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