{"version":3,"sources":["jsdelivr-header.js","/npm/adbm-mongodb@2.0.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,QAAQ,oBAAsB,QAAQ,kBAAoB,QAAQ,yBAA2B,QAAQ,UAAO,EAC5G,MAAM,KAAO,OAEb,QAAQ,KAAO,KACf,MAAM,yBAA2B,OAAS,KAAI,WAAU,aACpD,MAAM,QAAkB,EACnB,WAAW,GACX,KAAK,CAAC,EAAG,CAAE,WAAY,CAAE,IAAI,KAC7B,UAEL,OADA,EAAO,MAAM,WAAW,EAAU,uDAAuD,OAClF,EAAU,KAAI,EAAG,QAAS,GAAG,EAExC,QAAQ,yBAA2B,yBACnC,MAAM,kBAAoB,OAAS,KAAI,KAAI,qBACjC,EAAG,WAAW,GAAU,UAAU,CAAE,KAAI,UAAW,IAAI,MAAS,EAE1E,QAAQ,kBAAoB,kBAC5B,MAAM,oBAAsB,OAAS,KAAI,KAAI,qBACnC,EAAG,WAAW,GAAU,UAAU,CAAE,MAAK,EAEnD,QAAQ,oBAAsB","file":"/npm/adbm-mongodb@2.0.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/adbm-mongodb@2.0.2/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unregisterMigration = exports.registerMigration = exports.getCompletedMigrationIds = exports.init = void 0;\nconst init = () => {\n};\nexports.init = init;\nconst getCompletedMigrationIds = async ({ db, metadata, logger, }) => {\n    const completed = await db\n        .collection(metadata)\n        .find({}, { projection: { id: true } })\n        .toArray();\n    logger.debug(`○ Found ${completed.length} completed migrations in metadata collection \"${metadata}\".`);\n    return completed.map(({ id }) => id);\n};\nexports.getCompletedMigrationIds = getCompletedMigrationIds;\nconst registerMigration = async ({ id, db, metadata, }) => {\n    await db.collection(metadata).insertOne({ id, completed: new Date() });\n};\nexports.registerMigration = registerMigration;\nconst unregisterMigration = async ({ id, db, metadata, }) => {\n    await db.collection(metadata).deleteOne({ id });\n};\nexports.unregisterMigration = unregisterMigration;\n"]}