@datadog/mobile-react-native-code-push 2.3.3 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,9 +11,9 @@ export declare class DdSdkReactNative {
11
11
  private static readonly DD_SDK_VERSION;
12
12
  private static readonly DD_VERSION;
13
13
  private static readonly DD_VERSION_SUFFIX;
14
- private static wasInitialized;
15
14
  private static wasAutoInstrumented;
16
15
  private static features?;
16
+ private static _isInitialized;
17
17
  /**
18
18
  * Initializes the Datadog SDK.
19
19
  * @param configuration the configuration for the SDK library
@@ -57,6 +57,10 @@ export declare class DdSdkReactNative {
57
57
  * @returns a Promise
58
58
  */
59
59
  static clearAllData: () => Promise<void>;
60
+ /**
61
+ * Returns `true` if the SDK was initialized, `false` otherwise.
62
+ */
63
+ static isInitialized(): boolean;
60
64
  private static buildConfiguration;
61
65
  private static enableFeatures;
62
66
  }
@@ -11,4 +11,8 @@ import { RumActionType, ErrorSource, PropagatorType } from './rum/types';
11
11
  import { DatadogProvider } from './sdk/DatadogProvider/DatadogProvider';
12
12
  import { FileBasedConfiguration } from './sdk/FileBasedConfiguration/FileBasedConfiguration';
13
13
  import { DdTrace } from './trace/DdTrace';
14
- export { DatadogProvider, DatadogProviderConfiguration, FileBasedConfiguration, InitializationMode, DdLogs, DdTrace, DdRum, RumActionType, ErrorSource, DdSdkReactNativeConfiguration, DdSdkReactNative, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER };
14
+ import { DefaultTimeProvider } from './utils/time-provider/DefaultTimeProvider';
15
+ import { TimeProvider } from './utils/time-provider/TimeProvider';
16
+ import type { Timestamp } from './utils/time-provider/TimeProvider';
17
+ export { DatadogProvider, DatadogProviderConfiguration, FileBasedConfiguration, InitializationMode, DdLogs, DdTrace, DdRum, RumActionType, ErrorSource, DdSdkReactNativeConfiguration, DdSdkReactNative, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, TimeProvider, DefaultTimeProvider, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER };
18
+ export type { Timestamp };
@@ -1,4 +1,5 @@
1
1
  import type { GestureResponderEvent } from 'react-native';
2
+ import type { TimeProvider } from '../utils/time-provider/TimeProvider';
2
3
  import type { ActionEventMapper } from './eventMappers/actionEventMapper';
3
4
  import type { ErrorEventMapper } from './eventMappers/errorEventMapper';
4
5
  import type { ResourceEventMapper } from './eventMappers/resourceEventMapper';
@@ -9,6 +10,7 @@ declare class DdRumWrapper implements DdRumType {
9
10
  private errorEventMapper;
10
11
  private resourceEventMapper;
11
12
  private actionEventMapper;
13
+ private timeProvider;
12
14
  startView: (key: string, name: string, context?: object, timestampMs?: number) => Promise<void>;
13
15
  stopView: (key: string, context?: object, timestampMs?: number) => Promise<void>;
14
16
  startAction: (type: RumActionType, name: string, context?: object, timestampMs?: number) => Promise<void>;
@@ -18,6 +20,7 @@ declare class DdRumWrapper implements DdRumType {
18
20
  context?: object,
19
21
  timestampMs?: number
20
22
  ] | [context?: object, timestampMs?: number]) => Promise<void>;
23
+ setTimeProvider: (timeProvider: TimeProvider) => void;
21
24
  private callNativeStopAction;
22
25
  private getStopActionNativeCallArgs;
23
26
  addAction: (type: RumActionType, name: string, context?: object, timestampMs?: number, actionContext?: GestureResponderEvent) => Promise<void>;
@@ -27,6 +30,7 @@ declare class DdRumWrapper implements DdRumType {
27
30
  addTiming: (name: string) => Promise<void>;
28
31
  stopSession: () => Promise<void>;
29
32
  addFeatureFlagEvaluation: (name: string, value: unknown) => Promise<void>;
33
+ getCurrentSessionId(): Promise<string | undefined>;
30
34
  registerErrorEventMapper(errorEventMapper: ErrorEventMapper): void;
31
35
  unregisterErrorEventMapper(): void;
32
36
  registerResourceEventMapper(resourceEventMapper: ResourceEventMapper): void;
@@ -88,6 +88,10 @@ export type DdRumType = {
88
88
  * Stops the current RUM Session.
89
89
  */
90
90
  stopSession(): Promise<void>;
91
+ /**
92
+ * Returns current session ID, or undefined if unavailable.
93
+ */
94
+ getCurrentSessionId(): Promise<string | undefined>;
91
95
  };
92
96
  /**
93
97
  * Describe the type of a RUM Action.
@@ -9,6 +9,8 @@ export declare class BoundedBuffer extends DatadogBuffer {
9
9
  addCallbackReturningId: (callback: () => Promise<string>) => Promise<string>;
10
10
  addCallbackWithId: (callback: (id: string) => Promise<void>, bufferId: string) => Promise<void>;
11
11
  drain: () => Promise<void>;
12
+ private logBufferOverflow;
13
+ private logRandomIdGenerationError;
12
14
  private generateRandomBufferId;
13
15
  private addTelemetryEvent;
14
16
  private drainTelemetry;
@@ -87,6 +87,10 @@ export interface Spec extends TurboModule {
87
87
  * @param value: The value of the feature flag, encapsulated in an Object to accept all types
88
88
  */
89
89
  addFeatureFlagEvaluation(name: string, value: Object): Promise<void>;
90
+ /**
91
+ * Get current Session ID, or `undefined` if not available.
92
+ */
93
+ getCurrentSessionId(): Promise<string | undefined>;
90
94
  }
91
95
  declare const _default: Spec | null;
92
96
  export default _default;
@@ -1,4 +1,4 @@
1
- import { TimeProvider } from './TimeProvider';
1
+ import type { TimeProvider } from './time-provider/TimeProvider';
2
2
  /**
3
3
  * Simple timer which records time ticks. Shouldn't be re-used once stopped.
4
4
  * All timestamps/durations returned are in milliseconds.
@@ -0,0 +1,7 @@
1
+ import { TimeProvider } from './TimeProvider';
2
+ import type { Timestamp } from './TimeProvider';
3
+ export declare class DefaultTimeProvider extends TimeProvider {
4
+ private canUsePerformanceNow;
5
+ getTimestamp(): Timestamp;
6
+ private performanceNow;
7
+ }
@@ -3,18 +3,16 @@
3
3
  */
4
4
  export type Timestamp = {
5
5
  unix: number;
6
- react_native: number | null;
6
+ reactNative: number | null;
7
7
  };
8
8
  /**
9
9
  * Simple class providing timestamps in milliseconds.
10
10
  * If available, it will use the `performance.now()` method, and will fallback on `Date.now()` otherwise.
11
11
  */
12
- export declare class TimeProvider {
13
- private canUsePerformanceNow;
12
+ export declare abstract class TimeProvider {
14
13
  /** Keeps an average offset between the unix time and the provided timestamp. */
15
- private baseOffset;
14
+ protected baseOffset: number;
16
15
  constructor();
17
- getTimestamp(): Timestamp;
16
+ abstract getTimestamp(): Timestamp;
18
17
  now(): number;
19
- private performanceNow;
20
18
  }
@@ -1 +1 @@
1
- export declare const version = "2.3.3";
1
+ export declare const version = "2.3.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datadog/mobile-react-native-code-push",
3
- "version": "2.3.3",
3
+ "version": "2.3.4",
4
4
  "description": "A client-side React Native module to interact with Appcenter Codepush and Datadog",
5
5
  "keywords": [
6
6
  "datadog",
@@ -38,7 +38,7 @@
38
38
  "prepare": "rm -rf lib && yarn bob build"
39
39
  },
40
40
  "devDependencies": {
41
- "@datadog/mobile-react-native": "^2.3.3",
41
+ "@datadog/mobile-react-native": "^2.3.4",
42
42
  "@testing-library/react-native": "7.0.2",
43
43
  "react-native-builder-bob": "0.17.1",
44
44
  "react-native-code-push": "7.0.5"
@@ -78,5 +78,5 @@
78
78
  ]
79
79
  ]
80
80
  },
81
- "gitHead": "f9db01676449a1e3e31ad32ba20d1bcf360556e5"
81
+ "gitHead": "7293c15981edb7c5c523c7062866ef1bc2a7f339"
82
82
  }