@wix/headless-site 1.6.0 → 1.8.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.
@@ -11,15 +11,17 @@ const createHostModule = () => {
11
11
  create: () => {
12
12
  return {};
13
13
  },
14
- host: () => {
14
+ host: ({
15
+ essentials
16
+ } = {}) => {
15
17
  return {
16
18
  essentials: {
17
19
  get passThroughHeaders() {
18
20
  return (0, _headers.getPassThroughHeaders)();
19
21
  },
20
- language: 'en',
21
- locale: 'en-US',
22
- timezone: 'UTC'
22
+ language: (essentials == null ? void 0 : essentials.language) ?? 'en',
23
+ locale: (essentials == null ? void 0 : essentials.locale) ?? 'en-US',
24
+ timezone: (essentials == null ? void 0 : essentials.timezone) ?? 'UTC'
23
25
  },
24
26
  getMonitoringClient: () => {
25
27
  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 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 language: 'en',\n locale: 'en-US',\n timezone: 'UTC',\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,CAAA,KAAM;MACV,OAAO;QACLC,UAAU,EAAE;UACV,IAAIC,kBAAkBA,CAAA,EAAG;YACvB,OAAO,IAAAC,8BAAqB,EAAC,CAAC;UAChC,CAAC;UACDC,QAAQ,EAAE,IAAI;UACdC,MAAM,EAAE,OAAO;UACfC,QAAQ,EAAE;QACZ,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,CAAArB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
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: essentials?.language ?? 'en',\n locale: essentials?.locale ?? 'en-US',\n timezone: essentials?.timezone ?? 'UTC',\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;UACDC,QAAQ,EAAE,CAAAH,UAAU,oBAAVA,UAAU,CAAEG,QAAQ,KAAI,IAAI;UACtCC,MAAM,EAAE,CAAAJ,UAAU,oBAAVA,UAAU,CAAEI,MAAM,KAAI,OAAO;UACrCC,QAAQ,EAAE,CAAAL,UAAU,oBAAVA,UAAU,CAAEK,QAAQ,KAAI;QACpC,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,CAAArB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/types.ts"],"sourcesContent":["export type SDK = {};\n"],"mappings":"","ignoreList":[]}
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":[]}
@@ -7,15 +7,18 @@ export const createHostModule = () => {
7
7
  create: () => {
8
8
  return {};
9
9
  },
10
- host: () => {
10
+ host: function (_temp) {
11
+ let {
12
+ essentials
13
+ } = _temp === void 0 ? {} : _temp;
11
14
  return {
12
15
  essentials: {
13
16
  get passThroughHeaders() {
14
17
  return getPassThroughHeaders();
15
18
  },
16
- language: 'en',
17
- locale: 'en-US',
18
- timezone: 'UTC'
19
+ language: (essentials == null ? void 0 : essentials.language) ?? 'en',
20
+ locale: (essentials == null ? void 0 : essentials.locale) ?? 'en-US',
21
+ timezone: (essentials == null ? void 0 : essentials.timezone) ?? 'UTC'
19
22
  },
20
23
  getMonitoringClient: () => {
21
24
  let producer = 'unknown';
@@ -1 +1 @@
1
- {"version":3,"names":["createVeloMonitoringClient","getPassThroughHeaders","resolveAuthToken","createHostModule","__type","create","host","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 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 language: 'en',\n locale: 'en-US',\n timezone: 'UTC',\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,EAAEA,CAAA,KAAM;MACV,OAAO;QACLC,UAAU,EAAE;UACV,IAAIC,kBAAkBA,CAAA,EAAG;YACvB,OAAOP,qBAAqB,CAAC,CAAC;UAChC,CAAC;UACDQ,QAAQ,EAAE,IAAI;UACdC,MAAM,EAAE,OAAO;UACfC,QAAQ,EAAE;QACZ,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,OAAOjB,0BAA0B,CAAC;YAChCmB,SAAS,EAAE,UAAU;YACrBN,QAAQ;YACRO,YAAY,EAAE,MAAAA,CAAA,KAAYlB,gBAAgB,CAAC,CAAC;YAC5CY;UACF,CAAC,CAAC;QACJ;MACF,CAAC;IACH;EACF,CAAC;AACH,CAAC","ignoreList":[]}
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: essentials?.language ?? 'en',\n locale: essentials?.locale ?? 'en-US',\n timezone: essentials?.timezone ?? 'UTC',\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,SA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.ts"],"sourcesContent":["export type SDK = {};\n"],"mappings":"","ignoreList":[]}
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,5 +1,5 @@
1
1
  import type { HostModule, Host } from '@wix/sdk-types';
2
- import type { SDK } from './types';
2
+ import { SDK } from './types';
3
3
  export declare const createHostModule: () => HostModule<SDK, Host> & {
4
4
  host: () => Host;
5
5
  };
@@ -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,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,gBAAgB,QAAO,WAAW,GAAG,EAAE,IAAI,CAAC,GAAG;IAC1D,IAAI,EAAE,MAAM,IAAI,CAAC;CAoClB,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,EAAC,GAAG,EAAa,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,gBAAgB,QAAO,WAAW,GAAG,EAAE,IAAI,CAAC,GAAG;IAC1D,IAAI,EAAE,MAAM,IAAI,CAAC;CAoClB,CAAC"}
@@ -1,2 +1,10 @@
1
1
  export declare type SDK = {};
2
+ export interface SDKOptions {
3
+ essentials?: Essentials;
4
+ }
5
+ export interface Essentials {
6
+ language?: string;
7
+ locale?: string;
8
+ timezone?: string;
9
+ }
2
10
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,GAAG,GAAG,EAAE,CAAC"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-site",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "unpkg": true,
5
5
  "license": "UNLICENSED",
6
6
  "author": {
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@babel/runtime": "^7.0.0",
40
- "@wix/monitoring-velo": "^1.5.0",
40
+ "@wix/monitoring-velo": "^1.6.0",
41
41
  "@wix/sdk-runtime": "^0.3.62"
42
42
  },
43
43
  "devDependencies": {
@@ -84,5 +84,5 @@
84
84
  "wallaby": {
85
85
  "autoDetect": true
86
86
  },
87
- "falconPackageHash": "effabd606f5c4aa4e8ca3db3a804c0c05adaebeb0cb639c2f02ad317"
87
+ "falconPackageHash": "e04b1870c489a6db3685e4347210a28537b6200d511c8a372b12f4c6"
88
88
  }