@wix/headless-site 1.0.0 → 1.2.0
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/dist/cjs/host-module.js +6 -1
- package/dist/cjs/host-module.js.map +1 -1
- package/dist/cjs/utils/auth-utils.js +11 -0
- package/dist/cjs/utils/auth-utils.js.map +1 -0
- package/dist/esm/host-module.js +6 -1
- package/dist/esm/host-module.js.map +1 -1
- package/dist/esm/utils/auth-utils.js +6 -0
- package/dist/esm/utils/auth-utils.js.map +1 -0
- package/dist/types/host-module.d.ts.map +1 -1
- package/dist/types/utils/auth-utils.d.ts +2 -0
- package/dist/types/utils/auth-utils.d.ts.map +1 -0
- package/package.json +10 -4
package/dist/cjs/host-module.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.createHostModule = void 0;
|
|
5
|
+
var _monitoringVelo = require("@wix/monitoring-velo");
|
|
5
6
|
var _headers = require("./headers");
|
|
7
|
+
var _authUtils = require("./utils/auth-utils");
|
|
6
8
|
const createHostModule = () => {
|
|
7
9
|
return {
|
|
8
10
|
__type: 'host',
|
|
@@ -15,7 +17,10 @@ const createHostModule = () => {
|
|
|
15
17
|
get passThroughHeaders() {
|
|
16
18
|
return (0, _headers.getPassThroughHeaders)();
|
|
17
19
|
}
|
|
18
|
-
}
|
|
20
|
+
},
|
|
21
|
+
getMonitoringClient: () => (0, _monitoringVelo.createVeloMonitoringClient)({
|
|
22
|
+
getAuthToken: () => (0, _authUtils.resolveAuthToken)()
|
|
23
|
+
})
|
|
19
24
|
};
|
|
20
25
|
}
|
|
21
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_monitoringVelo","require","_headers","_authUtils","createHostModule","__type","create","host","essentials","passThroughHeaders","getPassThroughHeaders","getMonitoringClient","createVeloMonitoringClient","getAuthToken","resolveAuthToken","exports"],"sources":["../../src/host-module.ts"],"sourcesContent":["import type { HostModule, Host } from '@wix/sdk-types';\nimport { createVeloMonitoringClient } from '@wix/monitoring-velo';\nimport { getPassThroughHeaders } from './headers';\nimport { resolveAuthToken } from './utils/auth-utils';\nimport type { SDK } from './types';\n\nexport const createHostModule = (): HostModule<SDK, Host> & {\n host: () => Host;\n} => {\n return {\n __type: 'host',\n create: () => {\n return {};\n },\n host: () => {\n return {\n essentials: {\n get passThroughHeaders() {\n return getPassThroughHeaders();\n },\n },\n getMonitoringClient: () =>\n createVeloMonitoringClient({\n getAuthToken: () => resolveAuthToken(),\n }),\n };\n },\n };\n};\n"],"mappings":";;;;AACA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGO,MAAMG,gBAAgB,GAAGA,CAAA,KAE3B;EACH,OAAO;IACLC,MAAM,EAAE,MAAM;IACdC,MAAM,EAAEA,CAAA,KAAM;MACZ,OAAO,CAAC,CAAC;IACX,CAAC;IACDC,IAAI,EAAEA,CAAA,KAAM;MACV,OAAO;QACLC,UAAU,EAAE;UACV,IAAIC,kBAAkBA,CAAA,EAAG;YACvB,OAAO,IAAAC,8BAAqB,EAAC,CAAC;UAChC;QACF,CAAC;QACDC,mBAAmB,EAAEA,CAAA,KACnB,IAAAC,0CAA0B,EAAC;UACzBC,YAAY,EAAEA,CAAA,KAAM,IAAAC,2BAAgB,EAAC;QACvC,CAAC;MACL,CAAC;IACH;EACF,CAAC;AACH,CAAC;AAACC,OAAA,CAAAX,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.resolveAuthToken = void 0;
|
|
5
|
+
var _context = require("@wix/sdk-runtime/context");
|
|
6
|
+
const resolveAuthToken = () => {
|
|
7
|
+
var _resolveContext;
|
|
8
|
+
return (_resolveContext = (0, _context.resolveContext)()) == null ? void 0 : _resolveContext.getAuth().getTokens().accessToken.value;
|
|
9
|
+
};
|
|
10
|
+
exports.resolveAuthToken = resolveAuthToken;
|
|
11
|
+
//# sourceMappingURL=auth-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_context","require","resolveAuthToken","_resolveContext","resolveContext","getAuth","getTokens","accessToken","value","exports"],"sources":["../../../src/utils/auth-utils.ts"],"sourcesContent":["import type { IOAuthStrategy } from '@wix/sdk';\nimport { resolveContext } from '@wix/sdk-runtime/context';\n\nexport const resolveAuthToken = () => {\n return resolveContext()?.getAuth<IOAuthStrategy>().getTokens().accessToken\n .value;\n};\n"],"mappings":";;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EAAA,IAAAC,eAAA;EACpC,QAAAA,eAAA,GAAO,IAAAC,uBAAc,EAAC,CAAC,qBAAhBD,eAAA,CAAkBE,OAAO,CAAiB,CAAC,CAACC,SAAS,CAAC,CAAC,CAACC,WAAW,CACvEC,KAAK;AACV,CAAC;AAACC,OAAA,CAAAP,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
package/dist/esm/host-module.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { createVeloMonitoringClient } from '@wix/monitoring-velo';
|
|
1
2
|
import { getPassThroughHeaders } from './headers';
|
|
3
|
+
import { resolveAuthToken } from './utils/auth-utils';
|
|
2
4
|
export const createHostModule = () => {
|
|
3
5
|
return {
|
|
4
6
|
__type: 'host',
|
|
@@ -11,7 +13,10 @@ export const createHostModule = () => {
|
|
|
11
13
|
get passThroughHeaders() {
|
|
12
14
|
return getPassThroughHeaders();
|
|
13
15
|
}
|
|
14
|
-
}
|
|
16
|
+
},
|
|
17
|
+
getMonitoringClient: () => createVeloMonitoringClient({
|
|
18
|
+
getAuthToken: () => resolveAuthToken()
|
|
19
|
+
})
|
|
15
20
|
};
|
|
16
21
|
}
|
|
17
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getPassThroughHeaders","createHostModule","__type","create","host","essentials","passThroughHeaders"],"sources":["../../src/host-module.ts"],"sourcesContent":["import type { HostModule, Host } from '@wix/sdk-types';\nimport
|
|
1
|
+
{"version":3,"names":["createVeloMonitoringClient","getPassThroughHeaders","resolveAuthToken","createHostModule","__type","create","host","essentials","passThroughHeaders","getMonitoringClient","getAuthToken"],"sources":["../../src/host-module.ts"],"sourcesContent":["import type { HostModule, Host } from '@wix/sdk-types';\nimport { createVeloMonitoringClient } from '@wix/monitoring-velo';\nimport { getPassThroughHeaders } from './headers';\nimport { resolveAuthToken } from './utils/auth-utils';\nimport type { SDK } from './types';\n\nexport const createHostModule = (): HostModule<SDK, Host> & {\n host: () => Host;\n} => {\n return {\n __type: 'host',\n create: () => {\n return {};\n },\n host: () => {\n return {\n essentials: {\n get passThroughHeaders() {\n return getPassThroughHeaders();\n },\n },\n getMonitoringClient: () =>\n createVeloMonitoringClient({\n getAuthToken: () => resolveAuthToken(),\n }),\n };\n },\n };\n};\n"],"mappings":"AACA,SAASA,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,qBAAqB,QAAQ,WAAW;AACjD,SAASC,gBAAgB,QAAQ,oBAAoB;AAGrD,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAE3B;EACH,OAAO;IACLC,MAAM,EAAE,MAAM;IACdC,MAAM,EAAEA,CAAA,KAAM;MACZ,OAAO,CAAC,CAAC;IACX,CAAC;IACDC,IAAI,EAAEA,CAAA,KAAM;MACV,OAAO;QACLC,UAAU,EAAE;UACV,IAAIC,kBAAkBA,CAAA,EAAG;YACvB,OAAOP,qBAAqB,CAAC,CAAC;UAChC;QACF,CAAC;QACDQ,mBAAmB,EAAEA,CAAA,KACnBT,0BAA0B,CAAC;UACzBU,YAAY,EAAEA,CAAA,KAAMR,gBAAgB,CAAC;QACvC,CAAC;MACL,CAAC;IACH;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { resolveContext } from '@wix/sdk-runtime/context';
|
|
2
|
+
export const resolveAuthToken = () => {
|
|
3
|
+
var _resolveContext;
|
|
4
|
+
return (_resolveContext = resolveContext()) == null ? void 0 : _resolveContext.getAuth().getTokens().accessToken.value;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=auth-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveContext","resolveAuthToken","_resolveContext","getAuth","getTokens","accessToken","value"],"sources":["../../../src/utils/auth-utils.ts"],"sourcesContent":["import type { IOAuthStrategy } from '@wix/sdk';\nimport { resolveContext } from '@wix/sdk-runtime/context';\n\nexport const resolveAuthToken = () => {\n return resolveContext()?.getAuth<IOAuthStrategy>().getTokens().accessToken\n .value;\n};\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,0BAA0B;AAEzD,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EAAA,IAAAC,eAAA;EACpC,QAAAA,eAAA,GAAOF,cAAc,CAAC,CAAC,qBAAhBE,eAAA,CAAkBC,OAAO,CAAiB,CAAC,CAACC,SAAS,CAAC,CAAC,CAACC,WAAW,CACvEC,KAAK;AACV,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-module.d.ts","sourceRoot":"","sources":["../../src/host-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"host-module.d.ts","sourceRoot":"","sources":["../../src/host-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAIvD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,gBAAgB,QAAO,WAAW,GAAG,EAAE,IAAI,CAAC,GAAG;IAC1D,IAAI,EAAE,MAAM,IAAI,CAAC;CAqBlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/auth-utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,0BAG5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-site",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"unpkg": true,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": {
|
|
@@ -37,20 +37,26 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
|
-
"@wix/
|
|
40
|
+
"@wix/monitoring-velo": "^0.8.0",
|
|
41
|
+
"@wix/sdk-runtime": "^0.3.62"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/jest": "^27.4.0",
|
|
44
45
|
"@types/node": "^16.0.0",
|
|
45
46
|
"@wix/eslint-config-yoshi": "^6.131.0",
|
|
46
47
|
"@wix/jest-yoshi-preset": "^6.131.0",
|
|
48
|
+
"@wix/sdk": "^1.15.27",
|
|
49
|
+
"@wix/sdk-types": "^1.13.41",
|
|
47
50
|
"@wix/yoshi-flow-library": "^6.141.0",
|
|
48
51
|
"chance": "^1.1.13",
|
|
49
52
|
"husky": "^4.2.1",
|
|
50
53
|
"lint-staged": "^10.5.4",
|
|
54
|
+
"msw": "^1.0.0",
|
|
55
|
+
"node-fetch": "^2.0.0",
|
|
51
56
|
"prettier": "^2.0.5",
|
|
52
57
|
"ts-jest": "^27.1.2",
|
|
53
|
-
"typescript": "~4.9.0"
|
|
58
|
+
"typescript": "~4.9.0",
|
|
59
|
+
"wix-eventually": "^2.3.0"
|
|
54
60
|
},
|
|
55
61
|
"jest": {
|
|
56
62
|
"preset": "@wix/jest-yoshi-preset"
|
|
@@ -78,5 +84,5 @@
|
|
|
78
84
|
"wallaby": {
|
|
79
85
|
"autoDetect": true
|
|
80
86
|
},
|
|
81
|
-
"falconPackageHash": "
|
|
87
|
+
"falconPackageHash": "fb1cb0925e02e92a9ab567486c02fb9de542fcce4c09108df5f4d42d"
|
|
82
88
|
}
|