@contractspec/lib.contracts 0.0.0-canary-20260119224949 → 0.0.0-canary-20260128200020
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/app-config/contracts.d.ts +51 -51
- package/dist/app-config/events.d.ts +27 -27
- package/dist/app-config/lifecycle-contracts.d.ts +55 -55
- package/dist/app-config/runtime.d.ts +1 -1
- package/dist/app-config/spec.d.ts +2 -2
- package/dist/capabilities/capabilities.d.ts +64 -5
- package/dist/capabilities/capabilities.js +125 -0
- package/dist/capabilities/context.d.ts +88 -0
- package/dist/capabilities/context.js +87 -0
- package/dist/capabilities/docs/capabilities.docblock.js +191 -2
- package/dist/capabilities/guards.d.ts +110 -0
- package/dist/capabilities/guards.js +146 -0
- package/dist/capabilities/index.d.ts +4 -1
- package/dist/capabilities/index.js +4 -1
- package/dist/capabilities/validation.d.ts +76 -0
- package/dist/capabilities/validation.js +141 -0
- package/dist/client/react/feature-render.d.ts +2 -2
- package/dist/contract-registry/schemas.d.ts +2 -2
- package/dist/data-views/data-views.d.ts +2 -1
- package/dist/data-views/index.d.ts +2 -1
- package/dist/data-views/registry.d.ts +1 -1
- package/dist/data-views/runtime.d.ts +1 -1
- package/dist/data-views/spec.d.ts +2 -8
- package/dist/data-views/types.d.ts +1 -1
- package/dist/docs/capabilities/documentationSystem.capability.d.ts +7 -0
- package/dist/docs/capabilities/documentationSystem.capability.js +71 -0
- package/dist/docs/capabilities/index.d.ts +2 -0
- package/dist/docs/capabilities/index.js +3 -0
- package/dist/docs/commands/docsGenerate.command.d.ts +95 -0
- package/dist/docs/commands/docsGenerate.command.js +139 -0
- package/dist/docs/commands/docsPublish.command.d.ts +64 -0
- package/dist/docs/commands/docsPublish.command.js +104 -0
- package/dist/docs/commands/index.d.ts +3 -0
- package/dist/docs/commands/index.js +4 -0
- package/dist/docs/constants.d.ts +15 -0
- package/dist/docs/constants.js +18 -0
- package/dist/docs/contracts.d.ts +442 -0
- package/dist/docs/contracts.js +58 -0
- package/dist/docs/ensure-docblocks.d.ts +1 -0
- package/dist/docs/ensure-docblocks.js +1 -0
- package/dist/docs/events/docsGenerated.event.d.ts +62 -0
- package/dist/docs/events/docsGenerated.event.js +53 -0
- package/dist/docs/events/docsPublished.event.d.ts +70 -0
- package/dist/docs/events/docsPublished.event.js +57 -0
- package/dist/docs/events/index.d.ts +3 -0
- package/dist/docs/events/index.js +4 -0
- package/dist/docs/forms/docsSearch.form.d.ts +22 -0
- package/dist/docs/forms/docsSearch.form.js +113 -0
- package/dist/docs/forms/index.d.ts +2 -0
- package/dist/docs/forms/index.js +3 -0
- package/dist/docs/index.d.ts +23 -1
- package/dist/docs/index.js +24 -1
- package/dist/docs/presentations/docsLayout.presentation.d.ts +7 -0
- package/dist/docs/presentations/docsLayout.presentation.js +32 -0
- package/dist/docs/presentations/docsReferencePage.presentation.d.ts +7 -0
- package/dist/docs/presentations/docsReferencePage.presentation.js +32 -0
- package/dist/docs/presentations/index.d.ts +3 -0
- package/dist/docs/presentations/index.js +4 -0
- package/dist/docs/queries/contractReference.query.d.ts +217 -0
- package/dist/docs/queries/contractReference.query.js +122 -0
- package/dist/docs/queries/docsIndex.query.d.ts +272 -0
- package/dist/docs/queries/docsIndex.query.js +130 -0
- package/dist/docs/queries/index.d.ts +3 -0
- package/dist/docs/queries/index.js +4 -0
- package/dist/docs/tech/cli.docblock.js +10 -0
- package/dist/docs/tech/docs-system.docblock.d.ts +1 -0
- package/dist/docs/tech/docs-system.docblock.js +128 -0
- package/dist/docs/views/contractReference.dataView.d.ts +7 -0
- package/dist/docs/views/contractReference.dataView.js +80 -0
- package/dist/docs/views/docsIndex.dataView.d.ts +7 -0
- package/dist/docs/views/docsIndex.dataView.js +136 -0
- package/dist/docs/views/exampleCatalog.dataView.d.ts +7 -0
- package/dist/docs/views/exampleCatalog.dataView.js +91 -0
- package/dist/docs/views/index.d.ts +4 -0
- package/dist/docs/views/index.js +5 -0
- package/dist/events.d.ts +80 -14
- package/dist/events.js +33 -3
- package/dist/examples/schema.d.ts +9 -9
- package/dist/examples/types.d.ts +1 -1
- package/dist/experiments/spec.d.ts +9 -6
- package/dist/features/index.d.ts +2 -2
- package/dist/features/install.d.ts +4 -4
- package/dist/features/types.d.ts +28 -32
- package/dist/forms/forms.d.ts +1 -1
- package/dist/index.d.ts +54 -27
- package/dist/index.js +28 -3
- package/dist/install.d.ts +1 -1
- package/dist/integrations/openbanking/contracts/accounts.d.ts +67 -67
- package/dist/integrations/openbanking/contracts/balances.d.ts +35 -35
- package/dist/integrations/openbanking/contracts/transactions.d.ts +49 -49
- package/dist/integrations/openbanking/models.d.ts +55 -55
- package/dist/integrations/operations.d.ts +103 -103
- package/dist/integrations/spec.d.ts +2 -2
- package/dist/jsonschema.d.ts +1 -1
- package/dist/knowledge/operations.d.ts +67 -67
- package/dist/knowledge/spec.d.ts +1 -1
- package/dist/llm/exporters.d.ts +4 -4
- package/dist/llm/types.d.ts +1 -1
- package/dist/markdown.d.ts +2 -2
- package/dist/onboarding-base.d.ts +29 -29
- package/dist/operations/operation.d.ts +8 -2
- package/dist/operations/registry.d.ts +2 -2
- package/dist/ownership.d.ts +133 -8
- package/dist/ownership.js +25 -0
- package/dist/policy/context.d.ts +237 -0
- package/dist/policy/context.js +227 -0
- package/dist/policy/guards.d.ts +145 -0
- package/dist/policy/guards.js +254 -0
- package/dist/policy/index.d.ts +12 -1
- package/dist/policy/index.js +11 -1
- package/dist/policy/spec.d.ts +7 -4
- package/dist/policy/validation.d.ts +67 -0
- package/dist/policy/validation.js +307 -0
- package/dist/presentations/presentations.d.ts +6 -0
- package/dist/presentations/registry.d.ts +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/serialization/index.d.ts +3 -0
- package/dist/serialization/index.js +3 -0
- package/dist/serialization/serializers.d.ts +40 -0
- package/dist/serialization/serializers.js +148 -0
- package/dist/serialization/types.d.ts +103 -0
- package/dist/serialization/types.js +0 -0
- package/dist/server/rest-elysia.d.ts +1 -1
- package/dist/server/rest-express.d.ts +1 -1
- package/dist/server/rest-generic.d.ts +1 -1
- package/dist/server/rest-next-app.d.ts +1 -1
- package/dist/server/rest-next-mcp.d.ts +1 -1
- package/dist/server/rest-next-pages.d.ts +1 -1
- package/dist/telemetry/spec.d.ts +1 -1
- package/dist/tests/runner.d.ts +1 -1
- package/dist/tests/spec.d.ts +17 -12
- package/dist/themes.d.ts +8 -5
- package/dist/translations/index.d.ts +6 -0
- package/dist/translations/index.js +5 -0
- package/dist/translations/registry.d.ts +144 -0
- package/dist/translations/registry.js +223 -0
- package/dist/translations/spec.d.ts +126 -0
- package/dist/translations/spec.js +31 -0
- package/dist/translations/validation.d.ts +85 -0
- package/dist/translations/validation.js +328 -0
- package/dist/types.d.ts +140 -14
- package/dist/versioning/index.d.ts +2 -1
- package/dist/versioning/index.js +2 -1
- package/dist/versioning/refs.d.ts +179 -0
- package/dist/versioning/refs.js +161 -0
- package/dist/workflow/context.d.ts +191 -0
- package/dist/workflow/context.js +227 -0
- package/dist/workflow/index.d.ts +6 -3
- package/dist/workflow/index.js +4 -2
- package/dist/workflow/spec.d.ts +4 -11
- package/dist/workflow/validation.d.ts +64 -2
- package/dist/workflow/validation.js +194 -1
- package/dist/workspace-config/contractsrc-schema.js +1 -0
- package/dist/workspace-config/contractsrc-types.d.ts +3 -3
- package/package.json +47 -8
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { defineQuery } from "../../operations/operation.js";
|
|
2
|
+
import "../../operations/index.js";
|
|
3
|
+
import { DOCS_CAPABILITY_REF, DOCS_DOMAIN, DOCS_OWNERS, DOCS_STABILITY, DOCS_TAGS } from "../constants.js";
|
|
4
|
+
import { docId } from "../registry.js";
|
|
5
|
+
import "../ensure-docblocks.js";
|
|
6
|
+
import { ScalarTypeEnum, SchemaModel } from "@contractspec/lib.schema";
|
|
7
|
+
|
|
8
|
+
//#region src/docs/queries/docsIndex.query.ts
|
|
9
|
+
const DocSummaryModel = new SchemaModel({
|
|
10
|
+
name: "DocSummary",
|
|
11
|
+
fields: {
|
|
12
|
+
id: {
|
|
13
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
+
isOptional: false
|
|
15
|
+
},
|
|
16
|
+
title: {
|
|
17
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
18
|
+
isOptional: false
|
|
19
|
+
},
|
|
20
|
+
summary: {
|
|
21
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
22
|
+
isOptional: true
|
|
23
|
+
},
|
|
24
|
+
route: {
|
|
25
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
26
|
+
isOptional: true
|
|
27
|
+
},
|
|
28
|
+
visibility: {
|
|
29
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
30
|
+
isOptional: true
|
|
31
|
+
},
|
|
32
|
+
kind: {
|
|
33
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
34
|
+
isOptional: true
|
|
35
|
+
},
|
|
36
|
+
version: {
|
|
37
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
38
|
+
isOptional: true
|
|
39
|
+
},
|
|
40
|
+
tags: {
|
|
41
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
42
|
+
isOptional: true,
|
|
43
|
+
isArray: true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const DocsIndexInput = new SchemaModel({
|
|
48
|
+
name: "DocsIndexInput",
|
|
49
|
+
fields: {
|
|
50
|
+
query: {
|
|
51
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
52
|
+
isOptional: true
|
|
53
|
+
},
|
|
54
|
+
tag: {
|
|
55
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
56
|
+
isOptional: true,
|
|
57
|
+
isArray: true
|
|
58
|
+
},
|
|
59
|
+
visibility: {
|
|
60
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
61
|
+
isOptional: true
|
|
62
|
+
},
|
|
63
|
+
kind: {
|
|
64
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
65
|
+
isOptional: true
|
|
66
|
+
},
|
|
67
|
+
limit: {
|
|
68
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
69
|
+
isOptional: true
|
|
70
|
+
},
|
|
71
|
+
offset: {
|
|
72
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
73
|
+
isOptional: true
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const DocsIndexOutput = new SchemaModel({
|
|
78
|
+
name: "DocsIndexOutput",
|
|
79
|
+
fields: {
|
|
80
|
+
items: {
|
|
81
|
+
type: DocSummaryModel,
|
|
82
|
+
isOptional: true,
|
|
83
|
+
isArray: true
|
|
84
|
+
},
|
|
85
|
+
docs: {
|
|
86
|
+
type: DocSummaryModel,
|
|
87
|
+
isOptional: false,
|
|
88
|
+
isArray: true
|
|
89
|
+
},
|
|
90
|
+
total: {
|
|
91
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
92
|
+
isOptional: true
|
|
93
|
+
},
|
|
94
|
+
nextOffset: {
|
|
95
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
96
|
+
isOptional: true
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const DocsIndexQuery = defineQuery({
|
|
101
|
+
meta: {
|
|
102
|
+
key: "docs.search",
|
|
103
|
+
title: "Docs Index",
|
|
104
|
+
version: "1.0.0",
|
|
105
|
+
description: "Search and filter DocBlocks by query, tag, or visibility.",
|
|
106
|
+
goal: "Provide a consistent index of documentation entries for UI and MCP.",
|
|
107
|
+
context: "Used by docs surfaces to list and filter DocBlocks without coupling to storage.",
|
|
108
|
+
domain: DOCS_DOMAIN,
|
|
109
|
+
owners: DOCS_OWNERS,
|
|
110
|
+
tags: [
|
|
111
|
+
...DOCS_TAGS,
|
|
112
|
+
"search",
|
|
113
|
+
"index"
|
|
114
|
+
],
|
|
115
|
+
stability: DOCS_STABILITY,
|
|
116
|
+
docId: [docId("docs.tech.docs-search")]
|
|
117
|
+
},
|
|
118
|
+
capability: DOCS_CAPABILITY_REF,
|
|
119
|
+
io: {
|
|
120
|
+
input: DocsIndexInput,
|
|
121
|
+
output: DocsIndexOutput
|
|
122
|
+
},
|
|
123
|
+
policy: {
|
|
124
|
+
auth: "anonymous",
|
|
125
|
+
pii: []
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
//#endregion
|
|
130
|
+
export { DocSummaryModel, DocsIndexInput, DocsIndexOutput, DocsIndexQuery };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DocSummaryModel, DocsIndexInput, DocsIndexOutput, DocsIndexQuery } from "./docsIndex.query.js";
|
|
2
|
+
import { ContractReferenceInput, ContractReferenceModel, ContractReferenceOutput, ContractReferenceQuery } from "./contractReference.query.js";
|
|
3
|
+
export { ContractReferenceInput, ContractReferenceModel, ContractReferenceOutput, ContractReferenceQuery, DocSummaryModel, DocsIndexInput, DocsIndexOutput, DocsIndexQuery };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DocSummaryModel, DocsIndexInput, DocsIndexOutput, DocsIndexQuery } from "./docsIndex.query.js";
|
|
2
|
+
import { ContractReferenceInput, ContractReferenceModel, ContractReferenceOutput, ContractReferenceQuery } from "./contractReference.query.js";
|
|
3
|
+
|
|
4
|
+
export { ContractReferenceInput, ContractReferenceModel, ContractReferenceOutput, ContractReferenceQuery, DocSummaryModel, DocsIndexInput, DocsIndexOutput, DocsIndexQuery };
|
|
@@ -60,6 +60,10 @@ Generate implementation code from contract specs using AI agents or templates.
|
|
|
60
60
|
contractspec build src/contracts/signup.contracts.ts --agent-mode claude-code
|
|
61
61
|
\`\`\`
|
|
62
62
|
|
|
63
|
+
Available agent modes: simple, cursor, claude-code, openai-codex, opencode (alias for opencode-sdk).
|
|
64
|
+
|
|
65
|
+
OpenCode uses \`@opencode-ai/sdk\` via dynamic import and is ideal for teams running a self-hosted, open backend.
|
|
66
|
+
|
|
63
67
|
### \`validate\`
|
|
64
68
|
|
|
65
69
|
Validate contract specifications and verify implementations.
|
|
@@ -68,6 +72,12 @@ Validate contract specifications and verify implementations.
|
|
|
68
72
|
contractspec validate src/contracts/signup.contracts.ts --check-implementation
|
|
69
73
|
\`\`\`
|
|
70
74
|
|
|
75
|
+
You can also validate with OpenCode:
|
|
76
|
+
|
|
77
|
+
\`\`\`bash
|
|
78
|
+
contractspec validate src/contracts/signup.contracts.ts --check-implementation --agent-mode opencode
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
71
81
|
### \`watch\`
|
|
72
82
|
|
|
73
83
|
Watch contract specifications and auto-regenerate on changes.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/tech/docs-system.docblock.ts
|
|
4
|
+
registerDocBlocks([
|
|
5
|
+
{
|
|
6
|
+
id: "docs.tech.docs-system",
|
|
7
|
+
title: "Docs system overview",
|
|
8
|
+
summary: "How ContractSpec generates, indexes, and presents documentation.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/tech/docs/system",
|
|
12
|
+
tags: [
|
|
13
|
+
"docs",
|
|
14
|
+
"system",
|
|
15
|
+
"contracts"
|
|
16
|
+
],
|
|
17
|
+
body: `# Docs system overview
|
|
18
|
+
|
|
19
|
+
ContractSpec treats documentation as a first-class output of your specs. The docs system combines:
|
|
20
|
+
|
|
21
|
+
- Contract operations and schemas
|
|
22
|
+
- DocBlocks (goal/how/usage/reference)
|
|
23
|
+
- Presentations for rendering
|
|
24
|
+
|
|
25
|
+
The result is a consistent docs surface across CLI, web, and MCP.
|
|
26
|
+
|
|
27
|
+
## Key surfaces
|
|
28
|
+
|
|
29
|
+
- Generation: \`docs.generate\`
|
|
30
|
+
- Index/search: \`docs.search\`
|
|
31
|
+
- Contract reference: \`docs.contract.reference\`
|
|
32
|
+
- Publish: \`docs.publish\`
|
|
33
|
+
`
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "docs.tech.docs-generator",
|
|
37
|
+
title: "Docs generator",
|
|
38
|
+
summary: "Generate reference docs and metadata from ContractSpecs.",
|
|
39
|
+
kind: "how",
|
|
40
|
+
visibility: "public",
|
|
41
|
+
route: "/docs/tech/docs/generator",
|
|
42
|
+
tags: [
|
|
43
|
+
"docs",
|
|
44
|
+
"generator",
|
|
45
|
+
"cli"
|
|
46
|
+
],
|
|
47
|
+
body: `# Docs generator
|
|
48
|
+
|
|
49
|
+
The generator produces documentation artifacts from registered ContractSpecs and DocBlocks.
|
|
50
|
+
|
|
51
|
+
## Outputs
|
|
52
|
+
|
|
53
|
+
- Reference pages for operations, events, forms, data views, and presentations
|
|
54
|
+
- Search index metadata (DocBlocks + routes)
|
|
55
|
+
- Contract schemas rendered to markdown or JSON
|
|
56
|
+
`
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "docs.tech.docs-search",
|
|
60
|
+
title: "Docs index and search",
|
|
61
|
+
summary: "Search DocBlocks by query, tag, kind, or visibility.",
|
|
62
|
+
kind: "reference",
|
|
63
|
+
visibility: "public",
|
|
64
|
+
route: "/docs/tech/docs/search",
|
|
65
|
+
tags: ["docs", "search"],
|
|
66
|
+
body: `# Docs index and search
|
|
67
|
+
|
|
68
|
+
The docs index is the canonical list of DocBlocks exposed to UI and MCP surfaces.
|
|
69
|
+
|
|
70
|
+
## Query
|
|
71
|
+
|
|
72
|
+
- Operation: \`docs.search\`
|
|
73
|
+
- Filters: query, tag, kind, visibility
|
|
74
|
+
`
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "docs.tech.docs-reference",
|
|
78
|
+
title: "Contract reference pages",
|
|
79
|
+
summary: "Resolve any spec into a docs-ready reference payload.",
|
|
80
|
+
kind: "reference",
|
|
81
|
+
visibility: "public",
|
|
82
|
+
route: "/docs/tech/docs/reference",
|
|
83
|
+
tags: ["docs", "reference"],
|
|
84
|
+
body: `# Contract reference
|
|
85
|
+
|
|
86
|
+
Contract reference pages are generated from spec metadata plus schema details.
|
|
87
|
+
|
|
88
|
+
## Query
|
|
89
|
+
|
|
90
|
+
- Operation: \`docs.contract.reference\`
|
|
91
|
+
`
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "docs.tech.docs-publish",
|
|
95
|
+
title: "Docs publish",
|
|
96
|
+
summary: "Publish generated artifacts to the docs host.",
|
|
97
|
+
kind: "how",
|
|
98
|
+
visibility: "public",
|
|
99
|
+
route: "/docs/tech/docs/publish",
|
|
100
|
+
tags: ["docs", "publish"],
|
|
101
|
+
body: `# Docs publish
|
|
102
|
+
|
|
103
|
+
Publishing moves generated artifacts to a hosting target with versioning.
|
|
104
|
+
|
|
105
|
+
## Command
|
|
106
|
+
|
|
107
|
+
- Operation: \`docs.publish\`
|
|
108
|
+
`
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "docs.tech.docs-examples",
|
|
112
|
+
title: "Examples catalog",
|
|
113
|
+
summary: "Document and surface example projects with sandbox support.",
|
|
114
|
+
kind: "reference",
|
|
115
|
+
visibility: "public",
|
|
116
|
+
route: "/docs/tech/docs/examples",
|
|
117
|
+
tags: ["docs", "examples"],
|
|
118
|
+
body: `# Examples catalog
|
|
119
|
+
|
|
120
|
+
Examples are registered as ExampleSpecs and surface DocBlocks for discovery.
|
|
121
|
+
|
|
122
|
+
- Docs index tags should include \`examples\` to populate the catalog.
|
|
123
|
+
- Sandbox support is available under \`/sandbox\`.
|
|
124
|
+
`
|
|
125
|
+
}
|
|
126
|
+
]);
|
|
127
|
+
|
|
128
|
+
//#endregion
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineDataView } from "../../data-views/spec.js";
|
|
2
|
+
import "../../data-views/index.js";
|
|
3
|
+
import { DOCS_DOMAIN, DOCS_OWNERS, DOCS_STABILITY, DOCS_TAGS } from "../constants.js";
|
|
4
|
+
import { docId } from "../registry.js";
|
|
5
|
+
import "../ensure-docblocks.js";
|
|
6
|
+
import { ContractReferenceQuery } from "../queries/contractReference.query.js";
|
|
7
|
+
|
|
8
|
+
//#region src/docs/views/contractReference.dataView.ts
|
|
9
|
+
const ContractReferenceDataView = defineDataView({
|
|
10
|
+
meta: {
|
|
11
|
+
key: "docs.contract.reference.view",
|
|
12
|
+
title: "Contract Reference",
|
|
13
|
+
version: "1.0.0",
|
|
14
|
+
description: "Detail view for a single contract reference.",
|
|
15
|
+
domain: DOCS_DOMAIN,
|
|
16
|
+
owners: DOCS_OWNERS,
|
|
17
|
+
tags: [...DOCS_TAGS, "reference"],
|
|
18
|
+
stability: DOCS_STABILITY,
|
|
19
|
+
entity: "contract-reference",
|
|
20
|
+
docId: [docId("docs.tech.docs-reference")]
|
|
21
|
+
},
|
|
22
|
+
source: { primary: {
|
|
23
|
+
key: ContractReferenceQuery.meta.key,
|
|
24
|
+
version: ContractReferenceQuery.meta.version
|
|
25
|
+
} },
|
|
26
|
+
view: {
|
|
27
|
+
kind: "detail",
|
|
28
|
+
fields: [
|
|
29
|
+
{
|
|
30
|
+
key: "key",
|
|
31
|
+
label: "Key",
|
|
32
|
+
dataPath: "reference.key"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "version",
|
|
36
|
+
label: "Version",
|
|
37
|
+
dataPath: "reference.version"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: "type",
|
|
41
|
+
label: "Type",
|
|
42
|
+
dataPath: "reference.type"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "title",
|
|
46
|
+
label: "Title",
|
|
47
|
+
dataPath: "reference.title"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: "description",
|
|
51
|
+
label: "Description",
|
|
52
|
+
dataPath: "reference.description"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: "tags",
|
|
56
|
+
label: "Tags",
|
|
57
|
+
dataPath: "reference.tags"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: "owners",
|
|
61
|
+
label: "Owners",
|
|
62
|
+
dataPath: "reference.owners"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: "stability",
|
|
66
|
+
label: "Stability",
|
|
67
|
+
dataPath: "reference.stability"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
primaryField: "title",
|
|
71
|
+
secondaryFields: ["description"]
|
|
72
|
+
},
|
|
73
|
+
policy: {
|
|
74
|
+
flags: [],
|
|
75
|
+
pii: []
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
export { ContractReferenceDataView };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { defineDataView } from "../../data-views/spec.js";
|
|
2
|
+
import "../../data-views/index.js";
|
|
3
|
+
import { DOCS_DOMAIN, DOCS_OWNERS, DOCS_STABILITY, DOCS_TAGS } from "../constants.js";
|
|
4
|
+
import { docId } from "../registry.js";
|
|
5
|
+
import "../ensure-docblocks.js";
|
|
6
|
+
import { DocsIndexQuery } from "../queries/docsIndex.query.js";
|
|
7
|
+
|
|
8
|
+
//#region src/docs/views/docsIndex.dataView.ts
|
|
9
|
+
const DocsIndexDataView = defineDataView({
|
|
10
|
+
meta: {
|
|
11
|
+
key: "docs.index.view",
|
|
12
|
+
title: "Docs Index",
|
|
13
|
+
version: "1.0.0",
|
|
14
|
+
description: "List and filter documentation entries.",
|
|
15
|
+
domain: DOCS_DOMAIN,
|
|
16
|
+
owners: DOCS_OWNERS,
|
|
17
|
+
tags: [...DOCS_TAGS, "index"],
|
|
18
|
+
stability: DOCS_STABILITY,
|
|
19
|
+
entity: "docs",
|
|
20
|
+
docId: [docId("docs.tech.docs-search")]
|
|
21
|
+
},
|
|
22
|
+
source: { primary: {
|
|
23
|
+
key: DocsIndexQuery.meta.key,
|
|
24
|
+
version: DocsIndexQuery.meta.version
|
|
25
|
+
} },
|
|
26
|
+
view: {
|
|
27
|
+
kind: "list",
|
|
28
|
+
fields: [
|
|
29
|
+
{
|
|
30
|
+
key: "id",
|
|
31
|
+
label: "ID",
|
|
32
|
+
dataPath: "id"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "title",
|
|
36
|
+
label: "Title",
|
|
37
|
+
dataPath: "title"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: "summary",
|
|
41
|
+
label: "Summary",
|
|
42
|
+
dataPath: "summary"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "route",
|
|
46
|
+
label: "Route",
|
|
47
|
+
dataPath: "route"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: "tags",
|
|
51
|
+
label: "Tags",
|
|
52
|
+
dataPath: "tags",
|
|
53
|
+
format: "badge"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "kind",
|
|
57
|
+
label: "Kind",
|
|
58
|
+
dataPath: "kind"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: "visibility",
|
|
62
|
+
label: "Visibility",
|
|
63
|
+
dataPath: "visibility"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
primaryField: "title",
|
|
67
|
+
secondaryFields: ["summary", "route"],
|
|
68
|
+
filters: [
|
|
69
|
+
{
|
|
70
|
+
key: "query",
|
|
71
|
+
label: "Search",
|
|
72
|
+
field: "query",
|
|
73
|
+
type: "search"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: "visibility",
|
|
77
|
+
label: "Visibility",
|
|
78
|
+
field: "visibility",
|
|
79
|
+
type: "enum",
|
|
80
|
+
options: [
|
|
81
|
+
{
|
|
82
|
+
value: "public",
|
|
83
|
+
label: "Public"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: "internal",
|
|
87
|
+
label: "Internal"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
value: "mixed",
|
|
91
|
+
label: "Mixed"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
key: "kind",
|
|
97
|
+
label: "Kind",
|
|
98
|
+
field: "kind",
|
|
99
|
+
type: "enum",
|
|
100
|
+
options: [
|
|
101
|
+
{
|
|
102
|
+
value: "goal",
|
|
103
|
+
label: "Goal"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
value: "how",
|
|
107
|
+
label: "How"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
value: "usage",
|
|
111
|
+
label: "Usage"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
value: "reference",
|
|
115
|
+
label: "Reference"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
value: "faq",
|
|
119
|
+
label: "FAQ"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
value: "changelog",
|
|
123
|
+
label: "Changelog"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
policy: {
|
|
130
|
+
flags: [],
|
|
131
|
+
pii: []
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
export { DocsIndexDataView };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineDataView } from "../../data-views/spec.js";
|
|
2
|
+
import "../../data-views/index.js";
|
|
3
|
+
import { DOCS_DOMAIN, DOCS_OWNERS, DOCS_STABILITY, DOCS_TAGS } from "../constants.js";
|
|
4
|
+
import { docId } from "../registry.js";
|
|
5
|
+
import "../ensure-docblocks.js";
|
|
6
|
+
import { DocsIndexQuery } from "../queries/docsIndex.query.js";
|
|
7
|
+
|
|
8
|
+
//#region src/docs/views/exampleCatalog.dataView.ts
|
|
9
|
+
const ExampleCatalogDataView = defineDataView({
|
|
10
|
+
meta: {
|
|
11
|
+
key: "docs.examples.catalog.view",
|
|
12
|
+
title: "Examples Catalog",
|
|
13
|
+
version: "1.0.0",
|
|
14
|
+
description: "Catalog view of ContractSpec examples and demos.",
|
|
15
|
+
domain: DOCS_DOMAIN,
|
|
16
|
+
owners: DOCS_OWNERS,
|
|
17
|
+
tags: [...DOCS_TAGS, "examples"],
|
|
18
|
+
stability: DOCS_STABILITY,
|
|
19
|
+
entity: "docs-examples",
|
|
20
|
+
docId: [docId("docs.tech.docs-examples")]
|
|
21
|
+
},
|
|
22
|
+
source: { primary: {
|
|
23
|
+
key: DocsIndexQuery.meta.key,
|
|
24
|
+
version: DocsIndexQuery.meta.version
|
|
25
|
+
} },
|
|
26
|
+
view: {
|
|
27
|
+
kind: "grid",
|
|
28
|
+
fields: [
|
|
29
|
+
{
|
|
30
|
+
key: "id",
|
|
31
|
+
label: "ID",
|
|
32
|
+
dataPath: "id"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "title",
|
|
36
|
+
label: "Title",
|
|
37
|
+
dataPath: "title"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: "summary",
|
|
41
|
+
label: "Summary",
|
|
42
|
+
dataPath: "summary"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "route",
|
|
46
|
+
label: "Route",
|
|
47
|
+
dataPath: "route"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: "tags",
|
|
51
|
+
label: "Tags",
|
|
52
|
+
dataPath: "tags",
|
|
53
|
+
format: "badge"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
primaryField: "title",
|
|
57
|
+
secondaryFields: ["summary"],
|
|
58
|
+
filters: [{
|
|
59
|
+
key: "query",
|
|
60
|
+
label: "Search",
|
|
61
|
+
field: "query",
|
|
62
|
+
type: "search"
|
|
63
|
+
}, {
|
|
64
|
+
key: "tags",
|
|
65
|
+
label: "Tags",
|
|
66
|
+
field: "tag",
|
|
67
|
+
type: "enum",
|
|
68
|
+
options: [
|
|
69
|
+
{
|
|
70
|
+
value: "examples",
|
|
71
|
+
label: "Examples"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
value: "templates",
|
|
75
|
+
label: "Templates"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
value: "sandbox",
|
|
79
|
+
label: "Sandbox"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}]
|
|
83
|
+
},
|
|
84
|
+
policy: {
|
|
85
|
+
flags: [],
|
|
86
|
+
pii: []
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
export { ExampleCatalogDataView };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DocsIndexDataView } from "./docsIndex.dataView.js";
|
|
2
|
+
import { ContractReferenceDataView } from "./contractReference.dataView.js";
|
|
3
|
+
import { ExampleCatalogDataView } from "./exampleCatalog.dataView.js";
|
|
4
|
+
export { ContractReferenceDataView, DocsIndexDataView, ExampleCatalogDataView };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DocsIndexDataView } from "./docsIndex.dataView.js";
|
|
2
|
+
import { ContractReferenceDataView } from "./contractReference.dataView.js";
|
|
3
|
+
import { ExampleCatalogDataView } from "./exampleCatalog.dataView.js";
|
|
4
|
+
|
|
5
|
+
export { ContractReferenceDataView, DocsIndexDataView, ExampleCatalogDataView };
|