{"version":3,"file":"files.js","names":[],"sources":["../../../../src/rest/commands/delete/files.ts"],"sourcesContent":["import type { DirectusFile } from '../../../schema/file.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple files at once.\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deleteFiles =\n\t(keys: DirectusFile['id'][]): RestCommand =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/files`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing file.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deleteFile =\n\t(key: DirectusFile['id']): RestCommand =>\n\t() => {\n\t\tthrowIfEmpty(key, 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/files/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"6DAUA,MAAa,EACH,QAER,EAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,SACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAa,EAAK,sBAAsB,CAEjC,CACN,KAAM,UAAU,IAChB,OAAQ,SACR"}