@objectstack/spec 0.3.3 → 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/dist/ai/conversation.zod.d.ts +14 -14
- package/dist/ai/cost.zod.d.ts +112 -112
- package/dist/ai/model-registry.zod.d.ts +44 -44
- package/dist/ai/nlq.zod.d.ts +2 -2
- package/dist/ai/orchestration.zod.d.ts +6 -6
- package/dist/ai/predictive.zod.d.ts +8 -8
- package/dist/ai/rag-pipeline.zod.d.ts +62 -62
- package/dist/api/contract.zod.d.ts +92 -92
- package/dist/api/discovery.zod.d.ts +2 -2
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -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/api/router.zod.d.ts +4 -4
- package/dist/auth/config.zod.d.ts +21 -21
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -0
- package/dist/auth/organization.zod.d.ts +2 -2
- package/dist/auth/role.zod.d.ts +14 -0
- package/dist/auth/role.zod.d.ts.map +1 -1
- package/dist/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/automation/flow.zod.d.ts +6 -6
- package/dist/automation/index.d.ts +4 -0
- package/dist/automation/index.d.ts.map +1 -1
- package/dist/automation/index.js +4 -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/automation/webhook.zod.d.ts +24 -1
- package/dist/automation/webhook.zod.d.ts.map +1 -1
- package/dist/automation/webhook.zod.js +27 -3
- package/dist/automation/workflow.zod.d.ts +14 -0
- package/dist/automation/workflow.zod.d.ts.map +1 -1
- package/dist/automation/workflow.zod.js +16 -1
- package/dist/data/field.zod.d.ts +338 -8
- package/dist/data/field.zod.d.ts.map +1 -1
- package/dist/data/field.zod.js +100 -16
- package/dist/data/mapping.zod.d.ts +22 -10
- 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 +116 -22
- package/dist/data/object.zod.d.ts.map +1 -1
- package/dist/data/object.zod.js +4 -4
- package/dist/data/validation.zod.d.ts +18 -18
- package/dist/hub/composer.zod.d.ts +42 -1939
- package/dist/hub/composer.zod.d.ts.map +1 -1
- package/dist/hub/composer.zod.js +1 -1
- package/dist/hub/license.zod.d.ts +2 -2
- package/dist/hub/marketplace.zod.d.ts +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/permission/index.d.ts +7 -5
- package/dist/permission/index.d.ts.map +1 -1
- package/dist/permission/index.js +7 -5
- package/dist/permission/permission.zod.d.ts +14 -0
- package/dist/permission/permission.zod.d.ts.map +1 -1
- package/dist/permission/permission.zod.js +16 -1
- 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/territory.zod.d.ts +13 -0
- package/dist/permission/territory.zod.d.ts.map +1 -1
- package/dist/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/{driver → shared}/index.js +5 -4
- 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 +12 -12
- package/dist/{kernel → system}/context.zod.d.ts.map +1 -1
- package/dist/{driver → system}/datasource.zod.d.ts +2 -2
- package/dist/{driver → system}/datasource.zod.d.ts.map +1 -1
- package/dist/{driver → system/driver}/mongo.zod.d.ts +2 -2
- package/dist/system/driver/mongo.zod.d.ts.map +1 -0
- package/dist/{driver → system/driver}/postgres.zod.d.ts +4 -4
- package/dist/system/driver/postgres.zod.d.ts.map +1 -0
- package/dist/{driver → system}/driver.zod.d.ts +14 -14
- package/dist/{driver → system}/driver.zod.d.ts.map +1 -1
- package/dist/system/events.zod.d.ts +15 -12
- 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 +10 -0
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +12 -0
- package/dist/system/job.zod.d.ts +8 -8
- package/dist/{kernel → system}/logger.zod.d.ts +4 -4
- package/dist/{kernel → system}/logger.zod.d.ts.map +1 -1
- package/dist/system/manifest.zod.d.ts +515 -0
- package/dist/system/manifest.zod.d.ts.map +1 -0
- package/dist/{kernel → system}/manifest.zod.js +0 -12
- package/dist/{kernel → system}/plugin.zod.d.ts.map +1 -1
- package/dist/{kernel → system}/scoped-storage.zod.d.ts +2 -2
- package/dist/{kernel → system}/scoped-storage.zod.d.ts.map +1 -1
- package/dist/ui/action.zod.d.ts +35 -10
- 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 +23 -8
- 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 +21 -3
- 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 +7 -7
- package/dist/ui/view.zod.d.ts +252 -240
- 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 +673 -5
- package/dist/ui/widget.zod.d.ts.map +1 -1
- package/dist/ui/widget.zod.js +294 -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/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/automation/ETLSyncMode.json +14 -0
- 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/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/automation/SyncMode.json +14 -0
- package/json-schema/automation/Webhook.json +3 -1
- package/json-schema/automation/WebhookReceiver.json +3 -1
- package/json-schema/automation/WorkflowRule.json +3 -2
- package/json-schema/data/Field.json +62 -4
- package/json-schema/data/FieldType.json +12 -2
- package/json-schema/data/Object.json +62 -4
- package/json-schema/data/SelectOption.json +4 -2
- package/json-schema/data/VectorConfig.json +51 -0
- package/json-schema/hub/ComposerResponse.json +0 -2162
- package/json-schema/permission/PermissionSet.json +3 -1
- package/json-schema/permission/RLSConfig.json +59 -0
- package/json-schema/permission/RLSEvaluationResult.json +40 -0
- package/json-schema/permission/RLSOperation.json +16 -0
- package/json-schema/permission/RLSUserContext.json +51 -0
- package/json-schema/permission/RowLevelSecurityPolicy.json +77 -0
- package/json-schema/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/Event.json +3 -2
- package/json-schema/system/FeatureFlag.json +87 -0
- package/json-schema/system/FeatureStrategy.json +16 -0
- package/json-schema/system/Manifest.json +395 -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 +62 -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/package.json +1 -1
- package/prompts/architecture.md +5 -5
- package/prompts/create-new-project.md +85 -0
- package/dist/driver/index.d.ts +0 -5
- package/dist/driver/index.d.ts.map +0 -1
- package/dist/driver/mongo.zod.d.ts.map +0 -1
- package/dist/driver/postgres.zod.d.ts.map +0 -1
- package/dist/kernel/index.d.ts +0 -12
- package/dist/kernel/index.d.ts.map +0 -1
- package/dist/kernel/index.js +0 -27
- package/dist/kernel/manifest.zod.d.ts +0 -2153
- package/dist/kernel/manifest.zod.d.ts.map +0 -1
- package/json-schema/kernel/Manifest.json +0 -2557
- /package/dist/{kernel → system}/context.zod.d.ts +0 -0
- /package/dist/{kernel → system}/context.zod.js +0 -0
- /package/dist/{driver → system}/datasource.zod.js +0 -0
- /package/dist/{driver → system/driver}/mongo.zod.js +0 -0
- /package/dist/{driver → system/driver}/postgres.zod.js +0 -0
- /package/dist/{driver → system}/driver.zod.js +0 -0
- /package/dist/{kernel → system}/logger.zod.js +0 -0
- /package/dist/{kernel → system}/plugin.zod.d.ts +0 -0
- /package/dist/{kernel → system}/plugin.zod.js +0 -0
- /package/dist/{kernel → system}/scoped-storage.zod.js +0 -0
- /package/json-schema/{driver → system}/Datasource.json +0 -0
- /package/json-schema/{driver → system}/DatasourceCapabilities.json +0 -0
- /package/json-schema/{driver → system}/DriverCapabilities.json +0 -0
- /package/json-schema/{driver → system}/DriverDefinition.json +0 -0
- /package/json-schema/{driver → system}/DriverInterface.json +0 -0
- /package/json-schema/{driver → system}/DriverOptions.json +0 -0
- /package/json-schema/{driver → system}/DriverType.json +0 -0
- /package/json-schema/{kernel → system}/FileMetadata.json +0 -0
- /package/json-schema/{kernel → system}/I18nContext.json +0 -0
- /package/json-schema/{kernel → system}/KernelContext.json +0 -0
- /package/json-schema/{kernel → system}/LogEntry.json +0 -0
- /package/json-schema/{kernel → system}/LogFormat.json +0 -0
- /package/json-schema/{kernel → system}/LogLevel.json +0 -0
- /package/json-schema/{kernel → system}/Logger.json +0 -0
- /package/json-schema/{kernel → system}/LoggerConfig.json +0 -0
- /package/json-schema/{driver → system}/MongoConfig.json +0 -0
- /package/json-schema/{kernel → system}/ObjectQLClient.json +0 -0
- /package/json-schema/{kernel → system}/Plugin.json +0 -0
- /package/json-schema/{kernel → system}/PluginContext.json +0 -0
- /package/json-schema/{kernel → system}/PluginLifecycle.json +0 -0
- /package/json-schema/{driver → system}/PostgresConfig.json +0 -0
- /package/json-schema/{kernel → system}/Router.json +0 -0
- /package/json-schema/{kernel → system}/RuntimeMode.json +0 -0
- /package/json-schema/{kernel → system}/Scheduler.json +0 -0
- /package/json-schema/{kernel → system}/ScopedStorage.json +0 -0
- /package/json-schema/{kernel → system}/ScopedStorageConfig.json +0 -0
- /package/json-schema/{kernel → system}/StorageAdapterType.json +0 -0
- /package/json-schema/{kernel → system}/StorageScope.json +0 -0
- /package/json-schema/{kernel → system}/SystemAPI.json +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* System Identifier Schema
|
|
4
|
+
*
|
|
5
|
+
* Universal naming convention for all machine identifiers (API Names) in ObjectStack.
|
|
6
|
+
* Enforces lowercase with underscores or dots to ensure:
|
|
7
|
+
* - Cross-platform compatibility (case-insensitive filesystems)
|
|
8
|
+
* - URL-friendliness (no encoding needed)
|
|
9
|
+
* - Database consistency (no collation issues)
|
|
10
|
+
* - Security (no case-sensitivity bugs in permission checks)
|
|
11
|
+
*
|
|
12
|
+
* **Applies to all metadata that acts as a machine identifier:**
|
|
13
|
+
* - Object names (tables/collections)
|
|
14
|
+
* - Field names
|
|
15
|
+
* - Role names
|
|
16
|
+
* - Permission set names
|
|
17
|
+
* - Action/trigger names
|
|
18
|
+
* - Event keys
|
|
19
|
+
* - App IDs
|
|
20
|
+
* - Menu/page IDs
|
|
21
|
+
* - Select option values
|
|
22
|
+
* - Workflow names
|
|
23
|
+
* - Webhook names
|
|
24
|
+
*
|
|
25
|
+
* **Naming Convention Summary:**
|
|
26
|
+
* | Type | Pattern | Example |
|
|
27
|
+
* |------|---------|---------|
|
|
28
|
+
* | Machine ID | snake_case | `crm_account`, `btn_submit`, `role_admin` |
|
|
29
|
+
* | Event keys | dot.notation | `user.login`, `order.created` |
|
|
30
|
+
* | Labels | Any case | `Client Account`, `Submit Form` |
|
|
31
|
+
*
|
|
32
|
+
* @example Valid identifiers
|
|
33
|
+
* - 'account'
|
|
34
|
+
* - 'crm_account'
|
|
35
|
+
* - 'user_profile'
|
|
36
|
+
* - 'order.created' (for events)
|
|
37
|
+
* - 'api_v2_endpoint'
|
|
38
|
+
*
|
|
39
|
+
* @example Invalid identifiers (will be rejected)
|
|
40
|
+
* - 'Account' (uppercase)
|
|
41
|
+
* - 'CrmAccount' (camelCase)
|
|
42
|
+
* - 'crm-account' (kebab-case - use underscore instead)
|
|
43
|
+
* - 'user profile' (spaces)
|
|
44
|
+
*/
|
|
45
|
+
export declare const SystemIdentifierSchema: z.ZodString;
|
|
46
|
+
/**
|
|
47
|
+
* Strict Snake Case Identifier
|
|
48
|
+
*
|
|
49
|
+
* More restrictive than SystemIdentifierSchema - only allows underscores (no dots).
|
|
50
|
+
* Use this for identifiers that should NOT contain dots (e.g., database table/column names).
|
|
51
|
+
*
|
|
52
|
+
* @example Valid
|
|
53
|
+
* - 'account'
|
|
54
|
+
* - 'crm_account'
|
|
55
|
+
* - 'user_profile'
|
|
56
|
+
*
|
|
57
|
+
* @example Invalid
|
|
58
|
+
* - 'user.profile' (dots not allowed)
|
|
59
|
+
* - 'UserProfile' (uppercase)
|
|
60
|
+
*/
|
|
61
|
+
export declare const SnakeCaseIdentifierSchema: z.ZodString;
|
|
62
|
+
/**
|
|
63
|
+
* Event Name Identifier
|
|
64
|
+
*
|
|
65
|
+
* Specialized identifier for event names that encourages dot notation.
|
|
66
|
+
* Used in event-driven systems, message queues, and webhooks.
|
|
67
|
+
*
|
|
68
|
+
* Pattern: `namespace.action` or `entity.event_type`
|
|
69
|
+
*
|
|
70
|
+
* @example Valid
|
|
71
|
+
* - 'user.created'
|
|
72
|
+
* - 'order.paid'
|
|
73
|
+
* - 'user.login_success'
|
|
74
|
+
* - 'alarm.high_cpu'
|
|
75
|
+
*
|
|
76
|
+
* @example Invalid
|
|
77
|
+
* - 'UserCreated' (camelCase)
|
|
78
|
+
* - 'user_created' (should use dots for namespacing)
|
|
79
|
+
*/
|
|
80
|
+
export declare const EventNameSchema: z.ZodString;
|
|
81
|
+
/**
|
|
82
|
+
* Type Exports
|
|
83
|
+
*/
|
|
84
|
+
export type SystemIdentifier = z.infer<typeof SystemIdentifierSchema>;
|
|
85
|
+
export type SnakeCaseIdentifier = z.infer<typeof SnakeCaseIdentifierSchema>;
|
|
86
|
+
export type EventName = z.infer<typeof EventNameSchema>;
|
|
87
|
+
//# sourceMappingURL=identifiers.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifiers.zod.d.ts","sourceRoot":"","sources":["../../src/shared/identifiers.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,sBAAsB,aAOkC,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,aAOgC,CAAC;AAEvE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,aAO2C,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventNameSchema = exports.SnakeCaseIdentifierSchema = exports.SystemIdentifierSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* System Identifier Schema
|
|
7
|
+
*
|
|
8
|
+
* Universal naming convention for all machine identifiers (API Names) in ObjectStack.
|
|
9
|
+
* Enforces lowercase with underscores or dots to ensure:
|
|
10
|
+
* - Cross-platform compatibility (case-insensitive filesystems)
|
|
11
|
+
* - URL-friendliness (no encoding needed)
|
|
12
|
+
* - Database consistency (no collation issues)
|
|
13
|
+
* - Security (no case-sensitivity bugs in permission checks)
|
|
14
|
+
*
|
|
15
|
+
* **Applies to all metadata that acts as a machine identifier:**
|
|
16
|
+
* - Object names (tables/collections)
|
|
17
|
+
* - Field names
|
|
18
|
+
* - Role names
|
|
19
|
+
* - Permission set names
|
|
20
|
+
* - Action/trigger names
|
|
21
|
+
* - Event keys
|
|
22
|
+
* - App IDs
|
|
23
|
+
* - Menu/page IDs
|
|
24
|
+
* - Select option values
|
|
25
|
+
* - Workflow names
|
|
26
|
+
* - Webhook names
|
|
27
|
+
*
|
|
28
|
+
* **Naming Convention Summary:**
|
|
29
|
+
* | Type | Pattern | Example |
|
|
30
|
+
* |------|---------|---------|
|
|
31
|
+
* | Machine ID | snake_case | `crm_account`, `btn_submit`, `role_admin` |
|
|
32
|
+
* | Event keys | dot.notation | `user.login`, `order.created` |
|
|
33
|
+
* | Labels | Any case | `Client Account`, `Submit Form` |
|
|
34
|
+
*
|
|
35
|
+
* @example Valid identifiers
|
|
36
|
+
* - 'account'
|
|
37
|
+
* - 'crm_account'
|
|
38
|
+
* - 'user_profile'
|
|
39
|
+
* - 'order.created' (for events)
|
|
40
|
+
* - 'api_v2_endpoint'
|
|
41
|
+
*
|
|
42
|
+
* @example Invalid identifiers (will be rejected)
|
|
43
|
+
* - 'Account' (uppercase)
|
|
44
|
+
* - 'CrmAccount' (camelCase)
|
|
45
|
+
* - 'crm-account' (kebab-case - use underscore instead)
|
|
46
|
+
* - 'user profile' (spaces)
|
|
47
|
+
*/
|
|
48
|
+
exports.SystemIdentifierSchema = zod_1.z
|
|
49
|
+
.string()
|
|
50
|
+
.min(2, { message: 'System identifier must be at least 2 characters' })
|
|
51
|
+
.regex(/^[a-z][a-z0-9_.]*$/, {
|
|
52
|
+
message: 'System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., "user_profile" or "order.created")',
|
|
53
|
+
})
|
|
54
|
+
.describe('System identifier (lowercase with underscores or dots)');
|
|
55
|
+
/**
|
|
56
|
+
* Strict Snake Case Identifier
|
|
57
|
+
*
|
|
58
|
+
* More restrictive than SystemIdentifierSchema - only allows underscores (no dots).
|
|
59
|
+
* Use this for identifiers that should NOT contain dots (e.g., database table/column names).
|
|
60
|
+
*
|
|
61
|
+
* @example Valid
|
|
62
|
+
* - 'account'
|
|
63
|
+
* - 'crm_account'
|
|
64
|
+
* - 'user_profile'
|
|
65
|
+
*
|
|
66
|
+
* @example Invalid
|
|
67
|
+
* - 'user.profile' (dots not allowed)
|
|
68
|
+
* - 'UserProfile' (uppercase)
|
|
69
|
+
*/
|
|
70
|
+
exports.SnakeCaseIdentifierSchema = zod_1.z
|
|
71
|
+
.string()
|
|
72
|
+
.min(2, { message: 'Identifier must be at least 2 characters' })
|
|
73
|
+
.regex(/^[a-z][a-z0-9_]*$/, {
|
|
74
|
+
message: 'Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., "user_profile")',
|
|
75
|
+
})
|
|
76
|
+
.describe('Snake case identifier (lowercase with underscores only)');
|
|
77
|
+
/**
|
|
78
|
+
* Event Name Identifier
|
|
79
|
+
*
|
|
80
|
+
* Specialized identifier for event names that encourages dot notation.
|
|
81
|
+
* Used in event-driven systems, message queues, and webhooks.
|
|
82
|
+
*
|
|
83
|
+
* Pattern: `namespace.action` or `entity.event_type`
|
|
84
|
+
*
|
|
85
|
+
* @example Valid
|
|
86
|
+
* - 'user.created'
|
|
87
|
+
* - 'order.paid'
|
|
88
|
+
* - 'user.login_success'
|
|
89
|
+
* - 'alarm.high_cpu'
|
|
90
|
+
*
|
|
91
|
+
* @example Invalid
|
|
92
|
+
* - 'UserCreated' (camelCase)
|
|
93
|
+
* - 'user_created' (should use dots for namespacing)
|
|
94
|
+
*/
|
|
95
|
+
exports.EventNameSchema = zod_1.z
|
|
96
|
+
.string()
|
|
97
|
+
.min(3, { message: 'Event name must be at least 3 characters' })
|
|
98
|
+
.regex(/^[a-z][a-z0-9_.]*$/, {
|
|
99
|
+
message: 'Event name must be lowercase with dots for namespacing (e.g., "user.created", "order.paid")',
|
|
100
|
+
})
|
|
101
|
+
.describe('Event name (lowercase with dot notation for namespacing)');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared Schemas and Utilities
|
|
4
|
+
* Common schemas used across multiple modules
|
|
5
|
+
*/
|
|
2
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
7
|
if (k2 === undefined) k2 = k;
|
|
4
8
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -14,7 +18,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
19
|
};
|
|
16
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./datasource.zod"), exports);
|
|
19
|
-
__exportStar(require("./mongo.zod"), exports);
|
|
20
|
-
__exportStar(require("./postgres.zod"), exports);
|
|
21
|
+
__exportStar(require("./identifiers.zod"), exports);
|