@wix/astro 1.0.33 → 1.0.35

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.
Files changed (75) hide show
  1. package/build/fsevents-X6WP4TKM.node +0 -0
  2. package/build/index.js +184 -2
  3. package/build/index.js.map +1 -1
  4. package/build-browser-runtime/setup.js +22 -40
  5. package/build-runtime/auth.d.ts +5 -0
  6. package/build-runtime/auth.js +3557 -0
  7. package/build-runtime/chunk-24J7STEA.js +8 -0
  8. package/build-runtime/chunk-B6RICTPP.js +94 -0
  9. package/build-runtime/chunk-C3QOE2TZ.js +7 -0
  10. package/build-runtime/chunk-FR26HCAT.js +471 -0
  11. package/build-runtime/{chunk-NKFV7KCT.js → chunk-HDTWPOIV.js} +24 -44
  12. package/build-runtime/chunk-MLKGABMK.js +9 -0
  13. package/build-runtime/chunk-RKE6XT5Z.js +3104 -0
  14. package/build-runtime/chunk-VMS3NKCF.js +18 -0
  15. package/build-runtime/chunk-WYNC47R3.js +7 -0
  16. package/build-runtime/chunk-YMZMZCBN.js +4063 -0
  17. package/build-runtime/context/elevated.js +1 -1
  18. package/build-runtime/context/non-elevated.d.ts +2 -0
  19. package/build-runtime/context/non-elevated.js +32 -0
  20. package/build-runtime/context/nonElevated.js +1 -1
  21. package/build-runtime/routes/service-plugins.d.ts +5 -0
  22. package/build-runtime/routes/service-plugins.js +11 -0
  23. package/build-runtime/routes/webhooks.d.ts +5 -0
  24. package/build-runtime/routes/webhooks.js +11 -0
  25. package/build-runtime/routes/wix-apis/api.d.ts +5 -0
  26. package/build-runtime/routes/wix-apis/api.js +34 -0
  27. package/package.json +12 -5
  28. package/src/client-context/setup.ts +0 -14
  29. package/src/client-context/utils.ts +0 -59
  30. package/src/components.ts +0 -98
  31. package/src/constants.ts +0 -2
  32. package/src/context/elevated.ts +0 -20
  33. package/src/context/hostProxy.ts +0 -38
  34. package/src/context/nonElevated.ts +0 -42
  35. package/src/context/setupServicePlugin.ts +0 -13
  36. package/src/context/setupWebhook.ts +0 -13
  37. package/src/context/utils.ts +0 -32
  38. package/src/directories.ts +0 -5
  39. package/src/env.d.ts +0 -11
  40. package/src/index.ts +0 -293
  41. package/src/middleware/auth.ts +0 -38
  42. package/src/middleware/html-embeds.ts +0 -59
  43. package/src/plugins/patchAstroInlineScripts.ts +0 -27
  44. package/src/plugins/patchGlobal.ts +0 -20
  45. package/src/plugins/setupSsrContext.ts +0 -74
  46. package/src/routes/auth/callback.ts +0 -51
  47. package/src/routes/auth/login.ts +0 -42
  48. package/src/routes/auth/logout-callback.ts +0 -18
  49. package/src/routes/auth/logout.ts +0 -28
  50. package/src/routes/paylink/checkout.ts +0 -28
  51. package/src/routes/paylink/paylink.ts +0 -33
  52. package/src/routes/robots/robots.ts +0 -40
  53. package/src/routes/servicePluginsDevRoute.ts +0 -10
  54. package/src/routes/webhooksDevRoute.ts +0 -10
  55. package/src/schemas.ts +0 -227
  56. package/src/types.ts +0 -9
  57. package/src/utils/authAsyncLocalStorage.ts +0 -7
  58. package/src/utils/buildBackofficeComponent.ts +0 -64
  59. package/src/utils/buildComponents.ts +0 -182
  60. package/src/utils/buildServicePluginComponent.ts +0 -52
  61. package/src/utils/buildWebhookComponent.ts +0 -39
  62. package/src/utils/contextualAuth.ts +0 -4
  63. package/src/utils/createProjectModel.ts +0 -190
  64. package/src/utils/fs-utils.ts +0 -48
  65. package/src/utils/generateAppManifest.ts +0 -177
  66. package/src/utils/generateVisitorTokens.ts +0 -11
  67. package/src/utils/getSessionTokensFromCookie.ts +0 -38
  68. package/src/utils/loadEnvVars.ts +0 -47
  69. package/src/utils/normalizeWixRedirectUrl.ts +0 -11
  70. package/src/utils/removeUnusedCodegenFiles.ts +0 -34
  71. package/src/utils/resolveBuildMetadata.ts +0 -37
  72. package/src/utils/saveSessionTokensToCookie.ts +0 -27
  73. package/src/utils/transformStreamUtils.ts +0 -39
  74. package/tsconfig.json +0 -9
  75. package/tsup.config.mjs +0 -86
Binary file
package/build/index.js CHANGED
@@ -5529,6 +5529,177 @@ var require_nodefs_handler = __commonJS({
5529
5529
  }
5530
5530
  });
5531
5531
 
5532
+ // ../../node_modules/fsevents/fsevents.node
5533
+ var fsevents_default;
5534
+ var init_fsevents = __esm({
5535
+ "../../node_modules/fsevents/fsevents.node"() {
5536
+ fsevents_default = "./fsevents-X6WP4TKM.node";
5537
+ }
5538
+ });
5539
+
5540
+ // node-file:/Users/dorch/code/picasso-effort/wix-cli-one/node_modules/fsevents/fsevents.node
5541
+ var require_fsevents = __commonJS({
5542
+ "node-file:/Users/dorch/code/picasso-effort/wix-cli-one/node_modules/fsevents/fsevents.node"(exports, module2) {
5543
+ "use strict";
5544
+ init_esm_shims();
5545
+ init_fsevents();
5546
+ try {
5547
+ module2.exports = __require(fsevents_default);
5548
+ } catch {
5549
+ }
5550
+ }
5551
+ });
5552
+
5553
+ // ../../node_modules/fsevents/vfs.js
5554
+ var require_vfs = __commonJS({
5555
+ "../../node_modules/fsevents/vfs.js"(exports, module2) {
5556
+ "use strict";
5557
+ init_esm_shims();
5558
+ var path4 = __require("path");
5559
+ var pnpApi = null;
5560
+ try {
5561
+ pnpApi = __require("pnpapi");
5562
+ } catch {
5563
+ }
5564
+ function getVirtualLookupFn(pnpApi2) {
5565
+ const reverseMap = /* @__PURE__ */ new Map();
5566
+ for (const locator of pnpApi2.getAllLocators()) {
5567
+ const pkg = pnpApi2.getPackageInformation(locator);
5568
+ console.assert(pkg, `The package information should be available`);
5569
+ const resolvedLocation = pnpApi2.resolveVirtual(pkg.packageLocation);
5570
+ if (resolvedLocation === null)
5571
+ continue;
5572
+ const aliases = reverseMap.get(resolvedLocation) || [resolvedLocation];
5573
+ reverseMap.set(resolvedLocation, aliases);
5574
+ aliases.push(pkg.packageLocation);
5575
+ }
5576
+ const keys = [...reverseMap.keys()].sort((a, b) => {
5577
+ return b.length - a.length;
5578
+ });
5579
+ return (p) => {
5580
+ const prefix = keys.find((candidate) => p.startsWith(candidate));
5581
+ if (typeof prefix === `undefined`)
5582
+ return [p];
5583
+ const sub = p.substr(prefix.length);
5584
+ return reverseMap.get(prefix).map((alias) => {
5585
+ return alias + sub;
5586
+ });
5587
+ };
5588
+ }
5589
+ if (pnpApi != null) {
5590
+ const resolveVirtualAliases = getVirtualLookupFn(pnpApi);
5591
+ module2.exports = class FsePnp {
5592
+ constructor(p) {
5593
+ this.normalizedPath = path4.resolve(p);
5594
+ this.resolvedPath = pnpApi.resolveVirtual(this.normalizedPath) || this.normalizedPath;
5595
+ }
5596
+ transpose(p) {
5597
+ if (this.resolvedPath !== null) {
5598
+ return this.normalizedPath + p.substr(this.resolvedPath.length);
5599
+ } else {
5600
+ return p;
5601
+ }
5602
+ }
5603
+ wrap(fn) {
5604
+ return (path5, ...args) => {
5605
+ for (const entry of resolveVirtualAliases(path5)) {
5606
+ fn(this.transpose(entry), ...args);
5607
+ }
5608
+ };
5609
+ }
5610
+ };
5611
+ } else {
5612
+ module2.exports = class FsePnp {
5613
+ constructor(p) {
5614
+ this.resolvedPath = p;
5615
+ }
5616
+ wrap(fn) {
5617
+ return fn;
5618
+ }
5619
+ };
5620
+ }
5621
+ }
5622
+ });
5623
+
5624
+ // ../../node_modules/fsevents/fsevents.js
5625
+ var require_fsevents2 = __commonJS({
5626
+ "../../node_modules/fsevents/fsevents.js"(exports) {
5627
+ "use strict";
5628
+ init_esm_shims();
5629
+ if (process.platform !== "darwin") {
5630
+ throw new Error(`Module 'fsevents' is not compatible with platform '${process.platform}'`);
5631
+ }
5632
+ var Native = require_fsevents();
5633
+ var events = Native.constants;
5634
+ function watch(path4, since, handler) {
5635
+ if (typeof path4 !== "string") {
5636
+ throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof path4}`);
5637
+ }
5638
+ if ("function" === typeof since && "undefined" === typeof handler) {
5639
+ handler = since;
5640
+ since = Native.flags.SinceNow;
5641
+ }
5642
+ if (typeof since !== "number") {
5643
+ throw new TypeError(`fsevents argument 2 must be a number and not a ${typeof since}`);
5644
+ }
5645
+ if (typeof handler !== "function") {
5646
+ throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof handler}`);
5647
+ }
5648
+ let VFS = require_vfs();
5649
+ let vfs = new VFS(path4);
5650
+ let instance = Native.start(Native.global, vfs.resolvedPath, since, vfs.wrap(handler));
5651
+ if (!instance) throw new Error(`could not watch: ${path4}`);
5652
+ return () => {
5653
+ const result = instance ? Promise.resolve(instance).then(Native.stop) : Promise.resolve(void 0);
5654
+ instance = void 0;
5655
+ return result;
5656
+ };
5657
+ }
5658
+ function getInfo(path4, flags) {
5659
+ return {
5660
+ path: path4,
5661
+ flags,
5662
+ event: getEventType(flags),
5663
+ type: getFileType(flags),
5664
+ changes: getFileChanges(flags)
5665
+ };
5666
+ }
5667
+ function getFileType(flags) {
5668
+ if (events.ItemIsFile & flags) return "file";
5669
+ if (events.ItemIsDir & flags) return "directory";
5670
+ if (events.MustScanSubDirs & flags) return "directory";
5671
+ if (events.ItemIsSymlink & flags) return "symlink";
5672
+ }
5673
+ function anyIsTrue(obj) {
5674
+ for (let key in obj) {
5675
+ if (obj[key]) return true;
5676
+ }
5677
+ return false;
5678
+ }
5679
+ function getEventType(flags) {
5680
+ if (events.ItemRemoved & flags) return "deleted";
5681
+ if (events.ItemRenamed & flags) return "moved";
5682
+ if (events.ItemCreated & flags) return "created";
5683
+ if (events.ItemModified & flags) return "modified";
5684
+ if (events.RootChanged & flags) return "root-changed";
5685
+ if (events.ItemCloned & flags) return "cloned";
5686
+ if (anyIsTrue(flags)) return "modified";
5687
+ return "unknown";
5688
+ }
5689
+ function getFileChanges(flags) {
5690
+ return {
5691
+ inode: !!(events.ItemInodeMetaMod & flags),
5692
+ finder: !!(events.ItemFinderInfoMod & flags),
5693
+ access: !!(events.ItemChangeOwner & flags),
5694
+ xattrs: !!(events.ItemXattrMod & flags)
5695
+ };
5696
+ }
5697
+ exports.watch = watch;
5698
+ exports.getInfo = getInfo;
5699
+ exports.constants = events;
5700
+ }
5701
+ });
5702
+
5532
5703
  // ../../node_modules/chokidar/lib/fsevents-handler.js
5533
5704
  var require_fsevents_handler = __commonJS({
5534
5705
  "../../node_modules/chokidar/lib/fsevents-handler.js"(exports, module2) {
@@ -5539,7 +5710,7 @@ var require_fsevents_handler = __commonJS({
5539
5710
  var { promisify: promisify2 } = __require("util");
5540
5711
  var fsevents;
5541
5712
  try {
5542
- fsevents = __require("fsevents");
5713
+ fsevents = require_fsevents2();
5543
5714
  } catch (error2) {
5544
5715
  if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error2);
5545
5716
  }
@@ -11642,6 +11813,9 @@ var whitelistedFilePaths = [
11642
11813
  ),
11643
11814
  fileURLToPath2(
11644
11815
  new URL("../build-runtime/routes/robots/robots.js", import.meta.url)
11816
+ ),
11817
+ fileURLToPath2(
11818
+ new URL("../build-runtime/routes/wix-apis/api.js", import.meta.url)
11645
11819
  )
11646
11820
  ];
11647
11821
  function setupSsrContext(rootDir) {
@@ -16506,7 +16680,7 @@ function loadEnvVars({
16506
16680
  logger,
16507
16681
  rootDir
16508
16682
  }) {
16509
- const env2 = loadEnv("production", rootDir, "");
16683
+ const env2 = loadEnv("development", rootDir, "");
16510
16684
  const appId = env2[wixClientIdEnvVar];
16511
16685
  if (appId == null) {
16512
16686
  logger.error(
@@ -17012,6 +17186,14 @@ var createIntegration = (options = {
17012
17186
  pattern: "/robots.txt",
17013
17187
  prerender: false
17014
17188
  });
17189
+ injectRoute({
17190
+ entrypoint: new URL(
17191
+ "../build-runtime/routes/wix-apis/api.js",
17192
+ import.meta.url
17193
+ ),
17194
+ pattern: "/_api/[...path]",
17195
+ prerender: false
17196
+ });
17015
17197
  updateConfig({
17016
17198
  env: {
17017
17199
  schema: {