@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.
Files changed (213) hide show
  1. package/admin/cli/commands/app-invite.js +22 -0
  2. package/admin/cli/commands/app-limit-default.js +22 -0
  3. package/admin/cli/commands/{confirm-upload.d.ts → app-limit-event.d.ts} +1 -1
  4. package/admin/cli/commands/app-limit-event.js +212 -0
  5. package/admin/cli/commands/app-limit.js +66 -0
  6. package/admin/cli/commands/app-membership.js +0 -22
  7. package/admin/cli/commands/org-invite.js +22 -0
  8. package/{esm/admin/cli/commands/confirm-upload.d.ts → admin/cli/commands/org-limit-aggregate.d.ts} +1 -1
  9. package/admin/cli/commands/org-limit-aggregate.js +362 -0
  10. package/admin/cli/commands/org-limit-default.js +22 -0
  11. package/{auth/cli/commands/confirm-upload.d.ts → admin/cli/commands/org-limit-event.d.ts} +1 -1
  12. package/admin/cli/commands/org-limit-event.js +212 -0
  13. package/admin/cli/commands/org-limit.js +66 -0
  14. package/admin/cli/commands/org-membership-setting.js +44 -0
  15. package/admin/cli/commands.js +25 -21
  16. package/admin/cli/executor.d.ts +12 -14
  17. package/admin/orm/index.d.ts +24 -23
  18. package/admin/orm/index.js +24 -18
  19. package/admin/orm/input-types.d.ts +1297 -839
  20. package/admin/orm/models/appLimitEvent.d.ts +32 -0
  21. package/admin/orm/models/appLimitEvent.js +55 -0
  22. package/admin/orm/models/index.d.ts +12 -9
  23. package/admin/orm/models/index.js +25 -19
  24. package/admin/orm/models/orgLimitAggregate.d.ts +56 -0
  25. package/admin/orm/models/orgLimitAggregate.js +100 -0
  26. package/admin/orm/models/orgLimitEvent.d.ts +32 -0
  27. package/admin/orm/models/orgLimitEvent.js +55 -0
  28. package/admin/orm/mutation/index.d.ts +1 -15
  29. package/admin/orm/mutation/index.js +0 -12
  30. package/auth/cli/commands.js +1 -3
  31. package/auth/cli/executor.d.ts +0 -5
  32. package/auth/orm/index.d.ts +0 -5
  33. package/auth/orm/input-types.d.ts +0 -20
  34. package/auth/orm/mutation/index.d.ts +1 -15
  35. package/auth/orm/mutation/index.js +0 -12
  36. package/esm/admin/cli/commands/app-invite.js +22 -0
  37. package/esm/admin/cli/commands/app-limit-default.js +22 -0
  38. package/esm/{auth/cli/commands/confirm-upload.d.ts → admin/cli/commands/app-limit-event.d.ts} +1 -1
  39. package/esm/admin/cli/commands/app-limit-event.js +210 -0
  40. package/esm/admin/cli/commands/app-limit.js +66 -0
  41. package/esm/admin/cli/commands/app-membership.js +0 -22
  42. package/esm/admin/cli/commands/org-invite.js +22 -0
  43. package/esm/admin/cli/commands/org-limit-aggregate.d.ts +8 -0
  44. package/esm/admin/cli/commands/org-limit-aggregate.js +360 -0
  45. package/esm/admin/cli/commands/org-limit-default.js +22 -0
  46. package/esm/admin/cli/commands/org-limit-event.d.ts +8 -0
  47. package/esm/admin/cli/commands/org-limit-event.js +210 -0
  48. package/esm/admin/cli/commands/org-limit.js +66 -0
  49. package/esm/admin/cli/commands/org-membership-setting.js +44 -0
  50. package/esm/admin/cli/commands.js +25 -21
  51. package/esm/admin/cli/executor.d.ts +12 -14
  52. package/esm/admin/orm/index.d.ts +24 -23
  53. package/esm/admin/orm/index.js +24 -18
  54. package/esm/admin/orm/input-types.d.ts +1297 -839
  55. package/esm/admin/orm/models/appLimitEvent.d.ts +32 -0
  56. package/esm/admin/orm/models/appLimitEvent.js +51 -0
  57. package/esm/admin/orm/models/index.d.ts +12 -9
  58. package/esm/admin/orm/models/index.js +12 -9
  59. package/esm/admin/orm/models/orgLimitAggregate.d.ts +56 -0
  60. package/esm/admin/orm/models/orgLimitAggregate.js +96 -0
  61. package/esm/admin/orm/models/orgLimitEvent.d.ts +32 -0
  62. package/esm/admin/orm/models/orgLimitEvent.js +51 -0
  63. package/esm/admin/orm/mutation/index.d.ts +1 -15
  64. package/esm/admin/orm/mutation/index.js +0 -12
  65. package/esm/auth/cli/commands.js +1 -3
  66. package/esm/auth/cli/executor.d.ts +0 -5
  67. package/esm/auth/orm/index.d.ts +0 -5
  68. package/esm/auth/orm/input-types.d.ts +0 -20
  69. package/esm/auth/orm/mutation/index.d.ts +1 -15
  70. package/esm/auth/orm/mutation/index.js +0 -12
  71. package/esm/objects/cli/commands.js +1 -3
  72. package/esm/objects/cli/executor.d.ts +0 -5
  73. package/esm/objects/orm/index.d.ts +0 -5
  74. package/esm/objects/orm/input-types.d.ts +0 -20
  75. package/esm/objects/orm/mutation/index.d.ts +1 -15
  76. package/esm/objects/orm/mutation/index.js +0 -12
  77. package/esm/public/cli/commands/agent-message.d.ts +8 -0
  78. package/esm/public/cli/commands/agent-message.js +324 -0
  79. package/esm/public/cli/commands/agent-task.d.ts +8 -0
  80. package/esm/public/cli/commands/agent-task.js +368 -0
  81. package/esm/public/cli/commands/agent-thread.d.ts +8 -0
  82. package/esm/public/cli/commands/agent-thread.js +372 -0
  83. package/esm/public/cli/commands/app-invite.js +22 -0
  84. package/esm/public/cli/commands/app-limit-default.js +22 -0
  85. package/esm/public/cli/commands/app-limit-event.d.ts +8 -0
  86. package/esm/public/cli/commands/app-limit-event.js +210 -0
  87. package/esm/public/cli/commands/app-limit.js +66 -0
  88. package/esm/public/cli/commands/app-membership.js +0 -22
  89. package/esm/public/cli/commands/billing-module.d.ts +8 -0
  90. package/esm/public/cli/commands/billing-module.js +492 -0
  91. package/esm/public/cli/commands/limits-module.js +22 -0
  92. package/esm/public/cli/commands/node-type-registry.d.ts +8 -0
  93. package/esm/public/cli/commands/node-type-registry.js +343 -0
  94. package/esm/public/cli/commands/org-invite.js +22 -0
  95. package/esm/public/cli/commands/org-limit-aggregate.d.ts +8 -0
  96. package/esm/public/cli/commands/org-limit-aggregate.js +360 -0
  97. package/esm/public/cli/commands/org-limit-default.js +22 -0
  98. package/esm/public/cli/commands/org-limit-event.d.ts +8 -0
  99. package/esm/public/cli/commands/org-limit-event.js +210 -0
  100. package/esm/public/cli/commands/org-limit.js +66 -0
  101. package/esm/public/cli/commands/org-membership-setting.js +44 -0
  102. package/esm/public/cli/commands/plans-module.d.ts +8 -0
  103. package/esm/public/cli/commands/plans-module.js +426 -0
  104. package/esm/public/cli/commands/profiles-module.js +44 -0
  105. package/esm/public/cli/commands/storage-module.js +22 -44
  106. package/esm/public/cli/commands.js +45 -29
  107. package/esm/public/cli/executor.d.ts +38 -34
  108. package/esm/public/orm/index.d.ts +56 -43
  109. package/esm/public/orm/index.js +36 -18
  110. package/esm/public/orm/input-types.d.ts +2983 -1112
  111. package/esm/public/orm/input-types.js +9 -0
  112. package/esm/public/orm/models/agentMessage.d.ts +56 -0
  113. package/esm/public/orm/models/agentMessage.js +96 -0
  114. package/esm/public/orm/models/agentTask.d.ts +56 -0
  115. package/esm/public/orm/models/agentTask.js +96 -0
  116. package/esm/public/orm/models/agentThread.d.ts +56 -0
  117. package/esm/public/orm/models/agentThread.js +96 -0
  118. package/esm/public/orm/models/appLimitEvent.d.ts +32 -0
  119. package/esm/public/orm/models/appLimitEvent.js +51 -0
  120. package/esm/public/orm/models/billingModule.d.ts +56 -0
  121. package/esm/public/orm/models/billingModule.js +96 -0
  122. package/esm/public/orm/models/index.d.ts +18 -9
  123. package/esm/public/orm/models/index.js +18 -9
  124. package/esm/public/orm/models/nodeTypeRegistry.d.ts +56 -0
  125. package/esm/public/orm/models/nodeTypeRegistry.js +96 -0
  126. package/esm/public/orm/models/orgLimitAggregate.d.ts +56 -0
  127. package/esm/public/orm/models/orgLimitAggregate.js +96 -0
  128. package/esm/public/orm/models/orgLimitEvent.d.ts +32 -0
  129. package/esm/public/orm/models/orgLimitEvent.js +51 -0
  130. package/esm/public/orm/models/plansModule.d.ts +56 -0
  131. package/esm/public/orm/models/plansModule.js +96 -0
  132. package/esm/public/orm/mutation/index.d.ts +17 -31
  133. package/esm/public/orm/mutation/index.js +24 -36
  134. package/esm/public/orm/query/index.d.ts +28 -28
  135. package/esm/public/orm/query/index.js +48 -48
  136. package/objects/cli/commands.js +1 -3
  137. package/objects/cli/executor.d.ts +0 -5
  138. package/objects/orm/index.d.ts +0 -5
  139. package/objects/orm/input-types.d.ts +0 -20
  140. package/objects/orm/mutation/index.d.ts +1 -15
  141. package/objects/orm/mutation/index.js +0 -12
  142. package/package.json +4 -4
  143. package/public/cli/commands/agent-message.d.ts +8 -0
  144. package/public/cli/commands/agent-message.js +326 -0
  145. package/public/cli/commands/agent-task.d.ts +8 -0
  146. package/public/cli/commands/agent-task.js +370 -0
  147. package/public/cli/commands/agent-thread.d.ts +8 -0
  148. package/public/cli/commands/agent-thread.js +374 -0
  149. package/public/cli/commands/app-invite.js +22 -0
  150. package/public/cli/commands/app-limit-default.js +22 -0
  151. package/public/cli/commands/app-limit-event.d.ts +8 -0
  152. package/public/cli/commands/app-limit-event.js +212 -0
  153. package/public/cli/commands/app-limit.js +66 -0
  154. package/public/cli/commands/app-membership.js +0 -22
  155. package/public/cli/commands/billing-module.d.ts +8 -0
  156. package/public/cli/commands/billing-module.js +494 -0
  157. package/public/cli/commands/limits-module.js +22 -0
  158. package/public/cli/commands/node-type-registry.d.ts +8 -0
  159. package/public/cli/commands/node-type-registry.js +345 -0
  160. package/public/cli/commands/org-invite.js +22 -0
  161. package/public/cli/commands/org-limit-aggregate.d.ts +8 -0
  162. package/public/cli/commands/org-limit-aggregate.js +362 -0
  163. package/public/cli/commands/org-limit-default.js +22 -0
  164. package/public/cli/commands/org-limit-event.d.ts +8 -0
  165. package/public/cli/commands/org-limit-event.js +212 -0
  166. package/public/cli/commands/org-limit.js +66 -0
  167. package/public/cli/commands/org-membership-setting.js +44 -0
  168. package/public/cli/commands/plans-module.d.ts +8 -0
  169. package/public/cli/commands/plans-module.js +428 -0
  170. package/public/cli/commands/profiles-module.js +44 -0
  171. package/public/cli/commands/storage-module.js +22 -44
  172. package/public/cli/commands.js +45 -29
  173. package/public/cli/executor.d.ts +38 -34
  174. package/public/orm/index.d.ts +56 -43
  175. package/public/orm/index.js +36 -18
  176. package/public/orm/input-types.d.ts +2983 -1112
  177. package/public/orm/input-types.js +9 -0
  178. package/public/orm/models/agentMessage.d.ts +56 -0
  179. package/public/orm/models/agentMessage.js +100 -0
  180. package/public/orm/models/agentTask.d.ts +56 -0
  181. package/public/orm/models/agentTask.js +100 -0
  182. package/public/orm/models/agentThread.d.ts +56 -0
  183. package/public/orm/models/agentThread.js +100 -0
  184. package/public/orm/models/appLimitEvent.d.ts +32 -0
  185. package/public/orm/models/appLimitEvent.js +55 -0
  186. package/public/orm/models/billingModule.d.ts +56 -0
  187. package/public/orm/models/billingModule.js +100 -0
  188. package/public/orm/models/index.d.ts +18 -9
  189. package/public/orm/models/index.js +39 -21
  190. package/public/orm/models/nodeTypeRegistry.d.ts +56 -0
  191. package/public/orm/models/nodeTypeRegistry.js +100 -0
  192. package/public/orm/models/orgLimitAggregate.d.ts +56 -0
  193. package/public/orm/models/orgLimitAggregate.js +100 -0
  194. package/public/orm/models/orgLimitEvent.d.ts +32 -0
  195. package/public/orm/models/orgLimitEvent.js +55 -0
  196. package/public/orm/models/plansModule.d.ts +56 -0
  197. package/public/orm/models/plansModule.js +100 -0
  198. package/public/orm/mutation/index.d.ts +17 -31
  199. package/public/orm/mutation/index.js +24 -36
  200. package/public/orm/query/index.d.ts +28 -28
  201. package/public/orm/query/index.js +48 -48
  202. package/admin/cli/commands/confirm-upload.js +0 -36
  203. package/auth/cli/commands/confirm-upload.js +0 -36
  204. package/esm/admin/cli/commands/confirm-upload.js +0 -34
  205. package/esm/auth/cli/commands/confirm-upload.js +0 -34
  206. package/esm/objects/cli/commands/confirm-upload.d.ts +0 -8
  207. package/esm/objects/cli/commands/confirm-upload.js +0 -34
  208. package/esm/public/cli/commands/confirm-upload.d.ts +0 -8
  209. package/esm/public/cli/commands/confirm-upload.js +0 -34
  210. package/objects/cli/commands/confirm-upload.d.ts +0 -8
  211. package/objects/cli/commands/confirm-upload.js +0 -36
  212. package/public/cli/commands/confirm-upload.d.ts +0 -8
  213. package/public/cli/commands/confirm-upload.js +0 -36
@@ -0,0 +1,368 @@
1
+ /**
2
+ * CLI commands for AgentTask
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
+ threadId: 'uuid',
11
+ entityId: 'uuid',
12
+ description: 'string',
13
+ source: 'string',
14
+ error: 'string',
15
+ id: 'uuid',
16
+ createdAt: 'string',
17
+ updatedAt: 'string',
18
+ ownerId: 'uuid',
19
+ status: 'string',
20
+ };
21
+ const usage = '\nagent-task <command>\n\nCommands:\n list List agentTask records\n find-first Find first matching agentTask record\n get Get a agentTask by ID\n create Create a new agentTask\n update Update an existing agentTask\n delete Delete a agentTask\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
+ export 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 } = 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
+ description: true,
66
+ source: true,
67
+ error: true,
68
+ id: true,
69
+ createdAt: true,
70
+ updatedAt: true,
71
+ ownerId: true,
72
+ status: true,
73
+ };
74
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
75
+ const client = getClient();
76
+ const result = await client.agentTask.findMany(findManyArgs).execute();
77
+ console.log(JSON.stringify(result, null, 2));
78
+ }
79
+ catch (error) {
80
+ console.error('Failed to list records.');
81
+ if (error instanceof Error) {
82
+ console.error(error.message);
83
+ }
84
+ process.exit(1);
85
+ }
86
+ }
87
+ async function handleFindFirst(argv, _prompter) {
88
+ try {
89
+ const defaultSelect = {
90
+ threadId: true,
91
+ entityId: true,
92
+ description: true,
93
+ source: true,
94
+ error: true,
95
+ id: true,
96
+ createdAt: true,
97
+ updatedAt: true,
98
+ ownerId: true,
99
+ status: true,
100
+ };
101
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
102
+ const client = getClient();
103
+ const result = await client.agentTask.findFirst(findFirstArgs).execute();
104
+ console.log(JSON.stringify(result, null, 2));
105
+ }
106
+ catch (error) {
107
+ console.error('Failed to find record.');
108
+ if (error instanceof Error) {
109
+ console.error(error.message);
110
+ }
111
+ process.exit(1);
112
+ }
113
+ }
114
+ async function handleGet(argv, prompter) {
115
+ try {
116
+ const answers = await prompter.prompt(argv, [
117
+ {
118
+ type: 'text',
119
+ name: 'id',
120
+ message: 'id',
121
+ required: true,
122
+ },
123
+ ]);
124
+ const client = getClient();
125
+ const result = await client.agentTask
126
+ .findOne({
127
+ id: answers.id,
128
+ select: {
129
+ threadId: true,
130
+ entityId: true,
131
+ description: true,
132
+ source: true,
133
+ error: true,
134
+ id: true,
135
+ createdAt: true,
136
+ updatedAt: true,
137
+ ownerId: true,
138
+ status: true,
139
+ },
140
+ })
141
+ .execute();
142
+ console.log(JSON.stringify(result, null, 2));
143
+ }
144
+ catch (error) {
145
+ console.error('Record not found.');
146
+ if (error instanceof Error) {
147
+ console.error(error.message);
148
+ }
149
+ process.exit(1);
150
+ }
151
+ }
152
+ async function handleCreate(argv, prompter) {
153
+ try {
154
+ const rawAnswers = await prompter.prompt(argv, [
155
+ {
156
+ type: 'text',
157
+ name: 'threadId',
158
+ message: 'threadId',
159
+ required: true,
160
+ },
161
+ {
162
+ type: 'text',
163
+ name: 'entityId',
164
+ message: 'entityId',
165
+ required: true,
166
+ },
167
+ {
168
+ type: 'text',
169
+ name: 'description',
170
+ message: 'description',
171
+ required: true,
172
+ },
173
+ {
174
+ type: 'text',
175
+ name: 'source',
176
+ message: 'source',
177
+ required: false,
178
+ skipPrompt: true,
179
+ },
180
+ {
181
+ type: 'text',
182
+ name: 'error',
183
+ message: 'error',
184
+ required: false,
185
+ skipPrompt: true,
186
+ },
187
+ {
188
+ type: 'text',
189
+ name: 'ownerId',
190
+ message: 'ownerId',
191
+ required: false,
192
+ skipPrompt: true,
193
+ },
194
+ {
195
+ type: 'text',
196
+ name: 'status',
197
+ message: 'status',
198
+ required: false,
199
+ skipPrompt: true,
200
+ },
201
+ ]);
202
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
203
+ const cleanedData = stripUndefined(answers, fieldSchema);
204
+ const client = getClient();
205
+ const result = await client.agentTask
206
+ .create({
207
+ data: {
208
+ threadId: cleanedData.threadId,
209
+ entityId: cleanedData.entityId,
210
+ description: cleanedData.description,
211
+ source: cleanedData.source,
212
+ error: cleanedData.error,
213
+ ownerId: cleanedData.ownerId,
214
+ status: cleanedData.status,
215
+ },
216
+ select: {
217
+ threadId: true,
218
+ entityId: true,
219
+ description: true,
220
+ source: true,
221
+ error: true,
222
+ id: true,
223
+ createdAt: true,
224
+ updatedAt: true,
225
+ ownerId: true,
226
+ status: true,
227
+ },
228
+ })
229
+ .execute();
230
+ console.log(JSON.stringify(result, null, 2));
231
+ }
232
+ catch (error) {
233
+ console.error('Failed to create record.');
234
+ if (error instanceof Error) {
235
+ console.error(error.message);
236
+ }
237
+ process.exit(1);
238
+ }
239
+ }
240
+ async function handleUpdate(argv, prompter) {
241
+ try {
242
+ const rawAnswers = await prompter.prompt(argv, [
243
+ {
244
+ type: 'text',
245
+ name: 'id',
246
+ message: 'id',
247
+ required: true,
248
+ },
249
+ {
250
+ type: 'text',
251
+ name: 'threadId',
252
+ message: 'threadId',
253
+ required: false,
254
+ },
255
+ {
256
+ type: 'text',
257
+ name: 'entityId',
258
+ message: 'entityId',
259
+ required: false,
260
+ },
261
+ {
262
+ type: 'text',
263
+ name: 'description',
264
+ message: 'description',
265
+ required: false,
266
+ },
267
+ {
268
+ type: 'text',
269
+ name: 'source',
270
+ message: 'source',
271
+ required: false,
272
+ skipPrompt: true,
273
+ },
274
+ {
275
+ type: 'text',
276
+ name: 'error',
277
+ message: 'error',
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: 'status',
291
+ message: 'status',
292
+ required: false,
293
+ skipPrompt: true,
294
+ },
295
+ ]);
296
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
297
+ const cleanedData = stripUndefined(answers, fieldSchema);
298
+ const client = getClient();
299
+ const result = await client.agentTask
300
+ .update({
301
+ where: {
302
+ id: answers.id,
303
+ },
304
+ data: {
305
+ threadId: cleanedData.threadId,
306
+ entityId: cleanedData.entityId,
307
+ description: cleanedData.description,
308
+ source: cleanedData.source,
309
+ error: cleanedData.error,
310
+ ownerId: cleanedData.ownerId,
311
+ status: cleanedData.status,
312
+ },
313
+ select: {
314
+ threadId: true,
315
+ entityId: true,
316
+ description: true,
317
+ source: true,
318
+ error: true,
319
+ id: true,
320
+ createdAt: true,
321
+ updatedAt: true,
322
+ ownerId: true,
323
+ status: true,
324
+ },
325
+ })
326
+ .execute();
327
+ console.log(JSON.stringify(result, null, 2));
328
+ }
329
+ catch (error) {
330
+ console.error('Failed to update record.');
331
+ if (error instanceof Error) {
332
+ console.error(error.message);
333
+ }
334
+ process.exit(1);
335
+ }
336
+ }
337
+ async function handleDelete(argv, prompter) {
338
+ try {
339
+ const rawAnswers = await prompter.prompt(argv, [
340
+ {
341
+ type: 'text',
342
+ name: 'id',
343
+ message: 'id',
344
+ required: true,
345
+ },
346
+ ]);
347
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
348
+ const client = getClient();
349
+ const result = await client.agentTask
350
+ .delete({
351
+ where: {
352
+ id: answers.id,
353
+ },
354
+ select: {
355
+ id: true,
356
+ },
357
+ })
358
+ .execute();
359
+ console.log(JSON.stringify(result, null, 2));
360
+ }
361
+ catch (error) {
362
+ console.error('Failed to delete record.');
363
+ if (error instanceof Error) {
364
+ console.error(error.message);
365
+ }
366
+ process.exit(1);
367
+ }
368
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI commands for AgentThread
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;