@payloadcms/next 3.0.0-beta.2 → 3.0.0-beta.20
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/cjs/withPayload.cjs +2 -1
- package/dist/cjs/withPayload.cjs.map +1 -1
- package/dist/exports/routes.d.ts +1 -1
- package/dist/exports/routes.d.ts.map +1 -1
- package/dist/exports/routes.js +1 -1
- package/dist/exports/routes.js.map +1 -1
- package/dist/exports/utilities.d.ts +6 -1
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +6 -1
- package/dist/exports/utilities.js.map +1 -1
- package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.d.ts +2 -2
- package/dist/fetchAPI-multipart/fileFactory.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/fileFactory.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/handlers.d.ts +2 -2
- package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/handlers.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/index.d.ts +8 -8
- package/dist/fetchAPI-multipart/index.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/index.js +1 -1
- package/dist/fetchAPI-multipart/index.js.map +1 -0
- package/dist/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.js +1 -1
- package/dist/fetchAPI-multipart/isEligibleRequest.js.map +1 -0
- package/dist/fetchAPI-multipart/processMultipart.d.ts +8 -0
- package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/processMultipart.js +29 -6
- package/dist/fetchAPI-multipart/processMultipart.js.map +1 -0
- package/dist/fetchAPI-multipart/processNested.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/processNested.js +2 -1
- package/dist/fetchAPI-multipart/processNested.js.map +1 -0
- package/dist/fetchAPI-multipart/uploadTimer.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/utilities.d.ts +4 -4
- package/dist/fetchAPI-multipart/utilities.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/utilities.js +4 -4
- package/dist/fetchAPI-multipart/utilities.js.map +1 -0
- package/dist/fetchAPI-stream-file/index.d.ts.map +1 -0
- package/dist/fetchAPI-stream-file/index.js.map +1 -0
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +23 -1
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/graphql/handler.d.ts.map +1 -1
- package/dist/routes/graphql/handler.js +20 -7
- package/dist/routes/graphql/handler.js.map +1 -1
- package/dist/routes/rest/auth/access.d.ts.map +1 -1
- package/dist/routes/rest/auth/access.js +5 -0
- package/dist/routes/rest/auth/access.js.map +1 -1
- package/dist/routes/rest/auth/forgotPassword.d.ts.map +1 -1
- package/dist/routes/rest/auth/forgotPassword.js +7 -2
- package/dist/routes/rest/auth/forgotPassword.js.map +1 -1
- package/dist/routes/rest/auth/init.d.ts.map +1 -1
- package/dist/routes/rest/auth/init.js +6 -0
- package/dist/routes/rest/auth/init.js.map +1 -1
- package/dist/routes/rest/auth/login.d.ts.map +1 -1
- package/dist/routes/rest/auth/login.js +8 -5
- package/dist/routes/rest/auth/login.js.map +1 -1
- package/dist/routes/rest/auth/logout.d.ts.map +1 -1
- package/dist/routes/rest/auth/logout.js +12 -7
- package/dist/routes/rest/auth/logout.js.map +1 -1
- package/dist/routes/rest/auth/me.d.ts.map +1 -1
- package/dist/routes/rest/auth/me.js +5 -0
- package/dist/routes/rest/auth/me.js.map +1 -1
- package/dist/routes/rest/auth/refresh.d.ts.map +1 -1
- package/dist/routes/rest/auth/refresh.js +11 -7
- package/dist/routes/rest/auth/refresh.js.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.d.ts.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.js +8 -5
- package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
- package/dist/routes/rest/auth/resetPassword.d.ts.map +1 -1
- package/dist/routes/rest/auth/resetPassword.js +8 -5
- package/dist/routes/rest/auth/resetPassword.js.map +1 -1
- package/dist/routes/rest/auth/unlock.d.ts.map +1 -1
- package/dist/routes/rest/auth/unlock.js +7 -2
- package/dist/routes/rest/auth/unlock.js.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.d.ts.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.js +7 -2
- package/dist/routes/rest/auth/verifyEmail.js.map +1 -1
- package/dist/routes/rest/buildFormState.d.ts +3 -3
- package/dist/routes/rest/buildFormState.d.ts.map +1 -1
- package/dist/routes/rest/buildFormState.js +37 -7
- package/dist/routes/rest/buildFormState.js.map +1 -1
- package/dist/routes/rest/collections/count.d.ts +3 -0
- package/dist/routes/rest/collections/count.d.ts.map +1 -0
- package/dist/routes/rest/collections/count.js +15 -0
- package/dist/routes/rest/collections/count.js.map +1 -0
- package/dist/routes/rest/collections/create.d.ts.map +1 -1
- package/dist/routes/rest/collections/create.js +5 -0
- package/dist/routes/rest/collections/create.js.map +1 -1
- package/dist/routes/rest/collections/delete.d.ts.map +1 -1
- package/dist/routes/rest/collections/delete.js +7 -0
- package/dist/routes/rest/collections/delete.js.map +1 -1
- package/dist/routes/rest/collections/deleteByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/deleteByID.js +14 -1
- package/dist/routes/rest/collections/deleteByID.js.map +1 -1
- package/dist/routes/rest/collections/docAccess.d.ts.map +1 -1
- package/dist/routes/rest/collections/docAccess.js +5 -0
- package/dist/routes/rest/collections/docAccess.js.map +1 -1
- package/dist/routes/rest/collections/duplicate.d.ts.map +1 -1
- package/dist/routes/rest/collections/duplicate.js +12 -1
- package/dist/routes/rest/collections/duplicate.js.map +1 -1
- package/dist/routes/rest/collections/find.d.ts.map +1 -1
- package/dist/routes/rest/collections/find.js +5 -0
- package/dist/routes/rest/collections/find.js.map +1 -1
- package/dist/routes/rest/collections/findByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findByID.js +12 -1
- package/dist/routes/rest/collections/findByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersionByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findVersionByID.js +12 -1
- package/dist/routes/rest/collections/findVersionByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersions.d.ts.map +1 -1
- package/dist/routes/rest/collections/findVersions.js +5 -0
- package/dist/routes/rest/collections/findVersions.js.map +1 -1
- package/dist/routes/rest/collections/preview.d.ts.map +1 -1
- package/dist/routes/rest/collections/preview.js +11 -2
- package/dist/routes/rest/collections/preview.js.map +1 -1
- package/dist/routes/rest/collections/restoreVersion.d.ts.map +1 -1
- package/dist/routes/rest/collections/restoreVersion.js +12 -1
- package/dist/routes/rest/collections/restoreVersion.js.map +1 -1
- package/dist/routes/rest/collections/update.d.ts.map +1 -1
- package/dist/routes/rest/collections/update.js +7 -0
- package/dist/routes/rest/collections/update.js.map +1 -1
- package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/updateByID.js +12 -1
- package/dist/routes/rest/collections/updateByID.js.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.d.ts +2 -2
- package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
- package/dist/routes/rest/files/getFile.d.ts +2 -2
- package/dist/routes/rest/files/getFile.d.ts.map +1 -1
- package/dist/routes/rest/files/getFile.js +16 -9
- package/dist/routes/rest/files/getFile.js.map +1 -1
- package/dist/routes/rest/files/getFileTypeFallback.d.ts +7 -0
- package/dist/routes/rest/files/getFileTypeFallback.d.ts.map +1 -0
- package/dist/routes/rest/files/getFileTypeFallback.js +21 -0
- package/dist/routes/rest/files/getFileTypeFallback.js.map +1 -0
- package/dist/routes/rest/globals/docAccess.d.ts.map +1 -1
- package/dist/routes/rest/globals/docAccess.js +5 -0
- package/dist/routes/rest/globals/docAccess.js.map +1 -1
- package/dist/routes/rest/globals/findOne.d.ts.map +1 -1
- package/dist/routes/rest/globals/findOne.js +5 -0
- package/dist/routes/rest/globals/findOne.js.map +1 -1
- package/dist/routes/rest/globals/findVersionByID.d.ts.map +1 -1
- package/dist/routes/rest/globals/findVersionByID.js +5 -0
- package/dist/routes/rest/globals/findVersionByID.js.map +1 -1
- package/dist/routes/rest/globals/findVersions.d.ts.map +1 -1
- package/dist/routes/rest/globals/findVersions.js +5 -0
- package/dist/routes/rest/globals/findVersions.js.map +1 -1
- package/dist/routes/rest/globals/preview.d.ts.map +1 -1
- package/dist/routes/rest/globals/preview.js +11 -2
- package/dist/routes/rest/globals/preview.js.map +1 -1
- package/dist/routes/rest/globals/restoreVersion.d.ts.map +1 -1
- package/dist/routes/rest/globals/restoreVersion.js +5 -0
- package/dist/routes/rest/globals/restoreVersion.js.map +1 -1
- package/dist/routes/rest/globals/update.d.ts.map +1 -1
- package/dist/routes/rest/globals/update.js +5 -0
- package/dist/routes/rest/globals/update.js.map +1 -1
- package/dist/routes/rest/index.d.ts +1 -0
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +324 -213
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/routeError.d.ts +5 -4
- package/dist/routes/rest/routeError.d.ts.map +1 -1
- package/dist/routes/rest/routeError.js +25 -11
- package/dist/routes/rest/routeError.js.map +1 -1
- package/dist/routes/rest/types.d.ts +7 -7
- package/dist/routes/rest/types.d.ts.map +1 -1
- package/dist/routes/rest/types.js.map +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts +9 -0
- package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts.map +1 -0
- package/dist/routes/rest/utilities/sanitizeCollectionID.js +13 -0
- package/dist/routes/rest/utilities/sanitizeCollectionID.js.map +1 -0
- package/dist/scss/app.scss +2 -3
- package/dist/scss/vars.scss +0 -7
- package/dist/utilities/addDataAndFileToRequest.d.ts +11 -0
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -0
- package/dist/utilities/addDataAndFileToRequest.js +74 -0
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -0
- package/dist/utilities/addLocalesToRequest.d.ts +20 -0
- package/dist/utilities/addLocalesToRequest.d.ts.map +1 -0
- package/dist/utilities/addLocalesToRequest.js +41 -0
- package/dist/utilities/addLocalesToRequest.js.map +1 -0
- package/dist/utilities/buildFieldSchemaMap/index.d.ts +2 -2
- package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/index.js.map +1 -1
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +15 -28
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/getDataAndFile.d.ts +2 -2
- package/dist/utilities/getDataAndFile.d.ts.map +1 -1
- package/dist/utilities/getDataAndFile.js +27 -43
- package/dist/utilities/getDataAndFile.js.map +1 -1
- package/dist/utilities/getPayloadHMR.d.ts +2 -1
- package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
- package/dist/utilities/getPayloadHMR.js +22 -18
- package/dist/utilities/getPayloadHMR.js.map +1 -1
- package/dist/utilities/headersWithCors.d.ts +8 -0
- package/dist/utilities/headersWithCors.d.ts.map +1 -0
- package/dist/utilities/headersWithCors.js +17 -0
- package/dist/utilities/headersWithCors.js.map +1 -0
- package/dist/utilities/initPage.d.ts.map +1 -1
- package/dist/utilities/initPage.js +16 -2
- package/dist/utilities/initPage.js.map +1 -1
- package/dist/views/API/index.client.js +2 -2
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/Account/index.d.ts.map +1 -1
- package/dist/views/Account/index.js +2 -1
- package/dist/views/Account/index.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.d.ts +3 -3
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +48 -6
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.js +9 -20
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/index.scss +2 -12
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +2 -1
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.d.ts +1 -0
- package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +13 -6
- package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -1
- package/dist/views/Edit/Default/Auth/index.js +2 -1
- package/dist/views/Edit/Default/Auth/index.js.map +1 -1
- package/dist/views/Edit/Default/{SetStepNav → SetDocumentStepNav}/index.d.ts +1 -1
- package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +1 -0
- package/dist/views/Edit/Default/{SetStepNav → SetDocumentStepNav}/index.js +12 -5
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -0
- package/dist/views/Edit/Default/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/index.js +6 -5
- package/dist/views/Edit/Default/index.js.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts +3 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +58 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -0
- package/dist/views/ForgotPassword/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/index.js +3 -39
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/List/index.js +2 -2
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js +6 -4
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/LivePreview/index.client.js +2 -2
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
- package/dist/views/Login/LoginForm/index.js +32 -2
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
- package/dist/views/Logout/LogoutClient.js +1 -2
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Version/Restore/index.d.ts.map +1 -1
- package/dist/views/Version/Restore/index.js +11 -8
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/Restore/index.scss +4 -2
- package/dist/views/Versions/index.js +2 -2
- package/dist/views/Versions/index.js.map +1 -1
- package/dist/withPayload.d.ts.map +1 -1
- package/dist/withPayload.js +2 -1
- package/dist/withPayload.js.map +1 -1
- package/package.json +34 -32
- package/dist/next-fileupload/fileFactory.d.ts.map +0 -1
- package/dist/next-fileupload/fileFactory.js.map +0 -1
- package/dist/next-fileupload/handlers.d.ts.map +0 -1
- package/dist/next-fileupload/handlers.js.map +0 -1
- package/dist/next-fileupload/index.d.ts.map +0 -1
- package/dist/next-fileupload/index.js.map +0 -1
- package/dist/next-fileupload/isEligibleRequest.d.ts.map +0 -1
- package/dist/next-fileupload/isEligibleRequest.js.map +0 -1
- package/dist/next-fileupload/processMultipart.d.ts +0 -8
- package/dist/next-fileupload/processMultipart.d.ts.map +0 -1
- package/dist/next-fileupload/processMultipart.js.map +0 -1
- package/dist/next-fileupload/processNested.d.ts.map +0 -1
- package/dist/next-fileupload/processNested.js.map +0 -1
- package/dist/next-fileupload/uploadTimer.d.ts.map +0 -1
- package/dist/next-fileupload/uploadTimer.js.map +0 -1
- package/dist/next-fileupload/utilities.d.ts.map +0 -1
- package/dist/next-fileupload/utilities.js.map +0 -1
- package/dist/next-stream-file/index.d.ts.map +0 -1
- package/dist/next-stream-file/index.js.map +0 -1
- package/dist/prod/payload/SuisseIntl-Bold.woff +0 -0
- package/dist/prod/payload/SuisseIntl-Bold.woff2 +0 -0
- package/dist/prod/payload/SuisseIntl-Medium.woff +0 -0
- package/dist/prod/payload/SuisseIntl-Medium.woff2 +0 -0
- package/dist/prod/payload/SuisseIntl-SemiBold.woff +0 -0
- package/dist/prod/payload/SuisseIntl-SemiBold.woff2 +0 -0
- package/dist/prod/payload/SuisseIntl.woff +0 -0
- package/dist/prod/payload/SuisseIntl.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900italic.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900italic.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-italic.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-italic.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-regular.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-regular.woff2 +0 -0
- package/dist/scss/fonts.scss +0 -75
- package/dist/views/Edit/Default/SetStepNav/index.d.ts.map +0 -1
- package/dist/views/Edit/Default/SetStepNav/index.js.map +0 -1
- package/src/index.js +0 -1
- /package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.js +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/handlers.js +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.d.ts +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/processNested.d.ts +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.d.ts +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.js +0 -0
- /package/dist/{next-stream-file → fetchAPI-stream-file}/index.d.ts +0 -0
- /package/dist/{next-stream-file → fetchAPI-stream-file}/index.js +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { NextFileUploadOptions, NextFileUploadResponse } from './index.js';
|
|
2
|
-
type ProcessMultipart = (args: {
|
|
3
|
-
options: NextFileUploadOptions;
|
|
4
|
-
request: Request;
|
|
5
|
-
}) => Promise<NextFileUploadResponse>;
|
|
6
|
-
export declare const processMultipart: ProcessMultipart;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=processMultipart.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processMultipart.d.ts","sourceRoot":"","sources":["../../src/next-fileupload/processMultipart.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAU/E,KAAK,gBAAgB,GAAG,CAAC,IAAI,EAAE;IAC7B,OAAO,EAAE,qBAAqB,CAAA;IAC9B,OAAO,EAAE,OAAO,CAAA;CACjB,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACrC,eAAO,MAAM,gBAAgB,EAAE,gBAqJ9B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next-fileupload/processMultipart.ts"],"sourcesContent":["import Busboy from 'busboy'\nimport { APIError } from 'payload/errors'\n\nimport type { NextFileUploadOptions, NextFileUploadResponse } from './index.js'\n\nimport { fileFactory } from './fileFactory.js'\nimport { memHandler, tempFileHandler } from './handlers.js'\nimport { processNested } from './processNested.js'\nimport { createUploadTimer } from './uploadTimer.js'\nimport { buildFields, debugLog, isFunc, parseFileName } from './utilities.js'\n\nconst waitFlushProperty = Symbol('wait flush property symbol')\n\ntype ProcessMultipart = (args: {\n options: NextFileUploadOptions\n request: Request\n}) => Promise<NextFileUploadResponse>\nexport const processMultipart: ProcessMultipart = async ({ options, request }) => {\n let parsingRequest = true\n const result: NextFileUploadResponse = {\n fields: undefined,\n files: undefined,\n }\n\n const headersObject = {}\n request.headers.forEach((value, name) => {\n headersObject[name] = value\n })\n\n const busboy = Busboy({ ...options, headers: headersObject })\n\n // Build multipart req.body fields\n busboy.on('field', (field, val) => {\n result.fields = buildFields(result.fields, field, val)\n })\n\n // Build req.files fields\n busboy.on('file', (field, file, info) => {\n // Parse file name(cutting huge names, decoding, etc..).\n const { encoding, filename: name, mimeType: mime } = info\n const filename = parseFileName(options, name)\n\n // Define methods and handlers for upload process.\n const { cleanup, complete, dataHandler, getFilePath, getFileSize, getHash, getWritePromise } =\n options.useTempFiles\n ? tempFileHandler(options, field, filename) // Upload into temporary file.\n : memHandler(options, field, filename) // Upload into RAM.\n\n const writePromise = options.useTempFiles\n ? getWritePromise().catch((err) => {\n busboy.end()\n cleanup()\n })\n : getWritePromise()\n\n const uploadTimer = createUploadTimer(options.uploadTimeout, () => {\n file.removeAllListeners('data')\n file.resume()\n const err = new Error(`Upload timeout for ${field}->${filename}, bytes:${getFileSize()}`)\n return file.destroy(err)\n })\n\n file.on('limit', () => {\n debugLog(options, `Size limit reached for ${field}->${filename}, bytes:${getFileSize()}`)\n uploadTimer.clear()\n\n if (isFunc(options.limitHandler)) {\n options.limitHandler({ request, size: getFileSize() })\n }\n\n // Return error and cleanup files if abortOnLimit set.\n if (options.abortOnLimit) {\n debugLog(options, `Aborting upload because of size limit ${field}->${filename}.`)\n cleanup()\n parsingRequest = false\n throw new APIError(options.responseOnLimit, 413, { size: getFileSize() })\n }\n })\n\n file.on('data', (data) => {\n uploadTimer.set()\n dataHandler(data)\n })\n\n file.on('end', () => {\n const size = getFileSize()\n debugLog(options, `Upload finished ${field}->${filename}, bytes:${size}`)\n uploadTimer.clear()\n\n if (!name && size === 0) {\n if (options.useTempFiles) {\n cleanup()\n debugLog(options, `Removing the empty file ${field}->${filename}`)\n }\n return debugLog(options, `Don't add file instance if original name and size are empty`)\n }\n\n result.files = buildFields(\n result.files,\n field,\n fileFactory(\n {\n name: filename,\n buffer: complete(),\n encoding,\n hash: getHash(),\n mimetype: mime,\n size,\n tempFilePath: getFilePath(),\n truncated: Boolean('truncated' in file && file.truncated),\n },\n options,\n ),\n )\n\n if (!request[waitFlushProperty]) {\n request[waitFlushProperty] = []\n }\n request[waitFlushProperty].push(writePromise)\n })\n\n file.on('error', (err) => {\n uploadTimer.clear()\n debugLog(options, `File Error: ${err.message}`)\n cleanup()\n })\n\n debugLog(options, `New upload started ${field}->${filename}, bytes:${getFileSize()}`)\n uploadTimer.set()\n })\n\n busboy.on('finish', () => {\n debugLog(options, `Busboy finished parsing request.`)\n if (options.parseNested) {\n result.fields = processNested(result.fields)\n result.files = processNested(result.files)\n }\n\n if (request[waitFlushProperty]) {\n Promise.all(request[waitFlushProperty]).then(() => {\n delete request[waitFlushProperty]\n })\n }\n })\n\n busboy.on('error', (err) => {\n debugLog(options, `Busboy error`)\n parsingRequest = false\n throw new APIError('Busboy error parsing multipart request', 500)\n })\n\n const reader = request.body.getReader()\n\n while (parsingRequest) {\n const { done, value } = await reader.read()\n\n if (done) {\n parsingRequest = false\n }\n\n if (value) {\n busboy.write(value)\n }\n }\n\n return result\n}\n"],"names":["Busboy","APIError","fileFactory","memHandler","tempFileHandler","processNested","createUploadTimer","buildFields","debugLog","isFunc","parseFileName","waitFlushProperty","Symbol","processMultipart","options","request","parsingRequest","result","fields","undefined","files","headersObject","headers","forEach","value","name","busboy","on","field","val","file","info","encoding","filename","mimeType","mime","cleanup","complete","dataHandler","getFilePath","getFileSize","getHash","getWritePromise","useTempFiles","writePromise","catch","err","end","uploadTimer","uploadTimeout","removeAllListeners","resume","Error","destroy","clear","limitHandler","size","abortOnLimit","responseOnLimit","data","set","buffer","hash","mimetype","tempFilePath","truncated","Boolean","push","message","parseNested","Promise","all","then","reader","body","getReader","done","read","write"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,YAAY,SAAQ;AAC3B,SAASC,QAAQ,QAAQ,iBAAgB;AAI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ACC,SAAS;IAErC,MAAO3D,eAAgB;QACrB,MAAM,EAAE4D,IAAI,EAAEpD,KAAK,EAAE,GAAG,MAAMiD,OAAOI,IAAI;QAEzC,IAAID,MAAM;YACR5D,iBAAiB;QACnB;QAEA,IAAIQ,OAAO;YACTE,OAAOoD,KAAK,CAACtD;QACf;IACF;IAEA,OAAOP;AACT,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processNested.d.ts","sourceRoot":"","sources":["../../src/next-fileupload/processNested.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,oBA6BzB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next-fileupload/processNested.ts"],"sourcesContent":["import { isSafeFromPollution } from './utilities.js'\n\nexport const processNested = function (data) {\n if (!data || data.length < 1) return Object.create(null)\n\n const d = Object.create(null),\n keys = Object.keys(data)\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i],\n value = data[key],\n current = d,\n keyParts = key.replace(new RegExp(/\\[/g), '.').replace(new RegExp(/\\]/g), '').split('.')\n\n for (let index = 0; index < keyParts.length; index++) {\n const k = keyParts[index]\n\n // Ensure we don't allow prototype pollution\n if (!isSafeFromPollution(current, k)) {\n continue\n }\n\n if (index >= keyParts.length - 1) {\n current[k] = value\n } else {\n if (!current[k]) current[k] = !keyParts[index + 1] ? [] : Object.create(null)\n current = current[k]\n }\n }\n }\n return d\n}\n"],"names":["isSafeFromPollution","processNested","data","length","Object","create","d","keys","i","key","value","current","keyParts","replace","RegExp","split","index","k"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,mBAAmB,QAAQ,iBAAgB;AAEpD,OAAO,MAAMC,gBAAgB,SAAUC,IAAI;IACzC,IAAI,CAACA,QAAQA,KAAKC,MAAM,GAAG,GAAG,OAAOC,OAAOC,MAAM,CAAC;IAEnD,MAAMC,IAAIF,OAAOC,MAAM,CAAC,OACtBE,OAAOH,OAAOG,IAAI,CAACL;IAErB,IAAK,IAAIM,IAAI,GAAGA,IAAID,KAAKJ,MAAM,EAAEK,IAAK;QACpC,IAAIC,MAAMF,IAAI,CAACC,EAAE,EACfE,QAAQR,IAAI,CAACO,IAAI,EACjBE,UAAUL,GACVM,WAAWH,IAAII,OAAO,CAAC,IAAIC,OAAO,QAAQ,KAAKD,OAAO,CAAC,IAAIC,OAAO,QAAQ,IAAIC,KAAK,CAAC;QAEtF,IAAK,IAAIC,QAAQ,GAAGA,QAAQJ,SAAST,MAAM,EAAEa,QAAS;YACpD,MAAMC,IAAIL,QAAQ,CAACI,MAAM;YAEzB,4CAA4C;YAC5C,IAAI,CAAChB,oBAAoBW,SAASM,IAAI;gBACpC;YACF;YAEA,IAAID,SAASJ,SAAST,MAAM,GAAG,GAAG;gBAChCQ,OAAO,CAACM,EAAE,GAAGP;YACf,OAAO;gBACL,IAAI,CAACC,OAAO,CAACM,EAAE,EAAEN,OAAO,CAACM,EAAE,GAAG,CAACL,QAAQ,CAACI,QAAQ,EAAE,GAAG,EAAE,GAAGZ,OAAOC,MAAM,CAAC;gBACxEM,UAAUA,OAAO,CAACM,EAAE;YACtB;QACF;IACF;IACA,OAAOX;AACT,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uploadTimer.d.ts","sourceRoot":"","sources":["../../src/next-fileupload/uploadTimer.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG,CACvB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,KAClB;IACH,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,GAAG,EAAE,MAAM,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAgB/B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next-fileupload/uploadTimer.ts"],"sourcesContent":["type CreateUploadTimer = (\n timeout?: number,\n callback?: () => void,\n) => {\n clear: () => void\n set: () => boolean\n}\n\nexport const createUploadTimer: CreateUploadTimer = (timeout = 0, callback = () => {}) => {\n let timer = null\n\n const clear = () => {\n clearTimeout(timer)\n }\n\n const set = () => {\n // Do not start a timer if zero timeout or it hasn't been set.\n if (!timeout) return false\n clear()\n timer = setTimeout(callback, timeout)\n return true\n }\n\n return { clear, set }\n}\n"],"names":["createUploadTimer","timeout","callback","timer","clear","clearTimeout","set","setTimeout"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAQA,OAAO,MAAMA,oBAAuC,CAACC,UAAU,CAAC,EAAEC,WAAW,KAAO,CAAC;IACnF,IAAIC,QAAQ;IAEZ,MAAMC,QAAQ;QACZC,aAAaF;IACf;IAEA,MAAMG,MAAM;QACV,8DAA8D;QAC9D,IAAI,CAACL,SAAS,OAAO;QACrBG;QACAD,QAAQI,WAAWL,UAAUD;QAC7B,OAAO;IACT;IAEA,OAAO;QAAEG;QAAOE;IAAI;AACtB,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/next-fileupload/utilities.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAWvD;;GAEG;AACH,eAAO,MAAM,QAAQ,YAAa,qBAAqB,OAAO,MAAM,YAKnE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,MAAM,WAG7C,CAAA;AAED,KAAK,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;AACvC,eAAO,MAAM,MAAM,UAAW,GAAG,sBAEhC,CAAA;AAQD;;;GAGG;AACH,KAAK,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,KAAK,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAA;AAClG,eAA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GAAG,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;AAC9E,eAAO,MAAM,aAAa,EAAE,aAmB3B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next-fileupload/utilities.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport { Readable } from 'stream'\n\nimport type { NextFileUploadOptions } from './index.js'\n\n// Parameters for safe file name parsing.\nconst SAFE_FILE_NAME_REGEX = /[^\\w-]/g\nconst MAX_EXTENSION_LENGTH = 3\n\n// Parameters to generate unique temporary file names:\nconst TEMP_COUNTER_MAX = 65536\nconst TEMP_PREFIX = 'tmp'\nlet tempCounter = 0\n\n/**\n * Logs message to console if options.debug option set to true.\n */\nexport const debugLog = (options: NextFileUploadOptions, msg: string) => {\n const opts = options || {}\n if (!opts.debug) return false\n console.log(`Express-file-upload: ${msg}`) // eslint-disable-line\n return true\n}\n\n/**\n * Generates unique temporary file name. e.g. tmp-5000-156788789789.\n */\nexport const getTempFilename = (prefix: string = TEMP_PREFIX) => {\n tempCounter = tempCounter >= TEMP_COUNTER_MAX ? 1 : tempCounter + 1\n return `${prefix}-${tempCounter}-${Date.now()}`\n}\n\ntype FuncType = (...args: any[]) => any\nexport const isFunc = (value: any): value is FuncType => {\n return typeof value === 'function'\n}\n\n/**\n * Set errorFunc to the same value as successFunc for callback mode.\n */\ntype ErrorFunc = (resolve: () => void, reject: (err: Error) => void) => (err: Error) => void\nconst errorFunc: ErrorFunc = (resolve, reject) => (isFunc(reject) ? reject : resolve)\n\n/**\n * Return a callback function for promise resole/reject args.\n * Ensures that callback is called only once.\n */\ntype PromiseCallback = (resolve: () => void, reject: (err: Error) => void) => (err: Error) => void\nexport const promiseCallback: PromiseCallback = (resolve, reject) => {\n let hasFired = false\n return (err: Error) => {\n if (hasFired) {\n return\n }\n\n hasFired = true\n return err ? errorFunc(resolve, reject)(err) : resolve()\n }\n}\n\n// The default prototypes for both objects and arrays.\n// Used by isSafeFromPollution\nconst OBJECT_PROTOTYPE_KEYS = Object.getOwnPropertyNames(Object.prototype)\nconst ARRAY_PROTOTYPE_KEYS = Object.getOwnPropertyNames(Array.prototype)\n\n/**\n * Determines whether a key insertion into an object could result in a prototype pollution\n */\ntype IsSafeFromPollution = (base: any, key: string) => boolean\nexport const isSafeFromPollution: IsSafeFromPollution = (base, key) => {\n // We perform an instanceof check instead of Array.isArray as the former is more\n // permissive for cases in which the object as an Array prototype but was not constructed\n // via an Array constructor or literal.\n const TOUCHES_ARRAY_PROTOTYPE = base instanceof Array && ARRAY_PROTOTYPE_KEYS.includes(key)\n const TOUCHES_OBJECT_PROTOTYPE = OBJECT_PROTOTYPE_KEYS.includes(key)\n\n return !TOUCHES_ARRAY_PROTOTYPE && !TOUCHES_OBJECT_PROTOTYPE\n}\n\n/**\n * Build request field/file objects to return\n */\ntype BuildFields = (instance: any, field: string, value: any) => any\nexport const buildFields: BuildFields = (instance, field, value) => {\n // Do nothing if value is not set.\n if (value === null || value === undefined) return instance\n instance = instance || Object.create(null)\n\n if (!isSafeFromPollution(instance, field)) {\n return instance\n }\n // Non-array fields\n if (!instance[field]) {\n instance[field] = value\n return instance\n }\n // Array fields\n if (instance[field] instanceof Array) {\n instance[field].push(value)\n } else {\n instance[field] = [instance[field], value]\n }\n return instance\n}\n\n/**\n * Creates a folder if it does not exist\n * for file specified in the path variable\n */\ntype CheckAndMakeDir = (fileUploadOptions: NextFileUploadOptions, filePath: string) => boolean\nexport const checkAndMakeDir: CheckAndMakeDir = (fileUploadOptions, filePath) => {\n if (!fileUploadOptions.createParentPath) return false\n // Check whether folder for the file exists.\n const parentPath = path.dirname(filePath)\n // Create folder if it doesn't exist.\n if (!fs.existsSync(parentPath)) fs.mkdirSync(parentPath, { recursive: true })\n // Checks folder again and return a results.\n return fs.existsSync(parentPath)\n}\n\n/**\n * Delete a file.\n */\ntype DeleteFile = (filePath: string, callback: (args: any) => void) => void\nexport const deleteFile: DeleteFile = (filePath, callback: (args) => void) =>\n fs.unlink(filePath, callback)\n\n/**\n * Copy file via streams\n */\ntype CopyFile = (src: string, dst: string, callback: (err: Error) => void) => void\nconst copyFile: CopyFile = (src, dst, callback) => {\n // cbCalled flag and runCb helps to run cb only once.\n let cbCalled = false\n const runCb = (err?: Error) => {\n if (cbCalled) return\n cbCalled = true\n callback(err)\n }\n // Create read stream\n const readable = fs.createReadStream(src)\n readable.on('error', runCb)\n // Create write stream\n const writable = fs.createWriteStream(dst)\n writable.on('error', (err: Error) => {\n readable.destroy()\n runCb(err)\n })\n writable.on('close', () => runCb())\n // Copy file via piping streams.\n readable.pipe(writable)\n}\n\n/**\n * moveFile: moves the file from src to dst.\n * Firstly trying to rename the file if no luck copying it to dst and then deleting src.\n */\ntype MoveFile = (\n src: string,\n dst: string,\n callback: (err: Error, renamed?: boolean) => void,\n) => void\nexport const moveFile: MoveFile = (src, dst, callback) =>\n fs.rename(src, dst, (err) => {\n if (err) {\n // Try to copy file if rename didn't work.\n copyFile(src, dst, (cpErr) => (cpErr ? callback(cpErr) : deleteFile(src, callback)))\n return\n }\n // File was renamed successfully: Add true to the callback to indicate that.\n callback(null, true)\n })\n\n/**\n * Save buffer data to a file.\n * @param {Buffer} buffer - buffer to save to a file.\n * @param {string} filePath - path to a file.\n */\nexport const saveBufferToFile = (buffer, filePath, callback) => {\n if (!Buffer.isBuffer(buffer)) {\n return callback(new Error('buffer variable should be type of Buffer!'))\n }\n // Setup readable stream from buffer.\n let streamData = buffer\n const readStream = new Readable()\n readStream._read = () => {\n readStream.push(streamData)\n streamData = null\n }\n // Setup file system writable stream.\n const fstream = fs.createWriteStream(filePath)\n // console.log(\"Calling saveBuffer\");\n fstream.on('error', (err) => {\n // console.log(\"err cb\")\n callback(err)\n })\n fstream.on('close', () => {\n // console.log(\"close cb\");\n callback()\n })\n // Copy file via piping streams.\n readStream.pipe(fstream)\n}\n\n/**\n * Decodes uriEncoded file names.\n * @param {Object} opts - middleware options.\n * @param fileName {String} - file name to decode.\n * @returns {String}\n */\nconst uriDecodeFileName = (opts, fileName) => {\n if (!opts || !opts.uriDecodeFileNames) {\n return fileName\n }\n // Decode file name from URI with checking URI malformed errors.\n // See Issue https://github.com/richardgirges/express-fileupload/issues/342.\n try {\n return decodeURIComponent(fileName)\n } catch (err) {\n const matcher = /(%[a-f\\d]{2})/gi\n return fileName\n .split(matcher)\n .map((str) => {\n try {\n return decodeURIComponent(str)\n } catch (err) {\n return ''\n }\n })\n .join('')\n }\n}\n\n/**\n * Parses filename and extension and returns object {name, extension}.\n */\ntype ParseFileNameExtension = (\n preserveExtension: boolean | number,\n fileName: string,\n) => {\n extension: string\n name: string\n}\nexport const parseFileNameExtension: ParseFileNameExtension = (preserveExtension, fileName) => {\n const defaultResult = {\n name: fileName,\n extension: '',\n }\n if (!preserveExtension) return defaultResult\n\n // Define maximum extension length\n const maxExtLength =\n typeof preserveExtension === 'boolean' ? MAX_EXTENSION_LENGTH : preserveExtension\n\n const nameParts = fileName.split('.')\n if (nameParts.length < 2) return defaultResult\n\n let extension = nameParts.pop()\n if (extension.length > maxExtLength && maxExtLength > 0) {\n nameParts[nameParts.length - 1] += '.' + extension.substr(0, extension.length - maxExtLength)\n extension = extension.substr(-maxExtLength)\n }\n\n return {\n name: nameParts.join('.'),\n extension: maxExtLength ? extension : '',\n }\n}\n\n/**\n * Parse file name and extension.\n */\ntype ParseFileName = (opts: NextFileUploadOptions, fileName: string) => string\nexport const parseFileName: ParseFileName = (opts, fileName) => {\n // Check fileName argument\n if (!fileName || typeof fileName !== 'string') return getTempFilename()\n // Cut off file name if it's length more then 255.\n let parsedName = fileName.length <= 255 ? fileName : fileName.substr(0, 255)\n // Decode file name if uriDecodeFileNames option set true.\n parsedName = uriDecodeFileName(opts, parsedName)\n // Stop parsing file name if safeFileNames options hasn't been set.\n if (!opts.safeFileNames) return parsedName\n // Set regular expression for the file name.\n const nameRegex =\n typeof opts.safeFileNames === 'object' && opts.safeFileNames instanceof RegExp\n ? opts.safeFileNames\n : SAFE_FILE_NAME_REGEX\n // Parse file name extension.\n let { name, extension } = parseFileNameExtension(opts.preserveExtension, parsedName)\n if (extension.length) extension = '.' + extension.replace(nameRegex, '')\n\n return name.replace(nameRegex, '').concat(extension)\n}\n"],"names":["fs","path","Readable","SAFE_FILE_NAME_REGEX","MAX_EXTENSION_LENGTH","TEMP_COUNTER_MAX","TEMP_PREFIX","tempCounter","debugLog","options","msg","opts","debug","console","log","getTempFilename","prefix","Date","now","isFunc","value","errorFunc","resolve","reject","promiseCallback","hasFired","err","OBJECT_PROTOTYPE_KEYS","Object","getOwnPropertyNames","prototype","ARRAY_PROTOTYPE_KEYS","Array","isSafeFromPollution","base","key","TOUCHES_ARRAY_PROTOTYPE","includes","TOUCHES_OBJECT_PROTOTYPE","buildFields","instance","field","undefined","create","push","checkAndMakeDir","fileUploadOptions","filePath","createParentPath","parentPath","dirname","existsSync","mkdirSync","recursive","deleteFile","callback","unlink","copyFile","src","dst","cbCalled","runCb","readable","createReadStream","on","writable","createWriteStream","destroy","pipe","moveFile","rename","cpErr","saveBufferToFile","buffer","Buffer","isBuffer","Error","streamData","readStream","_read","fstream","uriDecodeFileName","fileName","uriDecodeFileNames","decodeURIComponent","matcher","split","map","str","join","parseFileNameExtension","preserveExtension","defaultResult","name","extension","maxExtLength","nameParts","length","pop","substr","parseFileName","parsedName","safeFileNames","nameRegex","RegExp","replace","concat"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,SAASC,QAAQ,QAAQ,SAAQ;AAI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AYE,SACpE7F,KAAK2F,aAAa,GAClBnG;IACN,6BAA6B;IAC7B,IAAI,EAAE0F,IAAI,EAAEC,SAAS,EAAE,GAAGJ,uBAAuB/E,KAAKgF,iBAAiB,EAAEU;IACzE,IAAIP,UAAUG,MAAM,EAAEH,YAAY,MAAMA,UAAUW,OAAO,CAACF,WAAW;IAErE,OAAOV,KAAKY,OAAO,CAACF,WAAW,IAAIG,MAAM,CAACZ;AAC5C,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/next-stream-file/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,wBAAgB,gBAAgB,CAAC,QAAQ,KAAA,uBAWxC;AAED,wBAAuB,oBAAoB,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,6CAIhE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAIvD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next-stream-file/index.ts"],"sourcesContent":["import fs from 'fs'\n\nexport function iteratorToStream(iterator) {\n return new ReadableStream({\n async pull(controller) {\n const { done, value } = await iterator.next()\n if (done) {\n controller.close()\n } else {\n controller.enqueue(value)\n }\n },\n })\n}\n\nexport async function* nodeStreamToIterator(stream: fs.ReadStream) {\n for await (const chunk of stream) {\n yield new Uint8Array(chunk)\n }\n}\n\nexport function streamFile(path: string): ReadableStream {\n const nodeStream = fs.createReadStream(path)\n const data: ReadableStream = iteratorToStream(nodeStreamToIterator(nodeStream))\n return data\n}\n"],"names":["fs","iteratorToStream","iterator","ReadableStream","pull","controller","done","value","next","close","enqueue","nodeStreamToIterator","stream","chunk","Uint8Array","streamFile","path","nodeStream","createReadStream","data"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,QAAQ,KAAI;AAEnB,OAAO,SAASC,iBAAiBC,QAAQ;IACvC,OAAO,IAAIC,eAAe;QACxB,MAAMC,MAAKC,UAAU;YACnB,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAG,MAAML,SAASM,IAAI;YAC3C,IAAIF,MAAM;gBACRD,WAAWI,KAAK;YAClB,OAAO;gBACLJ,WAAWK,OAAO,CAACH;YACrB;QACF;IACF;AACF;AAEA,OAAO,gBAAgBI,qBAAqBC,MAAqB;IAC/D,WAAW,MAAMC,SAASD,OAAQ;QAChC,MAAM,IAAIE,WAAWD;IACvB;AACF;AAEA,OAAO,SAASE,WAAWC,IAAY;IACrC,MAAMC,aAAajB,GAAGkB,gBAAgB,CAACF;IACvC,MAAMG,OAAuBlB,iBAAiBU,qBAAqBM;IACnE,OAAOE;AACT"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/scss/fonts.scss
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
font-family: 'Suisse Intl';
|
|
3
|
-
src:
|
|
4
|
-
url('../assets/fonts/SuisseIntl.woff2') format('woff2'),
|
|
5
|
-
url('../assets/fonts/SuisseIntl.woff') format('woff');
|
|
6
|
-
font-weight: normal;
|
|
7
|
-
font-style: normal;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@font-face {
|
|
11
|
-
font-family: 'Suisse Intl';
|
|
12
|
-
src:
|
|
13
|
-
url('../assets/fonts/SuisseIntl-Medium.woff2') format('woff2'),
|
|
14
|
-
url('../assets/fonts/SuisseIntl-Medium.woff') format('woff');
|
|
15
|
-
font-weight: 500;
|
|
16
|
-
font-style: normal;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@font-face {
|
|
20
|
-
font-family: 'Suisse Intl';
|
|
21
|
-
src:
|
|
22
|
-
url('../assets/fonts/SuisseIntl-SemiBold.woff2') format('woff2'),
|
|
23
|
-
url('../assets/fonts/SuisseIntl-SemiBold.woff') format('woff');
|
|
24
|
-
font-weight: 600;
|
|
25
|
-
font-style: normal;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@font-face {
|
|
29
|
-
font-family: 'Suisse Intl';
|
|
30
|
-
src:
|
|
31
|
-
url('../assets/fonts/SuisseIntl-Bold.woff2') format('woff2'),
|
|
32
|
-
url('../assets/fonts/SuisseIntl-Bold.woff') format('woff');
|
|
33
|
-
font-weight: bold;
|
|
34
|
-
font-style: normal;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@font-face {
|
|
38
|
-
font-family: 'Merriweather';
|
|
39
|
-
font-style: normal;
|
|
40
|
-
font-weight: 400;
|
|
41
|
-
src:
|
|
42
|
-
local(''),
|
|
43
|
-
url('../assets/fonts/merriweather-v30-latin-regular.woff2') format('woff2'),
|
|
44
|
-
url('../assets/fonts/merriweather-v30-latin-regular.woff') format('woff');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@font-face {
|
|
48
|
-
font-family: 'Merriweather';
|
|
49
|
-
font-style: italic;
|
|
50
|
-
font-weight: 400;
|
|
51
|
-
src:
|
|
52
|
-
local(''),
|
|
53
|
-
url('../assets/fonts/merriweather-v30-latin-italic.woff2') format('woff2'),
|
|
54
|
-
url('../assets/fonts/merriweather-v30-latin-italic.woff') format('woff');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@font-face {
|
|
58
|
-
font-family: 'Merriweather';
|
|
59
|
-
font-style: normal;
|
|
60
|
-
font-weight: 900;
|
|
61
|
-
src:
|
|
62
|
-
local(''),
|
|
63
|
-
url('../assets/fonts/merriweather-v30-latin-900.woff2') format('woff2'),
|
|
64
|
-
url('../assets/fonts/merriweather-v30-latin-900.woff') format('woff');
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@font-face {
|
|
68
|
-
font-family: 'Merriweather';
|
|
69
|
-
font-style: italic;
|
|
70
|
-
font-weight: 900;
|
|
71
|
-
src:
|
|
72
|
-
local(''),
|
|
73
|
-
url('../assets/fonts/merriweather-v30-latin-900italic.woff2') format('woff2'),
|
|
74
|
-
url('../assets/fonts/merriweather-v30-latin-900italic.woff') format('woff');
|
|
75
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/Edit/Default/SetStepNav/index.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAUrF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAChC,cAAc,CAAC,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAA;IAClD,WAAW,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAA;IAC5C,UAAU,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAC1C,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,yBAAyB,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAA;IAC3D,UAAU,CAAC,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAA;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAmEA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/views/Edit/Default/SetStepNav/index.tsx"],"sourcesContent":["'use client'\nimport type { StepNavItem } from '@payloadcms/ui/elements/StepNav'\nimport type { SanitizedCollectionConfig, SanitizedGlobalConfig } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { useStepNav } from '@payloadcms/ui/elements/StepNav'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useEditDepth } from '@payloadcms/ui/providers/EditDepth'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport { useEffect } from 'react'\n\nexport const SetStepNav: React.FC<{\n collectionSlug?: SanitizedCollectionConfig['slug']\n globalLabel?: SanitizedGlobalConfig['label']\n globalSlug?: SanitizedGlobalConfig['slug']\n id?: number | string\n pluralLabel?: SanitizedCollectionConfig['labels']['plural']\n useAsTitle?: SanitizedCollectionConfig['admin']['useAsTitle']\n view?: string\n}> = (props) => {\n const { id, collectionSlug, globalSlug, pluralLabel, useAsTitle } = props\n\n const view: string | undefined = props?.view || undefined\n\n const { isEditing, title } = useDocumentInfo()\n\n const { setStepNav } = useStepNav()\n\n const { i18n, t } = useTranslation()\n\n const {\n routes: { admin },\n } = useConfig()\n\n const drawerDepth = useEditDepth()\n\n useEffect(() => {\n const nav: StepNavItem[] = []\n\n if (collectionSlug) {\n nav.push({\n label: getTranslation(pluralLabel, i18n),\n url: `${admin}/collections/${collectionSlug}`,\n })\n\n if (isEditing) {\n nav.push({\n label: (useAsTitle && useAsTitle !== 'id' && title) || `${id}`,\n url: `${admin}/collections/${collectionSlug}/${id}`,\n })\n } else {\n nav.push({\n label: t('general:createNew'),\n })\n }\n } else if (globalSlug) {\n nav.push({\n label: title,\n url: `${admin}/globals/${globalSlug}`,\n })\n }\n\n if (view) {\n nav.push({\n label: view,\n })\n }\n\n if (drawerDepth <= 1) setStepNav(nav)\n }, [\n setStepNav,\n isEditing,\n pluralLabel,\n id,\n useAsTitle,\n admin,\n t,\n i18n,\n title,\n collectionSlug,\n globalSlug,\n view,\n drawerDepth,\n ])\n\n return null\n}\n"],"names":["getTranslation","useStepNav","useConfig","useDocumentInfo","useEditDepth","useTranslation","useEffect","SetStepNav","props","id","collectionSlug","globalSlug","pluralLabel","useAsTitle","view","undefined","isEditing","title","setStepNav","i18n","t","routes","admin","drawerDepth","nav","push","label","url"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC;YACvC;QACF;QAEA,IAAIG,MAAM;YACRU,IAAIC,IAAI,CAAC;gBACPC,OAAOZ;YACT;QACF;QAEA,IAAIS,eAAe,GAAGL,WAAWM;IACnC,GAAG;QACDN;QACAF;QACAJ;QACAH;QACAI;QACAS;QACAF;QACAD;QACAF;QACAP;QACAC;QACAG;QACAS;KACD;IAED,OAAO;AACT,EAAC"}
|
package/src/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as withPayload } from './withPayload.js'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|