@wix/create-headless-site 0.0.31 → 0.0.32
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 +38 -12
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -12477,10 +12477,10 @@ var require_error = __commonJS({
|
|
|
12477
12477
|
}
|
|
12478
12478
|
};
|
|
12479
12479
|
exports.HttpError = HttpError;
|
|
12480
|
-
function
|
|
12480
|
+
function createHttpError2(...args) {
|
|
12481
12481
|
return new HttpError(...args);
|
|
12482
12482
|
}
|
|
12483
|
-
exports.createHttpError =
|
|
12483
|
+
exports.createHttpError = createHttpError2;
|
|
12484
12484
|
}
|
|
12485
12485
|
});
|
|
12486
12486
|
|
|
@@ -75907,6 +75907,28 @@ function getHttpErrorInfo(httpError) {
|
|
|
75907
75907
|
};
|
|
75908
75908
|
}
|
|
75909
75909
|
|
|
75910
|
+
// ../cli-http-client/src/fetch-error.ts
|
|
75911
|
+
init_esm_shims();
|
|
75912
|
+
var import_http_client4 = __toESM(require_index_node(), 1);
|
|
75913
|
+
async function createHttpErrorFromFetch(originalResponse) {
|
|
75914
|
+
const res = originalResponse.clone();
|
|
75915
|
+
return (0, import_http_client4.createHttpError)({
|
|
75916
|
+
name: "Error",
|
|
75917
|
+
message: `Request failed with status code ${res.status}`,
|
|
75918
|
+
response: {
|
|
75919
|
+
config: {},
|
|
75920
|
+
data: await res.text(),
|
|
75921
|
+
status: res.status,
|
|
75922
|
+
statusText: res.statusText,
|
|
75923
|
+
headers: Object.fromEntries(res.headers)
|
|
75924
|
+
},
|
|
75925
|
+
code: res.statusText,
|
|
75926
|
+
config: {},
|
|
75927
|
+
toJSON: () => res,
|
|
75928
|
+
__CANCEL__: false
|
|
75929
|
+
});
|
|
75930
|
+
}
|
|
75931
|
+
|
|
75910
75932
|
// ../cli-auth/src/client.ts
|
|
75911
75933
|
var import_variant14 = __toESM(require_lib(), 1);
|
|
75912
75934
|
|
|
@@ -84008,14 +84030,14 @@ var open_default = open;
|
|
|
84008
84030
|
|
|
84009
84031
|
// ../user-browser/src/open-testkit.ts
|
|
84010
84032
|
init_esm_shims();
|
|
84011
|
-
var
|
|
84033
|
+
var import_http_client5 = __toESM(require_index_node(), 1);
|
|
84012
84034
|
async function open2(testEndpoint, url2) {
|
|
84013
|
-
await (0,
|
|
84035
|
+
await (0, import_http_client5.createHttpClient)().post(testEndpoint, void 0, {
|
|
84014
84036
|
params: {
|
|
84015
84037
|
url: url2
|
|
84016
84038
|
}
|
|
84017
84039
|
}).catch((error) => {
|
|
84018
|
-
if (
|
|
84040
|
+
if (import_http_client5.HttpClient.isHttpError(error) && error.response?.data?.message) {
|
|
84019
84041
|
throw new Error(error.response.data.message);
|
|
84020
84042
|
}
|
|
84021
84043
|
throw error;
|
|
@@ -90153,7 +90175,7 @@ init_esm_shims();
|
|
|
90153
90175
|
init_esm_shims();
|
|
90154
90176
|
init_tslib_es6();
|
|
90155
90177
|
var import_wix_bi_logger_client = __toESM(require_dist());
|
|
90156
|
-
var
|
|
90178
|
+
var import_http_client6 = __toESM(require_index_node());
|
|
90157
90179
|
var defaultOptions2 = {
|
|
90158
90180
|
baseUrl: process.env.BI_BASE_URL || "https://frog.wix.com",
|
|
90159
90181
|
endpoint: "",
|
|
@@ -90183,7 +90205,7 @@ var StandaloneNodeLogger = (
|
|
|
90183
90205
|
endpoint = context2.endpoint || fullOptions.endpoint;
|
|
90184
90206
|
baseUrl = fullOptions.baseUrl, userAgent = fullOptions.userAgent, logError = fullOptions.logError;
|
|
90185
90207
|
headers = userAgent ? { headers: { "User-Agent": userAgent } } : {};
|
|
90186
|
-
return [4, new
|
|
90208
|
+
return [4, new import_http_client6.HttpClient({ baseURL: baseUrl }).get(endpoint, {
|
|
90187
90209
|
headers,
|
|
90188
90210
|
params: eventParams,
|
|
90189
90211
|
timeout: 30 * 1e3
|
|
@@ -90354,7 +90376,7 @@ function wixCliCliError(params) {
|
|
|
90354
90376
|
var package_default = {
|
|
90355
90377
|
name: "@wix/create-headless-site",
|
|
90356
90378
|
description: "Headless site creation wizard",
|
|
90357
|
-
version: "0.0.
|
|
90379
|
+
version: "0.0.32",
|
|
90358
90380
|
bin: "bin/index.cjs",
|
|
90359
90381
|
devDependencies: {
|
|
90360
90382
|
"@commander-js/extra-typings": "^13.0.0",
|
|
@@ -102137,7 +102159,8 @@ var BackendAsAServiceClient = class {
|
|
|
102137
102159
|
body: formData
|
|
102138
102160
|
});
|
|
102139
102161
|
if (!response.ok) {
|
|
102140
|
-
|
|
102162
|
+
const error = await createHttpErrorFromFetch(response);
|
|
102163
|
+
throw error;
|
|
102141
102164
|
}
|
|
102142
102165
|
return response.json();
|
|
102143
102166
|
},
|
|
@@ -102147,7 +102170,8 @@ var BackendAsAServiceClient = class {
|
|
|
102147
102170
|
} catch (e2) {
|
|
102148
102171
|
throw new CliError({
|
|
102149
102172
|
code: CliErrorCode.FailedToUploadStaticFiles(),
|
|
102150
|
-
cause: e2
|
|
102173
|
+
cause: e2,
|
|
102174
|
+
info: { endpointUrl }
|
|
102151
102175
|
});
|
|
102152
102176
|
}
|
|
102153
102177
|
};
|
|
@@ -102163,7 +102187,8 @@ var BackendAsAServiceClient = class {
|
|
|
102163
102187
|
body: fileContent
|
|
102164
102188
|
});
|
|
102165
102189
|
if (!response.ok) {
|
|
102166
|
-
|
|
102190
|
+
const error = await createHttpErrorFromFetch(response);
|
|
102191
|
+
throw error;
|
|
102167
102192
|
}
|
|
102168
102193
|
},
|
|
102169
102194
|
{ retries: 3 }
|
|
@@ -102171,7 +102196,8 @@ var BackendAsAServiceClient = class {
|
|
|
102171
102196
|
} catch (e2) {
|
|
102172
102197
|
throw new CliError({
|
|
102173
102198
|
code: CliErrorCode.FailedToUploadStaticFiles(),
|
|
102174
|
-
cause: e2
|
|
102199
|
+
cause: e2,
|
|
102200
|
+
info: { endpointUrl }
|
|
102175
102201
|
});
|
|
102176
102202
|
}
|
|
102177
102203
|
};
|