@constructive-sdk/cli 0.14.0 → 0.14.1
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-membership.js +22 -0
- package/admin/cli/commands/membership-type.js +44 -0
- package/{auth/cli/commands/connected-account.d.ts → admin/cli/commands/org-member-profile.d.ts} +1 -1
- package/admin/cli/commands/org-member-profile.js +392 -0
- package/admin/cli/commands/org-membership.js +44 -0
- package/admin/cli/commands.js +7 -5
- package/admin/cli/executor.d.ts +3 -2
- package/admin/orm/index.d.ts +6 -4
- package/admin/orm/index.js +6 -4
- package/admin/orm/input-types.d.ts +503 -295
- package/admin/orm/models/index.d.ts +3 -2
- package/admin/orm/models/index.js +7 -5
- package/admin/orm/models/orgMemberProfile.d.ts +56 -0
- package/{auth/orm/models/connectedAccount.js → admin/orm/models/orgMemberProfile.js} +26 -26
- package/{esm/auth/cli/commands/one-time-token.d.ts → auth/cli/commands/create-api-key.d.ts} +1 -1
- package/{public/cli/commands/one-time-token.js → auth/cli/commands/create-api-key.js} +3 -3
- package/auth/cli/commands/disconnect-account.d.ts +8 -0
- package/auth/cli/commands/{sign-in-one-time-token.js → disconnect-account.js} +3 -3
- package/auth/cli/commands/provision-new-user.d.ts +8 -0
- package/{public/cli/commands/sign-in-one-time-token.js → auth/cli/commands/provision-new-user.js} +3 -3
- package/auth/cli/commands/request-cross-origin-token.d.ts +8 -0
- package/auth/cli/commands/request-cross-origin-token.js +36 -0
- package/auth/cli/commands/require-step-up.d.ts +8 -0
- package/auth/cli/commands/require-step-up.js +30 -0
- package/auth/cli/commands/{one-time-token.d.ts → revoke-api-key.d.ts} +1 -1
- package/auth/cli/commands/{one-time-token.js → revoke-api-key.js} +3 -3
- package/auth/cli/commands/revoke-session.d.ts +8 -0
- package/auth/cli/commands/revoke-session.js +36 -0
- package/auth/cli/commands/sign-in-cross-origin.d.ts +8 -0
- package/auth/cli/commands/sign-in-cross-origin.js +36 -0
- package/auth/cli/commands/user-connected-account.d.ts +8 -0
- package/auth/cli/commands/user-connected-account.js +176 -0
- package/auth/cli/commands.js +23 -11
- package/auth/cli/executor.d.ts +44 -14
- package/auth/orm/index.d.ts +45 -15
- package/auth/orm/index.js +2 -2
- package/auth/orm/input-types.d.ts +186 -251
- package/auth/orm/input-types.js +0 -1
- package/auth/orm/models/index.d.ts +1 -1
- package/auth/orm/models/index.js +3 -3
- package/auth/orm/models/userConnectedAccount.d.ts +38 -0
- package/auth/orm/models/userConnectedAccount.js +76 -0
- package/auth/orm/mutation/index.d.ts +56 -16
- package/auth/orm/mutation/index.js +78 -18
- package/auth/orm/query/index.d.ts +12 -4
- package/auth/orm/query/index.js +19 -7
- package/esm/admin/cli/commands/app-membership.js +22 -0
- package/esm/admin/cli/commands/membership-type.js +44 -0
- package/esm/{public/cli/commands/connected-account.d.ts → admin/cli/commands/org-member-profile.d.ts} +1 -1
- package/esm/admin/cli/commands/org-member-profile.js +390 -0
- package/esm/admin/cli/commands/org-membership.js +44 -0
- package/esm/admin/cli/commands.js +7 -5
- package/esm/admin/cli/executor.d.ts +3 -2
- package/esm/admin/orm/index.d.ts +6 -4
- package/esm/admin/orm/index.js +6 -4
- package/esm/admin/orm/input-types.d.ts +503 -295
- package/esm/admin/orm/models/index.d.ts +3 -2
- package/esm/admin/orm/models/index.js +3 -2
- package/esm/admin/orm/models/orgMemberProfile.d.ts +56 -0
- package/esm/{public/orm/models/connectedAccount.js → admin/orm/models/orgMemberProfile.js} +24 -24
- package/esm/auth/cli/commands/create-api-key.d.ts +8 -0
- package/esm/{public/cli/commands/one-time-token.js → auth/cli/commands/create-api-key.js} +3 -3
- package/esm/auth/cli/commands/disconnect-account.d.ts +8 -0
- package/esm/auth/cli/commands/{sign-in-one-time-token.js → disconnect-account.js} +3 -3
- package/esm/auth/cli/commands/provision-new-user.d.ts +8 -0
- package/esm/{public/cli/commands/sign-in-one-time-token.js → auth/cli/commands/provision-new-user.js} +3 -3
- package/esm/auth/cli/commands/request-cross-origin-token.d.ts +8 -0
- package/esm/auth/cli/commands/request-cross-origin-token.js +34 -0
- package/esm/auth/cli/commands/require-step-up.d.ts +8 -0
- package/esm/auth/cli/commands/require-step-up.js +28 -0
- package/esm/auth/cli/commands/revoke-api-key.d.ts +8 -0
- package/esm/auth/cli/commands/{one-time-token.js → revoke-api-key.js} +3 -3
- package/esm/auth/cli/commands/revoke-session.d.ts +8 -0
- package/esm/auth/cli/commands/revoke-session.js +34 -0
- package/esm/auth/cli/commands/sign-in-cross-origin.d.ts +8 -0
- package/esm/auth/cli/commands/sign-in-cross-origin.js +34 -0
- package/esm/auth/cli/commands/user-connected-account.d.ts +8 -0
- package/esm/auth/cli/commands/user-connected-account.js +174 -0
- package/esm/auth/cli/commands.js +23 -11
- package/esm/auth/cli/executor.d.ts +44 -14
- package/esm/auth/orm/index.d.ts +45 -15
- package/esm/auth/orm/index.js +2 -2
- package/esm/auth/orm/input-types.d.ts +186 -251
- package/esm/auth/orm/input-types.js +0 -1
- package/esm/auth/orm/models/index.d.ts +1 -1
- package/esm/auth/orm/models/index.js +1 -1
- package/esm/auth/orm/models/userConnectedAccount.d.ts +38 -0
- package/esm/auth/orm/models/userConnectedAccount.js +72 -0
- package/esm/auth/orm/mutation/index.d.ts +56 -16
- package/esm/auth/orm/mutation/index.js +78 -18
- package/esm/auth/orm/query/index.d.ts +12 -4
- package/esm/auth/orm/query/index.js +19 -7
- package/esm/public/cli/commands/app-membership.js +22 -0
- package/esm/public/cli/commands/construct-blueprint.js +1 -1
- package/esm/public/cli/commands/create-api-key.d.ts +8 -0
- package/esm/public/cli/commands/create-api-key.js +34 -0
- package/{public/cli/commands/connected-account.d.ts → esm/public/cli/commands/devices-module.d.ts} +1 -1
- package/esm/public/cli/commands/{connected-account.js → devices-module.js} +101 -87
- package/esm/public/cli/commands/disconnect-account.d.ts +8 -0
- package/esm/public/cli/commands/disconnect-account.js +34 -0
- package/esm/public/cli/commands/{table-template-module.d.ts → entity-type-provision.d.ts} +1 -1
- package/esm/public/cli/commands/entity-type-provision.js +554 -0
- package/esm/public/cli/commands/membership-type.js +44 -0
- package/esm/public/cli/commands/memberships-module.js +22 -0
- package/esm/{auth/cli/commands/connected-account.d.ts → public/cli/commands/org-member-profile.d.ts} +1 -1
- package/esm/public/cli/commands/org-member-profile.js +390 -0
- package/esm/public/cli/commands/org-membership.js +44 -0
- package/esm/public/cli/commands/provision-new-user.d.ts +8 -0
- package/esm/public/cli/commands/provision-new-user.js +34 -0
- package/esm/public/cli/commands/provision-spatial-relation.d.ts +8 -0
- package/esm/public/cli/commands/provision-spatial-relation.js +34 -0
- package/esm/public/cli/commands/request-cross-origin-token.d.ts +8 -0
- package/esm/public/cli/commands/request-cross-origin-token.js +34 -0
- package/esm/public/cli/commands/require-step-up.d.ts +8 -0
- package/esm/public/cli/commands/require-step-up.js +28 -0
- package/{auth/cli/commands/sign-in-one-time-token.d.ts → esm/public/cli/commands/resolve-blueprint-field.d.ts} +1 -1
- package/esm/public/cli/commands/resolve-blueprint-field.js +38 -0
- package/esm/public/cli/commands/revoke-api-key.d.ts +8 -0
- package/esm/public/cli/commands/revoke-api-key.js +34 -0
- package/esm/public/cli/commands/revoke-session.d.ts +8 -0
- package/esm/public/cli/commands/revoke-session.js +34 -0
- package/esm/public/cli/commands/session-secrets-module.d.ts +8 -0
- package/esm/{auth/cli/commands/connected-account.js → public/cli/commands/session-secrets-module.js} +82 -90
- package/esm/public/cli/commands/sign-in-cross-origin.d.ts +8 -0
- package/esm/public/cli/commands/sign-in-cross-origin.js +34 -0
- package/esm/public/cli/commands/spatial-relation.d.ts +8 -0
- package/esm/public/cli/commands/spatial-relation.js +472 -0
- package/esm/public/cli/commands/user-auth-module.js +24 -24
- package/esm/public/cli/commands/user-connected-account.d.ts +8 -0
- package/esm/public/cli/commands/user-connected-account.js +174 -0
- package/esm/public/cli/commands/webauthn-credentials-module.d.ts +8 -0
- package/esm/public/cli/commands/{table-template-module.js → webauthn-credentials-module.js} +8 -48
- package/esm/public/cli/commands.js +41 -15
- package/esm/public/cli/executor.d.ts +61 -16
- package/esm/public/orm/index.d.ts +69 -19
- package/esm/public/orm/index.js +16 -6
- package/esm/public/orm/input-types.d.ts +2047 -640
- package/esm/public/orm/input-types.js +15 -6
- package/esm/public/orm/models/devicesModule.d.ts +56 -0
- package/esm/public/orm/models/devicesModule.js +96 -0
- package/esm/public/orm/models/entityTypeProvision.d.ts +56 -0
- package/esm/public/orm/models/{tableTemplateModule.js → entityTypeProvision.js} +24 -24
- package/esm/public/orm/models/index.d.ts +8 -3
- package/esm/public/orm/models/index.js +8 -3
- package/esm/public/orm/models/orgMemberProfile.d.ts +56 -0
- package/esm/{auth/orm/models/connectedAccount.js → public/orm/models/orgMemberProfile.js} +24 -24
- package/esm/public/orm/models/sessionSecretsModule.d.ts +56 -0
- package/esm/public/orm/models/sessionSecretsModule.js +96 -0
- package/esm/public/orm/models/spatialRelation.d.ts +56 -0
- package/esm/public/orm/models/spatialRelation.js +96 -0
- package/esm/public/orm/models/userConnectedAccount.d.ts +38 -0
- package/esm/public/orm/models/userConnectedAccount.js +72 -0
- package/esm/public/orm/models/webauthnCredentialsModule.d.ts +56 -0
- package/esm/public/orm/models/webauthnCredentialsModule.js +96 -0
- package/esm/public/orm/mutation/index.d.ts +72 -20
- package/esm/public/orm/mutation/index.js +96 -24
- package/esm/public/orm/query/index.d.ts +24 -2
- package/esm/public/orm/query/index.js +36 -4
- package/package.json +2 -2
- package/public/cli/commands/app-membership.js +22 -0
- package/public/cli/commands/construct-blueprint.js +1 -1
- package/public/cli/commands/create-api-key.d.ts +8 -0
- package/public/cli/commands/create-api-key.js +36 -0
- package/public/cli/commands/devices-module.d.ts +8 -0
- package/{auth/cli/commands/connected-account.js → public/cli/commands/devices-module.js} +101 -87
- package/public/cli/commands/disconnect-account.d.ts +8 -0
- package/public/cli/commands/disconnect-account.js +36 -0
- package/public/cli/commands/entity-type-provision.d.ts +8 -0
- package/public/cli/commands/entity-type-provision.js +556 -0
- package/public/cli/commands/membership-type.js +44 -0
- package/public/cli/commands/memberships-module.js +22 -0
- package/public/cli/commands/org-member-profile.d.ts +8 -0
- package/public/cli/commands/org-member-profile.js +392 -0
- package/public/cli/commands/org-membership.js +44 -0
- package/public/cli/commands/provision-new-user.d.ts +8 -0
- package/public/cli/commands/provision-new-user.js +36 -0
- package/public/cli/commands/provision-spatial-relation.d.ts +8 -0
- package/public/cli/commands/provision-spatial-relation.js +36 -0
- package/public/cli/commands/request-cross-origin-token.d.ts +8 -0
- package/public/cli/commands/request-cross-origin-token.js +36 -0
- package/public/cli/commands/require-step-up.d.ts +8 -0
- package/public/cli/commands/require-step-up.js +30 -0
- package/public/cli/commands/resolve-blueprint-field.d.ts +8 -0
- package/public/cli/commands/resolve-blueprint-field.js +40 -0
- package/public/cli/commands/revoke-api-key.d.ts +8 -0
- package/public/cli/commands/revoke-api-key.js +36 -0
- package/public/cli/commands/revoke-session.d.ts +8 -0
- package/public/cli/commands/revoke-session.js +36 -0
- package/public/cli/commands/session-secrets-module.d.ts +8 -0
- package/public/cli/commands/{connected-account.js → session-secrets-module.js} +82 -90
- package/public/cli/commands/sign-in-cross-origin.d.ts +8 -0
- package/public/cli/commands/sign-in-cross-origin.js +36 -0
- package/public/cli/commands/spatial-relation.d.ts +8 -0
- package/public/cli/commands/spatial-relation.js +474 -0
- package/public/cli/commands/user-auth-module.js +24 -24
- package/public/cli/commands/user-connected-account.d.ts +8 -0
- package/public/cli/commands/user-connected-account.js +176 -0
- package/public/cli/commands/webauthn-credentials-module.d.ts +8 -0
- package/public/cli/commands/{table-template-module.js → webauthn-credentials-module.js} +8 -48
- package/public/cli/commands.js +41 -15
- package/public/cli/executor.d.ts +61 -16
- package/public/orm/index.d.ts +69 -19
- package/public/orm/index.js +16 -6
- package/public/orm/input-types.d.ts +2047 -640
- package/public/orm/input-types.js +15 -6
- package/public/orm/models/devicesModule.d.ts +56 -0
- package/public/orm/models/devicesModule.js +100 -0
- package/public/orm/models/entityTypeProvision.d.ts +56 -0
- package/public/orm/models/{tableTemplateModule.js → entityTypeProvision.js} +26 -26
- package/public/orm/models/index.d.ts +8 -3
- package/public/orm/models/index.js +19 -9
- package/public/orm/models/orgMemberProfile.d.ts +56 -0
- package/public/orm/models/{connectedAccount.js → orgMemberProfile.js} +26 -26
- package/public/orm/models/sessionSecretsModule.d.ts +56 -0
- package/public/orm/models/sessionSecretsModule.js +100 -0
- package/public/orm/models/spatialRelation.d.ts +56 -0
- package/public/orm/models/spatialRelation.js +100 -0
- package/public/orm/models/userConnectedAccount.d.ts +38 -0
- package/public/orm/models/userConnectedAccount.js +76 -0
- package/public/orm/models/webauthnCredentialsModule.d.ts +56 -0
- package/public/orm/models/webauthnCredentialsModule.js +100 -0
- package/public/orm/mutation/index.d.ts +72 -20
- package/public/orm/mutation/index.js +96 -24
- package/public/orm/query/index.d.ts +24 -2
- package/public/orm/query/index.js +36 -4
- package/auth/orm/models/connectedAccount.d.ts +0 -56
- package/esm/auth/cli/commands/sign-in-one-time-token.d.ts +0 -8
- package/esm/auth/orm/models/connectedAccount.d.ts +0 -56
- package/esm/public/cli/commands/one-time-token.d.ts +0 -8
- package/esm/public/cli/commands/sign-in-one-time-token.d.ts +0 -8
- package/esm/public/orm/models/connectedAccount.d.ts +0 -56
- package/esm/public/orm/models/tableTemplateModule.d.ts +0 -56
- package/public/cli/commands/one-time-token.d.ts +0 -8
- package/public/cli/commands/sign-in-one-time-token.d.ts +0 -8
- package/public/cli/commands/table-template-module.d.ts +0 -8
- package/public/orm/models/connectedAccount.d.ts +0 -56
- package/public/orm/models/tableTemplateModule.d.ts +0 -56
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for SpatialRelation
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { extractFirst } from 'inquirerer';
|
|
7
|
+
import { getClient } from '../executor';
|
|
8
|
+
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
|
|
9
|
+
const fieldSchema = {
|
|
10
|
+
id: 'uuid',
|
|
11
|
+
databaseId: 'uuid',
|
|
12
|
+
tableId: 'uuid',
|
|
13
|
+
fieldId: 'uuid',
|
|
14
|
+
refTableId: 'uuid',
|
|
15
|
+
refFieldId: 'uuid',
|
|
16
|
+
name: 'string',
|
|
17
|
+
operator: 'string',
|
|
18
|
+
paramName: 'string',
|
|
19
|
+
category: 'string',
|
|
20
|
+
module: 'string',
|
|
21
|
+
scope: 'int',
|
|
22
|
+
tags: 'string',
|
|
23
|
+
createdAt: 'string',
|
|
24
|
+
updatedAt: 'string',
|
|
25
|
+
};
|
|
26
|
+
const usage = '\nspatial-relation <command>\n\nCommands:\n list List spatialRelation records\n find-first Find first matching spatialRelation record\n get Get a spatialRelation by ID\n create Create a new spatialRelation\n update Update an existing spatialRelation\n delete Delete a spatialRelation\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';
|
|
27
|
+
export default async (argv, prompter, _options) => {
|
|
28
|
+
if (argv.help || argv.h) {
|
|
29
|
+
console.log(usage);
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
33
|
+
if (!subcommand) {
|
|
34
|
+
const answer = await prompter.prompt(argv, [
|
|
35
|
+
{
|
|
36
|
+
type: 'autocomplete',
|
|
37
|
+
name: 'subcommand',
|
|
38
|
+
message: 'What do you want to do?',
|
|
39
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
40
|
+
},
|
|
41
|
+
]);
|
|
42
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
43
|
+
}
|
|
44
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
45
|
+
};
|
|
46
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
47
|
+
switch (subcommand) {
|
|
48
|
+
case 'list':
|
|
49
|
+
return handleList(argv, prompter);
|
|
50
|
+
case 'find-first':
|
|
51
|
+
return handleFindFirst(argv, prompter);
|
|
52
|
+
case 'get':
|
|
53
|
+
return handleGet(argv, prompter);
|
|
54
|
+
case 'create':
|
|
55
|
+
return handleCreate(argv, prompter);
|
|
56
|
+
case 'update':
|
|
57
|
+
return handleUpdate(argv, prompter);
|
|
58
|
+
case 'delete':
|
|
59
|
+
return handleDelete(argv, prompter);
|
|
60
|
+
default:
|
|
61
|
+
console.log(usage);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function handleList(argv, _prompter) {
|
|
66
|
+
try {
|
|
67
|
+
const defaultSelect = {
|
|
68
|
+
id: true,
|
|
69
|
+
databaseId: true,
|
|
70
|
+
tableId: true,
|
|
71
|
+
fieldId: true,
|
|
72
|
+
refTableId: true,
|
|
73
|
+
refFieldId: true,
|
|
74
|
+
name: true,
|
|
75
|
+
operator: true,
|
|
76
|
+
paramName: true,
|
|
77
|
+
category: true,
|
|
78
|
+
module: true,
|
|
79
|
+
scope: true,
|
|
80
|
+
tags: true,
|
|
81
|
+
createdAt: true,
|
|
82
|
+
updatedAt: true,
|
|
83
|
+
};
|
|
84
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
85
|
+
const client = getClient();
|
|
86
|
+
const result = await client.spatialRelation.findMany(findManyArgs).execute();
|
|
87
|
+
console.log(JSON.stringify(result, null, 2));
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error('Failed to list records.');
|
|
91
|
+
if (error instanceof Error) {
|
|
92
|
+
console.error(error.message);
|
|
93
|
+
}
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function handleFindFirst(argv, _prompter) {
|
|
98
|
+
try {
|
|
99
|
+
const defaultSelect = {
|
|
100
|
+
id: true,
|
|
101
|
+
databaseId: true,
|
|
102
|
+
tableId: true,
|
|
103
|
+
fieldId: true,
|
|
104
|
+
refTableId: true,
|
|
105
|
+
refFieldId: true,
|
|
106
|
+
name: true,
|
|
107
|
+
operator: true,
|
|
108
|
+
paramName: true,
|
|
109
|
+
category: true,
|
|
110
|
+
module: true,
|
|
111
|
+
scope: true,
|
|
112
|
+
tags: true,
|
|
113
|
+
createdAt: true,
|
|
114
|
+
updatedAt: true,
|
|
115
|
+
};
|
|
116
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
117
|
+
const client = getClient();
|
|
118
|
+
const result = await client.spatialRelation.findFirst(findFirstArgs).execute();
|
|
119
|
+
console.log(JSON.stringify(result, null, 2));
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
console.error('Failed to find record.');
|
|
123
|
+
if (error instanceof Error) {
|
|
124
|
+
console.error(error.message);
|
|
125
|
+
}
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async function handleGet(argv, prompter) {
|
|
130
|
+
try {
|
|
131
|
+
const answers = await prompter.prompt(argv, [
|
|
132
|
+
{
|
|
133
|
+
type: 'text',
|
|
134
|
+
name: 'id',
|
|
135
|
+
message: 'id',
|
|
136
|
+
required: true,
|
|
137
|
+
},
|
|
138
|
+
]);
|
|
139
|
+
const client = getClient();
|
|
140
|
+
const result = await client.spatialRelation
|
|
141
|
+
.findOne({
|
|
142
|
+
id: answers.id,
|
|
143
|
+
select: {
|
|
144
|
+
id: true,
|
|
145
|
+
databaseId: true,
|
|
146
|
+
tableId: true,
|
|
147
|
+
fieldId: true,
|
|
148
|
+
refTableId: true,
|
|
149
|
+
refFieldId: true,
|
|
150
|
+
name: true,
|
|
151
|
+
operator: true,
|
|
152
|
+
paramName: true,
|
|
153
|
+
category: true,
|
|
154
|
+
module: true,
|
|
155
|
+
scope: true,
|
|
156
|
+
tags: true,
|
|
157
|
+
createdAt: true,
|
|
158
|
+
updatedAt: true,
|
|
159
|
+
},
|
|
160
|
+
})
|
|
161
|
+
.execute();
|
|
162
|
+
console.log(JSON.stringify(result, null, 2));
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
console.error('Record not found.');
|
|
166
|
+
if (error instanceof Error) {
|
|
167
|
+
console.error(error.message);
|
|
168
|
+
}
|
|
169
|
+
process.exit(1);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async function handleCreate(argv, prompter) {
|
|
173
|
+
try {
|
|
174
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
175
|
+
{
|
|
176
|
+
type: 'text',
|
|
177
|
+
name: 'databaseId',
|
|
178
|
+
message: 'databaseId',
|
|
179
|
+
required: false,
|
|
180
|
+
skipPrompt: true,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
type: 'text',
|
|
184
|
+
name: 'tableId',
|
|
185
|
+
message: 'tableId',
|
|
186
|
+
required: true,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
type: 'text',
|
|
190
|
+
name: 'fieldId',
|
|
191
|
+
message: 'fieldId',
|
|
192
|
+
required: true,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
type: 'text',
|
|
196
|
+
name: 'refTableId',
|
|
197
|
+
message: 'refTableId',
|
|
198
|
+
required: true,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
type: 'text',
|
|
202
|
+
name: 'refFieldId',
|
|
203
|
+
message: 'refFieldId',
|
|
204
|
+
required: true,
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
type: 'text',
|
|
208
|
+
name: 'name',
|
|
209
|
+
message: 'name',
|
|
210
|
+
required: true,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
type: 'text',
|
|
214
|
+
name: 'operator',
|
|
215
|
+
message: 'operator',
|
|
216
|
+
required: true,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: 'text',
|
|
220
|
+
name: 'paramName',
|
|
221
|
+
message: 'paramName',
|
|
222
|
+
required: false,
|
|
223
|
+
skipPrompt: true,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'text',
|
|
227
|
+
name: 'category',
|
|
228
|
+
message: 'category',
|
|
229
|
+
required: false,
|
|
230
|
+
skipPrompt: true,
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
type: 'text',
|
|
234
|
+
name: 'module',
|
|
235
|
+
message: 'module',
|
|
236
|
+
required: false,
|
|
237
|
+
skipPrompt: true,
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
type: 'text',
|
|
241
|
+
name: 'scope',
|
|
242
|
+
message: 'scope',
|
|
243
|
+
required: false,
|
|
244
|
+
skipPrompt: true,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
type: 'text',
|
|
248
|
+
name: 'tags',
|
|
249
|
+
message: 'tags',
|
|
250
|
+
required: false,
|
|
251
|
+
skipPrompt: true,
|
|
252
|
+
},
|
|
253
|
+
]);
|
|
254
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
255
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
256
|
+
const client = getClient();
|
|
257
|
+
const result = await client.spatialRelation
|
|
258
|
+
.create({
|
|
259
|
+
data: {
|
|
260
|
+
databaseId: cleanedData.databaseId,
|
|
261
|
+
tableId: cleanedData.tableId,
|
|
262
|
+
fieldId: cleanedData.fieldId,
|
|
263
|
+
refTableId: cleanedData.refTableId,
|
|
264
|
+
refFieldId: cleanedData.refFieldId,
|
|
265
|
+
name: cleanedData.name,
|
|
266
|
+
operator: cleanedData.operator,
|
|
267
|
+
paramName: cleanedData.paramName,
|
|
268
|
+
category: cleanedData.category,
|
|
269
|
+
module: cleanedData.module,
|
|
270
|
+
scope: cleanedData.scope,
|
|
271
|
+
tags: cleanedData.tags,
|
|
272
|
+
},
|
|
273
|
+
select: {
|
|
274
|
+
id: true,
|
|
275
|
+
databaseId: true,
|
|
276
|
+
tableId: true,
|
|
277
|
+
fieldId: true,
|
|
278
|
+
refTableId: true,
|
|
279
|
+
refFieldId: true,
|
|
280
|
+
name: true,
|
|
281
|
+
operator: true,
|
|
282
|
+
paramName: true,
|
|
283
|
+
category: true,
|
|
284
|
+
module: true,
|
|
285
|
+
scope: true,
|
|
286
|
+
tags: true,
|
|
287
|
+
createdAt: true,
|
|
288
|
+
updatedAt: true,
|
|
289
|
+
},
|
|
290
|
+
})
|
|
291
|
+
.execute();
|
|
292
|
+
console.log(JSON.stringify(result, null, 2));
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
console.error('Failed to create record.');
|
|
296
|
+
if (error instanceof Error) {
|
|
297
|
+
console.error(error.message);
|
|
298
|
+
}
|
|
299
|
+
process.exit(1);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
async function handleUpdate(argv, prompter) {
|
|
303
|
+
try {
|
|
304
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
305
|
+
{
|
|
306
|
+
type: 'text',
|
|
307
|
+
name: 'id',
|
|
308
|
+
message: 'id',
|
|
309
|
+
required: true,
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
type: 'text',
|
|
313
|
+
name: 'databaseId',
|
|
314
|
+
message: 'databaseId',
|
|
315
|
+
required: false,
|
|
316
|
+
skipPrompt: true,
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
type: 'text',
|
|
320
|
+
name: 'tableId',
|
|
321
|
+
message: 'tableId',
|
|
322
|
+
required: false,
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
type: 'text',
|
|
326
|
+
name: 'fieldId',
|
|
327
|
+
message: 'fieldId',
|
|
328
|
+
required: false,
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
type: 'text',
|
|
332
|
+
name: 'refTableId',
|
|
333
|
+
message: 'refTableId',
|
|
334
|
+
required: false,
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
type: 'text',
|
|
338
|
+
name: 'refFieldId',
|
|
339
|
+
message: 'refFieldId',
|
|
340
|
+
required: false,
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
type: 'text',
|
|
344
|
+
name: 'name',
|
|
345
|
+
message: 'name',
|
|
346
|
+
required: false,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
type: 'text',
|
|
350
|
+
name: 'operator',
|
|
351
|
+
message: 'operator',
|
|
352
|
+
required: false,
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
type: 'text',
|
|
356
|
+
name: 'paramName',
|
|
357
|
+
message: 'paramName',
|
|
358
|
+
required: false,
|
|
359
|
+
skipPrompt: true,
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
type: 'text',
|
|
363
|
+
name: 'category',
|
|
364
|
+
message: 'category',
|
|
365
|
+
required: false,
|
|
366
|
+
skipPrompt: true,
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
type: 'text',
|
|
370
|
+
name: 'module',
|
|
371
|
+
message: 'module',
|
|
372
|
+
required: false,
|
|
373
|
+
skipPrompt: true,
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
type: 'text',
|
|
377
|
+
name: 'scope',
|
|
378
|
+
message: 'scope',
|
|
379
|
+
required: false,
|
|
380
|
+
skipPrompt: true,
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
type: 'text',
|
|
384
|
+
name: 'tags',
|
|
385
|
+
message: 'tags',
|
|
386
|
+
required: false,
|
|
387
|
+
skipPrompt: true,
|
|
388
|
+
},
|
|
389
|
+
]);
|
|
390
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
391
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
392
|
+
const client = getClient();
|
|
393
|
+
const result = await client.spatialRelation
|
|
394
|
+
.update({
|
|
395
|
+
where: {
|
|
396
|
+
id: answers.id,
|
|
397
|
+
},
|
|
398
|
+
data: {
|
|
399
|
+
databaseId: cleanedData.databaseId,
|
|
400
|
+
tableId: cleanedData.tableId,
|
|
401
|
+
fieldId: cleanedData.fieldId,
|
|
402
|
+
refTableId: cleanedData.refTableId,
|
|
403
|
+
refFieldId: cleanedData.refFieldId,
|
|
404
|
+
name: cleanedData.name,
|
|
405
|
+
operator: cleanedData.operator,
|
|
406
|
+
paramName: cleanedData.paramName,
|
|
407
|
+
category: cleanedData.category,
|
|
408
|
+
module: cleanedData.module,
|
|
409
|
+
scope: cleanedData.scope,
|
|
410
|
+
tags: cleanedData.tags,
|
|
411
|
+
},
|
|
412
|
+
select: {
|
|
413
|
+
id: true,
|
|
414
|
+
databaseId: true,
|
|
415
|
+
tableId: true,
|
|
416
|
+
fieldId: true,
|
|
417
|
+
refTableId: true,
|
|
418
|
+
refFieldId: true,
|
|
419
|
+
name: true,
|
|
420
|
+
operator: true,
|
|
421
|
+
paramName: true,
|
|
422
|
+
category: true,
|
|
423
|
+
module: true,
|
|
424
|
+
scope: true,
|
|
425
|
+
tags: true,
|
|
426
|
+
createdAt: true,
|
|
427
|
+
updatedAt: true,
|
|
428
|
+
},
|
|
429
|
+
})
|
|
430
|
+
.execute();
|
|
431
|
+
console.log(JSON.stringify(result, null, 2));
|
|
432
|
+
}
|
|
433
|
+
catch (error) {
|
|
434
|
+
console.error('Failed to update record.');
|
|
435
|
+
if (error instanceof Error) {
|
|
436
|
+
console.error(error.message);
|
|
437
|
+
}
|
|
438
|
+
process.exit(1);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
async function handleDelete(argv, prompter) {
|
|
442
|
+
try {
|
|
443
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
444
|
+
{
|
|
445
|
+
type: 'text',
|
|
446
|
+
name: 'id',
|
|
447
|
+
message: 'id',
|
|
448
|
+
required: true,
|
|
449
|
+
},
|
|
450
|
+
]);
|
|
451
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
452
|
+
const client = getClient();
|
|
453
|
+
const result = await client.spatialRelation
|
|
454
|
+
.delete({
|
|
455
|
+
where: {
|
|
456
|
+
id: answers.id,
|
|
457
|
+
},
|
|
458
|
+
select: {
|
|
459
|
+
id: true,
|
|
460
|
+
},
|
|
461
|
+
})
|
|
462
|
+
.execute();
|
|
463
|
+
console.log(JSON.stringify(result, null, 2));
|
|
464
|
+
}
|
|
465
|
+
catch (error) {
|
|
466
|
+
console.error('Failed to delete record.');
|
|
467
|
+
if (error instanceof Error) {
|
|
468
|
+
console.error(error.message);
|
|
469
|
+
}
|
|
470
|
+
process.exit(1);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
@@ -30,8 +30,8 @@ const fieldSchema = {
|
|
|
30
30
|
checkPasswordFunction: 'string',
|
|
31
31
|
sendAccountDeletionEmailFunction: 'string',
|
|
32
32
|
deleteAccountFunction: 'string',
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
signInCrossOriginFunction: 'string',
|
|
34
|
+
requestCrossOriginTokenFunction: 'string',
|
|
35
35
|
extendTokenExpires: 'string',
|
|
36
36
|
};
|
|
37
37
|
const usage = '\nuser-auth-module <command>\n\nCommands:\n list List userAuthModule records\n find-first Find first matching userAuthModule record\n get Get a userAuthModule by ID\n create Create a new userAuthModule\n update Update an existing userAuthModule\n delete Delete a userAuthModule\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';
|
|
@@ -99,8 +99,8 @@ async function handleList(argv, _prompter) {
|
|
|
99
99
|
checkPasswordFunction: true,
|
|
100
100
|
sendAccountDeletionEmailFunction: true,
|
|
101
101
|
deleteAccountFunction: true,
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
signInCrossOriginFunction: true,
|
|
103
|
+
requestCrossOriginTokenFunction: true,
|
|
104
104
|
extendTokenExpires: true,
|
|
105
105
|
};
|
|
106
106
|
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
@@ -142,8 +142,8 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
142
142
|
checkPasswordFunction: true,
|
|
143
143
|
sendAccountDeletionEmailFunction: true,
|
|
144
144
|
deleteAccountFunction: true,
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
signInCrossOriginFunction: true,
|
|
146
|
+
requestCrossOriginTokenFunction: true,
|
|
147
147
|
extendTokenExpires: true,
|
|
148
148
|
};
|
|
149
149
|
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
@@ -197,8 +197,8 @@ async function handleGet(argv, prompter) {
|
|
|
197
197
|
checkPasswordFunction: true,
|
|
198
198
|
sendAccountDeletionEmailFunction: true,
|
|
199
199
|
deleteAccountFunction: true,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
signInCrossOriginFunction: true,
|
|
201
|
+
requestCrossOriginTokenFunction: true,
|
|
202
202
|
extendTokenExpires: true,
|
|
203
203
|
},
|
|
204
204
|
})
|
|
@@ -371,15 +371,15 @@ async function handleCreate(argv, prompter) {
|
|
|
371
371
|
},
|
|
372
372
|
{
|
|
373
373
|
type: 'text',
|
|
374
|
-
name: '
|
|
375
|
-
message: '
|
|
374
|
+
name: 'signInCrossOriginFunction',
|
|
375
|
+
message: 'signInCrossOriginFunction',
|
|
376
376
|
required: false,
|
|
377
377
|
skipPrompt: true,
|
|
378
378
|
},
|
|
379
379
|
{
|
|
380
380
|
type: 'text',
|
|
381
|
-
name: '
|
|
382
|
-
message: '
|
|
381
|
+
name: 'requestCrossOriginTokenFunction',
|
|
382
|
+
message: 'requestCrossOriginTokenFunction',
|
|
383
383
|
required: false,
|
|
384
384
|
skipPrompt: true,
|
|
385
385
|
},
|
|
@@ -419,8 +419,8 @@ async function handleCreate(argv, prompter) {
|
|
|
419
419
|
checkPasswordFunction: cleanedData.checkPasswordFunction,
|
|
420
420
|
sendAccountDeletionEmailFunction: cleanedData.sendAccountDeletionEmailFunction,
|
|
421
421
|
deleteAccountFunction: cleanedData.deleteAccountFunction,
|
|
422
|
-
|
|
423
|
-
|
|
422
|
+
signInCrossOriginFunction: cleanedData.signInCrossOriginFunction,
|
|
423
|
+
requestCrossOriginTokenFunction: cleanedData.requestCrossOriginTokenFunction,
|
|
424
424
|
extendTokenExpires: cleanedData.extendTokenExpires,
|
|
425
425
|
},
|
|
426
426
|
select: {
|
|
@@ -447,8 +447,8 @@ async function handleCreate(argv, prompter) {
|
|
|
447
447
|
checkPasswordFunction: true,
|
|
448
448
|
sendAccountDeletionEmailFunction: true,
|
|
449
449
|
deleteAccountFunction: true,
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
signInCrossOriginFunction: true,
|
|
451
|
+
requestCrossOriginTokenFunction: true,
|
|
452
452
|
extendTokenExpires: true,
|
|
453
453
|
},
|
|
454
454
|
})
|
|
@@ -627,15 +627,15 @@ async function handleUpdate(argv, prompter) {
|
|
|
627
627
|
},
|
|
628
628
|
{
|
|
629
629
|
type: 'text',
|
|
630
|
-
name: '
|
|
631
|
-
message: '
|
|
630
|
+
name: 'signInCrossOriginFunction',
|
|
631
|
+
message: 'signInCrossOriginFunction',
|
|
632
632
|
required: false,
|
|
633
633
|
skipPrompt: true,
|
|
634
634
|
},
|
|
635
635
|
{
|
|
636
636
|
type: 'text',
|
|
637
|
-
name: '
|
|
638
|
-
message: '
|
|
637
|
+
name: 'requestCrossOriginTokenFunction',
|
|
638
|
+
message: 'requestCrossOriginTokenFunction',
|
|
639
639
|
required: false,
|
|
640
640
|
skipPrompt: true,
|
|
641
641
|
},
|
|
@@ -678,8 +678,8 @@ async function handleUpdate(argv, prompter) {
|
|
|
678
678
|
checkPasswordFunction: cleanedData.checkPasswordFunction,
|
|
679
679
|
sendAccountDeletionEmailFunction: cleanedData.sendAccountDeletionEmailFunction,
|
|
680
680
|
deleteAccountFunction: cleanedData.deleteAccountFunction,
|
|
681
|
-
|
|
682
|
-
|
|
681
|
+
signInCrossOriginFunction: cleanedData.signInCrossOriginFunction,
|
|
682
|
+
requestCrossOriginTokenFunction: cleanedData.requestCrossOriginTokenFunction,
|
|
683
683
|
extendTokenExpires: cleanedData.extendTokenExpires,
|
|
684
684
|
},
|
|
685
685
|
select: {
|
|
@@ -706,8 +706,8 @@ async function handleUpdate(argv, prompter) {
|
|
|
706
706
|
checkPasswordFunction: true,
|
|
707
707
|
sendAccountDeletionEmailFunction: true,
|
|
708
708
|
deleteAccountFunction: true,
|
|
709
|
-
|
|
710
|
-
|
|
709
|
+
signInCrossOriginFunction: true,
|
|
710
|
+
requestCrossOriginTokenFunction: true,
|
|
711
711
|
extendTokenExpires: true,
|
|
712
712
|
},
|
|
713
713
|
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for UserConnectedAccount
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { CLIOptions, Inquirerer } from 'inquirerer';
|
|
7
|
+
declare const _default: (argv: Partial<Record<string, unknown>>, prompter: Inquirerer, _options: CLIOptions) => Promise<void>;
|
|
8
|
+
export default _default;
|