@builder.io/sdk-svelte 2.0.31 → 3.0.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.
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.31";
1
+ export declare const SDK_VERSION = "3.0.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.0.31";
1
+ export const SDK_VERSION = "3.0.0";
@@ -14,5 +14,5 @@ export declare const _processContentResult: (options: GetContentOptions, content
14
14
  /**
15
15
  * Returns a paginated array of entries that match the given options.
16
16
  */
17
- export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[] | null>;
17
+ export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[]>;
18
18
  export {};
@@ -78,21 +78,15 @@ export const _processContentResult = async (options, content, url = generateCont
78
78
  * Returns a paginated array of entries that match the given options.
79
79
  */
80
80
  export async function fetchEntries(options) {
81
- try {
82
- const url = generateContentUrl(options);
83
- const content = await _fetchContent(options);
84
- if (!checkContentHasResults(content)) {
85
- logger.error('Error fetching data. ', {
86
- url,
87
- content,
88
- options
89
- });
90
- return null;
91
- }
92
- return _processContentResult(options, content);
93
- }
94
- catch (error) {
95
- logger.error('Error fetching data. ', error);
96
- return null;
81
+ const url = generateContentUrl(options);
82
+ const content = await _fetchContent(options);
83
+ if (!checkContentHasResults(content)) {
84
+ logger.error('Error fetching data. ', {
85
+ url,
86
+ content,
87
+ options
88
+ });
89
+ throw content;
97
90
  }
91
+ return _processContentResult(options, content);
98
92
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.31";
1
+ export declare const SDK_VERSION = "3.0.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.0.31";
1
+ export const SDK_VERSION = "3.0.0";
@@ -14,5 +14,5 @@ export declare const _processContentResult: (options: GetContentOptions, content
14
14
  /**
15
15
  * Returns a paginated array of entries that match the given options.
16
16
  */
17
- export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[] | null>;
17
+ export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[]>;
18
18
  export {};
@@ -78,21 +78,15 @@ export const _processContentResult = async (options, content, url = generateCont
78
78
  * Returns a paginated array of entries that match the given options.
79
79
  */
80
80
  export async function fetchEntries(options) {
81
- try {
82
- const url = generateContentUrl(options);
83
- const content = await _fetchContent(options);
84
- if (!checkContentHasResults(content)) {
85
- logger.error('Error fetching data. ', {
86
- url,
87
- content,
88
- options
89
- });
90
- return null;
91
- }
92
- return _processContentResult(options, content);
93
- }
94
- catch (error) {
95
- logger.error('Error fetching data. ', error);
96
- return null;
81
+ const url = generateContentUrl(options);
82
+ const content = await _fetchContent(options);
83
+ if (!checkContentHasResults(content)) {
84
+ logger.error('Error fetching data. ', {
85
+ url,
86
+ content,
87
+ options
88
+ });
89
+ throw content;
97
90
  }
91
+ return _processContentResult(options, content);
98
92
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.31";
1
+ export declare const SDK_VERSION = "3.0.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.0.31";
1
+ export const SDK_VERSION = "3.0.0";
@@ -14,5 +14,5 @@ export declare const _processContentResult: (options: GetContentOptions, content
14
14
  /**
15
15
  * Returns a paginated array of entries that match the given options.
16
16
  */
17
- export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[] | null>;
17
+ export declare function fetchEntries(options: GetContentOptions): Promise<BuilderContent[]>;
18
18
  export {};
@@ -78,21 +78,15 @@ export const _processContentResult = async (options, content, url = generateCont
78
78
  * Returns a paginated array of entries that match the given options.
79
79
  */
80
80
  export async function fetchEntries(options) {
81
- try {
82
- const url = generateContentUrl(options);
83
- const content = await _fetchContent(options);
84
- if (!checkContentHasResults(content)) {
85
- logger.error('Error fetching data. ', {
86
- url,
87
- content,
88
- options
89
- });
90
- return null;
91
- }
92
- return _processContentResult(options, content);
93
- }
94
- catch (error) {
95
- logger.error('Error fetching data. ', error);
96
- return null;
81
+ const url = generateContentUrl(options);
82
+ const content = await _fetchContent(options);
83
+ if (!checkContentHasResults(content)) {
84
+ logger.error('Error fetching data. ', {
85
+ url,
86
+ content,
87
+ options
88
+ });
89
+ throw content;
97
90
  }
91
+ return _processContentResult(options, content);
98
92
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "2.0.31",
4
+ "version": "3.0.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "lib",
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.0.31"
1
+ export const SDK_VERSION = "3.0.0"
@@ -88,20 +88,15 @@ export const _processContentResult = async (options: GetContentOptions, content:
88
88
  * Returns a paginated array of entries that match the given options.
89
89
  */
90
90
  export async function fetchEntries(options: GetContentOptions) {
91
- try {
92
- const url = generateContentUrl(options);
93
- const content = await _fetchContent(options);
94
- if (!checkContentHasResults(content)) {
95
- logger.error('Error fetching data. ', {
96
- url,
97
- content,
98
- options
99
- });
100
- return null;
101
- }
102
- return _processContentResult(options, content);
103
- } catch (error) {
104
- logger.error('Error fetching data. ', error);
105
- return null;
91
+ const url = generateContentUrl(options);
92
+ const content = await _fetchContent(options);
93
+ if (!checkContentHasResults(content)) {
94
+ logger.error('Error fetching data. ', {
95
+ url,
96
+ content,
97
+ options
98
+ });
99
+ throw content;
106
100
  }
101
+ return _processContentResult(options, content);
107
102
  }