@wix/essentials 0.1.21 → 0.1.22
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/error-handler.d.ts +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/settings.d.ts +5 -0
- package/build/settings.js +10 -0
- package/cjs/build/error-handler.d.ts +1 -1
- package/cjs/build/index.d.ts +1 -0
- package/cjs/build/index.js +3 -1
- package/cjs/build/settings.d.ts +5 -0
- package/cjs/build/settings.js +13 -0
- package/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/internal/build/error-handler.d.ts +1 -1
- package/internal/build/index.d.ts +1 -0
- package/internal/build/index.js +3 -1
- package/internal/build/settings.d.ts +5 -0
- package/internal/build/settings.js +13 -0
- package/internal/cjs/build/error-handler.d.ts +1 -1
- package/internal/cjs/build/index.d.ts +1 -0
- package/internal/cjs/build/index.js +1 -0
- package/internal/cjs/build/settings.d.ts +5 -0
- package/internal/cjs/build/settings.js +10 -0
- package/internal/cjs/tsconfig.internal.tsbuildinfo +1 -1
- package/internal/tsconfig.internal.cjs.tsbuildinfo +1 -1
- package/package.json +6 -6
package/build/error-handler.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedError, ErrorCodesMap, ErrorHandler } from '@wix/sdk-types';
|
|
2
2
|
export declare const withErrorHandler: <T>(fn: () => Promise<T>, errorCodesMap: ErrorCodesMap) => Promise<T>;
|
|
3
3
|
export declare const getResolvedError: <T>(error: unknown) => ResolvedError & Partial<T>;
|
|
4
|
-
export declare const showError: (error: unknown, props?: Partial<import("@wix/error-handler-types/dist/types/v2/ShowError.js").
|
|
4
|
+
export declare const showError: (error: unknown, props?: Partial<import("@wix/error-handler-types/dist/types/v2/ShowError.js").ShowErrorOverrideProps> | null) => void;
|
|
5
5
|
export type { ErrorHandler, ResolvedError, ErrorCodesMap };
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createHostModule } from '@wix/sdk-runtime/host-modules';
|
|
2
|
+
export const settings = createHostModule({
|
|
3
|
+
getTimezone: (host) => () => {
|
|
4
|
+
const timezone = host.essentials?.timezone;
|
|
5
|
+
if (!timezone) {
|
|
6
|
+
throw new Error('Host timezone is not available on the current host. Make sure to use an updated version of the host initialization package.');
|
|
7
|
+
}
|
|
8
|
+
return timezone;
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedError, ErrorCodesMap, ErrorHandler } from '@wix/sdk-types';
|
|
2
2
|
export declare const withErrorHandler: <T>(fn: () => Promise<T>, errorCodesMap: ErrorCodesMap) => Promise<T>;
|
|
3
3
|
export declare const getResolvedError: <T>(error: unknown) => ResolvedError & Partial<T>;
|
|
4
|
-
export declare const showError: (error: unknown, props?: Partial<import("@wix/error-handler-types/dist/types/v2").
|
|
4
|
+
export declare const showError: (error: unknown, props?: Partial<import("@wix/error-handler-types/dist/types/v2").ShowErrorOverrideProps> | null) => void;
|
|
5
5
|
export type { ErrorHandler, ResolvedError, ErrorCodesMap };
|
package/cjs/build/index.d.ts
CHANGED
package/cjs/build/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.experiments = exports.bi = exports.monitoring = exports.i18n = exports.errorHandler = exports.httpClient = exports.auth = void 0;
|
|
36
|
+
exports.settings = exports.experiments = exports.bi = exports.monitoring = exports.i18n = exports.errorHandler = exports.httpClient = exports.auth = void 0;
|
|
37
37
|
const auth = __importStar(require("./auth.js"));
|
|
38
38
|
exports.auth = auth;
|
|
39
39
|
const httpClient = __importStar(require("./http-client.js"));
|
|
@@ -48,3 +48,5 @@ var bi_js_1 = require("./bi.js");
|
|
|
48
48
|
Object.defineProperty(exports, "bi", { enumerable: true, get: function () { return bi_js_1.bi; } });
|
|
49
49
|
var experiments_js_1 = require("./experiments.js");
|
|
50
50
|
Object.defineProperty(exports, "experiments", { enumerable: true, get: function () { return experiments_js_1.experiments; } });
|
|
51
|
+
var settings_js_1 = require("./settings.js");
|
|
52
|
+
Object.defineProperty(exports, "settings", { enumerable: true, get: function () { return settings_js_1.settings; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.settings = void 0;
|
|
4
|
+
const host_modules_1 = require("@wix/sdk-runtime/host-modules");
|
|
5
|
+
exports.settings = (0, host_modules_1.createHostModule)({
|
|
6
|
+
getTimezone: (host) => () => {
|
|
7
|
+
const timezone = host.essentials?.timezone;
|
|
8
|
+
if (!timezone) {
|
|
9
|
+
throw new Error('Host timezone is not available on the current host. Make sure to use an updated version of the host initialization package.');
|
|
10
|
+
}
|
|
11
|
+
return timezone;
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/auth.ts","../src/bi.ts","../src/error-handler.ts","../src/experiments.ts","../src/http-client.ts","../src/i18n.ts","../src/index.ts","../src/monitoring.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../src/auth.ts","../src/bi.ts","../src/error-handler.ts","../src/experiments.ts","../src/http-client.ts","../src/i18n.ts","../src/index.ts","../src/monitoring.ts","../src/settings.ts"],"version":"5.8.3"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ResolvedError, ErrorCodesMap, ErrorHandler } from '@wix/sdk-types';
|
|
2
2
|
export declare const withErrorHandler: <T>(fn: () => Promise<T>, errorCodesMap: ErrorCodesMap) => Promise<T>;
|
|
3
3
|
export declare const getResolvedError: <T>(error: unknown) => ResolvedError & Partial<T>;
|
|
4
|
-
export declare const showError: (error: unknown, props?: Partial<import("@wix/error-handler-types/dist/types/v2").
|
|
4
|
+
export declare const showError: (error: unknown, props?: Partial<import("@wix/error-handler-types/dist/types/v2").ShowErrorOverrideProps> | null) => void;
|
|
5
5
|
/** @internal */
|
|
6
6
|
export declare const reportRetryAttempt: (error: unknown) => void;
|
|
7
7
|
export type { ErrorHandler, ResolvedError, ErrorCodesMap };
|
package/internal/build/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.experiments = exports.bi = exports.monitoring = exports.i18n = exports.errorHandler = exports.httpClient = exports.auth = void 0;
|
|
36
|
+
exports.settings = exports.experiments = exports.bi = exports.monitoring = exports.i18n = exports.errorHandler = exports.httpClient = exports.auth = void 0;
|
|
37
37
|
const auth = __importStar(require("./auth.js"));
|
|
38
38
|
exports.auth = auth;
|
|
39
39
|
const httpClient = __importStar(require("./http-client.js"));
|
|
@@ -48,3 +48,5 @@ var bi_js_1 = require("./bi.js");
|
|
|
48
48
|
Object.defineProperty(exports, "bi", { enumerable: true, get: function () { return bi_js_1.bi; } });
|
|
49
49
|
var experiments_js_1 = require("./experiments.js");
|
|
50
50
|
Object.defineProperty(exports, "experiments", { enumerable: true, get: function () { return experiments_js_1.experiments; } });
|
|
51
|
+
var settings_js_1 = require("./settings.js");
|
|
52
|
+
Object.defineProperty(exports, "settings", { enumerable: true, get: function () { return settings_js_1.settings; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.settings = void 0;
|
|
4
|
+
const host_modules_1 = require("@wix/sdk-runtime/host-modules");
|
|
5
|
+
exports.settings = (0, host_modules_1.createHostModule)({
|
|
6
|
+
getTimezone: (host) => () => {
|
|
7
|
+
const timezone = host.essentials?.timezone;
|
|
8
|
+
if (!timezone) {
|
|
9
|
+
throw new Error('Host timezone is not available on the current host. Make sure to use an updated version of the host initialization package.');
|
|
10
|
+
}
|
|
11
|
+
return timezone;
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ResolvedError, ErrorCodesMap, ErrorHandler } from '@wix/sdk-types';
|
|
2
2
|
export declare const withErrorHandler: <T>(fn: () => Promise<T>, errorCodesMap: ErrorCodesMap) => Promise<T>;
|
|
3
3
|
export declare const getResolvedError: <T>(error: unknown) => ResolvedError & Partial<T>;
|
|
4
|
-
export declare const showError: (error: unknown, props?: Partial<import("@wix/error-handler-types/dist/types/v2/ShowError.js").
|
|
4
|
+
export declare const showError: (error: unknown, props?: Partial<import("@wix/error-handler-types/dist/types/v2/ShowError.js").ShowErrorOverrideProps> | null) => void;
|
|
5
5
|
/** @internal */
|
|
6
6
|
export declare const reportRetryAttempt: (error: unknown) => void;
|
|
7
7
|
export type { ErrorHandler, ResolvedError, ErrorCodesMap };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createHostModule } from '@wix/sdk-runtime/host-modules';
|
|
2
|
+
export const settings = createHostModule({
|
|
3
|
+
getTimezone: (host) => () => {
|
|
4
|
+
const timezone = host.essentials?.timezone;
|
|
5
|
+
if (!timezone) {
|
|
6
|
+
throw new Error('Host timezone is not available on the current host. Make sure to use an updated version of the host initialization package.');
|
|
7
|
+
}
|
|
8
|
+
return timezone;
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../../src/auth.ts","../../src/bi.ts","../../src/error-handler.ts","../../src/experiments.ts","../../src/http-client.ts","../../src/i18n.ts","../../src/index.ts","../../src/monitoring.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../../src/auth.ts","../../src/bi.ts","../../src/error-handler.ts","../../src/experiments.ts","../../src/http-client.ts","../../src/i18n.ts","../../src/index.ts","../../src/monitoring.ts","../../src/settings.ts"],"version":"5.8.3"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/auth.ts","../src/bi.ts","../src/error-handler.ts","../src/experiments.ts","../src/http-client.ts","../src/i18n.ts","../src/index.ts","../src/monitoring.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../src/auth.ts","../src/bi.ts","../src/error-handler.ts","../src/experiments.ts","../src/http-client.ts","../src/i18n.ts","../src/index.ts","../src/monitoring.ts","../src/settings.ts"],"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/essentials",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "cjs/build/index.js",
|
|
6
6
|
"module": "build/index.mjs",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@wix/monitoring": "^0.21.0",
|
|
40
|
-
"@wix/sdk-runtime": "^0.3.
|
|
41
|
-
"@wix/sdk-types": "^1.13.
|
|
40
|
+
"@wix/sdk-runtime": "^0.3.53",
|
|
41
|
+
"@wix/sdk-types": "^1.13.29"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
44
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/is-ci": "^3.0.4",
|
|
48
|
-
"@types/node": "^20.
|
|
48
|
+
"@types/node": "^20.19.0",
|
|
49
49
|
"@vitest/ui": "^1.6.1",
|
|
50
50
|
"@wix/sdk": "1.15.22",
|
|
51
51
|
"eslint": "^8.57.1",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"graphql": "^16.8.0",
|
|
54
54
|
"is-ci": "^3.0.1",
|
|
55
55
|
"jsdom": "^22.1.0",
|
|
56
|
-
"msw": "^2.
|
|
56
|
+
"msw": "^2.10.0",
|
|
57
57
|
"typescript": "^5.8.3",
|
|
58
58
|
"vitest": "^1.6.1",
|
|
59
59
|
"vitest-teamcity-reporter": "^0.3.1"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
]
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
"falconPackageHash": "
|
|
78
|
+
"falconPackageHash": "3ed427211afae0adbd6f811bb4264582b75c5314fdf2069639406af9"
|
|
79
79
|
}
|