mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
1 line
23 KiB
JSON
1 line
23 KiB
JSON
|
|
{"ast":null,"code":"import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';\nimport { loadModule, logger, fill, isThenable } from '@sentry/utils';\n\n// This allows us to use the same array for both defaults options and the type itself.\n// (note `as const` at the end to make it a union of string literal types (i.e. \"a\" | \"b\" | ... )\n// and not just a string[])\n\nvar OPERATIONS = ['aggregate',\n// aggregate(pipeline, options, callback)\n'bulkWrite',\n// bulkWrite(operations, options, callback)\n'countDocuments',\n// countDocuments(query, options, callback)\n'createIndex',\n// createIndex(fieldOrSpec, options, callback)\n'createIndexes',\n// createIndexes(indexSpecs, options, callback)\n'deleteMany',\n// deleteMany(filter, options, callback)\n'deleteOne',\n// deleteOne(filter, options, callback)\n'distinct',\n// distinct(key, query, options, callback)\n'drop',\n// drop(options, callback)\n'dropIndex',\n// dropIndex(indexName, options, callback)\n'dropIndexes',\n// dropIndexes(options, callback)\n'estimatedDocumentCount',\n// estimatedDocumentCount(options, callback)\n'find',\n// find(query, options, callback)\n'findOne',\n// findOne(query, options, callback)\n'findOneAndDelete',\n// findOneAndDelete(filter, options, callback)\n'findOneAndReplace',\n// findOneAndReplace(filter, replacement, options, callback)\n'findOneAndUpdate',\n// findOneAndUpdate(filter, update, options, callback)\n'indexes',\n// indexes(options, callback)\n'indexExists',\n// indexExists(indexes, options, callback)\n'indexInformation',\n// indexInformation(options, callback)\n'initializeOrderedBulkOp',\n// initializeOrderedBulkOp(options, callback)\n'insertMany',\n// insertMany(docs, options, callback)\n'insertOne',\n// insertOne(doc, options, callback)\n'isCapped',\n// isCapped(options, callback)\n'mapReduce',\n// mapReduce(map, reduce, options, callback)\n'options',\n// options(options, callback)\n'parallelCollectionScan',\n// parallelCollectionScan(options, callback)\n'rename',\n// rename(newName, options, callback)\n'replaceOne',\n// replaceOne(filter, doc, options, callback)\n'stats',\n// stats(options, callback)\n'updateMany',\n// updateMany(filter, update, options, callback)\n'updateOne' // updateOne(filter, update, options, callback)\n];\n\n// All of the operations above take `options` and `callback` as their final parameters, but some of them\n// take additional parameters as well. For those operations, this is a map of\n// { <operation name>: [<names of additional parameters>] }, as a way to know what to call the operation's\n// positional arguments when we add them to the span's `data` object later\nvar OPERATION_SIGNATURES = {\n // aggregate intentionally not included because `pipeline` arguments are too complex to serialize well\n // see https://github.com/getsentry/sentry-javascript/pull/3102\n bulkWrite: ['operations'],\n countDocuments: ['query'],\n createIndex: ['fieldOrSpec'],\n createIndexes: ['indexSpecs'],\n deleteMany: ['filter'],\n deleteOne: ['filter'],\n distinct: ['key', 'query'],\n dropIndex: ['indexName'],\n find: ['query'],\n findOne: ['query'],\n findOneAndDelete: ['filter'],\n findOneAndReplace: ['filter', 'replacement'],\n findOneAndUpdate: ['filter', 'update'],\n indexExists: ['indexes'],\n insertMany: ['docs'],\n insertOne: ['doc'],\n mapReduce: ['map', 'reduce'],\n rename: ['newName'],\n replaceOne: ['filter', 'doc'],\n updateMany: ['filter', 'update'],\n updateOne: ['filter', 'update']\n};\n\n/** Tracing integration for mongo package */\nclass Mongo {\n /**\n * @inheritDoc\n */\n static __initStatic() {\n this.id = 'Mongo';\n }\n\n /**\n * @inheritDoc\n */\n __init() {\n this.name = Mongo.id;\n }\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {\n ;\n Mongo.prototype.__init.call(this);\n this._operations = Array.isArray(options.operations) ? options.operations : OPERATIONS;\n this._describeOperations = 'describeOperations' in options ? options.describeOperations : true;\n this._useMongoose = !!options.useMongoose;\n }\n\n /*
|