@zwerm/bot-configs-schema
Advanced tools
Comparing version 3.0.0 to 3.1.0
export declare namespace BotsSchema { | ||
/** | ||
* This file was automatically generated by json-schema-to-typescript. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run json-schema-to-typescript to regenerate this file. | ||
*/ | ||
/* tslint:disable */ | ||
/** | ||
* This file was automatically generated by json-schema-to-typescript. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run json-schema-to-typescript to regenerate this file. | ||
*/ | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-engine". | ||
*/ | ||
export type BotEngine = AwsLexEngine | DialogflowEngine | WatsonEngine; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "adapter-label". | ||
*/ | ||
export type AdapterLabel = string | null; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-region-lex". | ||
*/ | ||
export type AwsRegionLex = 'us-east-1' | 'us-west-2' | 'eu-west-1'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-engine-settings". | ||
*/ | ||
export type DialogflowEngineSettings = | ||
| DialogflowEngineSettingsV1 | ||
| DialogflowEngineSettingsV2; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-engine-settings". | ||
*/ | ||
export type WatsonEngineSettings = | ||
| WatsonEngineSettingsV1 | ||
| WatsonEngineSettingsV2; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-polly-voice". | ||
*/ | ||
export type AwsPollyVoice = | ||
| 'Geraint' | ||
| 'Gwyneth' | ||
| 'Mads' | ||
| 'Naja' | ||
| 'Hans' | ||
| 'Marlene' | ||
| 'Nicole' | ||
| 'Russell' | ||
| 'Amy' | ||
| 'Brian' | ||
| 'Emma' | ||
| 'Raveena' | ||
| 'Ivy' | ||
| 'Joanna' | ||
| 'Joey' | ||
| 'Justin' | ||
| 'Kendra' | ||
| 'Kimberly' | ||
| 'Matthew' | ||
| 'Salli' | ||
| 'Conchita' | ||
| 'Enrique' | ||
| 'Miguel' | ||
| 'Penelope' | ||
| 'Chantal' | ||
| 'Celine' | ||
| 'Mathieu' | ||
| 'Dora' | ||
| 'Karl' | ||
| 'Carla' | ||
| 'Giorgio' | ||
| 'Mizuki' | ||
| 'Liv' | ||
| 'Lotte' | ||
| 'Ruben' | ||
| 'Ewa' | ||
| 'Jacek' | ||
| 'Jan' | ||
| 'Maja' | ||
| 'Ricardo' | ||
| 'Vitoria' | ||
| 'Cristiano' | ||
| 'Ines' | ||
| 'Carmen' | ||
| 'Maxim' | ||
| 'Tatyana' | ||
| 'Astrid' | ||
| 'Filiz' | ||
| 'Vicki' | ||
| 'Takumi' | ||
| 'Seoyeon' | ||
| 'Aditi'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-region-polly". | ||
*/ | ||
export type AwsRegionPolly = | ||
| 'us-east-1' | ||
| 'us-east-2' | ||
| 'us-west-1' | ||
| 'us-west-2' | ||
| 'ca-central-1' | ||
| 'eu-west-1' | ||
| 'eu-central-1' | ||
| 'eu-west-2' | ||
| 'eu-west-3' | ||
| 'ap-northeast-1' | ||
| 'ap-northeast-2' | ||
| 'ap-southeast-1' | ||
| 'ap-southeast-2' | ||
| 'ap-south-1' | ||
| 'sa-east-1'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-channel". | ||
*/ | ||
export type BotChannel = | ||
| ApiChannel | ||
| WebchatChannel | ||
| FacebookChannel | ||
| KikChannel | ||
| SlackChannel; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-region". | ||
*/ | ||
export type AwsRegion = | ||
| 'us-east-1' | ||
| 'us-east-2' | ||
| 'us-west-1' | ||
| 'us-west-2' | ||
| 'ca-central-1' | ||
| 'eu-west-1' | ||
| 'eu-central-1' | ||
| 'eu-west-2' | ||
| 'eu-west-3' | ||
| 'ap-northeast-1' | ||
| 'ap-northeast-2' | ||
| 'ap-southeast-1' | ||
| 'ap-southeast-2' | ||
| 'ap-south-1' | ||
| 'sa-east-1'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-api-version". | ||
*/ | ||
export type DialogflowApiVersion = 'v1' | 'v2'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-api-version". | ||
*/ | ||
export type WatsonApiVersion = '2018-02-16' | '2018-09-19'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-engine-settings". | ||
*/ | ||
export type BotEngineSettings = | ||
| AwsLexEngineSettings | ||
| DialogflowEngineSettings | ||
| WatsonEngineSettings; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-channel-settings". | ||
*/ | ||
export type BotChannelSettings = | ||
| ApiChannelSettings | ||
| WebchatChannelSettings | ||
| FacebookChannelSettings | ||
| KikChannelSettings | ||
| SlackChannelSettings; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-engine". | ||
*/ | ||
export type BotEngine = AwsLexEngine | DialogflowEngine | WatsonEngine; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "adapter-label". | ||
*/ | ||
export type AdapterLabel = string | null; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-region-lex". | ||
*/ | ||
export type AwsRegionLex = | ||
| 'us-east-1' | ||
| 'us-west-2' | ||
| 'eu-west-1' | ||
| 'ap-southeast-2'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-engine-settings". | ||
*/ | ||
export type DialogflowEngineSettings = | ||
| DialogflowEngineSettingsV1 | ||
| DialogflowEngineSettingsV2; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-engine-settings". | ||
*/ | ||
export type WatsonEngineSettings = | ||
| WatsonEngineSettingsV1 | ||
| WatsonEngineSettingsV2; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-polly-voice". | ||
*/ | ||
export type AwsPollyVoice = | ||
| 'Aditi' | ||
| 'Amy' | ||
| 'Astrid' | ||
| 'Bianca' | ||
| 'Brian' | ||
| 'Camila' | ||
| 'Carla' | ||
| 'Carmen' | ||
| 'Celine' | ||
| 'Chantal' | ||
| 'Conchita' | ||
| 'Cristiano' | ||
| 'Dora' | ||
| 'Emma' | ||
| 'Enrique' | ||
| 'Ewa' | ||
| 'Filiz' | ||
| 'Geraint' | ||
| 'Giorgio' | ||
| 'Gwyneth' | ||
| 'Hans' | ||
| 'Ines' | ||
| 'Ivy' | ||
| 'Jacek' | ||
| 'Jan' | ||
| 'Joanna' | ||
| 'Joey' | ||
| 'Justin' | ||
| 'Karl' | ||
| 'Kendra' | ||
| 'Kimberly' | ||
| 'Lea' | ||
| 'Liv' | ||
| 'Lotte' | ||
| 'Lucia' | ||
| 'Lupe' | ||
| 'Mads' | ||
| 'Maja' | ||
| 'Marlene' | ||
| 'Mathieu' | ||
| 'Matthew' | ||
| 'Maxim' | ||
| 'Mia' | ||
| 'Miguel' | ||
| 'Mizuki' | ||
| 'Naja' | ||
| 'Nicole' | ||
| 'Penelope' | ||
| 'Raveena' | ||
| 'Ricardo' | ||
| 'Ruben' | ||
| 'Russell' | ||
| 'Salli' | ||
| 'Seoyeon' | ||
| 'Takumi' | ||
| 'Tatyana' | ||
| 'Vicki' | ||
| 'Vitoria' | ||
| 'Zeina' | ||
| 'Zhiyu'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-region-polly". | ||
*/ | ||
export type AwsRegionPolly = | ||
| 'eu-north-1' | ||
| 'ap-south-1' | ||
| 'eu-west-3' | ||
| 'eu-west-2' | ||
| 'eu-west-1' | ||
| 'ap-northeast-2' | ||
| 'ap-northeast-1' | ||
| 'sa-east-1' | ||
| 'ca-central-1' | ||
| 'ap-southeast-1' | ||
| 'ap-southeast-2' | ||
| 'eu-central-1' | ||
| 'us-east-1' | ||
| 'us-east-2' | ||
| 'us-west-1' | ||
| 'us-west-2'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-channel". | ||
*/ | ||
export type BotChannel = | ||
| ApiChannel | ||
| WebchatChannel | ||
| FacebookChannel | ||
| KikChannel | ||
| SlackChannel; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-region". | ||
*/ | ||
export type AwsRegion = | ||
| 'eu-north-1' | ||
| 'ap-south-1' | ||
| 'eu-west-3' | ||
| 'eu-west-2' | ||
| 'eu-west-1' | ||
| 'ap-northeast-2' | ||
| 'ap-northeast-1' | ||
| 'sa-east-1' | ||
| 'ca-central-1' | ||
| 'ap-southeast-1' | ||
| 'ap-southeast-2' | ||
| 'eu-central-1' | ||
| 'us-east-1' | ||
| 'us-east-2' | ||
| 'us-west-1' | ||
| 'us-west-2'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-api-version". | ||
*/ | ||
export type DialogflowApiVersion = 'v1' | 'v2'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-api-version". | ||
*/ | ||
export type WatsonApiVersion = '2018-02-16' | '2018-09-19'; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-engine-settings". | ||
*/ | ||
export type BotEngineSettings = | ||
| AwsLexEngineSettings | ||
| DialogflowEngineSettings | ||
| WatsonEngineSettings; | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-channel-settings". | ||
*/ | ||
export type BotChannelSettings = | ||
| ApiChannelSettings | ||
| WebchatChannelSettings | ||
| FacebookChannelSettings | ||
| KikChannelSettings | ||
| SlackChannelSettings; | ||
export interface BotConfig { | ||
name: string; | ||
team: string; | ||
engines: BotEngines; | ||
options: BotOptions; | ||
channels: BotChannels; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-engines". | ||
*/ | ||
export interface BotEngines { | ||
[k: string]: BotEngine; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-lex-engine". | ||
*/ | ||
export interface AwsLexEngine { | ||
service: 'amazon-lex' | 'aws-lex'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: AwsLexEngineSettings; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-lex-engine-settings". | ||
*/ | ||
export interface AwsLexEngineSettings { | ||
botName: string; | ||
botAlias: string; | ||
awsRegion: AwsRegionLex; | ||
awsCredentials: AwsCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-credentials". | ||
*/ | ||
export interface AwsCredentials { | ||
awsAccessKeyId: string; | ||
awsSecretAccessKey: string; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-engine". | ||
*/ | ||
export interface DialogflowEngine { | ||
service: 'dialogflow'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: DialogflowEngineSettings; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-engine-settings-v1". | ||
*/ | ||
export interface DialogflowEngineSettingsV1 { | ||
apiVersion: 'v1'; | ||
clientToken: string; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-engine-settings-v2". | ||
*/ | ||
export interface DialogflowEngineSettingsV2 { | ||
apiVersion: 'v2'; | ||
dialogflowCredentials: DialogflowCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-credentials". | ||
*/ | ||
export interface DialogflowCredentials { | ||
type?: string; | ||
project_id: string; | ||
private_key_id?: string; | ||
private_key: string; | ||
client_email: string; | ||
client_id?: string; | ||
auth_uri?: string; | ||
token_uri?: string; | ||
auth_provider_x509_cert_url?: string; | ||
client_x509_cert_url?: string; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-engine". | ||
*/ | ||
export interface WatsonEngine { | ||
service: 'watson'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: WatsonEngineSettings; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-engine-settings-v1". | ||
*/ | ||
export interface WatsonEngineSettingsV1 { | ||
apiVersion: '2018-02-16'; | ||
watsonCredentials: WatsonCredentials; | ||
workspaceId: string; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-credentials". | ||
*/ | ||
export interface WatsonCredentials { | ||
apikey?: string; | ||
iam_apikey_description?: string; | ||
iam_apikey_name?: string; | ||
iam_role_crn?: string; | ||
iam_serviceid_crn?: string; | ||
url?: string; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-engine-settings-v2". | ||
*/ | ||
export interface WatsonEngineSettingsV2 { | ||
apiVersion: '2018-09-19'; | ||
watsonCredentials: WatsonCredentials; | ||
assistantId: string; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-options". | ||
*/ | ||
export interface BotOptions { | ||
defaultEngine: string; | ||
defaultConversationLifetime?: number; | ||
icon?: string | null; | ||
supportedSystemEvents?: string[]; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-channels". | ||
*/ | ||
export interface BotChannels { | ||
[k: string]: BotChannel; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "api-channel". | ||
*/ | ||
export interface ApiChannel { | ||
service: 'api'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: ApiChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "api-channel-settings". | ||
*/ | ||
export interface ApiChannelSettings { | ||
webhook: string; | ||
authToken: string; | ||
shouldSendPreAndPostQueryTypingMessages?: boolean; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "webchat-channel". | ||
*/ | ||
export interface WebchatChannel { | ||
service: 'webchat'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: WebchatChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "webchat-channel-settings". | ||
*/ | ||
export interface WebchatChannelSettings { | ||
authToken: string; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
icon?: string | null; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "facebook-channel". | ||
*/ | ||
export interface FacebookChannel { | ||
service: 'facebook'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: FacebookChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "facebook-channel-settings". | ||
*/ | ||
export interface FacebookChannelSettings { | ||
verifyToken: string; | ||
pageToken: string; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "kik-channel". | ||
*/ | ||
export interface KikChannel { | ||
service: 'kik'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: KikChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "kik-channel-settings". | ||
*/ | ||
export interface KikChannelSettings { | ||
userName: string; | ||
apiKey: string; | ||
manuallySendReadReceipts?: boolean; | ||
receiveReadReceipts?: boolean; | ||
receiveDeliveryReceipts?: boolean; | ||
receiveIsTyping?: boolean; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "slack-channel". | ||
*/ | ||
export interface SlackChannel { | ||
service: 'slack'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: SlackChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "slack-channel-settings". | ||
*/ | ||
export interface SlackChannelSettings { | ||
botUserToken: string; | ||
signingSecret: string; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bots". | ||
*/ | ||
export interface Bots { | ||
$schema?: string; | ||
[k: string]: BotConfig; | ||
} | ||
export interface BotConfig { | ||
name: string; | ||
team: string; | ||
engines: BotEngines; | ||
options: BotOptions; | ||
channels: BotChannels; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-engines". | ||
*/ | ||
export interface BotEngines { | ||
[k: string]: BotEngine; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-lex-engine". | ||
*/ | ||
export interface AwsLexEngine { | ||
service: 'amazon-lex' | 'aws-lex'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: AwsLexEngineSettings; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-lex-engine-settings". | ||
*/ | ||
export interface AwsLexEngineSettings { | ||
botName: string; | ||
botAlias: string; | ||
awsRegion: AwsRegionLex; | ||
awsCredentials: AwsCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "aws-credentials". | ||
*/ | ||
export interface AwsCredentials { | ||
awsAccessKeyId: string; | ||
awsSecretAccessKey: string; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-engine". | ||
*/ | ||
export interface DialogflowEngine { | ||
service: 'dialogflow'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: DialogflowEngineSettings; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-engine-settings-v1". | ||
*/ | ||
export interface DialogflowEngineSettingsV1 { | ||
apiVersion: 'v1'; | ||
clientToken: string; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-engine-settings-v2". | ||
*/ | ||
export interface DialogflowEngineSettingsV2 { | ||
apiVersion: 'v2'; | ||
dialogflowCredentials: DialogflowCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "dialogflow-credentials". | ||
*/ | ||
export interface DialogflowCredentials { | ||
type?: string; | ||
project_id: string; | ||
private_key_id?: string; | ||
private_key: string; | ||
client_email: string; | ||
client_id?: string; | ||
auth_uri?: string; | ||
token_uri?: string; | ||
auth_provider_x509_cert_url?: string; | ||
client_x509_cert_url?: string; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-engine". | ||
*/ | ||
export interface WatsonEngine { | ||
service: 'watson'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: WatsonEngineSettings; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-engine-settings-v1". | ||
*/ | ||
export interface WatsonEngineSettingsV1 { | ||
apiVersion: '2018-02-16'; | ||
watsonCredentials: WatsonCredentials; | ||
workspaceId: string; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-credentials". | ||
*/ | ||
export interface WatsonCredentials { | ||
apikey: string; | ||
iam_apikey_description: string; | ||
iam_apikey_name: string; | ||
iam_role_crn: string; | ||
iam_serviceid_crn: string; | ||
url: string; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "watson-engine-settings-v2". | ||
*/ | ||
export interface WatsonEngineSettingsV2 { | ||
apiVersion: '2018-09-19'; | ||
watsonCredentials: WatsonCredentials; | ||
assistantId: string; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-options". | ||
*/ | ||
export interface BotOptions { | ||
defaultEngine: string; | ||
defaultConversationLifetime?: number; | ||
icon?: string | null; | ||
supportedSystemEvents?: string[] | null; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
[k: string]: any; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bot-channels". | ||
*/ | ||
export interface BotChannels { | ||
[k: string]: BotChannel; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "api-channel". | ||
*/ | ||
export interface ApiChannel { | ||
service: 'api'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: ApiChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "api-channel-settings". | ||
*/ | ||
export interface ApiChannelSettings { | ||
webhook: string; | ||
authToken: string; | ||
shouldSendPreAndPostQueryTypingMessages?: boolean; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "webchat-channel". | ||
*/ | ||
export interface WebchatChannel { | ||
service: 'webchat'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: WebchatChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "webchat-channel-settings". | ||
*/ | ||
export interface WebchatChannelSettings { | ||
authToken: string; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
icon?: string | null; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "facebook-channel". | ||
*/ | ||
export interface FacebookChannel { | ||
service: 'facebook'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: FacebookChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "facebook-channel-settings". | ||
*/ | ||
export interface FacebookChannelSettings { | ||
verifyToken: string; | ||
pageToken: string; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "kik-channel". | ||
*/ | ||
export interface KikChannel { | ||
service: 'kik'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: KikChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "kik-channel-settings". | ||
*/ | ||
export interface KikChannelSettings { | ||
userName: string; | ||
apiKey: string; | ||
manuallySendReadReceipts?: boolean; | ||
receiveReadReceipts?: boolean; | ||
receiveDeliveryReceipts?: boolean; | ||
receiveIsTyping?: boolean; | ||
awsVoice?: AwsPollyVoice; | ||
awsRegion?: AwsRegionPolly; | ||
awsCredentials?: AwsCredentials; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "slack-channel". | ||
*/ | ||
export interface SlackChannel { | ||
service: 'slack'; | ||
label?: AdapterLabel; | ||
hidden?: boolean; | ||
settings: SlackChannelSettings; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "slack-channel-settings". | ||
*/ | ||
export interface SlackChannelSettings { | ||
botUserToken: string; | ||
signingSecret: string; | ||
} | ||
/** | ||
* This interface was referenced by `BotConfig`'s JSON-Schema | ||
* via the `definition` "bots". | ||
*/ | ||
export interface Bots { | ||
$schema?: string; | ||
[k: string]: BotConfig; | ||
} | ||
export type BotOptionKey = keyof BotOptions; | ||
export type BotOptionValue<key extends keyof BotOptions> = BotOptions[key]; | ||
export type BotOptionKey = keyof BotOptions; | ||
export type BotOptionValue<key extends keyof BotOptions> = BotOptions[key]; | ||
} |
{ | ||
"$schema": "http://json-schema.org/draft-06/schema#", | ||
"title": "bot-config", | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string" }, | ||
"team": { "type": "string" }, | ||
"engines": { "$ref": "#/definitions/bot-engines" }, | ||
"options": { "$ref": "#/definitions/bot-options" }, | ||
"channels": { "$ref": "#/definitions/bot-channels" } | ||
"$schema": "http://json-schema.org/draft-06/schema#", | ||
"title": "bot-config", | ||
"type": "object", | ||
"properties": { | ||
"name": { "type": "string" }, | ||
"team": { "type": "string" }, | ||
"engines": { "$ref": "#/definitions/bot-engines" }, | ||
"options": { "$ref": "#/definitions/bot-options" }, | ||
"channels": { "$ref": "#/definitions/bot-channels" } | ||
}, | ||
"required": ["name", "team", "engines", "options", "channels"], | ||
"definitions": { | ||
"adapter-label": { "type": ["string", "null"] }, | ||
"aws-polly-voice": { | ||
"$comment": "all the possible voices supported by aws-polly", | ||
"type": "string", | ||
"enum": [ | ||
"Aditi", | ||
"Amy", | ||
"Astrid", | ||
"Bianca", | ||
"Brian", | ||
"Camila", | ||
"Carla", | ||
"Carmen", | ||
"Celine", | ||
"Chantal", | ||
"Conchita", | ||
"Cristiano", | ||
"Dora", | ||
"Emma", | ||
"Enrique", | ||
"Ewa", | ||
"Filiz", | ||
"Geraint", | ||
"Giorgio", | ||
"Gwyneth", | ||
"Hans", | ||
"Ines", | ||
"Ivy", | ||
"Jacek", | ||
"Jan", | ||
"Joanna", | ||
"Joey", | ||
"Justin", | ||
"Karl", | ||
"Kendra", | ||
"Kimberly", | ||
"Lea", | ||
"Liv", | ||
"Lotte", | ||
"Lucia", | ||
"Lupe", | ||
"Mads", | ||
"Maja", | ||
"Marlene", | ||
"Mathieu", | ||
"Matthew", | ||
"Maxim", | ||
"Mia", | ||
"Miguel", | ||
"Mizuki", | ||
"Naja", | ||
"Nicole", | ||
"Penelope", | ||
"Raveena", | ||
"Ricardo", | ||
"Ruben", | ||
"Russell", | ||
"Salli", | ||
"Seoyeon", | ||
"Takumi", | ||
"Tatyana", | ||
"Vicki", | ||
"Vitoria", | ||
"Zeina", | ||
"Zhiyu" | ||
] | ||
}, | ||
"required": [ "name", "team", "engines", "options", "channels" ], | ||
"definitions": { | ||
"adapter-label": { "type": [ "string", "null" ] }, | ||
"aws-polly-voice": { | ||
"$comment": "all the possible voices supported by aws-polly", | ||
"type": "string", | ||
"enum": [ | ||
"Geraint", | ||
"Gwyneth", | ||
"Mads", | ||
"Naja", | ||
"Hans", | ||
"Marlene", | ||
"Nicole", | ||
"Russell", | ||
"Amy", | ||
"Brian", | ||
"Emma", | ||
"Raveena", | ||
"Ivy", | ||
"Joanna", | ||
"Joey", | ||
"Justin", | ||
"Kendra", | ||
"Kimberly", | ||
"Matthew", | ||
"Salli", | ||
"Conchita", | ||
"Enrique", | ||
"Miguel", | ||
"Penelope", | ||
"Chantal", | ||
"Celine", | ||
"Mathieu", | ||
"Dora", | ||
"Karl", | ||
"Carla", | ||
"Giorgio", | ||
"Mizuki", | ||
"Liv", | ||
"Lotte", | ||
"Ruben", | ||
"Ewa", | ||
"Jacek", | ||
"Jan", | ||
"Maja", | ||
"Ricardo", | ||
"Vitoria", | ||
"Cristiano", | ||
"Ines", | ||
"Carmen", | ||
"Maxim", | ||
"Tatyana", | ||
"Astrid", | ||
"Filiz", | ||
"Vicki", | ||
"Takumi", | ||
"Seoyeon", | ||
"Aditi" | ||
] | ||
"aws-region": { | ||
"$comment": "all the possible regions offered by aws", | ||
"type": "string", | ||
"enum": [ | ||
"eu-north-1", | ||
"ap-south-1", | ||
"eu-west-3", | ||
"eu-west-2", | ||
"eu-west-1", | ||
"ap-northeast-2", | ||
"ap-northeast-1", | ||
"sa-east-1", | ||
"ca-central-1", | ||
"ap-southeast-1", | ||
"ap-southeast-2", | ||
"eu-central-1", | ||
"us-east-1", | ||
"us-east-2", | ||
"us-west-1", | ||
"us-west-2" | ||
] | ||
}, | ||
"aws-region-polly": { | ||
"$comment": "all the possible regions that aws-polly operates in", | ||
"type": "string", | ||
"enum": [ | ||
"eu-north-1", | ||
"ap-south-1", | ||
"eu-west-3", | ||
"eu-west-2", | ||
"eu-west-1", | ||
"ap-northeast-2", | ||
"ap-northeast-1", | ||
"sa-east-1", | ||
"ca-central-1", | ||
"ap-southeast-1", | ||
"ap-southeast-2", | ||
"eu-central-1", | ||
"us-east-1", | ||
"us-east-2", | ||
"us-west-1", | ||
"us-west-2" | ||
] | ||
}, | ||
"aws-region-lex": { | ||
"$comment": "all the possible regions that amazon-lex operates in", | ||
"type": "string", | ||
"enum": ["us-east-1", "us-west-2", "eu-west-1", "ap-southeast-2"] | ||
}, | ||
"aws-credentials": { | ||
"$comment": "object containing required settings for using aws services", | ||
"type": "object", | ||
"properties": { | ||
"awsAccessKeyId": { "type": "string" }, | ||
"awsSecretAccessKey": { "type": "string" } | ||
}, | ||
"required": ["awsAccessKeyId", "awsSecretAccessKey"] | ||
}, | ||
"dialogflow-credentials": { | ||
"$comment": "object containing required settings for using google cloud platform services", | ||
"type": "object", | ||
"properties": { | ||
"type": { "type": "string" }, | ||
"project_id": { "type": "string" }, | ||
"private_key_id": { "type": "string" }, | ||
"private_key": { "type": "string" }, | ||
"client_email": { "type": "string" }, | ||
"client_id": { "type": "string" }, | ||
"auth_uri": { "type": "string" }, | ||
"token_uri": { "type": "string" }, | ||
"auth_provider_x509_cert_url": { "type": "string" }, | ||
"client_x509_cert_url": { "type": "string" } | ||
}, | ||
"required": ["project_id", "private_key", "client_email"] | ||
}, | ||
"watson-credentials": { | ||
"$comment": "object containing required settings for using watson services", | ||
"type": "object", | ||
"properties": { | ||
"apikey": { "type": "string" }, | ||
"iam_apikey_description": { "type": "string" }, | ||
"iam_apikey_name": { "type": "string" }, | ||
"iam_role_crn": { "type": "string" }, | ||
"iam_serviceid_crn": { "type": "string" }, | ||
"url": { "type": "string" } | ||
}, | ||
"required": [ | ||
"apikey", | ||
"iam_apikey_description", | ||
"iam_apikey_name", | ||
"iam_role_crn", | ||
"iam_serviceid_crn", | ||
"url" | ||
] | ||
}, | ||
"dialogflow-api-version": { | ||
"type": "string", | ||
"enum": ["v1", "v2"] | ||
}, | ||
"watson-api-version": { | ||
"type": "string", | ||
"enum": ["2018-02-16", "2018-09-19"] | ||
}, | ||
"aws-lex-engine": { | ||
"$comment": "bot engine powered by the amazon-lex service", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": ["amazon-lex", "aws-lex"] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean", "default": false }, | ||
"settings": { "$ref": "#/definitions/aws-lex-engine-settings" } | ||
}, | ||
"required": ["service", "settings"] | ||
}, | ||
"aws-lex-engine-settings": { | ||
"$comment": "settings for the amazon-lex engine", | ||
"properties": { | ||
"botName": { "type": "string" }, | ||
"botAlias": { "type": "string" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-lex" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": ["botAlias", "botName", "awsRegion", "awsCredentials"], | ||
"additionalProperties": false | ||
}, | ||
"dialogflow-engine": { | ||
"$comment": "bot engine powered by the dialogflow service", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": ["dialogflow"] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean", "default": false }, | ||
"settings": { "$ref": "#/definitions/dialogflow-engine-settings" } | ||
}, | ||
"required": ["service", "settings"] | ||
}, | ||
"dialogflow-engine-settings": { | ||
"$comment": "settings for the dialogflow engine", | ||
"required": ["apiVersion"], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/dialogflow-engine-settings-v1" }, | ||
{ "$ref": "#/definitions/dialogflow-engine-settings-v2" } | ||
] | ||
}, | ||
"dialogflow-engine-settings-v1": { | ||
"$comment": "settings for the dialogflow engine", | ||
"properties": { | ||
"apiVersion": { "enum": ["v1"] }, | ||
"clientToken": { "type": "string" } | ||
}, | ||
"required": ["apiVersion", "clientToken"], | ||
"additionalProperties": false | ||
}, | ||
"dialogflow-engine-settings-v2": { | ||
"$comment": "settings for the dialogflow engine", | ||
"properties": { | ||
"apiVersion": { "enum": ["v2"] }, | ||
"dialogflowCredentials": { | ||
"$ref": "#/definitions/dialogflow-credentials" | ||
} | ||
}, | ||
"required": ["apiVersion", "dialogflowCredentials"], | ||
"additionalProperties": false | ||
}, | ||
"watson-engine": { | ||
"$comment": "bot engine powered by the watson service", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": ["watson"] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean", "default": false }, | ||
"settings": { "$ref": "#/definitions/watson-engine-settings" } | ||
}, | ||
"required": ["service", "settings"] | ||
}, | ||
"watson-engine-settings": { | ||
"$comment": "settings for the watson engine", | ||
"required": ["apiVersion", "watsonCredentials"], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/watson-engine-settings-v1" }, | ||
{ "$ref": "#/definitions/watson-engine-settings-v2" } | ||
] | ||
}, | ||
"watson-engine-settings-v1": { | ||
"$comment": "settings for the watson engine", | ||
"properties": { | ||
"apiVersion": { "enum": ["2018-02-16"] }, | ||
"watsonCredentials": { "$ref": "#/definitions/watson-credentials" }, | ||
"workspaceId": { "type": "string" } | ||
}, | ||
"required": ["apiVersion", "watsonCredentials", "workspaceId"], | ||
"additionalProperties": false | ||
}, | ||
"watson-engine-settings-v2": { | ||
"$comment": "settings for the watson engine", | ||
"properties": { | ||
"apiVersion": { "enum": ["2018-09-19"] }, | ||
"watsonCredentials": { "$ref": "#/definitions/watson-credentials" }, | ||
"assistantId": { "type": "string" } | ||
}, | ||
"required": ["apiVersion", "watsonCredentials", "assistantId"], | ||
"additionalProperties": false | ||
}, | ||
"api-channel": { | ||
"$comment": "bot channel powered by an API (for now, StaMP)", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": ["api"] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean" }, | ||
"settings": { "$ref": "#/definitions/api-channel-settings" } | ||
}, | ||
"required": ["service", "settings"], | ||
"additionalProperties": false | ||
}, | ||
"api-channel-settings": { | ||
"$comment": "settings for the api channel", | ||
"type": "object", | ||
"properties": { | ||
"webhook": { "type": "string" }, | ||
"authToken": { "type": "string" }, | ||
"shouldSendPreAndPostQueryTypingMessages": { | ||
"$comment": "should start and stop typing messages be sent to the server pre- and post- submission of query messages to the engine", | ||
"type": "boolean", | ||
"default": "true" | ||
}, | ||
"aws-region": { | ||
"$comment": "all the possible regions offered by aws", | ||
"type": "string", | ||
"enum": [ | ||
"us-east-1", | ||
"us-east-2", | ||
"us-west-1", | ||
"us-west-2", | ||
"ca-central-1", | ||
"eu-west-1", | ||
"eu-central-1", | ||
"eu-west-2", | ||
"eu-west-3", | ||
"ap-northeast-1", | ||
"ap-northeast-2", | ||
"ap-southeast-1", | ||
"ap-southeast-2", | ||
"ap-south-1", | ||
"sa-east-1" | ||
] | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": ["webhook", "authToken"], | ||
"additionalProperties": false | ||
}, | ||
"webchat-channel": { | ||
"$comment": "bot channel powered by WebChat", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": ["webchat"] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean" }, | ||
"settings": { "$ref": "#/definitions/webchat-channel-settings" } | ||
}, | ||
"required": ["service", "settings"], | ||
"additionalProperties": false | ||
}, | ||
"webchat-channel-settings": { | ||
"$comment": "settings for the WebChat channel", | ||
"type": "object", | ||
"properties": { | ||
"authToken": { "type": "string" }, | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" }, | ||
"icon": { "type": ["string", "null"] } | ||
}, | ||
"required": ["authToken"], | ||
"additionalProperties": false | ||
}, | ||
"facebook-channel": { | ||
"$comment": "bot channel powered by facebook", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": ["facebook"] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean", "default": false }, | ||
"settings": { "$ref": "#/definitions/facebook-channel-settings" } | ||
}, | ||
"required": ["service", "settings"], | ||
"additionalProperties": false | ||
}, | ||
"facebook-channel-settings": { | ||
"$comment": "settings for the facebook channel", | ||
"type": "object", | ||
"properties": { | ||
"verifyToken": { "type": "string" }, | ||
"pageToken": { "type": "string" }, | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": ["verifyToken", "pageToken"], | ||
"additionalProperties": false | ||
}, | ||
"kik-channel": { | ||
"$comment": "bot channel powered by Kik", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": ["kik"] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean" }, | ||
"settings": { "$ref": "#/definitions/kik-channel-settings" } | ||
}, | ||
"required": ["service", "settings"], | ||
"additionalProperties": false | ||
}, | ||
"kik-channel-settings": { | ||
"$comment": "settings for the kik channel", | ||
"type": "object", | ||
"properties": { | ||
"userName": { "type": "string" }, | ||
"apiKey": { "type": "string" }, | ||
"manuallySendReadReceipts": { "type": "boolean" }, | ||
"receiveReadReceipts": { "type": "boolean" }, | ||
"receiveDeliveryReceipts": { "type": "boolean" }, | ||
"receiveIsTyping": { "type": "boolean" }, | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": ["userName", "apiKey"], | ||
"additionalProperties": false | ||
}, | ||
"slack-channel": { | ||
"$comment": "bot channel powered by Slack", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": ["slack"] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean" }, | ||
"settings": { "$ref": "#/definitions/slack-channel-settings" } | ||
}, | ||
"required": ["service", "settings"], | ||
"additionalProperties": false | ||
}, | ||
"slack-channel-settings": { | ||
"$comment": "settings for the Slack channel", | ||
"type": "object", | ||
"properties": { | ||
"botUserToken": { "type": "string" }, | ||
"signingSecret": { "type": "string" } | ||
}, | ||
"required": ["botUserToken", "signingSecret"], | ||
"additionalProperties": false | ||
}, | ||
"bot-engines": { | ||
"$comment": "the possible engines a bot can have", | ||
"type": "object", | ||
"additionalProperties": { "$ref": "#/definitions/bot-engine" } | ||
}, | ||
"bot-engine": { | ||
"$comment": "all of the possible bot engines", | ||
"required": ["service"], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/aws-lex-engine" }, | ||
{ "$ref": "#/definitions/dialogflow-engine" }, | ||
{ "$ref": "#/definitions/watson-engine" } | ||
] | ||
}, | ||
"bot-engine-settings": { | ||
"$comment": "all of the possible bot engine settings", | ||
"$todo": "move the settings to their own definitions?", | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/aws-lex-engine-settings" }, | ||
{ "$ref": "#/definitions/dialogflow-engine-settings" }, | ||
{ "$ref": "#/definitions/watson-engine-settings" } | ||
] | ||
}, | ||
"bot-options": { | ||
"$comment": "general configuration options for the bot, that don't apply to specific engines or channels", | ||
"type": "object", | ||
"properties": { | ||
"defaultEngine": { "type": "string" }, | ||
"defaultConversationLifetime": { | ||
"type": "number", | ||
"multipleOf": 1, | ||
"minimum": 1, | ||
"maximum": 525600 | ||
}, | ||
"aws-region-polly": { | ||
"$comment": "all the possible regions that aws-polly operates in", | ||
"type": "string", | ||
"enum": [ | ||
"us-east-1", | ||
"us-east-2", | ||
"us-west-1", | ||
"us-west-2", | ||
"ca-central-1", | ||
"eu-west-1", | ||
"eu-central-1", | ||
"eu-west-2", | ||
"eu-west-3", | ||
"ap-northeast-1", | ||
"ap-northeast-2", | ||
"ap-southeast-1", | ||
"ap-southeast-2", | ||
"ap-south-1", | ||
"sa-east-1" | ||
] | ||
"icon": { "type": ["string", "null"] }, | ||
"supportedSystemEvents": { | ||
"type": ["array", "null"], | ||
"items": { "type": "string" } | ||
}, | ||
"aws-region-lex": { | ||
"$comment": "all the possible regions that amazon-lex operates in", | ||
"type": "string", | ||
"enum": [ | ||
"us-east-1", | ||
"us-west-2", | ||
"eu-west-1" | ||
] | ||
}, | ||
"aws-credentials": { | ||
"$comment": "object containing required settings for using aws services", | ||
"type": "object", | ||
"properties": { | ||
"awsAccessKeyId": { "type": "string" }, | ||
"awsSecretAccessKey": { "type": "string" } | ||
}, | ||
"required": [ "awsAccessKeyId", "awsSecretAccessKey" ] | ||
}, | ||
"dialogflow-credentials": { | ||
"$comment": "object containing required settings for using google cloud platform services", | ||
"type": "object", | ||
"properties": { | ||
"type": { "type": "string" }, | ||
"project_id": { "type": "string" }, | ||
"private_key_id": { "type": "string" }, | ||
"private_key": { "type": "string" }, | ||
"client_email": { "type": "string" }, | ||
"client_id": { "type": "string" }, | ||
"auth_uri": { "type": "string" }, | ||
"token_uri": { "type": "string" }, | ||
"auth_provider_x509_cert_url": { "type": "string" }, | ||
"client_x509_cert_url": { "type": "string" } | ||
}, | ||
"required": [ "project_id", "private_key", "client_email" ] | ||
}, | ||
"watson-credentials": { | ||
"$comment": "object containing required settings for using watson services", | ||
"type": "object", | ||
"properties": { | ||
"apikey": { "type": "string" }, | ||
"iam_apikey_description": { "type": "string" }, | ||
"iam_apikey_name": { "type": "string" }, | ||
"iam_role_crn": { "type": "string" }, | ||
"iam_serviceid_crn": { "type": "string" }, | ||
"url": { "type": "string" } | ||
}, | ||
"required": [ "apikey", "iam_apikey_description", "iam_apikey_name", "iam_role_crn", "iam_serviceid_crn", "url" ] | ||
}, | ||
"dialogflow-api-version": { | ||
"type": "string", | ||
"enum": [ "v1", "v2" ] | ||
}, | ||
"watson-api-version": { | ||
"type": "string", | ||
"enum": [ "2018-02-16", "2018-09-19" ] | ||
}, | ||
"aws-lex-engine": { | ||
"$comment": "bot engine powered by the amazon-lex service", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": [ "amazon-lex", "aws-lex" ] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean", "default": false }, | ||
"settings": { "$ref": "#/definitions/aws-lex-engine-settings" } | ||
}, | ||
"required": [ "service", "settings" ] | ||
}, | ||
"aws-lex-engine-settings": { | ||
"$comment": "settings for the amazon-lex engine", | ||
"properties": { | ||
"botName": { "type": "string" }, | ||
"botAlias": { "type": "string" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-lex" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": [ "botAlias", "botName", "awsRegion", "awsCredentials" ], | ||
"additionalProperties": false | ||
}, | ||
"dialogflow-engine": { | ||
"$comment": "bot engine powered by the dialogflow service", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": [ "dialogflow" ] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean", "default": false }, | ||
"settings": { "$ref": "#/definitions/dialogflow-engine-settings" } | ||
}, | ||
"required": [ "service", "settings" ] | ||
}, | ||
"dialogflow-engine-settings": { | ||
"$comment": "settings for the dialogflow engine", | ||
"required": [ "apiVersion" ], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/dialogflow-engine-settings-v1" }, | ||
{ "$ref": "#/definitions/dialogflow-engine-settings-v2" } | ||
] | ||
}, | ||
"dialogflow-engine-settings-v1": { | ||
"$comment": "settings for the dialogflow engine", | ||
"properties": { | ||
"apiVersion": { "enum": [ "v1" ] }, | ||
"clientToken": { "type": "string" } | ||
}, | ||
"required": [ "apiVersion", "clientToken" ], | ||
"additionalProperties": false | ||
}, | ||
"dialogflow-engine-settings-v2": { | ||
"$comment": "settings for the dialogflow engine", | ||
"properties": { | ||
"apiVersion": { "enum": [ "v2" ] }, | ||
"dialogflowCredentials": { "$ref": "#/definitions/dialogflow-credentials" } | ||
}, | ||
"required": [ "apiVersion", "dialogflowCredentials" ], | ||
"additionalProperties": false | ||
}, | ||
"watson-engine": { | ||
"$comment": "bot engine powered by the watson service", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": [ "watson" ] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean", "default": false }, | ||
"settings": { "$ref": "#/definitions/watson-engine-settings" } | ||
}, | ||
"required": [ "service", "settings" ] | ||
}, | ||
"watson-engine-settings": { | ||
"$comment": "settings for the watson engine", | ||
"required": [ "apiVersion", "watsonCredentials" ], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/watson-engine-settings-v1" }, | ||
{ "$ref": "#/definitions/watson-engine-settings-v2" } | ||
] | ||
}, | ||
"watson-engine-settings-v1": { | ||
"$comment": "settings for the watson engine", | ||
"properties": { | ||
"apiVersion": { "enum": [ "2018-02-16" ] }, | ||
"watsonCredentials": { "$ref": "#/definitions/watson-credentials" }, | ||
"workspaceId": { "type": "string" } | ||
}, | ||
"required": [ "apiVersion", "watsonCredentials", "workspaceId" ], | ||
"additionalProperties": false | ||
}, | ||
"watson-engine-settings-v2": { | ||
"$comment": "settings for the watson engine", | ||
"properties": { | ||
"apiVersion": { "enum": [ "2018-09-19" ] }, | ||
"watsonCredentials": { "$ref": "#/definitions/watson-credentials" }, | ||
"assistantId": { "type": "string" } | ||
}, | ||
"required": [ "apiVersion", "watsonCredentials", "assistantId" ], | ||
"additionalProperties": false | ||
}, | ||
"api-channel": { | ||
"$comment": "bot channel powered by an API (for now, StaMP)", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": [ "api" ] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean" }, | ||
"settings": { "$ref": "#/definitions/api-channel-settings" } | ||
}, | ||
"required": [ "service", "settings" ], | ||
"additionalProperties": false | ||
}, | ||
"api-channel-settings": { | ||
"$comment": "settings for the api channel", | ||
"type": "object", | ||
"properties": { | ||
"webhook": { "type": "string" }, | ||
"authToken": { "type": "string" }, | ||
"shouldSendPreAndPostQueryTypingMessages": { | ||
"$comment": "should start and stop typing messages be sent to the server pre- and post- submission of query messages to the engine", | ||
"type": "boolean", | ||
"default": "true" | ||
}, | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": [ "webhook", "authToken" ], | ||
"additionalProperties": false | ||
}, | ||
"webchat-channel": { | ||
"$comment": "bot channel powered by WebChat", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": [ "webchat" ] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean" }, | ||
"settings": { "$ref": "#/definitions/webchat-channel-settings" } | ||
}, | ||
"required": [ "service", "settings" ], | ||
"additionalProperties": false | ||
}, | ||
"webchat-channel-settings": { | ||
"$comment": "settings for the WebChat channel", | ||
"type": "object", | ||
"properties": { | ||
"authToken": { "type": "string" }, | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" }, | ||
"icon": { "type": [ "string", "null" ] } | ||
}, | ||
"required": [ "authToken" ], | ||
"additionalProperties": false | ||
}, | ||
"facebook-channel": { | ||
"$comment": "bot channel powered by facebook", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": [ "facebook" ] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean", "default": false }, | ||
"settings": { "$ref": "#/definitions/facebook-channel-settings" } | ||
}, | ||
"required": [ "service", "settings" ], | ||
"additionalProperties": false | ||
}, | ||
"facebook-channel-settings": { | ||
"$comment": "settings for the facebook channel", | ||
"type": "object", | ||
"properties": { | ||
"verifyToken": { "type": "string" }, | ||
"pageToken": { "type": "string" }, | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": [ "verifyToken", "pageToken" ], | ||
"additionalProperties": false | ||
}, | ||
"kik-channel": { | ||
"$comment": "bot channel powered by Kik", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": [ "kik" ] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean" }, | ||
"settings": { "$ref": "#/definitions/kik-channel-settings" } | ||
}, | ||
"required": [ "service", "settings" ], | ||
"additionalProperties": false | ||
}, | ||
"kik-channel-settings": { | ||
"$comment": "settings for the kik channel", | ||
"type": "object", | ||
"properties": { | ||
"userName": { "type": "string" }, | ||
"apiKey": { "type": "string" }, | ||
"manuallySendReadReceipts": { "type": "boolean" }, | ||
"receiveReadReceipts": { "type": "boolean" }, | ||
"receiveDeliveryReceipts": { "type": "boolean" }, | ||
"receiveIsTyping": { "type": "boolean" }, | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": [ "userName", "apiKey" ], | ||
"additionalProperties": false | ||
}, | ||
"slack-channel": { | ||
"$comment": "bot channel powered by Slack", | ||
"type": "object", | ||
"properties": { | ||
"service": { "enum": [ "slack" ] }, | ||
"label": { "$ref": "#/definitions/adapter-label" }, | ||
"hidden": { "type": "boolean" }, | ||
"settings": { "$ref": "#/definitions/slack-channel-settings" } | ||
}, | ||
"required": [ "service", "settings" ], | ||
"additionalProperties": false | ||
}, | ||
"slack-channel-settings": { | ||
"$comment": "settings for the Slack channel", | ||
"type": "object", | ||
"properties": { | ||
"botUserToken": { "type": "string" }, | ||
"signingSecret": { "type": "string" } | ||
}, | ||
"required": [ "botUserToken", "signingSecret" ], | ||
"additionalProperties": false | ||
}, | ||
"bot-engines": { | ||
"$comment": "the possible engines a bot can have", | ||
"type": "object", | ||
"additionalProperties": { "$ref": "#/definitions/bot-engine" } | ||
}, | ||
"bot-engine": { | ||
"$comment": "all of the possible bot engines", | ||
"required": [ "service" ], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/aws-lex-engine" }, | ||
{ "$ref": "#/definitions/dialogflow-engine" }, | ||
{ "$ref": "#/definitions/watson-engine" } | ||
] | ||
}, | ||
"bot-engine-settings": { | ||
"$comment": "all of the possible bot engine settings", | ||
"$todo": "move the settings to their own definitions?", | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/aws-lex-engine-settings" }, | ||
{ "$ref": "#/definitions/dialogflow-engine-settings" }, | ||
{ "$ref": "#/definitions/watson-engine-settings" } | ||
] | ||
}, | ||
"bot-options": { | ||
"$comment": "general configuration options for the bot, that don't apply to specific engines or channels", | ||
"type": "object", | ||
"properties": { | ||
"defaultEngine": { "type": "string" }, | ||
"defaultConversationLifetime": { | ||
"type": "number", | ||
"multipleOf": 1, | ||
"minimum": 1, | ||
"maximum": 525600 | ||
}, | ||
"icon": { "type": [ "string", "null" ] }, | ||
"supportedSystemEvents": { | ||
"type": [ "array", "null" ], | ||
"items": { "type": "string" } | ||
}, | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": [ "defaultEngine" ] | ||
}, | ||
"bot-channels": { | ||
"$comment": "the possible channels a bot can have", | ||
"type": "object", | ||
"additionalProperties": { "$ref": "#/definitions/bot-channel" } | ||
}, | ||
"bot-channel": { | ||
"$comment": "all of the possible bot channels", | ||
"required": [ "service" ], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/api-channel" }, | ||
{ "$ref": "#/definitions/webchat-channel" }, | ||
{ "$ref": "#/definitions/facebook-channel" }, | ||
{ "$ref": "#/definitions/kik-channel" }, | ||
{ "$ref": "#/definitions/slack-channel" } | ||
] | ||
}, | ||
"bot-channel-settings": { | ||
"$comment": "all of the possible bot channel settings", | ||
"required": [ "service" ], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/api-channel-settings" }, | ||
{ "$ref": "#/definitions/webchat-channel-settings" }, | ||
{ "$ref": "#/definitions/facebook-channel-settings" }, | ||
{ "$ref": "#/definitions/kik-channel-settings" }, | ||
{ "$ref": "#/definitions/slack-channel-settings" } | ||
] | ||
}, | ||
"bots": { | ||
"$comment": "definition of a map of bot-configs. mainly here so that it's included in typings", | ||
"type": "object", | ||
"properties": { | ||
"$schema": { "type": "string" } | ||
}, | ||
"additionalProperties": { "$ref": "#" } | ||
} | ||
"awsVoice": { "$ref": "#/definitions/aws-polly-voice" }, | ||
"awsRegion": { "$ref": "#/definitions/aws-region-polly" }, | ||
"awsCredentials": { "$ref": "#/definitions/aws-credentials" } | ||
}, | ||
"required": ["defaultEngine"] | ||
}, | ||
"bot-channels": { | ||
"$comment": "the possible channels a bot can have", | ||
"type": "object", | ||
"additionalProperties": { "$ref": "#/definitions/bot-channel" } | ||
}, | ||
"bot-channel": { | ||
"$comment": "all of the possible bot channels", | ||
"required": ["service"], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/api-channel" }, | ||
{ "$ref": "#/definitions/webchat-channel" }, | ||
{ "$ref": "#/definitions/facebook-channel" }, | ||
{ "$ref": "#/definitions/kik-channel" }, | ||
{ "$ref": "#/definitions/slack-channel" } | ||
] | ||
}, | ||
"bot-channel-settings": { | ||
"$comment": "all of the possible bot channel settings", | ||
"required": ["service"], | ||
"oneOf": [ | ||
{ "$ref": "#/definitions/api-channel-settings" }, | ||
{ "$ref": "#/definitions/webchat-channel-settings" }, | ||
{ "$ref": "#/definitions/facebook-channel-settings" }, | ||
{ "$ref": "#/definitions/kik-channel-settings" }, | ||
{ "$ref": "#/definitions/slack-channel-settings" } | ||
] | ||
}, | ||
"bots": { | ||
"$comment": "definition of a map of bot-configs. mainly here so that it's included in typings", | ||
"type": "object", | ||
"properties": { | ||
"$schema": { "type": "string" } | ||
}, | ||
"additionalProperties": { "$ref": "#" } | ||
} | ||
} | ||
} |
{ | ||
"$schema": "http://json-schema.org/draft-06/schema#", | ||
"$comment": "mainly here for ides like IntelliJ - won't compile with ajv-cli for some reason", | ||
"title": "bots-config", | ||
"$ref": "bot.schema.json#/definitions/bots" | ||
"$schema": "http://json-schema.org/draft-06/schema#", | ||
"$comment": "mainly here for ides like IntelliJ - won't compile with ajv-cli for some reason", | ||
"title": "bots-config", | ||
"$ref": "bot.schema.json#/definitions/bots" | ||
} |
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
and this project adheres to | ||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
## [Unreleased] | ||
## [3.1.0] - 2020-04-22 | ||
### Changed | ||
- Update regions for aws services. | ||
- Update voices for aws polly. | ||
## [3.0.0] - 2018-10-24 | ||
### Added | ||
- Support for IBM Watson. | ||
- Support for IBM Watson. | ||
## [2.3.0] - 2018-10-19 | ||
### Added | ||
- Optional `'icon'` property to `webchat-channel-settings` object property. | ||
- Optional `'icon'` property to `webchat-channel-settings` object property. | ||
## [2.2.0] - 2018-09-03 | ||
### Added | ||
- Optional `'icon'` property to `options` object property. | ||
- Optional `'supportedSystemEvents'` property to `options` object property. | ||
- Slack configuration support | ||
- Optional `'icon'` property to `options` object property. | ||
- Optional `'supportedSystemEvents'` property to `options` object property. | ||
- Slack configuration support | ||
## [2.1.0] - 2018-07-17 | ||
### Added | ||
- `us-west-2` is now a valid Amazon Lex regions. | ||
- `us-west-2` is now a valid Amazon Lex regions. | ||
## [2.0.1] - 2018-06-20 | ||
Bug fix release for the php class trying to include the schema from the wrong path. | ||
Bug fix release for the php class trying to include the schema from the wrong | ||
path. | ||
### Changed | ||
- Use php constants to for schema file path. | ||
- Use php constants to for schema file path. | ||
## [2.0.1] - 2018-06-20 | ||
@@ -44,10 +59,11 @@ | ||
This major release has the `stamp` channel renamed to `api`. | ||
This is just a name change; no other rules have been changed. | ||
This major release has the `stamp` channel renamed to `api`. This is just a name | ||
change; no other rules have been changed. | ||
### Changed | ||
- Renamed `stamp` channel to `api`. ([277d75a]) | ||
- Regenerated schema typings. ([f135e9a]) | ||
- Updated PHP class to use namespacing ([3e40f80]) | ||
- Renamed `stamp` channel to `api`. ([277d75a]) | ||
- Regenerated schema typings. ([f135e9a]) | ||
- Updated PHP class to use namespacing ([3e40f80]) | ||
## [1.0.0] - 2018-06-18 | ||
@@ -60,4 +76,7 @@ | ||
### Added | ||
- Initial commit | ||
- Initial commit | ||
<!-- prettier-ignore-start --> | ||
[Unreleased]: https://github.com/zwerm/bot-configs-schema/compare/v2.0.1...master | ||
@@ -73,1 +92,2 @@ | ||
<!-- prettier-ignore-end --> |
@@ -5,8 +5,8 @@ { | ||
"homepage": "https://github.com/zwerm/bot-configs-schema#readme", | ||
"time": "2018-10-24", | ||
"time": "2020-04-22", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Prefer Ltd", | ||
"email": "hello@prefer.co.nz" | ||
"name": "Zwerm Ltd", | ||
"email": "hello@zwerm.co.nz" | ||
} | ||
@@ -13,0 +13,0 @@ ], |
@@ -9,18 +9,24 @@ const schemaToTypescript = require('json-schema-to-typescript'); | ||
const extraForExperts = [ | ||
'export type BotOptionKey = keyof BotOptions;', | ||
'export type BotOptionValue<key extends keyof BotOptions> = BotOptions[key];' | ||
'export type BotOptionKey = keyof BotOptions;', | ||
'export type BotOptionValue<key extends keyof BotOptions> = BotOptions[key];' | ||
].join('\n'); | ||
schemaToTypescript.compileFromFile(schemaFile, { unreachableDefinitions: true }) | ||
.then(ts => `export declare namespace BotsSchema { \n ${ts} \n ${extraForExperts} }`) | ||
.then(ts => prettier.format(`${ts}`, { | ||
tabWidth: 4, | ||
useTabs: false, | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: 'none', | ||
parser: 'typescript' | ||
})) | ||
.then(ts => fs.writeFileSync(typingFile, ts)) | ||
.then(() => console.log(`successfully generates ${typingFile} typings for ${schemaFile}`)); | ||
schemaToTypescript | ||
.compileFromFile(schemaFile, { unreachableDefinitions: true }) | ||
.then( | ||
ts => | ||
`export declare namespace BotsSchema { \n ${ts} \n ${extraForExperts} }` | ||
) | ||
.then(ts => | ||
prettier | ||
.resolveConfig() | ||
.then(options => | ||
prettier.format(ts, { parser: 'typescript', ...options }) | ||
) | ||
) | ||
.then(ts => fs.writeFileSync(typingFile, ts)) | ||
.then(() => | ||
console.log( | ||
`successfully generates ${typingFile} typings for ${schemaFile}` | ||
) | ||
); |
{ | ||
"name": "@zwerm/bot-configs-schema", | ||
"version": "3.0.0", | ||
"description": "Zwerm schema for bot configurations", | ||
"homepage": "https://github.com/zwerm/bot-configs-schema#readme", | ||
"license": "MIT", | ||
"author": "Prefer", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/zwerm/bot-configs-schema.git" | ||
}, | ||
"scripts": { | ||
"gen-types": "node ./gen-schema-types.js", | ||
"test": "ajv compile -s bot.schema.json", | ||
"preversion": "npm test", | ||
"version": "node ./scripts/npm-version.js" | ||
}, | ||
"config": { | ||
"ghooks": { | ||
"pre-commit": "npm test" | ||
} | ||
}, | ||
"devDependencies": { | ||
"ajv-cli": "^3.0.0", | ||
"ghooks": "^2.0.4", | ||
"json-schema-to-typescript": "^5.5.0", | ||
"prettier": "^1.13.5" | ||
"name": "@zwerm/bot-configs-schema", | ||
"version": "3.1.0", | ||
"description": "Zwerm schema for bot configurations", | ||
"homepage": "https://github.com/zwerm/bot-configs-schema#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/zwerm/bot-configs-schema.git" | ||
}, | ||
"license": "MIT", | ||
"author": "Zwerm", | ||
"scripts": { | ||
"gen-types": "node ./gen-schema-types.js", | ||
"test": "ajv compile -s bot.schema.json", | ||
"preversion": "npm test", | ||
"version": "node ./scripts/npm-version.js" | ||
}, | ||
"config": { | ||
"ghooks": { | ||
"pre-commit": "npm test" | ||
} | ||
}, | ||
"prettier": "prettier-config-ackama", | ||
"devDependencies": { | ||
"ajv-cli": "^3.1.0", | ||
"ghooks": "^2.0.4", | ||
"json-schema-to-typescript": "^8.2.0", | ||
"prettier": "^2.0.5", | ||
"prettier-config-ackama": "^0.1.2" | ||
} | ||
} |
@@ -5,4 +5,6 @@ # Zwerm Bot Configuration Schema | ||
`bot.schema.json` defines the schema for the configuration details for a single bot instance. | ||
`bots.schema.json` defines the schema for a map of bot ids to their respective configuration details for multiple bot instances. | ||
`bot.schema.json` defines the schema for the configuration details for a single | ||
bot instance. | ||
`bots.schema.json` defines the schema for a map of bot ids to their respective | ||
configuration details for multiple bot instances. | ||
@@ -30,5 +32,7 @@ ### Installing | ||
When making a Pull Request, add your changes to the *Unreleased* section of [CHANGELOG](https://github.com/zwerm/bot-configs-schema/blob/master/CHANGELOG.md). | ||
When making a Pull Request, add your changes to the _Unreleased_ section of | ||
[CHANGELOG](https://github.com/zwerm/bot-configs-schema/blob/master/CHANGELOG.md). | ||
To release a new version, run the `npm version` command on `master`, it will take care of everything for you. | ||
To release a new version, run the `npm version` command on `master`, it will | ||
take care of everything for you. | ||
@@ -41,2 +45,5 @@ `npm version [major | minor | patch]` | ||
We use a modified [GitFlow](https://datasift.github.io/gitflow/IntroducingGitFlow.html) branching model. The main difference being is we use `master` as a combined development branch and branch of short living production branches as needed. | ||
We use a modified | ||
[GitFlow](https://datasift.github.io/gitflow/IntroducingGitFlow.html) branching | ||
model. The main difference being is we use `master` as a combined development | ||
branch and branch of short living production branches as needed. |
@@ -10,10 +10,10 @@ const /** @type {module:child_process} */ child_process = require('child_process'); | ||
const addFilesToGit = (files, cwd) => { | ||
console.log( | ||
'adding the following files to commit:', | ||
...files.map(value => `\n > ${value}`) | ||
); | ||
console.log( | ||
'adding the following files to commit:', | ||
...files.map(value => `\n > ${value}`) | ||
); | ||
child_process.execSync(`git add ${files.join(' ')}`, { cwd }); | ||
child_process.execSync(`git add ${files.join(' ')}`, { cwd }); | ||
}; | ||
module.exports = addFilesToGit; |
@@ -12,13 +12,9 @@ /** | ||
const buildComposerTimeString = date => { | ||
const year = date.getFullYear(); | ||
const day = `${date.getDate()}`; | ||
const month = `${(date.getMonth() + 1)}`; | ||
const year = date.getFullYear(); | ||
const day = `${date.getDate()}`; | ||
const month = `${date.getMonth() + 1}`; | ||
return [ | ||
year, | ||
month.padStart(2, '0'), | ||
day.padStart(2, '0') | ||
].join('-'); | ||
return [year, month.padStart(2, '0'), day.padStart(2, '0')].join('-'); | ||
}; | ||
module.exports = buildComposerTimeString; |
@@ -17,21 +17,27 @@ const /** @type {module:path} */ path = require('path'); | ||
const ensureInitCwdEnvironmentValue = scriptsDirname => { | ||
if (typeof process.env.INIT_CWD === 'string') { | ||
return true; | ||
} // we don't have to fallback if it exists | ||
if (typeof process.env.INIT_CWD === 'string') { | ||
return true; | ||
} // we don't have to fallback if it exists | ||
const fallbackCwd = path.join(scriptsDirname, '..'); | ||
const fallbackCwd = path.join(scriptsDirname, '..'); | ||
console.warn(`process.env.INIT_CWD is not defined; falling back to ${fallbackCwd}`); | ||
console.warn(`if you're using yarn, you should checkout this issue: https://github.com/yarnpkg/yarn/issues/5698`); | ||
console.log(); | ||
console.warn( | ||
`process.env.INIT_CWD is not defined; falling back to ${fallbackCwd}` | ||
); | ||
console.warn( | ||
`if you're using yarn, you should checkout this issue: https://github.com/yarnpkg/yarn/issues/5698` | ||
); | ||
console.log(); | ||
if (process.env.INIT_CWD) { | ||
console.warn(`(actually, it is defined, but with a value of ${process.env.INIT_CWD}, which we don't like?)`); | ||
} | ||
if (process.env.INIT_CWD) { | ||
console.warn( | ||
`(actually, it is defined, but with a value of ${process.env.INIT_CWD}, which we don't like?)` | ||
); | ||
} | ||
process.env.INIT_CWD = fallbackCwd; | ||
process.env.INIT_CWD = fallbackCwd; | ||
return false; | ||
return false; | ||
}; | ||
module.exports = ensureInitCwdEnvironmentValue; |
@@ -13,13 +13,15 @@ const /** @type {module:fs} */ fs = require('fs'); | ||
const moveChangelogUnreleasedHeaderForVersion = (newVersion, changelogPath) => { | ||
const oldChangelogFile = fs.readFileSync(changelogPath).toString(); | ||
const newChangelogFile = oldChangelogFile.replace('## [Unreleased]', [ | ||
'## [Unreleased]', | ||
null, // there should be a blank line between ## [Unreleased] & the new version header | ||
`## [${newVersion}] - ${buildComposerTimeString(new Date())}` | ||
].join('\n') | ||
); | ||
const oldChangelogFile = fs.readFileSync(changelogPath).toString(); | ||
const newChangelogFile = oldChangelogFile.replace( | ||
'## [Unreleased]', | ||
[ | ||
'## [Unreleased]', | ||
null, // there should be a blank line between ## [Unreleased] & the new version header | ||
`## [${newVersion}] - ${buildComposerTimeString(new Date())}` | ||
].join('\n') | ||
); | ||
fs.writeFileSync(changelogPath, newChangelogFile); | ||
fs.writeFileSync(changelogPath, newChangelogFile); | ||
}; | ||
module.exports = moveChangelogUnreleasedHeaderForVersion; |
@@ -13,19 +13,21 @@ const /** @type {module:fs} */ fs = require('fs'); | ||
const syncComposerWithPackageJson = (packageJson, composerJsonPath) => { | ||
const propertiesToSync = [ | ||
'description', | ||
'license', | ||
'homepage', | ||
'keywords' | ||
]; | ||
const propertiesToSync = ['description', 'license', 'homepage', 'keywords']; | ||
const composerJson = require(composerJsonPath); | ||
propertiesToSync.forEach(property => console.log(` > syncing ${property}...`) || (composerJson[property] = packageJson[property])); | ||
const composerJson = require(composerJsonPath); | ||
propertiesToSync.forEach( | ||
property => | ||
console.log(` > syncing ${property}...`) || | ||
(composerJson[property] = packageJson[property]) | ||
); | ||
console.log(' > updating time...'); | ||
composerJson.time = buildComposerTimeString(new Date()); | ||
console.log(' > updating time...'); | ||
composerJson.time = buildComposerTimeString(new Date()); | ||
console.log(`>> writing to file at ${composerJsonPath}...`); | ||
fs.writeFileSync(composerJsonPath, JSON.stringify(composerJson, undefined, 4)); | ||
console.log(`>> writing to file at ${composerJsonPath}...`); | ||
fs.writeFileSync( | ||
composerJsonPath, | ||
JSON.stringify(composerJson, undefined, 4) | ||
); | ||
}; | ||
module.exports = syncComposerWithPackageJson; |
@@ -12,7 +12,7 @@ const /** @type {module:fs} */ fs = require('fs'); | ||
* | ||
* `ssh://git@bitbucket.org/preferizi/bot-configs-manager.git` | ||
* `ssh://git@bitbucket.org/zwerm/bot-configs-manager.git` | ||
* | ||
* would become | ||
* | ||
* `https://bitbucket.org/preferizi/bot-configs-manager`. | ||
* `https://bitbucket.org/zwerm/bot-configs-manager`. | ||
* | ||
@@ -24,5 +24,3 @@ * @param {string} gitRepoUrl | ||
const ensureProperGitRepoLink = gitRepoUrl => { | ||
return gitRepoUrl | ||
.replace('ssh://git@', 'https://') | ||
.replace('.git', ''); | ||
return gitRepoUrl.replace('ssh://git@', 'https://').replace('.git', ''); | ||
}; | ||
@@ -41,10 +39,12 @@ | ||
const getCompareSpacerFromRepoHostUrl = repoUrl => { | ||
if (repoUrl.startsWith('https://bitbucket')) { // bitbucket | ||
return '..'; | ||
} | ||
if (repoUrl.startsWith('https://github')) { // github | ||
return '...'; | ||
} | ||
if (repoUrl.startsWith('https://bitbucket')) { | ||
// bitbucket | ||
return '..'; | ||
} | ||
if (repoUrl.startsWith('https://github')) { | ||
// github | ||
return '...'; | ||
} | ||
throw new Error(`unknown repo host ${repoUrl}`); | ||
throw new Error(`unknown repo host ${repoUrl}`); | ||
}; | ||
@@ -62,13 +62,15 @@ | ||
const buildCompareUrl = (repoUrl, newVersionTag, lastVersionTag) => { | ||
const repoCompareSpacer = getCompareSpacerFromRepoHostUrl(repoUrl); | ||
const repoCompareSpacer = getCompareSpacerFromRepoHostUrl(repoUrl); | ||
if (repoUrl.startsWith('https://bitbucket')) { // bitbucket: source -> destination | ||
return `${repoUrl}/compare/${newVersionTag}${repoCompareSpacer}${lastVersionTag}`; | ||
} | ||
if (repoUrl.startsWith('https://bitbucket')) { | ||
// bitbucket: source -> destination | ||
return `${repoUrl}/compare/${newVersionTag}${repoCompareSpacer}${lastVersionTag}`; | ||
} | ||
if (repoUrl.startsWith('https://github')) { // github: base <- compare | ||
return `${repoUrl}/compare/${lastVersionTag}${repoCompareSpacer}${newVersionTag}`; | ||
} | ||
if (repoUrl.startsWith('https://github')) { | ||
// github: base <- compare | ||
return `${repoUrl}/compare/${lastVersionTag}${repoCompareSpacer}${newVersionTag}`; | ||
} | ||
throw new Error(`unknown repo host ${repoUrl}`); | ||
throw new Error(`unknown repo host ${repoUrl}`); | ||
}; | ||
@@ -87,13 +89,15 @@ | ||
const getOldVersionTagFromUnreleasedLink = unreleasedLinkUrl => { | ||
const repoCompareSpacer = getCompareSpacerFromRepoHostUrl(unreleasedLinkUrl); | ||
const compareRangeString = unreleasedLinkUrl.split('/').pop(); | ||
const repoCompareSpacer = getCompareSpacerFromRepoHostUrl(unreleasedLinkUrl); | ||
const compareRangeString = unreleasedLinkUrl.split('/').pop(); | ||
if (unreleasedLinkUrl.startsWith('https://bitbucket')) { // bitbucket | ||
return compareRangeString.split(repoCompareSpacer)[1]; | ||
} | ||
if (unreleasedLinkUrl.startsWith('https://github')) { // github | ||
return compareRangeString.split(repoCompareSpacer)[0]; | ||
} | ||
if (unreleasedLinkUrl.startsWith('https://bitbucket')) { | ||
// bitbucket | ||
return compareRangeString.split(repoCompareSpacer)[1]; | ||
} | ||
if (unreleasedLinkUrl.startsWith('https://github')) { | ||
// github | ||
return compareRangeString.split(repoCompareSpacer)[0]; | ||
} | ||
throw new Error(`unknown repo host ${unreleasedLinkUrl}`); | ||
throw new Error(`unknown repo host ${unreleasedLinkUrl}`); | ||
}; | ||
@@ -110,12 +114,22 @@ | ||
const getUnreleasedCompareUrl = (changelog, gitUrl) => { | ||
const unreleasedLinkPrefix = '[Unreleased]: '; | ||
const unreleasedLinkPrefix = '[Unreleased]: '; | ||
const unreleasedVersionCompareUrlStart = changelog.lastIndexOf(`${unreleasedLinkPrefix}${gitUrl}/compare/`) + unreleasedLinkPrefix.length; | ||
const unreleasedVersionCompareUrlEnd = changelog.indexOf('\n', unreleasedVersionCompareUrlStart); | ||
const unreleasedVersionCompareUrlStart = | ||
changelog.lastIndexOf(`${unreleasedLinkPrefix}${gitUrl}/compare/`) + | ||
unreleasedLinkPrefix.length; | ||
const unreleasedVersionCompareUrlEnd = changelog.indexOf( | ||
'\n', | ||
unreleasedVersionCompareUrlStart | ||
); | ||
if (unreleasedVersionCompareUrlStart - unreleasedLinkPrefix.length === -1) { | ||
throw new Error(`unable to find '${`${unreleasedLinkPrefix}${gitUrl}/compare/`} in changelog`); | ||
} | ||
if (unreleasedVersionCompareUrlStart - unreleasedLinkPrefix.length === -1) { | ||
throw new Error( | ||
`unable to find '${`${unreleasedLinkPrefix}${gitUrl}/compare/`} in changelog` | ||
); | ||
} | ||
return changelog.substring(unreleasedVersionCompareUrlStart, unreleasedVersionCompareUrlEnd); | ||
return changelog.substring( | ||
unreleasedVersionCompareUrlStart, | ||
unreleasedVersionCompareUrlEnd | ||
); | ||
}; | ||
@@ -138,26 +152,39 @@ | ||
*/ | ||
const updateChangelogTagLinksForNewVersion = (newVersionString, gitRepoUrl, changelogPath) => { | ||
const oldChangelogFile = fs.readFileSync(changelogPath).toString(); | ||
const updateChangelogTagLinksForNewVersion = ( | ||
newVersionString, | ||
gitRepoUrl, | ||
changelogPath | ||
) => { | ||
const oldChangelogFile = fs.readFileSync(changelogPath).toString(); | ||
const repoUrl = ensureProperGitRepoLink(gitRepoUrl); | ||
const unreleasedCompareUrl = getUnreleasedCompareUrl(oldChangelogFile, repoUrl); | ||
const repoUrl = ensureProperGitRepoLink(gitRepoUrl); | ||
const unreleasedCompareUrl = getUnreleasedCompareUrl( | ||
oldChangelogFile, | ||
repoUrl | ||
); | ||
const newVersionTag = `v${newVersionString}`; | ||
const oldVersionTag = getOldVersionTagFromUnreleasedLink(unreleasedCompareUrl); | ||
const newVersionTag = `v${newVersionString}`; | ||
const oldVersionTag = getOldVersionTagFromUnreleasedLink( | ||
unreleasedCompareUrl | ||
); | ||
const newChangelogFile = oldChangelogFile.replace( | ||
[ | ||
`[Unreleased]: ${buildCompareUrl(repoUrl, 'HEAD', oldVersionTag)}`, | ||
null // there should be a blank line between the [Unreleased] url & the block of tag urls | ||
].join('\n'), | ||
[ | ||
`[Unreleased]: ${buildCompareUrl(repoUrl, 'HEAD', newVersionTag)}`, | ||
null, // there should be a blank line between the [Unreleased] url & the block of tag urls | ||
`[${newVersionString}]: ${buildCompareUrl(repoUrl, newVersionTag, oldVersionTag)}` | ||
].join('\n') | ||
); | ||
const newChangelogFile = oldChangelogFile.replace( | ||
[ | ||
`[Unreleased]: ${buildCompareUrl(repoUrl, 'HEAD', oldVersionTag)}`, | ||
null // there should be a blank line between the [Unreleased] url & the block of tag urls | ||
].join('\n'), | ||
[ | ||
`[Unreleased]: ${buildCompareUrl(repoUrl, 'HEAD', newVersionTag)}`, | ||
null, // there should be a blank line between the [Unreleased] url & the block of tag urls | ||
`[${newVersionString}]: ${buildCompareUrl( | ||
repoUrl, | ||
newVersionTag, | ||
oldVersionTag | ||
)}` | ||
].join('\n') | ||
); | ||
fs.writeFileSync(changelogPath, newChangelogFile); | ||
fs.writeFileSync(changelogPath, newChangelogFile); | ||
}; | ||
module.exports = updateChangelogTagLinksForNewVersion; |
@@ -30,13 +30,22 @@ /** | ||
const filePaths = { | ||
CHANGELOG: path.join(process.env.INIT_CWD, 'CHANGELOG.md'), | ||
COMPOSER_JSON: path.join(process.env.INIT_CWD, 'composer.json') | ||
CHANGELOG: path.join(process.env.INIT_CWD, 'CHANGELOG.md'), | ||
COMPOSER_JSON: path.join(process.env.INIT_CWD, 'composer.json') | ||
}; | ||
// region update CHANGELOG.md | ||
console.log(`moving [Unreleased] header in CHANGELOG.md to be ${packageJson.version}...`); | ||
moveChangelogUnreleasedHeaderForVersion(packageJson.version, filePaths.CHANGELOG); | ||
console.log( | ||
`moving [Unreleased] header in CHANGELOG.md to be ${packageJson.version}...` | ||
); | ||
moveChangelogUnreleasedHeaderForVersion( | ||
packageJson.version, | ||
filePaths.CHANGELOG | ||
); | ||
// endregion | ||
// region update CHANGELOG.md version header links | ||
console.log(`updating tag links in CHANGELOG.md...`); | ||
updateChangelogTagLinksForNewVersion(packageJson.version, packageJson.repository.url, filePaths.CHANGELOG); | ||
updateChangelogTagLinksForNewVersion( | ||
packageJson.version, | ||
packageJson.repository.url, | ||
filePaths.CHANGELOG | ||
); | ||
// endregion | ||
@@ -54,2 +63,1 @@ // region sync composer file | ||
console.log(); | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1342
47
1
48204
5