@grafana/faro-core 1.14.1 → 1.14.2
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/dist/bundle/faro-core.iife.js +1 -1
- package/dist/bundle/types/api/ItemBuffer.d.ts +7 -0
- package/dist/bundle/types/api/apiTestHelpers.d.ts +11 -0
- package/dist/bundle/types/api/const.d.ts +3 -0
- package/dist/bundle/types/api/events/initialize.d.ts +13 -2
- package/dist/bundle/types/api/events/types.d.ts +11 -0
- package/dist/bundle/types/api/exceptions/initialize.d.ts +13 -2
- package/dist/bundle/types/api/exceptions/types.d.ts +2 -0
- package/dist/bundle/types/api/index.d.ts +3 -1
- package/dist/bundle/types/api/initialize.d.ts +3 -1
- package/dist/bundle/types/api/logs/initialize.d.ts +13 -2
- package/dist/bundle/types/api/logs/types.d.ts +3 -1
- package/dist/bundle/types/api/measurements/initialize.d.ts +13 -1
- package/dist/bundle/types/api/measurements/types.d.ts +2 -0
- package/dist/bundle/types/api/meta/initialize.d.ts +14 -2
- package/dist/bundle/types/api/types.d.ts +37 -0
- package/dist/bundle/types/api/userActionLifecycleHandler.d.ts +13 -0
- package/dist/bundle/types/config/types.d.ts +21 -12
- package/dist/bundle/types/index.d.ts +4 -4
- package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
- package/dist/bundle/types/utils/index.d.ts +2 -0
- package/dist/bundle/types/utils/reactive.d.ts +46 -0
- package/dist/bundle/types/version.d.ts +1 -1
- package/dist/cjs/api/ItemBuffer.js +27 -0
- package/dist/cjs/api/ItemBuffer.js.map +1 -0
- package/dist/cjs/api/apiTestHelpers.js +36 -0
- package/dist/cjs/api/apiTestHelpers.js.map +1 -0
- package/dist/cjs/api/const.js +7 -0
- package/dist/cjs/api/const.js.map +1 -0
- package/dist/cjs/api/events/initialize.js +15 -6
- package/dist/cjs/api/events/initialize.js.map +1 -1
- package/dist/cjs/api/events/types.js.map +1 -1
- package/dist/cjs/api/exceptions/initialize.js +51 -37
- package/dist/cjs/api/exceptions/initialize.js.map +1 -1
- package/dist/cjs/api/exceptions/types.js.map +1 -1
- package/dist/cjs/api/index.js +7 -1
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/api/initialize.js +16 -2
- package/dist/cjs/api/initialize.js.map +1 -1
- package/dist/cjs/api/logs/initialize.js +15 -6
- package/dist/cjs/api/logs/initialize.js.map +1 -1
- package/dist/cjs/api/logs/types.js.map +1 -1
- package/dist/cjs/api/measurements/initialize.js +12 -3
- package/dist/cjs/api/measurements/initialize.js.map +1 -1
- package/dist/cjs/api/measurements/types.js.map +1 -1
- package/dist/cjs/api/meta/initialize.js +2 -1
- package/dist/cjs/api/meta/initialize.js.map +1 -1
- package/dist/cjs/api/types.js.map +1 -1
- package/dist/cjs/api/userActionLifecycleHandler.js +59 -0
- package/dist/cjs/api/userActionLifecycleHandler.js.map +1 -0
- package/dist/cjs/config/types.js.map +1 -1
- package/dist/cjs/index.js +8 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/index.js +4 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/reactive.js +104 -0
- package/dist/cjs/utils/reactive.js.map +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/api/ItemBuffer.js +21 -0
- package/dist/esm/api/ItemBuffer.js.map +1 -0
- package/dist/esm/api/apiTestHelpers.js +33 -0
- package/dist/esm/api/apiTestHelpers.js.map +1 -0
- package/dist/esm/api/const.js +4 -0
- package/dist/esm/api/const.js.map +1 -0
- package/dist/esm/api/events/initialize.js +15 -7
- package/dist/esm/api/events/initialize.js.map +1 -1
- package/dist/esm/api/events/types.js.map +1 -1
- package/dist/esm/api/exceptions/initialize.js +47 -34
- package/dist/esm/api/exceptions/initialize.js.map +1 -1
- package/dist/esm/api/exceptions/types.js.map +1 -1
- package/dist/esm/api/index.js +2 -0
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/initialize.js +15 -1
- package/dist/esm/api/initialize.js.map +1 -1
- package/dist/esm/api/logs/initialize.js +12 -4
- package/dist/esm/api/logs/initialize.js.map +1 -1
- package/dist/esm/api/logs/types.js.map +1 -1
- package/dist/esm/api/measurements/initialize.js +12 -4
- package/dist/esm/api/measurements/initialize.js.map +1 -1
- package/dist/esm/api/measurements/types.js.map +1 -1
- package/dist/esm/api/meta/initialize.js +1 -1
- package/dist/esm/api/meta/initialize.js.map +1 -1
- package/dist/esm/api/types.js.map +1 -1
- package/dist/esm/api/userActionLifecycleHandler.js +43 -0
- package/dist/esm/api/userActionLifecycleHandler.js.map +1 -0
- package/dist/esm/config/types.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/reactive.js +93 -0
- package/dist/esm/utils/reactive.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/spec/core/src/api/ItemBuffer.js +27 -0
- package/dist/spec/core/src/api/ItemBuffer.js.map +1 -0
- package/dist/spec/core/src/api/apiTestHelpers.js +36 -0
- package/dist/spec/core/src/api/apiTestHelpers.js.map +1 -0
- package/dist/spec/core/src/api/const.js +7 -0
- package/dist/spec/core/src/api/const.js.map +1 -0
- package/dist/spec/core/src/api/events/initialize.js +15 -6
- package/dist/spec/core/src/api/events/initialize.js.map +1 -1
- package/dist/spec/core/src/api/events/initialize.test.js +57 -0
- package/dist/spec/core/src/api/events/initialize.test.js.map +1 -1
- package/dist/spec/core/src/api/events/types.js.map +1 -1
- package/dist/spec/core/src/api/exceptions/initialize.js +51 -37
- package/dist/spec/core/src/api/exceptions/initialize.js.map +1 -1
- package/dist/spec/core/src/api/exceptions/initialize.test.js +62 -3
- package/dist/spec/core/src/api/exceptions/initialize.test.js.map +1 -1
- package/dist/spec/core/src/api/exceptions/types.js.map +1 -1
- package/dist/spec/core/src/api/index.js +7 -1
- package/dist/spec/core/src/api/index.js.map +1 -1
- package/dist/spec/core/src/api/initialize.js +16 -2
- package/dist/spec/core/src/api/initialize.js.map +1 -1
- package/dist/spec/core/src/api/initialize.test.js +73 -0
- package/dist/spec/core/src/api/initialize.test.js.map +1 -0
- package/dist/spec/core/src/api/itemBuffer.test.js +36 -0
- package/dist/spec/core/src/api/itemBuffer.test.js.map +1 -0
- package/dist/spec/core/src/api/logs/initialize.js +15 -6
- package/dist/spec/core/src/api/logs/initialize.js.map +1 -1
- package/dist/spec/core/src/api/logs/initialize.test.js +98 -0
- package/dist/spec/core/src/api/logs/initialize.test.js.map +1 -1
- package/dist/spec/core/src/api/logs/types.js.map +1 -1
- package/dist/spec/core/src/api/measurements/initialize.js +12 -3
- package/dist/spec/core/src/api/measurements/initialize.js.map +1 -1
- package/dist/spec/core/src/api/measurements/initialize.test.js +105 -0
- package/dist/spec/core/src/api/measurements/initialize.test.js.map +1 -1
- package/dist/spec/core/src/api/measurements/types.js.map +1 -1
- package/dist/spec/core/src/api/meta/initialize.js +2 -1
- package/dist/spec/core/src/api/meta/initialize.js.map +1 -1
- package/dist/spec/core/src/api/meta/initilialize.test.js +1 -3
- package/dist/spec/core/src/api/meta/initilialize.test.js.map +1 -1
- package/dist/spec/core/src/api/types.js.map +1 -1
- package/dist/spec/core/src/api/userActionLifecycleHandler.js +59 -0
- package/dist/spec/core/src/api/userActionLifecycleHandler.js.map +1 -0
- package/dist/spec/core/src/api/userActionLifecycleHandler.test.js +152 -0
- package/dist/spec/core/src/api/userActionLifecycleHandler.test.js.map +1 -0
- package/dist/spec/core/src/config/types.js.map +1 -1
- package/dist/spec/core/src/index.js +8 -2
- package/dist/spec/core/src/index.js.map +1 -1
- package/dist/spec/core/src/utils/index.js +4 -1
- package/dist/spec/core/src/utils/index.js.map +1 -1
- package/dist/spec/core/src/utils/reactive.js +104 -0
- package/dist/spec/core/src/utils/reactive.js.map +1 -0
- package/dist/spec/core/src/utils/reactive.test.js +104 -0
- package/dist/spec/core/src/utils/reactive.test.js.map +1 -0
- package/dist/spec/core/src/version.js +1 -1
- package/dist/spec/core/src/version.js.map +1 -1
- package/dist/types/api/ItemBuffer.d.ts +7 -0
- package/dist/types/api/apiTestHelpers.d.ts +11 -0
- package/dist/types/api/const.d.ts +3 -0
- package/dist/types/api/events/initialize.d.ts +13 -2
- package/dist/types/api/events/types.d.ts +11 -0
- package/dist/types/api/exceptions/initialize.d.ts +13 -2
- package/dist/types/api/exceptions/types.d.ts +2 -0
- package/dist/types/api/index.d.ts +3 -1
- package/dist/types/api/initialize.d.ts +3 -1
- package/dist/types/api/logs/initialize.d.ts +13 -2
- package/dist/types/api/logs/types.d.ts +3 -1
- package/dist/types/api/measurements/initialize.d.ts +13 -1
- package/dist/types/api/measurements/types.d.ts +2 -0
- package/dist/types/api/meta/initialize.d.ts +14 -2
- package/dist/types/api/types.d.ts +37 -0
- package/dist/types/api/userActionLifecycleHandler.d.ts +13 -0
- package/dist/types/config/types.d.ts +21 -12
- package/dist/types/core/src/api/ItemBuffer.d.ts +7 -0
- package/dist/types/core/src/api/apiTestHelpers.d.ts +11 -0
- package/dist/types/core/src/api/const.d.ts +3 -0
- package/dist/types/core/src/api/events/initialize.d.ts +13 -2
- package/dist/types/core/src/api/events/types.d.ts +11 -0
- package/dist/types/core/src/api/exceptions/initialize.d.ts +13 -2
- package/dist/types/core/src/api/exceptions/types.d.ts +2 -0
- package/dist/types/core/src/api/index.d.ts +3 -1
- package/dist/types/core/src/api/initialize.d.ts +3 -1
- package/dist/types/core/src/api/initialize.test.d.ts +1 -0
- package/dist/types/core/src/api/itemBuffer.test.d.ts +1 -0
- package/dist/types/core/src/api/logs/initialize.d.ts +13 -2
- package/dist/types/core/src/api/logs/types.d.ts +3 -1
- package/dist/types/core/src/api/measurements/initialize.d.ts +13 -1
- package/dist/types/core/src/api/measurements/types.d.ts +2 -0
- package/dist/types/core/src/api/meta/initialize.d.ts +14 -2
- package/dist/types/core/src/api/types.d.ts +37 -0
- package/dist/types/core/src/api/userActionLifecycleHandler.d.ts +13 -0
- package/dist/types/core/src/api/userActionLifecycleHandler.test.d.ts +1 -0
- package/dist/types/core/src/config/types.d.ts +21 -12
- package/dist/types/core/src/index.d.ts +4 -4
- package/dist/types/core/src/testUtils/mockTransport.d.ts +1 -1
- package/dist/types/core/src/utils/index.d.ts +2 -0
- package/dist/types/core/src/utils/reactive.d.ts +46 -0
- package/dist/types/core/src/utils/reactive.test.d.ts +1 -0
- package/dist/types/core/src/version.d.ts +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/testUtils/mockTransport.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/reactive.d.ts +46 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/exceptions/initialize.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/exceptions/initialize.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAI1D,OAAO,EAAE,iBAAiB,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,CAAC,YAAsB,EAAE,KAA+B;IAC7E,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACvC,OAAO,iBAAiB,CAAC,YAAY,EAAE,OAAO,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["import type { Config, Patterns } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItemType } from '../../transports';\nimport type { TransportItem, Transports } from '../../transports';\nimport type { UnpatchedConsole } from '../../unpatchedConsole';\nimport {\n deepEqual,\n getCurrentTimestamp,\n isArray,\n isEmpty,\n isError,\n isNull,\n isObject,\n stringifyExternalJson,\n stringifyObjectValues,\n} from '../../utils';\nimport { timestampToIsoString } from '../../utils/date';\nimport { USER_ACTION_START_MESSAGE_TYPE } from '../const';\nimport type { ItemBuffer } from '../ItemBuffer';\nimport type { TracesAPI } from '../traces';\nimport type { ApiMessageBusMessages } from '../types';\nimport { shouldIgnoreEvent } from '../utils';\n\nimport { defaultExceptionType } from './const';\nimport type { ErrorWithIndexProperties, ExceptionEvent, ExceptionsAPI, StacktraceParser } from './types';\n\nlet stacktraceParser: StacktraceParser | undefined;\n\nexport function initializeExceptionsAPI({\n internalLogger,\n config,\n metas,\n transports,\n tracesApi,\n actionBuffer,\n getMessage,\n}: {\n unpatchedConsole: UnpatchedConsole;\n internalLogger: InternalLogger;\n config: Config;\n metas: Metas;\n transports: Transports;\n tracesApi: TracesAPI;\n actionBuffer: ItemBuffer<TransportItem>;\n getMessage: () => ApiMessageBusMessages | undefined;\n}): ExceptionsAPI {\n internalLogger.debug('Initializing exceptions API');\n\n let lastPayload: Pick<ExceptionEvent, 'type' | 'value' | 'stacktrace' | 'context'> | null = null;\n\n stacktraceParser = config.parseStacktrace ?? stacktraceParser;\n\n const changeStacktraceParser: ExceptionsAPI['changeStacktraceParser'] = (newStacktraceParser) => {\n internalLogger.debug('Changing stacktrace parser');\n\n stacktraceParser = newStacktraceParser ?? stacktraceParser;\n };\n\n const getStacktraceParser: ExceptionsAPI['getStacktraceParser'] = () => stacktraceParser;\n\n const { ignoreErrors = [] } = config;\n\n const pushError: ExceptionsAPI['pushError'] = (\n error,\n { skipDedupe, stackFrames, type, context, spanContext, timestampOverwriteMs } = {}\n ) => {\n if (isErrorIgnored(ignoreErrors, error)) {\n return;\n }\n try {\n const ctx = stringifyObjectValues({\n ...parseCause(error),\n ...(context ?? {}),\n });\n\n const item: TransportItem<ExceptionEvent> = {\n meta: metas.value,\n payload: {\n type: type || error.name || defaultExceptionType,\n value: error.message,\n timestamp: timestampOverwriteMs ? timestampToIsoString(timestampOverwriteMs) : getCurrentTimestamp(),\n trace: spanContext\n ? {\n trace_id: spanContext.traceId,\n span_id: spanContext.spanId,\n }\n : tracesApi.getTraceContext(),\n context: isEmpty(ctx) ? undefined : ctx,\n },\n type: TransportItemType.EXCEPTION,\n };\n\n stackFrames = stackFrames ?? (error.stack ? stacktraceParser?.(error).frames : undefined);\n\n if (stackFrames?.length) {\n item.payload.stacktrace = {\n frames: stackFrames,\n };\n }\n\n const testingPayload = {\n type: item.payload.type,\n value: item.payload.value,\n stackTrace: item.payload.stacktrace,\n context: item.payload.context,\n };\n\n if (!skipDedupe && config.dedupe && !isNull(lastPayload) && deepEqual(testingPayload, lastPayload)) {\n internalLogger.debug('Skipping error push because it is the same as the last one\\n', item.payload);\n\n return;\n }\n\n lastPayload = testingPayload;\n\n internalLogger.debug('Pushing exception\\n', item);\n\n const msg = getMessage();\n if (msg && msg.type === USER_ACTION_START_MESSAGE_TYPE) {\n actionBuffer.addItem(item);\n } else {\n transports.execute(item);\n }\n } catch (err) {\n internalLogger.error('Error pushing event', err);\n }\n };\n\n changeStacktraceParser(config.parseStacktrace);\n\n return {\n changeStacktraceParser,\n getStacktraceParser,\n pushError,\n };\n}\n\nfunction parseCause(error: ErrorWithIndexProperties): {} | { cause: string } {\n let cause = error.cause;\n\n if (isError(cause)) {\n cause = error.cause.toString();\n // typeof operator on null returns \"object\". This is a well-known quirk in JavaScript and is considered a bug that cannot be fixed due to backward compatibility issues.\n // MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#typeof_null\n } else if (cause !== null && (isObject(error.cause) || isArray(error.cause))) {\n cause = stringifyExternalJson(error.cause);\n } else if (cause != null) {\n cause = error.cause.toString();\n }\n\n return cause == null ? {} : { cause };\n}\n\nfunction isErrorIgnored(ignoreErrors: Patterns, error: ErrorWithIndexProperties): boolean {\n const { message, name, stack } = error;\n return shouldIgnoreEvent(ignoreErrors, message + ' ' + name + ' ' + stack);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/exceptions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type StacktraceParser = (err: ExtendedError) => Stacktrace;\n\nexport interface ExceptionStackFrame {\n filename: string;\n function: string;\n\n colno?: number;\n lineno?: number;\n\n bundleid?: string;\n}\n\nexport interface ExtendedError extends Error {\n columnNumber?: number;\n stacktrace?: Error['stack'];\n}\n\nexport interface Stacktrace {\n frames: ExceptionStackFrame[];\n}\n\nexport type ExceptionContext = Record<string, string>;\n\nexport interface ExceptionEvent {\n timestamp: string;\n type: string;\n value: string;\n\n stacktrace?: Stacktrace;\n trace?: TraceContext;\n context?: ExceptionContext;\n}\n\nexport interface PushErrorOptions {\n skipDedupe?: boolean;\n stackFrames?: ExceptionStackFrame[];\n type?: string;\n context?: ExceptionContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n timestampOverwriteMs?: number;\n}\n\n// ts type is missing the cause property\nexport type ErrorWithIndexProperties = Error & {\n cause?: any;\n};\n\nexport interface ExceptionsAPI {\n changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;\n getStacktraceParser: () => StacktraceParser | undefined;\n pushError: (value: ErrorWithIndexProperties, options?: PushErrorOptions) => void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/exceptions/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\nimport type { UserAction } from '../types';\n\nexport type StacktraceParser = (err: ExtendedError) => Stacktrace;\n\nexport interface ExceptionStackFrame {\n filename: string;\n function: string;\n\n colno?: number;\n lineno?: number;\n\n bundleid?: string;\n}\n\nexport interface ExtendedError extends Error {\n columnNumber?: number;\n stacktrace?: Error['stack'];\n}\n\nexport interface Stacktrace {\n frames: ExceptionStackFrame[];\n}\n\nexport type ExceptionContext = Record<string, string>;\n\nexport interface ExceptionEvent {\n timestamp: string;\n type: string;\n value: string;\n\n stacktrace?: Stacktrace;\n trace?: TraceContext;\n context?: ExceptionContext;\n\n action?: UserAction;\n}\n\nexport interface PushErrorOptions {\n skipDedupe?: boolean;\n stackFrames?: ExceptionStackFrame[];\n type?: string;\n context?: ExceptionContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n timestampOverwriteMs?: number;\n}\n\n// ts type is missing the cause property\nexport type ErrorWithIndexProperties = Error & {\n cause?: any;\n};\n\nexport interface ExceptionsAPI {\n changeStacktraceParser: (stacktraceParser: StacktraceParser) => void;\n getStacktraceParser: () => StacktraceParser | undefined;\n pushError: (value: ErrorWithIndexProperties, options?: PushErrorOptions) => void;\n}\n"]}
|
package/dist/esm/api/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { initializeAPI } from './initialize';
|
|
2
2
|
export { defaultExceptionType, defaultErrorArgsSerializer } from './exceptions';
|
|
3
3
|
export { defaultLogArgsSerializer } from './logs';
|
|
4
|
+
export { apiMessageBus } from './initialize';
|
|
5
|
+
export { USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE } from './const';
|
|
4
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAa7C,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAWhF,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AASlD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { initializeAPI } from './initialize';\nexport type {\n API,\n APIEvent,\n ApiMessageBusMessages,\n UserActionCancelMessage,\n UserActionEndMessage,\n UserActionStartMessage,\n UserAction,\n} from './types';\n\nexport type { EventAttributes, EventEvent, EventsAPI, PushEventOptions } from './events';\n\nexport { defaultExceptionType, defaultErrorArgsSerializer } from './exceptions';\nexport type {\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n PushErrorOptions,\n Stacktrace,\n StacktraceParser,\n} from './exceptions';\n\nexport { defaultLogArgsSerializer } from './logs';\nexport type { LogContext, LogEvent, LogArgsSerializer, LogsAPI, PushLogOptions } from './logs';\n\nexport type { MeasurementEvent, MeasurementsAPI, PushMeasurementOptions } from './measurements';\n\nexport type { MetaAPI } from './meta';\n\nexport type { OTELApi, TraceContext, TraceEvent, TracesAPI } from './traces';\n\nexport { apiMessageBus } from './initialize';\n\nexport { USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE } from './const';\n"]}
|
|
@@ -1,12 +1,26 @@
|
|
|
1
|
+
import { Observable } from '../utils';
|
|
1
2
|
import { initializeEventsAPI } from './events';
|
|
2
3
|
import { initializeExceptionsAPI } from './exceptions';
|
|
3
4
|
import { initializeLogsAPI } from './logs';
|
|
4
5
|
import { initializeMeasurementsAPI } from './measurements';
|
|
5
6
|
import { initializeMetaAPI } from './meta';
|
|
6
7
|
import { initializeTracesAPI } from './traces';
|
|
8
|
+
import { createUserActionLifecycleHandler } from './userActionLifecycleHandler';
|
|
9
|
+
export const apiMessageBus = new Observable();
|
|
7
10
|
export function initializeAPI(unpatchedConsole, internalLogger, config, metas, transports) {
|
|
8
11
|
internalLogger.debug('Initializing API');
|
|
12
|
+
const { actionBuffer, getMessage } = createUserActionLifecycleHandler({ apiMessageBus, transports, config });
|
|
9
13
|
const tracesApi = initializeTracesAPI(unpatchedConsole, internalLogger, config, metas, transports);
|
|
10
|
-
|
|
14
|
+
const props = {
|
|
15
|
+
unpatchedConsole,
|
|
16
|
+
internalLogger,
|
|
17
|
+
config,
|
|
18
|
+
metas,
|
|
19
|
+
transports,
|
|
20
|
+
tracesApi,
|
|
21
|
+
actionBuffer,
|
|
22
|
+
getMessage,
|
|
23
|
+
};
|
|
24
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, tracesApi), initializeExceptionsAPI(props)), initializeMetaAPI(props)), initializeLogsAPI(props)), initializeMeasurementsAPI(props)), initializeEventsAPI(props));
|
|
11
25
|
}
|
|
12
26
|
//# sourceMappingURL=initialize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/api/initialize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../src/api/initialize.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC;AAEhF,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,UAAU,EAAyB,CAAC;AAErE,MAAM,UAAU,aAAa,CAC3B,gBAAkC,EAClC,cAA8B,EAC9B,MAAc,EACd,KAAY,EACZ,UAAsB;IAEtB,cAAc,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAEzC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,gCAAgC,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;IAE7G,MAAM,SAAS,GAAG,mBAAmB,CAAC,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IAEnG,MAAM,KAAK,GAAG;QACZ,gBAAgB;QAChB,cAAc;QACd,MAAM;QACN,KAAK;QACL,UAAU;QACV,SAAS;QACT,YAAY;QACZ,UAAU;KACX,CAAC;IAEF,+FACK,SAAS,GACT,uBAAuB,CAAC,KAAK,CAAC,GAC9B,iBAAiB,CAAC,KAAK,CAAC,GACxB,iBAAiB,CAAC,KAAK,CAAC,GACxB,yBAAyB,CAAC,KAAK,CAAC,GAChC,mBAAmB,CAAC,KAAK,CAAC,EAC7B;AACJ,CAAC","sourcesContent":["import type { Config } from '../config';\nimport type { InternalLogger } from '../internalLogger';\nimport type { Metas } from '../metas';\nimport type { Transports } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\nimport { Observable } from '../utils';\n\nimport { initializeEventsAPI } from './events';\nimport { initializeExceptionsAPI } from './exceptions';\nimport { initializeLogsAPI } from './logs';\nimport { initializeMeasurementsAPI } from './measurements';\nimport { initializeMetaAPI } from './meta';\nimport { initializeTracesAPI } from './traces';\nimport type { API, ApiMessageBusMessages } from './types';\nimport { createUserActionLifecycleHandler } from './userActionLifecycleHandler';\n\nexport const apiMessageBus = new Observable<ApiMessageBusMessages>();\n\nexport function initializeAPI(\n unpatchedConsole: UnpatchedConsole,\n internalLogger: InternalLogger,\n config: Config,\n metas: Metas,\n transports: Transports\n): API {\n internalLogger.debug('Initializing API');\n\n const { actionBuffer, getMessage } = createUserActionLifecycleHandler({ apiMessageBus, transports, config });\n\n const tracesApi = initializeTracesAPI(unpatchedConsole, internalLogger, config, metas, transports);\n\n const props = {\n unpatchedConsole,\n internalLogger,\n config,\n metas,\n transports,\n tracesApi,\n actionBuffer,\n getMessage,\n };\n\n return {\n ...tracesApi,\n ...initializeExceptionsAPI(props),\n ...initializeMetaAPI(props),\n ...initializeLogsAPI(props),\n ...initializeMeasurementsAPI(props),\n ...initializeEventsAPI(props),\n };\n}\n"]}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { TransportItemType } from '../../transports';
|
|
2
|
-
import { deepEqual, defaultLogLevel, getCurrentTimestamp, isNull, stringifyObjectValues } from '../../utils';
|
|
2
|
+
import { deepEqual, defaultLogLevel, getCurrentTimestamp, isEmpty, isNull, stringifyObjectValues } from '../../utils';
|
|
3
3
|
import { timestampToIsoString } from '../../utils/date';
|
|
4
|
+
import { USER_ACTION_START_MESSAGE_TYPE } from '../const';
|
|
4
5
|
import { defaultLogArgsSerializer } from './const';
|
|
5
|
-
export function initializeLogsAPI(
|
|
6
|
+
export function initializeLogsAPI({ internalLogger, config, metas, transports, tracesApi, actionBuffer, getMessage, }) {
|
|
6
7
|
var _a;
|
|
7
8
|
internalLogger.debug('Initializing logs API');
|
|
8
9
|
let lastPayload = null;
|
|
9
10
|
const logArgsSerializer = (_a = config.logArgsSerializer) !== null && _a !== void 0 ? _a : defaultLogArgsSerializer;
|
|
10
11
|
const pushLog = (args, { context, level, skipDedupe, spanContext, timestampOverwriteMs } = {}) => {
|
|
11
12
|
try {
|
|
13
|
+
const ctx = stringifyObjectValues(context);
|
|
12
14
|
const item = {
|
|
13
15
|
type: TransportItemType.LOG,
|
|
14
16
|
payload: {
|
|
15
17
|
message: logArgsSerializer(args),
|
|
16
18
|
level: level !== null && level !== void 0 ? level : defaultLogLevel,
|
|
17
|
-
context:
|
|
19
|
+
context: isEmpty(ctx) ? undefined : ctx,
|
|
18
20
|
timestamp: timestampOverwriteMs ? timestampToIsoString(timestampOverwriteMs) : getCurrentTimestamp(),
|
|
19
21
|
trace: spanContext
|
|
20
22
|
? {
|
|
@@ -36,7 +38,13 @@ export function initializeLogsAPI(_unpatchedConsole, internalLogger, config, met
|
|
|
36
38
|
}
|
|
37
39
|
lastPayload = testingPayload;
|
|
38
40
|
internalLogger.debug('Pushing log\n', item);
|
|
39
|
-
|
|
41
|
+
const msg = getMessage();
|
|
42
|
+
if (msg && msg.type === USER_ACTION_START_MESSAGE_TYPE) {
|
|
43
|
+
actionBuffer.addItem(item);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
transports.execute(item);
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
49
|
catch (err) {
|
|
42
50
|
internalLogger.error('Error pushing log\n', err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/logs/initialize.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/logs/initialize.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,iBAAiB,EAAc,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,aAAa,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AE,KAAK,CAAC,KAAK;aAClB,CAAC;YAEF,MAAM,cAAc,GAAG;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;gBAC7B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;gBACzB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;aAC9B,CAAC;YAEF,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC,EAAE;gBAClG,cAAc,CAAC,KAAK,CAAC,4DAA4D,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEjG,OAAO;aACR;YAED,WAAW,GAAG,cAAc,CAAC;YAE7B,cAAc,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;YAE5C,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;YACzB,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,8BAA8B,EAAE;gBACtD,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aAC5B;iBAAM;gBACL,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aAC1B;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,cAAc,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;SAClD;IACH,CAAC,CAAC;IAEF,OAAO;QACL,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType, Transports } from '../../transports';\nimport type { UnpatchedConsole } from '../../unpatchedConsole';\nimport { deepEqual, defaultLogLevel, getCurrentTimestamp, isEmpty, isNull, stringifyObjectValues } from '../../utils';\nimport { timestampToIsoString } from '../../utils/date';\nimport { USER_ACTION_START_MESSAGE_TYPE } from '../const';\nimport type { ItemBuffer } from '../ItemBuffer';\nimport type { TracesAPI } from '../traces';\nimport type { ApiMessageBusMessages } from '../types';\n\nimport { defaultLogArgsSerializer } from './const';\nimport type { LogEvent, LogsAPI } from './types';\n\nexport function initializeLogsAPI({\n internalLogger,\n config,\n metas,\n transports,\n tracesApi,\n actionBuffer,\n getMessage,\n}: {\n unpatchedConsole: UnpatchedConsole;\n internalLogger: InternalLogger;\n config: Config;\n metas: Metas;\n transports: Transports;\n tracesApi: TracesAPI;\n actionBuffer: ItemBuffer<TransportItem>;\n getMessage: () => ApiMessageBusMessages | undefined;\n}): LogsAPI {\n internalLogger.debug('Initializing logs API');\n\n let lastPayload: Pick<LogEvent, 'message' | 'level' | 'context'> | null = null;\n\n const logArgsSerializer = config.logArgsSerializer ?? defaultLogArgsSerializer;\n\n const pushLog: LogsAPI['pushLog'] = (\n args,\n { context, level, skipDedupe, spanContext, timestampOverwriteMs } = {}\n ) => {\n try {\n const ctx = stringifyObjectValues(context);\n\n const item: TransportItem<LogEvent> = {\n type: TransportItemType.LOG,\n payload: {\n message: logArgsSerializer(args),\n level: level ?? defaultLogLevel,\n context: isEmpty(ctx) ? undefined : ctx,\n timestamp: timestampOverwriteMs ? timestampToIsoString(timestampOverwriteMs) : getCurrentTimestamp(),\n trace: spanContext\n ? {\n trace_id: spanContext.traceId,\n span_id: spanContext.spanId,\n }\n : tracesApi.getTraceContext(),\n },\n meta: metas.value,\n };\n\n const testingPayload = {\n message: item.payload.message,\n level: item.payload.level,\n context: item.payload.context,\n };\n\n if (!skipDedupe && config.dedupe && !isNull(lastPayload) && deepEqual(testingPayload, lastPayload)) {\n internalLogger.debug('Skipping log push because it is the same as the last one\\n', item.payload);\n\n return;\n }\n\n lastPayload = testingPayload;\n\n internalLogger.debug('Pushing log\\n', item);\n\n const msg = getMessage();\n if (msg && msg.type === USER_ACTION_START_MESSAGE_TYPE) {\n actionBuffer.addItem(item);\n } else {\n transports.execute(item);\n }\n } catch (err) {\n internalLogger.error('Error pushing log\\n', err);\n }\n };\n\n return {\n pushLog,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/logs/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { LogLevel } from '../../utils';\nimport type { TraceContext } from '../traces';\n\nexport type LogContext = Record<string, string>;\n\nexport interface LogEvent {\n context: LogContext;\n level: LogLevel;\n message: string;\n timestamp: string;\n\n trace?: TraceContext;\n}\n\nexport interface PushLogOptions {\n context?: LogContext;\n level?: LogLevel;\n skipDedupe?: boolean;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n timestampOverwriteMs?: number;\n}\n\nexport interface LogsAPI {\n pushLog: (args: unknown[], options?: PushLogOptions) => void;\n}\n\nexport type LogArgsSerializer = (args: unknown[]) => string;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/logs/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { LogLevel } from '../../utils';\nimport type { TraceContext } from '../traces';\nimport type { UserAction } from '../types';\n\nexport type LogContext = Record<string, string>;\n\nexport interface LogEvent {\n context: LogContext | undefined;\n level: LogLevel;\n message: string;\n timestamp: string;\n\n trace?: TraceContext;\n action?: UserAction;\n}\n\nexport interface PushLogOptions {\n context?: LogContext;\n level?: LogLevel;\n skipDedupe?: boolean;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n timestampOverwriteMs?: number;\n}\n\nexport interface LogsAPI {\n pushLog: (args: unknown[], options?: PushLogOptions) => void;\n}\n\nexport type LogArgsSerializer = (args: unknown[]) => string;\n"]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { TransportItemType } from '../../transports';
|
|
2
|
-
import { deepEqual, getCurrentTimestamp, isNull, stringifyObjectValues } from '../../utils';
|
|
2
|
+
import { deepEqual, getCurrentTimestamp, isEmpty, isNull, stringifyObjectValues } from '../../utils';
|
|
3
3
|
import { timestampToIsoString } from '../../utils/date';
|
|
4
|
-
|
|
4
|
+
import { USER_ACTION_START_MESSAGE_TYPE } from '../const';
|
|
5
|
+
export function initializeMeasurementsAPI({ internalLogger, config, metas, transports, tracesApi, actionBuffer, getMessage, }) {
|
|
5
6
|
internalLogger.debug('Initializing measurements API');
|
|
6
7
|
let lastPayload = null;
|
|
7
8
|
const pushMeasurement = (payload, { skipDedupe, context, spanContext, timestampOverwriteMs } = {}) => {
|
|
8
9
|
try {
|
|
10
|
+
const ctx = stringifyObjectValues(context);
|
|
9
11
|
const item = {
|
|
10
12
|
type: TransportItemType.MEASUREMENT,
|
|
11
13
|
payload: Object.assign(Object.assign({}, payload), { trace: spanContext
|
|
@@ -13,7 +15,7 @@ export function initializeMeasurementsAPI(_unpatchedConsole, internalLogger, con
|
|
|
13
15
|
trace_id: spanContext.traceId,
|
|
14
16
|
span_id: spanContext.spanId,
|
|
15
17
|
}
|
|
16
|
-
: tracesApi.getTraceContext(), timestamp: timestampOverwriteMs ? timestampToIsoString(timestampOverwriteMs) : getCurrentTimestamp(), context:
|
|
18
|
+
: tracesApi.getTraceContext(), timestamp: timestampOverwriteMs ? timestampToIsoString(timestampOverwriteMs) : getCurrentTimestamp(), context: isEmpty(ctx) ? undefined : ctx }),
|
|
17
19
|
meta: metas.value,
|
|
18
20
|
};
|
|
19
21
|
const testingPayload = {
|
|
@@ -27,7 +29,13 @@ export function initializeMeasurementsAPI(_unpatchedConsole, internalLogger, con
|
|
|
27
29
|
}
|
|
28
30
|
lastPayload = testingPayload;
|
|
29
31
|
internalLogger.debug('Pushing measurement\n', item);
|
|
30
|
-
|
|
32
|
+
const msg = getMessage();
|
|
33
|
+
if (msg && msg.type === USER_ACTION_START_MESSAGE_TYPE) {
|
|
34
|
+
actionBuffer.addItem(item);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
transports.execute(item);
|
|
38
|
+
}
|
|
31
39
|
}
|
|
32
40
|
catch (err) {
|
|
33
41
|
internalLogger.error('Error pushing measurement\n', err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/measurements/initialize.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGpE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/measurements/initialize.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGpE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAO1D,MAAM,UAAU,yBAAyB,CAAC,EACxC,cAAc,EACd,MAAM,EACN,KAAK,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,GAUX;IACC,cAAc,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAEtD,IAAI,WAAW,GAAiE,IAAI,CAAC;IAErF,MAAM,eAAe,GAAuC,CAC1D,OAAO,EACP,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,GAAG,EAAE,EAC/D,EAAE;QACF,IAAI;YACF,MAAM,GAAG,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;YAE3C,MAAM,IAAI,GAAoC;gBAC5C,IAAI,EAAE,iBAAiB,CAAC,WAAW;gBACnC,OAAO,kCACF,OAAO,KACV,KAAK,EAAE,WAAW;wBAChB,CAAC,CAAC;4BACE,QAAQ,EAAE,WAAW,CAAC,OAAO;4BAC7B,OAAO,EAAE,WAAW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';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Metas } from '../../metas';\nimport { TransportItem, TransportItemType } from '../../transports';\nimport type { Transports } from '../../transports';\nimport type { UnpatchedConsole } from '../../unpatchedConsole';\nimport { deepEqual, getCurrentTimestamp, isEmpty, isNull, stringifyObjectValues } from '../../utils';\nimport { timestampToIsoString } from '../../utils/date';\nimport { USER_ACTION_START_MESSAGE_TYPE } from '../const';\nimport type { ItemBuffer } from '../ItemBuffer';\nimport type { TracesAPI } from '../traces';\nimport type { ApiMessageBusMessages } from '../types';\n\nimport type { MeasurementEvent, MeasurementsAPI } from './types';\n\nexport function initializeMeasurementsAPI({\n internalLogger,\n config,\n metas,\n transports,\n tracesApi,\n actionBuffer,\n getMessage,\n}: {\n unpatchedConsole: UnpatchedConsole;\n internalLogger: InternalLogger;\n config: Config;\n metas: Metas;\n transports: Transports;\n tracesApi: TracesAPI;\n actionBuffer: ItemBuffer<TransportItem>;\n getMessage: () => ApiMessageBusMessages | undefined;\n}): MeasurementsAPI {\n internalLogger.debug('Initializing measurements API');\n\n let lastPayload: Pick<MeasurementEvent, 'type' | 'values' | 'context'> | null = null;\n\n const pushMeasurement: MeasurementsAPI['pushMeasurement'] = (\n payload,\n { skipDedupe, context, spanContext, timestampOverwriteMs } = {}\n ) => {\n try {\n const ctx = stringifyObjectValues(context);\n\n const item: TransportItem<MeasurementEvent> = {\n type: TransportItemType.MEASUREMENT,\n payload: {\n ...payload,\n trace: spanContext\n ? {\n trace_id: spanContext.traceId,\n span_id: spanContext.spanId,\n }\n : tracesApi.getTraceContext(),\n timestamp: timestampOverwriteMs ? timestampToIsoString(timestampOverwriteMs) : getCurrentTimestamp(),\n context: isEmpty(ctx) ? undefined : ctx,\n },\n meta: metas.value,\n };\n\n const testingPayload = {\n type: item.payload.type,\n values: item.payload.values,\n context: item.payload.context,\n };\n\n if (!skipDedupe && config.dedupe && !isNull(lastPayload) && deepEqual(testingPayload, lastPayload)) {\n internalLogger.debug('Skipping measurement push because it is the same as the last one\\n', item.payload);\n\n return;\n }\n\n lastPayload = testingPayload;\n\n internalLogger.debug('Pushing measurement\\n', item);\n\n const msg = getMessage();\n if (msg && msg.type === USER_ACTION_START_MESSAGE_TYPE) {\n actionBuffer.addItem(item);\n } else {\n transports.execute(item);\n }\n } catch (err) {\n internalLogger.error('Error pushing measurement\\n', err);\n }\n };\n\n return {\n pushMeasurement,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/measurements/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\n\nexport type MeasurementContext = Record<string, string>;\n\nexport interface MeasurementEvent<V extends { [label: string]: number } = { [label: string]: number }> {\n type: string;\n values: V;\n\n timestamp: string;\n trace?: TraceContext;\n context?: MeasurementContext;\n}\n\nexport interface PushMeasurementOptions {\n skipDedupe?: boolean;\n context?: MeasurementContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n timestampOverwriteMs?: number;\n}\n\nexport interface MeasurementsAPI {\n pushMeasurement: (\n payload: Omit<MeasurementEvent, 'timestamp'> & Partial<Pick<MeasurementEvent, 'timestamp'>>,\n options?: PushMeasurementOptions\n ) => void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/measurements/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanContext } from '@opentelemetry/api';\n\nimport type { TraceContext } from '../traces';\nimport type { UserAction } from '../types';\n\nexport type MeasurementContext = Record<string, string>;\n\nexport interface MeasurementEvent<V extends { [label: string]: number } = { [label: string]: number }> {\n type: string;\n values: V;\n\n timestamp: string;\n trace?: TraceContext;\n context?: MeasurementContext;\n\n action?: UserAction;\n}\n\nexport interface PushMeasurementOptions {\n skipDedupe?: boolean;\n context?: MeasurementContext;\n spanContext?: Pick<SpanContext, 'traceId' | 'spanId'>;\n timestampOverwriteMs?: number;\n}\n\nexport interface MeasurementsAPI {\n pushMeasurement: (\n payload: Omit<MeasurementEvent, 'timestamp'> & Partial<Pick<MeasurementEvent, 'timestamp'>>,\n options?: PushMeasurementOptions\n ) => void;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isEmpty, isString } from '../../utils/is';
|
|
2
|
-
export function initializeMetaAPI(
|
|
2
|
+
export function initializeMetaAPI({ internalLogger, metas, }) {
|
|
3
3
|
internalLogger.debug('Initializing meta API');
|
|
4
4
|
let metaSession = undefined;
|
|
5
5
|
let metaUser = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/meta/initialize.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../../../src/api/meta/initialize.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAOnD,MAAM,UAAU,iBAAiB,CAAC,EAChC,cAAc,EACd,KAAK,GAUN;IACC,cAAc,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAE9C,IAAI,WAAW,GAA8B,SAAS,CAAC;IACvD,IAAI,QAAQ,GAA8B,SAAS,CAAC;IACpD,IAAI,QAAQ,GAA8B,SAAS,CAAC;IACpD,IAAI,QAAQ,GAA8B,SAAS,CAAC;IAEpD,MAAM,OAAO,GAAuB,CAAC,IAAI,EAAE,EAAE;QAC3C,IAAI,QAAQ,EAAE;YACZ,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SACxB;QAED,QAAQ,GAAG;YACT,IAAI;SACL,CAAC;QAEF,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,MAAM,UAAU,GAA0B,CAAC,OAAO,EAAE,O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AC;SAC5B;IACH,CAAC,CAAC;IAEF,MAAM,OAAO,GAAuB,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;IAE3D,MAAM,OAAO,GAAuB,CAAC,IAAI,EAAE,EAAE;;QAC3C,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC7B,CAAC,iCAIM,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,mCAAI,OAAO,EAAE,CAAC,KAChC,EAAE,EAAE,IAAI,IAEZ,CAAC,CAAC,IAAI,CAAC;QAET,IAAI,QAAQ,EAAE;YACZ,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SACxB;QAED,QAAQ,GAAG;YACT,IAAI,EAAE,QAAQ;SACf,CAAC;QAEF,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,MAAM,OAAO,GAAuB,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;IAE3D,OAAO;QACL,OAAO;QACP,SAAS,EAAE,OAA+B;QAC1C,UAAU;QACV,YAAY,EAAE,UAAqC;QACnD,UAAU;QACV,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["import type { Config } from '../../config';\nimport type { InternalLogger } from '../../internalLogger';\nimport type { Meta, Metas } from '../../metas';\nimport type { TransportItem, Transports } from '../../transports';\nimport type { UnpatchedConsole } from '../../unpatchedConsole';\nimport { isEmpty, isString } from '../../utils/is';\nimport type { ItemBuffer } from '../ItemBuffer';\nimport type { TracesAPI } from '../traces';\nimport type { ApiMessageBusMessages } from '../types';\n\nimport type { MetaAPI } from './types';\n\nexport function initializeMetaAPI({\n internalLogger,\n metas,\n}: {\n unpatchedConsole: UnpatchedConsole;\n internalLogger: InternalLogger;\n config: Config;\n metas: Metas;\n transports: Transports;\n tracesApi: TracesAPI;\n actionBuffer: ItemBuffer<TransportItem>;\n getMessage: () => ApiMessageBusMessages | undefined;\n}): MetaAPI {\n internalLogger.debug('Initializing meta API');\n\n let metaSession: Partial<Meta> | undefined = undefined;\n let metaUser: Partial<Meta> | undefined = undefined;\n let metaView: Partial<Meta> | undefined = undefined;\n let metaPage: Partial<Meta> | undefined = undefined;\n\n const setUser: MetaAPI['setUser'] = (user) => {\n if (metaUser) {\n metas.remove(metaUser);\n }\n\n metaUser = {\n user,\n };\n\n metas.add(metaUser);\n };\n\n const setSession: MetaAPI['setSession'] = (session, options) => {\n const newOverrides = options?.overrides;\n const overrides = newOverrides\n ? {\n overrides: {\n ...metaSession?.session?.overrides,\n ...newOverrides,\n },\n }\n : {};\n\n if (metaSession) {\n metas.remove(metaSession);\n }\n\n metaSession = {\n session: {\n // if session is undefined, session manager force creates a new session\n ...(isEmpty(session) ? undefined : session),\n ...overrides,\n },\n };\n\n metas.add(metaSession);\n };\n\n const getSession: MetaAPI['getSession'] = () => metas.value.session;\n\n const setView: MetaAPI['setView'] = (view, options) => {\n if (options?.overrides) {\n setSession(getSession(), { overrides: options.overrides });\n }\n\n if (metaView?.view?.name === view?.name) {\n return;\n }\n\n const previousView = metaView;\n\n metaView = {\n view,\n };\n\n metas.add(metaView);\n\n if (previousView) {\n metas.remove(previousView);\n }\n };\n\n const getView: MetaAPI['getView'] = () => metas.value.view;\n\n const setPage: MetaAPI['setPage'] = (page) => {\n const pageMeta = isString(page)\n ? {\n // metaPage is available once setPage() has been called.\n // This is because page self updating metas like page need to be added as a function\n // Thus we call getPage in case metaPage is empty\n ...(metaPage?.page ?? getPage()),\n id: page,\n }\n : page;\n\n if (metaPage) {\n metas.remove(metaPage);\n }\n\n metaPage = {\n page: pageMeta,\n };\n\n metas.add(metaPage);\n };\n\n const getPage: MetaAPI['getPage'] = () => metas.value.page;\n\n return {\n setUser,\n resetUser: setUser as MetaAPI['resetUser'],\n setSession,\n resetSession: setSession as MetaAPI['resetSession'],\n getSession,\n setView,\n getView,\n setPage,\n getPage,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { EventEvent, EventsAPI } from './events';\nimport type { ExceptionEvent, ExceptionsAPI } from './exceptions';\nimport type { LogEvent, LogsAPI } from './logs';\nimport type { MeasurementEvent, MeasurementsAPI } from './measurements';\nimport type { MetaAPI } from './meta';\nimport type { TraceEvent, TracesAPI } from './traces';\n\nexport type APIEvent = LogEvent | ExceptionEvent | MeasurementEvent | TraceEvent | EventEvent;\n\nexport type API = LogsAPI & ExceptionsAPI & MeasurementsAPI & TracesAPI & MetaAPI & EventsAPI;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n USER_ACTION_CANCEL_MESSAGE_TYPE,\n USER_ACTION_END_MESSAGE_TYPE,\n USER_ACTION_START_MESSAGE_TYPE,\n} from './const';\nimport type { EventEvent, EventsAPI } from './events';\nimport type { ExceptionEvent, ExceptionsAPI } from './exceptions';\nimport type { LogEvent, LogsAPI } from './logs';\nimport type { MeasurementEvent, MeasurementsAPI } from './measurements';\nimport type { MetaAPI } from './meta';\nimport type { TraceEvent, TracesAPI } from './traces';\n\nexport type APIEvent = LogEvent | ExceptionEvent | MeasurementEvent | TraceEvent | EventEvent;\n\nexport type API = LogsAPI & ExceptionsAPI & MeasurementsAPI & TracesAPI & MetaAPI & EventsAPI;\n\nexport type ApiMessageBusMessages = UserActionStartMessage | UserActionEndMessage | UserActionCancelMessage;\n\nexport type UserActionMessageType =\n | typeof USER_ACTION_START_MESSAGE_TYPE\n | typeof USER_ACTION_END_MESSAGE_TYPE\n | typeof USER_ACTION_CANCEL_MESSAGE_TYPE;\n\nexport type UserActionStartMessage = {\n type: typeof USER_ACTION_START_MESSAGE_TYPE;\n name: string;\n startTime: number;\n\n /**\n * Unique identifier of the parent user action to which this action belongs.\n */\n parentId: string;\n};\n\nexport type UserActionEndMessage = {\n type: typeof USER_ACTION_END_MESSAGE_TYPE;\n name: string;\n startTime: number;\n endTime: number;\n duration: number;\n eventType: string;\n\n /**\n * Unique identifier for the user action. Will be undefined for messages related to child actions.\n */\n id: string;\n};\n\nexport type UserActionCancelMessage = {\n type: typeof USER_ACTION_CANCEL_MESSAGE_TYPE;\n name: string;\n\n /**\n * Unique identifier of the parent user action to which this action belongs.\n */\n parentId?: string;\n};\n\nexport type UserAction = {\n name: string;\n id?: string;\n parentId?: string;\n};\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TransportItemType } from '../transports';
|
|
2
|
+
import { USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE } from './const';
|
|
3
|
+
import { ItemBuffer } from './ItemBuffer';
|
|
4
|
+
export function createUserActionLifecycleHandler({ apiMessageBus, transports, config, }) {
|
|
5
|
+
const actionBuffer = new ItemBuffer();
|
|
6
|
+
const trackUserActionsExcludeItem = config.trackUserActionsExcludeItem;
|
|
7
|
+
let message;
|
|
8
|
+
apiMessageBus.subscribe((msg) => {
|
|
9
|
+
if (msg.type === USER_ACTION_START_MESSAGE_TYPE) {
|
|
10
|
+
message = msg;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (msg.type === USER_ACTION_END_MESSAGE_TYPE) {
|
|
14
|
+
const { id, name } = msg;
|
|
15
|
+
actionBuffer.flushBuffer((item) => {
|
|
16
|
+
if (isExcludeFromUserAction(item, trackUserActionsExcludeItem)) {
|
|
17
|
+
transports.execute(item);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const userActionItem = Object.assign(Object.assign({}, item), { payload: Object.assign(Object.assign({}, item.payload), { action: {
|
|
21
|
+
parentId: id,
|
|
22
|
+
name,
|
|
23
|
+
} }) });
|
|
24
|
+
transports.execute(userActionItem);
|
|
25
|
+
});
|
|
26
|
+
message = undefined;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (msg.type === USER_ACTION_CANCEL_MESSAGE_TYPE) {
|
|
30
|
+
message = undefined;
|
|
31
|
+
actionBuffer.flushBuffer((item) => {
|
|
32
|
+
transports.execute(item);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const getMessage = () => message;
|
|
37
|
+
return { actionBuffer, getMessage };
|
|
38
|
+
}
|
|
39
|
+
function isExcludeFromUserAction(item, trackUserActionsExcludeItem) {
|
|
40
|
+
return ((trackUserActionsExcludeItem === null || trackUserActionsExcludeItem === void 0 ? void 0 : trackUserActionsExcludeItem(item)) ||
|
|
41
|
+
(item.type === TransportItemType.MEASUREMENT && item.payload.type === 'web-vitals'));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=userActionLifecycleHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userActionLifecycleHandler.js","sourceRoot":"","sources":["../../../src/api/userActionLifecycleHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,iBAAiB,EAAmB,MAAM,eAAe,CAAC;AAGvF,OAAO,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AACxH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,MAAM,UAAU,gCAAgC,CAAC,EAC/C,aAAa,EACb,UAAU,EACV,MAAM,GAKP;IACC,MAAM,YAAY,GAAG,IAAI,UAAU,EAAiB,CAAC;IACrD,MAAM,2BAA2B,GAAG,MAAM,CAAC,2BAA2B,CAAC;IACvE,IAAI,OAA0C,CAAC;IAE/C,aAAa,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE;QAC9B,IAAI,GAAG,CAAC,IAAI,KAAK,8BAA8B,EAAE;YAC/C,OAAO,GAAG,GAAG,CAAC;YACd,OAAO;SACR;QAED,IAAI,GAAG,CAAC,IAAI,KAAK,4BAA4B,EAAE;YAC7C,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;YAEzB,YAAY,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;gBAChC,IAAI,uBAAuB,CAAC,IAAI,EAAE,2BAA2B,CAAC,EAAE;oBAC9D,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;oBACzB,OAAO;iBACR;gBAED,MAAM,cAAc,GAAG,gCAClB,IAAI,KACP,OAAO,kCACF,IAAI,CAAC,OAAO,KACf,MAAM,EAAE;4BACN,QAAQ,EAAE,EAAE;4BACZ,IAAI;yBACL,MAEa,CAAC;gBAEnB,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC;YAEH,OAAO,GAAG,SAAS,CAAC;YACpB,OAAO;SACR;QAED,IAAI,GAAG,CAAC,IAAI,KAAK,+BAA+B,EAAE;YAChD,OAAO,GAAG,SAAS,CAAC;YACpB,YAAY,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;gBAChC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,GAAmB,EAAE,CAAC,OAAO,CAAC;IACjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,uBAAuB,CAC9B,IAA6B,EAC7B,2BAAkE;IAElE,OAAO,CACL,CAAA,2BAA2B,aAA3B,2BAA2B,uBAA3B,2BAA2B,CAAG,IAAI,CAAC;QACnC,CAAC,IAAI,CAAC,IAAI,KAAK,iBAAiB,CAAC,WAAW,IAAK,IAAI,CAAC,OAA4B,CAAC,IAAI,KAAK,YAAY,CAAC,CAC1G,CAAC;AACJ,CAAC","sourcesContent":["import type { Config } from '../config';\nimport { type TransportItem, TransportItemType, type Transports } from '../transports';\nimport type { Observable } from '../utils';\n\nimport { USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE } from './const';\nimport { ItemBuffer } from './ItemBuffer';\nimport type { MeasurementEvent } from './measurements';\nimport type { APIEvent, ApiMessageBusMessages } from './types';\n\nexport function createUserActionLifecycleHandler({\n apiMessageBus,\n transports,\n config,\n}: {\n apiMessageBus: Observable<ApiMessageBusMessages>;\n transports: Transports;\n config: Config;\n}) {\n const actionBuffer = new ItemBuffer<TransportItem>();\n const trackUserActionsExcludeItem = config.trackUserActionsExcludeItem;\n let message: ApiMessageBusMessages | undefined;\n\n apiMessageBus.subscribe((msg) => {\n if (msg.type === USER_ACTION_START_MESSAGE_TYPE) {\n message = msg;\n return;\n }\n\n if (msg.type === USER_ACTION_END_MESSAGE_TYPE) {\n const { id, name } = msg;\n\n actionBuffer.flushBuffer((item) => {\n if (isExcludeFromUserAction(item, trackUserActionsExcludeItem)) {\n transports.execute(item);\n return;\n }\n\n const userActionItem = {\n ...item,\n payload: {\n ...item.payload,\n action: {\n parentId: id,\n name,\n },\n },\n } as TransportItem;\n\n transports.execute(userActionItem);\n });\n\n message = undefined;\n return;\n }\n\n if (msg.type === USER_ACTION_CANCEL_MESSAGE_TYPE) {\n message = undefined;\n actionBuffer.flushBuffer((item) => {\n transports.execute(item);\n });\n }\n });\n\n const getMessage = (): typeof message => message;\n return { actionBuffer, getMessage };\n}\n\nfunction isExcludeFromUserAction(\n item: TransportItem<APIEvent>,\n trackUserActionsExcludeItem: Config['trackUserActionsExcludeItem']\n) {\n return (\n trackUserActionsExcludeItem?.(item) ||\n (item.type === TransportItemType.MEASUREMENT && (item.payload as MeasurementEvent).type === 'web-vitals')\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { APIEvent, LogArgsSerializer, StacktraceParser } from '../api';\nimport type { Instrumentation } from '../instrumentations';\nimport type { InternalLoggerLevel } from '../internalLogger';\nimport type { Meta, MetaApp, MetaItem, MetaPage, MetaSession, MetaUser, MetaView } from '../metas';\nimport type { BatchExecutorOptions, BeforeSendHook, Transport } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\nimport type { LogLevel } from '../utils';\n\ntype SamplingContext = {\n metas: Meta;\n};\n\nexport interface Config<P = APIEvent> {\n /**\n * Application metadata\n */\n app: MetaApp;\n\n /**\n * Set max number and max interval for signals to be batched before sending\n */\n batching?: BatchExecutorOptions;\n\n /**\n * A flag for toggling deduplication for signals\n */\n dedupe: boolean;\n\n /**\n * The key (name) to use for the global Faro object (default: 'faro')\n */\n globalObjectKey: string;\n\n /**\n * The (custom) instrumentations to use with Faro\n */\n instrumentations: Instrumentation[];\n\n /**\n * The level of information printed to console for internal messages (default: LogLevel.ERROR)\n */\n internalLoggerLevel: InternalLoggerLevel;\n\n /**\n * Isolate Faro instance from other Faro instances on the same page. (default: false)\n */\n isolate: boolean;\n\n /**\n * Custom function to serialize log arguments\n */\n logArgsSerializer?: LogArgsSerializer;\n\n /**\n * Add custom Metas during Faro initialization\n */\n metas: MetaItem[];\n\n /**\n * Custom function used to parse stack traces\n */\n parseStacktrace: StacktraceParser;\n\n /**\n * Pause sending data (default: false)\n */\n paused: boolean;\n\n /**\n * Prevent Faro from exposing itself to the global object (default: false)\n */\n preventGlobalExposure: boolean;\n\n /**\n * The transports to use for sending beacons\n */\n transports: Transport[];\n\n /**\n * Some instrumentations might override the default console methods but Faro instance provides a\n * way to access the unmodified console methods.\n *\n * faro.unpatchedConsole.log('This is a log');\n * faro.unpatchedConsole.warn('This is a warning');\n */\n unpatchedConsole: UnpatchedConsole;\n\n /**\n * Function which invoked before pushing event to transport. Can be used to modify or filter events\n */\n beforeSend?: BeforeSendHook<P>;\n\n /**\n * Error message patterns for errors that should be ignored\n */\n ignoreErrors?: Patterns;\n\n /**\n * Path patterns for Endpoints that should be ignored form being tracked\n */\n ignoreUrls?: Patterns;\n\n /**\n * Configuration for the built in session tracker\n */\n sessionTracking?: {\n /**\n * Enable session tracking (default: true)\n */\n enabled?: boolean;\n /**\n * Wether to use sticky sessions (default: false)\n */\n persistent?: boolean;\n /**\n * Session metadata object to be used when initializing session tracking\n */\n session?: MetaSession;\n /**\n * How long is a sticky session valid for recurring users (default: 15 minutes)\n */\n maxSessionPersistenceTime?: number;\n /**\n * Called each time a session changes. This can be when a new session is created or when an existing session is updated.\n * @param oldSession\n * @param newSession\n */\n onSessionChange?: (oldSession: MetaSession | null, newSession: MetaSession) => void;\n /**\n * Then sampling rate for the session based sampler (default: 1). If a session is not part of a sample, no signals for this session are tracked.\n */\n samplingRate?: number;\n /**\n * Custom sampler function if custom sampling logic is needed.\n * @param context\n */\n sampler?: (context: SamplingContext) => number;\n /**\n * Custom function to generate session id. If available Faro uses this function instead of the internal one.\n */\n generateSessionId?: () => string;\n };\n\n /**\n * Meta object for user data\n */\n user?: MetaUser;\n\n /**\n * Meta object for view data\n */\n view?: MetaView;\n\n eventDomain?: string;\n\n /**\n * Only resource timings for fetch and xhr requests are tracked by default. Set this to true to track all resources (default: false).\n */\n trackResources?: boolean;\n\n /**\n * Track web vitals attribution data (default: false)\n */\n trackWebVitalsAttribution?: boolean;\n\n /**\n * Configuration for the web vitals instrumentation\n */\n webVitalsInstrumentation?: {\n /**\n * Report all changes for web vitals (default: false)\n *\n * In most cases, you only want the callback function to be called when the metric is ready to be reported.\n * However, it is possible to report every change (e.g. each larger layout shift as it happens)\n * by setting reportAllChanges to true.\n *\n * This can be useful when debugging, but in general using reportAllChanges is not needed (or recommended)\n * for measuring these metrics in production.\n */\n reportAllChanges?: boolean;\n };\n\n /**\n * Configuration for the console instrumentation\n */\n consoleInstrumentation?: {\n /**\n * Configure what console levels should be captured by Faro. By default the following levels\n * are disabled: console.debug, console.trace, console.log\n *\n * If you want to collect all levels set captureConsoleDisabledLevels: [];\n * If you want to disable only some levels set captureConsoleDisabledLevels: [LogLevel.DEBUG, LogLevel.TRACE];\n */\n disabledLevels?: LogLevel[];\n /*\n * By default, Faro sends an error for console.error calls. If you want to send a log instead, set this to true.\n */\n consoleErrorAsLog?: boolean;\n\n /**\n * If true, use the default Faro error serializer for console.error calls. If false, simply call toString() on the error arguments.\n * If enabled, payloads containing serialized errors may become very large. If left disabled, some error details may be lost.\n * (default: false)\n */\n serializeErrors?: boolean;\n\n /**\n * Custom function to serialize Error arguments\n */\n errorSerializer?: LogArgsSerializer;\n };\n\n /**\n * Configuration for the page tracking\n */\n pageTracking?: {\n /**\n * The page meta for initial page settings\n */\n page?: MetaPage;\n\n /**\n * Allows to provide a template for the page id\n */\n generatePageId?: (location: Location) => string;\n };\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { APIEvent, LogArgsSerializer, StacktraceParser } from '../api';\nimport type { Instrumentation } from '../instrumentations';\nimport type { InternalLoggerLevel } from '../internalLogger';\nimport type { Meta, MetaApp, MetaItem, MetaPage, MetaSession, MetaUser, MetaView } from '../metas';\nimport type { BatchExecutorOptions, BeforeSendHook, Transport, TransportItem } from '../transports';\nimport type { UnpatchedConsole } from '../unpatchedConsole';\nimport type { LogLevel } from '../utils';\n\ntype SamplingContext = {\n metas: Meta;\n};\n\nexport interface Config<P = APIEvent> {\n /**\n * Application metadata\n */\n app: MetaApp;\n\n /**\n * Set max number and max interval for signals to be batched before sending\n */\n batching?: BatchExecutorOptions;\n\n /**\n * A flag for toggling deduplication for signals\n */\n dedupe: boolean;\n\n /**\n * The key (name) to use for the global Faro object (default: 'faro')\n */\n globalObjectKey: string;\n\n /**\n * The (custom) instrumentations to use with Faro\n */\n instrumentations: Instrumentation[];\n\n /**\n * The level of information printed to console for internal messages (default: LogLevel.ERROR)\n */\n internalLoggerLevel: InternalLoggerLevel;\n\n /**\n * Isolate Faro instance from other Faro instances on the same page. (default: false)\n */\n isolate: boolean;\n\n /**\n * Custom function to serialize log arguments\n */\n logArgsSerializer?: LogArgsSerializer;\n\n /**\n * Add custom Metas during Faro initialization\n */\n metas: MetaItem[];\n\n /**\n * Custom function used to parse stack traces\n */\n parseStacktrace: StacktraceParser;\n\n /**\n * Pause sending data (default: false)\n */\n paused: boolean;\n\n /**\n * Prevent Faro from exposing itself to the global object (default: false)\n */\n preventGlobalExposure: boolean;\n\n /**\n * The transports to use for sending beacons\n */\n transports: Transport[];\n\n /**\n * Some instrumentations might override the default console methods but Faro instance provides a\n * way to access the unmodified console methods.\n *\n * faro.unpatchedConsole.log('This is a log');\n * faro.unpatchedConsole.warn('This is a warning');\n */\n unpatchedConsole: UnpatchedConsole;\n\n /**\n * Function which invoked before pushing event to transport. Can be used to modify or filter events\n */\n beforeSend?: BeforeSendHook<P>;\n\n /**\n * Error message patterns for errors that should be ignored\n */\n ignoreErrors?: Patterns;\n\n /**\n * Path patterns for Endpoints that should be ignored form being tracked\n */\n ignoreUrls?: Patterns;\n\n /**\n * Configuration for the built in session tracker\n */\n sessionTracking?: {\n /**\n * Enable session tracking (default: true)\n */\n enabled?: boolean;\n /**\n * Wether to use sticky sessions (default: false)\n */\n persistent?: boolean;\n /**\n * Session metadata object to be used when initializing session tracking\n */\n session?: MetaSession;\n /**\n * How long is a sticky session valid for recurring users (default: 15 minutes)\n */\n maxSessionPersistenceTime?: number;\n /**\n * Called each time a session changes. This can be when a new session is created or when an existing session is updated.\n * @param oldSession\n * @param newSession\n */\n onSessionChange?: (oldSession: MetaSession | null, newSession: MetaSession) => void;\n /**\n * Then sampling rate for the session based sampler (default: 1). If a session is not part of a sample, no signals for this session are tracked.\n */\n samplingRate?: number;\n /**\n * Custom sampler function if custom sampling logic is needed.\n * @param context\n */\n sampler?: (context: SamplingContext) => number;\n /**\n * Custom function to generate session id. If available Faro uses this function instead of the internal one.\n */\n generateSessionId?: () => string;\n };\n\n /**\n * Meta object for user data\n */\n user?: MetaUser;\n\n /**\n * Meta object for view data\n */\n view?: MetaView;\n\n eventDomain?: string;\n\n /**\n * Only resource timings for fetch and xhr requests are tracked by default. Set this to true to track all resources (default: false).\n */\n trackResources?: boolean;\n\n /**\n * Track web vitals attribution data (default: false)\n */\n trackWebVitalsAttribution?: boolean;\n\n /**\n * Configuration for the web vitals instrumentation\n */\n webVitalsInstrumentation?: {\n /**\n * Report all changes for web vitals (default: false)\n *\n * In most cases, you only want the callback function to be called when the metric is ready to be reported.\n * However, it is possible to report every change (e.g. each larger layout shift as it happens)\n * by setting reportAllChanges to true.\n *\n * This can be useful when debugging, but in general using reportAllChanges is not needed (or recommended)\n * for measuring these metrics in production.\n */\n reportAllChanges?: boolean;\n };\n\n /**\n * Configuration for the console instrumentation\n */\n consoleInstrumentation?: {\n /**\n * Configure what console levels should be captured by Faro. By default the following levels\n * are disabled: console.debug, console.trace, console.log\n *\n * If you want to collect all levels set captureConsoleDisabledLevels: [];\n * If you want to disable only some levels set captureConsoleDisabledLevels: [LogLevel.DEBUG, LogLevel.TRACE];\n */\n disabledLevels?: LogLevel[];\n /*\n * By default, Faro sends an error for console.error calls. If you want to send a log instead, set this to true.\n */\n consoleErrorAsLog?: boolean;\n\n /**\n * If true, use the default Faro error serializer for console.error calls. If false, simply call toString() on the error arguments.\n * If enabled, payloads containing serialized errors may become very large. If left disabled, some error details may be lost.\n * (default: false)\n */\n serializeErrors?: boolean;\n\n /**\n * Custom function to serialize Error arguments\n */\n errorSerializer?: LogArgsSerializer;\n };\n\n /**\n * Configuration for the page tracking\n */\n pageTracking?: {\n /**\n * The page meta for initial page settings\n */\n page?: MetaPage;\n\n /**\n * Allows to provide a template for the page id\n */\n generatePageId?: (location: Location) => string;\n };\n\n /**\n * Enable or disable geolocation tracking.\n * Geolocation tracking must be enabled in the Grafana Cloud settings first.\n * It cannot be enabled solely on the client side.\n * This option allows control over tracking on the client side to comply with user\n * privacy requirements.\n */\n trackGeolocation?: boolean;\n\n /**\n * This is a preview feature.\n * We have tested it thoroughly, but it is possible that it might not work as expected in all cases.\n */\n // TODO: remove preview postfix when feature is ga\n trackUserActionsPreview?: boolean;\n\n /**\n * Configure your own attribute name for tracking user actions. Default is 'data-faro-user-action-name'\n */\n trackUserActionsDataAttributeName?: string;\n\n /**\n * Predicate function to exclude items from user actions.\n * If the function returns true, the item will be excluded from user actions.\n */\n trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;\n}\n\nexport type Patterns = Array<string | RegExp>;\n"]}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer } from './api';
|
|
1
|
+
export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer, apiMessageBus, USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE, } from './api';
|
|
2
2
|
export { BaseExtension } from './extensions';
|
|
3
3
|
export { globalObject } from './globalObject';
|
|
4
4
|
export { initializeFaro } from './initialize';
|
|
@@ -9,7 +9,7 @@ export { faro, getInternalFaroFromGlobalObject, internalGlobalObjectKey, isInter
|
|
|
9
9
|
export * from './semantic';
|
|
10
10
|
export { BaseTransport, getTransportBody, TransportItemType, transportItemTypeToBodyKey } from './transports';
|
|
11
11
|
export { defaultUnpatchedConsole } from './unpatchedConsole';
|
|
12
|
-
export { allLogLevels, createPromiseBuffer, deepEqual, defaultLogLevel, genShortID, getCurrentTimestamp, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, LogLevel, noop, dateNow, isEmpty, getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues, } from './utils';
|
|
12
|
+
export { allLogLevels, createPromiseBuffer, deepEqual, defaultLogLevel, genShortID, getCurrentTimestamp, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, LogLevel, noop, dateNow, isEmpty, getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues, Observable, merge, } from './utils';
|
|
13
13
|
export { VERSION } from './version';
|
|
14
14
|
export { unknownString } from './consts';
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,aAAa,EACb,+BAA+B,EAC/B,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,OAAO,CAAC;AAmCf,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAoBzG,OAAO,EACL,IAAI,EACJ,+BAA+B,EAC/B,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,OAAO,CAAC;AAGf,cAAc,YAAY,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAW9G,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAK,EACL,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,OAAO,EACP,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,EACV,KAAK,GACN,MAAM,SAAS,CAAC;AAajB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export {\n defaultExceptionType,\n defaultLogArgsSerializer,\n defaultErrorArgsSerializer,\n apiMessageBus,\n USER_ACTION_CANCEL_MESSAGE_TYPE,\n USER_ACTION_END_MESSAGE_TYPE,\n USER_ACTION_START_MESSAGE_TYPE,\n} from './api';\nexport type {\n API,\n APIEvent,\n EventAttributes,\n EventEvent,\n EventsAPI,\n ExceptionEvent,\n ExceptionStackFrame,\n ExceptionsAPI,\n ExtendedError,\n LogArgsSerializer,\n LogContext,\n LogEvent,\n LogsAPI,\n MeasurementEvent,\n MeasurementsAPI,\n MetaAPI,\n OTELApi,\n PushErrorOptions,\n PushEventOptions,\n PushLogOptions,\n PushMeasurementOptions,\n Stacktrace,\n StacktraceParser,\n TraceContext,\n TraceEvent,\n TracesAPI,\n ApiMessageBusMessages,\n UserActionStartMessage,\n UserActionEndMessage,\n UserActionCancelMessage,\n UserAction,\n} from './api';\n\nexport { BaseExtension } from './extensions';\nexport type { Extension } from './extensions';\n\nexport { globalObject } from './globalObject';\nexport type { GlobalObject } from './globalObject';\n\nexport { initializeFaro } from './initialize';\n\nexport { defaultBatchingConfig, defaultGlobalObjectKey } from './config';\nexport type { Config, Patterns } from './config';\n\nexport { BaseInstrumentation } from './instrumentations';\nexport type { Instrumentation, Instrumentations } from './instrumentations';\n\nexport { createInternalLogger, defaultInternalLoggerLevel, InternalLoggerLevel } from './internalLogger';\nexport type { InternalLogger } from './internalLogger';\n\nexport type {\n Meta,\n MetaApp,\n MetaAttributes,\n MetaBrowser,\n MetaGetter,\n MetaItem,\n MetaPage,\n Metas,\n MetaSDK,\n MetaSDKIntegration,\n MetaSession,\n MetaUser,\n MetaView,\n MetaOverrides,\n} from './metas';\n\nexport {\n faro,\n getInternalFaroFromGlobalObject,\n internalGlobalObjectKey,\n isInternalFaroOnGlobalObject,\n setInternalFaroOnGlobalObject,\n} from './sdk';\nexport type { Faro } from './sdk';\n\nexport * from './semantic';\n\nexport { BaseTransport, getTransportBody, TransportItemType, transportItemTypeToBodyKey } from './transports';\nexport type {\n BeforeSendHook,\n SendFn,\n Transport,\n TransportBody,\n TransportItem,\n TransportItemPayload,\n Transports,\n} from './transports';\n\nexport { defaultUnpatchedConsole } from './unpatchedConsole';\nexport type { UnpatchedConsole } from './unpatchedConsole';\n\nexport {\n allLogLevels,\n createPromiseBuffer,\n deepEqual,\n defaultLogLevel,\n genShortID,\n getCurrentTimestamp,\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n LogLevel,\n noop,\n dateNow,\n isEmpty,\n getCircularDependencyReplacer,\n stringifyExternalJson,\n stringifyObjectValues,\n Observable,\n merge,\n} from './utils';\nexport type {\n BaseObject,\n BaseObjectKey,\n BaseObjectPrimitiveValue,\n BaseObjectValue,\n BufferItem,\n PromiseBuffer,\n PromiseBufferOptions,\n PromiseProducer,\n Subscription,\n} from './utils';\n\nexport { VERSION } from './version';\n\nexport { unknownString } from './consts';\n"]}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -8,4 +8,5 @@ export { genShortID } from './shortId';
|
|
|
8
8
|
export { getBundleId } from './sourceMaps';
|
|
9
9
|
export { dateNow } from './date';
|
|
10
10
|
export { getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues } from './json';
|
|
11
|
+
export { Observable, merge } from './reactive';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,EACL,OAAO,EACP,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAK,EACL,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,GACR,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './date';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n isEmpty,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { getBundleId } from './sourceMaps';\n\nexport { dateNow } from './date';\n\nexport { getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues } from './json';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,EACL,OAAO,EACP,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,OAAO,EACP,cAAc,EACd,UAAU,EACV,YAAY,EACZ,KAAK,EACL,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,GACR,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAErG,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export type { BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue } from './baseObject';\n\nexport { deepEqual } from './deepEqual';\n\nexport { getCurrentTimestamp } from './date';\n\nexport {\n isArray,\n isBoolean,\n isDomError,\n isDomException,\n isElement,\n isElementDefined,\n isError,\n isErrorDefined,\n isErrorEvent,\n isEvent,\n isEventDefined,\n isFunction,\n isInstanceOf,\n isInt,\n isMap,\n isMapDefined,\n isNull,\n isNumber,\n isObject,\n isPrimitive,\n isRegExp,\n isString,\n isSymbol,\n isSyntheticEvent,\n isThenable,\n isToString,\n isTypeof,\n isUndefined,\n isEmpty,\n} from './is';\nexport type { IsFnHelper } from './is';\n\nexport { allLogLevels, defaultLogLevel, LogLevel } from './logLevels';\n\nexport { noop } from './noop';\n\nexport { createPromiseBuffer } from './promiseBuffer';\nexport type { BufferItem, PromiseBuffer, PromiseBufferOptions, PromiseProducer } from './promiseBuffer';\n\nexport { genShortID } from './shortId';\n\nexport { getBundleId } from './sourceMaps';\n\nexport { dateNow } from './date';\n\nexport { getCircularDependencyReplacer, stringifyExternalJson, stringifyObjectValues } from './json';\n\nexport { Observable, merge } from './reactive';\nexport type { Subscription } from './reactive';\n"]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export class Observable {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.subscribers = [];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Subscribes a callback function to the observable.
|
|
7
|
+
* @param callback - The function to call when the observable emits a value.
|
|
8
|
+
* @returns A subscription object with an unsubscribe method to cancel the subscription.
|
|
9
|
+
*/
|
|
10
|
+
subscribe(callback) {
|
|
11
|
+
this.subscribers.push(callback);
|
|
12
|
+
return {
|
|
13
|
+
unsubscribe: () => this.unsubscribe(callback),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Notifies all subscribers with the given data.
|
|
18
|
+
* @param data - The data to emit to all subscribers.
|
|
19
|
+
*/
|
|
20
|
+
notify(data) {
|
|
21
|
+
this.subscribers.forEach((callback) => callback(data));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Subscribes a callback function to the observable and automatically unsubscribes after the first emission.
|
|
25
|
+
* @param callback - The function to call when the observable emits a value.
|
|
26
|
+
* @returns A subscription object with an unsubscribe method to cancel the subscription.
|
|
27
|
+
*/
|
|
28
|
+
first(callback) {
|
|
29
|
+
const subscription = this.subscribe((data) => {
|
|
30
|
+
callback(data);
|
|
31
|
+
subscription.unsubscribe();
|
|
32
|
+
});
|
|
33
|
+
return subscription;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Emits values from the source observable until the provided predicate function returns false.
|
|
37
|
+
* @param predicate - A function that evaluates each value emitted by the source observable.
|
|
38
|
+
* @returns A new observable that emits values from the source observable while the predicate returns true.
|
|
39
|
+
*/
|
|
40
|
+
takeWhile(predicate) {
|
|
41
|
+
const result = new Observable();
|
|
42
|
+
const subscription = this.subscribe((value) => {
|
|
43
|
+
if (predicate(value)) {
|
|
44
|
+
result.notify(value);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
subscription.unsubscribe();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Unsubscribes all subscribers by clearing the subscribers array.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* This method sets the `subscribers` array to an empty array, effectively removing all current subscribers.
|
|
57
|
+
*/
|
|
58
|
+
unsubscribeAll() {
|
|
59
|
+
this.subscribers = [];
|
|
60
|
+
}
|
|
61
|
+
unsubscribe(callback) {
|
|
62
|
+
this.subscribers = this.subscribers.filter((sub) => sub !== callback);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Merges multiple observables into a single observable.
|
|
67
|
+
*
|
|
68
|
+
* @template T - The type of the values emitted by the observables.
|
|
69
|
+
* @param {...Observable[]} observables - The observables to merge.
|
|
70
|
+
* @returns {Observable} A new observable that emits values from all input observables.
|
|
71
|
+
*/
|
|
72
|
+
export function merge(...observables) {
|
|
73
|
+
const mainObservable = new Observable();
|
|
74
|
+
const subscriptions = [];
|
|
75
|
+
observables.forEach((observable) => {
|
|
76
|
+
const subscription = observable.subscribe((value) => {
|
|
77
|
+
mainObservable.notify(value);
|
|
78
|
+
});
|
|
79
|
+
subscriptions.push(subscription);
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
subscribe: mainObservable.subscribe.bind(mainObservable),
|
|
83
|
+
takeWhile: mainObservable.takeWhile.bind(mainObservable),
|
|
84
|
+
first: mainObservable.first.bind(mainObservable),
|
|
85
|
+
notify: mainObservable.notify.bind(mainObservable),
|
|
86
|
+
unsubscribeAll: () => {
|
|
87
|
+
observables.forEach((observable) => {
|
|
88
|
+
observable.unsubscribeAll();
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=reactive.js.map
|