@wix/essentials 0.1.12 → 0.1.13
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.d.ts +2 -2
- package/build/index.js +2 -2
- package/build/monitoring.d.ts +6 -0
- package/build/monitoring.js +10 -0
- package/cjs/build/index.d.ts +2 -2
- package/cjs/build/index.js +3 -3
- package/cjs/build/monitoring.d.ts +6 -0
- package/cjs/build/monitoring.js +13 -0
- package/package.json +7 -6
- package/build/web-methods.d.ts +0 -8
- package/build/web-methods.js +0 -14
- package/cjs/build/web-methods.d.ts +0 -8
- package/cjs/build/web-methods.js +0 -18
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as auth from './auth.js';
|
|
2
2
|
import * as httpClient from './http-client.js';
|
|
3
|
-
|
|
4
|
-
export { auth, httpClient, webMethods };
|
|
3
|
+
export { auth, httpClient };
|
|
5
4
|
export { i18n } from './i18n.js';
|
|
5
|
+
export { monitoring } from './monitoring.js';
|
package/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as auth from './auth.js';
|
|
2
2
|
import * as httpClient from './http-client.js';
|
|
3
|
-
|
|
4
|
-
export { auth, httpClient, webMethods };
|
|
3
|
+
export { auth, httpClient };
|
|
5
4
|
export { i18n } from './i18n.js';
|
|
5
|
+
export { monitoring } from './monitoring.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Host } from '@wix/sdk-types';
|
|
2
|
+
export declare const monitoring: {
|
|
3
|
+
getMonitoringClient: () => ReturnType<NonNullable<Host["getMonitoringClient"]>>;
|
|
4
|
+
} & import("@wix/sdk-types").HostModule<{
|
|
5
|
+
getMonitoringClient: () => ReturnType<NonNullable<Host["getMonitoringClient"]>>;
|
|
6
|
+
}, Host>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFallbackMonitoringClient } from '@wix/monitoring';
|
|
2
|
+
import { createHostModule } from '@wix/sdk-runtime/host-modules';
|
|
3
|
+
export const monitoring = createHostModule({
|
|
4
|
+
getMonitoringClient: (host) => () => {
|
|
5
|
+
if (!host.getMonitoringClient) {
|
|
6
|
+
return createFallbackMonitoringClient('Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.');
|
|
7
|
+
}
|
|
8
|
+
return host.getMonitoringClient();
|
|
9
|
+
},
|
|
10
|
+
});
|
package/cjs/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as auth from './auth.js';
|
|
2
2
|
import * as httpClient from './http-client.js';
|
|
3
|
-
|
|
4
|
-
export { auth, httpClient, webMethods };
|
|
3
|
+
export { auth, httpClient };
|
|
5
4
|
export { i18n } from './i18n.js';
|
|
5
|
+
export { monitoring } from './monitoring.js';
|
package/cjs/build/index.js
CHANGED
|
@@ -33,12 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
36
|
+
exports.monitoring = exports.i18n = 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"));
|
|
40
40
|
exports.httpClient = httpClient;
|
|
41
|
-
const webMethods = __importStar(require("./web-methods.js"));
|
|
42
|
-
exports.webMethods = webMethods;
|
|
43
41
|
var i18n_js_1 = require("./i18n.js");
|
|
44
42
|
Object.defineProperty(exports, "i18n", { enumerable: true, get: function () { return i18n_js_1.i18n; } });
|
|
43
|
+
var monitoring_js_1 = require("./monitoring.js");
|
|
44
|
+
Object.defineProperty(exports, "monitoring", { enumerable: true, get: function () { return monitoring_js_1.monitoring; } });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Host } from '@wix/sdk-types';
|
|
2
|
+
export declare const monitoring: {
|
|
3
|
+
getMonitoringClient: () => ReturnType<NonNullable<Host["getMonitoringClient"]>>;
|
|
4
|
+
} & import("@wix/sdk-types").HostModule<{
|
|
5
|
+
getMonitoringClient: () => ReturnType<NonNullable<Host["getMonitoringClient"]>>;
|
|
6
|
+
}, Host>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.monitoring = void 0;
|
|
4
|
+
const monitoring_1 = require("@wix/monitoring");
|
|
5
|
+
const host_modules_1 = require("@wix/sdk-runtime/host-modules");
|
|
6
|
+
exports.monitoring = (0, host_modules_1.createHostModule)({
|
|
7
|
+
getMonitoringClient: (host) => () => {
|
|
8
|
+
if (!host.getMonitoringClient) {
|
|
9
|
+
return (0, monitoring_1.createFallbackMonitoringClient)('Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.');
|
|
10
|
+
}
|
|
11
|
+
return host.getMonitoringClient();
|
|
12
|
+
},
|
|
13
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/essentials",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"main": "cjs/build/index.js",
|
|
6
6
|
"module": "build/index.mjs",
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
"*.{js,ts}": "yarn lint"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@wix/
|
|
39
|
-
"@wix/sdk-
|
|
38
|
+
"@wix/monitoring": "^0.7.0",
|
|
39
|
+
"@wix/sdk-runtime": "^0.3.28",
|
|
40
|
+
"@wix/sdk-types": "^1.12.8"
|
|
40
41
|
},
|
|
41
42
|
"optionalDependencies": {
|
|
42
43
|
"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,13 +46,13 @@
|
|
|
45
46
|
"@types/is-ci": "^3.0.4",
|
|
46
47
|
"@types/node": "^20.17.10",
|
|
47
48
|
"@vitest/ui": "^1.6.0",
|
|
48
|
-
"@wix/sdk": "1.15.
|
|
49
|
+
"@wix/sdk": "1.15.7",
|
|
49
50
|
"eslint": "^8.57.1",
|
|
50
51
|
"eslint-config-sdk": "0.0.0",
|
|
51
52
|
"graphql": "^16.8.0",
|
|
52
53
|
"is-ci": "^3.0.1",
|
|
53
54
|
"jsdom": "^22.1.0",
|
|
54
|
-
"msw": "^2.
|
|
55
|
+
"msw": "^2.7.0",
|
|
55
56
|
"typescript": "^5.7.2",
|
|
56
57
|
"vitest": "^1.6.0",
|
|
57
58
|
"vitest-teamcity-reporter": "^0.3.1"
|
|
@@ -73,5 +74,5 @@
|
|
|
73
74
|
]
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
|
-
"falconPackageHash": "
|
|
77
|
+
"falconPackageHash": "f3a8db37c0e6c8cb72e43d4934ea27946c01a32eea0f02e832086acf"
|
|
77
78
|
}
|
package/build/web-methods.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type Handler<T extends unknown[], R> = (...args: T) => R;
|
|
2
|
-
export declare function webMethod<T extends unknown[], R>(permission: Permissions, handler: Handler<T, R>): Handler<T, Promise<Awaited<R>>>;
|
|
3
|
-
export declare enum Permissions {
|
|
4
|
-
Anyone = "anyone",
|
|
5
|
-
Admin = "admin",
|
|
6
|
-
SiteMember = "site-member"
|
|
7
|
-
}
|
|
8
|
-
export {};
|
package/build/web-methods.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// https://dev.wix.com/docs/velo/api-reference/wix-web-module/introduction
|
|
2
|
-
export function webMethod(permission, handler) {
|
|
3
|
-
return {
|
|
4
|
-
handler,
|
|
5
|
-
permission,
|
|
6
|
-
// The type assertion is necessary so developers using this get the types they expect
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export var Permissions;
|
|
10
|
-
(function (Permissions) {
|
|
11
|
-
Permissions["Anyone"] = "anyone";
|
|
12
|
-
Permissions["Admin"] = "admin";
|
|
13
|
-
Permissions["SiteMember"] = "site-member";
|
|
14
|
-
})(Permissions || (Permissions = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type Handler<T extends unknown[], R> = (...args: T) => R;
|
|
2
|
-
export declare function webMethod<T extends unknown[], R>(permission: Permissions, handler: Handler<T, R>): Handler<T, Promise<Awaited<R>>>;
|
|
3
|
-
export declare enum Permissions {
|
|
4
|
-
Anyone = "anyone",
|
|
5
|
-
Admin = "admin",
|
|
6
|
-
SiteMember = "site-member"
|
|
7
|
-
}
|
|
8
|
-
export {};
|
package/cjs/build/web-methods.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Permissions = void 0;
|
|
4
|
-
exports.webMethod = webMethod;
|
|
5
|
-
// https://dev.wix.com/docs/velo/api-reference/wix-web-module/introduction
|
|
6
|
-
function webMethod(permission, handler) {
|
|
7
|
-
return {
|
|
8
|
-
handler,
|
|
9
|
-
permission,
|
|
10
|
-
// The type assertion is necessary so developers using this get the types they expect
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
var Permissions;
|
|
14
|
-
(function (Permissions) {
|
|
15
|
-
Permissions["Anyone"] = "anyone";
|
|
16
|
-
Permissions["Admin"] = "admin";
|
|
17
|
-
Permissions["SiteMember"] = "site-member";
|
|
18
|
-
})(Permissions || (exports.Permissions = Permissions = {}));
|