@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-sdk/cli",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.3",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Constructive CLI SDK - Auto-generated GraphQL CLI with ORM client, context management, and interactive prompts",
|
|
6
6
|
"main": "index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@0no-co/graphql.web": "^1.1.2",
|
|
49
|
-
"@constructive-io/graphql-query": "^3.17.
|
|
49
|
+
"@constructive-io/graphql-query": "^3.17.3",
|
|
50
50
|
"@constructive-io/graphql-types": "^3.5.1",
|
|
51
51
|
"appstash": "^0.7.0",
|
|
52
52
|
"gql-ast": "^3.5.0",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"yanse": "^0.2.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@constructive-io/graphql-codegen": "^4.34.
|
|
59
|
+
"@constructive-io/graphql-codegen": "^4.34.3",
|
|
60
60
|
"@types/node": "^22.19.11",
|
|
61
61
|
"makage": "^0.3.0",
|
|
62
62
|
"tsx": "^4.19.0",
|
|
63
63
|
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "caf38236170287e2ad06d5c47482ce246fb3233e"
|
|
66
66
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for AgentMessage
|
|
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,326 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* CLI commands for AgentMessage
|
|
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
|
+
threadId: 'uuid',
|
|
13
|
+
entityId: 'uuid',
|
|
14
|
+
authorRole: 'string',
|
|
15
|
+
id: 'uuid',
|
|
16
|
+
createdAt: 'string',
|
|
17
|
+
updatedAt: 'string',
|
|
18
|
+
ownerId: 'uuid',
|
|
19
|
+
parts: 'json',
|
|
20
|
+
};
|
|
21
|
+
const usage = '\nagent-message <command>\n\nCommands:\n list List agentMessage records\n find-first Find first matching agentMessage record\n get Get a agentMessage by ID\n create Create a new agentMessage\n update Update an existing agentMessage\n delete Delete a agentMessage\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';
|
|
22
|
+
exports.default = async (argv, prompter, _options) => {
|
|
23
|
+
if (argv.help || argv.h) {
|
|
24
|
+
console.log(usage);
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
|
|
28
|
+
if (!subcommand) {
|
|
29
|
+
const answer = await prompter.prompt(argv, [
|
|
30
|
+
{
|
|
31
|
+
type: 'autocomplete',
|
|
32
|
+
name: 'subcommand',
|
|
33
|
+
message: 'What do you want to do?',
|
|
34
|
+
options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
|
|
35
|
+
},
|
|
36
|
+
]);
|
|
37
|
+
return handleTableSubcommand(answer.subcommand, newArgv, prompter);
|
|
38
|
+
}
|
|
39
|
+
return handleTableSubcommand(subcommand, newArgv, prompter);
|
|
40
|
+
};
|
|
41
|
+
async function handleTableSubcommand(subcommand, argv, prompter) {
|
|
42
|
+
switch (subcommand) {
|
|
43
|
+
case 'list':
|
|
44
|
+
return handleList(argv, prompter);
|
|
45
|
+
case 'find-first':
|
|
46
|
+
return handleFindFirst(argv, prompter);
|
|
47
|
+
case 'get':
|
|
48
|
+
return handleGet(argv, prompter);
|
|
49
|
+
case 'create':
|
|
50
|
+
return handleCreate(argv, prompter);
|
|
51
|
+
case 'update':
|
|
52
|
+
return handleUpdate(argv, prompter);
|
|
53
|
+
case 'delete':
|
|
54
|
+
return handleDelete(argv, prompter);
|
|
55
|
+
default:
|
|
56
|
+
console.log(usage);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function handleList(argv, _prompter) {
|
|
61
|
+
try {
|
|
62
|
+
const defaultSelect = {
|
|
63
|
+
threadId: true,
|
|
64
|
+
entityId: true,
|
|
65
|
+
authorRole: true,
|
|
66
|
+
id: true,
|
|
67
|
+
createdAt: true,
|
|
68
|
+
updatedAt: true,
|
|
69
|
+
ownerId: true,
|
|
70
|
+
parts: true,
|
|
71
|
+
};
|
|
72
|
+
const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
|
|
73
|
+
const client = (0, executor_1.getClient)();
|
|
74
|
+
const result = await client.agentMessage.findMany(findManyArgs).execute();
|
|
75
|
+
console.log(JSON.stringify(result, null, 2));
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
console.error('Failed to list records.');
|
|
79
|
+
if (error instanceof Error) {
|
|
80
|
+
console.error(error.message);
|
|
81
|
+
}
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function handleFindFirst(argv, _prompter) {
|
|
86
|
+
try {
|
|
87
|
+
const defaultSelect = {
|
|
88
|
+
threadId: true,
|
|
89
|
+
entityId: true,
|
|
90
|
+
authorRole: true,
|
|
91
|
+
id: true,
|
|
92
|
+
createdAt: true,
|
|
93
|
+
updatedAt: true,
|
|
94
|
+
ownerId: true,
|
|
95
|
+
parts: true,
|
|
96
|
+
};
|
|
97
|
+
const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
|
|
98
|
+
const client = (0, executor_1.getClient)();
|
|
99
|
+
const result = await client.agentMessage.findFirst(findFirstArgs).execute();
|
|
100
|
+
console.log(JSON.stringify(result, null, 2));
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
console.error('Failed to find record.');
|
|
104
|
+
if (error instanceof Error) {
|
|
105
|
+
console.error(error.message);
|
|
106
|
+
}
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function handleGet(argv, prompter) {
|
|
111
|
+
try {
|
|
112
|
+
const answers = await prompter.prompt(argv, [
|
|
113
|
+
{
|
|
114
|
+
type: 'text',
|
|
115
|
+
name: 'id',
|
|
116
|
+
message: 'id',
|
|
117
|
+
required: true,
|
|
118
|
+
},
|
|
119
|
+
]);
|
|
120
|
+
const client = (0, executor_1.getClient)();
|
|
121
|
+
const result = await client.agentMessage
|
|
122
|
+
.findOne({
|
|
123
|
+
id: answers.id,
|
|
124
|
+
select: {
|
|
125
|
+
threadId: true,
|
|
126
|
+
entityId: true,
|
|
127
|
+
authorRole: true,
|
|
128
|
+
id: true,
|
|
129
|
+
createdAt: true,
|
|
130
|
+
updatedAt: true,
|
|
131
|
+
ownerId: true,
|
|
132
|
+
parts: true,
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
.execute();
|
|
136
|
+
console.log(JSON.stringify(result, null, 2));
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
console.error('Record not found.');
|
|
140
|
+
if (error instanceof Error) {
|
|
141
|
+
console.error(error.message);
|
|
142
|
+
}
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async function handleCreate(argv, prompter) {
|
|
147
|
+
try {
|
|
148
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
149
|
+
{
|
|
150
|
+
type: 'text',
|
|
151
|
+
name: 'threadId',
|
|
152
|
+
message: 'threadId',
|
|
153
|
+
required: true,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
type: 'text',
|
|
157
|
+
name: 'entityId',
|
|
158
|
+
message: 'entityId',
|
|
159
|
+
required: true,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
type: 'text',
|
|
163
|
+
name: 'authorRole',
|
|
164
|
+
message: 'authorRole',
|
|
165
|
+
required: true,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
type: 'text',
|
|
169
|
+
name: 'ownerId',
|
|
170
|
+
message: 'ownerId',
|
|
171
|
+
required: false,
|
|
172
|
+
skipPrompt: true,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'json',
|
|
176
|
+
name: 'parts',
|
|
177
|
+
message: 'parts',
|
|
178
|
+
required: false,
|
|
179
|
+
skipPrompt: true,
|
|
180
|
+
},
|
|
181
|
+
]);
|
|
182
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
183
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
184
|
+
const client = (0, executor_1.getClient)();
|
|
185
|
+
const result = await client.agentMessage
|
|
186
|
+
.create({
|
|
187
|
+
data: {
|
|
188
|
+
threadId: cleanedData.threadId,
|
|
189
|
+
entityId: cleanedData.entityId,
|
|
190
|
+
authorRole: cleanedData.authorRole,
|
|
191
|
+
ownerId: cleanedData.ownerId,
|
|
192
|
+
parts: cleanedData.parts,
|
|
193
|
+
},
|
|
194
|
+
select: {
|
|
195
|
+
threadId: true,
|
|
196
|
+
entityId: true,
|
|
197
|
+
authorRole: true,
|
|
198
|
+
id: true,
|
|
199
|
+
createdAt: true,
|
|
200
|
+
updatedAt: true,
|
|
201
|
+
ownerId: true,
|
|
202
|
+
parts: true,
|
|
203
|
+
},
|
|
204
|
+
})
|
|
205
|
+
.execute();
|
|
206
|
+
console.log(JSON.stringify(result, null, 2));
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
console.error('Failed to create record.');
|
|
210
|
+
if (error instanceof Error) {
|
|
211
|
+
console.error(error.message);
|
|
212
|
+
}
|
|
213
|
+
process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
async function handleUpdate(argv, prompter) {
|
|
217
|
+
try {
|
|
218
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
219
|
+
{
|
|
220
|
+
type: 'text',
|
|
221
|
+
name: 'id',
|
|
222
|
+
message: 'id',
|
|
223
|
+
required: true,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'text',
|
|
227
|
+
name: 'threadId',
|
|
228
|
+
message: 'threadId',
|
|
229
|
+
required: false,
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
type: 'text',
|
|
233
|
+
name: 'entityId',
|
|
234
|
+
message: 'entityId',
|
|
235
|
+
required: false,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
type: 'text',
|
|
239
|
+
name: 'authorRole',
|
|
240
|
+
message: 'authorRole',
|
|
241
|
+
required: false,
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
type: 'text',
|
|
245
|
+
name: 'ownerId',
|
|
246
|
+
message: 'ownerId',
|
|
247
|
+
required: false,
|
|
248
|
+
skipPrompt: true,
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
type: 'json',
|
|
252
|
+
name: 'parts',
|
|
253
|
+
message: 'parts',
|
|
254
|
+
required: false,
|
|
255
|
+
skipPrompt: true,
|
|
256
|
+
},
|
|
257
|
+
]);
|
|
258
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
259
|
+
const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
|
|
260
|
+
const client = (0, executor_1.getClient)();
|
|
261
|
+
const result = await client.agentMessage
|
|
262
|
+
.update({
|
|
263
|
+
where: {
|
|
264
|
+
id: answers.id,
|
|
265
|
+
},
|
|
266
|
+
data: {
|
|
267
|
+
threadId: cleanedData.threadId,
|
|
268
|
+
entityId: cleanedData.entityId,
|
|
269
|
+
authorRole: cleanedData.authorRole,
|
|
270
|
+
ownerId: cleanedData.ownerId,
|
|
271
|
+
parts: cleanedData.parts,
|
|
272
|
+
},
|
|
273
|
+
select: {
|
|
274
|
+
threadId: true,
|
|
275
|
+
entityId: true,
|
|
276
|
+
authorRole: true,
|
|
277
|
+
id: true,
|
|
278
|
+
createdAt: true,
|
|
279
|
+
updatedAt: true,
|
|
280
|
+
ownerId: true,
|
|
281
|
+
parts: true,
|
|
282
|
+
},
|
|
283
|
+
})
|
|
284
|
+
.execute();
|
|
285
|
+
console.log(JSON.stringify(result, null, 2));
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
console.error('Failed to update record.');
|
|
289
|
+
if (error instanceof Error) {
|
|
290
|
+
console.error(error.message);
|
|
291
|
+
}
|
|
292
|
+
process.exit(1);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
async function handleDelete(argv, prompter) {
|
|
296
|
+
try {
|
|
297
|
+
const rawAnswers = await prompter.prompt(argv, [
|
|
298
|
+
{
|
|
299
|
+
type: 'text',
|
|
300
|
+
name: 'id',
|
|
301
|
+
message: 'id',
|
|
302
|
+
required: true,
|
|
303
|
+
},
|
|
304
|
+
]);
|
|
305
|
+
const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
|
|
306
|
+
const client = (0, executor_1.getClient)();
|
|
307
|
+
const result = await client.agentMessage
|
|
308
|
+
.delete({
|
|
309
|
+
where: {
|
|
310
|
+
id: answers.id,
|
|
311
|
+
},
|
|
312
|
+
select: {
|
|
313
|
+
id: true,
|
|
314
|
+
},
|
|
315
|
+
})
|
|
316
|
+
.execute();
|
|
317
|
+
console.log(JSON.stringify(result, null, 2));
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
console.error('Failed to delete record.');
|
|
321
|
+
if (error instanceof Error) {
|
|
322
|
+
console.error(error.message);
|
|
323
|
+
}
|
|
324
|
+
process.exit(1);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands for AgentTask
|
|
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;
|