@lssm/module.audit-trail 0.0.0-canary-20251217083314 → 0.0.0-canary-20251220002821

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 (156) hide show
  1. package/LICENSE +21 -0
  2. package/dist/audit-trail.feature.d.ts +2 -1
  3. package/dist/audit-trail.feature.d.ts.map +1 -0
  4. package/dist/audit-trail.feature.js +2 -1
  5. package/dist/audit-trail.feature.js.map +1 -0
  6. package/dist/contracts/index.d.ts +2 -1
  7. package/dist/contracts/index.d.ts.map +1 -0
  8. package/dist/contracts/index.js +57 -58
  9. package/dist/contracts/index.js.map +1 -0
  10. package/dist/entities/index.d.ts +2 -1
  11. package/dist/entities/index.d.ts.map +1 -0
  12. package/dist/entities/index.js +44 -44
  13. package/dist/entities/index.js.map +1 -0
  14. package/dist/libs/contracts/dist/capabilities/openbanking.js +2 -1
  15. package/dist/libs/contracts/dist/capabilities/openbanking.js.map +1 -0
  16. package/dist/libs/contracts/dist/contract-registry/schemas.js +2 -1
  17. package/dist/libs/contracts/dist/contract-registry/schemas.js.map +1 -0
  18. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +2 -1
  19. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -0
  20. package/dist/libs/contracts/dist/docs/index.js +2 -6
  21. package/dist/libs/contracts/dist/docs/meta.docs.js +30 -0
  22. package/dist/libs/contracts/dist/docs/meta.docs.js.map +1 -0
  23. package/dist/libs/contracts/dist/docs/presentations.js +2 -1
  24. package/dist/libs/contracts/dist/docs/presentations.js.map +1 -0
  25. package/dist/libs/contracts/dist/docs/registry.js +2 -1
  26. package/dist/libs/contracts/dist/docs/registry.js.map +1 -0
  27. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +2 -1
  28. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -0
  29. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +2 -1
  30. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -0
  31. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +2 -1
  32. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -0
  33. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -1
  34. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -0
  35. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +2 -1
  36. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -0
  37. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +2 -1
  38. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -0
  39. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +2 -1
  40. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -0
  41. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +2 -1
  42. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -0
  43. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +2 -1
  44. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -0
  45. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +2 -1
  46. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -0
  47. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +2 -1
  48. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -0
  49. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +2 -1
  50. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -0
  51. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +2 -1
  52. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -0
  53. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +2 -1
  54. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -0
  55. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +2 -1
  56. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -0
  57. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +2 -1
  58. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -0
  59. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +2 -1
  60. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -0
  61. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +2 -1
  62. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -0
  63. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +2 -1
  64. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -0
  65. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +2 -1
  66. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -0
  67. package/dist/libs/contracts/dist/docs/tech-contracts.docs.js +97 -0
  68. package/dist/libs/contracts/dist/docs/tech-contracts.docs.js.map +1 -0
  69. package/dist/libs/contracts/dist/index.js +3 -2
  70. package/dist/libs/contracts/dist/integrations/contracts.js +65 -66
  71. package/dist/libs/contracts/dist/integrations/contracts.js.map +1 -0
  72. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +31 -32
  73. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -0
  74. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +18 -19
  75. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -0
  76. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +32 -33
  77. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -0
  78. package/dist/libs/contracts/dist/integrations/openbanking/models.js +60 -61
  79. package/dist/libs/contracts/dist/integrations/openbanking/models.js.map +1 -0
  80. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +2 -1
  81. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js.map +1 -0
  82. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +2 -1
  83. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js.map +1 -0
  84. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +2 -1
  85. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js.map +1 -0
  86. package/dist/libs/contracts/dist/integrations/providers/gmail.js +2 -1
  87. package/dist/libs/contracts/dist/integrations/providers/gmail.js.map +1 -0
  88. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +2 -1
  89. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js.map +1 -0
  90. package/dist/libs/contracts/dist/integrations/providers/mistral.js +2 -1
  91. package/dist/libs/contracts/dist/integrations/providers/mistral.js.map +1 -0
  92. package/dist/libs/contracts/dist/integrations/providers/postmark.js +2 -1
  93. package/dist/libs/contracts/dist/integrations/providers/postmark.js.map +1 -0
  94. package/dist/libs/contracts/dist/integrations/providers/powens.js +2 -1
  95. package/dist/libs/contracts/dist/integrations/providers/powens.js.map +1 -0
  96. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +2 -1
  97. package/dist/libs/contracts/dist/integrations/providers/qdrant.js.map +1 -0
  98. package/dist/libs/contracts/dist/integrations/providers/stripe.js +2 -1
  99. package/dist/libs/contracts/dist/integrations/providers/stripe.js.map +1 -0
  100. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +2 -1
  101. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js.map +1 -0
  102. package/dist/libs/contracts/dist/knowledge/contracts.js +44 -45
  103. package/dist/libs/contracts/dist/knowledge/contracts.js.map +1 -0
  104. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +2 -1
  105. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js.map +1 -0
  106. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +2 -1
  107. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js.map +1 -0
  108. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +2 -1
  109. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js.map +1 -0
  110. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +2 -1
  111. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js.map +1 -0
  112. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +2 -1
  113. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js.map +1 -0
  114. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +2 -1
  115. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js.map +1 -0
  116. package/dist/libs/contracts/dist/llm/exporters.js +2 -1
  117. package/dist/libs/contracts/dist/llm/exporters.js.map +1 -0
  118. package/dist/libs/contracts/dist/onboarding-base.js +22 -23
  119. package/dist/libs/contracts/dist/onboarding-base.js.map +1 -0
  120. package/dist/libs/contracts/dist/ownership.js +4 -2
  121. package/dist/libs/contracts/dist/ownership.js.map +1 -0
  122. package/dist/libs/contracts/dist/presentations.v2.js +2 -1
  123. package/dist/libs/contracts/dist/presentations.v2.js.map +1 -0
  124. package/dist/libs/contracts/dist/regenerator/service.js +2 -1
  125. package/dist/libs/contracts/dist/regenerator/service.js.map +1 -0
  126. package/dist/libs/contracts/dist/schema/dist/index.js +3874 -6
  127. package/dist/libs/contracts/dist/schema/dist/index.js.map +1 -0
  128. package/dist/libs/contracts/dist/spec.js +2 -1
  129. package/dist/libs/contracts/dist/spec.js.map +1 -0
  130. package/dist/libs/schema/dist/index.js +4896 -6
  131. package/dist/libs/schema/dist/index.js.map +1 -0
  132. package/dist/storage/index.d.ts +2 -1
  133. package/dist/storage/index.d.ts.map +1 -0
  134. package/dist/storage/index.js +10 -3
  135. package/dist/storage/index.js.map +1 -0
  136. package/package.json +14 -7
  137. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  138. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  139. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  140. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  141. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  142. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  143. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  144. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  145. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  146. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -39
  147. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  148. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  149. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  150. package/dist/libs/schema/dist/EnumType.js +0 -56
  151. package/dist/libs/schema/dist/FieldType.js +0 -49
  152. package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -236
  153. package/dist/libs/schema/dist/SchemaModel.js +0 -3
  154. package/dist/libs/schema/dist/entity/defineEntity.js +0 -230
  155. package/dist/libs/schema/dist/entity/index.js +0 -2
  156. package/dist/libs/schema/dist/entity/types.js +0 -1
@@ -1,49 +0,0 @@
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 };
@@ -1,236 +0,0 @@
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 };
@@ -1,3 +0,0 @@
1
- import "./EnumType.js";
2
- import "./FieldType.js";
3
- import "zod";
@@ -1,230 +0,0 @@
1
- import * as z$1 from "zod";
2
-
3
- //#region ../../libs/schema/dist/entity/defineEntity.js
4
- /**
5
- * Helper to define a database entity with full type safety.
6
- *
7
- * @example
8
- * ```typescript
9
- * const UserEntity = defineEntity({
10
- * name: 'User',
11
- * schema: 'lssm_sigil',
12
- * description: 'A user of the platform.',
13
- * fields: {
14
- * id: field.id(),
15
- * email: field.string({ isUnique: true, zod: z.string().email() }),
16
- * name: field.string({ isOptional: true }),
17
- * createdAt: field.createdAt(),
18
- * updatedAt: field.updatedAt(),
19
- * memberships: field.hasMany('Member'),
20
- * },
21
- * indexes: [{ fields: ['email'], unique: true }],
22
- * });
23
- * ```
24
- */
25
- function defineEntity(spec) {
26
- return spec;
27
- }
28
- /**
29
- * Field builder helpers for common field patterns.
30
- */
31
- const field = {
32
- string(opts) {
33
- return {
34
- kind: "scalar",
35
- type: "String",
36
- ...opts
37
- };
38
- },
39
- int(opts) {
40
- return {
41
- kind: "scalar",
42
- type: "Int",
43
- ...opts
44
- };
45
- },
46
- float(opts) {
47
- return {
48
- kind: "scalar",
49
- type: "Float",
50
- ...opts
51
- };
52
- },
53
- boolean(opts) {
54
- return {
55
- kind: "scalar",
56
- type: "Boolean",
57
- ...opts
58
- };
59
- },
60
- dateTime(opts) {
61
- return {
62
- kind: "scalar",
63
- type: "DateTime",
64
- ...opts
65
- };
66
- },
67
- json(opts) {
68
- return {
69
- kind: "scalar",
70
- type: "Json",
71
- ...opts
72
- };
73
- },
74
- bigInt(opts) {
75
- return {
76
- kind: "scalar",
77
- type: "BigInt",
78
- ...opts
79
- };
80
- },
81
- decimal(opts) {
82
- return {
83
- kind: "scalar",
84
- type: "Decimal",
85
- ...opts
86
- };
87
- },
88
- bytes(opts) {
89
- return {
90
- kind: "scalar",
91
- type: "Bytes",
92
- ...opts
93
- };
94
- },
95
- id(opts) {
96
- return {
97
- kind: "scalar",
98
- type: "String",
99
- isId: true,
100
- default: "cuid()",
101
- ...opts
102
- };
103
- },
104
- uuid(opts) {
105
- return {
106
- kind: "scalar",
107
- type: "String",
108
- isId: true,
109
- default: "uuid()",
110
- ...opts
111
- };
112
- },
113
- autoIncrement(opts) {
114
- return {
115
- kind: "scalar",
116
- type: "Int",
117
- isId: true,
118
- default: "autoincrement()",
119
- ...opts
120
- };
121
- },
122
- createdAt(opts) {
123
- return {
124
- kind: "scalar",
125
- type: "DateTime",
126
- default: "now()",
127
- ...opts
128
- };
129
- },
130
- updatedAt(opts) {
131
- return {
132
- kind: "scalar",
133
- type: "DateTime",
134
- updatedAt: true,
135
- ...opts
136
- };
137
- },
138
- email(opts) {
139
- return {
140
- kind: "scalar",
141
- type: "String",
142
- zod: z$1.email(),
143
- ...opts
144
- };
145
- },
146
- url(opts) {
147
- return {
148
- kind: "scalar",
149
- type: "String",
150
- zod: z$1.url(),
151
- ...opts
152
- };
153
- },
154
- enum(enumName, opts) {
155
- return {
156
- kind: "enum",
157
- enumName,
158
- ...opts
159
- };
160
- },
161
- inlineEnum(enumName, values, opts) {
162
- return {
163
- kind: "enum",
164
- enumName,
165
- values,
166
- ...opts
167
- };
168
- },
169
- hasOne(target, opts) {
170
- return {
171
- kind: "relation",
172
- type: "hasOne",
173
- target,
174
- ...opts
175
- };
176
- },
177
- hasMany(target, opts) {
178
- return {
179
- kind: "relation",
180
- type: "hasMany",
181
- target,
182
- ...opts
183
- };
184
- },
185
- belongsTo(target, fields, references, opts) {
186
- return {
187
- kind: "relation",
188
- type: "belongsTo",
189
- target,
190
- fields,
191
- references,
192
- ...opts
193
- };
194
- },
195
- foreignKey(opts) {
196
- return {
197
- kind: "scalar",
198
- type: "String",
199
- ...opts
200
- };
201
- }
202
- };
203
- /**
204
- * Index builder helpers.
205
- */
206
- const index = {
207
- on(fields, opts) {
208
- return {
209
- fields,
210
- ...opts
211
- };
212
- },
213
- unique(fields, opts) {
214
- return {
215
- fields,
216
- unique: true,
217
- ...opts
218
- };
219
- },
220
- compound(fields, sort, opts) {
221
- return {
222
- fields,
223
- sort,
224
- ...opts
225
- };
226
- }
227
- };
228
-
229
- //#endregion
230
- export { defineEntity, field, index };
@@ -1,2 +0,0 @@
1
- import { defineEntity, field, index } from "./defineEntity.js";
2
- import "./types.js";
@@ -1 +0,0 @@
1
- import "zod";