@sensinum/strapi-plugin-multi-domain 5.2.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/_chunks/{About-DaPMT-kj.js → About-CrezKPYG.js} +8 -8
- package/dist/_chunks/{About-DNyaGrYn.mjs → About-DD6q90XE.mjs} +87 -80
- package/dist/_chunks/{Settings-B_1YuoN9.js → Settings-82rkWMJ-.js} +1 -1
- package/dist/_chunks/{Settings-B823hBAu.mjs → Settings-DVTWa7UL.mjs} +2 -2
- package/dist/_chunks/{TenantCustomField-B9Ntpj-S.mjs → TenantCustomField-MX6zdr0Y.mjs} +1 -1
- package/dist/_chunks/{TenantCustomField-CHUfO3Xh.js → TenantCustomField-aaNqlkBO.js} +1 -1
- package/dist/_chunks/{TenantEdit-Bkw_eaGW.js → TenantEdit-BA2xZHAl.js} +1 -1
- package/dist/_chunks/{TenantEdit-BFvwBQFd.mjs → TenantEdit-QroPNoOH.mjs} +4 -4
- package/dist/_chunks/{TenantList-C9nnIaGg.js → TenantList-BOEyqzpU.js} +1 -1
- package/dist/_chunks/{TenantList-DRfWswjS.mjs → TenantList-Dw1EqqA7.mjs} +55 -55
- package/dist/_chunks/{index-DuSOcmV4.js → index-B6P81dIL.js} +1 -1
- package/dist/_chunks/{index-DEoxiYwP.mjs → index-DFrXw6xt.mjs} +4 -4
- package/dist/_chunks/{index-2nR8Jd1x.mjs → index-DVqQk-cu.mjs} +2 -2
- package/dist/_chunks/{index-Cvs1ZCFy.js → index-lkcweU9g.js} +1 -1
- package/dist/_chunks/{useGetMessage-K3OG9Tv0.mjs → useGetMessage-BQOJqwKY.mjs} +1 -1
- package/dist/_chunks/useGetMessage-CkNMUbYX.js +1 -0
- package/dist/_chunks/{useSettings-BCMuYsbx.js → useSettings-DArWTfyj.js} +1 -1
- package/dist/_chunks/{useSettings-QOof9ZTx.mjs → useSettings-HNeo0XZx.mjs} +1 -1
- package/dist/_chunks/{useTenants-CT-L6xX1.mjs → useTenants-D2d36FHf.mjs} +3 -3
- package/dist/_chunks/{useTenants-_putKXAO.js → useTenants-DA6GxylQ.js} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +3 -4
- package/dist/server/index.mjs +5514 -5540
- package/package.json +1 -1
- package/dist/_chunks/useGetMessage-B1Xnqz3k.js +0 -1
package/README.md
CHANGED
|
@@ -117,6 +117,15 @@ module.exports = {
|
|
|
117
117
|
* @returns {Set<string>}
|
|
118
118
|
*/
|
|
119
119
|
getOmitContentTypes: () => new Set(['api::my-global-content-type.my-global-content-type']),
|
|
120
|
+
/**
|
|
121
|
+
* Optional async hook to validate domain customFields before create/update.
|
|
122
|
+
* Throw an error to reject the operation.
|
|
123
|
+
*/
|
|
124
|
+
customFieldValidation: async (customFields) => {
|
|
125
|
+
if (!customFields?.myRequiredField) {
|
|
126
|
+
throw new Error('myRequiredField is required');
|
|
127
|
+
}
|
|
128
|
+
},
|
|
120
129
|
/**
|
|
121
130
|
* A list of content-api endpoints to exclude from domain logic.
|
|
122
131
|
* e.g., ['/api/my-public-endpoint']
|
|
@@ -155,6 +164,7 @@ module.exports = {
|
|
|
155
164
|
- `customFields` (object): A JSON object for any custom data you want to associate with the domain.
|
|
156
165
|
- `getOmitContentTypes` (function): Returns a `Set` of content-type UIDs that should be excluded from multi-domain. Use this for global, non-domain-specific content.
|
|
157
166
|
- `getExcludedContentAPIEndpoints` (function): Returns an array of URL paths for Content API endpoints that should be publicly accessible and not scoped by domain.
|
|
167
|
+
- `customFieldValidation` (async function): An optional async validation hook called before a domain is created or updated. It receives the domain's `customFields` object and should throw an error (or return a rejected promise) if validation fails. By default it is a no-op (`() => Promise.resolve()`).
|
|
158
168
|
- `getExtraProxyDecorators` (function): An advanced feature that allows you to add custom logic to the database query proxy. This is useful for implementing complex, domain-specific business rules. It should return an array of objects, each with a `condition` and a `handler` function.
|
|
159
169
|
- `condition` (function): Takes a `modelName` and returns `true` if the handler should be applied.
|
|
160
170
|
- `handler` (function): A function that wraps the original database method, allowing you to modify its behavior. It receives the `target` repository, the original `targetElement` method, the Koa `ctx`, the method `prop` name, and the `modelName`.
|