{"version":3,"file":"extensions.cjs","names":[],"sources":["../../../../src/rest/commands/delete/extensions.ts"],"sourcesContent":["import type { DirectusExtension } from '../../../schema/extension.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Uninstall a registry extension.\n * @param id - UUID of the installed extension\n * @returns Nothing\n * @throws Will throw if id is empty\n */\nexport const uninstallRegistryExtension =\n\t<Schema>(id: DirectusExtension<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(id, 'Id cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/extensions/registry/uninstall/${id}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing extension.\n *\n * @param id - UUID of the extension\n * @returns Nothing\n * @throws Will throw if id is empty\n */\nexport const deleteExtension =\n\t<Schema>(id: DirectusExtension<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(id, 'Id cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/extensions/${id}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"kDAUa,EACH,QAER,EAAA,aAAa,EAAI,qBAAqB,CAE/B,CACN,KAAM,kCAAkC,IACxC,OAAQ,SACR,EAUU,EACH,QAER,EAAA,aAAa,EAAI,qBAAqB,CAE/B,CACN,KAAM,eAAe,IACrB,OAAQ,SACR"}