@botpress/cli 7.0.1 → 7.1.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 +14 -14
- package/dist/code-generation/integration-implementation/integration-implementation.js +7 -3
- package/dist/code-generation/integration-implementation/integration-implementation.js.map +2 -2
- package/dist/code-generation/strings.d.ts +1 -1
- package/dist/command-definitions.d.ts +426 -426
- package/dist/command-implementations/index.d.ts +470 -470
- package/dist/config.d.ts +295 -295
- package/dist/index.d.ts +460 -460
- package/dist/linter/ruleset-tests/common.d.ts +1 -1
- package/dist/project-templates.d.ts +15 -15
- package/dist/tables/schemas.d.ts +18 -18
- package/dist/utils/case-utils.d.ts +6 -6
- package/dist/utils/path-utils.d.ts +1 -1
- package/dist/utils/prompt-utils.js +7 -1
- package/dist/utils/prompt-utils.js.map +2 -2
- package/dist/utils/type-utils.d.ts +1 -1
- package/dist/utils/url-utils.d.ts +1 -1
- package/package.json +6 -6
- package/templates/empty-bot/package.json +3 -3
- package/templates/empty-bot/tsconfig.json +3 -2
- package/templates/empty-integration/package.json +3 -3
- package/templates/empty-integration/tsconfig.json +3 -2
- package/templates/empty-plugin/package.json +2 -2
- package/templates/empty-plugin/tsconfig.json +3 -2
- package/templates/hello-world/package.json +3 -3
- package/templates/hello-world/tsconfig.json +3 -2
- package/templates/webhook-message/package.json +3 -3
- package/templates/webhook-message/tsconfig.json +3 -2
- package/tsconfig.build.json +1 -1
- package/tsconfig.ts-node.json +6 -0
- package/eslint.config.mjs +0 -14
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@7.0
|
|
2
|
+
> @botpress/cli@7.1.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@7.0
|
|
6
|
+
> @botpress/cli@7.1.0 build:types /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> tsc -p ./tsconfig.build.json
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@7.0
|
|
11
|
-
> ts-node -T build.ts
|
|
10
|
+
> @botpress/cli@7.1.0 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
11
|
+
> ts-node -T -P tsconfig.ts-node.json build.ts
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
> @botpress/cli@7.0
|
|
14
|
+
> @botpress/cli@7.1.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 v7.0
|
|
18
|
-
🤖 Botpress CLI v7.0.1
|
|
17
|
+
🤖 Botpress CLI v7.1.0
|
|
19
18
|
● Checking if cli is up to date
|
|
19
|
+
🤖 Botpress CLI v7.1.0
|
|
20
20
|
● Checking if cli is up to date
|
|
21
|
-
🤖 Botpress CLI v7.0
|
|
22
|
-
🤖 Botpress CLI v7.0.1
|
|
21
|
+
🤖 Botpress CLI v7.1.0
|
|
23
22
|
● Checking if cli is up to date
|
|
23
|
+
🤖 Botpress CLI v7.1.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 integration
|
|
29
|
+
○ Generating typings for integration hello-world...
|
|
30
30
|
○ Generating typings for bot...
|
|
31
|
-
○ Generating typings for plugin empty-plugin...
|
|
32
|
-
✓ Typings available at .botpress
|
|
33
31
|
✓ Typings available at .botpress
|
|
34
32
|
|
|
33
|
+
○ Generating typings for plugin empty-plugin...
|
|
34
|
+
○ Generating typings for integration empty-integration...
|
|
35
|
+
✓ Typings available at .botpress
|
|
35
36
|
|
|
36
37
|
✓ Typings available at .botpress
|
|
37
38
|
|
|
38
|
-
○ Generating typings for integration hello-world...
|
|
39
39
|
✓ Typings available at .botpress
|
|
40
40
|
|
|
41
|
-
🤖 Botpress CLI v7.0
|
|
41
|
+
🤖 Botpress CLI v7.1.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...
|
|
@@ -84,11 +84,15 @@ class IntegrationImplementationModule extends import_module.Module {
|
|
|
84
84
|
"}",
|
|
85
85
|
"export type AnyActionProps = ValueOf<ActionProps>",
|
|
86
86
|
"",
|
|
87
|
+
// `messages` and `messageCreated` share the same underlying type on a channel (see ExactlyOneProperty in the
|
|
88
|
+
// SDK), so this resolves correctly regardless of which one the integration actually defines
|
|
89
|
+
"type ChannelMessages<TChannel extends keyof IntegrationProps['channels']> = NonNullable<",
|
|
90
|
+
" IntegrationProps['channels'][TChannel]['messageCreated']",
|
|
91
|
+
">",
|
|
92
|
+
"",
|
|
87
93
|
"export type MessageProps = {",
|
|
88
94
|
" [TChannel in keyof IntegrationProps['channels']]: {",
|
|
89
|
-
" [TMessage in keyof
|
|
90
|
-
" IntegrationProps['channels'][TChannel]['messages'][TMessage]",
|
|
91
|
-
" >[0]",
|
|
95
|
+
" [TMessage in keyof ChannelMessages<TChannel>]: Parameters<ChannelMessages<TChannel>[TMessage]>[0]",
|
|
92
96
|
" }",
|
|
93
97
|
"}",
|
|
94
98
|
"export type AnyMessageProps = ValueOf<ValueOf<MessageProps>>",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/code-generation/integration-implementation/integration-implementation.ts"],
|
|
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 Context = HandlerProps['ctx']\",\n \"export type Logger = HandlerProps['logger']\",\n '',\n 'export type CommonHandlerProps = {',\n ' ctx: Context',\n ' client: Client',\n ' logger: Logger',\n '}',\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
|
|
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,IAAI,YAAY,aAAa;AAAA,MAChE,oBAAoB,aAAa;AAAA,MACjC;AAAA,MACA,8CAA8C,KAAK,eAAe,IAAI,IAAI,KAAK,eAAe,UAAU;AAAA,MACxG;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;AAEX,WAAO;AAAA,EACT;AACF;",
|
|
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 Context = HandlerProps['ctx']\",\n \"export type Logger = HandlerProps['logger']\",\n '',\n 'export type CommonHandlerProps = {',\n ' ctx: Context',\n ' client: Client',\n ' logger: Logger',\n '}',\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 // `messages` and `messageCreated` share the same underlying type on a channel (see ExactlyOneProperty in the\n // SDK), so this resolves correctly regardless of which one the integration actually defines\n \"type ChannelMessages<TChannel extends keyof IntegrationProps['channels']> = NonNullable<\",\n \" IntegrationProps['channels'][TChannel]['messageCreated']\",\n '>',\n '',\n 'export type MessageProps = {',\n \" [TChannel in keyof IntegrationProps['channels']]: {\",\n ' [TMessage in keyof ChannelMessages<TChannel>]: Parameters<ChannelMessages<TChannel>[TMessage]>[0]',\n ' }',\n '}',\n 'export type AnyMessageProps = ValueOf<ValueOf<MessageProps>>',\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAI,YAAY,aAAa;AAAA,MAChE,oBAAoB,aAAa;AAAA,MACjC;AAAA,MACA,8CAA8C,KAAK,eAAe,IAAI,IAAI,KAAK,eAAe,UAAU;AAAA,MACxG;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;AAAA;AAAA,MAGA;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
|
}
|
|
@@ -2,4 +2,4 @@ export declare const typeName: (name: string) => string;
|
|
|
2
2
|
export declare const importAlias: (name: string) => string;
|
|
3
3
|
export declare const varName: (name: string) => string;
|
|
4
4
|
export declare const fileName: (name: string) => string;
|
|
5
|
-
export declare const dirName:
|
|
5
|
+
export declare const dirName: typeof fileName;
|