@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,345 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* CLI commands for NodeTypeRegistry
|
|
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
|
+
name: 'string',
|
|
13
|
+
slug: 'string',
|
|
14
|
+
category: 'string',
|
|
15
|
+
displayName: 'string',
|
|
16
|
+
description: 'string',
|
|
17
|
+
parameterSchema: 'json',
|
|
18
|
+
tags: 'string',
|
|
19
|
+
};
|
|
20
|
+
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';
|
|
21
|
+
exports.default = async (argv, prompter, _options) => {
|
|
22
|
+
if (argv.help || argv.h) {
|
|
23
|
+
console.log(usage);
|
|
24
|
+
process.exit(0);
|
|
25
|
+
}
|
|
26
|
+
const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
|
|
27
|
+
if (!subcommand) {
|
|
28
|
+
const answer = await prompter.prompt(argv, [
|
|
29
|
+
{
|
|
30
|
+
type: 'autocomplete',
|
|
31
|
+
name: 'subcommand',
|
|
32
|
+
message: 'What do you want to do?',
|
|
33
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
34
|
+
},
|
|
35
|
+
]);
|
|
36
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
37
|
+
}
|
|
38
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
39
|
+
};
|
|
40
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
41
|
+
switch (subcommand) {
|
|
42
|
+
case 'list':
|
|
43
|
+
return handleList(argv, prompter);
|
|
44
|
+
case 'find-first':
|
|
45
|
+
return handleFindFirst(argv, prompter);
|
|
46
|
+
case 'get':
|
|
47
|
+
return handleGet(argv, prompter);
|
|
48
|
+
case 'create':
|
|
49
|
+
return handleCreate(argv, prompter);
|
|
50
|
+
case 'update':
|
|
51
|
+
return handleUpdate(argv, prompter);
|
|
52
|
+
case 'delete':
|
|
53
|
+
return handleDelete(argv, prompter);
|
|
54
|
+
default:
|
|
55
|
+
console.log(usage);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function handleList(argv, _prompter) {
|
|
60
|
+
try {
|
|
61
|
+
const defaultSelect = {
|
|
62
|
+
name: true,
|
|
63
|
+
slug: true,
|
|
64
|
+
category: true,
|
|
65
|
+
displayName: true,
|
|
66
|
+
description: true,
|
|
67
|
+
parameterSchema: true,
|
|
68
|
+
tags: true,
|
|
69
|
+
};
|
|
70
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
71
|
+
const client = (0, executor_1.getClient)();
|
|
72
|
+
const result = await client.nodeTypeRegistry.findMany(findManyArgs).execute();
|
|
73
|
+
console.log(JSON.stringify(result, null, 2));
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error('Failed to list records.');
|
|
77
|
+
if (error instanceof Error) {
|
|
78
|
+
console.error(error.message);
|
|
79
|
+
}
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async function handleFindFirst(argv, _prompter) {
|
|
84
|
+
try {
|
|
85
|
+
const defaultSelect = {
|
|
86
|
+
name: true,
|
|
87
|
+
slug: true,
|
|
88
|
+
category: true,
|
|
89
|
+
displayName: true,
|
|
90
|
+
description: true,
|
|
91
|
+
parameterSchema: true,
|
|
92
|
+
tags: true,
|
|
93
|
+
};
|
|
94
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
95
|
+
const client = (0, executor_1.getClient)();
|
|
96
|
+
const result = await client.nodeTypeRegistry.findFirst(findFirstArgs).execute();
|
|
97
|
+
console.log(JSON.stringify(result, null, 2));
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
console.error('Failed to find record.');
|
|
101
|
+
if (error instanceof Error) {
|
|
102
|
+
console.error(error.message);
|
|
103
|
+
}
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async function handleGet(argv, prompter) {
|
|
108
|
+
try {
|
|
109
|
+
const answers = await prompter.prompt(argv, [
|
|
110
|
+
{
|
|
111
|
+
type: 'text',
|
|
112
|
+
name: 'name',
|
|
113
|
+
message: 'name',
|
|
114
|
+
required: true,
|
|
115
|
+
},
|
|
116
|
+
]);
|
|
117
|
+
const client = (0, executor_1.getClient)();
|
|
118
|
+
const result = await client.nodeTypeRegistry
|
|
119
|
+
.findOne({
|
|
120
|
+
name: answers.name,
|
|
121
|
+
select: {
|
|
122
|
+
name: true,
|
|
123
|
+
slug: true,
|
|
124
|
+
category: true,
|
|
125
|
+
displayName: true,
|
|
126
|
+
description: true,
|
|
127
|
+
parameterSchema: true,
|
|
128
|
+
tags: true,
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
.execute();
|
|
132
|
+
console.log(JSON.stringify(result, null, 2));
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
console.error('Record not found.');
|
|
136
|
+
if (error instanceof Error) {
|
|
137
|
+
console.error(error.message);
|
|
138
|
+
}
|
|
139
|
+
process.exit(1);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async function handleCreate(argv, prompter) {
|
|
143
|
+
try {
|
|
144
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
145
|
+
{
|
|
146
|
+
type: 'text',
|
|
147
|
+
name: 'name',
|
|
148
|
+
message: 'name',
|
|
149
|
+
required: true,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
type: 'text',
|
|
153
|
+
name: 'slug',
|
|
154
|
+
message: 'slug',
|
|
155
|
+
required: true,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
type: 'text',
|
|
159
|
+
name: 'category',
|
|
160
|
+
message: 'category',
|
|
161
|
+
required: true,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
type: 'text',
|
|
165
|
+
name: 'displayName',
|
|
166
|
+
message: 'displayName',
|
|
167
|
+
required: false,
|
|
168
|
+
skipPrompt: true,
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
type: 'text',
|
|
172
|
+
name: 'description',
|
|
173
|
+
message: 'description',
|
|
174
|
+
required: false,
|
|
175
|
+
skipPrompt: true,
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
type: 'json',
|
|
179
|
+
name: 'parameterSchema',
|
|
180
|
+
message: 'parameterSchema',
|
|
181
|
+
required: false,
|
|
182
|
+
skipPrompt: true,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'text',
|
|
186
|
+
name: 'tags',
|
|
187
|
+
message: 'tags',
|
|
188
|
+
required: false,
|
|
189
|
+
skipPrompt: true,
|
|
190
|
+
},
|
|
191
|
+
]);
|
|
192
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
193
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
194
|
+
const client = (0, executor_1.getClient)();
|
|
195
|
+
const result = await client.nodeTypeRegistry
|
|
196
|
+
.create({
|
|
197
|
+
data: {
|
|
198
|
+
name: cleanedData.name,
|
|
199
|
+
slug: cleanedData.slug,
|
|
200
|
+
category: cleanedData.category,
|
|
201
|
+
displayName: cleanedData.displayName,
|
|
202
|
+
description: cleanedData.description,
|
|
203
|
+
parameterSchema: cleanedData.parameterSchema,
|
|
204
|
+
tags: cleanedData.tags,
|
|
205
|
+
},
|
|
206
|
+
select: {
|
|
207
|
+
name: true,
|
|
208
|
+
slug: true,
|
|
209
|
+
category: true,
|
|
210
|
+
displayName: true,
|
|
211
|
+
description: true,
|
|
212
|
+
parameterSchema: true,
|
|
213
|
+
tags: true,
|
|
214
|
+
},
|
|
215
|
+
})
|
|
216
|
+
.execute();
|
|
217
|
+
console.log(JSON.stringify(result, null, 2));
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
console.error('Failed to create record.');
|
|
221
|
+
if (error instanceof Error) {
|
|
222
|
+
console.error(error.message);
|
|
223
|
+
}
|
|
224
|
+
process.exit(1);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
async function handleUpdate(argv, prompter) {
|
|
228
|
+
try {
|
|
229
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
230
|
+
{
|
|
231
|
+
type: 'text',
|
|
232
|
+
name: 'name',
|
|
233
|
+
message: 'name',
|
|
234
|
+
required: true,
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
type: 'text',
|
|
238
|
+
name: 'slug',
|
|
239
|
+
message: 'slug',
|
|
240
|
+
required: false,
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
type: 'text',
|
|
244
|
+
name: 'category',
|
|
245
|
+
message: 'category',
|
|
246
|
+
required: false,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
type: 'text',
|
|
250
|
+
name: 'displayName',
|
|
251
|
+
message: 'displayName',
|
|
252
|
+
required: false,
|
|
253
|
+
skipPrompt: true,
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
type: 'text',
|
|
257
|
+
name: 'description',
|
|
258
|
+
message: 'description',
|
|
259
|
+
required: false,
|
|
260
|
+
skipPrompt: true,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
type: 'json',
|
|
264
|
+
name: 'parameterSchema',
|
|
265
|
+
message: 'parameterSchema',
|
|
266
|
+
required: false,
|
|
267
|
+
skipPrompt: true,
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
type: 'text',
|
|
271
|
+
name: 'tags',
|
|
272
|
+
message: 'tags',
|
|
273
|
+
required: false,
|
|
274
|
+
skipPrompt: true,
|
|
275
|
+
},
|
|
276
|
+
]);
|
|
277
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
278
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
279
|
+
const client = (0, executor_1.getClient)();
|
|
280
|
+
const result = await client.nodeTypeRegistry
|
|
281
|
+
.update({
|
|
282
|
+
where: {
|
|
283
|
+
name: answers.name,
|
|
284
|
+
},
|
|
285
|
+
data: {
|
|
286
|
+
slug: cleanedData.slug,
|
|
287
|
+
category: cleanedData.category,
|
|
288
|
+
displayName: cleanedData.displayName,
|
|
289
|
+
description: cleanedData.description,
|
|
290
|
+
parameterSchema: cleanedData.parameterSchema,
|
|
291
|
+
tags: cleanedData.tags,
|
|
292
|
+
},
|
|
293
|
+
select: {
|
|
294
|
+
name: true,
|
|
295
|
+
slug: true,
|
|
296
|
+
category: true,
|
|
297
|
+
displayName: true,
|
|
298
|
+
description: true,
|
|
299
|
+
parameterSchema: true,
|
|
300
|
+
tags: true,
|
|
301
|
+
},
|
|
302
|
+
})
|
|
303
|
+
.execute();
|
|
304
|
+
console.log(JSON.stringify(result, null, 2));
|
|
305
|
+
}
|
|
306
|
+
catch (error) {
|
|
307
|
+
console.error('Failed to update record.');
|
|
308
|
+
if (error instanceof Error) {
|
|
309
|
+
console.error(error.message);
|
|
310
|
+
}
|
|
311
|
+
process.exit(1);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
async function handleDelete(argv, prompter) {
|
|
315
|
+
try {
|
|
316
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
317
|
+
{
|
|
318
|
+
type: 'text',
|
|
319
|
+
name: 'name',
|
|
320
|
+
message: 'name',
|
|
321
|
+
required: true,
|
|
322
|
+
},
|
|
323
|
+
]);
|
|
324
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
325
|
+
const client = (0, executor_1.getClient)();
|
|
326
|
+
const result = await client.nodeTypeRegistry
|
|
327
|
+
.delete({
|
|
328
|
+
where: {
|
|
329
|
+
name: answers.name,
|
|
330
|
+
},
|
|
331
|
+
select: {
|
|
332
|
+
name: true,
|
|
333
|
+
},
|
|
334
|
+
})
|
|
335
|
+
.execute();
|
|
336
|
+
console.log(JSON.stringify(result, null, 2));
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
console.error('Failed to delete record.');
|
|
340
|
+
if (error instanceof Error) {
|
|
341
|
+
console.error(error.message);
|
|
342
|
+
}
|
|
343
|
+
process.exit(1);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
@@ -19,6 +19,7 @@ const fieldSchema = {
|
|
|
19
19
|
inviteCount: 'int',
|
|
20
20
|
multiple: 'boolean',
|
|
21
21
|
data: 'json',
|
|
22
|
+
profileId: 'uuid',
|
|
22
23
|
expiresAt: 'string',
|
|
23
24
|
createdAt: 'string',
|
|
24
25
|
updatedAt: 'string',
|
|
@@ -76,6 +77,7 @@ async function handleList(argv, _prompter) {
|
|
|
76
77
|
inviteCount: true,
|
|
77
78
|
multiple: true,
|
|
78
79
|
data: true,
|
|
80
|
+
profileId: true,
|
|
79
81
|
expiresAt: true,
|
|
80
82
|
createdAt: true,
|
|
81
83
|
updatedAt: true,
|
|
@@ -107,6 +109,7 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
107
109
|
inviteCount: true,
|
|
108
110
|
multiple: true,
|
|
109
111
|
data: true,
|
|
112
|
+
profileId: true,
|
|
110
113
|
expiresAt: true,
|
|
111
114
|
createdAt: true,
|
|
112
115
|
updatedAt: true,
|
|
@@ -150,6 +153,7 @@ async function handleGet(argv, prompter) {
|
|
|
150
153
|
inviteCount: true,
|
|
151
154
|
multiple: true,
|
|
152
155
|
data: true,
|
|
156
|
+
profileId: true,
|
|
153
157
|
expiresAt: true,
|
|
154
158
|
createdAt: true,
|
|
155
159
|
updatedAt: true,
|
|
@@ -233,6 +237,13 @@ async function handleCreate(argv, prompter) {
|
|
|
233
237
|
required: false,
|
|
234
238
|
skipPrompt: true,
|
|
235
239
|
},
|
|
240
|
+
{
|
|
241
|
+
type: 'text',
|
|
242
|
+
name: 'profileId',
|
|
243
|
+
message: 'profileId',
|
|
244
|
+
required: false,
|
|
245
|
+
skipPrompt: true,
|
|
246
|
+
},
|
|
236
247
|
{
|
|
237
248
|
type: 'text',
|
|
238
249
|
name: 'expiresAt',
|
|
@@ -262,6 +273,7 @@ async function handleCreate(argv, prompter) {
|
|
|
262
273
|
inviteCount: cleanedData.inviteCount,
|
|
263
274
|
multiple: cleanedData.multiple,
|
|
264
275
|
data: cleanedData.data,
|
|
276
|
+
profileId: cleanedData.profileId,
|
|
265
277
|
expiresAt: cleanedData.expiresAt,
|
|
266
278
|
entityId: cleanedData.entityId,
|
|
267
279
|
},
|
|
@@ -276,6 +288,7 @@ async function handleCreate(argv, prompter) {
|
|
|
276
288
|
inviteCount: true,
|
|
277
289
|
multiple: true,
|
|
278
290
|
data: true,
|
|
291
|
+
profileId: true,
|
|
279
292
|
expiresAt: true,
|
|
280
293
|
createdAt: true,
|
|
281
294
|
updatedAt: true,
|
|
@@ -365,6 +378,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
365
378
|
required: false,
|
|
366
379
|
skipPrompt: true,
|
|
367
380
|
},
|
|
381
|
+
{
|
|
382
|
+
type: 'text',
|
|
383
|
+
name: 'profileId',
|
|
384
|
+
message: 'profileId',
|
|
385
|
+
required: false,
|
|
386
|
+
skipPrompt: true,
|
|
387
|
+
},
|
|
368
388
|
{
|
|
369
389
|
type: 'text',
|
|
370
390
|
name: 'expiresAt',
|
|
@@ -397,6 +417,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
397
417
|
inviteCount: cleanedData.inviteCount,
|
|
398
418
|
multiple: cleanedData.multiple,
|
|
399
419
|
data: cleanedData.data,
|
|
420
|
+
profileId: cleanedData.profileId,
|
|
400
421
|
expiresAt: cleanedData.expiresAt,
|
|
401
422
|
entityId: cleanedData.entityId,
|
|
402
423
|
},
|
|
@@ -411,6 +432,7 @@ async function handleUpdate(argv, prompter) {
|
|
|
411
432
|
inviteCount: true,
|
|
412
433
|
multiple: true,
|
|
413
434
|
data: true,
|
|
435
|
+
profileId: true,
|
|
414
436
|
expiresAt: true,
|
|
415
437
|
createdAt: true,
|
|
416
438
|
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;
|