@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
|
@@ -15,7 +15,7 @@ const fieldSchema = {
|
|
|
15
15
|
num: 'int',
|
|
16
16
|
max: 'int',
|
|
17
17
|
};
|
|
18
|
-
const usage = '\napp-limit <command>\n\nCommands:\n list List
|
|
18
|
+
const usage = '\napp-limit <command>\n\nCommands:\n list List appLimit records\n find-first Find first matching appLimit record\n get Get a appLimit by ID\n create Create a new appLimit\n update Update an existing appLimit\n delete Delete a appLimit\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
|
+
name: true,
|
|
62
|
+
actorId: true,
|
|
63
|
+
num: true,
|
|
64
|
+
max: true,
|
|
65
|
+
};
|
|
66
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
57
67
|
const client = (0, executor_1.getClient)();
|
|
58
|
-
const result = await client.appLimit
|
|
59
|
-
.findMany({
|
|
60
|
-
select: {
|
|
61
|
-
id: true,
|
|
62
|
-
name: true,
|
|
63
|
-
actorId: true,
|
|
64
|
-
num: true,
|
|
65
|
-
max: true,
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
.execute();
|
|
68
|
+
const result = await client.appLimit.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
|
+
name: true,
|
|
84
|
+
actorId: true,
|
|
85
|
+
num: true,
|
|
86
|
+
max: true,
|
|
87
|
+
};
|
|
88
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
89
|
+
const client = (0, executor_1.getClient)();
|
|
90
|
+
const result = await client.appLimit.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, [
|
|
@@ -17,7 +17,7 @@ const fieldSchema = {
|
|
|
17
17
|
isApproved: 'boolean',
|
|
18
18
|
isVerified: 'boolean',
|
|
19
19
|
};
|
|
20
|
-
const usage = '\napp-membership-default <command>\n\nCommands:\n list List
|
|
20
|
+
const usage = '\napp-membership-default <command>\n\nCommands:\n list List appMembershipDefault records\n find-first Find first matching appMembershipDefault record\n get Get a appMembershipDefault by ID\n create Create a new appMembershipDefault\n update Update an existing appMembershipDefault\n delete Delete a appMembershipDefault\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
21
21
|
exports.default = async (argv, prompter, _options) => {
|
|
22
22
|
if (argv.help || argv.h) {
|
|
23
23
|
console.log(usage);
|
|
@@ -30,7 +30,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
30
30
|
type: 'autocomplete',
|
|
31
31
|
name: 'subcommand',
|
|
32
32
|
message: 'What do you want to do?',
|
|
33
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
33
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
34
34
|
},
|
|
35
35
|
]);
|
|
36
36
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -41,6 +41,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
41
41
|
switch (subcommand) {
|
|
42
42
|
case 'list':
|
|
43
43
|
return handleList(argv, prompter);
|
|
44
|
+
case 'find-first':
|
|
45
|
+
return handleFindFirst(argv, prompter);
|
|
44
46
|
case 'get':
|
|
45
47
|
return handleGet(argv, prompter);
|
|
46
48
|
case 'create':
|
|
@@ -54,22 +56,20 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
54
56
|
process.exit(1);
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
|
-
async function handleList(
|
|
59
|
+
async function handleList(argv, _prompter) {
|
|
58
60
|
try {
|
|
61
|
+
const defaultSelect = {
|
|
62
|
+
id: true,
|
|
63
|
+
createdAt: true,
|
|
64
|
+
updatedAt: true,
|
|
65
|
+
createdBy: true,
|
|
66
|
+
updatedBy: true,
|
|
67
|
+
isApproved: true,
|
|
68
|
+
isVerified: true,
|
|
69
|
+
};
|
|
70
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
59
71
|
const client = (0, executor_1.getClient)();
|
|
60
|
-
const result = await client.appMembershipDefault
|
|
61
|
-
.findMany({
|
|
62
|
-
select: {
|
|
63
|
-
id: true,
|
|
64
|
-
createdAt: true,
|
|
65
|
-
updatedAt: true,
|
|
66
|
-
createdBy: true,
|
|
67
|
-
updatedBy: true,
|
|
68
|
-
isApproved: true,
|
|
69
|
-
isVerified: true,
|
|
70
|
-
},
|
|
71
|
-
})
|
|
72
|
-
.execute();
|
|
72
|
+
const result = await client.appMembershipDefault.findMany(findManyArgs).execute();
|
|
73
73
|
console.log(JSON.stringify(result, null, 2));
|
|
74
74
|
}
|
|
75
75
|
catch (error) {
|
|
@@ -80,6 +80,30 @@ async function handleList(_argv, _prompter) {
|
|
|
80
80
|
process.exit(1);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
+
async function handleFindFirst(argv, _prompter) {
|
|
84
|
+
try {
|
|
85
|
+
const defaultSelect = {
|
|
86
|
+
id: true,
|
|
87
|
+
createdAt: true,
|
|
88
|
+
updatedAt: true,
|
|
89
|
+
createdBy: true,
|
|
90
|
+
updatedBy: true,
|
|
91
|
+
isApproved: true,
|
|
92
|
+
isVerified: true,
|
|
93
|
+
};
|
|
94
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
95
|
+
const client = (0, executor_1.getClient)();
|
|
96
|
+
const result = await client.appMembershipDefault.findFirst(findFirstArgs).execute();
|
|
97
|
+
console.log(JSON.stringify(result, null, 2));
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
console.error('Failed to find record.');
|
|
101
|
+
if (error instanceof Error) {
|
|
102
|
+
console.error(error.message);
|
|
103
|
+
}
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
83
107
|
async function handleGet(argv, prompter) {
|
|
84
108
|
try {
|
|
85
109
|
const answers = await prompter.prompt(argv, [
|
|
@@ -26,7 +26,7 @@ const fieldSchema = {
|
|
|
26
26
|
actorId: 'uuid',
|
|
27
27
|
profileId: 'uuid',
|
|
28
28
|
};
|
|
29
|
-
const usage = '\napp-membership <command>\n\nCommands:\n list List
|
|
29
|
+
const usage = '\napp-membership <command>\n\nCommands:\n list List appMembership records\n find-first Find first matching appMembership record\n get Get a appMembership by ID\n create Create a new appMembership\n update Update an existing appMembership\n delete Delete a appMembership\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';
|
|
30
30
|
exports.default = async (argv, prompter, _options) => {
|
|
31
31
|
if (argv.help || argv.h) {
|
|
32
32
|
console.log(usage);
|
|
@@ -39,7 +39,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
39
39
|
type: 'autocomplete',
|
|
40
40
|
name: 'subcommand',
|
|
41
41
|
message: 'What do you want to do?',
|
|
42
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
42
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
43
43
|
},
|
|
44
44
|
]);
|
|
45
45
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -50,6 +50,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
50
50
|
switch (subcommand) {
|
|
51
51
|
case 'list':
|
|
52
52
|
return handleList(argv, prompter);
|
|
53
|
+
case 'find-first':
|
|
54
|
+
return handleFindFirst(argv, prompter);
|
|
53
55
|
case 'get':
|
|
54
56
|
return handleGet(argv, prompter);
|
|
55
57
|
case 'create':
|
|
@@ -63,31 +65,29 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
63
65
|
process.exit(1);
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
|
-
async function handleList(
|
|
68
|
+
async function handleList(argv, _prompter) {
|
|
67
69
|
try {
|
|
70
|
+
const defaultSelect = {
|
|
71
|
+
id: true,
|
|
72
|
+
createdAt: true,
|
|
73
|
+
updatedAt: true,
|
|
74
|
+
createdBy: true,
|
|
75
|
+
updatedBy: true,
|
|
76
|
+
isApproved: true,
|
|
77
|
+
isBanned: true,
|
|
78
|
+
isDisabled: true,
|
|
79
|
+
isVerified: true,
|
|
80
|
+
isActive: true,
|
|
81
|
+
isOwner: true,
|
|
82
|
+
isAdmin: true,
|
|
83
|
+
permissions: true,
|
|
84
|
+
granted: true,
|
|
85
|
+
actorId: true,
|
|
86
|
+
profileId: true,
|
|
87
|
+
};
|
|
88
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
68
89
|
const client = (0, executor_1.getClient)();
|
|
69
|
-
const result = await client.appMembership
|
|
70
|
-
.findMany({
|
|
71
|
-
select: {
|
|
72
|
-
id: true,
|
|
73
|
-
createdAt: true,
|
|
74
|
-
updatedAt: true,
|
|
75
|
-
createdBy: true,
|
|
76
|
-
updatedBy: true,
|
|
77
|
-
isApproved: true,
|
|
78
|
-
isBanned: true,
|
|
79
|
-
isDisabled: true,
|
|
80
|
-
isVerified: true,
|
|
81
|
-
isActive: true,
|
|
82
|
-
isOwner: true,
|
|
83
|
-
isAdmin: true,
|
|
84
|
-
permissions: true,
|
|
85
|
-
granted: true,
|
|
86
|
-
actorId: true,
|
|
87
|
-
profileId: true,
|
|
88
|
-
},
|
|
89
|
-
})
|
|
90
|
-
.execute();
|
|
90
|
+
const result = await client.appMembership.findMany(findManyArgs).execute();
|
|
91
91
|
console.log(JSON.stringify(result, null, 2));
|
|
92
92
|
}
|
|
93
93
|
catch (error) {
|
|
@@ -98,6 +98,39 @@ async function handleList(_argv, _prompter) {
|
|
|
98
98
|
process.exit(1);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
+
async function handleFindFirst(argv, _prompter) {
|
|
102
|
+
try {
|
|
103
|
+
const defaultSelect = {
|
|
104
|
+
id: true,
|
|
105
|
+
createdAt: true,
|
|
106
|
+
updatedAt: true,
|
|
107
|
+
createdBy: true,
|
|
108
|
+
updatedBy: true,
|
|
109
|
+
isApproved: true,
|
|
110
|
+
isBanned: true,
|
|
111
|
+
isDisabled: true,
|
|
112
|
+
isVerified: true,
|
|
113
|
+
isActive: true,
|
|
114
|
+
isOwner: true,
|
|
115
|
+
isAdmin: true,
|
|
116
|
+
permissions: true,
|
|
117
|
+
granted: true,
|
|
118
|
+
actorId: true,
|
|
119
|
+
profileId: true,
|
|
120
|
+
};
|
|
121
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
122
|
+
const client = (0, executor_1.getClient)();
|
|
123
|
+
const result = await client.appMembership.findFirst(findFirstArgs).execute();
|
|
124
|
+
console.log(JSON.stringify(result, null, 2));
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
console.error('Failed to find record.');
|
|
128
|
+
if (error instanceof Error) {
|
|
129
|
+
console.error(error.message);
|
|
130
|
+
}
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
101
134
|
async function handleGet(argv, prompter) {
|
|
102
135
|
try {
|
|
103
136
|
const answers = await prompter.prompt(argv, [
|
|
@@ -16,7 +16,7 @@ const fieldSchema = {
|
|
|
16
16
|
createdAt: 'string',
|
|
17
17
|
updatedAt: 'string',
|
|
18
18
|
};
|
|
19
|
-
const usage = '\napp-owner-grant <command>\n\nCommands:\n list List
|
|
19
|
+
const usage = '\napp-owner-grant <command>\n\nCommands:\n list List appOwnerGrant records\n find-first Find first matching appOwnerGrant record\n get Get a appOwnerGrant by ID\n create Create a new appOwnerGrant\n update Update an existing appOwnerGrant\n delete Delete a appOwnerGrant\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';
|
|
20
20
|
exports.default = async (argv, prompter, _options) => {
|
|
21
21
|
if (argv.help || argv.h) {
|
|
22
22
|
console.log(usage);
|
|
@@ -29,7 +29,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
29
29
|
type: 'autocomplete',
|
|
30
30
|
name: 'subcommand',
|
|
31
31
|
message: 'What do you want to do?',
|
|
32
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
32
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
33
33
|
},
|
|
34
34
|
]);
|
|
35
35
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -40,6 +40,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
40
40
|
switch (subcommand) {
|
|
41
41
|
case 'list':
|
|
42
42
|
return handleList(argv, prompter);
|
|
43
|
+
case 'find-first':
|
|
44
|
+
return handleFindFirst(argv, prompter);
|
|
43
45
|
case 'get':
|
|
44
46
|
return handleGet(argv, prompter);
|
|
45
47
|
case 'create':
|
|
@@ -53,21 +55,19 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
53
55
|
process.exit(1);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
|
-
async function handleList(
|
|
58
|
+
async function handleList(argv, _prompter) {
|
|
57
59
|
try {
|
|
60
|
+
const defaultSelect = {
|
|
61
|
+
id: true,
|
|
62
|
+
isGrant: true,
|
|
63
|
+
actorId: true,
|
|
64
|
+
grantorId: true,
|
|
65
|
+
createdAt: true,
|
|
66
|
+
updatedAt: true,
|
|
67
|
+
};
|
|
68
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
58
69
|
const client = (0, executor_1.getClient)();
|
|
59
|
-
const result = await client.appOwnerGrant
|
|
60
|
-
.findMany({
|
|
61
|
-
select: {
|
|
62
|
-
id: true,
|
|
63
|
-
isGrant: true,
|
|
64
|
-
actorId: true,
|
|
65
|
-
grantorId: true,
|
|
66
|
-
createdAt: true,
|
|
67
|
-
updatedAt: true,
|
|
68
|
-
},
|
|
69
|
-
})
|
|
70
|
-
.execute();
|
|
70
|
+
const result = await client.appOwnerGrant.findMany(findManyArgs).execute();
|
|
71
71
|
console.log(JSON.stringify(result, null, 2));
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
@@ -78,6 +78,29 @@ 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
|
+
grantorId: true,
|
|
88
|
+
createdAt: true,
|
|
89
|
+
updatedAt: true,
|
|
90
|
+
};
|
|
91
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
92
|
+
const client = (0, executor_1.getClient)();
|
|
93
|
+
const result = await client.appOwnerGrant.findFirst(findFirstArgs).execute();
|
|
94
|
+
console.log(JSON.stringify(result, null, 2));
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error('Failed to find record.');
|
|
98
|
+
if (error instanceof Error) {
|
|
99
|
+
console.error(error.message);
|
|
100
|
+
}
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
81
104
|
async function handleGet(argv, prompter) {
|
|
82
105
|
try {
|
|
83
106
|
const answers = await prompter.prompt(argv, [
|
|
@@ -12,7 +12,7 @@ const fieldSchema = {
|
|
|
12
12
|
id: 'uuid',
|
|
13
13
|
permissions: 'string',
|
|
14
14
|
};
|
|
15
|
-
const usage = '\napp-permission-default <command>\n\nCommands:\n list List
|
|
15
|
+
const usage = '\napp-permission-default <command>\n\nCommands:\n list List appPermissionDefault records\n find-first Find first matching appPermissionDefault record\n get Get a appPermissionDefault by ID\n create Create a new appPermissionDefault\n update Update an existing appPermissionDefault\n delete Delete a appPermissionDefault\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
|
exports.default = async (argv, prompter, _options) => {
|
|
17
17
|
if (argv.help || argv.h) {
|
|
18
18
|
console.log(usage);
|
|
@@ -25,7 +25,7 @@ exports.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,17 +51,15 @@ 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
|
+
permissions: true,
|
|
59
|
+
};
|
|
60
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
54
61
|
const client = (0, executor_1.getClient)();
|
|
55
|
-
const result = await client.appPermissionDefault
|
|
56
|
-
.findMany({
|
|
57
|
-
select: {
|
|
58
|
-
id: true,
|
|
59
|
-
permissions: true,
|
|
60
|
-
},
|
|
61
|
-
})
|
|
62
|
-
.execute();
|
|
62
|
+
const result = await client.appPermissionDefault.findMany(findManyArgs).execute();
|
|
63
63
|
console.log(JSON.stringify(result, null, 2));
|
|
64
64
|
}
|
|
65
65
|
catch (error) {
|
|
@@ -70,6 +70,25 @@ async function handleList(_argv, _prompter) {
|
|
|
70
70
|
process.exit(1);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
+
async function handleFindFirst(argv, _prompter) {
|
|
74
|
+
try {
|
|
75
|
+
const defaultSelect = {
|
|
76
|
+
id: true,
|
|
77
|
+
permissions: true,
|
|
78
|
+
};
|
|
79
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
80
|
+
const client = (0, executor_1.getClient)();
|
|
81
|
+
const result = await client.appPermissionDefault.findFirst(findFirstArgs).execute();
|
|
82
|
+
console.log(JSON.stringify(result, null, 2));
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error('Failed to find record.');
|
|
86
|
+
if (error instanceof Error) {
|
|
87
|
+
console.error(error.message);
|
|
88
|
+
}
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
73
92
|
async function handleGet(argv, prompter) {
|
|
74
93
|
try {
|
|
75
94
|
const answers = await prompter.prompt(argv, [
|
|
@@ -15,7 +15,7 @@ const fieldSchema = {
|
|
|
15
15
|
bitstr: 'string',
|
|
16
16
|
description: 'string',
|
|
17
17
|
};
|
|
18
|
-
const usage = '\napp-permission <command>\n\nCommands:\n list List
|
|
18
|
+
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';
|
|
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
|
+
name: true,
|
|
62
|
+
bitnum: true,
|
|
63
|
+
bitstr: true,
|
|
64
|
+
description: true,
|
|
65
|
+
};
|
|
66
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
57
67
|
const client = (0, executor_1.getClient)();
|
|
58
|
-
const result = await client.appPermission
|
|
59
|
-
.findMany({
|
|
60
|
-
select: {
|
|
61
|
-
id: true,
|
|
62
|
-
name: true,
|
|
63
|
-
bitnum: true,
|
|
64
|
-
bitstr: true,
|
|
65
|
-
description: true,
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
.execute();
|
|
68
|
+
const result = await client.appPermission.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
|
+
name: true,
|
|
84
|
+
bitnum: true,
|
|
85
|
+
bitstr: true,
|
|
86
|
+
description: true,
|
|
87
|
+
};
|
|
88
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
89
|
+
const client = (0, executor_1.getClient)();
|
|
90
|
+
const result = await client.appPermission.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, [
|
|
@@ -16,7 +16,7 @@ const fieldSchema = {
|
|
|
16
16
|
createdAt: 'string',
|
|
17
17
|
updatedAt: 'string',
|
|
18
18
|
};
|
|
19
|
-
const usage = '\napp-step <command>\n\nCommands:\n list List
|
|
19
|
+
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';
|
|
20
20
|
exports.default = async (argv, prompter, _options) => {
|
|
21
21
|
if (argv.help || argv.h) {
|
|
22
22
|
console.log(usage);
|
|
@@ -29,7 +29,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
29
29
|
type: 'autocomplete',
|
|
30
30
|
name: 'subcommand',
|
|
31
31
|
message: 'What do you want to do?',
|
|
32
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
32
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
33
33
|
},
|
|
34
34
|
]);
|
|
35
35
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -40,6 +40,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
40
40
|
switch (subcommand) {
|
|
41
41
|
case 'list':
|
|
42
42
|
return handleList(argv, prompter);
|
|
43
|
+
case 'find-first':
|
|
44
|
+
return handleFindFirst(argv, prompter);
|
|
43
45
|
case 'get':
|
|
44
46
|
return handleGet(argv, prompter);
|
|
45
47
|
case 'create':
|
|
@@ -53,21 +55,19 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
53
55
|
process.exit(1);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
|
-
async function handleList(
|
|
58
|
+
async function handleList(argv, _prompter) {
|
|
57
59
|
try {
|
|
60
|
+
const defaultSelect = {
|
|
61
|
+
id: true,
|
|
62
|
+
actorId: true,
|
|
63
|
+
name: true,
|
|
64
|
+
count: true,
|
|
65
|
+
createdAt: true,
|
|
66
|
+
updatedAt: true,
|
|
67
|
+
};
|
|
68
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
58
69
|
const client = (0, executor_1.getClient)();
|
|
59
|
-
const result = await client.appStep
|
|
60
|
-
.findMany({
|
|
61
|
-
select: {
|
|
62
|
-
id: true,
|
|
63
|
-
actorId: true,
|
|
64
|
-
name: true,
|
|
65
|
-
count: true,
|
|
66
|
-
createdAt: true,
|
|
67
|
-
updatedAt: true,
|
|
68
|
-
},
|
|
69
|
-
})
|
|
70
|
-
.execute();
|
|
70
|
+
const result = await client.appStep.findMany(findManyArgs).execute();
|
|
71
71
|
console.log(JSON.stringify(result, null, 2));
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
@@ -78,6 +78,29 @@ 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
|
+
actorId: true,
|
|
86
|
+
name: true,
|
|
87
|
+
count: true,
|
|
88
|
+
createdAt: true,
|
|
89
|
+
updatedAt: true,
|
|
90
|
+
};
|
|
91
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
92
|
+
const client = (0, executor_1.getClient)();
|
|
93
|
+
const result = await client.appStep.findFirst(findFirstArgs).execute();
|
|
94
|
+
console.log(JSON.stringify(result, null, 2));
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error('Failed to find record.');
|
|
98
|
+
if (error instanceof Error) {
|
|
99
|
+
console.error(error.message);
|
|
100
|
+
}
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
81
104
|
async function handleGet(argv, prompter) {
|
|
82
105
|
try {
|
|
83
106
|
const answers = await prompter.prompt(argv, [
|