@constructive-sdk/cli 0.25.8 → 0.25.10
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-admin-grant.js +3 -1
- package/admin/cli/commands/app-grant.js +3 -1
- package/admin/cli/commands/app-invite.js +44 -0
- package/admin/cli/commands/app-owner-grant.js +3 -1
- package/admin/cli/commands/app-permission-default-grant.d.ts +8 -0
- package/admin/cli/commands/app-permission-default-grant.js +286 -0
- package/admin/cli/commands/app-permission-default-permission.d.ts +8 -0
- package/admin/cli/commands/app-permission-default-permission.js +242 -0
- package/admin/cli/commands/org-admin-grant.js +3 -1
- package/admin/cli/commands/org-grant.js +3 -1
- package/admin/cli/commands/org-invite.js +44 -0
- package/admin/cli/commands/org-owner-grant.js +3 -1
- package/admin/cli/commands/org-permission-default-grant.d.ts +8 -0
- package/admin/cli/commands/org-permission-default-grant.js +306 -0
- package/admin/cli/commands/org-permission-default-permission.d.ts +8 -0
- package/admin/cli/commands/org-permission-default-permission.js +262 -0
- package/admin/cli/commands.js +11 -3
- package/admin/cli/executor.d.ts +5 -1
- package/admin/orm/index.d.ts +10 -2
- package/admin/orm/index.js +10 -2
- package/admin/orm/input-types.d.ts +1611 -230
- package/admin/orm/input-types.js +9 -1
- package/admin/orm/models/appPermissionDefaultGrant.d.ts +54 -0
- package/admin/orm/models/appPermissionDefaultGrant.js +104 -0
- package/admin/orm/models/appPermissionDefaultPermission.d.ts +54 -0
- package/admin/orm/models/appPermissionDefaultPermission.js +104 -0
- package/admin/orm/models/index.d.ts +5 -1
- package/admin/orm/models/index.js +11 -3
- package/admin/orm/models/orgPermissionDefaultGrant.d.ts +54 -0
- package/admin/orm/models/orgPermissionDefaultGrant.js +104 -0
- package/admin/orm/models/orgPermissionDefaultPermission.d.ts +54 -0
- package/admin/orm/models/orgPermissionDefaultPermission.js +104 -0
- package/agent/cli/commands/agent-message.js +34 -12
- package/agent/cli/commands/agent-task.js +12 -12
- package/agent/cli/embedder.d.ts +5 -0
- package/agent/cli/embedder.js +46 -9
- package/agent/orm/input-types.d.ts +289 -47
- package/agent/orm/input-types.js +1 -0
- package/api/cli/commands/check-constraint.js +0 -22
- package/api/cli/commands/composite-type.d.ts +8 -0
- package/api/cli/commands/composite-type.js +424 -0
- package/api/cli/commands/enum.js +0 -22
- package/api/cli/commands/field.js +0 -22
- package/api/cli/commands/foreign-key-constraint.js +0 -22
- package/api/cli/commands/index.js +0 -22
- package/api/cli/commands/policy.js +0 -22
- package/api/cli/commands/primary-key-constraint.js +0 -22
- package/api/cli/commands/schema.js +0 -22
- package/api/cli/commands/spatial-relation.js +0 -22
- package/api/cli/commands/table.js +6 -28
- package/api/cli/commands/trigger.js +0 -22
- package/api/cli/commands/unique-constraint.js +0 -22
- package/api/cli/commands/view-table.js +22 -0
- package/api/cli/commands/view.js +0 -22
- package/api/cli/commands.js +3 -1
- package/api/cli/executor.d.ts +1 -0
- package/api/orm/index.d.ts +2 -0
- package/api/orm/index.js +2 -0
- package/api/orm/input-types.d.ts +1064 -125
- package/api/orm/input-types.js +3 -0
- package/api/orm/models/compositeType.d.ts +54 -0
- package/api/orm/models/compositeType.js +104 -0
- package/api/orm/models/index.d.ts +1 -0
- package/api/orm/models/index.js +3 -1
- package/auth/cli/commands/link-identity.d.ts +8 -0
- package/auth/cli/commands/link-identity.js +36 -0
- package/auth/cli/commands/sign-in-sms-otp.d.ts +8 -0
- package/auth/cli/commands/sign-in-sms-otp.js +36 -0
- package/auth/cli/commands/sign-up-sms.d.ts +8 -0
- package/auth/cli/commands/sign-up-sms.js +36 -0
- package/auth/cli/commands.js +7 -1
- package/auth/cli/executor.d.ts +15 -0
- package/auth/orm/index.d.ts +15 -0
- package/auth/orm/input-types.d.ts +197 -1
- package/auth/orm/mutation/index.d.ts +25 -1
- package/auth/orm/mutation/index.js +36 -0
- package/esm/admin/cli/commands/app-admin-grant.js +3 -1
- package/esm/admin/cli/commands/app-grant.js +3 -1
- package/esm/admin/cli/commands/app-invite.js +44 -0
- package/esm/admin/cli/commands/app-owner-grant.js +3 -1
- package/esm/admin/cli/commands/app-permission-default-grant.d.ts +8 -0
- package/esm/admin/cli/commands/app-permission-default-grant.js +284 -0
- package/esm/admin/cli/commands/app-permission-default-permission.d.ts +8 -0
- package/esm/admin/cli/commands/app-permission-default-permission.js +240 -0
- package/esm/admin/cli/commands/org-admin-grant.js +3 -1
- package/esm/admin/cli/commands/org-grant.js +3 -1
- package/esm/admin/cli/commands/org-invite.js +44 -0
- package/esm/admin/cli/commands/org-owner-grant.js +3 -1
- package/esm/admin/cli/commands/org-permission-default-grant.d.ts +8 -0
- package/esm/admin/cli/commands/org-permission-default-grant.js +304 -0
- package/esm/admin/cli/commands/org-permission-default-permission.d.ts +8 -0
- package/esm/admin/cli/commands/org-permission-default-permission.js +260 -0
- package/esm/admin/cli/commands.js +11 -3
- package/esm/admin/cli/executor.d.ts +5 -1
- package/esm/admin/orm/index.d.ts +10 -2
- package/esm/admin/orm/index.js +10 -2
- package/esm/admin/orm/input-types.d.ts +1611 -230
- package/esm/admin/orm/input-types.js +9 -1
- package/esm/admin/orm/models/appPermissionDefaultGrant.d.ts +54 -0
- package/esm/admin/orm/models/appPermissionDefaultGrant.js +100 -0
- package/esm/admin/orm/models/appPermissionDefaultPermission.d.ts +54 -0
- package/esm/admin/orm/models/appPermissionDefaultPermission.js +100 -0
- package/esm/admin/orm/models/index.d.ts +5 -1
- package/esm/admin/orm/models/index.js +5 -1
- package/esm/admin/orm/models/orgPermissionDefaultGrant.d.ts +54 -0
- package/esm/admin/orm/models/orgPermissionDefaultGrant.js +100 -0
- package/esm/admin/orm/models/orgPermissionDefaultPermission.d.ts +54 -0
- package/esm/admin/orm/models/orgPermissionDefaultPermission.js +100 -0
- package/esm/agent/cli/commands/agent-message.js +34 -12
- package/esm/agent/cli/commands/agent-task.js +12 -12
- package/esm/agent/cli/embedder.d.ts +5 -0
- package/esm/agent/cli/embedder.js +10 -2
- package/esm/agent/orm/input-types.d.ts +289 -47
- package/esm/agent/orm/input-types.js +1 -0
- package/esm/api/cli/commands/check-constraint.js +0 -22
- package/esm/api/cli/commands/composite-type.d.ts +8 -0
- package/esm/api/cli/commands/composite-type.js +422 -0
- package/esm/api/cli/commands/enum.js +0 -22
- package/esm/api/cli/commands/field.js +0 -22
- package/esm/api/cli/commands/foreign-key-constraint.js +0 -22
- package/esm/api/cli/commands/index.js +0 -22
- package/esm/api/cli/commands/policy.js +0 -22
- package/esm/api/cli/commands/primary-key-constraint.js +0 -22
- package/esm/api/cli/commands/schema.js +0 -22
- package/esm/api/cli/commands/spatial-relation.js +0 -22
- package/esm/api/cli/commands/table.js +6 -28
- package/esm/api/cli/commands/trigger.js +0 -22
- package/esm/api/cli/commands/unique-constraint.js +0 -22
- package/esm/api/cli/commands/view-table.js +22 -0
- package/esm/api/cli/commands/view.js +0 -22
- package/esm/api/cli/commands.js +3 -1
- package/esm/api/cli/executor.d.ts +1 -0
- package/esm/api/orm/index.d.ts +2 -0
- package/esm/api/orm/index.js +2 -0
- package/esm/api/orm/input-types.d.ts +1064 -125
- package/esm/api/orm/input-types.js +3 -0
- package/esm/api/orm/models/compositeType.d.ts +54 -0
- package/esm/api/orm/models/compositeType.js +100 -0
- package/esm/api/orm/models/index.d.ts +1 -0
- package/esm/api/orm/models/index.js +1 -0
- package/esm/auth/cli/commands/link-identity.d.ts +8 -0
- package/esm/auth/cli/commands/link-identity.js +34 -0
- package/esm/auth/cli/commands/sign-in-sms-otp.d.ts +8 -0
- package/esm/auth/cli/commands/sign-in-sms-otp.js +34 -0
- package/esm/auth/cli/commands/sign-up-sms.d.ts +8 -0
- package/esm/auth/cli/commands/sign-up-sms.js +34 -0
- package/esm/auth/cli/commands.js +7 -1
- package/esm/auth/cli/executor.d.ts +15 -0
- package/esm/auth/orm/index.d.ts +15 -0
- package/esm/auth/orm/input-types.d.ts +197 -1
- package/esm/auth/orm/mutation/index.d.ts +25 -1
- package/esm/auth/orm/mutation/index.js +36 -0
- package/esm/modules/cli/commands/agent-module.js +88 -0
- package/esm/modules/cli/commands/billing-module.js +66 -0
- package/esm/modules/cli/commands/compute-log-module.js +44 -0
- package/esm/modules/cli/commands/config-secrets-module.js +44 -0
- package/esm/modules/cli/commands/db-usage-module.js +66 -0
- package/esm/modules/cli/commands/entity-type-provision.js +0 -44
- package/esm/modules/cli/commands/events-module.js +66 -0
- package/esm/modules/cli/commands/function-invocation-module.d.ts +8 -0
- package/esm/modules/cli/commands/function-invocation-module.js +580 -0
- package/esm/modules/cli/commands/function-module.js +22 -198
- package/esm/modules/cli/commands/graph-module.js +22 -0
- package/esm/modules/cli/commands/hierarchy-module.js +22 -0
- package/esm/modules/cli/commands/identity-providers-module.js +44 -0
- package/esm/modules/cli/commands/inference-log-module.js +44 -0
- package/esm/modules/cli/commands/invites-module.js +44 -0
- package/esm/modules/cli/commands/limits-module.js +44 -0
- package/esm/modules/cli/commands/memberships-module.js +88 -0
- package/esm/modules/cli/commands/merkle-store-module.js +22 -0
- package/esm/modules/cli/commands/namespace-module.js +22 -0
- package/esm/modules/cli/commands/notifications-module.js +88 -0
- package/esm/modules/cli/commands/permissions-module.js +44 -0
- package/esm/modules/cli/commands/plans-module.js +44 -0
- package/esm/modules/cli/commands/profiles-module.js +44 -0
- package/esm/modules/cli/commands/rate-limit-meters-module.js +66 -0
- package/esm/modules/cli/commands/storage-log-module.js +44 -0
- package/esm/modules/cli/commands/storage-module.js +66 -0
- package/esm/modules/cli/commands/transfer-log-module.js +44 -0
- package/esm/modules/cli/commands.js +29 -27
- package/esm/modules/cli/executor.d.ts +14 -13
- package/esm/modules/orm/index.d.ts +28 -26
- package/esm/modules/orm/index.js +28 -26
- package/esm/modules/orm/input-types.d.ts +4485 -2514
- package/esm/modules/orm/models/functionInvocationModule.d.ts +54 -0
- package/esm/modules/orm/models/functionInvocationModule.js +100 -0
- package/esm/modules/orm/models/index.d.ts +14 -13
- package/esm/modules/orm/models/index.js +14 -13
- package/esm/objects/orm/input-types.d.ts +62 -0
- package/esm/usage/orm/input-types.d.ts +314 -19
- package/modules/cli/commands/agent-module.js +88 -0
- package/modules/cli/commands/billing-module.js +66 -0
- package/modules/cli/commands/compute-log-module.js +44 -0
- package/modules/cli/commands/config-secrets-module.js +44 -0
- package/modules/cli/commands/db-usage-module.js +66 -0
- package/modules/cli/commands/entity-type-provision.js +0 -44
- package/modules/cli/commands/events-module.js +66 -0
- package/modules/cli/commands/function-invocation-module.d.ts +8 -0
- package/modules/cli/commands/function-invocation-module.js +582 -0
- package/modules/cli/commands/function-module.js +22 -198
- package/modules/cli/commands/graph-module.js +22 -0
- package/modules/cli/commands/hierarchy-module.js +22 -0
- package/modules/cli/commands/identity-providers-module.js +44 -0
- package/modules/cli/commands/inference-log-module.js +44 -0
- package/modules/cli/commands/invites-module.js +44 -0
- package/modules/cli/commands/limits-module.js +44 -0
- package/modules/cli/commands/memberships-module.js +88 -0
- package/modules/cli/commands/merkle-store-module.js +22 -0
- package/modules/cli/commands/namespace-module.js +22 -0
- package/modules/cli/commands/notifications-module.js +88 -0
- package/modules/cli/commands/permissions-module.js +44 -0
- package/modules/cli/commands/plans-module.js +44 -0
- package/modules/cli/commands/profiles-module.js +44 -0
- package/modules/cli/commands/rate-limit-meters-module.js +66 -0
- package/modules/cli/commands/storage-log-module.js +44 -0
- package/modules/cli/commands/storage-module.js +66 -0
- package/modules/cli/commands/transfer-log-module.js +44 -0
- package/modules/cli/commands.js +29 -27
- package/modules/cli/executor.d.ts +14 -13
- package/modules/orm/index.d.ts +28 -26
- package/modules/orm/index.js +28 -26
- package/modules/orm/input-types.d.ts +4485 -2514
- package/modules/orm/models/functionInvocationModule.d.ts +54 -0
- package/modules/orm/models/functionInvocationModule.js +104 -0
- package/modules/orm/models/index.d.ts +14 -13
- package/modules/orm/models/index.js +30 -28
- package/objects/orm/input-types.d.ts +62 -0
- package/package.json +4 -4
- package/usage/orm/input-types.d.ts +314 -19
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for CompositeType
|
|
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
|
+
schemaId: 'uuid',
|
|
13
|
+
name: 'string',
|
|
14
|
+
label: 'string',
|
|
15
|
+
description: 'string',
|
|
16
|
+
attributes: 'json',
|
|
17
|
+
smartTags: 'json',
|
|
18
|
+
category: 'string',
|
|
19
|
+
scope: 'int',
|
|
20
|
+
tags: 'string',
|
|
21
|
+
};
|
|
22
|
+
const usage = '\ncomposite-type <command>\n\nCommands:\n list List compositeType records\n find-first Find first matching compositeType record\n get Get a compositeType by ID\n create Create a new compositeType\n update Update an existing compositeType\n delete Delete a compositeType\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 --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n';
|
|
23
|
+
export default async (argv, prompter, _options) => {
|
|
24
|
+
if (argv.help || argv.h) {
|
|
25
|
+
console.log(usage);
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
29
|
+
if (!subcommand) {
|
|
30
|
+
const answer = await prompter.prompt(argv, [
|
|
31
|
+
{
|
|
32
|
+
type: 'autocomplete',
|
|
33
|
+
name: 'subcommand',
|
|
34
|
+
message: 'What do you want to do?',
|
|
35
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
36
|
+
},
|
|
37
|
+
]);
|
|
38
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
39
|
+
}
|
|
40
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
41
|
+
};
|
|
42
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
43
|
+
switch (subcommand) {
|
|
44
|
+
case 'list':
|
|
45
|
+
return handleList(argv, prompter);
|
|
46
|
+
case 'find-first':
|
|
47
|
+
return handleFindFirst(argv, prompter);
|
|
48
|
+
case 'get':
|
|
49
|
+
return handleGet(argv, prompter);
|
|
50
|
+
case 'create':
|
|
51
|
+
return handleCreate(argv, prompter);
|
|
52
|
+
case 'update':
|
|
53
|
+
return handleUpdate(argv, prompter);
|
|
54
|
+
case 'delete':
|
|
55
|
+
return handleDelete(argv, prompter);
|
|
56
|
+
default:
|
|
57
|
+
console.log(usage);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async function handleList(argv, _prompter) {
|
|
62
|
+
try {
|
|
63
|
+
const defaultSelect = {
|
|
64
|
+
id: true,
|
|
65
|
+
databaseId: true,
|
|
66
|
+
schemaId: true,
|
|
67
|
+
name: true,
|
|
68
|
+
label: true,
|
|
69
|
+
description: true,
|
|
70
|
+
attributes: true,
|
|
71
|
+
smartTags: true,
|
|
72
|
+
category: true,
|
|
73
|
+
scope: true,
|
|
74
|
+
tags: true,
|
|
75
|
+
};
|
|
76
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
77
|
+
const client = getClient();
|
|
78
|
+
const result = await client.compositeType.findMany(findManyArgs).execute();
|
|
79
|
+
console.log(JSON.stringify(result, null, 2));
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
console.error('Failed to list records.');
|
|
83
|
+
if (error instanceof Error) {
|
|
84
|
+
console.error(error.message);
|
|
85
|
+
}
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function handleFindFirst(argv, _prompter) {
|
|
90
|
+
try {
|
|
91
|
+
const defaultSelect = {
|
|
92
|
+
id: true,
|
|
93
|
+
databaseId: true,
|
|
94
|
+
schemaId: true,
|
|
95
|
+
name: true,
|
|
96
|
+
label: true,
|
|
97
|
+
description: true,
|
|
98
|
+
attributes: true,
|
|
99
|
+
smartTags: true,
|
|
100
|
+
category: true,
|
|
101
|
+
scope: true,
|
|
102
|
+
tags: true,
|
|
103
|
+
};
|
|
104
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
105
|
+
const client = getClient();
|
|
106
|
+
const result = await client.compositeType.findFirst(findFirstArgs).execute();
|
|
107
|
+
console.log(JSON.stringify(result, null, 2));
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
console.error('Failed to find record.');
|
|
111
|
+
if (error instanceof Error) {
|
|
112
|
+
console.error(error.message);
|
|
113
|
+
}
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async function handleGet(argv, prompter) {
|
|
118
|
+
try {
|
|
119
|
+
const answers = await prompter.prompt(argv, [
|
|
120
|
+
{
|
|
121
|
+
type: 'text',
|
|
122
|
+
name: 'id',
|
|
123
|
+
message: 'id',
|
|
124
|
+
required: true,
|
|
125
|
+
},
|
|
126
|
+
]);
|
|
127
|
+
const client = getClient();
|
|
128
|
+
const result = await client.compositeType
|
|
129
|
+
.findOne({
|
|
130
|
+
id: answers.id,
|
|
131
|
+
select: {
|
|
132
|
+
id: true,
|
|
133
|
+
databaseId: true,
|
|
134
|
+
schemaId: true,
|
|
135
|
+
name: true,
|
|
136
|
+
label: true,
|
|
137
|
+
description: true,
|
|
138
|
+
attributes: true,
|
|
139
|
+
smartTags: true,
|
|
140
|
+
category: true,
|
|
141
|
+
scope: true,
|
|
142
|
+
tags: true,
|
|
143
|
+
},
|
|
144
|
+
})
|
|
145
|
+
.execute();
|
|
146
|
+
console.log(JSON.stringify(result, null, 2));
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
console.error('Record not found.');
|
|
150
|
+
if (error instanceof Error) {
|
|
151
|
+
console.error(error.message);
|
|
152
|
+
}
|
|
153
|
+
process.exit(1);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async function handleCreate(argv, prompter) {
|
|
157
|
+
try {
|
|
158
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
159
|
+
{
|
|
160
|
+
type: 'text',
|
|
161
|
+
name: 'databaseId',
|
|
162
|
+
message: 'databaseId',
|
|
163
|
+
required: true,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
type: 'text',
|
|
167
|
+
name: 'schemaId',
|
|
168
|
+
message: 'schemaId',
|
|
169
|
+
required: true,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
type: 'text',
|
|
173
|
+
name: 'name',
|
|
174
|
+
message: 'name',
|
|
175
|
+
required: true,
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
type: 'text',
|
|
179
|
+
name: 'label',
|
|
180
|
+
message: 'label',
|
|
181
|
+
required: false,
|
|
182
|
+
skipPrompt: true,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'text',
|
|
186
|
+
name: 'description',
|
|
187
|
+
message: 'description',
|
|
188
|
+
required: false,
|
|
189
|
+
skipPrompt: true,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
type: 'json',
|
|
193
|
+
name: 'attributes',
|
|
194
|
+
message: 'attributes',
|
|
195
|
+
required: false,
|
|
196
|
+
skipPrompt: true,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
type: 'json',
|
|
200
|
+
name: 'smartTags',
|
|
201
|
+
message: 'smartTags',
|
|
202
|
+
required: false,
|
|
203
|
+
skipPrompt: true,
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
type: 'text',
|
|
207
|
+
name: 'category',
|
|
208
|
+
message: 'category',
|
|
209
|
+
required: false,
|
|
210
|
+
skipPrompt: true,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
type: 'text',
|
|
214
|
+
name: 'scope',
|
|
215
|
+
message: 'scope',
|
|
216
|
+
required: false,
|
|
217
|
+
skipPrompt: true,
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
type: 'text',
|
|
221
|
+
name: 'tags',
|
|
222
|
+
message: 'tags',
|
|
223
|
+
required: false,
|
|
224
|
+
skipPrompt: true,
|
|
225
|
+
},
|
|
226
|
+
]);
|
|
227
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
228
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
229
|
+
const client = getClient();
|
|
230
|
+
const result = await client.compositeType
|
|
231
|
+
.create({
|
|
232
|
+
data: {
|
|
233
|
+
databaseId: cleanedData.databaseId,
|
|
234
|
+
schemaId: cleanedData.schemaId,
|
|
235
|
+
name: cleanedData.name,
|
|
236
|
+
label: cleanedData.label,
|
|
237
|
+
description: cleanedData.description,
|
|
238
|
+
attributes: cleanedData.attributes,
|
|
239
|
+
smartTags: cleanedData.smartTags,
|
|
240
|
+
category: cleanedData.category,
|
|
241
|
+
scope: cleanedData.scope,
|
|
242
|
+
tags: cleanedData.tags,
|
|
243
|
+
},
|
|
244
|
+
select: {
|
|
245
|
+
id: true,
|
|
246
|
+
databaseId: true,
|
|
247
|
+
schemaId: true,
|
|
248
|
+
name: true,
|
|
249
|
+
label: true,
|
|
250
|
+
description: true,
|
|
251
|
+
attributes: true,
|
|
252
|
+
smartTags: true,
|
|
253
|
+
category: true,
|
|
254
|
+
scope: true,
|
|
255
|
+
tags: true,
|
|
256
|
+
},
|
|
257
|
+
})
|
|
258
|
+
.execute();
|
|
259
|
+
console.log(JSON.stringify(result, null, 2));
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
console.error('Failed to create record.');
|
|
263
|
+
if (error instanceof Error) {
|
|
264
|
+
console.error(error.message);
|
|
265
|
+
}
|
|
266
|
+
process.exit(1);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
async function handleUpdate(argv, prompter) {
|
|
270
|
+
try {
|
|
271
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
272
|
+
{
|
|
273
|
+
type: 'text',
|
|
274
|
+
name: 'id',
|
|
275
|
+
message: 'id',
|
|
276
|
+
required: true,
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
type: 'text',
|
|
280
|
+
name: 'databaseId',
|
|
281
|
+
message: 'databaseId',
|
|
282
|
+
required: false,
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
type: 'text',
|
|
286
|
+
name: 'schemaId',
|
|
287
|
+
message: 'schemaId',
|
|
288
|
+
required: false,
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
type: 'text',
|
|
292
|
+
name: 'name',
|
|
293
|
+
message: 'name',
|
|
294
|
+
required: false,
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
type: 'text',
|
|
298
|
+
name: 'label',
|
|
299
|
+
message: 'label',
|
|
300
|
+
required: false,
|
|
301
|
+
skipPrompt: true,
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
type: 'text',
|
|
305
|
+
name: 'description',
|
|
306
|
+
message: 'description',
|
|
307
|
+
required: false,
|
|
308
|
+
skipPrompt: true,
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
type: 'json',
|
|
312
|
+
name: 'attributes',
|
|
313
|
+
message: 'attributes',
|
|
314
|
+
required: false,
|
|
315
|
+
skipPrompt: true,
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
type: 'json',
|
|
319
|
+
name: 'smartTags',
|
|
320
|
+
message: 'smartTags',
|
|
321
|
+
required: false,
|
|
322
|
+
skipPrompt: true,
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
type: 'text',
|
|
326
|
+
name: 'category',
|
|
327
|
+
message: 'category',
|
|
328
|
+
required: false,
|
|
329
|
+
skipPrompt: true,
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
type: 'text',
|
|
333
|
+
name: 'scope',
|
|
334
|
+
message: 'scope',
|
|
335
|
+
required: false,
|
|
336
|
+
skipPrompt: true,
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
type: 'text',
|
|
340
|
+
name: 'tags',
|
|
341
|
+
message: 'tags',
|
|
342
|
+
required: false,
|
|
343
|
+
skipPrompt: true,
|
|
344
|
+
},
|
|
345
|
+
]);
|
|
346
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
347
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
348
|
+
const client = getClient();
|
|
349
|
+
const result = await client.compositeType
|
|
350
|
+
.update({
|
|
351
|
+
where: {
|
|
352
|
+
id: answers.id,
|
|
353
|
+
},
|
|
354
|
+
data: {
|
|
355
|
+
databaseId: cleanedData.databaseId,
|
|
356
|
+
schemaId: cleanedData.schemaId,
|
|
357
|
+
name: cleanedData.name,
|
|
358
|
+
label: cleanedData.label,
|
|
359
|
+
description: cleanedData.description,
|
|
360
|
+
attributes: cleanedData.attributes,
|
|
361
|
+
smartTags: cleanedData.smartTags,
|
|
362
|
+
category: cleanedData.category,
|
|
363
|
+
scope: cleanedData.scope,
|
|
364
|
+
tags: cleanedData.tags,
|
|
365
|
+
},
|
|
366
|
+
select: {
|
|
367
|
+
id: true,
|
|
368
|
+
databaseId: true,
|
|
369
|
+
schemaId: true,
|
|
370
|
+
name: true,
|
|
371
|
+
label: true,
|
|
372
|
+
description: true,
|
|
373
|
+
attributes: true,
|
|
374
|
+
smartTags: true,
|
|
375
|
+
category: true,
|
|
376
|
+
scope: true,
|
|
377
|
+
tags: true,
|
|
378
|
+
},
|
|
379
|
+
})
|
|
380
|
+
.execute();
|
|
381
|
+
console.log(JSON.stringify(result, null, 2));
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
console.error('Failed to update record.');
|
|
385
|
+
if (error instanceof Error) {
|
|
386
|
+
console.error(error.message);
|
|
387
|
+
}
|
|
388
|
+
process.exit(1);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
async function handleDelete(argv, prompter) {
|
|
392
|
+
try {
|
|
393
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
394
|
+
{
|
|
395
|
+
type: 'text',
|
|
396
|
+
name: 'id',
|
|
397
|
+
message: 'id',
|
|
398
|
+
required: true,
|
|
399
|
+
},
|
|
400
|
+
]);
|
|
401
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
402
|
+
const client = getClient();
|
|
403
|
+
const result = await client.compositeType
|
|
404
|
+
.delete({
|
|
405
|
+
where: {
|
|
406
|
+
id: answers.id,
|
|
407
|
+
},
|
|
408
|
+
select: {
|
|
409
|
+
id: true,
|
|
410
|
+
},
|
|
411
|
+
})
|
|
412
|
+
.execute();
|
|
413
|
+
console.log(JSON.stringify(result, null, 2));
|
|
414
|
+
}
|
|
415
|
+
catch (error) {
|
|
416
|
+
console.error('Failed to delete record.');
|
|
417
|
+
if (error instanceof Error) {
|
|
418
|
+
console.error(error.message);
|
|
419
|
+
}
|
|
420
|
+
process.exit(1);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
@@ -16,7 +16,6 @@ const fieldSchema = {
|
|
|
16
16
|
values: 'string',
|
|
17
17
|
smartTags: 'json',
|
|
18
18
|
category: 'string',
|
|
19
|
-
module: 'string',
|
|
20
19
|
scope: 'int',
|
|
21
20
|
tags: 'string',
|
|
22
21
|
};
|
|
@@ -71,7 +70,6 @@ async function handleList(argv, _prompter) {
|
|
|
71
70
|
values: true,
|
|
72
71
|
smartTags: true,
|
|
73
72
|
category: true,
|
|
74
|
-
module: true,
|
|
75
73
|
scope: true,
|
|
76
74
|
tags: true,
|
|
77
75
|
};
|
|
@@ -100,7 +98,6 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
100
98
|
values: true,
|
|
101
99
|
smartTags: true,
|
|
102
100
|
category: true,
|
|
103
|
-
module: true,
|
|
104
101
|
scope: true,
|
|
105
102
|
tags: true,
|
|
106
103
|
};
|
|
@@ -141,7 +138,6 @@ async function handleGet(argv, prompter) {
|
|
|
141
138
|
values: true,
|
|
142
139
|
smartTags: true,
|
|
143
140
|
category: true,
|
|
144
|
-
module: true,
|
|
145
141
|
scope: true,
|
|
146
142
|
tags: true,
|
|
147
143
|
},
|
|
@@ -213,13 +209,6 @@ async function handleCreate(argv, prompter) {
|
|
|
213
209
|
required: false,
|
|
214
210
|
skipPrompt: true,
|
|
215
211
|
},
|
|
216
|
-
{
|
|
217
|
-
type: 'text',
|
|
218
|
-
name: 'module',
|
|
219
|
-
message: 'module',
|
|
220
|
-
required: false,
|
|
221
|
-
skipPrompt: true,
|
|
222
|
-
},
|
|
223
212
|
{
|
|
224
213
|
type: 'text',
|
|
225
214
|
name: 'scope',
|
|
@@ -249,7 +238,6 @@ async function handleCreate(argv, prompter) {
|
|
|
249
238
|
values: cleanedData.values,
|
|
250
239
|
smartTags: cleanedData.smartTags,
|
|
251
240
|
category: cleanedData.category,
|
|
252
|
-
module: cleanedData.module,
|
|
253
241
|
scope: cleanedData.scope,
|
|
254
242
|
tags: cleanedData.tags,
|
|
255
243
|
},
|
|
@@ -263,7 +251,6 @@ async function handleCreate(argv, prompter) {
|
|
|
263
251
|
values: true,
|
|
264
252
|
smartTags: true,
|
|
265
253
|
category: true,
|
|
266
|
-
module: true,
|
|
267
254
|
scope: true,
|
|
268
255
|
tags: true,
|
|
269
256
|
},
|
|
@@ -341,13 +328,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
341
328
|
required: false,
|
|
342
329
|
skipPrompt: true,
|
|
343
330
|
},
|
|
344
|
-
{
|
|
345
|
-
type: 'text',
|
|
346
|
-
name: 'module',
|
|
347
|
-
message: 'module',
|
|
348
|
-
required: false,
|
|
349
|
-
skipPrompt: true,
|
|
350
|
-
},
|
|
351
331
|
{
|
|
352
332
|
type: 'text',
|
|
353
333
|
name: 'scope',
|
|
@@ -380,7 +360,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
380
360
|
values: cleanedData.values,
|
|
381
361
|
smartTags: cleanedData.smartTags,
|
|
382
362
|
category: cleanedData.category,
|
|
383
|
-
module: cleanedData.module,
|
|
384
363
|
scope: cleanedData.scope,
|
|
385
364
|
tags: cleanedData.tags,
|
|
386
365
|
},
|
|
@@ -394,7 +373,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
394
373
|
values: true,
|
|
395
374
|
smartTags: true,
|
|
396
375
|
category: true,
|
|
397
|
-
module: true,
|
|
398
376
|
scope: true,
|
|
399
377
|
tags: true,
|
|
400
378
|
},
|
|
@@ -26,7 +26,6 @@ const fieldSchema = {
|
|
|
26
26
|
max: 'float',
|
|
27
27
|
tags: 'string',
|
|
28
28
|
category: 'string',
|
|
29
|
-
module: 'string',
|
|
30
29
|
scope: 'int',
|
|
31
30
|
createdAt: 'string',
|
|
32
31
|
updatedAt: 'string',
|
|
@@ -92,7 +91,6 @@ async function handleList(argv, _prompter) {
|
|
|
92
91
|
max: true,
|
|
93
92
|
tags: true,
|
|
94
93
|
category: true,
|
|
95
|
-
module: true,
|
|
96
94
|
scope: true,
|
|
97
95
|
createdAt: true,
|
|
98
96
|
updatedAt: true,
|
|
@@ -132,7 +130,6 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
132
130
|
max: true,
|
|
133
131
|
tags: true,
|
|
134
132
|
category: true,
|
|
135
|
-
module: true,
|
|
136
133
|
scope: true,
|
|
137
134
|
createdAt: true,
|
|
138
135
|
updatedAt: true,
|
|
@@ -184,7 +181,6 @@ async function handleGet(argv, prompter) {
|
|
|
184
181
|
max: true,
|
|
185
182
|
tags: true,
|
|
186
183
|
category: true,
|
|
187
|
-
module: true,
|
|
188
184
|
scope: true,
|
|
189
185
|
createdAt: true,
|
|
190
186
|
updatedAt: true,
|
|
@@ -327,13 +323,6 @@ async function handleCreate(argv, prompter) {
|
|
|
327
323
|
required: false,
|
|
328
324
|
skipPrompt: true,
|
|
329
325
|
},
|
|
330
|
-
{
|
|
331
|
-
type: 'text',
|
|
332
|
-
name: 'module',
|
|
333
|
-
message: 'module',
|
|
334
|
-
required: false,
|
|
335
|
-
skipPrompt: true,
|
|
336
|
-
},
|
|
337
326
|
{
|
|
338
327
|
type: 'text',
|
|
339
328
|
name: 'scope',
|
|
@@ -366,7 +355,6 @@ async function handleCreate(argv, prompter) {
|
|
|
366
355
|
max: cleanedData.max,
|
|
367
356
|
tags: cleanedData.tags,
|
|
368
357
|
category: cleanedData.category,
|
|
369
|
-
module: cleanedData.module,
|
|
370
358
|
scope: cleanedData.scope,
|
|
371
359
|
},
|
|
372
360
|
select: {
|
|
@@ -389,7 +377,6 @@ async function handleCreate(argv, prompter) {
|
|
|
389
377
|
max: true,
|
|
390
378
|
tags: true,
|
|
391
379
|
category: true,
|
|
392
|
-
module: true,
|
|
393
380
|
scope: true,
|
|
394
381
|
createdAt: true,
|
|
395
382
|
updatedAt: true,
|
|
@@ -538,13 +525,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
538
525
|
required: false,
|
|
539
526
|
skipPrompt: true,
|
|
540
527
|
},
|
|
541
|
-
{
|
|
542
|
-
type: 'text',
|
|
543
|
-
name: 'module',
|
|
544
|
-
message: 'module',
|
|
545
|
-
required: false,
|
|
546
|
-
skipPrompt: true,
|
|
547
|
-
},
|
|
548
528
|
{
|
|
549
529
|
type: 'text',
|
|
550
530
|
name: 'scope',
|
|
@@ -580,7 +560,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
580
560
|
max: cleanedData.max,
|
|
581
561
|
tags: cleanedData.tags,
|
|
582
562
|
category: cleanedData.category,
|
|
583
|
-
module: cleanedData.module,
|
|
584
563
|
scope: cleanedData.scope,
|
|
585
564
|
},
|
|
586
565
|
select: {
|
|
@@ -603,7 +582,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
603
582
|
max: true,
|
|
604
583
|
tags: true,
|
|
605
584
|
category: true,
|
|
606
|
-
module: true,
|
|
607
585
|
scope: true,
|
|
608
586
|
createdAt: true,
|
|
609
587
|
updatedAt: true,
|
|
@@ -20,7 +20,6 @@ const fieldSchema = {
|
|
|
20
20
|
deleteAction: 'string',
|
|
21
21
|
updateAction: 'string',
|
|
22
22
|
category: 'string',
|
|
23
|
-
module: 'string',
|
|
24
23
|
scope: 'int',
|
|
25
24
|
tags: 'string',
|
|
26
25
|
createdAt: 'string',
|
|
@@ -81,7 +80,6 @@ async function handleList(argv, _prompter) {
|
|
|
81
80
|
deleteAction: true,
|
|
82
81
|
updateAction: true,
|
|
83
82
|
category: true,
|
|
84
|
-
module: true,
|
|
85
83
|
scope: true,
|
|
86
84
|
tags: true,
|
|
87
85
|
createdAt: true,
|
|
@@ -116,7 +114,6 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
116
114
|
deleteAction: true,
|
|
117
115
|
updateAction: true,
|
|
118
116
|
category: true,
|
|
119
|
-
module: true,
|
|
120
117
|
scope: true,
|
|
121
118
|
tags: true,
|
|
122
119
|
createdAt: true,
|
|
@@ -163,7 +160,6 @@ async function handleGet(argv, prompter) {
|
|
|
163
160
|
deleteAction: true,
|
|
164
161
|
updateAction: true,
|
|
165
162
|
category: true,
|
|
166
|
-
module: true,
|
|
167
163
|
scope: true,
|
|
168
164
|
tags: true,
|
|
169
165
|
createdAt: true,
|
|
@@ -264,13 +260,6 @@ async function handleCreate(argv, prompter) {
|
|
|
264
260
|
required: false,
|
|
265
261
|
skipPrompt: true,
|
|
266
262
|
},
|
|
267
|
-
{
|
|
268
|
-
type: 'text',
|
|
269
|
-
name: 'module',
|
|
270
|
-
message: 'module',
|
|
271
|
-
required: false,
|
|
272
|
-
skipPrompt: true,
|
|
273
|
-
},
|
|
274
263
|
{
|
|
275
264
|
type: 'text',
|
|
276
265
|
name: 'scope',
|
|
@@ -304,7 +293,6 @@ async function handleCreate(argv, prompter) {
|
|
|
304
293
|
deleteAction: cleanedData.deleteAction,
|
|
305
294
|
updateAction: cleanedData.updateAction,
|
|
306
295
|
category: cleanedData.category,
|
|
307
|
-
module: cleanedData.module,
|
|
308
296
|
scope: cleanedData.scope,
|
|
309
297
|
tags: cleanedData.tags,
|
|
310
298
|
},
|
|
@@ -322,7 +310,6 @@ async function handleCreate(argv, prompter) {
|
|
|
322
310
|
deleteAction: true,
|
|
323
311
|
updateAction: true,
|
|
324
312
|
category: true,
|
|
325
|
-
module: true,
|
|
326
313
|
scope: true,
|
|
327
314
|
tags: true,
|
|
328
315
|
createdAt: true,
|
|
@@ -429,13 +416,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
429
416
|
required: false,
|
|
430
417
|
skipPrompt: true,
|
|
431
418
|
},
|
|
432
|
-
{
|
|
433
|
-
type: 'text',
|
|
434
|
-
name: 'module',
|
|
435
|
-
message: 'module',
|
|
436
|
-
required: false,
|
|
437
|
-
skipPrompt: true,
|
|
438
|
-
},
|
|
439
419
|
{
|
|
440
420
|
type: 'text',
|
|
441
421
|
name: 'scope',
|
|
@@ -472,7 +452,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
472
452
|
deleteAction: cleanedData.deleteAction,
|
|
473
453
|
updateAction: cleanedData.updateAction,
|
|
474
454
|
category: cleanedData.category,
|
|
475
|
-
module: cleanedData.module,
|
|
476
455
|
scope: cleanedData.scope,
|
|
477
456
|
tags: cleanedData.tags,
|
|
478
457
|
},
|
|
@@ -490,7 +469,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
490
469
|
deleteAction: true,
|
|
491
470
|
updateAction: true,
|
|
492
471
|
category: true,
|
|
493
|
-
module: true,
|
|
494
472
|
scope: true,
|
|
495
473
|
tags: true,
|
|
496
474
|
createdAt: true,
|