@botpress/cli 0.11.6 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -9
- package/dist/api/bot-body.js.map +2 -2
- package/dist/api/client.js +14 -28
- package/dist/api/client.js.map +3 -3
- package/dist/api/find-previous-version.js.map +1 -1
- package/dist/api/index.js +23 -0
- package/dist/api/index.js.map +7 -0
- package/dist/api/interface-body.js +25 -10
- package/dist/api/interface-body.js.map +2 -2
- package/dist/code-generation/bot-implementation/bot-implementation.js +92 -0
- package/dist/code-generation/bot-implementation/bot-implementation.js.map +7 -0
- package/dist/code-generation/{integration-schemas → bot-implementation/bot-typings}/events-module.js +15 -22
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js.map +7 -0
- package/dist/code-generation/bot-implementation/bot-typings/index.js +96 -0
- package/dist/code-generation/bot-implementation/bot-typings/index.js.map +7 -0
- package/dist/code-generation/{integration-schemas → bot-implementation/bot-typings}/states-module.js +17 -22
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js.map +7 -0
- package/dist/code-generation/bot-implementation/index.js +56 -0
- package/dist/code-generation/bot-implementation/index.js.map +7 -0
- package/dist/code-generation/{const.js → consts.js} +9 -4
- package/dist/code-generation/consts.js.map +7 -0
- package/dist/code-generation/generators.js +37 -7
- package/dist/code-generation/generators.js.map +2 -2
- package/dist/code-generation/index.js +15 -105
- package/dist/code-generation/index.js.map +3 -3
- package/dist/code-generation/integration-implementation/index.js +66 -0
- package/dist/code-generation/integration-implementation/index.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-implementation.js +110 -0
- package/dist/code-generation/integration-implementation/integration-implementation.js.map +7 -0
- package/dist/code-generation/{integration-secret.js → integration-implementation/integration-secret.js} +17 -7
- package/dist/code-generation/integration-implementation/integration-secret.js.map +7 -0
- package/dist/code-generation/{integration-schemas → integration-implementation/integration-typings}/actions-module.js +28 -40
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js +103 -0
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js.map +7 -0
- package/dist/code-generation/{integration-schemas → integration-implementation/integration-typings}/configuration-module.js +18 -20
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js.map +7 -0
- package/dist/code-generation/{integration-schemas → integration-implementation/integration-typings}/configurations-module.js +21 -27
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js.map +7 -0
- package/dist/code-generation/{integration-schemas → integration-implementation/integration-typings}/entities-module.js +15 -22
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js +59 -0
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/index.js +128 -0
- package/dist/code-generation/integration-implementation/integration-typings/index.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js +60 -0
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js.map +7 -0
- package/dist/code-generation/integration-package/index.js +81 -0
- package/dist/code-generation/integration-package/index.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js +84 -0
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js +103 -0
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js +58 -0
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js +66 -0
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js +59 -0
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js +62 -0
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/index.js +136 -0
- package/dist/code-generation/integration-package/integration-package-definition/index.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js +62 -0
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/typings.js +17 -0
- package/dist/code-generation/integration-package/integration-package-definition/typings.js.map +7 -0
- package/dist/code-generation/interface-package/index.js +81 -0
- package/dist/code-generation/interface-package/index.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js +84 -0
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js +94 -0
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js +59 -0
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js +62 -0
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/index.js +100 -0
- package/dist/code-generation/interface-package/interface-package-definition/index.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/typings.js +17 -0
- package/dist/code-generation/interface-package/interface-package-definition/typings.js.map +7 -0
- package/dist/code-generation/module.js +60 -16
- package/dist/code-generation/module.js.map +2 -2
- package/dist/code-generation/strings.js +5 -2
- package/dist/code-generation/strings.js.map +2 -2
- package/dist/code-generation/typings.js.map +1 -1
- package/dist/command-implementations/add-command.js +102 -91
- package/dist/command-implementations/add-command.js.map +3 -3
- package/dist/command-implementations/bundle-command.js +16 -9
- package/dist/command-implementations/bundle-command.js.map +2 -2
- package/dist/command-implementations/deploy-command.js +27 -19
- package/dist/command-implementations/deploy-command.js.map +2 -2
- package/dist/command-implementations/dev-command.js +15 -12
- package/dist/command-implementations/dev-command.js.map +2 -2
- package/dist/command-implementations/gen-command.js +31 -12
- package/dist/command-implementations/gen-command.js.map +3 -3
- package/dist/command-implementations/init-command.js +2 -2
- package/dist/command-implementations/init-command.js.map +2 -2
- package/dist/command-implementations/integration-commands.js +5 -5
- package/dist/command-implementations/integration-commands.js.map +2 -2
- package/dist/command-implementations/interface-commands.js +5 -5
- package/dist/command-implementations/interface-commands.js.map +2 -2
- package/dist/command-implementations/lint-command.js +3 -1
- package/dist/command-implementations/lint-command.js.map +3 -3
- package/dist/command-implementations/project-command.js +40 -23
- package/dist/command-implementations/project-command.js.map +3 -3
- package/dist/command-implementations/read-command.js +0 -5
- package/dist/command-implementations/read-command.js.map +2 -2
- package/dist/config.js +22 -7
- package/dist/config.js.map +2 -2
- package/dist/consts.js +15 -6
- package/dist/consts.js.map +2 -2
- package/dist/errors.js +19 -11
- package/dist/errors.js.map +2 -2
- package/dist/logger/index.js +4 -2
- package/dist/logger/index.js.map +2 -2
- package/dist/{integration-ref.js → package-ref.js} +11 -11
- package/dist/package-ref.js.map +7 -0
- package/dist/{integration-ref.test.js → package-ref.test.js} +18 -18
- package/dist/package-ref.test.js.map +7 -0
- package/dist/sdk/index.js +21 -0
- package/dist/sdk/index.js.map +7 -0
- package/dist/sdk/resolve-bot-interfaces.js +38 -0
- package/dist/sdk/resolve-bot-interfaces.js.map +7 -0
- package/dist/sdk/resolve-integration-interfaces.js +148 -0
- package/dist/sdk/resolve-integration-interfaces.js.map +7 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +2 -2
- package/dist/utils/path-utils.js +25 -8
- package/dist/utils/path-utils.js.map +3 -3
- package/dist/utils/path-utils.test.js +69 -0
- package/dist/utils/path-utils.test.js.map +7 -0
- package/dist/utils/record-utils.js +25 -0
- package/dist/utils/record-utils.js.map +3 -3
- package/dist/utils/schema-utils.js +11 -0
- package/dist/utils/schema-utils.js.map +2 -2
- package/dist/utils/schema-utils.test.js +51 -0
- package/dist/utils/schema-utils.test.js.map +7 -0
- package/dist/utils/template-utils.js +47 -0
- package/dist/utils/template-utils.js.map +7 -0
- package/dist/utils/type-utils.js.map +1 -1
- package/e2e/index.ts +2 -0
- package/e2e/tests/install-package.ts +163 -0
- package/e2e/utils.ts +25 -2
- package/package.json +5 -4
- package/templates/empty-bot/.botpress/implementation/index.ts +41 -0
- package/templates/empty-bot/.botpress/implementation/typings/index.ts +17 -0
- package/templates/empty-bot/.botpress/implementation/typings/integrations/index.ts +6 -0
- package/templates/empty-bot/.botpress/index.ts +1 -0
- package/templates/empty-bot/bot.definition.ts +2 -0
- package/templates/{echo-bot → empty-bot}/package.json +2 -2
- package/templates/empty-bot/src/index.ts +5 -0
- package/templates/empty-integration/.botpress/implementation/index.ts +7 -35
- package/templates/empty-integration/.botpress/implementation/typings/configuration/index.ts +2 -0
- package/templates/empty-integration/.botpress/implementation/typings/index.ts +31 -0
- package/templates/empty-integration/package.json +1 -1
- package/templates/hello-world/.botpress/implementation/index.ts +7 -35
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/input.ts +5 -0
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/output.ts +5 -0
- package/templates/hello-world/.botpress/implementation/typings/configuration/index.ts +2 -0
- package/templates/hello-world/.botpress/implementation/typings/index.ts +31 -0
- package/templates/hello-world/package.json +1 -1
- package/templates/webhook-message/.botpress/implementation/index.ts +7 -35
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/messages/text.ts +5 -0
- package/templates/webhook-message/.botpress/implementation/typings/configuration/index.ts +8 -0
- package/templates/webhook-message/.botpress/implementation/typings/events/index.ts +6 -0
- package/templates/webhook-message/.botpress/implementation/typings/index.ts +31 -0
- package/templates/webhook-message/.botpress/implementation/typings/states/index.ts +6 -0
- package/templates/webhook-message/package.json +1 -1
- package/dist/code-generation/const.js.map +0 -7
- package/dist/code-generation/integration-implementation.js +0 -192
- package/dist/code-generation/integration-implementation.js.map +0 -7
- package/dist/code-generation/integration-instance.js +0 -185
- package/dist/code-generation/integration-instance.js.map +0 -7
- package/dist/code-generation/integration-schemas/actions-module.js.map +0 -7
- package/dist/code-generation/integration-schemas/channels-module.js +0 -117
- package/dist/code-generation/integration-schemas/channels-module.js.map +0 -7
- package/dist/code-generation/integration-schemas/configuration-module.js.map +0 -7
- package/dist/code-generation/integration-schemas/configurations-module.js.map +0 -7
- package/dist/code-generation/integration-schemas/entities-module.js.map +0 -7
- package/dist/code-generation/integration-schemas/events-module.js.map +0 -7
- package/dist/code-generation/integration-schemas/states-module.js.map +0 -7
- package/dist/code-generation/integration-secret.js.map +0 -7
- package/dist/code-generation/map-integration.js +0 -76
- package/dist/code-generation/map-integration.js.map +0 -7
- package/dist/integration-ref.js.map +0 -7
- package/dist/integration-ref.test.js.map +0 -7
- package/templates/echo-bot/src/index.ts +0 -30
- package/templates/empty-integration/.botpress/implementation/configuration/index.ts +0 -10
- package/templates/hello-world/.botpress/implementation/actions/helloWorld/input.ts +0 -10
- package/templates/hello-world/.botpress/implementation/actions/helloWorld/output.ts +0 -10
- package/templates/hello-world/.botpress/implementation/configuration/index.ts +0 -10
- package/templates/webhook-message/.botpress/implementation/channels/webhook/messages/text.ts +0 -10
- package/templates/webhook-message/.botpress/implementation/configuration/index.ts +0 -13
- /package/templates/{empty-integration/.botpress/implementation → empty-bot/.botpress/implementation/typings}/events/index.ts +0 -0
- /package/templates/{empty-integration/.botpress/implementation → empty-bot/.botpress/implementation/typings}/states/index.ts +0 -0
- /package/templates/{echo-bot → empty-bot}/tsconfig.json +0 -0
- /package/templates/empty-integration/.botpress/implementation/{actions → typings/actions}/index.ts +0 -0
- /package/templates/empty-integration/.botpress/implementation/{channels → typings/channels}/index.ts +0 -0
- /package/templates/empty-integration/.botpress/implementation/{configurations → typings/configurations}/index.ts +0 -0
- /package/templates/empty-integration/.botpress/implementation/{entities → typings/entities}/index.ts +0 -0
- /package/templates/{hello-world/.botpress/implementation → empty-integration/.botpress/implementation/typings}/events/index.ts +0 -0
- /package/templates/{hello-world/.botpress/implementation → empty-integration/.botpress/implementation/typings}/states/index.ts +0 -0
- /package/templates/hello-world/.botpress/implementation/{actions → typings/actions}/helloWorld/index.ts +0 -0
- /package/templates/hello-world/.botpress/implementation/{actions → typings/actions}/index.ts +0 -0
- /package/templates/hello-world/.botpress/implementation/{channels → typings/channels}/index.ts +0 -0
- /package/templates/hello-world/.botpress/implementation/{configurations → typings/configurations}/index.ts +0 -0
- /package/templates/hello-world/.botpress/implementation/{entities → typings/entities}/index.ts +0 -0
- /package/templates/{webhook-message/.botpress/implementation → hello-world/.botpress/implementation/typings}/events/index.ts +0 -0
- /package/templates/{webhook-message/.botpress/implementation → hello-world/.botpress/implementation/typings}/states/index.ts +0 -0
- /package/templates/webhook-message/.botpress/implementation/{actions → typings/actions}/index.ts +0 -0
- /package/templates/webhook-message/.botpress/implementation/{channels → typings/channels}/index.ts +0 -0
- /package/templates/webhook-message/.botpress/implementation/{channels → typings/channels}/webhook/index.ts +0 -0
- /package/templates/webhook-message/.botpress/implementation/{channels → typings/channels}/webhook/messages/index.ts +0 -0
- /package/templates/webhook-message/.botpress/implementation/{configurations → typings/configurations}/index.ts +0 -0
- /package/templates/webhook-message/.botpress/implementation/{entities → typings/entities}/index.ts +0 -0
package/dist/errors.js
CHANGED
|
@@ -28,13 +28,14 @@ __export(errors_exports, {
|
|
|
28
28
|
ExclusiveBotFeatureError: () => ExclusiveBotFeatureError,
|
|
29
29
|
ExclusiveIntegrationFeatureError: () => ExclusiveIntegrationFeatureError,
|
|
30
30
|
HTTPError: () => HTTPError,
|
|
31
|
-
|
|
32
|
-
InvalidInterfaceReferenceError: () => InvalidInterfaceReferenceError,
|
|
31
|
+
InvalidPackageReferenceError: () => InvalidPackageReferenceError,
|
|
33
32
|
NoBotsFoundError: () => NoBotsFoundError,
|
|
34
33
|
NoBundleFoundError: () => NoBundleFoundError,
|
|
35
34
|
NoWorkspacesFoundError: () => NoWorkspacesFoundError,
|
|
36
35
|
NotLoggedInError: () => NotLoggedInError,
|
|
37
|
-
ParamRequiredError: () => ParamRequiredError
|
|
36
|
+
ParamRequiredError: () => ParamRequiredError,
|
|
37
|
+
ProjectDefinitionNotFoundError: () => ProjectDefinitionNotFoundError,
|
|
38
|
+
UnsupportedProjectType: () => UnsupportedProjectType
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(errors_exports);
|
|
40
41
|
var import_client = require("@botpress/client");
|
|
@@ -161,15 +162,21 @@ class ParamRequiredError extends BotpressCLIError {
|
|
|
161
162
|
super(message);
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
|
-
class
|
|
165
|
+
class InvalidPackageReferenceError extends BotpressCLIError {
|
|
165
166
|
constructor(ref) {
|
|
166
|
-
const message = `Invalid
|
|
167
|
+
const message = `Invalid package reference "${ref}".`;
|
|
167
168
|
super(message);
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
|
-
class
|
|
171
|
-
constructor(
|
|
172
|
-
const message =
|
|
171
|
+
class UnsupportedProjectType extends BotpressCLIError {
|
|
172
|
+
constructor() {
|
|
173
|
+
const message = "Unsupported project type.";
|
|
174
|
+
super(message);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
class ProjectDefinitionNotFoundError extends BotpressCLIError {
|
|
178
|
+
constructor(workdir) {
|
|
179
|
+
const message = `No project definition found at "${workdir}".`;
|
|
173
180
|
super(message);
|
|
174
181
|
}
|
|
175
182
|
}
|
|
@@ -179,12 +186,13 @@ class InvalidInterfaceReferenceError extends BotpressCLIError {
|
|
|
179
186
|
ExclusiveBotFeatureError,
|
|
180
187
|
ExclusiveIntegrationFeatureError,
|
|
181
188
|
HTTPError,
|
|
182
|
-
|
|
183
|
-
InvalidInterfaceReferenceError,
|
|
189
|
+
InvalidPackageReferenceError,
|
|
184
190
|
NoBotsFoundError,
|
|
185
191
|
NoBundleFoundError,
|
|
186
192
|
NoWorkspacesFoundError,
|
|
187
193
|
NotLoggedInError,
|
|
188
|
-
ParamRequiredError
|
|
194
|
+
ParamRequiredError,
|
|
195
|
+
ProjectDefinitionNotFoundError,
|
|
196
|
+
UnsupportedProjectType
|
|
189
197
|
});
|
|
190
198
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/errors.ts"],
|
|
4
|
-
"sourcesContent": ["import { isApiError, ApiError, UnknownError } from '@botpress/client'\nimport axios, { AxiosError } from 'axios'\nimport { VError } from 'verror'\nimport * as consts from './consts'\n\ntype KnownApiError = Exclude<ApiError, UnknownError>\nconst isKnownApiError = (e: unknown): e is KnownApiError => isApiError(e) && !(e instanceof UnknownError)\n\nexport class BotpressCLIError extends VError {\n public static wrap(thrown: unknown, message: string): BotpressCLIError {\n const err = BotpressCLIError.map(thrown)\n return new BotpressCLIError(err, message ?? '')\n }\n\n public static map(thrown: unknown): BotpressCLIError {\n if (thrown instanceof BotpressCLIError) {\n return thrown\n }\n if (thrown instanceof UnknownError) {\n const inst = new HTTPError(500, 'An unknown error has occurred.')\n inst.debug = thrown.message\n return inst\n }\n if (isKnownApiError(thrown)) {\n return HTTPError.fromApi(thrown)\n }\n if (axios.isAxiosError(thrown)) {\n return HTTPError.fromAxios(thrown)\n }\n if (thrown instanceof Error) {\n const { message } = thrown\n return new BotpressCLIError(message)\n }\n return new BotpressCLIError(`${thrown}`)\n }\n\n private readonly _debug: string[]\n\n public constructor(error: BotpressCLIError, message: string)\n public constructor(message: string)\n public constructor(first: BotpressCLIError | string, second?: string) {\n if (typeof first === 'string') {\n super(first)\n this._debug = []\n return\n }\n super(first, second!)\n this._debug = [...first._debug]\n }\n\n public set debug(msg: string) {\n this._debug.push(msg)\n }\n\n public get debug(): string {\n const dbgMsgs = this._debug.filter((s) => s.length)\n if (!dbgMsgs.length) {\n return ''\n }\n return 'Error: \\n' + dbgMsgs.map((s) => ` ${s}`).join('\\n')\n }\n}\n\nexport class ExclusiveBotFeatureError extends BotpressCLIError {\n public constructor() {\n const message = 'This feature is only available for bots. This project is an integration or interface.'\n super(message)\n }\n}\n\nexport class ExclusiveIntegrationFeatureError extends BotpressCLIError {\n public constructor() {\n const message = 'This feature is only available for integration. This project is a bot or interface.'\n super(message)\n }\n}\n\nexport class HTTPError extends BotpressCLIError {\n public constructor(public readonly status: number | undefined, message: string) {\n super(message)\n }\n\n public static fromAxios(e: AxiosError<{ message?: string }>): HTTPError {\n const message = this._axiosMsg(e)\n return new HTTPError(e.response?.status, message)\n }\n\n public static fromApi(e: KnownApiError): HTTPError {\n const { message, code } = e\n return new HTTPError(code, message)\n }\n\n private static _axiosMsg(e: AxiosError<{ message?: string }>): string {\n let message = e.message\n if (e.response?.statusText) {\n message += `\\n ${e.response?.statusText}`\n }\n if (e.response?.status && e.request?.method && e.request?.path) {\n message += `\\n (${e.response?.status}) ${e.request.method} ${e.request.path}`\n }\n if (e.response?.data?.message) {\n message += `\\n ${e.response?.data?.message}`\n }\n return message\n }\n}\n\nexport class NoBundleFoundError extends BotpressCLIError {\n public constructor() {\n const message = 'No bundle found. Please run `bp bundle` first.'\n super(message)\n }\n}\n\nexport class NoBotsFoundError extends BotpressCLIError {\n public constructor() {\n const message = `No Bot found in your Workspace. Please create one first at ${consts.defaultBotpressAppUrl}.`\n super(message)\n }\n}\n\nexport class NoWorkspacesFoundError extends BotpressCLIError {\n public constructor() {\n const message = 'No Workspace found. Please create one first.'\n super(message)\n }\n}\n\nexport class NotLoggedInError extends BotpressCLIError {\n public constructor() {\n const message = 'Not logged in. Please run `bp login` first.'\n super(message)\n }\n}\n\nexport class ParamRequiredError extends BotpressCLIError {\n public constructor(param: string) {\n const message = `${param} is required.`\n super(message)\n }\n}\n\nexport class
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmD;AACnD,mBAAkC;AAClC,oBAAuB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iBAAiB;AAAA,EACpD,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,yBAAyB,iBAAiB;AAAA,EAC9C,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,2BAA2B,iBAAiB;AAAA,EAChD,YAAY,OAAe;AAChC,UAAM,UAAU,GAAG;AACnB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,
|
|
4
|
+
"sourcesContent": ["import { isApiError, ApiError, UnknownError } from '@botpress/client'\nimport axios, { AxiosError } from 'axios'\nimport { VError } from 'verror'\nimport * as consts from './consts'\n\ntype KnownApiError = Exclude<ApiError, UnknownError>\nconst isKnownApiError = (e: unknown): e is KnownApiError => isApiError(e) && !(e instanceof UnknownError)\n\nexport class BotpressCLIError extends VError {\n public static wrap(thrown: unknown, message: string): BotpressCLIError {\n const err = BotpressCLIError.map(thrown)\n return new BotpressCLIError(err, message ?? '')\n }\n\n public static map(thrown: unknown): BotpressCLIError {\n if (thrown instanceof BotpressCLIError) {\n return thrown\n }\n if (thrown instanceof UnknownError) {\n const inst = new HTTPError(500, 'An unknown error has occurred.')\n inst.debug = thrown.message\n return inst\n }\n if (isKnownApiError(thrown)) {\n return HTTPError.fromApi(thrown)\n }\n if (axios.isAxiosError(thrown)) {\n return HTTPError.fromAxios(thrown)\n }\n if (thrown instanceof Error) {\n const { message } = thrown\n return new BotpressCLIError(message)\n }\n return new BotpressCLIError(`${thrown}`)\n }\n\n private readonly _debug: string[]\n\n public constructor(error: BotpressCLIError, message: string)\n public constructor(message: string)\n public constructor(first: BotpressCLIError | string, second?: string) {\n if (typeof first === 'string') {\n super(first)\n this._debug = []\n return\n }\n super(first, second!)\n this._debug = [...first._debug]\n }\n\n public set debug(msg: string) {\n this._debug.push(msg)\n }\n\n public get debug(): string {\n const dbgMsgs = this._debug.filter((s) => s.length)\n if (!dbgMsgs.length) {\n return ''\n }\n return 'Error: \\n' + dbgMsgs.map((s) => ` ${s}`).join('\\n')\n }\n}\n\nexport class ExclusiveBotFeatureError extends BotpressCLIError {\n public constructor() {\n const message = 'This feature is only available for bots. This project is an integration or interface.'\n super(message)\n }\n}\n\nexport class ExclusiveIntegrationFeatureError extends BotpressCLIError {\n public constructor() {\n const message = 'This feature is only available for integration. This project is a bot or interface.'\n super(message)\n }\n}\n\nexport class HTTPError extends BotpressCLIError {\n public constructor(public readonly status: number | undefined, message: string) {\n super(message)\n }\n\n public static fromAxios(e: AxiosError<{ message?: string }>): HTTPError {\n const message = this._axiosMsg(e)\n return new HTTPError(e.response?.status, message)\n }\n\n public static fromApi(e: KnownApiError): HTTPError {\n const { message, code } = e\n return new HTTPError(code, message)\n }\n\n private static _axiosMsg(e: AxiosError<{ message?: string }>): string {\n let message = e.message\n if (e.response?.statusText) {\n message += `\\n ${e.response?.statusText}`\n }\n if (e.response?.status && e.request?.method && e.request?.path) {\n message += `\\n (${e.response?.status}) ${e.request.method} ${e.request.path}`\n }\n if (e.response?.data?.message) {\n message += `\\n ${e.response?.data?.message}`\n }\n return message\n }\n}\n\nexport class NoBundleFoundError extends BotpressCLIError {\n public constructor() {\n const message = 'No bundle found. Please run `bp bundle` first.'\n super(message)\n }\n}\n\nexport class NoBotsFoundError extends BotpressCLIError {\n public constructor() {\n const message = `No Bot found in your Workspace. Please create one first at ${consts.defaultBotpressAppUrl}.`\n super(message)\n }\n}\n\nexport class NoWorkspacesFoundError extends BotpressCLIError {\n public constructor() {\n const message = 'No Workspace found. Please create one first.'\n super(message)\n }\n}\n\nexport class NotLoggedInError extends BotpressCLIError {\n public constructor() {\n const message = 'Not logged in. Please run `bp login` first.'\n super(message)\n }\n}\n\nexport class ParamRequiredError extends BotpressCLIError {\n public constructor(param: string) {\n const message = `${param} is required.`\n super(message)\n }\n}\n\nexport class InvalidPackageReferenceError extends BotpressCLIError {\n public constructor(ref: string) {\n const message = `Invalid package reference \"${ref}\".`\n super(message)\n }\n}\n\nexport class UnsupportedProjectType extends BotpressCLIError {\n public constructor() {\n const message = 'Unsupported project type.'\n super(message)\n }\n}\n\nexport class ProjectDefinitionNotFoundError extends BotpressCLIError {\n public constructor(workdir: string) {\n const message = `No project definition found at \"${workdir}\".`\n super(message)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmD;AACnD,mBAAkC;AAClC,oBAAuB;AACvB,aAAwB;AAGxB,MAAM,kBAAkB,CAAC,UAAmC,0BAAW,CAAC,KAAK,EAAE,aAAa;AAErF,MAAM,yBAAyB,qBAAO;AAAA,EAC3C,OAAc,KAAK,QAAiB,SAAmC;AACrE,UAAM,MAAM,iBAAiB,IAAI,MAAM;AACvC,WAAO,IAAI,iBAAiB,KAAK,WAAW,EAAE;AAAA,EAChD;AAAA,EAEA,OAAc,IAAI,QAAmC;AACnD,QAAI,kBAAkB,kBAAkB;AACtC,aAAO;AAAA,IACT;AACA,QAAI,kBAAkB,4BAAc;AAClC,YAAM,OAAO,IAAI,UAAU,KAAK,gCAAgC;AAChE,WAAK,QAAQ,OAAO;AACpB,aAAO;AAAA,IACT;AACA,QAAI,gBAAgB,MAAM,GAAG;AAC3B,aAAO,UAAU,QAAQ,MAAM;AAAA,IACjC;AACA,QAAI,aAAAA,QAAM,aAAa,MAAM,GAAG;AAC9B,aAAO,UAAU,UAAU,MAAM;AAAA,IACnC;AACA,QAAI,kBAAkB,OAAO;AAC3B,YAAM,EAAE,QAAQ,IAAI;AACpB,aAAO,IAAI,iBAAiB,OAAO;AAAA,IACrC;AACA,WAAO,IAAI,iBAAiB,GAAG,QAAQ;AAAA,EACzC;AAAA,EAEiB;AAAA,EAIV,YAAY,OAAkC,QAAiB;AACpE,QAAI,OAAO,UAAU,UAAU;AAC7B,YAAM,KAAK;AACX,WAAK,SAAS,CAAC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C1E;AACA,QAAI,EAAE,UAAU,MAAM,SAAS;AAC7B,iBAAW;AAAA,IAAO,EAAE,UAAU,MAAM;AAAA,IACtC;AACA,WAAO;AAAA,EACT;AACF;AAEO,MAAM,2BAA2B,iBAAiB;AAAA,EAChD,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,yBAAyB,iBAAiB;AAAA,EAC9C,cAAc;AACnB,UAAM,UAAU,8DAA8D,OAAO;AACrF,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,+BAA+B,iBAAiB;AAAA,EACpD,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,yBAAyB,iBAAiB;AAAA,EAC9C,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,2BAA2B,iBAAiB;AAAA,EAChD,YAAY,OAAe;AAChC,UAAM,UAAU,GAAG;AACnB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,qCAAqC,iBAAiB;AAAA,EAC1D,YAAY,KAAa;AAC9B,UAAM,UAAU,8BAA8B;AAC9C,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,+BAA+B,iBAAiB;AAAA,EACpD,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,uCAAuC,iBAAiB;AAAA,EAC5D,YAAY,SAAiB;AAClC,UAAM,UAAU,mCAAmC;AACnD,UAAM,OAAO;AAAA,EACf;AACF;",
|
|
6
6
|
"names": ["axios"]
|
|
7
7
|
}
|
package/dist/logger/index.js
CHANGED
|
@@ -18,7 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var logger_exports = {};
|
|
20
20
|
__export(logger_exports, {
|
|
21
|
-
Logger: () => Logger
|
|
21
|
+
Logger: () => Logger,
|
|
22
|
+
SingleLineLogger: () => SingleLineLogger
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(logger_exports);
|
|
24
25
|
var import_readline = require("readline");
|
|
@@ -78,6 +79,7 @@ class SingleLineLogger extends import_base_logger.BaseLogger {
|
|
|
78
79
|
}
|
|
79
80
|
// Annotate the CommonJS export names for ESM import in node:
|
|
80
81
|
0 && (module.exports = {
|
|
81
|
-
Logger
|
|
82
|
+
Logger,
|
|
83
|
+
SingleLineLogger
|
|
82
84
|
});
|
|
83
85
|
//# sourceMappingURL=index.js.map
|
package/dist/logger/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/logger/index.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-console */\nimport { cursorTo, clearLine } from 'readline'\nimport { BaseLogger, LoggerOptions } from './base-logger'\n\nexport class Logger extends BaseLogger {\n private static _previousLine: SingleLineLogger | undefined // this is global to the whole process\n\n protected print(message: string, props: Partial<{ prefix: string; stderr?: boolean }> = {}): void {\n this.cleanup()\n const stream = props.stderr ? process.stderr : process.stdout\n const { prefix } = props\n if (prefix) {\n this.render(`${prefix} ${message}\\n`, stream)\n return\n }\n this.render(`${message}\\n`, stream)\n }\n\n public line(): SingleLineLogger {\n this.cleanup()\n const currentLine = new SingleLineLogger({ ...this.opts })\n Logger._previousLine = currentLine\n return currentLine\n }\n\n public cleanup(): void {\n if (Logger._previousLine) {\n Logger._previousLine.commit()\n Logger._previousLine = undefined\n }\n }\n}\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAoC;AACpC,yBAA0C;AAEnC,MAAM,eAAe,8BAAW;AAAA,EACrC,OAAe;AAAA,EAEL,MAAM,SAAiB,QAAuD,CAAC,GAAS;AAChG,SAAK,QAAQ;AACb,UAAM,SAAS,MAAM,SAAS,QAAQ,SAAS,QAAQ;AACvD,UAAM,EAAE,OAAO,IAAI;AACnB,QAAI,QAAQ;AACV,WAAK,OAAO,GAAG,UAAU;AAAA,GAAa,MAAM;AAC5C;AAAA,IACF;AACA,SAAK,OAAO,GAAG;AAAA,GAAa,MAAM;AAAA,EACpC;AAAA,EAEO,OAAyB;AAC9B,SAAK,QAAQ;AACb,UAAM,cAAc,IAAI,iBAAiB,EAAE,GAAG,KAAK,KAAK,CAAC;AACzD,WAAO,gBAAgB;AACvB,WAAO;AAAA,EACT;AAAA,EAEO,UAAgB;AACrB,QAAI,OAAO,eAAe;AACxB,aAAO,cAAc,OAAO;AAC5B,aAAO,gBAAgB;AAAA,IACzB;AAAA,EACF;AACF;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-console */\nimport { cursorTo, clearLine } from 'readline'\nimport { BaseLogger, LoggerOptions } from './base-logger'\n\nexport class Logger extends BaseLogger {\n private static _previousLine: SingleLineLogger | undefined // this is global to the whole process\n\n protected print(message: string, props: Partial<{ prefix: string; stderr?: boolean }> = {}): void {\n this.cleanup()\n const stream = props.stderr ? process.stderr : process.stdout\n const { prefix } = props\n if (prefix) {\n this.render(`${prefix} ${message}\\n`, stream)\n return\n }\n this.render(`${message}\\n`, stream)\n }\n\n public line(): SingleLineLogger {\n this.cleanup()\n const currentLine = new SingleLineLogger({ ...this.opts })\n Logger._previousLine = currentLine\n return currentLine\n }\n\n public cleanup(): void {\n if (Logger._previousLine) {\n Logger._previousLine.commit()\n Logger._previousLine = undefined\n }\n }\n}\n\nexport class SingleLineLogger extends BaseLogger {\n private _commited = false\n\n public constructor(opts: LoggerOptions) {\n super(opts)\n }\n\n public commit(): void {\n if (this._commited) {\n return\n }\n this._commited = true\n console.log()\n }\n\n protected print(message: string, props: Partial<{ prefix: string }> = {}): void {\n if (this._commited) {\n return\n }\n\n clearLine(process.stdout, 0)\n const { prefix } = props\n cursorTo(process.stdout, 0)\n if (prefix) {\n this.render(`${prefix} ${message}`)\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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,16 +22,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
var
|
|
26
|
-
__export(
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
var package_ref_exports = {};
|
|
26
|
+
__export(package_ref_exports, {
|
|
27
|
+
formatPackageRef: () => formatPackageRef,
|
|
28
|
+
parsePackageRef: () => parsePackageRef
|
|
29
29
|
});
|
|
30
|
-
module.exports = __toCommonJS(
|
|
30
|
+
module.exports = __toCommonJS(package_ref_exports);
|
|
31
31
|
var import_semver = __toESM(require("semver"));
|
|
32
32
|
var utils = __toESM(require("./utils"));
|
|
33
33
|
const LATEST_TAG = "latest";
|
|
34
|
-
const
|
|
34
|
+
const formatPackageRef = (ref) => {
|
|
35
35
|
if (ref.type === "path") {
|
|
36
36
|
return ref.path;
|
|
37
37
|
}
|
|
@@ -40,14 +40,14 @@ const formatIntegrationRef = (ref) => {
|
|
|
40
40
|
}
|
|
41
41
|
return `${ref.name}@${ref.version}`;
|
|
42
42
|
};
|
|
43
|
-
const
|
|
43
|
+
const parsePackageRef = (ref) => {
|
|
44
44
|
if (!ref) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
if (utils.id.isValidID(ref)) {
|
|
48
48
|
return { type: "id", id: ref };
|
|
49
49
|
}
|
|
50
|
-
if (utils.path.
|
|
50
|
+
if (utils.path.isPath(ref)) {
|
|
51
51
|
return { type: "path", path: ref };
|
|
52
52
|
}
|
|
53
53
|
if (!ref.includes("@")) {
|
|
@@ -65,7 +65,7 @@ const parseIntegrationRef = (ref) => {
|
|
|
65
65
|
};
|
|
66
66
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
67
|
0 && (module.exports = {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
formatPackageRef,
|
|
69
|
+
parsePackageRef
|
|
70
70
|
});
|
|
71
|
-
//# sourceMappingURL=
|
|
71
|
+
//# sourceMappingURL=package-ref.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/package-ref.ts"],
|
|
4
|
+
"sourcesContent": ["import semver from 'semver'\nimport * as utils from './utils'\n\nexport type UUIDPackageRef = {\n type: 'id'\n id: string\n}\n\nexport type NamePackageRef = {\n type: 'name'\n name: string\n version: string\n}\n\nexport type LocalPackageRef = {\n type: 'path'\n path: string\n}\n\nexport type ApiPackageRef = UUIDPackageRef | NamePackageRef\nexport type PackageRef = ApiPackageRef | LocalPackageRef\n\nconst LATEST_TAG = 'latest'\n\nexport const formatPackageRef = (ref: PackageRef): string => {\n if (ref.type === 'path') {\n return ref.path\n }\n if (ref.type === 'id') {\n return ref.id\n }\n return `${ref.name}@${ref.version}`\n}\n\nexport const parsePackageRef = (ref: string): PackageRef | undefined => {\n if (!ref) {\n return\n }\n\n if (utils.id.isValidID(ref)) {\n return { type: 'id', id: ref }\n }\n\n if (utils.path.isPath(ref)) {\n return { type: 'path', path: ref }\n }\n\n if (!ref.includes('@')) {\n return { type: 'name', name: ref, version: LATEST_TAG }\n }\n\n const [name, version] = ref.split('@')\n if (!name || !version) {\n return\n }\n\n const cleanedVersion = version === LATEST_TAG ? version : semver.clean(version)\n if (!cleanedVersion) {\n return\n }\n\n return { type: 'name', name, version: cleanedVersion }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AACnB,YAAuB;AAqBvB,MAAM,aAAa;AAEZ,MAAM,mBAAmB,CAAC,QAA4B;AAC3D,MAAI,IAAI,SAAS,QAAQ;AACvB,WAAO,IAAI;AAAA,EACb;AACA,MAAI,IAAI,SAAS,MAAM;AACrB,WAAO,IAAI;AAAA,EACb;AACA,SAAO,GAAG,IAAI,QAAQ,IAAI;AAC5B;AAEO,MAAM,kBAAkB,CAAC,QAAwC;AACtE,MAAI,CAAC,KAAK;AACR;AAAA,EACF;AAEA,MAAI,MAAM,GAAG,UAAU,GAAG,GAAG;AAC3B,WAAO,EAAE,MAAM,MAAM,IAAI,IAAI;AAAA,EAC/B;AAEA,MAAI,MAAM,KAAK,OAAO,GAAG,GAAG;AAC1B,WAAO,EAAE,MAAM,QAAQ,MAAM,IAAI;AAAA,EACnC;AAEA,MAAI,CAAC,IAAI,SAAS,GAAG,GAAG;AACtB,WAAO,EAAE,MAAM,QAAQ,MAAM,KAAK,SAAS,WAAW;AAAA,EACxD;AAEA,QAAM,CAAC,MAAM,OAAO,IAAI,IAAI,MAAM,GAAG;AACrC,MAAI,CAAC,QAAQ,CAAC,SAAS;AACrB;AAAA,EACF;AAEA,QAAM,iBAAiB,YAAY,aAAa,UAAU,cAAAA,QAAO,MAAM,OAAO;AAC9E,MAAI,CAAC,gBAAgB;AACnB;AAAA,EACF;AAEA,SAAO,EAAE,MAAM,QAAQ,MAAM,SAAS,eAAe;AACvD;",
|
|
6
|
+
"names": ["semver"]
|
|
7
|
+
}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var import_vitest = require("vitest");
|
|
3
|
-
var
|
|
3
|
+
var import_package_ref = require("./package-ref");
|
|
4
4
|
const path = "/my/path";
|
|
5
5
|
const prefixedUlid = "intver_01HF58RDKE3M7K5RJ5XZ7GF6HE";
|
|
6
6
|
const uuid = "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11";
|
|
7
7
|
const name = "myintegration";
|
|
8
|
-
(0, import_vitest.describe)("
|
|
8
|
+
(0, import_vitest.describe)("parsePackageRef", () => {
|
|
9
9
|
(0, import_vitest.test)("parse empty string should return undefined", () => {
|
|
10
10
|
const ref = "";
|
|
11
|
-
const result = (0,
|
|
11
|
+
const result = (0, import_package_ref.parsePackageRef)(ref);
|
|
12
12
|
(0, import_vitest.expect)(result).toBeUndefined();
|
|
13
13
|
});
|
|
14
14
|
(0, import_vitest.test)("parse with invalid version should return undefined", () => {
|
|
15
15
|
const ref0 = `${name}@lol`;
|
|
16
16
|
const ref1 = `${name}@1`;
|
|
17
17
|
const ref2 = `${name}@1.0`;
|
|
18
|
-
const result0 = (0,
|
|
19
|
-
const result1 = (0,
|
|
20
|
-
const result2 = (0,
|
|
18
|
+
const result0 = (0, import_package_ref.parsePackageRef)(ref0);
|
|
19
|
+
const result1 = (0, import_package_ref.parsePackageRef)(ref1);
|
|
20
|
+
const result2 = (0, import_package_ref.parsePackageRef)(ref2);
|
|
21
21
|
(0, import_vitest.expect)(result0).toBeUndefined();
|
|
22
22
|
(0, import_vitest.expect)(result1).toBeUndefined();
|
|
23
23
|
(0, import_vitest.expect)(result2).toBeUndefined();
|
|
24
24
|
});
|
|
25
25
|
(0, import_vitest.test)("parse with an absolute path should return path", () => {
|
|
26
26
|
const ref = path;
|
|
27
|
-
const result = (0,
|
|
27
|
+
const result = (0, import_package_ref.parsePackageRef)(ref);
|
|
28
28
|
const expected = { type: "path", path: ref };
|
|
29
29
|
(0, import_vitest.expect)(result).toEqual(expected);
|
|
30
30
|
});
|
|
31
31
|
(0, import_vitest.test)("parse with a prefixed ULID sets `id` type", () => {
|
|
32
32
|
const ref = prefixedUlid;
|
|
33
|
-
const result = (0,
|
|
33
|
+
const result = (0, import_package_ref.parsePackageRef)(ref);
|
|
34
34
|
const expected = { type: "id", id: ref };
|
|
35
35
|
(0, import_vitest.expect)(result).toEqual(expected);
|
|
36
36
|
});
|
|
37
37
|
(0, import_vitest.test)("parse with a legacy UUID sets `id` type", () => {
|
|
38
38
|
const ref = uuid;
|
|
39
|
-
const result = (0,
|
|
39
|
+
const result = (0, import_package_ref.parsePackageRef)(ref);
|
|
40
40
|
const expected = { type: "id", id: ref };
|
|
41
41
|
(0, import_vitest.expect)(result).toEqual(expected);
|
|
42
42
|
});
|
|
43
43
|
(0, import_vitest.test)("parse with a name and version should return name and version", () => {
|
|
44
44
|
const version = "1.0.0";
|
|
45
45
|
const ref = `${name}@${version}`;
|
|
46
|
-
const result = (0,
|
|
46
|
+
const result = (0, import_package_ref.parsePackageRef)(ref);
|
|
47
47
|
const expected = { type: "name", name, version };
|
|
48
48
|
(0, import_vitest.expect)(result).toEqual(expected);
|
|
49
49
|
});
|
|
50
50
|
(0, import_vitest.test)("parse with a name and latest should return name and latest", () => {
|
|
51
51
|
const version = "latest";
|
|
52
52
|
const ref = `${name}@${version}`;
|
|
53
|
-
const result = (0,
|
|
53
|
+
const result = (0, import_package_ref.parsePackageRef)(ref);
|
|
54
54
|
const expected = { type: "name", name, version };
|
|
55
55
|
(0, import_vitest.expect)(result).toEqual(expected);
|
|
56
56
|
});
|
|
57
57
|
(0, import_vitest.test)("parse with only a name should return name and latest", () => {
|
|
58
58
|
const ref = name;
|
|
59
|
-
const result = (0,
|
|
59
|
+
const result = (0, import_package_ref.parsePackageRef)(ref);
|
|
60
60
|
const expected = { type: "name", name, version: "latest" };
|
|
61
61
|
(0, import_vitest.expect)(result).toEqual(expected);
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
|
-
(0, import_vitest.describe)("
|
|
64
|
+
(0, import_vitest.describe)("formatPackageRef", () => {
|
|
65
65
|
(0, import_vitest.test)("format with a path should return path", () => {
|
|
66
66
|
const ref = { type: "path", path };
|
|
67
|
-
const result = (0,
|
|
67
|
+
const result = (0, import_package_ref.formatPackageRef)(ref);
|
|
68
68
|
(0, import_vitest.expect)(result).toEqual(ref.path);
|
|
69
69
|
});
|
|
70
70
|
(0, import_vitest.test)("format with a prefixed ULID uses `id` type", () => {
|
|
71
71
|
const ref = { type: "id", id: prefixedUlid };
|
|
72
|
-
const result = (0,
|
|
72
|
+
const result = (0, import_package_ref.formatPackageRef)(ref);
|
|
73
73
|
(0, import_vitest.expect)(result).toEqual(ref.id);
|
|
74
74
|
});
|
|
75
75
|
(0, import_vitest.test)("format with a legacy UUID uses `id` type", () => {
|
|
76
76
|
const ref = { type: "id", id: uuid };
|
|
77
|
-
const result = (0,
|
|
77
|
+
const result = (0, import_package_ref.formatPackageRef)(ref);
|
|
78
78
|
(0, import_vitest.expect)(result).toEqual(ref.id);
|
|
79
79
|
});
|
|
80
80
|
(0, import_vitest.test)("format with a name and version should return name and version", () => {
|
|
81
81
|
const version = "1.0.0";
|
|
82
82
|
const ref = { type: "name", name, version };
|
|
83
|
-
const result = (0,
|
|
83
|
+
const result = (0, import_package_ref.formatPackageRef)(ref);
|
|
84
84
|
(0, import_vitest.expect)(result).toEqual(`${name}@${version}`);
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
|
-
//# sourceMappingURL=
|
|
87
|
+
//# sourceMappingURL=package-ref.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/package-ref.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { test, expect, describe } from 'vitest'\nimport { formatPackageRef, PackageRef, parsePackageRef } from './package-ref'\n\nconst path = '/my/path'\nconst prefixedUlid = 'intver_01HF58RDKE3M7K5RJ5XZ7GF6HE'\nconst uuid = 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'\nconst name = 'myintegration'\n\ndescribe('parsePackageRef', () => {\n test('parse empty string should return undefined', () => {\n // arrange\n const ref = ''\n // act\n const result = parsePackageRef(ref)\n // assert\n expect(result).toBeUndefined()\n })\n\n test('parse with invalid version should return undefined', () => {\n // arrange\n const ref0 = `${name}@lol`\n const ref1 = `${name}@1`\n const ref2 = `${name}@1.0`\n // act\n const result0 = parsePackageRef(ref0)\n const result1 = parsePackageRef(ref1)\n const result2 = parsePackageRef(ref2)\n // assert\n expect(result0).toBeUndefined()\n expect(result1).toBeUndefined()\n expect(result2).toBeUndefined()\n })\n\n test('parse with an absolute path should return path', () => {\n // arrange\n const ref = path\n // act\n const result = parsePackageRef(ref)\n // assert\n const expected: PackageRef = { type: 'path', path: ref }\n expect(result).toEqual(expected)\n })\n\n test('parse with a prefixed ULID sets `id` type', () => {\n // arrange\n const ref = prefixedUlid\n // act\n const result = parsePackageRef(ref)\n // assert\n const expected: PackageRef = { type: 'id', id: ref }\n expect(result).toEqual(expected)\n })\n\n test('parse with a legacy UUID sets `id` type', () => {\n // arrange\n const ref = uuid\n // act\n const result = parsePackageRef(ref)\n // assert\n const expected: PackageRef = { type: 'id', id: ref }\n expect(result).toEqual(expected)\n })\n\n test('parse with a name and version should return name and version', () => {\n // arrange\n const version = '1.0.0'\n const ref = `${name}@${version}`\n // act\n const result = parsePackageRef(ref)\n // assert\n const expected: PackageRef = { type: 'name', name, version }\n expect(result).toEqual(expected)\n })\n\n test('parse with a name and latest should return name and latest', () => {\n // arrange\n const version = 'latest'\n const ref = `${name}@${version}`\n // act\n const result = parsePackageRef(ref)\n // assert\n const expected: PackageRef = { type: 'name', name, version }\n expect(result).toEqual(expected)\n })\n\n test('parse with only a name should return name and latest', () => {\n // arrange\n const ref = name\n // act\n const result = parsePackageRef(ref)\n // assert\n const expected: PackageRef = { type: 'name', name, version: 'latest' }\n expect(result).toEqual(expected)\n })\n})\n\ndescribe('formatPackageRef', () => {\n test('format with a path should return path', () => {\n // arrange\n const ref: PackageRef = { type: 'path', path }\n // act\n const result = formatPackageRef(ref)\n // assert\n expect(result).toEqual(ref.path)\n })\n\n test('format with a prefixed ULID uses `id` type', () => {\n // arrange\n const ref: PackageRef = { type: 'id', id: prefixedUlid }\n // act\n const result = formatPackageRef(ref)\n // assert\n expect(result).toEqual(ref.id)\n })\n\n test('format with a legacy UUID uses `id` type', () => {\n // arrange\n const ref: PackageRef = { type: 'id', id: uuid }\n // act\n const result = formatPackageRef(ref)\n // assert\n expect(result).toEqual(ref.id)\n })\n\n test('format with a name and version should return name and version', () => {\n // arrange\n const version = '1.0.0'\n const ref: PackageRef = { type: 'name', name, version }\n // act\n const result = formatPackageRef(ref)\n // assert\n expect(result).toEqual(`${name}@${version}`)\n })\n})\n"],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,UAAM,aAAS,qCAAiB,GAAG;AAEnC,8BAAO,MAAM,EAAE,QAAQ,GAAG,QAAQ,SAAS;AAAA,EAC7C,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var sdk_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(sdk_exports);
|
|
18
|
+
__reExport(sdk_exports, require("./validate-integration"), module.exports);
|
|
19
|
+
__reExport(sdk_exports, require("./resolve-integration-interfaces"), module.exports);
|
|
20
|
+
__reExport(sdk_exports, require("./resolve-bot-interfaces"), module.exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sdk/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './validate-integration'\nexport * from './resolve-integration-interfaces'\nexport * from './resolve-bot-interfaces'\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,mCAAd;AACA,wBAAc,6CADd;AAEA,wBAAc,qCAFd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 resolve_bot_interfaces_exports = {};
|
|
20
|
+
__export(resolve_bot_interfaces_exports, {
|
|
21
|
+
resolveBotInterfaces: () => resolveBotInterfaces
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(resolve_bot_interfaces_exports);
|
|
24
|
+
var import_resolve_integration_interfaces = require("./resolve-integration-interfaces");
|
|
25
|
+
const resolveBotInterfaces = (bot) => {
|
|
26
|
+
for (const integration of Object.values(bot.integrations ?? {})) {
|
|
27
|
+
if (!integration.definition.interfaces) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
integration.definition = (0, import_resolve_integration_interfaces.resolveInterfaces)(integration.definition);
|
|
31
|
+
}
|
|
32
|
+
return bot;
|
|
33
|
+
};
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
resolveBotInterfaces
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=resolve-bot-interfaces.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sdk/resolve-bot-interfaces.ts"],
|
|
4
|
+
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport { resolveInterfaces } from './resolve-integration-interfaces'\n\nexport const resolveBotInterfaces = (bot: sdk.BotDefinition): sdk.BotDefinition => {\n for (const integration of Object.values(bot.integrations ?? {})) {\n if (!integration.definition.interfaces) {\n continue\n }\n integration.definition = resolveInterfaces(integration.definition)\n }\n return bot\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,4CAAkC;AAE3B,MAAM,uBAAuB,CAAC,QAA8C;AACjF,aAAW,eAAe,OAAO,OAAO,IAAI,gBAAgB,CAAC,CAAC,GAAG;AAC/D,QAAI,CAAC,YAAY,WAAW,YAAY;AACtC;AAAA,IACF;AACA,gBAAY,iBAAa,yDAAkB,YAAY,UAAU;AAAA,EACnE;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var resolve_integration_interfaces_exports = {};
|
|
26
|
+
__export(resolve_integration_interfaces_exports, {
|
|
27
|
+
getImplementationStatements: () => getImplementationStatements,
|
|
28
|
+
resolveInterfaces: () => resolveInterfaces
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(resolve_integration_interfaces_exports);
|
|
31
|
+
var import_lodash = __toESM(require("lodash"));
|
|
32
|
+
var utils = __toESM(require("../utils"));
|
|
33
|
+
const resolveInterfaces = (integration) => {
|
|
34
|
+
const self = integration;
|
|
35
|
+
if (!self.interfaces) {
|
|
36
|
+
return integration;
|
|
37
|
+
}
|
|
38
|
+
for (const intrface of Object.values(self.interfaces)) {
|
|
39
|
+
const { resolved } = _resolveInterface(intrface);
|
|
40
|
+
self.actions = utils.records.mergeRecords(self.actions ?? {}, resolved.actions, _mergeActions);
|
|
41
|
+
self.channels = utils.records.mergeRecords(self.channels ?? {}, resolved.channels, _mergeChannels);
|
|
42
|
+
self.events = utils.records.mergeRecords(self.events ?? {}, resolved.events, _mergeEvents);
|
|
43
|
+
}
|
|
44
|
+
return self;
|
|
45
|
+
};
|
|
46
|
+
const getImplementationStatements = (integration) => {
|
|
47
|
+
const self = integration;
|
|
48
|
+
if (!self.props.interfaces) {
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
51
|
+
const statements = {};
|
|
52
|
+
for (const [interfaceKey, intrface] of Object.entries(self.props.interfaces)) {
|
|
53
|
+
const { statement } = _resolveInterface(intrface);
|
|
54
|
+
statements[interfaceKey] = statement;
|
|
55
|
+
}
|
|
56
|
+
return statements;
|
|
57
|
+
};
|
|
58
|
+
const _mergeActions = (a, b) => {
|
|
59
|
+
return {
|
|
60
|
+
...a,
|
|
61
|
+
...b,
|
|
62
|
+
input: {
|
|
63
|
+
schema: a.input.schema.merge(b.input.schema)
|
|
64
|
+
},
|
|
65
|
+
output: {
|
|
66
|
+
schema: a.output.schema.merge(b.output.schema)
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
const _mergeEvents = (a, b) => {
|
|
71
|
+
return {
|
|
72
|
+
...a,
|
|
73
|
+
...b,
|
|
74
|
+
schema: a.schema.merge(b.schema)
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const _mergeChannels = (a, b) => {
|
|
78
|
+
const messages = utils.records.mergeRecords(a.messages, b.messages, _mergeMessage);
|
|
79
|
+
return {
|
|
80
|
+
...a,
|
|
81
|
+
...b,
|
|
82
|
+
messages
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
const _mergeMessage = (a, b) => {
|
|
86
|
+
return {
|
|
87
|
+
schema: a.schema.merge(b.schema)
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
const _resolveInterface = (intrface) => {
|
|
91
|
+
const id = "id" in intrface ? intrface.id : void 0;
|
|
92
|
+
const {
|
|
93
|
+
definition: { name, version }
|
|
94
|
+
} = intrface;
|
|
95
|
+
const resolved = { actions: {}, events: {}, channels: {} };
|
|
96
|
+
const statement = {
|
|
97
|
+
id,
|
|
98
|
+
name,
|
|
99
|
+
version,
|
|
100
|
+
entities: import_lodash.default.mapValues(intrface.entities, (entity) => ({ name: entity.name })),
|
|
101
|
+
actions: {},
|
|
102
|
+
events: {},
|
|
103
|
+
channels: {}
|
|
104
|
+
};
|
|
105
|
+
const entitySchemas = import_lodash.default.mapValues(intrface.entities, (entity) => entity.schema);
|
|
106
|
+
for (const [actionName, action] of Object.entries(intrface.definition.actions ?? {})) {
|
|
107
|
+
const resolvedInputSchema = action.input.schema.dereference(entitySchemas);
|
|
108
|
+
const resolvedOutputSchema = action.output.schema.dereference(entitySchemas);
|
|
109
|
+
const newActionName = _rename(intrface, actionName);
|
|
110
|
+
resolved.actions[newActionName] = {
|
|
111
|
+
...action,
|
|
112
|
+
input: { schema: resolvedInputSchema },
|
|
113
|
+
output: { schema: resolvedOutputSchema }
|
|
114
|
+
};
|
|
115
|
+
statement.actions[actionName] = { name: newActionName };
|
|
116
|
+
}
|
|
117
|
+
for (const [eventName, event] of Object.entries(intrface.definition.events ?? {})) {
|
|
118
|
+
const resolvedEventSchema = event.schema.dereference(entitySchemas);
|
|
119
|
+
const newEventName = _rename(intrface, eventName);
|
|
120
|
+
resolved.events[newEventName] = { ...event, schema: resolvedEventSchema };
|
|
121
|
+
statement.events[eventName] = { name: newEventName };
|
|
122
|
+
}
|
|
123
|
+
for (const [channelName, channel] of Object.entries(intrface.definition.channels ?? {})) {
|
|
124
|
+
const messages = {};
|
|
125
|
+
for (const [messageName, message] of Object.entries(channel.messages)) {
|
|
126
|
+
const resolvedMessageSchema = message.schema.dereference(entitySchemas);
|
|
127
|
+
messages[messageName] = { ...message, schema: resolvedMessageSchema };
|
|
128
|
+
}
|
|
129
|
+
const newChannelName = _rename(intrface, channelName);
|
|
130
|
+
resolved.channels[newChannelName] = { ...channel, messages };
|
|
131
|
+
statement.channels[channelName] = { name: newChannelName };
|
|
132
|
+
}
|
|
133
|
+
return { resolved, statement };
|
|
134
|
+
};
|
|
135
|
+
const _rename = (intrface, name) => {
|
|
136
|
+
if (!intrface.definition.templateName) {
|
|
137
|
+
return name;
|
|
138
|
+
}
|
|
139
|
+
const { entities } = intrface;
|
|
140
|
+
const templateProps = import_lodash.default.mapValues(entities, (entity) => entity.name);
|
|
141
|
+
return utils.template.formatHandleBars(intrface.definition.templateName, { ...templateProps, name });
|
|
142
|
+
};
|
|
143
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
+
0 && (module.exports = {
|
|
145
|
+
getImplementationStatements,
|
|
146
|
+
resolveInterfaces
|
|
147
|
+
});
|
|
148
|
+
//# sourceMappingURL=resolve-integration-interfaces.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sdk/resolve-integration-interfaces.ts"],
|
|
4
|
+
"sourcesContent": ["import * as sdk from '@botpress/sdk'\nimport _ from 'lodash'\nimport * as utils from '../utils'\n\ntype InterfaceInstance = NonNullable<sdk.IntegrationDefinition['interfaces']>[number]\ntype ResolvedInterface = {\n actions: Record<string, sdk.ActionDefinition>\n events: Record<string, sdk.EventDefinition>\n channels: Record<string, sdk.ChannelDefinition>\n}\ntype InterfaceImplStatement = {\n id?: string\n name: string\n version: string\n entities: Record<string, { name: string }>\n actions: Record<string, { name: string }>\n events: Record<string, { name: string }>\n channels: Record<string, { name: string }>\n}\n\nexport const resolveInterfaces = <I extends sdk.IntegrationDefinition | sdk.IntegrationPackage['definition']>(\n integration: I\n): I => {\n const self = integration as utils.types.Writable<I>\n if (!self.interfaces) {\n return integration\n }\n\n for (const intrface of Object.values(self.interfaces)) {\n const { resolved } = _resolveInterface(intrface)\n\n /**\n * If an action is defined both in the integration and the interface; we merge both.\n * This allows setting more specific properties in the integration, while staying compatible with the interface.\n * Same goes for channels and events.\n */\n\n self.actions = utils.records.mergeRecords(self.actions ?? {}, resolved.actions, _mergeActions)\n self.channels = utils.records.mergeRecords(self.channels ?? {}, resolved.channels, _mergeChannels)\n self.events = utils.records.mergeRecords(self.events ?? {}, resolved.events, _mergeEvents)\n }\n\n return self\n}\n\nexport const getImplementationStatements = (\n integration: sdk.IntegrationDefinition\n): Record<string, InterfaceImplStatement> => {\n const self = integration as utils.types.Writable<sdk.IntegrationDefinition>\n if (!self.props.interfaces) {\n return {}\n }\n\n const statements: Record<string, InterfaceImplStatement> = {}\n for (const [interfaceKey, intrface] of Object.entries(self.props.interfaces)) {\n const { statement } = _resolveInterface(intrface)\n statements[interfaceKey] = statement\n }\n\n return statements\n}\n\nconst _mergeActions = (a: sdk.ActionDefinition, b: sdk.ActionDefinition): sdk.ActionDefinition => {\n return {\n ...a,\n ...b,\n input: {\n schema: a.input.schema.merge(b.input.schema),\n },\n output: {\n schema: a.output.schema.merge(b.output.schema),\n },\n }\n}\n\nconst _mergeEvents = (a: sdk.EventDefinition, b: sdk.EventDefinition): sdk.EventDefinition => {\n return {\n ...a,\n ...b,\n schema: a.schema.merge(b.schema),\n }\n}\n\nconst _mergeChannels = (a: sdk.ChannelDefinition, b: sdk.ChannelDefinition): sdk.ChannelDefinition => {\n const messages = utils.records.mergeRecords(a.messages, b.messages, _mergeMessage)\n return {\n ...a,\n ...b,\n messages,\n }\n}\n\nconst _mergeMessage = (a: sdk.MessageDefinition, b: sdk.MessageDefinition): sdk.MessageDefinition => {\n return {\n schema: a.schema.merge(b.schema),\n }\n}\n\nconst _resolveInterface = (\n intrface: InterfaceInstance\n): { resolved: ResolvedInterface; statement: InterfaceImplStatement } => {\n const id = 'id' in intrface ? intrface.id : undefined\n const {\n definition: { name, version },\n } = intrface\n\n const resolved: ResolvedInterface = { actions: {}, events: {}, channels: {} }\n const statement: InterfaceImplStatement = {\n id,\n name,\n version,\n entities: _.mapValues(intrface.entities, (entity) => ({ name: entity.name })), // { item: { name: 'issue' } },\n actions: {},\n events: {},\n channels: {},\n }\n\n const entitySchemas = _.mapValues(intrface.entities, (entity) => entity.schema)\n\n // dereference actions\n for (const [actionName, action] of Object.entries(intrface.definition.actions ?? {})) {\n const resolvedInputSchema = action.input.schema.dereference(entitySchemas) as sdk.z.AnyZodObject\n const resolvedOutputSchema = action.output.schema.dereference(entitySchemas) as sdk.z.AnyZodObject\n\n const newActionName = _rename(intrface, actionName)\n resolved.actions[newActionName] = {\n ...action,\n input: { schema: resolvedInputSchema },\n output: { schema: resolvedOutputSchema },\n }\n statement.actions[actionName] = { name: newActionName }\n }\n\n // dereference events\n for (const [eventName, event] of Object.entries(intrface.definition.events ?? {})) {\n const resolvedEventSchema = event.schema.dereference(entitySchemas) as sdk.z.AnyZodObject\n const newEventName = _rename(intrface, eventName)\n resolved.events[newEventName] = { ...event, schema: resolvedEventSchema }\n statement.events[eventName] = { name: newEventName }\n }\n\n // dereference channels\n for (const [channelName, channel] of Object.entries(intrface.definition.channels ?? {})) {\n const messages: Record<string, { schema: sdk.z.AnyZodObject }> = {}\n for (const [messageName, message] of Object.entries(channel.messages)) {\n const resolvedMessageSchema = message.schema.dereference(entitySchemas) as sdk.z.AnyZodObject\n // no renaming for messages as they are already contained within a channel that acts as a namespace\n messages[messageName] = { ...message, schema: resolvedMessageSchema }\n }\n const newChannelName = _rename(intrface, channelName)\n resolved.channels[newChannelName] = { ...channel, messages }\n statement.channels[channelName] = { name: newChannelName }\n }\n\n return { resolved, statement }\n}\n\nconst _rename = (intrface: InterfaceInstance, name: string) => {\n if (!intrface.definition.templateName) {\n return name\n }\n const { entities } = intrface\n const templateProps = _.mapValues(entities, (entity) => entity.name)\n return utils.template.formatHandleBars(intrface.definition.templateName, { ...templateProps, name })\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAc;AACd,YAAuB;AAkBhB,MAAM,oBAAoB,CAC/B,gBACM;AACN,QAAM,OAAO;AACb,MAAI,CAAC,KAAK,YAAY;AACpB,WAAO;AAAA,EACT;AAEA,aAAW,YAAY,OAAO,OAAO,KAAK,UAAU,GAAG;AACrD,UAAM,EAAE,SAAS,IAAI,kBAAkB,QAAQ;AAQ/C,SAAK,UAAU,MAAM,QAAQ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AoB;AACxE,cAAU,OAAO,aAAa,EAAE,MAAM,aAAa;AAAA,EACrD;AAGA,aAAW,CAAC,aAAa,OAAO,KAAK,OAAO,QAAQ,SAAS,WAAW,YAAY,CAAC,CAAC,GAAG;AACvF,UAAM,WAA2D,CAAC;AAClE,eAAW,CAAC,aAAa,OAAO,KAAK,OAAO,QAAQ,QAAQ,QAAQ,GAAG;AACrE,YAAM,wBAAwB,QAAQ,OAAO,YAAY,aAAa;AAEtE,eAAS,eAAe,EAAE,GAAG,SAAS,QAAQ,sBAAsB;AAAA,IACtE;AACA,UAAM,iBAAiB,QAAQ,UAAU,WAAW;AACpD,aAAS,SAAS,kBAAkB,EAAE,GAAG,SAAS,SAAS;AAC3D,cAAU,SAAS,eAAe,EAAE,MAAM,eAAe;AAAA,EAC3D;AAEA,SAAO,EAAE,UAAU,UAAU;AAC/B;AAEA,MAAM,UAAU,CAAC,UAA6B,SAAiB;AAC7D,MAAI,CAAC,SAAS,WAAW,cAAc;AACrC,WAAO;AAAA,EACT;AACA,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,gBAAgB,cAAAA,QAAE,UAAU,UAAU,CAAC,WAAW,OAAO,IAAI;AACnE,SAAO,MAAM,SAAS,iBAAiB,SAAS,WAAW,cAAc,EAAE,GAAG,eAAe,KAAK,CAAC;AACrG;",
|
|
6
|
+
"names": ["_"]
|
|
7
|
+
}
|
package/dist/utils/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __export(utils_exports, {
|
|
|
40
40
|
schema: () => schema,
|
|
41
41
|
semver: () => semver,
|
|
42
42
|
string: () => string,
|
|
43
|
+
template: () => template,
|
|
43
44
|
tunnel: () => tunnel,
|
|
44
45
|
types: () => types,
|
|
45
46
|
url: () => url
|
|
@@ -61,6 +62,7 @@ var require2 = __toESM(require("./require-utils"));
|
|
|
61
62
|
var schema = __toESM(require("./schema-utils"));
|
|
62
63
|
var semver = __toESM(require("./semver-utils"));
|
|
63
64
|
var string = __toESM(require("./string-utils"));
|
|
65
|
+
var template = __toESM(require("./template-utils"));
|
|
64
66
|
var tunnel = __toESM(require("./tunnel-utils"));
|
|
65
67
|
var types = __toESM(require("./type-utils"));
|
|
66
68
|
var url = __toESM(require("./url-utils"));
|
|
@@ -82,6 +84,7 @@ var url = __toESM(require("./url-utils"));
|
|
|
82
84
|
schema,
|
|
83
85
|
semver,
|
|
84
86
|
string,
|
|
87
|
+
template,
|
|
85
88
|
tunnel,
|
|
86
89
|
types,
|
|
87
90
|
url
|
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 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 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 tunnel from './tunnel-utils'\nexport * as types from './type-utils'\nexport * as url from './url-utils'\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;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,YAAuB;AACvB,aAAwB;AACxB,cAAyB;AACzB,cAAyB;AACzB,kBAA6B;AAC7B,aAAwB;AACxB,SAAoB;AACpB,WAAsB;AACtB,cAAyB;AACzB,eAA0B;AAC1B,aAAwB;AACxB,cAAyB;AACzB,IAAAA,WAAyB;AACzB,aAAwB;AACxB,aAAwB;AACxB,aAAwB;AACxB,aAAwB;AACxB,YAAuB;AACvB,UAAqB;",
|
|
4
|
+
"sourcesContent": ["export * 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 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'\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;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,YAAuB;AACvB,aAAwB;AACxB,cAAyB;AACzB,cAAyB;AACzB,kBAA6B;AAC7B,aAAwB;AACxB,SAAoB;AACpB,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;",
|
|
6
6
|
"names": ["require"]
|
|
7
7
|
}
|