@workleap/logrocket 2.1.5 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @workleap/logrocket
2
2
 
3
+ ## 2.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#129](https://github.com/workleap/wl-telemetry/pull/129) [`2b3bf24`](https://github.com/workleap/wl-telemetry/commit/2b3bf24e69abdcfe33c0bd3ce09350ec4f49d9ff) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumped dependency versions.
8
+
9
+ - Updated dependencies [[`2b3bf24`](https://github.com/workleap/wl-telemetry/commit/2b3bf24e69abdcfe33c0bd3ce09350ec4f49d9ff)]:
10
+ - @workleap-telemetry/core@1.0.6
11
+
12
+ ## 2.1.6
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [[`03f399c`](https://github.com/workleap/wl-telemetry/commit/03f399c6e97579da6fa5e7cc3f754830f91c7016)]:
17
+ - @workleap-telemetry/core@1.0.5
18
+
3
19
  ## 2.1.5
4
20
 
5
21
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"js/LogRocketInstrumentationClient.js","sources":["webpack://@workleap/logrocket/./src/js/LogRocketInstrumentationClient.ts"],"sourcesContent":["import type { LogRocketInstrumentationPartialClient, TelemetryContext } from \"@workleap-telemetry/core\";\nimport LogRocket from \"logrocket\";\nimport { isDefined } from \"./assertions.ts\";\n\nexport type GetLogRocketSessionUrlListener = (sessionURL: string) => void;\n\nexport const DeviceIdTrait = \"Device Id\";\nexport const TelemetryIdTrait = \"Telemetry Id\";\n\n///////////////////////////\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketWorkleapPlatformIdentification {\n userId: string;\n organizationId: string;\n organizationName: string;\n isMigratedToWorkleap: boolean;\n isAdmin: boolean;\n isOrganizationCreator?: boolean;\n isExecutive?: {\n wov?: boolean;\n lms?: boolean;\n onb?: boolean;\n sks?: boolean;\n wpm?: boolean;\n pbd?: boolean;\n cmp?: boolean;\n };\n isCollaborator?: {\n wov?: boolean;\n lms?: boolean;\n onb?: boolean;\n sks?: boolean;\n wpm?: boolean;\n pbd?: boolean;\n cmp?: boolean;\n };\n isReportingManager?: boolean;\n isTeamManager?: boolean;\n planCode?: {\n wov?: string;\n lms?: string;\n onb?: string;\n sks?: string;\n wpm?: string;\n pbd?: string;\n cmp?: string;\n };\n}\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketWorkleapPlatformUserTraits extends Record<string, unknown> {\n \"User Id\": string;\n \"Organization Id\": string;\n \"Organization Name\": string;\n \"Is Migrated To Workleap\": boolean;\n \"Is Admin\": boolean;\n [DeviceIdTrait]: string;\n [TelemetryIdTrait]: string;\n \"Is Organization Creator\"?: boolean;\n \"Is Executive\"?: boolean;\n \"Is Executive - Officevibe\"?: boolean;\n \"Is Executive - LMS\"?: boolean;\n \"Is Executive - Onboarding\"?: boolean;\n \"Is Executive - Skills\"?: boolean;\n \"Is Executive - Performance\"?: boolean;\n \"Is Executive - Pingboard\"?: boolean;\n \"Is Collaborator\"?: boolean;\n \"Is Collaborator - Officevibe\"?: boolean;\n \"Is Collaborator - LMS\"?: boolean;\n \"Is Collaborator - Onboarding\"?: boolean;\n \"Is Collaborator - Skills\"?: boolean;\n \"Is Collaborator - Performance\"?: boolean;\n \"Is Collaborator - Pingboard\"?: boolean;\n \"Is Reporting Manager\"?: boolean;\n \"Is Team Manager\"?: boolean;\n \"Plan Code - Officevibe\"?: string;\n \"Plan Code - LMS\"?: string;\n \"Plan Code - Onboarding\"?: string;\n \"Plan Code - Skills\"?: string;\n \"Plan Code - Performance\"?: string;\n \"Plan Code - Pingboard\"?: string;\n}\n\n///////////////////////////\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketInstrumentationClient extends LogRocketInstrumentationPartialClient {\n /**\n * Register a listener to receive the LogRocket session id when it's available.\n * This method is the equivalent of the LogRocket.getSessionURL function but is\n * particularly useful for third party libraries that doesn't want to take a dependency\n * on `logrocket`.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n registerGetSessionUrlListener: (listener: GetLogRocketSessionUrlListener) => void;\n\n /**\n * Create the default user traits for a Workleap Platform user.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n createWorkleapPlatformDefaultUserTraits: (identification: LogRocketWorkleapPlatformIdentification) => LogRocketWorkleapPlatformUserTraits;\n}\n\nexport class LogRocketInstrumentationClientImpl implements LogRocketInstrumentationClient {\n readonly #telemetryContext?: TelemetryContext;\n\n constructor(telemetryContext?: TelemetryContext) {\n this.#telemetryContext = telemetryContext;\n }\n\n // IMPORTANT: If you update this method, make sure to update the LogRocketInstrumentationPartialClient\n // interface as well in @workleap-telemetry/core.\n registerGetSessionUrlListener(listener: GetLogRocketSessionUrlListener) {\n LogRocket.getSessionURL(listener);\n }\n\n createWorkleapPlatformDefaultUserTraits(identification: LogRocketWorkleapPlatformIdentification) {\n const {\n userId,\n organizationId,\n organizationName,\n isMigratedToWorkleap,\n isOrganizationCreator,\n isAdmin,\n isExecutive,\n isCollaborator,\n isReportingManager,\n isTeamManager,\n planCode\n } = identification;\n\n const isExecutiveInAnyProduct = Boolean(\n isExecutive?.wov ||\n isExecutive?.lms ||\n isExecutive?.onb ||\n isExecutive?.sks ||\n isExecutive?.wpm ||\n isExecutive?.pbd ||\n isExecutive?.cmp\n );\n\n const isCollaboratorInAnyProduct = Boolean(\n isCollaborator?.wov ||\n isCollaborator?.lms ||\n isCollaborator?.onb ||\n isCollaborator?.sks ||\n isCollaborator?.wpm ||\n isCollaborator?.pbd ||\n isCollaborator?.cmp\n );\n\n return {\n \"User Id\": userId,\n \"Organization Id\": organizationId,\n \"Organization Name\": organizationName,\n \"Is Migrated To Workleap\": isMigratedToWorkleap,\n \"Is Admin\": isAdmin,\n [DeviceIdTrait]: this.#telemetryContext?.deviceId ?? \"N/A\",\n [TelemetryIdTrait]: this.#telemetryContext?.telemetryId ?? \"N/A\",\n ...(isDefined(isOrganizationCreator) && { \"Is Organization Creator\": isOrganizationCreator }),\n ...(isExecutiveInAnyProduct && { \"Is Executive\": true }),\n ...(isDefined(isExecutive?.wov) && { \"Is Executive - Officevibe\": isExecutive.wov }),\n ...(isDefined(isExecutive?.lms) && { \"Is Executive - LMS\": isExecutive.lms }),\n ...(isDefined(isExecutive?.onb) && { \"Is Executive - Onboarding\": isExecutive.onb }),\n ...(isDefined(isExecutive?.sks) && { \"Is Executive - Skills\": isExecutive.sks }),\n ...(isDefined(isExecutive?.wpm) && { \"Is Executive - Performance\": isExecutive.wpm }),\n ...(isDefined(isExecutive?.pbd) && { \"Is Executive - Pingboard\": isExecutive.pbd }),\n ...(isDefined(isExecutive?.cmp) && { \"Is Executive - Compensation\": isExecutive.cmp }),\n ...(isCollaboratorInAnyProduct && { \"Is Collaborator\": isCollaboratorInAnyProduct }),\n ...(isDefined(isCollaborator?.wov) && { \"Is Collaborator - Officevibe\": isCollaborator.wov }),\n ...(isDefined(isCollaborator?.lms) && { \"Is Collaborator - LMS\": isCollaborator.lms }),\n ...(isDefined(isCollaborator?.onb) && { \"Is Collaborator - Onboarding\": isCollaborator.onb }),\n ...(isDefined(isCollaborator?.sks) && { \"Is Collaborator - Skills\": isCollaborator.sks }),\n ...(isDefined(isCollaborator?.wpm) && { \"Is Collaborator - Performance\": isCollaborator.wpm }),\n ...(isDefined(isCollaborator?.pbd) && { \"Is Collaborator - Pingboard\": isCollaborator.pbd }),\n ...(isDefined(isCollaborator?.cmp) && { \"Is Collaborator - Compensation\": isCollaborator.cmp }),\n ...(isDefined(isReportingManager) && { \"Is Reporting Manager\": isReportingManager }),\n ...(isDefined(isTeamManager) && { \"Is Team Manager\": isTeamManager }),\n ...(isDefined(planCode?.wov) && { \"Plan Code - Officevibe\": planCode.wov }),\n ...(isDefined(planCode?.lms) && { \"Plan Code - LMS\": planCode.lms }),\n ...(isDefined(planCode?.onb) && { \"Plan Code - Onboarding\": planCode.onb }),\n ...(isDefined(planCode?.sks) && { \"Plan Code - Skills\": planCode.sks }),\n ...(isDefined(planCode?.wpm) && { \"Plan Code - Performance\": planCode.wpm }),\n ...(isDefined(planCode?.pbd) && { \"Plan Code - Pingboard\": planCode.pbd }),\n ...(isDefined(planCode?.cmp) && { \"Plan Code - Compensation\": planCode.cmp })\n } satisfies LogRocketWorkleapPlatformUserTraits;\n }\n}\n"],"names":["LogRocket","isDefined","DeviceIdTrait","TelemetryIdTrait","LogRocketInstrumentationClientImpl","telemetryContext","listener","identification","userId","organizationId","organizationName","isMigratedToWorkleap","isOrganizationCreator","isAdmin","isExecutive","isCollaborator","isReportingManager","isTeamManager","planCode","isExecutiveInAnyProduct","Boolean","isCollaboratorInAnyProduct"],"mappings":";;;;;;;;AACkC;AACU;AAIrC,MAAME,gBAAgB,YAAY;AAClC,MAAMC,mBAAmB,eAAe;AAuGxC,MAAMC;IACA,iBAAiB,CAAoB;IAE9C,YAAYC,gBAAmC,CAAE;QAC7C,IAAI,CAAC,iBAAiB,GAAGA;IAC7B;IAEA,sGAAsG;IACtG,iDAAiD;IACjD,8BAA8BC,QAAwC,EAAE;QACpEN,uBAAuB,CAACM;IAC5B;IAEA,wCAAwCC,cAAuD,EAAE;QAC7F,MAAM,EACFC,MAAM,EACNC,cAAc,EACdC,gBAAgB,EAChBC,oBAAoB,EACpBC,qBAAqB,EACrBC,OAAO,EACPC,WAAW,EACXC,cAAc,EACdC,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,EACX,GAAGX;QAEJ,MAAMY,0BAA0BC,QAC5BN,aAAa,OACbA,aAAa,OACbA,aAAa,OACbA,aAAa,OACbA,aAAa,OACbA,aAAa,OACbA,aAAa;QAGjB,MAAMO,6BAA6BD,QAC/BL,gBAAgB,OAChBA,gBAAgB,OAChBA,gBAAgB,OAChBA,gBAAgB,OAChBA,gBAAgB,OAChBA,gBAAgB,OAChBA,gBAAgB;QAGpB,O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G;YAAC,CAAC;YACxF,GAAId,SAASA,CAACc,gBAAgB,QAAQ;gBAAE,iCAAiCA,eAAe,GAAG;YAAC,CAAC;YAC7F,GAAId,SAASA,CAACc,gBAAgB,QAAQ;gBAAE,+BAA+BA,eAAe,GAAG;YAAC,CAAC;YAC3F,GAAId,SAASA,CAACc,gBAAgB,QAAQ;gBAAE,kCAAkCA,eAAe,GAAG;YAAC,CAAC;YAC9F,GAAId,SAASA,CAACe,uBAAuB;gBAAE,wBAAwBA;YAAmB,CAAC;YACnF,GAAIf,SAASA,CAACgB,kBAAkB;gBAAE,mBAAmBA;YAAc,CAAC;YACpE,GAAIhB,SAASA,CAACiB,UAAU,QAAQ;gBAAE,0BAA0BA,SAAS,GAAG;YAAC,CAAC;YAC1E,GAAIjB,SAASA,CAACiB,UAAU,QAAQ;gBAAE,mBAAmBA,SAAS,GAAG;YAAC,CAAC;YACnE,GAAIjB,SAASA,CAACiB,UAAU,QAAQ;gBAAE,0BAA0BA,SAAS,GAAG;YAAC,CAAC;YAC1E,GAAIjB,SAASA,CAACiB,UAAU,QAAQ;gBAAE,sBAAsBA,SAAS,GAAG;YAAC,CAAC;YACtE,GAAIjB,SAASA,CAACiB,UAAU,QAAQ;gBAAE,2BAA2BA,SAAS,GAAG;YAAC,CAAC;YAC3E,GAAIjB,SAASA,CAACiB,UAAU,QAAQ;gBAAE,yBAAyBA,SAAS,GAAG;YAAC,CAAC;YACzE,GAAIjB,SAASA,CAACiB,UAAU,QAAQ;gBAAE,4BAA4BA,SAAS,GAAG;YAAC,CAAC;QAChF;IACJ;AACJ"}
1
+ {"version":3,"file":"js/LogRocketInstrumentationClient.js","sources":["../../src/js/LogRocketInstrumentationClient.ts"],"sourcesContent":["import type { LogRocketInstrumentationPartialClient, TelemetryContext } from \"@workleap-telemetry/core\";\nimport LogRocket from \"logrocket\";\nimport { isDefined } from \"./assertions.ts\";\n\nexport type GetLogRocketSessionUrlListener = (sessionURL: string) => void;\n\nexport const DeviceIdTrait = \"Device Id\";\nexport const TelemetryIdTrait = \"Telemetry Id\";\n\n///////////////////////////\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketWorkleapPlatformIdentification {\n userId: string;\n organizationId: string;\n organizationName: string;\n isMigratedToWorkleap: boolean;\n isAdmin: boolean;\n isOrganizationCreator?: boolean;\n isExecutive?: {\n wov?: boolean;\n lms?: boolean;\n onb?: boolean;\n sks?: boolean;\n wpm?: boolean;\n pbd?: boolean;\n cmp?: boolean;\n };\n isCollaborator?: {\n wov?: boolean;\n lms?: boolean;\n onb?: boolean;\n sks?: boolean;\n wpm?: boolean;\n pbd?: boolean;\n cmp?: boolean;\n };\n isReportingManager?: boolean;\n isTeamManager?: boolean;\n planCode?: {\n wov?: string;\n lms?: string;\n onb?: string;\n sks?: string;\n wpm?: string;\n pbd?: string;\n cmp?: string;\n };\n}\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketWorkleapPlatformUserTraits extends Record<string, unknown> {\n \"User Id\": string;\n \"Organization Id\": string;\n \"Organization Name\": string;\n \"Is Migrated To Workleap\": boolean;\n \"Is Admin\": boolean;\n [DeviceIdTrait]: string;\n [TelemetryIdTrait]: string;\n \"Is Organization Creator\"?: boolean;\n \"Is Executive\"?: boolean;\n \"Is Executive - Officevibe\"?: boolean;\n \"Is Executive - LMS\"?: boolean;\n \"Is Executive - Onboarding\"?: boolean;\n \"Is Executive - Skills\"?: boolean;\n \"Is Executive - Performance\"?: boolean;\n \"Is Executive - Pingboard\"?: boolean;\n \"Is Collaborator\"?: boolean;\n \"Is Collaborator - Officevibe\"?: boolean;\n \"Is Collaborator - LMS\"?: boolean;\n \"Is Collaborator - Onboarding\"?: boolean;\n \"Is Collaborator - Skills\"?: boolean;\n \"Is Collaborator - Performance\"?: boolean;\n \"Is Collaborator - Pingboard\"?: boolean;\n \"Is Reporting Manager\"?: boolean;\n \"Is Team Manager\"?: boolean;\n \"Plan Code - Officevibe\"?: string;\n \"Plan Code - LMS\"?: string;\n \"Plan Code - Onboarding\"?: string;\n \"Plan Code - Skills\"?: string;\n \"Plan Code - Performance\"?: string;\n \"Plan Code - Pingboard\"?: string;\n}\n\n///////////////////////////\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketInstrumentationClient extends LogRocketInstrumentationPartialClient {\n /**\n * Register a listener to receive the LogRocket session id when it's available.\n * This method is the equivalent of the LogRocket.getSessionURL function but is\n * particularly useful for third party libraries that doesn't want to take a dependency\n * on `logrocket`.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n registerGetSessionUrlListener: (listener: GetLogRocketSessionUrlListener) => void;\n\n /**\n * Create the default user traits for a Workleap Platform user.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n createWorkleapPlatformDefaultUserTraits: (identification: LogRocketWorkleapPlatformIdentification) => LogRocketWorkleapPlatformUserTraits;\n}\n\nexport class LogRocketInstrumentationClientImpl implements LogRocketInstrumentationClient {\n readonly #telemetryContext?: TelemetryContext;\n\n constructor(telemetryContext?: TelemetryContext) {\n this.#telemetryContext = telemetryContext;\n }\n\n // IMPORTANT: If you update this method, make sure to update the LogRocketInstrumentationPartialClient\n // interface as well in @workleap-telemetry/core.\n registerGetSessionUrlListener(listener: GetLogRocketSessionUrlListener) {\n LogRocket.getSessionURL(listener);\n }\n\n createWorkleapPlatformDefaultUserTraits(identification: LogRocketWorkleapPlatformIdentification) {\n const {\n userId,\n organizationId,\n organizationName,\n isMigratedToWorkleap,\n isOrganizationCreator,\n isAdmin,\n isExecutive,\n isCollaborator,\n isReportingManager,\n isTeamManager,\n planCode\n } = identification;\n\n const isExecutiveInAnyProduct = Boolean(\n isExecutive?.wov ||\n isExecutive?.lms ||\n isExecutive?.onb ||\n isExecutive?.sks ||\n isExecutive?.wpm ||\n isExecutive?.pbd ||\n isExecutive?.cmp\n );\n\n const isCollaboratorInAnyProduct = Boolean(\n isCollaborator?.wov ||\n isCollaborator?.lms ||\n isCollaborator?.onb ||\n isCollaborator?.sks ||\n isCollaborator?.wpm ||\n isCollaborator?.pbd ||\n isCollaborator?.cmp\n );\n\n return {\n \"User Id\": userId,\n \"Organization Id\": organizationId,\n \"Organization Name\": organizationName,\n \"Is Migrated To Workleap\": isMigratedToWorkleap,\n \"Is Admin\": isAdmin,\n [DeviceIdTrait]: this.#telemetryContext?.deviceId ?? \"N/A\",\n [TelemetryIdTrait]: this.#telemetryContext?.telemetryId ?? \"N/A\",\n ...(isDefined(isOrganizationCreator) && { \"Is Organization Creator\": isOrganizationCreator }),\n ...(isExecutiveInAnyProduct && { \"Is Executive\": true }),\n ...(isDefined(isExecutive?.wov) && { \"Is Executive - Officevibe\": isExecutive.wov }),\n ...(isDefined(isExecutive?.lms) && { \"Is Executive - LMS\": isExecutive.lms }),\n ...(isDefined(isExecutive?.onb) && { \"Is Executive - Onboarding\": isExecutive.onb }),\n ...(isDefined(isExecutive?.sks) && { \"Is Executive - Skills\": isExecutive.sks }),\n ...(isDefined(isExecutive?.wpm) && { \"Is Executive - Performance\": isExecutive.wpm }),\n ...(isDefined(isExecutive?.pbd) && { \"Is Executive - Pingboard\": isExecutive.pbd }),\n ...(isDefined(isExecutive?.cmp) && { \"Is Executive - Compensation\": isExecutive.cmp }),\n ...(isCollaboratorInAnyProduct && { \"Is Collaborator\": isCollaboratorInAnyProduct }),\n ...(isDefined(isCollaborator?.wov) && { \"Is Collaborator - Officevibe\": isCollaborator.wov }),\n ...(isDefined(isCollaborator?.lms) && { \"Is Collaborator - LMS\": isCollaborator.lms }),\n ...(isDefined(isCollaborator?.onb) && { \"Is Collaborator - Onboarding\": isCollaborator.onb }),\n ...(isDefined(isCollaborator?.sks) && { \"Is Collaborator - Skills\": isCollaborator.sks }),\n ...(isDefined(isCollaborator?.wpm) && { \"Is Collaborator - Performance\": isCollaborator.wpm }),\n ...(isDefined(isCollaborator?.pbd) && { \"Is Collaborator - Pingboard\": isCollaborator.pbd }),\n ...(isDefined(isCollaborator?.cmp) && { \"Is Collaborator - Compensation\": isCollaborator.cmp }),\n ...(isDefined(isReportingManager) && { \"Is Reporting Manager\": isReportingManager }),\n ...(isDefined(isTeamManager) && { \"Is Team Manager\": isTeamManager }),\n ...(isDefined(planCode?.wov) && { \"Plan Code - Officevibe\": planCode.wov }),\n ...(isDefined(planCode?.lms) && { \"Plan Code - LMS\": planCode.lms }),\n ...(isDefined(planCode?.onb) && { \"Plan Code - Onboarding\": planCode.onb }),\n ...(isDefined(planCode?.sks) && { \"Plan Code - Skills\": planCode.sks }),\n ...(isDefined(planCode?.wpm) && { \"Plan Code - Performance\": planCode.wpm }),\n ...(isDefined(planCode?.pbd) && { \"Plan Code - Pingboard\": planCode.pbd }),\n ...(isDefined(planCode?.cmp) && { \"Plan Code - Compensation\": planCode.cmp })\n } satisfies LogRocketWorkleapPlatformUserTraits;\n }\n}\n"],"names":["LogRocket","isDefined","DeviceIdTrait","TelemetryIdTrait","LogRocketInstrumentationClientImpl","telemetryContext","listener","identification","userId","organizationId","organizationName","isMigratedToWorkleap","isOrganizationCreator","isAdmin","isExecutive","isCollaborator","isReportingManager","isTeamManager","planCode","isExecutiveInAnyProduct","Boolean","isCollaboratorInAnyProduct"],"mappings":";;;;;;;;AACkC;AACU;AAIrC,MAAME,gBAAgB,YAAY;AAClC,MAAMC,mBAAmB,eAAe;AAuGxC,MAAMC;IACA,iBAAiB,CAAoB;IAE9C,YAAYC,gBAAmC,CAAE;QAC7C,IAAI,CAAC,iBAAiB,GAAGA;IAC7B;IAEA,sGAAsG;IACtG,iDAAiD;IACjD,8BAA8BC,QAAwC,EAAE;QACpEN,uBAAuB,CAACM;IAC5B;IAEA,wCAAwCC,cAAuD,EAAE;QAC7F,MAAM,EACFC,MAAM,EACNC,cAAc,EACdC,gBAAgB,EAChBC,oBAAoB,EACpBC,qBAAqB,EACrBC,OAAO,EACPC,WAAW,EACXC,cAAc,EACdC,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,EACX,GAAGX;QAEJ,MAAMY,0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@@
1
- {"version":3,"file":"js/LogRocketLogger.js","sources":["webpack://@workleap/logrocket/./src/js/LogRocketLogger.ts"],"sourcesContent":["import { type Logger, type LoggerOptions, type LoggerScope, type LoggerScopeEndOptions, LogLevel, type LogOptions } from \"@workleap/logging\";\nimport LogRocket from \"logrocket\";\n\ninterface Segment {\n type: \"text\" | \"object\" | \"error\" | \"line-change\";\n value: unknown;\n options?: LogOptions;\n}\n\nfunction appendText(currentText: string, newText: string, options: { leadingSpace?: boolean } = {}) {\n const {\n leadingSpace = true\n } = options;\n\n if (currentText.length > 0) {\n return `${currentText}${leadingSpace ? \" \" : \"\"}${newText}`;\n }\n\n return newText;\n}\n\n/**\n * Formats an array of Segment objects into a list of log arguments.\n *\n * - Consecutive \"text\" segments are concatenated into a single string, separated by spaces (unless `leadingSpace` is false).\n * - Non-\"text\" segments (\"object\", \"error\", \"line-change\") are added directly to the output array.\n * - When a non-\"text\" segment is encountered, any buffered text is flushed to the output before adding the segment.\n * - At the end, any remaining buffered text is flushed.\n */\nfunction formatSegments(segments: Segment[]) {\n const logs: unknown[] = [];\n\n let textBuffer = \"\";\n\n const flushText = () => {\n if (textBuffer.length > 0) {\n logs.push(textBuffer);\n\n textBuffer = \"\";\n }\n };\n\n segments.forEach(x => {\n if (x.type === \"text\") {\n textBuffer = appendText(textBuffer, x.value as string, {\n leadingSpace: x.options?.leadingSpace\n });\n } else {\n flushText();\n\n logs.push(x.value);\n }\n });\n\n // If the last segment is text, the text buffer hasn't been flushed.\n flushText();\n\n return logs;\n}\n\ntype LogFunction = (...rest: unknown[]) => void;\ntype PendingLog = () => void;\n\n/**\n * An scope implementation for the LogRocket logger.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport class LogRocketLoggerScope implements LoggerScope {\n readonly #logLevel: LogLevel;\n readonly #label: string;\n\n #segments: Segment[] = [];\n #pendingLogs: PendingLog[] = [];\n #hasEnded: boolean = false;\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n constructor(label: string, logLevel: LogLevel) {\n this.#logLevel = logLevel;\n this.#label = label;\n }\n\n #resetSegments() {\n this.#segments = [];\n }\n\n #log(fct: LogFunction, threshold: LogLevel) {\n if (this.#segments.length > 0) {\n if (this.#logLevel <= threshold) {\n // Required closure to preserved the current log items for when they will be formatted when the scope is ended.\n const segments = this.#segments;\n\n this.#pendingLogs.push(() => {\n const formattedSegments = formatSegments(segments);\n // Since LogRocket session replay UI doesn't have a concept similar to console.group,\n // the logs of a group are indented by 4 spaces under the group label.\n formattedSegments.unshift(\" \");\n\n fct(...formattedSegments);\n });\n }\n\n this.#resetSegments();\n }\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withText(text?: string, options?: Omit<LogOptions, \"style\">) {\n if (text) {\n this.#segments.push({\n type: \"text\",\n value: text,\n options\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withError(error?: Error) {\n if (error) {\n this.#segments.push({\n type: \"error\",\n value: error\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withObject(obj?: unknown) {\n if (obj) {\n this.#segments.push({\n type: \"object\",\n value: obj\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withLineChange() {\n this.#segments.push({\n type: \"line-change\",\n value: \"\\r\\n\"\n });\n\n return this;\n }\n\n /**\n * Write a debug log. The log will be processed only if the logger LogLevel is >= debug.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n debug(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.debug);\n }\n\n /**\n * Write an information log. The log will be processed only if the logger LogLevel is >= information.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n information(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.information);\n }\n\n /**\n * Write a warning log. The log will be processed only if the logger LogLevel is >= warning.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n warning(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.warn, LogLevel.warning);\n }\n\n /**\n * Write an error log. The log will be processed only if the logger LogLevel is >= error.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n error(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.error);\n }\n\n /**\n * Write a critical log. The log will be processed only if the logger LogLevel is >= critical.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n critical(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.critical);\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n end(options: LoggerScopeEndOptions = {}) {\n const {\n dismiss = false\n } = options;\n\n if (!this.#hasEnded) {\n this.#hasEnded = true;\n\n if (!dismiss) {\n if (this.#pendingLogs.length > 0) {\n LogRocket.log(this.#label);\n\n this.#pendingLogs.forEach(x => {\n x();\n });\n\n this.#pendingLogs = [];\n }\n }\n }\n }\n}\n\n/**\n * A logger implementation for LogRocket.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport class LogRocketLogger implements Logger {\n readonly #logLevel: LogLevel;\n #segments: Segment[] = [];\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n constructor(options: LoggerOptions = {}) {\n const {\n logLevel = LogLevel.debug\n } = options;\n\n this.#logLevel = logLevel;\n }\n\n #resetSegments() {\n this.#segments = [];\n }\n\n #log(fct: LogFunction, threshold: LogLevel) {\n if (this.#segments.length > 0) {\n if (this.#logLevel <= threshold) {\n const formattedSegments = formatSegments(this.#segments);\n\n fct(...formattedSegments);\n }\n\n this.#resetSegments();\n }\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n getName() {\n return LogRocketLogger.name;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withText(text?: string, options?: Omit<LogOptions, \"style\">) {\n if (text) {\n this.#segments.push({\n type: \"text\",\n value: text,\n options\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withError(error?: Error) {\n if (error) {\n this.#segments.push({\n type: \"error\",\n value: error\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withObject(obj?: unknown) {\n if (obj) {\n this.#segments.push({\n type: \"object\",\n value: obj\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withLineChange() {\n this.#segments.push({\n type: \"line-change\",\n value: \"\\r\\n\"\n });\n\n return this;\n }\n\n /**\n * Write a debug log. The log will be processed only if the logger LogLevel is >= debug.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n debug(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.debug);\n }\n\n /**\n * Write an information log. The log will be processed only if the logger LogLevel is >= information.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n information(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.information);\n }\n\n /**\n * Write a warning log. The log will be processed only if the logger LogLevel is >= warning.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n warning(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.warn, LogLevel.warning);\n }\n\n /**\n * Write an error log. The log will be processed only if the logger LogLevel is >= error.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n error(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.error);\n }\n\n /**\n * Write a critical log. The log will be processed only if the logger LogLevel is >= critical.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n critical(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.critical);\n }\n\n /**\n * Start a new logging scope. The scope will inherit the LogLevel of the root logger.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n startScope(label: string) {\n return new LogRocketLoggerScope(label, this.#logLevel);\n }\n}\n"],"names":["LogLevel","LogRocket","appendText","currentText","newText","options","leadingSpace","formatSegments","segments","logs","textBuffer","flushText","x","LogRocketLoggerScope","label","logLevel","fct","threshold","formattedSegments","text","error","obj","log","dismiss","LogRocketLogger"],"mappings":";;;;;;;;AAA6I;AAC3G;AAQlC,SAASE,WAAWC,WAAmB,EAAEC,OAAe,EAAEC,UAAsC,CAAC,CAAC;IAC9F,MAAM,EACFC,eAAe,IAAI,EACtB,GAAGD;IAEJ,IAAIF,YAAY,MAAM,GAAG,GAAG;QACxB,OAAO,GAAGA,cAAcG,eAAe,MAAM,KAAKF,SAAS;IAC/D;IAEA,OAAOA;AACX;AAEA;;;;;;;CAOC,GACD,SAASG,eAAeC,QAAmB;IACvC,MAAMC,OAAkB,EAAE;IAE1B,IAAIC,aAAa;IAEjB,MAAMC,YAAY;QACd,IAAID,WAAW,MAAM,GAAG,GAAG;YACvBD,KAAK,IAAI,CAACC;YAEVA,aAAa;QACjB;IACJ;IAEAF,SAAS,OAAO,CAACI,CAAAA;QACb,IAAIA,EAAE,IAAI,KAAK,QAAQ;YACnBF,aAAaR,WAAWQ,YAAYE,EAAE,KAAK,EAAY;gBACnD,cAAcA,EAAE,OAAO,EAAE;YAC7B;QACJ,OAAO;YACHD;YAEAF,KAAK,IAAI,CAACG,EAAE,KAAK;QACrB;IACJ;IAEA,oEAAoE;IACpED;IAEA,OAAOF;AACX;AAKA;;;CAGC,GACM,MAAMI;IACA,SAAS,CAAW;IACpB,MAAM,CAAS;IAExB,SAAS,GAAc,EAAE,CAAC;IAC1B,YAAY,GAAiB,EAAE,CAAC;IAChC,SAAS,GAAY,MAAM;IAE3B;;KAEC,GACD,YAAYC,KAAa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N,OAAO;QACX;QAEA,OAAO,IAAI;IACf;IAEA;;;KAGC,GACD,MAAMC,GAAY,EAAE;QAChB,IAAIA,KAAK;YACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,aAAa,EAAED,cAAc;IAC3C;IAEA;;;KAGC,GACD,YAAYsB,GAAY,EAAE;QACtB,IAAIA,KAAK;YACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,aAAa,EAAED,oBAAoB;IACjD;IAEA;;;KAGC,GACD,QAAQsB,GAAY,EAAE;QAClB,IAAIA,KAAK;YACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,cAAc,EAAED,gBAAgB;IAC9C;IAEA;;;KAGC,GACD,MAAMsB,GAAY,EAAE;QAChB,IAAIA,KAAK;YACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,eAAe,EAAED,cAAc;IAC7C;IAEA;;;KAGC,GACD,SAASsB,GAAY,EAAE;QACnB,IAAIA,KAAK;YACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,eAAe,EAAED,iBAAiB;IAChD;IAEA;;;KAGC,GACD,WAAWc,KAAa,EAAE;QACtB,OAAO,IAAID,qBAAqBC,OAAO,IAAI,CAAC,SAAS;IACzD;AACJ"}
1
+ {"version":3,"file":"js/LogRocketLogger.js","sources":["../../src/js/LogRocketLogger.ts"],"sourcesContent":["import { type Logger, type LoggerOptions, type LoggerScope, type LoggerScopeEndOptions, LogLevel, type LogOptions } from \"@workleap/logging\";\nimport LogRocket from \"logrocket\";\n\ninterface Segment {\n type: \"text\" | \"object\" | \"error\" | \"line-change\";\n value: unknown;\n options?: LogOptions;\n}\n\nfunction appendText(currentText: string, newText: string, options: { leadingSpace?: boolean } = {}) {\n const {\n leadingSpace = true\n } = options;\n\n if (currentText.length > 0) {\n return `${currentText}${leadingSpace ? \" \" : \"\"}${newText}`;\n }\n\n return newText;\n}\n\n/**\n * Formats an array of Segment objects into a list of log arguments.\n *\n * - Consecutive \"text\" segments are concatenated into a single string, separated by spaces (unless `leadingSpace` is false).\n * - Non-\"text\" segments (\"object\", \"error\", \"line-change\") are added directly to the output array.\n * - When a non-\"text\" segment is encountered, any buffered text is flushed to the output before adding the segment.\n * - At the end, any remaining buffered text is flushed.\n */\nfunction formatSegments(segments: Segment[]) {\n const logs: unknown[] = [];\n\n let textBuffer = \"\";\n\n const flushText = () => {\n if (textBuffer.length > 0) {\n logs.push(textBuffer);\n\n textBuffer = \"\";\n }\n };\n\n segments.forEach(x => {\n if (x.type === \"text\") {\n textBuffer = appendText(textBuffer, x.value as string, {\n leadingSpace: x.options?.leadingSpace\n });\n } else {\n flushText();\n\n logs.push(x.value);\n }\n });\n\n // If the last segment is text, the text buffer hasn't been flushed.\n flushText();\n\n return logs;\n}\n\ntype LogFunction = (...rest: unknown[]) => void;\ntype PendingLog = () => void;\n\n/**\n * An scope implementation for the LogRocket logger.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport class LogRocketLoggerScope implements LoggerScope {\n readonly #logLevel: LogLevel;\n readonly #label: string;\n\n #segments: Segment[] = [];\n #pendingLogs: PendingLog[] = [];\n #hasEnded: boolean = false;\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n constructor(label: string, logLevel: LogLevel) {\n this.#logLevel = logLevel;\n this.#label = label;\n }\n\n #resetSegments() {\n this.#segments = [];\n }\n\n #log(fct: LogFunction, threshold: LogLevel) {\n if (this.#segments.length > 0) {\n if (this.#logLevel <= threshold) {\n // Required closure to preserved the current log items for when they will be formatted when the scope is ended.\n const segments = this.#segments;\n\n this.#pendingLogs.push(() => {\n const formattedSegments = formatSegments(segments);\n // Since LogRocket session replay UI doesn't have a concept similar to console.group,\n // the logs of a group are indented by 4 spaces under the group label.\n formattedSegments.unshift(\" \");\n\n fct(...formattedSegments);\n });\n }\n\n this.#resetSegments();\n }\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withText(text?: string, options?: Omit<LogOptions, \"style\">) {\n if (text) {\n this.#segments.push({\n type: \"text\",\n value: text,\n options\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withError(error?: Error) {\n if (error) {\n this.#segments.push({\n type: \"error\",\n value: error\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withObject(obj?: unknown) {\n if (obj) {\n this.#segments.push({\n type: \"object\",\n value: obj\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withLineChange() {\n this.#segments.push({\n type: \"line-change\",\n value: \"\\r\\n\"\n });\n\n return this;\n }\n\n /**\n * Write a debug log. The log will be processed only if the logger LogLevel is >= debug.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n debug(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.debug);\n }\n\n /**\n * Write an information log. The log will be processed only if the logger LogLevel is >= information.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n information(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.information);\n }\n\n /**\n * Write a warning log. The log will be processed only if the logger LogLevel is >= warning.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n warning(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.warn, LogLevel.warning);\n }\n\n /**\n * Write an error log. The log will be processed only if the logger LogLevel is >= error.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n error(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.error);\n }\n\n /**\n * Write a critical log. The log will be processed only if the logger LogLevel is >= critical.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n critical(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.critical);\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n end(options: LoggerScopeEndOptions = {}) {\n const {\n dismiss = false\n } = options;\n\n if (!this.#hasEnded) {\n this.#hasEnded = true;\n\n if (!dismiss) {\n if (this.#pendingLogs.length > 0) {\n LogRocket.log(this.#label);\n\n this.#pendingLogs.forEach(x => {\n x();\n });\n\n this.#pendingLogs = [];\n }\n }\n }\n }\n}\n\n/**\n * A logger implementation for LogRocket.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport class LogRocketLogger implements Logger {\n readonly #logLevel: LogLevel;\n #segments: Segment[] = [];\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n constructor(options: LoggerOptions = {}) {\n const {\n logLevel = LogLevel.debug\n } = options;\n\n this.#logLevel = logLevel;\n }\n\n #resetSegments() {\n this.#segments = [];\n }\n\n #log(fct: LogFunction, threshold: LogLevel) {\n if (this.#segments.length > 0) {\n if (this.#logLevel <= threshold) {\n const formattedSegments = formatSegments(this.#segments);\n\n fct(...formattedSegments);\n }\n\n this.#resetSegments();\n }\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n getName() {\n return LogRocketLogger.name;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withText(text?: string, options?: Omit<LogOptions, \"style\">) {\n if (text) {\n this.#segments.push({\n type: \"text\",\n value: text,\n options\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withError(error?: Error) {\n if (error) {\n this.#segments.push({\n type: \"error\",\n value: error\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withObject(obj?: unknown) {\n if (obj) {\n this.#segments.push({\n type: \"object\",\n value: obj\n });\n }\n\n return this;\n }\n\n /**\n * @see {@link https://workleap.github.io/wl-logging}\n */\n withLineChange() {\n this.#segments.push({\n type: \"line-change\",\n value: \"\\r\\n\"\n });\n\n return this;\n }\n\n /**\n * Write a debug log. The log will be processed only if the logger LogLevel is >= debug.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n debug(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.debug);\n }\n\n /**\n * Write an information log. The log will be processed only if the logger LogLevel is >= information.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n information(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.log, LogLevel.information);\n }\n\n /**\n * Write a warning log. The log will be processed only if the logger LogLevel is >= warning.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n warning(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.warn, LogLevel.warning);\n }\n\n /**\n * Write an error log. The log will be processed only if the logger LogLevel is >= error.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n error(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.error);\n }\n\n /**\n * Write a critical log. The log will be processed only if the logger LogLevel is >= critical.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n critical(log?: string) {\n if (log) {\n this.#segments.push({\n type: \"text\",\n value: log\n });\n }\n\n this.#log(LogRocket.error, LogLevel.critical);\n }\n\n /**\n * Start a new logging scope. The scope will inherit the LogLevel of the root logger.\n * @see {@link https://workleap.github.io/wl-logging}\n */\n startScope(label: string) {\n return new LogRocketLoggerScope(label, this.#logLevel);\n }\n}\n"],"names":["LogLevel","LogRocket","appendText","currentText","newText","options","leadingSpace","formatSegments","segments","logs","textBuffer","flushText","x","LogRocketLoggerScope","label","logLevel","fct","threshold","formattedSegments","text","error","obj","log","dismiss","LogRocketLogger"],"mappings":";;;;;;;;AAA6I;AAC3G;AAQlC,SAASE,WAAWC,WAAmB,EAAEC,OAAe,EAAEC,UAAsC,CAAC,CAAC;IAC9F,MAAM,EACFC,eAAe,IAAI,EACtB,GAAGD;IAEJ,IAAIF,YAAY,MAAM,GAAG,GAAG;QACxB,OAAO,GAAGA,cAAcG,eAAe,MAAM,KAAKF,SAAS;IAC/D;IAEA,OAAOA;AACX;AAEA;;;;;;;CAOC,GACD,SAASG,eAAeC,QAAmB;IACvC,MAAMC,OAAkB,EAAE;IAE1B,IAAIC,aAAa;IAEjB,MAAMC,YAAY;QACd,IAAID,WAAW,MAAM,GAAG,GAAG;YACvBD,KAAK,IAAI,CAACC;YAEVA,aAAa;QACjB;IACJ;IAEAF,SAAS,OAAO,CAACI,CAAAA;QACb,IAAIA,EAAE,IAAI,KAAK,QAAQ;YACnBF,aAAaR,WAAWQ,YAAYE,EAAE,KAAK,EAAY;gBACnD,cAAcA,EAAE,OAAO,EAAE;YAC7B;QACJ,OAAO;YACHD;YAEAF,KAAK,IAAI,CAACG,EAAE,KAAK;QACrB;IACJ;IAEA,oEAAoE;IACpED;IAEA,OAAOF;AACX;AAKA;;;CAGC,GACM,MAAMI;IACA,SAAS,CAAW;IACpB,MAAM,CAAS;IAExB,SAAS,GAAc,EAAE,CAAC;IAC1B,YAAY,GAAiB,EAAE,CAAC;IAChC,SAAS,GAAY,MAAM;IAE3B;;KAEC,GACD,YAAYC,KAAa,EAAEC,QAAkB,CAAE;QAC3C,IAAI,CAAC,SAAS,GAAGA;QACjB,IAAI,CAAC,MAAM,GAAGD;IAClB;IAEA,cAAc;QACV,IAAI,CAAC,SAAS,GAAG,EAAE;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ChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,aAAa,EAAED,cAAc;IAC3C;IAEA;;;KAGC,GACD,YAAYsB,GAAY,EAAE;QACtB,IAAIA,KAAK;YACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,aAAa,EAAED,oBAAoB;IACjD;IAEA;;;KAGC,GACD,QAAQsB,GAAY,EAAE;QAClB,IAAIA,KAAK;YACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,cAAc,EAAED,gBAAgB;IAC9C;IAEA;;;KAGC,GACD,MAAMsB,GAAY,EAAE;QAChB,IAAIA,KAAK;YACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,eAAe,EAAED,cAAc;IAC7C;IAEA;;;KAGC,GACD,SAASsB,GAAY,EAAE;QACnB,IAAIA,KAAK;YACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAChB,MAAM;gBACN,OAAOA;YACX;QACJ;QAEA,IAAI,CAAC,IAAI,CAACrB,eAAe,EAAED,iBAAiB;IAChD;IAEA;;;KAGC,GACD,WAAWc,KAAa,EAAE;QACtB,OAAO,IAAID,qBAAqBC,OAAO,IAAI,CAAC,SAAS;IACzD;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"js/NoopLogRocketInstrumentationClient.js","sources":["webpack://@workleap/logrocket/./src/js/NoopLogRocketInstrumentationClient.ts"],"sourcesContent":["import type { LogRocketInstrumentationClient, LogRocketWorkleapPlatformUserTraits } from \"./LogRocketInstrumentationClient.ts\";\n\nexport class NoopLogRocketInstrumentationClient implements LogRocketInstrumentationClient {\n createWorkleapPlatformDefaultUserTraits() {\n return {} as LogRocketWorkleapPlatformUserTraits;\n }\n\n registerGetSessionUrlListener() {}\n}\n"],"names":["NoopLogRocketInstrumentationClient"],"mappings":";;AAEO,MAAMA;IACT,0CAA0C;QACtC,OAAO,CAAC;IACZ;IAEA,gCAAgC,CAAC;AACrC"}
1
+ {"version":3,"file":"js/NoopLogRocketInstrumentationClient.js","sources":["../../src/js/NoopLogRocketInstrumentationClient.ts"],"sourcesContent":["import type { LogRocketInstrumentationClient, LogRocketWorkleapPlatformUserTraits } from \"./LogRocketInstrumentationClient.ts\";\n\nexport class NoopLogRocketInstrumentationClient implements LogRocketInstrumentationClient {\n createWorkleapPlatformDefaultUserTraits() {\n return {} as LogRocketWorkleapPlatformUserTraits;\n }\n\n registerGetSessionUrlListener() {}\n}\n"],"names":["NoopLogRocketInstrumentationClient"],"mappings":";;AAEO,MAAMA;IACT,0CAA0C;QACtC,OAAO,CAAC;IACZ;IAEA,gCAAgC,CAAC;AACrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"js/applyTransformers.js","sources":["webpack://@workleap/logrocket/./src/js/applyTransformers.ts"],"sourcesContent":["import type { RootLogger } from \"@workleap/logging\";\nimport type { LogRocketSdkOptions } from \"./logRocketTypes.ts\";\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketSdkOptionsTransformerContext {\n verbose: boolean;\n logger: RootLogger;\n}\n\n/**\n * Hook to transform the resulting LogRocket SDK options.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport type LogRocketSdkOptionsTransformer = (options: LogRocketSdkOptions, context: LogRocketSdkOptionsTransformerContext) => LogRocketSdkOptions;\n\n// The function return type is mandatory, otherwise we got an error TS4058.\nexport function applyTransformers(options: LogRocketSdkOptions, transformers: LogRocketSdkOptionsTransformer[], context: LogRocketSdkOptionsTransformerContext): LogRocketSdkOptions {\n return transformers.reduce((acc, transformer) => transformer(acc, context), options);\n}\n"],"names":["applyTransformers","options","transformers","context","acc","transformer"],"mappings":";;AAiBA,2EAA2E;AACpE,SAASA,kBAAkBC,OAA4B,EAAEC,YAA8C,EAAEC,OAA8C;IAC1J,OAAOD,aAAa,MAAM,CAAC,CAACE,KAAKC,cAAgBA,YAAYD,KAAKD,UAAUF;AAChF"}
1
+ {"version":3,"file":"js/applyTransformers.js","sources":["../../src/js/applyTransformers.ts"],"sourcesContent":["import type { RootLogger } from \"@workleap/logging\";\nimport type { LogRocketSdkOptions } from \"./logRocketTypes.ts\";\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketSdkOptionsTransformerContext {\n verbose: boolean;\n logger: RootLogger;\n}\n\n/**\n * Hook to transform the resulting LogRocket SDK options.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport type LogRocketSdkOptionsTransformer = (options: LogRocketSdkOptions, context: LogRocketSdkOptionsTransformerContext) => LogRocketSdkOptions;\n\n// The function return type is mandatory, otherwise we got an error TS4058.\nexport function applyTransformers(options: LogRocketSdkOptions, transformers: LogRocketSdkOptionsTransformer[], context: LogRocketSdkOptionsTransformerContext): LogRocketSdkOptions {\n return transformers.reduce((acc, transformer) => transformer(acc, context), options);\n}\n"],"names":["applyTransformers","options","transformers","context","acc","transformer"],"mappings":";;AAiBA,2EAA2E;AACpE,SAASA,kBAAkBC,OAA4B,EAAEC,YAA8C,EAAEC,OAA8C;IAC1J,OAAOD,aAAa,MAAM,CAAC,CAACE,KAAKC,cAAgBA,YAAYD,KAAKD,UAAUF;AAChF"}
@@ -1 +1 @@
1
- {"version":3,"file":"js/assertions.js","sources":["webpack://@workleap/logrocket/./src/js/assertions.ts"],"sourcesContent":["export function isDefined(value: unknown) {\n return typeof value !== \"undefined\" && value !== undefined;\n}\n"],"names":["isDefined","value","undefined"],"mappings":";;AAAO,SAASA,UAAUC,KAAc;IACpC,OAAO,OAAOA,UAAU,eAAeA,UAAUC;AACrD"}
1
+ {"version":3,"file":"js/assertions.js","sources":["../../src/js/assertions.ts"],"sourcesContent":["export function isDefined(value: unknown) {\n return typeof value !== \"undefined\" && value !== undefined;\n}\n"],"names":["isDefined","value","undefined"],"mappings":";;AAAO,SAASA,UAAUC,KAAc;IACpC,OAAO,OAAOA,UAAU,eAAeA,UAAUC;AACrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"js/createRequestSanitizer.js","sources":["webpack://@workleap/logrocket/./src/js/createRequestSanitizer.ts"],"sourcesContent":["import type { LogRocketRequest } from \"./logRocketTypes.ts\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type RequestSanitizerFunction = (req: LogRocketRequest) => any;\n\nexport function createRequestSanitizer(fuzzyRequestSanitizer: RequestSanitizerFunction) {\n return (req: LogRocketRequest) => {\n if (req.headers[\"Authorization\"]) {\n req.headers[\"Authorization\"] = \"**redacted**\";\n }\n\n if (req.body) {\n // Do not return the request body, which could contain sensitive information.\n req.body = \"**redacted**\";\n }\n\n return fuzzyRequestSanitizer(req);\n };\n}\n"],"names":["createRequestSanitizer","fuzzyRequestSanitizer","req"],"mappings":";;AAKO,SAASA,uBAAuBC,qBAA+C;IAClF,OAAO,CAACC;QACJ,IAAIA,IAAI,OAAO,CAAC,gBAAgB,EAAE;YAC9BA,IAAI,OAAO,CAAC,gBAAgB,GAAG;QACnC;QAEA,IAAIA,IAAI,IAAI,EAAE;YACV,6EAA6E;YAC7EA,IAAI,IAAI,GAAG;QACf;QAEA,OAAOD,sBAAsBC;IACjC;AACJ"}
1
+ {"version":3,"file":"js/createRequestSanitizer.js","sources":["../../src/js/createRequestSanitizer.ts"],"sourcesContent":["import type { LogRocketRequest } from \"./logRocketTypes.ts\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type RequestSanitizerFunction = (req: LogRocketRequest) => any;\n\nexport function createRequestSanitizer(fuzzyRequestSanitizer: RequestSanitizerFunction) {\n return (req: LogRocketRequest) => {\n if (req.headers[\"Authorization\"]) {\n req.headers[\"Authorization\"] = \"**redacted**\";\n }\n\n if (req.body) {\n // Do not return the request body, which could contain sensitive information.\n req.body = \"**redacted**\";\n }\n\n return fuzzyRequestSanitizer(req);\n };\n}\n"],"names":["createRequestSanitizer","fuzzyRequestSanitizer","req"],"mappings":";;AAKO,SAASA,uBAAuBC,qBAA+C;IAClF,OAAO,CAACC;QACJ,IAAIA,IAAI,OAAO,CAAC,gBAAgB,EAAE;YAC9BA,IAAI,OAAO,CAAC,gBAAgB,GAAG;QACnC;QAEA,IAAIA,IAAI,IAAI,EAAE;YACV,6EAA6E;YAC7EA,IAAI,IAAI,GAAG;QACf;QAEA,OAAOD,sBAAsBC;IACjC;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"js/createResponseSanitizer.js","sources":["webpack://@workleap/logrocket/./src/js/createResponseSanitizer.ts"],"sourcesContent":["import type { LogRocketResponse } from \"./logRocketTypes.ts\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ResponseSanitizerFunction = (res: LogRocketResponse) => any;\n\nexport function createResponseSanitizer(fuzzyResponseSanitizer: ResponseSanitizerFunction) {\n return (res: LogRocketResponse) => {\n if (res.body) {\n // Do not return the response body, which could contain sensitive information.\n res.body = \"**redacted**\";\n }\n\n return fuzzyResponseSanitizer(res);\n };\n}\n"],"names":["createResponseSanitizer","fuzzyResponseSanitizer","res"],"mappings":";;AAKO,SAASA,wBAAwBC,sBAAiD;IACrF,OAAO,CAACC;QACJ,IAAIA,IAAI,IAAI,EAAE;YACV,8EAA8E;YAC9EA,IAAI,IAAI,GAAG;QACf;QAEA,OAAOD,uBAAuBC;IAClC;AACJ"}
1
+ {"version":3,"file":"js/createResponseSanitizer.js","sources":["../../src/js/createResponseSanitizer.ts"],"sourcesContent":["import type { LogRocketResponse } from \"./logRocketTypes.ts\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ResponseSanitizerFunction = (res: LogRocketResponse) => any;\n\nexport function createResponseSanitizer(fuzzyResponseSanitizer: ResponseSanitizerFunction) {\n return (res: LogRocketResponse) => {\n if (res.body) {\n // Do not return the response body, which could contain sensitive information.\n res.body = \"**redacted**\";\n }\n\n return fuzzyResponseSanitizer(res);\n };\n}\n"],"names":["createResponseSanitizer","fuzzyResponseSanitizer","res"],"mappings":";;AAKO,SAASA,wBAAwBC,sBAAiD;IACrF,OAAO,CAACC;QACJ,IAAIA,IAAI,IAAI,EAAE;YACV,8EAA8E;YAC9EA,IAAI,IAAI,GAAG;QACf;QAEA,OAAOD,uBAAuBC;IAClC;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"js/createUrlSanitizer.js","sources":["webpack://@workleap/logrocket/./src/js/createUrlSanitizer.ts"],"sourcesContent":["export function createUrlSanitizer(queryParametersToRemove: string[]) {\n return (url: string) => {\n let sanitizedUrl = url;\n\n for (const x of queryParametersToRemove) {\n sanitizedUrl = sanitizedUrl.replace(new RegExp(`${x}=([^&]*)`, \"i\"), `${x}=**redacted**`);\n }\n\n return sanitizedUrl;\n };\n}\n"],"names":["createUrlSanitizer","queryParametersToRemove","url","sanitizedUrl","x","RegExp"],"mappings":";;AAAO,SAASA,mBAAmBC,uBAAiC;IAChE,OAAO,CAACC;QACJ,IAAIC,eAAeD;QAEnB,KAAK,MAAME,KAAKH,wBAAyB;YACrCE,eAAeA,aAAa,OAAO,CAAC,IAAIE,OAAO,GAAGD,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAGA,EAAE,aAAa,CAAC;QAC5F;QAEA,OAAOD;IACX;AACJ"}
1
+ {"version":3,"file":"js/createUrlSanitizer.js","sources":["../../src/js/createUrlSanitizer.ts"],"sourcesContent":["export function createUrlSanitizer(queryParametersToRemove: string[]) {\n return (url: string) => {\n let sanitizedUrl = url;\n\n for (const x of queryParametersToRemove) {\n sanitizedUrl = sanitizedUrl.replace(new RegExp(`${x}=([^&]*)`, \"i\"), `${x}=**redacted**`);\n }\n\n return sanitizedUrl;\n };\n}\n"],"names":["createUrlSanitizer","queryParametersToRemove","url","sanitizedUrl","x","RegExp"],"mappings":";;AAAO,SAASA,mBAAmBC,uBAAiC;IAChE,OAAO,CAACC;QACJ,IAAIC,eAAeD;QAEnB,KAAK,MAAME,KAAKH,wBAAyB;YACrCE,eAAeA,aAAa,OAAO,CAAC,IAAIE,OAAO,GAAGD,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAGA,EAAE,aAAa,CAAC;QAC5F;QAEA,OAAOD;IACX;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"js/index.js","sources":["webpack://@workleap/logrocket/./src/js/index.ts"],"sourcesContent":["export { createTelemetryContext, type CreateTelemetryContextOptions, type TelemetryContext } from \"@workleap-telemetry/core\";\nexport type { LogRocketSdkOptionsTransformer } from \"./applyTransformers.ts\";\nexport type { GetLogRocketSessionUrlListener, LogRocketInstrumentationClient, LogRocketWorkleapPlatformIdentification, LogRocketWorkleapPlatformUserTraits } from \"./LogRocketInstrumentationClient.ts\";\nexport { LogRocketLogger, LogRocketLoggerScope } from \"./LogRocketLogger.ts\";\nexport type * from \"./logRocketTypes.ts\";\nexport { NoopLogRocketInstrumentationClient } from \"./NoopLogRocketInstrumentationClient.ts\";\nexport { registerLogRocketInstrumentation, type RegisterLogRocketInstrumentationOptions } from \"./registerLogRocketInstrumentation.ts\";\n\n"],"names":["createTelemetryContext","LogRocketLogger","LogRocketLoggerScope","NoopLogRocketInstrumentationClient","registerLogRocketInstrumentation"],"mappings":";;;;;;;;;;;;;;AAA6H;AAGhD;AAEgB;AAC0C"}
1
+ {"version":3,"file":"js/index.js","sources":["../../src/js/index.ts"],"sourcesContent":["export { createTelemetryContext, type CreateTelemetryContextOptions, type TelemetryContext } from \"@workleap-telemetry/core\";\nexport type { LogRocketSdkOptionsTransformer } from \"./applyTransformers.ts\";\nexport type { GetLogRocketSessionUrlListener, LogRocketInstrumentationClient, LogRocketWorkleapPlatformIdentification, LogRocketWorkleapPlatformUserTraits } from \"./LogRocketInstrumentationClient.ts\";\nexport { LogRocketLogger, LogRocketLoggerScope } from \"./LogRocketLogger.ts\";\nexport type * from \"./logRocketTypes.ts\";\nexport { NoopLogRocketInstrumentationClient } from \"./NoopLogRocketInstrumentationClient.ts\";\nexport { registerLogRocketInstrumentation, type RegisterLogRocketInstrumentationOptions } from \"./registerLogRocketInstrumentation.ts\";\n\n"],"names":["createTelemetryContext","LogRocketLogger","LogRocketLoggerScope","NoopLogRocketInstrumentationClient","registerLogRocketInstrumentation"],"mappings":";;;;;;;;;;;;;;AAA6H;AAGhD;AAEgB;AAC0C"}
@@ -1 +1 @@
1
- {"version":3,"file":"js/logRocketTypes.js","sources":["webpack://@workleap/logrocket/./src/js/logRocketTypes.ts"],"sourcesContent":["import type LogRocket from \"logrocket\";\n\n// Typings are not exposed by the library.\nexport type LogRocketSdkOptions = NonNullable<Parameters<(typeof LogRocket)[\"init\"]>[1]>;\n\n// Typings are not exposed by the library, copied from the LogRocket package.\nexport interface LogRocketRequest {\n reqId: string;\n url: string;\n headers: {\n [key: string]: string | null | undefined;\n };\n body?: string;\n method: string;\n referrer?: string;\n mode?: string;\n credentials?: string;\n}\n\n// Typings are not exposed by the library, copied from the LogRocket package.\nexport interface LogRocketResponse {\n reqId: string;\n status?: number;\n headers: {\n [key: string]: string | null | undefined;\n };\n body?: string;\n method: string;\n url?: string;\n}\n"],"names":[],"mappings":";;AAmBA,6EAA6E;AAU5E"}
1
+ {"version":3,"file":"js/logRocketTypes.js","sources":["../../src/js/logRocketTypes.ts"],"sourcesContent":["import type LogRocket from \"logrocket\";\n\n// Typings are not exposed by the library.\nexport type LogRocketSdkOptions = NonNullable<Parameters<(typeof LogRocket)[\"init\"]>[1]>;\n\n// Typings are not exposed by the library, copied from the LogRocket package.\nexport interface LogRocketRequest {\n reqId: string;\n url: string;\n headers: {\n [key: string]: string | null | undefined;\n };\n body?: string;\n method: string;\n referrer?: string;\n mode?: string;\n credentials?: string;\n}\n\n// Typings are not exposed by the library, copied from the LogRocket package.\nexport interface LogRocketResponse {\n reqId: string;\n status?: number;\n headers: {\n [key: string]: string | null | undefined;\n };\n body?: string;\n method: string;\n url?: string;\n}\n"],"names":[],"mappings":";;AAmBA,6EAA6E;AAU5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"js/registerLogRocketInstrumentation.js","sources":["webpack://@workleap/logrocket/./src/js/registerLogRocketInstrumentation.ts"],"sourcesContent":["import { HasExecutedGuard, type TelemetryContext } from \"@workleap-telemetry/core\";\nimport { createCompositeLogger, type RootLogger } from \"@workleap/logging\";\nimport LogRocket from \"logrocket\";\nimport LogrocketFuzzySanitizer from \"logrocket-fuzzy-search-sanitizer\";\nimport { applyTransformers, type LogRocketSdkOptionsTransformer } from \"./applyTransformers.ts\";\nimport { createRequestSanitizer } from \"./createRequestSanitizer.ts\";\nimport { createResponseSanitizer } from \"./createResponseSanitizer.ts\";\nimport { createUrlSanitizer } from \"./createUrlSanitizer.ts\";\nimport { DeviceIdTrait, type LogRocketInstrumentationClient, LogRocketInstrumentationClientImpl, TelemetryIdTrait } from \"./LogRocketInstrumentationClient.ts\";\nimport type { LogRocketSdkOptions } from \"./logRocketTypes.ts\";\n\nconst DefaultPrivateFieldNames = [\n \"email\",\n \"personalEmail\",\n \"phoneNumber\",\n \"password\",\n \"firstName\",\n \"lastName\",\n \"givenName\",\n \"fullName\",\n \"gender\",\n \"timeZone\",\n \"birthday\"\n];\n\nconst DefaultPrivateQueryParameterNames = [\n \"token\",\n \"email\",\n \"password\"\n];\n\n///////////////////////////\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface RegisterLogRocketInstrumentationOptions {\n /**\n * A root hostname to track sessions across subdomains. Set this option to capture traffic from all subdomains under one session: https://docs.logrocket.com/reference/roothostname.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n rootHostname?: LogRocketSdkOptions[\"rootHostname\"];\n /**\n * Names of additional fields to exclude from session replays. These fields will be removed from network requests, responses using a fuzzy-matching algorithm.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n privateFieldNames?: string[];\n /**\n * Names of additional fields to exclude from session replays. These fields will be removed from query parameters using a fuzzy-matching algorithm.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n privateQueryParameterNames?: string[];\n /**\n * Context including telemetry correlation ids.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n telemetryContext?: TelemetryContext;\n /**\n * Hooks to transform the resulting LogRocket SDK options.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n transformers?: LogRocketSdkOptionsTransformer[];\n /**\n * Indicates whether or not debug information should be logged to the console.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n verbose?: boolean;\n /**\n * The logger instances that will output messages.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n loggers?: RootLogger[];\n}\n\n// The function return type is mandatory, otherwise we got an error TS4058.\nexport function getLogRocketSdkOptions(userOptions: RegisterLogRocketInstrumentationOptions, logger: RootLogger): LogRocketSdkOptions {\n const {\n rootHostname = \"workleap.com\",\n privateFieldNames = [],\n privateQueryParameterNames = [],\n verbose = false,\n transformers = []\n } = userOptions;\n\n const mergedPrivateFieldNames = DefaultPrivateFieldNames.concat(privateFieldNames);\n const mergedPrivateQueryParameterNames = DefaultPrivateQueryParameterNames.concat(privateQueryParameterNames);\n\n // The \"LogrocketFuzzySearch.setup\" code is awkward. For now, we prefer to play it safe and call it once here, then forward the sanitize functions\n // to the appropriate factories.\n // No clue why the \"setup\" method is not available. This package is shady.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const { requestSanitizer: fuzzyRequestSanitizer, responseSanitizer: fuzzyResponseSanitizer } = LogrocketFuzzySanitizer.setup(mergedPrivateFieldNames);\n\n const sdkOptions = {\n console: {\n // Prevent console logs from being visible in LogRocket session replays and leaking PII.\n // To capture logs in a session replay, use the LogRocketLogger class.\n isEnabled: false\n },\n rootHostname,\n dom: {\n textSanitizer: true,\n inputSanitizer: true\n },\n network: {\n requestSanitizer: createRequestSanitizer(fuzzyRequestSanitizer),\n responseSanitizer: createResponseSanitizer(fuzzyResponseSanitizer)\n },\n browser: {\n urlSanitizer: createUrlSanitizer(mergedPrivateQueryParameterNames)\n },\n shouldDebugLog: verbose\n } satisfies LogRocketSdkOptions;\n\n return applyTransformers(sdkOptions, transformers, {\n verbose,\n logger\n });\n}\n\n///////////////////////////\n\n// DEPRECATED: Grace period ends on January 1th 2026.\nexport const IsRegisteredVariableName = \"__WLP_LOGROCKET_INSTRUMENTATION_IS_REGISTERED__\";\nexport const RegisterGetSessionUrlFunctionName = \"__WLP_LOGROCKET_INSTRUMENTATION_REGISTER_GET_SESSION_URL_LISTENER__\";\n\n// DEPRECATED: Grace period ends on January 1th 2026.\nfunction registerDeprecatedGlobalVariables() {\n // Indicates to the host applications that logrocket has been initialized.\n // It's useful in cases where an \"add-on\", like the platform widgets needs\n // to know whether or not the host application is using LogRocket.\n // While there are ways that the host application could tell to an \"add-on\" if\n // it's using LogRocket or not, doing it this way is transparent for the consumer,\n // which is great for DX.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n globalThis[IsRegisteredVariableName] = true;\n\n // While consumers could directly call LogRocket.getSessionURL, by doing it this way,\n // it allow consumers to not take a direct dependency on the \"logrocket\" package.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n globalThis[RegisterGetSessionUrlFunctionName] = listener => {\n LogRocket.getSessionURL(listener);\n };\n}\n\n///////////////////////////\n\nlet registrationGuardInstance: HasExecutedGuard | undefined;\n\n// It's important to use a lazy singleton instead of a singleton to avoid\n// any future probleme related to HMR, tree-shaking, SSR, etc..\nfunction getRegistrationGuard() {\n if (!registrationGuardInstance) {\n registrationGuardInstance = new HasExecutedGuard();\n }\n\n return registrationGuardInstance;\n}\n\n// This function should only be used by tests.\nexport function __resetRegistrationGuard() {\n if (registrationGuardInstance) {\n registrationGuardInstance.reset();\n }\n}\n\n///////////////////////////\n\nexport class LogRocketInstrumentationRegistrator {\n register(\n appId: string,\n options: RegisterLogRocketInstrumentationOptions = {}\n ) {\n const {\n telemetryContext,\n verbose = false,\n loggers = []\n } = options;\n\n const logger = createCompositeLogger(verbose, loggers);\n const sdkOptions = getLogRocketSdkOptions(options, logger);\n\n // Session starts anonymously when LogRocket.init() is called.\n LogRocket.init(appId, sdkOptions);\n\n // Identify the user with the correlation ids.\n if (telemetryContext) {\n // LogRocket maintains the same session even if the user starts as anonymous and later becomes identified via LogRocket.identify().\n // If LogRocket.identify is called multiple times during a recording, you can search for any of the identified users in the session.\n LogRocket.identify(telemetryContext.deviceId, {\n [DeviceIdTrait]: telemetryContext.deviceId,\n [TelemetryIdTrait]: telemetryContext.telemetryId\n });\n }\n\n LogRocket.getSessionURL(url => {\n logger\n .withText(\"[logrocket] Session replay URL is now available:\")\n .withText(url)\n .debug();\n });\n\n registerDeprecatedGlobalVariables();\n\n logger.information(\"[logrocket] LogRocket instrumentation is registered.\");\n\n const client = new LogRocketInstrumentationClientImpl(telemetryContext);\n\n // The cast is to normalize the inferred return type to the \"LogRocketInstrumentationClient\" type.\n return client as LogRocketInstrumentationClient;\n }\n}\n\n/**\n * Register the LogRocket instrumentation.\n * @param appId LogRocket application id.\n * @param options LogRocket instrumentation options.\n * @returns {LogRocketInstrumentationClient} A LogRocket instrumentation client instance.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport function registerLogRocketInstrumentation(\n appId: string,\n options?: RegisterLogRocketInstrumentationOptions\n) {\n getRegistrationGuard().throw(\"[logrocket] The LogRocket instrumentation has already been registered. Did you call the \\\"registerLogRocketInstrumentation\\\" function twice?\");\n\n return new LogRocketInstrumentationRegistrator().register(appId, options);\n}\n"],"names":["HasExecutedGuard","createCompositeLogger","LogRocket","LogrocketFuzzySanitizer","applyTransformers","createRequestSanitizer","createResponseSanitizer","createUrlSanitizer","DeviceIdTrait","LogRocketInstrumentationClientImpl","TelemetryIdTrait","DefaultPrivateFieldNames","DefaultPrivateQueryParameterNames","getLogRocketSdkOptions","userOptions","logger","rootHostname","privateFieldNames","privateQueryParameterNames","verbose","transformers","mergedPrivateFieldNames","mergedPrivateQueryParameterNames","fuzzyRequestSanitizer","fuzzyResponseSanitizer","sdkOptions","IsRegisteredVariableName","RegisterGetSessionUrlFunctionName","registerDeprecatedGlobalVariables","globalThis","listener","registrationGuardInstance","getRegistrationGuard","__resetRegistrationGuard","LogRocketInstrumentationRegistrator","appId","options","telemetryContext","loggers","url","client","registerLogRocketInstrumentation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAmF;AACR;AACzC;AACqC;AACyB;AAC3B;AACE;AACV;AACkG;AAG/J,MAAMW,2BAA2B;IAC7B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAED,MAAMC,oCAAoC;IACtC;IACA;IACA;CACH;AA6CD,2EAA2E;AACpE,SAASC,uBAAuBC,WAAoD,EAAEC,MAAkB;IAC3G,MAAM,EACFC,eAAe,cAAc,EAC7BC,oBAAoB,EAAE,EACtBC,6BAA6B,EAAE,EAC/BC,UAAU,KAAK,EACfC,eAAe,EAAE,EACpB,GAAGN;IAEJ,MAAMO,0BAA0BV,yBAAyB,MAAM,CAACM;IAChE,MAAMK,mCAAmCV,kCAAkC,MAAM,CAACM;IAElF,kJAAkJ;IAClJ,gCAAgC;IAChC,0EAA0E;IAC1E,6DAA6D;IAC7D,aAAa;IACb,MAAM,EAAE,kBAAkBK,qBAAqB,EAAE,mBAAmBC,sBAAsB,EAAE,GAAGrB,sCAA6B,CAACkB;IAE7H,MAAMI,aAAa;QACf,SAAS;YACL,wFAAwF;YACxF,sEAAsE;YACtE,WAAW;QACf;QACAT;QACA,KAAK;YACD,eAAe;YACf,gBAAgB;QACpB;QACA,SAAS;YACL,kBAAkBX,sBAAsBA,CAACkB;YACzC,mBAAmBjB,uBAAuBA,CAACkB;QAC/C;QACA,SAAS;YACL,cAAcjB,kBAAkBA,CAACe;QACrC;QACA,gBAAgBH;IACpB;IAEA,OAAOf,iBAAiBA,CAACqB,YAAYL,cAAc;QAC/CD;QACAJ;IACJ;AACJ;AAEA,2BAA2B;AAE3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AK;QACd;QAEAX;QAEAb,OAAO,WAAW,CAAC;QAEnB,MAAMyB,SAAS,IAAI/B,kCAAkCA,CAAC4B;QAEtD,kGAAkG;QAClG,OAAOG;IACX;AACJ;AAEA;;;;;;CAMC,GACM,SAASC,iCACZN,KAAa,EACbC,OAAiD;IAEjDJ,uBAAuB,KAAK,CAAC;IAE7B,OAAO,IAAIE,sCAAsC,QAAQ,CAACC,OAAOC;AACrE"}
1
+ {"version":3,"file":"js/registerLogRocketInstrumentation.js","sources":["../../src/js/registerLogRocketInstrumentation.ts"],"sourcesContent":["import { HasExecutedGuard, type TelemetryContext } from \"@workleap-telemetry/core\";\nimport { createCompositeLogger, type RootLogger } from \"@workleap/logging\";\nimport LogRocket from \"logrocket\";\nimport LogrocketFuzzySanitizer from \"logrocket-fuzzy-search-sanitizer\";\nimport { applyTransformers, type LogRocketSdkOptionsTransformer } from \"./applyTransformers.ts\";\nimport { createRequestSanitizer } from \"./createRequestSanitizer.ts\";\nimport { createResponseSanitizer } from \"./createResponseSanitizer.ts\";\nimport { createUrlSanitizer } from \"./createUrlSanitizer.ts\";\nimport { DeviceIdTrait, type LogRocketInstrumentationClient, LogRocketInstrumentationClientImpl, TelemetryIdTrait } from \"./LogRocketInstrumentationClient.ts\";\nimport type { LogRocketSdkOptions } from \"./logRocketTypes.ts\";\n\nconst DefaultPrivateFieldNames = [\n \"email\",\n \"personalEmail\",\n \"phoneNumber\",\n \"password\",\n \"firstName\",\n \"lastName\",\n \"givenName\",\n \"fullName\",\n \"gender\",\n \"timeZone\",\n \"birthday\"\n];\n\nconst DefaultPrivateQueryParameterNames = [\n \"token\",\n \"email\",\n \"password\"\n];\n\n///////////////////////////\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface RegisterLogRocketInstrumentationOptions {\n /**\n * A root hostname to track sessions across subdomains. Set this option to capture traffic from all subdomains under one session: https://docs.logrocket.com/reference/roothostname.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n rootHostname?: LogRocketSdkOptions[\"rootHostname\"];\n /**\n * Names of additional fields to exclude from session replays. These fields will be removed from network requests, responses using a fuzzy-matching algorithm.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n privateFieldNames?: string[];\n /**\n * Names of additional fields to exclude from session replays. These fields will be removed from query parameters using a fuzzy-matching algorithm.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n privateQueryParameterNames?: string[];\n /**\n * Context including telemetry correlation ids.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n telemetryContext?: TelemetryContext;\n /**\n * Hooks to transform the resulting LogRocket SDK options.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n transformers?: LogRocketSdkOptionsTransformer[];\n /**\n * Indicates whether or not debug information should be logged to the console.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n verbose?: boolean;\n /**\n * The logger instances that will output messages.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\n loggers?: RootLogger[];\n}\n\n// The function return type is mandatory, otherwise we got an error TS4058.\nexport function getLogRocketSdkOptions(userOptions: RegisterLogRocketInstrumentationOptions, logger: RootLogger): LogRocketSdkOptions {\n const {\n rootHostname = \"workleap.com\",\n privateFieldNames = [],\n privateQueryParameterNames = [],\n verbose = false,\n transformers = []\n } = userOptions;\n\n const mergedPrivateFieldNames = DefaultPrivateFieldNames.concat(privateFieldNames);\n const mergedPrivateQueryParameterNames = DefaultPrivateQueryParameterNames.concat(privateQueryParameterNames);\n\n // The \"LogrocketFuzzySearch.setup\" code is awkward. For now, we prefer to play it safe and call it once here, then forward the sanitize functions\n // to the appropriate factories.\n // No clue why the \"setup\" method is not available. This package is shady.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const { requestSanitizer: fuzzyRequestSanitizer, responseSanitizer: fuzzyResponseSanitizer } = LogrocketFuzzySanitizer.setup(mergedPrivateFieldNames);\n\n const sdkOptions = {\n console: {\n // Prevent console logs from being visible in LogRocket session replays and leaking PII.\n // To capture logs in a session replay, use the LogRocketLogger class.\n isEnabled: false\n },\n rootHostname,\n dom: {\n textSanitizer: true,\n inputSanitizer: true\n },\n network: {\n requestSanitizer: createRequestSanitizer(fuzzyRequestSanitizer),\n responseSanitizer: createResponseSanitizer(fuzzyResponseSanitizer)\n },\n browser: {\n urlSanitizer: createUrlSanitizer(mergedPrivateQueryParameterNames)\n },\n shouldDebugLog: verbose\n } satisfies LogRocketSdkOptions;\n\n return applyTransformers(sdkOptions, transformers, {\n verbose,\n logger\n });\n}\n\n///////////////////////////\n\n// DEPRECATED: Grace period ends on January 1th 2026.\nexport const IsRegisteredVariableName = \"__WLP_LOGROCKET_INSTRUMENTATION_IS_REGISTERED__\";\nexport const RegisterGetSessionUrlFunctionName = \"__WLP_LOGROCKET_INSTRUMENTATION_REGISTER_GET_SESSION_URL_LISTENER__\";\n\n// DEPRECATED: Grace period ends on January 1th 2026.\nfunction registerDeprecatedGlobalVariables() {\n // Indicates to the host applications that logrocket has been initialized.\n // It's useful in cases where an \"add-on\", like the platform widgets needs\n // to know whether or not the host application is using LogRocket.\n // While there are ways that the host application could tell to an \"add-on\" if\n // it's using LogRocket or not, doing it this way is transparent for the consumer,\n // which is great for DX.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n globalThis[IsRegisteredVariableName] = true;\n\n // While consumers could directly call LogRocket.getSessionURL, by doing it this way,\n // it allow consumers to not take a direct dependency on the \"logrocket\" package.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n globalThis[RegisterGetSessionUrlFunctionName] = listener => {\n LogRocket.getSessionURL(listener);\n };\n}\n\n///////////////////////////\n\nlet registrationGuardInstance: HasExecutedGuard | undefined;\n\n// It's important to use a lazy singleton instead of a singleton to avoid\n// any future probleme related to HMR, tree-shaking, SSR, etc..\nfunction getRegistrationGuard() {\n if (!registrationGuardInstance) {\n registrationGuardInstance = new HasExecutedGuard();\n }\n\n return registrationGuardInstance;\n}\n\n// This function should only be used by tests.\nexport function __resetRegistrationGuard() {\n if (registrationGuardInstance) {\n registrationGuardInstance.reset();\n }\n}\n\n///////////////////////////\n\nexport class LogRocketInstrumentationRegistrator {\n register(\n appId: string,\n options: RegisterLogRocketInstrumentationOptions = {}\n ) {\n const {\n telemetryContext,\n verbose = false,\n loggers = []\n } = options;\n\n const logger = createCompositeLogger(verbose, loggers);\n const sdkOptions = getLogRocketSdkOptions(options, logger);\n\n // Session starts anonymously when LogRocket.init() is called.\n LogRocket.init(appId, sdkOptions);\n\n // Identify the user with the correlation ids.\n if (telemetryContext) {\n // LogRocket maintains the same session even if the user starts as anonymous and later becomes identified via LogRocket.identify().\n // If LogRocket.identify is called multiple times during a recording, you can search for any of the identified users in the session.\n LogRocket.identify(telemetryContext.deviceId, {\n [DeviceIdTrait]: telemetryContext.deviceId,\n [TelemetryIdTrait]: telemetryContext.telemetryId\n });\n }\n\n LogRocket.getSessionURL(url => {\n logger\n .withText(\"[logrocket] Session replay URL is now available:\")\n .withText(url)\n .debug();\n });\n\n registerDeprecatedGlobalVariables();\n\n logger.information(\"[logrocket] LogRocket instrumentation is registered.\");\n\n const client = new LogRocketInstrumentationClientImpl(telemetryContext);\n\n // The cast is to normalize the inferred return type to the \"LogRocketInstrumentationClient\" type.\n return client as LogRocketInstrumentationClient;\n }\n}\n\n/**\n * Register the LogRocket instrumentation.\n * @param appId LogRocket application id.\n * @param options LogRocket instrumentation options.\n * @returns {LogRocketInstrumentationClient} A LogRocket instrumentation client instance.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport function registerLogRocketInstrumentation(\n appId: string,\n options?: RegisterLogRocketInstrumentationOptions\n) {\n getRegistrationGuard().throw(\"[logrocket] The LogRocket instrumentation has already been registered. Did you call the \\\"registerLogRocketInstrumentation\\\" function twice?\");\n\n return new LogRocketInstrumentationRegistrator().register(appId, options);\n}\n"],"names":["HasExecutedGuard","createCompositeLogger","LogRocket","LogrocketFuzzySanitizer","applyTransformers","createRequestSanitizer","createResponseSanitizer","createUrlSanitizer","DeviceIdTrait","LogRocketInstrumentationClientImpl","TelemetryIdTrait","DefaultPrivateFieldNames","DefaultPrivateQueryParameterNames","getLogRocketSdkOptions","userOptions","logger","rootHostname","privateFieldNames","privateQueryParameterNames","verbose","transformers","mergedPrivateFieldNames","mergedPrivateQueryParameterNames","fuzzyRequestSanitizer","fuzzyResponseSanitizer","sdkOptions","IsRegisteredVariableName","RegisterGetSessionUrlFunctionName","registerDeprecatedGlobalVariables","globalThis","listener","registrationGuardInstance","getRegistrationGuard","__resetRegistrationGuard","LogRocketInstrumentationRegistrator","appId","options","telemetryContext","loggers","url","client","registerLogRocketInstrumentation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAmF;AACR;AACzC;AACqC;AACyB;AAC3B;AACE;AACV;AACkG;AAG/J,MAAMW,2BAA2B;IAC7B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAED,MAAMC,oCAAoC;IACtC;IACA;IACA;CACH;AA6CD,2EAA2E;AACpE,SAASC,uBAAuBC,WAAoD,EAAEC,MAAkB;IAC3G,MAAM,EACFC,eAAe,cAAc,EAC7BC,oBAAoB,EAAE,EACtBC,6BAA6B,EAAE,EAC/BC,UAAU,KAAK,EACfC,eAAe,EAAE,EACpB,GAAGN;IAEJ,MAAMO,0BAA0BV,yBAAyB,MAAM,CAACM;IAChE,MAAMK,mCAAmCV,kCAAkC,MAAM,CAACM;IAElF,kJAAkJ;IAClJ,gCAAgC;IAChC,0EAA0E;IAC1E,6DAA6D;IAC7D,aAAa;IACb,MAAM,EAAE,kBAAkBK,qBAAqB,EAAE,mBAAmBC,sBAAsB,EAAE,GAAGrB,sCAA6B,CAACkB;IAE7H,MAAMI,aAAa;QACf,SAAS;YACL,wFAAwF;YACxF,sEAAsE;YACtE,WAAW;QACf;QACAT;QACA,KAAK;YACD,eAAe;YACf,gBAAgB;QACpB;QACA,SAAS;YACL,kBAAkBX,sBAAsBA,CAACkB;YACzC,mBAA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aA,CAAC,EAAE6B,iBAAiB,QAAQ;gBAC1C,CAAC3B,gBAAgBA,CAAC,EAAE2B,iBAAiB,WAAW;YACpD;QACJ;QAEAnC,uBAAuB,CAACqC,CAAAA;YACpBxB,OACK,QAAQ,CAAC,oDACT,QAAQ,CAACwB,KACT,KAAK;QACd;QAEAX;QAEAb,OAAO,WAAW,CAAC;QAEnB,MAAMyB,SAAS,IAAI/B,kCAAkCA,CAAC4B;QAEtD,kGAAkG;QAClG,OAAOG;IACX;AACJ;AAEA;;;;;;CAMC,GACM,SAASC,iCACZN,KAAa,EACbC,OAAiD;IAEjDJ,uBAAuB,KAAK,CAAC;IAE7B,OAAO,IAAIE,sCAAsC,QAAQ,CAACC,OAAOC;AACrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"react/LogRocketInstrumentationContext.js","sources":["webpack://@workleap/logrocket/./src/react/LogRocketInstrumentationContext.tsx"],"sourcesContent":["import { createContext, type PropsWithChildren, useContext } from \"react\";\nimport type { LogRocketInstrumentationClient } from \"../js/LogRocketInstrumentationClient.ts\";\n\nconst LogRocketInstrumentationContext = createContext<LogRocketInstrumentationClient | undefined>(undefined);\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketInstrumentationProviderProps extends PropsWithChildren {\n client: LogRocketInstrumentationClient;\n}\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport function LogRocketInstrumentationProvider(props: LogRocketInstrumentationProviderProps) {\n const {\n client,\n children\n } = props;\n\n return (\n <LogRocketInstrumentationContext.Provider value={client}>\n {children}\n </LogRocketInstrumentationContext.Provider>\n );\n}\n\nexport interface UseLogRocketInstrumentationClientOptions {\n /**\n * Whether or not an exception should be thrown if the client hasn't been provided.\n */\n throwOnUndefined?: boolean;\n}\n\nexport function useLogRocketInstrumentationClient(options?: { throwOnUndefined?: true }): LogRocketInstrumentationClient;\nexport function useLogRocketInstrumentationClient(options: { throwOnUndefined: false }): LogRocketInstrumentationClient | undefined;\n\n/**\n * Retrieve the LogRocket instrumentation client.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport function useLogRocketInstrumentationClient(options: UseLogRocketInstrumentationClientOptions = {}) {\n const {\n throwOnUndefined = true\n } = options;\n\n const client = useContext(LogRocketInstrumentationContext);\n\n if (!client && throwOnUndefined) {\n throw new Error(\"[logrocket] The useLogRocketInstrumentationClient function is called before an LogRocketInstrumentationClient instance has been provided.\");\n }\n\n return client;\n}\n"],"names":["createContext","useContext","LogRocketInstrumentationContext","undefined","LogRocketInstrumentationProvider","props","client","children","useLogRocketInstrumentationClient","options","throwOnUndefined","Error"],"mappings":";;;;;;;;;AAA0E;AAG1E,MAAME,gDAAkCF,aAAaA,CAA6CG;AASlG;;CAEC,GACM,SAASC,iCAAiCC,KAA4C;IACzF,MAAM,EACFC,MAAM,EACNC,QAAQ,EACX,GAAGF;IAEJ,qBACI,IAACH,gCAAgC,QAAQ;QAAC,OAAOI;kBAC5CC;;AAGb;AAYA;;;CAGC,GACM,SAASC,kCAAkCC,UAAoD,CAAC,CAAC;IACpG,MAAM,EACFC,mBAAmB,IAAI,EAC1B,GAAGD;IAEJ,MAAMH,SAASL,UAAUA,CAACC;IAE1B,IAAI,CAACI,UAAUI,kBAAkB;QAC7B,MAAM,IAAIC,MAAM;IACpB;IAEA,OAAOL;AACX"}
1
+ {"version":3,"file":"react/LogRocketInstrumentationContext.js","sources":["../../src/react/LogRocketInstrumentationContext.tsx"],"sourcesContent":["import { createContext, type PropsWithChildren, useContext } from \"react\";\nimport type { LogRocketInstrumentationClient } from \"../js/LogRocketInstrumentationClient.ts\";\n\nconst LogRocketInstrumentationContext = createContext<LogRocketInstrumentationClient | undefined>(undefined);\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport interface LogRocketInstrumentationProviderProps extends PropsWithChildren {\n client: LogRocketInstrumentationClient;\n}\n\n/**\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport function LogRocketInstrumentationProvider(props: LogRocketInstrumentationProviderProps) {\n const {\n client,\n children\n } = props;\n\n return (\n <LogRocketInstrumentationContext.Provider value={client}>\n {children}\n </LogRocketInstrumentationContext.Provider>\n );\n}\n\nexport interface UseLogRocketInstrumentationClientOptions {\n /**\n * Whether or not an exception should be thrown if the client hasn't been provided.\n */\n throwOnUndefined?: boolean;\n}\n\nexport function useLogRocketInstrumentationClient(options?: { throwOnUndefined?: true }): LogRocketInstrumentationClient;\nexport function useLogRocketInstrumentationClient(options: { throwOnUndefined: false }): LogRocketInstrumentationClient | undefined;\n\n/**\n * Retrieve the LogRocket instrumentation client.\n * @see {@link https://workleap.github.io/wl-telemetry}\n */\nexport function useLogRocketInstrumentationClient(options: UseLogRocketInstrumentationClientOptions = {}) {\n const {\n throwOnUndefined = true\n } = options;\n\n const client = useContext(LogRocketInstrumentationContext);\n\n if (!client && throwOnUndefined) {\n throw new Error(\"[logrocket] The useLogRocketInstrumentationClient function is called before an LogRocketInstrumentationClient instance has been provided.\");\n }\n\n return client;\n}\n"],"names":["createContext","useContext","LogRocketInstrumentationContext","undefined","LogRocketInstrumentationProvider","props","client","children","useLogRocketInstrumentationClient","options","throwOnUndefined","Error"],"mappings":";;;;;;;;;AAA0E;AAG1E,MAAME,gDAAkCF,aAAaA,CAA6CG;AASlG;;CAEC,GACM,SAASC,iCAAiCC,KAA4C;IACzF,MAAM,EACFC,MAAM,EACNC,QAAQ,EACX,GAAGF;IAEJ,qBACI,IAACH,gCAAgC,QAAQ;QAAC,OAAOI;kBAC5CC;;AAGb;AAYA;;;CAGC,GACM,SAASC,kCAAkCC,UAAoD,CAAC,CAAC;IACpG,MAAM,EACFC,mBAAmB,IAAI,EAC1B,GAAGD;IAEJ,MAAMH,SAASL,UAAUA,CAACC;IAE1B,IAAI,CAACI,UAAUI,kBAAkB;QAC7B,MAAM,IAAIC,MAAM;IACpB;IAEA,OAAOL;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"react/index.js","sources":["webpack://@workleap/logrocket/./src/react/index.ts"],"sourcesContent":["export * from \"../js/index.ts\";\nexport { LogRocketInstrumentationProvider, useLogRocketInstrumentationClient, type UseLogRocketInstrumentationClientOptions } from \"./LogRocketInstrumentationContext.tsx\";\n\n"],"names":["LogRocketInstrumentationProvider","useLogRocketInstrumentationClient"],"mappings":";;;;;;AAA+B;AAC4I"}
1
+ {"version":3,"file":"react/index.js","sources":["../../src/react/index.ts"],"sourcesContent":["export * from \"../js/index.ts\";\nexport { LogRocketInstrumentationProvider, useLogRocketInstrumentationClient, type UseLogRocketInstrumentationClientOptions } from \"./LogRocketInstrumentationContext.tsx\";\n\n"],"names":["LogRocketInstrumentationProvider","useLogRocketInstrumentationClient"],"mappings":";;;;;;AAA+B;AAC4I"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@workleap/logrocket",
3
3
  "author": "Workleap",
4
- "version": "2.1.5",
4
+ "version": "2.1.7",
5
5
  "description": "A package containing utilities for LogRocket.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "CHANGELOG.md"
33
33
  ],
34
34
  "peerDependencies": {
35
- "logrocket": "^10.1.0",
35
+ "logrocket": "^10.1.1",
36
36
  "react": "^18.0.0 || ^19.0.0",
37
37
  "react-dom": "^18.0.0 || ^19.0.0"
38
38
  },
@@ -45,29 +45,29 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@workleap/logging": "^1.3.1",
48
+ "@workleap/logging": "^1.3.2",
49
49
  "logrocket-fuzzy-search-sanitizer": "0.0.2",
50
- "@workleap-telemetry/core": "1.0.4"
50
+ "@workleap-telemetry/core": "1.0.6"
51
51
  },
52
52
  "devDependencies": {
53
- "@eslint/js": "9.38.0",
54
- "@rsbuild/core": "1.5.17",
55
- "@rslib/core": "0.16.1",
56
- "@types/react": "19.2.2",
57
- "@typescript-eslint/parser": "8.46.2",
58
- "@workleap/eslint-configs": "1.0.1",
59
- "@workleap/rslib-configs": "1.1.3",
53
+ "@eslint/js": "9.39.1",
54
+ "@rsbuild/core": "1.6.14",
55
+ "@rslib/core": "0.18.4",
56
+ "@types/react": "19.2.7",
57
+ "@typescript-eslint/parser": "8.49.0",
58
+ "@workleap/eslint-configs": "1.1.7",
59
+ "@workleap/rslib-configs": "1.1.4",
60
60
  "@workleap/typescript-configs": "3.0.7",
61
- "eslint": "9.38.0",
62
- "happy-dom": "20.0.10",
61
+ "eslint": "9.39.1",
62
+ "happy-dom": "20.0.11",
63
63
  "typescript": "5.9.3",
64
- "typescript-eslint": "8.46.2",
65
- "vitest": "4.0.4"
64
+ "typescript-eslint": "8.49.0",
65
+ "vitest": "4.0.15"
66
66
  },
67
67
  "sideEffects": false,
68
68
  "scripts": {
69
69
  "build": "rslib build --config ./rslib.build.ts",
70
- "eslint": "eslint . --max-warnings=-0 --cache --cache-location node_modules/.cache/eslint",
70
+ "eslint": "eslint . --max-warnings=0 --cache --cache-location node_modules/.cache/eslint",
71
71
  "typecheck": "tsc",
72
72
  "test": "vitest --config vitest.config.ts --no-watch"
73
73
  }