@payloadcms/next 3.19.0-canary.edf2c5e → 3.19.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/exports/utilities.d.ts +3 -1
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +3 -1
- package/dist/exports/utilities.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/rest/index.d.ts +30 -6
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +3 -2
- package/dist/routes/rest/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
import { type SanitizedConfig } from 'payload';
|
|
2
|
-
export declare const OPTIONS: (config: Promise<SanitizedConfig> | SanitizedConfig) => (request: Request
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
2
|
+
export declare const OPTIONS: (config: Promise<SanitizedConfig> | SanitizedConfig) => (request: Request, args: {
|
|
3
|
+
params: Promise<{
|
|
4
|
+
slug: string[];
|
|
5
|
+
}>;
|
|
6
|
+
}) => Promise<Response>;
|
|
7
|
+
export declare const GET: (config: Promise<SanitizedConfig> | SanitizedConfig) => (request: Request, args: {
|
|
8
|
+
params: Promise<{
|
|
9
|
+
slug: string[];
|
|
10
|
+
}>;
|
|
11
|
+
}) => Promise<Response>;
|
|
12
|
+
export declare const POST: (config: Promise<SanitizedConfig> | SanitizedConfig) => (request: Request, args: {
|
|
13
|
+
params: Promise<{
|
|
14
|
+
slug: string[];
|
|
15
|
+
}>;
|
|
16
|
+
}) => Promise<Response>;
|
|
17
|
+
export declare const DELETE: (config: Promise<SanitizedConfig> | SanitizedConfig) => (request: Request, args: {
|
|
18
|
+
params: Promise<{
|
|
19
|
+
slug: string[];
|
|
20
|
+
}>;
|
|
21
|
+
}) => Promise<Response>;
|
|
22
|
+
export declare const PATCH: (config: Promise<SanitizedConfig> | SanitizedConfig) => (request: Request, args: {
|
|
23
|
+
params: Promise<{
|
|
24
|
+
slug: string[];
|
|
25
|
+
}>;
|
|
26
|
+
}) => Promise<Response>;
|
|
27
|
+
export declare const PUT: (config: Promise<SanitizedConfig> | SanitizedConfig) => (request: Request, args: {
|
|
28
|
+
params: Promise<{
|
|
29
|
+
slug: string[];
|
|
30
|
+
}>;
|
|
31
|
+
}) => Promise<Response>;
|
|
8
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AA2C/D,eAAO,MAAM,OAAO,WApCT,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,eAExC,OAAO,QACV;IACJ,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CACpC,KACA,OAAO,CAAC,QAAQ,CA8BgB,CAAA;AAErC,eAAO,MAAM,GAAG,WAtCL,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,eAExC,OAAO,QACV;IACJ,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CACpC,KACA,OAAO,CAAC,QAAQ,CAgCY,CAAA;AAEjC,eAAO,MAAM,IAAI,WAxCN,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,eAExC,OAAO,QACV;IACJ,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CACpC,KACA,OAAO,CAAC,QAAQ,CAkCa,CAAA;AAElC,eAAO,MAAM,MAAM,WA1CR,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,eAExC,OAAO,QACV;IACJ,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CACpC,KACA,OAAO,CAAC,QAAQ,CAoCe,CAAA;AAEpC,eAAO,MAAM,KAAK,WA5CP,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,eAExC,OAAO,QACV;IACJ,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CACpC,KACA,OAAO,CAAC,QAAQ,CAsCc,CAAA;AAEnC,eAAO,MAAM,GAAG,WA9CL,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,eAExC,OAAO,QACV;IACJ,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CACpC,KACA,OAAO,CAAC,QAAQ,CAwCY,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { handleEndpoints } from 'payload';
|
|
2
2
|
import { generateOGImage } from './og/index.js';
|
|
3
3
|
let initedOGEndpoint = false;
|
|
4
|
-
const handlerBuilder = config => async request => {
|
|
4
|
+
const handlerBuilder = config => async (request, args) => {
|
|
5
5
|
const awaitedConfig = await config;
|
|
6
6
|
// Add this endpoint only when using Next.js, still can be overriden.
|
|
7
7
|
if (initedOGEndpoint === false && !awaitedConfig.endpoints.some(endpoint => endpoint.path === '/og' && endpoint.method === 'get')) {
|
|
@@ -12,9 +12,10 @@ const handlerBuilder = config => async request => {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
initedOGEndpoint = true;
|
|
15
|
+
const awaitedParams = await args.params;
|
|
15
16
|
const response = await handleEndpoints({
|
|
16
|
-
basePath: process.env.NEXT_BASE_PATH,
|
|
17
17
|
config,
|
|
18
|
+
path: `${awaitedConfig.routes.api}/${awaitedParams.slug.join('/')}`,
|
|
18
19
|
request
|
|
19
20
|
});
|
|
20
21
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["handleEndpoints","generateOGImage","initedOGEndpoint","handlerBuilder","config","request","awaitedConfig","endpoints","some","endpoint","path","method","push","handler","response","
|
|
1
|
+
{"version":3,"file":"index.js","names":["handleEndpoints","generateOGImage","initedOGEndpoint","handlerBuilder","config","request","args","awaitedConfig","endpoints","some","endpoint","path","method","push","handler","awaitedParams","params","response","routes","api","slug","join","OPTIONS","GET","POST","DELETE","PATCH","PUT"],"sources":["../../../src/routes/rest/index.ts"],"sourcesContent":["import { handleEndpoints, type SanitizedConfig } from 'payload'\n\nimport { generateOGImage } from './og/index.js'\n\nlet initedOGEndpoint = false\n\nconst handlerBuilder =\n (config: Promise<SanitizedConfig> | SanitizedConfig) =>\n async (\n request: Request,\n args: {\n params: Promise<{ slug: string[] }>\n },\n ): Promise<Response> => {\n const awaitedConfig = await config\n\n // Add this endpoint only when using Next.js, still can be overriden.\n if (\n initedOGEndpoint === false &&\n !awaitedConfig.endpoints.some(\n (endpoint) => endpoint.path === '/og' && endpoint.method === 'get',\n )\n ) {\n awaitedConfig.endpoints.push({\n handler: generateOGImage,\n method: 'get',\n path: '/og',\n })\n }\n\n initedOGEndpoint = true\n\n const awaitedParams = await args.params\n\n const response = await handleEndpoints({\n config,\n path: `${awaitedConfig.routes.api}/${awaitedParams.slug.join('/')}`,\n request,\n })\n\n return response\n }\n\nexport const OPTIONS = handlerBuilder\n\nexport const GET = handlerBuilder\n\nexport const POST = handlerBuilder\n\nexport const DELETE = handlerBuilder\n\nexport const PATCH = handlerBuilder\n\nexport const PUT = handlerBuilder\n"],"mappings":"AAAA,SAASA,eAAe,QAA8B;AAEtD,SAASC,eAAe,QAAQ;AAEhC,IAAIC,gBAAA,GAAmB;AAEvB,MAAMC,cAAA,GACHC,MAAA,IACD,OACEC,OAAA,EACAC,IAAA;EAIA,MAAMC,aAAA,GAAgB,MAAMH,MAAA;EAE5B;EACA,IACEF,gBAAA,KAAqB,SACrB,CAACK,aAAA,CAAcC,SAAS,CAACC,IAAI,CAC1BC,QAAA,IAAaA,QAAA,CAASC,IAAI,KAAK,SAASD,QAAA,CAASE,MAAM,KAAK,QAE/D;IACAL,aAAA,CAAcC,SAAS,CAACK,IAAI,CAAC;MAC3BC,OAAA,EAASb,eAAA;MACTW,MAAA,EAAQ;MACRD,IAAA,EAAM;IACR;EACF;EAEAT,gBAAA,GAAmB;EAEnB,MAAMa,aAAA,GAAgB,MAAMT,IAAA,CAAKU,MAAM;EAEvC,MAAMC,QAAA,GAAW,MAAMjB,eAAA,CAAgB;IACrCI,MAAA;IACAO,IAAA,EAAM,GAAGJ,aAAA,CAAcW,MAAM,CAACC,GAAG,IAAIJ,aAAA,CAAcK,IAAI,CAACC,IAAI,CAAC,MAAM;IACnEhB;EACF;EAEA,OAAOY,QAAA;AACT;AAEF,OAAO,MAAMK,OAAA,GAAUnB,cAAA;AAEvB,OAAO,MAAMoB,GAAA,GAAMpB,cAAA;AAEnB,OAAO,MAAMqB,IAAA,GAAOrB,cAAA;AAEpB,OAAO,MAAMsB,MAAA,GAAStB,cAAA;AAEtB,OAAO,MAAMuB,KAAA,GAAQvB,cAAA;AAErB,OAAO,MAAMwB,GAAA,GAAMxB,cAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/next",
|
|
3
|
-
"version": "3.19.0
|
|
3
|
+
"version": "3.19.0",
|
|
4
4
|
"homepage": "https://payloadcms.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"sass": "1.77.4",
|
|
80
80
|
"sonner": "^1.7.0",
|
|
81
81
|
"uuid": "10.0.0",
|
|
82
|
-
"@payloadcms/graphql": "3.19.0
|
|
83
|
-
"@payloadcms/translations": "3.19.0
|
|
84
|
-
"@payloadcms/ui": "3.19.0
|
|
82
|
+
"@payloadcms/graphql": "3.19.0",
|
|
83
|
+
"@payloadcms/translations": "3.19.0",
|
|
84
|
+
"@payloadcms/ui": "3.19.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@babel/cli": "7.25.9",
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
"esbuild-sass-plugin": "3.3.1",
|
|
100
100
|
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
|
|
101
101
|
"swc-plugin-transform-remove-imports": "2.0.0",
|
|
102
|
-
"
|
|
103
|
-
"
|
|
102
|
+
"payload": "3.19.0",
|
|
103
|
+
"@payloadcms/eslint-config": "3.9.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"graphql": "^16.8.1",
|
|
107
107
|
"next": "^15.0.0",
|
|
108
|
-
"payload": "3.19.0
|
|
108
|
+
"payload": "3.19.0"
|
|
109
109
|
},
|
|
110
110
|
"engines": {
|
|
111
111
|
"node": "^18.20.2 || >=20.9.0"
|