@dani-builder/strapi-client 0.14.0 → 0.15.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/README.md +17 -0
- package/docs/components.md +1 -1
- package/docs/content-types.md +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -34,6 +34,23 @@ const global = await getGlobal(strapi);
|
|
|
34
34
|
const draft = await getPageBySlug(strapi, "about", { status: "draft" });
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
## Site settings and analytics
|
|
38
|
+
|
|
39
|
+
`getSiteSettings` populates analytics settings automatically. For a custom REST
|
|
40
|
+
request, include the shared populate builder:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { getSiteSettingsPopulate } from "@dani-builder/strapi-client/populate";
|
|
44
|
+
import type { SiteSettingsDocument, StrapiResponse } from "@dani-builder/strapi-client/types";
|
|
45
|
+
|
|
46
|
+
const { data } = await strapi.get<StrapiResponse<SiteSettingsDocument>>(
|
|
47
|
+
"/api/builder/site-setting",
|
|
48
|
+
{ params: { populate: getSiteSettingsPopulate() } },
|
|
49
|
+
);
|
|
50
|
+
const configs = data.data.analyticsSettings;
|
|
51
|
+
// Pass configs to AnalyticsProvider from @dani-builder/blocks/analytics.
|
|
52
|
+
```
|
|
53
|
+
|
|
37
54
|
## Sub-exports
|
|
38
55
|
|
|
39
56
|
| Import | Contents |
|
package/docs/components.md
CHANGED
|
@@ -45,7 +45,7 @@ Reusable sub-components referenced by blocks and content types.
|
|
|
45
45
|
|---|---|---|---|---|
|
|
46
46
|
| `provider` | enumeration | yes | — | `google-tag-manager`, `google-analytics`, `matomo` |
|
|
47
47
|
| `trackingId` | string | yes | — | — |
|
|
48
|
-
| `customDomain` | string | — | — |
|
|
48
|
+
| `customDomain` | string | — | — | regex `^(?![\s\S]*[\s<>"'\x60\\])https?://(?:\[[0-9A-Fa-f:]+\]\|[^/@:?#\[\]]+)(?::\d+)?(?:[/?#][\s\S]*)?$` |
|
|
49
49
|
| `enabled` | boolean | — | `true` | — |
|
|
50
50
|
|
|
51
51
|
## Bento Item
|
package/docs/content-types.md
CHANGED
|
@@ -200,6 +200,6 @@ Article tag with optional color
|
|
|
200
200
|
|---|---|---|---|---|
|
|
201
201
|
| `name` | string | yes | — | — |
|
|
202
202
|
| `slug` | uid ← `name` | yes | — | — |
|
|
203
|
-
| `color` | customField | — | — | custom field `plugin::color-picker.color` |
|
|
203
|
+
| `color` | customField | — | — | custom field `plugin::color-picker.color` · regex `^#([A-Fa-f0-9]{6}\|[A-Fa-f0-9]{3})$` |
|
|
204
204
|
| `description` | text | — | — | — |
|
|
205
205
|
| `articles` | relation `manyToMany` → `plugin::builder.article` | — | — | — |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dani-builder/strapi-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "TypeScript client for Daniworks Builder CMS (Strapi v5)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"typescript": "^6.0.3",
|
|
69
69
|
"@types/node": "^26",
|
|
70
70
|
"@dani-builder/agent-contract-build": "npm:@dani-builder/agent-contract@0.6.0",
|
|
71
|
-
"@repo/
|
|
72
|
-
"@repo/
|
|
71
|
+
"@repo/typescript-config": "0.0.0",
|
|
72
|
+
"@repo/eslint-config": "0.0.0"
|
|
73
73
|
},
|
|
74
74
|
"keywords": [
|
|
75
75
|
"strapi",
|