@davincicoding/payload-utils 0.0.1 → 0.0.2
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/LICENSE +21 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 DAVINCI CODING GmbH
|
|
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/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"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,iBAAiB,WAAY,oBAAoB,KAAG,UAChB,CAAC;AAElD,eAAO,MAAM,kBAAkB,UAAW,KAAK,UAE9C,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,UAAU,CAAC,CAgBrB;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAE,UAAU,uBAkBjB;AAED,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {\n BasePayload,\n CollectionSlug,\n GlobalSlug,\n JsonObject,\n TypeWithID,\n} from 'payload';\nimport z from 'zod';\n\n// MARK: Types\n\nexport const documentIdSchema = z.union([z.number(), z.string()]);\nexport type DocumentID = TypeWithID['id'] & z.infer<typeof documentIdSchema>;\n\nexport const documentReferenceSchema = z.discriminatedUnion('entity', [\n z.object({\n entity: z.literal('collection'),\n slug: z.string(),\n id: documentIdSchema,\n }),\n z.object({\n entity: z.literal('global'),\n slug: z.string(),\n }),\n]);\n\nexport type DocumentReference = z.infer<typeof documentReferenceSchema>;\n\n// MARK: Type Guards\n\nexport const isPopulated = <T extends TypeWithID>(\n relationship: T | DocumentID,\n): relationship is T => typeof relationship === 'object';\n\nexport function assertPopulated<T extends TypeWithID | null>(\n docsOrIds: (T | DocumentID)[],\n errorMessage?: (id: DocumentID) => string,\n): T[];\nexport function assertPopulated<T extends TypeWithID | null>(\n docOrId: T | DocumentID,\n errorMessage?: (id: DocumentID) => string,\n): T;\nexport function assertPopulated<T extends TypeWithID | null>(\n value: T | DocumentID | (T | DocumentID)[],\n errorMessage = (id: DocumentID) => `Doc is not populated: [${id}]`,\n): T | T[] {\n if (value === null) return value;\n if (Array.isArray(value)) {\n return value.map((item) => assertPopulated(item, errorMessage));\n }\n if (isPopulated(value)) return value;\n throw new Error(errorMessage(value as DocumentID));\n}\n\n// MARK: Utilities\n\nexport type IdentifiableDocument = TypeWithID['id'] | TypeWithID;\n\nexport function isIdentifiableDocument(\n value: unknown,\n): value is IdentifiableDocument {\n if (typeof value === 'string') return true;\n if (typeof value === 'number') return true;\n if (value === null) return false;\n if (typeof value !== 'object') return true;\n if (!('id' in value)) return false;\n return isIdentifiableDocument(value.id);\n}\n\nexport const resolveDocumentID = (entity: IdentifiableDocument): DocumentID =>\n typeof entity === 'object' ? entity.id : entity;\n\nexport const uncaughtSwitchCase = (value: never) => {\n throw new Error(`Unhandled switch case: ${value}`);\n};\n\nexport function fetchDocumentByReference(\n payload: BasePayload,\n ref: DocumentReference,\n): Promise<JsonObject> {\n switch (ref.entity) {\n case 'collection':\n return payload.findByID({\n collection: ref.slug as CollectionSlug,\n id: ref.id,\n depth: 0,\n });\n case 'global':\n return payload.findGlobal({\n slug: ref.slug as GlobalSlug,\n depth: 0,\n });\n default:\n return uncaughtSwitchCase(ref);\n }\n}\n\nexport async function updateDocumentByReference(\n payload: BasePayload,\n ref: DocumentReference,\n data: JsonObject,\n) {\n switch (ref.entity) {\n case 'collection':\n return payload.update({\n collection: ref.slug as CollectionSlug,\n id: ref.id,\n data: data,\n });\n case 'global':\n return payload.updateGlobal({\n slug: ref.slug as GlobalSlug,\n data: data as any,\n });\n default:\n return uncaughtSwitchCase(ref);\n }\n}\n\nexport { getAdminURL, getApiURL, getServerURL } from './urls';\n"],"names":["z","documentIdSchema","union","number","string","documentReferenceSchema","discriminatedUnion","object","entity","literal","slug","id","isPopulated","relationship","assertPopulated","value","errorMessage","Array","isArray","map","item","Error","isIdentifiableDocument","resolveDocumentID","uncaughtSwitchCase","fetchDocumentByReference","payload","ref","findByID","collection","depth","findGlobal","updateDocumentByReference","data","update","updateGlobal","getAdminURL","getApiURL","getServerURL"],"mappings":"AAOA,OAA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nD,EAAE;AAEF,OAAO,SAASU,yBACdC,OAAoB,EACpBC,GAAsB;IAEtB,OAAQA,IAAInB,MAAM;QAChB,KAAK;YACH,OAAOkB,QAAQE,QAAQ,CAAC;gBACtBC,YAAYF,IAAIjB,IAAI;gBACpBC,IAAIgB,IAAIhB,EAAE;gBACVmB,OAAO;YACT;QACF,KAAK;YACH,OAAOJ,QAAQK,UAAU,CAAC;gBACxBrB,MAAMiB,IAAIjB,IAAI;gBACdoB,OAAO;YACT;QACF;YACE,OAAON,mBAAmBG;IAC9B;AACF;AAEA,OAAO,eAAeK,0BACpBN,OAAoB,EACpBC,GAAsB,EACtBM,IAAgB;IAEhB,OAAQN,IAAInB,MAAM;QAChB,KAAK;YACH,OAAOkB,QAAQQ,MAAM,CAAC;gBACpBL,YAAYF,IAAIjB,IAAI;gBACpBC,IAAIgB,IAAIhB,EAAE;gBACVsB,MAAMA;YACR;QACF,KAAK;YACH,OAAOP,QAAQS,YAAY,CAAC;gBAC1BzB,MAAMiB,IAAIjB,IAAI;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {\n BasePayload,\n CollectionSlug,\n GlobalSlug,\n JsonObject,\n TypeWithID,\n} from 'payload';\nimport z from 'zod';\n\n// MARK: Types\n\nexport const documentIdSchema = z.union([z.number(), z.string()]);\nexport type DocumentID = TypeWithID['id'] & z.infer<typeof documentIdSchema>;\n\nexport const documentReferenceSchema = z.discriminatedUnion('entity', [\n z.object({\n entity: z.literal('collection'),\n slug: z.string(),\n id: documentIdSchema,\n }),\n z.object({\n entity: z.literal('global'),\n slug: z.string(),\n }),\n]);\n\nexport type DocumentReference = z.infer<typeof documentReferenceSchema>;\n\n// MARK: Type Guards\n\nexport const isPopulated = <T extends TypeWithID>(\n relationship: T | DocumentID,\n): relationship is T => typeof relationship === 'object';\n\nexport function assertPopulated<T extends TypeWithID | null>(\n docsOrIds: (T | DocumentID)[],\n errorMessage?: (id: DocumentID) => string,\n): T[];\nexport function assertPopulated<T extends TypeWithID | null>(\n docOrId: T | DocumentID,\n errorMessage?: (id: DocumentID) => string,\n): T;\nexport function assertPopulated<T extends TypeWithID | null>(\n value: T | DocumentID | (T | DocumentID)[],\n errorMessage = (id: DocumentID) => `Doc is not populated: [${id}]`,\n): T | T[] {\n if (value === null) return value;\n if (Array.isArray(value)) {\n return value.map((item) => assertPopulated(item, errorMessage));\n }\n if (isPopulated(value)) return value;\n throw new Error(errorMessage(value as DocumentID));\n}\n\n// MARK: Utilities\n\nexport type IdentifiableDocument = TypeWithID['id'] | TypeWithID;\n\nexport function isIdentifiableDocument(\n value: unknown,\n): value is IdentifiableDocument {\n if (typeof value === 'string') return true;\n if (typeof value === 'number') return true;\n if (value === null) return false;\n if (typeof value !== 'object') return true;\n if (!('id' in value)) return false;\n return isIdentifiableDocument(value.id);\n}\n\nexport const resolveDocumentID = (entity: IdentifiableDocument): DocumentID =>\n typeof entity === 'object' ? entity.id : entity;\n\nexport const uncaughtSwitchCase = (value: never) => {\n throw new Error(`Unhandled switch case: ${value}`);\n};\n\nexport function fetchDocumentByReference(\n payload: BasePayload,\n ref: DocumentReference,\n): Promise<JsonObject> {\n switch (ref.entity) {\n case 'collection':\n return payload.findByID({\n collection: ref.slug as CollectionSlug,\n id: ref.id,\n depth: 0,\n });\n case 'global':\n return payload.findGlobal({\n slug: ref.slug as GlobalSlug,\n depth: 0,\n });\n default:\n return uncaughtSwitchCase(ref);\n }\n}\n\nexport async function updateDocumentByReference(\n payload: BasePayload,\n ref: DocumentReference,\n data: JsonObject,\n) {\n switch (ref.entity) {\n case 'collection':\n return payload.update({\n collection: ref.slug as CollectionSlug,\n id: ref.id,\n data: data,\n });\n case 'global':\n return payload.updateGlobal({\n slug: ref.slug as GlobalSlug,\n // biome-ignore lint/suspicious/noExplicitAny: this is fine\n data: data as any,\n });\n default:\n return uncaughtSwitchCase(ref);\n }\n}\n\nexport { getAdminURL, getApiURL, getServerURL } from './urls';\n"],"names":["z","documentIdSchema","union","number","string","documentReferenceSchema","discriminatedUnion","object","entity","literal","slug","id","isPopulated","relationship","assertPopulated","value","errorMessage","Array","isArray","map","item","Error","isIdentifiableDocument","resolveDocumentID","uncaughtSwitchCase","fetchDocumentByReference","payload","ref","findByID","collection","depth","findGlobal","updateDocumentByReference","data","update","updateGlobal","getAdminURL","getApiURL","getServerURL"],"mappings":"AAOA,OAAOA,OAAO,MAAM;AAEpB,cAAc;AAEd,OAAO,MAAMC,mBAAmBD,EAAEE,KAAK,CAAC;IAACF,EAAEG,MAAM;IAAIH,EAAEI,MAAM;CAAG,EAAE;AAGlE,OAAO,MAAMC,0BAA0BL,EAAEM,kBAAkB,CAAC,UAAU;IACpEN,EAAEO,MAAM,CAAC;QACPC,QAAQR,EAAES,OAAO,CAAC;QAClBC,MAAMV,EAAEI,MAAM;QACdO,IAAIV;IACN;IACAD,EAAEO,MAAM,CAAC;QACPC,QAAQR,EAAES,OAAO,CAAC;QAClBC,MAAMV,EAAEI,MAAM;IAChB;CACD,EAAE;AAIH,oBAAoB;AAEpB,OAAO,MAAMQ,cAAc,CACzBC,eACsB,OAAOA,iBAAiB,SAAS;AAUzD,OAAO,SAASC,gBACdC,KAA0C,EAC1CC,eAAe,CAACL,KAAmB,CAAC,uBAAuB,EAAEA,GAAG,CAAC,CAAC;IAElE,IAAII,UAAU,MAAM,OAAOA;IAC3B,IAAIE,MAAMC,OAAO,CAACH,QAAQ;QACxB,OAAOA,MAAMI,GAAG,CAAC,CAACC,OAASN,gBAAgBM,MAAMJ;IACnD;IACA,IAAIJ,YAAYG,QAAQ,OAAOA;IAC/B,MAAM,IAAIM,MAAML,aAAaD;AAC/B;AAMA,OAAO,SAASO,uBACdP,KAAc;IAEd,IAAI,OAAOA,UAAU,UAAU,OAAO;IACtC,IAAI,OAAOA,UAAU,UAAU,OAAO;IACtC,IAAIA,UAAU,MAAM,OAAO;IAC3B,IAAI,OAAOA,UAAU,UAAU,OAAO;IACtC,IAAI,CAAE,CAAA,QAAQA,KAAI,GAAI,OAAO;IAC7B,OAAOO,uBAAuBP,MAAMJ,EAAE;AACxC;AAEA,OAAO,MAAMY,oBAAoB,CAACf,SAChC,OAAOA,WAAW,WAAWA,OAAOG,EAAE,GAAGH,OAAO;AAElD,OAAO,MAAMgB,qBAAqB,CAACT;IACjC,MAAM,IAAIM,MAAM,CAAC,uBAAuB,EAAEN,OAAO;AACnD,EAAE;AAEF,OAAO,SAASU,yBACdC,OAAoB,EACpBC,GAAsB;IAEtB,OAAQA,IAAInB,MAAM;QAChB,KAAK;YACH,OAAOkB,QAAQE,QAAQ,CAAC;gBACtBC,YAAYF,IAAIjB,IAAI;gBACpBC,IAAIgB,IAAIhB,EAAE;gBACVmB,OAAO;YACT;QACF,KAAK;YACH,OAAOJ,QAAQK,UAAU,CAAC;gBACxBrB,MAAMiB,IAAIjB,IAAI;gBACdoB,OAAO;YACT;QACF;YACE,OAAON,mBAAmBG;IAC9B;AACF;AAEA,OAAO,eAAeK,0BACpBN,OAAoB,EACpBC,GAAsB,EACtBM,IAAgB;IAEhB,OAAQN,IAAInB,MAAM;QAChB,KAAK;YACH,OAAOkB,QAAQQ,MAAM,CAAC;gBACpBL,YAAYF,IAAIjB,IAAI;gBACpBC,IAAIgB,IAAIhB,EAAE;gBACVsB,MAAMA;YACR;QACF,KAAK;YACH,OAAOP,QAAQS,YAAY,CAAC;gBAC1BzB,MAAMiB,IAAIjB,IAAI;gBACd,2DAA2D;gBAC3DuB,MAAMA;YACR;QACF;YACE,OAAOT,mBAAmBG;IAC9B;AACF;AAEA,SAASS,WAAW,EAAEC,SAAS,EAAEC,YAAY,QAAQ,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@davincicoding/payload-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Shared utilities for Payload CMS plugins and applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,22 +25,15 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "swc src -d dist --config-file .swcrc --strip-leading-paths --ignore '**/*.test.ts' && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
30
|
-
"check:types": "tsc --noEmit",
|
|
31
|
-
"clean": "rm -rf dist && rm -rf node_modules",
|
|
32
|
-
"test": "vitest run",
|
|
33
|
-
"test:watch": "vitest"
|
|
34
|
-
},
|
|
35
28
|
"dependencies": {
|
|
36
|
-
"zod": "
|
|
29
|
+
"zod": "4.3.5"
|
|
37
30
|
},
|
|
38
31
|
"devDependencies": {
|
|
39
32
|
"@swc/cli": "^0.6.0",
|
|
40
33
|
"@swc/core": "^1.11.0",
|
|
41
34
|
"@types/node": "^22.5.4",
|
|
42
|
-
"payload": "
|
|
43
|
-
"typescript": "
|
|
35
|
+
"payload": "3.72.0",
|
|
36
|
+
"typescript": "5.7.3",
|
|
44
37
|
"vitest": "^3.1.2"
|
|
45
38
|
},
|
|
46
39
|
"peerDependencies": {
|
|
@@ -48,5 +41,12 @@
|
|
|
48
41
|
},
|
|
49
42
|
"engines": {
|
|
50
43
|
"node": "^18.20.2 || >=20.9.0"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "swc src -d dist --config-file .swcrc --strip-leading-paths --ignore '**/*.test.ts' && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
47
|
+
"check:types": "tsc --noEmit",
|
|
48
|
+
"clean": "rm -rf dist && rm -rf node_modules",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"test:watch": "vitest"
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|