@flowscripter/dynamic-cli-framework-api 1.5.0 → 2.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.
|
@@ -24,16 +24,30 @@ export declare enum InstallMethod {
|
|
|
24
24
|
GITHUB_RELEASE = "github-release"
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* Outcome of an {@link UpgradeService.checkForUpgrade}
|
|
27
|
+
* Outcome of an {@link UpgradeService.checkForUpgrade} or {@link UpgradeService.getUpgradeCheckResult}
|
|
28
|
+
* call. The `"pending"` status can only be produced by {@link UpgradeService.getUpgradeCheckResult}'s
|
|
29
|
+
* non-blocking bounded wait - `checkForUpgrade()` and a `getUpgradeCheckResult(true)` call always
|
|
30
|
+
* run to completion and so never resolve to it.
|
|
28
31
|
*/
|
|
29
|
-
export
|
|
32
|
+
export type UpgradeCheckResult = {
|
|
33
|
+
readonly status: "checked";
|
|
30
34
|
readonly currentVersion: string;
|
|
31
35
|
readonly latestVersion: string;
|
|
32
36
|
readonly updateAvailable: boolean;
|
|
33
37
|
readonly os: SupportedOs;
|
|
34
38
|
readonly arch: SupportedArch;
|
|
35
39
|
readonly installMethod: InstallMethod;
|
|
36
|
-
}
|
|
40
|
+
} | {
|
|
41
|
+
/** The resolved (or overridden) os/arch/installMethod combination is not supported or not configured. */
|
|
42
|
+
readonly status: "unsupported";
|
|
43
|
+
} | {
|
|
44
|
+
/** A supported/configured combination was found, but determining the latest version failed. */
|
|
45
|
+
readonly status: "failed";
|
|
46
|
+
readonly error: Error;
|
|
47
|
+
} | {
|
|
48
|
+
/** The non-blocking bounded wait elapsed before the check completed. */
|
|
49
|
+
readonly status: "pending";
|
|
50
|
+
};
|
|
37
51
|
/**
|
|
38
52
|
* Outcome of an {@link UpgradeService.upgrade} call.
|
|
39
53
|
*/
|
|
@@ -74,10 +88,10 @@ export default interface UpgradeService {
|
|
|
74
88
|
* @param arch optional {@link SupportedArch} override, defaults to the detected value.
|
|
75
89
|
* @param installMethod optional {@link InstallMethod} override, defaults to the detected value.
|
|
76
90
|
*
|
|
77
|
-
* @return the {@link UpgradeCheckResult},
|
|
78
|
-
*
|
|
91
|
+
* @return the {@link UpgradeCheckResult}. Runs to completion, so never resolves to the
|
|
92
|
+
* `"pending"` status. Never rejects.
|
|
79
93
|
*/
|
|
80
|
-
checkForUpgrade(os?: SupportedOs, arch?: SupportedArch, installMethod?: InstallMethod): Promise<UpgradeCheckResult
|
|
94
|
+
checkForUpgrade(os?: SupportedOs, arch?: SupportedArch, installMethod?: InstallMethod): Promise<UpgradeCheckResult>;
|
|
81
95
|
/**
|
|
82
96
|
* Upgrade the CLI to the latest available version.
|
|
83
97
|
*
|
|
@@ -93,13 +107,13 @@ export default interface UpgradeService {
|
|
|
93
107
|
* dependencies were set (or starts one now, with default/no-override detection, if none has
|
|
94
108
|
* started yet). Every call is backed by the same cached promise.
|
|
95
109
|
*
|
|
96
|
-
* @param waitForResult if `true`, waits for the check to fully resolve
|
|
97
|
-
* gives up and resolves to `
|
|
98
|
-
* startup/opportunistic path are never blocked by a
|
|
110
|
+
* @param waitForResult if `true`, waits for the check to fully resolve, so the result never has
|
|
111
|
+
* status `"pending"`. If `false` (default), gives up and resolves to a `"pending"` result after
|
|
112
|
+
* an internal bounded delay, so callers on a startup/opportunistic path are never blocked by a
|
|
113
|
+
* slow network/spawn call.
|
|
99
114
|
*
|
|
100
|
-
* @return the {@link UpgradeCheckResult}
|
|
101
|
-
* bounded wait elapsed. Never rejects.
|
|
115
|
+
* @return the {@link UpgradeCheckResult}. Never rejects.
|
|
102
116
|
*/
|
|
103
|
-
getUpgradeCheckResult(waitForResult?: boolean): Promise<UpgradeCheckResult
|
|
117
|
+
getUpgradeCheckResult(waitForResult?: boolean): Promise<UpgradeCheckResult>;
|
|
104
118
|
}
|
|
105
119
|
//# sourceMappingURL=UpgradeService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpgradeService.d.ts","sourceRoot":"","sources":["../../../../src/service/core/UpgradeService.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,wDAAwD,CAAC;AAExF;;GAEG;AACH,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,cAAc,mBAAmB;CAClC;AAED
|
|
1
|
+
{"version":3,"file":"UpgradeService.d.ts","sourceRoot":"","sources":["../../../../src/service/core/UpgradeService.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,wDAAwD,CAAC;AAExF;;GAEG;AACH,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,cAAc,mBAAmB;CAClC;AAED;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IACE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;CACvC,GACD;IACE,yGAAyG;IACzG,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC,GACD;IACE,+FAA+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eService.checkForUpgrade}
|
|
31
|
+
* Outcome of an {@link UpgradeService.checkForUpgrade} or {@link UpgradeService.getUpgradeCheckResult}
|
|
32
|
+
* call. The `"pending"` status can only be produced by {@link UpgradeService.getUpgradeCheckResult}'s
|
|
33
|
+
* non-blocking bounded wait - `checkForUpgrade()` and a `getUpgradeCheckResult(true)` call always
|
|
34
|
+
* run to completion and so never resolve to it.
|
|
32
35
|
*/
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
export type UpgradeCheckResult =
|
|
37
|
+
| {
|
|
38
|
+
readonly status: "checked";
|
|
39
|
+
readonly currentVersion: string;
|
|
40
|
+
readonly latestVersion: string;
|
|
41
|
+
readonly updateAvailable: boolean;
|
|
42
|
+
readonly os: SupportedOs;
|
|
43
|
+
readonly arch: SupportedArch;
|
|
44
|
+
readonly installMethod: InstallMethod;
|
|
45
|
+
}
|
|
46
|
+
| {
|
|
47
|
+
/** The resolved (or overridden) os/arch/installMethod combination is not supported or not configured. */
|
|
48
|
+
readonly status: "unsupported";
|
|
49
|
+
}
|
|
50
|
+
| {
|
|
51
|
+
/** A supported/configured combination was found, but determining the latest version failed. */
|
|
52
|
+
readonly status: "failed";
|
|
53
|
+
readonly error: Error;
|
|
54
|
+
}
|
|
55
|
+
| {
|
|
56
|
+
/** The non-blocking bounded wait elapsed before the check completed. */
|
|
57
|
+
readonly status: "pending";
|
|
58
|
+
};
|
|
41
59
|
|
|
42
60
|
/**
|
|
43
61
|
* Outcome of an {@link UpgradeService.upgrade} call.
|
|
@@ -83,14 +101,14 @@ export default interface UpgradeService {
|
|
|
83
101
|
* @param arch optional {@link SupportedArch} override, defaults to the detected value.
|
|
84
102
|
* @param installMethod optional {@link InstallMethod} override, defaults to the detected value.
|
|
85
103
|
*
|
|
86
|
-
* @return the {@link UpgradeCheckResult},
|
|
87
|
-
*
|
|
104
|
+
* @return the {@link UpgradeCheckResult}. Runs to completion, so never resolves to the
|
|
105
|
+
* `"pending"` status. Never rejects.
|
|
88
106
|
*/
|
|
89
107
|
checkForUpgrade(
|
|
90
108
|
os?: SupportedOs,
|
|
91
109
|
arch?: SupportedArch,
|
|
92
110
|
installMethod?: InstallMethod,
|
|
93
|
-
): Promise<UpgradeCheckResult
|
|
111
|
+
): Promise<UpgradeCheckResult>;
|
|
94
112
|
|
|
95
113
|
/**
|
|
96
114
|
* Upgrade the CLI to the latest available version.
|
|
@@ -112,12 +130,12 @@ export default interface UpgradeService {
|
|
|
112
130
|
* dependencies were set (or starts one now, with default/no-override detection, if none has
|
|
113
131
|
* started yet). Every call is backed by the same cached promise.
|
|
114
132
|
*
|
|
115
|
-
* @param waitForResult if `true`, waits for the check to fully resolve
|
|
116
|
-
* gives up and resolves to `
|
|
117
|
-
* startup/opportunistic path are never blocked by a
|
|
133
|
+
* @param waitForResult if `true`, waits for the check to fully resolve, so the result never has
|
|
134
|
+
* status `"pending"`. If `false` (default), gives up and resolves to a `"pending"` result after
|
|
135
|
+
* an internal bounded delay, so callers on a startup/opportunistic path are never blocked by a
|
|
136
|
+
* slow network/spawn call.
|
|
118
137
|
*
|
|
119
|
-
* @return the {@link UpgradeCheckResult}
|
|
120
|
-
* bounded wait elapsed. Never rejects.
|
|
138
|
+
* @return the {@link UpgradeCheckResult}. Never rejects.
|
|
121
139
|
*/
|
|
122
|
-
getUpgradeCheckResult(waitForResult?: boolean): Promise<UpgradeCheckResult
|
|
140
|
+
getUpgradeCheckResult(waitForResult?: boolean): Promise<UpgradeCheckResult>;
|
|
123
141
|
}
|