@orizm/cli 2.2.7 → 3.0.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.
- package/README.md +111 -4
- package/dist/array-update-CMFUoQEe.mjs +41 -0
- package/dist/array-update-CMFUoQEe.mjs.map +1 -0
- package/dist/array-update-Dch4e9tI.cjs +58 -0
- package/dist/array-update-Dch4e9tI.cjs.map +1 -0
- package/dist/auth-BGW072BP.mjs +18 -0
- package/dist/auth-BGW072BP.mjs.map +1 -0
- package/dist/auth-CNbONZuf.cjs +18 -0
- package/dist/auth-CNbONZuf.cjs.map +1 -0
- package/dist/bucket-6d3VNt1D.mjs +17 -0
- package/dist/bucket-6d3VNt1D.mjs.map +1 -0
- package/dist/bucket-DjbHz9_A.cjs +17 -0
- package/dist/bucket-DjbHz9_A.cjs.map +1 -0
- package/dist/cli/main.cjs +231 -0
- package/dist/cli/main.cjs.map +1 -0
- package/dist/cli/main.d.cts +1 -0
- package/dist/cli/main.d.mts +1 -0
- package/dist/cli/main.mjs +196 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cms-BJnovGYT.mjs +172 -0
- package/dist/cms-BJnovGYT.mjs.map +1 -0
- package/dist/cms-Cnx-lDGu.cjs +172 -0
- package/dist/cms-Cnx-lDGu.cjs.map +1 -0
- package/dist/codegen-BF5b-u46.cjs +17 -0
- package/dist/codegen-BF5b-u46.cjs.map +1 -0
- package/dist/codegen-DZOB4ttR.mjs +17 -0
- package/dist/codegen-DZOB4ttR.mjs.map +1 -0
- package/dist/config/index.cjs +49 -96
- package/dist/config/index.cjs.map +1 -1
- package/dist/config/index.d.cts +1 -53
- package/dist/config/{index.d.ts → index.d.mts} +29 -27
- package/dist/config/index.d.mts.map +1 -0
- package/dist/config/index.mjs +59 -0
- package/dist/config/index.mjs.map +1 -0
- package/dist/config-loader-BEgS869e.mjs +65 -0
- package/dist/config-loader-BEgS869e.mjs.map +1 -0
- package/dist/config-loader-D8x32gEU.cjs +78 -0
- package/dist/config-loader-D8x32gEU.cjs.map +1 -0
- package/dist/confirm-delete-B9o73U7B.cjs +19 -0
- package/dist/confirm-delete-B9o73U7B.cjs.map +1 -0
- package/dist/confirm-delete-CsWkW69-.mjs +14 -0
- package/dist/confirm-delete-CsWkW69-.mjs.map +1 -0
- package/dist/consumer-BBsH8b1j.cjs +18 -0
- package/dist/consumer-BBsH8b1j.cjs.map +1 -0
- package/dist/consumer-DqyRfpsl.mjs +18 -0
- package/dist/consumer-DqyRfpsl.mjs.map +1 -0
- package/dist/consumer-OF6Z_eTP.cjs +95 -0
- package/dist/consumer-OF6Z_eTP.cjs.map +1 -0
- package/dist/consumer-pU2HyiyA.mjs +95 -0
- package/dist/consumer-pU2HyiyA.mjs.map +1 -0
- package/dist/content-BsoRmjis.mjs +20 -0
- package/dist/content-BsoRmjis.mjs.map +1 -0
- package/dist/content-Y-2Y0cyn.cjs +20 -0
- package/dist/content-Y-2Y0cyn.cjs.map +1 -0
- package/dist/create--1NYduI_.cjs +58 -0
- package/dist/create--1NYduI_.cjs.map +1 -0
- package/dist/create-B-PAOor6.mjs +66 -0
- package/dist/create-B-PAOor6.mjs.map +1 -0
- package/dist/create-BNYWcyuQ.cjs +66 -0
- package/dist/create-BNYWcyuQ.cjs.map +1 -0
- package/dist/create-B_gsZCL-.cjs +54 -0
- package/dist/create-B_gsZCL-.cjs.map +1 -0
- package/dist/create-BqlxdhcR.mjs +81 -0
- package/dist/create-BqlxdhcR.mjs.map +1 -0
- package/dist/create-CC814ixh.mjs +66 -0
- package/dist/create-CC814ixh.mjs.map +1 -0
- package/dist/create-CkFBiEDH.mjs +58 -0
- package/dist/create-CkFBiEDH.mjs.map +1 -0
- package/dist/create-CykRHseR.cjs +81 -0
- package/dist/create-CykRHseR.cjs.map +1 -0
- package/dist/create-RLyp_dl6.mjs +54 -0
- package/dist/create-RLyp_dl6.mjs.map +1 -0
- package/dist/create-Z-z3LXNW.cjs +66 -0
- package/dist/create-Z-z3LXNW.cjs.map +1 -0
- package/dist/delete-8yZ3j0vX.cjs +59 -0
- package/dist/delete-8yZ3j0vX.cjs.map +1 -0
- package/dist/delete-BOUObrDw.mjs +48 -0
- package/dist/delete-BOUObrDw.mjs.map +1 -0
- package/dist/delete-BSLIXrAh.mjs +59 -0
- package/dist/delete-BSLIXrAh.mjs.map +1 -0
- package/dist/delete-BenBNL2p.mjs +56 -0
- package/dist/delete-BenBNL2p.mjs.map +1 -0
- package/dist/delete-Bx2oNROv.cjs +56 -0
- package/dist/delete-Bx2oNROv.cjs.map +1 -0
- package/dist/delete-CCTiCYIL.cjs +51 -0
- package/dist/delete-CCTiCYIL.cjs.map +1 -0
- package/dist/delete-CGW0VMK6.cjs +56 -0
- package/dist/delete-CGW0VMK6.cjs.map +1 -0
- package/dist/delete-CIYY59v_.cjs +48 -0
- package/dist/delete-CIYY59v_.cjs.map +1 -0
- package/dist/delete-CSSd0gmt.mjs +56 -0
- package/dist/delete-CSSd0gmt.mjs.map +1 -0
- package/dist/delete-CSs5Czlo.mjs +59 -0
- package/dist/delete-CSs5Czlo.mjs.map +1 -0
- package/dist/delete-CrOVRvMo.cjs +56 -0
- package/dist/delete-CrOVRvMo.cjs.map +1 -0
- package/dist/delete-DehKYCXh.mjs +56 -0
- package/dist/delete-DehKYCXh.mjs.map +1 -0
- package/dist/delete-DhSU-Lx2.mjs +51 -0
- package/dist/delete-DhSU-Lx2.mjs.map +1 -0
- package/dist/delete-DozSxZQ7.cjs +59 -0
- package/dist/delete-DozSxZQ7.cjs.map +1 -0
- package/dist/detail-8CXNIhKw.cjs +16 -0
- package/dist/detail-8CXNIhKw.cjs.map +1 -0
- package/dist/detail-DN5jCQ4N.mjs +10 -0
- package/dist/detail-DN5jCQ4N.mjs.map +1 -0
- package/dist/download-oFGzg30E.mjs +68 -0
- package/dist/download-oFGzg30E.mjs.map +1 -0
- package/dist/download-ogGbb3FU.cjs +68 -0
- package/dist/download-ogGbb3FU.cjs.map +1 -0
- package/dist/erd-lKC5NB2l.cjs +124 -0
- package/dist/erd-lKC5NB2l.cjs.map +1 -0
- package/dist/erd-zDoF6I_y.mjs +123 -0
- package/dist/erd-zDoF6I_y.mjs.map +1 -0
- package/dist/get-BBOKSXkh.cjs +48 -0
- package/dist/get-BBOKSXkh.cjs.map +1 -0
- package/dist/get-BHniACk5.cjs +57 -0
- package/dist/get-BHniACk5.cjs.map +1 -0
- package/dist/get-BtmzDaVn.mjs +47 -0
- package/dist/get-BtmzDaVn.mjs.map +1 -0
- package/dist/get-CVV3h6HR.cjs +47 -0
- package/dist/get-CVV3h6HR.cjs.map +1 -0
- package/dist/get-CgEgETQa.mjs +52 -0
- package/dist/get-CgEgETQa.mjs.map +1 -0
- package/dist/get-DB80UNSR.mjs +47 -0
- package/dist/get-DB80UNSR.mjs.map +1 -0
- package/dist/get-DBxhbN1G.mjs +57 -0
- package/dist/get-DBxhbN1G.mjs.map +1 -0
- package/dist/get-DDB89cOs.mjs +48 -0
- package/dist/get-DDB89cOs.mjs.map +1 -0
- package/dist/get-DPGx1zU4.mjs +56 -0
- package/dist/get-DPGx1zU4.mjs.map +1 -0
- package/dist/get-IOU__2RP.cjs +52 -0
- package/dist/get-IOU__2RP.cjs.map +1 -0
- package/dist/get-KdWfYINc.cjs +47 -0
- package/dist/get-KdWfYINc.cjs.map +1 -0
- package/dist/get-jwXRlIBJ.cjs +57 -0
- package/dist/get-jwXRlIBJ.cjs.map +1 -0
- package/dist/group-roles-BEEzLxPX.mjs +36 -0
- package/dist/group-roles-BEEzLxPX.mjs.map +1 -0
- package/dist/group-roles-Bl_mEodO.cjs +59 -0
- package/dist/group-roles-Bl_mEodO.cjs.map +1 -0
- package/dist/invite-DsOCKGTJ.mjs +66 -0
- package/dist/invite-DsOCKGTJ.mjs.map +1 -0
- package/dist/invite-Dts9uNQL.cjs +66 -0
- package/dist/invite-Dts9uNQL.cjs.map +1 -0
- package/dist/key-BogfSiz_.mjs +17 -0
- package/dist/key-BogfSiz_.mjs.map +1 -0
- package/dist/key-Czwiu2pW.cjs +17 -0
- package/dist/key-Czwiu2pW.cjs.map +1 -0
- package/dist/link-BluFyxEL.mjs +42 -0
- package/dist/link-BluFyxEL.mjs.map +1 -0
- package/dist/link-DYu1Vjlw.cjs +42 -0
- package/dist/link-DYu1Vjlw.cjs.map +1 -0
- package/dist/list-2BpPj4Z0.cjs +40 -0
- package/dist/list-2BpPj4Z0.cjs.map +1 -0
- package/dist/list-57TUfNFd.mjs +48 -0
- package/dist/list-57TUfNFd.mjs.map +1 -0
- package/dist/list-60NcDr0q.cjs +81 -0
- package/dist/list-60NcDr0q.cjs.map +1 -0
- package/dist/list-BRh59EqI.cjs +35 -0
- package/dist/list-BRh59EqI.cjs.map +1 -0
- package/dist/list-BwfpuhmJ.cjs +37 -0
- package/dist/list-BwfpuhmJ.cjs.map +1 -0
- package/dist/list-CJuefq_I.cjs +82 -0
- package/dist/list-CJuefq_I.cjs.map +1 -0
- package/dist/list-CYE9Exi3.cjs +72 -0
- package/dist/list-CYE9Exi3.cjs.map +1 -0
- package/dist/list-CbvEh7eA.mjs +35 -0
- package/dist/list-CbvEh7eA.mjs.map +1 -0
- package/dist/list-CfIeReBx.mjs +82 -0
- package/dist/list-CfIeReBx.mjs.map +1 -0
- package/dist/list-CxHDoXjv.mjs +81 -0
- package/dist/list-CxHDoXjv.mjs.map +1 -0
- package/dist/list-D0-QrWmn.cjs +51 -0
- package/dist/list-D0-QrWmn.cjs.map +1 -0
- package/dist/list-D24J_Qbm.mjs +49 -0
- package/dist/list-D24J_Qbm.mjs.map +1 -0
- package/dist/list-D5PSDMWw.mjs +51 -0
- package/dist/list-D5PSDMWw.mjs.map +1 -0
- package/dist/list-DRKF2uKW.cjs +95 -0
- package/dist/list-DRKF2uKW.cjs.map +1 -0
- package/dist/list-DdJ05juK.mjs +72 -0
- package/dist/list-DdJ05juK.mjs.map +1 -0
- package/dist/list-DlJssPwy.cjs +48 -0
- package/dist/list-DlJssPwy.cjs.map +1 -0
- package/dist/list-V3W6hvOa.cjs +49 -0
- package/dist/list-V3W6hvOa.cjs.map +1 -0
- package/dist/list-rAn3uOA7.mjs +37 -0
- package/dist/list-rAn3uOA7.mjs.map +1 -0
- package/dist/list-syVDGkVR.mjs +40 -0
- package/dist/list-syVDGkVR.mjs.map +1 -0
- package/dist/list-yQZLzkC7.mjs +95 -0
- package/dist/list-yQZLzkC7.mjs.map +1 -0
- package/dist/login-2XcHd4wn.cjs +212 -0
- package/dist/login-2XcHd4wn.cjs.map +1 -0
- package/dist/login-FE_dbWMo.mjs +211 -0
- package/dist/login-FE_dbWMo.mjs.map +1 -0
- package/dist/logout-BDbWrGBm.mjs +35 -0
- package/dist/logout-BDbWrGBm.mjs.map +1 -0
- package/dist/logout-DC5TMJ5_.cjs +35 -0
- package/dist/logout-DC5TMJ5_.cjs.map +1 -0
- package/dist/management-BaN1Nynl.mjs +19 -0
- package/dist/management-BaN1Nynl.mjs.map +1 -0
- package/dist/management-DHXxdCra.cjs +19 -0
- package/dist/management-DHXxdCra.cjs.map +1 -0
- package/dist/mask-B1qD73jb.mjs +22 -0
- package/dist/mask-B1qD73jb.mjs.map +1 -0
- package/dist/mask-CqYLib9p.cjs +40 -0
- package/dist/mask-CqYLib9p.cjs.map +1 -0
- package/dist/oauth-client-CdD0evAV.cjs +170 -0
- package/dist/oauth-client-CdD0evAV.cjs.map +1 -0
- package/dist/oauth-client-QHuDa4fW.mjs +139 -0
- package/dist/oauth-client-QHuDa4fW.mjs.map +1 -0
- package/dist/object-BfUf8Y6w.mjs +20 -0
- package/dist/object-BfUf8Y6w.mjs.map +1 -0
- package/dist/object-DT7UEW9G.cjs +20 -0
- package/dist/object-DT7UEW9G.cjs.map +1 -0
- package/dist/org-C4cVovOM.cjs +14 -0
- package/dist/org-C4cVovOM.cjs.map +1 -0
- package/dist/org-CPhTRTks.mjs +14 -0
- package/dist/org-CPhTRTks.mjs.map +1 -0
- package/dist/org-context-Bewx2NEW.cjs +30 -0
- package/dist/org-context-Bewx2NEW.cjs.map +1 -0
- package/dist/org-context-D0dwWC2M.mjs +25 -0
- package/dist/org-context-D0dwWC2M.mjs.map +1 -0
- package/dist/parse-BeO2IwfI.cjs +229 -0
- package/dist/parse-BeO2IwfI.cjs.map +1 -0
- package/dist/parse-CA5fBB3x.mjs +150 -0
- package/dist/parse-CA5fBB3x.mjs.map +1 -0
- package/dist/project-CNr9xMny.cjs +20 -0
- package/dist/project-CNr9xMny.cjs.map +1 -0
- package/dist/project-DFoHcXi5.mjs +20 -0
- package/dist/project-DFoHcXi5.mjs.map +1 -0
- package/dist/project-name-CEoM-OL4.cjs +18 -0
- package/dist/project-name-CEoM-OL4.cjs.map +1 -0
- package/dist/project-name-DNMejnzZ.mjs +12 -0
- package/dist/project-name-DNMejnzZ.mjs.map +1 -0
- package/dist/project-user-9D7Ey_Fu.mjs +20 -0
- package/dist/project-user-9D7Ey_Fu.mjs.map +1 -0
- package/dist/project-user-DTPFjyfZ.cjs +20 -0
- package/dist/project-user-DTPFjyfZ.cjs.map +1 -0
- package/dist/push-0u6PDz4E.cjs +166 -0
- package/dist/push-0u6PDz4E.cjs.map +1 -0
- package/dist/push-D7co0keA.mjs +166 -0
- package/dist/push-D7co0keA.mjs.map +1 -0
- package/dist/run-codegen-Ceeosw5x.cjs +272 -0
- package/dist/run-codegen-Ceeosw5x.cjs.map +1 -0
- package/dist/run-codegen-DgaFaIQ1.mjs +190 -0
- package/dist/run-codegen-DgaFaIQ1.mjs.map +1 -0
- package/dist/run-with-context-CVhmzAFZ.mjs +876 -0
- package/dist/run-with-context-CVhmzAFZ.mjs.map +1 -0
- package/dist/run-with-context-DJNnEigg.cjs +943 -0
- package/dist/run-with-context-DJNnEigg.cjs.map +1 -0
- package/dist/schema-DDzrgjkT.mjs +20 -0
- package/dist/schema-DDzrgjkT.mjs.map +1 -0
- package/dist/schema-DdhyEh81.cjs +20 -0
- package/dist/schema-DdhyEh81.cjs.map +1 -0
- package/dist/shared-CZZimGxc.mjs +35 -0
- package/dist/shared-CZZimGxc.mjs.map +1 -0
- package/dist/shared-DHRPzzKl.cjs +59 -0
- package/dist/shared-DHRPzzKl.cjs.map +1 -0
- package/dist/status-Dq_NJE71.cjs +49 -0
- package/dist/status-Dq_NJE71.cjs.map +1 -0
- package/dist/status-fWqXzV0P.mjs +49 -0
- package/dist/status-fWqXzV0P.mjs.map +1 -0
- package/dist/table-C74eOSh8.cjs +27 -0
- package/dist/table-C74eOSh8.cjs.map +1 -0
- package/dist/table-MHEfbnWO.mjs +20 -0
- package/dist/table-MHEfbnWO.mjs.map +1 -0
- package/dist/table-event-C16cp9nq.mjs +72 -0
- package/dist/table-event-C16cp9nq.mjs.map +1 -0
- package/dist/table-event-D7PPuS7E.cjs +101 -0
- package/dist/table-event-D7PPuS7E.cjs.map +1 -0
- package/dist/token-store--9GYVL7N.cjs +139 -0
- package/dist/token-store--9GYVL7N.cjs.map +1 -0
- package/dist/token-store-reCGF86F.mjs +124 -0
- package/dist/token-store-reCGF86F.mjs.map +1 -0
- package/dist/update-8e3u4jKa.mjs +109 -0
- package/dist/update-8e3u4jKa.mjs.map +1 -0
- package/dist/update-CDLviRuu.cjs +73 -0
- package/dist/update-CDLviRuu.cjs.map +1 -0
- package/dist/update-CSiOfiPL.mjs +117 -0
- package/dist/update-CSiOfiPL.mjs.map +1 -0
- package/dist/update-CjbcI8Qc.mjs +61 -0
- package/dist/update-CjbcI8Qc.mjs.map +1 -0
- package/dist/update-Cktd0zXA.cjs +109 -0
- package/dist/update-Cktd0zXA.cjs.map +1 -0
- package/dist/update-D-X32BVW.cjs +117 -0
- package/dist/update-D-X32BVW.cjs.map +1 -0
- package/dist/update-DfYV_TQb.mjs +171 -0
- package/dist/update-DfYV_TQb.mjs.map +1 -0
- package/dist/update-OWC5K8Ne.cjs +61 -0
- package/dist/update-OWC5K8Ne.cjs.map +1 -0
- package/dist/update-ap5Qv1Yl.cjs +171 -0
- package/dist/update-ap5Qv1Yl.cjs.map +1 -0
- package/dist/update-yscrx6WQ.mjs +73 -0
- package/dist/update-yscrx6WQ.mjs.map +1 -0
- package/dist/upload-C43ZXxyb.cjs +95 -0
- package/dist/upload-C43ZXxyb.cjs.map +1 -0
- package/dist/upload-DGgJ1TQk.mjs +94 -0
- package/dist/upload-DGgJ1TQk.mjs.map +1 -0
- package/dist/validate-BpxZ8LTl.cjs +31 -0
- package/dist/validate-BpxZ8LTl.cjs.map +1 -0
- package/dist/validate-Ca0CRo16.mjs +31 -0
- package/dist/validate-Ca0CRo16.mjs.map +1 -0
- package/dist/webhook-3zs6Ulxd.mjs +20 -0
- package/dist/webhook-3zs6Ulxd.mjs.map +1 -0
- package/dist/webhook-BsygMMf-.cjs +20 -0
- package/dist/webhook-BsygMMf-.cjs.map +1 -0
- package/package.json +27 -16
- package/bin/index.js +0 -3
- package/dist/cli.cjs +0 -1978
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.d.cts +0 -2
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -1954
- package/dist/cli.js.map +0 -1
- package/dist/config/index.js +0 -81
- package/dist/config/index.js.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as defineCommand } from "./cli/main.mjs";
|
|
2
|
+
import { r as contextArgs } from "./shared-CZZimGxc.mjs";
|
|
3
|
+
import { a as apiErrorFailure, n as runWithContext, u as toResult } from "./run-with-context-CVhmzAFZ.mjs";
|
|
4
|
+
import { t as confirmDeletion } from "./confirm-delete-CsWkW69-.mjs";
|
|
5
|
+
import { Result } from "@praha/byethrow";
|
|
6
|
+
|
|
7
|
+
//#region src/cli/commands/bucket/object/delete.ts
|
|
8
|
+
async function bucketObjectDeleteHandler(ctx, options) {
|
|
9
|
+
const confirmed = await confirmDeletion(`object ${options.key} in bucket ${options.bucket}`, options.yes);
|
|
10
|
+
if (Result.isFailure(confirmed)) return confirmed;
|
|
11
|
+
const deleted = toResult(await ctx.client.DELETE("/projects/{projectName}/buckets/{bucketName}/objects/{objectKey}", { params: { path: {
|
|
12
|
+
projectName: ctx.projectName,
|
|
13
|
+
bucketName: options.bucket,
|
|
14
|
+
objectKey: options.key
|
|
15
|
+
} } }));
|
|
16
|
+
if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);
|
|
17
|
+
return Result.succeed({
|
|
18
|
+
json: {
|
|
19
|
+
deleted: true,
|
|
20
|
+
bucket: options.bucket,
|
|
21
|
+
key: options.key
|
|
22
|
+
},
|
|
23
|
+
text: () => `Deleted object ${options.key} from bucket ${options.bucket}.`
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const deleteArgs = {
|
|
27
|
+
...contextArgs,
|
|
28
|
+
bucket: {
|
|
29
|
+
type: "positional",
|
|
30
|
+
required: true,
|
|
31
|
+
description: "Bucket name"
|
|
32
|
+
},
|
|
33
|
+
key: {
|
|
34
|
+
type: "positional",
|
|
35
|
+
required: true,
|
|
36
|
+
description: "Object key"
|
|
37
|
+
},
|
|
38
|
+
yes: {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
description: "Skip the confirmation prompt",
|
|
41
|
+
default: false
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var delete_default = defineCommand({
|
|
45
|
+
meta: {
|
|
46
|
+
name: "delete",
|
|
47
|
+
description: "Delete a bucket object"
|
|
48
|
+
},
|
|
49
|
+
args: deleteArgs,
|
|
50
|
+
run: ({ args }) => runWithContext(args, (ctx) => bucketObjectDeleteHandler(ctx, {
|
|
51
|
+
bucket: args.bucket,
|
|
52
|
+
key: args.key,
|
|
53
|
+
yes: args.yes === true
|
|
54
|
+
}))
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { delete_default as default };
|
|
59
|
+
//# sourceMappingURL=delete-BSLIXrAh.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-BSLIXrAh.mjs","names":[],"sources":["../src/cli/commands/bucket/object/delete.ts"],"sourcesContent":["import type { ArgsDef } from \"citty\";\nimport { Result } from \"@praha/byethrow\";\nimport {\n defineCommand,\n type CommandFailure,\n type CommandOutput,\n} from \"../../define-command.js\";\nimport { contextArgs } from \"../../shared.js\";\nimport { runWithContext, type CommandContext } from \"../../run-with-context.js\";\nimport { apiErrorFailure } from \"../../api-errors.js\";\nimport { toResult } from \"../../../api/errors.js\";\nimport { confirmDeletion } from \"../../confirm-delete.js\";\n\nexport async function bucketObjectDeleteHandler(\n ctx: CommandContext,\n options: { bucket: string; key: string; yes: boolean },\n): Promise<Result.Result<CommandOutput | undefined, CommandFailure>> {\n const confirmed = await confirmDeletion(\n `object ${options.key} in bucket ${options.bucket}`,\n options.yes,\n );\n if (Result.isFailure(confirmed)) return confirmed;\n\n const deleted = toResult(\n await ctx.client.DELETE(\n \"/projects/{projectName}/buckets/{bucketName}/objects/{objectKey}\",\n {\n params: {\n path: {\n projectName: ctx.projectName,\n bucketName: options.bucket,\n objectKey: options.key,\n },\n },\n },\n ),\n );\n if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);\n\n return Result.succeed({\n json: { deleted: true, bucket: options.bucket, key: options.key },\n text: () => `Deleted object ${options.key} from bucket ${options.bucket}.`,\n });\n}\n\nconst deleteArgs = {\n ...contextArgs,\n bucket: {\n type: \"positional\",\n required: true,\n description: \"Bucket name\",\n },\n key: {\n type: \"positional\",\n required: true,\n description: \"Object key\",\n },\n yes: {\n type: \"boolean\",\n description: \"Skip the confirmation prompt\",\n default: false,\n },\n} satisfies ArgsDef;\n\nexport default defineCommand({\n meta: {\n name: \"delete\",\n description: \"Delete a bucket object\",\n },\n args: deleteArgs,\n run: ({ args }) =>\n runWithContext(args, (ctx) =>\n bucketObjectDeleteHandler(ctx, {\n bucket: args.bucket,\n key: args.key,\n yes: args.yes === true,\n }),\n ),\n});\n"],"mappings":";;;;;;;AAaA,eAAsB,0BACpB,KACA,SACmE;CACnE,MAAM,YAAY,MAAM,gBACtB,UAAU,QAAQ,IAAI,aAAa,QAAQ,UAC3C,QAAQ,GACV;CACA,IAAI,OAAO,UAAU,SAAS,GAAG,OAAO;CAExC,MAAM,UAAU,SACd,MAAM,IAAI,OAAO,OACf,oEACA,EACE,QAAQ,EACN,MAAM;EACJ,aAAa,IAAI;EACjB,YAAY,QAAQ;EACpB,WAAW,QAAQ;CACrB,EACF,EACF,CACF,CACF;CACA,IAAI,OAAO,UAAU,OAAO,GAAG,OAAO,gBAAgB,QAAQ,KAAK;CAEnE,OAAO,OAAO,QAAQ;EACpB,MAAM;GAAE,SAAS;GAAM,QAAQ,QAAQ;GAAQ,KAAK,QAAQ;EAAI;EAChE,YAAY,kBAAkB,QAAQ,IAAI,eAAe,QAAQ,OAAO;CAC1E,CAAC;AACH;AAEA,MAAM,aAAa;CACjB,GAAG;CACH,QAAQ;EACN,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,aAAa;EACb,SAAS;CACX;AACF;AAEA,qBAAe,cAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;CACN,MAAM,EAAE,WACN,eAAe,OAAO,QACpB,0BAA0B,KAAK;EAC7B,QAAQ,KAAK;EACb,KAAK,KAAK;EACV,KAAK,KAAK,QAAQ;CACpB,CAAC,CACH;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { t as defineCommand } from "./cli/main.mjs";
|
|
2
|
+
import { r as contextArgs } from "./shared-CZZimGxc.mjs";
|
|
3
|
+
import { a as apiErrorFailure, n as runWithContext, u as toResult } from "./run-with-context-CVhmzAFZ.mjs";
|
|
4
|
+
import { t as confirmDeletion } from "./confirm-delete-CsWkW69-.mjs";
|
|
5
|
+
import { u as parsePositionalId } from "./parse-CA5fBB3x.mjs";
|
|
6
|
+
import { Result } from "@praha/byethrow";
|
|
7
|
+
|
|
8
|
+
//#region src/cli/commands/key/management/delete.ts
|
|
9
|
+
async function keyManagementDeleteHandler(ctx, options) {
|
|
10
|
+
const confirmed = await confirmDeletion(`management key ${options.id}`, options.yes);
|
|
11
|
+
if (Result.isFailure(confirmed)) return confirmed;
|
|
12
|
+
const deleted = toResult(await ctx.client.DELETE("/projects/{projectName}/management-keys/{projectManagementKeyId}", { params: { path: {
|
|
13
|
+
projectName: ctx.projectName,
|
|
14
|
+
projectManagementKeyId: options.id
|
|
15
|
+
} } }));
|
|
16
|
+
if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);
|
|
17
|
+
return Result.succeed({
|
|
18
|
+
json: {
|
|
19
|
+
deleted: true,
|
|
20
|
+
id: options.id
|
|
21
|
+
},
|
|
22
|
+
text: () => `Deleted management key ${options.id}.`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const deleteArgs = {
|
|
26
|
+
...contextArgs,
|
|
27
|
+
id: {
|
|
28
|
+
type: "positional",
|
|
29
|
+
required: true,
|
|
30
|
+
description: "Numeric management key ID"
|
|
31
|
+
},
|
|
32
|
+
yes: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: "Skip the confirmation prompt",
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var delete_default = defineCommand({
|
|
39
|
+
meta: {
|
|
40
|
+
name: "delete",
|
|
41
|
+
description: "Delete a management key"
|
|
42
|
+
},
|
|
43
|
+
args: deleteArgs,
|
|
44
|
+
run: async ({ args }) => {
|
|
45
|
+
const id = parsePositionalId("management key ID", args.id);
|
|
46
|
+
if (Result.isFailure(id)) return id;
|
|
47
|
+
return runWithContext(args, (ctx) => keyManagementDeleteHandler(ctx, {
|
|
48
|
+
id: id.value,
|
|
49
|
+
yes: args.yes === true
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { delete_default as default };
|
|
56
|
+
//# sourceMappingURL=delete-BenBNL2p.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-BenBNL2p.mjs","names":[],"sources":["../src/cli/commands/key/management/delete.ts"],"sourcesContent":["import type { ArgsDef } from \"citty\";\nimport { Result } from \"@praha/byethrow\";\nimport {\n defineCommand,\n type CommandFailure,\n type CommandOutput,\n} from \"../../define-command.js\";\nimport { contextArgs } from \"../../shared.js\";\nimport { runWithContext, type CommandContext } from \"../../run-with-context.js\";\nimport { apiErrorFailure } from \"../../api-errors.js\";\nimport { toResult } from \"../../../api/errors.js\";\nimport { confirmDeletion } from \"../../confirm-delete.js\";\nimport { parsePositionalId } from \"../../parse.js\";\n\nexport async function keyManagementDeleteHandler(\n ctx: CommandContext,\n options: { id: number; yes: boolean },\n): Promise<Result.Result<CommandOutput | undefined, CommandFailure>> {\n const confirmed = await confirmDeletion(\n `management key ${options.id}`,\n options.yes,\n );\n if (Result.isFailure(confirmed)) return confirmed;\n\n const deleted = toResult(\n await ctx.client.DELETE(\n \"/projects/{projectName}/management-keys/{projectManagementKeyId}\",\n {\n params: {\n path: {\n projectName: ctx.projectName,\n projectManagementKeyId: options.id,\n },\n },\n },\n ),\n );\n if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);\n\n return Result.succeed({\n json: { deleted: true, id: options.id },\n text: () => `Deleted management key ${options.id}.`,\n });\n}\n\nconst deleteArgs = {\n ...contextArgs,\n id: {\n type: \"positional\",\n required: true,\n description: \"Numeric management key ID\",\n },\n yes: {\n type: \"boolean\",\n description: \"Skip the confirmation prompt\",\n default: false,\n },\n} satisfies ArgsDef;\n\nexport default defineCommand({\n meta: {\n name: \"delete\",\n description: \"Delete a management key\",\n },\n args: deleteArgs,\n run: async ({ args }) => {\n const id = parsePositionalId(\"management key ID\", args.id);\n if (Result.isFailure(id)) return id;\n\n return runWithContext(args, (ctx) =>\n keyManagementDeleteHandler(ctx, { id: id.value, yes: args.yes === true }),\n );\n },\n});\n"],"mappings":";;;;;;;;AAcA,eAAsB,2BACpB,KACA,SACmE;CACnE,MAAM,YAAY,MAAM,gBACtB,kBAAkB,QAAQ,MAC1B,QAAQ,GACV;CACA,IAAI,OAAO,UAAU,SAAS,GAAG,OAAO;CAExC,MAAM,UAAU,SACd,MAAM,IAAI,OAAO,OACf,oEACA,EACE,QAAQ,EACN,MAAM;EACJ,aAAa,IAAI;EACjB,wBAAwB,QAAQ;CAClC,EACF,EACF,CACF,CACF;CACA,IAAI,OAAO,UAAU,OAAO,GAAG,OAAO,gBAAgB,QAAQ,KAAK;CAEnE,OAAO,OAAO,QAAQ;EACpB,MAAM;GAAE,SAAS;GAAM,IAAI,QAAQ;EAAG;EACtC,YAAY,0BAA0B,QAAQ,GAAG;CACnD,CAAC;AACH;AAEA,MAAM,aAAa;CACjB,GAAG;CACH,IAAI;EACF,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,aAAa;EACb,SAAS;CACX;AACF;AAEA,qBAAe,cAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;CACN,KAAK,OAAO,EAAE,WAAW;EACvB,MAAM,KAAK,kBAAkB,qBAAqB,KAAK,EAAE;EACzD,IAAI,OAAO,UAAU,EAAE,GAAG,OAAO;EAEjC,OAAO,eAAe,OAAO,QAC3B,2BAA2B,KAAK;GAAE,IAAI,GAAG;GAAO,KAAK,KAAK,QAAQ;EAAK,CAAC,CAC1E;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const require_cli_main = require('./cli/main.cjs');
|
|
2
|
+
const require_shared = require('./shared-DHRPzzKl.cjs');
|
|
3
|
+
const require_run_with_context = require('./run-with-context-DJNnEigg.cjs');
|
|
4
|
+
const require_confirm_delete = require('./confirm-delete-B9o73U7B.cjs');
|
|
5
|
+
const require_parse = require('./parse-BeO2IwfI.cjs');
|
|
6
|
+
let _praha_byethrow = require("@praha/byethrow");
|
|
7
|
+
|
|
8
|
+
//#region src/cli/commands/webhook/delete.ts
|
|
9
|
+
async function webhookDeleteHandler(ctx, options) {
|
|
10
|
+
const confirmed = await require_confirm_delete.confirmDeletion(`webhook ${options.webhookId}`, options.yes);
|
|
11
|
+
if (_praha_byethrow.Result.isFailure(confirmed)) return confirmed;
|
|
12
|
+
const deleted = require_run_with_context.toResult(await ctx.client.DELETE("/projects/{projectName}/webhooks/{webhookId}", { params: { path: {
|
|
13
|
+
projectName: ctx.projectName,
|
|
14
|
+
webhookId: options.webhookId
|
|
15
|
+
} } }));
|
|
16
|
+
if (_praha_byethrow.Result.isFailure(deleted)) return require_run_with_context.apiErrorFailure(deleted.error);
|
|
17
|
+
return _praha_byethrow.Result.succeed({
|
|
18
|
+
json: {
|
|
19
|
+
deleted: true,
|
|
20
|
+
id: options.webhookId
|
|
21
|
+
},
|
|
22
|
+
text: () => `Deleted webhook ${options.webhookId}.`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const deleteArgs = {
|
|
26
|
+
...require_shared.contextArgs,
|
|
27
|
+
id: {
|
|
28
|
+
type: "positional",
|
|
29
|
+
required: true,
|
|
30
|
+
description: "Numeric webhook ID"
|
|
31
|
+
},
|
|
32
|
+
yes: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: "Skip the confirmation prompt",
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var delete_default = require_cli_main.defineCommand({
|
|
39
|
+
meta: {
|
|
40
|
+
name: "delete",
|
|
41
|
+
description: "Delete a webhook"
|
|
42
|
+
},
|
|
43
|
+
args: deleteArgs,
|
|
44
|
+
run: async ({ args }) => {
|
|
45
|
+
const webhookId = require_parse.parsePositionalId("webhook ID", args.id);
|
|
46
|
+
if (_praha_byethrow.Result.isFailure(webhookId)) return webhookId;
|
|
47
|
+
return require_run_with_context.runWithContext(args, (ctx) => webhookDeleteHandler(ctx, {
|
|
48
|
+
webhookId: webhookId.value,
|
|
49
|
+
yes: args.yes === true
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.default = delete_default;
|
|
56
|
+
//# sourceMappingURL=delete-Bx2oNROv.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-Bx2oNROv.cjs","names":["confirmDeletion","Result","toResult","apiErrorFailure","contextArgs","defineCommand","parsePositionalId","runWithContext"],"sources":["../src/cli/commands/webhook/delete.ts"],"sourcesContent":["import type { ArgsDef } from \"citty\";\nimport { Result } from \"@praha/byethrow\";\nimport {\n defineCommand,\n type CommandFailure,\n type CommandOutput,\n} from \"../define-command.js\";\nimport { contextArgs } from \"../shared.js\";\nimport { runWithContext, type CommandContext } from \"../run-with-context.js\";\nimport { apiErrorFailure } from \"../api-errors.js\";\nimport { toResult } from \"../../api/errors.js\";\nimport { confirmDeletion } from \"../confirm-delete.js\";\nimport { parsePositionalId } from \"../parse.js\";\n\nexport async function webhookDeleteHandler(\n ctx: CommandContext,\n options: { webhookId: number; yes: boolean },\n): Promise<Result.Result<CommandOutput | undefined, CommandFailure>> {\n const confirmed = await confirmDeletion(\n `webhook ${options.webhookId}`,\n options.yes,\n );\n if (Result.isFailure(confirmed)) return confirmed;\n\n const deleted = toResult(\n await ctx.client.DELETE(\"/projects/{projectName}/webhooks/{webhookId}\", {\n params: {\n path: { projectName: ctx.projectName, webhookId: options.webhookId },\n },\n }),\n );\n if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);\n\n return Result.succeed({\n json: { deleted: true, id: options.webhookId },\n text: () => `Deleted webhook ${options.webhookId}.`,\n });\n}\n\nconst deleteArgs = {\n ...contextArgs,\n id: {\n type: \"positional\",\n required: true,\n description: \"Numeric webhook ID\",\n },\n yes: {\n type: \"boolean\",\n description: \"Skip the confirmation prompt\",\n default: false,\n },\n} satisfies ArgsDef;\n\nexport default defineCommand({\n meta: {\n name: \"delete\",\n description: \"Delete a webhook\",\n },\n args: deleteArgs,\n run: async ({ args }) => {\n const webhookId = parsePositionalId(\"webhook ID\", args.id);\n if (Result.isFailure(webhookId)) return webhookId;\n\n return runWithContext(args, (ctx) =>\n webhookDeleteHandler(ctx, {\n webhookId: webhookId.value,\n yes: args.yes === true,\n }),\n );\n },\n});\n"],"mappings":";;;;;;;;AAcA,eAAsB,qBACpB,KACA,SACmE;CACnE,MAAM,YAAY,MAAMA,uCACtB,WAAW,QAAQ,aACnB,QAAQ,GACV;CACA,IAAIC,uBAAO,UAAU,SAAS,GAAG,OAAO;CAExC,MAAM,UAAUC,kCACd,MAAM,IAAI,OAAO,OAAO,gDAAgD,EACtE,QAAQ,EACN,MAAM;EAAE,aAAa,IAAI;EAAa,WAAW,QAAQ;CAAU,EACrE,EACF,CAAC,CACH;CACA,IAAID,uBAAO,UAAU,OAAO,GAAG,OAAOE,yCAAgB,QAAQ,KAAK;CAEnE,OAAOF,uBAAO,QAAQ;EACpB,MAAM;GAAE,SAAS;GAAM,IAAI,QAAQ;EAAU;EAC7C,YAAY,mBAAmB,QAAQ,UAAU;CACnD,CAAC;AACH;AAEA,MAAM,aAAa;CACjB,GAAGG;CACH,IAAI;EACF,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,aAAa;EACb,SAAS;CACX;AACF;AAEA,qBAAeC,+BAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;CACN,KAAK,OAAO,EAAE,WAAW;EACvB,MAAM,YAAYC,gCAAkB,cAAc,KAAK,EAAE;EACzD,IAAIL,uBAAO,UAAU,SAAS,GAAG,OAAO;EAExC,OAAOM,wCAAe,OAAO,QAC3B,qBAAqB,KAAK;GACxB,WAAW,UAAU;GACrB,KAAK,KAAK,QAAQ;EACpB,CAAC,CACH;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const require_cli_main = require('./cli/main.cjs');
|
|
2
|
+
const require_shared = require('./shared-DHRPzzKl.cjs');
|
|
3
|
+
const require_run_with_context = require('./run-with-context-DJNnEigg.cjs');
|
|
4
|
+
const require_confirm_delete = require('./confirm-delete-B9o73U7B.cjs');
|
|
5
|
+
let _praha_byethrow = require("@praha/byethrow");
|
|
6
|
+
|
|
7
|
+
//#region src/cli/commands/project-user/delete.ts
|
|
8
|
+
async function projectUserDeleteHandler(ctx, options) {
|
|
9
|
+
const confirmed = await require_confirm_delete.confirmDeletion(`project user ${options.userId}`, options.yes);
|
|
10
|
+
if (_praha_byethrow.Result.isFailure(confirmed)) return confirmed;
|
|
11
|
+
const deleted = require_run_with_context.toResult(await ctx.client.DELETE("/projects/{projectName}/users/{userId}", { params: { path: {
|
|
12
|
+
projectName: ctx.projectName,
|
|
13
|
+
userId: options.userId
|
|
14
|
+
} } }));
|
|
15
|
+
if (_praha_byethrow.Result.isFailure(deleted)) return require_run_with_context.apiErrorFailure(deleted.error);
|
|
16
|
+
return _praha_byethrow.Result.succeed({
|
|
17
|
+
json: {
|
|
18
|
+
deleted: true,
|
|
19
|
+
userId: options.userId
|
|
20
|
+
},
|
|
21
|
+
text: () => `Removed project user ${options.userId}.`
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const deleteArgs = {
|
|
25
|
+
...require_shared.contextArgs,
|
|
26
|
+
"user-id": {
|
|
27
|
+
type: "positional",
|
|
28
|
+
required: true,
|
|
29
|
+
description: "Project user ID"
|
|
30
|
+
},
|
|
31
|
+
yes: {
|
|
32
|
+
type: "boolean",
|
|
33
|
+
description: "Skip the confirmation prompt",
|
|
34
|
+
default: false
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var delete_default = require_cli_main.defineCommand({
|
|
38
|
+
meta: {
|
|
39
|
+
name: "delete",
|
|
40
|
+
description: "Remove a user from the project"
|
|
41
|
+
},
|
|
42
|
+
args: deleteArgs,
|
|
43
|
+
run: ({ args }) => require_run_with_context.runWithContext(args, (ctx) => projectUserDeleteHandler(ctx, {
|
|
44
|
+
userId: args["user-id"],
|
|
45
|
+
yes: args.yes === true
|
|
46
|
+
}))
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.default = delete_default;
|
|
51
|
+
//# sourceMappingURL=delete-CCTiCYIL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-CCTiCYIL.cjs","names":["confirmDeletion","Result","toResult","apiErrorFailure","contextArgs","defineCommand","runWithContext"],"sources":["../src/cli/commands/project-user/delete.ts"],"sourcesContent":["import type { ArgsDef } from \"citty\";\nimport { Result } from \"@praha/byethrow\";\nimport {\n defineCommand,\n type CommandFailure,\n type CommandOutput,\n} from \"../define-command.js\";\nimport { contextArgs } from \"../shared.js\";\nimport { runWithContext, type CommandContext } from \"../run-with-context.js\";\nimport { apiErrorFailure } from \"../api-errors.js\";\nimport { toResult } from \"../../api/errors.js\";\nimport { confirmDeletion } from \"../confirm-delete.js\";\n\nexport async function projectUserDeleteHandler(\n ctx: CommandContext,\n options: { userId: string; yes: boolean },\n): Promise<Result.Result<CommandOutput | undefined, CommandFailure>> {\n const confirmed = await confirmDeletion(\n `project user ${options.userId}`,\n options.yes,\n );\n if (Result.isFailure(confirmed)) return confirmed;\n\n const deleted = toResult(\n await ctx.client.DELETE(\"/projects/{projectName}/users/{userId}\", {\n params: {\n path: { projectName: ctx.projectName, userId: options.userId },\n },\n }),\n );\n if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);\n\n return Result.succeed({\n json: { deleted: true, userId: options.userId },\n text: () => `Removed project user ${options.userId}.`,\n });\n}\n\nconst deleteArgs = {\n ...contextArgs,\n \"user-id\": {\n type: \"positional\",\n required: true,\n description: \"Project user ID\",\n },\n yes: {\n type: \"boolean\",\n description: \"Skip the confirmation prompt\",\n default: false,\n },\n} satisfies ArgsDef;\n\nexport default defineCommand({\n meta: {\n name: \"delete\",\n description: \"Remove a user from the project\",\n },\n args: deleteArgs,\n run: ({ args }) =>\n runWithContext(args, (ctx) =>\n projectUserDeleteHandler(ctx, {\n userId: args[\"user-id\"],\n yes: args.yes === true,\n }),\n ),\n});\n"],"mappings":";;;;;;;AAaA,eAAsB,yBACpB,KACA,SACmE;CACnE,MAAM,YAAY,MAAMA,uCACtB,gBAAgB,QAAQ,UACxB,QAAQ,GACV;CACA,IAAIC,uBAAO,UAAU,SAAS,GAAG,OAAO;CAExC,MAAM,UAAUC,kCACd,MAAM,IAAI,OAAO,OAAO,0CAA0C,EAChE,QAAQ,EACN,MAAM;EAAE,aAAa,IAAI;EAAa,QAAQ,QAAQ;CAAO,EAC/D,EACF,CAAC,CACH;CACA,IAAID,uBAAO,UAAU,OAAO,GAAG,OAAOE,yCAAgB,QAAQ,KAAK;CAEnE,OAAOF,uBAAO,QAAQ;EACpB,MAAM;GAAE,SAAS;GAAM,QAAQ,QAAQ;EAAO;EAC9C,YAAY,wBAAwB,QAAQ,OAAO;CACrD,CAAC;AACH;AAEA,MAAM,aAAa;CACjB,GAAGG;CACH,WAAW;EACT,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,aAAa;EACb,SAAS;CACX;AACF;AAEA,qBAAeC,+BAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;CACN,MAAM,EAAE,WACNC,wCAAe,OAAO,QACpB,yBAAyB,KAAK;EAC5B,QAAQ,KAAK;EACb,KAAK,KAAK,QAAQ;CACpB,CAAC,CACH;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const require_cli_main = require('./cli/main.cjs');
|
|
2
|
+
const require_shared = require('./shared-DHRPzzKl.cjs');
|
|
3
|
+
const require_run_with_context = require('./run-with-context-DJNnEigg.cjs');
|
|
4
|
+
const require_confirm_delete = require('./confirm-delete-B9o73U7B.cjs');
|
|
5
|
+
const require_parse = require('./parse-BeO2IwfI.cjs');
|
|
6
|
+
let _praha_byethrow = require("@praha/byethrow");
|
|
7
|
+
|
|
8
|
+
//#region src/cli/commands/key/management/delete.ts
|
|
9
|
+
async function keyManagementDeleteHandler(ctx, options) {
|
|
10
|
+
const confirmed = await require_confirm_delete.confirmDeletion(`management key ${options.id}`, options.yes);
|
|
11
|
+
if (_praha_byethrow.Result.isFailure(confirmed)) return confirmed;
|
|
12
|
+
const deleted = require_run_with_context.toResult(await ctx.client.DELETE("/projects/{projectName}/management-keys/{projectManagementKeyId}", { params: { path: {
|
|
13
|
+
projectName: ctx.projectName,
|
|
14
|
+
projectManagementKeyId: options.id
|
|
15
|
+
} } }));
|
|
16
|
+
if (_praha_byethrow.Result.isFailure(deleted)) return require_run_with_context.apiErrorFailure(deleted.error);
|
|
17
|
+
return _praha_byethrow.Result.succeed({
|
|
18
|
+
json: {
|
|
19
|
+
deleted: true,
|
|
20
|
+
id: options.id
|
|
21
|
+
},
|
|
22
|
+
text: () => `Deleted management key ${options.id}.`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const deleteArgs = {
|
|
26
|
+
...require_shared.contextArgs,
|
|
27
|
+
id: {
|
|
28
|
+
type: "positional",
|
|
29
|
+
required: true,
|
|
30
|
+
description: "Numeric management key ID"
|
|
31
|
+
},
|
|
32
|
+
yes: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: "Skip the confirmation prompt",
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var delete_default = require_cli_main.defineCommand({
|
|
39
|
+
meta: {
|
|
40
|
+
name: "delete",
|
|
41
|
+
description: "Delete a management key"
|
|
42
|
+
},
|
|
43
|
+
args: deleteArgs,
|
|
44
|
+
run: async ({ args }) => {
|
|
45
|
+
const id = require_parse.parsePositionalId("management key ID", args.id);
|
|
46
|
+
if (_praha_byethrow.Result.isFailure(id)) return id;
|
|
47
|
+
return require_run_with_context.runWithContext(args, (ctx) => keyManagementDeleteHandler(ctx, {
|
|
48
|
+
id: id.value,
|
|
49
|
+
yes: args.yes === true
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.default = delete_default;
|
|
56
|
+
//# sourceMappingURL=delete-CGW0VMK6.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-CGW0VMK6.cjs","names":["confirmDeletion","Result","toResult","apiErrorFailure","contextArgs","defineCommand","parsePositionalId","runWithContext"],"sources":["../src/cli/commands/key/management/delete.ts"],"sourcesContent":["import type { ArgsDef } from \"citty\";\nimport { Result } from \"@praha/byethrow\";\nimport {\n defineCommand,\n type CommandFailure,\n type CommandOutput,\n} from \"../../define-command.js\";\nimport { contextArgs } from \"../../shared.js\";\nimport { runWithContext, type CommandContext } from \"../../run-with-context.js\";\nimport { apiErrorFailure } from \"../../api-errors.js\";\nimport { toResult } from \"../../../api/errors.js\";\nimport { confirmDeletion } from \"../../confirm-delete.js\";\nimport { parsePositionalId } from \"../../parse.js\";\n\nexport async function keyManagementDeleteHandler(\n ctx: CommandContext,\n options: { id: number; yes: boolean },\n): Promise<Result.Result<CommandOutput | undefined, CommandFailure>> {\n const confirmed = await confirmDeletion(\n `management key ${options.id}`,\n options.yes,\n );\n if (Result.isFailure(confirmed)) return confirmed;\n\n const deleted = toResult(\n await ctx.client.DELETE(\n \"/projects/{projectName}/management-keys/{projectManagementKeyId}\",\n {\n params: {\n path: {\n projectName: ctx.projectName,\n projectManagementKeyId: options.id,\n },\n },\n },\n ),\n );\n if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);\n\n return Result.succeed({\n json: { deleted: true, id: options.id },\n text: () => `Deleted management key ${options.id}.`,\n });\n}\n\nconst deleteArgs = {\n ...contextArgs,\n id: {\n type: \"positional\",\n required: true,\n description: \"Numeric management key ID\",\n },\n yes: {\n type: \"boolean\",\n description: \"Skip the confirmation prompt\",\n default: false,\n },\n} satisfies ArgsDef;\n\nexport default defineCommand({\n meta: {\n name: \"delete\",\n description: \"Delete a management key\",\n },\n args: deleteArgs,\n run: async ({ args }) => {\n const id = parsePositionalId(\"management key ID\", args.id);\n if (Result.isFailure(id)) return id;\n\n return runWithContext(args, (ctx) =>\n keyManagementDeleteHandler(ctx, { id: id.value, yes: args.yes === true }),\n );\n },\n});\n"],"mappings":";;;;;;;;AAcA,eAAsB,2BACpB,KACA,SACmE;CACnE,MAAM,YAAY,MAAMA,uCACtB,kBAAkB,QAAQ,MAC1B,QAAQ,GACV;CACA,IAAIC,uBAAO,UAAU,SAAS,GAAG,OAAO;CAExC,MAAM,UAAUC,kCACd,MAAM,IAAI,OAAO,OACf,oEACA,EACE,QAAQ,EACN,MAAM;EACJ,aAAa,IAAI;EACjB,wBAAwB,QAAQ;CAClC,EACF,EACF,CACF,CACF;CACA,IAAID,uBAAO,UAAU,OAAO,GAAG,OAAOE,yCAAgB,QAAQ,KAAK;CAEnE,OAAOF,uBAAO,QAAQ;EACpB,MAAM;GAAE,SAAS;GAAM,IAAI,QAAQ;EAAG;EACtC,YAAY,0BAA0B,QAAQ,GAAG;CACnD,CAAC;AACH;AAEA,MAAM,aAAa;CACjB,GAAGG;CACH,IAAI;EACF,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,aAAa;EACb,SAAS;CACX;AACF;AAEA,qBAAeC,+BAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;CACN,KAAK,OAAO,EAAE,WAAW;EACvB,MAAM,KAAKC,gCAAkB,qBAAqB,KAAK,EAAE;EACzD,IAAIL,uBAAO,UAAU,EAAE,GAAG,OAAO;EAEjC,OAAOM,wCAAe,OAAO,QAC3B,2BAA2B,KAAK;GAAE,IAAI,GAAG;GAAO,KAAK,KAAK,QAAQ;EAAK,CAAC,CAC1E;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const require_cli_main = require('./cli/main.cjs');
|
|
2
|
+
const require_shared = require('./shared-DHRPzzKl.cjs');
|
|
3
|
+
const require_run_with_context = require('./run-with-context-DJNnEigg.cjs');
|
|
4
|
+
const require_project_name = require('./project-name-CEoM-OL4.cjs');
|
|
5
|
+
let _praha_byethrow = require("@praha/byethrow");
|
|
6
|
+
|
|
7
|
+
//#region src/cli/commands/project/delete.ts
|
|
8
|
+
async function projectDeleteHandler(ctx, options) {
|
|
9
|
+
if (!options.yes) {
|
|
10
|
+
if (process.stdin.isTTY !== true) return _praha_byethrow.Result.fail({ message: "Refusing to delete without confirmation in a non-interactive shell. Re-run with --yes." });
|
|
11
|
+
require_cli_main.notice(`This permanently deletes project "${ctx.projectName}" and all of its content.`);
|
|
12
|
+
if (await require_run_with_context.promptText(`Type the project name to confirm deletion:`) !== ctx.projectName) return _praha_byethrow.Result.fail({ message: "Project name did not match. Aborted." });
|
|
13
|
+
}
|
|
14
|
+
const deleted = require_run_with_context.toResult(await ctx.client.DELETE("/projects/{projectName}", { params: { path: { projectName: ctx.projectName } } }));
|
|
15
|
+
if (_praha_byethrow.Result.isFailure(deleted)) return require_run_with_context.apiErrorFailure(deleted.error);
|
|
16
|
+
return _praha_byethrow.Result.succeed({
|
|
17
|
+
json: {
|
|
18
|
+
deleted: true,
|
|
19
|
+
projectName: ctx.projectName
|
|
20
|
+
},
|
|
21
|
+
text: () => `Deleted project ${ctx.projectName}.`
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const deleteArgs = {
|
|
25
|
+
...require_shared.contextArgs,
|
|
26
|
+
name: {
|
|
27
|
+
type: "positional",
|
|
28
|
+
required: false,
|
|
29
|
+
description: "Project name (defaults to the current project context)"
|
|
30
|
+
},
|
|
31
|
+
yes: {
|
|
32
|
+
type: "boolean",
|
|
33
|
+
description: "Skip the type-to-confirm prompt",
|
|
34
|
+
default: false
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var delete_default = require_cli_main.defineCommand({
|
|
38
|
+
meta: {
|
|
39
|
+
name: "delete",
|
|
40
|
+
description: "Delete a project and all of its content"
|
|
41
|
+
},
|
|
42
|
+
args: deleteArgs,
|
|
43
|
+
run: ({ args }) => require_run_with_context.runWithContext(require_project_name.projectNameOverride(args), (ctx) => projectDeleteHandler(ctx, { yes: args.yes === true }))
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
exports.default = delete_default;
|
|
48
|
+
//# sourceMappingURL=delete-CIYY59v_.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-CIYY59v_.cjs","names":["Result","promptText","toResult","apiErrorFailure","contextArgs","defineCommand","runWithContext","projectNameOverride"],"sources":["../src/cli/commands/project/delete.ts"],"sourcesContent":["import type { ArgsDef } from \"citty\";\nimport { Result } from \"@praha/byethrow\";\nimport {\n defineCommand,\n type CommandFailure,\n type CommandOutput,\n} from \"../define-command.js\";\nimport { contextArgs } from \"../shared.js\";\nimport { runWithContext, type CommandContext } from \"../run-with-context.js\";\nimport { apiErrorFailure } from \"../api-errors.js\";\nimport { toResult } from \"../../api/errors.js\";\nimport { notice } from \"../../ui/output.js\";\nimport { promptText } from \"../../ui/prompt.js\";\nimport { projectNameOverride } from \"./project-name.js\";\n\nexport async function projectDeleteHandler(\n ctx: CommandContext,\n options: { yes: boolean },\n): Promise<Result.Result<CommandOutput | undefined, CommandFailure>> {\n if (!options.yes) {\n if (process.stdin.isTTY !== true) {\n return Result.fail({\n message:\n \"Refusing to delete without confirmation in a non-interactive shell. Re-run with --yes.\",\n });\n }\n\n notice(\n `This permanently deletes project \"${ctx.projectName}\" and all of its content.`,\n );\n const typed = await promptText(\n `Type the project name to confirm deletion:`,\n );\n if (typed !== ctx.projectName) {\n return Result.fail({\n message: \"Project name did not match. Aborted.\",\n });\n }\n }\n\n const deleted = toResult(\n await ctx.client.DELETE(\"/projects/{projectName}\", {\n params: { path: { projectName: ctx.projectName } },\n }),\n );\n if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);\n\n return Result.succeed({\n json: { deleted: true, projectName: ctx.projectName },\n text: () => `Deleted project ${ctx.projectName}.`,\n });\n}\n\nconst deleteArgs = {\n ...contextArgs,\n name: {\n type: \"positional\",\n required: false,\n description: \"Project name (defaults to the current project context)\",\n },\n yes: {\n type: \"boolean\",\n description: \"Skip the type-to-confirm prompt\",\n default: false,\n },\n} satisfies ArgsDef;\n\nexport default defineCommand({\n meta: {\n name: \"delete\",\n description: \"Delete a project and all of its content\",\n },\n args: deleteArgs,\n run: ({ args }) =>\n runWithContext(projectNameOverride(args), (ctx) =>\n projectDeleteHandler(ctx, { yes: args.yes === true }),\n ),\n});\n"],"mappings":";;;;;;;AAeA,eAAsB,qBACpB,KACA,SACmE;CACnE,IAAI,CAAC,QAAQ,KAAK;EAChB,IAAI,QAAQ,MAAM,UAAU,MAC1B,OAAOA,uBAAO,KAAK,EACjB,SACE,yFACJ,CAAC;EAGH,wBACE,qCAAqC,IAAI,YAAY,0BACvD;EAIA,IAAI,MAHgBC,oCAClB,4CACF,MACc,IAAI,aAChB,OAAOD,uBAAO,KAAK,EACjB,SAAS,uCACX,CAAC;CAEL;CAEA,MAAM,UAAUE,kCACd,MAAM,IAAI,OAAO,OAAO,2BAA2B,EACjD,QAAQ,EAAE,MAAM,EAAE,aAAa,IAAI,YAAY,EAAE,EACnD,CAAC,CACH;CACA,IAAIF,uBAAO,UAAU,OAAO,GAAG,OAAOG,yCAAgB,QAAQ,KAAK;CAEnE,OAAOH,uBAAO,QAAQ;EACpB,MAAM;GAAE,SAAS;GAAM,aAAa,IAAI;EAAY;EACpD,YAAY,mBAAmB,IAAI,YAAY;CACjD,CAAC;AACH;AAEA,MAAM,aAAa;CACjB,GAAGI;CACH,MAAM;EACJ,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,aAAa;EACb,SAAS;CACX;AACF;AAEA,qBAAeC,+BAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;CACN,MAAM,EAAE,WACNC,wCAAeC,yCAAoB,IAAI,IAAI,QACzC,qBAAqB,KAAK,EAAE,KAAK,KAAK,QAAQ,KAAK,CAAC,CACtD;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { t as defineCommand } from "./cli/main.mjs";
|
|
2
|
+
import { r as contextArgs } from "./shared-CZZimGxc.mjs";
|
|
3
|
+
import { a as apiErrorFailure, n as runWithContext, u as toResult } from "./run-with-context-CVhmzAFZ.mjs";
|
|
4
|
+
import { t as confirmDeletion } from "./confirm-delete-CsWkW69-.mjs";
|
|
5
|
+
import { u as parsePositionalId } from "./parse-CA5fBB3x.mjs";
|
|
6
|
+
import { Result } from "@praha/byethrow";
|
|
7
|
+
|
|
8
|
+
//#region src/cli/commands/webhook/delete.ts
|
|
9
|
+
async function webhookDeleteHandler(ctx, options) {
|
|
10
|
+
const confirmed = await confirmDeletion(`webhook ${options.webhookId}`, options.yes);
|
|
11
|
+
if (Result.isFailure(confirmed)) return confirmed;
|
|
12
|
+
const deleted = toResult(await ctx.client.DELETE("/projects/{projectName}/webhooks/{webhookId}", { params: { path: {
|
|
13
|
+
projectName: ctx.projectName,
|
|
14
|
+
webhookId: options.webhookId
|
|
15
|
+
} } }));
|
|
16
|
+
if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);
|
|
17
|
+
return Result.succeed({
|
|
18
|
+
json: {
|
|
19
|
+
deleted: true,
|
|
20
|
+
id: options.webhookId
|
|
21
|
+
},
|
|
22
|
+
text: () => `Deleted webhook ${options.webhookId}.`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const deleteArgs = {
|
|
26
|
+
...contextArgs,
|
|
27
|
+
id: {
|
|
28
|
+
type: "positional",
|
|
29
|
+
required: true,
|
|
30
|
+
description: "Numeric webhook ID"
|
|
31
|
+
},
|
|
32
|
+
yes: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: "Skip the confirmation prompt",
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var delete_default = defineCommand({
|
|
39
|
+
meta: {
|
|
40
|
+
name: "delete",
|
|
41
|
+
description: "Delete a webhook"
|
|
42
|
+
},
|
|
43
|
+
args: deleteArgs,
|
|
44
|
+
run: async ({ args }) => {
|
|
45
|
+
const webhookId = parsePositionalId("webhook ID", args.id);
|
|
46
|
+
if (Result.isFailure(webhookId)) return webhookId;
|
|
47
|
+
return runWithContext(args, (ctx) => webhookDeleteHandler(ctx, {
|
|
48
|
+
webhookId: webhookId.value,
|
|
49
|
+
yes: args.yes === true
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { delete_default as default };
|
|
56
|
+
//# sourceMappingURL=delete-CSSd0gmt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-CSSd0gmt.mjs","names":[],"sources":["../src/cli/commands/webhook/delete.ts"],"sourcesContent":["import type { ArgsDef } from \"citty\";\nimport { Result } from \"@praha/byethrow\";\nimport {\n defineCommand,\n type CommandFailure,\n type CommandOutput,\n} from \"../define-command.js\";\nimport { contextArgs } from \"../shared.js\";\nimport { runWithContext, type CommandContext } from \"../run-with-context.js\";\nimport { apiErrorFailure } from \"../api-errors.js\";\nimport { toResult } from \"../../api/errors.js\";\nimport { confirmDeletion } from \"../confirm-delete.js\";\nimport { parsePositionalId } from \"../parse.js\";\n\nexport async function webhookDeleteHandler(\n ctx: CommandContext,\n options: { webhookId: number; yes: boolean },\n): Promise<Result.Result<CommandOutput | undefined, CommandFailure>> {\n const confirmed = await confirmDeletion(\n `webhook ${options.webhookId}`,\n options.yes,\n );\n if (Result.isFailure(confirmed)) return confirmed;\n\n const deleted = toResult(\n await ctx.client.DELETE(\"/projects/{projectName}/webhooks/{webhookId}\", {\n params: {\n path: { projectName: ctx.projectName, webhookId: options.webhookId },\n },\n }),\n );\n if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);\n\n return Result.succeed({\n json: { deleted: true, id: options.webhookId },\n text: () => `Deleted webhook ${options.webhookId}.`,\n });\n}\n\nconst deleteArgs = {\n ...contextArgs,\n id: {\n type: \"positional\",\n required: true,\n description: \"Numeric webhook ID\",\n },\n yes: {\n type: \"boolean\",\n description: \"Skip the confirmation prompt\",\n default: false,\n },\n} satisfies ArgsDef;\n\nexport default defineCommand({\n meta: {\n name: \"delete\",\n description: \"Delete a webhook\",\n },\n args: deleteArgs,\n run: async ({ args }) => {\n const webhookId = parsePositionalId(\"webhook ID\", args.id);\n if (Result.isFailure(webhookId)) return webhookId;\n\n return runWithContext(args, (ctx) =>\n webhookDeleteHandler(ctx, {\n webhookId: webhookId.value,\n yes: args.yes === true,\n }),\n );\n },\n});\n"],"mappings":";;;;;;;;AAcA,eAAsB,qBACpB,KACA,SACmE;CACnE,MAAM,YAAY,MAAM,gBACtB,WAAW,QAAQ,aACnB,QAAQ,GACV;CACA,IAAI,OAAO,UAAU,SAAS,GAAG,OAAO;CAExC,MAAM,UAAU,SACd,MAAM,IAAI,OAAO,OAAO,gDAAgD,EACtE,QAAQ,EACN,MAAM;EAAE,aAAa,IAAI;EAAa,WAAW,QAAQ;CAAU,EACrE,EACF,CAAC,CACH;CACA,IAAI,OAAO,UAAU,OAAO,GAAG,OAAO,gBAAgB,QAAQ,KAAK;CAEnE,OAAO,OAAO,QAAQ;EACpB,MAAM;GAAE,SAAS;GAAM,IAAI,QAAQ;EAAU;EAC7C,YAAY,mBAAmB,QAAQ,UAAU;CACnD,CAAC;AACH;AAEA,MAAM,aAAa;CACjB,GAAG;CACH,IAAI;EACF,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,aAAa;EACb,SAAS;CACX;AACF;AAEA,qBAAe,cAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;CACN,KAAK,OAAO,EAAE,WAAW;EACvB,MAAM,YAAY,kBAAkB,cAAc,KAAK,EAAE;EACzD,IAAI,OAAO,UAAU,SAAS,GAAG,OAAO;EAExC,OAAO,eAAe,OAAO,QAC3B,qBAAqB,KAAK;GACxB,WAAW,UAAU;GACrB,KAAK,KAAK,QAAQ;EACpB,CAAC,CACH;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as defineCommand } from "./cli/main.mjs";
|
|
2
|
+
import { r as contextArgs } from "./shared-CZZimGxc.mjs";
|
|
3
|
+
import { a as apiErrorFailure, n as runWithContext, u as toResult } from "./run-with-context-CVhmzAFZ.mjs";
|
|
4
|
+
import { t as confirmDeletion } from "./confirm-delete-CsWkW69-.mjs";
|
|
5
|
+
import { Result } from "@praha/byethrow";
|
|
6
|
+
|
|
7
|
+
//#region src/cli/commands/content/delete.ts
|
|
8
|
+
async function contentDeleteHandler(ctx, options) {
|
|
9
|
+
const confirmed = await confirmDeletion(`content ${options.contentId} in table ${options.table}`, options.yes);
|
|
10
|
+
if (Result.isFailure(confirmed)) return confirmed;
|
|
11
|
+
const deleted = toResult(await ctx.client.DELETE("/projects/{projectName}/tables/{tableName}/{contentId}", { params: { path: {
|
|
12
|
+
projectName: ctx.projectName,
|
|
13
|
+
tableName: options.table,
|
|
14
|
+
contentId: options.contentId
|
|
15
|
+
} } }));
|
|
16
|
+
if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);
|
|
17
|
+
return Result.succeed({
|
|
18
|
+
json: {
|
|
19
|
+
deleted: true,
|
|
20
|
+
table: options.table,
|
|
21
|
+
contentId: options.contentId
|
|
22
|
+
},
|
|
23
|
+
text: () => `Deleted content ${options.contentId} from table ${options.table}.`
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const deleteArgs = {
|
|
27
|
+
...contextArgs,
|
|
28
|
+
table: {
|
|
29
|
+
type: "positional",
|
|
30
|
+
required: true,
|
|
31
|
+
description: "Table name"
|
|
32
|
+
},
|
|
33
|
+
id: {
|
|
34
|
+
type: "positional",
|
|
35
|
+
required: true,
|
|
36
|
+
description: "Content ID"
|
|
37
|
+
},
|
|
38
|
+
yes: {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
description: "Skip the confirmation prompt",
|
|
41
|
+
default: false
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var delete_default = defineCommand({
|
|
45
|
+
meta: {
|
|
46
|
+
name: "delete",
|
|
47
|
+
description: "Delete a content"
|
|
48
|
+
},
|
|
49
|
+
args: deleteArgs,
|
|
50
|
+
run: ({ args }) => runWithContext(args, (ctx) => contentDeleteHandler(ctx, {
|
|
51
|
+
table: args.table,
|
|
52
|
+
contentId: args.id,
|
|
53
|
+
yes: args.yes === true
|
|
54
|
+
}))
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { delete_default as default };
|
|
59
|
+
//# sourceMappingURL=delete-CSs5Czlo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-CSs5Czlo.mjs","names":[],"sources":["../src/cli/commands/content/delete.ts"],"sourcesContent":["import type { ArgsDef } from \"citty\";\nimport { Result } from \"@praha/byethrow\";\nimport {\n defineCommand,\n type CommandFailure,\n type CommandOutput,\n} from \"../define-command.js\";\nimport { contextArgs } from \"../shared.js\";\nimport { runWithContext, type CommandContext } from \"../run-with-context.js\";\nimport { apiErrorFailure } from \"../api-errors.js\";\nimport { toResult } from \"../../api/errors.js\";\nimport { confirmDeletion } from \"../confirm-delete.js\";\n\nexport async function contentDeleteHandler(\n ctx: CommandContext,\n options: { table: string; contentId: string; yes: boolean },\n): Promise<Result.Result<CommandOutput | undefined, CommandFailure>> {\n const confirmed = await confirmDeletion(\n `content ${options.contentId} in table ${options.table}`,\n options.yes,\n );\n if (Result.isFailure(confirmed)) return confirmed;\n\n const deleted = toResult(\n await ctx.client.DELETE(\n \"/projects/{projectName}/tables/{tableName}/{contentId}\",\n {\n params: {\n path: {\n projectName: ctx.projectName,\n tableName: options.table,\n contentId: options.contentId,\n },\n },\n },\n ),\n );\n if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);\n\n return Result.succeed({\n json: { deleted: true, table: options.table, contentId: options.contentId },\n text: () =>\n `Deleted content ${options.contentId} from table ${options.table}.`,\n });\n}\n\nconst deleteArgs = {\n ...contextArgs,\n table: {\n type: \"positional\",\n required: true,\n description: \"Table name\",\n },\n id: {\n type: \"positional\",\n required: true,\n description: \"Content ID\",\n },\n yes: {\n type: \"boolean\",\n description: \"Skip the confirmation prompt\",\n default: false,\n },\n} satisfies ArgsDef;\n\nexport default defineCommand({\n meta: {\n name: \"delete\",\n description: \"Delete a content\",\n },\n args: deleteArgs,\n run: ({ args }) =>\n runWithContext(args, (ctx) =>\n contentDeleteHandler(ctx, {\n table: args.table,\n contentId: args.id,\n yes: args.yes === true,\n }),\n ),\n});\n"],"mappings":";;;;;;;AAaA,eAAsB,qBACpB,KACA,SACmE;CACnE,MAAM,YAAY,MAAM,gBACtB,WAAW,QAAQ,UAAU,YAAY,QAAQ,SACjD,QAAQ,GACV;CACA,IAAI,OAAO,UAAU,SAAS,GAAG,OAAO;CAExC,MAAM,UAAU,SACd,MAAM,IAAI,OAAO,OACf,0DACA,EACE,QAAQ,EACN,MAAM;EACJ,aAAa,IAAI;EACjB,WAAW,QAAQ;EACnB,WAAW,QAAQ;CACrB,EACF,EACF,CACF,CACF;CACA,IAAI,OAAO,UAAU,OAAO,GAAG,OAAO,gBAAgB,QAAQ,KAAK;CAEnE,OAAO,OAAO,QAAQ;EACpB,MAAM;GAAE,SAAS;GAAM,OAAO,QAAQ;GAAO,WAAW,QAAQ;EAAU;EAC1E,YACE,mBAAmB,QAAQ,UAAU,cAAc,QAAQ,MAAM;CACrE,CAAC;AACH;AAEA,MAAM,aAAa;CACjB,GAAG;CACH,OAAO;EACL,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,IAAI;EACF,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,aAAa;EACb,SAAS;CACX;AACF;AAEA,qBAAe,cAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;CACN,MAAM,EAAE,WACN,eAAe,OAAO,QACpB,qBAAqB,KAAK;EACxB,OAAO,KAAK;EACZ,WAAW,KAAK;EAChB,KAAK,KAAK,QAAQ;CACpB,CAAC,CACH;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const require_cli_main = require('./cli/main.cjs');
|
|
2
|
+
const require_shared = require('./shared-DHRPzzKl.cjs');
|
|
3
|
+
const require_run_with_context = require('./run-with-context-DJNnEigg.cjs');
|
|
4
|
+
const require_confirm_delete = require('./confirm-delete-B9o73U7B.cjs');
|
|
5
|
+
const require_parse = require('./parse-BeO2IwfI.cjs');
|
|
6
|
+
let _praha_byethrow = require("@praha/byethrow");
|
|
7
|
+
|
|
8
|
+
//#region src/cli/commands/key/consumer/delete.ts
|
|
9
|
+
async function keyConsumerDeleteHandler(ctx, options) {
|
|
10
|
+
const confirmed = await require_confirm_delete.confirmDeletion(`consumer key ${options.id}`, options.yes);
|
|
11
|
+
if (_praha_byethrow.Result.isFailure(confirmed)) return confirmed;
|
|
12
|
+
const deleted = require_run_with_context.toResult(await ctx.client.DELETE("/projects/{projectName}/consumer-keys/{projectConsumerKeyId}", { params: { path: {
|
|
13
|
+
projectName: ctx.projectName,
|
|
14
|
+
projectConsumerKeyId: options.id
|
|
15
|
+
} } }));
|
|
16
|
+
if (_praha_byethrow.Result.isFailure(deleted)) return require_run_with_context.apiErrorFailure(deleted.error);
|
|
17
|
+
return _praha_byethrow.Result.succeed({
|
|
18
|
+
json: {
|
|
19
|
+
deleted: true,
|
|
20
|
+
id: options.id
|
|
21
|
+
},
|
|
22
|
+
text: () => `Deleted consumer key ${options.id}.`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const deleteArgs = {
|
|
26
|
+
...require_shared.contextArgs,
|
|
27
|
+
id: {
|
|
28
|
+
type: "positional",
|
|
29
|
+
required: true,
|
|
30
|
+
description: "Numeric consumer key ID"
|
|
31
|
+
},
|
|
32
|
+
yes: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: "Skip the confirmation prompt",
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var delete_default = require_cli_main.defineCommand({
|
|
39
|
+
meta: {
|
|
40
|
+
name: "delete",
|
|
41
|
+
description: "Delete a consumer key"
|
|
42
|
+
},
|
|
43
|
+
args: deleteArgs,
|
|
44
|
+
run: async ({ args }) => {
|
|
45
|
+
const id = require_parse.parsePositionalId("consumer key ID", args.id);
|
|
46
|
+
if (_praha_byethrow.Result.isFailure(id)) return id;
|
|
47
|
+
return require_run_with_context.runWithContext(args, (ctx) => keyConsumerDeleteHandler(ctx, {
|
|
48
|
+
id: id.value,
|
|
49
|
+
yes: args.yes === true
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.default = delete_default;
|
|
56
|
+
//# sourceMappingURL=delete-CrOVRvMo.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-CrOVRvMo.cjs","names":["confirmDeletion","Result","toResult","apiErrorFailure","contextArgs","defineCommand","parsePositionalId","runWithContext"],"sources":["../src/cli/commands/key/consumer/delete.ts"],"sourcesContent":["import type { ArgsDef } from \"citty\";\nimport { Result } from \"@praha/byethrow\";\nimport {\n defineCommand,\n type CommandFailure,\n type CommandOutput,\n} from \"../../define-command.js\";\nimport { contextArgs } from \"../../shared.js\";\nimport { runWithContext, type CommandContext } from \"../../run-with-context.js\";\nimport { apiErrorFailure } from \"../../api-errors.js\";\nimport { toResult } from \"../../../api/errors.js\";\nimport { confirmDeletion } from \"../../confirm-delete.js\";\nimport { parsePositionalId } from \"../../parse.js\";\n\nexport async function keyConsumerDeleteHandler(\n ctx: CommandContext,\n options: { id: number; yes: boolean },\n): Promise<Result.Result<CommandOutput | undefined, CommandFailure>> {\n const confirmed = await confirmDeletion(\n `consumer key ${options.id}`,\n options.yes,\n );\n if (Result.isFailure(confirmed)) return confirmed;\n\n const deleted = toResult(\n await ctx.client.DELETE(\n \"/projects/{projectName}/consumer-keys/{projectConsumerKeyId}\",\n {\n params: {\n path: {\n projectName: ctx.projectName,\n projectConsumerKeyId: options.id,\n },\n },\n },\n ),\n );\n if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);\n\n return Result.succeed({\n json: { deleted: true, id: options.id },\n text: () => `Deleted consumer key ${options.id}.`,\n });\n}\n\nconst deleteArgs = {\n ...contextArgs,\n id: {\n type: \"positional\",\n required: true,\n description: \"Numeric consumer key ID\",\n },\n yes: {\n type: \"boolean\",\n description: \"Skip the confirmation prompt\",\n default: false,\n },\n} satisfies ArgsDef;\n\nexport default defineCommand({\n meta: {\n name: \"delete\",\n description: \"Delete a consumer key\",\n },\n args: deleteArgs,\n run: async ({ args }) => {\n const id = parsePositionalId(\"consumer key ID\", args.id);\n if (Result.isFailure(id)) return id;\n\n return runWithContext(args, (ctx) =>\n keyConsumerDeleteHandler(ctx, { id: id.value, yes: args.yes === true }),\n );\n },\n});\n"],"mappings":";;;;;;;;AAcA,eAAsB,yBACpB,KACA,SACmE;CACnE,MAAM,YAAY,MAAMA,uCACtB,gBAAgB,QAAQ,MACxB,QAAQ,GACV;CACA,IAAIC,uBAAO,UAAU,SAAS,GAAG,OAAO;CAExC,MAAM,UAAUC,kCACd,MAAM,IAAI,OAAO,OACf,gEACA,EACE,QAAQ,EACN,MAAM;EACJ,aAAa,IAAI;EACjB,sBAAsB,QAAQ;CAChC,EACF,EACF,CACF,CACF;CACA,IAAID,uBAAO,UAAU,OAAO,GAAG,OAAOE,yCAAgB,QAAQ,KAAK;CAEnE,OAAOF,uBAAO,QAAQ;EACpB,MAAM;GAAE,SAAS;GAAM,IAAI,QAAQ;EAAG;EACtC,YAAY,wBAAwB,QAAQ,GAAG;CACjD,CAAC;AACH;AAEA,MAAM,aAAa;CACjB,GAAGG;CACH,IAAI;EACF,MAAM;EACN,UAAU;EACV,aAAa;CACf;CACA,KAAK;EACH,MAAM;EACN,aAAa;EACb,SAAS;CACX;AACF;AAEA,qBAAeC,+BAAc;CAC3B,MAAM;EACJ,MAAM;EACN,aAAa;CACf;CACA,MAAM;CACN,KAAK,OAAO,EAAE,WAAW;EACvB,MAAM,KAAKC,gCAAkB,mBAAmB,KAAK,EAAE;EACvD,IAAIL,uBAAO,UAAU,EAAE,GAAG,OAAO;EAEjC,OAAOM,wCAAe,OAAO,QAC3B,yBAAyB,KAAK;GAAE,IAAI,GAAG;GAAO,KAAK,KAAK,QAAQ;EAAK,CAAC,CACxE;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { t as defineCommand } from "./cli/main.mjs";
|
|
2
|
+
import { r as contextArgs } from "./shared-CZZimGxc.mjs";
|
|
3
|
+
import { a as apiErrorFailure, n as runWithContext, u as toResult } from "./run-with-context-CVhmzAFZ.mjs";
|
|
4
|
+
import { t as confirmDeletion } from "./confirm-delete-CsWkW69-.mjs";
|
|
5
|
+
import { u as parsePositionalId } from "./parse-CA5fBB3x.mjs";
|
|
6
|
+
import { Result } from "@praha/byethrow";
|
|
7
|
+
|
|
8
|
+
//#region src/cli/commands/key/consumer/delete.ts
|
|
9
|
+
async function keyConsumerDeleteHandler(ctx, options) {
|
|
10
|
+
const confirmed = await confirmDeletion(`consumer key ${options.id}`, options.yes);
|
|
11
|
+
if (Result.isFailure(confirmed)) return confirmed;
|
|
12
|
+
const deleted = toResult(await ctx.client.DELETE("/projects/{projectName}/consumer-keys/{projectConsumerKeyId}", { params: { path: {
|
|
13
|
+
projectName: ctx.projectName,
|
|
14
|
+
projectConsumerKeyId: options.id
|
|
15
|
+
} } }));
|
|
16
|
+
if (Result.isFailure(deleted)) return apiErrorFailure(deleted.error);
|
|
17
|
+
return Result.succeed({
|
|
18
|
+
json: {
|
|
19
|
+
deleted: true,
|
|
20
|
+
id: options.id
|
|
21
|
+
},
|
|
22
|
+
text: () => `Deleted consumer key ${options.id}.`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const deleteArgs = {
|
|
26
|
+
...contextArgs,
|
|
27
|
+
id: {
|
|
28
|
+
type: "positional",
|
|
29
|
+
required: true,
|
|
30
|
+
description: "Numeric consumer key ID"
|
|
31
|
+
},
|
|
32
|
+
yes: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: "Skip the confirmation prompt",
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var delete_default = defineCommand({
|
|
39
|
+
meta: {
|
|
40
|
+
name: "delete",
|
|
41
|
+
description: "Delete a consumer key"
|
|
42
|
+
},
|
|
43
|
+
args: deleteArgs,
|
|
44
|
+
run: async ({ args }) => {
|
|
45
|
+
const id = parsePositionalId("consumer key ID", args.id);
|
|
46
|
+
if (Result.isFailure(id)) return id;
|
|
47
|
+
return runWithContext(args, (ctx) => keyConsumerDeleteHandler(ctx, {
|
|
48
|
+
id: id.value,
|
|
49
|
+
yes: args.yes === true
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { delete_default as default };
|
|
56
|
+
//# sourceMappingURL=delete-DehKYCXh.mjs.map
|