@constructive-sdk/cli 0.12.7 → 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 +3 -3
  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
@@ -19,7 +19,7 @@ const fieldSchema = {
19
19
  appIdPrefix: 'string',
20
20
  playStoreLink: 'string',
21
21
  };
22
- const usage = '\napp <command>\n\nCommands:\n list List all app records\n get Get a app by ID\n create Create a new app\n update Update an existing app\n delete Delete a app\n\n --help, -h Show this help message\n';
22
+ const usage = '\napp <command>\n\nCommands:\n list List app records\n find-first Find first matching app record\n get Get a app by ID\n create Create a new app\n update Update an existing app\n delete Delete a app\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';
23
23
  exports.default = async (argv, prompter, _options) => {
24
24
  if (argv.help || argv.h) {
25
25
  console.log(usage);
@@ -32,7 +32,7 @@ exports.default = async (argv, prompter, _options) => {
32
32
  type: 'autocomplete',
33
33
  name: 'subcommand',
34
34
  message: 'What do you want to do?',
35
- options: ['list', 'get', 'create', 'update', 'delete'],
35
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
36
36
  },
37
37
  ]);
38
38
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -43,6 +43,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
43
43
  switch (subcommand) {
44
44
  case 'list':
45
45
  return handleList(argv, prompter);
46
+ case 'find-first':
47
+ return handleFindFirst(argv, prompter);
46
48
  case 'get':
47
49
  return handleGet(argv, prompter);
48
50
  case 'create':
@@ -56,24 +58,22 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
56
58
  process.exit(1);
57
59
  }
58
60
  }
59
- async function handleList(_argv, _prompter) {
61
+ async function handleList(argv, _prompter) {
60
62
  try {
63
+ const defaultSelect = {
64
+ id: true,
65
+ databaseId: true,
66
+ siteId: true,
67
+ name: true,
68
+ appImage: true,
69
+ appStoreLink: true,
70
+ appStoreId: true,
71
+ appIdPrefix: true,
72
+ playStoreLink: true,
73
+ };
74
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
61
75
  const client = (0, executor_1.getClient)();
62
- const result = await client.app
63
- .findMany({
64
- select: {
65
- id: true,
66
- databaseId: true,
67
- siteId: true,
68
- name: true,
69
- appImage: true,
70
- appStoreLink: true,
71
- appStoreId: true,
72
- appIdPrefix: true,
73
- playStoreLink: true,
74
- },
75
- })
76
- .execute();
76
+ const result = await client.app.findMany(findManyArgs).execute();
77
77
  console.log(JSON.stringify(result, null, 2));
78
78
  }
79
79
  catch (error) {
@@ -84,6 +84,32 @@ async function handleList(_argv, _prompter) {
84
84
  process.exit(1);
85
85
  }
86
86
  }
87
+ async function handleFindFirst(argv, _prompter) {
88
+ try {
89
+ const defaultSelect = {
90
+ id: true,
91
+ databaseId: true,
92
+ siteId: true,
93
+ name: true,
94
+ appImage: true,
95
+ appStoreLink: true,
96
+ appStoreId: true,
97
+ appIdPrefix: true,
98
+ playStoreLink: true,
99
+ };
100
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
101
+ const client = (0, executor_1.getClient)();
102
+ const result = await client.app.findFirst(findFirstArgs).execute();
103
+ console.log(JSON.stringify(result, null, 2));
104
+ }
105
+ catch (error) {
106
+ console.error('Failed to find record.');
107
+ if (error instanceof Error) {
108
+ console.error(error.message);
109
+ }
110
+ process.exit(1);
111
+ }
112
+ }
87
113
  async function handleGet(argv, prompter) {
88
114
  try {
89
115
  const answers = await prompter.prompt(argv, [
@@ -23,7 +23,7 @@ const fieldSchema = {
23
23
  actionId: 'uuid',
24
24
  actorId: 'uuid',
25
25
  };
26
- const usage = '\nast-migration <command>\n\nCommands:\n list List all astMigration records\n create Create a new astMigration\n\n --help, -h Show this help message\n';
26
+ const usage = '\nast-migration <command>\n\nCommands:\n list List astMigration records\n find-first Find first matching astMigration record\n create Create a new astMigration\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';
27
27
  exports.default = async (argv, prompter, _options) => {
28
28
  if (argv.help || argv.h) {
29
29
  console.log(usage);
@@ -36,7 +36,7 @@ exports.default = async (argv, prompter, _options) => {
36
36
  type: 'autocomplete',
37
37
  name: 'subcommand',
38
38
  message: 'What do you want to do?',
39
- options: ['list', 'create'],
39
+ options: ['list', 'find-first', 'create'],
40
40
  },
41
41
  ]);
42
42
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -47,6 +47,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
47
47
  switch (subcommand) {
48
48
  case 'list':
49
49
  return handleList(argv, prompter);
50
+ case 'find-first':
51
+ return handleFindFirst(argv, prompter);
50
52
  case 'create':
51
53
  return handleCreate(argv, prompter);
52
54
  default:
@@ -54,28 +56,26 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
54
56
  process.exit(1);
55
57
  }
56
58
  }
57
- async function handleList(_argv, _prompter) {
59
+ async function handleList(argv, _prompter) {
58
60
  try {
61
+ const defaultSelect = {
62
+ id: true,
63
+ databaseId: true,
64
+ name: true,
65
+ requires: true,
66
+ payload: true,
67
+ deploys: true,
68
+ deploy: true,
69
+ revert: true,
70
+ verify: true,
71
+ createdAt: true,
72
+ action: true,
73
+ actionId: true,
74
+ actorId: true,
75
+ };
76
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
59
77
  const client = (0, executor_1.getClient)();
60
- const result = await client.astMigration
61
- .findMany({
62
- select: {
63
- id: true,
64
- databaseId: true,
65
- name: true,
66
- requires: true,
67
- payload: true,
68
- deploys: true,
69
- deploy: true,
70
- revert: true,
71
- verify: true,
72
- createdAt: true,
73
- action: true,
74
- actionId: true,
75
- actorId: true,
76
- },
77
- })
78
- .execute();
78
+ const result = await client.astMigration.findMany(findManyArgs).execute();
79
79
  console.log(JSON.stringify(result, null, 2));
80
80
  }
81
81
  catch (error) {
@@ -86,6 +86,36 @@ async function handleList(_argv, _prompter) {
86
86
  process.exit(1);
87
87
  }
88
88
  }
89
+ async function handleFindFirst(argv, _prompter) {
90
+ try {
91
+ const defaultSelect = {
92
+ id: true,
93
+ databaseId: true,
94
+ name: true,
95
+ requires: true,
96
+ payload: true,
97
+ deploys: true,
98
+ deploy: true,
99
+ revert: true,
100
+ verify: true,
101
+ createdAt: true,
102
+ action: true,
103
+ actionId: true,
104
+ actorId: true,
105
+ };
106
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
107
+ const client = (0, executor_1.getClient)();
108
+ const result = await client.astMigration.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
+ }
89
119
  async function handleCreate(argv, prompter) {
90
120
  try {
91
121
  const rawAnswers = await prompter.prompt(argv, [
@@ -18,7 +18,7 @@ const fieldSchema = {
18
18
  success: 'boolean',
19
19
  createdAt: 'string',
20
20
  };
21
- const usage = '\naudit-log <command>\n\nCommands:\n list List all auditLog records\n get Get a auditLog by ID\n create Create a new auditLog\n update Update an existing auditLog\n delete Delete a auditLog\n\n --help, -h Show this help message\n';
21
+ const usage = '\naudit-log <command>\n\nCommands:\n list List auditLog records\n find-first Find first matching auditLog record\n get Get a auditLog by ID\n create Create a new auditLog\n update Update an existing auditLog\n delete Delete a auditLog\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';
22
22
  exports.default = async (argv, prompter, _options) => {
23
23
  if (argv.help || argv.h) {
24
24
  console.log(usage);
@@ -31,7 +31,7 @@ exports.default = async (argv, prompter, _options) => {
31
31
  type: 'autocomplete',
32
32
  name: 'subcommand',
33
33
  message: 'What do you want to do?',
34
- options: ['list', 'get', 'create', 'update', 'delete'],
34
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
35
35
  },
36
36
  ]);
37
37
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -42,6 +42,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
42
42
  switch (subcommand) {
43
43
  case 'list':
44
44
  return handleList(argv, prompter);
45
+ case 'find-first':
46
+ return handleFindFirst(argv, prompter);
45
47
  case 'get':
46
48
  return handleGet(argv, prompter);
47
49
  case 'create':
@@ -55,23 +57,21 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
55
57
  process.exit(1);
56
58
  }
57
59
  }
58
- async function handleList(_argv, _prompter) {
60
+ async function handleList(argv, _prompter) {
59
61
  try {
62
+ const defaultSelect = {
63
+ id: true,
64
+ event: true,
65
+ actorId: true,
66
+ origin: true,
67
+ userAgent: true,
68
+ ipAddress: true,
69
+ success: true,
70
+ createdAt: true,
71
+ };
72
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
60
73
  const client = (0, executor_1.getClient)();
61
- const result = await client.auditLog
62
- .findMany({
63
- select: {
64
- id: true,
65
- event: true,
66
- actorId: true,
67
- origin: true,
68
- userAgent: true,
69
- ipAddress: true,
70
- success: true,
71
- createdAt: true,
72
- },
73
- })
74
- .execute();
74
+ const result = await client.auditLog.findMany(findManyArgs).execute();
75
75
  console.log(JSON.stringify(result, null, 2));
76
76
  }
77
77
  catch (error) {
@@ -82,6 +82,31 @@ async function handleList(_argv, _prompter) {
82
82
  process.exit(1);
83
83
  }
84
84
  }
85
+ async function handleFindFirst(argv, _prompter) {
86
+ try {
87
+ const defaultSelect = {
88
+ id: true,
89
+ event: true,
90
+ actorId: true,
91
+ origin: true,
92
+ userAgent: true,
93
+ ipAddress: true,
94
+ success: true,
95
+ createdAt: true,
96
+ };
97
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
98
+ const client = (0, executor_1.getClient)();
99
+ const result = await client.auditLog.findFirst(findFirstArgs).execute();
100
+ console.log(JSON.stringify(result, null, 2));
101
+ }
102
+ catch (error) {
103
+ console.error('Failed to find record.');
104
+ if (error instanceof Error) {
105
+ console.error(error.message);
106
+ }
107
+ process.exit(1);
108
+ }
109
+ }
85
110
  async function handleGet(argv, prompter) {
86
111
  try {
87
112
  const answers = await prompter.prompt(argv, [
@@ -30,7 +30,7 @@ const fieldSchema = {
30
30
  createdAt: 'string',
31
31
  updatedAt: 'string',
32
32
  };
33
- const usage = '\nblueprint-template <command>\n\nCommands:\n list List all blueprintTemplate records\n get Get a blueprintTemplate by ID\n create Create a new blueprintTemplate\n update Update an existing blueprintTemplate\n delete Delete a blueprintTemplate\n\n --help, -h Show this help message\n';
33
+ const usage = '\nblueprint-template <command>\n\nCommands:\n list List blueprintTemplate records\n find-first Find first matching blueprintTemplate record\n get Get a blueprintTemplate by ID\n create Create a new blueprintTemplate\n update Update an existing blueprintTemplate\n delete Delete a blueprintTemplate\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';
34
34
  exports.default = async (argv, prompter, _options) => {
35
35
  if (argv.help || argv.h) {
36
36
  console.log(usage);
@@ -43,7 +43,7 @@ exports.default = async (argv, prompter, _options) => {
43
43
  type: 'autocomplete',
44
44
  name: 'subcommand',
45
45
  message: 'What do you want to do?',
46
- options: ['list', 'get', 'create', 'update', 'delete'],
46
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
47
47
  },
48
48
  ]);
49
49
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -54,6 +54,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
54
54
  switch (subcommand) {
55
55
  case 'list':
56
56
  return handleList(argv, prompter);
57
+ case 'find-first':
58
+ return handleFindFirst(argv, prompter);
57
59
  case 'get':
58
60
  return handleGet(argv, prompter);
59
61
  case 'create':
@@ -67,35 +69,33 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
67
69
  process.exit(1);
68
70
  }
69
71
  }
70
- async function handleList(_argv, _prompter) {
72
+ async function handleList(argv, _prompter) {
71
73
  try {
74
+ const defaultSelect = {
75
+ id: true,
76
+ name: true,
77
+ version: true,
78
+ displayName: true,
79
+ description: true,
80
+ ownerId: true,
81
+ visibility: true,
82
+ categories: true,
83
+ tags: true,
84
+ definition: true,
85
+ definitionSchemaVersion: true,
86
+ source: true,
87
+ complexity: true,
88
+ copyCount: true,
89
+ forkCount: true,
90
+ forkedFromId: true,
91
+ definitionHash: true,
92
+ tableHashes: true,
93
+ createdAt: true,
94
+ updatedAt: true,
95
+ };
96
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
72
97
  const client = (0, executor_1.getClient)();
73
- const result = await client.blueprintTemplate
74
- .findMany({
75
- select: {
76
- id: true,
77
- name: true,
78
- version: true,
79
- displayName: true,
80
- description: true,
81
- ownerId: true,
82
- visibility: true,
83
- categories: true,
84
- tags: true,
85
- definition: true,
86
- definitionSchemaVersion: true,
87
- source: true,
88
- complexity: true,
89
- copyCount: true,
90
- forkCount: true,
91
- forkedFromId: true,
92
- definitionHash: true,
93
- tableHashes: true,
94
- createdAt: true,
95
- updatedAt: true,
96
- },
97
- })
98
- .execute();
98
+ const result = await client.blueprintTemplate.findMany(findManyArgs).execute();
99
99
  console.log(JSON.stringify(result, null, 2));
100
100
  }
101
101
  catch (error) {
@@ -106,6 +106,43 @@ async function handleList(_argv, _prompter) {
106
106
  process.exit(1);
107
107
  }
108
108
  }
109
+ async function handleFindFirst(argv, _prompter) {
110
+ try {
111
+ const defaultSelect = {
112
+ id: true,
113
+ name: true,
114
+ version: true,
115
+ displayName: true,
116
+ description: true,
117
+ ownerId: true,
118
+ visibility: true,
119
+ categories: true,
120
+ tags: true,
121
+ definition: true,
122
+ definitionSchemaVersion: true,
123
+ source: true,
124
+ complexity: true,
125
+ copyCount: true,
126
+ forkCount: true,
127
+ forkedFromId: true,
128
+ definitionHash: true,
129
+ tableHashes: true,
130
+ createdAt: true,
131
+ updatedAt: true,
132
+ };
133
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
134
+ const client = (0, executor_1.getClient)();
135
+ const result = await client.blueprintTemplate.findFirst(findFirstArgs).execute();
136
+ console.log(JSON.stringify(result, null, 2));
137
+ }
138
+ catch (error) {
139
+ console.error('Failed to find record.');
140
+ if (error instanceof Error) {
141
+ console.error(error.message);
142
+ }
143
+ process.exit(1);
144
+ }
145
+ }
109
146
  async function handleGet(argv, prompter) {
110
147
  try {
111
148
  const answers = await prompter.prompt(argv, [
@@ -27,7 +27,7 @@ const fieldSchema = {
27
27
  createdAt: 'string',
28
28
  updatedAt: 'string',
29
29
  };
30
- const usage = '\nblueprint <command>\n\nCommands:\n list List all blueprint records\n get Get a blueprint by ID\n create Create a new blueprint\n update Update an existing blueprint\n delete Delete a blueprint\n\n --help, -h Show this help message\n';
30
+ const usage = '\nblueprint <command>\n\nCommands:\n list List blueprint records\n find-first Find first matching blueprint record\n get Get a blueprint by ID\n create Create a new blueprint\n update Update an existing blueprint\n delete Delete a blueprint\n\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';
31
31
  exports.default = async (argv, prompter, _options) => {
32
32
  if (argv.help || argv.h) {
33
33
  console.log(usage);
@@ -40,7 +40,7 @@ exports.default = async (argv, prompter, _options) => {
40
40
  type: 'autocomplete',
41
41
  name: 'subcommand',
42
42
  message: 'What do you want to do?',
43
- options: ['list', 'get', 'create', 'update', 'delete'],
43
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
44
44
  },
45
45
  ]);
46
46
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -51,6 +51,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
51
51
  switch (subcommand) {
52
52
  case 'list':
53
53
  return handleList(argv, prompter);
54
+ case 'find-first':
55
+ return handleFindFirst(argv, prompter);
54
56
  case 'get':
55
57
  return handleGet(argv, prompter);
56
58
  case 'create':
@@ -64,32 +66,30 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
64
66
  process.exit(1);
65
67
  }
66
68
  }
67
- async function handleList(_argv, _prompter) {
69
+ async function handleList(argv, _prompter) {
68
70
  try {
71
+ const defaultSelect = {
72
+ id: true,
73
+ ownerId: true,
74
+ databaseId: true,
75
+ name: true,
76
+ displayName: true,
77
+ description: true,
78
+ definition: true,
79
+ templateId: true,
80
+ status: true,
81
+ constructedAt: true,
82
+ errorDetails: true,
83
+ refMap: true,
84
+ constructedDefinition: true,
85
+ definitionHash: true,
86
+ tableHashes: true,
87
+ createdAt: true,
88
+ updatedAt: true,
89
+ };
90
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
69
91
  const client = (0, executor_1.getClient)();
70
- const result = await client.blueprint
71
- .findMany({
72
- select: {
73
- id: true,
74
- ownerId: true,
75
- databaseId: true,
76
- name: true,
77
- displayName: true,
78
- description: true,
79
- definition: true,
80
- templateId: true,
81
- status: true,
82
- constructedAt: true,
83
- errorDetails: true,
84
- refMap: true,
85
- constructedDefinition: true,
86
- definitionHash: true,
87
- tableHashes: true,
88
- createdAt: true,
89
- updatedAt: true,
90
- },
91
- })
92
- .execute();
92
+ const result = await client.blueprint.findMany(findManyArgs).execute();
93
93
  console.log(JSON.stringify(result, null, 2));
94
94
  }
95
95
  catch (error) {
@@ -100,6 +100,40 @@ async function handleList(_argv, _prompter) {
100
100
  process.exit(1);
101
101
  }
102
102
  }
103
+ async function handleFindFirst(argv, _prompter) {
104
+ try {
105
+ const defaultSelect = {
106
+ id: true,
107
+ ownerId: true,
108
+ databaseId: true,
109
+ name: true,
110
+ displayName: true,
111
+ description: true,
112
+ definition: true,
113
+ templateId: true,
114
+ status: true,
115
+ constructedAt: true,
116
+ errorDetails: true,
117
+ refMap: true,
118
+ constructedDefinition: true,
119
+ definitionHash: true,
120
+ tableHashes: true,
121
+ createdAt: true,
122
+ updatedAt: true,
123
+ };
124
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
125
+ const client = (0, executor_1.getClient)();
126
+ const result = await client.blueprint.findFirst(findFirstArgs).execute();
127
+ console.log(JSON.stringify(result, null, 2));
128
+ }
129
+ catch (error) {
130
+ console.error('Failed to find record.');
131
+ if (error instanceof Error) {
132
+ console.error(error.message);
133
+ }
134
+ process.exit(1);
135
+ }
136
+ }
103
137
  async function handleGet(argv, prompter) {
104
138
  try {
105
139
  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 = '\ncheck-constraint <command>\n\nCommands:\n list List all checkConstraint records\n get Get a checkConstraint by ID\n create Create a new checkConstraint\n update Update an existing checkConstraint\n delete Delete a checkConstraint\n\n --help, -h Show this help message\n';
27
+ const usage = '\ncheck-constraint <command>\n\nCommands:\n list List checkConstraint records\n find-first Find first matching checkConstraint record\n get Get a checkConstraint by ID\n create Create a new checkConstraint\n update Update an existing checkConstraint\n delete Delete a checkConstraint\n\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
+ tableId: true,
72
+ name: true,
73
+ type: true,
74
+ fieldIds: true,
75
+ expr: true,
76
+ smartTags: true,
77
+ category: true,
78
+ module: true,
79
+ scope: true,
80
+ tags: 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.checkConstraint
68
- .findMany({
69
- select: {
70
- id: true,
71
- databaseId: true,
72
- tableId: true,
73
- name: true,
74
- type: true,
75
- fieldIds: true,
76
- expr: true,
77
- smartTags: true,
78
- category: true,
79
- module: true,
80
- scope: true,
81
- tags: true,
82
- createdAt: true,
83
- updatedAt: true,
84
- },
85
- })
86
- .execute();
86
+ const result = await client.checkConstraint.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
+ tableId: true,
103
+ name: true,
104
+ type: true,
105
+ fieldIds: true,
106
+ expr: true,
107
+ smartTags: true,
108
+ category: true,
109
+ module: true,
110
+ scope: true,
111
+ tags: 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.checkConstraint.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, [