Файловый менеджер - Редактировать - /home/freeclou/app.optimyar.com/backend/node_modules/@sentry/tracing/esm/integrations/mongo.js.map
Назад
{"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../src/integrations/mongo.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMzE,IAAM,UAAU,GAAG;IACjB,WAAW;IACX,WAAW;IACX,gBAAgB;IAChB,aAAa;IACb,eAAe;IACf,YAAY;IACZ,WAAW;IACX,UAAU;IACV,MAAM;IACN,WAAW;IACX,aAAa;IACb,wBAAwB;IACxB,MAAM;IACN,SAAS;IACT,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAClB,SAAS;IACT,aAAa;IACb,kBAAkB;IAClB,yBAAyB;IACzB,YAAY;IACZ,WAAW;IACX,UAAU;IACV,WAAW;IACX,SAAS;IACT,wBAAwB;IACxB,QAAQ;IACR,YAAY;IACZ,OAAO;IACP,YAAY;IACZ,WAAW;CACH,CAAC;AAEX,wGAAwG;AACxG,6EAA6E;AAC7E,2GAA2G;AAC3G,0EAA0E;AAC1E,IAAM,oBAAoB,GAEtB;IACF,sGAAsG;IACtG,+DAA+D;IAC/D,SAAS,EAAE,CAAC,YAAY,CAAC;IACzB,cAAc,EAAE,CAAC,OAAO,CAAC;IACzB,WAAW,EAAE,CAAC,aAAa,CAAC;IAC5B,aAAa,EAAE,CAAC,YAAY,CAAC;IAC7B,UAAU,EAAE,CAAC,QAAQ,CAAC;IACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,CAAC,WAAW,CAAC;IACxB,IAAI,EAAE,CAAC,OAAO,CAAC;IACf,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,gBAAgB,EAAE,CAAC,QAAQ,CAAC;IAC5B,iBAAiB,EAAE,CAAC,QAAQ,EAAE,aA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dynamicRequire, fill, isThenable, logger } 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[])\ntype Operation = typeof OPERATIONS[number];\nconst OPERATIONS = [\n 'aggregate', // aggregate(pipeline, options, callback)\n 'bulkWrite', // bulkWrite(operations, options, callback)\n 'countDocuments', // countDocuments(query, options, callback)\n 'createIndex', // createIndex(fieldOrSpec, options, callback)\n 'createIndexes', // createIndexes(indexSpecs, options, callback)\n 'deleteMany', // deleteMany(filter, options, callback)\n 'deleteOne', // deleteOne(filter, options, callback)\n 'distinct', // distinct(key, query, options, callback)\n 'drop', // drop(options, callback)\n 'dropIndex', // dropIndex(indexName, options, callback)\n 'dropIndexes', // dropIndexes(options, callback)\n 'estimatedDocumentCount', // estimatedDocumentCount(options, callback)\n 'find', // find(query, options, callback)\n 'findOne', // findOne(query, options, callback)\n 'findOneAndDelete', // findOneAndDelete(filter, options, callback)\n 'findOneAndReplace', // findOneAndReplace(filter, replacement, options, callback)\n 'findOneAndUpdate', // findOneAndUpdate(filter, update, options, callback)\n 'indexes', // indexes(options, callback)\n 'indexExists', // indexExists(indexes, options, callback)\n 'indexInformation', // indexInformation(options, callback)\n 'initializeOrderedBulkOp', // initializeOrderedBulkOp(options, callback)\n 'insertMany', // insertMany(docs, options, callback)\n 'insertOne', // insertOne(doc, options, callback)\n 'isCapped', // isCapped(options, callback)\n 'mapReduce', // mapReduce(map, reduce, options, callback)\n 'options', // options(options, callback)\n 'parallelCollectionScan', // parallelCollectionScan(options, callback)\n 'rename', // rename(newName, options, callback)\n 'replaceOne', // replaceOne(filter, doc, options, callback)\n 'stats', // stats(options, callback)\n 'updateMany', // updateMany(filter, update, options, callback)\n 'updateOne', // updateOne(filter, update, options, callback)\n] as const;\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\nconst OPERATION_SIGNATURES: {\n [op in Operation]?: string[];\n} = {\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\ninterface MongoCollection {\n collectionName: string;\n dbName: string;\n namespace: string;\n prototype: {\n [operation in Operation]: (...args: unknown[]) => unknown;\n };\n}\n\ninterface MongoOptions {\n operations?: Operation[];\n describeOperations?: boolean | Operation[];\n useMongoose?: boolean;\n}\n\n/** Tracing integration for mongo package */\nexport class Mongo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Mongo';\n\n /**\n * @inheritDoc\n */\n public name: string = Mongo.id;\n\n private _operations: Operation[];\n private _describeOperations?: boolean | Operation[];\n private _useMongoose: boolean;\n\n /**\n * @inheritDoc\n */\n public constructor(options: MongoOptions = {}) {\n this._operations = Array.isArray(options.operations)\n ? options.operations\n : ((OPERATIONS as unknown) as Operation[]);\n this._describeOperations = 'describeOperations' in options ? options.describeOperations : true;\n this._useMongoose = !!options.useMongoose;\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n let collection: MongoCollection;\n const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';\n try {\n const mongodbModule = dynamicRequire(module, moduleName) as { Collection: MongoCollection };\n collection = mongodbModule.Collection;\n } catch (e) {\n logger.error(`Mongo Integration was unable to require \\`${moduleName}\\` package.`);\n return;\n }\n\n this._instrumentOperations(collection, this._operations, getCurrentHub);\n }\n\n /**\n * Patches original collection methods\n */\n private _instrumentOperations(collection: MongoCollection, operations: Operation[], getCurrentHub: () => Hub): void {\n operations.forEach((operation: Operation) => this._patchOperation(collection, operation, getCurrentHub));\n }\n\n /**\n * Patches original collection to utilize our tracing functionality\n */\n private _patchOperation(collection: MongoCollection, operation: Operation, getCurrentHub: () => Hub): void {\n if (!(operation in collection.prototype)) return;\n\n const getSpanContext = this._getSpanContextFromOperationArguments.bind(this);\n\n fill(collection.prototype, operation, function(orig: () => void | Promise<unknown>) {\n return function(this: unknown, ...args: unknown[]) {\n const lastArg = args[args.length - 1];\n const scope = getCurrentHub().getScope();\n const parentSpan = scope?.getSpan();\n\n // Check if the operation was passed a callback. (mapReduce requires a different check, as\n // its (non-callback) arguments can also be functions.)\n if (typeof lastArg !== 'function' || (operation === 'mapReduce' && args.length === 2)) {\n const span = parentSpan?.startChild(getSpanContext(this, operation, args));\n const maybePromise = orig.call(this, ...args) as Promise<unknown>;\n\n if (isThenable(maybePromise)) {\n return maybePromise.then((res: unknown) => {\n span?.finish();\n return res;\n });\n } else {\n span?.finish();\n return maybePromise;\n }\n }\n\n const span = parentSpan?.startChild(getSpanContext(this, operation, args.slice(0, -1)));\n return orig.call(this, ...args.slice(0, -1), function(err: Error, result: unknown) {\n span?.finish();\n lastArg(err, result);\n });\n };\n });\n }\n\n /**\n * Form a SpanContext based on the user input to a given operation.\n */\n private _getSpanContextFromOperationArguments(\n collection: MongoCollection,\n operation: Operation,\n args: unknown[],\n ): SpanContext {\n const data: { [key: string]: string } = {\n collectionName: collection.collectionName,\n dbName: collection.dbName,\n namespace: collection.namespace,\n };\n const spanContext: SpanContext = {\n op: `db`,\n description: operation,\n data,\n };\n\n // If the operation takes no arguments besides `options` and `callback`, or if argument\n // collection is disabled for this operation, just return early.\n const signature = OPERATION_SIGNATURES[operation];\n const shouldDescribe = Array.isArray(this._describeOperations)\n ? this._describeOperations.includes(operation)\n : this._describeOperations;\n\n if (!signature || !shouldDescribe) {\n return spanContext;\n }\n\n try {\n // Special case for `mapReduce`, as the only one accepting functions as arguments.\n if (operation === 'mapReduce') {\n const [map, reduce] = args as { name?: string }[];\n data[signature[0]] = typeof map === 'string' ? map : map.name || '<anonymous>';\n data[signature[1]] = typeof reduce === 'string' ? reduce : reduce.name || '<anonymous>';\n } else {\n for (let i = 0; i < signature.length; i++) {\n data[signature[i]] = JSON.stringify(args[i]);\n }\n }\n } catch (_oO) {\n // no-empty\n }\n\n return spanContext;\n }\n}\n"]}
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка