@constructive-sdk/cli 0.29.1 → 0.29.3

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 (199) hide show
  1. package/api/cli/commands/api.js +44 -0
  2. package/api/cli/commands/check-constraint.js +0 -22
  3. package/api/cli/commands/composite-type.js +0 -22
  4. package/api/cli/commands/database-setting.js +44 -0
  5. package/api/cli/commands/domain.js +66 -0
  6. package/api/cli/commands/enum.js +0 -22
  7. package/api/cli/commands/field.js +0 -22
  8. package/api/cli/commands/foreign-key-constraint.js +0 -22
  9. package/api/cli/commands/index.js +0 -22
  10. package/api/cli/commands/policy.js +0 -22
  11. package/api/cli/commands/primary-key-constraint.js +0 -22
  12. package/api/cli/commands/schema.js +0 -22
  13. package/api/cli/commands/site.js +44 -0
  14. package/api/cli/commands/spatial-relation.js +0 -22
  15. package/api/cli/commands/table.js +0 -22
  16. package/api/cli/commands/trigger.js +0 -22
  17. package/api/cli/commands/unique-constraint.js +0 -22
  18. package/api/cli/commands/view.js +0 -22
  19. package/api/orm/input-types.d.ts +144 -171
  20. package/auth/cli/commands/create-org-api-key.d.ts +8 -0
  21. package/auth/cli/commands/create-org-api-key.js +36 -0
  22. package/auth/cli/commands/create-org-principal.d.ts +8 -0
  23. package/auth/cli/commands/create-org-principal.js +36 -0
  24. package/auth/cli/commands/delete-org-principal.d.ts +8 -0
  25. package/auth/cli/commands/delete-org-principal.js +36 -0
  26. package/auth/cli/commands/org-api-key-list.d.ts +8 -0
  27. package/auth/cli/commands/org-api-key-list.js +224 -0
  28. package/auth/cli/commands/principal-entity.d.ts +8 -0
  29. package/auth/cli/commands/principal-entity.js +282 -0
  30. package/auth/cli/commands/principal-scope-override.d.ts +8 -0
  31. package/auth/cli/commands/principal-scope-override.js +171 -0
  32. package/auth/cli/commands/principal.d.ts +8 -0
  33. package/auth/cli/commands/principal.js +171 -0
  34. package/auth/cli/commands/revoke-org-api-key.d.ts +8 -0
  35. package/auth/cli/commands/revoke-org-api-key.js +36 -0
  36. package/auth/cli/commands.js +19 -3
  37. package/auth/cli/executor.d.ts +28 -4
  38. package/auth/orm/index.d.ts +32 -4
  39. package/auth/orm/index.js +8 -0
  40. package/auth/orm/input-types.d.ts +915 -145
  41. package/auth/orm/input-types.js +7 -0
  42. package/auth/orm/models/index.d.ts +4 -0
  43. package/auth/orm/models/index.js +9 -1
  44. package/auth/orm/models/orgApiKeyList.d.ts +36 -0
  45. package/auth/orm/models/orgApiKeyList.js +80 -0
  46. package/auth/orm/models/principal.d.ts +45 -0
  47. package/auth/orm/models/principal.js +93 -0
  48. package/auth/orm/models/principalEntity.d.ts +54 -0
  49. package/auth/orm/models/principalEntity.js +104 -0
  50. package/auth/orm/models/principalScopeOverride.d.ts +36 -0
  51. package/auth/orm/models/principalScopeOverride.js +80 -0
  52. package/auth/orm/mutation/index.d.ts +33 -1
  53. package/auth/orm/mutation/index.js +48 -0
  54. package/auth/orm/query/index.d.ts +4 -4
  55. package/auth/orm/query/index.js +7 -7
  56. package/compute/cli/commands/function-graph-execution.js +0 -22
  57. package/compute/cli/commands/function-graph.js +0 -20
  58. package/compute/cli/commands/platform-namespace-event.d.ts +8 -0
  59. package/compute/cli/commands/platform-namespace-event.js +510 -0
  60. package/compute/cli/commands/platform-namespace.d.ts +8 -0
  61. package/compute/cli/commands/platform-namespace.js +436 -0
  62. package/compute/cli/commands/resource-event.d.ts +8 -0
  63. package/compute/cli/commands/resource-event.js +356 -0
  64. package/compute/cli/commands/resource.d.ts +8 -0
  65. package/compute/cli/commands/resource.js +520 -0
  66. package/compute/cli/commands.js +13 -5
  67. package/compute/cli/executor.d.ts +10 -6
  68. package/compute/orm/index.d.ts +15 -7
  69. package/compute/orm/index.js +10 -2
  70. package/compute/orm/input-types.d.ts +1159 -221
  71. package/compute/orm/input-types.js +4 -0
  72. package/compute/orm/models/index.d.ts +5 -1
  73. package/compute/orm/models/index.js +11 -3
  74. package/compute/orm/models/platformNamespace.d.ts +54 -0
  75. package/compute/orm/models/platformNamespace.js +104 -0
  76. package/compute/orm/models/platformNamespaceEvent.d.ts +56 -0
  77. package/compute/orm/models/platformNamespaceEvent.js +107 -0
  78. package/compute/orm/models/resource.d.ts +54 -0
  79. package/compute/orm/models/resource.js +104 -0
  80. package/compute/orm/models/resourceEvent.d.ts +56 -0
  81. package/compute/orm/models/resourceEvent.js +107 -0
  82. package/compute/orm/mutation/index.d.ts +9 -9
  83. package/compute/orm/mutation/index.js +12 -12
  84. package/esm/api/cli/commands/api.js +44 -0
  85. package/esm/api/cli/commands/check-constraint.js +0 -22
  86. package/esm/api/cli/commands/composite-type.js +0 -22
  87. package/esm/api/cli/commands/database-setting.js +44 -0
  88. package/esm/api/cli/commands/domain.js +66 -0
  89. package/esm/api/cli/commands/enum.js +0 -22
  90. package/esm/api/cli/commands/field.js +0 -22
  91. package/esm/api/cli/commands/foreign-key-constraint.js +0 -22
  92. package/esm/api/cli/commands/index.js +0 -22
  93. package/esm/api/cli/commands/policy.js +0 -22
  94. package/esm/api/cli/commands/primary-key-constraint.js +0 -22
  95. package/esm/api/cli/commands/schema.js +0 -22
  96. package/esm/api/cli/commands/site.js +44 -0
  97. package/esm/api/cli/commands/spatial-relation.js +0 -22
  98. package/esm/api/cli/commands/table.js +0 -22
  99. package/esm/api/cli/commands/trigger.js +0 -22
  100. package/esm/api/cli/commands/unique-constraint.js +0 -22
  101. package/esm/api/cli/commands/view.js +0 -22
  102. package/esm/api/orm/input-types.d.ts +144 -171
  103. package/esm/auth/cli/commands/create-org-api-key.d.ts +8 -0
  104. package/esm/auth/cli/commands/create-org-api-key.js +34 -0
  105. package/esm/auth/cli/commands/create-org-principal.d.ts +8 -0
  106. package/esm/auth/cli/commands/create-org-principal.js +34 -0
  107. package/esm/auth/cli/commands/delete-org-principal.d.ts +8 -0
  108. package/esm/auth/cli/commands/delete-org-principal.js +34 -0
  109. package/esm/auth/cli/commands/org-api-key-list.d.ts +8 -0
  110. package/esm/auth/cli/commands/org-api-key-list.js +222 -0
  111. package/esm/auth/cli/commands/principal-entity.d.ts +8 -0
  112. package/esm/auth/cli/commands/principal-entity.js +280 -0
  113. package/esm/auth/cli/commands/principal-scope-override.d.ts +8 -0
  114. package/esm/auth/cli/commands/principal-scope-override.js +169 -0
  115. package/esm/auth/cli/commands/principal.d.ts +8 -0
  116. package/esm/auth/cli/commands/principal.js +169 -0
  117. package/esm/auth/cli/commands/revoke-org-api-key.d.ts +8 -0
  118. package/esm/auth/cli/commands/revoke-org-api-key.js +34 -0
  119. package/esm/auth/cli/commands.js +19 -3
  120. package/esm/auth/cli/executor.d.ts +28 -4
  121. package/esm/auth/orm/index.d.ts +32 -4
  122. package/esm/auth/orm/index.js +8 -0
  123. package/esm/auth/orm/input-types.d.ts +915 -145
  124. package/esm/auth/orm/input-types.js +7 -0
  125. package/esm/auth/orm/models/index.d.ts +4 -0
  126. package/esm/auth/orm/models/index.js +4 -0
  127. package/esm/auth/orm/models/orgApiKeyList.d.ts +36 -0
  128. package/esm/auth/orm/models/orgApiKeyList.js +76 -0
  129. package/esm/auth/orm/models/principal.d.ts +45 -0
  130. package/esm/auth/orm/models/principal.js +89 -0
  131. package/esm/auth/orm/models/principalEntity.d.ts +54 -0
  132. package/esm/auth/orm/models/principalEntity.js +100 -0
  133. package/esm/auth/orm/models/principalScopeOverride.d.ts +36 -0
  134. package/esm/auth/orm/models/principalScopeOverride.js +76 -0
  135. package/esm/auth/orm/mutation/index.d.ts +33 -1
  136. package/esm/auth/orm/mutation/index.js +48 -0
  137. package/esm/auth/orm/query/index.d.ts +4 -4
  138. package/esm/auth/orm/query/index.js +7 -7
  139. package/esm/compute/cli/commands/function-graph-execution.js +0 -22
  140. package/esm/compute/cli/commands/function-graph.js +0 -20
  141. package/esm/compute/cli/commands/platform-namespace-event.d.ts +8 -0
  142. package/esm/compute/cli/commands/platform-namespace-event.js +508 -0
  143. package/esm/compute/cli/commands/platform-namespace.d.ts +8 -0
  144. package/esm/compute/cli/commands/platform-namespace.js +434 -0
  145. package/esm/compute/cli/commands/resource-event.d.ts +8 -0
  146. package/esm/compute/cli/commands/resource-event.js +354 -0
  147. package/esm/compute/cli/commands/resource.d.ts +8 -0
  148. package/esm/compute/cli/commands/resource.js +518 -0
  149. package/esm/compute/cli/commands.js +13 -5
  150. package/esm/compute/cli/executor.d.ts +10 -6
  151. package/esm/compute/orm/index.d.ts +15 -7
  152. package/esm/compute/orm/index.js +10 -2
  153. package/esm/compute/orm/input-types.d.ts +1159 -221
  154. package/esm/compute/orm/input-types.js +4 -0
  155. package/esm/compute/orm/models/index.d.ts +5 -1
  156. package/esm/compute/orm/models/index.js +5 -1
  157. package/esm/compute/orm/models/platformNamespace.d.ts +54 -0
  158. package/esm/compute/orm/models/platformNamespace.js +100 -0
  159. package/esm/compute/orm/models/platformNamespaceEvent.d.ts +56 -0
  160. package/esm/compute/orm/models/platformNamespaceEvent.js +103 -0
  161. package/esm/compute/orm/models/resource.d.ts +54 -0
  162. package/esm/compute/orm/models/resource.js +100 -0
  163. package/esm/compute/orm/models/resourceEvent.d.ts +56 -0
  164. package/esm/compute/orm/models/resourceEvent.js +103 -0
  165. package/esm/compute/orm/mutation/index.d.ts +9 -9
  166. package/esm/compute/orm/mutation/index.js +12 -12
  167. package/esm/modules/cli/commands/merkle-store-module.js +22 -0
  168. package/esm/modules/cli/commands/principal-auth-module.d.ts +8 -0
  169. package/esm/modules/cli/commands/principal-auth-module.js +580 -0
  170. package/esm/modules/cli/commands/resource-module.d.ts +8 -0
  171. package/esm/modules/cli/commands/resource-module.js +602 -0
  172. package/esm/modules/cli/commands.js +9 -5
  173. package/esm/modules/cli/executor.d.ts +4 -2
  174. package/esm/modules/orm/index.d.ts +8 -4
  175. package/esm/modules/orm/index.js +8 -4
  176. package/esm/modules/orm/input-types.d.ts +868 -411
  177. package/esm/modules/orm/models/index.d.ts +4 -2
  178. package/esm/modules/orm/models/index.js +4 -2
  179. package/esm/modules/orm/models/principalAuthModule.d.ts +54 -0
  180. package/esm/modules/orm/models/principalAuthModule.js +100 -0
  181. package/esm/modules/orm/models/resourceModule.d.ts +54 -0
  182. package/esm/modules/orm/models/resourceModule.js +100 -0
  183. package/modules/cli/commands/merkle-store-module.js +22 -0
  184. package/modules/cli/commands/principal-auth-module.d.ts +8 -0
  185. package/modules/cli/commands/principal-auth-module.js +582 -0
  186. package/modules/cli/commands/resource-module.d.ts +8 -0
  187. package/modules/cli/commands/resource-module.js +604 -0
  188. package/modules/cli/commands.js +9 -5
  189. package/modules/cli/executor.d.ts +4 -2
  190. package/modules/orm/index.d.ts +8 -4
  191. package/modules/orm/index.js +8 -4
  192. package/modules/orm/input-types.d.ts +868 -411
  193. package/modules/orm/models/index.d.ts +4 -2
  194. package/modules/orm/models/index.js +10 -6
  195. package/modules/orm/models/principalAuthModule.d.ts +54 -0
  196. package/modules/orm/models/principalAuthModule.js +104 -0
  197. package/modules/orm/models/resourceModule.d.ts +54 -0
  198. package/modules/orm/models/resourceModule.js +104 -0
  199. package/package.json +5 -5
@@ -38,19 +38,21 @@ const blueprint_construction_1 = __importDefault(require("./commands/blueprint-c
38
38
  const crypto_auth_module_1 = __importDefault(require("./commands/crypto-auth-module"));
39
39
  const sessions_module_1 = __importDefault(require("./commands/sessions-module"));
40
40
  const secure_table_provision_1 = __importDefault(require("./commands/secure-table-provision"));
41
- const merkle_store_module_1 = __importDefault(require("./commands/merkle-store-module"));
42
- const graph_module_1 = __importDefault(require("./commands/graph-module"));
43
41
  const database_provision_module_1 = __importDefault(require("./commands/database-provision-module"));
44
42
  const config_secrets_module_1 = __importDefault(require("./commands/config-secrets-module"));
43
+ const graph_module_1 = __importDefault(require("./commands/graph-module"));
44
+ const merkle_store_module_1 = __importDefault(require("./commands/merkle-store-module"));
45
45
  const rate_limit_meters_module_1 = __importDefault(require("./commands/rate-limit-meters-module"));
46
46
  const realtime_module_1 = __importDefault(require("./commands/realtime-module"));
47
47
  const webauthn_auth_module_1 = __importDefault(require("./commands/webauthn-auth-module"));
48
48
  const function_invocation_module_1 = __importDefault(require("./commands/function-invocation-module"));
49
49
  const function_module_1 = __importDefault(require("./commands/function-module"));
50
50
  const invites_module_1 = __importDefault(require("./commands/invites-module"));
51
+ const principal_auth_module_1 = __importDefault(require("./commands/principal-auth-module"));
51
52
  const compute_log_module_1 = __importDefault(require("./commands/compute-log-module"));
52
53
  const inference_log_module_1 = __importDefault(require("./commands/inference-log-module"));
53
54
  const namespace_module_1 = __importDefault(require("./commands/namespace-module"));
55
+ const resource_module_1 = __importDefault(require("./commands/resource-module"));
54
56
  const storage_log_module_1 = __importDefault(require("./commands/storage-log-module"));
55
57
  const transfer_log_module_1 = __importDefault(require("./commands/transfer-log-module"));
56
58
  const function_deployment_module_1 = __importDefault(require("./commands/function-deployment-module"));
@@ -112,19 +114,21 @@ const createCommandMap = () => ({
112
114
  'crypto-auth-module': crypto_auth_module_1.default,
113
115
  'sessions-module': sessions_module_1.default,
114
116
  'secure-table-provision': secure_table_provision_1.default,
115
- 'merkle-store-module': merkle_store_module_1.default,
116
- 'graph-module': graph_module_1.default,
117
117
  'database-provision-module': database_provision_module_1.default,
118
118
  'config-secrets-module': config_secrets_module_1.default,
119
+ 'graph-module': graph_module_1.default,
120
+ 'merkle-store-module': merkle_store_module_1.default,
119
121
  'rate-limit-meters-module': rate_limit_meters_module_1.default,
120
122
  'realtime-module': realtime_module_1.default,
121
123
  'webauthn-auth-module': webauthn_auth_module_1.default,
122
124
  'function-invocation-module': function_invocation_module_1.default,
123
125
  'function-module': function_module_1.default,
124
126
  'invites-module': invites_module_1.default,
127
+ 'principal-auth-module': principal_auth_module_1.default,
125
128
  'compute-log-module': compute_log_module_1.default,
126
129
  'inference-log-module': inference_log_module_1.default,
127
130
  'namespace-module': namespace_module_1.default,
131
+ 'resource-module': resource_module_1.default,
128
132
  'storage-log-module': storage_log_module_1.default,
129
133
  'transfer-log-module': transfer_log_module_1.default,
130
134
  'function-deployment-module': function_deployment_module_1.default,
@@ -158,7 +162,7 @@ const createCommandMap = () => ({
158
162
  'provision-relation': provision_relation_1.default,
159
163
  'provision-bucket': provision_bucket_1.default,
160
164
  });
161
- 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";
165
+ 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";
162
166
  const commands = async (argv, prompter, options) => {
163
167
  if (argv.help || argv.h) {
164
168
  console.log(usage);
@@ -26,19 +26,21 @@ export declare function getClient(contextName?: string): {
26
26
  cryptoAuthModule: import("../orm").CryptoAuthModuleModel;
27
27
  sessionsModule: import("../orm").SessionsModuleModel;
28
28
  secureTableProvision: import("../orm").SecureTableProvisionModel;
29
- merkleStoreModule: import("../orm").MerkleStoreModuleModel;
30
- graphModule: import("../orm").GraphModuleModel;
31
29
  databaseProvisionModule: import("../orm").DatabaseProvisionModuleModel;
32
30
  configSecretsModule: import("../orm").ConfigSecretsModuleModel;
31
+ graphModule: import("../orm").GraphModuleModel;
32
+ merkleStoreModule: import("../orm").MerkleStoreModuleModel;
33
33
  rateLimitMetersModule: import("../orm").RateLimitMetersModuleModel;
34
34
  realtimeModule: import("../orm").RealtimeModuleModel;
35
35
  webauthnAuthModule: import("../orm").WebauthnAuthModuleModel;
36
36
  functionInvocationModule: import("../orm").FunctionInvocationModuleModel;
37
37
  functionModule: import("../orm").FunctionModuleModel;
38
38
  invitesModule: import("../orm").InvitesModuleModel;
39
+ principalAuthModule: import("../orm").PrincipalAuthModuleModel;
39
40
  computeLogModule: import("../orm").ComputeLogModuleModel;
40
41
  inferenceLogModule: import("../orm").InferenceLogModuleModel;
41
42
  namespaceModule: import("../orm").NamespaceModuleModel;
43
+ resourceModule: import("../orm").ResourceModuleModel;
42
44
  storageLogModule: import("../orm").StorageLogModuleModel;
43
45
  transferLogModule: import("../orm").TransferLogModuleModel;
44
46
  functionDeploymentModule: import("../orm").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;
@@ -48,19 +48,21 @@ const blueprintConstruction_1 = require("./models/blueprintConstruction");
48
48
  const cryptoAuthModule_1 = require("./models/cryptoAuthModule");
49
49
  const sessionsModule_1 = require("./models/sessionsModule");
50
50
  const secureTableProvision_1 = require("./models/secureTableProvision");
51
- const merkleStoreModule_1 = require("./models/merkleStoreModule");
52
- const graphModule_1 = require("./models/graphModule");
53
51
  const databaseProvisionModule_1 = require("./models/databaseProvisionModule");
54
52
  const configSecretsModule_1 = require("./models/configSecretsModule");
53
+ const graphModule_1 = require("./models/graphModule");
54
+ const merkleStoreModule_1 = require("./models/merkleStoreModule");
55
55
  const rateLimitMetersModule_1 = require("./models/rateLimitMetersModule");
56
56
  const realtimeModule_1 = require("./models/realtimeModule");
57
57
  const webauthnAuthModule_1 = require("./models/webauthnAuthModule");
58
58
  const functionInvocationModule_1 = require("./models/functionInvocationModule");
59
59
  const functionModule_1 = require("./models/functionModule");
60
60
  const invitesModule_1 = require("./models/invitesModule");
61
+ const principalAuthModule_1 = require("./models/principalAuthModule");
61
62
  const computeLogModule_1 = require("./models/computeLogModule");
62
63
  const inferenceLogModule_1 = require("./models/inferenceLogModule");
63
64
  const namespaceModule_1 = require("./models/namespaceModule");
65
+ const resourceModule_1 = require("./models/resourceModule");
64
66
  const storageLogModule_1 = require("./models/storageLogModule");
65
67
  const transferLogModule_1 = require("./models/transferLogModule");
66
68
  const functionDeploymentModule_1 = require("./models/functionDeploymentModule");
@@ -146,19 +148,21 @@ function createClient(config) {
146
148
  cryptoAuthModule: new cryptoAuthModule_1.CryptoAuthModuleModel(client),
147
149
  sessionsModule: new sessionsModule_1.SessionsModuleModel(client),
148
150
  secureTableProvision: new secureTableProvision_1.SecureTableProvisionModel(client),
149
- merkleStoreModule: new merkleStoreModule_1.MerkleStoreModuleModel(client),
150
- graphModule: new graphModule_1.GraphModuleModel(client),
151
151
  databaseProvisionModule: new databaseProvisionModule_1.DatabaseProvisionModuleModel(client),
152
152
  configSecretsModule: new configSecretsModule_1.ConfigSecretsModuleModel(client),
153
+ graphModule: new graphModule_1.GraphModuleModel(client),
154
+ merkleStoreModule: new merkleStoreModule_1.MerkleStoreModuleModel(client),
153
155
  rateLimitMetersModule: new rateLimitMetersModule_1.RateLimitMetersModuleModel(client),
154
156
  realtimeModule: new realtimeModule_1.RealtimeModuleModel(client),
155
157
  webauthnAuthModule: new webauthnAuthModule_1.WebauthnAuthModuleModel(client),
156
158
  functionInvocationModule: new functionInvocationModule_1.FunctionInvocationModuleModel(client),
157
159
  functionModule: new functionModule_1.FunctionModuleModel(client),
158
160
  invitesModule: new invitesModule_1.InvitesModuleModel(client),
161
+ principalAuthModule: new principalAuthModule_1.PrincipalAuthModuleModel(client),
159
162
  computeLogModule: new computeLogModule_1.ComputeLogModuleModel(client),
160
163
  inferenceLogModule: new inferenceLogModule_1.InferenceLogModuleModel(client),
161
164
  namespaceModule: new namespaceModule_1.NamespaceModuleModel(client),
165
+ resourceModule: new resourceModule_1.ResourceModuleModel(client),
162
166
  storageLogModule: new storageLogModule_1.StorageLogModuleModel(client),
163
167
  transferLogModule: new transferLogModule_1.TransferLogModuleModel(client),
164
168
  functionDeploymentModule: new functionDeploymentModule_1.FunctionDeploymentModuleModel(client),