@wix/cli-app 1.1.107 → 1.1.108
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/{AddPermissionCommand-7E5GD5VD.js → AddPermissionCommand-W3TQTL3X.js} +2 -2
- package/build/{DevCommand-BWRRKEE6.js → DevCommand-3HZJQQIQ.js} +10 -10
- package/build/{DevCommand-BWRRKEE6.js.map → DevCommand-3HZJQQIQ.js.map} +1 -1
- package/build/{GenerateCommand-IO6ENBOG.js → GenerateCommand-UQ3JHQTJ.js} +47 -8
- package/build/GenerateCommand-UQ3JHQTJ.js.map +1 -0
- package/build/{LogsCommand-C62QNN65.js → LogsCommand-JHADSYUE.js} +3 -3
- package/build/PreviewCommand-WBQRDP7K.js +19 -0
- package/build/ReleaseCommand-3KDJB3KZ.js +23 -0
- package/build/{ServeCommand-NDUXIY75.js → ServeCommand-IPKP6PJ2.js} +3 -3
- package/build/{build-ZO7CXGLN.js → build-LZ3CJXNM.js} +6 -6
- package/build/{chunk-EC7IFTLG.js → chunk-6OQZW27N.js} +8 -2
- package/build/{chunk-EC7IFTLG.js.map → chunk-6OQZW27N.js.map} +1 -1
- package/build/{chunk-PSN6WZCB.js → chunk-7KESMWRI.js} +13 -7
- package/build/{chunk-PSN6WZCB.js.map → chunk-7KESMWRI.js.map} +1 -1
- package/build/{chunk-77PR2TSF.js → chunk-BER5YRAG.js} +2 -2
- package/build/{chunk-7B3P7MZT.js → chunk-FO7ABKNR.js} +3 -3
- package/build/{chunk-HNIJZROR.js → chunk-HAUIN5OS.js} +6 -6
- package/build/{chunk-657KFISY.js → chunk-IGC7QYU5.js} +2 -2
- package/build/{chunk-HJXYDXED.js → chunk-LOVLYP4H.js} +5 -5
- package/build/{chunk-VV6PV2NF.js → chunk-LWOWN5OI.js} +5 -5
- package/build/{chunk-6X7N6N75.js → chunk-MAZMH6ES.js} +6 -6
- package/build/{chunk-TZ37SYKU.js → chunk-OKHXUGGH.js} +2 -2
- package/build/{chunk-5ZI5USPK.js → chunk-PBROWK34.js} +8 -1
- package/build/{chunk-5ZI5USPK.js.map → chunk-PBROWK34.js.map} +1 -1
- package/build/{chunk-EH63OURU.js → chunk-PFAJ5ETM.js} +2 -2
- package/build/{chunk-AKBVXZXO.js → chunk-RDXTHRJ4.js} +14 -2
- package/build/{chunk-AKBVXZXO.js.map → chunk-RDXTHRJ4.js.map} +1 -1
- package/build/{chunk-VJAMKDBT.js → chunk-UEUJOHB4.js} +3 -3
- package/build/{chunk-OSDDOY2U.js → chunk-UN2TQTOP.js} +156 -10
- package/build/{chunk-OSDDOY2U.js.map → chunk-UN2TQTOP.js.map} +1 -1
- package/build/{chunk-GFXZXRO4.js → chunk-UPQ6AZFY.js} +2 -2
- package/build/{chunk-VCFM6SMQ.js → chunk-W5SE5OVE.js} +123 -7
- package/build/{chunk-VCFM6SMQ.js.map → chunk-W5SE5OVE.js.map} +1 -1
- package/build/{chunk-MK5OQBNN.js → chunk-Z4NG6X6T.js} +2 -2
- package/build/cloudflare-runtime/entry.js +256 -32
- package/build/cloudflare-runtime/getRegisteredExtensions.js +252 -28
- package/build/index.js +24 -24
- package/build/platform-sdk/chunk-J3SVE4GM.js +2 -0
- package/build/platform-sdk/chunk-J3SVE4GM.js.map +1 -0
- package/build/platform-sdk/chunk-J7RIIVO6.js +2 -0
- package/build/platform-sdk/chunk-J7RIIVO6.js.map +1 -0
- package/build/platform-sdk/chunk-RHDUKNAJ.js +2 -0
- package/build/platform-sdk/chunk-RHDUKNAJ.js.map +1 -0
- package/build/platform-sdk/dashboard.js +1 -1
- package/build/platform-sdk/dashboard.js.map +1 -1
- package/build/platform-sdk/editor.js +2 -2
- package/build/platform-sdk/editor.js.map +1 -1
- package/build/platform-sdk/sdk-context.js +1 -1
- package/build/platform-sdk/sdk-context.js.map +1 -1
- package/build/platform-sdk/site.js +1 -1
- package/build/{preview-ZGAFDUGX.js → preview-OVNN2RP4.js} +13 -13
- package/build/{release-YOEGOFAT.js → release-OMLRH2VC.js} +15 -15
- package/build/{render-command-FI2MU2Z5.js → render-command-DIMIKL4B.js} +6 -6
- package/package.json +6 -6
- package/build/GenerateCommand-IO6ENBOG.js.map +0 -1
- package/build/PreviewCommand-YAYKKYRN.js +0 -19
- package/build/ReleaseCommand-77SWCHH2.js +0 -23
- package/build/platform-sdk/chunk-BBFFXVJD.js +0 -2
- package/build/platform-sdk/chunk-BBFFXVJD.js.map +0 -1
- package/build/platform-sdk/chunk-MAZR75DI.js +0 -2
- package/build/platform-sdk/chunk-MAZR75DI.js.map +0 -1
- package/build/platform-sdk/chunk-NHYZDMR5.js +0 -2
- package/build/platform-sdk/chunk-NHYZDMR5.js.map +0 -1
- /package/build/{AddPermissionCommand-7E5GD5VD.js.map → AddPermissionCommand-W3TQTL3X.js.map} +0 -0
- /package/build/{LogsCommand-C62QNN65.js.map → LogsCommand-JHADSYUE.js.map} +0 -0
- /package/build/{PreviewCommand-YAYKKYRN.js.map → PreviewCommand-WBQRDP7K.js.map} +0 -0
- /package/build/{ReleaseCommand-77SWCHH2.js.map → ReleaseCommand-3KDJB3KZ.js.map} +0 -0
- /package/build/{ServeCommand-NDUXIY75.js.map → ServeCommand-IPKP6PJ2.js.map} +0 -0
- /package/build/{build-ZO7CXGLN.js.map → build-LZ3CJXNM.js.map} +0 -0
- /package/build/{chunk-77PR2TSF.js.map → chunk-BER5YRAG.js.map} +0 -0
- /package/build/{chunk-7B3P7MZT.js.map → chunk-FO7ABKNR.js.map} +0 -0
- /package/build/{chunk-HNIJZROR.js.map → chunk-HAUIN5OS.js.map} +0 -0
- /package/build/{chunk-657KFISY.js.map → chunk-IGC7QYU5.js.map} +0 -0
- /package/build/{chunk-HJXYDXED.js.map → chunk-LOVLYP4H.js.map} +0 -0
- /package/build/{chunk-VV6PV2NF.js.map → chunk-LWOWN5OI.js.map} +0 -0
- /package/build/{chunk-6X7N6N75.js.map → chunk-MAZMH6ES.js.map} +0 -0
- /package/build/{chunk-TZ37SYKU.js.map → chunk-OKHXUGGH.js.map} +0 -0
- /package/build/{chunk-EH63OURU.js.map → chunk-PFAJ5ETM.js.map} +0 -0
- /package/build/{chunk-VJAMKDBT.js.map → chunk-UEUJOHB4.js.map} +0 -0
- /package/build/{chunk-GFXZXRO4.js.map → chunk-UPQ6AZFY.js.map} +0 -0
- /package/build/{chunk-MK5OQBNN.js.map → chunk-Z4NG6X6T.js.map} +0 -0
- /package/build/{preview-ZGAFDUGX.js.map → preview-OVNN2RP4.js.map} +0 -0
- /package/build/{release-YOEGOFAT.js.map → release-OMLRH2VC.js.map} +0 -0
- /package/build/{render-command-FI2MU2Z5.js.map → render-command-DIMIKL4B.js.map} +0 -0
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
useProjectModel,
|
|
16
16
|
writePackageJson,
|
|
17
17
|
z
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-W5SE5OVE.js";
|
|
19
19
|
import {
|
|
20
20
|
__commonJS,
|
|
21
21
|
__require,
|
|
@@ -9385,4 +9385,4 @@ ejs/lib/ejs.js:
|
|
|
9385
9385
|
* @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
|
|
9386
9386
|
*)
|
|
9387
9387
|
*/
|
|
9388
|
-
//# sourceMappingURL=chunk-
|
|
9388
|
+
//# sourceMappingURL=chunk-Z4NG6X6T.js.map
|
|
@@ -4595,7 +4595,7 @@ function objectToKeyValue(input) {
|
|
|
4595
4595
|
return Object.entries(input).filter(([_, value]) => Boolean(value)).map(([key, value]) => `${key}=${value}`).join(",");
|
|
4596
4596
|
}
|
|
4597
4597
|
|
|
4598
|
-
// ../../node_modules/@wix/sdk-runtime/build/context.js
|
|
4598
|
+
// ../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/context.js
|
|
4599
4599
|
function runWithoutContext(fn) {
|
|
4600
4600
|
const globalContext = globalThis.__wix_context__;
|
|
4601
4601
|
const moduleContext = {
|
|
@@ -4627,8 +4627,189 @@ function runWithoutContext(fn) {
|
|
|
4627
4627
|
}
|
|
4628
4628
|
}
|
|
4629
4629
|
|
|
4630
|
+
// ../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/utils.js
|
|
4631
|
+
function constantCase(input) {
|
|
4632
|
+
return split(input).map((part) => part.toLocaleUpperCase()).join("_");
|
|
4633
|
+
}
|
|
4634
|
+
var SPLIT_LOWER_UPPER_RE = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu");
|
|
4635
|
+
var SPLIT_UPPER_UPPER_RE = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu");
|
|
4636
|
+
var SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
4637
|
+
var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
4638
|
+
function split(value) {
|
|
4639
|
+
let result = value.trim();
|
|
4640
|
+
result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
4641
|
+
result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
4642
|
+
let start = 0;
|
|
4643
|
+
let end = result.length;
|
|
4644
|
+
while (result.charAt(start) === "\0") {
|
|
4645
|
+
start++;
|
|
4646
|
+
}
|
|
4647
|
+
if (start === end) {
|
|
4648
|
+
return [];
|
|
4649
|
+
}
|
|
4650
|
+
while (result.charAt(end - 1) === "\0") {
|
|
4651
|
+
end--;
|
|
4652
|
+
}
|
|
4653
|
+
return result.slice(start, end).split(/\0/g);
|
|
4654
|
+
}
|
|
4655
|
+
|
|
4656
|
+
// ../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/transform-error.js
|
|
4657
|
+
var isValidationError = (httpClientError) => "validationError" in (httpClientError.response?.data?.details ?? {});
|
|
4658
|
+
var isApplicationError = (httpClientError) => "applicationError" in (httpClientError.response?.data?.details ?? {});
|
|
4659
|
+
var isClientError = (httpClientError) => (httpClientError.response?.status ?? -1) >= 400 && (httpClientError.response?.status ?? -1) < 500;
|
|
4660
|
+
function transformError(httpClientError, pathsToArguments = {
|
|
4661
|
+
explicitPathsToArguments: {},
|
|
4662
|
+
spreadPathsToArguments: {},
|
|
4663
|
+
singleArgumentUnchanged: false
|
|
4664
|
+
}, argumentNames = []) {
|
|
4665
|
+
if (typeof httpClientError !== "object" || httpClientError === null) {
|
|
4666
|
+
throw httpClientError;
|
|
4667
|
+
}
|
|
4668
|
+
if (isValidationError(httpClientError)) {
|
|
4669
|
+
return buildValidationError(httpClientError, pathsToArguments, argumentNames);
|
|
4670
|
+
}
|
|
4671
|
+
if (isApplicationError(httpClientError)) {
|
|
4672
|
+
return buildApplicationError(httpClientError);
|
|
4673
|
+
}
|
|
4674
|
+
if (isClientError(httpClientError)) {
|
|
4675
|
+
const status = httpClientError.response?.status;
|
|
4676
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
4677
|
+
const message2 = httpClientError.response?.data?.message ?? statusText;
|
|
4678
|
+
const details = {
|
|
4679
|
+
applicationError: {
|
|
4680
|
+
description: statusText,
|
|
4681
|
+
code: constantCase(statusText),
|
|
4682
|
+
data: {}
|
|
4683
|
+
},
|
|
4684
|
+
requestId: httpClientError.requestId
|
|
4685
|
+
};
|
|
4686
|
+
return wrapError(httpClientError, {
|
|
4687
|
+
message: JSON.stringify({
|
|
4688
|
+
message: message2,
|
|
4689
|
+
details
|
|
4690
|
+
}, null, 2),
|
|
4691
|
+
extraProperties: {
|
|
4692
|
+
details,
|
|
4693
|
+
status
|
|
4694
|
+
}
|
|
4695
|
+
});
|
|
4696
|
+
}
|
|
4697
|
+
return buildSystemError(httpClientError);
|
|
4698
|
+
}
|
|
4699
|
+
var buildValidationError = (httpClientError, pathsToArguments, argumentNames) => {
|
|
4700
|
+
const validationErrorResponse = httpClientError.response?.data;
|
|
4701
|
+
const requestId = httpClientError.requestId;
|
|
4702
|
+
const { fieldViolations } = validationErrorResponse.details.validationError;
|
|
4703
|
+
const transformedFieldViolations = violationsWithRenamedFields(pathsToArguments, fieldViolations, argumentNames)?.sort((a, b) => a.field < b.field ? -1 : 1);
|
|
4704
|
+
const message2 = `INVALID_ARGUMENT: ${transformedFieldViolations?.map(({ field, description }) => `"${field}" ${description}`)?.join(", ")}`;
|
|
4705
|
+
const details = {
|
|
4706
|
+
validationError: { fieldViolations: transformedFieldViolations },
|
|
4707
|
+
requestId
|
|
4708
|
+
};
|
|
4709
|
+
return wrapError(httpClientError, {
|
|
4710
|
+
message: JSON.stringify({ message: message2, details }, null, 2),
|
|
4711
|
+
extraProperties: {
|
|
4712
|
+
details,
|
|
4713
|
+
status: httpClientError.response?.status,
|
|
4714
|
+
requestId
|
|
4715
|
+
}
|
|
4716
|
+
});
|
|
4717
|
+
};
|
|
4718
|
+
var wrapError = (baseError, { message: message2, extraProperties }) => {
|
|
4719
|
+
return Object.assign(baseError, {
|
|
4720
|
+
...extraProperties,
|
|
4721
|
+
message: message2
|
|
4722
|
+
});
|
|
4723
|
+
};
|
|
4724
|
+
var buildApplicationError = (httpClientError) => {
|
|
4725
|
+
const status = httpClientError.response?.status;
|
|
4726
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
4727
|
+
const message2 = httpClientError.response?.data?.message ?? statusText;
|
|
4728
|
+
const description = httpClientError.response?.data?.details?.applicationError?.description ?? statusText;
|
|
4729
|
+
const code = httpClientError.response?.data?.details?.applicationError?.code ?? constantCase(statusText);
|
|
4730
|
+
const data = httpClientError.response?.data?.details?.applicationError?.data ?? {};
|
|
4731
|
+
const combinedMessage = message2 === description ? message2 : `${message2}: ${description}`;
|
|
4732
|
+
const details = {
|
|
4733
|
+
applicationError: {
|
|
4734
|
+
description,
|
|
4735
|
+
code,
|
|
4736
|
+
data
|
|
4737
|
+
},
|
|
4738
|
+
requestId: httpClientError.requestId
|
|
4739
|
+
};
|
|
4740
|
+
return wrapError(httpClientError, {
|
|
4741
|
+
message: JSON.stringify({ message: combinedMessage, details }, null, 2),
|
|
4742
|
+
extraProperties: {
|
|
4743
|
+
details,
|
|
4744
|
+
status,
|
|
4745
|
+
requestId: httpClientError.requestId
|
|
4746
|
+
}
|
|
4747
|
+
});
|
|
4748
|
+
};
|
|
4749
|
+
var buildSystemError = (httpClientError) => {
|
|
4750
|
+
const message2 = httpClientError.requestId ? `System error occurred, request-id: ${httpClientError.requestId}` : `System error occurred: ${JSON.stringify(httpClientError)}`;
|
|
4751
|
+
return wrapError(httpClientError, {
|
|
4752
|
+
message: message2,
|
|
4753
|
+
extraProperties: {
|
|
4754
|
+
requestId: httpClientError.requestId,
|
|
4755
|
+
status: httpClientError.response?.status,
|
|
4756
|
+
code: constantCase(httpClientError.response?.statusText ?? "UNKNOWN"),
|
|
4757
|
+
...!httpClientError.response && {
|
|
4758
|
+
runtimeError: httpClientError
|
|
4759
|
+
}
|
|
4760
|
+
}
|
|
4761
|
+
});
|
|
4762
|
+
};
|
|
4763
|
+
var violationsWithRenamedFields = ({ spreadPathsToArguments, explicitPathsToArguments, singleArgumentUnchanged }, fieldViolations, argumentNames) => {
|
|
4764
|
+
const allPathsToArguments = {
|
|
4765
|
+
...spreadPathsToArguments,
|
|
4766
|
+
...explicitPathsToArguments
|
|
4767
|
+
};
|
|
4768
|
+
const allPathsToArgumentsKeys = Object.keys(allPathsToArguments);
|
|
4769
|
+
return fieldViolations?.filter((fieldViolation) => {
|
|
4770
|
+
const containedInAMoreSpecificViolationField = fieldViolations.some((anotherViolation) => anotherViolation.field.length > fieldViolation.field.length && anotherViolation.field.startsWith(fieldViolation.field) && allPathsToArgumentsKeys.includes(anotherViolation.field));
|
|
4771
|
+
return !containedInAMoreSpecificViolationField;
|
|
4772
|
+
}).map((fieldViolation) => {
|
|
4773
|
+
const exactMatchArgumentExpression = explicitPathsToArguments[fieldViolation.field];
|
|
4774
|
+
if (exactMatchArgumentExpression) {
|
|
4775
|
+
return {
|
|
4776
|
+
...fieldViolation,
|
|
4777
|
+
field: withRenamedArgument(exactMatchArgumentExpression, argumentNames)
|
|
4778
|
+
};
|
|
4779
|
+
}
|
|
4780
|
+
const longestPartialPathMatch = allPathsToArgumentsKeys?.sort((a, b) => b.length - a.length)?.find((path) => fieldViolation.field.startsWith(path));
|
|
4781
|
+
if (longestPartialPathMatch) {
|
|
4782
|
+
const partialMatchArgumentExpression = allPathsToArguments[longestPartialPathMatch];
|
|
4783
|
+
if (partialMatchArgumentExpression) {
|
|
4784
|
+
return {
|
|
4785
|
+
...fieldViolation,
|
|
4786
|
+
field: fieldViolation.field.replace(longestPartialPathMatch, withRenamedArgument(partialMatchArgumentExpression, argumentNames))
|
|
4787
|
+
};
|
|
4788
|
+
}
|
|
4789
|
+
}
|
|
4790
|
+
if (singleArgumentUnchanged) {
|
|
4791
|
+
return {
|
|
4792
|
+
...fieldViolation,
|
|
4793
|
+
field: `${argumentNames[0]}.${fieldViolation.field}`
|
|
4794
|
+
};
|
|
4795
|
+
}
|
|
4796
|
+
return fieldViolation;
|
|
4797
|
+
});
|
|
4798
|
+
};
|
|
4799
|
+
var withRenamedArgument = (fieldValue, argumentNames) => {
|
|
4800
|
+
const argIndex = getArgumentIndex(fieldValue);
|
|
4801
|
+
if (argIndex !== null && typeof argIndex !== "undefined") {
|
|
4802
|
+
return fieldValue.replace(`$[${argIndex}]`, argumentNames[argIndex]);
|
|
4803
|
+
}
|
|
4804
|
+
return fieldValue;
|
|
4805
|
+
};
|
|
4806
|
+
var getArgumentIndex = (s) => {
|
|
4807
|
+
const match = s.match(/\$\[(?<argIndex>\d+)\]/);
|
|
4808
|
+
return match && match.groups && Number(match.groups.argIndex);
|
|
4809
|
+
};
|
|
4810
|
+
|
|
4630
4811
|
// ../../node_modules/@wix/sdk/build/rest-modules.js
|
|
4631
|
-
function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, wixAPIFetch, getActiveToken, options, hostName, useCDN) {
|
|
4812
|
+
function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, errorHandler, wixAPIFetch, getActiveToken, options, hostName, useCDN) {
|
|
4632
4813
|
return runWithoutContext(() => origFunc({
|
|
4633
4814
|
request: async (factory) => {
|
|
4634
4815
|
const requestOptions = factory({
|
|
@@ -4645,7 +4826,7 @@ function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, wixAPIFetch,
|
|
|
4645
4826
|
}
|
|
4646
4827
|
try {
|
|
4647
4828
|
const biHeader = biHeaderGenerator(requestOptions, publicMetadata, hostName);
|
|
4648
|
-
const
|
|
4829
|
+
const requestOptionsInit = {
|
|
4649
4830
|
method: request.method,
|
|
4650
4831
|
...request.data && {
|
|
4651
4832
|
body: JSON.stringify(request.data)
|
|
@@ -4653,17 +4834,28 @@ function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, wixAPIFetch,
|
|
|
4653
4834
|
headers: {
|
|
4654
4835
|
...biHeader
|
|
4655
4836
|
}
|
|
4656
|
-
}
|
|
4837
|
+
};
|
|
4838
|
+
const res = await boundFetch(url, requestOptionsInit);
|
|
4657
4839
|
if (res.status !== 200) {
|
|
4658
4840
|
let dataError = null;
|
|
4659
4841
|
try {
|
|
4660
4842
|
dataError = await res.json();
|
|
4661
4843
|
} catch (e) {
|
|
4662
4844
|
}
|
|
4663
|
-
|
|
4845
|
+
const error = errorBuilder2(res.status, dataError?.message, dataError?.details, {
|
|
4664
4846
|
requestId: res.headers.get("X-Wix-Request-Id"),
|
|
4665
4847
|
details: dataError
|
|
4666
4848
|
});
|
|
4849
|
+
const transformedError = transformError(error);
|
|
4850
|
+
errorHandler?.handleError(transformedError, {
|
|
4851
|
+
requestOptions: {
|
|
4852
|
+
url: request.url,
|
|
4853
|
+
method: request.method,
|
|
4854
|
+
entityFqdn: requestOptions.entityFqdn,
|
|
4855
|
+
methodFqn: requestOptions.methodFqn
|
|
4856
|
+
}
|
|
4857
|
+
});
|
|
4858
|
+
throw error;
|
|
4667
4859
|
}
|
|
4668
4860
|
const data = await res.json();
|
|
4669
4861
|
return {
|
|
@@ -4684,8 +4876,17 @@ function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, wixAPIFetch,
|
|
|
4684
4876
|
getActiveToken
|
|
4685
4877
|
}));
|
|
4686
4878
|
}
|
|
4879
|
+
var SDKError = class extends Error {
|
|
4880
|
+
response;
|
|
4881
|
+
requestId;
|
|
4882
|
+
constructor(params) {
|
|
4883
|
+
super();
|
|
4884
|
+
this.response = params.response;
|
|
4885
|
+
this.requestId = params.requestId;
|
|
4886
|
+
}
|
|
4887
|
+
};
|
|
4687
4888
|
var errorBuilder2 = (code, description, details, data) => {
|
|
4688
|
-
return {
|
|
4889
|
+
return new SDKError({
|
|
4689
4890
|
response: {
|
|
4690
4891
|
data: {
|
|
4691
4892
|
details: {
|
|
@@ -4703,7 +4904,7 @@ var errorBuilder2 = (code, description, details, data) => {
|
|
|
4703
4904
|
status: code
|
|
4704
4905
|
},
|
|
4705
4906
|
requestId: data?.requestId
|
|
4706
|
-
};
|
|
4907
|
+
});
|
|
4707
4908
|
};
|
|
4708
4909
|
|
|
4709
4910
|
// ../../node_modules/@wix/sdk/build/nanoevents.js
|
|
@@ -4945,28 +5146,51 @@ function createClient(config) {
|
|
|
4945
5146
|
...config.host?.essentials?.passThroughHeaders,
|
|
4946
5147
|
..._headers[X_WIX_CONSISTENT_HEADER] ? { [X_WIX_CONSISTENT_HEADER]: _headers[X_WIX_CONSISTENT_HEADER] } : {}
|
|
4947
5148
|
};
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
5149
|
+
const errorHandler = config.host?.getErrorHandler?.();
|
|
5150
|
+
try {
|
|
5151
|
+
if (typeof urlOrRequest === "string" || urlOrRequest instanceof URL) {
|
|
5152
|
+
const response = await fetch(urlOrRequest, {
|
|
5153
|
+
...requestInit,
|
|
5154
|
+
headers
|
|
5155
|
+
});
|
|
5156
|
+
errorHandler?.handleError(response, {
|
|
5157
|
+
requestOptions: {
|
|
5158
|
+
url: urlOrRequest.toString(),
|
|
5159
|
+
method: requestInit?.method
|
|
5160
|
+
}
|
|
5161
|
+
});
|
|
5162
|
+
const consistentHeader = findConsistentHeader(response);
|
|
5163
|
+
if (consistentHeader) {
|
|
5164
|
+
_headers[X_WIX_CONSISTENT_HEADER] = consistentHeader;
|
|
4962
5165
|
}
|
|
5166
|
+
return response;
|
|
5167
|
+
} else {
|
|
5168
|
+
for (const [k, v] of Object.entries(headers)) {
|
|
5169
|
+
if (typeof v === "string") {
|
|
5170
|
+
urlOrRequest.headers.set(k, v);
|
|
5171
|
+
}
|
|
5172
|
+
}
|
|
5173
|
+
const response = await fetch(urlOrRequest, requestInit);
|
|
5174
|
+
errorHandler?.handleError(response, {
|
|
5175
|
+
requestOptions: {
|
|
5176
|
+
url: urlOrRequest.url,
|
|
5177
|
+
method: requestInit?.method
|
|
5178
|
+
}
|
|
5179
|
+
});
|
|
5180
|
+
const consistentHeader = findConsistentHeader(response);
|
|
5181
|
+
if (consistentHeader) {
|
|
5182
|
+
_headers[X_WIX_CONSISTENT_HEADER] = consistentHeader;
|
|
5183
|
+
}
|
|
5184
|
+
return response;
|
|
4963
5185
|
}
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
5186
|
+
} catch (e) {
|
|
5187
|
+
errorHandler?.handleError(e, {
|
|
5188
|
+
requestOptions: {
|
|
5189
|
+
url: typeof urlOrRequest === "string" || urlOrRequest instanceof URL ? urlOrRequest.toString() : urlOrRequest.url,
|
|
5190
|
+
method: requestInit?.method
|
|
5191
|
+
}
|
|
5192
|
+
});
|
|
5193
|
+
throw e;
|
|
4970
5194
|
}
|
|
4971
5195
|
};
|
|
4972
5196
|
const { client: servicePluginsClient, initModule: initServicePluginModule } = servicePluginsModules(authStrategy);
|
|
@@ -5005,7 +5229,7 @@ function createClient(config) {
|
|
|
5005
5229
|
}
|
|
5006
5230
|
const apiBaseUrl = config.host?.apiBaseUrl ?? DEFAULT_API_URL;
|
|
5007
5231
|
const shouldUseCDN = config.useCDN === void 0 ? config.auth?.shouldUseCDN : config.useCDN;
|
|
5008
|
-
return buildRESTDescriptor(runWithoutContext(() => isAmbassadorModule(modules)) ? toHTTPModule(modules) : modules, metadata ?? {}, boundFetch, (relativeUrl, fetchOptions) => {
|
|
5232
|
+
return buildRESTDescriptor(runWithoutContext(() => isAmbassadorModule(modules)) ? toHTTPModule(modules) : modules, metadata ?? {}, boundFetch, config.host?.getErrorHandler?.(), (relativeUrl, fetchOptions) => {
|
|
5009
5233
|
const finalUrl = new URL(relativeUrl, `https://${apiBaseUrl}`);
|
|
5010
5234
|
finalUrl.host = apiBaseUrl;
|
|
5011
5235
|
finalUrl.protocol = "https";
|
|
@@ -8014,10 +8238,10 @@ function dsnFromString(str) {
|
|
|
8014
8238
|
const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match.slice(1);
|
|
8015
8239
|
let path = "";
|
|
8016
8240
|
let projectId = lastPath;
|
|
8017
|
-
const
|
|
8018
|
-
if (
|
|
8019
|
-
path =
|
|
8020
|
-
projectId =
|
|
8241
|
+
const split2 = projectId.split("/");
|
|
8242
|
+
if (split2.length > 1) {
|
|
8243
|
+
path = split2.slice(0, -1).join("/");
|
|
8244
|
+
projectId = split2.pop();
|
|
8021
8245
|
}
|
|
8022
8246
|
if (projectId) {
|
|
8023
8247
|
const projectMatch = projectId.match(/^\d+/);
|