@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
|
message: 'string',
|
|
@@ -17,7 +17,7 @@ const fieldSchema = {
|
|
|
17
17
|
treeId: 'uuid',
|
|
18
18
|
date: 'string',
|
|
19
19
|
};
|
|
20
|
-
const usage = '\ncommit <command>\n\nCommands:\n list List
|
|
20
|
+
const usage = '\ncommit <command>\n\nCommands:\n list List commit records\n find-first Find first matching commit record\n get Get a commit by ID\n create Create a new commit\n update Update an existing commit\n delete Delete a commit\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
|
export default async (argv, prompter, _options) => {
|
|
22
22
|
if (argv.help || argv.h) {
|
|
23
23
|
console.log(usage);
|
|
@@ -30,7 +30,7 @@ export 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,24 +56,22 @@ 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
|
+
message: true,
|
|
64
|
+
databaseId: true,
|
|
65
|
+
storeId: true,
|
|
66
|
+
parentIds: true,
|
|
67
|
+
authorId: true,
|
|
68
|
+
committerId: true,
|
|
69
|
+
treeId: true,
|
|
70
|
+
date: true,
|
|
71
|
+
};
|
|
72
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
59
73
|
const client = getClient();
|
|
60
|
-
const result = await client.commit
|
|
61
|
-
.findMany({
|
|
62
|
-
select: {
|
|
63
|
-
id: true,
|
|
64
|
-
message: true,
|
|
65
|
-
databaseId: true,
|
|
66
|
-
storeId: true,
|
|
67
|
-
parentIds: true,
|
|
68
|
-
authorId: true,
|
|
69
|
-
committerId: true,
|
|
70
|
-
treeId: true,
|
|
71
|
-
date: true,
|
|
72
|
-
},
|
|
73
|
-
})
|
|
74
|
-
.execute();
|
|
74
|
+
const result = await client.commit.findMany(findManyArgs).execute();
|
|
75
75
|
console.log(JSON.stringify(result, null, 2));
|
|
76
76
|
}
|
|
77
77
|
catch (error) {
|
|
@@ -82,6 +82,32 @@ async function handleList(_argv, _prompter) {
|
|
|
82
82
|
process.exit(1);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
async function handleFindFirst(argv, _prompter) {
|
|
86
|
+
try {
|
|
87
|
+
const defaultSelect = {
|
|
88
|
+
id: true,
|
|
89
|
+
message: true,
|
|
90
|
+
databaseId: true,
|
|
91
|
+
storeId: true,
|
|
92
|
+
parentIds: true,
|
|
93
|
+
authorId: true,
|
|
94
|
+
committerId: true,
|
|
95
|
+
treeId: true,
|
|
96
|
+
date: true,
|
|
97
|
+
};
|
|
98
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
99
|
+
const client = getClient();
|
|
100
|
+
const result = await client.commit.findFirst(findFirstArgs).execute();
|
|
101
|
+
console.log(JSON.stringify(result, null, 2));
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
console.error('Failed to find record.');
|
|
105
|
+
if (error instanceof Error) {
|
|
106
|
+
console.error(error.message);
|
|
107
|
+
}
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
85
111
|
async function handleGet(argv, prompter) {
|
|
86
112
|
try {
|
|
87
113
|
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
|
ownerId: 'uuid',
|
|
@@ -16,7 +16,7 @@ const fieldSchema = {
|
|
|
16
16
|
createdAt: 'string',
|
|
17
17
|
updatedAt: 'string',
|
|
18
18
|
};
|
|
19
|
-
const usage = '\nconnected-account <command>\n\nCommands:\n list List
|
|
19
|
+
const usage = '\nconnected-account <command>\n\nCommands:\n list List connectedAccount records\n find-first Find first matching connectedAccount record\n get Get a connectedAccount by ID\n create Create a new connectedAccount\n update Update an existing connectedAccount\n delete Delete a connectedAccount\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
|
export default async (argv, prompter, _options) => {
|
|
21
21
|
if (argv.help || argv.h) {
|
|
22
22
|
console.log(usage);
|
|
@@ -29,7 +29,7 @@ export 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,23 +55,21 @@ 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
|
+
ownerId: true,
|
|
63
|
+
service: true,
|
|
64
|
+
identifier: true,
|
|
65
|
+
details: true,
|
|
66
|
+
isVerified: true,
|
|
67
|
+
createdAt: true,
|
|
68
|
+
updatedAt: true,
|
|
69
|
+
};
|
|
70
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
58
71
|
const client = getClient();
|
|
59
|
-
const result = await client.connectedAccount
|
|
60
|
-
.findMany({
|
|
61
|
-
select: {
|
|
62
|
-
id: true,
|
|
63
|
-
ownerId: true,
|
|
64
|
-
service: true,
|
|
65
|
-
identifier: true,
|
|
66
|
-
details: true,
|
|
67
|
-
isVerified: true,
|
|
68
|
-
createdAt: true,
|
|
69
|
-
updatedAt: true,
|
|
70
|
-
},
|
|
71
|
-
})
|
|
72
|
-
.execute();
|
|
72
|
+
const result = await client.connectedAccount.findMany(findManyArgs).execute();
|
|
73
73
|
console.log(JSON.stringify(result, null, 2));
|
|
74
74
|
}
|
|
75
75
|
catch (error) {
|
|
@@ -80,6 +80,31 @@ 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
|
+
ownerId: true,
|
|
88
|
+
service: true,
|
|
89
|
+
identifier: true,
|
|
90
|
+
details: true,
|
|
91
|
+
isVerified: true,
|
|
92
|
+
createdAt: true,
|
|
93
|
+
updatedAt: true,
|
|
94
|
+
};
|
|
95
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
96
|
+
const client = getClient();
|
|
97
|
+
const result = await client.connectedAccount.findFirst(findFirstArgs).execute();
|
|
98
|
+
console.log(JSON.stringify(result, null, 2));
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.error('Failed to find record.');
|
|
102
|
+
if (error instanceof Error) {
|
|
103
|
+
console.error(error.message);
|
|
104
|
+
}
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
83
108
|
async function handleGet(argv, prompter) {
|
|
84
109
|
try {
|
|
85
110
|
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
|
databaseId: 'uuid',
|
|
@@ -15,7 +15,7 @@ const fieldSchema = {
|
|
|
15
15
|
ownerTableId: 'uuid',
|
|
16
16
|
tableName: 'string',
|
|
17
17
|
};
|
|
18
|
-
const usage = '\nconnected-accounts-module <command>\n\nCommands:\n list List
|
|
18
|
+
const usage = '\nconnected-accounts-module <command>\n\nCommands:\n list List connectedAccountsModule records\n find-first Find first matching connectedAccountsModule record\n get Get a connectedAccountsModule by ID\n create Create a new connectedAccountsModule\n update Update an existing connectedAccountsModule\n delete Delete a connectedAccountsModule\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
|
+
databaseId: true,
|
|
62
|
+
schemaId: true,
|
|
63
|
+
privateSchemaId: true,
|
|
64
|
+
tableId: true,
|
|
65
|
+
ownerTableId: true,
|
|
66
|
+
tableName: true,
|
|
67
|
+
};
|
|
68
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
57
69
|
const client = getClient();
|
|
58
|
-
const result = await client.connectedAccountsModule
|
|
59
|
-
.findMany({
|
|
60
|
-
select: {
|
|
61
|
-
id: true,
|
|
62
|
-
databaseId: true,
|
|
63
|
-
schemaId: true,
|
|
64
|
-
privateSchemaId: true,
|
|
65
|
-
tableId: true,
|
|
66
|
-
ownerTableId: true,
|
|
67
|
-
tableName: true,
|
|
68
|
-
},
|
|
69
|
-
})
|
|
70
|
-
.execute();
|
|
70
|
+
const result = await client.connectedAccountsModule.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
|
+
databaseId: true,
|
|
86
|
+
schemaId: true,
|
|
87
|
+
privateSchemaId: true,
|
|
88
|
+
tableId: true,
|
|
89
|
+
ownerTableId: true,
|
|
90
|
+
tableName: true,
|
|
91
|
+
};
|
|
92
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
93
|
+
const client = getClient();
|
|
94
|
+
const result = await client.connectedAccountsModule.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, [
|
|
@@ -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
|
ownerId: 'uuid',
|
|
@@ -15,7 +15,7 @@ const fieldSchema = {
|
|
|
15
15
|
createdAt: 'string',
|
|
16
16
|
updatedAt: 'string',
|
|
17
17
|
};
|
|
18
|
-
const usage = '\ncrypto-address <command>\n\nCommands:\n list List
|
|
18
|
+
const usage = '\ncrypto-address <command>\n\nCommands:\n list List cryptoAddress records\n find-first Find first matching cryptoAddress record\n get Get a cryptoAddress by ID\n create Create a new cryptoAddress\n update Update an existing cryptoAddress\n delete Delete a cryptoAddress\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
|
+
ownerId: true,
|
|
62
|
+
address: true,
|
|
63
|
+
isVerified: true,
|
|
64
|
+
isPrimary: true,
|
|
65
|
+
createdAt: true,
|
|
66
|
+
updatedAt: true,
|
|
67
|
+
};
|
|
68
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
57
69
|
const client = getClient();
|
|
58
|
-
const result = await client.cryptoAddress
|
|
59
|
-
.findMany({
|
|
60
|
-
select: {
|
|
61
|
-
id: true,
|
|
62
|
-
ownerId: true,
|
|
63
|
-
address: true,
|
|
64
|
-
isVerified: true,
|
|
65
|
-
isPrimary: true,
|
|
66
|
-
createdAt: true,
|
|
67
|
-
updatedAt: true,
|
|
68
|
-
},
|
|
69
|
-
})
|
|
70
|
-
.execute();
|
|
70
|
+
const result = await client.cryptoAddress.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
|
+
ownerId: true,
|
|
86
|
+
address: true,
|
|
87
|
+
isVerified: true,
|
|
88
|
+
isPrimary: true,
|
|
89
|
+
createdAt: true,
|
|
90
|
+
updatedAt: true,
|
|
91
|
+
};
|
|
92
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
93
|
+
const client = getClient();
|
|
94
|
+
const result = await client.cryptoAddress.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, [
|
|
@@ -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
|
databaseId: 'uuid',
|
|
@@ -16,7 +16,7 @@ const fieldSchema = {
|
|
|
16
16
|
tableName: 'string',
|
|
17
17
|
cryptoNetwork: 'string',
|
|
18
18
|
};
|
|
19
|
-
const usage = '\ncrypto-addresses-module <command>\n\nCommands:\n list List
|
|
19
|
+
const usage = '\ncrypto-addresses-module <command>\n\nCommands:\n list List cryptoAddressesModule records\n find-first Find first matching cryptoAddressesModule record\n get Get a cryptoAddressesModule by ID\n create Create a new cryptoAddressesModule\n update Update an existing cryptoAddressesModule\n delete Delete a cryptoAddressesModule\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
|
export default async (argv, prompter, _options) => {
|
|
21
21
|
if (argv.help || argv.h) {
|
|
22
22
|
console.log(usage);
|
|
@@ -29,7 +29,7 @@ export 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,23 +55,21 @@ 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
|
+
databaseId: true,
|
|
63
|
+
schemaId: true,
|
|
64
|
+
privateSchemaId: true,
|
|
65
|
+
tableId: true,
|
|
66
|
+
ownerTableId: true,
|
|
67
|
+
tableName: true,
|
|
68
|
+
cryptoNetwork: true,
|
|
69
|
+
};
|
|
70
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
58
71
|
const client = getClient();
|
|
59
|
-
const result = await client.cryptoAddressesModule
|
|
60
|
-
.findMany({
|
|
61
|
-
select: {
|
|
62
|
-
id: true,
|
|
63
|
-
databaseId: true,
|
|
64
|
-
schemaId: true,
|
|
65
|
-
privateSchemaId: true,
|
|
66
|
-
tableId: true,
|
|
67
|
-
ownerTableId: true,
|
|
68
|
-
tableName: true,
|
|
69
|
-
cryptoNetwork: true,
|
|
70
|
-
},
|
|
71
|
-
})
|
|
72
|
-
.execute();
|
|
72
|
+
const result = await client.cryptoAddressesModule.findMany(findManyArgs).execute();
|
|
73
73
|
console.log(JSON.stringify(result, null, 2));
|
|
74
74
|
}
|
|
75
75
|
catch (error) {
|
|
@@ -80,6 +80,31 @@ async function handleList(_argv, _prompter) {
|
|
|
80
80
|
process.exit(1);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
+
async function handleFindFirst(argv, _prompter) {
|
|
84
|
+
try {
|
|
85
|
+
const defaultSelect = {
|
|
86
|
+
id: true,
|
|
87
|
+
databaseId: true,
|
|
88
|
+
schemaId: true,
|
|
89
|
+
privateSchemaId: true,
|
|
90
|
+
tableId: true,
|
|
91
|
+
ownerTableId: true,
|
|
92
|
+
tableName: true,
|
|
93
|
+
cryptoNetwork: true,
|
|
94
|
+
};
|
|
95
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
96
|
+
const client = getClient();
|
|
97
|
+
const result = await client.cryptoAddressesModule.findFirst(findFirstArgs).execute();
|
|
98
|
+
console.log(JSON.stringify(result, null, 2));
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.error('Failed to find record.');
|
|
102
|
+
if (error instanceof Error) {
|
|
103
|
+
console.error(error.message);
|
|
104
|
+
}
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
83
108
|
async function handleGet(argv, prompter) {
|
|
84
109
|
try {
|
|
85
110
|
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
|
databaseId: 'uuid',
|
|
@@ -22,7 +22,7 @@ const fieldSchema = {
|
|
|
22
22
|
signUpWithKey: 'string',
|
|
23
23
|
signInWithChallenge: 'string',
|
|
24
24
|
};
|
|
25
|
-
const usage = '\ncrypto-auth-module <command>\n\nCommands:\n list List
|
|
25
|
+
const usage = '\ncrypto-auth-module <command>\n\nCommands:\n list List cryptoAuthModule records\n find-first Find first matching cryptoAuthModule record\n get Get a cryptoAuthModule by ID\n create Create a new cryptoAuthModule\n update Update an existing cryptoAuthModule\n delete Delete a cryptoAuthModule\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';
|
|
26
26
|
export default async (argv, prompter, _options) => {
|
|
27
27
|
if (argv.help || argv.h) {
|
|
28
28
|
console.log(usage);
|
|
@@ -35,7 +35,7 @@ export default async (argv, prompter, _options) => {
|
|
|
35
35
|
type: 'autocomplete',
|
|
36
36
|
name: 'subcommand',
|
|
37
37
|
message: 'What do you want to do?',
|
|
38
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
38
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
39
39
|
},
|
|
40
40
|
]);
|
|
41
41
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -46,6 +46,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
46
46
|
switch (subcommand) {
|
|
47
47
|
case 'list':
|
|
48
48
|
return handleList(argv, prompter);
|
|
49
|
+
case 'find-first':
|
|
50
|
+
return handleFindFirst(argv, prompter);
|
|
49
51
|
case 'get':
|
|
50
52
|
return handleGet(argv, prompter);
|
|
51
53
|
case 'create':
|
|
@@ -59,29 +61,27 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
59
61
|
process.exit(1);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
|
-
async function handleList(
|
|
64
|
+
async function handleList(argv, _prompter) {
|
|
63
65
|
try {
|
|
66
|
+
const defaultSelect = {
|
|
67
|
+
id: true,
|
|
68
|
+
databaseId: true,
|
|
69
|
+
schemaId: true,
|
|
70
|
+
usersTableId: true,
|
|
71
|
+
secretsTableId: true,
|
|
72
|
+
sessionsTableId: true,
|
|
73
|
+
sessionCredentialsTableId: true,
|
|
74
|
+
addressesTableId: true,
|
|
75
|
+
userField: true,
|
|
76
|
+
cryptoNetwork: true,
|
|
77
|
+
signInRequestChallenge: true,
|
|
78
|
+
signInRecordFailure: true,
|
|
79
|
+
signUpWithKey: true,
|
|
80
|
+
signInWithChallenge: true,
|
|
81
|
+
};
|
|
82
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
64
83
|
const client = getClient();
|
|
65
|
-
const result = await client.cryptoAuthModule
|
|
66
|
-
.findMany({
|
|
67
|
-
select: {
|
|
68
|
-
id: true,
|
|
69
|
-
databaseId: true,
|
|
70
|
-
schemaId: true,
|
|
71
|
-
usersTableId: true,
|
|
72
|
-
secretsTableId: true,
|
|
73
|
-
sessionsTableId: true,
|
|
74
|
-
sessionCredentialsTableId: true,
|
|
75
|
-
addressesTableId: true,
|
|
76
|
-
userField: true,
|
|
77
|
-
cryptoNetwork: true,
|
|
78
|
-
signInRequestChallenge: true,
|
|
79
|
-
signInRecordFailure: true,
|
|
80
|
-
signUpWithKey: true,
|
|
81
|
-
signInWithChallenge: true,
|
|
82
|
-
},
|
|
83
|
-
})
|
|
84
|
-
.execute();
|
|
84
|
+
const result = await client.cryptoAuthModule.findMany(findManyArgs).execute();
|
|
85
85
|
console.log(JSON.stringify(result, null, 2));
|
|
86
86
|
}
|
|
87
87
|
catch (error) {
|
|
@@ -92,6 +92,37 @@ async function handleList(_argv, _prompter) {
|
|
|
92
92
|
process.exit(1);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
+
async function handleFindFirst(argv, _prompter) {
|
|
96
|
+
try {
|
|
97
|
+
const defaultSelect = {
|
|
98
|
+
id: true,
|
|
99
|
+
databaseId: true,
|
|
100
|
+
schemaId: true,
|
|
101
|
+
usersTableId: true,
|
|
102
|
+
secretsTableId: true,
|
|
103
|
+
sessionsTableId: true,
|
|
104
|
+
sessionCredentialsTableId: true,
|
|
105
|
+
addressesTableId: true,
|
|
106
|
+
userField: true,
|
|
107
|
+
cryptoNetwork: true,
|
|
108
|
+
signInRequestChallenge: true,
|
|
109
|
+
signInRecordFailure: true,
|
|
110
|
+
signUpWithKey: true,
|
|
111
|
+
signInWithChallenge: true,
|
|
112
|
+
};
|
|
113
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
114
|
+
const client = getClient();
|
|
115
|
+
const result = await client.cryptoAuthModule.findFirst(findFirstArgs).execute();
|
|
116
|
+
console.log(JSON.stringify(result, null, 2));
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
console.error('Failed to find record.');
|
|
120
|
+
if (error instanceof Error) {
|
|
121
|
+
console.error(error.message);
|
|
122
|
+
}
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
95
126
|
async function handleGet(argv, prompter) {
|
|
96
127
|
try {
|
|
97
128
|
const answers = await prompter.prompt(argv, [
|