@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,492 @@
1
+ /**
2
+ * CLI commands for BillingModule
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
+ metersTableId: 'uuid',
15
+ metersTableName: 'string',
16
+ planSubscriptionsTableId: 'uuid',
17
+ planSubscriptionsTableName: 'string',
18
+ ledgerTableId: 'uuid',
19
+ ledgerTableName: 'string',
20
+ balancesTableId: 'uuid',
21
+ balancesTableName: 'string',
22
+ recordUsageFunction: 'string',
23
+ prefix: 'string',
24
+ };
25
+ 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';
26
+ export 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 } = 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
+ metersTableId: true,
72
+ metersTableName: true,
73
+ planSubscriptionsTableId: true,
74
+ planSubscriptionsTableName: true,
75
+ ledgerTableId: true,
76
+ ledgerTableName: true,
77
+ balancesTableId: true,
78
+ balancesTableName: true,
79
+ recordUsageFunction: true,
80
+ prefix: true,
81
+ };
82
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
83
+ const client = getClient();
84
+ const result = await client.billingModule.findMany(findManyArgs).execute();
85
+ console.log(JSON.stringify(result, null, 2));
86
+ }
87
+ catch (error) {
88
+ console.error('Failed to list records.');
89
+ if (error instanceof Error) {
90
+ console.error(error.message);
91
+ }
92
+ process.exit(1);
93
+ }
94
+ }
95
+ async function handleFindFirst(argv, _prompter) {
96
+ try {
97
+ const defaultSelect = {
98
+ id: true,
99
+ databaseId: true,
100
+ schemaId: true,
101
+ privateSchemaId: true,
102
+ metersTableId: true,
103
+ metersTableName: true,
104
+ planSubscriptionsTableId: true,
105
+ planSubscriptionsTableName: true,
106
+ ledgerTableId: true,
107
+ ledgerTableName: true,
108
+ balancesTableId: true,
109
+ balancesTableName: true,
110
+ recordUsageFunction: true,
111
+ prefix: true,
112
+ };
113
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
114
+ const client = getClient();
115
+ const result = await client.billingModule.findFirst(findFirstArgs).execute();
116
+ console.log(JSON.stringify(result, null, 2));
117
+ }
118
+ catch (error) {
119
+ console.error('Failed to find record.');
120
+ if (error instanceof Error) {
121
+ console.error(error.message);
122
+ }
123
+ process.exit(1);
124
+ }
125
+ }
126
+ async function handleGet(argv, prompter) {
127
+ try {
128
+ const answers = await prompter.prompt(argv, [
129
+ {
130
+ type: 'text',
131
+ name: 'id',
132
+ message: 'id',
133
+ required: true,
134
+ },
135
+ ]);
136
+ const client = getClient();
137
+ const result = await client.billingModule
138
+ .findOne({
139
+ id: answers.id,
140
+ select: {
141
+ id: true,
142
+ databaseId: true,
143
+ schemaId: true,
144
+ privateSchemaId: true,
145
+ metersTableId: true,
146
+ metersTableName: true,
147
+ planSubscriptionsTableId: true,
148
+ planSubscriptionsTableName: true,
149
+ ledgerTableId: true,
150
+ ledgerTableName: true,
151
+ balancesTableId: true,
152
+ balancesTableName: true,
153
+ recordUsageFunction: true,
154
+ prefix: true,
155
+ },
156
+ })
157
+ .execute();
158
+ console.log(JSON.stringify(result, null, 2));
159
+ }
160
+ catch (error) {
161
+ console.error('Record not found.');
162
+ if (error instanceof Error) {
163
+ console.error(error.message);
164
+ }
165
+ process.exit(1);
166
+ }
167
+ }
168
+ async function handleCreate(argv, prompter) {
169
+ try {
170
+ const rawAnswers = await prompter.prompt(argv, [
171
+ {
172
+ type: 'text',
173
+ name: 'databaseId',
174
+ message: 'databaseId',
175
+ required: true,
176
+ },
177
+ {
178
+ type: 'text',
179
+ name: 'schemaId',
180
+ message: 'schemaId',
181
+ required: false,
182
+ skipPrompt: true,
183
+ },
184
+ {
185
+ type: 'text',
186
+ name: 'privateSchemaId',
187
+ message: 'privateSchemaId',
188
+ required: false,
189
+ skipPrompt: true,
190
+ },
191
+ {
192
+ type: 'text',
193
+ name: 'metersTableId',
194
+ message: 'metersTableId',
195
+ required: false,
196
+ skipPrompt: true,
197
+ },
198
+ {
199
+ type: 'text',
200
+ name: 'metersTableName',
201
+ message: 'metersTableName',
202
+ required: false,
203
+ skipPrompt: true,
204
+ },
205
+ {
206
+ type: 'text',
207
+ name: 'planSubscriptionsTableId',
208
+ message: 'planSubscriptionsTableId',
209
+ required: false,
210
+ skipPrompt: true,
211
+ },
212
+ {
213
+ type: 'text',
214
+ name: 'planSubscriptionsTableName',
215
+ message: 'planSubscriptionsTableName',
216
+ required: false,
217
+ skipPrompt: true,
218
+ },
219
+ {
220
+ type: 'text',
221
+ name: 'ledgerTableId',
222
+ message: 'ledgerTableId',
223
+ required: false,
224
+ skipPrompt: true,
225
+ },
226
+ {
227
+ type: 'text',
228
+ name: 'ledgerTableName',
229
+ message: 'ledgerTableName',
230
+ required: false,
231
+ skipPrompt: true,
232
+ },
233
+ {
234
+ type: 'text',
235
+ name: 'balancesTableId',
236
+ message: 'balancesTableId',
237
+ required: false,
238
+ skipPrompt: true,
239
+ },
240
+ {
241
+ type: 'text',
242
+ name: 'balancesTableName',
243
+ message: 'balancesTableName',
244
+ required: false,
245
+ skipPrompt: true,
246
+ },
247
+ {
248
+ type: 'text',
249
+ name: 'recordUsageFunction',
250
+ message: 'recordUsageFunction',
251
+ required: false,
252
+ skipPrompt: true,
253
+ },
254
+ {
255
+ type: 'text',
256
+ name: 'prefix',
257
+ message: 'prefix',
258
+ required: false,
259
+ skipPrompt: true,
260
+ },
261
+ ]);
262
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
263
+ const cleanedData = stripUndefined(answers, fieldSchema);
264
+ const client = getClient();
265
+ const result = await client.billingModule
266
+ .create({
267
+ data: {
268
+ databaseId: cleanedData.databaseId,
269
+ schemaId: cleanedData.schemaId,
270
+ privateSchemaId: cleanedData.privateSchemaId,
271
+ metersTableId: cleanedData.metersTableId,
272
+ metersTableName: cleanedData.metersTableName,
273
+ planSubscriptionsTableId: cleanedData.planSubscriptionsTableId,
274
+ planSubscriptionsTableName: cleanedData.planSubscriptionsTableName,
275
+ ledgerTableId: cleanedData.ledgerTableId,
276
+ ledgerTableName: cleanedData.ledgerTableName,
277
+ balancesTableId: cleanedData.balancesTableId,
278
+ balancesTableName: cleanedData.balancesTableName,
279
+ recordUsageFunction: cleanedData.recordUsageFunction,
280
+ prefix: cleanedData.prefix,
281
+ },
282
+ select: {
283
+ id: true,
284
+ databaseId: true,
285
+ schemaId: true,
286
+ privateSchemaId: true,
287
+ metersTableId: true,
288
+ metersTableName: true,
289
+ planSubscriptionsTableId: true,
290
+ planSubscriptionsTableName: true,
291
+ ledgerTableId: true,
292
+ ledgerTableName: true,
293
+ balancesTableId: true,
294
+ balancesTableName: true,
295
+ recordUsageFunction: true,
296
+ prefix: true,
297
+ },
298
+ })
299
+ .execute();
300
+ console.log(JSON.stringify(result, null, 2));
301
+ }
302
+ catch (error) {
303
+ console.error('Failed to create record.');
304
+ if (error instanceof Error) {
305
+ console.error(error.message);
306
+ }
307
+ process.exit(1);
308
+ }
309
+ }
310
+ async function handleUpdate(argv, prompter) {
311
+ try {
312
+ const rawAnswers = await prompter.prompt(argv, [
313
+ {
314
+ type: 'text',
315
+ name: 'id',
316
+ message: 'id',
317
+ required: true,
318
+ },
319
+ {
320
+ type: 'text',
321
+ name: 'databaseId',
322
+ message: 'databaseId',
323
+ required: false,
324
+ },
325
+ {
326
+ type: 'text',
327
+ name: 'schemaId',
328
+ message: 'schemaId',
329
+ required: false,
330
+ skipPrompt: true,
331
+ },
332
+ {
333
+ type: 'text',
334
+ name: 'privateSchemaId',
335
+ message: 'privateSchemaId',
336
+ required: false,
337
+ skipPrompt: true,
338
+ },
339
+ {
340
+ type: 'text',
341
+ name: 'metersTableId',
342
+ message: 'metersTableId',
343
+ required: false,
344
+ skipPrompt: true,
345
+ },
346
+ {
347
+ type: 'text',
348
+ name: 'metersTableName',
349
+ message: 'metersTableName',
350
+ required: false,
351
+ skipPrompt: true,
352
+ },
353
+ {
354
+ type: 'text',
355
+ name: 'planSubscriptionsTableId',
356
+ message: 'planSubscriptionsTableId',
357
+ required: false,
358
+ skipPrompt: true,
359
+ },
360
+ {
361
+ type: 'text',
362
+ name: 'planSubscriptionsTableName',
363
+ message: 'planSubscriptionsTableName',
364
+ required: false,
365
+ skipPrompt: true,
366
+ },
367
+ {
368
+ type: 'text',
369
+ name: 'ledgerTableId',
370
+ message: 'ledgerTableId',
371
+ required: false,
372
+ skipPrompt: true,
373
+ },
374
+ {
375
+ type: 'text',
376
+ name: 'ledgerTableName',
377
+ message: 'ledgerTableName',
378
+ required: false,
379
+ skipPrompt: true,
380
+ },
381
+ {
382
+ type: 'text',
383
+ name: 'balancesTableId',
384
+ message: 'balancesTableId',
385
+ required: false,
386
+ skipPrompt: true,
387
+ },
388
+ {
389
+ type: 'text',
390
+ name: 'balancesTableName',
391
+ message: 'balancesTableName',
392
+ required: false,
393
+ skipPrompt: true,
394
+ },
395
+ {
396
+ type: 'text',
397
+ name: 'recordUsageFunction',
398
+ message: 'recordUsageFunction',
399
+ required: false,
400
+ skipPrompt: true,
401
+ },
402
+ {
403
+ type: 'text',
404
+ name: 'prefix',
405
+ message: 'prefix',
406
+ required: false,
407
+ skipPrompt: true,
408
+ },
409
+ ]);
410
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
411
+ const cleanedData = stripUndefined(answers, fieldSchema);
412
+ const client = getClient();
413
+ const result = await client.billingModule
414
+ .update({
415
+ where: {
416
+ id: answers.id,
417
+ },
418
+ data: {
419
+ databaseId: cleanedData.databaseId,
420
+ schemaId: cleanedData.schemaId,
421
+ privateSchemaId: cleanedData.privateSchemaId,
422
+ metersTableId: cleanedData.metersTableId,
423
+ metersTableName: cleanedData.metersTableName,
424
+ planSubscriptionsTableId: cleanedData.planSubscriptionsTableId,
425
+ planSubscriptionsTableName: cleanedData.planSubscriptionsTableName,
426
+ ledgerTableId: cleanedData.ledgerTableId,
427
+ ledgerTableName: cleanedData.ledgerTableName,
428
+ balancesTableId: cleanedData.balancesTableId,
429
+ balancesTableName: cleanedData.balancesTableName,
430
+ recordUsageFunction: cleanedData.recordUsageFunction,
431
+ prefix: cleanedData.prefix,
432
+ },
433
+ select: {
434
+ id: true,
435
+ databaseId: true,
436
+ schemaId: true,
437
+ privateSchemaId: true,
438
+ metersTableId: true,
439
+ metersTableName: true,
440
+ planSubscriptionsTableId: true,
441
+ planSubscriptionsTableName: true,
442
+ ledgerTableId: true,
443
+ ledgerTableName: true,
444
+ balancesTableId: true,
445
+ balancesTableName: true,
446
+ recordUsageFunction: true,
447
+ prefix: true,
448
+ },
449
+ })
450
+ .execute();
451
+ console.log(JSON.stringify(result, null, 2));
452
+ }
453
+ catch (error) {
454
+ console.error('Failed to update record.');
455
+ if (error instanceof Error) {
456
+ console.error(error.message);
457
+ }
458
+ process.exit(1);
459
+ }
460
+ }
461
+ async function handleDelete(argv, prompter) {
462
+ try {
463
+ const rawAnswers = await prompter.prompt(argv, [
464
+ {
465
+ type: 'text',
466
+ name: 'id',
467
+ message: 'id',
468
+ required: true,
469
+ },
470
+ ]);
471
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
472
+ const client = getClient();
473
+ const result = await client.billingModule
474
+ .delete({
475
+ where: {
476
+ id: answers.id,
477
+ },
478
+ select: {
479
+ id: true,
480
+ },
481
+ })
482
+ .execute();
483
+ console.log(JSON.stringify(result, null, 2));
484
+ }
485
+ catch (error) {
486
+ console.error('Failed to delete record.');
487
+ if (error instanceof Error) {
488
+ console.error(error.message);
489
+ }
490
+ process.exit(1);
491
+ }
492
+ }
@@ -21,6 +21,7 @@ const fieldSchema = {
21
21
  limitDecrementTrigger: 'string',
22
22
  limitUpdateTrigger: 'string',
23
23
  limitCheckFunction: 'string',
24
+ aggregateTableId: 'uuid',
24
25
  prefix: 'string',
25
26
  membershipType: 'int',
26
27
  entityTableId: 'uuid',
@@ -82,6 +83,7 @@ async function handleList(argv, _prompter) {
82
83
  limitDecrementTrigger: true,
83
84
  limitUpdateTrigger: true,
84
85
  limitCheckFunction: true,
86
+ aggregateTableId: true,
85
87
  prefix: true,
86
88
  membershipType: true,
87
89
  entityTableId: true,
@@ -117,6 +119,7 @@ async function handleFindFirst(argv, _prompter) {
117
119
  limitDecrementTrigger: true,
118
120
  limitUpdateTrigger: true,
119
121
  limitCheckFunction: true,
122
+ aggregateTableId: true,
120
123
  prefix: true,
121
124
  membershipType: true,
122
125
  entityTableId: true,
@@ -164,6 +167,7 @@ async function handleGet(argv, prompter) {
164
167
  limitDecrementTrigger: true,
165
168
  limitUpdateTrigger: true,
166
169
  limitCheckFunction: true,
170
+ aggregateTableId: true,
167
171
  prefix: true,
168
172
  membershipType: true,
169
173
  entityTableId: true,
@@ -274,6 +278,13 @@ async function handleCreate(argv, prompter) {
274
278
  required: false,
275
279
  skipPrompt: true,
276
280
  },
281
+ {
282
+ type: 'text',
283
+ name: 'aggregateTableId',
284
+ message: 'aggregateTableId',
285
+ required: false,
286
+ skipPrompt: true,
287
+ },
277
288
  {
278
289
  type: 'text',
279
290
  name: 'prefix',
@@ -321,6 +332,7 @@ async function handleCreate(argv, prompter) {
321
332
  limitDecrementTrigger: cleanedData.limitDecrementTrigger,
322
333
  limitUpdateTrigger: cleanedData.limitUpdateTrigger,
323
334
  limitCheckFunction: cleanedData.limitCheckFunction,
335
+ aggregateTableId: cleanedData.aggregateTableId,
324
336
  prefix: cleanedData.prefix,
325
337
  membershipType: cleanedData.membershipType,
326
338
  entityTableId: cleanedData.entityTableId,
@@ -341,6 +353,7 @@ async function handleCreate(argv, prompter) {
341
353
  limitDecrementTrigger: true,
342
354
  limitUpdateTrigger: true,
343
355
  limitCheckFunction: true,
356
+ aggregateTableId: true,
344
357
  prefix: true,
345
358
  membershipType: true,
346
359
  entityTableId: true,
@@ -457,6 +470,13 @@ async function handleUpdate(argv, prompter) {
457
470
  required: false,
458
471
  skipPrompt: true,
459
472
  },
473
+ {
474
+ type: 'text',
475
+ name: 'aggregateTableId',
476
+ message: 'aggregateTableId',
477
+ required: false,
478
+ skipPrompt: true,
479
+ },
460
480
  {
461
481
  type: 'text',
462
482
  name: 'prefix',
@@ -507,6 +527,7 @@ async function handleUpdate(argv, prompter) {
507
527
  limitDecrementTrigger: cleanedData.limitDecrementTrigger,
508
528
  limitUpdateTrigger: cleanedData.limitUpdateTrigger,
509
529
  limitCheckFunction: cleanedData.limitCheckFunction,
530
+ aggregateTableId: cleanedData.aggregateTableId,
510
531
  prefix: cleanedData.prefix,
511
532
  membershipType: cleanedData.membershipType,
512
533
  entityTableId: cleanedData.entityTableId,
@@ -527,6 +548,7 @@ async function handleUpdate(argv, prompter) {
527
548
  limitDecrementTrigger: true,
528
549
  limitUpdateTrigger: true,
529
550
  limitCheckFunction: true,
551
+ aggregateTableId: true,
530
552
  prefix: true,
531
553
  membershipType: true,
532
554
  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;