@shopify/cli-kit 2.0.2 → 2.0.3
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 +9 -0
- package/dist/{index-0f69cf26.js → index-cee0245d.js} +1175 -64
- package/dist/index-cee0245d.js.map +1 -0
- package/dist/index.d.ts +111 -22
- package/dist/index.js +1 -1
- package/dist/{multipart-parser-95bacd77.js → multipart-parser-b4090c19.js} +2 -2
- package/dist/{multipart-parser-95bacd77.js.map → multipart-parser-b4090c19.js.map} +1 -1
- package/package.json +2 -1
- package/dist/index-0f69cf26.js.map +0 -1
|
@@ -142,7 +142,7 @@ Reflect.defineProperty(module.exports, 'windows', { enumerable: false, value: wi
|
|
|
142
142
|
Reflect.defineProperty(module.exports, 'other', { enumerable: false, value: other });
|
|
143
143
|
}(symbols$2));
|
|
144
144
|
|
|
145
|
-
const isObject$
|
|
145
|
+
const isObject$6 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
146
146
|
|
|
147
147
|
/* eslint-disable no-control-regex */
|
|
148
148
|
// this is a modified version of https://github.com/chalk/ansi-regex (MIT License)
|
|
@@ -290,7 +290,7 @@ const create$3 = () => {
|
|
|
290
290
|
};
|
|
291
291
|
|
|
292
292
|
colors.theme = custom => {
|
|
293
|
-
if (!isObject$
|
|
293
|
+
if (!isObject$6(custom)) throw new TypeError('Expected theme to be an object');
|
|
294
294
|
for (let name of Object.keys(custom)) {
|
|
295
295
|
colors.alias(name, custom[name]);
|
|
296
296
|
}
|
|
@@ -1884,7 +1884,7 @@ const colors$5 = ansiColors.exports;
|
|
|
1884
1884
|
const Prompt$5 = prompt$1;
|
|
1885
1885
|
const roles = roles_1;
|
|
1886
1886
|
const utils$t = utils$z;
|
|
1887
|
-
const { reorder, scrollUp, scrollDown, isObject: isObject$
|
|
1887
|
+
const { reorder, scrollUp, scrollDown, isObject: isObject$5, swap } = utils$t;
|
|
1888
1888
|
|
|
1889
1889
|
class ArrayPrompt$3 extends Prompt$5 {
|
|
1890
1890
|
constructor(options) {
|
|
@@ -1918,7 +1918,7 @@ class ArrayPrompt$3 extends Prompt$5 {
|
|
|
1918
1918
|
throw new Error('At least one choice must be selectable');
|
|
1919
1919
|
}
|
|
1920
1920
|
|
|
1921
|
-
if (isObject$
|
|
1921
|
+
if (isObject$5(initial)) initial = Object.keys(initial);
|
|
1922
1922
|
if (Array.isArray(initial)) {
|
|
1923
1923
|
if (autofocus != null) this.index = this.findIndex(autofocus);
|
|
1924
1924
|
initial.forEach(v => this.enable(this.find(v)));
|
|
@@ -2394,7 +2394,7 @@ class ArrayPrompt$3 extends Prompt$5 {
|
|
|
2394
2394
|
}
|
|
2395
2395
|
|
|
2396
2396
|
find(value, prop) {
|
|
2397
|
-
if (isObject$
|
|
2397
|
+
if (isObject$5(value)) return prop ? value[prop] : value;
|
|
2398
2398
|
let isChoice = (ele, i) => [ele.name, i].includes(value);
|
|
2399
2399
|
let fn = typeof value === 'function' ? value : isChoice;
|
|
2400
2400
|
let choice = this.choices.find(fn);
|
|
@@ -8240,7 +8240,7 @@ onetime$3.exports.callCount = function_ => {
|
|
|
8240
8240
|
|
|
8241
8241
|
var signalExit$1 = {exports: {}};
|
|
8242
8242
|
|
|
8243
|
-
var signals$
|
|
8243
|
+
var signals$2 = {exports: {}};
|
|
8244
8244
|
|
|
8245
8245
|
(function (module) {
|
|
8246
8246
|
// This is not the set of all possible signals.
|
|
@@ -8296,7 +8296,7 @@ if (process.platform === 'linux') {
|
|
|
8296
8296
|
'SIGUNUSED'
|
|
8297
8297
|
);
|
|
8298
8298
|
}
|
|
8299
|
-
}(signals$
|
|
8299
|
+
}(signals$2));
|
|
8300
8300
|
|
|
8301
8301
|
// Note: since nyc uses this module to output coverage, any lines
|
|
8302
8302
|
// that are in the direct sync flow of nyc's outputCoverage are
|
|
@@ -8324,7 +8324,7 @@ if (!processOk(process$1)) {
|
|
|
8324
8324
|
};
|
|
8325
8325
|
} else {
|
|
8326
8326
|
var assert$3 = require$$0$4;
|
|
8327
|
-
var signals = signals$
|
|
8327
|
+
var signals$1 = signals$2.exports;
|
|
8328
8328
|
var isWin$2 = /^win/i.test(process$1.platform);
|
|
8329
8329
|
|
|
8330
8330
|
var EE = require$$0$3;
|
|
@@ -8385,7 +8385,7 @@ if (!processOk(process$1)) {
|
|
|
8385
8385
|
}
|
|
8386
8386
|
loaded = false;
|
|
8387
8387
|
|
|
8388
|
-
signals.forEach(function (sig) {
|
|
8388
|
+
signals$1.forEach(function (sig) {
|
|
8389
8389
|
try {
|
|
8390
8390
|
process$1.removeListener(sig, sigListeners[sig]);
|
|
8391
8391
|
} catch (er) {}
|
|
@@ -8407,7 +8407,7 @@ if (!processOk(process$1)) {
|
|
|
8407
8407
|
|
|
8408
8408
|
// { <signal>: <listener fn>, ... }
|
|
8409
8409
|
var sigListeners = {};
|
|
8410
|
-
signals.forEach(function (sig) {
|
|
8410
|
+
signals$1.forEach(function (sig) {
|
|
8411
8411
|
sigListeners[sig] = function listener () {
|
|
8412
8412
|
/* istanbul ignore if */
|
|
8413
8413
|
if (!processOk(commonjsGlobal.process)) {
|
|
@@ -8436,7 +8436,7 @@ if (!processOk(process$1)) {
|
|
|
8436
8436
|
});
|
|
8437
8437
|
|
|
8438
8438
|
signalExit$1.exports.signals = function () {
|
|
8439
|
-
return signals
|
|
8439
|
+
return signals$1
|
|
8440
8440
|
};
|
|
8441
8441
|
|
|
8442
8442
|
var loaded = false;
|
|
@@ -8453,7 +8453,7 @@ if (!processOk(process$1)) {
|
|
|
8453
8453
|
// handle it instead of us.
|
|
8454
8454
|
emitter.count += 1;
|
|
8455
8455
|
|
|
8456
|
-
signals = signals.filter(function (sig) {
|
|
8456
|
+
signals$1 = signals$1.filter(function (sig) {
|
|
8457
8457
|
try {
|
|
8458
8458
|
process$1.on(sig, sigListeners[sig]);
|
|
8459
8459
|
return true
|
|
@@ -11833,7 +11833,7 @@ var toRegexRange_1 = toRegexRange$1;
|
|
|
11833
11833
|
const util$9 = require$$0$7;
|
|
11834
11834
|
const toRegexRange = toRegexRange_1;
|
|
11835
11835
|
|
|
11836
|
-
const isObject$
|
|
11836
|
+
const isObject$4 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
11837
11837
|
|
|
11838
11838
|
const transform$1 = toNumber => {
|
|
11839
11839
|
return value => toNumber === true ? Number(value) : String(value);
|
|
@@ -12049,7 +12049,7 @@ const fill$2 = (start, end, step, options = {}) => {
|
|
|
12049
12049
|
return fill$2(start, end, 1, { transform: step });
|
|
12050
12050
|
}
|
|
12051
12051
|
|
|
12052
|
-
if (isObject$
|
|
12052
|
+
if (isObject$4(step)) {
|
|
12053
12053
|
return fill$2(start, end, 0, step);
|
|
12054
12054
|
}
|
|
12055
12055
|
|
|
@@ -12058,7 +12058,7 @@ const fill$2 = (start, end, step, options = {}) => {
|
|
|
12058
12058
|
step = step || opts.step || 1;
|
|
12059
12059
|
|
|
12060
12060
|
if (!isNumber$3(step)) {
|
|
12061
|
-
if (step != null && !isObject$
|
|
12061
|
+
if (step != null && !isObject$4(step)) return invalidStep(step, opts);
|
|
12062
12062
|
return fill$2(start, end, 1, step);
|
|
12063
12063
|
}
|
|
12064
12064
|
|
|
@@ -14524,7 +14524,7 @@ const scan = scan_1;
|
|
|
14524
14524
|
const parse$d = parse_1$2;
|
|
14525
14525
|
const utils$g = utils$j;
|
|
14526
14526
|
const constants$4 = constants$6;
|
|
14527
|
-
const isObject$
|
|
14527
|
+
const isObject$3 = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
14528
14528
|
|
|
14529
14529
|
/**
|
|
14530
14530
|
* Creates a matcher function from one or more glob patterns. The
|
|
@@ -14561,7 +14561,7 @@ const picomatch$2 = (glob, options, returnState = false) => {
|
|
|
14561
14561
|
return arrayMatcher;
|
|
14562
14562
|
}
|
|
14563
14563
|
|
|
14564
|
-
const isState = isObject$
|
|
14564
|
+
const isState = isObject$3(glob) && glob.tokens && glob.input;
|
|
14565
14565
|
|
|
14566
14566
|
if (glob === '' || (typeof glob !== 'string' && !isState)) {
|
|
14567
14567
|
throw new TypeError('Expected pattern to be a non-empty string');
|
|
@@ -17656,7 +17656,7 @@ var path$w = /*#__PURE__*/Object.freeze({
|
|
|
17656
17656
|
});
|
|
17657
17657
|
|
|
17658
17658
|
var name = "@shopify/cli-kit";
|
|
17659
|
-
var version$4 = "2.0.
|
|
17659
|
+
var version$4 = "2.0.3";
|
|
17660
17660
|
var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
|
|
17661
17661
|
var keywords = [
|
|
17662
17662
|
"shopify",
|
|
@@ -17715,6 +17715,7 @@ var devDependencies = {
|
|
|
17715
17715
|
"@types/cross-zip": "^4.0.0",
|
|
17716
17716
|
"@types/js-yaml": "^4.0.5",
|
|
17717
17717
|
"@types/semver": "^7.3.9",
|
|
17718
|
+
"abort-controller": "^3.0.0",
|
|
17718
17719
|
"ansi-colors": "^4.1.1",
|
|
17719
17720
|
"change-case": "^4.1.2",
|
|
17720
17721
|
commondir: "^1.0.1",
|
|
@@ -17769,11 +17770,11 @@ var cliKitPackageJson = {
|
|
|
17769
17770
|
devDependencies: devDependencies
|
|
17770
17771
|
};
|
|
17771
17772
|
|
|
17772
|
-
var version$3 = "2.0.
|
|
17773
|
+
var version$3 = "2.0.3";
|
|
17773
17774
|
|
|
17774
|
-
var version$2 = "2.0.
|
|
17775
|
+
var version$2 = "2.0.3";
|
|
17775
17776
|
|
|
17776
|
-
var version$1 = "2.0.
|
|
17777
|
+
var version$1 = "2.0.3";
|
|
17777
17778
|
|
|
17778
17779
|
const homedir$1 = os$8.homedir();
|
|
17779
17780
|
const tmpdir$1 = os$8.tmpdir();
|
|
@@ -24970,6 +24971,979 @@ terminalLink.isSupported = supportsHyperlinks.stdout;
|
|
|
24970
24971
|
terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, {target: 'stderr', ...options});
|
|
24971
24972
|
terminalLink.stderr.isSupported = supportsHyperlinks.stderr;
|
|
24972
24973
|
|
|
24974
|
+
/**
|
|
24975
|
+
* @author Toru Nagashima <https://github.com/mysticatea>
|
|
24976
|
+
* @copyright 2015 Toru Nagashima. All rights reserved.
|
|
24977
|
+
* See LICENSE file in root directory for full license.
|
|
24978
|
+
*/
|
|
24979
|
+
/**
|
|
24980
|
+
* @typedef {object} PrivateData
|
|
24981
|
+
* @property {EventTarget} eventTarget The event target.
|
|
24982
|
+
* @property {{type:string}} event The original event object.
|
|
24983
|
+
* @property {number} eventPhase The current event phase.
|
|
24984
|
+
* @property {EventTarget|null} currentTarget The current event target.
|
|
24985
|
+
* @property {boolean} canceled The flag to prevent default.
|
|
24986
|
+
* @property {boolean} stopped The flag to stop propagation.
|
|
24987
|
+
* @property {boolean} immediateStopped The flag to stop propagation immediately.
|
|
24988
|
+
* @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.
|
|
24989
|
+
* @property {number} timeStamp The unix time.
|
|
24990
|
+
* @private
|
|
24991
|
+
*/
|
|
24992
|
+
|
|
24993
|
+
/**
|
|
24994
|
+
* Private data for event wrappers.
|
|
24995
|
+
* @type {WeakMap<Event, PrivateData>}
|
|
24996
|
+
* @private
|
|
24997
|
+
*/
|
|
24998
|
+
const privateData = new WeakMap();
|
|
24999
|
+
|
|
25000
|
+
/**
|
|
25001
|
+
* Cache for wrapper classes.
|
|
25002
|
+
* @type {WeakMap<Object, Function>}
|
|
25003
|
+
* @private
|
|
25004
|
+
*/
|
|
25005
|
+
const wrappers = new WeakMap();
|
|
25006
|
+
|
|
25007
|
+
/**
|
|
25008
|
+
* Get private data.
|
|
25009
|
+
* @param {Event} event The event object to get private data.
|
|
25010
|
+
* @returns {PrivateData} The private data of the event.
|
|
25011
|
+
* @private
|
|
25012
|
+
*/
|
|
25013
|
+
function pd(event) {
|
|
25014
|
+
const retv = privateData.get(event);
|
|
25015
|
+
console.assert(
|
|
25016
|
+
retv != null,
|
|
25017
|
+
"'this' is expected an Event object, but got",
|
|
25018
|
+
event
|
|
25019
|
+
);
|
|
25020
|
+
return retv
|
|
25021
|
+
}
|
|
25022
|
+
|
|
25023
|
+
/**
|
|
25024
|
+
* https://dom.spec.whatwg.org/#set-the-canceled-flag
|
|
25025
|
+
* @param data {PrivateData} private data.
|
|
25026
|
+
*/
|
|
25027
|
+
function setCancelFlag(data) {
|
|
25028
|
+
if (data.passiveListener != null) {
|
|
25029
|
+
if (
|
|
25030
|
+
typeof console !== "undefined" &&
|
|
25031
|
+
typeof console.error === "function"
|
|
25032
|
+
) {
|
|
25033
|
+
console.error(
|
|
25034
|
+
"Unable to preventDefault inside passive event listener invocation.",
|
|
25035
|
+
data.passiveListener
|
|
25036
|
+
);
|
|
25037
|
+
}
|
|
25038
|
+
return
|
|
25039
|
+
}
|
|
25040
|
+
if (!data.event.cancelable) {
|
|
25041
|
+
return
|
|
25042
|
+
}
|
|
25043
|
+
|
|
25044
|
+
data.canceled = true;
|
|
25045
|
+
if (typeof data.event.preventDefault === "function") {
|
|
25046
|
+
data.event.preventDefault();
|
|
25047
|
+
}
|
|
25048
|
+
}
|
|
25049
|
+
|
|
25050
|
+
/**
|
|
25051
|
+
* @see https://dom.spec.whatwg.org/#interface-event
|
|
25052
|
+
* @private
|
|
25053
|
+
*/
|
|
25054
|
+
/**
|
|
25055
|
+
* The event wrapper.
|
|
25056
|
+
* @constructor
|
|
25057
|
+
* @param {EventTarget} eventTarget The event target of this dispatching.
|
|
25058
|
+
* @param {Event|{type:string}} event The original event to wrap.
|
|
25059
|
+
*/
|
|
25060
|
+
function Event(eventTarget, event) {
|
|
25061
|
+
privateData.set(this, {
|
|
25062
|
+
eventTarget,
|
|
25063
|
+
event,
|
|
25064
|
+
eventPhase: 2,
|
|
25065
|
+
currentTarget: eventTarget,
|
|
25066
|
+
canceled: false,
|
|
25067
|
+
stopped: false,
|
|
25068
|
+
immediateStopped: false,
|
|
25069
|
+
passiveListener: null,
|
|
25070
|
+
timeStamp: event.timeStamp || Date.now(),
|
|
25071
|
+
});
|
|
25072
|
+
|
|
25073
|
+
// https://heycam.github.io/webidl/#Unforgeable
|
|
25074
|
+
Object.defineProperty(this, "isTrusted", { value: false, enumerable: true });
|
|
25075
|
+
|
|
25076
|
+
// Define accessors
|
|
25077
|
+
const keys = Object.keys(event);
|
|
25078
|
+
for (let i = 0; i < keys.length; ++i) {
|
|
25079
|
+
const key = keys[i];
|
|
25080
|
+
if (!(key in this)) {
|
|
25081
|
+
Object.defineProperty(this, key, defineRedirectDescriptor(key));
|
|
25082
|
+
}
|
|
25083
|
+
}
|
|
25084
|
+
}
|
|
25085
|
+
|
|
25086
|
+
// Should be enumerable, but class methods are not enumerable.
|
|
25087
|
+
Event.prototype = {
|
|
25088
|
+
/**
|
|
25089
|
+
* The type of this event.
|
|
25090
|
+
* @type {string}
|
|
25091
|
+
*/
|
|
25092
|
+
get type() {
|
|
25093
|
+
return pd(this).event.type
|
|
25094
|
+
},
|
|
25095
|
+
|
|
25096
|
+
/**
|
|
25097
|
+
* The target of this event.
|
|
25098
|
+
* @type {EventTarget}
|
|
25099
|
+
*/
|
|
25100
|
+
get target() {
|
|
25101
|
+
return pd(this).eventTarget
|
|
25102
|
+
},
|
|
25103
|
+
|
|
25104
|
+
/**
|
|
25105
|
+
* The target of this event.
|
|
25106
|
+
* @type {EventTarget}
|
|
25107
|
+
*/
|
|
25108
|
+
get currentTarget() {
|
|
25109
|
+
return pd(this).currentTarget
|
|
25110
|
+
},
|
|
25111
|
+
|
|
25112
|
+
/**
|
|
25113
|
+
* @returns {EventTarget[]} The composed path of this event.
|
|
25114
|
+
*/
|
|
25115
|
+
composedPath() {
|
|
25116
|
+
const currentTarget = pd(this).currentTarget;
|
|
25117
|
+
if (currentTarget == null) {
|
|
25118
|
+
return []
|
|
25119
|
+
}
|
|
25120
|
+
return [currentTarget]
|
|
25121
|
+
},
|
|
25122
|
+
|
|
25123
|
+
/**
|
|
25124
|
+
* Constant of NONE.
|
|
25125
|
+
* @type {number}
|
|
25126
|
+
*/
|
|
25127
|
+
get NONE() {
|
|
25128
|
+
return 0
|
|
25129
|
+
},
|
|
25130
|
+
|
|
25131
|
+
/**
|
|
25132
|
+
* Constant of CAPTURING_PHASE.
|
|
25133
|
+
* @type {number}
|
|
25134
|
+
*/
|
|
25135
|
+
get CAPTURING_PHASE() {
|
|
25136
|
+
return 1
|
|
25137
|
+
},
|
|
25138
|
+
|
|
25139
|
+
/**
|
|
25140
|
+
* Constant of AT_TARGET.
|
|
25141
|
+
* @type {number}
|
|
25142
|
+
*/
|
|
25143
|
+
get AT_TARGET() {
|
|
25144
|
+
return 2
|
|
25145
|
+
},
|
|
25146
|
+
|
|
25147
|
+
/**
|
|
25148
|
+
* Constant of BUBBLING_PHASE.
|
|
25149
|
+
* @type {number}
|
|
25150
|
+
*/
|
|
25151
|
+
get BUBBLING_PHASE() {
|
|
25152
|
+
return 3
|
|
25153
|
+
},
|
|
25154
|
+
|
|
25155
|
+
/**
|
|
25156
|
+
* The target of this event.
|
|
25157
|
+
* @type {number}
|
|
25158
|
+
*/
|
|
25159
|
+
get eventPhase() {
|
|
25160
|
+
return pd(this).eventPhase
|
|
25161
|
+
},
|
|
25162
|
+
|
|
25163
|
+
/**
|
|
25164
|
+
* Stop event bubbling.
|
|
25165
|
+
* @returns {void}
|
|
25166
|
+
*/
|
|
25167
|
+
stopPropagation() {
|
|
25168
|
+
const data = pd(this);
|
|
25169
|
+
|
|
25170
|
+
data.stopped = true;
|
|
25171
|
+
if (typeof data.event.stopPropagation === "function") {
|
|
25172
|
+
data.event.stopPropagation();
|
|
25173
|
+
}
|
|
25174
|
+
},
|
|
25175
|
+
|
|
25176
|
+
/**
|
|
25177
|
+
* Stop event bubbling.
|
|
25178
|
+
* @returns {void}
|
|
25179
|
+
*/
|
|
25180
|
+
stopImmediatePropagation() {
|
|
25181
|
+
const data = pd(this);
|
|
25182
|
+
|
|
25183
|
+
data.stopped = true;
|
|
25184
|
+
data.immediateStopped = true;
|
|
25185
|
+
if (typeof data.event.stopImmediatePropagation === "function") {
|
|
25186
|
+
data.event.stopImmediatePropagation();
|
|
25187
|
+
}
|
|
25188
|
+
},
|
|
25189
|
+
|
|
25190
|
+
/**
|
|
25191
|
+
* The flag to be bubbling.
|
|
25192
|
+
* @type {boolean}
|
|
25193
|
+
*/
|
|
25194
|
+
get bubbles() {
|
|
25195
|
+
return Boolean(pd(this).event.bubbles)
|
|
25196
|
+
},
|
|
25197
|
+
|
|
25198
|
+
/**
|
|
25199
|
+
* The flag to be cancelable.
|
|
25200
|
+
* @type {boolean}
|
|
25201
|
+
*/
|
|
25202
|
+
get cancelable() {
|
|
25203
|
+
return Boolean(pd(this).event.cancelable)
|
|
25204
|
+
},
|
|
25205
|
+
|
|
25206
|
+
/**
|
|
25207
|
+
* Cancel this event.
|
|
25208
|
+
* @returns {void}
|
|
25209
|
+
*/
|
|
25210
|
+
preventDefault() {
|
|
25211
|
+
setCancelFlag(pd(this));
|
|
25212
|
+
},
|
|
25213
|
+
|
|
25214
|
+
/**
|
|
25215
|
+
* The flag to indicate cancellation state.
|
|
25216
|
+
* @type {boolean}
|
|
25217
|
+
*/
|
|
25218
|
+
get defaultPrevented() {
|
|
25219
|
+
return pd(this).canceled
|
|
25220
|
+
},
|
|
25221
|
+
|
|
25222
|
+
/**
|
|
25223
|
+
* The flag to be composed.
|
|
25224
|
+
* @type {boolean}
|
|
25225
|
+
*/
|
|
25226
|
+
get composed() {
|
|
25227
|
+
return Boolean(pd(this).event.composed)
|
|
25228
|
+
},
|
|
25229
|
+
|
|
25230
|
+
/**
|
|
25231
|
+
* The unix time of this event.
|
|
25232
|
+
* @type {number}
|
|
25233
|
+
*/
|
|
25234
|
+
get timeStamp() {
|
|
25235
|
+
return pd(this).timeStamp
|
|
25236
|
+
},
|
|
25237
|
+
|
|
25238
|
+
/**
|
|
25239
|
+
* The target of this event.
|
|
25240
|
+
* @type {EventTarget}
|
|
25241
|
+
* @deprecated
|
|
25242
|
+
*/
|
|
25243
|
+
get srcElement() {
|
|
25244
|
+
return pd(this).eventTarget
|
|
25245
|
+
},
|
|
25246
|
+
|
|
25247
|
+
/**
|
|
25248
|
+
* The flag to stop event bubbling.
|
|
25249
|
+
* @type {boolean}
|
|
25250
|
+
* @deprecated
|
|
25251
|
+
*/
|
|
25252
|
+
get cancelBubble() {
|
|
25253
|
+
return pd(this).stopped
|
|
25254
|
+
},
|
|
25255
|
+
set cancelBubble(value) {
|
|
25256
|
+
if (!value) {
|
|
25257
|
+
return
|
|
25258
|
+
}
|
|
25259
|
+
const data = pd(this);
|
|
25260
|
+
|
|
25261
|
+
data.stopped = true;
|
|
25262
|
+
if (typeof data.event.cancelBubble === "boolean") {
|
|
25263
|
+
data.event.cancelBubble = true;
|
|
25264
|
+
}
|
|
25265
|
+
},
|
|
25266
|
+
|
|
25267
|
+
/**
|
|
25268
|
+
* The flag to indicate cancellation state.
|
|
25269
|
+
* @type {boolean}
|
|
25270
|
+
* @deprecated
|
|
25271
|
+
*/
|
|
25272
|
+
get returnValue() {
|
|
25273
|
+
return !pd(this).canceled
|
|
25274
|
+
},
|
|
25275
|
+
set returnValue(value) {
|
|
25276
|
+
if (!value) {
|
|
25277
|
+
setCancelFlag(pd(this));
|
|
25278
|
+
}
|
|
25279
|
+
},
|
|
25280
|
+
|
|
25281
|
+
/**
|
|
25282
|
+
* Initialize this event object. But do nothing under event dispatching.
|
|
25283
|
+
* @param {string} type The event type.
|
|
25284
|
+
* @param {boolean} [bubbles=false] The flag to be possible to bubble up.
|
|
25285
|
+
* @param {boolean} [cancelable=false] The flag to be possible to cancel.
|
|
25286
|
+
* @deprecated
|
|
25287
|
+
*/
|
|
25288
|
+
initEvent() {
|
|
25289
|
+
// Do nothing.
|
|
25290
|
+
},
|
|
25291
|
+
};
|
|
25292
|
+
|
|
25293
|
+
// `constructor` is not enumerable.
|
|
25294
|
+
Object.defineProperty(Event.prototype, "constructor", {
|
|
25295
|
+
value: Event,
|
|
25296
|
+
configurable: true,
|
|
25297
|
+
writable: true,
|
|
25298
|
+
});
|
|
25299
|
+
|
|
25300
|
+
// Ensure `event instanceof window.Event` is `true`.
|
|
25301
|
+
if (typeof window !== "undefined" && typeof window.Event !== "undefined") {
|
|
25302
|
+
Object.setPrototypeOf(Event.prototype, window.Event.prototype);
|
|
25303
|
+
|
|
25304
|
+
// Make association for wrappers.
|
|
25305
|
+
wrappers.set(window.Event.prototype, Event);
|
|
25306
|
+
}
|
|
25307
|
+
|
|
25308
|
+
/**
|
|
25309
|
+
* Get the property descriptor to redirect a given property.
|
|
25310
|
+
* @param {string} key Property name to define property descriptor.
|
|
25311
|
+
* @returns {PropertyDescriptor} The property descriptor to redirect the property.
|
|
25312
|
+
* @private
|
|
25313
|
+
*/
|
|
25314
|
+
function defineRedirectDescriptor(key) {
|
|
25315
|
+
return {
|
|
25316
|
+
get() {
|
|
25317
|
+
return pd(this).event[key]
|
|
25318
|
+
},
|
|
25319
|
+
set(value) {
|
|
25320
|
+
pd(this).event[key] = value;
|
|
25321
|
+
},
|
|
25322
|
+
configurable: true,
|
|
25323
|
+
enumerable: true,
|
|
25324
|
+
}
|
|
25325
|
+
}
|
|
25326
|
+
|
|
25327
|
+
/**
|
|
25328
|
+
* Get the property descriptor to call a given method property.
|
|
25329
|
+
* @param {string} key Property name to define property descriptor.
|
|
25330
|
+
* @returns {PropertyDescriptor} The property descriptor to call the method property.
|
|
25331
|
+
* @private
|
|
25332
|
+
*/
|
|
25333
|
+
function defineCallDescriptor(key) {
|
|
25334
|
+
return {
|
|
25335
|
+
value() {
|
|
25336
|
+
const event = pd(this).event;
|
|
25337
|
+
return event[key].apply(event, arguments)
|
|
25338
|
+
},
|
|
25339
|
+
configurable: true,
|
|
25340
|
+
enumerable: true,
|
|
25341
|
+
}
|
|
25342
|
+
}
|
|
25343
|
+
|
|
25344
|
+
/**
|
|
25345
|
+
* Define new wrapper class.
|
|
25346
|
+
* @param {Function} BaseEvent The base wrapper class.
|
|
25347
|
+
* @param {Object} proto The prototype of the original event.
|
|
25348
|
+
* @returns {Function} The defined wrapper class.
|
|
25349
|
+
* @private
|
|
25350
|
+
*/
|
|
25351
|
+
function defineWrapper(BaseEvent, proto) {
|
|
25352
|
+
const keys = Object.keys(proto);
|
|
25353
|
+
if (keys.length === 0) {
|
|
25354
|
+
return BaseEvent
|
|
25355
|
+
}
|
|
25356
|
+
|
|
25357
|
+
/** CustomEvent */
|
|
25358
|
+
function CustomEvent(eventTarget, event) {
|
|
25359
|
+
BaseEvent.call(this, eventTarget, event);
|
|
25360
|
+
}
|
|
25361
|
+
|
|
25362
|
+
CustomEvent.prototype = Object.create(BaseEvent.prototype, {
|
|
25363
|
+
constructor: { value: CustomEvent, configurable: true, writable: true },
|
|
25364
|
+
});
|
|
25365
|
+
|
|
25366
|
+
// Define accessors.
|
|
25367
|
+
for (let i = 0; i < keys.length; ++i) {
|
|
25368
|
+
const key = keys[i];
|
|
25369
|
+
if (!(key in BaseEvent.prototype)) {
|
|
25370
|
+
const descriptor = Object.getOwnPropertyDescriptor(proto, key);
|
|
25371
|
+
const isFunc = typeof descriptor.value === "function";
|
|
25372
|
+
Object.defineProperty(
|
|
25373
|
+
CustomEvent.prototype,
|
|
25374
|
+
key,
|
|
25375
|
+
isFunc
|
|
25376
|
+
? defineCallDescriptor(key)
|
|
25377
|
+
: defineRedirectDescriptor(key)
|
|
25378
|
+
);
|
|
25379
|
+
}
|
|
25380
|
+
}
|
|
25381
|
+
|
|
25382
|
+
return CustomEvent
|
|
25383
|
+
}
|
|
25384
|
+
|
|
25385
|
+
/**
|
|
25386
|
+
* Get the wrapper class of a given prototype.
|
|
25387
|
+
* @param {Object} proto The prototype of the original event to get its wrapper.
|
|
25388
|
+
* @returns {Function} The wrapper class.
|
|
25389
|
+
* @private
|
|
25390
|
+
*/
|
|
25391
|
+
function getWrapper(proto) {
|
|
25392
|
+
if (proto == null || proto === Object.prototype) {
|
|
25393
|
+
return Event
|
|
25394
|
+
}
|
|
25395
|
+
|
|
25396
|
+
let wrapper = wrappers.get(proto);
|
|
25397
|
+
if (wrapper == null) {
|
|
25398
|
+
wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto);
|
|
25399
|
+
wrappers.set(proto, wrapper);
|
|
25400
|
+
}
|
|
25401
|
+
return wrapper
|
|
25402
|
+
}
|
|
25403
|
+
|
|
25404
|
+
/**
|
|
25405
|
+
* Wrap a given event to management a dispatching.
|
|
25406
|
+
* @param {EventTarget} eventTarget The event target of this dispatching.
|
|
25407
|
+
* @param {Object} event The event to wrap.
|
|
25408
|
+
* @returns {Event} The wrapper instance.
|
|
25409
|
+
* @private
|
|
25410
|
+
*/
|
|
25411
|
+
function wrapEvent(eventTarget, event) {
|
|
25412
|
+
const Wrapper = getWrapper(Object.getPrototypeOf(event));
|
|
25413
|
+
return new Wrapper(eventTarget, event)
|
|
25414
|
+
}
|
|
25415
|
+
|
|
25416
|
+
/**
|
|
25417
|
+
* Get the immediateStopped flag of a given event.
|
|
25418
|
+
* @param {Event} event The event to get.
|
|
25419
|
+
* @returns {boolean} The flag to stop propagation immediately.
|
|
25420
|
+
* @private
|
|
25421
|
+
*/
|
|
25422
|
+
function isStopped(event) {
|
|
25423
|
+
return pd(event).immediateStopped
|
|
25424
|
+
}
|
|
25425
|
+
|
|
25426
|
+
/**
|
|
25427
|
+
* Set the current event phase of a given event.
|
|
25428
|
+
* @param {Event} event The event to set current target.
|
|
25429
|
+
* @param {number} eventPhase New event phase.
|
|
25430
|
+
* @returns {void}
|
|
25431
|
+
* @private
|
|
25432
|
+
*/
|
|
25433
|
+
function setEventPhase(event, eventPhase) {
|
|
25434
|
+
pd(event).eventPhase = eventPhase;
|
|
25435
|
+
}
|
|
25436
|
+
|
|
25437
|
+
/**
|
|
25438
|
+
* Set the current target of a given event.
|
|
25439
|
+
* @param {Event} event The event to set current target.
|
|
25440
|
+
* @param {EventTarget|null} currentTarget New current target.
|
|
25441
|
+
* @returns {void}
|
|
25442
|
+
* @private
|
|
25443
|
+
*/
|
|
25444
|
+
function setCurrentTarget(event, currentTarget) {
|
|
25445
|
+
pd(event).currentTarget = currentTarget;
|
|
25446
|
+
}
|
|
25447
|
+
|
|
25448
|
+
/**
|
|
25449
|
+
* Set a passive listener of a given event.
|
|
25450
|
+
* @param {Event} event The event to set current target.
|
|
25451
|
+
* @param {Function|null} passiveListener New passive listener.
|
|
25452
|
+
* @returns {void}
|
|
25453
|
+
* @private
|
|
25454
|
+
*/
|
|
25455
|
+
function setPassiveListener(event, passiveListener) {
|
|
25456
|
+
pd(event).passiveListener = passiveListener;
|
|
25457
|
+
}
|
|
25458
|
+
|
|
25459
|
+
/**
|
|
25460
|
+
* @typedef {object} ListenerNode
|
|
25461
|
+
* @property {Function} listener
|
|
25462
|
+
* @property {1|2|3} listenerType
|
|
25463
|
+
* @property {boolean} passive
|
|
25464
|
+
* @property {boolean} once
|
|
25465
|
+
* @property {ListenerNode|null} next
|
|
25466
|
+
* @private
|
|
25467
|
+
*/
|
|
25468
|
+
|
|
25469
|
+
/**
|
|
25470
|
+
* @type {WeakMap<object, Map<string, ListenerNode>>}
|
|
25471
|
+
* @private
|
|
25472
|
+
*/
|
|
25473
|
+
const listenersMap = new WeakMap();
|
|
25474
|
+
|
|
25475
|
+
// Listener types
|
|
25476
|
+
const CAPTURE = 1;
|
|
25477
|
+
const BUBBLE = 2;
|
|
25478
|
+
const ATTRIBUTE = 3;
|
|
25479
|
+
|
|
25480
|
+
/**
|
|
25481
|
+
* Check whether a given value is an object or not.
|
|
25482
|
+
* @param {any} x The value to check.
|
|
25483
|
+
* @returns {boolean} `true` if the value is an object.
|
|
25484
|
+
*/
|
|
25485
|
+
function isObject$2(x) {
|
|
25486
|
+
return x !== null && typeof x === "object" //eslint-disable-line no-restricted-syntax
|
|
25487
|
+
}
|
|
25488
|
+
|
|
25489
|
+
/**
|
|
25490
|
+
* Get listeners.
|
|
25491
|
+
* @param {EventTarget} eventTarget The event target to get.
|
|
25492
|
+
* @returns {Map<string, ListenerNode>} The listeners.
|
|
25493
|
+
* @private
|
|
25494
|
+
*/
|
|
25495
|
+
function getListeners(eventTarget) {
|
|
25496
|
+
const listeners = listenersMap.get(eventTarget);
|
|
25497
|
+
if (listeners == null) {
|
|
25498
|
+
throw new TypeError(
|
|
25499
|
+
"'this' is expected an EventTarget object, but got another value."
|
|
25500
|
+
)
|
|
25501
|
+
}
|
|
25502
|
+
return listeners
|
|
25503
|
+
}
|
|
25504
|
+
|
|
25505
|
+
/**
|
|
25506
|
+
* Get the property descriptor for the event attribute of a given event.
|
|
25507
|
+
* @param {string} eventName The event name to get property descriptor.
|
|
25508
|
+
* @returns {PropertyDescriptor} The property descriptor.
|
|
25509
|
+
* @private
|
|
25510
|
+
*/
|
|
25511
|
+
function defineEventAttributeDescriptor(eventName) {
|
|
25512
|
+
return {
|
|
25513
|
+
get() {
|
|
25514
|
+
const listeners = getListeners(this);
|
|
25515
|
+
let node = listeners.get(eventName);
|
|
25516
|
+
while (node != null) {
|
|
25517
|
+
if (node.listenerType === ATTRIBUTE) {
|
|
25518
|
+
return node.listener
|
|
25519
|
+
}
|
|
25520
|
+
node = node.next;
|
|
25521
|
+
}
|
|
25522
|
+
return null
|
|
25523
|
+
},
|
|
25524
|
+
|
|
25525
|
+
set(listener) {
|
|
25526
|
+
if (typeof listener !== "function" && !isObject$2(listener)) {
|
|
25527
|
+
listener = null; // eslint-disable-line no-param-reassign
|
|
25528
|
+
}
|
|
25529
|
+
const listeners = getListeners(this);
|
|
25530
|
+
|
|
25531
|
+
// Traverse to the tail while removing old value.
|
|
25532
|
+
let prev = null;
|
|
25533
|
+
let node = listeners.get(eventName);
|
|
25534
|
+
while (node != null) {
|
|
25535
|
+
if (node.listenerType === ATTRIBUTE) {
|
|
25536
|
+
// Remove old value.
|
|
25537
|
+
if (prev !== null) {
|
|
25538
|
+
prev.next = node.next;
|
|
25539
|
+
} else if (node.next !== null) {
|
|
25540
|
+
listeners.set(eventName, node.next);
|
|
25541
|
+
} else {
|
|
25542
|
+
listeners.delete(eventName);
|
|
25543
|
+
}
|
|
25544
|
+
} else {
|
|
25545
|
+
prev = node;
|
|
25546
|
+
}
|
|
25547
|
+
|
|
25548
|
+
node = node.next;
|
|
25549
|
+
}
|
|
25550
|
+
|
|
25551
|
+
// Add new value.
|
|
25552
|
+
if (listener !== null) {
|
|
25553
|
+
const newNode = {
|
|
25554
|
+
listener,
|
|
25555
|
+
listenerType: ATTRIBUTE,
|
|
25556
|
+
passive: false,
|
|
25557
|
+
once: false,
|
|
25558
|
+
next: null,
|
|
25559
|
+
};
|
|
25560
|
+
if (prev === null) {
|
|
25561
|
+
listeners.set(eventName, newNode);
|
|
25562
|
+
} else {
|
|
25563
|
+
prev.next = newNode;
|
|
25564
|
+
}
|
|
25565
|
+
}
|
|
25566
|
+
},
|
|
25567
|
+
configurable: true,
|
|
25568
|
+
enumerable: true,
|
|
25569
|
+
}
|
|
25570
|
+
}
|
|
25571
|
+
|
|
25572
|
+
/**
|
|
25573
|
+
* Define an event attribute (e.g. `eventTarget.onclick`).
|
|
25574
|
+
* @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.
|
|
25575
|
+
* @param {string} eventName The event name to define.
|
|
25576
|
+
* @returns {void}
|
|
25577
|
+
*/
|
|
25578
|
+
function defineEventAttribute(eventTargetPrototype, eventName) {
|
|
25579
|
+
Object.defineProperty(
|
|
25580
|
+
eventTargetPrototype,
|
|
25581
|
+
`on${eventName}`,
|
|
25582
|
+
defineEventAttributeDescriptor(eventName)
|
|
25583
|
+
);
|
|
25584
|
+
}
|
|
25585
|
+
|
|
25586
|
+
/**
|
|
25587
|
+
* Define a custom EventTarget with event attributes.
|
|
25588
|
+
* @param {string[]} eventNames Event names for event attributes.
|
|
25589
|
+
* @returns {EventTarget} The custom EventTarget.
|
|
25590
|
+
* @private
|
|
25591
|
+
*/
|
|
25592
|
+
function defineCustomEventTarget(eventNames) {
|
|
25593
|
+
/** CustomEventTarget */
|
|
25594
|
+
function CustomEventTarget() {
|
|
25595
|
+
EventTarget.call(this);
|
|
25596
|
+
}
|
|
25597
|
+
|
|
25598
|
+
CustomEventTarget.prototype = Object.create(EventTarget.prototype, {
|
|
25599
|
+
constructor: {
|
|
25600
|
+
value: CustomEventTarget,
|
|
25601
|
+
configurable: true,
|
|
25602
|
+
writable: true,
|
|
25603
|
+
},
|
|
25604
|
+
});
|
|
25605
|
+
|
|
25606
|
+
for (let i = 0; i < eventNames.length; ++i) {
|
|
25607
|
+
defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);
|
|
25608
|
+
}
|
|
25609
|
+
|
|
25610
|
+
return CustomEventTarget
|
|
25611
|
+
}
|
|
25612
|
+
|
|
25613
|
+
/**
|
|
25614
|
+
* EventTarget.
|
|
25615
|
+
*
|
|
25616
|
+
* - This is constructor if no arguments.
|
|
25617
|
+
* - This is a function which returns a CustomEventTarget constructor if there are arguments.
|
|
25618
|
+
*
|
|
25619
|
+
* For example:
|
|
25620
|
+
*
|
|
25621
|
+
* class A extends EventTarget {}
|
|
25622
|
+
* class B extends EventTarget("message") {}
|
|
25623
|
+
* class C extends EventTarget("message", "error") {}
|
|
25624
|
+
* class D extends EventTarget(["message", "error"]) {}
|
|
25625
|
+
*/
|
|
25626
|
+
function EventTarget() {
|
|
25627
|
+
/*eslint-disable consistent-return */
|
|
25628
|
+
if (this instanceof EventTarget) {
|
|
25629
|
+
listenersMap.set(this, new Map());
|
|
25630
|
+
return
|
|
25631
|
+
}
|
|
25632
|
+
if (arguments.length === 1 && Array.isArray(arguments[0])) {
|
|
25633
|
+
return defineCustomEventTarget(arguments[0])
|
|
25634
|
+
}
|
|
25635
|
+
if (arguments.length > 0) {
|
|
25636
|
+
const types = new Array(arguments.length);
|
|
25637
|
+
for (let i = 0; i < arguments.length; ++i) {
|
|
25638
|
+
types[i] = arguments[i];
|
|
25639
|
+
}
|
|
25640
|
+
return defineCustomEventTarget(types)
|
|
25641
|
+
}
|
|
25642
|
+
throw new TypeError("Cannot call a class as a function")
|
|
25643
|
+
/*eslint-enable consistent-return */
|
|
25644
|
+
}
|
|
25645
|
+
|
|
25646
|
+
// Should be enumerable, but class methods are not enumerable.
|
|
25647
|
+
EventTarget.prototype = {
|
|
25648
|
+
/**
|
|
25649
|
+
* Add a given listener to this event target.
|
|
25650
|
+
* @param {string} eventName The event name to add.
|
|
25651
|
+
* @param {Function} listener The listener to add.
|
|
25652
|
+
* @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
|
|
25653
|
+
* @returns {void}
|
|
25654
|
+
*/
|
|
25655
|
+
addEventListener(eventName, listener, options) {
|
|
25656
|
+
if (listener == null) {
|
|
25657
|
+
return
|
|
25658
|
+
}
|
|
25659
|
+
if (typeof listener !== "function" && !isObject$2(listener)) {
|
|
25660
|
+
throw new TypeError("'listener' should be a function or an object.")
|
|
25661
|
+
}
|
|
25662
|
+
|
|
25663
|
+
const listeners = getListeners(this);
|
|
25664
|
+
const optionsIsObj = isObject$2(options);
|
|
25665
|
+
const capture = optionsIsObj
|
|
25666
|
+
? Boolean(options.capture)
|
|
25667
|
+
: Boolean(options);
|
|
25668
|
+
const listenerType = capture ? CAPTURE : BUBBLE;
|
|
25669
|
+
const newNode = {
|
|
25670
|
+
listener,
|
|
25671
|
+
listenerType,
|
|
25672
|
+
passive: optionsIsObj && Boolean(options.passive),
|
|
25673
|
+
once: optionsIsObj && Boolean(options.once),
|
|
25674
|
+
next: null,
|
|
25675
|
+
};
|
|
25676
|
+
|
|
25677
|
+
// Set it as the first node if the first node is null.
|
|
25678
|
+
let node = listeners.get(eventName);
|
|
25679
|
+
if (node === undefined) {
|
|
25680
|
+
listeners.set(eventName, newNode);
|
|
25681
|
+
return
|
|
25682
|
+
}
|
|
25683
|
+
|
|
25684
|
+
// Traverse to the tail while checking duplication..
|
|
25685
|
+
let prev = null;
|
|
25686
|
+
while (node != null) {
|
|
25687
|
+
if (
|
|
25688
|
+
node.listener === listener &&
|
|
25689
|
+
node.listenerType === listenerType
|
|
25690
|
+
) {
|
|
25691
|
+
// Should ignore duplication.
|
|
25692
|
+
return
|
|
25693
|
+
}
|
|
25694
|
+
prev = node;
|
|
25695
|
+
node = node.next;
|
|
25696
|
+
}
|
|
25697
|
+
|
|
25698
|
+
// Add it.
|
|
25699
|
+
prev.next = newNode;
|
|
25700
|
+
},
|
|
25701
|
+
|
|
25702
|
+
/**
|
|
25703
|
+
* Remove a given listener from this event target.
|
|
25704
|
+
* @param {string} eventName The event name to remove.
|
|
25705
|
+
* @param {Function} listener The listener to remove.
|
|
25706
|
+
* @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
|
|
25707
|
+
* @returns {void}
|
|
25708
|
+
*/
|
|
25709
|
+
removeEventListener(eventName, listener, options) {
|
|
25710
|
+
if (listener == null) {
|
|
25711
|
+
return
|
|
25712
|
+
}
|
|
25713
|
+
|
|
25714
|
+
const listeners = getListeners(this);
|
|
25715
|
+
const capture = isObject$2(options)
|
|
25716
|
+
? Boolean(options.capture)
|
|
25717
|
+
: Boolean(options);
|
|
25718
|
+
const listenerType = capture ? CAPTURE : BUBBLE;
|
|
25719
|
+
|
|
25720
|
+
let prev = null;
|
|
25721
|
+
let node = listeners.get(eventName);
|
|
25722
|
+
while (node != null) {
|
|
25723
|
+
if (
|
|
25724
|
+
node.listener === listener &&
|
|
25725
|
+
node.listenerType === listenerType
|
|
25726
|
+
) {
|
|
25727
|
+
if (prev !== null) {
|
|
25728
|
+
prev.next = node.next;
|
|
25729
|
+
} else if (node.next !== null) {
|
|
25730
|
+
listeners.set(eventName, node.next);
|
|
25731
|
+
} else {
|
|
25732
|
+
listeners.delete(eventName);
|
|
25733
|
+
}
|
|
25734
|
+
return
|
|
25735
|
+
}
|
|
25736
|
+
|
|
25737
|
+
prev = node;
|
|
25738
|
+
node = node.next;
|
|
25739
|
+
}
|
|
25740
|
+
},
|
|
25741
|
+
|
|
25742
|
+
/**
|
|
25743
|
+
* Dispatch a given event.
|
|
25744
|
+
* @param {Event|{type:string}} event The event to dispatch.
|
|
25745
|
+
* @returns {boolean} `false` if canceled.
|
|
25746
|
+
*/
|
|
25747
|
+
dispatchEvent(event) {
|
|
25748
|
+
if (event == null || typeof event.type !== "string") {
|
|
25749
|
+
throw new TypeError('"event.type" should be a string.')
|
|
25750
|
+
}
|
|
25751
|
+
|
|
25752
|
+
// If listeners aren't registered, terminate.
|
|
25753
|
+
const listeners = getListeners(this);
|
|
25754
|
+
const eventName = event.type;
|
|
25755
|
+
let node = listeners.get(eventName);
|
|
25756
|
+
if (node == null) {
|
|
25757
|
+
return true
|
|
25758
|
+
}
|
|
25759
|
+
|
|
25760
|
+
// Since we cannot rewrite several properties, so wrap object.
|
|
25761
|
+
const wrappedEvent = wrapEvent(this, event);
|
|
25762
|
+
|
|
25763
|
+
// This doesn't process capturing phase and bubbling phase.
|
|
25764
|
+
// This isn't participating in a tree.
|
|
25765
|
+
let prev = null;
|
|
25766
|
+
while (node != null) {
|
|
25767
|
+
// Remove this listener if it's once
|
|
25768
|
+
if (node.once) {
|
|
25769
|
+
if (prev !== null) {
|
|
25770
|
+
prev.next = node.next;
|
|
25771
|
+
} else if (node.next !== null) {
|
|
25772
|
+
listeners.set(eventName, node.next);
|
|
25773
|
+
} else {
|
|
25774
|
+
listeners.delete(eventName);
|
|
25775
|
+
}
|
|
25776
|
+
} else {
|
|
25777
|
+
prev = node;
|
|
25778
|
+
}
|
|
25779
|
+
|
|
25780
|
+
// Call this listener
|
|
25781
|
+
setPassiveListener(
|
|
25782
|
+
wrappedEvent,
|
|
25783
|
+
node.passive ? node.listener : null
|
|
25784
|
+
);
|
|
25785
|
+
if (typeof node.listener === "function") {
|
|
25786
|
+
try {
|
|
25787
|
+
node.listener.call(this, wrappedEvent);
|
|
25788
|
+
} catch (err) {
|
|
25789
|
+
if (
|
|
25790
|
+
typeof console !== "undefined" &&
|
|
25791
|
+
typeof console.error === "function"
|
|
25792
|
+
) {
|
|
25793
|
+
console.error(err);
|
|
25794
|
+
}
|
|
25795
|
+
}
|
|
25796
|
+
} else if (
|
|
25797
|
+
node.listenerType !== ATTRIBUTE &&
|
|
25798
|
+
typeof node.listener.handleEvent === "function"
|
|
25799
|
+
) {
|
|
25800
|
+
node.listener.handleEvent(wrappedEvent);
|
|
25801
|
+
}
|
|
25802
|
+
|
|
25803
|
+
// Break if `event.stopImmediatePropagation` was called.
|
|
25804
|
+
if (isStopped(wrappedEvent)) {
|
|
25805
|
+
break
|
|
25806
|
+
}
|
|
25807
|
+
|
|
25808
|
+
node = node.next;
|
|
25809
|
+
}
|
|
25810
|
+
setPassiveListener(wrappedEvent, null);
|
|
25811
|
+
setEventPhase(wrappedEvent, 0);
|
|
25812
|
+
setCurrentTarget(wrappedEvent, null);
|
|
25813
|
+
|
|
25814
|
+
return !wrappedEvent.defaultPrevented
|
|
25815
|
+
},
|
|
25816
|
+
};
|
|
25817
|
+
|
|
25818
|
+
// `constructor` is not enumerable.
|
|
25819
|
+
Object.defineProperty(EventTarget.prototype, "constructor", {
|
|
25820
|
+
value: EventTarget,
|
|
25821
|
+
configurable: true,
|
|
25822
|
+
writable: true,
|
|
25823
|
+
});
|
|
25824
|
+
|
|
25825
|
+
// Ensure `eventTarget instanceof window.EventTarget` is `true`.
|
|
25826
|
+
if (
|
|
25827
|
+
typeof window !== "undefined" &&
|
|
25828
|
+
typeof window.EventTarget !== "undefined"
|
|
25829
|
+
) {
|
|
25830
|
+
Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);
|
|
25831
|
+
}
|
|
25832
|
+
|
|
25833
|
+
/**
|
|
25834
|
+
* @author Toru Nagashima <https://github.com/mysticatea>
|
|
25835
|
+
* See LICENSE file in root directory for full license.
|
|
25836
|
+
*/
|
|
25837
|
+
|
|
25838
|
+
/**
|
|
25839
|
+
* The signal class.
|
|
25840
|
+
* @see https://dom.spec.whatwg.org/#abortsignal
|
|
25841
|
+
*/
|
|
25842
|
+
class AbortSignal extends EventTarget {
|
|
25843
|
+
/**
|
|
25844
|
+
* AbortSignal cannot be constructed directly.
|
|
25845
|
+
*/
|
|
25846
|
+
constructor() {
|
|
25847
|
+
super();
|
|
25848
|
+
throw new TypeError("AbortSignal cannot be constructed directly");
|
|
25849
|
+
}
|
|
25850
|
+
/**
|
|
25851
|
+
* Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.
|
|
25852
|
+
*/
|
|
25853
|
+
get aborted() {
|
|
25854
|
+
const aborted = abortedFlags.get(this);
|
|
25855
|
+
if (typeof aborted !== "boolean") {
|
|
25856
|
+
throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`);
|
|
25857
|
+
}
|
|
25858
|
+
return aborted;
|
|
25859
|
+
}
|
|
25860
|
+
}
|
|
25861
|
+
defineEventAttribute(AbortSignal.prototype, "abort");
|
|
25862
|
+
/**
|
|
25863
|
+
* Create an AbortSignal object.
|
|
25864
|
+
*/
|
|
25865
|
+
function createAbortSignal() {
|
|
25866
|
+
const signal = Object.create(AbortSignal.prototype);
|
|
25867
|
+
EventTarget.call(signal);
|
|
25868
|
+
abortedFlags.set(signal, false);
|
|
25869
|
+
return signal;
|
|
25870
|
+
}
|
|
25871
|
+
/**
|
|
25872
|
+
* Abort a given signal.
|
|
25873
|
+
*/
|
|
25874
|
+
function abortSignal(signal) {
|
|
25875
|
+
if (abortedFlags.get(signal) !== false) {
|
|
25876
|
+
return;
|
|
25877
|
+
}
|
|
25878
|
+
abortedFlags.set(signal, true);
|
|
25879
|
+
signal.dispatchEvent({ type: "abort" });
|
|
25880
|
+
}
|
|
25881
|
+
/**
|
|
25882
|
+
* Aborted flag for each instances.
|
|
25883
|
+
*/
|
|
25884
|
+
const abortedFlags = new WeakMap();
|
|
25885
|
+
// Properties should be enumerable.
|
|
25886
|
+
Object.defineProperties(AbortSignal.prototype, {
|
|
25887
|
+
aborted: { enumerable: true },
|
|
25888
|
+
});
|
|
25889
|
+
// `toString()` should return `"[object AbortSignal]"`
|
|
25890
|
+
if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
|
|
25891
|
+
Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {
|
|
25892
|
+
configurable: true,
|
|
25893
|
+
value: "AbortSignal",
|
|
25894
|
+
});
|
|
25895
|
+
}
|
|
25896
|
+
|
|
25897
|
+
/**
|
|
25898
|
+
* The AbortController.
|
|
25899
|
+
* @see https://dom.spec.whatwg.org/#abortcontroller
|
|
25900
|
+
*/
|
|
25901
|
+
class AbortController$1 {
|
|
25902
|
+
/**
|
|
25903
|
+
* Initialize this controller.
|
|
25904
|
+
*/
|
|
25905
|
+
constructor() {
|
|
25906
|
+
signals.set(this, createAbortSignal());
|
|
25907
|
+
}
|
|
25908
|
+
/**
|
|
25909
|
+
* Returns the `AbortSignal` object associated with this object.
|
|
25910
|
+
*/
|
|
25911
|
+
get signal() {
|
|
25912
|
+
return getSignal(this);
|
|
25913
|
+
}
|
|
25914
|
+
/**
|
|
25915
|
+
* Abort and signal to any observers that the associated activity is to be aborted.
|
|
25916
|
+
*/
|
|
25917
|
+
abort() {
|
|
25918
|
+
abortSignal(getSignal(this));
|
|
25919
|
+
}
|
|
25920
|
+
}
|
|
25921
|
+
/**
|
|
25922
|
+
* Associated signals.
|
|
25923
|
+
*/
|
|
25924
|
+
const signals = new WeakMap();
|
|
25925
|
+
/**
|
|
25926
|
+
* Get the associated signal of a given controller.
|
|
25927
|
+
*/
|
|
25928
|
+
function getSignal(controller) {
|
|
25929
|
+
const signal = signals.get(controller);
|
|
25930
|
+
if (signal == null) {
|
|
25931
|
+
throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`);
|
|
25932
|
+
}
|
|
25933
|
+
return signal;
|
|
25934
|
+
}
|
|
25935
|
+
// Properties should be enumerable.
|
|
25936
|
+
Object.defineProperties(AbortController$1.prototype, {
|
|
25937
|
+
signal: { enumerable: true },
|
|
25938
|
+
abort: { enumerable: true },
|
|
25939
|
+
});
|
|
25940
|
+
if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
|
|
25941
|
+
Object.defineProperty(AbortController$1.prototype, Symbol.toStringTag, {
|
|
25942
|
+
configurable: true,
|
|
25943
|
+
value: "AbortController",
|
|
25944
|
+
});
|
|
25945
|
+
}
|
|
25946
|
+
|
|
24973
25947
|
class ContentToken {
|
|
24974
25948
|
constructor(value, metadata = {}, type) {
|
|
24975
25949
|
this.type = type;
|
|
@@ -25086,7 +26060,7 @@ const success = (content2) => {
|
|
|
25086
26060
|
}
|
|
25087
26061
|
};
|
|
25088
26062
|
const debug$5 = (content2) => {
|
|
25089
|
-
message(content2, "debug");
|
|
26063
|
+
message(colors$9.gray(stringifyMessage(content2)), "debug");
|
|
25090
26064
|
};
|
|
25091
26065
|
const warn = (content2) => {
|
|
25092
26066
|
consoleWarn(colors$9.yellow(stringifyMessage(content2)));
|
|
@@ -25153,7 +26127,7 @@ const message = (content2, level = "info") => {
|
|
|
25153
26127
|
}
|
|
25154
26128
|
};
|
|
25155
26129
|
async function concurrent(processes) {
|
|
25156
|
-
const abortController = new AbortController();
|
|
26130
|
+
const abortController = new AbortController$1();
|
|
25157
26131
|
const concurrentColors = [token.yellow, token.cyan, token.magenta, token.green];
|
|
25158
26132
|
const prefixColumnSize = Math.max(...processes.map((process2) => process2.prefix.length));
|
|
25159
26133
|
function linePrefix(prefix, index) {
|
|
@@ -25249,7 +26223,7 @@ class AbortSilent extends Fatal {
|
|
|
25249
26223
|
class Bug extends Fatal {
|
|
25250
26224
|
}
|
|
25251
26225
|
async function handler(error) {
|
|
25252
|
-
const fatal = error instanceof Fatal ? error : new
|
|
26226
|
+
const fatal = error instanceof Fatal ? error : new Abort(error.message);
|
|
25253
26227
|
await error$k(fatal);
|
|
25254
26228
|
return Promise.resolve(error);
|
|
25255
26229
|
}
|
|
@@ -39550,7 +40524,7 @@ class Body$1 {
|
|
|
39550
40524
|
return formData;
|
|
39551
40525
|
}
|
|
39552
40526
|
|
|
39553
|
-
const {toFormData} = await import('./multipart-parser-
|
|
40527
|
+
const {toFormData} = await import('./multipart-parser-b4090c19.js');
|
|
39554
40528
|
return toFormData(this.body, ct);
|
|
39555
40529
|
}
|
|
39556
40530
|
|
|
@@ -53478,33 +54452,136 @@ var github = /*#__PURE__*/Object.freeze({
|
|
|
53478
54452
|
parseRepoUrl: parseRepoUrl
|
|
53479
54453
|
});
|
|
53480
54454
|
|
|
53481
|
-
|
|
53482
|
-
|
|
53483
|
-
|
|
53484
|
-
|
|
53485
|
-
return DependencyManager2;
|
|
53486
|
-
})(DependencyManager || {});
|
|
53487
|
-
const dependencyManager = Object.entries(DependencyManager).map(([_, value]) => `${value}`);
|
|
54455
|
+
const dependencyManager = ["yarn", "npm", "pnpm"];
|
|
54456
|
+
const PackageJsonNotFoundError = (directory) => {
|
|
54457
|
+
return new Bug(`The directory ${directory} doesn't have a package.json.`);
|
|
54458
|
+
};
|
|
53488
54459
|
function dependencyManagerUsedForCreating(env = process.env) {
|
|
53489
54460
|
if (env.npm_config_user_agent?.includes("yarn")) {
|
|
53490
|
-
return "yarn"
|
|
54461
|
+
return "yarn";
|
|
53491
54462
|
} else if (env.npm_config_user_agent?.includes("pnpm")) {
|
|
53492
|
-
return "pnpm"
|
|
54463
|
+
return "pnpm";
|
|
53493
54464
|
} else {
|
|
53494
|
-
return "npm"
|
|
54465
|
+
return "npm";
|
|
54466
|
+
}
|
|
54467
|
+
}
|
|
54468
|
+
async function installNPMDependenciesRecursively(options) {
|
|
54469
|
+
const packageJsons = await out(join$3(options.directory, "**/package.json"), {
|
|
54470
|
+
ignore: [join$3(options.directory, "node_modules/**/package.json")],
|
|
54471
|
+
cwd: options.directory,
|
|
54472
|
+
onlyFiles: true,
|
|
54473
|
+
deep: options.deep
|
|
54474
|
+
});
|
|
54475
|
+
const abortController = new AbortController$1();
|
|
54476
|
+
try {
|
|
54477
|
+
await Promise.all(packageJsons.map(async (packageJsonPath) => {
|
|
54478
|
+
const directory = dirname$1(packageJsonPath);
|
|
54479
|
+
await install(directory, options.dependencyManager, void 0, void 0, abortController.signal);
|
|
54480
|
+
}));
|
|
54481
|
+
} catch (error) {
|
|
54482
|
+
abortController.abort();
|
|
54483
|
+
throw error;
|
|
53495
54484
|
}
|
|
53496
54485
|
}
|
|
53497
|
-
async function install(directory, dependencyManager2, stdout, stderr) {
|
|
53498
|
-
const options = { cwd: directory, stdout, stderr };
|
|
54486
|
+
async function install(directory, dependencyManager2, stdout, stderr, signal) {
|
|
54487
|
+
const options = { cwd: directory, stdout, stderr, signal };
|
|
53499
54488
|
await exec(dependencyManager2, ["install"], options);
|
|
53500
54489
|
}
|
|
54490
|
+
async function getDependencies(packageJsonPath) {
|
|
54491
|
+
if (!await exists$1(packageJsonPath)) {
|
|
54492
|
+
throw PackageJsonNotFoundError(dirname$1(packageJsonPath));
|
|
54493
|
+
}
|
|
54494
|
+
const packageJsonContent = JSON.parse(await read(packageJsonPath));
|
|
54495
|
+
const dependencies = packageJsonContent.dependencies ?? {};
|
|
54496
|
+
const devDependencies = packageJsonContent.devDependencies ?? {};
|
|
54497
|
+
return [...Object.keys(dependencies), ...Object.keys(devDependencies)];
|
|
54498
|
+
}
|
|
54499
|
+
async function addNPMDependenciesIfNeeded(dependencies, options) {
|
|
54500
|
+
const packageJsonPath = join$3(options.directory, "package.json");
|
|
54501
|
+
if (!await exists$1(packageJsonPath)) {
|
|
54502
|
+
throw PackageJsonNotFoundError(options.directory);
|
|
54503
|
+
}
|
|
54504
|
+
const existingDependencies = await getDependencies(packageJsonPath);
|
|
54505
|
+
const dependenciesToAdd = dependencies.filter((dep) => {
|
|
54506
|
+
return !existingDependencies.includes(dep);
|
|
54507
|
+
});
|
|
54508
|
+
let args;
|
|
54509
|
+
switch (options.dependencyManager) {
|
|
54510
|
+
case "npm":
|
|
54511
|
+
args = argumentsToAddDependenciesWithNPM(dependenciesToAdd, options.type);
|
|
54512
|
+
break;
|
|
54513
|
+
case "yarn":
|
|
54514
|
+
args = argumentsToAddDependenciesWithYarn(dependenciesToAdd, options.type);
|
|
54515
|
+
break;
|
|
54516
|
+
case "pnpm":
|
|
54517
|
+
args = argumentsToAddDependenciesWithPNPM(dependenciesToAdd, options.type);
|
|
54518
|
+
break;
|
|
54519
|
+
}
|
|
54520
|
+
exec(options.dependencyManager, args, {
|
|
54521
|
+
cwd: options.directory,
|
|
54522
|
+
stdout: options.stdout,
|
|
54523
|
+
stderr: options.stderr,
|
|
54524
|
+
signal: options.signal
|
|
54525
|
+
});
|
|
54526
|
+
}
|
|
54527
|
+
function argumentsToAddDependenciesWithNPM(dependencies, type) {
|
|
54528
|
+
let command = ["install"];
|
|
54529
|
+
command = command.concat(dependencies);
|
|
54530
|
+
switch (type) {
|
|
54531
|
+
case "dev":
|
|
54532
|
+
command.push("--save-dev");
|
|
54533
|
+
break;
|
|
54534
|
+
case "peer":
|
|
54535
|
+
command.push("--save-peer");
|
|
54536
|
+
break;
|
|
54537
|
+
case "prod":
|
|
54538
|
+
command.push("--save-prod");
|
|
54539
|
+
break;
|
|
54540
|
+
}
|
|
54541
|
+
return command;
|
|
54542
|
+
}
|
|
54543
|
+
function argumentsToAddDependenciesWithYarn(dependencies, type) {
|
|
54544
|
+
let command = ["add"];
|
|
54545
|
+
command = command.concat(dependencies);
|
|
54546
|
+
switch (type) {
|
|
54547
|
+
case "dev":
|
|
54548
|
+
command.push("--dev");
|
|
54549
|
+
break;
|
|
54550
|
+
case "peer":
|
|
54551
|
+
command.push("--peer");
|
|
54552
|
+
break;
|
|
54553
|
+
case "prod":
|
|
54554
|
+
command.push("--prod");
|
|
54555
|
+
break;
|
|
54556
|
+
}
|
|
54557
|
+
return command;
|
|
54558
|
+
}
|
|
54559
|
+
function argumentsToAddDependenciesWithPNPM(dependencies, type) {
|
|
54560
|
+
let command = ["add"];
|
|
54561
|
+
command = command.concat(dependencies);
|
|
54562
|
+
switch (type) {
|
|
54563
|
+
case "dev":
|
|
54564
|
+
command.push("--save-dev");
|
|
54565
|
+
break;
|
|
54566
|
+
case "peer":
|
|
54567
|
+
command.push("--save-peer");
|
|
54568
|
+
break;
|
|
54569
|
+
case "prod":
|
|
54570
|
+
command.push("--save-prod");
|
|
54571
|
+
break;
|
|
54572
|
+
}
|
|
54573
|
+
return command;
|
|
54574
|
+
}
|
|
53501
54575
|
|
|
53502
54576
|
var dependency = /*#__PURE__*/Object.freeze({
|
|
53503
54577
|
__proto__: null,
|
|
53504
|
-
DependencyManager: DependencyManager,
|
|
53505
54578
|
dependencyManager: dependencyManager,
|
|
54579
|
+
PackageJsonNotFoundError: PackageJsonNotFoundError,
|
|
53506
54580
|
dependencyManagerUsedForCreating: dependencyManagerUsedForCreating,
|
|
53507
|
-
|
|
54581
|
+
installNPMDependenciesRecursively: installNPMDependenciesRecursively,
|
|
54582
|
+
install: install,
|
|
54583
|
+
getDependencies: getDependencies,
|
|
54584
|
+
addNPMDependenciesIfNeeded: addNPMDependenciesIfNeeded
|
|
53508
54585
|
});
|
|
53509
54586
|
|
|
53510
54587
|
var packageJson$2 = {exports: {}};
|
|
@@ -170627,6 +171704,13 @@ function HeadersInstanceToPlainObject(headers) {
|
|
|
170627
171704
|
}(dist$1));
|
|
170628
171705
|
|
|
170629
171706
|
async function request$1(query, session, variables) {
|
|
171707
|
+
debug$5(`
|
|
171708
|
+
Sending Admin GraphQL request:
|
|
171709
|
+
${query}
|
|
171710
|
+
|
|
171711
|
+
With variables:
|
|
171712
|
+
${variables ? JSON.stringify(variables, null, 2) : ""}
|
|
171713
|
+
`);
|
|
170630
171714
|
const version = await fetchApiVersion(session);
|
|
170631
171715
|
const url = adminUrl(session.storeFqdn, version);
|
|
170632
171716
|
const headers = await buildHeaders(session.token);
|
|
@@ -170636,6 +171720,10 @@ async function fetchApiVersion(session) {
|
|
|
170636
171720
|
const url = adminUrl(session.storeFqdn, "unstable");
|
|
170637
171721
|
const query = apiVersionQuery();
|
|
170638
171722
|
const headers = await buildHeaders(session.token);
|
|
171723
|
+
debug$5(`
|
|
171724
|
+
Sending Admin GraphQL request to URL ${url} with query:
|
|
171725
|
+
${query}
|
|
171726
|
+
`);
|
|
170639
171727
|
const data = await dist$1.request(url, query, {}, headers);
|
|
170640
171728
|
return data.publicApiVersions.filter((item) => item.supported).map((item) => item.handle).sort().reverse()[0];
|
|
170641
171729
|
}
|
|
@@ -170663,6 +171751,13 @@ async function request(query, token, variables) {
|
|
|
170663
171751
|
const fqdn = await partners$1();
|
|
170664
171752
|
const url = `https://${fqdn}/api/cli/graphql`;
|
|
170665
171753
|
const headers = await buildHeaders(token);
|
|
171754
|
+
debug$5(`
|
|
171755
|
+
Sending Partners GraphQL request:
|
|
171756
|
+
${query}
|
|
171757
|
+
|
|
171758
|
+
With variables:
|
|
171759
|
+
${variables ? JSON.stringify(variables, null, 2) : ""}
|
|
171760
|
+
`);
|
|
170666
171761
|
return dist$1.request(url, query, variables, headers);
|
|
170667
171762
|
}
|
|
170668
171763
|
|
|
@@ -170678,16 +171773,6 @@ const FindOrganizationQuery = dist$1.gql`
|
|
|
170678
171773
|
id
|
|
170679
171774
|
businessName
|
|
170680
171775
|
website
|
|
170681
|
-
stores(first: 100) {
|
|
170682
|
-
nodes {
|
|
170683
|
-
shopId
|
|
170684
|
-
link
|
|
170685
|
-
shopDomain
|
|
170686
|
-
shopName
|
|
170687
|
-
transferDisabled
|
|
170688
|
-
convertableToPartnerTest
|
|
170689
|
-
}
|
|
170690
|
-
}
|
|
170691
171776
|
apps(first: 100) {
|
|
170692
171777
|
nodes {
|
|
170693
171778
|
id
|
|
@@ -170717,16 +171802,8 @@ const AllOrganizationsQuery = dist$1.gql`
|
|
|
170717
171802
|
`;
|
|
170718
171803
|
|
|
170719
171804
|
const CreateAppQuery = dist$1.gql`
|
|
170720
|
-
mutation AppCreate($org: Int!, $title: String!, $appUrl: Url!, $redir: [Url]
|
|
170721
|
-
appCreate(
|
|
170722
|
-
input: {
|
|
170723
|
-
organizationID: $org
|
|
170724
|
-
title: $title
|
|
170725
|
-
applicationUrl: $appUrl
|
|
170726
|
-
redirectUrlWhitelist: $redir
|
|
170727
|
-
appType: $type
|
|
170728
|
-
}
|
|
170729
|
-
) {
|
|
171805
|
+
mutation AppCreate($org: Int!, $title: String!, $appUrl: Url!, $redir: [Url]!) {
|
|
171806
|
+
appCreate(input: {organizationID: $org, title: $title, applicationUrl: $appUrl, redirectUrlWhitelist: $redir}) {
|
|
170730
171807
|
app {
|
|
170731
171808
|
id
|
|
170732
171809
|
apiKey
|
|
@@ -170822,6 +171899,38 @@ const CreateDeployment = dist$1.gql`
|
|
|
170822
171899
|
}
|
|
170823
171900
|
`;
|
|
170824
171901
|
|
|
171902
|
+
const AllStoresByOrganizationQuery = dist$1.gql`
|
|
171903
|
+
query FindOrganization($id: ID!) {
|
|
171904
|
+
organizations(id: $id, first: 1) {
|
|
171905
|
+
nodes {
|
|
171906
|
+
id
|
|
171907
|
+
stores(first: 500) {
|
|
171908
|
+
nodes {
|
|
171909
|
+
shopId
|
|
171910
|
+
link
|
|
171911
|
+
shopDomain
|
|
171912
|
+
shopName
|
|
171913
|
+
transferDisabled
|
|
171914
|
+
convertableToPartnerTest
|
|
171915
|
+
}
|
|
171916
|
+
}
|
|
171917
|
+
}
|
|
171918
|
+
}
|
|
171919
|
+
}
|
|
171920
|
+
`;
|
|
171921
|
+
|
|
171922
|
+
const ConvertDevToTestStoreQuery = dist$1.gql`
|
|
171923
|
+
mutation convertDevToTestStore($input: ConvertDevToTestStoreInput!) {
|
|
171924
|
+
convertDevToTestStore(input: $input) {
|
|
171925
|
+
convertedToTestStore
|
|
171926
|
+
userErrors {
|
|
171927
|
+
message
|
|
171928
|
+
field
|
|
171929
|
+
}
|
|
171930
|
+
}
|
|
171931
|
+
}
|
|
171932
|
+
`;
|
|
171933
|
+
|
|
170825
171934
|
var index = /*#__PURE__*/Object.freeze({
|
|
170826
171935
|
__proto__: null,
|
|
170827
171936
|
FindOrganizationQuery: FindOrganizationQuery,
|
|
@@ -170831,7 +171940,9 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
170831
171940
|
FindAppQuery: FindAppQuery,
|
|
170832
171941
|
UpdateDraftMutation: UpdateDraftMutation,
|
|
170833
171942
|
GenerateSignedUploadUrl: GenerateSignedUploadUrl,
|
|
170834
|
-
CreateDeployment: CreateDeployment
|
|
171943
|
+
CreateDeployment: CreateDeployment,
|
|
171944
|
+
AllStoresByOrganizationQuery: AllStoresByOrganizationQuery,
|
|
171945
|
+
ConvertDevToTestStoreQuery: ConvertDevToTestStoreQuery
|
|
170835
171946
|
});
|
|
170836
171947
|
|
|
170837
171948
|
var api = /*#__PURE__*/Object.freeze({
|
|
@@ -171124,12 +172235,12 @@ async function validateRubyEnv() {
|
|
|
171124
172235
|
try {
|
|
171125
172236
|
await exec("ruby", ["-v"]);
|
|
171126
172237
|
} catch {
|
|
171127
|
-
throw new
|
|
172238
|
+
throw new Abort("Ruby environment not found", "Make sure you have ruby installed on your system: https://www.ruby-lang.org/en/documentation/installation/");
|
|
171128
172239
|
}
|
|
171129
172240
|
const bundlerVersion = await getBundlerVersion();
|
|
171130
172241
|
const isValid = bundlerVersion?.compare(MinBundlerVersion);
|
|
171131
172242
|
if (isValid === -1 || isValid === void 0) {
|
|
171132
|
-
throw new
|
|
172243
|
+
throw new Abort(`Bundler version ${bundlerVersion} is not supported`, `Make sure you have Bundler version ${MinBundlerVersion} or higher installed on your system: https://bundler.io/`);
|
|
171133
172244
|
}
|
|
171134
172245
|
}
|
|
171135
172246
|
async function getBundlerVersion() {
|
|
@@ -171137,7 +172248,7 @@ async function getBundlerVersion() {
|
|
|
171137
172248
|
const { stdout } = await exec("bundler", ["-v"]);
|
|
171138
172249
|
return coerce_1(stdout);
|
|
171139
172250
|
} catch {
|
|
171140
|
-
throw new
|
|
172251
|
+
throw new Abort("Bundler not found", "Make sure you have Bundler installed on your system: https://bundler.io/");
|
|
171141
172252
|
}
|
|
171142
172253
|
}
|
|
171143
172254
|
function createWorkingDirectory() {
|
|
@@ -171437,4 +172548,4 @@ var plugins = /*#__PURE__*/Object.freeze({
|
|
|
171437
172548
|
});
|
|
171438
172549
|
|
|
171439
172550
|
export { npm as A, port as B, cli as C, id as D, temporary as E, FormData$3 as F, constants$2 as G, plugins as H, File$1 as a, string as b, github as c, dependency as d, error$j as e, file$1 as f, git as g, os$2 as h, environment as i, session as j, schema$2 as k, toml as l, store as m, api as n, output as o, path$w as p, http$2 as q, archiver as r, system as s, template as t, ui as u, version as v, checksum as w, ruby as x, yaml as y, semver as z };
|
|
171440
|
-
//# sourceMappingURL=index-
|
|
172551
|
+
//# sourceMappingURL=index-cee0245d.js.map
|