@constructive-sdk/cli 0.12.18 → 0.12.20
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/admin/cli/commands.js +13 -13
- package/admin/cli/executor.d.ts +6 -6
- package/admin/orm/index.d.ts +12 -12
- package/admin/orm/index.js +12 -12
- package/admin/orm/input-types.d.ts +849 -849
- package/admin/orm/models/index.d.ts +6 -6
- package/admin/orm/models/index.js +13 -13
- package/esm/admin/cli/commands.js +13 -13
- package/esm/admin/cli/executor.d.ts +6 -6
- package/esm/admin/orm/index.d.ts +12 -12
- package/esm/admin/orm/index.js +12 -12
- package/esm/admin/orm/input-types.d.ts +849 -849
- package/esm/admin/orm/models/index.d.ts +6 -6
- package/esm/admin/orm/models/index.js +6 -6
- package/esm/public/cli/commands/provision-table.js +1 -1
- package/esm/public/cli/commands.js +9 -11
- package/esm/public/cli/executor.d.ts +4 -5
- package/esm/public/orm/index.d.ts +8 -10
- package/esm/public/orm/index.js +8 -10
- package/esm/public/orm/input-types.d.ts +368 -529
- package/esm/public/orm/models/index.d.ts +4 -5
- package/esm/public/orm/models/index.js +4 -5
- package/esm/public/orm/mutation/index.d.ts +1 -1
- package/package.json +3 -3
- package/public/cli/commands/provision-table.js +1 -1
- package/public/cli/commands.js +9 -11
- package/public/cli/executor.d.ts +4 -5
- package/public/orm/index.d.ts +8 -10
- package/public/orm/index.js +8 -10
- package/public/orm/input-types.d.ts +368 -529
- package/public/orm/models/index.d.ts +4 -5
- package/public/orm/models/index.js +10 -12
- package/public/orm/mutation/index.d.ts +1 -1
- package/esm/public/cli/commands/node-type-registry.d.ts +0 -8
- package/esm/public/cli/commands/node-type-registry.js +0 -399
- package/esm/public/orm/models/nodeTypeRegistry.d.ts +0 -56
- package/esm/public/orm/models/nodeTypeRegistry.js +0 -96
- package/public/cli/commands/node-type-registry.d.ts +0 -8
- package/public/cli/commands/node-type-registry.js +0 -401
- package/public/orm/models/nodeTypeRegistry.d.ts +0 -56
- package/public/orm/models/nodeTypeRegistry.js +0 -100
|
@@ -13,25 +13,25 @@ export { AppPermissionDefaultModel } from './appPermissionDefault';
|
|
|
13
13
|
export { OrgPermissionDefaultModel } from './orgPermissionDefault';
|
|
14
14
|
export { AppAdminGrantModel } from './appAdminGrant';
|
|
15
15
|
export { AppOwnerGrantModel } from './appOwnerGrant';
|
|
16
|
-
export { OrgAdminGrantModel } from './orgAdminGrant';
|
|
17
|
-
export { OrgOwnerGrantModel } from './orgOwnerGrant';
|
|
18
16
|
export { AppLimitDefaultModel } from './appLimitDefault';
|
|
19
17
|
export { OrgLimitDefaultModel } from './orgLimitDefault';
|
|
20
|
-
export {
|
|
18
|
+
export { OrgAdminGrantModel } from './orgAdminGrant';
|
|
19
|
+
export { OrgOwnerGrantModel } from './orgOwnerGrant';
|
|
21
20
|
export { MembershipTypeModel } from './membershipType';
|
|
22
21
|
export { AppLimitModel } from './appLimit';
|
|
23
22
|
export { AppAchievementModel } from './appAchievement';
|
|
24
23
|
export { AppStepModel } from './appStep';
|
|
25
24
|
export { ClaimedInviteModel } from './claimedInvite';
|
|
25
|
+
export { OrgChartEdgeGrantModel } from './orgChartEdgeGrant';
|
|
26
|
+
export { OrgLimitModel } from './orgLimit';
|
|
26
27
|
export { AppGrantModel } from './appGrant';
|
|
27
28
|
export { AppMembershipDefaultModel } from './appMembershipDefault';
|
|
28
|
-
export { OrgLimitModel } from './orgLimit';
|
|
29
29
|
export { OrgClaimedInviteModel } from './orgClaimedInvite';
|
|
30
30
|
export { OrgGrantModel } from './orgGrant';
|
|
31
31
|
export { OrgChartEdgeModel } from './orgChartEdge';
|
|
32
32
|
export { OrgMembershipDefaultModel } from './orgMembershipDefault';
|
|
33
|
+
export { AppLevelModel } from './appLevel';
|
|
34
|
+
export { InviteModel } from './invite';
|
|
33
35
|
export { AppMembershipModel } from './appMembership';
|
|
34
36
|
export { OrgMembershipModel } from './orgMembership';
|
|
35
|
-
export { InviteModel } from './invite';
|
|
36
|
-
export { AppLevelModel } from './appLevel';
|
|
37
37
|
export { OrgInviteModel } from './orgInvite';
|
|
@@ -13,25 +13,25 @@ export { AppPermissionDefaultModel } from './appPermissionDefault';
|
|
|
13
13
|
export { OrgPermissionDefaultModel } from './orgPermissionDefault';
|
|
14
14
|
export { AppAdminGrantModel } from './appAdminGrant';
|
|
15
15
|
export { AppOwnerGrantModel } from './appOwnerGrant';
|
|
16
|
-
export { OrgAdminGrantModel } from './orgAdminGrant';
|
|
17
|
-
export { OrgOwnerGrantModel } from './orgOwnerGrant';
|
|
18
16
|
export { AppLimitDefaultModel } from './appLimitDefault';
|
|
19
17
|
export { OrgLimitDefaultModel } from './orgLimitDefault';
|
|
20
|
-
export {
|
|
18
|
+
export { OrgAdminGrantModel } from './orgAdminGrant';
|
|
19
|
+
export { OrgOwnerGrantModel } from './orgOwnerGrant';
|
|
21
20
|
export { MembershipTypeModel } from './membershipType';
|
|
22
21
|
export { AppLimitModel } from './appLimit';
|
|
23
22
|
export { AppAchievementModel } from './appAchievement';
|
|
24
23
|
export { AppStepModel } from './appStep';
|
|
25
24
|
export { ClaimedInviteModel } from './claimedInvite';
|
|
25
|
+
export { OrgChartEdgeGrantModel } from './orgChartEdgeGrant';
|
|
26
|
+
export { OrgLimitModel } from './orgLimit';
|
|
26
27
|
export { AppGrantModel } from './appGrant';
|
|
27
28
|
export { AppMembershipDefaultModel } from './appMembershipDefault';
|
|
28
|
-
export { OrgLimitModel } from './orgLimit';
|
|
29
29
|
export { OrgClaimedInviteModel } from './orgClaimedInvite';
|
|
30
30
|
export { OrgGrantModel } from './orgGrant';
|
|
31
31
|
export { OrgChartEdgeModel } from './orgChartEdge';
|
|
32
32
|
export { OrgMembershipDefaultModel } from './orgMembershipDefault';
|
|
33
|
+
export { AppLevelModel } from './appLevel';
|
|
34
|
+
export { InviteModel } from './invite';
|
|
33
35
|
export { AppMembershipModel } from './appMembership';
|
|
34
36
|
export { OrgMembershipModel } from './orgMembership';
|
|
35
|
-
export { InviteModel } from './invite';
|
|
36
|
-
export { AppLevelModel } from './appLevel';
|
|
37
37
|
export { OrgInviteModel } from './orgInvite';
|
|
@@ -3,7 +3,7 @@ import { unflattenDotNotation, buildSelectFromPaths } from '../utils';
|
|
|
3
3
|
export default async (argv, prompter, _options) => {
|
|
4
4
|
try {
|
|
5
5
|
if (argv.help || argv.h) {
|
|
6
|
-
console.log('provision-table - Composable table provisioning: creates or finds a table, then applies N nodes (Data* modules),
|
|
6
|
+
console.log('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\nUsage: provision-table [OPTIONS]\n');
|
|
7
7
|
process.exit(0);
|
|
8
8
|
}
|
|
9
9
|
const answers = await prompter.prompt(argv, [
|
|
@@ -97,19 +97,18 @@ import claimedInviteCmd from './commands/claimed-invite';
|
|
|
97
97
|
import orgInviteCmd from './commands/org-invite';
|
|
98
98
|
import orgClaimedInviteCmd from './commands/org-claimed-invite';
|
|
99
99
|
import auditLogCmd from './commands/audit-log';
|
|
100
|
+
import appPermissionDefaultCmd from './commands/app-permission-default';
|
|
100
101
|
import refCmd from './commands/ref';
|
|
101
102
|
import storeCmd from './commands/store';
|
|
102
|
-
import appPermissionDefaultCmd from './commands/app-permission-default';
|
|
103
103
|
import roleTypeCmd from './commands/role-type';
|
|
104
|
+
import migrateFileCmd from './commands/migrate-file';
|
|
104
105
|
import appLimitDefaultCmd from './commands/app-limit-default';
|
|
105
106
|
import orgLimitDefaultCmd from './commands/org-limit-default';
|
|
106
|
-
import migrateFileCmd from './commands/migrate-file';
|
|
107
107
|
import membershipTypeCmd from './commands/membership-type';
|
|
108
|
-
import commitCmd from './commands/commit';
|
|
109
108
|
import appMembershipDefaultCmd from './commands/app-membership-default';
|
|
110
|
-
import
|
|
111
|
-
import nodeTypeRegistryCmd from './commands/node-type-registry';
|
|
109
|
+
import commitCmd from './commands/commit';
|
|
112
110
|
import orgMembershipDefaultCmd from './commands/org-membership-default';
|
|
111
|
+
import rlsModuleCmd from './commands/rls-module';
|
|
113
112
|
import sqlActionCmd from './commands/sql-action';
|
|
114
113
|
import userCmd from './commands/user';
|
|
115
114
|
import astMigrationCmd from './commands/ast-migration';
|
|
@@ -270,19 +269,18 @@ const createCommandMap = () => ({
|
|
|
270
269
|
'org-invite': orgInviteCmd,
|
|
271
270
|
'org-claimed-invite': orgClaimedInviteCmd,
|
|
272
271
|
'audit-log': auditLogCmd,
|
|
272
|
+
'app-permission-default': appPermissionDefaultCmd,
|
|
273
273
|
ref: refCmd,
|
|
274
274
|
store: storeCmd,
|
|
275
|
-
'app-permission-default': appPermissionDefaultCmd,
|
|
276
275
|
'role-type': roleTypeCmd,
|
|
276
|
+
'migrate-file': migrateFileCmd,
|
|
277
277
|
'app-limit-default': appLimitDefaultCmd,
|
|
278
278
|
'org-limit-default': orgLimitDefaultCmd,
|
|
279
|
-
'migrate-file': migrateFileCmd,
|
|
280
279
|
'membership-type': membershipTypeCmd,
|
|
281
|
-
commit: commitCmd,
|
|
282
280
|
'app-membership-default': appMembershipDefaultCmd,
|
|
283
|
-
|
|
284
|
-
'node-type-registry': nodeTypeRegistryCmd,
|
|
281
|
+
commit: commitCmd,
|
|
285
282
|
'org-membership-default': orgMembershipDefaultCmd,
|
|
283
|
+
'rls-module': rlsModuleCmd,
|
|
286
284
|
'sql-action': sqlActionCmd,
|
|
287
285
|
user: userCmd,
|
|
288
286
|
'ast-migration': astMigrationCmd,
|
|
@@ -350,7 +348,7 @@ const createCommandMap = () => ({
|
|
|
350
348
|
'verify-password': verifyPasswordCmd,
|
|
351
349
|
'verify-totp': verifyTotpCmd,
|
|
352
350
|
});
|
|
353
|
-
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 object object CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission 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 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 table-template-module tableTemplateModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum 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 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 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 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-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 org-limit orgLimit 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 connected-account connectedAccount CRUD operations\n invite invite CRUD operations\n claimed-invite claimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n role-type roleType CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n migrate-file migrateFile CRUD operations\n membership-type membershipType CRUD operations\n commit commit CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n rls-module rlsModule CRUD operations\n node-type-registry nodeTypeRegistry CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n sql-action sqlAction CRUD operations\n user user CRUD operations\n ast-migration astMigration CRUD operations\n app-membership appMembership CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-ip-address currentIpAddress\n current-user-agent currentUserAgent\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\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 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 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 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 submit-invite-code submitInviteCode\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. Five phases: (1) provision_table() for each table with all nodes[], fields[], policies[], grants, and table-level indexes/fts/unique_constraints in a single call, (2) provision_relation() for each relation, (3) provision_index() for top-level indexes, (4) provision_full_text_search() for top-level FTS, (5) provision_unique_constraint() for top-level unique constraints. Tables are identified by table_name with optional per-table schema_name. Relations use $type for relation_type with source_table/target_table. Returns the construction record ID on success, NULL on failure.\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 bootstrap-user bootstrapUser\n set-field-order setFieldOrder\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-one-time-token signInOneTimeToken\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 sign-in signIn\n sign-up signUp\n one-time-token oneTimeToken\n provision-table Composable table provisioning: creates or finds a table, then applies N nodes (Data* modules), creates fields, 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 send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n verify-password verifyPassword\n verify-totp verifyTotp\n\n --help, -h Show this help message\n --version, -v Show version\n";
|
|
351
|
+
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 object object CRUD operations\n app-permission appPermission CRUD operations\n org-permission orgPermission 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 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 table-template-module tableTemplateModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n relation-provision relationProvision CRUD operations\n schema-grant schemaGrant CRUD operations\n default-privilege defaultPrivilege CRUD operations\n enum enum 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 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 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 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-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 org-limit orgLimit 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 connected-account connectedAccount CRUD operations\n invite invite CRUD operations\n claimed-invite claimedInvite CRUD operations\n org-invite orgInvite CRUD operations\n org-claimed-invite orgClaimedInvite CRUD operations\n audit-log auditLog CRUD operations\n app-permission-default appPermissionDefault CRUD operations\n ref ref CRUD operations\n store store CRUD operations\n role-type roleType CRUD operations\n migrate-file migrateFile CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n membership-type membershipType CRUD operations\n app-membership-default appMembershipDefault CRUD operations\n commit commit CRUD operations\n org-membership-default orgMembershipDefault CRUD operations\n rls-module rlsModule CRUD operations\n sql-action sqlAction CRUD operations\n user user CRUD operations\n ast-migration astMigration CRUD operations\n app-membership appMembership CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n current-user-id currentUserId\n current-ip-address currentIpAddress\n current-user-agent currentUserAgent\n app-permissions-get-padded-mask appPermissionsGetPaddedMask\n org-permissions-get-padded-mask orgPermissionsGetPaddedMask\n steps-achieved stepsAchieved\n rev-parse revParse\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 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 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 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 submit-invite-code submitInviteCode\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. Five phases: (1) provision_table() for each table with all nodes[], fields[], policies[], grants, and table-level indexes/fts/unique_constraints in a single call, (2) provision_relation() for each relation, (3) provision_index() for top-level indexes, (4) provision_full_text_search() for top-level FTS, (5) provision_unique_constraint() for top-level unique constraints. Tables are identified by table_name with optional per-table schema_name. Relations use $type for relation_type with source_table/target_table. Returns the construction record ID on success, NULL on failure.\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 bootstrap-user bootstrapUser\n set-field-order setFieldOrder\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-one-time-token signInOneTimeToken\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 sign-in signIn\n sign-up signUp\n one-time-token oneTimeToken\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 send-verification-email sendVerificationEmail\n forgot-password forgotPassword\n verify-password verifyPassword\n verify-totp verifyTotp\n\n --help, -h Show this help message\n --version, -v Show version\n";
|
|
354
352
|
export const commands = async (argv, prompter, options) => {
|
|
355
353
|
if (argv.help || argv.h) {
|
|
356
354
|
console.log(usage);
|
|
@@ -91,19 +91,18 @@ export declare function getClient(contextName?: string): {
|
|
|
91
91
|
orgInvite: import("..").OrgInviteModel;
|
|
92
92
|
orgClaimedInvite: import("..").OrgClaimedInviteModel;
|
|
93
93
|
auditLog: import("..").AuditLogModel;
|
|
94
|
+
appPermissionDefault: import("..").AppPermissionDefaultModel;
|
|
94
95
|
ref: import("..").RefModel;
|
|
95
96
|
store: import("..").StoreModel;
|
|
96
|
-
appPermissionDefault: import("..").AppPermissionDefaultModel;
|
|
97
97
|
roleType: import("..").RoleTypeModel;
|
|
98
|
+
migrateFile: import("..").MigrateFileModel;
|
|
98
99
|
appLimitDefault: import("..").AppLimitDefaultModel;
|
|
99
100
|
orgLimitDefault: import("..").OrgLimitDefaultModel;
|
|
100
|
-
migrateFile: import("..").MigrateFileModel;
|
|
101
101
|
membershipType: import("..").MembershipTypeModel;
|
|
102
|
-
commit: import("..").CommitModel;
|
|
103
102
|
appMembershipDefault: import("..").AppMembershipDefaultModel;
|
|
104
|
-
|
|
105
|
-
nodeTypeRegistry: import("..").NodeTypeRegistryModel;
|
|
103
|
+
commit: import("..").CommitModel;
|
|
106
104
|
orgMembershipDefault: import("..").OrgMembershipDefaultModel;
|
|
105
|
+
rlsModule: import("..").RlsModuleModel;
|
|
107
106
|
sqlAction: import("..").SqlActionModel;
|
|
108
107
|
user: import("..").UserModel;
|
|
109
108
|
astMigration: import("..").AstMigrationModel;
|
|
@@ -90,19 +90,18 @@ import { ClaimedInviteModel } from './models/claimedInvite';
|
|
|
90
90
|
import { OrgInviteModel } from './models/orgInvite';
|
|
91
91
|
import { OrgClaimedInviteModel } from './models/orgClaimedInvite';
|
|
92
92
|
import { AuditLogModel } from './models/auditLog';
|
|
93
|
+
import { AppPermissionDefaultModel } from './models/appPermissionDefault';
|
|
93
94
|
import { RefModel } from './models/ref';
|
|
94
95
|
import { StoreModel } from './models/store';
|
|
95
|
-
import { AppPermissionDefaultModel } from './models/appPermissionDefault';
|
|
96
96
|
import { RoleTypeModel } from './models/roleType';
|
|
97
|
+
import { MigrateFileModel } from './models/migrateFile';
|
|
97
98
|
import { AppLimitDefaultModel } from './models/appLimitDefault';
|
|
98
99
|
import { OrgLimitDefaultModel } from './models/orgLimitDefault';
|
|
99
|
-
import { MigrateFileModel } from './models/migrateFile';
|
|
100
100
|
import { MembershipTypeModel } from './models/membershipType';
|
|
101
|
-
import { CommitModel } from './models/commit';
|
|
102
101
|
import { AppMembershipDefaultModel } from './models/appMembershipDefault';
|
|
103
|
-
import {
|
|
104
|
-
import { NodeTypeRegistryModel } from './models/nodeTypeRegistry';
|
|
102
|
+
import { CommitModel } from './models/commit';
|
|
105
103
|
import { OrgMembershipDefaultModel } from './models/orgMembershipDefault';
|
|
104
|
+
import { RlsModuleModel } from './models/rlsModule';
|
|
106
105
|
import { SqlActionModel } from './models/sqlAction';
|
|
107
106
|
import { UserModel } from './models/user';
|
|
108
107
|
import { AstMigrationModel } from './models/astMigration';
|
|
@@ -231,19 +230,18 @@ export declare function createClient(config: OrmClientConfig): {
|
|
|
231
230
|
orgInvite: OrgInviteModel;
|
|
232
231
|
orgClaimedInvite: OrgClaimedInviteModel;
|
|
233
232
|
auditLog: AuditLogModel;
|
|
233
|
+
appPermissionDefault: AppPermissionDefaultModel;
|
|
234
234
|
ref: RefModel;
|
|
235
235
|
store: StoreModel;
|
|
236
|
-
appPermissionDefault: AppPermissionDefaultModel;
|
|
237
236
|
roleType: RoleTypeModel;
|
|
237
|
+
migrateFile: MigrateFileModel;
|
|
238
238
|
appLimitDefault: AppLimitDefaultModel;
|
|
239
239
|
orgLimitDefault: OrgLimitDefaultModel;
|
|
240
|
-
migrateFile: MigrateFileModel;
|
|
241
240
|
membershipType: MembershipTypeModel;
|
|
242
|
-
commit: CommitModel;
|
|
243
241
|
appMembershipDefault: AppMembershipDefaultModel;
|
|
244
|
-
|
|
245
|
-
nodeTypeRegistry: NodeTypeRegistryModel;
|
|
242
|
+
commit: CommitModel;
|
|
246
243
|
orgMembershipDefault: OrgMembershipDefaultModel;
|
|
244
|
+
rlsModule: RlsModuleModel;
|
|
247
245
|
sqlAction: SqlActionModel;
|
|
248
246
|
user: UserModel;
|
|
249
247
|
astMigration: AstMigrationModel;
|
package/esm/public/orm/index.js
CHANGED
|
@@ -95,19 +95,18 @@ import { ClaimedInviteModel } from './models/claimedInvite';
|
|
|
95
95
|
import { OrgInviteModel } from './models/orgInvite';
|
|
96
96
|
import { OrgClaimedInviteModel } from './models/orgClaimedInvite';
|
|
97
97
|
import { AuditLogModel } from './models/auditLog';
|
|
98
|
+
import { AppPermissionDefaultModel } from './models/appPermissionDefault';
|
|
98
99
|
import { RefModel } from './models/ref';
|
|
99
100
|
import { StoreModel } from './models/store';
|
|
100
|
-
import { AppPermissionDefaultModel } from './models/appPermissionDefault';
|
|
101
101
|
import { RoleTypeModel } from './models/roleType';
|
|
102
|
+
import { MigrateFileModel } from './models/migrateFile';
|
|
102
103
|
import { AppLimitDefaultModel } from './models/appLimitDefault';
|
|
103
104
|
import { OrgLimitDefaultModel } from './models/orgLimitDefault';
|
|
104
|
-
import { MigrateFileModel } from './models/migrateFile';
|
|
105
105
|
import { MembershipTypeModel } from './models/membershipType';
|
|
106
|
-
import { CommitModel } from './models/commit';
|
|
107
106
|
import { AppMembershipDefaultModel } from './models/appMembershipDefault';
|
|
108
|
-
import {
|
|
109
|
-
import { NodeTypeRegistryModel } from './models/nodeTypeRegistry';
|
|
107
|
+
import { CommitModel } from './models/commit';
|
|
110
108
|
import { OrgMembershipDefaultModel } from './models/orgMembershipDefault';
|
|
109
|
+
import { RlsModuleModel } from './models/rlsModule';
|
|
111
110
|
import { SqlActionModel } from './models/sqlAction';
|
|
112
111
|
import { UserModel } from './models/user';
|
|
113
112
|
import { AstMigrationModel } from './models/astMigration';
|
|
@@ -239,19 +238,18 @@ export function createClient(config) {
|
|
|
239
238
|
orgInvite: new OrgInviteModel(client),
|
|
240
239
|
orgClaimedInvite: new OrgClaimedInviteModel(client),
|
|
241
240
|
auditLog: new AuditLogModel(client),
|
|
241
|
+
appPermissionDefault: new AppPermissionDefaultModel(client),
|
|
242
242
|
ref: new RefModel(client),
|
|
243
243
|
store: new StoreModel(client),
|
|
244
|
-
appPermissionDefault: new AppPermissionDefaultModel(client),
|
|
245
244
|
roleType: new RoleTypeModel(client),
|
|
245
|
+
migrateFile: new MigrateFileModel(client),
|
|
246
246
|
appLimitDefault: new AppLimitDefaultModel(client),
|
|
247
247
|
orgLimitDefault: new OrgLimitDefaultModel(client),
|
|
248
|
-
migrateFile: new MigrateFileModel(client),
|
|
249
248
|
membershipType: new MembershipTypeModel(client),
|
|
250
|
-
commit: new CommitModel(client),
|
|
251
249
|
appMembershipDefault: new AppMembershipDefaultModel(client),
|
|
252
|
-
|
|
253
|
-
nodeTypeRegistry: new NodeTypeRegistryModel(client),
|
|
250
|
+
commit: new CommitModel(client),
|
|
254
251
|
orgMembershipDefault: new OrgMembershipDefaultModel(client),
|
|
252
|
+
rlsModule: new RlsModuleModel(client),
|
|
255
253
|
sqlAction: new SqlActionModel(client),
|
|
256
254
|
user: new UserModel(client),
|
|
257
255
|
astMigration: new AstMigrationModel(client),
|