@constructive-sdk/cli 0.22.3 → 0.22.5

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 (177) hide show
  1. package/admin/cli/commands/{app-achievement.d.ts → app-limit-warning.d.ts} +1 -1
  2. package/{public/cli/commands/app-step.js → admin/cli/commands/app-limit-warning.js} +58 -54
  3. package/{esm/admin/cli/commands/app-achievement.d.ts → admin/cli/commands/org-limit-warning.d.ts} +1 -1
  4. package/admin/cli/commands/{app-level.js → org-limit-warning.js} +66 -62
  5. package/admin/cli/commands.js +7 -15
  6. package/admin/cli/executor.d.ts +3 -15
  7. package/admin/orm/index.d.ts +6 -20
  8. package/admin/orm/index.js +6 -10
  9. package/admin/orm/input-types.d.ts +488 -768
  10. package/admin/orm/models/appLimitWarning.d.ts +54 -0
  11. package/{public/orm/models/secretsModule.js → admin/orm/models/appLimitWarning.js} +27 -27
  12. package/admin/orm/models/index.d.ts +3 -5
  13. package/admin/orm/models/index.js +7 -11
  14. package/admin/orm/models/orgLimitWarning.d.ts +54 -0
  15. package/admin/orm/models/{appAchievement.js → orgLimitWarning.js} +27 -27
  16. package/admin/orm/query/index.d.ts +1 -28
  17. package/admin/orm/query/index.js +0 -44
  18. package/{admin/cli/commands/app-step.d.ts → esm/admin/cli/commands/app-limit-warning.d.ts} +1 -1
  19. package/esm/{public/cli/commands/app-step.js → admin/cli/commands/app-limit-warning.js} +58 -54
  20. package/esm/admin/cli/commands/org-limit-warning.d.ts +8 -0
  21. package/esm/{public/cli/commands/app-level.js → admin/cli/commands/org-limit-warning.js} +66 -62
  22. package/esm/admin/cli/commands.js +7 -15
  23. package/esm/admin/cli/executor.d.ts +3 -15
  24. package/esm/admin/orm/index.d.ts +6 -20
  25. package/esm/admin/orm/index.js +6 -10
  26. package/esm/admin/orm/input-types.d.ts +488 -768
  27. package/esm/admin/orm/models/appLimitWarning.d.ts +54 -0
  28. package/esm/{public/orm/models/appAchievement.js → admin/orm/models/appLimitWarning.js} +25 -25
  29. package/esm/admin/orm/models/index.d.ts +3 -5
  30. package/esm/admin/orm/models/index.js +3 -5
  31. package/esm/admin/orm/models/orgLimitWarning.d.ts +54 -0
  32. package/esm/admin/orm/models/{appAchievement.js → orgLimitWarning.js} +25 -25
  33. package/esm/admin/orm/query/index.d.ts +1 -28
  34. package/esm/admin/orm/query/index.js +0 -44
  35. package/esm/public/cli/commands/app-limit-warning.d.ts +8 -0
  36. package/esm/{admin/cli/commands/app-step.js → public/cli/commands/app-limit-warning.js} +58 -54
  37. package/esm/public/cli/commands/construct-blueprint.js +1 -1
  38. package/esm/public/cli/commands/create-user-database.js +1 -1
  39. package/esm/public/cli/commands/embedding-chunk.js +66 -0
  40. package/esm/public/cli/commands/entity-type-provision.js +22 -0
  41. package/esm/{admin/cli/commands/app-level.d.ts → public/cli/commands/events-module.d.ts} +1 -1
  42. package/esm/public/cli/commands/{levels-module.js → events-module.js} +438 -152
  43. package/esm/public/cli/commands/limits-module.js +88 -0
  44. package/esm/public/cli/commands/org-limit-warning.d.ts +8 -0
  45. package/esm/{admin/cli/commands/app-level.js → public/cli/commands/org-limit-warning.js} +66 -62
  46. package/esm/public/cli/commands/partition.js +24 -24
  47. package/{admin/cli/commands/app-level-requirement.d.ts → esm/public/cli/commands/rate-limit-meters-module.d.ts} +1 -1
  48. package/esm/public/cli/commands/rate-limit-meters-module.js +448 -0
  49. package/esm/public/cli/commands/realtime-module.js +24 -24
  50. package/esm/public/cli/commands/user-state-module.d.ts +8 -0
  51. package/esm/public/cli/commands/{secrets-module.js → user-state-module.js} +8 -8
  52. package/esm/public/cli/commands.js +11 -17
  53. package/esm/public/cli/executor.d.ts +5 -16
  54. package/esm/public/orm/index.d.ts +10 -22
  55. package/esm/public/orm/index.js +10 -12
  56. package/esm/public/orm/input-types.d.ts +1024 -919
  57. package/esm/public/orm/input-types.js +3 -5
  58. package/esm/public/orm/models/appLimitWarning.d.ts +54 -0
  59. package/esm/{admin/orm/models/appLevel.js → public/orm/models/appLimitWarning.js} +25 -25
  60. package/esm/public/orm/models/eventsModule.d.ts +54 -0
  61. package/esm/public/orm/models/{levelsModule.js → eventsModule.js} +25 -25
  62. package/esm/public/orm/models/index.d.ts +5 -6
  63. package/esm/public/orm/models/index.js +5 -6
  64. package/esm/public/orm/models/orgLimitWarning.d.ts +54 -0
  65. package/esm/{admin/orm/models/appStep.js → public/orm/models/orgLimitWarning.js} +25 -25
  66. package/esm/public/orm/models/rateLimitMetersModule.d.ts +54 -0
  67. package/esm/{admin/orm/models/appLevelRequirement.js → public/orm/models/rateLimitMetersModule.js} +25 -25
  68. package/esm/public/orm/models/userStateModule.d.ts +54 -0
  69. package/esm/public/orm/models/userStateModule.js +100 -0
  70. package/esm/public/orm/mutation/index.d.ts +2 -2
  71. package/esm/public/orm/query/index.d.ts +1 -28
  72. package/esm/public/orm/query/index.js +0 -44
  73. package/package.json +4 -4
  74. package/public/cli/commands/app-limit-warning.d.ts +8 -0
  75. package/{admin/cli/commands/app-step.js → public/cli/commands/app-limit-warning.js} +58 -54
  76. package/public/cli/commands/construct-blueprint.js +1 -1
  77. package/public/cli/commands/create-user-database.js +1 -1
  78. package/public/cli/commands/embedding-chunk.js +66 -0
  79. package/public/cli/commands/entity-type-provision.js +22 -0
  80. package/{admin/cli/commands/app-level.d.ts → public/cli/commands/events-module.d.ts} +1 -1
  81. package/public/cli/commands/{levels-module.js → events-module.js} +438 -152
  82. package/public/cli/commands/limits-module.js +88 -0
  83. package/public/cli/commands/org-limit-warning.d.ts +8 -0
  84. package/public/cli/commands/{app-level.js → org-limit-warning.js} +66 -62
  85. package/public/cli/commands/partition.js +24 -24
  86. package/public/cli/commands/rate-limit-meters-module.d.ts +8 -0
  87. package/public/cli/commands/rate-limit-meters-module.js +450 -0
  88. package/public/cli/commands/realtime-module.js +24 -24
  89. package/public/cli/commands/user-state-module.d.ts +8 -0
  90. package/public/cli/commands/{secrets-module.js → user-state-module.js} +8 -8
  91. package/public/cli/commands.js +11 -17
  92. package/public/cli/executor.d.ts +5 -16
  93. package/public/orm/index.d.ts +10 -22
  94. package/public/orm/index.js +10 -12
  95. package/public/orm/input-types.d.ts +1024 -919
  96. package/public/orm/input-types.js +3 -5
  97. package/public/orm/models/appLimitWarning.d.ts +54 -0
  98. package/{admin/orm/models/appStep.js → public/orm/models/appLimitWarning.js} +27 -27
  99. package/public/orm/models/eventsModule.d.ts +54 -0
  100. package/public/orm/models/{levelsModule.js → eventsModule.js} +27 -27
  101. package/public/orm/models/index.d.ts +5 -6
  102. package/public/orm/models/index.js +13 -15
  103. package/public/orm/models/orgLimitWarning.d.ts +54 -0
  104. package/{admin/orm/models/appLevel.js → public/orm/models/orgLimitWarning.js} +27 -27
  105. package/public/orm/models/rateLimitMetersModule.d.ts +54 -0
  106. package/public/orm/models/{appAchievement.js → rateLimitMetersModule.js} +27 -27
  107. package/public/orm/models/userStateModule.d.ts +54 -0
  108. package/public/orm/models/userStateModule.js +104 -0
  109. package/public/orm/mutation/index.d.ts +2 -2
  110. package/public/orm/query/index.d.ts +1 -28
  111. package/public/orm/query/index.js +0 -44
  112. package/admin/cli/commands/app-achievement.js +0 -286
  113. package/admin/cli/commands/app-level-requirement.js +0 -328
  114. package/admin/cli/commands/steps-achieved.d.ts +0 -8
  115. package/admin/cli/commands/steps-achieved.js +0 -35
  116. package/admin/cli/commands/steps-required.d.ts +0 -8
  117. package/admin/cli/commands/steps-required.js +0 -54
  118. package/admin/orm/models/appAchievement.d.ts +0 -54
  119. package/admin/orm/models/appLevel.d.ts +0 -54
  120. package/admin/orm/models/appLevelRequirement.d.ts +0 -54
  121. package/admin/orm/models/appLevelRequirement.js +0 -104
  122. package/admin/orm/models/appStep.d.ts +0 -54
  123. package/esm/admin/cli/commands/app-achievement.js +0 -284
  124. package/esm/admin/cli/commands/app-level-requirement.d.ts +0 -8
  125. package/esm/admin/cli/commands/app-level-requirement.js +0 -326
  126. package/esm/admin/cli/commands/app-step.d.ts +0 -8
  127. package/esm/admin/cli/commands/steps-achieved.d.ts +0 -8
  128. package/esm/admin/cli/commands/steps-achieved.js +0 -33
  129. package/esm/admin/cli/commands/steps-required.d.ts +0 -8
  130. package/esm/admin/cli/commands/steps-required.js +0 -52
  131. package/esm/admin/orm/models/appAchievement.d.ts +0 -54
  132. package/esm/admin/orm/models/appLevel.d.ts +0 -54
  133. package/esm/admin/orm/models/appLevelRequirement.d.ts +0 -54
  134. package/esm/admin/orm/models/appStep.d.ts +0 -54
  135. package/esm/public/cli/commands/app-achievement.d.ts +0 -8
  136. package/esm/public/cli/commands/app-achievement.js +0 -284
  137. package/esm/public/cli/commands/app-level-requirement.d.ts +0 -8
  138. package/esm/public/cli/commands/app-level-requirement.js +0 -326
  139. package/esm/public/cli/commands/app-level.d.ts +0 -8
  140. package/esm/public/cli/commands/app-step.d.ts +0 -8
  141. package/esm/public/cli/commands/levels-module.d.ts +0 -8
  142. package/esm/public/cli/commands/secrets-module.d.ts +0 -8
  143. package/esm/public/cli/commands/steps-achieved.d.ts +0 -8
  144. package/esm/public/cli/commands/steps-achieved.js +0 -33
  145. package/esm/public/cli/commands/steps-required.d.ts +0 -8
  146. package/esm/public/cli/commands/steps-required.js +0 -52
  147. package/esm/public/orm/models/appAchievement.d.ts +0 -54
  148. package/esm/public/orm/models/appLevel.d.ts +0 -54
  149. package/esm/public/orm/models/appLevel.js +0 -100
  150. package/esm/public/orm/models/appLevelRequirement.d.ts +0 -54
  151. package/esm/public/orm/models/appLevelRequirement.js +0 -100
  152. package/esm/public/orm/models/appStep.d.ts +0 -54
  153. package/esm/public/orm/models/appStep.js +0 -100
  154. package/esm/public/orm/models/levelsModule.d.ts +0 -54
  155. package/esm/public/orm/models/secretsModule.d.ts +0 -54
  156. package/esm/public/orm/models/secretsModule.js +0 -100
  157. package/public/cli/commands/app-achievement.d.ts +0 -8
  158. package/public/cli/commands/app-achievement.js +0 -286
  159. package/public/cli/commands/app-level-requirement.d.ts +0 -8
  160. package/public/cli/commands/app-level-requirement.js +0 -328
  161. package/public/cli/commands/app-level.d.ts +0 -8
  162. package/public/cli/commands/app-step.d.ts +0 -8
  163. package/public/cli/commands/levels-module.d.ts +0 -8
  164. package/public/cli/commands/secrets-module.d.ts +0 -8
  165. package/public/cli/commands/steps-achieved.d.ts +0 -8
  166. package/public/cli/commands/steps-achieved.js +0 -35
  167. package/public/cli/commands/steps-required.d.ts +0 -8
  168. package/public/cli/commands/steps-required.js +0 -54
  169. package/public/orm/models/appAchievement.d.ts +0 -54
  170. package/public/orm/models/appLevel.d.ts +0 -54
  171. package/public/orm/models/appLevel.js +0 -104
  172. package/public/orm/models/appLevelRequirement.d.ts +0 -54
  173. package/public/orm/models/appLevelRequirement.js +0 -104
  174. package/public/orm/models/appStep.d.ts +0 -54
  175. package/public/orm/models/appStep.js +0 -104
  176. package/public/orm/models/levelsModule.d.ts +0 -54
  177. package/public/orm/models/secretsModule.d.ts +0 -54
@@ -1,286 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * CLI commands for AppAchievement
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
- actorId: 'uuid',
14
- name: 'string',
15
- count: 'int',
16
- createdAt: 'string',
17
- updatedAt: 'string',
18
- };
19
- const usage = '\napp-achievement <command>\n\nCommands:\n list List appAchievement records\n find-first Find first matching appAchievement record\n get Get a appAchievement by ID\n create Create a new appAchievement\n update Update an existing appAchievement\n delete Delete a appAchievement\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 --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n';
20
- exports.default = async (argv, prompter, _options) => {
21
- if (argv.help || argv.h) {
22
- console.log(usage);
23
- process.exit(0);
24
- }
25
- const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
26
- if (!subcommand) {
27
- const answer = await prompter.prompt(argv, [
28
- {
29
- type: 'autocomplete',
30
- name: 'subcommand',
31
- message: 'What do you want to do?',
32
- options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
33
- },
34
- ]);
35
- return handleTableSubcommand(answer.subcommand, newArgv, prompter);
36
- }
37
- return handleTableSubcommand(subcommand, newArgv, prompter);
38
- };
39
- async function handleTableSubcommand(subcommand, argv, prompter) {
40
- switch (subcommand) {
41
- case 'list':
42
- return handleList(argv, prompter);
43
- case 'find-first':
44
- return handleFindFirst(argv, prompter);
45
- case 'get':
46
- return handleGet(argv, prompter);
47
- case 'create':
48
- return handleCreate(argv, prompter);
49
- case 'update':
50
- return handleUpdate(argv, prompter);
51
- case 'delete':
52
- return handleDelete(argv, prompter);
53
- default:
54
- console.log(usage);
55
- process.exit(1);
56
- }
57
- }
58
- async function handleList(argv, _prompter) {
59
- try {
60
- const defaultSelect = {
61
- id: true,
62
- actorId: true,
63
- name: true,
64
- count: true,
65
- createdAt: true,
66
- updatedAt: true,
67
- };
68
- const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
69
- const client = (0, executor_1.getClient)();
70
- const result = await client.appAchievement.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
- id: true,
85
- actorId: true,
86
- name: true,
87
- count: true,
88
- createdAt: true,
89
- updatedAt: true,
90
- };
91
- const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
92
- const client = (0, executor_1.getClient)();
93
- const result = await client.appAchievement.findFirst(findFirstArgs).execute();
94
- console.log(JSON.stringify(result, null, 2));
95
- }
96
- catch (error) {
97
- console.error('Failed to find record.');
98
- if (error instanceof Error) {
99
- console.error(error.message);
100
- }
101
- process.exit(1);
102
- }
103
- }
104
- async function handleGet(argv, prompter) {
105
- try {
106
- const answers = await prompter.prompt(argv, [
107
- {
108
- type: 'text',
109
- name: 'id',
110
- message: 'id',
111
- required: true,
112
- },
113
- ]);
114
- const client = (0, executor_1.getClient)();
115
- const result = await client.appAchievement
116
- .findOne({
117
- id: answers.id,
118
- select: {
119
- id: true,
120
- actorId: true,
121
- name: true,
122
- count: true,
123
- createdAt: true,
124
- updatedAt: true,
125
- },
126
- })
127
- .execute();
128
- console.log(JSON.stringify(result, null, 2));
129
- }
130
- catch (error) {
131
- console.error('Record not found.');
132
- if (error instanceof Error) {
133
- console.error(error.message);
134
- }
135
- process.exit(1);
136
- }
137
- }
138
- async function handleCreate(argv, prompter) {
139
- try {
140
- const rawAnswers = await prompter.prompt(argv, [
141
- {
142
- type: 'text',
143
- name: 'actorId',
144
- message: 'actorId',
145
- required: false,
146
- skipPrompt: true,
147
- },
148
- {
149
- type: 'text',
150
- name: 'name',
151
- message: 'name',
152
- required: true,
153
- },
154
- {
155
- type: 'text',
156
- name: 'count',
157
- message: 'count',
158
- required: false,
159
- skipPrompt: true,
160
- },
161
- ]);
162
- const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
163
- const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
164
- const client = (0, executor_1.getClient)();
165
- const result = await client.appAchievement
166
- .create({
167
- data: {
168
- actorId: cleanedData.actorId,
169
- name: cleanedData.name,
170
- count: cleanedData.count,
171
- },
172
- select: {
173
- id: true,
174
- actorId: true,
175
- name: true,
176
- count: true,
177
- createdAt: true,
178
- updatedAt: true,
179
- },
180
- })
181
- .execute();
182
- console.log(JSON.stringify(result, null, 2));
183
- }
184
- catch (error) {
185
- console.error('Failed to create record.');
186
- if (error instanceof Error) {
187
- console.error(error.message);
188
- }
189
- process.exit(1);
190
- }
191
- }
192
- async function handleUpdate(argv, prompter) {
193
- try {
194
- const rawAnswers = await prompter.prompt(argv, [
195
- {
196
- type: 'text',
197
- name: 'id',
198
- message: 'id',
199
- required: true,
200
- },
201
- {
202
- type: 'text',
203
- name: 'actorId',
204
- message: 'actorId',
205
- required: false,
206
- skipPrompt: true,
207
- },
208
- {
209
- type: 'text',
210
- name: 'name',
211
- message: 'name',
212
- required: false,
213
- },
214
- {
215
- type: 'text',
216
- name: 'count',
217
- message: 'count',
218
- required: false,
219
- skipPrompt: true,
220
- },
221
- ]);
222
- const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
223
- const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
224
- const client = (0, executor_1.getClient)();
225
- const result = await client.appAchievement
226
- .update({
227
- where: {
228
- id: answers.id,
229
- },
230
- data: {
231
- actorId: cleanedData.actorId,
232
- name: cleanedData.name,
233
- count: cleanedData.count,
234
- },
235
- select: {
236
- id: true,
237
- actorId: true,
238
- name: true,
239
- count: true,
240
- createdAt: true,
241
- updatedAt: true,
242
- },
243
- })
244
- .execute();
245
- console.log(JSON.stringify(result, null, 2));
246
- }
247
- catch (error) {
248
- console.error('Failed to update record.');
249
- if (error instanceof Error) {
250
- console.error(error.message);
251
- }
252
- process.exit(1);
253
- }
254
- }
255
- async function handleDelete(argv, prompter) {
256
- try {
257
- const rawAnswers = await prompter.prompt(argv, [
258
- {
259
- type: 'text',
260
- name: 'id',
261
- message: 'id',
262
- required: true,
263
- },
264
- ]);
265
- const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
266
- const client = (0, executor_1.getClient)();
267
- const result = await client.appAchievement
268
- .delete({
269
- where: {
270
- id: answers.id,
271
- },
272
- select: {
273
- id: true,
274
- },
275
- })
276
- .execute();
277
- console.log(JSON.stringify(result, null, 2));
278
- }
279
- catch (error) {
280
- console.error('Failed to delete record.');
281
- if (error instanceof Error) {
282
- console.error(error.message);
283
- }
284
- process.exit(1);
285
- }
286
- }
@@ -1,328 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * CLI commands for AppLevelRequirement
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
- level: 'string',
15
- description: 'string',
16
- requiredCount: 'int',
17
- priority: 'int',
18
- createdAt: 'string',
19
- updatedAt: 'string',
20
- };
21
- const usage = '\napp-level-requirement <command>\n\nCommands:\n list List appLevelRequirement records\n find-first Find first matching appLevelRequirement record\n get Get a appLevelRequirement by ID\n create Create a new appLevelRequirement\n update Update an existing appLevelRequirement\n delete Delete a appLevelRequirement\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 --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\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
- level: true,
66
- description: true,
67
- requiredCount: true,
68
- priority: true,
69
- createdAt: true,
70
- updatedAt: true,
71
- };
72
- const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
73
- const client = (0, executor_1.getClient)();
74
- const result = await client.appLevelRequirement.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
- level: true,
91
- description: true,
92
- requiredCount: true,
93
- priority: true,
94
- createdAt: true,
95
- updatedAt: true,
96
- };
97
- const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
98
- const client = (0, executor_1.getClient)();
99
- const result = await client.appLevelRequirement.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.appLevelRequirement
122
- .findOne({
123
- id: answers.id,
124
- select: {
125
- id: true,
126
- name: true,
127
- level: true,
128
- description: true,
129
- requiredCount: true,
130
- priority: true,
131
- createdAt: true,
132
- updatedAt: 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: true,
154
- },
155
- {
156
- type: 'text',
157
- name: 'level',
158
- message: 'level',
159
- required: true,
160
- },
161
- {
162
- type: 'text',
163
- name: 'description',
164
- message: 'description',
165
- required: false,
166
- skipPrompt: true,
167
- },
168
- {
169
- type: 'text',
170
- name: 'requiredCount',
171
- message: 'requiredCount',
172
- required: false,
173
- skipPrompt: true,
174
- },
175
- {
176
- type: 'text',
177
- name: 'priority',
178
- message: 'priority',
179
- required: false,
180
- skipPrompt: true,
181
- },
182
- ]);
183
- const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
184
- const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
185
- const client = (0, executor_1.getClient)();
186
- const result = await client.appLevelRequirement
187
- .create({
188
- data: {
189
- name: cleanedData.name,
190
- level: cleanedData.level,
191
- description: cleanedData.description,
192
- requiredCount: cleanedData.requiredCount,
193
- priority: cleanedData.priority,
194
- },
195
- select: {
196
- id: true,
197
- name: true,
198
- level: true,
199
- description: true,
200
- requiredCount: true,
201
- priority: true,
202
- createdAt: true,
203
- updatedAt: true,
204
- },
205
- })
206
- .execute();
207
- console.log(JSON.stringify(result, null, 2));
208
- }
209
- catch (error) {
210
- console.error('Failed to create record.');
211
- if (error instanceof Error) {
212
- console.error(error.message);
213
- }
214
- process.exit(1);
215
- }
216
- }
217
- async function handleUpdate(argv, prompter) {
218
- try {
219
- const rawAnswers = await prompter.prompt(argv, [
220
- {
221
- type: 'text',
222
- name: 'id',
223
- message: 'id',
224
- required: true,
225
- },
226
- {
227
- type: 'text',
228
- name: 'name',
229
- message: 'name',
230
- required: false,
231
- },
232
- {
233
- type: 'text',
234
- name: 'level',
235
- message: 'level',
236
- required: false,
237
- },
238
- {
239
- type: 'text',
240
- name: 'description',
241
- message: 'description',
242
- required: false,
243
- skipPrompt: true,
244
- },
245
- {
246
- type: 'text',
247
- name: 'requiredCount',
248
- message: 'requiredCount',
249
- required: false,
250
- skipPrompt: true,
251
- },
252
- {
253
- type: 'text',
254
- name: 'priority',
255
- message: 'priority',
256
- required: false,
257
- skipPrompt: true,
258
- },
259
- ]);
260
- const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
261
- const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
262
- const client = (0, executor_1.getClient)();
263
- const result = await client.appLevelRequirement
264
- .update({
265
- where: {
266
- id: answers.id,
267
- },
268
- data: {
269
- name: cleanedData.name,
270
- level: cleanedData.level,
271
- description: cleanedData.description,
272
- requiredCount: cleanedData.requiredCount,
273
- priority: cleanedData.priority,
274
- },
275
- select: {
276
- id: true,
277
- name: true,
278
- level: true,
279
- description: true,
280
- requiredCount: true,
281
- priority: true,
282
- createdAt: true,
283
- updatedAt: true,
284
- },
285
- })
286
- .execute();
287
- console.log(JSON.stringify(result, null, 2));
288
- }
289
- catch (error) {
290
- console.error('Failed to update record.');
291
- if (error instanceof Error) {
292
- console.error(error.message);
293
- }
294
- process.exit(1);
295
- }
296
- }
297
- async function handleDelete(argv, prompter) {
298
- try {
299
- const rawAnswers = await prompter.prompt(argv, [
300
- {
301
- type: 'text',
302
- name: 'id',
303
- message: 'id',
304
- required: true,
305
- },
306
- ]);
307
- const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
308
- const client = (0, executor_1.getClient)();
309
- const result = await client.appLevelRequirement
310
- .delete({
311
- where: {
312
- id: answers.id,
313
- },
314
- select: {
315
- id: true,
316
- },
317
- })
318
- .execute();
319
- console.log(JSON.stringify(result, null, 2));
320
- }
321
- catch (error) {
322
- console.error('Failed to delete record.');
323
- if (error instanceof Error) {
324
- console.error(error.message);
325
- }
326
- process.exit(1);
327
- }
328
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * CLI command for query stepsAchieved
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;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const executor_1 = require("../executor");
4
- exports.default = async (argv, prompter, _options) => {
5
- try {
6
- if (argv.help || argv.h) {
7
- console.log('steps-achieved - stepsAchieved\n\nUsage: steps-achieved [OPTIONS]\n');
8
- process.exit(0);
9
- }
10
- const answers = await prompter.prompt(argv, [
11
- {
12
- type: 'text',
13
- name: 'level',
14
- message: 'level',
15
- },
16
- {
17
- type: 'text',
18
- name: 'roleId',
19
- message: 'roleId',
20
- },
21
- ]);
22
- const client = (0, executor_1.getClient)();
23
- const result = await client.query
24
- .stepsAchieved(answers)
25
- .execute();
26
- console.log(JSON.stringify(result, null, 2));
27
- }
28
- catch (error) {
29
- console.error('Failed: stepsAchieved');
30
- if (error instanceof Error) {
31
- console.error(error.message);
32
- }
33
- process.exit(1);
34
- }
35
- };
@@ -1,8 +0,0 @@
1
- /**
2
- * CLI command for query stepsRequired
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;