@botpress/cli 0.8.65 → 0.8.66

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.
@@ -1,20 +1,20 @@
1
1
 
2
- > @botpress/cli@0.8.65 build /home/runner/work/botpress/botpress/packages/cli
2
+ > @botpress/cli@0.8.66 build /home/runner/work/botpress/botpress/packages/cli
3
3
  > pnpm run bundle && pnpm run template:gen
4
4
 
5
5
 
6
- > @botpress/cli@0.8.65 bundle /home/runner/work/botpress/botpress/packages/cli
6
+ > @botpress/cli@0.8.66 bundle /home/runner/work/botpress/botpress/packages/cli
7
7
  > ts-node -T build.ts
8
8
 
9
9
 
10
- > @botpress/cli@0.8.65 template:gen /home/runner/work/botpress/botpress/packages/cli
10
+ > @botpress/cli@0.8.66 template:gen /home/runner/work/botpress/botpress/packages/cli
11
11
  > pnpm -r --stream -F @bp-templates/* exec bp gen
12
12
 
13
- šŸ¤– Botpress CLI v0.8.65
14
- šŸ¤– Botpress CLI v0.8.65
15
- šŸ¤– Botpress CLI v0.8.65
16
- šŸ¤– Botpress CLI v0.8.65
13
+ šŸ¤– Botpress CLI v0.8.66
14
+ šŸ¤– Botpress CLI v0.8.66
15
+ šŸ¤– Botpress CLI v0.8.66
16
+ šŸ¤– Botpress CLI v0.8.66
17
17
  ⚠ No typings to generate for bot projects
18
- ā—‹ Generating typings for integration webhook-message...ā—‹ Generating typings for integration empty-integration...ā—‹ Generating typings for integration hello-world...āœ“ Typings available at .botpress
18
+ ā—‹ Generating typings for integration empty-integration...ā—‹ Generating typings for integration hello-world...ā—‹ Generating typings for integration webhook-message...āœ“ Typings available at .botpress
19
19
  āœ“ Typings available at .botpress
20
20
  āœ“ Typings available at .botpress
@@ -106,16 +106,6 @@ class IntegrationImplementationIndexModule extends import_module.Module {
106
106
  "type Cast<X, Y> = X extends Y ? X : Y",
107
107
  "type ValueOf<T> = T[keyof T]",
108
108
  "type AsyncFunction = (...args: any[]) => Promise<any>",
109
- "type SimplifyObject<T extends object> = T extends infer O ? { [K in keyof O]: Simplify<O[K]> } : never",
110
- "type Simplify<T> = T extends (...args: infer A) => infer R",
111
- " ? (...args: Simplify<A>) => Simplify<R>",
112
- " : T extends Buffer",
113
- " ? Buffer",
114
- " : T extends Promise<infer R>",
115
- " ? Promise<Simplify<R>>",
116
- " : T extends object",
117
- " ? SimplifyObject<T>",
118
- " : T",
119
109
  "",
120
110
  "type TIntegration = {",
121
111
  ` name: "${integration.name}"`,
@@ -137,20 +127,20 @@ class IntegrationImplementationIndexModule extends import_module.Module {
137
127
  "",
138
128
  "// extra types",
139
129
  "",
140
- "export type HandlerProps = Simplify<Parameters<IntegrationProps['handler']>[0]>",
130
+ "export type HandlerProps = Parameters<IntegrationProps['handler']>[0]",
141
131
  "",
142
- "export type ActionProps = Simplify<{",
132
+ "export type ActionProps = {",
143
133
  " [K in keyof IntegrationProps['actions']]: Parameters<IntegrationProps['actions'][K]>[0]",
144
- "}>",
134
+ "}",
145
135
  "export type AnyActionProps = ValueOf<ActionProps>",
146
136
  "",
147
- "export type MessageProps = Simplify<{",
137
+ "export type MessageProps = {",
148
138
  " [TChannel in keyof IntegrationProps['channels']]: {",
149
139
  " [TMessage in keyof IntegrationProps['channels'][TChannel]['messages']]: Parameters<",
150
140
  " IntegrationProps['channels'][TChannel]['messages'][TMessage]",
151
141
  " >[0]",
152
142
  " }",
153
- "}>",
143
+ "}",
154
144
  "export type AnyMessageProps = ValueOf<ValueOf<MessageProps>>",
155
145
  "",
156
146
  "export type Context = HandlerProps['ctx']",
@@ -163,15 +153,15 @@ class IntegrationImplementationIndexModule extends import_module.Module {
163
153
  "}",
164
154
  "export type AnyAckFunction = ValueOf<ValueOf<AckFunctions>>",
165
155
  "",
166
- "export type ClientOperation = Simplify<ValueOf<{",
156
+ "export type ClientOperation = ValueOf<{",
167
157
  " [K in keyof Client as Client[K] extends AsyncFunction ? K : never]: K",
168
- "}>>",
169
- "export type ClientRequests = Simplify<{",
170
- " [K in ClientOperation]: Parameters<Client[K]>[0]",
171
158
  "}>",
172
- "export type ClientResponses = Simplify<{",
159
+ "export type ClientRequests = {",
160
+ " [K in ClientOperation]: Parameters<Client[K]>[0]",
161
+ "}",
162
+ "export type ClientResponses = {",
173
163
  " [K in ClientOperation]: Awaited<ReturnType<Client[K]>>",
174
- "}>"
164
+ "}"
175
165
  ].join("\n");
176
166
  return content;
177
167
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/code-generation/integration-implementation.ts"],
4
- "sourcesContent": ["import { GENERATED_HEADER, INDEX_FILE } from './const'\nimport { stringifySingleLine } from './generators'\nimport { ActionsModule } from './integration-schemas/actions-module'\nimport { ChannelsModule } from './integration-schemas/channels-module'\nimport { ConfigurationModule } from './integration-schemas/configuration-module'\nimport { EntitiesModule } from './integration-schemas/entities-module'\nimport { EventsModule } from './integration-schemas/events-module'\nimport { StatesModule } from './integration-schemas/states-module'\nimport { Module, ModuleDef } from './module'\nimport * as types from './typings'\n\nexport class IntegrationImplementationIndexModule extends Module {\n public static async create(integration: types.IntegrationDefinition): Promise<IntegrationImplementationIndexModule> {\n const configModule = await ConfigurationModule.create(integration.configuration ?? { schema: {} })\n configModule.unshift('configuration')\n\n const actionsModule = await ActionsModule.create(integration.actions ?? {})\n actionsModule.unshift('actions')\n\n const channelsModule = await ChannelsModule.create(integration.channels ?? {})\n channelsModule.unshift('channels')\n\n const eventsModule = await EventsModule.create(integration.events ?? {})\n eventsModule.unshift('events')\n\n const statesModule = await StatesModule.create(integration.states ?? {})\n statesModule.unshift('states')\n\n const entitiesModule = await EntitiesModule.create(integration.entities ?? {})\n entitiesModule.unshift('entities')\n\n const inst = new IntegrationImplementationIndexModule(\n integration,\n configModule,\n actionsModule,\n channelsModule,\n eventsModule,\n statesModule,\n entitiesModule,\n {\n path: INDEX_FILE,\n exportName: 'Integration',\n content: '',\n }\n )\n\n inst.pushDep(configModule)\n inst.pushDep(actionsModule)\n inst.pushDep(channelsModule)\n inst.pushDep(eventsModule)\n inst.pushDep(statesModule)\n inst.pushDep(entitiesModule)\n return inst\n }\n\n private constructor(\n private integration: types.IntegrationDefinition,\n private configModule: ConfigurationModule,\n private actionsModule: ActionsModule,\n private channelsModule: ChannelsModule,\n private eventsModule: EventsModule,\n private statesModule: StatesModule,\n private entitiesModule: EntitiesModule,\n def: ModuleDef\n ) {\n super(def)\n }\n\n public override get content(): string {\n let content = GENERATED_HEADER\n\n const { configModule, actionsModule, channelsModule, eventsModule, statesModule, entitiesModule, integration } =\n this\n\n const configImport = configModule.import(this)\n const actionsImport = actionsModule.import(this)\n const channelsImport = channelsModule.import(this)\n const eventsImport = eventsModule.import(this)\n const statesImport = statesModule.import(this)\n const entitiesImport = entitiesModule.import(this)\n\n content += [\n GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n '',\n `import type * as ${configModule.name} from \"./${configImport}\"`,\n `import type * as ${actionsModule.name} from \"./${actionsImport}\"`,\n `import type * as ${channelsModule.name} from \"./${channelsImport}\"`,\n `import type * as ${eventsModule.name} from \"./${eventsImport}\"`,\n `import type * as ${statesModule.name} from \"./${statesImport}\"`,\n `import type * as ${entitiesModule.name} from \"./${entitiesImport}\"`,\n `export * as ${configModule.name} from \"./${configImport}\"`,\n `export * as ${actionsModule.name} from \"./${actionsImport}\"`,\n `export * as ${channelsModule.name} from \"./${channelsImport}\"`,\n `export * as ${eventsModule.name} from \"./${eventsImport}\"`,\n `export * as ${statesModule.name} from \"./${statesImport}\"`,\n `export * as ${entitiesModule.name} from \"./${entitiesImport}\"`,\n '',\n '// type utils',\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 'type SimplifyObject<T extends object> = T extends infer O ? { [K in keyof O]: Simplify<O[K]> } : never',\n 'type Simplify<T> = T extends (...args: infer A) => infer R',\n ' ? (...args: Simplify<A>) => Simplify<R>',\n ' : T extends Buffer',\n ' ? Buffer',\n ' : T extends Promise<infer R>',\n ' ? Promise<Simplify<R>>',\n ' : T extends object',\n ' ? SimplifyObject<T>',\n ' : T',\n '',\n 'type TIntegration = {',\n ` name: \"${integration.name}\"`,\n ` version: \"${integration.version}\"`,\n ` configuration: ${configModule.name}.${configModule.exports}`,\n ` actions: ${actionsModule.name}.${actionsModule.exports}`,\n ` channels: ${channelsModule.name}.${channelsModule.exports}`,\n ` events: ${eventsModule.name}.${eventsModule.exports}`,\n ` states: ${statesModule.name}.${statesModule.exports}`,\n ` user: ${stringifySingleLine(integration.user)}`,\n ` entities: ${entitiesModule.name}.${entitiesModule.exports}`,\n '}',\n '',\n 'export type IntegrationProps = sdk.IntegrationProps<TIntegration>',\n '',\n 'export class Integration extends sdk.Integration<TIntegration> {}',\n '',\n 'export type Client = sdk.IntegrationSpecificClient<TIntegration>',\n '',\n '// extra types',\n '',\n \"export type HandlerProps = Simplify<Parameters<IntegrationProps['handler']>[0]>\",\n '',\n 'export type ActionProps = Simplify<{',\n \" [K in keyof IntegrationProps['actions']]: Parameters<IntegrationProps['actions'][K]>[0]\",\n '}>',\n 'export type AnyActionProps = ValueOf<ActionProps>',\n '',\n 'export type MessageProps = Simplify<{',\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 = Simplify<ValueOf<{',\n ' [K in keyof Client as Client[K] extends AsyncFunction ? K : never]: K',\n '}>>',\n 'export type ClientRequests = Simplify<{',\n ' [K in ClientOperation]: Parameters<Client[K]>[0]',\n '}>',\n 'export type ClientResponses = Simplify<{',\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;AAAA,mBAA6C;AAC7C,wBAAoC;AACpC,4BAA8B;AAC9B,6BAA+B;AAC/B,kCAAoC;AACpC,6BAA+B;AAC/B,2BAA6B;AAC7B,2BAA6B;AAC7B,oBAAkC;AAG3B,MAAM,6CAA6C,qBAAO;AAAA,EA4CvD,YACE,aACA,cACA,eACA,gBACA,cACA,cACA,gBACR,KACA;AACA,UAAM,GAAG;AATD;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,EAIV;AAAA,EAtDA,aAAoB,OAAO,aAAyF;AAClH,UAAM,eAAe,MAAM,gDAAoB,OAAO,YAAY,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC;AACjG,iBAAa,QAAQ,eAAe;AAEpC,UAAM,gBAAgB,MAAM,oCAAc,OAAO,YAAY,WAAW,CAAC,CAAC;AAC1E,kBAAc,QAAQ,SAAS;AAE/B,UAAM,iBAAiB,MAAM,sCAAe,OAAO,YAAY,YAAY,CAAC,CAAC;AAC7E,mBAAe,QAAQ,UAAU;AAEjC,UAAM,eAAe,MAAM,kCAAa,OAAO,YAAY,UAAU,CAAC,CAAC;AACvE,iBAAa,QAAQ,QAAQ;AAE7B,UAAM,eAAe,MAAM,kCAAa,OAAO,YAAY,UAAU,CAAC,CAAC;AACvE,iBAAa,QAAQ,QAAQ;AAE7B,UAAM,iBAAiB,MAAM,sCAAe,OAAO,YAAY,YAAY,CAAC,CAAC;AAC7E,mBAAe,QAAQ,UAAU;AAEjC,UAAM,OAAO,IAAI;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AA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ACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,YAAY;AAAA,MACxB,eAAe,YAAY;AAAA,MAC3B,oBAAoB,aAAa,QAAQ,aAAa;AAAA,MACtD,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,eAAW,uCAAoB,YAAY,IAAI;AAAA,MAC/C,eAAe,eAAe,QAAQ,eAAe;AAAA,MACrD;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 { GENERATED_HEADER, INDEX_FILE } from './const'\nimport { stringifySingleLine } from './generators'\nimport { ActionsModule } from './integration-schemas/actions-module'\nimport { ChannelsModule } from './integration-schemas/channels-module'\nimport { ConfigurationModule } from './integration-schemas/configuration-module'\nimport { EntitiesModule } from './integration-schemas/entities-module'\nimport { EventsModule } from './integration-schemas/events-module'\nimport { StatesModule } from './integration-schemas/states-module'\nimport { Module, ModuleDef } from './module'\nimport * as types from './typings'\n\nexport class IntegrationImplementationIndexModule extends Module {\n public static async create(integration: types.IntegrationDefinition): Promise<IntegrationImplementationIndexModule> {\n const configModule = await ConfigurationModule.create(integration.configuration ?? { schema: {} })\n configModule.unshift('configuration')\n\n const actionsModule = await ActionsModule.create(integration.actions ?? {})\n actionsModule.unshift('actions')\n\n const channelsModule = await ChannelsModule.create(integration.channels ?? {})\n channelsModule.unshift('channels')\n\n const eventsModule = await EventsModule.create(integration.events ?? {})\n eventsModule.unshift('events')\n\n const statesModule = await StatesModule.create(integration.states ?? {})\n statesModule.unshift('states')\n\n const entitiesModule = await EntitiesModule.create(integration.entities ?? {})\n entitiesModule.unshift('entities')\n\n const inst = new IntegrationImplementationIndexModule(\n integration,\n configModule,\n actionsModule,\n channelsModule,\n eventsModule,\n statesModule,\n entitiesModule,\n {\n path: INDEX_FILE,\n exportName: 'Integration',\n content: '',\n }\n )\n\n inst.pushDep(configModule)\n inst.pushDep(actionsModule)\n inst.pushDep(channelsModule)\n inst.pushDep(eventsModule)\n inst.pushDep(statesModule)\n inst.pushDep(entitiesModule)\n return inst\n }\n\n private constructor(\n private integration: types.IntegrationDefinition,\n private configModule: ConfigurationModule,\n private actionsModule: ActionsModule,\n private channelsModule: ChannelsModule,\n private eventsModule: EventsModule,\n private statesModule: StatesModule,\n private entitiesModule: EntitiesModule,\n def: ModuleDef\n ) {\n super(def)\n }\n\n public override get content(): string {\n let content = GENERATED_HEADER\n\n const { configModule, actionsModule, channelsModule, eventsModule, statesModule, entitiesModule, integration } =\n this\n\n const configImport = configModule.import(this)\n const actionsImport = actionsModule.import(this)\n const channelsImport = channelsModule.import(this)\n const eventsImport = eventsModule.import(this)\n const statesImport = statesModule.import(this)\n const entitiesImport = entitiesModule.import(this)\n\n content += [\n GENERATED_HEADER,\n 'import * as sdk from \"@botpress/sdk\"',\n '',\n `import type * as ${configModule.name} from \"./${configImport}\"`,\n `import type * as ${actionsModule.name} from \"./${actionsImport}\"`,\n `import type * as ${channelsModule.name} from \"./${channelsImport}\"`,\n `import type * as ${eventsModule.name} from \"./${eventsImport}\"`,\n `import type * as ${statesModule.name} from \"./${statesImport}\"`,\n `import type * as ${entitiesModule.name} from \"./${entitiesImport}\"`,\n `export * as ${configModule.name} from \"./${configImport}\"`,\n `export * as ${actionsModule.name} from \"./${actionsImport}\"`,\n `export * as ${channelsModule.name} from \"./${channelsImport}\"`,\n `export * as ${eventsModule.name} from \"./${eventsImport}\"`,\n `export * as ${statesModule.name} from \"./${statesImport}\"`,\n `export * as ${entitiesModule.name} from \"./${entitiesImport}\"`,\n '',\n '// type utils',\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 'type TIntegration = {',\n ` name: \"${integration.name}\"`,\n ` version: \"${integration.version}\"`,\n ` configuration: ${configModule.name}.${configModule.exports}`,\n ` actions: ${actionsModule.name}.${actionsModule.exports}`,\n ` channels: ${channelsModule.name}.${channelsModule.exports}`,\n ` events: ${eventsModule.name}.${eventsModule.exports}`,\n ` states: ${statesModule.name}.${statesModule.exports}`,\n ` user: ${stringifySingleLine(integration.user)}`,\n ` entities: ${entitiesModule.name}.${entitiesModule.exports}`,\n '}',\n '',\n 'export type IntegrationProps = sdk.IntegrationProps<TIntegration>',\n '',\n 'export class Integration extends sdk.Integration<TIntegration> {}',\n '',\n 'export type Client = sdk.IntegrationSpecificClient<TIntegration>',\n '',\n '// extra types',\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": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAC7C,wBAAoC;AACpC,4BAA8B;AAC9B,6BAA+B;AAC/B,kCAAoC;AACpC,6BAA+B;AAC/B,2BAA6B;AAC7B,2BAA6B;AAC7B,oBAAkC;AAG3B,MAAM,6CAA6C,qBAAO;AAAA,EA4CvD,YACE,aACA,cACA,eACA,gBACA,cACA,cACA,gBACR,KACA;AACA,UAAM,GAAG;AATD;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,EAIV;AAAA,EAtDA,aAAoB,OAAO,aAAyF;AAClH,UAAM,eAAe,MAAM,gDAAoB,OAAO,YAAY,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC;AACjG,iBAAa,QAAQ,eAAe;AAEpC,UAAM,gBAAgB,MAAM,oCAAc,OAAO,YAAY,WAAW,CAAC,CAAC;AAC1E,kBAAc,QAAQ,SAAS;AAE/B,UAAM,iBAAiB,MAAM,sCAAe,OAAO,YAAY,YAAY,CAAC,CAAC;AAC7E,mBAAe,QAAQ,UAAU;AAEjC,UAAM,eAAe,MAAM,kCAAa,OAAO,YAAY,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C5C,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;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,YAAY;AAAA,MACxB,eAAe,YAAY;AAAA,MAC3B,oBAAoB,aAAa,QAAQ,aAAa;AAAA,MACtD,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,eAAW,uCAAoB,YAAY,IAAI;AAAA,MAC/C,eAAe,eAAe,QAAQ,eAAe;AAAA,MACrD;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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/cli",
3
- "version": "0.8.65",
3
+ "version": "0.8.66",
4
4
  "description": "Botpress CLI",
5
5
  "scripts": {
6
6
  "build": "pnpm run bundle && pnpm run template:gen",
@@ -21,7 +21,7 @@
21
21
  "main": "dist/index.js",
22
22
  "dependencies": {
23
23
  "@botpress/client": "0.29.3",
24
- "@botpress/sdk": "0.10.16",
24
+ "@botpress/sdk": "0.10.17",
25
25
  "@bpinternal/const": "^0.0.20",
26
26
  "@bpinternal/tunnel": "^0.1.1",
27
27
  "@bpinternal/yargs-extra": "^0.0.3",
@@ -6,7 +6,7 @@
6
6
  "private": true,
7
7
  "dependencies": {
8
8
  "@botpress/client": "0.29.3",
9
- "@botpress/sdk": "0.10.16"
9
+ "@botpress/sdk": "0.10.17"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/node": "^18.11.17",
@@ -24,16 +24,6 @@ export * as entities from "./entities/index"
24
24
  type Cast<X, Y> = X extends Y ? X : Y
25
25
  type ValueOf<T> = T[keyof T]
26
26
  type AsyncFunction = (...args: any[]) => Promise<any>
27
- type SimplifyObject<T extends object> = T extends infer O ? { [K in keyof O]: Simplify<O[K]> } : never
28
- type Simplify<T> = T extends (...args: infer A) => infer R
29
- ? (...args: Simplify<A>) => Simplify<R>
30
- : T extends Buffer
31
- ? Buffer
32
- : T extends Promise<infer R>
33
- ? Promise<Simplify<R>>
34
- : T extends object
35
- ? SimplifyObject<T>
36
- : T
37
27
 
38
28
  type TIntegration = {
39
29
  name: "empty-integration"
@@ -55,20 +45,20 @@ export type Client = sdk.IntegrationSpecificClient<TIntegration>
55
45
 
56
46
  // extra types
57
47
 
58
- export type HandlerProps = Simplify<Parameters<IntegrationProps['handler']>[0]>
48
+ export type HandlerProps = Parameters<IntegrationProps['handler']>[0]
59
49
 
60
- export type ActionProps = Simplify<{
50
+ export type ActionProps = {
61
51
  [K in keyof IntegrationProps['actions']]: Parameters<IntegrationProps['actions'][K]>[0]
62
- }>
52
+ }
63
53
  export type AnyActionProps = ValueOf<ActionProps>
64
54
 
65
- export type MessageProps = Simplify<{
55
+ export type MessageProps = {
66
56
  [TChannel in keyof IntegrationProps['channels']]: {
67
57
  [TMessage in keyof IntegrationProps['channels'][TChannel]['messages']]: Parameters<
68
58
  IntegrationProps['channels'][TChannel]['messages'][TMessage]
69
59
  >[0]
70
60
  }
71
- }>
61
+ }
72
62
  export type AnyMessageProps = ValueOf<ValueOf<MessageProps>>
73
63
 
74
64
  export type Context = HandlerProps['ctx']
@@ -81,12 +71,12 @@ export type AckFunctions = {
81
71
  }
82
72
  export type AnyAckFunction = ValueOf<ValueOf<AckFunctions>>
83
73
 
84
- export type ClientOperation = Simplify<ValueOf<{
74
+ export type ClientOperation = ValueOf<{
85
75
  [K in keyof Client as Client[K] extends AsyncFunction ? K : never]: K
86
- }>>
87
- export type ClientRequests = Simplify<{
88
- [K in ClientOperation]: Parameters<Client[K]>[0]
89
76
  }>
90
- export type ClientResponses = Simplify<{
77
+ export type ClientRequests = {
78
+ [K in ClientOperation]: Parameters<Client[K]>[0]
79
+ }
80
+ export type ClientResponses = {
91
81
  [K in ClientOperation]: Awaited<ReturnType<Client[K]>>
92
- }>
82
+ }
@@ -7,7 +7,7 @@
7
7
  "private": true,
8
8
  "dependencies": {
9
9
  "@botpress/client": "0.29.3",
10
- "@botpress/sdk": "0.10.16"
10
+ "@botpress/sdk": "0.10.17"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^18.11.17",
@@ -24,16 +24,6 @@ export * as entities from "./entities/index"
24
24
  type Cast<X, Y> = X extends Y ? X : Y
25
25
  type ValueOf<T> = T[keyof T]
26
26
  type AsyncFunction = (...args: any[]) => Promise<any>
27
- type SimplifyObject<T extends object> = T extends infer O ? { [K in keyof O]: Simplify<O[K]> } : never
28
- type Simplify<T> = T extends (...args: infer A) => infer R
29
- ? (...args: Simplify<A>) => Simplify<R>
30
- : T extends Buffer
31
- ? Buffer
32
- : T extends Promise<infer R>
33
- ? Promise<Simplify<R>>
34
- : T extends object
35
- ? SimplifyObject<T>
36
- : T
37
27
 
38
28
  type TIntegration = {
39
29
  name: "hello-world"
@@ -55,20 +45,20 @@ export type Client = sdk.IntegrationSpecificClient<TIntegration>
55
45
 
56
46
  // extra types
57
47
 
58
- export type HandlerProps = Simplify<Parameters<IntegrationProps['handler']>[0]>
48
+ export type HandlerProps = Parameters<IntegrationProps['handler']>[0]
59
49
 
60
- export type ActionProps = Simplify<{
50
+ export type ActionProps = {
61
51
  [K in keyof IntegrationProps['actions']]: Parameters<IntegrationProps['actions'][K]>[0]
62
- }>
52
+ }
63
53
  export type AnyActionProps = ValueOf<ActionProps>
64
54
 
65
- export type MessageProps = Simplify<{
55
+ export type MessageProps = {
66
56
  [TChannel in keyof IntegrationProps['channels']]: {
67
57
  [TMessage in keyof IntegrationProps['channels'][TChannel]['messages']]: Parameters<
68
58
  IntegrationProps['channels'][TChannel]['messages'][TMessage]
69
59
  >[0]
70
60
  }
71
- }>
61
+ }
72
62
  export type AnyMessageProps = ValueOf<ValueOf<MessageProps>>
73
63
 
74
64
  export type Context = HandlerProps['ctx']
@@ -81,12 +71,12 @@ export type AckFunctions = {
81
71
  }
82
72
  export type AnyAckFunction = ValueOf<ValueOf<AckFunctions>>
83
73
 
84
- export type ClientOperation = Simplify<ValueOf<{
74
+ export type ClientOperation = ValueOf<{
85
75
  [K in keyof Client as Client[K] extends AsyncFunction ? K : never]: K
86
- }>>
87
- export type ClientRequests = Simplify<{
88
- [K in ClientOperation]: Parameters<Client[K]>[0]
89
76
  }>
90
- export type ClientResponses = Simplify<{
77
+ export type ClientRequests = {
78
+ [K in ClientOperation]: Parameters<Client[K]>[0]
79
+ }
80
+ export type ClientResponses = {
91
81
  [K in ClientOperation]: Awaited<ReturnType<Client[K]>>
92
- }>
82
+ }
@@ -7,7 +7,7 @@
7
7
  "private": true,
8
8
  "dependencies": {
9
9
  "@botpress/client": "0.29.3",
10
- "@botpress/sdk": "0.10.16"
10
+ "@botpress/sdk": "0.10.17"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^18.11.17",
@@ -24,16 +24,6 @@ export * as entities from "./entities/index"
24
24
  type Cast<X, Y> = X extends Y ? X : Y
25
25
  type ValueOf<T> = T[keyof T]
26
26
  type AsyncFunction = (...args: any[]) => Promise<any>
27
- type SimplifyObject<T extends object> = T extends infer O ? { [K in keyof O]: Simplify<O[K]> } : never
28
- type Simplify<T> = T extends (...args: infer A) => infer R
29
- ? (...args: Simplify<A>) => Simplify<R>
30
- : T extends Buffer
31
- ? Buffer
32
- : T extends Promise<infer R>
33
- ? Promise<Simplify<R>>
34
- : T extends object
35
- ? SimplifyObject<T>
36
- : T
37
27
 
38
28
  type TIntegration = {
39
29
  name: "webhook-message"
@@ -55,20 +45,20 @@ export type Client = sdk.IntegrationSpecificClient<TIntegration>
55
45
 
56
46
  // extra types
57
47
 
58
- export type HandlerProps = Simplify<Parameters<IntegrationProps['handler']>[0]>
48
+ export type HandlerProps = Parameters<IntegrationProps['handler']>[0]
59
49
 
60
- export type ActionProps = Simplify<{
50
+ export type ActionProps = {
61
51
  [K in keyof IntegrationProps['actions']]: Parameters<IntegrationProps['actions'][K]>[0]
62
- }>
52
+ }
63
53
  export type AnyActionProps = ValueOf<ActionProps>
64
54
 
65
- export type MessageProps = Simplify<{
55
+ export type MessageProps = {
66
56
  [TChannel in keyof IntegrationProps['channels']]: {
67
57
  [TMessage in keyof IntegrationProps['channels'][TChannel]['messages']]: Parameters<
68
58
  IntegrationProps['channels'][TChannel]['messages'][TMessage]
69
59
  >[0]
70
60
  }
71
- }>
61
+ }
72
62
  export type AnyMessageProps = ValueOf<ValueOf<MessageProps>>
73
63
 
74
64
  export type Context = HandlerProps['ctx']
@@ -81,12 +71,12 @@ export type AckFunctions = {
81
71
  }
82
72
  export type AnyAckFunction = ValueOf<ValueOf<AckFunctions>>
83
73
 
84
- export type ClientOperation = Simplify<ValueOf<{
74
+ export type ClientOperation = ValueOf<{
85
75
  [K in keyof Client as Client[K] extends AsyncFunction ? K : never]: K
86
- }>>
87
- export type ClientRequests = Simplify<{
88
- [K in ClientOperation]: Parameters<Client[K]>[0]
89
76
  }>
90
- export type ClientResponses = Simplify<{
77
+ export type ClientRequests = {
78
+ [K in ClientOperation]: Parameters<Client[K]>[0]
79
+ }
80
+ export type ClientResponses = {
91
81
  [K in ClientOperation]: Awaited<ReturnType<Client[K]>>
92
- }>
82
+ }
@@ -7,7 +7,7 @@
7
7
  "private": true,
8
8
  "dependencies": {
9
9
  "@botpress/client": "0.29.3",
10
- "@botpress/sdk": "0.10.16",
10
+ "@botpress/sdk": "0.10.17",
11
11
  "axios": "^1.6.8"
12
12
  },
13
13
  "devDependencies": {