@constructive-sdk/cli 0.29.0 → 0.29.2
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/api/cli/commands/api.js +44 -0
- package/api/cli/commands/check-constraint.js +0 -22
- package/api/cli/commands/composite-type.js +0 -22
- package/api/cli/commands/database-setting.js +44 -0
- package/api/cli/commands/domain.js +66 -0
- package/api/cli/commands/enum.js +0 -22
- package/api/cli/commands/field.js +0 -22
- package/api/cli/commands/foreign-key-constraint.js +0 -22
- package/api/cli/commands/index.js +0 -22
- package/api/cli/commands/policy.js +0 -22
- package/api/cli/commands/primary-key-constraint.js +0 -22
- package/api/cli/commands/schema.js +0 -22
- package/api/cli/commands/site.js +44 -0
- package/api/cli/commands/spatial-relation.js +0 -22
- package/api/cli/commands/table.js +0 -22
- package/api/cli/commands/trigger.js +0 -22
- package/api/cli/commands/unique-constraint.js +0 -22
- package/api/cli/commands/view.js +0 -22
- package/api/orm/input-types.d.ts +144 -171
- package/auth/cli/commands/create-org-api-key.d.ts +8 -0
- package/auth/cli/commands/create-org-api-key.js +36 -0
- package/auth/cli/commands/create-org-principal.d.ts +8 -0
- package/auth/cli/commands/create-org-principal.js +36 -0
- package/auth/cli/commands/delete-org-principal.d.ts +8 -0
- package/auth/cli/commands/delete-org-principal.js +36 -0
- package/auth/cli/commands/org-api-key-list.d.ts +8 -0
- package/auth/cli/commands/org-api-key-list.js +224 -0
- package/auth/cli/commands/principal-entity.d.ts +8 -0
- package/auth/cli/commands/principal-entity.js +282 -0
- package/auth/cli/commands/principal-scope-override.d.ts +8 -0
- package/auth/cli/commands/principal-scope-override.js +171 -0
- package/auth/cli/commands/principal.d.ts +8 -0
- package/auth/cli/commands/principal.js +171 -0
- package/auth/cli/commands/revoke-org-api-key.d.ts +8 -0
- package/auth/cli/commands/revoke-org-api-key.js +36 -0
- package/auth/cli/commands.js +19 -3
- package/auth/cli/executor.d.ts +28 -4
- package/auth/orm/index.d.ts +32 -4
- package/auth/orm/index.js +8 -0
- package/auth/orm/input-types.d.ts +915 -145
- package/auth/orm/input-types.js +7 -0
- package/auth/orm/models/index.d.ts +4 -0
- package/auth/orm/models/index.js +9 -1
- package/auth/orm/models/orgApiKeyList.d.ts +36 -0
- package/auth/orm/models/orgApiKeyList.js +80 -0
- package/auth/orm/models/principal.d.ts +45 -0
- package/auth/orm/models/principal.js +93 -0
- package/auth/orm/models/principalEntity.d.ts +54 -0
- package/auth/orm/models/principalEntity.js +104 -0
- package/auth/orm/models/principalScopeOverride.d.ts +36 -0
- package/auth/orm/models/principalScopeOverride.js +80 -0
- package/auth/orm/mutation/index.d.ts +33 -1
- package/auth/orm/mutation/index.js +48 -0
- package/auth/orm/query/index.d.ts +4 -4
- package/auth/orm/query/index.js +7 -7
- package/compute/cli/commands/function-graph-execution.js +0 -22
- package/compute/cli/commands/function-graph.js +0 -20
- package/compute/cli/commands/platform-namespace-event.d.ts +8 -0
- package/compute/cli/commands/platform-namespace-event.js +510 -0
- package/compute/cli/commands/platform-namespace.d.ts +8 -0
- package/compute/cli/commands/platform-namespace.js +436 -0
- package/compute/cli/commands/resource-event.d.ts +8 -0
- package/compute/cli/commands/resource-event.js +356 -0
- package/compute/cli/commands/resource.d.ts +8 -0
- package/compute/cli/commands/resource.js +520 -0
- package/compute/cli/commands.js +13 -5
- package/compute/cli/executor.d.ts +10 -6
- package/compute/orm/index.d.ts +15 -7
- package/compute/orm/index.js +10 -2
- package/compute/orm/input-types.d.ts +1159 -221
- package/compute/orm/input-types.js +4 -0
- package/compute/orm/models/index.d.ts +5 -1
- package/compute/orm/models/index.js +11 -3
- package/compute/orm/models/platformNamespace.d.ts +54 -0
- package/compute/orm/models/platformNamespace.js +104 -0
- package/compute/orm/models/platformNamespaceEvent.d.ts +56 -0
- package/compute/orm/models/platformNamespaceEvent.js +107 -0
- package/compute/orm/models/resource.d.ts +54 -0
- package/compute/orm/models/resource.js +104 -0
- package/compute/orm/models/resourceEvent.d.ts +56 -0
- package/compute/orm/models/resourceEvent.js +107 -0
- package/compute/orm/mutation/index.d.ts +9 -9
- package/compute/orm/mutation/index.js +12 -12
- package/esm/api/cli/commands/api.js +44 -0
- package/esm/api/cli/commands/check-constraint.js +0 -22
- package/esm/api/cli/commands/composite-type.js +0 -22
- package/esm/api/cli/commands/database-setting.js +44 -0
- package/esm/api/cli/commands/domain.js +66 -0
- package/esm/api/cli/commands/enum.js +0 -22
- package/esm/api/cli/commands/field.js +0 -22
- package/esm/api/cli/commands/foreign-key-constraint.js +0 -22
- package/esm/api/cli/commands/index.js +0 -22
- package/esm/api/cli/commands/policy.js +0 -22
- package/esm/api/cli/commands/primary-key-constraint.js +0 -22
- package/esm/api/cli/commands/schema.js +0 -22
- package/esm/api/cli/commands/site.js +44 -0
- package/esm/api/cli/commands/spatial-relation.js +0 -22
- package/esm/api/cli/commands/table.js +0 -22
- package/esm/api/cli/commands/trigger.js +0 -22
- package/esm/api/cli/commands/unique-constraint.js +0 -22
- package/esm/api/cli/commands/view.js +0 -22
- package/esm/api/orm/input-types.d.ts +144 -171
- package/esm/auth/cli/commands/create-org-api-key.d.ts +8 -0
- package/esm/auth/cli/commands/create-org-api-key.js +34 -0
- package/esm/auth/cli/commands/create-org-principal.d.ts +8 -0
- package/esm/auth/cli/commands/create-org-principal.js +34 -0
- package/esm/auth/cli/commands/delete-org-principal.d.ts +8 -0
- package/esm/auth/cli/commands/delete-org-principal.js +34 -0
- package/esm/auth/cli/commands/org-api-key-list.d.ts +8 -0
- package/esm/auth/cli/commands/org-api-key-list.js +222 -0
- package/esm/auth/cli/commands/principal-entity.d.ts +8 -0
- package/esm/auth/cli/commands/principal-entity.js +280 -0
- package/esm/auth/cli/commands/principal-scope-override.d.ts +8 -0
- package/esm/auth/cli/commands/principal-scope-override.js +169 -0
- package/esm/auth/cli/commands/principal.d.ts +8 -0
- package/esm/auth/cli/commands/principal.js +169 -0
- package/esm/auth/cli/commands/revoke-org-api-key.d.ts +8 -0
- package/esm/auth/cli/commands/revoke-org-api-key.js +34 -0
- package/esm/auth/cli/commands.js +19 -3
- package/esm/auth/cli/executor.d.ts +28 -4
- package/esm/auth/orm/index.d.ts +32 -4
- package/esm/auth/orm/index.js +8 -0
- package/esm/auth/orm/input-types.d.ts +915 -145
- package/esm/auth/orm/input-types.js +7 -0
- package/esm/auth/orm/models/index.d.ts +4 -0
- package/esm/auth/orm/models/index.js +4 -0
- package/esm/auth/orm/models/orgApiKeyList.d.ts +36 -0
- package/esm/auth/orm/models/orgApiKeyList.js +76 -0
- package/esm/auth/orm/models/principal.d.ts +45 -0
- package/esm/auth/orm/models/principal.js +89 -0
- package/esm/auth/orm/models/principalEntity.d.ts +54 -0
- package/esm/auth/orm/models/principalEntity.js +100 -0
- package/esm/auth/orm/models/principalScopeOverride.d.ts +36 -0
- package/esm/auth/orm/models/principalScopeOverride.js +76 -0
- package/esm/auth/orm/mutation/index.d.ts +33 -1
- package/esm/auth/orm/mutation/index.js +48 -0
- package/esm/auth/orm/query/index.d.ts +4 -4
- package/esm/auth/orm/query/index.js +7 -7
- package/esm/compute/cli/commands/function-graph-execution.js +0 -22
- package/esm/compute/cli/commands/function-graph.js +0 -20
- package/esm/compute/cli/commands/platform-namespace-event.d.ts +8 -0
- package/esm/compute/cli/commands/platform-namespace-event.js +508 -0
- package/esm/compute/cli/commands/platform-namespace.d.ts +8 -0
- package/esm/compute/cli/commands/platform-namespace.js +434 -0
- package/esm/compute/cli/commands/resource-event.d.ts +8 -0
- package/esm/compute/cli/commands/resource-event.js +354 -0
- package/esm/compute/cli/commands/resource.d.ts +8 -0
- package/esm/compute/cli/commands/resource.js +518 -0
- package/esm/compute/cli/commands.js +13 -5
- package/esm/compute/cli/executor.d.ts +10 -6
- package/esm/compute/orm/index.d.ts +15 -7
- package/esm/compute/orm/index.js +10 -2
- package/esm/compute/orm/input-types.d.ts +1159 -221
- package/esm/compute/orm/input-types.js +4 -0
- package/esm/compute/orm/models/index.d.ts +5 -1
- package/esm/compute/orm/models/index.js +5 -1
- package/esm/compute/orm/models/platformNamespace.d.ts +54 -0
- package/esm/compute/orm/models/platformNamespace.js +100 -0
- package/esm/compute/orm/models/platformNamespaceEvent.d.ts +56 -0
- package/esm/compute/orm/models/platformNamespaceEvent.js +103 -0
- package/esm/compute/orm/models/resource.d.ts +54 -0
- package/esm/compute/orm/models/resource.js +100 -0
- package/esm/compute/orm/models/resourceEvent.d.ts +56 -0
- package/esm/compute/orm/models/resourceEvent.js +103 -0
- package/esm/compute/orm/mutation/index.d.ts +9 -9
- package/esm/compute/orm/mutation/index.js +12 -12
- package/esm/modules/cli/commands/merkle-store-module.js +22 -0
- package/esm/modules/cli/commands/principal-auth-module.d.ts +8 -0
- package/esm/modules/cli/commands/principal-auth-module.js +580 -0
- package/esm/modules/cli/commands/resource-module.d.ts +8 -0
- package/esm/modules/cli/commands/resource-module.js +602 -0
- package/esm/modules/cli/commands.js +9 -5
- package/esm/modules/cli/executor.d.ts +4 -2
- package/esm/modules/orm/index.d.ts +8 -4
- package/esm/modules/orm/index.js +8 -4
- package/esm/modules/orm/input-types.d.ts +868 -411
- package/esm/modules/orm/models/index.d.ts +4 -2
- package/esm/modules/orm/models/index.js +4 -2
- package/esm/modules/orm/models/principalAuthModule.d.ts +54 -0
- package/esm/modules/orm/models/principalAuthModule.js +100 -0
- package/esm/modules/orm/models/resourceModule.d.ts +54 -0
- package/esm/modules/orm/models/resourceModule.js +100 -0
- package/modules/cli/commands/merkle-store-module.js +22 -0
- package/modules/cli/commands/principal-auth-module.d.ts +8 -0
- package/modules/cli/commands/principal-auth-module.js +582 -0
- package/modules/cli/commands/resource-module.d.ts +8 -0
- package/modules/cli/commands/resource-module.js +604 -0
- package/modules/cli/commands.js +9 -5
- package/modules/cli/executor.d.ts +4 -2
- package/modules/orm/index.d.ts +8 -4
- package/modules/orm/index.js +8 -4
- package/modules/orm/input-types.d.ts +868 -411
- package/modules/orm/models/index.d.ts +4 -2
- package/modules/orm/models/index.js +10 -6
- package/modules/orm/models/principalAuthModule.d.ts +54 -0
- package/modules/orm/models/principalAuthModule.js +104 -0
- package/modules/orm/models/resourceModule.d.ts +54 -0
- package/modules/orm/models/resourceModule.js +104 -0
- package/package.json +5 -5
|
@@ -32,19 +32,21 @@ import blueprintConstructionCmd from './commands/blueprint-construction';
|
|
|
32
32
|
import cryptoAuthModuleCmd from './commands/crypto-auth-module';
|
|
33
33
|
import sessionsModuleCmd from './commands/sessions-module';
|
|
34
34
|
import secureTableProvisionCmd from './commands/secure-table-provision';
|
|
35
|
-
import merkleStoreModuleCmd from './commands/merkle-store-module';
|
|
36
|
-
import graphModuleCmd from './commands/graph-module';
|
|
37
35
|
import databaseProvisionModuleCmd from './commands/database-provision-module';
|
|
38
36
|
import configSecretsModuleCmd from './commands/config-secrets-module';
|
|
37
|
+
import graphModuleCmd from './commands/graph-module';
|
|
38
|
+
import merkleStoreModuleCmd from './commands/merkle-store-module';
|
|
39
39
|
import rateLimitMetersModuleCmd from './commands/rate-limit-meters-module';
|
|
40
40
|
import realtimeModuleCmd from './commands/realtime-module';
|
|
41
41
|
import webauthnAuthModuleCmd from './commands/webauthn-auth-module';
|
|
42
42
|
import functionInvocationModuleCmd from './commands/function-invocation-module';
|
|
43
43
|
import functionModuleCmd from './commands/function-module';
|
|
44
44
|
import invitesModuleCmd from './commands/invites-module';
|
|
45
|
+
import principalAuthModuleCmd from './commands/principal-auth-module';
|
|
45
46
|
import computeLogModuleCmd from './commands/compute-log-module';
|
|
46
47
|
import inferenceLogModuleCmd from './commands/inference-log-module';
|
|
47
48
|
import namespaceModuleCmd from './commands/namespace-module';
|
|
49
|
+
import resourceModuleCmd from './commands/resource-module';
|
|
48
50
|
import storageLogModuleCmd from './commands/storage-log-module';
|
|
49
51
|
import transferLogModuleCmd from './commands/transfer-log-module';
|
|
50
52
|
import functionDeploymentModuleCmd from './commands/function-deployment-module';
|
|
@@ -106,19 +108,21 @@ const createCommandMap = () => ({
|
|
|
106
108
|
'crypto-auth-module': cryptoAuthModuleCmd,
|
|
107
109
|
'sessions-module': sessionsModuleCmd,
|
|
108
110
|
'secure-table-provision': secureTableProvisionCmd,
|
|
109
|
-
'merkle-store-module': merkleStoreModuleCmd,
|
|
110
|
-
'graph-module': graphModuleCmd,
|
|
111
111
|
'database-provision-module': databaseProvisionModuleCmd,
|
|
112
112
|
'config-secrets-module': configSecretsModuleCmd,
|
|
113
|
+
'graph-module': graphModuleCmd,
|
|
114
|
+
'merkle-store-module': merkleStoreModuleCmd,
|
|
113
115
|
'rate-limit-meters-module': rateLimitMetersModuleCmd,
|
|
114
116
|
'realtime-module': realtimeModuleCmd,
|
|
115
117
|
'webauthn-auth-module': webauthnAuthModuleCmd,
|
|
116
118
|
'function-invocation-module': functionInvocationModuleCmd,
|
|
117
119
|
'function-module': functionModuleCmd,
|
|
118
120
|
'invites-module': invitesModuleCmd,
|
|
121
|
+
'principal-auth-module': principalAuthModuleCmd,
|
|
119
122
|
'compute-log-module': computeLogModuleCmd,
|
|
120
123
|
'inference-log-module': inferenceLogModuleCmd,
|
|
121
124
|
'namespace-module': namespaceModuleCmd,
|
|
125
|
+
'resource-module': resourceModuleCmd,
|
|
122
126
|
'storage-log-module': storageLogModuleCmd,
|
|
123
127
|
'transfer-log-module': transferLogModuleCmd,
|
|
124
128
|
'function-deployment-module': functionDeploymentModuleCmd,
|
|
@@ -152,7 +156,7 @@ const createCommandMap = () => ({
|
|
|
152
156
|
'provision-relation': provisionRelationCmd,
|
|
153
157
|
'provision-bucket': provisionBucketCmd,
|
|
154
158
|
});
|
|
155
|
-
const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n default-ids-module defaultIdsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n user-state-module userStateModule CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n config-secrets-org-module configSecretsOrgModule CRUD operations\n devices-module devicesModule CRUD operations\n i-18-n-module i18NModule CRUD operations\n user-credentials-module userCredentialsModule CRUD operations\n user-settings-module userSettingsModule CRUD operations\n config-secrets-user-module configSecretsUserModule CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n emails-module emailsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n users-module usersModule CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n rls-module rlsModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n sessions-module sessionsModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n merkle-store-module merkleStoreModule CRUD operations\n graph-module graphModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n config-secrets-module configSecretsModule CRUD operations\n rate-limit-meters-module rateLimitMetersModule CRUD operations\n realtime-module realtimeModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n function-invocation-module functionInvocationModule CRUD operations\n function-module functionModule CRUD operations\n invites-module invitesModule CRUD operations\n compute-log-module computeLogModule CRUD operations\n inference-log-module inferenceLogModule CRUD operations\n namespace-module namespaceModule CRUD operations\n storage-log-module storageLogModule CRUD operations\n transfer-log-module transferLogModule CRUD operations\n function-deployment-module functionDeploymentModule CRUD operations\n plans-module plansModule CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n db-usage-module dbUsageModule CRUD operations\n graph-execution-module graphExecutionModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n permissions-module permissionsModule CRUD operations\n notifications-module notificationsModule CRUD operations\n profiles-module profilesModule CRUD operations\n billing-module billingModule CRUD operations\n relation-provision relationProvision CRUD operations\n user-auth-module userAuthModule CRUD operations\n agent-module agentModule CRUD operations\n limits-module limitsModule CRUD operations\n memberships-module membershipsModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n storage-module storageModule CRUD operations\n events-module eventsModule CRUD operations\n resolve-blueprint-field Resolves a field_name within a given table_id to a field_id. Throws if no match is found. Used by construct_blueprint to translate user-authored field names (e.g. \"location\") into field UUIDs for downstream provisioning procedures. table_id must already be resolved (via resolve_blueprint_table) before calling this.\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Eight phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security. When a prefix already exists (e.g., 'org'), the entry extends the existing entity type instead of creating a new one; if a storage[] key is present, it provisions entity-scoped storage for that type. (0.5) scope-based storage: each storage[] entry has an optional scope ('app' or 'org' only). App-scoped storage seeds buckets at migration time. Org-scoped storage resolves the org membership type, creates org_buckets/org_files with owner_id, and seeds buckets per-entity via an AFTER INSERT trigger on the users table. When function_module is installed, a private functions bucket is auto-injected into org-scoped or entity-scoped storage entries. (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints/check_constraints are deferred). After provisioning, optional smart_tags (jsonb object) on the table entry are applied via metaschema.append_table_smart_tags(), and optional smart_tags on individual field entries are applied via metaschema.append_field_smart_tags(). (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints, (6) provision_check_constraint() for top-level + deferred check constraints, (7) seed achievements from definition.achievements[] \u2014 resolves events_module by entity_prefix and creates INSERT actions for levels, level_requirements, and achievement_rewards tables. Phase 0 entity tables are added to the table_map so subsequent phases can reference them by name. Table-level entries are deferred to phases 3-6 so they can reference columns created by relations in phase 2. Returns the construction record ID on success, NULL on failure.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n provision-check-constraint Creates a check constraint on a table from a $type + data blueprint definition. Supports: CheckOneOf (enum validation via = ANY(ARRAY[...])), CheckGreaterThan (single-column > value or cross-column), CheckLessThan (single-column < value or cross-column), CheckNotEqual (cross-column inequality). Builds AST expressions via ast_helpers and inserts into metaschema_public.check_constraint. Graceful: skips if a constraint with the same name already exists.\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n provision-spatial-relation Idempotent provisioner for metaschema_public.spatial_relation. Inserts a row declaring a spatial predicate between two geometry/geography columns (owner and target). Called from construct_blueprint when a relation entry has $type=RelationSpatial. Graceful: re-running with the same (source_table_id, name) returns the existing id without modifying the row. Operator whitelist and st_dwithin \u2194 param_name pairing are enforced by the spatial_relation table CHECKs. Both fields must already exist \u2014 this is a metadata-only insert.\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n";
|
|
159
|
+
const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n default-ids-module defaultIdsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n user-state-module userStateModule CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n config-secrets-org-module configSecretsOrgModule CRUD operations\n devices-module devicesModule CRUD operations\n i-18-n-module i18NModule CRUD operations\n user-credentials-module userCredentialsModule CRUD operations\n user-settings-module userSettingsModule CRUD operations\n config-secrets-user-module configSecretsUserModule CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n emails-module emailsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n users-module usersModule CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n rls-module rlsModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n sessions-module sessionsModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n config-secrets-module configSecretsModule CRUD operations\n graph-module graphModule CRUD operations\n merkle-store-module merkleStoreModule CRUD operations\n rate-limit-meters-module rateLimitMetersModule CRUD operations\n realtime-module realtimeModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n function-invocation-module functionInvocationModule CRUD operations\n function-module functionModule CRUD operations\n invites-module invitesModule CRUD operations\n principal-auth-module principalAuthModule CRUD operations\n compute-log-module computeLogModule CRUD operations\n inference-log-module inferenceLogModule CRUD operations\n namespace-module namespaceModule CRUD operations\n resource-module resourceModule CRUD operations\n storage-log-module storageLogModule CRUD operations\n transfer-log-module transferLogModule CRUD operations\n function-deployment-module functionDeploymentModule CRUD operations\n plans-module plansModule CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n db-usage-module dbUsageModule CRUD operations\n graph-execution-module graphExecutionModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n permissions-module permissionsModule CRUD operations\n notifications-module notificationsModule CRUD operations\n profiles-module profilesModule CRUD operations\n billing-module billingModule CRUD operations\n relation-provision relationProvision CRUD operations\n user-auth-module userAuthModule CRUD operations\n agent-module agentModule CRUD operations\n limits-module limitsModule CRUD operations\n memberships-module membershipsModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n storage-module storageModule CRUD operations\n events-module eventsModule CRUD operations\n resolve-blueprint-field Resolves a field_name within a given table_id to a field_id. Throws if no match is found. Used by construct_blueprint to translate user-authored field names (e.g. \"location\") into field UUIDs for downstream provisioning procedures. table_id must already be resolved (via resolve_blueprint_table) before calling this.\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Eight phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security. When a prefix already exists (e.g., 'org'), the entry extends the existing entity type instead of creating a new one; if a storage[] key is present, it provisions entity-scoped storage for that type. (0.5) scope-based storage: each storage[] entry has an optional scope ('app' or 'org' only). App-scoped storage seeds buckets at migration time. Org-scoped storage resolves the org membership type, creates org_buckets/org_files with owner_id, and seeds buckets per-entity via an AFTER INSERT trigger on the users table. When function_module is installed, a private functions bucket is auto-injected into org-scoped or entity-scoped storage entries. (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints/check_constraints are deferred). After provisioning, optional smart_tags (jsonb object) on the table entry are applied via metaschema.append_table_smart_tags(), and optional smart_tags on individual field entries are applied via metaschema.append_field_smart_tags(). (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints, (6) provision_check_constraint() for top-level + deferred check constraints, (7) seed achievements from definition.achievements[] \u2014 resolves events_module by entity_prefix and creates INSERT actions for levels, level_requirements, and achievement_rewards tables. Phase 0 entity tables are added to the table_map so subsequent phases can reference them by name. Table-level entries are deferred to phases 3-6 so they can reference columns created by relations in phase 2. Returns the construction record ID on success, NULL on failure.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n provision-check-constraint Creates a check constraint on a table from a $type + data blueprint definition. Supports: CheckOneOf (enum validation via = ANY(ARRAY[...])), CheckGreaterThan (single-column > value or cross-column), CheckLessThan (single-column < value or cross-column), CheckNotEqual (cross-column inequality). Builds AST expressions via ast_helpers and inserts into metaschema_public.check_constraint. Graceful: skips if a constraint with the same name already exists.\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n provision-spatial-relation Idempotent provisioner for metaschema_public.spatial_relation. Inserts a row declaring a spatial predicate between two geometry/geography columns (owner and target). Called from construct_blueprint when a relation entry has $type=RelationSpatial. Graceful: re-running with the same (source_table_id, name) returns the existing id without modifying the row. Operator whitelist and st_dwithin \u2194 param_name pairing are enforced by the spatial_relation table CHECKs. Both fields must already exist \u2014 this is a metadata-only insert.\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n";
|
|
156
160
|
export const commands = async (argv, prompter, options) => {
|
|
157
161
|
if (argv.help || argv.h) {
|
|
158
162
|
console.log(usage);
|
|
@@ -26,19 +26,21 @@ export declare function getClient(contextName?: string): {
|
|
|
26
26
|
cryptoAuthModule: import("..").CryptoAuthModuleModel;
|
|
27
27
|
sessionsModule: import("..").SessionsModuleModel;
|
|
28
28
|
secureTableProvision: import("..").SecureTableProvisionModel;
|
|
29
|
-
merkleStoreModule: import("..").MerkleStoreModuleModel;
|
|
30
|
-
graphModule: import("..").GraphModuleModel;
|
|
31
29
|
databaseProvisionModule: import("..").DatabaseProvisionModuleModel;
|
|
32
30
|
configSecretsModule: import("..").ConfigSecretsModuleModel;
|
|
31
|
+
graphModule: import("..").GraphModuleModel;
|
|
32
|
+
merkleStoreModule: import("..").MerkleStoreModuleModel;
|
|
33
33
|
rateLimitMetersModule: import("..").RateLimitMetersModuleModel;
|
|
34
34
|
realtimeModule: import("..").RealtimeModuleModel;
|
|
35
35
|
webauthnAuthModule: import("..").WebauthnAuthModuleModel;
|
|
36
36
|
functionInvocationModule: import("..").FunctionInvocationModuleModel;
|
|
37
37
|
functionModule: import("..").FunctionModuleModel;
|
|
38
38
|
invitesModule: import("..").InvitesModuleModel;
|
|
39
|
+
principalAuthModule: import("..").PrincipalAuthModuleModel;
|
|
39
40
|
computeLogModule: import("..").ComputeLogModuleModel;
|
|
40
41
|
inferenceLogModule: import("..").InferenceLogModuleModel;
|
|
41
42
|
namespaceModule: import("..").NamespaceModuleModel;
|
|
43
|
+
resourceModule: import("..").ResourceModuleModel;
|
|
42
44
|
storageLogModule: import("..").StorageLogModuleModel;
|
|
43
45
|
transferLogModule: import("..").TransferLogModuleModel;
|
|
44
46
|
functionDeploymentModule: import("..").FunctionDeploymentModuleModel;
|
|
@@ -25,19 +25,21 @@ import { BlueprintConstructionModel } from './models/blueprintConstruction';
|
|
|
25
25
|
import { CryptoAuthModuleModel } from './models/cryptoAuthModule';
|
|
26
26
|
import { SessionsModuleModel } from './models/sessionsModule';
|
|
27
27
|
import { SecureTableProvisionModel } from './models/secureTableProvision';
|
|
28
|
-
import { MerkleStoreModuleModel } from './models/merkleStoreModule';
|
|
29
|
-
import { GraphModuleModel } from './models/graphModule';
|
|
30
28
|
import { DatabaseProvisionModuleModel } from './models/databaseProvisionModule';
|
|
31
29
|
import { ConfigSecretsModuleModel } from './models/configSecretsModule';
|
|
30
|
+
import { GraphModuleModel } from './models/graphModule';
|
|
31
|
+
import { MerkleStoreModuleModel } from './models/merkleStoreModule';
|
|
32
32
|
import { RateLimitMetersModuleModel } from './models/rateLimitMetersModule';
|
|
33
33
|
import { RealtimeModuleModel } from './models/realtimeModule';
|
|
34
34
|
import { WebauthnAuthModuleModel } from './models/webauthnAuthModule';
|
|
35
35
|
import { FunctionInvocationModuleModel } from './models/functionInvocationModule';
|
|
36
36
|
import { FunctionModuleModel } from './models/functionModule';
|
|
37
37
|
import { InvitesModuleModel } from './models/invitesModule';
|
|
38
|
+
import { PrincipalAuthModuleModel } from './models/principalAuthModule';
|
|
38
39
|
import { ComputeLogModuleModel } from './models/computeLogModule';
|
|
39
40
|
import { InferenceLogModuleModel } from './models/inferenceLogModule';
|
|
40
41
|
import { NamespaceModuleModel } from './models/namespaceModule';
|
|
42
|
+
import { ResourceModuleModel } from './models/resourceModule';
|
|
41
43
|
import { StorageLogModuleModel } from './models/storageLogModule';
|
|
42
44
|
import { TransferLogModuleModel } from './models/transferLogModule';
|
|
43
45
|
import { FunctionDeploymentModuleModel } from './models/functionDeploymentModule';
|
|
@@ -115,19 +117,21 @@ export declare function createClient(config: OrmClientConfig): {
|
|
|
115
117
|
cryptoAuthModule: CryptoAuthModuleModel;
|
|
116
118
|
sessionsModule: SessionsModuleModel;
|
|
117
119
|
secureTableProvision: SecureTableProvisionModel;
|
|
118
|
-
merkleStoreModule: MerkleStoreModuleModel;
|
|
119
|
-
graphModule: GraphModuleModel;
|
|
120
120
|
databaseProvisionModule: DatabaseProvisionModuleModel;
|
|
121
121
|
configSecretsModule: ConfigSecretsModuleModel;
|
|
122
|
+
graphModule: GraphModuleModel;
|
|
123
|
+
merkleStoreModule: MerkleStoreModuleModel;
|
|
122
124
|
rateLimitMetersModule: RateLimitMetersModuleModel;
|
|
123
125
|
realtimeModule: RealtimeModuleModel;
|
|
124
126
|
webauthnAuthModule: WebauthnAuthModuleModel;
|
|
125
127
|
functionInvocationModule: FunctionInvocationModuleModel;
|
|
126
128
|
functionModule: FunctionModuleModel;
|
|
127
129
|
invitesModule: InvitesModuleModel;
|
|
130
|
+
principalAuthModule: PrincipalAuthModuleModel;
|
|
128
131
|
computeLogModule: ComputeLogModuleModel;
|
|
129
132
|
inferenceLogModule: InferenceLogModuleModel;
|
|
130
133
|
namespaceModule: NamespaceModuleModel;
|
|
134
|
+
resourceModule: ResourceModuleModel;
|
|
131
135
|
storageLogModule: StorageLogModuleModel;
|
|
132
136
|
transferLogModule: TransferLogModuleModel;
|
|
133
137
|
functionDeploymentModule: FunctionDeploymentModuleModel;
|
package/esm/modules/orm/index.js
CHANGED
|
@@ -30,19 +30,21 @@ import { BlueprintConstructionModel } from './models/blueprintConstruction';
|
|
|
30
30
|
import { CryptoAuthModuleModel } from './models/cryptoAuthModule';
|
|
31
31
|
import { SessionsModuleModel } from './models/sessionsModule';
|
|
32
32
|
import { SecureTableProvisionModel } from './models/secureTableProvision';
|
|
33
|
-
import { MerkleStoreModuleModel } from './models/merkleStoreModule';
|
|
34
|
-
import { GraphModuleModel } from './models/graphModule';
|
|
35
33
|
import { DatabaseProvisionModuleModel } from './models/databaseProvisionModule';
|
|
36
34
|
import { ConfigSecretsModuleModel } from './models/configSecretsModule';
|
|
35
|
+
import { GraphModuleModel } from './models/graphModule';
|
|
36
|
+
import { MerkleStoreModuleModel } from './models/merkleStoreModule';
|
|
37
37
|
import { RateLimitMetersModuleModel } from './models/rateLimitMetersModule';
|
|
38
38
|
import { RealtimeModuleModel } from './models/realtimeModule';
|
|
39
39
|
import { WebauthnAuthModuleModel } from './models/webauthnAuthModule';
|
|
40
40
|
import { FunctionInvocationModuleModel } from './models/functionInvocationModule';
|
|
41
41
|
import { FunctionModuleModel } from './models/functionModule';
|
|
42
42
|
import { InvitesModuleModel } from './models/invitesModule';
|
|
43
|
+
import { PrincipalAuthModuleModel } from './models/principalAuthModule';
|
|
43
44
|
import { ComputeLogModuleModel } from './models/computeLogModule';
|
|
44
45
|
import { InferenceLogModuleModel } from './models/inferenceLogModule';
|
|
45
46
|
import { NamespaceModuleModel } from './models/namespaceModule';
|
|
47
|
+
import { ResourceModuleModel } from './models/resourceModule';
|
|
46
48
|
import { StorageLogModuleModel } from './models/storageLogModule';
|
|
47
49
|
import { TransferLogModuleModel } from './models/transferLogModule';
|
|
48
50
|
import { FunctionDeploymentModuleModel } from './models/functionDeploymentModule';
|
|
@@ -123,19 +125,21 @@ export function createClient(config) {
|
|
|
123
125
|
cryptoAuthModule: new CryptoAuthModuleModel(client),
|
|
124
126
|
sessionsModule: new SessionsModuleModel(client),
|
|
125
127
|
secureTableProvision: new SecureTableProvisionModel(client),
|
|
126
|
-
merkleStoreModule: new MerkleStoreModuleModel(client),
|
|
127
|
-
graphModule: new GraphModuleModel(client),
|
|
128
128
|
databaseProvisionModule: new DatabaseProvisionModuleModel(client),
|
|
129
129
|
configSecretsModule: new ConfigSecretsModuleModel(client),
|
|
130
|
+
graphModule: new GraphModuleModel(client),
|
|
131
|
+
merkleStoreModule: new MerkleStoreModuleModel(client),
|
|
130
132
|
rateLimitMetersModule: new RateLimitMetersModuleModel(client),
|
|
131
133
|
realtimeModule: new RealtimeModuleModel(client),
|
|
132
134
|
webauthnAuthModule: new WebauthnAuthModuleModel(client),
|
|
133
135
|
functionInvocationModule: new FunctionInvocationModuleModel(client),
|
|
134
136
|
functionModule: new FunctionModuleModel(client),
|
|
135
137
|
invitesModule: new InvitesModuleModel(client),
|
|
138
|
+
principalAuthModule: new PrincipalAuthModuleModel(client),
|
|
136
139
|
computeLogModule: new ComputeLogModuleModel(client),
|
|
137
140
|
inferenceLogModule: new InferenceLogModuleModel(client),
|
|
138
141
|
namespaceModule: new NamespaceModuleModel(client),
|
|
142
|
+
resourceModule: new ResourceModuleModel(client),
|
|
139
143
|
storageLogModule: new StorageLogModuleModel(client),
|
|
140
144
|
transferLogModule: new TransferLogModuleModel(client),
|
|
141
145
|
functionDeploymentModule: new FunctionDeploymentModuleModel(client),
|