@objectstack/spec 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -1
- package/dist/ai/index.d.mts +2 -1
- package/dist/ai/index.d.ts +2 -1
- package/dist/ai/index.js +2047 -1944
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +2047 -1944
- package/dist/ai/index.mjs.map +1 -1
- package/dist/api/index.d.mts +3 -1
- package/dist/api/index.d.ts +3 -1
- package/dist/api/index.js +2599 -2292
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +2587 -2292
- package/dist/api/index.mjs.map +1 -1
- package/dist/automation/index.d.mts +2 -1
- package/dist/automation/index.d.ts +2 -1
- package/dist/automation/index.js +83 -0
- package/dist/automation/index.js.map +1 -1
- package/dist/automation/index.mjs +77 -0
- package/dist/automation/index.mjs.map +1 -1
- package/dist/contracts/index.d.mts +3 -2
- package/dist/contracts/index.d.ts +3 -2
- package/dist/data/index.d.mts +3 -2
- package/dist/data/index.d.ts +3 -2
- package/dist/data/index.js +658 -556
- package/dist/data/index.js.map +1 -1
- package/dist/data/index.mjs +656 -556
- package/dist/data/index.mjs.map +1 -1
- package/dist/{driver.zod-lfi00zVT.d.ts → driver.zod-CfGk9GYh.d.ts} +2164 -11
- package/dist/{driver.zod-BOM_Etco.d.mts → driver.zod-y1cX6R3c.d.mts} +2164 -11
- package/dist/hub/index.d.mts +1 -1
- package/dist/hub/index.d.ts +1 -1
- package/dist/hub/index.js +789 -724
- package/dist/hub/index.js.map +1 -1
- package/dist/hub/index.mjs +789 -724
- package/dist/hub/index.mjs.map +1 -1
- package/dist/{index-C67cfwmW.d.ts → index-B0Hf65bV.d.ts} +13 -5
- package/dist/{index-DLcySG7U.d.ts → index-B5pKM0My.d.ts} +335 -4370
- package/dist/{index-Os7lItRe.d.mts → index-BA022mg2.d.ts} +6178 -129
- package/dist/{index-B5-VbOKg.d.mts → index-BGeLoH2z.d.ts} +4251 -74
- package/dist/{index-CH5zloR3.d.ts → index-BwO__aqV.d.ts} +1 -1
- package/dist/{index-Dp7GFJ8V.d.mts → index-Cia3JPQ8.d.mts} +13 -5
- package/dist/{index-D12rNohm.d.mts → index-CpD1q1FP.d.ts} +35 -18
- package/dist/{index-Os7lItRe.d.ts → index-D5RSFPuB.d.mts} +6178 -129
- package/dist/{index-CU4m6noq.d.mts → index-DGjpaj0X.d.mts} +1 -1
- package/dist/{index-D12rNohm.d.ts → index-Dfn5VXl6.d.mts} +35 -18
- package/dist/{index-l6WIlmOD.d.mts → index-Dgybxlky.d.mts} +177 -158
- package/dist/{index-l6WIlmOD.d.ts → index-Dgybxlky.d.ts} +177 -158
- package/dist/{index-DLcySG7U.d.mts → index-Dpsk8PF4.d.mts} +335 -4370
- package/dist/{index-CyognKSZ.d.ts → index-DrNah5E0.d.ts} +1952 -6990
- package/dist/{index-DE_lJ11p.d.mts → index-OO84R20k.d.mts} +1952 -6990
- package/dist/{index-B5-VbOKg.d.ts → index-upA3Xt04.d.mts} +4251 -74
- package/dist/index.d.mts +8072 -1922
- package/dist/index.d.ts +8072 -1922
- package/dist/index.js +8563 -8249
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8563 -8249
- package/dist/index.mjs.map +1 -1
- package/dist/integration/index.d.mts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/kernel/index.d.mts +2 -1
- package/dist/kernel/index.d.ts +2 -1
- package/dist/kernel/index.js +884 -684
- package/dist/kernel/index.js.map +1 -1
- package/dist/kernel/index.mjs +870 -684
- package/dist/kernel/index.mjs.map +1 -1
- package/dist/package-registry.zod-JMcOYNxM.d.mts +21119 -0
- package/dist/package-registry.zod-JMcOYNxM.d.ts +21119 -0
- package/dist/state-machine.zod-B-lFFSxQ.d.mts +285 -0
- package/dist/state-machine.zod-B-lFFSxQ.d.ts +285 -0
- package/dist/system/index.d.mts +2 -1
- package/dist/system/index.d.ts +2 -1
- package/dist/system/index.js +749 -651
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.mjs +749 -651
- package/dist/system/index.mjs.map +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/json-schema/ai/Agent.json +499 -0
- package/json-schema/ai/DevOpsAgent.json +499 -0
- package/json-schema/ai/FeedbackLoop.json +2188 -186
- package/json-schema/ai/Resolution.json +2188 -186
- package/json-schema/api/ApiRoutes.json +4 -0
- package/json-schema/api/CompileManifestResponse.json +40 -10
- package/json-schema/api/DisablePackageRequest.json +18 -0
- package/json-schema/api/DisablePackageResponse.json +1521 -0
- package/json-schema/api/Discovery.json +4 -0
- package/json-schema/api/EnablePackageRequest.json +18 -0
- package/json-schema/api/EnablePackageResponse.json +1521 -0
- package/json-schema/api/GetDiscoveryResponse.json +4 -0
- package/json-schema/api/GetPackageRequest.json +18 -0
- package/json-schema/api/GetPackageResponse.json +1518 -0
- package/json-schema/api/InstallPackageRequest.json +1483 -0
- package/json-schema/api/InstallPackageResponse.json +1521 -0
- package/json-schema/api/ListPackagesRequest.json +42 -0
- package/json-schema/api/ListPackagesResponse.json +1525 -0
- package/json-schema/api/ObjectDefinitionResponse.json +1001 -0
- package/json-schema/api/ObjectStackProtocol.json +86 -1
- package/json-schema/api/RestApiConfig.json +5 -0
- package/json-schema/api/RestServerConfig.json +5 -0
- package/json-schema/api/UninstallPackageRequest.json +18 -0
- package/json-schema/api/UninstallPackageResponse.json +25 -0
- package/json-schema/automation/ActionRef.json +30 -0
- package/json-schema/automation/Event.json +24 -0
- package/json-schema/automation/Flow.json +1 -0
- package/json-schema/automation/FlowNode.json +1 -0
- package/json-schema/automation/FlowNodeAction.json +1 -0
- package/json-schema/automation/GuardRef.json +30 -0
- package/json-schema/automation/StateMachine.json +504 -0
- package/json-schema/automation/StateNode.json +324 -0
- package/json-schema/automation/Transition.json +73 -0
- package/json-schema/data/Object.json +1001 -0
- package/json-schema/data/ObjectExtension.json +2376 -0
- package/json-schema/data/ObjectOwnershipEnum.json +13 -0
- package/json-schema/hub/ComposerResponse.json +40 -10
- package/json-schema/kernel/DisablePackageRequest.json +18 -0
- package/json-schema/kernel/DisablePackageResponse.json +1521 -0
- package/json-schema/kernel/EnablePackageRequest.json +18 -0
- package/json-schema/kernel/EnablePackageResponse.json +1521 -0
- package/json-schema/kernel/EventBusConfig.json +15 -0
- package/json-schema/kernel/EventHandler.json +6 -0
- package/json-schema/kernel/EventPersistence.json +3 -0
- package/json-schema/kernel/EventRoute.json +3 -0
- package/json-schema/kernel/EventWebhookConfig.json +3 -0
- package/json-schema/kernel/GetPackageRequest.json +18 -0
- package/json-schema/kernel/GetPackageResponse.json +1518 -0
- package/json-schema/kernel/InstallPackageRequest.json +1483 -0
- package/json-schema/kernel/InstallPackageResponse.json +1521 -0
- package/json-schema/kernel/InstalledPackage.json +1509 -0
- package/json-schema/kernel/ListPackagesRequest.json +42 -0
- package/json-schema/kernel/ListPackagesResponse.json +1525 -0
- package/json-schema/kernel/Manifest.json +40 -10
- package/json-schema/kernel/PackageStatusEnum.json +16 -0
- package/json-schema/kernel/Plugin.json +5 -0
- package/json-schema/kernel/PluginContext.json +31 -7
- package/json-schema/kernel/PluginLifecycle.json +7 -1
- package/json-schema/kernel/RealTimeNotificationConfig.json +3 -0
- package/json-schema/kernel/UninstallPackageRequest.json +18 -0
- package/json-schema/kernel/UninstallPackageResponse.json +25 -0
- package/json-schema/system/ChangeSet.json +2188 -186
- package/json-schema/system/CreateObjectOperation.json +1001 -0
- package/json-schema/system/MigrationOperation.json +1001 -0
- package/package.json +29 -15
- package/prompts/create-new-project.md +37 -19
- package/dist/{index-I3piy4U4.d.mts → index-BmU_sD1f.d.mts} +8 -8
- package/dist/{index-CkhpsEUw.d.ts → index-BnXuc_HO.d.ts} +8 -8
- package/dist/{index-CIDI-8zR.d.mts → index-C_NTOcet.d.mts} +98 -98
- package/dist/{index-CIDI-8zR.d.ts → index-C_NTOcet.d.ts} +98 -98
package/dist/data/index.js
CHANGED
|
@@ -118,6 +118,8 @@ __export(data_exports, {
|
|
|
118
118
|
NoSQLTransactionOptionsSchema: () => NoSQLTransactionOptionsSchema,
|
|
119
119
|
NormalizedFilterSchema: () => NormalizedFilterSchema,
|
|
120
120
|
ObjectCapabilities: () => ObjectCapabilities,
|
|
121
|
+
ObjectExtensionSchema: () => ObjectExtensionSchema,
|
|
122
|
+
ObjectOwnershipEnum: () => ObjectOwnershipEnum,
|
|
121
123
|
ObjectSchema: () => ObjectSchema,
|
|
122
124
|
PartitioningConfigSchema: () => PartitioningConfigSchema,
|
|
123
125
|
PoolConfigSchema: () => PoolConfigSchema,
|
|
@@ -405,7 +407,7 @@ var QuerySchema = BaseQuerySchema.extend({
|
|
|
405
407
|
});
|
|
406
408
|
|
|
407
409
|
// src/data/object.zod.ts
|
|
408
|
-
var
|
|
410
|
+
var import_zod9 = require("zod");
|
|
409
411
|
|
|
410
412
|
// src/data/field.zod.ts
|
|
411
413
|
var import_zod6 = require("zod");
|
|
@@ -988,8 +990,77 @@ var ConditionalValidationSchema = BaseValidationSchema.extend({
|
|
|
988
990
|
otherwise: ValidationRuleSchema.optional().describe("Validation rule to apply when condition is false")
|
|
989
991
|
});
|
|
990
992
|
|
|
993
|
+
// src/automation/state-machine.zod.ts
|
|
994
|
+
var import_zod8 = require("zod");
|
|
995
|
+
var ActionRefSchema = import_zod8.z.union([
|
|
996
|
+
import_zod8.z.string().describe("Action Name"),
|
|
997
|
+
import_zod8.z.object({
|
|
998
|
+
type: import_zod8.z.string(),
|
|
999
|
+
// e.g., 'xstate.assign', 'log', 'email'
|
|
1000
|
+
params: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.any()).optional()
|
|
1001
|
+
})
|
|
1002
|
+
]);
|
|
1003
|
+
var GuardRefSchema = import_zod8.z.union([
|
|
1004
|
+
import_zod8.z.string().describe('Guard Name (e.g., "isManager", "amountGT1000")'),
|
|
1005
|
+
import_zod8.z.object({
|
|
1006
|
+
type: import_zod8.z.string(),
|
|
1007
|
+
params: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.any()).optional()
|
|
1008
|
+
})
|
|
1009
|
+
]);
|
|
1010
|
+
var TransitionSchema = import_zod8.z.object({
|
|
1011
|
+
target: import_zod8.z.string().optional().describe("Target State ID"),
|
|
1012
|
+
cond: GuardRefSchema.optional().describe("Condition (Guard) required to take this path"),
|
|
1013
|
+
actions: import_zod8.z.array(ActionRefSchema).optional().describe("Actions to execute during transition"),
|
|
1014
|
+
description: import_zod8.z.string().optional().describe("Human readable description of this rule")
|
|
1015
|
+
});
|
|
1016
|
+
var EventSchema = import_zod8.z.object({
|
|
1017
|
+
type: import_zod8.z.string().describe('Event Type (e.g. "APPROVE", "REJECT", "Submit")'),
|
|
1018
|
+
// Payload validation schema could go here if we want deep validation
|
|
1019
|
+
schema: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.any()).optional().describe("Expected event payload structure")
|
|
1020
|
+
});
|
|
1021
|
+
var StateNodeSchema = import_zod8.z.lazy(() => import_zod8.z.object({
|
|
1022
|
+
/** Type of state */
|
|
1023
|
+
type: import_zod8.z.enum(["atomic", "compound", "parallel", "final", "history"]).default("atomic"),
|
|
1024
|
+
/** Entry/Exit Actions */
|
|
1025
|
+
entry: import_zod8.z.array(ActionRefSchema).optional().describe("Actions to run when entering this state"),
|
|
1026
|
+
exit: import_zod8.z.array(ActionRefSchema).optional().describe("Actions to run when leaving this state"),
|
|
1027
|
+
/** Transitions (Events) */
|
|
1028
|
+
on: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.union([
|
|
1029
|
+
import_zod8.z.string(),
|
|
1030
|
+
// Shorthand target
|
|
1031
|
+
TransitionSchema,
|
|
1032
|
+
import_zod8.z.array(TransitionSchema)
|
|
1033
|
+
])).optional().describe("Map of Event Type -> Transition Definition"),
|
|
1034
|
+
/** Always Transitions (Eventless) */
|
|
1035
|
+
always: import_zod8.z.array(TransitionSchema).optional(),
|
|
1036
|
+
/** Nesting (Hierarchical States) */
|
|
1037
|
+
initial: import_zod8.z.string().optional().describe("Initial child state (if compound)"),
|
|
1038
|
+
states: import_zod8.z.record(import_zod8.z.string(), StateNodeSchema).optional(),
|
|
1039
|
+
/** Metadata for UI/AI */
|
|
1040
|
+
meta: import_zod8.z.object({
|
|
1041
|
+
label: import_zod8.z.string().optional(),
|
|
1042
|
+
description: import_zod8.z.string().optional(),
|
|
1043
|
+
color: import_zod8.z.string().optional(),
|
|
1044
|
+
// For UI diagrams
|
|
1045
|
+
// Instructions for AI Agent when in this state
|
|
1046
|
+
aiInstructions: import_zod8.z.string().optional().describe("Specific instructions for AI when in this state")
|
|
1047
|
+
}).optional()
|
|
1048
|
+
}));
|
|
1049
|
+
var StateMachineSchema = import_zod8.z.object({
|
|
1050
|
+
id: SnakeCaseIdentifierSchema.describe("Unique Machine ID"),
|
|
1051
|
+
description: import_zod8.z.string().optional(),
|
|
1052
|
+
/** Context (Memory) Schema */
|
|
1053
|
+
contextSchema: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.any()).optional().describe("Zod Schema for the machine context/memory"),
|
|
1054
|
+
/** Initial State */
|
|
1055
|
+
initial: import_zod8.z.string().describe("Initial State ID"),
|
|
1056
|
+
/** State Definitions */
|
|
1057
|
+
states: import_zod8.z.record(import_zod8.z.string(), StateNodeSchema).describe("State Nodes"),
|
|
1058
|
+
/** Global Listeners */
|
|
1059
|
+
on: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.union([import_zod8.z.string(), TransitionSchema, import_zod8.z.array(TransitionSchema)])).optional()
|
|
1060
|
+
});
|
|
1061
|
+
|
|
991
1062
|
// src/data/object.zod.ts
|
|
992
|
-
var ApiMethod =
|
|
1063
|
+
var ApiMethod = import_zod9.z.enum([
|
|
993
1064
|
"get",
|
|
994
1065
|
"list",
|
|
995
1066
|
// Read
|
|
@@ -1014,65 +1085,65 @@ var ApiMethod = import_zod8.z.enum([
|
|
|
1014
1085
|
"export"
|
|
1015
1086
|
// Data portability
|
|
1016
1087
|
]);
|
|
1017
|
-
var ObjectCapabilities =
|
|
1088
|
+
var ObjectCapabilities = import_zod9.z.object({
|
|
1018
1089
|
/** Enable history tracking (Audit Trail) */
|
|
1019
|
-
trackHistory:
|
|
1090
|
+
trackHistory: import_zod9.z.boolean().default(false).describe("Enable field history tracking for audit compliance"),
|
|
1020
1091
|
/** Enable global search indexing */
|
|
1021
|
-
searchable:
|
|
1092
|
+
searchable: import_zod9.z.boolean().default(true).describe("Index records for global search"),
|
|
1022
1093
|
/** Enable REST/GraphQL API access */
|
|
1023
|
-
apiEnabled:
|
|
1094
|
+
apiEnabled: import_zod9.z.boolean().default(true).describe("Expose object via automatic APIs"),
|
|
1024
1095
|
/**
|
|
1025
1096
|
* API Supported Operations
|
|
1026
1097
|
* Granular control over API exposure.
|
|
1027
1098
|
*/
|
|
1028
|
-
apiMethods:
|
|
1099
|
+
apiMethods: import_zod9.z.array(ApiMethod).optional().describe("Whitelist of allowed API operations"),
|
|
1029
1100
|
/** Enable standard attachments/files engine */
|
|
1030
|
-
files:
|
|
1101
|
+
files: import_zod9.z.boolean().default(false).describe("Enable file attachments and document management"),
|
|
1031
1102
|
/** Enable social collaboration (Comments, Mentions, Feeds) */
|
|
1032
|
-
feeds:
|
|
1103
|
+
feeds: import_zod9.z.boolean().default(false).describe("Enable social feed, comments, and mentions (Chatter-like)"),
|
|
1033
1104
|
/** Enable standard Activity suite (Tasks, Calendars, Events) */
|
|
1034
|
-
activities:
|
|
1105
|
+
activities: import_zod9.z.boolean().default(false).describe("Enable standard tasks and events tracking"),
|
|
1035
1106
|
/** Enable Recycle Bin / Soft Delete */
|
|
1036
|
-
trash:
|
|
1107
|
+
trash: import_zod9.z.boolean().default(true).describe("Enable soft-delete with restore capability"),
|
|
1037
1108
|
/** Enable "Recently Viewed" tracking */
|
|
1038
|
-
mru:
|
|
1109
|
+
mru: import_zod9.z.boolean().default(true).describe("Track Most Recently Used (MRU) list for users"),
|
|
1039
1110
|
/** Allow cloning records */
|
|
1040
|
-
clone:
|
|
1041
|
-
});
|
|
1042
|
-
var IndexSchema =
|
|
1043
|
-
name:
|
|
1044
|
-
fields:
|
|
1045
|
-
type:
|
|
1046
|
-
unique:
|
|
1047
|
-
partial:
|
|
1048
|
-
});
|
|
1049
|
-
var SearchConfigSchema =
|
|
1050
|
-
fields:
|
|
1051
|
-
displayFields:
|
|
1052
|
-
filters:
|
|
1053
|
-
});
|
|
1054
|
-
var TenancyConfigSchema =
|
|
1055
|
-
enabled:
|
|
1056
|
-
strategy:
|
|
1057
|
-
tenantField:
|
|
1058
|
-
crossTenantAccess:
|
|
1059
|
-
});
|
|
1060
|
-
var SoftDeleteConfigSchema =
|
|
1061
|
-
enabled:
|
|
1062
|
-
field:
|
|
1063
|
-
cascadeDelete:
|
|
1064
|
-
});
|
|
1065
|
-
var VersioningConfigSchema =
|
|
1066
|
-
enabled:
|
|
1067
|
-
strategy:
|
|
1068
|
-
retentionDays:
|
|
1069
|
-
versionField:
|
|
1070
|
-
});
|
|
1071
|
-
var PartitioningConfigSchema =
|
|
1072
|
-
enabled:
|
|
1073
|
-
strategy:
|
|
1074
|
-
key:
|
|
1075
|
-
interval:
|
|
1111
|
+
clone: import_zod9.z.boolean().default(true).describe("Allow record deep cloning")
|
|
1112
|
+
});
|
|
1113
|
+
var IndexSchema = import_zod9.z.object({
|
|
1114
|
+
name: import_zod9.z.string().optional().describe("Index name (auto-generated if not provided)"),
|
|
1115
|
+
fields: import_zod9.z.array(import_zod9.z.string()).describe("Fields included in the index"),
|
|
1116
|
+
type: import_zod9.z.enum(["btree", "hash", "gin", "gist", "fulltext"]).optional().default("btree").describe("Index algorithm type"),
|
|
1117
|
+
unique: import_zod9.z.boolean().optional().default(false).describe("Whether the index enforces uniqueness"),
|
|
1118
|
+
partial: import_zod9.z.string().optional().describe("Partial index condition (SQL WHERE clause for conditional indexes)")
|
|
1119
|
+
});
|
|
1120
|
+
var SearchConfigSchema = import_zod9.z.object({
|
|
1121
|
+
fields: import_zod9.z.array(import_zod9.z.string()).describe("Fields to index for full-text search weighting"),
|
|
1122
|
+
displayFields: import_zod9.z.array(import_zod9.z.string()).optional().describe("Fields to display in search result cards"),
|
|
1123
|
+
filters: import_zod9.z.array(import_zod9.z.string()).optional().describe("Default filters for search results")
|
|
1124
|
+
});
|
|
1125
|
+
var TenancyConfigSchema = import_zod9.z.object({
|
|
1126
|
+
enabled: import_zod9.z.boolean().describe("Enable multi-tenancy for this object"),
|
|
1127
|
+
strategy: import_zod9.z.enum(["shared", "isolated", "hybrid"]).describe("Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)"),
|
|
1128
|
+
tenantField: import_zod9.z.string().default("tenant_id").describe("Field name for tenant identifier"),
|
|
1129
|
+
crossTenantAccess: import_zod9.z.boolean().default(false).describe("Allow cross-tenant data access (with explicit permission)")
|
|
1130
|
+
});
|
|
1131
|
+
var SoftDeleteConfigSchema = import_zod9.z.object({
|
|
1132
|
+
enabled: import_zod9.z.boolean().describe("Enable soft delete (trash/recycle bin)"),
|
|
1133
|
+
field: import_zod9.z.string().default("deleted_at").describe("Field name for soft delete timestamp"),
|
|
1134
|
+
cascadeDelete: import_zod9.z.boolean().default(false).describe("Cascade soft delete to related records")
|
|
1135
|
+
});
|
|
1136
|
+
var VersioningConfigSchema = import_zod9.z.object({
|
|
1137
|
+
enabled: import_zod9.z.boolean().describe("Enable record versioning"),
|
|
1138
|
+
strategy: import_zod9.z.enum(["snapshot", "delta", "event-sourcing"]).describe("Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)"),
|
|
1139
|
+
retentionDays: import_zod9.z.number().min(1).optional().describe("Number of days to retain old versions (undefined = infinite)"),
|
|
1140
|
+
versionField: import_zod9.z.string().default("version").describe("Field name for version number/timestamp")
|
|
1141
|
+
});
|
|
1142
|
+
var PartitioningConfigSchema = import_zod9.z.object({
|
|
1143
|
+
enabled: import_zod9.z.boolean().describe("Enable table partitioning"),
|
|
1144
|
+
strategy: import_zod9.z.enum(["range", "hash", "list"]).describe("Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)"),
|
|
1145
|
+
key: import_zod9.z.string().describe("Field name to partition by"),
|
|
1146
|
+
interval: import_zod9.z.string().optional().describe('Partition interval for range strategy (e.g., "1 month", "1 year")')
|
|
1076
1147
|
}).refine((data) => {
|
|
1077
1148
|
if (data.strategy === "range" && !data.interval) {
|
|
1078
1149
|
return false;
|
|
@@ -1081,39 +1152,39 @@ var PartitioningConfigSchema = import_zod8.z.object({
|
|
|
1081
1152
|
}, {
|
|
1082
1153
|
message: 'interval is required when strategy is "range"'
|
|
1083
1154
|
});
|
|
1084
|
-
var CDCConfigSchema =
|
|
1085
|
-
enabled:
|
|
1086
|
-
events:
|
|
1087
|
-
destination:
|
|
1155
|
+
var CDCConfigSchema = import_zod9.z.object({
|
|
1156
|
+
enabled: import_zod9.z.boolean().describe("Enable Change Data Capture"),
|
|
1157
|
+
events: import_zod9.z.array(import_zod9.z.enum(["insert", "update", "delete"])).describe("Event types to capture"),
|
|
1158
|
+
destination: import_zod9.z.string().describe('Destination endpoint (e.g., "kafka://topic", "webhook://url")')
|
|
1088
1159
|
});
|
|
1089
|
-
var ObjectSchemaBase =
|
|
1160
|
+
var ObjectSchemaBase = import_zod9.z.object({
|
|
1090
1161
|
/**
|
|
1091
1162
|
* Identity & Metadata
|
|
1092
1163
|
*/
|
|
1093
|
-
name:
|
|
1094
|
-
label:
|
|
1095
|
-
pluralLabel:
|
|
1096
|
-
description:
|
|
1097
|
-
icon:
|
|
1164
|
+
name: import_zod9.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Machine unique key (snake_case). Immutable."),
|
|
1165
|
+
label: import_zod9.z.string().optional().describe('Human readable singular label (e.g. "Account")'),
|
|
1166
|
+
pluralLabel: import_zod9.z.string().optional().describe('Human readable plural label (e.g. "Accounts")'),
|
|
1167
|
+
description: import_zod9.z.string().optional().describe("Developer documentation / description"),
|
|
1168
|
+
icon: import_zod9.z.string().optional().describe("Icon name (Lucide/Material) for UI representation"),
|
|
1098
1169
|
/**
|
|
1099
1170
|
* Taxonomy & Organization
|
|
1100
1171
|
*/
|
|
1101
|
-
tags:
|
|
1102
|
-
active:
|
|
1103
|
-
isSystem:
|
|
1104
|
-
abstract:
|
|
1172
|
+
tags: import_zod9.z.array(import_zod9.z.string()).optional().describe('Categorization tags (e.g. "sales", "system", "reference")'),
|
|
1173
|
+
active: import_zod9.z.boolean().optional().default(true).describe("Is the object active and usable"),
|
|
1174
|
+
isSystem: import_zod9.z.boolean().optional().default(false).describe("Is system object (protected from deletion)"),
|
|
1175
|
+
abstract: import_zod9.z.boolean().optional().default(false).describe("Is abstract base object (cannot be instantiated)"),
|
|
1105
1176
|
/**
|
|
1106
1177
|
* Storage & Virtualization
|
|
1107
1178
|
*/
|
|
1108
|
-
datasource:
|
|
1109
|
-
tableName:
|
|
1179
|
+
datasource: import_zod9.z.string().optional().default("default").describe('Target Datasource ID. "default" is the primary DB.'),
|
|
1180
|
+
tableName: import_zod9.z.string().optional().describe("Physical table/collection name in the target datasource"),
|
|
1110
1181
|
/**
|
|
1111
1182
|
* Data Model
|
|
1112
1183
|
*/
|
|
1113
|
-
fields:
|
|
1184
|
+
fields: import_zod9.z.record(import_zod9.z.string().regex(/^[a-z_][a-z0-9_]*$/, {
|
|
1114
1185
|
message: 'Field names must be lowercase snake_case (e.g., "first_name", "company", "annual_revenue")'
|
|
1115
1186
|
}), FieldSchema).describe("Field definitions map. Keys must be snake_case identifiers."),
|
|
1116
|
-
indexes:
|
|
1187
|
+
indexes: import_zod9.z.array(IndexSchema).optional().describe("Database performance indexes"),
|
|
1117
1188
|
/**
|
|
1118
1189
|
* Advanced Data Management
|
|
1119
1190
|
*/
|
|
@@ -1131,12 +1202,22 @@ var ObjectSchemaBase = import_zod8.z.object({
|
|
|
1131
1202
|
* Logic & Validation (Co-located)
|
|
1132
1203
|
* Best Practice: Define rules close to data.
|
|
1133
1204
|
*/
|
|
1134
|
-
validations:
|
|
1205
|
+
validations: import_zod9.z.array(ValidationRuleSchema).optional().describe("Object-level validation rules"),
|
|
1206
|
+
/**
|
|
1207
|
+
* State Machine(s)
|
|
1208
|
+
* Supports a single machine (legacy) or a named record of machines.
|
|
1209
|
+
* Multiple machines allow parallel lifecycles (e.g., status + payment_status + approval_status).
|
|
1210
|
+
*
|
|
1211
|
+
* @example Single: stateMachine: { id: 'lifecycle', initial: 'draft', states: {...} }
|
|
1212
|
+
* @example Multiple: stateMachines: { lifecycle: {...}, payment: {...}, approval: {...} }
|
|
1213
|
+
*/
|
|
1214
|
+
stateMachine: StateMachineSchema.optional().describe("Single state machine for record lifecycle (shorthand)"),
|
|
1215
|
+
stateMachines: import_zod9.z.record(import_zod9.z.string(), StateMachineSchema).optional().describe("Named state machines for parallel lifecycles (e.g., status, payment, approval)"),
|
|
1135
1216
|
/**
|
|
1136
1217
|
* Display & UI Hints (Data-Layer)
|
|
1137
1218
|
*/
|
|
1138
|
-
titleFormat:
|
|
1139
|
-
compactLayout:
|
|
1219
|
+
titleFormat: import_zod9.z.string().optional().describe('Title expression (e.g. "{name} - {code}"). Overrides nameField.'),
|
|
1220
|
+
compactLayout: import_zod9.z.array(import_zod9.z.string()).optional().describe("Primary fields for hover/cards/lookups"),
|
|
1140
1221
|
/**
|
|
1141
1222
|
* Search Engine Config
|
|
1142
1223
|
*/
|
|
@@ -1149,10 +1230,29 @@ var ObjectSchemaBase = import_zod8.z.object({
|
|
|
1149
1230
|
var ObjectSchema = Object.assign(ObjectSchemaBase, {
|
|
1150
1231
|
create: (config) => config
|
|
1151
1232
|
});
|
|
1233
|
+
var ObjectOwnershipEnum = import_zod9.z.enum(["own", "extend"]);
|
|
1234
|
+
var ObjectExtensionSchema = import_zod9.z.object({
|
|
1235
|
+
/** The target object name (FQN) to extend */
|
|
1236
|
+
extend: import_zod9.z.string().describe("Target object name (FQN) to extend"),
|
|
1237
|
+
/** Fields to merge into the target object (additive) */
|
|
1238
|
+
fields: import_zod9.z.record(import_zod9.z.string(), FieldSchema).optional().describe("Fields to add/override"),
|
|
1239
|
+
/** Override label */
|
|
1240
|
+
label: import_zod9.z.string().optional(),
|
|
1241
|
+
/** Override plural label */
|
|
1242
|
+
pluralLabel: import_zod9.z.string().optional(),
|
|
1243
|
+
/** Override description */
|
|
1244
|
+
description: import_zod9.z.string().optional(),
|
|
1245
|
+
/** Additional validation rules to add */
|
|
1246
|
+
validations: import_zod9.z.array(ValidationRuleSchema).optional(),
|
|
1247
|
+
/** Additional indexes to add */
|
|
1248
|
+
indexes: import_zod9.z.array(IndexSchema).optional(),
|
|
1249
|
+
/** Merge priority. Higher number applied later (wins on conflict). Default: 200 */
|
|
1250
|
+
priority: import_zod9.z.number().int().min(0).max(999).default(200).describe("Merge priority (higher = applied later)")
|
|
1251
|
+
});
|
|
1152
1252
|
|
|
1153
1253
|
// src/data/hook.zod.ts
|
|
1154
|
-
var
|
|
1155
|
-
var HookEvent =
|
|
1254
|
+
var import_zod10 = require("zod");
|
|
1255
|
+
var HookEvent = import_zod10.z.enum([
|
|
1156
1256
|
// Read Operations
|
|
1157
1257
|
"beforeFind",
|
|
1158
1258
|
"afterFind",
|
|
@@ -1175,16 +1275,16 @@ var HookEvent = import_zod9.z.enum([
|
|
|
1175
1275
|
"beforeDeleteMany",
|
|
1176
1276
|
"afterDeleteMany"
|
|
1177
1277
|
]);
|
|
1178
|
-
var HookSchema =
|
|
1278
|
+
var HookSchema = import_zod10.z.object({
|
|
1179
1279
|
/**
|
|
1180
1280
|
* Unique identifier for the hook
|
|
1181
1281
|
* Required for debugging and overriding.
|
|
1182
1282
|
*/
|
|
1183
|
-
name:
|
|
1283
|
+
name: import_zod10.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Hook unique name (snake_case)"),
|
|
1184
1284
|
/**
|
|
1185
1285
|
* Human readable label
|
|
1186
1286
|
*/
|
|
1187
|
-
label:
|
|
1287
|
+
label: import_zod10.z.string().optional().describe("Description of what this hook does"),
|
|
1188
1288
|
/**
|
|
1189
1289
|
* Target Object(s)
|
|
1190
1290
|
* can be:
|
|
@@ -1192,17 +1292,17 @@ var HookSchema = import_zod9.z.object({
|
|
|
1192
1292
|
* - List of objects: ["account", "contact"]
|
|
1193
1293
|
* - Wildcard: "*" (All objects)
|
|
1194
1294
|
*/
|
|
1195
|
-
object:
|
|
1295
|
+
object: import_zod10.z.union([import_zod10.z.string(), import_zod10.z.array(import_zod10.z.string())]).describe("Target object(s)"),
|
|
1196
1296
|
/**
|
|
1197
1297
|
* Events to subscribe to
|
|
1198
1298
|
* Combinations of timing (before/after) and action (find/insert/update/delete/etc)
|
|
1199
1299
|
*/
|
|
1200
|
-
events:
|
|
1300
|
+
events: import_zod10.z.array(HookEvent).describe("Lifecycle events"),
|
|
1201
1301
|
/**
|
|
1202
1302
|
* Handler Logic
|
|
1203
1303
|
* Reference to a registered function in the plugin system OR a direct function (runtime only).
|
|
1204
1304
|
*/
|
|
1205
|
-
handler:
|
|
1305
|
+
handler: import_zod10.z.union([import_zod10.z.string(), import_zod10.z.any()]).optional().describe("Function handler name or direct function"),
|
|
1206
1306
|
/**
|
|
1207
1307
|
* Execution Order
|
|
1208
1308
|
* Lower numbers run first.
|
|
@@ -1210,27 +1310,27 @@ var HookSchema = import_zod9.z.object({
|
|
|
1210
1310
|
* - App Hooks: 100-999
|
|
1211
1311
|
* - User Hooks: 1000+
|
|
1212
1312
|
*/
|
|
1213
|
-
priority:
|
|
1313
|
+
priority: import_zod10.z.number().default(100).describe("Execution priority"),
|
|
1214
1314
|
/**
|
|
1215
1315
|
* Async / Background Execution
|
|
1216
1316
|
* If true, the hook runs in the background and does not block the transaction.
|
|
1217
1317
|
* Only applicable for 'after*' events.
|
|
1218
1318
|
* Default: false (Blocking)
|
|
1219
1319
|
*/
|
|
1220
|
-
async:
|
|
1320
|
+
async: import_zod10.z.boolean().default(false).describe("Run specifically as fire-and-forget"),
|
|
1221
1321
|
/**
|
|
1222
1322
|
* Error Policy
|
|
1223
1323
|
* What to do if the hook throws an exception?
|
|
1224
1324
|
* - abort: Rollback transaction (if blocking)
|
|
1225
1325
|
* - log: Log error and continue
|
|
1226
1326
|
*/
|
|
1227
|
-
onError:
|
|
1327
|
+
onError: import_zod10.z.enum(["abort", "log"]).default("abort").describe("Error handling strategy")
|
|
1228
1328
|
});
|
|
1229
|
-
var HookContextSchema =
|
|
1329
|
+
var HookContextSchema = import_zod10.z.object({
|
|
1230
1330
|
/** Tracing ID */
|
|
1231
|
-
id:
|
|
1331
|
+
id: import_zod10.z.string().optional().describe("Unique execution ID for tracing"),
|
|
1232
1332
|
/** Target Object Name */
|
|
1233
|
-
object:
|
|
1333
|
+
object: import_zod10.z.string(),
|
|
1234
1334
|
/** Current Lifecycle Event */
|
|
1235
1335
|
event: HookEvent,
|
|
1236
1336
|
/**
|
|
@@ -1244,42 +1344,42 @@ var HookContextSchema = import_zod9.z.object({
|
|
|
1244
1344
|
* - updateMany: { query: QueryAST, doc: Record, options: DriverOptions }
|
|
1245
1345
|
* - deleteMany: { query: QueryAST, options: DriverOptions }
|
|
1246
1346
|
*/
|
|
1247
|
-
input:
|
|
1347
|
+
input: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.any()).describe("Mutable input parameters"),
|
|
1248
1348
|
/**
|
|
1249
1349
|
* Operation Result (Mutable)
|
|
1250
1350
|
* Available in 'after*' events. Modify this to transform the output.
|
|
1251
1351
|
*/
|
|
1252
|
-
result:
|
|
1352
|
+
result: import_zod10.z.any().optional().describe("Operation result (After hooks only)"),
|
|
1253
1353
|
/**
|
|
1254
1354
|
* Data Snapshot
|
|
1255
1355
|
* The state of the record BEFORE the operation (for update/delete).
|
|
1256
1356
|
*/
|
|
1257
|
-
previous:
|
|
1357
|
+
previous: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.any()).optional().describe("Record state before operation"),
|
|
1258
1358
|
/**
|
|
1259
1359
|
* Execution Session
|
|
1260
1360
|
* Contains authentication and tenancy information.
|
|
1261
1361
|
*/
|
|
1262
|
-
session:
|
|
1263
|
-
userId:
|
|
1264
|
-
tenantId:
|
|
1265
|
-
roles:
|
|
1266
|
-
accessToken:
|
|
1362
|
+
session: import_zod10.z.object({
|
|
1363
|
+
userId: import_zod10.z.string().optional(),
|
|
1364
|
+
tenantId: import_zod10.z.string().optional(),
|
|
1365
|
+
roles: import_zod10.z.array(import_zod10.z.string()).optional(),
|
|
1366
|
+
accessToken: import_zod10.z.string().optional()
|
|
1267
1367
|
}).optional().describe("Current session context"),
|
|
1268
1368
|
/**
|
|
1269
1369
|
* Transaction Handle
|
|
1270
1370
|
* If the operation is part of a transaction, use this handle for side-effects.
|
|
1271
1371
|
*/
|
|
1272
|
-
transaction:
|
|
1372
|
+
transaction: import_zod10.z.any().optional().describe("Database transaction handle"),
|
|
1273
1373
|
/**
|
|
1274
1374
|
* Engine Access
|
|
1275
1375
|
* Reference to the ObjectQL engine for performing side effects.
|
|
1276
1376
|
*/
|
|
1277
|
-
ql:
|
|
1377
|
+
ql: import_zod10.z.any().describe("ObjectQL Engine Reference")
|
|
1278
1378
|
});
|
|
1279
1379
|
|
|
1280
1380
|
// src/data/mapping.zod.ts
|
|
1281
|
-
var
|
|
1282
|
-
var TransformType =
|
|
1381
|
+
var import_zod11 = require("zod");
|
|
1382
|
+
var TransformType = import_zod11.z.enum([
|
|
1283
1383
|
"none",
|
|
1284
1384
|
// Direct copy
|
|
1285
1385
|
"constant",
|
|
@@ -1295,114 +1395,114 @@ var TransformType = import_zod10.z.enum([
|
|
|
1295
1395
|
"map"
|
|
1296
1396
|
// Value mapping (e.g. "Active" -> "active")
|
|
1297
1397
|
]);
|
|
1298
|
-
var FieldMappingSchema =
|
|
1398
|
+
var FieldMappingSchema = import_zod11.z.object({
|
|
1299
1399
|
/** Source Column */
|
|
1300
|
-
source:
|
|
1400
|
+
source: import_zod11.z.union([import_zod11.z.string(), import_zod11.z.array(import_zod11.z.string())]).describe("Source column header(s)"),
|
|
1301
1401
|
/** Target Field */
|
|
1302
|
-
target:
|
|
1402
|
+
target: import_zod11.z.union([import_zod11.z.string(), import_zod11.z.array(import_zod11.z.string())]).describe("Target object field(s)"),
|
|
1303
1403
|
/** Transformation */
|
|
1304
1404
|
transform: TransformType.default("none"),
|
|
1305
1405
|
/** Configuration for transform */
|
|
1306
|
-
params:
|
|
1406
|
+
params: import_zod11.z.object({
|
|
1307
1407
|
// Constant
|
|
1308
|
-
value:
|
|
1408
|
+
value: import_zod11.z.any().optional(),
|
|
1309
1409
|
// Lookup
|
|
1310
|
-
object:
|
|
1410
|
+
object: import_zod11.z.string().optional(),
|
|
1311
1411
|
// Lookup Object
|
|
1312
|
-
fromField:
|
|
1412
|
+
fromField: import_zod11.z.string().optional(),
|
|
1313
1413
|
// Match on (e.g. "name")
|
|
1314
|
-
toField:
|
|
1414
|
+
toField: import_zod11.z.string().optional(),
|
|
1315
1415
|
// Value to take (e.g. "_id")
|
|
1316
|
-
autoCreate:
|
|
1416
|
+
autoCreate: import_zod11.z.boolean().optional(),
|
|
1317
1417
|
// Create if missing
|
|
1318
1418
|
// Map
|
|
1319
|
-
valueMap:
|
|
1419
|
+
valueMap: import_zod11.z.record(import_zod11.z.string(), import_zod11.z.any()).optional(),
|
|
1320
1420
|
// { "Open": "draft" }
|
|
1321
1421
|
// Split/Join
|
|
1322
|
-
separator:
|
|
1422
|
+
separator: import_zod11.z.string().optional()
|
|
1323
1423
|
}).optional()
|
|
1324
1424
|
});
|
|
1325
|
-
var MappingSchema =
|
|
1425
|
+
var MappingSchema = import_zod11.z.object({
|
|
1326
1426
|
/** Identity */
|
|
1327
1427
|
name: SnakeCaseIdentifierSchema.describe("Mapping unique name (lowercase snake_case)"),
|
|
1328
|
-
label:
|
|
1428
|
+
label: import_zod11.z.string().optional(),
|
|
1329
1429
|
/** Scope */
|
|
1330
|
-
sourceFormat:
|
|
1331
|
-
targetObject:
|
|
1430
|
+
sourceFormat: import_zod11.z.enum(["csv", "json", "xml", "sql"]).default("csv"),
|
|
1431
|
+
targetObject: import_zod11.z.string().describe("Target Object Name"),
|
|
1332
1432
|
/** Column Mappings */
|
|
1333
|
-
fieldMapping:
|
|
1433
|
+
fieldMapping: import_zod11.z.array(FieldMappingSchema),
|
|
1334
1434
|
/** Upsert Logic */
|
|
1335
|
-
mode:
|
|
1336
|
-
upsertKey:
|
|
1435
|
+
mode: import_zod11.z.enum(["insert", "update", "upsert"]).default("insert"),
|
|
1436
|
+
upsertKey: import_zod11.z.array(import_zod11.z.string()).optional().describe("Fields to match for upsert (e.g. email)"),
|
|
1337
1437
|
/** Extract Logic (For Export) */
|
|
1338
1438
|
extractQuery: QuerySchema.optional().describe("Query to run for export only"),
|
|
1339
1439
|
/** Error Handling */
|
|
1340
|
-
errorPolicy:
|
|
1341
|
-
batchSize:
|
|
1440
|
+
errorPolicy: import_zod11.z.enum(["skip", "abort", "retry"]).default("skip"),
|
|
1441
|
+
batchSize: import_zod11.z.number().default(1e3)
|
|
1342
1442
|
});
|
|
1343
1443
|
|
|
1344
1444
|
// src/data/data-engine.zod.ts
|
|
1345
|
-
var
|
|
1346
|
-
var DataEngineFilterSchema =
|
|
1347
|
-
|
|
1445
|
+
var import_zod12 = require("zod");
|
|
1446
|
+
var DataEngineFilterSchema = import_zod12.z.union([
|
|
1447
|
+
import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()),
|
|
1348
1448
|
FilterConditionSchema
|
|
1349
1449
|
]).describe("Data Engine query filter conditions");
|
|
1350
|
-
var DataEngineSortSchema =
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1450
|
+
var DataEngineSortSchema = import_zod12.z.union([
|
|
1451
|
+
import_zod12.z.record(import_zod12.z.string(), import_zod12.z.enum(["asc", "desc"])),
|
|
1452
|
+
import_zod12.z.record(import_zod12.z.string(), import_zod12.z.union([import_zod12.z.literal(1), import_zod12.z.literal(-1)])),
|
|
1453
|
+
import_zod12.z.array(SortNodeSchema)
|
|
1354
1454
|
]).describe("Sort order definition");
|
|
1355
|
-
var DataEngineQueryOptionsSchema =
|
|
1455
|
+
var DataEngineQueryOptionsSchema = import_zod12.z.object({
|
|
1356
1456
|
/** Filter conditions (WHERE) */
|
|
1357
1457
|
filter: DataEngineFilterSchema.optional(),
|
|
1358
1458
|
/** Fields to select (SELECT) */
|
|
1359
|
-
select:
|
|
1459
|
+
select: import_zod12.z.array(import_zod12.z.string()).optional(),
|
|
1360
1460
|
/** Sort order (ORDER BY) */
|
|
1361
1461
|
sort: DataEngineSortSchema.optional(),
|
|
1362
1462
|
/** Limit number of results (LIMIT) */
|
|
1363
|
-
limit:
|
|
1463
|
+
limit: import_zod12.z.number().int().min(1).optional(),
|
|
1364
1464
|
/** Skip number of results (OFFSET) */
|
|
1365
|
-
skip:
|
|
1465
|
+
skip: import_zod12.z.number().int().min(0).optional(),
|
|
1366
1466
|
/**
|
|
1367
1467
|
* Maximum number of results (OData style)
|
|
1368
1468
|
* Takes precedence over limit if both specified
|
|
1369
1469
|
*/
|
|
1370
|
-
top:
|
|
1470
|
+
top: import_zod12.z.number().int().min(1).optional(),
|
|
1371
1471
|
/**
|
|
1372
1472
|
* Include related records (JOIN/Populate)
|
|
1373
1473
|
* List of relationship field names to expand
|
|
1374
1474
|
*/
|
|
1375
|
-
populate:
|
|
1475
|
+
populate: import_zod12.z.array(import_zod12.z.string()).optional()
|
|
1376
1476
|
}).describe("Query options for IDataEngine.find() operations");
|
|
1377
|
-
var DataEngineInsertOptionsSchema =
|
|
1477
|
+
var DataEngineInsertOptionsSchema = import_zod12.z.object({
|
|
1378
1478
|
/**
|
|
1379
1479
|
* Return the inserted record(s)?
|
|
1380
1480
|
* Some drivers support RETURNING clause for efficiency.
|
|
1381
1481
|
* Default: true
|
|
1382
1482
|
*/
|
|
1383
|
-
returning:
|
|
1483
|
+
returning: import_zod12.z.boolean().default(true).optional()
|
|
1384
1484
|
}).describe("Options for DataEngine.insert operations");
|
|
1385
|
-
var DataEngineUpdateOptionsSchema =
|
|
1485
|
+
var DataEngineUpdateOptionsSchema = import_zod12.z.object({
|
|
1386
1486
|
/** Filter conditions to identify records to update */
|
|
1387
1487
|
filter: DataEngineFilterSchema.optional(),
|
|
1388
1488
|
/**
|
|
1389
1489
|
* Perform an upsert?
|
|
1390
1490
|
* If true, insert if not found.
|
|
1391
1491
|
*/
|
|
1392
|
-
upsert:
|
|
1492
|
+
upsert: import_zod12.z.boolean().default(false).optional(),
|
|
1393
1493
|
/**
|
|
1394
1494
|
* Update multiple records?
|
|
1395
1495
|
* If false, only the first match is updated.
|
|
1396
1496
|
* Default: false
|
|
1397
1497
|
*/
|
|
1398
|
-
multi:
|
|
1498
|
+
multi: import_zod12.z.boolean().default(false).optional(),
|
|
1399
1499
|
/**
|
|
1400
1500
|
* Return the updated record(s)?
|
|
1401
1501
|
* Default: false (returns update count/status)
|
|
1402
1502
|
*/
|
|
1403
|
-
returning:
|
|
1503
|
+
returning: import_zod12.z.boolean().default(false).optional()
|
|
1404
1504
|
}).describe("Options for DataEngine.update operations");
|
|
1405
|
-
var DataEngineDeleteOptionsSchema =
|
|
1505
|
+
var DataEngineDeleteOptionsSchema = import_zod12.z.object({
|
|
1406
1506
|
/** Filter conditions to identify records to delete */
|
|
1407
1507
|
filter: DataEngineFilterSchema.optional(),
|
|
1408
1508
|
/**
|
|
@@ -1410,99 +1510,99 @@ var DataEngineDeleteOptionsSchema = import_zod11.z.object({
|
|
|
1410
1510
|
* If false, only the first match is deleted.
|
|
1411
1511
|
* Default: false
|
|
1412
1512
|
*/
|
|
1413
|
-
multi:
|
|
1513
|
+
multi: import_zod12.z.boolean().default(false).optional()
|
|
1414
1514
|
}).describe("Options for DataEngine.delete operations");
|
|
1415
|
-
var DataEngineAggregateOptionsSchema =
|
|
1515
|
+
var DataEngineAggregateOptionsSchema = import_zod12.z.object({
|
|
1416
1516
|
/** Filter conditions (WHERE) */
|
|
1417
1517
|
filter: DataEngineFilterSchema.optional(),
|
|
1418
1518
|
/** Group By fields */
|
|
1419
|
-
groupBy:
|
|
1519
|
+
groupBy: import_zod12.z.array(import_zod12.z.string()).optional(),
|
|
1420
1520
|
/**
|
|
1421
1521
|
* Aggregation definitions
|
|
1422
1522
|
* e.g. [{ field: 'amount', method: 'sum', alias: 'total' }]
|
|
1423
1523
|
*/
|
|
1424
|
-
aggregations:
|
|
1425
|
-
field:
|
|
1426
|
-
method:
|
|
1427
|
-
alias:
|
|
1524
|
+
aggregations: import_zod12.z.array(import_zod12.z.object({
|
|
1525
|
+
field: import_zod12.z.string(),
|
|
1526
|
+
method: import_zod12.z.enum(["count", "sum", "avg", "min", "max", "count_distinct"]),
|
|
1527
|
+
alias: import_zod12.z.string().optional()
|
|
1428
1528
|
})).optional()
|
|
1429
1529
|
}).describe("Options for DataEngine.aggregate operations");
|
|
1430
|
-
var DataEngineCountOptionsSchema =
|
|
1530
|
+
var DataEngineCountOptionsSchema = import_zod12.z.object({
|
|
1431
1531
|
/** Filter conditions */
|
|
1432
1532
|
filter: DataEngineFilterSchema.optional()
|
|
1433
1533
|
}).describe("Options for DataEngine.count operations");
|
|
1434
|
-
var DataEngineContractSchema =
|
|
1435
|
-
find:
|
|
1436
|
-
findOne:
|
|
1437
|
-
insert:
|
|
1438
|
-
update:
|
|
1439
|
-
delete:
|
|
1440
|
-
count:
|
|
1441
|
-
aggregate:
|
|
1534
|
+
var DataEngineContractSchema = import_zod12.z.object({
|
|
1535
|
+
find: import_zod12.z.function().args(import_zod12.z.string(), DataEngineQueryOptionsSchema.optional()).returns(import_zod12.z.promise(import_zod12.z.array(import_zod12.z.any()))),
|
|
1536
|
+
findOne: import_zod12.z.function().args(import_zod12.z.string(), DataEngineQueryOptionsSchema.optional()).returns(import_zod12.z.promise(import_zod12.z.any())),
|
|
1537
|
+
insert: import_zod12.z.function().args(import_zod12.z.string(), import_zod12.z.union([import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()), import_zod12.z.array(import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()))]), DataEngineInsertOptionsSchema.optional()).returns(import_zod12.z.promise(import_zod12.z.any())),
|
|
1538
|
+
update: import_zod12.z.function().args(import_zod12.z.string(), import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()), DataEngineUpdateOptionsSchema.optional()).returns(import_zod12.z.promise(import_zod12.z.any())),
|
|
1539
|
+
delete: import_zod12.z.function().args(import_zod12.z.string(), DataEngineDeleteOptionsSchema.optional()).returns(import_zod12.z.promise(import_zod12.z.any())),
|
|
1540
|
+
count: import_zod12.z.function().args(import_zod12.z.string(), DataEngineCountOptionsSchema.optional()).returns(import_zod12.z.promise(import_zod12.z.number())),
|
|
1541
|
+
aggregate: import_zod12.z.function().args(import_zod12.z.string(), DataEngineAggregateOptionsSchema).returns(import_zod12.z.promise(import_zod12.z.array(import_zod12.z.any())))
|
|
1442
1542
|
}).describe("Standard Data Engine Contract");
|
|
1443
|
-
var DataEngineFindRequestSchema =
|
|
1444
|
-
method:
|
|
1445
|
-
object:
|
|
1543
|
+
var DataEngineFindRequestSchema = import_zod12.z.object({
|
|
1544
|
+
method: import_zod12.z.literal("find"),
|
|
1545
|
+
object: import_zod12.z.string(),
|
|
1446
1546
|
query: DataEngineQueryOptionsSchema.optional()
|
|
1447
1547
|
});
|
|
1448
|
-
var DataEngineFindOneRequestSchema =
|
|
1449
|
-
method:
|
|
1450
|
-
object:
|
|
1548
|
+
var DataEngineFindOneRequestSchema = import_zod12.z.object({
|
|
1549
|
+
method: import_zod12.z.literal("findOne"),
|
|
1550
|
+
object: import_zod12.z.string(),
|
|
1451
1551
|
query: DataEngineQueryOptionsSchema.optional()
|
|
1452
1552
|
});
|
|
1453
|
-
var DataEngineInsertRequestSchema =
|
|
1454
|
-
method:
|
|
1455
|
-
object:
|
|
1456
|
-
data:
|
|
1553
|
+
var DataEngineInsertRequestSchema = import_zod12.z.object({
|
|
1554
|
+
method: import_zod12.z.literal("insert"),
|
|
1555
|
+
object: import_zod12.z.string(),
|
|
1556
|
+
data: import_zod12.z.union([import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()), import_zod12.z.array(import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()))]),
|
|
1457
1557
|
options: DataEngineInsertOptionsSchema.optional()
|
|
1458
1558
|
});
|
|
1459
|
-
var DataEngineUpdateRequestSchema =
|
|
1460
|
-
method:
|
|
1461
|
-
object:
|
|
1462
|
-
data:
|
|
1463
|
-
id:
|
|
1559
|
+
var DataEngineUpdateRequestSchema = import_zod12.z.object({
|
|
1560
|
+
method: import_zod12.z.literal("update"),
|
|
1561
|
+
object: import_zod12.z.string(),
|
|
1562
|
+
data: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()),
|
|
1563
|
+
id: import_zod12.z.any().optional().describe("ID for single update, or use filter in options"),
|
|
1464
1564
|
options: DataEngineUpdateOptionsSchema.optional()
|
|
1465
1565
|
});
|
|
1466
|
-
var DataEngineDeleteRequestSchema =
|
|
1467
|
-
method:
|
|
1468
|
-
object:
|
|
1469
|
-
id:
|
|
1566
|
+
var DataEngineDeleteRequestSchema = import_zod12.z.object({
|
|
1567
|
+
method: import_zod12.z.literal("delete"),
|
|
1568
|
+
object: import_zod12.z.string(),
|
|
1569
|
+
id: import_zod12.z.any().optional().describe("ID for single delete, or use filter in options"),
|
|
1470
1570
|
options: DataEngineDeleteOptionsSchema.optional()
|
|
1471
1571
|
});
|
|
1472
|
-
var DataEngineCountRequestSchema =
|
|
1473
|
-
method:
|
|
1474
|
-
object:
|
|
1572
|
+
var DataEngineCountRequestSchema = import_zod12.z.object({
|
|
1573
|
+
method: import_zod12.z.literal("count"),
|
|
1574
|
+
object: import_zod12.z.string(),
|
|
1475
1575
|
query: DataEngineCountOptionsSchema.optional()
|
|
1476
1576
|
});
|
|
1477
|
-
var DataEngineAggregateRequestSchema =
|
|
1478
|
-
method:
|
|
1479
|
-
object:
|
|
1577
|
+
var DataEngineAggregateRequestSchema = import_zod12.z.object({
|
|
1578
|
+
method: import_zod12.z.literal("aggregate"),
|
|
1579
|
+
object: import_zod12.z.string(),
|
|
1480
1580
|
query: DataEngineAggregateOptionsSchema
|
|
1481
1581
|
});
|
|
1482
|
-
var DataEngineExecuteRequestSchema =
|
|
1483
|
-
method:
|
|
1582
|
+
var DataEngineExecuteRequestSchema = import_zod12.z.object({
|
|
1583
|
+
method: import_zod12.z.literal("execute"),
|
|
1484
1584
|
/** The abstract command (string SQL, or JSON object) */
|
|
1485
|
-
command:
|
|
1585
|
+
command: import_zod12.z.any(),
|
|
1486
1586
|
/** Optional options */
|
|
1487
|
-
options:
|
|
1587
|
+
options: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()).optional()
|
|
1488
1588
|
});
|
|
1489
|
-
var DataEngineVectorFindRequestSchema =
|
|
1490
|
-
method:
|
|
1491
|
-
object:
|
|
1589
|
+
var DataEngineVectorFindRequestSchema = import_zod12.z.object({
|
|
1590
|
+
method: import_zod12.z.literal("vectorFind"),
|
|
1591
|
+
object: import_zod12.z.string(),
|
|
1492
1592
|
/** The vector embedding to search for */
|
|
1493
|
-
vector:
|
|
1593
|
+
vector: import_zod12.z.array(import_zod12.z.number()),
|
|
1494
1594
|
/** Optional pre-filter (Metadata filtering) */
|
|
1495
1595
|
filter: DataEngineFilterSchema.optional(),
|
|
1496
1596
|
/** Fields to select */
|
|
1497
|
-
select:
|
|
1597
|
+
select: import_zod12.z.array(import_zod12.z.string()).optional(),
|
|
1498
1598
|
/** Number of results */
|
|
1499
|
-
limit:
|
|
1599
|
+
limit: import_zod12.z.number().int().default(5).optional(),
|
|
1500
1600
|
/** Minimum similarity score (0-1) or distance threshold */
|
|
1501
|
-
threshold:
|
|
1601
|
+
threshold: import_zod12.z.number().optional()
|
|
1502
1602
|
});
|
|
1503
|
-
var DataEngineBatchRequestSchema =
|
|
1504
|
-
method:
|
|
1505
|
-
requests:
|
|
1603
|
+
var DataEngineBatchRequestSchema = import_zod12.z.object({
|
|
1604
|
+
method: import_zod12.z.literal("batch"),
|
|
1605
|
+
requests: import_zod12.z.array(import_zod12.z.discriminatedUnion("method", [
|
|
1506
1606
|
DataEngineFindRequestSchema,
|
|
1507
1607
|
DataEngineFindOneRequestSchema,
|
|
1508
1608
|
DataEngineInsertRequestSchema,
|
|
@@ -1518,9 +1618,9 @@ var DataEngineBatchRequestSchema = import_zod11.z.object({
|
|
|
1518
1618
|
* - true: All or nothing (Atomic)
|
|
1519
1619
|
* - false: Best effort, continue on error
|
|
1520
1620
|
*/
|
|
1521
|
-
transaction:
|
|
1621
|
+
transaction: import_zod12.z.boolean().default(true).optional()
|
|
1522
1622
|
});
|
|
1523
|
-
var DataEngineRequestSchema =
|
|
1623
|
+
var DataEngineRequestSchema = import_zod12.z.discriminatedUnion("method", [
|
|
1524
1624
|
DataEngineFindRequestSchema,
|
|
1525
1625
|
DataEngineFindOneRequestSchema,
|
|
1526
1626
|
DataEngineInsertRequestSchema,
|
|
@@ -1534,67 +1634,67 @@ var DataEngineRequestSchema = import_zod11.z.discriminatedUnion("method", [
|
|
|
1534
1634
|
]).describe("Virtual ObjectQL Request Protocol");
|
|
1535
1635
|
|
|
1536
1636
|
// src/data/driver.zod.ts
|
|
1537
|
-
var
|
|
1538
|
-
var DriverOptionsSchema =
|
|
1637
|
+
var import_zod13 = require("zod");
|
|
1638
|
+
var DriverOptionsSchema = import_zod13.z.object({
|
|
1539
1639
|
/**
|
|
1540
1640
|
* Transaction handle/identifier.
|
|
1541
1641
|
* If provided, the operation must run within this transaction.
|
|
1542
1642
|
*/
|
|
1543
|
-
transaction:
|
|
1643
|
+
transaction: import_zod13.z.any().optional().describe("Transaction handle"),
|
|
1544
1644
|
/**
|
|
1545
1645
|
* Operation timeout in milliseconds.
|
|
1546
1646
|
*/
|
|
1547
|
-
timeout:
|
|
1647
|
+
timeout: import_zod13.z.number().optional().describe("Timeout in ms"),
|
|
1548
1648
|
/**
|
|
1549
1649
|
* Whether to bypass cache and force a fresh read.
|
|
1550
1650
|
*/
|
|
1551
|
-
skipCache:
|
|
1651
|
+
skipCache: import_zod13.z.boolean().optional().describe("Bypass cache"),
|
|
1552
1652
|
/**
|
|
1553
1653
|
* Distributed Tracing Context.
|
|
1554
1654
|
* Used for passing OpenTelemetry span context or request IDs for observability.
|
|
1555
1655
|
*/
|
|
1556
|
-
traceContext:
|
|
1656
|
+
traceContext: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.string()).optional().describe("OpenTelemetry context or request ID"),
|
|
1557
1657
|
/**
|
|
1558
1658
|
* Tenant Identifier.
|
|
1559
1659
|
* For multi-tenant databases (row-level security or schema-per-tenant).
|
|
1560
1660
|
*/
|
|
1561
|
-
tenantId:
|
|
1661
|
+
tenantId: import_zod13.z.string().optional().describe("Tenant Isolation identifier")
|
|
1562
1662
|
});
|
|
1563
|
-
var DriverCapabilitiesSchema =
|
|
1663
|
+
var DriverCapabilitiesSchema = import_zod13.z.object({
|
|
1564
1664
|
// ============================================================================
|
|
1565
1665
|
// Basic CRUD Operations
|
|
1566
1666
|
// ============================================================================
|
|
1567
1667
|
/**
|
|
1568
1668
|
* Whether the driver supports create operations.
|
|
1569
1669
|
*/
|
|
1570
|
-
create:
|
|
1670
|
+
create: import_zod13.z.boolean().default(true).describe("Supports CREATE operations"),
|
|
1571
1671
|
/**
|
|
1572
1672
|
* Whether the driver supports read operations.
|
|
1573
1673
|
*/
|
|
1574
|
-
read:
|
|
1674
|
+
read: import_zod13.z.boolean().default(true).describe("Supports READ operations"),
|
|
1575
1675
|
/**
|
|
1576
1676
|
* Whether the driver supports update operations.
|
|
1577
1677
|
*/
|
|
1578
|
-
update:
|
|
1678
|
+
update: import_zod13.z.boolean().default(true).describe("Supports UPDATE operations"),
|
|
1579
1679
|
/**
|
|
1580
1680
|
* Whether the driver supports delete operations.
|
|
1581
1681
|
*/
|
|
1582
|
-
delete:
|
|
1682
|
+
delete: import_zod13.z.boolean().default(true).describe("Supports DELETE operations"),
|
|
1583
1683
|
// ============================================================================
|
|
1584
1684
|
// Bulk Operations
|
|
1585
1685
|
// ============================================================================
|
|
1586
1686
|
/**
|
|
1587
1687
|
* Whether the driver supports bulk create operations.
|
|
1588
1688
|
*/
|
|
1589
|
-
bulkCreate:
|
|
1689
|
+
bulkCreate: import_zod13.z.boolean().default(false).describe("Supports bulk CREATE operations"),
|
|
1590
1690
|
/**
|
|
1591
1691
|
* Whether the driver supports bulk update operations.
|
|
1592
1692
|
*/
|
|
1593
|
-
bulkUpdate:
|
|
1693
|
+
bulkUpdate: import_zod13.z.boolean().default(false).describe("Supports bulk UPDATE operations"),
|
|
1594
1694
|
/**
|
|
1595
1695
|
* Whether the driver supports bulk delete operations.
|
|
1596
1696
|
*/
|
|
1597
|
-
bulkDelete:
|
|
1697
|
+
bulkDelete: import_zod13.z.boolean().default(false).describe("Supports bulk DELETE operations"),
|
|
1598
1698
|
// ============================================================================
|
|
1599
1699
|
// Transaction & Connection Management
|
|
1600
1700
|
// ============================================================================
|
|
@@ -1602,15 +1702,15 @@ var DriverCapabilitiesSchema = import_zod12.z.object({
|
|
|
1602
1702
|
* Whether the driver supports database transactions.
|
|
1603
1703
|
* If true, beginTransaction, commit, and rollback must be implemented.
|
|
1604
1704
|
*/
|
|
1605
|
-
transactions:
|
|
1705
|
+
transactions: import_zod13.z.boolean().default(false).describe("Supports ACID transactions"),
|
|
1606
1706
|
/**
|
|
1607
1707
|
* Whether the driver supports savepoints within transactions.
|
|
1608
1708
|
*/
|
|
1609
|
-
savepoints:
|
|
1709
|
+
savepoints: import_zod13.z.boolean().default(false).describe("Supports transaction savepoints"),
|
|
1610
1710
|
/**
|
|
1611
1711
|
* Supported transaction isolation levels.
|
|
1612
1712
|
*/
|
|
1613
|
-
isolationLevels:
|
|
1713
|
+
isolationLevels: import_zod13.z.array(import_zod13.z.enum([
|
|
1614
1714
|
"read-uncommitted",
|
|
1615
1715
|
"read-committed",
|
|
1616
1716
|
"repeatable-read",
|
|
@@ -1625,41 +1725,41 @@ var DriverCapabilitiesSchema = import_zod12.z.object({
|
|
|
1625
1725
|
*
|
|
1626
1726
|
* Example: Memory driver might not support complex filter conditions.
|
|
1627
1727
|
*/
|
|
1628
|
-
queryFilters:
|
|
1728
|
+
queryFilters: import_zod13.z.boolean().default(true).describe("Supports WHERE clause filtering"),
|
|
1629
1729
|
/**
|
|
1630
1730
|
* Whether the driver supports aggregation functions (COUNT, SUM, AVG, etc.).
|
|
1631
1731
|
* If false, ObjectQL will compute aggregations in memory.
|
|
1632
1732
|
*/
|
|
1633
|
-
queryAggregations:
|
|
1733
|
+
queryAggregations: import_zod13.z.boolean().default(false).describe("Supports GROUP BY and aggregation functions"),
|
|
1634
1734
|
/**
|
|
1635
1735
|
* Whether the driver supports ORDER BY sorting.
|
|
1636
1736
|
* If false, ObjectQL will sort results in memory.
|
|
1637
1737
|
*/
|
|
1638
|
-
querySorting:
|
|
1738
|
+
querySorting: import_zod13.z.boolean().default(true).describe("Supports ORDER BY sorting"),
|
|
1639
1739
|
/**
|
|
1640
1740
|
* Whether the driver supports LIMIT/OFFSET pagination.
|
|
1641
1741
|
* If false, ObjectQL will fetch all records and paginate in memory.
|
|
1642
1742
|
*/
|
|
1643
|
-
queryPagination:
|
|
1743
|
+
queryPagination: import_zod13.z.boolean().default(true).describe("Supports LIMIT/OFFSET pagination"),
|
|
1644
1744
|
/**
|
|
1645
1745
|
* Whether the driver supports window functions (ROW_NUMBER, RANK, LAG, LEAD, etc.).
|
|
1646
1746
|
* If false, ObjectQL will compute window functions in memory.
|
|
1647
1747
|
*/
|
|
1648
|
-
queryWindowFunctions:
|
|
1748
|
+
queryWindowFunctions: import_zod13.z.boolean().default(false).describe("Supports window functions with OVER clause"),
|
|
1649
1749
|
/**
|
|
1650
1750
|
* Whether the driver supports subqueries (nested SELECT statements).
|
|
1651
1751
|
* If false, ObjectQL will execute queries separately and combine results.
|
|
1652
1752
|
*/
|
|
1653
|
-
querySubqueries:
|
|
1753
|
+
querySubqueries: import_zod13.z.boolean().default(false).describe("Supports subqueries"),
|
|
1654
1754
|
/**
|
|
1655
1755
|
* Whether the driver supports Common Table Expressions (WITH clause).
|
|
1656
1756
|
*/
|
|
1657
|
-
queryCTE:
|
|
1757
|
+
queryCTE: import_zod13.z.boolean().default(false).describe("Supports Common Table Expressions (WITH clause)"),
|
|
1658
1758
|
/**
|
|
1659
1759
|
* Whether the driver supports SQL-style joins.
|
|
1660
1760
|
* If false, ObjectQL will fetch related data separately and join in memory.
|
|
1661
1761
|
*/
|
|
1662
|
-
joins:
|
|
1762
|
+
joins: import_zod13.z.boolean().default(false).describe("Supports SQL joins"),
|
|
1663
1763
|
// ============================================================================
|
|
1664
1764
|
// Advanced Features
|
|
1665
1765
|
// ============================================================================
|
|
@@ -1667,69 +1767,69 @@ var DriverCapabilitiesSchema = import_zod12.z.object({
|
|
|
1667
1767
|
* Whether the driver supports full-text search.
|
|
1668
1768
|
* If true, text search queries can be pushed to the database.
|
|
1669
1769
|
*/
|
|
1670
|
-
fullTextSearch:
|
|
1770
|
+
fullTextSearch: import_zod13.z.boolean().default(false).describe("Supports full-text search"),
|
|
1671
1771
|
/**
|
|
1672
1772
|
* Whether the driver supports JSON querying capabilities.
|
|
1673
1773
|
*/
|
|
1674
|
-
jsonQuery:
|
|
1774
|
+
jsonQuery: import_zod13.z.boolean().default(false).describe("Supports JSON field querying"),
|
|
1675
1775
|
/**
|
|
1676
1776
|
* Whether the driver supports geospatial queries.
|
|
1677
1777
|
*/
|
|
1678
|
-
geospatialQuery:
|
|
1778
|
+
geospatialQuery: import_zod13.z.boolean().default(false).describe("Supports geospatial queries"),
|
|
1679
1779
|
/**
|
|
1680
1780
|
* Whether the driver supports streaming large result sets.
|
|
1681
1781
|
*/
|
|
1682
|
-
streaming:
|
|
1782
|
+
streaming: import_zod13.z.boolean().default(false).describe("Supports result streaming (cursors/iterators)"),
|
|
1683
1783
|
/**
|
|
1684
1784
|
* Whether the driver supports JSON field types.
|
|
1685
1785
|
* If false, JSON data will be serialized as strings.
|
|
1686
1786
|
*/
|
|
1687
|
-
jsonFields:
|
|
1787
|
+
jsonFields: import_zod13.z.boolean().default(false).describe("Supports JSON field types"),
|
|
1688
1788
|
/**
|
|
1689
1789
|
* Whether the driver supports array field types.
|
|
1690
1790
|
* If false, arrays will be stored as JSON strings or in separate tables.
|
|
1691
1791
|
*/
|
|
1692
|
-
arrayFields:
|
|
1792
|
+
arrayFields: import_zod13.z.boolean().default(false).describe("Supports array field types"),
|
|
1693
1793
|
/**
|
|
1694
1794
|
* Whether the driver supports vector embeddings and similarity search.
|
|
1695
1795
|
* Required for RAG (Retrieval-Augmented Generation) and AI features.
|
|
1696
1796
|
*/
|
|
1697
|
-
vectorSearch:
|
|
1797
|
+
vectorSearch: import_zod13.z.boolean().default(false).describe("Supports vector embeddings and similarity search"),
|
|
1698
1798
|
/**
|
|
1699
1799
|
* Whether the driver supports geospatial queries.
|
|
1700
1800
|
* @deprecated Use geospatialQuery instead
|
|
1701
1801
|
*/
|
|
1702
|
-
geoSpatial:
|
|
1802
|
+
geoSpatial: import_zod13.z.boolean().default(false).describe("Supports geospatial queries (deprecated: use geospatialQuery)"),
|
|
1703
1803
|
// ============================================================================
|
|
1704
1804
|
// Schema Management
|
|
1705
1805
|
// ============================================================================
|
|
1706
1806
|
/**
|
|
1707
1807
|
* Whether the driver supports automatic schema synchronization.
|
|
1708
1808
|
*/
|
|
1709
|
-
schemaSync:
|
|
1809
|
+
schemaSync: import_zod13.z.boolean().default(false).describe("Supports automatic schema synchronization"),
|
|
1710
1810
|
/**
|
|
1711
1811
|
* Whether the driver supports database migrations.
|
|
1712
1812
|
*/
|
|
1713
|
-
migrations:
|
|
1813
|
+
migrations: import_zod13.z.boolean().default(false).describe("Supports database migrations"),
|
|
1714
1814
|
/**
|
|
1715
1815
|
* Whether the driver supports index management.
|
|
1716
1816
|
*/
|
|
1717
|
-
indexes:
|
|
1817
|
+
indexes: import_zod13.z.boolean().default(false).describe("Supports index creation and management"),
|
|
1718
1818
|
// ============================================================================
|
|
1719
1819
|
// Performance & Optimization
|
|
1720
1820
|
// ============================================================================
|
|
1721
1821
|
/**
|
|
1722
1822
|
* Whether the driver supports connection pooling.
|
|
1723
1823
|
*/
|
|
1724
|
-
connectionPooling:
|
|
1824
|
+
connectionPooling: import_zod13.z.boolean().default(false).describe("Supports connection pooling"),
|
|
1725
1825
|
/**
|
|
1726
1826
|
* Whether the driver supports prepared statements.
|
|
1727
1827
|
*/
|
|
1728
|
-
preparedStatements:
|
|
1828
|
+
preparedStatements: import_zod13.z.boolean().default(false).describe("Supports prepared statements (SQL injection prevention)"),
|
|
1729
1829
|
/**
|
|
1730
1830
|
* Whether the driver supports query result caching.
|
|
1731
1831
|
*/
|
|
1732
|
-
queryCache:
|
|
1832
|
+
queryCache: import_zod13.z.boolean().default(false).describe("Supports query result caching")
|
|
1733
1833
|
}).refine((data) => {
|
|
1734
1834
|
if (data.geoSpatial !== void 0 && data.geospatialQuery !== void 0 && data.geoSpatial !== data.geospatialQuery) {
|
|
1735
1835
|
return false;
|
|
@@ -1738,15 +1838,15 @@ var DriverCapabilitiesSchema = import_zod12.z.object({
|
|
|
1738
1838
|
}, {
|
|
1739
1839
|
message: "Deprecated geoSpatial and geospatialQuery must have the same value if both are provided"
|
|
1740
1840
|
});
|
|
1741
|
-
var DriverInterfaceSchema =
|
|
1841
|
+
var DriverInterfaceSchema = import_zod13.z.object({
|
|
1742
1842
|
/**
|
|
1743
1843
|
* Driver name (e.g., 'postgresql', 'mongodb', 'rest_api').
|
|
1744
1844
|
*/
|
|
1745
|
-
name:
|
|
1845
|
+
name: import_zod13.z.string().describe("Driver unique name"),
|
|
1746
1846
|
/**
|
|
1747
1847
|
* Driver version.
|
|
1748
1848
|
*/
|
|
1749
|
-
version:
|
|
1849
|
+
version: import_zod13.z.string().describe("Driver version"),
|
|
1750
1850
|
/**
|
|
1751
1851
|
* Capabilities descriptor.
|
|
1752
1852
|
*/
|
|
@@ -1757,25 +1857,25 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1757
1857
|
/**
|
|
1758
1858
|
* Initialize connection pool or authenticate.
|
|
1759
1859
|
*/
|
|
1760
|
-
connect:
|
|
1860
|
+
connect: import_zod13.z.function().args().returns(import_zod13.z.promise(import_zod13.z.void())).describe("Establish connection"),
|
|
1761
1861
|
/**
|
|
1762
1862
|
* Close connections and cleanup resources.
|
|
1763
1863
|
*/
|
|
1764
|
-
disconnect:
|
|
1864
|
+
disconnect: import_zod13.z.function().args().returns(import_zod13.z.promise(import_zod13.z.void())).describe("Close connection"),
|
|
1765
1865
|
/**
|
|
1766
1866
|
* Check connection health.
|
|
1767
1867
|
* @returns true if healthy, false otherwise.
|
|
1768
1868
|
*/
|
|
1769
|
-
checkHealth:
|
|
1869
|
+
checkHealth: import_zod13.z.function().args().returns(import_zod13.z.promise(import_zod13.z.boolean())).describe("Health check"),
|
|
1770
1870
|
/**
|
|
1771
1871
|
* Get Connection Pool Statistics.
|
|
1772
1872
|
* Useful for monitoring database load.
|
|
1773
1873
|
*/
|
|
1774
|
-
getPoolStats:
|
|
1775
|
-
total:
|
|
1776
|
-
idle:
|
|
1777
|
-
active:
|
|
1778
|
-
waiting:
|
|
1874
|
+
getPoolStats: import_zod13.z.function().args().returns(import_zod13.z.object({
|
|
1875
|
+
total: import_zod13.z.number(),
|
|
1876
|
+
idle: import_zod13.z.number(),
|
|
1877
|
+
active: import_zod13.z.number(),
|
|
1878
|
+
waiting: import_zod13.z.number()
|
|
1779
1879
|
}).optional()).optional().describe("Get connection pool statistics"),
|
|
1780
1880
|
// ============================================================================
|
|
1781
1881
|
// Raw Execution (Escape Hatch)
|
|
@@ -1796,7 +1896,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1796
1896
|
* // Mongo Driver
|
|
1797
1897
|
* await driver.execute({ aggregate: 'orders', pipeline: [...] });
|
|
1798
1898
|
*/
|
|
1799
|
-
execute:
|
|
1899
|
+
execute: import_zod13.z.function().args(import_zod13.z.any(), import_zod13.z.array(import_zod13.z.any()).optional(), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.any())).describe("Execute raw command"),
|
|
1800
1900
|
// ============================================================================
|
|
1801
1901
|
// CRUD Operations
|
|
1802
1902
|
// ============================================================================
|
|
@@ -1818,7 +1918,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1818
1918
|
* @returns Array of records.
|
|
1819
1919
|
* MUST return `id` as string. MUST NOT return implementation details like `_id`.
|
|
1820
1920
|
*/
|
|
1821
|
-
find:
|
|
1921
|
+
find: import_zod13.z.function().args(import_zod13.z.string(), QuerySchema, DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.array(import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any())))).describe("Find records"),
|
|
1822
1922
|
/**
|
|
1823
1923
|
* Stream records matching the structured query.
|
|
1824
1924
|
* Optimized for large datasets to avoid memory overflow.
|
|
@@ -1828,7 +1928,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1828
1928
|
* @param options - Driver options.
|
|
1829
1929
|
* @returns AsyncIterable/ReadableStream of records.
|
|
1830
1930
|
*/
|
|
1831
|
-
findStream:
|
|
1931
|
+
findStream: import_zod13.z.function().args(import_zod13.z.string(), QuerySchema, DriverOptionsSchema.optional()).returns(import_zod13.z.any()).describe("Stream records (AsyncIterable)"),
|
|
1832
1932
|
/**
|
|
1833
1933
|
* Find a single record by query.
|
|
1834
1934
|
* Similar to find(), but returns only the first match or null.
|
|
@@ -1839,7 +1939,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1839
1939
|
* @returns The record or null.
|
|
1840
1940
|
* MUST return `id` as string. MUST NOT return implementation details like `_id`.
|
|
1841
1941
|
*/
|
|
1842
|
-
findOne:
|
|
1942
|
+
findOne: import_zod13.z.function().args(import_zod13.z.string(), QuerySchema, DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()).nullable())).describe("Find one record"),
|
|
1843
1943
|
/**
|
|
1844
1944
|
* Create a new record.
|
|
1845
1945
|
*
|
|
@@ -1849,7 +1949,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1849
1949
|
* @returns The created record, including server-generated fields (id, created_at, etc.).
|
|
1850
1950
|
* MUST return `id` as string. MUST NOT return implementation details like `_id`.
|
|
1851
1951
|
*/
|
|
1852
|
-
create:
|
|
1952
|
+
create: import_zod13.z.function().args(import_zod13.z.string(), import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()))).describe("Create record"),
|
|
1853
1953
|
/**
|
|
1854
1954
|
* Update an existing record by ID.
|
|
1855
1955
|
*
|
|
@@ -1860,7 +1960,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1860
1960
|
* @returns The updated record.
|
|
1861
1961
|
* MUST return `id` as string. MUST NOT return implementation details like `_id`.
|
|
1862
1962
|
*/
|
|
1863
|
-
update:
|
|
1963
|
+
update: import_zod13.z.function().args(import_zod13.z.string(), import_zod13.z.string().or(import_zod13.z.number()), import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()))).describe("Update record"),
|
|
1864
1964
|
/**
|
|
1865
1965
|
* Upsert (Update or Insert) a record.
|
|
1866
1966
|
*
|
|
@@ -1870,7 +1970,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1870
1970
|
* @param options - Driver options.
|
|
1871
1971
|
* @returns The created or updated record.
|
|
1872
1972
|
*/
|
|
1873
|
-
upsert:
|
|
1973
|
+
upsert: import_zod13.z.function().args(import_zod13.z.string(), import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()), import_zod13.z.array(import_zod13.z.string()).optional(), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()))).describe("Upsert record"),
|
|
1874
1974
|
/**
|
|
1875
1975
|
* Delete a record by ID.
|
|
1876
1976
|
*
|
|
@@ -1879,7 +1979,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1879
1979
|
* @param options - Driver options.
|
|
1880
1980
|
* @returns True if deleted, false if not found.
|
|
1881
1981
|
*/
|
|
1882
|
-
delete:
|
|
1982
|
+
delete: import_zod13.z.function().args(import_zod13.z.string(), import_zod13.z.string().or(import_zod13.z.number()), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.boolean())).describe("Delete record"),
|
|
1883
1983
|
/**
|
|
1884
1984
|
* Count records matching a query.
|
|
1885
1985
|
*
|
|
@@ -1888,7 +1988,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1888
1988
|
* @param options - Driver options.
|
|
1889
1989
|
* @returns Total count.
|
|
1890
1990
|
*/
|
|
1891
|
-
count:
|
|
1991
|
+
count: import_zod13.z.function().args(import_zod13.z.string(), QuerySchema.optional(), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.number())).describe("Count records"),
|
|
1892
1992
|
// ============================================================================
|
|
1893
1993
|
// Bulk Operations
|
|
1894
1994
|
// ============================================================================
|
|
@@ -1900,7 +2000,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1900
2000
|
* @param dataArray - Array of record data.
|
|
1901
2001
|
* @returns Array of created records.
|
|
1902
2002
|
*/
|
|
1903
|
-
bulkCreate:
|
|
2003
|
+
bulkCreate: import_zod13.z.function().args(import_zod13.z.string(), import_zod13.z.array(import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any())), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.array(import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any())))),
|
|
1904
2004
|
/**
|
|
1905
2005
|
* Update multiple records in a single batch.
|
|
1906
2006
|
*
|
|
@@ -1908,14 +2008,14 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1908
2008
|
* @param updates - Array of objects containing {id, data}.
|
|
1909
2009
|
* @returns Array of updated records.
|
|
1910
2010
|
*/
|
|
1911
|
-
bulkUpdate:
|
|
2011
|
+
bulkUpdate: import_zod13.z.function().args(import_zod13.z.string(), import_zod13.z.array(import_zod13.z.object({ id: import_zod13.z.string().or(import_zod13.z.number()), data: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()) })), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.array(import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any())))),
|
|
1912
2012
|
/**
|
|
1913
2013
|
* Delete multiple records in a single batch.
|
|
1914
2014
|
*
|
|
1915
2015
|
* @param object - The object name.
|
|
1916
2016
|
* @param ids - Array of record IDs.
|
|
1917
2017
|
*/
|
|
1918
|
-
bulkDelete:
|
|
2018
|
+
bulkDelete: import_zod13.z.function().args(import_zod13.z.string(), import_zod13.z.array(import_zod13.z.string().or(import_zod13.z.number())), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.void())),
|
|
1919
2019
|
/**
|
|
1920
2020
|
* Update multiple records matching a query.
|
|
1921
2021
|
* Direct database push-down. DOES NOT trigger per-record hooks.
|
|
@@ -1925,7 +2025,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1925
2025
|
* @param data - The data to update.
|
|
1926
2026
|
* @returns Count of modified records.
|
|
1927
2027
|
*/
|
|
1928
|
-
updateMany:
|
|
2028
|
+
updateMany: import_zod13.z.function().args(import_zod13.z.string(), QuerySchema, import_zod13.z.record(import_zod13.z.string(), import_zod13.z.any()), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.number())).optional(),
|
|
1929
2029
|
/**
|
|
1930
2030
|
* Delete multiple records matching a query.
|
|
1931
2031
|
* Direct database push-down. DOES NOT trigger per-record hooks.
|
|
@@ -1934,7 +2034,7 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1934
2034
|
* @param query - The filtering criteria.
|
|
1935
2035
|
* @returns Count of deleted records.
|
|
1936
2036
|
*/
|
|
1937
|
-
deleteMany:
|
|
2037
|
+
deleteMany: import_zod13.z.function().args(import_zod13.z.string(), QuerySchema, DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.number())).optional(),
|
|
1938
2038
|
// ============================================================================
|
|
1939
2039
|
// Transaction Management
|
|
1940
2040
|
// ============================================================================
|
|
@@ -1943,19 +2043,19 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1943
2043
|
* @param options - Isolation level and other settings.
|
|
1944
2044
|
* @returns A transaction handle to be passed to subsequent operations via `options.transaction`.
|
|
1945
2045
|
*/
|
|
1946
|
-
beginTransaction:
|
|
1947
|
-
isolationLevel:
|
|
1948
|
-
}).optional()).returns(
|
|
2046
|
+
beginTransaction: import_zod13.z.function().args(import_zod13.z.object({
|
|
2047
|
+
isolationLevel: import_zod13.z.enum(["READ UNCOMMITTED", "READ COMMITTED", "REPEATABLE READ", "SERIALIZABLE", "SNAPSHOT"]).optional()
|
|
2048
|
+
}).optional()).returns(import_zod13.z.promise(import_zod13.z.any())).describe("Start transaction"),
|
|
1949
2049
|
/**
|
|
1950
2050
|
* Commit the transaction.
|
|
1951
2051
|
* @param transaction - The transaction handle.
|
|
1952
2052
|
*/
|
|
1953
|
-
commit:
|
|
2053
|
+
commit: import_zod13.z.function().args(import_zod13.z.any()).returns(import_zod13.z.promise(import_zod13.z.void())).describe("Commit transaction"),
|
|
1954
2054
|
/**
|
|
1955
2055
|
* Rollback the transaction.
|
|
1956
2056
|
* @param transaction - The transaction handle.
|
|
1957
2057
|
*/
|
|
1958
|
-
rollback:
|
|
2058
|
+
rollback: import_zod13.z.function().args(import_zod13.z.any()).returns(import_zod13.z.promise(import_zod13.z.void())).describe("Rollback transaction"),
|
|
1959
2059
|
// ============================================================================
|
|
1960
2060
|
// Schema Management
|
|
1961
2061
|
// ============================================================================
|
|
@@ -1968,14 +2068,14 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1968
2068
|
* @param schema - The full Object Schema (fields, indexes, etc).
|
|
1969
2069
|
* @param options - Driver options.
|
|
1970
2070
|
*/
|
|
1971
|
-
syncSchema:
|
|
2071
|
+
syncSchema: import_zod13.z.function().args(import_zod13.z.string(), import_zod13.z.any(), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.void())).describe("Sync object schema to DB"),
|
|
1972
2072
|
/**
|
|
1973
2073
|
* Drop the underlying table or collection for an object.
|
|
1974
2074
|
* WARNING: Destructive operation.
|
|
1975
2075
|
*
|
|
1976
2076
|
* @param object - The object name.
|
|
1977
2077
|
*/
|
|
1978
|
-
dropTable:
|
|
2078
|
+
dropTable: import_zod13.z.function().args(import_zod13.z.string(), DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.void())),
|
|
1979
2079
|
/**
|
|
1980
2080
|
* Analyze query performance.
|
|
1981
2081
|
* Returns execution plan without executing the query (where possible).
|
|
@@ -1984,25 +2084,25 @@ var DriverInterfaceSchema = import_zod12.z.object({
|
|
|
1984
2084
|
* @param query - The query to explain.
|
|
1985
2085
|
* @returns The execution plan details.
|
|
1986
2086
|
*/
|
|
1987
|
-
explain:
|
|
2087
|
+
explain: import_zod13.z.function().args(import_zod13.z.string(), QuerySchema, DriverOptionsSchema.optional()).returns(import_zod13.z.promise(import_zod13.z.any())).optional()
|
|
1988
2088
|
});
|
|
1989
|
-
var PoolConfigSchema =
|
|
1990
|
-
min:
|
|
1991
|
-
max:
|
|
1992
|
-
idleTimeoutMillis:
|
|
1993
|
-
connectionTimeoutMillis:
|
|
2089
|
+
var PoolConfigSchema = import_zod13.z.object({
|
|
2090
|
+
min: import_zod13.z.number().min(0).default(2).describe("Minimum number of connections in pool"),
|
|
2091
|
+
max: import_zod13.z.number().min(1).default(10).describe("Maximum number of connections in pool"),
|
|
2092
|
+
idleTimeoutMillis: import_zod13.z.number().min(0).default(3e4).describe("Time in ms before idle connection is closed"),
|
|
2093
|
+
connectionTimeoutMillis: import_zod13.z.number().min(0).default(5e3).describe("Time in ms to wait for available connection")
|
|
1994
2094
|
});
|
|
1995
|
-
var DriverConfigSchema =
|
|
1996
|
-
name:
|
|
1997
|
-
type:
|
|
2095
|
+
var DriverConfigSchema = import_zod13.z.object({
|
|
2096
|
+
name: import_zod13.z.string().describe("Driver instance name"),
|
|
2097
|
+
type: import_zod13.z.enum(["sql", "nosql", "cache", "search", "graph", "timeseries"]).describe("Driver type category"),
|
|
1998
2098
|
capabilities: DriverCapabilitiesSchema.describe("Driver capability flags"),
|
|
1999
|
-
connectionString:
|
|
2099
|
+
connectionString: import_zod13.z.string().optional().describe("Database connection string (driver-specific format)"),
|
|
2000
2100
|
poolConfig: PoolConfigSchema.optional().describe("Connection pool configuration")
|
|
2001
2101
|
});
|
|
2002
2102
|
|
|
2003
2103
|
// src/data/driver-sql.zod.ts
|
|
2004
|
-
var
|
|
2005
|
-
var SQLDialectSchema =
|
|
2104
|
+
var import_zod14 = require("zod");
|
|
2105
|
+
var SQLDialectSchema = import_zod14.z.enum([
|
|
2006
2106
|
"postgresql",
|
|
2007
2107
|
"mysql",
|
|
2008
2108
|
"sqlite",
|
|
@@ -2010,21 +2110,21 @@ var SQLDialectSchema = import_zod13.z.enum([
|
|
|
2010
2110
|
"oracle",
|
|
2011
2111
|
"mariadb"
|
|
2012
2112
|
]);
|
|
2013
|
-
var DataTypeMappingSchema =
|
|
2014
|
-
text:
|
|
2015
|
-
number:
|
|
2016
|
-
boolean:
|
|
2017
|
-
date:
|
|
2018
|
-
datetime:
|
|
2019
|
-
json:
|
|
2020
|
-
uuid:
|
|
2021
|
-
binary:
|
|
2022
|
-
});
|
|
2023
|
-
var SSLConfigSchema =
|
|
2024
|
-
rejectUnauthorized:
|
|
2025
|
-
ca:
|
|
2026
|
-
cert:
|
|
2027
|
-
key:
|
|
2113
|
+
var DataTypeMappingSchema = import_zod14.z.object({
|
|
2114
|
+
text: import_zod14.z.string().describe("SQL type for text fields (e.g., VARCHAR, TEXT)"),
|
|
2115
|
+
number: import_zod14.z.string().describe("SQL type for number fields (e.g., NUMERIC, DECIMAL, INT)"),
|
|
2116
|
+
boolean: import_zod14.z.string().describe("SQL type for boolean fields (e.g., BOOLEAN, BIT)"),
|
|
2117
|
+
date: import_zod14.z.string().describe("SQL type for date fields (e.g., DATE)"),
|
|
2118
|
+
datetime: import_zod14.z.string().describe("SQL type for datetime fields (e.g., TIMESTAMP, DATETIME)"),
|
|
2119
|
+
json: import_zod14.z.string().optional().describe("SQL type for JSON fields (e.g., JSON, JSONB)"),
|
|
2120
|
+
uuid: import_zod14.z.string().optional().describe("SQL type for UUID fields (e.g., UUID, CHAR(36))"),
|
|
2121
|
+
binary: import_zod14.z.string().optional().describe("SQL type for binary fields (e.g., BLOB, BYTEA)")
|
|
2122
|
+
});
|
|
2123
|
+
var SSLConfigSchema = import_zod14.z.object({
|
|
2124
|
+
rejectUnauthorized: import_zod14.z.boolean().default(true).describe("Reject connections with invalid certificates"),
|
|
2125
|
+
ca: import_zod14.z.string().optional().describe("CA certificate file path or content"),
|
|
2126
|
+
cert: import_zod14.z.string().optional().describe("Client certificate file path or content"),
|
|
2127
|
+
key: import_zod14.z.string().optional().describe("Client private key file path or content")
|
|
2028
2128
|
}).refine((data) => {
|
|
2029
2129
|
const hasCert = data.cert !== void 0;
|
|
2030
2130
|
const hasKey = data.key !== void 0;
|
|
@@ -2033,10 +2133,10 @@ var SSLConfigSchema = import_zod13.z.object({
|
|
|
2033
2133
|
message: "Client certificate (cert) and private key (key) must be provided together"
|
|
2034
2134
|
});
|
|
2035
2135
|
var SQLDriverConfigSchema = DriverConfigSchema.extend({
|
|
2036
|
-
type:
|
|
2136
|
+
type: import_zod14.z.literal("sql").describe('Driver type must be "sql"'),
|
|
2037
2137
|
dialect: SQLDialectSchema.describe("SQL database dialect"),
|
|
2038
2138
|
dataTypeMapping: DataTypeMappingSchema.describe("SQL data type mapping configuration"),
|
|
2039
|
-
ssl:
|
|
2139
|
+
ssl: import_zod14.z.boolean().default(false).describe("Enable SSL/TLS connection"),
|
|
2040
2140
|
sslConfig: SSLConfigSchema.optional().describe("SSL/TLS configuration (required when ssl is true)")
|
|
2041
2141
|
}).refine((data) => {
|
|
2042
2142
|
if (data.ssl && !data.sslConfig) {
|
|
@@ -2048,8 +2148,8 @@ var SQLDriverConfigSchema = DriverConfigSchema.extend({
|
|
|
2048
2148
|
});
|
|
2049
2149
|
|
|
2050
2150
|
// src/data/driver-nosql.zod.ts
|
|
2051
|
-
var
|
|
2052
|
-
var NoSQLDatabaseTypeSchema =
|
|
2151
|
+
var import_zod15 = require("zod");
|
|
2152
|
+
var NoSQLDatabaseTypeSchema = import_zod15.z.enum([
|
|
2053
2153
|
"mongodb",
|
|
2054
2154
|
"couchdb",
|
|
2055
2155
|
"dynamodb",
|
|
@@ -2059,7 +2159,7 @@ var NoSQLDatabaseTypeSchema = import_zod14.z.enum([
|
|
|
2059
2159
|
"neo4j",
|
|
2060
2160
|
"orientdb"
|
|
2061
2161
|
]);
|
|
2062
|
-
var NoSQLOperationTypeSchema =
|
|
2162
|
+
var NoSQLOperationTypeSchema = import_zod15.z.enum([
|
|
2063
2163
|
"find",
|
|
2064
2164
|
// Query documents/records
|
|
2065
2165
|
"findOne",
|
|
@@ -2083,7 +2183,7 @@ var NoSQLOperationTypeSchema = import_zod14.z.enum([
|
|
|
2083
2183
|
"dropIndex"
|
|
2084
2184
|
// Drop index
|
|
2085
2185
|
]);
|
|
2086
|
-
var ConsistencyLevelSchema =
|
|
2186
|
+
var ConsistencyLevelSchema = import_zod15.z.enum([
|
|
2087
2187
|
"all",
|
|
2088
2188
|
"quorum",
|
|
2089
2189
|
"one",
|
|
@@ -2091,7 +2191,7 @@ var ConsistencyLevelSchema = import_zod14.z.enum([
|
|
|
2091
2191
|
"each_quorum",
|
|
2092
2192
|
"eventual"
|
|
2093
2193
|
]);
|
|
2094
|
-
var NoSQLIndexTypeSchema =
|
|
2194
|
+
var NoSQLIndexTypeSchema = import_zod15.z.enum([
|
|
2095
2195
|
"single",
|
|
2096
2196
|
// Single field index
|
|
2097
2197
|
"compound",
|
|
@@ -2109,40 +2209,40 @@ var NoSQLIndexTypeSchema = import_zod14.z.enum([
|
|
|
2109
2209
|
"sparse"
|
|
2110
2210
|
// Sparse index (only indexed documents with field)
|
|
2111
2211
|
]);
|
|
2112
|
-
var ShardingConfigSchema =
|
|
2113
|
-
enabled:
|
|
2114
|
-
shardKey:
|
|
2115
|
-
shardingStrategy:
|
|
2116
|
-
numShards:
|
|
2117
|
-
});
|
|
2118
|
-
var ReplicationConfigSchema =
|
|
2119
|
-
enabled:
|
|
2120
|
-
replicaSetName:
|
|
2121
|
-
replicas:
|
|
2122
|
-
readPreference:
|
|
2123
|
-
writeConcern:
|
|
2124
|
-
});
|
|
2125
|
-
var DocumentSchemaValidationSchema =
|
|
2126
|
-
enabled:
|
|
2127
|
-
validationLevel:
|
|
2128
|
-
validationAction:
|
|
2129
|
-
jsonSchema:
|
|
2130
|
-
});
|
|
2131
|
-
var NoSQLDataTypeMappingSchema =
|
|
2132
|
-
text:
|
|
2133
|
-
number:
|
|
2134
|
-
boolean:
|
|
2135
|
-
date:
|
|
2136
|
-
datetime:
|
|
2137
|
-
json:
|
|
2138
|
-
uuid:
|
|
2139
|
-
binary:
|
|
2140
|
-
array:
|
|
2141
|
-
objectId:
|
|
2142
|
-
geopoint:
|
|
2212
|
+
var ShardingConfigSchema = import_zod15.z.object({
|
|
2213
|
+
enabled: import_zod15.z.boolean().default(false).describe("Enable sharding"),
|
|
2214
|
+
shardKey: import_zod15.z.string().optional().describe("Field to use as shard key"),
|
|
2215
|
+
shardingStrategy: import_zod15.z.enum(["hash", "range", "zone"]).optional().describe("Sharding strategy"),
|
|
2216
|
+
numShards: import_zod15.z.number().int().positive().optional().describe("Number of shards")
|
|
2217
|
+
});
|
|
2218
|
+
var ReplicationConfigSchema = import_zod15.z.object({
|
|
2219
|
+
enabled: import_zod15.z.boolean().default(false).describe("Enable replication"),
|
|
2220
|
+
replicaSetName: import_zod15.z.string().optional().describe("Replica set name"),
|
|
2221
|
+
replicas: import_zod15.z.number().int().positive().optional().describe("Number of replicas"),
|
|
2222
|
+
readPreference: import_zod15.z.enum(["primary", "primaryPreferred", "secondary", "secondaryPreferred", "nearest"]).optional().describe("Read preference for replica set"),
|
|
2223
|
+
writeConcern: import_zod15.z.enum(["majority", "acknowledged", "unacknowledged"]).optional().describe("Write concern level")
|
|
2224
|
+
});
|
|
2225
|
+
var DocumentSchemaValidationSchema = import_zod15.z.object({
|
|
2226
|
+
enabled: import_zod15.z.boolean().default(false).describe("Enable schema validation"),
|
|
2227
|
+
validationLevel: import_zod15.z.enum(["strict", "moderate", "off"]).optional().describe("Validation strictness"),
|
|
2228
|
+
validationAction: import_zod15.z.enum(["error", "warn"]).optional().describe("Action on validation failure"),
|
|
2229
|
+
jsonSchema: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).optional().describe("JSON Schema for validation")
|
|
2230
|
+
});
|
|
2231
|
+
var NoSQLDataTypeMappingSchema = import_zod15.z.object({
|
|
2232
|
+
text: import_zod15.z.string().describe("NoSQL type for text fields"),
|
|
2233
|
+
number: import_zod15.z.string().describe("NoSQL type for number fields"),
|
|
2234
|
+
boolean: import_zod15.z.string().describe("NoSQL type for boolean fields"),
|
|
2235
|
+
date: import_zod15.z.string().describe("NoSQL type for date fields"),
|
|
2236
|
+
datetime: import_zod15.z.string().describe("NoSQL type for datetime fields"),
|
|
2237
|
+
json: import_zod15.z.string().optional().describe("NoSQL type for JSON/object fields"),
|
|
2238
|
+
uuid: import_zod15.z.string().optional().describe("NoSQL type for UUID fields"),
|
|
2239
|
+
binary: import_zod15.z.string().optional().describe("NoSQL type for binary fields"),
|
|
2240
|
+
array: import_zod15.z.string().optional().describe("NoSQL type for array fields"),
|
|
2241
|
+
objectId: import_zod15.z.string().optional().describe("NoSQL type for ObjectID fields (MongoDB)"),
|
|
2242
|
+
geopoint: import_zod15.z.string().optional().describe("NoSQL type for geospatial point fields")
|
|
2143
2243
|
});
|
|
2144
2244
|
var NoSQLDriverConfigSchema = DriverConfigSchema.extend({
|
|
2145
|
-
type:
|
|
2245
|
+
type: import_zod15.z.literal("nosql").describe('Driver type must be "nosql"'),
|
|
2146
2246
|
databaseType: NoSQLDatabaseTypeSchema.describe("Specific NoSQL database type"),
|
|
2147
2247
|
dataTypeMapping: NoSQLDataTypeMappingSchema.describe("NoSQL data type mapping configuration"),
|
|
2148
2248
|
/**
|
|
@@ -2164,31 +2264,31 @@ var NoSQLDriverConfigSchema = DriverConfigSchema.extend({
|
|
|
2164
2264
|
/**
|
|
2165
2265
|
* AWS Region (for DynamoDB, DocumentDB, etc.)
|
|
2166
2266
|
*/
|
|
2167
|
-
region:
|
|
2267
|
+
region: import_zod15.z.string().optional().describe("AWS region (for managed NoSQL services)"),
|
|
2168
2268
|
/**
|
|
2169
2269
|
* AWS Access Key ID (for DynamoDB, DocumentDB, etc.)
|
|
2170
2270
|
*/
|
|
2171
|
-
accessKeyId:
|
|
2271
|
+
accessKeyId: import_zod15.z.string().optional().describe("AWS access key ID"),
|
|
2172
2272
|
/**
|
|
2173
2273
|
* AWS Secret Access Key (for DynamoDB, DocumentDB, etc.)
|
|
2174
2274
|
*/
|
|
2175
|
-
secretAccessKey:
|
|
2275
|
+
secretAccessKey: import_zod15.z.string().optional().describe("AWS secret access key"),
|
|
2176
2276
|
/**
|
|
2177
2277
|
* Time-to-live (TTL) field name
|
|
2178
2278
|
* Automatically delete documents after a specified time
|
|
2179
2279
|
*/
|
|
2180
|
-
ttlField:
|
|
2280
|
+
ttlField: import_zod15.z.string().optional().describe("Field name for TTL (auto-deletion)"),
|
|
2181
2281
|
/**
|
|
2182
2282
|
* Maximum document size in bytes
|
|
2183
2283
|
*/
|
|
2184
|
-
maxDocumentSize:
|
|
2284
|
+
maxDocumentSize: import_zod15.z.number().int().positive().optional().describe("Maximum document size in bytes"),
|
|
2185
2285
|
/**
|
|
2186
2286
|
* Collection/Table name prefix
|
|
2187
2287
|
* Useful for multi-tenancy or environment isolation
|
|
2188
2288
|
*/
|
|
2189
|
-
collectionPrefix:
|
|
2289
|
+
collectionPrefix: import_zod15.z.string().optional().describe("Prefix for collection/table names")
|
|
2190
2290
|
});
|
|
2191
|
-
var NoSQLQueryOptionsSchema =
|
|
2291
|
+
var NoSQLQueryOptionsSchema = import_zod15.z.object({
|
|
2192
2292
|
/**
|
|
2193
2293
|
* Consistency level for this query
|
|
2194
2294
|
*/
|
|
@@ -2196,61 +2296,61 @@ var NoSQLQueryOptionsSchema = import_zod14.z.object({
|
|
|
2196
2296
|
/**
|
|
2197
2297
|
* Read from secondary replicas
|
|
2198
2298
|
*/
|
|
2199
|
-
readFromSecondary:
|
|
2299
|
+
readFromSecondary: import_zod15.z.boolean().optional().describe("Allow reading from secondary replicas"),
|
|
2200
2300
|
/**
|
|
2201
2301
|
* Projection (fields to include/exclude)
|
|
2202
2302
|
*/
|
|
2203
|
-
projection:
|
|
2303
|
+
projection: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.union([import_zod15.z.literal(0), import_zod15.z.literal(1)])).optional().describe("Field projection"),
|
|
2204
2304
|
/**
|
|
2205
2305
|
* Query timeout in milliseconds
|
|
2206
2306
|
*/
|
|
2207
|
-
timeout:
|
|
2307
|
+
timeout: import_zod15.z.number().int().positive().optional().describe("Query timeout (ms)"),
|
|
2208
2308
|
/**
|
|
2209
2309
|
* Use cursor for large result sets
|
|
2210
2310
|
*/
|
|
2211
|
-
useCursor:
|
|
2311
|
+
useCursor: import_zod15.z.boolean().optional().describe("Use cursor instead of loading all results"),
|
|
2212
2312
|
/**
|
|
2213
2313
|
* Batch size for cursor iteration
|
|
2214
2314
|
*/
|
|
2215
|
-
batchSize:
|
|
2315
|
+
batchSize: import_zod15.z.number().int().positive().optional().describe("Cursor batch size"),
|
|
2216
2316
|
/**
|
|
2217
2317
|
* Enable query profiling
|
|
2218
2318
|
*/
|
|
2219
|
-
profile:
|
|
2319
|
+
profile: import_zod15.z.boolean().optional().describe("Enable query profiling"),
|
|
2220
2320
|
/**
|
|
2221
2321
|
* Use hinted index
|
|
2222
2322
|
*/
|
|
2223
|
-
hint:
|
|
2323
|
+
hint: import_zod15.z.string().optional().describe("Index hint for query optimization")
|
|
2224
2324
|
});
|
|
2225
|
-
var AggregationStageSchema =
|
|
2325
|
+
var AggregationStageSchema = import_zod15.z.object({
|
|
2226
2326
|
/**
|
|
2227
2327
|
* Stage operator (e.g., $match, $group, $sort, $project)
|
|
2228
2328
|
*/
|
|
2229
|
-
operator:
|
|
2329
|
+
operator: import_zod15.z.string().describe("Aggregation operator (e.g., $match, $group, $sort)"),
|
|
2230
2330
|
/**
|
|
2231
2331
|
* Stage parameters/options
|
|
2232
2332
|
*/
|
|
2233
|
-
options:
|
|
2333
|
+
options: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).describe("Stage-specific options")
|
|
2234
2334
|
});
|
|
2235
|
-
var AggregationPipelineSchema =
|
|
2335
|
+
var AggregationPipelineSchema = import_zod15.z.object({
|
|
2236
2336
|
/**
|
|
2237
2337
|
* Collection/Table to aggregate
|
|
2238
2338
|
*/
|
|
2239
|
-
collection:
|
|
2339
|
+
collection: import_zod15.z.string().describe("Collection/table name"),
|
|
2240
2340
|
/**
|
|
2241
2341
|
* Pipeline stages
|
|
2242
2342
|
*/
|
|
2243
|
-
stages:
|
|
2343
|
+
stages: import_zod15.z.array(AggregationStageSchema).describe("Aggregation pipeline stages"),
|
|
2244
2344
|
/**
|
|
2245
2345
|
* Additional options
|
|
2246
2346
|
*/
|
|
2247
2347
|
options: NoSQLQueryOptionsSchema.optional().describe("Query options")
|
|
2248
2348
|
});
|
|
2249
|
-
var NoSQLIndexSchema =
|
|
2349
|
+
var NoSQLIndexSchema = import_zod15.z.object({
|
|
2250
2350
|
/**
|
|
2251
2351
|
* Index name
|
|
2252
2352
|
*/
|
|
2253
|
-
name:
|
|
2353
|
+
name: import_zod15.z.string().describe("Index name"),
|
|
2254
2354
|
/**
|
|
2255
2355
|
* Index type
|
|
2256
2356
|
*/
|
|
@@ -2259,53 +2359,53 @@ var NoSQLIndexSchema = import_zod14.z.object({
|
|
|
2259
2359
|
* Fields to index
|
|
2260
2360
|
* For compound indexes, order matters
|
|
2261
2361
|
*/
|
|
2262
|
-
fields:
|
|
2263
|
-
field:
|
|
2264
|
-
order:
|
|
2362
|
+
fields: import_zod15.z.array(import_zod15.z.object({
|
|
2363
|
+
field: import_zod15.z.string().describe("Field name"),
|
|
2364
|
+
order: import_zod15.z.enum(["asc", "desc", "text", "2dsphere"]).optional().describe("Index order or type")
|
|
2265
2365
|
})).describe("Fields to index"),
|
|
2266
2366
|
/**
|
|
2267
2367
|
* Unique constraint
|
|
2268
2368
|
*/
|
|
2269
|
-
unique:
|
|
2369
|
+
unique: import_zod15.z.boolean().default(false).describe("Enforce uniqueness"),
|
|
2270
2370
|
/**
|
|
2271
2371
|
* Sparse index (only index documents with the field)
|
|
2272
2372
|
*/
|
|
2273
|
-
sparse:
|
|
2373
|
+
sparse: import_zod15.z.boolean().default(false).describe("Sparse index"),
|
|
2274
2374
|
/**
|
|
2275
2375
|
* TTL in seconds (for TTL indexes)
|
|
2276
2376
|
*/
|
|
2277
|
-
expireAfterSeconds:
|
|
2377
|
+
expireAfterSeconds: import_zod15.z.number().int().positive().optional().describe("TTL in seconds"),
|
|
2278
2378
|
/**
|
|
2279
2379
|
* Partial index filter
|
|
2280
2380
|
*/
|
|
2281
|
-
partialFilterExpression:
|
|
2381
|
+
partialFilterExpression: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.any()).optional().describe("Partial index filter"),
|
|
2282
2382
|
/**
|
|
2283
2383
|
* Background index creation
|
|
2284
2384
|
*/
|
|
2285
|
-
background:
|
|
2385
|
+
background: import_zod15.z.boolean().default(false).describe("Create index in background")
|
|
2286
2386
|
});
|
|
2287
|
-
var NoSQLTransactionOptionsSchema =
|
|
2387
|
+
var NoSQLTransactionOptionsSchema = import_zod15.z.object({
|
|
2288
2388
|
/**
|
|
2289
2389
|
* Read concern level
|
|
2290
2390
|
*/
|
|
2291
|
-
readConcern:
|
|
2391
|
+
readConcern: import_zod15.z.enum(["local", "majority", "linearizable", "snapshot"]).optional().describe("Read concern level"),
|
|
2292
2392
|
/**
|
|
2293
2393
|
* Write concern level
|
|
2294
2394
|
*/
|
|
2295
|
-
writeConcern:
|
|
2395
|
+
writeConcern: import_zod15.z.enum(["majority", "acknowledged", "unacknowledged"]).optional().describe("Write concern level"),
|
|
2296
2396
|
/**
|
|
2297
2397
|
* Read preference
|
|
2298
2398
|
*/
|
|
2299
|
-
readPreference:
|
|
2399
|
+
readPreference: import_zod15.z.enum(["primary", "primaryPreferred", "secondary", "secondaryPreferred", "nearest"]).optional().describe("Read preference"),
|
|
2300
2400
|
/**
|
|
2301
2401
|
* Transaction timeout in milliseconds
|
|
2302
2402
|
*/
|
|
2303
|
-
maxCommitTimeMS:
|
|
2403
|
+
maxCommitTimeMS: import_zod15.z.number().int().positive().optional().describe("Transaction commit timeout (ms)")
|
|
2304
2404
|
});
|
|
2305
2405
|
|
|
2306
2406
|
// src/data/dataset.zod.ts
|
|
2307
|
-
var
|
|
2308
|
-
var DatasetMode =
|
|
2407
|
+
var import_zod16 = require("zod");
|
|
2408
|
+
var DatasetMode = import_zod16.z.enum([
|
|
2309
2409
|
"insert",
|
|
2310
2410
|
// Try to insert, fail on duplicate
|
|
2311
2411
|
"update",
|
|
@@ -2317,19 +2417,19 @@ var DatasetMode = import_zod15.z.enum([
|
|
|
2317
2417
|
"ignore"
|
|
2318
2418
|
// Try to insert, silently skip duplicates
|
|
2319
2419
|
]);
|
|
2320
|
-
var DatasetSchema =
|
|
2420
|
+
var DatasetSchema = import_zod16.z.object({
|
|
2321
2421
|
/**
|
|
2322
2422
|
* Target Object
|
|
2323
2423
|
* The machine name of the object to populate.
|
|
2324
2424
|
*/
|
|
2325
|
-
object:
|
|
2425
|
+
object: import_zod16.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Target Object Name"),
|
|
2326
2426
|
/**
|
|
2327
2427
|
* Idempotency Key (The "Upsert" Key)
|
|
2328
2428
|
* The field used to check if a record already exists.
|
|
2329
2429
|
* Best Practice: Use a natural key like 'code', 'slug', 'username' or 'external_id'.
|
|
2330
2430
|
* Standard: '_id' (internal ID) is rarely used for portable seed data.
|
|
2331
2431
|
*/
|
|
2332
|
-
externalId:
|
|
2432
|
+
externalId: import_zod16.z.string().default("name").describe("Field match for uniqueness check"),
|
|
2333
2433
|
/**
|
|
2334
2434
|
* Import Strategy
|
|
2335
2435
|
*/
|
|
@@ -2340,182 +2440,182 @@ var DatasetSchema = import_zod15.z.object({
|
|
|
2340
2440
|
* - 'dev': Only for development/demo
|
|
2341
2441
|
* - 'test': Only for CI/CD tests
|
|
2342
2442
|
*/
|
|
2343
|
-
env:
|
|
2443
|
+
env: import_zod16.z.array(import_zod16.z.enum(["prod", "dev", "test"])).default(["prod", "dev", "test"]).describe("Applicable environments"),
|
|
2344
2444
|
/**
|
|
2345
2445
|
* The Payload
|
|
2346
2446
|
* Array of raw JSON objects matching the Object Schema.
|
|
2347
2447
|
*/
|
|
2348
|
-
records:
|
|
2448
|
+
records: import_zod16.z.array(import_zod16.z.record(import_zod16.z.string(), import_zod16.z.any())).describe("Data records")
|
|
2349
2449
|
});
|
|
2350
2450
|
|
|
2351
2451
|
// src/data/document.zod.ts
|
|
2352
|
-
var
|
|
2353
|
-
var DocumentVersionSchema =
|
|
2452
|
+
var import_zod17 = require("zod");
|
|
2453
|
+
var DocumentVersionSchema = import_zod17.z.object({
|
|
2354
2454
|
/**
|
|
2355
2455
|
* Sequential version number (increments with each new version)
|
|
2356
2456
|
*/
|
|
2357
|
-
versionNumber:
|
|
2457
|
+
versionNumber: import_zod17.z.number().describe("Version number"),
|
|
2358
2458
|
/**
|
|
2359
2459
|
* Timestamp when this version was created (Unix milliseconds)
|
|
2360
2460
|
*/
|
|
2361
|
-
createdAt:
|
|
2461
|
+
createdAt: import_zod17.z.number().describe("Creation timestamp"),
|
|
2362
2462
|
/**
|
|
2363
2463
|
* User ID who created this version
|
|
2364
2464
|
*/
|
|
2365
|
-
createdBy:
|
|
2465
|
+
createdBy: import_zod17.z.string().describe("Creator user ID"),
|
|
2366
2466
|
/**
|
|
2367
2467
|
* File size in bytes
|
|
2368
2468
|
*/
|
|
2369
|
-
size:
|
|
2469
|
+
size: import_zod17.z.number().describe("File size in bytes"),
|
|
2370
2470
|
/**
|
|
2371
2471
|
* Checksum/hash of the file content (for integrity verification)
|
|
2372
2472
|
*/
|
|
2373
|
-
checksum:
|
|
2473
|
+
checksum: import_zod17.z.string().describe("File checksum"),
|
|
2374
2474
|
/**
|
|
2375
2475
|
* URL to download this specific version
|
|
2376
2476
|
*/
|
|
2377
|
-
downloadUrl:
|
|
2477
|
+
downloadUrl: import_zod17.z.string().url().describe("Download URL"),
|
|
2378
2478
|
/**
|
|
2379
2479
|
* Whether this is the latest version
|
|
2380
2480
|
* @default false
|
|
2381
2481
|
*/
|
|
2382
|
-
isLatest:
|
|
2482
|
+
isLatest: import_zod17.z.boolean().optional().default(false).describe("Is latest version")
|
|
2383
2483
|
});
|
|
2384
|
-
var DocumentTemplateSchema =
|
|
2484
|
+
var DocumentTemplateSchema = import_zod17.z.object({
|
|
2385
2485
|
/**
|
|
2386
2486
|
* Unique identifier for the template
|
|
2387
2487
|
*/
|
|
2388
|
-
id:
|
|
2488
|
+
id: import_zod17.z.string().describe("Template ID"),
|
|
2389
2489
|
/**
|
|
2390
2490
|
* Human-readable name of the template
|
|
2391
2491
|
*/
|
|
2392
|
-
name:
|
|
2492
|
+
name: import_zod17.z.string().describe("Template name"),
|
|
2393
2493
|
/**
|
|
2394
2494
|
* Optional description of the template's purpose
|
|
2395
2495
|
*/
|
|
2396
|
-
description:
|
|
2496
|
+
description: import_zod17.z.string().optional().describe("Template description"),
|
|
2397
2497
|
/**
|
|
2398
2498
|
* URL to the template file
|
|
2399
2499
|
*/
|
|
2400
|
-
fileUrl:
|
|
2500
|
+
fileUrl: import_zod17.z.string().url().describe("Template file URL"),
|
|
2401
2501
|
/**
|
|
2402
2502
|
* MIME type of the template file
|
|
2403
2503
|
*/
|
|
2404
|
-
fileType:
|
|
2504
|
+
fileType: import_zod17.z.string().describe("File MIME type"),
|
|
2405
2505
|
/**
|
|
2406
2506
|
* List of dynamic placeholders in the template
|
|
2407
2507
|
*/
|
|
2408
|
-
placeholders:
|
|
2508
|
+
placeholders: import_zod17.z.array(import_zod17.z.object({
|
|
2409
2509
|
/**
|
|
2410
2510
|
* Placeholder identifier (used in template)
|
|
2411
2511
|
*/
|
|
2412
|
-
key:
|
|
2512
|
+
key: import_zod17.z.string().describe("Placeholder key"),
|
|
2413
2513
|
/**
|
|
2414
2514
|
* Human-readable label for the placeholder
|
|
2415
2515
|
*/
|
|
2416
|
-
label:
|
|
2516
|
+
label: import_zod17.z.string().describe("Placeholder label"),
|
|
2417
2517
|
/**
|
|
2418
2518
|
* Data type of the placeholder value
|
|
2419
2519
|
*/
|
|
2420
|
-
type:
|
|
2520
|
+
type: import_zod17.z.enum(["text", "number", "date", "image"]).describe("Placeholder type"),
|
|
2421
2521
|
/**
|
|
2422
2522
|
* Whether this placeholder must be filled
|
|
2423
2523
|
* @default false
|
|
2424
2524
|
*/
|
|
2425
|
-
required:
|
|
2525
|
+
required: import_zod17.z.boolean().optional().default(false).describe("Is required")
|
|
2426
2526
|
})).describe("Template placeholders")
|
|
2427
2527
|
});
|
|
2428
|
-
var ESignatureConfigSchema =
|
|
2528
|
+
var ESignatureConfigSchema = import_zod17.z.object({
|
|
2429
2529
|
/**
|
|
2430
2530
|
* E-signature service provider
|
|
2431
2531
|
*/
|
|
2432
|
-
provider:
|
|
2532
|
+
provider: import_zod17.z.enum(["docusign", "adobe-sign", "hellosign", "custom"]).describe("E-signature provider"),
|
|
2433
2533
|
/**
|
|
2434
2534
|
* Whether e-signature is enabled for this document
|
|
2435
2535
|
* @default false
|
|
2436
2536
|
*/
|
|
2437
|
-
enabled:
|
|
2537
|
+
enabled: import_zod17.z.boolean().optional().default(false).describe("E-signature enabled"),
|
|
2438
2538
|
/**
|
|
2439
2539
|
* List of signers in signing order
|
|
2440
2540
|
*/
|
|
2441
|
-
signers:
|
|
2541
|
+
signers: import_zod17.z.array(import_zod17.z.object({
|
|
2442
2542
|
/**
|
|
2443
2543
|
* Signer's email address
|
|
2444
2544
|
*/
|
|
2445
|
-
email:
|
|
2545
|
+
email: import_zod17.z.string().email().describe("Signer email"),
|
|
2446
2546
|
/**
|
|
2447
2547
|
* Signer's full name
|
|
2448
2548
|
*/
|
|
2449
|
-
name:
|
|
2549
|
+
name: import_zod17.z.string().describe("Signer name"),
|
|
2450
2550
|
/**
|
|
2451
2551
|
* Signer's role in the document
|
|
2452
2552
|
*/
|
|
2453
|
-
role:
|
|
2553
|
+
role: import_zod17.z.string().describe("Signer role"),
|
|
2454
2554
|
/**
|
|
2455
2555
|
* Signing order (lower numbers sign first)
|
|
2456
2556
|
*/
|
|
2457
|
-
order:
|
|
2557
|
+
order: import_zod17.z.number().describe("Signing order")
|
|
2458
2558
|
})).describe("Document signers"),
|
|
2459
2559
|
/**
|
|
2460
2560
|
* Days until signature request expires
|
|
2461
2561
|
* @default 30
|
|
2462
2562
|
*/
|
|
2463
|
-
expirationDays:
|
|
2563
|
+
expirationDays: import_zod17.z.number().optional().default(30).describe("Expiration days"),
|
|
2464
2564
|
/**
|
|
2465
2565
|
* Days between reminder emails
|
|
2466
2566
|
* @default 7
|
|
2467
2567
|
*/
|
|
2468
|
-
reminderDays:
|
|
2568
|
+
reminderDays: import_zod17.z.number().optional().default(7).describe("Reminder interval days")
|
|
2469
2569
|
});
|
|
2470
|
-
var DocumentSchema =
|
|
2570
|
+
var DocumentSchema = import_zod17.z.object({
|
|
2471
2571
|
/**
|
|
2472
2572
|
* Unique document identifier
|
|
2473
2573
|
*/
|
|
2474
|
-
id:
|
|
2574
|
+
id: import_zod17.z.string().describe("Document ID"),
|
|
2475
2575
|
/**
|
|
2476
2576
|
* Document name
|
|
2477
2577
|
*/
|
|
2478
|
-
name:
|
|
2578
|
+
name: import_zod17.z.string().describe("Document name"),
|
|
2479
2579
|
/**
|
|
2480
2580
|
* Optional document description
|
|
2481
2581
|
*/
|
|
2482
|
-
description:
|
|
2582
|
+
description: import_zod17.z.string().optional().describe("Document description"),
|
|
2483
2583
|
/**
|
|
2484
2584
|
* MIME type of the document
|
|
2485
2585
|
*/
|
|
2486
|
-
fileType:
|
|
2586
|
+
fileType: import_zod17.z.string().describe("File MIME type"),
|
|
2487
2587
|
/**
|
|
2488
2588
|
* File size in bytes
|
|
2489
2589
|
*/
|
|
2490
|
-
fileSize:
|
|
2590
|
+
fileSize: import_zod17.z.number().describe("File size in bytes"),
|
|
2491
2591
|
/**
|
|
2492
2592
|
* Document category for organization
|
|
2493
2593
|
*/
|
|
2494
|
-
category:
|
|
2594
|
+
category: import_zod17.z.string().optional().describe("Document category"),
|
|
2495
2595
|
/**
|
|
2496
2596
|
* Tags for searchability and organization
|
|
2497
2597
|
*/
|
|
2498
|
-
tags:
|
|
2598
|
+
tags: import_zod17.z.array(import_zod17.z.string()).optional().describe("Document tags"),
|
|
2499
2599
|
/**
|
|
2500
2600
|
* Version control configuration
|
|
2501
2601
|
*/
|
|
2502
|
-
versioning:
|
|
2602
|
+
versioning: import_zod17.z.object({
|
|
2503
2603
|
/**
|
|
2504
2604
|
* Whether versioning is enabled
|
|
2505
2605
|
*/
|
|
2506
|
-
enabled:
|
|
2606
|
+
enabled: import_zod17.z.boolean().describe("Versioning enabled"),
|
|
2507
2607
|
/**
|
|
2508
2608
|
* List of all document versions
|
|
2509
2609
|
*/
|
|
2510
|
-
versions:
|
|
2610
|
+
versions: import_zod17.z.array(DocumentVersionSchema).describe("Version history"),
|
|
2511
2611
|
/**
|
|
2512
2612
|
* Current major version number
|
|
2513
2613
|
*/
|
|
2514
|
-
majorVersion:
|
|
2614
|
+
majorVersion: import_zod17.z.number().describe("Major version"),
|
|
2515
2615
|
/**
|
|
2516
2616
|
* Current minor version number
|
|
2517
2617
|
*/
|
|
2518
|
-
minorVersion:
|
|
2618
|
+
minorVersion: import_zod17.z.number().describe("Minor version")
|
|
2519
2619
|
}).optional().describe("Version control"),
|
|
2520
2620
|
/**
|
|
2521
2621
|
* Template configuration (if document is generated from template)
|
|
@@ -2528,65 +2628,65 @@ var DocumentSchema = import_zod16.z.object({
|
|
|
2528
2628
|
/**
|
|
2529
2629
|
* Access control settings
|
|
2530
2630
|
*/
|
|
2531
|
-
access:
|
|
2631
|
+
access: import_zod17.z.object({
|
|
2532
2632
|
/**
|
|
2533
2633
|
* Whether document is publicly accessible
|
|
2534
2634
|
* @default false
|
|
2535
2635
|
*/
|
|
2536
|
-
isPublic:
|
|
2636
|
+
isPublic: import_zod17.z.boolean().optional().default(false).describe("Public access"),
|
|
2537
2637
|
/**
|
|
2538
2638
|
* List of user/team IDs with access
|
|
2539
2639
|
*/
|
|
2540
|
-
sharedWith:
|
|
2640
|
+
sharedWith: import_zod17.z.array(import_zod17.z.string()).optional().describe("Shared with"),
|
|
2541
2641
|
/**
|
|
2542
2642
|
* Timestamp when access expires (Unix milliseconds)
|
|
2543
2643
|
*/
|
|
2544
|
-
expiresAt:
|
|
2644
|
+
expiresAt: import_zod17.z.number().optional().describe("Access expiration")
|
|
2545
2645
|
}).optional().describe("Access control"),
|
|
2546
2646
|
/**
|
|
2547
2647
|
* Custom metadata fields
|
|
2548
2648
|
*/
|
|
2549
|
-
metadata:
|
|
2649
|
+
metadata: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.any()).optional().describe("Custom metadata")
|
|
2550
2650
|
});
|
|
2551
2651
|
|
|
2552
2652
|
// src/data/external-lookup.zod.ts
|
|
2553
|
-
var
|
|
2653
|
+
var import_zod19 = require("zod");
|
|
2554
2654
|
|
|
2555
2655
|
// src/shared/mapping.zod.ts
|
|
2556
|
-
var
|
|
2557
|
-
var TransformTypeSchema =
|
|
2558
|
-
|
|
2559
|
-
type:
|
|
2560
|
-
value:
|
|
2656
|
+
var import_zod18 = require("zod");
|
|
2657
|
+
var TransformTypeSchema = import_zod18.z.discriminatedUnion("type", [
|
|
2658
|
+
import_zod18.z.object({
|
|
2659
|
+
type: import_zod18.z.literal("constant"),
|
|
2660
|
+
value: import_zod18.z.any().describe("Constant value to use")
|
|
2561
2661
|
}).describe("Set a constant value"),
|
|
2562
|
-
|
|
2563
|
-
type:
|
|
2564
|
-
targetType:
|
|
2662
|
+
import_zod18.z.object({
|
|
2663
|
+
type: import_zod18.z.literal("cast"),
|
|
2664
|
+
targetType: import_zod18.z.enum(["string", "number", "boolean", "date"]).describe("Target data type")
|
|
2565
2665
|
}).describe("Cast to a specific data type"),
|
|
2566
|
-
|
|
2567
|
-
type:
|
|
2568
|
-
table:
|
|
2569
|
-
keyField:
|
|
2570
|
-
valueField:
|
|
2666
|
+
import_zod18.z.object({
|
|
2667
|
+
type: import_zod18.z.literal("lookup"),
|
|
2668
|
+
table: import_zod18.z.string().describe("Lookup table name"),
|
|
2669
|
+
keyField: import_zod18.z.string().describe("Field to match on"),
|
|
2670
|
+
valueField: import_zod18.z.string().describe("Field to retrieve")
|
|
2571
2671
|
}).describe("Lookup value from another table"),
|
|
2572
|
-
|
|
2573
|
-
type:
|
|
2574
|
-
expression:
|
|
2672
|
+
import_zod18.z.object({
|
|
2673
|
+
type: import_zod18.z.literal("javascript"),
|
|
2674
|
+
expression: import_zod18.z.string().describe('JavaScript expression (e.g., "value.toUpperCase()")')
|
|
2575
2675
|
}).describe("Custom JavaScript transformation"),
|
|
2576
|
-
|
|
2577
|
-
type:
|
|
2578
|
-
mappings:
|
|
2676
|
+
import_zod18.z.object({
|
|
2677
|
+
type: import_zod18.z.literal("map"),
|
|
2678
|
+
mappings: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.any()).describe('Value mappings (e.g., {"Active": "active"})')
|
|
2579
2679
|
}).describe("Map values using a dictionary")
|
|
2580
2680
|
]);
|
|
2581
|
-
var FieldMappingSchema2 =
|
|
2681
|
+
var FieldMappingSchema2 = import_zod18.z.object({
|
|
2582
2682
|
/**
|
|
2583
2683
|
* Source field name
|
|
2584
2684
|
*/
|
|
2585
|
-
source:
|
|
2685
|
+
source: import_zod18.z.string().describe("Source field name"),
|
|
2586
2686
|
/**
|
|
2587
2687
|
* Target field name (should be snake_case for ObjectStack)
|
|
2588
2688
|
*/
|
|
2589
|
-
target:
|
|
2689
|
+
target: import_zod18.z.string().describe("Target field name"),
|
|
2590
2690
|
/**
|
|
2591
2691
|
* Transformation to apply
|
|
2592
2692
|
*/
|
|
@@ -2594,58 +2694,58 @@ var FieldMappingSchema2 = import_zod17.z.object({
|
|
|
2594
2694
|
/**
|
|
2595
2695
|
* Default value if source is null/undefined
|
|
2596
2696
|
*/
|
|
2597
|
-
defaultValue:
|
|
2697
|
+
defaultValue: import_zod18.z.any().optional().describe("Default if source is null/undefined")
|
|
2598
2698
|
});
|
|
2599
2699
|
|
|
2600
2700
|
// src/data/external-lookup.zod.ts
|
|
2601
|
-
var ExternalDataSourceSchema =
|
|
2701
|
+
var ExternalDataSourceSchema = import_zod19.z.object({
|
|
2602
2702
|
/**
|
|
2603
2703
|
* Unique identifier for the external data source
|
|
2604
2704
|
*/
|
|
2605
|
-
id:
|
|
2705
|
+
id: import_zod19.z.string().describe("Data source ID"),
|
|
2606
2706
|
/**
|
|
2607
2707
|
* Human-readable name of the data source
|
|
2608
2708
|
*/
|
|
2609
|
-
name:
|
|
2709
|
+
name: import_zod19.z.string().describe("Data source name"),
|
|
2610
2710
|
/**
|
|
2611
2711
|
* Protocol type for connecting to the data source
|
|
2612
2712
|
*/
|
|
2613
|
-
type:
|
|
2713
|
+
type: import_zod19.z.enum(["odata", "rest-api", "graphql", "custom"]).describe("Protocol type"),
|
|
2614
2714
|
/**
|
|
2615
2715
|
* Base URL endpoint for the external system
|
|
2616
2716
|
*/
|
|
2617
|
-
endpoint:
|
|
2717
|
+
endpoint: import_zod19.z.string().url().describe("API endpoint URL"),
|
|
2618
2718
|
/**
|
|
2619
2719
|
* Authentication configuration
|
|
2620
2720
|
*/
|
|
2621
|
-
authentication:
|
|
2721
|
+
authentication: import_zod19.z.object({
|
|
2622
2722
|
/**
|
|
2623
2723
|
* Authentication method
|
|
2624
2724
|
*/
|
|
2625
|
-
type:
|
|
2725
|
+
type: import_zod19.z.enum(["oauth2", "api-key", "basic", "none"]).describe("Auth type"),
|
|
2626
2726
|
/**
|
|
2627
2727
|
* Authentication-specific configuration
|
|
2628
2728
|
* Structure varies based on auth type
|
|
2629
2729
|
*/
|
|
2630
|
-
config:
|
|
2730
|
+
config: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.any()).describe("Auth configuration")
|
|
2631
2731
|
}).describe("Authentication")
|
|
2632
2732
|
});
|
|
2633
2733
|
var ExternalFieldMappingSchema = FieldMappingSchema2.extend({
|
|
2634
2734
|
/**
|
|
2635
2735
|
* Field data type
|
|
2636
2736
|
*/
|
|
2637
|
-
type:
|
|
2737
|
+
type: import_zod19.z.string().optional().describe("Field type"),
|
|
2638
2738
|
/**
|
|
2639
2739
|
* Whether the field is read-only
|
|
2640
2740
|
* @default true
|
|
2641
2741
|
*/
|
|
2642
|
-
readonly:
|
|
2742
|
+
readonly: import_zod19.z.boolean().optional().default(true).describe("Read-only field")
|
|
2643
2743
|
});
|
|
2644
|
-
var ExternalLookupSchema =
|
|
2744
|
+
var ExternalLookupSchema = import_zod19.z.object({
|
|
2645
2745
|
/**
|
|
2646
2746
|
* Name of the field that uses external lookup
|
|
2647
2747
|
*/
|
|
2648
|
-
fieldName:
|
|
2748
|
+
fieldName: import_zod19.z.string().describe("Field name"),
|
|
2649
2749
|
/**
|
|
2650
2750
|
* External data source configuration
|
|
2651
2751
|
*/
|
|
@@ -2653,137 +2753,137 @@ var ExternalLookupSchema = import_zod18.z.object({
|
|
|
2653
2753
|
/**
|
|
2654
2754
|
* Query configuration for fetching external data
|
|
2655
2755
|
*/
|
|
2656
|
-
query:
|
|
2756
|
+
query: import_zod19.z.object({
|
|
2657
2757
|
/**
|
|
2658
2758
|
* API endpoint path (relative to base endpoint)
|
|
2659
2759
|
*/
|
|
2660
|
-
endpoint:
|
|
2760
|
+
endpoint: import_zod19.z.string().describe("Query endpoint path"),
|
|
2661
2761
|
/**
|
|
2662
2762
|
* HTTP method for the query
|
|
2663
2763
|
* @default 'GET'
|
|
2664
2764
|
*/
|
|
2665
|
-
method:
|
|
2765
|
+
method: import_zod19.z.enum(["GET", "POST"]).optional().default("GET").describe("HTTP method"),
|
|
2666
2766
|
/**
|
|
2667
2767
|
* Query parameters or request body
|
|
2668
2768
|
*/
|
|
2669
|
-
parameters:
|
|
2769
|
+
parameters: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.any()).optional().describe("Query parameters")
|
|
2670
2770
|
}).describe("Query configuration"),
|
|
2671
2771
|
/**
|
|
2672
2772
|
* Mapping between external and local fields
|
|
2673
2773
|
*/
|
|
2674
|
-
fieldMappings:
|
|
2774
|
+
fieldMappings: import_zod19.z.array(ExternalFieldMappingSchema).describe("Field mappings"),
|
|
2675
2775
|
/**
|
|
2676
2776
|
* Cache configuration for external data
|
|
2677
2777
|
*/
|
|
2678
|
-
caching:
|
|
2778
|
+
caching: import_zod19.z.object({
|
|
2679
2779
|
/**
|
|
2680
2780
|
* Whether caching is enabled
|
|
2681
2781
|
* @default true
|
|
2682
2782
|
*/
|
|
2683
|
-
enabled:
|
|
2783
|
+
enabled: import_zod19.z.boolean().optional().default(true).describe("Cache enabled"),
|
|
2684
2784
|
/**
|
|
2685
2785
|
* Time-to-live in seconds
|
|
2686
2786
|
* @default 300
|
|
2687
2787
|
*/
|
|
2688
|
-
ttl:
|
|
2788
|
+
ttl: import_zod19.z.number().optional().default(300).describe("Cache TTL (seconds)"),
|
|
2689
2789
|
/**
|
|
2690
2790
|
* Cache eviction strategy
|
|
2691
2791
|
* @default 'ttl'
|
|
2692
2792
|
*/
|
|
2693
|
-
strategy:
|
|
2793
|
+
strategy: import_zod19.z.enum(["lru", "lfu", "ttl"]).optional().default("ttl").describe("Cache strategy")
|
|
2694
2794
|
}).optional().describe("Caching configuration"),
|
|
2695
2795
|
/**
|
|
2696
2796
|
* Fallback behavior when external system is unavailable
|
|
2697
2797
|
*/
|
|
2698
|
-
fallback:
|
|
2798
|
+
fallback: import_zod19.z.object({
|
|
2699
2799
|
/**
|
|
2700
2800
|
* Whether fallback is enabled
|
|
2701
2801
|
* @default true
|
|
2702
2802
|
*/
|
|
2703
|
-
enabled:
|
|
2803
|
+
enabled: import_zod19.z.boolean().optional().default(true).describe("Fallback enabled"),
|
|
2704
2804
|
/**
|
|
2705
2805
|
* Default value to use when external system fails
|
|
2706
2806
|
*/
|
|
2707
|
-
defaultValue:
|
|
2807
|
+
defaultValue: import_zod19.z.any().optional().describe("Default fallback value"),
|
|
2708
2808
|
/**
|
|
2709
2809
|
* Whether to show error message to user
|
|
2710
2810
|
* @default true
|
|
2711
2811
|
*/
|
|
2712
|
-
showError:
|
|
2812
|
+
showError: import_zod19.z.boolean().optional().default(true).describe("Show error to user")
|
|
2713
2813
|
}).optional().describe("Fallback configuration"),
|
|
2714
2814
|
/**
|
|
2715
2815
|
* Rate limiting to prevent overwhelming external system
|
|
2716
2816
|
*/
|
|
2717
|
-
rateLimit:
|
|
2817
|
+
rateLimit: import_zod19.z.object({
|
|
2718
2818
|
/**
|
|
2719
2819
|
* Maximum requests per second
|
|
2720
2820
|
*/
|
|
2721
|
-
requestsPerSecond:
|
|
2821
|
+
requestsPerSecond: import_zod19.z.number().describe("Requests per second limit"),
|
|
2722
2822
|
/**
|
|
2723
2823
|
* Burst size for handling spikes
|
|
2724
2824
|
*/
|
|
2725
|
-
burstSize:
|
|
2825
|
+
burstSize: import_zod19.z.number().optional().describe("Burst size")
|
|
2726
2826
|
}).optional().describe("Rate limiting")
|
|
2727
2827
|
});
|
|
2728
2828
|
|
|
2729
2829
|
// src/data/datasource.zod.ts
|
|
2730
|
-
var
|
|
2731
|
-
var DriverType =
|
|
2732
|
-
var DriverDefinitionSchema =
|
|
2733
|
-
id:
|
|
2734
|
-
label:
|
|
2735
|
-
description:
|
|
2736
|
-
icon:
|
|
2830
|
+
var import_zod20 = require("zod");
|
|
2831
|
+
var DriverType = import_zod20.z.string().describe("Underlying driver identifier");
|
|
2832
|
+
var DriverDefinitionSchema = import_zod20.z.object({
|
|
2833
|
+
id: import_zod20.z.string().describe('Unique driver identifier (e.g. "postgres")'),
|
|
2834
|
+
label: import_zod20.z.string().describe('Display label (e.g. "PostgreSQL")'),
|
|
2835
|
+
description: import_zod20.z.string().optional(),
|
|
2836
|
+
icon: import_zod20.z.string().optional(),
|
|
2737
2837
|
/**
|
|
2738
2838
|
* Configuration Schema (JSON Schema)
|
|
2739
2839
|
* Describes the structure of the `config` object needed for this driver.
|
|
2740
2840
|
* Used by the UI to generate the connection form.
|
|
2741
2841
|
*/
|
|
2742
|
-
configSchema:
|
|
2842
|
+
configSchema: import_zod20.z.record(import_zod20.z.string(), import_zod20.z.any()).describe("JSON Schema for connection configuration"),
|
|
2743
2843
|
/**
|
|
2744
2844
|
* Default Capabilities
|
|
2745
2845
|
* What this driver supports out-of-the-box.
|
|
2746
2846
|
*/
|
|
2747
|
-
capabilities:
|
|
2847
|
+
capabilities: import_zod20.z.lazy(() => DatasourceCapabilities).optional()
|
|
2748
2848
|
});
|
|
2749
|
-
var DatasourceCapabilities =
|
|
2849
|
+
var DatasourceCapabilities = import_zod20.z.object({
|
|
2750
2850
|
// ============================================================================
|
|
2751
2851
|
// Transaction & Connection Management
|
|
2752
2852
|
// ============================================================================
|
|
2753
2853
|
/** Can handle ACID transactions? */
|
|
2754
|
-
transactions:
|
|
2854
|
+
transactions: import_zod20.z.boolean().default(false),
|
|
2755
2855
|
// ============================================================================
|
|
2756
2856
|
// Query Operations
|
|
2757
2857
|
// ============================================================================
|
|
2758
2858
|
/** Can execute WHERE clause filters natively? */
|
|
2759
|
-
queryFilters:
|
|
2859
|
+
queryFilters: import_zod20.z.boolean().default(false),
|
|
2760
2860
|
/** Can perform aggregation (group by, sum, avg)? */
|
|
2761
|
-
queryAggregations:
|
|
2861
|
+
queryAggregations: import_zod20.z.boolean().default(false),
|
|
2762
2862
|
/** Can perform ORDER BY sorting? */
|
|
2763
|
-
querySorting:
|
|
2863
|
+
querySorting: import_zod20.z.boolean().default(false),
|
|
2764
2864
|
/** Can perform LIMIT/OFFSET pagination? */
|
|
2765
|
-
queryPagination:
|
|
2865
|
+
queryPagination: import_zod20.z.boolean().default(false),
|
|
2766
2866
|
/** Can perform window functions? */
|
|
2767
|
-
queryWindowFunctions:
|
|
2867
|
+
queryWindowFunctions: import_zod20.z.boolean().default(false),
|
|
2768
2868
|
/** Can perform subqueries? */
|
|
2769
|
-
querySubqueries:
|
|
2869
|
+
querySubqueries: import_zod20.z.boolean().default(false),
|
|
2770
2870
|
/** Can execute SQL-like joins natively? */
|
|
2771
|
-
joins:
|
|
2871
|
+
joins: import_zod20.z.boolean().default(false),
|
|
2772
2872
|
// ============================================================================
|
|
2773
2873
|
// Advanced Features
|
|
2774
2874
|
// ============================================================================
|
|
2775
2875
|
/** Can perform full-text search? */
|
|
2776
|
-
fullTextSearch:
|
|
2876
|
+
fullTextSearch: import_zod20.z.boolean().default(false),
|
|
2777
2877
|
/** Is read-only? */
|
|
2778
|
-
readOnly:
|
|
2878
|
+
readOnly: import_zod20.z.boolean().default(false),
|
|
2779
2879
|
/** Is scheme-less (needs schema inference)? */
|
|
2780
|
-
dynamicSchema:
|
|
2880
|
+
dynamicSchema: import_zod20.z.boolean().default(false)
|
|
2781
2881
|
});
|
|
2782
|
-
var DatasourceSchema =
|
|
2882
|
+
var DatasourceSchema = import_zod20.z.object({
|
|
2783
2883
|
/** Machine Name */
|
|
2784
|
-
name:
|
|
2884
|
+
name: import_zod20.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Unique datasource identifier"),
|
|
2785
2885
|
/** Human Label */
|
|
2786
|
-
label:
|
|
2886
|
+
label: import_zod20.z.string().optional().describe("Display label"),
|
|
2787
2887
|
/** Driver */
|
|
2788
2888
|
driver: DriverType.describe("Underlying driver type"),
|
|
2789
2889
|
/**
|
|
@@ -2791,37 +2891,37 @@ var DatasourceSchema = import_zod19.z.object({
|
|
|
2791
2891
|
* Specific to the driver (e.g., host, port, user, password, bucket, etc.)
|
|
2792
2892
|
* Stored securely (passwords usually interpolated from ENV).
|
|
2793
2893
|
*/
|
|
2794
|
-
config:
|
|
2894
|
+
config: import_zod20.z.record(import_zod20.z.string(), import_zod20.z.any()).describe("Driver specific configuration"),
|
|
2795
2895
|
/**
|
|
2796
2896
|
* Connection Pool Configuration
|
|
2797
2897
|
* Standard connection pooling settings.
|
|
2798
2898
|
*/
|
|
2799
|
-
pool:
|
|
2800
|
-
min:
|
|
2801
|
-
max:
|
|
2802
|
-
idleTimeoutMillis:
|
|
2803
|
-
connectionTimeoutMillis:
|
|
2899
|
+
pool: import_zod20.z.object({
|
|
2900
|
+
min: import_zod20.z.number().default(0).describe("Minimum connections"),
|
|
2901
|
+
max: import_zod20.z.number().default(10).describe("Maximum connections"),
|
|
2902
|
+
idleTimeoutMillis: import_zod20.z.number().default(3e4).describe("Idle timeout"),
|
|
2903
|
+
connectionTimeoutMillis: import_zod20.z.number().default(3e3).describe("Connection establishment timeout")
|
|
2804
2904
|
}).optional().describe("Connection pool settings"),
|
|
2805
2905
|
/**
|
|
2806
2906
|
* Read Replicas
|
|
2807
2907
|
* Optional list of duplicate configurations for read-only operations.
|
|
2808
2908
|
* Useful for scaling read throughput.
|
|
2809
2909
|
*/
|
|
2810
|
-
readReplicas:
|
|
2910
|
+
readReplicas: import_zod20.z.array(import_zod20.z.record(import_zod20.z.string(), import_zod20.z.any())).optional().describe("Read-only replica configurations"),
|
|
2811
2911
|
/**
|
|
2812
2912
|
* Capability Overrides
|
|
2813
2913
|
* Manually override what the driver claims to support.
|
|
2814
2914
|
*/
|
|
2815
2915
|
capabilities: DatasourceCapabilities.optional().describe("Capability overrides"),
|
|
2816
2916
|
/** Description */
|
|
2817
|
-
description:
|
|
2917
|
+
description: import_zod20.z.string().optional().describe("Internal description"),
|
|
2818
2918
|
/** Is enabled? */
|
|
2819
|
-
active:
|
|
2919
|
+
active: import_zod20.z.boolean().default(true).describe("Is datasource enabled")
|
|
2820
2920
|
});
|
|
2821
2921
|
|
|
2822
2922
|
// src/data/analytics.zod.ts
|
|
2823
|
-
var
|
|
2824
|
-
var MetricType =
|
|
2923
|
+
var import_zod21 = require("zod");
|
|
2924
|
+
var MetricType = import_zod21.z.enum([
|
|
2825
2925
|
"count",
|
|
2826
2926
|
"sum",
|
|
2827
2927
|
"avg",
|
|
@@ -2835,14 +2935,14 @@ var MetricType = import_zod20.z.enum([
|
|
|
2835
2935
|
"boolean"
|
|
2836
2936
|
// Custom SQL expression returning a boolean
|
|
2837
2937
|
]);
|
|
2838
|
-
var DimensionType =
|
|
2938
|
+
var DimensionType = import_zod21.z.enum([
|
|
2839
2939
|
"string",
|
|
2840
2940
|
"number",
|
|
2841
2941
|
"boolean",
|
|
2842
2942
|
"time",
|
|
2843
2943
|
"geo"
|
|
2844
2944
|
]);
|
|
2845
|
-
var TimeUpdateInterval =
|
|
2945
|
+
var TimeUpdateInterval = import_zod21.z.enum([
|
|
2846
2946
|
"second",
|
|
2847
2947
|
"minute",
|
|
2848
2948
|
"hour",
|
|
@@ -2852,78 +2952,78 @@ var TimeUpdateInterval = import_zod20.z.enum([
|
|
|
2852
2952
|
"quarter",
|
|
2853
2953
|
"year"
|
|
2854
2954
|
]);
|
|
2855
|
-
var MetricSchema =
|
|
2856
|
-
name:
|
|
2857
|
-
label:
|
|
2858
|
-
description:
|
|
2955
|
+
var MetricSchema = import_zod21.z.object({
|
|
2956
|
+
name: import_zod21.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Unique metric ID"),
|
|
2957
|
+
label: import_zod21.z.string().describe("Human readable label"),
|
|
2958
|
+
description: import_zod21.z.string().optional(),
|
|
2859
2959
|
type: MetricType,
|
|
2860
2960
|
/** Source Calculation */
|
|
2861
|
-
sql:
|
|
2961
|
+
sql: import_zod21.z.string().describe("SQL expression or field reference"),
|
|
2862
2962
|
/** Filtering for this specific metric (e.g. "Revenue from Premium Users") */
|
|
2863
|
-
filters:
|
|
2864
|
-
sql:
|
|
2963
|
+
filters: import_zod21.z.array(import_zod21.z.object({
|
|
2964
|
+
sql: import_zod21.z.string()
|
|
2865
2965
|
})).optional(),
|
|
2866
2966
|
/** Format for display (e.g. "currency", "percent") */
|
|
2867
|
-
format:
|
|
2967
|
+
format: import_zod21.z.string().optional()
|
|
2868
2968
|
});
|
|
2869
|
-
var DimensionSchema =
|
|
2870
|
-
name:
|
|
2871
|
-
label:
|
|
2872
|
-
description:
|
|
2969
|
+
var DimensionSchema = import_zod21.z.object({
|
|
2970
|
+
name: import_zod21.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Unique dimension ID"),
|
|
2971
|
+
label: import_zod21.z.string().describe("Human readable label"),
|
|
2972
|
+
description: import_zod21.z.string().optional(),
|
|
2873
2973
|
type: DimensionType,
|
|
2874
2974
|
/** Source Column */
|
|
2875
|
-
sql:
|
|
2975
|
+
sql: import_zod21.z.string().describe("SQL expression or column reference"),
|
|
2876
2976
|
/** For Time Dimensions: Supported Granularities */
|
|
2877
|
-
granularities:
|
|
2977
|
+
granularities: import_zod21.z.array(TimeUpdateInterval).optional()
|
|
2878
2978
|
});
|
|
2879
|
-
var CubeJoinSchema =
|
|
2880
|
-
name:
|
|
2881
|
-
relationship:
|
|
2882
|
-
sql:
|
|
2979
|
+
var CubeJoinSchema = import_zod21.z.object({
|
|
2980
|
+
name: import_zod21.z.string().describe("Target cube name"),
|
|
2981
|
+
relationship: import_zod21.z.enum(["one_to_one", "one_to_many", "many_to_one"]).default("many_to_one"),
|
|
2982
|
+
sql: import_zod21.z.string().describe("Join condition (ON clause)")
|
|
2883
2983
|
});
|
|
2884
|
-
var CubeSchema =
|
|
2885
|
-
name:
|
|
2886
|
-
title:
|
|
2887
|
-
description:
|
|
2984
|
+
var CubeSchema = import_zod21.z.object({
|
|
2985
|
+
name: import_zod21.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Cube name (snake_case)"),
|
|
2986
|
+
title: import_zod21.z.string().optional(),
|
|
2987
|
+
description: import_zod21.z.string().optional(),
|
|
2888
2988
|
/** Physical Data Source */
|
|
2889
|
-
sql:
|
|
2989
|
+
sql: import_zod21.z.string().describe("Base SQL statement or Table Name"),
|
|
2890
2990
|
/** Semantic Definitions */
|
|
2891
|
-
measures:
|
|
2892
|
-
dimensions:
|
|
2991
|
+
measures: import_zod21.z.record(import_zod21.z.string(), MetricSchema).describe("Quantitative metrics"),
|
|
2992
|
+
dimensions: import_zod21.z.record(import_zod21.z.string(), DimensionSchema).describe("Qualitative attributes"),
|
|
2893
2993
|
/** Relationships */
|
|
2894
|
-
joins:
|
|
2994
|
+
joins: import_zod21.z.record(import_zod21.z.string(), CubeJoinSchema).optional(),
|
|
2895
2995
|
/** Pre-aggregations / Caching */
|
|
2896
|
-
refreshKey:
|
|
2897
|
-
every:
|
|
2996
|
+
refreshKey: import_zod21.z.object({
|
|
2997
|
+
every: import_zod21.z.string().optional(),
|
|
2898
2998
|
// e.g. "1 hour"
|
|
2899
|
-
sql:
|
|
2999
|
+
sql: import_zod21.z.string().optional()
|
|
2900
3000
|
// SQL to check for data changes
|
|
2901
3001
|
}).optional(),
|
|
2902
3002
|
/** Access Control */
|
|
2903
|
-
public:
|
|
2904
|
-
});
|
|
2905
|
-
var AnalyticsQuerySchema =
|
|
2906
|
-
measures:
|
|
2907
|
-
dimensions:
|
|
2908
|
-
filters:
|
|
2909
|
-
member:
|
|
2910
|
-
operator:
|
|
2911
|
-
values:
|
|
3003
|
+
public: import_zod21.z.boolean().default(false)
|
|
3004
|
+
});
|
|
3005
|
+
var AnalyticsQuerySchema = import_zod21.z.object({
|
|
3006
|
+
measures: import_zod21.z.array(import_zod21.z.string()).describe("List of metrics to calculate"),
|
|
3007
|
+
dimensions: import_zod21.z.array(import_zod21.z.string()).optional().describe("List of dimensions to group by"),
|
|
3008
|
+
filters: import_zod21.z.array(import_zod21.z.object({
|
|
3009
|
+
member: import_zod21.z.string().describe("Dimension or Measure"),
|
|
3010
|
+
operator: import_zod21.z.enum(["equals", "notEquals", "contains", "notContains", "gt", "gte", "lt", "lte", "set", "notSet", "inDateRange"]),
|
|
3011
|
+
values: import_zod21.z.array(import_zod21.z.string()).optional()
|
|
2912
3012
|
})).optional(),
|
|
2913
|
-
timeDimensions:
|
|
2914
|
-
dimension:
|
|
3013
|
+
timeDimensions: import_zod21.z.array(import_zod21.z.object({
|
|
3014
|
+
dimension: import_zod21.z.string(),
|
|
2915
3015
|
granularity: TimeUpdateInterval.optional(),
|
|
2916
|
-
dateRange:
|
|
2917
|
-
|
|
3016
|
+
dateRange: import_zod21.z.union([
|
|
3017
|
+
import_zod21.z.string(),
|
|
2918
3018
|
// "Last 7 days"
|
|
2919
|
-
|
|
3019
|
+
import_zod21.z.array(import_zod21.z.string())
|
|
2920
3020
|
// ["2023-01-01", "2023-01-31"]
|
|
2921
3021
|
]).optional()
|
|
2922
3022
|
})).optional(),
|
|
2923
|
-
order:
|
|
2924
|
-
limit:
|
|
2925
|
-
offset:
|
|
2926
|
-
timezone:
|
|
3023
|
+
order: import_zod21.z.record(import_zod21.z.string(), import_zod21.z.enum(["asc", "desc"])).optional(),
|
|
3024
|
+
limit: import_zod21.z.number().optional(),
|
|
3025
|
+
offset: import_zod21.z.number().optional(),
|
|
3026
|
+
timezone: import_zod21.z.string().default("UTC")
|
|
2927
3027
|
});
|
|
2928
3028
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2929
3029
|
0 && (module.exports = {
|
|
@@ -3025,6 +3125,8 @@ var AnalyticsQuerySchema = import_zod20.z.object({
|
|
|
3025
3125
|
NoSQLTransactionOptionsSchema,
|
|
3026
3126
|
NormalizedFilterSchema,
|
|
3027
3127
|
ObjectCapabilities,
|
|
3128
|
+
ObjectExtensionSchema,
|
|
3129
|
+
ObjectOwnershipEnum,
|
|
3028
3130
|
ObjectSchema,
|
|
3029
3131
|
PartitioningConfigSchema,
|
|
3030
3132
|
PoolConfigSchema,
|