@wix/headless-site 1.8.0 → 1.10.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 +12 -3
- package/dist/cjs/host-module.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/host-module.js +12 -3
- package/dist/esm/host-module.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/types/host-module.d.ts +3 -3
- package/dist/types/host-module.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +9 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/cjs/host-module.js
CHANGED
|
@@ -19,9 +19,18 @@ const createHostModule = () => {
|
|
|
19
19
|
get passThroughHeaders() {
|
|
20
20
|
return (0, _headers.getPassThroughHeaders)();
|
|
21
21
|
},
|
|
22
|
-
language
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
get language() {
|
|
23
|
+
var _window$essentials;
|
|
24
|
+
return (essentials == null ? void 0 : essentials.language) ?? ((_window$essentials = window.essentials) == null ? void 0 : _window$essentials.language) ?? 'en';
|
|
25
|
+
},
|
|
26
|
+
get locale() {
|
|
27
|
+
var _window$essentials2;
|
|
28
|
+
return (essentials == null ? void 0 : essentials.locale) ?? ((_window$essentials2 = window.essentials) == null ? void 0 : _window$essentials2.locale) ?? 'en-US';
|
|
29
|
+
},
|
|
30
|
+
get timezone() {
|
|
31
|
+
var _window$essentials3;
|
|
32
|
+
return (essentials == null ? void 0 : essentials.timezone) ?? ((_window$essentials3 = window.essentials) == null ? void 0 : _window$essentials3.timeZone) ?? 'UTC';
|
|
33
|
+
}
|
|
25
34
|
},
|
|
26
35
|
getMonitoringClient: () => {
|
|
27
36
|
let producer = 'unknown';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_monitoringVelo","require","_headers","_authUtils","createHostModule","__type","create","host","essentials","passThroughHeaders","getPassThroughHeaders","language","locale","timezone","getMonitoringClient","producer","req","document","location","href","Request","createVeloMonitoringClient","namespace","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 {SDK, SDKOptions} 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: ({ essentials }: SDKOptions = {}) => {\n return {\n essentials: {\n get passThroughHeaders() {\n return getPassThroughHeaders();\n },\n language
|
|
1
|
+
{"version":3,"names":["_monitoringVelo","require","_headers","_authUtils","createHostModule","__type","create","host","essentials","passThroughHeaders","getPassThroughHeaders","language","_window$essentials","window","locale","_window$essentials2","timezone","_window$essentials3","timeZone","getMonitoringClient","producer","req","document","location","href","Request","createVeloMonitoringClient","namespace","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, SDKOptions } from './types';\n\nexport const createHostModule = (): HostModule<SDK, Host> & {\n host: (options: SDKOptions) => Host;\n} => {\n return {\n __type: 'host',\n create: () => {\n return {};\n },\n host: ({ essentials }: SDKOptions = {}) => {\n return {\n essentials: {\n get passThroughHeaders() {\n return getPassThroughHeaders();\n },\n get language() {\n return essentials?.language ?? window.essentials?.language ?? 'en';\n },\n get locale() {\n return essentials?.locale ?? window.essentials?.locale ?? 'en-US';\n },\n get timezone() {\n return essentials?.timezone ?? window.essentials?.timeZone ?? 'UTC';\n },\n },\n getMonitoringClient: () => {\n let producer = 'unknown';\n let req: Request | undefined;\n\n if (typeof document !== 'undefined') {\n producer = document.location.href;\n req = new Request(document.location.href);\n }\n\n return createVeloMonitoringClient({\n namespace: 'Headless',\n producer,\n getAuthToken: async () => resolveAuthToken(),\n req,\n });\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,CAAC;MAAEC;IAAuB,CAAC,GAAG,CAAC,CAAC,KAAK;MACzC,OAAO;QACLA,UAAU,EAAE;UACV,IAAIC,kBAAkBA,CAAA,EAAG;YACvB,OAAO,IAAAC,8BAAqB,EAAC,CAAC;UAChC,CAAC;UACD,IAAIC,QAAQA,CAAA,EAAG;YAAA,IAAAC,kBAAA;YACb,OAAO,CAAAJ,UAAU,oBAAVA,UAAU,CAAEG,QAAQ,OAAAC,kBAAA,GAAIC,MAAM,CAACL,UAAU,qBAAjBI,kBAAA,CAAmBD,QAAQ,KAAI,IAAI;UACpE,CAAC;UACD,IAAIG,MAAMA,CAAA,EAAG;YAAA,IAAAC,mBAAA;YACX,OAAO,CAAAP,UAAU,oBAAVA,UAAU,CAAEM,MAAM,OAAAC,mBAAA,GAAIF,MAAM,CAACL,UAAU,qBAAjBO,mBAAA,CAAmBD,MAAM,KAAI,OAAO;UACnE,CAAC;UACD,IAAIE,QAAQA,CAAA,EAAG;YAAA,IAAAC,mBAAA;YACb,OAAO,CAAAT,UAAU,oBAAVA,UAAU,CAAEQ,QAAQ,OAAAC,mBAAA,GAAIJ,MAAM,CAACL,UAAU,qBAAjBS,mBAAA,CAAmBC,QAAQ,KAAI,KAAK;UACrE;QACF,CAAC;QACDC,mBAAmB,EAAEA,CAAA,KAAM;UACzB,IAAIC,QAAQ,GAAG,SAAS;UACxB,IAAIC,GAAwB;UAE5B,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;YACnCF,QAAQ,GAAGE,QAAQ,CAACC,QAAQ,CAACC,IAAI;YACjCH,GAAG,GAAG,IAAII,OAAO,CAACH,QAAQ,CAACC,QAAQ,CAACC,IAAI,CAAC;UAC3C;UAEA,OAAO,IAAAE,0CAA0B,EAAC;YAChCC,SAAS,EAAE,UAAU;YACrBP,QAAQ;YACRQ,YAAY,EAAE,MAAAA,CAAA,KAAY,IAAAC,2BAAgB,EAAC,CAAC;YAC5CR;UACF,CAAC,CAAC;QACJ;MACF,CAAC;IACH;EACF,CAAC;AACH,CAAC;AAACS,OAAA,CAAA1B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/types.ts"],"sourcesContent":["export type SDK = {};\n\nexport interface SDKOptions {\n essentials?: Essentials;\n}\n\nexport interface Essentials {\n language?: string;\n locale?: string;\n timezone?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/types.ts"],"sourcesContent":["export type SDK = {};\n\ndeclare global {\n interface Window {\n essentials: {\n language: string;\n locale?: string;\n timeZone?: string;\n };\n }\n}\n\nexport interface SDKOptions {\n essentials?: Essentials;\n}\n\nexport interface Essentials {\n language?: string;\n locale?: string;\n timezone?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
package/dist/esm/host-module.js
CHANGED
|
@@ -16,9 +16,18 @@ export const createHostModule = () => {
|
|
|
16
16
|
get passThroughHeaders() {
|
|
17
17
|
return getPassThroughHeaders();
|
|
18
18
|
},
|
|
19
|
-
language
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
get language() {
|
|
20
|
+
var _window$essentials;
|
|
21
|
+
return (essentials == null ? void 0 : essentials.language) ?? ((_window$essentials = window.essentials) == null ? void 0 : _window$essentials.language) ?? 'en';
|
|
22
|
+
},
|
|
23
|
+
get locale() {
|
|
24
|
+
var _window$essentials2;
|
|
25
|
+
return (essentials == null ? void 0 : essentials.locale) ?? ((_window$essentials2 = window.essentials) == null ? void 0 : _window$essentials2.locale) ?? 'en-US';
|
|
26
|
+
},
|
|
27
|
+
get timezone() {
|
|
28
|
+
var _window$essentials3;
|
|
29
|
+
return (essentials == null ? void 0 : essentials.timezone) ?? ((_window$essentials3 = window.essentials) == null ? void 0 : _window$essentials3.timeZone) ?? 'UTC';
|
|
30
|
+
}
|
|
22
31
|
},
|
|
23
32
|
getMonitoringClient: () => {
|
|
24
33
|
let producer = 'unknown';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createVeloMonitoringClient","getPassThroughHeaders","resolveAuthToken","createHostModule","__type","create","host","_temp","essentials","passThroughHeaders","language","locale","timezone","getMonitoringClient","producer","req","document","location","href","Request","namespace","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 {SDK, SDKOptions} 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: ({ essentials }: SDKOptions = {}) => {\n return {\n essentials: {\n get passThroughHeaders() {\n return getPassThroughHeaders();\n },\n language
|
|
1
|
+
{"version":3,"names":["createVeloMonitoringClient","getPassThroughHeaders","resolveAuthToken","createHostModule","__type","create","host","_temp","essentials","passThroughHeaders","language","_window$essentials","window","locale","_window$essentials2","timezone","_window$essentials3","timeZone","getMonitoringClient","producer","req","document","location","href","Request","namespace","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, SDKOptions } from './types';\n\nexport const createHostModule = (): HostModule<SDK, Host> & {\n host: (options: SDKOptions) => Host;\n} => {\n return {\n __type: 'host',\n create: () => {\n return {};\n },\n host: ({ essentials }: SDKOptions = {}) => {\n return {\n essentials: {\n get passThroughHeaders() {\n return getPassThroughHeaders();\n },\n get language() {\n return essentials?.language ?? window.essentials?.language ?? 'en';\n },\n get locale() {\n return essentials?.locale ?? window.essentials?.locale ?? 'en-US';\n },\n get timezone() {\n return essentials?.timezone ?? window.essentials?.timeZone ?? 'UTC';\n },\n },\n getMonitoringClient: () => {\n let producer = 'unknown';\n let req: Request | undefined;\n\n if (typeof document !== 'undefined') {\n producer = document.location.href;\n req = new Request(document.location.href);\n }\n\n return createVeloMonitoringClient({\n namespace: 'Headless',\n producer,\n getAuthToken: async () => resolveAuthToken(),\n req,\n });\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,EAAE,SAAAA,CAAAC,KAAA,EAAqC;MAAA,IAApC;QAAEC;MAAuB,CAAC,GAAAD,KAAA,cAAG,CAAC,CAAC,GAAAA,KAAA;MACpC,OAAO;QACLC,UAAU,EAAE;UACV,IAAIC,kBAAkBA,CAAA,EAAG;YACvB,OAAOR,qBAAqB,CAAC,CAAC;UAChC,CAAC;UACD,IAAIS,QAAQA,CAAA,EAAG;YAAA,IAAAC,kBAAA;YACb,OAAO,CAAAH,UAAU,oBAAVA,UAAU,CAAEE,QAAQ,OAAAC,kBAAA,GAAIC,MAAM,CAACJ,UAAU,qBAAjBG,kBAAA,CAAmBD,QAAQ,KAAI,IAAI;UACpE,CAAC;UACD,IAAIG,MAAMA,CAAA,EAAG;YAAA,IAAAC,mBAAA;YACX,OAAO,CAAAN,UAAU,oBAAVA,UAAU,CAAEK,MAAM,OAAAC,mBAAA,GAAIF,MAAM,CAACJ,UAAU,qBAAjBM,mBAAA,CAAmBD,MAAM,KAAI,OAAO;UACnE,CAAC;UACD,IAAIE,QAAQA,CAAA,EAAG;YAAA,IAAAC,mBAAA;YACb,OAAO,CAAAR,UAAU,oBAAVA,UAAU,CAAEO,QAAQ,OAAAC,mBAAA,GAAIJ,MAAM,CAACJ,UAAU,qBAAjBQ,mBAAA,CAAmBC,QAAQ,KAAI,KAAK;UACrE;QACF,CAAC;QACDC,mBAAmB,EAAEA,CAAA,KAAM;UACzB,IAAIC,QAAQ,GAAG,SAAS;UACxB,IAAIC,GAAwB;UAE5B,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;YACnCF,QAAQ,GAAGE,QAAQ,CAACC,QAAQ,CAACC,IAAI;YACjCH,GAAG,GAAG,IAAII,OAAO,CAACH,QAAQ,CAACC,QAAQ,CAACC,IAAI,CAAC;UAC3C;UAEA,OAAOvB,0BAA0B,CAAC;YAChCyB,SAAS,EAAE,UAAU;YACrBN,QAAQ;YACRO,YAAY,EAAE,MAAAA,CAAA,KAAYxB,gBAAgB,CAAC,CAAC;YAC5CkB;UACF,CAAC,CAAC;QACJ;MACF,CAAC;IACH;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/types.ts"],"sourcesContent":["export type SDK = {};\n\nexport interface SDKOptions {\n essentials?: Essentials;\n}\n\nexport interface Essentials {\n language?: string;\n locale?: string;\n timezone?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/types.ts"],"sourcesContent":["export type SDK = {};\n\ndeclare global {\n interface Window {\n essentials: {\n language: string;\n locale?: string;\n timeZone?: string;\n };\n }\n}\n\nexport interface SDKOptions {\n essentials?: Essentials;\n}\n\nexport interface Essentials {\n language?: string;\n locale?: string;\n timezone?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HostModule, Host } from '@wix/sdk-types';
|
|
2
|
-
import { SDK } from './types';
|
|
3
|
-
export declare const createHostModule: () => HostModule<SDK, Host
|
|
4
|
-
host: () => Host;
|
|
2
|
+
import type { SDK, SDKOptions } from './types';
|
|
3
|
+
export declare const createHostModule: () => HostModule<SDK, Host<unknown>> & {
|
|
4
|
+
host: (options: SDKOptions) => Host;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=host-module.d.ts.map
|
|
@@ -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;AAIvD,OAAO,
|
|
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,UAAU,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,gBAAgB;oBACX,UAAU,KAAK,IAAI;CA0CpC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const headlessSite: import("@wix/sdk-types").HostModule<import("./types").SDK, import("@wix/sdk-types").Host<unknown>> & {
|
|
2
|
-
host: () => import("@wix/sdk-types").Host<unknown>;
|
|
2
|
+
host: (options: import("./types").SDKOptions) => import("@wix/sdk-types").Host<unknown>;
|
|
3
3
|
};
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,GAAG,GAAG,EAAE,CAAC;AAErB,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,GAAG,GAAG,EAAE,CAAC;AAErB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM,CAAC;YACjB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB,CAAC;KACH;CACF;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-site",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"unpkg": true,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"wallaby": {
|
|
85
85
|
"autoDetect": true
|
|
86
86
|
},
|
|
87
|
-
"falconPackageHash": "
|
|
87
|
+
"falconPackageHash": "99a010a3f66b5890fd29409c43a5d9fc36d930b9378a6bd01106117c"
|
|
88
88
|
}
|