@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
|
@@ -28,7 +28,7 @@ const fieldSchema = {
|
|
|
28
28
|
entityTableId: 'uuid',
|
|
29
29
|
actorTableId: 'uuid',
|
|
30
30
|
};
|
|
31
|
-
const usage = '\nlimits-module <command>\n\nCommands:\n list List
|
|
31
|
+
const usage = '\nlimits-module <command>\n\nCommands:\n list List limitsModule records\n find-first Find first matching limitsModule record\n get Get a limitsModule by ID\n create Create a new limitsModule\n update Update an existing limitsModule\n delete Delete a limitsModule\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
|
+
defaultTableId: true,
|
|
80
|
+
defaultTableName: true,
|
|
81
|
+
limitIncrementFunction: true,
|
|
82
|
+
limitDecrementFunction: true,
|
|
83
|
+
limitIncrementTrigger: true,
|
|
84
|
+
limitDecrementTrigger: true,
|
|
85
|
+
limitUpdateTrigger: true,
|
|
86
|
+
limitCheckFunction: true,
|
|
87
|
+
prefix: true,
|
|
88
|
+
membershipType: true,
|
|
89
|
+
entityTableId: true,
|
|
90
|
+
actorTableId: true,
|
|
91
|
+
};
|
|
92
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
70
93
|
const client = (0, executor_1.getClient)();
|
|
71
|
-
const result = await client.limitsModule
|
|
72
|
-
.findMany({
|
|
73
|
-
select: {
|
|
74
|
-
id: true,
|
|
75
|
-
databaseId: true,
|
|
76
|
-
schemaId: true,
|
|
77
|
-
privateSchemaId: true,
|
|
78
|
-
tableId: true,
|
|
79
|
-
tableName: true,
|
|
80
|
-
defaultTableId: true,
|
|
81
|
-
defaultTableName: true,
|
|
82
|
-
limitIncrementFunction: true,
|
|
83
|
-
limitDecrementFunction: true,
|
|
84
|
-
limitIncrementTrigger: true,
|
|
85
|
-
limitDecrementTrigger: true,
|
|
86
|
-
limitUpdateTrigger: true,
|
|
87
|
-
limitCheckFunction: true,
|
|
88
|
-
prefix: true,
|
|
89
|
-
membershipType: true,
|
|
90
|
-
entityTableId: true,
|
|
91
|
-
actorTableId: true,
|
|
92
|
-
},
|
|
93
|
-
})
|
|
94
|
-
.execute();
|
|
94
|
+
const result = await client.limitsModule.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
|
+
defaultTableId: true,
|
|
115
|
+
defaultTableName: true,
|
|
116
|
+
limitIncrementFunction: true,
|
|
117
|
+
limitDecrementFunction: true,
|
|
118
|
+
limitIncrementTrigger: true,
|
|
119
|
+
limitDecrementTrigger: true,
|
|
120
|
+
limitUpdateTrigger: true,
|
|
121
|
+
limitCheckFunction: true,
|
|
122
|
+
prefix: true,
|
|
123
|
+
membershipType: true,
|
|
124
|
+
entityTableId: true,
|
|
125
|
+
actorTableId: true,
|
|
126
|
+
};
|
|
127
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
128
|
+
const client = (0, executor_1.getClient)();
|
|
129
|
+
const result = await client.limitsModule.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, [
|
|
@@ -14,7 +14,7 @@ const fieldSchema = {
|
|
|
14
14
|
description: 'string',
|
|
15
15
|
prefix: 'string',
|
|
16
16
|
};
|
|
17
|
-
const usage = '\nmembership-type <command>\n\nCommands:\n list List
|
|
17
|
+
const usage = '\nmembership-type <command>\n\nCommands:\n list List membershipType records\n find-first Find first matching membershipType record\n get Get a membershipType by ID\n create Create a new membershipType\n update Update an existing membershipType\n delete Delete a membershipType\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';
|
|
18
18
|
exports.default = async (argv, prompter, _options) => {
|
|
19
19
|
if (argv.help || argv.h) {
|
|
20
20
|
console.log(usage);
|
|
@@ -27,7 +27,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
27
27
|
type: 'autocomplete',
|
|
28
28
|
name: 'subcommand',
|
|
29
29
|
message: 'What do you want to do?',
|
|
30
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
30
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
31
31
|
},
|
|
32
32
|
]);
|
|
33
33
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -38,6 +38,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
38
38
|
switch (subcommand) {
|
|
39
39
|
case 'list':
|
|
40
40
|
return handleList(argv, prompter);
|
|
41
|
+
case 'find-first':
|
|
42
|
+
return handleFindFirst(argv, prompter);
|
|
41
43
|
case 'get':
|
|
42
44
|
return handleGet(argv, prompter);
|
|
43
45
|
case 'create':
|
|
@@ -51,19 +53,17 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
51
53
|
process.exit(1);
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
async function handleList(
|
|
56
|
+
async function handleList(argv, _prompter) {
|
|
55
57
|
try {
|
|
58
|
+
const defaultSelect = {
|
|
59
|
+
id: true,
|
|
60
|
+
name: true,
|
|
61
|
+
description: true,
|
|
62
|
+
prefix: true,
|
|
63
|
+
};
|
|
64
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
56
65
|
const client = (0, executor_1.getClient)();
|
|
57
|
-
const result = await client.membershipType
|
|
58
|
-
.findMany({
|
|
59
|
-
select: {
|
|
60
|
-
id: true,
|
|
61
|
-
name: true,
|
|
62
|
-
description: true,
|
|
63
|
-
prefix: true,
|
|
64
|
-
},
|
|
65
|
-
})
|
|
66
|
-
.execute();
|
|
66
|
+
const result = await client.membershipType.findMany(findManyArgs).execute();
|
|
67
67
|
console.log(JSON.stringify(result, null, 2));
|
|
68
68
|
}
|
|
69
69
|
catch (error) {
|
|
@@ -74,6 +74,27 @@ async function handleList(_argv, _prompter) {
|
|
|
74
74
|
process.exit(1);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
async function handleFindFirst(argv, _prompter) {
|
|
78
|
+
try {
|
|
79
|
+
const defaultSelect = {
|
|
80
|
+
id: true,
|
|
81
|
+
name: true,
|
|
82
|
+
description: true,
|
|
83
|
+
prefix: true,
|
|
84
|
+
};
|
|
85
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
86
|
+
const client = (0, executor_1.getClient)();
|
|
87
|
+
const result = await client.membershipType.findFirst(findFirstArgs).execute();
|
|
88
|
+
console.log(JSON.stringify(result, null, 2));
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
console.error('Failed to find record.');
|
|
92
|
+
if (error instanceof Error) {
|
|
93
|
+
console.error(error.message);
|
|
94
|
+
}
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
77
98
|
async function handleGet(argv, prompter) {
|
|
78
99
|
try {
|
|
79
100
|
const answers = await prompter.prompt(argv, [
|
|
@@ -15,7 +15,7 @@ const fieldSchema = {
|
|
|
15
15
|
tableId: 'uuid',
|
|
16
16
|
tableName: 'string',
|
|
17
17
|
};
|
|
18
|
-
const usage = '\nmembership-types-module <command>\n\nCommands:\n list List
|
|
18
|
+
const usage = '\nmembership-types-module <command>\n\nCommands:\n list List membershipTypesModule records\n find-first Find first matching membershipTypesModule record\n get Get a membershipTypesModule by ID\n create Create a new membershipTypesModule\n update Update an existing membershipTypesModule\n delete Delete a membershipTypesModule\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';
|
|
19
19
|
exports.default = async (argv, prompter, _options) => {
|
|
20
20
|
if (argv.help || argv.h) {
|
|
21
21
|
console.log(usage);
|
|
@@ -28,7 +28,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
28
28
|
type: 'autocomplete',
|
|
29
29
|
name: 'subcommand',
|
|
30
30
|
message: 'What do you want to do?',
|
|
31
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
31
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
32
32
|
},
|
|
33
33
|
]);
|
|
34
34
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -39,6 +39,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
39
39
|
switch (subcommand) {
|
|
40
40
|
case 'list':
|
|
41
41
|
return handleList(argv, prompter);
|
|
42
|
+
case 'find-first':
|
|
43
|
+
return handleFindFirst(argv, prompter);
|
|
42
44
|
case 'get':
|
|
43
45
|
return handleGet(argv, prompter);
|
|
44
46
|
case 'create':
|
|
@@ -52,20 +54,18 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
52
54
|
process.exit(1);
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
|
-
async function handleList(
|
|
57
|
+
async function handleList(argv, _prompter) {
|
|
56
58
|
try {
|
|
59
|
+
const defaultSelect = {
|
|
60
|
+
id: true,
|
|
61
|
+
databaseId: true,
|
|
62
|
+
schemaId: true,
|
|
63
|
+
tableId: true,
|
|
64
|
+
tableName: true,
|
|
65
|
+
};
|
|
66
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
57
67
|
const client = (0, executor_1.getClient)();
|
|
58
|
-
const result = await client.membershipTypesModule
|
|
59
|
-
.findMany({
|
|
60
|
-
select: {
|
|
61
|
-
id: true,
|
|
62
|
-
databaseId: true,
|
|
63
|
-
schemaId: true,
|
|
64
|
-
tableId: true,
|
|
65
|
-
tableName: true,
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
.execute();
|
|
68
|
+
const result = await client.membershipTypesModule.findMany(findManyArgs).execute();
|
|
69
69
|
console.log(JSON.stringify(result, null, 2));
|
|
70
70
|
}
|
|
71
71
|
catch (error) {
|
|
@@ -76,6 +76,28 @@ async function handleList(_argv, _prompter) {
|
|
|
76
76
|
process.exit(1);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
+
async function handleFindFirst(argv, _prompter) {
|
|
80
|
+
try {
|
|
81
|
+
const defaultSelect = {
|
|
82
|
+
id: true,
|
|
83
|
+
databaseId: true,
|
|
84
|
+
schemaId: true,
|
|
85
|
+
tableId: true,
|
|
86
|
+
tableName: true,
|
|
87
|
+
};
|
|
88
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
89
|
+
const client = (0, executor_1.getClient)();
|
|
90
|
+
const result = await client.membershipTypesModule.findFirst(findFirstArgs).execute();
|
|
91
|
+
console.log(JSON.stringify(result, null, 2));
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.error('Failed to find record.');
|
|
95
|
+
if (error instanceof Error) {
|
|
96
|
+
console.error(error.message);
|
|
97
|
+
}
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
79
101
|
async function handleGet(argv, prompter) {
|
|
80
102
|
try {
|
|
81
103
|
const answers = await prompter.prompt(argv, [
|
|
@@ -41,7 +41,7 @@ const fieldSchema = {
|
|
|
41
41
|
entityIdsByPerm: 'string',
|
|
42
42
|
entityIdsFunction: 'string',
|
|
43
43
|
};
|
|
44
|
-
const usage = '\nmemberships-module <command>\n\nCommands:\n list List
|
|
44
|
+
const usage = '\nmemberships-module <command>\n\nCommands:\n list List membershipsModule records\n find-first Find first matching membershipsModule record\n get Get a membershipsModule by ID\n create Create a new membershipsModule\n update Update an existing membershipsModule\n delete Delete a membershipsModule\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';
|
|
45
45
|
exports.default = async (argv, prompter, _options) => {
|
|
46
46
|
if (argv.help || argv.h) {
|
|
47
47
|
console.log(usage);
|
|
@@ -54,7 +54,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
54
54
|
type: 'autocomplete',
|
|
55
55
|
name: 'subcommand',
|
|
56
56
|
message: 'What do you want to do?',
|
|
57
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
57
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
58
58
|
},
|
|
59
59
|
]);
|
|
60
60
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -65,6 +65,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
65
65
|
switch (subcommand) {
|
|
66
66
|
case 'list':
|
|
67
67
|
return handleList(argv, prompter);
|
|
68
|
+
case 'find-first':
|
|
69
|
+
return handleFindFirst(argv, prompter);
|
|
68
70
|
case 'get':
|
|
69
71
|
return handleGet(argv, prompter);
|
|
70
72
|
case 'create':
|
|
@@ -78,46 +80,44 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
78
80
|
process.exit(1);
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
async function handleList(
|
|
83
|
+
async function handleList(argv, _prompter) {
|
|
82
84
|
try {
|
|
85
|
+
const defaultSelect = {
|
|
86
|
+
id: true,
|
|
87
|
+
databaseId: true,
|
|
88
|
+
schemaId: true,
|
|
89
|
+
privateSchemaId: true,
|
|
90
|
+
membershipsTableId: true,
|
|
91
|
+
membershipsTableName: true,
|
|
92
|
+
membersTableId: true,
|
|
93
|
+
membersTableName: true,
|
|
94
|
+
membershipDefaultsTableId: true,
|
|
95
|
+
membershipDefaultsTableName: true,
|
|
96
|
+
grantsTableId: true,
|
|
97
|
+
grantsTableName: true,
|
|
98
|
+
actorTableId: true,
|
|
99
|
+
limitsTableId: true,
|
|
100
|
+
defaultLimitsTableId: true,
|
|
101
|
+
permissionsTableId: true,
|
|
102
|
+
defaultPermissionsTableId: true,
|
|
103
|
+
sprtTableId: true,
|
|
104
|
+
adminGrantsTableId: true,
|
|
105
|
+
adminGrantsTableName: true,
|
|
106
|
+
ownerGrantsTableId: true,
|
|
107
|
+
ownerGrantsTableName: true,
|
|
108
|
+
membershipType: true,
|
|
109
|
+
entityTableId: true,
|
|
110
|
+
entityTableOwnerId: true,
|
|
111
|
+
prefix: true,
|
|
112
|
+
actorMaskCheck: true,
|
|
113
|
+
actorPermCheck: true,
|
|
114
|
+
entityIdsByMask: true,
|
|
115
|
+
entityIdsByPerm: true,
|
|
116
|
+
entityIdsFunction: true,
|
|
117
|
+
};
|
|
118
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
83
119
|
const client = (0, executor_1.getClient)();
|
|
84
|
-
const result = await client.membershipsModule
|
|
85
|
-
.findMany({
|
|
86
|
-
select: {
|
|
87
|
-
id: true,
|
|
88
|
-
databaseId: true,
|
|
89
|
-
schemaId: true,
|
|
90
|
-
privateSchemaId: true,
|
|
91
|
-
membershipsTableId: true,
|
|
92
|
-
membershipsTableName: true,
|
|
93
|
-
membersTableId: true,
|
|
94
|
-
membersTableName: true,
|
|
95
|
-
membershipDefaultsTableId: true,
|
|
96
|
-
membershipDefaultsTableName: true,
|
|
97
|
-
grantsTableId: true,
|
|
98
|
-
grantsTableName: true,
|
|
99
|
-
actorTableId: true,
|
|
100
|
-
limitsTableId: true,
|
|
101
|
-
defaultLimitsTableId: true,
|
|
102
|
-
permissionsTableId: true,
|
|
103
|
-
defaultPermissionsTableId: true,
|
|
104
|
-
sprtTableId: true,
|
|
105
|
-
adminGrantsTableId: true,
|
|
106
|
-
adminGrantsTableName: true,
|
|
107
|
-
ownerGrantsTableId: true,
|
|
108
|
-
ownerGrantsTableName: true,
|
|
109
|
-
membershipType: true,
|
|
110
|
-
entityTableId: true,
|
|
111
|
-
entityTableOwnerId: true,
|
|
112
|
-
prefix: true,
|
|
113
|
-
actorMaskCheck: true,
|
|
114
|
-
actorPermCheck: true,
|
|
115
|
-
entityIdsByMask: true,
|
|
116
|
-
entityIdsByPerm: true,
|
|
117
|
-
entityIdsFunction: true,
|
|
118
|
-
},
|
|
119
|
-
})
|
|
120
|
-
.execute();
|
|
120
|
+
const result = await client.membershipsModule.findMany(findManyArgs).execute();
|
|
121
121
|
console.log(JSON.stringify(result, null, 2));
|
|
122
122
|
}
|
|
123
123
|
catch (error) {
|
|
@@ -128,6 +128,54 @@ async function handleList(_argv, _prompter) {
|
|
|
128
128
|
process.exit(1);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
+
async function handleFindFirst(argv, _prompter) {
|
|
132
|
+
try {
|
|
133
|
+
const defaultSelect = {
|
|
134
|
+
id: true,
|
|
135
|
+
databaseId: true,
|
|
136
|
+
schemaId: true,
|
|
137
|
+
privateSchemaId: true,
|
|
138
|
+
membershipsTableId: true,
|
|
139
|
+
membershipsTableName: true,
|
|
140
|
+
membersTableId: true,
|
|
141
|
+
membersTableName: true,
|
|
142
|
+
membershipDefaultsTableId: true,
|
|
143
|
+
membershipDefaultsTableName: true,
|
|
144
|
+
grantsTableId: true,
|
|
145
|
+
grantsTableName: true,
|
|
146
|
+
actorTableId: true,
|
|
147
|
+
limitsTableId: true,
|
|
148
|
+
defaultLimitsTableId: true,
|
|
149
|
+
permissionsTableId: true,
|
|
150
|
+
defaultPermissionsTableId: true,
|
|
151
|
+
sprtTableId: true,
|
|
152
|
+
adminGrantsTableId: true,
|
|
153
|
+
adminGrantsTableName: true,
|
|
154
|
+
ownerGrantsTableId: true,
|
|
155
|
+
ownerGrantsTableName: true,
|
|
156
|
+
membershipType: true,
|
|
157
|
+
entityTableId: true,
|
|
158
|
+
entityTableOwnerId: true,
|
|
159
|
+
prefix: true,
|
|
160
|
+
actorMaskCheck: true,
|
|
161
|
+
actorPermCheck: true,
|
|
162
|
+
entityIdsByMask: true,
|
|
163
|
+
entityIdsByPerm: true,
|
|
164
|
+
entityIdsFunction: true,
|
|
165
|
+
};
|
|
166
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
167
|
+
const client = (0, executor_1.getClient)();
|
|
168
|
+
const result = await client.membershipsModule.findFirst(findFirstArgs).execute();
|
|
169
|
+
console.log(JSON.stringify(result, null, 2));
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
console.error('Failed to find record.');
|
|
173
|
+
if (error instanceof Error) {
|
|
174
|
+
console.error(error.message);
|
|
175
|
+
}
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
131
179
|
async function handleGet(argv, prompter) {
|
|
132
180
|
try {
|
|
133
181
|
const answers = await prompter.prompt(argv, [
|
|
@@ -13,7 +13,7 @@ const fieldSchema = {
|
|
|
13
13
|
databaseId: 'uuid',
|
|
14
14
|
upload: 'string',
|
|
15
15
|
};
|
|
16
|
-
const usage = '\nmigrate-file <command>\n\nCommands:\n list List
|
|
16
|
+
const usage = '\nmigrate-file <command>\n\nCommands:\n list List migrateFile records\n find-first Find first matching migrateFile record\n create Create a new migrateFile\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';
|
|
17
17
|
exports.default = async (argv, prompter, _options) => {
|
|
18
18
|
if (argv.help || argv.h) {
|
|
19
19
|
console.log(usage);
|
|
@@ -26,7 +26,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
26
26
|
type: 'autocomplete',
|
|
27
27
|
name: 'subcommand',
|
|
28
28
|
message: 'What do you want to do?',
|
|
29
|
-
options: ['list', 'create'],
|
|
29
|
+
options: ['list', 'find-first', 'create'],
|
|
30
30
|
},
|
|
31
31
|
]);
|
|
32
32
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -37,6 +37,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
37
37
|
switch (subcommand) {
|
|
38
38
|
case 'list':
|
|
39
39
|
return handleList(argv, prompter);
|
|
40
|
+
case 'find-first':
|
|
41
|
+
return handleFindFirst(argv, prompter);
|
|
40
42
|
case 'create':
|
|
41
43
|
return handleCreate(argv, prompter);
|
|
42
44
|
default:
|
|
@@ -44,18 +46,16 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
44
46
|
process.exit(1);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
|
-
async function handleList(
|
|
49
|
+
async function handleList(argv, _prompter) {
|
|
48
50
|
try {
|
|
51
|
+
const defaultSelect = {
|
|
52
|
+
id: true,
|
|
53
|
+
databaseId: true,
|
|
54
|
+
upload: true,
|
|
55
|
+
};
|
|
56
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
49
57
|
const client = (0, executor_1.getClient)();
|
|
50
|
-
const result = await client.migrateFile
|
|
51
|
-
.findMany({
|
|
52
|
-
select: {
|
|
53
|
-
id: true,
|
|
54
|
-
databaseId: true,
|
|
55
|
-
upload: true,
|
|
56
|
-
},
|
|
57
|
-
})
|
|
58
|
-
.execute();
|
|
58
|
+
const result = await client.migrateFile.findMany(findManyArgs).execute();
|
|
59
59
|
console.log(JSON.stringify(result, null, 2));
|
|
60
60
|
}
|
|
61
61
|
catch (error) {
|
|
@@ -66,6 +66,26 @@ async function handleList(_argv, _prompter) {
|
|
|
66
66
|
process.exit(1);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
async function handleFindFirst(argv, _prompter) {
|
|
70
|
+
try {
|
|
71
|
+
const defaultSelect = {
|
|
72
|
+
id: true,
|
|
73
|
+
databaseId: true,
|
|
74
|
+
upload: true,
|
|
75
|
+
};
|
|
76
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
77
|
+
const client = (0, executor_1.getClient)();
|
|
78
|
+
const result = await client.migrateFile.findFirst(findFirstArgs).execute();
|
|
79
|
+
console.log(JSON.stringify(result, null, 2));
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
console.error('Failed to find record.');
|
|
83
|
+
if (error instanceof Error) {
|
|
84
|
+
console.error(error.message);
|
|
85
|
+
}
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
69
89
|
async function handleCreate(argv, prompter) {
|
|
70
90
|
try {
|
|
71
91
|
const rawAnswers = await prompter.prompt(argv, [
|