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