@constructive-sdk/cli 0.25.9 → 0.25.11

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 (229) hide show
  1. package/admin/cli/commands/app-admin-grant.js +3 -1
  2. package/admin/cli/commands/app-grant.js +3 -1
  3. package/admin/cli/commands/app-invite.js +44 -0
  4. package/admin/cli/commands/app-owner-grant.js +3 -1
  5. package/admin/cli/commands/app-permission-default-grant.d.ts +8 -0
  6. package/admin/cli/commands/app-permission-default-grant.js +286 -0
  7. package/admin/cli/commands/app-permission-default-permission.d.ts +8 -0
  8. package/admin/cli/commands/app-permission-default-permission.js +242 -0
  9. package/admin/cli/commands/org-admin-grant.js +3 -1
  10. package/admin/cli/commands/org-grant.js +3 -1
  11. package/admin/cli/commands/org-invite.js +44 -0
  12. package/admin/cli/commands/org-owner-grant.js +3 -1
  13. package/admin/cli/commands/org-permission-default-grant.d.ts +8 -0
  14. package/admin/cli/commands/org-permission-default-grant.js +306 -0
  15. package/admin/cli/commands/org-permission-default-permission.d.ts +8 -0
  16. package/admin/cli/commands/org-permission-default-permission.js +262 -0
  17. package/admin/cli/commands.js +11 -3
  18. package/admin/cli/executor.d.ts +5 -1
  19. package/admin/orm/index.d.ts +10 -2
  20. package/admin/orm/index.js +10 -2
  21. package/admin/orm/input-types.d.ts +1611 -230
  22. package/admin/orm/input-types.js +9 -1
  23. package/admin/orm/models/appPermissionDefaultGrant.d.ts +54 -0
  24. package/admin/orm/models/appPermissionDefaultGrant.js +104 -0
  25. package/admin/orm/models/appPermissionDefaultPermission.d.ts +54 -0
  26. package/admin/orm/models/appPermissionDefaultPermission.js +104 -0
  27. package/admin/orm/models/index.d.ts +5 -1
  28. package/admin/orm/models/index.js +11 -3
  29. package/admin/orm/models/orgPermissionDefaultGrant.d.ts +54 -0
  30. package/admin/orm/models/orgPermissionDefaultGrant.js +104 -0
  31. package/admin/orm/models/orgPermissionDefaultPermission.d.ts +54 -0
  32. package/admin/orm/models/orgPermissionDefaultPermission.js +104 -0
  33. package/agent/cli/commands/agent-message.js +34 -12
  34. package/agent/cli/commands/agent-task.js +12 -12
  35. package/agent/cli/embedder.d.ts +5 -0
  36. package/agent/cli/embedder.js +46 -9
  37. package/agent/orm/input-types.d.ts +289 -47
  38. package/agent/orm/input-types.js +1 -0
  39. package/api/cli/commands/check-constraint.js +0 -22
  40. package/api/cli/commands/composite-type.d.ts +8 -0
  41. package/api/cli/commands/composite-type.js +424 -0
  42. package/api/cli/commands/enum.js +0 -22
  43. package/api/cli/commands/field.js +0 -22
  44. package/api/cli/commands/foreign-key-constraint.js +0 -22
  45. package/api/cli/commands/index.js +0 -22
  46. package/api/cli/commands/policy.js +0 -22
  47. package/api/cli/commands/primary-key-constraint.js +0 -22
  48. package/api/cli/commands/schema.js +0 -22
  49. package/api/cli/commands/spatial-relation.js +0 -22
  50. package/api/cli/commands/table.js +6 -28
  51. package/api/cli/commands/trigger.js +0 -22
  52. package/api/cli/commands/unique-constraint.js +0 -22
  53. package/api/cli/commands/view-table.js +22 -0
  54. package/api/cli/commands/view.js +0 -22
  55. package/api/cli/commands.js +3 -1
  56. package/api/cli/executor.d.ts +1 -0
  57. package/api/orm/index.d.ts +2 -0
  58. package/api/orm/index.js +2 -0
  59. package/api/orm/input-types.d.ts +1064 -125
  60. package/api/orm/input-types.js +3 -0
  61. package/api/orm/models/compositeType.d.ts +54 -0
  62. package/api/orm/models/compositeType.js +104 -0
  63. package/api/orm/models/index.d.ts +1 -0
  64. package/api/orm/models/index.js +3 -1
  65. package/auth/cli/commands/link-identity.d.ts +8 -0
  66. package/auth/cli/commands/link-identity.js +36 -0
  67. package/auth/cli/commands/sign-in-sms-otp.d.ts +8 -0
  68. package/auth/cli/commands/sign-in-sms-otp.js +36 -0
  69. package/auth/cli/commands/sign-up-sms.d.ts +8 -0
  70. package/auth/cli/commands/sign-up-sms.js +36 -0
  71. package/auth/cli/commands.js +7 -1
  72. package/auth/cli/executor.d.ts +15 -0
  73. package/auth/orm/index.d.ts +15 -0
  74. package/auth/orm/input-types.d.ts +197 -1
  75. package/auth/orm/mutation/index.d.ts +25 -1
  76. package/auth/orm/mutation/index.js +36 -0
  77. package/esm/admin/cli/commands/app-admin-grant.js +3 -1
  78. package/esm/admin/cli/commands/app-grant.js +3 -1
  79. package/esm/admin/cli/commands/app-invite.js +44 -0
  80. package/esm/admin/cli/commands/app-owner-grant.js +3 -1
  81. package/esm/admin/cli/commands/app-permission-default-grant.d.ts +8 -0
  82. package/esm/admin/cli/commands/app-permission-default-grant.js +284 -0
  83. package/esm/admin/cli/commands/app-permission-default-permission.d.ts +8 -0
  84. package/esm/admin/cli/commands/app-permission-default-permission.js +240 -0
  85. package/esm/admin/cli/commands/org-admin-grant.js +3 -1
  86. package/esm/admin/cli/commands/org-grant.js +3 -1
  87. package/esm/admin/cli/commands/org-invite.js +44 -0
  88. package/esm/admin/cli/commands/org-owner-grant.js +3 -1
  89. package/esm/admin/cli/commands/org-permission-default-grant.d.ts +8 -0
  90. package/esm/admin/cli/commands/org-permission-default-grant.js +304 -0
  91. package/esm/admin/cli/commands/org-permission-default-permission.d.ts +8 -0
  92. package/esm/admin/cli/commands/org-permission-default-permission.js +260 -0
  93. package/esm/admin/cli/commands.js +11 -3
  94. package/esm/admin/cli/executor.d.ts +5 -1
  95. package/esm/admin/orm/index.d.ts +10 -2
  96. package/esm/admin/orm/index.js +10 -2
  97. package/esm/admin/orm/input-types.d.ts +1611 -230
  98. package/esm/admin/orm/input-types.js +9 -1
  99. package/esm/admin/orm/models/appPermissionDefaultGrant.d.ts +54 -0
  100. package/esm/admin/orm/models/appPermissionDefaultGrant.js +100 -0
  101. package/esm/admin/orm/models/appPermissionDefaultPermission.d.ts +54 -0
  102. package/esm/admin/orm/models/appPermissionDefaultPermission.js +100 -0
  103. package/esm/admin/orm/models/index.d.ts +5 -1
  104. package/esm/admin/orm/models/index.js +5 -1
  105. package/esm/admin/orm/models/orgPermissionDefaultGrant.d.ts +54 -0
  106. package/esm/admin/orm/models/orgPermissionDefaultGrant.js +100 -0
  107. package/esm/admin/orm/models/orgPermissionDefaultPermission.d.ts +54 -0
  108. package/esm/admin/orm/models/orgPermissionDefaultPermission.js +100 -0
  109. package/esm/agent/cli/commands/agent-message.js +34 -12
  110. package/esm/agent/cli/commands/agent-task.js +12 -12
  111. package/esm/agent/cli/embedder.d.ts +5 -0
  112. package/esm/agent/cli/embedder.js +10 -2
  113. package/esm/agent/orm/input-types.d.ts +289 -47
  114. package/esm/agent/orm/input-types.js +1 -0
  115. package/esm/api/cli/commands/check-constraint.js +0 -22
  116. package/esm/api/cli/commands/composite-type.d.ts +8 -0
  117. package/esm/api/cli/commands/composite-type.js +422 -0
  118. package/esm/api/cli/commands/enum.js +0 -22
  119. package/esm/api/cli/commands/field.js +0 -22
  120. package/esm/api/cli/commands/foreign-key-constraint.js +0 -22
  121. package/esm/api/cli/commands/index.js +0 -22
  122. package/esm/api/cli/commands/policy.js +0 -22
  123. package/esm/api/cli/commands/primary-key-constraint.js +0 -22
  124. package/esm/api/cli/commands/schema.js +0 -22
  125. package/esm/api/cli/commands/spatial-relation.js +0 -22
  126. package/esm/api/cli/commands/table.js +6 -28
  127. package/esm/api/cli/commands/trigger.js +0 -22
  128. package/esm/api/cli/commands/unique-constraint.js +0 -22
  129. package/esm/api/cli/commands/view-table.js +22 -0
  130. package/esm/api/cli/commands/view.js +0 -22
  131. package/esm/api/cli/commands.js +3 -1
  132. package/esm/api/cli/executor.d.ts +1 -0
  133. package/esm/api/orm/index.d.ts +2 -0
  134. package/esm/api/orm/index.js +2 -0
  135. package/esm/api/orm/input-types.d.ts +1064 -125
  136. package/esm/api/orm/input-types.js +3 -0
  137. package/esm/api/orm/models/compositeType.d.ts +54 -0
  138. package/esm/api/orm/models/compositeType.js +100 -0
  139. package/esm/api/orm/models/index.d.ts +1 -0
  140. package/esm/api/orm/models/index.js +1 -0
  141. package/esm/auth/cli/commands/link-identity.d.ts +8 -0
  142. package/esm/auth/cli/commands/link-identity.js +34 -0
  143. package/esm/auth/cli/commands/sign-in-sms-otp.d.ts +8 -0
  144. package/esm/auth/cli/commands/sign-in-sms-otp.js +34 -0
  145. package/esm/auth/cli/commands/sign-up-sms.d.ts +8 -0
  146. package/esm/auth/cli/commands/sign-up-sms.js +34 -0
  147. package/esm/auth/cli/commands.js +7 -1
  148. package/esm/auth/cli/executor.d.ts +15 -0
  149. package/esm/auth/orm/index.d.ts +15 -0
  150. package/esm/auth/orm/input-types.d.ts +197 -1
  151. package/esm/auth/orm/mutation/index.d.ts +25 -1
  152. package/esm/auth/orm/mutation/index.js +36 -0
  153. package/esm/modules/cli/commands/agent-module.js +88 -0
  154. package/esm/modules/cli/commands/billing-module.js +66 -0
  155. package/esm/modules/cli/commands/compute-log-module.js +44 -0
  156. package/esm/modules/cli/commands/config-secrets-module.js +44 -0
  157. package/esm/modules/cli/commands/db-usage-module.js +66 -0
  158. package/esm/modules/cli/commands/entity-type-provision.js +0 -44
  159. package/esm/modules/cli/commands/events-module.js +66 -0
  160. package/esm/modules/cli/commands/function-invocation-module.d.ts +8 -0
  161. package/esm/modules/cli/commands/function-invocation-module.js +580 -0
  162. package/esm/modules/cli/commands/function-module.js +22 -198
  163. package/esm/modules/cli/commands/graph-module.js +22 -0
  164. package/esm/modules/cli/commands/hierarchy-module.js +22 -0
  165. package/esm/modules/cli/commands/identity-providers-module.js +44 -0
  166. package/esm/modules/cli/commands/inference-log-module.js +44 -0
  167. package/esm/modules/cli/commands/invites-module.js +44 -0
  168. package/esm/modules/cli/commands/limits-module.js +44 -0
  169. package/esm/modules/cli/commands/memberships-module.js +88 -0
  170. package/esm/modules/cli/commands/merkle-store-module.js +22 -0
  171. package/esm/modules/cli/commands/namespace-module.js +22 -0
  172. package/esm/modules/cli/commands/notifications-module.js +88 -0
  173. package/esm/modules/cli/commands/permissions-module.js +44 -0
  174. package/esm/modules/cli/commands/plans-module.js +44 -0
  175. package/esm/modules/cli/commands/profiles-module.js +44 -0
  176. package/esm/modules/cli/commands/rate-limit-meters-module.js +66 -0
  177. package/esm/modules/cli/commands/storage-log-module.js +44 -0
  178. package/esm/modules/cli/commands/storage-module.js +66 -0
  179. package/esm/modules/cli/commands/transfer-log-module.js +44 -0
  180. package/esm/modules/cli/commands.js +29 -27
  181. package/esm/modules/cli/executor.d.ts +14 -13
  182. package/esm/modules/orm/index.d.ts +28 -26
  183. package/esm/modules/orm/index.js +28 -26
  184. package/esm/modules/orm/input-types.d.ts +4485 -2514
  185. package/esm/modules/orm/models/functionInvocationModule.d.ts +54 -0
  186. package/esm/modules/orm/models/functionInvocationModule.js +100 -0
  187. package/esm/modules/orm/models/index.d.ts +14 -13
  188. package/esm/modules/orm/models/index.js +14 -13
  189. package/esm/objects/orm/input-types.d.ts +62 -0
  190. package/esm/usage/orm/input-types.d.ts +314 -19
  191. package/modules/cli/commands/agent-module.js +88 -0
  192. package/modules/cli/commands/billing-module.js +66 -0
  193. package/modules/cli/commands/compute-log-module.js +44 -0
  194. package/modules/cli/commands/config-secrets-module.js +44 -0
  195. package/modules/cli/commands/db-usage-module.js +66 -0
  196. package/modules/cli/commands/entity-type-provision.js +0 -44
  197. package/modules/cli/commands/events-module.js +66 -0
  198. package/modules/cli/commands/function-invocation-module.d.ts +8 -0
  199. package/modules/cli/commands/function-invocation-module.js +582 -0
  200. package/modules/cli/commands/function-module.js +22 -198
  201. package/modules/cli/commands/graph-module.js +22 -0
  202. package/modules/cli/commands/hierarchy-module.js +22 -0
  203. package/modules/cli/commands/identity-providers-module.js +44 -0
  204. package/modules/cli/commands/inference-log-module.js +44 -0
  205. package/modules/cli/commands/invites-module.js +44 -0
  206. package/modules/cli/commands/limits-module.js +44 -0
  207. package/modules/cli/commands/memberships-module.js +88 -0
  208. package/modules/cli/commands/merkle-store-module.js +22 -0
  209. package/modules/cli/commands/namespace-module.js +22 -0
  210. package/modules/cli/commands/notifications-module.js +88 -0
  211. package/modules/cli/commands/permissions-module.js +44 -0
  212. package/modules/cli/commands/plans-module.js +44 -0
  213. package/modules/cli/commands/profiles-module.js +44 -0
  214. package/modules/cli/commands/rate-limit-meters-module.js +66 -0
  215. package/modules/cli/commands/storage-log-module.js +44 -0
  216. package/modules/cli/commands/storage-module.js +66 -0
  217. package/modules/cli/commands/transfer-log-module.js +44 -0
  218. package/modules/cli/commands.js +29 -27
  219. package/modules/cli/executor.d.ts +14 -13
  220. package/modules/orm/index.d.ts +28 -26
  221. package/modules/orm/index.js +28 -26
  222. package/modules/orm/input-types.d.ts +4485 -2514
  223. package/modules/orm/models/functionInvocationModule.d.ts +54 -0
  224. package/modules/orm/models/functionInvocationModule.js +104 -0
  225. package/modules/orm/models/index.d.ts +14 -13
  226. package/modules/orm/models/index.js +30 -28
  227. package/objects/orm/input-types.d.ts +62 -0
  228. package/package.json +4 -4
  229. package/usage/orm/input-types.d.ts +314 -19
@@ -0,0 +1,582 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * CLI commands for FunctionInvocationModule
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
+ publicSchemaName: 'string',
17
+ privateSchemaName: 'string',
18
+ invocationsTableId: 'uuid',
19
+ executionLogsTableId: 'uuid',
20
+ invocationsTableName: 'string',
21
+ executionLogsTableName: 'string',
22
+ apiName: 'string',
23
+ privateApiName: 'string',
24
+ scope: 'string',
25
+ prefix: 'string',
26
+ entityTableId: 'uuid',
27
+ policies: 'json',
28
+ provisions: 'json',
29
+ defaultPermissions: 'string',
30
+ };
31
+ const usage = '\nfunction-invocation-module <command>\n\nCommands:\n list List functionInvocationModule records\n find-first Find first matching functionInvocationModule record\n get Get a functionInvocationModule by ID\n create Create a new functionInvocationModule\n update Update an existing functionInvocationModule\n delete Delete a functionInvocationModule\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';
32
+ exports.default = async (argv, prompter, _options) => {
33
+ if (argv.help || argv.h) {
34
+ console.log(usage);
35
+ process.exit(0);
36
+ }
37
+ const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
38
+ if (!subcommand) {
39
+ const answer = await prompter.prompt(argv, [
40
+ {
41
+ type: 'autocomplete',
42
+ name: 'subcommand',
43
+ message: 'What do you want to do?',
44
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
45
+ },
46
+ ]);
47
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
48
+ }
49
+ return handleTableSubcommand(subcommand, newArgv, prompter);
50
+ };
51
+ async function handleTableSubcommand(subcommand, argv, prompter) {
52
+ switch (subcommand) {
53
+ case 'list':
54
+ return handleList(argv, prompter);
55
+ case 'find-first':
56
+ return handleFindFirst(argv, prompter);
57
+ case 'get':
58
+ return handleGet(argv, prompter);
59
+ case 'create':
60
+ return handleCreate(argv, prompter);
61
+ case 'update':
62
+ return handleUpdate(argv, prompter);
63
+ case 'delete':
64
+ return handleDelete(argv, prompter);
65
+ default:
66
+ console.log(usage);
67
+ process.exit(1);
68
+ }
69
+ }
70
+ async function handleList(argv, _prompter) {
71
+ try {
72
+ const defaultSelect = {
73
+ id: true,
74
+ databaseId: true,
75
+ schemaId: true,
76
+ privateSchemaId: true,
77
+ publicSchemaName: true,
78
+ privateSchemaName: true,
79
+ invocationsTableId: true,
80
+ executionLogsTableId: true,
81
+ invocationsTableName: true,
82
+ executionLogsTableName: true,
83
+ apiName: true,
84
+ privateApiName: true,
85
+ scope: true,
86
+ prefix: true,
87
+ entityTableId: true,
88
+ policies: true,
89
+ provisions: true,
90
+ defaultPermissions: true,
91
+ };
92
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
93
+ const client = (0, executor_1.getClient)();
94
+ const result = await client.functionInvocationModule.findMany(findManyArgs).execute();
95
+ console.log(JSON.stringify(result, null, 2));
96
+ }
97
+ catch (error) {
98
+ console.error('Failed to list records.');
99
+ if (error instanceof Error) {
100
+ console.error(error.message);
101
+ }
102
+ process.exit(1);
103
+ }
104
+ }
105
+ async function handleFindFirst(argv, _prompter) {
106
+ try {
107
+ const defaultSelect = {
108
+ id: true,
109
+ databaseId: true,
110
+ schemaId: true,
111
+ privateSchemaId: true,
112
+ publicSchemaName: true,
113
+ privateSchemaName: true,
114
+ invocationsTableId: true,
115
+ executionLogsTableId: true,
116
+ invocationsTableName: true,
117
+ executionLogsTableName: true,
118
+ apiName: true,
119
+ privateApiName: true,
120
+ scope: true,
121
+ prefix: true,
122
+ entityTableId: true,
123
+ policies: true,
124
+ provisions: true,
125
+ defaultPermissions: true,
126
+ };
127
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
128
+ const client = (0, executor_1.getClient)();
129
+ const result = await client.functionInvocationModule.findFirst(findFirstArgs).execute();
130
+ console.log(JSON.stringify(result, null, 2));
131
+ }
132
+ catch (error) {
133
+ console.error('Failed to find record.');
134
+ if (error instanceof Error) {
135
+ console.error(error.message);
136
+ }
137
+ process.exit(1);
138
+ }
139
+ }
140
+ async function handleGet(argv, prompter) {
141
+ try {
142
+ const answers = await prompter.prompt(argv, [
143
+ {
144
+ type: 'text',
145
+ name: 'id',
146
+ message: 'id',
147
+ required: true,
148
+ },
149
+ ]);
150
+ const client = (0, executor_1.getClient)();
151
+ const result = await client.functionInvocationModule
152
+ .findOne({
153
+ id: answers.id,
154
+ select: {
155
+ id: true,
156
+ databaseId: true,
157
+ schemaId: true,
158
+ privateSchemaId: true,
159
+ publicSchemaName: true,
160
+ privateSchemaName: true,
161
+ invocationsTableId: true,
162
+ executionLogsTableId: true,
163
+ invocationsTableName: true,
164
+ executionLogsTableName: true,
165
+ apiName: true,
166
+ privateApiName: true,
167
+ scope: true,
168
+ prefix: true,
169
+ entityTableId: true,
170
+ policies: true,
171
+ provisions: true,
172
+ defaultPermissions: true,
173
+ },
174
+ })
175
+ .execute();
176
+ console.log(JSON.stringify(result, null, 2));
177
+ }
178
+ catch (error) {
179
+ console.error('Record not found.');
180
+ if (error instanceof Error) {
181
+ console.error(error.message);
182
+ }
183
+ process.exit(1);
184
+ }
185
+ }
186
+ async function handleCreate(argv, prompter) {
187
+ try {
188
+ const rawAnswers = await prompter.prompt(argv, [
189
+ {
190
+ type: 'text',
191
+ name: 'databaseId',
192
+ message: 'databaseId',
193
+ required: true,
194
+ },
195
+ {
196
+ type: 'text',
197
+ name: 'schemaId',
198
+ message: 'schemaId',
199
+ required: false,
200
+ skipPrompt: true,
201
+ },
202
+ {
203
+ type: 'text',
204
+ name: 'privateSchemaId',
205
+ message: 'privateSchemaId',
206
+ required: false,
207
+ skipPrompt: true,
208
+ },
209
+ {
210
+ type: 'text',
211
+ name: 'publicSchemaName',
212
+ message: 'publicSchemaName',
213
+ required: false,
214
+ skipPrompt: true,
215
+ },
216
+ {
217
+ type: 'text',
218
+ name: 'privateSchemaName',
219
+ message: 'privateSchemaName',
220
+ required: false,
221
+ skipPrompt: true,
222
+ },
223
+ {
224
+ type: 'text',
225
+ name: 'invocationsTableId',
226
+ message: 'invocationsTableId',
227
+ required: false,
228
+ skipPrompt: true,
229
+ },
230
+ {
231
+ type: 'text',
232
+ name: 'executionLogsTableId',
233
+ message: 'executionLogsTableId',
234
+ required: false,
235
+ skipPrompt: true,
236
+ },
237
+ {
238
+ type: 'text',
239
+ name: 'invocationsTableName',
240
+ message: 'invocationsTableName',
241
+ required: false,
242
+ skipPrompt: true,
243
+ },
244
+ {
245
+ type: 'text',
246
+ name: 'executionLogsTableName',
247
+ message: 'executionLogsTableName',
248
+ required: false,
249
+ skipPrompt: true,
250
+ },
251
+ {
252
+ type: 'text',
253
+ name: 'apiName',
254
+ message: 'apiName',
255
+ required: false,
256
+ skipPrompt: true,
257
+ },
258
+ {
259
+ type: 'text',
260
+ name: 'privateApiName',
261
+ message: 'privateApiName',
262
+ required: false,
263
+ skipPrompt: true,
264
+ },
265
+ {
266
+ type: 'text',
267
+ name: 'scope',
268
+ message: 'scope',
269
+ required: false,
270
+ skipPrompt: true,
271
+ },
272
+ {
273
+ type: 'text',
274
+ name: 'prefix',
275
+ message: 'prefix',
276
+ required: false,
277
+ skipPrompt: true,
278
+ },
279
+ {
280
+ type: 'text',
281
+ name: 'entityTableId',
282
+ message: 'entityTableId',
283
+ required: false,
284
+ skipPrompt: true,
285
+ },
286
+ {
287
+ type: 'json',
288
+ name: 'policies',
289
+ message: 'policies',
290
+ required: false,
291
+ skipPrompt: true,
292
+ },
293
+ {
294
+ type: 'json',
295
+ name: 'provisions',
296
+ message: 'provisions',
297
+ required: false,
298
+ skipPrompt: true,
299
+ },
300
+ {
301
+ type: 'text',
302
+ name: 'defaultPermissions',
303
+ message: 'defaultPermissions',
304
+ required: false,
305
+ skipPrompt: true,
306
+ },
307
+ ]);
308
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
309
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
310
+ const client = (0, executor_1.getClient)();
311
+ const result = await client.functionInvocationModule
312
+ .create({
313
+ data: {
314
+ databaseId: cleanedData.databaseId,
315
+ schemaId: cleanedData.schemaId,
316
+ privateSchemaId: cleanedData.privateSchemaId,
317
+ publicSchemaName: cleanedData.publicSchemaName,
318
+ privateSchemaName: cleanedData.privateSchemaName,
319
+ invocationsTableId: cleanedData.invocationsTableId,
320
+ executionLogsTableId: cleanedData.executionLogsTableId,
321
+ invocationsTableName: cleanedData.invocationsTableName,
322
+ executionLogsTableName: cleanedData.executionLogsTableName,
323
+ apiName: cleanedData.apiName,
324
+ privateApiName: cleanedData.privateApiName,
325
+ scope: cleanedData.scope,
326
+ prefix: cleanedData.prefix,
327
+ entityTableId: cleanedData.entityTableId,
328
+ policies: cleanedData.policies,
329
+ provisions: cleanedData.provisions,
330
+ defaultPermissions: cleanedData.defaultPermissions,
331
+ },
332
+ select: {
333
+ id: true,
334
+ databaseId: true,
335
+ schemaId: true,
336
+ privateSchemaId: true,
337
+ publicSchemaName: true,
338
+ privateSchemaName: true,
339
+ invocationsTableId: true,
340
+ executionLogsTableId: true,
341
+ invocationsTableName: true,
342
+ executionLogsTableName: true,
343
+ apiName: true,
344
+ privateApiName: true,
345
+ scope: true,
346
+ prefix: true,
347
+ entityTableId: true,
348
+ policies: true,
349
+ provisions: true,
350
+ defaultPermissions: true,
351
+ },
352
+ })
353
+ .execute();
354
+ console.log(JSON.stringify(result, null, 2));
355
+ }
356
+ catch (error) {
357
+ console.error('Failed to create record.');
358
+ if (error instanceof Error) {
359
+ console.error(error.message);
360
+ }
361
+ process.exit(1);
362
+ }
363
+ }
364
+ async function handleUpdate(argv, prompter) {
365
+ try {
366
+ const rawAnswers = await prompter.prompt(argv, [
367
+ {
368
+ type: 'text',
369
+ name: 'id',
370
+ message: 'id',
371
+ required: true,
372
+ },
373
+ {
374
+ type: 'text',
375
+ name: 'databaseId',
376
+ message: 'databaseId',
377
+ required: false,
378
+ },
379
+ {
380
+ type: 'text',
381
+ name: 'schemaId',
382
+ message: 'schemaId',
383
+ required: false,
384
+ skipPrompt: true,
385
+ },
386
+ {
387
+ type: 'text',
388
+ name: 'privateSchemaId',
389
+ message: 'privateSchemaId',
390
+ required: false,
391
+ skipPrompt: true,
392
+ },
393
+ {
394
+ type: 'text',
395
+ name: 'publicSchemaName',
396
+ message: 'publicSchemaName',
397
+ required: false,
398
+ skipPrompt: true,
399
+ },
400
+ {
401
+ type: 'text',
402
+ name: 'privateSchemaName',
403
+ message: 'privateSchemaName',
404
+ required: false,
405
+ skipPrompt: true,
406
+ },
407
+ {
408
+ type: 'text',
409
+ name: 'invocationsTableId',
410
+ message: 'invocationsTableId',
411
+ required: false,
412
+ skipPrompt: true,
413
+ },
414
+ {
415
+ type: 'text',
416
+ name: 'executionLogsTableId',
417
+ message: 'executionLogsTableId',
418
+ required: false,
419
+ skipPrompt: true,
420
+ },
421
+ {
422
+ type: 'text',
423
+ name: 'invocationsTableName',
424
+ message: 'invocationsTableName',
425
+ required: false,
426
+ skipPrompt: true,
427
+ },
428
+ {
429
+ type: 'text',
430
+ name: 'executionLogsTableName',
431
+ message: 'executionLogsTableName',
432
+ required: false,
433
+ skipPrompt: true,
434
+ },
435
+ {
436
+ type: 'text',
437
+ name: 'apiName',
438
+ message: 'apiName',
439
+ required: false,
440
+ skipPrompt: true,
441
+ },
442
+ {
443
+ type: 'text',
444
+ name: 'privateApiName',
445
+ message: 'privateApiName',
446
+ required: false,
447
+ skipPrompt: true,
448
+ },
449
+ {
450
+ type: 'text',
451
+ name: 'scope',
452
+ message: 'scope',
453
+ required: false,
454
+ skipPrompt: true,
455
+ },
456
+ {
457
+ type: 'text',
458
+ name: 'prefix',
459
+ message: 'prefix',
460
+ required: false,
461
+ skipPrompt: true,
462
+ },
463
+ {
464
+ type: 'text',
465
+ name: 'entityTableId',
466
+ message: 'entityTableId',
467
+ required: false,
468
+ skipPrompt: true,
469
+ },
470
+ {
471
+ type: 'json',
472
+ name: 'policies',
473
+ message: 'policies',
474
+ required: false,
475
+ skipPrompt: true,
476
+ },
477
+ {
478
+ type: 'json',
479
+ name: 'provisions',
480
+ message: 'provisions',
481
+ required: false,
482
+ skipPrompt: true,
483
+ },
484
+ {
485
+ type: 'text',
486
+ name: 'defaultPermissions',
487
+ message: 'defaultPermissions',
488
+ required: false,
489
+ skipPrompt: true,
490
+ },
491
+ ]);
492
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
493
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
494
+ const client = (0, executor_1.getClient)();
495
+ const result = await client.functionInvocationModule
496
+ .update({
497
+ where: {
498
+ id: answers.id,
499
+ },
500
+ data: {
501
+ databaseId: cleanedData.databaseId,
502
+ schemaId: cleanedData.schemaId,
503
+ privateSchemaId: cleanedData.privateSchemaId,
504
+ publicSchemaName: cleanedData.publicSchemaName,
505
+ privateSchemaName: cleanedData.privateSchemaName,
506
+ invocationsTableId: cleanedData.invocationsTableId,
507
+ executionLogsTableId: cleanedData.executionLogsTableId,
508
+ invocationsTableName: cleanedData.invocationsTableName,
509
+ executionLogsTableName: cleanedData.executionLogsTableName,
510
+ apiName: cleanedData.apiName,
511
+ privateApiName: cleanedData.privateApiName,
512
+ scope: cleanedData.scope,
513
+ prefix: cleanedData.prefix,
514
+ entityTableId: cleanedData.entityTableId,
515
+ policies: cleanedData.policies,
516
+ provisions: cleanedData.provisions,
517
+ defaultPermissions: cleanedData.defaultPermissions,
518
+ },
519
+ select: {
520
+ id: true,
521
+ databaseId: true,
522
+ schemaId: true,
523
+ privateSchemaId: true,
524
+ publicSchemaName: true,
525
+ privateSchemaName: true,
526
+ invocationsTableId: true,
527
+ executionLogsTableId: true,
528
+ invocationsTableName: true,
529
+ executionLogsTableName: true,
530
+ apiName: true,
531
+ privateApiName: true,
532
+ scope: true,
533
+ prefix: true,
534
+ entityTableId: true,
535
+ policies: true,
536
+ provisions: true,
537
+ defaultPermissions: true,
538
+ },
539
+ })
540
+ .execute();
541
+ console.log(JSON.stringify(result, null, 2));
542
+ }
543
+ catch (error) {
544
+ console.error('Failed to update record.');
545
+ if (error instanceof Error) {
546
+ console.error(error.message);
547
+ }
548
+ process.exit(1);
549
+ }
550
+ }
551
+ async function handleDelete(argv, prompter) {
552
+ try {
553
+ const rawAnswers = await prompter.prompt(argv, [
554
+ {
555
+ type: 'text',
556
+ name: 'id',
557
+ message: 'id',
558
+ required: true,
559
+ },
560
+ ]);
561
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
562
+ const client = (0, executor_1.getClient)();
563
+ const result = await client.functionInvocationModule
564
+ .delete({
565
+ where: {
566
+ id: answers.id,
567
+ },
568
+ select: {
569
+ id: true,
570
+ },
571
+ })
572
+ .execute();
573
+ console.log(JSON.stringify(result, null, 2));
574
+ }
575
+ catch (error) {
576
+ console.error('Failed to delete record.');
577
+ if (error instanceof Error) {
578
+ console.error(error.message);
579
+ }
580
+ process.exit(1);
581
+ }
582
+ }