@builder.io/sdk-svelte 0.0.9-0 → 0.0.9-1

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.0.8",
4
+ "version": "0.0.9-0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "package",
@@ -3,7 +3,7 @@ import { getBuilderSearchParamsFromWindow, normalizeSearchParams, } from '../get
3
3
  import { getFetch } from '../get-fetch.js';
4
4
  import { handleABTesting } from './ab-testing.js';
5
5
  export async function getContent(options) {
6
- return (await getAllContent({ ...options, limit: 1 })).results[0] || null;
6
+ return (await getAllContent({ ...options, single: true })) || null;
7
7
  }
8
8
  export const generateContentUrl = (options) => {
9
9
  const { limit = 30, userAttributes, query, noTraverse = false, model, apiKey, includeRefs = true, } = options;
@@ -32,4 +32,12 @@ export interface GetContentOptions {
32
32
  * Include references in the response. Defaults to `true`.
33
33
  */
34
34
  includeRefs?: boolean;
35
+ /**
36
+ * Returns a single content match
37
+ */
38
+ single?: boolean;
39
+ /**
40
+ * If passed , the API will aut-resolve localized objects to the value of this locale key
41
+ */
42
+ locale?: string;
35
43
  }
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": "0.0.9-0",
4
+ "version": "0.0.9-1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "package",
@@ -12,7 +12,7 @@ export type GetContentOptions = import('./types.js').GetContentOptions;
12
12
  export async function getContent(
13
13
  options: GetContentOptions
14
14
  ): Promise<BuilderContent | null> {
15
- return (await getAllContent({ ...options, limit: 1 })).results[0] || null;
15
+ return (await getAllContent({ ...options, single: true })) || null;
16
16
  }
17
17
 
18
18
  export const generateContentUrl = (options: GetContentOptions): URL => {
@@ -38,4 +38,14 @@ export interface GetContentOptions {
38
38
  * Include references in the response. Defaults to `true`.
39
39
  */
40
40
  includeRefs?: boolean;
41
+
42
+ /**
43
+ * Returns a single content match
44
+ */
45
+ single?: boolean;
46
+
47
+ /**
48
+ * If passed , the API will aut-resolve localized objects to the value of this locale key
49
+ */
50
+ locale?: string;
41
51
  }