@objectstack/spec 0.3.0 → 0.3.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.
Files changed (386) hide show
  1. package/dist/ai/conversation.zod.d.ts +1059 -0
  2. package/dist/ai/conversation.zod.d.ts.map +1 -0
  3. package/dist/ai/conversation.zod.js +248 -0
  4. package/dist/ai/cost.zod.d.ts +2025 -0
  5. package/dist/ai/cost.zod.d.ts.map +1 -0
  6. package/dist/ai/cost.zod.js +324 -0
  7. package/dist/ai/index.d.ts +8 -0
  8. package/dist/ai/index.d.ts.map +1 -1
  9. package/dist/ai/index.js +8 -0
  10. package/dist/ai/model-registry.zod.d.ts +53 -53
  11. package/dist/ai/nlq.zod.d.ts +24 -24
  12. package/dist/ai/predictive.zod.d.ts +838 -0
  13. package/dist/ai/predictive.zod.d.ts.map +1 -0
  14. package/dist/ai/predictive.zod.js +244 -0
  15. package/dist/ai/rag-pipeline.zod.d.ts +22 -22
  16. package/dist/ai/workflow-automation.zod.d.ts +590 -0
  17. package/dist/ai/workflow-automation.zod.d.ts.map +1 -0
  18. package/dist/ai/workflow-automation.zod.js +197 -0
  19. package/dist/api/contract.zod.d.ts +22 -22
  20. package/dist/data/field.zod.d.ts +409 -4
  21. package/dist/data/field.zod.d.ts.map +1 -1
  22. package/dist/data/field.zod.js +28 -2
  23. package/dist/data/mapping.zod.d.ts +6 -6
  24. package/dist/data/object.zod.d.ts +80 -10
  25. package/dist/data/object.zod.d.ts.map +1 -1
  26. package/dist/data/workflow.zod.d.ts +809 -18
  27. package/dist/data/workflow.zod.d.ts.map +1 -1
  28. package/dist/data/workflow.zod.js +115 -7
  29. package/dist/system/api.zod.d.ts +4 -4
  30. package/dist/system/audit.zod.d.ts +1172 -0
  31. package/dist/system/audit.zod.d.ts.map +1 -0
  32. package/dist/system/audit.zod.js +596 -0
  33. package/dist/system/auth.zod.d.ts +8 -8
  34. package/dist/system/driver.zod.d.ts +4 -4
  35. package/dist/system/events.zod.d.ts +177 -0
  36. package/dist/system/events.zod.d.ts.map +1 -0
  37. package/dist/system/events.zod.js +51 -0
  38. package/dist/system/identity.zod.d.ts +4 -4
  39. package/dist/system/index.d.ts +5 -0
  40. package/dist/system/index.d.ts.map +1 -1
  41. package/dist/system/index.js +5 -0
  42. package/dist/system/job.zod.d.ts +237 -0
  43. package/dist/system/job.zod.d.ts.map +1 -0
  44. package/dist/system/job.zod.js +82 -0
  45. package/dist/system/manifest.zod.d.ts +10 -10
  46. package/dist/system/realtime.zod.d.ts +135 -0
  47. package/dist/system/realtime.zod.d.ts.map +1 -0
  48. package/dist/system/realtime.zod.js +83 -0
  49. package/dist/system/tenant.zod.d.ts +1151 -0
  50. package/dist/system/tenant.zod.d.ts.map +1 -0
  51. package/dist/system/tenant.zod.js +498 -0
  52. package/dist/system/webhook.zod.d.ts +2 -2
  53. package/dist/ui/action.zod.d.ts +8 -8
  54. package/dist/ui/theme.zod.d.ts +12 -12
  55. package/dist/ui/widget.zod.d.ts +40 -5
  56. package/dist/ui/widget.zod.d.ts.map +1 -1
  57. package/json-schema/README.md +127 -0
  58. package/json-schema/ai/AITask.json +123 -0
  59. package/json-schema/ai/AITaskType.json +21 -0
  60. package/json-schema/ai/AIWorkflowAutomation.json +379 -0
  61. package/json-schema/ai/AIWorkflowExecutionResult.json +105 -0
  62. package/json-schema/ai/AIWorkflowTrigger.json +18 -0
  63. package/json-schema/ai/BatchAIWorkflowExecution.json +48 -0
  64. package/json-schema/ai/BillingPeriod.json +18 -0
  65. package/json-schema/ai/BudgetLimit.json +111 -0
  66. package/json-schema/ai/BudgetStatus.json +91 -0
  67. package/json-schema/ai/BudgetType.json +17 -0
  68. package/json-schema/ai/ConversationAnalytics.json +86 -0
  69. package/json-schema/ai/ConversationContext.json +48 -0
  70. package/json-schema/ai/ConversationMessage.json +209 -0
  71. package/json-schema/ai/ConversationSession.json +458 -0
  72. package/json-schema/ai/ConversationSummary.json +73 -0
  73. package/json-schema/ai/CostAlert.json +107 -0
  74. package/json-schema/ai/CostAlertType.json +16 -0
  75. package/json-schema/ai/CostAnalytics.json +589 -0
  76. package/json-schema/ai/CostBreakdownDimension.json +20 -0
  77. package/json-schema/ai/CostBreakdownEntry.json +60 -0
  78. package/json-schema/ai/CostEntry.json +106 -0
  79. package/json-schema/ai/CostMetricType.json +17 -0
  80. package/json-schema/ai/CostOptimizationRecommendation.json +100 -0
  81. package/json-schema/ai/CostQueryFilters.json +112 -0
  82. package/json-schema/ai/CostReport.json +964 -0
  83. package/json-schema/ai/EvaluationMetrics.json +64 -0
  84. package/json-schema/ai/FunctionCall.json +28 -0
  85. package/json-schema/ai/Hyperparameters.json +80 -0
  86. package/json-schema/ai/MessageContent.json +46 -0
  87. package/json-schema/ai/MessageContentType.json +16 -0
  88. package/json-schema/ai/MessagePruningEvent.json +92 -0
  89. package/json-schema/ai/MessageRole.json +16 -0
  90. package/json-schema/ai/ModelDrift.json +73 -0
  91. package/json-schema/ai/ModelFeature.json +71 -0
  92. package/json-schema/ai/PostProcessingAction.json +41 -0
  93. package/json-schema/ai/PredictionRequest.json +39 -0
  94. package/json-schema/ai/PredictionResult.json +82 -0
  95. package/json-schema/ai/PredictiveModel.json +445 -0
  96. package/json-schema/ai/PredictiveModelType.json +18 -0
  97. package/json-schema/ai/TokenBudgetConfig.json +92 -0
  98. package/json-schema/ai/TokenBudgetStrategy.json +16 -0
  99. package/json-schema/ai/TokenUsageStats.json +66 -0
  100. package/json-schema/ai/ToolCall.json +49 -0
  101. package/json-schema/ai/TrainingConfig.json +88 -0
  102. package/json-schema/ai/WorkflowFieldCondition.json +33 -0
  103. package/json-schema/ai/WorkflowSchedule.json +51 -0
  104. package/json-schema/data/CustomScriptAction.json +49 -0
  105. package/json-schema/{Field.json → data/Field.json} +50 -1
  106. package/json-schema/{FieldType.json → data/FieldType.json} +4 -1
  107. package/json-schema/data/HttpCallAction.json +81 -0
  108. package/json-schema/{Object.json → data/Object.json} +50 -1
  109. package/json-schema/data/PushNotificationAction.json +59 -0
  110. package/json-schema/data/SlackMessageAction.json +45 -0
  111. package/json-schema/data/SmsNotificationAction.json +50 -0
  112. package/json-schema/data/TaskCreationAction.json +59 -0
  113. package/json-schema/data/TeamsMessageAction.json +45 -0
  114. package/json-schema/data/WebhookTriggerAction.json +58 -0
  115. package/json-schema/data/WorkflowAction.json +465 -0
  116. package/json-schema/data/WorkflowRule.json +509 -0
  117. package/json-schema/system/AuditConfig.json +587 -0
  118. package/json-schema/system/AuditEvent.json +232 -0
  119. package/json-schema/system/AuditEventActor.json +48 -0
  120. package/json-schema/system/AuditEventChange.json +25 -0
  121. package/json-schema/system/AuditEventFilter.json +127 -0
  122. package/json-schema/system/AuditEventSeverity.json +19 -0
  123. package/json-schema/system/AuditEventTarget.json +33 -0
  124. package/json-schema/system/AuditEventType.json +53 -0
  125. package/json-schema/system/AuditRetentionPolicy.json +73 -0
  126. package/json-schema/system/AuditStorageConfig.json +60 -0
  127. package/json-schema/system/CronSchedule.json +29 -0
  128. package/json-schema/system/DatabaseLevelIsolationStrategy.json +139 -0
  129. package/json-schema/system/Event.json +52 -0
  130. package/json-schema/system/EventHandler.json +29 -0
  131. package/json-schema/system/EventMetadata.json +33 -0
  132. package/json-schema/system/EventPersistence.json +25 -0
  133. package/json-schema/system/EventRoute.json +27 -0
  134. package/json-schema/system/IntervalSchedule.json +25 -0
  135. package/json-schema/system/Job.json +127 -0
  136. package/json-schema/system/JobExecution.json +49 -0
  137. package/json-schema/system/JobExecutionStatus.json +15 -0
  138. package/json-schema/system/LevelIsolationStrategySchema.json +93 -0
  139. package/json-schema/system/OnceSchedule.json +25 -0
  140. package/json-schema/system/Presence.json +40 -0
  141. package/json-schema/system/PresenceStatus.json +14 -0
  142. package/json-schema/system/RealtimeAction.json +14 -0
  143. package/json-schema/system/RealtimeEvent.json +51 -0
  144. package/json-schema/system/RealtimeEventType.json +15 -0
  145. package/json-schema/system/RetryPolicy.json +30 -0
  146. package/json-schema/system/RowLevelIsolationStrategy.json +74 -0
  147. package/json-schema/system/Schedule.json +71 -0
  148. package/json-schema/system/Subscription.json +65 -0
  149. package/json-schema/system/SubscriptionEvent.json +32 -0
  150. package/json-schema/system/SuspiciousActivityRule.json +175 -0
  151. package/json-schema/system/Tenant.json +61 -0
  152. package/json-schema/system/TenantIsolationConfig.json +298 -0
  153. package/json-schema/system/TenantIsolationLevel.json +14 -0
  154. package/json-schema/system/TenantQuota.json +27 -0
  155. package/json-schema/system/TenantSecurityPolicy.json +115 -0
  156. package/json-schema/system/TransportProtocol.json +14 -0
  157. package/json-schema/{Action.json → ui/Action.json} +4 -1
  158. package/json-schema/{ActionParam.json → ui/ActionParam.json} +4 -1
  159. package/json-schema/{FieldWidgetProps.json → ui/FieldWidgetProps.json} +50 -1
  160. package/package.json +12 -12
  161. package/json-schema/AuthenticationConfig.json +0 -601
  162. package/json-schema/AuthenticationProvider.json +0 -617
  163. package/json-schema/MenuItem.json +0 -28
  164. package/json-schema/WorkflowAction.json +0 -84
  165. package/json-schema/WorkflowRule.json +0 -128
  166. /package/json-schema/{AIKnowledge.json → ai/AIKnowledge.json} +0 -0
  167. /package/json-schema/{AIModelConfig.json → ai/AIModelConfig.json} +0 -0
  168. /package/json-schema/{AITool.json → ai/AITool.json} +0 -0
  169. /package/json-schema/{Agent.json → ai/Agent.json} +0 -0
  170. /package/json-schema/{ChunkingStrategy.json → ai/ChunkingStrategy.json} +0 -0
  171. /package/json-schema/{DocumentChunk.json → ai/DocumentChunk.json} +0 -0
  172. /package/json-schema/{DocumentLoaderConfig.json → ai/DocumentLoaderConfig.json} +0 -0
  173. /package/json-schema/{DocumentMetadata.json → ai/DocumentMetadata.json} +0 -0
  174. /package/json-schema/{EmbeddingModel.json → ai/EmbeddingModel.json} +0 -0
  175. /package/json-schema/{Entity.json → ai/Entity.json} +0 -0
  176. /package/json-schema/{FieldSynonymConfig.json → ai/FieldSynonymConfig.json} +0 -0
  177. /package/json-schema/{ModelCapability.json → ai/ModelCapability.json} +0 -0
  178. /package/json-schema/{ModelConfig.json → ai/ModelConfig.json} +0 -0
  179. /package/json-schema/{ModelLimits.json → ai/ModelLimits.json} +0 -0
  180. /package/json-schema/{ModelPricing.json → ai/ModelPricing.json} +0 -0
  181. /package/json-schema/{ModelProvider.json → ai/ModelProvider.json} +0 -0
  182. /package/json-schema/{ModelRegistry.json → ai/ModelRegistry.json} +0 -0
  183. /package/json-schema/{ModelRegistryEntry.json → ai/ModelRegistryEntry.json} +0 -0
  184. /package/json-schema/{ModelSelectionCriteria.json → ai/ModelSelectionCriteria.json} +0 -0
  185. /package/json-schema/{NLQAnalytics.json → ai/NLQAnalytics.json} +0 -0
  186. /package/json-schema/{NLQFieldMapping.json → ai/NLQFieldMapping.json} +0 -0
  187. /package/json-schema/{NLQModelConfig.json → ai/NLQModelConfig.json} +0 -0
  188. /package/json-schema/{NLQParseResult.json → ai/NLQParseResult.json} +0 -0
  189. /package/json-schema/{NLQRequest.json → ai/NLQRequest.json} +0 -0
  190. /package/json-schema/{NLQResponse.json → ai/NLQResponse.json} +0 -0
  191. /package/json-schema/{NLQTrainingExample.json → ai/NLQTrainingExample.json} +0 -0
  192. /package/json-schema/{PromptTemplate.json → ai/PromptTemplate.json} +0 -0
  193. /package/json-schema/{PromptVariable.json → ai/PromptVariable.json} +0 -0
  194. /package/json-schema/{QueryContext.json → ai/QueryContext.json} +0 -0
  195. /package/json-schema/{QueryIntent.json → ai/QueryIntent.json} +0 -0
  196. /package/json-schema/{QueryTemplate.json → ai/QueryTemplate.json} +0 -0
  197. /package/json-schema/{RAGPipelineConfig.json → ai/RAGPipelineConfig.json} +0 -0
  198. /package/json-schema/{RAGPipelineStatus.json → ai/RAGPipelineStatus.json} +0 -0
  199. /package/json-schema/{RAGQueryRequest.json → ai/RAGQueryRequest.json} +0 -0
  200. /package/json-schema/{RAGQueryResponse.json → ai/RAGQueryResponse.json} +0 -0
  201. /package/json-schema/{RerankingConfig.json → ai/RerankingConfig.json} +0 -0
  202. /package/json-schema/{RetrievalStrategy.json → ai/RetrievalStrategy.json} +0 -0
  203. /package/json-schema/{Timeframe.json → ai/Timeframe.json} +0 -0
  204. /package/json-schema/{VectorStoreConfig.json → ai/VectorStoreConfig.json} +0 -0
  205. /package/json-schema/{VectorStoreProvider.json → ai/VectorStoreProvider.json} +0 -0
  206. /package/json-schema/{ApiError.json → api/ApiError.json} +0 -0
  207. /package/json-schema/{BaseResponse.json → api/BaseResponse.json} +0 -0
  208. /package/json-schema/{BulkRequest.json → api/BulkRequest.json} +0 -0
  209. /package/json-schema/{BulkResponse.json → api/BulkResponse.json} +0 -0
  210. /package/json-schema/{CreateRequest.json → api/CreateRequest.json} +0 -0
  211. /package/json-schema/{DeleteResponse.json → api/DeleteResponse.json} +0 -0
  212. /package/json-schema/{ExportRequest.json → api/ExportRequest.json} +0 -0
  213. /package/json-schema/{ListRecordResponse.json → api/ListRecordResponse.json} +0 -0
  214. /package/json-schema/{ModificationResult.json → api/ModificationResult.json} +0 -0
  215. /package/json-schema/{RecordData.json → api/RecordData.json} +0 -0
  216. /package/json-schema/{SingleRecordResponse.json → api/SingleRecordResponse.json} +0 -0
  217. /package/json-schema/{UpdateRequest.json → api/UpdateRequest.json} +0 -0
  218. /package/json-schema/{Address.json → data/Address.json} +0 -0
  219. /package/json-schema/{AggregationFunction.json → data/AggregationFunction.json} +0 -0
  220. /package/json-schema/{AggregationNode.json → data/AggregationNode.json} +0 -0
  221. /package/json-schema/{AsyncValidation.json → data/AsyncValidation.json} +0 -0
  222. /package/json-schema/{ComparisonOperator.json → data/ComparisonOperator.json} +0 -0
  223. /package/json-schema/{ConditionalValidation.json → data/ConditionalValidation.json} +0 -0
  224. /package/json-schema/{CrossFieldValidation.json → data/CrossFieldValidation.json} +0 -0
  225. /package/json-schema/{CustomValidator.json → data/CustomValidator.json} +0 -0
  226. /package/json-schema/{Dataset.json → data/Dataset.json} +0 -0
  227. /package/json-schema/{DatasetMode.json → data/DatasetMode.json} +0 -0
  228. /package/json-schema/{EmailAlertAction.json → data/EmailAlertAction.json} +0 -0
  229. /package/json-schema/{EqualityOperator.json → data/EqualityOperator.json} +0 -0
  230. /package/json-schema/{FieldMapping.json → data/FieldMapping.json} +0 -0
  231. /package/json-schema/{FieldNode.json → data/FieldNode.json} +0 -0
  232. /package/json-schema/{FieldOperators.json → data/FieldOperators.json} +0 -0
  233. /package/json-schema/{FieldPermission.json → data/FieldPermission.json} +0 -0
  234. /package/json-schema/{FieldUpdateAction.json → data/FieldUpdateAction.json} +0 -0
  235. /package/json-schema/{FilterCondition.json → data/FilterCondition.json} +0 -0
  236. /package/json-schema/{FilterNode.json → data/FilterNode.json} +0 -0
  237. /package/json-schema/{FilterOperator.json → data/FilterOperator.json} +0 -0
  238. /package/json-schema/{Flow.json → data/Flow.json} +0 -0
  239. /package/json-schema/{FlowEdge.json → data/FlowEdge.json} +0 -0
  240. /package/json-schema/{FlowNode.json → data/FlowNode.json} +0 -0
  241. /package/json-schema/{FlowNodeAction.json → data/FlowNodeAction.json} +0 -0
  242. /package/json-schema/{FlowVariable.json → data/FlowVariable.json} +0 -0
  243. /package/json-schema/{FormatValidation.json → data/FormatValidation.json} +0 -0
  244. /package/json-schema/{Index.json → data/Index.json} +0 -0
  245. /package/json-schema/{JoinNode.json → data/JoinNode.json} +0 -0
  246. /package/json-schema/{JoinType.json → data/JoinType.json} +0 -0
  247. /package/json-schema/{LocationCoordinates.json → data/LocationCoordinates.json} +0 -0
  248. /package/json-schema/{LogicOperator.json → data/LogicOperator.json} +0 -0
  249. /package/json-schema/{Mapping.json → data/Mapping.json} +0 -0
  250. /package/json-schema/{NormalizedFilter.json → data/NormalizedFilter.json} +0 -0
  251. /package/json-schema/{OWDModel.json → data/OWDModel.json} +0 -0
  252. /package/json-schema/{ObjectCapabilities.json → data/ObjectCapabilities.json} +0 -0
  253. /package/json-schema/{ObjectPermission.json → data/ObjectPermission.json} +0 -0
  254. /package/json-schema/{PermissionSet.json → data/PermissionSet.json} +0 -0
  255. /package/json-schema/{Query.json → data/Query.json} +0 -0
  256. /package/json-schema/{QueryFilter.json → data/QueryFilter.json} +0 -0
  257. /package/json-schema/{RangeOperator.json → data/RangeOperator.json} +0 -0
  258. /package/json-schema/{ScriptValidation.json → data/ScriptValidation.json} +0 -0
  259. /package/json-schema/{SelectOption.json → data/SelectOption.json} +0 -0
  260. /package/json-schema/{SetOperator.json → data/SetOperator.json} +0 -0
  261. /package/json-schema/{SharingLevel.json → data/SharingLevel.json} +0 -0
  262. /package/json-schema/{SharingRule.json → data/SharingRule.json} +0 -0
  263. /package/json-schema/{SharingRuleType.json → data/SharingRuleType.json} +0 -0
  264. /package/json-schema/{SortNode.json → data/SortNode.json} +0 -0
  265. /package/json-schema/{SpecialOperator.json → data/SpecialOperator.json} +0 -0
  266. /package/json-schema/{StateMachineValidation.json → data/StateMachineValidation.json} +0 -0
  267. /package/json-schema/{StringOperator.json → data/StringOperator.json} +0 -0
  268. /package/json-schema/{TransformType.json → data/TransformType.json} +0 -0
  269. /package/json-schema/{Trigger.json → data/Trigger.json} +0 -0
  270. /package/json-schema/{TriggerAction.json → data/TriggerAction.json} +0 -0
  271. /package/json-schema/{TriggerContext.json → data/TriggerContext.json} +0 -0
  272. /package/json-schema/{TriggerTiming.json → data/TriggerTiming.json} +0 -0
  273. /package/json-schema/{UniquenessValidation.json → data/UniquenessValidation.json} +0 -0
  274. /package/json-schema/{ValidationRule.json → data/ValidationRule.json} +0 -0
  275. /package/json-schema/{WindowFunction.json → data/WindowFunction.json} +0 -0
  276. /package/json-schema/{WindowFunctionNode.json → data/WindowFunctionNode.json} +0 -0
  277. /package/json-schema/{WindowSpec.json → data/WindowSpec.json} +0 -0
  278. /package/json-schema/{WorkflowTriggerType.json → data/WorkflowTriggerType.json} +0 -0
  279. /package/json-schema/{Account.json → system/Account.json} +0 -0
  280. /package/json-schema/{AccountLinkingConfig.json → system/AccountLinkingConfig.json} +0 -0
  281. /package/json-schema/{ApiCapabilities.json → system/ApiCapabilities.json} +0 -0
  282. /package/json-schema/{ApiEndpoint.json → system/ApiEndpoint.json} +0 -0
  283. /package/json-schema/{ApiMapping.json → system/ApiMapping.json} +0 -0
  284. /package/json-schema/{ApiRoutes.json → system/ApiRoutes.json} +0 -0
  285. /package/json-schema/{AuditPolicy.json → system/AuditPolicy.json} +0 -0
  286. /package/json-schema/{AuthConfig.json → system/AuthConfig.json} +0 -0
  287. /package/json-schema/{AuthPluginConfig.json → system/AuthPluginConfig.json} +0 -0
  288. /package/json-schema/{AuthStrategy.json → system/AuthStrategy.json} +0 -0
  289. /package/json-schema/{CSRFConfig.json → system/CSRFConfig.json} +0 -0
  290. /package/json-schema/{DatabaseAdapter.json → system/DatabaseAdapter.json} +0 -0
  291. /package/json-schema/{DatabaseMapping.json → system/DatabaseMapping.json} +0 -0
  292. /package/json-schema/{Datasource.json → system/Datasource.json} +0 -0
  293. /package/json-schema/{DatasourceCapabilities.json → system/DatasourceCapabilities.json} +0 -0
  294. /package/json-schema/{Discovery.json → system/Discovery.json} +0 -0
  295. /package/json-schema/{DriverCapabilities.json → system/DriverCapabilities.json} +0 -0
  296. /package/json-schema/{DriverDefinition.json → system/DriverDefinition.json} +0 -0
  297. /package/json-schema/{DriverInterface.json → system/DriverInterface.json} +0 -0
  298. /package/json-schema/{DriverOptions.json → system/DriverOptions.json} +0 -0
  299. /package/json-schema/{DriverType.json → system/DriverType.json} +0 -0
  300. /package/json-schema/{EmailPasswordConfig.json → system/EmailPasswordConfig.json} +0 -0
  301. /package/json-schema/{EnterpriseAuthConfig.json → system/EnterpriseAuthConfig.json} +0 -0
  302. /package/json-schema/{Feature.json → system/Feature.json} +0 -0
  303. /package/json-schema/{HttpMethod.json → system/HttpMethod.json} +0 -0
  304. /package/json-schema/{I18nContext.json → system/I18nContext.json} +0 -0
  305. /package/json-schema/{Invitation.json → system/Invitation.json} +0 -0
  306. /package/json-schema/{InvitationStatus.json → system/InvitationStatus.json} +0 -0
  307. /package/json-schema/{LDAPConfig.json → system/LDAPConfig.json} +0 -0
  308. /package/json-schema/{License.json → system/License.json} +0 -0
  309. /package/json-schema/{Locale.json → system/Locale.json} +0 -0
  310. /package/json-schema/{Logger.json → system/Logger.json} +0 -0
  311. /package/json-schema/{MagicLinkConfig.json → system/MagicLinkConfig.json} +0 -0
  312. /package/json-schema/{Manifest.json → system/Manifest.json} +0 -0
  313. /package/json-schema/{Member.json → system/Member.json} +0 -0
  314. /package/json-schema/{MetricType.json → system/MetricType.json} +0 -0
  315. /package/json-schema/{NetworkPolicy.json → system/NetworkPolicy.json} +0 -0
  316. /package/json-schema/{OAuthProvider.json → system/OAuthProvider.json} +0 -0
  317. /package/json-schema/{OIDCConfig.json → system/OIDCConfig.json} +0 -0
  318. /package/json-schema/{ObjectQLClient.json → system/ObjectQLClient.json} +0 -0
  319. /package/json-schema/{Organization.json → system/Organization.json} +0 -0
  320. /package/json-schema/{PasskeyConfig.json → system/PasskeyConfig.json} +0 -0
  321. /package/json-schema/{PasswordPolicy.json → system/PasswordPolicy.json} +0 -0
  322. /package/json-schema/{Plan.json → system/Plan.json} +0 -0
  323. /package/json-schema/{Plugin.json → system/Plugin.json} +0 -0
  324. /package/json-schema/{PluginContext.json → system/PluginContext.json} +0 -0
  325. /package/json-schema/{PluginLifecycle.json → system/PluginLifecycle.json} +0 -0
  326. /package/json-schema/{Policy.json → system/Policy.json} +0 -0
  327. /package/json-schema/{RateLimit.json → system/RateLimit.json} +0 -0
  328. /package/json-schema/{RateLimitConfig.json → system/RateLimitConfig.json} +0 -0
  329. /package/json-schema/{Role.json → system/Role.json} +0 -0
  330. /package/json-schema/{Router.json → system/Router.json} +0 -0
  331. /package/json-schema/{SAMLConfig.json → system/SAMLConfig.json} +0 -0
  332. /package/json-schema/{Scheduler.json → system/Scheduler.json} +0 -0
  333. /package/json-schema/{ScopedStorage.json → system/ScopedStorage.json} +0 -0
  334. /package/json-schema/{Session.json → system/Session.json} +0 -0
  335. /package/json-schema/{SessionConfig.json → system/SessionConfig.json} +0 -0
  336. /package/json-schema/{SessionPolicy.json → system/SessionPolicy.json} +0 -0
  337. /package/json-schema/{StandardAuthProvider.json → system/StandardAuthProvider.json} +0 -0
  338. /package/json-schema/{SystemAPI.json → system/SystemAPI.json} +0 -0
  339. /package/json-schema/{Territory.json → system/Territory.json} +0 -0
  340. /package/json-schema/{TerritoryModel.json → system/TerritoryModel.json} +0 -0
  341. /package/json-schema/{TerritoryType.json → system/TerritoryType.json} +0 -0
  342. /package/json-schema/{TranslationBundle.json → system/TranslationBundle.json} +0 -0
  343. /package/json-schema/{TranslationData.json → system/TranslationData.json} +0 -0
  344. /package/json-schema/{TwoFactorConfig.json → system/TwoFactorConfig.json} +0 -0
  345. /package/json-schema/{User.json → system/User.json} +0 -0
  346. /package/json-schema/{UserFieldMapping.json → system/UserFieldMapping.json} +0 -0
  347. /package/json-schema/{VerificationToken.json → system/VerificationToken.json} +0 -0
  348. /package/json-schema/{Webhook.json → system/Webhook.json} +0 -0
  349. /package/json-schema/{WebhookReceiver.json → system/WebhookReceiver.json} +0 -0
  350. /package/json-schema/{WebhookTriggerType.json → system/WebhookTriggerType.json} +0 -0
  351. /package/json-schema/{Animation.json → ui/Animation.json} +0 -0
  352. /package/json-schema/{App.json → ui/App.json} +0 -0
  353. /package/json-schema/{AppBranding.json → ui/AppBranding.json} +0 -0
  354. /package/json-schema/{BorderRadius.json → ui/BorderRadius.json} +0 -0
  355. /package/json-schema/{Breakpoints.json → ui/Breakpoints.json} +0 -0
  356. /package/json-schema/{CalendarConfig.json → ui/CalendarConfig.json} +0 -0
  357. /package/json-schema/{ChartType.json → ui/ChartType.json} +0 -0
  358. /package/json-schema/{ColorPalette.json → ui/ColorPalette.json} +0 -0
  359. /package/json-schema/{Dashboard.json → ui/Dashboard.json} +0 -0
  360. /package/json-schema/{DashboardNavItem.json → ui/DashboardNavItem.json} +0 -0
  361. /package/json-schema/{DashboardWidget.json → ui/DashboardWidget.json} +0 -0
  362. /package/json-schema/{FormSection.json → ui/FormSection.json} +0 -0
  363. /package/json-schema/{FormView.json → ui/FormView.json} +0 -0
  364. /package/json-schema/{GanttConfig.json → ui/GanttConfig.json} +0 -0
  365. /package/json-schema/{GroupNavItem.json → ui/GroupNavItem.json} +0 -0
  366. /package/json-schema/{KanbanConfig.json → ui/KanbanConfig.json} +0 -0
  367. /package/json-schema/{ListView.json → ui/ListView.json} +0 -0
  368. /package/json-schema/{NavigationItem.json → ui/NavigationItem.json} +0 -0
  369. /package/json-schema/{ObjectNavItem.json → ui/ObjectNavItem.json} +0 -0
  370. /package/json-schema/{Page.json → ui/Page.json} +0 -0
  371. /package/json-schema/{PageComponent.json → ui/PageComponent.json} +0 -0
  372. /package/json-schema/{PageNavItem.json → ui/PageNavItem.json} +0 -0
  373. /package/json-schema/{PageRegion.json → ui/PageRegion.json} +0 -0
  374. /package/json-schema/{Report.json → ui/Report.json} +0 -0
  375. /package/json-schema/{ReportChart.json → ui/ReportChart.json} +0 -0
  376. /package/json-schema/{ReportColumn.json → ui/ReportColumn.json} +0 -0
  377. /package/json-schema/{ReportGrouping.json → ui/ReportGrouping.json} +0 -0
  378. /package/json-schema/{ReportType.json → ui/ReportType.json} +0 -0
  379. /package/json-schema/{Shadow.json → ui/Shadow.json} +0 -0
  380. /package/json-schema/{Spacing.json → ui/Spacing.json} +0 -0
  381. /package/json-schema/{Theme.json → ui/Theme.json} +0 -0
  382. /package/json-schema/{ThemeMode.json → ui/ThemeMode.json} +0 -0
  383. /package/json-schema/{Typography.json → ui/Typography.json} +0 -0
  384. /package/json-schema/{UrlNavItem.json → ui/UrlNavItem.json} +0 -0
  385. /package/json-schema/{View.json → ui/View.json} +0 -0
  386. /package/json-schema/{ZIndex.json → ui/ZIndex.json} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.zod.d.ts","sourceRoot":"","sources":["../../src/system/audit.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AACH,eAAO,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGL,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,iCAAiC,EAAE,sBAAsB,EAwDrE,CAAC"}
@@ -0,0 +1,596 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_SUSPICIOUS_ACTIVITY_RULES = exports.AuditConfigSchema = exports.AuditEventFilterSchema = exports.AuditStorageConfigSchema = exports.SuspiciousActivityRuleSchema = exports.AuditRetentionPolicySchema = exports.AuditEventSchema = exports.AuditEventChangeSchema = exports.AuditEventTargetSchema = exports.AuditEventActorSchema = exports.AuditEventSeverity = exports.AuditEventType = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Audit Log Architecture
7
+ *
8
+ * Comprehensive audit logging system for compliance and security.
9
+ * Supports SOX, HIPAA, GDPR, and other regulatory requirements.
10
+ *
11
+ * Features:
12
+ * - Records all CRUD operations on data
13
+ * - Tracks authentication events (login, logout, password reset)
14
+ * - Monitors authorization changes (permissions, roles)
15
+ * - Configurable retention policies (180-day GDPR requirement)
16
+ * - Suspicious activity detection and alerting
17
+ */
18
+ /**
19
+ * Audit Event Type Enum
20
+ * Categorizes different types of auditable events in the system
21
+ */
22
+ exports.AuditEventType = zod_1.z.enum([
23
+ // Data Operations (CRUD)
24
+ 'data.create', // Record creation
25
+ 'data.read', // Record retrieval/viewing
26
+ 'data.update', // Record modification
27
+ 'data.delete', // Record deletion
28
+ 'data.export', // Data export operations
29
+ 'data.import', // Data import operations
30
+ 'data.bulk_update', // Bulk update operations
31
+ 'data.bulk_delete', // Bulk delete operations
32
+ // Authentication Events
33
+ 'auth.login', // Successful login
34
+ 'auth.login_failed', // Failed login attempt
35
+ 'auth.logout', // User logout
36
+ 'auth.session_created', // New session created
37
+ 'auth.session_expired', // Session expiration
38
+ 'auth.password_reset', // Password reset initiated
39
+ 'auth.password_changed', // Password successfully changed
40
+ 'auth.email_verified', // Email verification completed
41
+ 'auth.mfa_enabled', // Multi-factor auth enabled
42
+ 'auth.mfa_disabled', // Multi-factor auth disabled
43
+ 'auth.account_locked', // Account locked (too many failures)
44
+ 'auth.account_unlocked', // Account unlocked
45
+ // Authorization Events
46
+ 'authz.permission_granted', // Permission granted to user
47
+ 'authz.permission_revoked', // Permission revoked from user
48
+ 'authz.role_assigned', // Role assigned to user
49
+ 'authz.role_removed', // Role removed from user
50
+ 'authz.role_created', // New role created
51
+ 'authz.role_updated', // Role permissions modified
52
+ 'authz.role_deleted', // Role deleted
53
+ 'authz.policy_created', // Security policy created
54
+ 'authz.policy_updated', // Security policy updated
55
+ 'authz.policy_deleted', // Security policy deleted
56
+ // System Events
57
+ 'system.config_changed', // System configuration modified
58
+ 'system.plugin_installed', // Plugin installed
59
+ 'system.plugin_uninstalled', // Plugin uninstalled
60
+ 'system.backup_created', // Backup created
61
+ 'system.backup_restored', // Backup restored
62
+ 'system.integration_added', // External integration added
63
+ 'system.integration_removed', // External integration removed
64
+ // Security Events
65
+ 'security.access_denied', // Access denied (authorization failure)
66
+ 'security.suspicious_activity', // Suspicious activity detected
67
+ 'security.data_breach', // Potential data breach detected
68
+ 'security.api_key_created', // API key created
69
+ 'security.api_key_revoked', // API key revoked
70
+ ]);
71
+ /**
72
+ * Audit Event Severity Level
73
+ * Indicates the importance/criticality of an audit event
74
+ */
75
+ exports.AuditEventSeverity = zod_1.z.enum([
76
+ 'debug', // Diagnostic information
77
+ 'info', // Informational events (normal operations)
78
+ 'notice', // Normal but significant events
79
+ 'warning', // Warning conditions
80
+ 'error', // Error conditions
81
+ 'critical', // Critical conditions requiring immediate attention
82
+ 'alert', // Action must be taken immediately
83
+ 'emergency', // System is unusable
84
+ ]);
85
+ /**
86
+ * Audit Event Actor Schema
87
+ * Identifies who/what performed the action
88
+ */
89
+ exports.AuditEventActorSchema = zod_1.z.object({
90
+ /**
91
+ * Actor type (user, system, service, api_client, etc.)
92
+ */
93
+ type: zod_1.z.enum(['user', 'system', 'service', 'api_client', 'integration']).describe('Actor type'),
94
+ /**
95
+ * Unique identifier for the actor
96
+ */
97
+ id: zod_1.z.string().describe('Actor identifier'),
98
+ /**
99
+ * Display name of the actor
100
+ */
101
+ name: zod_1.z.string().optional().describe('Actor display name'),
102
+ /**
103
+ * Email address (for user actors)
104
+ */
105
+ email: zod_1.z.string().email().optional().describe('Actor email address'),
106
+ /**
107
+ * IP address of the actor
108
+ */
109
+ ipAddress: zod_1.z.string().optional().describe('Actor IP address'),
110
+ /**
111
+ * User agent string (for web/API requests)
112
+ */
113
+ userAgent: zod_1.z.string().optional().describe('User agent string'),
114
+ });
115
+ /**
116
+ * Audit Event Target Schema
117
+ * Identifies what was acted upon
118
+ */
119
+ exports.AuditEventTargetSchema = zod_1.z.object({
120
+ /**
121
+ * Target type (e.g., 'object', 'record', 'user', 'role', 'config')
122
+ */
123
+ type: zod_1.z.string().describe('Target type'),
124
+ /**
125
+ * Unique identifier for the target
126
+ */
127
+ id: zod_1.z.string().describe('Target identifier'),
128
+ /**
129
+ * Display name of the target
130
+ */
131
+ name: zod_1.z.string().optional().describe('Target display name'),
132
+ /**
133
+ * Additional metadata about the target
134
+ */
135
+ metadata: zod_1.z.record(zod_1.z.any()).optional().describe('Target metadata'),
136
+ });
137
+ /**
138
+ * Audit Event Change Schema
139
+ * Describes what changed (for update operations)
140
+ */
141
+ exports.AuditEventChangeSchema = zod_1.z.object({
142
+ /**
143
+ * Field/property that changed
144
+ */
145
+ field: zod_1.z.string().describe('Changed field name'),
146
+ /**
147
+ * Value before the change
148
+ */
149
+ oldValue: zod_1.z.any().optional().describe('Previous value'),
150
+ /**
151
+ * Value after the change
152
+ */
153
+ newValue: zod_1.z.any().optional().describe('New value'),
154
+ });
155
+ /**
156
+ * Audit Event Schema
157
+ * Complete audit event record
158
+ */
159
+ exports.AuditEventSchema = zod_1.z.object({
160
+ /**
161
+ * Unique identifier for this audit event
162
+ */
163
+ id: zod_1.z.string().describe('Audit event ID'),
164
+ /**
165
+ * Type of event being audited
166
+ */
167
+ eventType: exports.AuditEventType.describe('Event type'),
168
+ /**
169
+ * Severity level of the event
170
+ */
171
+ severity: exports.AuditEventSeverity.default('info').describe('Event severity'),
172
+ /**
173
+ * Timestamp when the event occurred (ISO 8601)
174
+ */
175
+ timestamp: zod_1.z.string().datetime().describe('Event timestamp'),
176
+ /**
177
+ * Who/what performed the action
178
+ */
179
+ actor: exports.AuditEventActorSchema.describe('Event actor'),
180
+ /**
181
+ * What was acted upon
182
+ */
183
+ target: exports.AuditEventTargetSchema.optional().describe('Event target'),
184
+ /**
185
+ * Human-readable description of the action
186
+ */
187
+ description: zod_1.z.string().describe('Event description'),
188
+ /**
189
+ * Detailed changes (for update operations)
190
+ */
191
+ changes: zod_1.z.array(exports.AuditEventChangeSchema).optional().describe('List of changes'),
192
+ /**
193
+ * Result of the action (success, failure, partial)
194
+ */
195
+ result: zod_1.z.enum(['success', 'failure', 'partial']).default('success').describe('Action result'),
196
+ /**
197
+ * Error message (if result is failure)
198
+ */
199
+ errorMessage: zod_1.z.string().optional().describe('Error message'),
200
+ /**
201
+ * Tenant identifier (for multi-tenant systems)
202
+ */
203
+ tenantId: zod_1.z.string().optional().describe('Tenant identifier'),
204
+ /**
205
+ * Request/trace ID for correlation
206
+ */
207
+ requestId: zod_1.z.string().optional().describe('Request ID for tracing'),
208
+ /**
209
+ * Additional context and metadata
210
+ */
211
+ metadata: zod_1.z.record(zod_1.z.any()).optional().describe('Additional metadata'),
212
+ /**
213
+ * Geographic location (if available)
214
+ */
215
+ location: zod_1.z.object({
216
+ country: zod_1.z.string().optional(),
217
+ region: zod_1.z.string().optional(),
218
+ city: zod_1.z.string().optional(),
219
+ }).optional().describe('Geographic location'),
220
+ });
221
+ /**
222
+ * Audit Retention Policy Schema
223
+ * Defines how long audit logs are retained
224
+ */
225
+ exports.AuditRetentionPolicySchema = zod_1.z.object({
226
+ /**
227
+ * Retention period in days
228
+ * Default: 180 days (GDPR 6-month requirement)
229
+ */
230
+ retentionDays: zod_1.z.number().int().min(1).default(180).describe('Retention period in days'),
231
+ /**
232
+ * Whether to archive logs after retention period
233
+ * If true, logs are moved to cold storage; if false, they are deleted
234
+ */
235
+ archiveAfterRetention: zod_1.z.boolean().default(true).describe('Archive logs after retention period'),
236
+ /**
237
+ * Archive storage configuration
238
+ */
239
+ archiveStorage: zod_1.z.object({
240
+ type: zod_1.z.enum(['s3', 'gcs', 'azure_blob', 'filesystem']).describe('Archive storage type'),
241
+ endpoint: zod_1.z.string().optional().describe('Storage endpoint URL'),
242
+ bucket: zod_1.z.string().optional().describe('Storage bucket/container name'),
243
+ path: zod_1.z.string().optional().describe('Storage path prefix'),
244
+ credentials: zod_1.z.record(zod_1.z.any()).optional().describe('Storage credentials'),
245
+ }).optional().describe('Archive storage configuration'),
246
+ /**
247
+ * Event types that have different retention periods
248
+ * Overrides the default retentionDays for specific event types
249
+ */
250
+ customRetention: zod_1.z.record(zod_1.z.number().int().positive()).optional().describe('Custom retention by event type'),
251
+ /**
252
+ * Minimum retention period for compliance
253
+ * Prevents accidental deletion below compliance requirements
254
+ */
255
+ minimumRetentionDays: zod_1.z.number().int().positive().optional().describe('Minimum retention for compliance'),
256
+ });
257
+ /**
258
+ * Suspicious Activity Rule Schema
259
+ * Defines rules for detecting suspicious activities
260
+ */
261
+ exports.SuspiciousActivityRuleSchema = zod_1.z.object({
262
+ /**
263
+ * Unique identifier for the rule
264
+ */
265
+ id: zod_1.z.string().describe('Rule identifier'),
266
+ /**
267
+ * Rule name
268
+ */
269
+ name: zod_1.z.string().describe('Rule name'),
270
+ /**
271
+ * Rule description
272
+ */
273
+ description: zod_1.z.string().optional().describe('Rule description'),
274
+ /**
275
+ * Whether the rule is enabled
276
+ */
277
+ enabled: zod_1.z.boolean().default(true).describe('Rule enabled status'),
278
+ /**
279
+ * Event types to monitor
280
+ */
281
+ eventTypes: zod_1.z.array(exports.AuditEventType).describe('Event types to monitor'),
282
+ /**
283
+ * Detection condition
284
+ */
285
+ condition: zod_1.z.object({
286
+ /**
287
+ * Number of events that trigger the rule
288
+ */
289
+ threshold: zod_1.z.number().int().positive().describe('Event threshold'),
290
+ /**
291
+ * Time window in seconds
292
+ */
293
+ windowSeconds: zod_1.z.number().int().positive().describe('Time window in seconds'),
294
+ /**
295
+ * Grouping criteria (e.g., by actor.id, by ipAddress)
296
+ */
297
+ groupBy: zod_1.z.array(zod_1.z.string()).optional().describe('Grouping criteria'),
298
+ /**
299
+ * Additional filters
300
+ */
301
+ filters: zod_1.z.record(zod_1.z.any()).optional().describe('Additional filters'),
302
+ }).describe('Detection condition'),
303
+ /**
304
+ * Actions to take when rule is triggered
305
+ */
306
+ actions: zod_1.z.array(zod_1.z.enum([
307
+ 'alert', // Send alert notification
308
+ 'lock_account', // Lock the user account
309
+ 'block_ip', // Block the IP address
310
+ 'require_mfa', // Require multi-factor authentication
311
+ 'log_critical', // Log as critical event
312
+ 'webhook', // Call webhook
313
+ ])).describe('Actions to take'),
314
+ /**
315
+ * Severity level for triggered alerts
316
+ */
317
+ alertSeverity: exports.AuditEventSeverity.default('warning').describe('Alert severity'),
318
+ /**
319
+ * Notification configuration
320
+ */
321
+ notifications: zod_1.z.object({
322
+ /**
323
+ * Email addresses to notify
324
+ */
325
+ email: zod_1.z.array(zod_1.z.string().email()).optional().describe('Email recipients'),
326
+ /**
327
+ * Slack webhook URL
328
+ */
329
+ slack: zod_1.z.string().url().optional().describe('Slack webhook URL'),
330
+ /**
331
+ * Custom webhook URL
332
+ */
333
+ webhook: zod_1.z.string().url().optional().describe('Custom webhook URL'),
334
+ }).optional().describe('Notification configuration'),
335
+ });
336
+ /**
337
+ * Audit Log Storage Configuration
338
+ * Defines where and how audit logs are stored
339
+ */
340
+ exports.AuditStorageConfigSchema = zod_1.z.object({
341
+ /**
342
+ * Storage backend type
343
+ */
344
+ type: zod_1.z.enum([
345
+ 'database', // Store in database (PostgreSQL, MySQL, etc.)
346
+ 'elasticsearch', // Store in Elasticsearch
347
+ 'mongodb', // Store in MongoDB
348
+ 'clickhouse', // Store in ClickHouse (for analytics)
349
+ 's3', // Store in S3-compatible storage
350
+ 'gcs', // Store in Google Cloud Storage
351
+ 'azure_blob', // Store in Azure Blob Storage
352
+ 'custom', // Custom storage implementation
353
+ ]).describe('Storage backend type'),
354
+ /**
355
+ * Connection string or configuration
356
+ */
357
+ connectionString: zod_1.z.string().optional().describe('Connection string'),
358
+ /**
359
+ * Storage configuration
360
+ */
361
+ config: zod_1.z.record(zod_1.z.any()).optional().describe('Storage-specific configuration'),
362
+ /**
363
+ * Whether to enable buffering/batching
364
+ */
365
+ bufferEnabled: zod_1.z.boolean().default(true).describe('Enable buffering'),
366
+ /**
367
+ * Buffer size (number of events before flush)
368
+ */
369
+ bufferSize: zod_1.z.number().int().positive().default(100).describe('Buffer size'),
370
+ /**
371
+ * Buffer flush interval in seconds
372
+ */
373
+ flushIntervalSeconds: zod_1.z.number().int().positive().default(5).describe('Flush interval in seconds'),
374
+ /**
375
+ * Whether to compress stored data
376
+ */
377
+ compression: zod_1.z.boolean().default(true).describe('Enable compression'),
378
+ });
379
+ /**
380
+ * Audit Event Filter Schema
381
+ * Defines filters for querying audit events
382
+ */
383
+ exports.AuditEventFilterSchema = zod_1.z.object({
384
+ /**
385
+ * Filter by event types
386
+ */
387
+ eventTypes: zod_1.z.array(exports.AuditEventType).optional().describe('Event types to include'),
388
+ /**
389
+ * Filter by severity levels
390
+ */
391
+ severities: zod_1.z.array(exports.AuditEventSeverity).optional().describe('Severity levels to include'),
392
+ /**
393
+ * Filter by actor ID
394
+ */
395
+ actorId: zod_1.z.string().optional().describe('Actor identifier'),
396
+ /**
397
+ * Filter by tenant ID
398
+ */
399
+ tenantId: zod_1.z.string().optional().describe('Tenant identifier'),
400
+ /**
401
+ * Filter by time range
402
+ */
403
+ timeRange: zod_1.z.object({
404
+ from: zod_1.z.string().datetime().describe('Start time'),
405
+ to: zod_1.z.string().datetime().describe('End time'),
406
+ }).optional().describe('Time range filter'),
407
+ /**
408
+ * Filter by result status
409
+ */
410
+ result: zod_1.z.enum(['success', 'failure', 'partial']).optional().describe('Result status'),
411
+ /**
412
+ * Search query (full-text search)
413
+ */
414
+ searchQuery: zod_1.z.string().optional().describe('Search query'),
415
+ /**
416
+ * Custom filters
417
+ */
418
+ customFilters: zod_1.z.record(zod_1.z.any()).optional().describe('Custom filters'),
419
+ });
420
+ /**
421
+ * Complete Audit Configuration Schema
422
+ * Main configuration for the audit system
423
+ */
424
+ exports.AuditConfigSchema = zod_1.z.object({
425
+ /**
426
+ * Unique identifier for this audit configuration
427
+ * Must be in snake_case following ObjectStack conventions
428
+ * Maximum length: 64 characters
429
+ */
430
+ name: zod_1.z.string()
431
+ .regex(/^[a-z_][a-z0-9_]*$/)
432
+ .max(64)
433
+ .describe('Configuration name (snake_case, max 64 chars)'),
434
+ /**
435
+ * Human-readable label
436
+ */
437
+ label: zod_1.z.string().describe('Display label'),
438
+ /**
439
+ * Whether audit logging is enabled
440
+ */
441
+ enabled: zod_1.z.boolean().default(true).describe('Enable audit logging'),
442
+ /**
443
+ * Event types to audit
444
+ * If not specified, all event types are audited
445
+ */
446
+ eventTypes: zod_1.z.array(exports.AuditEventType).optional().describe('Event types to audit'),
447
+ /**
448
+ * Event types to exclude from auditing
449
+ */
450
+ excludeEventTypes: zod_1.z.array(exports.AuditEventType).optional().describe('Event types to exclude'),
451
+ /**
452
+ * Minimum severity level to log
453
+ * Events below this level are not logged
454
+ */
455
+ minimumSeverity: exports.AuditEventSeverity.default('info').describe('Minimum severity level'),
456
+ /**
457
+ * Storage configuration
458
+ */
459
+ storage: exports.AuditStorageConfigSchema.describe('Storage configuration'),
460
+ /**
461
+ * Retention policy
462
+ */
463
+ retentionPolicy: exports.AuditRetentionPolicySchema.default({}).describe('Retention policy'),
464
+ /**
465
+ * Suspicious activity detection rules
466
+ */
467
+ suspiciousActivityRules: zod_1.z.array(exports.SuspiciousActivityRuleSchema).default([]).describe('Suspicious activity rules'),
468
+ /**
469
+ * Whether to include sensitive data in audit logs
470
+ * If false, sensitive fields are redacted/masked
471
+ */
472
+ includeSensitiveData: zod_1.z.boolean().default(false).describe('Include sensitive data'),
473
+ /**
474
+ * Fields to redact from audit logs
475
+ */
476
+ redactFields: zod_1.z.array(zod_1.z.string()).default([
477
+ 'password',
478
+ 'passwordHash',
479
+ 'token',
480
+ 'apiKey',
481
+ 'secret',
482
+ 'creditCard',
483
+ 'ssn',
484
+ ]).describe('Fields to redact'),
485
+ /**
486
+ * Whether to log successful read operations
487
+ * Can be disabled to reduce log volume
488
+ */
489
+ logReads: zod_1.z.boolean().default(false).describe('Log read operations'),
490
+ /**
491
+ * Sampling rate for read operations (0.0 to 1.0)
492
+ * Only applies if logReads is true
493
+ */
494
+ readSamplingRate: zod_1.z.number().min(0).max(1).default(0.1).describe('Read sampling rate'),
495
+ /**
496
+ * Whether to log system/internal operations
497
+ */
498
+ logSystemEvents: zod_1.z.boolean().default(true).describe('Log system events'),
499
+ /**
500
+ * Custom audit event handlers
501
+ * Note: Function handlers are for runtime configuration only and will not be serialized to JSON Schema
502
+ */
503
+ customHandlers: zod_1.z.array(zod_1.z.object({
504
+ eventType: exports.AuditEventType.describe('Event type to handle'),
505
+ handlerId: zod_1.z.string().describe('Unique identifier for the handler'),
506
+ })).optional().describe('Custom event handler references'),
507
+ /**
508
+ * Compliance mode configuration
509
+ */
510
+ compliance: zod_1.z.object({
511
+ /**
512
+ * Compliance standards to enforce
513
+ */
514
+ standards: zod_1.z.array(zod_1.z.enum([
515
+ 'sox', // Sarbanes-Oxley Act
516
+ 'hipaa', // Health Insurance Portability and Accountability Act
517
+ 'gdpr', // General Data Protection Regulation
518
+ 'pci_dss', // Payment Card Industry Data Security Standard
519
+ 'iso_27001', // ISO/IEC 27001
520
+ 'fedramp', // Federal Risk and Authorization Management Program
521
+ ])).optional().describe('Compliance standards'),
522
+ /**
523
+ * Whether to enforce immutable audit logs
524
+ */
525
+ immutableLogs: zod_1.z.boolean().default(true).describe('Enforce immutable logs'),
526
+ /**
527
+ * Whether to require cryptographic signing
528
+ */
529
+ requireSigning: zod_1.z.boolean().default(false).describe('Require log signing'),
530
+ /**
531
+ * Signing key configuration
532
+ */
533
+ signingKey: zod_1.z.string().optional().describe('Signing key'),
534
+ }).optional().describe('Compliance configuration'),
535
+ });
536
+ /**
537
+ * Default suspicious activity rules
538
+ * Common security patterns to detect
539
+ */
540
+ exports.DEFAULT_SUSPICIOUS_ACTIVITY_RULES = [
541
+ {
542
+ id: 'multiple_failed_logins',
543
+ name: 'Multiple Failed Login Attempts',
544
+ description: 'Detects multiple failed login attempts from the same user or IP',
545
+ enabled: true,
546
+ eventTypes: ['auth.login_failed'],
547
+ condition: {
548
+ threshold: 5,
549
+ windowSeconds: 600, // 10 minutes
550
+ groupBy: ['actor.id', 'actor.ipAddress'],
551
+ },
552
+ actions: ['alert', 'lock_account'],
553
+ alertSeverity: 'warning',
554
+ },
555
+ {
556
+ id: 'bulk_data_export',
557
+ name: 'Bulk Data Export',
558
+ description: 'Detects large data export operations',
559
+ enabled: true,
560
+ eventTypes: ['data.export'],
561
+ condition: {
562
+ threshold: 3,
563
+ windowSeconds: 3600, // 1 hour
564
+ groupBy: ['actor.id'],
565
+ },
566
+ actions: ['alert', 'log_critical'],
567
+ alertSeverity: 'warning',
568
+ },
569
+ {
570
+ id: 'suspicious_permission_changes',
571
+ name: 'Rapid Permission Changes',
572
+ description: 'Detects rapid permission or role changes',
573
+ enabled: true,
574
+ eventTypes: ['authz.permission_granted', 'authz.role_assigned'],
575
+ condition: {
576
+ threshold: 10,
577
+ windowSeconds: 300, // 5 minutes
578
+ groupBy: ['actor.id'],
579
+ },
580
+ actions: ['alert', 'log_critical'],
581
+ alertSeverity: 'critical',
582
+ },
583
+ {
584
+ id: 'after_hours_access',
585
+ name: 'After Hours Access',
586
+ description: 'Detects access during non-business hours',
587
+ enabled: false, // Disabled by default, requires time zone configuration
588
+ eventTypes: ['auth.login'],
589
+ condition: {
590
+ threshold: 1,
591
+ windowSeconds: 86400, // 24 hours
592
+ },
593
+ actions: ['alert'],
594
+ alertSeverity: 'notice',
595
+ },
596
+ ];
@@ -28,8 +28,8 @@ export declare const OAuthProviderSchema: z.ZodObject<{
28
28
  displayName: z.ZodOptional<z.ZodString>;
29
29
  icon: z.ZodOptional<z.ZodString>;
30
30
  }, "strip", z.ZodTypeAny, {
31
- enabled: boolean;
32
31
  provider: "custom" | "google" | "github" | "facebook" | "twitter" | "linkedin" | "microsoft" | "apple" | "discord" | "gitlab";
32
+ enabled: boolean;
33
33
  clientId: string;
34
34
  clientSecret: string;
35
35
  icon?: string | undefined;
@@ -823,8 +823,8 @@ export declare const AuthConfigSchema: z.ZodObject<{
823
823
  displayName: z.ZodOptional<z.ZodString>;
824
824
  icon: z.ZodOptional<z.ZodString>;
825
825
  }, "strip", z.ZodTypeAny, {
826
- enabled: boolean;
827
826
  provider: "custom" | "google" | "github" | "facebook" | "twitter" | "linkedin" | "microsoft" | "apple" | "discord" | "gitlab";
827
+ enabled: boolean;
828
828
  clientId: string;
829
829
  clientSecret: string;
830
830
  icon?: string | undefined;
@@ -843,8 +843,8 @@ export declare const AuthConfigSchema: z.ZodObject<{
843
843
  }>, "many">;
844
844
  }, "strip", z.ZodTypeAny, {
845
845
  providers: {
846
- enabled: boolean;
847
846
  provider: "custom" | "google" | "github" | "facebook" | "twitter" | "linkedin" | "microsoft" | "apple" | "discord" | "gitlab";
847
+ enabled: boolean;
848
848
  clientId: string;
849
849
  clientSecret: string;
850
850
  icon?: string | undefined;
@@ -1487,8 +1487,8 @@ export declare const AuthConfigSchema: z.ZodObject<{
1487
1487
  } | undefined;
1488
1488
  oauth?: {
1489
1489
  providers: {
1490
- enabled: boolean;
1491
1490
  provider: "custom" | "google" | "github" | "facebook" | "twitter" | "linkedin" | "microsoft" | "apple" | "discord" | "gitlab";
1491
+ enabled: boolean;
1492
1492
  clientId: string;
1493
1493
  clientSecret: string;
1494
1494
  icon?: string | undefined;
@@ -1946,8 +1946,8 @@ export declare const StandardAuthProviderSchema: z.ZodObject<{
1946
1946
  displayName: z.ZodOptional<z.ZodString>;
1947
1947
  icon: z.ZodOptional<z.ZodString>;
1948
1948
  }, "strip", z.ZodTypeAny, {
1949
- enabled: boolean;
1950
1949
  provider: "custom" | "google" | "github" | "facebook" | "twitter" | "linkedin" | "microsoft" | "apple" | "discord" | "gitlab";
1950
+ enabled: boolean;
1951
1951
  clientId: string;
1952
1952
  clientSecret: string;
1953
1953
  icon?: string | undefined;
@@ -1966,8 +1966,8 @@ export declare const StandardAuthProviderSchema: z.ZodObject<{
1966
1966
  }>, "many">;
1967
1967
  }, "strip", z.ZodTypeAny, {
1968
1968
  providers: {
1969
- enabled: boolean;
1970
1969
  provider: "custom" | "google" | "github" | "facebook" | "twitter" | "linkedin" | "microsoft" | "apple" | "discord" | "gitlab";
1970
+ enabled: boolean;
1971
1971
  clientId: string;
1972
1972
  clientSecret: string;
1973
1973
  icon?: string | undefined;
@@ -2610,8 +2610,8 @@ export declare const StandardAuthProviderSchema: z.ZodObject<{
2610
2610
  } | undefined;
2611
2611
  oauth?: {
2612
2612
  providers: {
2613
- enabled: boolean;
2614
2613
  provider: "custom" | "google" | "github" | "facebook" | "twitter" | "linkedin" | "microsoft" | "apple" | "discord" | "gitlab";
2614
+ enabled: boolean;
2615
2615
  clientId: string;
2616
2616
  clientSecret: string;
2617
2617
  icon?: string | undefined;
@@ -2991,8 +2991,8 @@ export declare const StandardAuthProviderSchema: z.ZodObject<{
2991
2991
  } | undefined;
2992
2992
  oauth?: {
2993
2993
  providers: {
2994
- enabled: boolean;
2995
2994
  provider: "custom" | "google" | "github" | "facebook" | "twitter" | "linkedin" | "microsoft" | "apple" | "discord" | "gitlab";
2995
+ enabled: boolean;
2996
2996
  clientId: string;
2997
2997
  clientSecret: string;
2998
2998
  icon?: string | undefined;