@constructive-sdk/cli 0.22.3 → 0.22.4

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