@constructive-sdk/cli 0.12.6 → 0.12.8

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 (333) hide show
  1. package/admin/cli/commands/app-achievement.js +38 -15
  2. package/admin/cli/commands/app-admin-grant.js +38 -15
  3. package/admin/cli/commands/app-grant.js +40 -16
  4. package/admin/cli/commands/app-level-requirement.js +42 -17
  5. package/admin/cli/commands/app-level.js +40 -16
  6. package/admin/cli/commands/app-limit-default.js +32 -12
  7. package/admin/cli/commands/app-limit.js +36 -14
  8. package/admin/cli/commands/app-membership-default.js +40 -16
  9. package/admin/cli/commands/app-membership.js +58 -25
  10. package/admin/cli/commands/app-owner-grant.js +38 -15
  11. package/admin/cli/commands/app-permission-default.js +30 -11
  12. package/admin/cli/commands/app-permission.js +36 -14
  13. package/admin/cli/commands/app-step.js +38 -15
  14. package/admin/cli/commands/claimed-invite.js +38 -15
  15. package/admin/cli/commands/invite.js +50 -21
  16. package/admin/cli/commands/membership-type.js +34 -13
  17. package/admin/cli/commands/org-admin-grant.js +40 -16
  18. package/admin/cli/commands/org-chart-edge-grant.js +44 -18
  19. package/admin/cli/commands/org-chart-edge.js +42 -17
  20. package/admin/cli/commands/org-claimed-invite.js +40 -16
  21. package/admin/cli/commands/org-get-managers-record.js +30 -11
  22. package/admin/cli/commands/org-get-subordinates-record.js +30 -11
  23. package/admin/cli/commands/org-grant.js +42 -17
  24. package/admin/cli/commands/org-invite.js +54 -23
  25. package/admin/cli/commands/org-limit-default.js +32 -12
  26. package/admin/cli/commands/org-limit.js +38 -15
  27. package/admin/cli/commands/org-member.js +34 -13
  28. package/admin/cli/commands/org-membership-default.js +44 -18
  29. package/admin/cli/commands/org-membership.js +58 -25
  30. package/admin/cli/commands/org-owner-grant.js +40 -16
  31. package/admin/cli/commands/org-permission-default.js +32 -12
  32. package/admin/cli/commands/org-permission.js +36 -14
  33. package/admin/cli/utils.d.ts +38 -0
  34. package/admin/cli/utils.js +96 -0
  35. package/auth/cli/commands/audit-log.js +42 -17
  36. package/auth/cli/commands/connected-account.js +42 -17
  37. package/auth/cli/commands/crypto-address.js +40 -16
  38. package/auth/cli/commands/email.js +40 -16
  39. package/auth/cli/commands/phone-number.js +42 -17
  40. package/auth/cli/commands/role-type.js +30 -11
  41. package/auth/cli/commands/user.js +80 -16
  42. package/auth/cli/utils.d.ts +38 -0
  43. package/auth/cli/utils.js +96 -0
  44. package/esm/admin/cli/commands/app-achievement.js +39 -16
  45. package/esm/admin/cli/commands/app-admin-grant.js +39 -16
  46. package/esm/admin/cli/commands/app-grant.js +41 -17
  47. package/esm/admin/cli/commands/app-level-requirement.js +43 -18
  48. package/esm/admin/cli/commands/app-level.js +41 -17
  49. package/esm/admin/cli/commands/app-limit-default.js +33 -13
  50. package/esm/admin/cli/commands/app-limit.js +37 -15
  51. package/esm/admin/cli/commands/app-membership-default.js +41 -17
  52. package/esm/admin/cli/commands/app-membership.js +59 -26
  53. package/esm/admin/cli/commands/app-owner-grant.js +39 -16
  54. package/esm/admin/cli/commands/app-permission-default.js +31 -12
  55. package/esm/admin/cli/commands/app-permission.js +37 -15
  56. package/esm/admin/cli/commands/app-step.js +39 -16
  57. package/esm/admin/cli/commands/claimed-invite.js +39 -16
  58. package/esm/admin/cli/commands/invite.js +51 -22
  59. package/esm/admin/cli/commands/membership-type.js +35 -14
  60. package/esm/admin/cli/commands/org-admin-grant.js +41 -17
  61. package/esm/admin/cli/commands/org-chart-edge-grant.js +45 -19
  62. package/esm/admin/cli/commands/org-chart-edge.js +43 -18
  63. package/esm/admin/cli/commands/org-claimed-invite.js +41 -17
  64. package/esm/admin/cli/commands/org-get-managers-record.js +31 -12
  65. package/esm/admin/cli/commands/org-get-subordinates-record.js +31 -12
  66. package/esm/admin/cli/commands/org-grant.js +43 -18
  67. package/esm/admin/cli/commands/org-invite.js +55 -24
  68. package/esm/admin/cli/commands/org-limit-default.js +33 -13
  69. package/esm/admin/cli/commands/org-limit.js +39 -16
  70. package/esm/admin/cli/commands/org-member.js +35 -14
  71. package/esm/admin/cli/commands/org-membership-default.js +45 -19
  72. package/esm/admin/cli/commands/org-membership.js +59 -26
  73. package/esm/admin/cli/commands/org-owner-grant.js +41 -17
  74. package/esm/admin/cli/commands/org-permission-default.js +33 -13
  75. package/esm/admin/cli/commands/org-permission.js +37 -15
  76. package/esm/admin/cli/utils.d.ts +38 -0
  77. package/esm/admin/cli/utils.js +90 -0
  78. package/esm/auth/cli/commands/audit-log.js +43 -18
  79. package/esm/auth/cli/commands/connected-account.js +43 -18
  80. package/esm/auth/cli/commands/crypto-address.js +41 -17
  81. package/esm/auth/cli/commands/email.js +41 -17
  82. package/esm/auth/cli/commands/phone-number.js +43 -18
  83. package/esm/auth/cli/commands/role-type.js +31 -12
  84. package/esm/auth/cli/commands/user.js +81 -17
  85. package/esm/auth/cli/utils.d.ts +38 -0
  86. package/esm/auth/cli/utils.js +90 -0
  87. package/esm/objects/cli/commands/commit.js +45 -19
  88. package/esm/objects/cli/commands/get-all-record.js +31 -12
  89. package/esm/objects/cli/commands/object.js +41 -17
  90. package/esm/objects/cli/commands/ref.js +37 -15
  91. package/esm/objects/cli/commands/store.js +37 -15
  92. package/esm/objects/cli/utils.d.ts +38 -0
  93. package/esm/objects/cli/utils.js +90 -0
  94. package/esm/public/cli/commands/api-module.js +37 -15
  95. package/esm/public/cli/commands/api-schema.js +35 -14
  96. package/esm/public/cli/commands/api.js +41 -17
  97. package/esm/public/cli/commands/app-achievement.js +39 -16
  98. package/esm/public/cli/commands/app-admin-grant.js +39 -16
  99. package/esm/public/cli/commands/app-grant.js +41 -17
  100. package/esm/public/cli/commands/app-level-requirement.js +43 -18
  101. package/esm/public/cli/commands/app-level.js +41 -17
  102. package/esm/public/cli/commands/app-limit-default.js +33 -13
  103. package/esm/public/cli/commands/app-limit.js +37 -15
  104. package/esm/public/cli/commands/app-membership-default.js +41 -17
  105. package/esm/public/cli/commands/app-membership.js +59 -26
  106. package/esm/public/cli/commands/app-owner-grant.js +39 -16
  107. package/esm/public/cli/commands/app-permission-default.js +31 -12
  108. package/esm/public/cli/commands/app-permission.js +37 -15
  109. package/esm/public/cli/commands/app-step.js +39 -16
  110. package/esm/public/cli/commands/app.js +45 -19
  111. package/esm/public/cli/commands/ast-migration.js +53 -23
  112. package/esm/public/cli/commands/audit-log.js +43 -18
  113. package/esm/public/cli/commands/blueprint-template.js +67 -30
  114. package/esm/public/cli/commands/blueprint.js +61 -27
  115. package/esm/public/cli/commands/check-constraint.js +55 -24
  116. package/esm/public/cli/commands/claimed-invite.js +39 -16
  117. package/esm/public/cli/commands/commit.js +45 -19
  118. package/esm/public/cli/commands/connected-account.js +43 -18
  119. package/esm/public/cli/commands/connected-accounts-module.js +41 -17
  120. package/esm/public/cli/commands/crypto-address.js +41 -17
  121. package/esm/public/cli/commands/crypto-addresses-module.js +43 -18
  122. package/esm/public/cli/commands/crypto-auth-module.js +55 -24
  123. package/esm/public/cli/commands/database-provision-module.js +55 -24
  124. package/esm/public/cli/commands/database-transfer.js +55 -24
  125. package/esm/public/cli/commands/database.js +43 -18
  126. package/esm/public/cli/commands/default-ids-module.js +31 -12
  127. package/esm/public/cli/commands/default-privilege.js +41 -17
  128. package/esm/public/cli/commands/denormalized-table-field.js +51 -22
  129. package/esm/public/cli/commands/domain.js +39 -16
  130. package/esm/public/cli/commands/email.js +41 -17
  131. package/esm/public/cli/commands/emails-module.js +41 -17
  132. package/esm/public/cli/commands/embedding-chunk.js +63 -28
  133. package/esm/public/cli/commands/encrypted-secrets-module.js +37 -15
  134. package/esm/public/cli/commands/enum.js +51 -22
  135. package/esm/public/cli/commands/field.js +75 -34
  136. package/esm/public/cli/commands/foreign-key-constraint.js +63 -28
  137. package/esm/public/cli/commands/full-text-search.js +45 -19
  138. package/esm/public/cli/commands/get-all-record.js +31 -12
  139. package/esm/public/cli/commands/hierarchy-module.js +67 -30
  140. package/esm/public/cli/commands/index.js +65 -29
  141. package/esm/public/cli/commands/invite.js +51 -22
  142. package/esm/public/cli/commands/invites-module.js +55 -24
  143. package/esm/public/cli/commands/levels-module.js +79 -36
  144. package/esm/public/cli/commands/limits-module.js +63 -28
  145. package/esm/public/cli/commands/membership-type.js +35 -14
  146. package/esm/public/cli/commands/membership-types-module.js +37 -15
  147. package/esm/public/cli/commands/memberships-module.js +89 -41
  148. package/esm/public/cli/commands/migrate-file.js +33 -13
  149. package/esm/public/cli/commands/node-type-registry.js +89 -19
  150. package/esm/public/cli/commands/object.js +41 -17
  151. package/esm/public/cli/commands/org-admin-grant.js +41 -17
  152. package/esm/public/cli/commands/org-chart-edge-grant.js +45 -19
  153. package/esm/public/cli/commands/org-chart-edge.js +43 -18
  154. package/esm/public/cli/commands/org-claimed-invite.js +41 -17
  155. package/esm/public/cli/commands/org-get-managers-record.js +31 -12
  156. package/esm/public/cli/commands/org-get-subordinates-record.js +31 -12
  157. package/esm/public/cli/commands/org-grant.js +43 -18
  158. package/esm/public/cli/commands/org-invite.js +55 -24
  159. package/esm/public/cli/commands/org-limit-default.js +33 -13
  160. package/esm/public/cli/commands/org-limit.js +39 -16
  161. package/esm/public/cli/commands/org-member.js +35 -14
  162. package/esm/public/cli/commands/org-membership-default.js +45 -19
  163. package/esm/public/cli/commands/org-membership.js +59 -26
  164. package/esm/public/cli/commands/org-owner-grant.js +41 -17
  165. package/esm/public/cli/commands/org-permission-default.js +33 -13
  166. package/esm/public/cli/commands/org-permission.js +37 -15
  167. package/esm/public/cli/commands/permissions-module.js +61 -27
  168. package/esm/public/cli/commands/phone-number.js +43 -18
  169. package/esm/public/cli/commands/phone-numbers-module.js +41 -17
  170. package/esm/public/cli/commands/policy.js +61 -27
  171. package/esm/public/cli/commands/primary-key-constraint.js +53 -23
  172. package/esm/public/cli/commands/profiles-module.js +63 -28
  173. package/esm/public/cli/commands/ref.js +37 -15
  174. package/esm/public/cli/commands/relation-provision.js +89 -41
  175. package/esm/public/cli/commands/rls-module.js +49 -21
  176. package/esm/public/cli/commands/role-type.js +31 -12
  177. package/esm/public/cli/commands/schema-grant.js +39 -16
  178. package/esm/public/cli/commands/schema.js +55 -24
  179. package/esm/public/cli/commands/secrets-module.js +37 -15
  180. package/esm/public/cli/commands/secure-table-provision.js +63 -28
  181. package/esm/public/cli/commands/sessions-module.js +49 -21
  182. package/esm/public/cli/commands/site-metadatum.js +39 -16
  183. package/esm/public/cli/commands/site-module.js +37 -15
  184. package/esm/public/cli/commands/site-theme.js +35 -14
  185. package/esm/public/cli/commands/site.js +45 -19
  186. package/esm/public/cli/commands/sql-action.js +53 -23
  187. package/esm/public/cli/commands/store.js +37 -15
  188. package/esm/public/cli/commands/table-grant.js +45 -19
  189. package/esm/public/cli/commands/table-template-module.js +45 -19
  190. package/esm/public/cli/commands/table.js +65 -29
  191. package/esm/public/cli/commands/trigger-function.js +39 -16
  192. package/esm/public/cli/commands/trigger.js +53 -23
  193. package/esm/public/cli/commands/unique-constraint.js +55 -24
  194. package/esm/public/cli/commands/user-auth-module.js +79 -36
  195. package/esm/public/cli/commands/user.js +81 -17
  196. package/esm/public/cli/commands/users-module.js +41 -17
  197. package/esm/public/cli/commands/view-grant.js +41 -17
  198. package/esm/public/cli/commands/view-rule.js +39 -16
  199. package/esm/public/cli/commands/view-table.js +35 -14
  200. package/esm/public/cli/commands/view.js +59 -26
  201. package/esm/public/cli/commands.js +3 -3
  202. package/esm/public/cli/executor.d.ts +1 -1
  203. package/esm/public/cli/utils.d.ts +38 -0
  204. package/esm/public/cli/utils.js +90 -0
  205. package/esm/public/orm/index.d.ts +2 -2
  206. package/esm/public/orm/index.js +2 -2
  207. package/esm/public/orm/input-types.d.ts +161 -147
  208. package/esm/public/orm/models/index.d.ts +1 -1
  209. package/esm/public/orm/models/index.js +1 -1
  210. package/objects/cli/commands/commit.js +44 -18
  211. package/objects/cli/commands/get-all-record.js +30 -11
  212. package/objects/cli/commands/object.js +40 -16
  213. package/objects/cli/commands/ref.js +36 -14
  214. package/objects/cli/commands/store.js +36 -14
  215. package/objects/cli/utils.d.ts +38 -0
  216. package/objects/cli/utils.js +96 -0
  217. package/package.json +7 -7
  218. package/public/cli/commands/api-module.js +36 -14
  219. package/public/cli/commands/api-schema.js +34 -13
  220. package/public/cli/commands/api.js +40 -16
  221. package/public/cli/commands/app-achievement.js +38 -15
  222. package/public/cli/commands/app-admin-grant.js +38 -15
  223. package/public/cli/commands/app-grant.js +40 -16
  224. package/public/cli/commands/app-level-requirement.js +42 -17
  225. package/public/cli/commands/app-level.js +40 -16
  226. package/public/cli/commands/app-limit-default.js +32 -12
  227. package/public/cli/commands/app-limit.js +36 -14
  228. package/public/cli/commands/app-membership-default.js +40 -16
  229. package/public/cli/commands/app-membership.js +58 -25
  230. package/public/cli/commands/app-owner-grant.js +38 -15
  231. package/public/cli/commands/app-permission-default.js +30 -11
  232. package/public/cli/commands/app-permission.js +36 -14
  233. package/public/cli/commands/app-step.js +38 -15
  234. package/public/cli/commands/app.js +44 -18
  235. package/public/cli/commands/ast-migration.js +52 -22
  236. package/public/cli/commands/audit-log.js +42 -17
  237. package/public/cli/commands/blueprint-template.js +66 -29
  238. package/public/cli/commands/blueprint.js +60 -26
  239. package/public/cli/commands/check-constraint.js +54 -23
  240. package/public/cli/commands/claimed-invite.js +38 -15
  241. package/public/cli/commands/commit.js +44 -18
  242. package/public/cli/commands/connected-account.js +42 -17
  243. package/public/cli/commands/connected-accounts-module.js +40 -16
  244. package/public/cli/commands/crypto-address.js +40 -16
  245. package/public/cli/commands/crypto-addresses-module.js +42 -17
  246. package/public/cli/commands/crypto-auth-module.js +54 -23
  247. package/public/cli/commands/database-provision-module.js +54 -23
  248. package/public/cli/commands/database-transfer.js +54 -23
  249. package/public/cli/commands/database.js +42 -17
  250. package/public/cli/commands/default-ids-module.js +30 -11
  251. package/public/cli/commands/default-privilege.js +40 -16
  252. package/public/cli/commands/denormalized-table-field.js +50 -21
  253. package/public/cli/commands/domain.js +38 -15
  254. package/public/cli/commands/email.js +40 -16
  255. package/public/cli/commands/emails-module.js +40 -16
  256. package/public/cli/commands/embedding-chunk.js +62 -27
  257. package/public/cli/commands/encrypted-secrets-module.js +36 -14
  258. package/public/cli/commands/enum.js +50 -21
  259. package/public/cli/commands/field.js +74 -33
  260. package/public/cli/commands/foreign-key-constraint.js +62 -27
  261. package/public/cli/commands/full-text-search.js +44 -18
  262. package/public/cli/commands/get-all-record.js +30 -11
  263. package/public/cli/commands/hierarchy-module.js +66 -29
  264. package/public/cli/commands/index.js +64 -28
  265. package/public/cli/commands/invite.js +50 -21
  266. package/public/cli/commands/invites-module.js +54 -23
  267. package/public/cli/commands/levels-module.js +78 -35
  268. package/public/cli/commands/limits-module.js +62 -27
  269. package/public/cli/commands/membership-type.js +34 -13
  270. package/public/cli/commands/membership-types-module.js +36 -14
  271. package/public/cli/commands/memberships-module.js +88 -40
  272. package/public/cli/commands/migrate-file.js +32 -12
  273. package/public/cli/commands/node-type-registry.js +88 -18
  274. package/public/cli/commands/object.js +40 -16
  275. package/public/cli/commands/org-admin-grant.js +40 -16
  276. package/public/cli/commands/org-chart-edge-grant.js +44 -18
  277. package/public/cli/commands/org-chart-edge.js +42 -17
  278. package/public/cli/commands/org-claimed-invite.js +40 -16
  279. package/public/cli/commands/org-get-managers-record.js +30 -11
  280. package/public/cli/commands/org-get-subordinates-record.js +30 -11
  281. package/public/cli/commands/org-grant.js +42 -17
  282. package/public/cli/commands/org-invite.js +54 -23
  283. package/public/cli/commands/org-limit-default.js +32 -12
  284. package/public/cli/commands/org-limit.js +38 -15
  285. package/public/cli/commands/org-member.js +34 -13
  286. package/public/cli/commands/org-membership-default.js +44 -18
  287. package/public/cli/commands/org-membership.js +58 -25
  288. package/public/cli/commands/org-owner-grant.js +40 -16
  289. package/public/cli/commands/org-permission-default.js +32 -12
  290. package/public/cli/commands/org-permission.js +36 -14
  291. package/public/cli/commands/permissions-module.js +60 -26
  292. package/public/cli/commands/phone-number.js +42 -17
  293. package/public/cli/commands/phone-numbers-module.js +40 -16
  294. package/public/cli/commands/policy.js +60 -26
  295. package/public/cli/commands/primary-key-constraint.js +52 -22
  296. package/public/cli/commands/profiles-module.js +62 -27
  297. package/public/cli/commands/ref.js +36 -14
  298. package/public/cli/commands/relation-provision.js +88 -40
  299. package/public/cli/commands/rls-module.js +48 -20
  300. package/public/cli/commands/role-type.js +30 -11
  301. package/public/cli/commands/schema-grant.js +38 -15
  302. package/public/cli/commands/schema.js +54 -23
  303. package/public/cli/commands/secrets-module.js +36 -14
  304. package/public/cli/commands/secure-table-provision.js +62 -27
  305. package/public/cli/commands/sessions-module.js +48 -20
  306. package/public/cli/commands/site-metadatum.js +38 -15
  307. package/public/cli/commands/site-module.js +36 -14
  308. package/public/cli/commands/site-theme.js +34 -13
  309. package/public/cli/commands/site.js +44 -18
  310. package/public/cli/commands/sql-action.js +52 -22
  311. package/public/cli/commands/store.js +36 -14
  312. package/public/cli/commands/table-grant.js +44 -18
  313. package/public/cli/commands/table-template-module.js +44 -18
  314. package/public/cli/commands/table.js +64 -28
  315. package/public/cli/commands/trigger-function.js +38 -15
  316. package/public/cli/commands/trigger.js +52 -22
  317. package/public/cli/commands/unique-constraint.js +54 -23
  318. package/public/cli/commands/user-auth-module.js +78 -35
  319. package/public/cli/commands/user.js +80 -16
  320. package/public/cli/commands/users-module.js +40 -16
  321. package/public/cli/commands/view-grant.js +40 -16
  322. package/public/cli/commands/view-rule.js +38 -15
  323. package/public/cli/commands/view-table.js +34 -13
  324. package/public/cli/commands/view.js +58 -25
  325. package/public/cli/commands.js +3 -3
  326. package/public/cli/executor.d.ts +1 -1
  327. package/public/cli/utils.d.ts +38 -0
  328. package/public/cli/utils.js +96 -0
  329. package/public/orm/index.d.ts +2 -2
  330. package/public/orm/index.js +2 -2
  331. package/public/orm/input-types.d.ts +161 -147
  332. package/public/orm/models/index.d.ts +1 -1
  333. package/public/orm/models/index.js +4 -4
@@ -15,7 +15,7 @@ const fieldSchema = {
15
15
  storeId: 'uuid',
16
16
  commitId: 'uuid',
17
17
  };
18
- const usage = '\nref <command>\n\nCommands:\n list List all ref records\n get Get a ref by ID\n create Create a new ref\n update Update an existing ref\n delete Delete a ref\n\n --help, -h Show this help message\n';
18
+ const usage = '\nref <command>\n\nCommands:\n list List ref records\n find-first Find first matching ref record\n get Get a ref by ID\n create Create a new ref\n update Update an existing ref\n delete Delete a ref\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
19
19
  exports.default = async (argv, prompter, _options) => {
20
20
  if (argv.help || argv.h) {
21
21
  console.log(usage);
@@ -28,7 +28,7 @@ exports.default = async (argv, prompter, _options) => {
28
28
  type: 'autocomplete',
29
29
  name: 'subcommand',
30
30
  message: 'What do you want to do?',
31
- options: ['list', 'get', 'create', 'update', 'delete'],
31
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
32
32
  },
33
33
  ]);
34
34
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -39,6 +39,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
39
39
  switch (subcommand) {
40
40
  case 'list':
41
41
  return handleList(argv, prompter);
42
+ case 'find-first':
43
+ return handleFindFirst(argv, prompter);
42
44
  case 'get':
43
45
  return handleGet(argv, prompter);
44
46
  case 'create':
@@ -52,20 +54,18 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
52
54
  process.exit(1);
53
55
  }
54
56
  }
55
- async function handleList(_argv, _prompter) {
57
+ async function handleList(argv, _prompter) {
56
58
  try {
59
+ const defaultSelect = {
60
+ id: true,
61
+ name: true,
62
+ databaseId: true,
63
+ storeId: true,
64
+ commitId: true,
65
+ };
66
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
57
67
  const client = (0, executor_1.getClient)();
58
- const result = await client.ref
59
- .findMany({
60
- select: {
61
- id: true,
62
- name: true,
63
- databaseId: true,
64
- storeId: true,
65
- commitId: true,
66
- },
67
- })
68
- .execute();
68
+ const result = await client.ref.findMany(findManyArgs).execute();
69
69
  console.log(JSON.stringify(result, null, 2));
70
70
  }
71
71
  catch (error) {
@@ -76,6 +76,28 @@ async function handleList(_argv, _prompter) {
76
76
  process.exit(1);
77
77
  }
78
78
  }
79
+ async function handleFindFirst(argv, _prompter) {
80
+ try {
81
+ const defaultSelect = {
82
+ id: true,
83
+ name: true,
84
+ databaseId: true,
85
+ storeId: true,
86
+ commitId: true,
87
+ };
88
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
89
+ const client = (0, executor_1.getClient)();
90
+ const result = await client.ref.findFirst(findFirstArgs).execute();
91
+ console.log(JSON.stringify(result, null, 2));
92
+ }
93
+ catch (error) {
94
+ console.error('Failed to find record.');
95
+ if (error instanceof Error) {
96
+ console.error(error.message);
97
+ }
98
+ process.exit(1);
99
+ }
100
+ }
79
101
  async function handleGet(argv, prompter) {
80
102
  try {
81
103
  const answers = await prompter.prompt(argv, [
@@ -41,7 +41,7 @@ const fieldSchema = {
41
41
  outSourceFieldId: 'uuid',
42
42
  outTargetFieldId: 'uuid',
43
43
  };
44
- const usage = '\nrelation-provision <command>\n\nCommands:\n list List all relationProvision records\n get Get a relationProvision by ID\n create Create a new relationProvision\n update Update an existing relationProvision\n delete Delete a relationProvision\n\n --help, -h Show this help message\n';
44
+ const usage = '\nrelation-provision <command>\n\nCommands:\n list List relationProvision records\n find-first Find first matching relationProvision record\n get Get a relationProvision by ID\n create Create a new relationProvision\n update Update an existing relationProvision\n delete Delete a relationProvision\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
45
45
  exports.default = async (argv, prompter, _options) => {
46
46
  if (argv.help || argv.h) {
47
47
  console.log(usage);
@@ -54,7 +54,7 @@ exports.default = async (argv, prompter, _options) => {
54
54
  type: 'autocomplete',
55
55
  name: 'subcommand',
56
56
  message: 'What do you want to do?',
57
- options: ['list', 'get', 'create', 'update', 'delete'],
57
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
58
58
  },
59
59
  ]);
60
60
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -65,6 +65,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
65
65
  switch (subcommand) {
66
66
  case 'list':
67
67
  return handleList(argv, prompter);
68
+ case 'find-first':
69
+ return handleFindFirst(argv, prompter);
68
70
  case 'get':
69
71
  return handleGet(argv, prompter);
70
72
  case 'create':
@@ -78,46 +80,44 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
78
80
  process.exit(1);
79
81
  }
80
82
  }
81
- async function handleList(_argv, _prompter) {
83
+ async function handleList(argv, _prompter) {
82
84
  try {
85
+ const defaultSelect = {
86
+ id: true,
87
+ databaseId: true,
88
+ relationType: true,
89
+ sourceTableId: true,
90
+ targetTableId: true,
91
+ fieldName: true,
92
+ deleteAction: true,
93
+ isRequired: true,
94
+ apiRequired: true,
95
+ junctionTableId: true,
96
+ junctionTableName: true,
97
+ junctionSchemaId: true,
98
+ sourceFieldName: true,
99
+ targetFieldName: true,
100
+ useCompositeKey: true,
101
+ createIndex: true,
102
+ exposeInApi: true,
103
+ nodeType: true,
104
+ nodeData: true,
105
+ grantRoles: true,
106
+ grantPrivileges: true,
107
+ policyType: true,
108
+ policyPrivileges: true,
109
+ policyRole: true,
110
+ policyPermissive: true,
111
+ policyName: true,
112
+ policyData: true,
113
+ outFieldId: true,
114
+ outJunctionTableId: true,
115
+ outSourceFieldId: true,
116
+ outTargetFieldId: true,
117
+ };
118
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
83
119
  const client = (0, executor_1.getClient)();
84
- const result = await client.relationProvision
85
- .findMany({
86
- select: {
87
- id: true,
88
- databaseId: true,
89
- relationType: true,
90
- sourceTableId: true,
91
- targetTableId: true,
92
- fieldName: true,
93
- deleteAction: true,
94
- isRequired: true,
95
- apiRequired: true,
96
- junctionTableId: true,
97
- junctionTableName: true,
98
- junctionSchemaId: true,
99
- sourceFieldName: true,
100
- targetFieldName: true,
101
- useCompositeKey: true,
102
- createIndex: true,
103
- exposeInApi: true,
104
- nodeType: true,
105
- nodeData: true,
106
- grantRoles: true,
107
- grantPrivileges: true,
108
- policyType: true,
109
- policyPrivileges: true,
110
- policyRole: true,
111
- policyPermissive: true,
112
- policyName: true,
113
- policyData: true,
114
- outFieldId: true,
115
- outJunctionTableId: true,
116
- outSourceFieldId: true,
117
- outTargetFieldId: true,
118
- },
119
- })
120
- .execute();
120
+ const result = await client.relationProvision.findMany(findManyArgs).execute();
121
121
  console.log(JSON.stringify(result, null, 2));
122
122
  }
123
123
  catch (error) {
@@ -128,6 +128,54 @@ async function handleList(_argv, _prompter) {
128
128
  process.exit(1);
129
129
  }
130
130
  }
131
+ async function handleFindFirst(argv, _prompter) {
132
+ try {
133
+ const defaultSelect = {
134
+ id: true,
135
+ databaseId: true,
136
+ relationType: true,
137
+ sourceTableId: true,
138
+ targetTableId: true,
139
+ fieldName: true,
140
+ deleteAction: true,
141
+ isRequired: true,
142
+ apiRequired: true,
143
+ junctionTableId: true,
144
+ junctionTableName: true,
145
+ junctionSchemaId: true,
146
+ sourceFieldName: true,
147
+ targetFieldName: true,
148
+ useCompositeKey: true,
149
+ createIndex: true,
150
+ exposeInApi: true,
151
+ nodeType: true,
152
+ nodeData: true,
153
+ grantRoles: true,
154
+ grantPrivileges: true,
155
+ policyType: true,
156
+ policyPrivileges: true,
157
+ policyRole: true,
158
+ policyPermissive: true,
159
+ policyName: true,
160
+ policyData: true,
161
+ outFieldId: true,
162
+ outJunctionTableId: true,
163
+ outSourceFieldId: true,
164
+ outTargetFieldId: true,
165
+ };
166
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
167
+ const client = (0, executor_1.getClient)();
168
+ const result = await client.relationProvision.findFirst(findFirstArgs).execute();
169
+ console.log(JSON.stringify(result, null, 2));
170
+ }
171
+ catch (error) {
172
+ console.error('Failed to find record.');
173
+ if (error instanceof Error) {
174
+ console.error(error.message);
175
+ }
176
+ process.exit(1);
177
+ }
178
+ }
131
179
  async function handleGet(argv, prompter) {
132
180
  try {
133
181
  const answers = await prompter.prompt(argv, [
@@ -21,7 +21,7 @@ const fieldSchema = {
21
21
  currentRole: 'string',
22
22
  currentRoleId: 'string',
23
23
  };
24
- const usage = '\nrls-module <command>\n\nCommands:\n list List all rlsModule records\n get Get a rlsModule by ID\n create Create a new rlsModule\n update Update an existing rlsModule\n delete Delete a rlsModule\n\n --help, -h Show this help message\n';
24
+ const usage = '\nrls-module <command>\n\nCommands:\n list List rlsModule records\n find-first Find first matching rlsModule record\n get Get a rlsModule by ID\n create Create a new rlsModule\n update Update an existing rlsModule\n delete Delete a rlsModule\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
25
25
  exports.default = async (argv, prompter, _options) => {
26
26
  if (argv.help || argv.h) {
27
27
  console.log(usage);
@@ -34,7 +34,7 @@ exports.default = async (argv, prompter, _options) => {
34
34
  type: 'autocomplete',
35
35
  name: 'subcommand',
36
36
  message: 'What do you want to do?',
37
- options: ['list', 'get', 'create', 'update', 'delete'],
37
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
38
38
  },
39
39
  ]);
40
40
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -45,6 +45,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
45
45
  switch (subcommand) {
46
46
  case 'list':
47
47
  return handleList(argv, prompter);
48
+ case 'find-first':
49
+ return handleFindFirst(argv, prompter);
48
50
  case 'get':
49
51
  return handleGet(argv, prompter);
50
52
  case 'create':
@@ -58,26 +60,24 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
58
60
  process.exit(1);
59
61
  }
60
62
  }
61
- async function handleList(_argv, _prompter) {
63
+ async function handleList(argv, _prompter) {
62
64
  try {
65
+ const defaultSelect = {
66
+ id: true,
67
+ databaseId: true,
68
+ schemaId: true,
69
+ privateSchemaId: true,
70
+ sessionCredentialsTableId: true,
71
+ sessionsTableId: true,
72
+ usersTableId: true,
73
+ authenticate: true,
74
+ authenticateStrict: true,
75
+ currentRole: true,
76
+ currentRoleId: true,
77
+ };
78
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
63
79
  const client = (0, executor_1.getClient)();
64
- const result = await client.rlsModule
65
- .findMany({
66
- select: {
67
- id: true,
68
- databaseId: true,
69
- schemaId: true,
70
- privateSchemaId: true,
71
- sessionCredentialsTableId: true,
72
- sessionsTableId: true,
73
- usersTableId: true,
74
- authenticate: true,
75
- authenticateStrict: true,
76
- currentRole: true,
77
- currentRoleId: true,
78
- },
79
- })
80
- .execute();
80
+ const result = await client.rlsModule.findMany(findManyArgs).execute();
81
81
  console.log(JSON.stringify(result, null, 2));
82
82
  }
83
83
  catch (error) {
@@ -88,6 +88,34 @@ async function handleList(_argv, _prompter) {
88
88
  process.exit(1);
89
89
  }
90
90
  }
91
+ async function handleFindFirst(argv, _prompter) {
92
+ try {
93
+ const defaultSelect = {
94
+ id: true,
95
+ databaseId: true,
96
+ schemaId: true,
97
+ privateSchemaId: true,
98
+ sessionCredentialsTableId: true,
99
+ sessionsTableId: true,
100
+ usersTableId: true,
101
+ authenticate: true,
102
+ authenticateStrict: true,
103
+ currentRole: true,
104
+ currentRoleId: true,
105
+ };
106
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
107
+ const client = (0, executor_1.getClient)();
108
+ const result = await client.rlsModule.findFirst(findFirstArgs).execute();
109
+ console.log(JSON.stringify(result, null, 2));
110
+ }
111
+ catch (error) {
112
+ console.error('Failed to find record.');
113
+ if (error instanceof Error) {
114
+ console.error(error.message);
115
+ }
116
+ process.exit(1);
117
+ }
118
+ }
91
119
  async function handleGet(argv, prompter) {
92
120
  try {
93
121
  const answers = await prompter.prompt(argv, [
@@ -12,7 +12,7 @@ const fieldSchema = {
12
12
  id: 'int',
13
13
  name: 'string',
14
14
  };
15
- const usage = '\nrole-type <command>\n\nCommands:\n list List all roleType records\n get Get a roleType by ID\n create Create a new roleType\n update Update an existing roleType\n delete Delete a roleType\n\n --help, -h Show this help message\n';
15
+ const usage = '\nrole-type <command>\n\nCommands:\n list List roleType records\n find-first Find first matching roleType record\n get Get a roleType by ID\n create Create a new roleType\n update Update an existing roleType\n delete Delete a roleType\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
16
16
  exports.default = async (argv, prompter, _options) => {
17
17
  if (argv.help || argv.h) {
18
18
  console.log(usage);
@@ -25,7 +25,7 @@ exports.default = async (argv, prompter, _options) => {
25
25
  type: 'autocomplete',
26
26
  name: 'subcommand',
27
27
  message: 'What do you want to do?',
28
- options: ['list', 'get', 'create', 'update', 'delete'],
28
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
29
29
  },
30
30
  ]);
31
31
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -36,6 +36,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
36
36
  switch (subcommand) {
37
37
  case 'list':
38
38
  return handleList(argv, prompter);
39
+ case 'find-first':
40
+ return handleFindFirst(argv, prompter);
39
41
  case 'get':
40
42
  return handleGet(argv, prompter);
41
43
  case 'create':
@@ -49,17 +51,15 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
49
51
  process.exit(1);
50
52
  }
51
53
  }
52
- async function handleList(_argv, _prompter) {
54
+ async function handleList(argv, _prompter) {
53
55
  try {
56
+ const defaultSelect = {
57
+ id: true,
58
+ name: true,
59
+ };
60
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
54
61
  const client = (0, executor_1.getClient)();
55
- const result = await client.roleType
56
- .findMany({
57
- select: {
58
- id: true,
59
- name: true,
60
- },
61
- })
62
- .execute();
62
+ const result = await client.roleType.findMany(findManyArgs).execute();
63
63
  console.log(JSON.stringify(result, null, 2));
64
64
  }
65
65
  catch (error) {
@@ -70,6 +70,25 @@ async function handleList(_argv, _prompter) {
70
70
  process.exit(1);
71
71
  }
72
72
  }
73
+ async function handleFindFirst(argv, _prompter) {
74
+ try {
75
+ const defaultSelect = {
76
+ id: true,
77
+ name: true,
78
+ };
79
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
80
+ const client = (0, executor_1.getClient)();
81
+ const result = await client.roleType.findFirst(findFirstArgs).execute();
82
+ console.log(JSON.stringify(result, null, 2));
83
+ }
84
+ catch (error) {
85
+ console.error('Failed to find record.');
86
+ if (error instanceof Error) {
87
+ console.error(error.message);
88
+ }
89
+ process.exit(1);
90
+ }
91
+ }
73
92
  async function handleGet(argv, prompter) {
74
93
  try {
75
94
  const answers = await prompter.prompt(argv, [
@@ -16,7 +16,7 @@ const fieldSchema = {
16
16
  createdAt: 'string',
17
17
  updatedAt: 'string',
18
18
  };
19
- const usage = '\nschema-grant <command>\n\nCommands:\n list List all schemaGrant records\n get Get a schemaGrant by ID\n create Create a new schemaGrant\n update Update an existing schemaGrant\n delete Delete a schemaGrant\n\n --help, -h Show this help message\n';
19
+ const usage = '\nschema-grant <command>\n\nCommands:\n list List schemaGrant records\n find-first Find first matching schemaGrant record\n get Get a schemaGrant by ID\n create Create a new schemaGrant\n update Update an existing schemaGrant\n delete Delete a schemaGrant\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
20
20
  exports.default = async (argv, prompter, _options) => {
21
21
  if (argv.help || argv.h) {
22
22
  console.log(usage);
@@ -29,7 +29,7 @@ exports.default = async (argv, prompter, _options) => {
29
29
  type: 'autocomplete',
30
30
  name: 'subcommand',
31
31
  message: 'What do you want to do?',
32
- options: ['list', 'get', 'create', 'update', 'delete'],
32
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
33
33
  },
34
34
  ]);
35
35
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -40,6 +40,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
40
40
  switch (subcommand) {
41
41
  case 'list':
42
42
  return handleList(argv, prompter);
43
+ case 'find-first':
44
+ return handleFindFirst(argv, prompter);
43
45
  case 'get':
44
46
  return handleGet(argv, prompter);
45
47
  case 'create':
@@ -53,21 +55,19 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
53
55
  process.exit(1);
54
56
  }
55
57
  }
56
- async function handleList(_argv, _prompter) {
58
+ async function handleList(argv, _prompter) {
57
59
  try {
60
+ const defaultSelect = {
61
+ id: true,
62
+ databaseId: true,
63
+ schemaId: true,
64
+ granteeName: true,
65
+ createdAt: true,
66
+ updatedAt: true,
67
+ };
68
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
58
69
  const client = (0, executor_1.getClient)();
59
- const result = await client.schemaGrant
60
- .findMany({
61
- select: {
62
- id: true,
63
- databaseId: true,
64
- schemaId: true,
65
- granteeName: true,
66
- createdAt: true,
67
- updatedAt: true,
68
- },
69
- })
70
- .execute();
70
+ const result = await client.schemaGrant.findMany(findManyArgs).execute();
71
71
  console.log(JSON.stringify(result, null, 2));
72
72
  }
73
73
  catch (error) {
@@ -78,6 +78,29 @@ async function handleList(_argv, _prompter) {
78
78
  process.exit(1);
79
79
  }
80
80
  }
81
+ async function handleFindFirst(argv, _prompter) {
82
+ try {
83
+ const defaultSelect = {
84
+ id: true,
85
+ databaseId: true,
86
+ schemaId: true,
87
+ granteeName: true,
88
+ createdAt: true,
89
+ updatedAt: true,
90
+ };
91
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
92
+ const client = (0, executor_1.getClient)();
93
+ const result = await client.schemaGrant.findFirst(findFirstArgs).execute();
94
+ console.log(JSON.stringify(result, null, 2));
95
+ }
96
+ catch (error) {
97
+ console.error('Failed to find record.');
98
+ if (error instanceof Error) {
99
+ console.error(error.message);
100
+ }
101
+ process.exit(1);
102
+ }
103
+ }
81
104
  async function handleGet(argv, prompter) {
82
105
  try {
83
106
  const answers = await prompter.prompt(argv, [
@@ -24,7 +24,7 @@ const fieldSchema = {
24
24
  createdAt: 'string',
25
25
  updatedAt: 'string',
26
26
  };
27
- const usage = '\nschema <command>\n\nCommands:\n list List all schema records\n get Get a schema by ID\n create Create a new schema\n update Update an existing schema\n delete Delete a schema\n\n --help, -h Show this help message\n';
27
+ const usage = '\nschema <command>\n\nCommands:\n list List schema records\n find-first Find first matching schema record\n get Get a schema by ID\n create Create a new schema\n update Update an existing schema\n delete Delete a schema\n\nList Options:\n --limit <n> Max number of records to return (forward pagination)\n --last <n> Number of records from the end (backward pagination)\n --after <cursor> Cursor for forward pagination\n --before <cursor> Cursor for backward pagination\n --offset <n> Number of records to skip\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.<f>.<op> Condition filter (dot-notation)\n --orderBy <values> Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select <fields> Comma-separated list of fields to return\n --where.<field>.<op> Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.<f>.<op> Condition filter (dot-notation)\n\n --help, -h Show this help message\n';
28
28
  exports.default = async (argv, prompter, _options) => {
29
29
  if (argv.help || argv.h) {
30
30
  console.log(usage);
@@ -37,7 +37,7 @@ exports.default = async (argv, prompter, _options) => {
37
37
  type: 'autocomplete',
38
38
  name: 'subcommand',
39
39
  message: 'What do you want to do?',
40
- options: ['list', 'get', 'create', 'update', 'delete'],
40
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
41
41
  },
42
42
  ]);
43
43
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -48,6 +48,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
48
48
  switch (subcommand) {
49
49
  case 'list':
50
50
  return handleList(argv, prompter);
51
+ case 'find-first':
52
+ return handleFindFirst(argv, prompter);
51
53
  case 'get':
52
54
  return handleGet(argv, prompter);
53
55
  case 'create':
@@ -61,29 +63,27 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
61
63
  process.exit(1);
62
64
  }
63
65
  }
64
- async function handleList(_argv, _prompter) {
66
+ async function handleList(argv, _prompter) {
65
67
  try {
68
+ const defaultSelect = {
69
+ id: true,
70
+ databaseId: true,
71
+ name: true,
72
+ schemaName: true,
73
+ label: true,
74
+ description: true,
75
+ smartTags: true,
76
+ category: true,
77
+ module: true,
78
+ scope: true,
79
+ tags: true,
80
+ isPublic: true,
81
+ createdAt: true,
82
+ updatedAt: true,
83
+ };
84
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
66
85
  const client = (0, executor_1.getClient)();
67
- const result = await client.schema
68
- .findMany({
69
- select: {
70
- id: true,
71
- databaseId: true,
72
- name: true,
73
- schemaName: true,
74
- label: true,
75
- description: true,
76
- smartTags: true,
77
- category: true,
78
- module: true,
79
- scope: true,
80
- tags: true,
81
- isPublic: true,
82
- createdAt: true,
83
- updatedAt: true,
84
- },
85
- })
86
- .execute();
86
+ const result = await client.schema.findMany(findManyArgs).execute();
87
87
  console.log(JSON.stringify(result, null, 2));
88
88
  }
89
89
  catch (error) {
@@ -94,6 +94,37 @@ async function handleList(_argv, _prompter) {
94
94
  process.exit(1);
95
95
  }
96
96
  }
97
+ async function handleFindFirst(argv, _prompter) {
98
+ try {
99
+ const defaultSelect = {
100
+ id: true,
101
+ databaseId: true,
102
+ name: true,
103
+ schemaName: true,
104
+ label: true,
105
+ description: true,
106
+ smartTags: true,
107
+ category: true,
108
+ module: true,
109
+ scope: true,
110
+ tags: true,
111
+ isPublic: true,
112
+ createdAt: true,
113
+ updatedAt: true,
114
+ };
115
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
116
+ const client = (0, executor_1.getClient)();
117
+ const result = await client.schema.findFirst(findFirstArgs).execute();
118
+ console.log(JSON.stringify(result, null, 2));
119
+ }
120
+ catch (error) {
121
+ console.error('Failed to find record.');
122
+ if (error instanceof Error) {
123
+ console.error(error.message);
124
+ }
125
+ process.exit(1);
126
+ }
127
+ }
97
128
  async function handleGet(argv, prompter) {
98
129
  try {
99
130
  const answers = await prompter.prompt(argv, [