@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,372 @@
1
+ /**
2
+ * CLI commands for AgentThread
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
+ title: 'string',
11
+ mode: 'string',
12
+ model: 'string',
13
+ systemPrompt: 'string',
14
+ id: 'uuid',
15
+ createdAt: 'string',
16
+ updatedAt: 'string',
17
+ ownerId: 'uuid',
18
+ entityId: 'uuid',
19
+ status: 'string',
20
+ };
21
+ 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';
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
+ title: true,
64
+ mode: true,
65
+ model: true,
66
+ systemPrompt: true,
67
+ id: true,
68
+ createdAt: true,
69
+ updatedAt: true,
70
+ ownerId: true,
71
+ entityId: true,
72
+ status: true,
73
+ };
74
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
75
+ const client = getClient();
76
+ const result = await client.agentThread.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
+ title: true,
91
+ mode: true,
92
+ model: true,
93
+ systemPrompt: true,
94
+ id: true,
95
+ createdAt: true,
96
+ updatedAt: true,
97
+ ownerId: true,
98
+ entityId: true,
99
+ status: true,
100
+ };
101
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
102
+ const client = getClient();
103
+ const result = await client.agentThread.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.agentThread
126
+ .findOne({
127
+ id: answers.id,
128
+ select: {
129
+ title: true,
130
+ mode: true,
131
+ model: true,
132
+ systemPrompt: true,
133
+ id: true,
134
+ createdAt: true,
135
+ updatedAt: true,
136
+ ownerId: true,
137
+ entityId: 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: 'title',
158
+ message: 'title',
159
+ required: false,
160
+ skipPrompt: true,
161
+ },
162
+ {
163
+ type: 'text',
164
+ name: 'mode',
165
+ message: 'mode',
166
+ required: false,
167
+ skipPrompt: true,
168
+ },
169
+ {
170
+ type: 'text',
171
+ name: 'model',
172
+ message: 'model',
173
+ required: false,
174
+ skipPrompt: true,
175
+ },
176
+ {
177
+ type: 'text',
178
+ name: 'systemPrompt',
179
+ message: 'systemPrompt',
180
+ required: false,
181
+ skipPrompt: true,
182
+ },
183
+ {
184
+ type: 'text',
185
+ name: 'ownerId',
186
+ message: 'ownerId',
187
+ required: false,
188
+ skipPrompt: true,
189
+ },
190
+ {
191
+ type: 'text',
192
+ name: 'entityId',
193
+ message: 'entityId',
194
+ required: true,
195
+ },
196
+ {
197
+ type: 'text',
198
+ name: 'status',
199
+ message: 'status',
200
+ required: false,
201
+ skipPrompt: true,
202
+ },
203
+ ]);
204
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
205
+ const cleanedData = stripUndefined(answers, fieldSchema);
206
+ const client = getClient();
207
+ const result = await client.agentThread
208
+ .create({
209
+ data: {
210
+ title: cleanedData.title,
211
+ mode: cleanedData.mode,
212
+ model: cleanedData.model,
213
+ systemPrompt: cleanedData.systemPrompt,
214
+ ownerId: cleanedData.ownerId,
215
+ entityId: cleanedData.entityId,
216
+ status: cleanedData.status,
217
+ },
218
+ select: {
219
+ title: true,
220
+ mode: true,
221
+ model: true,
222
+ systemPrompt: true,
223
+ id: true,
224
+ createdAt: true,
225
+ updatedAt: true,
226
+ ownerId: true,
227
+ entityId: true,
228
+ status: true,
229
+ },
230
+ })
231
+ .execute();
232
+ console.log(JSON.stringify(result, null, 2));
233
+ }
234
+ catch (error) {
235
+ console.error('Failed to create record.');
236
+ if (error instanceof Error) {
237
+ console.error(error.message);
238
+ }
239
+ process.exit(1);
240
+ }
241
+ }
242
+ async function handleUpdate(argv, prompter) {
243
+ try {
244
+ const rawAnswers = await prompter.prompt(argv, [
245
+ {
246
+ type: 'text',
247
+ name: 'id',
248
+ message: 'id',
249
+ required: true,
250
+ },
251
+ {
252
+ type: 'text',
253
+ name: 'title',
254
+ message: 'title',
255
+ required: false,
256
+ skipPrompt: true,
257
+ },
258
+ {
259
+ type: 'text',
260
+ name: 'mode',
261
+ message: 'mode',
262
+ required: false,
263
+ skipPrompt: true,
264
+ },
265
+ {
266
+ type: 'text',
267
+ name: 'model',
268
+ message: 'model',
269
+ required: false,
270
+ skipPrompt: true,
271
+ },
272
+ {
273
+ type: 'text',
274
+ name: 'systemPrompt',
275
+ message: 'systemPrompt',
276
+ required: false,
277
+ skipPrompt: true,
278
+ },
279
+ {
280
+ type: 'text',
281
+ name: 'ownerId',
282
+ message: 'ownerId',
283
+ required: false,
284
+ skipPrompt: true,
285
+ },
286
+ {
287
+ type: 'text',
288
+ name: 'entityId',
289
+ message: 'entityId',
290
+ required: false,
291
+ },
292
+ {
293
+ type: 'text',
294
+ name: 'status',
295
+ message: 'status',
296
+ required: false,
297
+ skipPrompt: true,
298
+ },
299
+ ]);
300
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
301
+ const cleanedData = stripUndefined(answers, fieldSchema);
302
+ const client = getClient();
303
+ const result = await client.agentThread
304
+ .update({
305
+ where: {
306
+ id: answers.id,
307
+ },
308
+ data: {
309
+ title: cleanedData.title,
310
+ mode: cleanedData.mode,
311
+ model: cleanedData.model,
312
+ systemPrompt: cleanedData.systemPrompt,
313
+ ownerId: cleanedData.ownerId,
314
+ entityId: cleanedData.entityId,
315
+ status: cleanedData.status,
316
+ },
317
+ select: {
318
+ title: true,
319
+ mode: true,
320
+ model: true,
321
+ systemPrompt: true,
322
+ id: true,
323
+ createdAt: true,
324
+ updatedAt: true,
325
+ ownerId: true,
326
+ entityId: true,
327
+ status: true,
328
+ },
329
+ })
330
+ .execute();
331
+ console.log(JSON.stringify(result, null, 2));
332
+ }
333
+ catch (error) {
334
+ console.error('Failed to update record.');
335
+ if (error instanceof Error) {
336
+ console.error(error.message);
337
+ }
338
+ process.exit(1);
339
+ }
340
+ }
341
+ async function handleDelete(argv, prompter) {
342
+ try {
343
+ const rawAnswers = await prompter.prompt(argv, [
344
+ {
345
+ type: 'text',
346
+ name: 'id',
347
+ message: 'id',
348
+ required: true,
349
+ },
350
+ ]);
351
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
352
+ const client = getClient();
353
+ const result = await client.agentThread
354
+ .delete({
355
+ where: {
356
+ id: answers.id,
357
+ },
358
+ select: {
359
+ id: true,
360
+ },
361
+ })
362
+ .execute();
363
+ console.log(JSON.stringify(result, null, 2));
364
+ }
365
+ catch (error) {
366
+ console.error('Failed to delete record.');
367
+ if (error instanceof Error) {
368
+ console.error(error.message);
369
+ }
370
+ process.exit(1);
371
+ }
372
+ }
@@ -16,6 +16,7 @@ const fieldSchema = {
16
16
  inviteCount: 'int',
17
17
  multiple: 'boolean',
18
18
  data: 'json',
19
+ profileId: 'uuid',
19
20
  expiresAt: 'string',
20
21
  createdAt: 'string',
21
22
  updatedAt: 'string',
@@ -71,6 +72,7 @@ async function handleList(argv, _prompter) {
71
72
  inviteCount: true,
72
73
  multiple: true,
73
74
  data: true,
75
+ profileId: true,
74
76
  expiresAt: true,
75
77
  createdAt: true,
76
78
  updatedAt: true,
@@ -100,6 +102,7 @@ async function handleFindFirst(argv, _prompter) {
100
102
  inviteCount: true,
101
103
  multiple: true,
102
104
  data: true,
105
+ profileId: true,
103
106
  expiresAt: true,
104
107
  createdAt: true,
105
108
  updatedAt: true,
@@ -141,6 +144,7 @@ async function handleGet(argv, prompter) {
141
144
  inviteCount: true,
142
145
  multiple: true,
143
146
  data: true,
147
+ profileId: true,
144
148
  expiresAt: true,
145
149
  createdAt: true,
146
150
  updatedAt: true,
@@ -216,6 +220,13 @@ async function handleCreate(argv, prompter) {
216
220
  required: false,
217
221
  skipPrompt: true,
218
222
  },
223
+ {
224
+ type: 'text',
225
+ name: 'profileId',
226
+ message: 'profileId',
227
+ required: false,
228
+ skipPrompt: true,
229
+ },
219
230
  {
220
231
  type: 'text',
221
232
  name: 'expiresAt',
@@ -238,6 +249,7 @@ async function handleCreate(argv, prompter) {
238
249
  inviteCount: cleanedData.inviteCount,
239
250
  multiple: cleanedData.multiple,
240
251
  data: cleanedData.data,
252
+ profileId: cleanedData.profileId,
241
253
  expiresAt: cleanedData.expiresAt,
242
254
  },
243
255
  select: {
@@ -250,6 +262,7 @@ async function handleCreate(argv, prompter) {
250
262
  inviteCount: true,
251
263
  multiple: true,
252
264
  data: true,
265
+ profileId: true,
253
266
  expiresAt: true,
254
267
  createdAt: true,
255
268
  updatedAt: true,
@@ -331,6 +344,13 @@ async function handleUpdate(argv, prompter) {
331
344
  required: false,
332
345
  skipPrompt: true,
333
346
  },
347
+ {
348
+ type: 'text',
349
+ name: 'profileId',
350
+ message: 'profileId',
351
+ required: false,
352
+ skipPrompt: true,
353
+ },
334
354
  {
335
355
  type: 'text',
336
356
  name: 'expiresAt',
@@ -356,6 +376,7 @@ async function handleUpdate(argv, prompter) {
356
376
  inviteCount: cleanedData.inviteCount,
357
377
  multiple: cleanedData.multiple,
358
378
  data: cleanedData.data,
379
+ profileId: cleanedData.profileId,
359
380
  expiresAt: cleanedData.expiresAt,
360
381
  },
361
382
  select: {
@@ -368,6 +389,7 @@ async function handleUpdate(argv, prompter) {
368
389
  inviteCount: true,
369
390
  multiple: true,
370
391
  data: true,
392
+ profileId: true,
371
393
  expiresAt: true,
372
394
  createdAt: true,
373
395
  updatedAt: true,
@@ -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 = '\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';
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 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;