@objectstack/spec 0.3.2 → 0.4.1
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 +32 -10
- package/dist/ai/agent.zod.d.ts +12 -12
- package/dist/ai/conversation.zod.d.ts +54 -54
- package/dist/ai/cost.zod.d.ts +135 -135
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/ai/model-registry.zod.d.ts +91 -91
- package/dist/ai/nlq.zod.d.ts +72 -72
- package/dist/ai/{workflow-automation.zod.d.ts → orchestration.zod.d.ts} +51 -50
- package/dist/ai/orchestration.zod.d.ts.map +1 -0
- package/dist/ai/{workflow-automation.zod.js → orchestration.zod.js} +26 -25
- package/dist/ai/predictive.zod.d.ts +27 -27
- package/dist/ai/rag-pipeline.zod.d.ts +102 -102
- package/dist/api/contract.zod.d.ts +213 -197
- package/dist/api/contract.zod.d.ts.map +1 -1
- package/dist/{system → api}/discovery.zod.d.ts +26 -26
- package/dist/api/discovery.zod.d.ts.map +1 -0
- package/dist/{system → api}/discovery.zod.js +9 -9
- package/dist/{system/api.zod.d.ts → api/endpoint.zod.d.ts} +53 -57
- package/dist/api/endpoint.zod.d.ts.map +1 -0
- package/dist/{system/api.zod.js → api/endpoint.zod.js} +3 -6
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +6 -0
- package/dist/api/odata.zod.d.ts +482 -0
- package/dist/api/odata.zod.d.ts.map +1 -0
- package/dist/api/odata.zod.js +401 -0
- package/dist/{system → api}/realtime.zod.d.ts +4 -4
- package/dist/api/realtime.zod.d.ts.map +1 -0
- package/dist/api/router.zod.d.ts +182 -0
- package/dist/api/router.zod.d.ts.map +1 -0
- package/dist/api/router.zod.js +103 -0
- package/dist/{system/auth.zod.d.ts → auth/config.zod.d.ts} +199 -199
- package/dist/auth/config.zod.d.ts.map +1 -0
- package/dist/{system → auth}/identity.zod.d.ts +8 -8
- package/dist/auth/identity.zod.d.ts.map +1 -0
- package/dist/auth/index.d.ts +8 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +23 -0
- package/dist/{system → auth}/organization.zod.d.ts +7 -7
- package/dist/auth/organization.zod.d.ts.map +1 -0
- package/dist/{system → auth}/policy.zod.d.ts +3 -3
- package/dist/auth/policy.zod.d.ts.map +1 -0
- package/dist/{system/auth-protocol.d.ts → auth/protocol.d.ts} +1 -1
- package/dist/auth/protocol.d.ts.map +1 -0
- package/dist/{system → auth}/role.zod.d.ts +14 -0
- package/dist/auth/role.zod.d.ts.map +1 -0
- package/dist/{system → auth}/role.zod.js +16 -1
- package/dist/auth/scim.zod.d.ts +2732 -0
- package/dist/auth/scim.zod.d.ts.map +1 -0
- package/dist/auth/scim.zod.js +811 -0
- package/dist/automation/approval.zod.d.ts +643 -0
- package/dist/automation/approval.zod.d.ts.map +1 -0
- package/dist/automation/approval.zod.js +84 -0
- package/dist/automation/connector.zod.d.ts +1284 -0
- package/dist/automation/connector.zod.d.ts.map +1 -0
- package/dist/automation/connector.zod.js +500 -0
- package/dist/automation/etl.zod.d.ts +623 -0
- package/dist/automation/etl.zod.d.ts.map +1 -0
- package/dist/automation/etl.zod.js +359 -0
- package/dist/{data → automation}/flow.zod.d.ts +40 -22
- package/dist/automation/flow.zod.d.ts.map +1 -0
- package/dist/{data → automation}/flow.zod.js +6 -1
- package/dist/automation/index.d.ts +8 -0
- package/dist/automation/index.d.ts.map +1 -0
- package/dist/automation/index.js +23 -0
- package/dist/automation/sync.zod.d.ts +854 -0
- package/dist/automation/sync.zod.d.ts.map +1 -0
- package/dist/automation/sync.zod.js +444 -0
- package/dist/{system → automation}/webhook.zod.d.ts +26 -3
- package/dist/automation/webhook.zod.d.ts.map +1 -0
- package/dist/{system → automation}/webhook.zod.js +27 -3
- package/dist/automation/workflow.zod.d.ts +2059 -0
- package/dist/automation/workflow.zod.d.ts.map +1 -0
- package/dist/{data → automation}/workflow.zod.js +40 -2
- package/dist/data/dataset.zod.d.ts +2 -2
- package/dist/data/field.zod.d.ts +779 -219
- package/dist/data/field.zod.d.ts.map +1 -1
- package/dist/data/field.zod.js +128 -16
- package/dist/data/filter.zod.d.ts +167 -30
- package/dist/data/filter.zod.d.ts.map +1 -1
- package/dist/data/filter.zod.js +25 -13
- package/dist/data/hook.zod.d.ts +191 -0
- package/dist/data/hook.zod.d.ts.map +1 -0
- package/dist/data/hook.zod.js +144 -0
- package/dist/data/index.d.ts +4 -17
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +4 -17
- package/dist/data/mapping.zod.d.ts +117 -93
- package/dist/data/mapping.zod.d.ts.map +1 -1
- package/dist/data/mapping.zod.js +16 -3
- package/dist/data/object.zod.d.ts +485 -131
- package/dist/data/object.zod.d.ts.map +1 -1
- package/dist/data/object.zod.js +87 -42
- package/dist/data/query.zod.d.ts +98 -169
- package/dist/data/query.zod.d.ts.map +1 -1
- package/dist/data/query.zod.js +42 -130
- package/dist/data/validation.zod.d.ts +166 -26
- package/dist/data/validation.zod.d.ts.map +1 -1
- package/dist/data/validation.zod.js +38 -16
- package/dist/hub/composer.zod.d.ts +871 -0
- package/dist/hub/composer.zod.d.ts.map +1 -0
- package/dist/hub/composer.zod.js +111 -0
- package/dist/hub/index.d.ts +6 -0
- package/dist/hub/index.d.ts.map +1 -0
- package/dist/hub/index.js +22 -0
- package/dist/{system → hub}/license.zod.d.ts +13 -9
- package/dist/hub/license.zod.d.ts.map +1 -0
- package/dist/{system → hub}/license.zod.js +5 -3
- package/dist/hub/marketplace.zod.d.ts +191 -0
- package/dist/hub/marketplace.zod.d.ts.map +1 -0
- package/dist/hub/marketplace.zod.js +85 -0
- package/dist/hub/space.zod.d.ts +383 -0
- package/dist/hub/space.zod.d.ts.map +1 -0
- package/dist/hub/space.zod.js +103 -0
- package/dist/{system → hub}/tenant.zod.d.ts +73 -47
- package/dist/hub/tenant.zod.d.ts.map +1 -0
- package/dist/{system → hub}/tenant.zod.js +36 -10
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/permission/index.d.ts +14 -0
- package/dist/permission/index.d.ts.map +1 -0
- package/dist/permission/index.js +29 -0
- package/dist/{data → permission}/permission.zod.d.ts +48 -3
- package/dist/permission/permission.zod.d.ts.map +1 -0
- package/dist/{data → permission}/permission.zod.js +26 -2
- package/dist/permission/rls.zod.d.ts +605 -0
- package/dist/permission/rls.zod.d.ts.map +1 -0
- package/dist/permission/rls.zod.js +615 -0
- package/dist/permission/sharing.zod.d.ts +146 -0
- package/dist/permission/sharing.zod.d.ts.map +1 -0
- package/dist/permission/sharing.zod.js +88 -0
- package/dist/{system → permission}/territory.zod.d.ts +13 -0
- package/dist/permission/territory.zod.d.ts.map +1 -0
- package/dist/{system → permission}/territory.zod.js +15 -1
- package/dist/shared/identifiers.zod.d.ts +87 -0
- package/dist/shared/identifiers.zod.d.ts.map +1 -0
- package/dist/shared/identifiers.zod.js +101 -0
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +21 -0
- package/dist/stack.zod.d.ts +19869 -0
- package/dist/stack.zod.d.ts.map +1 -0
- package/dist/stack.zod.js +248 -0
- package/dist/system/audit.zod.d.ts +58 -58
- package/dist/system/context.zod.d.ts +56 -0
- package/dist/system/context.zod.d.ts.map +1 -0
- package/dist/system/context.zod.js +43 -0
- package/dist/system/datasource.zod.d.ts +40 -6
- package/dist/system/datasource.zod.d.ts.map +1 -1
- package/dist/system/datasource.zod.js +17 -13
- package/dist/system/driver/mongo.zod.d.ts +107 -0
- package/dist/system/driver/mongo.zod.d.ts.map +1 -0
- package/dist/system/driver/mongo.zod.js +80 -0
- package/dist/system/driver/postgres.zod.d.ts +134 -0
- package/dist/system/driver/postgres.zod.d.ts.map +1 -0
- package/dist/system/driver/postgres.zod.js +88 -0
- package/dist/system/driver.zod.d.ts +2249 -488
- package/dist/system/driver.zod.d.ts.map +1 -1
- package/dist/system/driver.zod.js +99 -0
- package/dist/system/events.zod.d.ts +8 -5
- package/dist/system/events.zod.d.ts.map +1 -1
- package/dist/system/events.zod.js +5 -1
- package/dist/system/feature.zod.d.ts +131 -0
- package/dist/system/feature.zod.d.ts.map +1 -0
- package/dist/system/feature.zod.js +45 -0
- package/dist/system/index.d.ts +11 -20
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +15 -20
- package/dist/system/job.zod.d.ts +5 -5
- package/dist/system/logger.zod.d.ts +111 -0
- package/dist/system/logger.zod.d.ts.map +1 -0
- package/dist/system/logger.zod.js +75 -0
- package/dist/system/manifest.zod.d.ts +136 -18
- package/dist/system/manifest.zod.d.ts.map +1 -1
- package/dist/system/manifest.zod.js +28 -0
- package/dist/system/plugin.zod.d.ts +598 -318
- package/dist/system/plugin.zod.d.ts.map +1 -1
- package/dist/system/plugin.zod.js +13 -0
- package/dist/system/scoped-storage.zod.d.ts +81 -0
- package/dist/system/scoped-storage.zod.d.ts.map +1 -0
- package/dist/system/scoped-storage.zod.js +66 -0
- package/dist/ui/action.zod.d.ts +42 -17
- package/dist/ui/action.zod.d.ts.map +1 -1
- package/dist/ui/action.zod.js +30 -1
- package/dist/ui/app.zod.d.ts +26 -11
- package/dist/ui/app.zod.d.ts.map +1 -1
- package/dist/ui/app.zod.js +32 -4
- package/dist/ui/block.zod.d.ts +265 -0
- package/dist/ui/block.zod.d.ts.map +1 -0
- package/dist/ui/block.zod.js +90 -0
- package/dist/ui/component.zod.d.ts +265 -0
- package/dist/ui/component.zod.d.ts.map +1 -0
- package/dist/ui/component.zod.js +90 -0
- package/dist/ui/dashboard.zod.d.ts +15 -15
- package/dist/ui/dashboard.zod.d.ts.map +1 -1
- package/dist/ui/dashboard.zod.js +18 -8
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/page.zod.d.ts +23 -5
- package/dist/ui/page.zod.d.ts.map +1 -1
- package/dist/ui/page.zod.js +37 -4
- package/dist/ui/report.zod.d.ts +12 -12
- package/dist/ui/theme.zod.d.ts +42 -42
- package/dist/ui/view.zod.d.ts +302 -290
- package/dist/ui/view.zod.d.ts.map +1 -1
- package/dist/ui/view.zod.js +32 -3
- package/dist/ui/widget.zod.d.ts +730 -29
- package/dist/ui/widget.zod.d.ts.map +1 -1
- package/dist/ui/widget.zod.js +294 -1
- package/json-schema/ai/{AIWorkflowAutomation.json → AIOrchestration.json} +5 -5
- package/json-schema/ai/{AIWorkflowExecutionResult.json → AIOrchestrationExecutionResult.json} +2 -2
- package/json-schema/ai/{AIWorkflowTrigger.json → AIOrchestrationTrigger.json} +2 -2
- package/json-schema/ai/{BatchAIWorkflowExecution.json → BatchAIOrchestrationExecution.json} +3 -3
- package/json-schema/{system → api}/ApiEndpoint.json +3 -1
- package/json-schema/{system → api}/ApiRoutes.json +7 -7
- package/json-schema/{system → api}/Discovery.json +7 -7
- package/json-schema/api/ExportRequest.json +402 -438
- package/json-schema/{system → api}/HttpMethod.json +3 -1
- package/json-schema/api/ODataError.json +65 -0
- package/json-schema/api/ODataFilterFunction.json +39 -0
- package/json-schema/api/ODataFilterOperator.json +24 -0
- package/json-schema/api/ODataMetadata.json +115 -0
- package/json-schema/api/ODataQuery.json +89 -0
- package/json-schema/api/ODataResponse.json +37 -0
- package/json-schema/api/RouteCategory.json +17 -0
- package/json-schema/api/RouteDefinition.json +77 -0
- package/json-schema/api/RouterConfig.json +117 -0
- package/json-schema/{system → auth}/Role.json +3 -2
- package/json-schema/auth/SCIMAddress.json +50 -0
- package/json-schema/auth/SCIMEmail.json +38 -0
- package/json-schema/auth/SCIMEnterpriseUser.json +55 -0
- package/json-schema/auth/SCIMError.json +52 -0
- package/json-schema/auth/SCIMGroup.json +102 -0
- package/json-schema/auth/SCIMGroupReference.json +36 -0
- package/json-schema/auth/SCIMListResponse.json +606 -0
- package/json-schema/auth/SCIMMemberReference.json +36 -0
- package/json-schema/auth/SCIMMeta.json +35 -0
- package/json-schema/auth/SCIMName.json +36 -0
- package/json-schema/auth/SCIMPatchOperation.json +31 -0
- package/json-schema/auth/SCIMPatchRequest.json +56 -0
- package/json-schema/auth/SCIMPhoneNumber.json +40 -0
- package/json-schema/auth/SCIMUser.json +462 -0
- package/json-schema/automation/ApprovalAction.json +35 -0
- package/json-schema/automation/ApprovalActionType.json +15 -0
- package/json-schema/automation/ApprovalProcess.json +326 -0
- package/json-schema/automation/ApprovalStep.json +147 -0
- package/json-schema/automation/ApproverType.json +16 -0
- package/json-schema/automation/AuthField.json +73 -0
- package/json-schema/automation/Authentication.json +159 -0
- package/json-schema/automation/AuthenticationType.json +18 -0
- package/json-schema/automation/ConflictResolution.json +16 -0
- package/json-schema/automation/Connector.json +440 -0
- package/json-schema/automation/ConnectorCategory.json +26 -0
- package/json-schema/automation/ConnectorInstance.json +69 -0
- package/json-schema/automation/ConnectorOperation.json +117 -0
- package/json-schema/automation/ConnectorTrigger.json +54 -0
- package/json-schema/automation/DataDestinationConfig.json +89 -0
- package/json-schema/automation/DataSourceConfig.json +34 -0
- package/json-schema/automation/DataSyncConfig.json +355 -0
- package/json-schema/automation/ETLDestination.json +57 -0
- package/json-schema/automation/ETLEndpointType.json +19 -0
- package/json-schema/automation/ETLPipeline.json +252 -0
- package/json-schema/automation/ETLPipelineRun.json +107 -0
- package/json-schema/automation/ETLRunStatus.json +17 -0
- package/json-schema/automation/ETLSource.json +60 -0
- package/json-schema/{data/LogicOperator.json → automation/ETLSyncMode.json} +5 -5
- package/json-schema/automation/ETLTransformation.json +46 -0
- package/json-schema/automation/ETLTransformationType.json +21 -0
- package/json-schema/automation/FieldMapping.json +36 -0
- package/json-schema/{data → automation}/Flow.json +31 -1
- package/json-schema/{data → automation}/FlowEdge.json +9 -0
- package/json-schema/automation/OAuth2Config.json +43 -0
- package/json-schema/automation/OperationParameter.json +59 -0
- package/json-schema/automation/OperationType.json +17 -0
- package/json-schema/automation/SyncDirection.json +14 -0
- package/json-schema/automation/SyncExecutionResult.json +135 -0
- package/json-schema/automation/SyncExecutionStatus.json +17 -0
- package/json-schema/{data/TriggerTiming.json → automation/SyncMode.json} +5 -4
- package/json-schema/{data/WorkflowRule.json → automation/TimeTrigger.json} +35 -25
- package/json-schema/{system → automation}/Webhook.json +3 -1
- package/json-schema/{system → automation}/WebhookReceiver.json +3 -1
- package/json-schema/automation/WorkflowRule.json +1032 -0
- package/json-schema/data/AggregationNode.json +23 -0
- package/json-schema/data/AsyncValidation.json +49 -2
- package/json-schema/data/ComparisonOperator.json +52 -0
- package/json-schema/data/ConditionalValidation.json +693 -46
- package/json-schema/data/CrossFieldValidation.json +33 -2
- package/json-schema/data/CurrencyConfig.json +35 -0
- package/json-schema/data/CurrencyValue.json +26 -0
- package/json-schema/data/CustomValidator.json +37 -10
- package/json-schema/data/Field.json +92 -4
- package/json-schema/data/FieldOperators.json +78 -0
- package/json-schema/data/FieldReference.json +19 -0
- package/json-schema/data/FieldType.json +12 -2
- package/json-schema/data/FormatValidation.json +33 -2
- package/json-schema/data/Hook.json +95 -0
- package/json-schema/data/HookContext.json +88 -0
- package/json-schema/data/HookEvent.json +29 -0
- package/json-schema/data/Index.json +10 -0
- package/json-schema/data/JSONValidation.json +85 -0
- package/json-schema/data/JoinNode.json +197 -213
- package/json-schema/data/JoinStrategy.json +15 -0
- package/json-schema/data/NormalizedFilter.json +234 -0
- package/json-schema/data/Object.json +1642 -32
- package/json-schema/data/ObjectCapabilities.json +30 -12
- package/json-schema/data/Query.json +246 -262
- package/json-schema/data/RangeOperator.json +26 -0
- package/json-schema/data/ScriptValidation.json +33 -2
- package/json-schema/data/SearchConfig.json +36 -0
- package/json-schema/data/SelectOption.json +4 -2
- package/json-schema/data/StateMachineValidation.json +33 -2
- package/json-schema/data/UniquenessValidation.json +33 -2
- package/json-schema/data/ValidationRule.json +693 -46
- package/json-schema/data/VectorConfig.json +51 -0
- package/json-schema/hub/BillOfMaterials.json +70 -0
- package/json-schema/hub/ComposerRequest.json +86 -0
- package/json-schema/hub/ComposerResponse.json +483 -0
- package/json-schema/hub/ConflictReport.json +53 -0
- package/json-schema/hub/DependencyRequirement.json +36 -0
- package/json-schema/hub/DeploymentTarget.json +38 -0
- package/json-schema/hub/HubSpace.json +279 -0
- package/json-schema/{system → hub}/License.json +11 -3
- package/json-schema/hub/MarketplacePlugin.json +141 -0
- package/json-schema/hub/PluginAuthor.json +26 -0
- package/json-schema/hub/PluginPricing.json +43 -0
- package/json-schema/hub/SpaceSubscription.json +77 -0
- package/json-schema/hub/SubscriptionStatus.json +16 -0
- package/json-schema/{system → hub}/Tenant.json +3 -5
- package/json-schema/permission/CriteriaSharingRule.json +82 -0
- package/json-schema/{data → permission}/OWDModel.json +2 -1
- package/json-schema/{data → permission}/ObjectPermission.json +15 -0
- package/json-schema/permission/OwnerSharingRule.json +102 -0
- package/json-schema/{data → permission}/PermissionSet.json +18 -1
- package/json-schema/permission/RLSConfig.json +59 -0
- package/json-schema/permission/RLSEvaluationResult.json +40 -0
- package/json-schema/{data/TriggerAction.json → permission/RLSOperation.json} +5 -3
- package/json-schema/permission/RLSUserContext.json +51 -0
- package/json-schema/permission/RowLevelSecurityPolicy.json +77 -0
- package/json-schema/permission/ShareRecipientType.json +16 -0
- package/json-schema/{data → permission}/SharingLevel.json +2 -1
- package/json-schema/permission/SharingRule.json +182 -0
- package/json-schema/{data → permission}/SharingRuleType.json +1 -3
- package/json-schema/{system → permission}/Territory.json +3 -1
- package/json-schema/shared/EventName.json +12 -0
- package/json-schema/shared/SnakeCaseIdentifier.json +12 -0
- package/json-schema/shared/SystemIdentifier.json +12 -0
- package/json-schema/system/Datasource.json +35 -0
- package/json-schema/system/DriverCapabilities.json +10 -0
- package/json-schema/system/DriverInterface.json +10 -0
- package/json-schema/system/DriverOptions.json +11 -0
- package/json-schema/system/Event.json +3 -2
- package/json-schema/system/FeatureFlag.json +87 -0
- package/json-schema/system/FeatureStrategy.json +16 -0
- package/json-schema/system/FileMetadata.json +43 -0
- package/json-schema/system/KernelContext.json +62 -0
- package/json-schema/system/LogEntry.json +63 -0
- package/json-schema/system/LogFormat.json +15 -0
- package/json-schema/system/LogLevel.json +17 -0
- package/json-schema/system/LoggerConfig.json +70 -0
- package/json-schema/system/Manifest.json +80 -0
- package/json-schema/system/MongoConfig.json +82 -0
- package/json-schema/system/PluginContext.json +8 -1
- package/json-schema/system/PostgresConfig.json +98 -0
- package/json-schema/system/RuntimeMode.json +16 -0
- package/json-schema/system/ScopedStorageConfig.json +54 -0
- package/json-schema/system/StorageAdapterType.json +17 -0
- package/json-schema/system/StorageScope.json +18 -0
- package/json-schema/ui/Action.json +25 -4
- package/json-schema/ui/ActionParam.json +12 -2
- package/json-schema/ui/App.json +18 -7
- package/json-schema/ui/ChartType.json +9 -1
- package/json-schema/ui/Dashboard.json +9 -1
- package/json-schema/ui/DashboardNavItem.json +3 -1
- package/json-schema/ui/DashboardWidget.json +9 -1
- package/json-schema/ui/FieldWidgetProps.json +92 -4
- package/json-schema/ui/FormView.json +4 -1
- package/json-schema/ui/GroupNavItem.json +3 -1
- package/json-schema/ui/ListView.json +7 -1
- package/json-schema/ui/NavigationItem.json +15 -5
- package/json-schema/ui/ObjectNavItem.json +3 -1
- package/json-schema/ui/Page.json +36 -4
- package/json-schema/ui/PageCardProps.json +32 -0
- package/json-schema/ui/PageComponent.json +33 -3
- package/json-schema/ui/PageComponentType.json +32 -0
- package/json-schema/ui/PageHeaderProps.json +39 -0
- package/json-schema/ui/PageNavItem.json +3 -1
- package/json-schema/ui/PageRegion.json +33 -3
- package/json-schema/ui/PageTabsProps.json +55 -0
- package/json-schema/ui/RecordDetailsProps.json +37 -0
- package/json-schema/ui/RecordHighlightsProps.json +24 -0
- package/json-schema/ui/RecordRelatedListProps.json +39 -0
- package/json-schema/ui/UrlNavItem.json +3 -1
- package/json-schema/ui/View.json +22 -4
- package/json-schema/ui/WidgetEvent.json +42 -0
- package/json-schema/ui/WidgetLifecycle.json +40 -0
- package/json-schema/ui/WidgetManifest.json +262 -0
- package/json-schema/ui/WidgetProperty.json +58 -0
- package/llms.txt +182 -0
- package/package.json +38 -16
- package/prompts/README.md +18 -0
- package/prompts/architecture.md +81 -0
- package/prompts/create-new-project.md +85 -0
- package/prompts/implement-objectai.md +39 -0
- package/prompts/implement-objectos.md +48 -0
- package/prompts/implement-objectql.md +39 -0
- package/prompts/implement-objectui.md +46 -0
- package/prompts/instructions.md +91 -0
- package/dist/ai/workflow-automation.zod.d.ts.map +0 -1
- package/dist/data/flow.zod.d.ts.map +0 -1
- package/dist/data/permission.zod.d.ts.map +0 -1
- package/dist/data/sharing.zod.d.ts +0 -63
- package/dist/data/sharing.zod.d.ts.map +0 -1
- package/dist/data/sharing.zod.js +0 -57
- package/dist/data/trigger.zod.d.ts +0 -354
- package/dist/data/trigger.zod.d.ts.map +0 -1
- package/dist/data/trigger.zod.js +0 -195
- package/dist/data/workflow.zod.d.ts +0 -986
- package/dist/data/workflow.zod.d.ts.map +0 -1
- package/dist/system/api.zod.d.ts.map +0 -1
- package/dist/system/auth-protocol.d.ts.map +0 -1
- package/dist/system/auth.zod.d.ts.map +0 -1
- package/dist/system/discovery.zod.d.ts.map +0 -1
- package/dist/system/identity.zod.d.ts.map +0 -1
- package/dist/system/license.zod.d.ts.map +0 -1
- package/dist/system/organization.zod.d.ts.map +0 -1
- package/dist/system/policy.zod.d.ts.map +0 -1
- package/dist/system/realtime.zod.d.ts.map +0 -1
- package/dist/system/role.zod.d.ts.map +0 -1
- package/dist/system/tenant.zod.d.ts.map +0 -1
- package/dist/system/territory.zod.d.ts.map +0 -1
- package/dist/system/webhook.zod.d.ts.map +0 -1
- package/json-schema/README.md +0 -127
- package/json-schema/data/FieldMapping.json +0 -83
- package/json-schema/data/FilterNode.json +0 -52
- package/json-schema/data/FilterOperator.json +0 -26
- package/json-schema/data/Mapping.json +0 -598
- package/json-schema/data/SharingRule.json +0 -58
- package/json-schema/data/TransformType.json +0 -18
- package/json-schema/data/Trigger.json +0 -73
- package/json-schema/data/TriggerContext.json +0 -61
- /package/dist/{system → api}/realtime.zod.js +0 -0
- /package/dist/{system/auth.zod.js → auth/config.zod.js} +0 -0
- /package/dist/{system → auth}/identity.zod.js +0 -0
- /package/dist/{system → auth}/organization.zod.js +0 -0
- /package/dist/{system → auth}/policy.zod.js +0 -0
- /package/dist/{system/auth-protocol.js → auth/protocol.js} +0 -0
- /package/json-schema/{system → api}/ApiCapabilities.json +0 -0
- /package/json-schema/{system → api}/ApiMapping.json +0 -0
- /package/json-schema/{system → api}/Presence.json +0 -0
- /package/json-schema/{system → api}/PresenceStatus.json +0 -0
- /package/json-schema/{system → api}/RateLimit.json +0 -0
- /package/json-schema/{system → api}/RealtimeAction.json +0 -0
- /package/json-schema/{system → api}/RealtimeEvent.json +0 -0
- /package/json-schema/{system → api}/RealtimeEventType.json +0 -0
- /package/json-schema/{system → api}/Subscription.json +0 -0
- /package/json-schema/{system → api}/SubscriptionEvent.json +0 -0
- /package/json-schema/{system → api}/TransportProtocol.json +0 -0
- /package/json-schema/{system → auth}/Account.json +0 -0
- /package/json-schema/{system → auth}/AccountLinkingConfig.json +0 -0
- /package/json-schema/{system → auth}/AuditPolicy.json +0 -0
- /package/json-schema/{system → auth}/AuthConfig.json +0 -0
- /package/json-schema/{system → auth}/AuthPluginConfig.json +0 -0
- /package/json-schema/{system → auth}/AuthStrategy.json +0 -0
- /package/json-schema/{system → auth}/CSRFConfig.json +0 -0
- /package/json-schema/{system → auth}/DatabaseAdapter.json +0 -0
- /package/json-schema/{system → auth}/DatabaseMapping.json +0 -0
- /package/json-schema/{system → auth}/EmailPasswordConfig.json +0 -0
- /package/json-schema/{system → auth}/EnterpriseAuthConfig.json +0 -0
- /package/json-schema/{system → auth}/Invitation.json +0 -0
- /package/json-schema/{system → auth}/InvitationStatus.json +0 -0
- /package/json-schema/{system → auth}/LDAPConfig.json +0 -0
- /package/json-schema/{system → auth}/MagicLinkConfig.json +0 -0
- /package/json-schema/{system → auth}/Member.json +0 -0
- /package/json-schema/{system → auth}/NetworkPolicy.json +0 -0
- /package/json-schema/{system → auth}/OAuthProvider.json +0 -0
- /package/json-schema/{system → auth}/OIDCConfig.json +0 -0
- /package/json-schema/{system → auth}/Organization.json +0 -0
- /package/json-schema/{system → auth}/PasskeyConfig.json +0 -0
- /package/json-schema/{system → auth}/PasswordPolicy.json +0 -0
- /package/json-schema/{system → auth}/Policy.json +0 -0
- /package/json-schema/{system → auth}/RateLimitConfig.json +0 -0
- /package/json-schema/{system → auth}/SAMLConfig.json +0 -0
- /package/json-schema/{system → auth}/Session.json +0 -0
- /package/json-schema/{system → auth}/SessionConfig.json +0 -0
- /package/json-schema/{system → auth}/SessionPolicy.json +0 -0
- /package/json-schema/{system → auth}/StandardAuthProvider.json +0 -0
- /package/json-schema/{system → auth}/TwoFactorConfig.json +0 -0
- /package/json-schema/{system → auth}/User.json +0 -0
- /package/json-schema/{system → auth}/UserFieldMapping.json +0 -0
- /package/json-schema/{system → auth}/VerificationToken.json +0 -0
- /package/json-schema/{data → automation}/CustomScriptAction.json +0 -0
- /package/json-schema/{data → automation}/EmailAlertAction.json +0 -0
- /package/json-schema/{data → automation}/FieldUpdateAction.json +0 -0
- /package/json-schema/{data → automation}/FlowNode.json +0 -0
- /package/json-schema/{data → automation}/FlowNodeAction.json +0 -0
- /package/json-schema/{data → automation}/FlowVariable.json +0 -0
- /package/json-schema/{data → automation}/HttpCallAction.json +0 -0
- /package/json-schema/{data → automation}/PushNotificationAction.json +0 -0
- /package/json-schema/{data → automation}/SlackMessageAction.json +0 -0
- /package/json-schema/{data → automation}/SmsNotificationAction.json +0 -0
- /package/json-schema/{data → automation}/TaskCreationAction.json +0 -0
- /package/json-schema/{data → automation}/TeamsMessageAction.json +0 -0
- /package/json-schema/{data → automation}/WebhookTriggerAction.json +0 -0
- /package/json-schema/{system → automation}/WebhookTriggerType.json +0 -0
- /package/json-schema/{data → automation}/WorkflowAction.json +0 -0
- /package/json-schema/{data → automation}/WorkflowTriggerType.json +0 -0
- /package/json-schema/{system → hub}/DatabaseLevelIsolationStrategy.json +0 -0
- /package/json-schema/{system → hub}/Feature.json +0 -0
- /package/json-schema/{system → hub}/LevelIsolationStrategySchema.json +0 -0
- /package/json-schema/{system → hub}/MetricType.json +0 -0
- /package/json-schema/{system → hub}/Plan.json +0 -0
- /package/json-schema/{system → hub}/RowLevelIsolationStrategy.json +0 -0
- /package/json-schema/{system → hub}/TenantIsolationConfig.json +0 -0
- /package/json-schema/{system → hub}/TenantIsolationLevel.json +0 -0
- /package/json-schema/{system → hub}/TenantQuota.json +0 -0
- /package/json-schema/{system → hub}/TenantSecurityPolicy.json +0 -0
- /package/json-schema/{data → permission}/FieldPermission.json +0 -0
- /package/json-schema/{system → permission}/TerritoryModel.json +0 -0
- /package/json-schema/{system → permission}/TerritoryType.json +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Hook Lifecycle Events
|
|
4
|
+
* Defines the interception points in the ObjectQL execution pipeline.
|
|
5
|
+
*/
|
|
6
|
+
export declare const HookEvent: z.ZodEnum<["beforeFind", "afterFind", "beforeFindOne", "afterFindOne", "beforeCount", "afterCount", "beforeAggregate", "afterAggregate", "beforeInsert", "afterInsert", "beforeUpdate", "afterUpdate", "beforeDelete", "afterDelete", "beforeUpdateMany", "afterUpdateMany", "beforeDeleteMany", "afterDeleteMany"]>;
|
|
7
|
+
/**
|
|
8
|
+
* Hook Definition Schema
|
|
9
|
+
*
|
|
10
|
+
* Hooks serve as the "Logic Layer" in ObjectStack, allowing developers to
|
|
11
|
+
* inject custom code during the data access lifecycle.
|
|
12
|
+
*
|
|
13
|
+
* Use cases:
|
|
14
|
+
* - Data Enrichment (Default values, Calculated fields)
|
|
15
|
+
* - Validation (Complex business rules)
|
|
16
|
+
* - Side Effects (Sending emails, Syncing to external systems)
|
|
17
|
+
* - Security (Filtering data based on context)
|
|
18
|
+
*/
|
|
19
|
+
export declare const HookSchema: z.ZodObject<{
|
|
20
|
+
/**
|
|
21
|
+
* Unique identifier for the hook
|
|
22
|
+
* Required for debugging and overriding.
|
|
23
|
+
*/
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
/**
|
|
26
|
+
* Human readable label
|
|
27
|
+
*/
|
|
28
|
+
label: z.ZodOptional<z.ZodString>;
|
|
29
|
+
/**
|
|
30
|
+
* Target Object(s)
|
|
31
|
+
* can be:
|
|
32
|
+
* - Single object: "account"
|
|
33
|
+
* - List of objects: ["account", "contact"]
|
|
34
|
+
* - Wildcard: "*" (All objects)
|
|
35
|
+
*/
|
|
36
|
+
object: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
37
|
+
/**
|
|
38
|
+
* Events to subscribe to
|
|
39
|
+
* Combinations of timing (before/after) and action (find/insert/update/delete/etc)
|
|
40
|
+
*/
|
|
41
|
+
events: z.ZodArray<z.ZodEnum<["beforeFind", "afterFind", "beforeFindOne", "afterFindOne", "beforeCount", "afterCount", "beforeAggregate", "afterAggregate", "beforeInsert", "afterInsert", "beforeUpdate", "afterUpdate", "beforeDelete", "afterDelete", "beforeUpdateMany", "afterUpdateMany", "beforeDeleteMany", "afterDeleteMany"]>, "many">;
|
|
42
|
+
/**
|
|
43
|
+
* Handler Logic
|
|
44
|
+
* Reference to a registered function in the plugin system OR a direct function (runtime only).
|
|
45
|
+
*/
|
|
46
|
+
handler: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodAny]>>;
|
|
47
|
+
/**
|
|
48
|
+
* Execution Order
|
|
49
|
+
* Lower numbers run first.
|
|
50
|
+
* - System Hooks: 0-99
|
|
51
|
+
* - App Hooks: 100-999
|
|
52
|
+
* - User Hooks: 1000+
|
|
53
|
+
*/
|
|
54
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
55
|
+
/**
|
|
56
|
+
* Async / Background Execution
|
|
57
|
+
* If true, the hook runs in the background and does not block the transaction.
|
|
58
|
+
* Only applicable for 'after*' events.
|
|
59
|
+
* Default: false (Blocking)
|
|
60
|
+
*/
|
|
61
|
+
async: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Error Policy
|
|
64
|
+
* What to do if the hook throws an exception?
|
|
65
|
+
* - abort: Rollback transaction (if blocking)
|
|
66
|
+
* - log: Log error and continue
|
|
67
|
+
*/
|
|
68
|
+
onError: z.ZodDefault<z.ZodEnum<["abort", "log"]>>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
object: string | string[];
|
|
71
|
+
name: string;
|
|
72
|
+
events: ("beforeFind" | "afterFind" | "beforeFindOne" | "afterFindOne" | "beforeCount" | "afterCount" | "beforeAggregate" | "afterAggregate" | "beforeInsert" | "afterInsert" | "beforeUpdate" | "afterUpdate" | "beforeDelete" | "afterDelete" | "beforeUpdateMany" | "afterUpdateMany" | "beforeDeleteMany" | "afterDeleteMany")[];
|
|
73
|
+
async: boolean;
|
|
74
|
+
priority: number;
|
|
75
|
+
onError: "abort" | "log";
|
|
76
|
+
label?: string | undefined;
|
|
77
|
+
handler?: any;
|
|
78
|
+
}, {
|
|
79
|
+
object: string | string[];
|
|
80
|
+
name: string;
|
|
81
|
+
events: ("beforeFind" | "afterFind" | "beforeFindOne" | "afterFindOne" | "beforeCount" | "afterCount" | "beforeAggregate" | "afterAggregate" | "beforeInsert" | "afterInsert" | "beforeUpdate" | "afterUpdate" | "beforeDelete" | "afterDelete" | "beforeUpdateMany" | "afterUpdateMany" | "beforeDeleteMany" | "afterDeleteMany")[];
|
|
82
|
+
label?: string | undefined;
|
|
83
|
+
async?: boolean | undefined;
|
|
84
|
+
handler?: any;
|
|
85
|
+
priority?: number | undefined;
|
|
86
|
+
onError?: "abort" | "log" | undefined;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Hook Runtime Context
|
|
90
|
+
* Defines what is available to the hook handler during execution.
|
|
91
|
+
*
|
|
92
|
+
* Best Practices:
|
|
93
|
+
* - **Immutability**: `object`, `event`, `id` are immutable.
|
|
94
|
+
* - **Mutability**: `input` and `result` are mutable to allow transformation.
|
|
95
|
+
* - **Encapsulation**: `session` isolates auth info; `transaction` ensures atomicity.
|
|
96
|
+
*/
|
|
97
|
+
export declare const HookContextSchema: z.ZodObject<{
|
|
98
|
+
/** Tracing ID */
|
|
99
|
+
id: z.ZodOptional<z.ZodString>;
|
|
100
|
+
/** Target Object Name */
|
|
101
|
+
object: z.ZodString;
|
|
102
|
+
/** Current Lifecycle Event */
|
|
103
|
+
event: z.ZodEnum<["beforeFind", "afterFind", "beforeFindOne", "afterFindOne", "beforeCount", "afterCount", "beforeAggregate", "afterAggregate", "beforeInsert", "afterInsert", "beforeUpdate", "afterUpdate", "beforeDelete", "afterDelete", "beforeUpdateMany", "afterUpdateMany", "beforeDeleteMany", "afterDeleteMany"]>;
|
|
104
|
+
/**
|
|
105
|
+
* Input Parameters (Mutable)
|
|
106
|
+
* Modify this to change the behavior of the operation.
|
|
107
|
+
*
|
|
108
|
+
* - find: { query: QueryAST, options: DriverOptions }
|
|
109
|
+
* - insert: { doc: Record, options: DriverOptions }
|
|
110
|
+
* - update: { id: ID, doc: Record, options: DriverOptions }
|
|
111
|
+
* - delete: { id: ID, options: DriverOptions }
|
|
112
|
+
* - updateMany: { query: QueryAST, doc: Record, options: DriverOptions }
|
|
113
|
+
* - deleteMany: { query: QueryAST, options: DriverOptions }
|
|
114
|
+
*/
|
|
115
|
+
input: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
116
|
+
/**
|
|
117
|
+
* Operation Result (Mutable)
|
|
118
|
+
* Available in 'after*' events. Modify this to transform the output.
|
|
119
|
+
*/
|
|
120
|
+
result: z.ZodOptional<z.ZodAny>;
|
|
121
|
+
/**
|
|
122
|
+
* Data Snapshot
|
|
123
|
+
* The state of the record BEFORE the operation (for update/delete).
|
|
124
|
+
*/
|
|
125
|
+
previous: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
126
|
+
/**
|
|
127
|
+
* Execution Session
|
|
128
|
+
* Contains authentication and tenancy information.
|
|
129
|
+
*/
|
|
130
|
+
session: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
132
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
133
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
134
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
userId?: string | undefined;
|
|
137
|
+
tenantId?: string | undefined;
|
|
138
|
+
roles?: string[] | undefined;
|
|
139
|
+
accessToken?: string | undefined;
|
|
140
|
+
}, {
|
|
141
|
+
userId?: string | undefined;
|
|
142
|
+
tenantId?: string | undefined;
|
|
143
|
+
roles?: string[] | undefined;
|
|
144
|
+
accessToken?: string | undefined;
|
|
145
|
+
}>>;
|
|
146
|
+
/**
|
|
147
|
+
* Transaction Handle
|
|
148
|
+
* If the operation is part of a transaction, use this handle for side-effects.
|
|
149
|
+
*/
|
|
150
|
+
transaction: z.ZodOptional<z.ZodAny>;
|
|
151
|
+
/**
|
|
152
|
+
* Engine Access
|
|
153
|
+
* Reference to the ObjectQL engine for performing side effects.
|
|
154
|
+
*/
|
|
155
|
+
ql: z.ZodAny;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
object: string;
|
|
158
|
+
event: "beforeFind" | "afterFind" | "beforeFindOne" | "afterFindOne" | "beforeCount" | "afterCount" | "beforeAggregate" | "afterAggregate" | "beforeInsert" | "afterInsert" | "beforeUpdate" | "afterUpdate" | "beforeDelete" | "afterDelete" | "beforeUpdateMany" | "afterUpdateMany" | "beforeDeleteMany" | "afterDeleteMany";
|
|
159
|
+
input: Record<string, any>;
|
|
160
|
+
id?: string | undefined;
|
|
161
|
+
result?: any;
|
|
162
|
+
previous?: Record<string, any> | undefined;
|
|
163
|
+
session?: {
|
|
164
|
+
userId?: string | undefined;
|
|
165
|
+
tenantId?: string | undefined;
|
|
166
|
+
roles?: string[] | undefined;
|
|
167
|
+
accessToken?: string | undefined;
|
|
168
|
+
} | undefined;
|
|
169
|
+
transaction?: any;
|
|
170
|
+
ql?: any;
|
|
171
|
+
}, {
|
|
172
|
+
object: string;
|
|
173
|
+
event: "beforeFind" | "afterFind" | "beforeFindOne" | "afterFindOne" | "beforeCount" | "afterCount" | "beforeAggregate" | "afterAggregate" | "beforeInsert" | "afterInsert" | "beforeUpdate" | "afterUpdate" | "beforeDelete" | "afterDelete" | "beforeUpdateMany" | "afterUpdateMany" | "beforeDeleteMany" | "afterDeleteMany";
|
|
174
|
+
input: Record<string, any>;
|
|
175
|
+
id?: string | undefined;
|
|
176
|
+
result?: any;
|
|
177
|
+
previous?: Record<string, any> | undefined;
|
|
178
|
+
session?: {
|
|
179
|
+
userId?: string | undefined;
|
|
180
|
+
tenantId?: string | undefined;
|
|
181
|
+
roles?: string[] | undefined;
|
|
182
|
+
accessToken?: string | undefined;
|
|
183
|
+
} | undefined;
|
|
184
|
+
transaction?: any;
|
|
185
|
+
ql?: any;
|
|
186
|
+
}>;
|
|
187
|
+
export type Hook = z.input<typeof HookSchema>;
|
|
188
|
+
export type ResolvedHook = z.output<typeof HookSchema>;
|
|
189
|
+
export type HookEventType = z.infer<typeof HookEvent>;
|
|
190
|
+
export type HookContext = z.infer<typeof HookContextSchema>;
|
|
191
|
+
//# sourceMappingURL=hook.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.zod.d.ts","sourceRoot":"","sources":["../../src/data/hook.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,SAAS,sTAepB,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU;IACrB;;;OAGG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;;;;OAMG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;IAC5B,iBAAiB;;IAGjB,yBAAyB;;IAGzB,8BAA8B;;IAG9B;;;;;;;;;;OAUG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;IAQH;;;OAGG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AACvD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AACtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HookContextSchema = exports.HookSchema = exports.HookEvent = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Hook Lifecycle Events
|
|
7
|
+
* Defines the interception points in the ObjectQL execution pipeline.
|
|
8
|
+
*/
|
|
9
|
+
exports.HookEvent = zod_1.z.enum([
|
|
10
|
+
// Read Operations
|
|
11
|
+
'beforeFind', 'afterFind',
|
|
12
|
+
'beforeFindOne', 'afterFindOne',
|
|
13
|
+
'beforeCount', 'afterCount',
|
|
14
|
+
'beforeAggregate', 'afterAggregate',
|
|
15
|
+
// Write Operations
|
|
16
|
+
'beforeInsert', 'afterInsert',
|
|
17
|
+
'beforeUpdate', 'afterUpdate',
|
|
18
|
+
'beforeDelete', 'afterDelete',
|
|
19
|
+
// Bulk Operations (Query-based)
|
|
20
|
+
'beforeUpdateMany', 'afterUpdateMany',
|
|
21
|
+
'beforeDeleteMany', 'afterDeleteMany',
|
|
22
|
+
]);
|
|
23
|
+
/**
|
|
24
|
+
* Hook Definition Schema
|
|
25
|
+
*
|
|
26
|
+
* Hooks serve as the "Logic Layer" in ObjectStack, allowing developers to
|
|
27
|
+
* inject custom code during the data access lifecycle.
|
|
28
|
+
*
|
|
29
|
+
* Use cases:
|
|
30
|
+
* - Data Enrichment (Default values, Calculated fields)
|
|
31
|
+
* - Validation (Complex business rules)
|
|
32
|
+
* - Side Effects (Sending emails, Syncing to external systems)
|
|
33
|
+
* - Security (Filtering data based on context)
|
|
34
|
+
*/
|
|
35
|
+
exports.HookSchema = zod_1.z.object({
|
|
36
|
+
/**
|
|
37
|
+
* Unique identifier for the hook
|
|
38
|
+
* Required for debugging and overriding.
|
|
39
|
+
*/
|
|
40
|
+
name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Hook unique name (snake_case)'),
|
|
41
|
+
/**
|
|
42
|
+
* Human readable label
|
|
43
|
+
*/
|
|
44
|
+
label: zod_1.z.string().optional().describe('Description of what this hook does'),
|
|
45
|
+
/**
|
|
46
|
+
* Target Object(s)
|
|
47
|
+
* can be:
|
|
48
|
+
* - Single object: "account"
|
|
49
|
+
* - List of objects: ["account", "contact"]
|
|
50
|
+
* - Wildcard: "*" (All objects)
|
|
51
|
+
*/
|
|
52
|
+
object: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).describe('Target object(s)'),
|
|
53
|
+
/**
|
|
54
|
+
* Events to subscribe to
|
|
55
|
+
* Combinations of timing (before/after) and action (find/insert/update/delete/etc)
|
|
56
|
+
*/
|
|
57
|
+
events: zod_1.z.array(exports.HookEvent).describe('Lifecycle events'),
|
|
58
|
+
/**
|
|
59
|
+
* Handler Logic
|
|
60
|
+
* Reference to a registered function in the plugin system OR a direct function (runtime only).
|
|
61
|
+
*/
|
|
62
|
+
handler: zod_1.z.union([zod_1.z.string(), zod_1.z.any()]).optional().describe('Function handler name or direct function'),
|
|
63
|
+
/**
|
|
64
|
+
* Execution Order
|
|
65
|
+
* Lower numbers run first.
|
|
66
|
+
* - System Hooks: 0-99
|
|
67
|
+
* - App Hooks: 100-999
|
|
68
|
+
* - User Hooks: 1000+
|
|
69
|
+
*/
|
|
70
|
+
priority: zod_1.z.number().default(100).describe('Execution priority'),
|
|
71
|
+
/**
|
|
72
|
+
* Async / Background Execution
|
|
73
|
+
* If true, the hook runs in the background and does not block the transaction.
|
|
74
|
+
* Only applicable for 'after*' events.
|
|
75
|
+
* Default: false (Blocking)
|
|
76
|
+
*/
|
|
77
|
+
async: zod_1.z.boolean().default(false).describe('Run specifically as fire-and-forget'),
|
|
78
|
+
/**
|
|
79
|
+
* Error Policy
|
|
80
|
+
* What to do if the hook throws an exception?
|
|
81
|
+
* - abort: Rollback transaction (if blocking)
|
|
82
|
+
* - log: Log error and continue
|
|
83
|
+
*/
|
|
84
|
+
onError: zod_1.z.enum(['abort', 'log']).default('abort').describe('Error handling strategy'),
|
|
85
|
+
});
|
|
86
|
+
/**
|
|
87
|
+
* Hook Runtime Context
|
|
88
|
+
* Defines what is available to the hook handler during execution.
|
|
89
|
+
*
|
|
90
|
+
* Best Practices:
|
|
91
|
+
* - **Immutability**: `object`, `event`, `id` are immutable.
|
|
92
|
+
* - **Mutability**: `input` and `result` are mutable to allow transformation.
|
|
93
|
+
* - **Encapsulation**: `session` isolates auth info; `transaction` ensures atomicity.
|
|
94
|
+
*/
|
|
95
|
+
exports.HookContextSchema = zod_1.z.object({
|
|
96
|
+
/** Tracing ID */
|
|
97
|
+
id: zod_1.z.string().optional().describe('Unique execution ID for tracing'),
|
|
98
|
+
/** Target Object Name */
|
|
99
|
+
object: zod_1.z.string(),
|
|
100
|
+
/** Current Lifecycle Event */
|
|
101
|
+
event: exports.HookEvent,
|
|
102
|
+
/**
|
|
103
|
+
* Input Parameters (Mutable)
|
|
104
|
+
* Modify this to change the behavior of the operation.
|
|
105
|
+
*
|
|
106
|
+
* - find: { query: QueryAST, options: DriverOptions }
|
|
107
|
+
* - insert: { doc: Record, options: DriverOptions }
|
|
108
|
+
* - update: { id: ID, doc: Record, options: DriverOptions }
|
|
109
|
+
* - delete: { id: ID, options: DriverOptions }
|
|
110
|
+
* - updateMany: { query: QueryAST, doc: Record, options: DriverOptions }
|
|
111
|
+
* - deleteMany: { query: QueryAST, options: DriverOptions }
|
|
112
|
+
*/
|
|
113
|
+
input: zod_1.z.record(zod_1.z.any()).describe('Mutable input parameters'),
|
|
114
|
+
/**
|
|
115
|
+
* Operation Result (Mutable)
|
|
116
|
+
* Available in 'after*' events. Modify this to transform the output.
|
|
117
|
+
*/
|
|
118
|
+
result: zod_1.z.any().optional().describe('Operation result (After hooks only)'),
|
|
119
|
+
/**
|
|
120
|
+
* Data Snapshot
|
|
121
|
+
* The state of the record BEFORE the operation (for update/delete).
|
|
122
|
+
*/
|
|
123
|
+
previous: zod_1.z.record(zod_1.z.any()).optional().describe('Record state before operation'),
|
|
124
|
+
/**
|
|
125
|
+
* Execution Session
|
|
126
|
+
* Contains authentication and tenancy information.
|
|
127
|
+
*/
|
|
128
|
+
session: zod_1.z.object({
|
|
129
|
+
userId: zod_1.z.string().optional(),
|
|
130
|
+
tenantId: zod_1.z.string().optional(),
|
|
131
|
+
roles: zod_1.z.array(zod_1.z.string()).optional(),
|
|
132
|
+
accessToken: zod_1.z.string().optional(),
|
|
133
|
+
}).optional().describe('Current session context'),
|
|
134
|
+
/**
|
|
135
|
+
* Transaction Handle
|
|
136
|
+
* If the operation is part of a transaction, use this handle for side-effects.
|
|
137
|
+
*/
|
|
138
|
+
transaction: zod_1.z.any().optional().describe('Database transaction handle'),
|
|
139
|
+
/**
|
|
140
|
+
* Engine Access
|
|
141
|
+
* Reference to the ObjectQL engine for performing side effects.
|
|
142
|
+
*/
|
|
143
|
+
ql: zod_1.z.any().describe('ObjectQL Engine Reference'),
|
|
144
|
+
});
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Core Business Logic & Data Modeling
|
|
5
|
-
* - Object, Field, Validation
|
|
6
|
-
* - Query (AST), Mapping (ETL)
|
|
7
|
-
* - Permission, Sharing, Flow
|
|
8
|
-
*/
|
|
9
|
-
export * from './field.zod';
|
|
1
|
+
export * from './query.zod';
|
|
2
|
+
export * from './filter.zod';
|
|
10
3
|
export * from './object.zod';
|
|
4
|
+
export * from './field.zod';
|
|
11
5
|
export * from './validation.zod';
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './sharing.zod';
|
|
14
|
-
export * from './workflow.zod';
|
|
15
|
-
export * from './flow.zod';
|
|
6
|
+
export * from './hook.zod';
|
|
16
7
|
export * from './dataset.zod';
|
|
17
|
-
export * from './query.zod';
|
|
18
|
-
export * from './filter.zod';
|
|
19
|
-
export * from './mapping.zod';
|
|
20
|
-
export * from './trigger.zod';
|
|
21
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/data/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAE3B,cAAc,eAAe,CAAC"}
|
package/dist/data/index.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Data Protocol Exports
|
|
4
|
-
*
|
|
5
|
-
* Core Business Logic & Data Modeling
|
|
6
|
-
* - Object, Field, Validation
|
|
7
|
-
* - Query (AST), Mapping (ETL)
|
|
8
|
-
* - Permission, Sharing, Flow
|
|
9
|
-
*/
|
|
10
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
3
|
if (k2 === undefined) k2 = k;
|
|
12
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -22,15 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
22
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
15
|
};
|
|
24
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./query.zod"), exports);
|
|
18
|
+
__exportStar(require("./filter.zod"), exports);
|
|
26
19
|
__exportStar(require("./object.zod"), exports);
|
|
20
|
+
__exportStar(require("./field.zod"), exports);
|
|
27
21
|
__exportStar(require("./validation.zod"), exports);
|
|
28
|
-
__exportStar(require("./
|
|
29
|
-
__exportStar(require("./sharing.zod"), exports);
|
|
30
|
-
__exportStar(require("./workflow.zod"), exports);
|
|
31
|
-
__exportStar(require("./flow.zod"), exports);
|
|
22
|
+
__exportStar(require("./hook.zod"), exports);
|
|
32
23
|
__exportStar(require("./dataset.zod"), exports);
|
|
33
|
-
__exportStar(require("./query.zod"), exports);
|
|
34
|
-
__exportStar(require("./filter.zod"), exports);
|
|
35
|
-
__exportStar(require("./mapping.zod"), exports);
|
|
36
|
-
__exportStar(require("./trigger.zod"), exports);
|