@lssm/bundle.contractspec-workspace 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217073102
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/dist/_virtual/rolldown_runtime.js +22 -1
- package/dist/adapters/ai.js +82 -1
- package/dist/adapters/factory.js +36 -1
- package/dist/adapters/fs.js +118 -1
- package/dist/adapters/git.js +54 -1
- package/dist/adapters/index.js +7 -1
- package/dist/adapters/logger.js +80 -1
- package/dist/adapters/watcher.js +69 -1
- package/dist/adapters/workspace.js +190 -2
- package/dist/ai/agents/claude-code-agent.js +146 -9
- package/dist/ai/agents/cursor-agent.js +286 -17
- package/dist/ai/agents/index.js +5 -1
- package/dist/ai/agents/openai-codex-agent.js +140 -8
- package/dist/ai/agents/orchestrator.js +142 -1
- package/dist/ai/agents/simple-agent.js +80 -4
- package/dist/ai/client.js +162 -1
- package/dist/ai/index.js +27 -1
- package/dist/ai/prompts/code-generation.js +55 -13
- package/dist/ai/prompts/index.js +12 -1
- package/dist/ai/prompts/spec-creation.js +61 -20
- package/dist/ai/providers.js +40 -1
- package/dist/formatters/index.js +18 -1
- package/dist/formatters/json.js +71 -1
- package/dist/formatters/sarif.js +163 -1
- package/dist/formatters/text.js +208 -2
- package/dist/index.js +81 -1
- package/dist/libs/ai-providers/dist/factory.js +154 -1
- package/dist/libs/ai-providers/dist/index.js +4 -1
- package/dist/libs/ai-providers/dist/legacy.js +72 -1
- package/dist/libs/ai-providers/dist/models.js +287 -1
- package/dist/libs/ai-providers/dist/validation.js +1 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -1
- package/dist/libs/contracts/dist/client/index.js +5 -1
- package/dist/libs/contracts/dist/client/react/feature-render.js +2 -1
- package/dist/libs/contracts/dist/client/react/form-render.js +4 -1
- package/dist/libs/contracts/dist/client/react/index.js +4 -1
- package/dist/libs/contracts/dist/contract-registry/index.js +1 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -1
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
- package/dist/libs/contracts/dist/docs/index.js +29 -1
- package/dist/libs/contracts/dist/docs/presentations.js +71 -1
- package/dist/libs/contracts/dist/docs/registry.js +44 -1
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
- package/dist/libs/contracts/dist/events.js +8 -1
- package/dist/libs/contracts/dist/experiments/evaluator.js +1 -1
- package/dist/libs/contracts/dist/index.js +72 -1
- package/dist/libs/contracts/dist/install.js +2 -1
- package/dist/libs/contracts/dist/integrations/contracts.js +377 -1
- package/dist/libs/contracts/dist/integrations/index.js +18 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -1
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -1
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -1
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -1
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -1
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -1
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -1
- package/dist/libs/contracts/dist/integrations/providers/index.js +11 -1
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -1
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -1
- package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -1
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -1
- package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -1
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -1
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -1
- package/dist/libs/contracts/dist/jsonschema.js +24 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +306 -1
- package/dist/libs/contracts/dist/knowledge/index.js +7 -1
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -1
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -1
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -1
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -1
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -1
- package/dist/libs/contracts/dist/llm/exporters.js +352 -4
- package/dist/libs/contracts/dist/llm/index.js +2 -1
- package/dist/libs/contracts/dist/llm/prompts.js +143 -7
- package/dist/libs/contracts/dist/onboarding-base.js +196 -1
- package/dist/libs/contracts/dist/openapi.js +75 -1
- package/dist/libs/contracts/dist/ownership.js +21 -1
- package/dist/libs/contracts/dist/presentations.js +1 -1
- package/dist/libs/contracts/dist/presentations.v2.js +11 -1
- package/dist/libs/contracts/dist/prompt.js +1 -1
- package/dist/libs/contracts/dist/promptRegistry.js +1 -1
- package/dist/libs/contracts/dist/regenerator/index.js +2 -1
- package/dist/libs/contracts/dist/regenerator/service.js +92 -1
- package/dist/libs/contracts/dist/regenerator/utils.js +51 -1
- package/dist/libs/contracts/dist/registry.js +208 -1
- package/dist/libs/contracts/dist/resources.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -1
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -1
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -1
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +34 -1
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -1
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +6 -1
- package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -1
- package/dist/libs/contracts/dist/server/index.js +8 -1
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -1
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -1
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -1
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +1 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +1 -1
- package/dist/libs/contracts/dist/server/rest-express.js +1 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +1 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +1 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -1
- package/dist/libs/contracts/dist/spec.js +35 -1
- package/dist/libs/contracts/dist/telemetry/index.js +1 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +1 -1
- package/dist/libs/contracts/dist/tests/index.js +1 -1
- package/dist/libs/contracts/dist/tests/runner.js +150 -1
- package/dist/libs/contracts/dist/workflow/index.js +1 -1
- package/dist/libs/contracts/dist/workflow/runner.js +1 -1
- package/dist/libs/contracts-transformers/dist/common/utils.js +47 -1
- package/dist/libs/contracts-transformers/dist/openapi/exporter.js +1 -1
- package/dist/libs/contracts-transformers/dist/openapi/importer.js +255 -2
- package/dist/libs/contracts-transformers/dist/openapi/index.js +4 -1
- package/dist/libs/contracts-transformers/dist/openapi/parser.js +231 -1
- package/dist/libs/contracts-transformers/dist/openapi/schema-converter.js +201 -4
- package/dist/modules/contractspec-workspace/dist/ai/code-generation.js +50 -13
- package/dist/modules/contractspec-workspace/dist/ai/spec-creation.js +50 -18
- package/dist/modules/contractspec-workspace/dist/analysis/deps/graph.js +84 -2
- package/dist/modules/contractspec-workspace/dist/analysis/deps/parse-imports.js +30 -1
- package/dist/modules/contractspec-workspace/dist/analysis/diff/semantic.js +96 -1
- package/dist/modules/contractspec-workspace/dist/analysis/feature-scan.js +151 -1
- package/dist/modules/contractspec-workspace/dist/analysis/spec-scan.js +344 -1
- package/dist/modules/contractspec-workspace/dist/analysis/validate/spec-structure.js +122 -1
- package/dist/modules/contractspec-workspace/dist/templates/app-config.js +100 -28
- package/dist/modules/contractspec-workspace/dist/templates/data-view.js +41 -27
- package/dist/modules/contractspec-workspace/dist/templates/event.js +28 -14
- package/dist/modules/contractspec-workspace/dist/templates/experiment.js +76 -51
- package/dist/modules/contractspec-workspace/dist/templates/handler.js +49 -17
- package/dist/modules/contractspec-workspace/dist/templates/integration-utils.js +97 -26
- package/dist/modules/contractspec-workspace/dist/templates/integration.js +46 -23
- package/dist/modules/contractspec-workspace/dist/templates/knowledge.js +59 -19
- package/dist/modules/contractspec-workspace/dist/templates/migration.js +49 -26
- package/dist/modules/contractspec-workspace/dist/templates/operation.js +40 -28
- package/dist/modules/contractspec-workspace/dist/templates/presentation.js +45 -20
- package/dist/modules/contractspec-workspace/dist/templates/telemetry.js +73 -53
- package/dist/modules/contractspec-workspace/dist/templates/utils.js +38 -1
- package/dist/modules/contractspec-workspace/dist/templates/workflow-runner.js +12 -6
- package/dist/modules/contractspec-workspace/dist/templates/workflow.js +50 -24
- package/dist/modules/contractspec-workspace/dist/types/generation-types.js +20 -1
- package/dist/services/agent-guide/adapters/claude-code.js +144 -3
- package/dist/services/agent-guide/adapters/cursor-cli.js +135 -3
- package/dist/services/agent-guide/adapters/generic-mcp.js +159 -3
- package/dist/services/agent-guide/adapters/index.js +30 -1
- package/dist/services/agent-guide/agent-guide-service.js +148 -1
- package/dist/services/agent-guide/index.js +5 -1
- package/dist/services/build.js +140 -1
- package/dist/services/ci-check/ci-check-service.js +393 -1
- package/dist/services/ci-check/index.js +2 -1
- package/dist/services/ci-check/types.js +28 -1
- package/dist/services/clean.js +71 -1
- package/dist/services/config.js +76 -1
- package/dist/services/deps.js +62 -1
- package/dist/services/diff.js +33 -1
- package/dist/services/doctor/checks/ai.js +118 -2
- package/dist/services/doctor/checks/cli.js +146 -1
- package/dist/services/doctor/checks/config.js +170 -1
- package/dist/services/doctor/checks/deps.js +180 -1
- package/dist/services/doctor/checks/index.js +6 -1
- package/dist/services/doctor/checks/mcp.js +144 -1
- package/dist/services/doctor/checks/workspace.js +243 -1
- package/dist/services/doctor/doctor-service.js +115 -2
- package/dist/services/doctor/index.js +2 -1
- package/dist/services/doctor/types.js +26 -1
- package/dist/services/implementation/discovery.js +143 -2
- package/dist/services/implementation/index.js +2 -1
- package/dist/services/implementation/resolver.js +223 -1
- package/dist/services/index.js +53 -1
- package/dist/services/integrity-diagram.js +274 -6
- package/dist/services/integrity.js +272 -1
- package/dist/services/list.js +35 -1
- package/dist/services/openapi/export-service.js +51 -2
- package/dist/services/openapi/import-service.js +75 -1
- package/dist/services/openapi/index.js +4 -1
- package/dist/services/openapi/sync-service.js +121 -1
- package/dist/services/openapi/validate-service.js +130 -1
- package/dist/services/regenerator.js +23 -1
- package/dist/services/registry.js +73 -1
- package/dist/services/setup/config-generators.js +113 -26
- package/dist/services/setup/file-merger.js +60 -2
- package/dist/services/setup/index.js +4 -1
- package/dist/services/setup/setup-service.js +95 -1
- package/dist/services/setup/targets/agents-md.js +46 -1
- package/dist/services/setup/targets/cli-config.js +59 -1
- package/dist/services/setup/targets/cursor-rules.js +47 -1
- package/dist/services/setup/targets/mcp-claude.js +59 -1
- package/dist/services/setup/targets/mcp-cursor.js +58 -1
- package/dist/services/setup/targets/vscode-settings.js +62 -1
- package/dist/services/setup/types.js +26 -1
- package/dist/services/sync.js +62 -1
- package/dist/services/test.js +30 -1
- package/dist/services/validate-implementation.js +69 -1
- package/dist/services/validate.js +47 -1
- package/dist/services/verification-cache/adapters/filesystem.js +121 -1
- package/dist/services/verification-cache/adapters/in-memory.js +45 -1
- package/dist/services/verification-cache/adapters/index.js +3 -1
- package/dist/services/verification-cache/adapters/workspace-state.js +90 -1
- package/dist/services/verification-cache/cache-service.js +255 -1
- package/dist/services/verification-cache/index.js +6 -1
- package/dist/services/verification-cache/types.js +15 -1
- package/dist/services/verify/ai-verifier.js +336 -9
- package/dist/services/verify/behavior-verifier.js +185 -1
- package/dist/services/verify/index.js +4 -1
- package/dist/services/verify/structure-verifier.js +195 -2
- package/dist/services/verify/verify-service.js +203 -3
- package/dist/services/watch.js +31 -1
- package/dist/services/workspace-info.js +102 -2
- package/dist/templates/app-config.template.js +101 -28
- package/dist/templates/data-view.template.js +42 -27
- package/dist/templates/event.template.js +29 -14
- package/dist/templates/experiment.template.js +77 -51
- package/dist/templates/handler.template.js +53 -17
- package/dist/templates/index.js +36 -1
- package/dist/templates/integration.template.js +134 -50
- package/dist/templates/knowledge.template.js +62 -21
- package/dist/templates/migration.template.js +50 -26
- package/dist/templates/operation.template.js +44 -28
- package/dist/templates/presentation.template.js +46 -20
- package/dist/templates/telemetry.template.js +74 -53
- package/dist/templates/workflow-runner.template.js +12 -6
- package/dist/templates/workflow.template.js +51 -24
- package/package.json +13 -9
|
@@ -1,42 +1,49 @@
|
|
|
1
|
-
import{
|
|
2
|
-
key: '${e(t.key)}',
|
|
3
|
-
label: '${r(t.label)}',
|
|
4
|
-
dataPath: '${e(t.dataPath)}',
|
|
5
|
-
${t.format?`format: '${e(t.format)}',`:``}
|
|
6
|
-
${t.sortable?`sortable: true,`:``}
|
|
7
|
-
${t.filterable?`filterable: true,`:``}
|
|
8
|
-
}`).join(`,
|
|
9
|
-
`),o=n.secondaryFields?.length?`secondaryFields: [${n.secondaryFields.map(t=>`'${e(t)}'`).join(`, `)}],`:``,s=n.itemOperation?`item: { name: '${e(n.itemOperation.name)}', version: ${n.itemOperation.version} },`:``;return`import type { DataViewSpec } from '@lssm/lib.contracts/data-views';
|
|
1
|
+
import { escapeString, toPascalCase } from "./utils.js";
|
|
10
2
|
|
|
11
|
-
|
|
3
|
+
//#region ../../modules/contractspec-workspace/dist/templates/data-view.js
|
|
4
|
+
function generateDataViewSpec(data) {
|
|
5
|
+
const viewVarName = toPascalCase(data.name.split(".").pop() ?? "DataView") + "DataView";
|
|
6
|
+
const fields = data.fields.map((field) => ` {
|
|
7
|
+
key: '${escapeString(field.key)}',
|
|
8
|
+
label: '${escape(field.label)}',
|
|
9
|
+
dataPath: '${escapeString(field.dataPath)}',
|
|
10
|
+
${field.format ? `format: '${escapeString(field.format)}',` : ""}
|
|
11
|
+
${field.sortable ? "sortable: true," : ""}
|
|
12
|
+
${field.filterable ? "filterable: true," : ""}
|
|
13
|
+
}`).join(",\n");
|
|
14
|
+
const secondaryFields = data.secondaryFields?.length ? `secondaryFields: [${data.secondaryFields.map((key) => `'${escapeString(key)}'`).join(", ")}],` : "";
|
|
15
|
+
const itemOperation = data.itemOperation ? `item: { name: '${escapeString(data.itemOperation.name)}', version: ${data.itemOperation.version} },` : "";
|
|
16
|
+
return `import type { DataViewSpec } from '@lssm/lib.contracts/data-views';
|
|
17
|
+
|
|
18
|
+
export const ${viewVarName}: DataViewSpec = {
|
|
12
19
|
meta: {
|
|
13
|
-
name: '${
|
|
14
|
-
version: ${
|
|
15
|
-
entity: '${
|
|
16
|
-
title: '${
|
|
17
|
-
description: '${
|
|
18
|
-
domain: '${
|
|
19
|
-
owners: [${
|
|
20
|
-
tags: [${
|
|
21
|
-
stability: '${
|
|
20
|
+
name: '${escapeString(data.name)}',
|
|
21
|
+
version: ${data.version},
|
|
22
|
+
entity: '${escapeString(data.entity)}',
|
|
23
|
+
title: '${escape(data.title)}',
|
|
24
|
+
description: '${escape(data.description || "Describe the purpose of this data view.")}',
|
|
25
|
+
domain: '${escape(data.domain || data.entity)}',
|
|
26
|
+
owners: [${data.owners.map((owner) => `'${escapeString(owner)}'`).join(", ")}],
|
|
27
|
+
tags: [${data.tags.map((tag) => `'${escapeString(tag)}'`).join(", ")}],
|
|
28
|
+
stability: '${data.stability}',
|
|
22
29
|
},
|
|
23
30
|
source: {
|
|
24
31
|
primary: {
|
|
25
|
-
name: '${
|
|
26
|
-
version: ${
|
|
32
|
+
name: '${escapeString(data.primaryOperation.name)}',
|
|
33
|
+
version: ${data.primaryOperation.version},
|
|
27
34
|
},
|
|
28
|
-
${
|
|
35
|
+
${itemOperation}
|
|
29
36
|
refreshEvents: [
|
|
30
37
|
// { name: 'entity.updated', version: 1 },
|
|
31
38
|
],
|
|
32
39
|
},
|
|
33
40
|
view: {
|
|
34
|
-
kind: '${
|
|
41
|
+
kind: '${data.kind}',
|
|
35
42
|
fields: [
|
|
36
|
-
${
|
|
43
|
+
${fields}
|
|
37
44
|
],
|
|
38
|
-
${
|
|
39
|
-
${
|
|
45
|
+
${data.primaryField ? `primaryField: '${escapeString(data.primaryField)}',` : ""}
|
|
46
|
+
${secondaryFields}
|
|
40
47
|
filters: [
|
|
41
48
|
// Example filter:
|
|
42
49
|
// { key: 'search', label: 'Search', field: 'fullName', type: 'search' },
|
|
@@ -51,4 +58,11 @@ ${a}
|
|
|
51
58
|
// error: { name: 'app.data.error', version: 1 },
|
|
52
59
|
},
|
|
53
60
|
};
|
|
54
|
-
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
function escape(value) {
|
|
64
|
+
return value.replace(/'/g, "\\'");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { generateDataViewSpec };
|
|
@@ -1,24 +1,38 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { toPascalCase } from "./utils.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../modules/contractspec-workspace/dist/templates/event.js
|
|
4
|
+
/**
|
|
5
|
+
* Generate event spec TypeScript code.
|
|
6
|
+
*/
|
|
7
|
+
function generateEventSpec(data) {
|
|
8
|
+
const { name, version, description, stability, owners, tags, piiFields } = data;
|
|
9
|
+
const eventVarName = toPascalCase(name.replace(/\./g, "_")) + "V" + version;
|
|
10
|
+
const payloadSchemaName = eventVarName + "Payload";
|
|
11
|
+
return `import { defineEvent } from '@lssm/lib.contracts';
|
|
2
12
|
import { ScalarTypeEnum, SchemaModel } from '@lssm/lib.schema';
|
|
3
13
|
|
|
4
14
|
// TODO: Define event payload schema
|
|
5
|
-
export const ${
|
|
6
|
-
name: '${
|
|
7
|
-
description: 'Payload for ${
|
|
15
|
+
export const ${payloadSchemaName} = new SchemaModel({
|
|
16
|
+
name: '${payloadSchemaName}',
|
|
17
|
+
description: 'Payload for ${name}',
|
|
8
18
|
fields: {
|
|
9
19
|
// Add your payload fields here
|
|
10
20
|
// example: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
21
|
},
|
|
12
22
|
});
|
|
13
23
|
|
|
14
|
-
export const ${
|
|
15
|
-
name: '${
|
|
16
|
-
version: ${
|
|
17
|
-
description: '${
|
|
18
|
-
stability: '${
|
|
19
|
-
owners: [${
|
|
20
|
-
tags: [${
|
|
21
|
-
${
|
|
22
|
-
payload: ${
|
|
24
|
+
export const ${eventVarName} = defineEvent({
|
|
25
|
+
name: '${name}',
|
|
26
|
+
version: ${version},
|
|
27
|
+
description: '${description}',
|
|
28
|
+
stability: '${stability}',
|
|
29
|
+
owners: [${owners.map((o) => `'${o}'`).join(", ")}],
|
|
30
|
+
tags: [${tags.map((t) => `'${t}'`).join(", ")}],
|
|
31
|
+
${piiFields.length > 0 ? `pii: [${piiFields.map((f) => `'${f}'`).join(", ")}],` : "// pii: [],"}
|
|
32
|
+
payload: ${payloadSchemaName},
|
|
23
33
|
});
|
|
24
|
-
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { generateEventSpec };
|
|
@@ -1,62 +1,87 @@
|
|
|
1
|
-
import{
|
|
2
|
-
${e.overrides.map(e=>` {
|
|
3
|
-
type: '${e.type}',
|
|
4
|
-
target: '${r(e.target)}',
|
|
5
|
-
${typeof e.version==`number`?`version: ${e.version},`:``}
|
|
6
|
-
}`).join(`,
|
|
7
|
-
`)}
|
|
8
|
-
],`:``;return` {
|
|
9
|
-
id: '${r(e.id)}',
|
|
10
|
-
name: '${r(e.name)}',
|
|
11
|
-
${e.description?`description: '${r(e.description)}',`:``}
|
|
12
|
-
${typeof e.weight==`number`?`weight: ${e.weight},`:``}
|
|
13
|
-
${t}
|
|
14
|
-
}`}).join(`,
|
|
15
|
-
`),o=n(t.allocation),s=t.successMetrics?.length?` successMetrics: [
|
|
16
|
-
${t.successMetrics.map(e=>` {
|
|
17
|
-
name: '${r(e.name)}',
|
|
18
|
-
telemetryEvent: { name: '${r(e.eventName)}', version: ${e.eventVersion} },
|
|
19
|
-
aggregation: '${e.aggregation}',
|
|
20
|
-
${typeof e.target==`number`?`target: ${e.target},`:``}
|
|
21
|
-
}`).join(`,
|
|
22
|
-
`)}
|
|
23
|
-
],`:``;return`import type { ExperimentSpec } from '@lssm/lib.contracts/experiments';
|
|
1
|
+
import { toPascalCase } from "./utils.js";
|
|
24
2
|
|
|
25
|
-
|
|
3
|
+
//#region ../../modules/contractspec-workspace/dist/templates/experiment.js
|
|
4
|
+
function generateExperimentSpec(data) {
|
|
5
|
+
const specVar = toPascalCase(data.name.split(".").pop() ?? "Experiment") + "Experiment";
|
|
6
|
+
const variants = data.variants.map((variant) => {
|
|
7
|
+
const overrides = variant.overrides?.length ? ` overrides: [
|
|
8
|
+
${variant.overrides.map((override) => ` {
|
|
9
|
+
type: '${override.type}',
|
|
10
|
+
target: '${escapeString(override.target)}',
|
|
11
|
+
${typeof override.version === "number" ? `version: ${override.version},` : ""}
|
|
12
|
+
}`).join(",\n")}
|
|
13
|
+
],` : "";
|
|
14
|
+
return ` {
|
|
15
|
+
id: '${escapeString(variant.id)}',
|
|
16
|
+
name: '${escapeString(variant.name)}',
|
|
17
|
+
${variant.description ? `description: '${escapeString(variant.description)}',` : ""}
|
|
18
|
+
${typeof variant.weight === "number" ? `weight: ${variant.weight},` : ""}
|
|
19
|
+
${overrides}
|
|
20
|
+
}`;
|
|
21
|
+
}).join(",\n");
|
|
22
|
+
const allocation = renderAllocation(data.allocation);
|
|
23
|
+
const metrics = data.successMetrics?.length ? ` successMetrics: [
|
|
24
|
+
${data.successMetrics.map((metric) => ` {
|
|
25
|
+
name: '${escapeString(metric.name)}',
|
|
26
|
+
telemetryEvent: { name: '${escapeString(metric.eventName)}', version: ${metric.eventVersion} },
|
|
27
|
+
aggregation: '${metric.aggregation}',
|
|
28
|
+
${typeof metric.target === "number" ? `target: ${metric.target},` : ""}
|
|
29
|
+
}`).join(",\n")}
|
|
30
|
+
],` : "";
|
|
31
|
+
return `import type { ExperimentSpec } from '@lssm/lib.contracts/experiments';
|
|
32
|
+
|
|
33
|
+
export const ${specVar}: ExperimentSpec = {
|
|
26
34
|
meta: {
|
|
27
|
-
name: '${
|
|
28
|
-
version: ${
|
|
29
|
-
title: '${
|
|
30
|
-
description: '${
|
|
31
|
-
domain: '${
|
|
32
|
-
owners: [${
|
|
33
|
-
tags: [${
|
|
34
|
-
stability: '${
|
|
35
|
+
name: '${escapeString(data.name)}',
|
|
36
|
+
version: ${data.version},
|
|
37
|
+
title: '${escapeString(data.name)} experiment',
|
|
38
|
+
description: '${escapeString(data.description || "Describe the experiment goal.")}',
|
|
39
|
+
domain: '${escapeString(data.domain)}',
|
|
40
|
+
owners: [${data.owners.map((owner) => `'${escapeString(owner)}'`).join(", ")}],
|
|
41
|
+
tags: [${data.tags.map((tag) => `'${escapeString(tag)}'`).join(", ")}],
|
|
42
|
+
stability: '${data.stability}',
|
|
35
43
|
},
|
|
36
|
-
controlVariant: '${
|
|
44
|
+
controlVariant: '${escapeString(data.controlVariant)}',
|
|
37
45
|
variants: [
|
|
38
|
-
${
|
|
46
|
+
${variants}
|
|
39
47
|
],
|
|
40
|
-
allocation: ${
|
|
41
|
-
${
|
|
48
|
+
allocation: ${allocation},
|
|
49
|
+
${metrics}
|
|
42
50
|
};
|
|
43
|
-
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
function renderAllocation(allocation) {
|
|
54
|
+
switch (allocation.type) {
|
|
55
|
+
case "random": return `{
|
|
44
56
|
type: 'random',
|
|
45
|
-
${
|
|
46
|
-
}`;
|
|
57
|
+
${allocation.salt ? `salt: '${escapeString(allocation.salt)}',` : ""}
|
|
58
|
+
}`;
|
|
59
|
+
case "sticky": return `{
|
|
47
60
|
type: 'sticky',
|
|
48
|
-
attribute: '${
|
|
49
|
-
${
|
|
50
|
-
}`;
|
|
61
|
+
attribute: '${allocation.attribute}',
|
|
62
|
+
${allocation.salt ? `salt: '${escapeString(allocation.salt)}',` : ""}
|
|
63
|
+
}`;
|
|
64
|
+
case "targeted": return `{
|
|
51
65
|
type: 'targeted',
|
|
52
66
|
rules: [
|
|
53
|
-
${
|
|
54
|
-
variantId: '${
|
|
55
|
-
${typeof
|
|
56
|
-
${
|
|
57
|
-
${
|
|
58
|
-
}`).join(
|
|
59
|
-
`)}
|
|
67
|
+
${allocation.rules.map((rule) => ` {
|
|
68
|
+
variantId: '${escapeString(rule.variantId)}',
|
|
69
|
+
${typeof rule.percentage === "number" ? `percentage: ${rule.percentage},` : ""}
|
|
70
|
+
${rule.policy ? `policy: { name: '${escapeString(rule.policy.name)}'${typeof rule.policy.version === "number" ? `, version: ${rule.policy.version}` : ""} },` : ""}
|
|
71
|
+
${rule.expression ? `expression: '${escapeString(rule.expression)}',` : ""}
|
|
72
|
+
}`).join(",\n")}
|
|
60
73
|
],
|
|
61
|
-
fallback: '${
|
|
62
|
-
}`;
|
|
74
|
+
fallback: '${allocation.fallback ?? "control"}',
|
|
75
|
+
}`;
|
|
76
|
+
default: return renderUnsupportedAllocation(allocation);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function escapeString(value) {
|
|
80
|
+
return value.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
|
81
|
+
}
|
|
82
|
+
function renderUnsupportedAllocation(allocation) {
|
|
83
|
+
throw new Error(`Unsupported allocation type ${allocation}`);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
export { generateExperimentSpec };
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import{
|
|
2
|
-
import { ${o} } from '../contracts/${t(r)}.contracts';
|
|
1
|
+
import { toCamelCase, toKebabCase, toPascalCase } from "./utils.js";
|
|
3
2
|
|
|
3
|
+
//#region ../../modules/contractspec-workspace/dist/templates/handler.js
|
|
4
4
|
/**
|
|
5
|
-
|
|
5
|
+
* Handler and component template generation.
|
|
6
|
+
* Extracted from cli-contracts/src/templates/handler.template.ts
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Generate handler implementation template.
|
|
10
|
+
*/
|
|
11
|
+
function generateHandlerTemplate(specName, kind) {
|
|
12
|
+
const handlerName = toCamelCase(specName.split(".").pop() ?? "unknown") + "Handler";
|
|
13
|
+
const specVarName = toPascalCase(specName.split(".").pop() ?? "Unknown") + "Spec";
|
|
14
|
+
return `import type { ContractHandler } from '@lssm/lib.contracts';
|
|
15
|
+
import { ${specVarName} } from '../contracts/${toKebabCase(specName)}.contracts';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Handler for ${specName}
|
|
6
19
|
*/
|
|
7
|
-
export const ${
|
|
20
|
+
export const ${handlerName}: ContractHandler<typeof ${specVarName}> = async (
|
|
8
21
|
input,
|
|
9
22
|
context
|
|
10
23
|
) => {
|
|
11
|
-
// TODO: Implement ${
|
|
24
|
+
// TODO: Implement ${kind} logic
|
|
12
25
|
|
|
13
26
|
try {
|
|
14
27
|
// 1. Validate prerequisites
|
|
@@ -24,28 +37,43 @@ export const ${a}: ContractHandler<typeof ${o}> = async (
|
|
|
24
37
|
throw error;
|
|
25
38
|
}
|
|
26
39
|
};
|
|
27
|
-
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Generate React component template.
|
|
44
|
+
*/
|
|
45
|
+
function generateComponentTemplate(componentName, description) {
|
|
46
|
+
const pascalName = toPascalCase(componentName);
|
|
47
|
+
return `import React from 'react';
|
|
28
48
|
|
|
29
|
-
interface ${
|
|
49
|
+
interface ${pascalName}Props {
|
|
30
50
|
// TODO: Define props based on presentation spec
|
|
31
51
|
}
|
|
32
52
|
|
|
33
53
|
/**
|
|
34
|
-
* ${
|
|
54
|
+
* ${description}
|
|
35
55
|
*/
|
|
36
|
-
export const ${
|
|
56
|
+
export const ${pascalName}: React.FC<${pascalName}Props> = (props) => {
|
|
37
57
|
return (
|
|
38
58
|
<div>
|
|
39
59
|
{/* TODO: Implement component UI */}
|
|
40
|
-
<p>Component: ${
|
|
60
|
+
<p>Component: ${pascalName}</p>
|
|
41
61
|
</div>
|
|
42
62
|
);
|
|
43
63
|
};
|
|
44
|
-
|
|
45
|
-
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Generate test template.
|
|
68
|
+
*/
|
|
69
|
+
function generateTestTemplate(targetName, type) {
|
|
70
|
+
const importPath = type === "handler" ? "../handlers" : "../components";
|
|
71
|
+
const testName = toPascalCase(targetName);
|
|
72
|
+
return `import { describe, it, expect } from 'bun:test';
|
|
73
|
+
import { ${testName} } from '${importPath}/${toKebabCase(targetName)}';
|
|
46
74
|
|
|
47
|
-
describe('${
|
|
48
|
-
it('should ${
|
|
75
|
+
describe('${testName}', () => {
|
|
76
|
+
it('should ${type === "handler" ? "handle valid input" : "render correctly"}', async () => {
|
|
49
77
|
// TODO: Implement test
|
|
50
78
|
expect(true).toBe(true);
|
|
51
79
|
});
|
|
@@ -54,10 +82,14 @@ describe('${a}', () => {
|
|
|
54
82
|
// TODO: Test edge cases
|
|
55
83
|
});
|
|
56
84
|
|
|
57
|
-
${
|
|
85
|
+
${type === "handler" ? `it('should handle errors appropriately', async () => {
|
|
58
86
|
// TODO: Test error scenarios
|
|
59
|
-
})
|
|
87
|
+
});` : `it('should be accessible', async () => {
|
|
60
88
|
// TODO: Test accessibility
|
|
61
89
|
});`}
|
|
62
90
|
});
|
|
63
|
-
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
//#endregion
|
|
95
|
+
export { generateComponentTemplate, generateHandlerTemplate, generateTestTemplate };
|
|
@@ -1,33 +1,104 @@
|
|
|
1
|
-
|
|
1
|
+
//#region ../../modules/contractspec-workspace/dist/templates/integration-utils.js
|
|
2
|
+
function renderConfigSchema(fields) {
|
|
3
|
+
const requiredFields = fields.filter((field) => field.required);
|
|
4
|
+
return ` schema: {
|
|
2
5
|
type: 'object',
|
|
3
|
-
${
|
|
4
|
-
|
|
5
|
-
${(
|
|
6
|
-
|
|
6
|
+
${requiredFields.length > 0 ? ` required: [${requiredFields.map((field) => `'${field.key}'`).join(", ")}],
|
|
7
|
+
` : ""} properties: {
|
|
8
|
+
${(fields.length ? fields.map((field) => {
|
|
9
|
+
const description = field.description ? `, description: '${escape(field.description)}'` : "";
|
|
10
|
+
return ` ${field.key}: { type: '${mapConfigType(field.type)}'${description} }`;
|
|
11
|
+
}).join(",\n") : "") || " "}
|
|
7
12
|
},
|
|
8
|
-
},\n
|
|
13
|
+
},\n`;
|
|
14
|
+
}
|
|
15
|
+
function renderSecretSchema(fields) {
|
|
16
|
+
const requiredFields = fields.filter((field) => field.required);
|
|
17
|
+
return ` schema: {
|
|
9
18
|
type: 'object',
|
|
10
|
-
${
|
|
11
|
-
|
|
12
|
-
${(
|
|
13
|
-
|
|
19
|
+
${requiredFields.length > 0 ? ` required: [${requiredFields.map((field) => `'${field.key}'`).join(", ")}],
|
|
20
|
+
` : ""} properties: {
|
|
21
|
+
${(fields.length ? fields.map((field) => {
|
|
22
|
+
const description = field.description ? `, description: '${escape(field.description)}'` : "";
|
|
23
|
+
return ` ${field.key}: { type: 'string'${description} }`;
|
|
24
|
+
}).join(",\n") : "") || " "}
|
|
14
25
|
},
|
|
15
|
-
},\n
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
},\n`;
|
|
27
|
+
}
|
|
28
|
+
function renderConfigExample(fields) {
|
|
29
|
+
if (fields.length === 0) return `{}`;
|
|
30
|
+
return `{
|
|
31
|
+
${fields.map((field) => {
|
|
32
|
+
switch (field.type) {
|
|
33
|
+
case "number": return ` ${field.key}: 0`;
|
|
34
|
+
case "boolean": return ` ${field.key}: true`;
|
|
35
|
+
case "string":
|
|
36
|
+
default: return ` ${field.key}: '${field.key.toUpperCase()}_VALUE'`;
|
|
37
|
+
}
|
|
38
|
+
}).join(",\n")}
|
|
39
|
+
}`;
|
|
40
|
+
}
|
|
41
|
+
function renderSecretExample(fields) {
|
|
42
|
+
if (fields.length === 0) return `{}`;
|
|
43
|
+
return `{
|
|
44
|
+
${fields.map((field) => ` ${field.key}: '${field.key.toUpperCase()}_SECRET'`).join(",\n")}
|
|
45
|
+
}`;
|
|
46
|
+
}
|
|
47
|
+
function renderConstraints(rpm, rph) {
|
|
48
|
+
if (rpm == null && rph == null) return "";
|
|
49
|
+
const entries = [];
|
|
50
|
+
if (rpm != null) entries.push(` rpm: ${rpm}`);
|
|
51
|
+
if (rph != null) entries.push(` rph: ${rph}`);
|
|
52
|
+
return ` constraints: {
|
|
22
53
|
rateLimit: {
|
|
23
|
-
${
|
|
24
|
-
`)}
|
|
54
|
+
${entries.join(",\n")}
|
|
25
55
|
},
|
|
26
56
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`)}
|
|
33
|
-
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
function renderByokSetup(modes, instructions, scopes) {
|
|
60
|
+
if (!modes.includes("byok")) return "";
|
|
61
|
+
const instructionsLine = instructions ? ` setupInstructions: '${escape(instructions)}',\n` : "";
|
|
62
|
+
const scopesLine = scopes && scopes.length ? ` requiredScopes: [${scopes.map((scope) => `'${escape(scope)}'`).join(", ")}],\n` : "";
|
|
63
|
+
if (!instructionsLine && !scopesLine) return "";
|
|
64
|
+
return ` byokSetup: {
|
|
65
|
+
${instructionsLine}${scopesLine} },
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
function mapConfigType(type) {
|
|
69
|
+
switch (type) {
|
|
70
|
+
case "number": return "number";
|
|
71
|
+
case "boolean": return "boolean";
|
|
72
|
+
case "string":
|
|
73
|
+
default: return "string";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function stabilityToEnum(stability) {
|
|
77
|
+
switch (stability) {
|
|
78
|
+
case "beta": return "Beta";
|
|
79
|
+
case "stable": return "Stable";
|
|
80
|
+
case "deprecated": return "Deprecated";
|
|
81
|
+
case "experimental":
|
|
82
|
+
default: return "Experimental";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function renderProvides(data) {
|
|
86
|
+
return data.capabilitiesProvided.map((cap) => ` { key: '${cap.key}', version: ${cap.version} }`).join(",\n");
|
|
87
|
+
}
|
|
88
|
+
function renderRequires(data) {
|
|
89
|
+
if (data.capabilitiesRequired.length === 0) return "";
|
|
90
|
+
return ` requires: [
|
|
91
|
+
${data.capabilitiesRequired.map((req) => {
|
|
92
|
+
const version = typeof req.version === "number" ? `, version: ${req.version}` : "";
|
|
93
|
+
const optional = req.optional ? ", optional: true" : "";
|
|
94
|
+
const reason = req.reason ? `, reason: '${escape(req.reason)}'` : "";
|
|
95
|
+
return ` { key: '${req.key}'${version}${optional}${reason} }`;
|
|
96
|
+
}).join(",\n")}
|
|
97
|
+
],`;
|
|
98
|
+
}
|
|
99
|
+
function escape(value) {
|
|
100
|
+
return value.replace(/`/g, "\\`").replace(/'/g, "\\'");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
export { escape, renderByokSetup, renderConfigExample, renderConfigSchema, renderConstraints, renderProvides, renderRequires, renderSecretExample, renderSecretSchema, stabilityToEnum };
|
|
@@ -1,39 +1,62 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { toPascalCase } from "./utils.js";
|
|
2
|
+
import { escape, renderByokSetup, renderConfigExample, renderConfigSchema, renderConstraints, renderProvides, renderRequires, renderSecretExample, renderSecretSchema, stabilityToEnum } from "./integration-utils.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../modules/contractspec-workspace/dist/templates/integration.js
|
|
5
|
+
function generateIntegrationSpec(data) {
|
|
6
|
+
const specName = toPascalCase(data.name.split(".").pop() ?? "Integration");
|
|
7
|
+
const varName = `${specName}IntegrationSpec`;
|
|
8
|
+
const registerFn = `register${specName}Integration`;
|
|
9
|
+
const supportedModes = data.supportedModes.length ? data.supportedModes : ["managed"];
|
|
10
|
+
const supportedModesLine = supportedModes.map((mode) => `'${mode}'`).join(", ");
|
|
11
|
+
const provides = renderProvides(data);
|
|
12
|
+
const requires = renderRequires(data);
|
|
13
|
+
const configSchema = renderConfigSchema(data.configFields);
|
|
14
|
+
const configExample = renderConfigExample(data.configFields);
|
|
15
|
+
const secretSchema = renderSecretSchema(data.secretFields);
|
|
16
|
+
const secretExample = renderSecretExample(data.secretFields);
|
|
17
|
+
const docsUrl = data.docsUrl ? ` docsUrl: '${escape(data.docsUrl)}',\n` : "";
|
|
18
|
+
const constraints = renderConstraints(data.rateLimitRpm, data.rateLimitRph);
|
|
19
|
+
const byokSetup = renderByokSetup(supportedModes, data.byokSetupInstructions, data.byokRequiredScopes);
|
|
20
|
+
return `import { StabilityEnum } from '@lssm/lib.contracts/ownership';
|
|
2
21
|
import type { IntegrationSpec } from '@lssm/lib.contracts/integrations/spec';
|
|
3
22
|
import type { IntegrationSpecRegistry } from '@lssm/lib.contracts/integrations/spec';
|
|
4
23
|
|
|
5
|
-
export const ${
|
|
24
|
+
export const ${varName}: IntegrationSpec = {
|
|
6
25
|
meta: {
|
|
7
|
-
key: '${
|
|
8
|
-
version: ${
|
|
9
|
-
category: '${
|
|
10
|
-
displayName: '${
|
|
11
|
-
title: '${
|
|
12
|
-
description: '${
|
|
13
|
-
domain: '${
|
|
14
|
-
owners: [${
|
|
15
|
-
tags: [${
|
|
16
|
-
stability: StabilityEnum.${
|
|
26
|
+
key: '${escape(data.name)}',
|
|
27
|
+
version: ${data.version},
|
|
28
|
+
category: '${data.category}',
|
|
29
|
+
displayName: '${escape(data.displayName)}',
|
|
30
|
+
title: '${escape(data.title)}',
|
|
31
|
+
description: '${escape(data.description)}',
|
|
32
|
+
domain: '${escape(data.domain)}',
|
|
33
|
+
owners: [${data.owners.map((owner) => `'${escape(owner)}'`).join(", ")}],
|
|
34
|
+
tags: [${data.tags.map((tag) => `'${escape(tag)}'`).join(", ")}],
|
|
35
|
+
stability: StabilityEnum.${stabilityToEnum(data.stability)},
|
|
17
36
|
},
|
|
18
|
-
supportedModes: [${
|
|
37
|
+
supportedModes: [${supportedModesLine}],
|
|
19
38
|
capabilities: {
|
|
20
39
|
provides: [
|
|
21
|
-
${
|
|
40
|
+
${provides}
|
|
22
41
|
],
|
|
23
|
-
${
|
|
42
|
+
${requires.length > 0 ? `${requires}\n` : ""} },
|
|
24
43
|
configSchema: {
|
|
25
|
-
${
|
|
44
|
+
${configSchema} example: ${configExample},
|
|
26
45
|
},
|
|
27
46
|
secretSchema: {
|
|
28
|
-
${
|
|
47
|
+
${secretSchema} example: ${secretExample},
|
|
29
48
|
},
|
|
30
|
-
${
|
|
31
|
-
method: '${
|
|
32
|
-
timeoutMs: ${
|
|
49
|
+
${docsUrl}${constraints}${byokSetup} healthCheck: {
|
|
50
|
+
method: '${data.healthCheckMethod}',
|
|
51
|
+
timeoutMs: ${data.healthCheckTimeoutMs ?? 5e3},
|
|
33
52
|
},
|
|
34
53
|
};
|
|
35
54
|
|
|
36
|
-
export function ${
|
|
37
|
-
return registry.register(${
|
|
55
|
+
export function ${registerFn}(registry: IntegrationSpecRegistry): IntegrationSpecRegistry {
|
|
56
|
+
return registry.register(${varName});
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
38
59
|
}
|
|
39
|
-
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
export { generateIntegrationSpec };
|