@brizz/sdk 0.1.3 → 0.1.4
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/README.md +72 -7
- package/dist/index.cjs +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/preload.cjs.map +1 -1
- package/dist/preload.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -116,7 +116,8 @@ declare function emitEvent(name: string, attributes?: Record<string, string | nu
|
|
|
116
116
|
declare function getSpanExporter(): SpanExporter;
|
|
117
117
|
declare function getSpanProcessor(): SpanProcessor;
|
|
118
118
|
|
|
119
|
-
declare function
|
|
119
|
+
declare function withSessionId<F extends (this: any, ...args: any[]) => any>(sessionId: string, fn: F, thisArg?: ThisParameterType<F>): F;
|
|
120
|
+
declare function callWithSessionId<A extends unknown[], F extends (...args: A) => ReturnType<F>>(sessionId: string, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
|
|
120
121
|
|
|
121
122
|
declare function getMetricsExporter(): OTLPMetricExporter;
|
|
122
123
|
declare function getMetricsReader(): MetricReader;
|
|
@@ -134,4 +135,4 @@ declare namespace init {
|
|
|
134
135
|
export { };
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
export { Brizz, DEFAULT_PII_PATTERNS, type IAttributesMaskingRule, type IBrizzInitializeOptions, type IEventMaskingConfig, type IEventMaskingRule, type IInstrumentModules, type ILogMaskingConfig, type ILogger, type IMaskingConfig, type ISpanMaskingConfig, LogLevel, type MaskingMode, type RuntimeInfo,
|
|
138
|
+
export { Brizz, DEFAULT_PII_PATTERNS, type IAttributesMaskingRule, type IBrizzInitializeOptions, type IEventMaskingConfig, type IEventMaskingRule, type IInstrumentModules, type ILogMaskingConfig, type ILogger, type IMaskingConfig, type ISpanMaskingConfig, LogLevel, type MaskingMode, type RuntimeInfo, callWithSessionId, detectRuntime, emitEvent, getLogLevel, getMetricsExporter, getMetricsReader, getSpanExporter, getSpanProcessor, init, logger, maskAttributes, maskValue, setLogLevel, withSessionId };
|
package/dist/index.d.ts
CHANGED
|
@@ -116,7 +116,8 @@ declare function emitEvent(name: string, attributes?: Record<string, string | nu
|
|
|
116
116
|
declare function getSpanExporter(): SpanExporter;
|
|
117
117
|
declare function getSpanProcessor(): SpanProcessor;
|
|
118
118
|
|
|
119
|
-
declare function
|
|
119
|
+
declare function withSessionId<F extends (this: any, ...args: any[]) => any>(sessionId: string, fn: F, thisArg?: ThisParameterType<F>): F;
|
|
120
|
+
declare function callWithSessionId<A extends unknown[], F extends (...args: A) => ReturnType<F>>(sessionId: string, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
|
|
120
121
|
|
|
121
122
|
declare function getMetricsExporter(): OTLPMetricExporter;
|
|
122
123
|
declare function getMetricsReader(): MetricReader;
|
|
@@ -134,4 +135,4 @@ declare namespace init {
|
|
|
134
135
|
export { };
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
export { Brizz, DEFAULT_PII_PATTERNS, type IAttributesMaskingRule, type IBrizzInitializeOptions, type IEventMaskingConfig, type IEventMaskingRule, type IInstrumentModules, type ILogMaskingConfig, type ILogger, type IMaskingConfig, type ISpanMaskingConfig, LogLevel, type MaskingMode, type RuntimeInfo,
|
|
138
|
+
export { Brizz, DEFAULT_PII_PATTERNS, type IAttributesMaskingRule, type IBrizzInitializeOptions, type IEventMaskingConfig, type IEventMaskingRule, type IInstrumentModules, type ILogMaskingConfig, type ILogger, type IMaskingConfig, type ISpanMaskingConfig, LogLevel, type MaskingMode, type RuntimeInfo, callWithSessionId, detectRuntime, emitEvent, getLogLevel, getMetricsExporter, getMetricsReader, getSpanExporter, getSpanProcessor, init, logger, maskAttributes, maskValue, setLogLevel, withSessionId };
|
package/dist/index.js
CHANGED
|
@@ -1751,7 +1751,15 @@ function withProperties(properties, fn, thisArg, ...args) {
|
|
|
1751
1751
|
const newContext = context3.active().setValue(PROPERTIES_CONTEXT_KEY, properties);
|
|
1752
1752
|
return context3.with(newContext, fn, thisArg, ...args);
|
|
1753
1753
|
}
|
|
1754
|
-
function
|
|
1754
|
+
function withSessionId(sessionId, fn, thisArg) {
|
|
1755
|
+
return function wrapped(...args) {
|
|
1756
|
+
const base = context3.active();
|
|
1757
|
+
const prev = base.getValue(PROPERTIES_CONTEXT_KEY);
|
|
1758
|
+
const next = base.setValue(PROPERTIES_CONTEXT_KEY, prev ? { ...prev, [SESSION_ID]: sessionId } : { [SESSION_ID]: sessionId });
|
|
1759
|
+
return context3.with(next, fn, thisArg ?? this, ...args);
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
function callWithSessionId(sessionId, fn, thisArg, ...args) {
|
|
1755
1763
|
return withProperties({ [SESSION_ID]: sessionId }, fn, thisArg, ...args);
|
|
1756
1764
|
}
|
|
1757
1765
|
|
|
@@ -1994,7 +2002,7 @@ export {
|
|
|
1994
2002
|
DEFAULT_PII_PATTERNS,
|
|
1995
2003
|
LogLevel,
|
|
1996
2004
|
SeverityNumber2 as SeverityNumber,
|
|
1997
|
-
|
|
2005
|
+
callWithSessionId,
|
|
1998
2006
|
detectRuntime,
|
|
1999
2007
|
emitEvent,
|
|
2000
2008
|
getLogLevel,
|
|
@@ -2006,6 +2014,7 @@ export {
|
|
|
2006
2014
|
logger,
|
|
2007
2015
|
maskAttributes,
|
|
2008
2016
|
maskValue,
|
|
2009
|
-
setLogLevel
|
|
2017
|
+
setLogLevel,
|
|
2018
|
+
withSessionId
|
|
2010
2019
|
};
|
|
2011
2020
|
//# sourceMappingURL=index.js.map
|