{"version":3,"file":"presets.cjs","names":[],"sources":["../../../../src/rest/commands/delete/presets.ts"],"sourcesContent":["import type { DirectusPreset } from '../../../schema/preset.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing presets.\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deletePresets =\n\t<Schema>(keys: DirectusPreset<Schema>['id'][]): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/presets`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing preset.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deletePreset =\n\t<Schema>(key: DirectusPreset<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/presets/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"kDAUa,EACH,QAER,EAAA,aAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,WACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAA,aAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,YAAY,IAClB,OAAQ,SACR"}