@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
|
@@ -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;
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for OrgLimitAggregate
|
|
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
|
+
name: 'string',
|
|
12
|
+
entityId: 'uuid',
|
|
13
|
+
num: 'int',
|
|
14
|
+
max: 'int',
|
|
15
|
+
softMax: 'int',
|
|
16
|
+
windowStart: 'string',
|
|
17
|
+
windowDuration: 'string',
|
|
18
|
+
};
|
|
19
|
+
const usage = '\norg-limit-aggregate <command>\n\nCommands:\n list List orgLimitAggregate records\n find-first Find first matching orgLimitAggregate record\n get Get a orgLimitAggregate by ID\n create Create a new orgLimitAggregate\n update Update an existing orgLimitAggregate\n delete Delete a orgLimitAggregate\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';
|
|
20
|
+
export default async (argv, prompter, _options) => {
|
|
21
|
+
if (argv.help || argv.h) {
|
|
22
|
+
console.log(usage);
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
const { first: subcommand, newArgv } = extractFirst(argv);
|
|
26
|
+
if (!subcommand) {
|
|
27
|
+
const answer = await prompter.prompt(argv, [
|
|
28
|
+
{
|
|
29
|
+
type: 'autocomplete',
|
|
30
|
+
name: 'subcommand',
|
|
31
|
+
message: 'What do you want to do?',
|
|
32
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
33
|
+
},
|
|
34
|
+
]);
|
|
35
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
36
|
+
}
|
|
37
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
38
|
+
};
|
|
39
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
40
|
+
switch (subcommand) {
|
|
41
|
+
case 'list':
|
|
42
|
+
return handleList(argv, prompter);
|
|
43
|
+
case 'find-first':
|
|
44
|
+
return handleFindFirst(argv, prompter);
|
|
45
|
+
case 'get':
|
|
46
|
+
return handleGet(argv, prompter);
|
|
47
|
+
case 'create':
|
|
48
|
+
return handleCreate(argv, prompter);
|
|
49
|
+
case 'update':
|
|
50
|
+
return handleUpdate(argv, prompter);
|
|
51
|
+
case 'delete':
|
|
52
|
+
return handleDelete(argv, prompter);
|
|
53
|
+
default:
|
|
54
|
+
console.log(usage);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function handleList(argv, _prompter) {
|
|
59
|
+
try {
|
|
60
|
+
const defaultSelect = {
|
|
61
|
+
id: true,
|
|
62
|
+
name: true,
|
|
63
|
+
entityId: true,
|
|
64
|
+
num: true,
|
|
65
|
+
max: true,
|
|
66
|
+
softMax: true,
|
|
67
|
+
windowStart: true,
|
|
68
|
+
windowDuration: true,
|
|
69
|
+
};
|
|
70
|
+
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
71
|
+
const client = getClient();
|
|
72
|
+
const result = await client.orgLimitAggregate.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
|
+
id: true,
|
|
87
|
+
name: true,
|
|
88
|
+
entityId: true,
|
|
89
|
+
num: true,
|
|
90
|
+
max: true,
|
|
91
|
+
softMax: true,
|
|
92
|
+
windowStart: true,
|
|
93
|
+
windowDuration: true,
|
|
94
|
+
};
|
|
95
|
+
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
96
|
+
const client = getClient();
|
|
97
|
+
const result = await client.orgLimitAggregate.findFirst(findFirstArgs).execute();
|
|
98
|
+
console.log(JSON.stringify(result, null, 2));
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.error('Failed to find record.');
|
|
102
|
+
if (error instanceof Error) {
|
|
103
|
+
console.error(error.message);
|
|
104
|
+
}
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async function handleGet(argv, prompter) {
|
|
109
|
+
try {
|
|
110
|
+
const answers = await prompter.prompt(argv, [
|
|
111
|
+
{
|
|
112
|
+
type: 'text',
|
|
113
|
+
name: 'id',
|
|
114
|
+
message: 'id',
|
|
115
|
+
required: true,
|
|
116
|
+
},
|
|
117
|
+
]);
|
|
118
|
+
const client = getClient();
|
|
119
|
+
const result = await client.orgLimitAggregate
|
|
120
|
+
.findOne({
|
|
121
|
+
id: answers.id,
|
|
122
|
+
select: {
|
|
123
|
+
id: true,
|
|
124
|
+
name: true,
|
|
125
|
+
entityId: true,
|
|
126
|
+
num: true,
|
|
127
|
+
max: true,
|
|
128
|
+
softMax: true,
|
|
129
|
+
windowStart: true,
|
|
130
|
+
windowDuration: true,
|
|
131
|
+
},
|
|
132
|
+
})
|
|
133
|
+
.execute();
|
|
134
|
+
console.log(JSON.stringify(result, null, 2));
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
console.error('Record not found.');
|
|
138
|
+
if (error instanceof Error) {
|
|
139
|
+
console.error(error.message);
|
|
140
|
+
}
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async function handleCreate(argv, prompter) {
|
|
145
|
+
try {
|
|
146
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
147
|
+
{
|
|
148
|
+
type: 'text',
|
|
149
|
+
name: 'name',
|
|
150
|
+
message: 'name',
|
|
151
|
+
required: false,
|
|
152
|
+
skipPrompt: true,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: 'text',
|
|
156
|
+
name: 'entityId',
|
|
157
|
+
message: 'entityId',
|
|
158
|
+
required: true,
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
type: 'text',
|
|
162
|
+
name: 'num',
|
|
163
|
+
message: 'num',
|
|
164
|
+
required: false,
|
|
165
|
+
skipPrompt: true,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
type: 'text',
|
|
169
|
+
name: 'max',
|
|
170
|
+
message: 'max',
|
|
171
|
+
required: false,
|
|
172
|
+
skipPrompt: true,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'text',
|
|
176
|
+
name: 'softMax',
|
|
177
|
+
message: 'softMax',
|
|
178
|
+
required: false,
|
|
179
|
+
skipPrompt: true,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
type: 'text',
|
|
183
|
+
name: 'windowStart',
|
|
184
|
+
message: 'windowStart',
|
|
185
|
+
required: false,
|
|
186
|
+
skipPrompt: true,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
type: 'text',
|
|
190
|
+
name: 'windowDuration',
|
|
191
|
+
message: 'windowDuration',
|
|
192
|
+
required: false,
|
|
193
|
+
skipPrompt: true,
|
|
194
|
+
},
|
|
195
|
+
]);
|
|
196
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
197
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
198
|
+
const client = getClient();
|
|
199
|
+
const result = await client.orgLimitAggregate
|
|
200
|
+
.create({
|
|
201
|
+
data: {
|
|
202
|
+
name: cleanedData.name,
|
|
203
|
+
entityId: cleanedData.entityId,
|
|
204
|
+
num: cleanedData.num,
|
|
205
|
+
max: cleanedData.max,
|
|
206
|
+
softMax: cleanedData.softMax,
|
|
207
|
+
windowStart: cleanedData.windowStart,
|
|
208
|
+
windowDuration: cleanedData.windowDuration,
|
|
209
|
+
},
|
|
210
|
+
select: {
|
|
211
|
+
id: true,
|
|
212
|
+
name: true,
|
|
213
|
+
entityId: true,
|
|
214
|
+
num: true,
|
|
215
|
+
max: true,
|
|
216
|
+
softMax: true,
|
|
217
|
+
windowStart: true,
|
|
218
|
+
windowDuration: true,
|
|
219
|
+
},
|
|
220
|
+
})
|
|
221
|
+
.execute();
|
|
222
|
+
console.log(JSON.stringify(result, null, 2));
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
console.error('Failed to create record.');
|
|
226
|
+
if (error instanceof Error) {
|
|
227
|
+
console.error(error.message);
|
|
228
|
+
}
|
|
229
|
+
process.exit(1);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
async function handleUpdate(argv, prompter) {
|
|
233
|
+
try {
|
|
234
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
235
|
+
{
|
|
236
|
+
type: 'text',
|
|
237
|
+
name: 'id',
|
|
238
|
+
message: 'id',
|
|
239
|
+
required: true,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
type: 'text',
|
|
243
|
+
name: 'name',
|
|
244
|
+
message: 'name',
|
|
245
|
+
required: false,
|
|
246
|
+
skipPrompt: true,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
type: 'text',
|
|
250
|
+
name: 'entityId',
|
|
251
|
+
message: 'entityId',
|
|
252
|
+
required: false,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
type: 'text',
|
|
256
|
+
name: 'num',
|
|
257
|
+
message: 'num',
|
|
258
|
+
required: false,
|
|
259
|
+
skipPrompt: true,
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
type: 'text',
|
|
263
|
+
name: 'max',
|
|
264
|
+
message: 'max',
|
|
265
|
+
required: false,
|
|
266
|
+
skipPrompt: true,
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
type: 'text',
|
|
270
|
+
name: 'softMax',
|
|
271
|
+
message: 'softMax',
|
|
272
|
+
required: false,
|
|
273
|
+
skipPrompt: true,
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
type: 'text',
|
|
277
|
+
name: 'windowStart',
|
|
278
|
+
message: 'windowStart',
|
|
279
|
+
required: false,
|
|
280
|
+
skipPrompt: true,
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
type: 'text',
|
|
284
|
+
name: 'windowDuration',
|
|
285
|
+
message: 'windowDuration',
|
|
286
|
+
required: false,
|
|
287
|
+
skipPrompt: true,
|
|
288
|
+
},
|
|
289
|
+
]);
|
|
290
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
291
|
+
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
292
|
+
const client = getClient();
|
|
293
|
+
const result = await client.orgLimitAggregate
|
|
294
|
+
.update({
|
|
295
|
+
where: {
|
|
296
|
+
id: answers.id,
|
|
297
|
+
},
|
|
298
|
+
data: {
|
|
299
|
+
name: cleanedData.name,
|
|
300
|
+
entityId: cleanedData.entityId,
|
|
301
|
+
num: cleanedData.num,
|
|
302
|
+
max: cleanedData.max,
|
|
303
|
+
softMax: cleanedData.softMax,
|
|
304
|
+
windowStart: cleanedData.windowStart,
|
|
305
|
+
windowDuration: cleanedData.windowDuration,
|
|
306
|
+
},
|
|
307
|
+
select: {
|
|
308
|
+
id: true,
|
|
309
|
+
name: true,
|
|
310
|
+
entityId: true,
|
|
311
|
+
num: true,
|
|
312
|
+
max: true,
|
|
313
|
+
softMax: true,
|
|
314
|
+
windowStart: true,
|
|
315
|
+
windowDuration: true,
|
|
316
|
+
},
|
|
317
|
+
})
|
|
318
|
+
.execute();
|
|
319
|
+
console.log(JSON.stringify(result, null, 2));
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
console.error('Failed to update record.');
|
|
323
|
+
if (error instanceof Error) {
|
|
324
|
+
console.error(error.message);
|
|
325
|
+
}
|
|
326
|
+
process.exit(1);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
async function handleDelete(argv, prompter) {
|
|
330
|
+
try {
|
|
331
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
332
|
+
{
|
|
333
|
+
type: 'text',
|
|
334
|
+
name: 'id',
|
|
335
|
+
message: 'id',
|
|
336
|
+
required: true,
|
|
337
|
+
},
|
|
338
|
+
]);
|
|
339
|
+
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
340
|
+
const client = getClient();
|
|
341
|
+
const result = await client.orgLimitAggregate
|
|
342
|
+
.delete({
|
|
343
|
+
where: {
|
|
344
|
+
id: answers.id,
|
|
345
|
+
},
|
|
346
|
+
select: {
|
|
347
|
+
id: true,
|
|
348
|
+
},
|
|
349
|
+
})
|
|
350
|
+
.execute();
|
|
351
|
+
console.log(JSON.stringify(result, null, 2));
|
|
352
|
+
}
|
|
353
|
+
catch (error) {
|
|
354
|
+
console.error('Failed to delete record.');
|
|
355
|
+
if (error instanceof Error) {
|
|
356
|
+
console.error(error.message);
|
|
357
|
+
}
|
|
358
|
+
process.exit(1);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
@@ -10,6 +10,7 @@ const fieldSchema = {
|
|
|
10
10
|
id: 'uuid',
|
|
11
11
|
name: 'string',
|
|
12
12
|
max: 'int',
|
|
13
|
+
softMax: 'int',
|
|
13
14
|
};
|
|
14
15
|
const usage = '\norg-limit-default <command>\n\nCommands:\n list List orgLimitDefault records\n find-first Find first matching orgLimitDefault record\n get Get a orgLimitDefault by ID\n create Create a new orgLimitDefault\n update Update an existing orgLimitDefault\n delete Delete a orgLimitDefault\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';
|
|
15
16
|
export default async (argv, prompter, _options) => {
|
|
@@ -56,6 +57,7 @@ async function handleList(argv, _prompter) {
|
|
|
56
57
|
id: true,
|
|
57
58
|
name: true,
|
|
58
59
|
max: true,
|
|
60
|
+
softMax: true,
|
|
59
61
|
};
|
|
60
62
|
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
|
|
61
63
|
const client = getClient();
|
|
@@ -76,6 +78,7 @@ async function handleFindFirst(argv, _prompter) {
|
|
|
76
78
|
id: true,
|
|
77
79
|
name: true,
|
|
78
80
|
max: true,
|
|
81
|
+
softMax: true,
|
|
79
82
|
};
|
|
80
83
|
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
|
|
81
84
|
const client = getClient();
|
|
@@ -108,6 +111,7 @@ async function handleGet(argv, prompter) {
|
|
|
108
111
|
id: true,
|
|
109
112
|
name: true,
|
|
110
113
|
max: true,
|
|
114
|
+
softMax: true,
|
|
111
115
|
},
|
|
112
116
|
})
|
|
113
117
|
.execute();
|
|
@@ -137,6 +141,13 @@ async function handleCreate(argv, prompter) {
|
|
|
137
141
|
required: false,
|
|
138
142
|
skipPrompt: true,
|
|
139
143
|
},
|
|
144
|
+
{
|
|
145
|
+
type: 'text',
|
|
146
|
+
name: 'softMax',
|
|
147
|
+
message: 'softMax',
|
|
148
|
+
required: false,
|
|
149
|
+
skipPrompt: true,
|
|
150
|
+
},
|
|
140
151
|
]);
|
|
141
152
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
142
153
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
@@ -146,11 +157,13 @@ async function handleCreate(argv, prompter) {
|
|
|
146
157
|
data: {
|
|
147
158
|
name: cleanedData.name,
|
|
148
159
|
max: cleanedData.max,
|
|
160
|
+
softMax: cleanedData.softMax,
|
|
149
161
|
},
|
|
150
162
|
select: {
|
|
151
163
|
id: true,
|
|
152
164
|
name: true,
|
|
153
165
|
max: true,
|
|
166
|
+
softMax: true,
|
|
154
167
|
},
|
|
155
168
|
})
|
|
156
169
|
.execute();
|
|
@@ -186,6 +199,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
186
199
|
required: false,
|
|
187
200
|
skipPrompt: true,
|
|
188
201
|
},
|
|
202
|
+
{
|
|
203
|
+
type: 'text',
|
|
204
|
+
name: 'softMax',
|
|
205
|
+
message: 'softMax',
|
|
206
|
+
required: false,
|
|
207
|
+
skipPrompt: true,
|
|
208
|
+
},
|
|
189
209
|
]);
|
|
190
210
|
const answers = coerceAnswers(rawAnswers, fieldSchema);
|
|
191
211
|
const cleanedData = stripUndefined(answers, fieldSchema);
|
|
@@ -198,11 +218,13 @@ async function handleUpdate(argv, prompter) {
|
|
|
198
218
|
data: {
|
|
199
219
|
name: cleanedData.name,
|
|
200
220
|
max: cleanedData.max,
|
|
221
|
+
softMax: cleanedData.softMax,
|
|
201
222
|
},
|
|
202
223
|
select: {
|
|
203
224
|
id: true,
|
|
204
225
|
name: true,
|
|
205
226
|
max: true,
|
|
227
|
+
softMax: true,
|
|
206
228
|
},
|
|
207
229
|
})
|
|
208
230
|
.execute();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for OrgLimitEvent
|
|
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;
|