@lssm/lib.contracts 0.0.0-canary-20251221114240 → 0.0.0-canary-20251221144710
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 +37 -0
- package/dist/app-config/contracts.d.ts +56 -55
- package/dist/app-config/contracts.js +5 -4
- package/dist/app-config/docs/app-config.docblock.js +0 -1
- package/dist/app-config/events.d.ts +27 -27
- package/dist/app-config/lifecycle-contracts.d.ts +83 -82
- package/dist/app-config/lifecycle-contracts.js +2 -1
- package/dist/app-config/runtime.d.ts +4 -2
- package/dist/app-config/spec.d.ts +2 -1
- package/dist/app-config/validation.d.ts +4 -2
- package/dist/{capabilities.d.ts → capabilities/capabilities.d.ts} +3 -3
- package/dist/{capabilities.js → capabilities/capabilities.js} +1 -1
- package/dist/capabilities/docs/capabilities.docblock.js +0 -1
- package/dist/capabilities/index.d.ts +3 -0
- package/dist/capabilities/index.js +4 -0
- package/dist/capabilities/openbanking.d.ts +2 -1
- package/dist/client/react/feature-render.d.ts +3 -1
- package/dist/client/react/feature-render.js +2 -1
- package/dist/client/react/form-render.d.ts +1 -1
- package/dist/client/react/form-render.js +1 -1
- package/dist/{data-views.d.ts → data-views/data-views.d.ts} +15 -4
- package/dist/data-views/data-views.js +61 -0
- package/dist/data-views/docs/data-views.docblock.js +0 -1
- package/dist/data-views/index.d.ts +4 -0
- package/dist/data-views/index.js +5 -0
- package/dist/data-views/query-generator.d.ts +2 -1
- package/dist/data-views/runtime.d.ts +2 -1
- package/dist/docs/presentations.d.ts +3 -2
- package/dist/docs/registry.d.ts +3 -2
- package/dist/docs/tech/llm/llm-integration.docblock.js +2 -2
- package/dist/experiments/docs/experiments.docblock.js +0 -1
- package/dist/experiments/spec-resolver.d.ts +2 -1
- package/dist/features.d.ts +19 -5
- package/dist/features.js +26 -0
- package/dist/forms/docs/forms.docblock.js +0 -1
- package/dist/{forms.d.ts → forms/forms.d.ts} +13 -2
- package/dist/{forms.js → forms/forms.js} +27 -1
- package/dist/forms/index.d.ts +2 -0
- package/dist/forms/index.js +3 -0
- package/dist/index.d.ts +20 -13
- package/dist/index.js +24 -15
- package/dist/install.d.ts +3 -2
- package/dist/install.js +1 -1
- package/dist/integrations/docs/integrations.docblock.js +0 -1
- package/dist/integrations/openbanking/contracts/accounts.d.ts +69 -68
- package/dist/integrations/openbanking/contracts/accounts.js +2 -1
- package/dist/integrations/openbanking/contracts/balances.d.ts +37 -36
- package/dist/integrations/openbanking/contracts/balances.js +2 -1
- package/dist/integrations/openbanking/contracts/index.d.ts +1 -1
- package/dist/integrations/openbanking/contracts/transactions.d.ts +51 -50
- package/dist/integrations/openbanking/contracts/transactions.js +2 -1
- package/dist/integrations/openbanking/models.d.ts +55 -55
- package/dist/integrations/operations.d.ts +437 -0
- package/dist/integrations/{contracts.js → operations.js} +3 -2
- package/dist/integrations/spec.d.ts +2 -1
- package/dist/jsonschema.d.ts +5 -4
- package/dist/knowledge/docs/knowledge.docblock.js +0 -1
- package/dist/knowledge/{contracts.d.ts → operations.d.ts} +70 -69
- package/dist/knowledge/{contracts.js → operations.js} +3 -2
- package/dist/llm/exporters.d.ts +10 -8
- package/dist/llm/exporters.js +11 -10
- package/dist/llm/index.d.ts +2 -2
- package/dist/llm/index.js +2 -2
- package/dist/llm/prompts.d.ts +2 -1
- package/dist/llm/prompts.js +8 -8
- package/dist/llm/types.d.ts +3 -2
- package/dist/markdown.d.ts +5 -4
- package/dist/markdown.js +6 -5
- package/dist/onboarding-base.d.ts +31 -30
- package/dist/onboarding-base.js +2 -1
- package/dist/openapi.d.ts +1 -1
- package/dist/operations/index.d.ts +3 -0
- package/dist/operations/index.js +4 -0
- package/dist/{operation.d.ts → operations/operation.d.ts} +7 -7
- package/dist/{operation.js → operations/operation.js} +1 -1
- package/dist/{registry.d.ts → operations/registry.d.ts} +38 -6
- package/dist/{registry.js → operations/registry.js} +59 -4
- package/dist/policy/docs/policy.docblock.js +0 -1
- package/dist/presentations/docs/presentations-conventions.docblock.js +0 -1
- package/dist/presentations/index.d.ts +4 -0
- package/dist/presentations/index.js +4 -0
- package/dist/{presentations.d.ts → presentations/presentations.d.ts} +16 -5
- package/dist/{presentations.js → presentations/presentations.js} +26 -1
- package/dist/presentations/presentations.v2.d.ts +54 -0
- package/dist/{presentations.v2.d.ts → presentations/transform-engine.d.ts} +3 -51
- package/dist/{presentations.v2.js → presentations/transform-engine.js} +2 -2
- package/dist/regenerator/docs/regenerator.docblock.js +0 -1
- package/dist/registry-utils.d.ts +107 -0
- package/dist/registry-utils.js +122 -0
- package/dist/{contracts-adapter-hydration.d.ts → server/contracts-adapter-hydration.d.ts} +2 -2
- package/dist/{contracts-adapter-hydration.js → server/contracts-adapter-hydration.js} +1 -1
- package/dist/{contracts-adapter-input.d.ts → server/contracts-adapter-input.d.ts} +2 -3
- package/dist/{contracts-adapter-input.js → server/contracts-adapter-input.js} +2 -2
- package/dist/server/graphql-pothos.d.ts +1 -1
- package/dist/server/graphql-pothos.js +2 -2
- package/dist/server/mcp/createMcpServer.d.ts +1 -1
- package/dist/server/mcp/mcpTypes.d.ts +3 -2
- package/dist/server/mcp/registerPresentations.js +3 -2
- package/dist/server/mcp/registerTools.d.ts +1 -1
- 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/docs/telemetry.docblock.js +0 -1
- package/dist/tests/runner.d.ts +1 -1
- package/dist/tests/spec.d.ts +1 -1
- package/dist/workflow/spec.d.ts +13 -2
- package/dist/workflow/spec.js +26 -0
- package/dist/workflow/validation.d.ts +2 -2
- package/dist/workspace-config/contractsrc-schema.d.ts +112 -2
- package/dist/workspace-config/contractsrc-schema.js +28 -3
- package/package.json +23 -19
- package/dist/data-views.js +0 -35
- package/dist/integrations/contracts.d.ts +0 -436
- package/dist/openbanking/docs/openbanking.docblock.d.ts +0 -6
- package/dist/openbanking/docs/openbanking.docblock.js +0 -22
- package/dist/presentations.backcompat.d.ts +0 -7
- package/dist/presentations.backcompat.js +0 -47
- package/dist/types/all.d.ts +0 -60
- /package/dist/{types/all.js → presentations/presentations.v2.js} +0 -0
package/dist/markdown.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { isEmitDeclRef } from "./operation.js";
|
|
1
|
+
import { isEmitDeclRef } from "./operations/operation.js";
|
|
2
|
+
import "./operations/index.js";
|
|
2
3
|
|
|
3
4
|
//#region src/markdown.ts
|
|
4
5
|
/**
|
|
5
6
|
* Render simple Markdown docs for each spec.
|
|
6
7
|
* Useful for dev portals and repo docs generation.
|
|
7
8
|
*/
|
|
8
|
-
function
|
|
9
|
+
function operationsToMarkdown(registry, _extras) {
|
|
9
10
|
const lines = [];
|
|
10
|
-
for (const spec of
|
|
11
|
+
for (const spec of registry.listSpecs()) {
|
|
11
12
|
const m = spec.meta;
|
|
12
13
|
lines.push(`# ${m.name}.v${m.version}`);
|
|
13
14
|
lines.push("");
|
|
@@ -72,7 +73,7 @@ function specsToMarkdown(reg, _extras) {
|
|
|
72
73
|
/** Render presentations and features as additional sections. */
|
|
73
74
|
function docsToMarkdown(reg, extras) {
|
|
74
75
|
const parts = [];
|
|
75
|
-
parts.push(
|
|
76
|
+
parts.push(operationsToMarkdown(reg, extras));
|
|
76
77
|
if (extras.presentations) {
|
|
77
78
|
parts.push("# Presentations");
|
|
78
79
|
parts.push("");
|
|
@@ -113,4 +114,4 @@ function docsToMarkdown(reg, extras) {
|
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
//#endregion
|
|
116
|
-
export { docsToMarkdown,
|
|
117
|
+
export { docsToMarkdown, operationsToMarkdown };
|
|
@@ -1,135 +1,136 @@
|
|
|
1
|
-
import { OperationSpec } from "./operation.js";
|
|
2
|
-
import
|
|
1
|
+
import { OperationSpec } from "./operations/operation.js";
|
|
2
|
+
import "./index.js";
|
|
3
|
+
import * as _lssm_lib_schema7 from "@lssm/lib.schema";
|
|
3
4
|
import { SchemaModel } from "@lssm/lib.schema";
|
|
4
5
|
|
|
5
6
|
//#region src/onboarding-base.d.ts
|
|
6
7
|
/** Save/update onboarding draft (auto-save during flow) */
|
|
7
8
|
declare const SaveOnboardingDraftInput: SchemaModel<{
|
|
8
9
|
data: {
|
|
9
|
-
type:
|
|
10
|
+
type: _lssm_lib_schema7.FieldType<unknown, unknown>;
|
|
10
11
|
isOptional: false;
|
|
11
12
|
};
|
|
12
13
|
}>;
|
|
13
14
|
declare const SaveOnboardingDraftOutput: SchemaModel<{
|
|
14
15
|
id: {
|
|
15
|
-
type:
|
|
16
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
16
17
|
isOptional: false;
|
|
17
18
|
};
|
|
18
19
|
organizationId: {
|
|
19
|
-
type:
|
|
20
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
20
21
|
isOptional: false;
|
|
21
22
|
};
|
|
22
23
|
}>;
|
|
23
24
|
declare const SaveOnboardingDraftBaseSpec: OperationSpec<SchemaModel<{
|
|
24
25
|
data: {
|
|
25
|
-
type:
|
|
26
|
+
type: _lssm_lib_schema7.FieldType<unknown, unknown>;
|
|
26
27
|
isOptional: false;
|
|
27
28
|
};
|
|
28
29
|
}>, SchemaModel<{
|
|
29
30
|
id: {
|
|
30
|
-
type:
|
|
31
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
31
32
|
isOptional: false;
|
|
32
33
|
};
|
|
33
34
|
organizationId: {
|
|
34
|
-
type:
|
|
35
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
35
36
|
isOptional: false;
|
|
36
37
|
};
|
|
37
38
|
}>, undefined>;
|
|
38
39
|
/** Get current onboarding draft (on mount/restore) */
|
|
39
40
|
declare const GetOnboardingDraftOutput: SchemaModel<{
|
|
40
41
|
id: {
|
|
41
|
-
type:
|
|
42
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
42
43
|
isOptional: true;
|
|
43
44
|
};
|
|
44
45
|
organizationId: {
|
|
45
|
-
type:
|
|
46
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
46
47
|
isOptional: true;
|
|
47
48
|
};
|
|
48
49
|
data: {
|
|
49
|
-
type:
|
|
50
|
+
type: _lssm_lib_schema7.FieldType<unknown, unknown>;
|
|
50
51
|
isOptional: true;
|
|
51
52
|
};
|
|
52
53
|
createdAt: {
|
|
53
|
-
type:
|
|
54
|
+
type: _lssm_lib_schema7.FieldType<Date, string>;
|
|
54
55
|
isOptional: true;
|
|
55
56
|
};
|
|
56
57
|
updatedAt: {
|
|
57
|
-
type:
|
|
58
|
+
type: _lssm_lib_schema7.FieldType<Date, string>;
|
|
58
59
|
isOptional: true;
|
|
59
60
|
};
|
|
60
61
|
}>;
|
|
61
|
-
declare const GetOnboardingDraftBaseSpec: OperationSpec<
|
|
62
|
+
declare const GetOnboardingDraftBaseSpec: OperationSpec<_lssm_lib_schema7.AnySchemaModel, SchemaModel<{
|
|
62
63
|
id: {
|
|
63
|
-
type:
|
|
64
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
64
65
|
isOptional: true;
|
|
65
66
|
};
|
|
66
67
|
organizationId: {
|
|
67
|
-
type:
|
|
68
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
68
69
|
isOptional: true;
|
|
69
70
|
};
|
|
70
71
|
data: {
|
|
71
|
-
type:
|
|
72
|
+
type: _lssm_lib_schema7.FieldType<unknown, unknown>;
|
|
72
73
|
isOptional: true;
|
|
73
74
|
};
|
|
74
75
|
createdAt: {
|
|
75
|
-
type:
|
|
76
|
+
type: _lssm_lib_schema7.FieldType<Date, string>;
|
|
76
77
|
isOptional: true;
|
|
77
78
|
};
|
|
78
79
|
updatedAt: {
|
|
79
|
-
type:
|
|
80
|
+
type: _lssm_lib_schema7.FieldType<Date, string>;
|
|
80
81
|
isOptional: true;
|
|
81
82
|
};
|
|
82
83
|
}>, undefined>;
|
|
83
84
|
/** Delete onboarding draft (cleanup after completion or cancel) */
|
|
84
85
|
declare const DeleteOnboardingDraftOutput: SchemaModel<{
|
|
85
86
|
ok: {
|
|
86
|
-
type:
|
|
87
|
+
type: _lssm_lib_schema7.FieldType<boolean, boolean>;
|
|
87
88
|
isOptional: false;
|
|
88
89
|
};
|
|
89
90
|
}>;
|
|
90
|
-
declare const DeleteOnboardingDraftBaseSpec: OperationSpec<
|
|
91
|
+
declare const DeleteOnboardingDraftBaseSpec: OperationSpec<_lssm_lib_schema7.AnySchemaModel, SchemaModel<{
|
|
91
92
|
ok: {
|
|
92
|
-
type:
|
|
93
|
+
type: _lssm_lib_schema7.FieldType<boolean, boolean>;
|
|
93
94
|
isOptional: false;
|
|
94
95
|
};
|
|
95
96
|
}>, undefined>;
|
|
96
97
|
/** Complete onboarding (final submit, creates entities) */
|
|
97
98
|
declare const CompleteOnboardingBaseInput: SchemaModel<{
|
|
98
99
|
data: {
|
|
99
|
-
type:
|
|
100
|
+
type: _lssm_lib_schema7.FieldType<unknown, unknown>;
|
|
100
101
|
isOptional: false;
|
|
101
102
|
};
|
|
102
103
|
}>;
|
|
103
104
|
declare const CompleteOnboardingBaseOutput: SchemaModel<{
|
|
104
105
|
success: {
|
|
105
|
-
type:
|
|
106
|
+
type: _lssm_lib_schema7.FieldType<boolean, boolean>;
|
|
106
107
|
isOptional: false;
|
|
107
108
|
};
|
|
108
109
|
userId: {
|
|
109
|
-
type:
|
|
110
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
110
111
|
isOptional: true;
|
|
111
112
|
};
|
|
112
113
|
organizationId: {
|
|
113
|
-
type:
|
|
114
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
114
115
|
isOptional: true;
|
|
115
116
|
};
|
|
116
117
|
}>;
|
|
117
118
|
declare const CompleteOnboardingBaseSpec: OperationSpec<SchemaModel<{
|
|
118
119
|
data: {
|
|
119
|
-
type:
|
|
120
|
+
type: _lssm_lib_schema7.FieldType<unknown, unknown>;
|
|
120
121
|
isOptional: false;
|
|
121
122
|
};
|
|
122
123
|
}>, SchemaModel<{
|
|
123
124
|
success: {
|
|
124
|
-
type:
|
|
125
|
+
type: _lssm_lib_schema7.FieldType<boolean, boolean>;
|
|
125
126
|
isOptional: false;
|
|
126
127
|
};
|
|
127
128
|
userId: {
|
|
128
|
-
type:
|
|
129
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
129
130
|
isOptional: true;
|
|
130
131
|
};
|
|
131
132
|
organizationId: {
|
|
132
|
-
type:
|
|
133
|
+
type: _lssm_lib_schema7.FieldType<string, string>;
|
|
133
134
|
isOptional: true;
|
|
134
135
|
};
|
|
135
136
|
}>, undefined>;
|
package/dist/onboarding-base.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { E5, x8 } from "./schema/dist/index.js";
|
|
2
|
-
import { defineCommand, defineQuery } from "./operation.js";
|
|
3
2
|
import { OwnersEnum, StabilityEnum } from "./ownership.js";
|
|
3
|
+
import { defineCommand, defineQuery } from "./operations/operation.js";
|
|
4
|
+
import "./operations/index.js";
|
|
4
5
|
|
|
5
6
|
//#region src/onboarding-base.ts
|
|
6
7
|
/**
|
package/dist/openapi.d.ts
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AnyOperationSpec, EmitDecl, EmitDeclInline, EmitDeclRef, ImplementationRef, ImplementationType, OpKind, OperationSpec, TelemetryTrigger, defineCommand, defineQuery, isEmitDeclRef } from "./operation.js";
|
|
2
|
+
import { OperationKey, OperationSpecRegistry, opKey } from "./registry.js";
|
|
3
|
+
export { AnyOperationSpec, EmitDecl, EmitDeclInline, EmitDeclRef, ImplementationRef, ImplementationType, OpKind, OperationKey, OperationSpec, OperationSpecRegistry, TelemetryTrigger, defineCommand, defineQuery, isEmitDeclRef, opKey };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Owner, Stability, Tag } from "
|
|
2
|
-
import { DocId } from "
|
|
3
|
-
import { EventSpec } from "
|
|
4
|
-
import { ResourceRefDescriptor } from "
|
|
5
|
-
import { PolicyRef } from "
|
|
6
|
-
import { TestSpecRef } from "
|
|
1
|
+
import { Owner, Stability, Tag } from "../ownership.js";
|
|
2
|
+
import { DocId } from "../docs/registry.js";
|
|
3
|
+
import { EventSpec } from "../events.js";
|
|
4
|
+
import { ResourceRefDescriptor } from "../resources.js";
|
|
5
|
+
import { PolicyRef } from "../policy/spec.js";
|
|
6
|
+
import { TestSpecRef } from "../tests/spec.js";
|
|
7
7
|
import { AnySchemaModel } from "@lssm/lib.schema";
|
|
8
8
|
|
|
9
|
-
//#region src/operation.d.ts
|
|
9
|
+
//#region src/operations/operation.d.ts
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Distinguishes between state-changing operations (command) and read-only operations (query).
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ResourceRefDescriptor } from "
|
|
1
|
+
import { GroupKeyFn, RegistryFilter } from "../registry-utils.js";
|
|
2
|
+
import { ResourceRefDescriptor } from "../resources.js";
|
|
3
3
|
import { AnyOperationSpec, OperationSpec } from "./operation.js";
|
|
4
|
-
import { HandlerCtx } from "
|
|
5
|
-
import { HandlerForOperationSpec } from "
|
|
4
|
+
import { HandlerCtx } from "../types.js";
|
|
5
|
+
import { HandlerForOperationSpec } from "../install.js";
|
|
6
6
|
import { AnySchemaModel } from "@lssm/lib.schema";
|
|
7
7
|
|
|
8
|
-
//#region src/registry.d.ts
|
|
8
|
+
//#region src/operations/registry.d.ts
|
|
9
9
|
|
|
10
10
|
type OperationKey = `${string}.v${number}`;
|
|
11
11
|
declare function opKey(name: string, version: number): OperationKey;
|
|
@@ -53,6 +53,38 @@ declare class OperationSpecRegistry {
|
|
|
53
53
|
spec: AnyOperationSpec;
|
|
54
54
|
handler: AnyOperationHandler;
|
|
55
55
|
}[];
|
|
56
|
+
/**
|
|
57
|
+
* Filter specs by criteria.
|
|
58
|
+
*/
|
|
59
|
+
filter(criteria: RegistryFilter): AnyOperationSpec[];
|
|
60
|
+
/**
|
|
61
|
+
* List specs with specific tag.
|
|
62
|
+
*/
|
|
63
|
+
listByTag(tag: string): AnyOperationSpec[];
|
|
64
|
+
/**
|
|
65
|
+
* List specs by owner.
|
|
66
|
+
*/
|
|
67
|
+
listByOwner(owner: string): AnyOperationSpec[];
|
|
68
|
+
/**
|
|
69
|
+
* Group specs by key function.
|
|
70
|
+
*/
|
|
71
|
+
groupBy(keyFn: GroupKeyFn<AnyOperationSpec>): Map<string, AnyOperationSpec[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Group by domain (first segment of name).
|
|
74
|
+
*/
|
|
75
|
+
groupByDomain(): Map<string, AnyOperationSpec[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Group by tag.
|
|
78
|
+
*/
|
|
79
|
+
groupByTag(): Map<string, AnyOperationSpec[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Get unique tags from all specs.
|
|
82
|
+
*/
|
|
83
|
+
getUniqueTags(): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Get unique owners from all specs.
|
|
86
|
+
*/
|
|
87
|
+
getUniqueOwners(): string[];
|
|
56
88
|
/**
|
|
57
89
|
* Execute an operation by name/version with full runtime protections:
|
|
58
90
|
* 1. Validates input against Zod schema.
|
|
@@ -69,4 +101,4 @@ declare class OperationSpecRegistry {
|
|
|
69
101
|
execute(name: string, version: number | undefined, rawInput: unknown, ctx: HandlerCtx): Promise<unknown>;
|
|
70
102
|
}
|
|
71
103
|
//#endregion
|
|
72
|
-
export { OperationKey, OperationSpecRegistry,
|
|
104
|
+
export { OperationKey, OperationSpecRegistry, opKey };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __toCommonJS } from "../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { eventKey } from "../events.js";
|
|
3
|
+
import { init_registry_utils, registry_utils_exports } from "../registry-utils.js";
|
|
2
4
|
import { isEmitDeclRef } from "./operation.js";
|
|
3
|
-
import { defaultDocRegistry, docId, registerDocBlocks } from "./docs/registry.js";
|
|
4
5
|
|
|
5
|
-
//#region src/registry.ts
|
|
6
|
+
//#region src/operations/registry.ts
|
|
6
7
|
/**
|
|
7
8
|
* OperationSpecRegistry:
|
|
8
9
|
* - Registers ContractSpecs (unique by name+version)
|
|
@@ -94,6 +95,60 @@ var OperationSpecRegistry = class {
|
|
|
94
95
|
return out;
|
|
95
96
|
}
|
|
96
97
|
/**
|
|
98
|
+
* Filter specs by criteria.
|
|
99
|
+
*/
|
|
100
|
+
filter(criteria) {
|
|
101
|
+
const { filterBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
102
|
+
return filterBy(this.listSpecs(), criteria);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* List specs with specific tag.
|
|
106
|
+
*/
|
|
107
|
+
listByTag(tag) {
|
|
108
|
+
return this.listSpecs().filter((s) => s.meta.tags?.includes(tag));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* List specs by owner.
|
|
112
|
+
*/
|
|
113
|
+
listByOwner(owner) {
|
|
114
|
+
return this.listSpecs().filter((s) => s.meta.owners?.includes(owner));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Group specs by key function.
|
|
118
|
+
*/
|
|
119
|
+
groupBy(keyFn) {
|
|
120
|
+
const { groupBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
121
|
+
return groupBy(this.listSpecs(), keyFn);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Group by domain (first segment of name).
|
|
125
|
+
*/
|
|
126
|
+
groupByDomain() {
|
|
127
|
+
const { GroupingStrategies } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
128
|
+
return this.groupBy(GroupingStrategies.byDomain);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Group by tag.
|
|
132
|
+
*/
|
|
133
|
+
groupByTag() {
|
|
134
|
+
const { GroupingStrategies } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
135
|
+
return this.groupBy(GroupingStrategies.byTag);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get unique tags from all specs.
|
|
139
|
+
*/
|
|
140
|
+
getUniqueTags() {
|
|
141
|
+
const { getUniqueTags } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
142
|
+
return getUniqueTags(this.listSpecs());
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Get unique owners from all specs.
|
|
146
|
+
*/
|
|
147
|
+
getUniqueOwners() {
|
|
148
|
+
const { getUniqueOwners } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
149
|
+
return getUniqueOwners(this.listSpecs());
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
97
152
|
* Execute an operation by name/version with full runtime protections:
|
|
98
153
|
* 1. Validates input against Zod schema.
|
|
99
154
|
* 2. Enforces policy (Auth, RBAC, Rate Limits) via PDP.
|
|
@@ -206,4 +261,4 @@ var OperationSpecRegistry = class {
|
|
|
206
261
|
};
|
|
207
262
|
|
|
208
263
|
//#endregion
|
|
209
|
-
export { OperationSpecRegistry,
|
|
264
|
+
export { OperationSpecRegistry, opKey };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PresentationDescriptorV2, PresentationSource, PresentationSourceBlocknotejs, PresentationSourceComponentReact, PresentationTarget, PresentationV2Meta } from "./presentations.v2.js";
|
|
2
|
+
import { ComponentMap, PresentationRenderer, PresentationValidator, ReactRenderDescriptor, RenderContext, TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer } from "./transform-engine.js";
|
|
3
|
+
import { DataPresentation, MarkdownPresentation, PresentationContent, PresentationKind, PresentationMeta, PresentationPolicy, PresentationRegistry, PresentationSpec, WebComponentPresentation, jsonSchemaForPresentation } from "./presentations.js";
|
|
4
|
+
export { ComponentMap, DataPresentation, MarkdownPresentation, PresentationContent, PresentationDescriptorV2, PresentationKind, PresentationMeta, PresentationPolicy, PresentationRegistry, PresentationRenderer, PresentationSource, PresentationSourceBlocknotejs, PresentationSourceComponentReact, PresentationSpec, PresentationTarget, PresentationV2Meta, PresentationValidator, ReactRenderDescriptor, RenderContext, TransformEngine, WebComponentPresentation, createDefaultTransformEngine, jsonSchemaForPresentation, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer } from "./transform-engine.js";
|
|
2
|
+
import { PresentationRegistry, jsonSchemaForPresentation } from "./presentations.js";
|
|
3
|
+
|
|
4
|
+
export { PresentationRegistry, TransformEngine, createDefaultTransformEngine, jsonSchemaForPresentation, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Stability } from "
|
|
1
|
+
import { Stability } from "../ownership.js";
|
|
2
|
+
import { GroupKeyFn, RegistryFilter } from "../registry-utils.js";
|
|
2
3
|
import z from "zod";
|
|
3
|
-
import * as
|
|
4
|
+
import * as _lssm_lib_schema154 from "@lssm/lib.schema";
|
|
4
5
|
import { AnySchemaModel } from "@lssm/lib.schema";
|
|
5
6
|
|
|
6
|
-
//#region src/presentations.d.ts
|
|
7
|
+
//#region src/presentations/presentations.d.ts
|
|
7
8
|
/** V1 presentation kinds (back-compat). Prefer V2 descriptors for new work. */
|
|
8
9
|
type PresentationKind = 'web_component' | 'markdown' | 'data';
|
|
9
10
|
/** Minimal metadata for presentations (V1). */
|
|
@@ -58,11 +59,21 @@ declare class PresentationRegistry {
|
|
|
58
59
|
register(p: PresentationSpec): this;
|
|
59
60
|
list(): PresentationSpec[];
|
|
60
61
|
get(name: string, version?: number): PresentationSpec | undefined;
|
|
62
|
+
/** Filter presentations by criteria. */
|
|
63
|
+
filter(criteria: RegistryFilter): PresentationSpec[];
|
|
64
|
+
/** List presentations with specific tag. */
|
|
65
|
+
listByTag(tag: string): PresentationSpec[];
|
|
66
|
+
/** List presentations by owner. */
|
|
67
|
+
listByOwner(owner: string): PresentationSpec[];
|
|
68
|
+
/** Group presentations by key function. */
|
|
69
|
+
groupBy(keyFn: GroupKeyFn<PresentationSpec>): Map<string, PresentationSpec[]>;
|
|
70
|
+
/** Get unique tags from all presentations. */
|
|
71
|
+
getUniqueTags(): string[];
|
|
61
72
|
}
|
|
62
73
|
declare function jsonSchemaForPresentation(p: PresentationSpec): {
|
|
63
74
|
framework: "react";
|
|
64
75
|
componentKey: string;
|
|
65
|
-
props: z.core.ZodStandardJSONSchemaPayload<
|
|
76
|
+
props: z.core.ZodStandardJSONSchemaPayload<_lssm_lib_schema154.TopLevelZodFromModel<_lssm_lib_schema154.SchemaModelFieldsAnyConfig<AnySchemaModel | _lssm_lib_schema154.AnyFieldType | _lssm_lib_schema154.AnyEnumType>>>;
|
|
66
77
|
meta: {
|
|
67
78
|
readonly name: string;
|
|
68
79
|
readonly version: number;
|
|
@@ -84,7 +95,7 @@ declare function jsonSchemaForPresentation(p: PresentationSpec): {
|
|
|
84
95
|
kind: PresentationKind;
|
|
85
96
|
} | {
|
|
86
97
|
mimeType: string;
|
|
87
|
-
model: z.core.ZodStandardJSONSchemaPayload<
|
|
98
|
+
model: z.core.ZodStandardJSONSchemaPayload<_lssm_lib_schema154.TopLevelZodFromModel<_lssm_lib_schema154.SchemaModelFieldsAnyConfig<AnySchemaModel | _lssm_lib_schema154.AnyFieldType | _lssm_lib_schema154.AnyEnumType>>>;
|
|
88
99
|
meta: {
|
|
89
100
|
readonly name: string;
|
|
90
101
|
readonly version: number;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { __toCommonJS } from "../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { init_registry_utils, registry_utils_exports } from "../registry-utils.js";
|
|
1
3
|
import z from "zod";
|
|
2
4
|
|
|
3
|
-
//#region src/presentations.ts
|
|
5
|
+
//#region src/presentations/presentations.ts
|
|
4
6
|
function keyOf(p) {
|
|
5
7
|
return `${p.meta.name}.v${p.meta.version}`;
|
|
6
8
|
}
|
|
@@ -32,6 +34,29 @@ var PresentationRegistry = class {
|
|
|
32
34
|
}
|
|
33
35
|
return candidate;
|
|
34
36
|
}
|
|
37
|
+
/** Filter presentations by criteria. */
|
|
38
|
+
filter(criteria) {
|
|
39
|
+
const { filterBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
40
|
+
return filterBy(this.list(), criteria);
|
|
41
|
+
}
|
|
42
|
+
/** List presentations with specific tag. */
|
|
43
|
+
listByTag(tag) {
|
|
44
|
+
return this.list().filter((p) => p.meta.tags?.includes(tag));
|
|
45
|
+
}
|
|
46
|
+
/** List presentations by owner. */
|
|
47
|
+
listByOwner(owner) {
|
|
48
|
+
return this.list().filter((p) => p.meta.owners?.includes(owner));
|
|
49
|
+
}
|
|
50
|
+
/** Group presentations by key function. */
|
|
51
|
+
groupBy(keyFn) {
|
|
52
|
+
const { groupBy } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
53
|
+
return groupBy(this.list(), keyFn);
|
|
54
|
+
}
|
|
55
|
+
/** Get unique tags from all presentations. */
|
|
56
|
+
getUniqueTags() {
|
|
57
|
+
const { getUniqueTags } = (init_registry_utils(), __toCommonJS(registry_utils_exports));
|
|
58
|
+
return getUniqueTags(this.list());
|
|
59
|
+
}
|
|
35
60
|
};
|
|
36
61
|
function jsonSchemaForPresentation(p) {
|
|
37
62
|
const base = {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OwnerShipMeta } from "../ownership.js";
|
|
2
|
+
import { DocId } from "../docs/registry.js";
|
|
3
|
+
import { AnySchemaModel } from "@lssm/lib.schema";
|
|
4
|
+
import { BlockConfig } from "@blocknote/core";
|
|
5
|
+
|
|
6
|
+
//#region src/presentations/presentations.v2.d.ts
|
|
7
|
+
/** Supported render targets for the transform engine and descriptors. */
|
|
8
|
+
type PresentationTarget = 'react' | 'markdown' | 'application/json' | 'application/xml';
|
|
9
|
+
interface PresentationV2Meta extends Partial<OwnerShipMeta> {
|
|
10
|
+
/** Fully-qualified presentation name (e.g., "sigil.auth.webauth_tabs_v2"). */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Version of this descriptor. Increment on breaking changes. */
|
|
13
|
+
version: number;
|
|
14
|
+
/** Human-readable description for docs/a11y. Required by validators. */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Optional doc block id for this presentation. */
|
|
17
|
+
docId?: DocId;
|
|
18
|
+
}
|
|
19
|
+
/** React component presentation source. */
|
|
20
|
+
interface PresentationSourceComponentReact {
|
|
21
|
+
/** Source marker for React component presentations. */
|
|
22
|
+
type: 'component';
|
|
23
|
+
/** Framework for the component source (currently only 'react'). */
|
|
24
|
+
framework: 'react';
|
|
25
|
+
/** Component key resolved by host `componentMap`. */
|
|
26
|
+
componentKey: string;
|
|
27
|
+
/** Optional props schema to validate against. */
|
|
28
|
+
props?: AnySchemaModel;
|
|
29
|
+
}
|
|
30
|
+
/** BlockNoteJS document presentation source. */
|
|
31
|
+
interface PresentationSourceBlocknotejs {
|
|
32
|
+
/** Source marker for BlockNoteJS document presentations. */
|
|
33
|
+
type: 'blocknotejs';
|
|
34
|
+
/** BlockNoteJS JSON document. */
|
|
35
|
+
docJson: unknown;
|
|
36
|
+
/** Optional BlockNote config to guide rendering. */
|
|
37
|
+
blockConfig?: BlockConfig;
|
|
38
|
+
}
|
|
39
|
+
type PresentationSource = PresentationSourceComponentReact | PresentationSourceBlocknotejs;
|
|
40
|
+
/**
|
|
41
|
+
* Normalized presentation descriptor decoupled from framework/adapters.
|
|
42
|
+
* Renderers and validators are provided via TransformEngine.
|
|
43
|
+
*/
|
|
44
|
+
interface PresentationDescriptorV2 {
|
|
45
|
+
meta: PresentationV2Meta;
|
|
46
|
+
policy?: {
|
|
47
|
+
flags?: string[];
|
|
48
|
+
pii?: string[];
|
|
49
|
+
};
|
|
50
|
+
source: PresentationSource;
|
|
51
|
+
targets: PresentationTarget[];
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { PresentationDescriptorV2, PresentationSource, PresentationSourceBlocknotejs, PresentationSourceComponentReact, PresentationTarget, PresentationV2Meta };
|
|
@@ -1,56 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DocId } from "./docs/registry.js";
|
|
1
|
+
import { PresentationDescriptorV2, PresentationTarget } from "./presentations.v2.js";
|
|
3
2
|
import React from "react";
|
|
4
|
-
import { AnySchemaModel } from "@lssm/lib.schema";
|
|
5
3
|
import { BlockConfig } from "@blocknote/core";
|
|
6
4
|
|
|
7
|
-
//#region src/presentations.
|
|
8
|
-
/** Supported render targets for the transform engine and descriptors. */
|
|
9
|
-
type PresentationTarget = 'react' | 'markdown' | 'application/json' | 'application/xml';
|
|
10
|
-
interface PresentationV2Meta extends Partial<OwnerShipMeta> {
|
|
11
|
-
/** Fully-qualified presentation name (e.g., "sigil.auth.webauth_tabs_v2"). */
|
|
12
|
-
name: string;
|
|
13
|
-
/** Version of this descriptor. Increment on breaking changes. */
|
|
14
|
-
version: number;
|
|
15
|
-
/** Human-readable description for docs/a11y. Required by validators. */
|
|
16
|
-
description?: string;
|
|
17
|
-
/** Optional doc block id for this presentation. */
|
|
18
|
-
docId?: DocId;
|
|
19
|
-
}
|
|
20
|
-
/** React component presentation source. */
|
|
21
|
-
interface PresentationSourceComponentReact {
|
|
22
|
-
/** Source marker for React component presentations. */
|
|
23
|
-
type: 'component';
|
|
24
|
-
/** Framework for the component source (currently only 'react'). */
|
|
25
|
-
framework: 'react';
|
|
26
|
-
/** Component key resolved by host `componentMap`. */
|
|
27
|
-
componentKey: string;
|
|
28
|
-
/** Optional props schema to validate against. */
|
|
29
|
-
props?: AnySchemaModel;
|
|
30
|
-
}
|
|
31
|
-
/** BlockNoteJS document presentation source. */
|
|
32
|
-
interface PresentationSourceBlocknotejs {
|
|
33
|
-
/** Source marker for BlockNoteJS document presentations. */
|
|
34
|
-
type: 'blocknotejs';
|
|
35
|
-
/** BlockNoteJS JSON document. */
|
|
36
|
-
docJson: unknown;
|
|
37
|
-
/** Optional BlockNote config to guide rendering. */
|
|
38
|
-
blockConfig?: BlockConfig;
|
|
39
|
-
}
|
|
40
|
-
type PresentationSource = PresentationSourceComponentReact | PresentationSourceBlocknotejs;
|
|
41
|
-
/**
|
|
42
|
-
* Normalized presentation descriptor decoupled from framework/adapters.
|
|
43
|
-
* Renderers and validators are provided via TransformEngine.
|
|
44
|
-
*/
|
|
45
|
-
interface PresentationDescriptorV2 {
|
|
46
|
-
meta: PresentationV2Meta;
|
|
47
|
-
policy?: {
|
|
48
|
-
flags?: string[];
|
|
49
|
-
pii?: string[];
|
|
50
|
-
};
|
|
51
|
-
source: PresentationSource;
|
|
52
|
-
targets: PresentationTarget[];
|
|
53
|
-
}
|
|
5
|
+
//#region src/presentations/transform-engine.d.ts
|
|
54
6
|
interface RenderContext {
|
|
55
7
|
/** Optional locale hint (i18n). */
|
|
56
8
|
locale?: string;
|
|
@@ -111,4 +63,4 @@ type ComponentMap = Record<string, React.ComponentType<any>>;
|
|
|
111
63
|
*/
|
|
112
64
|
declare function registerReactToMarkdownRenderer(engine: TransformEngine, componentMap: ComponentMap): TransformEngine;
|
|
113
65
|
//#endregion
|
|
114
|
-
export { ComponentMap,
|
|
66
|
+
export { ComponentMap, PresentationRenderer, PresentationValidator, ReactRenderDescriptor, RenderContext, TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { schemaToMarkdown } from "
|
|
1
|
+
import { schemaToMarkdown } from "../schema-to-markdown.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import TurndownService from "turndown";
|
|
4
4
|
|
|
5
|
-
//#region src/presentations.
|
|
5
|
+
//#region src/presentations/transform-engine.ts
|
|
6
6
|
/**
|
|
7
7
|
* Pluggable transform engine that renders descriptors to various targets
|
|
8
8
|
* and runs validators (e.g., basic metadata checks, PII redaction policies).
|