@dani-builder/strapi-client 0.1.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/api/articles.d.ts +29 -0
- package/dist/api/articles.d.ts.map +1 -0
- package/dist/api/articles.js +54 -0
- package/dist/api/articles.js.map +1 -0
- package/dist/api/authors.d.ts +15 -0
- package/dist/api/authors.d.ts.map +1 -0
- package/dist/api/authors.js +27 -0
- package/dist/api/authors.js.map +1 -0
- package/dist/api/categories.d.ts +12 -0
- package/dist/api/categories.d.ts.map +1 -0
- package/dist/api/categories.js +14 -0
- package/dist/api/categories.js.map +1 -0
- package/dist/api/faqs.d.ts +13 -0
- package/dist/api/faqs.d.ts.map +1 -0
- package/dist/api/faqs.js +20 -0
- package/dist/api/faqs.js.map +1 -0
- package/dist/api/global.d.ts +15 -0
- package/dist/api/global.d.ts.map +1 -0
- package/dist/api/global.js +25 -0
- package/dist/api/global.js.map +1 -0
- package/dist/api/index.d.ts +21 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +12 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/inquiry.d.ts +7 -0
- package/dist/api/inquiry.d.ts.map +1 -0
- package/dist/api/inquiry.js +9 -0
- package/dist/api/inquiry.js.map +1 -0
- package/dist/api/navigation.d.ts +10 -0
- package/dist/api/navigation.d.ts.map +1 -0
- package/dist/api/navigation.js +15 -0
- package/dist/api/navigation.js.map +1 -0
- package/dist/api/pages.d.ts +30 -0
- package/dist/api/pages.d.ts.map +1 -0
- package/dist/api/pages.js +53 -0
- package/dist/api/pages.js.map +1 -0
- package/dist/api/series.d.ts +16 -0
- package/dist/api/series.d.ts.map +1 -0
- package/dist/api/series.js +29 -0
- package/dist/api/series.js.map +1 -0
- package/dist/api/site-settings.d.ts +7 -0
- package/dist/api/site-settings.d.ts.map +1 -0
- package/dist/api/site-settings.js +14 -0
- package/dist/api/site-settings.js.map +1 -0
- package/dist/api/tags.d.ts +12 -0
- package/dist/api/tags.d.ts.map +1 -0
- package/dist/api/tags.js +14 -0
- package/dist/api/tags.js.map +1 -0
- package/dist/client/create-client.d.ts +25 -0
- package/dist/client/create-client.d.ts.map +1 -0
- package/dist/client/create-client.js +31 -0
- package/dist/client/create-client.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/populate/builders.d.ts +125 -0
- package/dist/populate/builders.d.ts.map +1 -0
- package/dist/populate/builders.js +139 -0
- package/dist/populate/builders.js.map +1 -0
- package/dist/populate/core-blocks.d.ts +25 -0
- package/dist/populate/core-blocks.d.ts.map +1 -0
- package/dist/populate/core-blocks.js +167 -0
- package/dist/populate/core-blocks.js.map +1 -0
- package/dist/populate/index.d.ts +3 -0
- package/dist/populate/index.d.ts.map +1 -0
- package/dist/populate/index.js +3 -0
- package/dist/populate/index.js.map +1 -0
- package/dist/types/components/blocks.d.ts +94 -0
- package/dist/types/components/blocks.d.ts.map +1 -0
- package/dist/types/components/blocks.js +4 -0
- package/dist/types/components/blocks.js.map +1 -0
- package/dist/types/components/elements.d.ts +21 -0
- package/dist/types/components/elements.d.ts.map +1 -0
- package/dist/types/components/elements.js +4 -0
- package/dist/types/components/elements.js.map +1 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/index.js +2 -0
- package/dist/types/components/index.js.map +1 -0
- package/dist/types/components/shared.d.ts +116 -0
- package/dist/types/components/shared.d.ts.map +1 -0
- package/dist/types/components/shared.js +4 -0
- package/dist/types/components/shared.js.map +1 -0
- package/dist/types/content-types/article.d.ts +26 -0
- package/dist/types/content-types/article.d.ts.map +1 -0
- package/dist/types/content-types/article.js +4 -0
- package/dist/types/content-types/article.js.map +1 -0
- package/dist/types/content-types/author.d.ts +12 -0
- package/dist/types/content-types/author.d.ts.map +1 -0
- package/dist/types/content-types/author.js +4 -0
- package/dist/types/content-types/author.js.map +1 -0
- package/dist/types/content-types/category.d.ts +9 -0
- package/dist/types/content-types/category.d.ts.map +1 -0
- package/dist/types/content-types/category.js +4 -0
- package/dist/types/content-types/category.js.map +1 -0
- package/dist/types/content-types/faq.d.ts +10 -0
- package/dist/types/content-types/faq.d.ts.map +1 -0
- package/dist/types/content-types/faq.js +4 -0
- package/dist/types/content-types/faq.js.map +1 -0
- package/dist/types/content-types/global.d.ts +19 -0
- package/dist/types/content-types/global.d.ts.map +1 -0
- package/dist/types/content-types/global.js +4 -0
- package/dist/types/content-types/global.js.map +1 -0
- package/dist/types/content-types/index.d.ts +12 -0
- package/dist/types/content-types/index.d.ts.map +1 -0
- package/dist/types/content-types/index.js +2 -0
- package/dist/types/content-types/index.js.map +1 -0
- package/dist/types/content-types/inquiry.d.ts +18 -0
- package/dist/types/content-types/inquiry.d.ts.map +1 -0
- package/dist/types/content-types/inquiry.js +4 -0
- package/dist/types/content-types/inquiry.js.map +1 -0
- package/dist/types/content-types/navigation.d.ts +12 -0
- package/dist/types/content-types/navigation.d.ts.map +1 -0
- package/dist/types/content-types/navigation.js +4 -0
- package/dist/types/content-types/navigation.js.map +1 -0
- package/dist/types/content-types/page.d.ts +15 -0
- package/dist/types/content-types/page.d.ts.map +1 -0
- package/dist/types/content-types/page.js +4 -0
- package/dist/types/content-types/page.js.map +1 -0
- package/dist/types/content-types/series.d.ts +9 -0
- package/dist/types/content-types/series.d.ts.map +1 -0
- package/dist/types/content-types/series.js +4 -0
- package/dist/types/content-types/series.js.map +1 -0
- package/dist/types/content-types/site-settings.d.ts +10 -0
- package/dist/types/content-types/site-settings.d.ts.map +1 -0
- package/dist/types/content-types/site-settings.js +4 -0
- package/dist/types/content-types/site-settings.js.map +1 -0
- package/dist/types/content-types/tag.d.ts +10 -0
- package/dist/types/content-types/tag.d.ts.map +1 -0
- package/dist/types/content-types/tag.js +4 -0
- package/dist/types/content-types/tag.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/strapi.d.ts +126 -0
- package/dist/types/strapi.d.ts.map +1 -0
- package/dist/types/strapi.js +4 -0
- package/dist/types/strapi.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/media.d.ts +12 -0
- package/dist/utils/media.d.ts.map +1 -0
- package/dist/utils/media.js +25 -0
- package/dist/utils/media.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
3
|
+
import type { ArticleDocument } from '../types/content-types/article.js';
|
|
4
|
+
export interface ArticleQueryOptions {
|
|
5
|
+
locale?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ArticleListOptions {
|
|
8
|
+
locale?: string;
|
|
9
|
+
page?: number;
|
|
10
|
+
pageSize?: number;
|
|
11
|
+
category?: string;
|
|
12
|
+
tag?: string;
|
|
13
|
+
author?: string;
|
|
14
|
+
series?: string;
|
|
15
|
+
sort?: string | string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get a single article by documentId.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getArticle(client: AxiosInstance, documentId: string, options?: ArticleQueryOptions): Promise<ArticleDocument>;
|
|
21
|
+
/**
|
|
22
|
+
* Get an article by slug.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getArticleBySlug(client: AxiosInstance, slug: string, options?: ArticleQueryOptions): Promise<ArticleDocument | null>;
|
|
25
|
+
/**
|
|
26
|
+
* List articles with filtering, sorting, and pagination.
|
|
27
|
+
*/
|
|
28
|
+
export declare function listArticles(client: AxiosInstance, options?: ArticleListOptions): Promise<StrapiCollectionResponse<ArticleDocument>>;
|
|
29
|
+
//# sourceMappingURL=articles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"articles.d.ts","sourceRoot":"","sources":["../../src/api/articles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAkB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGzE,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,4BASlG;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,mCAUlG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,kBAAkB,sDAkB/E"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getArticlePopulate, getArticleListPopulate } from '../populate/builders.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get a single article by documentId.
|
|
4
|
+
*/
|
|
5
|
+
export function getArticle(client, documentId, options) {
|
|
6
|
+
return client
|
|
7
|
+
.get(`/api/articles/${documentId}`, {
|
|
8
|
+
params: {
|
|
9
|
+
populate: getArticlePopulate(),
|
|
10
|
+
locale: options?.locale,
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
.then((res) => res.data.data);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get an article by slug.
|
|
17
|
+
*/
|
|
18
|
+
export function getArticleBySlug(client, slug, options) {
|
|
19
|
+
return client
|
|
20
|
+
.get('/api/articles', {
|
|
21
|
+
params: {
|
|
22
|
+
filters: { slug: { $eq: slug } },
|
|
23
|
+
populate: getArticlePopulate(),
|
|
24
|
+
locale: options?.locale,
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
.then((res) => res.data.data[0] ?? null);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* List articles with filtering, sorting, and pagination.
|
|
31
|
+
*/
|
|
32
|
+
export function listArticles(client, options) {
|
|
33
|
+
const filters = {};
|
|
34
|
+
if (options?.category)
|
|
35
|
+
filters['categories'] = { slug: { $eq: options.category } };
|
|
36
|
+
if (options?.tag)
|
|
37
|
+
filters['tags'] = { slug: { $eq: options.tag } };
|
|
38
|
+
if (options?.author)
|
|
39
|
+
filters['author'] = { slug: { $eq: options.author } };
|
|
40
|
+
if (options?.series)
|
|
41
|
+
filters['series'] = { slug: { $eq: options.series } };
|
|
42
|
+
return client
|
|
43
|
+
.get('/api/articles', {
|
|
44
|
+
params: {
|
|
45
|
+
populate: getArticleListPopulate(),
|
|
46
|
+
filters: Object.keys(filters).length > 0 ? filters : undefined,
|
|
47
|
+
sort: options?.sort ?? 'firstPublishedAt:desc',
|
|
48
|
+
locale: options?.locale,
|
|
49
|
+
pagination: options?.page != null ? { page: options.page, pageSize: options.pageSize } : undefined,
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
.then((res) => res.data);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=articles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"articles.js","sourceRoot":"","sources":["../../src/api/articles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAiBrF;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,MAAqB,EAAE,UAAkB,EAAE,OAA6B;IACjG,OAAO,MAAM;SACV,GAAG,CAAkC,iBAAiB,UAAU,EAAE,EAAE;QACnE,MAAM,EAAE;YACN,QAAQ,EAAE,kBAAkB,EAAE;YAC9B,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAqB,EAAE,IAAY,EAAE,OAA6B;IACjG,OAAO,MAAM;SACV,GAAG,CAA4C,eAAe,EAAE;QAC/D,MAAM,EAAE;YACN,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAChC,QAAQ,EAAE,kBAAkB,EAAE;YAC9B,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAqB,EAAE,OAA4B;IAC9E,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,IAAI,OAAO,EAAE,QAAQ;QAAE,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;IACnF,IAAI,OAAO,EAAE,GAAG;QAAE,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;IACnE,IAAI,OAAO,EAAE,MAAM;QAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAC3E,IAAI,OAAO,EAAE,MAAM;QAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAE3E,OAAO,MAAM;SACV,GAAG,CAA4C,eAAe,EAAE;QAC/D,MAAM,EAAE;YACN,QAAQ,EAAE,sBAAsB,EAAE;YAClC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YAC9D,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,uBAAuB;YAC9C,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,UAAU,EAAE,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;SACnG;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
3
|
+
import type { AuthorDocument } from '../types/content-types/author.js';
|
|
4
|
+
export interface AuthorListOptions {
|
|
5
|
+
sort?: string | string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* List all authors.
|
|
9
|
+
*/
|
|
10
|
+
export declare function listAuthors(client: AxiosInstance, options?: AuthorListOptions): Promise<StrapiCollectionResponse<AuthorDocument>>;
|
|
11
|
+
/**
|
|
12
|
+
* Get an author by slug.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAuthorBySlug(client: AxiosInstance, slug: string): Promise<AuthorDocument | null>;
|
|
15
|
+
//# sourceMappingURL=authors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authors.d.ts","sourceRoot":"","sources":["../../src/api/authors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB,qDAS7E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,kCASlE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List all authors.
|
|
3
|
+
*/
|
|
4
|
+
export function listAuthors(client, options) {
|
|
5
|
+
return client
|
|
6
|
+
.get('/api/authors', {
|
|
7
|
+
params: {
|
|
8
|
+
populate: { avatar: true },
|
|
9
|
+
sort: options?.sort ?? 'name:asc',
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
.then((res) => res.data);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get an author by slug.
|
|
16
|
+
*/
|
|
17
|
+
export function getAuthorBySlug(client, slug) {
|
|
18
|
+
return client
|
|
19
|
+
.get('/api/authors', {
|
|
20
|
+
params: {
|
|
21
|
+
filters: { slug: { $eq: slug } },
|
|
22
|
+
populate: { avatar: true },
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
.then((res) => res.data.data[0] ?? null);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=authors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authors.js","sourceRoot":"","sources":["../../src/api/authors.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAqB,EAAE,OAA2B;IAC5E,OAAO,MAAM;SACV,GAAG,CAA2C,cAAc,EAAE;QAC7D,MAAM,EAAE;YACN,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YAC1B,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,UAAU;SAClC;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAqB,EAAE,IAAY;IACjE,OAAO,MAAM;SACV,GAAG,CAA2C,cAAc,EAAE;QAC7D,MAAM,EAAE;YACN,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAChC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SAC3B;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
3
|
+
import type { CategoryDocument } from '../types/content-types/category.js';
|
|
4
|
+
export interface CategoryListOptions {
|
|
5
|
+
locale?: string;
|
|
6
|
+
sort?: string | string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* List all categories.
|
|
10
|
+
*/
|
|
11
|
+
export declare function listCategories(client: AxiosInstance, options?: CategoryListOptions): Promise<StrapiCollectionResponse<CategoryDocument>>;
|
|
12
|
+
//# sourceMappingURL=categories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../src/api/categories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,mBAAmB,uDASlF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List all categories.
|
|
3
|
+
*/
|
|
4
|
+
export function listCategories(client, options) {
|
|
5
|
+
return client
|
|
6
|
+
.get('/api/categories', {
|
|
7
|
+
params: {
|
|
8
|
+
sort: options?.sort ?? 'sortOrder:asc',
|
|
9
|
+
locale: options?.locale,
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
.then((res) => res.data);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/api/categories.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAqB,EAAE,OAA6B;IACjF,OAAO,MAAM;SACV,GAAG,CAA6C,iBAAiB,EAAE;QAClE,MAAM,EAAE;YACN,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,eAAe;YACtC,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
3
|
+
import type { FaqDocument } from '../types/content-types/faq.js';
|
|
4
|
+
export interface FaqListOptions {
|
|
5
|
+
locale?: string;
|
|
6
|
+
category?: string;
|
|
7
|
+
sort?: string | string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List FAQs with optional category filter.
|
|
11
|
+
*/
|
|
12
|
+
export declare function listFaqs(client: AxiosInstance, options?: FaqListOptions): Promise<StrapiCollectionResponse<FaqDocument>>;
|
|
13
|
+
//# sourceMappingURL=faqs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faqs.d.ts","sourceRoot":"","sources":["../../src/api/faqs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGjE,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,cAAc,kDAcvE"}
|
package/dist/api/faqs.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getFaqPopulate } from '../populate/builders.js';
|
|
2
|
+
/**
|
|
3
|
+
* List FAQs with optional category filter.
|
|
4
|
+
*/
|
|
5
|
+
export function listFaqs(client, options) {
|
|
6
|
+
const filters = {};
|
|
7
|
+
if (options?.category)
|
|
8
|
+
filters['category'] = { slug: { $eq: options.category } };
|
|
9
|
+
return client
|
|
10
|
+
.get('/api/faqs', {
|
|
11
|
+
params: {
|
|
12
|
+
populate: getFaqPopulate(),
|
|
13
|
+
filters: Object.keys(filters).length > 0 ? filters : undefined,
|
|
14
|
+
sort: options?.sort ?? 'sortOrder:asc',
|
|
15
|
+
locale: options?.locale,
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
.then((res) => res.data);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=faqs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faqs.js","sourceRoot":"","sources":["../../src/api/faqs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAQzD;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAqB,EAAE,OAAwB;IACtE,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,IAAI,OAAO,EAAE,QAAQ;QAAE,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;IAEjF,OAAO,MAAM;SACV,GAAG,CAAwC,WAAW,EAAE;QACvD,MAAM,EAAE;YACN,QAAQ,EAAE,cAAc,EAAE;YAC1B,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YAC9D,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,eAAe;YACtC,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { GlobalDocument } from '../types/content-types/global.js';
|
|
3
|
+
export interface GlobalQueryOptions {
|
|
4
|
+
locale?: string;
|
|
5
|
+
customBlocks?: Record<string, object>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Get Global single type via Smart endpoint (server-side populate).
|
|
9
|
+
*/
|
|
10
|
+
export declare function getGlobal(client: AxiosInstance, options?: GlobalQueryOptions): Promise<GlobalDocument>;
|
|
11
|
+
/**
|
|
12
|
+
* Get Global via standard REST (client-side populate).
|
|
13
|
+
*/
|
|
14
|
+
export declare function getGlobalRest(client: AxiosInstance, options?: GlobalQueryOptions): Promise<GlobalDocument>;
|
|
15
|
+
//# sourceMappingURL=global.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/api/global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,kBAAkB,2BAM5E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,kBAAkB,2BAShF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getGlobalPopulate } from '../populate/builders.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get Global single type via Smart endpoint (server-side populate).
|
|
4
|
+
*/
|
|
5
|
+
export function getGlobal(client, options) {
|
|
6
|
+
return client
|
|
7
|
+
.get('/api/builder/global', {
|
|
8
|
+
params: { locale: options?.locale },
|
|
9
|
+
})
|
|
10
|
+
.then((res) => res.data.data);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get Global via standard REST (client-side populate).
|
|
14
|
+
*/
|
|
15
|
+
export function getGlobalRest(client, options) {
|
|
16
|
+
return client
|
|
17
|
+
.get('/api/global', {
|
|
18
|
+
params: {
|
|
19
|
+
populate: getGlobalPopulate(options?.customBlocks),
|
|
20
|
+
locale: options?.locale,
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
.then((res) => res.data.data);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/api/global.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAO5D;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,MAAqB,EAAE,OAA4B;IAC3E,OAAO,MAAM;SACV,GAAG,CAAiC,qBAAqB,EAAE;QAC1D,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;KACpC,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAqB,EAAE,OAA4B;IAC/E,OAAO,MAAM;SACV,GAAG,CAAiC,aAAa,EAAE;QAClD,MAAM,EAAE;YACN,QAAQ,EAAE,iBAAiB,CAAC,OAAO,EAAE,YAAY,CAAC;YAClD,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { getPage, getPageBySlug, listPages, listPagesRest } from './pages.js';
|
|
2
|
+
export type { PageQueryOptions, PageListOptions } from './pages.js';
|
|
3
|
+
export { getArticle, getArticleBySlug, listArticles } from './articles.js';
|
|
4
|
+
export type { ArticleQueryOptions, ArticleListOptions } from './articles.js';
|
|
5
|
+
export { getGlobal, getGlobalRest } from './global.js';
|
|
6
|
+
export type { GlobalQueryOptions } from './global.js';
|
|
7
|
+
export { getNavigation } from './navigation.js';
|
|
8
|
+
export type { NavigationQueryOptions } from './navigation.js';
|
|
9
|
+
export { getSiteSettings } from './site-settings.js';
|
|
10
|
+
export { listFaqs } from './faqs.js';
|
|
11
|
+
export type { FaqListOptions } from './faqs.js';
|
|
12
|
+
export { listCategories } from './categories.js';
|
|
13
|
+
export type { CategoryListOptions } from './categories.js';
|
|
14
|
+
export { listTags } from './tags.js';
|
|
15
|
+
export type { TagListOptions } from './tags.js';
|
|
16
|
+
export { listAuthors, getAuthorBySlug } from './authors.js';
|
|
17
|
+
export type { AuthorListOptions } from './authors.js';
|
|
18
|
+
export { listSeries, getSeriesBySlug } from './series.js';
|
|
19
|
+
export type { SeriesListOptions } from './series.js';
|
|
20
|
+
export { postInquiry } from './inquiry.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9E,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE7E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { getPage, getPageBySlug, listPages, listPagesRest } from './pages.js';
|
|
2
|
+
export { getArticle, getArticleBySlug, listArticles } from './articles.js';
|
|
3
|
+
export { getGlobal, getGlobalRest } from './global.js';
|
|
4
|
+
export { getNavigation } from './navigation.js';
|
|
5
|
+
export { getSiteSettings } from './site-settings.js';
|
|
6
|
+
export { listFaqs } from './faqs.js';
|
|
7
|
+
export { listCategories } from './categories.js';
|
|
8
|
+
export { listTags } from './tags.js';
|
|
9
|
+
export { listAuthors, getAuthorBySlug } from './authors.js';
|
|
10
|
+
export { listSeries, getSeriesBySlug } from './series.js';
|
|
11
|
+
export { postInquiry } from './inquiry.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG3E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { InquiryDocument, InquiryFormData } from '../types/content-types/inquiry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Submit an inquiry form (POST).
|
|
5
|
+
*/
|
|
6
|
+
export declare function postInquiry(client: AxiosInstance, data: InquiryFormData): Promise<InquiryDocument>;
|
|
7
|
+
//# sourceMappingURL=inquiry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inquiry.d.ts","sourceRoot":"","sources":["../../src/api/inquiry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAE1F;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,4BAIvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inquiry.js","sourceRoot":"","sources":["../../src/api/inquiry.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAqB,EAAE,IAAqB;IACtE,OAAO,MAAM;SACV,IAAI,CAAkC,gBAAgB,EAAE,EAAE,IAAI,EAAE,CAAC;SACjE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { NavigationDocument } from '../types/content-types/navigation.js';
|
|
3
|
+
export interface NavigationQueryOptions {
|
|
4
|
+
locale?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Get Navigation single type.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getNavigation(client: AxiosInstance, options?: NavigationQueryOptions): Promise<NavigationDocument>;
|
|
10
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/api/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,sBAAsB,+BASpF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getNavigationPopulate } from '../populate/builders.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get Navigation single type.
|
|
4
|
+
*/
|
|
5
|
+
export function getNavigation(client, options) {
|
|
6
|
+
return client
|
|
7
|
+
.get('/api/navigation', {
|
|
8
|
+
params: {
|
|
9
|
+
populate: getNavigationPopulate(),
|
|
10
|
+
locale: options?.locale,
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
.then((res) => res.data.data);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/api/navigation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAMhE;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAqB,EAAE,OAAgC;IACnF,OAAO,MAAM;SACV,GAAG,CAAqC,iBAAiB,EAAE;QAC1D,MAAM,EAAE;YACN,QAAQ,EAAE,qBAAqB,EAAE;YACjC,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
3
|
+
import type { PageDocument } from '../types/content-types/page.js';
|
|
4
|
+
export interface PageQueryOptions {
|
|
5
|
+
locale?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PageListOptions {
|
|
8
|
+
locale?: string;
|
|
9
|
+
page?: number;
|
|
10
|
+
pageSize?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get a single page by documentId via Smart endpoint (server-side populate).
|
|
14
|
+
*/
|
|
15
|
+
export declare function getPage(client: AxiosInstance, documentId: string, options?: PageQueryOptions): Promise<PageDocument>;
|
|
16
|
+
/**
|
|
17
|
+
* Get a page by slug via standard REST (client-side populate).
|
|
18
|
+
*/
|
|
19
|
+
export declare function getPageBySlug(client: AxiosInstance, slug: string, options?: PageQueryOptions & {
|
|
20
|
+
customBlocks?: Record<string, object>;
|
|
21
|
+
}): Promise<PageDocument | null>;
|
|
22
|
+
/**
|
|
23
|
+
* List pages via Smart endpoint (minimal populate, no blocks).
|
|
24
|
+
*/
|
|
25
|
+
export declare function listPages(client: AxiosInstance, options?: PageListOptions): Promise<StrapiCollectionResponse<PageDocument>>;
|
|
26
|
+
/**
|
|
27
|
+
* List pages via standard REST (with populate control).
|
|
28
|
+
*/
|
|
29
|
+
export declare function listPagesRest(client: AxiosInstance, options?: PageListOptions): Promise<StrapiCollectionResponse<PageDocument>>;
|
|
30
|
+
//# sourceMappingURL=pages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/api/pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAkB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAGnE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,yBAM5F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,gBAAgB,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,gCAWvE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,eAAe,mDASzE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,eAAe,mDAU7E"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { getPagePopulate, getPageListPopulate } from '../populate/builders.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get a single page by documentId via Smart endpoint (server-side populate).
|
|
4
|
+
*/
|
|
5
|
+
export function getPage(client, documentId, options) {
|
|
6
|
+
return client
|
|
7
|
+
.get(`/api/builder/pages/${documentId}`, {
|
|
8
|
+
params: { locale: options?.locale },
|
|
9
|
+
})
|
|
10
|
+
.then((res) => res.data.data);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get a page by slug via standard REST (client-side populate).
|
|
14
|
+
*/
|
|
15
|
+
export function getPageBySlug(client, slug, options) {
|
|
16
|
+
return client
|
|
17
|
+
.get('/api/pages', {
|
|
18
|
+
params: {
|
|
19
|
+
filters: { slug: { $eq: slug } },
|
|
20
|
+
populate: getPagePopulate(options?.customBlocks),
|
|
21
|
+
locale: options?.locale,
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
.then((res) => res.data.data[0] ?? null);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List pages via Smart endpoint (minimal populate, no blocks).
|
|
28
|
+
*/
|
|
29
|
+
export function listPages(client, options) {
|
|
30
|
+
return client
|
|
31
|
+
.get('/api/builder/pages', {
|
|
32
|
+
params: {
|
|
33
|
+
locale: options?.locale,
|
|
34
|
+
pagination: options?.page != null ? { page: options.page, pageSize: options.pageSize } : undefined,
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
.then((res) => res.data);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* List pages via standard REST (with populate control).
|
|
41
|
+
*/
|
|
42
|
+
export function listPagesRest(client, options) {
|
|
43
|
+
return client
|
|
44
|
+
.get('/api/pages', {
|
|
45
|
+
params: {
|
|
46
|
+
populate: getPageListPopulate(),
|
|
47
|
+
locale: options?.locale,
|
|
48
|
+
pagination: options?.page != null ? { page: options.page, pageSize: options.pageSize } : undefined,
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
.then((res) => res.data);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../src/api/pages.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAY/E;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,MAAqB,EAAE,UAAkB,EAAE,OAA0B;IAC3F,OAAO,MAAM;SACV,GAAG,CAA+B,sBAAsB,UAAU,EAAE,EAAE;QACrE,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;KACpC,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAqB,EACrB,IAAY,EACZ,OAAsE;IAEtE,OAAO,MAAM;SACV,GAAG,CAAyC,YAAY,EAAE;QACzD,MAAM,EAAE;YACN,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAChC,QAAQ,EAAE,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC;YAChD,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,MAAqB,EAAE,OAAyB;IACxE,OAAO,MAAM;SACV,GAAG,CAAyC,oBAAoB,EAAE;QACjE,MAAM,EAAE;YACN,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,UAAU,EAAE,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;SACnG;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAqB,EAAE,OAAyB;IAC5E,OAAO,MAAM;SACV,GAAG,CAAyC,YAAY,EAAE;QACzD,MAAM,EAAE;YACN,QAAQ,EAAE,mBAAmB,EAAE;YAC/B,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,UAAU,EAAE,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;SACnG;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
3
|
+
import type { SeriesDocument } from '../types/content-types/series.js';
|
|
4
|
+
export interface SeriesListOptions {
|
|
5
|
+
locale?: string;
|
|
6
|
+
sort?: string | string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* List all series.
|
|
10
|
+
*/
|
|
11
|
+
export declare function listSeries(client: AxiosInstance, options?: SeriesListOptions): Promise<StrapiCollectionResponse<SeriesDocument>>;
|
|
12
|
+
/**
|
|
13
|
+
* Get a series by slug.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getSeriesBySlug(client: AxiosInstance, slug: string, locale?: string): Promise<SeriesDocument | null>;
|
|
16
|
+
//# sourceMappingURL=series.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"series.d.ts","sourceRoot":"","sources":["../../src/api/series.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB,qDAU5E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,kCAUnF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List all series.
|
|
3
|
+
*/
|
|
4
|
+
export function listSeries(client, options) {
|
|
5
|
+
return client
|
|
6
|
+
.get('/api/all-series', {
|
|
7
|
+
params: {
|
|
8
|
+
populate: { cover: true },
|
|
9
|
+
sort: options?.sort ?? 'name:asc',
|
|
10
|
+
locale: options?.locale,
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
.then((res) => res.data);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get a series by slug.
|
|
17
|
+
*/
|
|
18
|
+
export function getSeriesBySlug(client, slug, locale) {
|
|
19
|
+
return client
|
|
20
|
+
.get('/api/all-series', {
|
|
21
|
+
params: {
|
|
22
|
+
filters: { slug: { $eq: slug } },
|
|
23
|
+
populate: { cover: true },
|
|
24
|
+
locale,
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
.then((res) => res.data.data[0] ?? null);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=series.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"series.js","sourceRoot":"","sources":["../../src/api/series.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,MAAqB,EAAE,OAA2B;IAC3E,OAAO,MAAM;SACV,GAAG,CAA2C,iBAAiB,EAAE;QAChE,MAAM,EAAE;YACN,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YACzB,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,UAAU;YACjC,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAqB,EAAE,IAAY,EAAE,MAAe;IAClF,OAAO,MAAM;SACV,GAAG,CAA2C,iBAAiB,EAAE;QAChE,MAAM,EAAE;YACN,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAChC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YACzB,MAAM;SACP;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { SiteSettingsDocument } from '../types/content-types/site-settings.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get SiteSettings single type.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getSiteSettings(client: AxiosInstance): Promise<SiteSettingsDocument>;
|
|
7
|
+
//# sourceMappingURL=site-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-settings.d.ts","sourceRoot":"","sources":["../../src/api/site-settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAGpF;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,iCAQpD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getSiteSettingsPopulate } from '../populate/builders.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get SiteSettings single type.
|
|
4
|
+
*/
|
|
5
|
+
export function getSiteSettings(client) {
|
|
6
|
+
return client
|
|
7
|
+
.get('/api/site-setting', {
|
|
8
|
+
params: {
|
|
9
|
+
populate: getSiteSettingsPopulate(),
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
.then((res) => res.data.data);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=site-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-settings.js","sourceRoot":"","sources":["../../src/api/site-settings.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAqB;IACnD,OAAO,MAAM;SACV,GAAG,CAAuC,mBAAmB,EAAE;QAC9D,MAAM,EAAE;YACN,QAAQ,EAAE,uBAAuB,EAAE;SACpC;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
3
|
+
import type { TagDocument } from '../types/content-types/tag.js';
|
|
4
|
+
export interface TagListOptions {
|
|
5
|
+
locale?: string;
|
|
6
|
+
sort?: string | string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* List all tags.
|
|
10
|
+
*/
|
|
11
|
+
export declare function listTags(client: AxiosInstance, options?: TagListOptions): Promise<StrapiCollectionResponse<TagDocument>>;
|
|
12
|
+
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../src/api/tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,cAAc,kDASvE"}
|
package/dist/api/tags.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List all tags.
|
|
3
|
+
*/
|
|
4
|
+
export function listTags(client, options) {
|
|
5
|
+
return client
|
|
6
|
+
.get('/api/tags', {
|
|
7
|
+
params: {
|
|
8
|
+
sort: options?.sort ?? 'name:asc',
|
|
9
|
+
locale: options?.locale,
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
.then((res) => res.data);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/api/tags.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAqB,EAAE,OAAwB;IACtE,OAAO,MAAM;SACV,GAAG,CAAwC,WAAW,EAAE;QACvD,MAAM,EAAE;YACN,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,UAAU;YACjC,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|