@wix/create-headless-site 0.0.15 → 0.0.16
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 +1591 -417
- package/build/index.js.map +1 -1
- package/package.json +4 -3
package/build/index.js
CHANGED
|
@@ -7668,10 +7668,10 @@ var require_variant_tools = __commonJS({
|
|
|
7668
7668
|
init_esm_shims();
|
|
7669
7669
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7670
7670
|
exports.nil = exports.payload = exports.fields = void 0;
|
|
7671
|
-
function fields10(
|
|
7671
|
+
function fields10(defaults4 = {}) {
|
|
7672
7672
|
return (...args) => {
|
|
7673
7673
|
const [arg] = args;
|
|
7674
|
-
return Object.assign(Object.assign({},
|
|
7674
|
+
return Object.assign(Object.assign({}, defaults4), arg);
|
|
7675
7675
|
};
|
|
7676
7676
|
}
|
|
7677
7677
|
exports.fields = fields10;
|
|
@@ -12367,30 +12367,30 @@ var require_utils = __commonJS({
|
|
|
12367
12367
|
exports.changeHost = changeHost;
|
|
12368
12368
|
function getGlobalConfig() {
|
|
12369
12369
|
const defaultConfig = { httpMockServer: { enabled: false } };
|
|
12370
|
-
let
|
|
12370
|
+
let globalConfig2;
|
|
12371
12371
|
if ((0, env_util_1.isNode)() && process.env.HTTP_CLIENT_GLOBAL_CONFIG) {
|
|
12372
12372
|
try {
|
|
12373
|
-
|
|
12373
|
+
globalConfig2 = JSON.parse(process.env.HTTP_CLIENT_GLOBAL_CONFIG);
|
|
12374
12374
|
} catch (e2) {
|
|
12375
12375
|
}
|
|
12376
12376
|
}
|
|
12377
|
-
if (!
|
|
12377
|
+
if (!globalConfig2) {
|
|
12378
12378
|
if ((0, env_util_1.isBrowser)()) {
|
|
12379
|
-
|
|
12379
|
+
globalConfig2 = window._httpClientGlobalConfig;
|
|
12380
12380
|
} else if ((0, env_util_1.isWebWorker)()) {
|
|
12381
12381
|
}
|
|
12382
12382
|
}
|
|
12383
|
-
return
|
|
12383
|
+
return globalConfig2 || defaultConfig;
|
|
12384
12384
|
}
|
|
12385
12385
|
exports.getGlobalConfig = getGlobalConfig;
|
|
12386
12386
|
function isHttpMockServerEnabled() {
|
|
12387
|
-
const
|
|
12388
|
-
return
|
|
12387
|
+
const globalConfig2 = getGlobalConfig();
|
|
12388
|
+
return globalConfig2.httpMockServer.enabled;
|
|
12389
12389
|
}
|
|
12390
12390
|
exports.isHttpMockServerEnabled = isHttpMockServerEnabled;
|
|
12391
12391
|
function shouldAllowUnmocked() {
|
|
12392
|
-
const
|
|
12393
|
-
return
|
|
12392
|
+
const globalConfig2 = getGlobalConfig();
|
|
12393
|
+
return globalConfig2.httpMockServer.allowUnmocked;
|
|
12394
12394
|
}
|
|
12395
12395
|
exports.shouldAllowUnmocked = shouldAllowUnmocked;
|
|
12396
12396
|
function toSearchQueryParams(params) {
|
|
@@ -14719,7 +14719,7 @@ var require_defaults = __commonJS({
|
|
|
14719
14719
|
}
|
|
14720
14720
|
return (encoder || JSON.stringify)(rawValue);
|
|
14721
14721
|
}
|
|
14722
|
-
var
|
|
14722
|
+
var defaults4 = {
|
|
14723
14723
|
transitional: {
|
|
14724
14724
|
silentJSONParsing: true,
|
|
14725
14725
|
forcedJSONParsing: true,
|
|
@@ -14777,18 +14777,18 @@ var require_defaults = __commonJS({
|
|
|
14777
14777
|
return status >= 200 && status < 300;
|
|
14778
14778
|
}
|
|
14779
14779
|
};
|
|
14780
|
-
|
|
14780
|
+
defaults4.headers = {
|
|
14781
14781
|
common: {
|
|
14782
14782
|
"Accept": "application/json, text/plain, */*"
|
|
14783
14783
|
}
|
|
14784
14784
|
};
|
|
14785
14785
|
utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
14786
|
-
|
|
14786
|
+
defaults4.headers[method] = {};
|
|
14787
14787
|
});
|
|
14788
14788
|
utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
14789
|
-
|
|
14789
|
+
defaults4.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
14790
14790
|
});
|
|
14791
|
-
module2.exports =
|
|
14791
|
+
module2.exports = defaults4;
|
|
14792
14792
|
}
|
|
14793
14793
|
});
|
|
14794
14794
|
|
|
@@ -14798,9 +14798,9 @@ var require_transformData = __commonJS({
|
|
|
14798
14798
|
"use strict";
|
|
14799
14799
|
init_esm_shims();
|
|
14800
14800
|
var utils = require_utils2();
|
|
14801
|
-
var
|
|
14801
|
+
var defaults4 = require_defaults();
|
|
14802
14802
|
module2.exports = function transformData(data, headers, fns) {
|
|
14803
|
-
var context2 = this ||
|
|
14803
|
+
var context2 = this || defaults4;
|
|
14804
14804
|
utils.forEach(fns, function transform(fn) {
|
|
14805
14805
|
data = fn.call(context2, data, headers);
|
|
14806
14806
|
});
|
|
@@ -14828,7 +14828,7 @@ var require_dispatchRequest = __commonJS({
|
|
|
14828
14828
|
var utils = require_utils2();
|
|
14829
14829
|
var transformData = require_transformData();
|
|
14830
14830
|
var isCancel = require_isCancel();
|
|
14831
|
-
var
|
|
14831
|
+
var defaults4 = require_defaults();
|
|
14832
14832
|
function throwIfCancellationRequested(config) {
|
|
14833
14833
|
if (config.cancelToken) {
|
|
14834
14834
|
config.cancelToken.throwIfRequested();
|
|
@@ -14854,7 +14854,7 @@ var require_dispatchRequest = __commonJS({
|
|
|
14854
14854
|
delete config.headers[method];
|
|
14855
14855
|
}
|
|
14856
14856
|
);
|
|
14857
|
-
var adapter = config.adapter ||
|
|
14857
|
+
var adapter = config.adapter || defaults4.adapter;
|
|
14858
14858
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
14859
14859
|
throwIfCancellationRequested(config);
|
|
14860
14860
|
response.data = transformData.call(
|
|
@@ -15247,7 +15247,7 @@ var require_axios = __commonJS({
|
|
|
15247
15247
|
var bind = require_bind();
|
|
15248
15248
|
var Axios = require_Axios();
|
|
15249
15249
|
var mergeConfig2 = require_mergeConfig();
|
|
15250
|
-
var
|
|
15250
|
+
var defaults4 = require_defaults();
|
|
15251
15251
|
function createInstance4(defaultConfig) {
|
|
15252
15252
|
var context2 = new Axios(defaultConfig);
|
|
15253
15253
|
var instance2 = bind(Axios.prototype.request, context2);
|
|
@@ -15255,7 +15255,7 @@ var require_axios = __commonJS({
|
|
|
15255
15255
|
utils.extend(instance2, context2);
|
|
15256
15256
|
return instance2;
|
|
15257
15257
|
}
|
|
15258
|
-
var axios = createInstance4(
|
|
15258
|
+
var axios = createInstance4(defaults4);
|
|
15259
15259
|
axios.Axios = Axios;
|
|
15260
15260
|
axios.create = function create3(instanceConfig) {
|
|
15261
15261
|
return createInstance4(mergeConfig2(axios.defaults, instanceConfig));
|
|
@@ -15292,7 +15292,7 @@ var require_options = __commonJS({
|
|
|
15292
15292
|
var constants_1 = require_constants2();
|
|
15293
15293
|
var headers_1 = require_headers();
|
|
15294
15294
|
var utils_1 = require_utils();
|
|
15295
|
-
var buildOptions = ({ requestOptions, urlObject, headers, globalConfig = {
|
|
15295
|
+
var buildOptions = ({ requestOptions, urlObject, headers, globalConfig: globalConfig2 = {
|
|
15296
15296
|
httpMockServer: {
|
|
15297
15297
|
enabled: false
|
|
15298
15298
|
}
|
|
@@ -15303,12 +15303,12 @@ var require_options = __commonJS({
|
|
|
15303
15303
|
throw new Error("Search params must be an object");
|
|
15304
15304
|
}
|
|
15305
15305
|
}
|
|
15306
|
-
const localConfigOptions = maybeRedirectToMockServer(url2,
|
|
15306
|
+
const localConfigOptions = maybeRedirectToMockServer(url2, globalConfig2);
|
|
15307
15307
|
const newOptions = Object.assign(Object.assign(Object.assign({}, requestOptions), localConfigOptions), { headers });
|
|
15308
15308
|
return newOptions;
|
|
15309
15309
|
};
|
|
15310
15310
|
exports.buildOptions = buildOptions;
|
|
15311
|
-
var buildAllHeaders = (requestOptions, wixHeadersOpts,
|
|
15311
|
+
var buildAllHeaders = (requestOptions, wixHeadersOpts, globalConfig2 = {
|
|
15312
15312
|
httpMockServer: {
|
|
15313
15313
|
enabled: false
|
|
15314
15314
|
}
|
|
@@ -15319,14 +15319,14 @@ var require_options = __commonJS({
|
|
|
15319
15319
|
disableWixHeaders,
|
|
15320
15320
|
wixHeadersOpts
|
|
15321
15321
|
});
|
|
15322
|
-
const originalUrlHeader = (0, exports.getUrlHeaders)(
|
|
15322
|
+
const originalUrlHeader = (0, exports.getUrlHeaders)(globalConfig2, requestOptions, urlObject);
|
|
15323
15323
|
return Object.assign(Object.assign(Object.assign({}, composedHeaders), lowerAllJsonKeys(headers)), originalUrlHeader);
|
|
15324
15324
|
};
|
|
15325
15325
|
exports.buildAllHeaders = buildAllHeaders;
|
|
15326
|
-
var getUrlHeaders = (
|
|
15326
|
+
var getUrlHeaders = (globalConfig2, requestOptions, urlObject) => {
|
|
15327
15327
|
const { url: url2, params } = requestOptions;
|
|
15328
15328
|
const { host, protocol } = urlObject;
|
|
15329
|
-
const originalUrlHeader =
|
|
15329
|
+
const originalUrlHeader = globalConfig2.httpMockServer.enabled ? {
|
|
15330
15330
|
[constants_1.ORIGINAL_URL_HEADER]: buildUrlFromRequest(url2, params),
|
|
15331
15331
|
[constants_1.ORIGINAL_HOST_HEADER]: (0, utils_1.isAbsoluteUrl)(url2) ? (0, utils_1.extractHost)(url2) : host,
|
|
15332
15332
|
[constants_1.ORIGINAL_PROTOCOL_HEADER]: (0, utils_1.isAbsoluteUrl)(url2) ? (0, utils_1.extractProtocol)(url2) : protocol
|
|
@@ -15334,9 +15334,9 @@ var require_options = __commonJS({
|
|
|
15334
15334
|
return originalUrlHeader;
|
|
15335
15335
|
};
|
|
15336
15336
|
exports.getUrlHeaders = getUrlHeaders;
|
|
15337
|
-
function maybeRedirectToMockServer(url2,
|
|
15338
|
-
if (
|
|
15339
|
-
const mockUrl = new URL(
|
|
15337
|
+
function maybeRedirectToMockServer(url2, globalConfig2) {
|
|
15338
|
+
if (globalConfig2.httpMockServer.enabled) {
|
|
15339
|
+
const mockUrl = new URL(globalConfig2.httpMockServer.mockServerUrl);
|
|
15340
15340
|
return {
|
|
15341
15341
|
url: (0, utils_1.changeHost)(url2, mockUrl.host)
|
|
15342
15342
|
};
|
|
@@ -15731,7 +15731,7 @@ var require_main = __commonJS({
|
|
|
15731
15731
|
var fs11 = __require("fs");
|
|
15732
15732
|
var path8 = __require("path");
|
|
15733
15733
|
var os8 = __require("os");
|
|
15734
|
-
var
|
|
15734
|
+
var crypto4 = __require("crypto");
|
|
15735
15735
|
var packageJson2 = require_package2();
|
|
15736
15736
|
var version = packageJson2.version;
|
|
15737
15737
|
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
@@ -15927,7 +15927,7 @@ var require_main = __commonJS({
|
|
|
15927
15927
|
const authTag = ciphertext.subarray(-16);
|
|
15928
15928
|
ciphertext = ciphertext.subarray(12, -16);
|
|
15929
15929
|
try {
|
|
15930
|
-
const aesgcm =
|
|
15930
|
+
const aesgcm = crypto4.createDecipheriv("aes-256-gcm", key, nonce);
|
|
15931
15931
|
aesgcm.setAuthTag(authTag);
|
|
15932
15932
|
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
15933
15933
|
} catch (error) {
|
|
@@ -21992,8 +21992,8 @@ var require_require_in_the_middle = __commonJS({
|
|
|
21992
21992
|
var resolve5 = require_resolve();
|
|
21993
21993
|
var debug3 = require_src()("require-in-the-middle");
|
|
21994
21994
|
var moduleDetailsFromPath = require_module_details_from_path();
|
|
21995
|
-
module2.exports =
|
|
21996
|
-
module2.exports.Hook =
|
|
21995
|
+
module2.exports = Hook3;
|
|
21996
|
+
module2.exports.Hook = Hook3;
|
|
21997
21997
|
var isCore;
|
|
21998
21998
|
if (Module.isBuiltin) {
|
|
21999
21999
|
isCore = Module.isBuiltin;
|
|
@@ -22048,8 +22048,8 @@ var require_require_in_the_middle = __commonJS({
|
|
|
22048
22048
|
}
|
|
22049
22049
|
}
|
|
22050
22050
|
};
|
|
22051
|
-
function
|
|
22052
|
-
if (this instanceof
|
|
22051
|
+
function Hook3(modules, options, onrequire) {
|
|
22052
|
+
if (this instanceof Hook3 === false) return new Hook3(modules, options, onrequire);
|
|
22053
22053
|
if (typeof modules === "function") {
|
|
22054
22054
|
onrequire = modules;
|
|
22055
22055
|
modules = null;
|
|
@@ -22190,7 +22190,7 @@ var require_require_in_the_middle = __commonJS({
|
|
|
22190
22190
|
return patchedExports;
|
|
22191
22191
|
}
|
|
22192
22192
|
}
|
|
22193
|
-
|
|
22193
|
+
Hook3.prototype.unhook = function() {
|
|
22194
22194
|
this._unhooked = true;
|
|
22195
22195
|
if (this._require === Module.prototype.require) {
|
|
22196
22196
|
Module.prototype.require = this._origRequire;
|
|
@@ -22500,8 +22500,8 @@ var require_import_in_the_middle = __commonJS({
|
|
|
22500
22500
|
namespace.default = newDefault;
|
|
22501
22501
|
}
|
|
22502
22502
|
}
|
|
22503
|
-
function
|
|
22504
|
-
if (this instanceof
|
|
22503
|
+
function Hook3(modules, options, hookFn) {
|
|
22504
|
+
if (this instanceof Hook3 === false) return new Hook3(modules, options, hookFn);
|
|
22505
22505
|
if (typeof modules === "function") {
|
|
22506
22506
|
hookFn = modules;
|
|
22507
22507
|
modules = null;
|
|
@@ -22549,11 +22549,11 @@ var require_import_in_the_middle = __commonJS({
|
|
|
22549
22549
|
};
|
|
22550
22550
|
addHook(this._iitmHook);
|
|
22551
22551
|
}
|
|
22552
|
-
|
|
22552
|
+
Hook3.prototype.unhook = function() {
|
|
22553
22553
|
removeHook(this._iitmHook);
|
|
22554
22554
|
};
|
|
22555
|
-
module2.exports =
|
|
22556
|
-
module2.exports.Hook =
|
|
22555
|
+
module2.exports = Hook3;
|
|
22556
|
+
module2.exports.Hook = Hook3;
|
|
22557
22557
|
module2.exports.addHook = addHook;
|
|
22558
22558
|
module2.exports.removeHook = removeHook;
|
|
22559
22559
|
}
|
|
@@ -32829,6 +32829,76 @@ var require_extra_typings = __commonJS({
|
|
|
32829
32829
|
}
|
|
32830
32830
|
});
|
|
32831
32831
|
|
|
32832
|
+
// ../../node_modules/@babel/runtime/helpers/typeof.js
|
|
32833
|
+
var require_typeof = __commonJS({
|
|
32834
|
+
"../../node_modules/@babel/runtime/helpers/typeof.js"(exports, module2) {
|
|
32835
|
+
"use strict";
|
|
32836
|
+
init_esm_shims();
|
|
32837
|
+
function _typeof(o) {
|
|
32838
|
+
"@babel/helpers - typeof";
|
|
32839
|
+
return module2.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
32840
|
+
return typeof o2;
|
|
32841
|
+
} : function(o2) {
|
|
32842
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
32843
|
+
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports, _typeof(o);
|
|
32844
|
+
}
|
|
32845
|
+
module2.exports = _typeof, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
32846
|
+
}
|
|
32847
|
+
});
|
|
32848
|
+
|
|
32849
|
+
// ../../node_modules/@babel/runtime/helpers/toPrimitive.js
|
|
32850
|
+
var require_toPrimitive = __commonJS({
|
|
32851
|
+
"../../node_modules/@babel/runtime/helpers/toPrimitive.js"(exports, module2) {
|
|
32852
|
+
"use strict";
|
|
32853
|
+
init_esm_shims();
|
|
32854
|
+
var _typeof = require_typeof()["default"];
|
|
32855
|
+
function toPrimitive(t3, r2) {
|
|
32856
|
+
if ("object" != _typeof(t3) || !t3) return t3;
|
|
32857
|
+
var e2 = t3[Symbol.toPrimitive];
|
|
32858
|
+
if (void 0 !== e2) {
|
|
32859
|
+
var i2 = e2.call(t3, r2 || "default");
|
|
32860
|
+
if ("object" != _typeof(i2)) return i2;
|
|
32861
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
32862
|
+
}
|
|
32863
|
+
return ("string" === r2 ? String : Number)(t3);
|
|
32864
|
+
}
|
|
32865
|
+
module2.exports = toPrimitive, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
32866
|
+
}
|
|
32867
|
+
});
|
|
32868
|
+
|
|
32869
|
+
// ../../node_modules/@babel/runtime/helpers/toPropertyKey.js
|
|
32870
|
+
var require_toPropertyKey = __commonJS({
|
|
32871
|
+
"../../node_modules/@babel/runtime/helpers/toPropertyKey.js"(exports, module2) {
|
|
32872
|
+
"use strict";
|
|
32873
|
+
init_esm_shims();
|
|
32874
|
+
var _typeof = require_typeof()["default"];
|
|
32875
|
+
var toPrimitive = require_toPrimitive();
|
|
32876
|
+
function toPropertyKey(t3) {
|
|
32877
|
+
var i2 = toPrimitive(t3, "string");
|
|
32878
|
+
return "symbol" == _typeof(i2) ? i2 : i2 + "";
|
|
32879
|
+
}
|
|
32880
|
+
module2.exports = toPropertyKey, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
32881
|
+
}
|
|
32882
|
+
});
|
|
32883
|
+
|
|
32884
|
+
// ../../node_modules/@babel/runtime/helpers/defineProperty.js
|
|
32885
|
+
var require_defineProperty = __commonJS({
|
|
32886
|
+
"../../node_modules/@babel/runtime/helpers/defineProperty.js"(exports, module2) {
|
|
32887
|
+
"use strict";
|
|
32888
|
+
init_esm_shims();
|
|
32889
|
+
var toPropertyKey = require_toPropertyKey();
|
|
32890
|
+
function _defineProperty8(e2, r2, t3) {
|
|
32891
|
+
return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, {
|
|
32892
|
+
value: t3,
|
|
32893
|
+
enumerable: true,
|
|
32894
|
+
configurable: true,
|
|
32895
|
+
writable: true
|
|
32896
|
+
}) : e2[r2] = t3, e2;
|
|
32897
|
+
}
|
|
32898
|
+
module2.exports = _defineProperty8, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
32899
|
+
}
|
|
32900
|
+
});
|
|
32901
|
+
|
|
32832
32902
|
// ../../node_modules/@wix/wix-bi-logger-client/dist/assert.js
|
|
32833
32903
|
var require_assert2 = __commonJS({
|
|
32834
32904
|
"../../node_modules/@wix/wix-bi-logger-client/dist/assert.js"(exports, module2) {
|
|
@@ -33372,8 +33442,8 @@ var require_bi_logger = __commonJS({
|
|
|
33372
33442
|
return queue.feed(transformedEvent, fullContext);
|
|
33373
33443
|
};
|
|
33374
33444
|
if (this._globalBatchQueue) {
|
|
33375
|
-
return this._getDefaults(this._defaults).then(function(
|
|
33376
|
-
var fullEvent2 = _extends2({},
|
|
33445
|
+
return this._getDefaults(this._defaults).then(function(defaults4) {
|
|
33446
|
+
var fullEvent2 = _extends2({}, defaults4, _this._getDynamicNonEssentialDefaults(policy), _this._getStaticNonEssentialDefaults(policy), event, _this._getPolicyFields(policy, fullContext.category));
|
|
33377
33447
|
return transformAndQueue(fullEvent2);
|
|
33378
33448
|
});
|
|
33379
33449
|
} else {
|
|
@@ -33381,8 +33451,8 @@ var require_bi_logger = __commonJS({
|
|
|
33381
33451
|
return transformAndQueue(fullEvent);
|
|
33382
33452
|
}
|
|
33383
33453
|
}
|
|
33384
|
-
return this._getDefaults(this._defaults).then(function(
|
|
33385
|
-
var fullEvent2 = Object.assign(
|
|
33454
|
+
return this._getDefaults(this._defaults).then(function(defaults4) {
|
|
33455
|
+
var fullEvent2 = Object.assign(defaults4, _this._getDynamicNonEssentialDefaults(policy), _this._getStaticNonEssentialDefaults(policy), event, _this._getPolicyFields(policy, fullContext.category));
|
|
33386
33456
|
var validatorsResult = _this._validators.length === 0 ? true : _this._validators.some(function(validator) {
|
|
33387
33457
|
return validator.match(fullEvent2) && (validator.execute(fullEvent2) || true);
|
|
33388
33458
|
});
|
|
@@ -33404,10 +33474,10 @@ var require_bi_logger = __commonJS({
|
|
|
33404
33474
|
}
|
|
33405
33475
|
}, {
|
|
33406
33476
|
key: "updateDefaults",
|
|
33407
|
-
value: function updateDefaults(
|
|
33408
|
-
assert.defined(
|
|
33409
|
-
assert.object(
|
|
33410
|
-
Object.assign(this._ownDefaults,
|
|
33477
|
+
value: function updateDefaults(defaults4) {
|
|
33478
|
+
assert.defined(defaults4, "Defaults must be provided");
|
|
33479
|
+
assert.object(defaults4, "Defaults must be an object");
|
|
33480
|
+
Object.assign(this._ownDefaults, defaults4);
|
|
33411
33481
|
return this;
|
|
33412
33482
|
}
|
|
33413
33483
|
}, {
|
|
@@ -33497,14 +33567,14 @@ var require_bi_logger = __commonJS({
|
|
|
33497
33567
|
}
|
|
33498
33568
|
}, {
|
|
33499
33569
|
key: "_withOwnDefaults",
|
|
33500
|
-
value: function _withOwnDefaults(
|
|
33501
|
-
return Object.assign({},
|
|
33570
|
+
value: function _withOwnDefaults(defaults4) {
|
|
33571
|
+
return Object.assign({}, defaults4, this._ownDefaults);
|
|
33502
33572
|
}
|
|
33503
33573
|
}, {
|
|
33504
33574
|
key: "_getDynamicDefaults",
|
|
33505
|
-
value: function _getDynamicDefaults(
|
|
33506
|
-
|
|
33507
|
-
var dynamicDefaults = filterValues(
|
|
33575
|
+
value: function _getDynamicDefaults(defaults4) {
|
|
33576
|
+
defaults4 = this._withOwnDefaults(defaults4);
|
|
33577
|
+
var dynamicDefaults = filterValues(defaults4, function(v) {
|
|
33508
33578
|
return typeof v === "function";
|
|
33509
33579
|
});
|
|
33510
33580
|
return mapValues(dynamicDefaults, function(v) {
|
|
@@ -33513,22 +33583,22 @@ var require_bi_logger = __commonJS({
|
|
|
33513
33583
|
}
|
|
33514
33584
|
}, {
|
|
33515
33585
|
key: "_getStaticDefaults",
|
|
33516
|
-
value: function _getStaticDefaults(
|
|
33517
|
-
|
|
33518
|
-
var staticDefaults = filterValues(
|
|
33586
|
+
value: function _getStaticDefaults(defaults4) {
|
|
33587
|
+
defaults4 = this._withOwnDefaults(defaults4);
|
|
33588
|
+
var staticDefaults = filterValues(defaults4, function(v) {
|
|
33519
33589
|
return typeof v !== "function";
|
|
33520
33590
|
});
|
|
33521
33591
|
return staticDefaults;
|
|
33522
33592
|
}
|
|
33523
33593
|
}, {
|
|
33524
33594
|
key: "_getDefaults",
|
|
33525
|
-
value: function _getDefaults(
|
|
33595
|
+
value: function _getDefaults(defaults4) {
|
|
33526
33596
|
var _this4 = this;
|
|
33527
|
-
|
|
33528
|
-
if (!
|
|
33597
|
+
defaults4 = this._withOwnDefaults(defaults4);
|
|
33598
|
+
if (!defaults4) {
|
|
33529
33599
|
return Promise.resolve({});
|
|
33530
33600
|
}
|
|
33531
|
-
var promises2 = mapValues(
|
|
33601
|
+
var promises2 = mapValues(defaults4, function(value2, key) {
|
|
33532
33602
|
if (typeof value2 === "function") {
|
|
33533
33603
|
try {
|
|
33534
33604
|
value2 = value2();
|
|
@@ -33719,26 +33789,26 @@ var require_bi_logger_factory = __commonJS({
|
|
|
33719
33789
|
}
|
|
33720
33790
|
}, {
|
|
33721
33791
|
key: "setDefaults",
|
|
33722
|
-
value: function setDefaults2(
|
|
33723
|
-
assert.defined(
|
|
33724
|
-
assert.object(
|
|
33725
|
-
this._defaults =
|
|
33792
|
+
value: function setDefaults2(defaults4) {
|
|
33793
|
+
assert.defined(defaults4, "Defaults must be provided");
|
|
33794
|
+
assert.object(defaults4, "Defaults must be an object");
|
|
33795
|
+
this._defaults = defaults4;
|
|
33726
33796
|
return this;
|
|
33727
33797
|
}
|
|
33728
33798
|
}, {
|
|
33729
33799
|
key: "updateDefaults",
|
|
33730
|
-
value: function updateDefaults(
|
|
33731
|
-
assert.defined(
|
|
33732
|
-
assert.object(
|
|
33733
|
-
Object.assign(this._defaults,
|
|
33800
|
+
value: function updateDefaults(defaults4) {
|
|
33801
|
+
assert.defined(defaults4, "Defaults must be provided");
|
|
33802
|
+
assert.object(defaults4, "Defaults must be an object");
|
|
33803
|
+
Object.assign(this._defaults, defaults4);
|
|
33734
33804
|
return this;
|
|
33735
33805
|
}
|
|
33736
33806
|
}, {
|
|
33737
33807
|
key: "updateNonEssentialDefaults",
|
|
33738
|
-
value: function updateNonEssentialDefaults(
|
|
33739
|
-
assert.defined(
|
|
33740
|
-
assert.object(
|
|
33741
|
-
Object.assign(this._nonEssentialDefaults,
|
|
33808
|
+
value: function updateNonEssentialDefaults(defaults4) {
|
|
33809
|
+
assert.defined(defaults4, "Non-essential Defaults must be provided");
|
|
33810
|
+
assert.object(defaults4, "Non-essential Defaults must be an object");
|
|
33811
|
+
Object.assign(this._nonEssentialDefaults, defaults4);
|
|
33742
33812
|
return this;
|
|
33743
33813
|
}
|
|
33744
33814
|
}, {
|
|
@@ -43901,7 +43971,7 @@ var require_lodash2 = __commonJS({
|
|
|
43901
43971
|
function takeWhile(array, predicate) {
|
|
43902
43972
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
|
|
43903
43973
|
}
|
|
43904
|
-
var
|
|
43974
|
+
var union2 = baseRest(function(arrays) {
|
|
43905
43975
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
|
|
43906
43976
|
});
|
|
43907
43977
|
var unionBy = baseRest(function(arrays) {
|
|
@@ -44726,7 +44796,7 @@ var require_lodash2 = __commonJS({
|
|
|
44726
44796
|
var result2 = baseCreate(prototype);
|
|
44727
44797
|
return properties == null ? result2 : baseAssign(result2, properties);
|
|
44728
44798
|
}
|
|
44729
|
-
var
|
|
44799
|
+
var defaults4 = baseRest(function(object, sources) {
|
|
44730
44800
|
object = Object2(object);
|
|
44731
44801
|
var index = -1;
|
|
44732
44802
|
var length = sources.length;
|
|
@@ -45473,7 +45543,7 @@ var require_lodash2 = __commonJS({
|
|
|
45473
45543
|
lodash.curry = curry;
|
|
45474
45544
|
lodash.curryRight = curryRight;
|
|
45475
45545
|
lodash.debounce = debounce;
|
|
45476
|
-
lodash.defaults =
|
|
45546
|
+
lodash.defaults = defaults4;
|
|
45477
45547
|
lodash.defaultsDeep = defaultsDeep;
|
|
45478
45548
|
lodash.defer = defer2;
|
|
45479
45549
|
lodash.delay = delay2;
|
|
@@ -45575,7 +45645,7 @@ var require_lodash2 = __commonJS({
|
|
|
45575
45645
|
lodash.toPlainObject = toPlainObject;
|
|
45576
45646
|
lodash.transform = transform;
|
|
45577
45647
|
lodash.unary = unary;
|
|
45578
|
-
lodash.union =
|
|
45648
|
+
lodash.union = union2;
|
|
45579
45649
|
lodash.unionBy = unionBy;
|
|
45580
45650
|
lodash.unionWith = unionWith;
|
|
45581
45651
|
lodash.uniq = uniq;
|
|
@@ -49381,7 +49451,7 @@ var require_lib2 = __commonJS({
|
|
|
49381
49451
|
function canBeReservedWord(word) {
|
|
49382
49452
|
return reservedWordLikeSet.has(word);
|
|
49383
49453
|
}
|
|
49384
|
-
var
|
|
49454
|
+
var Scope5 = class {
|
|
49385
49455
|
constructor(flags) {
|
|
49386
49456
|
this.flags = 0;
|
|
49387
49457
|
this.names = /* @__PURE__ */ new Map();
|
|
@@ -49437,7 +49507,7 @@ var require_lib2 = __commonJS({
|
|
|
49437
49507
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
49438
49508
|
}
|
|
49439
49509
|
createScope(flags) {
|
|
49440
|
-
return new
|
|
49510
|
+
return new Scope5(flags);
|
|
49441
49511
|
}
|
|
49442
49512
|
enter(flags) {
|
|
49443
49513
|
this.scopeStack.push(this.createScope(flags));
|
|
@@ -49535,7 +49605,7 @@ var require_lib2 = __commonJS({
|
|
|
49535
49605
|
}
|
|
49536
49606
|
}
|
|
49537
49607
|
};
|
|
49538
|
-
var FlowScope = class extends
|
|
49608
|
+
var FlowScope = class extends Scope5 {
|
|
49539
49609
|
constructor(...args) {
|
|
49540
49610
|
super(...args);
|
|
49541
49611
|
this.declareFunctions = /* @__PURE__ */ new Set();
|
|
@@ -52684,7 +52754,7 @@ var require_lib2 = __commonJS({
|
|
|
52684
52754
|
}
|
|
52685
52755
|
}
|
|
52686
52756
|
};
|
|
52687
|
-
var TypeScriptScope = class extends
|
|
52757
|
+
var TypeScriptScope = class extends Scope5 {
|
|
52688
52758
|
constructor(...args) {
|
|
52689
52759
|
super(...args);
|
|
52690
52760
|
this.tsNames = /* @__PURE__ */ new Map();
|
|
@@ -66415,7 +66485,7 @@ var require_minimist = __commonJS({
|
|
|
66415
66485
|
});
|
|
66416
66486
|
}
|
|
66417
66487
|
});
|
|
66418
|
-
var
|
|
66488
|
+
var defaults4 = opts.default || {};
|
|
66419
66489
|
var argv = { _: [] };
|
|
66420
66490
|
function argDefined(key2, arg2) {
|
|
66421
66491
|
return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases2[key2];
|
|
@@ -66469,7 +66539,7 @@ var require_minimist = __commonJS({
|
|
|
66469
66539
|
});
|
|
66470
66540
|
}
|
|
66471
66541
|
Object.keys(flags.bools).forEach(function(key2) {
|
|
66472
|
-
setArg(key2,
|
|
66542
|
+
setArg(key2, defaults4[key2] === void 0 ? false : defaults4[key2]);
|
|
66473
66543
|
});
|
|
66474
66544
|
var notFlags = [];
|
|
66475
66545
|
if (args.indexOf("--") !== -1) {
|
|
@@ -66552,11 +66622,11 @@ var require_minimist = __commonJS({
|
|
|
66552
66622
|
}
|
|
66553
66623
|
}
|
|
66554
66624
|
}
|
|
66555
|
-
Object.keys(
|
|
66625
|
+
Object.keys(defaults4).forEach(function(k) {
|
|
66556
66626
|
if (!hasKey(argv, k.split("."))) {
|
|
66557
|
-
setKey(argv, k.split("."),
|
|
66627
|
+
setKey(argv, k.split("."), defaults4[k]);
|
|
66558
66628
|
(aliases2[k] || []).forEach(function(x) {
|
|
66559
|
-
setKey(argv, x.split("."),
|
|
66629
|
+
setKey(argv, x.split("."), defaults4[k]);
|
|
66560
66630
|
});
|
|
66561
66631
|
}
|
|
66562
66632
|
});
|
|
@@ -66583,15 +66653,15 @@ var require_rc = __commonJS({
|
|
|
66583
66653
|
var etc = "/etc";
|
|
66584
66654
|
var win = process.platform === "win32";
|
|
66585
66655
|
var home = win ? process.env.USERPROFILE : process.env.HOME;
|
|
66586
|
-
module2.exports = function(name,
|
|
66656
|
+
module2.exports = function(name, defaults4, argv, parse4) {
|
|
66587
66657
|
if ("string" !== typeof name)
|
|
66588
66658
|
throw new Error("rc(name): name *must* be string");
|
|
66589
66659
|
if (!argv)
|
|
66590
66660
|
argv = require_minimist()(process.argv.slice(2));
|
|
66591
|
-
|
|
66661
|
+
defaults4 = ("string" === typeof defaults4 ? cc.json(defaults4) : defaults4) || {};
|
|
66592
66662
|
parse4 = parse4 || cc.parse;
|
|
66593
66663
|
var env3 = cc.env(name + "_");
|
|
66594
|
-
var configs = [
|
|
66664
|
+
var configs = [defaults4];
|
|
66595
66665
|
var configFiles = [];
|
|
66596
66666
|
function addConfigFile(file) {
|
|
66597
66667
|
if (configFiles.indexOf(file) >= 0) return;
|
|
@@ -68310,11 +68380,11 @@ var require_defaults2 = __commonJS({
|
|
|
68310
68380
|
var cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm";
|
|
68311
68381
|
var cacheRoot = process.platform === "win32" && process.env.APPDATA || home;
|
|
68312
68382
|
var cache3 = path8.resolve(cacheRoot, cacheExtra);
|
|
68313
|
-
var
|
|
68383
|
+
var defaults4;
|
|
68314
68384
|
var globalPrefix;
|
|
68315
68385
|
Object.defineProperty(exports, "defaults", {
|
|
68316
68386
|
get: function() {
|
|
68317
|
-
if (
|
|
68387
|
+
if (defaults4) return defaults4;
|
|
68318
68388
|
if (process.env.PREFIX) {
|
|
68319
68389
|
globalPrefix = process.env.PREFIX;
|
|
68320
68390
|
} else if (process.platform === "win32") {
|
|
@@ -68325,7 +68395,7 @@ var require_defaults2 = __commonJS({
|
|
|
68325
68395
|
globalPrefix = path8.join(process.env.DESTDIR, globalPrefix);
|
|
68326
68396
|
}
|
|
68327
68397
|
}
|
|
68328
|
-
|
|
68398
|
+
defaults4 = {
|
|
68329
68399
|
access: null,
|
|
68330
68400
|
"allow-same-version": false,
|
|
68331
68401
|
"always-auth": false,
|
|
@@ -68446,7 +68516,7 @@ var require_defaults2 = __commonJS({
|
|
|
68446
68516
|
viewer: process.platform === "win32" ? "browser" : "man",
|
|
68447
68517
|
_exit: true
|
|
68448
68518
|
};
|
|
68449
|
-
return
|
|
68519
|
+
return defaults4;
|
|
68450
68520
|
}
|
|
68451
68521
|
});
|
|
68452
68522
|
}
|
|
@@ -68460,8 +68530,8 @@ var require_npm_conf = __commonJS({
|
|
|
68460
68530
|
var path8 = __require("path");
|
|
68461
68531
|
var Conf = require_conf();
|
|
68462
68532
|
var _defaults = require_defaults2();
|
|
68463
|
-
module2.exports = (opts, types,
|
|
68464
|
-
const conf = new Conf(Object.assign({}, _defaults.defaults,
|
|
68533
|
+
module2.exports = (opts, types, defaults4) => {
|
|
68534
|
+
const conf = new Conf(Object.assign({}, _defaults.defaults, defaults4), types);
|
|
68465
68535
|
conf.add(Object.assign({}, opts), "cli");
|
|
68466
68536
|
const warnings = [];
|
|
68467
68537
|
let failedToLoadBuiltInConfig = false;
|
|
@@ -68717,7 +68787,7 @@ var require_lib3 = __commonJS({
|
|
|
68717
68787
|
|
|
68718
68788
|
// src/index.tsx
|
|
68719
68789
|
init_esm_shims();
|
|
68720
|
-
var
|
|
68790
|
+
var import_react117 = __toESM(require_react(), 1);
|
|
68721
68791
|
import { cwd as cwd2 } from "node:process";
|
|
68722
68792
|
|
|
68723
68793
|
// ../cli-telemetry-react/src/index.ts
|
|
@@ -79213,7 +79283,8 @@ var testOverridesSchema = z.object({
|
|
|
79213
79283
|
localTunnel: z.boolean().optional(),
|
|
79214
79284
|
customElementsCreationDelay: z.number().optional(),
|
|
79215
79285
|
sdkAuthServerBaseUrl: z.string().optional(),
|
|
79216
|
-
miniflareRequestsRewrites: z.array(z.object({ from: z.string(), to: z.string() })).optional()
|
|
79286
|
+
miniflareRequestsRewrites: z.array(z.object({ from: z.string(), to: z.string() })).optional(),
|
|
79287
|
+
panoramaReporterUrl: z.string().optional()
|
|
79217
79288
|
});
|
|
79218
79289
|
var TEST_OVERRIDES_ENV_VAR = "WIX_CLI_TEST_OVERRIDES";
|
|
79219
79290
|
function getTestOverrides() {
|
|
@@ -82165,7 +82236,7 @@ function Trans({
|
|
|
82165
82236
|
context: context2,
|
|
82166
82237
|
tOptions = {},
|
|
82167
82238
|
values,
|
|
82168
|
-
defaults:
|
|
82239
|
+
defaults: defaults4,
|
|
82169
82240
|
components,
|
|
82170
82241
|
ns,
|
|
82171
82242
|
i18n: i18nFromProps,
|
|
@@ -82188,7 +82259,7 @@ function Trans({
|
|
|
82188
82259
|
let namespaces = ns || t3.ns || i18n.options?.defaultNS;
|
|
82189
82260
|
namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
|
|
82190
82261
|
const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey);
|
|
82191
|
-
const defaultValue =
|
|
82262
|
+
const defaultValue = defaults4 || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey;
|
|
82192
82263
|
const {
|
|
82193
82264
|
hashTransKey
|
|
82194
82265
|
} = reactI18nextOptions;
|
|
@@ -82263,7 +82334,7 @@ function Trans2({
|
|
|
82263
82334
|
context: context2,
|
|
82264
82335
|
tOptions = {},
|
|
82265
82336
|
values,
|
|
82266
|
-
defaults:
|
|
82337
|
+
defaults: defaults4,
|
|
82267
82338
|
components,
|
|
82268
82339
|
ns,
|
|
82269
82340
|
i18n: i18nFromProps,
|
|
@@ -82285,7 +82356,7 @@ function Trans2({
|
|
|
82285
82356
|
context: context2,
|
|
82286
82357
|
tOptions,
|
|
82287
82358
|
values,
|
|
82288
|
-
defaults:
|
|
82359
|
+
defaults: defaults4,
|
|
82289
82360
|
components,
|
|
82290
82361
|
ns: ns || t3?.ns || defaultNSFromContext || i18n?.options?.defaultNS,
|
|
82291
82362
|
i18n,
|
|
@@ -93662,6 +93733,1102 @@ function getErrorLogFilePath(cwd3) {
|
|
|
93662
93733
|
return join5(cwd3, ERROR_LOG_FILENAME);
|
|
93663
93734
|
}
|
|
93664
93735
|
|
|
93736
|
+
// ../cli-panorama/src/index.ts
|
|
93737
|
+
init_esm_shims();
|
|
93738
|
+
|
|
93739
|
+
// ../cli-panorama/src/PanoramaContext.tsx
|
|
93740
|
+
init_esm_shims();
|
|
93741
|
+
var import_react93 = __toESM(require_react(), 1);
|
|
93742
|
+
var PanoramaContext = (0, import_react93.createContext)(void 0);
|
|
93743
|
+
var PanoramaProvider = (props) => {
|
|
93744
|
+
const { value: value2, children } = props;
|
|
93745
|
+
return /* @__PURE__ */ import_react93.default.createElement(PanoramaContext.Provider, { value: value2 }, children);
|
|
93746
|
+
};
|
|
93747
|
+
|
|
93748
|
+
// ../cli-panorama/src/usePanoramaMethodLogger.ts
|
|
93749
|
+
init_esm_shims();
|
|
93750
|
+
var import_react94 = __toESM(require_react(), 1);
|
|
93751
|
+
function usePanoramaMethodLogger(target) {
|
|
93752
|
+
const factory = (0, import_react94.useContext)(PanoramaContext);
|
|
93753
|
+
if (factory == null) {
|
|
93754
|
+
throw new Error(
|
|
93755
|
+
"usePanoramaMethodLogger() cannot be used without a <PanoramaProvider />"
|
|
93756
|
+
);
|
|
93757
|
+
}
|
|
93758
|
+
const componentId = target.constructor.name;
|
|
93759
|
+
const clientOptions = (0, import_react94.useMemo)(
|
|
93760
|
+
() => ({ baseParams: { componentId } }),
|
|
93761
|
+
[componentId]
|
|
93762
|
+
);
|
|
93763
|
+
const client2 = (0, import_react94.useMemo)(() => {
|
|
93764
|
+
return factory.client(clientOptions);
|
|
93765
|
+
}, [factory, clientOptions]);
|
|
93766
|
+
return (0, import_react94.useMemo)(() => {
|
|
93767
|
+
const cache3 = /* @__PURE__ */ new Map();
|
|
93768
|
+
return new Proxy(target, {
|
|
93769
|
+
get(target2, prop, receiver) {
|
|
93770
|
+
const value2 = Reflect.get(target2, prop, receiver);
|
|
93771
|
+
const isAsyncMethod = typeof value2 === "function" && typeof prop === "string" && Object.hasOwn(target2, prop) && value2.constructor.name === "AsyncFunction";
|
|
93772
|
+
if (!isAsyncMethod) {
|
|
93773
|
+
return value2;
|
|
93774
|
+
}
|
|
93775
|
+
if (!cache3.has(prop)) {
|
|
93776
|
+
const wrapped = async function(...args) {
|
|
93777
|
+
const transaction = client2.transaction(prop);
|
|
93778
|
+
transaction.start();
|
|
93779
|
+
const result = await value2.apply(target2, args);
|
|
93780
|
+
transaction.finish();
|
|
93781
|
+
return result;
|
|
93782
|
+
};
|
|
93783
|
+
cache3.set(prop, wrapped);
|
|
93784
|
+
}
|
|
93785
|
+
return cache3.get(prop);
|
|
93786
|
+
}
|
|
93787
|
+
});
|
|
93788
|
+
}, [target, client2]);
|
|
93789
|
+
}
|
|
93790
|
+
|
|
93791
|
+
// ../cli-panorama/src/createPanorama.ts
|
|
93792
|
+
init_esm_shims();
|
|
93793
|
+
|
|
93794
|
+
// ../../node_modules/@wix/panorama-client-node/dist/esm/index.js
|
|
93795
|
+
init_esm_shims();
|
|
93796
|
+
|
|
93797
|
+
// ../../node_modules/@wix/panorama-client-node/dist/esm/panorama-client-node.js
|
|
93798
|
+
init_esm_shims();
|
|
93799
|
+
|
|
93800
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/index.js
|
|
93801
|
+
init_esm_shims();
|
|
93802
|
+
|
|
93803
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common-shared/dist/esm/types/index.js
|
|
93804
|
+
init_esm_shims();
|
|
93805
|
+
|
|
93806
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common-shared/dist/esm/types/enum-types.js
|
|
93807
|
+
init_esm_shims();
|
|
93808
|
+
var AlertType;
|
|
93809
|
+
(function(AlertType2) {
|
|
93810
|
+
AlertType2["SuccessRate"] = "SuccessRate";
|
|
93811
|
+
AlertType2["SuccessRateQuality"] = "SuccessRateQuality";
|
|
93812
|
+
AlertType2["Duration"] = "Duration";
|
|
93813
|
+
AlertType2["ErrorRate"] = "ErrorRate";
|
|
93814
|
+
})(AlertType || (AlertType = {}));
|
|
93815
|
+
var AlertStatus;
|
|
93816
|
+
(function(AlertStatus2) {
|
|
93817
|
+
AlertStatus2["Alerting"] = "alerting";
|
|
93818
|
+
AlertStatus2["Ok"] = "ok";
|
|
93819
|
+
})(AlertStatus || (AlertStatus = {}));
|
|
93820
|
+
var LogLevel;
|
|
93821
|
+
(function(LogLevel2) {
|
|
93822
|
+
LogLevel2["Info"] = "INFO";
|
|
93823
|
+
LogLevel2["Warn"] = "WARN";
|
|
93824
|
+
LogLevel2["Error"] = "ERROR";
|
|
93825
|
+
LogLevel2["Debug"] = "DEBUG";
|
|
93826
|
+
})(LogLevel || (LogLevel = {}));
|
|
93827
|
+
var TransactionAction;
|
|
93828
|
+
(function(TransactionAction2) {
|
|
93829
|
+
TransactionAction2["Start"] = "START";
|
|
93830
|
+
TransactionAction2["Finish"] = "FINISH";
|
|
93831
|
+
})(TransactionAction || (TransactionAction = {}));
|
|
93832
|
+
var InternalTransactions = {
|
|
93833
|
+
ComponentLoad: "PANORAMA_COMPONENT_LOAD",
|
|
93834
|
+
ComponentPhase: "PANORAMA_COMPONENT_PHASE"
|
|
93835
|
+
};
|
|
93836
|
+
var Platform;
|
|
93837
|
+
(function(Platform2) {
|
|
93838
|
+
Platform2["Standalone"] = "standalone";
|
|
93839
|
+
Platform2["BusinessManager"] = "business-manager";
|
|
93840
|
+
Platform2["Viewer"] = "viewer";
|
|
93841
|
+
Platform2["Editor"] = "editor";
|
|
93842
|
+
Platform2["EditorSettings"] = "editor:settings";
|
|
93843
|
+
Platform2["Mobile"] = "mobile";
|
|
93844
|
+
Platform2["Standards"] = "standards";
|
|
93845
|
+
})(Platform || (Platform = {}));
|
|
93846
|
+
var ErrorSeverity;
|
|
93847
|
+
(function(ErrorSeverity2) {
|
|
93848
|
+
ErrorSeverity2["Fatal"] = "fatal";
|
|
93849
|
+
ErrorSeverity2["Error"] = "error";
|
|
93850
|
+
ErrorSeverity2["Warning"] = "warning";
|
|
93851
|
+
ErrorSeverity2["Log"] = "log";
|
|
93852
|
+
ErrorSeverity2["Info"] = "info";
|
|
93853
|
+
ErrorSeverity2["Debug"] = "debug";
|
|
93854
|
+
ErrorSeverity2["Critical"] = "critical";
|
|
93855
|
+
})(ErrorSeverity || (ErrorSeverity = {}));
|
|
93856
|
+
|
|
93857
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common-shared/dist/esm/types/data-types.js
|
|
93858
|
+
init_esm_shims();
|
|
93859
|
+
|
|
93860
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common-shared/dist/esm/types/interface-types.js
|
|
93861
|
+
init_esm_shims();
|
|
93862
|
+
|
|
93863
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common/dist/esm/global-config/index.js
|
|
93864
|
+
init_esm_shims();
|
|
93865
|
+
|
|
93866
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common/dist/esm/global-config/global-config.js
|
|
93867
|
+
init_esm_shims();
|
|
93868
|
+
|
|
93869
|
+
// ../../node_modules/uuid/dist/esm-node/index.js
|
|
93870
|
+
init_esm_shims();
|
|
93871
|
+
|
|
93872
|
+
// ../../node_modules/uuid/dist/esm-node/rng.js
|
|
93873
|
+
init_esm_shims();
|
|
93874
|
+
import crypto from "crypto";
|
|
93875
|
+
var rnds8Pool = new Uint8Array(256);
|
|
93876
|
+
var poolPtr = rnds8Pool.length;
|
|
93877
|
+
function rng() {
|
|
93878
|
+
if (poolPtr > rnds8Pool.length - 16) {
|
|
93879
|
+
crypto.randomFillSync(rnds8Pool);
|
|
93880
|
+
poolPtr = 0;
|
|
93881
|
+
}
|
|
93882
|
+
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
93883
|
+
}
|
|
93884
|
+
|
|
93885
|
+
// ../../node_modules/uuid/dist/esm-node/stringify.js
|
|
93886
|
+
init_esm_shims();
|
|
93887
|
+
var byteToHex = [];
|
|
93888
|
+
for (let i2 = 0; i2 < 256; ++i2) {
|
|
93889
|
+
byteToHex.push((i2 + 256).toString(16).slice(1));
|
|
93890
|
+
}
|
|
93891
|
+
function unsafeStringify(arr2, offset = 0) {
|
|
93892
|
+
return byteToHex[arr2[offset + 0]] + byteToHex[arr2[offset + 1]] + byteToHex[arr2[offset + 2]] + byteToHex[arr2[offset + 3]] + "-" + byteToHex[arr2[offset + 4]] + byteToHex[arr2[offset + 5]] + "-" + byteToHex[arr2[offset + 6]] + byteToHex[arr2[offset + 7]] + "-" + byteToHex[arr2[offset + 8]] + byteToHex[arr2[offset + 9]] + "-" + byteToHex[arr2[offset + 10]] + byteToHex[arr2[offset + 11]] + byteToHex[arr2[offset + 12]] + byteToHex[arr2[offset + 13]] + byteToHex[arr2[offset + 14]] + byteToHex[arr2[offset + 15]];
|
|
93893
|
+
}
|
|
93894
|
+
|
|
93895
|
+
// ../../node_modules/uuid/dist/esm-node/v4.js
|
|
93896
|
+
init_esm_shims();
|
|
93897
|
+
|
|
93898
|
+
// ../../node_modules/uuid/dist/esm-node/native.js
|
|
93899
|
+
init_esm_shims();
|
|
93900
|
+
import crypto2 from "crypto";
|
|
93901
|
+
var native_default = {
|
|
93902
|
+
randomUUID: crypto2.randomUUID
|
|
93903
|
+
};
|
|
93904
|
+
|
|
93905
|
+
// ../../node_modules/uuid/dist/esm-node/v4.js
|
|
93906
|
+
function v4(options, buf, offset) {
|
|
93907
|
+
if (native_default.randomUUID && !buf && !options) {
|
|
93908
|
+
return native_default.randomUUID();
|
|
93909
|
+
}
|
|
93910
|
+
options = options || {};
|
|
93911
|
+
const rnds = options.random || (options.rng || rng)();
|
|
93912
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
93913
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
93914
|
+
if (buf) {
|
|
93915
|
+
offset = offset || 0;
|
|
93916
|
+
for (let i2 = 0; i2 < 16; ++i2) {
|
|
93917
|
+
buf[offset + i2] = rnds[i2];
|
|
93918
|
+
}
|
|
93919
|
+
return buf;
|
|
93920
|
+
}
|
|
93921
|
+
return unsafeStringify(rnds);
|
|
93922
|
+
}
|
|
93923
|
+
var v4_default = v4;
|
|
93924
|
+
|
|
93925
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common/dist/esm/duration-tracker/index.js
|
|
93926
|
+
init_esm_shims();
|
|
93927
|
+
|
|
93928
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common/dist/esm/duration-tracker/duration-tracker.js
|
|
93929
|
+
init_esm_shims();
|
|
93930
|
+
var DELIMITER = " | ";
|
|
93931
|
+
var DurationTrackerImpl = class {
|
|
93932
|
+
constructor() {
|
|
93933
|
+
this.transactionStartTimes = {};
|
|
93934
|
+
this.phaseStartTimes = {};
|
|
93935
|
+
}
|
|
93936
|
+
createKey(...args) {
|
|
93937
|
+
return args.filter((x) => !!x).join(DELIMITER);
|
|
93938
|
+
}
|
|
93939
|
+
markTransactionStart(fullArtifactId, componentId, transactionName, transactionId) {
|
|
93940
|
+
const key = this.createKey(fullArtifactId, componentId, transactionName, transactionId);
|
|
93941
|
+
this.transactionStartTimes[key] = Date.now();
|
|
93942
|
+
}
|
|
93943
|
+
markTransactionFinish(fullArtifactId, componentId, transactionName, transactionId) {
|
|
93944
|
+
const key = this.createKey(fullArtifactId, componentId, transactionName, transactionId);
|
|
93945
|
+
const finishTime = Date.now();
|
|
93946
|
+
const startTime = this.transactionStartTimes[key] || finishTime;
|
|
93947
|
+
const duration2 = Math.round(finishTime - startTime);
|
|
93948
|
+
this.transactionStartTimes[key] = 0;
|
|
93949
|
+
return duration2;
|
|
93950
|
+
}
|
|
93951
|
+
markPhaseStart(fullArtifactId, componentId, phaseName) {
|
|
93952
|
+
const key = this.createKey(fullArtifactId, componentId, phaseName);
|
|
93953
|
+
this.phaseStartTimes[key] = Date.now();
|
|
93954
|
+
}
|
|
93955
|
+
markPhaseFinish(fullArtifactId, componentId, phaseName) {
|
|
93956
|
+
const key = this.createKey(fullArtifactId, componentId, phaseName);
|
|
93957
|
+
const finishTime = Date.now();
|
|
93958
|
+
const startTime = this.phaseStartTimes[key] || finishTime;
|
|
93959
|
+
const duration2 = Math.round(finishTime - startTime);
|
|
93960
|
+
this.phaseStartTimes[key] = 0;
|
|
93961
|
+
return duration2;
|
|
93962
|
+
}
|
|
93963
|
+
};
|
|
93964
|
+
var createDurationTracker = () => new DurationTrackerImpl();
|
|
93965
|
+
|
|
93966
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common/dist/esm/global-config/global-config.js
|
|
93967
|
+
var GlobalConfigImpl = class {
|
|
93968
|
+
constructor() {
|
|
93969
|
+
this.sessionId = "";
|
|
93970
|
+
this.reporter = null;
|
|
93971
|
+
this.batchQueue = null;
|
|
93972
|
+
this.durationTracker = createDurationTracker();
|
|
93973
|
+
this.state = /* @__PURE__ */ new Map();
|
|
93974
|
+
this.sessionStart = Date.now();
|
|
93975
|
+
}
|
|
93976
|
+
getSessionId() {
|
|
93977
|
+
this.sessionId = this.sessionId || v4_default();
|
|
93978
|
+
return this.sessionId;
|
|
93979
|
+
}
|
|
93980
|
+
setSessionId(sessionId) {
|
|
93981
|
+
this.sessionId = sessionId;
|
|
93982
|
+
}
|
|
93983
|
+
getSessionTime() {
|
|
93984
|
+
return Date.now() - this.sessionStart;
|
|
93985
|
+
}
|
|
93986
|
+
getReporter() {
|
|
93987
|
+
return this.reporter;
|
|
93988
|
+
}
|
|
93989
|
+
setReporter(reporter) {
|
|
93990
|
+
this.reporter = reporter;
|
|
93991
|
+
}
|
|
93992
|
+
initBatchQueue(batchQueue) {
|
|
93993
|
+
this.batchQueue = this.batchQueue ?? batchQueue;
|
|
93994
|
+
}
|
|
93995
|
+
getBatchQueue() {
|
|
93996
|
+
return this.batchQueue;
|
|
93997
|
+
}
|
|
93998
|
+
getDurationTracker() {
|
|
93999
|
+
return this.durationTracker;
|
|
94000
|
+
}
|
|
94001
|
+
getStateValue(key) {
|
|
94002
|
+
return this.state.get(key);
|
|
94003
|
+
}
|
|
94004
|
+
setStateValue(key, value2) {
|
|
94005
|
+
this.state.set(key, value2);
|
|
94006
|
+
}
|
|
94007
|
+
clearState() {
|
|
94008
|
+
this.state.clear();
|
|
94009
|
+
this.durationTracker = createDurationTracker();
|
|
94010
|
+
}
|
|
94011
|
+
};
|
|
94012
|
+
var createGlobalConfig = () => new GlobalConfigImpl();
|
|
94013
|
+
|
|
94014
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-client-factory.js
|
|
94015
|
+
init_esm_shims();
|
|
94016
|
+
var import_defineProperty6 = __toESM(require_defineProperty());
|
|
94017
|
+
|
|
94018
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common/dist/esm/utils/index.js
|
|
94019
|
+
init_esm_shims();
|
|
94020
|
+
|
|
94021
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common/dist/esm/utils/class-utils.js
|
|
94022
|
+
init_esm_shims();
|
|
94023
|
+
var bindPrototypeMethodsToSelf = (instance2, classFn) => {
|
|
94024
|
+
const prototype = classFn ? classFn.prototype : Object.getPrototypeOf(instance2);
|
|
94025
|
+
const props = Object.getOwnPropertyNames(prototype);
|
|
94026
|
+
for (const prop of props) {
|
|
94027
|
+
if (prop === "constructor" || typeof prototype[prop] !== "function") {
|
|
94028
|
+
continue;
|
|
94029
|
+
}
|
|
94030
|
+
instance2[prop] = prototype[prop].bind(instance2);
|
|
94031
|
+
}
|
|
94032
|
+
};
|
|
94033
|
+
|
|
94034
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/utils/general-utils.js
|
|
94035
|
+
init_esm_shims();
|
|
94036
|
+
var union = function() {
|
|
94037
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
94038
|
+
args[_key] = arguments[_key];
|
|
94039
|
+
}
|
|
94040
|
+
return [...new Set(args.flat()).values()];
|
|
94041
|
+
};
|
|
94042
|
+
var defaults2 = function() {
|
|
94043
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
94044
|
+
args[_key2] = arguments[_key2];
|
|
94045
|
+
}
|
|
94046
|
+
return args.reduce((res, obj) => Object.entries(obj ?? {}).reduce((_res, _ref) => {
|
|
94047
|
+
let [key, value2] = _ref;
|
|
94048
|
+
if (typeof _res[key] === "undefined" && typeof value2 !== "undefined") {
|
|
94049
|
+
_res[key] = value2;
|
|
94050
|
+
}
|
|
94051
|
+
return _res;
|
|
94052
|
+
}, res), {});
|
|
94053
|
+
};
|
|
94054
|
+
var deepDefaults = function(dest) {
|
|
94055
|
+
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
94056
|
+
rest[_key3 - 1] = arguments[_key3];
|
|
94057
|
+
}
|
|
94058
|
+
const keys = union(...rest.map((value2) => Object.keys(value2 ?? {})));
|
|
94059
|
+
const all = [dest, ...rest];
|
|
94060
|
+
return keys.reduce((res, key) => {
|
|
94061
|
+
const values = all.map((value2) => value2 == null ? void 0 : value2[key]);
|
|
94062
|
+
const merged = defaults2(...values);
|
|
94063
|
+
const hasValues = Object.values(merged).filter((value2) => typeof value2 !== "undefined").length > 0;
|
|
94064
|
+
if (hasValues) {
|
|
94065
|
+
res = res ?? {};
|
|
94066
|
+
res[key] = merged;
|
|
94067
|
+
} else {
|
|
94068
|
+
var _res2;
|
|
94069
|
+
(_res2 = res) == null || delete _res2[key];
|
|
94070
|
+
}
|
|
94071
|
+
return res;
|
|
94072
|
+
}, dest ? {
|
|
94073
|
+
...dest
|
|
94074
|
+
} : dest);
|
|
94075
|
+
};
|
|
94076
|
+
|
|
94077
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-client.js
|
|
94078
|
+
init_esm_shims();
|
|
94079
|
+
var import_defineProperty3 = __toESM(require_defineProperty());
|
|
94080
|
+
|
|
94081
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-client-component.js
|
|
94082
|
+
init_esm_shims();
|
|
94083
|
+
var import_defineProperty = __toESM(require_defineProperty());
|
|
94084
|
+
|
|
94085
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-error-monitor.js
|
|
94086
|
+
init_esm_shims();
|
|
94087
|
+
var PanoramaErrorMonitorImpl = class {
|
|
94088
|
+
constructor(baseClient, options) {
|
|
94089
|
+
this.baseClient = baseClient;
|
|
94090
|
+
this.options = options;
|
|
94091
|
+
bindPrototypeMethodsToSelf(this);
|
|
94092
|
+
}
|
|
94093
|
+
reportError(error, data) {
|
|
94094
|
+
this.baseClient.reportError(error, data, this.options);
|
|
94095
|
+
}
|
|
94096
|
+
addBreadcrumb(breadcrumb) {
|
|
94097
|
+
this.baseClient.addBreadcrumb(breadcrumb);
|
|
94098
|
+
}
|
|
94099
|
+
};
|
|
94100
|
+
|
|
94101
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-logger.js
|
|
94102
|
+
init_esm_shims();
|
|
94103
|
+
var PanoramaLoggerImpl = class {
|
|
94104
|
+
constructor(baseClient) {
|
|
94105
|
+
this.baseClient = baseClient;
|
|
94106
|
+
bindPrototypeMethodsToSelf(this);
|
|
94107
|
+
}
|
|
94108
|
+
info(message, data) {
|
|
94109
|
+
this.baseClient.log(LogLevel.Info, message, data);
|
|
94110
|
+
}
|
|
94111
|
+
warn(message, data) {
|
|
94112
|
+
this.baseClient.log(LogLevel.Warn, message, data);
|
|
94113
|
+
}
|
|
94114
|
+
error(message, data) {
|
|
94115
|
+
this.baseClient.log(LogLevel.Error, message, data);
|
|
94116
|
+
}
|
|
94117
|
+
debug(message, data) {
|
|
94118
|
+
this.baseClient.log(LogLevel.Debug, message, data);
|
|
94119
|
+
}
|
|
94120
|
+
};
|
|
94121
|
+
|
|
94122
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-transaction.js
|
|
94123
|
+
init_esm_shims();
|
|
94124
|
+
|
|
94125
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common-shared/dist/esm/utils/index.js
|
|
94126
|
+
init_esm_shims();
|
|
94127
|
+
|
|
94128
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common-shared/dist/esm/utils/transaction-utils.js
|
|
94129
|
+
init_esm_shims();
|
|
94130
|
+
var isCustomTransactionName = (name) => !Object.values(InternalTransactions).includes(name);
|
|
94131
|
+
|
|
94132
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common-shared/dist/esm/utils/platform-utils.js
|
|
94133
|
+
init_esm_shims();
|
|
94134
|
+
|
|
94135
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common-shared/dist/esm/utils/guid.js
|
|
94136
|
+
init_esm_shims();
|
|
94137
|
+
|
|
94138
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-transaction.js
|
|
94139
|
+
var PanoramaTransactionImpl = class {
|
|
94140
|
+
constructor(baseClient, name, options) {
|
|
94141
|
+
this.baseClient = baseClient;
|
|
94142
|
+
this.name = name;
|
|
94143
|
+
this.options = options;
|
|
94144
|
+
if (!isCustomTransactionName(name)) {
|
|
94145
|
+
throw new Error(`"${name}" is an internal transaction and can't be used`);
|
|
94146
|
+
}
|
|
94147
|
+
this.baseClient = baseClient;
|
|
94148
|
+
bindPrototypeMethodsToSelf(this);
|
|
94149
|
+
}
|
|
94150
|
+
start(data, options) {
|
|
94151
|
+
return this.baseClient.reportTransactionStart(this.name, defaults2(options, this.options), data);
|
|
94152
|
+
}
|
|
94153
|
+
finish(data, options) {
|
|
94154
|
+
return this.baseClient.reportTransactionFinish(this.name, defaults2(options, this.options), data);
|
|
94155
|
+
}
|
|
94156
|
+
};
|
|
94157
|
+
|
|
94158
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-client-component.js
|
|
94159
|
+
var PanoramaClientForComponentImpl = class {
|
|
94160
|
+
constructor(_ref) {
|
|
94161
|
+
let {
|
|
94162
|
+
baseClient
|
|
94163
|
+
} = _ref;
|
|
94164
|
+
(0, import_defineProperty.default)(this, "baseClient", void 0);
|
|
94165
|
+
this.baseClient = baseClient;
|
|
94166
|
+
bindPrototypeMethodsToSelf(this);
|
|
94167
|
+
}
|
|
94168
|
+
transaction(name, options) {
|
|
94169
|
+
return new PanoramaTransactionImpl(this.baseClient, name, options);
|
|
94170
|
+
}
|
|
94171
|
+
errorMonitor(options) {
|
|
94172
|
+
return new PanoramaErrorMonitorImpl(this.baseClient, options);
|
|
94173
|
+
}
|
|
94174
|
+
logger() {
|
|
94175
|
+
return new PanoramaLoggerImpl(this.baseClient);
|
|
94176
|
+
}
|
|
94177
|
+
};
|
|
94178
|
+
|
|
94179
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/plugins/hooks-manager.js
|
|
94180
|
+
init_esm_shims();
|
|
94181
|
+
var import_defineProperty2 = __toESM(require_defineProperty());
|
|
94182
|
+
var Hook2 = /* @__PURE__ */ function(Hook3) {
|
|
94183
|
+
Hook3[Hook3["afterCreateClientForComponent"] = 0] = "afterCreateClientForComponent";
|
|
94184
|
+
Hook3[Hook3["beforeReport"] = 1] = "beforeReport";
|
|
94185
|
+
Hook3[Hook3["beforeReportTransactionStart"] = 2] = "beforeReportTransactionStart";
|
|
94186
|
+
Hook3[Hook3["afterReportTransactionStart"] = 3] = "afterReportTransactionStart";
|
|
94187
|
+
Hook3[Hook3["beforeReportTransactionFinish"] = 4] = "beforeReportTransactionFinish";
|
|
94188
|
+
Hook3[Hook3["afterReportTransactionFinish"] = 5] = "afterReportTransactionFinish";
|
|
94189
|
+
Hook3[Hook3["beforeReportPhaseStart"] = 6] = "beforeReportPhaseStart";
|
|
94190
|
+
Hook3[Hook3["afterReportPhaseStart"] = 7] = "afterReportPhaseStart";
|
|
94191
|
+
Hook3[Hook3["beforeReportPhaseFinish"] = 8] = "beforeReportPhaseFinish";
|
|
94192
|
+
Hook3[Hook3["afterReportPhaseFinish"] = 9] = "afterReportPhaseFinish";
|
|
94193
|
+
Hook3[Hook3["beforeReportError"] = 10] = "beforeReportError";
|
|
94194
|
+
Hook3[Hook3["afterReportError"] = 11] = "afterReportError";
|
|
94195
|
+
Hook3[Hook3["beforeAddBreadcrumb"] = 12] = "beforeAddBreadcrumb";
|
|
94196
|
+
Hook3[Hook3["afterAddBreadcrumb"] = 13] = "afterAddBreadcrumb";
|
|
94197
|
+
Hook3[Hook3["beforeReportLog"] = 14] = "beforeReportLog";
|
|
94198
|
+
Hook3[Hook3["afterReportLog"] = 15] = "afterReportLog";
|
|
94199
|
+
Hook3[Hook3["beforeUnhandledError"] = 16] = "beforeUnhandledError";
|
|
94200
|
+
return Hook3;
|
|
94201
|
+
}({});
|
|
94202
|
+
var HooksManager = class {
|
|
94203
|
+
constructor() {
|
|
94204
|
+
(0, import_defineProperty2.default)(this, "subscribers", {});
|
|
94205
|
+
}
|
|
94206
|
+
tap(hook, subscriber) {
|
|
94207
|
+
this.subscribers[hook] = this.subscribers[hook] || [];
|
|
94208
|
+
this.subscribers[hook].push(subscriber);
|
|
94209
|
+
}
|
|
94210
|
+
invoke(hook) {
|
|
94211
|
+
const subscribers = this.subscribers[hook];
|
|
94212
|
+
if (!subscribers) {
|
|
94213
|
+
return true;
|
|
94214
|
+
}
|
|
94215
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
94216
|
+
args[_key - 1] = arguments[_key];
|
|
94217
|
+
}
|
|
94218
|
+
for (const subscriber of subscribers) {
|
|
94219
|
+
if (subscriber(...args) === false) {
|
|
94220
|
+
return false;
|
|
94221
|
+
}
|
|
94222
|
+
}
|
|
94223
|
+
return true;
|
|
94224
|
+
}
|
|
94225
|
+
};
|
|
94226
|
+
|
|
94227
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-phase.js
|
|
94228
|
+
init_esm_shims();
|
|
94229
|
+
var PanoramaPhaseImpl = class {
|
|
94230
|
+
constructor(name, baseClient) {
|
|
94231
|
+
this.name = name;
|
|
94232
|
+
this.baseClient = baseClient;
|
|
94233
|
+
this.baseClient = baseClient;
|
|
94234
|
+
bindPrototypeMethodsToSelf(this);
|
|
94235
|
+
}
|
|
94236
|
+
start(data) {
|
|
94237
|
+
return this.baseClient.reportPhaseStart(this.name, data);
|
|
94238
|
+
}
|
|
94239
|
+
finish(data) {
|
|
94240
|
+
return this.baseClient.reportPhaseFinish(this.name, data);
|
|
94241
|
+
}
|
|
94242
|
+
};
|
|
94243
|
+
|
|
94244
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-client.js
|
|
94245
|
+
var PanoramaClientImpl = class {
|
|
94246
|
+
constructor(_ref) {
|
|
94247
|
+
let {
|
|
94248
|
+
hooksManager,
|
|
94249
|
+
baseClient
|
|
94250
|
+
} = _ref;
|
|
94251
|
+
(0, import_defineProperty3.default)(this, "baseClient", void 0);
|
|
94252
|
+
(0, import_defineProperty3.default)(this, "hooksManager", void 0);
|
|
94253
|
+
this.baseClient = baseClient;
|
|
94254
|
+
this.hooksManager = hooksManager;
|
|
94255
|
+
bindPrototypeMethodsToSelf(this);
|
|
94256
|
+
}
|
|
94257
|
+
onUnhandledError(subscriber) {
|
|
94258
|
+
this.hooksManager.tap(Hook2.beforeUnhandledError, subscriber);
|
|
94259
|
+
}
|
|
94260
|
+
reportLoadStart(data, options) {
|
|
94261
|
+
const {
|
|
94262
|
+
ComponentLoad
|
|
94263
|
+
} = InternalTransactions;
|
|
94264
|
+
return this.baseClient.reportTransactionStart(ComponentLoad, options, data);
|
|
94265
|
+
}
|
|
94266
|
+
reportLoadFinish(data, options) {
|
|
94267
|
+
const {
|
|
94268
|
+
ComponentLoad
|
|
94269
|
+
} = InternalTransactions;
|
|
94270
|
+
return this.baseClient.reportTransactionFinish(ComponentLoad, options, data);
|
|
94271
|
+
}
|
|
94272
|
+
phase(name) {
|
|
94273
|
+
return new PanoramaPhaseImpl(name, this.baseClient);
|
|
94274
|
+
}
|
|
94275
|
+
transaction(name, options) {
|
|
94276
|
+
return new PanoramaTransactionImpl(this.baseClient, name, options);
|
|
94277
|
+
}
|
|
94278
|
+
errorMonitor(options) {
|
|
94279
|
+
return new PanoramaErrorMonitorImpl(this.baseClient, options);
|
|
94280
|
+
}
|
|
94281
|
+
logger() {
|
|
94282
|
+
return new PanoramaLoggerImpl(this.baseClient);
|
|
94283
|
+
}
|
|
94284
|
+
createClientForComponent() {
|
|
94285
|
+
const client2 = new PanoramaClientForComponentImpl({
|
|
94286
|
+
baseClient: this.baseClient
|
|
94287
|
+
});
|
|
94288
|
+
this.hooksManager.invoke(Hook2.afterCreateClientForComponent, client2);
|
|
94289
|
+
return client2;
|
|
94290
|
+
}
|
|
94291
|
+
};
|
|
94292
|
+
|
|
94293
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-client-base.js
|
|
94294
|
+
init_esm_shims();
|
|
94295
|
+
var import_defineProperty4 = __toESM(require_defineProperty());
|
|
94296
|
+
|
|
94297
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/lib/payload-builder.js
|
|
94298
|
+
init_esm_shims();
|
|
94299
|
+
|
|
94300
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/utils/error-utils.js
|
|
94301
|
+
init_esm_shims();
|
|
94302
|
+
var extractWixHttpErrorDetailsRec = (error) => {
|
|
94303
|
+
var _httpClientError$resp;
|
|
94304
|
+
if (!(error instanceof Error)) {
|
|
94305
|
+
return {};
|
|
94306
|
+
}
|
|
94307
|
+
const res = extractWixHttpErrorDetailsRec(error.cause);
|
|
94308
|
+
const httpClientError = error;
|
|
94309
|
+
return defaults2(res, {
|
|
94310
|
+
isWixHttpError: httpClientError.isWixHttpError,
|
|
94311
|
+
requestId: ((_httpClientError$resp = httpClientError.response) == null || (_httpClientError$resp = _httpClientError$resp.headers) == null ? void 0 : _httpClientError$resp["x-wix-request-id"]) ?? httpClientError.requestId
|
|
94312
|
+
});
|
|
94313
|
+
};
|
|
94314
|
+
var extractWixHttpErrorDetails = (error) => defaults2(extractWixHttpErrorDetailsRec(error), {
|
|
94315
|
+
isWixHttpError: false,
|
|
94316
|
+
requestId: ""
|
|
94317
|
+
});
|
|
94318
|
+
|
|
94319
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/lib/payload-sanitizer.js
|
|
94320
|
+
init_esm_shims();
|
|
94321
|
+
|
|
94322
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/constants.js
|
|
94323
|
+
init_esm_shims();
|
|
94324
|
+
var MAX_STACK_TRACE_SIZE_BYTES = 32 * 1024;
|
|
94325
|
+
var MAX_SESSION_TIME_MS = 24 * 60 * 60 * 1e3;
|
|
94326
|
+
|
|
94327
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/lib/payload-sanitizer.js
|
|
94328
|
+
var sanitizePayload = (payload5) => {
|
|
94329
|
+
const {
|
|
94330
|
+
errorStack,
|
|
94331
|
+
sessionTime
|
|
94332
|
+
} = payload5;
|
|
94333
|
+
if (errorStack && errorStack.length > MAX_STACK_TRACE_SIZE_BYTES) {
|
|
94334
|
+
const truncationMessage = `...[truncated by Panorama client to ${MAX_STACK_TRACE_SIZE_BYTES / 1024}kb]`;
|
|
94335
|
+
const truncatedErrorStack = errorStack.substring(0, MAX_STACK_TRACE_SIZE_BYTES - truncationMessage.length);
|
|
94336
|
+
payload5 = {
|
|
94337
|
+
...payload5,
|
|
94338
|
+
errorStack: `${truncatedErrorStack}${truncationMessage}`
|
|
94339
|
+
};
|
|
94340
|
+
}
|
|
94341
|
+
if (sessionTime && sessionTime > MAX_SESSION_TIME_MS) {
|
|
94342
|
+
payload5 = {
|
|
94343
|
+
...payload5,
|
|
94344
|
+
sessionTime: MAX_SESSION_TIME_MS
|
|
94345
|
+
};
|
|
94346
|
+
}
|
|
94347
|
+
return payload5;
|
|
94348
|
+
};
|
|
94349
|
+
|
|
94350
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/lib/payload-builder.js
|
|
94351
|
+
var getSessionParams = (globalConfig2) => {
|
|
94352
|
+
const sessionId = globalConfig2.getSessionId();
|
|
94353
|
+
const sessionTime = Math.round(globalConfig2.getSessionTime());
|
|
94354
|
+
return {
|
|
94355
|
+
sessionId,
|
|
94356
|
+
sessionTime
|
|
94357
|
+
};
|
|
94358
|
+
};
|
|
94359
|
+
var buildTransactionPayload = (globalConfig2, baseParams, transactionParams, data) => {
|
|
94360
|
+
const {
|
|
94361
|
+
transactionName,
|
|
94362
|
+
transactionAction
|
|
94363
|
+
} = transactionParams;
|
|
94364
|
+
const {
|
|
94365
|
+
sessionId,
|
|
94366
|
+
sessionTime
|
|
94367
|
+
} = getSessionParams(globalConfig2);
|
|
94368
|
+
const logLevel = LogLevel.Info;
|
|
94369
|
+
const message = `Panorama ${transactionName} ${transactionAction}`;
|
|
94370
|
+
const requestId = "";
|
|
94371
|
+
return sanitizePayload({
|
|
94372
|
+
...baseParams,
|
|
94373
|
+
...transactionParams,
|
|
94374
|
+
sessionId,
|
|
94375
|
+
sessionTime,
|
|
94376
|
+
logLevel,
|
|
94377
|
+
requestId,
|
|
94378
|
+
message,
|
|
94379
|
+
data
|
|
94380
|
+
});
|
|
94381
|
+
};
|
|
94382
|
+
var buildPhasePayload = (globalConfig2, baseParams, phaseParams, data) => {
|
|
94383
|
+
const transactionName = InternalTransactions.ComponentPhase;
|
|
94384
|
+
const {
|
|
94385
|
+
phaseName,
|
|
94386
|
+
transactionAction
|
|
94387
|
+
} = phaseParams;
|
|
94388
|
+
const {
|
|
94389
|
+
sessionId,
|
|
94390
|
+
sessionTime
|
|
94391
|
+
} = getSessionParams(globalConfig2);
|
|
94392
|
+
const logLevel = LogLevel.Info;
|
|
94393
|
+
const message = `Panorama ${phaseName} phase ${transactionAction}`;
|
|
94394
|
+
const requestId = "";
|
|
94395
|
+
return sanitizePayload({
|
|
94396
|
+
...baseParams,
|
|
94397
|
+
...phaseParams,
|
|
94398
|
+
transactionName,
|
|
94399
|
+
sessionId,
|
|
94400
|
+
sessionTime,
|
|
94401
|
+
logLevel,
|
|
94402
|
+
requestId,
|
|
94403
|
+
message,
|
|
94404
|
+
data
|
|
94405
|
+
});
|
|
94406
|
+
};
|
|
94407
|
+
var buildErrorPayload = (globalConfig2, baseParams, error, data) => {
|
|
94408
|
+
const {
|
|
94409
|
+
sessionId,
|
|
94410
|
+
sessionTime
|
|
94411
|
+
} = getSessionParams(globalConfig2);
|
|
94412
|
+
const {
|
|
94413
|
+
constructor,
|
|
94414
|
+
message,
|
|
94415
|
+
stack = ""
|
|
94416
|
+
} = error;
|
|
94417
|
+
const logLevel = LogLevel.Error;
|
|
94418
|
+
const {
|
|
94419
|
+
requestId
|
|
94420
|
+
} = extractWixHttpErrorDetails(error);
|
|
94421
|
+
return sanitizePayload({
|
|
94422
|
+
...baseParams,
|
|
94423
|
+
sessionId,
|
|
94424
|
+
sessionTime,
|
|
94425
|
+
logLevel,
|
|
94426
|
+
requestId,
|
|
94427
|
+
data,
|
|
94428
|
+
errorName: (data == null ? void 0 : data.errorName) ?? constructor.name,
|
|
94429
|
+
errorStack: stack,
|
|
94430
|
+
message
|
|
94431
|
+
});
|
|
94432
|
+
};
|
|
94433
|
+
var buildLoggerPayload = (globalConfig2, baseParams, loggerParams) => {
|
|
94434
|
+
const {
|
|
94435
|
+
sessionId,
|
|
94436
|
+
sessionTime
|
|
94437
|
+
} = getSessionParams(globalConfig2);
|
|
94438
|
+
const requestId = "";
|
|
94439
|
+
return sanitizePayload({
|
|
94440
|
+
...baseParams,
|
|
94441
|
+
...loggerParams,
|
|
94442
|
+
sessionId,
|
|
94443
|
+
sessionTime,
|
|
94444
|
+
requestId
|
|
94445
|
+
});
|
|
94446
|
+
};
|
|
94447
|
+
|
|
94448
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-client-base.js
|
|
94449
|
+
var BasePanoramaClient = class {
|
|
94450
|
+
constructor(_ref) {
|
|
94451
|
+
var _this = this;
|
|
94452
|
+
let {
|
|
94453
|
+
baseParams,
|
|
94454
|
+
globalConfig: globalConfig2,
|
|
94455
|
+
reporter,
|
|
94456
|
+
hooksManager,
|
|
94457
|
+
data,
|
|
94458
|
+
isMuted
|
|
94459
|
+
} = _ref;
|
|
94460
|
+
(0, import_defineProperty4.default)(this, "durationTracker", void 0);
|
|
94461
|
+
(0, import_defineProperty4.default)(this, "baseParams", void 0);
|
|
94462
|
+
(0, import_defineProperty4.default)(this, "globalConfig", void 0);
|
|
94463
|
+
(0, import_defineProperty4.default)(this, "reporter", void 0);
|
|
94464
|
+
(0, import_defineProperty4.default)(this, "hooksManager", void 0);
|
|
94465
|
+
(0, import_defineProperty4.default)(this, "data", void 0);
|
|
94466
|
+
(0, import_defineProperty4.default)(this, "isMuted", void 0);
|
|
94467
|
+
(0, import_defineProperty4.default)(this, "getErrorMonitorDataWithDefaults", function() {
|
|
94468
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
94469
|
+
args[_key] = arguments[_key];
|
|
94470
|
+
}
|
|
94471
|
+
return _this.data.addDataScope(args).getData();
|
|
94472
|
+
});
|
|
94473
|
+
this.baseParams = baseParams;
|
|
94474
|
+
this.globalConfig = globalConfig2;
|
|
94475
|
+
this.reporter = reporter;
|
|
94476
|
+
this.hooksManager = hooksManager;
|
|
94477
|
+
this.data = data;
|
|
94478
|
+
this.isMuted = isMuted;
|
|
94479
|
+
this.durationTracker = typeof globalConfig2.getDurationTracker === "function" ? globalConfig2.getDurationTracker() : createDurationTracker();
|
|
94480
|
+
}
|
|
94481
|
+
report(eventPayload) {
|
|
94482
|
+
if (this.isMuted()) {
|
|
94483
|
+
return;
|
|
94484
|
+
}
|
|
94485
|
+
const reporterOverride = this.globalConfig.getReporter();
|
|
94486
|
+
const beforeReportHookResult = this.hooksManager.invoke(Hook2.beforeReport, eventPayload);
|
|
94487
|
+
if (typeof reporterOverride === "function") {
|
|
94488
|
+
reporterOverride(eventPayload);
|
|
94489
|
+
return;
|
|
94490
|
+
}
|
|
94491
|
+
if (!beforeReportHookResult) {
|
|
94492
|
+
return;
|
|
94493
|
+
}
|
|
94494
|
+
this.reporter(eventPayload);
|
|
94495
|
+
}
|
|
94496
|
+
reportTransactionStart(name, options, data) {
|
|
94497
|
+
if (options === void 0) {
|
|
94498
|
+
options = {};
|
|
94499
|
+
}
|
|
94500
|
+
const {
|
|
94501
|
+
id
|
|
94502
|
+
} = options;
|
|
94503
|
+
const dataWithDefault = this.data.addDataScope(data).getData();
|
|
94504
|
+
if (!this.hooksManager.invoke(Hook2.beforeReportTransactionStart, name, dataWithDefault)) {
|
|
94505
|
+
return;
|
|
94506
|
+
}
|
|
94507
|
+
const {
|
|
94508
|
+
fullArtifactId,
|
|
94509
|
+
componentId
|
|
94510
|
+
} = this.baseParams;
|
|
94511
|
+
this.durationTracker.markTransactionStart(fullArtifactId, componentId, name, id);
|
|
94512
|
+
const payload5 = buildTransactionPayload(this.globalConfig, this.baseParams, {
|
|
94513
|
+
transactionName: name,
|
|
94514
|
+
transactionAction: TransactionAction.Start
|
|
94515
|
+
}, dataWithDefault);
|
|
94516
|
+
this.report(payload5);
|
|
94517
|
+
this.hooksManager.invoke(Hook2.afterReportTransactionStart, name, payload5);
|
|
94518
|
+
}
|
|
94519
|
+
reportTransactionFinish(name, options, data) {
|
|
94520
|
+
if (options === void 0) {
|
|
94521
|
+
options = {};
|
|
94522
|
+
}
|
|
94523
|
+
const {
|
|
94524
|
+
id
|
|
94525
|
+
} = options;
|
|
94526
|
+
const dataWithDefault = this.data.addDataScope(data).getData();
|
|
94527
|
+
if (!this.hooksManager.invoke(Hook2.beforeReportTransactionFinish, name, dataWithDefault)) {
|
|
94528
|
+
return;
|
|
94529
|
+
}
|
|
94530
|
+
const {
|
|
94531
|
+
fullArtifactId,
|
|
94532
|
+
componentId
|
|
94533
|
+
} = this.baseParams;
|
|
94534
|
+
const duration2 = this.durationTracker.markTransactionFinish(fullArtifactId, componentId, name, id);
|
|
94535
|
+
const payload5 = buildTransactionPayload(this.globalConfig, this.baseParams, {
|
|
94536
|
+
transactionName: name,
|
|
94537
|
+
transactionAction: TransactionAction.Finish,
|
|
94538
|
+
transactionDuration: duration2
|
|
94539
|
+
}, dataWithDefault);
|
|
94540
|
+
this.report(payload5);
|
|
94541
|
+
this.hooksManager.invoke(Hook2.afterReportTransactionFinish, name, payload5);
|
|
94542
|
+
}
|
|
94543
|
+
reportPhaseStart(name, data) {
|
|
94544
|
+
const dataWithDefault = this.data.addDataScope(data).getData();
|
|
94545
|
+
if (!this.hooksManager.invoke(Hook2.beforeReportPhaseStart, name, dataWithDefault)) {
|
|
94546
|
+
return;
|
|
94547
|
+
}
|
|
94548
|
+
const {
|
|
94549
|
+
fullArtifactId,
|
|
94550
|
+
componentId
|
|
94551
|
+
} = this.baseParams;
|
|
94552
|
+
this.durationTracker.markPhaseStart(fullArtifactId, componentId, name);
|
|
94553
|
+
const payload5 = buildPhasePayload(this.globalConfig, this.baseParams, {
|
|
94554
|
+
phaseName: name,
|
|
94555
|
+
transactionAction: TransactionAction.Start
|
|
94556
|
+
}, dataWithDefault);
|
|
94557
|
+
this.report(payload5);
|
|
94558
|
+
this.hooksManager.invoke(Hook2.afterReportPhaseStart, name, payload5);
|
|
94559
|
+
}
|
|
94560
|
+
reportPhaseFinish(name, data) {
|
|
94561
|
+
const dataWithDefault = this.data.addDataScope(data).getData();
|
|
94562
|
+
if (!this.hooksManager.invoke(Hook2.beforeReportPhaseFinish, name, dataWithDefault)) {
|
|
94563
|
+
return;
|
|
94564
|
+
}
|
|
94565
|
+
const {
|
|
94566
|
+
fullArtifactId,
|
|
94567
|
+
componentId
|
|
94568
|
+
} = this.baseParams;
|
|
94569
|
+
const duration2 = this.durationTracker.markPhaseFinish(fullArtifactId, componentId, name);
|
|
94570
|
+
const payload5 = buildPhasePayload(this.globalConfig, this.baseParams, {
|
|
94571
|
+
phaseName: name,
|
|
94572
|
+
transactionAction: TransactionAction.Finish,
|
|
94573
|
+
transactionDuration: duration2
|
|
94574
|
+
}, dataWithDefault);
|
|
94575
|
+
this.report(payload5);
|
|
94576
|
+
this.hooksManager.invoke(Hook2.afterReportPhaseFinish, name, payload5);
|
|
94577
|
+
}
|
|
94578
|
+
reportError(error, data, options) {
|
|
94579
|
+
if (!(error instanceof Error)) {
|
|
94580
|
+
return;
|
|
94581
|
+
}
|
|
94582
|
+
data = this.data.addDataScope([data, options == null ? void 0 : options.data]).getData();
|
|
94583
|
+
if (!this.hooksManager.invoke(Hook2.beforeReportError, error, data, options)) {
|
|
94584
|
+
return;
|
|
94585
|
+
}
|
|
94586
|
+
const payload5 = buildErrorPayload(this.globalConfig, this.baseParams, error, data);
|
|
94587
|
+
this.report(payload5);
|
|
94588
|
+
this.hooksManager.invoke(Hook2.afterReportError, error, data, options);
|
|
94589
|
+
}
|
|
94590
|
+
addBreadcrumb(breadcrumb) {
|
|
94591
|
+
if (!this.hooksManager.invoke(Hook2.beforeAddBreadcrumb, breadcrumb)) {
|
|
94592
|
+
return;
|
|
94593
|
+
}
|
|
94594
|
+
this.hooksManager.invoke(Hook2.afterAddBreadcrumb, breadcrumb);
|
|
94595
|
+
}
|
|
94596
|
+
log(logLevel, message, data) {
|
|
94597
|
+
if (!message) {
|
|
94598
|
+
return;
|
|
94599
|
+
}
|
|
94600
|
+
const dataWithDefault = this.data.addDataScope(data).getData();
|
|
94601
|
+
const loggerParams = {
|
|
94602
|
+
message,
|
|
94603
|
+
data: dataWithDefault,
|
|
94604
|
+
logLevel
|
|
94605
|
+
};
|
|
94606
|
+
if (!this.hooksManager.invoke(Hook2.beforeReportLog, logLevel, message, dataWithDefault)) {
|
|
94607
|
+
return;
|
|
94608
|
+
}
|
|
94609
|
+
const payload5 = buildLoggerPayload(this.globalConfig, this.baseParams, loggerParams);
|
|
94610
|
+
this.report(payload5);
|
|
94611
|
+
this.hooksManager.invoke(Hook2.afterReportLog, logLevel, message, dataWithDefault);
|
|
94612
|
+
}
|
|
94613
|
+
};
|
|
94614
|
+
|
|
94615
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/lib/scope.js
|
|
94616
|
+
init_esm_shims();
|
|
94617
|
+
var import_defineProperty5 = __toESM(require_defineProperty());
|
|
94618
|
+
var Scope2 = class _Scope {
|
|
94619
|
+
constructor(data) {
|
|
94620
|
+
(0, import_defineProperty5.default)(this, "data", void 0);
|
|
94621
|
+
this.data = data;
|
|
94622
|
+
}
|
|
94623
|
+
getEntriesToDeepDefaults(data) {
|
|
94624
|
+
if (!data) {
|
|
94625
|
+
return void 0;
|
|
94626
|
+
}
|
|
94627
|
+
return Object.fromEntries(Object.entries(data).filter((_ref) => {
|
|
94628
|
+
let [key] = _ref;
|
|
94629
|
+
return _Scope.KEYS_TO_DEEP_DEFAULTS.includes(key);
|
|
94630
|
+
}));
|
|
94631
|
+
}
|
|
94632
|
+
addDataScope(data) {
|
|
94633
|
+
const outerDataArray = Array.isArray(data) ? data : [data];
|
|
94634
|
+
const deepDefaultData = deepDefaults(...outerDataArray.map((_data) => this.getEntriesToDeepDefaults(_data)), this.getEntriesToDeepDefaults(this.data));
|
|
94635
|
+
return new _Scope(defaults2(deepDefaultData, ...outerDataArray, this.data));
|
|
94636
|
+
}
|
|
94637
|
+
getData() {
|
|
94638
|
+
return this.data;
|
|
94639
|
+
}
|
|
94640
|
+
};
|
|
94641
|
+
(0, import_defineProperty5.default)(Scope2, "KEYS_TO_DEEP_DEFAULTS", ["tags", "context"]);
|
|
94642
|
+
|
|
94643
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-client/dist/esm/panorama-client-factory.js
|
|
94644
|
+
var PanoramaClientFactoryImpl = class {
|
|
94645
|
+
constructor(options) {
|
|
94646
|
+
this.options = options;
|
|
94647
|
+
(0, import_defineProperty6.default)(this, "globalConfig", void 0);
|
|
94648
|
+
(0, import_defineProperty6.default)(this, "reporter", () => true);
|
|
94649
|
+
(0, import_defineProperty6.default)(this, "plugins", []);
|
|
94650
|
+
(0, import_defineProperty6.default)(this, "isMuted", false);
|
|
94651
|
+
bindPrototypeMethodsToSelf(this);
|
|
94652
|
+
}
|
|
94653
|
+
withGlobalConfig(globalConfig2) {
|
|
94654
|
+
this.globalConfig = globalConfig2;
|
|
94655
|
+
return this;
|
|
94656
|
+
}
|
|
94657
|
+
withReporter(reporter) {
|
|
94658
|
+
this.reporter = reporter;
|
|
94659
|
+
return this;
|
|
94660
|
+
}
|
|
94661
|
+
setMuted(isMuted) {
|
|
94662
|
+
this.isMuted = isMuted;
|
|
94663
|
+
return this;
|
|
94664
|
+
}
|
|
94665
|
+
use(plugin) {
|
|
94666
|
+
this.plugins.push(plugin);
|
|
94667
|
+
return this;
|
|
94668
|
+
}
|
|
94669
|
+
client(options) {
|
|
94670
|
+
if (options === void 0) {
|
|
94671
|
+
options = {};
|
|
94672
|
+
}
|
|
94673
|
+
const {
|
|
94674
|
+
pluginParams
|
|
94675
|
+
} = options;
|
|
94676
|
+
const globalConfig2 = this.globalConfig ?? createGlobalConfig();
|
|
94677
|
+
const reporter = this.reporter;
|
|
94678
|
+
const hooksManager = new HooksManager();
|
|
94679
|
+
const baseParams = defaults2(options.baseParams, this.options.baseParams);
|
|
94680
|
+
const data = new Scope2(this.options.data).addDataScope(options.data);
|
|
94681
|
+
const pluginClientParams = pluginParams ?? {};
|
|
94682
|
+
const baseClient = new BasePanoramaClient({
|
|
94683
|
+
baseParams,
|
|
94684
|
+
globalConfig: globalConfig2,
|
|
94685
|
+
isMuted: () => this.isMuted,
|
|
94686
|
+
reporter,
|
|
94687
|
+
hooksManager,
|
|
94688
|
+
data
|
|
94689
|
+
});
|
|
94690
|
+
const client2 = new PanoramaClientImpl({
|
|
94691
|
+
baseClient,
|
|
94692
|
+
hooksManager
|
|
94693
|
+
});
|
|
94694
|
+
this.plugins.forEach((plugin) => plugin({
|
|
94695
|
+
hooksManager,
|
|
94696
|
+
globalConfig: globalConfig2,
|
|
94697
|
+
reporter,
|
|
94698
|
+
baseClient,
|
|
94699
|
+
baseParams,
|
|
94700
|
+
pluginParams: pluginClientParams
|
|
94701
|
+
}));
|
|
94702
|
+
return client2;
|
|
94703
|
+
}
|
|
94704
|
+
};
|
|
94705
|
+
var panoramaClient = function(options) {
|
|
94706
|
+
if (options === void 0) {
|
|
94707
|
+
options = {};
|
|
94708
|
+
}
|
|
94709
|
+
return new PanoramaClientFactoryImpl(options);
|
|
94710
|
+
};
|
|
94711
|
+
|
|
94712
|
+
// ../../node_modules/@wix/panorama-client-node/node_modules/@wix/panorama-common-shared/dist/esm/constants.js
|
|
94713
|
+
init_esm_shims();
|
|
94714
|
+
var CLICKHOUSE_REPORT_URL = "https://panorama.wixapps.net/api/v1/log";
|
|
94715
|
+
|
|
94716
|
+
// ../../node_modules/@wix/panorama-client-node/dist/esm/reporter.js
|
|
94717
|
+
init_esm_shims();
|
|
94718
|
+
var nodeReporter = function(url2, _temp) {
|
|
94719
|
+
let {
|
|
94720
|
+
silent = false
|
|
94721
|
+
} = _temp === void 0 ? {
|
|
94722
|
+
silent: false
|
|
94723
|
+
} : _temp;
|
|
94724
|
+
return (eventPayload) => {
|
|
94725
|
+
const body = JSON.stringify({
|
|
94726
|
+
logMessage: eventPayload
|
|
94727
|
+
});
|
|
94728
|
+
fetch(url2, {
|
|
94729
|
+
method: "POST",
|
|
94730
|
+
body
|
|
94731
|
+
}).then((res) => {
|
|
94732
|
+
if (res.ok || silent) {
|
|
94733
|
+
return;
|
|
94734
|
+
}
|
|
94735
|
+
console.error("Panorama report failed", res.statusText);
|
|
94736
|
+
}).catch((e2) => {
|
|
94737
|
+
if (silent) {
|
|
94738
|
+
return;
|
|
94739
|
+
}
|
|
94740
|
+
console.error("Panorama report failed", e2);
|
|
94741
|
+
});
|
|
94742
|
+
return true;
|
|
94743
|
+
};
|
|
94744
|
+
};
|
|
94745
|
+
|
|
94746
|
+
// ../../node_modules/@wix/panorama-client-node/dist/esm/panorama-client-node.js
|
|
94747
|
+
var panoramaClientFactory = (options) => {
|
|
94748
|
+
const {
|
|
94749
|
+
baseParams,
|
|
94750
|
+
reporterOptions,
|
|
94751
|
+
data
|
|
94752
|
+
} = options;
|
|
94753
|
+
const factory = panoramaClient({
|
|
94754
|
+
baseParams,
|
|
94755
|
+
data
|
|
94756
|
+
}).withReporter(nodeReporter(CLICKHOUSE_REPORT_URL, reporterOptions));
|
|
94757
|
+
factory.use = void 0;
|
|
94758
|
+
return factory;
|
|
94759
|
+
};
|
|
94760
|
+
|
|
94761
|
+
// ../cli-user-config/src/user-config.ts
|
|
94762
|
+
init_esm_shims();
|
|
94763
|
+
import { join as join7 } from "node:path";
|
|
94764
|
+
|
|
94765
|
+
// ../cli-core-definitions/src/index.ts
|
|
94766
|
+
init_esm_shims();
|
|
94767
|
+
import { join as join6 } from "node:path";
|
|
94768
|
+
var WIX_CONFIG_FILENAME = "wix.config.json";
|
|
94769
|
+
var USER_CONFIG_FILENAME = "user.config.json";
|
|
94770
|
+
var userConfigSchema = z.object({
|
|
94771
|
+
telemetry: z.boolean().default(true),
|
|
94772
|
+
tunneling: z.boolean().default(false)
|
|
94773
|
+
});
|
|
94774
|
+
function getWixConfigFilePath(projectFolder) {
|
|
94775
|
+
return join6(projectFolder, WIX_CONFIG_FILENAME);
|
|
94776
|
+
}
|
|
94777
|
+
|
|
94778
|
+
// ../cli-user-config/src/user-config.ts
|
|
94779
|
+
function getUserConfigPath() {
|
|
94780
|
+
return join7(getDataDirPath(), USER_CONFIG_FILENAME);
|
|
94781
|
+
}
|
|
94782
|
+
async function readUserConfig() {
|
|
94783
|
+
const configPath = getUserConfigPath();
|
|
94784
|
+
const isConfigExist = await pathExists(configPath);
|
|
94785
|
+
const json = isConfigExist ? await readJson(configPath) : {};
|
|
94786
|
+
return userConfigSchema.parse(json);
|
|
94787
|
+
}
|
|
94788
|
+
|
|
94789
|
+
// ../cli-panorama/src/createPanorama.ts
|
|
94790
|
+
var globalConfig = createGlobalConfig();
|
|
94791
|
+
async function createPanorama(options) {
|
|
94792
|
+
const { version, artifact, userId } = options;
|
|
94793
|
+
const userConfig = await readUserConfig();
|
|
94794
|
+
const overrides = getTestOverrides();
|
|
94795
|
+
const factory = panoramaClientFactory({
|
|
94796
|
+
baseParams: {
|
|
94797
|
+
platform: Platform.Standalone,
|
|
94798
|
+
fullArtifactId: `${artifact.groupId}.${artifact.artifactId}`,
|
|
94799
|
+
componentId: "app",
|
|
94800
|
+
// This property is mandatory, there is validation on server side
|
|
94801
|
+
artifactVersion: version,
|
|
94802
|
+
uuid: userId
|
|
94803
|
+
},
|
|
94804
|
+
reporterOptions: {
|
|
94805
|
+
silent: true
|
|
94806
|
+
}
|
|
94807
|
+
}).withGlobalConfig(globalConfig).setMuted(!userConfig.telemetry);
|
|
94808
|
+
if (overrides.panoramaReporterUrl) {
|
|
94809
|
+
return factory.withReporter(nodeReporter2(overrides.panoramaReporterUrl));
|
|
94810
|
+
}
|
|
94811
|
+
return factory;
|
|
94812
|
+
}
|
|
94813
|
+
function nodeReporter2(url2) {
|
|
94814
|
+
let queue = Promise.resolve();
|
|
94815
|
+
const noop8 = () => {
|
|
94816
|
+
};
|
|
94817
|
+
return (logMessage) => {
|
|
94818
|
+
const body = JSON.stringify({ logMessage });
|
|
94819
|
+
queue = queue.then(() => {
|
|
94820
|
+
return fetch(url2, {
|
|
94821
|
+
method: "POST",
|
|
94822
|
+
body,
|
|
94823
|
+
headers: {
|
|
94824
|
+
"Content-Type": "application/json"
|
|
94825
|
+
}
|
|
94826
|
+
}).then(noop8).catch(noop8);
|
|
94827
|
+
});
|
|
94828
|
+
return true;
|
|
94829
|
+
};
|
|
94830
|
+
}
|
|
94831
|
+
|
|
93665
94832
|
// src/bi/index.ts
|
|
93666
94833
|
init_esm_shims();
|
|
93667
94834
|
|
|
@@ -93733,34 +94900,6 @@ var StandaloneNodeLogger = (
|
|
|
93733
94900
|
);
|
|
93734
94901
|
var src_default = new StandaloneNodeLogger();
|
|
93735
94902
|
|
|
93736
|
-
// ../cli-user-config/src/user-config.ts
|
|
93737
|
-
init_esm_shims();
|
|
93738
|
-
import { join as join7 } from "node:path";
|
|
93739
|
-
|
|
93740
|
-
// ../cli-core-definitions/src/index.ts
|
|
93741
|
-
init_esm_shims();
|
|
93742
|
-
import { join as join6 } from "node:path";
|
|
93743
|
-
var WIX_CONFIG_FILENAME = "wix.config.json";
|
|
93744
|
-
var USER_CONFIG_FILENAME = "user.config.json";
|
|
93745
|
-
var userConfigSchema = z.object({
|
|
93746
|
-
telemetry: z.boolean().default(true),
|
|
93747
|
-
tunneling: z.boolean().default(false)
|
|
93748
|
-
});
|
|
93749
|
-
function getWixConfigFilePath(projectFolder) {
|
|
93750
|
-
return join6(projectFolder, WIX_CONFIG_FILENAME);
|
|
93751
|
-
}
|
|
93752
|
-
|
|
93753
|
-
// ../cli-user-config/src/user-config.ts
|
|
93754
|
-
function getUserConfigPath() {
|
|
93755
|
-
return join7(getDataDirPath(), USER_CONFIG_FILENAME);
|
|
93756
|
-
}
|
|
93757
|
-
async function readUserConfig() {
|
|
93758
|
-
const configPath = getUserConfigPath();
|
|
93759
|
-
const isConfigExist = await pathExists(configPath);
|
|
93760
|
-
const json = isConfigExist ? await readJson(configPath) : {};
|
|
93761
|
-
return userConfigSchema.parse(json);
|
|
93762
|
-
}
|
|
93763
|
-
|
|
93764
94903
|
// ../cli-telemetry/src/add-user-fields.ts
|
|
93765
94904
|
init_esm_shims();
|
|
93766
94905
|
import { randomUUID } from "node:crypto";
|
|
@@ -93908,14 +95047,14 @@ function wixCliCliError(params) {
|
|
|
93908
95047
|
var package_default = {
|
|
93909
95048
|
name: "@wix/create-headless-site",
|
|
93910
95049
|
description: "Headless site creation wizard",
|
|
93911
|
-
version: "0.0.
|
|
95050
|
+
version: "0.0.16",
|
|
93912
95051
|
bin: "bin/index.cjs",
|
|
93913
95052
|
devDependencies: {
|
|
93914
95053
|
"@commander-js/extra-typings": "^13.0.0",
|
|
93915
95054
|
"@types/react": "^18.3.3",
|
|
93916
95055
|
"@types/semver": "^7.5.8",
|
|
93917
95056
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
93918
|
-
"@wix/ambassador-funnel-projects-v1-project": "^1.0.
|
|
95057
|
+
"@wix/ambassador-funnel-projects-v1-project": "^1.0.11",
|
|
93919
95058
|
"@wix/backend-as-a-service-client": "workspace:*",
|
|
93920
95059
|
"@wix/bi-logger-dev-tools-data": "^1.116.0",
|
|
93921
95060
|
"@wix/cli-astro-definitions": "workspace:*",
|
|
@@ -93926,6 +95065,7 @@ var package_default = {
|
|
|
93926
95065
|
"@wix/cli-fs": "workspace:*",
|
|
93927
95066
|
"@wix/cli-http-client": "workspace:*",
|
|
93928
95067
|
"@wix/cli-http-client-react": "workspace:*",
|
|
95068
|
+
"@wix/cli-panorama": "workspace:*",
|
|
93929
95069
|
"@wix/cli-project-extender": "workspace:*",
|
|
93930
95070
|
"@wix/cli-telemetry": "workspace:*",
|
|
93931
95071
|
"@wix/cli-telemetry-react": "workspace:*",
|
|
@@ -94026,7 +95166,7 @@ var createBiLogger2 = async (errorReporter2, userId) => {
|
|
|
94026
95166
|
|
|
94027
95167
|
// src/components/LinkCommand/LinkCommand.tsx
|
|
94028
95168
|
init_esm_shims();
|
|
94029
|
-
var
|
|
95169
|
+
var import_react109 = __toESM(require_react(), 1);
|
|
94030
95170
|
|
|
94031
95171
|
// ../package-manager/src/index.ts
|
|
94032
95172
|
init_esm_shims();
|
|
@@ -96542,14 +97682,14 @@ var import_variant35 = __toESM(require_lib(), 1);
|
|
|
96542
97682
|
|
|
96543
97683
|
// src/components/WelcomeMessage.tsx
|
|
96544
97684
|
init_esm_shims();
|
|
96545
|
-
var
|
|
97685
|
+
var import_react95 = __toESM(require_react(), 1);
|
|
96546
97686
|
var WelcomeMessage = () => {
|
|
96547
|
-
return /* @__PURE__ */
|
|
97687
|
+
return /* @__PURE__ */ import_react95.default.createElement(Box_default, { flexDirection: "column", marginBottom: 1, paddingTop: 1 }, /* @__PURE__ */ import_react95.default.createElement(Text2, { bold: true }, "Create Headless Site"));
|
|
96548
97688
|
};
|
|
96549
97689
|
|
|
96550
97690
|
// src/components/ChooseBusinessName.tsx
|
|
96551
97691
|
init_esm_shims();
|
|
96552
|
-
var
|
|
97692
|
+
var import_react96 = __toESM(require_react(), 1);
|
|
96553
97693
|
|
|
96554
97694
|
// src/validations/validate-business-name.ts
|
|
96555
97695
|
init_esm_shims();
|
|
@@ -96564,7 +97704,7 @@ var validateBusinessName = (value2) => {
|
|
|
96564
97704
|
|
|
96565
97705
|
// src/components/ChooseBusinessName.tsx
|
|
96566
97706
|
var ChooseBusinessName = ({ onSubmit }) => {
|
|
96567
|
-
const validate3 = (0,
|
|
97707
|
+
const validate3 = (0, import_react96.useCallback)((businessName) => {
|
|
96568
97708
|
try {
|
|
96569
97709
|
validateBusinessName(businessName);
|
|
96570
97710
|
return true;
|
|
@@ -96572,7 +97712,7 @@ var ChooseBusinessName = ({ onSubmit }) => {
|
|
|
96572
97712
|
return e2.message;
|
|
96573
97713
|
}
|
|
96574
97714
|
}, []);
|
|
96575
|
-
return /* @__PURE__ */
|
|
97715
|
+
return /* @__PURE__ */ import_react96.default.createElement(
|
|
96576
97716
|
TextInput2,
|
|
96577
97717
|
{
|
|
96578
97718
|
label: "What's the name of your business?",
|
|
@@ -96585,32 +97725,32 @@ var ChooseBusinessName = ({ onSubmit }) => {
|
|
|
96585
97725
|
|
|
96586
97726
|
// src/components/CreateBusiness.tsx
|
|
96587
97727
|
init_esm_shims();
|
|
96588
|
-
var
|
|
97728
|
+
var import_react100 = __toESM(require_react(), 1);
|
|
96589
97729
|
var import_variant30 = __toESM(require_lib(), 1);
|
|
96590
97730
|
|
|
96591
97731
|
// src/clients/funnel-projects/useFunnelProjectsClient.ts
|
|
96592
97732
|
init_esm_shims();
|
|
96593
|
-
var
|
|
97733
|
+
var import_react99 = __toESM(require_react(), 1);
|
|
96594
97734
|
|
|
96595
97735
|
// ../cli-http-client-react/src/index.ts
|
|
96596
97736
|
init_esm_shims();
|
|
96597
97737
|
|
|
96598
97738
|
// ../cli-http-client-react/src/useHttpClient.ts
|
|
96599
97739
|
init_esm_shims();
|
|
96600
|
-
var
|
|
97740
|
+
var import_react98 = __toESM(require_react(), 1);
|
|
96601
97741
|
|
|
96602
97742
|
// ../cli-http-client-react/src/httpClientProvider.tsx
|
|
96603
97743
|
init_esm_shims();
|
|
96604
|
-
var
|
|
96605
|
-
var HttpClientContext = (0,
|
|
97744
|
+
var import_react97 = __toESM(require_react(), 1);
|
|
97745
|
+
var HttpClientContext = (0, import_react97.createContext)(null);
|
|
96606
97746
|
|
|
96607
97747
|
// ../cli-http-client-react/src/useHttpClient.ts
|
|
96608
97748
|
function useHttpClient({
|
|
96609
97749
|
type
|
|
96610
97750
|
}) {
|
|
96611
|
-
const context2 = (0,
|
|
97751
|
+
const context2 = (0, import_react98.useContext)(HttpClientContext);
|
|
96612
97752
|
const { getAccessToken: getAppToken, getRequestHeaders: createAuthHeaders } = useAuth();
|
|
96613
|
-
return (0,
|
|
97753
|
+
return (0, import_react98.useMemo)(
|
|
96614
97754
|
() => createHttpClient({
|
|
96615
97755
|
type,
|
|
96616
97756
|
getAppToken,
|
|
@@ -96731,7 +97871,11 @@ var FunnelProjectsClient = class {
|
|
|
96731
97871
|
// src/clients/funnel-projects/useFunnelProjectsClient.ts
|
|
96732
97872
|
function useFunnelProjectsClient() {
|
|
96733
97873
|
const httpClient = useHttpClient({ type: "api" });
|
|
96734
|
-
|
|
97874
|
+
const client2 = (0, import_react99.useMemo)(
|
|
97875
|
+
() => new FunnelProjectsClient(httpClient),
|
|
97876
|
+
[httpClient]
|
|
97877
|
+
);
|
|
97878
|
+
return usePanoramaMethodLogger(client2);
|
|
96735
97879
|
}
|
|
96736
97880
|
|
|
96737
97881
|
// src/components/CreateBusiness.tsx
|
|
@@ -96741,17 +97885,17 @@ var CreateBusiness = ({ businessName, businessTemplateId, onDone }) => {
|
|
|
96741
97885
|
const { project } = await createProject2(businessName, businessTemplateId);
|
|
96742
97886
|
onDone({ businessId: project.metaSiteId });
|
|
96743
97887
|
}, []);
|
|
96744
|
-
return /* @__PURE__ */
|
|
97888
|
+
return /* @__PURE__ */ import_react100.default.createElement(import_react100.default.Fragment, null, (0, import_variant30.match)(status, {
|
|
96745
97889
|
Error: () => null,
|
|
96746
|
-
Loading: () => /* @__PURE__ */
|
|
96747
|
-
Success: () => /* @__PURE__ */
|
|
97890
|
+
Loading: () => /* @__PURE__ */ import_react100.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react100.default.createElement(Spinner2, { text: "Creating your business..." })),
|
|
97891
|
+
Success: () => /* @__PURE__ */ import_react100.default.createElement(Box_default, { marginLeft: -2, marginBottom: 1 }, /* @__PURE__ */ import_react100.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react100.default.createElement(Badge, { skin: "success" }, "Success"), " ", /* @__PURE__ */ import_react100.default.createElement(Text2, null, "Business created successfully"))),
|
|
96748
97892
|
NotRequested: () => null
|
|
96749
97893
|
}));
|
|
96750
97894
|
};
|
|
96751
97895
|
|
|
96752
97896
|
// src/components/CreateProject.tsx
|
|
96753
97897
|
init_esm_shims();
|
|
96754
|
-
var
|
|
97898
|
+
var import_react104 = __toESM(require_react(), 1);
|
|
96755
97899
|
var import_variant31 = __toESM(require_lib(), 1);
|
|
96756
97900
|
|
|
96757
97901
|
// src/validations/validate-project-name.ts
|
|
@@ -98941,6 +100085,7 @@ var ComponentType;
|
|
|
98941
100085
|
ComponentType3["WIX_VIBE_CODING_INSTRUCTIONS"] = "WIX_VIBE_CODING_INSTRUCTIONS";
|
|
98942
100086
|
ComponentType3["TAX_EXEMPT_GROUPS_PROVIDER"] = "TAX_EXEMPT_GROUPS_PROVIDER";
|
|
98943
100087
|
ComponentType3["BOOKING_AUTOMATIONS_CONFIGURATION"] = "BOOKING_AUTOMATIONS_CONFIGURATION";
|
|
100088
|
+
ComponentType3["WIX_VIBE_COMPONENT"] = "WIX_VIBE_COMPONENT";
|
|
98944
100089
|
})(ComponentType || (ComponentType = {}));
|
|
98945
100090
|
var WidgetVertical;
|
|
98946
100091
|
(function(WidgetVertical3) {
|
|
@@ -99757,6 +100902,13 @@ var PlanFormPricingOption;
|
|
|
99757
100902
|
PlanFormPricingOption3["ONE_TIME"] = "ONE_TIME";
|
|
99758
100903
|
PlanFormPricingOption3["RECURRING"] = "RECURRING";
|
|
99759
100904
|
})(PlanFormPricingOption || (PlanFormPricingOption = {}));
|
|
100905
|
+
var PlanFormPricingType;
|
|
100906
|
+
(function(PlanFormPricingType2) {
|
|
100907
|
+
PlanFormPricingType2["UNKNOWN_OPTION"] = "UNKNOWN_OPTION";
|
|
100908
|
+
PlanFormPricingType2["FREE"] = "FREE";
|
|
100909
|
+
PlanFormPricingType2["ONE_TIME"] = "ONE_TIME";
|
|
100910
|
+
PlanFormPricingType2["RECURRING"] = "RECURRING";
|
|
100911
|
+
})(PlanFormPricingType || (PlanFormPricingType = {}));
|
|
99760
100912
|
var PlanFormDefaultSection;
|
|
99761
100913
|
(function(PlanFormDefaultSection3) {
|
|
99762
100914
|
PlanFormDefaultSection3["UNKNWON_PLAN_FORM_SECTION"] = "UNKNWON_PLAN_FORM_SECTION";
|
|
@@ -99765,6 +100917,8 @@ var PlanFormDefaultSection;
|
|
|
99765
100917
|
PlanFormDefaultSection3["PAGE_PERMISSIONS"] = "PAGE_PERMISSIONS";
|
|
99766
100918
|
PlanFormDefaultSection3["PRICING_AND_DURATION"] = "PRICING_AND_DURATION";
|
|
99767
100919
|
PlanFormDefaultSection3["ADVANCED_SETTINGS"] = "ADVANCED_SETTINGS";
|
|
100920
|
+
PlanFormDefaultSection3["PRICING"] = "PRICING";
|
|
100921
|
+
PlanFormDefaultSection3["DURATION"] = "DURATION";
|
|
99768
100922
|
})(PlanFormDefaultSection || (PlanFormDefaultSection = {}));
|
|
99769
100923
|
var PlanPeriodUnit;
|
|
99770
100924
|
(function(PlanPeriodUnit3) {
|
|
@@ -100330,12 +101484,12 @@ var InterfaceConfigurationType;
|
|
|
100330
101484
|
InterfaceConfigurationType3["WIDGET_COMPONENT"] = "WIDGET_COMPONENT";
|
|
100331
101485
|
InterfaceConfigurationType3["ITEM_SELECTION"] = "ITEM_SELECTION";
|
|
100332
101486
|
})(InterfaceConfigurationType || (InterfaceConfigurationType = {}));
|
|
100333
|
-
var
|
|
100334
|
-
(function(
|
|
100335
|
-
|
|
100336
|
-
|
|
100337
|
-
|
|
100338
|
-
})(
|
|
101487
|
+
var Scope3;
|
|
101488
|
+
(function(Scope5) {
|
|
101489
|
+
Scope5["UNKNOWN_SCOPE"] = "UNKNOWN_SCOPE";
|
|
101490
|
+
Scope5["SPECIFIC_SITE"] = "SPECIFIC_SITE";
|
|
101491
|
+
Scope5["NON_SPECIFIC_SITE"] = "NON_SPECIFIC_SITE";
|
|
101492
|
+
})(Scope3 || (Scope3 = {}));
|
|
100339
101493
|
var CssPropertyType;
|
|
100340
101494
|
(function(CssPropertyType3) {
|
|
100341
101495
|
CssPropertyType3["UNKNOWN_CssPropertyType"] = "UNKNOWN_CssPropertyType";
|
|
@@ -101556,6 +102710,7 @@ var ComponentType2;
|
|
|
101556
102710
|
ComponentType3["WIX_VIBE_CODING_INSTRUCTIONS"] = "WIX_VIBE_CODING_INSTRUCTIONS";
|
|
101557
102711
|
ComponentType3["TAX_EXEMPT_GROUPS_PROVIDER"] = "TAX_EXEMPT_GROUPS_PROVIDER";
|
|
101558
102712
|
ComponentType3["BOOKING_AUTOMATIONS_CONFIGURATION"] = "BOOKING_AUTOMATIONS_CONFIGURATION";
|
|
102713
|
+
ComponentType3["WIX_VIBE_COMPONENT"] = "WIX_VIBE_COMPONENT";
|
|
101559
102714
|
})(ComponentType2 || (ComponentType2 = {}));
|
|
101560
102715
|
var WidgetVertical2;
|
|
101561
102716
|
(function(WidgetVertical3) {
|
|
@@ -102945,12 +104100,12 @@ var InterfaceConfigurationType2;
|
|
|
102945
104100
|
InterfaceConfigurationType3["WIDGET_COMPONENT"] = "WIDGET_COMPONENT";
|
|
102946
104101
|
InterfaceConfigurationType3["ITEM_SELECTION"] = "ITEM_SELECTION";
|
|
102947
104102
|
})(InterfaceConfigurationType2 || (InterfaceConfigurationType2 = {}));
|
|
102948
|
-
var
|
|
102949
|
-
(function(
|
|
102950
|
-
|
|
102951
|
-
|
|
102952
|
-
|
|
102953
|
-
})(
|
|
104103
|
+
var Scope4;
|
|
104104
|
+
(function(Scope5) {
|
|
104105
|
+
Scope5["UNKNOWN_SCOPE"] = "UNKNOWN_SCOPE";
|
|
104106
|
+
Scope5["SPECIFIC_SITE"] = "SPECIFIC_SITE";
|
|
104107
|
+
Scope5["NON_SPECIFIC_SITE"] = "NON_SPECIFIC_SITE";
|
|
104108
|
+
})(Scope4 || (Scope4 = {}));
|
|
102954
104109
|
var CssPropertyType2;
|
|
102955
104110
|
(function(CssPropertyType3) {
|
|
102956
104111
|
CssPropertyType3["UNKNOWN_CssPropertyType"] = "UNKNOWN_CssPropertyType";
|
|
@@ -104426,10 +105581,11 @@ var DevCenterClient = class {
|
|
|
104426
105581
|
|
|
104427
105582
|
// ../dev-center-client/src/useDevCenterClient.ts
|
|
104428
105583
|
init_esm_shims();
|
|
104429
|
-
var
|
|
105584
|
+
var import_react101 = __toESM(require_react(), 1);
|
|
104430
105585
|
function useDevCenterClient() {
|
|
104431
105586
|
const httpClient = useHttpClient({ type: "backoffice" });
|
|
104432
|
-
|
|
105587
|
+
const client2 = (0, import_react101.useMemo)(() => new DevCenterClient(httpClient), [httpClient]);
|
|
105588
|
+
return usePanoramaMethodLogger(client2);
|
|
104433
105589
|
}
|
|
104434
105590
|
|
|
104435
105591
|
// ../metasite-manager-client/src/index.ts
|
|
@@ -104437,7 +105593,7 @@ init_esm_shims();
|
|
|
104437
105593
|
|
|
104438
105594
|
// ../metasite-manager-client/src/useMetasiteManagerClient.ts
|
|
104439
105595
|
init_esm_shims();
|
|
104440
|
-
var
|
|
105596
|
+
var import_react102 = __toESM(require_react(), 1);
|
|
104441
105597
|
|
|
104442
105598
|
// ../metasite-manager-client/src/metasite-manager-client.ts
|
|
104443
105599
|
init_esm_shims();
|
|
@@ -104604,7 +105760,11 @@ var MetasiteManagerClient = class {
|
|
|
104604
105760
|
// ../metasite-manager-client/src/useMetasiteManagerClient.ts
|
|
104605
105761
|
function useMetasiteManagerClient() {
|
|
104606
105762
|
const httpClient = useHttpClient({ type: "general" });
|
|
104607
|
-
|
|
105763
|
+
const client2 = (0, import_react102.useMemo)(
|
|
105764
|
+
() => new MetasiteManagerClient(httpClient),
|
|
105765
|
+
[httpClient]
|
|
105766
|
+
);
|
|
105767
|
+
return usePanoramaMethodLogger(client2);
|
|
104608
105768
|
}
|
|
104609
105769
|
|
|
104610
105770
|
// ../backend-as-a-service-client/src/index.ts
|
|
@@ -104612,7 +105772,7 @@ init_esm_shims();
|
|
|
104612
105772
|
|
|
104613
105773
|
// ../backend-as-a-service-client/src/useBackendAsAServiceClient.ts
|
|
104614
105774
|
init_esm_shims();
|
|
104615
|
-
var
|
|
105775
|
+
var import_react103 = __toESM(require_react(), 1);
|
|
104616
105776
|
|
|
104617
105777
|
// ../backend-as-a-service-client/src/backend-as-a-service-client.ts
|
|
104618
105778
|
init_esm_shims();
|
|
@@ -105069,7 +106229,11 @@ var BackendAsAServiceClient = class {
|
|
|
105069
106229
|
// ../backend-as-a-service-client/src/useBackendAsAServiceClient.ts
|
|
105070
106230
|
function useBackendAsAServiceClient() {
|
|
105071
106231
|
const httpClient = useHttpClient({ type: "backoffice" });
|
|
105072
|
-
|
|
106232
|
+
const client2 = (0, import_react103.useMemo)(
|
|
106233
|
+
() => new BackendAsAServiceClient(httpClient),
|
|
106234
|
+
[httpClient]
|
|
106235
|
+
);
|
|
106236
|
+
return usePanoramaMethodLogger(client2);
|
|
105073
106237
|
}
|
|
105074
106238
|
|
|
105075
106239
|
// src/hooks/create-project.ts
|
|
@@ -105134,17 +106298,17 @@ var useCreateProject = (businessId) => {
|
|
|
105134
106298
|
// src/components/CreateProject.tsx
|
|
105135
106299
|
var CreateProject = ({ onSubmit, projectName: providedProjectName, businessId }) => {
|
|
105136
106300
|
const { status, execute } = useCreateProject(businessId);
|
|
105137
|
-
(0,
|
|
106301
|
+
(0, import_react104.useEffect)(() => {
|
|
105138
106302
|
if ((0, import_variant31.isType)(status, "Success")) {
|
|
105139
106303
|
onSubmit(status.result);
|
|
105140
106304
|
}
|
|
105141
106305
|
}, [status, onSubmit]);
|
|
105142
|
-
(0,
|
|
106306
|
+
(0, import_react104.useEffect)(() => {
|
|
105143
106307
|
if (providedProjectName) {
|
|
105144
106308
|
void execute({ projectName: providedProjectName });
|
|
105145
106309
|
}
|
|
105146
106310
|
}, [providedProjectName, execute]);
|
|
105147
|
-
const validate3 = (0,
|
|
106311
|
+
const validate3 = (0, import_react104.useCallback)(async (projectName) => {
|
|
105148
106312
|
try {
|
|
105149
106313
|
validateProjectName(projectName);
|
|
105150
106314
|
return true;
|
|
@@ -105152,7 +106316,7 @@ var CreateProject = ({ onSubmit, projectName: providedProjectName, businessId })
|
|
|
105152
106316
|
return e2.message;
|
|
105153
106317
|
}
|
|
105154
106318
|
}, []);
|
|
105155
|
-
return /* @__PURE__ */
|
|
106319
|
+
return /* @__PURE__ */ import_react104.default.createElement(import_react104.default.Fragment, null, !providedProjectName && /* @__PURE__ */ import_react104.default.createElement(
|
|
105156
106320
|
TextInput2,
|
|
105157
106321
|
{
|
|
105158
106322
|
label: "What's the name of your Custom Frontend project?",
|
|
@@ -105162,15 +106326,15 @@ var CreateProject = ({ onSubmit, projectName: providedProjectName, businessId })
|
|
|
105162
106326
|
}
|
|
105163
106327
|
), (0, import_variant31.match)(status, {
|
|
105164
106328
|
Error: () => null,
|
|
105165
|
-
Loading: () => /* @__PURE__ */
|
|
105166
|
-
Success: () => /* @__PURE__ */
|
|
106329
|
+
Loading: () => /* @__PURE__ */ import_react104.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react104.default.createElement(Spinner2, { text: "Creating your project..." })),
|
|
106330
|
+
Success: () => /* @__PURE__ */ import_react104.default.createElement(Box_default, { marginLeft: -2, marginBottom: 1 }, /* @__PURE__ */ import_react104.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react104.default.createElement(Badge, { skin: "success" }, "Success"), " ", /* @__PURE__ */ import_react104.default.createElement(Text2, null, "Project created successfully"))),
|
|
105167
106331
|
NotRequested: () => null
|
|
105168
106332
|
}));
|
|
105169
106333
|
};
|
|
105170
106334
|
|
|
105171
106335
|
// src/components/LinkCommand/GenerateProject.tsx
|
|
105172
106336
|
init_esm_shims();
|
|
105173
|
-
var
|
|
106337
|
+
var import_react107 = __toESM(require_react(), 1);
|
|
105174
106338
|
var import_variant34 = __toESM(require_lib(), 1);
|
|
105175
106339
|
|
|
105176
106340
|
// ../cli-astro-definitions/src/index.ts
|
|
@@ -105257,7 +106421,7 @@ function sharedPlugin(fork2) {
|
|
|
105257
106421
|
isNumber2 + " >= " + than
|
|
105258
106422
|
);
|
|
105259
106423
|
}
|
|
105260
|
-
const
|
|
106424
|
+
const defaults4 = {
|
|
105261
106425
|
// Functions were used because (among other reasons) that's the most
|
|
105262
106426
|
// elegant way to allow for the emptyArray one always to give a new
|
|
105263
106427
|
// array instance.
|
|
@@ -105300,7 +106464,7 @@ function sharedPlugin(fork2) {
|
|
|
105300
106464
|
);
|
|
105301
106465
|
return {
|
|
105302
106466
|
geq,
|
|
105303
|
-
defaults:
|
|
106467
|
+
defaults: defaults4,
|
|
105304
106468
|
isPrimitive: isPrimitive3
|
|
105305
106469
|
};
|
|
105306
106470
|
}
|
|
@@ -106230,7 +107394,7 @@ function scopePlugin(fork2) {
|
|
|
106230
107394
|
var Expression2 = namedTypes2.Expression;
|
|
106231
107395
|
var isArray3 = types.builtInTypes.array;
|
|
106232
107396
|
var b2 = types.builders;
|
|
106233
|
-
const
|
|
107397
|
+
const Scope5 = function Scope22(path8, parentScope) {
|
|
106234
107398
|
if (!(this instanceof Scope22)) {
|
|
106235
107399
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
106236
107400
|
}
|
|
@@ -106280,10 +107444,10 @@ function scopePlugin(fork2) {
|
|
|
106280
107444
|
namedTypes2.TypeParameter,
|
|
106281
107445
|
namedTypes2.TSTypeParameter
|
|
106282
107446
|
);
|
|
106283
|
-
|
|
107447
|
+
Scope5.isEstablishedBy = function(node) {
|
|
106284
107448
|
return ScopeType.check(node) || TypeParameterScopeType.check(node);
|
|
106285
107449
|
};
|
|
106286
|
-
var Sp =
|
|
107450
|
+
var Sp = Scope5.prototype;
|
|
106287
107451
|
Sp.didScan = false;
|
|
106288
107452
|
Sp.declares = function(name) {
|
|
106289
107453
|
this.scan();
|
|
@@ -106510,7 +107674,7 @@ function scopePlugin(fork2) {
|
|
|
106510
107674
|
scope = scope.parent;
|
|
106511
107675
|
return scope;
|
|
106512
107676
|
};
|
|
106513
|
-
return
|
|
107677
|
+
return Scope5;
|
|
106514
107678
|
}
|
|
106515
107679
|
maybeSetModuleExports(() => module);
|
|
106516
107680
|
function nodePathPlugin(fork2) {
|
|
@@ -107416,7 +108580,7 @@ function coreDef(fork2) {
|
|
|
107416
108580
|
var def = Type5.def;
|
|
107417
108581
|
var or = Type5.or;
|
|
107418
108582
|
var shared = fork2.use(sharedPlugin);
|
|
107419
|
-
var
|
|
108583
|
+
var defaults4 = shared.defaults;
|
|
107420
108584
|
var geq = shared.geq;
|
|
107421
108585
|
const {
|
|
107422
108586
|
BinaryOperators,
|
|
@@ -107426,34 +108590,34 @@ function coreDef(fork2) {
|
|
|
107426
108590
|
def("Printable").field("loc", or(
|
|
107427
108591
|
def("SourceLocation"),
|
|
107428
108592
|
null
|
|
107429
|
-
),
|
|
108593
|
+
), defaults4["null"], true);
|
|
107430
108594
|
def("Node").bases("Printable").field("type", String).field("comments", or(
|
|
107431
108595
|
[def("Comment")],
|
|
107432
108596
|
null
|
|
107433
|
-
),
|
|
107434
|
-
def("SourceLocation").field("start", def("Position")).field("end", def("Position")).field("source", or(String, null),
|
|
108597
|
+
), defaults4["null"], true);
|
|
108598
|
+
def("SourceLocation").field("start", def("Position")).field("end", def("Position")).field("source", or(String, null), defaults4["null"]);
|
|
107435
108599
|
def("Position").field("line", geq(1)).field("column", geq(0));
|
|
107436
|
-
def("File").bases("Node").build("program", "name").field("program", def("Program")).field("name", or(String, null),
|
|
108600
|
+
def("File").bases("Node").build("program", "name").field("program", def("Program")).field("name", or(String, null), defaults4["null"]);
|
|
107437
108601
|
def("Program").bases("Node").build("body").field("body", [def("Statement")]);
|
|
107438
|
-
def("Function").bases("Node").field("id", or(def("Identifier"), null),
|
|
108602
|
+
def("Function").bases("Node").field("id", or(def("Identifier"), null), defaults4["null"]).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("generator", Boolean, defaults4["false"]).field("async", Boolean, defaults4["false"]);
|
|
107439
108603
|
def("Statement").bases("Node");
|
|
107440
108604
|
def("EmptyStatement").bases("Statement").build();
|
|
107441
108605
|
def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]);
|
|
107442
108606
|
def("ExpressionStatement").bases("Statement").build("expression").field("expression", def("Expression"));
|
|
107443
|
-
def("IfStatement").bases("Statement").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Statement")).field("alternate", or(def("Statement"), null),
|
|
108607
|
+
def("IfStatement").bases("Statement").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Statement")).field("alternate", or(def("Statement"), null), defaults4["null"]);
|
|
107444
108608
|
def("LabeledStatement").bases("Statement").build("label", "body").field("label", def("Identifier")).field("body", def("Statement"));
|
|
107445
|
-
def("BreakStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null),
|
|
107446
|
-
def("ContinueStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null),
|
|
108609
|
+
def("BreakStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null), defaults4["null"]);
|
|
108610
|
+
def("ContinueStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null), defaults4["null"]);
|
|
107447
108611
|
def("WithStatement").bases("Statement").build("object", "body").field("object", def("Expression")).field("body", def("Statement"));
|
|
107448
|
-
def("SwitchStatement").bases("Statement").build("discriminant", "cases", "lexical").field("discriminant", def("Expression")).field("cases", [def("SwitchCase")]).field("lexical", Boolean,
|
|
108612
|
+
def("SwitchStatement").bases("Statement").build("discriminant", "cases", "lexical").field("discriminant", def("Expression")).field("cases", [def("SwitchCase")]).field("lexical", Boolean, defaults4["false"]);
|
|
107449
108613
|
def("ReturnStatement").bases("Statement").build("argument").field("argument", or(def("Expression"), null));
|
|
107450
108614
|
def("ThrowStatement").bases("Statement").build("argument").field("argument", def("Expression"));
|
|
107451
108615
|
def("TryStatement").bases("Statement").build("block", "handler", "finalizer").field("block", def("BlockStatement")).field("handler", or(def("CatchClause"), null), function() {
|
|
107452
108616
|
return this.handlers && this.handlers[0] || null;
|
|
107453
108617
|
}).field("handlers", [def("CatchClause")], function() {
|
|
107454
108618
|
return this.handler ? [this.handler] : [];
|
|
107455
|
-
}, true).field("guardedHandlers", [def("CatchClause")],
|
|
107456
|
-
def("CatchClause").bases("Node").build("param", "guard", "body").field("param", def("Pattern")).field("guard", or(def("Expression"), null),
|
|
108619
|
+
}, true).field("guardedHandlers", [def("CatchClause")], defaults4.emptyArray).field("finalizer", or(def("BlockStatement"), null), defaults4["null"]);
|
|
108620
|
+
def("CatchClause").bases("Node").build("param", "guard", "body").field("param", def("Pattern")).field("guard", or(def("Expression"), null), defaults4["null"]).field("body", def("BlockStatement"));
|
|
107457
108621
|
def("WhileStatement").bases("Statement").build("test", "body").field("test", def("Expression")).field("body", def("Statement"));
|
|
107458
108622
|
def("DoWhileStatement").bases("Statement").build("body", "test").field("body", def("Statement")).field("test", def("Expression"));
|
|
107459
108623
|
def("ForStatement").bases("Statement").build("init", "test", "update", "body").field("init", or(
|
|
@@ -107470,7 +108634,7 @@ function coreDef(fork2) {
|
|
|
107470
108634
|
def("FunctionDeclaration").bases("Function", "Declaration").build("id", "params", "body").field("id", def("Identifier"));
|
|
107471
108635
|
def("FunctionExpression").bases("Function", "Expression").build("id", "params", "body");
|
|
107472
108636
|
def("VariableDeclaration").bases("Declaration").build("kind", "declarations").field("kind", or("var", "let", "const")).field("declarations", [def("VariableDeclarator")]);
|
|
107473
|
-
def("VariableDeclarator").bases("Node").build("id", "init").field("id", def("Pattern")).field("init", or(def("Expression"), null),
|
|
108637
|
+
def("VariableDeclarator").bases("Node").build("id", "init").field("id", def("Pattern")).field("init", or(def("Expression"), null), defaults4["null"]);
|
|
107474
108638
|
def("Expression").bases("Node");
|
|
107475
108639
|
def("ThisExpression").bases("Expression").build();
|
|
107476
108640
|
def("ArrayExpression").bases("Expression").build("elements").field("elements", [or(def("Expression"), null)]);
|
|
@@ -107486,7 +108650,7 @@ function coreDef(fork2) {
|
|
|
107486
108650
|
"void",
|
|
107487
108651
|
"delete"
|
|
107488
108652
|
);
|
|
107489
|
-
def("UnaryExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UnaryOperator).field("argument", def("Expression")).field("prefix", Boolean,
|
|
108653
|
+
def("UnaryExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UnaryOperator).field("argument", def("Expression")).field("prefix", Boolean, defaults4["true"]);
|
|
107490
108654
|
const BinaryOperator = or(...BinaryOperators);
|
|
107491
108655
|
def("BinaryExpression").bases("Expression").build("operator", "left", "right").field("operator", BinaryOperator).field("left", def("Expression")).field("right", def("Expression"));
|
|
107492
108656
|
const AssignmentOperator = or(...AssignmentOperators);
|
|
@@ -107507,9 +108671,9 @@ function coreDef(fork2) {
|
|
|
107507
108671
|
});
|
|
107508
108672
|
def("Pattern").bases("Node");
|
|
107509
108673
|
def("SwitchCase").bases("Node").build("test", "consequent").field("test", or(def("Expression"), null)).field("consequent", [def("Statement")]);
|
|
107510
|
-
def("Identifier").bases("Expression", "Pattern").build("name").field("name", String).field("optional", Boolean,
|
|
108674
|
+
def("Identifier").bases("Expression", "Pattern").build("name").field("name", String).field("optional", Boolean, defaults4["false"]);
|
|
107511
108675
|
def("Literal").bases("Expression").build("value").field("value", or(String, Boolean, null, Number, RegExp, BigInt));
|
|
107512
|
-
def("Comment").bases("Printable").field("value", String).field("leading", Boolean,
|
|
108676
|
+
def("Comment").bases("Printable").field("value", String).field("leading", Boolean, defaults4["true"]).field("trailing", Boolean, defaults4["false"]);
|
|
107513
108677
|
}
|
|
107514
108678
|
maybeSetModuleExports(() => module);
|
|
107515
108679
|
function es6Def(fork2) {
|
|
@@ -107517,29 +108681,29 @@ function es6Def(fork2) {
|
|
|
107517
108681
|
const types = fork2.use(typesPlugin);
|
|
107518
108682
|
const def = types.Type.def;
|
|
107519
108683
|
const or = types.Type.or;
|
|
107520
|
-
const
|
|
107521
|
-
def("Function").field("generator", Boolean,
|
|
108684
|
+
const defaults4 = fork2.use(sharedPlugin).defaults;
|
|
108685
|
+
def("Function").field("generator", Boolean, defaults4["false"]).field("expression", Boolean, defaults4["false"]).field("defaults", [or(def("Expression"), null)], defaults4.emptyArray).field("rest", or(def("Identifier"), null), defaults4["null"]);
|
|
107522
108686
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
107523
108687
|
"typeAnnotation",
|
|
107524
108688
|
// for Babylon. Flow parser puts it on the identifier
|
|
107525
108689
|
or(def("TypeAnnotation"), def("TSTypeAnnotation"), null),
|
|
107526
|
-
|
|
108690
|
+
defaults4["null"]
|
|
107527
108691
|
);
|
|
107528
108692
|
def("SpreadElementPattern").bases("Pattern").build("argument").field("argument", def("Pattern"));
|
|
107529
108693
|
def("FunctionDeclaration").build("id", "params", "body", "generator", "expression").field("id", or(def("Identifier"), null));
|
|
107530
108694
|
def("FunctionExpression").build("id", "params", "body", "generator", "expression");
|
|
107531
|
-
def("ArrowFunctionExpression").bases("Function", "Expression").build("params", "body", "expression").field("id", null,
|
|
108695
|
+
def("ArrowFunctionExpression").bases("Function", "Expression").build("params", "body", "expression").field("id", null, defaults4["null"]).field("body", or(def("BlockStatement"), def("Expression"))).field("generator", false, defaults4["false"]);
|
|
107532
108696
|
def("ForOfStatement").bases("Statement").build("left", "right", "body").field("left", or(
|
|
107533
108697
|
def("VariableDeclaration"),
|
|
107534
108698
|
def("Pattern")
|
|
107535
108699
|
)).field("right", def("Expression")).field("body", def("Statement"));
|
|
107536
|
-
def("YieldExpression").bases("Expression").build("argument", "delegate").field("argument", or(def("Expression"), null)).field("delegate", Boolean,
|
|
108700
|
+
def("YieldExpression").bases("Expression").build("argument", "delegate").field("argument", or(def("Expression"), null)).field("delegate", Boolean, defaults4["false"]);
|
|
107537
108701
|
def("GeneratorExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or(def("Expression"), null));
|
|
107538
108702
|
def("ComprehensionExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or(def("Expression"), null));
|
|
107539
108703
|
def("ComprehensionBlock").bases("Node").build("left", "right", "each").field("left", def("Pattern")).field("right", def("Expression")).field("each", Boolean);
|
|
107540
|
-
def("Property").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("value", or(def("Expression"), def("Pattern"))).field("method", Boolean,
|
|
107541
|
-
def("ObjectProperty").field("shorthand", Boolean,
|
|
107542
|
-
def("PropertyPattern").bases("Pattern").build("key", "pattern").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("pattern", def("Pattern")).field("computed", Boolean,
|
|
108704
|
+
def("Property").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("value", or(def("Expression"), def("Pattern"))).field("method", Boolean, defaults4["false"]).field("shorthand", Boolean, defaults4["false"]).field("computed", Boolean, defaults4["false"]);
|
|
108705
|
+
def("ObjectProperty").field("shorthand", Boolean, defaults4["false"]);
|
|
108706
|
+
def("PropertyPattern").bases("Pattern").build("key", "pattern").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("pattern", def("Pattern")).field("computed", Boolean, defaults4["false"]);
|
|
107543
108707
|
def("ObjectPattern").bases("Pattern").build("properties").field("properties", [or(def("PropertyPattern"), def("Property"))]);
|
|
107544
108708
|
def("ArrayPattern").bases("Pattern").build("elements").field("elements", [or(def("Pattern"), null)]);
|
|
107545
108709
|
def("SpreadElement").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -107552,7 +108716,7 @@ function es6Def(fork2) {
|
|
|
107552
108716
|
def("NewExpression").field("arguments", [or(def("Expression"), def("SpreadElement"))]);
|
|
107553
108717
|
def("CallExpression").field("arguments", [or(def("Expression"), def("SpreadElement"))]);
|
|
107554
108718
|
def("AssignmentPattern").bases("Pattern").build("left", "right").field("left", def("Pattern")).field("right", def("Expression"));
|
|
107555
|
-
def("MethodDefinition").bases("Declaration").build("kind", "key", "value", "static").field("kind", or("constructor", "method", "get", "set")).field("key", def("Expression")).field("value", def("Function")).field("computed", Boolean,
|
|
108719
|
+
def("MethodDefinition").bases("Declaration").build("kind", "key", "value", "static").field("kind", or("constructor", "method", "get", "set")).field("key", def("Expression")).field("value", def("Function")).field("computed", Boolean, defaults4["false"]).field("static", Boolean, defaults4["false"]);
|
|
107556
108720
|
const ClassBodyElement = or(
|
|
107557
108721
|
def("MethodDefinition"),
|
|
107558
108722
|
def("VariableDeclarator"),
|
|
@@ -107560,14 +108724,14 @@ function es6Def(fork2) {
|
|
|
107560
108724
|
def("ClassProperty"),
|
|
107561
108725
|
def("StaticBlock")
|
|
107562
108726
|
);
|
|
107563
|
-
def("ClassProperty").bases("Declaration").build("key").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("computed", Boolean,
|
|
108727
|
+
def("ClassProperty").bases("Declaration").build("key").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("computed", Boolean, defaults4["false"]);
|
|
107564
108728
|
def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition", ClassBodyElement);
|
|
107565
108729
|
def("ClassBody").bases("Declaration").build("body").field("body", [ClassBodyElement]);
|
|
107566
|
-
def("ClassDeclaration").bases("Declaration").build("id", "body", "superClass").field("id", or(def("Identifier"), null)).field("body", def("ClassBody")).field("superClass", or(def("Expression"), null),
|
|
107567
|
-
def("ClassExpression").bases("Expression").build("id", "body", "superClass").field("id", or(def("Identifier"), null),
|
|
108730
|
+
def("ClassDeclaration").bases("Declaration").build("id", "body", "superClass").field("id", or(def("Identifier"), null)).field("body", def("ClassBody")).field("superClass", or(def("Expression"), null), defaults4["null"]);
|
|
108731
|
+
def("ClassExpression").bases("Expression").build("id", "body", "superClass").field("id", or(def("Identifier"), null), defaults4["null"]).field("body", def("ClassBody")).field("superClass", or(def("Expression"), null), defaults4["null"]);
|
|
107568
108732
|
def("Super").bases("Expression").build();
|
|
107569
108733
|
def("Specifier").bases("Node");
|
|
107570
|
-
def("ModuleSpecifier").bases("Specifier").field("local", or(def("Identifier"), null),
|
|
108734
|
+
def("ModuleSpecifier").bases("Specifier").field("local", or(def("Identifier"), null), defaults4["null"]).field("id", or(def("Identifier"), null), defaults4["null"]).field("name", or(def("Identifier"), null), defaults4["null"]);
|
|
107571
108735
|
def("ImportSpecifier").bases("ModuleSpecifier").build("imported", "local").field("imported", def("Identifier"));
|
|
107572
108736
|
def("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local");
|
|
107573
108737
|
def("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local");
|
|
@@ -107575,13 +108739,13 @@ function es6Def(fork2) {
|
|
|
107575
108739
|
def("ImportSpecifier"),
|
|
107576
108740
|
def("ImportNamespaceSpecifier"),
|
|
107577
108741
|
def("ImportDefaultSpecifier")
|
|
107578
|
-
)],
|
|
108742
|
+
)], defaults4.emptyArray).field("source", def("Literal")).field("importKind", or(
|
|
107579
108743
|
"value",
|
|
107580
108744
|
"type"
|
|
107581
108745
|
), function() {
|
|
107582
108746
|
return "value";
|
|
107583
108747
|
});
|
|
107584
|
-
def("ExportNamedDeclaration").bases("Declaration").build("declaration", "specifiers", "source").field("declaration", or(def("Declaration"), null)).field("specifiers", [def("ExportSpecifier")],
|
|
108748
|
+
def("ExportNamedDeclaration").bases("Declaration").build("declaration", "specifiers", "source").field("declaration", or(def("Declaration"), null)).field("specifiers", [def("ExportSpecifier")], defaults4.emptyArray).field("source", or(def("Literal"), null), defaults4["null"]);
|
|
107585
108749
|
def("ExportSpecifier").bases("ModuleSpecifier").build("local", "exported").field("exported", def("Identifier"));
|
|
107586
108750
|
def("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration", or(def("Declaration"), def("Expression")));
|
|
107587
108751
|
def("ExportAllDeclaration").bases("Declaration").build("source").field("source", def("Literal"));
|
|
@@ -107600,8 +108764,8 @@ function es2017Def(fork2) {
|
|
|
107600
108764
|
fork2.use(es2016Def);
|
|
107601
108765
|
const types = fork2.use(typesPlugin);
|
|
107602
108766
|
const def = types.Type.def;
|
|
107603
|
-
const
|
|
107604
|
-
def("Function").field("async", Boolean,
|
|
108767
|
+
const defaults4 = fork2.use(sharedPlugin).defaults;
|
|
108768
|
+
def("Function").field("async", Boolean, defaults4["false"]);
|
|
107605
108769
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
107606
108770
|
}
|
|
107607
108771
|
maybeSetModuleExports(() => module);
|
|
@@ -107610,8 +108774,8 @@ function es2018Def(fork2) {
|
|
|
107610
108774
|
const types = fork2.use(typesPlugin);
|
|
107611
108775
|
const def = types.Type.def;
|
|
107612
108776
|
const or = types.Type.or;
|
|
107613
|
-
const
|
|
107614
|
-
def("ForOfStatement").field("await", Boolean,
|
|
108777
|
+
const defaults4 = fork2.use(sharedPlugin).defaults;
|
|
108778
|
+
def("ForOfStatement").field("await", Boolean, defaults4["false"]);
|
|
107615
108779
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
107616
108780
|
def("ObjectExpression").field("properties", [or(
|
|
107617
108781
|
def("Property"),
|
|
@@ -107629,8 +108793,8 @@ function es2019Def(fork2) {
|
|
|
107629
108793
|
const types = fork2.use(typesPlugin);
|
|
107630
108794
|
const def = types.Type.def;
|
|
107631
108795
|
const or = types.Type.or;
|
|
107632
|
-
const
|
|
107633
|
-
def("CatchClause").field("param", or(def("Pattern"), null),
|
|
108796
|
+
const defaults4 = fork2.use(sharedPlugin).defaults;
|
|
108797
|
+
def("CatchClause").field("param", or(def("Pattern"), null), defaults4["null"]);
|
|
107634
108798
|
}
|
|
107635
108799
|
maybeSetModuleExports(() => module);
|
|
107636
108800
|
function es2020Def(fork2) {
|
|
@@ -107640,19 +108804,19 @@ function es2020Def(fork2) {
|
|
|
107640
108804
|
const def = types.Type.def;
|
|
107641
108805
|
const or = types.Type.or;
|
|
107642
108806
|
const shared = fork2.use(sharedPlugin);
|
|
107643
|
-
const
|
|
108807
|
+
const defaults4 = shared.defaults;
|
|
107644
108808
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
107645
108809
|
def("ExportAllDeclaration").bases("Declaration").build("source", "exported").field("source", def("Literal")).field("exported", or(
|
|
107646
108810
|
def("Identifier"),
|
|
107647
108811
|
null,
|
|
107648
108812
|
void 0
|
|
107649
|
-
),
|
|
107650
|
-
def("ChainElement").bases("Node").field("optional", Boolean,
|
|
108813
|
+
), defaults4["null"]);
|
|
108814
|
+
def("ChainElement").bases("Node").field("optional", Boolean, defaults4["false"]);
|
|
107651
108815
|
def("CallExpression").bases("Expression", "ChainElement");
|
|
107652
108816
|
def("MemberExpression").bases("Expression", "ChainElement");
|
|
107653
108817
|
def("ChainExpression").bases("Expression").build("expression").field("expression", def("ChainElement"));
|
|
107654
|
-
def("OptionalCallExpression").bases("CallExpression").build("callee", "arguments", "optional").field("optional", Boolean,
|
|
107655
|
-
def("OptionalMemberExpression").bases("MemberExpression").build("object", "property", "computed", "optional").field("optional", Boolean,
|
|
108818
|
+
def("OptionalCallExpression").bases("CallExpression").build("callee", "arguments", "optional").field("optional", Boolean, defaults4["true"]);
|
|
108819
|
+
def("OptionalMemberExpression").bases("MemberExpression").build("object", "property", "computed", "optional").field("optional", Boolean, defaults4["true"]);
|
|
107656
108820
|
}
|
|
107657
108821
|
maybeSetModuleExports(() => module);
|
|
107658
108822
|
function es2021Def(fork2) {
|
|
@@ -107674,21 +108838,21 @@ function esProposalsDef(fork2) {
|
|
|
107674
108838
|
const def = types.Type.def;
|
|
107675
108839
|
const or = Type5.or;
|
|
107676
108840
|
const shared = fork2.use(sharedPlugin);
|
|
107677
|
-
const
|
|
107678
|
-
def("AwaitExpression").build("argument", "all").field("argument", or(def("Expression"), null)).field("all", Boolean,
|
|
108841
|
+
const defaults4 = shared.defaults;
|
|
108842
|
+
def("AwaitExpression").build("argument", "all").field("argument", or(def("Expression"), null)).field("all", Boolean, defaults4["false"]);
|
|
107679
108843
|
def("Decorator").bases("Node").build("expression").field("expression", def("Expression"));
|
|
107680
108844
|
def("Property").field(
|
|
107681
108845
|
"decorators",
|
|
107682
108846
|
or([def("Decorator")], null),
|
|
107683
|
-
|
|
108847
|
+
defaults4["null"]
|
|
107684
108848
|
);
|
|
107685
108849
|
def("MethodDefinition").field(
|
|
107686
108850
|
"decorators",
|
|
107687
108851
|
or([def("Decorator")], null),
|
|
107688
|
-
|
|
108852
|
+
defaults4["null"]
|
|
107689
108853
|
);
|
|
107690
108854
|
def("PrivateName").bases("Expression", "Pattern").build("id").field("id", def("Identifier"));
|
|
107691
|
-
def("ClassPrivateProperty").bases("ClassProperty").build("key", "value").field("key", def("PrivateName")).field("value", or(def("Expression"), null),
|
|
108855
|
+
def("ClassPrivateProperty").bases("ClassProperty").build("key", "value").field("key", def("PrivateName")).field("value", or(def("Expression"), null), defaults4["null"]);
|
|
107692
108856
|
def("ImportAttribute").bases("Node").build("key", "value").field("key", or(def("Identifier"), def("Literal"))).field("value", def("Expression"));
|
|
107693
108857
|
[
|
|
107694
108858
|
"ImportDeclaration",
|
|
@@ -107698,7 +108862,7 @@ function esProposalsDef(fork2) {
|
|
|
107698
108862
|
def(decl).field(
|
|
107699
108863
|
"assertions",
|
|
107700
108864
|
[def("ImportAttribute")],
|
|
107701
|
-
|
|
108865
|
+
defaults4.emptyArray
|
|
107702
108866
|
);
|
|
107703
108867
|
});
|
|
107704
108868
|
def("RecordExpression").bases("Expression").build("properties").field("properties", [or(
|
|
@@ -107719,7 +108883,7 @@ function jsxDef(fork2) {
|
|
|
107719
108883
|
const types = fork2.use(typesPlugin);
|
|
107720
108884
|
const def = types.Type.def;
|
|
107721
108885
|
const or = types.Type.or;
|
|
107722
|
-
const
|
|
108886
|
+
const defaults4 = fork2.use(sharedPlugin).defaults;
|
|
107723
108887
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
107724
108888
|
def("Literal"),
|
|
107725
108889
|
// attr="value"
|
|
@@ -107731,10 +108895,10 @@ function jsxDef(fork2) {
|
|
|
107731
108895
|
// attr=<></>
|
|
107732
108896
|
null
|
|
107733
108897
|
// attr= or just attr
|
|
107734
|
-
),
|
|
108898
|
+
), defaults4["null"]);
|
|
107735
108899
|
def("JSXIdentifier").bases("Identifier").build("name").field("name", String);
|
|
107736
108900
|
def("JSXNamespacedName").bases("Node").build("namespace", "name").field("namespace", def("JSXIdentifier")).field("name", def("JSXIdentifier"));
|
|
107737
|
-
def("JSXMemberExpression").bases("MemberExpression").build("object", "property").field("object", or(def("JSXIdentifier"), def("JSXMemberExpression"))).field("property", def("JSXIdentifier")).field("computed", Boolean,
|
|
108901
|
+
def("JSXMemberExpression").bases("MemberExpression").build("object", "property").field("object", or(def("JSXIdentifier"), def("JSXMemberExpression"))).field("property", def("JSXIdentifier")).field("computed", Boolean, defaults4.false);
|
|
107738
108902
|
const JSXElementName = or(
|
|
107739
108903
|
def("JSXIdentifier"),
|
|
107740
108904
|
def("JSXNamespacedName"),
|
|
@@ -107755,16 +108919,16 @@ function jsxDef(fork2) {
|
|
|
107755
108919
|
def("Literal")
|
|
107756
108920
|
// Legacy: Esprima should return JSXText instead.
|
|
107757
108921
|
)];
|
|
107758
|
-
def("JSXElement").bases("Expression").build("openingElement", "closingElement", "children").field("openingElement", def("JSXOpeningElement")).field("closingElement", or(def("JSXClosingElement"), null),
|
|
108922
|
+
def("JSXElement").bases("Expression").build("openingElement", "closingElement", "children").field("openingElement", def("JSXOpeningElement")).field("closingElement", or(def("JSXClosingElement"), null), defaults4["null"]).field("children", JSXChildren, defaults4.emptyArray).field("name", JSXElementName, function() {
|
|
107759
108923
|
return this.openingElement.name;
|
|
107760
108924
|
}, true).field("selfClosing", Boolean, function() {
|
|
107761
108925
|
return this.openingElement.selfClosing;
|
|
107762
108926
|
}, true).field("attributes", JSXAttributes, function() {
|
|
107763
108927
|
return this.openingElement.attributes;
|
|
107764
108928
|
}, true);
|
|
107765
|
-
def("JSXOpeningElement").bases("Node").build("name", "attributes", "selfClosing").field("name", JSXElementName).field("attributes", JSXAttributes,
|
|
108929
|
+
def("JSXOpeningElement").bases("Node").build("name", "attributes", "selfClosing").field("name", JSXElementName).field("attributes", JSXAttributes, defaults4.emptyArray).field("selfClosing", Boolean, defaults4["false"]);
|
|
107766
108930
|
def("JSXClosingElement").bases("Node").build("name").field("name", JSXElementName);
|
|
107767
|
-
def("JSXFragment").bases("Expression").build("openingFragment", "closingFragment", "children").field("openingFragment", def("JSXOpeningFragment")).field("closingFragment", def("JSXClosingFragment")).field("children", JSXChildren,
|
|
108931
|
+
def("JSXFragment").bases("Expression").build("openingFragment", "closingFragment", "children").field("openingFragment", def("JSXOpeningFragment")).field("closingFragment", def("JSXClosingFragment")).field("children", JSXChildren, defaults4.emptyArray);
|
|
107768
108932
|
def("JSXOpeningFragment").bases("Node").build();
|
|
107769
108933
|
def("JSXClosingFragment").bases("Node").build();
|
|
107770
108934
|
def("JSXText").bases("Literal").build("value", "raw").field("value", String).field("raw", String, function() {
|
|
@@ -107778,7 +108942,7 @@ function typeAnnotationsDef(fork2) {
|
|
|
107778
108942
|
var types = fork2.use(typesPlugin);
|
|
107779
108943
|
var def = types.Type.def;
|
|
107780
108944
|
var or = types.Type.or;
|
|
107781
|
-
var
|
|
108945
|
+
var defaults4 = fork2.use(sharedPlugin).defaults;
|
|
107782
108946
|
var TypeAnnotation = or(
|
|
107783
108947
|
def("TypeAnnotation"),
|
|
107784
108948
|
def("TSTypeAnnotation"),
|
|
@@ -107789,29 +108953,29 @@ function typeAnnotationsDef(fork2) {
|
|
|
107789
108953
|
def("TSTypeParameterDeclaration"),
|
|
107790
108954
|
null
|
|
107791
108955
|
);
|
|
107792
|
-
def("Identifier").field("typeAnnotation", TypeAnnotation,
|
|
107793
|
-
def("ObjectPattern").field("typeAnnotation", TypeAnnotation,
|
|
107794
|
-
def("Function").field("returnType", TypeAnnotation,
|
|
107795
|
-
def("ClassProperty").build("key", "value", "typeAnnotation", "static").field("value", or(def("Expression"), null)).field("static", Boolean,
|
|
108956
|
+
def("Identifier").field("typeAnnotation", TypeAnnotation, defaults4["null"]);
|
|
108957
|
+
def("ObjectPattern").field("typeAnnotation", TypeAnnotation, defaults4["null"]);
|
|
108958
|
+
def("Function").field("returnType", TypeAnnotation, defaults4["null"]).field("typeParameters", TypeParamDecl, defaults4["null"]);
|
|
108959
|
+
def("ClassProperty").build("key", "value", "typeAnnotation", "static").field("value", or(def("Expression"), null)).field("static", Boolean, defaults4["false"]).field("typeAnnotation", TypeAnnotation, defaults4["null"]);
|
|
107796
108960
|
[
|
|
107797
108961
|
"ClassDeclaration",
|
|
107798
108962
|
"ClassExpression"
|
|
107799
108963
|
].forEach((typeName) => {
|
|
107800
|
-
def(typeName).field("typeParameters", TypeParamDecl,
|
|
108964
|
+
def(typeName).field("typeParameters", TypeParamDecl, defaults4["null"]).field(
|
|
107801
108965
|
"superTypeParameters",
|
|
107802
108966
|
or(
|
|
107803
108967
|
def("TypeParameterInstantiation"),
|
|
107804
108968
|
def("TSTypeParameterInstantiation"),
|
|
107805
108969
|
null
|
|
107806
108970
|
),
|
|
107807
|
-
|
|
108971
|
+
defaults4["null"]
|
|
107808
108972
|
).field(
|
|
107809
108973
|
"implements",
|
|
107810
108974
|
or(
|
|
107811
108975
|
[def("ClassImplements")],
|
|
107812
108976
|
[def("TSExpressionWithTypeArguments")]
|
|
107813
108977
|
),
|
|
107814
|
-
|
|
108978
|
+
defaults4.emptyArray
|
|
107815
108979
|
);
|
|
107816
108980
|
});
|
|
107817
108981
|
}
|
|
@@ -107822,7 +108986,7 @@ function flowDef(fork2) {
|
|
|
107822
108986
|
const types = fork2.use(typesPlugin);
|
|
107823
108987
|
const def = types.Type.def;
|
|
107824
108988
|
const or = types.Type.or;
|
|
107825
|
-
const
|
|
108989
|
+
const defaults4 = fork2.use(sharedPlugin).defaults;
|
|
107826
108990
|
def("Flow").bases("Node");
|
|
107827
108991
|
def("FlowType").bases("Flow");
|
|
107828
108992
|
def("AnyTypeAnnotation").bases("FlowType").build();
|
|
@@ -107854,11 +109018,11 @@ function flowDef(fork2) {
|
|
|
107854
109018
|
def("ObjectTypeProperty"),
|
|
107855
109019
|
def("ObjectTypeSpreadProperty")
|
|
107856
109020
|
)
|
|
107857
|
-
]).field("indexers", [def("ObjectTypeIndexer")],
|
|
109021
|
+
]).field("indexers", [def("ObjectTypeIndexer")], defaults4.emptyArray).field(
|
|
107858
109022
|
"callProperties",
|
|
107859
109023
|
[def("ObjectTypeCallProperty")],
|
|
107860
|
-
|
|
107861
|
-
).field("inexact", or(Boolean, void 0),
|
|
109024
|
+
defaults4.emptyArray
|
|
109025
|
+
).field("inexact", or(Boolean, void 0), defaults4["undefined"]).field("exact", Boolean, defaults4["false"]).field("internalSlots", [def("ObjectTypeInternalSlot")], defaults4.emptyArray);
|
|
107862
109026
|
def("Variance").bases("Node").build("kind").field("kind", or("plus", "minus"));
|
|
107863
109027
|
const LegacyVariance = or(
|
|
107864
109028
|
def("Variance"),
|
|
@@ -107866,9 +109030,9 @@ function flowDef(fork2) {
|
|
|
107866
109030
|
"minus",
|
|
107867
109031
|
null
|
|
107868
109032
|
);
|
|
107869
|
-
def("ObjectTypeProperty").bases("Node").build("key", "value", "optional").field("key", or(def("Literal"), def("Identifier"))).field("value", def("FlowType")).field("optional", Boolean).field("variance", LegacyVariance,
|
|
107870
|
-
def("ObjectTypeIndexer").bases("Node").build("id", "key", "value").field("id", def("Identifier")).field("key", def("FlowType")).field("value", def("FlowType")).field("variance", LegacyVariance,
|
|
107871
|
-
def("ObjectTypeCallProperty").bases("Node").build("value").field("value", def("FunctionTypeAnnotation")).field("static", Boolean,
|
|
109033
|
+
def("ObjectTypeProperty").bases("Node").build("key", "value", "optional").field("key", or(def("Literal"), def("Identifier"))).field("value", def("FlowType")).field("optional", Boolean).field("variance", LegacyVariance, defaults4["null"]);
|
|
109034
|
+
def("ObjectTypeIndexer").bases("Node").build("id", "key", "value").field("id", def("Identifier")).field("key", def("FlowType")).field("value", def("FlowType")).field("variance", LegacyVariance, defaults4["null"]).field("static", Boolean, defaults4["false"]);
|
|
109035
|
+
def("ObjectTypeCallProperty").bases("Node").build("value").field("value", def("FunctionTypeAnnotation")).field("static", Boolean, defaults4["false"]);
|
|
107872
109036
|
def("QualifiedTypeIdentifier").bases("Node").build("qualification", "id").field(
|
|
107873
109037
|
"qualification",
|
|
107874
109038
|
or(
|
|
@@ -107893,24 +109057,24 @@ function flowDef(fork2) {
|
|
|
107893
109057
|
def("ObjectTypeInternalSlot").bases("Node").build("id", "value", "optional", "static", "method").field("id", def("Identifier")).field("value", def("FlowType")).field("optional", Boolean).field("static", Boolean).field("method", Boolean);
|
|
107894
109058
|
def("TypeParameterDeclaration").bases("Node").build("params").field("params", [def("TypeParameter")]);
|
|
107895
109059
|
def("TypeParameterInstantiation").bases("Node").build("params").field("params", [def("FlowType")]);
|
|
107896
|
-
def("TypeParameter").bases("FlowType").build("name", "variance", "bound", "default").field("name", String).field("variance", LegacyVariance,
|
|
107897
|
-
def("ClassProperty").field("variance", LegacyVariance,
|
|
107898
|
-
def("ClassImplements").bases("Node").build("id").field("id", def("Identifier")).field("superClass", or(def("Expression"), null),
|
|
109060
|
+
def("TypeParameter").bases("FlowType").build("name", "variance", "bound", "default").field("name", String).field("variance", LegacyVariance, defaults4["null"]).field("bound", or(def("TypeAnnotation"), null), defaults4["null"]).field("default", or(def("FlowType"), null), defaults4["null"]);
|
|
109061
|
+
def("ClassProperty").field("variance", LegacyVariance, defaults4["null"]);
|
|
109062
|
+
def("ClassImplements").bases("Node").build("id").field("id", def("Identifier")).field("superClass", or(def("Expression"), null), defaults4["null"]).field(
|
|
107899
109063
|
"typeParameters",
|
|
107900
109064
|
or(def("TypeParameterInstantiation"), null),
|
|
107901
|
-
|
|
109065
|
+
defaults4["null"]
|
|
107902
109066
|
);
|
|
107903
|
-
def("InterfaceTypeAnnotation").bases("FlowType").build("body", "extends").field("body", def("ObjectTypeAnnotation")).field("extends", or([def("InterfaceExtends")], null),
|
|
109067
|
+
def("InterfaceTypeAnnotation").bases("FlowType").build("body", "extends").field("body", def("ObjectTypeAnnotation")).field("extends", or([def("InterfaceExtends")], null), defaults4["null"]);
|
|
107904
109068
|
def("InterfaceDeclaration").bases("Declaration").build("id", "body", "extends").field("id", def("Identifier")).field(
|
|
107905
109069
|
"typeParameters",
|
|
107906
109070
|
or(def("TypeParameterDeclaration"), null),
|
|
107907
|
-
|
|
109071
|
+
defaults4["null"]
|
|
107908
109072
|
).field("body", def("ObjectTypeAnnotation")).field("extends", [def("InterfaceExtends")]);
|
|
107909
109073
|
def("DeclareInterface").bases("InterfaceDeclaration").build("id", "body", "extends");
|
|
107910
109074
|
def("InterfaceExtends").bases("Node").build("id").field("id", def("Identifier")).field(
|
|
107911
109075
|
"typeParameters",
|
|
107912
109076
|
or(def("TypeParameterInstantiation"), null),
|
|
107913
|
-
|
|
109077
|
+
defaults4["null"]
|
|
107914
109078
|
);
|
|
107915
109079
|
def("TypeAlias").bases("Declaration").build("id", "typeParameters", "right").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null)).field("right", def("FlowType"));
|
|
107916
109080
|
def("DeclareTypeAlias").bases("TypeAlias").build("id", "typeParameters", "right");
|
|
@@ -107919,7 +109083,7 @@ function flowDef(fork2) {
|
|
|
107919
109083
|
def("TypeCastExpression").bases("Expression").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TypeAnnotation"));
|
|
107920
109084
|
def("TupleTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]);
|
|
107921
109085
|
def("DeclareVariable").bases("Statement").build("id").field("id", def("Identifier"));
|
|
107922
|
-
def("DeclareFunction").bases("Statement").build("id").field("id", def("Identifier")).field("predicate", or(def("FlowPredicate"), null),
|
|
109086
|
+
def("DeclareFunction").bases("Statement").build("id").field("id", def("Identifier")).field("predicate", or(def("FlowPredicate"), null), defaults4["null"]);
|
|
107923
109087
|
def("DeclareClass").bases("InterfaceDeclaration").build("id");
|
|
107924
109088
|
def("DeclareModule").bases("Statement").build("id", "body").field("id", or(def("Identifier"), def("Literal"))).field("body", def("BlockStatement"));
|
|
107925
109089
|
def("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation", def("TypeAnnotation"));
|
|
@@ -107938,27 +109102,27 @@ function flowDef(fork2) {
|
|
|
107938
109102
|
)).field("specifiers", [or(
|
|
107939
109103
|
def("ExportSpecifier"),
|
|
107940
109104
|
def("ExportBatchSpecifier")
|
|
107941
|
-
)],
|
|
109105
|
+
)], defaults4.emptyArray).field("source", or(
|
|
107942
109106
|
def("Literal"),
|
|
107943
109107
|
null
|
|
107944
|
-
),
|
|
109108
|
+
), defaults4["null"]);
|
|
107945
109109
|
def("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source", or(
|
|
107946
109110
|
def("Literal"),
|
|
107947
109111
|
null
|
|
107948
|
-
),
|
|
109112
|
+
), defaults4["null"]);
|
|
107949
109113
|
def("ImportDeclaration").field("importKind", or("value", "type", "typeof"), () => "value");
|
|
107950
109114
|
def("FlowPredicate").bases("Flow");
|
|
107951
109115
|
def("InferredPredicate").bases("FlowPredicate").build();
|
|
107952
109116
|
def("DeclaredPredicate").bases("FlowPredicate").build("value").field("value", def("Expression"));
|
|
107953
|
-
def("Function").field("predicate", or(def("FlowPredicate"), null),
|
|
109117
|
+
def("Function").field("predicate", or(def("FlowPredicate"), null), defaults4["null"]);
|
|
107954
109118
|
def("CallExpression").field("typeArguments", or(
|
|
107955
109119
|
null,
|
|
107956
109120
|
def("TypeParameterInstantiation")
|
|
107957
|
-
),
|
|
109121
|
+
), defaults4["null"]);
|
|
107958
109122
|
def("NewExpression").field("typeArguments", or(
|
|
107959
109123
|
null,
|
|
107960
109124
|
def("TypeParameterInstantiation")
|
|
107961
|
-
),
|
|
109125
|
+
), defaults4["null"]);
|
|
107962
109126
|
def("EnumDeclaration").bases("Declaration").build("id", "body").field("id", def("Identifier")).field("body", or(
|
|
107963
109127
|
def("EnumBooleanBody"),
|
|
107964
109128
|
def("EnumNumberBody"),
|
|
@@ -107978,7 +109142,7 @@ maybeSetModuleExports(() => module);
|
|
|
107978
109142
|
function esprimaDef(fork2) {
|
|
107979
109143
|
fork2.use(esProposalsDef);
|
|
107980
109144
|
var types = fork2.use(typesPlugin);
|
|
107981
|
-
var
|
|
109145
|
+
var defaults4 = fork2.use(sharedPlugin).defaults;
|
|
107982
109146
|
var def = types.Type.def;
|
|
107983
109147
|
var or = types.Type.or;
|
|
107984
109148
|
def("VariableDeclaration").field("declarations", [or(
|
|
@@ -108013,10 +109177,10 @@ function esprimaDef(fork2) {
|
|
|
108013
109177
|
)).field("specifiers", [or(
|
|
108014
109178
|
def("ExportSpecifier"),
|
|
108015
109179
|
def("ExportBatchSpecifier")
|
|
108016
|
-
)],
|
|
109180
|
+
)], defaults4.emptyArray).field("source", or(
|
|
108017
109181
|
def("Literal"),
|
|
108018
109182
|
null
|
|
108019
|
-
),
|
|
109183
|
+
), defaults4["null"]);
|
|
108020
109184
|
def("Block").bases("Comment").build(
|
|
108021
109185
|
"value",
|
|
108022
109186
|
/*optional:*/
|
|
@@ -108034,7 +109198,7 @@ maybeSetModuleExports(() => module);
|
|
|
108034
109198
|
function babelCoreDef(fork2) {
|
|
108035
109199
|
fork2.use(esProposalsDef);
|
|
108036
109200
|
const types = fork2.use(typesPlugin);
|
|
108037
|
-
const
|
|
109201
|
+
const defaults4 = fork2.use(sharedPlugin).defaults;
|
|
108038
109202
|
const def = types.Type.def;
|
|
108039
109203
|
const or = types.Type.or;
|
|
108040
109204
|
const {
|
|
@@ -108059,10 +109223,10 @@ function babelCoreDef(fork2) {
|
|
|
108059
109223
|
"trailing"
|
|
108060
109224
|
);
|
|
108061
109225
|
def("Directive").bases("Node").build("value").field("value", def("DirectiveLiteral"));
|
|
108062
|
-
def("DirectiveLiteral").bases("Node", "Expression").build("value").field("value", String,
|
|
109226
|
+
def("DirectiveLiteral").bases("Node", "Expression").build("value").field("value", String, defaults4["use strict"]);
|
|
108063
109227
|
def("InterpreterDirective").bases("Node").build("value").field("value", String);
|
|
108064
|
-
def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")],
|
|
108065
|
-
def("Program").bases("Node").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")],
|
|
109228
|
+
def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults4.emptyArray);
|
|
109229
|
+
def("Program").bases("Node").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults4.emptyArray).field("interpreter", or(def("InterpreterDirective"), null), defaults4["null"]);
|
|
108066
109230
|
function makeLiteralExtra(rawValueType = String, toRaw) {
|
|
108067
109231
|
return [
|
|
108068
109232
|
"extra",
|
|
@@ -108080,10 +109244,10 @@ function babelCoreDef(fork2) {
|
|
|
108080
109244
|
];
|
|
108081
109245
|
}
|
|
108082
109246
|
def("StringLiteral").bases("Literal").build("value").field("value", String).field(...makeLiteralExtra(String, (val) => JSON.stringify(val)));
|
|
108083
|
-
def("NumericLiteral").bases("Literal").build("value").field("value", Number).field("raw", or(String, null),
|
|
109247
|
+
def("NumericLiteral").bases("Literal").build("value").field("value", Number).field("raw", or(String, null), defaults4["null"]).field(...makeLiteralExtra(Number));
|
|
108084
109248
|
def("BigIntLiteral").bases("Literal").build("value").field("value", or(String, Number)).field(...makeLiteralExtra(String, (val) => val + "n"));
|
|
108085
109249
|
def("DecimalLiteral").bases("Literal").build("value").field("value", String).field(...makeLiteralExtra(String, (val) => val + "m"));
|
|
108086
|
-
def("NullLiteral").bases("Literal").build().field("value", null,
|
|
109250
|
+
def("NullLiteral").bases("Literal").build().field("value", null, defaults4["null"]);
|
|
108087
109251
|
def("BooleanLiteral").bases("Literal").build("value").field("value", Boolean);
|
|
108088
109252
|
def("RegExpLiteral").bases("Literal").build("pattern", "flags").field("pattern", String).field("flags", String).field("value", RegExp, function() {
|
|
108089
109253
|
return new RegExp(this.pattern, this.flags);
|
|
@@ -108107,22 +109271,22 @@ function babelCoreDef(fork2) {
|
|
|
108107
109271
|
def("SpreadElement")
|
|
108108
109272
|
);
|
|
108109
109273
|
def("ObjectExpression").bases("Expression").build("properties").field("properties", [ObjectExpressionProperty]);
|
|
108110
|
-
def("ObjectMethod").bases("Node", "Function").build("kind", "key", "params", "body", "computed").field("kind", or("method", "get", "set")).field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("computed", Boolean,
|
|
109274
|
+
def("ObjectMethod").bases("Node", "Function").build("kind", "key", "params", "body", "computed").field("kind", or("method", "get", "set")).field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("computed", Boolean, defaults4["false"]).field("generator", Boolean, defaults4["false"]).field("async", Boolean, defaults4["false"]).field(
|
|
108111
109275
|
"accessibility",
|
|
108112
109276
|
// TypeScript
|
|
108113
109277
|
or(def("Literal"), null),
|
|
108114
|
-
|
|
109278
|
+
defaults4["null"]
|
|
108115
109279
|
).field(
|
|
108116
109280
|
"decorators",
|
|
108117
109281
|
or([def("Decorator")], null),
|
|
108118
|
-
|
|
109282
|
+
defaults4["null"]
|
|
108119
109283
|
);
|
|
108120
109284
|
def("ObjectProperty").bases("Node").build("key", "value").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("value", or(def("Expression"), def("Pattern"))).field(
|
|
108121
109285
|
"accessibility",
|
|
108122
109286
|
// TypeScript
|
|
108123
109287
|
or(def("Literal"), null),
|
|
108124
|
-
|
|
108125
|
-
).field("computed", Boolean,
|
|
109288
|
+
defaults4["null"]
|
|
109289
|
+
).field("computed", Boolean, defaults4["false"]);
|
|
108126
109290
|
var ClassBodyElement = or(
|
|
108127
109291
|
def("MethodDefinition"),
|
|
108128
109292
|
def("VariableDeclarator"),
|
|
@@ -108143,19 +109307,19 @@ function babelCoreDef(fork2) {
|
|
|
108143
109307
|
def("PrivateName"),
|
|
108144
109308
|
// Only when .computed is true (TODO enforce this)
|
|
108145
109309
|
def("Expression")
|
|
108146
|
-
)).field("value", or(def("Expression"), null),
|
|
109310
|
+
)).field("value", or(def("Expression"), null), defaults4["null"]);
|
|
108147
109311
|
[
|
|
108148
109312
|
"ClassMethod",
|
|
108149
109313
|
"ClassPrivateMethod"
|
|
108150
109314
|
].forEach((typeName) => {
|
|
108151
|
-
def(typeName).field("kind", or("get", "set", "method", "constructor"), () => "method").field("body", def("BlockStatement")).field("access", or("public", "private", "protected", null),
|
|
109315
|
+
def(typeName).field("kind", or("get", "set", "method", "constructor"), () => "method").field("body", def("BlockStatement")).field("access", or("public", "private", "protected", null), defaults4["null"]);
|
|
108152
109316
|
});
|
|
108153
109317
|
[
|
|
108154
109318
|
"ClassMethod",
|
|
108155
109319
|
"ClassPrivateMethod",
|
|
108156
109320
|
"ClassAccessorProperty"
|
|
108157
109321
|
].forEach((typeName) => {
|
|
108158
|
-
def(typeName).field("computed", Boolean,
|
|
109322
|
+
def(typeName).field("computed", Boolean, defaults4["false"]).field("static", Boolean, defaults4["false"]).field("abstract", Boolean, defaults4["false"]).field("accessibility", or("public", "private", "protected", null), defaults4["null"]).field("decorators", or([def("Decorator")], null), defaults4["null"]).field("definite", Boolean, defaults4["false"]).field("optional", Boolean, defaults4["false"]).field("override", Boolean, defaults4["false"]).field("readonly", Boolean, defaults4["false"]);
|
|
108159
109323
|
});
|
|
108160
109324
|
var ObjectPatternProperty = or(
|
|
108161
109325
|
def("Property"),
|
|
@@ -108173,7 +109337,7 @@ function babelCoreDef(fork2) {
|
|
|
108173
109337
|
def("ObjectPattern").bases("Pattern").build("properties").field("properties", [ObjectPatternProperty]).field(
|
|
108174
109338
|
"decorators",
|
|
108175
109339
|
or([def("Decorator")], null),
|
|
108176
|
-
|
|
109340
|
+
defaults4["null"]
|
|
108177
109341
|
);
|
|
108178
109342
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
108179
109343
|
def("RestProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -108200,7 +109364,7 @@ function typescriptDef(fork2) {
|
|
|
108200
109364
|
var n3 = types.namedTypes;
|
|
108201
109365
|
var def = types.Type.def;
|
|
108202
109366
|
var or = types.Type.or;
|
|
108203
|
-
var
|
|
109367
|
+
var defaults4 = fork2.use(sharedPlugin).defaults;
|
|
108204
109368
|
var StringLiteral = types.Type.from(function(value2, deep) {
|
|
108205
109369
|
if (n3.StringLiteral && n3.StringLiteral.check(value2, deep)) {
|
|
108206
109370
|
return true;
|
|
@@ -108219,23 +109383,23 @@ function typescriptDef(fork2) {
|
|
|
108219
109383
|
def("TSHasOptionalTypeParameterInstantiation").field(
|
|
108220
109384
|
"typeParameters",
|
|
108221
109385
|
or(def("TSTypeParameterInstantiation"), null),
|
|
108222
|
-
|
|
109386
|
+
defaults4["null"]
|
|
108223
109387
|
);
|
|
108224
109388
|
def("TSHasOptionalTypeParameters").field(
|
|
108225
109389
|
"typeParameters",
|
|
108226
109390
|
or(def("TSTypeParameterDeclaration"), null, void 0),
|
|
108227
|
-
|
|
109391
|
+
defaults4["null"]
|
|
108228
109392
|
);
|
|
108229
109393
|
def("TSHasOptionalTypeAnnotation").field(
|
|
108230
109394
|
"typeAnnotation",
|
|
108231
109395
|
or(def("TSTypeAnnotation"), null),
|
|
108232
|
-
|
|
109396
|
+
defaults4["null"]
|
|
108233
109397
|
);
|
|
108234
109398
|
def("TSQualifiedName").bases("Node").build("left", "right").field("left", TSEntityName).field("right", TSEntityName);
|
|
108235
109399
|
def("TSAsExpression").bases("Expression", "Pattern").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType")).field(
|
|
108236
109400
|
"extra",
|
|
108237
109401
|
or({ parenthesized: Boolean }, null),
|
|
108238
|
-
|
|
109402
|
+
defaults4["null"]
|
|
108239
109403
|
);
|
|
108240
109404
|
def("TSTypeCastExpression").bases("Expression").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType"));
|
|
108241
109405
|
def("TSSatisfiesExpression").bases("Expression", "Pattern").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType"));
|
|
@@ -108297,7 +109461,7 @@ function typescriptDef(fork2) {
|
|
|
108297
109461
|
"TSHasOptionalTypeAnnotation"
|
|
108298
109462
|
).build("parameters").field("parameters", ParametersType);
|
|
108299
109463
|
});
|
|
108300
|
-
def("TSDeclareFunction").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "params", "returnType").field("declare", Boolean,
|
|
109464
|
+
def("TSDeclareFunction").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "params", "returnType").field("declare", Boolean, defaults4["false"]).field("async", Boolean, defaults4["false"]).field("generator", Boolean, defaults4["false"]).field("id", or(def("Identifier"), null), defaults4["null"]).field("params", [def("Pattern")]).field(
|
|
108301
109465
|
"returnType",
|
|
108302
109466
|
or(
|
|
108303
109467
|
def("TSTypeAnnotation"),
|
|
@@ -108305,13 +109469,13 @@ function typescriptDef(fork2) {
|
|
|
108305
109469
|
// Still used?
|
|
108306
109470
|
null
|
|
108307
109471
|
),
|
|
108308
|
-
|
|
109472
|
+
defaults4["null"]
|
|
108309
109473
|
);
|
|
108310
|
-
def("TSDeclareMethod").bases("Declaration", "TSHasOptionalTypeParameters").build("key", "params", "returnType").field("async", Boolean,
|
|
109474
|
+
def("TSDeclareMethod").bases("Declaration", "TSHasOptionalTypeParameters").build("key", "params", "returnType").field("async", Boolean, defaults4["false"]).field("generator", Boolean, defaults4["false"]).field("params", [def("Pattern")]).field("abstract", Boolean, defaults4["false"]).field(
|
|
108311
109475
|
"accessibility",
|
|
108312
109476
|
or("public", "private", "protected", void 0),
|
|
108313
|
-
|
|
108314
|
-
).field("static", Boolean,
|
|
109477
|
+
defaults4["undefined"]
|
|
109478
|
+
).field("static", Boolean, defaults4["false"]).field("computed", Boolean, defaults4["false"]).field("optional", Boolean, defaults4["false"]).field("key", or(
|
|
108315
109479
|
def("Identifier"),
|
|
108316
109480
|
def("StringLiteral"),
|
|
108317
109481
|
def("NumericLiteral"),
|
|
@@ -108327,11 +109491,11 @@ function typescriptDef(fork2) {
|
|
|
108327
109491
|
"access",
|
|
108328
109492
|
// Not "accessibility"?
|
|
108329
109493
|
or("public", "private", "protected", void 0),
|
|
108330
|
-
|
|
109494
|
+
defaults4["undefined"]
|
|
108331
109495
|
).field(
|
|
108332
109496
|
"decorators",
|
|
108333
109497
|
or([def("Decorator")], null),
|
|
108334
|
-
|
|
109498
|
+
defaults4["null"]
|
|
108335
109499
|
).field(
|
|
108336
109500
|
"returnType",
|
|
108337
109501
|
or(
|
|
@@ -108340,18 +109504,18 @@ function typescriptDef(fork2) {
|
|
|
108340
109504
|
// Still used?
|
|
108341
109505
|
null
|
|
108342
109506
|
),
|
|
108343
|
-
|
|
109507
|
+
defaults4["null"]
|
|
108344
109508
|
);
|
|
108345
|
-
def("TSMappedType").bases("TSType").build("typeParameter", "typeAnnotation").field("readonly", or(Boolean, "+", "-"),
|
|
109509
|
+
def("TSMappedType").bases("TSType").build("typeParameter", "typeAnnotation").field("readonly", or(Boolean, "+", "-"), defaults4["false"]).field("typeParameter", def("TSTypeParameter")).field("optional", or(Boolean, "+", "-"), defaults4["false"]).field(
|
|
108346
109510
|
"typeAnnotation",
|
|
108347
109511
|
or(def("TSType"), null),
|
|
108348
|
-
|
|
109512
|
+
defaults4["null"]
|
|
108349
109513
|
);
|
|
108350
109514
|
def("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes", [or(
|
|
108351
109515
|
def("TSType"),
|
|
108352
109516
|
def("TSNamedTupleMember")
|
|
108353
109517
|
)]);
|
|
108354
|
-
def("TSNamedTupleMember").bases("TSType").build("label", "elementType", "optional").field("label", def("Identifier")).field("optional", Boolean,
|
|
109518
|
+
def("TSNamedTupleMember").bases("TSType").build("label", "elementType", "optional").field("label", def("Identifier")).field("optional", Boolean, defaults4["false"]).field("elementType", def("TSType"));
|
|
108355
109519
|
def("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType"));
|
|
108356
109520
|
def("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType"));
|
|
108357
109521
|
def("TSIndexedAccessType").bases("TSType").build("objectType", "indexType").field("objectType", def("TSType")).field("indexType", def("TSType"));
|
|
@@ -108363,17 +109527,17 @@ function typescriptDef(fork2) {
|
|
|
108363
109527
|
def("TSTypeAnnotation")
|
|
108364
109528
|
)
|
|
108365
109529
|
);
|
|
108366
|
-
def("TSIndexSignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", [def("Identifier")]).field("readonly", Boolean,
|
|
108367
|
-
def("TSPropertySignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("key", "typeAnnotation", "optional").field("key", def("Expression")).field("computed", Boolean,
|
|
109530
|
+
def("TSIndexSignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", [def("Identifier")]).field("readonly", Boolean, defaults4["false"]);
|
|
109531
|
+
def("TSPropertySignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("key", "typeAnnotation", "optional").field("key", def("Expression")).field("computed", Boolean, defaults4["false"]).field("readonly", Boolean, defaults4["false"]).field("optional", Boolean, defaults4["false"]).field(
|
|
108368
109532
|
"initializer",
|
|
108369
109533
|
or(def("Expression"), null),
|
|
108370
|
-
|
|
109534
|
+
defaults4["null"]
|
|
108371
109535
|
);
|
|
108372
109536
|
def("TSMethodSignature").bases(
|
|
108373
109537
|
"Declaration",
|
|
108374
109538
|
"TSHasOptionalTypeParameters",
|
|
108375
109539
|
"TSHasOptionalTypeAnnotation"
|
|
108376
|
-
).build("key", "parameters", "typeAnnotation").field("key", def("Expression")).field("computed", Boolean,
|
|
109540
|
+
).build("key", "parameters", "typeAnnotation").field("key", def("Expression")).field("computed", Boolean, defaults4["false"]).field("optional", Boolean, defaults4["false"]).field("parameters", ParametersType);
|
|
108377
109541
|
def("TSTypePredicate").bases("TSTypeAnnotation", "TSType").build("parameterName", "typeAnnotation", "asserts").field(
|
|
108378
109542
|
"parameterName",
|
|
108379
109543
|
or(
|
|
@@ -108383,8 +109547,8 @@ function typescriptDef(fork2) {
|
|
|
108383
109547
|
).field(
|
|
108384
109548
|
"typeAnnotation",
|
|
108385
109549
|
or(def("TSTypeAnnotation"), null),
|
|
108386
|
-
|
|
108387
|
-
).field("asserts", Boolean,
|
|
109550
|
+
defaults4["null"]
|
|
109551
|
+
).field("asserts", Boolean, defaults4["false"]);
|
|
108388
109552
|
[
|
|
108389
109553
|
"TSCallSignatureDeclaration",
|
|
108390
109554
|
"TSConstructSignatureDeclaration"
|
|
@@ -108398,7 +109562,7 @@ function typescriptDef(fork2) {
|
|
|
108398
109562
|
def("TSEnumMember").bases("Node").build("id", "initializer").field("id", or(def("Identifier"), StringLiteral)).field(
|
|
108399
109563
|
"initializer",
|
|
108400
109564
|
or(def("Expression"), null),
|
|
108401
|
-
|
|
109565
|
+
defaults4["null"]
|
|
108402
109566
|
);
|
|
108403
109567
|
def("TSTypeQuery").bases("TSType").build("exprName").field("exprName", or(TSEntityName, def("TSImportType")));
|
|
108404
109568
|
var TSTypeMember = or(
|
|
@@ -108409,33 +109573,33 @@ function typescriptDef(fork2) {
|
|
|
108409
109573
|
def("TSPropertySignature")
|
|
108410
109574
|
);
|
|
108411
109575
|
def("TSTypeLiteral").bases("TSType").build("members").field("members", [TSTypeMember]);
|
|
108412
|
-
def("TSTypeParameter").bases("Identifier").build("name", "constraint", "default").field("name", or(def("Identifier"), String)).field("constraint", or(def("TSType"), void 0),
|
|
109576
|
+
def("TSTypeParameter").bases("Identifier").build("name", "constraint", "default").field("name", or(def("Identifier"), String)).field("constraint", or(def("TSType"), void 0), defaults4["undefined"]).field("default", or(def("TSType"), void 0), defaults4["undefined"]);
|
|
108413
109577
|
def("TSTypeAssertion").bases("Expression", "Pattern").build("typeAnnotation", "expression").field("typeAnnotation", def("TSType")).field("expression", def("Expression")).field(
|
|
108414
109578
|
"extra",
|
|
108415
109579
|
or({ parenthesized: Boolean }, null),
|
|
108416
|
-
|
|
109580
|
+
defaults4["null"]
|
|
108417
109581
|
);
|
|
108418
109582
|
def("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params", [def("TSTypeParameter")]);
|
|
108419
109583
|
def("TSInstantiationExpression").bases("Expression", "TSHasOptionalTypeParameterInstantiation").build("expression", "typeParameters").field("expression", def("Expression"));
|
|
108420
109584
|
def("TSTypeParameterInstantiation").bases("Node").build("params").field("params", [def("TSType")]);
|
|
108421
|
-
def("TSEnumDeclaration").bases("Declaration").build("id", "members").field("id", def("Identifier")).field("const", Boolean,
|
|
109585
|
+
def("TSEnumDeclaration").bases("Declaration").build("id", "members").field("id", def("Identifier")).field("const", Boolean, defaults4["false"]).field("declare", Boolean, defaults4["false"]).field("members", [def("TSEnumMember")]).field(
|
|
108422
109586
|
"initializer",
|
|
108423
109587
|
or(def("Expression"), null),
|
|
108424
|
-
|
|
109588
|
+
defaults4["null"]
|
|
108425
109589
|
);
|
|
108426
|
-
def("TSTypeAliasDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "typeAnnotation").field("id", def("Identifier")).field("declare", Boolean,
|
|
109590
|
+
def("TSTypeAliasDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "typeAnnotation").field("id", def("Identifier")).field("declare", Boolean, defaults4["false"]).field("typeAnnotation", def("TSType"));
|
|
108427
109591
|
def("TSModuleBlock").bases("Node").build("body").field("body", [def("Statement")]);
|
|
108428
|
-
def("TSModuleDeclaration").bases("Declaration").build("id", "body").field("id", or(StringLiteral, TSEntityName)).field("declare", Boolean,
|
|
109592
|
+
def("TSModuleDeclaration").bases("Declaration").build("id", "body").field("id", or(StringLiteral, TSEntityName)).field("declare", Boolean, defaults4["false"]).field("global", Boolean, defaults4["false"]).field(
|
|
108429
109593
|
"body",
|
|
108430
109594
|
or(
|
|
108431
109595
|
def("TSModuleBlock"),
|
|
108432
109596
|
def("TSModuleDeclaration"),
|
|
108433
109597
|
null
|
|
108434
109598
|
),
|
|
108435
|
-
|
|
109599
|
+
defaults4["null"]
|
|
108436
109600
|
);
|
|
108437
|
-
def("TSImportType").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("argument", "qualifier", "typeParameters").field("argument", StringLiteral).field("qualifier", or(TSEntityName, void 0),
|
|
108438
|
-
def("TSImportEqualsDeclaration").bases("Declaration").build("id", "moduleReference").field("id", def("Identifier")).field("isExport", Boolean,
|
|
109601
|
+
def("TSImportType").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("argument", "qualifier", "typeParameters").field("argument", StringLiteral).field("qualifier", or(TSEntityName, void 0), defaults4["undefined"]);
|
|
109602
|
+
def("TSImportEqualsDeclaration").bases("Declaration").build("id", "moduleReference").field("id", def("Identifier")).field("isExport", Boolean, defaults4["false"]).field(
|
|
108439
109603
|
"moduleReference",
|
|
108440
109604
|
or(
|
|
108441
109605
|
TSEntityName,
|
|
@@ -108447,16 +109611,16 @@ function typescriptDef(fork2) {
|
|
|
108447
109611
|
def("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id", def("Identifier"));
|
|
108448
109612
|
def("TSInterfaceBody").bases("Node").build("body").field("body", [TSTypeMember]);
|
|
108449
109613
|
def("TSExpressionWithTypeArguments").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("expression", "typeParameters").field("expression", TSEntityName);
|
|
108450
|
-
def("TSInterfaceDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "body").field("id", TSEntityName).field("declare", Boolean,
|
|
109614
|
+
def("TSInterfaceDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "body").field("id", TSEntityName).field("declare", Boolean, defaults4["false"]).field(
|
|
108451
109615
|
"extends",
|
|
108452
109616
|
or([def("TSExpressionWithTypeArguments")], null),
|
|
108453
|
-
|
|
109617
|
+
defaults4["null"]
|
|
108454
109618
|
).field("body", def("TSInterfaceBody"));
|
|
108455
109619
|
def("TSParameterProperty").bases("Pattern").build("parameter").field(
|
|
108456
109620
|
"accessibility",
|
|
108457
109621
|
or("public", "private", "protected", void 0),
|
|
108458
|
-
|
|
108459
|
-
).field("readonly", Boolean,
|
|
109622
|
+
defaults4["undefined"]
|
|
109623
|
+
).field("readonly", Boolean, defaults4["false"]).field("parameter", or(
|
|
108460
109624
|
def("Identifier"),
|
|
108461
109625
|
def("AssignmentPattern")
|
|
108462
109626
|
));
|
|
@@ -108464,7 +109628,7 @@ function typescriptDef(fork2) {
|
|
|
108464
109628
|
"access",
|
|
108465
109629
|
// Not "accessibility"?
|
|
108466
109630
|
or("public", "private", "protected", void 0),
|
|
108467
|
-
|
|
109631
|
+
defaults4["undefined"]
|
|
108468
109632
|
);
|
|
108469
109633
|
def("ClassAccessorProperty").bases("Declaration", "TSHasOptionalTypeAnnotation");
|
|
108470
109634
|
def("ClassBody").field("body", [or(
|
|
@@ -108759,7 +109923,7 @@ function isTrailingCommaEnabled(options, context2) {
|
|
|
108759
109923
|
}
|
|
108760
109924
|
return !!trailingComma;
|
|
108761
109925
|
}
|
|
108762
|
-
var
|
|
109926
|
+
var defaults3 = {
|
|
108763
109927
|
tabWidth: 4,
|
|
108764
109928
|
useTabs: false,
|
|
108765
109929
|
reuseWhitespace: true,
|
|
@@ -108780,11 +109944,11 @@ var defaults2 = {
|
|
|
108780
109944
|
flowObjectCommas: true,
|
|
108781
109945
|
tokens: true
|
|
108782
109946
|
};
|
|
108783
|
-
var hasOwn$1 =
|
|
109947
|
+
var hasOwn$1 = defaults3.hasOwnProperty;
|
|
108784
109948
|
function normalize3(opts) {
|
|
108785
|
-
const options = opts ||
|
|
109949
|
+
const options = opts || defaults3;
|
|
108786
109950
|
function get2(key) {
|
|
108787
|
-
return hasOwn$1.call(options, key) ? options[key] :
|
|
109951
|
+
return hasOwn$1.call(options, key) ? options[key] : defaults3[key];
|
|
108788
109952
|
}
|
|
108789
109953
|
return {
|
|
108790
109954
|
tabWidth: +get2("tabWidth"),
|
|
@@ -114404,8 +115568,8 @@ init_esm_shims();
|
|
|
114404
115568
|
// ../../node_modules/crypto-random-string/index.js
|
|
114405
115569
|
init_esm_shims();
|
|
114406
115570
|
import { promisify as promisify7 } from "util";
|
|
114407
|
-
import
|
|
114408
|
-
var randomBytesAsync = promisify7(
|
|
115571
|
+
import crypto3 from "crypto";
|
|
115572
|
+
var randomBytesAsync = promisify7(crypto3.randomBytes);
|
|
114409
115573
|
var urlSafeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split("");
|
|
114410
115574
|
var numericCharacters = "0123456789".split("");
|
|
114411
115575
|
var distinguishableCharacters = "CDEHKMPRTUWXY012458".split("");
|
|
@@ -114418,7 +115582,7 @@ var generateForCustomCharacters = (length, characters) => {
|
|
|
114418
115582
|
let string = "";
|
|
114419
115583
|
let stringLength = 0;
|
|
114420
115584
|
while (stringLength < length) {
|
|
114421
|
-
const entropy =
|
|
115585
|
+
const entropy = crypto3.randomBytes(entropyLength);
|
|
114422
115586
|
let entropyPosition = 0;
|
|
114423
115587
|
while (entropyPosition < entropyLength && stringLength < length) {
|
|
114424
115588
|
const entropyValue = entropy.readUInt16LE(entropyPosition);
|
|
@@ -114453,7 +115617,7 @@ var generateForCustomCharactersAsync = async (length, characters) => {
|
|
|
114453
115617
|
}
|
|
114454
115618
|
return string;
|
|
114455
115619
|
};
|
|
114456
|
-
var generateRandomBytes = (byteLength, type, length) =>
|
|
115620
|
+
var generateRandomBytes = (byteLength, type, length) => crypto3.randomBytes(byteLength).toString(type).slice(0, length);
|
|
114457
115621
|
var generateRandomBytesAsync = async (byteLength, type, length) => {
|
|
114458
115622
|
const buffer = await randomBytesAsync(byteLength);
|
|
114459
115623
|
return buffer.toString(type).slice(0, length);
|
|
@@ -114603,7 +115767,7 @@ async function getUniqueExtensionPath(projectFolder, extensionPath, suffix) {
|
|
|
114603
115767
|
|
|
114604
115768
|
// src/task-runner.ts
|
|
114605
115769
|
init_esm_shims();
|
|
114606
|
-
var
|
|
115770
|
+
var import_react105 = __toESM(require_react(), 1);
|
|
114607
115771
|
var import_variant33 = __toESM(require_lib(), 1);
|
|
114608
115772
|
var TaskRunnerStatus = (0, import_variant33.variant)({
|
|
114609
115773
|
Idle: {},
|
|
@@ -114629,7 +115793,7 @@ var TaskRunnerStatus = (0, import_variant33.variant)({
|
|
|
114629
115793
|
}
|
|
114630
115794
|
});
|
|
114631
115795
|
function useTaskRunner() {
|
|
114632
|
-
const [status, setStatus] = (0,
|
|
115796
|
+
const [status, setStatus] = (0, import_react105.useState)(
|
|
114633
115797
|
TaskRunnerStatus.Idle()
|
|
114634
115798
|
);
|
|
114635
115799
|
const { execute } = useAsyncCallback3(async (_2, tasks) => {
|
|
@@ -114649,25 +115813,25 @@ function useTaskRunner() {
|
|
|
114649
115813
|
|
|
114650
115814
|
// src/components/TaskList.tsx
|
|
114651
115815
|
init_esm_shims();
|
|
114652
|
-
var
|
|
115816
|
+
var import_react106 = __toESM(require_react(), 1);
|
|
114653
115817
|
var TaskList = ({ tasks, totalTaskCount }) => {
|
|
114654
|
-
return /* @__PURE__ */
|
|
115818
|
+
return /* @__PURE__ */ import_react106.default.createElement(import_react106.default.Fragment, null, tasks.map((task, index) => {
|
|
114655
115819
|
const stepper = `[${index + 1}/${totalTaskCount}]`;
|
|
114656
115820
|
const fullText = `${stepper} ${task.text}`;
|
|
114657
115821
|
if (task.status === "running") {
|
|
114658
|
-
return /* @__PURE__ */
|
|
115822
|
+
return /* @__PURE__ */ import_react106.default.createElement(Spinner2, { key: index, text: fullText });
|
|
114659
115823
|
}
|
|
114660
|
-
return /* @__PURE__ */
|
|
115824
|
+
return /* @__PURE__ */ import_react106.default.createElement(Alert, { key: index, type: "success" }, fullText);
|
|
114661
115825
|
}));
|
|
114662
115826
|
};
|
|
114663
115827
|
|
|
114664
115828
|
// src/components/LinkCommand/GenerateProject.tsx
|
|
114665
115829
|
var GenerationProgress = ({ tasks, totalTaskCount }) => {
|
|
114666
|
-
return /* @__PURE__ */
|
|
115830
|
+
return /* @__PURE__ */ import_react107.default.createElement(import_react107.default.Fragment, null, /* @__PURE__ */ import_react107.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react107.default.createElement(Text2, null, "Generating your headless site...")), /* @__PURE__ */ import_react107.default.createElement(TaskList, { tasks, totalTaskCount }));
|
|
114667
115831
|
};
|
|
114668
115832
|
var GenerateProject = ({ projectFolder, businessId, projectData, onDone, packageManager }) => {
|
|
114669
115833
|
const { execute: executeTaskRunner, status: taskRunnerStatus } = useTaskRunner();
|
|
114670
|
-
const generateProject = (0,
|
|
115834
|
+
const generateProject = (0, import_react107.useCallback)(async () => {
|
|
114671
115835
|
const wixConfigFilePath = getWixConfigFilePath(projectFolder);
|
|
114672
115836
|
const envFilePath = getEnvFilePath(projectFolder);
|
|
114673
115837
|
await writeJson(
|
|
@@ -114680,10 +115844,10 @@ var GenerateProject = ({ projectFolder, businessId, projectData, onDone, package
|
|
|
114680
115844
|
);
|
|
114681
115845
|
await updateEnvFile(envFilePath, projectData.environmentVariables);
|
|
114682
115846
|
}, [businessId, projectFolder, projectData]);
|
|
114683
|
-
const extendProject = (0,
|
|
115847
|
+
const extendProject = (0, import_react107.useCallback)(async () => {
|
|
114684
115848
|
await extend2(projectFolder);
|
|
114685
115849
|
}, [projectFolder]);
|
|
114686
|
-
const installDependencies = (0,
|
|
115850
|
+
const installDependencies = (0, import_react107.useCallback)(async () => {
|
|
114687
115851
|
try {
|
|
114688
115852
|
await packageManager.runInstall(projectFolder);
|
|
114689
115853
|
} catch (e2) {
|
|
@@ -114693,7 +115857,7 @@ var GenerateProject = ({ projectFolder, businessId, projectData, onDone, package
|
|
|
114693
115857
|
});
|
|
114694
115858
|
}
|
|
114695
115859
|
}, [projectFolder, packageManager]);
|
|
114696
|
-
const tasks = (0,
|
|
115860
|
+
const tasks = (0, import_react107.useMemo)(() => {
|
|
114697
115861
|
const result = [
|
|
114698
115862
|
{
|
|
114699
115863
|
action: generateProject,
|
|
@@ -114719,16 +115883,16 @@ var GenerateProject = ({ projectFolder, businessId, projectData, onDone, package
|
|
|
114719
115883
|
}, []);
|
|
114720
115884
|
return (0, import_variant34.match)(taskRunnerStatus, {
|
|
114721
115885
|
Idle: () => null,
|
|
114722
|
-
Running: (status) => /* @__PURE__ */
|
|
114723
|
-
Done: (status) => /* @__PURE__ */
|
|
115886
|
+
Running: (status) => /* @__PURE__ */ import_react107.default.createElement(GenerationProgress, { ...status }),
|
|
115887
|
+
Done: (status) => /* @__PURE__ */ import_react107.default.createElement(Box_default, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ import_react107.default.createElement(GenerationProgress, { ...status }), /* @__PURE__ */ import_react107.default.createElement(Box_default, { marginLeft: -2, marginTop: 1 }, /* @__PURE__ */ import_react107.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react107.default.createElement(Badge, { skin: "success" }, "Success"), " ", /* @__PURE__ */ import_react107.default.createElement(Text2, null, "Project set up successfully"))))
|
|
114724
115888
|
});
|
|
114725
115889
|
};
|
|
114726
115890
|
|
|
114727
115891
|
// src/components/LinkCommand/FinishedSuccessfullyMessage.tsx
|
|
114728
115892
|
init_esm_shims();
|
|
114729
|
-
var
|
|
115893
|
+
var import_react108 = __toESM(require_react(), 1);
|
|
114730
115894
|
var FinishedSuccessfullyMessage = ({ packageManager }) => {
|
|
114731
|
-
return /* @__PURE__ */
|
|
115895
|
+
return /* @__PURE__ */ import_react108.default.createElement(
|
|
114732
115896
|
Box_default,
|
|
114733
115897
|
{
|
|
114734
115898
|
borderColor: "blue",
|
|
@@ -114740,8 +115904,8 @@ var FinishedSuccessfullyMessage = ({ packageManager }) => {
|
|
|
114740
115904
|
marginLeft: -2,
|
|
114741
115905
|
marginTop: 1
|
|
114742
115906
|
},
|
|
114743
|
-
/* @__PURE__ */
|
|
114744
|
-
/* @__PURE__ */
|
|
115907
|
+
/* @__PURE__ */ import_react108.default.createElement(Text2, { bold: true }, "Next Steps:"),
|
|
115908
|
+
/* @__PURE__ */ import_react108.default.createElement(UnorderedList, { gap: 1 }, /* @__PURE__ */ import_react108.default.createElement(UnorderedList.Item, { marker: "\u{1F45F}" }, /* @__PURE__ */ import_react108.default.createElement(Text2, null, "Start developing"), /* @__PURE__ */ import_react108.default.createElement(Text2, { skin: "info" }, `${packageManager.getRunCmd()} dev`)), /* @__PURE__ */ import_react108.default.createElement(UnorderedList.Item, { marker: /* @__PURE__ */ import_react108.default.createElement(Learn, null) }, /* @__PURE__ */ import_react108.default.createElement(Text2, null, "For guides and API references visit our"), /* @__PURE__ */ import_react108.default.createElement(Link, { skin: "info", url: "https://dev.wix.com/docs/go-headless" }, "documentation")), /* @__PURE__ */ import_react108.default.createElement(UnorderedList.Item, { marker: "\u{1F4AC}" }, /* @__PURE__ */ import_react108.default.createElement(Text2, null, "Join our"), /* @__PURE__ */ import_react108.default.createElement(Link, { skin: "info", url: "https://discord.gg/wixstudio" }, "Discord community")))
|
|
114745
115909
|
);
|
|
114746
115910
|
};
|
|
114747
115911
|
|
|
@@ -114762,10 +115926,10 @@ var LinkCommand = ({
|
|
|
114762
115926
|
projectName: preEnteredProjectName,
|
|
114763
115927
|
businessName: preEnteredBusinessName
|
|
114764
115928
|
}) => {
|
|
114765
|
-
const [businessName, setBusinessName] = (0,
|
|
114766
|
-
const [businessId, setBusinessId] = (0,
|
|
114767
|
-
const [projectData, setProjectData] = (0,
|
|
114768
|
-
const [isDone, setIsDone] = (0,
|
|
115929
|
+
const [businessName, setBusinessName] = (0, import_react109.useState)(preEnteredBusinessName);
|
|
115930
|
+
const [businessId, setBusinessId] = (0, import_react109.useState)();
|
|
115931
|
+
const [projectData, setProjectData] = (0, import_react109.useState)();
|
|
115932
|
+
const [isDone, setIsDone] = (0, import_react109.useState)(false);
|
|
114769
115933
|
const { status } = useAsync2(async () => {
|
|
114770
115934
|
const alreadyLinked = await isWixConfigExists(projectFolder);
|
|
114771
115935
|
if (alreadyLinked) {
|
|
@@ -114787,9 +115951,9 @@ var LinkCommand = ({
|
|
|
114787
115951
|
}, []);
|
|
114788
115952
|
return (0, import_variant35.match)(status, {
|
|
114789
115953
|
Error: () => null,
|
|
114790
|
-
Loading: () => /* @__PURE__ */
|
|
115954
|
+
Loading: () => /* @__PURE__ */ import_react109.default.createElement(Spinner2, { text: "Loading..." }),
|
|
114791
115955
|
Success: ({ result: { packageManager } }) => {
|
|
114792
|
-
return /* @__PURE__ */
|
|
115956
|
+
return /* @__PURE__ */ import_react109.default.createElement(
|
|
114793
115957
|
Box_default,
|
|
114794
115958
|
{
|
|
114795
115959
|
flexDirection: "column",
|
|
@@ -114800,14 +115964,14 @@ var LinkCommand = ({
|
|
|
114800
115964
|
borderTop: false,
|
|
114801
115965
|
paddingLeft: 1
|
|
114802
115966
|
},
|
|
114803
|
-
/* @__PURE__ */
|
|
114804
|
-
!preEnteredBusinessName && /* @__PURE__ */
|
|
115967
|
+
/* @__PURE__ */ import_react109.default.createElement(WelcomeMessage, null),
|
|
115968
|
+
!preEnteredBusinessName && /* @__PURE__ */ import_react109.default.createElement(
|
|
114805
115969
|
ChooseBusinessName,
|
|
114806
115970
|
{
|
|
114807
115971
|
onSubmit: ({ businessName: businessName2 }) => setBusinessName(businessName2)
|
|
114808
115972
|
}
|
|
114809
115973
|
),
|
|
114810
|
-
businessName && /* @__PURE__ */
|
|
115974
|
+
businessName && /* @__PURE__ */ import_react109.default.createElement(AccountAuthProvider, null, /* @__PURE__ */ import_react109.default.createElement(
|
|
114811
115975
|
CreateBusiness,
|
|
114812
115976
|
{
|
|
114813
115977
|
businessName,
|
|
@@ -114815,7 +115979,7 @@ var LinkCommand = ({
|
|
|
114815
115979
|
onDone: ({ businessId: businessId2 }) => setBusinessId(businessId2)
|
|
114816
115980
|
}
|
|
114817
115981
|
)),
|
|
114818
|
-
businessName && businessId && /* @__PURE__ */
|
|
115982
|
+
businessName && businessId && /* @__PURE__ */ import_react109.default.createElement(SiteAuthProvider, { siteId: businessId }, /* @__PURE__ */ import_react109.default.createElement(
|
|
114819
115983
|
CreateProject,
|
|
114820
115984
|
{
|
|
114821
115985
|
businessId,
|
|
@@ -114823,7 +115987,7 @@ var LinkCommand = ({
|
|
|
114823
115987
|
onSubmit: (data) => setProjectData(data)
|
|
114824
115988
|
}
|
|
114825
115989
|
)),
|
|
114826
|
-
businessName && businessId && projectData && /* @__PURE__ */
|
|
115990
|
+
businessName && businessId && projectData && /* @__PURE__ */ import_react109.default.createElement(
|
|
114827
115991
|
GenerateProject,
|
|
114828
115992
|
{
|
|
114829
115993
|
packageManager,
|
|
@@ -114833,7 +115997,7 @@ var LinkCommand = ({
|
|
|
114833
115997
|
onDone: () => setIsDone(true)
|
|
114834
115998
|
}
|
|
114835
115999
|
),
|
|
114836
|
-
businessName && businessId && projectData && isDone && /* @__PURE__ */
|
|
116000
|
+
businessName && businessId && projectData && isDone && /* @__PURE__ */ import_react109.default.createElement(FinishedSuccessfullyMessage, { packageManager })
|
|
114837
116001
|
);
|
|
114838
116002
|
}
|
|
114839
116003
|
});
|
|
@@ -114872,7 +116036,7 @@ function validateTemplateParams(value2) {
|
|
|
114872
116036
|
|
|
114873
116037
|
// src/components/ProcessCommand.tsx
|
|
114874
116038
|
init_esm_shims();
|
|
114875
|
-
var
|
|
116039
|
+
var import_react116 = __toESM(require_react(), 1);
|
|
114876
116040
|
var import_variant43 = __toESM(require_lib(), 1);
|
|
114877
116041
|
|
|
114878
116042
|
// src/parse-command-options.ts
|
|
@@ -115406,17 +116570,17 @@ var Ky = class _Ky {
|
|
|
115406
116570
|
};
|
|
115407
116571
|
|
|
115408
116572
|
// ../../node_modules/ky/distribution/index.js
|
|
115409
|
-
var createInstance3 = (
|
|
115410
|
-
const ky2 = (input, options) => Ky.create(input, validateAndMerge(
|
|
116573
|
+
var createInstance3 = (defaults4) => {
|
|
116574
|
+
const ky2 = (input, options) => Ky.create(input, validateAndMerge(defaults4, options));
|
|
115411
116575
|
for (const method of requestMethods) {
|
|
115412
|
-
ky2[method] = (input, options) => Ky.create(input, validateAndMerge(
|
|
116576
|
+
ky2[method] = (input, options) => Ky.create(input, validateAndMerge(defaults4, options, { method }));
|
|
115413
116577
|
}
|
|
115414
116578
|
ky2.create = (newDefaults) => createInstance3(validateAndMerge(newDefaults));
|
|
115415
116579
|
ky2.extend = (newDefaults) => {
|
|
115416
116580
|
if (typeof newDefaults === "function") {
|
|
115417
|
-
newDefaults = newDefaults(
|
|
116581
|
+
newDefaults = newDefaults(defaults4 ?? {});
|
|
115418
116582
|
}
|
|
115419
|
-
return createInstance3(validateAndMerge(
|
|
116583
|
+
return createInstance3(validateAndMerge(defaults4, newDefaults));
|
|
115420
116584
|
};
|
|
115421
116585
|
ky2.stop = stop;
|
|
115422
116586
|
return ky2;
|
|
@@ -115681,12 +116845,12 @@ async function parseCommandOptions(targetParentFolder2, options) {
|
|
|
115681
116845
|
|
|
115682
116846
|
// src/components/CreateHeadlessSiteCommand.tsx
|
|
115683
116847
|
init_esm_shims();
|
|
115684
|
-
var
|
|
116848
|
+
var import_react115 = __toESM(require_react(), 1);
|
|
115685
116849
|
var import_variant42 = __toESM(require_lib(), 1);
|
|
115686
116850
|
|
|
115687
116851
|
// src/components/ChooseFolder.tsx
|
|
115688
116852
|
init_esm_shims();
|
|
115689
|
-
var
|
|
116853
|
+
var import_react110 = __toESM(require_react(), 1);
|
|
115690
116854
|
var import_variant38 = __toESM(require_lib(), 1);
|
|
115691
116855
|
import { join as join18 } from "node:path";
|
|
115692
116856
|
var validateAppDirectory = async (targetParentFolder2, packageName) => {
|
|
@@ -115700,11 +116864,11 @@ var validateAppDirectory = async (targetParentFolder2, packageName) => {
|
|
|
115700
116864
|
});
|
|
115701
116865
|
};
|
|
115702
116866
|
var ChooseFolder = ({ initialFolderName, targetParentFolder: targetParentFolder2, onSubmit }) => {
|
|
115703
|
-
const validate3 = (0,
|
|
116867
|
+
const validate3 = (0, import_react110.useCallback)(
|
|
115704
116868
|
async (packageName) => validateAppDirectory(targetParentFolder2, packageName),
|
|
115705
116869
|
[targetParentFolder2]
|
|
115706
116870
|
);
|
|
115707
|
-
return /* @__PURE__ */
|
|
116871
|
+
return /* @__PURE__ */ import_react110.default.createElement(
|
|
115708
116872
|
TextInput2,
|
|
115709
116873
|
{
|
|
115710
116874
|
label: "In which directory do you want to create your application?",
|
|
@@ -115719,7 +116883,7 @@ var ChooseFolder = ({ initialFolderName, targetParentFolder: targetParentFolder2
|
|
|
115719
116883
|
// src/components/GenerateProject.tsx
|
|
115720
116884
|
init_esm_shims();
|
|
115721
116885
|
import { mkdir as mkdir3 } from "node:fs/promises";
|
|
115722
|
-
var
|
|
116886
|
+
var import_react111 = __toESM(require_react(), 1);
|
|
115723
116887
|
var import_variant39 = __toESM(require_lib(), 1);
|
|
115724
116888
|
import { join as join20 } from "node:path";
|
|
115725
116889
|
|
|
@@ -115764,7 +116928,7 @@ async function fetchTemplate(url2, path8 = ".") {
|
|
|
115764
116928
|
// src/components/GenerateProject.tsx
|
|
115765
116929
|
var headlessTemplatesGitUrl = "https://github.com/wix/headless-templates.git";
|
|
115766
116930
|
var GenerationProgress2 = ({ tasks, totalTaskCount }) => {
|
|
115767
|
-
return /* @__PURE__ */
|
|
116931
|
+
return /* @__PURE__ */ import_react111.default.createElement(import_react111.default.Fragment, null, /* @__PURE__ */ import_react111.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react111.default.createElement(Text2, null, "Generating your headless site...")), /* @__PURE__ */ import_react111.default.createElement(TaskList, { tasks, totalTaskCount }));
|
|
115768
116932
|
};
|
|
115769
116933
|
var GenerateProject2 = ({
|
|
115770
116934
|
repoType,
|
|
@@ -115779,11 +116943,11 @@ var GenerateProject2 = ({
|
|
|
115779
116943
|
}) => {
|
|
115780
116944
|
const { reportError: reportError2 } = useErrorReporter();
|
|
115781
116945
|
const { execute: executeTaskRunner, status: taskRunnerStatus } = useTaskRunner();
|
|
115782
|
-
const packageFolder = (0,
|
|
116946
|
+
const packageFolder = (0, import_react111.useMemo)(
|
|
115783
116947
|
() => join20(targetParentFolder2, folderName),
|
|
115784
116948
|
[folderName, targetParentFolder2]
|
|
115785
116949
|
);
|
|
115786
|
-
const generateProject = (0,
|
|
116950
|
+
const generateProject = (0, import_react111.useCallback)(async () => {
|
|
115787
116951
|
try {
|
|
115788
116952
|
await mkdir3(packageFolder, { recursive: true });
|
|
115789
116953
|
} catch (e2) {
|
|
@@ -115824,7 +116988,7 @@ var GenerateProject2 = ({
|
|
|
115824
116988
|
selectedTemplate,
|
|
115825
116989
|
commandOptions.templateParams
|
|
115826
116990
|
]);
|
|
115827
|
-
const extendProject = (0,
|
|
116991
|
+
const extendProject = (0, import_react111.useCallback)(async () => {
|
|
115828
116992
|
await extend2(packageFolder);
|
|
115829
116993
|
try {
|
|
115830
116994
|
await addFilesFromTemplate(
|
|
@@ -115843,7 +117007,7 @@ var GenerateProject2 = ({
|
|
|
115843
117007
|
packageManager,
|
|
115844
117008
|
repoType
|
|
115845
117009
|
]);
|
|
115846
|
-
const initializeGit = (0,
|
|
117010
|
+
const initializeGit = (0, import_react111.useCallback)(async () => {
|
|
115847
117011
|
try {
|
|
115848
117012
|
await gitInit(packageFolder);
|
|
115849
117013
|
} catch (e2) {
|
|
@@ -115853,7 +117017,7 @@ var GenerateProject2 = ({
|
|
|
115853
117017
|
});
|
|
115854
117018
|
}
|
|
115855
117019
|
}, [packageFolder]);
|
|
115856
|
-
const installDependencies = (0,
|
|
117020
|
+
const installDependencies = (0, import_react111.useCallback)(async () => {
|
|
115857
117021
|
try {
|
|
115858
117022
|
await packageManager.runInstall(packageFolder);
|
|
115859
117023
|
} catch (e2) {
|
|
@@ -115863,7 +117027,7 @@ var GenerateProject2 = ({
|
|
|
115863
117027
|
});
|
|
115864
117028
|
}
|
|
115865
117029
|
}, [packageFolder, packageManager]);
|
|
115866
|
-
const commitToGit = (0,
|
|
117030
|
+
const commitToGit = (0, import_react111.useCallback)(async () => {
|
|
115867
117031
|
try {
|
|
115868
117032
|
await gitCommit(packageFolder);
|
|
115869
117033
|
} catch (e2) {
|
|
@@ -115873,7 +117037,7 @@ var GenerateProject2 = ({
|
|
|
115873
117037
|
});
|
|
115874
117038
|
}
|
|
115875
117039
|
}, [packageFolder]);
|
|
115876
|
-
const tasks = (0,
|
|
117040
|
+
const tasks = (0, import_react111.useMemo)(() => {
|
|
115877
117041
|
const result = [
|
|
115878
117042
|
{
|
|
115879
117043
|
action: generateProject,
|
|
@@ -115923,16 +117087,16 @@ var GenerateProject2 = ({
|
|
|
115923
117087
|
}, []);
|
|
115924
117088
|
return (0, import_variant39.match)(taskRunnerStatus, {
|
|
115925
117089
|
Idle: () => null,
|
|
115926
|
-
Running: (status) => /* @__PURE__ */
|
|
115927
|
-
Done: (status) => /* @__PURE__ */
|
|
117090
|
+
Running: (status) => /* @__PURE__ */ import_react111.default.createElement(GenerationProgress2, { ...status }),
|
|
117091
|
+
Done: (status) => /* @__PURE__ */ import_react111.default.createElement(Box_default, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ import_react111.default.createElement(GenerationProgress2, { ...status }), /* @__PURE__ */ import_react111.default.createElement(Box_default, { marginLeft: -2, marginTop: 1 }, /* @__PURE__ */ import_react111.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react111.default.createElement(Badge, { skin: "success" }, "Success"), " ", /* @__PURE__ */ import_react111.default.createElement(Text2, null, "Project set up successfully"))))
|
|
115928
117092
|
});
|
|
115929
117093
|
};
|
|
115930
117094
|
|
|
115931
117095
|
// src/components/ChooseTemplate.tsx
|
|
115932
117096
|
init_esm_shims();
|
|
115933
|
-
var
|
|
117097
|
+
var import_react112 = __toESM(require_react(), 1);
|
|
115934
117098
|
var ChooseTemplate = ({ onSubmit }) => {
|
|
115935
|
-
const options = (0,
|
|
117099
|
+
const options = (0, import_react112.useMemo)(() => {
|
|
115936
117100
|
return headlessTemplates.map((template) => ({
|
|
115937
117101
|
key: template.siteTemplateId,
|
|
115938
117102
|
title: template.title,
|
|
@@ -115940,7 +117104,7 @@ var ChooseTemplate = ({ onSubmit }) => {
|
|
|
115940
117104
|
value: template
|
|
115941
117105
|
}));
|
|
115942
117106
|
}, []);
|
|
115943
|
-
return /* @__PURE__ */
|
|
117107
|
+
return /* @__PURE__ */ import_react112.default.createElement(
|
|
115944
117108
|
SelectInput2,
|
|
115945
117109
|
{
|
|
115946
117110
|
label: "Choose an initial template for your business",
|
|
@@ -115952,14 +117116,14 @@ var ChooseTemplate = ({ onSubmit }) => {
|
|
|
115952
117116
|
|
|
115953
117117
|
// src/components/ReleaseProject.tsx
|
|
115954
117118
|
init_esm_shims();
|
|
115955
|
-
var
|
|
117119
|
+
var import_react114 = __toESM(require_react(), 1);
|
|
115956
117120
|
var import_variant41 = __toESM(require_lib(), 1);
|
|
115957
117121
|
|
|
115958
117122
|
// src/components/FinishedSuccessfullyMessage.tsx
|
|
115959
117123
|
init_esm_shims();
|
|
115960
|
-
var
|
|
117124
|
+
var import_react113 = __toESM(require_react(), 1);
|
|
115961
117125
|
var FinishedSuccessfullyMessage2 = ({ packageManager, folderName, projectData, isReleased }) => {
|
|
115962
|
-
return /* @__PURE__ */
|
|
117126
|
+
return /* @__PURE__ */ import_react113.default.createElement(
|
|
115963
117127
|
Box_default,
|
|
115964
117128
|
{
|
|
115965
117129
|
borderColor: "blue",
|
|
@@ -115971,9 +117135,9 @@ var FinishedSuccessfullyMessage2 = ({ packageManager, folderName, projectData, i
|
|
|
115971
117135
|
marginLeft: -2,
|
|
115972
117136
|
marginTop: 1
|
|
115973
117137
|
},
|
|
115974
|
-
isReleased && /* @__PURE__ */
|
|
115975
|
-
/* @__PURE__ */
|
|
115976
|
-
/* @__PURE__ */
|
|
117138
|
+
isReleased && /* @__PURE__ */ import_react113.default.createElement(Text2, { bold: true }, /* @__PURE__ */ import_react113.default.createElement(Rocket, null), " Visit your site at: ", projectData.baseUrl),
|
|
117139
|
+
/* @__PURE__ */ import_react113.default.createElement(Text2, { bold: true }, "Next Steps:"),
|
|
117140
|
+
/* @__PURE__ */ import_react113.default.createElement(UnorderedList, { gap: 1 }, /* @__PURE__ */ import_react113.default.createElement(UnorderedList.Item, { marker: "\u{1F45F}" }, /* @__PURE__ */ import_react113.default.createElement(Text2, null, "Start developing"), /* @__PURE__ */ import_react113.default.createElement(Text2, { skin: "info" }, `cd ${folderName}`), /* @__PURE__ */ import_react113.default.createElement(Text2, { skin: "info" }, `${packageManager.getRunCmd()} dev`)), /* @__PURE__ */ import_react113.default.createElement(UnorderedList.Item, { marker: /* @__PURE__ */ import_react113.default.createElement(Learn, null) }, /* @__PURE__ */ import_react113.default.createElement(Text2, null, "For guides and API references visit our"), /* @__PURE__ */ import_react113.default.createElement(Link, { skin: "info", url: "https://dev.wix.com/docs/go-headless" }, "documentation")), /* @__PURE__ */ import_react113.default.createElement(UnorderedList.Item, { marker: "\u{1F4AC}" }, /* @__PURE__ */ import_react113.default.createElement(Text2, null, "Join our"), /* @__PURE__ */ import_react113.default.createElement(Link, { skin: "info", url: "https://discord.gg/wixstudio" }, "Discord community")))
|
|
115977
117141
|
);
|
|
115978
117142
|
};
|
|
115979
117143
|
|
|
@@ -116029,7 +117193,7 @@ var ReleaseProject = ({
|
|
|
116029
117193
|
releaseNonInteractive
|
|
116030
117194
|
}) => {
|
|
116031
117195
|
const { status, execute } = useReleaseProject();
|
|
116032
|
-
(0,
|
|
117196
|
+
(0, import_react114.useEffect)(() => {
|
|
116033
117197
|
if (releaseNonInteractive != null) {
|
|
116034
117198
|
void execute({
|
|
116035
117199
|
confirmed: releaseNonInteractive,
|
|
@@ -116039,7 +117203,7 @@ var ReleaseProject = ({
|
|
|
116039
117203
|
});
|
|
116040
117204
|
}
|
|
116041
117205
|
}, []);
|
|
116042
|
-
return /* @__PURE__ */
|
|
117206
|
+
return /* @__PURE__ */ import_react114.default.createElement(import_react114.default.Fragment, null, releaseNonInteractive == null && /* @__PURE__ */ import_react114.default.createElement(Box_default, { marginLeft: -2, marginBottom: 1 }, /* @__PURE__ */ import_react114.default.createElement(
|
|
116043
117207
|
ConfirmInput,
|
|
116044
117208
|
{
|
|
116045
117209
|
label: "Would you like to publish your site now?",
|
|
@@ -116056,11 +117220,11 @@ var ReleaseProject = ({
|
|
|
116056
117220
|
)), (0, import_variant41.match)(status, {
|
|
116057
117221
|
NotRequested: () => null,
|
|
116058
117222
|
Success: ({ result }) => {
|
|
116059
|
-
return /* @__PURE__ */
|
|
116060
|
-
Success: () => /* @__PURE__ */
|
|
116061
|
-
Skipped: () => /* @__PURE__ */
|
|
116062
|
-
Error: () => /* @__PURE__ */
|
|
116063
|
-
}), /* @__PURE__ */
|
|
117223
|
+
return /* @__PURE__ */ import_react114.default.createElement(import_react114.default.Fragment, null, (0, import_variant41.match)(result, {
|
|
117224
|
+
Success: () => /* @__PURE__ */ import_react114.default.createElement(Box_default, { marginLeft: -2 }, /* @__PURE__ */ import_react114.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react114.default.createElement(Badge, { skin: "success" }, "Success"), " ", /* @__PURE__ */ import_react114.default.createElement(Text2, null, "Site published successfully"))),
|
|
117225
|
+
Skipped: () => /* @__PURE__ */ import_react114.default.createElement(Text2, null, `No worries, you can publish your site later by running ${packageManager.getRunCmd()} release`),
|
|
117226
|
+
Error: () => /* @__PURE__ */ import_react114.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react114.default.createElement(Alert, { type: "error" }, "Failed to publish your site"), /* @__PURE__ */ import_react114.default.createElement(Text2, null, `No worries, you can publish your site later by running ${packageManager.getRunCmd()} release`))
|
|
117227
|
+
}), /* @__PURE__ */ import_react114.default.createElement(
|
|
116064
117228
|
FinishedSuccessfullyMessage2,
|
|
116065
117229
|
{
|
|
116066
117230
|
packageManager,
|
|
@@ -116071,7 +117235,7 @@ var ReleaseProject = ({
|
|
|
116071
117235
|
));
|
|
116072
117236
|
},
|
|
116073
117237
|
Error: () => null,
|
|
116074
|
-
Loading: () => /* @__PURE__ */
|
|
117238
|
+
Loading: () => /* @__PURE__ */ import_react114.default.createElement(Spinner2, { text: "Publishing your site..." })
|
|
116075
117239
|
}));
|
|
116076
117240
|
};
|
|
116077
117241
|
|
|
@@ -116084,16 +117248,16 @@ var CreateHeadlessSiteCommand = ({
|
|
|
116084
117248
|
projectName: defaultProjectName,
|
|
116085
117249
|
businessName: defaultBusinessName
|
|
116086
117250
|
}) => {
|
|
116087
|
-
const [businessName, setBusinessName] = (0,
|
|
117251
|
+
const [businessName, setBusinessName] = (0, import_react115.useState)(
|
|
116088
117252
|
defaultBusinessName
|
|
116089
117253
|
);
|
|
116090
|
-
const [selectedTemplate, setSelectedTemplate] = (0,
|
|
116091
|
-
const [folderName, setFolderName] = (0,
|
|
117254
|
+
const [selectedTemplate, setSelectedTemplate] = (0, import_react115.useState)(defaultTemplate);
|
|
117255
|
+
const [folderName, setFolderName] = (0, import_react115.useState)(
|
|
116092
117256
|
defaultProjectName
|
|
116093
117257
|
);
|
|
116094
|
-
const [businessId, setBusinessId] = (0,
|
|
116095
|
-
const [projectData, setProjectData] = (0,
|
|
116096
|
-
const [generationDone, setGenerationDone] = (0,
|
|
117258
|
+
const [businessId, setBusinessId] = (0, import_react115.useState)();
|
|
117259
|
+
const [projectData, setProjectData] = (0, import_react115.useState)();
|
|
117260
|
+
const [generationDone, setGenerationDone] = (0, import_react115.useState)(false);
|
|
116097
117261
|
const { status } = useAsync2(async () => {
|
|
116098
117262
|
const repoType = await getRepoType(targetParentFolder2);
|
|
116099
117263
|
const packageManager = await createPackageManager(repoType);
|
|
@@ -116102,9 +117266,9 @@ var CreateHeadlessSiteCommand = ({
|
|
|
116102
117266
|
}, []);
|
|
116103
117267
|
return (0, import_variant42.match)(status, {
|
|
116104
117268
|
Error: () => null,
|
|
116105
|
-
Loading: () => /* @__PURE__ */
|
|
117269
|
+
Loading: () => /* @__PURE__ */ import_react115.default.createElement(Spinner2, { text: "Loading..." }),
|
|
116106
117270
|
Success: ({ result: { packageManager, repoType } }) => {
|
|
116107
|
-
return /* @__PURE__ */
|
|
117271
|
+
return /* @__PURE__ */ import_react115.default.createElement(
|
|
116108
117272
|
Box_default,
|
|
116109
117273
|
{
|
|
116110
117274
|
flexDirection: "column",
|
|
@@ -116115,14 +117279,14 @@ var CreateHeadlessSiteCommand = ({
|
|
|
116115
117279
|
borderTop: false,
|
|
116116
117280
|
paddingLeft: 1
|
|
116117
117281
|
},
|
|
116118
|
-
/* @__PURE__ */
|
|
116119
|
-
!defaultBusinessName && /* @__PURE__ */
|
|
117282
|
+
/* @__PURE__ */ import_react115.default.createElement(WelcomeMessage, null),
|
|
117283
|
+
!defaultBusinessName && /* @__PURE__ */ import_react115.default.createElement(
|
|
116120
117284
|
ChooseBusinessName,
|
|
116121
117285
|
{
|
|
116122
117286
|
onSubmit: ({ businessName: businessName2 }) => setBusinessName(businessName2)
|
|
116123
117287
|
}
|
|
116124
117288
|
),
|
|
116125
|
-
!defaultTemplate && businessName && /* @__PURE__ */
|
|
117289
|
+
!defaultTemplate && businessName && /* @__PURE__ */ import_react115.default.createElement(
|
|
116126
117290
|
ChooseTemplate,
|
|
116127
117291
|
{
|
|
116128
117292
|
onSubmit: ({ template }) => {
|
|
@@ -116130,7 +117294,7 @@ var CreateHeadlessSiteCommand = ({
|
|
|
116130
117294
|
}
|
|
116131
117295
|
}
|
|
116132
117296
|
),
|
|
116133
|
-
businessName && selectedTemplate && /* @__PURE__ */
|
|
117297
|
+
businessName && selectedTemplate && /* @__PURE__ */ import_react115.default.createElement(AccountAuthProvider, null, /* @__PURE__ */ import_react115.default.createElement(
|
|
116134
117298
|
CreateBusiness,
|
|
116135
117299
|
{
|
|
116136
117300
|
businessName,
|
|
@@ -116138,7 +117302,7 @@ var CreateHeadlessSiteCommand = ({
|
|
|
116138
117302
|
onDone: ({ businessId: businessId2 }) => setBusinessId(businessId2)
|
|
116139
117303
|
}
|
|
116140
117304
|
)),
|
|
116141
|
-
businessName && selectedTemplate && businessId && /* @__PURE__ */
|
|
117305
|
+
businessName && selectedTemplate && businessId && /* @__PURE__ */ import_react115.default.createElement(SiteAuthProvider, { siteId: businessId }, /* @__PURE__ */ import_react115.default.createElement(
|
|
116142
117306
|
CreateProject,
|
|
116143
117307
|
{
|
|
116144
117308
|
businessId,
|
|
@@ -116146,7 +117310,7 @@ var CreateHeadlessSiteCommand = ({
|
|
|
116146
117310
|
onSubmit: (data) => setProjectData(data)
|
|
116147
117311
|
}
|
|
116148
117312
|
)),
|
|
116149
|
-
!defaultProjectName && businessName && selectedTemplate && businessId && projectData && /* @__PURE__ */
|
|
117313
|
+
!defaultProjectName && businessName && selectedTemplate && businessId && projectData && /* @__PURE__ */ import_react115.default.createElement(
|
|
116150
117314
|
ChooseFolder,
|
|
116151
117315
|
{
|
|
116152
117316
|
initialFolderName: projectData.projectName,
|
|
@@ -116154,7 +117318,7 @@ var CreateHeadlessSiteCommand = ({
|
|
|
116154
117318
|
onSubmit: ({ folderName: folderName2 }) => setFolderName(folderName2)
|
|
116155
117319
|
}
|
|
116156
117320
|
),
|
|
116157
|
-
businessName && selectedTemplate && businessId && projectData && folderName && /* @__PURE__ */
|
|
117321
|
+
businessName && selectedTemplate && businessId && projectData && folderName && /* @__PURE__ */ import_react115.default.createElement(
|
|
116158
117322
|
GenerateProject2,
|
|
116159
117323
|
{
|
|
116160
117324
|
folderName,
|
|
@@ -116168,7 +117332,7 @@ var CreateHeadlessSiteCommand = ({
|
|
|
116168
117332
|
onDone: (isDone) => setGenerationDone(isDone)
|
|
116169
117333
|
}
|
|
116170
117334
|
),
|
|
116171
|
-
businessName && selectedTemplate && businessId && projectData && folderName && generationDone && /* @__PURE__ */
|
|
117335
|
+
businessName && selectedTemplate && businessId && projectData && folderName && generationDone && /* @__PURE__ */ import_react115.default.createElement(
|
|
116172
117336
|
ReleaseProject,
|
|
116173
117337
|
{
|
|
116174
117338
|
folderName,
|
|
@@ -116208,9 +117372,9 @@ var ProcessCommand = ({ targetParentFolder: targetParentFolder2, commandOptions
|
|
|
116208
117372
|
}, []);
|
|
116209
117373
|
return (0, import_variant43.match)(status, {
|
|
116210
117374
|
Error: () => null,
|
|
116211
|
-
Loading: () => /* @__PURE__ */
|
|
117375
|
+
Loading: () => /* @__PURE__ */ import_react116.default.createElement(Spinner2, { text: "Loading..." }),
|
|
116212
117376
|
Success: ({ result: { template, projectName, businessName, publish } }) => {
|
|
116213
|
-
return /* @__PURE__ */
|
|
117377
|
+
return /* @__PURE__ */ import_react116.default.createElement(
|
|
116214
117378
|
CreateHeadlessSiteCommand,
|
|
116215
117379
|
{
|
|
116216
117380
|
targetParentFolder: targetParentFolder2,
|
|
@@ -116262,17 +117426,22 @@ program2.command("link").description("Link current project to use Wix as deploym
|
|
|
116262
117426
|
errorReporter,
|
|
116263
117427
|
userInfo?.userId
|
|
116264
117428
|
);
|
|
117429
|
+
const panorama = await createPanorama({
|
|
117430
|
+
artifact: package_default.wix.artifact,
|
|
117431
|
+
version: package_default.version,
|
|
117432
|
+
userId: userInfo?.userId
|
|
117433
|
+
});
|
|
116265
117434
|
const commandStatus = reportCommandStartEvent2(command);
|
|
116266
117435
|
try {
|
|
116267
117436
|
await render2(
|
|
116268
|
-
/* @__PURE__ */
|
|
117437
|
+
/* @__PURE__ */ import_react117.default.createElement(BiProvider, { value: biLogger }, /* @__PURE__ */ import_react117.default.createElement(ErrorReporterProvider, { value: errorReporter }, /* @__PURE__ */ import_react117.default.createElement(PanoramaProvider, { value: panorama }, /* @__PURE__ */ import_react117.default.createElement(
|
|
116269
117438
|
LinkCommand,
|
|
116270
117439
|
{
|
|
116271
117440
|
projectName: options.projectName,
|
|
116272
117441
|
businessName: options.businessName,
|
|
116273
117442
|
projectFolder: targetParentFolder
|
|
116274
117443
|
}
|
|
116275
|
-
)))
|
|
117444
|
+
))))
|
|
116276
117445
|
);
|
|
116277
117446
|
commandStatus.succeed();
|
|
116278
117447
|
} catch (e2) {
|
|
@@ -116336,16 +117505,21 @@ program2.command("init", { isDefault: true }).description("Create headless site"
|
|
|
116336
117505
|
errorReporter,
|
|
116337
117506
|
userInfo?.userId
|
|
116338
117507
|
);
|
|
117508
|
+
const panorama = await createPanorama({
|
|
117509
|
+
artifact: package_default.wix.artifact,
|
|
117510
|
+
version: package_default.version,
|
|
117511
|
+
userId: userInfo?.userId
|
|
117512
|
+
});
|
|
116339
117513
|
const commandStatus = reportCommandStartEvent2(command);
|
|
116340
117514
|
try {
|
|
116341
117515
|
await render2(
|
|
116342
|
-
/* @__PURE__ */
|
|
117516
|
+
/* @__PURE__ */ import_react117.default.createElement(BiProvider, { value: biLogger }, /* @__PURE__ */ import_react117.default.createElement(ErrorReporterProvider, { value: errorReporter }, /* @__PURE__ */ import_react117.default.createElement(PanoramaProvider, { value: panorama }, /* @__PURE__ */ import_react117.default.createElement(
|
|
116343
117517
|
ProcessCommand,
|
|
116344
117518
|
{
|
|
116345
117519
|
targetParentFolder,
|
|
116346
117520
|
commandOptions: options
|
|
116347
117521
|
}
|
|
116348
|
-
)))
|
|
117522
|
+
))))
|
|
116349
117523
|
);
|
|
116350
117524
|
commandStatus.succeed();
|
|
116351
117525
|
} catch (e2) {
|