From 5dd70580797fdcae2ceb7f38d22e0dddb807c2a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matu=CC=81s=CC=8C=20Tomlein?= Date: Thu, 21 Nov 2024 15:11:37 +0100 Subject: [PATCH] Update API docs --- .../markdown/react-native-tracker.md | 1 + ...react-native-tracker.reactnativetracker.md | 6 ++++- ...-native-tracker.sessionstate.eventindex.md | 13 +++++++++ ...ative-tracker.sessionstate.firsteventid.md | 13 +++++++++ ...racker.sessionstate.firsteventtimestamp.md | 13 +++++++++ .../react-native-tracker.sessionstate.md | 27 +++++++++++++++++++ ...-tracker.sessionstate.previoussessionid.md | 13 +++++++++ ...t-native-tracker.sessionstate.sessionid.md | 13 +++++++++ ...ative-tracker.sessionstate.sessionindex.md | 13 +++++++++ ...e-tracker.sessionstate.storagemechanism.md | 13 +++++++++ ...eact-native-tracker.sessionstate.userid.md | 13 +++++++++ .../react-native-tracker.api.md | 16 +++++++++++ trackers/react-native-tracker/src/types.ts | 6 ----- 13 files changed, 153 insertions(+), 7 deletions(-) create mode 100644 api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.eventindex.md create mode 100644 api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.firsteventid.md create mode 100644 api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.firsteventtimestamp.md create mode 100644 api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.md create mode 100644 api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.previoussessionid.md create mode 100644 api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.sessionid.md create mode 100644 api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.sessionindex.md create mode 100644 api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.storagemechanism.md create mode 100644 api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.userid.md diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.md index 10f2ebe20..48913f89f 100644 --- a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.md +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.md @@ -41,6 +41,7 @@ | [PayloadBuilder](./react-native-tracker.payloadbuilder.md) | Interface for mutable object encapsulating tracker payload | | [RuleSet](./react-native-tracker.ruleset.md) | A ruleset has accept or reject properties that contain rules for matching Iglu schema URIs | | [SessionConfiguration](./react-native-tracker.sessionconfiguration.md) | Configuration for session tracking | +| [SessionState](./react-native-tracker.sessionstate.md) | Current session state that is tracked in events. | | [StructuredEvent](./react-native-tracker.structuredevent.md) | A Structured Event A classic style of event tracking, allows for easier movement between analytics systems. A loosely typed event, creating a Self Describing event is preferred, but useful for interoperability. | | [SubjectConfiguration](./react-native-tracker.subjectconfiguration.md) | Configuration of subject properties tracked with events | | [TrackerConfiguration](./react-native-tracker.trackerconfiguration.md) | The configuration object for initialising the tracker | diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.reactnativetracker.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.reactnativetracker.md index 00f678ae0..6d8f6dd05 100644 --- a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.reactnativetracker.md +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.reactnativetracker.md @@ -33,7 +33,11 @@ export declare type ReactNativeTracker = { readonly setScreenViewport: (newView: ScreenSize) => void; readonly setColorDepth: (newLang: number) => void; readonly setSubjectData: (config: SubjectConfiguration) => void; + readonly getSessionUserId: () => Promise; + readonly getSessionId: () => Promise; + readonly getSessionIndex: () => Promise; + readonly getSessionState: () => Promise; }; ``` -References: [EventContext](./react-native-tracker.eventcontext.md), [TimingProps](./react-native-tracker.timingprops.md), [MessageNotificationProps](./react-native-tracker.messagenotificationprops.md), [ScreenSize](./react-native-tracker.screensize.md), [SubjectConfiguration](./react-native-tracker.subjectconfiguration.md) +References: [EventContext](./react-native-tracker.eventcontext.md), [TimingProps](./react-native-tracker.timingprops.md), [MessageNotificationProps](./react-native-tracker.messagenotificationprops.md), [ScreenSize](./react-native-tracker.screensize.md), [SubjectConfiguration](./react-native-tracker.subjectconfiguration.md), [SessionState](./react-native-tracker.sessionstate.md) diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.eventindex.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.eventindex.md new file mode 100644 index 000000000..c6bd011e1 --- /dev/null +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.eventindex.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [SessionState](./react-native-tracker.sessionstate.md) > [eventIndex](./react-native-tracker.sessionstate.eventindex.md) + +## SessionState.eventIndex property + +Optional index of the current event in the session + +Signature: + +```typescript +eventIndex?: number; +``` diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.firsteventid.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.firsteventid.md new file mode 100644 index 000000000..fa6fa9ea6 --- /dev/null +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.firsteventid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [SessionState](./react-native-tracker.sessionstate.md) > [firstEventId](./react-native-tracker.sessionstate.firsteventid.md) + +## SessionState.firstEventId property + +The optional identifier of the first event for this session + +Signature: + +```typescript +firstEventId?: string; +``` diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.firsteventtimestamp.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.firsteventtimestamp.md new file mode 100644 index 000000000..b7530cbc5 --- /dev/null +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.firsteventtimestamp.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [SessionState](./react-native-tracker.sessionstate.md) > [firstEventTimestamp](./react-native-tracker.sessionstate.firsteventtimestamp.md) + +## SessionState.firstEventTimestamp property + +Optional date-time timestamp of when the first event in the session was tracked + +Signature: + +```typescript +firstEventTimestamp?: string; +``` diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.md new file mode 100644 index 000000000..3146ea3b2 --- /dev/null +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [SessionState](./react-native-tracker.sessionstate.md) + +## SessionState interface + +Current session state that is tracked in events. + +Signature: + +```typescript +export interface SessionState +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [eventIndex?](./react-native-tracker.sessionstate.eventindex.md) | number | (Optional) Optional index of the current event in the session | +| [firstEventId?](./react-native-tracker.sessionstate.firsteventid.md) | string | (Optional) The optional identifier of the first event for this session | +| [firstEventTimestamp?](./react-native-tracker.sessionstate.firsteventtimestamp.md) | string | (Optional) Optional date-time timestamp of when the first event in the session was tracked | +| [previousSessionId?](./react-native-tracker.sessionstate.previoussessionid.md) | string | (Optional) The previous session identifier for this user | +| [sessionId](./react-native-tracker.sessionstate.sessionid.md) | string | An identifier for the session | +| [sessionIndex](./react-native-tracker.sessionstate.sessionindex.md) | number | The index of the current session for this user | +| [storageMechanism](./react-native-tracker.sessionstate.storagemechanism.md) | string | The mechanism that the session information has been stored on the device | +| [userId](./react-native-tracker.sessionstate.userid.md) | string | An identifier for the user of the session | + diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.previoussessionid.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.previoussessionid.md new file mode 100644 index 000000000..159517a4b --- /dev/null +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.previoussessionid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [SessionState](./react-native-tracker.sessionstate.md) > [previousSessionId](./react-native-tracker.sessionstate.previoussessionid.md) + +## SessionState.previousSessionId property + +The previous session identifier for this user + +Signature: + +```typescript +previousSessionId?: string; +``` diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.sessionid.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.sessionid.md new file mode 100644 index 000000000..1da413386 --- /dev/null +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.sessionid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [SessionState](./react-native-tracker.sessionstate.md) > [sessionId](./react-native-tracker.sessionstate.sessionid.md) + +## SessionState.sessionId property + +An identifier for the session + +Signature: + +```typescript +sessionId: string; +``` diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.sessionindex.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.sessionindex.md new file mode 100644 index 000000000..6c4e5ee6c --- /dev/null +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.sessionindex.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [SessionState](./react-native-tracker.sessionstate.md) > [sessionIndex](./react-native-tracker.sessionstate.sessionindex.md) + +## SessionState.sessionIndex property + +The index of the current session for this user + +Signature: + +```typescript +sessionIndex: number; +``` diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.storagemechanism.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.storagemechanism.md new file mode 100644 index 000000000..1e96c113c --- /dev/null +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.storagemechanism.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [SessionState](./react-native-tracker.sessionstate.md) > [storageMechanism](./react-native-tracker.sessionstate.storagemechanism.md) + +## SessionState.storageMechanism property + +The mechanism that the session information has been stored on the device + +Signature: + +```typescript +storageMechanism: string; +``` diff --git a/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.userid.md b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.userid.md new file mode 100644 index 000000000..a2151d0b2 --- /dev/null +++ b/api-docs/docs/react-native-tracker/markdown/react-native-tracker.sessionstate.userid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [SessionState](./react-native-tracker.sessionstate.md) > [userId](./react-native-tracker.sessionstate.userid.md) + +## SessionState.userId property + +An identifier for the user of the session + +Signature: + +```typescript +userId: string; +``` diff --git a/api-docs/docs/react-native-tracker/react-native-tracker.api.md b/api-docs/docs/react-native-tracker/react-native-tracker.api.md index a48e04ddf..8f8131227 100644 --- a/api-docs/docs/react-native-tracker/react-native-tracker.api.md +++ b/api-docs/docs/react-native-tracker/react-native-tracker.api.md @@ -300,6 +300,10 @@ export type ReactNativeTracker = { readonly setScreenViewport: (newView: ScreenSize) => void; readonly setColorDepth: (newLang: number) => void; readonly setSubjectData: (config: SubjectConfiguration) => void; + readonly getSessionUserId: () => Promise; + readonly getSessionId: () => Promise; + readonly getSessionIndex: () => Promise; + readonly getSessionState: () => Promise; }; // @public @@ -366,6 +370,18 @@ export interface SessionConfiguration { foregroundSessionTimeout?: number; } +// @public +export interface SessionState { + eventIndex?: number; + firstEventId?: string; + firstEventTimestamp?: string; + previousSessionId?: string; + sessionId: string; + sessionIndex: number; + storageMechanism: string; + userId: string; +} + // @public export interface StructuredEvent { // (undocumented) diff --git a/trackers/react-native-tracker/src/types.ts b/trackers/react-native-tracker/src/types.ts index 95bbfed7f..14662389a 100755 --- a/trackers/react-native-tracker/src/types.ts +++ b/trackers/react-native-tracker/src/types.ts @@ -582,22 +582,16 @@ export type ReactNativeTracker = { /** * Gets the identifier for the user of the session - * - * @returns {Promise} */ readonly getSessionUserId: () => Promise; /** * Gets the identifier for the session - * - * @returns {Promise} */ readonly getSessionId: () => Promise; /** * Gets the index of the current session for this user - * - * @returns {Promise} */ readonly getSessionIndex: () => Promise;