@constructive-sdk/cli 0.12.3 → 0.12.5
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/esm/public/cli/commands/{field-module.d.ts → migrate-file.d.ts} +1 -1
- package/esm/public/cli/commands/migrate-file.js +110 -0
- package/{public/cli/commands/field-module.d.ts → esm/public/cli/commands/sql-action.d.ts} +1 -1
- package/esm/public/cli/commands/{sql-migration.js → sql-action.js} +4 -4
- package/esm/public/cli/commands.js +5 -5
- package/esm/public/cli/executor.d.ts +2 -2
- package/esm/public/orm/index.d.ts +4 -4
- package/esm/public/orm/index.js +4 -4
- package/esm/public/orm/input-types.d.ts +118 -247
- package/esm/public/orm/input-types.js +0 -1
- package/esm/public/orm/models/index.d.ts +2 -2
- package/esm/public/orm/models/index.js +2 -2
- package/esm/public/orm/models/migrateFile.d.ts +38 -0
- package/esm/public/orm/models/migrateFile.js +72 -0
- package/esm/public/orm/models/sqlAction.d.ts +38 -0
- package/esm/public/orm/models/{sqlMigration.js → sqlAction.js} +17 -17
- package/package.json +3 -3
- package/{esm/public/cli/commands/sql-migration.d.ts → public/cli/commands/migrate-file.d.ts} +1 -1
- package/public/cli/commands/migrate-file.js +112 -0
- package/public/cli/commands/{sql-migration.d.ts → sql-action.d.ts} +1 -1
- package/public/cli/commands/{sql-migration.js → sql-action.js} +4 -4
- package/public/cli/commands.js +5 -5
- package/public/cli/executor.d.ts +2 -2
- package/public/orm/index.d.ts +4 -4
- package/public/orm/index.js +4 -4
- package/public/orm/input-types.d.ts +118 -247
- package/public/orm/input-types.js +0 -1
- package/public/orm/models/index.d.ts +2 -2
- package/public/orm/models/index.js +7 -7
- package/public/orm/models/migrateFile.d.ts +38 -0
- package/public/orm/models/{sqlMigration.js → migrateFile.js} +19 -19
- package/public/orm/models/sqlAction.d.ts +38 -0
- package/public/orm/models/sqlAction.js +76 -0
- package/esm/public/cli/commands/field-module.js +0 -354
- package/esm/public/orm/models/fieldModule.d.ts +0 -56
- package/esm/public/orm/models/fieldModule.js +0 -96
- package/esm/public/orm/models/sqlMigration.d.ts +0 -38
- package/public/cli/commands/field-module.js +0 -356
- package/public/orm/models/fieldModule.d.ts +0 -56
- package/public/orm/models/fieldModule.js +0 -100
- package/public/orm/models/sqlMigration.d.ts +0 -38
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for MigrateFile
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { extractFirst } from 'inquirerer';
|
|
7
|
+
import { getClient } from '../executor';
|
|
8
|
+
import { coerceAnswers, stripUndefined } from '../utils';
|
|
9
|
+
const fieldSchema = {
|
|
10
|
+
id: 'uuid',
|
|
11
|
+
databaseId: 'uuid',
|
|
12
|
+
upload: 'string',
|
|
13
|
+
};
|
|
14
|
+
const usage = '\nmigrate-file <command>\n\nCommands:\n list List all migrateFile records\n create Create a new migrateFile\n\n --help, -h Show this help message\n';
|
|
15
|
+
export default async (argv, prompter, _options) => {
|
|
16
|
+
if (argv.help || argv.h) {
|
|
17
|
+
console.log(usage);
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
21
|
+
if (!subcommand) {
|
|
22
|
+
const answer = await prompter.prompt(argv, [
|
|
23
|
+
{
|
|
24
|
+
type: 'autocomplete',
|
|
25
|
+
name: 'subcommand',
|
|
26
|
+
message: 'What do you want to do?',
|
|
27
|
+
options: ['list', 'create'],
|
|
28
|
+
},
|
|
29
|
+
]);
|
|
30
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
31
|
+
}
|
|
32
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
33
|
+
};
|
|
34
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
35
|
+
switch (subcommand) {
|
|
36
|
+
case 'list':
|
|
37
|
+
return handleList(argv, prompter);
|
|
38
|
+
case 'create':
|
|
39
|
+
return handleCreate(argv, prompter);
|
|
40
|
+
default:
|
|
41
|
+
console.log(usage);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function handleList(_argv, _prompter) {
|
|
46
|
+
try {
|
|
47
|
+
const client = getClient();
|
|
48
|
+
const result = await client.migrateFile
|
|
49
|
+
.findMany({
|
|
50
|
+
select: {
|
|
51
|
+
id: true,
|
|
52
|
+
databaseId: true,
|
|
53
|
+
upload: true,
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
.execute();
|
|
57
|
+
console.log(JSON.stringify(result, null, 2));
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error('Failed to list records.');
|
|
61
|
+
if (error instanceof Error) {
|
|
62
|
+
console.error(error.message);
|
|
63
|
+
}
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function handleCreate(argv, prompter) {
|
|
68
|
+
try {
|
|
69
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
70
|
+
{
|
|
71
|
+
type: 'text',
|
|
72
|
+
name: 'databaseId',
|
|
73
|
+
message: 'databaseId',
|
|
74
|
+
required: false,
|
|
75
|
+
skipPrompt: true,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'text',
|
|
79
|
+
name: 'upload',
|
|
80
|
+
message: 'upload',
|
|
81
|
+
required: false,
|
|
82
|
+
skipPrompt: true,
|
|
83
|
+
},
|
|
84
|
+
]);
|
|
85
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
86
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
87
|
+
const client = getClient();
|
|
88
|
+
const result = await client.migrateFile
|
|
89
|
+
.create({
|
|
90
|
+
data: {
|
|
91
|
+
databaseId: cleanedData.databaseId,
|
|
92
|
+
upload: cleanedData.upload,
|
|
93
|
+
},
|
|
94
|
+
select: {
|
|
95
|
+
id: true,
|
|
96
|
+
databaseId: true,
|
|
97
|
+
upload: true,
|
|
98
|
+
},
|
|
99
|
+
})
|
|
100
|
+
.execute();
|
|
101
|
+
console.log(JSON.stringify(result, null, 2));
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
console.error('Failed to create record.');
|
|
105
|
+
if (error instanceof Error) {
|
|
106
|
+
console.error(error.message);
|
|
107
|
+
}
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CLI commands for
|
|
2
|
+
* CLI commands for SqlAction
|
|
3
3
|
* @generated by @constructive-io/graphql-codegen
|
|
4
4
|
* DO NOT EDIT - changes will be overwritten
|
|
5
5
|
*/
|
|
@@ -21,7 +21,7 @@ const fieldSchema = {
|
|
|
21
21
|
actionId: 'uuid',
|
|
22
22
|
actorId: 'uuid',
|
|
23
23
|
};
|
|
24
|
-
const usage = '\nsql-
|
|
24
|
+
const usage = '\nsql-action <command>\n\nCommands:\n list List all sqlAction records\n create Create a new sqlAction\n\n --help, -h Show this help message\n';
|
|
25
25
|
export default async (argv, prompter, _options) => {
|
|
26
26
|
if (argv.help || argv.h) {
|
|
27
27
|
console.log(usage);
|
|
@@ -55,7 +55,7 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
55
55
|
async function handleList(_argv, _prompter) {
|
|
56
56
|
try {
|
|
57
57
|
const client = getClient();
|
|
58
|
-
const result = await client.
|
|
58
|
+
const result = await client.sqlAction
|
|
59
59
|
.findMany({
|
|
60
60
|
select: {
|
|
61
61
|
id: true,
|
|
@@ -168,7 +168,7 @@ async function handleCreate(argv, prompter) {
|
|
|
168
168
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
169
169
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
170
170
|
const client = getClient();
|
|
171
|
-
const result = await client.
|
|
171
|
+
const result = await client.sqlAction
|
|
172
172
|
.create({
|
|
173
173
|
data: {
|
|
174
174
|
name: cleanedData.name,
|
|
@@ -55,7 +55,6 @@ import defaultIdsModuleCmd from './commands/default-ids-module';
|
|
|
55
55
|
import denormalizedTableFieldCmd from './commands/denormalized-table-field';
|
|
56
56
|
import emailsModuleCmd from './commands/emails-module';
|
|
57
57
|
import encryptedSecretsModuleCmd from './commands/encrypted-secrets-module';
|
|
58
|
-
import fieldModuleCmd from './commands/field-module';
|
|
59
58
|
import invitesModuleCmd from './commands/invites-module';
|
|
60
59
|
import levelsModuleCmd from './commands/levels-module';
|
|
61
60
|
import limitsModuleCmd from './commands/limits-module';
|
|
@@ -100,6 +99,7 @@ import refCmd from './commands/ref';
|
|
|
100
99
|
import storeCmd from './commands/store';
|
|
101
100
|
import appPermissionDefaultCmd from './commands/app-permission-default';
|
|
102
101
|
import roleTypeCmd from './commands/role-type';
|
|
102
|
+
import migrateFileCmd from './commands/migrate-file';
|
|
103
103
|
import appLimitDefaultCmd from './commands/app-limit-default';
|
|
104
104
|
import orgLimitDefaultCmd from './commands/org-limit-default';
|
|
105
105
|
import nodeTypeRegistryCmd from './commands/node-type-registry';
|
|
@@ -108,7 +108,7 @@ import commitCmd from './commands/commit';
|
|
|
108
108
|
import appMembershipDefaultCmd from './commands/app-membership-default';
|
|
109
109
|
import rlsModuleCmd from './commands/rls-module';
|
|
110
110
|
import orgMembershipDefaultCmd from './commands/org-membership-default';
|
|
111
|
-
import
|
|
111
|
+
import sqlActionCmd from './commands/sql-action';
|
|
112
112
|
import userCmd from './commands/user';
|
|
113
113
|
import astMigrationCmd from './commands/ast-migration';
|
|
114
114
|
import appMembershipCmd from './commands/app-membership';
|
|
@@ -220,7 +220,6 @@ const createCommandMap = () => ({
|
|
|
220
220
|
'denormalized-table-field': denormalizedTableFieldCmd,
|
|
221
221
|
'emails-module': emailsModuleCmd,
|
|
222
222
|
'encrypted-secrets-module': encryptedSecretsModuleCmd,
|
|
223
|
-
'field-module': fieldModuleCmd,
|
|
224
223
|
'invites-module': invitesModuleCmd,
|
|
225
224
|
'levels-module': levelsModuleCmd,
|
|
226
225
|
'limits-module': limitsModuleCmd,
|
|
@@ -265,6 +264,7 @@ const createCommandMap = () => ({
|
|
|
265
264
|
store: storeCmd,
|
|
266
265
|
'app-permission-default': appPermissionDefaultCmd,
|
|
267
266
|
'role-type': roleTypeCmd,
|
|
267
|
+
'migrate-file': migrateFileCmd,
|
|
268
268
|
'app-limit-default': appLimitDefaultCmd,
|
|
269
269
|
'org-limit-default': orgLimitDefaultCmd,
|
|
270
270
|
'node-type-registry': nodeTypeRegistryCmd,
|
|
@@ -273,7 +273,7 @@ const createCommandMap = () => ({
|
|
|
273
273
|
'app-membership-default': appMembershipDefaultCmd,
|
|
274
274
|
'rls-module': rlsModuleCmd,
|
|
275
275
|
'org-membership-default': orgMembershipDefaultCmd,
|
|
276
|
-
'sql-
|
|
276
|
+
'sql-action': sqlActionCmd,
|
|
277
277
|
user: userCmd,
|
|
278
278
|
'ast-migration': astMigrationCmd,
|
|
279
279
|
'app-membership': appMembershipCmd,
|
|
@@ -334,7 +334,7 @@ const createCommandMap = () => ({
|
|
|
334
334
|
'verify-password': verifyPasswordCmd,
|
|
335
335
|
'verify-totp': verifyTotpCmd,
|
|
336
336
|
});
|
|
337
|
-
const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n get-all-record getAllRecord CRUD operations\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord 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 field-module fieldModule 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 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 node-type-registry nodeTypeRegistry 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 org-membership-default orgMembershipDefault CRUD operations\n sql-migration sqlMigration 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 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 draft blueprint definition. Four phases: (1) create tables with nodes[], fields, and policies[], (2) create relations between tables, (3) create indexes on table fields (supports BTREE, HNSW, GIN, GIST, BM25, etc.), (4) create full-text search configurations with weighted multi-field TSVector support. nodes[] entries can be strings or {$type, data} objects. Relations use $type for relation_type with junction config in data. Indexes reference table_ref + column name(s) and are resolved to field_ids. Full-text searches reference table_ref + tsvector field + source fields with weights/langs. Builds a ref_map of local ref names to created table UUIDs. Updates blueprint status to constructed (or failed with error_details). Returns the ref_map.\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\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-database-with-user provisionDatabaseWithUser\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\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 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";
|
|
337
|
+
const usage = "\ncsdk <command>\n\nCommands:\n context Manage API contexts\n auth Manage authentication\n get-all-record getAllRecord CRUD operations\n org-get-managers-record orgGetManagersRecord CRUD operations\n org-get-subordinates-record orgGetSubordinatesRecord 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 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 migrate-file migrateFile CRUD operations\n app-limit-default appLimitDefault CRUD operations\n org-limit-default orgLimitDefault CRUD operations\n node-type-registry nodeTypeRegistry 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 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 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 draft blueprint definition. Four phases: (1) create tables with nodes[], fields, and policies[], (2) create relations between tables, (3) create indexes on table fields (supports BTREE, HNSW, GIN, GIST, BM25, etc.), (4) create full-text search configurations with weighted multi-field TSVector support. nodes[] entries can be strings or {$type, data} objects. Relations use $type for relation_type with junction config in data. Indexes reference table_ref + column name(s) and are resolved to field_ids. Full-text searches reference table_ref + tsvector field + source fields with weights/langs. Builds a ref_map of local ref names to created table UUIDs. Updates blueprint status to constructed (or failed with error_details). Returns the ref_map.\n reset-password resetPassword\n remove-node-at-path removeNodeAtPath\n set-data-at-path setDataAtPath\n set-props-and-commit setPropsAndCommit\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-database-with-user provisionDatabaseWithUser\n bootstrap-user bootstrapUser\n set-field-order setFieldOrder\n insert-node-at-path insertNodeAtPath\n update-node-at-path updateNodeAtPath\n set-and-commit setAndCommit\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 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";
|
|
338
338
|
export const commands = async (argv, prompter, options) => {
|
|
339
339
|
if (argv.help || argv.h) {
|
|
340
340
|
console.log(usage);
|
|
@@ -49,7 +49,6 @@ export declare function getClient(contextName?: string): {
|
|
|
49
49
|
denormalizedTableField: import("..").DenormalizedTableFieldModel;
|
|
50
50
|
emailsModule: import("..").EmailsModuleModel;
|
|
51
51
|
encryptedSecretsModule: import("..").EncryptedSecretsModuleModel;
|
|
52
|
-
fieldModule: import("..").FieldModuleModel;
|
|
53
52
|
invitesModule: import("..").InvitesModuleModel;
|
|
54
53
|
levelsModule: import("..").LevelsModuleModel;
|
|
55
54
|
limitsModule: import("..").LimitsModuleModel;
|
|
@@ -94,6 +93,7 @@ export declare function getClient(contextName?: string): {
|
|
|
94
93
|
store: import("..").StoreModel;
|
|
95
94
|
appPermissionDefault: import("..").AppPermissionDefaultModel;
|
|
96
95
|
roleType: import("..").RoleTypeModel;
|
|
96
|
+
migrateFile: import("..").MigrateFileModel;
|
|
97
97
|
appLimitDefault: import("..").AppLimitDefaultModel;
|
|
98
98
|
orgLimitDefault: import("..").OrgLimitDefaultModel;
|
|
99
99
|
nodeTypeRegistry: import("..").NodeTypeRegistryModel;
|
|
@@ -102,7 +102,7 @@ export declare function getClient(contextName?: string): {
|
|
|
102
102
|
appMembershipDefault: import("..").AppMembershipDefaultModel;
|
|
103
103
|
rlsModule: import("..").RlsModuleModel;
|
|
104
104
|
orgMembershipDefault: import("..").OrgMembershipDefaultModel;
|
|
105
|
-
|
|
105
|
+
sqlAction: import("..").SqlActionModel;
|
|
106
106
|
user: import("..").UserModel;
|
|
107
107
|
astMigration: import("..").AstMigrationModel;
|
|
108
108
|
appMembership: import("..").AppMembershipModel;
|
|
@@ -48,7 +48,6 @@ import { DefaultIdsModuleModel } from './models/defaultIdsModule';
|
|
|
48
48
|
import { DenormalizedTableFieldModel } from './models/denormalizedTableField';
|
|
49
49
|
import { EmailsModuleModel } from './models/emailsModule';
|
|
50
50
|
import { EncryptedSecretsModuleModel } from './models/encryptedSecretsModule';
|
|
51
|
-
import { FieldModuleModel } from './models/fieldModule';
|
|
52
51
|
import { InvitesModuleModel } from './models/invitesModule';
|
|
53
52
|
import { LevelsModuleModel } from './models/levelsModule';
|
|
54
53
|
import { LimitsModuleModel } from './models/limitsModule';
|
|
@@ -93,6 +92,7 @@ import { RefModel } from './models/ref';
|
|
|
93
92
|
import { StoreModel } from './models/store';
|
|
94
93
|
import { AppPermissionDefaultModel } from './models/appPermissionDefault';
|
|
95
94
|
import { RoleTypeModel } from './models/roleType';
|
|
95
|
+
import { MigrateFileModel } from './models/migrateFile';
|
|
96
96
|
import { AppLimitDefaultModel } from './models/appLimitDefault';
|
|
97
97
|
import { OrgLimitDefaultModel } from './models/orgLimitDefault';
|
|
98
98
|
import { NodeTypeRegistryModel } from './models/nodeTypeRegistry';
|
|
@@ -101,7 +101,7 @@ import { CommitModel } from './models/commit';
|
|
|
101
101
|
import { AppMembershipDefaultModel } from './models/appMembershipDefault';
|
|
102
102
|
import { RlsModuleModel } from './models/rlsModule';
|
|
103
103
|
import { OrgMembershipDefaultModel } from './models/orgMembershipDefault';
|
|
104
|
-
import {
|
|
104
|
+
import { SqlActionModel } from './models/sqlAction';
|
|
105
105
|
import { UserModel } from './models/user';
|
|
106
106
|
import { AstMigrationModel } from './models/astMigration';
|
|
107
107
|
import { AppMembershipModel } from './models/appMembership';
|
|
@@ -187,7 +187,6 @@ export declare function createClient(config: OrmClientConfig): {
|
|
|
187
187
|
denormalizedTableField: DenormalizedTableFieldModel;
|
|
188
188
|
emailsModule: EmailsModuleModel;
|
|
189
189
|
encryptedSecretsModule: EncryptedSecretsModuleModel;
|
|
190
|
-
fieldModule: FieldModuleModel;
|
|
191
190
|
invitesModule: InvitesModuleModel;
|
|
192
191
|
levelsModule: LevelsModuleModel;
|
|
193
192
|
limitsModule: LimitsModuleModel;
|
|
@@ -232,6 +231,7 @@ export declare function createClient(config: OrmClientConfig): {
|
|
|
232
231
|
store: StoreModel;
|
|
233
232
|
appPermissionDefault: AppPermissionDefaultModel;
|
|
234
233
|
roleType: RoleTypeModel;
|
|
234
|
+
migrateFile: MigrateFileModel;
|
|
235
235
|
appLimitDefault: AppLimitDefaultModel;
|
|
236
236
|
orgLimitDefault: OrgLimitDefaultModel;
|
|
237
237
|
nodeTypeRegistry: NodeTypeRegistryModel;
|
|
@@ -240,7 +240,7 @@ export declare function createClient(config: OrmClientConfig): {
|
|
|
240
240
|
appMembershipDefault: AppMembershipDefaultModel;
|
|
241
241
|
rlsModule: RlsModuleModel;
|
|
242
242
|
orgMembershipDefault: OrgMembershipDefaultModel;
|
|
243
|
-
|
|
243
|
+
sqlAction: SqlActionModel;
|
|
244
244
|
user: UserModel;
|
|
245
245
|
astMigration: AstMigrationModel;
|
|
246
246
|
appMembership: AppMembershipModel;
|
package/esm/public/orm/index.js
CHANGED
|
@@ -53,7 +53,6 @@ import { DefaultIdsModuleModel } from './models/defaultIdsModule';
|
|
|
53
53
|
import { DenormalizedTableFieldModel } from './models/denormalizedTableField';
|
|
54
54
|
import { EmailsModuleModel } from './models/emailsModule';
|
|
55
55
|
import { EncryptedSecretsModuleModel } from './models/encryptedSecretsModule';
|
|
56
|
-
import { FieldModuleModel } from './models/fieldModule';
|
|
57
56
|
import { InvitesModuleModel } from './models/invitesModule';
|
|
58
57
|
import { LevelsModuleModel } from './models/levelsModule';
|
|
59
58
|
import { LimitsModuleModel } from './models/limitsModule';
|
|
@@ -98,6 +97,7 @@ import { RefModel } from './models/ref';
|
|
|
98
97
|
import { StoreModel } from './models/store';
|
|
99
98
|
import { AppPermissionDefaultModel } from './models/appPermissionDefault';
|
|
100
99
|
import { RoleTypeModel } from './models/roleType';
|
|
100
|
+
import { MigrateFileModel } from './models/migrateFile';
|
|
101
101
|
import { AppLimitDefaultModel } from './models/appLimitDefault';
|
|
102
102
|
import { OrgLimitDefaultModel } from './models/orgLimitDefault';
|
|
103
103
|
import { NodeTypeRegistryModel } from './models/nodeTypeRegistry';
|
|
@@ -106,7 +106,7 @@ import { CommitModel } from './models/commit';
|
|
|
106
106
|
import { AppMembershipDefaultModel } from './models/appMembershipDefault';
|
|
107
107
|
import { RlsModuleModel } from './models/rlsModule';
|
|
108
108
|
import { OrgMembershipDefaultModel } from './models/orgMembershipDefault';
|
|
109
|
-
import {
|
|
109
|
+
import { SqlActionModel } from './models/sqlAction';
|
|
110
110
|
import { UserModel } from './models/user';
|
|
111
111
|
import { AstMigrationModel } from './models/astMigration';
|
|
112
112
|
import { AppMembershipModel } from './models/appMembership';
|
|
@@ -195,7 +195,6 @@ export function createClient(config) {
|
|
|
195
195
|
denormalizedTableField: new DenormalizedTableFieldModel(client),
|
|
196
196
|
emailsModule: new EmailsModuleModel(client),
|
|
197
197
|
encryptedSecretsModule: new EncryptedSecretsModuleModel(client),
|
|
198
|
-
fieldModule: new FieldModuleModel(client),
|
|
199
198
|
invitesModule: new InvitesModuleModel(client),
|
|
200
199
|
levelsModule: new LevelsModuleModel(client),
|
|
201
200
|
limitsModule: new LimitsModuleModel(client),
|
|
@@ -240,6 +239,7 @@ export function createClient(config) {
|
|
|
240
239
|
store: new StoreModel(client),
|
|
241
240
|
appPermissionDefault: new AppPermissionDefaultModel(client),
|
|
242
241
|
roleType: new RoleTypeModel(client),
|
|
242
|
+
migrateFile: new MigrateFileModel(client),
|
|
243
243
|
appLimitDefault: new AppLimitDefaultModel(client),
|
|
244
244
|
orgLimitDefault: new OrgLimitDefaultModel(client),
|
|
245
245
|
nodeTypeRegistry: new NodeTypeRegistryModel(client),
|
|
@@ -248,7 +248,7 @@ export function createClient(config) {
|
|
|
248
248
|
appMembershipDefault: new AppMembershipDefaultModel(client),
|
|
249
249
|
rlsModule: new RlsModuleModel(client),
|
|
250
250
|
orgMembershipDefault: new OrgMembershipDefaultModel(client),
|
|
251
|
-
|
|
251
|
+
sqlAction: new SqlActionModel(client),
|
|
252
252
|
user: new UserModel(client),
|
|
253
253
|
astMigration: new AstMigrationModel(client),
|
|
254
254
|
appMembership: new AppMembershipModel(client),
|