@constructive-sdk/cli 0.20.3 → 0.20.5

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 (323) hide show
  1. package/admin/cli/commands/{request-upload-url.d.ts → app-limit-cap.d.ts} +1 -1
  2. package/admin/cli/commands/app-limit-cap.js +272 -0
  3. package/{esm/admin/cli/commands/request-upload-url.d.ts → admin/cli/commands/app-limit-caps-default.d.ts} +1 -1
  4. package/admin/cli/commands/app-limit-caps-default.js +252 -0
  5. package/{auth/cli/commands/request-upload-url.d.ts → admin/cli/commands/app-limit-credit-code-item.d.ts} +1 -1
  6. package/admin/cli/commands/app-limit-credit-code-item.js +292 -0
  7. package/{esm/auth/cli/commands/request-upload-url.d.ts → admin/cli/commands/app-limit-credit-code.d.ts} +1 -1
  8. package/admin/cli/commands/app-limit-credit-code.js +296 -0
  9. package/admin/cli/commands/app-limit-credit-redemption.d.ts +8 -0
  10. package/admin/cli/commands/app-limit-credit-redemption.js +250 -0
  11. package/admin/cli/commands/app-limit-credit.d.ts +8 -0
  12. package/admin/cli/commands/app-limit-credit.js +316 -0
  13. package/admin/cli/commands/app-limit.js +66 -0
  14. package/admin/cli/commands/org-limit-aggregate.js +88 -0
  15. package/admin/cli/commands/org-limit-cap.d.ts +8 -0
  16. package/admin/cli/commands/org-limit-cap.js +272 -0
  17. package/admin/cli/commands/org-limit-caps-default.d.ts +8 -0
  18. package/admin/cli/commands/org-limit-caps-default.js +252 -0
  19. package/admin/cli/commands/org-limit-credit.d.ts +8 -0
  20. package/admin/cli/commands/org-limit-credit.js +338 -0
  21. package/admin/cli/commands/org-limit.js +66 -0
  22. package/admin/cli/commands.js +25 -9
  23. package/admin/cli/executor.d.ts +12 -8
  24. package/admin/orm/index.d.ts +24 -11
  25. package/admin/orm/index.js +24 -6
  26. package/admin/orm/input-types.d.ts +2108 -545
  27. package/admin/orm/input-types.js +13 -1
  28. package/admin/orm/models/appLimitCap.d.ts +56 -0
  29. package/admin/orm/models/appLimitCap.js +100 -0
  30. package/admin/orm/models/appLimitCapsDefault.d.ts +56 -0
  31. package/admin/orm/models/appLimitCapsDefault.js +100 -0
  32. package/admin/orm/models/appLimitCredit.d.ts +56 -0
  33. package/admin/orm/models/appLimitCredit.js +100 -0
  34. package/admin/orm/models/appLimitCreditCode.d.ts +56 -0
  35. package/admin/orm/models/appLimitCreditCode.js +100 -0
  36. package/admin/orm/models/appLimitCreditCodeItem.d.ts +56 -0
  37. package/admin/orm/models/appLimitCreditCodeItem.js +100 -0
  38. package/admin/orm/models/appLimitCreditRedemption.d.ts +56 -0
  39. package/admin/orm/models/appLimitCreditRedemption.js +100 -0
  40. package/admin/orm/models/index.d.ts +12 -3
  41. package/admin/orm/models/index.js +25 -7
  42. package/admin/orm/models/orgLimitCap.d.ts +56 -0
  43. package/admin/orm/models/orgLimitCap.js +100 -0
  44. package/admin/orm/models/orgLimitCapsDefault.d.ts +56 -0
  45. package/admin/orm/models/orgLimitCapsDefault.js +100 -0
  46. package/admin/orm/models/orgLimitCredit.d.ts +56 -0
  47. package/admin/orm/models/orgLimitCredit.js +100 -0
  48. package/admin/orm/mutation/index.d.ts +1 -16
  49. package/admin/orm/mutation/index.js +0 -12
  50. package/admin/orm/query-builder.js +24 -0
  51. package/auth/cli/commands.js +1 -3
  52. package/auth/cli/executor.d.ts +0 -5
  53. package/auth/orm/index.d.ts +0 -5
  54. package/auth/orm/input-types.d.ts +0 -38
  55. package/auth/orm/mutation/index.d.ts +1 -16
  56. package/auth/orm/mutation/index.js +0 -12
  57. package/auth/orm/query-builder.js +24 -0
  58. package/esm/admin/cli/commands/app-limit-cap.d.ts +8 -0
  59. package/esm/admin/cli/commands/app-limit-cap.js +270 -0
  60. package/esm/admin/cli/commands/app-limit-caps-default.d.ts +8 -0
  61. package/esm/admin/cli/commands/app-limit-caps-default.js +250 -0
  62. package/esm/admin/cli/commands/app-limit-credit-code-item.d.ts +8 -0
  63. package/esm/admin/cli/commands/app-limit-credit-code-item.js +290 -0
  64. package/esm/admin/cli/commands/app-limit-credit-code.d.ts +8 -0
  65. package/esm/admin/cli/commands/app-limit-credit-code.js +294 -0
  66. package/esm/admin/cli/commands/app-limit-credit-redemption.d.ts +8 -0
  67. package/esm/admin/cli/commands/app-limit-credit-redemption.js +248 -0
  68. package/esm/admin/cli/commands/app-limit-credit.d.ts +8 -0
  69. package/esm/admin/cli/commands/app-limit-credit.js +314 -0
  70. package/esm/admin/cli/commands/app-limit.js +66 -0
  71. package/esm/admin/cli/commands/org-limit-aggregate.js +88 -0
  72. package/esm/admin/cli/commands/org-limit-cap.d.ts +8 -0
  73. package/esm/admin/cli/commands/org-limit-cap.js +270 -0
  74. package/esm/admin/cli/commands/org-limit-caps-default.d.ts +8 -0
  75. package/esm/admin/cli/commands/org-limit-caps-default.js +250 -0
  76. package/esm/admin/cli/commands/org-limit-credit.d.ts +8 -0
  77. package/esm/admin/cli/commands/org-limit-credit.js +336 -0
  78. package/esm/admin/cli/commands/org-limit.js +66 -0
  79. package/esm/admin/cli/commands.js +25 -9
  80. package/esm/admin/cli/executor.d.ts +12 -8
  81. package/esm/admin/orm/index.d.ts +24 -11
  82. package/esm/admin/orm/index.js +24 -6
  83. package/esm/admin/orm/input-types.d.ts +2108 -545
  84. package/esm/admin/orm/input-types.js +13 -1
  85. package/esm/admin/orm/models/appLimitCap.d.ts +56 -0
  86. package/esm/admin/orm/models/appLimitCap.js +96 -0
  87. package/esm/admin/orm/models/appLimitCapsDefault.d.ts +56 -0
  88. package/esm/admin/orm/models/appLimitCapsDefault.js +96 -0
  89. package/esm/admin/orm/models/appLimitCredit.d.ts +56 -0
  90. package/esm/admin/orm/models/appLimitCredit.js +96 -0
  91. package/esm/admin/orm/models/appLimitCreditCode.d.ts +56 -0
  92. package/esm/admin/orm/models/appLimitCreditCode.js +96 -0
  93. package/esm/admin/orm/models/appLimitCreditCodeItem.d.ts +56 -0
  94. package/esm/admin/orm/models/appLimitCreditCodeItem.js +96 -0
  95. package/esm/admin/orm/models/appLimitCreditRedemption.d.ts +56 -0
  96. package/esm/admin/orm/models/appLimitCreditRedemption.js +96 -0
  97. package/esm/admin/orm/models/index.d.ts +12 -3
  98. package/esm/admin/orm/models/index.js +12 -3
  99. package/esm/admin/orm/models/orgLimitCap.d.ts +56 -0
  100. package/esm/admin/orm/models/orgLimitCap.js +96 -0
  101. package/esm/admin/orm/models/orgLimitCapsDefault.d.ts +56 -0
  102. package/esm/admin/orm/models/orgLimitCapsDefault.js +96 -0
  103. package/esm/admin/orm/models/orgLimitCredit.d.ts +56 -0
  104. package/esm/admin/orm/models/orgLimitCredit.js +96 -0
  105. package/esm/admin/orm/mutation/index.d.ts +1 -16
  106. package/esm/admin/orm/mutation/index.js +0 -12
  107. package/esm/admin/orm/query-builder.js +24 -0
  108. package/esm/auth/cli/commands.js +1 -3
  109. package/esm/auth/cli/executor.d.ts +0 -5
  110. package/esm/auth/orm/index.d.ts +0 -5
  111. package/esm/auth/orm/input-types.d.ts +0 -38
  112. package/esm/auth/orm/mutation/index.d.ts +1 -16
  113. package/esm/auth/orm/mutation/index.js +0 -12
  114. package/esm/auth/orm/query-builder.js +24 -0
  115. package/esm/objects/cli/commands.js +1 -3
  116. package/esm/objects/cli/executor.d.ts +0 -5
  117. package/esm/objects/orm/index.d.ts +0 -5
  118. package/esm/objects/orm/input-types.d.ts +0 -38
  119. package/esm/objects/orm/mutation/index.d.ts +1 -16
  120. package/esm/objects/orm/mutation/index.js +0 -12
  121. package/esm/objects/orm/query-builder.js +24 -0
  122. package/esm/public/cli/commands/api-setting.d.ts +8 -0
  123. package/esm/public/cli/commands/api-setting.js +468 -0
  124. package/esm/public/cli/commands/app-limit-cap.d.ts +8 -0
  125. package/esm/public/cli/commands/app-limit-cap.js +270 -0
  126. package/esm/public/cli/commands/app-limit-caps-default.d.ts +8 -0
  127. package/esm/public/cli/commands/app-limit-caps-default.js +250 -0
  128. package/esm/public/cli/commands/app-limit-credit-code-item.d.ts +8 -0
  129. package/esm/public/cli/commands/app-limit-credit-code-item.js +290 -0
  130. package/esm/public/cli/commands/app-limit-credit-code.d.ts +8 -0
  131. package/esm/public/cli/commands/app-limit-credit-code.js +294 -0
  132. package/esm/public/cli/commands/app-limit-credit-redemption.d.ts +8 -0
  133. package/esm/public/cli/commands/app-limit-credit-redemption.js +248 -0
  134. package/esm/public/cli/commands/app-limit-credit.d.ts +8 -0
  135. package/esm/public/cli/commands/app-limit-credit.js +314 -0
  136. package/esm/public/cli/commands/app-limit.js +66 -0
  137. package/esm/public/cli/commands/append-smart-tags.d.ts +8 -0
  138. package/esm/{admin/cli/commands/request-upload-url.js → public/cli/commands/append-smart-tags.js} +3 -3
  139. package/esm/public/cli/commands/billing-provider-module.d.ts +8 -0
  140. package/esm/public/cli/commands/billing-provider-module.js +624 -0
  141. package/esm/public/cli/commands/cors-setting.d.ts +8 -0
  142. package/esm/public/cli/commands/cors-setting.js +272 -0
  143. package/esm/public/cli/commands/database-setting.d.ts +8 -0
  144. package/esm/public/cli/commands/database-setting.js +448 -0
  145. package/esm/public/cli/commands/entity-type-provision.js +22 -0
  146. package/esm/public/cli/commands/function.d.ts +8 -0
  147. package/esm/public/cli/commands/function.js +268 -0
  148. package/esm/public/cli/commands/limits-module.js +198 -0
  149. package/esm/public/cli/commands/org-limit-aggregate.js +88 -0
  150. package/esm/public/cli/commands/org-limit-cap.d.ts +8 -0
  151. package/esm/public/cli/commands/org-limit-cap.js +270 -0
  152. package/esm/public/cli/commands/org-limit-caps-default.d.ts +8 -0
  153. package/esm/public/cli/commands/org-limit-caps-default.js +250 -0
  154. package/esm/public/cli/commands/org-limit-credit.d.ts +8 -0
  155. package/esm/public/cli/commands/org-limit-credit.js +336 -0
  156. package/esm/public/cli/commands/org-limit.js +66 -0
  157. package/esm/public/cli/commands/partition.d.ts +8 -0
  158. package/esm/public/cli/commands/partition.js +388 -0
  159. package/esm/public/cli/commands/plans-module.js +44 -0
  160. package/esm/public/cli/commands/pubkey-setting.d.ts +8 -0
  161. package/esm/public/cli/commands/pubkey-setting.js +382 -0
  162. package/esm/public/cli/commands/rls-setting.d.ts +8 -0
  163. package/esm/public/cli/commands/rls-setting.js +404 -0
  164. package/esm/public/cli/commands/storage-module.js +198 -0
  165. package/esm/public/cli/commands/webauthn-setting.d.ts +8 -0
  166. package/esm/public/cli/commands/webauthn-setting.js +580 -0
  167. package/esm/public/cli/commands.js +41 -5
  168. package/esm/public/cli/executor.d.ts +24 -6
  169. package/esm/public/orm/index.d.ts +43 -7
  170. package/esm/public/orm/index.js +38 -2
  171. package/esm/public/orm/input-types.d.ts +4601 -321
  172. package/esm/public/orm/input-types.js +21 -0
  173. package/esm/public/orm/models/apiSetting.d.ts +56 -0
  174. package/esm/public/orm/models/apiSetting.js +96 -0
  175. package/esm/public/orm/models/appLimitCap.d.ts +56 -0
  176. package/esm/public/orm/models/appLimitCap.js +96 -0
  177. package/esm/public/orm/models/appLimitCapsDefault.d.ts +56 -0
  178. package/esm/public/orm/models/appLimitCapsDefault.js +96 -0
  179. package/esm/public/orm/models/appLimitCredit.d.ts +56 -0
  180. package/esm/public/orm/models/appLimitCredit.js +96 -0
  181. package/esm/public/orm/models/appLimitCreditCode.d.ts +56 -0
  182. package/esm/public/orm/models/appLimitCreditCode.js +96 -0
  183. package/esm/public/orm/models/appLimitCreditCodeItem.d.ts +56 -0
  184. package/esm/public/orm/models/appLimitCreditCodeItem.js +96 -0
  185. package/esm/public/orm/models/appLimitCreditRedemption.d.ts +56 -0
  186. package/esm/public/orm/models/appLimitCreditRedemption.js +96 -0
  187. package/esm/public/orm/models/billingProviderModule.d.ts +56 -0
  188. package/esm/public/orm/models/billingProviderModule.js +96 -0
  189. package/esm/public/orm/models/corsSetting.d.ts +56 -0
  190. package/esm/public/orm/models/corsSetting.js +96 -0
  191. package/esm/public/orm/models/databaseSetting.d.ts +56 -0
  192. package/esm/public/orm/models/databaseSetting.js +96 -0
  193. package/esm/public/orm/models/function.d.ts +56 -0
  194. package/esm/public/orm/models/function.js +96 -0
  195. package/esm/public/orm/models/index.d.ts +19 -1
  196. package/esm/public/orm/models/index.js +19 -1
  197. package/esm/public/orm/models/orgLimitCap.d.ts +56 -0
  198. package/esm/public/orm/models/orgLimitCap.js +96 -0
  199. package/esm/public/orm/models/orgLimitCapsDefault.d.ts +56 -0
  200. package/esm/public/orm/models/orgLimitCapsDefault.js +96 -0
  201. package/esm/public/orm/models/orgLimitCredit.d.ts +56 -0
  202. package/esm/public/orm/models/orgLimitCredit.js +96 -0
  203. package/esm/public/orm/models/partition.d.ts +56 -0
  204. package/esm/public/orm/models/partition.js +96 -0
  205. package/esm/public/orm/models/pubkeySetting.d.ts +56 -0
  206. package/esm/public/orm/models/pubkeySetting.js +96 -0
  207. package/esm/public/orm/models/rlsSetting.d.ts +56 -0
  208. package/esm/public/orm/models/rlsSetting.js +96 -0
  209. package/esm/public/orm/models/webauthnSetting.d.ts +56 -0
  210. package/esm/public/orm/models/webauthnSetting.js +96 -0
  211. package/esm/public/orm/mutation/index.d.ts +9 -16
  212. package/esm/public/orm/mutation/index.js +12 -12
  213. package/esm/public/orm/query-builder.js +24 -0
  214. package/objects/cli/commands.js +1 -3
  215. package/objects/cli/executor.d.ts +0 -5
  216. package/objects/orm/index.d.ts +0 -5
  217. package/objects/orm/input-types.d.ts +0 -38
  218. package/objects/orm/mutation/index.d.ts +1 -16
  219. package/objects/orm/mutation/index.js +0 -12
  220. package/objects/orm/query-builder.js +24 -0
  221. package/package.json +4 -4
  222. package/public/cli/commands/api-setting.d.ts +8 -0
  223. package/public/cli/commands/api-setting.js +470 -0
  224. package/public/cli/commands/app-limit-cap.d.ts +8 -0
  225. package/public/cli/commands/app-limit-cap.js +272 -0
  226. package/public/cli/commands/app-limit-caps-default.d.ts +8 -0
  227. package/public/cli/commands/app-limit-caps-default.js +252 -0
  228. package/public/cli/commands/app-limit-credit-code-item.d.ts +8 -0
  229. package/public/cli/commands/app-limit-credit-code-item.js +292 -0
  230. package/public/cli/commands/app-limit-credit-code.d.ts +8 -0
  231. package/public/cli/commands/app-limit-credit-code.js +296 -0
  232. package/public/cli/commands/app-limit-credit-redemption.d.ts +8 -0
  233. package/public/cli/commands/app-limit-credit-redemption.js +250 -0
  234. package/public/cli/commands/app-limit-credit.d.ts +8 -0
  235. package/public/cli/commands/app-limit-credit.js +316 -0
  236. package/public/cli/commands/app-limit.js +66 -0
  237. package/public/cli/commands/append-smart-tags.d.ts +8 -0
  238. package/{objects/cli/commands/request-upload-url.js → public/cli/commands/append-smart-tags.js} +3 -3
  239. package/public/cli/commands/billing-provider-module.d.ts +8 -0
  240. package/public/cli/commands/billing-provider-module.js +626 -0
  241. package/public/cli/commands/cors-setting.d.ts +8 -0
  242. package/public/cli/commands/cors-setting.js +274 -0
  243. package/public/cli/commands/database-setting.d.ts +8 -0
  244. package/public/cli/commands/database-setting.js +450 -0
  245. package/public/cli/commands/entity-type-provision.js +22 -0
  246. package/public/cli/commands/function.d.ts +8 -0
  247. package/public/cli/commands/function.js +270 -0
  248. package/public/cli/commands/limits-module.js +198 -0
  249. package/public/cli/commands/org-limit-aggregate.js +88 -0
  250. package/public/cli/commands/org-limit-cap.d.ts +8 -0
  251. package/public/cli/commands/org-limit-cap.js +272 -0
  252. package/public/cli/commands/org-limit-caps-default.d.ts +8 -0
  253. package/public/cli/commands/org-limit-caps-default.js +252 -0
  254. package/public/cli/commands/org-limit-credit.d.ts +8 -0
  255. package/public/cli/commands/org-limit-credit.js +338 -0
  256. package/public/cli/commands/org-limit.js +66 -0
  257. package/public/cli/commands/partition.d.ts +8 -0
  258. package/public/cli/commands/partition.js +390 -0
  259. package/public/cli/commands/plans-module.js +44 -0
  260. package/public/cli/commands/pubkey-setting.d.ts +8 -0
  261. package/public/cli/commands/pubkey-setting.js +384 -0
  262. package/public/cli/commands/rls-setting.d.ts +8 -0
  263. package/public/cli/commands/rls-setting.js +406 -0
  264. package/public/cli/commands/storage-module.js +198 -0
  265. package/public/cli/commands/webauthn-setting.d.ts +8 -0
  266. package/public/cli/commands/webauthn-setting.js +582 -0
  267. package/public/cli/commands.js +41 -5
  268. package/public/cli/executor.d.ts +24 -6
  269. package/public/orm/index.d.ts +43 -7
  270. package/public/orm/index.js +38 -2
  271. package/public/orm/input-types.d.ts +4601 -321
  272. package/public/orm/input-types.js +21 -0
  273. package/public/orm/models/apiSetting.d.ts +56 -0
  274. package/public/orm/models/apiSetting.js +100 -0
  275. package/public/orm/models/appLimitCap.d.ts +56 -0
  276. package/public/orm/models/appLimitCap.js +100 -0
  277. package/public/orm/models/appLimitCapsDefault.d.ts +56 -0
  278. package/public/orm/models/appLimitCapsDefault.js +100 -0
  279. package/public/orm/models/appLimitCredit.d.ts +56 -0
  280. package/public/orm/models/appLimitCredit.js +100 -0
  281. package/public/orm/models/appLimitCreditCode.d.ts +56 -0
  282. package/public/orm/models/appLimitCreditCode.js +100 -0
  283. package/public/orm/models/appLimitCreditCodeItem.d.ts +56 -0
  284. package/public/orm/models/appLimitCreditCodeItem.js +100 -0
  285. package/public/orm/models/appLimitCreditRedemption.d.ts +56 -0
  286. package/public/orm/models/appLimitCreditRedemption.js +100 -0
  287. package/public/orm/models/billingProviderModule.d.ts +56 -0
  288. package/public/orm/models/billingProviderModule.js +100 -0
  289. package/public/orm/models/corsSetting.d.ts +56 -0
  290. package/public/orm/models/corsSetting.js +100 -0
  291. package/public/orm/models/databaseSetting.d.ts +56 -0
  292. package/public/orm/models/databaseSetting.js +100 -0
  293. package/public/orm/models/function.d.ts +56 -0
  294. package/public/orm/models/function.js +100 -0
  295. package/public/orm/models/index.d.ts +19 -1
  296. package/public/orm/models/index.js +41 -5
  297. package/public/orm/models/orgLimitCap.d.ts +56 -0
  298. package/public/orm/models/orgLimitCap.js +100 -0
  299. package/public/orm/models/orgLimitCapsDefault.d.ts +56 -0
  300. package/public/orm/models/orgLimitCapsDefault.js +100 -0
  301. package/public/orm/models/orgLimitCredit.d.ts +56 -0
  302. package/public/orm/models/orgLimitCredit.js +100 -0
  303. package/public/orm/models/partition.d.ts +56 -0
  304. package/public/orm/models/partition.js +100 -0
  305. package/public/orm/models/pubkeySetting.d.ts +56 -0
  306. package/public/orm/models/pubkeySetting.js +100 -0
  307. package/public/orm/models/rlsSetting.d.ts +56 -0
  308. package/public/orm/models/rlsSetting.js +100 -0
  309. package/public/orm/models/webauthnSetting.d.ts +56 -0
  310. package/public/orm/models/webauthnSetting.js +100 -0
  311. package/public/orm/mutation/index.d.ts +9 -16
  312. package/public/orm/mutation/index.js +12 -12
  313. package/public/orm/query-builder.js +24 -0
  314. package/admin/cli/commands/request-upload-url.js +0 -36
  315. package/auth/cli/commands/request-upload-url.js +0 -36
  316. package/esm/auth/cli/commands/request-upload-url.js +0 -34
  317. package/esm/objects/cli/commands/request-upload-url.d.ts +0 -8
  318. package/esm/objects/cli/commands/request-upload-url.js +0 -34
  319. package/esm/public/cli/commands/request-upload-url.d.ts +0 -8
  320. package/esm/public/cli/commands/request-upload-url.js +0 -34
  321. package/objects/cli/commands/request-upload-url.d.ts +0 -8
  322. package/public/cli/commands/request-upload-url.d.ts +0 -8
  323. package/public/cli/commands/request-upload-url.js +0 -36
@@ -0,0 +1,268 @@
1
+ /**
2
+ * CLI commands for Function
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { extractFirst } from 'inquirerer';
7
+ import { getClient } from '../executor';
8
+ import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
9
+ const fieldSchema = {
10
+ id: 'uuid',
11
+ databaseId: 'uuid',
12
+ schemaId: 'uuid',
13
+ name: 'string',
14
+ };
15
+ const usage = '\nfunction <command>\n\nCommands:\n list List function records\n find-first Find first matching function record\n get Get a function by ID\n create Create a new function\n update Update an existing function\n delete Delete a function\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
+ export default async (argv, prompter, _options) => {
17
+ if (argv.help || argv.h) {
18
+ console.log(usage);
19
+ process.exit(0);
20
+ }
21
+ const { first: subcommand, newArgv } = extractFirst(argv);
22
+ if (!subcommand) {
23
+ const answer = await prompter.prompt(argv, [
24
+ {
25
+ type: 'autocomplete',
26
+ name: 'subcommand',
27
+ message: 'What do you want to do?',
28
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
29
+ },
30
+ ]);
31
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
32
+ }
33
+ return handleTableSubcommand(subcommand, newArgv, prompter);
34
+ };
35
+ async function handleTableSubcommand(subcommand, argv, prompter) {
36
+ switch (subcommand) {
37
+ case 'list':
38
+ return handleList(argv, prompter);
39
+ case 'find-first':
40
+ return handleFindFirst(argv, prompter);
41
+ case 'get':
42
+ return handleGet(argv, prompter);
43
+ case 'create':
44
+ return handleCreate(argv, prompter);
45
+ case 'update':
46
+ return handleUpdate(argv, prompter);
47
+ case 'delete':
48
+ return handleDelete(argv, prompter);
49
+ default:
50
+ console.log(usage);
51
+ process.exit(1);
52
+ }
53
+ }
54
+ async function handleList(argv, _prompter) {
55
+ try {
56
+ const defaultSelect = {
57
+ id: true,
58
+ databaseId: true,
59
+ schemaId: true,
60
+ name: true,
61
+ };
62
+ const findManyArgs = parseFindManyArgs(argv, defaultSelect);
63
+ const client = getClient();
64
+ const result = await client.function.findMany(findManyArgs).execute();
65
+ console.log(JSON.stringify(result, null, 2));
66
+ }
67
+ catch (error) {
68
+ console.error('Failed to list records.');
69
+ if (error instanceof Error) {
70
+ console.error(error.message);
71
+ }
72
+ process.exit(1);
73
+ }
74
+ }
75
+ async function handleFindFirst(argv, _prompter) {
76
+ try {
77
+ const defaultSelect = {
78
+ id: true,
79
+ databaseId: true,
80
+ schemaId: true,
81
+ name: true,
82
+ };
83
+ const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
84
+ const client = getClient();
85
+ const result = await client.function.findFirst(findFirstArgs).execute();
86
+ console.log(JSON.stringify(result, null, 2));
87
+ }
88
+ catch (error) {
89
+ console.error('Failed to find record.');
90
+ if (error instanceof Error) {
91
+ console.error(error.message);
92
+ }
93
+ process.exit(1);
94
+ }
95
+ }
96
+ async function handleGet(argv, prompter) {
97
+ try {
98
+ const answers = await prompter.prompt(argv, [
99
+ {
100
+ type: 'text',
101
+ name: 'id',
102
+ message: 'id',
103
+ required: true,
104
+ },
105
+ ]);
106
+ const client = getClient();
107
+ const result = await client.function
108
+ .findOne({
109
+ id: answers.id,
110
+ select: {
111
+ id: true,
112
+ databaseId: true,
113
+ schemaId: true,
114
+ name: true,
115
+ },
116
+ })
117
+ .execute();
118
+ console.log(JSON.stringify(result, null, 2));
119
+ }
120
+ catch (error) {
121
+ console.error('Record not found.');
122
+ if (error instanceof Error) {
123
+ console.error(error.message);
124
+ }
125
+ process.exit(1);
126
+ }
127
+ }
128
+ async function handleCreate(argv, prompter) {
129
+ try {
130
+ const rawAnswers = await prompter.prompt(argv, [
131
+ {
132
+ type: 'text',
133
+ name: 'databaseId',
134
+ message: 'databaseId',
135
+ required: true,
136
+ },
137
+ {
138
+ type: 'text',
139
+ name: 'schemaId',
140
+ message: 'schemaId',
141
+ required: true,
142
+ },
143
+ {
144
+ type: 'text',
145
+ name: 'name',
146
+ message: 'name',
147
+ required: true,
148
+ },
149
+ ]);
150
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
151
+ const cleanedData = stripUndefined(answers, fieldSchema);
152
+ const client = getClient();
153
+ const result = await client.function
154
+ .create({
155
+ data: {
156
+ databaseId: cleanedData.databaseId,
157
+ schemaId: cleanedData.schemaId,
158
+ name: cleanedData.name,
159
+ },
160
+ select: {
161
+ id: true,
162
+ databaseId: true,
163
+ schemaId: true,
164
+ name: true,
165
+ },
166
+ })
167
+ .execute();
168
+ console.log(JSON.stringify(result, null, 2));
169
+ }
170
+ catch (error) {
171
+ console.error('Failed to create record.');
172
+ if (error instanceof Error) {
173
+ console.error(error.message);
174
+ }
175
+ process.exit(1);
176
+ }
177
+ }
178
+ async function handleUpdate(argv, prompter) {
179
+ try {
180
+ const rawAnswers = await prompter.prompt(argv, [
181
+ {
182
+ type: 'text',
183
+ name: 'id',
184
+ message: 'id',
185
+ required: true,
186
+ },
187
+ {
188
+ type: 'text',
189
+ name: 'databaseId',
190
+ message: 'databaseId',
191
+ required: false,
192
+ },
193
+ {
194
+ type: 'text',
195
+ name: 'schemaId',
196
+ message: 'schemaId',
197
+ required: false,
198
+ },
199
+ {
200
+ type: 'text',
201
+ name: 'name',
202
+ message: 'name',
203
+ required: false,
204
+ },
205
+ ]);
206
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
207
+ const cleanedData = stripUndefined(answers, fieldSchema);
208
+ const client = getClient();
209
+ const result = await client.function
210
+ .update({
211
+ where: {
212
+ id: answers.id,
213
+ },
214
+ data: {
215
+ databaseId: cleanedData.databaseId,
216
+ schemaId: cleanedData.schemaId,
217
+ name: cleanedData.name,
218
+ },
219
+ select: {
220
+ id: true,
221
+ databaseId: true,
222
+ schemaId: true,
223
+ name: true,
224
+ },
225
+ })
226
+ .execute();
227
+ console.log(JSON.stringify(result, null, 2));
228
+ }
229
+ catch (error) {
230
+ console.error('Failed to update record.');
231
+ if (error instanceof Error) {
232
+ console.error(error.message);
233
+ }
234
+ process.exit(1);
235
+ }
236
+ }
237
+ async function handleDelete(argv, prompter) {
238
+ try {
239
+ const rawAnswers = await prompter.prompt(argv, [
240
+ {
241
+ type: 'text',
242
+ name: 'id',
243
+ message: 'id',
244
+ required: true,
245
+ },
246
+ ]);
247
+ const answers = coerceAnswers(rawAnswers, fieldSchema);
248
+ const client = getClient();
249
+ const result = await client.function
250
+ .delete({
251
+ where: {
252
+ id: answers.id,
253
+ },
254
+ select: {
255
+ id: true,
256
+ },
257
+ })
258
+ .execute();
259
+ console.log(JSON.stringify(result, null, 2));
260
+ }
261
+ catch (error) {
262
+ console.error('Failed to delete record.');
263
+ if (error instanceof Error) {
264
+ console.error(error.message);
265
+ }
266
+ process.exit(1);
267
+ }
268
+ }
@@ -21,7 +21,16 @@ const fieldSchema = {
21
21
  limitDecrementTrigger: 'string',
22
22
  limitUpdateTrigger: 'string',
23
23
  limitCheckFunction: 'string',
24
+ limitCreditsTableId: 'uuid',
25
+ eventsTableId: 'uuid',
26
+ creditCodesTableId: 'uuid',
27
+ creditCodeItemsTableId: 'uuid',
28
+ creditRedemptionsTableId: 'uuid',
24
29
  aggregateTableId: 'uuid',
30
+ limitCapsTableId: 'uuid',
31
+ limitCapsDefaultsTableId: 'uuid',
32
+ capCheckTrigger: 'string',
33
+ resolveCapFunction: 'string',
25
34
  prefix: 'string',
26
35
  membershipType: 'int',
27
36
  entityTableId: 'uuid',
@@ -83,7 +92,16 @@ async function handleList(argv, _prompter) {
83
92
  limitDecrementTrigger: true,
84
93
  limitUpdateTrigger: true,
85
94
  limitCheckFunction: true,
95
+ limitCreditsTableId: true,
96
+ eventsTableId: true,
97
+ creditCodesTableId: true,
98
+ creditCodeItemsTableId: true,
99
+ creditRedemptionsTableId: true,
86
100
  aggregateTableId: true,
101
+ limitCapsTableId: true,
102
+ limitCapsDefaultsTableId: true,
103
+ capCheckTrigger: true,
104
+ resolveCapFunction: true,
87
105
  prefix: true,
88
106
  membershipType: true,
89
107
  entityTableId: true,
@@ -119,7 +137,16 @@ async function handleFindFirst(argv, _prompter) {
119
137
  limitDecrementTrigger: true,
120
138
  limitUpdateTrigger: true,
121
139
  limitCheckFunction: true,
140
+ limitCreditsTableId: true,
141
+ eventsTableId: true,
142
+ creditCodesTableId: true,
143
+ creditCodeItemsTableId: true,
144
+ creditRedemptionsTableId: true,
122
145
  aggregateTableId: true,
146
+ limitCapsTableId: true,
147
+ limitCapsDefaultsTableId: true,
148
+ capCheckTrigger: true,
149
+ resolveCapFunction: true,
123
150
  prefix: true,
124
151
  membershipType: true,
125
152
  entityTableId: true,
@@ -167,7 +194,16 @@ async function handleGet(argv, prompter) {
167
194
  limitDecrementTrigger: true,
168
195
  limitUpdateTrigger: true,
169
196
  limitCheckFunction: true,
197
+ limitCreditsTableId: true,
198
+ eventsTableId: true,
199
+ creditCodesTableId: true,
200
+ creditCodeItemsTableId: true,
201
+ creditRedemptionsTableId: true,
170
202
  aggregateTableId: true,
203
+ limitCapsTableId: true,
204
+ limitCapsDefaultsTableId: true,
205
+ capCheckTrigger: true,
206
+ resolveCapFunction: true,
171
207
  prefix: true,
172
208
  membershipType: true,
173
209
  entityTableId: true,
@@ -278,6 +314,41 @@ async function handleCreate(argv, prompter) {
278
314
  required: false,
279
315
  skipPrompt: true,
280
316
  },
317
+ {
318
+ type: 'text',
319
+ name: 'limitCreditsTableId',
320
+ message: 'limitCreditsTableId',
321
+ required: false,
322
+ skipPrompt: true,
323
+ },
324
+ {
325
+ type: 'text',
326
+ name: 'eventsTableId',
327
+ message: 'eventsTableId',
328
+ required: false,
329
+ skipPrompt: true,
330
+ },
331
+ {
332
+ type: 'text',
333
+ name: 'creditCodesTableId',
334
+ message: 'creditCodesTableId',
335
+ required: false,
336
+ skipPrompt: true,
337
+ },
338
+ {
339
+ type: 'text',
340
+ name: 'creditCodeItemsTableId',
341
+ message: 'creditCodeItemsTableId',
342
+ required: false,
343
+ skipPrompt: true,
344
+ },
345
+ {
346
+ type: 'text',
347
+ name: 'creditRedemptionsTableId',
348
+ message: 'creditRedemptionsTableId',
349
+ required: false,
350
+ skipPrompt: true,
351
+ },
281
352
  {
282
353
  type: 'text',
283
354
  name: 'aggregateTableId',
@@ -285,6 +356,34 @@ async function handleCreate(argv, prompter) {
285
356
  required: false,
286
357
  skipPrompt: true,
287
358
  },
359
+ {
360
+ type: 'text',
361
+ name: 'limitCapsTableId',
362
+ message: 'limitCapsTableId',
363
+ required: false,
364
+ skipPrompt: true,
365
+ },
366
+ {
367
+ type: 'text',
368
+ name: 'limitCapsDefaultsTableId',
369
+ message: 'limitCapsDefaultsTableId',
370
+ required: false,
371
+ skipPrompt: true,
372
+ },
373
+ {
374
+ type: 'text',
375
+ name: 'capCheckTrigger',
376
+ message: 'capCheckTrigger',
377
+ required: false,
378
+ skipPrompt: true,
379
+ },
380
+ {
381
+ type: 'text',
382
+ name: 'resolveCapFunction',
383
+ message: 'resolveCapFunction',
384
+ required: false,
385
+ skipPrompt: true,
386
+ },
288
387
  {
289
388
  type: 'text',
290
389
  name: 'prefix',
@@ -332,7 +431,16 @@ async function handleCreate(argv, prompter) {
332
431
  limitDecrementTrigger: cleanedData.limitDecrementTrigger,
333
432
  limitUpdateTrigger: cleanedData.limitUpdateTrigger,
334
433
  limitCheckFunction: cleanedData.limitCheckFunction,
434
+ limitCreditsTableId: cleanedData.limitCreditsTableId,
435
+ eventsTableId: cleanedData.eventsTableId,
436
+ creditCodesTableId: cleanedData.creditCodesTableId,
437
+ creditCodeItemsTableId: cleanedData.creditCodeItemsTableId,
438
+ creditRedemptionsTableId: cleanedData.creditRedemptionsTableId,
335
439
  aggregateTableId: cleanedData.aggregateTableId,
440
+ limitCapsTableId: cleanedData.limitCapsTableId,
441
+ limitCapsDefaultsTableId: cleanedData.limitCapsDefaultsTableId,
442
+ capCheckTrigger: cleanedData.capCheckTrigger,
443
+ resolveCapFunction: cleanedData.resolveCapFunction,
336
444
  prefix: cleanedData.prefix,
337
445
  membershipType: cleanedData.membershipType,
338
446
  entityTableId: cleanedData.entityTableId,
@@ -353,7 +461,16 @@ async function handleCreate(argv, prompter) {
353
461
  limitDecrementTrigger: true,
354
462
  limitUpdateTrigger: true,
355
463
  limitCheckFunction: true,
464
+ limitCreditsTableId: true,
465
+ eventsTableId: true,
466
+ creditCodesTableId: true,
467
+ creditCodeItemsTableId: true,
468
+ creditRedemptionsTableId: true,
356
469
  aggregateTableId: true,
470
+ limitCapsTableId: true,
471
+ limitCapsDefaultsTableId: true,
472
+ capCheckTrigger: true,
473
+ resolveCapFunction: true,
357
474
  prefix: true,
358
475
  membershipType: true,
359
476
  entityTableId: true,
@@ -470,6 +587,41 @@ async function handleUpdate(argv, prompter) {
470
587
  required: false,
471
588
  skipPrompt: true,
472
589
  },
590
+ {
591
+ type: 'text',
592
+ name: 'limitCreditsTableId',
593
+ message: 'limitCreditsTableId',
594
+ required: false,
595
+ skipPrompt: true,
596
+ },
597
+ {
598
+ type: 'text',
599
+ name: 'eventsTableId',
600
+ message: 'eventsTableId',
601
+ required: false,
602
+ skipPrompt: true,
603
+ },
604
+ {
605
+ type: 'text',
606
+ name: 'creditCodesTableId',
607
+ message: 'creditCodesTableId',
608
+ required: false,
609
+ skipPrompt: true,
610
+ },
611
+ {
612
+ type: 'text',
613
+ name: 'creditCodeItemsTableId',
614
+ message: 'creditCodeItemsTableId',
615
+ required: false,
616
+ skipPrompt: true,
617
+ },
618
+ {
619
+ type: 'text',
620
+ name: 'creditRedemptionsTableId',
621
+ message: 'creditRedemptionsTableId',
622
+ required: false,
623
+ skipPrompt: true,
624
+ },
473
625
  {
474
626
  type: 'text',
475
627
  name: 'aggregateTableId',
@@ -477,6 +629,34 @@ async function handleUpdate(argv, prompter) {
477
629
  required: false,
478
630
  skipPrompt: true,
479
631
  },
632
+ {
633
+ type: 'text',
634
+ name: 'limitCapsTableId',
635
+ message: 'limitCapsTableId',
636
+ required: false,
637
+ skipPrompt: true,
638
+ },
639
+ {
640
+ type: 'text',
641
+ name: 'limitCapsDefaultsTableId',
642
+ message: 'limitCapsDefaultsTableId',
643
+ required: false,
644
+ skipPrompt: true,
645
+ },
646
+ {
647
+ type: 'text',
648
+ name: 'capCheckTrigger',
649
+ message: 'capCheckTrigger',
650
+ required: false,
651
+ skipPrompt: true,
652
+ },
653
+ {
654
+ type: 'text',
655
+ name: 'resolveCapFunction',
656
+ message: 'resolveCapFunction',
657
+ required: false,
658
+ skipPrompt: true,
659
+ },
480
660
  {
481
661
  type: 'text',
482
662
  name: 'prefix',
@@ -527,7 +707,16 @@ async function handleUpdate(argv, prompter) {
527
707
  limitDecrementTrigger: cleanedData.limitDecrementTrigger,
528
708
  limitUpdateTrigger: cleanedData.limitUpdateTrigger,
529
709
  limitCheckFunction: cleanedData.limitCheckFunction,
710
+ limitCreditsTableId: cleanedData.limitCreditsTableId,
711
+ eventsTableId: cleanedData.eventsTableId,
712
+ creditCodesTableId: cleanedData.creditCodesTableId,
713
+ creditCodeItemsTableId: cleanedData.creditCodeItemsTableId,
714
+ creditRedemptionsTableId: cleanedData.creditRedemptionsTableId,
530
715
  aggregateTableId: cleanedData.aggregateTableId,
716
+ limitCapsTableId: cleanedData.limitCapsTableId,
717
+ limitCapsDefaultsTableId: cleanedData.limitCapsDefaultsTableId,
718
+ capCheckTrigger: cleanedData.capCheckTrigger,
719
+ resolveCapFunction: cleanedData.resolveCapFunction,
531
720
  prefix: cleanedData.prefix,
532
721
  membershipType: cleanedData.membershipType,
533
722
  entityTableId: cleanedData.entityTableId,
@@ -548,7 +737,16 @@ async function handleUpdate(argv, prompter) {
548
737
  limitDecrementTrigger: true,
549
738
  limitUpdateTrigger: true,
550
739
  limitCheckFunction: true,
740
+ limitCreditsTableId: true,
741
+ eventsTableId: true,
742
+ creditCodesTableId: true,
743
+ creditCodeItemsTableId: true,
744
+ creditRedemptionsTableId: true,
551
745
  aggregateTableId: true,
746
+ limitCapsTableId: true,
747
+ limitCapsDefaultsTableId: true,
748
+ capCheckTrigger: true,
749
+ resolveCapFunction: true,
552
750
  prefix: true,
553
751
  membershipType: true,
554
752
  entityTableId: true,