@dani-builder/strapi-client 0.2.0 → 0.4.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/AGENTS.md +9 -5
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/api/articles.d.ts +3 -0
- package/dist/api/articles.d.ts.map +1 -1
- package/dist/api/articles.js +8 -5
- package/dist/api/articles.js.map +1 -1
- package/dist/api/authors.d.ts +2 -0
- package/dist/api/authors.d.ts.map +1 -1
- package/dist/api/authors.js +5 -2
- package/dist/api/authors.js.map +1 -1
- package/dist/api/categories.d.ts +2 -0
- package/dist/api/categories.d.ts.map +1 -1
- package/dist/api/categories.js +4 -1
- package/dist/api/categories.js.map +1 -1
- package/dist/api/faqs.d.ts +2 -0
- package/dist/api/faqs.d.ts.map +1 -1
- package/dist/api/faqs.js +4 -1
- package/dist/api/faqs.js.map +1 -1
- package/dist/api/global.js +1 -1
- package/dist/api/global.js.map +1 -1
- package/dist/api/inquiry.js +1 -1
- package/dist/api/inquiry.js.map +1 -1
- package/dist/api/navigation.js +1 -1
- package/dist/api/navigation.js.map +1 -1
- package/dist/api/pages.d.ts +9 -1
- package/dist/api/pages.d.ts.map +1 -1
- package/dist/api/pages.js +26 -9
- package/dist/api/pages.js.map +1 -1
- package/dist/api/series.d.ts +2 -0
- package/dist/api/series.d.ts.map +1 -1
- package/dist/api/series.js +5 -2
- package/dist/api/series.js.map +1 -1
- package/dist/api/site-settings.js +1 -1
- package/dist/api/site-settings.js.map +1 -1
- package/dist/api/tags.d.ts +2 -0
- package/dist/api/tags.d.ts.map +1 -1
- package/dist/api/tags.js +4 -1
- package/dist/api/tags.js.map +1 -1
- package/dist/client/create-client.d.ts +7 -3
- package/dist/client/create-client.d.ts.map +1 -1
- package/dist/client/create-client.js +13 -5
- package/dist/client/create-client.js.map +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/populate/builders.d.ts +12 -0
- package/dist/populate/builders.d.ts.map +1 -1
- package/dist/populate/builders.js +10 -0
- package/dist/populate/builders.js.map +1 -1
- package/dist/populate/core-blocks.d.ts.map +1 -1
- package/dist/populate/core-blocks.js +15 -9
- package/dist/populate/core-blocks.js.map +1 -1
- package/dist/types/components/blocks.d.ts +12 -11
- package/dist/types/components/blocks.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/shared.d.ts +14 -3
- package/dist/types/components/shared.d.ts.map +1 -1
- package/dist/types/components/shared.js +1 -1
- package/dist/types/content-types/article.d.ts +3 -1
- package/dist/types/content-types/article.d.ts.map +1 -1
- package/dist/types/content-types/article.js +1 -1
- package/dist/types/content-types/article.js.map +1 -1
- package/dist/types/content-types/author.js +1 -1
- package/dist/types/content-types/author.js.map +1 -1
- package/dist/types/content-types/category.js +1 -1
- package/dist/types/content-types/category.js.map +1 -1
- package/dist/types/content-types/faq.js +1 -1
- package/dist/types/content-types/faq.js.map +1 -1
- package/dist/types/content-types/global.js +1 -1
- package/dist/types/content-types/global.js.map +1 -1
- package/dist/types/content-types/inquiry.js +1 -1
- package/dist/types/content-types/inquiry.js.map +1 -1
- package/dist/types/content-types/navigation.js +1 -1
- package/dist/types/content-types/navigation.js.map +1 -1
- package/dist/types/content-types/page.d.ts +12 -3
- package/dist/types/content-types/page.d.ts.map +1 -1
- package/dist/types/content-types/page.js +1 -1
- package/dist/types/content-types/page.js.map +1 -1
- package/dist/types/content-types/series.js +1 -1
- package/dist/types/content-types/series.js.map +1 -1
- package/dist/types/content-types/site-settings.js +1 -1
- package/dist/types/content-types/site-settings.js.map +1 -1
- package/dist/types/content-types/tag.js +1 -1
- package/dist/types/content-types/tag.js.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/strapi.d.ts +10 -0
- package/dist/types/strapi.d.ts.map +1 -1
- package/docs/api-guide.md +22 -22
- package/docs/block-reference.md +147 -554
- package/docs/components.md +234 -0
- package/docs/content-types.md +173 -382
- package/docs/elements.md +50 -0
- package/package.json +25 -8
package/AGENTS.md
CHANGED
|
@@ -32,12 +32,12 @@ const global = await getGlobal(client, { locale: 'ko' }); // Smart endpoint
|
|
|
32
32
|
## Critical Rules
|
|
33
33
|
|
|
34
34
|
1. **Variants are exact enum values** — DO NOT invent variant names. Only use values defined in the type (e.g. `'side-by-side' | 'media-extending' | 'fullscreen-media' | 'stacked-media'` for HeroBlock). See [Block Reference](./docs/block-reference.md).
|
|
35
|
-
2. **Media policy varies by field** — Some fields accept images+videos, others images-only. Check the block's media policy before rendering `<video
|
|
35
|
+
2. **Media policy varies by field** — Some fields accept images+videos, others images-only. Check the block's media policy before rendering `<video>`; each block's attribute table lists `allowed:` per media field. See [Block Reference](./docs/block-reference.md).
|
|
36
36
|
3. **All media fields are nullable** — Always render defensively (`asset && <img ... />`). Even required media in sub-components may be null at the API level.
|
|
37
37
|
4. **BlocksContent is structured JSON** — `Article.body`, `FAQ.answer`, and `ContentBlock.body` are `BlockNode[]` arrays, NOT HTML or Markdown. Use a Blocks renderer.
|
|
38
38
|
5. **Section.theme is a Tailwind preset key** — Map to your design tokens (e.g. `'dark'` → dark background + light text). DO NOT apply arbitrary CSS colors.
|
|
39
39
|
6. **`name` fields are admin-only** — Blocks with `name` (Features, Slider, Highlights, etc.) use it for CMS identification. DO NOT display it in the frontend.
|
|
40
|
-
7. **Series uses `/api/all-series`** — The pluralName differs from singularName. DO NOT use `/api/series`.
|
|
40
|
+
7. **Series uses `/api/builder/all-series`** — The pluralName differs from singularName. DO NOT use `/api/builder/series`.
|
|
41
41
|
8. **Inquiry has no draftAndPublish** — `postInquiry` creates immediately-visible records. No publish step needed.
|
|
42
42
|
|
|
43
43
|
## MCP Content Creation Guide
|
|
@@ -58,7 +58,6 @@ LLM(Claude Code)이 MCP를 통해 Strapi CMS에 직접 페이지/콘텐츠를
|
|
|
58
58
|
{ "my-cms": { "api_url": "http://localhost:1337", "api_key": "<token>", "version": "5.*" } }
|
|
59
59
|
```
|
|
60
60
|
3. 프로젝트 루트 `.mcp.json`에 MCP 서버 설정 (상세: 프로젝트 CLAUDE.md 참조)
|
|
61
|
-
4. **`npx daniworks-builder sync` 필수** — schema뿐 아니라 routes/controllers/services도 생성하여 REST CRUD 엔드포인트 활성화
|
|
62
61
|
|
|
63
62
|
### 페이지 생성 패턴
|
|
64
63
|
|
|
@@ -113,5 +112,10 @@ LLM(Claude Code)이 MCP를 통해 Strapi CMS에 직접 페이지/콘텐츠를
|
|
|
113
112
|
| File | Content |
|
|
114
113
|
|------|---------|
|
|
115
114
|
| [docs/api-guide.md](./docs/api-guide.md) | Client setup, 19 API functions, Smart vs REST, populate builders, error handling, i18n |
|
|
116
|
-
| [docs/block-reference.md](./docs/block-reference.md) | 14 blocks
|
|
117
|
-
| [docs/content-types.md](./docs/content-types.md) | 11 content types: fields, relations, i18n,
|
|
115
|
+
| [docs/block-reference.md](./docs/block-reference.md) | 14 blocks: variants, fields, media policies |
|
|
116
|
+
| [docs/content-types.md](./docs/content-types.md) | 11 content types: fields, relations, i18n, dynamic-zone unions |
|
|
117
|
+
| [docs/elements.md](./docs/elements.md) | `elements.section` and other structural wrappers |
|
|
118
|
+
| [docs/components.md](./docs/components.md) | Shared sub-components referenced by blocks |
|
|
119
|
+
|
|
120
|
+
> The four reference files are **generated** from the plugin JSON schemas by
|
|
121
|
+
> `pnpm docs:gen` in the monorepo. Do not hand-edit them.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HJ-company
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @dani-builder/strapi-client
|
|
2
|
+
|
|
3
|
+
TypeScript client for the [Daniworks Builder](https://github.com/HJ-company/daniworks-builder-v2)
|
|
4
|
+
CMS (Strapi v5). Hand-curated types, deep-populate builders, and SSR-safe API
|
|
5
|
+
functions for every content type — pairs with
|
|
6
|
+
[`@dani-builder/strapi-plugin-builder`](https://www.npmjs.com/package/@dani-builder/strapi-plugin-builder).
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pnpm add @dani-builder/strapi-client
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
ESM-only (`"type": "module"`).
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Every API function takes an `AxiosInstance` (no singleton — SSR-safe):
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { createStrapiClient } from "@dani-builder/strapi-client/client";
|
|
22
|
+
import { getPageBySlug, getGlobal } from "@dani-builder/strapi-client/api";
|
|
23
|
+
|
|
24
|
+
const strapi = createStrapiClient({
|
|
25
|
+
baseUrl: process.env.STRAPI_URL,
|
|
26
|
+
apiToken: process.env.STRAPI_TOKEN,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const page = await getPageBySlug(strapi, "about");
|
|
30
|
+
const global = await getGlobal(strapi);
|
|
31
|
+
|
|
32
|
+
// Editor preview: pass status: "draft" (authenticated requests only).
|
|
33
|
+
const draft = await getPageBySlug(strapi, "about", { status: "draft" });
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Sub-exports
|
|
37
|
+
|
|
38
|
+
| Import | Contents |
|
|
39
|
+
|--------|----------|
|
|
40
|
+
| `@dani-builder/strapi-client/types` | Hand-curated content-type & block types |
|
|
41
|
+
| `@dani-builder/strapi-client/client` | `createStrapiClient` |
|
|
42
|
+
| `@dani-builder/strapi-client/api` | 19 API functions |
|
|
43
|
+
| `@dani-builder/strapi-client/populate` | 15 block populate builders |
|
|
44
|
+
| `@dani-builder/strapi-client/utils` | Media URL helpers |
|
|
45
|
+
|
|
46
|
+
See [`docs/block-reference.md`](./docs/block-reference.md) for the full block schema.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT © HJ-company
|
package/dist/api/articles.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
|
3
3
|
import type { ArticleDocument } from '../types/content-types/article.js';
|
|
4
4
|
export interface ArticleQueryOptions {
|
|
5
5
|
locale?: string;
|
|
6
|
+
/** Draft & Publish status. Defaults to published; `'draft'` is editor-preview
|
|
7
|
+
* only (authenticated) — never for anonymous public traffic. */
|
|
8
|
+
status?: 'draft' | 'published';
|
|
6
9
|
}
|
|
7
10
|
export interface ArticleListOptions {
|
|
8
11
|
locale?: string;
|
|
@@ -1 +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,
|
|
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,EAEV,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAMzE,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;qEACiE;IACjE,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CAChC;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,CACxB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,mBAAmB,4BAa9B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,mBAAmB,mCAY9B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,kBAAkB,sDAuB7B"}
|
package/dist/api/articles.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getArticlePopulate, getArticleListPopulate } from '../populate/builders.js';
|
|
1
|
+
import { getArticlePopulate, getArticleListPopulate, } from '../populate/builders.js';
|
|
2
2
|
/**
|
|
3
3
|
* Get a single article by documentId.
|
|
4
4
|
*/
|
|
5
5
|
export function getArticle(client, documentId, options) {
|
|
6
6
|
return client
|
|
7
|
-
.get(`/api/articles/${documentId}`, {
|
|
7
|
+
.get(`/api/builder/articles/${documentId}`, {
|
|
8
8
|
params: {
|
|
9
9
|
populate: getArticlePopulate(),
|
|
10
10
|
locale: options?.locale,
|
|
@@ -17,11 +17,12 @@ export function getArticle(client, documentId, options) {
|
|
|
17
17
|
*/
|
|
18
18
|
export function getArticleBySlug(client, slug, options) {
|
|
19
19
|
return client
|
|
20
|
-
.get('/api/articles', {
|
|
20
|
+
.get('/api/builder/articles', {
|
|
21
21
|
params: {
|
|
22
22
|
filters: { slug: { $eq: slug } },
|
|
23
23
|
populate: getArticlePopulate(),
|
|
24
24
|
locale: options?.locale,
|
|
25
|
+
status: options?.status === 'draft' ? 'draft' : undefined,
|
|
25
26
|
},
|
|
26
27
|
})
|
|
27
28
|
.then((res) => res.data.data[0] ?? null);
|
|
@@ -40,13 +41,15 @@ export function listArticles(client, options) {
|
|
|
40
41
|
if (options?.series)
|
|
41
42
|
filters['series'] = { slug: { $eq: options.series } };
|
|
42
43
|
return client
|
|
43
|
-
.get('/api/articles', {
|
|
44
|
+
.get('/api/builder/articles', {
|
|
44
45
|
params: {
|
|
45
46
|
populate: getArticleListPopulate(),
|
|
46
47
|
filters: Object.keys(filters).length > 0 ? filters : undefined,
|
|
47
48
|
sort: options?.sort ?? 'firstPublishedAt:desc',
|
|
48
49
|
locale: options?.locale,
|
|
49
|
-
pagination: options?.page != null
|
|
50
|
+
pagination: options?.page != null || options?.pageSize != null
|
|
51
|
+
? { page: options.page ?? 1, pageSize: options.pageSize }
|
|
52
|
+
: undefined,
|
|
50
53
|
},
|
|
51
54
|
})
|
|
52
55
|
.then((res) => res.data);
|
package/dist/api/articles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"articles.js","sourceRoot":"","sources":["../../src/api/articles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"articles.js","sourceRoot":"","sources":["../../src/api/articles.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAoBjC;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,MAAqB,EACrB,UAAkB,EAClB,OAA6B;IAE7B,OAAO,MAAM;SACV,GAAG,CACF,yBAAyB,UAAU,EAAE,EACrC;QACE,MAAM,EAAE;YACN,QAAQ,EAAE,kBAAkB,EAAE;YAC9B,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB;KACF,CACF;SACA,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAqB,EACrB,IAAY,EACZ,OAA6B;IAE7B,OAAO,MAAM;SACV,GAAG,CAA4C,uBAAuB,EAAE;QACvE,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;YACvB,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;SAC1D;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,CAC1B,MAAqB,EACrB,OAA4B;IAE5B,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,IAAI,OAAO,EAAE,QAAQ;QACnB,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC9D,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,uBAAuB,EAAE;QACvE,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,EACR,OAAO,EAAE,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE,QAAQ,IAAI,IAAI;gBAChD,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;gBACzD,CAAC,CAAC,SAAS;SAChB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/api/authors.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { AxiosInstance } from 'axios';
|
|
|
2
2
|
import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
3
3
|
import type { AuthorDocument } from '../types/content-types/author.js';
|
|
4
4
|
export interface AuthorListOptions {
|
|
5
|
+
page?: number;
|
|
6
|
+
pageSize?: number;
|
|
5
7
|
sort?: string | string[];
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
@@ -1 +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,
|
|
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,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,iBAAiB,qDAc5B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,kCASlE"}
|
package/dist/api/authors.js
CHANGED
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export function listAuthors(client, options) {
|
|
5
5
|
return client
|
|
6
|
-
.get('/api/authors', {
|
|
6
|
+
.get('/api/builder/authors', {
|
|
7
7
|
params: {
|
|
8
8
|
populate: { avatar: true },
|
|
9
9
|
sort: options?.sort ?? 'name:asc',
|
|
10
|
+
pagination: options?.page != null || options?.pageSize != null
|
|
11
|
+
? { page: options.page ?? 1, pageSize: options.pageSize }
|
|
12
|
+
: undefined,
|
|
10
13
|
},
|
|
11
14
|
})
|
|
12
15
|
.then((res) => res.data);
|
|
@@ -16,7 +19,7 @@ export function listAuthors(client, options) {
|
|
|
16
19
|
*/
|
|
17
20
|
export function getAuthorBySlug(client, slug) {
|
|
18
21
|
return client
|
|
19
|
-
.get('/api/authors', {
|
|
22
|
+
.get('/api/builder/authors', {
|
|
20
23
|
params: {
|
|
21
24
|
filters: { slug: { $eq: slug } },
|
|
22
25
|
populate: { avatar: true },
|
package/dist/api/authors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authors.js","sourceRoot":"","sources":["../../src/api/authors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authors.js","sourceRoot":"","sources":["../../src/api/authors.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,MAAqB,EACrB,OAA2B;IAE3B,OAAO,MAAM;SACV,GAAG,CAA2C,sBAAsB,EAAE;QACrE,MAAM,EAAE;YACN,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YAC1B,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,UAAU;YACjC,UAAU,EACR,OAAO,EAAE,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE,QAAQ,IAAI,IAAI;gBAChD,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;gBACzD,CAAC,CAAC,SAAS;SAChB;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,sBAAsB,EAAE;QACrE,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"}
|
package/dist/api/categories.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
|
3
3
|
import type { CategoryDocument } from '../types/content-types/category.js';
|
|
4
4
|
export interface CategoryListOptions {
|
|
5
5
|
locale?: string;
|
|
6
|
+
page?: number;
|
|
7
|
+
pageSize?: number;
|
|
6
8
|
sort?: string | string[];
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
@@ -1 +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,
|
|
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,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,mBAAmB,uDAiB9B"}
|
package/dist/api/categories.js
CHANGED
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export function listCategories(client, options) {
|
|
5
5
|
return client
|
|
6
|
-
.get('/api/categories', {
|
|
6
|
+
.get('/api/builder/categories', {
|
|
7
7
|
params: {
|
|
8
8
|
sort: options?.sort ?? 'sortOrder:asc',
|
|
9
9
|
locale: options?.locale,
|
|
10
|
+
pagination: options?.page != null || options?.pageSize != null
|
|
11
|
+
? { page: options.page ?? 1, pageSize: options.pageSize }
|
|
12
|
+
: undefined,
|
|
10
13
|
},
|
|
11
14
|
})
|
|
12
15
|
.then((res) => res.data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/api/categories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/api/categories.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAqB,EACrB,OAA6B;IAE7B,OAAO,MAAM;SACV,GAAG,CACF,yBAAyB,EACzB;QACE,MAAM,EAAE;YACN,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,eAAe;YACtC,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,UAAU,EACR,OAAO,EAAE,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE,QAAQ,IAAI,IAAI;gBAChD,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;gBACzD,CAAC,CAAC,SAAS;SAChB;KACF,CACF;SACA,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/api/faqs.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
|
3
3
|
import type { FaqDocument } from '../types/content-types/faq.js';
|
|
4
4
|
export interface FaqListOptions {
|
|
5
5
|
locale?: string;
|
|
6
|
+
page?: number;
|
|
7
|
+
pageSize?: number;
|
|
6
8
|
category?: string;
|
|
7
9
|
sort?: string | string[];
|
|
8
10
|
}
|
package/dist/api/faqs.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,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,kDAmBvE"}
|
package/dist/api/faqs.js
CHANGED
|
@@ -7,12 +7,15 @@ export function listFaqs(client, options) {
|
|
|
7
7
|
if (options?.category)
|
|
8
8
|
filters['category'] = { slug: { $eq: options.category } };
|
|
9
9
|
return client
|
|
10
|
-
.get('/api/faqs', {
|
|
10
|
+
.get('/api/builder/faqs', {
|
|
11
11
|
params: {
|
|
12
12
|
populate: getFaqPopulate(),
|
|
13
13
|
filters: Object.keys(filters).length > 0 ? filters : undefined,
|
|
14
14
|
sort: options?.sort ?? 'sortOrder:asc',
|
|
15
15
|
locale: options?.locale,
|
|
16
|
+
pagination: options?.page != null || options?.pageSize != null
|
|
17
|
+
? { page: options.page ?? 1, pageSize: options.pageSize }
|
|
18
|
+
: undefined,
|
|
16
19
|
},
|
|
17
20
|
})
|
|
18
21
|
.then((res) => res.data);
|
package/dist/api/faqs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faqs.js","sourceRoot":"","sources":["../../src/api/faqs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"faqs.js","sourceRoot":"","sources":["../../src/api/faqs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAUzD;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAqB,EAAE,OAAwB;IACtE,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,IAAI,OAAO,EAAE,QAAQ;QACnB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;IAE5D,OAAO,MAAM;SACV,GAAG,CAAwC,mBAAmB,EAAE;QAC/D,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;YACvB,UAAU,EACR,OAAO,EAAE,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE,QAAQ,IAAI,IAAI;gBAChD,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;gBACzD,CAAC,CAAC,SAAS;SAChB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/api/global.js
CHANGED
|
@@ -14,7 +14,7 @@ export function getGlobal(client, options) {
|
|
|
14
14
|
*/
|
|
15
15
|
export function getGlobalRest(client, options) {
|
|
16
16
|
return client
|
|
17
|
-
.get('/api/global', {
|
|
17
|
+
.get('/api/builder/global', {
|
|
18
18
|
params: {
|
|
19
19
|
populate: getGlobalPopulate(options?.customBlocks),
|
|
20
20
|
locale: options?.locale,
|
package/dist/api/global.js.map
CHANGED
|
@@ -1 +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,
|
|
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,qBAAqB,EAAE;QAC1D,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"}
|
package/dist/api/inquiry.js
CHANGED
package/dist/api/inquiry.js.map
CHANGED
|
@@ -1 +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,
|
|
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,wBAAwB,EAAE,EAAE,IAAI,EAAE,CAAC;SACzE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/api/navigation.js
CHANGED
|
@@ -4,7 +4,7 @@ import { getNavigationPopulate } from '../populate/builders.js';
|
|
|
4
4
|
*/
|
|
5
5
|
export function getNavigation(client, options) {
|
|
6
6
|
return client
|
|
7
|
-
.get('/api/navigation', {
|
|
7
|
+
.get('/api/builder/navigation', {
|
|
8
8
|
params: {
|
|
9
9
|
populate: getNavigationPopulate(),
|
|
10
10
|
locale: options?.locale,
|
|
@@ -1 +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,
|
|
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,yBAAyB,EAAE;QAClE,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"}
|
package/dist/api/pages.d.ts
CHANGED
|
@@ -3,18 +3,26 @@ import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
|
3
3
|
import type { PageDocument } from '../types/content-types/page.js';
|
|
4
4
|
export interface PageQueryOptions {
|
|
5
5
|
locale?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Draft & Publish status. Defaults to published. `'draft'` requires an
|
|
8
|
+
* authenticated request (editor preview) — never expose it to anonymous
|
|
9
|
+
* public traffic; the smart API stays published-only (S0-1).
|
|
10
|
+
*/
|
|
11
|
+
status?: 'draft' | 'published';
|
|
6
12
|
}
|
|
7
13
|
export interface PageListOptions {
|
|
8
14
|
locale?: string;
|
|
9
15
|
page?: number;
|
|
16
|
+
/** Limited by the smart endpoint's `api.rest.maxLimit` when enabled. */
|
|
10
17
|
pageSize?: number;
|
|
18
|
+
sort?: string | string[];
|
|
11
19
|
}
|
|
12
20
|
/**
|
|
13
21
|
* Get a single page by documentId via Smart endpoint (server-side populate).
|
|
14
22
|
*/
|
|
15
23
|
export declare function getPage(client: AxiosInstance, documentId: string, options?: PageQueryOptions): Promise<PageDocument>;
|
|
16
24
|
/**
|
|
17
|
-
* Get a page by slug
|
|
25
|
+
* Get a page by slug, then load it through the deep-populated Smart endpoint.
|
|
18
26
|
*/
|
|
19
27
|
export declare function getPageBySlug(client: AxiosInstance, slug: string, options?: PageQueryOptions & {
|
|
20
28
|
customBlocks?: Record<string, object>;
|
package/dist/api/pages.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,EAEV,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAGnE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAQD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,gBAAgB,yBAU3B;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,gCAoBvE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,eAAe,mDAUzE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,eAAe,mDAY1B"}
|
package/dist/api/pages.js
CHANGED
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getPageListPopulate } from '../populate/builders.js';
|
|
2
|
+
function getPagination(options) {
|
|
3
|
+
if (options?.page == null && options?.pageSize == null)
|
|
4
|
+
return undefined;
|
|
5
|
+
return { page: options.page ?? 1, pageSize: options.pageSize };
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
8
|
* Get a single page by documentId via Smart endpoint (server-side populate).
|
|
4
9
|
*/
|
|
5
10
|
export function getPage(client, documentId, options) {
|
|
6
11
|
return client
|
|
7
12
|
.get(`/api/builder/pages/${documentId}`, {
|
|
8
|
-
params: {
|
|
13
|
+
params: {
|
|
14
|
+
locale: options?.locale,
|
|
15
|
+
status: options?.status === 'draft' ? 'draft' : undefined,
|
|
16
|
+
},
|
|
9
17
|
})
|
|
10
18
|
.then((res) => res.data.data);
|
|
11
19
|
}
|
|
12
20
|
/**
|
|
13
|
-
* Get a page by slug
|
|
21
|
+
* Get a page by slug, then load it through the deep-populated Smart endpoint.
|
|
14
22
|
*/
|
|
15
23
|
export function getPageBySlug(client, slug, options) {
|
|
16
24
|
return client
|
|
17
|
-
.get('/api/pages', {
|
|
25
|
+
.get('/api/builder/pages', {
|
|
18
26
|
params: {
|
|
19
27
|
filters: { slug: { $eq: slug } },
|
|
20
|
-
populate: getPagePopulate(options?.customBlocks),
|
|
21
28
|
locale: options?.locale,
|
|
29
|
+
// Strapi v5 D&P: only forwarded when explicitly requesting drafts.
|
|
30
|
+
status: options?.status === 'draft' ? 'draft' : undefined,
|
|
22
31
|
},
|
|
23
32
|
})
|
|
24
|
-
.then((res) => res.data.data[0] ?? null)
|
|
33
|
+
.then((res) => res.data.data[0] ?? null)
|
|
34
|
+
.then((page) => page
|
|
35
|
+
? getPage(client, page.documentId, {
|
|
36
|
+
locale: options?.locale,
|
|
37
|
+
status: options?.status,
|
|
38
|
+
})
|
|
39
|
+
: null);
|
|
25
40
|
}
|
|
26
41
|
/**
|
|
27
42
|
* List pages via Smart endpoint (minimal populate, no blocks).
|
|
@@ -31,7 +46,8 @@ export function listPages(client, options) {
|
|
|
31
46
|
.get('/api/builder/pages', {
|
|
32
47
|
params: {
|
|
33
48
|
locale: options?.locale,
|
|
34
|
-
|
|
49
|
+
sort: options?.sort,
|
|
50
|
+
pagination: getPagination(options),
|
|
35
51
|
},
|
|
36
52
|
})
|
|
37
53
|
.then((res) => res.data);
|
|
@@ -41,11 +57,12 @@ export function listPages(client, options) {
|
|
|
41
57
|
*/
|
|
42
58
|
export function listPagesRest(client, options) {
|
|
43
59
|
return client
|
|
44
|
-
.get('/api/pages', {
|
|
60
|
+
.get('/api/builder/pages', {
|
|
45
61
|
params: {
|
|
46
62
|
populate: getPageListPopulate(),
|
|
47
63
|
locale: options?.locale,
|
|
48
|
-
|
|
64
|
+
sort: options?.sort,
|
|
65
|
+
pagination: getPagination(options),
|
|
49
66
|
},
|
|
50
67
|
})
|
|
51
68
|
.then((res) => res.data);
|
package/dist/api/pages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../src/api/pages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../src/api/pages.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAoB9D,SAAS,aAAa,CAAC,OAAyB;IAC9C,IAAI,OAAO,EAAE,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE,QAAQ,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC;IAEzE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CACrB,MAAqB,EACrB,UAAkB,EAClB,OAA0B;IAE1B,OAAO,MAAM;SACV,GAAG,CAA+B,sBAAsB,UAAU,EAAE,EAAE;QACrE,MAAM,EAAE;YACN,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;SAC1D;KACF,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,oBAAoB,EAAE;QACjE,MAAM,EAAE;YACN,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAChC,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,mEAAmE;YACnE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;SAC1D;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;SACvC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACb,IAAI;QACF,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE;YAC/B,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,MAAM,EAAE,OAAO,EAAE,MAAM;SACxB,CAAC;QACJ,CAAC,CAAC,IAAI,CACT,CAAC;AACN,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,IAAI,EAAE,OAAO,EAAE,IAAI;YACnB,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC;SACnC;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAqB,EACrB,OAAyB;IAEzB,OAAO,MAAM;SACV,GAAG,CAAyC,oBAAoB,EAAE;QACjE,MAAM,EAAE;YACN,QAAQ,EAAE,mBAAmB,EAAE;YAC/B,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,IAAI,EAAE,OAAO,EAAE,IAAI;YACnB,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC;SACnC;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/api/series.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { StrapiCollectionResponse } from '../types/strapi.js';
|
|
|
3
3
|
import type { SeriesDocument } from '../types/content-types/series.js';
|
|
4
4
|
export interface SeriesListOptions {
|
|
5
5
|
locale?: string;
|
|
6
|
+
page?: number;
|
|
7
|
+
pageSize?: number;
|
|
6
8
|
sort?: string | string[];
|
|
7
9
|
}
|
|
8
10
|
/**
|
package/dist/api/series.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB,qDAc5E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,kCAWhB"}
|
package/dist/api/series.js
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export function listSeries(client, options) {
|
|
5
5
|
return client
|
|
6
|
-
.get('/api/all-series', {
|
|
6
|
+
.get('/api/builder/all-series', {
|
|
7
7
|
params: {
|
|
8
8
|
populate: { cover: true },
|
|
9
9
|
sort: options?.sort ?? 'name:asc',
|
|
10
10
|
locale: options?.locale,
|
|
11
|
+
pagination: options?.page != null || options?.pageSize != null
|
|
12
|
+
? { page: options.page ?? 1, pageSize: options.pageSize }
|
|
13
|
+
: undefined,
|
|
11
14
|
},
|
|
12
15
|
})
|
|
13
16
|
.then((res) => res.data);
|
|
@@ -17,7 +20,7 @@ export function listSeries(client, options) {
|
|
|
17
20
|
*/
|
|
18
21
|
export function getSeriesBySlug(client, slug, locale) {
|
|
19
22
|
return client
|
|
20
|
-
.get('/api/all-series', {
|
|
23
|
+
.get('/api/builder/all-series', {
|
|
21
24
|
params: {
|
|
22
25
|
filters: { slug: { $eq: slug } },
|
|
23
26
|
populate: { cover: true },
|
package/dist/api/series.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"series.js","sourceRoot":"","sources":["../../src/api/series.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"series.js","sourceRoot":"","sources":["../../src/api/series.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,MAAqB,EAAE,OAA2B;IAC3E,OAAO,MAAM;SACV,GAAG,CAA2C,yBAAyB,EAAE;QACxE,MAAM,EAAE;YACN,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;YACzB,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,UAAU;YACjC,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,UAAU,EACR,OAAO,EAAE,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE,QAAQ,IAAI,IAAI;gBAChD,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;gBACzD,CAAC,CAAC,SAAS;SAChB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAqB,EACrB,IAAY,EACZ,MAAe;IAEf,OAAO,MAAM;SACV,GAAG,CAA2C,yBAAyB,EAAE;QACxE,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"}
|
|
@@ -1 +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,
|
|
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,2BAA2B,EAAE;QACtE,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"}
|
package/dist/api/tags.d.ts
CHANGED
package/dist/api/tags.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,CAAC;IACd,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,kDAavE"}
|
package/dist/api/tags.js
CHANGED
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export function listTags(client, options) {
|
|
5
5
|
return client
|
|
6
|
-
.get('/api/tags', {
|
|
6
|
+
.get('/api/builder/tags', {
|
|
7
7
|
params: {
|
|
8
8
|
sort: options?.sort ?? 'name:asc',
|
|
9
9
|
locale: options?.locale,
|
|
10
|
+
pagination: options?.page != null || options?.pageSize != null
|
|
11
|
+
? { page: options.page ?? 1, pageSize: options.pageSize }
|
|
12
|
+
: undefined,
|
|
10
13
|
},
|
|
11
14
|
})
|
|
12
15
|
.then((res) => res.data);
|
package/dist/api/tags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/api/tags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/api/tags.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAqB,EAAE,OAAwB;IACtE,OAAO,MAAM;SACV,GAAG,CAAwC,mBAAmB,EAAE;QAC/D,MAAM,EAAE;YACN,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,UAAU;YACjC,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,UAAU,EACR,OAAO,EAAE,IAAI,IAAI,IAAI,IAAI,OAAO,EAAE,QAAQ,IAAI,IAAI;gBAChD,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;gBACzD,CAAC,CAAC,SAAS;SAChB;KACF,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|