@botpress/cli 4.1.1 → 4.2.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.
@@ -1,32 +1,32 @@
1
1
 
2
- > @botpress/cli@4.1.1 build /home/runner/work/botpress/botpress/packages/cli
2
+ > @botpress/cli@4.2.0 build /home/runner/work/botpress/botpress/packages/cli
3
3
  > pnpm run bundle && pnpm run template:gen
4
4
 
5
5
 
6
- > @botpress/cli@4.1.1 bundle /home/runner/work/botpress/botpress/packages/cli
6
+ > @botpress/cli@4.2.0 bundle /home/runner/work/botpress/botpress/packages/cli
7
7
  > ts-node -T build.ts
8
8
 
9
9
 
10
- > @botpress/cli@4.1.1 template:gen /home/runner/work/botpress/botpress/packages/cli
10
+ > @botpress/cli@4.2.0 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 v4.1.1
14
- 🤖 Botpress CLI v4.1.1
15
- 🤖 Botpress CLI v4.1.1
16
- 🤖 Botpress CLI v4.1.1
17
- ○ Generating typings for bot...
13
+ 🤖 Botpress CLI v4.2.0
14
+ 🤖 Botpress CLI v4.2.0
15
+ 🤖 Botpress CLI v4.2.0
16
+ 🤖 Botpress CLI v4.2.0
17
+ ○ Generating typings for plugin empty-plugin...
18
18
  ✓ Typings available at .botpress
19
19
 
20
20
  ○ Generating typings for integration hello-world...
21
- ○ Generating typings for integration empty-integration...
22
21
  ✓ Typings available at .botpress
23
22
 
24
- ○ Generating typings for plugin empty-plugin...
23
+ ○ Generating typings for bot...
25
24
  ✓ Typings available at .botpress
26
25
 
26
+ ○ Generating typings for integration empty-integration...
27
27
  ✓ Typings available at .botpress
28
28
 
29
- 🤖 Botpress CLI v4.1.1
29
+ 🤖 Botpress CLI v4.2.0
30
30
  ○ Generating typings for integration webhook-message...
31
31
  ✓ Typings available at .botpress
32
32
 
@@ -72,6 +72,15 @@ const prepareCreateIntegrationBody = async (integration) => ({
72
72
  });
73
73
  const prepareUpdateIntegrationBody = (localIntegration, remoteIntegration) => {
74
74
  const actions = utils.records.setNullOnMissingValues(localIntegration.actions, remoteIntegration.actions);
75
+ for (const [actionName, action] of Object.entries(actions)) {
76
+ if (!action || !remoteIntegration.actions[actionName]) {
77
+ continue;
78
+ }
79
+ action.attributes = utils.records.setNullOnMissingValues(
80
+ action.attributes,
81
+ remoteIntegration.actions[actionName].attributes
82
+ );
83
+ }
75
84
  const events = utils.records.setNullOnMissingValues(localIntegration.events, remoteIntegration.events);
76
85
  const states = utils.records.setNullOnMissingValues(localIntegration.states, remoteIntegration.states);
77
86
  const entities = utils.records.setNullOnMissingValues(localIntegration.entities, remoteIntegration.entities);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api/integration-body.ts"],
4
- "sourcesContent": ["import * as client from '@botpress/client'\nimport * as sdk from '@botpress/sdk'\nimport * as utils from '../utils'\nimport * as types from './types'\n\nexport const prepareCreateIntegrationBody = async (\n integration: sdk.IntegrationDefinition | sdk.IntegrationPackage['definition']\n): Promise<types.CreateIntegrationRequestBody> => ({\n name: integration.name,\n version: integration.version,\n title: 'title' in integration ? integration.title : undefined,\n description: 'description' in integration ? integration.description : undefined,\n user: integration.user,\n events: integration.events\n ? await utils.records.mapValuesAsync(integration.events, async (event) => ({\n ...event,\n schema: await utils.schema.mapZodToJsonSchema(event),\n }))\n : undefined,\n actions: integration.actions\n ? await utils.records.mapValuesAsync(integration.actions, async (action) => ({\n ...action,\n input: {\n ...action.input,\n schema: await utils.schema.mapZodToJsonSchema(action.input),\n },\n output: {\n ...action.output,\n schema: await utils.schema.mapZodToJsonSchema(action.output),\n },\n }))\n : undefined,\n channels: integration.channels\n ? await utils.records.mapValuesAsync(integration.channels, async (channel) => ({\n ...channel,\n messages: await utils.records.mapValuesAsync(channel.messages, async (message) => ({\n ...message,\n schema: await utils.schema.mapZodToJsonSchema(message),\n })),\n }))\n : undefined,\n states: integration.states\n ? await utils.records.mapValuesAsync(integration.states, async (state) => ({\n ...state,\n schema: await utils.schema.mapZodToJsonSchema(state),\n }))\n : undefined,\n entities: integration.entities\n ? await utils.records.mapValuesAsync(integration.entities, async (entity) => ({\n ...entity,\n schema: await utils.schema.mapZodToJsonSchema(entity),\n }))\n : undefined,\n})\n\ntype UpdateIntegrationChannelsBody = NonNullable<types.UpdateIntegrationRequestBody['channels']>\ntype UpdateIntegrationChannelBody = UpdateIntegrationChannelsBody[string]\ntype Channels = client.Integration['channels']\ntype Channel = client.Integration['channels'][string]\nexport const prepareUpdateIntegrationBody = (\n localIntegration: types.UpdateIntegrationRequestBody,\n remoteIntegration: client.Integration\n): types.UpdateIntegrationRequestBody => {\n const actions = utils.records.setNullOnMissingValues(localIntegration.actions, remoteIntegration.actions)\n const events = utils.records.setNullOnMissingValues(localIntegration.events, remoteIntegration.events)\n const states = utils.records.setNullOnMissingValues(localIntegration.states, remoteIntegration.states)\n const entities = utils.records.setNullOnMissingValues(localIntegration.entities, remoteIntegration.entities)\n const user = {\n ...localIntegration.user,\n tags: utils.records.setNullOnMissingValues(localIntegration.user?.tags, remoteIntegration.user?.tags),\n }\n\n const channels = _prepareUpdateIntegrationChannelsBody(localIntegration.channels ?? {}, remoteIntegration.channels)\n\n const interfaces = utils.records.setNullOnMissingValues(localIntegration.interfaces, remoteIntegration.interfaces)\n\n const configurations = utils.records.setNullOnMissingValues(\n localIntegration.configurations,\n remoteIntegration.configurations\n )\n\n return {\n ..._maybeRemoveVrlScripts(localIntegration, remoteIntegration),\n actions,\n events,\n states,\n entities,\n user,\n channels,\n interfaces,\n configurations,\n }\n}\n\nconst _maybeRemoveVrlScripts = (\n localIntegration: types.UpdateIntegrationRequestBody,\n remoteIntegration: client.Integration\n): types.UpdateIntegrationRequestBody => {\n const newIntegration = structuredClone(localIntegration)\n\n if (\n remoteIntegration.configuration?.identifier?.linkTemplateScript &&\n !localIntegration.configuration?.identifier?.linkTemplateScript\n ) {\n newIntegration.configuration ??= remoteIntegration.configuration\n newIntegration.configuration.identifier ??= remoteIntegration.configuration.identifier\n newIntegration.configuration.identifier.linkTemplateScript = null\n newIntegration.configuration.identifier.required = false\n }\n\n if (remoteIntegration.identifier.extractScript && !localIntegration.identifier?.extractScript) {\n newIntegration.identifier ??= remoteIntegration.identifier\n newIntegration.identifier.extractScript = null\n }\n\n if (remoteIntegration.identifier.fallbackHandlerScript && !localIntegration.identifier?.fallbackHandlerScript) {\n newIntegration.identifier ??= remoteIntegration.identifier\n newIntegration.identifier.fallbackHandlerScript = null\n }\n\n for (const configName of Object.keys(localIntegration.configurations ?? {})) {\n if (\n remoteIntegration.configurations[configName]?.identifier.linkTemplateScript &&\n !localIntegration.configurations?.[configName]?.identifier?.linkTemplateScript\n ) {\n newIntegration.configurations ??= remoteIntegration.configurations\n newIntegration.configurations[configName] ??= remoteIntegration.configurations[configName]\n newIntegration.configurations[configName].identifier ??= remoteIntegration.configurations[configName].identifier\n newIntegration.configurations[configName].identifier.linkTemplateScript = null\n newIntegration.configurations[configName].identifier.required = false\n }\n }\n\n return newIntegration\n}\n\nconst _prepareUpdateIntegrationChannelsBody = (\n localChannels: UpdateIntegrationChannelsBody,\n remoteChannels: Channels\n): UpdateIntegrationChannelsBody => {\n const channelBody: UpdateIntegrationChannelsBody = {}\n\n const zipped = utils.records.zipObjects(localChannels, remoteChannels)\n for (const [channelName, [localChannel, remoteChannel]] of Object.entries(zipped)) {\n if (localChannel && remoteChannel) {\n // channel has to be updated\n channelBody[channelName] = _prepareUpdateIntegrationChannelBody(localChannel, remoteChannel)\n } else if (localChannel) {\n // channel has to be created\n channelBody[channelName] = localChannel\n continue\n } else if (remoteChannel) {\n // channel has to be deleted\n channelBody[channelName] = null\n continue\n }\n }\n\n return channelBody\n}\n\nconst _prepareUpdateIntegrationChannelBody = (\n localChannel: UpdateIntegrationChannelBody,\n remoteChannel: Channel\n): UpdateIntegrationChannelBody => ({\n ...localChannel,\n messages: utils.records.setNullOnMissingValues(localChannel?.messages, remoteChannel.messages),\n message: {\n ...localChannel?.message,\n tags: utils.records.setNullOnMissingValues(localChannel?.message?.tags, remoteChannel.message.tags),\n },\n conversation: {\n ...localChannel?.conversation,\n tags: utils.records.setNullOnMissingValues(localChannel?.conversation?.tags, remoteChannel.conversation.tags),\n },\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAGhB,MAAM,+BAA+B,OAC1C,iBACiD;AAAA,EACjD,MAAM,YAAY;AAAA,EAClB,SAAS,YAAY;AAAA,EACrB,OAAO,WAAW,cAAc,YAAY,QAAQ;AAAA,EACpD,aAAa,iBAAiB,cAAc,YAAY,cAAc;AAAA,EACtE,MAAM,YAAY;AAAA,EAClB,QAAQ,YAAY,SAChB,MAAM,MAAM,QAAQ,eAAe,YAAY,QAAQ,OAAO,WAAW;AAAA,IACvE,GAAG;AAAA,IACH,QAAQ,MAAM,MAAM,OAAO,mBAAmB,KAAK;AAAA,EACrD,EAAE,IACF;AAAA,EACJ,SAAS,YAAY,UACjB,MAAM,MAAM,QAAQ,eAAe,YAAY,SAAS,OAAO,YAAY;AAAA,IACzE,GAAG;AAAA,IACH,OAAO;AAAA,MACL,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO,KAAK;AAAA,IAC5D;AAAA,IACA,QAAQ;AAAA,MACN,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO,MAAM;AAAA,IAC7D;AAAA,EACF,EAAE,IACF;AAAA,EACJ,UAAU,YAAY,WAClB,MAAM,MAAM,QAAQ,eAAe,YAAY,UAAU,OAAO,aAAa;AAAA,IAC3E,GAAG;AAAA,IACH,UAAU,MAAM,MAAM,QAAQ,eAAe,QAAQ,UAAU,OAAO,aAAa;AAAA,MACjF,GAAG;AAAA,MACH,QAAQ,MAAM,MAAM,OAAO,mBAAmB,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AAEjC,kBAAY,WAAW,IAAI,qCAAqC,cAAc,aAAa;AAAA,IAC7F,WAAW,cAAc;AAEvB,kBAAY,WAAW,IAAI;AAC3B;AAAA,IACF,WAAW,eAAe;AAExB,kBAAY,WAAW,IAAI;AAC3B;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,uCAAuC,CAC3C,cACA,mBACkC;AAAA,EAClC,GAAG;AAAA,EACH,UAAU,MAAM,QAAQ,uBAAuB,cAAc,UAAU,cAAc,QAAQ;AAAA,EAC7F,SAAS;AAAA,IACP,GAAG,cAAc;AAAA,IACjB,MAAM,MAAM,QAAQ,uBAAuB,cAAc,SAAS,MAAM,cAAc,QAAQ,IAAI;AAAA,EACpG;AAAA,EACA,cAAc;AAAA,IACZ,GAAG,cAAc;AAAA,IACjB,MAAM,MAAM,QAAQ,uBAAuB,cAAc,cAAc,MAAM,cAAc,aAAa,IAAI;AAAA,EAC9G;AACF;",
4
+ "sourcesContent": ["import * as client from '@botpress/client'\nimport * as sdk from '@botpress/sdk'\nimport * as utils from '../utils'\nimport * as types from './types'\n\nexport const prepareCreateIntegrationBody = async (\n integration: sdk.IntegrationDefinition | sdk.IntegrationPackage['definition']\n): Promise<types.CreateIntegrationRequestBody> => ({\n name: integration.name,\n version: integration.version,\n title: 'title' in integration ? integration.title : undefined,\n description: 'description' in integration ? integration.description : undefined,\n user: integration.user,\n events: integration.events\n ? await utils.records.mapValuesAsync(integration.events, async (event) => ({\n ...event,\n schema: await utils.schema.mapZodToJsonSchema(event),\n }))\n : undefined,\n actions: integration.actions\n ? await utils.records.mapValuesAsync(integration.actions, async (action) => ({\n ...action,\n input: {\n ...action.input,\n schema: await utils.schema.mapZodToJsonSchema(action.input),\n },\n output: {\n ...action.output,\n schema: await utils.schema.mapZodToJsonSchema(action.output),\n },\n }))\n : undefined,\n channels: integration.channels\n ? await utils.records.mapValuesAsync(integration.channels, async (channel) => ({\n ...channel,\n messages: await utils.records.mapValuesAsync(channel.messages, async (message) => ({\n ...message,\n schema: await utils.schema.mapZodToJsonSchema(message),\n })),\n }))\n : undefined,\n states: integration.states\n ? await utils.records.mapValuesAsync(integration.states, async (state) => ({\n ...state,\n schema: await utils.schema.mapZodToJsonSchema(state),\n }))\n : undefined,\n entities: integration.entities\n ? await utils.records.mapValuesAsync(integration.entities, async (entity) => ({\n ...entity,\n schema: await utils.schema.mapZodToJsonSchema(entity),\n }))\n : undefined,\n})\n\ntype UpdateIntegrationChannelsBody = NonNullable<types.UpdateIntegrationRequestBody['channels']>\ntype UpdateIntegrationChannelBody = UpdateIntegrationChannelsBody[string]\ntype Channels = client.Integration['channels']\ntype Channel = client.Integration['channels'][string]\nexport const prepareUpdateIntegrationBody = (\n localIntegration: types.UpdateIntegrationRequestBody,\n remoteIntegration: client.Integration\n): types.UpdateIntegrationRequestBody => {\n const actions = utils.records.setNullOnMissingValues(localIntegration.actions, remoteIntegration.actions)\n\n for (const [actionName, action] of Object.entries(actions)) {\n if (!action || !remoteIntegration.actions[actionName]) {\n continue\n }\n\n action.attributes = utils.records.setNullOnMissingValues(\n action.attributes,\n remoteIntegration.actions[actionName].attributes\n )\n }\n\n const events = utils.records.setNullOnMissingValues(localIntegration.events, remoteIntegration.events)\n const states = utils.records.setNullOnMissingValues(localIntegration.states, remoteIntegration.states)\n const entities = utils.records.setNullOnMissingValues(localIntegration.entities, remoteIntegration.entities)\n const user = {\n ...localIntegration.user,\n tags: utils.records.setNullOnMissingValues(localIntegration.user?.tags, remoteIntegration.user?.tags),\n }\n\n const channels = _prepareUpdateIntegrationChannelsBody(localIntegration.channels ?? {}, remoteIntegration.channels)\n\n const interfaces = utils.records.setNullOnMissingValues(localIntegration.interfaces, remoteIntegration.interfaces)\n\n const configurations = utils.records.setNullOnMissingValues(\n localIntegration.configurations,\n remoteIntegration.configurations\n )\n\n return {\n ..._maybeRemoveVrlScripts(localIntegration, remoteIntegration),\n actions,\n events,\n states,\n entities,\n user,\n channels,\n interfaces,\n configurations,\n }\n}\n\nconst _maybeRemoveVrlScripts = (\n localIntegration: types.UpdateIntegrationRequestBody,\n remoteIntegration: client.Integration\n): types.UpdateIntegrationRequestBody => {\n const newIntegration = structuredClone(localIntegration)\n\n if (\n remoteIntegration.configuration?.identifier?.linkTemplateScript &&\n !localIntegration.configuration?.identifier?.linkTemplateScript\n ) {\n newIntegration.configuration ??= remoteIntegration.configuration\n newIntegration.configuration.identifier ??= remoteIntegration.configuration.identifier\n newIntegration.configuration.identifier.linkTemplateScript = null\n newIntegration.configuration.identifier.required = false\n }\n\n if (remoteIntegration.identifier.extractScript && !localIntegration.identifier?.extractScript) {\n newIntegration.identifier ??= remoteIntegration.identifier\n newIntegration.identifier.extractScript = null\n }\n\n if (remoteIntegration.identifier.fallbackHandlerScript && !localIntegration.identifier?.fallbackHandlerScript) {\n newIntegration.identifier ??= remoteIntegration.identifier\n newIntegration.identifier.fallbackHandlerScript = null\n }\n\n for (const configName of Object.keys(localIntegration.configurations ?? {})) {\n if (\n remoteIntegration.configurations[configName]?.identifier.linkTemplateScript &&\n !localIntegration.configurations?.[configName]?.identifier?.linkTemplateScript\n ) {\n newIntegration.configurations ??= remoteIntegration.configurations\n newIntegration.configurations[configName] ??= remoteIntegration.configurations[configName]\n newIntegration.configurations[configName].identifier ??= remoteIntegration.configurations[configName].identifier\n newIntegration.configurations[configName].identifier.linkTemplateScript = null\n newIntegration.configurations[configName].identifier.required = false\n }\n }\n\n return newIntegration\n}\n\nconst _prepareUpdateIntegrationChannelsBody = (\n localChannels: UpdateIntegrationChannelsBody,\n remoteChannels: Channels\n): UpdateIntegrationChannelsBody => {\n const channelBody: UpdateIntegrationChannelsBody = {}\n\n const zipped = utils.records.zipObjects(localChannels, remoteChannels)\n for (const [channelName, [localChannel, remoteChannel]] of Object.entries(zipped)) {\n if (localChannel && remoteChannel) {\n // channel has to be updated\n channelBody[channelName] = _prepareUpdateIntegrationChannelBody(localChannel, remoteChannel)\n } else if (localChannel) {\n // channel has to be created\n channelBody[channelName] = localChannel\n continue\n } else if (remoteChannel) {\n // channel has to be deleted\n channelBody[channelName] = null\n continue\n }\n }\n\n return channelBody\n}\n\nconst _prepareUpdateIntegrationChannelBody = (\n localChannel: UpdateIntegrationChannelBody,\n remoteChannel: Channel\n): UpdateIntegrationChannelBody => ({\n ...localChannel,\n messages: utils.records.setNullOnMissingValues(localChannel?.messages, remoteChannel.messages),\n message: {\n ...localChannel?.message,\n tags: utils.records.setNullOnMissingValues(localChannel?.message?.tags, remoteChannel.message.tags),\n },\n conversation: {\n ...localChannel?.conversation,\n tags: utils.records.setNullOnMissingValues(localChannel?.conversation?.tags, remoteChannel.conversation.tags),\n },\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAGhB,MAAM,+BAA+B,OAC1C,iBACiD;AAAA,EACjD,MAAM,YAAY;AAAA,EAClB,SAAS,YAAY;AAAA,EACrB,OAAO,WAAW,cAAc,YAAY,QAAQ;AAAA,EACpD,aAAa,iBAAiB,cAAc,YAAY,cAAc;AAAA,EACtE,MAAM,YAAY;AAAA,EAClB,QAAQ,YAAY,SAChB,MAAM,MAAM,QAAQ,eAAe,YAAY,QAAQ,OAAO,WAAW;AAAA,IACvE,GAAG;AAAA,IACH,QAAQ,MAAM,MAAM,OAAO,mBAAmB,KAAK;AAAA,EACrD,EAAE,IACF;AAAA,EACJ,SAAS,YAAY,UACjB,MAAM,MAAM,QAAQ,eAAe,YAAY,SAAS,OAAO,YAAY;AAAA,IACzE,GAAG;AAAA,IACH,OAAO;AAAA,MACL,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO,KAAK;AAAA,IAC5D;AAAA,IACA,QAAQ;AAAA,MACN,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO,MAAM;AAAA,IAC7D;AAAA,EACF,EAAE,IACF;AAAA,EACJ,UAAU,Y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Ae,eAAe,UAAU,MAAM,kBAAkB,eAAe,UAAU;AACzF,qBAAe,eAAe,UAAU,EAAE,eAAe,kBAAkB,eAAe,UAAU,EAAE;AACtG,qBAAe,eAAe,UAAU,EAAE,WAAW,qBAAqB;AAC1E,qBAAe,eAAe,UAAU,EAAE,WAAW,WAAW;AAAA,IAClE;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,wCAAwC,CAC5C,eACA,mBACkC;AAClC,QAAM,cAA6C,CAAC;AAEpD,QAAM,SAAS,MAAM,QAAQ,WAAW,eAAe,cAAc;AACrE,aAAW,CAAC,aAAa,CAAC,cAAc,aAAa,CAAC,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjF,QAAI,gBAAgB,eAAe;AAEjC,kBAAY,WAAW,IAAI,qCAAqC,cAAc,aAAa;AAAA,IAC7F,WAAW,cAAc;AAEvB,kBAAY,WAAW,IAAI;AAC3B;AAAA,IACF,WAAW,eAAe;AAExB,kBAAY,WAAW,IAAI;AAC3B;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,uCAAuC,CAC3C,cACA,mBACkC;AAAA,EAClC,GAAG;AAAA,EACH,UAAU,MAAM,QAAQ,uBAAuB,cAAc,UAAU,cAAc,QAAQ;AAAA,EAC7F,SAAS;AAAA,IACP,GAAG,cAAc;AAAA,IACjB,MAAM,MAAM,QAAQ,uBAAuB,cAAc,SAAS,MAAM,cAAc,QAAQ,IAAI;AAAA,EACpG;AAAA,EACA,cAAc;AAAA,IACZ,GAAG,cAAc;AAAA,IACjB,MAAM,MAAM,QAAQ,uBAAuB,cAAc,cAAc,MAAM,cAAc,aAAa,IAAI;AAAA,EAC9G;AACF;",
6
6
  "names": []
7
7
  }
@@ -64,7 +64,19 @@ const prepareCreateInterfaceBody = async (intrface) => ({
64
64
  })) : {}
65
65
  });
66
66
  const prepareUpdateInterfaceBody = (localInterface, remoteInterface) => {
67
- const actions = utils.records.setNullOnMissingValues(localInterface.actions, remoteInterface.actions);
67
+ const actions = utils.records.setNullOnMissingValues(
68
+ localInterface.actions,
69
+ remoteInterface.actions
70
+ );
71
+ for (const [actionName, action] of Object.entries(actions)) {
72
+ if (!action || !remoteInterface.actions[actionName]) {
73
+ continue;
74
+ }
75
+ action.attributes = utils.records.setNullOnMissingValues(
76
+ action.attributes,
77
+ remoteInterface.actions[actionName].attributes
78
+ );
79
+ }
68
80
  const events = utils.records.setNullOnMissingValues(localInterface.events, remoteInterface.events);
69
81
  const entities = utils.records.setNullOnMissingValues(localInterface.entities, remoteInterface.entities);
70
82
  const currentChannels = localInterface.channels ? utils.records.mapValues(localInterface.channels, (channel, channelName) => ({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api/interface-body.ts"],
4
- "sourcesContent": ["import * as client from '@botpress/client'\nimport * as sdk from '@botpress/sdk'\nimport * as utils from '../utils'\nimport * as types from './types'\n\nexport const prepareCreateInterfaceBody = async (\n intrface: sdk.InterfaceDefinition | sdk.InterfacePackage['definition']\n): Promise<types.CreateInterfaceRequestBody> => ({\n name: intrface.name,\n version: intrface.version,\n entities: intrface.entities\n ? await utils.records.mapValuesAsync(intrface.entities, async (entity) => ({\n ...entity,\n schema: await utils.schema.mapZodToJsonSchema(entity),\n }))\n : {},\n events: intrface.events\n ? await utils.records.mapValuesAsync(intrface.events, async (event) => ({\n ...event,\n schema: await utils.schema.mapZodToJsonSchema(event),\n }))\n : {},\n actions: intrface.actions\n ? await utils.records.mapValuesAsync(intrface.actions, async (action) => ({\n ...action,\n input: {\n ...action.input,\n schema: await utils.schema.mapZodToJsonSchema(action.input),\n },\n output: {\n ...action.output,\n schema: await utils.schema.mapZodToJsonSchema(action.output),\n },\n }))\n : {},\n channels: intrface.channels\n ? await utils.records.mapValuesAsync(intrface.channels, async (channel) => ({\n ...channel,\n messages: await utils.records.mapValuesAsync(channel.messages, async (message) => ({\n ...message,\n schema: await utils.schema.mapZodToJsonSchema(message),\n })),\n }))\n : {},\n})\n\nexport const prepareUpdateInterfaceBody = (\n localInterface: types.CreateInterfaceRequestBody & { id: string },\n remoteInterface: client.Interface\n): types.UpdateInterfaceRequestBody => {\n const actions = utils.records.setNullOnMissingValues(localInterface.actions, remoteInterface.actions)\n const events = utils.records.setNullOnMissingValues(localInterface.events, remoteInterface.events)\n const entities = utils.records.setNullOnMissingValues(localInterface.entities, remoteInterface.entities)\n\n const currentChannels: types.UpdateInterfaceRequestBody['channels'] = localInterface.channels\n ? utils.records.mapValues(localInterface.channels, (channel, channelName) => ({\n ...channel,\n messages: utils.records.setNullOnMissingValues(\n channel?.messages,\n remoteInterface.channels[channelName]?.messages\n ),\n }))\n : undefined\n\n const channels = utils.records.setNullOnMissingValues(currentChannels, remoteInterface.channels)\n\n return {\n ...localInterface,\n entities,\n actions,\n events,\n channels,\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAGhB,MAAM,6BAA6B,OACxC,cAC+C;AAAA,EAC/C,MAAM,SAAS;AAAA,EACf,SAAS,SAAS;AAAA,EAClB,UAAU,SAAS,WACf,MAAM,MAAM,QAAQ,eAAe,SAAS,UAAU,OAAO,YAAY;AAAA,IACvE,GAAG;AAAA,IACH,QAAQ,MAAM,MAAM,OAAO,mBAAmB,MAAM;AAAA,EACtD,EAAE,IACF,CAAC;AAAA,EACL,QAAQ,SAAS,SACb,MAAM,MAAM,QAAQ,eAAe,SAAS,QAAQ,OAAO,WAAW;AAAA,IACpE,GAAG;AAAA,IACH,QAAQ,MAAM,MAAM,OAAO,mBAAmB,KAAK;AAAA,EACrD,EAAE,IACF,CAAC;AAAA,EACL,SAAS,SAAS,UACd,MAAM,MAAM,QAAQ,eAAe,SAAS,SAAS,OAAO,YAAY;AAAA,IACtE,GAAG;AAAA,IACH,OAAO;AAAA,MACL,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO,KAAK;AAAA,IAC5D;AAAA,IACA,QAAQ;AAAA,MACN,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO,MAAM;AAAA,IAC7D;AAAA,EACF,EAAE,IACF,CAAC;AAAA,EACL,UAAU,SAAS,WACf,MAAM,MAAM,QAAQ,eAAe,SAAS,UAAU,OAAO,aAAa;AAAA,IACxE,GAAG;AAAA,IACH,UAAU,MAAM,MAAM,QAAQ,eAAe,QAAQ,UAAU,OAAO,aAAa;AAAA,MACjF,GAAG;AAAA,MACH,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO;AAAA,IACvD,EAAE;AAAA,EACJ,EAAE,IACF,CAAC;AACP;AAEO,MAAM,6BAA6B,CACxC,gBACA,oBACqC;AACrC,QAAM,UAAU,MAAM,QAAQ,uBAAuB,eAAe,SAAS,gBAAgB,OAAO;AACpG,QAAM,SAAS,MAAM,QAAQ,uBAAuB,eAAe,QAAQ,gBAAgB,MAAM;AACjG,QAAM,WAAW,MAAM,QAAQ,uBAAuB,eAAe,UAAU,gBAAgB,QAAQ;AAEvG,QAAM,kBAAgE,eAAe,WACjF,MAAM,QAAQ,UAAU,eAAe,UAAU,CAAC,SAAS,iBAAiB;AAAA,IAC1E,GAAG;AAAA,IACH,UAAU,MAAM,QAAQ;AAAA,MACtB,SAAS;AAAA,MACT,gBAAgB,SAAS,WAAW,GAAG;AAAA,IACzC;AAAA,EACF,EAAE,IACF;AAEJ,QAAM,WAAW,MAAM,QAAQ,uBAAuB,iBAAiB,gBAAgB,QAAQ;AAE/F,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import * as client from '@botpress/client'\nimport * as sdk from '@botpress/sdk'\nimport * as utils from '../utils'\nimport * as types from './types'\n\nexport const prepareCreateInterfaceBody = async (\n intrface: sdk.InterfaceDefinition | sdk.InterfacePackage['definition']\n): Promise<types.CreateInterfaceRequestBody> => ({\n name: intrface.name,\n version: intrface.version,\n entities: intrface.entities\n ? await utils.records.mapValuesAsync(intrface.entities, async (entity) => ({\n ...entity,\n schema: await utils.schema.mapZodToJsonSchema(entity),\n }))\n : {},\n events: intrface.events\n ? await utils.records.mapValuesAsync(intrface.events, async (event) => ({\n ...event,\n schema: await utils.schema.mapZodToJsonSchema(event),\n }))\n : {},\n actions: intrface.actions\n ? await utils.records.mapValuesAsync(intrface.actions, async (action) => ({\n ...action,\n input: {\n ...action.input,\n schema: await utils.schema.mapZodToJsonSchema(action.input),\n },\n output: {\n ...action.output,\n schema: await utils.schema.mapZodToJsonSchema(action.output),\n },\n }))\n : {},\n channels: intrface.channels\n ? await utils.records.mapValuesAsync(intrface.channels, async (channel) => ({\n ...channel,\n messages: await utils.records.mapValuesAsync(channel.messages, async (message) => ({\n ...message,\n schema: await utils.schema.mapZodToJsonSchema(message),\n })),\n }))\n : {},\n})\n\nexport const prepareUpdateInterfaceBody = (\n localInterface: types.CreateInterfaceRequestBody & { id: string },\n remoteInterface: client.Interface\n): types.UpdateInterfaceRequestBody => {\n const actions = utils.records.setNullOnMissingValues(\n localInterface.actions,\n remoteInterface.actions\n ) as types.CreateInterfaceRequestBody['actions'] &\n Pick<NonNullable<types.UpdateInterfaceRequestBody['actions']>, 'attributes'>\n\n for (const [actionName, action] of Object.entries(actions)) {\n if (!action || !remoteInterface.actions[actionName]) {\n continue\n }\n\n action.attributes = utils.records.setNullOnMissingValues(\n action.attributes,\n remoteInterface.actions[actionName].attributes\n )\n }\n\n const events = utils.records.setNullOnMissingValues(localInterface.events, remoteInterface.events)\n const entities = utils.records.setNullOnMissingValues(localInterface.entities, remoteInterface.entities)\n\n const currentChannels: types.UpdateInterfaceRequestBody['channels'] = localInterface.channels\n ? utils.records.mapValues(localInterface.channels, (channel, channelName) => ({\n ...channel,\n messages: utils.records.setNullOnMissingValues(\n channel?.messages,\n remoteInterface.channels[channelName]?.messages\n ),\n }))\n : undefined\n\n const channels = utils.records.setNullOnMissingValues(currentChannels, remoteInterface.channels)\n\n return {\n ...localInterface,\n entities,\n actions,\n events,\n channels,\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAGhB,MAAM,6BAA6B,OACxC,cAC+C;AAAA,EAC/C,MAAM,SAAS;AAAA,EACf,SAAS,SAAS;AAAA,EAClB,UAAU,SAAS,WACf,MAAM,MAAM,QAAQ,eAAe,SAAS,UAAU,OAAO,YAAY;AAAA,IACvE,GAAG;AAAA,IACH,QAAQ,MAAM,MAAM,OAAO,mBAAmB,MAAM;AAAA,EACtD,EAAE,IACF,CAAC;AAAA,EACL,QAAQ,SAAS,SACb,MAAM,MAAM,QAAQ,eAAe,SAAS,QAAQ,OAAO,WAAW;AAAA,IACpE,GAAG;AAAA,IACH,QAAQ,MAAM,MAAM,OAAO,mBAAmB,KAAK;AAAA,EACrD,EAAE,IACF,CAAC;AAAA,EACL,SAAS,SAAS,UACd,MAAM,MAAM,QAAQ,eAAe,SAAS,SAAS,OAAO,YAAY;AAAA,IACtE,GAAG;AAAA,IACH,OAAO;AAAA,MACL,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO,KAAK;AAAA,IAC5D;AAAA,IACA,QAAQ;AAAA,MACN,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO,MAAM;AAAA,IAC7D;AAAA,EACF,EAAE,IACF,CAAC;AAAA,EACL,UAAU,SAAS,WACf,MAAM,MAAM,QAAQ,eAAe,SAAS,UAAU,OAAO,aAAa;AAAA,IACxE,GAAG;AAAA,IACH,UAAU,MAAM,MAAM,QAAQ,eAAe,QAAQ,UAAU,OAAO,aAAa;AAAA,MACjF,GAAG;AAAA,MACH,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO;AAAA,IACvD,EAAE;AAAA,EACJ,EAAE,IACF,CAAC;AACP;AAEO,MAAM,6BAA6B,CACxC,gBACA,oBACqC;AACrC,QAAM,UAAU,MAAM,QAAQ;AAAA,IAC5B,eAAe;AAAA,IACf,gBAAgB;AAAA,EAClB;AAGA,aAAW,CAAC,YAAY,MAAM,KAAK,OAAO,QAAQ,OAAO,GAAG;AAC1D,QAAI,CAAC,UAAU,CAAC,gBAAgB,QAAQ,UAAU,GAAG;AACnD;AAAA,IACF;AAEA,WAAO,aAAa,MAAM,QAAQ;AAAA,MAChC,OAAO;AAAA,MACP,gBAAgB,QAAQ,UAAU,EAAE;AAAA,IACtC;AAAA,EACF;AAEA,QAAM,SAAS,MAAM,QAAQ,uBAAuB,eAAe,QAAQ,gBAAgB,MAAM;AACjG,QAAM,WAAW,MAAM,QAAQ,uBAAuB,eAAe,UAAU,gBAAgB,QAAQ;AAEvG,QAAM,kBAAgE,eAAe,WACjF,MAAM,QAAQ,UAAU,eAAe,UAAU,CAAC,SAAS,iBAAiB;AAAA,IAC1E,GAAG;AAAA,IACH,UAAU,MAAM,QAAQ;AAAA,MACtB,SAAS;AAAA,MACT,gBAAgB,SAAS,WAAW,GAAG;AAAA,IACzC;AAAA,EACF,EAAE,IACF;AAEJ,QAAM,WAAW,MAAM,QAAQ,uBAAuB,iBAAiB,gBAAgB,QAAQ;AAE/F,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -64,12 +64,15 @@ class ActionModule extends import_module.ReExportVariableModule {
64
64
  constructor(actionName, action) {
65
65
  super({
66
66
  exportName: strings.varName(actionName),
67
- extraProps: gen.primitiveRecordToTypescriptValues({
68
- title: action.title,
69
- description: action.description,
70
- billable: action.billable,
71
- cacheable: action.cacheable
72
- })
67
+ extraProps: {
68
+ ...gen.primitiveRecordToTypescriptValues({
69
+ title: action.title,
70
+ description: action.description,
71
+ billable: action.billable,
72
+ cacheable: action.cacheable
73
+ }),
74
+ ...action.attributes ? { attributes: gen.stringifySingleLine(action.attributes) } : void 0
75
+ }
73
76
  });
74
77
  const inputModule = new ActionInputModule(action.input);
75
78
  const outputModule = new ActionOutputModule(action.output);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/code-generation/integration-package/integration-package-definition/actions-module.ts"],
4
- "sourcesContent": ["import { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport * as gen from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\ntype ActionInput = types.ActionDefinition['input']\ntype ActionOutput = types.ActionDefinition['output']\n\nexport class ActionInputModule extends Module {\n public constructor(private _input: ActionInput) {\n const name = 'input'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._input.schema, this.exportName)\n }\n}\n\nexport class ActionOutputModule extends Module {\n public constructor(private _output: ActionOutput) {\n const name = 'output'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._output.schema, this.exportName)\n }\n}\n\nexport class ActionModule extends ReExportVariableModule {\n public constructor(actionName: string, action: types.ActionDefinition) {\n super({\n exportName: strings.varName(actionName),\n extraProps: gen.primitiveRecordToTypescriptValues({\n title: action.title,\n description: action.description,\n billable: action.billable,\n cacheable: action.cacheable,\n }),\n })\n\n const inputModule = new ActionInputModule(action.input)\n const outputModule = new ActionOutputModule(action.output)\n\n this.pushDep(inputModule)\n this.pushDep(outputModule)\n }\n}\n\nexport class ActionsModule extends ReExportVariableModule {\n public constructor(actions: Record<string, types.ActionDefinition>) {\n super({ exportName: strings.varName('actions') })\n for (const [actionName, action] of Object.entries(actions)) {\n const module = new ActionModule(actionName, action)\n module.unshift(actionName)\n this.pushDep(module)\n }\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;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KAAK,OAAO,QAAQ,OAAO,GAAG;AAC1D,YAAMA,UAAS,IAAI,aAAa,YAAY,MAAM;AAClD,MAAAA,QAAO,QAAQ,UAAU;AACzB,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport * as gen from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\ntype ActionInput = types.ActionDefinition['input']\ntype ActionOutput = types.ActionDefinition['output']\n\nexport class ActionInputModule extends Module {\n public constructor(private _input: ActionInput) {\n const name = 'input'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._input.schema, this.exportName)\n }\n}\n\nexport class ActionOutputModule extends Module {\n public constructor(private _output: ActionOutput) {\n const name = 'output'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._output.schema, this.exportName)\n }\n}\n\nexport class ActionModule extends ReExportVariableModule {\n public constructor(actionName: string, action: types.ActionDefinition) {\n super({\n exportName: strings.varName(actionName),\n extraProps: {\n ...gen.primitiveRecordToTypescriptValues({\n title: action.title,\n description: action.description,\n billable: action.billable,\n cacheable: action.cacheable,\n }),\n ...(action.attributes ? { attributes: gen.stringifySingleLine(action.attributes) } : undefined),\n },\n })\n\n const inputModule = new ActionInputModule(action.input)\n const outputModule = new ActionOutputModule(action.output)\n\n this.pushDep(inputModule)\n this.pushDep(outputModule)\n }\n}\n\nexport class ActionsModule extends ReExportVariableModule {\n public constructor(actions: Record<string, types.ActionDefinition>) {\n super({ exportName: strings.varName('actions') })\n for (const [actionName, action] of Object.entries(actions)) {\n const module = new ActionModule(actionName, action)\n module.unshift(actionName)\n this.pushDep(module)\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;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ACjD,YAAY,SAAiD;AAClE,UAAM,EAAE,YAAY,QAAQ,QAAQ,SAAS,EAAE,CAAC;AAChD,eAAW,CAAC,YAAY,MAAM,KAAK,OAAO,QAAQ,OAAO,GAAG;AAC1D,YAAMA,UAAS,IAAI,aAAa,YAAY,MAAM;AAClD,MAAAA,QAAO,QAAQ,UAAU;AACzB,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
6
6
  "names": ["module"]
7
7
  }
@@ -64,12 +64,15 @@ class ActionModule extends import_module.ReExportVariableModule {
64
64
  constructor(actionName, action) {
65
65
  super({
66
66
  exportName: strings.varName(actionName),
67
- extraProps: gen.primitiveRecordToTypescriptValues({
68
- title: action.title,
69
- description: action.description,
70
- billable: action.billable,
71
- cacheable: action.cacheable
72
- })
67
+ extraProps: {
68
+ ...gen.primitiveRecordToTypescriptValues({
69
+ title: action.title,
70
+ description: action.description,
71
+ billable: action.billable,
72
+ cacheable: action.cacheable
73
+ }),
74
+ ...action.attributes ? { attributes: gen.stringifySingleLine(action.attributes) } : void 0
75
+ }
73
76
  });
74
77
  const inputModule = new ActionInputModule(action.input);
75
78
  const outputModule = new ActionOutputModule(action.output);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/code-generation/interface-package/interface-package-definition/actions-module.ts"],
4
- "sourcesContent": ["import { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport * as gen from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\ntype ActionInput = types.ActionDefinition['input']\ntype ActionOutput = types.ActionDefinition['output']\n\nexport class ActionInputModule extends Module {\n public constructor(private _input: ActionInput) {\n const name = 'input'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._input.schema, this.exportName)\n }\n}\n\nexport class ActionOutputModule extends Module {\n public constructor(private _output: ActionOutput) {\n const name = 'output'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._output.schema, this.exportName)\n }\n}\n\nexport class ActionModule extends ReExportVariableModule {\n public constructor(actionName: string, action: types.ActionDefinition) {\n super({\n exportName: strings.varName(actionName),\n extraProps: gen.primitiveRecordToTypescriptValues({\n title: action.title,\n description: action.description,\n billable: action.billable,\n cacheable: action.cacheable,\n }),\n })\n\n const inputModule = new ActionInputModule(action.input)\n const outputModule = new ActionOutputModule(action.output)\n\n this.pushDep(inputModule)\n this.pushDep(outputModule)\n }\n}\n\nexport class ActionsModule extends ReExportVariableModule {\n public constructor(actions: Record<string, types.ActionDefinition>) {\n super({ exportName: strings.varName('actions') })\n for (const [actionName, action] of Object.entries(actions)) {\n const module = new ActionModule(actionName, action)\n module.unshift(actionName)\n this.pushDep(module)\n }\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAgD;AAChD,UAAqB;AACrB,oBAA+C;AAC/C,cAAyB;AAMlB,MAAM,0BAA0B,qBAAO;AAAA,EACrC,YAAoB,QAAqB;AAC9C,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,QAAQ,IAAI;AACvC,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHf;AAAA,EAI3B;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,mDAAgC,KAAK,OAAO,QAAQ,KAAK,UAAU;AAAA,EAC5E;AACF;AAEO,MAAM,2BAA2B,qBAAO;AAAA,EACtC,YAAoB,SAAuB;AAChD,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,QAAQ,IAAI;AACvC,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHf;AAAA,EAI3B;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,mDAAgC,KAAK,QAAQ,QAAQ,KAAK,UAAU;AAAA,EAC7E;AACF;AAEO,MAAM,qBAAqB,qCAAuB;AAAA,EAChD,YAAY,YAAoB,QAAgC;AACrE,UAAM;AAAA,MACJ,YAAY,QAAQ,QAAQ,UAAU;AAAA,MACtC,YAAY,IAAI,kCAAkC;AAAA,QAChD,OAAO,OAAO;AAAA,QACd,aAAa,OAAO;AAAA,QACpB,UAAU,OAAO;AAAA,QACjB,WAAW,OAAO;AAAA,MACpB,CAAC;AAAA,IACH,CAAC;AAED,UAAM,cAAc,IAAI,kBAAkB,OAAO,KAAK;AACtD,UAAM,eAAe,IAAI,mBAAmB,OAAO,MAAM;AAEzD,SAAK,QAAQ,WAAW;AACxB,SAAK,QAAQ,YAAY;AAAA,EAC3B;AACF;AAEO,MAAM,sBAAsB,qCAAuB;AAAA,EACjD,YAAY,SAAiD;AAClE,UAAM,EAAE,YAAY,QAAQ,QAAQ,SAAS,EAAE,CAAC;AAChD,eAAW,CAAC,YAAY,MAAM,KAAK,OAAO,QAAQ,OAAO,GAAG;AAC1D,YAAMA,UAAS,IAAI,aAAa,YAAY,MAAM;AAClD,MAAAA,QAAO,QAAQ,UAAU;AACzB,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { jsonSchemaToTypescriptZuiSchema } from '../../generators'\nimport * as gen from '../../generators'\nimport { Module, ReExportVariableModule } from '../../module'\nimport * as strings from '../../strings'\nimport * as types from './typings'\n\ntype ActionInput = types.ActionDefinition['input']\ntype ActionOutput = types.ActionDefinition['output']\n\nexport class ActionInputModule extends Module {\n public constructor(private _input: ActionInput) {\n const name = 'input'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._input.schema, this.exportName)\n }\n}\n\nexport class ActionOutputModule extends Module {\n public constructor(private _output: ActionOutput) {\n const name = 'output'\n const exportName = strings.varName(name)\n super({ path: `${name}.ts`, exportName })\n }\n\n public async getContent() {\n return jsonSchemaToTypescriptZuiSchema(this._output.schema, this.exportName)\n }\n}\n\nexport class ActionModule extends ReExportVariableModule {\n public constructor(actionName: string, action: types.ActionDefinition) {\n super({\n exportName: strings.varName(actionName),\n extraProps: {\n ...gen.primitiveRecordToTypescriptValues({\n title: action.title,\n description: action.description,\n billable: action.billable,\n cacheable: action.cacheable,\n }),\n ...(action.attributes ? { attributes: gen.stringifySingleLine(action.attributes) } : undefined),\n },\n })\n\n const inputModule = new ActionInputModule(action.input)\n const outputModule = new ActionOutputModule(action.output)\n\n this.pushDep(inputModule)\n this.pushDep(outputModule)\n }\n}\n\nexport class ActionsModule extends ReExportVariableModule {\n public constructor(actions: Record<string, types.ActionDefinition>) {\n super({ exportName: strings.varName('actions') })\n for (const [actionName, action] of Object.entries(actions)) {\n const module = new ActionModule(actionName, action)\n module.unshift(actionName)\n this.pushDep(module)\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAgD;AAChD,UAAqB;AACrB,oBAA+C;AAC/C,cAAyB;AAMlB,MAAM,0BAA0B,qBAAO;AAAA,EACrC,YAAoB,QAAqB;AAC9C,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,QAAQ,IAAI;AACvC,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHf;AAAA,EAI3B;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,mDAAgC,KAAK,OAAO,QAAQ,KAAK,UAAU;AAAA,EAC5E;AACF;AAEO,MAAM,2BAA2B,qBAAO;AAAA,EACtC,YAAoB,SAAuB;AAChD,UAAM,OAAO;AACb,UAAM,aAAa,QAAQ,QAAQ,IAAI;AACvC,UAAM,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC;AAHf;AAAA,EAI3B;AAAA,EAEA,MAAa,aAAa;AACxB,eAAO,mDAAgC,KAAK,QAAQ,QAAQ,KAAK,UAAU;AAAA,EAC7E;AACF;AAEO,MAAM,qBAAqB,qCAAuB;AAAA,EAChD,YAAY,YAAoB,QAAgC;AACrE,UAAM;AAAA,MACJ,YAAY,QAAQ,QAAQ,UAAU;AAAA,MACtC,YAAY;AAAA,QACV,GAAG,IAAI,kCAAkC;AAAA,UACvC,OAAO,OAAO;AAAA,UACd,aAAa,OAAO;AAAA,UACpB,UAAU,OAAO;AAAA,UACjB,WAAW,OAAO;AAAA,QACpB,CAAC;AAAA,QACD,GAAI,OAAO,aAAa,EAAE,YAAY,IAAI,oBAAoB,OAAO,UAAU,EAAE,IAAI;AAAA,MACvF;AAAA,IACF,CAAC;AAED,UAAM,cAAc,IAAI,kBAAkB,OAAO,KAAK;AACtD,UAAM,eAAe,IAAI,mBAAmB,OAAO,MAAM;AAEzD,SAAK,QAAQ,WAAW;AACxB,SAAK,QAAQ,YAAY;AAAA,EAC3B;AACF;AAEO,MAAM,sBAAsB,qCAAuB;AAAA,EACjD,YAAY,SAAiD;AAClE,UAAM,EAAE,YAAY,QAAQ,QAAQ,SAAS,EAAE,CAAC;AAChD,eAAW,CAAC,YAAY,MAAM,KAAK,OAAO,QAAQ,OAAO,GAAG;AAC1D,YAAMA,UAAS,IAAI,aAAa,YAAY,MAAM;AAClD,MAAAA,QAAO,QAAQ,UAAU;AACzB,WAAK,QAAQA,OAAM;AAAA,IACrB;AAAA,EACF;AACF;",
6
6
  "names": ["module"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/code-generation/typings.ts"],
4
- "sourcesContent": ["import * as client from '@botpress/client'\nimport * as utils from '../utils'\n\ntype NameVersion = { name: string; version: string }\ntype PackageRef = { id?: string; name: string; version: string }\ntype Schema = Record<string, any>\ntype Aliases = Record<string, { name: string }>\n\ntype TitleDescription = { title?: string; description?: string }\ntype Tags = { tags: Record<string, {}> }\ntype InputOutput = { input: { schema: Schema }; output: { schema: Schema } }\n\nexport type File = { path: string; content: string }\n\nexport type IntegrationDefinition = PackageRef & {\n interfaces?: Record<\n string,\n {\n id?: string\n entities?: Aliases\n actions?: Aliases\n events?: Aliases\n channels?: Aliases\n }\n >\n configuration?: TitleDescription & {\n schema?: Schema\n }\n configurations?: Record<\n string,\n TitleDescription & {\n schema?: Schema\n }\n >\n channels?: Record<\n string,\n TitleDescription & {\n messages: Record<string, TitleDescription & { schema: Schema }>\n conversation?: {\n tags?: Record<string, {}>\n creation?: {\n enabled: boolean\n requiredTags: string[]\n }\n }\n message?: {\n tags?: Record<string, {}>\n }\n }\n >\n states?: Record<\n string,\n TitleDescription & {\n type: client.State['type']\n schema: Schema\n }\n >\n events?: Record<string, TitleDescription & { schema: Schema }>\n actions?: Record<\n string,\n TitleDescription & {\n billable?: boolean\n cacheable?: boolean\n input: {\n schema: Schema\n }\n output: {\n schema: Schema\n }\n }\n >\n entities?: Record<string, TitleDescription & { schema: Schema }>\n user?: {\n tags?: Record<string, {}>\n creation?: {\n enabled: boolean\n requiredTags: string[]\n }\n }\n}\n\nexport type InterfaceDefinition = PackageRef & {\n entities?: Record<string, TitleDescription & { schema: Schema }>\n events?: Record<string, TitleDescription & { schema: Schema }>\n actions?: Record<\n string,\n TitleDescription & {\n billable?: boolean\n cacheable?: boolean\n input: { schema: Schema }\n output: { schema: Schema }\n }\n >\n channels?: Record<string, TitleDescription & { messages: Record<string, TitleDescription & { schema: Schema }> }>\n}\n\nexport type RecurringEventDefinition = {\n type: string\n payload: Record<string, any>\n schedule: { cron: string }\n}\n\nexport type PluginDefinition = PackageRef & {\n configuration?: TitleDescription & { schema?: Schema }\n user?: { tags: Record<string, {}> }\n conversation?: Tags\n states?: Record<string, TitleDescription & { type: client.State['type']; schema: Schema }>\n events?: Record<string, TitleDescription & { schema: Schema }>\n actions?: Record<string, TitleDescription & InputOutput>\n workflows?: Record<string, TitleDescription & Tags & InputOutput>\n dependencies?: {\n interfaces?: Record<string, PackageRef>\n integrations?: Record<string, PackageRef>\n }\n recurringEvents?: Record<string, RecurringEventDefinition>\n}\n\nexport type IntegrationInstallablePackage = NameVersion & {\n integration: IntegrationDefinition\n devId?: string\n path?: utils.path.AbsolutePath\n}\n\nexport type InterfaceInstallablePackage = NameVersion & {\n interface: InterfaceDefinition\n path?: utils.path.AbsolutePath\n}\n\nexport type PluginInstallablePackage = NameVersion & {\n plugin: PluginDefinition\n path?: utils.path.AbsolutePath\n code: string\n}\n"],
4
+ "sourcesContent": ["import * as client from '@botpress/client'\nimport * as utils from '../utils'\n\ntype NameVersion = { name: string; version: string }\ntype PackageRef = { id?: string; name: string; version: string }\ntype Schema = Record<string, any>\ntype Aliases = Record<string, { name: string }>\n\ntype TitleDescription = { title?: string; description?: string }\ntype Tags = { tags: Record<string, {}> }\ntype InputOutput = { input: { schema: Schema }; output: { schema: Schema } }\n\nexport type File = { path: string; content: string }\n\nexport type IntegrationDefinition = PackageRef & {\n interfaces?: Record<\n string,\n {\n id?: string\n entities?: Aliases\n actions?: Aliases\n events?: Aliases\n channels?: Aliases\n }\n >\n configuration?: TitleDescription & {\n schema?: Schema\n }\n configurations?: Record<\n string,\n TitleDescription & {\n schema?: Schema\n }\n >\n channels?: Record<\n string,\n TitleDescription & {\n messages: Record<string, TitleDescription & { schema: Schema }>\n conversation?: {\n tags?: Record<string, {}>\n creation?: {\n enabled: boolean\n requiredTags: string[]\n }\n }\n message?: {\n tags?: Record<string, {}>\n }\n }\n >\n states?: Record<\n string,\n TitleDescription & {\n type: client.State['type']\n schema: Schema\n }\n >\n events?: Record<string, TitleDescription & { schema: Schema }>\n actions?: Record<\n string,\n TitleDescription & {\n billable?: boolean\n cacheable?: boolean\n input: {\n schema: Schema\n }\n output: {\n schema: Schema\n }\n attributes?: Record<string, string>\n }\n >\n entities?: Record<string, TitleDescription & { schema: Schema }>\n user?: {\n tags?: Record<string, {}>\n creation?: {\n enabled: boolean\n requiredTags: string[]\n }\n }\n}\n\nexport type InterfaceDefinition = PackageRef & {\n entities?: Record<string, TitleDescription & { schema: Schema }>\n events?: Record<string, TitleDescription & { schema: Schema }>\n actions?: Record<\n string,\n TitleDescription & {\n billable?: boolean\n cacheable?: boolean\n input: { schema: Schema }\n output: { schema: Schema }\n attributes?: Record<string, string>\n }\n >\n channels?: Record<string, TitleDescription & { messages: Record<string, TitleDescription & { schema: Schema }> }>\n}\n\nexport type RecurringEventDefinition = {\n type: string\n payload: Record<string, any>\n schedule: { cron: string }\n}\n\nexport type PluginDefinition = PackageRef & {\n configuration?: TitleDescription & { schema?: Schema }\n user?: { tags: Record<string, {}> }\n conversation?: Tags\n states?: Record<string, TitleDescription & { type: client.State['type']; schema: Schema }>\n events?: Record<string, TitleDescription & { schema: Schema }>\n actions?: Record<string, TitleDescription & InputOutput>\n workflows?: Record<string, TitleDescription & Tags & InputOutput>\n dependencies?: {\n interfaces?: Record<string, PackageRef>\n integrations?: Record<string, PackageRef>\n }\n recurringEvents?: Record<string, RecurringEventDefinition>\n}\n\nexport type IntegrationInstallablePackage = NameVersion & {\n integration: IntegrationDefinition\n devId?: string\n path?: utils.path.AbsolutePath\n}\n\nexport type InterfaceInstallablePackage = NameVersion & {\n interface: InterfaceDefinition\n path?: utils.path.AbsolutePath\n}\n\nexport type PluginInstallablePackage = NameVersion & {\n plugin: PluginDefinition\n path?: utils.path.AbsolutePath\n code: string\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/cli",
3
- "version": "4.1.1",
3
+ "version": "4.2.0",
4
4
  "description": "Botpress CLI",
5
5
  "scripts": {
6
6
  "build": "pnpm run bundle && pnpm run template:gen",
@@ -21,8 +21,8 @@
21
21
  "dependencies": {
22
22
  "@apidevtools/json-schema-ref-parser": "^11.7.0",
23
23
  "@botpress/chat": "0.5.1",
24
- "@botpress/client": "1.5.0",
25
- "@botpress/sdk": "4.0.7",
24
+ "@botpress/client": "1.6.0",
25
+ "@botpress/sdk": "4.1.0",
26
26
  "@bpinternal/const": "^0.1.0",
27
27
  "@bpinternal/tunnel": "^0.1.1",
28
28
  "@bpinternal/yargs-extra": "^0.0.3",
@@ -5,8 +5,8 @@
5
5
  },
6
6
  "private": true,
7
7
  "dependencies": {
8
- "@botpress/client": "1.5.0",
9
- "@botpress/sdk": "4.0.7"
8
+ "@botpress/client": "1.6.0",
9
+ "@botpress/sdk": "4.1.0"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/node": "^18.19.67",
@@ -6,8 +6,8 @@
6
6
  },
7
7
  "private": true,
8
8
  "dependencies": {
9
- "@botpress/client": "1.5.0",
10
- "@botpress/sdk": "4.0.7"
9
+ "@botpress/client": "1.6.0",
10
+ "@botpress/sdk": "4.1.0"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^18.19.67",
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "private": true,
8
8
  "dependencies": {
9
- "@botpress/sdk": "4.0.7"
9
+ "@botpress/sdk": "4.1.0"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/node": "^18.19.67",
@@ -6,8 +6,8 @@
6
6
  },
7
7
  "private": true,
8
8
  "dependencies": {
9
- "@botpress/client": "1.5.0",
10
- "@botpress/sdk": "4.0.7"
9
+ "@botpress/client": "1.6.0",
10
+ "@botpress/sdk": "4.1.0"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^18.19.67",
@@ -6,8 +6,8 @@
6
6
  },
7
7
  "private": true,
8
8
  "dependencies": {
9
- "@botpress/client": "1.5.0",
10
- "@botpress/sdk": "4.0.7",
9
+ "@botpress/client": "1.6.0",
10
+ "@botpress/sdk": "4.1.0",
11
11
  "axios": "^1.6.8"
12
12
  },
13
13
  "devDependencies": {