@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
|
@@ -30,7 +30,7 @@ const fieldSchema = {
|
|
|
30
30
|
isManagerOfFunction: 'string',
|
|
31
31
|
createdAt: 'string',
|
|
32
32
|
};
|
|
33
|
-
const usage = '\nhierarchy-module <command>\n\nCommands:\n list List
|
|
33
|
+
const usage = '\nhierarchy-module <command>\n\nCommands:\n list List hierarchyModule records\n find-first Find first matching hierarchyModule record\n get Get a hierarchyModule by ID\n create Create a new hierarchyModule\n update Update an existing hierarchyModule\n delete Delete a hierarchyModule\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';
|
|
34
34
|
exports.default = async (argv, prompter, _options) => {
|
|
35
35
|
if (argv.help || argv.h) {
|
|
36
36
|
console.log(usage);
|
|
@@ -43,7 +43,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
43
43
|
type: 'autocomplete',
|
|
44
44
|
name: 'subcommand',
|
|
45
45
|
message: 'What do you want to do?',
|
|
46
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
46
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
47
47
|
},
|
|
48
48
|
]);
|
|
49
49
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -54,6 +54,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
54
54
|
switch (subcommand) {
|
|
55
55
|
case 'list':
|
|
56
56
|
return handleList(argv, prompter);
|
|
57
|
+
case 'find-first':
|
|
58
|
+
return handleFindFirst(argv, prompter);
|
|
57
59
|
case 'get':
|
|
58
60
|
return handleGet(argv, prompter);
|
|
59
61
|
case 'create':
|
|
@@ -67,35 +69,33 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
67
69
|
process.exit(1);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
|
-
async function handleList(
|
|
72
|
+
async function handleList(argv, _prompter) {
|
|
71
73
|
try {
|
|
74
|
+
const defaultSelect = {
|
|
75
|
+
id: true,
|
|
76
|
+
databaseId: true,
|
|
77
|
+
schemaId: true,
|
|
78
|
+
privateSchemaId: true,
|
|
79
|
+
chartEdgesTableId: true,
|
|
80
|
+
chartEdgesTableName: true,
|
|
81
|
+
hierarchySprtTableId: true,
|
|
82
|
+
hierarchySprtTableName: true,
|
|
83
|
+
chartEdgeGrantsTableId: true,
|
|
84
|
+
chartEdgeGrantsTableName: true,
|
|
85
|
+
entityTableId: true,
|
|
86
|
+
usersTableId: true,
|
|
87
|
+
prefix: true,
|
|
88
|
+
privateSchemaName: true,
|
|
89
|
+
sprtTableName: true,
|
|
90
|
+
rebuildHierarchyFunction: true,
|
|
91
|
+
getSubordinatesFunction: true,
|
|
92
|
+
getManagersFunction: true,
|
|
93
|
+
isManagerOfFunction: true,
|
|
94
|
+
createdAt: true,
|
|
95
|
+
};
|
|
96
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
72
97
|
const client = (0, executor_1.getClient)();
|
|
73
|
-
const result = await client.hierarchyModule
|
|
74
|
-
.findMany({
|
|
75
|
-
select: {
|
|
76
|
-
id: true,
|
|
77
|
-
databaseId: true,
|
|
78
|
-
schemaId: true,
|
|
79
|
-
privateSchemaId: true,
|
|
80
|
-
chartEdgesTableId: true,
|
|
81
|
-
chartEdgesTableName: true,
|
|
82
|
-
hierarchySprtTableId: true,
|
|
83
|
-
hierarchySprtTableName: true,
|
|
84
|
-
chartEdgeGrantsTableId: true,
|
|
85
|
-
chartEdgeGrantsTableName: true,
|
|
86
|
-
entityTableId: true,
|
|
87
|
-
usersTableId: true,
|
|
88
|
-
prefix: true,
|
|
89
|
-
privateSchemaName: true,
|
|
90
|
-
sprtTableName: true,
|
|
91
|
-
rebuildHierarchyFunction: true,
|
|
92
|
-
getSubordinatesFunction: true,
|
|
93
|
-
getManagersFunction: true,
|
|
94
|
-
isManagerOfFunction: true,
|
|
95
|
-
createdAt: true,
|
|
96
|
-
},
|
|
97
|
-
})
|
|
98
|
-
.execute();
|
|
98
|
+
const result = await client.hierarchyModule.findMany(findManyArgs).execute();
|
|
99
99
|
console.log(JSON.stringify(result, null, 2));
|
|
100
100
|
}
|
|
101
101
|
catch (error) {
|
|
@@ -106,6 +106,43 @@ async function handleList(_argv, _prompter) {
|
|
|
106
106
|
process.exit(1);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
async function handleFindFirst(argv, _prompter) {
|
|
110
|
+
try {
|
|
111
|
+
const defaultSelect = {
|
|
112
|
+
id: true,
|
|
113
|
+
databaseId: true,
|
|
114
|
+
schemaId: true,
|
|
115
|
+
privateSchemaId: true,
|
|
116
|
+
chartEdgesTableId: true,
|
|
117
|
+
chartEdgesTableName: true,
|
|
118
|
+
hierarchySprtTableId: true,
|
|
119
|
+
hierarchySprtTableName: true,
|
|
120
|
+
chartEdgeGrantsTableId: true,
|
|
121
|
+
chartEdgeGrantsTableName: true,
|
|
122
|
+
entityTableId: true,
|
|
123
|
+
usersTableId: true,
|
|
124
|
+
prefix: true,
|
|
125
|
+
privateSchemaName: true,
|
|
126
|
+
sprtTableName: true,
|
|
127
|
+
rebuildHierarchyFunction: true,
|
|
128
|
+
getSubordinatesFunction: true,
|
|
129
|
+
getManagersFunction: true,
|
|
130
|
+
isManagerOfFunction: true,
|
|
131
|
+
createdAt: true,
|
|
132
|
+
};
|
|
133
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
134
|
+
const client = (0, executor_1.getClient)();
|
|
135
|
+
const result = await client.hierarchyModule.findFirst(findFirstArgs).execute();
|
|
136
|
+
console.log(JSON.stringify(result, null, 2));
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
console.error('Failed to find record.');
|
|
140
|
+
if (error instanceof Error) {
|
|
141
|
+
console.error(error.message);
|
|
142
|
+
}
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
109
146
|
async function handleGet(argv, prompter) {
|
|
110
147
|
try {
|
|
111
148
|
const answers = await prompter.prompt(argv, [
|
|
@@ -29,7 +29,7 @@ const fieldSchema = {
|
|
|
29
29
|
createdAt: 'string',
|
|
30
30
|
updatedAt: 'string',
|
|
31
31
|
};
|
|
32
|
-
const usage = '\nindex <command>\n\nCommands:\n list List
|
|
32
|
+
const usage = '\nindex <command>\n\nCommands:\n list List index records\n find-first Find first matching index record\n get Get a index by ID\n create Create a new index\n update Update an existing index\n delete Delete a index\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';
|
|
33
33
|
exports.default = async (argv, prompter, _options) => {
|
|
34
34
|
if (argv.help || argv.h) {
|
|
35
35
|
console.log(usage);
|
|
@@ -42,7 +42,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
42
42
|
type: 'autocomplete',
|
|
43
43
|
name: 'subcommand',
|
|
44
44
|
message: 'What do you want to do?',
|
|
45
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
45
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
46
46
|
},
|
|
47
47
|
]);
|
|
48
48
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -53,6 +53,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
53
53
|
switch (subcommand) {
|
|
54
54
|
case 'list':
|
|
55
55
|
return handleList(argv, prompter);
|
|
56
|
+
case 'find-first':
|
|
57
|
+
return handleFindFirst(argv, prompter);
|
|
56
58
|
case 'get':
|
|
57
59
|
return handleGet(argv, prompter);
|
|
58
60
|
case 'create':
|
|
@@ -66,34 +68,32 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
66
68
|
process.exit(1);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
async function handleList(
|
|
71
|
+
async function handleList(argv, _prompter) {
|
|
70
72
|
try {
|
|
73
|
+
const defaultSelect = {
|
|
74
|
+
id: true,
|
|
75
|
+
databaseId: true,
|
|
76
|
+
tableId: true,
|
|
77
|
+
name: true,
|
|
78
|
+
fieldIds: true,
|
|
79
|
+
includeFieldIds: true,
|
|
80
|
+
accessMethod: true,
|
|
81
|
+
indexParams: true,
|
|
82
|
+
whereClause: true,
|
|
83
|
+
isUnique: true,
|
|
84
|
+
options: true,
|
|
85
|
+
opClasses: true,
|
|
86
|
+
smartTags: true,
|
|
87
|
+
category: true,
|
|
88
|
+
module: true,
|
|
89
|
+
scope: true,
|
|
90
|
+
tags: true,
|
|
91
|
+
createdAt: true,
|
|
92
|
+
updatedAt: true,
|
|
93
|
+
};
|
|
94
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
71
95
|
const client = (0, executor_1.getClient)();
|
|
72
|
-
const result = await client.index
|
|
73
|
-
.findMany({
|
|
74
|
-
select: {
|
|
75
|
-
id: true,
|
|
76
|
-
databaseId: true,
|
|
77
|
-
tableId: true,
|
|
78
|
-
name: true,
|
|
79
|
-
fieldIds: true,
|
|
80
|
-
includeFieldIds: true,
|
|
81
|
-
accessMethod: true,
|
|
82
|
-
indexParams: true,
|
|
83
|
-
whereClause: true,
|
|
84
|
-
isUnique: true,
|
|
85
|
-
options: true,
|
|
86
|
-
opClasses: true,
|
|
87
|
-
smartTags: true,
|
|
88
|
-
category: true,
|
|
89
|
-
module: true,
|
|
90
|
-
scope: true,
|
|
91
|
-
tags: true,
|
|
92
|
-
createdAt: true,
|
|
93
|
-
updatedAt: true,
|
|
94
|
-
},
|
|
95
|
-
})
|
|
96
|
-
.execute();
|
|
96
|
+
const result = await client.index.findMany(findManyArgs).execute();
|
|
97
97
|
console.log(JSON.stringify(result, null, 2));
|
|
98
98
|
}
|
|
99
99
|
catch (error) {
|
|
@@ -104,6 +104,42 @@ async function handleList(_argv, _prompter) {
|
|
|
104
104
|
process.exit(1);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
+
async function handleFindFirst(argv, _prompter) {
|
|
108
|
+
try {
|
|
109
|
+
const defaultSelect = {
|
|
110
|
+
id: true,
|
|
111
|
+
databaseId: true,
|
|
112
|
+
tableId: true,
|
|
113
|
+
name: true,
|
|
114
|
+
fieldIds: true,
|
|
115
|
+
includeFieldIds: true,
|
|
116
|
+
accessMethod: true,
|
|
117
|
+
indexParams: true,
|
|
118
|
+
whereClause: true,
|
|
119
|
+
isUnique: true,
|
|
120
|
+
options: true,
|
|
121
|
+
opClasses: true,
|
|
122
|
+
smartTags: true,
|
|
123
|
+
category: true,
|
|
124
|
+
module: true,
|
|
125
|
+
scope: true,
|
|
126
|
+
tags: true,
|
|
127
|
+
createdAt: true,
|
|
128
|
+
updatedAt: true,
|
|
129
|
+
};
|
|
130
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
131
|
+
const client = (0, executor_1.getClient)();
|
|
132
|
+
const result = await client.index.findFirst(findFirstArgs).execute();
|
|
133
|
+
console.log(JSON.stringify(result, null, 2));
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
console.error('Failed to find record.');
|
|
137
|
+
if (error instanceof Error) {
|
|
138
|
+
console.error(error.message);
|
|
139
|
+
}
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
107
143
|
async function handleGet(argv, prompter) {
|
|
108
144
|
try {
|
|
109
145
|
const answers = await prompter.prompt(argv, [
|
|
@@ -22,7 +22,7 @@ const fieldSchema = {
|
|
|
22
22
|
createdAt: 'string',
|
|
23
23
|
updatedAt: 'string',
|
|
24
24
|
};
|
|
25
|
-
const usage = '\ninvite <command>\n\nCommands:\n list List
|
|
25
|
+
const usage = '\ninvite <command>\n\nCommands:\n list List invite records\n find-first Find first matching invite record\n get Get a invite by ID\n create Create a new invite\n update Update an existing invite\n delete Delete a invite\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
26
26
|
exports.default = async (argv, prompter, _options) => {
|
|
27
27
|
if (argv.help || argv.h) {
|
|
28
28
|
console.log(usage);
|
|
@@ -35,7 +35,7 @@ exports.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,27 +61,25 @@ 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
|
+
email: true,
|
|
69
|
+
senderId: true,
|
|
70
|
+
inviteToken: true,
|
|
71
|
+
inviteValid: true,
|
|
72
|
+
inviteLimit: true,
|
|
73
|
+
inviteCount: true,
|
|
74
|
+
multiple: true,
|
|
75
|
+
data: true,
|
|
76
|
+
expiresAt: true,
|
|
77
|
+
createdAt: true,
|
|
78
|
+
updatedAt: true,
|
|
79
|
+
};
|
|
80
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
64
81
|
const client = (0, executor_1.getClient)();
|
|
65
|
-
const result = await client.invite
|
|
66
|
-
.findMany({
|
|
67
|
-
select: {
|
|
68
|
-
id: true,
|
|
69
|
-
email: true,
|
|
70
|
-
senderId: true,
|
|
71
|
-
inviteToken: true,
|
|
72
|
-
inviteValid: true,
|
|
73
|
-
inviteLimit: true,
|
|
74
|
-
inviteCount: true,
|
|
75
|
-
multiple: true,
|
|
76
|
-
data: true,
|
|
77
|
-
expiresAt: true,
|
|
78
|
-
createdAt: true,
|
|
79
|
-
updatedAt: true,
|
|
80
|
-
},
|
|
81
|
-
})
|
|
82
|
-
.execute();
|
|
82
|
+
const result = await client.invite.findMany(findManyArgs).execute();
|
|
83
83
|
console.log(JSON.stringify(result, null, 2));
|
|
84
84
|
}
|
|
85
85
|
catch (error) {
|
|
@@ -90,6 +90,35 @@ async function handleList(_argv, _prompter) {
|
|
|
90
90
|
process.exit(1);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
async function handleFindFirst(argv, _prompter) {
|
|
94
|
+
try {
|
|
95
|
+
const defaultSelect = {
|
|
96
|
+
id: true,
|
|
97
|
+
email: true,
|
|
98
|
+
senderId: true,
|
|
99
|
+
inviteToken: true,
|
|
100
|
+
inviteValid: true,
|
|
101
|
+
inviteLimit: true,
|
|
102
|
+
inviteCount: true,
|
|
103
|
+
multiple: true,
|
|
104
|
+
data: true,
|
|
105
|
+
expiresAt: true,
|
|
106
|
+
createdAt: true,
|
|
107
|
+
updatedAt: true,
|
|
108
|
+
};
|
|
109
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
110
|
+
const client = (0, executor_1.getClient)();
|
|
111
|
+
const result = await client.invite.findFirst(findFirstArgs).execute();
|
|
112
|
+
console.log(JSON.stringify(result, null, 2));
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.error('Failed to find record.');
|
|
116
|
+
if (error instanceof Error) {
|
|
117
|
+
console.error(error.message);
|
|
118
|
+
}
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
93
122
|
async function handleGet(argv, prompter) {
|
|
94
123
|
try {
|
|
95
124
|
const answers = await prompter.prompt(argv, [
|
|
@@ -24,7 +24,7 @@ const fieldSchema = {
|
|
|
24
24
|
membershipType: 'int',
|
|
25
25
|
entityTableId: 'uuid',
|
|
26
26
|
};
|
|
27
|
-
const usage = '\ninvites-module <command>\n\nCommands:\n list List
|
|
27
|
+
const usage = '\ninvites-module <command>\n\nCommands:\n list List invitesModule records\n find-first Find first matching invitesModule record\n get Get a invitesModule by ID\n create Create a new invitesModule\n update Update an existing invitesModule\n delete Delete a invitesModule\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';
|
|
28
28
|
exports.default = async (argv, prompter, _options) => {
|
|
29
29
|
if (argv.help || argv.h) {
|
|
30
30
|
console.log(usage);
|
|
@@ -37,7 +37,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
37
37
|
type: 'autocomplete',
|
|
38
38
|
name: 'subcommand',
|
|
39
39
|
message: 'What do you want to do?',
|
|
40
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
40
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
41
41
|
},
|
|
42
42
|
]);
|
|
43
43
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -48,6 +48,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
48
48
|
switch (subcommand) {
|
|
49
49
|
case 'list':
|
|
50
50
|
return handleList(argv, prompter);
|
|
51
|
+
case 'find-first':
|
|
52
|
+
return handleFindFirst(argv, prompter);
|
|
51
53
|
case 'get':
|
|
52
54
|
return handleGet(argv, prompter);
|
|
53
55
|
case 'create':
|
|
@@ -61,29 +63,27 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
61
63
|
process.exit(1);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
async function handleList(
|
|
66
|
+
async function handleList(argv, _prompter) {
|
|
65
67
|
try {
|
|
68
|
+
const defaultSelect = {
|
|
69
|
+
id: true,
|
|
70
|
+
databaseId: true,
|
|
71
|
+
schemaId: true,
|
|
72
|
+
privateSchemaId: true,
|
|
73
|
+
emailsTableId: true,
|
|
74
|
+
usersTableId: true,
|
|
75
|
+
invitesTableId: true,
|
|
76
|
+
claimedInvitesTableId: true,
|
|
77
|
+
invitesTableName: true,
|
|
78
|
+
claimedInvitesTableName: true,
|
|
79
|
+
submitInviteCodeFunction: true,
|
|
80
|
+
prefix: true,
|
|
81
|
+
membershipType: true,
|
|
82
|
+
entityTableId: true,
|
|
83
|
+
};
|
|
84
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
66
85
|
const client = (0, executor_1.getClient)();
|
|
67
|
-
const result = await client.invitesModule
|
|
68
|
-
.findMany({
|
|
69
|
-
select: {
|
|
70
|
-
id: true,
|
|
71
|
-
databaseId: true,
|
|
72
|
-
schemaId: true,
|
|
73
|
-
privateSchemaId: true,
|
|
74
|
-
emailsTableId: true,
|
|
75
|
-
usersTableId: true,
|
|
76
|
-
invitesTableId: true,
|
|
77
|
-
claimedInvitesTableId: true,
|
|
78
|
-
invitesTableName: true,
|
|
79
|
-
claimedInvitesTableName: true,
|
|
80
|
-
submitInviteCodeFunction: true,
|
|
81
|
-
prefix: true,
|
|
82
|
-
membershipType: true,
|
|
83
|
-
entityTableId: true,
|
|
84
|
-
},
|
|
85
|
-
})
|
|
86
|
-
.execute();
|
|
86
|
+
const result = await client.invitesModule.findMany(findManyArgs).execute();
|
|
87
87
|
console.log(JSON.stringify(result, null, 2));
|
|
88
88
|
}
|
|
89
89
|
catch (error) {
|
|
@@ -94,6 +94,37 @@ async function handleList(_argv, _prompter) {
|
|
|
94
94
|
process.exit(1);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
async function handleFindFirst(argv, _prompter) {
|
|
98
|
+
try {
|
|
99
|
+
const defaultSelect = {
|
|
100
|
+
id: true,
|
|
101
|
+
databaseId: true,
|
|
102
|
+
schemaId: true,
|
|
103
|
+
privateSchemaId: true,
|
|
104
|
+
emailsTableId: true,
|
|
105
|
+
usersTableId: true,
|
|
106
|
+
invitesTableId: true,
|
|
107
|
+
claimedInvitesTableId: true,
|
|
108
|
+
invitesTableName: true,
|
|
109
|
+
claimedInvitesTableName: true,
|
|
110
|
+
submitInviteCodeFunction: true,
|
|
111
|
+
prefix: true,
|
|
112
|
+
membershipType: true,
|
|
113
|
+
entityTableId: true,
|
|
114
|
+
};
|
|
115
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
116
|
+
const client = (0, executor_1.getClient)();
|
|
117
|
+
const result = await client.invitesModule.findFirst(findFirstArgs).execute();
|
|
118
|
+
console.log(JSON.stringify(result, null, 2));
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
console.error('Failed to find record.');
|
|
122
|
+
if (error instanceof Error) {
|
|
123
|
+
console.error(error.message);
|
|
124
|
+
}
|
|
125
|
+
process.exit(1);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
97
128
|
async function handleGet(argv, prompter) {
|
|
98
129
|
try {
|
|
99
130
|
const answers = await prompter.prompt(argv, [
|
|
@@ -36,7 +36,7 @@ const fieldSchema = {
|
|
|
36
36
|
entityTableId: 'uuid',
|
|
37
37
|
actorTableId: 'uuid',
|
|
38
38
|
};
|
|
39
|
-
const usage = '\nlevels-module <command>\n\nCommands:\n list List
|
|
39
|
+
const usage = '\nlevels-module <command>\n\nCommands:\n list List levelsModule records\n find-first Find first matching levelsModule record\n get Get a levelsModule by ID\n create Create a new levelsModule\n update Update an existing levelsModule\n delete Delete a levelsModule\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';
|
|
40
40
|
exports.default = async (argv, prompter, _options) => {
|
|
41
41
|
if (argv.help || argv.h) {
|
|
42
42
|
console.log(usage);
|
|
@@ -49,7 +49,7 @@ exports.default = async (argv, prompter, _options) => {
|
|
|
49
49
|
type: 'autocomplete',
|
|
50
50
|
name: 'subcommand',
|
|
51
51
|
message: 'What do you want to do?',
|
|
52
|
-
options: ['list', 'get', 'create', 'update', 'delete'],
|
|
52
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
53
53
|
},
|
|
54
54
|
]);
|
|
55
55
|
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
@@ -60,6 +60,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
60
60
|
switch (subcommand) {
|
|
61
61
|
case 'list':
|
|
62
62
|
return handleList(argv, prompter);
|
|
63
|
+
case 'find-first':
|
|
64
|
+
return handleFindFirst(argv, prompter);
|
|
63
65
|
case 'get':
|
|
64
66
|
return handleGet(argv, prompter);
|
|
65
67
|
case 'create':
|
|
@@ -73,41 +75,39 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
|
73
75
|
process.exit(1);
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
|
-
async function handleList(
|
|
78
|
+
async function handleList(argv, _prompter) {
|
|
77
79
|
try {
|
|
80
|
+
const defaultSelect = {
|
|
81
|
+
id: true,
|
|
82
|
+
databaseId: true,
|
|
83
|
+
schemaId: true,
|
|
84
|
+
privateSchemaId: true,
|
|
85
|
+
stepsTableId: true,
|
|
86
|
+
stepsTableName: true,
|
|
87
|
+
achievementsTableId: true,
|
|
88
|
+
achievementsTableName: true,
|
|
89
|
+
levelsTableId: true,
|
|
90
|
+
levelsTableName: true,
|
|
91
|
+
levelRequirementsTableId: true,
|
|
92
|
+
levelRequirementsTableName: true,
|
|
93
|
+
completedStep: true,
|
|
94
|
+
incompletedStep: true,
|
|
95
|
+
tgAchievement: true,
|
|
96
|
+
tgAchievementToggle: true,
|
|
97
|
+
tgAchievementToggleBoolean: true,
|
|
98
|
+
tgAchievementBoolean: true,
|
|
99
|
+
upsertAchievement: true,
|
|
100
|
+
tgUpdateAchievements: true,
|
|
101
|
+
stepsRequired: true,
|
|
102
|
+
levelAchieved: true,
|
|
103
|
+
prefix: true,
|
|
104
|
+
membershipType: true,
|
|
105
|
+
entityTableId: true,
|
|
106
|
+
actorTableId: true,
|
|
107
|
+
};
|
|
108
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
78
109
|
const client = (0, executor_1.getClient)();
|
|
79
|
-
const result = await client.levelsModule
|
|
80
|
-
.findMany({
|
|
81
|
-
select: {
|
|
82
|
-
id: true,
|
|
83
|
-
databaseId: true,
|
|
84
|
-
schemaId: true,
|
|
85
|
-
privateSchemaId: true,
|
|
86
|
-
stepsTableId: true,
|
|
87
|
-
stepsTableName: true,
|
|
88
|
-
achievementsTableId: true,
|
|
89
|
-
achievementsTableName: true,
|
|
90
|
-
levelsTableId: true,
|
|
91
|
-
levelsTableName: true,
|
|
92
|
-
levelRequirementsTableId: true,
|
|
93
|
-
levelRequirementsTableName: true,
|
|
94
|
-
completedStep: true,
|
|
95
|
-
incompletedStep: true,
|
|
96
|
-
tgAchievement: true,
|
|
97
|
-
tgAchievementToggle: true,
|
|
98
|
-
tgAchievementToggleBoolean: true,
|
|
99
|
-
tgAchievementBoolean: true,
|
|
100
|
-
upsertAchievement: true,
|
|
101
|
-
tgUpdateAchievements: true,
|
|
102
|
-
stepsRequired: true,
|
|
103
|
-
levelAchieved: true,
|
|
104
|
-
prefix: true,
|
|
105
|
-
membershipType: true,
|
|
106
|
-
entityTableId: true,
|
|
107
|
-
actorTableId: true,
|
|
108
|
-
},
|
|
109
|
-
})
|
|
110
|
-
.execute();
|
|
110
|
+
const result = await client.levelsModule.findMany(findManyArgs).execute();
|
|
111
111
|
console.log(JSON.stringify(result, null, 2));
|
|
112
112
|
}
|
|
113
113
|
catch (error) {
|
|
@@ -118,6 +118,49 @@ async function handleList(_argv, _prompter) {
|
|
|
118
118
|
process.exit(1);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
async function handleFindFirst(argv, _prompter) {
|
|
122
|
+
try {
|
|
123
|
+
const defaultSelect = {
|
|
124
|
+
id: true,
|
|
125
|
+
databaseId: true,
|
|
126
|
+
schemaId: true,
|
|
127
|
+
privateSchemaId: true,
|
|
128
|
+
stepsTableId: true,
|
|
129
|
+
stepsTableName: true,
|
|
130
|
+
achievementsTableId: true,
|
|
131
|
+
achievementsTableName: true,
|
|
132
|
+
levelsTableId: true,
|
|
133
|
+
levelsTableName: true,
|
|
134
|
+
levelRequirementsTableId: true,
|
|
135
|
+
levelRequirementsTableName: true,
|
|
136
|
+
completedStep: true,
|
|
137
|
+
incompletedStep: true,
|
|
138
|
+
tgAchievement: true,
|
|
139
|
+
tgAchievementToggle: true,
|
|
140
|
+
tgAchievementToggleBoolean: true,
|
|
141
|
+
tgAchievementBoolean: true,
|
|
142
|
+
upsertAchievement: true,
|
|
143
|
+
tgUpdateAchievements: true,
|
|
144
|
+
stepsRequired: true,
|
|
145
|
+
levelAchieved: true,
|
|
146
|
+
prefix: true,
|
|
147
|
+
membershipType: true,
|
|
148
|
+
entityTableId: true,
|
|
149
|
+
actorTableId: true,
|
|
150
|
+
};
|
|
151
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
152
|
+
const client = (0, executor_1.getClient)();
|
|
153
|
+
const result = await client.levelsModule.findFirst(findFirstArgs).execute();
|
|
154
|
+
console.log(JSON.stringify(result, null, 2));
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
console.error('Failed to find record.');
|
|
158
|
+
if (error instanceof Error) {
|
|
159
|
+
console.error(error.message);
|
|
160
|
+
}
|
|
161
|
+
process.exit(1);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
121
164
|
async function handleGet(argv, prompter) {
|
|
122
165
|
try {
|
|
123
166
|
const answers = await prompter.prompt(argv, [
|