open-index/open-npm huggingface dataset:
npm package: @gve/analytics
Description: Analytics events and constants to track system usage
Author: Matt Norris
Latest version: 0.4.4

# Analytics

Analytics events and constants to track system usage.

## Installation

Install with [npm](https://www.npmjs.com/).

```bash
npm i @gve/analtyics
```

## Usage

```js
const { AnalyticsEvent, EVENTS } = require("@gve/analytics");

const analyticsEvent = new AnalyticsEvent(EVENTS.MESSAGE_SENT);
```

## License

[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)
npm package: @gve/bot-commands
Description: Create responsive bot commands with ease
Author: Matt Norris
Latest version: 0.5.4

# Bot commands

Create responsive bot commands with ease.

## Installation

Install with [npm](https://www.npmjs.com/).

```bash
npm i @gve/bot-commands
```

## Usage

```js
const { Command } = require("@gve/bot-commands");

const phrases = ["hello", "hi", "hey"];

class Hello extends Command {
  constructor(intent = "hello", config = { phrases }) {
    super(intent, config);
    this.handleText = this.sayHello.bind(this);
  }

  async sayHello(bot, message) {
    await bot.say("Hello 👋");
  }
}
```

## License

[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)
npm package: @gve/bot-middleware
Description: Middleware to intercept messages, e.g., gather and send analytics
Author: Matt Norris
Latest version: 0.6.4

# Bot middleware

Middleware to intercept messages. For example, gather and send analytics.

## Installation

Install with [npm](https://www.npmjs.com/).

```bash
npm i @gve/bot-middleware
```

## Usage

```js
// Create a Webex bot with Botkit.

const { Botkit } = require("botkit");
const { WebexAdapter } = require("botbuilder-adapter-webex");

const adapter = new WebexAdapter({
  access_token: "<BOT_ACCESS_TOKEN>",
  public_address: "<BOT_URL>",
  secret: "<BOT_SECRET>",
});

const controller = new Botkit({
  adapter,
  webhook_uri: "/api/messages",
});

// Use the product analytics middleware. 👇

const { Analytics } = require("@gve/bot-middleware");

const analyticsMiddleware = new Analytics("<ANALYTICS_API_KEY>");
controller.middleware.receive.use(analyticsMiddleware.trackUserMessage);
controller.middleware.send.use(analyticsMiddleware.trackBotMessage);
```

Now basic properties from all messages are automatically ✨ sent to analytics, including:

- message ID
- message time
- sender's domain, e.g., cisco.com
- if the conversation is one-on-one or in a group
- more!

## License

[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)
npm package: @gve/bridge
Description: Bridge two or more Lerna monorepos so you can develop in all of them simultaneously
Author: Matt Norris
Latest version: 0.4.4
Deprecated: No longer supported. Create symbolic links between monorepos instead.

# Bridge

"Bridge" two or more [Lerna](https://github.com/lerna/lerna) monorepos so that you can develop in all of them simultaneously.

## Installation

Install with [npm](https://www.npmjs.com/).

```bash
npm i -D @gve/bridge
```

## Usage

Point the bridge at the path of the source code you want to use. For example, the `packages` directory of another monorepo.

```bash
export SOURCE_DIR="~/path/to/other/monorepo/packages"
npx bridge ${SOURCE_DIR}
```

`bridge` will:

- Copy the packages into a sub-directory of the current monorepo.
- Update `.gitignore` to ignore them when committing.
- Update `lerna.json` to ignore them when publishing packages.

## Rationale

[Read the rationale](docs/rationale.md) for this approach.

## License

[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)
npm package: @gve/cards
Description: Create Adaptive Cards, components, and rich messages for bot platforms and more
Author: Matt Norris
Latest version: 0.7.4

# Cards

Create [Adaptive Cards](https://adaptivecards.io/), components, and rich messages for bot platforms and more - without having to remember the [boilerplate](https://docs.microsoft.com/en-us/adaptive-cards/authoring-cards/getting-started#example-card).

## Installation

Install with [npm](https://www.npmjs.com/).

```bash
npm i @gve/cards
```

## Usage

```js
const { Card, Header, Property } = require("@gve/cards");

class RookieCard extends Card {
  constructor(playerName, team, position) {
    super();
    this.body = [
      type: "Container",
      items: [
        new Header(`${playerName}'s Rookie Card`),
        {
          type: "FactSet",
          facts: [
            new Property("Player", playerName),
            new Property("Team", team),
            new Property("Position", position),
          ]
        },
      ]
    ];
  }
}
```

## License

[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)
npm package: @gve/core
Description: Helpful functions to reduce parsing and errors
Author: Matt Norris
Latest version: 0.4.4

# Core

Use helpful functions to reduce parsing and errors.

## Installation

Install with [npm](https://www.npmjs.com/).

```bash
npm i @gve/core
```

## Usage

```js
const { getDomain } = require("@gve/core");

const malformedUrl = "://www.cisco.com/c/en/us/products/datasheet.html";
const domain = getDomain(malformedUrl);
console.log(domain);
```

Prints `cisco.com`.

## License

[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)
npm package: @gve/google
Description: Utilities to work easily with [Google Cloud](https://cloud.google.com/).
Author: Matt Norris
Latest version: 0.3.4

# Google

Utilities to work easily with [Google Cloud](https://cloud.google.com/).

## Installation

Install with [npm](https://www.npmjs.com/).

```bash
npm i @gve/google
```

## Usage

The `auth` module attempts to get Google application credentials from the [environment variable](https://cloud.google.com/docs/authentication/getting-started#setting_the_environment_variable) `GOOGLE_APPLICATION_CREDENTIALS`. If that fails, it looks for `GVE_GOOGLE_EMAIL` and `GVE_GOOGLE_KEY` to get them.

```js
const { auth: googleAuth } = require("@gve/google");
const dialogflow = require("@google-cloud/dialogflow");

const config = { credentials: googleAuth.credentials };
const sessionsClient = new dialogflow.SessionsClient(config);
```

## License

[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)
npm package: @gve/salesforce
Description: Query and update Salesforcewith built-in retries
Author: Matt Norris
Latest version: 0.6.4

# Salesforce

Query and update [Salesforce](https://www.salesforce.com/) with built-in retries.

## Installation

Install with [npm](https://www.npmjs.com/).

```bash
npm i @gve/salesforce
```

## Usage

```js
const { Salesforce, DirectAdapter } = require("@gve/salesforce");

const adapter = new DirectAdapter("<USERNAME>", "<PASSWORD>", "<URL>");
const salesforce = new Salesforce(SALESFORCE_URL, adapter);

salesforce
  .login()
  .then(() => {
    console.info("Salesforce connected");
  })
  .then(() => {
    const users = await salesforce.users.get("<Salesforce User ID>");
    console.log(users);
  })
  .catch((error) => {
    console.error("Salesforce not connected");
    debug(error.message);
  });
```

## License

[Apache 2.0](https://choosealicense.com/licenses/apache-2.0/)