@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,515 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * CLI commands for EmbeddingChunk
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
+ tableId: 'uuid',
15
+ embeddingFieldId: 'uuid',
16
+ chunksTableId: 'uuid',
17
+ chunksTableName: 'string',
18
+ contentFieldName: 'string',
19
+ dimensions: 'int',
20
+ metric: 'string',
21
+ chunkSize: 'int',
22
+ chunkOverlap: 'int',
23
+ chunkStrategy: 'string',
24
+ metadataFields: 'json',
25
+ enqueueChunkingJob: 'boolean',
26
+ chunkingTaskName: 'string',
27
+ parentFkFieldId: 'uuid',
28
+ createdAt: 'string',
29
+ updatedAt: 'string',
30
+ };
31
+ const usage = '\nembedding-chunk <command>\n\nCommands:\n list List all embeddingChunk records\n get Get a embeddingChunk by ID\n create Create a new embeddingChunk\n update Update an existing embeddingChunk\n delete Delete a embeddingChunk\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', '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 'get':
56
+ return handleGet(argv, prompter);
57
+ case 'create':
58
+ return handleCreate(argv, prompter);
59
+ case 'update':
60
+ return handleUpdate(argv, prompter);
61
+ case 'delete':
62
+ return handleDelete(argv, prompter);
63
+ default:
64
+ console.log(usage);
65
+ process.exit(1);
66
+ }
67
+ }
68
+ async function handleList(_argv, _prompter) {
69
+ try {
70
+ const client = (0, executor_1.getClient)();
71
+ const result = await client.embeddingChunk
72
+ .findMany({
73
+ select: {
74
+ id: true,
75
+ databaseId: true,
76
+ tableId: true,
77
+ embeddingFieldId: true,
78
+ chunksTableId: true,
79
+ chunksTableName: true,
80
+ contentFieldName: true,
81
+ dimensions: true,
82
+ metric: true,
83
+ chunkSize: true,
84
+ chunkOverlap: true,
85
+ chunkStrategy: true,
86
+ metadataFields: true,
87
+ enqueueChunkingJob: true,
88
+ chunkingTaskName: true,
89
+ parentFkFieldId: true,
90
+ createdAt: true,
91
+ updatedAt: true,
92
+ },
93
+ })
94
+ .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 handleGet(argv, prompter) {
106
+ try {
107
+ const answers = await prompter.prompt(argv, [
108
+ {
109
+ type: 'text',
110
+ name: 'id',
111
+ message: 'id',
112
+ required: true,
113
+ },
114
+ ]);
115
+ const client = (0, executor_1.getClient)();
116
+ const result = await client.embeddingChunk
117
+ .findOne({
118
+ id: answers.id,
119
+ select: {
120
+ id: true,
121
+ databaseId: true,
122
+ tableId: true,
123
+ embeddingFieldId: true,
124
+ chunksTableId: true,
125
+ chunksTableName: true,
126
+ contentFieldName: true,
127
+ dimensions: true,
128
+ metric: true,
129
+ chunkSize: true,
130
+ chunkOverlap: true,
131
+ chunkStrategy: true,
132
+ metadataFields: true,
133
+ enqueueChunkingJob: true,
134
+ chunkingTaskName: true,
135
+ parentFkFieldId: true,
136
+ createdAt: true,
137
+ updatedAt: true,
138
+ },
139
+ })
140
+ .execute();
141
+ console.log(JSON.stringify(result, null, 2));
142
+ }
143
+ catch (error) {
144
+ console.error('Record not found.');
145
+ if (error instanceof Error) {
146
+ console.error(error.message);
147
+ }
148
+ process.exit(1);
149
+ }
150
+ }
151
+ async function handleCreate(argv, prompter) {
152
+ try {
153
+ const rawAnswers = await prompter.prompt(argv, [
154
+ {
155
+ type: 'text',
156
+ name: 'databaseId',
157
+ message: 'databaseId',
158
+ required: false,
159
+ skipPrompt: true,
160
+ },
161
+ {
162
+ type: 'text',
163
+ name: 'tableId',
164
+ message: 'tableId',
165
+ required: true,
166
+ },
167
+ {
168
+ type: 'text',
169
+ name: 'embeddingFieldId',
170
+ message: 'embeddingFieldId',
171
+ required: false,
172
+ skipPrompt: true,
173
+ },
174
+ {
175
+ type: 'text',
176
+ name: 'chunksTableId',
177
+ message: 'chunksTableId',
178
+ required: false,
179
+ skipPrompt: true,
180
+ },
181
+ {
182
+ type: 'text',
183
+ name: 'chunksTableName',
184
+ message: 'chunksTableName',
185
+ required: false,
186
+ skipPrompt: true,
187
+ },
188
+ {
189
+ type: 'text',
190
+ name: 'contentFieldName',
191
+ message: 'contentFieldName',
192
+ required: false,
193
+ skipPrompt: true,
194
+ },
195
+ {
196
+ type: 'text',
197
+ name: 'dimensions',
198
+ message: 'dimensions',
199
+ required: false,
200
+ skipPrompt: true,
201
+ },
202
+ {
203
+ type: 'text',
204
+ name: 'metric',
205
+ message: 'metric',
206
+ required: false,
207
+ skipPrompt: true,
208
+ },
209
+ {
210
+ type: 'text',
211
+ name: 'chunkSize',
212
+ message: 'chunkSize',
213
+ required: false,
214
+ skipPrompt: true,
215
+ },
216
+ {
217
+ type: 'text',
218
+ name: 'chunkOverlap',
219
+ message: 'chunkOverlap',
220
+ required: false,
221
+ skipPrompt: true,
222
+ },
223
+ {
224
+ type: 'text',
225
+ name: 'chunkStrategy',
226
+ message: 'chunkStrategy',
227
+ required: false,
228
+ skipPrompt: true,
229
+ },
230
+ {
231
+ type: 'json',
232
+ name: 'metadataFields',
233
+ message: 'metadataFields',
234
+ required: false,
235
+ skipPrompt: true,
236
+ },
237
+ {
238
+ type: 'boolean',
239
+ name: 'enqueueChunkingJob',
240
+ message: 'enqueueChunkingJob',
241
+ required: false,
242
+ skipPrompt: true,
243
+ },
244
+ {
245
+ type: 'text',
246
+ name: 'chunkingTaskName',
247
+ message: 'chunkingTaskName',
248
+ required: false,
249
+ skipPrompt: true,
250
+ },
251
+ {
252
+ type: 'text',
253
+ name: 'parentFkFieldId',
254
+ message: 'parentFkFieldId',
255
+ required: false,
256
+ skipPrompt: true,
257
+ },
258
+ ]);
259
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
260
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
261
+ const client = (0, executor_1.getClient)();
262
+ const result = await client.embeddingChunk
263
+ .create({
264
+ data: {
265
+ databaseId: cleanedData.databaseId,
266
+ tableId: cleanedData.tableId,
267
+ embeddingFieldId: cleanedData.embeddingFieldId,
268
+ chunksTableId: cleanedData.chunksTableId,
269
+ chunksTableName: cleanedData.chunksTableName,
270
+ contentFieldName: cleanedData.contentFieldName,
271
+ dimensions: cleanedData.dimensions,
272
+ metric: cleanedData.metric,
273
+ chunkSize: cleanedData.chunkSize,
274
+ chunkOverlap: cleanedData.chunkOverlap,
275
+ chunkStrategy: cleanedData.chunkStrategy,
276
+ metadataFields: cleanedData.metadataFields,
277
+ enqueueChunkingJob: cleanedData.enqueueChunkingJob,
278
+ chunkingTaskName: cleanedData.chunkingTaskName,
279
+ parentFkFieldId: cleanedData.parentFkFieldId,
280
+ },
281
+ select: {
282
+ id: true,
283
+ databaseId: true,
284
+ tableId: true,
285
+ embeddingFieldId: true,
286
+ chunksTableId: true,
287
+ chunksTableName: true,
288
+ contentFieldName: true,
289
+ dimensions: true,
290
+ metric: true,
291
+ chunkSize: true,
292
+ chunkOverlap: true,
293
+ chunkStrategy: true,
294
+ metadataFields: true,
295
+ enqueueChunkingJob: true,
296
+ chunkingTaskName: true,
297
+ parentFkFieldId: true,
298
+ createdAt: true,
299
+ updatedAt: true,
300
+ },
301
+ })
302
+ .execute();
303
+ console.log(JSON.stringify(result, null, 2));
304
+ }
305
+ catch (error) {
306
+ console.error('Failed to create record.');
307
+ if (error instanceof Error) {
308
+ console.error(error.message);
309
+ }
310
+ process.exit(1);
311
+ }
312
+ }
313
+ async function handleUpdate(argv, prompter) {
314
+ try {
315
+ const rawAnswers = await prompter.prompt(argv, [
316
+ {
317
+ type: 'text',
318
+ name: 'id',
319
+ message: 'id',
320
+ required: true,
321
+ },
322
+ {
323
+ type: 'text',
324
+ name: 'databaseId',
325
+ message: 'databaseId',
326
+ required: false,
327
+ skipPrompt: true,
328
+ },
329
+ {
330
+ type: 'text',
331
+ name: 'tableId',
332
+ message: 'tableId',
333
+ required: false,
334
+ },
335
+ {
336
+ type: 'text',
337
+ name: 'embeddingFieldId',
338
+ message: 'embeddingFieldId',
339
+ required: false,
340
+ skipPrompt: true,
341
+ },
342
+ {
343
+ type: 'text',
344
+ name: 'chunksTableId',
345
+ message: 'chunksTableId',
346
+ required: false,
347
+ skipPrompt: true,
348
+ },
349
+ {
350
+ type: 'text',
351
+ name: 'chunksTableName',
352
+ message: 'chunksTableName',
353
+ required: false,
354
+ skipPrompt: true,
355
+ },
356
+ {
357
+ type: 'text',
358
+ name: 'contentFieldName',
359
+ message: 'contentFieldName',
360
+ required: false,
361
+ skipPrompt: true,
362
+ },
363
+ {
364
+ type: 'text',
365
+ name: 'dimensions',
366
+ message: 'dimensions',
367
+ required: false,
368
+ skipPrompt: true,
369
+ },
370
+ {
371
+ type: 'text',
372
+ name: 'metric',
373
+ message: 'metric',
374
+ required: false,
375
+ skipPrompt: true,
376
+ },
377
+ {
378
+ type: 'text',
379
+ name: 'chunkSize',
380
+ message: 'chunkSize',
381
+ required: false,
382
+ skipPrompt: true,
383
+ },
384
+ {
385
+ type: 'text',
386
+ name: 'chunkOverlap',
387
+ message: 'chunkOverlap',
388
+ required: false,
389
+ skipPrompt: true,
390
+ },
391
+ {
392
+ type: 'text',
393
+ name: 'chunkStrategy',
394
+ message: 'chunkStrategy',
395
+ required: false,
396
+ skipPrompt: true,
397
+ },
398
+ {
399
+ type: 'json',
400
+ name: 'metadataFields',
401
+ message: 'metadataFields',
402
+ required: false,
403
+ skipPrompt: true,
404
+ },
405
+ {
406
+ type: 'boolean',
407
+ name: 'enqueueChunkingJob',
408
+ message: 'enqueueChunkingJob',
409
+ required: false,
410
+ skipPrompt: true,
411
+ },
412
+ {
413
+ type: 'text',
414
+ name: 'chunkingTaskName',
415
+ message: 'chunkingTaskName',
416
+ required: false,
417
+ skipPrompt: true,
418
+ },
419
+ {
420
+ type: 'text',
421
+ name: 'parentFkFieldId',
422
+ message: 'parentFkFieldId',
423
+ required: false,
424
+ skipPrompt: true,
425
+ },
426
+ ]);
427
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
428
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
429
+ const client = (0, executor_1.getClient)();
430
+ const result = await client.embeddingChunk
431
+ .update({
432
+ where: {
433
+ id: answers.id,
434
+ },
435
+ data: {
436
+ databaseId: cleanedData.databaseId,
437
+ tableId: cleanedData.tableId,
438
+ embeddingFieldId: cleanedData.embeddingFieldId,
439
+ chunksTableId: cleanedData.chunksTableId,
440
+ chunksTableName: cleanedData.chunksTableName,
441
+ contentFieldName: cleanedData.contentFieldName,
442
+ dimensions: cleanedData.dimensions,
443
+ metric: cleanedData.metric,
444
+ chunkSize: cleanedData.chunkSize,
445
+ chunkOverlap: cleanedData.chunkOverlap,
446
+ chunkStrategy: cleanedData.chunkStrategy,
447
+ metadataFields: cleanedData.metadataFields,
448
+ enqueueChunkingJob: cleanedData.enqueueChunkingJob,
449
+ chunkingTaskName: cleanedData.chunkingTaskName,
450
+ parentFkFieldId: cleanedData.parentFkFieldId,
451
+ },
452
+ select: {
453
+ id: true,
454
+ databaseId: true,
455
+ tableId: true,
456
+ embeddingFieldId: true,
457
+ chunksTableId: true,
458
+ chunksTableName: true,
459
+ contentFieldName: true,
460
+ dimensions: true,
461
+ metric: true,
462
+ chunkSize: true,
463
+ chunkOverlap: true,
464
+ chunkStrategy: true,
465
+ metadataFields: true,
466
+ enqueueChunkingJob: true,
467
+ chunkingTaskName: true,
468
+ parentFkFieldId: true,
469
+ createdAt: true,
470
+ updatedAt: true,
471
+ },
472
+ })
473
+ .execute();
474
+ console.log(JSON.stringify(result, null, 2));
475
+ }
476
+ catch (error) {
477
+ console.error('Failed to update record.');
478
+ if (error instanceof Error) {
479
+ console.error(error.message);
480
+ }
481
+ process.exit(1);
482
+ }
483
+ }
484
+ async function handleDelete(argv, prompter) {
485
+ try {
486
+ const rawAnswers = await prompter.prompt(argv, [
487
+ {
488
+ type: 'text',
489
+ name: 'id',
490
+ message: 'id',
491
+ required: true,
492
+ },
493
+ ]);
494
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
495
+ const client = (0, executor_1.getClient)();
496
+ const result = await client.embeddingChunk
497
+ .delete({
498
+ where: {
499
+ id: answers.id,
500
+ },
501
+ select: {
502
+ id: true,
503
+ },
504
+ })
505
+ .execute();
506
+ console.log(JSON.stringify(result, null, 2));
507
+ }
508
+ catch (error) {
509
+ console.error('Failed to delete record.');
510
+ if (error instanceof Error) {
511
+ console.error(error.message);
512
+ }
513
+ process.exit(1);
514
+ }
515
+ }
@@ -14,8 +14,6 @@ const fieldSchema = {
14
14
  schemaId: 'uuid',
15
15
  tableId: 'uuid',
16
16
  tableName: 'string',
17
- tableNameTrgmSimilarity: 'float',
18
- searchScore: 'float',
19
17
  };
20
18
  const usage = '\nencrypted-secrets-module <command>\n\nCommands:\n list List all encryptedSecretsModule records\n get Get a encryptedSecretsModule by ID\n create Create a new encryptedSecretsModule\n update Update an existing encryptedSecretsModule\n delete Delete a encryptedSecretsModule\n\n --help, -h Show this help message\n';
21
19
  exports.default = async (argv, prompter, _options) => {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * CLI commands for Enum
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;