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