@botpress/cli 0.2.9 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/client.js +1 -1
- package/dist/api/client.js.map +2 -2
- package/dist/code-generation/const.js +1 -1
- package/dist/code-generation/const.js.map +1 -1
- package/dist/code-generation/{event.js → generators.js} +15 -19
- package/dist/code-generation/generators.js.map +7 -0
- package/dist/code-generation/index.js +40 -8
- package/dist/code-generation/index.js.map +2 -2
- package/dist/code-generation/integration-implementation.js +157 -0
- package/dist/code-generation/integration-implementation.js.map +7 -0
- package/dist/code-generation/integration-instance.js +101 -39
- package/dist/code-generation/integration-instance.js.map +2 -2
- package/dist/code-generation/{action.js → integration-schemas/actions-module.js} +41 -19
- package/dist/code-generation/integration-schemas/actions-module.js.map +7 -0
- package/dist/code-generation/integration-schemas/channels-module.js +114 -0
- package/dist/code-generation/integration-schemas/channels-module.js.map +7 -0
- package/dist/code-generation/{configuration.js → integration-schemas/configuration-module.js} +11 -10
- package/dist/code-generation/integration-schemas/configuration-module.js.map +7 -0
- package/dist/code-generation/integration-schemas/events-module.js +64 -0
- package/dist/code-generation/integration-schemas/events-module.js.map +7 -0
- package/dist/code-generation/integration-schemas/states-module.js +64 -0
- package/dist/code-generation/integration-schemas/states-module.js.map +7 -0
- package/dist/code-generation/module.js +5 -5
- package/dist/code-generation/module.js.map +2 -2
- package/dist/code-generation/typings.js.map +1 -1
- package/dist/command-implementations/deploy-command.js +2 -20
- package/dist/command-implementations/deploy-command.js.map +3 -3
- package/dist/command-implementations/dev-command.js +26 -13
- package/dist/command-implementations/dev-command.js.map +3 -3
- package/dist/command-implementations/project-command.js +54 -1
- package/dist/command-implementations/project-command.js.map +2 -2
- package/dist/{code-generation/message.js → utils/guard-utils.js} +9 -20
- package/dist/utils/guard-utils.js.map +7 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +2 -2
- package/dist/utils/record-utils.js +9 -0
- package/dist/utils/record-utils.js.map +2 -2
- package/dist/{code-generation/channel.js → utils/schema-utils.js} +25 -22
- package/dist/utils/schema-utils.js.map +7 -0
- package/dist/utils/type-utils.js +17 -0
- package/dist/utils/type-utils.js.map +7 -0
- package/e2e/api.ts +4 -4
- package/e2e/tests/create-deploy-bot.ts +1 -1
- package/e2e/tests/create-deploy-integration.ts +1 -1
- package/e2e/tests/dev-bot.ts +5 -4
- package/package.json +6 -5
- package/templates/echo-bot/package.json +2 -2
- package/templates/echo-bot/src/index.ts +7 -20
- package/templates/empty-integration/.botpress/implementation/actions/index.ts +0 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/index.ts +6 -34
- package/templates/empty-integration/.botpress/implementation/channels/channel/{audio.ts → messages/audio.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/{card.ts → messages/card.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/{carousel.ts → messages/carousel.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/{choice.ts → messages/choice.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/{dropdown.ts → messages/dropdown.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/{file.ts → messages/file.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/{image.ts → messages/image.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/messages/index.ts +39 -0
- package/templates/empty-integration/.botpress/implementation/channels/channel/{location.ts → messages/location.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/{markdown.ts → messages/markdown.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/{text.ts → messages/text.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/channel/{video.ts → messages/video.ts} +1 -1
- package/templates/empty-integration/.botpress/implementation/channels/index.ts +1 -2
- package/templates/empty-integration/.botpress/implementation/{configuration.ts → configuration/index.ts} +2 -2
- package/templates/empty-integration/.botpress/implementation/events/index.ts +0 -1
- package/templates/empty-integration/.botpress/implementation/index.ts +30 -12
- package/templates/empty-integration/.botpress/implementation/states/index.ts +6 -0
- package/templates/empty-integration/.botpress/secrets/index.ts +0 -1
- package/templates/empty-integration/package.json +2 -2
- package/dist/code-generation/action.js.map +0 -7
- package/dist/code-generation/channel.js.map +0 -7
- package/dist/code-generation/configuration.js.map +0 -7
- package/dist/code-generation/event.js.map +0 -7
- package/dist/code-generation/integration-impl.js +0 -147
- package/dist/code-generation/integration-impl.js.map +0 -7
- package/dist/code-generation/message.js.map +0 -7
package/dist/api/client.js
CHANGED
|
@@ -34,7 +34,7 @@ class ApiClient {
|
|
|
34
34
|
constructor(props, _logger) {
|
|
35
35
|
this._logger = _logger;
|
|
36
36
|
const { apiUrl, token, workspaceId } = props;
|
|
37
|
-
this.client = new import_client.Client({
|
|
37
|
+
this.client = new import_client.Client({ apiUrl, token, workspaceId });
|
|
38
38
|
this.url = apiUrl;
|
|
39
39
|
this.token = token;
|
|
40
40
|
this.workspaceId = workspaceId;
|
package/dist/api/client.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/api/client.ts"],
|
|
4
|
-
"sourcesContent": ["import { Client, Integration, isApiError } from '@botpress/client'\nimport _ from 'lodash'\nimport { formatIntegrationRef, IntegrationRef } from '../integration-ref'\nimport type { Logger } from '../logger'\n\nexport type PageLister<R extends object> = (t: { nextToken?: string }) => Promise<R & { meta: { nextToken?: string } }>\n\nexport type ApiClientProps = {\n apiUrl: string\n token: string\n workspaceId?: string\n}\n\nexport type ApiClientFactory = {\n newClient: (props: ApiClientProps, logger: Logger) => ApiClient\n}\n\n/**\n * This class is used to wrap the Botpress API and provide a more convenient way to interact with it.\n */\nexport class ApiClient {\n public readonly client: Client\n public readonly url: string\n public readonly token: string\n public readonly workspaceId?: string\n\n public static newClient = (props: ApiClientProps, logger: Logger) => new ApiClient(props, logger)\n\n public constructor(props: ApiClientProps, private _logger: Logger) {\n const { apiUrl, token, workspaceId } = props\n this.client = new Client({
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,oBAAc;AACd,6BAAqD;AAkB9C,MAAM,UAAU;AAAA,EAQd,YAAY,OAA+B,SAAiB;AAAjB;AAChD,UAAM,EAAE,QAAQ,OAAO,YAAY,IAAI;AACvC,SAAK,SAAS,IAAI,qBAAO,EAAE,
|
|
4
|
+
"sourcesContent": ["import { Client, Integration, isApiError } from '@botpress/client'\nimport _ from 'lodash'\nimport { formatIntegrationRef, IntegrationRef } from '../integration-ref'\nimport type { Logger } from '../logger'\n\nexport type PageLister<R extends object> = (t: { nextToken?: string }) => Promise<R & { meta: { nextToken?: string } }>\n\nexport type ApiClientProps = {\n apiUrl: string\n token: string\n workspaceId?: string\n}\n\nexport type ApiClientFactory = {\n newClient: (props: ApiClientProps, logger: Logger) => ApiClient\n}\n\n/**\n * This class is used to wrap the Botpress API and provide a more convenient way to interact with it.\n */\nexport class ApiClient {\n public readonly client: Client\n public readonly url: string\n public readonly token: string\n public readonly workspaceId?: string\n\n public static newClient = (props: ApiClientProps, logger: Logger) => new ApiClient(props, logger)\n\n public constructor(props: ApiClientProps, private _logger: Logger) {\n const { apiUrl, token, workspaceId } = props\n this.client = new Client({ apiUrl, token, workspaceId })\n this.url = apiUrl\n this.token = token\n this.workspaceId = workspaceId\n }\n\n public async findIntegration(ref: IntegrationRef): Promise<Integration | undefined> {\n const formatted = formatIntegrationRef(ref)\n\n const privateIntegration = await this.findPrivateIntegration(ref)\n if (privateIntegration) {\n this._logger.debug(`Found integration \"${formatted}\" in workspace`)\n return privateIntegration\n }\n\n const publicIntegration = await this.findPublicIntegration(ref)\n if (publicIntegration) {\n this._logger.debug(`Found integration \"${formatted}\" in hub`)\n return publicIntegration\n }\n\n return\n }\n\n public async findPrivateIntegration(ref: IntegrationRef): Promise<Integration | undefined> {\n if (ref.type === 'id') {\n return this.validateStatus(() => this.client.getIntegration(ref).then((r) => r.integration), 404)\n }\n return this.validateStatus(() => this.client.getIntegrationByName(ref).then((r) => r.integration), 404)\n }\n\n public async findPublicIntegration(ref: IntegrationRef): Promise<Integration | undefined> {\n if (ref.type === 'id') {\n return this.validateStatus(() => this.client.getPublicIntegrationById(ref).then((r) => r.integration), 404)\n }\n return this.validateStatus(() => this.client.getPublicIntegration(ref).then((r) => r.integration), 404)\n }\n\n public async testLogin(): Promise<void> {\n await this.client.listBots({})\n }\n\n public async listAllPages<R extends object>(lister: PageLister<R>): Promise<R[]>\n public async listAllPages<R extends object, M>(lister: PageLister<R>, mapper?: (r: R) => M[]): Promise<M[]>\n public async listAllPages<R extends object, M>(lister: PageLister<R>, mapper?: (r: R) => M[]) {\n let nextToken: string | undefined\n const all: R[] = []\n\n do {\n const { meta, ...r } = await lister({ nextToken })\n all.push(r as R)\n nextToken = meta.nextToken\n } while (nextToken)\n\n if (!mapper) {\n return all\n }\n\n const mapped: M[] = all.flatMap((r) => mapper(r))\n return mapped\n }\n\n public async validateStatus<V>(fn: () => Promise<V>, allowedStatuses: number | number[]): Promise<V | undefined> {\n try {\n const v = await fn()\n return v\n } catch (err) {\n const allowedStatusesArray = _.isArray(allowedStatuses) ? allowedStatuses : [allowedStatuses]\n const isAllowed = isApiError(err) && err.code && allowedStatusesArray.includes(err.code)\n if (isAllowed) {\n return\n }\n throw err\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,oBAAc;AACd,6BAAqD;AAkB9C,MAAM,UAAU;AAAA,EAQd,YAAY,OAA+B,SAAiB;AAAjB;AAChD,UAAM,EAAE,QAAQ,OAAO,YAAY,IAAI;AACvC,SAAK,SAAS,IAAI,qBAAO,EAAE,QAAQ,OAAO,YAAY,CAAC;AACvD,SAAK,MAAM;AACX,SAAK,QAAQ;AACb,SAA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CAAC;AAElB,OAAG;AACD,YAAM,EAAE,SAAS,EAAE,IAAI,MAAM,OAAO,EAAE,UAAU,CAAC;AACjD,UAAI,KAAK,CAAM;AACf,kBAAY,KAAK;AAAA,IACnB,SAAS;AAET,QAAI,CAAC,QAAQ;AACX,aAAO;AAAA,IACT;AAEA,UAAM,SAAc,IAAI,QAAQ,CAAC,MAAM,OAAO,CAAC,CAAC;AAChD,WAAO;AAAA,EACT;AAAA,EAEA,MAAa,eAAkB,IAAsB,iBAA4D;AAC/G,QAAI;AACF,YAAM,IAAI,MAAM,GAAG;AACnB,aAAO;AAAA,IACT,SAAS,KAAP;AACA,YAAM,uBAAuB,cAAAA,QAAE,QAAQ,eAAe,IAAI,kBAAkB,CAAC,eAAe;AAC5F,YAAM,gBAAY,0BAAW,GAAG,KAAK,IAAI,QAAQ,qBAAqB,SAAS,IAAI,IAAI;AACvF,UAAI,WAAW;AACb;AAAA,MACF;AACA,YAAM;AAAA,IACR;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["_"]
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ __export(const_exports, {
|
|
|
22
22
|
INDEX_FILE: () => INDEX_FILE
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(const_exports);
|
|
25
|
-
const GENERATED_HEADER = "/* tslint:disable */\n// This file is generated\n// Do not edit this file\n
|
|
25
|
+
const GENERATED_HEADER = "/* tslint:disable */\n// This file is generated\n// Do not edit this file\n";
|
|
26
26
|
const INDEX_FILE = "index.ts";
|
|
27
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
28
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/code-generation/const.ts"],
|
|
4
|
-
"sourcesContent": ["export const GENERATED_HEADER = '/* tslint:disable */\\n// This file is generated\\n// Do not edit this file\\n
|
|
4
|
+
"sourcesContent": ["export const GENERATED_HEADER = '/* tslint:disable */\\n// This file is generated\\n// Do not edit this file\\n'\nexport const INDEX_FILE = 'index.ts'\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,mBAAmB;AACzB,MAAM,aAAa;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -16,27 +16,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
|
|
19
|
+
var generators_exports = {};
|
|
20
|
+
__export(generators_exports, {
|
|
21
|
+
jsonSchemaToTypeScriptType: () => jsonSchemaToTypeScriptType,
|
|
22
|
+
stringifySingleLine: () => stringifySingleLine
|
|
22
23
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(generators_exports);
|
|
24
25
|
var import_json_schema_to_typescript = require("json-schema-to-typescript");
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exportName: import_utils.casing.to.pascalCase(name),
|
|
33
|
-
content: await (0, import_json_schema_to_typescript.compile)(schema, name)
|
|
34
|
-
};
|
|
35
|
-
return new EventModule(def);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
26
|
+
const jsonSchemaToTypeScriptType = async (jsonSchema, name) => {
|
|
27
|
+
const code = await (0, import_json_schema_to_typescript.compile)(jsonSchema, name, { unknownAny: false });
|
|
28
|
+
return code;
|
|
29
|
+
};
|
|
30
|
+
const stringifySingleLine = (x) => {
|
|
31
|
+
return JSON.stringify(x, null, 1).replace(/\n */g, " ");
|
|
32
|
+
};
|
|
38
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
34
|
0 && (module.exports = {
|
|
40
|
-
|
|
35
|
+
jsonSchemaToTypeScriptType,
|
|
36
|
+
stringifySingleLine
|
|
41
37
|
});
|
|
42
|
-
//# sourceMappingURL=
|
|
38
|
+
//# sourceMappingURL=generators.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/code-generation/generators.ts"],
|
|
4
|
+
"sourcesContent": ["import { JSONSchema4 } from 'json-schema'\nimport { compile } from 'json-schema-to-typescript'\n\nexport const jsonSchemaToTypeScriptType = async (jsonSchema: JSONSchema4, name: string): Promise<string> => {\n const code = await compile(jsonSchema, name, { unknownAny: false })\n return code\n}\n\nexport const stringifySingleLine = (x: object): string => {\n return JSON.stringify(x, null, 1).replace(/\\n */g, ' ')\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uCAAwB;AAEjB,MAAM,6BAA6B,OAAO,YAAyB,SAAkC;AAC1G,QAAM,OAAO,UAAM,0CAAQ,YAAY,MAAM,EAAE,YAAY,MAAM,CAAC;AAClE,SAAO;AACT;AAEO,MAAM,sBAAsB,CAAC,MAAsB;AACxD,SAAO,KAAK,UAAU,GAAG,MAAM,CAAC,EAAE,QAAQ,SAAS,GAAG;AACxD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -35,16 +35,16 @@ __export(code_generation_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(code_generation_exports);
|
|
37
37
|
var import_path = __toESM(require("path"));
|
|
38
|
-
var
|
|
38
|
+
var utils = __toESM(require("../utils"));
|
|
39
39
|
var import_const = require("./const");
|
|
40
|
-
var
|
|
40
|
+
var import_integration_implementation = require("./integration-implementation");
|
|
41
41
|
var import_integration_instance = require("./integration-instance");
|
|
42
42
|
var import_integration_secret = require("./integration-secret");
|
|
43
43
|
var import_typings = require("./typings");
|
|
44
44
|
var import_integration_secret2 = require("./integration-secret");
|
|
45
45
|
const INTEGRATION_JSON = "integration.json";
|
|
46
46
|
const generateIntegrationImplementationTypings = async (integration, implementationTypingsPath) => {
|
|
47
|
-
const indexModule = await
|
|
47
|
+
const indexModule = await import_integration_implementation.IntegrationImplementationIndexModule.create(integration);
|
|
48
48
|
indexModule.unshift(implementationTypingsPath);
|
|
49
49
|
return indexModule.flatten();
|
|
50
50
|
};
|
|
@@ -66,7 +66,7 @@ const generateIntegrationIndex = async (implementationTypingsPath, implementatio
|
|
|
66
66
|
};
|
|
67
67
|
const generateIntegrationInstance = async (integration, installPath) => {
|
|
68
68
|
const indexModule = await import_integration_instance.IntegrationInstanceIndexModule.create(integration);
|
|
69
|
-
const dirname =
|
|
69
|
+
const dirname = utils.casing.to.kebabCase(integration.name);
|
|
70
70
|
indexModule.unshift(installPath, dirname);
|
|
71
71
|
const files = indexModule.flatten();
|
|
72
72
|
const { name, version, id } = integration;
|
|
@@ -81,10 +81,42 @@ const generateIntegrationInstance = async (integration, installPath) => {
|
|
|
81
81
|
});
|
|
82
82
|
return files;
|
|
83
83
|
};
|
|
84
|
-
const generateBotIndex = async (installPath, instances) =>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
const generateBotIndex = async (installPath, instances) => {
|
|
85
|
+
const lines = [
|
|
86
|
+
import_const.GENERATED_HEADER,
|
|
87
|
+
"import * as sdk from '@botpress/sdk'",
|
|
88
|
+
...instances.map(
|
|
89
|
+
(instance) => `import * as ${utils.casing.to.camelCase(instance)} from './${installPath}/${instance}'`
|
|
90
|
+
),
|
|
91
|
+
...instances.map(
|
|
92
|
+
(instance) => `export * as ${utils.casing.to.camelCase(instance)} from './${installPath}/${instance}'`
|
|
93
|
+
),
|
|
94
|
+
"",
|
|
95
|
+
"type TIntegrations = {",
|
|
96
|
+
...instances.map(
|
|
97
|
+
(instance) => ` ${utils.casing.to.camelCase(instance)}: ${utils.casing.to.camelCase(instance)}.T${utils.casing.to.pascalCase(
|
|
98
|
+
instance
|
|
99
|
+
)}`
|
|
100
|
+
),
|
|
101
|
+
"}",
|
|
102
|
+
"",
|
|
103
|
+
"type BaseStates = sdk.Bot extends sdk.Bot<any, infer TStates, any> ? TStates : never",
|
|
104
|
+
"type BaseEvents = sdk.Bot extends sdk.Bot<any, any, infer TEvents> ? TEvents : never",
|
|
105
|
+
"",
|
|
106
|
+
"export class Bot<",
|
|
107
|
+
" TStates extends BaseStates,",
|
|
108
|
+
" TEvents extends BaseEvents",
|
|
109
|
+
"> extends sdk.Bot<",
|
|
110
|
+
" TIntegrations,",
|
|
111
|
+
" TStates,",
|
|
112
|
+
" TEvents",
|
|
113
|
+
"> {}"
|
|
114
|
+
];
|
|
115
|
+
return {
|
|
116
|
+
path: import_const.INDEX_FILE,
|
|
117
|
+
content: lines.join("\n")
|
|
118
|
+
};
|
|
119
|
+
};
|
|
88
120
|
// Annotate the CommonJS export names for ESM import in node:
|
|
89
121
|
0 && (module.exports = {
|
|
90
122
|
File,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/code-generation/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type * as client from '@botpress/client'\nimport type { IntegrationDefinition } from '@botpress/sdk'\nimport pathlib from 'path'\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAAoB;AACpB,
|
|
4
|
+
"sourcesContent": ["import type * as client from '@botpress/client'\nimport type { IntegrationDefinition } from '@botpress/sdk'\nimport pathlib from 'path'\nimport * as utils from '../utils'\nimport { GENERATED_HEADER, INDEX_FILE } from './const'\nimport { IntegrationImplementationIndexModule } from './integration-implementation'\nimport { IntegrationInstanceIndexModule } from './integration-instance'\nimport { IntegrationSecretIndexModule } from './integration-secret'\nimport type * as types from './typings'\n\nexport { File } from './typings'\nexport { secretEnvVariableName } from './integration-secret'\nexport const INTEGRATION_JSON = 'integration.json'\n\nexport const generateIntegrationImplementationTypings = async (\n integration: IntegrationDefinition,\n implementationTypingsPath: string\n): Promise<types.File[]> => {\n const indexModule = await IntegrationImplementationIndexModule.create(integration)\n indexModule.unshift(implementationTypingsPath)\n return indexModule.flatten()\n}\n\nexport const generateIntegrationSecrets = async (\n integration: IntegrationDefinition,\n secretsPath: string\n): Promise<types.File[]> => {\n const indexModule = await IntegrationSecretIndexModule.create(integration)\n indexModule.unshift(secretsPath)\n return indexModule.flatten()\n}\n\nexport const generateIntegrationIndex = async (\n implementationTypingsPath: string,\n implementationSecretsPath: string\n): Promise<types.File> => {\n let content = ''\n content += `export * from './${implementationTypingsPath}'\\n`\n content += `export * from './${implementationSecretsPath}'\\n`\n return {\n path: INDEX_FILE,\n content,\n }\n}\n\nexport type IntegrationInstanceJson = {\n name: string\n version: string\n id: string\n}\n\nexport const generateIntegrationInstance = async (\n integration: client.Integration,\n installPath: string\n): Promise<types.File[]> => {\n const indexModule = await IntegrationInstanceIndexModule.create(integration)\n const dirname = utils.casing.to.kebabCase(integration.name)\n indexModule.unshift(installPath, dirname)\n const files = indexModule.flatten()\n\n const { name, version, id } = integration\n const json: IntegrationInstanceJson = {\n name,\n version,\n id,\n }\n files.push({\n path: pathlib.join(installPath, dirname, INTEGRATION_JSON),\n content: JSON.stringify(json, null, 2),\n })\n\n return files\n}\n\nexport const generateBotIndex = async (installPath: string, instances: string[]): Promise<types.File> => {\n const lines: string[] = [\n GENERATED_HEADER,\n \"import * as sdk from '@botpress/sdk'\",\n ...instances.map(\n (instance) => `import * as ${utils.casing.to.camelCase(instance)} from './${installPath}/${instance}'`\n ),\n ...instances.map(\n (instance) => `export * as ${utils.casing.to.camelCase(instance)} from './${installPath}/${instance}'`\n ),\n '',\n 'type TIntegrations = {',\n ...instances.map(\n (instance) =>\n ` ${utils.casing.to.camelCase(instance)}: ${utils.casing.to.camelCase(instance)}.T${utils.casing.to.pascalCase(\n instance\n )}`\n ),\n '}',\n '',\n 'type BaseStates = sdk.Bot extends sdk.Bot<any, infer TStates, any> ? TStates : never',\n 'type BaseEvents = sdk.Bot extends sdk.Bot<any, any, infer TEvents> ? TEvents : never',\n '',\n 'export class Bot<',\n ' TStates extends BaseStates,',\n ' TEvents extends BaseEvents',\n '> extends sdk.Bot<',\n ' TIntegrations,',\n ' TStates,',\n ' TEvents',\n '> {}',\n ]\n\n return {\n path: INDEX_FILE,\n content: lines.join('\\n'),\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAAoB;AACpB,YAAuB;AACvB,mBAA6C;AAC7C,wCAAqD;AACrD,kCAA+C;AAC/C,gCAA6C;AAG7C,qBAAqB;AACrB,IAAAA,6BAAsC;AAC/B,MAAM,mBAAmB;AAEzB,MAAM,2CAA2C,OACtD,aACA,8BAC0B;AAC1B,QAAM,cAAc,MAAM,uEAAqC,OAAO,WAAW;AACjF,cAAY,QAAQ,yBAAyB;AAC7C,SAAO,YAAY,QAAQ;AAC7B;AAEO,MAAM,6BAA6B,OACxC,aACA,gBAC0B;AAC1B,QAAM,cAAc,MAAM,uDAA6B,OAAO,WAAW;AACzE,cAAY,QAAQ,WAAW;AAC/B,SAAO,YAAY,QAAQ;AAC7B;AAEO,MAAM,2BAA2B,OACtC,2BACA,8BACwB;AACxB,MAAI,UAAU;AACd,aAAW,oBAAoB;AAAA;AAC/B,aAAW,oBAAoB;AAAA;AAC/B,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,EACF;AACF;AAQO,MAAM,8BAA8B,OACzC,aACA,gBAC0B;AAC1B,QAAM,cAAc,MAAM,2DAA+B,OAAO,WAAW;AAC3E,QAAM,UAAU,MAAM,OAAO,GAAG,UAAU,YAAY,IAAI;AAC1D,cAAY,QAAQ,aAAa,OAAO;AACxC,QAAM,QAAQ,YAAY,QAAQ;AAElC,QAAM,EAAE,MAAM,SAAS,GAAG,IAAI;AAC9B,QAAM,OAAgC;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,KAAK;AAAA,IACT,MAAM,YAAAC,QAAQ,KAAK,aAAa,SAAS,gBAAgB;AAAA,IACzD,SAAS,KAAK,UAAU,MAAM,MAAM,CAAC;AAAA,EACvC,CAAC;AAED,SAAO;AACT;AAEO,MAAM,mBAAmB,OAAO,aAAqB,cAA6C;AACvG,QAAM,QAAkB;AAAA,IACtB;AAAA,IACA;AAAA,IACA,GAAG,UAAU;AAAA,MACX,CAAC,aAAa,eAAe,MAAM,OAAO,GAAG,UAAU,QAAQ,aAAa,eAAe;AAAA,IAC7F;AAAA,IACA,GAAG,UAAU;AAAA,MACX,CAAC,aAAa,eAAe,MAAM,OAAO,GAAG,UAAU,QAAQ,aAAa,eAAe;AAAA,IAC7F;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,UAAU;AAAA,MACX,CAAC,aACC,KAAK,MAAM,OAAO,GAAG,UAAU,QAAQ,MAAM,MAAM,OAAO,GAAG,UAAU,QAAQ,MAAM,MAAM,OAAO,GAAG;AAAA,QACnG;AAAA,MACF;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS,MAAM,KAAK,IAAI;AAAA,EAC1B;AACF;",
|
|
6
6
|
"names": ["import_integration_secret", "pathlib"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var integration_implementation_exports = {};
|
|
26
|
+
__export(integration_implementation_exports, {
|
|
27
|
+
IntegrationImplementationIndexModule: () => IntegrationImplementationIndexModule
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(integration_implementation_exports);
|
|
30
|
+
var utils = __toESM(require("../utils"));
|
|
31
|
+
var import_const = require("./const");
|
|
32
|
+
var import_generators = require("./generators");
|
|
33
|
+
var import_actions_module = require("./integration-schemas/actions-module");
|
|
34
|
+
var import_channels_module = require("./integration-schemas/channels-module");
|
|
35
|
+
var import_configuration_module = require("./integration-schemas/configuration-module");
|
|
36
|
+
var import_events_module = require("./integration-schemas/events-module");
|
|
37
|
+
var import_states_module = require("./integration-schemas/states-module");
|
|
38
|
+
var import_module = require("./module");
|
|
39
|
+
class IntegrationImplementationIndexModule extends import_module.Module {
|
|
40
|
+
constructor(integration, configModule, actionsModule, channelsModule, eventsModule, statesModule, def) {
|
|
41
|
+
super(def);
|
|
42
|
+
this.integration = integration;
|
|
43
|
+
this.configModule = configModule;
|
|
44
|
+
this.actionsModule = actionsModule;
|
|
45
|
+
this.channelsModule = channelsModule;
|
|
46
|
+
this.eventsModule = eventsModule;
|
|
47
|
+
this.statesModule = statesModule;
|
|
48
|
+
}
|
|
49
|
+
static async create(sdkIntegration) {
|
|
50
|
+
const integration = this._mapIntegration(sdkIntegration);
|
|
51
|
+
const configModule = await import_configuration_module.ConfigurationModule.create(integration.configuration ?? { schema: {} });
|
|
52
|
+
configModule.unshift("configuration");
|
|
53
|
+
const actionsModule = await import_actions_module.ActionsModule.create(integration.actions ?? {});
|
|
54
|
+
actionsModule.unshift("actions");
|
|
55
|
+
const channelsModule = await import_channels_module.ChannelsModule.create(integration.channels ?? {});
|
|
56
|
+
channelsModule.unshift("channels");
|
|
57
|
+
const eventsModule = await import_events_module.EventsModule.create(integration.events ?? {});
|
|
58
|
+
eventsModule.unshift("events");
|
|
59
|
+
const statesModule = await import_states_module.StatesModule.create(integration.states ?? {});
|
|
60
|
+
statesModule.unshift("states");
|
|
61
|
+
const inst = new IntegrationImplementationIndexModule(
|
|
62
|
+
integration,
|
|
63
|
+
configModule,
|
|
64
|
+
actionsModule,
|
|
65
|
+
channelsModule,
|
|
66
|
+
eventsModule,
|
|
67
|
+
statesModule,
|
|
68
|
+
{
|
|
69
|
+
path: import_const.INDEX_FILE,
|
|
70
|
+
exportName: "Integration",
|
|
71
|
+
content: ""
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
inst.pushDep(configModule);
|
|
75
|
+
inst.pushDep(actionsModule);
|
|
76
|
+
inst.pushDep(channelsModule);
|
|
77
|
+
inst.pushDep(eventsModule);
|
|
78
|
+
inst.pushDep(statesModule);
|
|
79
|
+
return inst;
|
|
80
|
+
}
|
|
81
|
+
get content() {
|
|
82
|
+
let content = import_const.GENERATED_HEADER;
|
|
83
|
+
const { configModule, actionsModule, channelsModule, eventsModule, statesModule, integration } = this;
|
|
84
|
+
const configImport = configModule.import(this);
|
|
85
|
+
const actionsImport = actionsModule.import(this);
|
|
86
|
+
const channelsImport = channelsModule.import(this);
|
|
87
|
+
const eventsImport = eventsModule.import(this);
|
|
88
|
+
const statesImport = statesModule.import(this);
|
|
89
|
+
content += [
|
|
90
|
+
import_const.GENERATED_HEADER,
|
|
91
|
+
'import * as sdk from "@botpress/sdk"',
|
|
92
|
+
"",
|
|
93
|
+
`import type * as ${configModule.name} from "./${configImport}"`,
|
|
94
|
+
`import type * as ${actionsModule.name} from "./${actionsImport}"`,
|
|
95
|
+
`import type * as ${channelsModule.name} from "./${channelsImport}"`,
|
|
96
|
+
`import type * as ${eventsModule.name} from "./${eventsImport}"`,
|
|
97
|
+
`import type * as ${statesModule.name} from "./${statesImport}"`,
|
|
98
|
+
`export * as ${configModule.name} from "./${configImport}"`,
|
|
99
|
+
`export * as ${actionsModule.name} from "./${actionsImport}"`,
|
|
100
|
+
`export * as ${channelsModule.name} from "./${channelsImport}"`,
|
|
101
|
+
`export * as ${eventsModule.name} from "./${eventsImport}"`,
|
|
102
|
+
`export * as ${statesModule.name} from "./${statesImport}"`,
|
|
103
|
+
"",
|
|
104
|
+
"type TIntegration = {",
|
|
105
|
+
` name: "${integration.name}"`,
|
|
106
|
+
` version: "${integration.version}"`,
|
|
107
|
+
` configuration: ${configModule.name}.${configModule.exports}`,
|
|
108
|
+
` actions: ${actionsModule.name}.${actionsModule.exports}`,
|
|
109
|
+
` channels: ${channelsModule.name}.${channelsModule.exports}`,
|
|
110
|
+
` events: ${eventsModule.name}.${eventsModule.exports}`,
|
|
111
|
+
` states: ${statesModule.name}.${statesModule.exports}`,
|
|
112
|
+
` user: ${(0, import_generators.stringifySingleLine)(integration.user)}`,
|
|
113
|
+
"}",
|
|
114
|
+
"",
|
|
115
|
+
"export type IntegrationProps = sdk.IntegrationProps<TIntegration>",
|
|
116
|
+
"",
|
|
117
|
+
"export class Integration extends sdk.Integration<TIntegration> {}",
|
|
118
|
+
"",
|
|
119
|
+
"export type Client = sdk.IntegrationSpecificClient<TIntegration>"
|
|
120
|
+
].join("\n");
|
|
121
|
+
return content;
|
|
122
|
+
}
|
|
123
|
+
static _mapIntegration = (i) => ({
|
|
124
|
+
name: i.name,
|
|
125
|
+
version: i.version,
|
|
126
|
+
user: {
|
|
127
|
+
tags: i.user?.tags ?? {},
|
|
128
|
+
creation: i.user?.creation ?? { enabled: false, requiredTags: [] }
|
|
129
|
+
},
|
|
130
|
+
configuration: i.configuration ? this._mapSchema(i.configuration) : { schema: {} },
|
|
131
|
+
events: i.events ? utils.records.mapValues(i.events, this._mapSchema) : {},
|
|
132
|
+
states: i.states ? utils.records.mapValues(i.states, this._mapSchema) : {},
|
|
133
|
+
actions: i.actions ? utils.records.mapValues(i.actions, (a) => ({
|
|
134
|
+
input: this._mapSchema(a.input),
|
|
135
|
+
output: this._mapSchema(a.output)
|
|
136
|
+
})) : {},
|
|
137
|
+
channels: i.channels ? utils.records.mapValues(i.channels, (c) => ({
|
|
138
|
+
conversation: {
|
|
139
|
+
tags: c.conversation?.tags ?? {},
|
|
140
|
+
creation: c.conversation?.creation ?? { enabled: false, requiredTags: [] }
|
|
141
|
+
},
|
|
142
|
+
message: {
|
|
143
|
+
tags: c.message?.tags ?? {}
|
|
144
|
+
},
|
|
145
|
+
messages: utils.records.mapValues(c.messages, this._mapSchema)
|
|
146
|
+
})) : {}
|
|
147
|
+
});
|
|
148
|
+
static _mapSchema = (x) => ({
|
|
149
|
+
...x,
|
|
150
|
+
schema: utils.schema.mapZodToJsonSchema(x)
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
154
|
+
0 && (module.exports = {
|
|
155
|
+
IntegrationImplementationIndexModule
|
|
156
|
+
});
|
|
157
|
+
//# sourceMappingURL=integration-implementation.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/code-generation/integration-implementation.ts"],
|
|
4
|
+
"sourcesContent": ["import * as bpsdk from '@botpress/sdk'\nimport { z } from 'zod'\nimport * as utils from '../utils'\nimport { GENERATED_HEADER, INDEX_FILE } from './const'\nimport { stringifySingleLine } from './generators'\nimport { ActionsModule } from './integration-schemas/actions-module'\nimport { ChannelsModule } from './integration-schemas/channels-module'\nimport { ConfigurationModule } from './integration-schemas/configuration-module'\nimport { EventsModule } from './integration-schemas/events-module'\nimport { StatesModule } from './integration-schemas/states-module'\nimport { Module, ModuleDef } from './module'\nimport * as types from './typings'\n\nexport class IntegrationImplementationIndexModule extends Module {\n public static async create(\n sdkIntegration: bpsdk.IntegrationDefinition\n ): Promise<IntegrationImplementationIndexModule> {\n const integration = this._mapIntegration(sdkIntegration)\n\n const configModule = await ConfigurationModule.create(integration.configuration ?? { schema: {} })\n configModule.unshift('configuration')\n\n const actionsModule = await ActionsModule.create(integration.actions ?? {})\n actionsModule.unshift('actions')\n\n const channelsModule = await ChannelsModule.create(integration.channels ?? {})\n channelsModule.unshift('channels')\n\n const eventsModule = await EventsModule.create(integration.events ?? {})\n eventsModule.unshift('events')\n\n const statesModule = await StatesModule.create(integration.states ?? {})\n statesModule.unshift('states')\n\n const inst = new IntegrationImplementationIndexModule(\n integration,\n configModule,\n actionsModule,\n channelsModule,\n eventsModule,\n statesModule,\n {\n path: INDEX_FILE,\n exportName: 'Integration',\n content: '',\n }\n )\n\n inst.pushDep(configModule)\n inst.pushDep(actionsModule)\n inst.pushDep(channelsModule)\n inst.pushDep(eventsModule)\n inst.pushDep(statesModule)\n return inst\n }\n\n private constructor(\n private integration: types.IntegrationDefinition,\n private configModule: ConfigurationModule,\n private actionsModule: ActionsModule,\n private channelsModule: ChannelsModule,\n private eventsModule: EventsModule,\n private statesModule: StatesModule,\n def: ModuleDef\n ) {\n super(def)\n }\n\n public override get content(): string {\n let content = GENERATED_HEADER\n\n const { configModule, actionsModule, channelsModule, eventsModule, statesModule, integration } = this\n\n const configImport = configModule.import(this)\n const actionsImport = actionsModule.import(this)\n const channelsImport = channelsModule.import(this)\n const eventsImport = eventsModule.import(this)\n const statesImport = statesModule.import(this)\n\n content += [\n GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n '',\n `import type * as ${configModule.name} from \"./${configImport}\"`,\n `import type * as ${actionsModule.name} from \"./${actionsImport}\"`,\n `import type * as ${channelsModule.name} from \"./${channelsImport}\"`,\n `import type * as ${eventsModule.name} from \"./${eventsImport}\"`,\n `import type * as ${statesModule.name} from \"./${statesImport}\"`,\n `export * as ${configModule.name} from \"./${configImport}\"`,\n `export * as ${actionsModule.name} from \"./${actionsImport}\"`,\n `export * as ${channelsModule.name} from \"./${channelsImport}\"`,\n `export * as ${eventsModule.name} from \"./${eventsImport}\"`,\n `export * as ${statesModule.name} from \"./${statesImport}\"`,\n '',\n 'type TIntegration = {',\n ` name: \"${integration.name}\"`,\n ` version: \"${integration.version}\"`,\n ` configuration: ${configModule.name}.${configModule.exports}`,\n ` actions: ${actionsModule.name}.${actionsModule.exports}`,\n ` channels: ${channelsModule.name}.${channelsModule.exports}`,\n ` events: ${eventsModule.name}.${eventsModule.exports}`,\n ` states: ${statesModule.name}.${statesModule.exports}`,\n ` user: ${stringifySingleLine(integration.user)}`,\n '}',\n '',\n 'export type IntegrationProps = sdk.IntegrationProps<TIntegration>',\n '',\n 'export class Integration extends sdk.Integration<TIntegration> {}',\n '',\n 'export type Client = sdk.IntegrationSpecificClient<TIntegration>',\n ].join('\\n')\n\n return content\n }\n\n private static _mapIntegration = (i: bpsdk.IntegrationDefinition): types.IntegrationDefinition => ({\n name: i.name,\n version: i.version,\n user: {\n tags: i.user?.tags ?? {},\n creation: i.user?.creation ?? { enabled: false, requiredTags: [] },\n },\n configuration: i.configuration ? this._mapSchema(i.configuration) : { schema: {} },\n events: i.events ? utils.records.mapValues(i.events, this._mapSchema) : {},\n states: i.states ? utils.records.mapValues(i.states, this._mapSchema) : {},\n actions: i.actions\n ? utils.records.mapValues(i.actions, (a) => ({\n input: this._mapSchema(a.input),\n output: this._mapSchema(a.output),\n }))\n : {},\n channels: i.channels\n ? utils.records.mapValues(i.channels, (c) => ({\n conversation: {\n tags: c.conversation?.tags ?? {},\n creation: c.conversation?.creation ?? { enabled: false, requiredTags: [] },\n },\n message: {\n tags: c.message?.tags ?? {},\n },\n messages: utils.records.mapValues(c.messages, this._mapSchema),\n }))\n : {},\n })\n\n private static _mapSchema = <T extends { schema: z.ZodObject<any> }>(\n x: T\n ): utils.types.Merge<T, { schema: ReturnType<typeof utils.schema.mapZodToJsonSchema> }> => ({\n ...x,\n schema: utils.schema.mapZodToJsonSchema(x),\n })\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,mBAA6C;AAC7C,wBAAoC;AACpC,4BAA8B;AAC9B,6BAA+B;AAC/B,kCAAoC;AACpC,2BAA6B;AAC7B,2BAA6B;AAC7B,oBAAkC;AAG3B,MAAM,6CAA6C,qBAAO;AAAA,EA2CvD,YACE,aACA,cACA,eACA,gBACA,cACA,cACR,KACA;AACA,UAAM,GAAG;AARD;AACA;AACA;AACA;AACA;AACA;AAAA,EAIV;AAAA,EApDA,aAAoB,OAClB,gBAC+C;AAC/C,UAAM,cAAc,KAAK,gBAAgB,cAAc;AAEvD,UAAM,eAAe,MAAM,gDAAoB,OAAO,YAAY,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC;AACjG,iBAAa,QAAQ,eAAe;AAEpC,UAAM,gBAAgB,MAAM,oCAAc,OAAO,YAAY,WAAW,CAAC,CAAC;AAC1E,kBAAc,QAAQ,SAAS;AAE/B,UAAM,iBAAiB,MAAM,sCAAe,OAAO,YAAY,YAAY,CAAC,CAAC;AAC7E,mBAAe,QAAQ,UAAU;AAEjC,UAAM,eAAe,MAAM,kCAAa,OAAO,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,EAAE;AAAA,MAC3E;AAAA,MACA,SAAS;AAAA,QACP,MAAM,EAAE,SAAS,QAAQ,CAAC;AAAA,MAC5B;AAAA,MACA,UAAU,MAAM,QAAQ,UAAU,EAAE,UAAU,KAAK,UAAU;AAAA,IAC/D,EAAE,IACF,CAAC;AAAA,EACP;AAAA,EAEA,OAAe,aAAa,CAC1B,OAC0F;AAAA,IAC1F,GAAG;AAAA,IACH,QAAQ,MAAM,OAAO,mBAAmB,CAAC;AAAA,EAC3C;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -22,53 +22,115 @@ __export(integration_instance_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(integration_instance_exports);
|
|
24
24
|
var import_utils = require("../utils");
|
|
25
|
-
var import_configuration = require("./configuration");
|
|
26
25
|
var import_const = require("./const");
|
|
26
|
+
var import_generators = require("./generators");
|
|
27
|
+
var import_actions_module = require("./integration-schemas/actions-module");
|
|
28
|
+
var import_channels_module = require("./integration-schemas/channels-module");
|
|
29
|
+
var import_configuration_module = require("./integration-schemas/configuration-module");
|
|
30
|
+
var import_events_module = require("./integration-schemas/events-module");
|
|
31
|
+
var import_states_module = require("./integration-schemas/states-module");
|
|
27
32
|
var import_module = require("./module");
|
|
28
|
-
const CONTENT = ({
|
|
29
|
-
name,
|
|
30
|
-
className,
|
|
31
|
-
propsName,
|
|
32
|
-
version,
|
|
33
|
-
id
|
|
34
|
-
}) => `
|
|
35
|
-
import type { IntegrationInstance } from '@botpress/sdk'
|
|
36
|
-
import type { Configuration } from './configuration'
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export type ${propsName} = {
|
|
40
|
-
enabled?: boolean
|
|
41
|
-
config?: Configuration
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export class ${className} implements IntegrationInstance {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
public readonly name = '${name}'
|
|
48
|
-
public readonly version = '${version}'
|
|
49
|
-
public readonly id = '${id}'
|
|
50
|
-
|
|
51
|
-
public readonly enabled?: boolean
|
|
52
|
-
public readonly configuration?: Configuration
|
|
53
|
-
|
|
54
|
-
constructor(props?: ${propsName}) {
|
|
55
|
-
this.enabled = props?.enabled
|
|
56
|
-
this.configuration = props?.config
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
60
33
|
class IntegrationInstanceIndexModule extends import_module.Module {
|
|
34
|
+
constructor(integration, configModule, actionsModule, channelsModule, eventsModule, statesModule, def) {
|
|
35
|
+
super(def);
|
|
36
|
+
this.integration = integration;
|
|
37
|
+
this.configModule = configModule;
|
|
38
|
+
this.actionsModule = actionsModule;
|
|
39
|
+
this.channelsModule = channelsModule;
|
|
40
|
+
this.eventsModule = eventsModule;
|
|
41
|
+
this.statesModule = statesModule;
|
|
42
|
+
}
|
|
61
43
|
static async create(integration) {
|
|
62
|
-
const { name
|
|
63
|
-
const configModule = await
|
|
44
|
+
const { name } = integration;
|
|
45
|
+
const configModule = await import_configuration_module.ConfigurationModule.create(integration.configuration ?? { schema: {} });
|
|
46
|
+
configModule.unshift("configuration");
|
|
47
|
+
const actionsModule = await import_actions_module.ActionsModule.create(integration.actions ?? {});
|
|
48
|
+
actionsModule.unshift("actions");
|
|
49
|
+
const channelsModule = await import_channels_module.ChannelsModule.create(integration.channels ?? {});
|
|
50
|
+
channelsModule.unshift("channels");
|
|
51
|
+
const eventsModule = await import_events_module.EventsModule.create(integration.events ?? {});
|
|
52
|
+
eventsModule.unshift("events");
|
|
53
|
+
const statesModule = await import_states_module.StatesModule.create(integration.states ?? {});
|
|
54
|
+
statesModule.unshift("states");
|
|
64
55
|
const exportName = import_utils.casing.to.pascalCase(name);
|
|
65
|
-
const
|
|
66
|
-
|
|
56
|
+
const inst = new IntegrationInstanceIndexModule(
|
|
57
|
+
integration,
|
|
58
|
+
configModule,
|
|
59
|
+
actionsModule,
|
|
60
|
+
channelsModule,
|
|
61
|
+
eventsModule,
|
|
62
|
+
statesModule,
|
|
63
|
+
{
|
|
64
|
+
path: import_const.INDEX_FILE,
|
|
65
|
+
content: "",
|
|
66
|
+
exportName
|
|
67
|
+
}
|
|
68
|
+
);
|
|
67
69
|
inst.pushDep(configModule);
|
|
70
|
+
inst.pushDep(actionsModule);
|
|
71
|
+
inst.pushDep(channelsModule);
|
|
72
|
+
inst.pushDep(eventsModule);
|
|
73
|
+
inst.pushDep(statesModule);
|
|
68
74
|
return inst;
|
|
69
75
|
}
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
get content() {
|
|
77
|
+
const { configModule, actionsModule, channelsModule, eventsModule, statesModule, integration } = this;
|
|
78
|
+
const configImport = configModule.import(this);
|
|
79
|
+
const actionsImport = actionsModule.import(this);
|
|
80
|
+
const channelsImport = channelsModule.import(this);
|
|
81
|
+
const eventsImport = eventsModule.import(this);
|
|
82
|
+
const statesImport = statesModule.import(this);
|
|
83
|
+
const { name, version, id } = integration;
|
|
84
|
+
const className = import_utils.casing.to.pascalCase(name);
|
|
85
|
+
const propsName = `${className}Props`;
|
|
86
|
+
const lines = [
|
|
87
|
+
import_const.GENERATED_HEADER,
|
|
88
|
+
"import type { IntegrationInstance } from '@botpress/sdk'",
|
|
89
|
+
"",
|
|
90
|
+
`import type * as ${configModule.name} from "./${configImport}"`,
|
|
91
|
+
`import type * as ${actionsModule.name} from "./${actionsImport}"`,
|
|
92
|
+
`import type * as ${channelsModule.name} from "./${channelsImport}"`,
|
|
93
|
+
`import type * as ${eventsModule.name} from "./${eventsImport}"`,
|
|
94
|
+
`import type * as ${statesModule.name} from "./${statesImport}"`,
|
|
95
|
+
`export * as ${configModule.name} from "./${configImport}"`,
|
|
96
|
+
`export * as ${actionsModule.name} from "./${actionsImport}"`,
|
|
97
|
+
`export * as ${channelsModule.name} from "./${channelsImport}"`,
|
|
98
|
+
`export * as ${eventsModule.name} from "./${eventsImport}"`,
|
|
99
|
+
`export * as ${statesModule.name} from "./${statesImport}"`,
|
|
100
|
+
"",
|
|
101
|
+
`export type ${propsName} = {`,
|
|
102
|
+
" enabled?: boolean",
|
|
103
|
+
` config?: ${configModule.name}.${configModule.exports}`,
|
|
104
|
+
"}",
|
|
105
|
+
"",
|
|
106
|
+
`export type T${className} = {`,
|
|
107
|
+
` name: '${name}'`,
|
|
108
|
+
` version: '${version}'`,
|
|
109
|
+
` configuration: ${configModule.name}.${configModule.exports}`,
|
|
110
|
+
` actions: ${actionsModule.name}.${actionsModule.exports}`,
|
|
111
|
+
` channels: ${channelsModule.name}.${channelsModule.exports}`,
|
|
112
|
+
` events: ${eventsModule.name}.${eventsModule.exports}`,
|
|
113
|
+
` states: ${statesModule.name}.${statesModule.exports}`,
|
|
114
|
+
` user: ${(0, import_generators.stringifySingleLine)(this.integration.user)}`,
|
|
115
|
+
"}",
|
|
116
|
+
"",
|
|
117
|
+
`export class ${className} implements IntegrationInstance<'${name}'> {`,
|
|
118
|
+
"",
|
|
119
|
+
` public readonly name = '${name}'`,
|
|
120
|
+
` public readonly version = '${version}'`,
|
|
121
|
+
` public readonly id = '${id}'`,
|
|
122
|
+
"",
|
|
123
|
+
" public readonly enabled?: boolean",
|
|
124
|
+
` public readonly configuration?: ${configModule.name}.${configModule.exports}`,
|
|
125
|
+
"",
|
|
126
|
+
` constructor(props?: ${propsName}) {`,
|
|
127
|
+
" this.enabled = props?.enabled",
|
|
128
|
+
" this.configuration = props?.config",
|
|
129
|
+
" }",
|
|
130
|
+
"}"
|
|
131
|
+
];
|
|
132
|
+
return `${import_const.GENERATED_HEADER}
|
|
133
|
+
${lines.join("\n")}`;
|
|
72
134
|
}
|
|
73
135
|
}
|
|
74
136
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/code-generation/integration-instance.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Integration } from '@botpress/client'\nimport { casing } from '../utils'\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAuB;AACvB,
|
|
4
|
+
"sourcesContent": ["import type { Integration } from '@botpress/client'\nimport { casing } from '../utils'\nimport { GENERATED_HEADER, INDEX_FILE } from './const'\nimport { stringifySingleLine } from './generators'\nimport { ActionsModule } from './integration-schemas/actions-module'\nimport { ChannelsModule } from './integration-schemas/channels-module'\nimport { ConfigurationModule } from './integration-schemas/configuration-module'\nimport { EventsModule } from './integration-schemas/events-module'\nimport { StatesModule } from './integration-schemas/states-module'\nimport { Module, ModuleDef } from './module'\n\nexport class IntegrationInstanceIndexModule extends Module {\n public static async create(integration: Integration): Promise<IntegrationInstanceIndexModule> {\n const { name } = integration\n\n const configModule = await ConfigurationModule.create(integration.configuration ?? { schema: {} })\n configModule.unshift('configuration')\n\n const actionsModule = await ActionsModule.create(integration.actions ?? {})\n actionsModule.unshift('actions')\n\n const channelsModule = await ChannelsModule.create(integration.channels ?? {})\n channelsModule.unshift('channels')\n\n const eventsModule = await EventsModule.create(integration.events ?? {})\n eventsModule.unshift('events')\n\n const statesModule = await StatesModule.create(integration.states ?? {})\n statesModule.unshift('states')\n\n const exportName = casing.to.pascalCase(name)\n\n const inst = new IntegrationInstanceIndexModule(\n integration,\n configModule,\n actionsModule,\n channelsModule,\n eventsModule,\n statesModule,\n {\n path: INDEX_FILE,\n content: '',\n exportName,\n }\n )\n\n inst.pushDep(configModule)\n inst.pushDep(actionsModule)\n inst.pushDep(channelsModule)\n inst.pushDep(eventsModule)\n inst.pushDep(statesModule)\n\n return inst\n }\n\n private constructor(\n private integration: Integration,\n private configModule: ConfigurationModule,\n private actionsModule: ActionsModule,\n private channelsModule: ChannelsModule,\n private eventsModule: EventsModule,\n private statesModule: StatesModule,\n def: ModuleDef\n ) {\n super(def)\n }\n\n public override get content(): string {\n const { configModule, actionsModule, channelsModule, eventsModule, statesModule, integration } = this\n\n const configImport = configModule.import(this)\n const actionsImport = actionsModule.import(this)\n const channelsImport = channelsModule.import(this)\n const eventsImport = eventsModule.import(this)\n const statesImport = statesModule.import(this)\n\n const { name, version, id } = integration\n const className = casing.to.pascalCase(name)\n const propsName = `${className}Props`\n\n const lines = [\n GENERATED_HEADER,\n \"import type { IntegrationInstance } from '@botpress/sdk'\",\n '',\n `import type * as ${configModule.name} from \"./${configImport}\"`,\n `import type * as ${actionsModule.name} from \"./${actionsImport}\"`,\n `import type * as ${channelsModule.name} from \"./${channelsImport}\"`,\n `import type * as ${eventsModule.name} from \"./${eventsImport}\"`,\n `import type * as ${statesModule.name} from \"./${statesImport}\"`,\n `export * as ${configModule.name} from \"./${configImport}\"`,\n `export * as ${actionsModule.name} from \"./${actionsImport}\"`,\n `export * as ${channelsModule.name} from \"./${channelsImport}\"`,\n `export * as ${eventsModule.name} from \"./${eventsImport}\"`,\n `export * as ${statesModule.name} from \"./${statesImport}\"`,\n '',\n `export type ${propsName} = {`,\n ' enabled?: boolean',\n ` config?: ${configModule.name}.${configModule.exports}`,\n '}',\n '',\n `export type T${className} = {`,\n ` name: '${name}'`,\n ` version: '${version}'`,\n ` configuration: ${configModule.name}.${configModule.exports}`,\n ` actions: ${actionsModule.name}.${actionsModule.exports}`,\n ` channels: ${channelsModule.name}.${channelsModule.exports}`,\n ` events: ${eventsModule.name}.${eventsModule.exports}`,\n ` states: ${statesModule.name}.${statesModule.exports}`,\n ` user: ${stringifySingleLine(this.integration.user)}`,\n '}',\n '',\n `export class ${className} implements IntegrationInstance<'${name}'> {`,\n '',\n ` public readonly name = '${name}'`,\n ` public readonly version = '${version}'`,\n ` public readonly id = '${id}'`,\n '',\n ' public readonly enabled?: boolean',\n ` public readonly configuration?: ${configModule.name}.${configModule.exports}`,\n '',\n ` constructor(props?: ${propsName}) {`,\n ' this.enabled = props?.enabled',\n ' this.configuration = props?.config',\n ' }',\n '}',\n ]\n\n return `${GENERATED_HEADER}\\n${lines.join('\\n')}`\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA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