@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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { extractFirst } from 'inquirerer';
|
|
7
7
|
import { getClient } from '../executor';
|
|
8
|
-
import { coerceAnswers, stripUndefined } from '../utils';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
9
|
const fieldSchema = {
|
|
10
10
|
id: 'uuid',
|
|
11
11
|
name: 'string',
|
|
@@ -13,7 +13,7 @@ const fieldSchema = {
|
|
|
13
13
|
bitstr: 'string',
|
|
14
14
|
description: 'string',
|
|
15
15
|
};
|
|
16
|
-
const usage = '\napp-permission <command>\n\nCommands:\n list List
|
|
16
|
+
const usage = '\napp-permission <command>\n\nCommands:\n list List appPermission records\n find-first Find first matching appPermission record\n get Get a appPermission by ID\n create Create a new appPermission\n update Update an existing appPermission\n delete Delete a appPermission\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
|
export default async (argv, prompter, _options) => {
|
|
18
18
|
if (argv.help || argv.h) {
|
|
19
19
|
console.log(usage);
|
|
@@ -26,7 +26,7 @@ export 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', 'get', 'create', 'update', 'delete'],
|
|
29
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
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 'get':
|
|
41
43
|
return handleGet(argv, prompter);
|
|
42
44
|
case 'create':
|
|
@@ -50,20 +52,18 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
50
52
|
process.exit(1);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
|
-
async function handleList(
|
|
55
|
+
async function handleList(argv, _prompter) {
|
|
54
56
|
try {
|
|
57
|
+
const defaultSelect = {
|
|
58
|
+
id: true,
|
|
59
|
+
name: true,
|
|
60
|
+
bitnum: true,
|
|
61
|
+
bitstr: true,
|
|
62
|
+
description: true,
|
|
63
|
+
};
|
|
64
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
55
65
|
const client = getClient();
|
|
56
|
-
const result = await client.appPermission
|
|
57
|
-
.findMany({
|
|
58
|
-
select: {
|
|
59
|
-
id: true,
|
|
60
|
-
name: true,
|
|
61
|
-
bitnum: true,
|
|
62
|
-
bitstr: true,
|
|
63
|
-
description: true,
|
|
64
|
-
},
|
|
65
|
-
})
|
|
66
|
-
.execute();
|
|
66
|
+
const result = await client.appPermission.findMany(findManyArgs).execute();
|
|
67
67
|
console.log(JSON.stringify(result, null, 2));
|
|
68
68
|
}
|
|
69
69
|
catch (error) {
|
|
@@ -74,6 +74,28 @@ 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
|
+
bitnum: true,
|
|
83
|
+
bitstr: true,
|
|
84
|
+
description: true,
|
|
85
|
+
};
|
|
86
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
87
|
+
const client = getClient();
|
|
88
|
+
const result = await client.appPermission.findFirst(findFirstArgs).execute();
|
|
89
|
+
console.log(JSON.stringify(result, null, 2));
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
console.error('Failed to find record.');
|
|
93
|
+
if (error instanceof Error) {
|
|
94
|
+
console.error(error.message);
|
|
95
|
+
}
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
77
99
|
async function handleGet(argv, prompter) {
|
|
78
100
|
try {
|
|
79
101
|
const answers = await prompter.prompt(argv, [
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { extractFirst } from 'inquirerer';
|
|
7
7
|
import { getClient } from '../executor';
|
|
8
|
-
import { coerceAnswers, stripUndefined } from '../utils';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
9
|
const fieldSchema = {
|
|
10
10
|
id: 'uuid',
|
|
11
11
|
actorId: 'uuid',
|
|
@@ -14,7 +14,7 @@ const fieldSchema = {
|
|
|
14
14
|
createdAt: 'string',
|
|
15
15
|
updatedAt: 'string',
|
|
16
16
|
};
|
|
17
|
-
const usage = '\napp-step <command>\n\nCommands:\n list List
|
|
17
|
+
const usage = '\napp-step <command>\n\nCommands:\n list List appStep records\n find-first Find first matching appStep record\n get Get a appStep by ID\n create Create a new appStep\n update Update an existing appStep\n delete Delete a appStep\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
|
export default async (argv, prompter, _options) => {
|
|
19
19
|
if (argv.help || argv.h) {
|
|
20
20
|
console.log(usage);
|
|
@@ -27,7 +27,7 @@ export 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,21 +53,19 @@ 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
|
+
actorId: true,
|
|
61
|
+
name: true,
|
|
62
|
+
count: true,
|
|
63
|
+
createdAt: true,
|
|
64
|
+
updatedAt: true,
|
|
65
|
+
};
|
|
66
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
56
67
|
const client = getClient();
|
|
57
|
-
const result = await client.appStep
|
|
58
|
-
.findMany({
|
|
59
|
-
select: {
|
|
60
|
-
id: true,
|
|
61
|
-
actorId: true,
|
|
62
|
-
name: true,
|
|
63
|
-
count: true,
|
|
64
|
-
createdAt: true,
|
|
65
|
-
updatedAt: true,
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
.execute();
|
|
68
|
+
const result = await client.appStep.findMany(findManyArgs).execute();
|
|
69
69
|
console.log(JSON.stringify(result, null, 2));
|
|
70
70
|
}
|
|
71
71
|
catch (error) {
|
|
@@ -76,6 +76,29 @@ 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
|
+
actorId: true,
|
|
84
|
+
name: true,
|
|
85
|
+
count: true,
|
|
86
|
+
createdAt: true,
|
|
87
|
+
updatedAt: true,
|
|
88
|
+
};
|
|
89
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
90
|
+
const client = getClient();
|
|
91
|
+
const result = await client.appStep.findFirst(findFirstArgs).execute();
|
|
92
|
+
console.log(JSON.stringify(result, null, 2));
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error('Failed to find record.');
|
|
96
|
+
if (error instanceof Error) {
|
|
97
|
+
console.error(error.message);
|
|
98
|
+
}
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
79
102
|
async function handleGet(argv, prompter) {
|
|
80
103
|
try {
|
|
81
104
|
const answers = await prompter.prompt(argv, [
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { extractFirst } from 'inquirerer';
|
|
7
7
|
import { getClient } from '../executor';
|
|
8
|
-
import { coerceAnswers, stripUndefined } from '../utils';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
9
|
const fieldSchema = {
|
|
10
10
|
id: 'uuid',
|
|
11
11
|
data: 'json',
|
|
@@ -14,7 +14,7 @@ const fieldSchema = {
|
|
|
14
14
|
createdAt: 'string',
|
|
15
15
|
updatedAt: 'string',
|
|
16
16
|
};
|
|
17
|
-
const usage = '\nclaimed-invite <command>\n\nCommands:\n list List
|
|
17
|
+
const usage = '\nclaimed-invite <command>\n\nCommands:\n list List claimedInvite records\n find-first Find first matching claimedInvite record\n get Get a claimedInvite by ID\n create Create a new claimedInvite\n update Update an existing claimedInvite\n delete Delete a claimedInvite\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
|
export default async (argv, prompter, _options) => {
|
|
19
19
|
if (argv.help || argv.h) {
|
|
20
20
|
console.log(usage);
|
|
@@ -27,7 +27,7 @@ export 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,21 +53,19 @@ 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
|
+
data: true,
|
|
61
|
+
senderId: true,
|
|
62
|
+
receiverId: true,
|
|
63
|
+
createdAt: true,
|
|
64
|
+
updatedAt: true,
|
|
65
|
+
};
|
|
66
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
56
67
|
const client = getClient();
|
|
57
|
-
const result = await client.claimedInvite
|
|
58
|
-
.findMany({
|
|
59
|
-
select: {
|
|
60
|
-
id: true,
|
|
61
|
-
data: true,
|
|
62
|
-
senderId: true,
|
|
63
|
-
receiverId: true,
|
|
64
|
-
createdAt: true,
|
|
65
|
-
updatedAt: true,
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
.execute();
|
|
68
|
+
const result = await client.claimedInvite.findMany(findManyArgs).execute();
|
|
69
69
|
console.log(JSON.stringify(result, null, 2));
|
|
70
70
|
}
|
|
71
71
|
catch (error) {
|
|
@@ -76,6 +76,29 @@ 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
|
+
data: true,
|
|
84
|
+
senderId: true,
|
|
85
|
+
receiverId: true,
|
|
86
|
+
createdAt: true,
|
|
87
|
+
updatedAt: true,
|
|
88
|
+
};
|
|
89
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
90
|
+
const client = getClient();
|
|
91
|
+
const result = await client.claimedInvite.findFirst(findFirstArgs).execute();
|
|
92
|
+
console.log(JSON.stringify(result, null, 2));
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error('Failed to find record.');
|
|
96
|
+
if (error instanceof Error) {
|
|
97
|
+
console.error(error.message);
|
|
98
|
+
}
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
79
102
|
async function handleGet(argv, prompter) {
|
|
80
103
|
try {
|
|
81
104
|
const answers = await prompter.prompt(argv, [
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { extractFirst } from 'inquirerer';
|
|
7
7
|
import { getClient } from '../executor';
|
|
8
|
-
import { coerceAnswers, stripUndefined } from '../utils';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
9
|
const fieldSchema = {
|
|
10
10
|
id: 'uuid',
|
|
11
11
|
email: 'string',
|
|
@@ -20,7 +20,7 @@ const fieldSchema = {
|
|
|
20
20
|
createdAt: 'string',
|
|
21
21
|
updatedAt: 'string',
|
|
22
22
|
};
|
|
23
|
-
const usage = '\ninvite <command>\n\nCommands:\n list List
|
|
23
|
+
const usage = '\ninvite <command>\n\nCommands:\n list List invite records\n find-first Find first matching invite record\n get Get a invite by ID\n create Create a new invite\n update Update an existing invite\n delete Delete a invite\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';
|
|
24
24
|
export default async (argv, prompter, _options) => {
|
|
25
25
|
if (argv.help || argv.h) {
|
|
26
26
|
console.log(usage);
|
|
@@ -33,7 +33,7 @@ export default async (argv, prompter, _options) => {
|
|
|
33
33
|
type: 'autocomplete',
|
|
34
34
|
name: 'subcommand',
|
|
35
35
|
message: 'What do you want to do?',
|
|
36
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
36
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
37
37
|
},
|
|
38
38
|
]);
|
|
39
39
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -44,6 +44,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
44
44
|
switch (subcommand) {
|
|
45
45
|
case 'list':
|
|
46
46
|
return handleList(argv, prompter);
|
|
47
|
+
case 'find-first':
|
|
48
|
+
return handleFindFirst(argv, prompter);
|
|
47
49
|
case 'get':
|
|
48
50
|
return handleGet(argv, prompter);
|
|
49
51
|
case 'create':
|
|
@@ -57,27 +59,25 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
57
59
|
process.exit(1);
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
|
-
async function handleList(
|
|
62
|
+
async function handleList(argv, _prompter) {
|
|
61
63
|
try {
|
|
64
|
+
const defaultSelect = {
|
|
65
|
+
id: true,
|
|
66
|
+
email: true,
|
|
67
|
+
senderId: true,
|
|
68
|
+
inviteToken: true,
|
|
69
|
+
inviteValid: true,
|
|
70
|
+
inviteLimit: true,
|
|
71
|
+
inviteCount: true,
|
|
72
|
+
multiple: true,
|
|
73
|
+
data: true,
|
|
74
|
+
expiresAt: true,
|
|
75
|
+
createdAt: true,
|
|
76
|
+
updatedAt: true,
|
|
77
|
+
};
|
|
78
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
62
79
|
const client = getClient();
|
|
63
|
-
const result = await client.invite
|
|
64
|
-
.findMany({
|
|
65
|
-
select: {
|
|
66
|
-
id: true,
|
|
67
|
-
email: true,
|
|
68
|
-
senderId: true,
|
|
69
|
-
inviteToken: true,
|
|
70
|
-
inviteValid: true,
|
|
71
|
-
inviteLimit: true,
|
|
72
|
-
inviteCount: true,
|
|
73
|
-
multiple: true,
|
|
74
|
-
data: true,
|
|
75
|
-
expiresAt: true,
|
|
76
|
-
createdAt: true,
|
|
77
|
-
updatedAt: true,
|
|
78
|
-
},
|
|
79
|
-
})
|
|
80
|
-
.execute();
|
|
80
|
+
const result = await client.invite.findMany(findManyArgs).execute();
|
|
81
81
|
console.log(JSON.stringify(result, null, 2));
|
|
82
82
|
}
|
|
83
83
|
catch (error) {
|
|
@@ -88,6 +88,35 @@ async function handleList(_argv, _prompter) {
|
|
|
88
88
|
process.exit(1);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
async function handleFindFirst(argv, _prompter) {
|
|
92
|
+
try {
|
|
93
|
+
const defaultSelect = {
|
|
94
|
+
id: true,
|
|
95
|
+
email: true,
|
|
96
|
+
senderId: true,
|
|
97
|
+
inviteToken: true,
|
|
98
|
+
inviteValid: true,
|
|
99
|
+
inviteLimit: true,
|
|
100
|
+
inviteCount: true,
|
|
101
|
+
multiple: true,
|
|
102
|
+
data: true,
|
|
103
|
+
expiresAt: true,
|
|
104
|
+
createdAt: true,
|
|
105
|
+
updatedAt: true,
|
|
106
|
+
};
|
|
107
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
108
|
+
const client = getClient();
|
|
109
|
+
const result = await client.invite.findFirst(findFirstArgs).execute();
|
|
110
|
+
console.log(JSON.stringify(result, null, 2));
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error('Failed to find record.');
|
|
114
|
+
if (error instanceof Error) {
|
|
115
|
+
console.error(error.message);
|
|
116
|
+
}
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
91
120
|
async function handleGet(argv, prompter) {
|
|
92
121
|
try {
|
|
93
122
|
const answers = await prompter.prompt(argv, [
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { extractFirst } from 'inquirerer';
|
|
7
7
|
import { getClient } from '../executor';
|
|
8
|
-
import { coerceAnswers, stripUndefined } from '../utils';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
9
|
const fieldSchema = {
|
|
10
10
|
id: 'int',
|
|
11
11
|
name: 'string',
|
|
12
12
|
description: 'string',
|
|
13
13
|
prefix: 'string',
|
|
14
14
|
};
|
|
15
|
-
const usage = '\nmembership-type <command>\n\nCommands:\n list List
|
|
15
|
+
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';
|
|
16
16
|
export default async (argv, prompter, _options) => {
|
|
17
17
|
if (argv.help || argv.h) {
|
|
18
18
|
console.log(usage);
|
|
@@ -25,7 +25,7 @@ export default async (argv, prompter, _options) => {
|
|
|
25
25
|
type: 'autocomplete',
|
|
26
26
|
name: 'subcommand',
|
|
27
27
|
message: 'What do you want to do?',
|
|
28
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
28
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
29
29
|
},
|
|
30
30
|
]);
|
|
31
31
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -36,6 +36,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
36
36
|
switch (subcommand) {
|
|
37
37
|
case 'list':
|
|
38
38
|
return handleList(argv, prompter);
|
|
39
|
+
case 'find-first':
|
|
40
|
+
return handleFindFirst(argv, prompter);
|
|
39
41
|
case 'get':
|
|
40
42
|
return handleGet(argv, prompter);
|
|
41
43
|
case 'create':
|
|
@@ -49,19 +51,17 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
49
51
|
process.exit(1);
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
|
-
async function handleList(
|
|
54
|
+
async function handleList(argv, _prompter) {
|
|
53
55
|
try {
|
|
56
|
+
const defaultSelect = {
|
|
57
|
+
id: true,
|
|
58
|
+
name: true,
|
|
59
|
+
description: true,
|
|
60
|
+
prefix: true,
|
|
61
|
+
};
|
|
62
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
54
63
|
const client = getClient();
|
|
55
|
-
const result = await client.membershipType
|
|
56
|
-
.findMany({
|
|
57
|
-
select: {
|
|
58
|
-
id: true,
|
|
59
|
-
name: true,
|
|
60
|
-
description: true,
|
|
61
|
-
prefix: true,
|
|
62
|
-
},
|
|
63
|
-
})
|
|
64
|
-
.execute();
|
|
64
|
+
const result = await client.membershipType.findMany(findManyArgs).execute();
|
|
65
65
|
console.log(JSON.stringify(result, null, 2));
|
|
66
66
|
}
|
|
67
67
|
catch (error) {
|
|
@@ -72,6 +72,27 @@ async function handleList(_argv, _prompter) {
|
|
|
72
72
|
process.exit(1);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
+
async function handleFindFirst(argv, _prompter) {
|
|
76
|
+
try {
|
|
77
|
+
const defaultSelect = {
|
|
78
|
+
id: true,
|
|
79
|
+
name: true,
|
|
80
|
+
description: true,
|
|
81
|
+
prefix: true,
|
|
82
|
+
};
|
|
83
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
84
|
+
const client = getClient();
|
|
85
|
+
const result = await client.membershipType.findFirst(findFirstArgs).execute();
|
|
86
|
+
console.log(JSON.stringify(result, null, 2));
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.error('Failed to find record.');
|
|
90
|
+
if (error instanceof Error) {
|
|
91
|
+
console.error(error.message);
|
|
92
|
+
}
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
75
96
|
async function handleGet(argv, prompter) {
|
|
76
97
|
try {
|
|
77
98
|
const answers = await prompter.prompt(argv, [
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { extractFirst } from 'inquirerer';
|
|
7
7
|
import { getClient } from '../executor';
|
|
8
|
-
import { coerceAnswers, stripUndefined } from '../utils';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
9
|
const fieldSchema = {
|
|
10
10
|
id: 'uuid',
|
|
11
11
|
isGrant: 'boolean',
|
|
@@ -15,7 +15,7 @@ const fieldSchema = {
|
|
|
15
15
|
createdAt: 'string',
|
|
16
16
|
updatedAt: 'string',
|
|
17
17
|
};
|
|
18
|
-
const usage = '\norg-admin-grant <command>\n\nCommands:\n list List
|
|
18
|
+
const usage = '\norg-admin-grant <command>\n\nCommands:\n list List orgAdminGrant records\n find-first Find first matching orgAdminGrant record\n get Get a orgAdminGrant by ID\n create Create a new orgAdminGrant\n update Update an existing orgAdminGrant\n delete Delete a orgAdminGrant\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
|
export default async (argv, prompter, _options) => {
|
|
20
20
|
if (argv.help || argv.h) {
|
|
21
21
|
console.log(usage);
|
|
@@ -28,7 +28,7 @@ export 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,22 +54,20 @@ 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
|
+
isGrant: true,
|
|
62
|
+
actorId: true,
|
|
63
|
+
entityId: true,
|
|
64
|
+
grantorId: true,
|
|
65
|
+
createdAt: true,
|
|
66
|
+
updatedAt: true,
|
|
67
|
+
};
|
|
68
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
57
69
|
const client = getClient();
|
|
58
|
-
const result = await client.orgAdminGrant
|
|
59
|
-
.findMany({
|
|
60
|
-
select: {
|
|
61
|
-
id: true,
|
|
62
|
-
isGrant: true,
|
|
63
|
-
actorId: true,
|
|
64
|
-
entityId: true,
|
|
65
|
-
grantorId: true,
|
|
66
|
-
createdAt: true,
|
|
67
|
-
updatedAt: true,
|
|
68
|
-
},
|
|
69
|
-
})
|
|
70
|
-
.execute();
|
|
70
|
+
const result = await client.orgAdminGrant.findMany(findManyArgs).execute();
|
|
71
71
|
console.log(JSON.stringify(result, null, 2));
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
@@ -78,6 +78,30 @@ async function handleList(_argv, _prompter) {
|
|
|
78
78
|
process.exit(1);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
+
async function handleFindFirst(argv, _prompter) {
|
|
82
|
+
try {
|
|
83
|
+
const defaultSelect = {
|
|
84
|
+
id: true,
|
|
85
|
+
isGrant: true,
|
|
86
|
+
actorId: true,
|
|
87
|
+
entityId: true,
|
|
88
|
+
grantorId: true,
|
|
89
|
+
createdAt: true,
|
|
90
|
+
updatedAt: true,
|
|
91
|
+
};
|
|
92
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
93
|
+
const client = getClient();
|
|
94
|
+
const result = await client.orgAdminGrant.findFirst(findFirstArgs).execute();
|
|
95
|
+
console.log(JSON.stringify(result, null, 2));
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
console.error('Failed to find record.');
|
|
99
|
+
if (error instanceof Error) {
|
|
100
|
+
console.error(error.message);
|
|
101
|
+
}
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
81
105
|
async function handleGet(argv, prompter) {
|
|
82
106
|
try {
|
|
83
107
|
const answers = await prompter.prompt(argv, [
|