@dani-builder/strapi-client 0.1.0 → 0.3.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 +121 -0
- 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 +223 -0
- package/docs/block-reference.md +194 -0
- package/docs/components.md +234 -0
- package/docs/content-types.md +184 -0
- package/docs/elements.md +50 -0
- package/package.json +31 -12
package/AGENTS.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# @dani-builder/strapi-client
|
|
2
|
+
|
|
3
|
+
TypeScript client library for the Daniworks Builder CMS (Strapi v5). Provides typed API functions, populate builders, and media utilities for SSR-safe data fetching.
|
|
4
|
+
|
|
5
|
+
## Import Paths
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createStrapiClient, getPage, getMediaUrl } from '@dani-builder/strapi-client'; // everything
|
|
9
|
+
import type { PageDocument, HeroBlock } from '@dani-builder/strapi-client/types'; // types only
|
|
10
|
+
import { createStrapiClient, isStrapiError } from '@dani-builder/strapi-client/client'; // client factory
|
|
11
|
+
import { getPagePopulate, coreBlockPopulates } from '@dani-builder/strapi-client/populate'; // populate builders
|
|
12
|
+
import { getPage, listArticles, postInquiry } from '@dani-builder/strapi-client/api'; // API functions
|
|
13
|
+
import { getMediaUrl, getAssetUrl } from '@dani-builder/strapi-client/utils'; // media helpers
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
const client = createStrapiClient({ baseUrl: 'http://localhost:1337', apiToken: '...' });
|
|
20
|
+
const page = await getPage(client, documentId); // Smart endpoint (server-side populate)
|
|
21
|
+
const page2 = await getPageBySlug(client, 'about'); // REST with client-side populate
|
|
22
|
+
const global = await getGlobal(client, { locale: 'ko' }); // Smart endpoint
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Key Concepts
|
|
26
|
+
|
|
27
|
+
- **Smart vs REST** — Smart endpoints (`/api/builder/*`) use server-side populate via plugin. REST endpoints use client-side populate builders. Prefer Smart when available.
|
|
28
|
+
- **Dynamic Zone discrimination** — Use `block.__component` to switch on block type (e.g. `'blocks.hero'`).
|
|
29
|
+
- **Populate builders** — `getPagePopulate()`, `getGlobalPopulate()`, etc. build nested populate objects. Pass `customBlocks` to extend.
|
|
30
|
+
- **Media URL resolution** — `getMediaUrl(url, mediaHost)` resolves relative paths. `getAssetUrl(asset, format, mediaHost)` gets a specific format with fallback.
|
|
31
|
+
|
|
32
|
+
## Critical Rules
|
|
33
|
+
|
|
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>`; each block's attribute table lists `allowed:` per media field. See [Block Reference](./docs/block-reference.md).
|
|
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
|
+
4. **BlocksContent is structured JSON** — `Article.body`, `FAQ.answer`, and `ContentBlock.body` are `BlockNode[]` arrays, NOT HTML or Markdown. Use a Blocks renderer.
|
|
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
|
+
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/builder/all-series`** — The pluralName differs from singularName. DO NOT use `/api/builder/series`.
|
|
41
|
+
8. **Inquiry has no draftAndPublish** — `postInquiry` creates immediately-visible records. No publish step needed.
|
|
42
|
+
|
|
43
|
+
## MCP Content Creation Guide
|
|
44
|
+
|
|
45
|
+
LLM(Claude Code)이 MCP를 통해 Strapi CMS에 직접 페이지/콘텐츠를 등록하는 워크플로우.
|
|
46
|
+
|
|
47
|
+
### 추천 MCP 서버
|
|
48
|
+
|
|
49
|
+
**`@bschauer/strapi-mcp-server`** (npm: `@bschauer/strapi-mcp-server`)
|
|
50
|
+
- Strapi v5 호환, API Token 인증, `strapi_rest` 도구로 REST CRUD 지원
|
|
51
|
+
- `strapi-mcp` (l33tdawg)는 v5에서 create 실패 — 사용 금지
|
|
52
|
+
|
|
53
|
+
### 설정 순서
|
|
54
|
+
|
|
55
|
+
1. Strapi Admin → Settings → API Tokens → **Full access / Unlimited** 토큰 생성
|
|
56
|
+
2. `~/.mcp/strapi-mcp-server.config.json`에 서버 등록:
|
|
57
|
+
```json
|
|
58
|
+
{ "my-cms": { "api_url": "http://localhost:1337", "api_key": "<token>", "version": "5.*" } }
|
|
59
|
+
```
|
|
60
|
+
3. 프로젝트 루트 `.mcp.json`에 MCP 서버 설정 (상세: 프로젝트 CLAUDE.md 참조)
|
|
61
|
+
|
|
62
|
+
### 페이지 생성 패턴
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
// POST api/pages (via strapi_rest, server="my-cms")
|
|
66
|
+
{
|
|
67
|
+
"data": {
|
|
68
|
+
"title": "서비스 소개",
|
|
69
|
+
"slug": "services",
|
|
70
|
+
"locale": "ko",
|
|
71
|
+
"headerMode": "offset",
|
|
72
|
+
"blocks": [
|
|
73
|
+
{
|
|
74
|
+
"__component": "blocks.hero",
|
|
75
|
+
"variant": "side-by-side",
|
|
76
|
+
"section": {
|
|
77
|
+
"heading": "최고의 서비스",
|
|
78
|
+
"subheading": "고객에게 가치를 전달합니다",
|
|
79
|
+
"theme": "dark"
|
|
80
|
+
},
|
|
81
|
+
"ctaLink": { "label": "시작하기", "href": "/contact" }
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"__component": "blocks.features",
|
|
85
|
+
"variant": "simple-grid",
|
|
86
|
+
"section": {
|
|
87
|
+
"heading": "주요 기능",
|
|
88
|
+
"theme": "default"
|
|
89
|
+
},
|
|
90
|
+
"items": [
|
|
91
|
+
{ "label": "빠른 개발", "description": "CMS 기반 빠른 페이지 구축" },
|
|
92
|
+
{ "label": "유연한 레이아웃", "description": "15가지 블록 조합" }
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 핵심 주의사항
|
|
101
|
+
|
|
102
|
+
9. **`data` 래퍼 필수** — POST/PUT body는 `{ "data": { ... } }`. 이중 래핑 금지.
|
|
103
|
+
10. **`locale` 필수** — i18n 활성 CT는 `locale` 누락 시 `Invalid key` 에러.
|
|
104
|
+
11. **블록 텍스트는 `section` 안에** — heading/subheading/theme은 블록이 아닌 `section` 서브컴포넌트에 위치. Hero에 `title` 필드 없음.
|
|
105
|
+
12. **`__component` 필수** — Dynamic zone의 각 블록 객체에 반드시 포함.
|
|
106
|
+
13. **컴포넌트 스키마 먼저 확인** — `strapi_get_components`로 실제 필드명 확인 후 데이터 작성. 필드명 추측 금지.
|
|
107
|
+
14. **미디어는 별도 업로드** — `strapi_upload_media` → ID 획득 → PUT으로 연결.
|
|
108
|
+
15. **Deep populate는 Smart API** — `api/builder/pages/:docId`로 모든 중첩 데이터 조회.
|
|
109
|
+
|
|
110
|
+
## Documentation
|
|
111
|
+
|
|
112
|
+
| File | Content |
|
|
113
|
+
|------|---------|
|
|
114
|
+
| [docs/api-guide.md](./docs/api-guide.md) | Client setup, 19 API functions, Smart vs REST, populate builders, error handling, 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"}
|