@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,270 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * CLI commands for Function
5
+ * @generated by @constructive-io/graphql-codegen
6
+ * DO NOT EDIT - changes will be overwritten
7
+ */
8
+ const inquirerer_1 = require("inquirerer");
9
+ const executor_1 = require("../executor");
10
+ const utils_1 = require("../utils");
11
+ const fieldSchema = {
12
+ id: 'uuid',
13
+ databaseId: 'uuid',
14
+ schemaId: 'uuid',
15
+ name: 'string',
16
+ };
17
+ 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';
18
+ exports.default = async (argv, prompter, _options) => {
19
+ if (argv.help || argv.h) {
20
+ console.log(usage);
21
+ process.exit(0);
22
+ }
23
+ const { first: subcommand, newArgv } = (0, inquirerer_1.extractFirst)(argv);
24
+ if (!subcommand) {
25
+ const answer = await prompter.prompt(argv, [
26
+ {
27
+ type: 'autocomplete',
28
+ name: 'subcommand',
29
+ message: 'What do you want to do?',
30
+ options: ['list', 'find-first', 'get', 'create', 'update', 'delete'],
31
+ },
32
+ ]);
33
+ return handleTableSubcommand(answer.subcommand, newArgv, prompter);
34
+ }
35
+ return handleTableSubcommand(subcommand, newArgv, prompter);
36
+ };
37
+ async function handleTableSubcommand(subcommand, argv, prompter) {
38
+ switch (subcommand) {
39
+ case 'list':
40
+ return handleList(argv, prompter);
41
+ case 'find-first':
42
+ return handleFindFirst(argv, prompter);
43
+ case 'get':
44
+ return handleGet(argv, prompter);
45
+ case 'create':
46
+ return handleCreate(argv, prompter);
47
+ case 'update':
48
+ return handleUpdate(argv, prompter);
49
+ case 'delete':
50
+ return handleDelete(argv, prompter);
51
+ default:
52
+ console.log(usage);
53
+ process.exit(1);
54
+ }
55
+ }
56
+ async function handleList(argv, _prompter) {
57
+ try {
58
+ const defaultSelect = {
59
+ id: true,
60
+ databaseId: true,
61
+ schemaId: true,
62
+ name: true,
63
+ };
64
+ const findManyArgs = (0, utils_1.parseFindManyArgs)(argv, defaultSelect);
65
+ const client = (0, executor_1.getClient)();
66
+ const result = await client.function.findMany(findManyArgs).execute();
67
+ console.log(JSON.stringify(result, null, 2));
68
+ }
69
+ catch (error) {
70
+ console.error('Failed to list records.');
71
+ if (error instanceof Error) {
72
+ console.error(error.message);
73
+ }
74
+ process.exit(1);
75
+ }
76
+ }
77
+ async function handleFindFirst(argv, _prompter) {
78
+ try {
79
+ const defaultSelect = {
80
+ id: true,
81
+ databaseId: true,
82
+ schemaId: true,
83
+ name: true,
84
+ };
85
+ const findFirstArgs = (0, utils_1.parseFindFirstArgs)(argv, defaultSelect);
86
+ const client = (0, executor_1.getClient)();
87
+ const result = await client.function.findFirst(findFirstArgs).execute();
88
+ console.log(JSON.stringify(result, null, 2));
89
+ }
90
+ catch (error) {
91
+ console.error('Failed to find record.');
92
+ if (error instanceof Error) {
93
+ console.error(error.message);
94
+ }
95
+ process.exit(1);
96
+ }
97
+ }
98
+ async function handleGet(argv, prompter) {
99
+ try {
100
+ const answers = await prompter.prompt(argv, [
101
+ {
102
+ type: 'text',
103
+ name: 'id',
104
+ message: 'id',
105
+ required: true,
106
+ },
107
+ ]);
108
+ const client = (0, executor_1.getClient)();
109
+ const result = await client.function
110
+ .findOne({
111
+ id: answers.id,
112
+ select: {
113
+ id: true,
114
+ databaseId: true,
115
+ schemaId: true,
116
+ name: true,
117
+ },
118
+ })
119
+ .execute();
120
+ console.log(JSON.stringify(result, null, 2));
121
+ }
122
+ catch (error) {
123
+ console.error('Record not found.');
124
+ if (error instanceof Error) {
125
+ console.error(error.message);
126
+ }
127
+ process.exit(1);
128
+ }
129
+ }
130
+ async function handleCreate(argv, prompter) {
131
+ try {
132
+ const rawAnswers = await prompter.prompt(argv, [
133
+ {
134
+ type: 'text',
135
+ name: 'databaseId',
136
+ message: 'databaseId',
137
+ required: true,
138
+ },
139
+ {
140
+ type: 'text',
141
+ name: 'schemaId',
142
+ message: 'schemaId',
143
+ required: true,
144
+ },
145
+ {
146
+ type: 'text',
147
+ name: 'name',
148
+ message: 'name',
149
+ required: true,
150
+ },
151
+ ]);
152
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
153
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
154
+ const client = (0, executor_1.getClient)();
155
+ const result = await client.function
156
+ .create({
157
+ data: {
158
+ databaseId: cleanedData.databaseId,
159
+ schemaId: cleanedData.schemaId,
160
+ name: cleanedData.name,
161
+ },
162
+ select: {
163
+ id: true,
164
+ databaseId: true,
165
+ schemaId: true,
166
+ name: true,
167
+ },
168
+ })
169
+ .execute();
170
+ console.log(JSON.stringify(result, null, 2));
171
+ }
172
+ catch (error) {
173
+ console.error('Failed to create record.');
174
+ if (error instanceof Error) {
175
+ console.error(error.message);
176
+ }
177
+ process.exit(1);
178
+ }
179
+ }
180
+ async function handleUpdate(argv, prompter) {
181
+ try {
182
+ const rawAnswers = await prompter.prompt(argv, [
183
+ {
184
+ type: 'text',
185
+ name: 'id',
186
+ message: 'id',
187
+ required: true,
188
+ },
189
+ {
190
+ type: 'text',
191
+ name: 'databaseId',
192
+ message: 'databaseId',
193
+ required: false,
194
+ },
195
+ {
196
+ type: 'text',
197
+ name: 'schemaId',
198
+ message: 'schemaId',
199
+ required: false,
200
+ },
201
+ {
202
+ type: 'text',
203
+ name: 'name',
204
+ message: 'name',
205
+ required: false,
206
+ },
207
+ ]);
208
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
209
+ const cleanedData = (0, utils_1.stripUndefined)(answers, fieldSchema);
210
+ const client = (0, executor_1.getClient)();
211
+ const result = await client.function
212
+ .update({
213
+ where: {
214
+ id: answers.id,
215
+ },
216
+ data: {
217
+ databaseId: cleanedData.databaseId,
218
+ schemaId: cleanedData.schemaId,
219
+ name: cleanedData.name,
220
+ },
221
+ select: {
222
+ id: true,
223
+ databaseId: true,
224
+ schemaId: true,
225
+ name: true,
226
+ },
227
+ })
228
+ .execute();
229
+ console.log(JSON.stringify(result, null, 2));
230
+ }
231
+ catch (error) {
232
+ console.error('Failed to update record.');
233
+ if (error instanceof Error) {
234
+ console.error(error.message);
235
+ }
236
+ process.exit(1);
237
+ }
238
+ }
239
+ async function handleDelete(argv, prompter) {
240
+ try {
241
+ const rawAnswers = await prompter.prompt(argv, [
242
+ {
243
+ type: 'text',
244
+ name: 'id',
245
+ message: 'id',
246
+ required: true,
247
+ },
248
+ ]);
249
+ const answers = (0, utils_1.coerceAnswers)(rawAnswers, fieldSchema);
250
+ const client = (0, executor_1.getClient)();
251
+ const result = await client.function
252
+ .delete({
253
+ where: {
254
+ id: answers.id,
255
+ },
256
+ select: {
257
+ id: true,
258
+ },
259
+ })
260
+ .execute();
261
+ console.log(JSON.stringify(result, null, 2));
262
+ }
263
+ catch (error) {
264
+ console.error('Failed to delete record.');
265
+ if (error instanceof Error) {
266
+ console.error(error.message);
267
+ }
268
+ process.exit(1);
269
+ }
270
+ }
@@ -23,7 +23,16 @@ const fieldSchema = {
23
23
  limitDecrementTrigger: 'string',
24
24
  limitUpdateTrigger: 'string',
25
25
  limitCheckFunction: 'string',
26
+ limitCreditsTableId: 'uuid',
27
+ eventsTableId: 'uuid',
28
+ creditCodesTableId: 'uuid',
29
+ creditCodeItemsTableId: 'uuid',
30
+ creditRedemptionsTableId: 'uuid',
26
31
  aggregateTableId: 'uuid',
32
+ limitCapsTableId: 'uuid',
33
+ limitCapsDefaultsTableId: 'uuid',
34
+ capCheckTrigger: 'string',
35
+ resolveCapFunction: 'string',
27
36
  prefix: 'string',
28
37
  membershipType: 'int',
29
38
  entityTableId: 'uuid',
@@ -85,7 +94,16 @@ async function handleList(argv, _prompter) {
85
94
  limitDecrementTrigger: true,
86
95
  limitUpdateTrigger: true,
87
96
  limitCheckFunction: true,
97
+ limitCreditsTableId: true,
98
+ eventsTableId: true,
99
+ creditCodesTableId: true,
100
+ creditCodeItemsTableId: true,
101
+ creditRedemptionsTableId: true,
88
102
  aggregateTableId: true,
103
+ limitCapsTableId: true,
104
+ limitCapsDefaultsTableId: true,
105
+ capCheckTrigger: true,
106
+ resolveCapFunction: true,
89
107
  prefix: true,
90
108
  membershipType: true,
91
109
  entityTableId: true,
@@ -121,7 +139,16 @@ async function handleFindFirst(argv, _prompter) {
121
139
  limitDecrementTrigger: true,
122
140
  limitUpdateTrigger: true,
123
141
  limitCheckFunction: true,
142
+ limitCreditsTableId: true,
143
+ eventsTableId: true,
144
+ creditCodesTableId: true,
145
+ creditCodeItemsTableId: true,
146
+ creditRedemptionsTableId: true,
124
147
  aggregateTableId: true,
148
+ limitCapsTableId: true,
149
+ limitCapsDefaultsTableId: true,
150
+ capCheckTrigger: true,
151
+ resolveCapFunction: true,
125
152
  prefix: true,
126
153
  membershipType: true,
127
154
  entityTableId: true,
@@ -169,7 +196,16 @@ async function handleGet(argv, prompter) {
169
196
  limitDecrementTrigger: true,
170
197
  limitUpdateTrigger: true,
171
198
  limitCheckFunction: true,
199
+ limitCreditsTableId: true,
200
+ eventsTableId: true,
201
+ creditCodesTableId: true,
202
+ creditCodeItemsTableId: true,
203
+ creditRedemptionsTableId: true,
172
204
  aggregateTableId: true,
205
+ limitCapsTableId: true,
206
+ limitCapsDefaultsTableId: true,
207
+ capCheckTrigger: true,
208
+ resolveCapFunction: true,
173
209
  prefix: true,
174
210
  membershipType: true,
175
211
  entityTableId: true,
@@ -280,6 +316,41 @@ async function handleCreate(argv, prompter) {
280
316
  required: false,
281
317
  skipPrompt: true,
282
318
  },
319
+ {
320
+ type: 'text',
321
+ name: 'limitCreditsTableId',
322
+ message: 'limitCreditsTableId',
323
+ required: false,
324
+ skipPrompt: true,
325
+ },
326
+ {
327
+ type: 'text',
328
+ name: 'eventsTableId',
329
+ message: 'eventsTableId',
330
+ required: false,
331
+ skipPrompt: true,
332
+ },
333
+ {
334
+ type: 'text',
335
+ name: 'creditCodesTableId',
336
+ message: 'creditCodesTableId',
337
+ required: false,
338
+ skipPrompt: true,
339
+ },
340
+ {
341
+ type: 'text',
342
+ name: 'creditCodeItemsTableId',
343
+ message: 'creditCodeItemsTableId',
344
+ required: false,
345
+ skipPrompt: true,
346
+ },
347
+ {
348
+ type: 'text',
349
+ name: 'creditRedemptionsTableId',
350
+ message: 'creditRedemptionsTableId',
351
+ required: false,
352
+ skipPrompt: true,
353
+ },
283
354
  {
284
355
  type: 'text',
285
356
  name: 'aggregateTableId',
@@ -287,6 +358,34 @@ async function handleCreate(argv, prompter) {
287
358
  required: false,
288
359
  skipPrompt: true,
289
360
  },
361
+ {
362
+ type: 'text',
363
+ name: 'limitCapsTableId',
364
+ message: 'limitCapsTableId',
365
+ required: false,
366
+ skipPrompt: true,
367
+ },
368
+ {
369
+ type: 'text',
370
+ name: 'limitCapsDefaultsTableId',
371
+ message: 'limitCapsDefaultsTableId',
372
+ required: false,
373
+ skipPrompt: true,
374
+ },
375
+ {
376
+ type: 'text',
377
+ name: 'capCheckTrigger',
378
+ message: 'capCheckTrigger',
379
+ required: false,
380
+ skipPrompt: true,
381
+ },
382
+ {
383
+ type: 'text',
384
+ name: 'resolveCapFunction',
385
+ message: 'resolveCapFunction',
386
+ required: false,
387
+ skipPrompt: true,
388
+ },
290
389
  {
291
390
  type: 'text',
292
391
  name: 'prefix',
@@ -334,7 +433,16 @@ async function handleCreate(argv, prompter) {
334
433
  limitDecrementTrigger: cleanedData.limitDecrementTrigger,
335
434
  limitUpdateTrigger: cleanedData.limitUpdateTrigger,
336
435
  limitCheckFunction: cleanedData.limitCheckFunction,
436
+ limitCreditsTableId: cleanedData.limitCreditsTableId,
437
+ eventsTableId: cleanedData.eventsTableId,
438
+ creditCodesTableId: cleanedData.creditCodesTableId,
439
+ creditCodeItemsTableId: cleanedData.creditCodeItemsTableId,
440
+ creditRedemptionsTableId: cleanedData.creditRedemptionsTableId,
337
441
  aggregateTableId: cleanedData.aggregateTableId,
442
+ limitCapsTableId: cleanedData.limitCapsTableId,
443
+ limitCapsDefaultsTableId: cleanedData.limitCapsDefaultsTableId,
444
+ capCheckTrigger: cleanedData.capCheckTrigger,
445
+ resolveCapFunction: cleanedData.resolveCapFunction,
338
446
  prefix: cleanedData.prefix,
339
447
  membershipType: cleanedData.membershipType,
340
448
  entityTableId: cleanedData.entityTableId,
@@ -355,7 +463,16 @@ async function handleCreate(argv, prompter) {
355
463
  limitDecrementTrigger: true,
356
464
  limitUpdateTrigger: true,
357
465
  limitCheckFunction: true,
466
+ limitCreditsTableId: true,
467
+ eventsTableId: true,
468
+ creditCodesTableId: true,
469
+ creditCodeItemsTableId: true,
470
+ creditRedemptionsTableId: true,
358
471
  aggregateTableId: true,
472
+ limitCapsTableId: true,
473
+ limitCapsDefaultsTableId: true,
474
+ capCheckTrigger: true,
475
+ resolveCapFunction: true,
359
476
  prefix: true,
360
477
  membershipType: true,
361
478
  entityTableId: true,
@@ -472,6 +589,41 @@ async function handleUpdate(argv, prompter) {
472
589
  required: false,
473
590
  skipPrompt: true,
474
591
  },
592
+ {
593
+ type: 'text',
594
+ name: 'limitCreditsTableId',
595
+ message: 'limitCreditsTableId',
596
+ required: false,
597
+ skipPrompt: true,
598
+ },
599
+ {
600
+ type: 'text',
601
+ name: 'eventsTableId',
602
+ message: 'eventsTableId',
603
+ required: false,
604
+ skipPrompt: true,
605
+ },
606
+ {
607
+ type: 'text',
608
+ name: 'creditCodesTableId',
609
+ message: 'creditCodesTableId',
610
+ required: false,
611
+ skipPrompt: true,
612
+ },
613
+ {
614
+ type: 'text',
615
+ name: 'creditCodeItemsTableId',
616
+ message: 'creditCodeItemsTableId',
617
+ required: false,
618
+ skipPrompt: true,
619
+ },
620
+ {
621
+ type: 'text',
622
+ name: 'creditRedemptionsTableId',
623
+ message: 'creditRedemptionsTableId',
624
+ required: false,
625
+ skipPrompt: true,
626
+ },
475
627
  {
476
628
  type: 'text',
477
629
  name: 'aggregateTableId',
@@ -479,6 +631,34 @@ async function handleUpdate(argv, prompter) {
479
631
  required: false,
480
632
  skipPrompt: true,
481
633
  },
634
+ {
635
+ type: 'text',
636
+ name: 'limitCapsTableId',
637
+ message: 'limitCapsTableId',
638
+ required: false,
639
+ skipPrompt: true,
640
+ },
641
+ {
642
+ type: 'text',
643
+ name: 'limitCapsDefaultsTableId',
644
+ message: 'limitCapsDefaultsTableId',
645
+ required: false,
646
+ skipPrompt: true,
647
+ },
648
+ {
649
+ type: 'text',
650
+ name: 'capCheckTrigger',
651
+ message: 'capCheckTrigger',
652
+ required: false,
653
+ skipPrompt: true,
654
+ },
655
+ {
656
+ type: 'text',
657
+ name: 'resolveCapFunction',
658
+ message: 'resolveCapFunction',
659
+ required: false,
660
+ skipPrompt: true,
661
+ },
482
662
  {
483
663
  type: 'text',
484
664
  name: 'prefix',
@@ -529,7 +709,16 @@ async function handleUpdate(argv, prompter) {
529
709
  limitDecrementTrigger: cleanedData.limitDecrementTrigger,
530
710
  limitUpdateTrigger: cleanedData.limitUpdateTrigger,
531
711
  limitCheckFunction: cleanedData.limitCheckFunction,
712
+ limitCreditsTableId: cleanedData.limitCreditsTableId,
713
+ eventsTableId: cleanedData.eventsTableId,
714
+ creditCodesTableId: cleanedData.creditCodesTableId,
715
+ creditCodeItemsTableId: cleanedData.creditCodeItemsTableId,
716
+ creditRedemptionsTableId: cleanedData.creditRedemptionsTableId,
532
717
  aggregateTableId: cleanedData.aggregateTableId,
718
+ limitCapsTableId: cleanedData.limitCapsTableId,
719
+ limitCapsDefaultsTableId: cleanedData.limitCapsDefaultsTableId,
720
+ capCheckTrigger: cleanedData.capCheckTrigger,
721
+ resolveCapFunction: cleanedData.resolveCapFunction,
533
722
  prefix: cleanedData.prefix,
534
723
  membershipType: cleanedData.membershipType,
535
724
  entityTableId: cleanedData.entityTableId,
@@ -550,7 +739,16 @@ async function handleUpdate(argv, prompter) {
550
739
  limitDecrementTrigger: true,
551
740
  limitUpdateTrigger: true,
552
741
  limitCheckFunction: true,
742
+ limitCreditsTableId: true,
743
+ eventsTableId: true,
744
+ creditCodesTableId: true,
745
+ creditCodeItemsTableId: true,
746
+ creditRedemptionsTableId: true,
553
747
  aggregateTableId: true,
748
+ limitCapsTableId: true,
749
+ limitCapsDefaultsTableId: true,
750
+ capCheckTrigger: true,
751
+ resolveCapFunction: true,
554
752
  prefix: true,
555
753
  membershipType: true,
556
754
  entityTableId: true,