@actionway/cli 0.18.19 → 0.18.21
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 +2 -2
- package/dist/index.js +22 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,5 +105,5 @@ pnpm cli -- generate-video --print-schema
|
|
|
105
105
|
`.github/workflows/release.yml` 负责:勾选 `actionway_cli`(可单独选择,也可与 Worker 组合)并选择版本 bump 后,
|
|
106
106
|
workflow 以 npm 已发布的最高版本为基线生成下一版本,构建当前仓库的
|
|
107
107
|
tarball,验证真实 npm install 后的 `.bin/actionway`、`--help`、`--version`
|
|
108
|
-
和 `logout`,再发布到 `latest
|
|
109
|
-
|
|
108
|
+
和 `logout`,再发布到 `latest`。同一 Production Release 也提供独立的
|
|
109
|
+
`sandbox_cli` 目标,把受检的 `@actionway/sandbox-cli` artifact 发布到 iLands wrapper 使用的 `prod` dist-tag。
|
package/dist/index.js
CHANGED
|
@@ -12610,6 +12610,7 @@ async function startDevicePairing(gateway, codeChallenge, fetchImpl = fetch, con
|
|
|
12610
12610
|
}
|
|
12611
12611
|
return {
|
|
12612
12612
|
deviceCode: value.device_code,
|
|
12613
|
+
...typeof value.install_attempt_id === "string" && value.install_attempt_id ? { installAttemptId: value.install_attempt_id } : {},
|
|
12613
12614
|
userCode: value.user_code,
|
|
12614
12615
|
verificationUrl: value.verification_url,
|
|
12615
12616
|
verificationUrlComplete: value.verification_url_complete,
|
|
@@ -12640,6 +12641,8 @@ async function pollDevicePairing(gateway, deviceCode, fetchImpl = fetch) {
|
|
|
12640
12641
|
return { status: "approved", code: value.code };
|
|
12641
12642
|
case "denied":
|
|
12642
12643
|
return { status: "denied" };
|
|
12644
|
+
case "superseded":
|
|
12645
|
+
return { status: "superseded" };
|
|
12643
12646
|
case "expired":
|
|
12644
12647
|
return { status: "expired" };
|
|
12645
12648
|
default:
|
|
@@ -12731,6 +12734,9 @@ async function fetchCliSession(gateway, accessToken, fetchImpl = fetch, context
|
|
|
12731
12734
|
url.searchParams.set("install_session_id", context.installAttribution.installSessionId);
|
|
12732
12735
|
url.searchParams.set("install_source", context.installAttribution.installSource);
|
|
12733
12736
|
}
|
|
12737
|
+
if (context.installAttemptId) {
|
|
12738
|
+
url.searchParams.set("install_attempt_id", context.installAttemptId);
|
|
12739
|
+
}
|
|
12734
12740
|
const response = await fetchImpl(url, {
|
|
12735
12741
|
headers: {
|
|
12736
12742
|
Accept: "application/json",
|
|
@@ -12766,11 +12772,15 @@ async function login(options = {}) {
|
|
|
12766
12772
|
const sleep = options.sleepImpl ?? defaultSleep;
|
|
12767
12773
|
const onNotice = options.onNotice ?? ((message) => process.stderr.write(`${message}
|
|
12768
12774
|
`));
|
|
12775
|
+
let installAttemptId;
|
|
12769
12776
|
let failureReported = false;
|
|
12770
12777
|
const reportInstallEvent = async (event) => {
|
|
12771
12778
|
if (!options.installAttribution || !options.onInstallEvent) return;
|
|
12772
12779
|
try {
|
|
12773
|
-
await options.onInstallEvent(
|
|
12780
|
+
await options.onInstallEvent({
|
|
12781
|
+
...event,
|
|
12782
|
+
...installAttemptId ? { installAttemptId } : {}
|
|
12783
|
+
});
|
|
12774
12784
|
} catch {
|
|
12775
12785
|
}
|
|
12776
12786
|
};
|
|
@@ -12831,6 +12841,7 @@ async function login(options = {}) {
|
|
|
12831
12841
|
...options.installAttribution ? { installAttribution: options.installAttribution } : {},
|
|
12832
12842
|
...options.clientContext ? { clientContext: options.clientContext } : {}
|
|
12833
12843
|
});
|
|
12844
|
+
installAttemptId = options.installAttribution ? pairing.installAttemptId : void 0;
|
|
12834
12845
|
onNotice(
|
|
12835
12846
|
`Sign in to Actionway on any device:
|
|
12836
12847
|
${pairing.verificationUrl}
|
|
@@ -12856,6 +12867,14 @@ ${pairing.verificationUrlComplete}`);
|
|
|
12856
12867
|
"run `actionway login` again and approve the request on the activation page"
|
|
12857
12868
|
);
|
|
12858
12869
|
}
|
|
12870
|
+
if (poll.status === "superseded") {
|
|
12871
|
+
await reportInstallFailure("pairing", "pairing_superseded");
|
|
12872
|
+
throw new CliError(
|
|
12873
|
+
"E_BACKEND",
|
|
12874
|
+
"this sign-in request was replaced by a newer install attempt",
|
|
12875
|
+
"use the latest authorization link or one-time code shown in the most recent terminal output"
|
|
12876
|
+
);
|
|
12877
|
+
}
|
|
12859
12878
|
if (poll.status === "expired") {
|
|
12860
12879
|
await reportInstallFailure("authorization", "authorization_expired");
|
|
12861
12880
|
throw new CliError(
|
|
@@ -12890,6 +12909,7 @@ ${pairing.verificationUrlComplete}`);
|
|
|
12890
12909
|
failureStage = "account_connection";
|
|
12891
12910
|
const account = await fetchCliSession(gateway, tokens.accessToken, fetchImpl, {
|
|
12892
12911
|
...options.installAttribution ? { installAttribution: options.installAttribution } : {},
|
|
12912
|
+
...installAttemptId ? { installAttemptId } : {},
|
|
12893
12913
|
...options.clientContext ? { clientContext: options.clientContext } : {}
|
|
12894
12914
|
});
|
|
12895
12915
|
if (!account) {
|
|
@@ -13429,6 +13449,7 @@ async function captureInstallAuthEvent(input) {
|
|
|
13429
13449
|
event: input.event.event,
|
|
13430
13450
|
installSessionId: input.installSessionId,
|
|
13431
13451
|
installSource: input.installSource,
|
|
13452
|
+
...input.event.installAttemptId ? { installAttemptId: input.event.installAttemptId } : {},
|
|
13432
13453
|
...input.event.event === "install_failed" ? {
|
|
13433
13454
|
failureStage: input.event.failureStage,
|
|
13434
13455
|
failureReason: input.event.failureReason
|
package/package.json
CHANGED