@constructive-sdk/cli 0.17.1 → 0.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/admin/cli/commands/app-invite.js +22 -0
  2. package/admin/cli/commands/app-limit-default.js +22 -0
  3. package/admin/cli/commands/{confirm-upload.d.ts → app-limit-event.d.ts} +1 -1
  4. package/admin/cli/commands/app-limit-event.js +212 -0
  5. package/admin/cli/commands/app-limit.js +66 -0
  6. package/admin/cli/commands/app-membership.js +0 -22
  7. package/admin/cli/commands/org-invite.js +22 -0
  8. package/{esm/admin/cli/commands/confirm-upload.d.ts → admin/cli/commands/org-limit-aggregate.d.ts} +1 -1
  9. package/admin/cli/commands/org-limit-aggregate.js +362 -0
  10. package/admin/cli/commands/org-limit-default.js +22 -0
  11. package/{auth/cli/commands/confirm-upload.d.ts → admin/cli/commands/org-limit-event.d.ts} +1 -1
  12. package/admin/cli/commands/org-limit-event.js +212 -0
  13. package/admin/cli/commands/org-limit.js +66 -0
  14. package/admin/cli/commands/org-membership-setting.js +44 -0
  15. package/admin/cli/commands.js +25 -21
  16. package/admin/cli/executor.d.ts +12 -14
  17. package/admin/orm/index.d.ts +24 -23
  18. package/admin/orm/index.js +24 -18
  19. package/admin/orm/input-types.d.ts +1297 -839
  20. package/admin/orm/models/appLimitEvent.d.ts +32 -0
  21. package/admin/orm/models/appLimitEvent.js +55 -0
  22. package/admin/orm/models/index.d.ts +12 -9
  23. package/admin/orm/models/index.js +25 -19
  24. package/admin/orm/models/orgLimitAggregate.d.ts +56 -0
  25. package/admin/orm/models/orgLimitAggregate.js +100 -0
  26. package/admin/orm/models/orgLimitEvent.d.ts +32 -0
  27. package/admin/orm/models/orgLimitEvent.js +55 -0
  28. package/admin/orm/mutation/index.d.ts +1 -15
  29. package/admin/orm/mutation/index.js +0 -12
  30. package/auth/cli/commands.js +1 -3
  31. package/auth/cli/executor.d.ts +0 -5
  32. package/auth/orm/index.d.ts +0 -5
  33. package/auth/orm/input-types.d.ts +0 -20
  34. package/auth/orm/mutation/index.d.ts +1 -15
  35. package/auth/orm/mutation/index.js +0 -12
  36. package/esm/admin/cli/commands/app-invite.js +22 -0
  37. package/esm/admin/cli/commands/app-limit-default.js +22 -0
  38. package/esm/{auth/cli/commands/confirm-upload.d.ts → admin/cli/commands/app-limit-event.d.ts} +1 -1
  39. package/esm/admin/cli/commands/app-limit-event.js +210 -0
  40. package/esm/admin/cli/commands/app-limit.js +66 -0
  41. package/esm/admin/cli/commands/app-membership.js +0 -22
  42. package/esm/admin/cli/commands/org-invite.js +22 -0
  43. package/esm/admin/cli/commands/org-limit-aggregate.d.ts +8 -0
  44. package/esm/admin/cli/commands/org-limit-aggregate.js +360 -0
  45. package/esm/admin/cli/commands/org-limit-default.js +22 -0
  46. package/esm/admin/cli/commands/org-limit-event.d.ts +8 -0
  47. package/esm/admin/cli/commands/org-limit-event.js +210 -0
  48. package/esm/admin/cli/commands/org-limit.js +66 -0
  49. package/esm/admin/cli/commands/org-membership-setting.js +44 -0
  50. package/esm/admin/cli/commands.js +25 -21
  51. package/esm/admin/cli/executor.d.ts +12 -14
  52. package/esm/admin/orm/index.d.ts +24 -23
  53. package/esm/admin/orm/index.js +24 -18
  54. package/esm/admin/orm/input-types.d.ts +1297 -839
  55. package/esm/admin/orm/models/appLimitEvent.d.ts +32 -0
  56. package/esm/admin/orm/models/appLimitEvent.js +51 -0
  57. package/esm/admin/orm/models/index.d.ts +12 -9
  58. package/esm/admin/orm/models/index.js +12 -9
  59. package/esm/admin/orm/models/orgLimitAggregate.d.ts +56 -0
  60. package/esm/admin/orm/models/orgLimitAggregate.js +96 -0
  61. package/esm/admin/orm/models/orgLimitEvent.d.ts +32 -0
  62. package/esm/admin/orm/models/orgLimitEvent.js +51 -0
  63. package/esm/admin/orm/mutation/index.d.ts +1 -15
  64. package/esm/admin/orm/mutation/index.js +0 -12
  65. package/esm/auth/cli/commands.js +1 -3
  66. package/esm/auth/cli/executor.d.ts +0 -5
  67. package/esm/auth/orm/index.d.ts +0 -5
  68. package/esm/auth/orm/input-types.d.ts +0 -20
  69. package/esm/auth/orm/mutation/index.d.ts +1 -15
  70. package/esm/auth/orm/mutation/index.js +0 -12
  71. package/esm/objects/cli/commands.js +1 -3
  72. package/esm/objects/cli/executor.d.ts +0 -5
  73. package/esm/objects/orm/index.d.ts +0 -5
  74. package/esm/objects/orm/input-types.d.ts +0 -20
  75. package/esm/objects/orm/mutation/index.d.ts +1 -15
  76. package/esm/objects/orm/mutation/index.js +0 -12
  77. package/esm/public/cli/commands/agent-message.d.ts +8 -0
  78. package/esm/public/cli/commands/agent-message.js +324 -0
  79. package/esm/public/cli/commands/agent-task.d.ts +8 -0
  80. package/esm/public/cli/commands/agent-task.js +368 -0
  81. package/esm/public/cli/commands/agent-thread.d.ts +8 -0
  82. package/esm/public/cli/commands/agent-thread.js +372 -0
  83. package/esm/public/cli/commands/app-invite.js +22 -0
  84. package/esm/public/cli/commands/app-limit-default.js +22 -0
  85. package/esm/public/cli/commands/app-limit-event.d.ts +8 -0
  86. package/esm/public/cli/commands/app-limit-event.js +210 -0
  87. package/esm/public/cli/commands/app-limit.js +66 -0
  88. package/esm/public/cli/commands/app-membership.js +0 -22
  89. package/esm/public/cli/commands/billing-module.d.ts +8 -0
  90. package/esm/public/cli/commands/billing-module.js +492 -0
  91. package/esm/public/cli/commands/limits-module.js +22 -0
  92. package/esm/public/cli/commands/node-type-registry.d.ts +8 -0
  93. package/esm/public/cli/commands/node-type-registry.js +343 -0
  94. package/esm/public/cli/commands/org-invite.js +22 -0
  95. package/esm/public/cli/commands/org-limit-aggregate.d.ts +8 -0
  96. package/esm/public/cli/commands/org-limit-aggregate.js +360 -0
  97. package/esm/public/cli/commands/org-limit-default.js +22 -0
  98. package/esm/public/cli/commands/org-limit-event.d.ts +8 -0
  99. package/esm/public/cli/commands/org-limit-event.js +210 -0
  100. package/esm/public/cli/commands/org-limit.js +66 -0
  101. package/esm/public/cli/commands/org-membership-setting.js +44 -0
  102. package/esm/public/cli/commands/plans-module.d.ts +8 -0
  103. package/esm/public/cli/commands/plans-module.js +426 -0
  104. package/esm/public/cli/commands/profiles-module.js +44 -0
  105. package/esm/public/cli/commands/storage-module.js +22 -44
  106. package/esm/public/cli/commands.js +45 -29
  107. package/esm/public/cli/executor.d.ts +38 -34
  108. package/esm/public/orm/index.d.ts +56 -43
  109. package/esm/public/orm/index.js +36 -18
  110. package/esm/public/orm/input-types.d.ts +2983 -1112
  111. package/esm/public/orm/input-types.js +9 -0
  112. package/esm/public/orm/models/agentMessage.d.ts +56 -0
  113. package/esm/public/orm/models/agentMessage.js +96 -0
  114. package/esm/public/orm/models/agentTask.d.ts +56 -0
  115. package/esm/public/orm/models/agentTask.js +96 -0
  116. package/esm/public/orm/models/agentThread.d.ts +56 -0
  117. package/esm/public/orm/models/agentThread.js +96 -0
  118. package/esm/public/orm/models/appLimitEvent.d.ts +32 -0
  119. package/esm/public/orm/models/appLimitEvent.js +51 -0
  120. package/esm/public/orm/models/billingModule.d.ts +56 -0
  121. package/esm/public/orm/models/billingModule.js +96 -0
  122. package/esm/public/orm/models/index.d.ts +18 -9
  123. package/esm/public/orm/models/index.js +18 -9
  124. package/esm/public/orm/models/nodeTypeRegistry.d.ts +56 -0
  125. package/esm/public/orm/models/nodeTypeRegistry.js +96 -0
  126. package/esm/public/orm/models/orgLimitAggregate.d.ts +56 -0
  127. package/esm/public/orm/models/orgLimitAggregate.js +96 -0
  128. package/esm/public/orm/models/orgLimitEvent.d.ts +32 -0
  129. package/esm/public/orm/models/orgLimitEvent.js +51 -0
  130. package/esm/public/orm/models/plansModule.d.ts +56 -0
  131. package/esm/public/orm/models/plansModule.js +96 -0
  132. package/esm/public/orm/mutation/index.d.ts +17 -31
  133. package/esm/public/orm/mutation/index.js +24 -36
  134. package/esm/public/orm/query/index.d.ts +28 -28
  135. package/esm/public/orm/query/index.js +48 -48
  136. package/objects/cli/commands.js +1 -3
  137. package/objects/cli/executor.d.ts +0 -5
  138. package/objects/orm/index.d.ts +0 -5
  139. package/objects/orm/input-types.d.ts +0 -20
  140. package/objects/orm/mutation/index.d.ts +1 -15
  141. package/objects/orm/mutation/index.js +0 -12
  142. package/package.json +4 -4
  143. package/public/cli/commands/agent-message.d.ts +8 -0
  144. package/public/cli/commands/agent-message.js +326 -0
  145. package/public/cli/commands/agent-task.d.ts +8 -0
  146. package/public/cli/commands/agent-task.js +370 -0
  147. package/public/cli/commands/agent-thread.d.ts +8 -0
  148. package/public/cli/commands/agent-thread.js +374 -0
  149. package/public/cli/commands/app-invite.js +22 -0
  150. package/public/cli/commands/app-limit-default.js +22 -0
  151. package/public/cli/commands/app-limit-event.d.ts +8 -0
  152. package/public/cli/commands/app-limit-event.js +212 -0
  153. package/public/cli/commands/app-limit.js +66 -0
  154. package/public/cli/commands/app-membership.js +0 -22
  155. package/public/cli/commands/billing-module.d.ts +8 -0
  156. package/public/cli/commands/billing-module.js +494 -0
  157. package/public/cli/commands/limits-module.js +22 -0
  158. package/public/cli/commands/node-type-registry.d.ts +8 -0
  159. package/public/cli/commands/node-type-registry.js +345 -0
  160. package/public/cli/commands/org-invite.js +22 -0
  161. package/public/cli/commands/org-limit-aggregate.d.ts +8 -0
  162. package/public/cli/commands/org-limit-aggregate.js +362 -0
  163. package/public/cli/commands/org-limit-default.js +22 -0
  164. package/public/cli/commands/org-limit-event.d.ts +8 -0
  165. package/public/cli/commands/org-limit-event.js +212 -0
  166. package/public/cli/commands/org-limit.js +66 -0
  167. package/public/cli/commands/org-membership-setting.js +44 -0
  168. package/public/cli/commands/plans-module.d.ts +8 -0
  169. package/public/cli/commands/plans-module.js +428 -0
  170. package/public/cli/commands/profiles-module.js +44 -0
  171. package/public/cli/commands/storage-module.js +22 -44
  172. package/public/cli/commands.js +45 -29
  173. package/public/cli/executor.d.ts +38 -34
  174. package/public/orm/index.d.ts +56 -43
  175. package/public/orm/index.js +36 -18
  176. package/public/orm/input-types.d.ts +2983 -1112
  177. package/public/orm/input-types.js +9 -0
  178. package/public/orm/models/agentMessage.d.ts +56 -0
  179. package/public/orm/models/agentMessage.js +100 -0
  180. package/public/orm/models/agentTask.d.ts +56 -0
  181. package/public/orm/models/agentTask.js +100 -0
  182. package/public/orm/models/agentThread.d.ts +56 -0
  183. package/public/orm/models/agentThread.js +100 -0
  184. package/public/orm/models/appLimitEvent.d.ts +32 -0
  185. package/public/orm/models/appLimitEvent.js +55 -0
  186. package/public/orm/models/billingModule.d.ts +56 -0
  187. package/public/orm/models/billingModule.js +100 -0
  188. package/public/orm/models/index.d.ts +18 -9
  189. package/public/orm/models/index.js +39 -21
  190. package/public/orm/models/nodeTypeRegistry.d.ts +56 -0
  191. package/public/orm/models/nodeTypeRegistry.js +100 -0
  192. package/public/orm/models/orgLimitAggregate.d.ts +56 -0
  193. package/public/orm/models/orgLimitAggregate.js +100 -0
  194. package/public/orm/models/orgLimitEvent.d.ts +32 -0
  195. package/public/orm/models/orgLimitEvent.js +55 -0
  196. package/public/orm/models/plansModule.d.ts +56 -0
  197. package/public/orm/models/plansModule.js +100 -0
  198. package/public/orm/mutation/index.d.ts +17 -31
  199. package/public/orm/mutation/index.js +24 -36
  200. package/public/orm/query/index.d.ts +28 -28
  201. package/public/orm/query/index.js +48 -48
  202. package/admin/cli/commands/confirm-upload.js +0 -36
  203. package/auth/cli/commands/confirm-upload.js +0 -36
  204. package/esm/admin/cli/commands/confirm-upload.js +0 -34
  205. package/esm/auth/cli/commands/confirm-upload.js +0 -34
  206. package/esm/objects/cli/commands/confirm-upload.d.ts +0 -8
  207. package/esm/objects/cli/commands/confirm-upload.js +0 -34
  208. package/esm/public/cli/commands/confirm-upload.d.ts +0 -8
  209. package/esm/public/cli/commands/confirm-upload.js +0 -34
  210. package/objects/cli/commands/confirm-upload.d.ts +0 -8
  211. package/objects/cli/commands/confirm-upload.js +0 -36
  212. package/public/cli/commands/confirm-upload.d.ts +0 -8
  213. package/public/cli/commands/confirm-upload.js +0 -36
@@ -0,0 +1,494 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * CLI commands for BillingModule
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
+ metersTableId: 'uuid',
17
+ metersTableName: 'string',
18
+ planSubscriptionsTableId: 'uuid',
19
+ planSubscriptionsTableName: 'string',
20
+ ledgerTableId: 'uuid',
21
+ ledgerTableName: 'string',
22
+ balancesTableId: 'uuid',
23
+ balancesTableName: 'string',
24
+ recordUsageFunction: 'string',
25
+ prefix: 'string',
26
+ };
27
+ const usage = '\nbilling-module <command>\n\nCommands:\n list List billingModule records\n find-first Find first matching billingModule record\n get Get a billingModule by ID\n create Create a new billingModule\n update Update an existing billingModule\n delete Delete a billingModule\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
28
+ exports.default = async (argv, prompter, _options) => {
29
+ if (argv.help || argv.h) {
30
+ console.log(usage);
31
+ process.exit(0);
32
+ }
33
+ const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
34
+ if (!subcommand) {
35
+ const answer = await prompter.prompt(argv, [
36
+ {
37
+ type: 'autocomplete',
38
+ name: 'subcommand',
39
+ message: 'What do you want to do?',
40
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
41
+ },
42
+ ]);
43
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
44
+ }
45
+ return handleTableSubcommand(subcommand, newArgv, prompter);
46
+ };
47
+ async function handleTableSubcommand(subcommand, argv, prompter) {
48
+ switch (subcommand) {
49
+ case 'list':
50
+ return handleList(argv, prompter);
51
+ case 'find-first':
52
+ return handleFindFirst(argv, prompter);
53
+ case 'get':
54
+ return handleGet(argv, prompter);
55
+ case 'create':
56
+ return handleCreate(argv, prompter);
57
+ case 'update':
58
+ return handleUpdate(argv, prompter);
59
+ case 'delete':
60
+ return handleDelete(argv, prompter);
61
+ default:
62
+ console.log(usage);
63
+ process.exit(1);
64
+ }
65
+ }
66
+ async function handleList(argv, _prompter) {
67
+ try {
68
+ const defaultSelect = {
69
+ id: true,
70
+ databaseId: true,
71
+ schemaId: true,
72
+ privateSchemaId: true,
73
+ metersTableId: true,
74
+ metersTableName: true,
75
+ planSubscriptionsTableId: true,
76
+ planSubscriptionsTableName: true,
77
+ ledgerTableId: true,
78
+ ledgerTableName: true,
79
+ balancesTableId: true,
80
+ balancesTableName: true,
81
+ recordUsageFunction: true,
82
+ prefix: true,
83
+ };
84
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
85
+ const client = (0, executor_1.getClient)();
86
+ const result = await client.billingModule.findMany(findManyArgs).execute();
87
+ console.log(JSON.stringify(result, null, 2));
88
+ }
89
+ catch (error) {
90
+ console.error('Failed to list records.');
91
+ if (error instanceof Error) {
92
+ console.error(error.message);
93
+ }
94
+ process.exit(1);
95
+ }
96
+ }
97
+ async function handleFindFirst(argv, _prompter) {
98
+ try {
99
+ const defaultSelect = {
100
+ id: true,
101
+ databaseId: true,
102
+ schemaId: true,
103
+ privateSchemaId: true,
104
+ metersTableId: true,
105
+ metersTableName: true,
106
+ planSubscriptionsTableId: true,
107
+ planSubscriptionsTableName: true,
108
+ ledgerTableId: true,
109
+ ledgerTableName: true,
110
+ balancesTableId: true,
111
+ balancesTableName: true,
112
+ recordUsageFunction: true,
113
+ prefix: true,
114
+ };
115
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
116
+ const client = (0, executor_1.getClient)();
117
+ const result = await client.billingModule.findFirst(findFirstArgs).execute();
118
+ console.log(JSON.stringify(result, null, 2));
119
+ }
120
+ catch (error) {
121
+ console.error('Failed to find record.');
122
+ if (error instanceof Error) {
123
+ console.error(error.message);
124
+ }
125
+ process.exit(1);
126
+ }
127
+ }
128
+ async function handleGet(argv, prompter) {
129
+ try {
130
+ const answers = await prompter.prompt(argv, [
131
+ {
132
+ type: 'text',
133
+ name: 'id',
134
+ message: 'id',
135
+ required: true,
136
+ },
137
+ ]);
138
+ const client = (0, executor_1.getClient)();
139
+ const result = await client.billingModule
140
+ .findOne({
141
+ id: answers.id,
142
+ select: {
143
+ id: true,
144
+ databaseId: true,
145
+ schemaId: true,
146
+ privateSchemaId: true,
147
+ metersTableId: true,
148
+ metersTableName: true,
149
+ planSubscriptionsTableId: true,
150
+ planSubscriptionsTableName: true,
151
+ ledgerTableId: true,
152
+ ledgerTableName: true,
153
+ balancesTableId: true,
154
+ balancesTableName: true,
155
+ recordUsageFunction: true,
156
+ prefix: true,
157
+ },
158
+ })
159
+ .execute();
160
+ console.log(JSON.stringify(result, null, 2));
161
+ }
162
+ catch (error) {
163
+ console.error('Record not found.');
164
+ if (error instanceof Error) {
165
+ console.error(error.message);
166
+ }
167
+ process.exit(1);
168
+ }
169
+ }
170
+ async function handleCreate(argv, prompter) {
171
+ try {
172
+ const rawAnswers = await prompter.prompt(argv, [
173
+ {
174
+ type: 'text',
175
+ name: 'databaseId',
176
+ message: 'databaseId',
177
+ required: true,
178
+ },
179
+ {
180
+ type: 'text',
181
+ name: 'schemaId',
182
+ message: 'schemaId',
183
+ required: false,
184
+ skipPrompt: true,
185
+ },
186
+ {
187
+ type: 'text',
188
+ name: 'privateSchemaId',
189
+ message: 'privateSchemaId',
190
+ required: false,
191
+ skipPrompt: true,
192
+ },
193
+ {
194
+ type: 'text',
195
+ name: 'metersTableId',
196
+ message: 'metersTableId',
197
+ required: false,
198
+ skipPrompt: true,
199
+ },
200
+ {
201
+ type: 'text',
202
+ name: 'metersTableName',
203
+ message: 'metersTableName',
204
+ required: false,
205
+ skipPrompt: true,
206
+ },
207
+ {
208
+ type: 'text',
209
+ name: 'planSubscriptionsTableId',
210
+ message: 'planSubscriptionsTableId',
211
+ required: false,
212
+ skipPrompt: true,
213
+ },
214
+ {
215
+ type: 'text',
216
+ name: 'planSubscriptionsTableName',
217
+ message: 'planSubscriptionsTableName',
218
+ required: false,
219
+ skipPrompt: true,
220
+ },
221
+ {
222
+ type: 'text',
223
+ name: 'ledgerTableId',
224
+ message: 'ledgerTableId',
225
+ required: false,
226
+ skipPrompt: true,
227
+ },
228
+ {
229
+ type: 'text',
230
+ name: 'ledgerTableName',
231
+ message: 'ledgerTableName',
232
+ required: false,
233
+ skipPrompt: true,
234
+ },
235
+ {
236
+ type: 'text',
237
+ name: 'balancesTableId',
238
+ message: 'balancesTableId',
239
+ required: false,
240
+ skipPrompt: true,
241
+ },
242
+ {
243
+ type: 'text',
244
+ name: 'balancesTableName',
245
+ message: 'balancesTableName',
246
+ required: false,
247
+ skipPrompt: true,
248
+ },
249
+ {
250
+ type: 'text',
251
+ name: 'recordUsageFunction',
252
+ message: 'recordUsageFunction',
253
+ required: false,
254
+ skipPrompt: true,
255
+ },
256
+ {
257
+ type: 'text',
258
+ name: 'prefix',
259
+ message: 'prefix',
260
+ required: false,
261
+ skipPrompt: true,
262
+ },
263
+ ]);
264
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
265
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
266
+ const client = (0, executor_1.getClient)();
267
+ const result = await client.billingModule
268
+ .create({
269
+ data: {
270
+ databaseId: cleanedData.databaseId,
271
+ schemaId: cleanedData.schemaId,
272
+ privateSchemaId: cleanedData.privateSchemaId,
273
+ metersTableId: cleanedData.metersTableId,
274
+ metersTableName: cleanedData.metersTableName,
275
+ planSubscriptionsTableId: cleanedData.planSubscriptionsTableId,
276
+ planSubscriptionsTableName: cleanedData.planSubscriptionsTableName,
277
+ ledgerTableId: cleanedData.ledgerTableId,
278
+ ledgerTableName: cleanedData.ledgerTableName,
279
+ balancesTableId: cleanedData.balancesTableId,
280
+ balancesTableName: cleanedData.balancesTableName,
281
+ recordUsageFunction: cleanedData.recordUsageFunction,
282
+ prefix: cleanedData.prefix,
283
+ },
284
+ select: {
285
+ id: true,
286
+ databaseId: true,
287
+ schemaId: true,
288
+ privateSchemaId: true,
289
+ metersTableId: true,
290
+ metersTableName: true,
291
+ planSubscriptionsTableId: true,
292
+ planSubscriptionsTableName: true,
293
+ ledgerTableId: true,
294
+ ledgerTableName: true,
295
+ balancesTableId: true,
296
+ balancesTableName: true,
297
+ recordUsageFunction: true,
298
+ prefix: true,
299
+ },
300
+ })
301
+ .execute();
302
+ console.log(JSON.stringify(result, null, 2));
303
+ }
304
+ catch (error) {
305
+ console.error('Failed to create record.');
306
+ if (error instanceof Error) {
307
+ console.error(error.message);
308
+ }
309
+ process.exit(1);
310
+ }
311
+ }
312
+ async function handleUpdate(argv, prompter) {
313
+ try {
314
+ const rawAnswers = await prompter.prompt(argv, [
315
+ {
316
+ type: 'text',
317
+ name: 'id',
318
+ message: 'id',
319
+ required: true,
320
+ },
321
+ {
322
+ type: 'text',
323
+ name: 'databaseId',
324
+ message: 'databaseId',
325
+ required: false,
326
+ },
327
+ {
328
+ type: 'text',
329
+ name: 'schemaId',
330
+ message: 'schemaId',
331
+ required: false,
332
+ skipPrompt: true,
333
+ },
334
+ {
335
+ type: 'text',
336
+ name: 'privateSchemaId',
337
+ message: 'privateSchemaId',
338
+ required: false,
339
+ skipPrompt: true,
340
+ },
341
+ {
342
+ type: 'text',
343
+ name: 'metersTableId',
344
+ message: 'metersTableId',
345
+ required: false,
346
+ skipPrompt: true,
347
+ },
348
+ {
349
+ type: 'text',
350
+ name: 'metersTableName',
351
+ message: 'metersTableName',
352
+ required: false,
353
+ skipPrompt: true,
354
+ },
355
+ {
356
+ type: 'text',
357
+ name: 'planSubscriptionsTableId',
358
+ message: 'planSubscriptionsTableId',
359
+ required: false,
360
+ skipPrompt: true,
361
+ },
362
+ {
363
+ type: 'text',
364
+ name: 'planSubscriptionsTableName',
365
+ message: 'planSubscriptionsTableName',
366
+ required: false,
367
+ skipPrompt: true,
368
+ },
369
+ {
370
+ type: 'text',
371
+ name: 'ledgerTableId',
372
+ message: 'ledgerTableId',
373
+ required: false,
374
+ skipPrompt: true,
375
+ },
376
+ {
377
+ type: 'text',
378
+ name: 'ledgerTableName',
379
+ message: 'ledgerTableName',
380
+ required: false,
381
+ skipPrompt: true,
382
+ },
383
+ {
384
+ type: 'text',
385
+ name: 'balancesTableId',
386
+ message: 'balancesTableId',
387
+ required: false,
388
+ skipPrompt: true,
389
+ },
390
+ {
391
+ type: 'text',
392
+ name: 'balancesTableName',
393
+ message: 'balancesTableName',
394
+ required: false,
395
+ skipPrompt: true,
396
+ },
397
+ {
398
+ type: 'text',
399
+ name: 'recordUsageFunction',
400
+ message: 'recordUsageFunction',
401
+ required: false,
402
+ skipPrompt: true,
403
+ },
404
+ {
405
+ type: 'text',
406
+ name: 'prefix',
407
+ message: 'prefix',
408
+ required: false,
409
+ skipPrompt: true,
410
+ },
411
+ ]);
412
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
413
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
414
+ const client = (0, executor_1.getClient)();
415
+ const result = await client.billingModule
416
+ .update({
417
+ where: {
418
+ id: answers.id,
419
+ },
420
+ data: {
421
+ databaseId: cleanedData.databaseId,
422
+ schemaId: cleanedData.schemaId,
423
+ privateSchemaId: cleanedData.privateSchemaId,
424
+ metersTableId: cleanedData.metersTableId,
425
+ metersTableName: cleanedData.metersTableName,
426
+ planSubscriptionsTableId: cleanedData.planSubscriptionsTableId,
427
+ planSubscriptionsTableName: cleanedData.planSubscriptionsTableName,
428
+ ledgerTableId: cleanedData.ledgerTableId,
429
+ ledgerTableName: cleanedData.ledgerTableName,
430
+ balancesTableId: cleanedData.balancesTableId,
431
+ balancesTableName: cleanedData.balancesTableName,
432
+ recordUsageFunction: cleanedData.recordUsageFunction,
433
+ prefix: cleanedData.prefix,
434
+ },
435
+ select: {
436
+ id: true,
437
+ databaseId: true,
438
+ schemaId: true,
439
+ privateSchemaId: true,
440
+ metersTableId: true,
441
+ metersTableName: true,
442
+ planSubscriptionsTableId: true,
443
+ planSubscriptionsTableName: true,
444
+ ledgerTableId: true,
445
+ ledgerTableName: true,
446
+ balancesTableId: true,
447
+ balancesTableName: true,
448
+ recordUsageFunction: true,
449
+ prefix: true,
450
+ },
451
+ })
452
+ .execute();
453
+ console.log(JSON.stringify(result, null, 2));
454
+ }
455
+ catch (error) {
456
+ console.error('Failed to update record.');
457
+ if (error instanceof Error) {
458
+ console.error(error.message);
459
+ }
460
+ process.exit(1);
461
+ }
462
+ }
463
+ async function handleDelete(argv, prompter) {
464
+ try {
465
+ const rawAnswers = await prompter.prompt(argv, [
466
+ {
467
+ type: 'text',
468
+ name: 'id',
469
+ message: 'id',
470
+ required: true,
471
+ },
472
+ ]);
473
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
474
+ const client = (0, executor_1.getClient)();
475
+ const result = await client.billingModule
476
+ .delete({
477
+ where: {
478
+ id: answers.id,
479
+ },
480
+ select: {
481
+ id: true,
482
+ },
483
+ })
484
+ .execute();
485
+ console.log(JSON.stringify(result, null, 2));
486
+ }
487
+ catch (error) {
488
+ console.error('Failed to delete record.');
489
+ if (error instanceof Error) {
490
+ console.error(error.message);
491
+ }
492
+ process.exit(1);
493
+ }
494
+ }
@@ -23,6 +23,7 @@ const fieldSchema = {
23
23
  limitDecrementTrigger: 'string',
24
24
  limitUpdateTrigger: 'string',
25
25
  limitCheckFunction: 'string',
26
+ aggregateTableId: 'uuid',
26
27
  prefix: 'string',
27
28
  membershipType: 'int',
28
29
  entityTableId: 'uuid',
@@ -84,6 +85,7 @@ async function handleList(argv, _prompter) {
84
85
  limitDecrementTrigger: true,
85
86
  limitUpdateTrigger: true,
86
87
  limitCheckFunction: true,
88
+ aggregateTableId: true,
87
89
  prefix: true,
88
90
  membershipType: true,
89
91
  entityTableId: true,
@@ -119,6 +121,7 @@ async function handleFindFirst(argv, _prompter) {
119
121
  limitDecrementTrigger: true,
120
122
  limitUpdateTrigger: true,
121
123
  limitCheckFunction: true,
124
+ aggregateTableId: true,
122
125
  prefix: true,
123
126
  membershipType: true,
124
127
  entityTableId: true,
@@ -166,6 +169,7 @@ async function handleGet(argv, prompter) {
166
169
  limitDecrementTrigger: true,
167
170
  limitUpdateTrigger: true,
168
171
  limitCheckFunction: true,
172
+ aggregateTableId: true,
169
173
  prefix: true,
170
174
  membershipType: true,
171
175
  entityTableId: true,
@@ -276,6 +280,13 @@ async function handleCreate(argv, prompter) {
276
280
  required: false,
277
281
  skipPrompt: true,
278
282
  },
283
+ {
284
+ type: 'text',
285
+ name: 'aggregateTableId',
286
+ message: 'aggregateTableId',
287
+ required: false,
288
+ skipPrompt: true,
289
+ },
279
290
  {
280
291
  type: 'text',
281
292
  name: 'prefix',
@@ -323,6 +334,7 @@ async function handleCreate(argv, prompter) {
323
334
  limitDecrementTrigger: cleanedData.limitDecrementTrigger,
324
335
  limitUpdateTrigger: cleanedData.limitUpdateTrigger,
325
336
  limitCheckFunction: cleanedData.limitCheckFunction,
337
+ aggregateTableId: cleanedData.aggregateTableId,
326
338
  prefix: cleanedData.prefix,
327
339
  membershipType: cleanedData.membershipType,
328
340
  entityTableId: cleanedData.entityTableId,
@@ -343,6 +355,7 @@ async function handleCreate(argv, prompter) {
343
355
  limitDecrementTrigger: true,
344
356
  limitUpdateTrigger: true,
345
357
  limitCheckFunction: true,
358
+ aggregateTableId: true,
346
359
  prefix: true,
347
360
  membershipType: true,
348
361
  entityTableId: true,
@@ -459,6 +472,13 @@ async function handleUpdate(argv, prompter) {
459
472
  required: false,
460
473
  skipPrompt: true,
461
474
  },
475
+ {
476
+ type: 'text',
477
+ name: 'aggregateTableId',
478
+ message: 'aggregateTableId',
479
+ required: false,
480
+ skipPrompt: true,
481
+ },
462
482
  {
463
483
  type: 'text',
464
484
  name: 'prefix',
@@ -509,6 +529,7 @@ async function handleUpdate(argv, prompter) {
509
529
  limitDecrementTrigger: cleanedData.limitDecrementTrigger,
510
530
  limitUpdateTrigger: cleanedData.limitUpdateTrigger,
511
531
  limitCheckFunction: cleanedData.limitCheckFunction,
532
+ aggregateTableId: cleanedData.aggregateTableId,
512
533
  prefix: cleanedData.prefix,
513
534
  membershipType: cleanedData.membershipType,
514
535
  entityTableId: cleanedData.entityTableId,
@@ -529,6 +550,7 @@ async function handleUpdate(argv, prompter) {
529
550
  limitDecrementTrigger: true,
530
551
  limitUpdateTrigger: true,
531
552
  limitCheckFunction: true,
553
+ aggregateTableId: true,
532
554
  prefix: true,
533
555
  membershipType: true,
534
556
  entityTableId: true,
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI commands for NodeTypeRegistry
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;