@botpress/cli 2.0.0 → 2.0.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/.turbo/turbo-build.log +10 -10
- package/dist/api/bot-body.js +4 -0
- package/dist/api/bot-body.js.map +1 -1
- package/dist/api/client.js +4 -0
- package/dist/api/client.js.map +1 -1
- package/dist/api/find-previous-version.js +4 -0
- package/dist/api/find-previous-version.js.map +1 -1
- package/dist/api/find-previous-version.test.js +4 -0
- package/dist/api/find-previous-version.test.js.map +1 -1
- package/dist/api/integration-body.js +4 -0
- package/dist/api/integration-body.js.map +1 -1
- package/dist/api/interface-body.js +4 -0
- package/dist/api/interface-body.js.map +1 -1
- package/dist/api/paging.js.map +1 -1
- package/dist/api/plugin-body.js +5 -0
- package/dist/api/plugin-body.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-implementation.js +5 -0
- package/dist/code-generation/bot-implementation/bot-implementation.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-plugins/index.js +4 -0
- package/dist/code-generation/bot-implementation/bot-plugins/index.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js +4 -0
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js +4 -0
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js +4 -0
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-typings/index.js +4 -0
- package/dist/code-generation/bot-implementation/bot-typings/index.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js +4 -0
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js.map +1 -1
- package/dist/code-generation/bot-implementation/index.js +5 -0
- package/dist/code-generation/bot-implementation/index.js.map +1 -1
- package/dist/code-generation/generators.js +5 -0
- package/dist/code-generation/generators.js.map +1 -1
- package/dist/code-generation/integration-implementation/index.js +4 -0
- package/dist/code-generation/integration-implementation/index.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-implementation.js +4 -0
- package/dist/code-generation/integration-implementation/integration-implementation.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-secret.js +4 -0
- package/dist/code-generation/integration-implementation/integration-secret.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js.map +1 -1
- package/dist/code-generation/integration-package/index.js +4 -0
- package/dist/code-generation/integration-package/index.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js +5 -0
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/index.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/index.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/index.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/index.js.map +1 -1
- package/dist/code-generation/interface-package/index.js +4 -0
- package/dist/code-generation/interface-package/index.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/index.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/index.js.map +1 -1
- package/dist/code-generation/module.js +7 -0
- package/dist/code-generation/module.js.map +1 -1
- package/dist/code-generation/plugin-implementation/index.js +4 -0
- package/dist/code-generation/plugin-implementation/index.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-implementation.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-implementation.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js.map +1 -1
- package/dist/code-generation/plugin-package/index.js +5 -0
- package/dist/code-generation/plugin-package/index.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js.map +1 -1
- package/dist/code-generation/strings.js +4 -0
- package/dist/code-generation/strings.js.map +1 -1
- package/dist/command-definitions.js +4 -0
- package/dist/command-definitions.js.map +1 -1
- package/dist/command-implementations/add-command.js +67 -15
- package/dist/command-implementations/add-command.js.map +2 -2
- package/dist/command-implementations/base-command.js +4 -0
- package/dist/command-implementations/base-command.js.map +1 -1
- package/dist/command-implementations/bot-commands.js +4 -0
- package/dist/command-implementations/bot-commands.js.map +1 -1
- package/dist/command-implementations/bundle-command.js +4 -0
- package/dist/command-implementations/bundle-command.js.map +1 -1
- package/dist/command-implementations/deploy-command.js +4 -0
- package/dist/command-implementations/deploy-command.js.map +1 -1
- package/dist/command-implementations/dev-command.js +4 -0
- package/dist/command-implementations/dev-command.js.map +1 -1
- package/dist/command-implementations/gen-command.js +6 -1
- package/dist/command-implementations/gen-command.js.map +2 -2
- package/dist/command-implementations/global-command.js +4 -0
- package/dist/command-implementations/global-command.js.map +1 -1
- package/dist/command-implementations/index.js +4 -0
- package/dist/command-implementations/index.js.map +1 -1
- package/dist/command-implementations/init-command.js +4 -0
- package/dist/command-implementations/init-command.js.map +1 -1
- package/dist/command-implementations/integration-commands.js +4 -0
- package/dist/command-implementations/integration-commands.js.map +1 -1
- package/dist/command-implementations/interface-commands.js +4 -0
- package/dist/command-implementations/interface-commands.js.map +1 -1
- package/dist/command-implementations/lint-command.js +27 -0
- package/dist/command-implementations/lint-command.js.map +2 -2
- package/dist/command-implementations/login-command.js +4 -0
- package/dist/command-implementations/login-command.js.map +1 -1
- package/dist/command-implementations/plugin-commands.js +4 -0
- package/dist/command-implementations/plugin-commands.js.map +1 -1
- package/dist/command-implementations/project-command.js +4 -0
- package/dist/command-implementations/project-command.js.map +1 -1
- package/dist/command-implementations/read-command.js +4 -0
- package/dist/command-implementations/read-command.js.map +1 -1
- package/dist/command-implementations/serve-command.js +4 -0
- package/dist/command-implementations/serve-command.js.map +1 -1
- package/dist/command-tree.js.map +1 -1
- package/dist/config.js +7 -1
- package/dist/config.js.map +2 -2
- package/dist/consts.js +4 -0
- package/dist/consts.js.map +1 -1
- package/dist/errors.js +4 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/init.js +4 -0
- package/dist/init.js.map +1 -1
- package/dist/linter/base-linter.js.map +1 -1
- package/dist/linter/base-linter.test.js.map +1 -1
- package/dist/linter/ruleset-tests/bot.ruleset.test.js.map +1 -1
- package/dist/linter/ruleset-tests/common.js.map +1 -1
- package/dist/linter/ruleset-tests/integration.ruleset.test.js.map +1 -1
- package/dist/linter/ruleset-tests/interface.ruleset.test.js.map +1 -1
- package/dist/linter/rulesets/bot.ruleset.js.map +1 -1
- package/dist/linter/rulesets/integration.ruleset.js.map +1 -1
- package/dist/linter/rulesets/interface.ruleset.js.map +1 -1
- package/dist/logger/base-logger.js +4 -0
- package/dist/logger/base-logger.js.map +1 -1
- package/dist/logger/index.js +1 -0
- package/dist/logger/index.js.map +1 -1
- package/dist/package-ref.js +33 -0
- package/dist/package-ref.js.map +2 -2
- package/dist/package-ref.test.js +22 -0
- package/dist/package-ref.test.js.map +2 -2
- package/dist/register-yargs.js +4 -0
- package/dist/register-yargs.js.map +1 -1
- package/dist/root.js +4 -0
- package/dist/root.js.map +1 -1
- package/dist/sdk/resolve-integration-interfaces.js +5 -0
- package/dist/sdk/resolve-integration-interfaces.js.map +1 -1
- package/dist/sdk/validate-bot.js +4 -0
- package/dist/sdk/validate-bot.js.map +1 -1
- package/dist/sdk/validate-integration.js +4 -0
- package/dist/sdk/validate-integration.js.map +1 -1
- package/dist/utils/cache-utils.js +4 -0
- package/dist/utils/cache-utils.js.map +1 -1
- package/dist/utils/case-utils.js +4 -0
- package/dist/utils/case-utils.js.map +1 -1
- package/dist/utils/case-utils.test.js +4 -0
- package/dist/utils/case-utils.test.js.map +1 -1
- package/dist/utils/event-emitter.js.map +1 -1
- package/dist/utils/file-watcher.js +4 -0
- package/dist/utils/file-watcher.js.map +1 -1
- package/dist/utils/id-utils.js +4 -0
- package/dist/utils/id-utils.js.map +1 -1
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/object-utils.js.map +1 -1
- package/dist/utils/path-utils.js +6 -2
- package/dist/utils/path-utils.js.map +1 -1
- package/dist/utils/path-utils.test.js +4 -0
- package/dist/utils/path-utils.test.js.map +1 -1
- package/dist/utils/pkgjson-utils.js +4 -0
- package/dist/utils/pkgjson-utils.js.map +2 -2
- package/dist/utils/promise-utils.js.map +1 -1
- package/dist/utils/prompt-utils.js +4 -0
- package/dist/utils/prompt-utils.js.map +1 -1
- package/dist/utils/record-utils.js +4 -0
- package/dist/utils/record-utils.js.map +1 -1
- package/dist/utils/record-utils.test.js +4 -0
- package/dist/utils/record-utils.test.js.map +1 -1
- package/dist/utils/require-utils.js +4 -0
- package/dist/utils/require-utils.js.map +1 -1
- package/dist/utils/require-utils.test.js +4 -0
- package/dist/utils/require-utils.test.js.map +1 -1
- package/dist/utils/schema-utils.js.map +1 -1
- package/dist/utils/semver-utils.js.map +1 -1
- package/dist/utils/template-utils.js +4 -0
- package/dist/utils/template-utils.js.map +1 -1
- package/dist/utils/tunnel-utils.js +3 -0
- package/dist/utils/tunnel-utils.js.map +1 -1
- package/dist/worker/child-entrypoint.js +4 -0
- package/dist/worker/child-entrypoint.js.map +1 -1
- package/dist/worker/child-wrapper.js +5 -0
- package/dist/worker/child-wrapper.js.map +1 -1
- package/dist/worker/is-child.js.map +1 -1
- package/dist/worker/worker-state.js.map +1 -1
- package/dist/worker/worker.js +3 -0
- package/dist/worker/worker.js.map +1 -1
- package/package.json +6 -8
- package/templates/empty-bot/package.json +4 -5
- package/templates/empty-integration/package.json +4 -5
- package/templates/empty-plugin/package.json +3 -4
- package/templates/hello-world/package.json +4 -5
- package/templates/webhook-message/package.json +4 -5
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/code-generation/generators.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { JSONSchema7 } from 'json-schema'\nimport * as prettier from 'prettier'\nimport * as utils from '../utils'\nimport * as consts from './consts'\n\nexport const zuiSchemaToTypeScriptType = async (zuiSchema: sdk.z.Schema, name: string): Promise<string> => {\n let code = zuiSchema.toTypescript()\n code = `export type ${name} = ${code}`\n code = prettier.format(code, { parser: 'typescript' })\n return [\n //\n consts.GENERATED_HEADER,\n code,\n ].join('\\n')\n}\n\nexport const jsonSchemaToTypescriptZuiSchema = async (\n schema: JSONSchema7,\n name: string,\n extraProps: Record<string, string> = {}\n): Promise<string> => {\n schema = await utils.schema.dereferenceSchema(schema)\n const zuiSchema = sdk.z.fromJsonSchema(schema)\n let code = [\n consts.GENERATED_HEADER,\n 'import { z } from \"@botpress/sdk\"',\n `export const ${name} = {`,\n ...Object.entries(extraProps).map(([key, value]) => ` ${key}: ${value},`),\n ` schema: ${zuiSchema.toTypescriptSchema()}`,\n '}',\n ].join('\\n')\n code = prettier.format(code, { parser: 'typescript' })\n return code\n}\n\nexport const stringifySingleLine = (x: object): string => {\n return JSON.stringify(x, null, 1).replace(/\\n */g, ' ')\n}\n\nexport function primitiveToTypescriptValue(x: string | number | boolean | null | undefined): string {\n if (typeof x === 'undefined') {\n return 'undefined'\n }\n return JSON.stringify(x)\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAAqB;AAErB,eAA0B;AAC1B,YAAuB;AACvB,aAAwB;AAEjB,MAAM,4BAA4B,OAAO,WAAyB,SAAkC;AACzG,MAAI,OAAO,UAAU,aAAa;AAClC,SAAO,eAAe,UAAU;AAChC,SAAO,SAAS,OAAO,MAAM,EAAE,QAAQ,aAAa,CAAC;AACrD,SAAO;AAAA;AAAA,IAEL,OAAO;AAAA,IACP;AAAA,EACF,EAAE,KAAK,IAAI;AACb;AAEO,MAAM,kCAAkC,OAC7C,QACA,MACA,aAAqC,CAAC,MAClB;AACpB,WAAS,MAAM,MAAM,OAAO,kBAAkB,MAAM;AACpD,QAAM,YAAY,IAAI,EAAE,eAAe,MAAM;AAC7C,MAAI,OAAO;AAAA,IACT,OAAO;AAAA,IACP;AAAA,IACA,gBAAgB;AAAA,IAChB,GAAG,OAAO,QAAQ,UAAU,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,KAAK,QAAQ,QAAQ;AAAA,IACzE,aAAa,UAAU,mBAAmB;AAAA,IAC1C;AAAA,EACF,EAAE,KAAK,IAAI;AACX,SAAO,SAAS,OAAO,MAAM,EAAE,QAAQ,aAAa,CAAC;AACrD,SAAO;AACT;AAEO,MAAM,sBAAsB,CAAC,MAAsB;AACxD,SAAO,KAAK,UAAU,GAAG,MAAM,CAAC,EAAE,QAAQ,SAAS,GAAG;AACxD;AAEO,SAAS,2BAA2B,GAAyD;AAClG,MAAI,OAAO,MAAM,aAAa;AAC5B,WAAO;AAAA,EACT;AACA,SAAO,KAAK,UAAU,CAAC;AACzB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/code-generation/integration-implementation/index.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as consts from '../consts'\nimport * as types from '../typings'\nimport { IntegrationImplementationModule } from './integration-implementation'\nimport { IntegrationSecretIndexModule } from './integration-secret'\n\nconst generateIntegrationImplementationCls = async (\n sdkIntegrationDefinition: sdk.IntegrationDefinition,\n implPath: string\n): Promise<types.File[]> => {\n const indexModule = new IntegrationImplementationModule(sdkIntegrationDefinition)\n indexModule.unshift(implPath)\n return indexModule.flatten()\n}\n\nconst generateIntegrationSecrets = async (\n sdkIntegrationDefinition: sdk.IntegrationDefinition,\n secretsPath: string\n): Promise<types.File[]> => {\n const indexModule = new IntegrationSecretIndexModule(sdkIntegrationDefinition)\n indexModule.unshift(secretsPath)\n return indexModule.flatten()\n}\n\nconst generateIntegrationImplementationIndex = async (implPath: string, secretsPath: string): Promise<types.File> => {\n let content = ''\n content += `export * from './${implPath}'\\n`\n content += `export * from './${secretsPath}'\\n`\n return {\n path: consts.INDEX_FILE,\n content,\n }\n}\n\nexport const generateIntegrationImplementation = async (\n sdkIntegrationDefinition: sdk.IntegrationDefinition\n): Promise<types.File[]> => {\n const implPath = consts.fromOutDir.implementationDir\n const secretsPath = consts.fromOutDir.secretsDir\n const implFiles = await generateIntegrationImplementationCls(sdkIntegrationDefinition, implPath)\n const secretFiles = await generateIntegrationSecrets(sdkIntegrationDefinition, secretsPath)\n const indexFile = await generateIntegrationImplementationIndex(implPath, secretsPath)\n return [...implFiles, ...secretFiles, indexFile]\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AAExB,wCAAgD;AAChD,gCAA6C;AAE7C,MAAM,uCAAuC,OAC3C,0BACA,aAC0B;AAC1B,QAAM,cAAc,IAAI,kEAAgC,wBAAwB;AAChF,cAAY,QAAQ,QAAQ;AAC5B,SAAO,YAAY,QAAQ;AAC7B;AAEA,MAAM,6BAA6B,OACjC,0BACA,gBAC0B;AAC1B,QAAM,cAAc,IAAI,uDAA6B,wBAAwB;AAC7E,cAAY,QAAQ,WAAW;AAC/B,SAAO,YAAY,QAAQ;AAC7B;AAEA,MAAM,yCAAyC,OAAO,UAAkB,gBAA6C;AACnH,MAAI,UAAU;AACd,aAAW,oBAAoB;AAAA;AAC/B,aAAW,oBAAoB;AAAA;AAC/B,SAAO;AAAA,IACL,MAAM,OAAO;AAAA,IACb;AAAA,EACF;AACF;AAEO,MAAM,oCAAoC,OAC/C,6BAC0B;AAC1B,QAAM,WAAW,OAAO,WAAW;AACnC,QAAM,cAAc,OAAO,WAAW;AACtC,QAAM,YAAY,MAAM,qCAAqC,0BAA0B,QAAQ;AAC/F,QAAM,cAAc,MAAM,2BAA2B,0BAA0B,WAAW;AAC1F,QAAM,YAAY,MAAM,uCAAuC,UAAU,WAAW;AACpF,SAAO,CAAC,GAAG,WAAW,GAAG,aAAa,SAAS;AACjD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/code-generation/integration-implementation/integration-implementation.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as consts from '../consts'\nimport { Module } from '../module'\nimport { IntegrationTypingsModule } from './integration-typings'\n\nexport class IntegrationImplementationModule extends Module {\n private _typingsModule: IntegrationTypingsModule\n\n public constructor(integration: sdk.IntegrationDefinition) {\n super({\n path: consts.INDEX_FILE,\n exportName: 'Integration',\n })\n this._typingsModule = new IntegrationTypingsModule(integration)\n this._typingsModule.unshift('typings')\n this.pushDep(this._typingsModule)\n }\n\n public async getContent() {\n let content = ''\n\n const typingsImport = this._typingsModule.import(this)\n\n content += [\n consts.GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n `import * as ${this._typingsModule.name} from \"./${typingsImport}\"`,\n `export * from \"./${typingsImport}\"`,\n '',\n `type TIntegration = sdk.DefaultIntegration<${this._typingsModule.name}.${this._typingsModule.exportName}>`,\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 '',\n '// extra types',\n '',\n 'type Cast<X, Y> = X extends Y ? X : Y',\n 'type ValueOf<T> = T[keyof T]',\n 'type AsyncFunction = (...args: any[]) => Promise<any>',\n '',\n \"export type HandlerProps = Parameters<IntegrationProps['handler']>[0]\",\n '',\n 'export type ActionProps = {',\n \" [K in keyof IntegrationProps['actions']]: Parameters<IntegrationProps['actions'][K]>[0]\",\n '}',\n 'export type AnyActionProps = ValueOf<ActionProps>',\n '',\n 'export type MessageProps = {',\n \" [TChannel in keyof IntegrationProps['channels']]: {\",\n \" [TMessage in keyof IntegrationProps['channels'][TChannel]['messages']]: Parameters<\",\n \" IntegrationProps['channels'][TChannel]['messages'][TMessage]\",\n ' >[0]',\n ' }',\n '}',\n 'export type AnyMessageProps = ValueOf<ValueOf<MessageProps>>',\n '',\n \"export type Context = HandlerProps['ctx']\",\n \"export type Logger = HandlerProps['logger']\",\n '',\n 'export type AckFunctions = {',\n ' [TChannel in keyof MessageProps]: {',\n \" [TMessage in keyof MessageProps[TChannel]]: Cast<MessageProps[TChannel][TMessage], AnyMessageProps>['ack']\",\n ' }',\n '}',\n 'export type AnyAckFunction = ValueOf<ValueOf<AckFunctions>>',\n '',\n 'export type ClientOperation = ValueOf<{',\n ' [K in keyof Client as Client[K] extends AsyncFunction ? K : never]: K',\n '}>',\n 'export type ClientRequests = {',\n ' [K in ClientOperation]: Parameters<Client[K]>[0]',\n '}',\n 'export type ClientResponses = {',\n ' [K in ClientOperation]: Awaited<ReturnType<Client[K]>>',\n '}',\n ].join('\\n')\n\n return content\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,oBAAuB;AACvB,iCAAyC;AAElC,MAAM,wCAAwC,qBAAO;AAAA,EAClD;AAAA,EAED,YAAY,aAAwC;AACzD,UAAM;AAAA,MACJ,MAAM,OAAO;AAAA,MACb,YAAY;AAAA,IACd,CAAC;AACD,SAAK,iBAAiB,IAAI,oDAAyB,WAAW;AAC9D,SAAK,eAAe,QAAQ,SAAS;AACrC,SAAK,QAAQ,KAAK,cAAc;AAAA,EAClC;AAAA,EAEA,MAAa,aAAa;AACxB,QAAI,UAAU;AAEd,UAAM,gBAAgB,KAAK,eAAe,OAAO,IAAI;AAErD,eAAW;AAAA,MACT,OAAO;AAAA,MACP;AAAA,MACA,eAAe,KAAK,eAAe,gBAAgB;AAAA,MACnD,oBAAoB;AAAA,MACpB;AAAA,MACA,8CAA8C,KAAK,eAAe,QAAQ,KAAK,eAAe;AAAA,MAC9F;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,IAAI;AAEX,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/code-generation/integration-implementation/integration-secret.ts"],
|
|
4
4
|
"sourcesContent": ["import { IntegrationDefinition } from '@botpress/sdk'\nimport { casing } from '../../utils'\nimport * as consts from '../consts'\nimport { Module } from '../module'\n\nexport const secretEnvVariableName = (secretName: string) => `SECRET_${casing.to.screamingSnakeCase(secretName)}`\n\nexport class IntegrationSecretIndexModule extends Module {\n public constructor(private _integration: IntegrationDefinition) {\n super({ exportName: 'secrets', path: consts.INDEX_FILE })\n }\n\n public async getContent() {\n let content = consts.GENERATED_HEADER\n content += 'class Secrets {\\n'\n for (const [secretName, { optional }] of Object.entries(this._integration.secrets ?? {})) {\n const envVariableName = secretEnvVariableName(secretName)\n const fieldName = casing.to.screamingSnakeCase(secretName)\n\n if (optional) {\n content += ` public get ${fieldName}(): string | undefined {\\n`\n content += ` const envVarValue = process.env.${envVariableName}\\n`\n content += ' return envVarValue\\n'\n content += ' }\\n'\n } else {\n content += ` public get ${fieldName}(): string {\\n`\n content += ` const envVarValue = process.env.${envVariableName}\\n`\n content += ` if (!envVarValue) throw new Error('Missing required secret \"${secretName}\"')\\n`\n content += ' return envVarValue\\n'\n content += ' }\\n'\n }\n }\n content += '}\\n'\n content += 'export const secrets = new Secrets()\\n'\n return content\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAuB;AACvB,aAAwB;AACxB,oBAAuB;AAEhB,MAAM,wBAAwB,CAAC,eAAuB,UAAU,oBAAO,GAAG,mBAAmB,UAAU;AAEvG,MAAM,qCAAqC,qBAAO;AAAA,EAChD,YAAoB,cAAqC;AAC9D,UAAM,EAAE,YAAY,WAAW,MAAM,OAAO,WAAW,CAAC;AAD/B;AAAA,EAE3B;AAAA,EAEA,MAAa,aAAa;AACxB,QAAI,UAAU,OAAO;AACrB,eAAW;AACX,eAAW,CAAC,YAAY,EAAE,SAAS,CAAC,KAAK,OAAO,QAAQ,KAAK,aAAa,WAAW,CAAC,CAAC,GAAG;AACxF,YAAM,kBAAkB,sBAAsB,UAAU;AACxD,YAAM,YAAY,oBAAO,GAAG,mBAAmB,UAAU;AAEzD,UAAI,UAAU;AACZ,mBAAW,gBAAgB;AAAA;AAC3B,mBAAW,uCAAuC;AAAA;AAClD,mBAAW;AACX,mBAAW;AAAA,MACb,OAAO;AACL,mBAAW,gBAAgB;AAAA;AAC3B,mBAAW,uCAAuC;AAAA;AAClD,mBAAW,mEAAmE;AAAA;AAC9E,mBAAW;AACX,mBAAW;AAAA,MACb;AAAA,IACF;AACA,eAAW;AACX,eAAW;AACX,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/code-generation/integration-implementation/integration-typings/actions-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/code-generation/integration-implementation/integration-typings/actions-module.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-implementation/integration-typings/actions-module.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { zuiSchemaToTypeScriptType } from '../../generators'\nimport { Module, ReExportTypeModule } from '../../module'\nimport * as strings from '../../strings'\n\ntype ActionInput = sdk.ActionDefinition['input']\ntype ActionOutput = sdk.ActionDefinition['output']\n\nexport class ActionInputModule extends Module {\n public constructor(private _input: ActionInput) {\n const name = 'input'\n const exportName = strings.typeName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return zuiSchemaToTypeScriptType(this._input.schema, this.exportName)\n }\n}\n\nexport class ActionOutputModule extends Module {\n public constructor(private _output: ActionOutput) {\n const name = 'output'\n const exportName = strings.typeName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return zuiSchemaToTypeScriptType(this._output.schema, this.exportName)\n }\n}\n\nexport class ActionModule extends ReExportTypeModule {\n public constructor(actionName: string, action: sdk.ActionDefinition) {\n super({ exportName: strings.typeName(actionName) })\n\n const inputModule = new ActionInputModule(action.input)\n const outputModule = new ActionOutputModule(action.output)\n\n this.pushDep(inputModule)\n this.pushDep(outputModule)\n }\n}\n\nexport class ActionsModule extends ReExportTypeModule {\n public constructor(actions: Record<string, sdk.ActionDefinition>) {\n super({ exportName: strings.typeName('actions') })\n for (const [actionName, action] of Object.entries(actions)) {\n const module = new ActionModule(actionName, action)\n module.unshift(actionName)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0C;AAC1C,oBAA2C;AAC3C,cAAyB;AAKlB,MAAM,0BAA0B,qBAAO;AAAA,EACrC,YAAoB,QAAqB;AAC9C,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,SAAS,IAAI;AACxC,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHf;AAAA,EAI3B;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,6CAA0B,KAAK,OAAO,QAAQ,KAAK,UAAU;AAAA,EACtE;AACF;AAEO,MAAM,2BAA2B,qBAAO;AAAA,EACtC,YAAoB,SAAuB;AAChD,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,SAAS,IAAI;AACxC,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHf;AAAA,EAI3B;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,6CAA0B,KAAK,QAAQ,QAAQ,KAAK,UAAU;AAAA,EACvE;AACF;AAEO,MAAM,qBAAqB,iCAAmB;AAAA,EAC5C,YAAY,YAAoB,QAA8B;AACnE,UAAM,EAAE,YAAY,QAAQ,SAAS,UAAU,EAAE,CAAC;AAElD,UAAM,cAAc,IAAI,kBAAkB,OAAO,KAAK;AACtD,UAAM,eAAe,IAAI,mBAAmB,OAAO,MAAM;AAEzD,SAAK,QAAQ,WAAW;AACxB,SAAK,QAAQ,YAAY;AAAA,EAC3B;AACF;AAEO,MAAM,sBAAsB,iCAAmB;AAAA,EAC7C,YAAY,SAA+C;AAChE,UAAM,EAAE,YAAY,QAAQ,SAAS,SAAS,EAAE,CAAC;AACjD,eAAW,CAAC,YAAY,MAAM,KAAK,OAAO,QAAQ,OAAO,GAAG;AAC1D,YAAMA,UAAS,IAAI,aAAa,YAAY,MAAM;AAClD,MAAAA,QAAO,QAAQ,UAAU;AACzB,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
package/dist/code-generation/integration-implementation/integration-typings/channels-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/code-generation/integration-implementation/integration-typings/channels-module.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-implementation/integration-typings/channels-module.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { GENERATED_HEADER, INDEX_FILE } from '../../consts'\nimport { zuiSchemaToTypeScriptType, stringifySingleLine } from '../../generators'\nimport { Module, ReExportTypeModule } from '../../module'\nimport * as strings from '../../strings'\n\nclass MessageModule extends Module {\n public constructor(name: string, private _message: sdk.MessageDefinition) {\n super({\n path: `${name}.ts`,\n exportName: strings.typeName(name),\n })\n }\n\n public async getContent() {\n return zuiSchemaToTypeScriptType(this._message.schema, this.exportName)\n }\n}\n\nclass MessagesModule extends ReExportTypeModule {\n public constructor(channel: sdk.ChannelDefinition) {\n super({ exportName: strings.typeName('messages') })\n for (const [messageName, message] of Object.entries(channel.messages ?? {})) {\n const module = new MessageModule(messageName, message)\n this.pushDep(module)\n }\n }\n}\n\nclass ChannelModule extends Module {\n private _messagesModule: MessagesModule\n\n public constructor(channelName: string, private _channel: sdk.ChannelDefinition) {\n super({\n path: INDEX_FILE,\n exportName: strings.typeName(channelName),\n })\n\n this._messagesModule = new MessagesModule(_channel)\n this._messagesModule.unshift('messages')\n this.pushDep(this._messagesModule)\n }\n\n public async getContent() {\n const messageImport = this._messagesModule.import(this)\n\n const conversation = {\n tags: this._channel.conversation?.tags ?? {},\n creation: this._channel.conversation?.creation ?? { enabled: false, requiredTags: [] },\n }\n\n const message = {\n tags: this._channel.message?.tags ?? {},\n }\n\n return [\n GENERATED_HEADER,\n `import { ${this._messagesModule.exportName} } from './${messageImport}'`,\n `export * from './${messageImport}'`,\n '',\n `export type ${this.exportName} = {`,\n ` messages: ${this._messagesModule.exportName}`,\n ` message: ${stringifySingleLine(message)}`,\n ` conversation: ${stringifySingleLine(conversation)}`,\n '}',\n ].join('\\n')\n }\n}\n\nexport class ChannelsModule extends ReExportTypeModule {\n public constructor(channels: Record<string, sdk.ChannelDefinition>) {\n super({ exportName: strings.typeName('channels') })\n for (const [channelName, channel] of Object.entries(channels)) {\n const module = new ChannelModule(channelName, channel)\n module.unshift(channelName)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA6C;AAC7C,wBAA+D;AAC/D,oBAA2C;AAC3C,cAAyB;AAEzB,MAAM,sBAAsB,qBAAO;AAAA,EAC1B,YAAY,MAAsB,UAAiC;AACxE,UAAM;AAAA,MACJ,MAAM,GAAG;AAAA,MACT,YAAY,QAAQ,SAAS,IAAI;AAAA,IACnC,CAAC;AAJsC;AAAA,EAKzC;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,6CAA0B,KAAK,SAAS,QAAQ,KAAK,UAAU;AAAA,EACxE;AACF;AAEA,MAAM,uBAAuB,iCAAmB;AAAA,EACvC,YAAY,SAAgC;AACjD,UAAM,EAAE,YAAY,QAAQ,SAAS,UAAU,EAAE,CAAC;AAClD,eAAW,CAAC,aAAa,OAAO,KAAK,OAAO,QAAQ,QAAQ,YAAY,CAAC,CAAC,GAAG;AAC3E,YAAMA,UAAS,IAAI,cAAc,aAAa,OAAO;AACrD,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;AAEA,MAAM,sBAAsB,qBAAO;AAAA,EAG1B,YAAY,aAA6B,UAAiC;AAC/E,UAAM;AAAA,MACJ,MAAM;AAAA,MACN,YAAY,QAAQ,SAAS,WAAW;AAAA,IAC1C,CAAC;AAJ6C;AAM9C,SAAK,kBAAkB,IAAI,eAAe,QAAQ;AAClD,SAAK,gBAAgB,QAAQ,UAAU;AACvC,SAAK,QAAQ,KAAK,eAAe;AAAA,EACnC;AAAA,EAXQ;AAAA,EAaR,MAAa,aAAa;AACxB,UAAM,gBAAgB,KAAK,gBAAgB,OAAO,IAAI;AAEtD,UAAM,eAAe;AAAA,MACnB,MAAM,KAAK,SAAS,cAAc,QAAQ,CAAC;AAAA,MAC3C,UAAU,KAAK,SAAS,cAAc,YAAY,EAAE,SAAS,OAAO,cAAc,CAAC,EAAE;AAAA,IACvF;AAEA,UAAM,UAAU;AAAA,MACd,MAAM,KAAK,SAAS,SAAS,QAAQ,CAAC;AAAA,IACxC;AAEA,WAAO;AAAA,MACL;AAAA,MACA,YAAY,KAAK,gBAAgB,wBAAwB;AAAA,MACzD,oBAAoB;AAAA,MACpB;AAAA,MACA,eAAe,KAAK;AAAA,MACpB,eAAe,KAAK,gBAAgB;AAAA,MACpC,kBAAc,uCAAoB,OAAO;AAAA,MACzC,uBAAmB,uCAAoB,YAAY;AAAA,MACnD;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACF;AAEO,MAAM,uBAAuB,iCAAmB;AAAA,EAC9C,YAAY,UAAiD;AAClE,UAAM,EAAE,YAAY,QAAQ,SAAS,UAAU,EAAE,CAAC;AAClD,eAAW,CAAC,aAAa,OAAO,KAAK,OAAO,QAAQ,QAAQ,GAAG;AAC7D,YAAMA,UAAS,IAAI,cAAc,aAAa,OAAO;AACrD,MAAAA,QAAO,QAAQ,WAAW;AAC1B,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-implementation/integration-typings/configuration-module.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { INDEX_FILE } from '../../consts'\nimport { zuiSchemaToTypeScriptType } from '../../generators'\nimport { Module } from '../../module'\nimport * as strings from '../../strings'\n\nexport class DefaultConfigurationModule extends Module {\n public constructor(private _configuration: sdk.ConfigurationDefinition | undefined) {\n const name = 'configuration'\n const exportName = strings.typeName(name)\n super({\n path: INDEX_FILE,\n exportName,\n })\n }\n\n public async getContent() {\n if (!this._configuration) {\n return [\n '/** Default Configuration of the Integration */',\n 'export type Configuration = Record<string, never>;',\n ].join('\\n')\n }\n return zuiSchemaToTypeScriptType(this._configuration.schema, this.exportName)\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAC3B,wBAA0C;AAC1C,oBAAuB;AACvB,cAAyB;AAElB,MAAM,mCAAmC,qBAAO;AAAA,EAC9C,YAAoB,gBAAyD;AAClF,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,SAAS,IAAI;AACxC,UAAM;AAAA,MACJ,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AANwB;AAAA,EAO3B;AAAA,EAEA,MAAa,aAAa;AACxB,QAAI,CAAC,KAAK,gBAAgB;AACxB,aAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF,EAAE,KAAK,IAAI;AAAA,IACb;AACA,eAAO,6CAA0B,KAAK,eAAe,QAAQ,KAAK,UAAU;AAAA,EAC9E;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-implementation/integration-typings/configurations-module.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { zuiSchemaToTypeScriptType } from '../../generators'\nimport { Module, ReExportTypeModule } from '../../module'\nimport * as strings from '../../strings'\n\nexport class ConfigurationModule extends Module {\n public constructor(name: string, private _configuration: sdk.ConfigurationDefinition) {\n const configurationName = name\n const exportName = strings.typeName(`${configurationName}Config`)\n super({\n path: `${name}.ts`,\n exportName,\n })\n }\n\n public async getContent() {\n const { schema } = this._configuration\n if (!schema) {\n return `export type ${this.exportName} = Record<string, never>;`\n }\n return zuiSchemaToTypeScriptType(schema, this.exportName)\n }\n}\n\nexport class ConfigurationsModule extends ReExportTypeModule {\n public constructor(configurations: Record<string, sdk.ConfigurationDefinition>) {\n super({ exportName: strings.typeName('configurations') })\n for (const [configurationName, configuration] of Object.entries(configurations)) {\n const module = new ConfigurationModule(configurationName, configuration)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0C;AAC1C,oBAA2C;AAC3C,cAAyB;AAElB,MAAM,4BAA4B,qBAAO;AAAA,EACvC,YAAY,MAAsB,gBAA6C;AACpF,UAAM,oBAAoB;AAC1B,UAAM,aAAa,QAAQ,SAAS,GAAG,yBAAyB;AAChE,UAAM;AAAA,MACJ,MAAM,GAAG;AAAA,MACT;AAAA,IACF,CAAC;AANsC;AAAA,EAOzC;AAAA,EAEA,MAAa,aAAa;AACxB,UAAM,EAAE,OAAO,IAAI,KAAK;AACxB,QAAI,CAAC,QAAQ;AACX,aAAO,eAAe,KAAK;AAAA,IAC7B;AACA,eAAO,6CAA0B,QAAQ,KAAK,UAAU;AAAA,EAC1D;AACF;AAEO,MAAM,6BAA6B,iCAAmB;AAAA,EACpD,YAAY,gBAA6D;AAC9E,UAAM,EAAE,YAAY,QAAQ,SAAS,gBAAgB,EAAE,CAAC;AACxD,eAAW,CAAC,mBAAmB,aAAa,KAAK,OAAO,QAAQ,cAAc,GAAG;AAC/E,YAAMA,UAAS,IAAI,oBAAoB,mBAAmB,aAAa;AACvE,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
package/dist/code-generation/integration-implementation/integration-typings/entities-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/code-generation/integration-implementation/integration-typings/entities-module.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-implementation/integration-typings/entities-module.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { zuiSchemaToTypeScriptType } from '../../generators'\nimport { Module, ReExportTypeModule } from '../../module'\nimport * as strings from '../../strings'\n\nexport class EntityModule extends Module {\n public constructor(name: string, private _entity: sdk.EntityDefinition) {\n const entityName = name\n const exportName = strings.typeName(entityName)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return zuiSchemaToTypeScriptType(this._entity.schema, this.exportName)\n }\n}\n\nexport class EntitiesModule extends ReExportTypeModule {\n public constructor(entities: Record<string, sdk.EntityDefinition>) {\n super({ exportName: strings.typeName('entities') })\n\n for (const [entityName, entity] of Object.entries(entities)) {\n const module = new EntityModule(entityName, entity)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0C;AAC1C,oBAA2C;AAC3C,cAAyB;AAElB,MAAM,qBAAqB,qBAAO;AAAA,EAChC,YAAY,MAAsB,SAA+B;AACtE,UAAM,aAAa;AACnB,UAAM,aAAa,QAAQ,SAAS,UAAU;AAC9C,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHD;AAAA,EAIzC;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,6CAA0B,KAAK,QAAQ,QAAQ,KAAK,UAAU;AAAA,EACvE;AACF;AAEO,MAAM,uBAAuB,iCAAmB;AAAA,EAC9C,YAAY,UAAgD;AACjE,UAAM,EAAE,YAAY,QAAQ,SAAS,UAAU,EAAE,CAAC;AAElD,eAAW,CAAC,YAAY,MAAM,KAAK,OAAO,QAAQ,QAAQ,GAAG;AAC3D,YAAMA,UAAS,IAAI,aAAa,YAAY,MAAM;AAClD,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
package/dist/code-generation/integration-implementation/integration-typings/events-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/code-generation/integration-implementation/integration-typings/events-module.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-implementation/integration-typings/events-module.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { zuiSchemaToTypeScriptType } from '../../generators'\nimport { Module, ReExportTypeModule } from '../../module'\nimport * as strings from '../../strings'\n\nexport class EventModule extends Module {\n public constructor(name: string, private _event: sdk.EventDefinition) {\n const eventName = name\n const exportName = strings.typeName(eventName)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return zuiSchemaToTypeScriptType(this._event.schema, this.exportName)\n }\n}\n\nexport class EventsModule extends ReExportTypeModule {\n public constructor(events: Record<string, sdk.EventDefinition>) {\n super({ exportName: strings.typeName('events') })\n for (const [eventName, event] of Object.entries(events)) {\n const module = new EventModule(eventName, event)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0C;AAC1C,oBAA2C;AAC3C,cAAyB;AAElB,MAAM,oBAAoB,qBAAO;AAAA,EAC/B,YAAY,MAAsB,QAA6B;AACpE,UAAM,YAAY;AAClB,UAAM,aAAa,QAAQ,SAAS,SAAS;AAC7C,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHD;AAAA,EAIzC;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,6CAA0B,KAAK,OAAO,QAAQ,KAAK,UAAU;AAAA,EACtE;AACF;AAEO,MAAM,qBAAqB,iCAAmB;AAAA,EAC5C,YAAY,QAA6C;AAC9D,UAAM,EAAE,YAAY,QAAQ,SAAS,QAAQ,EAAE,CAAC;AAChD,eAAW,CAAC,WAAW,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACvD,YAAMA,UAAS,IAAI,YAAY,WAAW,KAAK;AAC/C,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
package/dist/code-generation/integration-implementation/integration-typings/states-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/code-generation/integration-implementation/integration-typings/states-module.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-implementation/integration-typings/states-module.ts"],
|
|
4
4
|
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { zuiSchemaToTypeScriptType } from '../../generators'\nimport { Module, ReExportTypeModule } from '../../module'\nimport * as strings from '../../strings'\n\nexport class StateModule extends Module {\n public constructor(name: string, private _state: sdk.StateDefinition) {\n super({\n path: `${name}.ts`,\n exportName: strings.typeName(name),\n })\n }\n\n public async getContent() {\n return zuiSchemaToTypeScriptType(this._state.schema, this.exportName)\n }\n}\n\nexport class StatesModule extends ReExportTypeModule {\n public constructor(states: Record<string, sdk.StateDefinition>) {\n super({ exportName: strings.typeName('states') })\n for (const [stateName, state] of Object.entries(states)) {\n const module = new StateModule(stateName, state)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA0C;AAC1C,oBAA2C;AAC3C,cAAyB;AAElB,MAAM,oBAAoB,qBAAO;AAAA,EAC/B,YAAY,MAAsB,QAA6B;AACpE,UAAM;AAAA,MACJ,MAAM,GAAG;AAAA,MACT,YAAY,QAAQ,SAAS,IAAI;AAAA,IACnC,CAAC;AAJsC;AAAA,EAKzC;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,6CAA0B,KAAK,OAAO,QAAQ,KAAK,UAAU;AAAA,EACtE;AACF;AAEO,MAAM,qBAAqB,iCAAmB;AAAA,EAC5C,YAAY,QAA6C;AAC9D,UAAM,EAAE,YAAY,QAAQ,SAAS,QAAQ,EAAE,CAAC;AAChD,eAAW,CAAC,WAAW,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACvD,YAAMA,UAAS,IAAI,YAAY,WAAW,KAAK;AAC/C,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/code-generation/integration-package/index.ts"],
|
|
4
4
|
"sourcesContent": ["import * as utils from '../../utils'\nimport * as consts from '../consts'\nimport * as gen from '../generators'\nimport * as types from '../typings'\nimport { IntegrationPackageDefinitionModule } from './integration-package-definition'\n\nconst generateIntegrationPackageModule = (\n definitionImport: string,\n pkg: types.IntegrationInstallablePackage\n): string => {\n const id = pkg.source === 'remote' ? pkg.integration.id : undefined\n const uri = pkg.source === 'local' ? utils.path.win32.escapeBackslashes(pkg.path) : undefined\n\n const tsId = gen.primitiveToTypescriptValue(id)\n const tsUri = gen.primitiveToTypescriptValue(uri)\n const tsName = gen.primitiveToTypescriptValue(pkg.name)\n const tsVersion = gen.primitiveToTypescriptValue(pkg.version)\n\n return [\n consts.GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n '',\n `import definition from \"${utils.path.win32.escapeBackslashes(definitionImport)}\"`,\n '',\n 'export default {',\n ' type: \"integration\",',\n ` id: ${tsId},`,\n ` uri: ${tsUri},`,\n ` name: ${tsName},`,\n ` version: ${tsVersion},`,\n ' definition,',\n '} satisfies sdk.IntegrationPackage',\n ].join('\\n')\n}\n\nconst generateIntegrationPackageFromRemote = async (\n pkg: Extract<types.IntegrationInstallablePackage, { source: 'remote' }>\n): Promise<types.File[]> => {\n const definitionDir = 'definition'\n const definitionModule = new IntegrationPackageDefinitionModule(pkg.integration)\n definitionModule.unshift(definitionDir)\n\n const definitionFiles = await definitionModule.flatten()\n return [\n ...definitionFiles,\n {\n path: consts.INDEX_FILE,\n content: generateIntegrationPackageModule(`./${definitionDir}`, pkg),\n },\n ]\n}\n\nconst generateIntegrationPackageFromLocal = async (\n pkg: Extract<types.IntegrationInstallablePackage, { source: 'local' }>\n): Promise<types.File[]> => {\n let definitionImport: string = utils.path.join(pkg.path, consts.fromWorkDir.integrationDefinition)\n definitionImport = utils.path.rmExtension(definitionImport)\n return [\n {\n path: consts.INDEX_FILE,\n content: generateIntegrationPackageModule(definitionImport, pkg),\n },\n ]\n}\n\nexport const generateIntegrationPackage = async (pkg: types.IntegrationInstallablePackage): Promise<types.File[]> => {\n if (pkg.source === 'remote') {\n return generateIntegrationPackageFromRemote(pkg)\n }\n return generateIntegrationPackageFromLocal(pkg)\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AACvB,aAAwB;AACxB,UAAqB;AAErB,4CAAmD;AAEnD,MAAM,mCAAmC,CACvC,kBACA,QACW;AACX,QAAM,KAAK,IAAI,WAAW,WAAW,IAAI,YAAY,KAAK;AAC1D,QAAM,MAAM,IAAI,WAAW,UAAU,MAAM,KAAK,MAAM,kBAAkB,IAAI,IAAI,IAAI;AAEpF,QAAM,OAAO,IAAI,2BAA2B,EAAE;AAC9C,QAAM,QAAQ,IAAI,2BAA2B,GAAG;AAChD,QAAM,SAAS,IAAI,2BAA2B,IAAI,IAAI;AACtD,QAAM,YAAY,IAAI,2BAA2B,IAAI,OAAO;AAE5D,SAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,2BAA2B,MAAM,KAAK,MAAM,kBAAkB,gBAAgB;AAAA,IAC9E;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,WAAW;AAAA,IACX,cAAc;AAAA,IACd;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;AAEA,MAAM,uCAAuC,OAC3C,QAC0B;AAC1B,QAAM,gBAAgB;AACtB,QAAM,mBAAmB,IAAI,yEAAmC,IAAI,WAAW;AAC/E,mBAAiB,QAAQ,aAAa;AAEtC,QAAM,kBAAkB,MAAM,iBAAiB,QAAQ;AACvD,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,MACE,MAAM,OAAO;AAAA,MACb,SAAS,iCAAiC,KAAK,iBAAiB,GAAG;AAAA,IACrE;AAAA,EACF;AACF;AAEA,MAAM,sCAAsC,OAC1C,QAC0B;AAC1B,MAAI,mBAA2B,MAAM,KAAK,KAAK,IAAI,MAAM,OAAO,YAAY,qBAAqB;AACjG,qBAAmB,MAAM,KAAK,YAAY,gBAAgB;AAC1D,SAAO;AAAA,IACL;AAAA,MACE,MAAM,OAAO;AAAA,MACb,SAAS,iCAAiC,kBAAkB,GAAG;AAAA,IACjE;AAAA,EACF;AACF;AAEO,MAAM,6BAA6B,OAAO,QAAoE;AACnH,MAAI,IAAI,WAAW,UAAU;AAC3B,WAAO,qCAAqC,GAAG;AAAA,EACjD;AACA,SAAO,oCAAoC,GAAG;AAChD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/code-generation/integration-package/integration-package-definition/actions-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-package/integration-package-definition/actions-module.ts"],
|
|
4
4
|
"sourcesContent": ["import { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\ntype ActionInput = types.ApiActionDefinition['input']\ntype ActionOutput = types.ApiActionDefinition['output']\n\nexport class ActionInputModule extends Module {\n public constructor(private _input: ActionInput) {\n const name = 'input'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._input.schema, this.exportName)\n }\n}\n\nexport class ActionOutputModule extends Module {\n public constructor(private _output: ActionOutput) {\n const name = 'output'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._output.schema, this.exportName)\n }\n}\n\nexport class ActionModule extends ReExportVariableModule {\n public constructor(actionName: string, action: types.ApiActionDefinition) {\n super({ exportName: strings.varName(actionName) })\n\n const inputModule = new ActionInputModule(action.input)\n const outputModule = new ActionOutputModule(action.output)\n\n this.pushDep(inputModule)\n this.pushDep(outputModule)\n }\n}\n\nexport class ActionsModule extends ReExportVariableModule {\n public constructor(actions: Record<string, types.ApiActionDefinition>) {\n super({ exportName: strings.varName('actions') })\n for (const [actionName, action] of Object.entries(actions)) {\n const module = new ActionModule(actionName, action)\n module.unshift(actionName)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAgD;AAChD,oBAA+C;AAC/C,cAAyB;AAMlB,MAAM,0BAA0B,qBAAO;AAAA,EACrC,YAAoB,QAAqB;AAC9C,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,QAAQ,IAAI;AACvC,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHf;AAAA,EAI3B;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,mDAAgC,KAAK,OAAO,QAAQ,KAAK,UAAU;AAAA,EAC5E;AACF;AAEO,MAAM,2BAA2B,qBAAO;AAAA,EACtC,YAAoB,SAAuB;AAChD,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,QAAQ,IAAI;AACvC,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHf;AAAA,EAI3B;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,mDAAgC,KAAK,QAAQ,QAAQ,KAAK,UAAU;AAAA,EAC7E;AACF;AAEO,MAAM,qBAAqB,qCAAuB;AAAA,EAChD,YAAY,YAAoB,QAAmC;AACxE,UAAM,EAAE,YAAY,QAAQ,QAAQ,UAAU,EAAE,CAAC;AAEjD,UAAM,cAAc,IAAI,kBAAkB,OAAO,KAAK;AACtD,UAAM,eAAe,IAAI,mBAAmB,OAAO,MAAM;AAEzD,SAAK,QAAQ,WAAW;AACxB,SAAK,QAAQ,YAAY;AAAA,EAC3B;AACF;AAEO,MAAM,sBAAsB,qCAAuB;AAAA,EACjD,YAAY,SAAoD;AACrE,UAAM,EAAE,YAAY,QAAQ,QAAQ,SAAS,EAAE,CAAC;AAChD,eAAW,CAAC,YAAY,MAAM,KAAK,OAAO,QAAQ,OAAO,GAAG;AAC1D,YAAMA,UAAS,IAAI,aAAa,YAAY,MAAM;AAClD,MAAAA,QAAO,QAAQ,UAAU;AACzB,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
package/dist/code-generation/integration-package/integration-package-definition/channels-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-package/integration-package-definition/channels-module.ts"],
|
|
4
4
|
"sourcesContent": ["import { GENERATED_HEADER, INDEX_FILE } from '../../consts'\nimport { jsonSchemaToTypescriptZuiSchema, stringifySingleLine } from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\nclass MessageModule extends Module {\n public constructor(name: string, private _message: types.ApiMessageDefinition) {\n super({\n path: `${name}.ts`,\n exportName: strings.varName(name),\n })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._message.schema, this.exportName)\n }\n}\n\nclass MessagesModule extends ReExportVariableModule {\n public constructor(channel: types.ApiChannelDefinition) {\n super({ exportName: strings.varName('messages') })\n for (const [messageName, message] of Object.entries(channel.messages ?? {})) {\n const module = new MessageModule(messageName, message)\n this.pushDep(module)\n }\n }\n}\n\nclass ChannelModule extends Module {\n private _messagesModule: MessagesModule\n\n public constructor(channelName: string, private _channel: types.ApiChannelDefinition) {\n super({\n path: INDEX_FILE,\n exportName: strings.varName(channelName),\n })\n\n this._messagesModule = new MessagesModule(_channel)\n this._messagesModule.unshift('messages')\n this.pushDep(this._messagesModule)\n }\n\n public async getContent() {\n const messageImport = this._messagesModule.import(this)\n\n const conversation = {\n tags: this._channel.conversation?.tags ?? {},\n creation: this._channel.conversation?.creation ?? { enabled: false, requiredTags: [] },\n }\n\n const message = {\n tags: this._channel.message?.tags ?? {},\n }\n\n return [\n GENERATED_HEADER,\n `import { ${this._messagesModule.exportName} } from './${messageImport}'`,\n `export * from './${messageImport}'`,\n '',\n `export const ${this.exportName} = {`,\n ` messages: ${this._messagesModule.exportName},`,\n ` message: ${stringifySingleLine(message)},`,\n ` conversation: ${stringifySingleLine(conversation)},`,\n '}',\n ].join('\\n')\n }\n}\n\nexport class ChannelsModule extends ReExportVariableModule {\n public constructor(channels: Record<string, types.ApiChannelDefinition>) {\n super({ exportName: strings.varName('channels') })\n for (const [channelName, channel] of Object.entries(channels)) {\n const module = new ChannelModule(channelName, channel)\n module.unshift(channelName)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6C;AAC7C,wBAAqE;AACrE,oBAA+C;AAC/C,cAAyB;AAGzB,MAAM,sBAAsB,qBAAO;AAAA,EAC1B,YAAY,MAAsB,UAAsC;AAC7E,UAAM;AAAA,MACJ,MAAM,GAAG;AAAA,MACT,YAAY,QAAQ,QAAQ,IAAI;AAAA,IAClC,CAAC;AAJsC;AAAA,EAKzC;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,mDAAgC,KAAK,SAAS,QAAQ,KAAK,UAAU;AAAA,EAC9E;AACF;AAEA,MAAM,uBAAuB,qCAAuB;AAAA,EAC3C,YAAY,SAAqC;AACtD,UAAM,EAAE,YAAY,QAAQ,QAAQ,UAAU,EAAE,CAAC;AACjD,eAAW,CAAC,aAAa,OAAO,KAAK,OAAO,QAAQ,QAAQ,YAAY,CAAC,CAAC,GAAG;AAC3E,YAAMA,UAAS,IAAI,cAAc,aAAa,OAAO;AACrD,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;AAEA,MAAM,sBAAsB,qBAAO;AAAA,EAG1B,YAAY,aAA6B,UAAsC;AACpF,UAAM;AAAA,MACJ,MAAM;AAAA,MACN,YAAY,QAAQ,QAAQ,WAAW;AAAA,IACzC,CAAC;AAJ6C;AAM9C,SAAK,kBAAkB,IAAI,eAAe,QAAQ;AAClD,SAAK,gBAAgB,QAAQ,UAAU;AACvC,SAAK,QAAQ,KAAK,eAAe;AAAA,EACnC;AAAA,EAXQ;AAAA,EAaR,MAAa,aAAa;AACxB,UAAM,gBAAgB,KAAK,gBAAgB,OAAO,IAAI;AAEtD,UAAM,eAAe;AAAA,MACnB,MAAM,KAAK,SAAS,cAAc,QAAQ,CAAC;AAAA,MAC3C,UAAU,KAAK,SAAS,cAAc,YAAY,EAAE,SAAS,OAAO,cAAc,CAAC,EAAE;AAAA,IACvF;AAEA,UAAM,UAAU;AAAA,MACd,MAAM,KAAK,SAAS,SAAS,QAAQ,CAAC;AAAA,IACxC;AAEA,WAAO;AAAA,MACL;AAAA,MACA,YAAY,KAAK,gBAAgB,wBAAwB;AAAA,MACzD,oBAAoB;AAAA,MACpB;AAAA,MACA,gBAAgB,KAAK;AAAA,MACrB,eAAe,KAAK,gBAAgB;AAAA,MACpC,kBAAc,uCAAoB,OAAO;AAAA,MACzC,uBAAmB,uCAAoB,YAAY;AAAA,MACnD;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACF;AAEO,MAAM,uBAAuB,qCAAuB;AAAA,EAClD,YAAY,UAAsD;AACvE,UAAM,EAAE,YAAY,QAAQ,QAAQ,UAAU,EAAE,CAAC;AACjD,eAAW,CAAC,aAAa,OAAO,KAAK,OAAO,QAAQ,QAAQ,GAAG;AAC7D,YAAMA,UAAS,IAAI,cAAc,aAAa,OAAO;AACrD,MAAAA,QAAO,QAAQ,WAAW;AAC1B,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -44,6 +48,7 @@ class DefaultConfigurationModule extends import_module.Module {
|
|
|
44
48
|
async getContent() {
|
|
45
49
|
if (!this._configuration.schema) {
|
|
46
50
|
return [
|
|
51
|
+
//
|
|
47
52
|
"/** Default Configuration of the Integration */",
|
|
48
53
|
`export const ${this.exportName} = z.object({})`
|
|
49
54
|
].join("\n");
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-package/integration-package-definition/configuration-module.ts"],
|
|
4
4
|
"sourcesContent": ["import { INDEX_FILE } from '../../consts'\nimport { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport { Module } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\nexport class DefaultConfigurationModule extends Module {\n public constructor(private _configuration: types.ApiConfigurationDefinition) {\n const name = 'configuration'\n const exportName = strings.varName(name)\n super({\n path: INDEX_FILE,\n exportName,\n })\n }\n\n public async getContent() {\n if (!this._configuration.schema) {\n return [\n //\n '/** Default Configuration of the Integration */',\n `export const ${this.exportName} = z.object({})`,\n ].join('\\n')\n }\n return jsonSchemaToTypescriptZuiSchema(this._configuration.schema, this.exportName)\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAC3B,wBAAgD;AAChD,oBAAuB;AACvB,cAAyB;AAGlB,MAAM,mCAAmC,qBAAO;AAAA,EAC9C,YAAoB,gBAAkD;AAC3E,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,QAAQ,IAAI;AACvC,UAAM;AAAA,MACJ,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AANwB;AAAA,EAO3B;AAAA,EAEA,MAAa,aAAa;AACxB,QAAI,CAAC,KAAK,eAAe,QAAQ;AAC/B,aAAO;AAAA;AAAA,QAEL;AAAA,QACA,gBAAgB,KAAK;AAAA,MACvB,EAAE,KAAK,IAAI;AAAA,IACb;AACA,eAAO,mDAAgC,KAAK,eAAe,QAAQ,KAAK,UAAU;AAAA,EACpF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-package/integration-package-definition/configurations-module.ts"],
|
|
4
4
|
"sourcesContent": ["import { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\nexport class ConfigurationModule extends Module {\n public constructor(name: string, private _configuration: types.ApiConfigurationDefinition) {\n const configurationName = name\n const exportName = strings.varName(`${configurationName}Config`)\n super({\n path: `${name}.ts`,\n exportName,\n })\n }\n\n public async getContent() {\n const { schema } = this._configuration\n if (!schema) {\n return `export const ${this.exportName} = z.object({});`\n }\n return jsonSchemaToTypescriptZuiSchema(schema, this.exportName)\n }\n}\n\nexport class ConfigurationsModule extends ReExportVariableModule {\n public constructor(configurations: Record<string, types.ApiConfigurationDefinition>) {\n super({ exportName: strings.varName('configurations') })\n for (const [configurationName, configuration] of Object.entries(configurations)) {\n const module = new ConfigurationModule(configurationName, configuration)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAgD;AAChD,oBAA+C;AAC/C,cAAyB;AAGlB,MAAM,4BAA4B,qBAAO;AAAA,EACvC,YAAY,MAAsB,gBAAkD;AACzF,UAAM,oBAAoB;AAC1B,UAAM,aAAa,QAAQ,QAAQ,GAAG,yBAAyB;AAC/D,UAAM;AAAA,MACJ,MAAM,GAAG;AAAA,MACT;AAAA,IACF,CAAC;AANsC;AAAA,EAOzC;AAAA,EAEA,MAAa,aAAa;AACxB,UAAM,EAAE,OAAO,IAAI,KAAK;AACxB,QAAI,CAAC,QAAQ;AACX,aAAO,gBAAgB,KAAK;AAAA,IAC9B;AACA,eAAO,mDAAgC,QAAQ,KAAK,UAAU;AAAA,EAChE;AACF;AAEO,MAAM,6BAA6B,qCAAuB;AAAA,EACxD,YAAY,gBAAkE;AACnF,UAAM,EAAE,YAAY,QAAQ,QAAQ,gBAAgB,EAAE,CAAC;AACvD,eAAW,CAAC,mBAAmB,aAAa,KAAK,OAAO,QAAQ,cAAc,GAAG;AAC/E,YAAMA,UAAS,IAAI,oBAAoB,mBAAmB,aAAa;AACvE,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
package/dist/code-generation/integration-package/integration-package-definition/entities-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-package/integration-package-definition/entities-module.ts"],
|
|
4
4
|
"sourcesContent": ["import { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\nexport class EntityModule extends Module {\n public constructor(name: string, private _entity: types.ApiEntityDefinition) {\n const entityName = name\n const exportName = strings.varName(entityName)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._entity.schema, this.exportName)\n }\n}\n\nexport class EntitiesModule extends ReExportVariableModule {\n public constructor(entities: Record<string, types.ApiEntityDefinition>) {\n super({ exportName: strings.varName('entities') })\n\n for (const [entityName, entity] of Object.entries(entities)) {\n const module = new EntityModule(entityName, entity)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAgD;AAChD,oBAA+C;AAC/C,cAAyB;AAGlB,MAAM,qBAAqB,qBAAO;AAAA,EAChC,YAAY,MAAsB,SAAoC;AAC3E,UAAM,aAAa;AACnB,UAAM,aAAa,QAAQ,QAAQ,UAAU;AAC7C,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHD;AAAA,EAIzC;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,mDAAgC,KAAK,QAAQ,QAAQ,KAAK,UAAU;AAAA,EAC7E;AACF;AAEO,MAAM,uBAAuB,qCAAuB;AAAA,EAClD,YAAY,UAAqD;AACtE,UAAM,EAAE,YAAY,QAAQ,QAAQ,UAAU,EAAE,CAAC;AAEjD,eAAW,CAAC,YAAY,MAAM,KAAK,OAAO,QAAQ,QAAQ,GAAG;AAC3D,YAAMA,UAAS,IAAI,aAAa,YAAY,MAAM;AAClD,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
package/dist/code-generation/integration-package/integration-package-definition/events-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/code-generation/integration-package/integration-package-definition/events-module.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-package/integration-package-definition/events-module.ts"],
|
|
4
4
|
"sourcesContent": ["import { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\nexport class EventModule extends Module {\n public constructor(name: string, private _event: types.ApiEventDefinition) {\n const eventName = name\n const exportName = strings.varName(eventName)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n if (!this._event.schema) {\n return `export const ${this.exportName} = z.object({});`\n }\n return jsonSchemaToTypescriptZuiSchema(this._event.schema, this.exportName)\n }\n}\n\nexport class EventsModule extends ReExportVariableModule {\n public constructor(events: Record<string, types.ApiEventDefinition>) {\n super({ exportName: strings.varName('events') })\n for (const [eventName, event] of Object.entries(events)) {\n const module = new EventModule(eventName, event)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAgD;AAChD,oBAA+C;AAC/C,cAAyB;AAGlB,MAAM,oBAAoB,qBAAO;AAAA,EAC/B,YAAY,MAAsB,QAAkC;AACzE,UAAM,YAAY;AAClB,UAAM,aAAa,QAAQ,QAAQ,SAAS;AAC5C,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHD;AAAA,EAIzC;AAAA,EAEA,MAAa,aAAa;AACxB,QAAI,CAAC,KAAK,OAAO,QAAQ;AACvB,aAAO,gBAAgB,KAAK;AAAA,IAC9B;AACA,eAAO,mDAAgC,KAAK,OAAO,QAAQ,KAAK,UAAU;AAAA,EAC5E;AACF;AAEO,MAAM,qBAAqB,qCAAuB;AAAA,EAChD,YAAY,QAAkD;AACnE,UAAM,EAAE,YAAY,QAAQ,QAAQ,QAAQ,EAAE,CAAC;AAC/C,eAAW,CAAC,WAAW,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACvD,YAAMA,UAAS,IAAI,YAAY,WAAW,KAAK;AAC/C,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/code-generation/integration-package/integration-package-definition/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-package/integration-package-definition/index.ts"],
|
|
4
4
|
"sourcesContent": ["import * as consts from '../../consts'\nimport { stringifySingleLine } from '../../generators'\nimport { Module } from '../../module'\nimport { ActionsModule } from './actions-module'\nimport { ChannelsModule } from './channels-module'\nimport { DefaultConfigurationModule } from './configuration-module'\nimport { ConfigurationsModule } from './configurations-module'\nimport { EntitiesModule } from './entities-module'\nimport { EventsModule } from './events-module'\nimport { StatesModule } from './states-module'\nimport * as types from './typings'\n\ntype IntegrationPackageModuleDependencies = {\n defaultConfigModule: DefaultConfigurationModule\n configurationsModule: ConfigurationsModule\n actionsModule: ActionsModule\n channelsModule: ChannelsModule\n eventsModule: EventsModule\n statesModule: StatesModule\n entitiesModule: EntitiesModule\n}\n\nexport class IntegrationPackageDefinitionModule extends Module {\n private _dependencies: IntegrationPackageModuleDependencies\n\n public constructor(private _integration: types.ApiIntegrationDefinition) {\n super({\n path: consts.INDEX_FILE,\n exportName: consts.DEFAULT_EXPORT_NAME,\n })\n\n const defaultConfigModule = new DefaultConfigurationModule(_integration.configuration)\n defaultConfigModule.unshift('configuration')\n\n const configurationsModule = new ConfigurationsModule(_integration.configurations ?? {})\n configurationsModule.unshift('configurations')\n\n const actionsModule = new ActionsModule(_integration.actions ?? {})\n actionsModule.unshift('actions')\n\n const channelsModule = new ChannelsModule(_integration.channels ?? {})\n channelsModule.unshift('channels')\n\n const eventsModule = new EventsModule(_integration.events ?? {})\n eventsModule.unshift('events')\n\n const statesModule = new StatesModule(_integration.states ?? {})\n statesModule.unshift('states')\n\n const entitiesModule = new EntitiesModule(_integration.entities ?? {})\n entitiesModule.unshift('entities')\n\n this._dependencies = {\n defaultConfigModule,\n configurationsModule,\n actionsModule,\n channelsModule,\n eventsModule,\n statesModule,\n entitiesModule,\n }\n\n for (const dep of Object.values(this._dependencies)) {\n this.pushDep(dep)\n }\n }\n\n public async getContent() {\n let content = ''\n\n const {\n defaultConfigModule,\n configurationsModule,\n actionsModule,\n channelsModule,\n eventsModule,\n statesModule,\n entitiesModule,\n } = this._dependencies\n\n const defaultConfigImport = defaultConfigModule.import(this)\n const configurationsImport = configurationsModule.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 const entitiesImport = entitiesModule.import(this)\n\n const user = {\n tags: this._integration.user?.tags ?? {},\n creation: this._integration.user?.creation ?? { enabled: false, requiredTags: [] },\n }\n\n content += [\n consts.GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n '',\n `import * as ${defaultConfigModule.name} from \"./${defaultConfigImport}\"`,\n `import * as ${configurationsModule.name} from \"./${configurationsImport}\"`,\n `import * as ${actionsModule.name} from \"./${actionsImport}\"`,\n `import * as ${channelsModule.name} from \"./${channelsImport}\"`,\n `import * as ${eventsModule.name} from \"./${eventsImport}\"`,\n `import * as ${statesModule.name} from \"./${statesImport}\"`,\n `import * as ${entitiesModule.name} from \"./${entitiesImport}\"`,\n `export * as ${defaultConfigModule.name} from \"./${defaultConfigImport}\"`,\n `export * as ${configurationsModule.name} from \"./${configurationsImport}\"`,\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 `export * as ${entitiesModule.name} from \"./${entitiesImport}\"`,\n '',\n 'export default {',\n ` name: \"${this._integration.name}\",`,\n ` version: \"${this._integration.version}\",`,\n ` user: ${stringifySingleLine(user)},`,\n ` configuration: ${defaultConfigModule.name}.${defaultConfigModule.exportName},`,\n ` configurations: ${configurationsModule.name}.${configurationsModule.exportName},`,\n ` actions: ${actionsModule.name}.${actionsModule.exportName},`,\n ` channels: ${channelsModule.name}.${channelsModule.exportName},`,\n ` events: ${eventsModule.name}.${eventsModule.exportName},`,\n ` states: ${statesModule.name}.${statesModule.exportName},`,\n ` entities: ${entitiesModule.name}.${entitiesModule.exportName},`,\n '} satisfies sdk.IntegrationPackage[\"definition\"]',\n ].join('\\n')\n\n return content\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,wBAAoC;AACpC,oBAAuB;AACvB,4BAA8B;AAC9B,6BAA+B;AAC/B,kCAA2C;AAC3C,mCAAqC;AACrC,6BAA+B;AAC/B,2BAA6B;AAC7B,2BAA6B;AAatB,MAAM,2CAA2C,qBAAO;AAAA,EAGtD,YAAoB,cAA8C;AACvE,UAAM;AAAA,MACJ,MAAM,OAAO;AAAA,MACb,YAAY,OAAO;AAAA,IACrB,CAAC;AAJwB;AAMzB,UAAM,sBAAsB,IAAI,uDAA2B,aAAa,aAAa;AACrF,wBAAoB,QAAQ,eAAe;AAE3C,UAAM,uBAAuB,IAAI,kDAAqB,aAAa,kBAAkB,CAAC,CAAC;AACvF,yBAAqB,QAAQ,gBAAgB;AAE7C,UAAM,gBAAgB,IAAI,oCAAc,aAAa,WAAW,CAAC,CAAC;AAClE,kBAAc,QAAQ,SAAS;AAE/B,UAAM,iBAAiB,IAAI,sCAAe,aAAa,YAAY,CAAC,CAAC;AACrE,mBAAe,QAAQ,UAAU;AAEjC,UAAM,eAAe,IAAI,kCAAa,aAAa,UAAU,CAAC,CAAC;AAC/D,iBAAa,QAAQ,QAAQ;AAE7B,UAAM,eAAe,IAAI,kCAAa,aAAa,UAAU,CAAC,CAAC;AAC/D,iBAAa,QAAQ,QAAQ;AAE7B,UAAM,iBAAiB,IAAI,sCAAe,aAAa,YAAY,CAAC,CAAC;AACrE,mBAAe,QAAQ,UAAU;AAEjC,SAAK,gBAAgB;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,eAAW,OAAO,OAAO,OAAO,KAAK,aAAa,GAAG;AACnD,WAAK,QAAQ,GAAG;AAAA,IAClB;AAAA,EACF;AAAA,EA1CQ;AAAA,EA4CR,MAAa,aAAa;AACxB,QAAI,UAAU;AAEd,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,KAAK;AAET,UAAM,sBAAsB,oBAAoB,OAAO,IAAI;AAC3D,UAAM,uBAAuB,qBAAqB,OAAO,IAAI;AAC7D,UAAM,gBAAgB,cAAc,OAAO,IAAI;AAC/C,UAAM,iBAAiB,eAAe,OAAO,IAAI;AACjD,UAAM,eAAe,aAAa,OAAO,IAAI;AAC7C,UAAM,eAAe,aAAa,OAAO,IAAI;AAC7C,UAAM,iBAAiB,eAAe,OAAO,IAAI;AAEjD,UAAM,OAAO;AAAA,MACX,MAAM,KAAK,aAAa,MAAM,QAAQ,CAAC;AAAA,MACvC,UAAU,KAAK,aAAa,MAAM,YAAY,EAAE,SAAS,OAAO,cAAc,CAAC,EAAE;AAAA,IACnF;AAEA,eAAW;AAAA,MACT,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,eAAe,oBAAoB,gBAAgB;AAAA,MACnD,eAAe,qBAAqB,gBAAgB;AAAA,MACpD,eAAe,cAAc,gBAAgB;AAAA,MAC7C,eAAe,eAAe,gBAAgB;AAAA,MAC9C,eAAe,aAAa,gBAAgB;AAAA,MAC5C,eAAe,aAAa,gBAAgB;AAAA,MAC5C,eAAe,eAAe,gBAAgB;AAAA,MAC9C,eAAe,oBAAoB,gBAAgB;AAAA,MACnD,eAAe,qBAAqB,gBAAgB;AAAA,MACpD,eAAe,cAAc,gBAAgB;AAAA,MAC7C,eAAe,eAAe,gBAAgB;AAAA,MAC9C,eAAe,aAAa,gBAAgB;AAAA,MAC5C,eAAe,aAAa,gBAAgB;AAAA,MAC5C,eAAe,eAAe,gBAAgB;AAAA,MAC9C;AAAA,MACA;AAAA,MACA,YAAY,KAAK,aAAa;AAAA,MAC9B,eAAe,KAAK,aAAa;AAAA,MACjC,eAAW,uCAAoB,IAAI;AAAA,MACnC,oBAAoB,oBAAoB,QAAQ,oBAAoB;AAAA,MACpE,qBAAqB,qBAAqB,QAAQ,qBAAqB;AAAA,MACvE,cAAc,cAAc,QAAQ,cAAc;AAAA,MAClD,eAAe,eAAe,QAAQ,eAAe;AAAA,MACrD,aAAa,aAAa,QAAQ,aAAa;AAAA,MAC/C,aAAa,aAAa,QAAQ,aAAa;AAAA,MAC/C,eAAe,eAAe,QAAQ,eAAe;AAAA,MACrD;AAAA,IACF,EAAE,KAAK,IAAI;AAEX,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/code-generation/integration-package/integration-package-definition/states-module.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/code-generation/integration-package/integration-package-definition/states-module.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/integration-package/integration-package-definition/states-module.ts"],
|
|
4
4
|
"sourcesContent": ["import { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\nexport class StateModule extends Module {\n public constructor(name: string, private _state: types.ApiStateDefinition) {\n super({\n path: `${name}.ts`,\n exportName: strings.varName(name),\n })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._state.schema, this.exportName, {\n type: `\"${this._state.type}\" as const`,\n })\n }\n}\n\nexport class StatesModule extends ReExportVariableModule {\n public constructor(states: Record<string, types.ApiStateDefinition>) {\n super({ exportName: strings.varName('states') })\n for (const [stateName, state] of Object.entries(states)) {\n const module = new StateModule(stateName, state)\n this.pushDep(module)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAgD;AAChD,oBAA+C;AAC/C,cAAyB;AAGlB,MAAM,oBAAoB,qBAAO;AAAA,EAC/B,YAAY,MAAsB,QAAkC;AACzE,UAAM;AAAA,MACJ,MAAM,GAAG;AAAA,MACT,YAAY,QAAQ,QAAQ,IAAI;AAAA,IAClC,CAAC;AAJsC;AAAA,EAKzC;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,mDAAgC,KAAK,OAAO,QAAQ,KAAK,YAAY;AAAA,MAC1E,MAAM,IAAI,KAAK,OAAO;AAAA,IACxB,CAAC;AAAA,EACH;AACF;AAEO,MAAM,qBAAqB,qCAAuB;AAAA,EAChD,YAAY,QAAkD;AACnE,UAAM,EAAE,YAAY,QAAQ,QAAQ,QAAQ,EAAE,CAAC;AAC/C,eAAW,CAAC,WAAW,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACvD,YAAMA,UAAS,IAAI,YAAY,WAAW,KAAK;AAC/C,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["module"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|