@shopify/cli-kit 1.0.8 → 1.0.9
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 +6 -0
- package/dist/{index-500e8461.js → index-73f2dc55.js} +23 -8
- package/dist/{index-500e8461.js.map → index-73f2dc55.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{multipart-parser-20740124.js → multipart-parser-305a2ce9.js} +2 -2
- package/dist/{multipart-parser-20740124.js.map → multipart-parser-305a2ce9.js.map} +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -45476,7 +45476,7 @@ function isTruthy(variable) {
|
|
|
45476
45476
|
}
|
|
45477
45477
|
|
|
45478
45478
|
var name = "@shopify/cli-kit";
|
|
45479
|
-
var version$2 = "1.0.
|
|
45479
|
+
var version$2 = "1.0.9";
|
|
45480
45480
|
var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
|
|
45481
45481
|
var keywords = [
|
|
45482
45482
|
"shopify",
|
|
@@ -45578,9 +45578,9 @@ var cliKitPackageJson = {
|
|
|
45578
45578
|
devDependencies: devDependencies
|
|
45579
45579
|
};
|
|
45580
45580
|
|
|
45581
|
-
var version$1 = "1.0.
|
|
45581
|
+
var version$1 = "1.0.9";
|
|
45582
45582
|
|
|
45583
|
-
var version = "1.0.
|
|
45583
|
+
var version = "1.0.9";
|
|
45584
45584
|
|
|
45585
45585
|
const constants = {
|
|
45586
45586
|
environmentVariables: {
|
|
@@ -50737,7 +50737,7 @@ class Body$1 {
|
|
|
50737
50737
|
return formData;
|
|
50738
50738
|
}
|
|
50739
50739
|
|
|
50740
|
-
const {toFormData} = await import('./multipart-parser-
|
|
50740
|
+
const {toFormData} = await import('./multipart-parser-305a2ce9.js');
|
|
50741
50741
|
return toFormData(this.body, ct);
|
|
50742
50742
|
}
|
|
50743
50743
|
|
|
@@ -52495,6 +52495,8 @@ var http$1 = /*#__PURE__*/Object.freeze({
|
|
|
52495
52495
|
fetch: fetch$3
|
|
52496
52496
|
});
|
|
52497
52497
|
|
|
52498
|
+
class InvalidGrantError extends Error {
|
|
52499
|
+
}
|
|
52498
52500
|
async function exchangeCodeForAccessToken(codeData) {
|
|
52499
52501
|
const clientId$1 = await clientId();
|
|
52500
52502
|
const params = {
|
|
@@ -52560,10 +52562,15 @@ async function tokenRequest(params) {
|
|
|
52560
52562
|
const url = new URL(`https://${fqdn}/oauth/token`);
|
|
52561
52563
|
url.search = new URLSearchParams(Object.entries(params)).toString();
|
|
52562
52564
|
const res = await fetch$3(url.href, { method: "POST" });
|
|
52565
|
+
const payload = await res.json();
|
|
52563
52566
|
if (!res.ok) {
|
|
52564
|
-
|
|
52567
|
+
if (payload.error === "invalid_grant") {
|
|
52568
|
+
throw new InvalidGrantError(payload.error_description);
|
|
52569
|
+
} else {
|
|
52570
|
+
throw new Abort(payload.error_description);
|
|
52571
|
+
}
|
|
52565
52572
|
}
|
|
52566
|
-
return
|
|
52573
|
+
return payload;
|
|
52567
52574
|
}
|
|
52568
52575
|
function buildIdentityToken(result) {
|
|
52569
52576
|
return {
|
|
@@ -55670,7 +55677,15 @@ async function ensureAuthenticated(applications, env = process.env) {
|
|
|
55670
55677
|
if (needFullAuth) {
|
|
55671
55678
|
newSession = await executeCompleteFlow(applications, fqdn);
|
|
55672
55679
|
} else if (sessionIsInvalid) {
|
|
55673
|
-
|
|
55680
|
+
try {
|
|
55681
|
+
newSession = await refreshTokens(fqdnSession.identity, applications, fqdn);
|
|
55682
|
+
} catch (error) {
|
|
55683
|
+
if (error instanceof InvalidGrantError) {
|
|
55684
|
+
newSession = await executeCompleteFlow(applications, fqdn);
|
|
55685
|
+
} else {
|
|
55686
|
+
throw error;
|
|
55687
|
+
}
|
|
55688
|
+
}
|
|
55674
55689
|
}
|
|
55675
55690
|
const completeSession = { ...currentSession, ...newSession };
|
|
55676
55691
|
await store$1(completeSession);
|
|
@@ -165713,4 +165728,4 @@ var checksum = /*#__PURE__*/Object.freeze({
|
|
|
165713
165728
|
});
|
|
165714
165729
|
|
|
165715
165730
|
export { FormData$2 as F, File$1 as a, string$2 as b, os$2 as c, dependency as d, error$k as e, file$1 as f, git as g, environment as h, session as i, schema$1 as j, toml as k, tunnel as l, store as m, api as n, output$1 as o, path$q as p, http$1 as q, checksum as r, system as s, template as t, ui as u, version$3 as v, constants as w };
|
|
165716
|
-
//# sourceMappingURL=index-
|
|
165731
|
+
//# sourceMappingURL=index-73f2dc55.js.map
|