@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
@@ -0,0 +1,448 @@
1
+ /**
2
+ * CLI commands for RateLimitMetersModule
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
+ id: 'uuid',
11
+ databaseId: 'uuid',
12
+ schemaId: 'uuid',
13
+ privateSchemaId: 'uuid',
14
+ rateLimitStateTableId: 'uuid',
15
+ rateLimitStateTableName: 'string',
16
+ rateLimitOverridesTableId: 'uuid',
17
+ rateLimitOverridesTableName: 'string',
18
+ rateWindowLimitsTableId: 'uuid',
19
+ rateWindowLimitsTableName: 'string',
20
+ checkRateLimitFunction: 'string',
21
+ prefix: 'string',
22
+ };
23
+ const usage = '\nrate-limit-meters-module <command>\n\nCommands:\n list List rateLimitMetersModule records\n find-first Find first matching rateLimitMetersModule record\n get Get a rateLimitMetersModule by ID\n create Create a new rateLimitMetersModule\n update Update an existing rateLimitMetersModule\n delete Delete a rateLimitMetersModule\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';
24
+ export default async (argv, prompter, _options) => {
25
+ if (argv.help || argv.h) {
26
+ console.log(usage);
27
+ process.exit(0);
28
+ }
29
+ const { first: subcommand, newArgv } = extractFirst(argv);
30
+ if (!subcommand) {
31
+ const answer = await prompter.prompt(argv, [
32
+ {
33
+ type: 'autocomplete',
34
+ name: 'subcommand',
35
+ message: 'What do you want to do?',
36
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
37
+ },
38
+ ]);
39
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
40
+ }
41
+ return handleTableSubcommand(subcommand, newArgv, prompter);
42
+ };
43
+ async function handleTableSubcommand(subcommand, argv, prompter) {
44
+ switch (subcommand) {
45
+ case 'list':
46
+ return handleList(argv, prompter);
47
+ case 'find-first':
48
+ return handleFindFirst(argv, prompter);
49
+ case 'get':
50
+ return handleGet(argv, prompter);
51
+ case 'create':
52
+ return handleCreate(argv, prompter);
53
+ case 'update':
54
+ return handleUpdate(argv, prompter);
55
+ case 'delete':
56
+ return handleDelete(argv, prompter);
57
+ default:
58
+ console.log(usage);
59
+ process.exit(1);
60
+ }
61
+ }
62
+ async function handleList(argv, _prompter) {
63
+ try {
64
+ const defaultSelect = {
65
+ id: true,
66
+ databaseId: true,
67
+ schemaId: true,
68
+ privateSchemaId: true,
69
+ rateLimitStateTableId: true,
70
+ rateLimitStateTableName: true,
71
+ rateLimitOverridesTableId: true,
72
+ rateLimitOverridesTableName: true,
73
+ rateWindowLimitsTableId: true,
74
+ rateWindowLimitsTableName: true,
75
+ checkRateLimitFunction: true,
76
+ prefix: true,
77
+ };
78
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
79
+ const client = getClient();
80
+ const result = await client.rateLimitMetersModule.findMany(findManyArgs).execute();
81
+ console.log(JSON.stringify(result, null, 2));
82
+ }
83
+ catch (error) {
84
+ console.error('Failed to list records.');
85
+ if (error instanceof Error) {
86
+ console.error(error.message);
87
+ }
88
+ process.exit(1);
89
+ }
90
+ }
91
+ async function handleFindFirst(argv, _prompter) {
92
+ try {
93
+ const defaultSelect = {
94
+ id: true,
95
+ databaseId: true,
96
+ schemaId: true,
97
+ privateSchemaId: true,
98
+ rateLimitStateTableId: true,
99
+ rateLimitStateTableName: true,
100
+ rateLimitOverridesTableId: true,
101
+ rateLimitOverridesTableName: true,
102
+ rateWindowLimitsTableId: true,
103
+ rateWindowLimitsTableName: true,
104
+ checkRateLimitFunction: true,
105
+ prefix: true,
106
+ };
107
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
108
+ const client = getClient();
109
+ const result = await client.rateLimitMetersModule.findFirst(findFirstArgs).execute();
110
+ console.log(JSON.stringify(result, null, 2));
111
+ }
112
+ catch (error) {
113
+ console.error('Failed to find record.');
114
+ if (error instanceof Error) {
115
+ console.error(error.message);
116
+ }
117
+ process.exit(1);
118
+ }
119
+ }
120
+ async function handleGet(argv, prompter) {
121
+ try {
122
+ const answers = await prompter.prompt(argv, [
123
+ {
124
+ type: 'text',
125
+ name: 'id',
126
+ message: 'id',
127
+ required: true,
128
+ },
129
+ ]);
130
+ const client = getClient();
131
+ const result = await client.rateLimitMetersModule
132
+ .findOne({
133
+ id: answers.id,
134
+ select: {
135
+ id: true,
136
+ databaseId: true,
137
+ schemaId: true,
138
+ privateSchemaId: true,
139
+ rateLimitStateTableId: true,
140
+ rateLimitStateTableName: true,
141
+ rateLimitOverridesTableId: true,
142
+ rateLimitOverridesTableName: true,
143
+ rateWindowLimitsTableId: true,
144
+ rateWindowLimitsTableName: true,
145
+ checkRateLimitFunction: true,
146
+ prefix: true,
147
+ },
148
+ })
149
+ .execute();
150
+ console.log(JSON.stringify(result, null, 2));
151
+ }
152
+ catch (error) {
153
+ console.error('Record not found.');
154
+ if (error instanceof Error) {
155
+ console.error(error.message);
156
+ }
157
+ process.exit(1);
158
+ }
159
+ }
160
+ async function handleCreate(argv, prompter) {
161
+ try {
162
+ const rawAnswers = await prompter.prompt(argv, [
163
+ {
164
+ type: 'text',
165
+ name: 'databaseId',
166
+ message: 'databaseId',
167
+ required: true,
168
+ },
169
+ {
170
+ type: 'text',
171
+ name: 'schemaId',
172
+ message: 'schemaId',
173
+ required: false,
174
+ skipPrompt: true,
175
+ },
176
+ {
177
+ type: 'text',
178
+ name: 'privateSchemaId',
179
+ message: 'privateSchemaId',
180
+ required: false,
181
+ skipPrompt: true,
182
+ },
183
+ {
184
+ type: 'text',
185
+ name: 'rateLimitStateTableId',
186
+ message: 'rateLimitStateTableId',
187
+ required: false,
188
+ skipPrompt: true,
189
+ },
190
+ {
191
+ type: 'text',
192
+ name: 'rateLimitStateTableName',
193
+ message: 'rateLimitStateTableName',
194
+ required: false,
195
+ skipPrompt: true,
196
+ },
197
+ {
198
+ type: 'text',
199
+ name: 'rateLimitOverridesTableId',
200
+ message: 'rateLimitOverridesTableId',
201
+ required: false,
202
+ skipPrompt: true,
203
+ },
204
+ {
205
+ type: 'text',
206
+ name: 'rateLimitOverridesTableName',
207
+ message: 'rateLimitOverridesTableName',
208
+ required: false,
209
+ skipPrompt: true,
210
+ },
211
+ {
212
+ type: 'text',
213
+ name: 'rateWindowLimitsTableId',
214
+ message: 'rateWindowLimitsTableId',
215
+ required: false,
216
+ skipPrompt: true,
217
+ },
218
+ {
219
+ type: 'text',
220
+ name: 'rateWindowLimitsTableName',
221
+ message: 'rateWindowLimitsTableName',
222
+ required: false,
223
+ skipPrompt: true,
224
+ },
225
+ {
226
+ type: 'text',
227
+ name: 'checkRateLimitFunction',
228
+ message: 'checkRateLimitFunction',
229
+ required: false,
230
+ skipPrompt: true,
231
+ },
232
+ {
233
+ type: 'text',
234
+ name: 'prefix',
235
+ message: 'prefix',
236
+ required: false,
237
+ skipPrompt: true,
238
+ },
239
+ ]);
240
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
241
+ const cleanedData = stripUndefined(answers, fieldSchema);
242
+ const client = getClient();
243
+ const result = await client.rateLimitMetersModule
244
+ .create({
245
+ data: {
246
+ databaseId: cleanedData.databaseId,
247
+ schemaId: cleanedData.schemaId,
248
+ privateSchemaId: cleanedData.privateSchemaId,
249
+ rateLimitStateTableId: cleanedData.rateLimitStateTableId,
250
+ rateLimitStateTableName: cleanedData.rateLimitStateTableName,
251
+ rateLimitOverridesTableId: cleanedData.rateLimitOverridesTableId,
252
+ rateLimitOverridesTableName: cleanedData.rateLimitOverridesTableName,
253
+ rateWindowLimitsTableId: cleanedData.rateWindowLimitsTableId,
254
+ rateWindowLimitsTableName: cleanedData.rateWindowLimitsTableName,
255
+ checkRateLimitFunction: cleanedData.checkRateLimitFunction,
256
+ prefix: cleanedData.prefix,
257
+ },
258
+ select: {
259
+ id: true,
260
+ databaseId: true,
261
+ schemaId: true,
262
+ privateSchemaId: true,
263
+ rateLimitStateTableId: true,
264
+ rateLimitStateTableName: true,
265
+ rateLimitOverridesTableId: true,
266
+ rateLimitOverridesTableName: true,
267
+ rateWindowLimitsTableId: true,
268
+ rateWindowLimitsTableName: true,
269
+ checkRateLimitFunction: true,
270
+ prefix: true,
271
+ },
272
+ })
273
+ .execute();
274
+ console.log(JSON.stringify(result, null, 2));
275
+ }
276
+ catch (error) {
277
+ console.error('Failed to create record.');
278
+ if (error instanceof Error) {
279
+ console.error(error.message);
280
+ }
281
+ process.exit(1);
282
+ }
283
+ }
284
+ async function handleUpdate(argv, prompter) {
285
+ try {
286
+ const rawAnswers = await prompter.prompt(argv, [
287
+ {
288
+ type: 'text',
289
+ name: 'id',
290
+ message: 'id',
291
+ required: true,
292
+ },
293
+ {
294
+ type: 'text',
295
+ name: 'databaseId',
296
+ message: 'databaseId',
297
+ required: false,
298
+ },
299
+ {
300
+ type: 'text',
301
+ name: 'schemaId',
302
+ message: 'schemaId',
303
+ required: false,
304
+ skipPrompt: true,
305
+ },
306
+ {
307
+ type: 'text',
308
+ name: 'privateSchemaId',
309
+ message: 'privateSchemaId',
310
+ required: false,
311
+ skipPrompt: true,
312
+ },
313
+ {
314
+ type: 'text',
315
+ name: 'rateLimitStateTableId',
316
+ message: 'rateLimitStateTableId',
317
+ required: false,
318
+ skipPrompt: true,
319
+ },
320
+ {
321
+ type: 'text',
322
+ name: 'rateLimitStateTableName',
323
+ message: 'rateLimitStateTableName',
324
+ required: false,
325
+ skipPrompt: true,
326
+ },
327
+ {
328
+ type: 'text',
329
+ name: 'rateLimitOverridesTableId',
330
+ message: 'rateLimitOverridesTableId',
331
+ required: false,
332
+ skipPrompt: true,
333
+ },
334
+ {
335
+ type: 'text',
336
+ name: 'rateLimitOverridesTableName',
337
+ message: 'rateLimitOverridesTableName',
338
+ required: false,
339
+ skipPrompt: true,
340
+ },
341
+ {
342
+ type: 'text',
343
+ name: 'rateWindowLimitsTableId',
344
+ message: 'rateWindowLimitsTableId',
345
+ required: false,
346
+ skipPrompt: true,
347
+ },
348
+ {
349
+ type: 'text',
350
+ name: 'rateWindowLimitsTableName',
351
+ message: 'rateWindowLimitsTableName',
352
+ required: false,
353
+ skipPrompt: true,
354
+ },
355
+ {
356
+ type: 'text',
357
+ name: 'checkRateLimitFunction',
358
+ message: 'checkRateLimitFunction',
359
+ required: false,
360
+ skipPrompt: true,
361
+ },
362
+ {
363
+ type: 'text',
364
+ name: 'prefix',
365
+ message: 'prefix',
366
+ required: false,
367
+ skipPrompt: true,
368
+ },
369
+ ]);
370
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
371
+ const cleanedData = stripUndefined(answers, fieldSchema);
372
+ const client = getClient();
373
+ const result = await client.rateLimitMetersModule
374
+ .update({
375
+ where: {
376
+ id: answers.id,
377
+ },
378
+ data: {
379
+ databaseId: cleanedData.databaseId,
380
+ schemaId: cleanedData.schemaId,
381
+ privateSchemaId: cleanedData.privateSchemaId,
382
+ rateLimitStateTableId: cleanedData.rateLimitStateTableId,
383
+ rateLimitStateTableName: cleanedData.rateLimitStateTableName,
384
+ rateLimitOverridesTableId: cleanedData.rateLimitOverridesTableId,
385
+ rateLimitOverridesTableName: cleanedData.rateLimitOverridesTableName,
386
+ rateWindowLimitsTableId: cleanedData.rateWindowLimitsTableId,
387
+ rateWindowLimitsTableName: cleanedData.rateWindowLimitsTableName,
388
+ checkRateLimitFunction: cleanedData.checkRateLimitFunction,
389
+ prefix: cleanedData.prefix,
390
+ },
391
+ select: {
392
+ id: true,
393
+ databaseId: true,
394
+ schemaId: true,
395
+ privateSchemaId: true,
396
+ rateLimitStateTableId: true,
397
+ rateLimitStateTableName: true,
398
+ rateLimitOverridesTableId: true,
399
+ rateLimitOverridesTableName: true,
400
+ rateWindowLimitsTableId: true,
401
+ rateWindowLimitsTableName: true,
402
+ checkRateLimitFunction: true,
403
+ prefix: true,
404
+ },
405
+ })
406
+ .execute();
407
+ console.log(JSON.stringify(result, null, 2));
408
+ }
409
+ catch (error) {
410
+ console.error('Failed to update record.');
411
+ if (error instanceof Error) {
412
+ console.error(error.message);
413
+ }
414
+ process.exit(1);
415
+ }
416
+ }
417
+ async function handleDelete(argv, prompter) {
418
+ try {
419
+ const rawAnswers = await prompter.prompt(argv, [
420
+ {
421
+ type: 'text',
422
+ name: 'id',
423
+ message: 'id',
424
+ required: true,
425
+ },
426
+ ]);
427
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
428
+ const client = getClient();
429
+ const result = await client.rateLimitMetersModule
430
+ .delete({
431
+ where: {
432
+ id: answers.id,
433
+ },
434
+ select: {
435
+ id: true,
436
+ },
437
+ })
438
+ .execute();
439
+ console.log(JSON.stringify(result, null, 2));
440
+ }
441
+ catch (error) {
442
+ console.error('Failed to delete record.');
443
+ if (error instanceof Error) {
444
+ console.error(error.message);
445
+ }
446
+ process.exit(1);
447
+ }
448
+ }
@@ -16,8 +16,8 @@ const fieldSchema = {
16
16
  listenerNodeTableId: 'uuid',
17
17
  sourceRegistryTableId: 'uuid',
18
18
  retentionHours: 'int',
19
- lookaheadHours: 'int',
20
- partitionInterval: 'string',
19
+ premake: 'int',
20
+ interval: 'string',
21
21
  notifyChannel: 'string',
22
22
  };
23
23
  const usage = '\nrealtime-module <command>\n\nCommands:\n list List realtimeModule records\n find-first Find first matching realtimeModule record\n get Get a realtimeModule by ID\n create Create a new realtimeModule\n update Update an existing realtimeModule\n delete Delete a realtimeModule\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';
@@ -71,8 +71,8 @@ async function handleList(argv, _prompter) {
71
71
  listenerNodeTableId: true,
72
72
  sourceRegistryTableId: true,
73
73
  retentionHours: true,
74
- lookaheadHours: true,
75
- partitionInterval: true,
74
+ premake: true,
75
+ interval: true,
76
76
  notifyChannel: true,
77
77
  };
78
78
  const findManyArgs = parseFindManyArgs(argv, defaultSelect);
@@ -100,8 +100,8 @@ async function handleFindFirst(argv, _prompter) {
100
100
  listenerNodeTableId: true,
101
101
  sourceRegistryTableId: true,
102
102
  retentionHours: true,
103
- lookaheadHours: true,
104
- partitionInterval: true,
103
+ premake: true,
104
+ interval: true,
105
105
  notifyChannel: true,
106
106
  };
107
107
  const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
@@ -141,8 +141,8 @@ async function handleGet(argv, prompter) {
141
141
  listenerNodeTableId: true,
142
142
  sourceRegistryTableId: true,
143
143
  retentionHours: true,
144
- lookaheadHours: true,
145
- partitionInterval: true,
144
+ premake: true,
145
+ interval: true,
146
146
  notifyChannel: true,
147
147
  },
148
148
  })
@@ -217,15 +217,15 @@ async function handleCreate(argv, prompter) {
217
217
  },
218
218
  {
219
219
  type: 'text',
220
- name: 'lookaheadHours',
221
- message: 'lookaheadHours',
220
+ name: 'premake',
221
+ message: 'premake',
222
222
  required: false,
223
223
  skipPrompt: true,
224
224
  },
225
225
  {
226
226
  type: 'text',
227
- name: 'partitionInterval',
228
- message: 'partitionInterval',
227
+ name: 'interval',
228
+ message: 'interval',
229
229
  required: false,
230
230
  skipPrompt: true,
231
231
  },
@@ -251,8 +251,8 @@ async function handleCreate(argv, prompter) {
251
251
  listenerNodeTableId: cleanedData.listenerNodeTableId,
252
252
  sourceRegistryTableId: cleanedData.sourceRegistryTableId,
253
253
  retentionHours: cleanedData.retentionHours,
254
- lookaheadHours: cleanedData.lookaheadHours,
255
- partitionInterval: cleanedData.partitionInterval,
254
+ premake: cleanedData.premake,
255
+ interval: cleanedData.interval,
256
256
  notifyChannel: cleanedData.notifyChannel,
257
257
  },
258
258
  select: {
@@ -265,8 +265,8 @@ async function handleCreate(argv, prompter) {
265
265
  listenerNodeTableId: true,
266
266
  sourceRegistryTableId: true,
267
267
  retentionHours: true,
268
- lookaheadHours: true,
269
- partitionInterval: true,
268
+ premake: true,
269
+ interval: true,
270
270
  notifyChannel: true,
271
271
  },
272
272
  })
@@ -347,15 +347,15 @@ async function handleUpdate(argv, prompter) {
347
347
  },
348
348
  {
349
349
  type: 'text',
350
- name: 'lookaheadHours',
351
- message: 'lookaheadHours',
350
+ name: 'premake',
351
+ message: 'premake',
352
352
  required: false,
353
353
  skipPrompt: true,
354
354
  },
355
355
  {
356
356
  type: 'text',
357
- name: 'partitionInterval',
358
- message: 'partitionInterval',
357
+ name: 'interval',
358
+ message: 'interval',
359
359
  required: false,
360
360
  skipPrompt: true,
361
361
  },
@@ -384,8 +384,8 @@ async function handleUpdate(argv, prompter) {
384
384
  listenerNodeTableId: cleanedData.listenerNodeTableId,
385
385
  sourceRegistryTableId: cleanedData.sourceRegistryTableId,
386
386
  retentionHours: cleanedData.retentionHours,
387
- lookaheadHours: cleanedData.lookaheadHours,
388
- partitionInterval: cleanedData.partitionInterval,
387
+ premake: cleanedData.premake,
388
+ interval: cleanedData.interval,
389
389
  notifyChannel: cleanedData.notifyChannel,
390
390
  },
391
391
  select: {
@@ -398,8 +398,8 @@ async function handleUpdate(argv, prompter) {
398
398
  listenerNodeTableId: true,
399
399
  sourceRegistryTableId: true,
400
400
  retentionHours: true,
401
- lookaheadHours: true,
402
- partitionInterval: true,
401
+ premake: true,
402
+ interval: true,
403
403
  notifyChannel: true,
404
404
  },
405
405
  })
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI commands for UserStateModule
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,5 +1,5 @@
1
1
  /**
2
- * CLI commands for SecretsModule
2
+ * CLI commands for UserStateModule
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -13,7 +13,7 @@ const fieldSchema = {
13
13
  tableId: 'uuid',
14
14
  tableName: 'string',
15
15
  };
16
- const usage = '\nsecrets-module <command>\n\nCommands:\n list List secretsModule records\n find-first Find first matching secretsModule record\n get Get a secretsModule by ID\n create Create a new secretsModule\n update Update an existing secretsModule\n delete Delete a secretsModule\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';
16
+ const usage = '\nuser-state-module <command>\n\nCommands:\n list List userStateModule records\n find-first Find first matching userStateModule record\n get Get a userStateModule by ID\n create Create a new userStateModule\n update Update an existing userStateModule\n delete Delete a userStateModule\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';
17
17
  export default async (argv, prompter, _options) => {
18
18
  if (argv.help || argv.h) {
19
19
  console.log(usage);
@@ -63,7 +63,7 @@ async function handleList(argv, _prompter) {
63
63
  };
64
64
  const findManyArgs = parseFindManyArgs(argv, defaultSelect);
65
65
  const client = getClient();
66
- const result = await client.secretsModule.findMany(findManyArgs).execute();
66
+ const result = await client.userStateModule.findMany(findManyArgs).execute();
67
67
  console.log(JSON.stringify(result, null, 2));
68
68
  }
69
69
  catch (error) {
@@ -85,7 +85,7 @@ async function handleFindFirst(argv, _prompter) {
85
85
  };
86
86
  const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
87
87
  const client = getClient();
88
- const result = await client.secretsModule.findFirst(findFirstArgs).execute();
88
+ const result = await client.userStateModule.findFirst(findFirstArgs).execute();
89
89
  console.log(JSON.stringify(result, null, 2));
90
90
  }
91
91
  catch (error) {
@@ -107,7 +107,7 @@ async function handleGet(argv, prompter) {
107
107
  },
108
108
  ]);
109
109
  const client = getClient();
110
- const result = await client.secretsModule
110
+ const result = await client.userStateModule
111
111
  .findOne({
112
112
  id: answers.id,
113
113
  select: {
@@ -163,7 +163,7 @@ async function handleCreate(argv, prompter) {
163
163
  const answers = coerceAnswers(rawAnswers, fieldSchema);
164
164
  const cleanedData = stripUndefined(answers, fieldSchema);
165
165
  const client = getClient();
166
- const result = await client.secretsModule
166
+ const result = await client.userStateModule
167
167
  .create({
168
168
  data: {
169
169
  databaseId: cleanedData.databaseId,
@@ -230,7 +230,7 @@ async function handleUpdate(argv, prompter) {
230
230
  const answers = coerceAnswers(rawAnswers, fieldSchema);
231
231
  const cleanedData = stripUndefined(answers, fieldSchema);
232
232
  const client = getClient();
233
- const result = await client.secretsModule
233
+ const result = await client.userStateModule
234
234
  .update({
235
235
  where: {
236
236
  id: answers.id,
@@ -272,7 +272,7 @@ async function handleDelete(argv, prompter) {
272
272
  ]);
273
273
  const answers = coerceAnswers(rawAnswers, fieldSchema);
274
274
  const client = getClient();
275
- const result = await client.secretsModule
275
+ const result = await client.userStateModule
276
276
  .delete({
277
277
  where: {
278
278
  id: answers.id,