@lssm/example.learning-journey-platform-tour 0.0.0-canary-20251217060834 → 0.0.0-canary-20251217072406
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$bundle.log +212 -21
- package/.turbo/turbo-build.log +211 -20
- package/CHANGELOG.md +4 -4
- package/dist/contracts/index.js +178 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/platform-tour.docblock.js +42 -1
- package/dist/example.js +38 -1
- package/dist/handlers/demo.handlers.js +26 -1
- package/dist/index.js +9 -1
- package/dist/learning-journey-platform-tour.feature.js +66 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -0
- package/dist/libs/contracts/dist/client/index.js +5 -0
- package/dist/libs/contracts/dist/client/react/feature-render.js +2 -0
- package/dist/libs/contracts/dist/client/react/form-render.js +4 -0
- package/dist/libs/contracts/dist/client/react/index.js +4 -0
- package/dist/libs/contracts/dist/contract-registry/index.js +1 -0
- package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -0
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/index.js +29 -0
- package/dist/libs/contracts/dist/docs/presentations.js +71 -0
- package/dist/libs/contracts/dist/docs/registry.js +44 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +80 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +57 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +357 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +79 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +84 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +45 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +40 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +69 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +62 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +155 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +101 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -0
- package/dist/libs/contracts/dist/events.js +1 -0
- package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
- package/dist/libs/contracts/dist/index.js +71 -0
- package/dist/libs/contracts/dist/install.js +2 -0
- package/dist/libs/contracts/dist/integrations/contracts.js +377 -0
- package/dist/libs/contracts/dist/integrations/index.js +18 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -0
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -0
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -0
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -0
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -0
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -0
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -0
- package/dist/libs/contracts/dist/integrations/providers/index.js +11 -0
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -0
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -0
- package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -0
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -0
- package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -0
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -0
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -0
- package/dist/libs/contracts/dist/jsonschema.js +1 -0
- package/dist/libs/contracts/dist/knowledge/contracts.js +306 -0
- package/dist/libs/contracts/dist/knowledge/index.js +7 -0
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -0
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -0
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -0
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -0
- package/dist/libs/contracts/dist/llm/exporters.js +19 -0
- package/dist/libs/contracts/dist/llm/index.js +2 -0
- package/dist/libs/contracts/dist/llm/prompts.js +1 -0
- package/dist/libs/contracts/dist/onboarding-base.js +196 -0
- package/dist/libs/contracts/dist/openapi.js +1 -0
- package/dist/libs/contracts/dist/ownership.js +21 -0
- package/dist/libs/contracts/dist/presentations.js +1 -0
- package/dist/libs/contracts/dist/presentations.v2.js +11 -0
- package/dist/libs/contracts/dist/prompt.js +1 -0
- package/dist/libs/contracts/dist/promptRegistry.js +1 -0
- package/dist/libs/contracts/dist/regenerator/index.js +1 -0
- package/dist/libs/contracts/dist/regenerator/service.js +6 -0
- package/dist/libs/contracts/dist/registry.js +2 -0
- package/dist/libs/contracts/dist/resources.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -0
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -0
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -0
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +34 -0
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -0
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/index.js +6 -0
- package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -0
- package/dist/libs/contracts/dist/server/index.js +8 -0
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -0
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -0
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -0
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -0
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -0
- package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
- package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
- package/dist/libs/contracts/dist/server/rest-express.js +1 -0
- package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
- package/dist/libs/contracts/dist/spec.js +34 -0
- package/dist/libs/contracts/dist/telemetry/index.js +1 -0
- package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
- package/dist/libs/contracts/dist/tests/index.js +1 -0
- package/dist/libs/contracts/dist/tests/runner.js +2 -0
- package/dist/libs/contracts/dist/workflow/index.js +1 -0
- package/dist/libs/contracts/dist/workflow/runner.js +1 -0
- package/dist/libs/schema/dist/EnumType.js +2 -0
- package/dist/libs/schema/dist/FieldType.js +49 -0
- package/dist/libs/schema/dist/ScalarTypeEnum.js +236 -0
- package/dist/libs/schema/dist/SchemaModel.js +39 -0
- package/dist/libs/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/schema/dist/entity/index.js +2 -0
- package/dist/libs/schema/dist/entity/types.js +1 -0
- package/dist/libs/schema/dist/index.js +6 -0
- package/dist/presentations/index.js +49 -1
- package/dist/track.js +105 -1
- package/package.json +6 -6
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region ../../libs/contracts/dist/spec.js
|
|
2
|
+
/**
|
|
3
|
+
* Helper to define a Command (write operation).
|
|
4
|
+
* Sets `kind: 'command'` and defaults `idempotent: false`.
|
|
5
|
+
*/
|
|
6
|
+
const defineCommand = (spec) => ({
|
|
7
|
+
...spec,
|
|
8
|
+
meta: {
|
|
9
|
+
...spec.meta,
|
|
10
|
+
kind: "command"
|
|
11
|
+
},
|
|
12
|
+
policy: {
|
|
13
|
+
...spec.policy,
|
|
14
|
+
idempotent: spec.policy?.["policy"]?.idempotent ?? false
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Helper to define a Query (read-only operation).
|
|
19
|
+
* Sets `kind: 'query'` and forces `idempotent: true`.
|
|
20
|
+
*/
|
|
21
|
+
const defineQuery = (spec) => ({
|
|
22
|
+
...spec,
|
|
23
|
+
meta: {
|
|
24
|
+
...spec.meta,
|
|
25
|
+
kind: "query"
|
|
26
|
+
},
|
|
27
|
+
policy: {
|
|
28
|
+
...spec.policy,
|
|
29
|
+
idempotent: true
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { defineCommand, defineQuery };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./tracker.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "crypto";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./runner.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./runner.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "node:crypto";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import "zod";
|
|
2
|
+
import { GraphQLScalarType } from "graphql";
|
|
3
|
+
|
|
4
|
+
//#region ../../libs/schema/dist/FieldType.js
|
|
5
|
+
/**
|
|
6
|
+
* GraphQL scalar wrapper that carries zod and JSON Schema metadata.
|
|
7
|
+
*
|
|
8
|
+
* TInternal is the runtime representation; TExternal is the GraphQL output.
|
|
9
|
+
*/
|
|
10
|
+
var FieldType = class extends GraphQLScalarType {
|
|
11
|
+
zodSchema;
|
|
12
|
+
jsonSchemaDef;
|
|
13
|
+
constructor(config) {
|
|
14
|
+
super(config);
|
|
15
|
+
this.zodSchema = config.zod;
|
|
16
|
+
this.jsonSchemaDef = config.jsonSchema;
|
|
17
|
+
}
|
|
18
|
+
/** Return the attached zod schema for validation. */
|
|
19
|
+
getZod() {
|
|
20
|
+
return this.zodSchema;
|
|
21
|
+
}
|
|
22
|
+
/** GraphQL scalar instance usable by Pothos or vanilla GraphQL. */
|
|
23
|
+
getPothos() {
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
/** Return the JSON Schema (evaluates factory if provided). */
|
|
27
|
+
getJson() {
|
|
28
|
+
return typeof this.jsonSchemaDef === "function" ? this.jsonSchemaDef() : this.jsonSchemaDef;
|
|
29
|
+
}
|
|
30
|
+
getJsonSchemaDef() {
|
|
31
|
+
return this.jsonSchemaDef;
|
|
32
|
+
}
|
|
33
|
+
getJsonSchema() {
|
|
34
|
+
const deepResolve = (v) => {
|
|
35
|
+
const value = typeof v === "function" ? v() : v;
|
|
36
|
+
if (Array.isArray(value)) return value.map((item) => deepResolve(item));
|
|
37
|
+
if (value && typeof value === "object") {
|
|
38
|
+
const obj = {};
|
|
39
|
+
for (const [k, val] of Object.entries(value)) obj[k] = deepResolve(val);
|
|
40
|
+
return obj;
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
};
|
|
44
|
+
return deepResolve(this.getJson());
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { FieldType };
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { FieldType } from "./FieldType.js";
|
|
2
|
+
import * as z$1 from "zod";
|
|
3
|
+
import { Kind } from "graphql";
|
|
4
|
+
|
|
5
|
+
//#region ../../libs/schema/dist/ScalarTypeEnum.js
|
|
6
|
+
const localeRegex = /^[A-Za-z]{2}(?:-[A-Za-z0-9]{2,8})*$/;
|
|
7
|
+
const timezoneRegex = /^(?:UTC|[A-Za-z_]+\/[A-Za-z_]+)$/;
|
|
8
|
+
const phoneRegex = /^[+]?\d[\d\s().-]{3,}$/;
|
|
9
|
+
const currencyRegex = /^[A-Z]{3}$/;
|
|
10
|
+
const countryRegex = /^[A-Z]{2}$/;
|
|
11
|
+
const latMin = -90;
|
|
12
|
+
const latMax = 90;
|
|
13
|
+
const lonMin = -180;
|
|
14
|
+
const lonMax = 180;
|
|
15
|
+
/**
|
|
16
|
+
* Factory functions for common scalar FieldTypes with zod/GraphQL/JSON Schema.
|
|
17
|
+
*/
|
|
18
|
+
const ScalarTypeEnum = {
|
|
19
|
+
String_unsecure: () => new FieldType({
|
|
20
|
+
name: "String_unsecure",
|
|
21
|
+
description: "Unvalidated string scalar",
|
|
22
|
+
zod: z$1.string(),
|
|
23
|
+
parseValue: (v) => z$1.string().parse(v),
|
|
24
|
+
serialize: (v) => String(v),
|
|
25
|
+
parseLiteral: (ast) => {
|
|
26
|
+
if (ast.kind !== Kind.STRING) throw new TypeError("Invalid literal");
|
|
27
|
+
return ast.value;
|
|
28
|
+
},
|
|
29
|
+
jsonSchema: { type: "string" }
|
|
30
|
+
}),
|
|
31
|
+
Int_unsecure: () => new FieldType({
|
|
32
|
+
name: "Int_unsecure",
|
|
33
|
+
description: "Unvalidated integer scalar",
|
|
34
|
+
zod: z$1.number().int(),
|
|
35
|
+
parseValue: (v) => {
|
|
36
|
+
const num = typeof v === "number" ? v : Number(v);
|
|
37
|
+
return z$1.number().int().parse(num);
|
|
38
|
+
},
|
|
39
|
+
serialize: (v) => Math.trunc(typeof v === "number" ? v : Number(v)),
|
|
40
|
+
parseLiteral: (ast) => {
|
|
41
|
+
if (ast.kind !== Kind.INT) throw new TypeError("Invalid literal");
|
|
42
|
+
return Number(ast.value);
|
|
43
|
+
},
|
|
44
|
+
jsonSchema: { type: "integer" }
|
|
45
|
+
}),
|
|
46
|
+
Float_unsecure: () => new FieldType({
|
|
47
|
+
name: "Float_unsecure",
|
|
48
|
+
description: "Unvalidated float scalar",
|
|
49
|
+
zod: z$1.number(),
|
|
50
|
+
parseValue: (v) => {
|
|
51
|
+
const num = typeof v === "number" ? v : Number(v);
|
|
52
|
+
return z$1.number().parse(num);
|
|
53
|
+
},
|
|
54
|
+
serialize: (v) => Number(v),
|
|
55
|
+
parseLiteral: (ast) => {
|
|
56
|
+
if (ast.kind !== Kind.FLOAT && ast.kind !== Kind.INT) throw new TypeError("Invalid literal");
|
|
57
|
+
return Number(ast.value);
|
|
58
|
+
},
|
|
59
|
+
jsonSchema: { type: "number" }
|
|
60
|
+
}),
|
|
61
|
+
Boolean: () => new FieldType({
|
|
62
|
+
name: "Boolean",
|
|
63
|
+
description: "Unvalidated boolean scalar",
|
|
64
|
+
zod: z$1.boolean(),
|
|
65
|
+
parseValue: (v) => z$1.coerce.boolean().parse(v),
|
|
66
|
+
serialize: (v) => Boolean(v),
|
|
67
|
+
parseLiteral: (ast) => {
|
|
68
|
+
if (ast.kind !== Kind.BOOLEAN) throw new TypeError("Invalid literal");
|
|
69
|
+
return ast.value;
|
|
70
|
+
},
|
|
71
|
+
jsonSchema: { type: "boolean" }
|
|
72
|
+
}),
|
|
73
|
+
ID: () => new FieldType({
|
|
74
|
+
name: "ID",
|
|
75
|
+
description: "Unvalidated id scalar",
|
|
76
|
+
zod: z$1.string(),
|
|
77
|
+
parseValue: (v) => z$1.string().parse(v),
|
|
78
|
+
serialize: (v) => String(v),
|
|
79
|
+
parseLiteral: (ast) => {
|
|
80
|
+
if (ast.kind !== Kind.STRING) throw new TypeError("Invalid literal");
|
|
81
|
+
return ast.value;
|
|
82
|
+
},
|
|
83
|
+
jsonSchema: { type: "string" }
|
|
84
|
+
}),
|
|
85
|
+
JSON: () => new FieldType({
|
|
86
|
+
name: "JSON",
|
|
87
|
+
zod: z$1.any(),
|
|
88
|
+
parseValue: (v) => v,
|
|
89
|
+
serialize: (v) => v,
|
|
90
|
+
jsonSchema: {}
|
|
91
|
+
}),
|
|
92
|
+
JSONObject: () => new FieldType({
|
|
93
|
+
name: "JSONObject",
|
|
94
|
+
zod: z$1.record(z$1.string(), z$1.any()),
|
|
95
|
+
parseValue: (v) => z$1.record(z$1.string(), z$1.any()).parse(v),
|
|
96
|
+
serialize: (v) => v ?? {},
|
|
97
|
+
jsonSchema: { type: "object" }
|
|
98
|
+
}),
|
|
99
|
+
Date: () => new FieldType({
|
|
100
|
+
name: "Date",
|
|
101
|
+
zod: z$1.date(),
|
|
102
|
+
parseValue: (v) => v instanceof Date ? v : new Date(String(v)),
|
|
103
|
+
serialize: (v) => v instanceof Date ? v.toISOString().split("T")[0] : String(v),
|
|
104
|
+
jsonSchema: {
|
|
105
|
+
type: "string",
|
|
106
|
+
format: "date"
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
DateTime: () => new FieldType({
|
|
110
|
+
name: "DateTime",
|
|
111
|
+
zod: z$1.date(),
|
|
112
|
+
parseValue: (v) => v instanceof Date ? v : new Date(String(v)),
|
|
113
|
+
serialize: (v) => {
|
|
114
|
+
return v instanceof Date ? v.toISOString() : String(v);
|
|
115
|
+
},
|
|
116
|
+
jsonSchema: {
|
|
117
|
+
type: "string",
|
|
118
|
+
format: "date-time"
|
|
119
|
+
}
|
|
120
|
+
}),
|
|
121
|
+
Time: () => new FieldType({
|
|
122
|
+
name: "Time",
|
|
123
|
+
zod: z$1.string().regex(/^\d{2}:\d{2}(:\d{2})?$/),
|
|
124
|
+
parseValue: (v) => z$1.string().regex(/^\d{2}:\d{2}(:\d{2})?$/).parse(v),
|
|
125
|
+
serialize: (v) => String(v),
|
|
126
|
+
jsonSchema: {
|
|
127
|
+
type: "string",
|
|
128
|
+
pattern: "^\\d{2}:\\d{2}(:\\d{2})?$"
|
|
129
|
+
}
|
|
130
|
+
}),
|
|
131
|
+
EmailAddress: () => new FieldType({
|
|
132
|
+
name: "EmailAddress",
|
|
133
|
+
zod: z$1.string().email(),
|
|
134
|
+
parseValue: (v) => z$1.string().email().parse(v),
|
|
135
|
+
serialize: (v) => String(v),
|
|
136
|
+
jsonSchema: {
|
|
137
|
+
type: "string",
|
|
138
|
+
format: "email"
|
|
139
|
+
}
|
|
140
|
+
}),
|
|
141
|
+
URL: () => new FieldType({
|
|
142
|
+
name: "URL",
|
|
143
|
+
zod: z$1.string().url(),
|
|
144
|
+
parseValue: (v) => z$1.string().url().parse(v),
|
|
145
|
+
serialize: (v) => String(v),
|
|
146
|
+
jsonSchema: {
|
|
147
|
+
type: "string",
|
|
148
|
+
format: "uri"
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
151
|
+
PhoneNumber: () => new FieldType({
|
|
152
|
+
name: "PhoneNumber",
|
|
153
|
+
zod: z$1.string().regex(phoneRegex),
|
|
154
|
+
parseValue: (v) => z$1.string().regex(phoneRegex).parse(v),
|
|
155
|
+
serialize: (v) => String(v),
|
|
156
|
+
jsonSchema: {
|
|
157
|
+
type: "string",
|
|
158
|
+
pattern: phoneRegex.source
|
|
159
|
+
}
|
|
160
|
+
}),
|
|
161
|
+
NonEmptyString: () => new FieldType({
|
|
162
|
+
name: "NonEmptyString",
|
|
163
|
+
zod: z$1.string().min(1),
|
|
164
|
+
parseValue: (v) => z$1.string().min(1).parse(v),
|
|
165
|
+
serialize: (v) => String(v),
|
|
166
|
+
jsonSchema: {
|
|
167
|
+
type: "string",
|
|
168
|
+
minLength: 1
|
|
169
|
+
}
|
|
170
|
+
}),
|
|
171
|
+
Locale: () => new FieldType({
|
|
172
|
+
name: "Locale",
|
|
173
|
+
zod: z$1.string().regex(localeRegex),
|
|
174
|
+
parseValue: (v) => z$1.string().regex(localeRegex).parse(v),
|
|
175
|
+
serialize: (v) => String(v),
|
|
176
|
+
jsonSchema: {
|
|
177
|
+
type: "string",
|
|
178
|
+
pattern: localeRegex.source
|
|
179
|
+
}
|
|
180
|
+
}),
|
|
181
|
+
TimeZone: () => new FieldType({
|
|
182
|
+
name: "TimeZone",
|
|
183
|
+
zod: z$1.string().regex(timezoneRegex),
|
|
184
|
+
parseValue: (v) => z$1.string().regex(timezoneRegex).parse(v),
|
|
185
|
+
serialize: (v) => String(v),
|
|
186
|
+
jsonSchema: {
|
|
187
|
+
type: "string",
|
|
188
|
+
pattern: timezoneRegex.source
|
|
189
|
+
}
|
|
190
|
+
}),
|
|
191
|
+
Latitude: () => new FieldType({
|
|
192
|
+
name: "Latitude",
|
|
193
|
+
zod: z$1.number().min(latMin).max(latMax),
|
|
194
|
+
parseValue: (v) => z$1.coerce.number().min(latMin).max(latMax).parse(v),
|
|
195
|
+
serialize: (v) => Number(v),
|
|
196
|
+
jsonSchema: {
|
|
197
|
+
type: "number",
|
|
198
|
+
minimum: latMin,
|
|
199
|
+
maximum: latMax
|
|
200
|
+
}
|
|
201
|
+
}),
|
|
202
|
+
Longitude: () => new FieldType({
|
|
203
|
+
name: "Longitude",
|
|
204
|
+
zod: z$1.number().min(lonMin).max(lonMax),
|
|
205
|
+
parseValue: (v) => z$1.coerce.number().min(lonMin).max(lonMax).parse(v),
|
|
206
|
+
serialize: (v) => Number(v),
|
|
207
|
+
jsonSchema: {
|
|
208
|
+
type: "number",
|
|
209
|
+
minimum: lonMin,
|
|
210
|
+
maximum: lonMax
|
|
211
|
+
}
|
|
212
|
+
}),
|
|
213
|
+
Currency: () => new FieldType({
|
|
214
|
+
name: "Currency",
|
|
215
|
+
zod: z$1.string().regex(currencyRegex),
|
|
216
|
+
parseValue: (v) => z$1.string().regex(currencyRegex).parse(v),
|
|
217
|
+
serialize: (v) => String(v),
|
|
218
|
+
jsonSchema: {
|
|
219
|
+
type: "string",
|
|
220
|
+
pattern: currencyRegex.source
|
|
221
|
+
}
|
|
222
|
+
}),
|
|
223
|
+
CountryCode: () => new FieldType({
|
|
224
|
+
name: "CountryCode",
|
|
225
|
+
zod: z$1.string().regex(countryRegex),
|
|
226
|
+
parseValue: (v) => z$1.string().regex(countryRegex).parse(v),
|
|
227
|
+
serialize: (v) => String(v),
|
|
228
|
+
jsonSchema: {
|
|
229
|
+
type: "string",
|
|
230
|
+
pattern: countryRegex.source
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
//#endregion
|
|
236
|
+
export { ScalarTypeEnum };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "./EnumType.js";
|
|
2
|
+
import "./FieldType.js";
|
|
3
|
+
import * as z$1 from "zod";
|
|
4
|
+
|
|
5
|
+
//#region ../../libs/schema/dist/SchemaModel.js
|
|
6
|
+
/**
|
|
7
|
+
* Named object model built from FieldType/EnumType/SchemaModel fields.
|
|
8
|
+
* Provides zod and GraphQL input helpers, and supports arrays/optional fields.
|
|
9
|
+
*/
|
|
10
|
+
var SchemaModel = class {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.config = config;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Build a typed ZodObject from the model fields, preserving each field's
|
|
16
|
+
* Zod schema and optionality at the type level when possible.
|
|
17
|
+
*/
|
|
18
|
+
getZod() {
|
|
19
|
+
const shape = Object.entries(this.config.fields).reduce((acc, [key, def]) => {
|
|
20
|
+
const base = def.type.getZod();
|
|
21
|
+
const withArray = def.isArray ? z$1.array(base) : base;
|
|
22
|
+
acc[key] = def.isOptional ? withArray.optional() : withArray;
|
|
23
|
+
return acc;
|
|
24
|
+
}, {});
|
|
25
|
+
return z$1.object(shape);
|
|
26
|
+
}
|
|
27
|
+
/** Input object name for GraphQL builder adapters. */
|
|
28
|
+
getPothosInput() {
|
|
29
|
+
return this.config.name;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Helper to define a SchemaModel with type inference.
|
|
34
|
+
* Equivalent to `new SchemaModel(config)` but with better ergonomics.
|
|
35
|
+
*/
|
|
36
|
+
const defineSchemaModel = (config) => new SchemaModel(config);
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { SchemaModel, defineSchemaModel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "zod";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "zod";
|
|
@@ -1 +1,49 @@
|
|
|
1
|
-
import{PlatformTourTrackModel
|
|
1
|
+
import { PlatformTourTrackModel } from "../contracts/index.js";
|
|
2
|
+
|
|
3
|
+
//#region src/presentations/index.ts
|
|
4
|
+
const baseMeta = {
|
|
5
|
+
domain: "learning-journey",
|
|
6
|
+
owners: ["examples.learning-journey.platform-tour"],
|
|
7
|
+
tags: [
|
|
8
|
+
"learning",
|
|
9
|
+
"platform",
|
|
10
|
+
"tour"
|
|
11
|
+
]
|
|
12
|
+
};
|
|
13
|
+
const PlatformTourTrackPresentation = {
|
|
14
|
+
meta: {
|
|
15
|
+
name: "learning.journey.platform.track",
|
|
16
|
+
version: 1,
|
|
17
|
+
description: "Platform primitives tour track detail",
|
|
18
|
+
...baseMeta
|
|
19
|
+
},
|
|
20
|
+
source: {
|
|
21
|
+
type: "component",
|
|
22
|
+
framework: "react",
|
|
23
|
+
componentKey: "LearningTrackDetail",
|
|
24
|
+
props: PlatformTourTrackModel
|
|
25
|
+
},
|
|
26
|
+
targets: [
|
|
27
|
+
"react",
|
|
28
|
+
"markdown",
|
|
29
|
+
"application/json"
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
const PlatformTourWidgetPresentation = {
|
|
33
|
+
meta: {
|
|
34
|
+
name: "learning.journey.platform.widget",
|
|
35
|
+
version: 1,
|
|
36
|
+
description: "Compact widget for platform tour progress",
|
|
37
|
+
...baseMeta
|
|
38
|
+
},
|
|
39
|
+
source: {
|
|
40
|
+
type: "component",
|
|
41
|
+
framework: "react",
|
|
42
|
+
componentKey: "LearningTrackProgressWidget"
|
|
43
|
+
},
|
|
44
|
+
targets: ["react"]
|
|
45
|
+
};
|
|
46
|
+
const platformTourPresentations = [PlatformTourTrackPresentation, PlatformTourWidgetPresentation];
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { PlatformTourTrackPresentation, PlatformTourWidgetPresentation, platformTourPresentations };
|
package/dist/track.js
CHANGED
|
@@ -1 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/track.ts
|
|
2
|
+
const platformPrimitivesTourTrack = {
|
|
3
|
+
id: "platform_primitives_tour",
|
|
4
|
+
productId: "contractspec-platform",
|
|
5
|
+
name: "Platform Primitives Tour",
|
|
6
|
+
description: "Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",
|
|
7
|
+
targetUserSegment: "platform_developer",
|
|
8
|
+
targetRole: "developer",
|
|
9
|
+
totalXp: 140,
|
|
10
|
+
completionRewards: {
|
|
11
|
+
xpBonus: 20,
|
|
12
|
+
badgeKey: "platform_primitives"
|
|
13
|
+
},
|
|
14
|
+
steps: [
|
|
15
|
+
{
|
|
16
|
+
id: "identity_rbac",
|
|
17
|
+
title: "Create org and member",
|
|
18
|
+
description: "Create an org and add at least one member.",
|
|
19
|
+
order: 1,
|
|
20
|
+
completion: {
|
|
21
|
+
eventName: "org.member.added",
|
|
22
|
+
sourceModule: "@lssm/lib.identity-rbac"
|
|
23
|
+
},
|
|
24
|
+
xpReward: 20,
|
|
25
|
+
metadata: { surface: "identity" }
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "event_bus_audit",
|
|
29
|
+
title: "Emit an auditable event",
|
|
30
|
+
description: "Emit an event that lands in the audit log.",
|
|
31
|
+
order: 2,
|
|
32
|
+
completion: {
|
|
33
|
+
eventName: "audit_log.created",
|
|
34
|
+
sourceModule: "@lssm/module.audit-trail"
|
|
35
|
+
},
|
|
36
|
+
xpReward: 20,
|
|
37
|
+
metadata: { surface: "bus+audit" }
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "notifications",
|
|
41
|
+
title: "Send a notification",
|
|
42
|
+
description: "Send yourself a notification and verify delivery.",
|
|
43
|
+
order: 3,
|
|
44
|
+
completion: {
|
|
45
|
+
eventName: "notification.sent",
|
|
46
|
+
sourceModule: "@lssm/module.notifications"
|
|
47
|
+
},
|
|
48
|
+
xpReward: 20,
|
|
49
|
+
metadata: { surface: "notifications" }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "jobs_scheduler",
|
|
53
|
+
title: "Schedule and run a job",
|
|
54
|
+
description: "Schedule a background job and let it run once.",
|
|
55
|
+
order: 4,
|
|
56
|
+
completion: {
|
|
57
|
+
eventName: "job.completed",
|
|
58
|
+
sourceModule: "@lssm/lib.jobs"
|
|
59
|
+
},
|
|
60
|
+
xpReward: 20,
|
|
61
|
+
metadata: { surface: "jobs" }
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "feature_flags",
|
|
65
|
+
title: "Create and toggle a feature flag",
|
|
66
|
+
description: "Create a feature flag and toggle it at least once.",
|
|
67
|
+
order: 5,
|
|
68
|
+
completion: {
|
|
69
|
+
eventName: "flag.toggled",
|
|
70
|
+
sourceModule: "@lssm/lib.feature-flags"
|
|
71
|
+
},
|
|
72
|
+
xpReward: 20,
|
|
73
|
+
metadata: { surface: "feature-flags" }
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "files_attachments",
|
|
77
|
+
title: "Attach a file",
|
|
78
|
+
description: "Upload and attach a file to any entity.",
|
|
79
|
+
order: 6,
|
|
80
|
+
completion: {
|
|
81
|
+
eventName: "attachment.attached",
|
|
82
|
+
sourceModule: "@lssm/lib.files"
|
|
83
|
+
},
|
|
84
|
+
xpReward: 20,
|
|
85
|
+
metadata: { surface: "files" }
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "usage_metering",
|
|
89
|
+
title: "Record usage",
|
|
90
|
+
description: "Emit a usage metric (regeneration, agent run, or similar).",
|
|
91
|
+
order: 7,
|
|
92
|
+
completion: {
|
|
93
|
+
eventName: "usage.recorded",
|
|
94
|
+
sourceModule: "@lssm/lib.metering"
|
|
95
|
+
},
|
|
96
|
+
xpReward: 20,
|
|
97
|
+
metadata: { surface: "metering" }
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
metadata: { surfacedIn: ["studio/learning", "platform/dev-center"] }
|
|
101
|
+
};
|
|
102
|
+
const platformLearningTracks = [platformPrimitivesTourTrack];
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
export { platformLearningTracks, platformPrimitivesTourTrack };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/example.learning-journey-platform-tour",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251217072406",
|
|
4
4
|
"description": "Learning journey track covering ContractSpec platform primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"lint:check": "eslint src"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@lssm/lib.contracts": "0.0.0-canary-
|
|
34
|
-
"@lssm/lib.schema": "0.0.0-canary-
|
|
35
|
-
"@lssm/module.learning-journey": "0.0.0-canary-
|
|
33
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251217072406",
|
|
34
|
+
"@lssm/lib.schema": "0.0.0-canary-20251217072406",
|
|
35
|
+
"@lssm/module.learning-journey": "0.0.0-canary-20251217072406"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
39
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
38
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251217072406",
|
|
39
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251217072406",
|
|
40
40
|
"tsdown": "^0.17.4",
|
|
41
41
|
"typescript": "^5.9.3"
|
|
42
42
|
},
|