@constructive-sdk/cli 0.17.1 → 0.17.3
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-invite.js +22 -0
- package/admin/cli/commands/app-limit-default.js +22 -0
- package/admin/cli/commands/{confirm-upload.d.ts → app-limit-event.d.ts} +1 -1
- package/admin/cli/commands/app-limit-event.js +212 -0
- package/admin/cli/commands/app-limit.js +66 -0
- package/admin/cli/commands/app-membership.js +0 -22
- package/admin/cli/commands/org-invite.js +22 -0
- package/{esm/admin/cli/commands/confirm-upload.d.ts → admin/cli/commands/org-limit-aggregate.d.ts} +1 -1
- package/admin/cli/commands/org-limit-aggregate.js +362 -0
- package/admin/cli/commands/org-limit-default.js +22 -0
- package/{auth/cli/commands/confirm-upload.d.ts → admin/cli/commands/org-limit-event.d.ts} +1 -1
- package/admin/cli/commands/org-limit-event.js +212 -0
- package/admin/cli/commands/org-limit.js +66 -0
- package/admin/cli/commands/org-membership-setting.js +44 -0
- package/admin/cli/commands.js +25 -21
- package/admin/cli/executor.d.ts +12 -14
- package/admin/orm/index.d.ts +24 -23
- package/admin/orm/index.js +24 -18
- package/admin/orm/input-types.d.ts +1297 -839
- package/admin/orm/models/appLimitEvent.d.ts +32 -0
- package/admin/orm/models/appLimitEvent.js +55 -0
- package/admin/orm/models/index.d.ts +12 -9
- package/admin/orm/models/index.js +25 -19
- package/admin/orm/models/orgLimitAggregate.d.ts +56 -0
- package/admin/orm/models/orgLimitAggregate.js +100 -0
- package/admin/orm/models/orgLimitEvent.d.ts +32 -0
- package/admin/orm/models/orgLimitEvent.js +55 -0
- package/admin/orm/mutation/index.d.ts +1 -15
- package/admin/orm/mutation/index.js +0 -12
- package/auth/cli/commands.js +1 -3
- package/auth/cli/executor.d.ts +0 -5
- package/auth/orm/index.d.ts +0 -5
- package/auth/orm/input-types.d.ts +0 -20
- package/auth/orm/mutation/index.d.ts +1 -15
- package/auth/orm/mutation/index.js +0 -12
- package/esm/admin/cli/commands/app-invite.js +22 -0
- package/esm/admin/cli/commands/app-limit-default.js +22 -0
- package/esm/{auth/cli/commands/confirm-upload.d.ts → admin/cli/commands/app-limit-event.d.ts} +1 -1
- package/esm/admin/cli/commands/app-limit-event.js +210 -0
- package/esm/admin/cli/commands/app-limit.js +66 -0
- package/esm/admin/cli/commands/app-membership.js +0 -22
- package/esm/admin/cli/commands/org-invite.js +22 -0
- package/esm/admin/cli/commands/org-limit-aggregate.d.ts +8 -0
- package/esm/admin/cli/commands/org-limit-aggregate.js +360 -0
- package/esm/admin/cli/commands/org-limit-default.js +22 -0
- package/esm/admin/cli/commands/org-limit-event.d.ts +8 -0
- package/esm/admin/cli/commands/org-limit-event.js +210 -0
- package/esm/admin/cli/commands/org-limit.js +66 -0
- package/esm/admin/cli/commands/org-membership-setting.js +44 -0
- package/esm/admin/cli/commands.js +25 -21
- package/esm/admin/cli/executor.d.ts +12 -14
- package/esm/admin/orm/index.d.ts +24 -23
- package/esm/admin/orm/index.js +24 -18
- package/esm/admin/orm/input-types.d.ts +1297 -839
- package/esm/admin/orm/models/appLimitEvent.d.ts +32 -0
- package/esm/admin/orm/models/appLimitEvent.js +51 -0
- package/esm/admin/orm/models/index.d.ts +12 -9
- package/esm/admin/orm/models/index.js +12 -9
- package/esm/admin/orm/models/orgLimitAggregate.d.ts +56 -0
- package/esm/admin/orm/models/orgLimitAggregate.js +96 -0
- package/esm/admin/orm/models/orgLimitEvent.d.ts +32 -0
- package/esm/admin/orm/models/orgLimitEvent.js +51 -0
- package/esm/admin/orm/mutation/index.d.ts +1 -15
- package/esm/admin/orm/mutation/index.js +0 -12
- package/esm/auth/cli/commands.js +1 -3
- package/esm/auth/cli/executor.d.ts +0 -5
- package/esm/auth/orm/index.d.ts +0 -5
- package/esm/auth/orm/input-types.d.ts +0 -20
- package/esm/auth/orm/mutation/index.d.ts +1 -15
- package/esm/auth/orm/mutation/index.js +0 -12
- package/esm/objects/cli/commands.js +1 -3
- package/esm/objects/cli/executor.d.ts +0 -5
- package/esm/objects/orm/index.d.ts +0 -5
- package/esm/objects/orm/input-types.d.ts +0 -20
- package/esm/objects/orm/mutation/index.d.ts +1 -15
- package/esm/objects/orm/mutation/index.js +0 -12
- package/esm/public/cli/commands/agent-message.d.ts +8 -0
- package/esm/public/cli/commands/agent-message.js +324 -0
- package/esm/public/cli/commands/agent-task.d.ts +8 -0
- package/esm/public/cli/commands/agent-task.js +368 -0
- package/esm/public/cli/commands/agent-thread.d.ts +8 -0
- package/esm/public/cli/commands/agent-thread.js +372 -0
- package/esm/public/cli/commands/app-invite.js +22 -0
- package/esm/public/cli/commands/app-limit-default.js +22 -0
- package/esm/public/cli/commands/app-limit-event.d.ts +8 -0
- package/esm/public/cli/commands/app-limit-event.js +210 -0
- package/esm/public/cli/commands/app-limit.js +66 -0
- package/esm/public/cli/commands/app-membership.js +0 -22
- package/esm/public/cli/commands/billing-module.d.ts +8 -0
- package/esm/public/cli/commands/billing-module.js +492 -0
- package/esm/public/cli/commands/limits-module.js +22 -0
- package/esm/public/cli/commands/node-type-registry.d.ts +8 -0
- package/esm/public/cli/commands/node-type-registry.js +343 -0
- package/esm/public/cli/commands/org-invite.js +22 -0
- package/esm/public/cli/commands/org-limit-aggregate.d.ts +8 -0
- package/esm/public/cli/commands/org-limit-aggregate.js +360 -0
- package/esm/public/cli/commands/org-limit-default.js +22 -0
- package/esm/public/cli/commands/org-limit-event.d.ts +8 -0
- package/esm/public/cli/commands/org-limit-event.js +210 -0
- package/esm/public/cli/commands/org-limit.js +66 -0
- package/esm/public/cli/commands/org-membership-setting.js +44 -0
- package/esm/public/cli/commands/plans-module.d.ts +8 -0
- package/esm/public/cli/commands/plans-module.js +426 -0
- package/esm/public/cli/commands/profiles-module.js +44 -0
- package/esm/public/cli/commands/storage-module.js +22 -44
- package/esm/public/cli/commands.js +45 -29
- package/esm/public/cli/executor.d.ts +38 -34
- package/esm/public/orm/index.d.ts +56 -43
- package/esm/public/orm/index.js +36 -18
- package/esm/public/orm/input-types.d.ts +2983 -1112
- package/esm/public/orm/input-types.js +9 -0
- package/esm/public/orm/models/agentMessage.d.ts +56 -0
- package/esm/public/orm/models/agentMessage.js +96 -0
- package/esm/public/orm/models/agentTask.d.ts +56 -0
- package/esm/public/orm/models/agentTask.js +96 -0
- package/esm/public/orm/models/agentThread.d.ts +56 -0
- package/esm/public/orm/models/agentThread.js +96 -0
- package/esm/public/orm/models/appLimitEvent.d.ts +32 -0
- package/esm/public/orm/models/appLimitEvent.js +51 -0
- package/esm/public/orm/models/billingModule.d.ts +56 -0
- package/esm/public/orm/models/billingModule.js +96 -0
- package/esm/public/orm/models/index.d.ts +18 -9
- package/esm/public/orm/models/index.js +18 -9
- package/esm/public/orm/models/nodeTypeRegistry.d.ts +56 -0
- package/esm/public/orm/models/nodeTypeRegistry.js +96 -0
- package/esm/public/orm/models/orgLimitAggregate.d.ts +56 -0
- package/esm/public/orm/models/orgLimitAggregate.js +96 -0
- package/esm/public/orm/models/orgLimitEvent.d.ts +32 -0
- package/esm/public/orm/models/orgLimitEvent.js +51 -0
- package/esm/public/orm/models/plansModule.d.ts +56 -0
- package/esm/public/orm/models/plansModule.js +96 -0
- package/esm/public/orm/mutation/index.d.ts +17 -31
- package/esm/public/orm/mutation/index.js +24 -36
- package/esm/public/orm/query/index.d.ts +28 -28
- package/esm/public/orm/query/index.js +48 -48
- package/objects/cli/commands.js +1 -3
- package/objects/cli/executor.d.ts +0 -5
- package/objects/orm/index.d.ts +0 -5
- package/objects/orm/input-types.d.ts +0 -20
- package/objects/orm/mutation/index.d.ts +1 -15
- package/objects/orm/mutation/index.js +0 -12
- package/package.json +4 -4
- package/public/cli/commands/agent-message.d.ts +8 -0
- package/public/cli/commands/agent-message.js +326 -0
- package/public/cli/commands/agent-task.d.ts +8 -0
- package/public/cli/commands/agent-task.js +370 -0
- package/public/cli/commands/agent-thread.d.ts +8 -0
- package/public/cli/commands/agent-thread.js +374 -0
- package/public/cli/commands/app-invite.js +22 -0
- package/public/cli/commands/app-limit-default.js +22 -0
- package/public/cli/commands/app-limit-event.d.ts +8 -0
- package/public/cli/commands/app-limit-event.js +212 -0
- package/public/cli/commands/app-limit.js +66 -0
- package/public/cli/commands/app-membership.js +0 -22
- package/public/cli/commands/billing-module.d.ts +8 -0
- package/public/cli/commands/billing-module.js +494 -0
- package/public/cli/commands/limits-module.js +22 -0
- package/public/cli/commands/node-type-registry.d.ts +8 -0
- package/public/cli/commands/node-type-registry.js +345 -0
- package/public/cli/commands/org-invite.js +22 -0
- package/public/cli/commands/org-limit-aggregate.d.ts +8 -0
- package/public/cli/commands/org-limit-aggregate.js +362 -0
- package/public/cli/commands/org-limit-default.js +22 -0
- package/public/cli/commands/org-limit-event.d.ts +8 -0
- package/public/cli/commands/org-limit-event.js +212 -0
- package/public/cli/commands/org-limit.js +66 -0
- package/public/cli/commands/org-membership-setting.js +44 -0
- package/public/cli/commands/plans-module.d.ts +8 -0
- package/public/cli/commands/plans-module.js +428 -0
- package/public/cli/commands/profiles-module.js +44 -0
- package/public/cli/commands/storage-module.js +22 -44
- package/public/cli/commands.js +45 -29
- package/public/cli/executor.d.ts +38 -34
- package/public/orm/index.d.ts +56 -43
- package/public/orm/index.js +36 -18
- package/public/orm/input-types.d.ts +2983 -1112
- package/public/orm/input-types.js +9 -0
- package/public/orm/models/agentMessage.d.ts +56 -0
- package/public/orm/models/agentMessage.js +100 -0
- package/public/orm/models/agentTask.d.ts +56 -0
- package/public/orm/models/agentTask.js +100 -0
- package/public/orm/models/agentThread.d.ts +56 -0
- package/public/orm/models/agentThread.js +100 -0
- package/public/orm/models/appLimitEvent.d.ts +32 -0
- package/public/orm/models/appLimitEvent.js +55 -0
- package/public/orm/models/billingModule.d.ts +56 -0
- package/public/orm/models/billingModule.js +100 -0
- package/public/orm/models/index.d.ts +18 -9
- package/public/orm/models/index.js +39 -21
- package/public/orm/models/nodeTypeRegistry.d.ts +56 -0
- package/public/orm/models/nodeTypeRegistry.js +100 -0
- package/public/orm/models/orgLimitAggregate.d.ts +56 -0
- package/public/orm/models/orgLimitAggregate.js +100 -0
- package/public/orm/models/orgLimitEvent.d.ts +32 -0
- package/public/orm/models/orgLimitEvent.js +55 -0
- package/public/orm/models/plansModule.d.ts +56 -0
- package/public/orm/models/plansModule.js +100 -0
- package/public/orm/mutation/index.d.ts +17 -31
- package/public/orm/mutation/index.js +24 -36
- package/public/orm/query/index.d.ts +28 -28
- package/public/orm/query/index.js +48 -48
- package/admin/cli/commands/confirm-upload.js +0 -36
- package/auth/cli/commands/confirm-upload.js +0 -36
- package/esm/admin/cli/commands/confirm-upload.js +0 -34
- package/esm/auth/cli/commands/confirm-upload.js +0 -34
- package/esm/objects/cli/commands/confirm-upload.d.ts +0 -8
- package/esm/objects/cli/commands/confirm-upload.js +0 -34
- package/esm/public/cli/commands/confirm-upload.d.ts +0 -8
- package/esm/public/cli/commands/confirm-upload.js +0 -34
- package/objects/cli/commands/confirm-upload.d.ts +0 -8
- package/objects/cli/commands/confirm-upload.js +0 -36
- package/public/cli/commands/confirm-upload.d.ts +0 -8
- package/public/cli/commands/confirm-upload.js +0 -36
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for NodeTypeRegistry
|
|
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
|
+
name: 'string',
|
|
11
|
+
slug: 'string',
|
|
12
|
+
category: 'string',
|
|
13
|
+
displayName: 'string',
|
|
14
|
+
description: 'string',
|
|
15
|
+
parameterSchema: 'json',
|
|
16
|
+
tags: 'string',
|
|
17
|
+
};
|
|
18
|
+
const usage = '\nnode-type-registry <command>\n\nCommands:\n list List nodeTypeRegistry records\n find-first Find first matching nodeTypeRegistry record\n get Get a nodeTypeRegistry by ID\n create Create a new nodeTypeRegistry\n update Update an existing nodeTypeRegistry\n delete Delete a nodeTypeRegistry\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
|
|
19
|
+
export default async (argv, prompter, _options) => {
|
|
20
|
+
if (argv.help || argv.h) {
|
|
21
|
+
console.log(usage);
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
25
|
+
if (!subcommand) {
|
|
26
|
+
const answer = await prompter.prompt(argv, [
|
|
27
|
+
{
|
|
28
|
+
type: 'autocomplete',
|
|
29
|
+
name: 'subcommand',
|
|
30
|
+
message: 'What do you want to do?',
|
|
31
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
32
|
+
},
|
|
33
|
+
]);
|
|
34
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
35
|
+
}
|
|
36
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
37
|
+
};
|
|
38
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
39
|
+
switch (subcommand) {
|
|
40
|
+
case 'list':
|
|
41
|
+
return handleList(argv, prompter);
|
|
42
|
+
case 'find-first':
|
|
43
|
+
return handleFindFirst(argv, prompter);
|
|
44
|
+
case 'get':
|
|
45
|
+
return handleGet(argv, prompter);
|
|
46
|
+
case 'create':
|
|
47
|
+
return handleCreate(argv, prompter);
|
|
48
|
+
case 'update':
|
|
49
|
+
return handleUpdate(argv, prompter);
|
|
50
|
+
case 'delete':
|
|
51
|
+
return handleDelete(argv, prompter);
|
|
52
|
+
default:
|
|
53
|
+
console.log(usage);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function handleList(argv, _prompter) {
|
|
58
|
+
try {
|
|
59
|
+
const defaultSelect = {
|
|
60
|
+
name: true,
|
|
61
|
+
slug: true,
|
|
62
|
+
category: true,
|
|
63
|
+
displayName: true,
|
|
64
|
+
description: true,
|
|
65
|
+
parameterSchema: true,
|
|
66
|
+
tags: true,
|
|
67
|
+
};
|
|
68
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
69
|
+
const client = getClient();
|
|
70
|
+
const result = await client.nodeTypeRegistry.findMany(findManyArgs).execute();
|
|
71
|
+
console.log(JSON.stringify(result, null, 2));
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.error('Failed to list records.');
|
|
75
|
+
if (error instanceof Error) {
|
|
76
|
+
console.error(error.message);
|
|
77
|
+
}
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function handleFindFirst(argv, _prompter) {
|
|
82
|
+
try {
|
|
83
|
+
const defaultSelect = {
|
|
84
|
+
name: true,
|
|
85
|
+
slug: true,
|
|
86
|
+
category: true,
|
|
87
|
+
displayName: true,
|
|
88
|
+
description: true,
|
|
89
|
+
parameterSchema: true,
|
|
90
|
+
tags: true,
|
|
91
|
+
};
|
|
92
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
93
|
+
const client = getClient();
|
|
94
|
+
const result = await client.nodeTypeRegistry.findFirst(findFirstArgs).execute();
|
|
95
|
+
console.log(JSON.stringify(result, null, 2));
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
console.error('Failed to find record.');
|
|
99
|
+
if (error instanceof Error) {
|
|
100
|
+
console.error(error.message);
|
|
101
|
+
}
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async function handleGet(argv, prompter) {
|
|
106
|
+
try {
|
|
107
|
+
const answers = await prompter.prompt(argv, [
|
|
108
|
+
{
|
|
109
|
+
type: 'text',
|
|
110
|
+
name: 'name',
|
|
111
|
+
message: 'name',
|
|
112
|
+
required: true,
|
|
113
|
+
},
|
|
114
|
+
]);
|
|
115
|
+
const client = getClient();
|
|
116
|
+
const result = await client.nodeTypeRegistry
|
|
117
|
+
.findOne({
|
|
118
|
+
name: answers.name,
|
|
119
|
+
select: {
|
|
120
|
+
name: true,
|
|
121
|
+
slug: true,
|
|
122
|
+
category: true,
|
|
123
|
+
displayName: true,
|
|
124
|
+
description: true,
|
|
125
|
+
parameterSchema: true,
|
|
126
|
+
tags: true,
|
|
127
|
+
},
|
|
128
|
+
})
|
|
129
|
+
.execute();
|
|
130
|
+
console.log(JSON.stringify(result, null, 2));
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
console.error('Record not found.');
|
|
134
|
+
if (error instanceof Error) {
|
|
135
|
+
console.error(error.message);
|
|
136
|
+
}
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async function handleCreate(argv, prompter) {
|
|
141
|
+
try {
|
|
142
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
143
|
+
{
|
|
144
|
+
type: 'text',
|
|
145
|
+
name: 'name',
|
|
146
|
+
message: 'name',
|
|
147
|
+
required: true,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
type: 'text',
|
|
151
|
+
name: 'slug',
|
|
152
|
+
message: 'slug',
|
|
153
|
+
required: true,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
type: 'text',
|
|
157
|
+
name: 'category',
|
|
158
|
+
message: 'category',
|
|
159
|
+
required: true,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
type: 'text',
|
|
163
|
+
name: 'displayName',
|
|
164
|
+
message: 'displayName',
|
|
165
|
+
required: false,
|
|
166
|
+
skipPrompt: true,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: 'text',
|
|
170
|
+
name: 'description',
|
|
171
|
+
message: 'description',
|
|
172
|
+
required: false,
|
|
173
|
+
skipPrompt: true,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: 'json',
|
|
177
|
+
name: 'parameterSchema',
|
|
178
|
+
message: 'parameterSchema',
|
|
179
|
+
required: false,
|
|
180
|
+
skipPrompt: true,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
type: 'text',
|
|
184
|
+
name: 'tags',
|
|
185
|
+
message: 'tags',
|
|
186
|
+
required: false,
|
|
187
|
+
skipPrompt: true,
|
|
188
|
+
},
|
|
189
|
+
]);
|
|
190
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
191
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
192
|
+
const client = getClient();
|
|
193
|
+
const result = await client.nodeTypeRegistry
|
|
194
|
+
.create({
|
|
195
|
+
data: {
|
|
196
|
+
name: cleanedData.name,
|
|
197
|
+
slug: cleanedData.slug,
|
|
198
|
+
category: cleanedData.category,
|
|
199
|
+
displayName: cleanedData.displayName,
|
|
200
|
+
description: cleanedData.description,
|
|
201
|
+
parameterSchema: cleanedData.parameterSchema,
|
|
202
|
+
tags: cleanedData.tags,
|
|
203
|
+
},
|
|
204
|
+
select: {
|
|
205
|
+
name: true,
|
|
206
|
+
slug: true,
|
|
207
|
+
category: true,
|
|
208
|
+
displayName: true,
|
|
209
|
+
description: true,
|
|
210
|
+
parameterSchema: true,
|
|
211
|
+
tags: true,
|
|
212
|
+
},
|
|
213
|
+
})
|
|
214
|
+
.execute();
|
|
215
|
+
console.log(JSON.stringify(result, null, 2));
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
console.error('Failed to create record.');
|
|
219
|
+
if (error instanceof Error) {
|
|
220
|
+
console.error(error.message);
|
|
221
|
+
}
|
|
222
|
+
process.exit(1);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
async function handleUpdate(argv, prompter) {
|
|
226
|
+
try {
|
|
227
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
228
|
+
{
|
|
229
|
+
type: 'text',
|
|
230
|
+
name: 'name',
|
|
231
|
+
message: 'name',
|
|
232
|
+
required: true,
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type: 'text',
|
|
236
|
+
name: 'slug',
|
|
237
|
+
message: 'slug',
|
|
238
|
+
required: false,
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
type: 'text',
|
|
242
|
+
name: 'category',
|
|
243
|
+
message: 'category',
|
|
244
|
+
required: false,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
type: 'text',
|
|
248
|
+
name: 'displayName',
|
|
249
|
+
message: 'displayName',
|
|
250
|
+
required: false,
|
|
251
|
+
skipPrompt: true,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
type: 'text',
|
|
255
|
+
name: 'description',
|
|
256
|
+
message: 'description',
|
|
257
|
+
required: false,
|
|
258
|
+
skipPrompt: true,
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
type: 'json',
|
|
262
|
+
name: 'parameterSchema',
|
|
263
|
+
message: 'parameterSchema',
|
|
264
|
+
required: false,
|
|
265
|
+
skipPrompt: true,
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: 'text',
|
|
269
|
+
name: 'tags',
|
|
270
|
+
message: 'tags',
|
|
271
|
+
required: false,
|
|
272
|
+
skipPrompt: true,
|
|
273
|
+
},
|
|
274
|
+
]);
|
|
275
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
276
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
277
|
+
const client = getClient();
|
|
278
|
+
const result = await client.nodeTypeRegistry
|
|
279
|
+
.update({
|
|
280
|
+
where: {
|
|
281
|
+
name: answers.name,
|
|
282
|
+
},
|
|
283
|
+
data: {
|
|
284
|
+
slug: cleanedData.slug,
|
|
285
|
+
category: cleanedData.category,
|
|
286
|
+
displayName: cleanedData.displayName,
|
|
287
|
+
description: cleanedData.description,
|
|
288
|
+
parameterSchema: cleanedData.parameterSchema,
|
|
289
|
+
tags: cleanedData.tags,
|
|
290
|
+
},
|
|
291
|
+
select: {
|
|
292
|
+
name: true,
|
|
293
|
+
slug: true,
|
|
294
|
+
category: true,
|
|
295
|
+
displayName: true,
|
|
296
|
+
description: true,
|
|
297
|
+
parameterSchema: true,
|
|
298
|
+
tags: true,
|
|
299
|
+
},
|
|
300
|
+
})
|
|
301
|
+
.execute();
|
|
302
|
+
console.log(JSON.stringify(result, null, 2));
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
console.error('Failed to update record.');
|
|
306
|
+
if (error instanceof Error) {
|
|
307
|
+
console.error(error.message);
|
|
308
|
+
}
|
|
309
|
+
process.exit(1);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
async function handleDelete(argv, prompter) {
|
|
313
|
+
try {
|
|
314
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
315
|
+
{
|
|
316
|
+
type: 'text',
|
|
317
|
+
name: 'name',
|
|
318
|
+
message: 'name',
|
|
319
|
+
required: true,
|
|
320
|
+
},
|
|
321
|
+
]);
|
|
322
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
323
|
+
const client = getClient();
|
|
324
|
+
const result = await client.nodeTypeRegistry
|
|
325
|
+
.delete({
|
|
326
|
+
where: {
|
|
327
|
+
name: answers.name,
|
|
328
|
+
},
|
|
329
|
+
select: {
|
|
330
|
+
name: true,
|
|
331
|
+
},
|
|
332
|
+
})
|
|
333
|
+
.execute();
|
|
334
|
+
console.log(JSON.stringify(result, null, 2));
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
console.error('Failed to delete record.');
|
|
338
|
+
if (error instanceof Error) {
|
|
339
|
+
console.error(error.message);
|
|
340
|
+
}
|
|
341
|
+
process.exit(1);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
@@ -17,6 +17,7 @@ const fieldSchema = {
|
|
|
17
17
|
inviteCount: 'int',
|
|
18
18
|
multiple: 'boolean',
|
|
19
19
|
data: 'json',
|
|
20
|
+
profileId: 'uuid',
|
|
20
21
|
expiresAt: 'string',
|
|
21
22
|
createdAt: 'string',
|
|
22
23
|
updatedAt: 'string',
|
|
@@ -74,6 +75,7 @@ async function handleList(argv, _prompter) {
|
|
|
74
75
|
inviteCount: true,
|
|
75
76
|
multiple: true,
|
|
76
77
|
data: true,
|
|
78
|
+
profileId: true,
|
|
77
79
|
expiresAt: true,
|
|
78
80
|
createdAt: true,
|
|
79
81
|
updatedAt: true,
|
|
@@ -105,6 +107,7 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
105
107
|
inviteCount: true,
|
|
106
108
|
multiple: true,
|
|
107
109
|
data: true,
|
|
110
|
+
profileId: true,
|
|
108
111
|
expiresAt: true,
|
|
109
112
|
createdAt: true,
|
|
110
113
|
updatedAt: true,
|
|
@@ -148,6 +151,7 @@ async function handleGet(argv, prompter) {
|
|
|
148
151
|
inviteCount: true,
|
|
149
152
|
multiple: true,
|
|
150
153
|
data: true,
|
|
154
|
+
profileId: true,
|
|
151
155
|
expiresAt: true,
|
|
152
156
|
createdAt: true,
|
|
153
157
|
updatedAt: true,
|
|
@@ -231,6 +235,13 @@ async function handleCreate(argv, prompter) {
|
|
|
231
235
|
required: false,
|
|
232
236
|
skipPrompt: true,
|
|
233
237
|
},
|
|
238
|
+
{
|
|
239
|
+
type: 'text',
|
|
240
|
+
name: 'profileId',
|
|
241
|
+
message: 'profileId',
|
|
242
|
+
required: false,
|
|
243
|
+
skipPrompt: true,
|
|
244
|
+
},
|
|
234
245
|
{
|
|
235
246
|
type: 'text',
|
|
236
247
|
name: 'expiresAt',
|
|
@@ -260,6 +271,7 @@ async function handleCreate(argv, prompter) {
|
|
|
260
271
|
inviteCount: cleanedData.inviteCount,
|
|
261
272
|
multiple: cleanedData.multiple,
|
|
262
273
|
data: cleanedData.data,
|
|
274
|
+
profileId: cleanedData.profileId,
|
|
263
275
|
expiresAt: cleanedData.expiresAt,
|
|
264
276
|
entityId: cleanedData.entityId,
|
|
265
277
|
},
|
|
@@ -274,6 +286,7 @@ async function handleCreate(argv, prompter) {
|
|
|
274
286
|
inviteCount: true,
|
|
275
287
|
multiple: true,
|
|
276
288
|
data: true,
|
|
289
|
+
profileId: true,
|
|
277
290
|
expiresAt: true,
|
|
278
291
|
createdAt: true,
|
|
279
292
|
updatedAt: true,
|
|
@@ -363,6 +376,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
363
376
|
required: false,
|
|
364
377
|
skipPrompt: true,
|
|
365
378
|
},
|
|
379
|
+
{
|
|
380
|
+
type: 'text',
|
|
381
|
+
name: 'profileId',
|
|
382
|
+
message: 'profileId',
|
|
383
|
+
required: false,
|
|
384
|
+
skipPrompt: true,
|
|
385
|
+
},
|
|
366
386
|
{
|
|
367
387
|
type: 'text',
|
|
368
388
|
name: 'expiresAt',
|
|
@@ -395,6 +415,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
395
415
|
inviteCount: cleanedData.inviteCount,
|
|
396
416
|
multiple: cleanedData.multiple,
|
|
397
417
|
data: cleanedData.data,
|
|
418
|
+
profileId: cleanedData.profileId,
|
|
398
419
|
expiresAt: cleanedData.expiresAt,
|
|
399
420
|
entityId: cleanedData.entityId,
|
|
400
421
|
},
|
|
@@ -409,6 +430,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
409
430
|
inviteCount: true,
|
|
410
431
|
multiple: true,
|
|
411
432
|
data: true,
|
|
433
|
+
profileId: true,
|
|
412
434
|
expiresAt: true,
|
|
413
435
|
createdAt: true,
|
|
414
436
|
updatedAt: true,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for OrgLimitAggregate
|
|
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;
|