@botpress/cli 4.27.4 → 5.0.0
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 +13 -13
- package/dist/code-generation/bot-implementation/bot-implementation.js +2 -3
- package/dist/code-generation/bot-implementation/bot-implementation.js.map +2 -2
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js +2 -2
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js.map +2 -2
- package/dist/code-generation/plugin-implementation/plugin-implementation.js +2 -3
- package/dist/code-generation/plugin-implementation/plugin-implementation.js.map +2 -2
- package/dist/code-generation/plugin-implementation/plugin-typings/conversation-module.d.ts +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/conversation-module.js +63 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/conversation-module.js.map +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js +32 -2
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js.map +2 -2
- package/dist/code-generation/plugin-implementation/plugin-typings/message-module.d.ts +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/message-module.js +63 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/message-module.js.map +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/user-module.d.ts +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/user-module.js +63 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/user-module.js.map +7 -0
- package/dist/command-definitions.d.ts +57 -5
- package/dist/command-definitions.js +10 -1
- package/dist/command-definitions.js.map +2 -2
- package/dist/command-implementations/add-command.d.ts +2 -0
- package/dist/command-implementations/add-command.js +52 -25
- package/dist/command-implementations/add-command.js.map +2 -2
- package/dist/command-implementations/index.d.ts +59 -5
- package/dist/command-implementations/index.js +2 -0
- package/dist/command-implementations/index.js.map +2 -2
- package/dist/command-implementations/project-command.d.ts +1 -0
- package/dist/command-implementations/project-command.js +62 -29
- package/dist/command-implementations/project-command.js.map +2 -2
- package/dist/command-implementations/remove-command.d.ts +10 -0
- package/dist/command-implementations/remove-command.js +95 -0
- package/dist/command-implementations/remove-command.js.map +7 -0
- package/dist/config.d.ts +52 -5
- package/dist/config.js +8 -7
- package/dist/config.js.map +2 -2
- package/dist/index.d.ts +59 -5
- package/dist/index.js +1 -0
- package/dist/index.js.map +2 -2
- package/dist/register-yargs.js +8 -1
- package/dist/register-yargs.js.map +2 -2
- package/dist/typings.d.ts +1 -1
- package/dist/typings.js.map +1 -1
- package/dist/utils/pkgjson-utils.d.ts +2 -0
- package/dist/utils/pkgjson-utils.js +7 -2
- package/dist/utils/pkgjson-utils.js.map +2 -2
- package/package.json +2 -2
- package/templates/empty-bot/package.json +1 -1
- package/templates/empty-integration/package.json +1 -1
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +1 -1
- package/templates/webhook-message/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@
|
|
2
|
+
> @botpress/cli@5.0.0 build /home/runner/work/botpress/botpress/packages/cli
|
|
3
3
|
> pnpm run build:types && pnpm run bundle && pnpm run template:gen
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/cli@
|
|
6
|
+
> @botpress/cli@5.0.0 build:types /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> tsc -p ./tsconfig.build.json
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@
|
|
10
|
+
> @botpress/cli@5.0.0 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
11
11
|
> ts-node -T build.ts
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
> @botpress/cli@
|
|
14
|
+
> @botpress/cli@5.0.0 template:gen /home/runner/work/botpress/botpress/packages/cli
|
|
15
15
|
> pnpm -r --stream -F @bp-templates/* exec bp gen
|
|
16
16
|
|
|
17
|
-
🤖 Botpress CLI
|
|
17
|
+
🤖 Botpress CLI v5.0.0
|
|
18
18
|
● Checking if cli is up to date
|
|
19
|
-
🤖 Botpress CLI
|
|
19
|
+
🤖 Botpress CLI v5.0.0
|
|
20
20
|
● Checking if cli is up to date
|
|
21
|
-
🤖 Botpress CLI
|
|
21
|
+
🤖 Botpress CLI v5.0.0
|
|
22
22
|
● Checking if cli is up to date
|
|
23
|
-
🤖 Botpress CLI
|
|
23
|
+
🤖 Botpress CLI v5.0.0
|
|
24
24
|
● Checking if cli is up to date
|
|
25
25
|
● Checking if sdk is up to date
|
|
26
26
|
● Checking if sdk is up to date
|
|
27
27
|
● Checking if sdk is up to date
|
|
28
28
|
● Checking if sdk is up to date
|
|
29
|
-
○ Generating typings for
|
|
29
|
+
○ Generating typings for plugin empty-plugin...
|
|
30
30
|
✓ Typings available at .botpress
|
|
31
31
|
|
|
32
|
-
○ Generating typings for integration
|
|
32
|
+
○ Generating typings for integration hello-world...
|
|
33
|
+
○ Generating typings for bot...
|
|
33
34
|
✓ Typings available at .botpress
|
|
34
35
|
|
|
35
|
-
○ Generating typings for integration
|
|
36
|
-
○ Generating typings for plugin empty-plugin...
|
|
36
|
+
○ Generating typings for integration empty-integration...
|
|
37
37
|
✓ Typings available at .botpress
|
|
38
38
|
|
|
39
39
|
✓ Typings available at .botpress
|
|
40
40
|
|
|
41
|
-
🤖 Botpress CLI
|
|
41
|
+
🤖 Botpress CLI v5.0.0
|
|
42
42
|
● Checking if cli is up to date
|
|
43
43
|
● Checking if sdk is up to date
|
|
44
44
|
○ Generating typings for integration webhook-message...
|
|
@@ -87,7 +87,7 @@ class BotImplementationModule extends import_module.Module {
|
|
|
87
87
|
"",
|
|
88
88
|
"type AsyncFunction = (...args: any[]) => Promise<any>",
|
|
89
89
|
"",
|
|
90
|
-
"export type BotHandlers = sdk.
|
|
90
|
+
"export type BotHandlers = sdk.InjectedBotHandlers<TBot>",
|
|
91
91
|
"",
|
|
92
92
|
"export type EventHandlers = Required<{",
|
|
93
93
|
" [K in keyof BotHandlers['eventHandlers']]: NonNullable<BotHandlers['eventHandlers'][K]>[number]",
|
|
@@ -97,8 +97,7 @@ class BotImplementationModule extends import_module.Module {
|
|
|
97
97
|
"}>",
|
|
98
98
|
"export type WorkflowHandlers = {",
|
|
99
99
|
" [TWorkflowName in keyof Required<BotHandlers['workflowHandlers'][keyof BotHandlers['workflowHandlers']]>]:",
|
|
100
|
-
" Required<BotHandlers['workflowHandlers'][keyof BotHandlers['workflowHandlers']]>[TWorkflowName]
|
|
101
|
-
" ({ handler: infer U })[] ? U : never",
|
|
100
|
+
" NonNullable<Required<BotHandlers['workflowHandlers'][keyof BotHandlers['workflowHandlers']]>[TWorkflowName]>[number]",
|
|
102
101
|
"}",
|
|
103
102
|
"",
|
|
104
103
|
"export type MessageHandlerProps = Parameters<MessageHandlers['*']>[0]",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/code-generation/bot-implementation/bot-implementation.ts"],
|
|
4
|
-
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as consts from '../consts'\nimport { Module } from '../module'\nimport { BotPluginsIndexModule } from './bot-plugins'\nimport { BotTypingsModule } from './bot-typings'\n\nexport class BotImplementationModule extends Module {\n private _typingsModule: BotTypingsModule\n private _pluginsModule: BotPluginsIndexModule\n\n public constructor(bot: sdk.BotDefinition) {\n super({\n exportName: 'Bot',\n path: consts.INDEX_FILE,\n })\n\n this._typingsModule = new BotTypingsModule(bot)\n this._typingsModule.unshift('typings')\n this.pushDep(this._typingsModule)\n\n this._pluginsModule = new BotPluginsIndexModule(bot)\n this._pluginsModule.unshift(consts.fromOutDir.pluginsDir)\n this.pushDep(this._pluginsModule)\n }\n\n public async getContent() {\n const {\n //\n _typingsModule: typingsModule,\n _pluginsModule: pluginsModule,\n } = this\n\n const typingsImport = typingsModule.import(this)\n const pluginsImport = pluginsModule.import(this)\n\n return [\n consts.GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n `import * as ${typingsModule.name} from \"./${typingsImport}\"`,\n `import * as ${pluginsModule.name} from \"./${pluginsImport}\"`,\n '',\n `export * from \"./${typingsImport}\"`,\n `export * from \"./${pluginsImport}\"`,\n '',\n `type TPlugins = ${pluginsModule.name}.TPlugins`,\n `type TBot = sdk.DefaultBot<${typingsModule.name}.${typingsModule.exportName}>`,\n '',\n 'export type BotProps = {',\n ' actions: sdk.BotProps<TBot, TPlugins>[\"actions\"]',\n '}',\n '',\n 'export class Bot extends sdk.Bot<TBot, TPlugins> {',\n ' public constructor(props: BotProps) {',\n ' super({',\n ' actions: props.actions,',\n ` plugins: ${pluginsModule.name}.${pluginsModule.exportName}`,\n ' })',\n ' }',\n '}',\n '',\n '// extra types',\n '',\n 'type AsyncFunction = (...args: any[]) => Promise<any>',\n '',\n 'export type BotHandlers = sdk.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,oBAAuB;AACvB,yBAAsC;AACtC,yBAAiC;AAE1B,MAAM,gCAAgC,qBAAO;AAAA,EAC1C;AAAA,EACA;AAAA,EAED,YAAY,KAAwB;AACzC,UAAM;AAAA,MACJ,YAAY;AAAA,MACZ,MAAM,OAAO;AAAA,IACf,CAAC;AAED,SAAK,iBAAiB,IAAI,oCAAiB,GAAG;AAC9C,SAAK,eAAe,QAAQ,SAAS;AACrC,SAAK,QAAQ,KAAK,cAAc;AAEhC,SAAK,iBAAiB,IAAI,yCAAsB,GAAG;AACnD,SAAK,eAAe,QAAQ,OAAO,WAAW,UAAU;AACxD,SAAK,QAAQ,KAAK,cAAc;AAAA,EAClC;AAAA,EAEA,MAAa,aAAa;AACxB,UAAM;AAAA;AAAA,MAEJ,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,IAClB,IAAI;AAEJ,UAAM,gBAAgB,cAAc,OAAO,IAAI;AAC/C,UAAM,gBAAgB,cAAc,OAAO,IAAI;AAE/C,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA,eAAe,cAAc,IAAI,YAAY,aAAa;AAAA,MAC1D,eAAe,cAAc,IAAI,YAAY,aAAa;AAAA,MAC1D;AAAA,MACA,oBAAoB,aAAa;AAAA,MACjC,oBAAoB,aAAa;AAAA,MACjC;AAAA,MACA,mBAAmB,cAAc,IAAI;AAAA,MACrC,8BAA8B,cAAc,IAAI,IAAI,cAAc,UAAU;AAAA,MAC5E;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,kBAAkB,cAAc,IAAI,IAAI,cAAc,UAAU;AAAA,MAChE;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,
|
|
4
|
+
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as consts from '../consts'\nimport { Module } from '../module'\nimport { BotPluginsIndexModule } from './bot-plugins'\nimport { BotTypingsModule } from './bot-typings'\n\nexport class BotImplementationModule extends Module {\n private _typingsModule: BotTypingsModule\n private _pluginsModule: BotPluginsIndexModule\n\n public constructor(bot: sdk.BotDefinition) {\n super({\n exportName: 'Bot',\n path: consts.INDEX_FILE,\n })\n\n this._typingsModule = new BotTypingsModule(bot)\n this._typingsModule.unshift('typings')\n this.pushDep(this._typingsModule)\n\n this._pluginsModule = new BotPluginsIndexModule(bot)\n this._pluginsModule.unshift(consts.fromOutDir.pluginsDir)\n this.pushDep(this._pluginsModule)\n }\n\n public async getContent() {\n const {\n //\n _typingsModule: typingsModule,\n _pluginsModule: pluginsModule,\n } = this\n\n const typingsImport = typingsModule.import(this)\n const pluginsImport = pluginsModule.import(this)\n\n return [\n consts.GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n `import * as ${typingsModule.name} from \"./${typingsImport}\"`,\n `import * as ${pluginsModule.name} from \"./${pluginsImport}\"`,\n '',\n `export * from \"./${typingsImport}\"`,\n `export * from \"./${pluginsImport}\"`,\n '',\n `type TPlugins = ${pluginsModule.name}.TPlugins`,\n `type TBot = sdk.DefaultBot<${typingsModule.name}.${typingsModule.exportName}>`,\n '',\n 'export type BotProps = {',\n ' actions: sdk.BotProps<TBot, TPlugins>[\"actions\"]',\n '}',\n '',\n 'export class Bot extends sdk.Bot<TBot, TPlugins> {',\n ' public constructor(props: BotProps) {',\n ' super({',\n ' actions: props.actions,',\n ` plugins: ${pluginsModule.name}.${pluginsModule.exportName}`,\n ' })',\n ' }',\n '}',\n '',\n '// extra types',\n '',\n 'type AsyncFunction = (...args: any[]) => Promise<any>',\n '',\n 'export type BotHandlers = sdk.InjectedBotHandlers<TBot>',\n '',\n 'export type EventHandlers = Required<{',\n \" [K in keyof BotHandlers['eventHandlers']]: NonNullable<BotHandlers['eventHandlers'][K]>[number]\",\n '}>',\n 'export type MessageHandlers = Required<{',\n \" [K in keyof BotHandlers['messageHandlers']]: NonNullable<BotHandlers['messageHandlers'][K]>[number]\",\n '}>',\n 'export type WorkflowHandlers = {',\n \" [TWorkflowName in keyof Required<BotHandlers['workflowHandlers'][keyof BotHandlers['workflowHandlers']]>]:\",\n \" NonNullable<Required<BotHandlers['workflowHandlers'][keyof BotHandlers['workflowHandlers']]>[TWorkflowName]>[number]\",\n '}',\n '',\n \"export type MessageHandlerProps = Parameters<MessageHandlers['*']>[0]\",\n \"export type EventHandlerProps = Parameters<EventHandlers['*']>[0]\",\n 'export type WorkflowHandlerProps = {',\n ' [TWorkflowName in keyof WorkflowHandlers]: WorkflowHandlers[TWorkflowName] extends',\n ' (..._: infer U) => any ? U[0] : never',\n '}',\n '',\n \"export type Client = (MessageHandlerProps | EventHandlerProps)['client']\",\n 'export type ClientOperation = keyof {',\n ' [K in keyof Client as Client[K] extends AsyncFunction ? K : never]: null',\n '}',\n 'export type ClientInputs = {',\n ' [K in ClientOperation]: Parameters<Client[K]>[0]',\n '}',\n 'export type ClientOutputs = {',\n ' [K in ClientOperation]: Awaited<ReturnType<Client[K]>>',\n '}',\n ].join('\\n')\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,oBAAuB;AACvB,yBAAsC;AACtC,yBAAiC;AAE1B,MAAM,gCAAgC,qBAAO;AAAA,EAC1C;AAAA,EACA;AAAA,EAED,YAAY,KAAwB;AACzC,UAAM;AAAA,MACJ,YAAY;AAAA,MACZ,MAAM,OAAO;AAAA,IACf,CAAC;AAED,SAAK,iBAAiB,IAAI,oCAAiB,GAAG;AAC9C,SAAK,eAAe,QAAQ,SAAS;AACrC,SAAK,QAAQ,KAAK,cAAc;AAEhC,SAAK,iBAAiB,IAAI,yCAAsB,GAAG;AACnD,SAAK,eAAe,QAAQ,OAAO,WAAW,UAAU;AACxD,SAAK,QAAQ,KAAK,cAAc;AAAA,EAClC;AAAA,EAEA,MAAa,aAAa;AACxB,UAAM;AAAA;AAAA,MAEJ,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,IAClB,IAAI;AAEJ,UAAM,gBAAgB,cAAc,OAAO,IAAI;AAC/C,UAAM,gBAAgB,cAAc,OAAO,IAAI;AAE/C,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA,eAAe,cAAc,IAAI,YAAY,aAAa;AAAA,MAC1D,eAAe,cAAc,IAAI,YAAY,aAAa;AAAA,MAC1D;AAAA,MACA,oBAAoB,aAAa;AAAA,MACjC,oBAAoB,aAAa;AAAA,MACjC;AAAA,MACA,mBAAmB,cAAc,IAAI;AAAA,MACrC,8BAA8B,cAAc,IAAI,IAAI,cAAc,UAAU;AAAA,MAC5E;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,kBAAkB,cAAc,IAAI,IAAI,cAAc,UAAU;AAAA,MAChE;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;AAAA,EACb;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -74,8 +74,8 @@ class PluginConfigModule extends import_module.Module {
|
|
|
74
74
|
this._plugin = config.plugin;
|
|
75
75
|
}
|
|
76
76
|
async getContent() {
|
|
77
|
-
const { interfaces, configuration, alias } = this._plugin;
|
|
78
|
-
const content = JSON.stringify({ alias, interfaces, configuration }, null, 2);
|
|
77
|
+
const { interfaces, integrations, configuration, alias } = this._plugin;
|
|
78
|
+
const content = JSON.stringify({ alias, interfaces, integrations, configuration }, null, 2);
|
|
79
79
|
return `export default ${content}`;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/bot-implementation/bot-plugins/plugin-module.ts"],
|
|
4
|
-
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as consts from '../../consts'\nimport { Module, ModuleProps } from '../../module'\nimport { PluginTypingsModule } from '../../plugin-implementation/plugin-typings'\n\ntype PluginInstance = NonNullable<sdk.BotDefinition['plugins']>[string]\n\nclass BundleJsModule extends Module {\n private _indexJs: string\n public constructor(plugin: PluginInstance) {\n super({\n path: 'bundle.js',\n exportName: 'default',\n })\n this._indexJs = plugin.implementation.toString()\n }\n\n public async getContent() {\n return this._indexJs\n }\n}\n\nclass BundleDtsModule extends Module {\n public constructor(private _typingsModule: PluginTypingsModule) {\n super({\n path: 'bundle.d.ts',\n exportName: 'default',\n })\n }\n\n public async getContent() {\n const typingsImport = this._typingsModule.import(this)\n\n return [\n consts.GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n `import * as ${this._typingsModule.name} from \"./${typingsImport}\"`,\n `type TPlugin = sdk.DefaultPlugin<${this._typingsModule.name}.${this._typingsModule.exportName}>`,\n 'export default new sdk.Plugin<TPlugin>({})',\n '',\n ].join('\\n')\n }\n}\n\nclass PluginConfigModule extends Module {\n private _plugin: PluginInstance\n public constructor(config: ModuleProps & { plugin: PluginInstance }) {\n super(config)\n this._plugin = config.plugin\n }\n\n public async getContent() {\n const { interfaces, configuration, alias } = this._plugin\n const content = JSON.stringify({ alias, interfaces, configuration }, null, 2)\n return `export default ${content}`\n }\n}\n\nexport class BotPluginModule extends Module {\n private _typingsModule: PluginTypingsModule\n private _bundleJsModule: BundleJsModule\n private _bundleDtsModule: BundleDtsModule\n private _configModule: PluginConfigModule\n\n public readonly pluginKey: string\n\n public constructor(plugin: PluginInstance) {\n super({\n exportName: 'default',\n path: consts.INDEX_FILE,\n })\n\n this.pluginKey = plugin.alias ?? plugin.name\n\n this._typingsModule = new PluginTypingsModule(plugin.definition)\n this._typingsModule.unshift('typings')\n this.pushDep(this._typingsModule)\n\n this._bundleJsModule = new BundleJsModule(plugin)\n this.pushDep(this._bundleJsModule)\n\n this._bundleDtsModule = new BundleDtsModule(this._typingsModule)\n this.pushDep(this._bundleDtsModule)\n\n this._configModule = new PluginConfigModule({\n path: 'config.ts',\n exportName: 'default',\n plugin,\n })\n this.pushDep(this._configModule)\n }\n\n public async getContent() {\n const configImport = this._configModule.import(this)\n const typingsImport = this._typingsModule.import(this)\n return [\n consts.GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n 'import bundle from \"./bundle\"',\n `import * as ${this._typingsModule.name} from \"./${typingsImport}\"`,\n `import * as ${this._configModule.name} from \"./${configImport}\"`,\n '',\n `export type TPlugin = sdk.DefaultPlugin<${this._typingsModule.name}.${this._typingsModule.exportName}>`,\n '',\n `export const configuration = ${this._configModule.name}.${this._configModule.exportName}.configuration`,\n `export const interfaces = ${this._configModule.name}.${this._configModule.exportName}.interfaces`,\n '',\n `export default bundle.initialize(${this._configModule.name}.${this._configModule.exportName})`,\n '',\n ].join('\\n')\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,oBAAoC;AACpC,4BAAoC;AAIpC,MAAM,uBAAuB,qBAAO;AAAA,EAC1B;AAAA,EACD,YAAY,QAAwB;AACzC,UAAM;AAAA,MACJ,MAAM;AAAA,MACN,YAAY;AAAA,IACd,CAAC;AACD,SAAK,WAAW,OAAO,eAAe,SAAS;AAAA,EACjD;AAAA,EAEA,MAAa,aAAa;AACxB,WAAO,KAAK;AAAA,EACd;AACF;AAEA,MAAM,wBAAwB,qBAAO;AAAA,EAC5B,YAAoB,gBAAqC;AAC9D,UAAM;AAAA,MACJ,MAAM;AAAA,MACN,YAAY;AAAA,IACd,CAAC;AAJwB;AAAA,EAK3B;AAAA,EAEA,MAAa,aAAa;AACxB,UAAM,gBAAgB,KAAK,eAAe,OAAO,IAAI;AAErD,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA,eAAe,KAAK,eAAe,IAAI,YAAY,aAAa;AAAA,MAChE,oCAAoC,KAAK,eAAe,IAAI,IAAI,KAAK,eAAe,UAAU;AAAA,MAC9F;AAAA,MACA;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACF;AAEA,MAAM,2BAA2B,qBAAO;AAAA,EAC9B;AAAA,EACD,YAAY,QAAkD;AACnE,UAAM,MAAM;AACZ,SAAK,UAAU,OAAO;AAAA,EACxB;AAAA,EAEA,MAAa,aAAa;AACxB,UAAM,EAAE,YAAY,eAAe,MAAM,IAAI,KAAK;
|
|
4
|
+
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as consts from '../../consts'\nimport { Module, ModuleProps } from '../../module'\nimport { PluginTypingsModule } from '../../plugin-implementation/plugin-typings'\n\ntype PluginInstance = NonNullable<sdk.BotDefinition['plugins']>[string]\n\nclass BundleJsModule extends Module {\n private _indexJs: string\n public constructor(plugin: PluginInstance) {\n super({\n path: 'bundle.js',\n exportName: 'default',\n })\n this._indexJs = plugin.implementation.toString()\n }\n\n public async getContent() {\n return this._indexJs\n }\n}\n\nclass BundleDtsModule extends Module {\n public constructor(private _typingsModule: PluginTypingsModule) {\n super({\n path: 'bundle.d.ts',\n exportName: 'default',\n })\n }\n\n public async getContent() {\n const typingsImport = this._typingsModule.import(this)\n\n return [\n consts.GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n `import * as ${this._typingsModule.name} from \"./${typingsImport}\"`,\n `type TPlugin = sdk.DefaultPlugin<${this._typingsModule.name}.${this._typingsModule.exportName}>`,\n 'export default new sdk.Plugin<TPlugin>({})',\n '',\n ].join('\\n')\n }\n}\n\nclass PluginConfigModule extends Module {\n private _plugin: PluginInstance\n public constructor(config: ModuleProps & { plugin: PluginInstance }) {\n super(config)\n this._plugin = config.plugin\n }\n\n public async getContent() {\n const { interfaces, integrations, configuration, alias } = this._plugin\n const content = JSON.stringify({ alias, interfaces, integrations, configuration }, null, 2)\n return `export default ${content}`\n }\n}\n\nexport class BotPluginModule extends Module {\n private _typingsModule: PluginTypingsModule\n private _bundleJsModule: BundleJsModule\n private _bundleDtsModule: BundleDtsModule\n private _configModule: PluginConfigModule\n\n public readonly pluginKey: string\n\n public constructor(plugin: PluginInstance) {\n super({\n exportName: 'default',\n path: consts.INDEX_FILE,\n })\n\n this.pluginKey = plugin.alias ?? plugin.name\n\n this._typingsModule = new PluginTypingsModule(plugin.definition)\n this._typingsModule.unshift('typings')\n this.pushDep(this._typingsModule)\n\n this._bundleJsModule = new BundleJsModule(plugin)\n this.pushDep(this._bundleJsModule)\n\n this._bundleDtsModule = new BundleDtsModule(this._typingsModule)\n this.pushDep(this._bundleDtsModule)\n\n this._configModule = new PluginConfigModule({\n path: 'config.ts',\n exportName: 'default',\n plugin,\n })\n this.pushDep(this._configModule)\n }\n\n public async getContent() {\n const configImport = this._configModule.import(this)\n const typingsImport = this._typingsModule.import(this)\n return [\n consts.GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n 'import bundle from \"./bundle\"',\n `import * as ${this._typingsModule.name} from \"./${typingsImport}\"`,\n `import * as ${this._configModule.name} from \"./${configImport}\"`,\n '',\n `export type TPlugin = sdk.DefaultPlugin<${this._typingsModule.name}.${this._typingsModule.exportName}>`,\n '',\n `export const configuration = ${this._configModule.name}.${this._configModule.exportName}.configuration`,\n `export const interfaces = ${this._configModule.name}.${this._configModule.exportName}.interfaces`,\n '',\n `export default bundle.initialize(${this._configModule.name}.${this._configModule.exportName})`,\n '',\n ].join('\\n')\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,oBAAoC;AACpC,4BAAoC;AAIpC,MAAM,uBAAuB,qBAAO;AAAA,EAC1B;AAAA,EACD,YAAY,QAAwB;AACzC,UAAM;AAAA,MACJ,MAAM;AAAA,MACN,YAAY;AAAA,IACd,CAAC;AACD,SAAK,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,eAAe;AAEjC,SAAK,mBAAmB,IAAI,gBAAgB,KAAK,cAAc;AAC/D,SAAK,QAAQ,KAAK,gBAAgB;AAElC,SAAK,gBAAgB,IAAI,mBAAmB;AAAA,MAC1C,MAAM;AAAA,MACN,YAAY;AAAA,MACZ;AAAA,IACF,CAAC;AACD,SAAK,QAAQ,KAAK,aAAa;AAAA,EACjC;AAAA,EAEA,MAAa,aAAa;AACxB,UAAM,eAAe,KAAK,cAAc,OAAO,IAAI;AACnD,UAAM,gBAAgB,KAAK,eAAe,OAAO,IAAI;AACrD,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,eAAe,KAAK,eAAe,IAAI,YAAY,aAAa;AAAA,MAChE,eAAe,KAAK,cAAc,IAAI,YAAY,YAAY;AAAA,MAC9D;AAAA,MACA,2CAA2C,KAAK,eAAe,IAAI,IAAI,KAAK,eAAe,UAAU;AAAA,MACrG;AAAA,MACA,gCAAgC,KAAK,cAAc,IAAI,IAAI,KAAK,cAAc,UAAU;AAAA,MACxF,6BAA6B,KAAK,cAAc,IAAI,IAAI,KAAK,cAAc,UAAU;AAAA,MACrF;AAAA,MACA,oCAAoC,KAAK,cAAc,IAAI,IAAI,KAAK,cAAc,UAAU;AAAA,MAC5F;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -65,7 +65,7 @@ class PluginImplementationModule extends import_module.Module {
|
|
|
65
65
|
"type ValueOf<T> = T[keyof T]",
|
|
66
66
|
"type AsyncFunction = (...args: any[]) => Promise<any>",
|
|
67
67
|
"",
|
|
68
|
-
"export type PluginHandlers = sdk.
|
|
68
|
+
"export type PluginHandlers = sdk.InjectedPluginHandlers<TPlugin>",
|
|
69
69
|
"",
|
|
70
70
|
"export type EventHandlers = Required<{",
|
|
71
71
|
" [K in keyof PluginHandlers['eventHandlers']]: NonNullable<PluginHandlers['eventHandlers'][K]>[number]",
|
|
@@ -80,8 +80,7 @@ class PluginImplementationModule extends import_module.Module {
|
|
|
80
80
|
"}>",
|
|
81
81
|
"export type WorkflowHandlers = {",
|
|
82
82
|
" [TWorkflowName in keyof Required<PluginHandlers['workflowHandlers'][keyof PluginHandlers['workflowHandlers']]>]:",
|
|
83
|
-
" Required<PluginHandlers['workflowHandlers'][keyof PluginHandlers['workflowHandlers']]>[TWorkflowName]
|
|
84
|
-
" ({ handler: infer U })[] ? U : never",
|
|
83
|
+
" NonNullable<Required<PluginHandlers['workflowHandlers'][keyof PluginHandlers['workflowHandlers']]>[TWorkflowName]>[number]",
|
|
85
84
|
"}",
|
|
86
85
|
"",
|
|
87
86
|
"export type AnyMessageHandler = MessageHandlers['*']",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/code-generation/plugin-implementation/plugin-implementation.ts"],
|
|
4
|
-
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as consts from '../consts'\nimport { Module } from '../module'\nimport { PluginTypingsModule } from './plugin-typings'\n\nexport class PluginImplementationModule extends Module {\n private _typingsModule: PluginTypingsModule\n\n public constructor(plugin: sdk.PluginDefinition) {\n super({\n exportName: 'Plugin',\n path: consts.INDEX_FILE,\n })\n\n this._typingsModule = new PluginTypingsModule(plugin)\n this._typingsModule.unshift('typings')\n this.pushDep(this._typingsModule)\n }\n\n public async getContent() {\n const typingsImport = this._typingsModule.import(this)\n\n return [\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 TPlugin = sdk.DefaultPlugin<${this._typingsModule.name}.${this._typingsModule.exportName}>`,\n '',\n 'export class Plugin extends sdk.Plugin<TPlugin> {}',\n '',\n 'export type PluginProps = sdk.PluginProps<TPlugin>',\n 'export type PluginRuntimeProps = sdk.PluginRuntimeProps<TPlugin>',\n '',\n '// extra types',\n '',\n 'type ValueOf<T> = T[keyof T]',\n 'type AsyncFunction = (...args: any[]) => Promise<any>',\n '',\n 'export type PluginHandlers = sdk.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,oBAAuB;AACvB,4BAAoC;AAE7B,MAAM,mCAAmC,qBAAO;AAAA,EAC7C;AAAA,EAED,YAAY,QAA8B;AAC/C,UAAM;AAAA,MACJ,YAAY;AAAA,MACZ,MAAM,OAAO;AAAA,IACf,CAAC;AAED,SAAK,iBAAiB,IAAI,0CAAoB,MAAM;AACpD,SAAK,eAAe,QAAQ,SAAS;AACrC,SAAK,QAAQ,KAAK,cAAc;AAAA,EAClC;AAAA,EAEA,MAAa,aAAa;AACxB,UAAM,gBAAgB,KAAK,eAAe,OAAO,IAAI;AAErD,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA,eAAe,KAAK,eAAe,IAAI,YAAY,aAAa;AAAA,MAChE,oBAAoB,aAAa;AAAA,MACjC;AAAA,MACA,oCAAoC,KAAK,eAAe,IAAI,IAAI,KAAK,eAAe,UAAU;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,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,
|
|
4
|
+
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as consts from '../consts'\nimport { Module } from '../module'\nimport { PluginTypingsModule } from './plugin-typings'\n\nexport class PluginImplementationModule extends Module {\n private _typingsModule: PluginTypingsModule\n\n public constructor(plugin: sdk.PluginDefinition) {\n super({\n exportName: 'Plugin',\n path: consts.INDEX_FILE,\n })\n\n this._typingsModule = new PluginTypingsModule(plugin)\n this._typingsModule.unshift('typings')\n this.pushDep(this._typingsModule)\n }\n\n public async getContent() {\n const typingsImport = this._typingsModule.import(this)\n\n return [\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 TPlugin = sdk.DefaultPlugin<${this._typingsModule.name}.${this._typingsModule.exportName}>`,\n '',\n 'export class Plugin extends sdk.Plugin<TPlugin> {}',\n '',\n 'export type PluginProps = sdk.PluginProps<TPlugin>',\n 'export type PluginRuntimeProps = sdk.PluginRuntimeProps<TPlugin>',\n '',\n '// extra types',\n '',\n 'type ValueOf<T> = T[keyof T]',\n 'type AsyncFunction = (...args: any[]) => Promise<any>',\n '',\n 'export type PluginHandlers = sdk.InjectedPluginHandlers<TPlugin>',\n '',\n 'export type EventHandlers = Required<{',\n \" [K in keyof PluginHandlers['eventHandlers']]: NonNullable<PluginHandlers['eventHandlers'][K]>[number]\",\n '}>',\n 'export type MessageHandlers = Required<{',\n \" [K in keyof PluginHandlers['messageHandlers']]: NonNullable<PluginHandlers['messageHandlers'][K]>[number]\",\n '}>',\n 'export type HookHandlers = Required<{',\n \" [H in keyof PluginHandlers['hookHandlers']]: Required<{\",\n \" [K in keyof PluginHandlers['hookHandlers'][H]]: NonNullable<PluginHandlers['hookHandlers'][H][K]>[number]\",\n ' }>',\n '}>',\n 'export type WorkflowHandlers = {',\n \" [TWorkflowName in keyof Required<PluginHandlers['workflowHandlers'][keyof PluginHandlers['workflowHandlers']]>]:\",\n \" NonNullable<Required<PluginHandlers['workflowHandlers'][keyof PluginHandlers['workflowHandlers']]>[TWorkflowName]>[number]\",\n '}',\n '',\n \"export type AnyMessageHandler = MessageHandlers['*']\",\n \"export type AnyEventHandler = EventHandlers['*']\",\n \"export type AnyActionHandler = ValueOf<PluginHandlers['actionHandlers']>\",\n 'export type AnyHookHanders = {',\n \" [H in keyof HookHandlers]: NonNullable<HookHandlers[H]['*']>\",\n '}',\n '',\n 'export type MessageHandlerProps = Parameters<AnyMessageHandler>[0]',\n 'export type EventHandlerProps = Parameters<AnyEventHandler>[0]',\n 'export type ActionHandlerProps = Parameters<AnyActionHandler>[0]',\n 'export type HookHandlerProps = {',\n ' [H in keyof AnyHookHanders]: Parameters<NonNullable<AnyHookHanders[H]>>[0]',\n '}',\n 'export type WorkflowHandlerProps = {',\n ' [TWorkflowName in keyof WorkflowHandlers]: WorkflowHandlers[TWorkflowName] extends',\n ' (..._: infer U) => any ? U[0] : never',\n '}',\n '',\n \"export type Client = (MessageHandlerProps | EventHandlerProps)['client']\",\n 'export type ClientOperation = keyof {',\n ' [K in keyof Client as Client[K] extends AsyncFunction ? K : never]: null',\n '}',\n 'export type ClientInputs = {',\n ' [K in ClientOperation]: Parameters<Client[K]>[0]',\n '}',\n 'export type ClientOutputs = {',\n ' [K in ClientOperation]: Awaited<ReturnType<Client[K]>>',\n '}',\n ].join('\\n')\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,aAAwB;AACxB,oBAAuB;AACvB,4BAAoC;AAE7B,MAAM,mCAAmC,qBAAO;AAAA,EAC7C;AAAA,EAED,YAAY,QAA8B;AAC/C,UAAM;AAAA,MACJ,YAAY;AAAA,MACZ,MAAM,OAAO;AAAA,IACf,CAAC;AAED,SAAK,iBAAiB,IAAI,0CAAoB,MAAM;AACpD,SAAK,eAAe,QAAQ,SAAS;AACrC,SAAK,QAAQ,KAAK,cAAc;AAAA,EAClC;AAAA,EAEA,MAAa,aAAa;AACxB,UAAM,gBAAgB,KAAK,eAAe,OAAO,IAAI;AAErD,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA,eAAe,KAAK,eAAe,IAAI,YAAY,aAAa;AAAA,MAChE,oBAAoB,aAAa;AAAA,MACjC;AAAA,MACA,oCAAoC,KAAK,eAAe,IAAI,IAAI,KAAK,eAAe,UAAU;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,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
// 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.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var conversation_module_exports = {};
|
|
30
|
+
__export(conversation_module_exports, {
|
|
31
|
+
ConversationModule: () => ConversationModule
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(conversation_module_exports);
|
|
34
|
+
var import_consts = require("../../consts");
|
|
35
|
+
var consts = __toESM(require("../../consts"));
|
|
36
|
+
var import_generators = require("../../generators");
|
|
37
|
+
var import_module = require("../../module");
|
|
38
|
+
var strings = __toESM(require("../../strings"));
|
|
39
|
+
class ConversationModule extends import_module.Module {
|
|
40
|
+
constructor(_conversation) {
|
|
41
|
+
const name = "conversation";
|
|
42
|
+
const exportName = strings.typeName(name);
|
|
43
|
+
super({
|
|
44
|
+
path: import_consts.INDEX_FILE,
|
|
45
|
+
exportName
|
|
46
|
+
});
|
|
47
|
+
this._conversation = _conversation;
|
|
48
|
+
}
|
|
49
|
+
async getContent() {
|
|
50
|
+
const conversation = { tags: this._conversation?.tags ?? {} };
|
|
51
|
+
return [
|
|
52
|
+
consts.GENERATED_HEADER,
|
|
53
|
+
`export type ${this.exportName} = {`,
|
|
54
|
+
` tags: ${(0, import_generators.stringifySingleLine)(conversation.tags)}`,
|
|
55
|
+
"}"
|
|
56
|
+
].join("\n");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
ConversationModule
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=conversation-module.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/code-generation/plugin-implementation/plugin-typings/conversation-module.ts"],
|
|
4
|
+
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { INDEX_FILE } from '../../consts'\nimport * as consts from '../../consts'\nimport { stringifySingleLine } from '../../generators'\nimport { Module } from '../../module'\nimport * as strings from '../../strings'\n\nexport class ConversationModule extends Module {\n public constructor(private _conversation: sdk.PluginDefinition['conversation']) {\n const name = 'conversation'\n const exportName = strings.typeName(name)\n super({\n path: INDEX_FILE,\n exportName,\n })\n }\n\n public async getContent() {\n const conversation = { tags: this._conversation?.tags ?? {} }\n\n return [\n consts.GENERATED_HEADER,\n `export type ${this.exportName} = {`,\n ` tags: ${stringifySingleLine(conversation.tags)}`,\n '}',\n ].join('\\n')\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAC3B,aAAwB;AACxB,wBAAoC;AACpC,oBAAuB;AACvB,cAAyB;AAElB,MAAM,2BAA2B,qBAAO;AAAA,EACtC,YAAoB,eAAqD;AAC9E,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,UAAM,eAAe,EAAE,MAAM,KAAK,eAAe,QAAQ,CAAC,EAAE;AAE5D,WAAO;AAAA,MACL,OAAO;AAAA,MACP,eAAe,KAAK,UAAU;AAAA,MAC9B,eAAW,uCAAoB,aAAa,IAAI,CAAC;AAAA,MACjD;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -38,9 +38,12 @@ var import_module = require("../../module");
|
|
|
38
38
|
var strings = __toESM(require("../../strings"));
|
|
39
39
|
var import_actions_module = require("./actions-module");
|
|
40
40
|
var import_configuration_module = require("./configuration-module");
|
|
41
|
+
var import_conversation_module = require("./conversation-module");
|
|
41
42
|
var import_events_module = require("./events-module");
|
|
43
|
+
var import_message_module = require("./message-module");
|
|
42
44
|
var import_states_module = require("./states-module");
|
|
43
45
|
var import_tables_module = require("./tables-module");
|
|
46
|
+
var import_user_module = require("./user-module");
|
|
44
47
|
var import_workflows_module = require("./workflows-module");
|
|
45
48
|
class PluginIntegrationsModule extends import_module.ReExportTypeModule {
|
|
46
49
|
constructor(plugin) {
|
|
@@ -108,6 +111,15 @@ class PluginTypingsModule extends import_module.Module {
|
|
|
108
111
|
const workflowsModule = new import_workflows_module.WorkflowsModule(_plugin.workflows ?? {});
|
|
109
112
|
workflowsModule.unshift("workflows");
|
|
110
113
|
this.pushDep(workflowsModule);
|
|
114
|
+
const conversationModule = new import_conversation_module.ConversationModule(_plugin.conversation);
|
|
115
|
+
conversationModule.unshift("conversation");
|
|
116
|
+
this.pushDep(conversationModule);
|
|
117
|
+
const messageModule = new import_message_module.MessageModule(_plugin.message);
|
|
118
|
+
messageModule.unshift("message");
|
|
119
|
+
this.pushDep(messageModule);
|
|
120
|
+
const userModule = new import_user_module.UserModule(_plugin.user);
|
|
121
|
+
userModule.unshift("user");
|
|
122
|
+
this.pushDep(userModule);
|
|
111
123
|
this._dependencies = {
|
|
112
124
|
integrationsModule,
|
|
113
125
|
interfacesModule,
|
|
@@ -116,7 +128,10 @@ class PluginTypingsModule extends import_module.Module {
|
|
|
116
128
|
statesModule,
|
|
117
129
|
actionsModule,
|
|
118
130
|
tablesModule,
|
|
119
|
-
workflowsModule
|
|
131
|
+
workflowsModule,
|
|
132
|
+
conversationModule,
|
|
133
|
+
messageModule,
|
|
134
|
+
userModule
|
|
120
135
|
};
|
|
121
136
|
}
|
|
122
137
|
_dependencies;
|
|
@@ -129,7 +144,10 @@ class PluginTypingsModule extends import_module.Module {
|
|
|
129
144
|
statesModule,
|
|
130
145
|
actionsModule,
|
|
131
146
|
tablesModule,
|
|
132
|
-
workflowsModule
|
|
147
|
+
workflowsModule,
|
|
148
|
+
conversationModule,
|
|
149
|
+
messageModule,
|
|
150
|
+
userModule
|
|
133
151
|
} = this._dependencies;
|
|
134
152
|
const integrationsImport = integrationsModule.import(this);
|
|
135
153
|
const interfacesImport = interfacesModule.import(this);
|
|
@@ -139,6 +157,9 @@ class PluginTypingsModule extends import_module.Module {
|
|
|
139
157
|
const actionsImport = actionsModule;
|
|
140
158
|
const tablesImport = tablesModule.import(this);
|
|
141
159
|
const workflowsImport = workflowsModule;
|
|
160
|
+
const conversationImport = conversationModule.import(this);
|
|
161
|
+
const messageImport = messageModule.import(this);
|
|
162
|
+
const userImport = userModule.import(this);
|
|
142
163
|
return [
|
|
143
164
|
consts.GENERATED_HEADER,
|
|
144
165
|
`import * as ${integrationsModule.name} from './${integrationsImport}'`,
|
|
@@ -149,6 +170,9 @@ class PluginTypingsModule extends import_module.Module {
|
|
|
149
170
|
`import * as ${actionsModule.name} from './${actionsImport.name}'`,
|
|
150
171
|
`import * as ${tablesModule.name} from './${tablesImport}'`,
|
|
151
172
|
`import * as ${workflowsModule.name} from './${workflowsImport.name}'`,
|
|
173
|
+
`import * as ${conversationModule.name} from './${conversationImport}'`,
|
|
174
|
+
`import * as ${messageModule.name} from './${messageImport}'`,
|
|
175
|
+
`import * as ${userModule.name} from './${userImport}'`,
|
|
152
176
|
"",
|
|
153
177
|
`export * as ${integrationsModule.name} from './${integrationsImport}'`,
|
|
154
178
|
`export * as ${interfacesModule.name} from './${interfacesImport}'`,
|
|
@@ -158,6 +182,9 @@ class PluginTypingsModule extends import_module.Module {
|
|
|
158
182
|
`export * as ${actionsModule.name} from './${actionsImport.name}'`,
|
|
159
183
|
`export * as ${tablesModule.name} from './${tablesImport}'`,
|
|
160
184
|
`export * as ${workflowsModule.name} from './${workflowsImport.name}'`,
|
|
185
|
+
`export * as ${conversationModule.name} from './${conversationImport}'`,
|
|
186
|
+
`export * as ${messageModule.name} from './${messageImport}'`,
|
|
187
|
+
`export * as ${userModule.name} from './${userImport}'`,
|
|
161
188
|
"",
|
|
162
189
|
"export type TPlugin = {",
|
|
163
190
|
` name: "${this._plugin.name}"`,
|
|
@@ -170,6 +197,9 @@ class PluginTypingsModule extends import_module.Module {
|
|
|
170
197
|
` actions: ${actionsModule.name}.${actionsModule.exportName}`,
|
|
171
198
|
` tables: ${tablesModule.name}.${tablesModule.exportName}`,
|
|
172
199
|
` workflows: ${workflowsModule.name}.${workflowsModule.exportName}`,
|
|
200
|
+
` conversation: ${conversationModule.name}.${conversationModule.exportName}`,
|
|
201
|
+
` message: ${messageModule.name}.${messageModule.exportName}`,
|
|
202
|
+
` user: ${userModule.name}.${userModule.exportName}`,
|
|
173
203
|
"}"
|
|
174
204
|
].join("\n");
|
|
175
205
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/code-generation/plugin-implementation/plugin-typings/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as utils from '../../../utils'\nimport * as consts from '../../consts'\nimport { IntegrationTypingsModule } from '../../integration-implementation/integration-typings'\nimport { InterfaceTypingsModule } from '../../interface-implementation'\nimport { Module, ReExportTypeModule, SingleFileModule } from '../../module'\nimport * as strings from '../../strings'\nimport { ActionsModule } from './actions-module'\nimport { DefaultConfigurationModule } from './configuration-module'\nimport { EventsModule } from './events-module'\nimport { StatesModule } from './states-module'\nimport { TablesModule } from './tables-module'\nimport { WorkflowsModule } from './workflows-module'\n\nclass PluginIntegrationsModule extends ReExportTypeModule {\n public constructor(plugin: sdk.PluginDefinition) {\n super({\n exportName: 'Integrations',\n })\n\n for (const [alias, integration] of Object.entries(plugin.integrations ?? {})) {\n const integrationModule = new IntegrationTypingsModule(integration.definition)\n integrationModule.unshift(strings.dirName(alias))\n this.pushDep(integrationModule)\n }\n }\n}\n\nclass PluginInterfacesModule extends ReExportTypeModule {\n public constructor(plugin: sdk.PluginDefinition) {\n super({\n exportName: 'Interfaces',\n })\n\n for (const [alias, intrface] of Object.entries(plugin.interfaces ?? {})) {\n const interfaceModule = new InterfaceTypingsModule(intrface.definition)\n interfaceModule.unshift(strings.dirName(alias))\n this.pushDep(interfaceModule)\n }\n }\n}\n\ntype PluginTypingsIndexDependencies = {\n integrationsModule: PluginIntegrationsModule\n interfacesModule: PluginInterfacesModule\n defaultConfigModule: DefaultConfigurationModule\n eventsModule: EventsModule\n statesModule: StatesModule\n actionsModule: ActionsModule\n tablesModule: TablesModule\n workflowsModule: WorkflowsModule\n}\n\ntype _assertPropsInPluginDefinition = utils.types.AssertKeyOf<'props', sdk.PluginDefinition>\nconst _isLocalPluginDefinition = (\n plugin: sdk.PluginDefinition | sdk.PluginPackage['definition']\n): plugin is sdk.PluginDefinition => {\n return 'props' in plugin\n}\n\nexport class PluginTypingsModule extends Module {\n private _dependencies: PluginTypingsIndexDependencies\n\n public constructor(private _plugin: sdk.PluginDefinition | sdk.PluginPackage['definition']) {\n super({\n exportName: 'TPlugin',\n path: consts.INDEX_FILE,\n })\n\n const integrationsModule = _isLocalPluginDefinition(_plugin)\n ? new PluginIntegrationsModule(_plugin)\n : new SingleFileModule({\n path: consts.INDEX_FILE,\n exportName: 'Integrations',\n content: 'export type Integrations = {}',\n })\n integrationsModule.unshift('integrations')\n this.pushDep(integrationsModule)\n\n const interfacesModule = _isLocalPluginDefinition(_plugin)\n ? new PluginInterfacesModule(_plugin)\n : new SingleFileModule({\n path: consts.INDEX_FILE,\n exportName: 'Interfaces',\n content: 'export type Interfaces = {}',\n })\n interfacesModule.unshift('interfaces')\n this.pushDep(interfacesModule)\n\n const defaultConfigModule = new DefaultConfigurationModule(_plugin.configuration)\n defaultConfigModule.unshift('configuration')\n this.pushDep(defaultConfigModule)\n\n const eventsModule = new EventsModule(_plugin.events ?? {})\n eventsModule.unshift('events')\n this.pushDep(eventsModule)\n\n const statesModule = new StatesModule(_plugin.states ?? {})\n statesModule.unshift('states')\n this.pushDep(statesModule)\n\n const actionsModule = new ActionsModule(_plugin.actions ?? {})\n actionsModule.unshift('actions')\n this.pushDep(actionsModule)\n\n const tablesModule = new TablesModule(_plugin.tables ?? {})\n tablesModule.unshift('tables')\n this.pushDep(tablesModule)\n\n const workflowsModule = new WorkflowsModule(_plugin.workflows ?? {})\n workflowsModule.unshift('workflows')\n this.pushDep(workflowsModule)\n\n this._dependencies = {\n integrationsModule,\n interfacesModule,\n defaultConfigModule,\n eventsModule,\n statesModule,\n actionsModule,\n tablesModule,\n workflowsModule,\n }\n }\n\n public async getContent() {\n const {\n integrationsModule,\n interfacesModule,\n defaultConfigModule,\n eventsModule,\n statesModule,\n actionsModule,\n tablesModule,\n workflowsModule,\n } = this._dependencies\n\n const integrationsImport = integrationsModule.import(this)\n const interfacesImport = interfacesModule.import(this)\n const defaultConfigImport = defaultConfigModule.import(this)\n const eventsImport = eventsModule.import(this)\n const statesImport = statesModule.import(this)\n const actionsImport = actionsModule\n const tablesImport = tablesModule.import(this)\n const workflowsImport = workflowsModule\n\n return [\n consts.GENERATED_HEADER,\n `import * as ${integrationsModule.name} from './${integrationsImport}'`,\n `import * as ${interfacesModule.name} from './${interfacesImport}'`,\n `import * as ${defaultConfigModule.name} from './${defaultConfigImport}'`,\n `import * as ${eventsModule.name} from './${eventsModule.name}'`,\n `import * as ${statesModule.name} from './${statesModule.name}'`,\n `import * as ${actionsModule.name} from './${actionsImport.name}'`,\n `import * as ${tablesModule.name} from './${tablesImport}'`,\n `import * as ${workflowsModule.name} from './${workflowsImport.name}'`,\n '',\n `export * as ${integrationsModule.name} from './${integrationsImport}'`,\n `export * as ${interfacesModule.name} from './${interfacesImport}'`,\n `export * as ${defaultConfigModule.name} from './${defaultConfigImport}'`,\n `export * as ${eventsModule.name} from './${eventsImport}'`,\n `export * as ${statesModule.name} from './${statesImport}'`,\n `export * as ${actionsModule.name} from './${actionsImport.name}'`,\n `export * as ${tablesModule.name} from './${tablesImport}'`,\n `export * as ${workflowsModule.name} from './${workflowsImport.name}'`,\n '',\n 'export type TPlugin = {',\n ` name: \"${this._plugin.name}\"`,\n ` version: \"${this._plugin.version}\"`,\n ` integrations: ${integrationsModule.name}.${integrationsModule.exportName}`,\n ` interfaces: ${interfacesModule.name}.${interfacesModule.exportName}`,\n ` configuration: ${defaultConfigModule.name}.${defaultConfigModule.exportName}`,\n ` events: ${eventsModule.name}.${eventsModule.exportName}`,\n ` states: ${statesModule.name}.${statesModule.exportName}`,\n ` actions: ${actionsModule.name}.${actionsModule.exportName}`,\n ` tables: ${tablesModule.name}.${tablesModule.exportName}`,\n ` workflows: ${workflowsModule.name}.${workflowsModule.exportName}`,\n '}',\n ].join('\\n')\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,aAAwB;AACxB,iCAAyC;AACzC,sCAAuC;AACvC,oBAA6D;AAC7D,cAAyB;AACzB,4BAA8B;AAC9B,kCAA2C;AAC3C,2BAA6B;AAC7B,2BAA6B;AAC7B,2BAA6B;AAC7B,8BAAgC;AAEhC,MAAM,iCAAiC,iCAAmB;AAAA,EACjD,YAAY,QAA8B;AAC/C,UAAM;AAAA,MACJ,YAAY;AAAA,IACd,CAAC;AAED,eAAW,CAAC,OAAO,WAAW,KAAK,OAAO,QAAQ,OAAO,gBAAgB,CAAC,CAAC,GAAG;AAC5E,YAAM,oBAAoB,IAAI,oDAAyB,YAAY,UAAU;AAC7E,wBAAkB,QAAQ,QAAQ,QAAQ,KAAK,CAAC;AAChD,WAAK,QAAQ,iBAAiB;AAAA,IAChC;AAAA,EACF;AACF;AAEA,MAAM,+BAA+B,iCAAmB;AAAA,EAC/C,YAAY,QAA8B;AAC/C,UAAM;AAAA,MACJ,YAAY;AAAA,IACd,CAAC;AAED,eAAW,CAAC,OAAO,QAAQ,KAAK,OAAO,QAAQ,OAAO,cAAc,CAAC,CAAC,GAAG;AACvE,YAAM,kBAAkB,IAAI,uDAAuB,SAAS,UAAU;AACtE,sBAAgB,QAAQ,QAAQ,QAAQ,KAAK,CAAC;AAC9C,WAAK,QAAQ,eAAe;AAAA,IAC9B;AAAA,EACF;AACF;
|
|
4
|
+
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport * as utils from '../../../utils'\nimport * as consts from '../../consts'\nimport { IntegrationTypingsModule } from '../../integration-implementation/integration-typings'\nimport { InterfaceTypingsModule } from '../../interface-implementation'\nimport { Module, ReExportTypeModule, SingleFileModule } from '../../module'\nimport * as strings from '../../strings'\nimport { ActionsModule } from './actions-module'\nimport { DefaultConfigurationModule } from './configuration-module'\nimport { ConversationModule } from './conversation-module'\nimport { EventsModule } from './events-module'\nimport { MessageModule } from './message-module'\nimport { StatesModule } from './states-module'\nimport { TablesModule } from './tables-module'\nimport { UserModule } from './user-module'\nimport { WorkflowsModule } from './workflows-module'\n\nclass PluginIntegrationsModule extends ReExportTypeModule {\n public constructor(plugin: sdk.PluginDefinition) {\n super({\n exportName: 'Integrations',\n })\n\n for (const [alias, integration] of Object.entries(plugin.integrations ?? {})) {\n const integrationModule = new IntegrationTypingsModule(integration.definition)\n integrationModule.unshift(strings.dirName(alias))\n this.pushDep(integrationModule)\n }\n }\n}\n\nclass PluginInterfacesModule extends ReExportTypeModule {\n public constructor(plugin: sdk.PluginDefinition) {\n super({\n exportName: 'Interfaces',\n })\n\n for (const [alias, intrface] of Object.entries(plugin.interfaces ?? {})) {\n const interfaceModule = new InterfaceTypingsModule(intrface.definition)\n interfaceModule.unshift(strings.dirName(alias))\n this.pushDep(interfaceModule)\n }\n }\n}\n\ntype PluginTypingsIndexDependencies = {\n integrationsModule: PluginIntegrationsModule\n interfacesModule: PluginInterfacesModule\n defaultConfigModule: DefaultConfigurationModule\n eventsModule: EventsModule\n statesModule: StatesModule\n actionsModule: ActionsModule\n tablesModule: TablesModule\n workflowsModule: WorkflowsModule\n conversationModule: ConversationModule\n messageModule: MessageModule\n userModule: UserModule\n}\n\ntype _assertPropsInPluginDefinition = utils.types.AssertKeyOf<'props', sdk.PluginDefinition>\nconst _isLocalPluginDefinition = (\n plugin: sdk.PluginDefinition | sdk.PluginPackage['definition']\n): plugin is sdk.PluginDefinition => {\n return 'props' in plugin\n}\n\nexport class PluginTypingsModule extends Module {\n private _dependencies: PluginTypingsIndexDependencies\n\n public constructor(private _plugin: sdk.PluginDefinition | sdk.PluginPackage['definition']) {\n super({\n exportName: 'TPlugin',\n path: consts.INDEX_FILE,\n })\n\n const integrationsModule = _isLocalPluginDefinition(_plugin)\n ? new PluginIntegrationsModule(_plugin)\n : new SingleFileModule({\n path: consts.INDEX_FILE,\n exportName: 'Integrations',\n content: 'export type Integrations = {}',\n })\n integrationsModule.unshift('integrations')\n this.pushDep(integrationsModule)\n\n const interfacesModule = _isLocalPluginDefinition(_plugin)\n ? new PluginInterfacesModule(_plugin)\n : new SingleFileModule({\n path: consts.INDEX_FILE,\n exportName: 'Interfaces',\n content: 'export type Interfaces = {}',\n })\n interfacesModule.unshift('interfaces')\n this.pushDep(interfacesModule)\n\n const defaultConfigModule = new DefaultConfigurationModule(_plugin.configuration)\n defaultConfigModule.unshift('configuration')\n this.pushDep(defaultConfigModule)\n\n const eventsModule = new EventsModule(_plugin.events ?? {})\n eventsModule.unshift('events')\n this.pushDep(eventsModule)\n\n const statesModule = new StatesModule(_plugin.states ?? {})\n statesModule.unshift('states')\n this.pushDep(statesModule)\n\n const actionsModule = new ActionsModule(_plugin.actions ?? {})\n actionsModule.unshift('actions')\n this.pushDep(actionsModule)\n\n const tablesModule = new TablesModule(_plugin.tables ?? {})\n tablesModule.unshift('tables')\n this.pushDep(tablesModule)\n\n const workflowsModule = new WorkflowsModule(_plugin.workflows ?? {})\n workflowsModule.unshift('workflows')\n this.pushDep(workflowsModule)\n\n const conversationModule = new ConversationModule(_plugin.conversation)\n conversationModule.unshift('conversation')\n this.pushDep(conversationModule)\n\n const messageModule = new MessageModule(_plugin.message)\n messageModule.unshift('message')\n this.pushDep(messageModule)\n\n const userModule = new UserModule(_plugin.user)\n userModule.unshift('user')\n this.pushDep(userModule)\n\n this._dependencies = {\n integrationsModule,\n interfacesModule,\n defaultConfigModule,\n eventsModule,\n statesModule,\n actionsModule,\n tablesModule,\n workflowsModule,\n conversationModule,\n messageModule,\n userModule,\n }\n }\n\n public async getContent() {\n const {\n integrationsModule,\n interfacesModule,\n defaultConfigModule,\n eventsModule,\n statesModule,\n actionsModule,\n tablesModule,\n workflowsModule,\n conversationModule,\n messageModule,\n userModule,\n } = this._dependencies\n\n const integrationsImport = integrationsModule.import(this)\n const interfacesImport = interfacesModule.import(this)\n const defaultConfigImport = defaultConfigModule.import(this)\n const eventsImport = eventsModule.import(this)\n const statesImport = statesModule.import(this)\n const actionsImport = actionsModule\n const tablesImport = tablesModule.import(this)\n const workflowsImport = workflowsModule\n const conversationImport = conversationModule.import(this)\n const messageImport = messageModule.import(this)\n const userImport = userModule.import(this)\n\n return [\n consts.GENERATED_HEADER,\n `import * as ${integrationsModule.name} from './${integrationsImport}'`,\n `import * as ${interfacesModule.name} from './${interfacesImport}'`,\n `import * as ${defaultConfigModule.name} from './${defaultConfigImport}'`,\n `import * as ${eventsModule.name} from './${eventsModule.name}'`,\n `import * as ${statesModule.name} from './${statesModule.name}'`,\n `import * as ${actionsModule.name} from './${actionsImport.name}'`,\n `import * as ${tablesModule.name} from './${tablesImport}'`,\n `import * as ${workflowsModule.name} from './${workflowsImport.name}'`,\n `import * as ${conversationModule.name} from './${conversationImport}'`,\n `import * as ${messageModule.name} from './${messageImport}'`,\n `import * as ${userModule.name} from './${userImport}'`,\n '',\n `export * as ${integrationsModule.name} from './${integrationsImport}'`,\n `export * as ${interfacesModule.name} from './${interfacesImport}'`,\n `export * as ${defaultConfigModule.name} from './${defaultConfigImport}'`,\n `export * as ${eventsModule.name} from './${eventsImport}'`,\n `export * as ${statesModule.name} from './${statesImport}'`,\n `export * as ${actionsModule.name} from './${actionsImport.name}'`,\n `export * as ${tablesModule.name} from './${tablesImport}'`,\n `export * as ${workflowsModule.name} from './${workflowsImport.name}'`,\n `export * as ${conversationModule.name} from './${conversationImport}'`,\n `export * as ${messageModule.name} from './${messageImport}'`,\n `export * as ${userModule.name} from './${userImport}'`,\n '',\n 'export type TPlugin = {',\n ` name: \"${this._plugin.name}\"`,\n ` version: \"${this._plugin.version}\"`,\n ` integrations: ${integrationsModule.name}.${integrationsModule.exportName}`,\n ` interfaces: ${interfacesModule.name}.${interfacesModule.exportName}`,\n ` configuration: ${defaultConfigModule.name}.${defaultConfigModule.exportName}`,\n ` events: ${eventsModule.name}.${eventsModule.exportName}`,\n ` states: ${statesModule.name}.${statesModule.exportName}`,\n ` actions: ${actionsModule.name}.${actionsModule.exportName}`,\n ` tables: ${tablesModule.name}.${tablesModule.exportName}`,\n ` workflows: ${workflowsModule.name}.${workflowsModule.exportName}`,\n ` conversation: ${conversationModule.name}.${conversationModule.exportName}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AA,MACzD,gBAAgB,gBAAgB,IAAI,IAAI,gBAAgB,UAAU;AAAA,MAClE,mBAAmB,mBAAmB,IAAI,IAAI,mBAAmB,UAAU;AAAA,MAC3E,cAAc,cAAc,IAAI,IAAI,cAAc,UAAU;AAAA,MAC5D,WAAW,WAAW,IAAI,IAAI,WAAW,UAAU;AAAA,MACnD;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
// 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.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var message_module_exports = {};
|
|
30
|
+
__export(message_module_exports, {
|
|
31
|
+
MessageModule: () => MessageModule
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(message_module_exports);
|
|
34
|
+
var import_consts = require("../../consts");
|
|
35
|
+
var consts = __toESM(require("../../consts"));
|
|
36
|
+
var import_generators = require("../../generators");
|
|
37
|
+
var import_module = require("../../module");
|
|
38
|
+
var strings = __toESM(require("../../strings"));
|
|
39
|
+
class MessageModule extends import_module.Module {
|
|
40
|
+
constructor(_message) {
|
|
41
|
+
const name = "message";
|
|
42
|
+
const exportName = strings.typeName(name);
|
|
43
|
+
super({
|
|
44
|
+
path: import_consts.INDEX_FILE,
|
|
45
|
+
exportName
|
|
46
|
+
});
|
|
47
|
+
this._message = _message;
|
|
48
|
+
}
|
|
49
|
+
async getContent() {
|
|
50
|
+
const message = { tags: this._message?.tags ?? {} };
|
|
51
|
+
return [
|
|
52
|
+
consts.GENERATED_HEADER,
|
|
53
|
+
`export type ${this.exportName} = {`,
|
|
54
|
+
` tags: ${(0, import_generators.stringifySingleLine)(message.tags)}`,
|
|
55
|
+
"}"
|
|
56
|
+
].join("\n");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
MessageModule
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=message-module.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/code-generation/plugin-implementation/plugin-typings/message-module.ts"],
|
|
4
|
+
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { INDEX_FILE } from '../../consts'\nimport * as consts from '../../consts'\nimport { stringifySingleLine } from '../../generators'\nimport { Module } from '../../module'\nimport * as strings from '../../strings'\n\nexport class MessageModule extends Module {\n public constructor(private _message: sdk.PluginDefinition['message']) {\n const name = 'message'\n const exportName = strings.typeName(name)\n super({\n path: INDEX_FILE,\n exportName,\n })\n }\n\n public async getContent() {\n const message = { tags: this._message?.tags ?? {} }\n\n return [\n consts.GENERATED_HEADER,\n `export type ${this.exportName} = {`,\n ` tags: ${stringifySingleLine(message.tags)}`,\n '}',\n ].join('\\n')\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAC3B,aAAwB;AACxB,wBAAoC;AACpC,oBAAuB;AACvB,cAAyB;AAElB,MAAM,sBAAsB,qBAAO;AAAA,EACjC,YAAoB,UAA2C;AACpE,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,UAAM,UAAU,EAAE,MAAM,KAAK,UAAU,QAAQ,CAAC,EAAE;AAElD,WAAO;AAAA,MACL,OAAO;AAAA,MACP,eAAe,KAAK,UAAU;AAAA,MAC9B,eAAW,uCAAoB,QAAQ,IAAI,CAAC;AAAA,MAC5C;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
// 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.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var user_module_exports = {};
|
|
30
|
+
__export(user_module_exports, {
|
|
31
|
+
UserModule: () => UserModule
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(user_module_exports);
|
|
34
|
+
var import_consts = require("../../consts");
|
|
35
|
+
var consts = __toESM(require("../../consts"));
|
|
36
|
+
var import_generators = require("../../generators");
|
|
37
|
+
var import_module = require("../../module");
|
|
38
|
+
var strings = __toESM(require("../../strings"));
|
|
39
|
+
class UserModule extends import_module.Module {
|
|
40
|
+
constructor(_user) {
|
|
41
|
+
const name = "user";
|
|
42
|
+
const exportName = strings.typeName(name);
|
|
43
|
+
super({
|
|
44
|
+
path: import_consts.INDEX_FILE,
|
|
45
|
+
exportName
|
|
46
|
+
});
|
|
47
|
+
this._user = _user;
|
|
48
|
+
}
|
|
49
|
+
async getContent() {
|
|
50
|
+
const user = { tags: this._user?.tags ?? {} };
|
|
51
|
+
return [
|
|
52
|
+
consts.GENERATED_HEADER,
|
|
53
|
+
`export type ${this.exportName} = {`,
|
|
54
|
+
` tags: ${(0, import_generators.stringifySingleLine)(user.tags)}`,
|
|
55
|
+
"}"
|
|
56
|
+
].join("\n");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
UserModule
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=user-module.js.map
|