@lssm/example.analytics-dashboard 0.0.0-canary-20251217063201 → 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.
Files changed (94) hide show
  1. package/dist/dashboard/dashboard.contracts.d.ts +131 -131
  2. package/dist/dashboard/dashboard.contracts.js +5 -5
  3. package/dist/dashboard/dashboard.enum.d.ts +4 -4
  4. package/dist/dashboard/dashboard.enum.js +4 -4
  5. package/dist/dashboard/dashboard.schema.d.ts +79 -79
  6. package/dist/dashboard/dashboard.schema.js +43 -43
  7. package/dist/docs/analytics-dashboard.docblock.js +2 -2
  8. package/dist/events.d.ts +40 -40
  9. package/dist/events.js +25 -25
  10. package/dist/libs/contracts/dist/capabilities/openbanking.js +53 -49
  11. package/dist/libs/contracts/dist/client/index.js +1 -1
  12. package/dist/libs/contracts/dist/client/react/index.js +1 -1
  13. package/dist/libs/contracts/dist/contract-registry/index.js +1 -1
  14. package/dist/libs/contracts/dist/contract-registry/schemas.js +52 -49
  15. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +11 -86
  16. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +11 -360
  17. package/dist/libs/contracts/dist/docs/index.js +2 -2
  18. package/dist/libs/contracts/dist/docs/presentations.js +48 -44
  19. package/dist/libs/contracts/dist/docs/registry.js +27 -25
  20. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +11 -393
  21. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +11 -78
  22. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +11 -150
  23. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +11 -96
  24. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +10 -10
  25. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +15 -15
  26. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +12 -12
  27. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +11 -223
  28. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +44 -44
  29. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +30 -14
  30. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +10 -10
  31. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +13 -274
  32. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +41 -15
  33. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +15 -15
  34. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +14 -14
  35. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +16 -28
  36. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +60 -15
  37. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +13 -13
  38. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +31 -48
  39. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +40 -15
  40. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +14 -14
  41. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +22 -22
  42. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +12 -12
  43. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +22 -22
  44. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +11 -11
  45. package/dist/libs/contracts/dist/events.js +4 -3
  46. package/dist/libs/contracts/dist/index.js +14 -14
  47. package/dist/libs/contracts/dist/integrations/contracts.js +205 -199
  48. package/dist/libs/contracts/dist/integrations/index.js +5 -5
  49. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +133 -130
  50. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +95 -93
  51. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -3
  52. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +120 -118
  53. package/dist/libs/contracts/dist/integrations/openbanking/models.js +122 -120
  54. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +9 -20
  55. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +25 -25
  56. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +36 -36
  57. package/dist/libs/contracts/dist/integrations/providers/gmail.js +40 -40
  58. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +31 -31
  59. package/dist/libs/contracts/dist/integrations/providers/mistral.js +31 -31
  60. package/dist/libs/contracts/dist/integrations/providers/postmark.js +31 -31
  61. package/dist/libs/contracts/dist/integrations/providers/powens.js +51 -51
  62. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +31 -31
  63. package/dist/libs/contracts/dist/integrations/providers/stripe.js +35 -35
  64. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +28 -28
  65. package/dist/libs/contracts/dist/jsonschema.js +1 -1
  66. package/dist/libs/contracts/dist/knowledge/contracts.js +170 -163
  67. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +17 -17
  68. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +17 -17
  69. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +19 -19
  70. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +17 -17
  71. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +17 -17
  72. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +17 -17
  73. package/dist/libs/contracts/dist/llm/exporters.js +13 -12
  74. package/dist/libs/contracts/dist/onboarding-base.js +116 -99
  75. package/dist/libs/contracts/dist/ownership.js +18 -33
  76. package/dist/libs/contracts/dist/presentations.js +1 -1
  77. package/dist/libs/contracts/dist/presentations.v2.js +6 -2
  78. package/dist/libs/contracts/dist/regenerator/service.js +5 -0
  79. package/dist/libs/contracts/dist/registry.js +1 -1
  80. package/dist/libs/contracts/dist/schema/dist/FieldType.js +24 -14
  81. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +180 -166
  82. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +20 -9
  83. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -1
  84. package/dist/libs/contracts/dist/spec.js +22 -13
  85. package/dist/libs/schema/dist/EnumType.js +25 -9
  86. package/dist/libs/schema/dist/FieldType.js +24 -14
  87. package/dist/libs/schema/dist/ScalarTypeEnum.js +180 -166
  88. package/dist/libs/schema/dist/SchemaModel.js +25 -10
  89. package/dist/libs/schema/dist/index.js +4 -4
  90. package/dist/query/query.contracts.d.ts +44 -44
  91. package/dist/query/query.contracts.js +3 -3
  92. package/dist/query/query.enum.js +2 -2
  93. package/dist/query/query.schema.js +33 -33
  94. package/package.json +10 -10
@@ -1,222 +1,236 @@
1
- import { t } from "./FieldType.js";
2
- import * as t$1 from "zod";
1
+ import { FieldType } from "./FieldType.js";
2
+ import * as z$1 from "zod";
3
3
  import { Kind } from "graphql";
4
4
 
5
5
  //#region ../../libs/contracts/dist/schema/dist/ScalarTypeEnum.js
6
- const r = /^[A-Za-z]{2}(?:-[A-Za-z0-9]{2,8})*$/, i = /^(?:UTC|[A-Za-z_]+\/[A-Za-z_]+)$/, a = /^[+]?\d[\d\s().-]{3,}$/, o = /^[A-Z]{3}$/, s = /^[A-Z]{2}$/, c = -180, l = {
7
- String_unsecure: () => new t({
8
- name: `String_unsecure`,
9
- description: `Unvalidated string scalar`,
10
- zod: t$1.string(),
11
- parseValue: (e$1) => t$1.string().parse(e$1),
12
- serialize: (e$1) => String(e$1),
13
- parseLiteral: (e$1) => {
14
- if (e$1.kind !== Kind.STRING) throw TypeError(`Invalid literal`);
15
- return e$1.value;
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;
16
28
  },
17
- jsonSchema: { type: `string` }
18
- }),
19
- Int_unsecure: () => new t({
20
- name: `Int_unsecure`,
21
- description: `Unvalidated integer scalar`,
22
- zod: t$1.number().int(),
23
- parseValue: (e$1) => {
24
- let n = typeof e$1 == `number` ? e$1 : Number(e$1);
25
- return t$1.number().int().parse(n);
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);
26
38
  },
27
- serialize: (e$1) => Math.trunc(typeof e$1 == `number` ? e$1 : Number(e$1)),
28
- parseLiteral: (e$1) => {
29
- if (e$1.kind !== Kind.INT) throw TypeError(`Invalid literal`);
30
- return Number(e$1.value);
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);
31
43
  },
32
- jsonSchema: { type: `integer` }
33
- }),
34
- Float_unsecure: () => new t({
35
- name: `Float_unsecure`,
36
- description: `Unvalidated float scalar`,
37
- zod: t$1.number(),
38
- parseValue: (e$1) => {
39
- let n = typeof e$1 == `number` ? e$1 : Number(e$1);
40
- return t$1.number().parse(n);
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);
41
53
  },
42
- serialize: (e$1) => Number(e$1),
43
- parseLiteral: (e$1) => {
44
- if (e$1.kind !== Kind.FLOAT && e$1.kind !== Kind.INT) throw TypeError(`Invalid literal`);
45
- return Number(e$1.value);
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);
46
58
  },
47
- jsonSchema: { type: `number` }
48
- }),
49
- Boolean: () => new t({
50
- name: `Boolean`,
51
- description: `Unvalidated boolean scalar`,
52
- zod: t$1.boolean(),
53
- parseValue: (e$1) => t$1.coerce.boolean().parse(e$1),
54
- serialize: (e$1) => !!e$1,
55
- parseLiteral: (e$1) => {
56
- if (e$1.kind !== Kind.BOOLEAN) throw TypeError(`Invalid literal`);
57
- return e$1.value;
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;
58
70
  },
59
- jsonSchema: { type: `boolean` }
60
- }),
61
- ID: () => new t({
62
- name: `ID`,
63
- description: `Unvalidated id scalar`,
64
- zod: t$1.string(),
65
- parseValue: (e$1) => t$1.string().parse(e$1),
66
- serialize: (e$1) => String(e$1),
67
- parseLiteral: (e$1) => {
68
- if (e$1.kind !== Kind.STRING) throw TypeError(`Invalid literal`);
69
- return e$1.value;
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;
70
82
  },
71
- jsonSchema: { type: `string` }
83
+ jsonSchema: { type: "string" }
72
84
  }),
73
- JSON: () => new t({
74
- name: `JSON`,
75
- zod: t$1.any(),
76
- parseValue: (e$1) => e$1,
77
- serialize: (e$1) => e$1,
85
+ JSON: () => new FieldType({
86
+ name: "JSON",
87
+ zod: z$1.any(),
88
+ parseValue: (v) => v,
89
+ serialize: (v) => v,
78
90
  jsonSchema: {}
79
91
  }),
80
- JSONObject: () => new t({
81
- name: `JSONObject`,
82
- zod: t$1.record(t$1.string(), t$1.any()),
83
- parseValue: (e$1) => t$1.record(t$1.string(), t$1.any()).parse(e$1),
84
- serialize: (e$1) => e$1 ?? {},
85
- jsonSchema: { type: `object` }
86
- }),
87
- Date: () => new t({
88
- name: `Date`,
89
- zod: t$1.date(),
90
- parseValue: (e$1) => e$1 instanceof Date ? e$1 : new Date(String(e$1)),
91
- serialize: (e$1) => e$1 instanceof Date ? e$1.toISOString().split(`T`)[0] : String(e$1),
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),
92
104
  jsonSchema: {
93
- type: `string`,
94
- format: `date`
105
+ type: "string",
106
+ format: "date"
95
107
  }
96
108
  }),
97
- DateTime: () => new t({
98
- name: `DateTime`,
99
- zod: t$1.date(),
100
- parseValue: (e$1) => e$1 instanceof Date ? e$1 : new Date(String(e$1)),
101
- serialize: (e$1) => e$1 instanceof Date ? e$1.toISOString() : String(e$1),
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
+ },
102
116
  jsonSchema: {
103
- type: `string`,
104
- format: `date-time`
117
+ type: "string",
118
+ format: "date-time"
105
119
  }
106
120
  }),
107
- Time: () => new t({
108
- name: `Time`,
109
- zod: t$1.string().regex(/^\d{2}:\d{2}(:\d{2})?$/),
110
- parseValue: (e$1) => t$1.string().regex(/^\d{2}:\d{2}(:\d{2})?$/).parse(e$1),
111
- serialize: (e$1) => String(e$1),
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),
112
126
  jsonSchema: {
113
- type: `string`,
114
- pattern: `^\\d{2}:\\d{2}(:\\d{2})?$`
127
+ type: "string",
128
+ pattern: "^\\d{2}:\\d{2}(:\\d{2})?$"
115
129
  }
116
130
  }),
117
- EmailAddress: () => new t({
118
- name: `EmailAddress`,
119
- zod: t$1.string().email(),
120
- parseValue: (e$1) => t$1.string().email().parse(e$1),
121
- serialize: (e$1) => String(e$1),
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),
122
136
  jsonSchema: {
123
- type: `string`,
124
- format: `email`
137
+ type: "string",
138
+ format: "email"
125
139
  }
126
140
  }),
127
- URL: () => new t({
128
- name: `URL`,
129
- zod: t$1.string().url(),
130
- parseValue: (e$1) => t$1.string().url().parse(e$1),
131
- serialize: (e$1) => String(e$1),
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),
132
146
  jsonSchema: {
133
- type: `string`,
134
- format: `uri`
147
+ type: "string",
148
+ format: "uri"
135
149
  }
136
150
  }),
137
- PhoneNumber: () => new t({
138
- name: `PhoneNumber`,
139
- zod: t$1.string().regex(a),
140
- parseValue: (e$1) => t$1.string().regex(a).parse(e$1),
141
- serialize: (e$1) => String(e$1),
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),
142
156
  jsonSchema: {
143
- type: `string`,
144
- pattern: a.source
157
+ type: "string",
158
+ pattern: phoneRegex.source
145
159
  }
146
160
  }),
147
- NonEmptyString: () => new t({
148
- name: `NonEmptyString`,
149
- zod: t$1.string().min(1),
150
- parseValue: (e$1) => t$1.string().min(1).parse(e$1),
151
- serialize: (e$1) => String(e$1),
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),
152
166
  jsonSchema: {
153
- type: `string`,
167
+ type: "string",
154
168
  minLength: 1
155
169
  }
156
170
  }),
157
- Locale: () => new t({
158
- name: `Locale`,
159
- zod: t$1.string().regex(r),
160
- parseValue: (e$1) => t$1.string().regex(r).parse(e$1),
161
- serialize: (e$1) => String(e$1),
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),
162
176
  jsonSchema: {
163
- type: `string`,
164
- pattern: r.source
177
+ type: "string",
178
+ pattern: localeRegex.source
165
179
  }
166
180
  }),
167
- TimeZone: () => new t({
168
- name: `TimeZone`,
169
- zod: t$1.string().regex(i),
170
- parseValue: (e$1) => t$1.string().regex(i).parse(e$1),
171
- serialize: (e$1) => String(e$1),
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),
172
186
  jsonSchema: {
173
- type: `string`,
174
- pattern: i.source
187
+ type: "string",
188
+ pattern: timezoneRegex.source
175
189
  }
176
190
  }),
177
- Latitude: () => new t({
178
- name: `Latitude`,
179
- zod: t$1.number().min(-90).max(90),
180
- parseValue: (e$1) => t$1.coerce.number().min(-90).max(90).parse(e$1),
181
- serialize: (e$1) => Number(e$1),
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),
182
196
  jsonSchema: {
183
- type: `number`,
184
- minimum: -90,
185
- maximum: 90
197
+ type: "number",
198
+ minimum: latMin,
199
+ maximum: latMax
186
200
  }
187
201
  }),
188
- Longitude: () => new t({
189
- name: `Longitude`,
190
- zod: t$1.number().min(c).max(180),
191
- parseValue: (e$1) => t$1.coerce.number().min(c).max(180).parse(e$1),
192
- serialize: (e$1) => Number(e$1),
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),
193
207
  jsonSchema: {
194
- type: `number`,
195
- minimum: c,
196
- maximum: 180
208
+ type: "number",
209
+ minimum: lonMin,
210
+ maximum: lonMax
197
211
  }
198
212
  }),
199
- Currency: () => new t({
200
- name: `Currency`,
201
- zod: t$1.string().regex(o),
202
- parseValue: (e$1) => t$1.string().regex(o).parse(e$1),
203
- serialize: (e$1) => String(e$1),
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),
204
218
  jsonSchema: {
205
- type: `string`,
206
- pattern: o.source
219
+ type: "string",
220
+ pattern: currencyRegex.source
207
221
  }
208
222
  }),
209
- CountryCode: () => new t({
210
- name: `CountryCode`,
211
- zod: t$1.string().regex(s),
212
- parseValue: (e$1) => t$1.string().regex(s).parse(e$1),
213
- serialize: (e$1) => String(e$1),
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),
214
228
  jsonSchema: {
215
- type: `string`,
216
- pattern: s.source
229
+ type: "string",
230
+ pattern: countryRegex.source
217
231
  }
218
232
  })
219
233
  };
220
234
 
221
235
  //#endregion
222
- export { l };
236
+ export { ScalarTypeEnum };
@@ -1,23 +1,34 @@
1
1
  import "./EnumType.js";
2
2
  import "./FieldType.js";
3
- import * as e$1 from "zod";
3
+ import * as z$1 from "zod";
4
4
 
5
5
  //#region ../../libs/contracts/dist/schema/dist/SchemaModel.js
6
- var t = class {
7
- constructor(e$2) {
8
- this.config = e$2;
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;
9
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
+ */
10
18
  getZod() {
11
- let t$1 = Object.entries(this.config.fields).reduce((t$2, [n, r]) => {
12
- let i = r.type.getZod(), a = r.isArray ? e$1.array(i) : i;
13
- return t$2[n] = r.isOptional ? a.optional() : a, t$2;
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;
14
24
  }, {});
15
- return e$1.object(t$1);
25
+ return z$1.object(shape);
16
26
  }
27
+ /** Input object name for GraphQL builder adapters. */
17
28
  getPothosInput() {
18
29
  return this.config.name;
19
30
  }
20
31
  };
21
32
 
22
33
  //#endregion
23
- export { t };
34
+ export { SchemaModel };
@@ -1 +1 @@
1
- import e from "zod";
1
+ import z from "zod";
@@ -1,25 +1,34 @@
1
1
  //#region ../../libs/contracts/dist/spec.js
2
- const e = (e$1) => `ref` in e$1, t = (e$1) => ({
3
- ...e$1,
2
+ /**
3
+ * Helper to define a Command (write operation).
4
+ * Sets `kind: 'command'` and defaults `idempotent: false`.
5
+ */
6
+ const defineCommand = (spec) => ({
7
+ ...spec,
4
8
  meta: {
5
- ...e$1.meta,
6
- kind: `command`
9
+ ...spec.meta,
10
+ kind: "command"
7
11
  },
8
12
  policy: {
9
- ...e$1.policy,
10
- idempotent: e$1.policy?.policy?.idempotent ?? !1
13
+ ...spec.policy,
14
+ idempotent: spec.policy?.["policy"]?.idempotent ?? false
11
15
  }
12
- }), n = (e$1) => ({
13
- ...e$1,
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,
14
23
  meta: {
15
- ...e$1.meta,
16
- kind: `query`
24
+ ...spec.meta,
25
+ kind: "query"
17
26
  },
18
27
  policy: {
19
- ...e$1.policy,
20
- idempotent: !0
28
+ ...spec.policy,
29
+ idempotent: true
21
30
  }
22
31
  });
23
32
 
24
33
  //#endregion
25
- export { n, t };
34
+ export { defineCommand, defineQuery };
@@ -1,40 +1,56 @@
1
- import * as e$1 from "zod";
1
+ import * as z$1 from "zod";
2
2
  import { GraphQLEnumType } from "graphql";
3
3
 
4
4
  //#region ../../libs/schema/dist/EnumType.js
5
- var n = class {
5
+ /**
6
+ * Strongly-typed string enum wrapper with one source of truth for zod, GraphQL, and JSON Schema.
7
+ */
8
+ var EnumType = class {
6
9
  name;
7
10
  values;
8
11
  gqlEnum;
9
- constructor(e$2, n$1) {
10
- this.name = e$2, this.values = n$1, this.gqlEnum = new GraphQLEnumType({
12
+ constructor(name, values) {
13
+ this.name = name;
14
+ this.values = values;
15
+ this.gqlEnum = new GraphQLEnumType({
11
16
  name: this.name,
12
- values: Object.fromEntries(n$1.map((e$3) => [e$3, { value: e$3 }]))
17
+ values: Object.fromEntries(values.map((v) => [v, { value: v }]))
13
18
  });
14
19
  }
20
+ /** Enum type name (used by GraphQL and JSON Schema). */
15
21
  getName() {
16
22
  return this.name;
17
23
  }
24
+ /** Returns the literal tuple of allowed values. */
18
25
  getEnumValues() {
19
26
  return this.values;
20
27
  }
28
+ /** GraphQL enum instance suitable for Pothos or vanilla GraphQL schemas. */
21
29
  getPothos() {
22
30
  return this.gqlEnum;
23
31
  }
32
+ /** zod schema representing this enum. */
24
33
  getZod() {
25
- return e$1.enum(this.values);
34
+ return z$1.enum(this.values);
26
35
  }
36
+ /** Minimal JSON representation (alias of getJsonSchema). */
27
37
  getJson() {
28
38
  return {
29
- type: `string`,
39
+ type: "string",
30
40
  enum: this.values
31
41
  };
32
42
  }
43
+ /** JSON Schema for this enum. */
33
44
  getJsonSchema() {
34
45
  return this.getJson();
35
46
  }
36
47
  };
37
- const r = (e$2, t) => new n(e$2, t);
48
+ /**
49
+ * Helper to define an EnumType.
50
+ * @param name Display/type name used across GraphQL and JSON Schema
51
+ * @param values Literal tuple of allowed string values (at least one)
52
+ */
53
+ const defineEnum = (name, values) => new EnumType(name, values);
38
54
 
39
55
  //#endregion
40
- export { n, r };
56
+ export { EnumType, defineEnum };
@@ -2,38 +2,48 @@ import "zod";
2
2
  import { GraphQLScalarType } from "graphql";
3
3
 
4
4
  //#region ../../libs/schema/dist/FieldType.js
5
- var t = class extends GraphQLScalarType {
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 {
6
11
  zodSchema;
7
12
  jsonSchemaDef;
8
- constructor(e$1) {
9
- super(e$1), this.zodSchema = e$1.zod, this.jsonSchemaDef = e$1.jsonSchema;
13
+ constructor(config) {
14
+ super(config);
15
+ this.zodSchema = config.zod;
16
+ this.jsonSchemaDef = config.jsonSchema;
10
17
  }
18
+ /** Return the attached zod schema for validation. */
11
19
  getZod() {
12
20
  return this.zodSchema;
13
21
  }
22
+ /** GraphQL scalar instance usable by Pothos or vanilla GraphQL. */
14
23
  getPothos() {
15
24
  return this;
16
25
  }
26
+ /** Return the JSON Schema (evaluates factory if provided). */
17
27
  getJson() {
18
- return typeof this.jsonSchemaDef == `function` ? this.jsonSchemaDef() : this.jsonSchemaDef;
28
+ return typeof this.jsonSchemaDef === "function" ? this.jsonSchemaDef() : this.jsonSchemaDef;
19
29
  }
20
30
  getJsonSchemaDef() {
21
31
  return this.jsonSchemaDef;
22
32
  }
23
33
  getJsonSchema() {
24
- let e$1 = (t$1) => {
25
- let n = typeof t$1 == `function` ? t$1() : t$1;
26
- if (Array.isArray(n)) return n.map((t$2) => e$1(t$2));
27
- if (n && typeof n == `object`) {
28
- let t$2 = {};
29
- for (let [r, i] of Object.entries(n)) t$2[r] = e$1(i);
30
- return t$2;
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;
31
41
  }
32
- return n;
42
+ return value;
33
43
  };
34
- return e$1(this.getJson());
44
+ return deepResolve(this.getJson());
35
45
  }
36
46
  };
37
47
 
38
48
  //#endregion
39
- export { t };
49
+ export { FieldType };