@wix/cli-app 1.1.58 → 1.1.59

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 (91) hide show
  1. package/build/{CreateVersionCommand-NNN5WEDG.js → CreateVersionCommand-6HJGN4WS.js} +16 -16
  2. package/build/{DevCommand-DTV4QLZX.js → DevCommand-U7PV4HW6.js} +15 -15
  3. package/build/DevCommand-U7PV4HW6.js.map +1 -0
  4. package/build/{GenerateCommand-3EILY6GU.js → GenerateCommand-M3T6OD4B.js} +295 -181
  5. package/build/GenerateCommand-M3T6OD4B.js.map +1 -0
  6. package/build/{LogsCommand-GBLWWXA4.js → LogsCommand-ECPZQ3LE.js} +4 -4
  7. package/build/PreviewCommand-ZQ3OUOKW.js +23 -0
  8. package/build/ReleaseCommand-KLZWNOVY.js +91 -0
  9. package/build/ReleaseCommand-KLZWNOVY.js.map +1 -0
  10. package/build/{ServeCommand-HBKGVBCD.js → ServeCommand-I65XXTLM.js} +13 -13
  11. package/build/{build-NYCCEFPM.js → build-HZ5LVFAS.js} +10 -9
  12. package/build/build-HZ5LVFAS.js.map +1 -0
  13. package/build/{chunk-XRPBC4UX.js → chunk-4JDHJDA5.js} +3 -3
  14. package/build/{chunk-NTTJJSCK.js → chunk-ACN6EZGH.js} +3 -3
  15. package/build/{chunk-IWJPJJEU.js → chunk-AQKGIDJO.js} +1969 -342
  16. package/build/chunk-AQKGIDJO.js.map +1 -0
  17. package/build/{chunk-RFDDKVTR.js → chunk-BNROT2BN.js} +5 -5
  18. package/build/{chunk-2ROHQF53.js → chunk-DXNFLVQP.js} +477 -484
  19. package/build/chunk-DXNFLVQP.js.map +1 -0
  20. package/build/{chunk-PUIMS4NQ.js → chunk-EZLVJJON.js} +3 -3
  21. package/build/{chunk-DKKXEKW7.js → chunk-FHMCCDCY.js} +3 -3
  22. package/build/{chunk-P5P6YINI.js → chunk-FMM24YL4.js} +2018 -886
  23. package/build/chunk-FMM24YL4.js.map +1 -0
  24. package/build/{chunk-CDB46GX7.js → chunk-IDWDZWLM.js} +2 -2
  25. package/build/{chunk-MVNY3M6D.js → chunk-OCC6MO6R.js} +5 -5
  26. package/build/{chunk-UGZFZOEU.js → chunk-PAWIUC26.js} +8 -8
  27. package/build/{chunk-SE6QML7T.js → chunk-QVGYU6D4.js} +17 -7
  28. package/build/chunk-QVGYU6D4.js.map +1 -0
  29. package/build/{chunk-FQ554CIC.js → chunk-QW4WBWJK.js} +3 -3
  30. package/build/{chunk-ZDKKDXHS.js → chunk-U72IPCQR.js} +3 -3
  31. package/build/{chunk-TQB6XTPS.js → chunk-UQBZVJDQ.js} +6 -3
  32. package/build/chunk-UQBZVJDQ.js.map +1 -0
  33. package/build/{chunk-JSDDG7MC.js → chunk-W4HI7DI3.js} +2 -2
  34. package/build/{chunk-QVLKHYBX.js → chunk-ZJYRE4BT.js} +3 -3
  35. package/build/{chunk-XIKZ45R2.js → chunk-ZXHKA32C.js} +56 -12
  36. package/build/chunk-ZXHKA32C.js.map +1 -0
  37. package/build/cloudflare-runtime/entry.js +306 -252
  38. package/build/cloudflare-runtime/getRegisteredExtensions.js +21 -273
  39. package/build/index.js +444 -134
  40. package/build/index.js.map +1 -1
  41. package/build/platform-sdk/chunk-7EYXEF6M.js +2 -0
  42. package/build/platform-sdk/chunk-7EYXEF6M.js.map +1 -0
  43. package/build/platform-sdk/chunk-EVF6HSFE.js +2 -0
  44. package/build/platform-sdk/chunk-EVF6HSFE.js.map +1 -0
  45. package/build/platform-sdk/chunk-LO6MZPZE.js +2 -0
  46. package/build/platform-sdk/chunk-LO6MZPZE.js.map +1 -0
  47. package/build/platform-sdk/dashboard.js +1 -1
  48. package/build/platform-sdk/dashboard.js.map +1 -1
  49. package/build/platform-sdk/editor.js +4 -4
  50. package/build/platform-sdk/editor.js.map +1 -1
  51. package/build/platform-sdk/site.js +1 -1
  52. package/build/platform-sdk/site.js.map +1 -1
  53. package/build/platform-sdk/web-methods.js +2 -0
  54. package/build/platform-sdk/web-methods.js.map +1 -0
  55. package/build/{preview-CCEFGOHW.js → preview-FI6WYZUP.js} +13 -13
  56. package/build/preview-FI6WYZUP.js.map +1 -0
  57. package/build/{render-command-T2HCJX3F.js → render-command-UKYXN7C7.js} +6 -6
  58. package/package.json +13 -10
  59. package/templates/web-method/files/placeholder.ts.ejs +17 -0
  60. package/build/DevCommand-DTV4QLZX.js.map +0 -1
  61. package/build/GenerateCommand-3EILY6GU.js.map +0 -1
  62. package/build/PreviewCommand-A2C52TVM.js +0 -23
  63. package/build/build-NYCCEFPM.js.map +0 -1
  64. package/build/chunk-2ROHQF53.js.map +0 -1
  65. package/build/chunk-IWJPJJEU.js.map +0 -1
  66. package/build/chunk-P5P6YINI.js.map +0 -1
  67. package/build/chunk-SE6QML7T.js.map +0 -1
  68. package/build/chunk-TQB6XTPS.js.map +0 -1
  69. package/build/chunk-XIKZ45R2.js.map +0 -1
  70. package/build/platform-sdk/chunk-DGX4CFXG.js +0 -2
  71. package/build/platform-sdk/chunk-DGX4CFXG.js.map +0 -1
  72. package/build/platform-sdk/chunk-TN6HYRXL.js +0 -2
  73. package/build/platform-sdk/chunk-TN6HYRXL.js.map +0 -1
  74. package/build/preview-CCEFGOHW.js.map +0 -1
  75. /package/build/{CreateVersionCommand-NNN5WEDG.js.map → CreateVersionCommand-6HJGN4WS.js.map} +0 -0
  76. /package/build/{LogsCommand-GBLWWXA4.js.map → LogsCommand-ECPZQ3LE.js.map} +0 -0
  77. /package/build/{PreviewCommand-A2C52TVM.js.map → PreviewCommand-ZQ3OUOKW.js.map} +0 -0
  78. /package/build/{ServeCommand-HBKGVBCD.js.map → ServeCommand-I65XXTLM.js.map} +0 -0
  79. /package/build/{chunk-XRPBC4UX.js.map → chunk-4JDHJDA5.js.map} +0 -0
  80. /package/build/{chunk-NTTJJSCK.js.map → chunk-ACN6EZGH.js.map} +0 -0
  81. /package/build/{chunk-RFDDKVTR.js.map → chunk-BNROT2BN.js.map} +0 -0
  82. /package/build/{chunk-PUIMS4NQ.js.map → chunk-EZLVJJON.js.map} +0 -0
  83. /package/build/{chunk-DKKXEKW7.js.map → chunk-FHMCCDCY.js.map} +0 -0
  84. /package/build/{chunk-CDB46GX7.js.map → chunk-IDWDZWLM.js.map} +0 -0
  85. /package/build/{chunk-MVNY3M6D.js.map → chunk-OCC6MO6R.js.map} +0 -0
  86. /package/build/{chunk-UGZFZOEU.js.map → chunk-PAWIUC26.js.map} +0 -0
  87. /package/build/{chunk-FQ554CIC.js.map → chunk-QW4WBWJK.js.map} +0 -0
  88. /package/build/{chunk-ZDKKDXHS.js.map → chunk-U72IPCQR.js.map} +0 -0
  89. /package/build/{chunk-JSDDG7MC.js.map → chunk-W4HI7DI3.js.map} +0 -0
  90. /package/build/{chunk-QVLKHYBX.js.map → chunk-ZJYRE4BT.js.map} +0 -0
  91. /package/build/{render-command-T2HCJX3F.js.map → render-command-UKYXN7C7.js.map} +0 -0
@@ -1,166 +1,12 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
3
  var __esm = (fn, res) => function __init() {
8
4
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
5
  };
10
- var __commonJS = (cb, mod) => function __require() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
- };
13
6
  var __export = (target, all) => {
14
7
  for (var name in all)
15
8
  __defProp(target, name, { get: all[name], enumerable: true });
16
9
  };
17
- var __copyProps = (to, from, except, desc) => {
18
- if (from && typeof from === "object" || typeof from === "function") {
19
- for (let key of __getOwnPropNames(from))
20
- if (!__hasOwnProp.call(to, key) && key !== except)
21
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
- }
23
- return to;
24
- };
25
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
- // If the importer is in node compatibility mode or this is not an ESM
27
- // file that has been converted to a CommonJS file using a Babel-
28
- // compatible transform (i.e. "__esModule" has not been set), then set
29
- // "default" to the CommonJS "module.exports" for node compatibility.
30
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
- mod
32
- ));
33
-
34
- // ../../node_modules/serialize-error/index.js
35
- var require_serialize_error = __commonJS({
36
- "../../node_modules/serialize-error/index.js"(exports, module) {
37
- "use strict";
38
- var NonError = class _NonError extends Error {
39
- constructor(message2) {
40
- super(_NonError._prepareSuperMessage(message2));
41
- Object.defineProperty(this, "name", {
42
- value: "NonError",
43
- configurable: true,
44
- writable: true
45
- });
46
- if (Error.captureStackTrace) {
47
- Error.captureStackTrace(this, _NonError);
48
- }
49
- }
50
- static _prepareSuperMessage(message2) {
51
- try {
52
- return JSON.stringify(message2);
53
- } catch {
54
- return String(message2);
55
- }
56
- }
57
- };
58
- var commonProperties = [
59
- { property: "name", enumerable: false },
60
- { property: "message", enumerable: false },
61
- { property: "stack", enumerable: false },
62
- { property: "code", enumerable: true }
63
- ];
64
- var isCalled = Symbol(".toJSON called");
65
- var toJSON = (from) => {
66
- from[isCalled] = true;
67
- const json = from.toJSON();
68
- delete from[isCalled];
69
- return json;
70
- };
71
- var destroyCircular = ({
72
- from,
73
- seen,
74
- to_,
75
- forceEnumerable,
76
- maxDepth,
77
- depth
78
- }) => {
79
- const to = to_ || (Array.isArray(from) ? [] : {});
80
- seen.push(from);
81
- if (depth >= maxDepth) {
82
- return to;
83
- }
84
- if (typeof from.toJSON === "function" && from[isCalled] !== true) {
85
- return toJSON(from);
86
- }
87
- for (const [key, value] of Object.entries(from)) {
88
- if (typeof Buffer === "function" && Buffer.isBuffer(value)) {
89
- to[key] = "[object Buffer]";
90
- continue;
91
- }
92
- if (typeof value === "function") {
93
- continue;
94
- }
95
- if (!value || typeof value !== "object") {
96
- to[key] = value;
97
- continue;
98
- }
99
- if (!seen.includes(from[key])) {
100
- depth++;
101
- to[key] = destroyCircular({
102
- from: from[key],
103
- seen: seen.slice(),
104
- forceEnumerable,
105
- maxDepth,
106
- depth
107
- });
108
- continue;
109
- }
110
- to[key] = "[Circular]";
111
- }
112
- for (const { property, enumerable } of commonProperties) {
113
- if (typeof from[property] === "string") {
114
- Object.defineProperty(to, property, {
115
- value: from[property],
116
- enumerable: forceEnumerable ? true : enumerable,
117
- configurable: true,
118
- writable: true
119
- });
120
- }
121
- }
122
- return to;
123
- };
124
- var serializeError2 = (value, options = {}) => {
125
- const { maxDepth = Number.POSITIVE_INFINITY } = options;
126
- if (typeof value === "object" && value !== null) {
127
- return destroyCircular({
128
- from: value,
129
- seen: [],
130
- forceEnumerable: true,
131
- maxDepth,
132
- depth: 0
133
- });
134
- }
135
- if (typeof value === "function") {
136
- return `[Function: ${value.name || "anonymous"}]`;
137
- }
138
- return value;
139
- };
140
- var deserializeError = (value, options = {}) => {
141
- const { maxDepth = Number.POSITIVE_INFINITY } = options;
142
- if (value instanceof Error) {
143
- return value;
144
- }
145
- if (typeof value === "object" && value !== null && !Array.isArray(value)) {
146
- const newError = new Error();
147
- destroyCircular({
148
- from: value,
149
- seen: [],
150
- to_: newError,
151
- maxDepth,
152
- depth: 0
153
- });
154
- return newError;
155
- }
156
- return new NonError(value);
157
- };
158
- module.exports = {
159
- serializeError: serializeError2,
160
- deserializeError
161
- };
162
- }
163
- });
164
10
 
165
11
  // ../../node_modules/jose/dist/browser/runtime/webcrypto.js
166
12
  var webcrypto_default, isCryptoKey;
@@ -4568,7 +4414,7 @@ function objectToKeyValue(input) {
4568
4414
  return Object.entries(input).filter(([_, value]) => Boolean(value)).map(([key, value]) => `${key}=${value}`).join(",");
4569
4415
  }
4570
4416
 
4571
- // ../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/context.js
4417
+ // ../../node_modules/@wix/sdk-runtime/build/context.js
4572
4418
  function runWithoutContext(fn) {
4573
4419
  const globalContext = globalThis.__wix_context__;
4574
4420
  const moduleContext = {
@@ -4900,120 +4746,6 @@ function servicePluginsModules(authStrategy) {
4900
4746
  };
4901
4747
  }
4902
4748
 
4903
- // ../../node_modules/@wix/sdk/build/web-method-modules.js
4904
- var import_serialize_error = __toESM(require_serialize_error(), 1);
4905
-
4906
- // ../../node_modules/@wix/sdk/build/get-token-info.js
4907
- async function getTokenInfo(token) {
4908
- const tokenInfoRes = await fetch("https://www.wixapis.com/oauth2/token-info", {
4909
- method: "POST",
4910
- headers: {
4911
- "Content-Type": "application/json"
4912
- },
4913
- body: JSON.stringify({
4914
- token
4915
- })
4916
- });
4917
- if (tokenInfoRes.status !== 200) {
4918
- throw new Error(`Failed to get token info. Unexpected status code from Wix OAuth API: ${tokenInfoRes.status}`);
4919
- }
4920
- return await tokenInfoRes.json();
4921
- }
4922
-
4923
- // ../../node_modules/@wix/sdk/build/web-method-modules.js
4924
- var isWebMethodModules = (val) => val.__type === "web-method-module";
4925
- var Permissions;
4926
- (function(Permissions2) {
4927
- Permissions2["Anyone"] = "anyone";
4928
- Permissions2["Admin"] = "admin";
4929
- Permissions2["SiteMember"] = "site-member";
4930
- })(Permissions || (Permissions = {}));
4931
- async function checkPermission(request, permission) {
4932
- const accessToken = request.headers.get("Authorization");
4933
- if (!accessToken) {
4934
- throw new Error("Request is missing authentication data");
4935
- }
4936
- const { subjectType } = await getTokenInfo(accessToken);
4937
- switch (permission) {
4938
- case Permissions.Anyone: {
4939
- if (subjectType !== "VISITOR" && subjectType !== "MEMBER" && subjectType !== "USER") {
4940
- throw new Error("Insufficient permissions");
4941
- }
4942
- break;
4943
- }
4944
- case Permissions.SiteMember: {
4945
- if (subjectType !== "MEMBER" && subjectType !== "USER") {
4946
- throw new Error("Insufficient permissions");
4947
- }
4948
- break;
4949
- }
4950
- case Permissions.Admin: {
4951
- if (subjectType !== "USER") {
4952
- throw new Error("Insufficient permissions");
4953
- }
4954
- break;
4955
- }
4956
- }
4957
- }
4958
- var urlRegex = /\/_webMethods\/(.+\..+)\/(.+\..+)/;
4959
- function extractUrlParts(url) {
4960
- const parts = url.match(urlRegex);
4961
- if (parts) {
4962
- return [parts[1], parts[2].replace(".ajax", "")];
4963
- }
4964
- }
4965
- function isRequestBodyValid(body) {
4966
- return !!body && typeof body === "object" && Array.isArray(body);
4967
- }
4968
- var productionErrorMessage = "Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information.";
4969
- function webMethodModules() {
4970
- const webMethods = {};
4971
- const client = {
4972
- async processRequest(request, devMode = false) {
4973
- const urlParts = extractUrlParts(request.url);
4974
- if (!urlParts) {
4975
- return new Response("invalid request", { status: 400 });
4976
- }
4977
- const [file, method] = urlParts;
4978
- const body = await request.json();
4979
- if (!isRequestBodyValid(body)) {
4980
- return new Response("invalid request", { status: 400 });
4981
- }
4982
- const loadWebMethodFile = webMethods[`/${file}`];
4983
- try {
4984
- if (!loadWebMethodFile) {
4985
- throw new Error(`Error loading web module ${file}: Cannot find module '${file}'`);
4986
- }
4987
- const webMethodFile = await loadWebMethodFile();
4988
- const webMethod = webMethodFile[method];
4989
- if (!webMethod) {
4990
- throw new Error(`Error loading function from web module ${file}: function '${method}' not found`);
4991
- }
4992
- await checkPermission(request, webMethod.permission);
4993
- return Response.json({
4994
- result: await webMethod.handler(...body)
4995
- });
4996
- } catch (error) {
4997
- const serializedError = (0, import_serialize_error.serializeError)(error, { maxDepth: 1 });
4998
- return Response.json({
4999
- result: devMode || !(error instanceof Error) ? serializedError : {
5000
- ...serializedError,
5001
- message: productionErrorMessage,
5002
- stack: productionErrorMessage
5003
- },
5004
- exception: true
5005
- });
5006
- }
5007
- }
5008
- };
5009
- return {
5010
- initModule(webMethodModule) {
5011
- Object.assign(webMethods, webMethodModule);
5012
- },
5013
- client
5014
- };
5015
- }
5016
-
5017
4749
  // ../../node_modules/@wix/sdk/build/wixClient.js
5018
4750
  function createClient(config) {
5019
4751
  const _headers = config.headers || { Authorization: "" };
@@ -5040,7 +4772,6 @@ function createClient(config) {
5040
4772
  };
5041
4773
  const { client: servicePluginsClient, initModule: initServicePluginModule } = servicePluginsModules(authStrategy);
5042
4774
  const { client: eventHandlersClient, initModule: initEventHandlerModule } = eventHandlersModules(authStrategy);
5043
- const { client: webMethodClient, initModule } = webMethodModules();
5044
4775
  const boundFetch = async (url, options) => {
5045
4776
  const authHeaders = await boundGetAuthHeaders();
5046
4777
  const defaultContentTypeHeader = getDefaultContentHeader(options);
@@ -5062,8 +4793,6 @@ function createClient(config) {
5062
4793
  return initServicePluginModule(modules);
5063
4794
  } else if (isHostModule(modules) && config.host) {
5064
4795
  return buildHostModule(modules, config.host);
5065
- } else if (isWebMethodModules(modules)) {
5066
- return initModule(modules);
5067
4796
  } else if (typeof modules === "function") {
5068
4797
  if ("__type" in modules && modules.__type === SERVICE_PLUGIN_ERROR_TYPE) {
5069
4798
  return modules;
@@ -5149,11 +4878,27 @@ function createClient(config) {
5149
4878
  return { data: data ?? {}, errors };
5150
4879
  },
5151
4880
  webhooks: eventHandlersClient,
5152
- webMethods: webMethodClient,
5153
4881
  servicePlugins: servicePluginsClient
5154
4882
  };
5155
4883
  }
5156
4884
 
4885
+ // ../../node_modules/@wix/sdk/build/get-token-info.js
4886
+ async function getTokenInfo(token) {
4887
+ const tokenInfoRes = await fetch("https://www.wixapis.com/oauth2/token-info", {
4888
+ method: "POST",
4889
+ headers: {
4890
+ "Content-Type": "application/json"
4891
+ },
4892
+ body: JSON.stringify({
4893
+ token
4894
+ })
4895
+ });
4896
+ if (tokenInfoRes.status !== 200) {
4897
+ throw new Error(`Failed to get token info. Unexpected status code from Wix OAuth API: ${tokenInfoRes.status}`);
4898
+ }
4899
+ return await tokenInfoRes.json();
4900
+ }
4901
+
5157
4902
  // ../../node_modules/@wix/sdk/build/auth/AppStrategy.js
5158
4903
  function AppStrategy(opts) {
5159
4904
  let refreshToken = "refreshToken" in opts ? opts.refreshToken : void 0;
@@ -5497,6 +5242,9 @@ var servicePlugins = import.meta.glob(
5497
5242
  eager: false
5498
5243
  }
5499
5244
  );
5245
+ var webMethods = import.meta.glob("/src/**/*.web.ts", {
5246
+ eager: false
5247
+ });
5500
5248
 
5501
5249
  // src/getRegisteredExtensions.ts
5502
5250
  var eventsHandler = new EventHandler(events);