@payloadcms/plugin-nested-docs 3.0.0-canary.fb81f02 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/resaveChildren.d.ts.map +1 -1
- package/dist/hooks/resaveChildren.js +8 -1
- package/dist/hooks/resaveChildren.js.map +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/populateBreadcrumbs.js.map +1 -1
- package/license.md +22 -0
- package/package.json +14 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resaveChildren.d.ts","sourceRoot":"","sources":["../../src/hooks/resaveChildren.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"resaveChildren.d.ts","sourceRoot":"","sources":["../../src/hooks/resaveChildren.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,gBAAgB,EAIjB,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AA8EzD,eAAO,MAAM,cAAc,iBACV,sBAAsB,cAAc,gBAAgB,KAAG,yBAqBrE,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { APIError } from 'payload';
|
|
1
2
|
import { populateBreadcrumbs } from '../utilities/populateBreadcrumbs.js';
|
|
2
3
|
const resave = async ({ collection, doc, draft, pluginConfig, req })=>{
|
|
3
4
|
const parentSlug = pluginConfig?.parentFieldSlug || 'parent';
|
|
@@ -19,7 +20,9 @@ const resave = async ({ collection, doc, draft, pluginConfig, req })=>{
|
|
|
19
20
|
await children.docs.reduce(async (priorSave, child)=>{
|
|
20
21
|
await priorSave;
|
|
21
22
|
const childIsPublished = typeof collection.versions === 'object' && collection.versions.drafts && child._status === 'published';
|
|
22
|
-
if (!parentDocIsPublished && childIsPublished)
|
|
23
|
+
if (!parentDocIsPublished && childIsPublished) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
23
26
|
await req.payload.update({
|
|
24
27
|
id: child.id,
|
|
25
28
|
collection: collection.slug,
|
|
@@ -36,6 +39,10 @@ const resave = async ({ collection, doc, draft, pluginConfig, req })=>{
|
|
|
36
39
|
} catch (err) {
|
|
37
40
|
req.payload.logger.error(`Nested Docs plugin has had an error while re-saving a child document${draft ? ' as draft' : ' as published'}.`);
|
|
38
41
|
req.payload.logger.error(err);
|
|
42
|
+
// Use type assertion until we can use instanceof reliably with our Error types
|
|
43
|
+
if (err?.name === 'ValidationError' && err?.data?.errors?.length) {
|
|
44
|
+
throw new APIError('Could not publish or save changes: One or more children are invalid.', 400);
|
|
45
|
+
}
|
|
39
46
|
}
|
|
40
47
|
};
|
|
41
48
|
export const resaveChildren = (pluginConfig, collection)=>async ({ doc, req })=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/resaveChildren.ts"],"sourcesContent":["import type {\n CollectionAfterChangeHook,\n CollectionConfig,\n JsonObject,\n PayloadRequest,\n} from 'payload'\n\nimport type { NestedDocsPluginConfig } from '../types.js'\n\nimport { populateBreadcrumbs } from '../utilities/populateBreadcrumbs.js'\n\ntype ResaveArgs = {\n collection: CollectionConfig\n doc: JsonObject\n draft: boolean\n pluginConfig: NestedDocsPluginConfig\n req: PayloadRequest\n}\n\nconst resave = async ({ collection, doc, draft, pluginConfig, req }: ResaveArgs) => {\n const parentSlug = pluginConfig?.parentFieldSlug || 'parent'\n const parentDocIsPublished = doc._status === 'published'\n\n const children = await req.payload.find({\n collection: collection.slug,\n depth: 0,\n draft,\n locale: req.locale,\n req,\n where: {\n [parentSlug]: {\n equals: doc.id,\n },\n },\n })\n\n const breadcrumbSlug = pluginConfig.breadcrumbsFieldSlug || 'breadcrumbs'\n\n try {\n await children.docs.reduce(async (priorSave, child) => {\n await priorSave\n\n const childIsPublished =\n typeof collection.versions === 'object' &&\n collection.versions.drafts &&\n child._status === 'published'\n\n if (!parentDocIsPublished && childIsPublished) return\n\n await req.payload.update({\n id: child.id,\n collection: collection.slug,\n data: {\n ...child,\n [breadcrumbSlug]: await populateBreadcrumbs(req, pluginConfig, collection, child),\n },\n depth: 0,\n draft: !childIsPublished,\n locale: req.locale,\n req,\n })\n }, Promise.resolve())\n } catch (err: unknown) {\n req.payload.logger.error(\n `Nested Docs plugin has had an error while re-saving a child document${\n draft ? ' as draft' : ' as published'\n }.`,\n )\n req.payload.logger.error(err)\n }\n}\n\nexport const resaveChildren =\n (pluginConfig: NestedDocsPluginConfig, collection: CollectionConfig): CollectionAfterChangeHook =>\n async ({ doc, req }) => {\n await resave({\n collection,\n doc,\n draft: true,\n pluginConfig,\n req,\n })\n\n if (doc._status === 'published') {\n await resave({\n collection,\n doc,\n draft: false,\n pluginConfig,\n req,\n })\n }\n\n return undefined\n }\n"],"names":["populateBreadcrumbs","resave","collection","doc","draft","pluginConfig","req","parentSlug","parentFieldSlug","parentDocIsPublished","_status","children","payload","find","slug","depth","locale","where","equals","id","breadcrumbSlug","breadcrumbsFieldSlug","docs","reduce","priorSave","child","childIsPublished","versions","drafts","update","data","Promise","resolve","err","logger","error","resaveChildren","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/resaveChildren.ts"],"sourcesContent":["import type {\n CollectionAfterChangeHook,\n CollectionConfig,\n JsonObject,\n PayloadRequest,\n ValidationError,\n} from 'payload'\n\nimport { APIError } from 'payload'\n\nimport type { NestedDocsPluginConfig } from '../types.js'\n\nimport { populateBreadcrumbs } from '../utilities/populateBreadcrumbs.js'\n\ntype ResaveArgs = {\n collection: CollectionConfig\n doc: JsonObject\n draft: boolean\n pluginConfig: NestedDocsPluginConfig\n req: PayloadRequest\n}\n\nconst resave = async ({ collection, doc, draft, pluginConfig, req }: ResaveArgs) => {\n const parentSlug = pluginConfig?.parentFieldSlug || 'parent'\n const parentDocIsPublished = doc._status === 'published'\n\n const children = await req.payload.find({\n collection: collection.slug,\n depth: 0,\n draft,\n locale: req.locale,\n req,\n where: {\n [parentSlug]: {\n equals: doc.id,\n },\n },\n })\n\n const breadcrumbSlug = pluginConfig.breadcrumbsFieldSlug || 'breadcrumbs'\n\n try {\n await children.docs.reduce(async (priorSave, child) => {\n await priorSave\n\n const childIsPublished =\n typeof collection.versions === 'object' &&\n collection.versions.drafts &&\n child._status === 'published'\n\n if (!parentDocIsPublished && childIsPublished) {\n return\n }\n\n await req.payload.update({\n id: child.id,\n collection: collection.slug,\n data: {\n ...child,\n [breadcrumbSlug]: await populateBreadcrumbs(req, pluginConfig, collection, child),\n },\n depth: 0,\n draft: !childIsPublished,\n locale: req.locale,\n req,\n })\n }, Promise.resolve())\n } catch (err: unknown) {\n req.payload.logger.error(\n `Nested Docs plugin has had an error while re-saving a child document${\n draft ? ' as draft' : ' as published'\n }.`,\n )\n req.payload.logger.error(err)\n\n // Use type assertion until we can use instanceof reliably with our Error types\n if (\n (err as ValidationError)?.name === 'ValidationError' &&\n (err as ValidationError)?.data?.errors?.length\n ) {\n throw new APIError(\n 'Could not publish or save changes: One or more children are invalid.',\n 400,\n )\n }\n }\n}\n\nexport const resaveChildren =\n (pluginConfig: NestedDocsPluginConfig, collection: CollectionConfig): CollectionAfterChangeHook =>\n async ({ doc, req }) => {\n await resave({\n collection,\n doc,\n draft: true,\n pluginConfig,\n req,\n })\n\n if (doc._status === 'published') {\n await resave({\n collection,\n doc,\n draft: false,\n pluginConfig,\n req,\n })\n }\n\n return undefined\n }\n"],"names":["APIError","populateBreadcrumbs","resave","collection","doc","draft","pluginConfig","req","parentSlug","parentFieldSlug","parentDocIsPublished","_status","children","payload","find","slug","depth","locale","where","equals","id","breadcrumbSlug","breadcrumbsFieldSlug","docs","reduce","priorSave","child","childIsPublished","versions","drafts","update","data","Promise","resolve","err","logger","error","name","errors","length","resaveChildren","undefined"],"mappings":"AAQA,SAASA,QAAQ,QAAQ,UAAS;AAIlC,SAASC,m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AC/E,IACE,AAACA,KAAyBG,SAAS,qBAClCH,KAAyBH,MAAMO,QAAQC,QACxC;YACA,MAAM,IAAIvC,SACR,wEACA;QAEJ;IACF;AACF;AAEA,OAAO,MAAMwC,iBACX,CAAClC,cAAsCH,aACvC,OAAO,EAAEC,GAAG,EAAEG,GAAG,EAAE;QACjB,MAAML,OAAO;YACXC;YACAC;YACAC,OAAO;YACPC;YACAC;QACF;QAEA,IAAIH,IAAIO,OAAO,KAAK,aAAa;YAC/B,MAAMT,OAAO;gBACXC;gBACAC;gBACAC,OAAO;gBACPC;gBACAC;YACF;QACF;QAEA,OAAOkC;IACT,EAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CollectionSlug } from 'payload';
|
|
1
2
|
export type Breadcrumb = {
|
|
2
3
|
doc: string;
|
|
3
4
|
label: string;
|
|
@@ -13,7 +14,7 @@ export type NestedDocsPluginConfig = {
|
|
|
13
14
|
/**
|
|
14
15
|
* The slugs of the collections this plugin should extend. If you need different configs for different collections, this plugin can be added to your config more than once having different collections.
|
|
15
16
|
*/
|
|
16
|
-
collections:
|
|
17
|
+
collections: CollectionSlug[];
|
|
17
18
|
generateLabel?: GenerateLabel;
|
|
18
19
|
generateURL?: GenerateURL;
|
|
19
20
|
/**
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,CACxB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAChC,MAAM,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{"version":3,"sources":["../src/types.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionSlug } from 'payload'\n\nexport type Breadcrumb = {\n doc: string\n label: string\n url?: string\n}\n\nexport type GenerateURL = (\n docs: Array<Record<string, unknown>>,\n currentDoc: Record<string, unknown>,\n) => string\n\nexport type GenerateLabel = (\n docs: Array<Record<string, unknown>>,\n currentDoc: Record<string, unknown>,\n) => string\n\nexport type NestedDocsPluginConfig = {\n /**\n * Should be supplied if using an alternative field name for the 'breadcrumbs' field in collections\n */\n breadcrumbsFieldSlug?: string\n /**\n * The slugs of the collections this plugin should extend. If you need different configs for different collections, this plugin can be added to your config more than once having different collections.\n */\n collections: CollectionSlug[]\n generateLabel?: GenerateLabel\n generateURL?: GenerateURL\n /**\n * Should be supplied if using an alternative field name for the 'parent' field in collections\n */\n parentFieldSlug?: string\n}\n"],"names":[],"mappings":"AAkBA,WAeC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/populateBreadcrumbs.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport type { NestedDocsPluginConfig } from '../types.js'\n\nimport { formatBreadcrumb } from './formatBreadcrumb.js'\nimport { getParents } from './getParents.js'\n\nexport const populateBreadcrumbs = async (\n req: any,\n pluginConfig: NestedDocsPluginConfig,\n collection: CollectionConfig,\n data: any,\n originalDoc?: any,\n): Promise<any> => {\n const newData = data\n const breadcrumbDocs = [\n ...(await getParents(req, pluginConfig, collection, {\n ...originalDoc,\n ...data,\n })),\n ]\n\n const currentDocBreadcrumb = {\n ...originalDoc,\n ...data,\n }\n\n if (originalDoc?.id) {\n currentDocBreadcrumb.id = originalDoc?.id\n }\n\n breadcrumbDocs.push(currentDocBreadcrumb)\n\n const breadcrumbs = breadcrumbDocs.map((_, i) =>\n formatBreadcrumb(pluginConfig, collection, breadcrumbDocs.slice(0, i + 1)),\n )
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/populateBreadcrumbs.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport type { NestedDocsPluginConfig } from '../types.js'\n\nimport { formatBreadcrumb } from './formatBreadcrumb.js'\nimport { getParents } from './getParents.js'\n\nexport const populateBreadcrumbs = async (\n req: any,\n pluginConfig: NestedDocsPluginConfig,\n collection: CollectionConfig,\n data: any,\n originalDoc?: any,\n): Promise<any> => {\n const newData = data\n const breadcrumbDocs = [\n ...(await getParents(req, pluginConfig, collection, {\n ...originalDoc,\n ...data,\n })),\n ]\n\n const currentDocBreadcrumb = {\n ...originalDoc,\n ...data,\n }\n\n if (originalDoc?.id) {\n currentDocBreadcrumb.id = originalDoc?.id\n }\n\n breadcrumbDocs.push(currentDocBreadcrumb)\n\n const breadcrumbs = breadcrumbDocs.map((_, i) =>\n formatBreadcrumb(pluginConfig, collection, breadcrumbDocs.slice(0, i + 1)),\n )\n\n return {\n ...newData,\n [pluginConfig?.breadcrumbsFieldSlug || 'breadcrumbs']: breadcrumbs,\n }\n}\n"],"names":["formatBreadcrumb","getParents","populateBreadcrumbs","req","pluginConfig","collection","data","originalDoc","newData","breadcrumbDocs","currentDocBreadcrumb","id","push","breadcrumbs","map","_","i","slice","breadcrumbsFieldSlug"],"mappings":"AAIA,SAASA,gBAAgB,QAAQ,wBAAuB;AACxD,SAASC,UAAU,QAAQ,kBAAiB;AAE5C,OAAO,MAAMC,sBAAsB,OACjCC,KACAC,cACAC,YACAC,MACAC;IAEA,MAAMC,UAAUF;IAChB,MAAMG,iBAAiB;WACjB,MAAMR,WAAWE,KAAKC,cAAcC,YAAY;YAClD,GAAGE,WAAW;YACd,GAAGD,IAAI;QACT;KACD;IAED,MAAMI,uBAAuB;QAC3B,GAAGH,WAAW;QACd,GAAGD,IAAI;IACT;IAEA,IAAIC,aAAaI,IAAI;QACnBD,qBAAqBC,EAAE,GAAGJ,aAAaI;IACzC;IAEAF,eAAeG,IAAI,CAACF;IAEpB,MAAMG,cAAcJ,eAAeK,GAAG,CAAC,CAACC,GAAGC,IACzChB,iBAAiBI,cAAcC,YAAYI,eAAeQ,KAAK,CAAC,GAAGD,IAAI;IAGzE,OAAO;QACL,GAAGR,OAAO;QACV,CAACJ,cAAcc,wBAAwB,cAAc,EAAEL;IACzD;AACF,EAAC"}
|
package/license.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-2024 Payload CMS, Inc. <info@payloadcms.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-nested-docs",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "The official Nested Docs plugin for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
|
|
13
|
+
"maintainers": [
|
|
14
|
+
{
|
|
15
|
+
"name": "Payload",
|
|
16
|
+
"email": "info@payloadcms.com",
|
|
17
|
+
"url": "https://payloadcms.com"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
13
20
|
"type": "module",
|
|
14
21
|
"exports": {
|
|
15
22
|
".": {
|
|
@@ -29,11 +36,11 @@
|
|
|
29
36
|
"dist"
|
|
30
37
|
],
|
|
31
38
|
"devDependencies": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
39
|
+
"@payloadcms/eslint-config": "3.0.0-beta.112",
|
|
40
|
+
"payload": "3.0.0"
|
|
34
41
|
},
|
|
35
42
|
"peerDependencies": {
|
|
36
|
-
"payload": "3.0.0
|
|
43
|
+
"payload": "3.0.0"
|
|
37
44
|
},
|
|
38
45
|
"publishConfig": {
|
|
39
46
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,6 +50,8 @@
|
|
|
43
50
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
44
51
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
45
52
|
"clean": "rimraf {dist,*.tsbuildinfo}",
|
|
46
|
-
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/"
|
|
53
|
+
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
54
|
+
"lint": "eslint .",
|
|
55
|
+
"lint:fix": "eslint . --fix"
|
|
47
56
|
}
|
|
48
57
|
}
|