@objectstack/spec 0.2.0 → 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 (103) 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/index.d.ts +21 -0
  18. package/dist/data/index.d.ts.map +1 -0
  19. package/dist/data/index.js +36 -0
  20. package/dist/data/query.zod.d.ts +386 -3
  21. package/dist/data/query.zod.d.ts.map +1 -1
  22. package/dist/data/query.zod.js +386 -3
  23. package/dist/data/validation.zod.d.ts +349 -0
  24. package/dist/data/validation.zod.d.ts.map +1 -1
  25. package/dist/data/validation.zod.js +395 -0
  26. package/dist/index.d.ts +36 -41
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +64 -49
  29. package/dist/system/auth-protocol.d.ts +175 -0
  30. package/dist/system/auth-protocol.d.ts.map +1 -0
  31. package/dist/system/auth-protocol.js +60 -0
  32. package/dist/system/auth.zod.d.ts +1097 -65
  33. package/dist/system/auth.zod.d.ts.map +1 -1
  34. package/dist/system/auth.zod.js +135 -1
  35. package/dist/system/identity.zod.d.ts +234 -180
  36. package/dist/system/identity.zod.d.ts.map +1 -1
  37. package/dist/system/identity.zod.js +168 -51
  38. package/dist/system/index.d.ts +28 -0
  39. package/dist/system/index.d.ts.map +1 -0
  40. package/dist/system/index.js +43 -0
  41. package/dist/system/manifest.zod.d.ts +10 -10
  42. package/dist/system/organization.zod.d.ts +179 -0
  43. package/dist/system/organization.zod.d.ts.map +1 -0
  44. package/dist/system/organization.zod.js +129 -0
  45. package/dist/ui/action.zod.d.ts +2 -2
  46. package/dist/ui/index.d.ts +17 -0
  47. package/dist/ui/index.d.ts.map +1 -0
  48. package/dist/ui/index.js +32 -0
  49. package/dist/ui/theme.zod.d.ts +6 -6
  50. package/json-schema/Account.json +87 -0
  51. package/json-schema/AuthConfig.json +235 -0
  52. package/json-schema/ChunkingStrategy.json +133 -0
  53. package/json-schema/DatabaseMapping.json +48 -0
  54. package/json-schema/DocumentChunk.json +97 -0
  55. package/json-schema/DocumentLoaderConfig.json +69 -0
  56. package/json-schema/DocumentMetadata.json +61 -0
  57. package/json-schema/EmbeddingModel.json +57 -0
  58. package/json-schema/EnterpriseAuthConfig.json +172 -0
  59. package/json-schema/Entity.json +55 -0
  60. package/json-schema/FieldSynonymConfig.json +39 -0
  61. package/json-schema/Invitation.json +69 -0
  62. package/json-schema/InvitationStatus.json +15 -0
  63. package/json-schema/LDAPConfig.json +22 -5
  64. package/json-schema/Member.json +46 -0
  65. package/json-schema/ModelCapability.json +47 -0
  66. package/json-schema/ModelConfig.json +181 -0
  67. package/json-schema/ModelLimits.json +45 -0
  68. package/json-schema/ModelPricing.json +28 -0
  69. package/json-schema/ModelProvider.json +19 -0
  70. package/json-schema/ModelRegistry.json +427 -0
  71. package/json-schema/ModelRegistryEntry.json +239 -0
  72. package/json-schema/ModelSelectionCriteria.json +50 -0
  73. package/json-schema/NLQAnalytics.json +106 -0
  74. package/json-schema/NLQFieldMapping.json +40 -0
  75. package/json-schema/NLQModelConfig.json +78 -0
  76. package/json-schema/NLQParseResult.json +252 -0
  77. package/json-schema/NLQRequest.json +110 -0
  78. package/json-schema/NLQResponse.json +288 -0
  79. package/json-schema/NLQTrainingExample.json +120 -0
  80. package/json-schema/OIDCConfig.json +18 -3
  81. package/json-schema/Organization.json +52 -0
  82. package/json-schema/PromptTemplate.json +163 -0
  83. package/json-schema/PromptVariable.json +56 -0
  84. package/json-schema/QueryContext.json +72 -0
  85. package/json-schema/QueryIntent.json +21 -0
  86. package/json-schema/QueryTemplate.json +81 -0
  87. package/json-schema/RAGPipelineConfig.json +552 -0
  88. package/json-schema/RAGPipelineStatus.json +66 -0
  89. package/json-schema/RAGQueryRequest.json +64 -0
  90. package/json-schema/RAGQueryResponse.json +108 -0
  91. package/json-schema/RerankingConfig.json +34 -0
  92. package/json-schema/RetrievalStrategy.json +121 -0
  93. package/json-schema/SAMLConfig.json +17 -3
  94. package/json-schema/Session.json +63 -0
  95. package/json-schema/StandardAuthProvider.json +235 -0
  96. package/json-schema/Timeframe.json +68 -0
  97. package/json-schema/User.json +51 -0
  98. package/json-schema/VectorStoreConfig.json +82 -0
  99. package/json-schema/VectorStoreProvider.json +21 -0
  100. package/json-schema/VerificationToken.json +36 -0
  101. package/package.json +27 -1
  102. package/json-schema/AuthProtocol.json +0 -17
  103. package/json-schema/AuthProvider.json +0 -171
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rag-pipeline.zod.d.ts","sourceRoot":"","sources":["../../src/ai/rag-pipeline.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB,iIAWpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;EAQ/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyBjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,244 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RAGPipelineStatusSchema = exports.RAGQueryResponseSchema = exports.RAGQueryRequestSchema = exports.RAGPipelineConfigSchema = exports.DocumentLoaderConfigSchema = exports.VectorStoreConfigSchema = exports.RerankingConfigSchema = exports.RetrievalStrategySchema = exports.DocumentChunkSchema = exports.DocumentMetadataSchema = exports.ChunkingStrategySchema = exports.EmbeddingModelSchema = exports.VectorStoreProviderSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * RAG (Retrieval-Augmented Generation) Pipeline Protocol
7
+ *
8
+ * Defines schemas for building context-aware AI assistants using RAG techniques.
9
+ * Enables vector search, document chunking, embeddings, and retrieval configuration.
10
+ */
11
+ /**
12
+ * Vector Store Provider
13
+ */
14
+ exports.VectorStoreProviderSchema = zod_1.z.enum([
15
+ 'pinecone',
16
+ 'weaviate',
17
+ 'qdrant',
18
+ 'milvus',
19
+ 'chroma',
20
+ 'pgvector',
21
+ 'redis',
22
+ 'opensearch',
23
+ 'elasticsearch',
24
+ 'custom',
25
+ ]);
26
+ /**
27
+ * Embedding Model
28
+ */
29
+ exports.EmbeddingModelSchema = zod_1.z.object({
30
+ provider: zod_1.z.enum(['openai', 'cohere', 'huggingface', 'azure_openai', 'local', 'custom']),
31
+ model: zod_1.z.string().describe('Model name (e.g., "text-embedding-3-large")'),
32
+ dimensions: zod_1.z.number().int().positive().describe('Embedding vector dimensions'),
33
+ maxTokens: zod_1.z.number().int().positive().optional().describe('Maximum tokens per embedding'),
34
+ batchSize: zod_1.z.number().int().positive().optional().default(100).describe('Batch size for embedding'),
35
+ endpoint: zod_1.z.string().url().optional().describe('Custom endpoint URL'),
36
+ apiKey: zod_1.z.string().optional().describe('API key or reference to secret'),
37
+ });
38
+ /**
39
+ * Text Chunking Strategy
40
+ */
41
+ exports.ChunkingStrategySchema = zod_1.z.discriminatedUnion('type', [
42
+ zod_1.z.object({
43
+ type: zod_1.z.literal('fixed'),
44
+ chunkSize: zod_1.z.number().int().positive().describe('Fixed chunk size in tokens/chars'),
45
+ chunkOverlap: zod_1.z.number().int().min(0).default(0).describe('Overlap between chunks'),
46
+ unit: zod_1.z.enum(['tokens', 'characters']).default('tokens'),
47
+ }),
48
+ zod_1.z.object({
49
+ type: zod_1.z.literal('semantic'),
50
+ model: zod_1.z.string().optional().describe('Model for semantic chunking'),
51
+ minChunkSize: zod_1.z.number().int().positive().default(100),
52
+ maxChunkSize: zod_1.z.number().int().positive().default(1000),
53
+ }),
54
+ zod_1.z.object({
55
+ type: zod_1.z.literal('recursive'),
56
+ separators: zod_1.z.array(zod_1.z.string()).default(['\n\n', '\n', ' ', '']),
57
+ chunkSize: zod_1.z.number().int().positive(),
58
+ chunkOverlap: zod_1.z.number().int().min(0).default(0),
59
+ }),
60
+ zod_1.z.object({
61
+ type: zod_1.z.literal('markdown'),
62
+ maxChunkSize: zod_1.z.number().int().positive().default(1000),
63
+ respectHeaders: zod_1.z.boolean().default(true).describe('Keep headers with content'),
64
+ respectCodeBlocks: zod_1.z.boolean().default(true).describe('Keep code blocks intact'),
65
+ }),
66
+ ]);
67
+ /**
68
+ * Document Metadata Schema
69
+ */
70
+ exports.DocumentMetadataSchema = zod_1.z.object({
71
+ source: zod_1.z.string().describe('Document source (file path, URL, etc.)'),
72
+ sourceType: zod_1.z.enum(['file', 'url', 'api', 'database', 'custom']).optional(),
73
+ title: zod_1.z.string().optional(),
74
+ author: zod_1.z.string().optional(),
75
+ createdAt: zod_1.z.string().optional().describe('ISO timestamp'),
76
+ updatedAt: zod_1.z.string().optional().describe('ISO timestamp'),
77
+ tags: zod_1.z.array(zod_1.z.string()).optional(),
78
+ category: zod_1.z.string().optional(),
79
+ language: zod_1.z.string().optional().describe('Document language (ISO 639-1 code)'),
80
+ custom: zod_1.z.record(zod_1.z.any()).optional().describe('Custom metadata fields'),
81
+ });
82
+ /**
83
+ * Document Chunk
84
+ */
85
+ exports.DocumentChunkSchema = zod_1.z.object({
86
+ id: zod_1.z.string().describe('Unique chunk identifier'),
87
+ content: zod_1.z.string().describe('Chunk text content'),
88
+ embedding: zod_1.z.array(zod_1.z.number()).optional().describe('Embedding vector'),
89
+ metadata: exports.DocumentMetadataSchema,
90
+ chunkIndex: zod_1.z.number().int().min(0).describe('Chunk position in document'),
91
+ tokens: zod_1.z.number().int().optional().describe('Token count'),
92
+ });
93
+ /**
94
+ * Retrieval Strategy
95
+ */
96
+ exports.RetrievalStrategySchema = zod_1.z.discriminatedUnion('type', [
97
+ zod_1.z.object({
98
+ type: zod_1.z.literal('similarity'),
99
+ topK: zod_1.z.number().int().positive().default(5).describe('Number of results to retrieve'),
100
+ scoreThreshold: zod_1.z.number().min(0).max(1).optional().describe('Minimum similarity score'),
101
+ }),
102
+ zod_1.z.object({
103
+ type: zod_1.z.literal('mmr'),
104
+ topK: zod_1.z.number().int().positive().default(5),
105
+ fetchK: zod_1.z.number().int().positive().default(20).describe('Initial fetch size'),
106
+ lambda: zod_1.z.number().min(0).max(1).default(0.5).describe('Diversity vs relevance (0=diverse, 1=relevant)'),
107
+ }),
108
+ zod_1.z.object({
109
+ type: zod_1.z.literal('hybrid'),
110
+ topK: zod_1.z.number().int().positive().default(5),
111
+ vectorWeight: zod_1.z.number().min(0).max(1).default(0.7).describe('Weight for vector search'),
112
+ keywordWeight: zod_1.z.number().min(0).max(1).default(0.3).describe('Weight for keyword search'),
113
+ }),
114
+ zod_1.z.object({
115
+ type: zod_1.z.literal('parent_document'),
116
+ topK: zod_1.z.number().int().positive().default(5),
117
+ retrieveParent: zod_1.z.boolean().default(true).describe('Retrieve full parent document'),
118
+ }),
119
+ ]);
120
+ /**
121
+ * Reranking Configuration
122
+ */
123
+ exports.RerankingConfigSchema = zod_1.z.object({
124
+ enabled: zod_1.z.boolean().default(false),
125
+ model: zod_1.z.string().optional().describe('Reranking model name'),
126
+ provider: zod_1.z.enum(['cohere', 'huggingface', 'custom']).optional(),
127
+ topK: zod_1.z.number().int().positive().default(3).describe('Final number of results after reranking'),
128
+ });
129
+ /**
130
+ * Vector Store Configuration
131
+ */
132
+ exports.VectorStoreConfigSchema = zod_1.z.object({
133
+ provider: exports.VectorStoreProviderSchema,
134
+ indexName: zod_1.z.string().describe('Index/collection name'),
135
+ namespace: zod_1.z.string().optional().describe('Namespace for multi-tenancy'),
136
+ /** Connection */
137
+ host: zod_1.z.string().optional().describe('Vector store host'),
138
+ port: zod_1.z.number().int().optional().describe('Vector store port'),
139
+ apiKey: zod_1.z.string().optional().describe('API key or reference to secret'),
140
+ /** Configuration */
141
+ dimensions: zod_1.z.number().int().positive().describe('Vector dimensions'),
142
+ metric: zod_1.z.enum(['cosine', 'euclidean', 'dotproduct']).optional().default('cosine'),
143
+ /** Performance */
144
+ batchSize: zod_1.z.number().int().positive().optional().default(100),
145
+ connectionPoolSize: zod_1.z.number().int().positive().optional().default(10),
146
+ timeout: zod_1.z.number().int().positive().optional().default(30000).describe('Timeout in milliseconds'),
147
+ });
148
+ /**
149
+ * Document Loader Configuration
150
+ */
151
+ exports.DocumentLoaderConfigSchema = zod_1.z.object({
152
+ type: zod_1.z.enum(['file', 'directory', 'url', 'api', 'database', 'custom']),
153
+ /** Source */
154
+ source: zod_1.z.string().describe('Source path, URL, or identifier'),
155
+ /** File Types */
156
+ fileTypes: zod_1.z.array(zod_1.z.string()).optional().describe('Accepted file extensions (e.g., [".pdf", ".md"])'),
157
+ /** Processing */
158
+ recursive: zod_1.z.boolean().optional().default(false).describe('Process directories recursively'),
159
+ maxFileSize: zod_1.z.number().int().optional().describe('Maximum file size in bytes'),
160
+ excludePatterns: zod_1.z.array(zod_1.z.string()).optional().describe('Patterns to exclude'),
161
+ /** Text Extraction */
162
+ extractImages: zod_1.z.boolean().optional().default(false).describe('Extract text from images (OCR)'),
163
+ extractTables: zod_1.z.boolean().optional().default(false).describe('Extract and format tables'),
164
+ /** Custom Loader */
165
+ loaderConfig: zod_1.z.record(zod_1.z.any()).optional().describe('Custom loader-specific config'),
166
+ });
167
+ /**
168
+ * RAG Pipeline Configuration
169
+ */
170
+ exports.RAGPipelineConfigSchema = zod_1.z.object({
171
+ /** Identity */
172
+ name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Pipeline name (snake_case)'),
173
+ label: zod_1.z.string().describe('Display name'),
174
+ description: zod_1.z.string().optional(),
175
+ /** Components */
176
+ embedding: exports.EmbeddingModelSchema,
177
+ vectorStore: exports.VectorStoreConfigSchema,
178
+ chunking: exports.ChunkingStrategySchema,
179
+ retrieval: exports.RetrievalStrategySchema,
180
+ reranking: exports.RerankingConfigSchema.optional(),
181
+ /** Document Loading */
182
+ loaders: zod_1.z.array(exports.DocumentLoaderConfigSchema).optional().describe('Document loaders'),
183
+ /** Context Management */
184
+ maxContextTokens: zod_1.z.number().int().positive().default(4000).describe('Maximum tokens in context'),
185
+ contextWindow: zod_1.z.number().int().positive().optional().describe('LLM context window size'),
186
+ /** Metadata Filtering */
187
+ metadataFilters: zod_1.z.record(zod_1.z.union([
188
+ zod_1.z.string(),
189
+ zod_1.z.number(),
190
+ zod_1.z.boolean(),
191
+ zod_1.z.array(zod_1.z.union([zod_1.z.string(), zod_1.z.number()])),
192
+ ])).optional().describe('Filters for retrieval (e.g., {category: "docs", status: "published"})'),
193
+ /** Caching */
194
+ enableCache: zod_1.z.boolean().default(true),
195
+ cacheTTL: zod_1.z.number().int().positive().default(3600).describe('Cache TTL in seconds'),
196
+ cacheInvalidationStrategy: zod_1.z.enum(['time_based', 'manual', 'on_update']).default('time_based').optional(),
197
+ });
198
+ /**
199
+ * RAG Query Request
200
+ */
201
+ exports.RAGQueryRequestSchema = zod_1.z.object({
202
+ query: zod_1.z.string().describe('User query'),
203
+ pipelineName: zod_1.z.string().describe('Pipeline to use'),
204
+ /** Override defaults */
205
+ topK: zod_1.z.number().int().positive().optional(),
206
+ metadataFilters: zod_1.z.record(zod_1.z.any()).optional(),
207
+ /** Context */
208
+ conversationHistory: zod_1.z.array(zod_1.z.object({
209
+ role: zod_1.z.enum(['user', 'assistant', 'system']),
210
+ content: zod_1.z.string(),
211
+ })).optional(),
212
+ /** Options */
213
+ includeMetadata: zod_1.z.boolean().default(true),
214
+ includeSources: zod_1.z.boolean().default(true),
215
+ });
216
+ /**
217
+ * RAG Query Response
218
+ */
219
+ exports.RAGQueryResponseSchema = zod_1.z.object({
220
+ query: zod_1.z.string(),
221
+ results: zod_1.z.array(zod_1.z.object({
222
+ content: zod_1.z.string(),
223
+ score: zod_1.z.number(),
224
+ metadata: exports.DocumentMetadataSchema.optional(),
225
+ chunkId: zod_1.z.string().optional(),
226
+ })),
227
+ context: zod_1.z.string().describe('Assembled context for LLM'),
228
+ tokensUsed: zod_1.z.number().int().optional(),
229
+ retrievalTime: zod_1.z.number().optional().describe('Retrieval time in milliseconds'),
230
+ });
231
+ /**
232
+ * RAG Pipeline Status
233
+ */
234
+ exports.RAGPipelineStatusSchema = zod_1.z.object({
235
+ name: zod_1.z.string(),
236
+ status: zod_1.z.enum(['active', 'indexing', 'error', 'disabled']),
237
+ documentsIndexed: zod_1.z.number().int().min(0),
238
+ lastIndexed: zod_1.z.string().optional().describe('ISO timestamp'),
239
+ errorMessage: zod_1.z.string().optional(),
240
+ health: zod_1.z.object({
241
+ vectorStore: zod_1.z.enum(['healthy', 'unhealthy', 'unknown']),
242
+ embeddingService: zod_1.z.enum(['healthy', 'unhealthy', 'unknown']),
243
+ }).optional(),
244
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * API Protocol Exports
3
+ *
4
+ * API Contracts & Envelopes
5
+ * - Request/Response schemas
6
+ * - Error handling
7
+ */
8
+ export * from './contract.zod';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * API Protocol Exports
4
+ *
5
+ * API Contracts & Envelopes
6
+ * - Request/Response schemas
7
+ * - Error handling
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ __exportStar(require("./contract.zod"), exports);
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Data Protocol Exports
3
+ *
4
+ * Core Business Logic & Data Modeling
5
+ * - Object, Field, Validation
6
+ * - Query (AST), Mapping (ETL)
7
+ * - Permission, Sharing, Flow
8
+ */
9
+ export * from './field.zod';
10
+ export * from './object.zod';
11
+ export * from './validation.zod';
12
+ export * from './permission.zod';
13
+ export * from './sharing.zod';
14
+ export * from './workflow.zod';
15
+ export * from './flow.zod';
16
+ export * from './dataset.zod';
17
+ export * from './query.zod';
18
+ export * from './filter.zod';
19
+ export * from './mapping.zod';
20
+ export * from './trigger.zod';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /**
3
+ * Data Protocol Exports
4
+ *
5
+ * Core Business Logic & Data Modeling
6
+ * - Object, Field, Validation
7
+ * - Query (AST), Mapping (ETL)
8
+ * - Permission, Sharing, Flow
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("./field.zod"), exports);
26
+ __exportStar(require("./object.zod"), exports);
27
+ __exportStar(require("./validation.zod"), exports);
28
+ __exportStar(require("./permission.zod"), exports);
29
+ __exportStar(require("./sharing.zod"), exports);
30
+ __exportStar(require("./workflow.zod"), exports);
31
+ __exportStar(require("./flow.zod"), exports);
32
+ __exportStar(require("./dataset.zod"), exports);
33
+ __exportStar(require("./query.zod"), exports);
34
+ __exportStar(require("./filter.zod"), exports);
35
+ __exportStar(require("./mapping.zod"), exports);
36
+ __exportStar(require("./trigger.zod"), exports);