@wix/astro 1.0.3 → 1.0.4
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/build/index.js +333 -131
- package/build/index.js.map +1 -1
- package/build-runtime/middleware/auth.js +2 -11
- package/build-runtime/routes/service-plugins.d.ts +5 -0
- package/build-runtime/routes/service-plugins.js +11 -0
- package/package.json +2 -2
- package/src/directories.ts +1 -0
- package/src/index.ts +55 -0
- package/src/middleware/auth.ts +1 -2
- package/src/routes/service-plugins.ts +10 -0
- package/src/utils/createProjectModel.ts +10 -0
- package/src/utils/generateAppManifest.ts +90 -0
- package/src/utils/getSessionTokensFromCookie.ts +1 -2
- package/src/utils/isValidServicePluginComponent.ts +19 -0
- package/src/utils/writeVirtualServicePluginExtensionFiles.ts +69 -0
- package/tsup.config.mjs +5 -1
- package/src/utils/checkIsDynamicPageRequest.ts +0 -17
package/build/index.js
CHANGED
|
@@ -1225,7 +1225,7 @@ It seems like none of the "@sentry/cli" package's optional dependencies got inst
|
|
|
1225
1225
|
]);
|
|
1226
1226
|
args = [...headers, ...args];
|
|
1227
1227
|
}
|
|
1228
|
-
return new Promise((
|
|
1228
|
+
return new Promise((resolve4, reject) => {
|
|
1229
1229
|
if (live === true) {
|
|
1230
1230
|
const output = silent ? "ignore" : "inherit";
|
|
1231
1231
|
const pid = childProcess.spawn(getPath(), args, {
|
|
@@ -1234,14 +1234,14 @@ It seems like none of the "@sentry/cli" package's optional dependencies got inst
|
|
|
1234
1234
|
stdio: ["ignore", output, output]
|
|
1235
1235
|
});
|
|
1236
1236
|
pid.on("exit", () => {
|
|
1237
|
-
|
|
1237
|
+
resolve4();
|
|
1238
1238
|
});
|
|
1239
1239
|
} else {
|
|
1240
1240
|
childProcess.execFile(getPath(), args, { env: env2 }, (err, stdout) => {
|
|
1241
1241
|
if (err) {
|
|
1242
1242
|
reject(err);
|
|
1243
1243
|
} else {
|
|
1244
|
-
|
|
1244
|
+
resolve4(stdout);
|
|
1245
1245
|
}
|
|
1246
1246
|
});
|
|
1247
1247
|
}
|
|
@@ -37676,7 +37676,7 @@ ${rootStack}`;
|
|
|
37676
37676
|
}
|
|
37677
37677
|
url.path = path3;
|
|
37678
37678
|
}
|
|
37679
|
-
function
|
|
37679
|
+
function resolve4(input, base) {
|
|
37680
37680
|
if (!input && !base)
|
|
37681
37681
|
return "";
|
|
37682
37682
|
const url = parseUrl(input);
|
|
@@ -37723,7 +37723,7 @@ ${rootStack}`;
|
|
|
37723
37723
|
return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
|
|
37724
37724
|
}
|
|
37725
37725
|
}
|
|
37726
|
-
return
|
|
37726
|
+
return resolve4;
|
|
37727
37727
|
});
|
|
37728
37728
|
}
|
|
37729
37729
|
});
|
|
@@ -37734,7 +37734,7 @@ ${rootStack}`;
|
|
|
37734
37734
|
typeof exports2 === "object" && typeof module22 !== "undefined" ? factory(exports2, require_sourcemap_codec_umd(), require_resolve_uri_umd()) : typeof define === "function" && define.amd ? define(["exports", "@jridgewell/sourcemap-codec", "@jridgewell/resolve-uri"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.traceMapping = {}, global2.sourcemapCodec, global2.resolveURI));
|
|
37735
37735
|
})(exports2, function(exports3, sourcemapCodec, resolveUri) {
|
|
37736
37736
|
"use strict";
|
|
37737
|
-
function
|
|
37737
|
+
function resolve4(input, base) {
|
|
37738
37738
|
if (base && !base.endsWith("/"))
|
|
37739
37739
|
base += "/";
|
|
37740
37740
|
return resolveUri(input, base);
|
|
@@ -37986,8 +37986,8 @@ ${rootStack}`;
|
|
|
37986
37986
|
this.sources = sources;
|
|
37987
37987
|
this.sourcesContent = sourcesContent;
|
|
37988
37988
|
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
|
|
37989
|
-
const from =
|
|
37990
|
-
this.resolvedSources = sources.map((s) =>
|
|
37989
|
+
const from = resolve4(sourceRoot || "", stripFilename(mapUrl));
|
|
37990
|
+
this.resolvedSources = sources.map((s) => resolve4(s || "", from));
|
|
37991
37991
|
const { mappings } = parsed;
|
|
37992
37992
|
if (typeof mappings === "string") {
|
|
37993
37993
|
this._encoded = mappings;
|
|
@@ -46384,7 +46384,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
46384
46384
|
exports2.isStatic = isStatic;
|
|
46385
46385
|
exports2.matchesPattern = matchesPattern;
|
|
46386
46386
|
exports2.referencesImport = referencesImport;
|
|
46387
|
-
exports2.resolve =
|
|
46387
|
+
exports2.resolve = resolve4;
|
|
46388
46388
|
exports2.willIMaybeExecuteBefore = willIMaybeExecuteBefore;
|
|
46389
46389
|
var _t = require_lib3();
|
|
46390
46390
|
var {
|
|
@@ -46646,7 +46646,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
46646
46646
|
nodeMap.set(target.node, result);
|
|
46647
46647
|
return result;
|
|
46648
46648
|
}
|
|
46649
|
-
function
|
|
46649
|
+
function resolve4(dangerous, resolved) {
|
|
46650
46650
|
return _resolve.call(this, dangerous, resolved) || this;
|
|
46651
46651
|
}
|
|
46652
46652
|
function _resolve(dangerous, resolved) {
|
|
@@ -51280,10 +51280,10 @@ ${" ".repeat(indentSize)}`);
|
|
|
51280
51280
|
const items = Array.from(args[0]);
|
|
51281
51281
|
return items.map((item) => evaluateSync(item));
|
|
51282
51282
|
},
|
|
51283
|
-
async: function(args,
|
|
51283
|
+
async: function(args, resolve4, reject) {
|
|
51284
51284
|
const items = Array.from(args[0]);
|
|
51285
51285
|
if (items.length === 0) {
|
|
51286
|
-
Promise.resolve().then(() =>
|
|
51286
|
+
Promise.resolve().then(() => resolve4([]));
|
|
51287
51287
|
return;
|
|
51288
51288
|
}
|
|
51289
51289
|
let count = 0;
|
|
@@ -51294,7 +51294,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
51294
51294
|
(val) => {
|
|
51295
51295
|
results[i] = val;
|
|
51296
51296
|
count += 1;
|
|
51297
|
-
if (count === results.length)
|
|
51297
|
+
if (count === results.length) resolve4(results);
|
|
51298
51298
|
},
|
|
51299
51299
|
reject
|
|
51300
51300
|
);
|
|
@@ -51311,13 +51311,13 @@ ${" ".repeat(indentSize)}`);
|
|
|
51311
51311
|
}
|
|
51312
51312
|
return evaluateSync(items[0]);
|
|
51313
51313
|
},
|
|
51314
|
-
async: function(args,
|
|
51314
|
+
async: function(args, resolve4, reject) {
|
|
51315
51315
|
const items = Array.from(args[0]);
|
|
51316
51316
|
if (items.length === 0) {
|
|
51317
51317
|
throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY);
|
|
51318
51318
|
}
|
|
51319
51319
|
for (const item of items) {
|
|
51320
|
-
evaluateAsync(item,
|
|
51320
|
+
evaluateAsync(item, resolve4, reject);
|
|
51321
51321
|
}
|
|
51322
51322
|
}
|
|
51323
51323
|
})
|
|
@@ -51329,8 +51329,8 @@ ${" ".repeat(indentSize)}`);
|
|
|
51329
51329
|
return evaluateSync(genFn.apply(this, args));
|
|
51330
51330
|
},
|
|
51331
51331
|
async: function(...args) {
|
|
51332
|
-
return new Promise((
|
|
51333
|
-
evaluateAsync(genFn.apply(this, args),
|
|
51332
|
+
return new Promise((resolve4, reject) => {
|
|
51333
|
+
evaluateAsync(genFn.apply(this, args), resolve4, reject);
|
|
51334
51334
|
});
|
|
51335
51335
|
},
|
|
51336
51336
|
errback: function(...args) {
|
|
@@ -51428,16 +51428,16 @@ ${" ".repeat(indentSize)}`);
|
|
|
51428
51428
|
sync: function(args) {
|
|
51429
51429
|
return sync.apply(this, args);
|
|
51430
51430
|
},
|
|
51431
|
-
async: function(args,
|
|
51431
|
+
async: function(args, resolve4, reject) {
|
|
51432
51432
|
if (async) {
|
|
51433
|
-
async.apply(this, args).then(
|
|
51433
|
+
async.apply(this, args).then(resolve4, reject);
|
|
51434
51434
|
} else if (errback) {
|
|
51435
51435
|
errback.call(this, ...args, (err, value2) => {
|
|
51436
|
-
if (err == null)
|
|
51436
|
+
if (err == null) resolve4(value2);
|
|
51437
51437
|
else reject(err);
|
|
51438
51438
|
});
|
|
51439
51439
|
} else {
|
|
51440
|
-
|
|
51440
|
+
resolve4(sync.apply(this, args));
|
|
51441
51441
|
}
|
|
51442
51442
|
}
|
|
51443
51443
|
});
|
|
@@ -51488,7 +51488,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
51488
51488
|
}
|
|
51489
51489
|
return value2;
|
|
51490
51490
|
}
|
|
51491
|
-
function evaluateAsync(gen,
|
|
51491
|
+
function evaluateAsync(gen, resolve4, reject) {
|
|
51492
51492
|
(function step() {
|
|
51493
51493
|
try {
|
|
51494
51494
|
let value2;
|
|
@@ -51509,7 +51509,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
51509
51509
|
return;
|
|
51510
51510
|
}
|
|
51511
51511
|
}
|
|
51512
|
-
return
|
|
51512
|
+
return resolve4(value2);
|
|
51513
51513
|
} catch (err) {
|
|
51514
51514
|
return reject(err);
|
|
51515
51515
|
}
|
|
@@ -51967,8 +51967,8 @@ ${" ".repeat(indentSize)}`);
|
|
|
51967
51967
|
this.released = false;
|
|
51968
51968
|
this.promise = void 0;
|
|
51969
51969
|
this._resolve = void 0;
|
|
51970
|
-
this.promise = new Promise((
|
|
51971
|
-
this._resolve =
|
|
51970
|
+
this.promise = new Promise((resolve4) => {
|
|
51971
|
+
this._resolve = resolve4;
|
|
51972
51972
|
});
|
|
51973
51973
|
}
|
|
51974
51974
|
release(value2) {
|
|
@@ -53500,9 +53500,9 @@ ${" ".repeat(indentSize)}`);
|
|
|
53500
53500
|
};
|
|
53501
53501
|
}
|
|
53502
53502
|
} else {
|
|
53503
|
-
let
|
|
53503
|
+
let resolve4, reject;
|
|
53504
53504
|
resultP = new Promise((res, rej) => {
|
|
53505
|
-
|
|
53505
|
+
resolve4 = res;
|
|
53506
53506
|
reject = rej;
|
|
53507
53507
|
});
|
|
53508
53508
|
try {
|
|
@@ -53511,7 +53511,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
53511
53511
|
value: yield* fn()
|
|
53512
53512
|
};
|
|
53513
53513
|
resultP = null;
|
|
53514
|
-
if (promiseReferenced)
|
|
53514
|
+
if (promiseReferenced) resolve4(result.value);
|
|
53515
53515
|
} catch (error) {
|
|
53516
53516
|
result = {
|
|
53517
53517
|
ok: false,
|
|
@@ -54646,7 +54646,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
54646
54646
|
function isSupported(flags, withPartial) {
|
|
54647
54647
|
return typeof flags === "string" && (flags.indexOf("y") >= 0 || withPartial && flags.indexOf("a") >= 0);
|
|
54648
54648
|
}
|
|
54649
|
-
function
|
|
54649
|
+
function resolve4(queries, context) {
|
|
54650
54650
|
return parse3(QUERIES, queries).reduce(function(result, node, index) {
|
|
54651
54651
|
if (node.not && index === 0) {
|
|
54652
54652
|
throw new BrowserslistError(
|
|
@@ -54733,7 +54733,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
54733
54733
|
}
|
|
54734
54734
|
var cacheKey = JSON.stringify([queries, context]);
|
|
54735
54735
|
if (cache[cacheKey]) return cache[cacheKey];
|
|
54736
|
-
var result = uniq(
|
|
54736
|
+
var result = uniq(resolve4(queries, context)).sort(function(name1, name2) {
|
|
54737
54737
|
name1 = name1.split(" ");
|
|
54738
54738
|
name2 = name2.split(" ");
|
|
54739
54739
|
if (name1[0] === name2[0]) {
|
|
@@ -55330,7 +55330,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
55330
55330
|
matches: [],
|
|
55331
55331
|
regexp: /^current\s+node$/i,
|
|
55332
55332
|
select: function(context) {
|
|
55333
|
-
return [env2.currentNode(
|
|
55333
|
+
return [env2.currentNode(resolve4, context)];
|
|
55334
55334
|
}
|
|
55335
55335
|
},
|
|
55336
55336
|
maintained_node: {
|
|
@@ -55343,7 +55343,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
55343
55343
|
}).map(function(key2) {
|
|
55344
55344
|
return "node " + key2.slice(1);
|
|
55345
55345
|
});
|
|
55346
|
-
return
|
|
55346
|
+
return resolve4(queries, context);
|
|
55347
55347
|
}
|
|
55348
55348
|
},
|
|
55349
55349
|
phantomjs_1_9: {
|
|
@@ -55401,14 +55401,14 @@ ${" ".repeat(indentSize)}`);
|
|
|
55401
55401
|
matches: ["config"],
|
|
55402
55402
|
regexp: /^extends (.+)$/i,
|
|
55403
55403
|
select: function(context, node) {
|
|
55404
|
-
return
|
|
55404
|
+
return resolve4(env2.loadQueries(context, node.config), context);
|
|
55405
55405
|
}
|
|
55406
55406
|
},
|
|
55407
55407
|
defaults: {
|
|
55408
55408
|
matches: [],
|
|
55409
55409
|
regexp: /^defaults$/i,
|
|
55410
55410
|
select: function(context) {
|
|
55411
|
-
return
|
|
55411
|
+
return resolve4(browserslist.defaults, context);
|
|
55412
55412
|
}
|
|
55413
55413
|
},
|
|
55414
55414
|
dead: {
|
|
@@ -55423,7 +55423,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
55423
55423
|
"op_mob <= 12.1",
|
|
55424
55424
|
"samsung 4"
|
|
55425
55425
|
];
|
|
55426
|
-
return
|
|
55426
|
+
return resolve4(dead, context);
|
|
55427
55427
|
}
|
|
55428
55428
|
},
|
|
55429
55429
|
unknown: {
|
|
@@ -69127,7 +69127,7 @@ module.exports = function(api) {
|
|
|
69127
69127
|
value: true
|
|
69128
69128
|
});
|
|
69129
69129
|
exports2.moduleResolve = moduleResolve;
|
|
69130
|
-
exports2.resolve =
|
|
69130
|
+
exports2.resolve = resolve4;
|
|
69131
69131
|
function _assert() {
|
|
69132
69132
|
const data = __require("assert");
|
|
69133
69133
|
_assert = function() {
|
|
@@ -70170,7 +70170,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
70170
70170
|
})
|
|
70171
70171
|
};
|
|
70172
70172
|
}
|
|
70173
|
-
function
|
|
70173
|
+
function resolve4(specifier, parent) {
|
|
70174
70174
|
if (!parent) {
|
|
70175
70175
|
throw new Error("Please pass `parent`: `import-meta-resolve` cannot ponyfill that");
|
|
70176
70176
|
}
|
|
@@ -74127,9 +74127,9 @@ to your top-level package.json.
|
|
|
74127
74127
|
return new ReaddirpStream(options);
|
|
74128
74128
|
};
|
|
74129
74129
|
var readdirpPromise = (root2, options = {}) => {
|
|
74130
|
-
return new Promise((
|
|
74130
|
+
return new Promise((resolve4, reject) => {
|
|
74131
74131
|
const files = [];
|
|
74132
|
-
readdirp(root2, options).on("data", (entry) => files.push(entry)).on("end", () =>
|
|
74132
|
+
readdirp(root2, options).on("data", (entry) => files.push(entry)).on("end", () => resolve4(files)).on("error", (error) => reject(error));
|
|
74133
74133
|
});
|
|
74134
74134
|
};
|
|
74135
74135
|
readdirp.promise = readdirpPromise;
|
|
@@ -77670,13 +77670,13 @@ to your top-level package.json.
|
|
|
77670
77670
|
}
|
|
77671
77671
|
}).on(EV_ERROR, this._boundHandleError);
|
|
77672
77672
|
return new Promise(
|
|
77673
|
-
(
|
|
77673
|
+
(resolve4) => stream.once(STR_END, () => {
|
|
77674
77674
|
if (this.fsw.closed) {
|
|
77675
77675
|
stream = void 0;
|
|
77676
77676
|
return;
|
|
77677
77677
|
}
|
|
77678
77678
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
77679
|
-
|
|
77679
|
+
resolve4();
|
|
77680
77680
|
previous.getChildren().filter((item) => {
|
|
77681
77681
|
return item !== directory && !current.has(item) && // in case of intersecting globs;
|
|
77682
77682
|
// a path may have been filtered out of this readdir, but
|
|
@@ -87680,7 +87680,7 @@ to your top-level package.json.
|
|
|
87680
87680
|
}
|
|
87681
87681
|
url.path = path22;
|
|
87682
87682
|
}
|
|
87683
|
-
function
|
|
87683
|
+
function resolve4(input, base) {
|
|
87684
87684
|
if (!input && !base)
|
|
87685
87685
|
return "";
|
|
87686
87686
|
const url = parseUrl(input);
|
|
@@ -87709,7 +87709,7 @@ to your top-level package.json.
|
|
|
87709
87709
|
function resolve22(input, base) {
|
|
87710
87710
|
if (base && !base.endsWith("/"))
|
|
87711
87711
|
base += "/";
|
|
87712
|
-
return
|
|
87712
|
+
return resolve4(input, base);
|
|
87713
87713
|
}
|
|
87714
87714
|
function stripFilename(path22) {
|
|
87715
87715
|
if (!path22)
|
|
@@ -88908,18 +88908,18 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
88908
88908
|
queue.dequeue()();
|
|
88909
88909
|
}
|
|
88910
88910
|
};
|
|
88911
|
-
const run = async (fn,
|
|
88911
|
+
const run = async (fn, resolve4, ...args) => {
|
|
88912
88912
|
activeCount++;
|
|
88913
88913
|
const result = (async () => fn(...args))();
|
|
88914
|
-
|
|
88914
|
+
resolve4(result);
|
|
88915
88915
|
try {
|
|
88916
88916
|
await result;
|
|
88917
88917
|
} catch {
|
|
88918
88918
|
}
|
|
88919
88919
|
next();
|
|
88920
88920
|
};
|
|
88921
|
-
const enqueue = (fn,
|
|
88922
|
-
queue.enqueue(run.bind(null, fn,
|
|
88921
|
+
const enqueue = (fn, resolve4, ...args) => {
|
|
88922
|
+
queue.enqueue(run.bind(null, fn, resolve4, ...args));
|
|
88923
88923
|
(async () => {
|
|
88924
88924
|
await Promise.resolve();
|
|
88925
88925
|
if (activeCount < concurrency && queue.size > 0) {
|
|
@@ -88927,8 +88927,8 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
88927
88927
|
}
|
|
88928
88928
|
})();
|
|
88929
88929
|
};
|
|
88930
|
-
const generator = (fn, ...args) => new Promise((
|
|
88931
|
-
enqueue(fn,
|
|
88930
|
+
const generator = (fn, ...args) => new Promise((resolve4) => {
|
|
88931
|
+
enqueue(fn, resolve4, ...args);
|
|
88932
88932
|
});
|
|
88933
88933
|
Object.defineProperties(generator, {
|
|
88934
88934
|
activeCount: {
|
|
@@ -92845,10 +92845,10 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
92845
92845
|
* Return a void Promise that resolves once the stream ends.
|
|
92846
92846
|
*/
|
|
92847
92847
|
async promise() {
|
|
92848
|
-
return new Promise((
|
|
92848
|
+
return new Promise((resolve4, reject) => {
|
|
92849
92849
|
this.on(DESTROYED, () => reject(new Error("stream destroyed")));
|
|
92850
92850
|
this.on("error", (er) => reject(er));
|
|
92851
|
-
this.on("end", () =>
|
|
92851
|
+
this.on("end", () => resolve4());
|
|
92852
92852
|
});
|
|
92853
92853
|
}
|
|
92854
92854
|
/**
|
|
@@ -92872,7 +92872,7 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
92872
92872
|
return Promise.resolve({ done: false, value: res });
|
|
92873
92873
|
if (this[EOF])
|
|
92874
92874
|
return stop();
|
|
92875
|
-
let
|
|
92875
|
+
let resolve4;
|
|
92876
92876
|
let reject;
|
|
92877
92877
|
const onerr = (er) => {
|
|
92878
92878
|
this.off("data", ondata);
|
|
@@ -92886,19 +92886,19 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
92886
92886
|
this.off("end", onend);
|
|
92887
92887
|
this.off(DESTROYED, ondestroy);
|
|
92888
92888
|
this.pause();
|
|
92889
|
-
|
|
92889
|
+
resolve4({ value: value2, done: !!this[EOF] });
|
|
92890
92890
|
};
|
|
92891
92891
|
const onend = () => {
|
|
92892
92892
|
this.off("error", onerr);
|
|
92893
92893
|
this.off("data", ondata);
|
|
92894
92894
|
this.off(DESTROYED, ondestroy);
|
|
92895
92895
|
stop();
|
|
92896
|
-
|
|
92896
|
+
resolve4({ done: true, value: void 0 });
|
|
92897
92897
|
};
|
|
92898
92898
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
92899
92899
|
return new Promise((res2, rej) => {
|
|
92900
92900
|
reject = rej;
|
|
92901
|
-
|
|
92901
|
+
resolve4 = res2;
|
|
92902
92902
|
this.once(DESTROYED, ondestroy);
|
|
92903
92903
|
this.once("error", onerr);
|
|
92904
92904
|
this.once("end", onend);
|
|
@@ -93908,9 +93908,9 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
93908
93908
|
if (this.#asyncReaddirInFlight) {
|
|
93909
93909
|
await this.#asyncReaddirInFlight;
|
|
93910
93910
|
} else {
|
|
93911
|
-
let
|
|
93911
|
+
let resolve4 = () => {
|
|
93912
93912
|
};
|
|
93913
|
-
this.#asyncReaddirInFlight = new Promise((res) =>
|
|
93913
|
+
this.#asyncReaddirInFlight = new Promise((res) => resolve4 = res);
|
|
93914
93914
|
try {
|
|
93915
93915
|
for (const e of await this.#fs.promises.readdir(fullpath, {
|
|
93916
93916
|
withFileTypes: true
|
|
@@ -93923,7 +93923,7 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
93923
93923
|
children.provisional = 0;
|
|
93924
93924
|
}
|
|
93925
93925
|
this.#asyncReaddirInFlight = void 0;
|
|
93926
|
-
|
|
93926
|
+
resolve4();
|
|
93927
93927
|
}
|
|
93928
93928
|
return children.slice(0, children.provisional);
|
|
93929
93929
|
}
|
|
@@ -95365,10 +95365,10 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
95365
95365
|
}
|
|
95366
95366
|
// stream.promise().then(() => done, er => emitted error)
|
|
95367
95367
|
promise() {
|
|
95368
|
-
return new Promise((
|
|
95368
|
+
return new Promise((resolve4, reject) => {
|
|
95369
95369
|
this.on(DESTROYED, () => reject(new Error("stream destroyed")));
|
|
95370
95370
|
this.on("error", (er) => reject(er));
|
|
95371
|
-
this.on("end", () =>
|
|
95371
|
+
this.on("end", () => resolve4());
|
|
95372
95372
|
});
|
|
95373
95373
|
}
|
|
95374
95374
|
// for await (let chunk of stream)
|
|
@@ -95384,7 +95384,7 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
95384
95384
|
const res = this.read();
|
|
95385
95385
|
if (res !== null) return Promise.resolve({ done: false, value: res });
|
|
95386
95386
|
if (this[EOF]) return stop();
|
|
95387
|
-
let
|
|
95387
|
+
let resolve4 = null;
|
|
95388
95388
|
let reject = null;
|
|
95389
95389
|
const onerr = (er) => {
|
|
95390
95390
|
this.removeListener("data", ondata);
|
|
@@ -95398,19 +95398,19 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
95398
95398
|
this.removeListener("end", onend);
|
|
95399
95399
|
this.removeListener(DESTROYED, ondestroy);
|
|
95400
95400
|
this.pause();
|
|
95401
|
-
|
|
95401
|
+
resolve4({ value: value2, done: !!this[EOF] });
|
|
95402
95402
|
};
|
|
95403
95403
|
const onend = () => {
|
|
95404
95404
|
this.removeListener("error", onerr);
|
|
95405
95405
|
this.removeListener("data", ondata);
|
|
95406
95406
|
this.removeListener(DESTROYED, ondestroy);
|
|
95407
95407
|
stop();
|
|
95408
|
-
|
|
95408
|
+
resolve4({ done: true });
|
|
95409
95409
|
};
|
|
95410
95410
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
95411
95411
|
return new Promise((res2, rej) => {
|
|
95412
95412
|
reject = rej;
|
|
95413
|
-
|
|
95413
|
+
resolve4 = res2;
|
|
95414
95414
|
this.once(DESTROYED, ondestroy);
|
|
95415
95415
|
this.once("error", onerr);
|
|
95416
95416
|
this.once("end", onend);
|
|
@@ -96895,18 +96895,18 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
96895
96895
|
});
|
|
96896
96896
|
}
|
|
96897
96897
|
function AsyncIterator(generator, PromiseImpl) {
|
|
96898
|
-
function invoke(method, arg,
|
|
96898
|
+
function invoke(method, arg, resolve4, reject) {
|
|
96899
96899
|
var record = tryCatch(generator[method], generator, arg);
|
|
96900
96900
|
if ("throw" !== record.type) {
|
|
96901
96901
|
var result = record.arg, value2 = result.value;
|
|
96902
96902
|
return value2 && "object" == typeof value2 && hasOwn.call(value2, "__await") ? PromiseImpl.resolve(value2.__await).then(function(value3) {
|
|
96903
|
-
invoke("next", value3,
|
|
96903
|
+
invoke("next", value3, resolve4, reject);
|
|
96904
96904
|
}, function(err) {
|
|
96905
|
-
invoke("throw", err,
|
|
96905
|
+
invoke("throw", err, resolve4, reject);
|
|
96906
96906
|
}) : PromiseImpl.resolve(value2).then(function(unwrapped) {
|
|
96907
|
-
result.value = unwrapped,
|
|
96907
|
+
result.value = unwrapped, resolve4(result);
|
|
96908
96908
|
}, function(error) {
|
|
96909
|
-
return invoke("throw", error,
|
|
96909
|
+
return invoke("throw", error, resolve4, reject);
|
|
96910
96910
|
});
|
|
96911
96911
|
}
|
|
96912
96912
|
reject(record.arg);
|
|
@@ -96915,8 +96915,8 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
96915
96915
|
defineProperty(this, "_invoke", {
|
|
96916
96916
|
value: function(method, arg) {
|
|
96917
96917
|
function callInvokeWithMethodAndArg() {
|
|
96918
|
-
return new PromiseImpl(function(
|
|
96919
|
-
invoke(method, arg,
|
|
96918
|
+
return new PromiseImpl(function(resolve4, reject) {
|
|
96919
|
+
invoke(method, arg, resolve4, reject);
|
|
96920
96920
|
});
|
|
96921
96921
|
}
|
|
96922
96922
|
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
@@ -97128,7 +97128,7 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
97128
97128
|
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
97129
97129
|
}, _typeof(obj);
|
|
97130
97130
|
}
|
|
97131
|
-
function asyncGeneratorStep(gen,
|
|
97131
|
+
function asyncGeneratorStep(gen, resolve4, reject, _next, _throw, key2, arg) {
|
|
97132
97132
|
try {
|
|
97133
97133
|
var info = gen[key2](arg);
|
|
97134
97134
|
var value2 = info.value;
|
|
@@ -97137,7 +97137,7 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
97137
97137
|
return;
|
|
97138
97138
|
}
|
|
97139
97139
|
if (info.done) {
|
|
97140
|
-
|
|
97140
|
+
resolve4(value2);
|
|
97141
97141
|
} else {
|
|
97142
97142
|
Promise.resolve(value2).then(_next, _throw);
|
|
97143
97143
|
}
|
|
@@ -97145,13 +97145,13 @@ Did you specify these with the most recent transformation maps first?`);
|
|
|
97145
97145
|
function _asyncToGenerator(fn) {
|
|
97146
97146
|
return function() {
|
|
97147
97147
|
var self2 = this, args = arguments;
|
|
97148
|
-
return new Promise(function(
|
|
97148
|
+
return new Promise(function(resolve4, reject) {
|
|
97149
97149
|
var gen = fn.apply(self2, args);
|
|
97150
97150
|
function _next(value2) {
|
|
97151
|
-
asyncGeneratorStep(gen,
|
|
97151
|
+
asyncGeneratorStep(gen, resolve4, reject, _next, _throw, "next", value2);
|
|
97152
97152
|
}
|
|
97153
97153
|
function _throw(err) {
|
|
97154
|
-
asyncGeneratorStep(gen,
|
|
97154
|
+
asyncGeneratorStep(gen, resolve4, reject, _next, _throw, "throw", err);
|
|
97155
97155
|
}
|
|
97156
97156
|
_next(void 0);
|
|
97157
97157
|
});
|
|
@@ -98276,8 +98276,8 @@ Error:`,
|
|
|
98276
98276
|
States2[States2["REJECTED"] = REJECTED] = "REJECTED";
|
|
98277
98277
|
})(States || (States = {}));
|
|
98278
98278
|
function resolvedSyncPromise(value2) {
|
|
98279
|
-
return new SyncPromise((
|
|
98280
|
-
|
|
98279
|
+
return new SyncPromise((resolve4) => {
|
|
98280
|
+
resolve4(value2);
|
|
98281
98281
|
});
|
|
98282
98282
|
}
|
|
98283
98283
|
function rejectedSyncPromise(reason) {
|
|
@@ -98301,15 +98301,15 @@ Error:`,
|
|
|
98301
98301
|
}
|
|
98302
98302
|
/** JSDoc */
|
|
98303
98303
|
then(onfulfilled, onrejected) {
|
|
98304
|
-
return new _SyncPromise((
|
|
98304
|
+
return new _SyncPromise((resolve4, reject) => {
|
|
98305
98305
|
this._handlers.push([
|
|
98306
98306
|
false,
|
|
98307
98307
|
(result) => {
|
|
98308
98308
|
if (!onfulfilled) {
|
|
98309
|
-
|
|
98309
|
+
resolve4(result);
|
|
98310
98310
|
} else {
|
|
98311
98311
|
try {
|
|
98312
|
-
|
|
98312
|
+
resolve4(onfulfilled(result));
|
|
98313
98313
|
} catch (e) {
|
|
98314
98314
|
reject(e);
|
|
98315
98315
|
}
|
|
@@ -98320,7 +98320,7 @@ Error:`,
|
|
|
98320
98320
|
reject(reason);
|
|
98321
98321
|
} else {
|
|
98322
98322
|
try {
|
|
98323
|
-
|
|
98323
|
+
resolve4(onrejected(reason));
|
|
98324
98324
|
} catch (e) {
|
|
98325
98325
|
reject(e);
|
|
98326
98326
|
}
|
|
@@ -98336,7 +98336,7 @@ Error:`,
|
|
|
98336
98336
|
}
|
|
98337
98337
|
/** JSDoc */
|
|
98338
98338
|
finally(onfinally) {
|
|
98339
|
-
return new _SyncPromise((
|
|
98339
|
+
return new _SyncPromise((resolve4, reject) => {
|
|
98340
98340
|
let val;
|
|
98341
98341
|
let isRejected;
|
|
98342
98342
|
return this.then(
|
|
@@ -98359,7 +98359,7 @@ Error:`,
|
|
|
98359
98359
|
reject(val);
|
|
98360
98360
|
return;
|
|
98361
98361
|
}
|
|
98362
|
-
|
|
98362
|
+
resolve4(val);
|
|
98363
98363
|
});
|
|
98364
98364
|
});
|
|
98365
98365
|
}
|
|
@@ -98437,21 +98437,21 @@ Error:`,
|
|
|
98437
98437
|
return task;
|
|
98438
98438
|
}
|
|
98439
98439
|
function drain(timeout) {
|
|
98440
|
-
return new SyncPromise((
|
|
98440
|
+
return new SyncPromise((resolve4, reject) => {
|
|
98441
98441
|
let counter = buffer2.length;
|
|
98442
98442
|
if (!counter) {
|
|
98443
|
-
return
|
|
98443
|
+
return resolve4(true);
|
|
98444
98444
|
}
|
|
98445
98445
|
const capturedSetTimeout = setTimeout(() => {
|
|
98446
98446
|
if (timeout && timeout > 0) {
|
|
98447
|
-
|
|
98447
|
+
resolve4(false);
|
|
98448
98448
|
}
|
|
98449
98449
|
}, timeout);
|
|
98450
98450
|
buffer2.forEach((item) => {
|
|
98451
98451
|
void resolvedSyncPromise(item).then(() => {
|
|
98452
98452
|
if (!--counter) {
|
|
98453
98453
|
clearTimeout(capturedSetTimeout);
|
|
98454
|
-
|
|
98454
|
+
resolve4(true);
|
|
98455
98455
|
}
|
|
98456
98456
|
}, reject);
|
|
98457
98457
|
});
|
|
@@ -100648,17 +100648,17 @@ ${JSON.stringify(itemHeaders)}
|
|
|
100648
100648
|
} : (callback) => callback();
|
|
100649
100649
|
}
|
|
100650
100650
|
function notifyEventProcessors(processors, event, hint, index = 0) {
|
|
100651
|
-
return new SyncPromise((
|
|
100651
|
+
return new SyncPromise((resolve4, reject) => {
|
|
100652
100652
|
const processor = processors[index];
|
|
100653
100653
|
if (event === null || typeof processor !== "function") {
|
|
100654
|
-
|
|
100654
|
+
resolve4(event);
|
|
100655
100655
|
} else {
|
|
100656
100656
|
const result = processor({ ...event }, hint);
|
|
100657
100657
|
DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor "${processor.id}" dropped event`);
|
|
100658
100658
|
if (isThenable(result)) {
|
|
100659
|
-
void result.then((final) => notifyEventProcessors(processors, final, hint, index + 1).then(
|
|
100659
|
+
void result.then((final) => notifyEventProcessors(processors, final, hint, index + 1).then(resolve4)).then(null, reject);
|
|
100660
100660
|
} else {
|
|
100661
|
-
void notifyEventProcessors(processors, result, hint, index + 1).then(
|
|
100661
|
+
void notifyEventProcessors(processors, result, hint, index + 1).then(resolve4).then(null, reject);
|
|
100662
100662
|
}
|
|
100663
100663
|
}
|
|
100664
100664
|
});
|
|
@@ -101435,18 +101435,18 @@ ${JSON.stringify(itemHeaders)}
|
|
|
101435
101435
|
* `false` otherwise
|
|
101436
101436
|
*/
|
|
101437
101437
|
_isClientDoneProcessing(timeout) {
|
|
101438
|
-
return new SyncPromise((
|
|
101438
|
+
return new SyncPromise((resolve4) => {
|
|
101439
101439
|
let ticked = 0;
|
|
101440
101440
|
const tick = 1;
|
|
101441
101441
|
const interval = setInterval(() => {
|
|
101442
101442
|
if (this._numProcessing == 0) {
|
|
101443
101443
|
clearInterval(interval);
|
|
101444
|
-
|
|
101444
|
+
resolve4(true);
|
|
101445
101445
|
} else {
|
|
101446
101446
|
ticked += tick;
|
|
101447
101447
|
if (timeout && ticked >= timeout) {
|
|
101448
101448
|
clearInterval(interval);
|
|
101449
|
-
|
|
101449
|
+
resolve4(false);
|
|
101450
101450
|
}
|
|
101451
101451
|
}
|
|
101452
101452
|
}, tick);
|
|
@@ -102027,7 +102027,7 @@ Reason: ${reason}`
|
|
|
102027
102027
|
function createRequestExecutor(options) {
|
|
102028
102028
|
var _URL = new URL(options.url), hostname = _URL.hostname, pathname = _URL.pathname, port = _URL.port, protocol = _URL.protocol, search = _URL.search;
|
|
102029
102029
|
return function makeRequest(request) {
|
|
102030
|
-
return new Promise(function(
|
|
102030
|
+
return new Promise(function(resolve4, reject) {
|
|
102031
102031
|
suppressTracing(function() {
|
|
102032
102032
|
var body = streamFromBody(request.body);
|
|
102033
102033
|
var headers = {};
|
|
@@ -102051,7 +102051,7 @@ Reason: ${reason}`
|
|
|
102051
102051
|
res.setEncoding("utf8");
|
|
102052
102052
|
var retryAfterHeader = (_res$headers$retryAf = res.headers["retry-after"]) !== null && _res$headers$retryAf !== void 0 ? _res$headers$retryAf : null;
|
|
102053
102053
|
var rateLimitsHeader = (_res$headers$xSentry = res.headers["x-sentry-rate-limits"]) !== null && _res$headers$xSentry !== void 0 ? _res$headers$xSentry : null;
|
|
102054
|
-
|
|
102054
|
+
resolve4({
|
|
102055
102055
|
statusCode: res.statusCode,
|
|
102056
102056
|
headers: {
|
|
102057
102057
|
"retry-after": retryAfterHeader,
|
|
@@ -103111,14 +103111,14 @@ Reason: ${reason}`
|
|
|
103111
103111
|
};
|
|
103112
103112
|
}
|
|
103113
103113
|
function waitUntilSourcemapFileDependenciesAreFreed() {
|
|
103114
|
-
return new Promise(function(
|
|
103114
|
+
return new Promise(function(resolve4) {
|
|
103115
103115
|
sourcemapFileDependencySubscribers.push(function() {
|
|
103116
103116
|
if (dependenciesOnSourcemapFiles.size === 0) {
|
|
103117
|
-
|
|
103117
|
+
resolve4();
|
|
103118
103118
|
}
|
|
103119
103119
|
});
|
|
103120
103120
|
if (dependenciesOnSourcemapFiles.size === 0) {
|
|
103121
|
-
|
|
103121
|
+
resolve4();
|
|
103122
103122
|
}
|
|
103123
103123
|
});
|
|
103124
103124
|
}
|
|
@@ -106334,9 +106334,9 @@ var require_readdirp = __commonJS({
|
|
|
106334
106334
|
return new ReaddirpStream(options);
|
|
106335
106335
|
};
|
|
106336
106336
|
var readdirpPromise = (root, options = {}) => {
|
|
106337
|
-
return new Promise((
|
|
106337
|
+
return new Promise((resolve4, reject) => {
|
|
106338
106338
|
const files = [];
|
|
106339
|
-
readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () =>
|
|
106339
|
+
readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve4(files)).on("error", (error) => reject(error));
|
|
106340
106340
|
});
|
|
106341
106341
|
};
|
|
106342
106342
|
readdirp.promise = readdirpPromise;
|
|
@@ -109951,13 +109951,13 @@ var require_nodefs_handler = __commonJS({
|
|
|
109951
109951
|
}
|
|
109952
109952
|
}).on(EV_ERROR, this._boundHandleError);
|
|
109953
109953
|
return new Promise(
|
|
109954
|
-
(
|
|
109954
|
+
(resolve4) => stream.once(STR_END, () => {
|
|
109955
109955
|
if (this.fsw.closed) {
|
|
109956
109956
|
stream = void 0;
|
|
109957
109957
|
return;
|
|
109958
109958
|
}
|
|
109959
109959
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
109960
|
-
|
|
109960
|
+
resolve4();
|
|
109961
109961
|
previous.getChildren().filter((item) => {
|
|
109962
109962
|
return item !== directory && !current.has(item) && // in case of intersecting globs;
|
|
109963
109963
|
// a path may have been filtered out of this readdir, but
|
|
@@ -114458,41 +114458,41 @@ var require_queue = __commonJS({
|
|
|
114458
114458
|
queue.drained = drained;
|
|
114459
114459
|
return queue;
|
|
114460
114460
|
function push(value2) {
|
|
114461
|
-
var p = new Promise(function(
|
|
114461
|
+
var p = new Promise(function(resolve4, reject) {
|
|
114462
114462
|
pushCb(value2, function(err, result) {
|
|
114463
114463
|
if (err) {
|
|
114464
114464
|
reject(err);
|
|
114465
114465
|
return;
|
|
114466
114466
|
}
|
|
114467
|
-
|
|
114467
|
+
resolve4(result);
|
|
114468
114468
|
});
|
|
114469
114469
|
});
|
|
114470
114470
|
p.catch(noop3);
|
|
114471
114471
|
return p;
|
|
114472
114472
|
}
|
|
114473
114473
|
function unshift(value2) {
|
|
114474
|
-
var p = new Promise(function(
|
|
114474
|
+
var p = new Promise(function(resolve4, reject) {
|
|
114475
114475
|
unshiftCb(value2, function(err, result) {
|
|
114476
114476
|
if (err) {
|
|
114477
114477
|
reject(err);
|
|
114478
114478
|
return;
|
|
114479
114479
|
}
|
|
114480
|
-
|
|
114480
|
+
resolve4(result);
|
|
114481
114481
|
});
|
|
114482
114482
|
});
|
|
114483
114483
|
p.catch(noop3);
|
|
114484
114484
|
return p;
|
|
114485
114485
|
}
|
|
114486
114486
|
function drained() {
|
|
114487
|
-
var p = new Promise(function(
|
|
114487
|
+
var p = new Promise(function(resolve4) {
|
|
114488
114488
|
process.nextTick(function() {
|
|
114489
114489
|
if (queue.idle()) {
|
|
114490
|
-
|
|
114490
|
+
resolve4();
|
|
114491
114491
|
} else {
|
|
114492
114492
|
var previousDrain = queue.drain;
|
|
114493
114493
|
queue.drain = function() {
|
|
114494
114494
|
if (typeof previousDrain === "function") previousDrain();
|
|
114495
|
-
|
|
114495
|
+
resolve4();
|
|
114496
114496
|
queue.drain = previousDrain;
|
|
114497
114497
|
};
|
|
114498
114498
|
}
|
|
@@ -114989,9 +114989,9 @@ var require_stream3 = __commonJS({
|
|
|
114989
114989
|
});
|
|
114990
114990
|
}
|
|
114991
114991
|
_getStat(filepath) {
|
|
114992
|
-
return new Promise((
|
|
114992
|
+
return new Promise((resolve4, reject) => {
|
|
114993
114993
|
this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
|
114994
|
-
return error === null ?
|
|
114994
|
+
return error === null ? resolve4(stats) : reject(error);
|
|
114995
114995
|
});
|
|
114996
114996
|
});
|
|
114997
114997
|
}
|
|
@@ -115016,10 +115016,10 @@ var require_async5 = __commonJS({
|
|
|
115016
115016
|
this._readerStream = new stream_1.default(this._settings);
|
|
115017
115017
|
}
|
|
115018
115018
|
dynamic(root, options) {
|
|
115019
|
-
return new Promise((
|
|
115019
|
+
return new Promise((resolve4, reject) => {
|
|
115020
115020
|
this._walkAsync(root, options, (error, entries) => {
|
|
115021
115021
|
if (error === null) {
|
|
115022
|
-
|
|
115022
|
+
resolve4(entries);
|
|
115023
115023
|
} else {
|
|
115024
115024
|
reject(error);
|
|
115025
115025
|
}
|
|
@@ -115029,10 +115029,10 @@ var require_async5 = __commonJS({
|
|
|
115029
115029
|
async static(patterns, options) {
|
|
115030
115030
|
const entries = [];
|
|
115031
115031
|
const stream = this._readerStream.static(patterns, options);
|
|
115032
|
-
return new Promise((
|
|
115032
|
+
return new Promise((resolve4, reject) => {
|
|
115033
115033
|
stream.once("error", reject);
|
|
115034
115034
|
stream.on("data", (entry) => entries.push(entry));
|
|
115035
|
-
stream.once("end", () =>
|
|
115035
|
+
stream.once("end", () => resolve4(entries));
|
|
115036
115036
|
});
|
|
115037
115037
|
}
|
|
115038
115038
|
};
|
|
@@ -116159,7 +116159,7 @@ var require_ignore = __commonJS({
|
|
|
116159
116159
|
|
|
116160
116160
|
// src/index.ts
|
|
116161
116161
|
init_esm_shims();
|
|
116162
|
-
import { join as
|
|
116162
|
+
import { join as join9 } from "node:path";
|
|
116163
116163
|
|
|
116164
116164
|
// ../cli-app-definitions/src/index.ts
|
|
116165
116165
|
init_esm_shims();
|
|
@@ -123331,6 +123331,7 @@ var DASHBOARD_MENU_PLUGINS_DIR2 = join3(DASHBOARD_DIR2, "menu-plugins");
|
|
|
123331
123331
|
var DASHBOARD_MODALS_DIR2 = join3(DASHBOARD_DIR2, "modals");
|
|
123332
123332
|
var BACKEND_DIR2 = join3(EXTENSIONS_DIR, "backend");
|
|
123333
123333
|
var EVENTS_DIR2 = join3(BACKEND_DIR2, "events");
|
|
123334
|
+
var SERVICE_PLUGINS_DIR2 = join3(BACKEND_DIR2, "service-plugins");
|
|
123334
123335
|
|
|
123335
123336
|
// src/plugins/patchGlobal.ts
|
|
123336
123337
|
init_esm_shims();
|
|
@@ -123736,7 +123737,7 @@ var ecomShippingRatesSchema = z.object({
|
|
|
123736
123737
|
compData: z.object({
|
|
123737
123738
|
ecomShippingRates: z.object({
|
|
123738
123739
|
name: z.string(),
|
|
123739
|
-
deploymentUri: z.string(),
|
|
123740
|
+
deploymentUri: z.string().optional(),
|
|
123740
123741
|
description: z.string().optional(),
|
|
123741
123742
|
learnMoreUrl: z.string().url().optional(),
|
|
123742
123743
|
dashboardUrl: z.string().url().optional(),
|
|
@@ -123810,6 +123811,14 @@ var topologySchema2 = z.object({
|
|
|
123810
123811
|
})
|
|
123811
123812
|
})
|
|
123812
123813
|
}).passthrough();
|
|
123814
|
+
var servicePluginSchema = z.discriminatedUnion("compType", [
|
|
123815
|
+
ecomShippingRatesSchema,
|
|
123816
|
+
ecomAdditionalFeesSchema,
|
|
123817
|
+
ecomDiscountsTriggerSchema,
|
|
123818
|
+
ecomValidationsSchema,
|
|
123819
|
+
ecomPaymentSettingsSchema,
|
|
123820
|
+
ecomGiftCardsProviderSchema
|
|
123821
|
+
]);
|
|
123813
123822
|
var monitoringSchema = z.object({
|
|
123814
123823
|
compType: z.literal(ComponentType.MONITORING),
|
|
123815
123824
|
compId: z.string(),
|
|
@@ -124507,6 +124516,12 @@ async function createProjectModel() {
|
|
|
124507
124516
|
rootDir,
|
|
124508
124517
|
schema: webhookSchema
|
|
124509
124518
|
});
|
|
124519
|
+
const servicePlugins = await loadExtension({
|
|
124520
|
+
directory: SERVICE_PLUGINS_DIR2,
|
|
124521
|
+
fileName: "plugin",
|
|
124522
|
+
rootDir,
|
|
124523
|
+
schema: servicePluginSchema
|
|
124524
|
+
});
|
|
124510
124525
|
return {
|
|
124511
124526
|
app,
|
|
124512
124527
|
extensions: [
|
|
@@ -124514,7 +124529,8 @@ async function createProjectModel() {
|
|
|
124514
124529
|
...backofficeModals,
|
|
124515
124530
|
...backofficePages,
|
|
124516
124531
|
...backofficePlugins,
|
|
124517
|
-
...events
|
|
124532
|
+
...events,
|
|
124533
|
+
...servicePlugins
|
|
124518
124534
|
],
|
|
124519
124535
|
rootDir
|
|
124520
124536
|
};
|
|
@@ -124540,6 +124556,84 @@ function generateAppManifest(model) {
|
|
|
124540
124556
|
}
|
|
124541
124557
|
}
|
|
124542
124558
|
};
|
|
124559
|
+
case ComponentType.ECOM_ADDITIONAL_FEES:
|
|
124560
|
+
if (config.compData.ecomAdditionalFees.deploymentUri) {
|
|
124561
|
+
return config;
|
|
124562
|
+
}
|
|
124563
|
+
return {
|
|
124564
|
+
...config,
|
|
124565
|
+
compData: {
|
|
124566
|
+
ecomAdditionalFees: {
|
|
124567
|
+
...config.compData.ecomAdditionalFees,
|
|
124568
|
+
deploymentUri: `_wix/extensions/service-plugins/${config.compId}`
|
|
124569
|
+
}
|
|
124570
|
+
}
|
|
124571
|
+
};
|
|
124572
|
+
case ComponentType.ECOM_DISCOUNTS_TRIGGER:
|
|
124573
|
+
if (config.compData.ecomDiscountsTrigger.deploymentUri) {
|
|
124574
|
+
return config;
|
|
124575
|
+
}
|
|
124576
|
+
return {
|
|
124577
|
+
...config,
|
|
124578
|
+
compData: {
|
|
124579
|
+
ecomDiscountsTrigger: {
|
|
124580
|
+
...config.compData.ecomDiscountsTrigger,
|
|
124581
|
+
deploymentUri: `_wix/extensions/service-plugins/${config.compId}`
|
|
124582
|
+
}
|
|
124583
|
+
}
|
|
124584
|
+
};
|
|
124585
|
+
case ComponentType.ECOM_PAYMENT_SETTINGS:
|
|
124586
|
+
if (config.compData.ecomPaymentSettings.deploymentUri) {
|
|
124587
|
+
return config;
|
|
124588
|
+
}
|
|
124589
|
+
return {
|
|
124590
|
+
...config,
|
|
124591
|
+
compData: {
|
|
124592
|
+
ecomPaymentSettings: {
|
|
124593
|
+
...config.compData.ecomPaymentSettings,
|
|
124594
|
+
deploymentUri: `_wix/extensions/service-plugins/${config.compId}`
|
|
124595
|
+
}
|
|
124596
|
+
}
|
|
124597
|
+
};
|
|
124598
|
+
case ComponentType.ECOM_SHIPPING_RATES:
|
|
124599
|
+
if (config.compData.ecomShippingRates.deploymentUri) {
|
|
124600
|
+
return config;
|
|
124601
|
+
}
|
|
124602
|
+
return {
|
|
124603
|
+
...config,
|
|
124604
|
+
compData: {
|
|
124605
|
+
ecomShippingRates: {
|
|
124606
|
+
...config.compData.ecomShippingRates,
|
|
124607
|
+
deploymentUri: `_wix/extensions/service-plugins/${config.compId}`
|
|
124608
|
+
}
|
|
124609
|
+
}
|
|
124610
|
+
};
|
|
124611
|
+
case ComponentType.ECOM_VALIDATIONS:
|
|
124612
|
+
if (config.compData.ecomValidations.deploymentUri) {
|
|
124613
|
+
return config;
|
|
124614
|
+
}
|
|
124615
|
+
return {
|
|
124616
|
+
...config,
|
|
124617
|
+
compData: {
|
|
124618
|
+
ecomValidations: {
|
|
124619
|
+
...config.compData.ecomValidations,
|
|
124620
|
+
deploymentUri: `_wix/extensions/service-plugins/${config.compId}`
|
|
124621
|
+
}
|
|
124622
|
+
}
|
|
124623
|
+
};
|
|
124624
|
+
case ComponentType.GIFT_CARDS_PROVIDER:
|
|
124625
|
+
if (config.compData.giftCardsProvider.deploymentUri) {
|
|
124626
|
+
return config;
|
|
124627
|
+
}
|
|
124628
|
+
return {
|
|
124629
|
+
...config,
|
|
124630
|
+
compData: {
|
|
124631
|
+
giftCardsProvider: {
|
|
124632
|
+
...config.compData.giftCardsProvider,
|
|
124633
|
+
deploymentUri: `_wix/extensions/service-plugins/${config.compId}`
|
|
124634
|
+
}
|
|
124635
|
+
}
|
|
124636
|
+
};
|
|
124543
124637
|
case ComponentType.WEBHOOK:
|
|
124544
124638
|
if (config.compData.webhook.callbackUrl) {
|
|
124545
124639
|
return config;
|
|
@@ -124566,6 +124660,12 @@ function isValidBackofficeComponent(component) {
|
|
|
124566
124660
|
return component.compType === ComponentType.BACK_OFFICE_PAGE && !component.compData.backOfficePage.iframeUrl || component.compType === ComponentType.BACK_OFFICE_EXTENSION_WIDGET && !component.compData.backOfficeExtensionWidget.iframeUrl || component.compType === ComponentType.BACK_OFFICE_EXTENSION_MENU_ITEM && !component.compData.backOfficeExtensionMenuItem.iframeUrl || component.compType === ComponentType.BACK_OFFICE_MODAL && !component.compData.backOfficeModal.iframeUrl;
|
|
124567
124661
|
}
|
|
124568
124662
|
|
|
124663
|
+
// src/utils/isValidServicePluginComponent.ts
|
|
124664
|
+
init_esm_shims();
|
|
124665
|
+
function isValidServicePluginComponent(component) {
|
|
124666
|
+
return component.compType === ComponentType.ECOM_SHIPPING_RATES && !component.compData.ecomShippingRates.deploymentUri || component.compType === ComponentType.ECOM_ADDITIONAL_FEES && !component.compData.ecomAdditionalFees.deploymentUri || component.compType === ComponentType.ECOM_DISCOUNTS_TRIGGER && !component.compData.ecomDiscountsTrigger.deploymentUri || component.compType === ComponentType.ECOM_VALIDATIONS && !component.compData.ecomValidations.deploymentUri || component.compType === ComponentType.ECOM_PAYMENT_SETTINGS && !component.compData.ecomPaymentSettings.deploymentUri || component.compType === ComponentType.GIFT_CARDS_PROVIDER && !component.compData.giftCardsProvider.deploymentUri;
|
|
124667
|
+
}
|
|
124668
|
+
|
|
124569
124669
|
// src/utils/isValidWebhookComponent.ts
|
|
124570
124670
|
init_esm_shims();
|
|
124571
124671
|
function isValidWebhookComponent(component) {
|
|
@@ -124617,10 +124717,68 @@ async function writeVirtualBackofficeExtensionFiles(model, codegenDir) {
|
|
|
124617
124717
|
}
|
|
124618
124718
|
}
|
|
124619
124719
|
|
|
124620
|
-
// src/utils/
|
|
124720
|
+
// src/utils/writeVirtualServicePluginExtensionFiles.ts
|
|
124621
124721
|
init_esm_shims();
|
|
124622
124722
|
import { rm as rm2, writeFile as writeFile3 } from "node:fs/promises";
|
|
124623
124723
|
import { join as join7, resolve as resolve2 } from "node:path";
|
|
124724
|
+
async function writeVirtualServicePluginExtensionFiles(model, codegenDir) {
|
|
124725
|
+
const servicePluginExtensions = model.extensions.filter(
|
|
124726
|
+
(extension) => isValidServicePluginComponent(extension.config)
|
|
124727
|
+
);
|
|
124728
|
+
const existingFiles = await globby(`*.ts`, {
|
|
124729
|
+
cwd: codegenDir,
|
|
124730
|
+
onlyFiles: true
|
|
124731
|
+
});
|
|
124732
|
+
for (const filename of existingFiles) {
|
|
124733
|
+
const hasMatchingSourceFile = servicePluginExtensions.some(
|
|
124734
|
+
(extension) => `${extension.config.compId}.ts` === filename
|
|
124735
|
+
);
|
|
124736
|
+
if (hasMatchingSourceFile) {
|
|
124737
|
+
continue;
|
|
124738
|
+
}
|
|
124739
|
+
await rm2(join7(codegenDir, filename));
|
|
124740
|
+
}
|
|
124741
|
+
for (const extension of servicePluginExtensions) {
|
|
124742
|
+
const originalEntrypoint = resolve2(extension.cwd, "plugin.ts");
|
|
124743
|
+
const virtualEntrypoint = join7(codegenDir, `${extension.config.compId}.ts`);
|
|
124744
|
+
await writeFile3(
|
|
124745
|
+
virtualEntrypoint,
|
|
124746
|
+
defaultOutdent`
|
|
124747
|
+
import type { APIRoute } from 'astro';
|
|
124748
|
+
import { AppStrategy, createClient } from '@wix/sdk';
|
|
124749
|
+
import { WIX_CLIENT_ID } from 'astro:env/client';
|
|
124750
|
+
import { WIX_CLIENT_PUBLIC_KEY, WIX_CLIENT_SECRET } from 'astro:env/server';
|
|
124751
|
+
|
|
124752
|
+
const client = createClient({
|
|
124753
|
+
auth: AppStrategy({
|
|
124754
|
+
appId: WIX_CLIENT_ID,
|
|
124755
|
+
appSecret: WIX_CLIENT_SECRET,
|
|
124756
|
+
publicKey: WIX_CLIENT_PUBLIC_KEY,
|
|
124757
|
+
}),
|
|
124758
|
+
});
|
|
124759
|
+
|
|
124760
|
+
const olderClient = globalThis.__wix_context__.client;
|
|
124761
|
+
|
|
124762
|
+
client.enableContext('global');
|
|
124763
|
+
|
|
124764
|
+
await import('${originalEntrypoint}');
|
|
124765
|
+
|
|
124766
|
+
if (olderClient) {
|
|
124767
|
+
olderClient.enableContext('global');
|
|
124768
|
+
}
|
|
124769
|
+
|
|
124770
|
+
export const ALL: APIRoute = async (context) => {
|
|
124771
|
+
return await client.servicePlugins.processRequest(context.request);
|
|
124772
|
+
};
|
|
124773
|
+
`
|
|
124774
|
+
);
|
|
124775
|
+
}
|
|
124776
|
+
}
|
|
124777
|
+
|
|
124778
|
+
// src/utils/writeVirtualWebhookExtensionFiles.ts
|
|
124779
|
+
init_esm_shims();
|
|
124780
|
+
import { rm as rm3, writeFile as writeFile4 } from "node:fs/promises";
|
|
124781
|
+
import { join as join8, resolve as resolve3 } from "node:path";
|
|
124624
124782
|
async function writeVirtualWebhookExtensionFiles(model, codegenDir) {
|
|
124625
124783
|
const webhookExtensions = model.extensions.filter(
|
|
124626
124784
|
(extension) => isValidWebhookComponent(extension.config)
|
|
@@ -124636,12 +124794,12 @@ async function writeVirtualWebhookExtensionFiles(model, codegenDir) {
|
|
|
124636
124794
|
if (hasMatchingSourceFile) {
|
|
124637
124795
|
continue;
|
|
124638
124796
|
}
|
|
124639
|
-
await
|
|
124797
|
+
await rm3(join8(codegenDir, filename));
|
|
124640
124798
|
}
|
|
124641
124799
|
for (const extension of webhookExtensions) {
|
|
124642
|
-
const originalEntrypoint =
|
|
124643
|
-
const virtualEntrypoint =
|
|
124644
|
-
await
|
|
124800
|
+
const originalEntrypoint = resolve3(extension.cwd, "event.ts");
|
|
124801
|
+
const virtualEntrypoint = join8(codegenDir, `${extension.config.compId}.ts`);
|
|
124802
|
+
await writeFile4(
|
|
124645
124803
|
virtualEntrypoint,
|
|
124646
124804
|
defaultOutdent`
|
|
124647
124805
|
import type { APIRoute } from 'astro';
|
|
@@ -124685,13 +124843,13 @@ var createIntegration = () => {
|
|
|
124685
124843
|
async "astro:build:done"() {
|
|
124686
124844
|
model ??= await createProjectModel();
|
|
124687
124845
|
const appManifest = generateAppManifest(model);
|
|
124688
|
-
const appManifestPath =
|
|
124846
|
+
const appManifestPath = join9(
|
|
124689
124847
|
_config.outDir.pathname,
|
|
124690
124848
|
"_wix/app-manifest.json"
|
|
124691
124849
|
);
|
|
124692
124850
|
await writeJson(appManifestPath, appManifest);
|
|
124693
124851
|
await writeJson(
|
|
124694
|
-
|
|
124852
|
+
join9(_config.root.pathname, GIT_IGNORED_DIR, "build-metadata.json"),
|
|
124695
124853
|
{
|
|
124696
124854
|
appManifestPath,
|
|
124697
124855
|
clientDir: _config.build.client.pathname,
|
|
@@ -124810,7 +124968,7 @@ var createIntegration = () => {
|
|
|
124810
124968
|
plugins: [patchGlobal()]
|
|
124811
124969
|
}
|
|
124812
124970
|
});
|
|
124813
|
-
const webhookCodegenDir =
|
|
124971
|
+
const webhookCodegenDir = join9(codegenDir, "extensions/webhooks");
|
|
124814
124972
|
await outputDir(webhookCodegenDir);
|
|
124815
124973
|
if (command === "dev") {
|
|
124816
124974
|
injectRoute({
|
|
@@ -124834,7 +124992,7 @@ var createIntegration = () => {
|
|
|
124834
124992
|
(extension) => isValidWebhookComponent(extension.config)
|
|
124835
124993
|
);
|
|
124836
124994
|
for (const extension of webhookExtensions) {
|
|
124837
|
-
const virtualEntrypoint =
|
|
124995
|
+
const virtualEntrypoint = join9(
|
|
124838
124996
|
webhookCodegenDir,
|
|
124839
124997
|
`${extension.config.compId}.ts`
|
|
124840
124998
|
);
|
|
@@ -124845,7 +125003,51 @@ var createIntegration = () => {
|
|
|
124845
125003
|
}
|
|
124846
125004
|
}
|
|
124847
125005
|
await writeVirtualWebhookExtensionFiles(model, webhookCodegenDir);
|
|
124848
|
-
const
|
|
125006
|
+
const servicePluginCodegenDir = join9(
|
|
125007
|
+
codegenDir,
|
|
125008
|
+
"extensions/service-plugins"
|
|
125009
|
+
);
|
|
125010
|
+
await outputDir(servicePluginCodegenDir);
|
|
125011
|
+
if (command === "dev") {
|
|
125012
|
+
injectRoute({
|
|
125013
|
+
entrypoint: new URL(
|
|
125014
|
+
"../build-runtime/routes/service-plugins.js",
|
|
125015
|
+
import.meta.url
|
|
125016
|
+
),
|
|
125017
|
+
pattern: `/_wix/extensions/service-plugins/[compId]`,
|
|
125018
|
+
prerender: false
|
|
125019
|
+
});
|
|
125020
|
+
import_chokidar.default.watch([SERVICE_PLUGINS_DIR2], {
|
|
125021
|
+
cwd: config.root.pathname,
|
|
125022
|
+
ignoreInitial: true,
|
|
125023
|
+
useFsEvents: false
|
|
125024
|
+
}).on("all", async () => {
|
|
125025
|
+
model = await createProjectModel();
|
|
125026
|
+
await writeVirtualServicePluginExtensionFiles(
|
|
125027
|
+
model,
|
|
125028
|
+
servicePluginCodegenDir
|
|
125029
|
+
);
|
|
125030
|
+
});
|
|
125031
|
+
} else {
|
|
125032
|
+
const servicePluginExtensions = model.extensions.filter(
|
|
125033
|
+
(extension) => isValidServicePluginComponent(extension.config)
|
|
125034
|
+
);
|
|
125035
|
+
for (const extension of servicePluginExtensions) {
|
|
125036
|
+
const virtualEntrypoint = join9(
|
|
125037
|
+
servicePluginCodegenDir,
|
|
125038
|
+
`${extension.config.compId}.ts`
|
|
125039
|
+
);
|
|
125040
|
+
injectRoute({
|
|
125041
|
+
entrypoint: virtualEntrypoint,
|
|
125042
|
+
pattern: `/_wix/extensions/service-plugins/${extension.config.compId}`
|
|
125043
|
+
});
|
|
125044
|
+
}
|
|
125045
|
+
}
|
|
125046
|
+
await writeVirtualServicePluginExtensionFiles(
|
|
125047
|
+
model,
|
|
125048
|
+
servicePluginCodegenDir
|
|
125049
|
+
);
|
|
125050
|
+
const backofficeCodegenDir = join9(codegenDir, "extensions/backoffice");
|
|
124849
125051
|
await outputDir(backofficeCodegenDir);
|
|
124850
125052
|
if (command === "dev") {
|
|
124851
125053
|
injectRoute({
|
|
@@ -124877,7 +125079,7 @@ var createIntegration = () => {
|
|
|
124877
125079
|
(extension) => isValidBackofficeComponent(extension.config)
|
|
124878
125080
|
);
|
|
124879
125081
|
for (const extension of backofficeExtensions) {
|
|
124880
|
-
const virtualEntrypoint =
|
|
125082
|
+
const virtualEntrypoint = join9(
|
|
124881
125083
|
backofficeCodegenDir,
|
|
124882
125084
|
`${extension.config.compId}.astro`
|
|
124883
125085
|
);
|