@constructive-sdk/cli 0.21.10 → 0.22.0

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.
@@ -1126,6 +1126,7 @@ export interface SignUpInput {
1126
1126
  rememberMe?: boolean;
1127
1127
  credentialKind?: string;
1128
1128
  csrfToken?: string;
1129
+ deviceToken?: string;
1129
1130
  }
1130
1131
  export interface RequestCrossOriginTokenInput {
1131
1132
  clientMutationId?: string;
@@ -1126,6 +1126,7 @@ export interface SignUpInput {
1126
1126
  rememberMe?: boolean;
1127
1127
  credentialKind?: string;
1128
1128
  csrfToken?: string;
1129
+ deviceToken?: string;
1129
1130
  }
1130
1131
  export interface RequestCrossOriginTokenInput {
1131
1132
  clientMutationId?: string;
@@ -11,7 +11,7 @@ const fieldSchema = {
11
11
  databaseId: 'uuid',
12
12
  tableId: 'uuid',
13
13
  strategy: 'string',
14
- partitionKeyId: 'uuid',
14
+ partitionKeyIds: 'uuid',
15
15
  interval: 'string',
16
16
  retention: 'string',
17
17
  lookahead: 'int',
@@ -65,7 +65,7 @@ async function handleList(argv, _prompter) {
65
65
  databaseId: true,
66
66
  tableId: true,
67
67
  strategy: true,
68
- partitionKeyId: true,
68
+ partitionKeyIds: true,
69
69
  interval: true,
70
70
  retention: true,
71
71
  lookahead: true,
@@ -93,7 +93,7 @@ async function handleFindFirst(argv, _prompter) {
93
93
  databaseId: true,
94
94
  tableId: true,
95
95
  strategy: true,
96
- partitionKeyId: true,
96
+ partitionKeyIds: true,
97
97
  interval: true,
98
98
  retention: true,
99
99
  lookahead: true,
@@ -133,7 +133,7 @@ async function handleGet(argv, prompter) {
133
133
  databaseId: true,
134
134
  tableId: true,
135
135
  strategy: true,
136
- partitionKeyId: true,
136
+ partitionKeyIds: true,
137
137
  interval: true,
138
138
  retention: true,
139
139
  lookahead: true,
@@ -176,8 +176,8 @@ async function handleCreate(argv, prompter) {
176
176
  },
177
177
  {
178
178
  type: 'text',
179
- name: 'partitionKeyId',
180
- message: 'partitionKeyId',
179
+ name: 'partitionKeyIds',
180
+ message: 'partitionKeyIds',
181
181
  required: true,
182
182
  },
183
183
  {
@@ -218,7 +218,7 @@ async function handleCreate(argv, prompter) {
218
218
  databaseId: cleanedData.databaseId,
219
219
  tableId: cleanedData.tableId,
220
220
  strategy: cleanedData.strategy,
221
- partitionKeyId: cleanedData.partitionKeyId,
221
+ partitionKeyIds: cleanedData.partitionKeyIds,
222
222
  interval: cleanedData.interval,
223
223
  retention: cleanedData.retention,
224
224
  lookahead: cleanedData.lookahead,
@@ -229,7 +229,7 @@ async function handleCreate(argv, prompter) {
229
229
  databaseId: true,
230
230
  tableId: true,
231
231
  strategy: true,
232
- partitionKeyId: true,
232
+ partitionKeyIds: true,
233
233
  interval: true,
234
234
  retention: true,
235
235
  lookahead: true,
@@ -278,8 +278,8 @@ async function handleUpdate(argv, prompter) {
278
278
  },
279
279
  {
280
280
  type: 'text',
281
- name: 'partitionKeyId',
282
- message: 'partitionKeyId',
281
+ name: 'partitionKeyIds',
282
+ message: 'partitionKeyIds',
283
283
  required: false,
284
284
  },
285
285
  {
@@ -323,7 +323,7 @@ async function handleUpdate(argv, prompter) {
323
323
  databaseId: cleanedData.databaseId,
324
324
  tableId: cleanedData.tableId,
325
325
  strategy: cleanedData.strategy,
326
- partitionKeyId: cleanedData.partitionKeyId,
326
+ partitionKeyIds: cleanedData.partitionKeyIds,
327
327
  interval: cleanedData.interval,
328
328
  retention: cleanedData.retention,
329
329
  lookahead: cleanedData.lookahead,
@@ -334,7 +334,7 @@ async function handleUpdate(argv, prompter) {
334
334
  databaseId: true,
335
335
  tableId: true,
336
336
  strategy: true,
337
- partitionKeyId: true,
337
+ partitionKeyIds: true,
338
338
  interval: true,
339
339
  retention: true,
340
340
  lookahead: true,
@@ -23,6 +23,10 @@ const fieldSchema = {
23
23
  pluralName: 'string',
24
24
  singularName: 'string',
25
25
  tags: 'string',
26
+ partitioned: 'boolean',
27
+ partitionStrategy: 'string',
28
+ partitionKeyNames: 'string',
29
+ partitionKeyTypes: 'string',
26
30
  inheritsId: 'uuid',
27
31
  createdAt: 'string',
28
32
  updatedAt: 'string',
@@ -85,6 +89,10 @@ async function handleList(argv, _prompter) {
85
89
  pluralName: true,
86
90
  singularName: true,
87
91
  tags: true,
92
+ partitioned: true,
93
+ partitionStrategy: true,
94
+ partitionKeyNames: true,
95
+ partitionKeyTypes: true,
88
96
  inheritsId: true,
89
97
  createdAt: true,
90
98
  updatedAt: true,
@@ -121,6 +129,10 @@ async function handleFindFirst(argv, _prompter) {
121
129
  pluralName: true,
122
130
  singularName: true,
123
131
  tags: true,
132
+ partitioned: true,
133
+ partitionStrategy: true,
134
+ partitionKeyNames: true,
135
+ partitionKeyTypes: true,
124
136
  inheritsId: true,
125
137
  createdAt: true,
126
138
  updatedAt: true,
@@ -169,6 +181,10 @@ async function handleGet(argv, prompter) {
169
181
  pluralName: true,
170
182
  singularName: true,
171
183
  tags: true,
184
+ partitioned: true,
185
+ partitionStrategy: true,
186
+ partitionKeyNames: true,
187
+ partitionKeyTypes: true,
172
188
  inheritsId: true,
173
189
  createdAt: true,
174
190
  updatedAt: true,
@@ -291,6 +307,34 @@ async function handleCreate(argv, prompter) {
291
307
  required: false,
292
308
  skipPrompt: true,
293
309
  },
310
+ {
311
+ type: 'boolean',
312
+ name: 'partitioned',
313
+ message: 'partitioned',
314
+ required: false,
315
+ skipPrompt: true,
316
+ },
317
+ {
318
+ type: 'text',
319
+ name: 'partitionStrategy',
320
+ message: 'partitionStrategy',
321
+ required: false,
322
+ skipPrompt: true,
323
+ },
324
+ {
325
+ type: 'text',
326
+ name: 'partitionKeyNames',
327
+ message: 'partitionKeyNames',
328
+ required: false,
329
+ skipPrompt: true,
330
+ },
331
+ {
332
+ type: 'text',
333
+ name: 'partitionKeyTypes',
334
+ message: 'partitionKeyTypes',
335
+ required: false,
336
+ skipPrompt: true,
337
+ },
294
338
  {
295
339
  type: 'text',
296
340
  name: 'inheritsId',
@@ -320,6 +364,10 @@ async function handleCreate(argv, prompter) {
320
364
  pluralName: cleanedData.pluralName,
321
365
  singularName: cleanedData.singularName,
322
366
  tags: cleanedData.tags,
367
+ partitioned: cleanedData.partitioned,
368
+ partitionStrategy: cleanedData.partitionStrategy,
369
+ partitionKeyNames: cleanedData.partitionKeyNames,
370
+ partitionKeyTypes: cleanedData.partitionKeyTypes,
323
371
  inheritsId: cleanedData.inheritsId,
324
372
  },
325
373
  select: {
@@ -339,6 +387,10 @@ async function handleCreate(argv, prompter) {
339
387
  pluralName: true,
340
388
  singularName: true,
341
389
  tags: true,
390
+ partitioned: true,
391
+ partitionStrategy: true,
392
+ partitionKeyNames: true,
393
+ partitionKeyTypes: true,
342
394
  inheritsId: true,
343
395
  createdAt: true,
344
396
  updatedAt: true,
@@ -467,6 +519,34 @@ async function handleUpdate(argv, prompter) {
467
519
  required: false,
468
520
  skipPrompt: true,
469
521
  },
522
+ {
523
+ type: 'boolean',
524
+ name: 'partitioned',
525
+ message: 'partitioned',
526
+ required: false,
527
+ skipPrompt: true,
528
+ },
529
+ {
530
+ type: 'text',
531
+ name: 'partitionStrategy',
532
+ message: 'partitionStrategy',
533
+ required: false,
534
+ skipPrompt: true,
535
+ },
536
+ {
537
+ type: 'text',
538
+ name: 'partitionKeyNames',
539
+ message: 'partitionKeyNames',
540
+ required: false,
541
+ skipPrompt: true,
542
+ },
543
+ {
544
+ type: 'text',
545
+ name: 'partitionKeyTypes',
546
+ message: 'partitionKeyTypes',
547
+ required: false,
548
+ skipPrompt: true,
549
+ },
470
550
  {
471
551
  type: 'text',
472
552
  name: 'inheritsId',
@@ -499,6 +579,10 @@ async function handleUpdate(argv, prompter) {
499
579
  pluralName: cleanedData.pluralName,
500
580
  singularName: cleanedData.singularName,
501
581
  tags: cleanedData.tags,
582
+ partitioned: cleanedData.partitioned,
583
+ partitionStrategy: cleanedData.partitionStrategy,
584
+ partitionKeyNames: cleanedData.partitionKeyNames,
585
+ partitionKeyTypes: cleanedData.partitionKeyTypes,
502
586
  inheritsId: cleanedData.inheritsId,
503
587
  },
504
588
  select: {
@@ -518,6 +602,10 @@ async function handleUpdate(argv, prompter) {
518
602
  pluralName: true,
519
603
  singularName: true,
520
604
  tags: true,
605
+ partitioned: true,
606
+ partitionStrategy: true,
607
+ partitionKeyNames: true,
608
+ partitionKeyTypes: true,
521
609
  inheritsId: true,
522
610
  createdAt: true,
523
611
  updatedAt: true,
@@ -19,7 +19,6 @@ import tableCmd from './commands/table';
19
19
  import checkConstraintCmd from './commands/check-constraint';
20
20
  import fieldCmd from './commands/field';
21
21
  import spatialRelationCmd from './commands/spatial-relation';
22
- import partitionCmd from './commands/partition';
23
22
  import foreignKeyConstraintCmd from './commands/foreign-key-constraint';
24
23
  import fullTextSearchCmd from './commands/full-text-search';
25
24
  import indexCmd from './commands/index';
@@ -51,6 +50,7 @@ import siteThemeCmd from './commands/site-theme';
51
50
  import corsSettingCmd from './commands/cors-setting';
52
51
  import triggerFunctionCmd from './commands/trigger-function';
53
52
  import databaseTransferCmd from './commands/database-transfer';
53
+ import partitionCmd from './commands/partition';
54
54
  import apiCmd from './commands/api';
55
55
  import siteCmd from './commands/site';
56
56
  import appCmd from './commands/app';
@@ -242,7 +242,6 @@ const createCommandMap = () => ({
242
242
  'check-constraint': checkConstraintCmd,
243
243
  field: fieldCmd,
244
244
  'spatial-relation': spatialRelationCmd,
245
- partition: partitionCmd,
246
245
  'foreign-key-constraint': foreignKeyConstraintCmd,
247
246
  'full-text-search': fullTextSearchCmd,
248
247
  index: indexCmd,
@@ -274,6 +273,7 @@ const createCommandMap = () => ({
274
273
  'cors-setting': corsSettingCmd,
275
274
  'trigger-function': triggerFunctionCmd,
276
275
  'database-transfer': databaseTransferCmd,
276
+ partition: partitionCmd,
277
277
  api: apiCmd,
278
278
  site: siteCmd,
279
279
  app: appCmd,
@@ -450,7 +450,7 @@ const createCommandMap = () => ({
450
450
  'provision-table': provisionTableCmd,
451
451
  'provision-bucket': provisionBucketCmd,
452
452
  });
453
- const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n object object CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n spatial-relation spatialRelation CRUD operations\n partition partition CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n realtime-module realtimeModule CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n function function CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n cors-setting corsSetting CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n api-setting apiSetting CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n notifications-module notificationsModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-member-profile orgMemberProfile CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n app-limit-credit appLimitCredit CRUD operations\n app-limit-credit-code-item appLimitCreditCodeItem CRUD operations\n app-limit-credit-redemption appLimitCreditRedemption CRUD operations\n org-limit orgLimit CRUD operations\n org-limit-credit orgLimitCredit CRUD operations\n org-limit-aggregate orgLimitAggregate CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n app-invite appInvite CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n agent-thread agentThread CRUD operations\n agent-message agentMessage CRUD operations\n agent-task agentTask CRUD operations\n role-type roleType CRUD operations\n identity-provider identityProvider CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n app-limit-credit-code appLimitCreditCode CRUD operations\n app-limit-caps-default appLimitCapsDefault CRUD operations\n org-limit-caps-default orgLimitCapsDefault CRUD operations\n app-limit-cap appLimitCap CRUD operations\n org-limit-cap orgLimitCap CRUD operations\n membership-type membershipType CRUD operations\n migrate-file migrateFile CRUD operations\n devices-module devicesModule CRUD operations\n node-type-registry nodeTypeRegistry CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n commit commit CRUD operations\n pubkey-setting pubkeySetting CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n usage-snapshot usageSnapshot CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-setting rlsSetting CRUD operations\n app-limit-event appLimitEvent CRUD operations\n org-limit-event orgLimitEvent CRUD operations\n rls-module rlsModule CRUD operations\n plans-module plansModule CRUD operations\n sql-action sqlAction CRUD operations\n database-setting databaseSetting CRUD operations\n billing-module billingModule CRUD operations\n ast-migration astMigration CRUD operations\n user user CRUD operations\n org-membership-setting orgMembershipSetting CRUD operations\n webauthn-setting webauthnSetting CRUD operations\n app-membership appMembership CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-user-agent currentUserAgent\n current-ip-address currentIpAddress\n require-step-up requireStepUp\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\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 org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\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 app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Seven phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security, (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints/check_constraints are deferred), (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. 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-new-user provisionNewUser\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\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 bootstrap-user bootstrapUser\n set-field-order setFieldOrder\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 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 set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\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 apply-rls applyRls\n sign-in-cross-origin signInCrossOrigin\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n create-api-key createApiKey\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n sign-up signUp\n request-cross-origin-token requestCrossOriginToken\n sign-in signIn\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-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";
453
+ const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord CRUD operations\n get-all-record getAllRecord CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission CRUD operations\n object object CRUD operations\n app-level-requirement appLevelRequirement CRUD operations\n database database CRUD operations\n schema schema CRUD operations\n table table CRUD operations\n check-constraint checkConstraint CRUD operations\n field field CRUD operations\n spatial-relation spatialRelation CRUD operations\n foreign-key-constraint foreignKeyConstraint CRUD operations\n full-text-search fullTextSearch CRUD operations\n index index CRUD operations\n policy policy CRUD operations\n primary-key-constraint primaryKeyConstraint CRUD operations\n table-grant tableGrant CRUD operations\n trigger trigger CRUD operations\n unique-constraint uniqueConstraint CRUD operations\n view view CRUD operations\n view-table viewTable CRUD operations\n view-grant viewGrant CRUD operations\n view-rule viewRule CRUD operations\n embedding-chunk embeddingChunk CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n realtime-module realtimeModule CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum CRUD operations\n function function CRUD operations\n api-schema apiSchema CRUD operations\n api-module apiModule CRUD operations\n domain domain CRUD operations\n site-metadatum siteMetadatum CRUD operations\n site-module siteModule CRUD operations\n site-theme siteTheme CRUD operations\n cors-setting corsSetting CRUD operations\n trigger-function triggerFunction CRUD operations\n database-transfer databaseTransfer CRUD operations\n partition partition CRUD operations\n api api CRUD operations\n site site CRUD operations\n app app CRUD operations\n api-setting apiSetting CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n default-ids-module defaultIdsModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n emails-module emailsModule CRUD operations\n encrypted-secrets-module encryptedSecretsModule CRUD operations\n invites-module invitesModule CRUD operations\n levels-module levelsModule CRUD operations\n limits-module limitsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n memberships-module membershipsModule CRUD operations\n permissions-module permissionsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n profiles-module profilesModule CRUD operations\n secrets-module secretsModule CRUD operations\n sessions-module sessionsModule CRUD operations\n user-auth-module userAuthModule CRUD operations\n users-module usersModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n storage-module storageModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n notifications-module notificationsModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n app-admin-grant appAdminGrant CRUD operations\n app-owner-grant appOwnerGrant CRUD operations\n app-grant appGrant CRUD operations\n org-membership orgMembership CRUD operations\n org-member orgMember CRUD operations\n org-admin-grant orgAdminGrant CRUD operations\n org-owner-grant orgOwnerGrant CRUD operations\n org-member-profile orgMemberProfile CRUD operations\n org-grant orgGrant CRUD operations\n org-chart-edge orgChartEdge CRUD operations\n org-chart-edge-grant orgChartEdgeGrant CRUD operations\n org-permission-default orgPermissionDefault CRUD operations\n app-limit appLimit CRUD operations\n app-limit-credit appLimitCredit CRUD operations\n app-limit-credit-code-item appLimitCreditCodeItem CRUD operations\n app-limit-credit-redemption appLimitCreditRedemption CRUD operations\n org-limit orgLimit CRUD operations\n org-limit-credit orgLimitCredit CRUD operations\n org-limit-aggregate orgLimitAggregate CRUD operations\n app-step appStep CRUD operations\n app-achievement appAchievement CRUD operations\n app-level appLevel CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n app-invite appInvite CRUD operations\n app-claimed-invite appClaimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n agent-thread agentThread CRUD operations\n agent-message agentMessage CRUD operations\n agent-task agentTask CRUD operations\n role-type roleType CRUD operations\n identity-provider identityProvider CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n app-limit-credit-code appLimitCreditCode CRUD operations\n app-limit-caps-default appLimitCapsDefault CRUD operations\n org-limit-caps-default orgLimitCapsDefault CRUD operations\n app-limit-cap appLimitCap CRUD operations\n org-limit-cap orgLimitCap CRUD operations\n membership-type membershipType CRUD operations\n migrate-file migrateFile CRUD operations\n devices-module devicesModule CRUD operations\n node-type-registry nodeTypeRegistry CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n commit commit CRUD operations\n pubkey-setting pubkeySetting CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n usage-snapshot usageSnapshot CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-setting rlsSetting CRUD operations\n app-limit-event appLimitEvent CRUD operations\n org-limit-event orgLimitEvent CRUD operations\n rls-module rlsModule CRUD operations\n plans-module plansModule CRUD operations\n sql-action sqlAction CRUD operations\n database-setting databaseSetting CRUD operations\n billing-module billingModule CRUD operations\n ast-migration astMigration CRUD operations\n user user CRUD operations\n org-membership-setting orgMembershipSetting CRUD operations\n webauthn-setting webauthnSetting CRUD operations\n app-membership appMembership CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-user-agent currentUserAgent\n current-ip-address currentIpAddress\n require-step-up requireStepUp\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\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 org-is-manager-of orgIsManagerOf\n app-permissions-get-mask appPermissionsGetMask\n org-permissions-get-mask orgPermissionsGetMask\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 app-permissions-get-mask-by-names appPermissionsGetMaskByNames\n org-permissions-get-mask-by-names orgPermissionsGetMaskByNames\n app-permissions-get-by-mask Reads and enables pagination through a set of `AppPermission`.\n org-permissions-get-by-mask Reads and enables pagination through a set of `OrgPermission`.\n get-all-objects-from-root Reads and enables pagination through a set of `Object`.\n get-path-objects-from-root Reads and enables pagination through a set of `Object`.\n get-object-at-path getObjectAtPath\n steps-required Reads and enables pagination through a set of `AppLevelRequirement`.\n current-user currentUser\n send-account-deletion-email sendAccountDeletionEmail\n sign-out signOut\n accept-database-transfer acceptDatabaseTransfer\n cancel-database-transfer cancelDatabaseTransfer\n reject-database-transfer rejectDatabaseTransfer\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n submit-app-invite-code submitAppInviteCode\n submit-org-invite-code submitOrgInviteCode\n check-password checkPassword\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n freeze-objects freezeObjects\n init-empty-repo initEmptyRepo\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Seven phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security, (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints/check_constraints are deferred), (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. 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-new-user provisionNewUser\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\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 bootstrap-user bootstrapUser\n set-field-order setFieldOrder\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 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 set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\n provision-database-with-user provisionDatabaseWithUser\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\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 apply-rls applyRls\n sign-in-cross-origin signInCrossOrigin\n create-user-database Creates a new user database with all required modules, permissions, and RLS policies.\n\nParameters:\n - database_name: Name for the new database (required)\n - owner_id: UUID of the owner user (required)\n - include_invites: Include invite system (default: true)\n - include_groups: Include group-level memberships (default: false)\n - include_levels: Include levels/achievements (default: false)\n - bitlen: Bit length for permission masks (default: 64)\n - tokens_expiration: Token expiration interval (default: 30 days)\n\nReturns the database_id UUID of the newly created database.\n\nExample usage:\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid);\n SELECT metaschema_public.create_user_database('my_app', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, true, true); -- with invites and groups\n\n extend-token-expires extendTokenExpires\n create-api-key createApiKey\n send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n sign-up signUp\n request-cross-origin-token requestCrossOriginToken\n sign-in signIn\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-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";
454
454
  export const commands = async (argv, prompter, options) => {
455
455
  if (argv.help || argv.h) {
456
456
  console.log(usage);
@@ -13,7 +13,6 @@ export declare function getClient(contextName?: string): {
13
13
  checkConstraint: import("..").CheckConstraintModel;
14
14
  field: import("..").FieldModel;
15
15
  spatialRelation: import("..").SpatialRelationModel;
16
- partition: import("..").PartitionModel;
17
16
  foreignKeyConstraint: import("..").ForeignKeyConstraintModel;
18
17
  fullTextSearch: import("..").FullTextSearchModel;
19
18
  index: import("..").IndexModel;
@@ -45,6 +44,7 @@ export declare function getClient(contextName?: string): {
45
44
  corsSetting: import("..").CorsSettingModel;
46
45
  triggerFunction: import("..").TriggerFunctionModel;
47
46
  databaseTransfer: import("..").DatabaseTransferModel;
47
+ partition: import("..").PartitionModel;
48
48
  api: import("..").ApiModel;
49
49
  site: import("..").SiteModel;
50
50
  app: import("..").AppModel;
@@ -12,7 +12,6 @@ import { TableModel } from './models/table';
12
12
  import { CheckConstraintModel } from './models/checkConstraint';
13
13
  import { FieldModel } from './models/field';
14
14
  import { SpatialRelationModel } from './models/spatialRelation';
15
- import { PartitionModel } from './models/partition';
16
15
  import { ForeignKeyConstraintModel } from './models/foreignKeyConstraint';
17
16
  import { FullTextSearchModel } from './models/fullTextSearch';
18
17
  import { IndexModel } from './models/index';
@@ -44,6 +43,7 @@ import { SiteThemeModel } from './models/siteTheme';
44
43
  import { CorsSettingModel } from './models/corsSetting';
45
44
  import { TriggerFunctionModel } from './models/triggerFunction';
46
45
  import { DatabaseTransferModel } from './models/databaseTransfer';
46
+ import { PartitionModel } from './models/partition';
47
47
  import { ApiModel } from './models/api';
48
48
  import { SiteModel } from './models/site';
49
49
  import { AppModel } from './models/app';
@@ -192,7 +192,6 @@ export declare function createClient(config: OrmClientConfig): {
192
192
  checkConstraint: CheckConstraintModel;
193
193
  field: FieldModel;
194
194
  spatialRelation: SpatialRelationModel;
195
- partition: PartitionModel;
196
195
  foreignKeyConstraint: ForeignKeyConstraintModel;
197
196
  fullTextSearch: FullTextSearchModel;
198
197
  index: IndexModel;
@@ -224,6 +223,7 @@ export declare function createClient(config: OrmClientConfig): {
224
223
  corsSetting: CorsSettingModel;
225
224
  triggerFunction: TriggerFunctionModel;
226
225
  databaseTransfer: DatabaseTransferModel;
226
+ partition: PartitionModel;
227
227
  api: ApiModel;
228
228
  site: SiteModel;
229
229
  app: AppModel;
@@ -17,7 +17,6 @@ import { TableModel } from './models/table';
17
17
  import { CheckConstraintModel } from './models/checkConstraint';
18
18
  import { FieldModel } from './models/field';
19
19
  import { SpatialRelationModel } from './models/spatialRelation';
20
- import { PartitionModel } from './models/partition';
21
20
  import { ForeignKeyConstraintModel } from './models/foreignKeyConstraint';
22
21
  import { FullTextSearchModel } from './models/fullTextSearch';
23
22
  import { IndexModel } from './models/index';
@@ -49,6 +48,7 @@ import { SiteThemeModel } from './models/siteTheme';
49
48
  import { CorsSettingModel } from './models/corsSetting';
50
49
  import { TriggerFunctionModel } from './models/triggerFunction';
51
50
  import { DatabaseTransferModel } from './models/databaseTransfer';
51
+ import { PartitionModel } from './models/partition';
52
52
  import { ApiModel } from './models/api';
53
53
  import { SiteModel } from './models/site';
54
54
  import { AppModel } from './models/app';
@@ -200,7 +200,6 @@ export function createClient(config) {
200
200
  checkConstraint: new CheckConstraintModel(client),
201
201
  field: new FieldModel(client),
202
202
  spatialRelation: new SpatialRelationModel(client),
203
- partition: new PartitionModel(client),
204
203
  foreignKeyConstraint: new ForeignKeyConstraintModel(client),
205
204
  fullTextSearch: new FullTextSearchModel(client),
206
205
  index: new IndexModel(client),
@@ -232,6 +231,7 @@ export function createClient(config) {
232
231
  corsSetting: new CorsSettingModel(client),
233
232
  triggerFunction: new TriggerFunctionModel(client),
234
233
  databaseTransfer: new DatabaseTransferModel(client),
234
+ partition: new PartitionModel(client),
235
235
  api: new ApiModel(client),
236
236
  site: new SiteModel(client),
237
237
  app: new AppModel(client),