perspectapi-ts-sdk 2.4.0 → 2.5.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/dist/index.js CHANGED
@@ -850,12 +850,12 @@ var ContentClient = class extends BaseClient {
850
850
  console.log("[PerspectAPI Content] Cache details:", {
851
851
  cacheEnabled: !!this.cache,
852
852
  cachePolicy,
853
- tags: this.buildContentTags(siteName)
853
+ tags: this.buildContentTags(siteName, void 0, void 0, normalizedParams?.slug_prefix)
854
854
  });
855
855
  const result = await this.fetchWithCache(
856
856
  endpoint,
857
857
  normalizedParams,
858
- this.buildContentTags(siteName),
858
+ this.buildContentTags(siteName, void 0, void 0, normalizedParams?.slug_prefix),
859
859
  cachePolicy,
860
860
  async () => {
861
861
  console.log("[PerspectAPI Content] Making HTTP request:", {
@@ -976,7 +976,7 @@ var ContentClient = class extends BaseClient {
976
976
  async duplicateContent(id) {
977
977
  return this.create(`/content/${id}/duplicate`, {});
978
978
  }
979
- buildContentTags(siteName, slug, id) {
979
+ buildContentTags(siteName, slug, id, slugPrefix) {
980
980
  const tags = /* @__PURE__ */ new Set(["content"]);
981
981
  if (siteName) {
982
982
  tags.add(`content:site:${siteName}`);
@@ -987,6 +987,9 @@ var ContentClient = class extends BaseClient {
987
987
  if (typeof id === "number") {
988
988
  tags.add(`content:id:${id}`);
989
989
  }
990
+ if (slugPrefix) {
991
+ tags.add(`content:prefix:${slugPrefix}`);
992
+ }
990
993
  return Array.from(tags.values());
991
994
  }
992
995
  };
package/dist/index.mjs CHANGED
@@ -789,12 +789,12 @@ var ContentClient = class extends BaseClient {
789
789
  console.log("[PerspectAPI Content] Cache details:", {
790
790
  cacheEnabled: !!this.cache,
791
791
  cachePolicy,
792
- tags: this.buildContentTags(siteName)
792
+ tags: this.buildContentTags(siteName, void 0, void 0, normalizedParams?.slug_prefix)
793
793
  });
794
794
  const result = await this.fetchWithCache(
795
795
  endpoint,
796
796
  normalizedParams,
797
- this.buildContentTags(siteName),
797
+ this.buildContentTags(siteName, void 0, void 0, normalizedParams?.slug_prefix),
798
798
  cachePolicy,
799
799
  async () => {
800
800
  console.log("[PerspectAPI Content] Making HTTP request:", {
@@ -915,7 +915,7 @@ var ContentClient = class extends BaseClient {
915
915
  async duplicateContent(id) {
916
916
  return this.create(`/content/${id}/duplicate`, {});
917
917
  }
918
- buildContentTags(siteName, slug, id) {
918
+ buildContentTags(siteName, slug, id, slugPrefix) {
919
919
  const tags = /* @__PURE__ */ new Set(["content"]);
920
920
  if (siteName) {
921
921
  tags.add(`content:site:${siteName}`);
@@ -926,6 +926,9 @@ var ContentClient = class extends BaseClient {
926
926
  if (typeof id === "number") {
927
927
  tags.add(`content:id:${id}`);
928
928
  }
929
+ if (slugPrefix) {
930
+ tags.add(`content:prefix:${slugPrefix}`);
931
+ }
929
932
  return Array.from(tags.values());
930
933
  }
931
934
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perspectapi-ts-sdk",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "TypeScript SDK for PerspectAPI - Cloudflare Workers compatible",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -76,13 +76,13 @@ export class ContentClient extends BaseClient {
76
76
  console.log('[PerspectAPI Content] Cache details:', {
77
77
  cacheEnabled: !!this.cache,
78
78
  cachePolicy,
79
- tags: this.buildContentTags(siteName)
79
+ tags: this.buildContentTags(siteName, undefined, undefined, normalizedParams?.slug_prefix)
80
80
  });
81
81
 
82
82
  const result = await this.fetchWithCache<PaginatedResponse<Content>>(
83
83
  endpoint,
84
84
  normalizedParams,
85
- this.buildContentTags(siteName),
85
+ this.buildContentTags(siteName, undefined, undefined, normalizedParams?.slug_prefix),
86
86
  cachePolicy,
87
87
  async () => {
88
88
  console.log('[PerspectAPI Content] Making HTTP request:', {
@@ -229,7 +229,7 @@ export class ContentClient extends BaseClient {
229
229
  return this.create<Record<string, never>, Content>(`/content/${id}/duplicate`, {});
230
230
  }
231
231
 
232
- private buildContentTags(siteName?: string, slug?: string, id?: number): string[] {
232
+ private buildContentTags(siteName?: string, slug?: string, id?: number, slugPrefix?: string): string[] {
233
233
  const tags = new Set<string>(['content']);
234
234
  if (siteName) {
235
235
  tags.add(`content:site:${siteName}`);
@@ -240,6 +240,9 @@ export class ContentClient extends BaseClient {
240
240
  if (typeof id === 'number') {
241
241
  tags.add(`content:id:${id}`);
242
242
  }
243
+ if (slugPrefix) {
244
+ tags.add(`content:prefix:${slugPrefix}`);
245
+ }
243
246
  return Array.from(tags.values());
244
247
  }
245
248
  }