@datadog/browser-core
Advanced tools
Comparing version 4.47.0 to 4.48.0
@@ -9,3 +9,3 @@ "use strict"; | ||
var publicApi = (0, polyfills_1.assign)({ | ||
version: "4.47.0", | ||
version: "4.48.0", | ||
// This API method is intentionally not monitored, since the only thing executed is the | ||
@@ -12,0 +12,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and |
@@ -69,3 +69,3 @@ "use strict"; | ||
var clientToken = _a.clientToken, internalAnalyticsSubdomain = _a.internalAnalyticsSubdomain; | ||
var tags = ["sdk_version:".concat("4.47.0"), "api:".concat(api)].concat(configurationTags); | ||
var tags = ["sdk_version:".concat("4.48.0"), "api:".concat(api)].concat(configurationTags); | ||
if (flushReason && (0, experimentalFeatures_1.isExperimentalFeatureEnabled)(experimentalFeatures_1.ExperimentalFeature.COLLECT_FLUSH_REASON)) { | ||
@@ -81,3 +81,3 @@ tags.push("flush_reason:".concat(flushReason)); | ||
"dd-api-key=".concat(clientToken), | ||
"dd-evp-origin-version=".concat(encodeURIComponent("4.47.0")), | ||
"dd-evp-origin-version=".concat(encodeURIComponent("4.48.0")), | ||
'dd-evp-origin=browser', | ||
@@ -84,0 +84,0 @@ "dd-request-id=".concat((0, stringUtils_1.generateUUID)()), |
@@ -53,3 +53,3 @@ "use strict"; | ||
service: telemetryService, | ||
version: "4.47.0", | ||
version: "4.48.0", | ||
source: 'browser', | ||
@@ -56,0 +56,0 @@ _dd: { |
@@ -12,3 +12,3 @@ export { Configuration, InitConfiguration, validateAndBuildConfiguration, DefaultPrivacyLevel, EndpointBuilder, serializeConfiguration, INTAKE_SITE_AP1, INTAKE_SITE_STAGING, INTAKE_SITE_US1, INTAKE_SITE_US1_FED, INTAKE_SITE_EU1, } from './domain/configuration'; | ||
export { SESSION_TIME_OUT_DELAY, } from './domain/session/sessionConstants'; | ||
export { HttpRequest, Payload, createHttpRequest, Batch, canUseEventBridge, getEventBridge, startBatchWithReplica, createFlushController, FlushEvent, FlushReason, } from './transport'; | ||
export { HttpRequest, Payload, createHttpRequest, canUseEventBridge, getEventBridge, startBatchWithReplica, createFlushController, FlushEvent, FlushReason, } from './transport'; | ||
export * from './tools/display'; | ||
@@ -64,1 +64,2 @@ export * from './tools/utils/urlPolyfill'; | ||
export { ErrorWithCause } from './domain/error/error.types'; | ||
export * from './domain/deflate'; |
@@ -17,4 +17,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toStackTraceString = exports.createHandlingStack = exports.computeRawError = exports.instrumentSetter = exports.instrumentMethodAndCallOriginal = exports.instrumentMethod = exports.getZoneJsOriginalValue = exports.runOnReadyState = exports.sendToExtension = exports.AbstractLifeCycle = exports.createFlushController = exports.startBatchWithReplica = exports.getEventBridge = exports.canUseEventBridge = exports.Batch = exports.createHttpRequest = exports.SESSION_TIME_OUT_DELAY = exports.stopSessionManager = exports.startSessionManager = exports.Observable = exports.setDebugMode = exports.callMonitored = exports.monitor = exports.monitored = exports.addTelemetryConfiguration = exports.isTelemetryReplicationAllowed = exports.resetTelemetry = exports.startFakeTelemetry = exports.addTelemetryError = exports.addTelemetryDebug = exports.startTelemetry = exports.RawReportType = exports.initReportObservable = exports.makePublicApi = exports.defineGlobal = exports.computeStackTrace = exports.trackRuntimeError = exports.ExperimentalFeature = exports.getExperimentalFeatures = exports.resetExperimentalFeatures = exports.addExperimentalFeatures = exports.isExperimentalFeatureEnabled = exports.INTAKE_SITE_EU1 = exports.INTAKE_SITE_US1_FED = exports.INTAKE_SITE_US1 = exports.INTAKE_SITE_STAGING = exports.INTAKE_SITE_AP1 = exports.serializeConfiguration = exports.DefaultPrivacyLevel = exports.validateAndBuildConfiguration = void 0; | ||
exports.ErrorSource = exports.sanitizeUser = exports.checkUser = exports.getSyntheticsResultId = exports.getSyntheticsTestId = exports.willSyntheticsInjectRum = exports.SESSION_STORE_KEY = exports.STORAGE_POLL_DELAY = exports.readBytesFromStream = exports.CLEAR_OLD_VALUES_INTERVAL = exports.ValueHistory = exports.CUSTOMER_DATA_BYTES_LIMIT = exports.warnIfCustomerDataLimitReached = exports.createContextManager = exports.catchUserErrors = exports.BoundedBuffer = exports.resetConsoleObservable = exports.initConsoleObservable = exports.isPageExitReason = exports.PageExitReason = exports.createPageExitObservable = exports.initFetchObservable = exports.initXhrObservable = exports.deleteCookie = exports.setCookie = exports.getCookie = exports.areCookiesAuthorized = exports.NO_ERROR_STACK_PRESENT_MESSAGE = exports.getFileFromStackTraceString = void 0; | ||
exports.getFileFromStackTraceString = exports.toStackTraceString = exports.createHandlingStack = exports.computeRawError = exports.instrumentSetter = exports.instrumentMethodAndCallOriginal = exports.instrumentMethod = exports.getZoneJsOriginalValue = exports.runOnReadyState = exports.sendToExtension = exports.AbstractLifeCycle = exports.createFlushController = exports.startBatchWithReplica = exports.getEventBridge = exports.canUseEventBridge = exports.createHttpRequest = exports.SESSION_TIME_OUT_DELAY = exports.stopSessionManager = exports.startSessionManager = exports.Observable = exports.setDebugMode = exports.callMonitored = exports.monitor = exports.monitored = exports.addTelemetryConfiguration = exports.isTelemetryReplicationAllowed = exports.resetTelemetry = exports.startFakeTelemetry = exports.addTelemetryError = exports.addTelemetryDebug = exports.startTelemetry = exports.RawReportType = exports.initReportObservable = exports.makePublicApi = exports.defineGlobal = exports.computeStackTrace = exports.trackRuntimeError = exports.ExperimentalFeature = exports.getExperimentalFeatures = exports.resetExperimentalFeatures = exports.addExperimentalFeatures = exports.isExperimentalFeatureEnabled = exports.INTAKE_SITE_EU1 = exports.INTAKE_SITE_US1_FED = exports.INTAKE_SITE_US1 = exports.INTAKE_SITE_STAGING = exports.INTAKE_SITE_AP1 = exports.serializeConfiguration = exports.DefaultPrivacyLevel = exports.validateAndBuildConfiguration = void 0; | ||
exports.ErrorSource = exports.sanitizeUser = exports.checkUser = exports.getSyntheticsResultId = exports.getSyntheticsTestId = exports.willSyntheticsInjectRum = exports.SESSION_STORE_KEY = exports.STORAGE_POLL_DELAY = exports.readBytesFromStream = exports.CLEAR_OLD_VALUES_INTERVAL = exports.ValueHistory = exports.CUSTOMER_DATA_BYTES_LIMIT = exports.warnIfCustomerDataLimitReached = exports.createContextManager = exports.catchUserErrors = exports.BoundedBuffer = exports.resetConsoleObservable = exports.initConsoleObservable = exports.isPageExitReason = exports.PageExitReason = exports.createPageExitObservable = exports.initFetchObservable = exports.initXhrObservable = exports.deleteCookie = exports.setCookie = exports.getCookie = exports.areCookiesAuthorized = exports.NO_ERROR_STACK_PRESENT_MESSAGE = void 0; | ||
var configuration_1 = require("./domain/configuration"); | ||
@@ -68,3 +68,2 @@ Object.defineProperty(exports, "validateAndBuildConfiguration", { enumerable: true, get: function () { return configuration_1.validateAndBuildConfiguration; } }); | ||
Object.defineProperty(exports, "createHttpRequest", { enumerable: true, get: function () { return transport_1.createHttpRequest; } }); | ||
Object.defineProperty(exports, "Batch", { enumerable: true, get: function () { return transport_1.Batch; } }); | ||
Object.defineProperty(exports, "canUseEventBridge", { enumerable: true, get: function () { return transport_1.canUseEventBridge; } }); | ||
@@ -157,2 +156,3 @@ Object.defineProperty(exports, "getEventBridge", { enumerable: true, get: function () { return transport_1.getEventBridge; } }); | ||
Object.defineProperty(exports, "ErrorSource", { enumerable: true, get: function () { return error_types_1.ErrorSource; } }); | ||
__exportStar(require("./domain/deflate"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -18,2 +18,3 @@ /** | ||
SCROLLMAP = "scrollmap", | ||
INTERACTION_TO_NEXT_PAINT = "interaction_to_next_paint", | ||
DISABLE_REPLAY_INLINE_CSS = "disable_replay_inline_css" | ||
@@ -20,0 +21,0 @@ } |
@@ -25,2 +25,3 @@ "use strict"; | ||
ExperimentalFeature["SCROLLMAP"] = "scrollmap"; | ||
ExperimentalFeature["INTERACTION_TO_NEXT_PAINT"] = "interaction_to_next_paint"; | ||
ExperimentalFeature["DISABLE_REPLAY_INLINE_CSS"] = "disable_replay_inline_css"; | ||
@@ -27,0 +28,0 @@ })(ExperimentalFeature || (exports.ExperimentalFeature = ExperimentalFeature = {})); |
@@ -6,3 +6,3 @@ import type { Context } from '../tools/serialisation/context'; | ||
private request; | ||
private flushController; | ||
flushController: FlushController; | ||
private messageBytesLimit; | ||
@@ -9,0 +9,0 @@ private pushOnlyBuffer; |
export { HttpRequest, createHttpRequest, Payload, RetryInfo } from './httpRequest'; | ||
export { Batch } from './batch'; | ||
export { canUseEventBridge, getEventBridge, BrowserWindowWithEventBridge } from './eventBridge'; | ||
export { startBatchWithReplica } from './startBatchWithReplica'; | ||
export { createFlushController, FlushController, FlushEvent, FlushReason } from './flushController'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createFlushController = exports.startBatchWithReplica = exports.getEventBridge = exports.canUseEventBridge = exports.Batch = exports.createHttpRequest = void 0; | ||
exports.createFlushController = exports.startBatchWithReplica = exports.getEventBridge = exports.canUseEventBridge = exports.createHttpRequest = void 0; | ||
var httpRequest_1 = require("./httpRequest"); | ||
Object.defineProperty(exports, "createHttpRequest", { enumerable: true, get: function () { return httpRequest_1.createHttpRequest; } }); | ||
var batch_1 = require("./batch"); | ||
Object.defineProperty(exports, "Batch", { enumerable: true, get: function () { return batch_1.Batch; } }); | ||
var eventBridge_1 = require("./eventBridge"); | ||
@@ -9,0 +7,0 @@ Object.defineProperty(exports, "canUseEventBridge", { enumerable: true, get: function () { return eventBridge_1.canUseEventBridge; } }); |
@@ -6,4 +6,11 @@ import type { Configuration, EndpointBuilder } from '../domain/configuration'; | ||
import type { RawError } from '../domain/error/error.types'; | ||
export declare function startBatchWithReplica<T extends Context>(configuration: Configuration, endpoint: EndpointBuilder, reportError: (error: RawError) => void, pageExitObservable: Observable<PageExitEvent>, sessionExpireObservable: Observable<void>, replicaEndpoint?: EndpointBuilder): { | ||
export declare function startBatchWithReplica<T extends Context>(configuration: Configuration, primary: { | ||
endpoint: EndpointBuilder; | ||
}, replica: { | ||
endpoint: EndpointBuilder; | ||
transformMessage?: (message: T) => T; | ||
} | undefined, reportError: (error: RawError) => void, pageExitObservable: Observable<PageExitEvent>, sessionExpireObservable: Observable<void>): { | ||
flushObservable: Observable<import("./flushController").FlushEvent>; | ||
add(message: T, replicated?: boolean): void; | ||
upsert: (message: T, key: string) => void; | ||
}; |
@@ -7,8 +7,5 @@ "use strict"; | ||
var flushController_1 = require("./flushController"); | ||
function startBatchWithReplica(configuration, endpoint, reportError, pageExitObservable, sessionExpireObservable, replicaEndpoint) { | ||
var primaryBatch = createBatch(configuration, endpoint); | ||
var replicaBatch; | ||
if (replicaEndpoint) { | ||
replicaBatch = createBatch(configuration, replicaEndpoint); | ||
} | ||
function startBatchWithReplica(configuration, primary, replica, reportError, pageExitObservable, sessionExpireObservable) { | ||
var primaryBatch = createBatch(configuration, primary.endpoint); | ||
var replicaBatch = replica && createBatch(configuration, replica.endpoint); | ||
function createBatch(configuration, endpointBuilder) { | ||
@@ -24,2 +21,3 @@ return new batch_1.Batch((0, httpRequest_1.createHttpRequest)(configuration, endpointBuilder, configuration.batchBytesLimit, reportError), (0, flushController_1.createFlushController)({ | ||
return { | ||
flushObservable: primaryBatch.flushController.flushObservable, | ||
add: function (message, replicated) { | ||
@@ -29,5 +27,11 @@ if (replicated === void 0) { replicated = true; } | ||
if (replicaBatch && replicated) { | ||
replicaBatch.add(message); | ||
replicaBatch.add(replica.transformMessage ? replica.transformMessage(message) : message); | ||
} | ||
}, | ||
upsert: function (message, key) { | ||
primaryBatch.upsert(message, key); | ||
if (replicaBatch) { | ||
replicaBatch.upsert(replica.transformMessage ? replica.transformMessage(message) : message, key); | ||
} | ||
}, | ||
}; | ||
@@ -34,0 +38,0 @@ } |
@@ -6,3 +6,3 @@ import { catchUserErrors } from '../tools/catchUserErrors'; | ||
var publicApi = assign({ | ||
version: "4.47.0", | ||
version: "4.48.0", | ||
// This API method is intentionally not monitored, since the only thing executed is the | ||
@@ -9,0 +9,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and |
@@ -65,3 +65,3 @@ import { timeStampNow } from '../../tools/utils/timeUtils'; | ||
var clientToken = _a.clientToken, internalAnalyticsSubdomain = _a.internalAnalyticsSubdomain; | ||
var tags = ["sdk_version:".concat("4.47.0"), "api:".concat(api)].concat(configurationTags); | ||
var tags = ["sdk_version:".concat("4.48.0"), "api:".concat(api)].concat(configurationTags); | ||
if (flushReason && isExperimentalFeatureEnabled(ExperimentalFeature.COLLECT_FLUSH_REASON)) { | ||
@@ -77,3 +77,3 @@ tags.push("flush_reason:".concat(flushReason)); | ||
"dd-api-key=".concat(clientToken), | ||
"dd-evp-origin-version=".concat(encodeURIComponent("4.47.0")), | ||
"dd-evp-origin-version=".concat(encodeURIComponent("4.48.0")), | ||
'dd-evp-origin=browser', | ||
@@ -80,0 +80,0 @@ "dd-request-id=".concat(generateUUID()), |
@@ -50,3 +50,3 @@ import { ConsoleApiName } from '../../tools/display'; | ||
service: telemetryService, | ||
version: "4.47.0", | ||
version: "4.48.0", | ||
source: 'browser', | ||
@@ -53,0 +53,0 @@ _dd: { |
@@ -12,3 +12,3 @@ export { Configuration, InitConfiguration, validateAndBuildConfiguration, DefaultPrivacyLevel, EndpointBuilder, serializeConfiguration, INTAKE_SITE_AP1, INTAKE_SITE_STAGING, INTAKE_SITE_US1, INTAKE_SITE_US1_FED, INTAKE_SITE_EU1, } from './domain/configuration'; | ||
export { SESSION_TIME_OUT_DELAY, } from './domain/session/sessionConstants'; | ||
export { HttpRequest, Payload, createHttpRequest, Batch, canUseEventBridge, getEventBridge, startBatchWithReplica, createFlushController, FlushEvent, FlushReason, } from './transport'; | ||
export { HttpRequest, Payload, createHttpRequest, canUseEventBridge, getEventBridge, startBatchWithReplica, createFlushController, FlushEvent, FlushReason, } from './transport'; | ||
export * from './tools/display'; | ||
@@ -64,1 +64,2 @@ export * from './tools/utils/urlPolyfill'; | ||
export { ErrorWithCause } from './domain/error/error.types'; | ||
export * from './domain/deflate'; |
@@ -15,3 +15,3 @@ export { validateAndBuildConfiguration, DefaultPrivacyLevel, serializeConfiguration, INTAKE_SITE_AP1, INTAKE_SITE_STAGING, INTAKE_SITE_US1, INTAKE_SITE_US1_FED, INTAKE_SITE_EU1, } from './domain/configuration'; | ||
} from './domain/session/sessionConstants'; | ||
export { createHttpRequest, Batch, canUseEventBridge, getEventBridge, startBatchWithReplica, createFlushController, } from './transport'; | ||
export { createHttpRequest, canUseEventBridge, getEventBridge, startBatchWithReplica, createFlushController, } from './transport'; | ||
export * from './tools/display'; | ||
@@ -61,2 +61,3 @@ export * from './tools/utils/urlPolyfill'; | ||
export { ErrorSource } from './domain/error/error.types'; | ||
export * from './domain/deflate'; | ||
//# sourceMappingURL=index.js.map |
@@ -18,2 +18,3 @@ /** | ||
SCROLLMAP = "scrollmap", | ||
INTERACTION_TO_NEXT_PAINT = "interaction_to_next_paint", | ||
DISABLE_REPLAY_INLINE_CSS = "disable_replay_inline_css" | ||
@@ -20,0 +21,0 @@ } |
@@ -22,2 +22,3 @@ /** | ||
ExperimentalFeature["SCROLLMAP"] = "scrollmap"; | ||
ExperimentalFeature["INTERACTION_TO_NEXT_PAINT"] = "interaction_to_next_paint"; | ||
ExperimentalFeature["DISABLE_REPLAY_INLINE_CSS"] = "disable_replay_inline_css"; | ||
@@ -24,0 +25,0 @@ })(ExperimentalFeature || (ExperimentalFeature = {})); |
@@ -6,3 +6,3 @@ import type { Context } from '../tools/serialisation/context'; | ||
private request; | ||
private flushController; | ||
flushController: FlushController; | ||
private messageBytesLimit; | ||
@@ -9,0 +9,0 @@ private pushOnlyBuffer; |
export { HttpRequest, createHttpRequest, Payload, RetryInfo } from './httpRequest'; | ||
export { Batch } from './batch'; | ||
export { canUseEventBridge, getEventBridge, BrowserWindowWithEventBridge } from './eventBridge'; | ||
export { startBatchWithReplica } from './startBatchWithReplica'; | ||
export { createFlushController, FlushController, FlushEvent, FlushReason } from './flushController'; |
export { createHttpRequest } from './httpRequest'; | ||
export { Batch } from './batch'; | ||
export { canUseEventBridge, getEventBridge } from './eventBridge'; | ||
@@ -4,0 +3,0 @@ export { startBatchWithReplica } from './startBatchWithReplica'; |
@@ -6,4 +6,11 @@ import type { Configuration, EndpointBuilder } from '../domain/configuration'; | ||
import type { RawError } from '../domain/error/error.types'; | ||
export declare function startBatchWithReplica<T extends Context>(configuration: Configuration, endpoint: EndpointBuilder, reportError: (error: RawError) => void, pageExitObservable: Observable<PageExitEvent>, sessionExpireObservable: Observable<void>, replicaEndpoint?: EndpointBuilder): { | ||
export declare function startBatchWithReplica<T extends Context>(configuration: Configuration, primary: { | ||
endpoint: EndpointBuilder; | ||
}, replica: { | ||
endpoint: EndpointBuilder; | ||
transformMessage?: (message: T) => T; | ||
} | undefined, reportError: (error: RawError) => void, pageExitObservable: Observable<PageExitEvent>, sessionExpireObservable: Observable<void>): { | ||
flushObservable: Observable<import("./flushController").FlushEvent>; | ||
add(message: T, replicated?: boolean): void; | ||
upsert: (message: T, key: string) => void; | ||
}; |
import { Batch } from './batch'; | ||
import { createHttpRequest } from './httpRequest'; | ||
import { createFlushController } from './flushController'; | ||
export function startBatchWithReplica(configuration, endpoint, reportError, pageExitObservable, sessionExpireObservable, replicaEndpoint) { | ||
var primaryBatch = createBatch(configuration, endpoint); | ||
var replicaBatch; | ||
if (replicaEndpoint) { | ||
replicaBatch = createBatch(configuration, replicaEndpoint); | ||
} | ||
export function startBatchWithReplica(configuration, primary, replica, reportError, pageExitObservable, sessionExpireObservable) { | ||
var primaryBatch = createBatch(configuration, primary.endpoint); | ||
var replicaBatch = replica && createBatch(configuration, replica.endpoint); | ||
function createBatch(configuration, endpointBuilder) { | ||
@@ -20,2 +17,3 @@ return new Batch(createHttpRequest(configuration, endpointBuilder, configuration.batchBytesLimit, reportError), createFlushController({ | ||
return { | ||
flushObservable: primaryBatch.flushController.flushObservable, | ||
add: function (message, replicated) { | ||
@@ -25,7 +23,13 @@ if (replicated === void 0) { replicated = true; } | ||
if (replicaBatch && replicated) { | ||
replicaBatch.add(message); | ||
replicaBatch.add(replica.transformMessage ? replica.transformMessage(message) : message); | ||
} | ||
}, | ||
upsert: function (message, key) { | ||
primaryBatch.upsert(message, key); | ||
if (replicaBatch) { | ||
replicaBatch.upsert(replica.transformMessage ? replica.transformMessage(message) : message, key); | ||
} | ||
}, | ||
}; | ||
} | ||
//# sourceMappingURL=startBatchWithReplica.js.map |
{ | ||
"name": "@datadog/browser-core", | ||
"version": "4.47.0", | ||
"version": "4.48.0", | ||
"license": "Apache-2.0", | ||
@@ -26,3 +26,3 @@ "main": "cjs/index.js", | ||
}, | ||
"gitHead": "8aa80956202b4b2eb82b15ffd0f815c58679873d" | ||
"gitHead": "fb747ba67e23abd3f21112c51d9fbac4c9c6fed4" | ||
} |
@@ -57,3 +57,2 @@ export { | ||
createHttpRequest, | ||
Batch, | ||
canUseEventBridge, | ||
@@ -130,1 +129,2 @@ getEventBridge, | ||
export { ErrorWithCause } from './domain/error/error.types' | ||
export * from './domain/deflate' |
@@ -21,2 +21,3 @@ /** | ||
SCROLLMAP = 'scrollmap', | ||
INTERACTION_TO_NEXT_PAINT = 'interaction_to_next_paint', | ||
DISABLE_REPLAY_INLINE_CSS = 'disable_replay_inline_css', | ||
@@ -23,0 +24,0 @@ } |
@@ -16,3 +16,3 @@ import { display } from '../tools/display' | ||
private request: HttpRequest, | ||
private flushController: FlushController, | ||
public flushController: FlushController, | ||
private messageBytesLimit: number | ||
@@ -19,0 +19,0 @@ ) { |
export { HttpRequest, createHttpRequest, Payload, RetryInfo } from './httpRequest' | ||
export { Batch } from './batch' | ||
export { canUseEventBridge, getEventBridge, BrowserWindowWithEventBridge } from './eventBridge' | ||
export { startBatchWithReplica } from './startBatchWithReplica' | ||
export { createFlushController, FlushController, FlushEvent, FlushReason } from './flushController' |
@@ -12,13 +12,10 @@ import type { Configuration, EndpointBuilder } from '../domain/configuration' | ||
configuration: Configuration, | ||
endpoint: EndpointBuilder, | ||
primary: { endpoint: EndpointBuilder }, | ||
replica: { endpoint: EndpointBuilder; transformMessage?: (message: T) => T } | undefined, | ||
reportError: (error: RawError) => void, | ||
pageExitObservable: Observable<PageExitEvent>, | ||
sessionExpireObservable: Observable<void>, | ||
replicaEndpoint?: EndpointBuilder | ||
sessionExpireObservable: Observable<void> | ||
) { | ||
const primaryBatch = createBatch(configuration, endpoint) | ||
let replicaBatch: Batch | undefined | ||
if (replicaEndpoint) { | ||
replicaBatch = createBatch(configuration, replicaEndpoint) | ||
} | ||
const primaryBatch = createBatch(configuration, primary.endpoint) | ||
const replicaBatch = replica && createBatch(configuration, replica.endpoint) | ||
@@ -40,9 +37,18 @@ function createBatch(configuration: Configuration, endpointBuilder: EndpointBuilder) { | ||
return { | ||
flushObservable: primaryBatch.flushController.flushObservable, | ||
add(message: T, replicated = true) { | ||
primaryBatch.add(message) | ||
if (replicaBatch && replicated) { | ||
replicaBatch.add(message) | ||
replicaBatch.add(replica.transformMessage ? replica.transformMessage(message) : message) | ||
} | ||
}, | ||
upsert: (message: T, key: string) => { | ||
primaryBatch.upsert(message, key) | ||
if (replicaBatch) { | ||
replicaBatch.upsert(replica.transformMessage ? replica.transformMessage(message) : message, key) | ||
} | ||
}, | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
960869
605
16975
4
5