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