@janbox/contentful-marketplace-sdk 3.1.0-alpha.0 → 4.0.0-alpha.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/README.md +77 -30
- package/dist/client/index.d.ts +4 -19
- package/dist/entries/help-center.d.ts +50 -0
- package/dist/entries/index.d.ts +1 -0
- package/dist/index.cjs +1 -2
- package/dist/index.js +556 -418
- package/dist/types/content-model.d.ts +56 -38
- package/dist/types/index.d.ts +0 -1
- package/dist/utils/errors.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/query.d.ts +5 -5
- package/dist/utils/resolve.d.ts +11 -10
- package/package.json +1 -1
- package/dist/http-responses/index.d.ts +0 -3
- package/dist/types/cms.d.ts +0 -61
package/README.md
CHANGED
|
@@ -31,10 +31,8 @@ import {
|
|
|
31
31
|
} from "@janbox/contentful-marketplace-sdk";
|
|
32
32
|
|
|
33
33
|
ContentfulSDK.configure({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Authorization: `Bearer ${process.env.CMS_DELIVERY_TOKEN}`,
|
|
37
|
-
},
|
|
34
|
+
baseUrl: "https://headless-cms.ichiba.net/delivery/janbox",
|
|
35
|
+
accessToken: process.env.CMS_DELIVERY_TOKEN,
|
|
38
36
|
});
|
|
39
37
|
|
|
40
38
|
const result = await getBannerCollections({
|
|
@@ -53,45 +51,48 @@ console.log(result.items);
|
|
|
53
51
|
|
|
54
52
|
### `ContentfulSDK.configure(params)`
|
|
55
53
|
|
|
56
|
-
Configure the SDK once before calling entry methods.
|
|
54
|
+
Configure the SDK once before calling entry methods. `params` is the `ClientConfig` of [`@janbox/headless-cms-sdk`](https://www.npmjs.com/package/@janbox/headless-cms-sdk):
|
|
57
55
|
|
|
58
|
-
| Parameter
|
|
59
|
-
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `headers`
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
56
|
+
| Parameter | Type | Required | Description |
|
|
57
|
+
|---------------|--------------------------|----------|-------------|
|
|
58
|
+
| `baseUrl` | `string` | ✅ | Delivery API base URL, e.g. `https://headless-cms.ichiba.net/delivery/janbox`. A trailing `/` is removed. |
|
|
59
|
+
| `accessToken` | `string` | — | Delivery key, sent as `Authorization: Bearer <accessToken>` |
|
|
60
|
+
| `headers` | `Record<string, string>` | — | Extra headers for every request. They override `accessToken` (header names are case-insensitive). |
|
|
61
|
+
| `fetch` | `typeof fetch` | — | Custom `fetch`, e.g. to log or trace requests. Defaults to `globalThis.fetch`. |
|
|
62
|
+
| `timeout` | `number` | — | Timeout per attempt in ms. Default `30000`; `0` disables it |
|
|
63
|
+
| `retry` | `{ maxRetries?: number; maxDelay?: number } \| false` | — | Retry on HTTP 429. Default `{ maxRetries: 3, maxDelay: 10000 }`; `false` disables it |
|
|
65
64
|
|
|
66
65
|
```ts
|
|
67
66
|
ContentfulSDK.configure({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Authorization: "Bearer cdel_your-delivery-key",
|
|
71
|
-
},
|
|
67
|
+
baseUrl: "https://test-headless-cms.ichiba.net/delivery/janbox", // QC
|
|
68
|
+
accessToken: "cdel_your-delivery-key",
|
|
72
69
|
});
|
|
73
70
|
```
|
|
74
71
|
|
|
75
72
|
Notes:
|
|
76
73
|
|
|
77
|
-
- The SDK sends `GET {
|
|
74
|
+
- The SDK sends `GET {baseUrl}/entries?...` with `Accept: application/json`.
|
|
75
|
+
- The client is built from the config on first use and rebuilt whenever `baseUrl`, `accessToken`, `headers`, `fetch`, `timeout` or `retry` changes, so calling `configure` again or assigning `ContentfulSDK.config.accessToken` applies to the next request.
|
|
76
|
+
- For queries the entry functions do not cover, use the SDK client directly: `ContentfulSDK.client.getEntries(query, { resolveLinks: false })`.
|
|
78
77
|
- Keep the delivery key server-side: call the SDK from your server (route handler, BFF), never from browser JavaScript.
|
|
79
|
-
- Runtime requires `fetch` (Node.js 18+
|
|
78
|
+
- Runtime requires `fetch` (Node.js 18+).
|
|
80
79
|
|
|
81
|
-
##
|
|
80
|
+
## Breaking changes in 4.0.0
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
Compared with 3.0.0 (3.1.0 was only released as `3.1.0-alpha.0`):
|
|
83
|
+
|
|
84
|
+
1. `ContentfulSDK.configure` takes the `ClientConfig` of `@janbox/headless-cms-sdk`: `url` is renamed to `baseUrl`, `method` is removed, and the token can be passed as `accessToken` (or as `headers.Authorization`, as before). `fetch`, `timeout` and `retry` are new.
|
|
85
|
+
2. `ContentfulSDK.getEntries` is removed. Use `ContentfulSDK.client.getEntries(query, { resolveLinks: false })` instead.
|
|
86
|
+
3. Every error is a `CmsError` from `@janbox/headless-cms-sdk`. When an entry is not found, the functions throw a `CmsError` with `id: "NotFound"` and `status: 404` instead of `NotFoundResponse`. Check errors with `isCmsError` from `@janbox/headless-cms-sdk` (add it to your app's dependencies).
|
|
87
|
+
4. `CmsEntry`, `CmsAsset`, `CmsLink` and `CmsCollection` are removed. Use `Entry`, `Asset`, `Link` and `RawEntryCollection` from `@janbox/headless-cms-sdk`. Link fields in `TypeXxxFields` are now `Link<"Entry">` / `Link<"Asset">`.
|
|
88
|
+
5. A 30-second timeout per attempt and retries on HTTP 429 are on by default. Set `timeout: 0` or `retry: false` to turn them off.
|
|
88
89
|
|
|
89
90
|
## Breaking changes in 3.0.0
|
|
90
91
|
|
|
91
92
|
1. `url` is now the Delivery API base URL of the internal CMS, and `headers` carries the delivery key (`Authorization: Bearer cdel_...`). `method` is still accepted but ignored.
|
|
92
93
|
2. The delivery key must stay on the server, so the SDK must be called server-side.
|
|
93
94
|
3. Types built on the `contentful` package are removed: `TypeXxxSkeleton`, the generic `TypeXxx<Modifiers, Locales>` types, and the `DocArticleEntry`, `DocCategoryEntry` and `HyperlinkEntry` aliases. `TypeXxxFields` are kept as plain interfaces.
|
|
94
|
-
4. Entry ids are the new CMS ids (GUIDs). Old Contentful ids must be migrated by the apps: the CMS rejects them with `400 InvalidQuery`, which the SDK throws as `Error("Request failed: 400
|
|
95
|
+
4. Entry ids are the new CMS ids (GUIDs). Old Contentful ids must be migrated by the apps: the CMS rejects them with `400 InvalidQuery`, which the SDK throws as `Error("Request failed: 400 ...")` (a `CmsError` with `id: "InvalidQuery"` since 4.0.0).
|
|
95
96
|
|
|
96
97
|
## API Methods
|
|
97
98
|
|
|
@@ -190,6 +191,42 @@ const articleById = await getDocArticleDetail({
|
|
|
190
191
|
});
|
|
191
192
|
```
|
|
192
193
|
|
|
194
|
+
### Help Center
|
|
195
|
+
|
|
196
|
+
- `getHelpCategories(options?)`
|
|
197
|
+
- `getHelpArticles(options?)`
|
|
198
|
+
- `getHelpArticleDetail({ id } | { slug })`
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
// Categories are flat: build the tree from parentId (null = top level).
|
|
202
|
+
const categories = await getHelpCategories({ locale: "vi", size: 1000 });
|
|
203
|
+
|
|
204
|
+
// Article summaries (no body). Filter by category or featured flag.
|
|
205
|
+
const articles = await getHelpArticles({ locale: "vi", size: 1000 });
|
|
206
|
+
const featured = await getHelpArticles({ locale: "vi", featured: true });
|
|
207
|
+
const subcategory = categories.items.find((c) => c.parentId !== null);
|
|
208
|
+
const inCategory = await getHelpArticles({
|
|
209
|
+
locale: "vi",
|
|
210
|
+
categoryId: subcategory?.sys.id,
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const article = await getHelpArticleDetail({
|
|
214
|
+
slug: "bao-lau-hang-ve-viet-nam",
|
|
215
|
+
locale: "vi",
|
|
216
|
+
});
|
|
217
|
+
// article.body: { json, links: { assets: { block } } } | null
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Notes:
|
|
221
|
+
|
|
222
|
+
- Results are ordered by `position`.
|
|
223
|
+
- To load a whole locale, pass `size: 1000` (the maximum the CMS accepts) and check `totalPages`. A larger `size` is rejected with `CmsError` `InvalidQuery`.
|
|
224
|
+
- `path` is the path stored on the CMS for the entry.
|
|
225
|
+
- An article slug is unique within a locale only, so pass `locale` when looking an article up by slug.
|
|
226
|
+
- Every item has `locale` (`null` when the entry has none), so an article fetched by `id`, or a list fetched without `locale`, still tells which language it belongs to.
|
|
227
|
+
- `categoryId` is `null` for an article with no category.
|
|
228
|
+
- The `categoryId` filter matches an article's own category only, not its subcategories. To list a whole branch, load all articles once and group them by `categoryId` along the tree.
|
|
229
|
+
|
|
193
230
|
### Brand / Hyperlink / Keyword Collections
|
|
194
231
|
|
|
195
232
|
- `getBrandCollections(options?)`
|
|
@@ -236,21 +273,28 @@ Filters `marketCode` / `locale` with global fallback (entries where `markets` /
|
|
|
236
273
|
|
|
237
274
|
## Error Handling
|
|
238
275
|
|
|
239
|
-
`
|
|
276
|
+
Every error from the CMS is a `CmsError` of `@janbox/headless-cms-sdk` (`id`, `status`, `requestId`, `details`, `url`). The SDK README lists the `id` values.
|
|
240
277
|
|
|
241
|
-
- `
|
|
242
|
-
- `
|
|
278
|
+
- The detail functions (`getBlogPostDetail`, `getBlogCategoryDetail`, `getDocCategoryDetail`, `getDocArticleDetail`, `getHelpArticleDetail`), `getPolicyAndTerms` and `getBlogPosts({ collectionId })` throw a `CmsError` with `id: "NotFound"`, `status: 404` and `message: "Entry not found"` when no entry matches.
|
|
279
|
+
- The detail functions throw `Error("Either id or slug is required.")` if neither `id` nor `slug` is provided.
|
|
280
|
+
- Calling a function before `configure` throws `Error("Client is not configured")`.
|
|
243
281
|
|
|
244
282
|
```ts
|
|
283
|
+
import { isCmsError } from "@janbox/headless-cms-sdk";
|
|
284
|
+
|
|
245
285
|
try {
|
|
246
286
|
await getDocArticleDetail({ slug: "unknown-slug" });
|
|
247
287
|
} catch (error) {
|
|
248
|
-
if (error
|
|
288
|
+
if (isCmsError(error) && error.id === "NotFound") {
|
|
249
289
|
console.log("Entry not found");
|
|
290
|
+
} else {
|
|
291
|
+
throw error;
|
|
250
292
|
}
|
|
251
293
|
}
|
|
252
294
|
```
|
|
253
295
|
|
|
296
|
+
The SDK also throws `NotFound` (404) when the CMS answers 404 for the whole endpoint, for example with a wrong `baseUrl`. If you need to tell the two apart, the error thrown by this package has `message === "Entry not found"`.
|
|
297
|
+
|
|
254
298
|
## Market/Language Filtering Behavior
|
|
255
299
|
|
|
256
300
|
When `marketCode` or `language` is provided, queries include both:
|
|
@@ -265,8 +309,11 @@ This supports global fallback content.
|
|
|
265
309
|
The package exports:
|
|
266
310
|
|
|
267
311
|
- client and entry functions from `src/client` and `src/entries`
|
|
268
|
-
- content model field types (`TypeXxxFields`)
|
|
312
|
+
- content model field types (`TypeXxxFields`) from `src/types`
|
|
269
313
|
- response item types such as `BlogPostGraphQLItem` and `DocArticleGraphQLItem` (names kept from 2.x)
|
|
314
|
+
- help center item types `HelpCategoryItem`, `HelpArticleItem`, `HelpArticleDetailItem`, and `RichText` (the shape of rich text fields such as `body`)
|
|
315
|
+
|
|
316
|
+
CMS data, query, config and error types (`Entry`, `Asset`, `Link`, `RawEntryCollection`, `EntriesQuery`, `ClientConfig`, `CmsClient`, `CmsError`) come from `@janbox/headless-cms-sdk`; this package does not re-export them.
|
|
270
317
|
|
|
271
318
|
## Development
|
|
272
319
|
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { QueryParams } from '../utils/query';
|
|
3
|
-
export interface ContentfulSDKConfig {
|
|
4
|
-
url: string;
|
|
5
|
-
/** @deprecated Ignored: requests are always GET. Kept so existing configs still type-check. */
|
|
6
|
-
method?: string;
|
|
7
|
-
headers?: Record<string, string>;
|
|
8
|
-
/** Timeout per attempt in ms. Defaults to 30000; 0 disables it. */
|
|
9
|
-
timeout?: number;
|
|
10
|
-
/** Retry on 429. Defaults to { maxRetries: 3, maxDelay: 10000 }; false disables it. */
|
|
11
|
-
retry?: {
|
|
12
|
-
maxRetries?: number;
|
|
13
|
-
maxDelay?: number;
|
|
14
|
-
} | false;
|
|
15
|
-
}
|
|
1
|
+
import { ClientConfig, CmsClient } from '@janbox/headless-cms-sdk';
|
|
16
2
|
export declare class ContentfulSDK {
|
|
17
3
|
private static _config;
|
|
18
4
|
private static _client;
|
|
19
|
-
static get config():
|
|
20
|
-
|
|
21
|
-
static configure(
|
|
22
|
-
static getEntries<T = CmsEntry>(params: QueryParams): Promise<CmsCollection<T>>;
|
|
5
|
+
static get config(): ClientConfig;
|
|
6
|
+
static get client(): CmsClient;
|
|
7
|
+
static configure(config: ClientConfig): void;
|
|
23
8
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PaginatedResponse } from '../utils';
|
|
2
|
+
import { RichText } from '../utils/resolve';
|
|
3
|
+
type HelpEntrySys = {
|
|
4
|
+
id: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
};
|
|
8
|
+
export type HelpCategoryItem = {
|
|
9
|
+
sys: HelpEntrySys;
|
|
10
|
+
title: string | null;
|
|
11
|
+
slug: string | null;
|
|
12
|
+
path: string | null;
|
|
13
|
+
locale: string | null;
|
|
14
|
+
position: number | null;
|
|
15
|
+
parentId: string | null;
|
|
16
|
+
};
|
|
17
|
+
export type HelpArticleItem = {
|
|
18
|
+
sys: HelpEntrySys;
|
|
19
|
+
title: string | null;
|
|
20
|
+
slug: string | null;
|
|
21
|
+
path: string | null;
|
|
22
|
+
locale: string | null;
|
|
23
|
+
position: number | null;
|
|
24
|
+
featured: boolean;
|
|
25
|
+
categoryId: string | null;
|
|
26
|
+
};
|
|
27
|
+
export type GetHelpCategoriesResponse = PaginatedResponse<HelpCategoryItem>;
|
|
28
|
+
export type GetHelpArticlesResponse = PaginatedResponse<HelpArticleItem>;
|
|
29
|
+
export interface HelpArticleDetailItem extends HelpArticleItem {
|
|
30
|
+
body: RichText | null;
|
|
31
|
+
}
|
|
32
|
+
export type GetHelpArticleDetailResponse = HelpArticleDetailItem;
|
|
33
|
+
export declare const getHelpCategories: ({ locale, page, size, }?: {
|
|
34
|
+
locale?: string;
|
|
35
|
+
page?: number;
|
|
36
|
+
size?: number;
|
|
37
|
+
}) => Promise<GetHelpCategoriesResponse>;
|
|
38
|
+
export declare const getHelpArticles: ({ locale, categoryId, featured, page, size, }?: {
|
|
39
|
+
locale?: string;
|
|
40
|
+
categoryId?: string;
|
|
41
|
+
featured?: boolean;
|
|
42
|
+
page?: number;
|
|
43
|
+
size?: number;
|
|
44
|
+
}) => Promise<GetHelpArticlesResponse>;
|
|
45
|
+
export declare const getHelpArticleDetail: ({ id, slug, locale, }: {
|
|
46
|
+
id?: string;
|
|
47
|
+
slug?: string;
|
|
48
|
+
locale?: string;
|
|
49
|
+
}) => Promise<GetHelpArticleDetailResponse>;
|
|
50
|
+
export {};
|
package/dist/entries/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './blog-category';
|
|
|
4
4
|
export * from './blog-collection';
|
|
5
5
|
export * from './brand-collection';
|
|
6
6
|
export * from './documentation';
|
|
7
|
+
export * from './help-center';
|
|
7
8
|
export * from './hyperlink-collection';
|
|
8
9
|
export * from './hyperlink';
|
|
9
10
|
export * from './keyword-collection';
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("@janbox/headless-cms-sdk"),N=e=>k.isCmsError(e)&&e.status!==void 0&&(e.status<200||e.status>299)?new Error(`Request failed: ${e.status} ${e.id}
|
|
2
|
-
${e.message}`,{cause:e}):e;class r{static _config;static _client;static get config(){if(!this._config)throw new Error("Client is not configured");return this._config}static get client(){const{url:t,headers:i,timeout:l,retry:s}=this.config,o=this._client;if(o&&o.builtFrom.url===t&&o.builtFrom.headers===i&&o.builtFrom.timeout===l&&o.builtFrom.retry===s)return o.client;const n=k.createClient({baseUrl:t,headers:i,timeout:l,retry:s});return this._client={client:n,builtFrom:{url:t,headers:i,timeout:l,retry:s}},n}static configure(t){this._config=t}static async getEntries(t){const i=this.client;try{return await i.getEntries(t,{resolveLinks:!1})}catch(l){throw N(l)}}}class h{page;total;size;items;totalPages;constructor({page:t,total:i,size:l,items:s}){this.page=t,this.total=i,this.size=l,this.items=s,this.totalPages=Math.ceil(this.total/this.size)}}const p="-sys.updatedAt",g=e=>e?k.or("market",[{"fields.markets[exists]":"false"},{"fields.markets.sys.contentType.sys.id":"market","fields.markets.fields.code":e}]):{},u=e=>e?k.or("locale",[{"fields.locale[exists]":"false"},{"fields.locale":e}]):{},z=({id:e,slug:t})=>{if(e)return{"sys.id":e,limit:1};if(t)return{"fields.slug":t,limit:1};throw new Error("Either id or slug is required.")},w=(e,t,i=0)=>{const l=Math.max(1,Math.floor(e)),s=Math.max(1,Math.floor(t)),o=Math.max(0,Math.floor(i));return{page:l,size:s,params:{limit:s,skip:(l-1)*s+o}}},f=e=>{const t=new Map,i=new Map;for(const s of[...e.items,...e.includes?.Entry??[]])t.set(s.sys.id,s);for(const s of e.includes?.Asset??[])i.set(s.sys.id,s);const l=s=>(s&&t.get(s.sys.id))??null;return{entry:l,asset:s=>(s&&i.get(s.sys.id))??null,entries:s=>(s??[]).map(o=>l(o)).filter(o=>o!==null)}},a=e=>e??null,E=e=>{const t=e?.fields.file;return t?{url:t.url,width:t.details.image?.width??null,height:t.details.image?.height??null,contentType:t.contentType}:null},G=e=>({sys:{id:e.sys.id},url:e.fields.file?.url,width:e.fields.file?.details.image?.width??null,height:e.fields.file?.details.image?.height??null,contentType:e.fields.file?.contentType,title:a(e.fields.title),description:a(e.fields.description)}),S=(e,t)=>{if(!e||typeof e!="object")return t;const i=e;if(i.nodeType==="embedded-asset-block"){const l=i.data?.target?.sys?.id;l&&!t.includes(l)&&t.push(l)}for(const l of i.content??[])S(l,t);return t},B=(e,t)=>{if(!e)return null;const i=S(e,[]).map(l=>t.asset({sys:{type:"Link",linkType:"Asset",id:l}})).filter(l=>l!==null&&!!l.fields.file).map(G);return{json:e,links:{assets:{block:i}}}},_=e=>e?{metaTitle:a(e.fields.metaTitle),metaDescription:a(e.fields.metaDescription),metaKeywords:a(e.fields.metaKeywords),metaRobots:a(e.fields.metaRobots)}:null,v=e=>e?{sys:{id:e.sys.id},label:a(e.fields.label),url:a(e.fields.url),target:a(e.fields.target),marketHandling:a(e.fields.marketHandling)}:null,F=(e,t)=>e?{name:a(e.fields.name),avatar:E(t.asset(e.fields.avatar))}:null,U=async({slot:e,page:t=1,size:i=20,platform:l,marketCode:s,locale:o})=>{const n=w(t,i),c=await r.getEntries({content_type:"bannerCollection","fields.slot":e,"fields.platform":l||void 0,select:"sys.id,fields.name,fields.slot,fields.platform,fields.banners",include:2,order:p,...n.params,...g(s),...u(o)}),d=f(c);return new h({page:n.page,total:c.total,size:n.size,items:c.items.map(m=>({sys:{id:m.sys.id},name:a(m.fields.name),slot:a(m.fields.slot),platform:a(m.fields.platform),bannersCollection:{items:d.entries(m.fields.banners).map(C=>({sys:{id:C.sys.id},name:a(C.fields.name),hyperlink:v(d.entry(C.fields.hyperlink)),media:E(d.asset(C.fields.media))}))}}))})};class A extends Response{constructor(...t){super(t[0]??"Not Found",{status:404,...t[1]})}}const I="sys.id,sys.createdAt,sys.updatedAt,fields.title,fields.shortDescription,fields.slug,fields.categories,fields.featuredImage",T=(e,t)=>({sys:{id:e.sys.id,createdAt:e.sys.createdAt,updatedAt:e.sys.updatedAt},title:a(e.fields.title),shortDescription:a(e.fields.shortDescription),slug:a(e.fields.slug),categoriesCollection:{items:t.entries(e.fields.categories).map(i=>({sys:{id:i.sys.id},title:a(i.fields.title),slug:a(i.fields.slug),featuredImage:E(t.asset(i.fields.featuredImage))}))},featuredImage:E(t.asset(e.fields.featuredImage))}),Y=async({marketCode:e,locale:t,collectionId:i,categoryId:l,page:s=1,size:o=20,skip:n=0}={})=>{const c=w(s,o,n);if(i){const P=(await r.getEntries({content_type:"blogCollection","sys.id":i,select:"sys.id,fields.posts",include:0,limit:1})).items.at(0);if(!P)throw new A;const D=(P.fields.posts??[]).filter(y=>y.sys.linkType==="Entry").map(y=>y.sys.id),b=D.slice(c.params.skip,c.params.skip+c.size);if(!b.length)return new h({page:c.page,total:D.length,size:c.size,items:[]});const R=await r.getEntries({content_type:"blogPost","sys.id[in]":b.join(","),select:I,include:2,limit:c.size}),j=f(R),q=new Map(R.items.map(y=>[y.sys.id,y]));return new h({page:c.page,total:D.length,size:c.size,items:b.map(y=>q.get(y)).filter(y=>y!==void 0).map(y=>T(y,j))})}const d=await r.getEntries({content_type:"blogPost","fields.categories.sys.id":l||void 0,select:I,include:2,order:p,...c.params,...g(e),...u(t)}),m=f(d);return new h({page:c.page,total:d.total,size:c.size,items:d.items.map(C=>T(C,m))})},J=async({id:e,slug:t,marketCode:i,locale:l})=>{const s=z({id:e,slug:t}),o=await r.getEntries({content_type:"blogPost",...s,select:`${I},fields.author,fields.content,fields.seo`,include:2,order:p,...g(i),...u(l)}),n=o.items.at(0);if(!n)throw new A;const c=f(o);return{...T(n,c),author:F(c.entry(n.fields.author),c),content:B(n.fields.content,c),seo:_(c.entry(n.fields.seo))}},L="sys.id,fields.title,fields.slug,fields.featuredImage",M=(e,t)=>({sys:{id:e.sys.id},title:a(e.fields.title),slug:a(e.fields.slug),featuredImage:E(t.asset(e.fields.featuredImage))}),Q=async({marketCode:e,locale:t,page:i=1,size:l=20}={})=>{const s=w(i,l),o=await r.getEntries({content_type:"blogCategory",select:L,include:1,order:p,...s.params,...g(e),...u(t)}),n=f(o);return new h({page:s.page,total:o.total,size:s.size,items:o.items.map(c=>M(c,n))})},V=async({id:e,slug:t,marketCode:i,locale:l})=>{const s=z({id:e,slug:t}),o=await r.getEntries({content_type:"blogCategory",...s,select:`${L},fields.description,fields.seo`,include:1,order:p,...g(i),...u(l)}),n=o.items.at(0);if(!n)throw new A;const c=f(o);return{...M(n,c),description:a(n.fields.description),seo:_(c.entry(n.fields.seo))}},W=async({marketCode:e,locale:t,page:i=1,size:l=20}={})=>{const s=w(i,l),o=await r.getEntries({content_type:"blogCollection",select:"sys.id,fields.name,fields.type,fields.order,fields.category,fields.featuredImage",include:1,order:p,...s.params,...g(e),...u(t)}),n=f(o),c=o.items.map(d=>{const m=n.entry(d.fields.category);return{name:a(d.fields.name),type:a(d.fields.type),order:a(d.fields.order),sys:{id:d.sys.id},category:m?{sys:{id:m.sys.id},title:a(m.fields.title),slug:a(m.fields.slug)}:null,featuredImage:E(n.asset(d.fields.featuredImage))}});return new h({page:s.page,total:o.total,size:s.size,items:c.map(d=>({...d,category:d.type==="category"?d.category:null,categoryId:d.type==="category"?d.category?.sys.id??null:null,collectionId:d.type==="manual"?d.sys.id:null}))})},X=async({page:e=1,size:t=20,marketCode:i,locale:l}={})=>{const s=w(e,t),o=await r.getEntries({content_type:"brandCollection",select:"sys.id,fields.name,fields.slot,fields.brands",include:2,order:p,...s.params,...g(i),...u(l)}),n=f(o);return new h({page:s.page,total:o.total,size:s.size,items:o.items.map(c=>({sys:{id:c.sys.id},name:a(c.fields.name),slot:a(c.fields.slot),brandsCollection:{items:n.entries(c.fields.brands).map(d=>({sys:{id:d.sys.id},name:a(d.fields.name),logo:E(n.asset(d.fields.logo)),hyperlink:v(n.entry(d.fields.hyperlink))}))}}))})},x="sys.id,sys.createdAt,sys.updatedAt,fields.title,fields.slug,fields.description,fields.order,fields.seo",O="sys.id,sys.createdAt,sys.updatedAt,fields.title,fields.slug,fields.author,fields.category",K=e=>({id:e.sys.id,createdAt:e.sys.createdAt,updatedAt:e.sys.updatedAt}),$=(e,t)=>({sys:K(e),title:a(e.fields.title),slug:a(e.fields.slug),description:a(e.fields.description),order:a(e.fields.order),seo:_(t.entry(e.fields.seo))}),H=(e,t)=>{const i=t.entry(e.fields.category);return{sys:K(e),title:a(e.fields.title),slug:a(e.fields.slug),author:F(t.entry(e.fields.author),t),category:i?{title:a(i.fields.title),slug:a(i.fields.slug),description:a(i.fields.description),order:a(i.fields.order)}:null}},Z=async({marketCode:e,locale:t,page:i=1,size:l=20}={})=>{const s=w(i,l),o=await r.getEntries({content_type:"documentationCategory",select:x,include:1,order:p,...s.params,...g(e),...u(t)}),n=f(o);return new h({page:s.page,total:o.total,size:s.size,items:o.items.map(c=>$(c,n))})},ee=async({id:e,slug:t,marketCode:i,locale:l})=>{const s=z({id:e,slug:t}),o=await r.getEntries({content_type:"documentationCategory",...s,select:x,include:1,order:p,...g(i),...u(l)}),n=o.items.at(0);if(!n)throw new A;return $(n,f(o))},te=async({marketCode:e,locale:t,categorySlug:i,page:l=1,size:s=20}={})=>{const o=w(l,s),n=await r.getEntries({content_type:"documentationArticle",...i?{"fields.category.sys.contentType.sys.id":"documentationCategory","fields.category.fields.slug":i}:{},select:O,include:2,order:p,...o.params,...g(e),...u(t)}),c=f(n);return new h({page:o.page,total:n.total,size:o.size,items:n.items.map(d=>H(d,c))})},se=async({id:e,slug:t,marketCode:i,locale:l})=>{const s=z({id:e,slug:t}),o=await r.getEntries({content_type:"documentationArticle",...s,select:`${O},fields.content,fields.seo`,include:2,order:p,...g(i),...u(l)}),n=o.items.at(0);if(!n)throw new A;const c=f(o);return{...H(n,c),content:B(n.fields.content,c),seo:_(c.entry(n.fields.seo))}},ie=async({page:e=1,size:t=20,marketCode:i,locale:l}={})=>{const s=w(e,t),o=await r.getEntries({content_type:"hyperlinkCollection",select:"sys.id,fields.name,fields.slot,fields.order,fields.links",include:1,order:"fields.order",...s.params,...g(i),...u(l)}),n=f(o);return new h({page:s.page,total:o.total,size:s.size,items:o.items.map(c=>({sys:{id:c.sys.id},name:a(c.fields.name),slot:a(c.fields.slot),order:a(c.fields.order),linksCollection:{items:n.entries(c.fields.links).map(d=>v(d))}}))})},le=async({page:e=1,size:t=20,marketCode:i,locale:l}={})=>{const s=w(e,t),o=await r.getEntries({content_type:"keywordCollection",select:"sys.id,fields.name,fields.slot,fields.keywords",include:0,order:p,...s.params,...g(i),...u(l)});return new h({page:s.page,total:o.total,size:s.size,items:o.items.map(n=>({sys:{id:n.sys.id},name:a(n.fields.name),slot:a(n.fields.slot),keywords:a(n.fields.keywords)}))})},oe=async({marketCode:e,locale:t}={})=>{const i=await r.getEntries({content_type:"policyAndTerms",select:"sys.id,fields.title,fields.locale,fields.content",include:1,order:p,limit:1,...g(e),...u(t)}),l=i.items.at(0);if(!l)throw new A;return{sys:{id:l.sys.id},title:a(l.fields.title),locale:a(l.fields.locale),content:B(l.fields.content,f(i))}};exports.ContentfulSDK=r;exports.PaginatedResponse=h;exports.getBannerCollections=U;exports.getBlogCategories=Q;exports.getBlogCategoryDetail=V;exports.getBlogCollections=W;exports.getBlogPostDetail=J;exports.getBlogPosts=Y;exports.getBrandCollections=X;exports.getDocArticleDetail=se;exports.getDocArticles=te;exports.getDocCategories=Z;exports.getDocCategoryDetail=ee;exports.getHyperlinkCollections=ie;exports.getKeywordCollections=le;exports.getPolicyAndTerms=oe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("@janbox/headless-cms-sdk"),Q=["baseUrl","accessToken","headers","fetch","timeout","retry"];class r{static _config;static _client;static get config(){if(!this._config)throw new Error("Client is not configured");return this._config}static get client(){const t=this.config,i=this._client;if(i&&Q.every(s=>i.builtFrom[s]===t[s]))return i.client;const l=_.createClient(t);return this._client={client:l,builtFrom:{...t}},l}static configure(t){this._config=t}}class p{page;total;size;items;totalPages;constructor({page:t,total:i,size:l,items:s}){this.page=t,this.total=i,this.size=l,this.items=s,this.totalPages=Math.ceil(this.total/this.size)}}const m="-sys.updatedAt",u=e=>e?_.or("market",[{"fields.markets[exists]":"false"},{"fields.markets.sys.contentType.sys.id":"market","fields.markets.fields.code":e}]):{},f=e=>e?_.or("locale",[{"fields.locale[exists]":"false"},{"fields.locale":e}]):{},A=({id:e,slug:t})=>{if(e)return{"sys.id":e,limit:1};if(t)return{"fields.slug":t,limit:1};throw new Error("Either id or slug is required.")},C=(e,t,i=0)=>{const l=Math.max(1,Math.floor(e)),s=Math.max(1,Math.floor(t)),n=Math.max(0,Math.floor(i));return{page:l,size:s,params:{limit:s,skip:(l-1)*s+n}}},g=e=>{const t=new Map,i=new Map;for(const s of[...e.items,...e.includes?.Entry??[]])t.set(s.sys.id,s);for(const s of e.includes?.Asset??[])i.set(s.sys.id,s);const l=s=>(s&&t.get(s.sys.id))??null;return{entry:l,asset:s=>(s&&i.get(s.sys.id))??null,entries:s=>(s??[]).map(n=>l(n)).filter(n=>n!==null)}},o=e=>e??null,w=e=>{const t=e?.fields.file;return t?{url:t.url,width:t.details.image?.width??null,height:t.details.image?.height??null,contentType:t.contentType}:null},V=e=>({sys:{id:e.sys.id},url:e.fields.file?.url,width:e.fields.file?.details.image?.width??null,height:e.fields.file?.details.image?.height??null,contentType:e.fields.file?.contentType,title:o(e.fields.title),description:o(e.fields.description)}),R=(e,t)=>{if(!e||typeof e!="object")return t;const i=e;if(i.nodeType==="embedded-asset-block"){const l=i.data?.target?.sys?.id;l&&!t.includes(l)&&t.push(l)}for(const l of i.content??[])R(l,t);return t},L=(e,t)=>{if(!e)return null;const i=R(e,[]).map(l=>t.asset({sys:{type:"Link",linkType:"Asset",id:l}})).filter(l=>l!==null&&!!l.fields.file).map(V);return{json:e,links:{assets:{block:i}}}},T=e=>e?{metaTitle:o(e.fields.metaTitle),metaDescription:o(e.fields.metaDescription),metaKeywords:o(e.fields.metaKeywords),metaRobots:o(e.fields.metaRobots)}:null,b=e=>e?{sys:{id:e.sys.id},label:o(e.fields.label),url:o(e.fields.url),target:o(e.fields.target),marketHandling:o(e.fields.marketHandling)}:null,S=(e,t)=>e?{name:o(e.fields.name),avatar:w(t.asset(e.fields.avatar))}:null,W=async({slot:e,page:t=1,size:i=20,platform:l,marketCode:s,locale:n})=>{const a=C(t,i),c=await r.client.getEntries({content_type:"bannerCollection","fields.slot":e,"fields.platform":l||void 0,select:"sys.id,fields.name,fields.slot,fields.platform,fields.banners",include:2,order:m,...a.params,...u(s),...f(n)},{resolveLinks:!1}),d=g(c);return new p({page:a.page,total:c.total,size:a.size,items:c.items.map(y=>({sys:{id:y.sys.id},name:o(y.fields.name),slot:o(y.fields.slot),platform:o(y.fields.platform),bannersCollection:{items:d.entries(y.fields.banners).map(E=>({sys:{id:E.sys.id},name:o(E.fields.name),hyperlink:b(d.entry(E.fields.hyperlink)),media:w(d.asset(E.fields.media))}))}}))})},k=()=>new _.CmsError({id:"NotFound",message:"Entry not found",url:`${r.config.baseUrl.trim().replace(/\/+$/,"")}/entries`,status:404}),D="sys.id,sys.createdAt,sys.updatedAt,fields.title,fields.shortDescription,fields.slug,fields.categories,fields.featuredImage",I=(e,t)=>({sys:{id:e.sys.id,createdAt:e.sys.createdAt,updatedAt:e.sys.updatedAt},title:o(e.fields.title),shortDescription:o(e.fields.shortDescription),slug:o(e.fields.slug),categoriesCollection:{items:t.entries(e.fields.categories).map(i=>({sys:{id:i.sys.id},title:o(i.fields.title),slug:o(i.fields.slug),featuredImage:w(t.asset(i.fields.featuredImage))}))},featuredImage:w(t.asset(e.fields.featuredImage))}),X=async({marketCode:e,locale:t,collectionId:i,categoryId:l,page:s=1,size:n=20,skip:a=0}={})=>{const c=C(s,n,a);if(i){const B=(await r.client.getEntries({content_type:"blogCollection","sys.id":i,select:"sys.id,fields.posts",include:0,limit:1},{resolveLinks:!1})).items.at(0);if(!B)throw k();const v=(B.fields.posts??[]).filter(h=>h.sys.linkType==="Entry").map(h=>h.sys.id),z=v.slice(c.params.skip,c.params.skip+c.size);if(!z.length)return new p({page:c.page,total:v.length,size:c.size,items:[]});const H=await r.client.getEntries({content_type:"blogPost","sys.id[in]":z.join(","),select:D,include:2,limit:c.size},{resolveLinks:!1}),q=g(H),J=new Map(H.items.map(h=>[h.sys.id,h]));return new p({page:c.page,total:v.length,size:c.size,items:z.map(h=>J.get(h)).filter(h=>h!==void 0).map(h=>I(h,q))})}const d=await r.client.getEntries({content_type:"blogPost","fields.categories.sys.id":l||void 0,select:D,include:2,order:m,...c.params,...u(e),...f(t)},{resolveLinks:!1}),y=g(d);return new p({page:c.page,total:d.total,size:c.size,items:d.items.map(E=>I(E,y))})},Z=async({id:e,slug:t,marketCode:i,locale:l})=>{const s=A({id:e,slug:t}),n=await r.client.getEntries({content_type:"blogPost",...s,select:`${D},fields.author,fields.content,fields.seo`,include:2,order:m,...u(i),...f(l)},{resolveLinks:!1}),a=n.items.at(0);if(!a)throw k();const c=g(n);return{...I(a,c),author:S(c.entry(a.fields.author),c),content:L(a.fields.content,c),seo:T(c.entry(a.fields.seo))}},O="sys.id,fields.title,fields.slug,fields.featuredImage",M=(e,t)=>({sys:{id:e.sys.id},title:o(e.fields.title),slug:o(e.fields.slug),featuredImage:w(t.asset(e.fields.featuredImage))}),ee=async({marketCode:e,locale:t,page:i=1,size:l=20}={})=>{const s=C(i,l),n=await r.client.getEntries({content_type:"blogCategory",select:O,include:1,order:m,...s.params,...u(e),...f(t)},{resolveLinks:!1}),a=g(n);return new p({page:s.page,total:n.total,size:s.size,items:n.items.map(c=>M(c,a))})},te=async({id:e,slug:t,marketCode:i,locale:l})=>{const s=A({id:e,slug:t}),n=await r.client.getEntries({content_type:"blogCategory",...s,select:`${O},fields.description,fields.seo`,include:1,order:m,...u(i),...f(l)},{resolveLinks:!1}),a=n.items.at(0);if(!a)throw k();const c=g(n);return{...M(a,c),description:o(a.fields.description),seo:T(c.entry(a.fields.seo))}},se=async({marketCode:e,locale:t,page:i=1,size:l=20}={})=>{const s=C(i,l),n=await r.client.getEntries({content_type:"blogCollection",select:"sys.id,fields.name,fields.type,fields.order,fields.category,fields.featuredImage",include:1,order:m,...s.params,...u(e),...f(t)},{resolveLinks:!1}),a=g(n),c=n.items.map(d=>{const y=a.entry(d.fields.category);return{name:o(d.fields.name),type:o(d.fields.type),order:o(d.fields.order),sys:{id:d.sys.id},category:y?{sys:{id:y.sys.id},title:o(y.fields.title),slug:o(y.fields.slug)}:null,featuredImage:w(a.asset(d.fields.featuredImage))}});return new p({page:s.page,total:n.total,size:s.size,items:c.map(d=>({...d,category:d.type==="category"?d.category:null,categoryId:d.type==="category"?d.category?.sys.id??null:null,collectionId:d.type==="manual"?d.sys.id:null}))})},ie=async({page:e=1,size:t=20,marketCode:i,locale:l}={})=>{const s=C(e,t),n=await r.client.getEntries({content_type:"brandCollection",select:"sys.id,fields.name,fields.slot,fields.brands",include:2,order:m,...s.params,...u(i),...f(l)},{resolveLinks:!1}),a=g(n);return new p({page:s.page,total:n.total,size:s.size,items:n.items.map(c=>({sys:{id:c.sys.id},name:o(c.fields.name),slot:o(c.fields.slot),brandsCollection:{items:a.entries(c.fields.brands).map(d=>({sys:{id:d.sys.id},name:o(d.fields.name),logo:w(a.asset(d.fields.logo)),hyperlink:b(a.entry(d.fields.hyperlink))}))}}))})},F="sys.id,sys.createdAt,sys.updatedAt,fields.title,fields.slug,fields.description,fields.order,fields.seo",x="sys.id,sys.createdAt,sys.updatedAt,fields.title,fields.slug,fields.author,fields.category",N=e=>({id:e.sys.id,createdAt:e.sys.createdAt,updatedAt:e.sys.updatedAt}),$=(e,t)=>({sys:N(e),title:o(e.fields.title),slug:o(e.fields.slug),description:o(e.fields.description),order:o(e.fields.order),seo:T(t.entry(e.fields.seo))}),K=(e,t)=>{const i=t.entry(e.fields.category);return{sys:N(e),title:o(e.fields.title),slug:o(e.fields.slug),author:S(t.entry(e.fields.author),t),category:i?{title:o(i.fields.title),slug:o(i.fields.slug),description:o(i.fields.description),order:o(i.fields.order)}:null}},le=async({marketCode:e,locale:t,page:i=1,size:l=20}={})=>{const s=C(i,l),n=await r.client.getEntries({content_type:"documentationCategory",select:F,include:1,order:m,...s.params,...u(e),...f(t)},{resolveLinks:!1}),a=g(n);return new p({page:s.page,total:n.total,size:s.size,items:n.items.map(c=>$(c,a))})},oe=async({id:e,slug:t,marketCode:i,locale:l})=>{const s=A({id:e,slug:t}),n=await r.client.getEntries({content_type:"documentationCategory",...s,select:F,include:1,order:m,...u(i),...f(l)},{resolveLinks:!1}),a=n.items.at(0);if(!a)throw k();return $(a,g(n))},ne=async({marketCode:e,locale:t,categorySlug:i,page:l=1,size:s=20}={})=>{const n=C(l,s),a=await r.client.getEntries({content_type:"documentationArticle",...i?{"fields.category.sys.contentType.sys.id":"documentationCategory","fields.category.fields.slug":i}:{},select:x,include:2,order:m,...n.params,...u(e),...f(t)},{resolveLinks:!1}),c=g(a);return new p({page:n.page,total:a.total,size:n.size,items:a.items.map(d=>K(d,c))})},ae=async({id:e,slug:t,marketCode:i,locale:l})=>{const s=A({id:e,slug:t}),n=await r.client.getEntries({content_type:"documentationArticle",...s,select:`${x},fields.content,fields.seo`,include:2,order:m,...u(i),...f(l)},{resolveLinks:!1}),a=n.items.at(0);if(!a)throw k();const c=g(n);return{...K(a,c),content:L(a.fields.content,c),seo:T(c.entry(a.fields.seo))}},ce="crispHelpCategory",Y="crispHelpArticle",P="fields.position,sys.id",de="sys.id,sys.createdAt,sys.updatedAt,fields.title,fields.slug,fields.path,fields.locale,fields.position,fields.parent",j="sys.id,sys.createdAt,sys.updatedAt,fields.title,fields.slug,fields.path,fields.locale,fields.position,fields.featured,fields.category",G=e=>({id:e.sys.id,createdAt:e.sys.createdAt,updatedAt:e.sys.updatedAt}),re=e=>({sys:G(e),title:o(e.fields.title),slug:o(e.fields.slug),path:o(e.fields.path),locale:o(e.fields.locale),position:o(e.fields.position),parentId:e.fields.parent?.sys.id??null}),U=e=>({sys:G(e),title:o(e.fields.title),slug:o(e.fields.slug),path:o(e.fields.path),locale:o(e.fields.locale),position:o(e.fields.position),featured:e.fields.featured===!0,categoryId:e.fields.category?.sys.id??null}),fe=async({locale:e,page:t=1,size:i=20}={})=>{const l=C(t,i),s=await r.client.getEntries({content_type:ce,select:de,include:0,order:P,...l.params,...f(e)},{resolveLinks:!1});return new p({page:l.page,total:s.total,size:l.size,items:s.items.map(re)})},ge=async({locale:e,categoryId:t,featured:i,page:l=1,size:s=20}={})=>{const n=C(l,s),a=await r.client.getEntries({content_type:Y,...t?{"fields.category.sys.id":t}:{},...i!==void 0?{"fields.featured":i}:{},select:j,include:0,order:P,...n.params,...f(e)},{resolveLinks:!1});return new p({page:n.page,total:a.total,size:n.size,items:a.items.map(U)})},pe=async({id:e,slug:t,locale:i})=>{const l=A({id:e,slug:t}),s=await r.client.getEntries({content_type:Y,...l,select:`${j},fields.body`,include:1,order:P,...f(i)},{resolveLinks:!1}),n=s.items.at(0);if(!n)throw k();return{...U(n),body:L(n.fields.body,g(s))}},ue=async({page:e=1,size:t=20,marketCode:i,locale:l}={})=>{const s=C(e,t),n=await r.client.getEntries({content_type:"hyperlinkCollection",select:"sys.id,fields.name,fields.slot,fields.order,fields.links",include:1,order:"fields.order",...s.params,...u(i),...f(l)},{resolveLinks:!1}),a=g(n);return new p({page:s.page,total:n.total,size:s.size,items:n.items.map(c=>({sys:{id:c.sys.id},name:o(c.fields.name),slot:o(c.fields.slot),order:o(c.fields.order),linksCollection:{items:a.entries(c.fields.links).map(d=>b(d))}}))})},me=async({page:e=1,size:t=20,marketCode:i,locale:l}={})=>{const s=C(e,t),n=await r.client.getEntries({content_type:"keywordCollection",select:"sys.id,fields.name,fields.slot,fields.keywords",include:0,order:m,...s.params,...u(i),...f(l)},{resolveLinks:!1});return new p({page:s.page,total:n.total,size:s.size,items:n.items.map(a=>({sys:{id:a.sys.id},name:o(a.fields.name),slot:o(a.fields.slot),keywords:o(a.fields.keywords)}))})},ye=async({marketCode:e,locale:t}={})=>{const i=await r.client.getEntries({content_type:"policyAndTerms",select:"sys.id,fields.title,fields.locale,fields.content",include:1,order:m,limit:1,...u(e),...f(t)},{resolveLinks:!1}),l=i.items.at(0);if(!l)throw k();return{sys:{id:l.sys.id},title:o(l.fields.title),locale:o(l.fields.locale),content:L(l.fields.content,g(i))}};exports.ContentfulSDK=r;exports.PaginatedResponse=p;exports.getBannerCollections=W;exports.getBlogCategories=ee;exports.getBlogCategoryDetail=te;exports.getBlogCollections=se;exports.getBlogPostDetail=Z;exports.getBlogPosts=X;exports.getBrandCollections=ie;exports.getDocArticleDetail=ae;exports.getDocArticles=ne;exports.getDocCategories=le;exports.getDocCategoryDetail=oe;exports.getHelpArticleDetail=pe;exports.getHelpArticles=ge;exports.getHelpCategories=fe;exports.getHyperlinkCollections=ue;exports.getKeywordCollections=me;exports.getPolicyAndTerms=ye;
|