@constructive-sdk/cli 0.10.0 → 0.10.2

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 (276) hide show
  1. package/README.md +0 -8
  2. package/admin/cli/commands/app-level-requirement.js +0 -2
  3. package/admin/cli/commands/app-level.js +0 -2
  4. package/admin/cli/commands/app-permission.js +0 -2
  5. package/admin/cli/commands/invite.js +0 -2
  6. package/admin/cli/commands/membership-type.js +0 -3
  7. package/admin/cli/commands/org-chart-edge-grant.js +3 -3
  8. package/admin/cli/commands/org-chart-edge.js +0 -2
  9. package/admin/cli/commands/org-invite.js +0 -2
  10. package/admin/cli/commands/org-permission.js +0 -2
  11. package/admin/orm/input-types.d.ts +33 -127
  12. package/auth/cli/commands/audit-log.js +0 -2
  13. package/auth/cli/commands/connected-account.js +0 -3
  14. package/auth/cli/commands/crypto-address.js +0 -2
  15. package/auth/cli/commands/phone-number.js +0 -3
  16. package/auth/cli/commands.js +7 -7
  17. package/auth/cli/executor.d.ts +3 -3
  18. package/auth/orm/index.d.ts +6 -6
  19. package/auth/orm/index.js +6 -6
  20. package/auth/orm/input-types.d.ts +279 -327
  21. package/auth/orm/input-types.js +9 -1
  22. package/auth/orm/models/index.d.ts +3 -3
  23. package/auth/orm/models/index.js +7 -7
  24. package/esm/admin/cli/commands/app-level-requirement.js +0 -2
  25. package/esm/admin/cli/commands/app-level.js +0 -2
  26. package/esm/admin/cli/commands/app-permission.js +0 -2
  27. package/esm/admin/cli/commands/invite.js +0 -2
  28. package/esm/admin/cli/commands/membership-type.js +0 -3
  29. package/esm/admin/cli/commands/org-chart-edge-grant.js +3 -3
  30. package/esm/admin/cli/commands/org-chart-edge.js +0 -2
  31. package/esm/admin/cli/commands/org-invite.js +0 -2
  32. package/esm/admin/cli/commands/org-permission.js +0 -2
  33. package/esm/admin/orm/input-types.d.ts +33 -127
  34. package/esm/auth/cli/commands/audit-log.js +0 -2
  35. package/esm/auth/cli/commands/connected-account.js +0 -3
  36. package/esm/auth/cli/commands/crypto-address.js +0 -2
  37. package/esm/auth/cli/commands/phone-number.js +0 -3
  38. package/esm/auth/cli/commands.js +7 -7
  39. package/esm/auth/cli/executor.d.ts +3 -3
  40. package/esm/auth/orm/index.d.ts +6 -6
  41. package/esm/auth/orm/index.js +6 -6
  42. package/esm/auth/orm/input-types.d.ts +279 -327
  43. package/esm/auth/orm/input-types.js +9 -1
  44. package/esm/auth/orm/models/index.d.ts +3 -3
  45. package/esm/auth/orm/models/index.js +3 -3
  46. package/esm/index.d.ts +3 -3
  47. package/esm/index.js +3 -3
  48. package/esm/objects/cli/commands/commit.js +0 -2
  49. package/esm/objects/cli/commands/ref.js +0 -2
  50. package/esm/objects/cli/commands/store.js +0 -2
  51. package/esm/objects/orm/input-types.d.ts +17 -48
  52. package/esm/public/cli/commands/accept-database-transfer.d.ts +8 -0
  53. package/esm/public/cli/commands/accept-database-transfer.js +34 -0
  54. package/esm/public/cli/commands/api-module.js +0 -2
  55. package/esm/public/cli/commands/api.js +0 -5
  56. package/esm/public/cli/commands/app-level-requirement.js +0 -2
  57. package/esm/public/cli/commands/app-level.js +0 -2
  58. package/esm/public/cli/commands/app-permission.js +0 -2
  59. package/esm/public/cli/commands/app.js +0 -4
  60. package/esm/public/cli/commands/ast-migration.js +0 -2
  61. package/esm/public/cli/commands/audit-log.js +0 -2
  62. package/esm/public/cli/commands/blueprint-template.d.ts +8 -0
  63. package/esm/public/cli/commands/blueprint-template.js +549 -0
  64. package/esm/public/cli/commands/{uuid-module.d.ts → blueprint.d.ts} +1 -1
  65. package/esm/public/cli/commands/blueprint.js +484 -0
  66. package/esm/public/cli/commands/cancel-database-transfer.d.ts +8 -0
  67. package/esm/public/cli/commands/cancel-database-transfer.js +34 -0
  68. package/esm/public/cli/commands/check-constraint.js +0 -4
  69. package/esm/public/cli/commands/commit.js +0 -2
  70. package/esm/public/cli/commands/connected-account.js +0 -3
  71. package/esm/public/cli/commands/connected-accounts-module.js +0 -2
  72. package/esm/public/cli/commands/construct-blueprint.d.ts +8 -0
  73. package/esm/public/cli/commands/construct-blueprint.js +34 -0
  74. package/esm/public/cli/commands/copy-template-to-blueprint.d.ts +8 -0
  75. package/esm/public/cli/commands/copy-template-to-blueprint.js +34 -0
  76. package/esm/public/cli/commands/crypto-address.js +0 -2
  77. package/esm/public/cli/commands/crypto-addresses-module.js +0 -3
  78. package/esm/public/cli/commands/crypto-auth-module.js +0 -7
  79. package/esm/public/cli/commands/database-provision-module.js +0 -6
  80. package/esm/public/cli/commands/database-transfer.d.ts +8 -0
  81. package/esm/public/cli/commands/database-transfer.js +425 -0
  82. package/esm/public/cli/commands/database.js +0 -4
  83. package/esm/public/cli/commands/default-privilege.js +0 -4
  84. package/esm/public/cli/commands/denormalized-table-field.js +0 -2
  85. package/esm/public/cli/commands/emails-module.js +0 -2
  86. package/esm/public/cli/commands/embedding-chunk.d.ts +8 -0
  87. package/esm/public/cli/commands/embedding-chunk.js +513 -0
  88. package/esm/public/cli/commands/encrypted-secrets-module.js +0 -2
  89. package/{public/cli/commands/uuid-module.d.ts → esm/public/cli/commands/enum.d.ts} +1 -1
  90. package/esm/public/cli/commands/{uuid-module.js → enum.js} +175 -33
  91. package/esm/public/cli/commands/field-module.js +0 -2
  92. package/esm/public/cli/commands/field.js +21 -7
  93. package/esm/public/cli/commands/foreign-key-constraint.js +0 -7
  94. package/esm/public/cli/commands/hierarchy-module.js +0 -11
  95. package/esm/public/cli/commands/index.js +0 -4
  96. package/esm/public/cli/commands/invite.js +0 -2
  97. package/esm/public/cli/commands/invites-module.js +0 -5
  98. package/esm/public/cli/commands/levels-module.js +0 -16
  99. package/esm/public/cli/commands/limits-module.js +0 -10
  100. package/esm/public/cli/commands/membership-type.js +0 -3
  101. package/esm/public/cli/commands/membership-types-module.js +0 -2
  102. package/esm/public/cli/commands/memberships-module.js +0 -13
  103. package/esm/public/cli/commands/node-type-registry.js +0 -6
  104. package/esm/public/cli/commands/org-chart-edge-grant.js +3 -3
  105. package/esm/public/cli/commands/org-chart-edge.js +0 -2
  106. package/esm/public/cli/commands/org-invite.js +0 -2
  107. package/esm/public/cli/commands/org-permission.js +0 -2
  108. package/esm/public/cli/commands/permissions-module.js +0 -8
  109. package/esm/public/cli/commands/phone-number.js +0 -3
  110. package/esm/public/cli/commands/phone-numbers-module.js +0 -2
  111. package/esm/public/cli/commands/policy.js +0 -6
  112. package/esm/public/cli/commands/primary-key-constraint.js +0 -4
  113. package/esm/public/cli/commands/profiles-module.js +0 -6
  114. package/esm/public/cli/commands/ref.js +0 -2
  115. package/esm/public/cli/commands/reject-database-transfer.d.ts +8 -0
  116. package/esm/public/cli/commands/reject-database-transfer.js +34 -0
  117. package/esm/public/cli/commands/relation-provision.js +63 -11
  118. package/esm/public/cli/commands/rls-module.js +0 -5
  119. package/esm/public/cli/commands/schema-grant.js +0 -2
  120. package/esm/public/cli/commands/schema.js +0 -6
  121. package/esm/public/cli/commands/secrets-module.js +0 -2
  122. package/esm/public/cli/commands/secure-table-provision.js +0 -6
  123. package/esm/public/cli/commands/sessions-module.js +0 -4
  124. package/esm/public/cli/commands/site-metadatum.js +0 -3
  125. package/esm/public/cli/commands/site-module.js +0 -2
  126. package/esm/public/cli/commands/site.js +0 -4
  127. package/esm/public/cli/commands/sql-migration.js +0 -7
  128. package/esm/public/cli/commands/store.js +0 -2
  129. package/esm/public/cli/commands/table-grant.js +0 -3
  130. package/esm/public/cli/commands/table-template-module.js +0 -3
  131. package/esm/public/cli/commands/table.js +0 -7
  132. package/esm/public/cli/commands/trigger-function.js +0 -3
  133. package/esm/public/cli/commands/trigger.js +0 -5
  134. package/esm/public/cli/commands/unique-constraint.js +0 -5
  135. package/esm/public/cli/commands/user-auth-module.js +0 -17
  136. package/esm/public/cli/commands/users-module.js +0 -3
  137. package/esm/public/cli/commands/view-grant.js +0 -3
  138. package/esm/public/cli/commands/view-rule.js +0 -4
  139. package/esm/public/cli/commands/view.js +0 -5
  140. package/esm/public/cli/commands.js +53 -35
  141. package/esm/public/cli/executor.d.ts +68 -39
  142. package/esm/public/orm/index.d.ts +81 -48
  143. package/esm/public/orm/index.js +26 -18
  144. package/esm/public/orm/input-types.d.ts +2447 -2980
  145. package/esm/public/orm/input-types.js +26 -1
  146. package/esm/public/orm/models/blueprint.d.ts +56 -0
  147. package/esm/public/orm/models/blueprint.js +94 -0
  148. package/esm/public/orm/models/blueprintTemplate.d.ts +56 -0
  149. package/esm/public/orm/models/blueprintTemplate.js +94 -0
  150. package/esm/public/orm/models/databaseTransfer.d.ts +56 -0
  151. package/esm/public/orm/models/databaseTransfer.js +94 -0
  152. package/esm/public/orm/models/embeddingChunk.d.ts +56 -0
  153. package/esm/public/orm/models/embeddingChunk.js +94 -0
  154. package/esm/public/orm/models/enum.d.ts +56 -0
  155. package/esm/public/orm/models/{uuidModule.js → enum.js} +23 -23
  156. package/esm/public/orm/models/index.d.ts +13 -9
  157. package/esm/public/orm/models/index.js +13 -9
  158. package/esm/public/orm/mutation/index.d.ts +98 -50
  159. package/esm/public/orm/mutation/index.js +126 -66
  160. package/index.d.ts +3 -3
  161. package/index.js +8 -8
  162. package/objects/cli/commands/commit.js +0 -2
  163. package/objects/cli/commands/ref.js +0 -2
  164. package/objects/cli/commands/store.js +0 -2
  165. package/objects/orm/input-types.d.ts +17 -48
  166. package/package.json +3 -3
  167. package/public/cli/commands/accept-database-transfer.d.ts +8 -0
  168. package/public/cli/commands/accept-database-transfer.js +36 -0
  169. package/public/cli/commands/api-module.js +0 -2
  170. package/public/cli/commands/api.js +0 -5
  171. package/public/cli/commands/app-level-requirement.js +0 -2
  172. package/public/cli/commands/app-level.js +0 -2
  173. package/public/cli/commands/app-permission.js +0 -2
  174. package/public/cli/commands/app.js +0 -4
  175. package/public/cli/commands/ast-migration.js +0 -2
  176. package/public/cli/commands/audit-log.js +0 -2
  177. package/public/cli/commands/blueprint-template.d.ts +8 -0
  178. package/public/cli/commands/blueprint-template.js +551 -0
  179. package/public/cli/commands/blueprint.d.ts +8 -0
  180. package/public/cli/commands/blueprint.js +486 -0
  181. package/public/cli/commands/cancel-database-transfer.d.ts +8 -0
  182. package/public/cli/commands/cancel-database-transfer.js +36 -0
  183. package/public/cli/commands/check-constraint.js +0 -4
  184. package/public/cli/commands/commit.js +0 -2
  185. package/public/cli/commands/connected-account.js +0 -3
  186. package/public/cli/commands/connected-accounts-module.js +0 -2
  187. package/public/cli/commands/construct-blueprint.d.ts +8 -0
  188. package/public/cli/commands/construct-blueprint.js +36 -0
  189. package/public/cli/commands/copy-template-to-blueprint.d.ts +8 -0
  190. package/public/cli/commands/copy-template-to-blueprint.js +36 -0
  191. package/public/cli/commands/crypto-address.js +0 -2
  192. package/public/cli/commands/crypto-addresses-module.js +0 -3
  193. package/public/cli/commands/crypto-auth-module.js +0 -7
  194. package/public/cli/commands/database-provision-module.js +0 -6
  195. package/public/cli/commands/database-transfer.d.ts +8 -0
  196. package/public/cli/commands/database-transfer.js +427 -0
  197. package/public/cli/commands/database.js +0 -4
  198. package/public/cli/commands/default-privilege.js +0 -4
  199. package/public/cli/commands/denormalized-table-field.js +0 -2
  200. package/public/cli/commands/emails-module.js +0 -2
  201. package/public/cli/commands/embedding-chunk.d.ts +8 -0
  202. package/public/cli/commands/embedding-chunk.js +515 -0
  203. package/public/cli/commands/encrypted-secrets-module.js +0 -2
  204. package/public/cli/commands/enum.d.ts +8 -0
  205. package/public/cli/commands/{uuid-module.js → enum.js} +175 -33
  206. package/public/cli/commands/field-module.js +0 -2
  207. package/public/cli/commands/field.js +21 -7
  208. package/public/cli/commands/foreign-key-constraint.js +0 -7
  209. package/public/cli/commands/hierarchy-module.js +0 -11
  210. package/public/cli/commands/index.js +0 -4
  211. package/public/cli/commands/invite.js +0 -2
  212. package/public/cli/commands/invites-module.js +0 -5
  213. package/public/cli/commands/levels-module.js +0 -16
  214. package/public/cli/commands/limits-module.js +0 -10
  215. package/public/cli/commands/membership-type.js +0 -3
  216. package/public/cli/commands/membership-types-module.js +0 -2
  217. package/public/cli/commands/memberships-module.js +0 -13
  218. package/public/cli/commands/node-type-registry.js +0 -6
  219. package/public/cli/commands/org-chart-edge-grant.js +3 -3
  220. package/public/cli/commands/org-chart-edge.js +0 -2
  221. package/public/cli/commands/org-invite.js +0 -2
  222. package/public/cli/commands/org-permission.js +0 -2
  223. package/public/cli/commands/permissions-module.js +0 -8
  224. package/public/cli/commands/phone-number.js +0 -3
  225. package/public/cli/commands/phone-numbers-module.js +0 -2
  226. package/public/cli/commands/policy.js +0 -6
  227. package/public/cli/commands/primary-key-constraint.js +0 -4
  228. package/public/cli/commands/profiles-module.js +0 -6
  229. package/public/cli/commands/ref.js +0 -2
  230. package/public/cli/commands/reject-database-transfer.d.ts +8 -0
  231. package/public/cli/commands/reject-database-transfer.js +36 -0
  232. package/public/cli/commands/relation-provision.js +63 -11
  233. package/public/cli/commands/rls-module.js +0 -5
  234. package/public/cli/commands/schema-grant.js +0 -2
  235. package/public/cli/commands/schema.js +0 -6
  236. package/public/cli/commands/secrets-module.js +0 -2
  237. package/public/cli/commands/secure-table-provision.js +0 -6
  238. package/public/cli/commands/sessions-module.js +0 -4
  239. package/public/cli/commands/site-metadatum.js +0 -3
  240. package/public/cli/commands/site-module.js +0 -2
  241. package/public/cli/commands/site.js +0 -4
  242. package/public/cli/commands/sql-migration.js +0 -7
  243. package/public/cli/commands/store.js +0 -2
  244. package/public/cli/commands/table-grant.js +0 -3
  245. package/public/cli/commands/table-template-module.js +0 -3
  246. package/public/cli/commands/table.js +0 -7
  247. package/public/cli/commands/trigger-function.js +0 -3
  248. package/public/cli/commands/trigger.js +0 -5
  249. package/public/cli/commands/unique-constraint.js +0 -5
  250. package/public/cli/commands/user-auth-module.js +0 -17
  251. package/public/cli/commands/users-module.js +0 -3
  252. package/public/cli/commands/view-grant.js +0 -3
  253. package/public/cli/commands/view-rule.js +0 -4
  254. package/public/cli/commands/view.js +0 -5
  255. package/public/cli/commands.js +53 -35
  256. package/public/cli/executor.d.ts +68 -39
  257. package/public/orm/index.d.ts +81 -48
  258. package/public/orm/index.js +26 -18
  259. package/public/orm/input-types.d.ts +2447 -2980
  260. package/public/orm/input-types.js +26 -1
  261. package/public/orm/models/blueprint.d.ts +56 -0
  262. package/public/orm/models/blueprint.js +98 -0
  263. package/public/orm/models/blueprintTemplate.d.ts +56 -0
  264. package/public/orm/models/blueprintTemplate.js +98 -0
  265. package/public/orm/models/databaseTransfer.d.ts +56 -0
  266. package/public/orm/models/databaseTransfer.js +98 -0
  267. package/public/orm/models/embeddingChunk.d.ts +56 -0
  268. package/public/orm/models/embeddingChunk.js +98 -0
  269. package/public/orm/models/enum.d.ts +56 -0
  270. package/public/orm/models/{uuidModule.js → enum.js} +25 -25
  271. package/public/orm/models/index.d.ts +13 -9
  272. package/public/orm/models/index.js +29 -21
  273. package/public/orm/mutation/index.d.ts +98 -50
  274. package/public/orm/mutation/index.js +126 -66
  275. package/esm/public/orm/models/uuidModule.d.ts +0 -56
  276. package/public/orm/models/uuidModule.d.ts +0 -56
@@ -0,0 +1,486 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * CLI commands for Blueprint
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
+ ownerId: 'uuid',
14
+ databaseId: 'uuid',
15
+ name: 'string',
16
+ displayName: 'string',
17
+ description: 'string',
18
+ definition: 'json',
19
+ templateId: 'uuid',
20
+ status: 'string',
21
+ constructedAt: 'string',
22
+ errorDetails: 'string',
23
+ refMap: 'json',
24
+ constructedDefinition: 'json',
25
+ definitionHash: 'uuid',
26
+ tableHashes: 'json',
27
+ createdAt: 'string',
28
+ updatedAt: 'string',
29
+ };
30
+ const usage = '\nblueprint <command>\n\nCommands:\n list List all blueprint records\n get Get a blueprint by ID\n create Create a new blueprint\n update Update an existing blueprint\n delete Delete a blueprint\n\n --help, -h Show this help message\n';
31
+ exports.default = async (argv, prompter, _options) => {
32
+ if (argv.help || argv.h) {
33
+ console.log(usage);
34
+ process.exit(0);
35
+ }
36
+ const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
37
+ if (!subcommand) {
38
+ const answer = await prompter.prompt(argv, [
39
+ {
40
+ type: 'autocomplete',
41
+ name: 'subcommand',
42
+ message: 'What do you want to do?',
43
+ options: ['list', 'get', 'create', 'update', 'delete'],
44
+ },
45
+ ]);
46
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
47
+ }
48
+ return handleTableSubcommand(subcommand, newArgv, prompter);
49
+ };
50
+ async function handleTableSubcommand(subcommand, argv, prompter) {
51
+ switch (subcommand) {
52
+ case 'list':
53
+ return handleList(argv, prompter);
54
+ case 'get':
55
+ return handleGet(argv, prompter);
56
+ case 'create':
57
+ return handleCreate(argv, prompter);
58
+ case 'update':
59
+ return handleUpdate(argv, prompter);
60
+ case 'delete':
61
+ return handleDelete(argv, prompter);
62
+ default:
63
+ console.log(usage);
64
+ process.exit(1);
65
+ }
66
+ }
67
+ async function handleList(_argv, _prompter) {
68
+ try {
69
+ const client = (0, executor_1.getClient)();
70
+ const result = await client.blueprint
71
+ .findMany({
72
+ select: {
73
+ id: true,
74
+ ownerId: true,
75
+ databaseId: true,
76
+ name: true,
77
+ displayName: true,
78
+ description: true,
79
+ definition: true,
80
+ templateId: true,
81
+ status: true,
82
+ constructedAt: true,
83
+ errorDetails: true,
84
+ refMap: true,
85
+ constructedDefinition: true,
86
+ definitionHash: true,
87
+ tableHashes: true,
88
+ createdAt: true,
89
+ updatedAt: true,
90
+ },
91
+ })
92
+ .execute();
93
+ console.log(JSON.stringify(result, null, 2));
94
+ }
95
+ catch (error) {
96
+ console.error('Failed to list records.');
97
+ if (error instanceof Error) {
98
+ console.error(error.message);
99
+ }
100
+ process.exit(1);
101
+ }
102
+ }
103
+ async function handleGet(argv, prompter) {
104
+ try {
105
+ const answers = await prompter.prompt(argv, [
106
+ {
107
+ type: 'text',
108
+ name: 'id',
109
+ message: 'id',
110
+ required: true,
111
+ },
112
+ ]);
113
+ const client = (0, executor_1.getClient)();
114
+ const result = await client.blueprint
115
+ .findOne({
116
+ id: answers.id,
117
+ select: {
118
+ id: true,
119
+ ownerId: true,
120
+ databaseId: true,
121
+ name: true,
122
+ displayName: true,
123
+ description: true,
124
+ definition: true,
125
+ templateId: true,
126
+ status: true,
127
+ constructedAt: true,
128
+ errorDetails: true,
129
+ refMap: true,
130
+ constructedDefinition: true,
131
+ definitionHash: true,
132
+ tableHashes: true,
133
+ createdAt: true,
134
+ updatedAt: true,
135
+ },
136
+ })
137
+ .execute();
138
+ console.log(JSON.stringify(result, null, 2));
139
+ }
140
+ catch (error) {
141
+ console.error('Record not found.');
142
+ if (error instanceof Error) {
143
+ console.error(error.message);
144
+ }
145
+ process.exit(1);
146
+ }
147
+ }
148
+ async function handleCreate(argv, prompter) {
149
+ try {
150
+ const rawAnswers = await prompter.prompt(argv, [
151
+ {
152
+ type: 'text',
153
+ name: 'ownerId',
154
+ message: 'ownerId',
155
+ required: true,
156
+ },
157
+ {
158
+ type: 'text',
159
+ name: 'databaseId',
160
+ message: 'databaseId',
161
+ required: true,
162
+ },
163
+ {
164
+ type: 'text',
165
+ name: 'name',
166
+ message: 'name',
167
+ required: true,
168
+ },
169
+ {
170
+ type: 'text',
171
+ name: 'displayName',
172
+ message: 'displayName',
173
+ required: true,
174
+ },
175
+ {
176
+ type: 'text',
177
+ name: 'description',
178
+ message: 'description',
179
+ required: false,
180
+ skipPrompt: true,
181
+ },
182
+ {
183
+ type: 'json',
184
+ name: 'definition',
185
+ message: 'definition',
186
+ required: true,
187
+ },
188
+ {
189
+ type: 'text',
190
+ name: 'templateId',
191
+ message: 'templateId',
192
+ required: false,
193
+ skipPrompt: true,
194
+ },
195
+ {
196
+ type: 'text',
197
+ name: 'status',
198
+ message: 'status',
199
+ required: false,
200
+ skipPrompt: true,
201
+ },
202
+ {
203
+ type: 'text',
204
+ name: 'constructedAt',
205
+ message: 'constructedAt',
206
+ required: false,
207
+ skipPrompt: true,
208
+ },
209
+ {
210
+ type: 'text',
211
+ name: 'errorDetails',
212
+ message: 'errorDetails',
213
+ required: false,
214
+ skipPrompt: true,
215
+ },
216
+ {
217
+ type: 'json',
218
+ name: 'refMap',
219
+ message: 'refMap',
220
+ required: false,
221
+ skipPrompt: true,
222
+ },
223
+ {
224
+ type: 'json',
225
+ name: 'constructedDefinition',
226
+ message: 'constructedDefinition',
227
+ required: false,
228
+ skipPrompt: true,
229
+ },
230
+ {
231
+ type: 'text',
232
+ name: 'definitionHash',
233
+ message: 'definitionHash',
234
+ required: false,
235
+ skipPrompt: true,
236
+ },
237
+ {
238
+ type: 'json',
239
+ name: 'tableHashes',
240
+ message: 'tableHashes',
241
+ required: false,
242
+ skipPrompt: true,
243
+ },
244
+ ]);
245
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
246
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
247
+ const client = (0, executor_1.getClient)();
248
+ const result = await client.blueprint
249
+ .create({
250
+ data: {
251
+ ownerId: cleanedData.ownerId,
252
+ databaseId: cleanedData.databaseId,
253
+ name: cleanedData.name,
254
+ displayName: cleanedData.displayName,
255
+ description: cleanedData.description,
256
+ definition: cleanedData.definition,
257
+ templateId: cleanedData.templateId,
258
+ status: cleanedData.status,
259
+ constructedAt: cleanedData.constructedAt,
260
+ errorDetails: cleanedData.errorDetails,
261
+ refMap: cleanedData.refMap,
262
+ constructedDefinition: cleanedData.constructedDefinition,
263
+ definitionHash: cleanedData.definitionHash,
264
+ tableHashes: cleanedData.tableHashes,
265
+ },
266
+ select: {
267
+ id: true,
268
+ ownerId: true,
269
+ databaseId: true,
270
+ name: true,
271
+ displayName: true,
272
+ description: true,
273
+ definition: true,
274
+ templateId: true,
275
+ status: true,
276
+ constructedAt: true,
277
+ errorDetails: true,
278
+ refMap: true,
279
+ constructedDefinition: true,
280
+ definitionHash: true,
281
+ tableHashes: true,
282
+ createdAt: true,
283
+ updatedAt: true,
284
+ },
285
+ })
286
+ .execute();
287
+ console.log(JSON.stringify(result, null, 2));
288
+ }
289
+ catch (error) {
290
+ console.error('Failed to create record.');
291
+ if (error instanceof Error) {
292
+ console.error(error.message);
293
+ }
294
+ process.exit(1);
295
+ }
296
+ }
297
+ async function handleUpdate(argv, prompter) {
298
+ try {
299
+ const rawAnswers = await prompter.prompt(argv, [
300
+ {
301
+ type: 'text',
302
+ name: 'id',
303
+ message: 'id',
304
+ required: true,
305
+ },
306
+ {
307
+ type: 'text',
308
+ name: 'ownerId',
309
+ message: 'ownerId',
310
+ required: false,
311
+ },
312
+ {
313
+ type: 'text',
314
+ name: 'databaseId',
315
+ message: 'databaseId',
316
+ required: false,
317
+ },
318
+ {
319
+ type: 'text',
320
+ name: 'name',
321
+ message: 'name',
322
+ required: false,
323
+ },
324
+ {
325
+ type: 'text',
326
+ name: 'displayName',
327
+ message: 'displayName',
328
+ required: false,
329
+ },
330
+ {
331
+ type: 'text',
332
+ name: 'description',
333
+ message: 'description',
334
+ required: false,
335
+ skipPrompt: true,
336
+ },
337
+ {
338
+ type: 'json',
339
+ name: 'definition',
340
+ message: 'definition',
341
+ required: false,
342
+ },
343
+ {
344
+ type: 'text',
345
+ name: 'templateId',
346
+ message: 'templateId',
347
+ required: false,
348
+ skipPrompt: true,
349
+ },
350
+ {
351
+ type: 'text',
352
+ name: 'status',
353
+ message: 'status',
354
+ required: false,
355
+ skipPrompt: true,
356
+ },
357
+ {
358
+ type: 'text',
359
+ name: 'constructedAt',
360
+ message: 'constructedAt',
361
+ required: false,
362
+ skipPrompt: true,
363
+ },
364
+ {
365
+ type: 'text',
366
+ name: 'errorDetails',
367
+ message: 'errorDetails',
368
+ required: false,
369
+ skipPrompt: true,
370
+ },
371
+ {
372
+ type: 'json',
373
+ name: 'refMap',
374
+ message: 'refMap',
375
+ required: false,
376
+ skipPrompt: true,
377
+ },
378
+ {
379
+ type: 'json',
380
+ name: 'constructedDefinition',
381
+ message: 'constructedDefinition',
382
+ required: false,
383
+ skipPrompt: true,
384
+ },
385
+ {
386
+ type: 'text',
387
+ name: 'definitionHash',
388
+ message: 'definitionHash',
389
+ required: false,
390
+ skipPrompt: true,
391
+ },
392
+ {
393
+ type: 'json',
394
+ name: 'tableHashes',
395
+ message: 'tableHashes',
396
+ required: false,
397
+ skipPrompt: true,
398
+ },
399
+ ]);
400
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
401
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
402
+ const client = (0, executor_1.getClient)();
403
+ const result = await client.blueprint
404
+ .update({
405
+ where: {
406
+ id: answers.id,
407
+ },
408
+ data: {
409
+ ownerId: cleanedData.ownerId,
410
+ databaseId: cleanedData.databaseId,
411
+ name: cleanedData.name,
412
+ displayName: cleanedData.displayName,
413
+ description: cleanedData.description,
414
+ definition: cleanedData.definition,
415
+ templateId: cleanedData.templateId,
416
+ status: cleanedData.status,
417
+ constructedAt: cleanedData.constructedAt,
418
+ errorDetails: cleanedData.errorDetails,
419
+ refMap: cleanedData.refMap,
420
+ constructedDefinition: cleanedData.constructedDefinition,
421
+ definitionHash: cleanedData.definitionHash,
422
+ tableHashes: cleanedData.tableHashes,
423
+ },
424
+ select: {
425
+ id: true,
426
+ ownerId: true,
427
+ databaseId: true,
428
+ name: true,
429
+ displayName: true,
430
+ description: true,
431
+ definition: true,
432
+ templateId: true,
433
+ status: true,
434
+ constructedAt: true,
435
+ errorDetails: true,
436
+ refMap: true,
437
+ constructedDefinition: true,
438
+ definitionHash: true,
439
+ tableHashes: true,
440
+ createdAt: true,
441
+ updatedAt: true,
442
+ },
443
+ })
444
+ .execute();
445
+ console.log(JSON.stringify(result, null, 2));
446
+ }
447
+ catch (error) {
448
+ console.error('Failed to update record.');
449
+ if (error instanceof Error) {
450
+ console.error(error.message);
451
+ }
452
+ process.exit(1);
453
+ }
454
+ }
455
+ async function handleDelete(argv, prompter) {
456
+ try {
457
+ const rawAnswers = await prompter.prompt(argv, [
458
+ {
459
+ type: 'text',
460
+ name: 'id',
461
+ message: 'id',
462
+ required: true,
463
+ },
464
+ ]);
465
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
466
+ const client = (0, executor_1.getClient)();
467
+ const result = await client.blueprint
468
+ .delete({
469
+ where: {
470
+ id: answers.id,
471
+ },
472
+ select: {
473
+ id: true,
474
+ },
475
+ })
476
+ .execute();
477
+ console.log(JSON.stringify(result, null, 2));
478
+ }
479
+ catch (error) {
480
+ console.error('Failed to delete record.');
481
+ if (error instanceof Error) {
482
+ console.error(error.message);
483
+ }
484
+ process.exit(1);
485
+ }
486
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI command for mutation cancelDatabaseTransfer
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;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const executor_1 = require("../executor");
4
+ const utils_1 = require("../utils");
5
+ exports.default = async (argv, prompter, _options) => {
6
+ try {
7
+ if (argv.help || argv.h) {
8
+ console.log('cancel-database-transfer - cancelDatabaseTransfer\n\nUsage: cancel-database-transfer [OPTIONS]\n');
9
+ process.exit(0);
10
+ }
11
+ const answers = await prompter.prompt(argv, [
12
+ {
13
+ type: 'text',
14
+ name: 'input',
15
+ message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
16
+ required: true,
17
+ },
18
+ ]);
19
+ const client = (0, executor_1.getClient)();
20
+ const parsedAnswers = (0, utils_1.unflattenDotNotation)(answers);
21
+ const selectFields = (0, utils_1.buildSelectFromPaths)(argv.select ?? 'clientMutationId');
22
+ const result = await client.mutation
23
+ .cancelDatabaseTransfer(parsedAnswers, {
24
+ select: selectFields,
25
+ })
26
+ .execute();
27
+ console.log(JSON.stringify(result, null, 2));
28
+ }
29
+ catch (error) {
30
+ console.error('Failed: cancelDatabaseTransfer');
31
+ if (error instanceof Error) {
32
+ console.error(error.message);
33
+ }
34
+ process.exit(1);
35
+ }
36
+ };
@@ -23,10 +23,6 @@ const fieldSchema = {
23
23
  tags: 'string',
24
24
  createdAt: 'string',
25
25
  updatedAt: 'string',
26
- nameTrgmSimilarity: 'float',
27
- typeTrgmSimilarity: 'float',
28
- moduleTrgmSimilarity: 'float',
29
- searchScore: 'float',
30
26
  };
31
27
  const usage = '\ncheck-constraint <command>\n\nCommands:\n list List all checkConstraint records\n get Get a checkConstraint by ID\n create Create a new checkConstraint\n update Update an existing checkConstraint\n delete Delete a checkConstraint\n\n --help, -h Show this help message\n';
32
28
  exports.default = async (argv, prompter, _options) => {
@@ -18,8 +18,6 @@ const fieldSchema = {
18
18
  committerId: 'uuid',
19
19
  treeId: 'uuid',
20
20
  date: 'string',
21
- messageTrgmSimilarity: 'float',
22
- searchScore: 'float',
23
21
  };
24
22
  const usage = '\ncommit <command>\n\nCommands:\n list List all commit records\n get Get a commit by ID\n create Create a new commit\n update Update an existing commit\n delete Delete a commit\n\n --help, -h Show this help message\n';
25
23
  exports.default = async (argv, prompter, _options) => {
@@ -17,9 +17,6 @@ const fieldSchema = {
17
17
  isVerified: 'boolean',
18
18
  createdAt: 'string',
19
19
  updatedAt: 'string',
20
- serviceTrgmSimilarity: 'float',
21
- identifierTrgmSimilarity: 'float',
22
- searchScore: 'float',
23
20
  };
24
21
  const usage = '\nconnected-account <command>\n\nCommands:\n list List all connectedAccount records\n get Get a connectedAccount by ID\n create Create a new connectedAccount\n update Update an existing connectedAccount\n delete Delete a connectedAccount\n\n --help, -h Show this help message\n';
25
22
  exports.default = async (argv, prompter, _options) => {
@@ -16,8 +16,6 @@ const fieldSchema = {
16
16
  tableId: 'uuid',
17
17
  ownerTableId: 'uuid',
18
18
  tableName: 'string',
19
- tableNameTrgmSimilarity: 'float',
20
- searchScore: 'float',
21
19
  };
22
20
  const usage = '\nconnected-accounts-module <command>\n\nCommands:\n list List all connectedAccountsModule records\n get Get a connectedAccountsModule by ID\n create Create a new connectedAccountsModule\n update Update an existing connectedAccountsModule\n delete Delete a connectedAccountsModule\n\n --help, -h Show this help message\n';
23
21
  exports.default = async (argv, prompter, _options) => {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI command for mutation constructBlueprint
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;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const executor_1 = require("../executor");
4
+ const utils_1 = require("../utils");
5
+ exports.default = async (argv, prompter, _options) => {
6
+ try {
7
+ if (argv.help || argv.h) {
8
+ console.log('construct-blueprint - Executes a draft blueprint definition. Four phases: (1) create tables with nodes[], fields, and policies[], (2) create relations between tables, (3) create indexes on table fields (supports BTREE, HNSW, GIN, GIST, BM25, etc.), (4) create full-text search configurations with weighted multi-field TSVector support. nodes[] entries can be strings or {$type, data} objects. Relations use $type for relation_type with junction config in data. Indexes reference table_ref + column name(s) and are resolved to field_ids. Full-text searches reference table_ref + tsvector field + source fields with weights/langs. Builds a ref_map of local ref names to created table UUIDs. Updates blueprint status to constructed (or failed with error_details). Returns the ref_map.\n\nUsage: construct-blueprint [OPTIONS]\n');
9
+ process.exit(0);
10
+ }
11
+ const answers = await prompter.prompt(argv, [
12
+ {
13
+ type: 'text',
14
+ name: 'input',
15
+ message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
16
+ required: true,
17
+ },
18
+ ]);
19
+ const client = (0, executor_1.getClient)();
20
+ const parsedAnswers = (0, utils_1.unflattenDotNotation)(answers);
21
+ const selectFields = (0, utils_1.buildSelectFromPaths)(argv.select ?? 'clientMutationId');
22
+ const result = await client.mutation
23
+ .constructBlueprint(parsedAnswers, {
24
+ select: selectFields,
25
+ })
26
+ .execute();
27
+ console.log(JSON.stringify(result, null, 2));
28
+ }
29
+ catch (error) {
30
+ console.error('Failed: constructBlueprint');
31
+ if (error instanceof Error) {
32
+ console.error(error.message);
33
+ }
34
+ process.exit(1);
35
+ }
36
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI command for mutation copyTemplateToBlueprint
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;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const executor_1 = require("../executor");
4
+ const utils_1 = require("../utils");
5
+ exports.default = async (argv, prompter, _options) => {
6
+ try {
7
+ if (argv.help || argv.h) {
8
+ console.log('copy-template-to-blueprint - Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n\nUsage: copy-template-to-blueprint [OPTIONS]\n');
9
+ process.exit(0);
10
+ }
11
+ const answers = await prompter.prompt(argv, [
12
+ {
13
+ type: 'text',
14
+ name: 'input',
15
+ message: 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.',
16
+ required: true,
17
+ },
18
+ ]);
19
+ const client = (0, executor_1.getClient)();
20
+ const parsedAnswers = (0, utils_1.unflattenDotNotation)(answers);
21
+ const selectFields = (0, utils_1.buildSelectFromPaths)(argv.select ?? 'clientMutationId');
22
+ const result = await client.mutation
23
+ .copyTemplateToBlueprint(parsedAnswers, {
24
+ select: selectFields,
25
+ })
26
+ .execute();
27
+ console.log(JSON.stringify(result, null, 2));
28
+ }
29
+ catch (error) {
30
+ console.error('Failed: copyTemplateToBlueprint');
31
+ if (error instanceof Error) {
32
+ console.error(error.message);
33
+ }
34
+ process.exit(1);
35
+ }
36
+ };
@@ -16,8 +16,6 @@ const fieldSchema = {
16
16
  isPrimary: 'boolean',
17
17
  createdAt: 'string',
18
18
  updatedAt: 'string',
19
- addressTrgmSimilarity: 'float',
20
- searchScore: 'float',
21
19
  };
22
20
  const usage = '\ncrypto-address <command>\n\nCommands:\n list List all cryptoAddress records\n get Get a cryptoAddress by ID\n create Create a new cryptoAddress\n update Update an existing cryptoAddress\n delete Delete a cryptoAddress\n\n --help, -h Show this help message\n';
23
21
  exports.default = async (argv, prompter, _options) => {
@@ -17,9 +17,6 @@ const fieldSchema = {
17
17
  ownerTableId: 'uuid',
18
18
  tableName: 'string',
19
19
  cryptoNetwork: 'string',
20
- tableNameTrgmSimilarity: 'float',
21
- cryptoNetworkTrgmSimilarity: 'float',
22
- searchScore: 'float',
23
20
  };
24
21
  const usage = '\ncrypto-addresses-module <command>\n\nCommands:\n list List all cryptoAddressesModule records\n get Get a cryptoAddressesModule by ID\n create Create a new cryptoAddressesModule\n update Update an existing cryptoAddressesModule\n delete Delete a cryptoAddressesModule\n\n --help, -h Show this help message\n';
25
22
  exports.default = async (argv, prompter, _options) => {