@botpress/cli 6.3.0 → 6.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +12 -12
- package/dist/api/bot-body.js +4 -1
- package/dist/api/bot-body.js.map +2 -2
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +2 -2
- package/dist/utils/integration-utils.d.ts +5 -0
- package/dist/utils/integration-utils.js +36 -0
- package/dist/utils/integration-utils.js.map +7 -0
- package/dist/utils/integration-utils.test.d.ts +1 -0
- package/dist/utils/integration-utils.test.js +16 -0
- package/dist/utils/integration-utils.test.js.map +7 -0
- package/package.json +2 -2
- package/templates/empty-bot/package.json +1 -1
- package/templates/empty-integration/package.json +1 -1
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +1 -1
- package/templates/webhook-message/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@6.3.
|
|
2
|
+
> @botpress/cli@6.3.2 build /home/runner/work/botpress/botpress/packages/cli
|
|
3
3
|
> pnpm run build:types && pnpm run bundle && pnpm run template:gen
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/cli@6.3.
|
|
6
|
+
> @botpress/cli@6.3.2 build:types /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> tsc -p ./tsconfig.build.json
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@6.3.
|
|
10
|
+
> @botpress/cli@6.3.2 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
11
11
|
> ts-node -T build.ts
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
> @botpress/cli@6.3.
|
|
14
|
+
> @botpress/cli@6.3.2 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 v6.3.
|
|
17
|
+
🤖 Botpress CLI v6.3.2
|
|
18
18
|
● Checking if cli is up to date
|
|
19
|
-
🤖 Botpress CLI v6.3.
|
|
19
|
+
🤖 Botpress CLI v6.3.2
|
|
20
20
|
● Checking if cli is up to date
|
|
21
|
-
🤖 Botpress CLI v6.3.
|
|
21
|
+
🤖 Botpress CLI v6.3.2
|
|
22
|
+
🤖 Botpress CLI v6.3.2
|
|
22
23
|
● Checking if cli is up to date
|
|
23
|
-
🤖 Botpress CLI v6.3.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 bot...
|
|
30
|
-
○ Generating typings for plugin empty-plugin...
|
|
31
29
|
○ Generating typings for integration empty-integration...
|
|
32
30
|
✓ Typings available at .botpress
|
|
33
31
|
|
|
32
|
+
○ Generating typings for integration hello-world...
|
|
33
|
+
○ Generating typings for bot...
|
|
34
|
+
○ Generating typings for plugin empty-plugin...
|
|
34
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 v6.3.
|
|
41
|
+
🤖 Botpress CLI v6.3.2
|
|
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...
|
package/dist/api/bot-body.js
CHANGED
|
@@ -105,7 +105,10 @@ const prepareUpdateBotBody = (localBot, remoteBot) => ({
|
|
|
105
105
|
...localBot.message,
|
|
106
106
|
tags: utils.records.setNullOnMissingValues(localBot.message?.tags, remoteBot.message?.tags)
|
|
107
107
|
},
|
|
108
|
-
integrations: utils.
|
|
108
|
+
integrations: utils.integrations.prepareIntegrationsUpdate(
|
|
109
|
+
utils.records.setNullOnMissingValues(localBot.integrations, remoteBot.integrations),
|
|
110
|
+
remoteBot.integrations
|
|
111
|
+
),
|
|
109
112
|
plugins: utils.records.setNullOnMissingValues(localBot.plugins, remoteBot.plugins),
|
|
110
113
|
tags: localBot.tags
|
|
111
114
|
// TODO: allow removing bot tags (aka attributes) by setting to null
|
package/dist/api/bot-body.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/api/bot-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 prepareCreateBotBody = async (bot: sdk.BotDefinition): Promise<types.CreateBotRequestBody> => ({\n user: bot.user,\n conversation: bot.conversation,\n message: bot.message,\n recurringEvents: bot.recurringEvents,\n actions: bot.actions\n ? await utils.records.mapValuesAsync(bot.actions, async (action) => ({\n ...action,\n input: {\n ...action.input,\n schema: await utils.schema.mapZodToJsonSchema(action.input, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n },\n output: {\n ...action.output,\n schema: await utils.schema.mapZodToJsonSchema(action.output, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n },\n }))\n : undefined,\n configuration: bot.configuration\n ? {\n ...bot.configuration,\n schema: await utils.schema.mapZodToJsonSchema(bot.configuration, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n }\n : undefined,\n events: bot.events\n ? await utils.records.mapValuesAsync(bot.events, async (event) => ({\n ...event,\n schema: await utils.schema.mapZodToJsonSchema(event, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n }))\n : undefined,\n states: bot.states\n ? (utils.records.filterValues(\n await utils.records.mapValuesAsync(bot.states, async (state) => ({\n ...state,\n schema: await utils.schema.mapZodToJsonSchema(state, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n })),\n ({ type }) => type !== 'workflow'\n ) as types.CreateBotRequestBody['states'])\n : undefined,\n tags: bot.attributes,\n})\n\nexport const prepareUpdateBotBody = (\n localBot: types.UpdateBotRequestBody,\n remoteBot: client.Bot\n): types.UpdateBotRequestBody => ({\n ...localBot,\n states: utils.records.setNullOnMissingValues(localBot.states, remoteBot.states),\n recurringEvents: utils.records.setNullOnMissingValues(localBot.recurringEvents, remoteBot.recurringEvents),\n events: utils.attributes.prepareAttributeUpdateBody({\n localItems: utils.records.setNullOnMissingValues(localBot.events, remoteBot.events),\n remoteItems: remoteBot.events,\n }),\n actions: utils.attributes.prepareAttributeUpdateBody({\n localItems: utils.records.setNullOnMissingValues(localBot.actions, remoteBot.actions),\n remoteItems: remoteBot.actions,\n }),\n user: {\n ...localBot.user,\n tags: utils.records.setNullOnMissingValues(localBot.user?.tags, remoteBot.user?.tags),\n },\n conversation: {\n ...localBot.conversation,\n tags: utils.records.setNullOnMissingValues(localBot.conversation?.tags, remoteBot.conversation?.tags),\n },\n message: {\n ...localBot.message,\n tags: utils.records.setNullOnMissingValues(localBot.message?.tags, remoteBot.message?.tags),\n },\n integrations: utils.records.setNullOnMissingValues(localBot.integrations, remoteBot.integrations),\n plugins: utils.records.setNullOnMissingValues(localBot.plugins, remoteBot.plugins),\n tags: localBot.tags, // TODO: allow removing bot tags (aka attributes) by setting to null\n})\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAu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\nimport * as utils from '../utils'\nimport * as types from './types'\n\nexport const prepareCreateBotBody = async (bot: sdk.BotDefinition): Promise<types.CreateBotRequestBody> => ({\n user: bot.user,\n conversation: bot.conversation,\n message: bot.message,\n recurringEvents: bot.recurringEvents,\n actions: bot.actions\n ? await utils.records.mapValuesAsync(bot.actions, async (action) => ({\n ...action,\n input: {\n ...action.input,\n schema: await utils.schema.mapZodToJsonSchema(action.input, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n },\n output: {\n ...action.output,\n schema: await utils.schema.mapZodToJsonSchema(action.output, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n },\n }))\n : undefined,\n configuration: bot.configuration\n ? {\n ...bot.configuration,\n schema: await utils.schema.mapZodToJsonSchema(bot.configuration, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n }\n : undefined,\n events: bot.events\n ? await utils.records.mapValuesAsync(bot.events, async (event) => ({\n ...event,\n schema: await utils.schema.mapZodToJsonSchema(event, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n }))\n : undefined,\n states: bot.states\n ? (utils.records.filterValues(\n await utils.records.mapValuesAsync(bot.states, async (state) => ({\n ...state,\n schema: await utils.schema.mapZodToJsonSchema(state, {\n useLegacyZuiTransformer: bot.__advanced?.useLegacyZuiTransformer,\n toJSONSchemaOptions: bot.__advanced?.toJSONSchemaOptions,\n }),\n })),\n ({ type }) => type !== 'workflow'\n ) as types.CreateBotRequestBody['states'])\n : undefined,\n tags: bot.attributes,\n})\n\nexport const prepareUpdateBotBody = (\n localBot: types.UpdateBotRequestBody,\n remoteBot: client.Bot\n): types.UpdateBotRequestBody => ({\n ...localBot,\n states: utils.records.setNullOnMissingValues(localBot.states, remoteBot.states),\n recurringEvents: utils.records.setNullOnMissingValues(localBot.recurringEvents, remoteBot.recurringEvents),\n events: utils.attributes.prepareAttributeUpdateBody({\n localItems: utils.records.setNullOnMissingValues(localBot.events, remoteBot.events),\n remoteItems: remoteBot.events,\n }),\n actions: utils.attributes.prepareAttributeUpdateBody({\n localItems: utils.records.setNullOnMissingValues(localBot.actions, remoteBot.actions),\n remoteItems: remoteBot.actions,\n }),\n user: {\n ...localBot.user,\n tags: utils.records.setNullOnMissingValues(localBot.user?.tags, remoteBot.user?.tags),\n },\n conversation: {\n ...localBot.conversation,\n tags: utils.records.setNullOnMissingValues(localBot.conversation?.tags, remoteBot.conversation?.tags),\n },\n message: {\n ...localBot.message,\n tags: utils.records.setNullOnMissingValues(localBot.message?.tags, remoteBot.message?.tags),\n },\n integrations: utils.integrations.prepareIntegrationsUpdate(\n utils.records.setNullOnMissingValues(localBot.integrations, remoteBot.integrations),\n remoteBot.integrations\n ),\n plugins: utils.records.setNullOnMissingValues(localBot.plugins, remoteBot.plugins),\n tags: localBot.tags, // TODO: allow removing bot tags (aka attributes) by setting to null\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAGhB,MAAM,uBAAuB,OAAO,SAAiE;AAAA,EAC1G,MAAM,IAAI;AAAA,EACV,cAAc,IAAI;AAAA,EAClB,SAAS,IAAI;AAAA,EACb,iBAAiB,IAAI;AAAA,EACrB,SAAS,IAAI,UACT,MAAM,MAAM,QAAQ,eAAe,IAAI,SAAS,OAAO,YAAY;AAAA,IACjE,GAAG;AAAA,IACH,OAAO;AAAA,MACL,GAAG,OAAO;AAAA,MACV,QAAQ,MAAM,MAAM,OAAO,mBAAmB,OAAO,OAAO;AAAA,QAC1D,yBAAyB,IAAI,YAAY;AAAA,QACzC,qBAAqB,IAAI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,uBAAuB,SAAS,iBAAiB,UAAU,eAAe;AAAA,EACzG,QAAQ,MAAM,WAAW,2BAA2B;AAAA,IAClD,YAAY,MAAM,QAAQ,uBAAuB,SAAS,QAAQ,UAAU,MAAM;AAAA,IAClF,aAAa,UAAU;AAAA,EACzB,CAAC;AAAA,EACD,SAAS,MAAM,WAAW,2BAA2B;AAAA,IACnD,YAAY,MAAM,QAAQ,uBAAuB,SAAS,SAAS,UAAU,OAAO;AAAA,IACpF,aAAa,UAAU;AAAA,EACzB,CAAC;AAAA,EACD,MAAM;AAAA,IACJ,GAAG,SAAS;AAAA,IACZ,MAAM,MAAM,QAAQ,uBAAuB,SAAS,MAAM,MAAM,UAAU,MAAM,IAAI;AAAA,EACtF;AAAA,EACA,cAAc;AAAA,IACZ,GAAG,SAAS;AAAA,IACZ,MAAM,MAAM,QAAQ,uBAAuB,SAAS,cAAc,MAAM,UAAU,cAAc,IAAI;AAAA,EACtG;AAAA,EACA,SAAS;AAAA,IACP,GAAG,SAAS;AAAA,IACZ,MAAM,MAAM,QAAQ,uBAAuB,SAAS,SAAS,MAAM,UAAU,SAAS,IAAI;AAAA,EAC5F;AAAA,EACA,cAAc,MAAM,aAAa;AAAA,IAC/B,MAAM,QAAQ,uBAAuB,SAAS,cAAc,UAAU,YAAY;AAAA,IAClF,UAAU;AAAA,EACZ;AAAA,EACA,SAAS,MAAM,QAAQ,uBAAuB,SAAS,SAAS,UAAU,OAAO;AAAA,EACjF,MAAM,SAAS;AAAA;AACjB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * as esbuild from './esbuild-utils';
|
|
|
6
6
|
export * as filewatcher from './file-watcher';
|
|
7
7
|
export * as guards from './guard-utils';
|
|
8
8
|
export * as id from './id-utils';
|
|
9
|
+
export * as integrations from './integration-utils';
|
|
9
10
|
export * as json from './json-utils';
|
|
10
11
|
export * as object from './object-utils';
|
|
11
12
|
export * as path from './path-utils';
|
package/dist/utils/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(utils_exports, {
|
|
|
36
36
|
filewatcher: () => filewatcher,
|
|
37
37
|
guards: () => guards,
|
|
38
38
|
id: () => id,
|
|
39
|
+
integrations: () => integrations,
|
|
39
40
|
json: () => json,
|
|
40
41
|
object: () => object,
|
|
41
42
|
path: () => path,
|
|
@@ -62,6 +63,7 @@ var esbuild = __toESM(require("./esbuild-utils"));
|
|
|
62
63
|
var filewatcher = __toESM(require("./file-watcher"));
|
|
63
64
|
var guards = __toESM(require("./guard-utils"));
|
|
64
65
|
var id = __toESM(require("./id-utils"));
|
|
66
|
+
var integrations = __toESM(require("./integration-utils"));
|
|
65
67
|
var json = __toESM(require("./json-utils"));
|
|
66
68
|
var object = __toESM(require("./object-utils"));
|
|
67
69
|
var path = __toESM(require("./path-utils"));
|
|
@@ -88,6 +90,7 @@ var vrl = __toESM(require("./vrl-utils"));
|
|
|
88
90
|
filewatcher,
|
|
89
91
|
guards,
|
|
90
92
|
id,
|
|
93
|
+
integrations,
|
|
91
94
|
json,
|
|
92
95
|
object,
|
|
93
96
|
path,
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * as attributes from './attribute-utils'\nexport * as cache from './cache-utils'\nexport * as casing from './case-utils'\nexport * as emitter from './event-emitter'\nexport * as esbuild from './esbuild-utils'\nexport * as filewatcher from './file-watcher'\nexport * as guards from './guard-utils'\nexport * as id from './id-utils'\nexport * as json from './json-utils'\nexport * as object from './object-utils'\nexport * as path from './path-utils'\nexport * as pkgJson from './pkgjson-utils'\nexport * as promises from './promise-utils'\nexport * as prompt from './prompt-utils'\nexport * as records from './record-utils'\nexport * as require from './require-utils'\nexport * as schema from './schema-utils'\nexport * as semver from './semver-utils'\nexport * as string from './string-utils'\nexport * as template from './template-utils'\nexport * as tunnel from './tunnel-utils'\nexport * as types from './type-utils'\nexport * as url from './url-utils'\nexport * as vrl from './vrl-utils'\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA4B;AAC5B,YAAuB;AACvB,aAAwB;AACxB,cAAyB;AACzB,cAAyB;AACzB,kBAA6B;AAC7B,aAAwB;AACxB,SAAoB;AACpB,WAAsB;AACtB,aAAwB;AACxB,WAAsB;AACtB,cAAyB;AACzB,eAA0B;AAC1B,aAAwB;AACxB,cAAyB;AACzB,IAAAA,WAAyB;AACzB,aAAwB;AACxB,aAAwB;AACxB,aAAwB;AACxB,eAA0B;AAC1B,aAAwB;AACxB,YAAuB;AACvB,UAAqB;AACrB,UAAqB;",
|
|
4
|
+
"sourcesContent": ["export * as attributes from './attribute-utils'\nexport * as cache from './cache-utils'\nexport * as casing from './case-utils'\nexport * as emitter from './event-emitter'\nexport * as esbuild from './esbuild-utils'\nexport * as filewatcher from './file-watcher'\nexport * as guards from './guard-utils'\nexport * as id from './id-utils'\nexport * as integrations from './integration-utils'\nexport * as json from './json-utils'\nexport * as object from './object-utils'\nexport * as path from './path-utils'\nexport * as pkgJson from './pkgjson-utils'\nexport * as promises from './promise-utils'\nexport * as prompt from './prompt-utils'\nexport * as records from './record-utils'\nexport * as require from './require-utils'\nexport * as schema from './schema-utils'\nexport * as semver from './semver-utils'\nexport * as string from './string-utils'\nexport * as template from './template-utils'\nexport * as tunnel from './tunnel-utils'\nexport * as types from './type-utils'\nexport * as url from './url-utils'\nexport * as vrl from './vrl-utils'\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA4B;AAC5B,YAAuB;AACvB,aAAwB;AACxB,cAAyB;AACzB,cAAyB;AACzB,kBAA6B;AAC7B,aAAwB;AACxB,SAAoB;AACpB,mBAA8B;AAC9B,WAAsB;AACtB,aAAwB;AACxB,WAAsB;AACtB,cAAyB;AACzB,eAA0B;AAC1B,aAAwB;AACxB,cAAyB;AACzB,IAAAA,WAAyB;AACzB,aAAwB;AACxB,aAAwB;AACxB,aAAwB;AACxB,eAA0B;AAC1B,aAAwB;AACxB,YAAuB;AACvB,UAAqB;AACrB,UAAqB;",
|
|
6
6
|
"names": ["require"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var integration_utils_exports = {};
|
|
20
|
+
__export(integration_utils_exports, {
|
|
21
|
+
prepareIntegrationsUpdate: () => prepareIntegrationsUpdate
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(integration_utils_exports);
|
|
24
|
+
var import_record_utils = require("./record-utils");
|
|
25
|
+
const prepareIntegrationsUpdate = (integrations, remoteIntegrations) => (0, import_record_utils.mapValues)(integrations, (integration, key) => {
|
|
26
|
+
const isExistingInstance = Object.hasOwn(remoteIntegrations, key);
|
|
27
|
+
if (integration !== null && !isExistingInstance && integration.enabled === void 0) {
|
|
28
|
+
return { ...integration, enabled: false };
|
|
29
|
+
}
|
|
30
|
+
return integration;
|
|
31
|
+
});
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
prepareIntegrationsUpdate
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=integration-utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/integration-utils.ts"],
|
|
4
|
+
"sourcesContent": ["import { mapValues } from './record-utils'\n\ntype WithEnabled = { enabled?: boolean }\n\nexport const prepareIntegrationsUpdate = <T extends WithEnabled>(\n integrations: Record<string, T | null>,\n remoteIntegrations: Record<string, unknown>\n): Record<string, T | null> =>\n mapValues(integrations, (integration, key) => {\n const isExistingInstance = Object.hasOwn(remoteIntegrations, key)\n if (integration !== null && !isExistingInstance && integration.enabled === undefined) {\n return { ...integration, enabled: false }\n }\n return integration\n })\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA0B;AAInB,MAAM,4BAA4B,CACvC,cACA,2BAEA,+BAAU,cAAc,CAAC,aAAa,QAAQ;AAC5C,QAAM,qBAAqB,OAAO,OAAO,oBAAoB,GAAG;AAChE,MAAI,gBAAgB,QAAQ,CAAC,sBAAsB,YAAY,YAAY,QAAW;AACpF,WAAO,EAAE,GAAG,aAAa,SAAS,MAAM;AAAA,EAC1C;AACA,SAAO;AACT,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var import_vitest = require("vitest");
|
|
3
|
+
var import_integration_utils = require("./integration-utils");
|
|
4
|
+
(0, import_vitest.test)("new integration with no enabled field should default to enabled: false", () => {
|
|
5
|
+
const result = (0, import_integration_utils.prepareIntegrationsUpdate)({ telegram: {} }, {});
|
|
6
|
+
(0, import_vitest.expect)(result["telegram"]).toMatchObject({ enabled: false });
|
|
7
|
+
});
|
|
8
|
+
(0, import_vitest.test)("new integration with enabled: true should remain enabled: true", () => {
|
|
9
|
+
const result = (0, import_integration_utils.prepareIntegrationsUpdate)({ telegram: { enabled: true } }, {});
|
|
10
|
+
(0, import_vitest.expect)(result["telegram"]).toMatchObject({ enabled: true });
|
|
11
|
+
});
|
|
12
|
+
(0, import_vitest.test)("removed integration passed as null should remain null", () => {
|
|
13
|
+
const result = (0, import_integration_utils.prepareIntegrationsUpdate)({ telegram: null }, { telegram: { enabled: true } });
|
|
14
|
+
(0, import_vitest.expect)(result["telegram"]).toBeNull();
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=integration-utils.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/integration-utils.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { test, expect } from 'vitest'\nimport { prepareIntegrationsUpdate } from './integration-utils'\n\ntest('new integration with no enabled field should default to enabled: false', () => {\n const result = prepareIntegrationsUpdate({ telegram: {} }, {})\n expect(result['telegram']).toMatchObject({ enabled: false })\n})\n\ntest('new integration with enabled: true should remain enabled: true', () => {\n const result = prepareIntegrationsUpdate({ telegram: { enabled: true } }, {})\n expect(result['telegram']).toMatchObject({ enabled: true })\n})\n\ntest('removed integration passed as null should remain null', () => {\n const result = prepareIntegrationsUpdate({ telegram: null }, { telegram: { enabled: true } })\n expect(result['telegram']).toBeNull()\n})\n"],
|
|
5
|
+
"mappings": ";AAAA,oBAA6B;AAC7B,+BAA0C;AAAA,IAE1C,oBAAK,0EAA0E,MAAM;AACnF,QAAM,aAAS,oDAA0B,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7D,4BAAO,OAAO,UAAU,CAAC,EAAE,cAAc,EAAE,SAAS,MAAM,CAAC;AAC7D,CAAC;AAAA,IAED,oBAAK,kEAAkE,MAAM;AAC3E,QAAM,aAAS,oDAA0B,EAAE,UAAU,EAAE,SAAS,KAAK,EAAE,GAAG,CAAC,CAAC;AAC5E,4BAAO,OAAO,UAAU,CAAC,EAAE,cAAc,EAAE,SAAS,KAAK,CAAC;AAC5D,CAAC;AAAA,IAED,oBAAK,yDAAyD,MAAM;AAClE,QAAM,aAAS,oDAA0B,EAAE,UAAU,KAAK,GAAG,EAAE,UAAU,EAAE,SAAS,KAAK,EAAE,CAAC;AAC5F,4BAAO,OAAO,UAAU,CAAC,EAAE,SAAS;AACtC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/cli",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.2",
|
|
4
4
|
"description": "Botpress CLI",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@apidevtools/json-schema-ref-parser": "^11.7.0",
|
|
29
29
|
"@botpress/chat": "0.5.5",
|
|
30
30
|
"@botpress/client": "1.39.0",
|
|
31
|
-
"@botpress/sdk": "6.4.
|
|
31
|
+
"@botpress/sdk": "6.4.4",
|
|
32
32
|
"@bpinternal/const": "^0.1.0",
|
|
33
33
|
"@bpinternal/tunnel": "^0.1.1",
|
|
34
34
|
"@bpinternal/verel": "^0.2.0",
|