@objectstack/spec 0.1.2 → 0.3.0

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 (152) hide show
  1. package/README.md +127 -5
  2. package/dist/ai/index.d.ts +14 -0
  3. package/dist/ai/index.d.ts.map +1 -0
  4. package/dist/ai/index.js +29 -0
  5. package/dist/ai/model-registry.zod.d.ts +1389 -0
  6. package/dist/ai/model-registry.zod.d.ts.map +1 -0
  7. package/dist/ai/model-registry.zod.js +164 -0
  8. package/dist/ai/nlq.zod.d.ts +1126 -0
  9. package/dist/ai/nlq.zod.d.ts.map +1 -0
  10. package/dist/ai/nlq.zod.js +246 -0
  11. package/dist/ai/rag-pipeline.zod.d.ts +1034 -0
  12. package/dist/ai/rag-pipeline.zod.d.ts.map +1 -0
  13. package/dist/ai/rag-pipeline.zod.js +244 -0
  14. package/dist/api/index.d.ts +9 -0
  15. package/dist/api/index.d.ts.map +1 -0
  16. package/dist/api/index.js +24 -0
  17. package/dist/data/filter.zod.d.ts +295 -0
  18. package/dist/data/filter.zod.d.ts.map +1 -0
  19. package/dist/data/filter.zod.js +226 -0
  20. package/dist/data/index.d.ts +21 -0
  21. package/dist/data/index.d.ts.map +1 -0
  22. package/dist/data/index.js +36 -0
  23. package/dist/data/query.zod.d.ts +386 -3
  24. package/dist/data/query.zod.d.ts.map +1 -1
  25. package/dist/data/query.zod.js +386 -3
  26. package/dist/data/validation.zod.d.ts +349 -0
  27. package/dist/data/validation.zod.d.ts.map +1 -1
  28. package/dist/data/validation.zod.js +395 -0
  29. package/dist/index.d.ts +36 -39
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +64 -47
  32. package/dist/system/auth-protocol.d.ts +175 -0
  33. package/dist/system/auth-protocol.d.ts.map +1 -0
  34. package/dist/system/auth-protocol.js +60 -0
  35. package/dist/system/auth.zod.d.ts +3319 -0
  36. package/dist/system/auth.zod.d.ts.map +1 -0
  37. package/dist/system/auth.zod.js +499 -0
  38. package/dist/system/datasource.zod.d.ts +118 -38
  39. package/dist/system/datasource.zod.d.ts.map +1 -1
  40. package/dist/system/datasource.zod.js +25 -6
  41. package/dist/system/driver.zod.d.ts +106 -0
  42. package/dist/system/driver.zod.d.ts.map +1 -1
  43. package/dist/system/driver.zod.js +47 -0
  44. package/dist/system/identity.zod.d.ts +234 -180
  45. package/dist/system/identity.zod.d.ts.map +1 -1
  46. package/dist/system/identity.zod.js +168 -51
  47. package/dist/system/index.d.ts +28 -0
  48. package/dist/system/index.d.ts.map +1 -0
  49. package/dist/system/index.js +43 -0
  50. package/dist/system/manifest.zod.d.ts +10 -10
  51. package/dist/system/organization.zod.d.ts +179 -0
  52. package/dist/system/organization.zod.d.ts.map +1 -0
  53. package/dist/system/organization.zod.js +129 -0
  54. package/dist/system/policy.zod.d.ts +10 -10
  55. package/dist/ui/action.zod.d.ts +2 -2
  56. package/dist/ui/dashboard.zod.d.ts +10 -10
  57. package/dist/ui/dashboard.zod.d.ts.map +1 -1
  58. package/dist/ui/dashboard.zod.js +3 -2
  59. package/dist/ui/index.d.ts +17 -0
  60. package/dist/ui/index.d.ts.map +1 -0
  61. package/dist/ui/index.js +32 -0
  62. package/dist/ui/report.zod.d.ts +4 -32
  63. package/dist/ui/report.zod.d.ts.map +1 -1
  64. package/dist/ui/report.zod.js +3 -8
  65. package/dist/ui/theme.zod.d.ts +6 -6
  66. package/json-schema/Account.json +87 -0
  67. package/json-schema/AccountLinkingConfig.json +27 -0
  68. package/json-schema/AuthConfig.json +841 -0
  69. package/json-schema/AuthPluginConfig.json +28 -0
  70. package/json-schema/AuthStrategy.json +17 -0
  71. package/json-schema/AuthenticationConfig.json +601 -0
  72. package/json-schema/AuthenticationProvider.json +617 -0
  73. package/json-schema/CSRFConfig.json +31 -0
  74. package/json-schema/ChunkingStrategy.json +133 -0
  75. package/json-schema/ComparisonOperator.json +56 -0
  76. package/json-schema/Dashboard.json +20 -0
  77. package/json-schema/DashboardWidget.json +20 -0
  78. package/json-schema/DatabaseAdapter.json +38 -0
  79. package/json-schema/DatabaseMapping.json +48 -0
  80. package/json-schema/Datasource.json +25 -5
  81. package/json-schema/DatasourceCapabilities.json +25 -5
  82. package/json-schema/DocumentChunk.json +97 -0
  83. package/json-schema/DocumentLoaderConfig.json +69 -0
  84. package/json-schema/DocumentMetadata.json +61 -0
  85. package/json-schema/DriverCapabilities.json +30 -0
  86. package/json-schema/DriverDefinition.json +25 -5
  87. package/json-schema/DriverInterface.json +30 -0
  88. package/json-schema/EmailPasswordConfig.json +43 -0
  89. package/json-schema/EmbeddingModel.json +57 -0
  90. package/json-schema/EnterpriseAuthConfig.json +172 -0
  91. package/json-schema/Entity.json +55 -0
  92. package/json-schema/EqualityOperator.json +14 -0
  93. package/json-schema/FieldOperators.json +108 -0
  94. package/json-schema/FieldSynonymConfig.json +39 -0
  95. package/json-schema/FilterCondition.json +28 -0
  96. package/json-schema/Invitation.json +69 -0
  97. package/json-schema/InvitationStatus.json +15 -0
  98. package/json-schema/LDAPConfig.json +22 -5
  99. package/json-schema/MagicLinkConfig.json +21 -0
  100. package/json-schema/Member.json +46 -0
  101. package/json-schema/ModelCapability.json +47 -0
  102. package/json-schema/ModelConfig.json +181 -0
  103. package/json-schema/ModelLimits.json +45 -0
  104. package/json-schema/ModelPricing.json +28 -0
  105. package/json-schema/ModelProvider.json +19 -0
  106. package/json-schema/ModelRegistry.json +427 -0
  107. package/json-schema/ModelRegistryEntry.json +239 -0
  108. package/json-schema/ModelSelectionCriteria.json +50 -0
  109. package/json-schema/NLQAnalytics.json +106 -0
  110. package/json-schema/NLQFieldMapping.json +40 -0
  111. package/json-schema/NLQModelConfig.json +78 -0
  112. package/json-schema/NLQParseResult.json +252 -0
  113. package/json-schema/NLQRequest.json +110 -0
  114. package/json-schema/NLQResponse.json +288 -0
  115. package/json-schema/NLQTrainingExample.json +120 -0
  116. package/json-schema/NormalizedFilter.json +348 -0
  117. package/json-schema/OAuthProvider.json +66 -0
  118. package/json-schema/OIDCConfig.json +18 -3
  119. package/json-schema/Organization.json +52 -0
  120. package/json-schema/PasskeyConfig.json +54 -0
  121. package/json-schema/PromptTemplate.json +163 -0
  122. package/json-schema/PromptVariable.json +56 -0
  123. package/json-schema/QueryContext.json +72 -0
  124. package/json-schema/QueryFilter.json +34 -0
  125. package/json-schema/QueryIntent.json +21 -0
  126. package/json-schema/QueryTemplate.json +81 -0
  127. package/json-schema/RAGPipelineConfig.json +552 -0
  128. package/json-schema/RAGPipelineStatus.json +66 -0
  129. package/json-schema/RAGQueryRequest.json +64 -0
  130. package/json-schema/RAGQueryResponse.json +108 -0
  131. package/json-schema/RangeOperator.json +41 -0
  132. package/json-schema/RateLimitConfig.json +36 -0
  133. package/json-schema/Report.json +20 -26
  134. package/json-schema/RerankingConfig.json +34 -0
  135. package/json-schema/RetrievalStrategy.json +121 -0
  136. package/json-schema/SAMLConfig.json +17 -3
  137. package/json-schema/Session.json +63 -0
  138. package/json-schema/SessionConfig.json +56 -0
  139. package/json-schema/SetOperator.json +18 -0
  140. package/json-schema/SpecialOperator.json +18 -0
  141. package/json-schema/StandardAuthProvider.json +857 -0
  142. package/json-schema/StringOperator.json +21 -0
  143. package/json-schema/Timeframe.json +68 -0
  144. package/json-schema/TwoFactorConfig.json +40 -0
  145. package/json-schema/User.json +51 -0
  146. package/json-schema/UserFieldMapping.json +47 -0
  147. package/json-schema/VectorStoreConfig.json +82 -0
  148. package/json-schema/VectorStoreProvider.json +21 -0
  149. package/json-schema/VerificationToken.json +36 -0
  150. package/package.json +27 -1
  151. package/json-schema/AuthProtocol.json +0 -17
  152. package/json-schema/AuthProvider.json +0 -171
@@ -0,0 +1,28 @@
1
+ /**
2
+ * System Protocol Exports
3
+ *
4
+ * Runtime Configuration & Security
5
+ * - Manifest (Config), Datasource
6
+ * - Role (Hierarchy), Identity (Auth)
7
+ * - Webhook (Integration), Policy (Compliance)
8
+ * - Plugin Architecture
9
+ */
10
+ export * from './manifest.zod';
11
+ export * from './datasource.zod';
12
+ export * from './api.zod';
13
+ export * from './identity.zod';
14
+ export * from './auth.zod';
15
+ export * from './auth-protocol';
16
+ export * from './organization.zod';
17
+ export * from './policy.zod';
18
+ export * from './role.zod';
19
+ export * from './territory.zod';
20
+ export * from './license.zod';
21
+ export * from './webhook.zod';
22
+ export * from './translation.zod';
23
+ export * from './driver.zod';
24
+ export * from './discovery.zod';
25
+ export * from './plugin.zod';
26
+ export * from './constants';
27
+ export * from './types';
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /**
3
+ * System Protocol Exports
4
+ *
5
+ * Runtime Configuration & Security
6
+ * - Manifest (Config), Datasource
7
+ * - Role (Hierarchy), Identity (Auth)
8
+ * - Webhook (Integration), Policy (Compliance)
9
+ * - Plugin Architecture
10
+ */
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ __exportStar(require("./manifest.zod"), exports);
27
+ __exportStar(require("./datasource.zod"), exports);
28
+ __exportStar(require("./api.zod"), exports);
29
+ __exportStar(require("./identity.zod"), exports);
30
+ __exportStar(require("./auth.zod"), exports);
31
+ __exportStar(require("./auth-protocol"), exports);
32
+ __exportStar(require("./organization.zod"), exports);
33
+ __exportStar(require("./policy.zod"), exports);
34
+ __exportStar(require("./role.zod"), exports);
35
+ __exportStar(require("./territory.zod"), exports);
36
+ __exportStar(require("./license.zod"), exports);
37
+ __exportStar(require("./webhook.zod"), exports);
38
+ __exportStar(require("./translation.zod"), exports);
39
+ __exportStar(require("./driver.zod"), exports);
40
+ __exportStar(require("./discovery.zod"), exports);
41
+ __exportStar(require("./plugin.zod"), exports);
42
+ __exportStar(require("./constants"), exports);
43
+ __exportStar(require("./types"), exports);
@@ -283,11 +283,6 @@ export declare const ManifestSchema: z.ZodObject<{
283
283
  version: string;
284
284
  description?: string | undefined;
285
285
  objects?: string[] | undefined;
286
- data?: {
287
- object: string;
288
- mode: "upsert" | "insert" | "ignore";
289
- records: Record<string, any>[];
290
- }[] | undefined;
291
286
  permissions?: string[] | undefined;
292
287
  datasources?: string[] | undefined;
293
288
  dependencies?: Record<string, string> | undefined;
@@ -331,6 +326,11 @@ export declare const ManifestSchema: z.ZodObject<{
331
326
  locale: string;
332
327
  }[] | undefined;
333
328
  } | undefined;
329
+ data?: {
330
+ object: string;
331
+ mode: "upsert" | "insert" | "ignore";
332
+ records: Record<string, any>[];
333
+ }[] | undefined;
334
334
  extensions?: Record<string, any> | undefined;
335
335
  }, {
336
336
  type: "app" | "plugin" | "driver" | "module";
@@ -339,11 +339,6 @@ export declare const ManifestSchema: z.ZodObject<{
339
339
  version: string;
340
340
  description?: string | undefined;
341
341
  objects?: string[] | undefined;
342
- data?: {
343
- object: string;
344
- records: Record<string, any>[];
345
- mode?: "upsert" | "insert" | "ignore" | undefined;
346
- }[] | undefined;
347
342
  permissions?: string[] | undefined;
348
343
  datasources?: string[] | undefined;
349
344
  dependencies?: Record<string, string> | undefined;
@@ -387,6 +382,11 @@ export declare const ManifestSchema: z.ZodObject<{
387
382
  locale: string;
388
383
  }[] | undefined;
389
384
  } | undefined;
385
+ data?: {
386
+ object: string;
387
+ records: Record<string, any>[];
388
+ mode?: "upsert" | "insert" | "ignore" | undefined;
389
+ }[] | undefined;
390
390
  extensions?: Record<string, any> | undefined;
391
391
  }>;
392
392
  /**
@@ -0,0 +1,179 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Organization Schema (Multi-Tenant Architecture)
4
+ *
5
+ * Defines the standard organization/workspace model for ObjectStack.
6
+ * Supports B2B SaaS scenarios where users belong to multiple teams/workspaces.
7
+ *
8
+ * This aligns with better-auth's organization plugin capabilities.
9
+ */
10
+ /**
11
+ * Organization Schema
12
+ * Represents a team, workspace, or tenant in a multi-tenant application
13
+ */
14
+ export declare const OrganizationSchema: z.ZodObject<{
15
+ /**
16
+ * Unique organization identifier
17
+ */
18
+ id: z.ZodString;
19
+ /**
20
+ * Organization name (display name)
21
+ */
22
+ name: z.ZodString;
23
+ /**
24
+ * Organization slug (URL-friendly identifier)
25
+ * Must be unique across all organizations
26
+ */
27
+ slug: z.ZodString;
28
+ /**
29
+ * Organization logo URL
30
+ */
31
+ logo: z.ZodOptional<z.ZodString>;
32
+ /**
33
+ * Custom metadata for the organization
34
+ * Can store additional configuration, settings, or custom fields
35
+ */
36
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
37
+ /**
38
+ * Organization creation timestamp
39
+ */
40
+ createdAt: z.ZodDate;
41
+ /**
42
+ * Last update timestamp
43
+ */
44
+ updatedAt: z.ZodDate;
45
+ }, "strip", z.ZodTypeAny, {
46
+ name: string;
47
+ id: string;
48
+ createdAt: Date;
49
+ updatedAt: Date;
50
+ slug: string;
51
+ logo?: string | undefined;
52
+ metadata?: Record<string, any> | undefined;
53
+ }, {
54
+ name: string;
55
+ id: string;
56
+ createdAt: Date;
57
+ updatedAt: Date;
58
+ slug: string;
59
+ logo?: string | undefined;
60
+ metadata?: Record<string, any> | undefined;
61
+ }>;
62
+ export type Organization = z.infer<typeof OrganizationSchema>;
63
+ /**
64
+ * Organization Member Schema
65
+ * Links users to organizations with specific roles
66
+ */
67
+ export declare const MemberSchema: z.ZodObject<{
68
+ /**
69
+ * Unique member identifier
70
+ */
71
+ id: z.ZodString;
72
+ /**
73
+ * Organization ID this membership belongs to
74
+ */
75
+ organizationId: z.ZodString;
76
+ /**
77
+ * User ID of the member
78
+ */
79
+ userId: z.ZodString;
80
+ /**
81
+ * Member's role within the organization
82
+ * Common roles: 'owner', 'admin', 'member', 'guest'
83
+ * Can be customized per application
84
+ */
85
+ role: z.ZodString;
86
+ /**
87
+ * Member creation timestamp
88
+ */
89
+ createdAt: z.ZodDate;
90
+ /**
91
+ * Last update timestamp
92
+ */
93
+ updatedAt: z.ZodDate;
94
+ }, "strip", z.ZodTypeAny, {
95
+ id: string;
96
+ userId: string;
97
+ createdAt: Date;
98
+ updatedAt: Date;
99
+ organizationId: string;
100
+ role: string;
101
+ }, {
102
+ id: string;
103
+ userId: string;
104
+ createdAt: Date;
105
+ updatedAt: Date;
106
+ organizationId: string;
107
+ role: string;
108
+ }>;
109
+ export type Member = z.infer<typeof MemberSchema>;
110
+ /**
111
+ * Invitation Status Enum
112
+ */
113
+ export declare const InvitationStatus: z.ZodEnum<["pending", "accepted", "rejected", "expired"]>;
114
+ export type InvitationStatus = z.infer<typeof InvitationStatus>;
115
+ /**
116
+ * Organization Invitation Schema
117
+ * Represents an invitation to join an organization
118
+ */
119
+ export declare const InvitationSchema: z.ZodObject<{
120
+ /**
121
+ * Unique invitation identifier
122
+ */
123
+ id: z.ZodString;
124
+ /**
125
+ * Organization ID the invitation is for
126
+ */
127
+ organizationId: z.ZodString;
128
+ /**
129
+ * Email address of the invitee
130
+ */
131
+ email: z.ZodString;
132
+ /**
133
+ * Role the invitee will receive upon accepting
134
+ * Common roles: 'admin', 'member', 'guest'
135
+ */
136
+ role: z.ZodString;
137
+ /**
138
+ * Invitation status
139
+ */
140
+ status: z.ZodDefault<z.ZodEnum<["pending", "accepted", "rejected", "expired"]>>;
141
+ /**
142
+ * Invitation expiration timestamp
143
+ */
144
+ expiresAt: z.ZodDate;
145
+ /**
146
+ * User ID of the person who sent the invitation
147
+ */
148
+ inviterId: z.ZodString;
149
+ /**
150
+ * Invitation creation timestamp
151
+ */
152
+ createdAt: z.ZodDate;
153
+ /**
154
+ * Last update timestamp
155
+ */
156
+ updatedAt: z.ZodDate;
157
+ }, "strip", z.ZodTypeAny, {
158
+ email: string;
159
+ status: "pending" | "accepted" | "rejected" | "expired";
160
+ id: string;
161
+ createdAt: Date;
162
+ updatedAt: Date;
163
+ expiresAt: Date;
164
+ organizationId: string;
165
+ role: string;
166
+ inviterId: string;
167
+ }, {
168
+ email: string;
169
+ id: string;
170
+ createdAt: Date;
171
+ updatedAt: Date;
172
+ expiresAt: Date;
173
+ organizationId: string;
174
+ role: string;
175
+ inviterId: string;
176
+ status?: "pending" | "accepted" | "rejected" | "expired" | undefined;
177
+ }>;
178
+ export type Invitation = z.infer<typeof InvitationSchema>;
179
+ //# sourceMappingURL=organization.zod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.zod.d.ts","sourceRoot":"","sources":["../../src/system/organization.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB;IAC7B;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAKH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,2DAAyD,CAAC;AAEvF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvitationSchema = exports.InvitationStatus = exports.MemberSchema = exports.OrganizationSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Organization Schema (Multi-Tenant Architecture)
7
+ *
8
+ * Defines the standard organization/workspace model for ObjectStack.
9
+ * Supports B2B SaaS scenarios where users belong to multiple teams/workspaces.
10
+ *
11
+ * This aligns with better-auth's organization plugin capabilities.
12
+ */
13
+ /**
14
+ * Organization Schema
15
+ * Represents a team, workspace, or tenant in a multi-tenant application
16
+ */
17
+ exports.OrganizationSchema = zod_1.z.object({
18
+ /**
19
+ * Unique organization identifier
20
+ */
21
+ id: zod_1.z.string().describe('Unique organization identifier'),
22
+ /**
23
+ * Organization name (display name)
24
+ */
25
+ name: zod_1.z.string().describe('Organization display name'),
26
+ /**
27
+ * Organization slug (URL-friendly identifier)
28
+ * Must be unique across all organizations
29
+ */
30
+ slug: zod_1.z.string()
31
+ .regex(/^[a-z0-9_-]+$/)
32
+ .describe('Unique URL-friendly slug (lowercase alphanumeric, hyphens, underscores)'),
33
+ /**
34
+ * Organization logo URL
35
+ */
36
+ logo: zod_1.z.string().url().optional().describe('Organization logo URL'),
37
+ /**
38
+ * Custom metadata for the organization
39
+ * Can store additional configuration, settings, or custom fields
40
+ */
41
+ metadata: zod_1.z.record(zod_1.z.any()).optional().describe('Custom metadata'),
42
+ /**
43
+ * Organization creation timestamp
44
+ */
45
+ createdAt: zod_1.z.date().describe('Organization creation timestamp'),
46
+ /**
47
+ * Last update timestamp
48
+ */
49
+ updatedAt: zod_1.z.date().describe('Last update timestamp'),
50
+ });
51
+ /**
52
+ * Organization Member Schema
53
+ * Links users to organizations with specific roles
54
+ */
55
+ exports.MemberSchema = zod_1.z.object({
56
+ /**
57
+ * Unique member identifier
58
+ */
59
+ id: zod_1.z.string().describe('Unique member identifier'),
60
+ /**
61
+ * Organization ID this membership belongs to
62
+ */
63
+ organizationId: zod_1.z.string().describe('Organization ID'),
64
+ /**
65
+ * User ID of the member
66
+ */
67
+ userId: zod_1.z.string().describe('User ID'),
68
+ /**
69
+ * Member's role within the organization
70
+ * Common roles: 'owner', 'admin', 'member', 'guest'
71
+ * Can be customized per application
72
+ */
73
+ role: zod_1.z.string().describe('Member role (e.g., owner, admin, member, guest)'),
74
+ /**
75
+ * Member creation timestamp
76
+ */
77
+ createdAt: zod_1.z.date().describe('Member creation timestamp'),
78
+ /**
79
+ * Last update timestamp
80
+ */
81
+ updatedAt: zod_1.z.date().describe('Last update timestamp'),
82
+ });
83
+ /**
84
+ * Invitation Status Enum
85
+ */
86
+ exports.InvitationStatus = zod_1.z.enum(['pending', 'accepted', 'rejected', 'expired']);
87
+ /**
88
+ * Organization Invitation Schema
89
+ * Represents an invitation to join an organization
90
+ */
91
+ exports.InvitationSchema = zod_1.z.object({
92
+ /**
93
+ * Unique invitation identifier
94
+ */
95
+ id: zod_1.z.string().describe('Unique invitation identifier'),
96
+ /**
97
+ * Organization ID the invitation is for
98
+ */
99
+ organizationId: zod_1.z.string().describe('Organization ID'),
100
+ /**
101
+ * Email address of the invitee
102
+ */
103
+ email: zod_1.z.string().email().describe('Invitee email address'),
104
+ /**
105
+ * Role the invitee will receive upon accepting
106
+ * Common roles: 'admin', 'member', 'guest'
107
+ */
108
+ role: zod_1.z.string().describe('Role to assign upon acceptance'),
109
+ /**
110
+ * Invitation status
111
+ */
112
+ status: exports.InvitationStatus.default('pending').describe('Invitation status'),
113
+ /**
114
+ * Invitation expiration timestamp
115
+ */
116
+ expiresAt: zod_1.z.date().describe('Invitation expiry timestamp'),
117
+ /**
118
+ * User ID of the person who sent the invitation
119
+ */
120
+ inviterId: zod_1.z.string().describe('User ID of the inviter'),
121
+ /**
122
+ * Invitation creation timestamp
123
+ */
124
+ createdAt: zod_1.z.date().describe('Invitation creation timestamp'),
125
+ /**
126
+ * Last update timestamp
127
+ */
128
+ updatedAt: zod_1.z.date().describe('Last update timestamp'),
129
+ });
@@ -161,16 +161,16 @@ export declare const PolicySchema: z.ZodObject<{
161
161
  expirationDays?: number | undefined;
162
162
  } | undefined;
163
163
  assignedProfiles?: string[] | undefined;
164
- network?: {
165
- trustedRanges: string[];
166
- blockUnknown: boolean;
167
- vpnRequired: boolean;
168
- } | undefined;
169
164
  session?: {
170
165
  idleTimeout: number;
171
166
  absoluteTimeout: number;
172
167
  forceMfa: boolean;
173
168
  } | undefined;
169
+ network?: {
170
+ trustedRanges: string[];
171
+ blockUnknown: boolean;
172
+ vpnRequired: boolean;
173
+ } | undefined;
174
174
  audit?: {
175
175
  logRetentionDays: number;
176
176
  sensitiveFields: string[];
@@ -189,16 +189,16 @@ export declare const PolicySchema: z.ZodObject<{
189
189
  } | undefined;
190
190
  isDefault?: boolean | undefined;
191
191
  assignedProfiles?: string[] | undefined;
192
- network?: {
193
- trustedRanges: string[];
194
- blockUnknown?: boolean | undefined;
195
- vpnRequired?: boolean | undefined;
196
- } | undefined;
197
192
  session?: {
198
193
  idleTimeout?: number | undefined;
199
194
  absoluteTimeout?: number | undefined;
200
195
  forceMfa?: boolean | undefined;
201
196
  } | undefined;
197
+ network?: {
198
+ trustedRanges: string[];
199
+ blockUnknown?: boolean | undefined;
200
+ vpnRequired?: boolean | undefined;
201
+ } | undefined;
202
202
  audit?: {
203
203
  sensitiveFields: string[];
204
204
  logRetentionDays?: number | undefined;
@@ -98,7 +98,7 @@ export declare const ActionSchema: z.ZodObject<{
98
98
  /** Access */
99
99
  visible: z.ZodOptional<z.ZodString>;
100
100
  }, "strip", z.ZodTypeAny, {
101
- type: "url" | "script" | "api" | "flow" | "modal";
101
+ type: "url" | "script" | "api" | "modal" | "flow";
102
102
  label: string;
103
103
  name: string;
104
104
  refreshAfter: boolean;
@@ -134,7 +134,7 @@ export declare const ActionSchema: z.ZodObject<{
134
134
  }[] | undefined;
135
135
  required?: boolean | undefined;
136
136
  }[] | undefined;
137
- type?: "url" | "script" | "api" | "flow" | "modal" | undefined;
137
+ type?: "url" | "script" | "api" | "modal" | "flow" | undefined;
138
138
  icon?: string | undefined;
139
139
  target?: string | undefined;
140
140
  execute?: string | undefined;
@@ -14,8 +14,8 @@ export declare const DashboardWidgetSchema: z.ZodObject<{
14
14
  type: z.ZodDefault<z.ZodEnum<["metric", "bar", "line", "pie", "donut", "funnel", "table", "text"]>>;
15
15
  /** Data Source Object */
16
16
  object: z.ZodOptional<z.ZodString>;
17
- /** Data Filter (ObjectQL JSON) */
18
- filter: z.ZodOptional<z.ZodAny>;
17
+ /** Data Filter (MongoDB-style FilterCondition) */
18
+ filter: z.ZodOptional<z.ZodType<import("../data/filter.zod").FilterCondition, z.ZodTypeDef, import("../data/filter.zod").FilterCondition>>;
19
19
  /** Category Field (X-Axis / Group By) */
20
20
  categoryField: z.ZodOptional<z.ZodString>;
21
21
  /** Value Field (Y-Axis) */
@@ -57,7 +57,7 @@ export declare const DashboardWidgetSchema: z.ZodObject<{
57
57
  h: number;
58
58
  };
59
59
  object?: string | undefined;
60
- filter?: any;
60
+ filter?: import("../data/filter.zod").FilterCondition | undefined;
61
61
  options?: any;
62
62
  title?: string | undefined;
63
63
  categoryField?: string | undefined;
@@ -70,7 +70,7 @@ export declare const DashboardWidgetSchema: z.ZodObject<{
70
70
  h: number;
71
71
  };
72
72
  object?: string | undefined;
73
- filter?: any;
73
+ filter?: import("../data/filter.zod").FilterCondition | undefined;
74
74
  options?: any;
75
75
  type?: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table" | undefined;
76
76
  aggregate?: "min" | "max" | "count" | "sum" | "avg" | undefined;
@@ -97,8 +97,8 @@ export declare const DashboardSchema: z.ZodObject<{
97
97
  type: z.ZodDefault<z.ZodEnum<["metric", "bar", "line", "pie", "donut", "funnel", "table", "text"]>>;
98
98
  /** Data Source Object */
99
99
  object: z.ZodOptional<z.ZodString>;
100
- /** Data Filter (ObjectQL JSON) */
101
- filter: z.ZodOptional<z.ZodAny>;
100
+ /** Data Filter (MongoDB-style FilterCondition) */
101
+ filter: z.ZodOptional<z.ZodType<import("../data/filter.zod").FilterCondition, z.ZodTypeDef, import("../data/filter.zod").FilterCondition>>;
102
102
  /** Category Field (X-Axis / Group By) */
103
103
  categoryField: z.ZodOptional<z.ZodString>;
104
104
  /** Value Field (Y-Axis) */
@@ -140,7 +140,7 @@ export declare const DashboardSchema: z.ZodObject<{
140
140
  h: number;
141
141
  };
142
142
  object?: string | undefined;
143
- filter?: any;
143
+ filter?: import("../data/filter.zod").FilterCondition | undefined;
144
144
  options?: any;
145
145
  title?: string | undefined;
146
146
  categoryField?: string | undefined;
@@ -153,7 +153,7 @@ export declare const DashboardSchema: z.ZodObject<{
153
153
  h: number;
154
154
  };
155
155
  object?: string | undefined;
156
- filter?: any;
156
+ filter?: import("../data/filter.zod").FilterCondition | undefined;
157
157
  options?: any;
158
158
  type?: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table" | undefined;
159
159
  aggregate?: "min" | "max" | "count" | "sum" | "avg" | undefined;
@@ -174,7 +174,7 @@ export declare const DashboardSchema: z.ZodObject<{
174
174
  h: number;
175
175
  };
176
176
  object?: string | undefined;
177
- filter?: any;
177
+ filter?: import("../data/filter.zod").FilterCondition | undefined;
178
178
  options?: any;
179
179
  title?: string | undefined;
180
180
  categoryField?: string | undefined;
@@ -192,7 +192,7 @@ export declare const DashboardSchema: z.ZodObject<{
192
192
  h: number;
193
193
  };
194
194
  object?: string | undefined;
195
- filter?: any;
195
+ filter?: import("../data/filter.zod").FilterCondition | undefined;
196
196
  options?: any;
197
197
  type?: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table" | undefined;
198
198
  aggregate?: "min" | "max" | "count" | "sum" | "avg" | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.zod.d.ts","sourceRoot":"","sources":["../../src/ui/dashboard.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,SAAS,iFASpB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;IAChC,mBAAmB;;IAGnB,yBAAyB;;IAGzB,yBAAyB;;IAGzB,kCAAkC;;IAGlC,yCAAyC;;IAGzC,2BAA2B;;IAG3B,0BAA0B;;IAG1B;;;;;;OAMG;;;;;;;;;;;;;;;;;IAQH,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAErD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,mBAAmB;;IAGnB,oBAAoB;;IAGpB,kBAAkB;;IAGlB,4BAA4B;;QArD5B,mBAAmB;;QAGnB,yBAAyB;;QAGzB,yBAAyB;;QAGzB,kCAAkC;;QAGlC,yCAAyC;;QAGzC,2BAA2B;;QAG3B,0BAA0B;;QAG1B;;;;;;WAMG;;;;;;;;;;;;;;;;;QAQH,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBrD,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,SAAS;8BACH,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,KAAG,SAAS;CACpD,CAAC"}
1
+ {"version":3,"file":"dashboard.zod.d.ts","sourceRoot":"","sources":["../../src/ui/dashboard.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,SAAS,iFASpB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;IAChC,mBAAmB;;IAGnB,yBAAyB;;IAGzB,yBAAyB;;IAGzB,kDAAkD;;IAGlD,yCAAyC;;IAGzC,2BAA2B;;IAG3B,0BAA0B;;IAG1B;;;;;;OAMG;;;;;;;;;;;;;;;;;IAQH,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAErD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,mBAAmB;;IAGnB,oBAAoB;;IAGpB,kBAAkB;;IAGlB,4BAA4B;;QArD5B,mBAAmB;;QAGnB,yBAAyB;;QAGzB,yBAAyB;;QAGzB,kDAAkD;;QAGlD,yCAAyC;;QAGzC,2BAA2B;;QAG3B,0BAA0B;;QAG1B;;;;;;WAMG;;;;;;;;;;;;;;;;;QAQH,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBrD,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,SAAS;8BACH,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,KAAG,SAAS;CACpD,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Dashboard = exports.DashboardSchema = exports.DashboardWidgetSchema = exports.ChartType = void 0;
4
4
  const zod_1 = require("zod");
5
+ const filter_zod_1 = require("../data/filter.zod");
5
6
  /**
6
7
  * Chart Type Enum
7
8
  */
@@ -26,8 +27,8 @@ exports.DashboardWidgetSchema = zod_1.z.object({
26
27
  type: exports.ChartType.default('metric').describe('Visualization type'),
27
28
  /** Data Source Object */
28
29
  object: zod_1.z.string().optional().describe('Data source object name'),
29
- /** Data Filter (ObjectQL JSON) */
30
- filter: zod_1.z.any().optional().describe('Data filter criteria'),
30
+ /** Data Filter (MongoDB-style FilterCondition) */
31
+ filter: filter_zod_1.FilterConditionSchema.optional().describe('Data filter criteria'),
31
32
  /** Category Field (X-Axis / Group By) */
32
33
  categoryField: zod_1.z.string().optional().describe('Field for grouping (X-Axis)'),
33
34
  /** Value Field (Y-Axis) */
@@ -0,0 +1,17 @@
1
+ /**
2
+ * UI Protocol Exports
3
+ *
4
+ * Presentation & Interaction
5
+ * - App, Page, View (Grid/Kanban)
6
+ * - Dashboard (Widgets), Report
7
+ * - Action (Triggers)
8
+ */
9
+ export * from './app.zod';
10
+ export * from './view.zod';
11
+ export * from './dashboard.zod';
12
+ export * from './report.zod';
13
+ export * from './action.zod';
14
+ export * from './page.zod';
15
+ export * from './widget.zod';
16
+ export * from './theme.zod';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /**
3
+ * UI Protocol Exports
4
+ *
5
+ * Presentation & Interaction
6
+ * - App, Page, View (Grid/Kanban)
7
+ * - Dashboard (Widgets), Report
8
+ * - Action (Triggers)
9
+ */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ __exportStar(require("./app.zod"), exports);
26
+ __exportStar(require("./view.zod"), exports);
27
+ __exportStar(require("./dashboard.zod"), exports);
28
+ __exportStar(require("./report.zod"), exports);
29
+ __exportStar(require("./action.zod"), exports);
30
+ __exportStar(require("./page.zod"), exports);
31
+ __exportStar(require("./widget.zod"), exports);
32
+ __exportStar(require("./theme.zod"), exports);