@seliseblocks/cli-os 0.1.4 → 0.2.0

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 (392) hide show
  1. package/AI_USAGE_GUIDE.md +328 -58
  2. package/README.md +84 -47
  3. package/dist/commands/auth/client-credentials/delete.d.ts +1 -0
  4. package/dist/commands/auth/client-credentials/delete.js +23 -0
  5. package/dist/commands/auth/client-credentials/list.d.ts +1 -0
  6. package/dist/commands/auth/client-credentials/list.js +14 -0
  7. package/dist/commands/auth/client-credentials/save.d.ts +1 -0
  8. package/dist/commands/auth/client-credentials/save.js +41 -0
  9. package/dist/commands/auth/config/get.d.ts +1 -0
  10. package/dist/commands/auth/config/get.js +14 -0
  11. package/dist/commands/auth/config/save.d.ts +1 -0
  12. package/dist/commands/auth/config/save.js +37 -0
  13. package/dist/commands/auth/idp/create.d.ts +1 -0
  14. package/dist/commands/auth/idp/create.js +46 -0
  15. package/dist/commands/auth/idp/delete.d.ts +1 -0
  16. package/dist/commands/auth/idp/delete.js +23 -0
  17. package/dist/commands/auth/idp/get.d.ts +1 -0
  18. package/dist/commands/auth/idp/get.js +16 -0
  19. package/dist/commands/auth/idp/list.d.ts +1 -0
  20. package/dist/commands/auth/idp/list.js +14 -0
  21. package/dist/commands/auth/idp/status.d.ts +1 -0
  22. package/dist/commands/auth/idp/status.js +27 -0
  23. package/dist/commands/auth/idp/update.d.ts +7 -0
  24. package/dist/commands/auth/idp/update.js +45 -0
  25. package/dist/commands/auth/oidc-clients/delete.d.ts +1 -0
  26. package/dist/commands/auth/oidc-clients/delete.js +23 -0
  27. package/dist/commands/auth/oidc-clients/get.d.ts +1 -0
  28. package/dist/commands/auth/oidc-clients/get.js +16 -0
  29. package/dist/commands/auth/oidc-clients/list.d.ts +1 -0
  30. package/dist/commands/auth/oidc-clients/list.js +14 -0
  31. package/dist/commands/auth/oidc-clients/rotate-secret.d.ts +1 -0
  32. package/dist/commands/auth/oidc-clients/rotate-secret.js +23 -0
  33. package/dist/commands/auth/oidc-clients/save.d.ts +2 -0
  34. package/dist/commands/auth/oidc-clients/save.js +57 -0
  35. package/dist/commands/auth/refresh.js +1 -1
  36. package/dist/commands/data/config/create.d.ts +1 -0
  37. package/dist/commands/data/config/create.js +38 -0
  38. package/dist/commands/data/config/get.d.ts +1 -0
  39. package/dist/commands/data/config/get.js +14 -0
  40. package/dist/commands/data/config/update.d.ts +1 -0
  41. package/dist/commands/data/config/update.js +41 -0
  42. package/dist/commands/data/files/create-folder.d.ts +1 -0
  43. package/dist/commands/data/files/create-folder.js +34 -0
  44. package/dist/commands/data/files/delete-folder.d.ts +1 -0
  45. package/dist/commands/data/files/delete-folder.js +25 -0
  46. package/dist/commands/data/files/delete.d.ts +1 -0
  47. package/dist/commands/data/files/delete.js +28 -0
  48. package/dist/commands/data/files/dms-list.d.ts +1 -0
  49. package/dist/commands/data/files/dms-list.js +27 -0
  50. package/dist/commands/data/files/dms-upload.d.ts +6 -0
  51. package/dist/commands/data/files/dms-upload.js +41 -0
  52. package/dist/commands/data/files/get-many.d.ts +1 -0
  53. package/dist/commands/data/files/get-many.js +24 -0
  54. package/dist/commands/data/files/get.d.ts +1 -0
  55. package/dist/commands/data/files/get.js +21 -0
  56. package/dist/commands/data/files/info.d.ts +1 -0
  57. package/dist/commands/data/files/info.js +30 -0
  58. package/dist/commands/data/files/presigned-upload-url.d.ts +6 -0
  59. package/dist/commands/data/files/presigned-upload-url.js +34 -0
  60. package/dist/commands/data/files/update-additional-info.d.ts +1 -0
  61. package/dist/commands/data/files/update-additional-info.js +26 -0
  62. package/dist/commands/data/files/upload-to-local-storage.d.ts +5 -0
  63. package/dist/commands/data/files/upload-to-local-storage.js +55 -0
  64. package/dist/commands/data/files/upload-to-url.d.ts +8 -0
  65. package/dist/commands/data/files/upload-to-url.js +36 -0
  66. package/dist/commands/data/files/upload.d.ts +7 -0
  67. package/dist/commands/data/files/upload.js +145 -0
  68. package/dist/commands/data/rules/policy/delete.d.ts +1 -0
  69. package/dist/commands/data/rules/policy/delete.js +24 -0
  70. package/dist/commands/data/rules/policy/get.d.ts +1 -0
  71. package/dist/commands/data/rules/policy/get.js +17 -0
  72. package/dist/commands/data/schema/aggregation.d.ts +1 -0
  73. package/dist/commands/data/schema/aggregation.js +26 -0
  74. package/dist/commands/data/schema/change-logs.d.ts +1 -0
  75. package/dist/commands/data/schema/change-logs.js +14 -0
  76. package/dist/commands/data/schema/delete.d.ts +1 -0
  77. package/dist/commands/data/schema/delete.js +24 -0
  78. package/dist/commands/data/schema/fields.d.ts +5 -0
  79. package/dist/commands/data/schema/fields.js +39 -0
  80. package/dist/commands/data/schema/get-by-name.d.ts +1 -0
  81. package/dist/commands/data/schema/get-by-name.js +17 -0
  82. package/dist/commands/data/schema/get.d.ts +1 -0
  83. package/dist/commands/data/schema/get.js +17 -0
  84. package/dist/commands/data/schema/info/list.d.ts +1 -0
  85. package/dist/commands/data/schema/info/list.js +15 -0
  86. package/dist/commands/data/schema/info/save.d.ts +1 -0
  87. package/dist/commands/data/schema/info/save.js +34 -0
  88. package/dist/commands/data/schema/info/update.d.ts +1 -0
  89. package/dist/commands/data/schema/info/update.js +35 -0
  90. package/dist/commands/data/sync.d.ts +7 -0
  91. package/dist/commands/data/sync.js +46 -0
  92. package/dist/commands/data/validation/by-schema-field.d.ts +1 -0
  93. package/dist/commands/data/validation/by-schema-field.js +18 -0
  94. package/dist/commands/data/validation/by-schema.d.ts +1 -0
  95. package/dist/commands/data/validation/by-schema.js +17 -0
  96. package/dist/commands/data/validation/delete.d.ts +1 -0
  97. package/dist/commands/data/validation/delete.js +24 -0
  98. package/dist/commands/data/validation/get.d.ts +1 -0
  99. package/dist/commands/data/validation/get.js +17 -0
  100. package/dist/commands/data/validation/list.d.ts +1 -0
  101. package/dist/commands/data/validation/list.js +25 -0
  102. package/dist/commands/data/validation/save.d.ts +6 -0
  103. package/dist/commands/data/validation/save.js +44 -0
  104. package/dist/commands/deselect.js +12 -22
  105. package/dist/commands/iam/email/available.d.ts +1 -0
  106. package/dist/commands/iam/email/available.js +17 -0
  107. package/dist/commands/iam/me.js +4 -1
  108. package/dist/commands/iam/organizations/config-get.d.ts +1 -0
  109. package/dist/commands/iam/organizations/config-get.js +14 -0
  110. package/dist/commands/iam/organizations/config-save.d.ts +1 -0
  111. package/dist/commands/iam/organizations/config-save.js +34 -0
  112. package/dist/commands/iam/organizations/create.d.ts +1 -0
  113. package/dist/commands/iam/organizations/create.js +37 -0
  114. package/dist/commands/iam/organizations/get.d.ts +1 -0
  115. package/dist/commands/iam/organizations/get.js +16 -0
  116. package/dist/commands/iam/organizations/list.d.ts +1 -0
  117. package/dist/commands/iam/organizations/list.js +26 -0
  118. package/dist/commands/iam/organizations/my.d.ts +1 -0
  119. package/dist/commands/iam/organizations/my.js +14 -0
  120. package/dist/commands/iam/organizations/update.d.ts +1 -0
  121. package/dist/commands/iam/organizations/update.js +39 -0
  122. package/dist/commands/iam/permissions/by-severity.d.ts +1 -0
  123. package/dist/commands/iam/permissions/by-severity.js +14 -0
  124. package/dist/commands/iam/permissions/create.d.ts +1 -0
  125. package/dist/commands/iam/permissions/create.js +39 -0
  126. package/dist/commands/iam/permissions/get.d.ts +1 -0
  127. package/dist/commands/iam/permissions/get.js +16 -0
  128. package/dist/commands/iam/permissions/list.d.ts +1 -0
  129. package/dist/commands/iam/permissions/list.js +41 -0
  130. package/dist/commands/iam/permissions/update.d.ts +1 -0
  131. package/dist/commands/iam/permissions/update.js +40 -0
  132. package/dist/commands/iam/resources/features.d.ts +1 -0
  133. package/dist/commands/iam/resources/features.js +19 -0
  134. package/dist/commands/iam/resources/groups.d.ts +1 -0
  135. package/dist/commands/iam/resources/groups.js +14 -0
  136. package/dist/commands/iam/roles/assign-permissions.d.ts +1 -0
  137. package/dist/commands/iam/roles/assign-permissions.js +33 -0
  138. package/dist/commands/iam/roles/assignable.d.ts +1 -0
  139. package/dist/commands/iam/roles/assignable.js +14 -0
  140. package/dist/commands/iam/roles/create.d.ts +1 -0
  141. package/dist/commands/iam/roles/create.js +35 -0
  142. package/dist/commands/iam/roles/get.d.ts +1 -0
  143. package/dist/commands/iam/roles/get.js +16 -0
  144. package/dist/commands/iam/roles/list.d.ts +1 -0
  145. package/dist/commands/iam/roles/list.js +34 -0
  146. package/dist/commands/iam/roles/update.d.ts +1 -0
  147. package/dist/commands/iam/roles/update.js +35 -0
  148. package/dist/commands/iam/signup-settings/get.d.ts +1 -0
  149. package/dist/commands/iam/signup-settings/get.js +14 -0
  150. package/dist/commands/iam/signup-settings/save.d.ts +1 -0
  151. package/dist/commands/iam/signup-settings/save.js +32 -0
  152. package/dist/commands/iam/users/access-grant.d.ts +1 -0
  153. package/dist/commands/iam/users/access-grant.js +32 -0
  154. package/dist/commands/iam/users/access-revoke.d.ts +1 -0
  155. package/dist/commands/iam/users/access-revoke.js +24 -0
  156. package/dist/commands/iam/users/activate.d.ts +1 -0
  157. package/dist/commands/iam/users/activate.js +24 -0
  158. package/dist/commands/iam/users/create.d.ts +1 -0
  159. package/dist/commands/iam/users/create.js +39 -0
  160. package/dist/commands/iam/users/deactivate.d.ts +1 -0
  161. package/dist/commands/iam/users/deactivate.js +24 -0
  162. package/dist/commands/iam/users/exists.d.ts +1 -0
  163. package/dist/commands/iam/users/exists.js +17 -0
  164. package/dist/commands/iam/users/get.d.ts +1 -0
  165. package/dist/commands/iam/users/get.js +17 -0
  166. package/dist/commands/iam/users/list.d.ts +1 -0
  167. package/dist/commands/iam/users/list.js +34 -0
  168. package/dist/commands/iam/users/update.d.ts +1 -0
  169. package/dist/commands/iam/users/update.js +35 -0
  170. package/dist/commands/init.js +0 -12
  171. package/dist/commands/localization/assistant/translation-suggestion.d.ts +1 -0
  172. package/dist/commands/localization/assistant/translation-suggestion.js +35 -0
  173. package/dist/commands/localization/config/get-webhook.d.ts +1 -0
  174. package/dist/commands/localization/config/get-webhook.js +14 -0
  175. package/dist/commands/localization/config/save-webhook.d.ts +1 -0
  176. package/dist/commands/localization/config/save-webhook.js +47 -0
  177. package/dist/commands/localization/glossary/delete.d.ts +1 -0
  178. package/dist/commands/localization/glossary/delete.js +24 -0
  179. package/dist/commands/localization/glossary/get.d.ts +1 -0
  180. package/dist/commands/localization/glossary/get.js +17 -0
  181. package/dist/commands/localization/glossary/list.d.ts +1 -0
  182. package/dist/commands/localization/glossary/list.js +22 -0
  183. package/dist/commands/localization/glossary/save.d.ts +1 -0
  184. package/dist/commands/localization/glossary/save.js +38 -0
  185. package/dist/commands/localization/glossary/suggested.d.ts +1 -0
  186. package/dist/commands/localization/glossary/suggested.js +20 -0
  187. package/dist/commands/localization/key/delete-keys.d.ts +1 -0
  188. package/dist/commands/localization/key/delete-keys.js +28 -0
  189. package/dist/commands/localization/key/delete.d.ts +1 -0
  190. package/dist/commands/localization/key/delete.js +24 -0
  191. package/dist/commands/localization/key/generate-uilm-file.d.ts +1 -0
  192. package/dist/commands/localization/key/generate-uilm-file.js +29 -0
  193. package/dist/commands/localization/key/get-by-names.d.ts +1 -0
  194. package/dist/commands/localization/key/get-by-names.js +24 -0
  195. package/dist/commands/localization/key/get-language-file-generation-history.d.ts +1 -0
  196. package/dist/commands/localization/key/get-language-file-generation-history.js +19 -0
  197. package/dist/commands/localization/key/get-localization-timeline.d.ts +1 -0
  198. package/dist/commands/localization/key/get-localization-timeline.js +28 -0
  199. package/dist/commands/localization/key/get-timeline-by-operation-id.d.ts +1 -0
  200. package/dist/commands/localization/key/get-timeline-by-operation-id.js +21 -0
  201. package/dist/commands/localization/key/get-timeline.d.ts +1 -0
  202. package/dist/commands/localization/key/get-timeline.js +25 -0
  203. package/dist/commands/localization/key/get-uilm-exported-files.d.ts +1 -0
  204. package/dist/commands/localization/key/get-uilm-exported-files.js +22 -0
  205. package/dist/commands/localization/key/get-uilm-file.d.ts +1 -0
  206. package/dist/commands/localization/key/get-uilm-file.js +18 -0
  207. package/dist/commands/localization/key/get.d.ts +1 -0
  208. package/dist/commands/localization/key/get.js +17 -0
  209. package/dist/commands/localization/key/list.d.ts +1 -0
  210. package/dist/commands/localization/key/list.js +39 -0
  211. package/dist/commands/localization/key/rollback.d.ts +1 -0
  212. package/dist/commands/localization/key/rollback.js +24 -0
  213. package/dist/commands/localization/key/save.d.ts +1 -0
  214. package/dist/commands/localization/key/save.js +44 -0
  215. package/dist/commands/localization/key/translate-all.d.ts +1 -0
  216. package/dist/commands/localization/key/translate-all.js +30 -0
  217. package/dist/commands/localization/key/translate-and-export.d.ts +7 -0
  218. package/dist/commands/localization/key/translate-and-export.js +132 -0
  219. package/dist/commands/localization/key/translate-key.d.ts +1 -0
  220. package/dist/commands/localization/key/translate-key.js +27 -0
  221. package/dist/commands/localization/key/translate-keys.d.ts +1 -0
  222. package/dist/commands/localization/key/translate-keys.js +31 -0
  223. package/dist/commands/localization/key/uilm-export.d.ts +1 -0
  224. package/dist/commands/localization/key/uilm-export.js +33 -0
  225. package/dist/commands/localization/key/uilm-import.d.ts +1 -0
  226. package/dist/commands/localization/key/uilm-import.js +26 -0
  227. package/dist/commands/localization/language/delete.d.ts +1 -0
  228. package/dist/commands/localization/language/delete.js +24 -0
  229. package/dist/commands/localization/language/list-for-tenant.d.ts +1 -0
  230. package/dist/commands/localization/language/list-for-tenant.js +14 -0
  231. package/dist/commands/localization/language/list.d.ts +1 -0
  232. package/dist/commands/localization/language/list.js +14 -0
  233. package/dist/commands/localization/language/save.d.ts +1 -0
  234. package/dist/commands/localization/language/save.js +36 -0
  235. package/dist/commands/localization/language/set-default.d.ts +1 -0
  236. package/dist/commands/localization/language/set-default.js +24 -0
  237. package/dist/commands/localization/module/list-for-tenant.d.ts +1 -0
  238. package/dist/commands/localization/module/list-for-tenant.js +14 -0
  239. package/dist/commands/localization/module/list.d.ts +1 -0
  240. package/dist/commands/localization/module/list.js +14 -0
  241. package/dist/commands/localization/module/save.d.ts +1 -0
  242. package/dist/commands/localization/module/save.js +32 -0
  243. package/dist/commands/localization/module/tag-glossary.d.ts +1 -0
  244. package/dist/commands/localization/module/tag-glossary.js +28 -0
  245. package/dist/commands/login.js +32 -1
  246. package/dist/commands/mail/config/delete.d.ts +1 -0
  247. package/dist/commands/mail/config/delete.js +24 -0
  248. package/dist/commands/mail/config/duplicate.d.ts +1 -0
  249. package/dist/commands/mail/config/duplicate.js +24 -0
  250. package/dist/commands/mail/config/get.d.ts +1 -0
  251. package/dist/commands/mail/config/get.js +17 -0
  252. package/dist/commands/mail/config/list.d.ts +1 -0
  253. package/dist/commands/mail/config/list.js +14 -0
  254. package/dist/commands/mail/config/save.d.ts +1 -0
  255. package/dist/commands/mail/config/save.js +44 -0
  256. package/dist/commands/mail/mailbox/get.d.ts +1 -0
  257. package/dist/commands/mail/mailbox/get.js +17 -0
  258. package/dist/commands/mail/mailbox/list.d.ts +1 -0
  259. package/dist/commands/mail/mailbox/list.js +24 -0
  260. package/dist/commands/mail/send.d.ts +1 -0
  261. package/dist/commands/mail/send.js +40 -0
  262. package/dist/commands/mail/sendtoany.d.ts +1 -0
  263. package/dist/commands/mail/sendtoany.js +41 -0
  264. package/dist/commands/mail/template/clone.d.ts +1 -0
  265. package/dist/commands/mail/template/clone.js +33 -0
  266. package/dist/commands/mail/template/delete.d.ts +1 -0
  267. package/dist/commands/mail/template/delete.js +24 -0
  268. package/dist/commands/mail/template/get.d.ts +1 -0
  269. package/dist/commands/mail/template/get.js +17 -0
  270. package/dist/commands/mail/template/list.d.ts +1 -0
  271. package/dist/commands/mail/template/list.js +24 -0
  272. package/dist/commands/mail/template/save.d.ts +1 -0
  273. package/dist/commands/mail/template/save.js +37 -0
  274. package/dist/commands/mfa/backup-codes/generate.d.ts +1 -0
  275. package/dist/commands/mfa/backup-codes/generate.js +22 -0
  276. package/dist/commands/mfa/backup-codes/list.d.ts +1 -0
  277. package/dist/commands/mfa/backup-codes/list.js +14 -0
  278. package/dist/commands/mfa/backup-codes/use.d.ts +1 -0
  279. package/dist/commands/mfa/backup-codes/use.js +18 -0
  280. package/dist/commands/mfa/config-get.d.ts +1 -0
  281. package/dist/commands/mfa/config-get.js +14 -0
  282. package/dist/commands/mfa/config-save.d.ts +1 -0
  283. package/dist/commands/mfa/config-save.js +36 -0
  284. package/dist/commands/mfa/disable.d.ts +1 -0
  285. package/dist/commands/mfa/disable.js +22 -0
  286. package/dist/commands/mfa/generate.d.ts +1 -0
  287. package/dist/commands/mfa/generate.js +22 -0
  288. package/dist/commands/mfa/method-set.d.ts +1 -0
  289. package/dist/commands/mfa/method-set.js +20 -0
  290. package/dist/commands/mfa/resend.d.ts +1 -0
  291. package/dist/commands/mfa/resend.js +20 -0
  292. package/dist/commands/mfa/totp-enable.d.ts +10 -0
  293. package/dist/commands/mfa/totp-enable.js +52 -0
  294. package/dist/commands/mfa/totp-setup.d.ts +1 -0
  295. package/dist/commands/mfa/totp-setup.js +15 -0
  296. package/dist/commands/mfa/totp-verify-setup.d.ts +1 -0
  297. package/dist/commands/mfa/totp-verify-setup.js +17 -0
  298. package/dist/commands/mfa/verify.d.ts +1 -0
  299. package/dist/commands/mfa/verify.js +26 -0
  300. package/dist/commands/new/web.js +115 -15
  301. package/dist/commands/notification/delete.d.ts +1 -0
  302. package/dist/commands/notification/delete.js +24 -0
  303. package/dist/commands/notification/get.d.ts +1 -0
  304. package/dist/commands/notification/get.js +17 -0
  305. package/dist/commands/notification/list.d.ts +1 -0
  306. package/dist/commands/notification/list.js +22 -0
  307. package/dist/commands/notification/save.d.ts +1 -0
  308. package/dist/commands/notification/save.js +34 -0
  309. package/dist/commands/notifier/list.d.ts +1 -0
  310. package/dist/commands/notifier/list.js +23 -0
  311. package/dist/commands/notifier/mark-all-read.d.ts +1 -0
  312. package/dist/commands/notifier/mark-all-read.js +23 -0
  313. package/dist/commands/notifier/mark-read.d.ts +1 -0
  314. package/dist/commands/notifier/mark-read.js +24 -0
  315. package/dist/commands/notifier/notify.d.ts +1 -0
  316. package/dist/commands/notifier/notify.js +39 -0
  317. package/dist/commands/notifier/unread.d.ts +1 -0
  318. package/dist/commands/notifier/unread.js +25 -0
  319. package/dist/commands/projects/get.js +16 -14
  320. package/dist/commands/projects/list.js +2 -7
  321. package/dist/commands/release/builds/list.js +21 -3
  322. package/dist/commands/release/deploy.js +121 -30
  323. package/dist/commands/sdk/client.d.ts +1 -0
  324. package/dist/commands/sdk/client.js +99 -0
  325. package/dist/commands/secrets/get.d.ts +1 -0
  326. package/dist/commands/secrets/get.js +21 -0
  327. package/dist/commands/secrets/save.d.ts +1 -0
  328. package/dist/commands/secrets/save.js +51 -0
  329. package/dist/commands/skill/add.d.ts +1 -0
  330. package/dist/commands/skill/add.js +19 -0
  331. package/dist/commands/skill/list.d.ts +1 -0
  332. package/dist/commands/skill/list.js +15 -0
  333. package/dist/commands/skill/show.d.ts +1 -0
  334. package/dist/commands/skill/show.js +15 -0
  335. package/dist/commands/storage/config/delete.d.ts +1 -0
  336. package/dist/commands/storage/config/delete.js +24 -0
  337. package/dist/commands/storage/config/get.d.ts +1 -0
  338. package/dist/commands/storage/config/get.js +17 -0
  339. package/dist/commands/storage/config/list.d.ts +1 -0
  340. package/dist/commands/storage/config/list.js +14 -0
  341. package/dist/commands/storage/config/save.d.ts +1 -0
  342. package/dist/commands/storage/config/save.js +49 -0
  343. package/dist/commands/use.js +18 -3
  344. package/dist/index.js +965 -160
  345. package/dist/lib/api.d.ts +2 -1
  346. package/dist/lib/api.js +64 -20
  347. package/dist/lib/args.d.ts +3 -0
  348. package/dist/lib/args.js +15 -0
  349. package/dist/lib/auth.d.ts +6 -2
  350. package/dist/lib/auth.js +74 -35
  351. package/dist/lib/config.js +7 -7
  352. package/dist/lib/json-flag.d.ts +17 -0
  353. package/dist/lib/json-flag.js +55 -0
  354. package/dist/lib/project-info.d.ts +33 -0
  355. package/dist/lib/project-info.js +43 -0
  356. package/dist/lib/prompt.d.ts +2 -0
  357. package/dist/lib/prompt.js +28 -0
  358. package/dist/lib/scaffold-web/dashboard.js +1 -1
  359. package/dist/lib/scaffold-web/root-files.js +2 -2
  360. package/dist/lib/secret-store.js +7 -7
  361. package/dist/lib/skills.d.ts +17 -0
  362. package/dist/lib/skills.js +69 -0
  363. package/dist/lib/token.d.ts +2 -0
  364. package/dist/lib/token.js +12 -0
  365. package/dist/lib/workspace.d.ts +0 -4
  366. package/dist/lib/workspace.js +1 -2
  367. package/dist/skills/blocks-data-gateway-configuration/SKILL.md +204 -0
  368. package/dist/skills/blocks-data-gateway-crud/SKILL.md +223 -0
  369. package/dist/skills/blocks-data-storage/SKILL.md +161 -0
  370. package/dist/skills/blocks-frontend-local-https/SKILL.md +100 -0
  371. package/dist/skills/blocks-iam-access-control/SKILL.md +49 -0
  372. package/dist/skills/blocks-iam-access-control/flows/feature-gating.md +38 -0
  373. package/dist/skills/blocks-iam-access-control/flows/manage-roles-permissions.md +109 -0
  374. package/dist/skills/blocks-iam-account/SKILL.md +169 -0
  375. package/dist/skills/blocks-iam-mfa/SKILL.md +124 -0
  376. package/dist/skills/blocks-iam-organizations/SKILL.md +43 -0
  377. package/dist/skills/blocks-iam-organizations/flows/admin-mutations.md +89 -0
  378. package/dist/skills/blocks-iam-organizations/flows/read-and-switch.md +57 -0
  379. package/dist/skills/blocks-iam-sso-oidc-configuration/SKILL.md +89 -0
  380. package/dist/skills/blocks-iam-sso-oidc-implementation/SKILL.md +80 -0
  381. package/dist/skills/blocks-iam-users/SKILL.md +131 -0
  382. package/dist/skills/blocks-localization-configuration/SKILL.md +149 -0
  383. package/dist/skills/blocks-localization-implementation/SKILL.md +63 -0
  384. package/dist/skills/blocks-mail/SKILL.md +95 -0
  385. package/dist/skills/blocks-notification/SKILL.md +69 -0
  386. package/dist/skills/blocks-notifier/SKILL.md +107 -0
  387. package/dist/skills/blocks-onboarding/SKILL.md +78 -0
  388. package/dist/skills/blocks-release-deployment/SKILL.md +81 -0
  389. package/dist/skills/blocks-secrets/SKILL.md +81 -0
  390. package/dist/skills/blocks-storage-configuration/SKILL.md +93 -0
  391. package/dist/skills/lint.mjs +168 -0
  392. package/package.json +4 -4
@@ -0,0 +1,39 @@
1
+ import { booleanFlag, stringFlag } from "../../lib/args.js";
2
+ import { blocksRequest } from "../../lib/api.js";
3
+ import { confirmMutation } from "../../lib/confirm.js";
4
+ import { compact, jsonBodyFlag, jsonFlag, listFlag } from "../../lib/json-flag.js";
5
+ import { writeOutput } from "../../lib/output.js";
6
+ import { requestContext } from "../../lib/request-context.js";
7
+ import { parseCommand, selectedProject } from "../../lib/workspace.js";
8
+ const NOTIFIER_NOTIFY_API = "/logic/v4/Notifier/Notify";
9
+ export async function notifierNotify(argv) {
10
+ const { flags } = parseCommand(argv);
11
+ const body = {
12
+ ...(await jsonBodyFlag(flags)),
13
+ ...compact({
14
+ configurationName: stringFlag(flags, "configuration-name") || undefined,
15
+ connectionId: stringFlag(flags, "connection-id") || undefined,
16
+ contentAvailable: booleanFlag(flags, "content-available") || undefined,
17
+ denormalizedPayload: stringFlag(flags, "denormalized-payload") || undefined,
18
+ responseKey: stringFlag(flags, "response-key") || undefined,
19
+ responseValue: stringFlag(flags, "response-value") || undefined,
20
+ roles: listFlag(flags, "roles"),
21
+ saveDenormalizedPayloadAsAnObject: booleanFlag(flags, "save-denormalized-payload-as-object") || undefined,
22
+ subscriptionFilters: jsonFlag(flags, "subscription-filters"),
23
+ userIds: listFlag(flags, "user-ids")
24
+ })
25
+ };
26
+ if (booleanFlag(flags, "dry-run")) {
27
+ writeOutput({ dryRun: true, endpoint: NOTIFIER_NOTIFY_API, request: body }, flags);
28
+ return;
29
+ }
30
+ await confirmMutation(flags, "Send notification.");
31
+ const projectKey = await selectedProject(flags);
32
+ const result = await blocksRequest(NOTIFIER_NOTIFY_API, {
33
+ body,
34
+ impersonatedProjectAuth: true,
35
+ ...requestContext(flags),
36
+ projectTenantId: projectKey
37
+ });
38
+ writeOutput(result, flags);
39
+ }
@@ -0,0 +1 @@
1
+ export declare function notifierUnread(argv: string[]): Promise<void>;
@@ -0,0 +1,25 @@
1
+ import { optionalIntegerFlag, stringFlag } from "../../lib/args.js";
2
+ import { blocksRequest } from "../../lib/api.js";
3
+ import { writeOutput } from "../../lib/output.js";
4
+ import { requestContext } from "../../lib/request-context.js";
5
+ import { parseCommand, selectedProject } from "../../lib/workspace.js";
6
+ // Swagger documents GetUnreadNotificationsBySubscriptionFilter as GET with a JSON
7
+ // request body, which the Fetch spec forbids sending on a GET request. Sent as a
8
+ // flattened query string instead, matching every other GET endpoint in this API.
9
+ export async function notifierUnread(argv) {
10
+ const { flags } = parseCommand(argv);
11
+ const projectKey = await selectedProject(flags);
12
+ const result = await blocksRequest("/logic/v4/Notifier/GetUnreadNotificationsBySubscriptionFilter", {
13
+ impersonatedProjectAuth: true,
14
+ ...requestContext(flags),
15
+ projectTenantId: projectKey,
16
+ query: {
17
+ OrderBy: optionalIntegerFlag(flags, "order-by"),
18
+ "SubscriptionFilterData.ActionName": stringFlag(flags, "action-name") || undefined,
19
+ "SubscriptionFilterData.Context": stringFlag(flags, "context") || undefined,
20
+ "SubscriptionFilterData.Value": stringFlag(flags, "value") || undefined,
21
+ UserId: stringFlag(flags, "user-id") || undefined
22
+ }
23
+ });
24
+ writeOutput(result, flags);
25
+ }
@@ -1,21 +1,23 @@
1
- import { blocksRequest } from "../../lib/api.js";
1
+ import { booleanFlag } from "../../lib/args.js";
2
2
  import { writeOutput } from "../../lib/output.js";
3
- import { requestContext } from "../../lib/request-context.js";
3
+ import { findProjectByTenantId, getProjectAssets } from "../../lib/project-info.js";
4
4
  import { parseCommand, selectedProject } from "../../lib/workspace.js";
5
5
  export async function getProject(argv) {
6
6
  const { args, flags } = parseCommand(argv);
7
7
  const tenantId = args[0] || await selectedProject(flags);
8
- const groups = await blocksRequest("/os/v4/Project/Gets", {
9
- accountAuth: true,
10
- ...requestContext(flags),
11
- query: { page: 0, pageSize: 100, tenantGroupId: "" }
12
- });
13
- for (const group of groups) {
14
- const project = (group.projects ?? []).find((item) => item.tenantId === tenantId);
15
- if (project) {
16
- writeOutput({ group, project }, flags);
17
- return;
18
- }
8
+ const { group, project } = await findProjectByTenantId(tenantId, flags);
9
+ if (!booleanFlag(flags, "deployment") || !group.tenantGroupId) {
10
+ writeOutput({ group, project }, flags);
11
+ return;
19
12
  }
20
- throw new Error(`Project '${tenantId}' was not found in Project/Gets.`);
13
+ const assets = await getProjectAssets(group.tenantGroupId, flags);
14
+ writeOutput({
15
+ deployment: {
16
+ environment: project.environment,
17
+ repos: assets.assets?.resources ?? [],
18
+ tenantGroupId: group.tenantGroupId
19
+ },
20
+ group,
21
+ project
22
+ }, flags);
21
23
  }
@@ -1,14 +1,9 @@
1
- import { blocksRequest } from "../../lib/api.js";
1
+ import { listProjectGroups } from "../../lib/project-info.js";
2
2
  import { parseCommand } from "../../lib/workspace.js";
3
3
  import { writeOutput } from "../../lib/output.js";
4
- import { requestContext } from "../../lib/request-context.js";
5
4
  export async function listProjects(argv = []) {
6
5
  const { flags } = parseCommand(argv);
7
- const groups = await blocksRequest("/os/v4/Project/Gets", {
8
- accountAuth: true,
9
- ...requestContext(flags),
10
- query: { page: 0, pageSize: 100, tenantGroupId: "" }
11
- });
6
+ const groups = await listProjectGroups(flags);
12
7
  if (flags.json) {
13
8
  writeOutput(groups, flags);
14
9
  return;
@@ -1,12 +1,15 @@
1
1
  import { stringFlag } from "../../../lib/args.js";
2
2
  import { blocksRequest } from "../../../lib/api.js";
3
+ import { CliActionableError } from "../../../lib/errors.js";
3
4
  import { writeOutput } from "../../../lib/output.js";
5
+ import { getProjectAssets, resolveSelectedProject } from "../../../lib/project-info.js";
6
+ import { selectFromList } from "../../../lib/prompt.js";
4
7
  import { requestContext } from "../../../lib/request-context.js";
5
- import { parseCommand, selectedProject } from "../../../lib/workspace.js";
8
+ import { parseCommand } from "../../../lib/workspace.js";
6
9
  export async function releaseBuildsList(argv) {
7
10
  const { args, flags } = parseCommand(argv);
8
- const repoId = args[0] || stringFlag(flags, "repo-id", { required: true });
9
- const projectKey = await selectedProject(flags);
11
+ const { group, tenantId: projectKey } = await resolveSelectedProject(flags);
12
+ const repoId = args[0] || stringFlag(flags, "repo-id") || (await resolveRepoId(group.tenantGroupId, flags));
10
13
  const result = await blocksRequest("/release/v4/api/Build/repo-details", {
11
14
  impersonatedProjectAuth: true,
12
15
  ...requestContext(flags),
@@ -15,3 +18,18 @@ export async function releaseBuildsList(argv) {
15
18
  });
16
19
  writeOutput(result, flags);
17
20
  }
21
+ async function resolveRepoId(tenantGroupId, flags) {
22
+ if (!tenantGroupId) {
23
+ throw new CliActionableError("This project has no tenant group on record, so its linked repos can't be looked up.", "no_tenant_group", "Pass --repo-id explicitly.");
24
+ }
25
+ const response = await getProjectAssets(tenantGroupId, flags);
26
+ const resources = response.assets?.resources ?? [];
27
+ if (resources.length === 0) {
28
+ throw new CliActionableError("No repo linked to this project.", "repo_not_linked", "Link a repo from the Blocks portal (requires GitHub auth), then re-run this command, or pass --repo-id explicitly.");
29
+ }
30
+ const resource = resources.length === 1 ? resources[0] : resources[await selectFromList("Multiple repos are linked to this project -- choose one:", resources.map((item) => `${item.name ?? "(unnamed)"} (${item.resourceId ?? "?"})`))];
31
+ if (!resource.resourceId) {
32
+ throw new Error("The selected repo asset is missing a resourceId.");
33
+ }
34
+ return resource.resourceId;
35
+ }
@@ -1,46 +1,137 @@
1
- import { booleanFlag, stringFlag } from "../../lib/args.js";
1
+ import { booleanFlag, integerFlag, stringFlag } from "../../lib/args.js";
2
2
  import { blocksRequest } from "../../lib/api.js";
3
3
  import { confirmMutation } from "../../lib/confirm.js";
4
+ import { CliActionableError } from "../../lib/errors.js";
4
5
  import { writeOutput } from "../../lib/output.js";
6
+ import { getProjectAssets, resolveSelectedProject } from "../../lib/project-info.js";
5
7
  import { requestContext } from "../../lib/request-context.js";
6
- import { parseCommand, pathsFromWorkspace, readWorkspaceConfig, selectedProject } from "../../lib/workspace.js";
7
- import { readFile } from "node:fs/promises";
8
+ import { parseCommand } from "../../lib/workspace.js";
9
+ const DEFAULT_POLL_INTERVAL_SECONDS = 10;
10
+ const DEFAULT_WAIT_TIMEOUT_SECONDS = 900;
11
+ const TERMINAL_STATUS_PATTERN = /succeed|success|complet|fail|error|cancel|abort|done/i;
8
12
  export async function releaseDeploy(argv) {
9
13
  const { flags } = parseCommand(argv);
10
- const config = await readReleaseConfig();
11
- const repoId = stringFlag(flags, "repo-id", { defaultValue: stringValue(config.repoId) });
12
- if (!repoId)
13
- throw new Error("Missing --repo-id or blocks/release/deploy.json repoId.");
14
- const body = {
15
- ...config,
16
- repoId
17
- };
18
- if (booleanFlag(flags, "dry-run")) {
19
- writeOutput({ dryRun: true, endpoint: "/release/v4/api/Build/manual", request: body }, flags);
14
+ const domain = stringFlag(flags, "domain");
15
+ const dryRun = booleanFlag(flags, "dry-run");
16
+ const { project, group, tenantId: projectKey } = await resolveSelectedProject(flags);
17
+ const environment = project.environment;
18
+ const tenantGroupId = group.tenantGroupId;
19
+ if (!environment || !tenantGroupId) {
20
+ throw new Error(`Project '${projectKey}' was not found in Project/Gets.`);
21
+ }
22
+ const repoId = await resolveRepoId(tenantGroupId, environment, flags);
23
+ const { branch, repoUrl } = await resolveRepoBranch(repoId, projectKey, flags);
24
+ if (branch.toLowerCase() !== environment.toLowerCase()) {
25
+ throw new CliActionableError(`Connected repo's branch '${branch}' does not match this project's environment '${environment}'.`, "branch_environment_mismatch", `Point the linked repo at a branch named '${environment}', or relink the correct branch from the Blocks portal.`);
26
+ }
27
+ if (dryRun) {
28
+ writeOutput({
29
+ branch,
30
+ domain: domain || undefined,
31
+ dryRun: true,
32
+ environment,
33
+ projectKey,
34
+ repoId
35
+ }, flags);
20
36
  return;
21
37
  }
22
- await confirmMutation(flags, `Trigger configured release build for repo '${repoId}'.`);
23
- const projectKey = await selectedProject(flags);
38
+ await confirmMutation(flags, `Deploy '${environment}' (repo ${repoId}, branch ${branch}).`);
39
+ if (domain) {
40
+ await blocksRequest("/release/v4/api/Build/repo-update", {
41
+ body: {
42
+ projectEnv: environment,
43
+ repoWithDomains: [{ customDeploymentDomain: domain, repoId, repoUrl }]
44
+ },
45
+ impersonatedProjectAuth: true,
46
+ projectTenantId: projectKey,
47
+ ...requestContext(flags)
48
+ });
49
+ }
24
50
  const result = await blocksRequest("/release/v4/api/Build/manual", {
51
+ body: { repoId },
25
52
  impersonatedProjectAuth: true,
26
- ...requestContext(flags),
27
- body,
28
- projectTenantId: projectKey
53
+ projectTenantId: projectKey,
54
+ ...requestContext(flags)
29
55
  });
30
- writeOutput(result, flags);
56
+ if (!booleanFlag(flags, "wait")) {
57
+ writeOutput(result, flags);
58
+ return;
59
+ }
60
+ const buildId = firstString(result, ["buildId", "itemId", "id", "buildID"]);
61
+ if (!buildId) {
62
+ console.warn(`Warning: could not find a buildId in the deploy response to wait on. Response: ${JSON.stringify(result)}`);
63
+ writeOutput(result, flags);
64
+ return;
65
+ }
66
+ const finalStatus = await waitForBuild(buildId, flags);
67
+ writeOutput({ build: finalStatus, buildId, deploy: result }, flags);
68
+ }
69
+ async function waitForBuild(buildId, flags) {
70
+ const pollIntervalMs = integerFlag(flags, "poll-interval", DEFAULT_POLL_INTERVAL_SECONDS) * 1000;
71
+ const timeoutMs = integerFlag(flags, "timeout", DEFAULT_WAIT_TIMEOUT_SECONDS) * 1000;
72
+ const deadline = Date.now() + timeoutMs;
73
+ console.log(`Waiting for build '${buildId}' (polling every ${pollIntervalMs / 1000}s, timeout ${timeoutMs / 1000}s)...`);
74
+ while (true) {
75
+ const status = await blocksRequest("/release/v4/api/Build", {
76
+ impersonatedProjectAuth: true,
77
+ query: { buildId },
78
+ ...requestContext(flags)
79
+ });
80
+ console.log(JSON.stringify(status, null, 2));
81
+ if (containsTerminalStatus(status))
82
+ return status;
83
+ if (Date.now() >= deadline) {
84
+ throw new CliActionableError(`Timed out after ${timeoutMs / 1000}s waiting for build '${buildId}' to reach a terminal status.`, "build_wait_timeout", `Check manually with 'blocks release status ${buildId}'.`);
85
+ }
86
+ await delay(pollIntervalMs);
87
+ }
88
+ }
89
+ function containsTerminalStatus(value, depth = 0) {
90
+ if (depth > 3 || value === null || value === undefined)
91
+ return false;
92
+ if (typeof value === "string")
93
+ return TERMINAL_STATUS_PATTERN.test(value);
94
+ if (Array.isArray(value))
95
+ return value.some((item) => containsTerminalStatus(item, depth + 1));
96
+ if (typeof value === "object")
97
+ return Object.values(value).some((item) => containsTerminalStatus(item, depth + 1));
98
+ return false;
99
+ }
100
+ function delay(ms) {
101
+ return new Promise((resolve) => setTimeout(resolve, ms));
102
+ }
103
+ function firstString(record, keys) {
104
+ for (const key of keys) {
105
+ const value = record[key];
106
+ if (typeof value === "string" && value)
107
+ return value;
108
+ }
109
+ return undefined;
31
110
  }
32
- async function readReleaseConfig() {
33
- const workspace = await readWorkspaceConfig();
34
- const { releaseConfig } = pathsFromWorkspace(workspace);
35
- try {
36
- return JSON.parse(await readFile(releaseConfig, "utf8"));
111
+ async function resolveRepoId(tenantGroupId, environment, flags) {
112
+ const response = await getProjectAssets(tenantGroupId, flags);
113
+ const resources = response.assets?.resources ?? [];
114
+ if (resources.length === 0) {
115
+ throw new CliActionableError("No repo linked to this project.", "repo_not_linked", "Link a repo from the Blocks portal (requires GitHub auth), then re-run this command.");
37
116
  }
38
- catch (error) {
39
- if (error.code === "ENOENT")
40
- return {};
41
- throw error;
117
+ const matched = resources.length === 1
118
+ ? resources[0]
119
+ : resources.find((resource) => resource.name?.toLowerCase() === environment.toLowerCase());
120
+ if (!matched?.resourceId) {
121
+ throw new CliActionableError(`Multiple repos are linked to this project and none is named for environment '${environment}'.`, "repo_ambiguous", "Check the repo links for this project from the Blocks portal.");
42
122
  }
123
+ return matched.resourceId;
43
124
  }
44
- function stringValue(value) {
45
- return typeof value === "string" ? value : undefined;
125
+ async function resolveRepoBranch(repoId, projectKey, flags) {
126
+ const result = await blocksRequest("/release/v4/api/Build/repo-details", {
127
+ impersonatedProjectAuth: true,
128
+ projectTenantId: projectKey,
129
+ query: { RepoId: repoId },
130
+ ...requestContext(flags)
131
+ });
132
+ const repo = result.data?.repo;
133
+ if (!repo?.branch) {
134
+ throw new CliActionableError(`Repo '${repoId}' from this project's linked asset was not found in blocks-release.`, "repo_not_found", "Check the repo link for this project from the Blocks portal.");
135
+ }
136
+ return { branch: repo.branch, repoUrl: repo.repoUrl ?? "" };
46
137
  }
@@ -0,0 +1 @@
1
+ export declare function sdkClient(argv: string[]): Promise<void>;
@@ -0,0 +1,99 @@
1
+ import { blocksRequest } from "../../lib/api.js";
2
+ import { stringFlag } from "../../lib/args.js";
3
+ import { defaults } from "../../lib/config.js";
4
+ import { findProjectByTenantId } from "../../lib/project-info.js";
5
+ import { writeOutput } from "../../lib/output.js";
6
+ import { requestContext } from "../../lib/request-context.js";
7
+ import { parseCommand, selectedProject } from "../../lib/workspace.js";
8
+ // Read-only: "I want to use the Blocks SDK in my app -- show me the client."
9
+ // Resolves this project's createBlocksClient() config and prints it, same
10
+ // values 'new web' scaffolds with. Never writes a file and never mutates
11
+ // anything -- if you want the SDK wired into a new app, use 'new web'.
12
+ export async function sdkClient(argv) {
13
+ const { flags } = parseCommand(argv);
14
+ const tenantId = stringFlag(flags, "x-blocks-key") || (await selectedProject(flags));
15
+ const apiUrl = stringFlag(flags, "blocks-api-url", { defaultValue: defaults().apiUrl });
16
+ const oidcUrl = stringFlag(flags, "oidc-url", { defaultValue: defaults().oidcUrl });
17
+ let appDomain = stringFlag(flags, "app-domain");
18
+ let oidcClientId = stringFlag(flags, "client-id");
19
+ const notes = [];
20
+ if (!appDomain || !oidcClientId) {
21
+ const { project } = await findProjectByTenantId(tenantId, flags);
22
+ if (!appDomain) {
23
+ const domains = (project.applications ?? [])
24
+ .map((application) => application.domain)
25
+ .filter((domain) => Boolean(domain));
26
+ if (domains.length === 1) {
27
+ appDomain = domains[0];
28
+ }
29
+ else if (domains.length > 1) {
30
+ notes.push(`Multiple domains registered for this project (${domains.join(", ")}) -- pass --app-domain to pick one.`);
31
+ }
32
+ else {
33
+ notes.push("This project has no domains registered in Blocks -- pass --app-domain explicitly.");
34
+ }
35
+ }
36
+ if (!oidcClientId) {
37
+ const clients = await listOidcClients(tenantId, flags);
38
+ if (clients.length === 1) {
39
+ oidcClientId = clients[0].id;
40
+ }
41
+ else if (clients.length > 1) {
42
+ notes.push(`Multiple OIDC clients found (${clients.map((client) => `${client.label} [${client.id}]`).join(", ")}) -- pass --client-id to pick one.`);
43
+ }
44
+ else {
45
+ notes.push("No OIDC client registered for this project -- create one ('auth:oidc-clients:save') and pass --client-id.");
46
+ }
47
+ }
48
+ }
49
+ if (flags.json) {
50
+ writeOutput({ apiUrl, appDomain: appDomain || undefined, notes, oidcClientId: oidcClientId || undefined, oidcUrl, xBlocksKey: tenantId }, flags);
51
+ return;
52
+ }
53
+ console.log("import { createBlocksClient } from \"@seliseblocks/client\";");
54
+ console.log("");
55
+ console.log("export const blocksClient = createBlocksClient({");
56
+ console.log(` apiUrl: "${apiUrl}",`);
57
+ if (appDomain)
58
+ console.log(` appDomain: "${appDomain}",`);
59
+ console.log(" oidc: {");
60
+ console.log(` clientId: "${oidcClientId || "<register a public OIDC client, see auth:oidc-clients:save>"}",`);
61
+ console.log(" scope: \"openid profile\",");
62
+ console.log(` url: "${oidcUrl}"`);
63
+ console.log(" },");
64
+ console.log(` xBlocksKey: "${tenantId}"`);
65
+ console.log("});");
66
+ for (const note of notes)
67
+ console.log(`\n${note}`);
68
+ }
69
+ async function listOidcClients(tenantId, flags) {
70
+ const raw = await blocksRequest("/iam/v4/oidc-clients", {
71
+ impersonatedProjectAuth: true,
72
+ projectTenantId: tenantId,
73
+ ...requestContext(flags)
74
+ });
75
+ const clients = [];
76
+ for (const item of normalizeList(raw)) {
77
+ if (typeof item !== "object" || item === null)
78
+ continue;
79
+ const record = item;
80
+ const id = record.itemId ?? record.clientId ?? record.id;
81
+ if (typeof id !== "string" || !id)
82
+ continue;
83
+ const label = typeof record.clientDisplayName === "string" && record.clientDisplayName ? record.clientDisplayName : id;
84
+ clients.push({ id, label });
85
+ }
86
+ return clients;
87
+ }
88
+ function normalizeList(raw) {
89
+ if (Array.isArray(raw))
90
+ return raw;
91
+ if (raw && typeof raw === "object") {
92
+ for (const key of ["data", "items", "results"]) {
93
+ const value = raw[key];
94
+ if (Array.isArray(value))
95
+ return value;
96
+ }
97
+ }
98
+ return [];
99
+ }
@@ -0,0 +1 @@
1
+ export declare function secretsGet(argv: string[]): Promise<void>;
@@ -0,0 +1,21 @@
1
+ import { integerFlag, stringFlag } from "../../lib/args.js";
2
+ import { blocksRequest } from "../../lib/api.js";
3
+ import { writeOutput } from "../../lib/output.js";
4
+ import { requestContext } from "../../lib/request-context.js";
5
+ import { parseCommand, selectedProject } from "../../lib/workspace.js";
6
+ export async function secretsGet(argv) {
7
+ const { args, flags } = parseCommand(argv);
8
+ const secretKey = args[0] || stringFlag(flags, "secret-key", { required: true });
9
+ const projectKey = await selectedProject(flags);
10
+ const result = await blocksRequest("/os/v4/Secrets/Gets", {
11
+ impersonatedProjectAuth: true,
12
+ ...requestContext(flags),
13
+ projectTenantId: projectKey,
14
+ query: {
15
+ PageNumber: integerFlag(flags, "page-number", 0),
16
+ PageSize: integerFlag(flags, "page-size", 10),
17
+ secretKey
18
+ }
19
+ });
20
+ writeOutput(result, flags);
21
+ }
@@ -0,0 +1 @@
1
+ export declare function secretsSave(argv: string[]): Promise<void>;
@@ -0,0 +1,51 @@
1
+ import { booleanFlag, stringFlag } from "../../lib/args.js";
2
+ import { blocksRequest } from "../../lib/api.js";
3
+ import { confirmMutation } from "../../lib/confirm.js";
4
+ import { compact, jsonBodyFlag, jsonFlag } from "../../lib/json-flag.js";
5
+ import { writeOutput } from "../../lib/output.js";
6
+ import { requestContext } from "../../lib/request-context.js";
7
+ import { parseCommand, selectedProject } from "../../lib/workspace.js";
8
+ const SECRETS_SAVE_API = "/os/v4/Secrets/Save";
9
+ export async function secretsSave(argv) {
10
+ const { flags } = parseCommand(argv);
11
+ const body = {
12
+ ...(await jsonBodyFlag(flags)),
13
+ ...compact({
14
+ itemId: stringFlag(flags, "item-id") || undefined,
15
+ keyValuePairs: keyValuePairsFlag(flags),
16
+ secretKey: stringFlag(flags, "secret-key") || undefined
17
+ })
18
+ };
19
+ if (booleanFlag(flags, "dry-run")) {
20
+ writeOutput({ dryRun: true, endpoint: SECRETS_SAVE_API, request: redactSecret(body) }, flags);
21
+ return;
22
+ }
23
+ await confirmMutation(flags, `Save secret '${body.secretKey ?? ""}'.`);
24
+ const projectKey = await selectedProject(flags);
25
+ const result = await blocksRequest(SECRETS_SAVE_API, {
26
+ body,
27
+ impersonatedProjectAuth: true,
28
+ ...requestContext(flags),
29
+ projectTenantId: projectKey
30
+ });
31
+ writeOutput(result, flags);
32
+ }
33
+ function keyValuePairsFlag(flags) {
34
+ const parsed = jsonFlag(flags, "key-value-pairs");
35
+ if (parsed === undefined)
36
+ return undefined;
37
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
38
+ throw new Error("--key-value-pairs must be a JSON object, e.g. '{\"isEnable\":\"true\"}'");
39
+ }
40
+ return parsed;
41
+ }
42
+ function redactSecret(body) {
43
+ const pairs = body.keyValuePairs;
44
+ if (!pairs || typeof pairs !== "object")
45
+ return body;
46
+ const redacted = {};
47
+ for (const [key, value] of Object.entries(pairs)) {
48
+ redacted[key] = /(secret|password|key$)/i.test(key) ? "***" : value;
49
+ }
50
+ return { ...body, keyValuePairs: redacted };
51
+ }
@@ -0,0 +1 @@
1
+ export declare function skillAdd(argv: string[]): Promise<void>;
@@ -0,0 +1,19 @@
1
+ import { cp } from "node:fs/promises";
2
+ import { dirname, join } from "node:path";
3
+ import { stringFlag } from "../../lib/args.js";
4
+ import { readSkill } from "../../lib/skills.js";
5
+ import { parseCommand } from "../../lib/workspace.js";
6
+ export async function skillAdd(argv) {
7
+ const { args, flags } = parseCommand(argv);
8
+ const name = args[0];
9
+ if (!name)
10
+ throw new Error("Missing skill name. Run 'blocks skill list' to see available skills.");
11
+ const skill = await readSkill(name);
12
+ const sourceDir = dirname(skill.path);
13
+ const targetDir = stringFlag(flags, "dir", { defaultValue: "blocks-skills" });
14
+ const targetPath = join(process.cwd(), targetDir, name);
15
+ // Copy the whole skill directory, not just SKILL.md -- some skills also ship
16
+ // supporting files (e.g. flows/*.md) that SKILL.md links to.
17
+ await cp(sourceDir, targetPath, { recursive: true });
18
+ console.log(`Added ${targetPath}`);
19
+ }
@@ -0,0 +1 @@
1
+ export declare function skillList(argv: string[]): Promise<void>;
@@ -0,0 +1,15 @@
1
+ import { listSkills, SKILLS_REPO_URL } from "../../lib/skills.js";
2
+ import { writeOutput } from "../../lib/output.js";
3
+ import { parseCommand } from "../../lib/workspace.js";
4
+ export async function skillList(argv) {
5
+ const { flags } = parseCommand(argv);
6
+ const skills = await listSkills();
7
+ if (flags.json) {
8
+ writeOutput(skills, flags);
9
+ return;
10
+ }
11
+ for (const skill of skills) {
12
+ console.log(`${skill.name} ${skill.description}`);
13
+ }
14
+ console.log(`\nFull catalog (may be ahead of this bundled list): ${SKILLS_REPO_URL}`);
15
+ }
@@ -0,0 +1 @@
1
+ export declare function skillShow(argv: string[]): Promise<void>;
@@ -0,0 +1,15 @@
1
+ import { readSkill } from "../../lib/skills.js";
2
+ import { writeOutput } from "../../lib/output.js";
3
+ import { parseCommand } from "../../lib/workspace.js";
4
+ export async function skillShow(argv) {
5
+ const { args, flags } = parseCommand(argv);
6
+ const name = args[0];
7
+ if (!name)
8
+ throw new Error("Missing skill name. Run 'blocks skill list' to see available skills.");
9
+ const skill = await readSkill(name);
10
+ if (flags.json) {
11
+ writeOutput(skill, flags);
12
+ return;
13
+ }
14
+ console.log(skill.content);
15
+ }
@@ -0,0 +1 @@
1
+ export declare function storageConfigDelete(argv: string[]): Promise<void>;
@@ -0,0 +1,24 @@
1
+ import { booleanFlag, stringFlag } from "../../../lib/args.js";
2
+ import { blocksRequest } from "../../../lib/api.js";
3
+ import { confirmMutation } from "../../../lib/confirm.js";
4
+ import { writeOutput } from "../../../lib/output.js";
5
+ import { requestContext } from "../../../lib/request-context.js";
6
+ import { parseCommand, selectedProject } from "../../../lib/workspace.js";
7
+ export async function storageConfigDelete(argv) {
8
+ const { args, flags } = parseCommand(argv);
9
+ const name = args[0] || stringFlag(flags, "name", { required: true });
10
+ if (booleanFlag(flags, "dry-run")) {
11
+ writeOutput({ dryRun: true, endpoint: "/os/v4/Storage/Delete", query: { ConfigurationName: name } }, flags);
12
+ return;
13
+ }
14
+ await confirmMutation(flags, `Delete storage configuration '${name}'.`);
15
+ const projectKey = await selectedProject(flags);
16
+ const result = await blocksRequest("/os/v4/Storage/Delete", {
17
+ impersonatedProjectAuth: true,
18
+ method: "DELETE",
19
+ ...requestContext(flags),
20
+ projectTenantId: projectKey,
21
+ query: { ConfigurationName: name }
22
+ });
23
+ writeOutput(result, flags);
24
+ }
@@ -0,0 +1 @@
1
+ export declare function storageConfigGet(argv: string[]): Promise<void>;
@@ -0,0 +1,17 @@
1
+ import { stringFlag } from "../../../lib/args.js";
2
+ import { blocksRequest } from "../../../lib/api.js";
3
+ import { writeOutput } from "../../../lib/output.js";
4
+ import { requestContext } from "../../../lib/request-context.js";
5
+ import { parseCommand, selectedProject } from "../../../lib/workspace.js";
6
+ export async function storageConfigGet(argv) {
7
+ const { args, flags } = parseCommand(argv);
8
+ const name = args[0] || stringFlag(flags, "name", { required: true });
9
+ const projectKey = await selectedProject(flags);
10
+ const result = await blocksRequest("/os/v4/Storage/Get", {
11
+ impersonatedProjectAuth: true,
12
+ ...requestContext(flags),
13
+ projectTenantId: projectKey,
14
+ query: { ConfigurationName: name }
15
+ });
16
+ writeOutput(result, flags);
17
+ }
@@ -0,0 +1 @@
1
+ export declare function storageConfigList(argv: string[]): Promise<void>;