pushary 1.9.23 → 1.9.25
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/CHANGELOG.md +15 -0
- package/data/cursor-plugin/.cursor-plugin/plugin.json +1 -1
- package/data/cursor-plugin/CHANGELOG.md +4 -0
- package/data/cursor-plugin/scripts/pushary-gate.mjs +4 -2
- package/data/cursor-plugin/scripts/pushary-gate.test.mjs +14 -1
- package/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +27 -26
- package/dist/bin/pushary-clean.js +41 -93
- package/dist/bin/pushary-codex-bridge.js +17 -17
- package/dist/bin/pushary-codex-hook.js +30 -30
- package/dist/bin/pushary-codex.js +12 -12
- package/dist/bin/pushary-connect.js +24 -24
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +31 -31
- package/dist/bin/pushary-disconnect.js +24 -24
- package/dist/bin/pushary-doctor.js +33 -33
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +27 -27
- package/dist/bin/pushary-hook.js +29 -29
- package/dist/bin/pushary-login.js +16 -16
- package/dist/bin/pushary-logout.js +77 -26
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +12 -12
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +26 -26
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +28 -28
- package/dist/bin/pushary-post-hook.js +24 -24
- package/dist/bin/pushary-prompt-hook.js +24 -24
- package/dist/bin/pushary-session-end-hook.js +24 -24
- package/dist/bin/pushary-session-start-hook.js +28 -28
- package/dist/bin/pushary-setup.js +41 -38
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +26 -26
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +12 -12
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +30 -30
- package/dist/bin/pushary-wait.js +12 -12
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-GN6BJXC7.js → chunk-2CUE3XXS.js} +1 -1
- package/dist/{chunk-OH6OGEOY.js → chunk-2J2WFX7X.js} +4 -4
- package/dist/{chunk-QIODXPTP.js → chunk-2VQZC6DW.js} +4 -4
- package/dist/{chunk-SWQLZQE3.js → chunk-2XHBYMVN.js} +14 -13
- package/dist/{chunk-HXZG5WHU.js → chunk-3UYMOWX6.js} +2 -2
- package/dist/{chunk-R5C3QCVT.js → chunk-4KZP4YMV.js} +1 -1
- package/dist/{chunk-73HGV4R6.js → chunk-5ETE7F45.js} +2 -2
- package/dist/{chunk-OQPEHKH2.js → chunk-5Q2QJ2AL.js} +1 -1
- package/dist/{chunk-K2EYK5RL.js → chunk-5WTEKIAS.js} +4 -4
- package/dist/{chunk-AV5VX7OK.js → chunk-7UZD2F4Y.js} +8 -8
- package/dist/{chunk-E2LGKG75.js → chunk-7V6PJFDF.js} +3 -3
- package/dist/{chunk-KJA6IGOZ.js → chunk-A3QQWXIE.js} +1 -1
- package/dist/{chunk-GYP6DLA4.js → chunk-AXB4ABUD.js} +8 -8
- package/dist/{chunk-I46QTKYI.js → chunk-BGJDOHNF.js} +5 -5
- package/dist/{chunk-FBV2KS3Z.js → chunk-BHRMHDOO.js} +2 -2
- package/dist/{chunk-RN5NRRHX.js → chunk-EJJNZYDS.js} +2 -2
- package/dist/{chunk-6HT2TUZD.js → chunk-EJMXZH5E.js} +2 -2
- package/dist/{chunk-N4DMADJM.js → chunk-FCXYDR62.js} +1 -1
- package/dist/{chunk-ZGYO6OQE.js → chunk-FJKV64M7.js} +5 -5
- package/dist/{chunk-QFNY4KUQ.js → chunk-FLC4TVXH.js} +1 -1
- package/dist/{chunk-NHBPW6C4.js → chunk-G446AVR5.js} +2 -2
- package/dist/{chunk-AQ3TSQA2.js → chunk-GC5HJE3T.js} +21 -8
- package/dist/{chunk-CJTQNUUT.js → chunk-HEJMZVJI.js} +2 -2
- package/dist/{chunk-OH647UT3.js → chunk-KGSN2SOL.js} +793 -18
- package/dist/{chunk-7RGEJOQS.js → chunk-KM7AEGKF.js} +3 -3
- package/dist/{chunk-FIYCICHC.js → chunk-KP4BIZLP.js} +2 -2
- package/dist/{chunk-YXHVMZPR.js → chunk-KZLOVLA6.js} +4 -4
- package/dist/{chunk-AXSHPFU3.js → chunk-LDNKGG5G.js} +3 -3
- package/dist/{chunk-DKBPNHAI.js → chunk-N3ACK3YA.js} +4 -4
- package/dist/{chunk-4GKQDFH6.js → chunk-NFH2H7PD.js} +5 -5
- package/dist/{chunk-BY5EKA6W.js → chunk-OFHSTCXK.js} +3 -3
- package/dist/{chunk-LEQRIJ4H.js → chunk-OOKIWOMK.js} +3 -3
- package/dist/{chunk-7J2AX5T6.js → chunk-OWOSNGEQ.js} +2 -2
- package/dist/{chunk-SSWK2WYX.js → chunk-PAMW5M53.js} +5 -5
- package/dist/{chunk-JNKHCGHR.js → chunk-PM2WJSUH.js} +1 -1
- package/dist/{chunk-JCEUDLGW.js → chunk-PPGLIWOR.js} +1 -1
- package/dist/{chunk-PFB7P4F3.js → chunk-PSNF27BC.js} +6 -6
- package/dist/{chunk-2AUKCSLQ.js → chunk-Q37XFSPO.js} +4 -4
- package/dist/{chunk-S2R2U5W5.js → chunk-RSENVGBQ.js} +4 -4
- package/dist/{chunk-M7DCI44L.js → chunk-SGGR5MN2.js} +1 -1
- package/dist/{chunk-NSCETODW.js → chunk-TLUSUDRU.js} +1 -1
- package/dist/chunk-UJB6HHP4.js +166 -0
- package/dist/{chunk-YZPFJCFE.js → chunk-UK7OY3EJ.js} +1 -1
- package/dist/{chunk-ISAKLEKE.js → chunk-UUOC7A7M.js} +7 -7
- package/dist/{chunk-Z4UDB7EC.js → chunk-VEGS4NYF.js} +3 -3
- package/dist/{chunk-USUI4P63.js → chunk-VFF7ZBIS.js} +2 -2
- package/dist/{chunk-RHIKMNWJ.js → chunk-VN5Q4KOD.js} +2 -2
- package/dist/{chunk-6GHZAS7S.js → chunk-WEKXYS2F.js} +4 -4
- package/dist/{chunk-SLBO7PHS.js → chunk-WKEP4JAW.js} +2 -2
- package/dist/{chunk-M6R3SZZS.js → chunk-YD3DIFIU.js} +1 -1
- package/dist/{chunk-EDN4F6GX.js → chunk-ZLGCNHJG.js} +1 -1
- package/dist/{chunk-A5U62Q6K.js → chunk-ZLY7BHN4.js} +5 -5
- package/dist/{chunk-AFP3HZVK.js → chunk-ZNT4ZZXJ.js} +1 -1
- package/dist/{chunk-XBETSM5T.js → chunk-ZV3262AA.js} +3 -3
- package/dist/{global-upgrade-SKY7A3SI.js → global-upgrade-4M4TJKQR.js} +6 -6
- package/dist/{paths-XUUEK7OU.js → paths-6JY6J56N.js} +2 -2
- package/dist/{reapply-WQDP26EA.js → reapply-LFEQ5GF6.js} +20 -20
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-AYW3TB7X.js → upgrade-lock-CZRCHYVU.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-OYIN77HO.js +0 -72
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FJKV64M7.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GC5HJE3T.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2VQZC6DW.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
12
|
} from "./chunk-AQFEP65J.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-KGSN2SOL.js";
|
|
16
16
|
|
|
17
17
|
// src/shared-mcp-key.ts
|
|
18
18
|
var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
keyPrefix,
|
|
5
5
|
readConfigFileKey,
|
|
6
6
|
readMacAppKeyPrefix
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GC5HJE3T.js";
|
|
8
8
|
import {
|
|
9
9
|
NPX_LATEST_COMMAND
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OOKIWOMK.js";
|
|
11
11
|
|
|
12
12
|
// src/key-signed-out.ts
|
|
13
13
|
var VERDICT_BY_CHECK = {
|
|
@@ -2,23 +2,23 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KM7AEGKF.js";
|
|
6
6
|
import {
|
|
7
7
|
AGENT_CHOICES
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4KZP4YMV.js";
|
|
9
9
|
import {
|
|
10
10
|
BELL_HOOK_BINARY
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZNT4ZZXJ.js";
|
|
12
12
|
import {
|
|
13
13
|
CODEX_HOOK_EVENTS,
|
|
14
14
|
hasCodexHooks,
|
|
15
15
|
holdBudgetOf
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2VQZC6DW.js";
|
|
17
17
|
import {
|
|
18
18
|
CURSOR_GATE_EVENTS,
|
|
19
19
|
HOOK_LOCATOR_BINARY,
|
|
20
20
|
hookCommandHoldBudget
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KGSN2SOL.js";
|
|
22
22
|
|
|
23
23
|
// src/diagnostics/bridge.ts
|
|
24
24
|
import { execFileSync } from "child_process";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readExistingMachineId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZLGCNHJG.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-7QLSKOSU.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5Q2QJ2AL.js";
|
|
10
10
|
import {
|
|
11
11
|
clientContextHeaders,
|
|
12
12
|
getPackageVersion
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KGSN2SOL.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/net.ts
|
|
16
16
|
import { createRequire } from "module";
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
readGlobalUpgradeSubject,
|
|
6
6
|
upgradeInstalledPackage,
|
|
7
7
|
withUpgradeLock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-BGJDOHNF.js";
|
|
9
|
+
import "./chunk-PPGLIWOR.js";
|
|
10
|
+
import "./chunk-VFF7ZBIS.js";
|
|
11
11
|
import "./chunk-POFBE6ZY.js";
|
|
12
12
|
import "./chunk-KZERVKTD.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-2VQZC6DW.js";
|
|
14
14
|
import "./chunk-AQFEP65J.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-OOKIWOMK.js";
|
|
16
|
+
import "./chunk-KGSN2SOL.js";
|
|
17
17
|
export {
|
|
18
18
|
finishGlobalUpgrade,
|
|
19
19
|
finishUpgradeWithLock,
|
|
@@ -10,34 +10,34 @@ import {
|
|
|
10
10
|
reapplyOpenCodePlugin,
|
|
11
11
|
reapplyVsCodePlugin,
|
|
12
12
|
repairCodexHolds
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-UUOC7A7M.js";
|
|
14
|
+
import "./chunk-VN5Q4KOD.js";
|
|
15
15
|
import "./chunk-RIVNNBEK.js";
|
|
16
16
|
import "./chunk-XHKBHWLX.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-FJKV64M7.js";
|
|
18
|
+
import "./chunk-5WTEKIAS.js";
|
|
19
|
+
import "./chunk-ZLY7BHN4.js";
|
|
20
|
+
import "./chunk-KM7AEGKF.js";
|
|
21
|
+
import "./chunk-4KZP4YMV.js";
|
|
22
|
+
import "./chunk-ZNT4ZZXJ.js";
|
|
23
23
|
import "./chunk-GMXKITVA.js";
|
|
24
24
|
import "./chunk-6ICPEJY5.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-AXB4ABUD.js";
|
|
26
|
+
import "./chunk-A3QQWXIE.js";
|
|
27
|
+
import "./chunk-NFH2H7PD.js";
|
|
28
28
|
import "./chunk-POFBE6ZY.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-7V6PJFDF.js";
|
|
30
|
+
import "./chunk-VEGS4NYF.js";
|
|
31
|
+
import "./chunk-ZV3262AA.js";
|
|
32
|
+
import "./chunk-ZLGCNHJG.js";
|
|
33
33
|
import "./chunk-7QLSKOSU.js";
|
|
34
34
|
import "./chunk-KZERVKTD.js";
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-EJMXZH5E.js";
|
|
36
|
+
import "./chunk-2VQZC6DW.js";
|
|
37
37
|
import "./chunk-AQFEP65J.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-5Q2QJ2AL.js";
|
|
39
|
+
import "./chunk-OOKIWOMK.js";
|
|
40
|
+
import "./chunk-KGSN2SOL.js";
|
|
41
41
|
export {
|
|
42
42
|
ensureCodexTrustAfterReapply,
|
|
43
43
|
inspectConfiguredManagedProviders,
|
package/dist/src/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-2XHBYMVN.js";
|
|
4
|
+
import "../chunk-BHRMHDOO.js";
|
|
5
|
+
import "../chunk-2CUE3XXS.js";
|
|
6
|
+
import "../chunk-SGGR5MN2.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchAccountPublicKey
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-FLC4TVXH.js";
|
|
10
|
+
import "../chunk-5WTEKIAS.js";
|
|
11
|
+
import "../chunk-KM7AEGKF.js";
|
|
12
12
|
import "../chunk-6ICPEJY5.js";
|
|
13
13
|
import {
|
|
14
14
|
fetchModeOverride,
|
|
@@ -18,31 +18,31 @@ import {
|
|
|
18
18
|
handlePostToolUse,
|
|
19
19
|
handleStop,
|
|
20
20
|
reportEvent
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-AXB4ABUD.js";
|
|
22
|
+
import "../chunk-A3QQWXIE.js";
|
|
23
23
|
import {
|
|
24
24
|
askUser,
|
|
25
25
|
cancelQuestion,
|
|
26
26
|
waitForAnswer
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-NFH2H7PD.js";
|
|
28
28
|
import "../chunk-POFBE6ZY.js";
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-7V6PJFDF.js";
|
|
30
|
+
import "../chunk-VEGS4NYF.js";
|
|
31
|
+
import "../chunk-ZV3262AA.js";
|
|
32
|
+
import "../chunk-ZLGCNHJG.js";
|
|
33
33
|
import "../chunk-7QLSKOSU.js";
|
|
34
34
|
import "../chunk-KZERVKTD.js";
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-EJMXZH5E.js";
|
|
36
|
+
import "../chunk-2VQZC6DW.js";
|
|
37
37
|
import "../chunk-AQFEP65J.js";
|
|
38
38
|
import {
|
|
39
39
|
getApiKey,
|
|
40
40
|
getBaseUrl
|
|
41
|
-
} from "../chunk-
|
|
42
|
-
import "../chunk-
|
|
41
|
+
} from "../chunk-5Q2QJ2AL.js";
|
|
42
|
+
import "../chunk-OOKIWOMK.js";
|
|
43
43
|
import {
|
|
44
44
|
resolvePolicy
|
|
45
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-KGSN2SOL.js";
|
|
46
46
|
export {
|
|
47
47
|
askUser,
|
|
48
48
|
cancelQuestion,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
ownsUpgradeLock,
|
|
7
7
|
releaseAutoUpdateLock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-PPGLIWOR.js";
|
|
9
|
+
import "./chunk-2VQZC6DW.js";
|
|
10
10
|
import "./chunk-AQFEP65J.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-KGSN2SOL.js";
|
|
12
12
|
export {
|
|
13
13
|
claimUpgradeLock,
|
|
14
14
|
finishWithUpgradeLock,
|
package/package.json
CHANGED
package/dist/chunk-OYIN77HO.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// src/key-revocation.ts
|
|
2
|
-
var SELF_REVOKE_PATH = "/api/v1/server/keys/self/revoke";
|
|
3
|
-
var DEVICE_KEY_PATH = "/api/agent/device-key";
|
|
4
|
-
var FULL_ACCESS_ONLY_STATUS = 403;
|
|
5
|
-
var REVOKE_TIMEOUT_MS = 1e4;
|
|
6
|
-
var readRevokedCount = async (response) => {
|
|
7
|
-
try {
|
|
8
|
-
const body = await response.json();
|
|
9
|
-
const revoked = typeof body === "object" && body !== null && "revoked" in body ? body.revoked : void 0;
|
|
10
|
-
return typeof revoked === "number" && Number.isInteger(revoked) && revoked >= 0 ? revoked : null;
|
|
11
|
-
} catch {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var revokeAgentKey = async (apiKey, baseUrl, fetchImpl) => {
|
|
16
|
-
const response = await fetchImpl(`${baseUrl}${DEVICE_KEY_PATH}`, {
|
|
17
|
-
method: "DELETE",
|
|
18
|
-
headers: { Authorization: `Bearer ${apiKey}` },
|
|
19
|
-
signal: AbortSignal.timeout(REVOKE_TIMEOUT_MS)
|
|
20
|
-
});
|
|
21
|
-
if (!response.ok) return { kind: "refused", status: response.status };
|
|
22
|
-
const revoked = await readRevokedCount(response);
|
|
23
|
-
if (revoked === null) return { kind: "unconfirmed", status: response.status };
|
|
24
|
-
return revoked > 0 ? { kind: "revoked" } : { kind: "not_accepted" };
|
|
25
|
-
};
|
|
26
|
-
var revokeOwnKey = async (apiKey, baseUrl, fetchImpl = fetch) => {
|
|
27
|
-
try {
|
|
28
|
-
const response = await fetchImpl(`${baseUrl}${SELF_REVOKE_PATH}`, {
|
|
29
|
-
method: "POST",
|
|
30
|
-
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
|
|
31
|
-
signal: AbortSignal.timeout(REVOKE_TIMEOUT_MS)
|
|
32
|
-
});
|
|
33
|
-
if (response.status === 401) return { kind: "not_accepted" };
|
|
34
|
-
if (response.status === FULL_ACCESS_ONLY_STATUS) return await revokeAgentKey(apiKey, baseUrl, fetchImpl);
|
|
35
|
-
if (!response.ok) return { kind: "refused", status: response.status };
|
|
36
|
-
return { kind: "revoked" };
|
|
37
|
-
} catch (err) {
|
|
38
|
-
return { kind: "unreachable", detail: err instanceof Error ? err.message : "network error" };
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var REVOKE_DETAIL = {
|
|
42
|
-
revoked: "Revoked the key on pushary.com.",
|
|
43
|
-
not_accepted: "pushary.com had already stopped accepting the key.",
|
|
44
|
-
refused: "pushary.com refused to revoke the key",
|
|
45
|
-
unconfirmed: "pushary.com did not confirm the key was revoked",
|
|
46
|
-
unreachable: "Could not reach pushary.com to revoke the key"
|
|
47
|
-
};
|
|
48
|
-
var describeRevokeAttempt = (attempt) => {
|
|
49
|
-
if (attempt.kind === "refused" || attempt.kind === "unconfirmed") return `${REVOKE_DETAIL[attempt.kind]} (HTTP ${attempt.status}).`;
|
|
50
|
-
if (attempt.kind === "unreachable") return `${REVOKE_DETAIL.unreachable}: ${attempt.detail}`;
|
|
51
|
-
return REVOKE_DETAIL[attempt.kind];
|
|
52
|
-
};
|
|
53
|
-
var keyNoLongerAccepted = (attempt) => attempt.kind === "revoked" || attempt.kind === "not_accepted";
|
|
54
|
-
var keyValidityOf = (check) => {
|
|
55
|
-
switch (check.kind) {
|
|
56
|
-
case "ok":
|
|
57
|
-
case "locked":
|
|
58
|
-
return "valid";
|
|
59
|
-
case "rejected":
|
|
60
|
-
case "malformed":
|
|
61
|
-
return "invalid";
|
|
62
|
-
case "unreachable":
|
|
63
|
-
return "unknown";
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export {
|
|
68
|
-
revokeOwnKey,
|
|
69
|
-
describeRevokeAttempt,
|
|
70
|
-
keyNoLongerAccepted,
|
|
71
|
-
keyValidityOf
|
|
72
|
-
};
|