@shopify/cli 3.78.1 → 3.79.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.
- package/dist/assets/dev-console/extensions/dev-console/assets/index-BteeGmYf.css +1 -0
- package/dist/assets/dev-console/extensions/dev-console/assets/index-CqNhY1h-.js +64 -0
- package/dist/assets/dev-console/index.html +2 -2
- package/dist/assets/hydrogen/starter/.cursor/rules/cookbook-recipe-subscriptions.mdc +921 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +20 -0
- package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +15 -0
- package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/components/ProductItem.tsx +44 -0
- package/dist/assets/hydrogen/starter/app/lib/redirect.ts +23 -0
- package/dist/assets/hydrogen/starter/app/routes/_index.tsx +8 -23
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +22 -2
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +4 -0
- package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +7 -41
- package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +11 -44
- package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +9 -1
- package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +5 -1
- package/dist/assets/hydrogen/starter/app/styles/app.css +15 -3
- package/dist/assets/hydrogen/starter/package.json +5 -5
- package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +57 -36
- package/dist/{chunk-F3SJ7GH2.js → chunk-2B4E6VSB.js} +3 -3
- package/dist/{chunk-TJUGCRWY.js → chunk-4BO44W6A.js} +2 -2
- package/dist/{chunk-ZJ2IPVO4.js → chunk-54K4AM4U.js} +3 -3
- package/dist/{chunk-HE3BDMSQ.js → chunk-7QKG75SI.js} +73 -7
- package/dist/{chunk-6GQF27II.js → chunk-ALANDDAF.js} +3 -3
- package/dist/{chunk-GA5Q2G7N.js → chunk-ANW4ZUSD.js} +2 -2
- package/dist/{chunk-RH2XRA3A.js → chunk-AVR7SY23.js} +4 -4
- package/dist/{chunk-5DXEBIVF.js → chunk-CZ7EMDNP.js} +5 -5
- package/dist/{chunk-6IPFYNHW.js → chunk-DG3SRCQ7.js} +2 -2
- package/dist/{chunk-QYA3TD2H.js → chunk-DOKAITPJ.js} +4 -4
- package/dist/{chunk-SWU3QODP.js → chunk-EKAPTGJ2.js} +2 -2
- package/dist/{chunk-OAZABGFS.js → chunk-F55GHOR3.js} +83 -130
- package/dist/{chunk-HRT2J6AZ.js → chunk-G63ZK76J.js} +3 -3
- package/dist/{chunk-VE4ESNRH.js → chunk-HTK3YCUG.js} +3 -3
- package/dist/{chunk-F23MB6TB.js → chunk-IARZXI6R.js} +3 -3
- package/dist/{chunk-HGD26EDV.js → chunk-IYBFDT7N.js} +41 -16
- package/dist/{chunk-WWOE2EFZ.js → chunk-JCZQQS22.js} +4 -4
- package/dist/{chunk-TIMWAEJ5.js → chunk-KRTNJAVX.js} +3 -3
- package/dist/{chunk-AV64MUSE.js → chunk-KVPURBXO.js} +5 -5
- package/dist/{chunk-EBRJEUGC.js → chunk-LFQMCRXU.js} +13 -9
- package/dist/{chunk-H73PDGHM.js → chunk-MLGPNWXX.js} +87 -97
- package/dist/{chunk-3COQLGRL.js → chunk-MRU3X272.js} +4 -4
- package/dist/{chunk-BV6PURBM.js → chunk-NOSVFQH5.js} +3 -3
- package/dist/{chunk-GWN4I7WX.js → chunk-OOVDD552.js} +3 -3
- package/dist/{chunk-FHYKRLSA.js → chunk-P6WUJAQG.js} +3 -3
- package/dist/{chunk-FEYZLXHI.js → chunk-PRSCEDOW.js} +18 -5
- package/dist/{chunk-HO5XX2LU.js → chunk-QBB7AFBN.js} +7 -7
- package/dist/{chunk-LE26CN2H.js → chunk-QJTHRGGC.js} +7 -5
- package/dist/{chunk-TFCMG5O2.js → chunk-QW44EO42.js} +8 -8
- package/dist/{chunk-PT5BDLIN.js → chunk-SHIHLMYP.js} +8 -6
- package/dist/{chunk-UGX6DGR4.js → chunk-SUWZRQHU.js} +2 -2
- package/dist/{chunk-DNGCAQBF.js → chunk-U6TDVNHS.js} +16 -15
- package/dist/{chunk-QTRXKFCW.js → chunk-UQLLSBKG.js} +3 -3
- package/dist/{chunk-QAKYKTFV.js → chunk-UTDSSCPI.js} +5 -5
- package/dist/{chunk-O6JLOWUE.js → chunk-YILOICE5.js} +5 -5
- package/dist/{chunk-FZI742QM.js → chunk-ZCIGSW2P.js} +2 -2
- package/dist/cli/commands/auth/logout.js +13 -13
- package/dist/cli/commands/auth/logout.test.js +14 -14
- package/dist/cli/commands/cache/clear.js +12 -12
- package/dist/cli/commands/debug/command-flags.js +12 -12
- package/dist/cli/commands/docs/generate.js +12 -12
- package/dist/cli/commands/docs/generate.test.js +13 -13
- package/dist/cli/commands/help.js +12 -12
- package/dist/cli/commands/kitchen-sink/async.js +13 -13
- package/dist/cli/commands/kitchen-sink/async.test.js +13 -13
- package/dist/cli/commands/kitchen-sink/index.js +15 -15
- package/dist/cli/commands/kitchen-sink/index.test.js +15 -15
- package/dist/cli/commands/kitchen-sink/prompts.js +13 -13
- package/dist/cli/commands/kitchen-sink/prompts.test.js +13 -13
- package/dist/cli/commands/kitchen-sink/static.js +13 -13
- package/dist/cli/commands/kitchen-sink/static.test.js +13 -13
- package/dist/cli/commands/notifications/generate.js +13 -13
- package/dist/cli/commands/notifications/list.js +13 -13
- package/dist/cli/commands/search.js +13 -13
- package/dist/cli/commands/upgrade.js +13 -13
- package/dist/cli/commands/version.js +13 -13
- package/dist/cli/commands/version.test.js +13 -13
- package/dist/cli/services/commands/notifications.js +8 -8
- package/dist/cli/services/commands/search.js +5 -4
- package/dist/cli/services/commands/search.test.js +5 -4
- package/dist/cli/services/commands/version.js +6 -5
- package/dist/cli/services/commands/version.test.js +7 -6
- package/dist/cli/services/kitchen-sink/async.js +5 -4
- package/dist/cli/services/kitchen-sink/prompts.js +5 -4
- package/dist/cli/services/kitchen-sink/static.js +5 -4
- package/dist/cli/services/upgrade.js +5 -5
- package/dist/cli/services/upgrade.test.js +7 -7
- package/dist/configs/all.yml +19 -4
- package/dist/configs/recommended.yml +19 -4
- package/dist/{custom-oclif-loader-BGXT6N23.js → custom-oclif-loader-ZMH2MAPE.js} +5 -4
- package/dist/{error-handler-HVEM4RKZ.js → error-handler-7Z6N6VQJ.js} +10 -10
- package/dist/hooks/postrun.js +9 -9
- package/dist/hooks/prerun.js +10 -10
- package/dist/index.js +2780 -2431
- package/dist/is-wsl-YAJ3DFN7.js +64 -0
- package/dist/{lib-IZAG57CE.js → lib-MWWAATIC.js} +3 -3
- package/dist/{local-UX2FKODS.js → local-LWMJQBFZ.js} +5 -6
- package/dist/{morph-W4XLLZ47.js → morph-MDY3DSJL.js} +9 -9
- package/dist/{node-RJ5OAO2M.js → node-JJXJUMVQ.js} +17 -17
- package/dist/{node-package-manager-NS6MYGUI.js → node-package-manager-BZGMCXZM.js} +5 -5
- package/dist/toml-patch-wasm-J5VGG6WG.js +140 -0
- package/dist/toml_patch_bg.wasm +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-FQHY2OWD.js → ui-IJDVK4OG.js} +5 -4
- package/dist/{workerd-KUHMQGDX.js → workerd-XA4WKUCO.js} +16 -16
- package/oclif.manifest.json +100 -2
- package/package.json +7 -7
- package/dist/assets/dev-console/extensions/dev-console/assets/index-lyGm6l3x.js +0 -64
- package/dist/assets/dev-console/extensions/dev-console/assets/index-n8yr6cxq.css +0 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_semver
|
|
3
|
+
} from "./chunk-HMDWNGIV.js";
|
|
1
4
|
import {
|
|
2
5
|
require_lib as require_lib2
|
|
3
6
|
} from "./chunk-B5EXYCV3.js";
|
|
@@ -10,7 +13,6 @@ import {
|
|
|
10
13
|
joinPath,
|
|
11
14
|
normalizePath,
|
|
12
15
|
relativizePath,
|
|
13
|
-
sniffForJson,
|
|
14
16
|
sniffForPath
|
|
15
17
|
} from "./chunk-57Q6OQG4.js";
|
|
16
18
|
import {
|
|
@@ -18,7 +20,7 @@ import {
|
|
|
18
20
|
require_lib,
|
|
19
21
|
require_source,
|
|
20
22
|
require_supports_hyperlinks
|
|
21
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UTDSSCPI.js";
|
|
22
24
|
import {
|
|
23
25
|
require_brace_expansion,
|
|
24
26
|
require_source_map
|
|
@@ -3644,10 +3646,10 @@ var require_ensure = __commonJS({
|
|
|
3644
3646
|
var require_utils2 = __commonJS({
|
|
3645
3647
|
"../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module) {
|
|
3646
3648
|
init_cjs_shims();
|
|
3647
|
-
function stringify(obj, { EOL
|
|
3649
|
+
function stringify(obj, { EOL = `
|
|
3648
3650
|
`, finalEOL = !0, replacer = null, spaces } = {}) {
|
|
3649
|
-
let EOF = finalEOL ?
|
|
3650
|
-
return JSON.stringify(obj, replacer, spaces).replace(/\n/g,
|
|
3651
|
+
let EOF = finalEOL ? EOL : "";
|
|
3652
|
+
return JSON.stringify(obj, replacer, spaces).replace(/\n/g, EOL) + EOF;
|
|
3651
3653
|
}
|
|
3652
3654
|
function stripBom(content) {
|
|
3653
3655
|
return Buffer.isBuffer(content) && (content = content.toString("utf8")), content.replace(/^\uFEFF/, "");
|
|
@@ -4214,8 +4216,8 @@ var require_getmacaddress_unix = __commonJS({
|
|
|
4214
4216
|
var require_getmacaddress = __commonJS({
|
|
4215
4217
|
"../../node_modules/.pnpm/macaddress@0.5.3/node_modules/macaddress/lib/getmacaddress.js"(exports, module) {
|
|
4216
4218
|
init_cjs_shims();
|
|
4217
|
-
var
|
|
4218
|
-
switch (
|
|
4219
|
+
var os5 = __require("os"), _getMacAddress, _validIfaceRegExp = "^[a-z0-9]+$";
|
|
4220
|
+
switch (os5.platform()) {
|
|
4219
4221
|
case "win32":
|
|
4220
4222
|
_validIfaceRegExp = "^[a-z0-9 -]+$", _getMacAddress = require_getmacaddress_windows();
|
|
4221
4223
|
break;
|
|
@@ -4319,8 +4321,8 @@ var require_getallinterfaces_unix = __commonJS({
|
|
|
4319
4321
|
var require_getallinterfaces = __commonJS({
|
|
4320
4322
|
"../../node_modules/.pnpm/macaddress@0.5.3/node_modules/macaddress/lib/getallinterfaces.js"(exports, module) {
|
|
4321
4323
|
init_cjs_shims();
|
|
4322
|
-
var
|
|
4323
|
-
switch (
|
|
4324
|
+
var os5 = __require("os"), _getAllInterfaces;
|
|
4325
|
+
switch (os5.platform()) {
|
|
4324
4326
|
case "win32":
|
|
4325
4327
|
_getAllInterfaces = require_getallinterfaces_windows();
|
|
4326
4328
|
break;
|
|
@@ -4344,11 +4346,11 @@ var require_getallinterfaces = __commonJS({
|
|
|
4344
4346
|
var require_networkinterfaces = __commonJS({
|
|
4345
4347
|
"../../node_modules/.pnpm/macaddress@0.5.3/node_modules/macaddress/lib/networkinterfaces.js"(exports, module) {
|
|
4346
4348
|
init_cjs_shims();
|
|
4347
|
-
var
|
|
4349
|
+
var os5 = __require("os");
|
|
4348
4350
|
module.exports = function() {
|
|
4349
4351
|
var allAddresses = {};
|
|
4350
4352
|
try {
|
|
4351
|
-
var ifaces =
|
|
4353
|
+
var ifaces = os5.networkInterfaces();
|
|
4352
4354
|
} catch (e) {
|
|
4353
4355
|
if (e.syscall === "uv_interface_addresses")
|
|
4354
4356
|
return allAddresses;
|
|
@@ -22247,6 +22249,9 @@ function uniqBy(array, iteratee) {
|
|
|
22247
22249
|
function difference(array, ...values) {
|
|
22248
22250
|
return (0, import_difference.default)(array, ...values);
|
|
22249
22251
|
}
|
|
22252
|
+
function asHumanFriendlyArray(items) {
|
|
22253
|
+
return items.length < 2 ? items : items.reduce((acc, item, index) => (index === items.length - 1 ? acc.push("and") : index !== 0 && acc.push(", "), acc.push(item), acc), []);
|
|
22254
|
+
}
|
|
22250
22255
|
|
|
22251
22256
|
// ../cli-kit/dist/public/common/string.js
|
|
22252
22257
|
var import_change_case = __toESM(require_dist15(), 1), SAFE_RANDOM_BUSINESS_ADJECTIVES = [
|
|
@@ -23450,22 +23455,22 @@ var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/, regExpEscape2 = (s) => s.replace(/[-[
|
|
|
23450
23455
|
return globParts.filter((gs) => gs.length);
|
|
23451
23456
|
}
|
|
23452
23457
|
partsMatch(a, b, emptyGSMatch = !1) {
|
|
23453
|
-
let ai = 0, bi = 0, result = [],
|
|
23458
|
+
let ai = 0, bi = 0, result = [], which3 = "";
|
|
23454
23459
|
for (; ai < a.length && bi < b.length; )
|
|
23455
23460
|
if (a[ai] === b[bi])
|
|
23456
|
-
result.push(
|
|
23461
|
+
result.push(which3 === "b" ? b[bi] : a[ai]), ai++, bi++;
|
|
23457
23462
|
else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1])
|
|
23458
23463
|
result.push(a[ai]), ai++;
|
|
23459
23464
|
else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1])
|
|
23460
23465
|
result.push(b[bi]), bi++;
|
|
23461
23466
|
else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
23462
|
-
if (
|
|
23467
|
+
if (which3 === "b")
|
|
23463
23468
|
return !1;
|
|
23464
|
-
|
|
23469
|
+
which3 = "a", result.push(a[ai]), ai++, bi++;
|
|
23465
23470
|
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
23466
|
-
if (
|
|
23471
|
+
if (which3 === "a")
|
|
23467
23472
|
return !1;
|
|
23468
|
-
|
|
23473
|
+
which3 = "b", result.push(b[bi]), ai++, bi++;
|
|
23469
23474
|
} else
|
|
23470
23475
|
return !1;
|
|
23471
23476
|
return a.length === b.length && result;
|
|
@@ -23614,7 +23619,6 @@ minimatch.unescape = unescape2;
|
|
|
23614
23619
|
// ../cli-kit/dist/public/node/fs.js
|
|
23615
23620
|
import { mkdirSync as fsMkdirSync, readFileSync as fsReadFileSync, writeFileSync as fsWriteFileSync, appendFileSync as fsAppendFileSync, statSync as fsStatSync, createReadStream as fsCreateReadStream, createWriteStream as fsCreateWriteStream, constants as fsConstants, existsSync as fsFileExistsSync, unlinkSync as fsUnlinkSync } from "fs";
|
|
23616
23621
|
import { mkdir as fsMkdir, writeFile as fsWriteFile, readFile as fsReadFile, realpath as fsRealPath, appendFile as fsAppendFile, mkdtemp as fsMkdtemp, stat as fsStat, lstat as fsLstat, chmod as fsChmod, access as fsAccess, rename as fsRename, unlink as fsUnlink } from "fs/promises";
|
|
23617
|
-
import * as os2 from "os";
|
|
23618
23622
|
async function inTemporaryDirectory(callback) {
|
|
23619
23623
|
return temporaryDirectoryTask(callback);
|
|
23620
23624
|
}
|
|
@@ -23730,20 +23734,6 @@ async function glob(pattern, options) {
|
|
|
23730
23734
|
let { default: fastGlob } = await import("./out-AZBX4ITJ.js"), overridenOptions = options;
|
|
23731
23735
|
return options?.dot == null && (overridenOptions = { ...options, dot: !0 }), fastGlob(pattern, overridenOptions);
|
|
23732
23736
|
}
|
|
23733
|
-
function detectEOL(content) {
|
|
23734
|
-
let match2 = content.match(/\r\n|\n/g);
|
|
23735
|
-
if (!match2)
|
|
23736
|
-
return defaultEOL();
|
|
23737
|
-
let crlf = match2.filter((eol) => eol === `\r
|
|
23738
|
-
`).length, lf = match2.filter((eol) => eol === `
|
|
23739
|
-
`).length;
|
|
23740
|
-
return crlf > lf ? `\r
|
|
23741
|
-
` : `
|
|
23742
|
-
`;
|
|
23743
|
-
}
|
|
23744
|
-
function defaultEOL() {
|
|
23745
|
-
return os2.EOL;
|
|
23746
|
-
}
|
|
23747
23737
|
async function findPathUp(matcher, options) {
|
|
23748
23738
|
let got = await findUp(matcher, options);
|
|
23749
23739
|
return got ? normalizePath(got) : void 0;
|
|
@@ -23758,16 +23748,16 @@ init_cjs_shims();
|
|
|
23758
23748
|
// ../../node_modules/.pnpm/env-paths@3.0.0/node_modules/env-paths/index.js
|
|
23759
23749
|
init_cjs_shims();
|
|
23760
23750
|
import path5 from "node:path";
|
|
23761
|
-
import
|
|
23751
|
+
import os2 from "node:os";
|
|
23762
23752
|
import process3 from "node:process";
|
|
23763
|
-
var homedir =
|
|
23753
|
+
var homedir = os2.homedir(), tmpdir = os2.tmpdir(), { env } = process3, macos = (name) => {
|
|
23764
23754
|
let library = path5.join(homedir, "Library");
|
|
23765
23755
|
return {
|
|
23766
23756
|
data: path5.join(library, "Application Support", name),
|
|
23767
23757
|
config: path5.join(library, "Preferences", name),
|
|
23768
23758
|
cache: path5.join(library, "Caches", name),
|
|
23769
23759
|
log: path5.join(library, "Logs", name),
|
|
23770
|
-
temp: path5.join(
|
|
23760
|
+
temp: path5.join(tmpdir, name)
|
|
23771
23761
|
};
|
|
23772
23762
|
}, windows = (name) => {
|
|
23773
23763
|
let appData = env.APPDATA || path5.join(homedir, "AppData", "Roaming"), localAppData = env.LOCALAPPDATA || path5.join(homedir, "AppData", "Local");
|
|
@@ -23777,7 +23767,7 @@ var homedir = os3.homedir(), tmpdir2 = os3.tmpdir(), { env } = process3, macos =
|
|
|
23777
23767
|
config: path5.join(appData, name, "Config"),
|
|
23778
23768
|
cache: path5.join(localAppData, name, "Cache"),
|
|
23779
23769
|
log: path5.join(localAppData, name, "Log"),
|
|
23780
|
-
temp: path5.join(
|
|
23770
|
+
temp: path5.join(tmpdir, name)
|
|
23781
23771
|
};
|
|
23782
23772
|
}, linux = (name) => {
|
|
23783
23773
|
let username2 = path5.basename(homedir);
|
|
@@ -23787,7 +23777,7 @@ var homedir = os3.homedir(), tmpdir2 = os3.tmpdir(), { env } = process3, macos =
|
|
|
23787
23777
|
cache: path5.join(env.XDG_CACHE_HOME || path5.join(homedir, ".cache"), name),
|
|
23788
23778
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
23789
23779
|
log: path5.join(env.XDG_STATE_HOME || path5.join(homedir, ".local", "state"), name),
|
|
23790
|
-
temp: path5.join(
|
|
23780
|
+
temp: path5.join(tmpdir, username2, name)
|
|
23791
23781
|
};
|
|
23792
23782
|
};
|
|
23793
23783
|
function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
@@ -24447,7 +24437,7 @@ var aliases = ["stdin", "stdout", "stderr"], hasAlias = (options) => aliases.som
|
|
|
24447
24437
|
// ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/lib/kill.js
|
|
24448
24438
|
init_cjs_shims();
|
|
24449
24439
|
var import_signal_exit = __toESM(require_signal_exit(), 1);
|
|
24450
|
-
import
|
|
24440
|
+
import os3 from "node:os";
|
|
24451
24441
|
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5, spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
24452
24442
|
let killResult = kill(signal);
|
|
24453
24443
|
return setKillTimeout(kill, signal, options, killResult), killResult;
|
|
@@ -24458,7 +24448,7 @@ var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5, spawnedKill = (kill, signal = "SIGTERM
|
|
|
24458
24448
|
kill("SIGKILL");
|
|
24459
24449
|
}, timeout);
|
|
24460
24450
|
t.unref && t.unref();
|
|
24461
|
-
}, shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== !1 && killResult, isSigterm = (signal) => signal ===
|
|
24451
|
+
}, shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== !1 && killResult, isSigterm = (signal) => signal === os3.constants.signals.SIGTERM || typeof signal == "string" && signal.toUpperCase() === "SIGTERM", getForceKillAfterTimeout = ({ forceKillAfterTimeout = !0 }) => {
|
|
24462
24452
|
if (forceKillAfterTimeout === !0)
|
|
24463
24453
|
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
24464
24454
|
if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0)
|
|
@@ -24919,6 +24909,9 @@ function terminalSupportsPrompting() {
|
|
|
24919
24909
|
function isCI() {
|
|
24920
24910
|
return isTruthy(process.env.CI);
|
|
24921
24911
|
}
|
|
24912
|
+
async function isWsl() {
|
|
24913
|
+
return (await import("./is-wsl-YAJ3DFN7.js")).default;
|
|
24914
|
+
}
|
|
24922
24915
|
|
|
24923
24916
|
// ../cli-kit/dist/private/node/context/spin-cache.js
|
|
24924
24917
|
init_cjs_shims();
|
|
@@ -25071,60 +25064,6 @@ function getCIMetadata(envName, envs) {
|
|
|
25071
25064
|
}
|
|
25072
25065
|
}
|
|
25073
25066
|
|
|
25074
|
-
// ../cli-kit/dist/public/node/environment.js
|
|
25075
|
-
init_cjs_shims();
|
|
25076
|
-
|
|
25077
|
-
// ../cli-kit/dist/public/node/crypto.js
|
|
25078
|
-
init_cjs_shims();
|
|
25079
|
-
import crypto2 from "crypto";
|
|
25080
|
-
function hashString(str) {
|
|
25081
|
-
return crypto2.createHash("sha1").update(str).digest("hex");
|
|
25082
|
-
}
|
|
25083
|
-
function fileHash(buff) {
|
|
25084
|
-
return crypto2.createHash("md5").update(buff).digest("hex");
|
|
25085
|
-
}
|
|
25086
|
-
function randomUUID() {
|
|
25087
|
-
return crypto2.randomUUID();
|
|
25088
|
-
}
|
|
25089
|
-
function nonRandomUUID(subject) {
|
|
25090
|
-
return crypto2.createHash("sha1").update(Buffer.from("6ba7b810-9dad-11d1-80b4-00c04fd430c8".replace(/-/g, ""), "hex")).update(subject).digest().toString("hex").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
|
|
25091
|
-
}
|
|
25092
|
-
|
|
25093
|
-
// ../cli-kit/dist/public/node/environment.js
|
|
25094
|
-
function getEnvironmentVariables() {
|
|
25095
|
-
return process.env;
|
|
25096
|
-
}
|
|
25097
|
-
function getPartnersToken() {
|
|
25098
|
-
return getEnvironmentVariables()[environmentVariables.partnersToken];
|
|
25099
|
-
}
|
|
25100
|
-
function getBackendPort() {
|
|
25101
|
-
let backendPort = getEnvironmentVariables()[systemEnvironmentVariables.backendPort];
|
|
25102
|
-
if (backendPort && !isNaN(Number(backendPort)))
|
|
25103
|
-
return Number(backendPort);
|
|
25104
|
-
}
|
|
25105
|
-
function getIdentityTokenInformation() {
|
|
25106
|
-
let identityToken = getEnvironmentVariables()[environmentVariables.identityToken], refreshToken = getEnvironmentVariables()[environmentVariables.refreshToken];
|
|
25107
|
-
if (!(!identityToken || !refreshToken))
|
|
25108
|
-
return {
|
|
25109
|
-
accessToken: identityToken,
|
|
25110
|
-
refreshToken,
|
|
25111
|
-
userId: nonRandomUUID(identityToken)
|
|
25112
|
-
};
|
|
25113
|
-
}
|
|
25114
|
-
function jsonOutputEnabled(environment = getEnvironmentVariables()) {
|
|
25115
|
-
return sniffForJson() || isTruthy(environment[environmentVariables.json]);
|
|
25116
|
-
}
|
|
25117
|
-
function blockPartnersAccess() {
|
|
25118
|
-
return isTruthy(getEnvironmentVariables()[environmentVariables.neverUsePartnersApi]);
|
|
25119
|
-
}
|
|
25120
|
-
function skipNetworkLevelRetry(environment = getEnvironmentVariables()) {
|
|
25121
|
-
return isTruthy(environment[environmentVariables.skipNetworkLevelRetry]);
|
|
25122
|
-
}
|
|
25123
|
-
function maxRequestTimeForNetworkCallsMs(environment = getEnvironmentVariables()) {
|
|
25124
|
-
let maxRequestTime = environment[environmentVariables.maxRequestTimeForNetworkCalls];
|
|
25125
|
-
return maxRequestTime && !isNaN(Number(maxRequestTime)) ? Number(maxRequestTime) : 15 * 1e3;
|
|
25126
|
-
}
|
|
25127
|
-
|
|
25128
25067
|
// ../../node_modules/.pnpm/is-interactive@2.0.0/node_modules/is-interactive/index.js
|
|
25129
25068
|
init_cjs_shims();
|
|
25130
25069
|
function isInteractive({ stream: stream2 = process.stdout } = {}) {
|
|
@@ -25146,9 +25085,6 @@ function isDevelopment(env3 = process.env) {
|
|
|
25146
25085
|
function isVerbose(env3 = process.env) {
|
|
25147
25086
|
return isTruthy(env3[environmentVariables.verbose]) || process.argv.includes("--verbose");
|
|
25148
25087
|
}
|
|
25149
|
-
function isAppManagementDisabled() {
|
|
25150
|
-
return !!getPartnersToken();
|
|
25151
|
-
}
|
|
25152
25088
|
async function isShopify(env3 = process.env) {
|
|
25153
25089
|
return Object.prototype.hasOwnProperty.call(env3, environmentVariables.runAsUser) ? !isTruthy(env3[environmentVariables.runAsUser]) : await fileExists(pathConstants.executables.dev) || isSpin(env3);
|
|
25154
25090
|
}
|
|
@@ -25230,6 +25166,35 @@ function opentelemetryDomain(env3 = process.env) {
|
|
|
25230
25166
|
|
|
25231
25167
|
// ../cli-kit/dist/public/node/is-global.js
|
|
25232
25168
|
init_cjs_shims();
|
|
25169
|
+
|
|
25170
|
+
// ../cli-kit/dist/public/node/version.js
|
|
25171
|
+
init_cjs_shims();
|
|
25172
|
+
var import_which2 = __toESM(require_lib2(), 1), import_semver = __toESM(require_semver(), 1);
|
|
25173
|
+
async function localCLIVersion(directory) {
|
|
25174
|
+
try {
|
|
25175
|
+
return (await captureOutput("npm", ["list", "@shopify/cli"], { cwd: directory })).match(/@shopify\/cli@([\w.-]*)/)?.[1];
|
|
25176
|
+
} catch {
|
|
25177
|
+
return;
|
|
25178
|
+
}
|
|
25179
|
+
}
|
|
25180
|
+
async function globalCLIVersion() {
|
|
25181
|
+
try {
|
|
25182
|
+
let env3 = { ...process.env, SHOPIFY_CLI_NO_ANALYTICS: "1" }, shopifyBinaries = import_which2.default.sync("shopify", { all: !0 }).filter((path8) => !path8.includes("node_modules"));
|
|
25183
|
+
if (!shopifyBinaries[0])
|
|
25184
|
+
return;
|
|
25185
|
+
let versionMatch = (await captureOutput(shopifyBinaries[0], [], { env: env3 })).match(/@shopify\/cli\/([^\s]+)/);
|
|
25186
|
+
if (versionMatch && versionMatch[1]) {
|
|
25187
|
+
let version = versionMatch[1];
|
|
25188
|
+
if ((0, import_semver.satisfies)(version, ">=3.59.0") || version.startsWith("0.0.0"))
|
|
25189
|
+
return version;
|
|
25190
|
+
}
|
|
25191
|
+
return;
|
|
25192
|
+
} catch {
|
|
25193
|
+
return;
|
|
25194
|
+
}
|
|
25195
|
+
}
|
|
25196
|
+
|
|
25197
|
+
// ../cli-kit/dist/public/node/is-global.js
|
|
25233
25198
|
var _isGlobal;
|
|
25234
25199
|
function currentProcessIsGlobal(argv = process.argv) {
|
|
25235
25200
|
try {
|
|
@@ -25241,20 +25206,12 @@ function currentProcessIsGlobal(argv = process.argv) {
|
|
|
25241
25206
|
return !1;
|
|
25242
25207
|
}
|
|
25243
25208
|
}
|
|
25244
|
-
async function isGlobalCLIInstalled() {
|
|
25245
|
-
try {
|
|
25246
|
-
let env3 = { ...process.env, SHOPIFY_CLI_NO_ANALYTICS: "1" };
|
|
25247
|
-
return (await captureOutput("shopify", ["app"], { env: env3 })).includes("app dev");
|
|
25248
|
-
} catch {
|
|
25249
|
-
return !1;
|
|
25250
|
-
}
|
|
25251
|
-
}
|
|
25252
25209
|
async function installGlobalShopifyCLI(packageManager) {
|
|
25253
25210
|
let args = packageManager === "yarn" ? ["global", "add", "@shopify/cli@latest"] : ["install", "-g", "@shopify/cli@latest"];
|
|
25254
25211
|
outputInfo(`Running ${packageManager} ${args.join(" ")}...`), await exec2(packageManager, args, { stdio: "inherit" });
|
|
25255
25212
|
}
|
|
25256
25213
|
async function installGlobalCLIPrompt() {
|
|
25257
|
-
return terminalSupportsPrompting() ? await
|
|
25214
|
+
return terminalSupportsPrompting() ? await globalCLIVersion() ? { install: !1, alreadyInstalled: !0 } : { install: await renderSelectPrompt({
|
|
25258
25215
|
message: "We recommend installing Shopify CLI globally in your system. Would you like to install it now?",
|
|
25259
25216
|
choices: [
|
|
25260
25217
|
{ value: "yes", label: "Yes" },
|
|
@@ -25419,7 +25376,7 @@ var ansiStyles = assembleStyles(), ansi_styles_default = ansiStyles;
|
|
|
25419
25376
|
// ../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js
|
|
25420
25377
|
init_cjs_shims();
|
|
25421
25378
|
import process8 from "node:process";
|
|
25422
|
-
import
|
|
25379
|
+
import os4 from "node:os";
|
|
25423
25380
|
import tty from "node:tty";
|
|
25424
25381
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process8.argv) {
|
|
25425
25382
|
let prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--", position = argv.indexOf(prefix + flag), terminatorPosition = argv.indexOf("--");
|
|
@@ -25459,7 +25416,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = !0 } = {}) {
|
|
|
25459
25416
|
if (env2.TERM === "dumb")
|
|
25460
25417
|
return min;
|
|
25461
25418
|
if (process8.platform === "win32") {
|
|
25462
|
-
let osRelease =
|
|
25419
|
+
let osRelease = os4.release().split(".");
|
|
25463
25420
|
return Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ? Number(osRelease[2]) >= 14931 ? 3 : 2 : 1;
|
|
25464
25421
|
}
|
|
25465
25422
|
if ("CI" in env2)
|
|
@@ -26835,7 +26792,7 @@ var Yoga = await initYoga(await E(_(import.meta.url).resolve("./yoga.wasm")));
|
|
|
26835
26792
|
|
|
26836
26793
|
// ../../node_modules/.pnpm/ink@4.4.1_@types+react@17.0.2_react@18.2.0/node_modules/ink/build/reconciler.js
|
|
26837
26794
|
init_cjs_shims();
|
|
26838
|
-
var import_react_reconciler = __toESM(require_react_reconciler(), 1),
|
|
26795
|
+
var import_react_reconciler = __toESM(require_react_reconciler(), 1), import_constants4 = __toESM(require_constants(), 1);
|
|
26839
26796
|
import process10 from "node:process";
|
|
26840
26797
|
|
|
26841
26798
|
// ../../node_modules/.pnpm/ink@4.4.1_@types+react@17.0.2_react@18.2.0/node_modules/ink/build/dom.js
|
|
@@ -27480,7 +27437,7 @@ var diff = (before, after) => {
|
|
|
27480
27437
|
scheduleTimeout: setTimeout,
|
|
27481
27438
|
cancelTimeout: clearTimeout,
|
|
27482
27439
|
noTimeout: -1,
|
|
27483
|
-
getCurrentEventPriority: () =>
|
|
27440
|
+
getCurrentEventPriority: () => import_constants4.DefaultEventPriority,
|
|
27484
27441
|
beforeActiveInstanceBlur() {
|
|
27485
27442
|
},
|
|
27486
27443
|
afterActiveInstanceBlur() {
|
|
@@ -29419,7 +29376,7 @@ function formatSection(title, body) {
|
|
|
29419
29376
|
}
|
|
29420
29377
|
|
|
29421
29378
|
// ../cli-kit/dist/public/node/error.js
|
|
29422
|
-
var import_core2 = __toESM(require_lib()), import_ts_error = __toESM(require_cjs()), FatalErrorType;
|
|
29379
|
+
var import_core2 = __toESM(require_lib(), 1), import_ts_error = __toESM(require_cjs(), 1), FatalErrorType;
|
|
29423
29380
|
(function(FatalErrorType2) {
|
|
29424
29381
|
FatalErrorType2[FatalErrorType2.Abort = 0] = "Abort", FatalErrorType2[FatalErrorType2.AbortSilent = 1] = "AbortSilent", FatalErrorType2[FatalErrorType2.Bug = 2] = "Bug";
|
|
29425
29382
|
})(FatalErrorType || (FatalErrorType = {}));
|
|
@@ -29547,7 +29504,7 @@ function createRuntimeMetadataContainer(defaultPublicMetadata = {}) {
|
|
|
29547
29504
|
try {
|
|
29548
29505
|
await getAndSet();
|
|
29549
29506
|
} catch (error) {
|
|
29550
|
-
let { sendErrorToBugsnag } = await import("./error-handler-
|
|
29507
|
+
let { sendErrorToBugsnag } = await import("./error-handler-7Z6N6VQJ.js");
|
|
29551
29508
|
await sendErrorToBugsnag(error, "unexpected_error");
|
|
29552
29509
|
}
|
|
29553
29510
|
}, durationStack = [];
|
|
@@ -30856,12 +30813,16 @@ function truncated(text, maxWidth) {
|
|
|
30856
30813
|
return maxWidth ? text.slice(0, maxWidth) : text;
|
|
30857
30814
|
}
|
|
30858
30815
|
var TextAnimation = (0, import_react50.memo)(({ text, maxWidth }) => {
|
|
30859
|
-
let frame = (0, import_react50.useRef)(0), [renderedFrame, setRenderedFrame] = (0, import_react50.useState)(text), timeout = (0, import_react50.useRef)(),
|
|
30816
|
+
let frame = (0, import_react50.useRef)(0), [renderedFrame, setRenderedFrame] = (0, import_react50.useState)(text), timeout = (0, import_react50.useRef)(), { stdout } = use_stdout_default(), [width, setWidth] = (0, import_react50.useState)(maxWidth ?? Math.floor(stdout.columns * 0.66));
|
|
30817
|
+
stdout.on("resize", () => {
|
|
30818
|
+
setWidth(Math.floor(stdout.columns * 0.66));
|
|
30819
|
+
});
|
|
30820
|
+
let renderAnimation = (0, import_react50.useCallback)(() => {
|
|
30860
30821
|
let newFrame = frame.current + 1;
|
|
30861
|
-
frame.current = newFrame, setRenderedFrame(rainbow(truncated(rotated(text, frame.current),
|
|
30822
|
+
frame.current = newFrame, setRenderedFrame(rainbow(truncated(rotated(text, frame.current), width), frame.current)), timeout.current = setTimeout(() => {
|
|
30862
30823
|
renderAnimation();
|
|
30863
30824
|
}, 35);
|
|
30864
|
-
}, [text,
|
|
30825
|
+
}, [text, width]);
|
|
30865
30826
|
return (0, import_react50.useLayoutEffect)(() => (renderAnimation(), () => {
|
|
30866
30827
|
clearTimeout(timeout.current);
|
|
30867
30828
|
}), [renderAnimation]), import_react50.default.createElement(Text, null, renderedFrame);
|
|
@@ -31070,7 +31031,7 @@ function AutocompletePrompt({ message, choices, infoTable, onSubmit, search, has
|
|
|
31070
31031
|
}
|
|
31071
31032
|
|
|
31072
31033
|
// ../cli-kit/dist/public/node/ui.js
|
|
31073
|
-
var import_react55 = __toESM(require_react()), defaultUIDebugOptions = {
|
|
31034
|
+
var import_react55 = __toESM(require_react(), 1), defaultUIDebugOptions = {
|
|
31074
31035
|
skipTTYCheck: !1
|
|
31075
31036
|
};
|
|
31076
31037
|
async function renderConcurrent({ renderOptions, ...props }) {
|
|
@@ -31254,6 +31215,7 @@ export {
|
|
|
31254
31215
|
treeKill,
|
|
31255
31216
|
render2 as render,
|
|
31256
31217
|
handleCtrlC,
|
|
31218
|
+
Alert,
|
|
31257
31219
|
require_stacktracey,
|
|
31258
31220
|
require_eq,
|
|
31259
31221
|
require_Stack,
|
|
@@ -31296,6 +31258,7 @@ export {
|
|
|
31296
31258
|
uniq,
|
|
31297
31259
|
uniqBy,
|
|
31298
31260
|
difference,
|
|
31261
|
+
asHumanFriendlyArray,
|
|
31299
31262
|
getRandomName,
|
|
31300
31263
|
capitalize,
|
|
31301
31264
|
pluralize,
|
|
@@ -31353,6 +31316,9 @@ export {
|
|
|
31353
31316
|
sleep,
|
|
31354
31317
|
terminalSupportsPrompting,
|
|
31355
31318
|
isCI,
|
|
31319
|
+
isWsl,
|
|
31320
|
+
localCLIVersion,
|
|
31321
|
+
globalCLIVersion,
|
|
31356
31322
|
currentProcessIsGlobal,
|
|
31357
31323
|
installGlobalShopifyCLI,
|
|
31358
31324
|
installGlobalCLIPrompt,
|
|
@@ -31409,12 +31375,12 @@ export {
|
|
|
31409
31375
|
fileExistsSync,
|
|
31410
31376
|
generateRandomNameForSubdirectory,
|
|
31411
31377
|
glob,
|
|
31412
|
-
detectEOL,
|
|
31413
31378
|
findPathUp,
|
|
31414
31379
|
matchGlob,
|
|
31415
31380
|
envPaths,
|
|
31416
31381
|
logsFolder,
|
|
31417
31382
|
environmentVariables,
|
|
31383
|
+
systemEnvironmentVariables,
|
|
31418
31384
|
sessionConstants,
|
|
31419
31385
|
bugsnagApiKey,
|
|
31420
31386
|
reportingRateLimit,
|
|
@@ -31428,23 +31394,10 @@ export {
|
|
|
31428
31394
|
appHost,
|
|
31429
31395
|
spinVariables,
|
|
31430
31396
|
fetchSpinPort,
|
|
31431
|
-
hashString,
|
|
31432
|
-
fileHash,
|
|
31433
|
-
randomUUID,
|
|
31434
|
-
nonRandomUUID,
|
|
31435
|
-
getEnvironmentVariables,
|
|
31436
|
-
getPartnersToken,
|
|
31437
|
-
getBackendPort,
|
|
31438
|
-
getIdentityTokenInformation,
|
|
31439
|
-
jsonOutputEnabled,
|
|
31440
|
-
blockPartnersAccess,
|
|
31441
|
-
skipNetworkLevelRetry,
|
|
31442
|
-
maxRequestTimeForNetworkCallsMs,
|
|
31443
31397
|
isTerminalInteractive,
|
|
31444
31398
|
homeDirectory,
|
|
31445
31399
|
isDevelopment,
|
|
31446
31400
|
isVerbose,
|
|
31447
|
-
isAppManagementDisabled,
|
|
31448
31401
|
isShopify,
|
|
31449
31402
|
isUnitTest,
|
|
31450
31403
|
analyticsDisabled,
|
|
@@ -31555,4 +31508,4 @@ react-reconciler/cjs/react-reconciler-constants.development.js:
|
|
|
31555
31508
|
* LICENSE file in the root directory of this source tree.
|
|
31556
31509
|
*)
|
|
31557
31510
|
*/
|
|
31558
|
-
//# sourceMappingURL=chunk-
|
|
31511
|
+
//# sourceMappingURL=chunk-F55GHOR3.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
packageManagerFromUserAgent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CZ7EMDNP.js";
|
|
4
4
|
import {
|
|
5
5
|
currentProcessIsGlobal,
|
|
6
6
|
inferPackageManagerForGlobalCLI,
|
|
7
7
|
outputContent,
|
|
8
8
|
outputToken
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F55GHOR3.js";
|
|
10
10
|
import {
|
|
11
11
|
init_cjs_shims
|
|
12
12
|
} from "./chunk-PKR7KJ6P.js";
|
|
@@ -25,4 +25,4 @@ export {
|
|
|
25
25
|
cliInstallCommand,
|
|
26
26
|
getOutputUpdateCLIReminder
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-G63ZK76J.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
base_command_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SHIHLMYP.js";
|
|
4
4
|
import {
|
|
5
5
|
mkdir,
|
|
6
6
|
outputInfo,
|
|
7
7
|
rmdir,
|
|
8
8
|
writeFile
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F55GHOR3.js";
|
|
10
10
|
import {
|
|
11
11
|
cwd,
|
|
12
12
|
joinPath
|
|
@@ -118,4 +118,4 @@ export {
|
|
|
118
118
|
writeCommandFlagInterface,
|
|
119
119
|
writeCommandUsageExampleFile
|
|
120
120
|
};
|
|
121
|
-
//# sourceMappingURL=chunk-
|
|
121
|
+
//# sourceMappingURL=chunk-HTK3YCUG.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
versionService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P6WUJAQG.js";
|
|
4
4
|
import {
|
|
5
5
|
base_command_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SHIHLMYP.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-IARZXI6R.js.map
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allAPIs,
|
|
3
|
+
blockPartnersAccess,
|
|
4
|
+
getIdentityTokenInformation,
|
|
5
|
+
getPartnersToken,
|
|
6
|
+
hashString,
|
|
7
|
+
nonRandomUUID,
|
|
3
8
|
shopifyFetch,
|
|
4
9
|
z
|
|
5
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7QKG75SI.js";
|
|
6
11
|
import {
|
|
7
12
|
getPackageManager,
|
|
8
13
|
getSession,
|
|
9
14
|
packageManagerFromUserAgent,
|
|
10
15
|
removeSession,
|
|
11
16
|
setSession
|
|
12
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CZ7EMDNP.js";
|
|
13
18
|
import {
|
|
14
19
|
AbortError,
|
|
15
20
|
BugError,
|
|
@@ -17,23 +22,18 @@ import {
|
|
|
17
22
|
FatalError,
|
|
18
23
|
addPublicMetadata,
|
|
19
24
|
addSensitiveMetadata,
|
|
20
|
-
blockPartnersAccess,
|
|
21
25
|
ciPlatform,
|
|
22
26
|
cloudEnvironment,
|
|
23
27
|
currentProcessIsGlobal,
|
|
24
28
|
firstPartyDev,
|
|
25
|
-
getIdentityTokenInformation,
|
|
26
|
-
getPartnersToken,
|
|
27
|
-
hashString,
|
|
28
29
|
import_ts_error,
|
|
29
|
-
isAppManagementDisabled,
|
|
30
30
|
isCI,
|
|
31
31
|
isCloudEnvironment,
|
|
32
32
|
isSpin,
|
|
33
33
|
isTTY,
|
|
34
|
+
isWsl,
|
|
34
35
|
keypress,
|
|
35
36
|
macAddress,
|
|
36
|
-
nonRandomUUID,
|
|
37
37
|
openURL,
|
|
38
38
|
outputCompleted,
|
|
39
39
|
outputContent,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
sessionConstants,
|
|
46
46
|
spinFqdn,
|
|
47
47
|
themeToken
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-F55GHOR3.js";
|
|
49
49
|
import {
|
|
50
50
|
cwd
|
|
51
51
|
} from "./chunk-57Q6OQG4.js";
|
|
@@ -220,6 +220,18 @@ function apiScopes(api, extraScopes = []) {
|
|
|
220
220
|
let scopes = [...defaultApiScopes(api), ...extraScopes.map(scopeTransform)].map(scopeTransform);
|
|
221
221
|
return Array.from(new Set(scopes));
|
|
222
222
|
}
|
|
223
|
+
function tokenExchangeScopes(api) {
|
|
224
|
+
switch (api) {
|
|
225
|
+
case "partners":
|
|
226
|
+
return [scopeTransform("cli")];
|
|
227
|
+
case "app-management":
|
|
228
|
+
return [scopeTransform("app-management")];
|
|
229
|
+
case "business-platform":
|
|
230
|
+
return [scopeTransform("destinations")];
|
|
231
|
+
default:
|
|
232
|
+
throw new BugError(`API not supported for token exchange: ${api}`);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
223
235
|
function defaultApiScopes(api) {
|
|
224
236
|
switch (api) {
|
|
225
237
|
case "admin":
|
|
@@ -776,7 +788,7 @@ async function exchangeAccessForApplicationTokens(identityToken, scopes, store2)
|
|
|
776
788
|
requestAppToken("storefront-renderer", token, scopes.storefront),
|
|
777
789
|
requestAppToken("business-platform", token, scopes.businessPlatform),
|
|
778
790
|
store2 ? requestAppToken("admin", token, scopes.admin, store2) : {},
|
|
779
|
-
|
|
791
|
+
requestAppToken("app-management", token, scopes.appManagement)
|
|
780
792
|
]);
|
|
781
793
|
return {
|
|
782
794
|
...partners,
|
|
@@ -795,15 +807,25 @@ async function refreshAccessToken(currentToken) {
|
|
|
795
807
|
}, value = (await tokenRequest(params)).mapError(tokenRequestErrorHandler).valueOrBug();
|
|
796
808
|
return buildIdentityToken(value, currentToken.userId);
|
|
797
809
|
}
|
|
798
|
-
async function
|
|
799
|
-
let appId = applicationId(
|
|
810
|
+
async function exchangeCliTokenForAccessToken(apiName, token, scopes) {
|
|
811
|
+
let appId = applicationId(apiName);
|
|
800
812
|
try {
|
|
801
|
-
let accessToken = (await requestAppToken(
|
|
813
|
+
let accessToken = (await requestAppToken(apiName, token, scopes))[appId].accessToken, userId2 = nonRandomUUID(token);
|
|
802
814
|
return setLastSeenUserIdAfterAuth(userId2), setLastSeenAuthMethod("partners_token"), { accessToken, userId: userId2 };
|
|
803
815
|
} catch {
|
|
804
|
-
|
|
816
|
+
let prettyName = apiName.replace(/-/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
|
|
817
|
+
throw new AbortError(`The custom token provided can't be used for the ${prettyName} API.`, "Ensure the token is correct and not expired.");
|
|
805
818
|
}
|
|
806
819
|
}
|
|
820
|
+
async function exchangeCustomPartnerToken(token) {
|
|
821
|
+
return exchangeCliTokenForAccessToken("partners", token, tokenExchangeScopes("partners"));
|
|
822
|
+
}
|
|
823
|
+
async function exchangeCliTokenForAppManagementAccessToken(token) {
|
|
824
|
+
return exchangeCliTokenForAccessToken("app-management", token, tokenExchangeScopes("app-management"));
|
|
825
|
+
}
|
|
826
|
+
async function exchangeCliTokenForBusinessPlatformAccessToken(token) {
|
|
827
|
+
return exchangeCliTokenForAccessToken("business-platform", token, tokenExchangeScopes("business-platform"));
|
|
828
|
+
}
|
|
807
829
|
async function exchangeDeviceCodeForAccessToken(deviceCode) {
|
|
808
830
|
let clientId2 = await clientId(), tokenResult = await tokenRequest({
|
|
809
831
|
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
@@ -1129,7 +1151,8 @@ async function getEnvironmentData(config) {
|
|
|
1129
1151
|
env_cloud: cloudEnvironment().platform,
|
|
1130
1152
|
env_package_manager: await getPackageManager(cwd()),
|
|
1131
1153
|
env_is_global: currentProcessIsGlobal(),
|
|
1132
|
-
env_auth_method: await getLastSeenAuthMethod()
|
|
1154
|
+
env_auth_method: await getLastSeenAuthMethod(),
|
|
1155
|
+
env_is_wsl: await isWsl()
|
|
1133
1156
|
};
|
|
1134
1157
|
}
|
|
1135
1158
|
async function getSensitiveEnvironmentData(config) {
|
|
@@ -1157,6 +1180,8 @@ export {
|
|
|
1157
1180
|
ok,
|
|
1158
1181
|
err,
|
|
1159
1182
|
exchangeCustomPartnerToken,
|
|
1183
|
+
exchangeCliTokenForAppManagementAccessToken,
|
|
1184
|
+
exchangeCliTokenForBusinessPlatformAccessToken,
|
|
1160
1185
|
remove,
|
|
1161
1186
|
isThemeAccessSession,
|
|
1162
1187
|
getLastSeenUserIdAfterAuth,
|
|
@@ -1167,4 +1192,4 @@ export {
|
|
|
1167
1192
|
getEnvironmentData,
|
|
1168
1193
|
getSensitiveEnvironmentData
|
|
1169
1194
|
};
|
|
1170
|
-
//# sourceMappingURL=chunk-
|
|
1195
|
+
//# sourceMappingURL=chunk-IYBFDT7N.js.map
|