@wix/astro 1.0.1 → 1.0.2

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 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((resolve2, reject) => {
1228
+ return new Promise((resolve3, 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
- resolve2();
1237
+ resolve3();
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
- resolve2(stdout);
1244
+ resolve3(stdout);
1245
1245
  }
1246
1246
  });
1247
1247
  }
@@ -37676,7 +37676,7 @@ ${rootStack}`;
37676
37676
  }
37677
37677
  url.path = path3;
37678
37678
  }
37679
- function resolve2(input, base) {
37679
+ function resolve3(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 resolve2;
37726
+ return resolve3;
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 resolve2(input, base) {
37737
+ function resolve3(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 = resolve2(sourceRoot || "", stripFilename(mapUrl));
37990
- this.resolvedSources = sources.map((s) => resolve2(s || "", from));
37989
+ const from = resolve3(sourceRoot || "", stripFilename(mapUrl));
37990
+ this.resolvedSources = sources.map((s) => resolve3(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 = resolve2;
46387
+ exports2.resolve = resolve3;
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 resolve2(dangerous, resolved) {
46649
+ function resolve3(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, resolve2, reject) {
51283
+ async: function(args, resolve3, reject) {
51284
51284
  const items = Array.from(args[0]);
51285
51285
  if (items.length === 0) {
51286
- Promise.resolve().then(() => resolve2([]));
51286
+ Promise.resolve().then(() => resolve3([]));
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) resolve2(results);
51297
+ if (count === results.length) resolve3(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, resolve2, reject) {
51314
+ async: function(args, resolve3, 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, resolve2, reject);
51320
+ evaluateAsync(item, resolve3, 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((resolve2, reject) => {
51333
- evaluateAsync(genFn.apply(this, args), resolve2, reject);
51332
+ return new Promise((resolve3, reject) => {
51333
+ evaluateAsync(genFn.apply(this, args), resolve3, 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, resolve2, reject) {
51431
+ async: function(args, resolve3, reject) {
51432
51432
  if (async) {
51433
- async.apply(this, args).then(resolve2, reject);
51433
+ async.apply(this, args).then(resolve3, reject);
51434
51434
  } else if (errback) {
51435
51435
  errback.call(this, ...args, (err, value2) => {
51436
- if (err == null) resolve2(value2);
51436
+ if (err == null) resolve3(value2);
51437
51437
  else reject(err);
51438
51438
  });
51439
51439
  } else {
51440
- resolve2(sync.apply(this, args));
51440
+ resolve3(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, resolve2, reject) {
51491
+ function evaluateAsync(gen, resolve3, 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 resolve2(value2);
51512
+ return resolve3(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((resolve2) => {
51971
- this._resolve = resolve2;
51970
+ this.promise = new Promise((resolve3) => {
51971
+ this._resolve = resolve3;
51972
51972
  });
51973
51973
  }
51974
51974
  release(value2) {
@@ -53500,9 +53500,9 @@ ${" ".repeat(indentSize)}`);
53500
53500
  };
53501
53501
  }
53502
53502
  } else {
53503
- let resolve2, reject;
53503
+ let resolve3, reject;
53504
53504
  resultP = new Promise((res, rej) => {
53505
- resolve2 = res;
53505
+ resolve3 = 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) resolve2(result.value);
53514
+ if (promiseReferenced) resolve3(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 resolve2(queries, context) {
54649
+ function resolve3(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(resolve2(queries, context)).sort(function(name1, name2) {
54736
+ var result = uniq(resolve3(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(resolve2, context)];
55333
+ return [env2.currentNode(resolve3, 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 resolve2(queries, context);
55346
+ return resolve3(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 resolve2(env2.loadQueries(context, node.config), context);
55404
+ return resolve3(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 resolve2(browserslist.defaults, context);
55411
+ return resolve3(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 resolve2(dead, context);
55426
+ return resolve3(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 = resolve2;
69130
+ exports2.resolve = resolve3;
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 resolve2(specifier, parent) {
70173
+ function resolve3(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((resolve2, reject) => {
74130
+ return new Promise((resolve3, reject) => {
74131
74131
  const files = [];
74132
- readdirp(root2, options).on("data", (entry) => files.push(entry)).on("end", () => resolve2(files)).on("error", (error) => reject(error));
74132
+ readdirp(root2, options).on("data", (entry) => files.push(entry)).on("end", () => resolve3(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
- (resolve2) => stream.once(STR_END, () => {
77673
+ (resolve3) => 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
- resolve2();
77679
+ resolve3();
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 resolve2(input, base) {
87683
+ function resolve3(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 resolve2(input, base);
87712
+ return resolve3(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, resolve2, ...args) => {
88911
+ const run = async (fn, resolve3, ...args) => {
88912
88912
  activeCount++;
88913
88913
  const result = (async () => fn(...args))();
88914
- resolve2(result);
88914
+ resolve3(result);
88915
88915
  try {
88916
88916
  await result;
88917
88917
  } catch {
88918
88918
  }
88919
88919
  next();
88920
88920
  };
88921
- const enqueue = (fn, resolve2, ...args) => {
88922
- queue.enqueue(run.bind(null, fn, resolve2, ...args));
88921
+ const enqueue = (fn, resolve3, ...args) => {
88922
+ queue.enqueue(run.bind(null, fn, resolve3, ...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((resolve2) => {
88931
- enqueue(fn, resolve2, ...args);
88930
+ const generator = (fn, ...args) => new Promise((resolve3) => {
88931
+ enqueue(fn, resolve3, ...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((resolve2, reject) => {
92848
+ return new Promise((resolve3, reject) => {
92849
92849
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
92850
92850
  this.on("error", (er) => reject(er));
92851
- this.on("end", () => resolve2());
92851
+ this.on("end", () => resolve3());
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 resolve2;
92875
+ let resolve3;
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
- resolve2({ value: value2, done: !!this[EOF] });
92889
+ resolve3({ 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
- resolve2({ done: true, value: void 0 });
92896
+ resolve3({ 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
- resolve2 = res2;
92901
+ resolve3 = 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 resolve2 = () => {
93911
+ let resolve3 = () => {
93912
93912
  };
93913
- this.#asyncReaddirInFlight = new Promise((res) => resolve2 = res);
93913
+ this.#asyncReaddirInFlight = new Promise((res) => resolve3 = 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
- resolve2();
93926
+ resolve3();
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((resolve2, reject) => {
95368
+ return new Promise((resolve3, reject) => {
95369
95369
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
95370
95370
  this.on("error", (er) => reject(er));
95371
- this.on("end", () => resolve2());
95371
+ this.on("end", () => resolve3());
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 resolve2 = null;
95387
+ let resolve3 = 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
- resolve2({ value: value2, done: !!this[EOF] });
95401
+ resolve3({ 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
- resolve2({ done: true });
95408
+ resolve3({ 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
- resolve2 = res2;
95413
+ resolve3 = 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, resolve2, reject) {
96898
+ function invoke(method, arg, resolve3, 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, resolve2, reject);
96903
+ invoke("next", value3, resolve3, reject);
96904
96904
  }, function(err) {
96905
- invoke("throw", err, resolve2, reject);
96905
+ invoke("throw", err, resolve3, reject);
96906
96906
  }) : PromiseImpl.resolve(value2).then(function(unwrapped) {
96907
- result.value = unwrapped, resolve2(result);
96907
+ result.value = unwrapped, resolve3(result);
96908
96908
  }, function(error) {
96909
- return invoke("throw", error, resolve2, reject);
96909
+ return invoke("throw", error, resolve3, 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(resolve2, reject) {
96919
- invoke(method, arg, resolve2, reject);
96918
+ return new PromiseImpl(function(resolve3, reject) {
96919
+ invoke(method, arg, resolve3, 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, resolve2, reject, _next, _throw, key2, arg) {
97131
+ function asyncGeneratorStep(gen, resolve3, 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
- resolve2(value2);
97140
+ resolve3(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(resolve2, reject) {
97148
+ return new Promise(function(resolve3, reject) {
97149
97149
  var gen = fn.apply(self2, args);
97150
97150
  function _next(value2) {
97151
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value2);
97151
+ asyncGeneratorStep(gen, resolve3, reject, _next, _throw, "next", value2);
97152
97152
  }
97153
97153
  function _throw(err) {
97154
- asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
97154
+ asyncGeneratorStep(gen, resolve3, 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((resolve2) => {
98280
- resolve2(value2);
98279
+ return new SyncPromise((resolve3) => {
98280
+ resolve3(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((resolve2, reject) => {
98304
+ return new _SyncPromise((resolve3, reject) => {
98305
98305
  this._handlers.push([
98306
98306
  false,
98307
98307
  (result) => {
98308
98308
  if (!onfulfilled) {
98309
- resolve2(result);
98309
+ resolve3(result);
98310
98310
  } else {
98311
98311
  try {
98312
- resolve2(onfulfilled(result));
98312
+ resolve3(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
- resolve2(onrejected(reason));
98323
+ resolve3(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((resolve2, reject) => {
98339
+ return new _SyncPromise((resolve3, 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
- resolve2(val);
98362
+ resolve3(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((resolve2, reject) => {
98440
+ return new SyncPromise((resolve3, reject) => {
98441
98441
  let counter = buffer2.length;
98442
98442
  if (!counter) {
98443
- return resolve2(true);
98443
+ return resolve3(true);
98444
98444
  }
98445
98445
  const capturedSetTimeout = setTimeout(() => {
98446
98446
  if (timeout && timeout > 0) {
98447
- resolve2(false);
98447
+ resolve3(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
- resolve2(true);
98454
+ resolve3(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((resolve2, reject) => {
100651
+ return new SyncPromise((resolve3, reject) => {
100652
100652
  const processor = processors[index];
100653
100653
  if (event === null || typeof processor !== "function") {
100654
- resolve2(event);
100654
+ resolve3(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(resolve2)).then(null, reject);
100659
+ void result.then((final) => notifyEventProcessors(processors, final, hint, index + 1).then(resolve3)).then(null, reject);
100660
100660
  } else {
100661
- void notifyEventProcessors(processors, result, hint, index + 1).then(resolve2).then(null, reject);
100661
+ void notifyEventProcessors(processors, result, hint, index + 1).then(resolve3).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((resolve2) => {
101438
+ return new SyncPromise((resolve3) => {
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
- resolve2(true);
101444
+ resolve3(true);
101445
101445
  } else {
101446
101446
  ticked += tick;
101447
101447
  if (timeout && ticked >= timeout) {
101448
101448
  clearInterval(interval);
101449
- resolve2(false);
101449
+ resolve3(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(resolve2, reject) {
102030
+ return new Promise(function(resolve3, 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
- resolve2({
102054
+ resolve3({
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(resolve2) {
103114
+ return new Promise(function(resolve3) {
103115
103115
  sourcemapFileDependencySubscribers.push(function() {
103116
103116
  if (dependenciesOnSourcemapFiles.size === 0) {
103117
- resolve2();
103117
+ resolve3();
103118
103118
  }
103119
103119
  });
103120
103120
  if (dependenciesOnSourcemapFiles.size === 0) {
103121
- resolve2();
103121
+ resolve3();
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((resolve2, reject) => {
106337
+ return new Promise((resolve3, reject) => {
106338
106338
  const files = [];
106339
- readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve2(files)).on("error", (error) => reject(error));
106339
+ readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve3(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
- (resolve2) => stream.once(STR_END, () => {
109954
+ (resolve3) => 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
- resolve2();
109960
+ resolve3();
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(resolve2, reject) {
114461
+ var p = new Promise(function(resolve3, reject) {
114462
114462
  pushCb(value2, function(err, result) {
114463
114463
  if (err) {
114464
114464
  reject(err);
114465
114465
  return;
114466
114466
  }
114467
- resolve2(result);
114467
+ resolve3(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(resolve2, reject) {
114474
+ var p = new Promise(function(resolve3, reject) {
114475
114475
  unshiftCb(value2, function(err, result) {
114476
114476
  if (err) {
114477
114477
  reject(err);
114478
114478
  return;
114479
114479
  }
114480
- resolve2(result);
114480
+ resolve3(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(resolve2) {
114487
+ var p = new Promise(function(resolve3) {
114488
114488
  process.nextTick(function() {
114489
114489
  if (queue.idle()) {
114490
- resolve2();
114490
+ resolve3();
114491
114491
  } else {
114492
114492
  var previousDrain = queue.drain;
114493
114493
  queue.drain = function() {
114494
114494
  if (typeof previousDrain === "function") previousDrain();
114495
- resolve2();
114495
+ resolve3();
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((resolve2, reject) => {
114992
+ return new Promise((resolve3, reject) => {
114993
114993
  this._stat(filepath, this._fsStatSettings, (error, stats) => {
114994
- return error === null ? resolve2(stats) : reject(error);
114994
+ return error === null ? resolve3(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((resolve2, reject) => {
115019
+ return new Promise((resolve3, reject) => {
115020
115020
  this._walkAsync(root, options, (error, entries) => {
115021
115021
  if (error === null) {
115022
- resolve2(entries);
115022
+ resolve3(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((resolve2, reject) => {
115032
+ return new Promise((resolve3, reject) => {
115033
115033
  stream.once("error", reject);
115034
115034
  stream.on("data", (entry) => entries.push(entry));
115035
- stream.once("end", () => resolve2(entries));
115035
+ stream.once("end", () => resolve3(entries));
115036
115036
  });
115037
115037
  }
115038
115038
  };
@@ -123309,6 +123309,8 @@ var DASHBOARD_PAGES_DIR2 = join3(DASHBOARD_DIR2, "pages");
123309
123309
  var DASHBOARD_PLUGINS_DIR2 = join3(DASHBOARD_DIR2, "plugins");
123310
123310
  var DASHBOARD_MENU_PLUGINS_DIR2 = join3(DASHBOARD_DIR2, "menu-plugins");
123311
123311
  var DASHBOARD_MODALS_DIR2 = join3(DASHBOARD_DIR2, "modals");
123312
+ var BACKEND_DIR2 = join3(EXTENSIONS_DIR, "backend");
123313
+ var EVENTS_DIR2 = join3(BACKEND_DIR2, "events");
123312
123314
 
123313
123315
  // src/plugins/patchGlobal.ts
123314
123316
  init_esm_shims();
@@ -123703,7 +123705,7 @@ var webhookSchema = z.object({
123703
123705
  compData: z.object({
123704
123706
  webhook: z.object({
123705
123707
  webhookSlug: z.string(),
123706
- callbackUrl: z.string()
123708
+ callbackUrl: z.string().optional()
123707
123709
  })
123708
123710
  })
123709
123711
  }).passthrough();
@@ -124479,13 +124481,20 @@ async function createProjectModel() {
124479
124481
  rootDir,
124480
124482
  schema: backofficeModalSchema
124481
124483
  });
124484
+ const events = await loadExtension({
124485
+ directory: EVENTS_DIR2,
124486
+ fileName: "event",
124487
+ rootDir,
124488
+ schema: webhookSchema
124489
+ });
124482
124490
  return {
124483
124491
  app,
124484
124492
  extensions: [
124485
124493
  ...backofficeMenuItems,
124486
124494
  ...backofficeModals,
124487
124495
  ...backofficePages,
124488
- ...backofficePlugins
124496
+ ...backofficePlugins,
124497
+ ...events
124489
124498
  ],
124490
124499
  rootDir
124491
124500
  };
@@ -124493,7 +124502,6 @@ async function createProjectModel() {
124493
124502
 
124494
124503
  // src/utils/generateAppManifest.ts
124495
124504
  init_esm_shims();
124496
- import { join as join6 } from "node:path";
124497
124505
  function generateAppManifest(model) {
124498
124506
  return {
124499
124507
  appId: model.app.appId,
@@ -124508,7 +124516,20 @@ function generateAppManifest(model) {
124508
124516
  compData: {
124509
124517
  backOfficePage: {
124510
124518
  ...config.compData.backOfficePage,
124511
- iframeUrl: join6("_wix/backoffice-extensions", config.compId)
124519
+ iframeUrl: `_wix/extensions/backoffice/${config.compId}`
124520
+ }
124521
+ }
124522
+ };
124523
+ case ComponentType.WEBHOOK:
124524
+ if (config.compData.webhook.callbackUrl) {
124525
+ return config;
124526
+ }
124527
+ return {
124528
+ ...config,
124529
+ compData: {
124530
+ webhook: {
124531
+ ...config.compData.webhook,
124532
+ callbackUrl: `_wix/extensions/webhooks/${config.compId}`
124512
124533
  }
124513
124534
  }
124514
124535
  };
@@ -124525,33 +124546,39 @@ function isValidBackofficeComponent(component) {
124525
124546
  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;
124526
124547
  }
124527
124548
 
124528
- // src/utils/writeVirtualExtensionFiles.ts
124549
+ // src/utils/isValidWebhookComponent.ts
124550
+ init_esm_shims();
124551
+ function isValidWebhookComponent(component) {
124552
+ return component.compType === ComponentType.WEBHOOK && !component.compData.webhook.callbackUrl;
124553
+ }
124554
+
124555
+ // src/utils/writeVirtualBackofficeExtensionFiles.ts
124529
124556
  init_esm_shims();
124530
124557
  import { rm, writeFile as writeFile2 } from "node:fs/promises";
124531
- import { join as join7, resolve } from "node:path";
124532
- async function writeVirtualExtensionFiles(model, codegenDir) {
124558
+ import { join as join6, resolve } from "node:path";
124559
+ async function writeVirtualBackofficeExtensionFiles(model, codegenDir) {
124560
+ const backofficeExtensions = model.extensions.filter(
124561
+ (extension) => isValidBackofficeComponent(extension.config)
124562
+ );
124533
124563
  const existingFiles = await globby(`*.astro`, {
124534
124564
  cwd: codegenDir,
124535
124565
  onlyFiles: true
124536
124566
  });
124537
124567
  for (const filename of existingFiles) {
124538
- const hasMatchingSourceFile = model.extensions.some(
124568
+ const hasMatchingSourceFile = backofficeExtensions.some(
124539
124569
  (extension) => `${extension.config.compId}.astro` === filename
124540
124570
  );
124541
124571
  if (hasMatchingSourceFile) {
124542
124572
  continue;
124543
124573
  }
124544
- await rm(join7(codegenDir, filename));
124574
+ await rm(join6(codegenDir, filename));
124545
124575
  }
124546
- const backofficeExtensions = model.extensions.filter(
124547
- (extension) => isValidBackofficeComponent(extension.config)
124548
- );
124549
124576
  for (const extension of backofficeExtensions) {
124550
124577
  const originalEntrypoint = resolve(
124551
124578
  model.rootDir,
124552
124579
  extension.componentFilePath
124553
124580
  );
124554
- const virtualEntrypoint = join7(
124581
+ const virtualEntrypoint = join6(
124555
124582
  codegenDir,
124556
124583
  `${extension.config.compId}.astro`
124557
124584
  );
@@ -124562,7 +124589,68 @@ async function writeVirtualExtensionFiles(model, codegenDir) {
124562
124589
  import Component from '${originalEntrypoint}';
124563
124590
  ---
124564
124591
 
124565
- <Component client:only="react" />
124592
+ <div>
124593
+ <Component client:only="react" />
124594
+ </div>
124595
+ `
124596
+ );
124597
+ }
124598
+ }
124599
+
124600
+ // src/utils/writeVirtualWebhookExtensionFiles.ts
124601
+ init_esm_shims();
124602
+ import { rm as rm2, writeFile as writeFile3 } from "node:fs/promises";
124603
+ import { join as join7, resolve as resolve2 } from "node:path";
124604
+ async function writeVirtualWebhookExtensionFiles(model, codegenDir) {
124605
+ const webhookExtensions = model.extensions.filter(
124606
+ (extension) => isValidWebhookComponent(extension.config)
124607
+ );
124608
+ const existingFiles = await globby(`*.ts`, {
124609
+ cwd: codegenDir,
124610
+ onlyFiles: true
124611
+ });
124612
+ for (const filename of existingFiles) {
124613
+ const hasMatchingSourceFile = webhookExtensions.some(
124614
+ (extension) => `${extension.config.compId}.ts` === filename
124615
+ );
124616
+ if (hasMatchingSourceFile) {
124617
+ continue;
124618
+ }
124619
+ await rm2(join7(codegenDir, filename));
124620
+ }
124621
+ for (const extension of webhookExtensions) {
124622
+ const originalEntrypoint = resolve2(extension.cwd, "event.ts");
124623
+ const virtualEntrypoint = join7(codegenDir, `${extension.config.compId}.ts`);
124624
+ await writeFile3(
124625
+ virtualEntrypoint,
124626
+ defaultOutdent`
124627
+ import type { APIRoute } from 'astro';
124628
+ import { AppStrategy, createClient } from '@wix/sdk';
124629
+ import { WIX_CLIENT_ID } from 'astro:env/client';
124630
+ import { WIX_CLIENT_PUBLIC_KEY, WIX_CLIENT_SECRET } from 'astro:env/server';
124631
+
124632
+ const client = createClient({
124633
+ auth: AppStrategy({
124634
+ appId: WIX_CLIENT_ID,
124635
+ appSecret: WIX_CLIENT_SECRET,
124636
+ publicKey: WIX_CLIENT_PUBLIC_KEY,
124637
+ }),
124638
+ });
124639
+
124640
+ const olderClient = globalThis.__wix_context__.client;
124641
+
124642
+ client.enableContext('global');
124643
+
124644
+ await import('${originalEntrypoint}');
124645
+
124646
+ if (olderClient) {
124647
+ olderClient.enableContext('global');
124648
+ }
124649
+
124650
+ export const ALL: APIRoute = async (context) => {
124651
+ await client.webhooks.processRequest(context.request);
124652
+ return new Response('OK');
124653
+ };
124566
124654
  `
124567
124655
  );
124568
124656
  }
@@ -124602,6 +124690,7 @@ var createIntegration = () => {
124602
124690
  logger,
124603
124691
  updateConfig
124604
124692
  }) {
124693
+ const { pathname: codegenDir } = createCodegenDir();
124605
124694
  model ??= await createProjectModel();
124606
124695
  injectScript(
124607
124696
  "before-hydration",
@@ -124638,7 +124727,10 @@ var createIntegration = () => {
124638
124727
  `
124639
124728
  );
124640
124729
  addMiddleware({
124641
- entrypoint: new URL("../build-runtime/auth", import.meta.url),
124730
+ entrypoint: new URL(
124731
+ "../build-runtime/middleware/auth.js",
124732
+ import.meta.url
124733
+ ),
124642
124734
  order: "pre"
124643
124735
  });
124644
124736
  const userEnv = loadEnv(
@@ -124672,6 +124764,18 @@ var createIntegration = () => {
124672
124764
  WIX_CLIENT_ID: envField.string({
124673
124765
  access: "public",
124674
124766
  context: "client"
124767
+ }),
124768
+ WIX_CLIENT_INSTANCE_ID: envField.string({
124769
+ access: "secret",
124770
+ context: "server"
124771
+ }),
124772
+ WIX_CLIENT_PUBLIC_KEY: envField.string({
124773
+ access: "secret",
124774
+ context: "server"
124775
+ }),
124776
+ WIX_CLIENT_SECRET: envField.string({
124777
+ access: "secret",
124778
+ context: "server"
124675
124779
  })
124676
124780
  }
124677
124781
  },
@@ -124683,11 +124787,47 @@ var createIntegration = () => {
124683
124787
  plugins: [patchGlobal()]
124684
124788
  }
124685
124789
  });
124686
- const { pathname: codegenDir } = createCodegenDir();
124790
+ const webhookCodegenDir = join8(codegenDir, "extensions/webhooks");
124791
+ await outputDir(webhookCodegenDir);
124792
+ if (command === "dev") {
124793
+ injectRoute({
124794
+ entrypoint: new URL(
124795
+ "../build-runtime/routes/webhooks.js",
124796
+ import.meta.url
124797
+ ),
124798
+ pattern: `/_wix/extensions/webhooks/[compId]`,
124799
+ prerender: false
124800
+ });
124801
+ import_chokidar.default.watch([EVENTS_DIR2], {
124802
+ cwd: config.root.pathname,
124803
+ ignoreInitial: true,
124804
+ useFsEvents: false
124805
+ }).on("all", async () => {
124806
+ model = await createProjectModel();
124807
+ await writeVirtualWebhookExtensionFiles(model, webhookCodegenDir);
124808
+ });
124809
+ } else {
124810
+ const webhookExtensions = model.extensions.filter(
124811
+ (extension) => isValidWebhookComponent(extension.config)
124812
+ );
124813
+ for (const extension of webhookExtensions) {
124814
+ const virtualEntrypoint = join8(
124815
+ webhookCodegenDir,
124816
+ `${extension.config.compId}.ts`
124817
+ );
124818
+ injectRoute({
124819
+ entrypoint: virtualEntrypoint,
124820
+ pattern: `/_wix/extensions/webhooks/${extension.config.compId}`
124821
+ });
124822
+ }
124823
+ }
124824
+ await writeVirtualWebhookExtensionFiles(model, webhookCodegenDir);
124825
+ const backofficeCodegenDir = join8(codegenDir, "extensions/backoffice");
124826
+ await outputDir(backofficeCodegenDir);
124687
124827
  if (command === "dev") {
124688
124828
  injectRoute({
124689
124829
  entrypoint: new URL("../runtime/entry.astro", import.meta.url),
124690
- pattern: `/_wix/backoffice-extensions/[...compId]`,
124830
+ pattern: `/_wix/extensions/backoffice/[compId]`,
124691
124831
  prerender: false
124692
124832
  });
124693
124833
  import_chokidar.default.watch(
@@ -124704,7 +124844,10 @@ var createIntegration = () => {
124704
124844
  }
124705
124845
  ).on("all", async () => {
124706
124846
  model = await createProjectModel();
124707
- await writeVirtualExtensionFiles(model, codegenDir);
124847
+ await writeVirtualBackofficeExtensionFiles(
124848
+ model,
124849
+ backofficeCodegenDir
124850
+ );
124708
124851
  });
124709
124852
  } else {
124710
124853
  const backofficeExtensions = model.extensions.filter(
@@ -124712,16 +124855,16 @@ var createIntegration = () => {
124712
124855
  );
124713
124856
  for (const extension of backofficeExtensions) {
124714
124857
  const virtualEntrypoint = join8(
124715
- codegenDir,
124858
+ backofficeCodegenDir,
124716
124859
  `${extension.config.compId}.astro`
124717
124860
  );
124718
124861
  injectRoute({
124719
124862
  entrypoint: virtualEntrypoint,
124720
- pattern: `/_wix/backoffice-extensions/${extension.config.compId}`
124863
+ pattern: `/_wix/extensions/backoffice/${extension.config.compId}`
124721
124864
  });
124722
124865
  }
124723
124866
  }
124724
- await writeVirtualExtensionFiles(model, codegenDir);
124867
+ await writeVirtualBackofficeExtensionFiles(model, backofficeCodegenDir);
124725
124868
  },
124726
124869
  "astro:server:setup": async ({ server }) => {
124727
124870
  server.middlewares.use(async (req, res, next) => {