@builder.io/sdk-svelte 0.9.0 → 0.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/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.d.ts +2 -2
- package/lib/browser/functions/get-content/index.js +4 -4
- 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.d.ts +2 -2
- package/lib/edge/functions/get-content/index.js +4 -4
- 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.d.ts +2 -2
- package/lib/node/functions/get-content/index.js +4 -4
- package/package.json +1 -1
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/get-content/index.ts +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.10.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.
|
|
1
|
+
export const SDK_VERSION = "0.10.0";
|
|
@@ -16,11 +16,11 @@ type ContentResults = {
|
|
|
16
16
|
/**
|
|
17
17
|
* @internal Exported only for testing purposes. Do not use.
|
|
18
18
|
*/
|
|
19
|
-
export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<
|
|
19
|
+
export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<BuilderContent[]>;
|
|
20
20
|
/**
|
|
21
21
|
* Returns a paginated array of entries that match the given options.
|
|
22
22
|
*/
|
|
23
|
-
export declare function fetchEntries(options: GetContentOptions): Promise<
|
|
23
|
+
export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[] | null>;
|
|
24
24
|
/**
|
|
25
25
|
* @deprecated `getAllContent` was renamed to `fetchEntries`. This is a temporary alias to avoid breaking changes.
|
|
26
26
|
*/
|
|
@@ -16,7 +16,7 @@ export async function fetchOneEntry(options) {
|
|
|
16
16
|
limit: 1
|
|
17
17
|
});
|
|
18
18
|
if (allContent) {
|
|
19
|
-
return allContent
|
|
19
|
+
return allContent[0] || null;
|
|
20
20
|
}
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
@@ -47,9 +47,9 @@ export const _processContentResult = async (options, content, url = generateCont
|
|
|
47
47
|
content.results = newResults;
|
|
48
48
|
}
|
|
49
49
|
if (!canTrack)
|
|
50
|
-
return content;
|
|
50
|
+
return content.results;
|
|
51
51
|
if (!(isBrowser() || TARGET === 'reactNative'))
|
|
52
|
-
return content;
|
|
52
|
+
return content.results;
|
|
53
53
|
/**
|
|
54
54
|
* For client-side navigations, it is ideal to handle AB testing at this point instead of using our
|
|
55
55
|
* complex multi-rendering variants approach, which is only needed for SSR'd content.
|
|
@@ -69,7 +69,7 @@ export const _processContentResult = async (options, content, url = generateCont
|
|
|
69
69
|
catch (e) {
|
|
70
70
|
logger.error('Could not process A/B tests. ', e);
|
|
71
71
|
}
|
|
72
|
-
return content;
|
|
72
|
+
return content.results;
|
|
73
73
|
};
|
|
74
74
|
/**
|
|
75
75
|
* Returns a paginated array of entries that match the given options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.10.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.
|
|
1
|
+
export const SDK_VERSION = "0.10.0";
|
|
@@ -16,11 +16,11 @@ type ContentResults = {
|
|
|
16
16
|
/**
|
|
17
17
|
* @internal Exported only for testing purposes. Do not use.
|
|
18
18
|
*/
|
|
19
|
-
export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<
|
|
19
|
+
export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<BuilderContent[]>;
|
|
20
20
|
/**
|
|
21
21
|
* Returns a paginated array of entries that match the given options.
|
|
22
22
|
*/
|
|
23
|
-
export declare function fetchEntries(options: GetContentOptions): Promise<
|
|
23
|
+
export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[] | null>;
|
|
24
24
|
/**
|
|
25
25
|
* @deprecated `getAllContent` was renamed to `fetchEntries`. This is a temporary alias to avoid breaking changes.
|
|
26
26
|
*/
|
|
@@ -16,7 +16,7 @@ export async function fetchOneEntry(options) {
|
|
|
16
16
|
limit: 1
|
|
17
17
|
});
|
|
18
18
|
if (allContent) {
|
|
19
|
-
return allContent
|
|
19
|
+
return allContent[0] || null;
|
|
20
20
|
}
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
@@ -47,9 +47,9 @@ export const _processContentResult = async (options, content, url = generateCont
|
|
|
47
47
|
content.results = newResults;
|
|
48
48
|
}
|
|
49
49
|
if (!canTrack)
|
|
50
|
-
return content;
|
|
50
|
+
return content.results;
|
|
51
51
|
if (!(isBrowser() || TARGET === 'reactNative'))
|
|
52
|
-
return content;
|
|
52
|
+
return content.results;
|
|
53
53
|
/**
|
|
54
54
|
* For client-side navigations, it is ideal to handle AB testing at this point instead of using our
|
|
55
55
|
* complex multi-rendering variants approach, which is only needed for SSR'd content.
|
|
@@ -69,7 +69,7 @@ export const _processContentResult = async (options, content, url = generateCont
|
|
|
69
69
|
catch (e) {
|
|
70
70
|
logger.error('Could not process A/B tests. ', e);
|
|
71
71
|
}
|
|
72
|
-
return content;
|
|
72
|
+
return content.results;
|
|
73
73
|
};
|
|
74
74
|
/**
|
|
75
75
|
* Returns a paginated array of entries that match the given options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.10.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.
|
|
1
|
+
export const SDK_VERSION = "0.10.0";
|
|
@@ -16,11 +16,11 @@ type ContentResults = {
|
|
|
16
16
|
/**
|
|
17
17
|
* @internal Exported only for testing purposes. Do not use.
|
|
18
18
|
*/
|
|
19
|
-
export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<
|
|
19
|
+
export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<BuilderContent[]>;
|
|
20
20
|
/**
|
|
21
21
|
* Returns a paginated array of entries that match the given options.
|
|
22
22
|
*/
|
|
23
|
-
export declare function fetchEntries(options: GetContentOptions): Promise<
|
|
23
|
+
export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[] | null>;
|
|
24
24
|
/**
|
|
25
25
|
* @deprecated `getAllContent` was renamed to `fetchEntries`. This is a temporary alias to avoid breaking changes.
|
|
26
26
|
*/
|
|
@@ -16,7 +16,7 @@ export async function fetchOneEntry(options) {
|
|
|
16
16
|
limit: 1
|
|
17
17
|
});
|
|
18
18
|
if (allContent) {
|
|
19
|
-
return allContent
|
|
19
|
+
return allContent[0] || null;
|
|
20
20
|
}
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
@@ -47,9 +47,9 @@ export const _processContentResult = async (options, content, url = generateCont
|
|
|
47
47
|
content.results = newResults;
|
|
48
48
|
}
|
|
49
49
|
if (!canTrack)
|
|
50
|
-
return content;
|
|
50
|
+
return content.results;
|
|
51
51
|
if (!(isBrowser() || TARGET === 'reactNative'))
|
|
52
|
-
return content;
|
|
52
|
+
return content.results;
|
|
53
53
|
/**
|
|
54
54
|
* For client-side navigations, it is ideal to handle AB testing at this point instead of using our
|
|
55
55
|
* complex multi-rendering variants approach, which is only needed for SSR'd content.
|
|
@@ -69,7 +69,7 @@ export const _processContentResult = async (options, content, url = generateCont
|
|
|
69
69
|
catch (e) {
|
|
70
70
|
logger.error('Could not process A/B tests. ', e);
|
|
71
71
|
}
|
|
72
|
-
return content;
|
|
72
|
+
return content.results;
|
|
73
73
|
};
|
|
74
74
|
/**
|
|
75
75
|
* Returns a paginated array of entries that match the given options.
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.
|
|
1
|
+
export const SDK_VERSION = "0.10.0"
|
|
@@ -19,7 +19,7 @@ export async function fetchOneEntry(options: GetContentOptions): Promise<Builder
|
|
|
19
19
|
limit: 1
|
|
20
20
|
});
|
|
21
21
|
if (allContent) {
|
|
22
|
-
return allContent
|
|
22
|
+
return allContent[0] || null;
|
|
23
23
|
}
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
@@ -47,7 +47,7 @@ const _fetchContent = async (options: GetContentOptions) => {
|
|
|
47
47
|
/**
|
|
48
48
|
* @internal Exported only for testing purposes. Do not use.
|
|
49
49
|
*/
|
|
50
|
-
export const _processContentResult = async (options: GetContentOptions, content: ContentResults, url: URL = generateContentUrl(options)) => {
|
|
50
|
+
export const _processContentResult = async (options: GetContentOptions, content: ContentResults, url: URL = generateContentUrl(options)): Promise<BuilderContent[]> => {
|
|
51
51
|
const canTrack = getDefaultCanTrack(options.canTrack);
|
|
52
52
|
const isPreviewing = url.search.includes(`preview=`);
|
|
53
53
|
if (TARGET === 'rsc' && isPreviewing) {
|
|
@@ -58,8 +58,8 @@ export const _processContentResult = async (options: GetContentOptions, content:
|
|
|
58
58
|
}
|
|
59
59
|
content.results = newResults;
|
|
60
60
|
}
|
|
61
|
-
if (!canTrack) return content;
|
|
62
|
-
if (!(isBrowser() || TARGET === 'reactNative')) return content;
|
|
61
|
+
if (!canTrack) return content.results;
|
|
62
|
+
if (!(isBrowser() || TARGET === 'reactNative')) return content.results;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* For client-side navigations, it is ideal to handle AB testing at this point instead of using our
|
|
@@ -79,7 +79,7 @@ export const _processContentResult = async (options: GetContentOptions, content:
|
|
|
79
79
|
} catch (e) {
|
|
80
80
|
logger.error('Could not process A/B tests. ', e);
|
|
81
81
|
}
|
|
82
|
-
return content;
|
|
82
|
+
return content.results;
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
/**
|