open-index/open-npm huggingface dataset:
npm package: @fvlab/configuration-store-service
Description: SDK to access a GraphQL-api implementation of the configuration store
Author: FairVentures Lab
Latest version: 1.0.2

# configuration-store-service

An SDK for access a particular type of configuration-store api/service that has been implemented in GraphQL.

# Usage

## Create and initialize the object.

```ts
const currentUserId = '1234';
const settings = new ConfigurationStoreService('url of remote configuration store graphql service', currentUserId);
return settings.init().then(() => {...});
```

## Retrieve values by key or get it's default value if a value doesn't exist for the key.

```ts
return settings.getGlobalData('someKey', 'default value')
.then(globalValue => ...);
```

```ts
return settings.getUserData('someOtherKey', 'default value')
.then(userValue => ...);
```

## Set the key-value pair.

```ts
return settings.setGlobalData('someKey', 'some value')
.then(globalValue => ...);
```

```ts
return settings.setUserData('someOtherKey', 'some value')
.then(userValue => ...);
```
npm package: @fvlab/configurationstore
Description: Models, interfaces and base classes to support basic key-value configuration storage at global and user levels
Author: FairVentures Lab
Latest version: 1.0.6

# configurationStore

Simple interface for storing settings or document storage using your whatever backend you want to implement. Global configurations will be stored under `/internal/global/` and user-specific configurations will be stored under `/internal/user/<userId>`. The paths can be configured by passing optional arguments to the constructor.

There is a `MockConfigurationStore` class to use as placeholder until you get the intended configuration store setup. It stores configuration in memory.

# Implementing a configuration store

Implement the `IConfigurationStore` or extend the `BaseConfigurationStore` class. Implement at least the following:

1. `setData<T>(settingsPath: string, value: T): Promise<T>`

   Overwrites the endpoint in the database. If path does not exist it should be created.

1. `updateData<T>(settingsPath: string, value: T): Promise<T>`

   Adds the value to the endpoint without overwriting existing data. If path does not exist it should be created

1. `getData<T>(settingsPath: string, defaultValue?: T): Promise<T>`

   Gets the value of the specified endpoint. If endpoint does not exist, it should be created with the `defaultValue`

```ts
class YourConfigurationStore extends BaseConfigurationStore {
  ...
}

const settings = new YourConfigurationStore(...);
...
```

## Retrieve values by key or get it's default value if a value doesn't exist for the key.

```ts
return settings.getGlobalData('someKey', 'default value')
.then(globalValue => ...);
```

```ts
return settings.getUserData('someOtherKey', 'default value')
.then(userValue => ...);
```

## Set the key-value pair, overwriting the endpoint.

```ts
return settings.setGlobalData('someKey', 'some value')
.then(globalValue => ...);
```

```ts
return settings.setUserData('someOtherKey', 'some value')
.then(userValue => ...);
```

## Update the endpoint with some value, without overwriting existing data

```ts
return settings.updateGlobalData('someKey', 'some value')
.then(globalValue => ...);
```

```ts
return settings.updateUserData('someKey', 'some value')
.then(userValue => ...);
```
npm package: @fvlab/dialogflow-response-builder
Description: A set of tools to abstract the building of responses for Dialogflow fulfilment logic
Author: FVLab
Latest version: 1.0.1

# Dialogflow Response Builder

This typescript, npm-package project provides a set of tools to help construct reponses in your Dialogflow fulfillment logic.
The `IResponseBuilder` abstraction normalizes responses to a set of response types that translates to various native types
based on the agent that is detected in the firebase fulfillment request.
Currently, Actions-on-Google (AoG) is a specific agent that is specifically supported; otherwise the fall back assumed to be a generic Webhook agent.

The supplied `defaultResponseBuilder` represents a vanilla brand for your responses. Build you own brand by designing your own response builder implementing `IResponseBuilder`. Branding includes the pattern, formatting, wording, etc. of response messages.

## Fulfillment handlers

There is also a `FulfillmentHandler` class to abstract away the process of invoking handlers based on the givent intent. Here is an example usage of `FulfillmentHandler` in a `Firebase functions` endpoint.

```js
import * as functions from 'firebase-functions';
import { FulfillmentHandler, IntentHandler } from '@fvlab/dialogflow-response-builder';
import { myHandler } from './handlers/myHandler'; // you provide this

// Define the intent-to-handler mappings
const intentHandlers: IntentHandler[] = [
  { intent: 'statistics.premium.byBroker', actionHandler: new myHandler() }
  // Add more intent to handler mappings here.
];

// This is the definition for the firebase (REST) endpoint that should be registered in your dialogflow project.
export const dialogflowFirebaseFulfillment = functions.https.onRequest((req, res) => {
  new FulfillmentHandler(...intentHandlers).handleFulfillment(req, res);
});
```

## Action handlers

To build your action handlers just create classes that implement the `IActionHanlder` interface. There is also a `BaseHandler` class that you can inherit from to help with response building.