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