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