@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
|
@@ -12,6 +12,9 @@ const fieldSchema = {
|
|
|
12
12
|
actorId: 'uuid',
|
|
13
13
|
num: 'int',
|
|
14
14
|
max: 'int',
|
|
15
|
+
softMax: 'int',
|
|
16
|
+
windowStart: 'string',
|
|
17
|
+
windowDuration: 'string',
|
|
15
18
|
entityId: 'uuid',
|
|
16
19
|
};
|
|
17
20
|
const usage = '\norg-limit <command>\n\nCommands:\n list List orgLimit records\n find-first Find first matching orgLimit record\n get Get a orgLimit by ID\n create Create a new orgLimit\n update Update an existing orgLimit\n delete Delete a orgLimit\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';
|
|
@@ -61,6 +64,9 @@ async function handleList(argv, _prompter) {
|
|
|
61
64
|
actorId: true,
|
|
62
65
|
num: true,
|
|
63
66
|
max: true,
|
|
67
|
+
softMax: true,
|
|
68
|
+
windowStart: true,
|
|
69
|
+
windowDuration: true,
|
|
64
70
|
entityId: true,
|
|
65
71
|
};
|
|
66
72
|
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
@@ -84,6 +90,9 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
84
90
|
actorId: true,
|
|
85
91
|
num: true,
|
|
86
92
|
max: true,
|
|
93
|
+
softMax: true,
|
|
94
|
+
windowStart: true,
|
|
95
|
+
windowDuration: true,
|
|
87
96
|
entityId: true,
|
|
88
97
|
};
|
|
89
98
|
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
@@ -119,6 +128,9 @@ async function handleGet(argv, prompter) {
|
|
|
119
128
|
actorId: true,
|
|
120
129
|
num: true,
|
|
121
130
|
max: true,
|
|
131
|
+
softMax: true,
|
|
132
|
+
windowStart: true,
|
|
133
|
+
windowDuration: true,
|
|
122
134
|
entityId: true,
|
|
123
135
|
},
|
|
124
136
|
})
|
|
@@ -163,6 +175,27 @@ async function handleCreate(argv, prompter) {
|
|
|
163
175
|
required: false,
|
|
164
176
|
skipPrompt: true,
|
|
165
177
|
},
|
|
178
|
+
{
|
|
179
|
+
type: 'text',
|
|
180
|
+
name: 'softMax',
|
|
181
|
+
message: 'softMax',
|
|
182
|
+
required: false,
|
|
183
|
+
skipPrompt: true,
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
type: 'text',
|
|
187
|
+
name: 'windowStart',
|
|
188
|
+
message: 'windowStart',
|
|
189
|
+
required: false,
|
|
190
|
+
skipPrompt: true,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
type: 'text',
|
|
194
|
+
name: 'windowDuration',
|
|
195
|
+
message: 'windowDuration',
|
|
196
|
+
required: false,
|
|
197
|
+
skipPrompt: true,
|
|
198
|
+
},
|
|
166
199
|
{
|
|
167
200
|
type: 'text',
|
|
168
201
|
name: 'entityId',
|
|
@@ -180,6 +213,9 @@ async function handleCreate(argv, prompter) {
|
|
|
180
213
|
actorId: cleanedData.actorId,
|
|
181
214
|
num: cleanedData.num,
|
|
182
215
|
max: cleanedData.max,
|
|
216
|
+
softMax: cleanedData.softMax,
|
|
217
|
+
windowStart: cleanedData.windowStart,
|
|
218
|
+
windowDuration: cleanedData.windowDuration,
|
|
183
219
|
entityId: cleanedData.entityId,
|
|
184
220
|
},
|
|
185
221
|
select: {
|
|
@@ -188,6 +224,9 @@ async function handleCreate(argv, prompter) {
|
|
|
188
224
|
actorId: true,
|
|
189
225
|
num: true,
|
|
190
226
|
max: true,
|
|
227
|
+
softMax: true,
|
|
228
|
+
windowStart: true,
|
|
229
|
+
windowDuration: true,
|
|
191
230
|
entityId: true,
|
|
192
231
|
},
|
|
193
232
|
})
|
|
@@ -238,6 +277,27 @@ async function handleUpdate(argv, prompter) {
|
|
|
238
277
|
required: false,
|
|
239
278
|
skipPrompt: true,
|
|
240
279
|
},
|
|
280
|
+
{
|
|
281
|
+
type: 'text',
|
|
282
|
+
name: 'softMax',
|
|
283
|
+
message: 'softMax',
|
|
284
|
+
required: false,
|
|
285
|
+
skipPrompt: true,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
type: 'text',
|
|
289
|
+
name: 'windowStart',
|
|
290
|
+
message: 'windowStart',
|
|
291
|
+
required: false,
|
|
292
|
+
skipPrompt: true,
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
type: 'text',
|
|
296
|
+
name: 'windowDuration',
|
|
297
|
+
message: 'windowDuration',
|
|
298
|
+
required: false,
|
|
299
|
+
skipPrompt: true,
|
|
300
|
+
},
|
|
241
301
|
{
|
|
242
302
|
type: 'text',
|
|
243
303
|
name: 'entityId',
|
|
@@ -258,6 +318,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
258
318
|
actorId: cleanedData.actorId,
|
|
259
319
|
num: cleanedData.num,
|
|
260
320
|
max: cleanedData.max,
|
|
321
|
+
softMax: cleanedData.softMax,
|
|
322
|
+
windowStart: cleanedData.windowStart,
|
|
323
|
+
windowDuration: cleanedData.windowDuration,
|
|
261
324
|
entityId: cleanedData.entityId,
|
|
262
325
|
},
|
|
263
326
|
select: {
|
|
@@ -266,6 +329,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
266
329
|
actorId: true,
|
|
267
330
|
num: true,
|
|
268
331
|
max: true,
|
|
332
|
+
softMax: true,
|
|
333
|
+
windowStart: true,
|
|
334
|
+
windowDuration: true,
|
|
269
335
|
entityId: true,
|
|
270
336
|
},
|
|
271
337
|
})
|
|
@@ -18,7 +18,9 @@ const fieldSchema = {
|
|
|
18
18
|
createChildCascadeAdmins: 'boolean',
|
|
19
19
|
createChildCascadeMembers: 'boolean',
|
|
20
20
|
allowExternalMembers: 'boolean',
|
|
21
|
+
inviteProfileAssignmentMode: 'string',
|
|
21
22
|
populateMemberEmail: 'boolean',
|
|
23
|
+
limitAllocationMode: 'string',
|
|
22
24
|
};
|
|
23
25
|
const usage = '\norg-membership-setting <command>\n\nCommands:\n list List orgMembershipSetting records\n find-first Find first matching orgMembershipSetting record\n get Get a orgMembershipSetting by ID\n create Create a new orgMembershipSetting\n update Update an existing orgMembershipSetting\n delete Delete a orgMembershipSetting\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';
|
|
24
26
|
export default async (argv, prompter, _options) => {
|
|
@@ -73,7 +75,9 @@ async function handleList(argv, _prompter) {
|
|
|
73
75
|
createChildCascadeAdmins: true,
|
|
74
76
|
createChildCascadeMembers: true,
|
|
75
77
|
allowExternalMembers: true,
|
|
78
|
+
inviteProfileAssignmentMode: true,
|
|
76
79
|
populateMemberEmail: true,
|
|
80
|
+
limitAllocationMode: true,
|
|
77
81
|
};
|
|
78
82
|
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
79
83
|
const client = getClient();
|
|
@@ -102,7 +106,9 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
102
106
|
createChildCascadeAdmins: true,
|
|
103
107
|
createChildCascadeMembers: true,
|
|
104
108
|
allowExternalMembers: true,
|
|
109
|
+
inviteProfileAssignmentMode: true,
|
|
105
110
|
populateMemberEmail: true,
|
|
111
|
+
limitAllocationMode: true,
|
|
106
112
|
};
|
|
107
113
|
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
108
114
|
const client = getClient();
|
|
@@ -143,7 +149,9 @@ async function handleGet(argv, prompter) {
|
|
|
143
149
|
createChildCascadeAdmins: true,
|
|
144
150
|
createChildCascadeMembers: true,
|
|
145
151
|
allowExternalMembers: true,
|
|
152
|
+
inviteProfileAssignmentMode: true,
|
|
146
153
|
populateMemberEmail: true,
|
|
154
|
+
limitAllocationMode: true,
|
|
147
155
|
},
|
|
148
156
|
})
|
|
149
157
|
.execute();
|
|
@@ -215,6 +223,13 @@ async function handleCreate(argv, prompter) {
|
|
|
215
223
|
required: false,
|
|
216
224
|
skipPrompt: true,
|
|
217
225
|
},
|
|
226
|
+
{
|
|
227
|
+
type: 'text',
|
|
228
|
+
name: 'inviteProfileAssignmentMode',
|
|
229
|
+
message: 'inviteProfileAssignmentMode',
|
|
230
|
+
required: false,
|
|
231
|
+
skipPrompt: true,
|
|
232
|
+
},
|
|
218
233
|
{
|
|
219
234
|
type: 'boolean',
|
|
220
235
|
name: 'populateMemberEmail',
|
|
@@ -222,6 +237,13 @@ async function handleCreate(argv, prompter) {
|
|
|
222
237
|
required: false,
|
|
223
238
|
skipPrompt: true,
|
|
224
239
|
},
|
|
240
|
+
{
|
|
241
|
+
type: 'text',
|
|
242
|
+
name: 'limitAllocationMode',
|
|
243
|
+
message: 'limitAllocationMode',
|
|
244
|
+
required: false,
|
|
245
|
+
skipPrompt: true,
|
|
246
|
+
},
|
|
225
247
|
]);
|
|
226
248
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
227
249
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
@@ -237,7 +259,9 @@ async function handleCreate(argv, prompter) {
|
|
|
237
259
|
createChildCascadeAdmins: cleanedData.createChildCascadeAdmins,
|
|
238
260
|
createChildCascadeMembers: cleanedData.createChildCascadeMembers,
|
|
239
261
|
allowExternalMembers: cleanedData.allowExternalMembers,
|
|
262
|
+
inviteProfileAssignmentMode: cleanedData.inviteProfileAssignmentMode,
|
|
240
263
|
populateMemberEmail: cleanedData.populateMemberEmail,
|
|
264
|
+
limitAllocationMode: cleanedData.limitAllocationMode,
|
|
241
265
|
},
|
|
242
266
|
select: {
|
|
243
267
|
id: true,
|
|
@@ -251,7 +275,9 @@ async function handleCreate(argv, prompter) {
|
|
|
251
275
|
createChildCascadeAdmins: true,
|
|
252
276
|
createChildCascadeMembers: true,
|
|
253
277
|
allowExternalMembers: true,
|
|
278
|
+
inviteProfileAssignmentMode: true,
|
|
254
279
|
populateMemberEmail: true,
|
|
280
|
+
limitAllocationMode: true,
|
|
255
281
|
},
|
|
256
282
|
})
|
|
257
283
|
.execute();
|
|
@@ -329,6 +355,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
329
355
|
required: false,
|
|
330
356
|
skipPrompt: true,
|
|
331
357
|
},
|
|
358
|
+
{
|
|
359
|
+
type: 'text',
|
|
360
|
+
name: 'inviteProfileAssignmentMode',
|
|
361
|
+
message: 'inviteProfileAssignmentMode',
|
|
362
|
+
required: false,
|
|
363
|
+
skipPrompt: true,
|
|
364
|
+
},
|
|
332
365
|
{
|
|
333
366
|
type: 'boolean',
|
|
334
367
|
name: 'populateMemberEmail',
|
|
@@ -336,6 +369,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
336
369
|
required: false,
|
|
337
370
|
skipPrompt: true,
|
|
338
371
|
},
|
|
372
|
+
{
|
|
373
|
+
type: 'text',
|
|
374
|
+
name: 'limitAllocationMode',
|
|
375
|
+
message: 'limitAllocationMode',
|
|
376
|
+
required: false,
|
|
377
|
+
skipPrompt: true,
|
|
378
|
+
},
|
|
339
379
|
]);
|
|
340
380
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
341
381
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
@@ -354,7 +394,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
354
394
|
createChildCascadeAdmins: cleanedData.createChildCascadeAdmins,
|
|
355
395
|
createChildCascadeMembers: cleanedData.createChildCascadeMembers,
|
|
356
396
|
allowExternalMembers: cleanedData.allowExternalMembers,
|
|
397
|
+
inviteProfileAssignmentMode: cleanedData.inviteProfileAssignmentMode,
|
|
357
398
|
populateMemberEmail: cleanedData.populateMemberEmail,
|
|
399
|
+
limitAllocationMode: cleanedData.limitAllocationMode,
|
|
358
400
|
},
|
|
359
401
|
select: {
|
|
360
402
|
id: true,
|
|
@@ -368,7 +410,9 @@ async function handleUpdate(argv, prompter) {
|
|
|
368
410
|
createChildCascadeAdmins: true,
|
|
369
411
|
createChildCascadeMembers: true,
|
|
370
412
|
allowExternalMembers: true,
|
|
413
|
+
inviteProfileAssignmentMode: true,
|
|
371
414
|
populateMemberEmail: true,
|
|
415
|
+
limitAllocationMode: true,
|
|
372
416
|
},
|
|
373
417
|
})
|
|
374
418
|
.execute();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for PlansModule
|
|
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;
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for PlansModule
|
|
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
|
+
privateSchemaId: 'uuid',
|
|
14
|
+
plansTableId: 'uuid',
|
|
15
|
+
plansTableName: 'string',
|
|
16
|
+
planLimitsTableId: 'uuid',
|
|
17
|
+
planLimitsTableName: 'string',
|
|
18
|
+
applyPlanFunction: 'string',
|
|
19
|
+
applyPlanAggregateFunction: 'string',
|
|
20
|
+
prefix: 'string',
|
|
21
|
+
};
|
|
22
|
+
const usage = '\nplans-module <command>\n\nCommands:\n list List plansModule records\n find-first Find first matching plansModule record\n get Get a plansModule by ID\n create Create a new plansModule\n update Update an existing plansModule\n delete Delete a plansModule\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';
|
|
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
|
+
privateSchemaId: true,
|
|
68
|
+
plansTableId: true,
|
|
69
|
+
plansTableName: true,
|
|
70
|
+
planLimitsTableId: true,
|
|
71
|
+
planLimitsTableName: true,
|
|
72
|
+
applyPlanFunction: true,
|
|
73
|
+
applyPlanAggregateFunction: true,
|
|
74
|
+
prefix: true,
|
|
75
|
+
};
|
|
76
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
77
|
+
const client = getClient();
|
|
78
|
+
const result = await client.plansModule.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
|
+
privateSchemaId: true,
|
|
96
|
+
plansTableId: true,
|
|
97
|
+
plansTableName: true,
|
|
98
|
+
planLimitsTableId: true,
|
|
99
|
+
planLimitsTableName: true,
|
|
100
|
+
applyPlanFunction: true,
|
|
101
|
+
applyPlanAggregateFunction: true,
|
|
102
|
+
prefix: true,
|
|
103
|
+
};
|
|
104
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
105
|
+
const client = getClient();
|
|
106
|
+
const result = await client.plansModule.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.plansModule
|
|
129
|
+
.findOne({
|
|
130
|
+
id: answers.id,
|
|
131
|
+
select: {
|
|
132
|
+
id: true,
|
|
133
|
+
databaseId: true,
|
|
134
|
+
schemaId: true,
|
|
135
|
+
privateSchemaId: true,
|
|
136
|
+
plansTableId: true,
|
|
137
|
+
plansTableName: true,
|
|
138
|
+
planLimitsTableId: true,
|
|
139
|
+
planLimitsTableName: true,
|
|
140
|
+
applyPlanFunction: true,
|
|
141
|
+
applyPlanAggregateFunction: true,
|
|
142
|
+
prefix: 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: false,
|
|
170
|
+
skipPrompt: true,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: 'text',
|
|
174
|
+
name: 'privateSchemaId',
|
|
175
|
+
message: 'privateSchemaId',
|
|
176
|
+
required: false,
|
|
177
|
+
skipPrompt: true,
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'text',
|
|
181
|
+
name: 'plansTableId',
|
|
182
|
+
message: 'plansTableId',
|
|
183
|
+
required: false,
|
|
184
|
+
skipPrompt: true,
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: 'text',
|
|
188
|
+
name: 'plansTableName',
|
|
189
|
+
message: 'plansTableName',
|
|
190
|
+
required: false,
|
|
191
|
+
skipPrompt: true,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
type: 'text',
|
|
195
|
+
name: 'planLimitsTableId',
|
|
196
|
+
message: 'planLimitsTableId',
|
|
197
|
+
required: false,
|
|
198
|
+
skipPrompt: true,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
type: 'text',
|
|
202
|
+
name: 'planLimitsTableName',
|
|
203
|
+
message: 'planLimitsTableName',
|
|
204
|
+
required: false,
|
|
205
|
+
skipPrompt: true,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
type: 'text',
|
|
209
|
+
name: 'applyPlanFunction',
|
|
210
|
+
message: 'applyPlanFunction',
|
|
211
|
+
required: false,
|
|
212
|
+
skipPrompt: true,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: 'text',
|
|
216
|
+
name: 'applyPlanAggregateFunction',
|
|
217
|
+
message: 'applyPlanAggregateFunction',
|
|
218
|
+
required: false,
|
|
219
|
+
skipPrompt: true,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
type: 'text',
|
|
223
|
+
name: 'prefix',
|
|
224
|
+
message: 'prefix',
|
|
225
|
+
required: false,
|
|
226
|
+
skipPrompt: true,
|
|
227
|
+
},
|
|
228
|
+
]);
|
|
229
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
230
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
231
|
+
const client = getClient();
|
|
232
|
+
const result = await client.plansModule
|
|
233
|
+
.create({
|
|
234
|
+
data: {
|
|
235
|
+
databaseId: cleanedData.databaseId,
|
|
236
|
+
schemaId: cleanedData.schemaId,
|
|
237
|
+
privateSchemaId: cleanedData.privateSchemaId,
|
|
238
|
+
plansTableId: cleanedData.plansTableId,
|
|
239
|
+
plansTableName: cleanedData.plansTableName,
|
|
240
|
+
planLimitsTableId: cleanedData.planLimitsTableId,
|
|
241
|
+
planLimitsTableName: cleanedData.planLimitsTableName,
|
|
242
|
+
applyPlanFunction: cleanedData.applyPlanFunction,
|
|
243
|
+
applyPlanAggregateFunction: cleanedData.applyPlanAggregateFunction,
|
|
244
|
+
prefix: cleanedData.prefix,
|
|
245
|
+
},
|
|
246
|
+
select: {
|
|
247
|
+
id: true,
|
|
248
|
+
databaseId: true,
|
|
249
|
+
schemaId: true,
|
|
250
|
+
privateSchemaId: true,
|
|
251
|
+
plansTableId: true,
|
|
252
|
+
plansTableName: true,
|
|
253
|
+
planLimitsTableId: true,
|
|
254
|
+
planLimitsTableName: true,
|
|
255
|
+
applyPlanFunction: true,
|
|
256
|
+
applyPlanAggregateFunction: true,
|
|
257
|
+
prefix: 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
|
+
skipPrompt: true,
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
type: 'text',
|
|
295
|
+
name: 'privateSchemaId',
|
|
296
|
+
message: 'privateSchemaId',
|
|
297
|
+
required: false,
|
|
298
|
+
skipPrompt: true,
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
type: 'text',
|
|
302
|
+
name: 'plansTableId',
|
|
303
|
+
message: 'plansTableId',
|
|
304
|
+
required: false,
|
|
305
|
+
skipPrompt: true,
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
type: 'text',
|
|
309
|
+
name: 'plansTableName',
|
|
310
|
+
message: 'plansTableName',
|
|
311
|
+
required: false,
|
|
312
|
+
skipPrompt: true,
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
type: 'text',
|
|
316
|
+
name: 'planLimitsTableId',
|
|
317
|
+
message: 'planLimitsTableId',
|
|
318
|
+
required: false,
|
|
319
|
+
skipPrompt: true,
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
type: 'text',
|
|
323
|
+
name: 'planLimitsTableName',
|
|
324
|
+
message: 'planLimitsTableName',
|
|
325
|
+
required: false,
|
|
326
|
+
skipPrompt: true,
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
type: 'text',
|
|
330
|
+
name: 'applyPlanFunction',
|
|
331
|
+
message: 'applyPlanFunction',
|
|
332
|
+
required: false,
|
|
333
|
+
skipPrompt: true,
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
type: 'text',
|
|
337
|
+
name: 'applyPlanAggregateFunction',
|
|
338
|
+
message: 'applyPlanAggregateFunction',
|
|
339
|
+
required: false,
|
|
340
|
+
skipPrompt: true,
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
type: 'text',
|
|
344
|
+
name: 'prefix',
|
|
345
|
+
message: 'prefix',
|
|
346
|
+
required: false,
|
|
347
|
+
skipPrompt: true,
|
|
348
|
+
},
|
|
349
|
+
]);
|
|
350
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
351
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
352
|
+
const client = getClient();
|
|
353
|
+
const result = await client.plansModule
|
|
354
|
+
.update({
|
|
355
|
+
where: {
|
|
356
|
+
id: answers.id,
|
|
357
|
+
},
|
|
358
|
+
data: {
|
|
359
|
+
databaseId: cleanedData.databaseId,
|
|
360
|
+
schemaId: cleanedData.schemaId,
|
|
361
|
+
privateSchemaId: cleanedData.privateSchemaId,
|
|
362
|
+
plansTableId: cleanedData.plansTableId,
|
|
363
|
+
plansTableName: cleanedData.plansTableName,
|
|
364
|
+
planLimitsTableId: cleanedData.planLimitsTableId,
|
|
365
|
+
planLimitsTableName: cleanedData.planLimitsTableName,
|
|
366
|
+
applyPlanFunction: cleanedData.applyPlanFunction,
|
|
367
|
+
applyPlanAggregateFunction: cleanedData.applyPlanAggregateFunction,
|
|
368
|
+
prefix: cleanedData.prefix,
|
|
369
|
+
},
|
|
370
|
+
select: {
|
|
371
|
+
id: true,
|
|
372
|
+
databaseId: true,
|
|
373
|
+
schemaId: true,
|
|
374
|
+
privateSchemaId: true,
|
|
375
|
+
plansTableId: true,
|
|
376
|
+
plansTableName: true,
|
|
377
|
+
planLimitsTableId: true,
|
|
378
|
+
planLimitsTableName: true,
|
|
379
|
+
applyPlanFunction: true,
|
|
380
|
+
applyPlanAggregateFunction: true,
|
|
381
|
+
prefix: true,
|
|
382
|
+
},
|
|
383
|
+
})
|
|
384
|
+
.execute();
|
|
385
|
+
console.log(JSON.stringify(result, null, 2));
|
|
386
|
+
}
|
|
387
|
+
catch (error) {
|
|
388
|
+
console.error('Failed to update record.');
|
|
389
|
+
if (error instanceof Error) {
|
|
390
|
+
console.error(error.message);
|
|
391
|
+
}
|
|
392
|
+
process.exit(1);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
async function handleDelete(argv, prompter) {
|
|
396
|
+
try {
|
|
397
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
398
|
+
{
|
|
399
|
+
type: 'text',
|
|
400
|
+
name: 'id',
|
|
401
|
+
message: 'id',
|
|
402
|
+
required: true,
|
|
403
|
+
},
|
|
404
|
+
]);
|
|
405
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
406
|
+
const client = getClient();
|
|
407
|
+
const result = await client.plansModule
|
|
408
|
+
.delete({
|
|
409
|
+
where: {
|
|
410
|
+
id: answers.id,
|
|
411
|
+
},
|
|
412
|
+
select: {
|
|
413
|
+
id: true,
|
|
414
|
+
},
|
|
415
|
+
})
|
|
416
|
+
.execute();
|
|
417
|
+
console.log(JSON.stringify(result, null, 2));
|
|
418
|
+
}
|
|
419
|
+
catch (error) {
|
|
420
|
+
console.error('Failed to delete record.');
|
|
421
|
+
if (error instanceof Error) {
|
|
422
|
+
console.error(error.message);
|
|
423
|
+
}
|
|
424
|
+
process.exit(1);
|
|
425
|
+
}
|
|
426
|
+
}
|