@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,424 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* CLI commands for CompositeType
|
|
5
|
+
* @generated by @constructive-io/graphql-codegen
|
|
6
|
+
* DO NOT EDIT - changes will be overwritten
|
|
7
|
+
*/
|
|
8
|
+
const inquirerer_1 = require("inquirerer");
|
|
9
|
+
const executor_1 = require("../executor");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
const fieldSchema = {
|
|
12
|
+
id: 'uuid',
|
|
13
|
+
databaseId: 'uuid',
|
|
14
|
+
schemaId: 'uuid',
|
|
15
|
+
name: 'string',
|
|
16
|
+
label: 'string',
|
|
17
|
+
description: 'string',
|
|
18
|
+
attributes: 'json',
|
|
19
|
+
smartTags: 'json',
|
|
20
|
+
category: 'string',
|
|
21
|
+
scope: 'int',
|
|
22
|
+
tags: 'string',
|
|
23
|
+
};
|
|
24
|
+
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';
|
|
25
|
+
exports.default = async (argv, prompter, _options) => {
|
|
26
|
+
if (argv.help || argv.h) {
|
|
27
|
+
console.log(usage);
|
|
28
|
+
process.exit(0);
|
|
29
|
+
}
|
|
30
|
+
const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
|
|
31
|
+
if (!subcommand) {
|
|
32
|
+
const answer = await prompter.prompt(argv, [
|
|
33
|
+
{
|
|
34
|
+
type: 'autocomplete',
|
|
35
|
+
name: 'subcommand',
|
|
36
|
+
message: 'What do you want to do?',
|
|
37
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
38
|
+
},
|
|
39
|
+
]);
|
|
40
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
41
|
+
}
|
|
42
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
43
|
+
};
|
|
44
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
45
|
+
switch (subcommand) {
|
|
46
|
+
case 'list':
|
|
47
|
+
return handleList(argv, prompter);
|
|
48
|
+
case 'find-first':
|
|
49
|
+
return handleFindFirst(argv, prompter);
|
|
50
|
+
case 'get':
|
|
51
|
+
return handleGet(argv, prompter);
|
|
52
|
+
case 'create':
|
|
53
|
+
return handleCreate(argv, prompter);
|
|
54
|
+
case 'update':
|
|
55
|
+
return handleUpdate(argv, prompter);
|
|
56
|
+
case 'delete':
|
|
57
|
+
return handleDelete(argv, prompter);
|
|
58
|
+
default:
|
|
59
|
+
console.log(usage);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async function handleList(argv, _prompter) {
|
|
64
|
+
try {
|
|
65
|
+
const defaultSelect = {
|
|
66
|
+
id: true,
|
|
67
|
+
databaseId: true,
|
|
68
|
+
schemaId: true,
|
|
69
|
+
name: true,
|
|
70
|
+
label: true,
|
|
71
|
+
description: true,
|
|
72
|
+
attributes: true,
|
|
73
|
+
smartTags: true,
|
|
74
|
+
category: true,
|
|
75
|
+
scope: true,
|
|
76
|
+
tags: true,
|
|
77
|
+
};
|
|
78
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
79
|
+
const client = (0, executor_1.getClient)();
|
|
80
|
+
const result = await client.compositeType.findMany(findManyArgs).execute();
|
|
81
|
+
console.log(JSON.stringify(result, null, 2));
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.error('Failed to list records.');
|
|
85
|
+
if (error instanceof Error) {
|
|
86
|
+
console.error(error.message);
|
|
87
|
+
}
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function handleFindFirst(argv, _prompter) {
|
|
92
|
+
try {
|
|
93
|
+
const defaultSelect = {
|
|
94
|
+
id: true,
|
|
95
|
+
databaseId: true,
|
|
96
|
+
schemaId: true,
|
|
97
|
+
name: true,
|
|
98
|
+
label: true,
|
|
99
|
+
description: true,
|
|
100
|
+
attributes: true,
|
|
101
|
+
smartTags: true,
|
|
102
|
+
category: true,
|
|
103
|
+
scope: true,
|
|
104
|
+
tags: true,
|
|
105
|
+
};
|
|
106
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
107
|
+
const client = (0, executor_1.getClient)();
|
|
108
|
+
const result = await client.compositeType.findFirst(findFirstArgs).execute();
|
|
109
|
+
console.log(JSON.stringify(result, null, 2));
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
console.error('Failed to find record.');
|
|
113
|
+
if (error instanceof Error) {
|
|
114
|
+
console.error(error.message);
|
|
115
|
+
}
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async function handleGet(argv, prompter) {
|
|
120
|
+
try {
|
|
121
|
+
const answers = await prompter.prompt(argv, [
|
|
122
|
+
{
|
|
123
|
+
type: 'text',
|
|
124
|
+
name: 'id',
|
|
125
|
+
message: 'id',
|
|
126
|
+
required: true,
|
|
127
|
+
},
|
|
128
|
+
]);
|
|
129
|
+
const client = (0, executor_1.getClient)();
|
|
130
|
+
const result = await client.compositeType
|
|
131
|
+
.findOne({
|
|
132
|
+
id: answers.id,
|
|
133
|
+
select: {
|
|
134
|
+
id: true,
|
|
135
|
+
databaseId: true,
|
|
136
|
+
schemaId: true,
|
|
137
|
+
name: true,
|
|
138
|
+
label: true,
|
|
139
|
+
description: true,
|
|
140
|
+
attributes: true,
|
|
141
|
+
smartTags: true,
|
|
142
|
+
category: true,
|
|
143
|
+
scope: true,
|
|
144
|
+
tags: true,
|
|
145
|
+
},
|
|
146
|
+
})
|
|
147
|
+
.execute();
|
|
148
|
+
console.log(JSON.stringify(result, null, 2));
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
console.error('Record not found.');
|
|
152
|
+
if (error instanceof Error) {
|
|
153
|
+
console.error(error.message);
|
|
154
|
+
}
|
|
155
|
+
process.exit(1);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
async function handleCreate(argv, prompter) {
|
|
159
|
+
try {
|
|
160
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
161
|
+
{
|
|
162
|
+
type: 'text',
|
|
163
|
+
name: 'databaseId',
|
|
164
|
+
message: 'databaseId',
|
|
165
|
+
required: true,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
type: 'text',
|
|
169
|
+
name: 'schemaId',
|
|
170
|
+
message: 'schemaId',
|
|
171
|
+
required: true,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'text',
|
|
175
|
+
name: 'name',
|
|
176
|
+
message: 'name',
|
|
177
|
+
required: true,
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'text',
|
|
181
|
+
name: 'label',
|
|
182
|
+
message: 'label',
|
|
183
|
+
required: false,
|
|
184
|
+
skipPrompt: true,
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: 'text',
|
|
188
|
+
name: 'description',
|
|
189
|
+
message: 'description',
|
|
190
|
+
required: false,
|
|
191
|
+
skipPrompt: true,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
type: 'json',
|
|
195
|
+
name: 'attributes',
|
|
196
|
+
message: 'attributes',
|
|
197
|
+
required: false,
|
|
198
|
+
skipPrompt: true,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
type: 'json',
|
|
202
|
+
name: 'smartTags',
|
|
203
|
+
message: 'smartTags',
|
|
204
|
+
required: false,
|
|
205
|
+
skipPrompt: true,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
type: 'text',
|
|
209
|
+
name: 'category',
|
|
210
|
+
message: 'category',
|
|
211
|
+
required: false,
|
|
212
|
+
skipPrompt: true,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: 'text',
|
|
216
|
+
name: 'scope',
|
|
217
|
+
message: 'scope',
|
|
218
|
+
required: false,
|
|
219
|
+
skipPrompt: true,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
type: 'text',
|
|
223
|
+
name: 'tags',
|
|
224
|
+
message: 'tags',
|
|
225
|
+
required: false,
|
|
226
|
+
skipPrompt: true,
|
|
227
|
+
},
|
|
228
|
+
]);
|
|
229
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
230
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
231
|
+
const client = (0, executor_1.getClient)();
|
|
232
|
+
const result = await client.compositeType
|
|
233
|
+
.create({
|
|
234
|
+
data: {
|
|
235
|
+
databaseId: cleanedData.databaseId,
|
|
236
|
+
schemaId: cleanedData.schemaId,
|
|
237
|
+
name: cleanedData.name,
|
|
238
|
+
label: cleanedData.label,
|
|
239
|
+
description: cleanedData.description,
|
|
240
|
+
attributes: cleanedData.attributes,
|
|
241
|
+
smartTags: cleanedData.smartTags,
|
|
242
|
+
category: cleanedData.category,
|
|
243
|
+
scope: cleanedData.scope,
|
|
244
|
+
tags: cleanedData.tags,
|
|
245
|
+
},
|
|
246
|
+
select: {
|
|
247
|
+
id: true,
|
|
248
|
+
databaseId: true,
|
|
249
|
+
schemaId: true,
|
|
250
|
+
name: true,
|
|
251
|
+
label: true,
|
|
252
|
+
description: true,
|
|
253
|
+
attributes: true,
|
|
254
|
+
smartTags: true,
|
|
255
|
+
category: true,
|
|
256
|
+
scope: true,
|
|
257
|
+
tags: true,
|
|
258
|
+
},
|
|
259
|
+
})
|
|
260
|
+
.execute();
|
|
261
|
+
console.log(JSON.stringify(result, null, 2));
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
console.error('Failed to create record.');
|
|
265
|
+
if (error instanceof Error) {
|
|
266
|
+
console.error(error.message);
|
|
267
|
+
}
|
|
268
|
+
process.exit(1);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
async function handleUpdate(argv, prompter) {
|
|
272
|
+
try {
|
|
273
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
274
|
+
{
|
|
275
|
+
type: 'text',
|
|
276
|
+
name: 'id',
|
|
277
|
+
message: 'id',
|
|
278
|
+
required: true,
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
type: 'text',
|
|
282
|
+
name: 'databaseId',
|
|
283
|
+
message: 'databaseId',
|
|
284
|
+
required: false,
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
type: 'text',
|
|
288
|
+
name: 'schemaId',
|
|
289
|
+
message: 'schemaId',
|
|
290
|
+
required: false,
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
type: 'text',
|
|
294
|
+
name: 'name',
|
|
295
|
+
message: 'name',
|
|
296
|
+
required: false,
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
type: 'text',
|
|
300
|
+
name: 'label',
|
|
301
|
+
message: 'label',
|
|
302
|
+
required: false,
|
|
303
|
+
skipPrompt: true,
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
type: 'text',
|
|
307
|
+
name: 'description',
|
|
308
|
+
message: 'description',
|
|
309
|
+
required: false,
|
|
310
|
+
skipPrompt: true,
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
type: 'json',
|
|
314
|
+
name: 'attributes',
|
|
315
|
+
message: 'attributes',
|
|
316
|
+
required: false,
|
|
317
|
+
skipPrompt: true,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
type: 'json',
|
|
321
|
+
name: 'smartTags',
|
|
322
|
+
message: 'smartTags',
|
|
323
|
+
required: false,
|
|
324
|
+
skipPrompt: true,
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
type: 'text',
|
|
328
|
+
name: 'category',
|
|
329
|
+
message: 'category',
|
|
330
|
+
required: false,
|
|
331
|
+
skipPrompt: true,
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
type: 'text',
|
|
335
|
+
name: 'scope',
|
|
336
|
+
message: 'scope',
|
|
337
|
+
required: false,
|
|
338
|
+
skipPrompt: true,
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
type: 'text',
|
|
342
|
+
name: 'tags',
|
|
343
|
+
message: 'tags',
|
|
344
|
+
required: false,
|
|
345
|
+
skipPrompt: true,
|
|
346
|
+
},
|
|
347
|
+
]);
|
|
348
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
349
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
350
|
+
const client = (0, executor_1.getClient)();
|
|
351
|
+
const result = await client.compositeType
|
|
352
|
+
.update({
|
|
353
|
+
where: {
|
|
354
|
+
id: answers.id,
|
|
355
|
+
},
|
|
356
|
+
data: {
|
|
357
|
+
databaseId: cleanedData.databaseId,
|
|
358
|
+
schemaId: cleanedData.schemaId,
|
|
359
|
+
name: cleanedData.name,
|
|
360
|
+
label: cleanedData.label,
|
|
361
|
+
description: cleanedData.description,
|
|
362
|
+
attributes: cleanedData.attributes,
|
|
363
|
+
smartTags: cleanedData.smartTags,
|
|
364
|
+
category: cleanedData.category,
|
|
365
|
+
scope: cleanedData.scope,
|
|
366
|
+
tags: cleanedData.tags,
|
|
367
|
+
},
|
|
368
|
+
select: {
|
|
369
|
+
id: true,
|
|
370
|
+
databaseId: true,
|
|
371
|
+
schemaId: true,
|
|
372
|
+
name: true,
|
|
373
|
+
label: true,
|
|
374
|
+
description: true,
|
|
375
|
+
attributes: true,
|
|
376
|
+
smartTags: true,
|
|
377
|
+
category: true,
|
|
378
|
+
scope: true,
|
|
379
|
+
tags: true,
|
|
380
|
+
},
|
|
381
|
+
})
|
|
382
|
+
.execute();
|
|
383
|
+
console.log(JSON.stringify(result, null, 2));
|
|
384
|
+
}
|
|
385
|
+
catch (error) {
|
|
386
|
+
console.error('Failed to update record.');
|
|
387
|
+
if (error instanceof Error) {
|
|
388
|
+
console.error(error.message);
|
|
389
|
+
}
|
|
390
|
+
process.exit(1);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
async function handleDelete(argv, prompter) {
|
|
394
|
+
try {
|
|
395
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
396
|
+
{
|
|
397
|
+
type: 'text',
|
|
398
|
+
name: 'id',
|
|
399
|
+
message: 'id',
|
|
400
|
+
required: true,
|
|
401
|
+
},
|
|
402
|
+
]);
|
|
403
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
404
|
+
const client = (0, executor_1.getClient)();
|
|
405
|
+
const result = await client.compositeType
|
|
406
|
+
.delete({
|
|
407
|
+
where: {
|
|
408
|
+
id: answers.id,
|
|
409
|
+
},
|
|
410
|
+
select: {
|
|
411
|
+
id: true,
|
|
412
|
+
},
|
|
413
|
+
})
|
|
414
|
+
.execute();
|
|
415
|
+
console.log(JSON.stringify(result, null, 2));
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
console.error('Failed to delete record.');
|
|
419
|
+
if (error instanceof Error) {
|
|
420
|
+
console.error(error.message);
|
|
421
|
+
}
|
|
422
|
+
process.exit(1);
|
|
423
|
+
}
|
|
424
|
+
}
|
package/api/cli/commands/enum.js
CHANGED
|
@@ -18,7 +18,6 @@ const fieldSchema = {
|
|
|
18
18
|
values: 'string',
|
|
19
19
|
smartTags: 'json',
|
|
20
20
|
category: 'string',
|
|
21
|
-
module: 'string',
|
|
22
21
|
scope: 'int',
|
|
23
22
|
tags: 'string',
|
|
24
23
|
};
|
|
@@ -73,7 +72,6 @@ async function handleList(argv, _prompter) {
|
|
|
73
72
|
values: true,
|
|
74
73
|
smartTags: true,
|
|
75
74
|
category: true,
|
|
76
|
-
module: true,
|
|
77
75
|
scope: true,
|
|
78
76
|
tags: true,
|
|
79
77
|
};
|
|
@@ -102,7 +100,6 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
102
100
|
values: true,
|
|
103
101
|
smartTags: true,
|
|
104
102
|
category: true,
|
|
105
|
-
module: true,
|
|
106
103
|
scope: true,
|
|
107
104
|
tags: true,
|
|
108
105
|
};
|
|
@@ -143,7 +140,6 @@ async function handleGet(argv, prompter) {
|
|
|
143
140
|
values: true,
|
|
144
141
|
smartTags: true,
|
|
145
142
|
category: true,
|
|
146
|
-
module: true,
|
|
147
143
|
scope: true,
|
|
148
144
|
tags: true,
|
|
149
145
|
},
|
|
@@ -215,13 +211,6 @@ async function handleCreate(argv, prompter) {
|
|
|
215
211
|
required: false,
|
|
216
212
|
skipPrompt: true,
|
|
217
213
|
},
|
|
218
|
-
{
|
|
219
|
-
type: 'text',
|
|
220
|
-
name: 'module',
|
|
221
|
-
message: 'module',
|
|
222
|
-
required: false,
|
|
223
|
-
skipPrompt: true,
|
|
224
|
-
},
|
|
225
214
|
{
|
|
226
215
|
type: 'text',
|
|
227
216
|
name: 'scope',
|
|
@@ -251,7 +240,6 @@ async function handleCreate(argv, prompter) {
|
|
|
251
240
|
values: cleanedData.values,
|
|
252
241
|
smartTags: cleanedData.smartTags,
|
|
253
242
|
category: cleanedData.category,
|
|
254
|
-
module: cleanedData.module,
|
|
255
243
|
scope: cleanedData.scope,
|
|
256
244
|
tags: cleanedData.tags,
|
|
257
245
|
},
|
|
@@ -265,7 +253,6 @@ async function handleCreate(argv, prompter) {
|
|
|
265
253
|
values: true,
|
|
266
254
|
smartTags: true,
|
|
267
255
|
category: true,
|
|
268
|
-
module: true,
|
|
269
256
|
scope: true,
|
|
270
257
|
tags: true,
|
|
271
258
|
},
|
|
@@ -343,13 +330,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
343
330
|
required: false,
|
|
344
331
|
skipPrompt: true,
|
|
345
332
|
},
|
|
346
|
-
{
|
|
347
|
-
type: 'text',
|
|
348
|
-
name: 'module',
|
|
349
|
-
message: 'module',
|
|
350
|
-
required: false,
|
|
351
|
-
skipPrompt: true,
|
|
352
|
-
},
|
|
353
333
|
{
|
|
354
334
|
type: 'text',
|
|
355
335
|
name: 'scope',
|
|
@@ -382,7 +362,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
382
362
|
values: cleanedData.values,
|
|
383
363
|
smartTags: cleanedData.smartTags,
|
|
384
364
|
category: cleanedData.category,
|
|
385
|
-
module: cleanedData.module,
|
|
386
365
|
scope: cleanedData.scope,
|
|
387
366
|
tags: cleanedData.tags,
|
|
388
367
|
},
|
|
@@ -396,7 +375,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
396
375
|
values: true,
|
|
397
376
|
smartTags: true,
|
|
398
377
|
category: true,
|
|
399
|
-
module: true,
|
|
400
378
|
scope: true,
|
|
401
379
|
tags: true,
|
|
402
380
|
},
|
|
@@ -28,7 +28,6 @@ const fieldSchema = {
|
|
|
28
28
|
max: 'float',
|
|
29
29
|
tags: 'string',
|
|
30
30
|
category: 'string',
|
|
31
|
-
module: 'string',
|
|
32
31
|
scope: 'int',
|
|
33
32
|
createdAt: 'string',
|
|
34
33
|
updatedAt: 'string',
|
|
@@ -94,7 +93,6 @@ async function handleList(argv, _prompter) {
|
|
|
94
93
|
max: true,
|
|
95
94
|
tags: true,
|
|
96
95
|
category: true,
|
|
97
|
-
module: true,
|
|
98
96
|
scope: true,
|
|
99
97
|
createdAt: true,
|
|
100
98
|
updatedAt: true,
|
|
@@ -134,7 +132,6 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
134
132
|
max: true,
|
|
135
133
|
tags: true,
|
|
136
134
|
category: true,
|
|
137
|
-
module: true,
|
|
138
135
|
scope: true,
|
|
139
136
|
createdAt: true,
|
|
140
137
|
updatedAt: true,
|
|
@@ -186,7 +183,6 @@ async function handleGet(argv, prompter) {
|
|
|
186
183
|
max: true,
|
|
187
184
|
tags: true,
|
|
188
185
|
category: true,
|
|
189
|
-
module: true,
|
|
190
186
|
scope: true,
|
|
191
187
|
createdAt: true,
|
|
192
188
|
updatedAt: true,
|
|
@@ -329,13 +325,6 @@ async function handleCreate(argv, prompter) {
|
|
|
329
325
|
required: false,
|
|
330
326
|
skipPrompt: true,
|
|
331
327
|
},
|
|
332
|
-
{
|
|
333
|
-
type: 'text',
|
|
334
|
-
name: 'module',
|
|
335
|
-
message: 'module',
|
|
336
|
-
required: false,
|
|
337
|
-
skipPrompt: true,
|
|
338
|
-
},
|
|
339
328
|
{
|
|
340
329
|
type: 'text',
|
|
341
330
|
name: 'scope',
|
|
@@ -368,7 +357,6 @@ async function handleCreate(argv, prompter) {
|
|
|
368
357
|
max: cleanedData.max,
|
|
369
358
|
tags: cleanedData.tags,
|
|
370
359
|
category: cleanedData.category,
|
|
371
|
-
module: cleanedData.module,
|
|
372
360
|
scope: cleanedData.scope,
|
|
373
361
|
},
|
|
374
362
|
select: {
|
|
@@ -391,7 +379,6 @@ async function handleCreate(argv, prompter) {
|
|
|
391
379
|
max: true,
|
|
392
380
|
tags: true,
|
|
393
381
|
category: true,
|
|
394
|
-
module: true,
|
|
395
382
|
scope: true,
|
|
396
383
|
createdAt: true,
|
|
397
384
|
updatedAt: true,
|
|
@@ -540,13 +527,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
540
527
|
required: false,
|
|
541
528
|
skipPrompt: true,
|
|
542
529
|
},
|
|
543
|
-
{
|
|
544
|
-
type: 'text',
|
|
545
|
-
name: 'module',
|
|
546
|
-
message: 'module',
|
|
547
|
-
required: false,
|
|
548
|
-
skipPrompt: true,
|
|
549
|
-
},
|
|
550
530
|
{
|
|
551
531
|
type: 'text',
|
|
552
532
|
name: 'scope',
|
|
@@ -582,7 +562,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
582
562
|
max: cleanedData.max,
|
|
583
563
|
tags: cleanedData.tags,
|
|
584
564
|
category: cleanedData.category,
|
|
585
|
-
module: cleanedData.module,
|
|
586
565
|
scope: cleanedData.scope,
|
|
587
566
|
},
|
|
588
567
|
select: {
|
|
@@ -605,7 +584,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
605
584
|
max: true,
|
|
606
585
|
tags: true,
|
|
607
586
|
category: true,
|
|
608
|
-
module: true,
|
|
609
587
|
scope: true,
|
|
610
588
|
createdAt: true,
|
|
611
589
|
updatedAt: true,
|
|
@@ -22,7 +22,6 @@ const fieldSchema = {
|
|
|
22
22
|
deleteAction: 'string',
|
|
23
23
|
updateAction: 'string',
|
|
24
24
|
category: 'string',
|
|
25
|
-
module: 'string',
|
|
26
25
|
scope: 'int',
|
|
27
26
|
tags: 'string',
|
|
28
27
|
createdAt: 'string',
|
|
@@ -83,7 +82,6 @@ async function handleList(argv, _prompter) {
|
|
|
83
82
|
deleteAction: true,
|
|
84
83
|
updateAction: true,
|
|
85
84
|
category: true,
|
|
86
|
-
module: true,
|
|
87
85
|
scope: true,
|
|
88
86
|
tags: true,
|
|
89
87
|
createdAt: true,
|
|
@@ -118,7 +116,6 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
118
116
|
deleteAction: true,
|
|
119
117
|
updateAction: true,
|
|
120
118
|
category: true,
|
|
121
|
-
module: true,
|
|
122
119
|
scope: true,
|
|
123
120
|
tags: true,
|
|
124
121
|
createdAt: true,
|
|
@@ -165,7 +162,6 @@ async function handleGet(argv, prompter) {
|
|
|
165
162
|
deleteAction: true,
|
|
166
163
|
updateAction: true,
|
|
167
164
|
category: true,
|
|
168
|
-
module: true,
|
|
169
165
|
scope: true,
|
|
170
166
|
tags: true,
|
|
171
167
|
createdAt: true,
|
|
@@ -266,13 +262,6 @@ async function handleCreate(argv, prompter) {
|
|
|
266
262
|
required: false,
|
|
267
263
|
skipPrompt: true,
|
|
268
264
|
},
|
|
269
|
-
{
|
|
270
|
-
type: 'text',
|
|
271
|
-
name: 'module',
|
|
272
|
-
message: 'module',
|
|
273
|
-
required: false,
|
|
274
|
-
skipPrompt: true,
|
|
275
|
-
},
|
|
276
265
|
{
|
|
277
266
|
type: 'text',
|
|
278
267
|
name: 'scope',
|
|
@@ -306,7 +295,6 @@ async function handleCreate(argv, prompter) {
|
|
|
306
295
|
deleteAction: cleanedData.deleteAction,
|
|
307
296
|
updateAction: cleanedData.updateAction,
|
|
308
297
|
category: cleanedData.category,
|
|
309
|
-
module: cleanedData.module,
|
|
310
298
|
scope: cleanedData.scope,
|
|
311
299
|
tags: cleanedData.tags,
|
|
312
300
|
},
|
|
@@ -324,7 +312,6 @@ async function handleCreate(argv, prompter) {
|
|
|
324
312
|
deleteAction: true,
|
|
325
313
|
updateAction: true,
|
|
326
314
|
category: true,
|
|
327
|
-
module: true,
|
|
328
315
|
scope: true,
|
|
329
316
|
tags: true,
|
|
330
317
|
createdAt: true,
|
|
@@ -431,13 +418,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
431
418
|
required: false,
|
|
432
419
|
skipPrompt: true,
|
|
433
420
|
},
|
|
434
|
-
{
|
|
435
|
-
type: 'text',
|
|
436
|
-
name: 'module',
|
|
437
|
-
message: 'module',
|
|
438
|
-
required: false,
|
|
439
|
-
skipPrompt: true,
|
|
440
|
-
},
|
|
441
421
|
{
|
|
442
422
|
type: 'text',
|
|
443
423
|
name: 'scope',
|
|
@@ -474,7 +454,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
474
454
|
deleteAction: cleanedData.deleteAction,
|
|
475
455
|
updateAction: cleanedData.updateAction,
|
|
476
456
|
category: cleanedData.category,
|
|
477
|
-
module: cleanedData.module,
|
|
478
457
|
scope: cleanedData.scope,
|
|
479
458
|
tags: cleanedData.tags,
|
|
480
459
|
},
|
|
@@ -492,7 +471,6 @@ async function handleUpdate(argv, prompter) {
|
|
|
492
471
|
deleteAction: true,
|
|
493
472
|
updateAction: true,
|
|
494
473
|
category: true,
|
|
495
|
-
module: true,
|
|
496
474
|
scope: true,
|
|
497
475
|
tags: true,
|
|
498
476
|
createdAt: true,
|