@wix/cli-app 1.1.107 → 1.1.109
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-PYSE647R.js} +2 -2
- package/build/{DevCommand-BWRRKEE6.js → DevCommand-47DRWF4R.js} +21 -12
- package/build/DevCommand-47DRWF4R.js.map +1 -0
- package/build/{GenerateCommand-IO6ENBOG.js → GenerateCommand-MEGRT44D.js} +47 -8
- package/build/GenerateCommand-MEGRT44D.js.map +1 -0
- package/build/{LogsCommand-C62QNN65.js → LogsCommand-35KRDK3E.js} +3 -3
- package/build/PreviewCommand-GQW2OPCK.js +19 -0
- package/build/ReleaseCommand-ALWL544L.js +23 -0
- package/build/{ServeCommand-NDUXIY75.js → ServeCommand-WNAWBSEY.js} +3 -3
- package/build/{build-ZO7CXGLN.js → build-R56FZRMN.js} +6 -6
- package/build/{chunk-VCFM6SMQ.js → chunk-2KUXKFJH.js} +123 -7
- package/build/{chunk-VCFM6SMQ.js.map → chunk-2KUXKFJH.js.map} +1 -1
- package/build/{chunk-GFXZXRO4.js → chunk-4GWPHNUS.js} +2 -2
- package/build/{chunk-6X7N6N75.js → chunk-66VY7ARJ.js} +6 -6
- package/build/{chunk-HNIJZROR.js → chunk-6Q3BEA5C.js} +6 -6
- package/build/{chunk-AKBVXZXO.js → chunk-A7WZ6FHJ.js} +14 -2
- package/build/{chunk-AKBVXZXO.js.map → chunk-A7WZ6FHJ.js.map} +1 -1
- package/build/{chunk-77PR2TSF.js → chunk-FWX34HZ7.js} +2 -2
- package/build/{chunk-OSDDOY2U.js → chunk-GHYEXMIR.js} +211 -54
- package/build/chunk-GHYEXMIR.js.map +1 -0
- package/build/{chunk-HJXYDXED.js → chunk-HDVE7E5R.js} +5 -5
- package/build/{chunk-VV6PV2NF.js → chunk-JZWZBBAJ.js} +5 -5
- package/build/{chunk-TZ37SYKU.js → chunk-N4KQP2BW.js} +2 -2
- package/build/{chunk-EC7IFTLG.js → chunk-NVAKZ24R.js} +8 -2
- package/build/{chunk-EC7IFTLG.js.map → chunk-NVAKZ24R.js.map} +1 -1
- package/build/{chunk-657KFISY.js → chunk-PRD4POH5.js} +2 -2
- package/build/{chunk-EH63OURU.js → chunk-TFY3JGVI.js} +2 -2
- package/build/{chunk-VJAMKDBT.js → chunk-WDIOSFX7.js} +3 -3
- package/build/{chunk-PSN6WZCB.js → chunk-WGYBD2WD.js} +23 -11
- package/build/{chunk-PSN6WZCB.js.map → chunk-WGYBD2WD.js.map} +1 -1
- package/build/{chunk-7B3P7MZT.js → chunk-YHTG4FUT.js} +3 -3
- package/build/{chunk-MK5OQBNN.js → chunk-ZA36AHE5.js} +2 -2
- package/build/{chunk-5ZI5USPK.js → chunk-ZHQREOZP.js} +10 -1
- package/build/chunk-ZHQREOZP.js.map +1 -0
- package/build/cloudflare-runtime/entry.js +256 -32
- package/build/cloudflare-runtime/getRegisteredExtensions.js +252 -28
- package/build/index.js +59 -41
- package/build/index.js.map +1 -1
- 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-C34XK2F7.js} +13 -13
- package/build/{release-YOEGOFAT.js → release-EUKZ7O55.js} +15 -15
- package/build/{render-command-FI2MU2Z5.js → render-command-C6PXMRQM.js} +6 -6
- package/package.json +6 -6
- package/build/DevCommand-BWRRKEE6.js.map +0 -1
- package/build/GenerateCommand-IO6ENBOG.js.map +0 -1
- package/build/PreviewCommand-YAYKKYRN.js +0 -19
- package/build/ReleaseCommand-77SWCHH2.js +0 -23
- package/build/chunk-5ZI5USPK.js.map +0 -1
- package/build/chunk-OSDDOY2U.js.map +0 -1
- 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-PYSE647R.js.map} +0 -0
- /package/build/{LogsCommand-C62QNN65.js.map → LogsCommand-35KRDK3E.js.map} +0 -0
- /package/build/{PreviewCommand-YAYKKYRN.js.map → PreviewCommand-GQW2OPCK.js.map} +0 -0
- /package/build/{ReleaseCommand-77SWCHH2.js.map → ReleaseCommand-ALWL544L.js.map} +0 -0
- /package/build/{ServeCommand-NDUXIY75.js.map → ServeCommand-WNAWBSEY.js.map} +0 -0
- /package/build/{build-ZO7CXGLN.js.map → build-R56FZRMN.js.map} +0 -0
- /package/build/{chunk-GFXZXRO4.js.map → chunk-4GWPHNUS.js.map} +0 -0
- /package/build/{chunk-6X7N6N75.js.map → chunk-66VY7ARJ.js.map} +0 -0
- /package/build/{chunk-HNIJZROR.js.map → chunk-6Q3BEA5C.js.map} +0 -0
- /package/build/{chunk-77PR2TSF.js.map → chunk-FWX34HZ7.js.map} +0 -0
- /package/build/{chunk-HJXYDXED.js.map → chunk-HDVE7E5R.js.map} +0 -0
- /package/build/{chunk-VV6PV2NF.js.map → chunk-JZWZBBAJ.js.map} +0 -0
- /package/build/{chunk-TZ37SYKU.js.map → chunk-N4KQP2BW.js.map} +0 -0
- /package/build/{chunk-657KFISY.js.map → chunk-PRD4POH5.js.map} +0 -0
- /package/build/{chunk-EH63OURU.js.map → chunk-TFY3JGVI.js.map} +0 -0
- /package/build/{chunk-VJAMKDBT.js.map → chunk-WDIOSFX7.js.map} +0 -0
- /package/build/{chunk-7B3P7MZT.js.map → chunk-YHTG4FUT.js.map} +0 -0
- /package/build/{chunk-MK5OQBNN.js.map → chunk-ZA36AHE5.js.map} +0 -0
- /package/build/{preview-ZGAFDUGX.js.map → preview-C34XK2F7.js.map} +0 -0
- /package/build/{release-YOEGOFAT.js.map → release-EUKZ7O55.js.map} +0 -0
- /package/build/{render-command-FI2MU2Z5.js.map → render-command-C6PXMRQM.js.map} +0 -0
|
@@ -4438,7 +4438,7 @@ function objectToKeyValue(input) {
|
|
|
4438
4438
|
return Object.entries(input).filter(([_, value]) => Boolean(value)).map(([key, value]) => `${key}=${value}`).join(",");
|
|
4439
4439
|
}
|
|
4440
4440
|
|
|
4441
|
-
// ../../node_modules/@wix/sdk-runtime/build/context.js
|
|
4441
|
+
// ../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/context.js
|
|
4442
4442
|
function runWithoutContext(fn) {
|
|
4443
4443
|
const globalContext = globalThis.__wix_context__;
|
|
4444
4444
|
const moduleContext = {
|
|
@@ -4470,8 +4470,189 @@ function runWithoutContext(fn) {
|
|
|
4470
4470
|
}
|
|
4471
4471
|
}
|
|
4472
4472
|
|
|
4473
|
+
// ../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/utils.js
|
|
4474
|
+
function constantCase(input) {
|
|
4475
|
+
return split(input).map((part) => part.toLocaleUpperCase()).join("_");
|
|
4476
|
+
}
|
|
4477
|
+
var SPLIT_LOWER_UPPER_RE = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu");
|
|
4478
|
+
var SPLIT_UPPER_UPPER_RE = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu");
|
|
4479
|
+
var SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
4480
|
+
var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
4481
|
+
function split(value) {
|
|
4482
|
+
let result = value.trim();
|
|
4483
|
+
result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
4484
|
+
result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
4485
|
+
let start = 0;
|
|
4486
|
+
let end = result.length;
|
|
4487
|
+
while (result.charAt(start) === "\0") {
|
|
4488
|
+
start++;
|
|
4489
|
+
}
|
|
4490
|
+
if (start === end) {
|
|
4491
|
+
return [];
|
|
4492
|
+
}
|
|
4493
|
+
while (result.charAt(end - 1) === "\0") {
|
|
4494
|
+
end--;
|
|
4495
|
+
}
|
|
4496
|
+
return result.slice(start, end).split(/\0/g);
|
|
4497
|
+
}
|
|
4498
|
+
|
|
4499
|
+
// ../../node_modules/@wix/sdk/node_modules/@wix/sdk-runtime/build/transform-error.js
|
|
4500
|
+
var isValidationError = (httpClientError) => "validationError" in (httpClientError.response?.data?.details ?? {});
|
|
4501
|
+
var isApplicationError = (httpClientError) => "applicationError" in (httpClientError.response?.data?.details ?? {});
|
|
4502
|
+
var isClientError = (httpClientError) => (httpClientError.response?.status ?? -1) >= 400 && (httpClientError.response?.status ?? -1) < 500;
|
|
4503
|
+
function transformError(httpClientError, pathsToArguments = {
|
|
4504
|
+
explicitPathsToArguments: {},
|
|
4505
|
+
spreadPathsToArguments: {},
|
|
4506
|
+
singleArgumentUnchanged: false
|
|
4507
|
+
}, argumentNames = []) {
|
|
4508
|
+
if (typeof httpClientError !== "object" || httpClientError === null) {
|
|
4509
|
+
throw httpClientError;
|
|
4510
|
+
}
|
|
4511
|
+
if (isValidationError(httpClientError)) {
|
|
4512
|
+
return buildValidationError(httpClientError, pathsToArguments, argumentNames);
|
|
4513
|
+
}
|
|
4514
|
+
if (isApplicationError(httpClientError)) {
|
|
4515
|
+
return buildApplicationError(httpClientError);
|
|
4516
|
+
}
|
|
4517
|
+
if (isClientError(httpClientError)) {
|
|
4518
|
+
const status = httpClientError.response?.status;
|
|
4519
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
4520
|
+
const message2 = httpClientError.response?.data?.message ?? statusText;
|
|
4521
|
+
const details = {
|
|
4522
|
+
applicationError: {
|
|
4523
|
+
description: statusText,
|
|
4524
|
+
code: constantCase(statusText),
|
|
4525
|
+
data: {}
|
|
4526
|
+
},
|
|
4527
|
+
requestId: httpClientError.requestId
|
|
4528
|
+
};
|
|
4529
|
+
return wrapError(httpClientError, {
|
|
4530
|
+
message: JSON.stringify({
|
|
4531
|
+
message: message2,
|
|
4532
|
+
details
|
|
4533
|
+
}, null, 2),
|
|
4534
|
+
extraProperties: {
|
|
4535
|
+
details,
|
|
4536
|
+
status
|
|
4537
|
+
}
|
|
4538
|
+
});
|
|
4539
|
+
}
|
|
4540
|
+
return buildSystemError(httpClientError);
|
|
4541
|
+
}
|
|
4542
|
+
var buildValidationError = (httpClientError, pathsToArguments, argumentNames) => {
|
|
4543
|
+
const validationErrorResponse = httpClientError.response?.data;
|
|
4544
|
+
const requestId = httpClientError.requestId;
|
|
4545
|
+
const { fieldViolations } = validationErrorResponse.details.validationError;
|
|
4546
|
+
const transformedFieldViolations = violationsWithRenamedFields(pathsToArguments, fieldViolations, argumentNames)?.sort((a, b) => a.field < b.field ? -1 : 1);
|
|
4547
|
+
const message2 = `INVALID_ARGUMENT: ${transformedFieldViolations?.map(({ field, description }) => `"${field}" ${description}`)?.join(", ")}`;
|
|
4548
|
+
const details = {
|
|
4549
|
+
validationError: { fieldViolations: transformedFieldViolations },
|
|
4550
|
+
requestId
|
|
4551
|
+
};
|
|
4552
|
+
return wrapError(httpClientError, {
|
|
4553
|
+
message: JSON.stringify({ message: message2, details }, null, 2),
|
|
4554
|
+
extraProperties: {
|
|
4555
|
+
details,
|
|
4556
|
+
status: httpClientError.response?.status,
|
|
4557
|
+
requestId
|
|
4558
|
+
}
|
|
4559
|
+
});
|
|
4560
|
+
};
|
|
4561
|
+
var wrapError = (baseError, { message: message2, extraProperties }) => {
|
|
4562
|
+
return Object.assign(baseError, {
|
|
4563
|
+
...extraProperties,
|
|
4564
|
+
message: message2
|
|
4565
|
+
});
|
|
4566
|
+
};
|
|
4567
|
+
var buildApplicationError = (httpClientError) => {
|
|
4568
|
+
const status = httpClientError.response?.status;
|
|
4569
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
4570
|
+
const message2 = httpClientError.response?.data?.message ?? statusText;
|
|
4571
|
+
const description = httpClientError.response?.data?.details?.applicationError?.description ?? statusText;
|
|
4572
|
+
const code = httpClientError.response?.data?.details?.applicationError?.code ?? constantCase(statusText);
|
|
4573
|
+
const data = httpClientError.response?.data?.details?.applicationError?.data ?? {};
|
|
4574
|
+
const combinedMessage = message2 === description ? message2 : `${message2}: ${description}`;
|
|
4575
|
+
const details = {
|
|
4576
|
+
applicationError: {
|
|
4577
|
+
description,
|
|
4578
|
+
code,
|
|
4579
|
+
data
|
|
4580
|
+
},
|
|
4581
|
+
requestId: httpClientError.requestId
|
|
4582
|
+
};
|
|
4583
|
+
return wrapError(httpClientError, {
|
|
4584
|
+
message: JSON.stringify({ message: combinedMessage, details }, null, 2),
|
|
4585
|
+
extraProperties: {
|
|
4586
|
+
details,
|
|
4587
|
+
status,
|
|
4588
|
+
requestId: httpClientError.requestId
|
|
4589
|
+
}
|
|
4590
|
+
});
|
|
4591
|
+
};
|
|
4592
|
+
var buildSystemError = (httpClientError) => {
|
|
4593
|
+
const message2 = httpClientError.requestId ? `System error occurred, request-id: ${httpClientError.requestId}` : `System error occurred: ${JSON.stringify(httpClientError)}`;
|
|
4594
|
+
return wrapError(httpClientError, {
|
|
4595
|
+
message: message2,
|
|
4596
|
+
extraProperties: {
|
|
4597
|
+
requestId: httpClientError.requestId,
|
|
4598
|
+
status: httpClientError.response?.status,
|
|
4599
|
+
code: constantCase(httpClientError.response?.statusText ?? "UNKNOWN"),
|
|
4600
|
+
...!httpClientError.response && {
|
|
4601
|
+
runtimeError: httpClientError
|
|
4602
|
+
}
|
|
4603
|
+
}
|
|
4604
|
+
});
|
|
4605
|
+
};
|
|
4606
|
+
var violationsWithRenamedFields = ({ spreadPathsToArguments, explicitPathsToArguments, singleArgumentUnchanged }, fieldViolations, argumentNames) => {
|
|
4607
|
+
const allPathsToArguments = {
|
|
4608
|
+
...spreadPathsToArguments,
|
|
4609
|
+
...explicitPathsToArguments
|
|
4610
|
+
};
|
|
4611
|
+
const allPathsToArgumentsKeys = Object.keys(allPathsToArguments);
|
|
4612
|
+
return fieldViolations?.filter((fieldViolation) => {
|
|
4613
|
+
const containedInAMoreSpecificViolationField = fieldViolations.some((anotherViolation) => anotherViolation.field.length > fieldViolation.field.length && anotherViolation.field.startsWith(fieldViolation.field) && allPathsToArgumentsKeys.includes(anotherViolation.field));
|
|
4614
|
+
return !containedInAMoreSpecificViolationField;
|
|
4615
|
+
}).map((fieldViolation) => {
|
|
4616
|
+
const exactMatchArgumentExpression = explicitPathsToArguments[fieldViolation.field];
|
|
4617
|
+
if (exactMatchArgumentExpression) {
|
|
4618
|
+
return {
|
|
4619
|
+
...fieldViolation,
|
|
4620
|
+
field: withRenamedArgument(exactMatchArgumentExpression, argumentNames)
|
|
4621
|
+
};
|
|
4622
|
+
}
|
|
4623
|
+
const longestPartialPathMatch = allPathsToArgumentsKeys?.sort((a, b) => b.length - a.length)?.find((path) => fieldViolation.field.startsWith(path));
|
|
4624
|
+
if (longestPartialPathMatch) {
|
|
4625
|
+
const partialMatchArgumentExpression = allPathsToArguments[longestPartialPathMatch];
|
|
4626
|
+
if (partialMatchArgumentExpression) {
|
|
4627
|
+
return {
|
|
4628
|
+
...fieldViolation,
|
|
4629
|
+
field: fieldViolation.field.replace(longestPartialPathMatch, withRenamedArgument(partialMatchArgumentExpression, argumentNames))
|
|
4630
|
+
};
|
|
4631
|
+
}
|
|
4632
|
+
}
|
|
4633
|
+
if (singleArgumentUnchanged) {
|
|
4634
|
+
return {
|
|
4635
|
+
...fieldViolation,
|
|
4636
|
+
field: `${argumentNames[0]}.${fieldViolation.field}`
|
|
4637
|
+
};
|
|
4638
|
+
}
|
|
4639
|
+
return fieldViolation;
|
|
4640
|
+
});
|
|
4641
|
+
};
|
|
4642
|
+
var withRenamedArgument = (fieldValue, argumentNames) => {
|
|
4643
|
+
const argIndex = getArgumentIndex(fieldValue);
|
|
4644
|
+
if (argIndex !== null && typeof argIndex !== "undefined") {
|
|
4645
|
+
return fieldValue.replace(`$[${argIndex}]`, argumentNames[argIndex]);
|
|
4646
|
+
}
|
|
4647
|
+
return fieldValue;
|
|
4648
|
+
};
|
|
4649
|
+
var getArgumentIndex = (s) => {
|
|
4650
|
+
const match = s.match(/\$\[(?<argIndex>\d+)\]/);
|
|
4651
|
+
return match && match.groups && Number(match.groups.argIndex);
|
|
4652
|
+
};
|
|
4653
|
+
|
|
4473
4654
|
// ../../node_modules/@wix/sdk/build/rest-modules.js
|
|
4474
|
-
function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, wixAPIFetch, getActiveToken, options, hostName, useCDN) {
|
|
4655
|
+
function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, errorHandler, wixAPIFetch, getActiveToken, options, hostName, useCDN) {
|
|
4475
4656
|
return runWithoutContext(() => origFunc({
|
|
4476
4657
|
request: async (factory) => {
|
|
4477
4658
|
const requestOptions = factory({
|
|
@@ -4488,7 +4669,7 @@ function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, wixAPIFetch,
|
|
|
4488
4669
|
}
|
|
4489
4670
|
try {
|
|
4490
4671
|
const biHeader = biHeaderGenerator(requestOptions, publicMetadata, hostName);
|
|
4491
|
-
const
|
|
4672
|
+
const requestOptionsInit = {
|
|
4492
4673
|
method: request.method,
|
|
4493
4674
|
...request.data && {
|
|
4494
4675
|
body: JSON.stringify(request.data)
|
|
@@ -4496,17 +4677,28 @@ function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, wixAPIFetch,
|
|
|
4496
4677
|
headers: {
|
|
4497
4678
|
...biHeader
|
|
4498
4679
|
}
|
|
4499
|
-
}
|
|
4680
|
+
};
|
|
4681
|
+
const res = await boundFetch(url, requestOptionsInit);
|
|
4500
4682
|
if (res.status !== 200) {
|
|
4501
4683
|
let dataError = null;
|
|
4502
4684
|
try {
|
|
4503
4685
|
dataError = await res.json();
|
|
4504
4686
|
} catch (e) {
|
|
4505
4687
|
}
|
|
4506
|
-
|
|
4688
|
+
const error = errorBuilder2(res.status, dataError?.message, dataError?.details, {
|
|
4507
4689
|
requestId: res.headers.get("X-Wix-Request-Id"),
|
|
4508
4690
|
details: dataError
|
|
4509
4691
|
});
|
|
4692
|
+
const transformedError = transformError(error);
|
|
4693
|
+
errorHandler?.handleError(transformedError, {
|
|
4694
|
+
requestOptions: {
|
|
4695
|
+
url: request.url,
|
|
4696
|
+
method: request.method,
|
|
4697
|
+
entityFqdn: requestOptions.entityFqdn,
|
|
4698
|
+
methodFqn: requestOptions.methodFqn
|
|
4699
|
+
}
|
|
4700
|
+
});
|
|
4701
|
+
throw error;
|
|
4510
4702
|
}
|
|
4511
4703
|
const data = await res.json();
|
|
4512
4704
|
return {
|
|
@@ -4527,8 +4719,17 @@ function buildRESTDescriptor(origFunc, publicMetadata, boundFetch, wixAPIFetch,
|
|
|
4527
4719
|
getActiveToken
|
|
4528
4720
|
}));
|
|
4529
4721
|
}
|
|
4722
|
+
var SDKError = class extends Error {
|
|
4723
|
+
response;
|
|
4724
|
+
requestId;
|
|
4725
|
+
constructor(params) {
|
|
4726
|
+
super();
|
|
4727
|
+
this.response = params.response;
|
|
4728
|
+
this.requestId = params.requestId;
|
|
4729
|
+
}
|
|
4730
|
+
};
|
|
4530
4731
|
var errorBuilder2 = (code, description, details, data) => {
|
|
4531
|
-
return {
|
|
4732
|
+
return new SDKError({
|
|
4532
4733
|
response: {
|
|
4533
4734
|
data: {
|
|
4534
4735
|
details: {
|
|
@@ -4546,7 +4747,7 @@ var errorBuilder2 = (code, description, details, data) => {
|
|
|
4546
4747
|
status: code
|
|
4547
4748
|
},
|
|
4548
4749
|
requestId: data?.requestId
|
|
4549
|
-
};
|
|
4750
|
+
});
|
|
4550
4751
|
};
|
|
4551
4752
|
|
|
4552
4753
|
// ../../node_modules/@wix/sdk/build/nanoevents.js
|
|
@@ -4788,28 +4989,51 @@ function createClient(config) {
|
|
|
4788
4989
|
...config.host?.essentials?.passThroughHeaders,
|
|
4789
4990
|
..._headers[X_WIX_CONSISTENT_HEADER] ? { [X_WIX_CONSISTENT_HEADER]: _headers[X_WIX_CONSISTENT_HEADER] } : {}
|
|
4790
4991
|
};
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4992
|
+
const errorHandler = config.host?.getErrorHandler?.();
|
|
4993
|
+
try {
|
|
4994
|
+
if (typeof urlOrRequest === "string" || urlOrRequest instanceof URL) {
|
|
4995
|
+
const response = await fetch(urlOrRequest, {
|
|
4996
|
+
...requestInit,
|
|
4997
|
+
headers
|
|
4998
|
+
});
|
|
4999
|
+
errorHandler?.handleError(response, {
|
|
5000
|
+
requestOptions: {
|
|
5001
|
+
url: urlOrRequest.toString(),
|
|
5002
|
+
method: requestInit?.method
|
|
5003
|
+
}
|
|
5004
|
+
});
|
|
5005
|
+
const consistentHeader = findConsistentHeader(response);
|
|
5006
|
+
if (consistentHeader) {
|
|
5007
|
+
_headers[X_WIX_CONSISTENT_HEADER] = consistentHeader;
|
|
4805
5008
|
}
|
|
5009
|
+
return response;
|
|
5010
|
+
} else {
|
|
5011
|
+
for (const [k, v] of Object.entries(headers)) {
|
|
5012
|
+
if (typeof v === "string") {
|
|
5013
|
+
urlOrRequest.headers.set(k, v);
|
|
5014
|
+
}
|
|
5015
|
+
}
|
|
5016
|
+
const response = await fetch(urlOrRequest, requestInit);
|
|
5017
|
+
errorHandler?.handleError(response, {
|
|
5018
|
+
requestOptions: {
|
|
5019
|
+
url: urlOrRequest.url,
|
|
5020
|
+
method: requestInit?.method
|
|
5021
|
+
}
|
|
5022
|
+
});
|
|
5023
|
+
const consistentHeader = findConsistentHeader(response);
|
|
5024
|
+
if (consistentHeader) {
|
|
5025
|
+
_headers[X_WIX_CONSISTENT_HEADER] = consistentHeader;
|
|
5026
|
+
}
|
|
5027
|
+
return response;
|
|
4806
5028
|
}
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
5029
|
+
} catch (e) {
|
|
5030
|
+
errorHandler?.handleError(e, {
|
|
5031
|
+
requestOptions: {
|
|
5032
|
+
url: typeof urlOrRequest === "string" || urlOrRequest instanceof URL ? urlOrRequest.toString() : urlOrRequest.url,
|
|
5033
|
+
method: requestInit?.method
|
|
5034
|
+
}
|
|
5035
|
+
});
|
|
5036
|
+
throw e;
|
|
4813
5037
|
}
|
|
4814
5038
|
};
|
|
4815
5039
|
const { client: servicePluginsClient, initModule: initServicePluginModule } = servicePluginsModules(authStrategy);
|
|
@@ -4848,7 +5072,7 @@ function createClient(config) {
|
|
|
4848
5072
|
}
|
|
4849
5073
|
const apiBaseUrl = config.host?.apiBaseUrl ?? DEFAULT_API_URL;
|
|
4850
5074
|
const shouldUseCDN = config.useCDN === void 0 ? config.auth?.shouldUseCDN : config.useCDN;
|
|
4851
|
-
return buildRESTDescriptor(runWithoutContext(() => isAmbassadorModule(modules)) ? toHTTPModule(modules) : modules, metadata ?? {}, boundFetch, (relativeUrl, fetchOptions) => {
|
|
5075
|
+
return buildRESTDescriptor(runWithoutContext(() => isAmbassadorModule(modules)) ? toHTTPModule(modules) : modules, metadata ?? {}, boundFetch, config.host?.getErrorHandler?.(), (relativeUrl, fetchOptions) => {
|
|
4852
5076
|
const finalUrl = new URL(relativeUrl, `https://${apiBaseUrl}`);
|
|
4853
5077
|
finalUrl.host = apiBaseUrl;
|
|
4854
5078
|
finalUrl.protocol = "https";
|
package/build/index.js
CHANGED
|
@@ -3,18 +3,18 @@ const require = _createRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
createI18nT,
|
|
5
5
|
docsExtensionTypeSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YHTG4FUT.js";
|
|
7
7
|
import {
|
|
8
8
|
runCommand
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-JZWZBBAJ.js";
|
|
10
|
+
import "./chunk-4GWPHNUS.js";
|
|
11
|
+
import "./chunk-ZHQREOZP.js";
|
|
12
|
+
import "./chunk-PRD4POH5.js";
|
|
13
13
|
import {
|
|
14
14
|
package_default,
|
|
15
15
|
require_react,
|
|
16
16
|
z
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2KUXKFJH.js";
|
|
18
18
|
import {
|
|
19
19
|
__commonJS,
|
|
20
20
|
__require,
|
|
@@ -3377,33 +3377,14 @@ var {
|
|
|
3377
3377
|
// src/commands/build.ts
|
|
3378
3378
|
init_esm_shims();
|
|
3379
3379
|
var buildCommand = (services) => createCommand("build").action(async (_, command) => {
|
|
3380
|
-
const { runCommand: runCommand2 } = await import("./render-command-
|
|
3381
|
-
const { build } = await import("./build-
|
|
3380
|
+
const { runCommand: runCommand2 } = await import("./render-command-C6PXMRQM.js");
|
|
3381
|
+
const { build } = await import("./build-R56FZRMN.js");
|
|
3382
3382
|
await runCommand2(command, services, build);
|
|
3383
3383
|
});
|
|
3384
3384
|
|
|
3385
3385
|
// src/commands/dev.tsx
|
|
3386
3386
|
init_esm_shims();
|
|
3387
3387
|
var import_react = __toESM(require_react(), 1);
|
|
3388
|
-
var devCommand = (services) => {
|
|
3389
|
-
const t = createI18nT();
|
|
3390
|
-
return createCommand("dev").option("-s, --https", t("dev_command_def.option.https")).action(async (options, command) => {
|
|
3391
|
-
const { DevCommand } = await import("./DevCommand-BWRRKEE6.js");
|
|
3392
|
-
const { renderCommand } = await import("./render-command-FI2MU2Z5.js");
|
|
3393
|
-
const { https = false } = options;
|
|
3394
|
-
await renderCommand(command, services, /* @__PURE__ */ import_react.default.createElement(DevCommand, { https }), {
|
|
3395
|
-
watchForModelChanges: true
|
|
3396
|
-
});
|
|
3397
|
-
});
|
|
3398
|
-
};
|
|
3399
|
-
|
|
3400
|
-
// src/commands/preview.tsx
|
|
3401
|
-
init_esm_shims();
|
|
3402
|
-
var import_react2 = __toESM(require_react(), 1);
|
|
3403
|
-
|
|
3404
|
-
// ../cli-command-contract/src/index.ts
|
|
3405
|
-
init_esm_shims();
|
|
3406
|
-
var NO_TTY_JSON_OUTPUT_OPTION = "--json";
|
|
3407
3388
|
|
|
3408
3389
|
// src/commands/validations.ts
|
|
3409
3390
|
init_esm_shims();
|
|
@@ -3421,6 +3402,15 @@ function validateBase(value) {
|
|
|
3421
3402
|
}
|
|
3422
3403
|
throw new InvalidArgumentError("Value must be a valid URL");
|
|
3423
3404
|
}
|
|
3405
|
+
function validatePort(value) {
|
|
3406
|
+
const parsed = z.coerce.number().int().gte(1e3).lte(65535).safeParse(value);
|
|
3407
|
+
if (parsed.success) {
|
|
3408
|
+
return parsed.data;
|
|
3409
|
+
}
|
|
3410
|
+
throw new InvalidArgumentError(
|
|
3411
|
+
`Port must be a valid number between 1000 and 65535`
|
|
3412
|
+
);
|
|
3413
|
+
}
|
|
3424
3414
|
function validateDocsExtensionType(value) {
|
|
3425
3415
|
const parsed = docsExtensionTypeSchema.safeParse(value);
|
|
3426
3416
|
if (parsed.success) {
|
|
@@ -3447,6 +3437,34 @@ function validateReleaseComment(value) {
|
|
|
3447
3437
|
);
|
|
3448
3438
|
}
|
|
3449
3439
|
|
|
3440
|
+
// src/commands/dev.tsx
|
|
3441
|
+
var devCommand = (services) => {
|
|
3442
|
+
const t = createI18nT();
|
|
3443
|
+
return createCommand("dev").option("-s, --https", t("dev_command_def.option.https")).option("--port <port>", t("dev_command_def.option.port"), validatePort).addOption(
|
|
3444
|
+
new Option("--origin <url>", t("dev_command_def.option.origin")).argParser(validateBase).hideHelp()
|
|
3445
|
+
).action(async (options, command) => {
|
|
3446
|
+
const { DevCommand } = await import("./DevCommand-47DRWF4R.js");
|
|
3447
|
+
const { renderCommand } = await import("./render-command-C6PXMRQM.js");
|
|
3448
|
+
const { https = false, origin, port } = options;
|
|
3449
|
+
await renderCommand(
|
|
3450
|
+
command,
|
|
3451
|
+
services,
|
|
3452
|
+
/* @__PURE__ */ import_react.default.createElement(DevCommand, { https, origin, port }),
|
|
3453
|
+
{
|
|
3454
|
+
watchForModelChanges: true
|
|
3455
|
+
}
|
|
3456
|
+
);
|
|
3457
|
+
});
|
|
3458
|
+
};
|
|
3459
|
+
|
|
3460
|
+
// src/commands/preview.tsx
|
|
3461
|
+
init_esm_shims();
|
|
3462
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
3463
|
+
|
|
3464
|
+
// ../cli-command-contract/src/index.ts
|
|
3465
|
+
init_esm_shims();
|
|
3466
|
+
var NO_TTY_JSON_OUTPUT_OPTION = "--json";
|
|
3467
|
+
|
|
3450
3468
|
// src/commands/preview.tsx
|
|
3451
3469
|
var previewCommand = (services) => {
|
|
3452
3470
|
const t = createI18nT();
|
|
@@ -3465,17 +3483,17 @@ var previewCommand = (services) => {
|
|
|
3465
3483
|
).hideHelp()
|
|
3466
3484
|
).action(async (options, command) => {
|
|
3467
3485
|
const { site, baseUrl, json } = options;
|
|
3468
|
-
const { renderCommand, runCommand: runCommand2 } = await import("./render-command-
|
|
3486
|
+
const { renderCommand, runCommand: runCommand2 } = await import("./render-command-C6PXMRQM.js");
|
|
3469
3487
|
if (json) {
|
|
3470
3488
|
return runCommand2(command, services, async (model) => {
|
|
3471
|
-
const { nonInteractivePreview } = await import("./preview-
|
|
3489
|
+
const { nonInteractivePreview } = await import("./preview-C34XK2F7.js");
|
|
3472
3490
|
return nonInteractivePreview(services, model, {
|
|
3473
3491
|
baseUrl,
|
|
3474
3492
|
siteId: site
|
|
3475
3493
|
});
|
|
3476
3494
|
});
|
|
3477
3495
|
}
|
|
3478
|
-
const { PreviewCommand } = await import("./PreviewCommand-
|
|
3496
|
+
const { PreviewCommand } = await import("./PreviewCommand-GQW2OPCK.js");
|
|
3479
3497
|
await renderCommand(
|
|
3480
3498
|
command,
|
|
3481
3499
|
services,
|
|
@@ -3492,8 +3510,8 @@ var addPermissionCommand = (services) => {
|
|
|
3492
3510
|
return createCommand("add-permission").description("adding a permission to the app").addOption(
|
|
3493
3511
|
new Option("-p, --permission-id <id>", t("the permission id to add"))
|
|
3494
3512
|
).action(async (options, command) => {
|
|
3495
|
-
const { renderCommand } = await import("./render-command-
|
|
3496
|
-
const { AddPermissionCommand } = await import("./AddPermissionCommand-
|
|
3513
|
+
const { renderCommand } = await import("./render-command-C6PXMRQM.js");
|
|
3514
|
+
const { AddPermissionCommand } = await import("./AddPermissionCommand-PYSE647R.js");
|
|
3497
3515
|
const { permissionId = "" } = options;
|
|
3498
3516
|
await renderCommand(
|
|
3499
3517
|
command,
|
|
@@ -3509,8 +3527,8 @@ var import_react4 = __toESM(require_react(), 1);
|
|
|
3509
3527
|
var serveCommand = (services) => {
|
|
3510
3528
|
const t = createI18nT();
|
|
3511
3529
|
return createCommand("serve").description(t("serve_command_def.description")).action(async (_, command) => {
|
|
3512
|
-
const { renderCommand } = await import("./render-command-
|
|
3513
|
-
const { ServeCommandDeprecated } = await import("./ServeCommand-
|
|
3530
|
+
const { renderCommand } = await import("./render-command-C6PXMRQM.js");
|
|
3531
|
+
const { ServeCommandDeprecated } = await import("./ServeCommand-WNAWBSEY.js");
|
|
3514
3532
|
await renderCommand(command, services, /* @__PURE__ */ import_react4.default.createElement(ServeCommandDeprecated, null));
|
|
3515
3533
|
});
|
|
3516
3534
|
};
|
|
@@ -3525,8 +3543,8 @@ var generateCommand = (services) => {
|
|
|
3525
3543
|
t("generate_command.type_flag"),
|
|
3526
3544
|
validateDocsExtensionType
|
|
3527
3545
|
).description(t("generate_command.description")).action(async (options, command) => {
|
|
3528
|
-
const { GenerateCommand } = await import("./GenerateCommand-
|
|
3529
|
-
const { renderCommand } = await import("./render-command-
|
|
3546
|
+
const { GenerateCommand } = await import("./GenerateCommand-MEGRT44D.js");
|
|
3547
|
+
const { renderCommand } = await import("./render-command-C6PXMRQM.js");
|
|
3530
3548
|
const { type } = options;
|
|
3531
3549
|
await renderCommand(
|
|
3532
3550
|
command,
|
|
@@ -3550,8 +3568,8 @@ var logsCommand = (services) => {
|
|
|
3550
3568
|
validateVersion
|
|
3551
3569
|
).action(async (options, command) => {
|
|
3552
3570
|
const { version } = options;
|
|
3553
|
-
const { renderCommand } = await import("./render-command-
|
|
3554
|
-
const { LogsCommand } = await import("./LogsCommand-
|
|
3571
|
+
const { renderCommand } = await import("./render-command-C6PXMRQM.js");
|
|
3572
|
+
const { LogsCommand } = await import("./LogsCommand-35KRDK3E.js");
|
|
3555
3573
|
await renderCommand(command, services, /* @__PURE__ */ import_react6.default.createElement(LogsCommand, { version }));
|
|
3556
3574
|
});
|
|
3557
3575
|
};
|
|
@@ -3584,8 +3602,8 @@ var releaseCommand = (services) => {
|
|
|
3584
3602
|
t("app_preview_command_def.option.json")
|
|
3585
3603
|
).hideHelp()
|
|
3586
3604
|
).action(async (options, command) => {
|
|
3587
|
-
const { renderCommand } = await import("./render-command-
|
|
3588
|
-
const { ReleaseCommand, ReleaseVersionType } = await import("./ReleaseCommand-
|
|
3605
|
+
const { renderCommand } = await import("./render-command-C6PXMRQM.js");
|
|
3606
|
+
const { ReleaseCommand, ReleaseVersionType } = await import("./ReleaseCommand-ALWL544L.js");
|
|
3589
3607
|
const { baseUrl, site, comment, json } = options;
|
|
3590
3608
|
const versionType = options.versionType ? {
|
|
3591
3609
|
major: ReleaseVersionType.MAJOR,
|
|
@@ -3599,7 +3617,7 @@ var releaseCommand = (services) => {
|
|
|
3599
3617
|
};
|
|
3600
3618
|
if (json) {
|
|
3601
3619
|
return runCommand(command, services, async (model) => {
|
|
3602
|
-
const { nonInteractiveRelease } = await import("./release-
|
|
3620
|
+
const { nonInteractiveRelease } = await import("./release-EUKZ7O55.js");
|
|
3603
3621
|
return nonInteractiveRelease(services, model, props);
|
|
3604
3622
|
});
|
|
3605
3623
|
}
|