@botpress/cli 5.5.3 → 5.5.5
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/linter/base-linter.test.js +35 -0
- package/dist/linter/base-linter.test.js.map +2 -2
- package/dist/linter/rulesets/bot.ruleset.js +2 -2
- package/dist/linter/rulesets/bot.ruleset.js.map +1 -1
- package/dist/linter/rulesets/integration.ruleset.js +6 -6
- package/dist/linter/rulesets/integration.ruleset.js.map +1 -1
- package/dist/linter/rulesets/interface.ruleset.js +4 -4
- package/dist/linter/rulesets/interface.ruleset.js.map +1 -1
- package/package.json +3 -3
- package/templates/empty-bot/package.json +2 -2
- package/templates/empty-integration/package.json +2 -2
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +2 -2
- package/templates/webhook-message/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@5.5.
|
|
2
|
+
> @botpress/cli@5.5.5 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@5.5.
|
|
6
|
+
> @botpress/cli@5.5.5 build:types /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> tsc -p ./tsconfig.build.json
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@5.5.
|
|
10
|
+
> @botpress/cli@5.5.5 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
11
11
|
> ts-node -T build.ts
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
> @botpress/cli@5.5.
|
|
14
|
+
> @botpress/cli@5.5.5 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 v5.5.
|
|
17
|
+
🤖 Botpress CLI v5.5.5
|
|
18
18
|
● Checking if cli is up to date
|
|
19
|
-
🤖 Botpress CLI v5.5.
|
|
19
|
+
🤖 Botpress CLI v5.5.5
|
|
20
20
|
● Checking if cli is up to date
|
|
21
|
-
🤖 Botpress CLI v5.5.
|
|
21
|
+
🤖 Botpress CLI v5.5.5
|
|
22
22
|
● Checking if cli is up to date
|
|
23
|
-
🤖 Botpress CLI v5.5.
|
|
23
|
+
🤖 Botpress CLI v5.5.5
|
|
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
|
-
● Checking if sdk is up to date
|
|
29
28
|
○ Generating typings for bot...
|
|
30
29
|
✓ Typings available at .botpress
|
|
31
30
|
|
|
32
31
|
○ Generating typings for integration empty-integration...
|
|
32
|
+
● Checking if sdk is up to date
|
|
33
33
|
✓ Typings available at .botpress
|
|
34
34
|
|
|
35
|
-
○ Generating typings for
|
|
35
|
+
○ Generating typings for integration hello-world...
|
|
36
36
|
✓ Typings available at .botpress
|
|
37
37
|
|
|
38
|
-
○ Generating typings for
|
|
38
|
+
○ Generating typings for plugin empty-plugin...
|
|
39
39
|
✓ Typings available at .botpress
|
|
40
40
|
|
|
41
|
-
🤖 Botpress CLI v5.5.
|
|
41
|
+
🤖 Botpress CLI v5.5.5
|
|
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...
|
|
@@ -1,6 +1,29 @@
|
|
|
1
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 __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
2
24
|
var import_vitest = require("vitest");
|
|
3
25
|
var import_integration_body = require("../api/integration-body");
|
|
26
|
+
var utils = __toESM(require("../utils"));
|
|
4
27
|
var import_integration_linter = require("./integration-linter");
|
|
5
28
|
var import_sdk = require("@botpress/sdk");
|
|
6
29
|
const EMPTY_STRING = "";
|
|
@@ -122,6 +145,18 @@ const lintDefinition = async (definition) => {
|
|
|
122
145
|
const integrationBody = await (0, import_integration_body.prepareCreateIntegrationBody)(integrationDefinition);
|
|
123
146
|
const linter = new import_integration_linter.IntegrationLinter({
|
|
124
147
|
...integrationBody,
|
|
148
|
+
configuration: integrationDefinition.configuration ? {
|
|
149
|
+
...integrationDefinition.configuration,
|
|
150
|
+
schema: await utils.schema.mapZodToJsonSchema(integrationDefinition.configuration, {
|
|
151
|
+
useLegacyZuiTransformer: integrationDefinition.__advanced?.useLegacyZuiTransformer
|
|
152
|
+
})
|
|
153
|
+
} : void 0,
|
|
154
|
+
configurations: integrationDefinition.configurations ? await utils.records.mapValuesAsync(integrationDefinition.configurations, async (configuration) => ({
|
|
155
|
+
...configuration,
|
|
156
|
+
schema: await utils.schema.mapZodToJsonSchema(configuration, {
|
|
157
|
+
useLegacyZuiTransformer: integrationDefinition.__advanced?.useLegacyZuiTransformer
|
|
158
|
+
})
|
|
159
|
+
})) : void 0,
|
|
125
160
|
readme: integrationDefinition.readme,
|
|
126
161
|
icon: integrationDefinition.icon,
|
|
127
162
|
secrets: integrationDefinition.secrets
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/linter/base-linter.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { test, expect, describe, vi } from 'vitest'\nimport { prepareCreateIntegrationBody } from '../api/integration-body'\nimport { IntegrationLinter } from './integration-linter'\nimport { IntegrationDefinition, type IntegrationDefinitionProps, z } from '@botpress/sdk'\n\nconst EMPTY_STRING = ''\nconst TRUTHY_STRING = 'truthy'\nconst ACTION_NAME = 'actionName'\nconst EVENT_NAME = 'eventName'\nconst CONFIG_NAME = 'configName'\nconst PARAM_NAME = 'paramName'\nconst TAG_NAME = 'tagName'\nconst CHANNEL_NAME = 'channelName'\nconst STATE_NAME = 'stateName'\nconst MESSAGE_TYPE = 'text'\nconst SECRET_NAME = 'SECRET_NAME'\n\nconst VALID_INTEGRATION = {\n name: TRUTHY_STRING,\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n version: TRUTHY_STRING,\n readme: TRUTHY_STRING,\n icon: TRUTHY_STRING,\n actions: {\n [ACTION_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n input: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n output: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n },\n events: {\n [EVENT_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n configuration: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n configurations: {\n [CONFIG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n user: {\n tags: {\n [TAG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n },\n },\n },\n channels: {\n [CHANNEL_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n messages: {\n [MESSAGE_TYPE]: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n message: {\n tags: {\n [TAG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n },\n },\n },\n conversation: {\n tags: {\n [TAG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n },\n },\n },\n },\n },\n states: {\n [STATE_NAME]: {\n type: 'integration',\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n secrets: {\n [SECRET_NAME]: {\n description: TRUTHY_STRING,\n },\n },\n} as const satisfies IntegrationDefinitionProps\n\nconst mockLogger = {\n log: vi.fn((message) => void message),\n warn: vi.fn((message) => void message),\n error: vi.fn((message) => void message),\n debug: vi.fn((message) => void message),\n}\n\nconst lintDefinition = async (definition: IntegrationDefinitionProps) => {\n const integrationDefinition = new IntegrationDefinition(definition)\n const integrationBody = await prepareCreateIntegrationBody(integrationDefinition)\n const linter = new IntegrationLinter({\n ...integrationBody,\n readme: integrationDefinition.readme,\n icon: integrationDefinition.icon,\n secrets: integrationDefinition.secrets,\n })\n await linter.lint()\n return linter\n}\n\nconst lintDefinitionAndReturnResults = async (definition: IntegrationDefinitionProps) => {\n const linter = await lintDefinition(definition)\n return linter.getSortedResults()\n}\n\nconst lintDefinitionAndLogResults = async (definition: IntegrationDefinitionProps) => {\n const linter = await lintDefinition(definition)\n linter.logResults(mockLogger as any)\n}\n\ndescribe.concurrent('Integration Linter', () => {\n test('should lint a valid definition without giving errors', async () => {\n // arrange\n const definition = VALID_INTEGRATION\n\n // act\n const results = await lintDefinitionAndReturnResults(definition)\n\n expect(results).toEqual([])\n })\n\n test('should report an error when missing required fields', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n title: EMPTY_STRING,\n } as const\n\n // act\n const results = await lintDefinitionAndReturnResults(definition)\n\n // assert\n expect(results[0]?.message).toContain('title')\n })\n\n test('should report an error when missing a title in an action input schema', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n actions: {\n [ACTION_NAME]: {\n ...VALID_INTEGRATION.actions[ACTION_NAME],\n input: {\n schema: z.object({\n [PARAM_NAME]: z.string().describe(TRUTHY_STRING),\n }),\n },\n },\n },\n } as const\n\n // act\n const results = await lintDefinitionAndReturnResults(definition)\n\n // assert\n expect(results[0]?.message).toContain('title')\n })\n\n test('should log as an error when severity is 0', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n title: EMPTY_STRING,\n } as const\n\n // act\n await lintDefinitionAndLogResults(definition)\n\n // assert\n expect(mockLogger.error).toHaveBeenCalled()\n })\n\n test('should log as a warning when severity is 1', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n user: {\n tags: {\n [TAG_NAME]: {},\n },\n },\n } as const\n\n // act\n await lintDefinitionAndLogResults(definition)\n\n // assert\n expect(mockLogger.warn).toHaveBeenCalled()\n })\n})\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { test, expect, describe, vi } from 'vitest'\nimport { prepareCreateIntegrationBody } from '../api/integration-body'\nimport * as utils from '../utils'\nimport { IntegrationLinter } from './integration-linter'\nimport { IntegrationDefinition, type IntegrationDefinitionProps, z } from '@botpress/sdk'\n\nconst EMPTY_STRING = ''\nconst TRUTHY_STRING = 'truthy'\nconst ACTION_NAME = 'actionName'\nconst EVENT_NAME = 'eventName'\nconst CONFIG_NAME = 'configName'\nconst PARAM_NAME = 'paramName'\nconst TAG_NAME = 'tagName'\nconst CHANNEL_NAME = 'channelName'\nconst STATE_NAME = 'stateName'\nconst MESSAGE_TYPE = 'text'\nconst SECRET_NAME = 'SECRET_NAME'\n\nconst VALID_INTEGRATION = {\n name: TRUTHY_STRING,\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n version: TRUTHY_STRING,\n readme: TRUTHY_STRING,\n icon: TRUTHY_STRING,\n actions: {\n [ACTION_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n input: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n output: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n },\n events: {\n [EVENT_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n configuration: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n configurations: {\n [CONFIG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n user: {\n tags: {\n [TAG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n },\n },\n },\n channels: {\n [CHANNEL_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n messages: {\n [MESSAGE_TYPE]: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n message: {\n tags: {\n [TAG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n },\n },\n },\n conversation: {\n tags: {\n [TAG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n },\n },\n },\n },\n },\n states: {\n [STATE_NAME]: {\n type: 'integration',\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n secrets: {\n [SECRET_NAME]: {\n description: TRUTHY_STRING,\n },\n },\n} as const satisfies IntegrationDefinitionProps\n\nconst mockLogger = {\n log: vi.fn((message) => void message),\n warn: vi.fn((message) => void message),\n error: vi.fn((message) => void message),\n debug: vi.fn((message) => void message),\n}\n\nconst lintDefinition = async (definition: IntegrationDefinitionProps) => {\n const integrationDefinition = new IntegrationDefinition(definition)\n const integrationBody = await prepareCreateIntegrationBody(integrationDefinition)\n const linter = new IntegrationLinter({\n ...integrationBody,\n configuration: integrationDefinition.configuration\n ? {\n ...integrationDefinition.configuration,\n schema: await utils.schema.mapZodToJsonSchema(integrationDefinition.configuration, {\n useLegacyZuiTransformer: integrationDefinition.__advanced?.useLegacyZuiTransformer,\n }),\n }\n : undefined,\n configurations: integrationDefinition.configurations\n ? await utils.records.mapValuesAsync(integrationDefinition.configurations, async (configuration) => ({\n ...configuration,\n schema: await utils.schema.mapZodToJsonSchema(configuration, {\n useLegacyZuiTransformer: integrationDefinition.__advanced?.useLegacyZuiTransformer,\n }),\n }))\n : undefined,\n readme: integrationDefinition.readme,\n icon: integrationDefinition.icon,\n secrets: integrationDefinition.secrets,\n })\n await linter.lint()\n return linter\n}\n\nconst lintDefinitionAndReturnResults = async (definition: IntegrationDefinitionProps) => {\n const linter = await lintDefinition(definition)\n return linter.getSortedResults()\n}\n\nconst lintDefinitionAndLogResults = async (definition: IntegrationDefinitionProps) => {\n const linter = await lintDefinition(definition)\n linter.logResults(mockLogger as any)\n}\n\ndescribe.concurrent('Integration Linter', () => {\n test('should lint a valid definition without giving errors', async () => {\n // arrange\n const definition = VALID_INTEGRATION\n\n // act\n const results = await lintDefinitionAndReturnResults(definition)\n\n expect(results).toEqual([])\n })\n\n test('should report an error when missing required fields', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n title: EMPTY_STRING,\n } as const\n\n // act\n const results = await lintDefinitionAndReturnResults(definition)\n\n // assert\n expect(results[0]?.message).toContain('title')\n })\n\n test('should report an error when missing a title in an action input schema', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n actions: {\n [ACTION_NAME]: {\n ...VALID_INTEGRATION.actions[ACTION_NAME],\n input: {\n schema: z.object({\n [PARAM_NAME]: z.string().describe(TRUTHY_STRING),\n }),\n },\n },\n },\n } as const\n\n // act\n const results = await lintDefinitionAndReturnResults(definition)\n\n // assert\n expect(results[0]?.message).toContain('title')\n })\n\n test('should log as an error when severity is 0', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n title: EMPTY_STRING,\n } as const\n\n // act\n await lintDefinitionAndLogResults(definition)\n\n // assert\n expect(mockLogger.error).toHaveBeenCalled()\n })\n\n test('should log as a warning when severity is 1', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n user: {\n tags: {\n [TAG_NAME]: {},\n },\n },\n } as const\n\n // act\n await lintDefinitionAndLogResults(definition)\n\n // assert\n expect(mockLogger.warn).toHaveBeenCalled()\n })\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,oBAA2C;AAC3C,8BAA6C;AAC7C,YAAuB;AACvB,gCAAkC;AAClC,iBAA0E;AAE1E,MAAM,eAAe;AACrB,MAAM,gBAAgB;AACtB,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,WAAW;AACjB,MAAM,eAAe;AACrB,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,cAAc;AAEpB,MAAM,oBAAoB;AAAA,EACxB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,IACP,CAAC,WAAW,GAAG;AAAA,MACb,OAAO;AAAA,MACP,aAAa;AAAA,MACb,OAAO;AAAA,QACL,QAAQ,aACL,OAAO;AAAA,UACN,CAAC,UAAU,GAAG,aAAE,OAAO,EAAE,MAAM,aAAa,EAAE,SAAS,aAAa;AAAA,QACtE,CAAC,EACA,MAAM,aAAa,EACnB,SAAS,aAAa;AAAA,MAC3B;AAAA,MACA,QAAQ;AAAA,QACN,QAAQ,aACL,OAAO;AAAA,UACN,CAAC,UAAU,GAAG,aAAE,OAAO,EAAE,MAAM,aAAa,EAAE,SAAS,aAAa;AAAA,QACtE,CAAC,EACA,MAAM,aAAa,EACnB,SAAS,aAAa;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,CAAC,UAAU,GAAG;AAAA,MACZ,OAAO;AAAA,MACP,aAAa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,EAC/C,CAAC;AAED,0BAAK,6CAA6C,YAAY;AAE5D,UAAM,aAAa;AAAA,MACjB,GAAG;AAAA,MACH,OAAO;AAAA,IACT;AAGA,UAAM,4BAA4B,UAAU;AAG5C,8BAAO,WAAW,KAAK,EAAE,iBAAiB;AAAA,EAC5C,CAAC;AAED,0BAAK,8CAA8C,YAAY;AAE7D,UAAM,aAAa;AAAA,MACjB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,MAAM;AAAA,UACJ,CAAC,QAAQ,GAAG,CAAC;AAAA,QACf;AAAA,MACF;AAAA,IACF;AAGA,UAAM,4BAA4B,UAAU;AAG5C,8BAAO,WAAW,IAAI,EAAE,iBAAiB;AAAA,EAC3C,CAAC;AACH,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -61,10 +61,10 @@ const BOT_RULESET = (0, import_ruleset_functions.preprocessRuleset)({
|
|
|
61
61
|
description: "All configuration fields {{callToAction}} have a title",
|
|
62
62
|
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
63
63
|
severity: "error",
|
|
64
|
-
given: "$.configuration..schema.properties[*]
|
|
64
|
+
given: "$.configuration..schema.properties[*]",
|
|
65
65
|
then: [
|
|
66
66
|
{
|
|
67
|
-
field: "title",
|
|
67
|
+
field: "x-zui.title",
|
|
68
68
|
function: (0, import_spectral_functions2.truthyWithMessage)({
|
|
69
69
|
failMsgMapper: ({ path, isFallback }) => `configuration parameter "${path.at(isFallback ? -5 : -3)}"`,
|
|
70
70
|
fallbackExtractor: import_spectral_functions2.titleFallbackExtractor
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/linter/rulesets/bot.ruleset.ts"],
|
|
4
|
-
"sourcesContent": ["import { falsy } from '@stoplight/spectral-functions'\nimport { preprocessRuleset } from '../ruleset-functions'\nimport { descriptionFallbackExtractor, titleFallbackExtractor, truthyWithMessage } from '../spectral-functions'\n\nexport const BOT_RULESET = preprocessRuleset({\n extends: [],\n rules: {\n 'event-outputparams-should-have-title': {\n description: 'All event output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of event \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-must-have-description': {\n description: 'All event output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of event \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'configuration-fields-must-have-a-title': {\n description: 'All configuration fields {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'error',\n given: '$.configuration..schema.properties[*]
|
|
4
|
+
"sourcesContent": ["import { falsy } from '@stoplight/spectral-functions'\nimport { preprocessRuleset } from '../ruleset-functions'\nimport { descriptionFallbackExtractor, titleFallbackExtractor, truthyWithMessage } from '../spectral-functions'\n\nexport const BOT_RULESET = preprocessRuleset({\n extends: [],\n rules: {\n 'event-outputparams-should-have-title': {\n description: 'All event output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of event \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-must-have-description': {\n description: 'All event output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of event \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'configuration-fields-must-have-a-title': {\n description: 'All configuration fields {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'error',\n given: '$.configuration..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `configuration parameter \"${path.at(isFallback ? -5 : -3)}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'configuration-fields-must-have-a-description': {\n description: 'All configuration fields {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.configuration..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `configuration parameter \"${path.at(isFallback ? -4 : -2)}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'user-tags-should-have-a-title': {\n description: 'All user tags {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.user.tags[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `user tag \"${path[2]}\"`),\n },\n ],\n },\n 'user-tags-must-have-a-description': {\n description: 'All user tags {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.user.tags[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `user tag \"${path[2]}\"`),\n },\n ],\n },\n 'conversation-tags-should-have-a-title': {\n description: 'All conversation tags {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.conversation.tags[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `conversation tag \"${path[2]}\"`),\n },\n ],\n },\n 'conversation-tags-must-have-a-description': {\n description: 'All conversation tags {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.conversation.tags[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `conversation tag \"${path[2]}\"`),\n },\n ],\n },\n 'message-tags-should-have-a-title': {\n description: 'All message tags {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.message.tags[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `message tag \"${path[2]}\"`),\n },\n ],\n },\n 'message-tags-must-have-a-description': {\n description: 'All message tags {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.message.tags[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `message tag \"${path[2]}\"`),\n },\n ],\n },\n 'legacy-zui-title-should-be-removed': {\n description:\n 'Legacy ZUI title fields (ui.title) {{callToAction}} be removed. Please use .title() in your Zod schemas instead',\n severity: 'error',\n given: '$..ui[*].title',\n then: [{ function: falsy }],\n },\n 'legacy-zui-examples-should-be-removed': {\n description:\n 'Legacy ZUI examples fields (ui.examples) {{callToAction}} be removed. There are currently no alternatives',\n severity: 'hint',\n given: '$..ui[*].examples',\n then: [{ function: falsy }],\n },\n 'state-fields-should-have-title': {\n description: 'All state fields {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.states[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -5 : -3)}\" of state \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'state-fields-must-have-description': {\n description: 'All state fields {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.states[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -4 : -2)}\" of state \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n },\n})\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAsB;AACtB,+BAAkC;AAClC,IAAAA,6BAAwF;AAEjF,MAAM,kBAAc,4CAAkB;AAAA,EAC3C,SAAS,CAAC;AAAA,EACV,OAAO;AAAA,IACL,wCAAwC;AAAA,MACtC,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB;AAAA,YAC1B,eAAe,CAAC,EAAE,MAAM,WAAW,MACjC,qBAAqB,KAAK,GAAG,aAAa,KAAK,EAAE,CAAC,eAAe,KAAK,CAAC,CAAC;AAAA,YAC1E,mBAAmB;AAAA,UACrB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,4CAA4C;AAAA,MAC1C,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAA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;AAAA,IACA,yCAAyC;AAAA,MACvC,aACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM,CAAC,EAAE,UAAU,gCAAM,CAAC;AAAA,IAC5B;AAAA,IACA,kCAAkC;AAAA,MAChC,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB;AAAA,YAC1B,eAAe,CAAC,EAAE,MAAM,WAAW,MAAM,UAAU,KAAK,GAAG,aAAa,KAAK,EAAE,CAAC,eAAe,KAAK,CAAC,CAAC;AAAA,YACtG,mBAAmB;AAAA,UACrB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,sCAAsC;AAAA,MACpC,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB;AAAA,YAC1B,eAAe,CAAC,EAAE,MAAM,WAAW,MAAM,UAAU,KAAK,GAAG,aAAa,KAAK,EAAE,CAAC,eAAe,KAAK,CAAC,CAAC;AAAA,YACtG,mBAAmB;AAAA,UACrB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
|
|
6
6
|
"names": ["import_spectral_functions"]
|
|
7
7
|
}
|
|
@@ -99,10 +99,10 @@ const INTEGRATION_RULESET = (0, import_ruleset_functions.preprocessRuleset)({
|
|
|
99
99
|
description: "All action output parameters {{callToAction}} have a title",
|
|
100
100
|
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
101
101
|
severity: "warn",
|
|
102
|
-
given: "$.actions[*].output..schema.properties[*]
|
|
102
|
+
given: "$.actions[*].output..schema.properties[*]",
|
|
103
103
|
then: [
|
|
104
104
|
{
|
|
105
|
-
field: "title",
|
|
105
|
+
field: "x-zui.title",
|
|
106
106
|
function: (0, import_spectral_functions2.truthyWithMessage)({
|
|
107
107
|
failMsgMapper: ({ path, isFallback }) => `output parameter "${path.at(isFallback ? -5 : -3)}" of action "${path[1]}"`,
|
|
108
108
|
fallbackExtractor: import_spectral_functions2.titleFallbackExtractor
|
|
@@ -182,10 +182,10 @@ const INTEGRATION_RULESET = (0, import_ruleset_functions.preprocessRuleset)({
|
|
|
182
182
|
description: "All configuration fields {{callToAction}} have a title",
|
|
183
183
|
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
184
184
|
severity: "error",
|
|
185
|
-
given: "$.configuration..schema.properties[*]
|
|
185
|
+
given: "$.configuration..schema.properties[*]",
|
|
186
186
|
then: [
|
|
187
187
|
{
|
|
188
|
-
field: "title",
|
|
188
|
+
field: "x-zui.title",
|
|
189
189
|
function: (0, import_spectral_functions2.truthyWithMessage)({
|
|
190
190
|
failMsgMapper: ({ path, isFallback }) => `configuration parameter "${path.at(isFallback ? -5 : -3)}"`,
|
|
191
191
|
fallbackExtractor: import_spectral_functions2.titleFallbackExtractor
|
|
@@ -226,10 +226,10 @@ const INTEGRATION_RULESET = (0, import_ruleset_functions.preprocessRuleset)({
|
|
|
226
226
|
description: "All configuration fields in multiple configurations {{callToAction}} have a title",
|
|
227
227
|
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
228
228
|
severity: "error",
|
|
229
|
-
given: "$.configurations[*]..schema.properties[*]
|
|
229
|
+
given: "$.configurations[*]..schema.properties[*]",
|
|
230
230
|
then: [
|
|
231
231
|
{
|
|
232
|
-
field: "title",
|
|
232
|
+
field: "x-zui.title",
|
|
233
233
|
function: (0, import_spectral_functions2.truthyWithMessage)({
|
|
234
234
|
failMsgMapper: ({ path, isFallback }) => `configuration field "${path.at(isFallback ? -5 : -3)}" of configuration "${path[1]}"`,
|
|
235
235
|
fallbackExtractor: import_spectral_functions2.titleFallbackExtractor
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/linter/rulesets/integration.ruleset.ts"],
|
|
4
|
-
"sourcesContent": ["import { falsy, truthy } from '@stoplight/spectral-functions'\nimport { preprocessRuleset } from '../ruleset-functions'\nimport { descriptionFallbackExtractor, titleFallbackExtractor, truthyWithMessage } from '../spectral-functions'\n\nexport const INTEGRATION_RULESET = preprocessRuleset({\n extends: [],\n rules: {\n 'integration-title-must-be-present': {\n description: 'The integration {{callToAction}} have a non-empty title',\n severity: 'error',\n given: '$',\n then: [{ field: 'title', function: truthy }],\n },\n 'integration-description-must-be-present': {\n description: 'The integration {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$',\n then: [{ field: 'description', function: truthy }],\n },\n 'integration-must-have-an-icon': {\n description: 'The integration {{callToAction}} have an icon',\n severity: 'error',\n given: '$',\n then: [{ field: 'icon', function: truthy }],\n },\n 'integration-must-have-a-readme-file': {\n description: 'The integration {{callToAction}} have a readme file',\n severity: 'error',\n given: '$',\n then: [{ field: 'readme', function: truthy }],\n },\n 'actions-should-have-a-title': {\n description: 'All actions {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.actions[*]',\n then: [{ field: 'title', function: truthyWithMessage(({ path }) => `action \"${path[1]}\"`) }],\n },\n 'actions-must-have-a-description': {\n description: 'All actions {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.actions[*]',\n then: [{ field: 'description', function: truthyWithMessage(({ path }) => `action \"${path[1]}\"`) }],\n },\n 'action-inputparams-should-have-a-title': {\n description: 'All action input parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.actions[*].input..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `input parameter \"${path.at(isFallback ? -5 : -3)}\" of action \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'action-inputparams-must-have-a-description': {\n description: 'All action input parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.actions[*].input..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `input parameter \"${path.at(isFallback ? -4 : -2)}\" of action \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'action-outputparams-should-have-a-title': {\n description: 'All action output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.actions[*].output..schema.properties[*].x-zui',\n then: [\n {\n field: 'title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of action \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'action-outputparams-must-have-a-description': {\n description: 'All action output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.actions[*].output..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of action \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-should-have-title': {\n description: 'All event output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of event \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-must-have-description': {\n description: 'All event output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of event \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'events-must-have-a-title': {\n description: 'All events {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} be a non-empty string',\n severity: 'error',\n given: '$.events[*]',\n then: [{ field: 'title', function: truthyWithMessage(({ path }) => `event \"${path[1]}\"`) }],\n },\n 'events-must-have-a-description': {\n description: 'All events {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} be a non-empty string',\n severity: 'error',\n given: '$.events[*]',\n then: [{ field: 'description', function: truthyWithMessage(({ path }) => `event \"${path[1]}\"`) }],\n },\n 'consider-migrating-to-configurations': {\n description:\n 'Consider migrating to the new multiple configuration format: you MAY move your configuration from \"configuration\" to \"configurations\" and remove the \"configuration\" property',\n severity: 'off',\n given: '$',\n then: [\n { field: 'configuration', function: falsy },\n { field: 'configurations', function: truthy },\n ],\n },\n 'configuration-fields-must-have-a-title': {\n description: 'All configuration fields {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'error',\n given: '$.configuration..schema.properties[*].x-zui',\n then: [\n {\n field: 'title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `configuration parameter \"${path.at(isFallback ? -5 : -3)}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'configuration-fields-must-have-a-description': {\n description: 'All configuration fields {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.configuration..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `configuration parameter \"${path.at(isFallback ? -4 : -2)}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'multiple-configurations-must-have-a-title': {\n description: 'Multiple configuration definitions {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a title',\n severity: 'error',\n given: '$.configurations[*]',\n then: [{ field: 'title', function: truthyWithMessage(({ path }) => `configuration \"${path[1]}\"`) }],\n },\n 'multiple-configurations-must-have-a-description': {\n description: 'Multiple configuration definitions {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a description',\n severity: 'error',\n given: '$.configurations[*]',\n then: [{ field: 'description', function: truthyWithMessage(({ path }) => `configuration \"${path[1]}\"`) }],\n },\n 'multipes-configurations-fields-must-have-a-title': {\n description: 'All configuration fields in multiple configurations {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'error',\n given: '$.configurations[*]..schema.properties[*].x-zui',\n then: [\n {\n field: 'title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `configuration field \"${path.at(isFallback ? -5 : -3)}\" of configuration \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'multipes-configurations-fields-must-have-a-description': {\n description: 'All configuration fields in multiple configurations {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.configurations[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `configuration field \"${path.at(isFallback ? -4 : -2)}\" of configuration \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'user-tags-should-have-a-title': {\n description: 'All user tags {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.user.tags[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `user tag \"${path[2]}\"`),\n },\n ],\n },\n 'user-tags-must-have-a-description': {\n description: 'All user tags {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.user.tags[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `user tag \"${path[2]}\"`),\n },\n ],\n },\n 'channels-should-have-a-title': {\n description: 'All channels {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.channels[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-must-have-a-description': {\n description: 'All channels {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.channels[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-conversation-tags-should-have-a-title': {\n description: 'All conversation tags {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.channels[*].conversation.tags[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `conversation tag \"${path.at(-2)}\" of channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-conversation-tags-must-have-a-description': {\n description: 'All conversation tags {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.channels[*].conversation.tags[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `conversation tag \"${path.at(-2)}\" of channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-message-tags-should-have-a-title': {\n description: 'All message tags {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.channels[*].message.tags[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `message tag \"${path.at(-2)}\" of channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-message-tags-must-have-a-description': {\n description: 'All message tags {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.channels[*].message.tags[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `message tag \"${path.at(-2)}\" of channel \"${path[1]}\"`),\n },\n ],\n },\n 'legacy-zui-title-should-be-removed': {\n description:\n 'Legacy ZUI title fields (ui.title) {{callToAction}} be removed. Please use .title() in your Zod schemas instead',\n severity: 'error',\n given: '$..ui[*].title',\n then: [{ function: falsy }],\n },\n 'legacy-zui-examples-should-be-removed': {\n description:\n 'Legacy ZUI examples fields (ui.examples) {{callToAction}} be removed. There are currently no alternatives',\n severity: 'hint',\n given: '$..ui[*].examples',\n then: [{ function: falsy }],\n },\n 'state-fields-should-have-title': {\n description: 'All state fields {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.states[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -5 : -3)}\" of state \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'state-fields-must-have-description': {\n description: 'All state fields {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.states[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -4 : -2)}\" of state \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'secrets-must-have-a-description': {\n description: 'All secrets {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.secrets[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `secret \"${path[1]}\"`),\n },\n ],\n },\n },\n})\n"],
|
|
4
|
+
"sourcesContent": ["import { falsy, truthy } from '@stoplight/spectral-functions'\nimport { preprocessRuleset } from '../ruleset-functions'\nimport { descriptionFallbackExtractor, titleFallbackExtractor, truthyWithMessage } from '../spectral-functions'\n\nexport const INTEGRATION_RULESET = preprocessRuleset({\n extends: [],\n rules: {\n 'integration-title-must-be-present': {\n description: 'The integration {{callToAction}} have a non-empty title',\n severity: 'error',\n given: '$',\n then: [{ field: 'title', function: truthy }],\n },\n 'integration-description-must-be-present': {\n description: 'The integration {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$',\n then: [{ field: 'description', function: truthy }],\n },\n 'integration-must-have-an-icon': {\n description: 'The integration {{callToAction}} have an icon',\n severity: 'error',\n given: '$',\n then: [{ field: 'icon', function: truthy }],\n },\n 'integration-must-have-a-readme-file': {\n description: 'The integration {{callToAction}} have a readme file',\n severity: 'error',\n given: '$',\n then: [{ field: 'readme', function: truthy }],\n },\n 'actions-should-have-a-title': {\n description: 'All actions {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.actions[*]',\n then: [{ field: 'title', function: truthyWithMessage(({ path }) => `action \"${path[1]}\"`) }],\n },\n 'actions-must-have-a-description': {\n description: 'All actions {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.actions[*]',\n then: [{ field: 'description', function: truthyWithMessage(({ path }) => `action \"${path[1]}\"`) }],\n },\n 'action-inputparams-should-have-a-title': {\n description: 'All action input parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.actions[*].input..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `input parameter \"${path.at(isFallback ? -5 : -3)}\" of action \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'action-inputparams-must-have-a-description': {\n description: 'All action input parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.actions[*].input..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `input parameter \"${path.at(isFallback ? -4 : -2)}\" of action \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'action-outputparams-should-have-a-title': {\n description: 'All action output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.actions[*].output..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of action \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'action-outputparams-must-have-a-description': {\n description: 'All action output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.actions[*].output..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of action \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-should-have-title': {\n description: 'All event output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of event \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-must-have-description': {\n description: 'All event output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of event \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'events-must-have-a-title': {\n description: 'All events {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} be a non-empty string',\n severity: 'error',\n given: '$.events[*]',\n then: [{ field: 'title', function: truthyWithMessage(({ path }) => `event \"${path[1]}\"`) }],\n },\n 'events-must-have-a-description': {\n description: 'All events {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} be a non-empty string',\n severity: 'error',\n given: '$.events[*]',\n then: [{ field: 'description', function: truthyWithMessage(({ path }) => `event \"${path[1]}\"`) }],\n },\n 'consider-migrating-to-configurations': {\n description:\n 'Consider migrating to the new multiple configuration format: you MAY move your configuration from \"configuration\" to \"configurations\" and remove the \"configuration\" property',\n severity: 'off',\n given: '$',\n then: [\n { field: 'configuration', function: falsy },\n { field: 'configurations', function: truthy },\n ],\n },\n 'configuration-fields-must-have-a-title': {\n description: 'All configuration fields {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'error',\n given: '$.configuration..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `configuration parameter \"${path.at(isFallback ? -5 : -3)}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'configuration-fields-must-have-a-description': {\n description: 'All configuration fields {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.configuration..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `configuration parameter \"${path.at(isFallback ? -4 : -2)}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'multiple-configurations-must-have-a-title': {\n description: 'Multiple configuration definitions {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a title',\n severity: 'error',\n given: '$.configurations[*]',\n then: [{ field: 'title', function: truthyWithMessage(({ path }) => `configuration \"${path[1]}\"`) }],\n },\n 'multiple-configurations-must-have-a-description': {\n description: 'Multiple configuration definitions {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a description',\n severity: 'error',\n given: '$.configurations[*]',\n then: [{ field: 'description', function: truthyWithMessage(({ path }) => `configuration \"${path[1]}\"`) }],\n },\n 'multipes-configurations-fields-must-have-a-title': {\n description: 'All configuration fields in multiple configurations {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'error',\n given: '$.configurations[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `configuration field \"${path.at(isFallback ? -5 : -3)}\" of configuration \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'multipes-configurations-fields-must-have-a-description': {\n description: 'All configuration fields in multiple configurations {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.configurations[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `configuration field \"${path.at(isFallback ? -4 : -2)}\" of configuration \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'user-tags-should-have-a-title': {\n description: 'All user tags {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.user.tags[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `user tag \"${path[2]}\"`),\n },\n ],\n },\n 'user-tags-must-have-a-description': {\n description: 'All user tags {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.user.tags[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `user tag \"${path[2]}\"`),\n },\n ],\n },\n 'channels-should-have-a-title': {\n description: 'All channels {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.channels[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-must-have-a-description': {\n description: 'All channels {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.channels[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-conversation-tags-should-have-a-title': {\n description: 'All conversation tags {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.channels[*].conversation.tags[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `conversation tag \"${path.at(-2)}\" of channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-conversation-tags-must-have-a-description': {\n description: 'All conversation tags {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.channels[*].conversation.tags[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `conversation tag \"${path.at(-2)}\" of channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-message-tags-should-have-a-title': {\n description: 'All message tags {{callToAction}} have a title',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty title',\n severity: 'warn',\n given: '$.channels[*].message.tags[*]',\n then: [\n {\n field: 'title',\n function: truthyWithMessage(({ path }) => `message tag \"${path.at(-2)}\" of channel \"${path[1]}\"`),\n },\n ],\n },\n 'channels-message-tags-must-have-a-description': {\n description: 'All message tags {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.channels[*].message.tags[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `message tag \"${path.at(-2)}\" of channel \"${path[1]}\"`),\n },\n ],\n },\n 'legacy-zui-title-should-be-removed': {\n description:\n 'Legacy ZUI title fields (ui.title) {{callToAction}} be removed. Please use .title() in your Zod schemas instead',\n severity: 'error',\n given: '$..ui[*].title',\n then: [{ function: falsy }],\n },\n 'legacy-zui-examples-should-be-removed': {\n description:\n 'Legacy ZUI examples fields (ui.examples) {{callToAction}} be removed. There are currently no alternatives',\n severity: 'hint',\n given: '$..ui[*].examples',\n then: [{ function: falsy }],\n },\n 'state-fields-should-have-title': {\n description: 'All state fields {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.states[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -5 : -3)}\" of state \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'state-fields-must-have-description': {\n description: 'All state fields {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.states[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -4 : -2)}\" of state \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'secrets-must-have-a-description': {\n description: 'All secrets {{callToAction}} have a description',\n message: '{{description}}: {{error}} {{callToAction}} have a non-empty description',\n severity: 'error',\n given: '$.secrets[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage(({ path }) => `secret \"${path[1]}\"`),\n },\n ],\n },\n },\n})\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAA8B;AAC9B,+BAAkC;AAClC,IAAAA,6BAAwF;AAEjF,MAAM,0BAAsB,4CAAkB;AAAA,EACnD,SAAS,CAAC;AAAA,EACV,OAAO;AAAA,IACL,qCAAqC;AAAA,MACnC,aAAa;AAAA,MACb,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM,CAAC,EAAE,OAAO,SAAS,UAAU,iCAAO,CAAC;AAAA,IAC7C;AAAA,IACA,2CAA2C;AAAA,MACzC,aAAa;AAAA,MACb,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM,CAAC,EAAE,OAAO,eAAe,UAAU,iCAAO,CAAC;AAAA,IACnD;AAAA,IACA,iCAAiC;AAAA,MAC/B,aAAa;AAAA,MACb,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM,CAAC,EAAE,OAAO,QAAQ,UAAU,iCAAO,CAAC;AAAA,IAC5C;AAAA,IACA,uCAAuC;AAAA,MACrC,aAAa;AAAA,MACb,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM,CAAC,EAAE,OAAO,UAAU,UAAU,iCAA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A,IACA,kCAAkC;AAAA,MAChC,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB;AAAA,YAC1B,eAAe,CAAC,EAAE,MAAM,WAAW,MAAM,UAAU,KAAK,GAAG,aAAa,KAAK,EAAE,CAAC,eAAe,KAAK,CAAC,CAAC;AAAA,YACtG,mBAAmB;AAAA,UACrB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,sCAAsC;AAAA,MACpC,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB;AAAA,YAC1B,eAAe,CAAC,EAAE,MAAM,WAAW,MAAM,UAAU,KAAK,GAAG,aAAa,KAAK,EAAE,CAAC,eAAe,KAAK,CAAC,CAAC;AAAA,YACtG,mBAAmB;AAAA,UACrB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,mCAAmC;AAAA,MACjC,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB,CAAC,EAAE,KAAK,MAAM,WAAW,KAAK,CAAC,CAAC,GAAG;AAAA,QACjE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
|
|
6
6
|
"names": ["import_spectral_functions"]
|
|
7
7
|
}
|
|
@@ -31,10 +31,10 @@ const INTERFACE_RULESET = (0, import_ruleset_functions.preprocessRuleset)({
|
|
|
31
31
|
description: "All action input parameters {{callToAction}} have a title",
|
|
32
32
|
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
33
33
|
severity: "warn",
|
|
34
|
-
given: "$.actions[*].input..schema.properties[*]
|
|
34
|
+
given: "$.actions[*].input..schema.properties[*]",
|
|
35
35
|
then: [
|
|
36
36
|
{
|
|
37
|
-
field: "title",
|
|
37
|
+
field: "x-zui.title",
|
|
38
38
|
function: (0, import_spectral_functions2.truthyWithMessage)({
|
|
39
39
|
failMsgMapper: ({ path, isFallback }) => `input parameter "${path.at(isFallback ? -5 : -3)}" of action "${path[1]}"`,
|
|
40
40
|
fallbackExtractor: import_spectral_functions2.titleFallbackExtractor
|
|
@@ -61,10 +61,10 @@ const INTERFACE_RULESET = (0, import_ruleset_functions.preprocessRuleset)({
|
|
|
61
61
|
description: "All action output parameters {{callToAction}} have a title",
|
|
62
62
|
message: "{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema",
|
|
63
63
|
severity: "warn",
|
|
64
|
-
given: "$.actions[*].output..schema.properties[*]
|
|
64
|
+
given: "$.actions[*].output..schema.properties[*]",
|
|
65
65
|
then: [
|
|
66
66
|
{
|
|
67
|
-
field: "title",
|
|
67
|
+
field: "x-zui.title",
|
|
68
68
|
function: (0, import_spectral_functions2.truthyWithMessage)({
|
|
69
69
|
failMsgMapper: ({ path, isFallback }) => `output parameter "${path.at(isFallback ? -5 : -3)}" of action "${path[1]}"`,
|
|
70
70
|
fallbackExtractor: import_spectral_functions2.titleFallbackExtractor
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/linter/rulesets/interface.ruleset.ts"],
|
|
4
|
-
"sourcesContent": ["import { falsy } from '@stoplight/spectral-functions'\nimport { preprocessRuleset } from '../ruleset-functions'\nimport { descriptionFallbackExtractor, titleFallbackExtractor, truthyWithMessage } from '../spectral-functions'\n\nexport const INTERFACE_RULESET = preprocessRuleset({\n extends: [],\n rules: {\n 'action-inputparams-should-have-a-title': {\n description: 'All action input parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.actions[*].input..schema.properties[*]
|
|
4
|
+
"sourcesContent": ["import { falsy } from '@stoplight/spectral-functions'\nimport { preprocessRuleset } from '../ruleset-functions'\nimport { descriptionFallbackExtractor, titleFallbackExtractor, truthyWithMessage } from '../spectral-functions'\n\nexport const INTERFACE_RULESET = preprocessRuleset({\n extends: [],\n rules: {\n 'action-inputparams-should-have-a-title': {\n description: 'All action input parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.actions[*].input..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `input parameter \"${path.at(isFallback ? -5 : -3)}\" of action \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'action-inputparams-must-have-a-description': {\n description: 'All action input parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.actions[*].input..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `input parameter \"${path.at(isFallback ? -4 : -2)}\" of action \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'action-outputparams-should-have-a-title': {\n description: 'All action output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.actions[*].output..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of action \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'action-outputparams-must-have-a-description': {\n description: 'All action output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.actions[*].output..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of action \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-should-have-title': {\n description: 'All event output parameters {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -5 : -3)}\" of event \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'event-outputparams-must-have-description': {\n description: 'All event output parameters {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.events[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) =>\n `output parameter \"${path.at(isFallback ? -4 : -2)}\" of event \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n 'legacy-zui-title-should-be-removed': {\n description:\n 'Legacy ZUI title fields (ui.title) {{callToAction}} be removed. Please use .title() in your Zod schemas instead',\n severity: 'error',\n given: '$..ui[*].title',\n then: [{ function: falsy }],\n },\n 'legacy-zui-examples-should-be-removed': {\n description:\n 'Legacy ZUI examples fields (ui.examples) {{callToAction}} be removed. There are currently no alternatives',\n severity: 'hint',\n given: '$..ui[*].examples',\n then: [{ function: falsy }],\n },\n 'entity-fields-should-have-a-title': {\n description: 'All entity fields {{callToAction}} have a title',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty title by using .title() in its Zod schema',\n severity: 'warn',\n given: '$.entities[*]..schema.properties[*]',\n then: [\n {\n field: 'x-zui.title',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -5 : -3)}\" of entity \"${path[1]}\"`,\n fallbackExtractor: titleFallbackExtractor,\n }),\n },\n ],\n },\n 'entity-fields-must-have-a-description': {\n description: 'All entity fields {{callToAction}} have a description',\n message:\n '{{description}}: {{error}} {{callToAction}} provide a non-empty description by using .describe() in its Zod schema',\n severity: 'error',\n given: '$.entities[*]..schema.properties[*]',\n then: [\n {\n field: 'description',\n function: truthyWithMessage({\n failMsgMapper: ({ path, isFallback }) => `field \"${path.at(isFallback ? -4 : -2)}\" of entity \"${path[1]}\"`,\n fallbackExtractor: descriptionFallbackExtractor,\n }),\n },\n ],\n },\n },\n})\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAsB;AACtB,+BAAkC;AAClC,IAAAA,6BAAwF;AAEjF,MAAM,wBAAoB,4CAAkB;AAAA,EACjD,SAAS,CAAC;AAAA,EACV,OAAO;AAAA,IACL,0CAA0C;AAAA,MACxC,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB;AAAA,YAC1B,eAAe,CAAC,EAAE,MAAM,WAAW,MACjC,oBAAoB,KAAK,GAAG,aAAa,KAAK,EAAE,CAAC,gBAAgB,KAAK,CAAC,CAAC;AAAA,YAC1E,mBAAmB;AAAA,UACrB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,8CAA8C;AAAA,MAC5C,aAAa;AAAA,MACb,SACE;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,UACP,cAAU,8CAAkB;AAAA,YAC1B,eAAe,CAA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mBAAmB;AAAA,UACrB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
|
|
6
6
|
"names": ["import_spectral_functions"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/cli",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.5",
|
|
4
4
|
"description": "Botpress CLI",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@apidevtools/json-schema-ref-parser": "^11.7.0",
|
|
29
29
|
"@botpress/chat": "0.5.4",
|
|
30
|
-
"@botpress/client": "1.
|
|
31
|
-
"@botpress/sdk": "5.4.
|
|
30
|
+
"@botpress/client": "1.34.0",
|
|
31
|
+
"@botpress/sdk": "5.4.2",
|
|
32
32
|
"@bpinternal/const": "^0.1.0",
|
|
33
33
|
"@bpinternal/tunnel": "^0.1.1",
|
|
34
34
|
"@bpinternal/verel": "^0.2.0",
|