@builder.io/sdk-svelte 2.0.24 → 2.0.25
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/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/functions/get-content/index.js +9 -1
- package/lib/browser/functions/track/index.js +3 -1
- package/lib/browser/helpers/sdk-headers.d.ts +5 -0
- package/lib/browser/helpers/sdk-headers.js +7 -0
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/functions/get-content/index.js +9 -1
- package/lib/edge/functions/track/index.js +3 -1
- package/lib/edge/helpers/sdk-headers.d.ts +5 -0
- package/lib/edge/helpers/sdk-headers.js +7 -0
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/functions/get-content/index.js +9 -1
- package/lib/node/functions/track/index.js +3 -1
- package/lib/node/helpers/sdk-headers.d.ts +5 -0
- package/lib/node/helpers/sdk-headers.js +7 -0
- package/package.json +1 -1
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/get-content/index.ts +9 -1
- package/src/functions/track/index.ts +3 -1
- package/src/helpers/sdk-headers.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.25";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.0.
|
|
1
|
+
export const SDK_VERSION = "2.0.25";
|
|
@@ -3,6 +3,7 @@ import { handleABTesting } from '../../helpers/ab-tests';
|
|
|
3
3
|
import { getDefaultCanTrack } from '../../helpers/canTrack';
|
|
4
4
|
import { logger } from '../../helpers/logger';
|
|
5
5
|
import { getPreviewContent } from '../../helpers/preview-lru-cache/get';
|
|
6
|
+
import { getSdkHeaders } from '../../helpers/sdk-headers';
|
|
6
7
|
import { fetch } from '../get-fetch';
|
|
7
8
|
import { isBrowser } from '../is-browser';
|
|
8
9
|
import { generateContentUrl } from './generate-content-url';
|
|
@@ -23,7 +24,14 @@ export async function fetchOneEntry(options) {
|
|
|
23
24
|
const _fetchContent = async (options) => {
|
|
24
25
|
const url = generateContentUrl(options);
|
|
25
26
|
const _fetch = options.fetch ?? fetch;
|
|
26
|
-
const
|
|
27
|
+
const fetchOptions = {
|
|
28
|
+
...options.fetchOptions,
|
|
29
|
+
headers: {
|
|
30
|
+
...options.fetchOptions?.headers,
|
|
31
|
+
...getSdkHeaders()
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const res = await _fetch(url.href, fetchOptions);
|
|
27
35
|
const content = await res.json();
|
|
28
36
|
return content;
|
|
29
37
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TARGET } from '../../constants/target';
|
|
2
2
|
import { logger } from '../../helpers/logger';
|
|
3
|
+
import { getSdkHeaders } from '../../helpers/sdk-headers';
|
|
3
4
|
import { getSessionId } from '../../helpers/sessionId';
|
|
4
5
|
import { getVisitorId } from '../../helpers/visitorId';
|
|
5
6
|
import { isBrowser } from '../is-browser';
|
|
@@ -58,7 +59,8 @@ export async function _track(eventProps) {
|
|
|
58
59
|
events: [await createEvent(eventProps)]
|
|
59
60
|
}),
|
|
60
61
|
headers: {
|
|
61
|
-
'content-type': 'application/json'
|
|
62
|
+
'content-type': 'application/json',
|
|
63
|
+
...getSdkHeaders()
|
|
62
64
|
},
|
|
63
65
|
mode: 'cors'
|
|
64
66
|
}).catch(err => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.25";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.0.
|
|
1
|
+
export const SDK_VERSION = "2.0.25";
|
|
@@ -3,6 +3,7 @@ import { handleABTesting } from '../../helpers/ab-tests';
|
|
|
3
3
|
import { getDefaultCanTrack } from '../../helpers/canTrack';
|
|
4
4
|
import { logger } from '../../helpers/logger';
|
|
5
5
|
import { getPreviewContent } from '../../helpers/preview-lru-cache/get';
|
|
6
|
+
import { getSdkHeaders } from '../../helpers/sdk-headers';
|
|
6
7
|
import { fetch } from '../get-fetch';
|
|
7
8
|
import { isBrowser } from '../is-browser';
|
|
8
9
|
import { generateContentUrl } from './generate-content-url';
|
|
@@ -23,7 +24,14 @@ export async function fetchOneEntry(options) {
|
|
|
23
24
|
const _fetchContent = async (options) => {
|
|
24
25
|
const url = generateContentUrl(options);
|
|
25
26
|
const _fetch = options.fetch ?? fetch;
|
|
26
|
-
const
|
|
27
|
+
const fetchOptions = {
|
|
28
|
+
...options.fetchOptions,
|
|
29
|
+
headers: {
|
|
30
|
+
...options.fetchOptions?.headers,
|
|
31
|
+
...getSdkHeaders()
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const res = await _fetch(url.href, fetchOptions);
|
|
27
35
|
const content = await res.json();
|
|
28
36
|
return content;
|
|
29
37
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TARGET } from '../../constants/target';
|
|
2
2
|
import { logger } from '../../helpers/logger';
|
|
3
|
+
import { getSdkHeaders } from '../../helpers/sdk-headers';
|
|
3
4
|
import { getSessionId } from '../../helpers/sessionId';
|
|
4
5
|
import { getVisitorId } from '../../helpers/visitorId';
|
|
5
6
|
import { isBrowser } from '../is-browser';
|
|
@@ -58,7 +59,8 @@ export async function _track(eventProps) {
|
|
|
58
59
|
events: [await createEvent(eventProps)]
|
|
59
60
|
}),
|
|
60
61
|
headers: {
|
|
61
|
-
'content-type': 'application/json'
|
|
62
|
+
'content-type': 'application/json',
|
|
63
|
+
...getSdkHeaders()
|
|
62
64
|
},
|
|
63
65
|
mode: 'cors'
|
|
64
66
|
}).catch(err => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.25";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.0.
|
|
1
|
+
export const SDK_VERSION = "2.0.25";
|
|
@@ -3,6 +3,7 @@ import { handleABTesting } from '../../helpers/ab-tests';
|
|
|
3
3
|
import { getDefaultCanTrack } from '../../helpers/canTrack';
|
|
4
4
|
import { logger } from '../../helpers/logger';
|
|
5
5
|
import { getPreviewContent } from '../../helpers/preview-lru-cache/get';
|
|
6
|
+
import { getSdkHeaders } from '../../helpers/sdk-headers';
|
|
6
7
|
import { fetch } from '../get-fetch';
|
|
7
8
|
import { isBrowser } from '../is-browser';
|
|
8
9
|
import { generateContentUrl } from './generate-content-url';
|
|
@@ -23,7 +24,14 @@ export async function fetchOneEntry(options) {
|
|
|
23
24
|
const _fetchContent = async (options) => {
|
|
24
25
|
const url = generateContentUrl(options);
|
|
25
26
|
const _fetch = options.fetch ?? fetch;
|
|
26
|
-
const
|
|
27
|
+
const fetchOptions = {
|
|
28
|
+
...options.fetchOptions,
|
|
29
|
+
headers: {
|
|
30
|
+
...options.fetchOptions?.headers,
|
|
31
|
+
...getSdkHeaders()
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const res = await _fetch(url.href, fetchOptions);
|
|
27
35
|
const content = await res.json();
|
|
28
36
|
return content;
|
|
29
37
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TARGET } from '../../constants/target';
|
|
2
2
|
import { logger } from '../../helpers/logger';
|
|
3
|
+
import { getSdkHeaders } from '../../helpers/sdk-headers';
|
|
3
4
|
import { getSessionId } from '../../helpers/sessionId';
|
|
4
5
|
import { getVisitorId } from '../../helpers/visitorId';
|
|
5
6
|
import { isBrowser } from '../is-browser';
|
|
@@ -58,7 +59,8 @@ export async function _track(eventProps) {
|
|
|
58
59
|
events: [await createEvent(eventProps)]
|
|
59
60
|
}),
|
|
60
61
|
headers: {
|
|
61
|
-
'content-type': 'application/json'
|
|
62
|
+
'content-type': 'application/json',
|
|
63
|
+
...getSdkHeaders()
|
|
62
64
|
},
|
|
63
65
|
mode: 'cors'
|
|
64
66
|
}).catch(err => {
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.0.
|
|
1
|
+
export const SDK_VERSION = "2.0.25"
|
|
@@ -3,6 +3,7 @@ import { handleABTesting } from '../../helpers/ab-tests';
|
|
|
3
3
|
import { getDefaultCanTrack } from '../../helpers/canTrack';
|
|
4
4
|
import { logger } from '../../helpers/logger';
|
|
5
5
|
import { getPreviewContent } from '../../helpers/preview-lru-cache/get';
|
|
6
|
+
import { getSdkHeaders } from '../../helpers/sdk-headers';
|
|
6
7
|
import type { BuilderContent } from '../../types/builder-content';
|
|
7
8
|
import { fetch } from '../get-fetch';
|
|
8
9
|
import { isBrowser } from '../is-browser';
|
|
@@ -33,7 +34,14 @@ type ContentResponse = ContentResults | {
|
|
|
33
34
|
const _fetchContent = async (options: GetContentOptions) => {
|
|
34
35
|
const url = generateContentUrl(options);
|
|
35
36
|
const _fetch = options.fetch ?? fetch;
|
|
36
|
-
const
|
|
37
|
+
const fetchOptions = {
|
|
38
|
+
...options.fetchOptions,
|
|
39
|
+
headers: {
|
|
40
|
+
...(options.fetchOptions as any)?.headers,
|
|
41
|
+
...getSdkHeaders()
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const res = await _fetch(url.href, fetchOptions);
|
|
37
45
|
const content = await (res.json() as Promise<ContentResponse>);
|
|
38
46
|
return content;
|
|
39
47
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TARGET } from '../../constants/target';
|
|
2
2
|
import { logger } from '../../helpers/logger';
|
|
3
|
+
import { getSdkHeaders } from '../../helpers/sdk-headers';
|
|
3
4
|
import { getSessionId } from '../../helpers/sessionId';
|
|
4
5
|
import { getVisitorId } from '../../helpers/visitorId';
|
|
5
6
|
import type { CanTrack } from '../../types/can-track';
|
|
@@ -118,7 +119,8 @@ export async function _track(eventProps: EventProps) {
|
|
|
118
119
|
events: [await createEvent(eventProps)]
|
|
119
120
|
}),
|
|
120
121
|
headers: {
|
|
121
|
-
'content-type': 'application/json'
|
|
122
|
+
'content-type': 'application/json',
|
|
123
|
+
...getSdkHeaders()
|
|
122
124
|
},
|
|
123
125
|
mode: 'cors'
|
|
124
126
|
}).catch(err => {
|