@shopify/cli 3.75.4 → 3.76.1
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/dist/{chunk-IROHTJ5D.js → chunk-3Q5TSFEN.js} +6 -6
- package/dist/{chunk-CBIPUP4Q.js → chunk-3THHNKSL.js} +3 -3
- package/dist/{chunk-Y3V7CDDP.js → chunk-4OD4TP6T.js} +4 -4
- package/dist/{chunk-NNHELYN3.js → chunk-4SFWD6RY.js} +3 -3
- package/dist/{chunk-VIMSAJBK.js → chunk-5TZDSORY.js} +93 -163
- package/dist/{chunk-3FPXLCF5.js → chunk-6KV6OKFB.js} +3 -3
- package/dist/{chunk-2OX7ESM2.js → chunk-6TPMZTXG.js} +6 -6
- package/dist/{chunk-VH3W76GN.js → chunk-742MYXOA.js} +3 -3
- package/dist/{chunk-LWZVD7VH.js → chunk-7UIQNXWE.js} +3 -3
- package/dist/{chunk-7DV7FO6D.js → chunk-A44GEDKW.js} +7 -6
- package/dist/{chunk-KRPDLCMT.js → chunk-ACGZSEHA.js} +11 -11
- package/dist/{chunk-4IY25QPC.js → chunk-BJG7ZRQ2.js} +3 -3
- package/dist/{chunk-EFDLFMUG.js → chunk-DFFXOFLT.js} +2 -2
- package/dist/{chunk-WHYTGJJU.js → chunk-EHL6XSBG.js} +10 -9
- package/dist/{chunk-QGAHQAXG.js → chunk-EJU7LVJW.js} +3 -3
- package/dist/{chunk-TPUB2CUK.js → chunk-FUA76K3T.js} +2 -2
- package/dist/{chunk-OSDKLELI.js → chunk-FZT5AGA5.js} +4 -4
- package/dist/{chunk-R2KFJZQF.js → chunk-IROPFRNN.js} +36 -15
- package/dist/{chunk-EPSGPKFO.js → chunk-JBS4NEJX.js} +5 -5
- package/dist/{chunk-ARR2ZV5X.js → chunk-LTIYNGCV.js} +3 -3
- package/dist/{chunk-IAFN3BTU.js → chunk-LUCMIGZJ.js} +2 -2
- package/dist/{chunk-V4FD5VKG.js → chunk-LXQWZFLX.js} +74 -11
- package/dist/{chunk-LRTITZPZ.js → chunk-MVZ4LGIM.js} +2 -2
- package/dist/{chunk-7DRESMZH.js → chunk-PDQLM7DM.js} +3 -3
- package/dist/{chunk-R6ST4Q4K.js → chunk-RB5K7TGA.js} +2 -2
- package/dist/{chunk-WCTQ65EF.js → chunk-RDHYYXFE.js} +3 -3
- package/dist/{chunk-R27Y5T4H.js → chunk-T2LQCR7X.js} +2 -2
- package/dist/{chunk-HV2KH53A.js → chunk-UAZUB5EV.js} +3 -3
- package/dist/{chunk-3CB5D2ZO.js → chunk-ULBY4CUT.js} +2 -2
- package/dist/{chunk-DFK6H6Q2.js → chunk-VX5SZCUI.js} +59 -19
- package/dist/{chunk-O5UY3K6F.js → chunk-W6WCETMJ.js} +4 -4
- package/dist/{chunk-37RGPUOL.js → chunk-WOG2LQ3X.js} +3 -3
- package/dist/{chunk-LH3QC4DP.js → chunk-WWI2QVFK.js} +4 -3
- package/dist/{chunk-DLW5TTAO.js → chunk-ZQU7DVLN.js} +3 -3
- package/dist/cli/commands/auth/logout.js +11 -12
- package/dist/cli/commands/auth/logout.test.js +12 -13
- package/dist/cli/commands/cache/clear.js +10 -11
- package/dist/cli/commands/debug/command-flags.js +10 -11
- package/dist/cli/commands/docs/generate.js +10 -11
- package/dist/cli/commands/docs/generate.test.js +10 -11
- package/dist/cli/commands/help.js +10 -11
- package/dist/cli/commands/kitchen-sink/async.js +11 -12
- package/dist/cli/commands/kitchen-sink/async.test.js +11 -12
- package/dist/cli/commands/kitchen-sink/index.js +13 -14
- package/dist/cli/commands/kitchen-sink/index.test.js +13 -14
- package/dist/cli/commands/kitchen-sink/prompts.js +11 -12
- package/dist/cli/commands/kitchen-sink/prompts.test.js +11 -12
- package/dist/cli/commands/kitchen-sink/static.js +11 -12
- package/dist/cli/commands/kitchen-sink/static.test.js +11 -12
- package/dist/cli/commands/notifications/generate.js +11 -12
- package/dist/cli/commands/notifications/list.js +11 -12
- package/dist/cli/commands/search.js +11 -12
- package/dist/cli/commands/upgrade.js +11 -12
- package/dist/cli/commands/version.js +11 -12
- package/dist/cli/commands/version.test.js +11 -12
- package/dist/cli/services/commands/notifications.js +6 -6
- package/dist/cli/services/commands/search.js +2 -2
- package/dist/cli/services/commands/search.test.js +2 -2
- package/dist/cli/services/commands/version.js +3 -3
- package/dist/cli/services/commands/version.test.js +4 -4
- package/dist/cli/services/kitchen-sink/async.js +2 -2
- package/dist/cli/services/kitchen-sink/prompts.js +2 -2
- package/dist/cli/services/kitchen-sink/static.js +2 -2
- package/dist/cli/services/upgrade.js +3 -3
- package/dist/cli/services/upgrade.test.js +5 -7
- package/dist/{custom-oclif-loader-24E7DVTH.js → custom-oclif-loader-BXHJERI2.js} +2 -2
- package/dist/{error-handler-7V7HCPFM.js → error-handler-FV3FJ3VW.js} +8 -9
- package/dist/hooks/postrun.js +8 -8
- package/dist/hooks/prerun.js +10 -8
- package/dist/index.js +7214 -6859
- package/dist/{local-WHLQPZNS.js → local-PMOJBQT6.js} +2 -2
- package/dist/{node-AJELTNRR.js → node-5MJ6ATKS.js} +12 -13
- package/dist/{node-package-manager-KULBOPYH.js → node-package-manager-FZRL3EQB.js} +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-B4IIF7YO.js → ui-5VMS7DNB.js} +2 -2
- package/dist/{workerd-PWW3BB6B.js → workerd-JHDITYBC.js} +12 -13
- package/oclif.manifest.json +46 -22
- package/package.json +6 -6
- package/dist/chunk-VTTVH23Q.js +0 -63
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
fanoutHooks,
|
|
6
6
|
reportAnalyticsEvent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6TPMZTXG.js";
|
|
8
8
|
import {
|
|
9
9
|
getEnvironmentData
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5TZDSORY.js";
|
|
11
11
|
import {
|
|
12
12
|
CLI_KIT_VERSION
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DFFXOFLT.js";
|
|
14
14
|
import {
|
|
15
15
|
runWithRateLimit
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WWI2QVFK.js";
|
|
17
17
|
import {
|
|
18
18
|
AbortSilentError,
|
|
19
19
|
CancelExecution,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
reportingRateLimit,
|
|
29
29
|
require_stacktracey,
|
|
30
30
|
shouldReportErrorAsUnexpected
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-LXQWZFLX.js";
|
|
32
32
|
import {
|
|
33
33
|
cwd,
|
|
34
34
|
isAbsolutePath,
|
|
@@ -2136,4 +2136,4 @@ export {
|
|
|
2136
2136
|
registerCleanBugsnagErrorsFromWithinPlugins,
|
|
2137
2137
|
addBugsnagMetadata
|
|
2138
2138
|
};
|
|
2139
|
-
//# sourceMappingURL=chunk-
|
|
2139
|
+
//# sourceMappingURL=chunk-3Q5TSFEN.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
versionService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6KV6OKFB.js";
|
|
4
4
|
import {
|
|
5
5
|
base_command_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EHL6XSBG.js";
|
|
7
7
|
import {
|
|
8
8
|
init_cjs_shims
|
|
9
9
|
} from "./chunk-PKR7KJ6P.js";
|
|
@@ -22,4 +22,4 @@ var Version = class extends base_command_default {
|
|
|
22
22
|
export {
|
|
23
23
|
Version
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-3THHNKSL.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logout
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4SFWD6RY.js";
|
|
4
4
|
import {
|
|
5
5
|
base_command_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EHL6XSBG.js";
|
|
7
7
|
import {
|
|
8
8
|
outputSuccess
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LXQWZFLX.js";
|
|
10
10
|
import {
|
|
11
11
|
init_cjs_shims
|
|
12
12
|
} from "./chunk-PKR7KJ6P.js";
|
|
@@ -25,4 +25,4 @@ var Logout = class extends base_command_default {
|
|
|
25
25
|
export {
|
|
26
26
|
Logout
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-4OD4TP6T.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
remove,
|
|
7
7
|
setLastSeenAuthMethod,
|
|
8
8
|
setLastSeenUserIdAfterAuth
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5TZDSORY.js";
|
|
10
10
|
import {
|
|
11
11
|
BugError,
|
|
12
12
|
getPartnersToken,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
outputContent,
|
|
15
15
|
outputDebug,
|
|
16
16
|
outputToken
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LXQWZFLX.js";
|
|
18
18
|
import {
|
|
19
19
|
init_cjs_shims
|
|
20
20
|
} from "./chunk-PKR7KJ6P.js";
|
|
@@ -104,4 +104,4 @@ export {
|
|
|
104
104
|
ensureAuthenticatedBusinessPlatform,
|
|
105
105
|
logout
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-4SFWD6RY.js.map
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
platformAndArch
|
|
3
|
-
} from "./chunk-VTTVH23Q.js";
|
|
4
1
|
import {
|
|
5
2
|
allAPIs,
|
|
6
|
-
buildHeaders,
|
|
7
3
|
shopifyFetch,
|
|
8
4
|
z
|
|
9
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-W6WCETMJ.js";
|
|
10
6
|
import {
|
|
11
|
-
cacheRetrieveOrRepopulate,
|
|
12
7
|
getPackageManager,
|
|
13
8
|
getSession,
|
|
14
9
|
packageManagerFromUserAgent,
|
|
15
10
|
removeSession,
|
|
16
11
|
setSession
|
|
17
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WWI2QVFK.js";
|
|
18
13
|
import {
|
|
19
14
|
AbortError,
|
|
20
15
|
BugError,
|
|
@@ -44,12 +39,12 @@ import {
|
|
|
44
39
|
outputDebug,
|
|
45
40
|
outputInfo,
|
|
46
41
|
outputToken,
|
|
42
|
+
platformAndArch,
|
|
47
43
|
serviceEnvironment,
|
|
48
44
|
sessionConstants,
|
|
49
45
|
spinFqdn,
|
|
50
|
-
themeKitAccessDomain,
|
|
51
46
|
themeToken
|
|
52
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-LXQWZFLX.js";
|
|
53
48
|
import {
|
|
54
49
|
cwd
|
|
55
50
|
} from "./chunk-57Q6OQG4.js";
|
|
@@ -180,7 +175,90 @@ function validateCachedIdentityTokenStructure(identityToken) {
|
|
|
180
175
|
return IdentityTokenSchema.safeParse(identityToken).success;
|
|
181
176
|
}
|
|
182
177
|
|
|
183
|
-
// ../cli-kit/dist/private/node/session/
|
|
178
|
+
// ../cli-kit/dist/private/node/session/validate.js
|
|
179
|
+
function validateScopes(requestedScopes, identity) {
|
|
180
|
+
let currentScopes = identity.scopes;
|
|
181
|
+
return firstPartyDev() !== currentScopes.includes("employee") ? !1 : requestedScopes.every((scope) => currentScopes.includes(scope));
|
|
182
|
+
}
|
|
183
|
+
async function validateSession(scopes, applications, session) {
|
|
184
|
+
if (!session || !validateScopes(scopes, session.identity))
|
|
185
|
+
return "needs_full_auth";
|
|
186
|
+
let tokensAreExpired = isTokenExpired(session.identity);
|
|
187
|
+
if (applications.partnersApi) {
|
|
188
|
+
let appId = applicationId("partners"), token = session.applications[appId];
|
|
189
|
+
tokensAreExpired = tokensAreExpired || isTokenExpired(token);
|
|
190
|
+
}
|
|
191
|
+
if (applications.appManagementApi) {
|
|
192
|
+
let appId = applicationId("app-management"), token = session.applications[appId];
|
|
193
|
+
tokensAreExpired = tokensAreExpired || isTokenExpired(token);
|
|
194
|
+
}
|
|
195
|
+
if (applications.storefrontRendererApi) {
|
|
196
|
+
let appId = applicationId("storefront-renderer"), token = session.applications[appId];
|
|
197
|
+
tokensAreExpired = tokensAreExpired || isTokenExpired(token);
|
|
198
|
+
}
|
|
199
|
+
if (applications.adminApi) {
|
|
200
|
+
let appId = applicationId("admin"), realAppId = `${applications.adminApi.storeFqdn}-${appId}`, token = session.applications[realAppId];
|
|
201
|
+
tokensAreExpired = tokensAreExpired || isTokenExpired(token);
|
|
202
|
+
}
|
|
203
|
+
return outputDebug(`- Token validation -> It's expired: ${tokensAreExpired}`), validateCachedIdentityTokenStructure(session.identity) ? tokensAreExpired ? "needs_refresh" : "ok" : "needs_full_auth";
|
|
204
|
+
}
|
|
205
|
+
function isTokenExpired(token) {
|
|
206
|
+
return token ? token.expiresAt < expireThreshold() : !0;
|
|
207
|
+
}
|
|
208
|
+
function expireThreshold() {
|
|
209
|
+
return new Date(Date.now() + sessionConstants.expirationTimeMarginInMinutes * 60 * 1e3);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// ../cli-kit/dist/private/node/session/scopes.js
|
|
213
|
+
init_cjs_shims();
|
|
214
|
+
function allDefaultScopes(extraScopes = []) {
|
|
215
|
+
let scopes = allAPIs.map((api) => defaultApiScopes(api)).flat();
|
|
216
|
+
return scopes = ["openid", ...scopes, ...extraScopes].map(scopeTransform), Array.from(new Set(scopes));
|
|
217
|
+
}
|
|
218
|
+
function apiScopes(api, extraScopes = []) {
|
|
219
|
+
let scopes = [...defaultApiScopes(api), ...extraScopes.map(scopeTransform)].map(scopeTransform);
|
|
220
|
+
return Array.from(new Set(scopes));
|
|
221
|
+
}
|
|
222
|
+
function defaultApiScopes(api) {
|
|
223
|
+
switch (api) {
|
|
224
|
+
case "admin":
|
|
225
|
+
return ["graphql", "themes", "collaborator"];
|
|
226
|
+
case "storefront-renderer":
|
|
227
|
+
return ["devtools"];
|
|
228
|
+
case "partners":
|
|
229
|
+
return ["cli"];
|
|
230
|
+
case "business-platform":
|
|
231
|
+
return ["destinations", "store-management"];
|
|
232
|
+
case "app-management":
|
|
233
|
+
return ["app-management"];
|
|
234
|
+
default:
|
|
235
|
+
throw new BugError(`Unknown API: ${api}`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function scopeTransform(scope) {
|
|
239
|
+
switch (scope) {
|
|
240
|
+
case "graphql":
|
|
241
|
+
return "https://api.shopify.com/auth/shop.admin.graphql";
|
|
242
|
+
case "themes":
|
|
243
|
+
return "https://api.shopify.com/auth/shop.admin.themes";
|
|
244
|
+
case "collaborator":
|
|
245
|
+
return "https://api.shopify.com/auth/partners.collaborator-relationships.readonly";
|
|
246
|
+
case "cli":
|
|
247
|
+
return "https://api.shopify.com/auth/partners.app.cli.access";
|
|
248
|
+
case "devtools":
|
|
249
|
+
return "https://api.shopify.com/auth/shop.storefront-renderer.devtools";
|
|
250
|
+
case "destinations":
|
|
251
|
+
return "https://api.shopify.com/auth/destinations.readonly";
|
|
252
|
+
case "store-management":
|
|
253
|
+
return "https://api.shopify.com/auth/organization.store-management";
|
|
254
|
+
case "app-management":
|
|
255
|
+
return "https://api.shopify.com/auth/organization.apps.manage";
|
|
256
|
+
default:
|
|
257
|
+
return scope;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// ../cli-kit/dist/private/node/session/exchange.js
|
|
184
262
|
init_cjs_shims();
|
|
185
263
|
|
|
186
264
|
// ../cli-kit/dist/public/node/context/fqdn.js
|
|
@@ -505,139 +583,6 @@ var ok = (value) => new Ok(value), err = (err2) => new Err(err2), Ok = class {
|
|
|
505
583
|
}
|
|
506
584
|
};
|
|
507
585
|
|
|
508
|
-
// ../cli-kit/dist/private/node/session/identity-token-validation.js
|
|
509
|
-
async function validateIdentityToken(token) {
|
|
510
|
-
if (isSpin() && firstPartyDev())
|
|
511
|
-
return !0;
|
|
512
|
-
try {
|
|
513
|
-
return withIntrospectionURL(async (introspectionURL) => {
|
|
514
|
-
let options = {
|
|
515
|
-
method: "POST",
|
|
516
|
-
headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
|
|
517
|
-
body: JSON.stringify({ token })
|
|
518
|
-
};
|
|
519
|
-
outputDebug(`Sending Identity Introspection request to URL: ${introspectionURL}`);
|
|
520
|
-
let response = await shopifyFetch(introspectionURL, options);
|
|
521
|
-
if (response.ok && response.headers.get("content-type")?.includes("json")) {
|
|
522
|
-
let json = await response.json();
|
|
523
|
-
return outputDebug(`The identity token is valid: ${json.valid}`), ok(json.valid);
|
|
524
|
-
} else {
|
|
525
|
-
if (response.status === 404 || response.status > 500)
|
|
526
|
-
return err(new AbortError(`The introspection endpoint returned a ${response.status}: ${introspectionURL}`));
|
|
527
|
-
{
|
|
528
|
-
let text = await response.text();
|
|
529
|
-
return outputDebug(`The Introspection request failed with:
|
|
530
|
-
- status: ${response.status}
|
|
531
|
-
- www-authenticate header: ${JSON.stringify(response.headers.get("www-authenticate"))}
|
|
532
|
-
- body: ${JSON.stringify(text)}`), ok(!1);
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
});
|
|
536
|
-
} catch (error) {
|
|
537
|
-
return outputDebug(`The identity token is invalid: ${error}`), !1;
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
async function withIntrospectionURL(fn) {
|
|
541
|
-
let cacheKey = `identity-introspection-url-${await identityFqdn()}`, introspectionURL = await cacheRetrieveOrRepopulate(cacheKey, getIntrospectionURL, 6048e5), result = await fn(introspectionURL);
|
|
542
|
-
if (result.isErr() && (introspectionURL = await cacheRetrieveOrRepopulate(cacheKey, getIntrospectionURL, 0), result = await fn(introspectionURL)), result.isErr())
|
|
543
|
-
throw result.error;
|
|
544
|
-
return result.value;
|
|
545
|
-
}
|
|
546
|
-
async function getIntrospectionURL() {
|
|
547
|
-
return (await (await shopifyFetch(`https://${await identityFqdn()}/.well-known/openid-configuration.json`)).json()).introspection_endpoint;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
// ../cli-kit/dist/private/node/session/validate.js
|
|
551
|
-
function validateScopes(requestedScopes, identity) {
|
|
552
|
-
let currentScopes = identity.scopes;
|
|
553
|
-
return firstPartyDev() !== currentScopes.includes("employee") ? !1 : requestedScopes.every((scope) => currentScopes.includes(scope));
|
|
554
|
-
}
|
|
555
|
-
async function validateSession(scopes, applications, session) {
|
|
556
|
-
if (!session || !validateScopes(scopes, session.identity))
|
|
557
|
-
return "needs_full_auth";
|
|
558
|
-
let tokensAreExpired = isTokenExpired(session.identity);
|
|
559
|
-
if (applications.partnersApi) {
|
|
560
|
-
let appId = applicationId("partners"), token = session.applications[appId];
|
|
561
|
-
tokensAreExpired = tokensAreExpired || isTokenExpired(token);
|
|
562
|
-
}
|
|
563
|
-
if (applications.appManagementApi) {
|
|
564
|
-
let appId = applicationId("app-management"), token = session.applications[appId];
|
|
565
|
-
tokensAreExpired = tokensAreExpired || isTokenExpired(token);
|
|
566
|
-
}
|
|
567
|
-
if (applications.storefrontRendererApi) {
|
|
568
|
-
let appId = applicationId("storefront-renderer"), token = session.applications[appId];
|
|
569
|
-
tokensAreExpired = tokensAreExpired || isTokenExpired(token);
|
|
570
|
-
}
|
|
571
|
-
if (applications.adminApi) {
|
|
572
|
-
let appId = applicationId("admin"), realAppId = `${applications.adminApi.storeFqdn}-${appId}`, token = session.applications[realAppId];
|
|
573
|
-
tokensAreExpired = tokensAreExpired || isTokenExpired(token);
|
|
574
|
-
}
|
|
575
|
-
if (outputDebug(`- Token validation -> It's expired: ${tokensAreExpired}`), !validateCachedIdentityTokenStructure(session.identity))
|
|
576
|
-
return "needs_full_auth";
|
|
577
|
-
if (tokensAreExpired)
|
|
578
|
-
return "needs_refresh";
|
|
579
|
-
let identityIsValid = await validateIdentityToken(session.identity.accessToken);
|
|
580
|
-
return outputDebug(`- Token validation -> It's invalid in identity: ${!identityIsValid}`), identityIsValid ? "ok" : "needs_full_auth";
|
|
581
|
-
}
|
|
582
|
-
function isTokenExpired(token) {
|
|
583
|
-
return token ? token.expiresAt < expireThreshold() : !0;
|
|
584
|
-
}
|
|
585
|
-
function expireThreshold() {
|
|
586
|
-
return new Date(Date.now() + sessionConstants.expirationTimeMarginInMinutes * 60 * 1e3);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
// ../cli-kit/dist/private/node/session/scopes.js
|
|
590
|
-
init_cjs_shims();
|
|
591
|
-
function allDefaultScopes(extraScopes = []) {
|
|
592
|
-
let scopes = allAPIs.map((api) => defaultApiScopes(api)).flat();
|
|
593
|
-
return scopes = ["openid", ...scopes, ...extraScopes].map(scopeTransform), Array.from(new Set(scopes));
|
|
594
|
-
}
|
|
595
|
-
function apiScopes(api, extraScopes = []) {
|
|
596
|
-
let scopes = [...defaultApiScopes(api), ...extraScopes.map(scopeTransform)].map(scopeTransform);
|
|
597
|
-
return Array.from(new Set(scopes));
|
|
598
|
-
}
|
|
599
|
-
function defaultApiScopes(api) {
|
|
600
|
-
switch (api) {
|
|
601
|
-
case "admin":
|
|
602
|
-
return ["graphql", "themes", "collaborator"];
|
|
603
|
-
case "storefront-renderer":
|
|
604
|
-
return ["devtools"];
|
|
605
|
-
case "partners":
|
|
606
|
-
return ["cli"];
|
|
607
|
-
case "business-platform":
|
|
608
|
-
return ["destinations", "store-management"];
|
|
609
|
-
case "app-management":
|
|
610
|
-
return ["app-management"];
|
|
611
|
-
default:
|
|
612
|
-
throw new BugError(`Unknown API: ${api}`);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
function scopeTransform(scope) {
|
|
616
|
-
switch (scope) {
|
|
617
|
-
case "graphql":
|
|
618
|
-
return "https://api.shopify.com/auth/shop.admin.graphql";
|
|
619
|
-
case "themes":
|
|
620
|
-
return "https://api.shopify.com/auth/shop.admin.themes";
|
|
621
|
-
case "collaborator":
|
|
622
|
-
return "https://api.shopify.com/auth/partners.collaborator-relationships.readonly";
|
|
623
|
-
case "cli":
|
|
624
|
-
return "https://api.shopify.com/auth/partners.app.cli.access";
|
|
625
|
-
case "devtools":
|
|
626
|
-
return "https://api.shopify.com/auth/shop.storefront-renderer.devtools";
|
|
627
|
-
case "destinations":
|
|
628
|
-
return "https://api.shopify.com/auth/destinations.readonly";
|
|
629
|
-
case "store-management":
|
|
630
|
-
return "https://api.shopify.com/auth/organization.store-management";
|
|
631
|
-
case "app-management":
|
|
632
|
-
return "https://api.shopify.com/auth/organization.apps.manage";
|
|
633
|
-
default:
|
|
634
|
-
return scope;
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
// ../cli-kit/dist/private/node/session/exchange.js
|
|
639
|
-
init_cjs_shims();
|
|
640
|
-
|
|
641
586
|
// ../../node_modules/.pnpm/jose@5.9.6/node_modules/jose/dist/node/esm/index.js
|
|
642
587
|
init_cjs_shims();
|
|
643
588
|
|
|
@@ -851,8 +796,10 @@ async function requestDeviceAuthorization(scopes) {
|
|
|
851
796
|
To run this command, log in to Shopify.`), !isTTY())
|
|
852
797
|
throw new AbortError("Authorization is required to continue, but the current environment does not support interactive prompts.", "To resolve this, specify credentials in your environment, or run the command in an interactive environment such as your local terminal.");
|
|
853
798
|
outputInfo(outputContent`User verification code: ${jsonResult.user_code}`);
|
|
854
|
-
let linkToken = outputToken.link(jsonResult.verification_uri_complete)
|
|
855
|
-
|
|
799
|
+
let linkToken = outputToken.link(jsonResult.verification_uri_complete), cloudMessage = () => {
|
|
800
|
+
outputInfo(outputContent`👉 Open this link to start the auth process: ${linkToken}`);
|
|
801
|
+
};
|
|
802
|
+
return isCloudEnvironment() ? cloudMessage() : (outputInfo("\u{1F449} Press any key to open the login page on your browser"), await keypress(), await openURL(jsonResult.verification_uri_complete) ? outputInfo(outputContent`Opened link to start the auth process: ${linkToken}`) : cloudMessage()), {
|
|
856
803
|
deviceCode: jsonResult.device_code,
|
|
857
804
|
userCode: jsonResult.user_code,
|
|
858
805
|
verificationUri: jsonResult.verification_uri,
|
|
@@ -899,20 +846,6 @@ function convertRequestToParams(queryParams) {
|
|
|
899
846
|
|
|
900
847
|
// ../cli-kit/dist/private/node/api/rest.js
|
|
901
848
|
init_cjs_shims();
|
|
902
|
-
function restRequestBody(requestBody) {
|
|
903
|
-
if (requestBody)
|
|
904
|
-
return JSON.stringify(requestBody);
|
|
905
|
-
}
|
|
906
|
-
function restRequestUrl(session, apiVersion, path, searchParams = {}) {
|
|
907
|
-
let url = new URL(isThemeAccessSession(session) ? `https://${themeKitAccessDomain}/cli/admin/api/${apiVersion}${path}.json` : `https://${session.storeFqdn}/admin/api/${apiVersion}${path}.json`);
|
|
908
|
-
return Object.entries(searchParams).forEach(([name, value]) => {
|
|
909
|
-
url.searchParams.set(name, value);
|
|
910
|
-
}), url.toString();
|
|
911
|
-
}
|
|
912
|
-
function restRequestHeaders(session) {
|
|
913
|
-
let store2 = session.storeFqdn, token = session.token, headers = buildHeaders(session.token);
|
|
914
|
-
return isThemeAccessSession(session) && (headers["X-Shopify-Shop"] = store2, headers["X-Shopify-Access-Token"] = token), headers;
|
|
915
|
-
}
|
|
916
849
|
function isThemeAccessSession(session) {
|
|
917
850
|
return session.token.startsWith("shptka_");
|
|
918
851
|
}
|
|
@@ -1123,9 +1056,6 @@ export {
|
|
|
1123
1056
|
err,
|
|
1124
1057
|
exchangeCustomPartnerToken,
|
|
1125
1058
|
remove,
|
|
1126
|
-
restRequestBody,
|
|
1127
|
-
restRequestUrl,
|
|
1128
|
-
restRequestHeaders,
|
|
1129
1059
|
isThemeAccessSession,
|
|
1130
1060
|
getLastSeenUserIdAfterAuth,
|
|
1131
1061
|
setLastSeenUserIdAfterAuth,
|
|
@@ -1135,4 +1065,4 @@ export {
|
|
|
1135
1065
|
getEnvironmentData,
|
|
1136
1066
|
getSensitiveEnvironmentData
|
|
1137
1067
|
};
|
|
1138
|
-
//# sourceMappingURL=chunk-
|
|
1068
|
+
//# sourceMappingURL=chunk-5TZDSORY.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CLI_KIT_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DFFXOFLT.js";
|
|
4
4
|
import {
|
|
5
5
|
outputInfo
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LXQWZFLX.js";
|
|
7
7
|
import {
|
|
8
8
|
init_cjs_shims
|
|
9
9
|
} from "./chunk-PKR7KJ6P.js";
|
|
@@ -17,4 +17,4 @@ async function versionService() {
|
|
|
17
17
|
export {
|
|
18
18
|
versionService
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-6KV6OKFB.js.map
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
getEnvironmentData,
|
|
3
3
|
getLastSeenUserIdAfterAuth,
|
|
4
4
|
getSensitiveEnvironmentData
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5TZDSORY.js";
|
|
6
6
|
import {
|
|
7
7
|
fetch
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-W6WCETMJ.js";
|
|
9
9
|
import {
|
|
10
10
|
CLI_KIT_VERSION
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DFFXOFLT.js";
|
|
12
12
|
import {
|
|
13
13
|
runWithRateLimit
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WWI2QVFK.js";
|
|
15
15
|
import {
|
|
16
16
|
alwaysLogAnalytics,
|
|
17
17
|
alwaysLogMetrics,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
outputDebug,
|
|
29
29
|
outputToken,
|
|
30
30
|
reportingRateLimit
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-LXQWZFLX.js";
|
|
32
32
|
import {
|
|
33
33
|
__commonJS,
|
|
34
34
|
__esm,
|
|
@@ -15930,4 +15930,4 @@ export {
|
|
|
15930
15930
|
requestIdsCollection,
|
|
15931
15931
|
reportAnalyticsEvent
|
|
15932
15932
|
};
|
|
15933
|
-
//# sourceMappingURL=chunk-
|
|
15933
|
+
//# sourceMappingURL=chunk-6TPMZTXG.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
searchService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MVZ4LGIM.js";
|
|
4
4
|
import {
|
|
5
5
|
base_command_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EHL6XSBG.js";
|
|
7
7
|
import {
|
|
8
8
|
require_lib
|
|
9
9
|
} from "./chunk-VSKRQ3JT.js";
|
|
@@ -45,4 +45,4 @@ var import_core = __toESM(require_lib(), 1), Search = class _Search extends base
|
|
|
45
45
|
export {
|
|
46
46
|
Search
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-742MYXOA.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
staticService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T2LQCR7X.js";
|
|
4
4
|
import {
|
|
5
5
|
base_command_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EHL6XSBG.js";
|
|
7
7
|
import {
|
|
8
8
|
init_cjs_shims
|
|
9
9
|
} from "./chunk-PKR7KJ6P.js";
|
|
@@ -25,4 +25,4 @@ var KitchenSinkStatic = class extends base_command_default {
|
|
|
25
25
|
export {
|
|
26
26
|
KitchenSinkStatic
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-7UIQNXWE.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
fetchNotifications,
|
|
2
3
|
getNotifications,
|
|
3
4
|
stringifyFilters
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IROPFRNN.js";
|
|
5
6
|
import {
|
|
6
7
|
CLI_KIT_VERSION
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DFFXOFLT.js";
|
|
8
9
|
import {
|
|
9
10
|
outputInfo,
|
|
10
11
|
randomUUID,
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
renderTable,
|
|
14
15
|
renderTextPrompt,
|
|
15
16
|
writeFile
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LXQWZFLX.js";
|
|
17
18
|
import {
|
|
18
19
|
init_cjs_shims
|
|
19
20
|
} from "./chunk-PKR7KJ6P.js";
|
|
@@ -81,14 +82,14 @@ async function generate() {
|
|
|
81
82
|
notifications.notifications.push(notification), await writeFile("./notifications.json", JSON.stringify(notifications)), renderSuccess({ headline: "notifications.json file updated successfully." });
|
|
82
83
|
}
|
|
83
84
|
async function list() {
|
|
84
|
-
let notifications = await
|
|
85
|
+
let notifications = await fetchNotifications(), columns = {
|
|
85
86
|
type: { header: "Type", color: "dim" },
|
|
86
87
|
title: { header: "Title", color: "dim" },
|
|
87
88
|
message: { header: "Message", color: "dim" },
|
|
88
89
|
filters: { header: "Filters", color: "dim" }
|
|
89
90
|
}, rows = notifications.notifications.map((notification) => ({
|
|
90
91
|
type: notification.type,
|
|
91
|
-
title: notification.title
|
|
92
|
+
title: notification.title ?? "",
|
|
92
93
|
message: notification.message,
|
|
93
94
|
filters: stringifyFilters(notification)
|
|
94
95
|
}));
|
|
@@ -100,4 +101,4 @@ export {
|
|
|
100
101
|
generate,
|
|
101
102
|
list
|
|
102
103
|
};
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
104
|
+
//# sourceMappingURL=chunk-A44GEDKW.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
base_command_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EHL6XSBG.js";
|
|
4
4
|
import {
|
|
5
5
|
cacheClear
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WWI2QVFK.js";
|
|
7
7
|
import {
|
|
8
8
|
environmentVariables,
|
|
9
9
|
isTruthy
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LXQWZFLX.js";
|
|
11
11
|
import {
|
|
12
12
|
require_lib
|
|
13
13
|
} from "./chunk-VSKRQ3JT.js";
|
|
@@ -26,7 +26,7 @@ init_cjs_shims();
|
|
|
26
26
|
init_cjs_shims();
|
|
27
27
|
import { fileURLToPath } from "node:url";
|
|
28
28
|
async function launchCLI(options) {
|
|
29
|
-
let { errorHandler } = await import("./error-handler-
|
|
29
|
+
let { errorHandler } = await import("./error-handler-FV3FJ3VW.js"), { isDevelopment } = await import("./local-PMOJBQT6.js"), oclif = await import("./lib-SGEWXU7Z.js"), { ShopifyConfig } = await import("./custom-oclif-loader-BXHJERI2.js");
|
|
30
30
|
isDevelopment() && (oclif.default.settings.debug = !0);
|
|
31
31
|
try {
|
|
32
32
|
let config = new ShopifyConfig({ root: fileURLToPath(options.moduleURL) });
|
|
@@ -38,11 +38,11 @@ async function launchCLI(options) {
|
|
|
38
38
|
|
|
39
39
|
// ../cli-kit/dist/public/node/cli.js
|
|
40
40
|
var import_core = __toESM(require_lib());
|
|
41
|
-
async function
|
|
41
|
+
async function exitIfOldNodeVersion(versions = process.versions) {
|
|
42
42
|
let nodeVersion = versions.node, nodeMajorVersion = Number(nodeVersion.split(".")[0]);
|
|
43
43
|
if (nodeMajorVersion < 18) {
|
|
44
|
-
let {
|
|
45
|
-
|
|
44
|
+
let { renderError } = await import("./ui-5VMS7DNB.js");
|
|
45
|
+
renderError({
|
|
46
46
|
headline: "Upgrade to a supported Node version now.",
|
|
47
47
|
body: [
|
|
48
48
|
`Node ${nodeMajorVersion} has reached end-of-life and poses security risks. When you upgrade to a`,
|
|
@@ -55,7 +55,7 @@ async function warnIfOldNodeVersion(versions = process.versions) {
|
|
|
55
55
|
{ char: "," },
|
|
56
56
|
"you'll be able to use Shopify CLI without interruption."
|
|
57
57
|
]
|
|
58
|
-
});
|
|
58
|
+
}), process.exit(1);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function setupEnvironmentVariables(options, argv = process.argv, env = process.env) {
|
|
@@ -65,10 +65,10 @@ function forceNoColor(argv = process.argv, env = process.env) {
|
|
|
65
65
|
(argv.includes("--no-color") || isTruthy(env.NO_COLOR) || isTruthy(env.SHOPIFY_FLAG_NO_COLOR) || env.TERM === "dumb") && (env.FORCE_COLOR = "0");
|
|
66
66
|
}
|
|
67
67
|
async function runCLI(options, launchCLI2 = launchCLI, argv = process.argv, env = process.env, versions = process.versions) {
|
|
68
|
-
return setupEnvironmentVariables(options, argv, env), options.runInCreateMode && await addInitToArgvWhenRunningCreateCLI(options, argv), forceNoColor(argv, env), await
|
|
68
|
+
return setupEnvironmentVariables(options, argv, env), options.runInCreateMode && await addInitToArgvWhenRunningCreateCLI(options, argv), forceNoColor(argv, env), await exitIfOldNodeVersion(versions), launchCLI2({ moduleURL: options.moduleURL });
|
|
69
69
|
}
|
|
70
70
|
async function addInitToArgvWhenRunningCreateCLI(options, argv = process.argv) {
|
|
71
|
-
let { findUpAndReadPackageJson } = await import("./node-package-manager-
|
|
71
|
+
let { findUpAndReadPackageJson } = await import("./node-package-manager-FZRL3EQB.js"), { moduleDirectory } = await import("./path-2K5HIMHZ.js"), name = (await findUpAndReadPackageJson(moduleDirectory(options.moduleURL))).content.name.replace("@shopify/create-", "");
|
|
72
72
|
if (argv.findIndex((arg) => arg.includes("init")) === -1) {
|
|
73
73
|
let initIndex2 = argv.findIndex((arg) => arg.match(new RegExp(`bin(\\/|\\\\)+(create-${name}|dev|run)`))) + 1;
|
|
74
74
|
argv.splice(initIndex2, 0, "init");
|
|
@@ -117,4 +117,4 @@ export {
|
|
|
117
117
|
jsonFlag,
|
|
118
118
|
ClearCache
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-ACGZSEHA.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A44GEDKW.js";
|
|
4
4
|
import {
|
|
5
5
|
base_command_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EHL6XSBG.js";
|
|
7
7
|
import {
|
|
8
8
|
init_cjs_shims
|
|
9
9
|
} from "./chunk-PKR7KJ6P.js";
|
|
@@ -25,4 +25,4 @@ var Generate = class extends base_command_default {
|
|
|
25
25
|
export {
|
|
26
26
|
Generate
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-BJG7ZRQ2.js.map
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// ../cli-kit/dist/public/common/version.js
|
|
6
6
|
init_cjs_shims();
|
|
7
|
-
var CLI_KIT_VERSION = "3.
|
|
7
|
+
var CLI_KIT_VERSION = "3.76.1";
|
|
8
8
|
|
|
9
9
|
export {
|
|
10
10
|
CLI_KIT_VERSION
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-DFFXOFLT.js.map
|