@payloadcms/figma 0.0.1-alpha.42 → 0.0.1-alpha.6
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/api/control-plane.d.ts +1 -22
- package/dist/api/control-plane.d.ts.map +1 -1
- package/dist/api/control-plane.js +22 -55
- package/dist/api/control-plane.js.map +1 -1
- package/dist/api/figma-api.d.ts.map +1 -1
- package/dist/api/figma-api.js +21 -45
- package/dist/api/figma-api.js.map +1 -1
- package/dist/auth/callback-server.d.ts.map +1 -1
- package/dist/auth/callback-server.js +1 -2
- package/dist/auth/callback-server.js.map +1 -1
- package/dist/auth/crypto-utils.d.ts.map +1 -1
- package/dist/auth/crypto-utils.js +5 -5
- package/dist/auth/crypto-utils.js.map +1 -1
- package/dist/auth/jwt-validator.d.ts +1 -2
- package/dist/auth/jwt-validator.d.ts.map +1 -1
- package/dist/auth/jwt-validator.js +2 -2
- package/dist/auth/jwt-validator.js.map +1 -1
- package/dist/auth/oauth-flow.d.ts +1 -1
- package/dist/auth/oauth-flow.d.ts.map +1 -1
- package/dist/auth/oauth-flow.js +11 -15
- package/dist/auth/oauth-flow.js.map +1 -1
- package/dist/auth/project-token.d.ts.map +1 -1
- package/dist/auth/project-token.js +4 -9
- package/dist/auth/project-token.js.map +1 -1
- package/dist/auth/refresh.d.ts +1 -2
- package/dist/auth/refresh.d.ts.map +1 -1
- package/dist/auth/refresh.js +12 -25
- package/dist/auth/refresh.js.map +1 -1
- package/dist/auth/token-store.d.ts +0 -12
- package/dist/auth/token-store.d.ts.map +1 -1
- package/dist/auth/token-store.js +5 -28
- package/dist/auth/token-store.js.map +1 -1
- package/dist/auth/types.d.ts +4 -7
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -39
- package/dist/cli.js.map +1 -1
- package/dist/commands/deploy.d.ts +0 -4
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +129 -72
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/init.d.ts +5 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +85 -105
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list-tokens.d.ts +3 -3
- package/dist/commands/list-tokens.d.ts.map +1 -1
- package/dist/commands/list-tokens.js +7 -22
- package/dist/commands/list-tokens.js.map +1 -1
- package/dist/commands/login.d.ts +1 -8
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +12 -30
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.d.ts +4 -5
- package/dist/commands/logout.d.ts.map +1 -1
- package/dist/commands/logout.js +13 -56
- package/dist/commands/logout.js.map +1 -1
- package/dist/config/oauth.d.ts +14 -4
- package/dist/config/oauth.d.ts.map +1 -1
- package/dist/config/oauth.js +40 -19
- package/dist/config/oauth.js.map +1 -1
- package/dist/constants.d.ts +18 -26
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +20 -34
- package/dist/constants.js.map +1 -1
- package/dist/exports/client.d.ts +0 -1
- package/dist/exports/client.d.ts.map +1 -1
- package/dist/exports/client.js +0 -1
- package/dist/exports/client.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/oauth/components/LoginButton/index.d.ts.map +1 -1
- package/dist/oauth/components/LoginButton/index.js +6 -50
- package/dist/oauth/components/LoginButton/index.js.map +1 -1
- package/dist/oauth/components/LoginButton/index.scss +3 -50
- package/dist/oauth/components/LogoutButton/index.d.ts.map +1 -1
- package/dist/oauth/components/LogoutButton/index.js +4 -5
- package/dist/oauth/components/LogoutButton/index.js.map +1 -1
- package/dist/oauth/defaults.d.ts.map +1 -1
- package/dist/oauth/defaults.js +5 -29
- package/dist/oauth/defaults.js.map +1 -1
- package/dist/oauth/endpoints/getLoginEndpoint.d.ts.map +1 -1
- package/dist/oauth/endpoints/getLoginEndpoint.js +11 -21
- package/dist/oauth/endpoints/getLoginEndpoint.js.map +1 -1
- package/dist/oauth/endpoints/getLogoutEndpoint.d.ts.map +1 -1
- package/dist/oauth/endpoints/getLogoutEndpoint.js +4 -7
- package/dist/oauth/endpoints/getLogoutEndpoint.js.map +1 -1
- package/dist/oauth/index.d.ts.map +1 -1
- package/dist/oauth/index.js +13 -40
- package/dist/oauth/index.js.map +1 -1
- package/dist/oauth/strategy/index.d.ts +2 -0
- package/dist/oauth/strategy/index.d.ts.map +1 -1
- package/dist/oauth/strategy/index.js +15 -38
- package/dist/oauth/strategy/index.js.map +1 -1
- package/dist/oauth/types.d.ts +6 -6
- package/dist/oauth/types.d.ts.map +1 -1
- package/dist/oauth/types.js.map +1 -1
- package/dist/oauth/utilities/createCookieOptions.d.ts.map +1 -1
- package/dist/oauth/utilities/createCookieOptions.js.map +1 -1
- package/dist/oauth/utilities/getAdminPath.d.ts +8 -0
- package/dist/oauth/utilities/getAdminPath.d.ts.map +1 -0
- package/dist/oauth/utilities/getAdminPath.js +9 -0
- package/dist/oauth/utilities/getAdminPath.js.map +1 -0
- package/dist/oauth/utilities/refreshTokens.d.ts.map +1 -1
- package/dist/oauth/utilities/refreshTokens.js +1 -1
- package/dist/oauth/utilities/refreshTokens.js.map +1 -1
- package/dist/plugin/build-config.d.ts +4 -21
- package/dist/plugin/build-config.d.ts.map +1 -1
- package/dist/plugin/build-config.js +7 -113
- package/dist/plugin/build-config.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/asset-collection.d.ts +6 -3
- package/dist/utils/asset-collection.d.ts.map +1 -1
- package/dist/utils/asset-collection.js +34 -10
- package/dist/utils/asset-collection.js.map +1 -1
- package/dist/utils/config.js +1 -1
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/env-management.d.ts +8 -9
- package/dist/utils/env-management.d.ts.map +1 -1
- package/dist/utils/env-management.js +74 -73
- package/dist/utils/env-management.js.map +1 -1
- package/dist/utils/formatter.d.ts.map +1 -1
- package/dist/utils/formatter.js +5 -3
- package/dist/utils/formatter.js.map +1 -1
- package/dist/utils/lambda-config.d.ts +1 -3
- package/dist/utils/lambda-config.d.ts.map +1 -1
- package/dist/utils/lambda-config.js +32 -38
- package/dist/utils/lambda-config.js.map +1 -1
- package/dist/utils/messages.js +8 -8
- package/dist/utils/messages.js.map +1 -1
- package/dist/utils/payload-config-ast.d.ts +3 -22
- package/dist/utils/payload-config-ast.d.ts.map +1 -1
- package/dist/utils/payload-config-ast.js +31 -89
- package/dist/utils/payload-config-ast.js.map +1 -1
- package/dist/utils/payload-config-finder.d.ts +2 -2
- package/dist/utils/payload-config-finder.d.ts.map +1 -1
- package/dist/utils/payload-config-finder.js +9 -48
- package/dist/utils/payload-config-finder.js.map +1 -1
- package/dist/utils/payload-config-modifier.d.ts.map +1 -1
- package/dist/utils/payload-config-modifier.js +6 -54
- package/dist/utils/payload-config-modifier.js.map +1 -1
- package/dist/utils/payload-package-check.d.ts +1 -12
- package/dist/utils/payload-package-check.d.ts.map +1 -1
- package/dist/utils/payload-package-check.js +5 -63
- package/dist/utils/payload-package-check.js.map +1 -1
- package/dist/utils/project.d.ts.map +1 -1
- package/dist/utils/project.js +5 -8
- package/dist/utils/project.js.map +1 -1
- package/dist/utils/s3-upload.d.ts +1 -0
- package/dist/utils/s3-upload.d.ts.map +1 -1
- package/dist/utils/s3-upload.js +3 -10
- package/dist/utils/s3-upload.js.map +1 -1
- package/dist/utils/token-display.d.ts.map +1 -1
- package/dist/utils/token-display.js +5 -11
- package/dist/utils/token-display.js.map +1 -1
- package/dist/utils/typescript-validator.d.ts.map +1 -1
- package/dist/utils/typescript-validator.js +6 -4
- package/dist/utils/typescript-validator.js.map +1 -1
- package/package.json +9 -27
- package/dist/commands/build-lambda-zip.d.ts +0 -5
- package/dist/commands/build-lambda-zip.d.ts.map +0 -1
- package/dist/commands/build-lambda-zip.js +0 -19
- package/dist/commands/build-lambda-zip.js.map +0 -1
- package/dist/db-content-api/README.md +0 -98
- package/dist/db-content-api/generated/content-api-types.d.ts +0 -3914
- package/dist/db-content-api/generated/content-api-types.d.ts.map +0 -1
- package/dist/db-content-api/generated/content-api-types.js +0 -7
- package/dist/db-content-api/generated/content-api-types.js.map +0 -1
- package/dist/db-content-api/index.d.ts +0 -18
- package/dist/db-content-api/index.d.ts.map +0 -1
- package/dist/db-content-api/index.js +0 -586
- package/dist/db-content-api/index.js.map +0 -1
- package/dist/db-content-api/temp-utilities/slug.d.ts +0 -2
- package/dist/db-content-api/temp-utilities/slug.d.ts.map +0 -1
- package/dist/db-content-api/temp-utilities/slug.js +0 -3
- package/dist/db-content-api/temp-utilities/slug.js.map +0 -1
- package/dist/db-content-api/temp-utilities/sorting.d.ts +0 -3
- package/dist/db-content-api/temp-utilities/sorting.d.ts.map +0 -1
- package/dist/db-content-api/temp-utilities/sorting.js +0 -32
- package/dist/db-content-api/temp-utilities/sorting.js.map +0 -1
- package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts +0 -34
- package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts.map +0 -1
- package/dist/db-content-api/temp-utilities/unwrapDocument.js +0 -53
- package/dist/db-content-api/temp-utilities/unwrapDocument.js.map +0 -1
- package/dist/db-content-api/utilities/auth.d.ts +0 -30
- package/dist/db-content-api/utilities/auth.d.ts.map +0 -1
- package/dist/db-content-api/utilities/auth.js +0 -81
- package/dist/db-content-api/utilities/auth.js.map +0 -1
- package/dist/db-content-api/utilities/buildPathTypes.d.ts +0 -12
- package/dist/db-content-api/utilities/buildPathTypes.d.ts.map +0 -1
- package/dist/db-content-api/utilities/buildPathTypes.js +0 -157
- package/dist/db-content-api/utilities/buildPathTypes.js.map +0 -1
- package/dist/db-content-api/utilities/data/applyDefaults.d.ts +0 -7
- package/dist/db-content-api/utilities/data/applyDefaults.d.ts.map +0 -1
- package/dist/db-content-api/utilities/data/applyDefaults.js +0 -59
- package/dist/db-content-api/utilities/data/applyDefaults.js.map +0 -1
- package/dist/db-content-api/utilities/data/castFieldValue.d.ts +0 -11
- package/dist/db-content-api/utilities/data/castFieldValue.d.ts.map +0 -1
- package/dist/db-content-api/utilities/data/castFieldValue.js +0 -66
- package/dist/db-content-api/utilities/data/castFieldValue.js.map +0 -1
- package/dist/db-content-api/utilities/data/index.d.ts +0 -32
- package/dist/db-content-api/utilities/data/index.d.ts.map +0 -1
- package/dist/db-content-api/utilities/data/index.js +0 -190
- package/dist/db-content-api/utilities/data/index.js.map +0 -1
- package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +0 -12
- package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts.map +0 -1
- package/dist/db-content-api/utilities/data/removeVirtualFields.js +0 -54
- package/dist/db-content-api/utilities/data/removeVirtualFields.js.map +0 -1
- package/dist/db-content-api/utilities/data/stripFields.d.ts +0 -48
- package/dist/db-content-api/utilities/data/stripFields.d.ts.map +0 -1
- package/dist/db-content-api/utilities/data/stripFields.js +0 -195
- package/dist/db-content-api/utilities/data/stripFields.js.map +0 -1
- package/dist/db-content-api/utilities/joins.d.ts +0 -55
- package/dist/db-content-api/utilities/joins.d.ts.map +0 -1
- package/dist/db-content-api/utilities/joins.js +0 -136
- package/dist/db-content-api/utilities/joins.js.map +0 -1
- package/dist/db-content-api/utilities/where.d.ts +0 -12
- package/dist/db-content-api/utilities/where.d.ts.map +0 -1
- package/dist/db-content-api/utilities/where.js +0 -121
- package/dist/db-content-api/utilities/where.js.map +0 -1
- package/dist/endpoints/health.d.ts +0 -3
- package/dist/endpoints/health.d.ts.map +0 -1
- package/dist/endpoints/health.js +0 -11
- package/dist/endpoints/health.js.map +0 -1
- package/dist/oauth/utilities/isDuplicateKeyError.d.ts +0 -7
- package/dist/oauth/utilities/isDuplicateKeyError.d.ts.map +0 -1
- package/dist/oauth/utilities/isDuplicateKeyError.js +0 -14
- package/dist/oauth/utilities/isDuplicateKeyError.js.map +0 -1
- package/dist/storage-content-api/api-types.d.ts +0 -168
- package/dist/storage-content-api/api-types.d.ts.map +0 -1
- package/dist/storage-content-api/api-types.js +0 -6
- package/dist/storage-content-api/api-types.js.map +0 -1
- package/dist/storage-content-api/client-uploads/ClientUploadHandler.d.ts +0 -9
- package/dist/storage-content-api/client-uploads/ClientUploadHandler.d.ts.map +0 -1
- package/dist/storage-content-api/client-uploads/ClientUploadHandler.js +0 -42
- package/dist/storage-content-api/client-uploads/ClientUploadHandler.js.map +0 -1
- package/dist/storage-content-api/client-uploads/generateSignedURL.d.ts +0 -13
- package/dist/storage-content-api/client-uploads/generateSignedURL.d.ts.map +0 -1
- package/dist/storage-content-api/client-uploads/generateSignedURL.js +0 -32
- package/dist/storage-content-api/client-uploads/generateSignedURL.js.map +0 -1
- package/dist/storage-content-api/client.d.ts +0 -6
- package/dist/storage-content-api/client.d.ts.map +0 -1
- package/dist/storage-content-api/client.js +0 -36
- package/dist/storage-content-api/client.js.map +0 -1
- package/dist/storage-content-api/generateURL.d.ts +0 -7
- package/dist/storage-content-api/generateURL.d.ts.map +0 -1
- package/dist/storage-content-api/generateURL.js +0 -8
- package/dist/storage-content-api/generateURL.js.map +0 -1
- package/dist/storage-content-api/handleDelete.d.ts +0 -8
- package/dist/storage-content-api/handleDelete.d.ts.map +0 -1
- package/dist/storage-content-api/handleDelete.js +0 -17
- package/dist/storage-content-api/handleDelete.js.map +0 -1
- package/dist/storage-content-api/handleUpload.d.ts +0 -11
- package/dist/storage-content-api/handleUpload.d.ts.map +0 -1
- package/dist/storage-content-api/handleUpload.js +0 -144
- package/dist/storage-content-api/handleUpload.js.map +0 -1
- package/dist/storage-content-api/index.d.ts +0 -5
- package/dist/storage-content-api/index.d.ts.map +0 -1
- package/dist/storage-content-api/index.js +0 -31
- package/dist/storage-content-api/index.js.map +0 -1
- package/dist/storage-content-api/staticHandler.d.ts +0 -10
- package/dist/storage-content-api/staticHandler.d.ts.map +0 -1
- package/dist/storage-content-api/staticHandler.js +0 -56
- package/dist/storage-content-api/staticHandler.js.map +0 -1
- package/dist/storage-content-api/types.d.ts +0 -10
- package/dist/storage-content-api/types.d.ts.map +0 -1
- package/dist/storage-content-api/types.js +0 -3
- package/dist/storage-content-api/types.js.map +0 -1
- package/dist/templates/README.md +0 -19
- package/dist/utils/build-lambda-zip.d.ts +0 -14
- package/dist/utils/build-lambda-zip.d.ts.map +0 -1
- package/dist/utils/build-lambda-zip.js +0 -81
- package/dist/utils/build-lambda-zip.js.map +0 -1
- package/dist/utils/format-env-suffix.d.ts +0 -12
- package/dist/utils/format-env-suffix.d.ts.map +0 -1
- package/dist/utils/format-env-suffix.js +0 -13
- package/dist/utils/format-env-suffix.js.map +0 -1
- package/dist/utils/version-check.d.ts +0 -3
- package/dist/utils/version-check.d.ts.map +0 -1
- package/dist/utils/version-check.js +0 -38
- package/dist/utils/version-check.js.map +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if an error is a duplicate key/unique constraint violation from Content API.
|
|
3
|
-
*
|
|
4
|
-
* Content API returns HTTP 409 with "conflict" or "already exists" in the message.
|
|
5
|
-
*/ export function isDuplicateKeyError(error) {
|
|
6
|
-
if (!error || typeof error !== 'object') {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
const err = error;
|
|
10
|
-
const message = typeof err.message === 'string' ? err.message : '';
|
|
11
|
-
return message.includes('409') || message.toLowerCase().includes('conflict') || message.toLowerCase().includes('already exists');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=isDuplicateKeyError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/oauth/utilities/isDuplicateKeyError.ts"],"sourcesContent":["/**\n * Check if an error is a duplicate key/unique constraint violation from Content API.\n *\n * Content API returns HTTP 409 with \"conflict\" or \"already exists\" in the message.\n */\nexport function isDuplicateKeyError(error: unknown): boolean {\n if (!error || typeof error !== 'object') {\n return false\n }\n\n const err = error as { message?: unknown }\n const message = typeof err.message === 'string' ? err.message : ''\n\n return (\n message.includes('409') ||\n message.toLowerCase().includes('conflict') ||\n message.toLowerCase().includes('already exists')\n )\n}\n"],"names":["isDuplicateKeyError","error","err","message","includes","toLowerCase"],"mappings":"AAAA;;;;CAIC,GACD,OAAO,SAASA,oBAAoBC,KAAc;IAChD,IAAI,CAACA,SAAS,OAAOA,UAAU,UAAU;QACvC,OAAO;IACT;IAEA,MAAMC,MAAMD;IACZ,MAAME,UAAU,OAAOD,IAAIC,OAAO,KAAK,WAAWD,IAAIC,OAAO,GAAG;IAEhE,OACEA,QAAQC,QAAQ,CAAC,UACjBD,QAAQE,WAAW,GAAGD,QAAQ,CAAC,eAC/BD,QAAQE,WAAW,GAAGD,QAAQ,CAAC;AAEnC"}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Upload API types extracted from Content API OpenAPI spec.
|
|
3
|
-
* These are kept separate to avoid breaking changes when the main spec is regenerated.
|
|
4
|
-
*/
|
|
5
|
-
export type UploadPaths = {
|
|
6
|
-
'/api/v0/uploads/{collectionId}/{filename}': {
|
|
7
|
-
delete: {
|
|
8
|
-
parameters: {
|
|
9
|
-
path: {
|
|
10
|
-
collectionId: string;
|
|
11
|
-
filename: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
responses: {
|
|
15
|
-
200: {
|
|
16
|
-
content: {
|
|
17
|
-
'application/json': {
|
|
18
|
-
success: true;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
'/api/v0/uploads/download/sign': {
|
|
26
|
-
post: {
|
|
27
|
-
requestBody: {
|
|
28
|
-
content: {
|
|
29
|
-
'application/json': {
|
|
30
|
-
collectionId: string;
|
|
31
|
-
expiresIn: number;
|
|
32
|
-
filename: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
responses: {
|
|
37
|
-
200: {
|
|
38
|
-
content: {
|
|
39
|
-
'application/json': {
|
|
40
|
-
url: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
'/api/v0/uploads/multipart/abort': {
|
|
48
|
-
post: {
|
|
49
|
-
requestBody: {
|
|
50
|
-
content: {
|
|
51
|
-
'application/json': {
|
|
52
|
-
collectionId: string;
|
|
53
|
-
filename: string;
|
|
54
|
-
uploadId: string;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
responses: {
|
|
59
|
-
200: {
|
|
60
|
-
content: {
|
|
61
|
-
'application/json': {
|
|
62
|
-
success: true;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
'/api/v0/uploads/multipart/complete': {
|
|
70
|
-
post: {
|
|
71
|
-
requestBody: {
|
|
72
|
-
content: {
|
|
73
|
-
'application/json': {
|
|
74
|
-
collectionId: string;
|
|
75
|
-
filename: string;
|
|
76
|
-
parts: Array<{
|
|
77
|
-
ETag: string;
|
|
78
|
-
PartNumber: number;
|
|
79
|
-
}>;
|
|
80
|
-
uploadId: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
responses: {
|
|
85
|
-
200: {
|
|
86
|
-
content: {
|
|
87
|
-
'application/json': {
|
|
88
|
-
success: true;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
'/api/v0/uploads/multipart/initiate': {
|
|
96
|
-
post: {
|
|
97
|
-
requestBody: {
|
|
98
|
-
content: {
|
|
99
|
-
'application/json': {
|
|
100
|
-
collectionId: string;
|
|
101
|
-
contentType: string;
|
|
102
|
-
filename: string;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
responses: {
|
|
107
|
-
200: {
|
|
108
|
-
content: {
|
|
109
|
-
'application/json': {
|
|
110
|
-
uploadId: string;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
'/api/v0/uploads/multipart/parts': {
|
|
118
|
-
post: {
|
|
119
|
-
requestBody: {
|
|
120
|
-
content: {
|
|
121
|
-
'application/json': {
|
|
122
|
-
collectionId: string;
|
|
123
|
-
expiresIn: number;
|
|
124
|
-
filename: string;
|
|
125
|
-
partNumbers: number[];
|
|
126
|
-
uploadId: string;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
responses: {
|
|
131
|
-
200: {
|
|
132
|
-
content: {
|
|
133
|
-
'application/json': {
|
|
134
|
-
parts: Array<{
|
|
135
|
-
partNumber: number;
|
|
136
|
-
url: string;
|
|
137
|
-
}>;
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
'/api/v0/uploads/sign': {
|
|
145
|
-
post: {
|
|
146
|
-
requestBody: {
|
|
147
|
-
content: {
|
|
148
|
-
'application/json': {
|
|
149
|
-
collectionId: string;
|
|
150
|
-
contentType?: string;
|
|
151
|
-
expiresIn: number;
|
|
152
|
-
filename: string;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
responses: {
|
|
157
|
-
200: {
|
|
158
|
-
content: {
|
|
159
|
-
'application/json': {
|
|
160
|
-
url: string;
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
//# sourceMappingURL=api-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-types.d.ts","sourceRoot":"","sources":["../../src/storage-content-api/api-types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/storage-content-api/api-types.ts"],"sourcesContent":["/**\n * Upload API types extracted from Content API OpenAPI spec.\n * These are kept separate to avoid breaking changes when the main spec is regenerated.\n */\n\nexport type UploadPaths = {\n '/api/v0/uploads/{collectionId}/{filename}': {\n delete: {\n parameters: {\n path: {\n collectionId: string\n filename: string\n }\n }\n responses: {\n 200: {\n content: {\n 'application/json': { success: true }\n }\n }\n }\n }\n }\n '/api/v0/uploads/download/sign': {\n post: {\n requestBody: {\n content: {\n 'application/json': {\n collectionId: string\n expiresIn: number\n filename: string\n }\n }\n }\n responses: {\n 200: {\n content: {\n 'application/json': { url: string }\n }\n }\n }\n }\n }\n '/api/v0/uploads/multipart/abort': {\n post: {\n requestBody: {\n content: {\n 'application/json': {\n collectionId: string\n filename: string\n uploadId: string\n }\n }\n }\n responses: {\n 200: {\n content: {\n 'application/json': { success: true }\n }\n }\n }\n }\n }\n '/api/v0/uploads/multipart/complete': {\n post: {\n requestBody: {\n content: {\n 'application/json': {\n collectionId: string\n filename: string\n parts: Array<{ ETag: string; PartNumber: number }>\n uploadId: string\n }\n }\n }\n responses: {\n 200: {\n content: {\n 'application/json': { success: true }\n }\n }\n }\n }\n }\n '/api/v0/uploads/multipart/initiate': {\n post: {\n requestBody: {\n content: {\n 'application/json': {\n collectionId: string\n contentType: string\n filename: string\n }\n }\n }\n responses: {\n 200: {\n content: {\n 'application/json': { uploadId: string }\n }\n }\n }\n }\n }\n '/api/v0/uploads/multipart/parts': {\n post: {\n requestBody: {\n content: {\n 'application/json': {\n collectionId: string\n expiresIn: number\n filename: string\n partNumbers: number[]\n uploadId: string\n }\n }\n }\n responses: {\n 200: {\n content: {\n 'application/json': {\n parts: Array<{ partNumber: number; url: string }>\n }\n }\n }\n }\n }\n }\n '/api/v0/uploads/sign': {\n post: {\n requestBody: {\n content: {\n 'application/json': {\n collectionId: string\n contentType?: string\n expiresIn: number\n filename: string\n }\n }\n }\n responses: {\n 200: {\n content: {\n 'application/json': { url: string }\n }\n }\n }\n }\n }\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAED,WAgJC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const ContentApiClientUploadHandler: ({ children, collectionSlug, enabled, extra, prefix, serverHandlerPath, }: {
|
|
2
|
-
children: import("react").ReactNode;
|
|
3
|
-
collectionSlug: import("payload").UploadCollectionSlug;
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
extra: Record<string, unknown>;
|
|
6
|
-
prefix?: string;
|
|
7
|
-
serverHandlerPath: `/${string}`;
|
|
8
|
-
}) => import("react").JSX.Element;
|
|
9
|
-
//# sourceMappingURL=ClientUploadHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClientUploadHandler.d.ts","sourceRoot":"","sources":["../../../src/storage-content-api/client-uploads/ClientUploadHandler.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,6BAA6B;;;;;;;aAoBf,OAAO,aAiBhC,CAAA"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { createClientUploadHandler } from '@payloadcms/plugin-cloud-storage/client';
|
|
3
|
-
export const ContentApiClientUploadHandler = createClientUploadHandler({
|
|
4
|
-
handler: async ({ apiRoute, collectionSlug, file, prefix, serverHandlerPath, serverURL })=>{
|
|
5
|
-
// Build endpoint URL: serverURL + apiRoute + serverHandlerPath
|
|
6
|
-
const endpointRoute = `${serverURL}${apiRoute}${serverHandlerPath}`;
|
|
7
|
-
const response = await fetch(endpointRoute, {
|
|
8
|
-
body: JSON.stringify({
|
|
9
|
-
collectionSlug,
|
|
10
|
-
filename: file.name,
|
|
11
|
-
mimeType: file.type
|
|
12
|
-
}),
|
|
13
|
-
credentials: 'include',
|
|
14
|
-
headers: {
|
|
15
|
-
'Content-Type': 'application/json'
|
|
16
|
-
},
|
|
17
|
-
method: 'POST'
|
|
18
|
-
});
|
|
19
|
-
if (!response.ok) {
|
|
20
|
-
throw new Error(`Failed to get presigned URL: ${response.status} ${response.statusText}`);
|
|
21
|
-
}
|
|
22
|
-
const { url } = await response.json();
|
|
23
|
-
const uploadResponse = await fetch(url, {
|
|
24
|
-
body: file,
|
|
25
|
-
headers: {
|
|
26
|
-
'Content-Type': file.type
|
|
27
|
-
},
|
|
28
|
-
method: 'PUT'
|
|
29
|
-
});
|
|
30
|
-
if (!uploadResponse.ok) {
|
|
31
|
-
throw new Error(`Failed to upload to S3: ${uploadResponse.status} ${uploadResponse.statusText}`);
|
|
32
|
-
}
|
|
33
|
-
// Include original filename so handleUpload can distinguish from resized versions
|
|
34
|
-
return {
|
|
35
|
-
clientUploaded: true,
|
|
36
|
-
filename: file.name,
|
|
37
|
-
prefix
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=ClientUploadHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/storage-content-api/client-uploads/ClientUploadHandler.tsx"],"sourcesContent":["'use client'\nimport { createClientUploadHandler } from '@payloadcms/plugin-cloud-storage/client'\n\nexport const ContentApiClientUploadHandler = createClientUploadHandler({\n handler: async ({ apiRoute, collectionSlug, file, prefix, serverHandlerPath, serverURL }) => {\n // Build endpoint URL: serverURL + apiRoute + serverHandlerPath\n const endpointRoute = `${serverURL}${apiRoute}${serverHandlerPath}`\n\n const response = await fetch(endpointRoute, {\n body: JSON.stringify({\n collectionSlug,\n filename: file.name,\n mimeType: file.type,\n }),\n credentials: 'include',\n headers: { 'Content-Type': 'application/json' },\n method: 'POST',\n })\n\n if (!response.ok) {\n throw new Error(`Failed to get presigned URL: ${response.status} ${response.statusText}`)\n }\n\n const { url } = (await response.json()) as { url: string }\n\n const uploadResponse = await fetch(url, {\n body: file,\n headers: { 'Content-Type': file.type },\n method: 'PUT',\n })\n\n if (!uploadResponse.ok) {\n throw new Error(\n `Failed to upload to S3: ${uploadResponse.status} ${uploadResponse.statusText}`,\n )\n }\n\n // Include original filename so handleUpload can distinguish from resized versions\n return { clientUploaded: true, filename: file.name, prefix }\n },\n})\n"],"names":["createClientUploadHandler","ContentApiClientUploadHandler","handler","apiRoute","collectionSlug","file","prefix","serverHandlerPath","serverURL","endpointRoute","response","fetch","body","JSON","stringify","filename","name","mimeType","type","credentials","headers","method","ok","Error","status","statusText","url","json","uploadResponse","clientUploaded"],"mappings":"AAAA;AACA,SAASA,yBAAyB,QAAQ,0CAAyC;AAEnF,OAAO,MAAMC,gCAAgCD,0BAA0B;IACrEE,SAAS,OAAO,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,IAAI,EAAEC,MAAM,EAAEC,iBAAiB,EAAEC,SAAS,EAAE;QACtF,+DAA+D;QAC/D,MAAMC,gBAAgB,GAAGD,YAAYL,WAAWI,mBAAmB;QAEnE,MAAMG,WAAW,MAAMC,MAAMF,eAAe;YAC1CG,MAAMC,KAAKC,SAAS,CAAC;gBACnBV;gBACAW,UAAUV,KAAKW,IAAI;gBACnBC,UAAUZ,KAAKa,IAAI;YACrB;YACAC,aAAa;YACbC,SAAS;gBAAE,gBAAgB;YAAmB;YAC9CC,QAAQ;QACV;QAEA,IAAI,CAACX,SAASY,EAAE,EAAE;YAChB,MAAM,IAAIC,MAAM,CAAC,6BAA6B,EAAEb,SAASc,MAAM,CAAC,CAAC,EAAEd,SAASe,UAAU,EAAE;QAC1F;QAEA,MAAM,EAAEC,GAAG,EAAE,GAAI,MAAMhB,SAASiB,IAAI;QAEpC,MAAMC,iBAAiB,MAAMjB,MAAMe,KAAK;YACtCd,MAAMP;YACNe,SAAS;gBAAE,gBAAgBf,KAAKa,IAAI;YAAC;YACrCG,QAAQ;QACV;QAEA,IAAI,CAACO,eAAeN,EAAE,EAAE;YACtB,MAAM,IAAIC,MACR,CAAC,wBAAwB,EAAEK,eAAeJ,MAAM,CAAC,CAAC,EAAEI,eAAeH,UAAU,EAAE;QAEnF;QAEA,kFAAkF;QAClF,OAAO;YAAEI,gBAAgB;YAAMd,UAAUV,KAAKW,IAAI;YAAEV;QAAO;IAC7D;AACF,GAAE"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { PayloadHandler } from 'payload';
|
|
2
|
-
import type { StorageClient } from '../client.js';
|
|
3
|
-
type ClientUploadsAccess = (args: {
|
|
4
|
-
collectionSlug: string;
|
|
5
|
-
req: Parameters<PayloadHandler>[0];
|
|
6
|
-
}) => boolean | Promise<boolean>;
|
|
7
|
-
type Args = {
|
|
8
|
-
access?: ClientUploadsAccess;
|
|
9
|
-
client: StorageClient;
|
|
10
|
-
};
|
|
11
|
-
export declare const getGenerateSignedURLHandler: ({ access, client, }: Args) => PayloadHandler;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=generateSignedURL.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateSignedURL.d.ts","sourceRoot":"","sources":["../../../src/storage-content-api/client-uploads/generateSignedURL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,KAAK,mBAAmB,GAAG,CAAC,IAAI,EAAE;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,GAAG,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;CACnC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAEhC,KAAK,IAAI,GAAG;IACV,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B,MAAM,EAAE,aAAa,CAAA;CACtB,CAAA;AAID,eAAO,MAAM,2BAA2B,wBAGrC,IAAI,KAAG,cA0BT,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { APIError, Forbidden } from 'payload';
|
|
2
|
-
const defaultAccess = ({ req })=>!!req.user;
|
|
3
|
-
export const getGenerateSignedURLHandler = ({ access = defaultAccess, client })=>{
|
|
4
|
-
return async (req)=>{
|
|
5
|
-
if (!req.json) {
|
|
6
|
-
throw new APIError('Content-Type expected to be application/json', 400);
|
|
7
|
-
}
|
|
8
|
-
const { collectionSlug, filename, mimeType } = await req.json();
|
|
9
|
-
if (!await access({
|
|
10
|
-
collectionSlug,
|
|
11
|
-
req
|
|
12
|
-
})) {
|
|
13
|
-
throw new Forbidden();
|
|
14
|
-
}
|
|
15
|
-
const { data, error } = await client.POST('/api/v0/uploads/sign', {
|
|
16
|
-
body: {
|
|
17
|
-
collectionId: collectionSlug,
|
|
18
|
-
contentType: mimeType,
|
|
19
|
-
expiresIn: 3600,
|
|
20
|
-
filename
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
if (error || !data) {
|
|
24
|
-
throw new APIError(`Failed to get presigned upload URL: ${JSON.stringify(error)}`);
|
|
25
|
-
}
|
|
26
|
-
return Response.json({
|
|
27
|
-
url: data.url
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=generateSignedURL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/storage-content-api/client-uploads/generateSignedURL.ts"],"sourcesContent":["import type { PayloadHandler } from 'payload'\n\nimport { APIError, Forbidden } from 'payload'\n\nimport type { StorageClient } from '../client.js'\n\ntype ClientUploadsAccess = (args: {\n collectionSlug: string\n req: Parameters<PayloadHandler>[0]\n}) => boolean | Promise<boolean>\n\ntype Args = {\n access?: ClientUploadsAccess\n client: StorageClient\n}\n\nconst defaultAccess: ClientUploadsAccess = ({ req }) => !!req.user\n\nexport const getGenerateSignedURLHandler = ({\n access = defaultAccess,\n client,\n}: Args): PayloadHandler => {\n return async (req) => {\n if (!req.json) {\n throw new APIError('Content-Type expected to be application/json', 400)\n }\n\n const { collectionSlug, filename, mimeType } = (await req.json()) as {\n collectionSlug: string\n filename: string\n mimeType: string\n }\n\n if (!(await access({ collectionSlug, req }))) {\n throw new Forbidden()\n }\n\n const { data, error } = await client.POST('/api/v0/uploads/sign', {\n body: { collectionId: collectionSlug, contentType: mimeType, expiresIn: 3600, filename },\n })\n\n if (error || !data) {\n throw new APIError(`Failed to get presigned upload URL: ${JSON.stringify(error)}`)\n }\n\n return Response.json({ url: data.url })\n }\n}\n"],"names":["APIError","Forbidden","defaultAccess","req","user","getGenerateSignedURLHandler","access","client","json","collectionSlug","filename","mimeType","data","error","POST","body","collectionId","contentType","expiresIn","JSON","stringify","Response","url"],"mappings":"AAEA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,UAAS;AAc7C,MAAMC,gBAAqC,CAAC,EAAEC,GAAG,EAAE,GAAK,CAAC,CAACA,IAAIC,IAAI;AAElE,OAAO,MAAMC,8BAA8B,CAAC,EAC1CC,SAASJ,aAAa,EACtBK,MAAM,EACD;IACL,OAAO,OAAOJ;QACZ,IAAI,CAACA,IAAIK,IAAI,EAAE;YACb,MAAM,IAAIR,SAAS,gDAAgD;QACrE;QAEA,MAAM,EAAES,cAAc,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAI,MAAMR,IAAIK,IAAI;QAM9D,IAAI,CAAE,MAAMF,OAAO;YAAEG;YAAgBN;QAAI,IAAK;YAC5C,MAAM,IAAIF;QACZ;QAEA,MAAM,EAAEW,IAAI,EAAEC,KAAK,EAAE,GAAG,MAAMN,OAAOO,IAAI,CAAC,wBAAwB;YAChEC,MAAM;gBAAEC,cAAcP;gBAAgBQ,aAAaN;gBAAUO,WAAW;gBAAMR;YAAS;QACzF;QAEA,IAAIG,SAAS,CAACD,MAAM;YAClB,MAAM,IAAIZ,SAAS,CAAC,oCAAoC,EAAEmB,KAAKC,SAAS,CAACP,QAAQ;QACnF;QAEA,OAAOQ,SAASb,IAAI,CAAC;YAAEc,KAAKV,KAAKU,GAAG;QAAC;IACvC;AACF,EAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import createClient from 'openapi-fetch';
|
|
2
|
-
import type { UploadPaths } from './api-types.js';
|
|
3
|
-
import type { StorageClientConfig } from './types.js';
|
|
4
|
-
export type StorageClient = ReturnType<typeof createClient<UploadPaths>>;
|
|
5
|
-
export declare function createStorageClient(config: StorageClientConfig): StorageClient;
|
|
6
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/storage-content-api/client.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,eAAe,CAAA;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAKrD,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,WAAW,CAAC,CAAC,CAAA;AAExE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAM9E"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import createClient from 'openapi-fetch';
|
|
2
|
-
import { getValidProjectToken } from '../auth/project-token.js';
|
|
3
|
-
import { fetchDevJwt } from '../db-content-api/utilities/auth.js';
|
|
4
|
-
export function createStorageClient(config) {
|
|
5
|
-
const client = createClient({
|
|
6
|
-
baseUrl: config.baseUrl
|
|
7
|
-
});
|
|
8
|
-
client.use(createStorageAuthMiddleware(config));
|
|
9
|
-
return client;
|
|
10
|
-
}
|
|
11
|
-
function createStorageAuthMiddleware(config) {
|
|
12
|
-
return {
|
|
13
|
-
async onRequest ({ request }) {
|
|
14
|
-
if ('contentApiKey' in config) {
|
|
15
|
-
request.headers.set('X-Api-Key', config.contentApiKey);
|
|
16
|
-
} else {
|
|
17
|
-
const { auth, contentSystemId } = config;
|
|
18
|
-
if (auth.mode === 'apiKey') {
|
|
19
|
-
request.headers.set('X-Api-Key', auth.apiKey);
|
|
20
|
-
} else if (auth.mode === 'tokenStore') {
|
|
21
|
-
const token = await getValidProjectToken(auth.tokenStore, contentSystemId);
|
|
22
|
-
if (!token) {
|
|
23
|
-
throw new Error('Authentication required. Run `npx @payloadcms/figma login` to authenticate.');
|
|
24
|
-
}
|
|
25
|
-
request.headers.set('Authorization', `Bearer ${token}`);
|
|
26
|
-
} else {
|
|
27
|
-
const token = await fetchDevJwt(config.baseUrl, contentSystemId);
|
|
28
|
-
request.headers.set('Authorization', `Bearer ${token}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return request;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/storage-content-api/client.ts"],"sourcesContent":["import type { Middleware } from 'openapi-fetch'\n\nimport createClient from 'openapi-fetch'\n\nimport type { UploadPaths } from './api-types.js'\nimport type { StorageClientConfig } from './types.js'\n\nimport { getValidProjectToken } from '../auth/project-token.js'\nimport { fetchDevJwt } from '../db-content-api/utilities/auth.js'\n\nexport type StorageClient = ReturnType<typeof createClient<UploadPaths>>\n\nexport function createStorageClient(config: StorageClientConfig): StorageClient {\n const client = createClient<UploadPaths>({ baseUrl: config.baseUrl })\n\n client.use(createStorageAuthMiddleware(config))\n\n return client\n}\n\nfunction createStorageAuthMiddleware(config: StorageClientConfig): Middleware {\n return {\n async onRequest({ request }) {\n if ('contentApiKey' in config) {\n request.headers.set('X-Api-Key', config.contentApiKey)\n } else {\n const { auth, contentSystemId } = config\n\n if (auth.mode === 'apiKey') {\n request.headers.set('X-Api-Key', auth.apiKey)\n } else if (auth.mode === 'tokenStore') {\n const token = await getValidProjectToken(auth.tokenStore, contentSystemId)\n if (!token) {\n throw new Error(\n 'Authentication required. Run `npx @payloadcms/figma login` to authenticate.',\n )\n }\n request.headers.set('Authorization', `Bearer ${token}`)\n } else {\n const token = await fetchDevJwt(config.baseUrl, contentSystemId)\n request.headers.set('Authorization', `Bearer ${token}`)\n }\n }\n return request\n },\n }\n}\n"],"names":["createClient","getValidProjectToken","fetchDevJwt","createStorageClient","config","client","baseUrl","use","createStorageAuthMiddleware","onRequest","request","headers","set","contentApiKey","auth","contentSystemId","mode","apiKey","token","tokenStore","Error"],"mappings":"AAEA,OAAOA,kBAAkB,gBAAe;AAKxC,SAASC,oBAAoB,QAAQ,2BAA0B;AAC/D,SAASC,WAAW,QAAQ,sCAAqC;AAIjE,OAAO,SAASC,oBAAoBC,MAA2B;IAC7D,MAAMC,SAASL,aAA0B;QAAEM,SAASF,OAAOE,OAAO;IAAC;IAEnED,OAAOE,GAAG,CAACC,4BAA4BJ;IAEvC,OAAOC;AACT;AAEA,SAASG,4BAA4BJ,MAA2B;IAC9D,OAAO;QACL,MAAMK,WAAU,EAAEC,OAAO,EAAE;YACzB,IAAI,mBAAmBN,QAAQ;gBAC7BM,QAAQC,OAAO,CAACC,GAAG,CAAC,aAAaR,OAAOS,aAAa;YACvD,OAAO;gBACL,MAAM,EAAEC,IAAI,EAAEC,eAAe,EAAE,GAAGX;gBAElC,IAAIU,KAAKE,IAAI,KAAK,UAAU;oBAC1BN,QAAQC,OAAO,CAACC,GAAG,CAAC,aAAaE,KAAKG,MAAM;gBAC9C,OAAO,IAAIH,KAAKE,IAAI,KAAK,cAAc;oBACrC,MAAME,QAAQ,MAAMjB,qBAAqBa,KAAKK,UAAU,EAAEJ;oBAC1D,IAAI,CAACG,OAAO;wBACV,MAAM,IAAIE,MACR;oBAEJ;oBACAV,QAAQC,OAAO,CAACC,GAAG,CAAC,iBAAiB,CAAC,OAAO,EAAEM,OAAO;gBACxD,OAAO;oBACL,MAAMA,QAAQ,MAAMhB,YAAYE,OAAOE,OAAO,EAAES;oBAChDL,QAAQC,OAAO,CAACC,GAAG,CAAC,iBAAiB,CAAC,OAAO,EAAEM,OAAO;gBACxD;YACF;YACA,OAAOR;QACT;IACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateURL.d.ts","sourceRoot":"","sources":["../../src/storage-content-api/generateURL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAIzE,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,cAAc,gBACX,IAAI,KAAG,WAKpB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
export const getGenerateURL = ({ baseUrl })=>({ collection, filename, prefix = '' })=>{
|
|
3
|
-
const collectionId = collection.slug;
|
|
4
|
-
const fileKey = path.posix.join(prefix, filename);
|
|
5
|
-
return `${baseUrl}/api/v0/uploads/download/${collectionId}/${encodeURIComponent(fileKey)}`;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=generateURL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/storage-content-api/generateURL.ts"],"sourcesContent":["import type { GenerateURL } from '@payloadcms/plugin-cloud-storage/types'\n\nimport path from 'path'\n\ntype Args = {\n baseUrl: string\n}\n\nexport const getGenerateURL =\n ({ baseUrl }: Args): GenerateURL =>\n ({ collection, filename, prefix = '' }) => {\n const collectionId = collection.slug\n const fileKey = path.posix.join(prefix, filename)\n return `${baseUrl}/api/v0/uploads/download/${collectionId}/${encodeURIComponent(fileKey)}`\n }\n"],"names":["path","getGenerateURL","baseUrl","collection","filename","prefix","collectionId","slug","fileKey","posix","join","encodeURIComponent"],"mappings":"AAEA,OAAOA,UAAU,OAAM;AAMvB,OAAO,MAAMC,iBACX,CAAC,EAAEC,OAAO,EAAQ,GAClB,CAAC,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,SAAS,EAAE,EAAE;QACpC,MAAMC,eAAeH,WAAWI,IAAI;QACpC,MAAMC,UAAUR,KAAKS,KAAK,CAACC,IAAI,CAACL,QAAQD;QACxC,OAAO,GAAGF,QAAQ,yBAAyB,EAAEI,aAAa,CAAC,EAAEK,mBAAmBH,UAAU;IAC5F,EAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { HandleDelete } from '@payloadcms/plugin-cloud-storage/types';
|
|
2
|
-
import type { StorageClient } from './client.js';
|
|
3
|
-
type Args = {
|
|
4
|
-
client: StorageClient;
|
|
5
|
-
};
|
|
6
|
-
export declare const getHandleDelete: ({ client }: Args) => HandleDelete;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=handleDelete.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleDelete.d.ts","sourceRoot":"","sources":["../../src/storage-content-api/handleDelete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAI1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,aAAa,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,eAAe,eAAgB,IAAI,KAAG,YAUlD,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
export const getHandleDelete = ({ client })=>{
|
|
3
|
-
return async ({ collection, doc: { prefix = '' }, filename })=>{
|
|
4
|
-
const collectionId = collection.slug;
|
|
5
|
-
const fileKey = path.posix.join(prefix, filename);
|
|
6
|
-
await client.DELETE('/api/v0/uploads/{collectionId}/{filename}', {
|
|
7
|
-
params: {
|
|
8
|
-
path: {
|
|
9
|
-
collectionId,
|
|
10
|
-
filename: fileKey
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=handleDelete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/storage-content-api/handleDelete.ts"],"sourcesContent":["import type { HandleDelete } from '@payloadcms/plugin-cloud-storage/types'\n\nimport path from 'path'\n\nimport type { StorageClient } from './client.js'\n\ntype Args = {\n client: StorageClient\n}\n\nexport const getHandleDelete = ({ client }: Args): HandleDelete => {\n return async ({ collection, doc: { prefix = '' }, filename }) => {\n const collectionId = collection.slug\n const fileKey = path.posix.join(prefix, filename)\n await client.DELETE('/api/v0/uploads/{collectionId}/{filename}', {\n params: {\n path: { collectionId, filename: fileKey },\n },\n })\n }\n}\n"],"names":["path","getHandleDelete","client","collection","doc","prefix","filename","collectionId","slug","fileKey","posix","join","DELETE","params"],"mappings":"AAEA,OAAOA,UAAU,OAAM;AAQvB,OAAO,MAAMC,kBAAkB,CAAC,EAAEC,MAAM,EAAQ;IAC9C,OAAO,OAAO,EAAEC,UAAU,EAAEC,KAAK,EAAEC,SAAS,EAAE,EAAE,EAAEC,QAAQ,EAAE;QAC1D,MAAMC,eAAeJ,WAAWK,IAAI;QACpC,MAAMC,UAAUT,KAAKU,KAAK,CAACC,IAAI,CAACN,QAAQC;QACxC,MAAMJ,OAAOU,MAAM,CAAC,6CAA6C;YAC/DC,QAAQ;gBACNb,MAAM;oBAAEO;oBAAcD,UAAUG;gBAAQ;YAC1C;QACF;IACF;AACF,EAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { HandleUpload } from '@payloadcms/plugin-cloud-storage/types';
|
|
2
|
-
import type { CollectionConfig } from 'payload';
|
|
3
|
-
import type { StorageClient } from './client.js';
|
|
4
|
-
type Args = {
|
|
5
|
-
client: StorageClient;
|
|
6
|
-
collection: CollectionConfig;
|
|
7
|
-
prefix?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const getHandleUpload: ({ client, collection, prefix }: Args) => HandleUpload;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=handleUpload.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleUpload.d.ts","sourceRoot":"","sources":["../../src/storage-content-api/handleUpload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAK/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,aAAa,CAAA;IACrB,UAAU,EAAE,gBAAgB,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAKD,eAAO,MAAM,eAAe,mCAAyC,IAAI,KAAG,YAoC3E,CAAA"}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
const PART_SIZE = 64 * 1024 * 1024 // 64MB per part
|
|
4
|
-
;
|
|
5
|
-
const MAX_FILE_SIZE_BEFORE_MULTIPART = 100 * 1024 * 1024 // 100MB
|
|
6
|
-
;
|
|
7
|
-
export const getHandleUpload = ({ client, collection, prefix = '' })=>{
|
|
8
|
-
return async ({ clientUploadContext, data, file })=>{
|
|
9
|
-
// Skip if client already uploaded THIS SPECIFIC file
|
|
10
|
-
// clientUploadContext.filename contains the original filename that was client-uploaded
|
|
11
|
-
// Resized versions (different filename) should still be uploaded
|
|
12
|
-
const clientUploadedFilename = clientUploadContext && typeof clientUploadContext === 'object' && 'filename' in clientUploadContext ? clientUploadContext.filename : undefined;
|
|
13
|
-
const isOriginalClientUploaded = clientUploadContext && typeof clientUploadContext === 'object' && 'clientUploaded' in clientUploadContext && clientUploadContext.clientUploaded && file.filename === clientUploadedFilename;
|
|
14
|
-
if (isOriginalClientUploaded) {
|
|
15
|
-
return data;
|
|
16
|
-
}
|
|
17
|
-
const collectionId = collection.slug;
|
|
18
|
-
const fileKey = path.posix.join(data.prefix || prefix, file.filename);
|
|
19
|
-
const fileData = file.tempFilePath ? fs.readFileSync(file.tempFilePath) : file.buffer;
|
|
20
|
-
const fileSize = file.filesize || fileData.length;
|
|
21
|
-
if (fileSize > MAX_FILE_SIZE_BEFORE_MULTIPART) {
|
|
22
|
-
await uploadMultipart({
|
|
23
|
-
client,
|
|
24
|
-
collectionId,
|
|
25
|
-
fileData,
|
|
26
|
-
fileKey,
|
|
27
|
-
mimeType: file.mimeType
|
|
28
|
-
});
|
|
29
|
-
} else {
|
|
30
|
-
await uploadSingleFile({
|
|
31
|
-
client,
|
|
32
|
-
collectionId,
|
|
33
|
-
fileData,
|
|
34
|
-
fileKey,
|
|
35
|
-
mimeType: file.mimeType
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
async function uploadSingleFile({ client, collectionId, fileData, fileKey, mimeType }) {
|
|
42
|
-
const { data, error } = await client.POST('/api/v0/uploads/sign', {
|
|
43
|
-
body: {
|
|
44
|
-
collectionId,
|
|
45
|
-
contentType: mimeType,
|
|
46
|
-
expiresIn: 3600,
|
|
47
|
-
filename: fileKey
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
if (error || !data) {
|
|
51
|
-
throw new Error(`Failed to get presigned upload URL: ${JSON.stringify(error)}`);
|
|
52
|
-
}
|
|
53
|
-
const uploadResponse = await fetch(data.url, {
|
|
54
|
-
body: fileData,
|
|
55
|
-
headers: {
|
|
56
|
-
'Content-Type': mimeType
|
|
57
|
-
},
|
|
58
|
-
method: 'PUT'
|
|
59
|
-
});
|
|
60
|
-
if (!uploadResponse.ok) {
|
|
61
|
-
throw new Error(`Failed to upload to S3: ${uploadResponse.status} ${uploadResponse.statusText}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
async function uploadMultipart({ client, collectionId, fileData, fileKey, mimeType }) {
|
|
65
|
-
const { data: initiateData, error: initiateError } = await client.POST('/api/v0/uploads/multipart/initiate', {
|
|
66
|
-
body: {
|
|
67
|
-
collectionId,
|
|
68
|
-
contentType: mimeType,
|
|
69
|
-
filename: fileKey
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
if (initiateError || !initiateData) {
|
|
73
|
-
throw new Error(`Failed to initiate multipart upload: ${JSON.stringify(initiateError)}`);
|
|
74
|
-
}
|
|
75
|
-
const { uploadId } = initiateData;
|
|
76
|
-
try {
|
|
77
|
-
const numParts = Math.ceil(fileData.length / PART_SIZE);
|
|
78
|
-
const partNumbers = Array.from({
|
|
79
|
-
length: numParts
|
|
80
|
-
}, (_, i)=>i + 1);
|
|
81
|
-
const { data: partsData, error: partsError } = await client.POST('/api/v0/uploads/multipart/parts', {
|
|
82
|
-
body: {
|
|
83
|
-
collectionId,
|
|
84
|
-
expiresIn: 3600,
|
|
85
|
-
filename: fileKey,
|
|
86
|
-
partNumbers,
|
|
87
|
-
uploadId
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
if (partsError || !partsData) {
|
|
91
|
-
throw new Error(`Failed to get part URLs: ${JSON.stringify(partsError)}`);
|
|
92
|
-
}
|
|
93
|
-
const { parts } = partsData;
|
|
94
|
-
if (!parts || !Array.isArray(parts)) {
|
|
95
|
-
throw new Error('Invalid response from part URLs endpoint: parts is not an array');
|
|
96
|
-
}
|
|
97
|
-
const uploadedParts = await Promise.all(parts.map(async ({ partNumber, url })=>{
|
|
98
|
-
const start = (partNumber - 1) * PART_SIZE;
|
|
99
|
-
const end = Math.min(start + PART_SIZE, fileData.length);
|
|
100
|
-
const partData = fileData.slice(start, end);
|
|
101
|
-
const uploadResponse = await fetch(url, {
|
|
102
|
-
body: partData,
|
|
103
|
-
headers: {
|
|
104
|
-
'Content-Type': mimeType
|
|
105
|
-
},
|
|
106
|
-
method: 'PUT'
|
|
107
|
-
});
|
|
108
|
-
const etag = uploadResponse.headers.get('ETag');
|
|
109
|
-
if (!etag) {
|
|
110
|
-
throw new Error(`No ETag returned for part ${partNumber}`);
|
|
111
|
-
}
|
|
112
|
-
return {
|
|
113
|
-
ETag: etag,
|
|
114
|
-
PartNumber: partNumber
|
|
115
|
-
};
|
|
116
|
-
}));
|
|
117
|
-
const { error: completeError } = await client.POST('/api/v0/uploads/multipart/complete', {
|
|
118
|
-
body: {
|
|
119
|
-
collectionId,
|
|
120
|
-
filename: fileKey,
|
|
121
|
-
parts: uploadedParts,
|
|
122
|
-
uploadId
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
if (completeError) {
|
|
126
|
-
throw new Error(`Failed to complete multipart upload: ${JSON.stringify(completeError)}`);
|
|
127
|
-
}
|
|
128
|
-
} catch (error) {
|
|
129
|
-
try {
|
|
130
|
-
await client.POST('/api/v0/uploads/multipart/abort', {
|
|
131
|
-
body: {
|
|
132
|
-
collectionId,
|
|
133
|
-
filename: fileKey,
|
|
134
|
-
uploadId
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
} catch {
|
|
138
|
-
// Ignore abort errors
|
|
139
|
-
}
|
|
140
|
-
throw error;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
//# sourceMappingURL=handleUpload.js.map
|