@constructive-sdk/cli 0.12.7 → 0.12.8
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/app-achievement.js +38 -15
- package/admin/cli/commands/app-admin-grant.js +38 -15
- package/admin/cli/commands/app-grant.js +40 -16
- package/admin/cli/commands/app-level-requirement.js +42 -17
- package/admin/cli/commands/app-level.js +40 -16
- package/admin/cli/commands/app-limit-default.js +32 -12
- package/admin/cli/commands/app-limit.js +36 -14
- package/admin/cli/commands/app-membership-default.js +40 -16
- package/admin/cli/commands/app-membership.js +58 -25
- package/admin/cli/commands/app-owner-grant.js +38 -15
- package/admin/cli/commands/app-permission-default.js +30 -11
- package/admin/cli/commands/app-permission.js +36 -14
- package/admin/cli/commands/app-step.js +38 -15
- package/admin/cli/commands/claimed-invite.js +38 -15
- package/admin/cli/commands/invite.js +50 -21
- package/admin/cli/commands/membership-type.js +34 -13
- package/admin/cli/commands/org-admin-grant.js +40 -16
- package/admin/cli/commands/org-chart-edge-grant.js +44 -18
- package/admin/cli/commands/org-chart-edge.js +42 -17
- package/admin/cli/commands/org-claimed-invite.js +40 -16
- package/admin/cli/commands/org-get-managers-record.js +30 -11
- package/admin/cli/commands/org-get-subordinates-record.js +30 -11
- package/admin/cli/commands/org-grant.js +42 -17
- package/admin/cli/commands/org-invite.js +54 -23
- package/admin/cli/commands/org-limit-default.js +32 -12
- package/admin/cli/commands/org-limit.js +38 -15
- package/admin/cli/commands/org-member.js +34 -13
- package/admin/cli/commands/org-membership-default.js +44 -18
- package/admin/cli/commands/org-membership.js +58 -25
- package/admin/cli/commands/org-owner-grant.js +40 -16
- package/admin/cli/commands/org-permission-default.js +32 -12
- package/admin/cli/commands/org-permission.js +36 -14
- package/admin/cli/utils.d.ts +38 -0
- package/admin/cli/utils.js +96 -0
- package/auth/cli/commands/audit-log.js +42 -17
- package/auth/cli/commands/connected-account.js +42 -17
- package/auth/cli/commands/crypto-address.js +40 -16
- package/auth/cli/commands/email.js +40 -16
- package/auth/cli/commands/phone-number.js +42 -17
- package/auth/cli/commands/role-type.js +30 -11
- package/auth/cli/commands/user.js +80 -16
- package/auth/cli/utils.d.ts +38 -0
- package/auth/cli/utils.js +96 -0
- package/esm/admin/cli/commands/app-achievement.js +39 -16
- package/esm/admin/cli/commands/app-admin-grant.js +39 -16
- package/esm/admin/cli/commands/app-grant.js +41 -17
- package/esm/admin/cli/commands/app-level-requirement.js +43 -18
- package/esm/admin/cli/commands/app-level.js +41 -17
- package/esm/admin/cli/commands/app-limit-default.js +33 -13
- package/esm/admin/cli/commands/app-limit.js +37 -15
- package/esm/admin/cli/commands/app-membership-default.js +41 -17
- package/esm/admin/cli/commands/app-membership.js +59 -26
- package/esm/admin/cli/commands/app-owner-grant.js +39 -16
- package/esm/admin/cli/commands/app-permission-default.js +31 -12
- package/esm/admin/cli/commands/app-permission.js +37 -15
- package/esm/admin/cli/commands/app-step.js +39 -16
- package/esm/admin/cli/commands/claimed-invite.js +39 -16
- package/esm/admin/cli/commands/invite.js +51 -22
- package/esm/admin/cli/commands/membership-type.js +35 -14
- package/esm/admin/cli/commands/org-admin-grant.js +41 -17
- package/esm/admin/cli/commands/org-chart-edge-grant.js +45 -19
- package/esm/admin/cli/commands/org-chart-edge.js +43 -18
- package/esm/admin/cli/commands/org-claimed-invite.js +41 -17
- package/esm/admin/cli/commands/org-get-managers-record.js +31 -12
- package/esm/admin/cli/commands/org-get-subordinates-record.js +31 -12
- package/esm/admin/cli/commands/org-grant.js +43 -18
- package/esm/admin/cli/commands/org-invite.js +55 -24
- package/esm/admin/cli/commands/org-limit-default.js +33 -13
- package/esm/admin/cli/commands/org-limit.js +39 -16
- package/esm/admin/cli/commands/org-member.js +35 -14
- package/esm/admin/cli/commands/org-membership-default.js +45 -19
- package/esm/admin/cli/commands/org-membership.js +59 -26
- package/esm/admin/cli/commands/org-owner-grant.js +41 -17
- package/esm/admin/cli/commands/org-permission-default.js +33 -13
- package/esm/admin/cli/commands/org-permission.js +37 -15
- package/esm/admin/cli/utils.d.ts +38 -0
- package/esm/admin/cli/utils.js +90 -0
- package/esm/auth/cli/commands/audit-log.js +43 -18
- package/esm/auth/cli/commands/connected-account.js +43 -18
- package/esm/auth/cli/commands/crypto-address.js +41 -17
- package/esm/auth/cli/commands/email.js +41 -17
- package/esm/auth/cli/commands/phone-number.js +43 -18
- package/esm/auth/cli/commands/role-type.js +31 -12
- package/esm/auth/cli/commands/user.js +81 -17
- package/esm/auth/cli/utils.d.ts +38 -0
- package/esm/auth/cli/utils.js +90 -0
- package/esm/objects/cli/commands/commit.js +45 -19
- package/esm/objects/cli/commands/get-all-record.js +31 -12
- package/esm/objects/cli/commands/object.js +41 -17
- package/esm/objects/cli/commands/ref.js +37 -15
- package/esm/objects/cli/commands/store.js +37 -15
- package/esm/objects/cli/utils.d.ts +38 -0
- package/esm/objects/cli/utils.js +90 -0
- package/esm/public/cli/commands/api-module.js +37 -15
- package/esm/public/cli/commands/api-schema.js +35 -14
- package/esm/public/cli/commands/api.js +41 -17
- package/esm/public/cli/commands/app-achievement.js +39 -16
- package/esm/public/cli/commands/app-admin-grant.js +39 -16
- package/esm/public/cli/commands/app-grant.js +41 -17
- package/esm/public/cli/commands/app-level-requirement.js +43 -18
- package/esm/public/cli/commands/app-level.js +41 -17
- package/esm/public/cli/commands/app-limit-default.js +33 -13
- package/esm/public/cli/commands/app-limit.js +37 -15
- package/esm/public/cli/commands/app-membership-default.js +41 -17
- package/esm/public/cli/commands/app-membership.js +59 -26
- package/esm/public/cli/commands/app-owner-grant.js +39 -16
- package/esm/public/cli/commands/app-permission-default.js +31 -12
- package/esm/public/cli/commands/app-permission.js +37 -15
- package/esm/public/cli/commands/app-step.js +39 -16
- package/esm/public/cli/commands/app.js +45 -19
- package/esm/public/cli/commands/ast-migration.js +53 -23
- package/esm/public/cli/commands/audit-log.js +43 -18
- package/esm/public/cli/commands/blueprint-template.js +67 -30
- package/esm/public/cli/commands/blueprint.js +61 -27
- package/esm/public/cli/commands/check-constraint.js +55 -24
- package/esm/public/cli/commands/claimed-invite.js +39 -16
- package/esm/public/cli/commands/commit.js +45 -19
- package/esm/public/cli/commands/connected-account.js +43 -18
- package/esm/public/cli/commands/connected-accounts-module.js +41 -17
- package/esm/public/cli/commands/crypto-address.js +41 -17
- package/esm/public/cli/commands/crypto-addresses-module.js +43 -18
- package/esm/public/cli/commands/crypto-auth-module.js +55 -24
- package/esm/public/cli/commands/database-provision-module.js +55 -24
- package/esm/public/cli/commands/database-transfer.js +55 -24
- package/esm/public/cli/commands/database.js +43 -18
- package/esm/public/cli/commands/default-ids-module.js +31 -12
- package/esm/public/cli/commands/default-privilege.js +41 -17
- package/esm/public/cli/commands/denormalized-table-field.js +51 -22
- package/esm/public/cli/commands/domain.js +39 -16
- package/esm/public/cli/commands/email.js +41 -17
- package/esm/public/cli/commands/emails-module.js +41 -17
- package/esm/public/cli/commands/embedding-chunk.js +63 -28
- package/esm/public/cli/commands/encrypted-secrets-module.js +37 -15
- package/esm/public/cli/commands/enum.js +51 -22
- package/esm/public/cli/commands/field.js +75 -34
- package/esm/public/cli/commands/foreign-key-constraint.js +63 -28
- package/esm/public/cli/commands/full-text-search.js +45 -19
- package/esm/public/cli/commands/get-all-record.js +31 -12
- package/esm/public/cli/commands/hierarchy-module.js +67 -30
- package/esm/public/cli/commands/index.js +65 -29
- package/esm/public/cli/commands/invite.js +51 -22
- package/esm/public/cli/commands/invites-module.js +55 -24
- package/esm/public/cli/commands/levels-module.js +79 -36
- package/esm/public/cli/commands/limits-module.js +63 -28
- package/esm/public/cli/commands/membership-type.js +35 -14
- package/esm/public/cli/commands/membership-types-module.js +37 -15
- package/esm/public/cli/commands/memberships-module.js +89 -41
- package/esm/public/cli/commands/migrate-file.js +33 -13
- package/esm/public/cli/commands/node-type-registry.js +89 -19
- package/esm/public/cli/commands/object.js +41 -17
- package/esm/public/cli/commands/org-admin-grant.js +41 -17
- package/esm/public/cli/commands/org-chart-edge-grant.js +45 -19
- package/esm/public/cli/commands/org-chart-edge.js +43 -18
- package/esm/public/cli/commands/org-claimed-invite.js +41 -17
- package/esm/public/cli/commands/org-get-managers-record.js +31 -12
- package/esm/public/cli/commands/org-get-subordinates-record.js +31 -12
- package/esm/public/cli/commands/org-grant.js +43 -18
- package/esm/public/cli/commands/org-invite.js +55 -24
- package/esm/public/cli/commands/org-limit-default.js +33 -13
- package/esm/public/cli/commands/org-limit.js +39 -16
- package/esm/public/cli/commands/org-member.js +35 -14
- package/esm/public/cli/commands/org-membership-default.js +45 -19
- package/esm/public/cli/commands/org-membership.js +59 -26
- package/esm/public/cli/commands/org-owner-grant.js +41 -17
- package/esm/public/cli/commands/org-permission-default.js +33 -13
- package/esm/public/cli/commands/org-permission.js +37 -15
- package/esm/public/cli/commands/permissions-module.js +61 -27
- package/esm/public/cli/commands/phone-number.js +43 -18
- package/esm/public/cli/commands/phone-numbers-module.js +41 -17
- package/esm/public/cli/commands/policy.js +61 -27
- package/esm/public/cli/commands/primary-key-constraint.js +53 -23
- package/esm/public/cli/commands/profiles-module.js +63 -28
- package/esm/public/cli/commands/ref.js +37 -15
- package/esm/public/cli/commands/relation-provision.js +89 -41
- package/esm/public/cli/commands/rls-module.js +49 -21
- package/esm/public/cli/commands/role-type.js +31 -12
- package/esm/public/cli/commands/schema-grant.js +39 -16
- package/esm/public/cli/commands/schema.js +55 -24
- package/esm/public/cli/commands/secrets-module.js +37 -15
- package/esm/public/cli/commands/secure-table-provision.js +63 -28
- package/esm/public/cli/commands/sessions-module.js +49 -21
- package/esm/public/cli/commands/site-metadatum.js +39 -16
- package/esm/public/cli/commands/site-module.js +37 -15
- package/esm/public/cli/commands/site-theme.js +35 -14
- package/esm/public/cli/commands/site.js +45 -19
- package/esm/public/cli/commands/sql-action.js +53 -23
- package/esm/public/cli/commands/store.js +37 -15
- package/esm/public/cli/commands/table-grant.js +45 -19
- package/esm/public/cli/commands/table-template-module.js +45 -19
- package/esm/public/cli/commands/table.js +65 -29
- package/esm/public/cli/commands/trigger-function.js +39 -16
- package/esm/public/cli/commands/trigger.js +53 -23
- package/esm/public/cli/commands/unique-constraint.js +55 -24
- package/esm/public/cli/commands/user-auth-module.js +79 -36
- package/esm/public/cli/commands/user.js +81 -17
- package/esm/public/cli/commands/users-module.js +41 -17
- package/esm/public/cli/commands/view-grant.js +41 -17
- package/esm/public/cli/commands/view-rule.js +39 -16
- package/esm/public/cli/commands/view-table.js +35 -14
- package/esm/public/cli/commands/view.js +59 -26
- package/esm/public/cli/commands.js +3 -3
- package/esm/public/cli/executor.d.ts +1 -1
- package/esm/public/cli/utils.d.ts +38 -0
- package/esm/public/cli/utils.js +90 -0
- package/esm/public/orm/index.d.ts +2 -2
- package/esm/public/orm/index.js +2 -2
- package/esm/public/orm/input-types.d.ts +161 -147
- package/esm/public/orm/models/index.d.ts +1 -1
- package/esm/public/orm/models/index.js +1 -1
- package/objects/cli/commands/commit.js +44 -18
- package/objects/cli/commands/get-all-record.js +30 -11
- package/objects/cli/commands/object.js +40 -16
- package/objects/cli/commands/ref.js +36 -14
- package/objects/cli/commands/store.js +36 -14
- package/objects/cli/utils.d.ts +38 -0
- package/objects/cli/utils.js +96 -0
- package/package.json +3 -3
- package/public/cli/commands/api-module.js +36 -14
- package/public/cli/commands/api-schema.js +34 -13
- package/public/cli/commands/api.js +40 -16
- package/public/cli/commands/app-achievement.js +38 -15
- package/public/cli/commands/app-admin-grant.js +38 -15
- package/public/cli/commands/app-grant.js +40 -16
- package/public/cli/commands/app-level-requirement.js +42 -17
- package/public/cli/commands/app-level.js +40 -16
- package/public/cli/commands/app-limit-default.js +32 -12
- package/public/cli/commands/app-limit.js +36 -14
- package/public/cli/commands/app-membership-default.js +40 -16
- package/public/cli/commands/app-membership.js +58 -25
- package/public/cli/commands/app-owner-grant.js +38 -15
- package/public/cli/commands/app-permission-default.js +30 -11
- package/public/cli/commands/app-permission.js +36 -14
- package/public/cli/commands/app-step.js +38 -15
- package/public/cli/commands/app.js +44 -18
- package/public/cli/commands/ast-migration.js +52 -22
- package/public/cli/commands/audit-log.js +42 -17
- package/public/cli/commands/blueprint-template.js +66 -29
- package/public/cli/commands/blueprint.js +60 -26
- package/public/cli/commands/check-constraint.js +54 -23
- package/public/cli/commands/claimed-invite.js +38 -15
- package/public/cli/commands/commit.js +44 -18
- package/public/cli/commands/connected-account.js +42 -17
- package/public/cli/commands/connected-accounts-module.js +40 -16
- package/public/cli/commands/crypto-address.js +40 -16
- package/public/cli/commands/crypto-addresses-module.js +42 -17
- package/public/cli/commands/crypto-auth-module.js +54 -23
- package/public/cli/commands/database-provision-module.js +54 -23
- package/public/cli/commands/database-transfer.js +54 -23
- package/public/cli/commands/database.js +42 -17
- package/public/cli/commands/default-ids-module.js +30 -11
- package/public/cli/commands/default-privilege.js +40 -16
- package/public/cli/commands/denormalized-table-field.js +50 -21
- package/public/cli/commands/domain.js +38 -15
- package/public/cli/commands/email.js +40 -16
- package/public/cli/commands/emails-module.js +40 -16
- package/public/cli/commands/embedding-chunk.js +62 -27
- package/public/cli/commands/encrypted-secrets-module.js +36 -14
- package/public/cli/commands/enum.js +50 -21
- package/public/cli/commands/field.js +74 -33
- package/public/cli/commands/foreign-key-constraint.js +62 -27
- package/public/cli/commands/full-text-search.js +44 -18
- package/public/cli/commands/get-all-record.js +30 -11
- package/public/cli/commands/hierarchy-module.js +66 -29
- package/public/cli/commands/index.js +64 -28
- package/public/cli/commands/invite.js +50 -21
- package/public/cli/commands/invites-module.js +54 -23
- package/public/cli/commands/levels-module.js +78 -35
- package/public/cli/commands/limits-module.js +62 -27
- package/public/cli/commands/membership-type.js +34 -13
- package/public/cli/commands/membership-types-module.js +36 -14
- package/public/cli/commands/memberships-module.js +88 -40
- package/public/cli/commands/migrate-file.js +32 -12
- package/public/cli/commands/node-type-registry.js +88 -18
- package/public/cli/commands/object.js +40 -16
- package/public/cli/commands/org-admin-grant.js +40 -16
- package/public/cli/commands/org-chart-edge-grant.js +44 -18
- package/public/cli/commands/org-chart-edge.js +42 -17
- package/public/cli/commands/org-claimed-invite.js +40 -16
- package/public/cli/commands/org-get-managers-record.js +30 -11
- package/public/cli/commands/org-get-subordinates-record.js +30 -11
- package/public/cli/commands/org-grant.js +42 -17
- package/public/cli/commands/org-invite.js +54 -23
- package/public/cli/commands/org-limit-default.js +32 -12
- package/public/cli/commands/org-limit.js +38 -15
- package/public/cli/commands/org-member.js +34 -13
- package/public/cli/commands/org-membership-default.js +44 -18
- package/public/cli/commands/org-membership.js +58 -25
- package/public/cli/commands/org-owner-grant.js +40 -16
- package/public/cli/commands/org-permission-default.js +32 -12
- package/public/cli/commands/org-permission.js +36 -14
- package/public/cli/commands/permissions-module.js +60 -26
- package/public/cli/commands/phone-number.js +42 -17
- package/public/cli/commands/phone-numbers-module.js +40 -16
- package/public/cli/commands/policy.js +60 -26
- package/public/cli/commands/primary-key-constraint.js +52 -22
- package/public/cli/commands/profiles-module.js +62 -27
- package/public/cli/commands/ref.js +36 -14
- package/public/cli/commands/relation-provision.js +88 -40
- package/public/cli/commands/rls-module.js +48 -20
- package/public/cli/commands/role-type.js +30 -11
- package/public/cli/commands/schema-grant.js +38 -15
- package/public/cli/commands/schema.js +54 -23
- package/public/cli/commands/secrets-module.js +36 -14
- package/public/cli/commands/secure-table-provision.js +62 -27
- package/public/cli/commands/sessions-module.js +48 -20
- package/public/cli/commands/site-metadatum.js +38 -15
- package/public/cli/commands/site-module.js +36 -14
- package/public/cli/commands/site-theme.js +34 -13
- package/public/cli/commands/site.js +44 -18
- package/public/cli/commands/sql-action.js +52 -22
- package/public/cli/commands/store.js +36 -14
- package/public/cli/commands/table-grant.js +44 -18
- package/public/cli/commands/table-template-module.js +44 -18
- package/public/cli/commands/table.js +64 -28
- package/public/cli/commands/trigger-function.js +38 -15
- package/public/cli/commands/trigger.js +52 -22
- package/public/cli/commands/unique-constraint.js +54 -23
- package/public/cli/commands/user-auth-module.js +78 -35
- package/public/cli/commands/user.js +80 -16
- package/public/cli/commands/users-module.js +40 -16
- package/public/cli/commands/view-grant.js +40 -16
- package/public/cli/commands/view-rule.js +38 -15
- package/public/cli/commands/view-table.js +34 -13
- package/public/cli/commands/view.js +58 -25
- package/public/cli/commands.js +3 -3
- package/public/cli/executor.d.ts +1 -1
- package/public/cli/utils.d.ts +38 -0
- package/public/cli/utils.js +96 -0
- package/public/orm/index.d.ts +2 -2
- package/public/orm/index.js +2 -2
- package/public/orm/input-types.d.ts +161 -147
- package/public/orm/models/index.d.ts +1 -1
- package/public/orm/models/index.js +4 -4
|
@@ -27,7 +27,7 @@ const fieldSchema = {
|
|
|
27
27
|
getByMask: 'string',
|
|
28
28
|
getMaskByName: 'string',
|
|
29
29
|
};
|
|
30
|
-
const usage = '\npermissions-module <command>\n\nCommands:\n list List
|
|
30
|
+
const usage = '\npermissions-module <command>\n\nCommands:\n list List permissionsModule records\n find-first Find first matching permissionsModule record\n get Get a permissionsModule by ID\n create Create a new permissionsModule\n update Update an existing permissionsModule\n delete Delete a permissionsModule\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
31
31
|
exports.default = async (argv, prompter, _options) => {
|
|
32
32
|
if (argv.help || argv.h) {
|
|
33
33
|
console.log(usage);
|
|
@@ -40,7 +40,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
40
40
|
type: 'autocomplete',
|
|
41
41
|
name: 'subcommand',
|
|
42
42
|
message: 'What do you want to do?',
|
|
43
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
43
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
44
44
|
},
|
|
45
45
|
]);
|
|
46
46
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -51,6 +51,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
51
51
|
switch (subcommand) {
|
|
52
52
|
case 'list':
|
|
53
53
|
return handleList(argv, prompter);
|
|
54
|
+
case 'find-first':
|
|
55
|
+
return handleFindFirst(argv, prompter);
|
|
54
56
|
case 'get':
|
|
55
57
|
return handleGet(argv, prompter);
|
|
56
58
|
case 'create':
|
|
@@ -64,32 +66,30 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
64
66
|
process.exit(1);
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
|
-
async function handleList(
|
|
69
|
+
async function handleList(argv, _prompter) {
|
|
68
70
|
try {
|
|
71
|
+
const defaultSelect = {
|
|
72
|
+
id: true,
|
|
73
|
+
databaseId: true,
|
|
74
|
+
schemaId: true,
|
|
75
|
+
privateSchemaId: true,
|
|
76
|
+
tableId: true,
|
|
77
|
+
tableName: true,
|
|
78
|
+
defaultTableId: true,
|
|
79
|
+
defaultTableName: true,
|
|
80
|
+
bitlen: true,
|
|
81
|
+
membershipType: true,
|
|
82
|
+
entityTableId: true,
|
|
83
|
+
actorTableId: true,
|
|
84
|
+
prefix: true,
|
|
85
|
+
getPaddedMask: true,
|
|
86
|
+
getMask: true,
|
|
87
|
+
getByMask: true,
|
|
88
|
+
getMaskByName: true,
|
|
89
|
+
};
|
|
90
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
69
91
|
const client = (0, executor_1.getClient)();
|
|
70
|
-
const result = await client.permissionsModule
|
|
71
|
-
.findMany({
|
|
72
|
-
select: {
|
|
73
|
-
id: true,
|
|
74
|
-
databaseId: true,
|
|
75
|
-
schemaId: true,
|
|
76
|
-
privateSchemaId: true,
|
|
77
|
-
tableId: true,
|
|
78
|
-
tableName: true,
|
|
79
|
-
defaultTableId: true,
|
|
80
|
-
defaultTableName: true,
|
|
81
|
-
bitlen: true,
|
|
82
|
-
membershipType: true,
|
|
83
|
-
entityTableId: true,
|
|
84
|
-
actorTableId: true,
|
|
85
|
-
prefix: true,
|
|
86
|
-
getPaddedMask: true,
|
|
87
|
-
getMask: true,
|
|
88
|
-
getByMask: true,
|
|
89
|
-
getMaskByName: true,
|
|
90
|
-
},
|
|
91
|
-
})
|
|
92
|
-
.execute();
|
|
92
|
+
const result = await client.permissionsModule.findMany(findManyArgs).execute();
|
|
93
93
|
console.log(JSON.stringify(result, null, 2));
|
|
94
94
|
}
|
|
95
95
|
catch (error) {
|
|
@@ -100,6 +100,40 @@ async function handleList(_argv, _prompter) {
|
|
|
100
100
|
process.exit(1);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
+
async function handleFindFirst(argv, _prompter) {
|
|
104
|
+
try {
|
|
105
|
+
const defaultSelect = {
|
|
106
|
+
id: true,
|
|
107
|
+
databaseId: true,
|
|
108
|
+
schemaId: true,
|
|
109
|
+
privateSchemaId: true,
|
|
110
|
+
tableId: true,
|
|
111
|
+
tableName: true,
|
|
112
|
+
defaultTableId: true,
|
|
113
|
+
defaultTableName: true,
|
|
114
|
+
bitlen: true,
|
|
115
|
+
membershipType: true,
|
|
116
|
+
entityTableId: true,
|
|
117
|
+
actorTableId: true,
|
|
118
|
+
prefix: true,
|
|
119
|
+
getPaddedMask: true,
|
|
120
|
+
getMask: true,
|
|
121
|
+
getByMask: true,
|
|
122
|
+
getMaskByName: true,
|
|
123
|
+
};
|
|
124
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
125
|
+
const client = (0, executor_1.getClient)();
|
|
126
|
+
const result = await client.permissionsModule.findFirst(findFirstArgs).execute();
|
|
127
|
+
console.log(JSON.stringify(result, null, 2));
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
console.error('Failed to find record.');
|
|
131
|
+
if (error instanceof Error) {
|
|
132
|
+
console.error(error.message);
|
|
133
|
+
}
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
103
137
|
async function handleGet(argv, prompter) {
|
|
104
138
|
try {
|
|
105
139
|
const answers = await prompter.prompt(argv, [
|
|
@@ -18,7 +18,7 @@ const fieldSchema = {
|
|
|
18
18
|
createdAt: 'string',
|
|
19
19
|
updatedAt: 'string',
|
|
20
20
|
};
|
|
21
|
-
const usage = '\nphone-number <command>\n\nCommands:\n list List
|
|
21
|
+
const usage = '\nphone-number <command>\n\nCommands:\n list List phoneNumber records\n find-first Find first matching phoneNumber record\n get Get a phoneNumber by ID\n create Create a new phoneNumber\n update Update an existing phoneNumber\n delete Delete a phoneNumber\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
22
22
|
exports.default = async (argv, prompter, _options) => {
|
|
23
23
|
if (argv.help || argv.h) {
|
|
24
24
|
console.log(usage);
|
|
@@ -31,7 +31,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
31
31
|
type: 'autocomplete',
|
|
32
32
|
name: 'subcommand',
|
|
33
33
|
message: 'What do you want to do?',
|
|
34
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
34
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
35
35
|
},
|
|
36
36
|
]);
|
|
37
37
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -42,6 +42,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
42
42
|
switch (subcommand) {
|
|
43
43
|
case 'list':
|
|
44
44
|
return handleList(argv, prompter);
|
|
45
|
+
case 'find-first':
|
|
46
|
+
return handleFindFirst(argv, prompter);
|
|
45
47
|
case 'get':
|
|
46
48
|
return handleGet(argv, prompter);
|
|
47
49
|
case 'create':
|
|
@@ -55,23 +57,21 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
55
57
|
process.exit(1);
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
|
-
async function handleList(
|
|
60
|
+
async function handleList(argv, _prompter) {
|
|
59
61
|
try {
|
|
62
|
+
const defaultSelect = {
|
|
63
|
+
id: true,
|
|
64
|
+
ownerId: true,
|
|
65
|
+
cc: true,
|
|
66
|
+
number: true,
|
|
67
|
+
isVerified: true,
|
|
68
|
+
isPrimary: true,
|
|
69
|
+
createdAt: true,
|
|
70
|
+
updatedAt: true,
|
|
71
|
+
};
|
|
72
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
60
73
|
const client = (0, executor_1.getClient)();
|
|
61
|
-
const result = await client.phoneNumber
|
|
62
|
-
.findMany({
|
|
63
|
-
select: {
|
|
64
|
-
id: true,
|
|
65
|
-
ownerId: true,
|
|
66
|
-
cc: true,
|
|
67
|
-
number: true,
|
|
68
|
-
isVerified: true,
|
|
69
|
-
isPrimary: true,
|
|
70
|
-
createdAt: true,
|
|
71
|
-
updatedAt: true,
|
|
72
|
-
},
|
|
73
|
-
})
|
|
74
|
-
.execute();
|
|
74
|
+
const result = await client.phoneNumber.findMany(findManyArgs).execute();
|
|
75
75
|
console.log(JSON.stringify(result, null, 2));
|
|
76
76
|
}
|
|
77
77
|
catch (error) {
|
|
@@ -82,6 +82,31 @@ async function handleList(_argv, _prompter) {
|
|
|
82
82
|
process.exit(1);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
async function handleFindFirst(argv, _prompter) {
|
|
86
|
+
try {
|
|
87
|
+
const defaultSelect = {
|
|
88
|
+
id: true,
|
|
89
|
+
ownerId: true,
|
|
90
|
+
cc: true,
|
|
91
|
+
number: true,
|
|
92
|
+
isVerified: true,
|
|
93
|
+
isPrimary: true,
|
|
94
|
+
createdAt: true,
|
|
95
|
+
updatedAt: true,
|
|
96
|
+
};
|
|
97
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
98
|
+
const client = (0, executor_1.getClient)();
|
|
99
|
+
const result = await client.phoneNumber.findFirst(findFirstArgs).execute();
|
|
100
|
+
console.log(JSON.stringify(result, null, 2));
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
console.error('Failed to find record.');
|
|
104
|
+
if (error instanceof Error) {
|
|
105
|
+
console.error(error.message);
|
|
106
|
+
}
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
85
110
|
async function handleGet(argv, prompter) {
|
|
86
111
|
try {
|
|
87
112
|
const answers = await prompter.prompt(argv, [
|
|
@@ -17,7 +17,7 @@ const fieldSchema = {
|
|
|
17
17
|
ownerTableId: 'uuid',
|
|
18
18
|
tableName: 'string',
|
|
19
19
|
};
|
|
20
|
-
const usage = '\nphone-numbers-module <command>\n\nCommands:\n list List
|
|
20
|
+
const usage = '\nphone-numbers-module <command>\n\nCommands:\n list List phoneNumbersModule records\n find-first Find first matching phoneNumbersModule record\n get Get a phoneNumbersModule by ID\n create Create a new phoneNumbersModule\n update Update an existing phoneNumbersModule\n delete Delete a phoneNumbersModule\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
21
21
|
exports.default = async (argv, prompter, _options) => {
|
|
22
22
|
if (argv.help || argv.h) {
|
|
23
23
|
console.log(usage);
|
|
@@ -30,7 +30,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
30
30
|
type: 'autocomplete',
|
|
31
31
|
name: 'subcommand',
|
|
32
32
|
message: 'What do you want to do?',
|
|
33
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
33
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
34
34
|
},
|
|
35
35
|
]);
|
|
36
36
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -41,6 +41,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
41
41
|
switch (subcommand) {
|
|
42
42
|
case 'list':
|
|
43
43
|
return handleList(argv, prompter);
|
|
44
|
+
case 'find-first':
|
|
45
|
+
return handleFindFirst(argv, prompter);
|
|
44
46
|
case 'get':
|
|
45
47
|
return handleGet(argv, prompter);
|
|
46
48
|
case 'create':
|
|
@@ -54,22 +56,20 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
54
56
|
process.exit(1);
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
|
-
async function handleList(
|
|
59
|
+
async function handleList(argv, _prompter) {
|
|
58
60
|
try {
|
|
61
|
+
const defaultSelect = {
|
|
62
|
+
id: true,
|
|
63
|
+
databaseId: true,
|
|
64
|
+
schemaId: true,
|
|
65
|
+
privateSchemaId: true,
|
|
66
|
+
tableId: true,
|
|
67
|
+
ownerTableId: true,
|
|
68
|
+
tableName: true,
|
|
69
|
+
};
|
|
70
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
59
71
|
const client = (0, executor_1.getClient)();
|
|
60
|
-
const result = await client.phoneNumbersModule
|
|
61
|
-
.findMany({
|
|
62
|
-
select: {
|
|
63
|
-
id: true,
|
|
64
|
-
databaseId: true,
|
|
65
|
-
schemaId: true,
|
|
66
|
-
privateSchemaId: true,
|
|
67
|
-
tableId: true,
|
|
68
|
-
ownerTableId: true,
|
|
69
|
-
tableName: true,
|
|
70
|
-
},
|
|
71
|
-
})
|
|
72
|
-
.execute();
|
|
72
|
+
const result = await client.phoneNumbersModule.findMany(findManyArgs).execute();
|
|
73
73
|
console.log(JSON.stringify(result, null, 2));
|
|
74
74
|
}
|
|
75
75
|
catch (error) {
|
|
@@ -80,6 +80,30 @@ async function handleList(_argv, _prompter) {
|
|
|
80
80
|
process.exit(1);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
+
async function handleFindFirst(argv, _prompter) {
|
|
84
|
+
try {
|
|
85
|
+
const defaultSelect = {
|
|
86
|
+
id: true,
|
|
87
|
+
databaseId: true,
|
|
88
|
+
schemaId: true,
|
|
89
|
+
privateSchemaId: true,
|
|
90
|
+
tableId: true,
|
|
91
|
+
ownerTableId: true,
|
|
92
|
+
tableName: true,
|
|
93
|
+
};
|
|
94
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
95
|
+
const client = (0, executor_1.getClient)();
|
|
96
|
+
const result = await client.phoneNumbersModule.findFirst(findFirstArgs).execute();
|
|
97
|
+
console.log(JSON.stringify(result, null, 2));
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
console.error('Failed to find record.');
|
|
101
|
+
if (error instanceof Error) {
|
|
102
|
+
console.error(error.message);
|
|
103
|
+
}
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
83
107
|
async function handleGet(argv, prompter) {
|
|
84
108
|
try {
|
|
85
109
|
const answers = await prompter.prompt(argv, [
|
|
@@ -27,7 +27,7 @@ const fieldSchema = {
|
|
|
27
27
|
createdAt: 'string',
|
|
28
28
|
updatedAt: 'string',
|
|
29
29
|
};
|
|
30
|
-
const usage = '\npolicy <command>\n\nCommands:\n list List
|
|
30
|
+
const usage = '\npolicy <command>\n\nCommands:\n list List policy records\n find-first Find first matching policy record\n get Get a policy by ID\n create Create a new policy\n update Update an existing policy\n delete Delete a policy\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
31
31
|
exports.default = async (argv, prompter, _options) => {
|
|
32
32
|
if (argv.help || argv.h) {
|
|
33
33
|
console.log(usage);
|
|
@@ -40,7 +40,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
40
40
|
type: 'autocomplete',
|
|
41
41
|
name: 'subcommand',
|
|
42
42
|
message: 'What do you want to do?',
|
|
43
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
43
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
44
44
|
},
|
|
45
45
|
]);
|
|
46
46
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -51,6 +51,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
51
51
|
switch (subcommand) {
|
|
52
52
|
case 'list':
|
|
53
53
|
return handleList(argv, prompter);
|
|
54
|
+
case 'find-first':
|
|
55
|
+
return handleFindFirst(argv, prompter);
|
|
54
56
|
case 'get':
|
|
55
57
|
return handleGet(argv, prompter);
|
|
56
58
|
case 'create':
|
|
@@ -64,32 +66,30 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
64
66
|
process.exit(1);
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
|
-
async function handleList(
|
|
69
|
+
async function handleList(argv, _prompter) {
|
|
68
70
|
try {
|
|
71
|
+
const defaultSelect = {
|
|
72
|
+
id: true,
|
|
73
|
+
databaseId: true,
|
|
74
|
+
tableId: true,
|
|
75
|
+
name: true,
|
|
76
|
+
granteeName: true,
|
|
77
|
+
privilege: true,
|
|
78
|
+
permissive: true,
|
|
79
|
+
disabled: true,
|
|
80
|
+
policyType: true,
|
|
81
|
+
data: true,
|
|
82
|
+
smartTags: true,
|
|
83
|
+
category: true,
|
|
84
|
+
module: true,
|
|
85
|
+
scope: true,
|
|
86
|
+
tags: true,
|
|
87
|
+
createdAt: true,
|
|
88
|
+
updatedAt: true,
|
|
89
|
+
};
|
|
90
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
69
91
|
const client = (0, executor_1.getClient)();
|
|
70
|
-
const result = await client.policy
|
|
71
|
-
.findMany({
|
|
72
|
-
select: {
|
|
73
|
-
id: true,
|
|
74
|
-
databaseId: true,
|
|
75
|
-
tableId: true,
|
|
76
|
-
name: true,
|
|
77
|
-
granteeName: true,
|
|
78
|
-
privilege: true,
|
|
79
|
-
permissive: true,
|
|
80
|
-
disabled: true,
|
|
81
|
-
policyType: true,
|
|
82
|
-
data: true,
|
|
83
|
-
smartTags: true,
|
|
84
|
-
category: true,
|
|
85
|
-
module: true,
|
|
86
|
-
scope: true,
|
|
87
|
-
tags: true,
|
|
88
|
-
createdAt: true,
|
|
89
|
-
updatedAt: true,
|
|
90
|
-
},
|
|
91
|
-
})
|
|
92
|
-
.execute();
|
|
92
|
+
const result = await client.policy.findMany(findManyArgs).execute();
|
|
93
93
|
console.log(JSON.stringify(result, null, 2));
|
|
94
94
|
}
|
|
95
95
|
catch (error) {
|
|
@@ -100,6 +100,40 @@ async function handleList(_argv, _prompter) {
|
|
|
100
100
|
process.exit(1);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
+
async function handleFindFirst(argv, _prompter) {
|
|
104
|
+
try {
|
|
105
|
+
const defaultSelect = {
|
|
106
|
+
id: true,
|
|
107
|
+
databaseId: true,
|
|
108
|
+
tableId: true,
|
|
109
|
+
name: true,
|
|
110
|
+
granteeName: true,
|
|
111
|
+
privilege: true,
|
|
112
|
+
permissive: true,
|
|
113
|
+
disabled: true,
|
|
114
|
+
policyType: true,
|
|
115
|
+
data: true,
|
|
116
|
+
smartTags: true,
|
|
117
|
+
category: true,
|
|
118
|
+
module: true,
|
|
119
|
+
scope: true,
|
|
120
|
+
tags: true,
|
|
121
|
+
createdAt: true,
|
|
122
|
+
updatedAt: true,
|
|
123
|
+
};
|
|
124
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
125
|
+
const client = (0, executor_1.getClient)();
|
|
126
|
+
const result = await client.policy.findFirst(findFirstArgs).execute();
|
|
127
|
+
console.log(JSON.stringify(result, null, 2));
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
console.error('Failed to find record.');
|
|
131
|
+
if (error instanceof Error) {
|
|
132
|
+
console.error(error.message);
|
|
133
|
+
}
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
103
137
|
async function handleGet(argv, prompter) {
|
|
104
138
|
try {
|
|
105
139
|
const answers = await prompter.prompt(argv, [
|
|
@@ -23,7 +23,7 @@ const fieldSchema = {
|
|
|
23
23
|
createdAt: 'string',
|
|
24
24
|
updatedAt: 'string',
|
|
25
25
|
};
|
|
26
|
-
const usage = '\nprimary-key-constraint <command>\n\nCommands:\n list List
|
|
26
|
+
const usage = '\nprimary-key-constraint <command>\n\nCommands:\n list List primaryKeyConstraint records\n find-first Find first matching primaryKeyConstraint record\n get Get a primaryKeyConstraint by ID\n create Create a new primaryKeyConstraint\n update Update an existing primaryKeyConstraint\n delete Delete a primaryKeyConstraint\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
27
27
|
exports.default = async (argv, prompter, _options) => {
|
|
28
28
|
if (argv.help || argv.h) {
|
|
29
29
|
console.log(usage);
|
|
@@ -36,7 +36,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
36
36
|
type: 'autocomplete',
|
|
37
37
|
name: 'subcommand',
|
|
38
38
|
message: 'What do you want to do?',
|
|
39
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
39
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
40
40
|
},
|
|
41
41
|
]);
|
|
42
42
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -47,6 +47,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
47
47
|
switch (subcommand) {
|
|
48
48
|
case 'list':
|
|
49
49
|
return handleList(argv, prompter);
|
|
50
|
+
case 'find-first':
|
|
51
|
+
return handleFindFirst(argv, prompter);
|
|
50
52
|
case 'get':
|
|
51
53
|
return handleGet(argv, prompter);
|
|
52
54
|
case 'create':
|
|
@@ -60,28 +62,26 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
60
62
|
process.exit(1);
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
|
-
async function handleList(
|
|
65
|
+
async function handleList(argv, _prompter) {
|
|
64
66
|
try {
|
|
67
|
+
const defaultSelect = {
|
|
68
|
+
id: true,
|
|
69
|
+
databaseId: true,
|
|
70
|
+
tableId: true,
|
|
71
|
+
name: true,
|
|
72
|
+
type: true,
|
|
73
|
+
fieldIds: true,
|
|
74
|
+
smartTags: true,
|
|
75
|
+
category: true,
|
|
76
|
+
module: true,
|
|
77
|
+
scope: true,
|
|
78
|
+
tags: true,
|
|
79
|
+
createdAt: true,
|
|
80
|
+
updatedAt: true,
|
|
81
|
+
};
|
|
82
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
65
83
|
const client = (0, executor_1.getClient)();
|
|
66
|
-
const result = await client.primaryKeyConstraint
|
|
67
|
-
.findMany({
|
|
68
|
-
select: {
|
|
69
|
-
id: true,
|
|
70
|
-
databaseId: true,
|
|
71
|
-
tableId: true,
|
|
72
|
-
name: true,
|
|
73
|
-
type: true,
|
|
74
|
-
fieldIds: true,
|
|
75
|
-
smartTags: true,
|
|
76
|
-
category: true,
|
|
77
|
-
module: true,
|
|
78
|
-
scope: true,
|
|
79
|
-
tags: true,
|
|
80
|
-
createdAt: true,
|
|
81
|
-
updatedAt: true,
|
|
82
|
-
},
|
|
83
|
-
})
|
|
84
|
-
.execute();
|
|
84
|
+
const result = await client.primaryKeyConstraint.findMany(findManyArgs).execute();
|
|
85
85
|
console.log(JSON.stringify(result, null, 2));
|
|
86
86
|
}
|
|
87
87
|
catch (error) {
|
|
@@ -92,6 +92,36 @@ async function handleList(_argv, _prompter) {
|
|
|
92
92
|
process.exit(1);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
+
async function handleFindFirst(argv, _prompter) {
|
|
96
|
+
try {
|
|
97
|
+
const defaultSelect = {
|
|
98
|
+
id: true,
|
|
99
|
+
databaseId: true,
|
|
100
|
+
tableId: true,
|
|
101
|
+
name: true,
|
|
102
|
+
type: true,
|
|
103
|
+
fieldIds: true,
|
|
104
|
+
smartTags: true,
|
|
105
|
+
category: true,
|
|
106
|
+
module: true,
|
|
107
|
+
scope: true,
|
|
108
|
+
tags: true,
|
|
109
|
+
createdAt: true,
|
|
110
|
+
updatedAt: true,
|
|
111
|
+
};
|
|
112
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
113
|
+
const client = (0, executor_1.getClient)();
|
|
114
|
+
const result = await client.primaryKeyConstraint.findFirst(findFirstArgs).execute();
|
|
115
|
+
console.log(JSON.stringify(result, null, 2));
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
console.error('Failed to find record.');
|
|
119
|
+
if (error instanceof Error) {
|
|
120
|
+
console.error(error.message);
|
|
121
|
+
}
|
|
122
|
+
process.exit(1);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
95
125
|
async function handleGet(argv, prompter) {
|
|
96
126
|
try {
|
|
97
127
|
const answers = await prompter.prompt(argv, [
|
|
@@ -28,7 +28,7 @@ const fieldSchema = {
|
|
|
28
28
|
membershipsTableId: 'uuid',
|
|
29
29
|
prefix: 'string',
|
|
30
30
|
};
|
|
31
|
-
const usage = '\nprofiles-module <command>\n\nCommands:\n list List
|
|
31
|
+
const usage = '\nprofiles-module <command>\n\nCommands:\n list List profilesModule records\n find-first Find first matching profilesModule record\n get Get a profilesModule by ID\n create Create a new profilesModule\n update Update an existing profilesModule\n delete Delete a profilesModule\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
32
32
|
exports.default = async (argv, prompter, _options) => {
|
|
33
33
|
if (argv.help || argv.h) {
|
|
34
34
|
console.log(usage);
|
|
@@ -41,7 +41,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
41
41
|
type: 'autocomplete',
|
|
42
42
|
name: 'subcommand',
|
|
43
43
|
message: 'What do you want to do?',
|
|
44
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
44
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
45
45
|
},
|
|
46
46
|
]);
|
|
47
47
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -52,6 +52,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
52
52
|
switch (subcommand) {
|
|
53
53
|
case 'list':
|
|
54
54
|
return handleList(argv, prompter);
|
|
55
|
+
case 'find-first':
|
|
56
|
+
return handleFindFirst(argv, prompter);
|
|
55
57
|
case 'get':
|
|
56
58
|
return handleGet(argv, prompter);
|
|
57
59
|
case 'create':
|
|
@@ -65,33 +67,31 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
65
67
|
process.exit(1);
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
|
-
async function handleList(
|
|
70
|
+
async function handleList(argv, _prompter) {
|
|
69
71
|
try {
|
|
72
|
+
const defaultSelect = {
|
|
73
|
+
id: true,
|
|
74
|
+
databaseId: true,
|
|
75
|
+
schemaId: true,
|
|
76
|
+
privateSchemaId: true,
|
|
77
|
+
tableId: true,
|
|
78
|
+
tableName: true,
|
|
79
|
+
profilePermissionsTableId: true,
|
|
80
|
+
profilePermissionsTableName: true,
|
|
81
|
+
profileGrantsTableId: true,
|
|
82
|
+
profileGrantsTableName: true,
|
|
83
|
+
profileDefinitionGrantsTableId: true,
|
|
84
|
+
profileDefinitionGrantsTableName: true,
|
|
85
|
+
membershipType: true,
|
|
86
|
+
entityTableId: true,
|
|
87
|
+
actorTableId: true,
|
|
88
|
+
permissionsTableId: true,
|
|
89
|
+
membershipsTableId: true,
|
|
90
|
+
prefix: true,
|
|
91
|
+
};
|
|
92
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
70
93
|
const client = (0, executor_1.getClient)();
|
|
71
|
-
const result = await client.profilesModule
|
|
72
|
-
.findMany({
|
|
73
|
-
select: {
|
|
74
|
-
id: true,
|
|
75
|
-
databaseId: true,
|
|
76
|
-
schemaId: true,
|
|
77
|
-
privateSchemaId: true,
|
|
78
|
-
tableId: true,
|
|
79
|
-
tableName: true,
|
|
80
|
-
profilePermissionsTableId: true,
|
|
81
|
-
profilePermissionsTableName: true,
|
|
82
|
-
profileGrantsTableId: true,
|
|
83
|
-
profileGrantsTableName: true,
|
|
84
|
-
profileDefinitionGrantsTableId: true,
|
|
85
|
-
profileDefinitionGrantsTableName: true,
|
|
86
|
-
membershipType: true,
|
|
87
|
-
entityTableId: true,
|
|
88
|
-
actorTableId: true,
|
|
89
|
-
permissionsTableId: true,
|
|
90
|
-
membershipsTableId: true,
|
|
91
|
-
prefix: true,
|
|
92
|
-
},
|
|
93
|
-
})
|
|
94
|
-
.execute();
|
|
94
|
+
const result = await client.profilesModule.findMany(findManyArgs).execute();
|
|
95
95
|
console.log(JSON.stringify(result, null, 2));
|
|
96
96
|
}
|
|
97
97
|
catch (error) {
|
|
@@ -102,6 +102,41 @@ async function handleList(_argv, _prompter) {
|
|
|
102
102
|
process.exit(1);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
+
async function handleFindFirst(argv, _prompter) {
|
|
106
|
+
try {
|
|
107
|
+
const defaultSelect = {
|
|
108
|
+
id: true,
|
|
109
|
+
databaseId: true,
|
|
110
|
+
schemaId: true,
|
|
111
|
+
privateSchemaId: true,
|
|
112
|
+
tableId: true,
|
|
113
|
+
tableName: true,
|
|
114
|
+
profilePermissionsTableId: true,
|
|
115
|
+
profilePermissionsTableName: true,
|
|
116
|
+
profileGrantsTableId: true,
|
|
117
|
+
profileGrantsTableName: true,
|
|
118
|
+
profileDefinitionGrantsTableId: true,
|
|
119
|
+
profileDefinitionGrantsTableName: true,
|
|
120
|
+
membershipType: true,
|
|
121
|
+
entityTableId: true,
|
|
122
|
+
actorTableId: true,
|
|
123
|
+
permissionsTableId: true,
|
|
124
|
+
membershipsTableId: true,
|
|
125
|
+
prefix: true,
|
|
126
|
+
};
|
|
127
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
128
|
+
const client = (0, executor_1.getClient)();
|
|
129
|
+
const result = await client.profilesModule.findFirst(findFirstArgs).execute();
|
|
130
|
+
console.log(JSON.stringify(result, null, 2));
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
console.error('Failed to find record.');
|
|
134
|
+
if (error instanceof Error) {
|
|
135
|
+
console.error(error.message);
|
|
136
|
+
}
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
105
140
|
async function handleGet(argv, prompter) {
|
|
106
141
|
try {
|
|
107
142
|
const answers = await prompter.prompt(argv, [
|