@payloadcms/storage-azure 4.0.0-internal.f15737c → 4.0.0-internal.f2a04f7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EAEpB,MAAM,wCAAwC,CAAA;AAS/C,UAAU,sBAAsB;IAC9B,oBAAoB,EAAE,OAAO,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,aAAa,EAAE,MAAM,CAAA;IACrB,0BAA0B,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACtD,gBAAgB,EAAE,MAAM,eAAe,CAAA;IACvC,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,oBAAoB,EACpB,OAAO,EACP,aAAa,EACb,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,EAChB,oBAA4B,GAC7B,EAAE,sBAAsB,GAAG,OAAO,CAgElC"}
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EAGpB,MAAM,wCAAwC,CAAA;AAU/C,UAAU,sBAAsB;IAC9B,oBAAoB,EAAE,OAAO,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,aAAa,EAAE,MAAM,CAAA;IACrB,0BAA0B,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACtD,gBAAgB,EAAE,MAAM,eAAe,CAAA;IACvC,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,oBAAoB,EACpB,OAAO,EACP,aAAa,EACb,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,EAChB,oBAA4B,GAC7B,EAAE,sBAAsB,GAAG,OAAO,CAmElC"}
package/dist/adapter.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { copyAzureFile } from './copyFile.js';
1
2
  import { deleteFile } from './deleteFile.js';
2
3
  import { generateUploadInstructions } from './generateUploadInstructions.js';
3
4
  import { generateURL } from './generateURL.js';
@@ -5,8 +6,20 @@ import { getFile } from './getFile.js';
5
6
  import { isClientUploadAllowed } from './isClientUploadAllowed.js';
6
7
  import { uploadFile } from './uploadFile.js';
7
8
  export function createAzureAdapter({ allowContainerCreate, baseURL, clientUploads, containerName, createContainerIfNotExists, getStorageClient, useCompositePrefixes = false }) {
9
+ const deleteStoredFile = ({ storageFilePath })=>deleteFile({
10
+ client: getStorageClient(),
11
+ storageFilePath
12
+ });
8
13
  return ({ collection, prefix = '' })=>({
9
14
  name: 'azure',
15
+ supportsTempFiles: true,
16
+ copyFile: ({ from, req, to })=>copyAzureFile({
17
+ client: getStorageClient(),
18
+ from,
19
+ req,
20
+ to
21
+ }),
22
+ deleteFile: deleteStoredFile,
10
23
  generateURL: ({ filename, prefix: urlPrefix = '' })=>generateURL({
11
24
  baseURL,
12
25
  collectionPrefix: prefix,
@@ -30,10 +43,7 @@ export function createAzureAdapter({ allowContainerCreate, baseURL, clientUpload
30
43
  requiresUploadReceipt: true,
31
44
  useInAdmin: true
32
45
  },
33
- handleDelete: ({ storageFilePath })=>deleteFile({
34
- client: getStorageClient(),
35
- storageFilePath
36
- }),
46
+ handleDelete: deleteStoredFile,
37
47
  handleUpload: async ({ data, file, storageFilePath })=>{
38
48
  await uploadFile({
39
49
  buffer: file.buffer,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/adapter.ts"],"sourcesContent":["import type { ContainerClient } from '@azure/storage-blob'\nimport type {\n Adapter,\n ClientUploadsConfig,\n GeneratedAdapter,\n} from '@payloadcms/plugin-cloud-storage/types'\n\nimport { deleteFile } from './deleteFile.js'\nimport { generateUploadInstructions } from './generateUploadInstructions.js'\nimport { generateURL } from './generateURL.js'\nimport { getFile } from './getFile.js'\nimport { isClientUploadAllowed } from './isClientUploadAllowed.js'\nimport { uploadFile } from './uploadFile.js'\n\ninterface CreateAzureAdapterArgs {\n allowContainerCreate: boolean\n baseURL: string\n clientUploads?: ClientUploadsConfig\n containerName: string\n createContainerIfNotExists: () => Promise<void> | void\n getStorageClient: () => ContainerClient\n useCompositePrefixes?: boolean\n}\n\nexport function createAzureAdapter({\n allowContainerCreate,\n baseURL,\n clientUploads,\n containerName,\n createContainerIfNotExists,\n getStorageClient,\n useCompositePrefixes = false,\n}: CreateAzureAdapterArgs): Adapter {\n return ({ collection, prefix = '' }): GeneratedAdapter => ({\n name: 'azure',\n\n generateURL: ({ filename, prefix: urlPrefix = '' }) =>\n generateURL({\n baseURL,\n collectionPrefix: prefix,\n containerName,\n filename,\n prefix: urlPrefix,\n useCompositePrefixes,\n }),\n\n uploadInstructions: {\n adminHandler: {\n path: '@payloadcms/storage-azure/client#AzureClientUploadHandler',\n },\n enabled: Boolean(clientUploads) && isClientUploadAllowed(collection),\n generate: generateUploadInstructions({\n access: typeof clientUploads === 'object' ? clientUploads.access : undefined,\n collectionPrefix: prefix,\n containerName,\n getStorageClient,\n useCompositePrefixes,\n }),\n requiresUploadReceipt: true,\n useInAdmin: true,\n },\n\n handleDelete: ({ storageFilePath }) =>\n deleteFile({\n client: getStorageClient(),\n storageFilePath,\n }),\n\n handleUpload: async ({ data, file, storageFilePath }) => {\n await uploadFile({\n buffer: file.buffer,\n client: getStorageClient(),\n mimeType: file.mimeType,\n storageFilePath,\n tempFilePath: file.tempFilePath,\n })\n\n return data\n },\n\n staticHandler: (req, { doc, headers, params: { filename, operation, uploadReference } }) =>\n getFile({\n client: getStorageClient(),\n collection,\n collectionPrefix: prefix,\n doc,\n filename,\n incomingHeaders: headers,\n operation,\n req,\n uploadReference,\n useCompositePrefixes,\n }),\n\n ...(allowContainerCreate && { onInit: createContainerIfNotExists }),\n })\n}\n"],"names":["deleteFile","generateUploadInstructions","generateURL","getFile","isClientUploadAllowed","uploadFile","createAzureAdapter","allowContainerCreate","baseURL","clientUploads","containerName","createContainerIfNotExists","getStorageClient","useCompositePrefixes","collection","prefix","name","filename","urlPrefix","collectionPrefix","uploadInstructions","adminHandler","path","enabled","Boolean","generate","access","undefined","requiresUploadReceipt","useInAdmin","handleDelete","storageFilePath","client","handleUpload","data","file","buffer","mimeType","tempFilePath","staticHandler","req","doc","headers","params","operation","uploadReference","incomingHeaders","onInit"],"mappings":"AAOA,SAASA,UAAU,QAAQ,kBAAiB;AAC5C,SAASC,0BAA0B,QAAQ,kCAAiC;AAC5E,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,OAAO,QAAQ,eAAc;AACtC,SAASC,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,UAAU,QAAQ,kBAAiB;AAY5C,OAAO,SAASC,mBAAmB,EACjCC,oBAAoB,EACpBC,OAAO,EACPC,aAAa,EACbC,aAAa,EACbC,0BAA0B,EAC1BC,gBAAgB,EAChBC,uBAAuB,KAAK,EACL;IACvB,OAAO,CAAC,EAAEC,UAAU,EAAEC,SAAS,EAAE,EAAE,GAAwB,CAAA;YACzDC,MAAM;YAENd,aAAa,CAAC,EAAEe,QAAQ,EAAEF,QAAQG,YAAY,EAAE,EAAE,GAChDhB,YAAY;oBACVM;oBACAW,kBAAkBJ;oBAClBL;oBACAO;oBACAF,QAAQG;oBACRL;gBACF;YAEFO,oBAAoB;gBAClBC,cAAc;oBACZC,MAAM;gBACR;gBACAC,SAASC,QAAQf,kBAAkBL,sBAAsBU;gBACzDW,UAAUxB,2BAA2B;oBACnCyB,QAAQ,OAAOjB,kBAAkB,WAAWA,cAAciB,MAAM,GAAGC;oBACnER,kBAAkBJ;oBAClBL;oBACAE;oBACAC;gBACF;gBACAe,uBAAuB;gBACvBC,YAAY;YACd;YAEAC,cAAc,CAAC,EAAEC,eAAe,EAAE,GAChC/B,WAAW;oBACTgC,QAAQpB;oBACRmB;gBACF;YAEFE,cAAc,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEJ,eAAe,EAAE;gBAClD,MAAM1B,WAAW;oBACf+B,QAAQD,KAAKC,MAAM;oBACnBJ,QAAQpB;oBACRyB,UAAUF,KAAKE,QAAQ;oBACvBN;oBACAO,cAAcH,KAAKG,YAAY;gBACjC;gBAEA,OAAOJ;YACT;YAEAK,eAAe,CAACC,KAAK,EAAEC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAE1B,QAAQ,EAAE2B,SAAS,EAAEC,eAAe,EAAE,EAAE,GACrF1C,QAAQ;oBACN6B,QAAQpB;oBACRE;oBACAK,kBAAkBJ;oBAClB0B;oBACAxB;oBACA6B,iBAAiBJ;oBACjBE;oBACAJ;oBACAK;oBACAhC;gBACF;YAEF,GAAIN,wBAAwB;gBAAEwC,QAAQpC;YAA2B,CAAC;QACpE,CAAA;AACF"}
1
+ {"version":3,"sources":["../src/adapter.ts"],"sourcesContent":["import type { ContainerClient } from '@azure/storage-blob'\nimport type {\n Adapter,\n ClientUploadsConfig,\n DeleteFile,\n GeneratedAdapter,\n} from '@payloadcms/plugin-cloud-storage/types'\n\nimport { copyAzureFile } from './copyFile.js'\nimport { deleteFile } from './deleteFile.js'\nimport { generateUploadInstructions } from './generateUploadInstructions.js'\nimport { generateURL } from './generateURL.js'\nimport { getFile } from './getFile.js'\nimport { isClientUploadAllowed } from './isClientUploadAllowed.js'\nimport { uploadFile } from './uploadFile.js'\n\ninterface CreateAzureAdapterArgs {\n allowContainerCreate: boolean\n baseURL: string\n clientUploads?: ClientUploadsConfig\n containerName: string\n createContainerIfNotExists: () => Promise<void> | void\n getStorageClient: () => ContainerClient\n useCompositePrefixes?: boolean\n}\n\nexport function createAzureAdapter({\n allowContainerCreate,\n baseURL,\n clientUploads,\n containerName,\n createContainerIfNotExists,\n getStorageClient,\n useCompositePrefixes = false,\n}: CreateAzureAdapterArgs): Adapter {\n const deleteStoredFile: DeleteFile = ({ storageFilePath }) =>\n deleteFile({ client: getStorageClient(), storageFilePath })\n\n return ({ collection, prefix = '' }): GeneratedAdapter => ({\n name: 'azure',\n supportsTempFiles: true,\n\n copyFile: ({ from, req, to }) => copyAzureFile({ client: getStorageClient(), from, req, to }),\n deleteFile: deleteStoredFile,\n\n generateURL: ({ filename, prefix: urlPrefix = '' }) =>\n generateURL({\n baseURL,\n collectionPrefix: prefix,\n containerName,\n filename,\n prefix: urlPrefix,\n useCompositePrefixes,\n }),\n\n uploadInstructions: {\n adminHandler: {\n path: '@payloadcms/storage-azure/client#AzureClientUploadHandler',\n },\n enabled: Boolean(clientUploads) && isClientUploadAllowed(collection),\n generate: generateUploadInstructions({\n access: typeof clientUploads === 'object' ? clientUploads.access : undefined,\n collectionPrefix: prefix,\n containerName,\n getStorageClient,\n useCompositePrefixes,\n }),\n requiresUploadReceipt: true,\n useInAdmin: true,\n },\n\n handleDelete: deleteStoredFile,\n\n handleUpload: async ({ data, file, storageFilePath }) => {\n await uploadFile({\n buffer: file.buffer,\n client: getStorageClient(),\n mimeType: file.mimeType,\n storageFilePath,\n tempFilePath: file.tempFilePath,\n })\n\n return data\n },\n\n staticHandler: (req, { doc, headers, params: { filename, operation, uploadReference } }) =>\n getFile({\n client: getStorageClient(),\n collection,\n collectionPrefix: prefix,\n doc,\n filename,\n incomingHeaders: headers,\n operation,\n req,\n uploadReference,\n useCompositePrefixes,\n }),\n\n ...(allowContainerCreate && { onInit: createContainerIfNotExists }),\n })\n}\n"],"names":["copyAzureFile","deleteFile","generateUploadInstructions","generateURL","getFile","isClientUploadAllowed","uploadFile","createAzureAdapter","allowContainerCreate","baseURL","clientUploads","containerName","createContainerIfNotExists","getStorageClient","useCompositePrefixes","deleteStoredFile","storageFilePath","client","collection","prefix","name","supportsTempFiles","copyFile","from","req","to","filename","urlPrefix","collectionPrefix","uploadInstructions","adminHandler","path","enabled","Boolean","generate","access","undefined","requiresUploadReceipt","useInAdmin","handleDelete","handleUpload","data","file","buffer","mimeType","tempFilePath","staticHandler","doc","headers","params","operation","uploadReference","incomingHeaders","onInit"],"mappings":"AAQA,SAASA,aAAa,QAAQ,gBAAe;AAC7C,SAASC,UAAU,QAAQ,kBAAiB;AAC5C,SAASC,0BAA0B,QAAQ,kCAAiC;AAC5E,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,OAAO,QAAQ,eAAc;AACtC,SAASC,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,UAAU,QAAQ,kBAAiB;AAY5C,OAAO,SAASC,mBAAmB,EACjCC,oBAAoB,EACpBC,OAAO,EACPC,aAAa,EACbC,aAAa,EACbC,0BAA0B,EAC1BC,gBAAgB,EAChBC,uBAAuB,KAAK,EACL;IACvB,MAAMC,mBAA+B,CAAC,EAAEC,eAAe,EAAE,GACvDf,WAAW;YAAEgB,QAAQJ;YAAoBG;QAAgB;IAE3D,OAAO,CAAC,EAAEE,UAAU,EAAEC,SAAS,EAAE,EAAE,GAAwB,CAAA;YACzDC,MAAM;YACNC,mBAAmB;YAEnBC,UAAU,CAAC,EAAEC,IAAI,EAAEC,GAAG,EAAEC,EAAE,EAAE,GAAKzB,cAAc;oBAAEiB,QAAQJ;oBAAoBU;oBAAMC;oBAAKC;gBAAG;YAC3FxB,YAAYc;YAEZZ,aAAa,CAAC,EAAEuB,QAAQ,EAAEP,QAAQQ,YAAY,EAAE,EAAE,GAChDxB,YAAY;oBACVM;oBACAmB,kBAAkBT;oBAClBR;oBACAe;oBACAP,QAAQQ;oBACRb;gBACF;YAEFe,oBAAoB;gBAClBC,cAAc;oBACZC,MAAM;gBACR;gBACAC,SAASC,QAAQvB,kBAAkBL,sBAAsBa;gBACzDgB,UAAUhC,2BAA2B;oBACnCiC,QAAQ,OAAOzB,kBAAkB,WAAWA,cAAcyB,MAAM,GAAGC;oBACnER,kBAAkBT;oBAClBR;oBACAE;oBACAC;gBACF;gBACAuB,uBAAuB;gBACvBC,YAAY;YACd;YAEAC,cAAcxB;YAEdyB,cAAc,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAE1B,eAAe,EAAE;gBAClD,MAAMV,WAAW;oBACfqC,QAAQD,KAAKC,MAAM;oBACnB1B,QAAQJ;oBACR+B,UAAUF,KAAKE,QAAQ;oBACvB5B;oBACA6B,cAAcH,KAAKG,YAAY;gBACjC;gBAEA,OAAOJ;YACT;YAEAK,eAAe,CAACtB,KAAK,EAAEuB,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAEvB,QAAQ,EAAEwB,SAAS,EAAEC,eAAe,EAAE,EAAE,GACrF/C,QAAQ;oBACNa,QAAQJ;oBACRK;oBACAU,kBAAkBT;oBAClB4B;oBACArB;oBACA0B,iBAAiBJ;oBACjBE;oBACA1B;oBACA2B;oBACArC;gBACF;YAEF,GAAIN,wBAAwB;gBAAE6C,QAAQzC;YAA2B,CAAC;QACpE,CAAA;AACF"}
@@ -0,0 +1,11 @@
1
+ import type { ContainerClient } from '@azure/storage-blob';
2
+ import type { PayloadRequest } from 'payload';
3
+ type Args = {
4
+ client: ContainerClient;
5
+ from: string;
6
+ req?: PayloadRequest;
7
+ to: string;
8
+ };
9
+ export declare const copyAzureFile: ({ client, from, req, to }: Args) => Promise<void>;
10
+ export {};
11
+ //# sourceMappingURL=copyFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copyFile.d.ts","sourceRoot":"","sources":["../src/copyFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,KAAK,IAAI,GAAG;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,cAAc,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvF,eAAO,MAAM,aAAa,8BAAqC,IAAI,KAAG,OAAO,CAAC,IAAI,CAqDjF,CAAA"}
@@ -0,0 +1,52 @@
1
+ export const copyAzureFile = async ({ client, from, req, to })=>{
2
+ if (from === to) {
3
+ throw new Error('Storage copy requires different source and destination keys');
4
+ }
5
+ const source = client.getBlockBlobClient(from);
6
+ const destination = client.getBlockBlobClient(to);
7
+ const properties = await source.getProperties();
8
+ const { tags } = await source.getTags();
9
+ const download = await source.download();
10
+ if (!download.readableStreamBody) {
11
+ throw new Error(`Azure storage source is not readable: ${from}`);
12
+ }
13
+ const uploaded = await destination.uploadStream(download.readableStreamBody, 4 * 1024 * 1024, 4, {
14
+ blobHTTPHeaders: {
15
+ blobCacheControl: properties.cacheControl,
16
+ blobContentDisposition: properties.contentDisposition,
17
+ blobContentEncoding: properties.contentEncoding,
18
+ blobContentLanguage: properties.contentLanguage,
19
+ blobContentType: properties.contentType
20
+ },
21
+ conditions: {
22
+ ifNoneMatch: '*'
23
+ },
24
+ metadata: properties.metadata,
25
+ tags
26
+ });
27
+ try {
28
+ const copied = await destination.getProperties();
29
+ if (copied.contentLength !== properties.contentLength) {
30
+ throw new Error(`Copied Azure object is not readable at its expected length: ${to}`);
31
+ }
32
+ } catch (err) {
33
+ try {
34
+ if (!uploaded.etag) {
35
+ throw new Error('Azure copy did not return an ETag for safe cleanup');
36
+ }
37
+ await destination.deleteIfExists({
38
+ conditions: {
39
+ ifMatch: uploaded.etag
40
+ }
41
+ });
42
+ } catch (cleanupError) {
43
+ req?.payload.logger.error({
44
+ err: cleanupError,
45
+ msg: `Failed to remove unsuccessful Azure copy at ${client.containerName}/${to}`
46
+ });
47
+ }
48
+ throw err;
49
+ }
50
+ };
51
+
52
+ //# sourceMappingURL=copyFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/copyFile.ts"],"sourcesContent":["import type { ContainerClient } from '@azure/storage-blob'\nimport type { Readable } from 'node:stream'\nimport type { PayloadRequest } from 'payload'\n\ntype Args = { client: ContainerClient; from: string; req?: PayloadRequest; to: string }\n\nexport const copyAzureFile = async ({ client, from, req, to }: Args): Promise<void> => {\n if (from === to) {\n throw new Error('Storage copy requires different source and destination keys')\n }\n\n const source = client.getBlockBlobClient(from)\n const destination = client.getBlockBlobClient(to)\n const properties = await source.getProperties()\n const { tags } = await source.getTags()\n const download = await source.download()\n\n if (!download.readableStreamBody) {\n throw new Error(`Azure storage source is not readable: ${from}`)\n }\n\n const uploaded = await destination.uploadStream(\n download.readableStreamBody as Readable,\n 4 * 1024 * 1024,\n 4,\n {\n blobHTTPHeaders: {\n blobCacheControl: properties.cacheControl,\n blobContentDisposition: properties.contentDisposition,\n blobContentEncoding: properties.contentEncoding,\n blobContentLanguage: properties.contentLanguage,\n blobContentType: properties.contentType,\n },\n conditions: { ifNoneMatch: '*' },\n metadata: properties.metadata,\n tags,\n },\n )\n\n try {\n const copied = await destination.getProperties()\n\n if (copied.contentLength !== properties.contentLength) {\n throw new Error(`Copied Azure object is not readable at its expected length: ${to}`)\n }\n } catch (err) {\n try {\n if (!uploaded.etag) {\n throw new Error('Azure copy did not return an ETag for safe cleanup')\n }\n await destination.deleteIfExists({ conditions: { ifMatch: uploaded.etag } })\n } catch (cleanupError) {\n req?.payload.logger.error({\n err: cleanupError,\n msg: `Failed to remove unsuccessful Azure copy at ${client.containerName}/${to}`,\n })\n }\n throw err\n }\n}\n"],"names":["copyAzureFile","client","from","req","to","Error","source","getBlockBlobClient","destination","properties","getProperties","tags","getTags","download","readableStreamBody","uploaded","uploadStream","blobHTTPHeaders","blobCacheControl","cacheControl","blobContentDisposition","contentDisposition","blobContentEncoding","contentEncoding","blobContentLanguage","contentLanguage","blobContentType","contentType","conditions","ifNoneMatch","metadata","copied","contentLength","err","etag","deleteIfExists","ifMatch","cleanupError","payload","logger","error","msg","containerName"],"mappings":"AAMA,OAAO,MAAMA,gBAAgB,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,EAAE,EAAQ;IACjE,IAAIF,SAASE,IAAI;QACf,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,SAASL,OAAOM,kBAAkB,CAACL;IACzC,MAAMM,cAAcP,OAAOM,kBAAkB,CAACH;IAC9C,MAAMK,aAAa,MAAMH,OAAOI,aAAa;IAC7C,MAAM,EAAEC,IAAI,EAAE,GAAG,MAAML,OAAOM,OAAO;IACrC,MAAMC,WAAW,MAAMP,OAAOO,QAAQ;IAEtC,IAAI,CAACA,SAASC,kBAAkB,EAAE;QAChC,MAAM,IAAIT,MAAM,CAAC,sCAAsC,EAAEH,MAAM;IACjE;IAEA,MAAMa,WAAW,MAAMP,YAAYQ,YAAY,CAC7CH,SAASC,kBAAkB,EAC3B,IAAI,OAAO,MACX,GACA;QACEG,iBAAiB;YACfC,kBAAkBT,WAAWU,YAAY;YACzCC,wBAAwBX,WAAWY,kBAAkB;YACrDC,qBAAqBb,WAAWc,eAAe;YAC/CC,qBAAqBf,WAAWgB,eAAe;YAC/CC,iBAAiBjB,WAAWkB,WAAW;QACzC;QACAC,YAAY;YAAEC,aAAa;QAAI;QAC/BC,UAAUrB,WAAWqB,QAAQ;QAC7BnB;IACF;IAGF,IAAI;QACF,MAAMoB,SAAS,MAAMvB,YAAYE,aAAa;QAE9C,IAAIqB,OAAOC,aAAa,KAAKvB,WAAWuB,aAAa,EAAE;YACrD,MAAM,IAAI3B,MAAM,CAAC,4DAA4D,EAAED,IAAI;QACrF;IACF,EAAE,OAAO6B,KAAK;QACZ,IAAI;YACF,IAAI,CAAClB,SAASmB,IAAI,EAAE;gBAClB,MAAM,IAAI7B,MAAM;YAClB;YACA,MAAMG,YAAY2B,cAAc,CAAC;gBAAEP,YAAY;oBAAEQ,SAASrB,SAASmB,IAAI;gBAAC;YAAE;QAC5E,EAAE,OAAOG,cAAc;YACrBlC,KAAKmC,QAAQC,OAAOC,MAAM;gBACxBP,KAAKI;gBACLI,KAAK,CAAC,4CAA4C,EAAExC,OAAOyC,aAAa,CAAC,CAAC,EAAEtC,IAAI;YAClF;QACF;QACA,MAAM6B;IACR;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/isClientUploadAllowed.ts"],"sourcesContent":["export const isClientUploadAllowed = (collection?: {\n upload?: { allowRestrictedFileTypes?: boolean } | boolean\n}): boolean =>\n Boolean(\n collection &&\n typeof collection.upload === 'object' &&\n collection.upload.allowRestrictedFileTypes,\n )\n"],"names":["isClientUploadAllowed","collection","Boolean","upload","allowRestrictedFileTypes"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB,CAACC,aAGpCC,QACED,cACE,OAAOA,WAAWE,MAAM,KAAK,YAC7BF,WAAWE,MAAM,CAACC,wBAAwB,EAC7C"}
1
+ {"version":3,"sources":["../src/isClientUploadAllowed.ts"],"sourcesContent":["export const isClientUploadAllowed = (collection?: {\n upload?: { allowRestrictedFileTypes?: boolean } | boolean\n}): boolean =>\n Boolean(\n collection &&\n typeof collection.upload === 'object' &&\n collection.upload.allowRestrictedFileTypes,\n )\n"],"names":["isClientUploadAllowed","collection","Boolean","upload","allowRestrictedFileTypes"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB,CAACC,aAGpCC,QACED,cACA,OAAOA,WAAWE,MAAM,KAAK,YAC7BF,WAAWE,MAAM,CAACC,wBAAwB,EAC3C"}
package/package.json CHANGED
@@ -1,13 +1,8 @@
1
1
  {
2
2
  "name": "@payloadcms/storage-azure",
3
- "version": "4.0.0-internal.f15737c",
3
+ "version": "4.0.0-internal.f2a04f7",
4
4
  "description": "Payload storage adapter for Azure Blob Storage",
5
5
  "homepage": "https://payloadcms.com",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/payloadcms/payload.git",
9
- "directory": "packages/storage-azure"
10
- },
11
6
  "license": "MIT",
12
7
  "author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
13
8
  "maintainers": [
@@ -17,8 +12,18 @@
17
12
  "url": "https://payloadcms.com"
18
13
  }
19
14
  ],
20
- "sideEffects": false,
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/payloadcms/payload.git",
18
+ "directory": "packages/storage-azure"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
21
23
  "type": "module",
24
+ "sideEffects": false,
25
+ "main": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
22
27
  "exports": {
23
28
  ".": {
24
29
  "import": "./dist/index.js",
@@ -31,21 +36,16 @@
31
36
  "default": "./dist/exports/client.js"
32
37
  }
33
38
  },
34
- "main": "./dist/index.js",
35
- "types": "./dist/index.d.ts",
36
- "files": [
37
- "dist"
38
- ],
39
39
  "dependencies": {
40
40
  "@azure/abort-controller": "^1.1.0",
41
41
  "@azure/storage-blob": "^12.33.0",
42
- "@payloadcms/plugin-cloud-storage": "4.0.0-internal.f15737c"
42
+ "@payloadcms/plugin-cloud-storage": "4.0.0-internal.f2a04f7"
43
43
  },
44
44
  "devDependencies": {
45
- "payload": "4.0.0-internal.f15737c"
45
+ "payload": "4.0.0-internal.f2a04f7"
46
46
  },
47
47
  "peerDependencies": {
48
- "payload": "4.0.0-internal.f15737c"
48
+ "payload": "4.0.0-internal.f2a04f7"
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=24.15.0"