@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
@@ -22,7 +22,7 @@ const fieldSchema = {
22
22
  scope: 'int',
23
23
  tags: 'string',
24
24
  };
25
- const usage = '\nenum <command>\n\nCommands:\n list List all enum records\n get Get a enum by ID\n create Create a new enum\n update Update an existing enum\n delete Delete a enum\n\n --help, -h Show this help message\n';
25
+ const usage = '\nenum <command>\n\nCommands:\n list List enum records\n find-first Find first matching enum record\n get Get a enum by ID\n create Create a new enum\n update Update an existing enum\n delete Delete a enum\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';
26
26
  exports.default = async (argv, prompter, _options) => {
27
27
  if (argv.help || argv.h) {
28
28
  console.log(usage);
@@ -35,7 +35,7 @@ exports.default = async (argv, prompter, _options) => {
35
35
  type: 'autocomplete',
36
36
  name: 'subcommand',
37
37
  message: 'What do you want to do?',
38
- options: ['list', 'get', 'create', 'update', 'delete'],
38
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
39
39
  },
40
40
  ]);
41
41
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -46,6 +46,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
46
46
  switch (subcommand) {
47
47
  case 'list':
48
48
  return handleList(argv, prompter);
49
+ case 'find-first':
50
+ return handleFindFirst(argv, prompter);
49
51
  case 'get':
50
52
  return handleGet(argv, prompter);
51
53
  case 'create':
@@ -59,27 +61,25 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
59
61
  process.exit(1);
60
62
  }
61
63
  }
62
- async function handleList(_argv, _prompter) {
64
+ async function handleList(argv, _prompter) {
63
65
  try {
66
+ const defaultSelect = {
67
+ id: true,
68
+ databaseId: true,
69
+ schemaId: true,
70
+ name: true,
71
+ label: true,
72
+ description: true,
73
+ values: true,
74
+ smartTags: true,
75
+ category: true,
76
+ module: true,
77
+ scope: true,
78
+ tags: true,
79
+ };
80
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
64
81
  const client = (0, executor_1.getClient)();
65
- const result = await client.enum
66
- .findMany({
67
- select: {
68
- id: true,
69
- databaseId: true,
70
- schemaId: true,
71
- name: true,
72
- label: true,
73
- description: true,
74
- values: true,
75
- smartTags: true,
76
- category: true,
77
- module: true,
78
- scope: true,
79
- tags: true,
80
- },
81
- })
82
- .execute();
82
+ const result = await client.enum.findMany(findManyArgs).execute();
83
83
  console.log(JSON.stringify(result, null, 2));
84
84
  }
85
85
  catch (error) {
@@ -90,6 +90,35 @@ async function handleList(_argv, _prompter) {
90
90
  process.exit(1);
91
91
  }
92
92
  }
93
+ async function handleFindFirst(argv, _prompter) {
94
+ try {
95
+ const defaultSelect = {
96
+ id: true,
97
+ databaseId: true,
98
+ schemaId: true,
99
+ name: true,
100
+ label: true,
101
+ description: true,
102
+ values: true,
103
+ smartTags: true,
104
+ category: true,
105
+ module: true,
106
+ scope: true,
107
+ tags: true,
108
+ };
109
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
110
+ const client = (0, executor_1.getClient)();
111
+ const result = await client.enum.findFirst(findFirstArgs).execute();
112
+ console.log(JSON.stringify(result, null, 2));
113
+ }
114
+ catch (error) {
115
+ console.error('Failed to find record.');
116
+ if (error instanceof Error) {
117
+ console.error(error.message);
118
+ }
119
+ process.exit(1);
120
+ }
121
+ }
93
122
  async function handleGet(argv, prompter) {
94
123
  try {
95
124
  const answers = await prompter.prompt(argv, [
@@ -34,7 +34,7 @@ const fieldSchema = {
34
34
  createdAt: 'string',
35
35
  updatedAt: 'string',
36
36
  };
37
- const usage = '\nfield <command>\n\nCommands:\n list List all field records\n get Get a field by ID\n create Create a new field\n update Update an existing field\n delete Delete a field\n\n --help, -h Show this help message\n';
37
+ const usage = '\nfield <command>\n\nCommands:\n list List field records\n find-first Find first matching field record\n get Get a field by ID\n create Create a new field\n update Update an existing field\n delete Delete a field\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';
38
38
  exports.default = async (argv, prompter, _options) => {
39
39
  if (argv.help || argv.h) {
40
40
  console.log(usage);
@@ -47,7 +47,7 @@ exports.default = async (argv, prompter, _options) => {
47
47
  type: 'autocomplete',
48
48
  name: 'subcommand',
49
49
  message: 'What do you want to do?',
50
- options: ['list', 'get', 'create', 'update', 'delete'],
50
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
51
51
  },
52
52
  ]);
53
53
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -58,6 +58,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
58
58
  switch (subcommand) {
59
59
  case 'list':
60
60
  return handleList(argv, prompter);
61
+ case 'find-first':
62
+ return handleFindFirst(argv, prompter);
61
63
  case 'get':
62
64
  return handleGet(argv, prompter);
63
65
  case 'create':
@@ -71,39 +73,37 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
71
73
  process.exit(1);
72
74
  }
73
75
  }
74
- async function handleList(_argv, _prompter) {
76
+ async function handleList(argv, _prompter) {
75
77
  try {
78
+ const defaultSelect = {
79
+ id: true,
80
+ databaseId: true,
81
+ tableId: true,
82
+ name: true,
83
+ label: true,
84
+ description: true,
85
+ smartTags: true,
86
+ isRequired: true,
87
+ apiRequired: true,
88
+ defaultValue: true,
89
+ defaultValueAst: true,
90
+ type: true,
91
+ fieldOrder: true,
92
+ regexp: true,
93
+ chk: true,
94
+ chkExpr: true,
95
+ min: true,
96
+ max: true,
97
+ tags: true,
98
+ category: true,
99
+ module: true,
100
+ scope: true,
101
+ createdAt: true,
102
+ updatedAt: true,
103
+ };
104
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
76
105
  const client = (0, executor_1.getClient)();
77
- const result = await client.field
78
- .findMany({
79
- select: {
80
- id: true,
81
- databaseId: true,
82
- tableId: true,
83
- name: true,
84
- label: true,
85
- description: true,
86
- smartTags: true,
87
- isRequired: true,
88
- apiRequired: true,
89
- defaultValue: true,
90
- defaultValueAst: true,
91
- type: true,
92
- fieldOrder: true,
93
- regexp: true,
94
- chk: true,
95
- chkExpr: true,
96
- min: true,
97
- max: true,
98
- tags: true,
99
- category: true,
100
- module: true,
101
- scope: true,
102
- createdAt: true,
103
- updatedAt: true,
104
- },
105
- })
106
- .execute();
106
+ const result = await client.field.findMany(findManyArgs).execute();
107
107
  console.log(JSON.stringify(result, null, 2));
108
108
  }
109
109
  catch (error) {
@@ -114,6 +114,47 @@ async function handleList(_argv, _prompter) {
114
114
  process.exit(1);
115
115
  }
116
116
  }
117
+ async function handleFindFirst(argv, _prompter) {
118
+ try {
119
+ const defaultSelect = {
120
+ id: true,
121
+ databaseId: true,
122
+ tableId: true,
123
+ name: true,
124
+ label: true,
125
+ description: true,
126
+ smartTags: true,
127
+ isRequired: true,
128
+ apiRequired: true,
129
+ defaultValue: true,
130
+ defaultValueAst: true,
131
+ type: true,
132
+ fieldOrder: true,
133
+ regexp: true,
134
+ chk: true,
135
+ chkExpr: true,
136
+ min: true,
137
+ max: true,
138
+ tags: true,
139
+ category: true,
140
+ module: true,
141
+ scope: true,
142
+ createdAt: true,
143
+ updatedAt: true,
144
+ };
145
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
146
+ const client = (0, executor_1.getClient)();
147
+ const result = await client.field.findFirst(findFirstArgs).execute();
148
+ console.log(JSON.stringify(result, null, 2));
149
+ }
150
+ catch (error) {
151
+ console.error('Failed to find record.');
152
+ if (error instanceof Error) {
153
+ console.error(error.message);
154
+ }
155
+ process.exit(1);
156
+ }
157
+ }
117
158
  async function handleGet(argv, prompter) {
118
159
  try {
119
160
  const answers = await prompter.prompt(argv, [
@@ -28,7 +28,7 @@ const fieldSchema = {
28
28
  createdAt: 'string',
29
29
  updatedAt: 'string',
30
30
  };
31
- const usage = '\nforeign-key-constraint <command>\n\nCommands:\n list List all foreignKeyConstraint records\n get Get a foreignKeyConstraint by ID\n create Create a new foreignKeyConstraint\n update Update an existing foreignKeyConstraint\n delete Delete a foreignKeyConstraint\n\n --help, -h Show this help message\n';
31
+ const usage = '\nforeign-key-constraint <command>\n\nCommands:\n list List foreignKeyConstraint records\n find-first Find first matching foreignKeyConstraint record\n get Get a foreignKeyConstraint by ID\n create Create a new foreignKeyConstraint\n update Update an existing foreignKeyConstraint\n delete Delete a foreignKeyConstraint\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';
32
32
  exports.default = async (argv, prompter, _options) => {
33
33
  if (argv.help || argv.h) {
34
34
  console.log(usage);
@@ -41,7 +41,7 @@ exports.default = async (argv, prompter, _options) => {
41
41
  type: 'autocomplete',
42
42
  name: 'subcommand',
43
43
  message: 'What do you want to do?',
44
- options: ['list', 'get', 'create', 'update', 'delete'],
44
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
45
45
  },
46
46
  ]);
47
47
  return handleTableSubcommand(answer.subcommand, newArgv, prompter);
@@ -52,6 +52,8 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
52
52
  switch (subcommand) {
53
53
  case 'list':
54
54
  return handleList(argv, prompter);
55
+ case 'find-first':
56
+ return handleFindFirst(argv, prompter);
55
57
  case 'get':
56
58
  return handleGet(argv, prompter);
57
59
  case 'create':
@@ -65,33 +67,31 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
65
67
  process.exit(1);
66
68
  }
67
69
  }
68
- async function handleList(_argv, _prompter) {
70
+ async function handleList(argv, _prompter) {
69
71
  try {
72
+ const defaultSelect = {
73
+ id: true,
74
+ databaseId: true,
75
+ tableId: true,
76
+ name: true,
77
+ description: true,
78
+ smartTags: true,
79
+ type: true,
80
+ fieldIds: true,
81
+ refTableId: true,
82
+ refFieldIds: true,
83
+ deleteAction: true,
84
+ updateAction: true,
85
+ category: true,
86
+ module: true,
87
+ scope: true,
88
+ tags: true,
89
+ createdAt: true,
90
+ updatedAt: true,
91
+ };
92
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
70
93
  const client = (0, executor_1.getClient)();
71
- const result = await client.foreignKeyConstraint
72
- .findMany({
73
- select: {
74
- id: true,
75
- databaseId: true,
76
- tableId: true,
77
- name: true,
78
- description: true,
79
- smartTags: true,
80
- type: true,
81
- fieldIds: true,
82
- refTableId: true,
83
- refFieldIds: true,
84
- deleteAction: true,
85
- updateAction: true,
86
- category: true,
87
- module: true,
88
- scope: true,
89
- tags: true,
90
- createdAt: true,
91
- updatedAt: true,
92
- },
93
- })
94
- .execute();
94
+ const result = await client.foreignKeyConstraint.findMany(findManyArgs).execute();
95
95
  console.log(JSON.stringify(result, null, 2));
96
96
  }
97
97
  catch (error) {
@@ -102,6 +102,41 @@ async function handleList(_argv, _prompter) {
102
102
  process.exit(1);
103
103
  }
104
104
  }
105
+ async function handleFindFirst(argv, _prompter) {
106
+ try {
107
+ const defaultSelect = {
108
+ id: true,
109
+ databaseId: true,
110
+ tableId: true,
111
+ name: true,
112
+ description: true,
113
+ smartTags: true,
114
+ type: true,
115
+ fieldIds: true,
116
+ refTableId: true,
117
+ refFieldIds: true,
118
+ deleteAction: true,
119
+ updateAction: true,
120
+ category: true,
121
+ module: true,
122
+ scope: true,
123
+ tags: true,
124
+ createdAt: true,
125
+ updatedAt: true,
126
+ };
127
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
128
+ const client = (0, executor_1.getClient)();
129
+ const result = await client.foreignKeyConstraint.findFirst(findFirstArgs).execute();
130
+ console.log(JSON.stringify(result, null, 2));
131
+ }
132
+ catch (error) {
133
+ console.error('Failed to find record.');
134
+ if (error instanceof Error) {
135
+ console.error(error.message);
136
+ }
137
+ process.exit(1);
138
+ }
139
+ }
105
140
  async function handleGet(argv, prompter) {
106
141
  try {
107
142
  const answers = await prompter.prompt(argv, [
@@ -19,7 +19,7 @@ const fieldSchema = {
19
19
  createdAt: 'string',
20
20
  updatedAt: 'string',
21
21
  };
22
- const usage = '\nfull-text-search <command>\n\nCommands:\n list List all fullTextSearch records\n get Get a fullTextSearch by ID\n create Create a new fullTextSearch\n update Update an existing fullTextSearch\n delete Delete a fullTextSearch\n\n --help, -h Show this help message\n';
22
+ const usage = '\nfull-text-search <command>\n\nCommands:\n list List fullTextSearch records\n find-first Find first matching fullTextSearch record\n get Get a fullTextSearch by ID\n create Create a new fullTextSearch\n update Update an existing fullTextSearch\n delete Delete a fullTextSearch\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
+ tableId: true,
67
+ fieldId: true,
68
+ fieldIds: true,
69
+ weights: true,
70
+ langs: true,
71
+ createdAt: true,
72
+ updatedAt: true,
73
+ };
74
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
61
75
  const client = (0, executor_1.getClient)();
62
- const result = await client.fullTextSearch
63
- .findMany({
64
- select: {
65
- id: true,
66
- databaseId: true,
67
- tableId: true,
68
- fieldId: true,
69
- fieldIds: true,
70
- weights: true,
71
- langs: true,
72
- createdAt: true,
73
- updatedAt: true,
74
- },
75
- })
76
- .execute();
76
+ const result = await client.fullTextSearch.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
+ tableId: true,
93
+ fieldId: true,
94
+ fieldIds: true,
95
+ weights: true,
96
+ langs: true,
97
+ createdAt: true,
98
+ updatedAt: true,
99
+ };
100
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
101
+ const client = (0, executor_1.getClient)();
102
+ const result = await client.fullTextSearch.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, [
@@ -12,7 +12,7 @@ const fieldSchema = {
12
12
  path: 'string',
13
13
  data: 'json',
14
14
  };
15
- const usage = '\nget-all-record <command>\n\nCommands:\n list List all getAllRecord records\n create Create a new getAllRecord\n\n --help, -h Show this help message\n';
15
+ const usage = '\nget-all-record <command>\n\nCommands:\n list List getAllRecord records\n find-first Find first matching getAllRecord record\n create Create a new getAllRecord\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', 'create'],
28
+ options: ['list', 'find-first', 'create'],
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 'create':
40
42
  return handleCreate(argv, prompter);
41
43
  default:
@@ -43,17 +45,15 @@ async function handleTableSubcommand(subcommand, argv, prompter) {
43
45
  process.exit(1);
44
46
  }
45
47
  }
46
- async function handleList(_argv, _prompter) {
48
+ async function handleList(argv, _prompter) {
47
49
  try {
50
+ const defaultSelect = {
51
+ path: true,
52
+ data: true,
53
+ };
54
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
48
55
  const client = (0, executor_1.getClient)();
49
- const result = await client.getAllRecord
50
- .findMany({
51
- select: {
52
- path: true,
53
- data: true,
54
- },
55
- })
56
- .execute();
56
+ const result = await client.getAllRecord.findMany(findManyArgs).execute();
57
57
  console.log(JSON.stringify(result, null, 2));
58
58
  }
59
59
  catch (error) {
@@ -64,6 +64,25 @@ async function handleList(_argv, _prompter) {
64
64
  process.exit(1);
65
65
  }
66
66
  }
67
+ async function handleFindFirst(argv, _prompter) {
68
+ try {
69
+ const defaultSelect = {
70
+ path: true,
71
+ data: true,
72
+ };
73
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
74
+ const client = (0, executor_1.getClient)();
75
+ const result = await client.getAllRecord.findFirst(findFirstArgs).execute();
76
+ console.log(JSON.stringify(result, null, 2));
77
+ }
78
+ catch (error) {
79
+ console.error('Failed to find record.');
80
+ if (error instanceof Error) {
81
+ console.error(error.message);
82
+ }
83
+ process.exit(1);
84
+ }
85
+ }
67
86
  async function handleCreate(argv, prompter) {
68
87
  try {
69
88
  const rawAnswers = await prompter.prompt(argv, [