@bettercms-ai/sdk 1.26.0 → 1.26.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.
- package/dist/index.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1134,7 +1134,11 @@ interface CreateClientOptions {
|
|
|
1134
1134
|
workspace: string;
|
|
1135
1135
|
/** Delivery API key. Use a `content:read:draft` key for drafts. */
|
|
1136
1136
|
apiKey?: string;
|
|
1137
|
-
/**
|
|
1137
|
+
/**
|
|
1138
|
+
* The project every read is addressed to. A workspace holds many projects whose slugs
|
|
1139
|
+
* collide (each has a `blog` model and a `home` page), so a site names its own; published
|
|
1140
|
+
* reads need no key for it. BetterCMS hosting supplies `PUBLIC_BCMS_PROJECT_ID`.
|
|
1141
|
+
*/
|
|
1138
1142
|
projectId?: string;
|
|
1139
1143
|
/** `published` (default) or `drafts`. */
|
|
1140
1144
|
perspective?: Perspective;
|
package/dist/index.d.ts
CHANGED
|
@@ -1134,7 +1134,11 @@ interface CreateClientOptions {
|
|
|
1134
1134
|
workspace: string;
|
|
1135
1135
|
/** Delivery API key. Use a `content:read:draft` key for drafts. */
|
|
1136
1136
|
apiKey?: string;
|
|
1137
|
-
/**
|
|
1137
|
+
/**
|
|
1138
|
+
* The project every read is addressed to. A workspace holds many projects whose slugs
|
|
1139
|
+
* collide (each has a `blog` model and a `home` page), so a site names its own; published
|
|
1140
|
+
* reads need no key for it. BetterCMS hosting supplies `PUBLIC_BCMS_PROJECT_ID`.
|
|
1141
|
+
*/
|
|
1138
1142
|
projectId?: string;
|
|
1139
1143
|
/** `published` (default) or `drafts`. */
|
|
1140
1144
|
perspective?: Perspective;
|
package/dist/index.js
CHANGED
|
@@ -1270,7 +1270,8 @@ function createClient(options) {
|
|
|
1270
1270
|
depth: opts?.depth,
|
|
1271
1271
|
select: opts?.select?.join(","),
|
|
1272
1272
|
perspective: draft ? "draft" : void 0,
|
|
1273
|
-
stega: draft && stega ? "1" : void 0
|
|
1273
|
+
stega: draft && stega ? "1" : void 0,
|
|
1274
|
+
projectId: defaultProjectId
|
|
1274
1275
|
})}`;
|
|
1275
1276
|
return unwrap(await fetchJSON(url));
|
|
1276
1277
|
},
|
|
@@ -1282,7 +1283,8 @@ function createClient(options) {
|
|
|
1282
1283
|
depth: opts?.depth,
|
|
1283
1284
|
select: opts?.select?.join(","),
|
|
1284
1285
|
perspective: draft ? "draft" : void 0,
|
|
1285
|
-
stega: draft && stega ? "1" : void 0
|
|
1286
|
+
stega: draft && stega ? "1" : void 0,
|
|
1287
|
+
projectId: defaultProjectId
|
|
1286
1288
|
})}`;
|
|
1287
1289
|
return unwrap(await fetchJSON(url));
|
|
1288
1290
|
},
|
|
@@ -1316,19 +1318,21 @@ function createClient(options) {
|
|
|
1316
1318
|
async listPages(opts) {
|
|
1317
1319
|
const url = `${base}/pages${qs({
|
|
1318
1320
|
page: opts?.page,
|
|
1319
|
-
perPage: opts?.perPage
|
|
1321
|
+
perPage: opts?.perPage,
|
|
1322
|
+
projectId: defaultProjectId
|
|
1320
1323
|
})}`;
|
|
1321
1324
|
return unwrap(await fetchJSON(url));
|
|
1322
1325
|
},
|
|
1323
1326
|
async listComponents() {
|
|
1324
1327
|
const url = `${base}/components${qs({
|
|
1325
1328
|
perspective: draft ? "draft" : void 0,
|
|
1326
|
-
token: draft ? previewToken : void 0
|
|
1329
|
+
token: draft ? previewToken : void 0,
|
|
1330
|
+
projectId: defaultProjectId
|
|
1327
1331
|
})}`;
|
|
1328
1332
|
return unwrap(await fetchJSON(url));
|
|
1329
1333
|
},
|
|
1330
1334
|
async getLayout() {
|
|
1331
|
-
const url = `${base}/layout${draft ? "
|
|
1335
|
+
const url = `${base}/layout${qs({ perspective: draft ? "draft" : void 0, projectId: defaultProjectId })}`;
|
|
1332
1336
|
try {
|
|
1333
1337
|
return unwrap(await fetchJSON(url));
|
|
1334
1338
|
} catch (error) {
|