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