@guidelytech/react-native 0.8.0 → 0.10.0

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/index.d.cts CHANGED
@@ -4,7 +4,7 @@ import { SelectorStrategy, MessengerConfig, MessengerMessage, MessengerConversat
4
4
  export { GuideStep, PublishedGuide, SdkConfigResponse } from '@guidelytech/shared';
5
5
  import { FlagsClientOptions, FlagsClient, JsonValue, FlagValue, FlagDetails, FlagsBootstrap, Attributes } from '@guidelytech/flags';
6
6
  export { Attributes, EvaluationResult, FlagDetails, FlagsBootstrap, FlagsClient, FlagsClientOptions, FlagsPayload, InMemoryStickyBucketStore, JsonValue, createFlagsClient } from '@guidelytech/flags';
7
- import { KeyValueStore, ChecklistProgressState, GuidelyEnvironment, ConsentState, GuidelyUser, GuidelyAccount, GuideLocalState, SessionState } from '@guidelytech/sdk-core/headless';
7
+ import { KeyValueStore, ServerHealth, ChecklistProgressState, GuidelyEnvironment, ConsentState, GuidelyUser, GuidelyAccount, GuideLocalState, SessionState } from '@guidelytech/sdk-core/headless';
8
8
  export { ChecklistProgressState, ConsentState, GuidelyAccount, GuidelyEnvironment, GuidelyUser } from '@guidelytech/sdk-core/headless';
9
9
  import { ViewProps, StyleProp, ViewStyle, View, GestureResponderEvent } from 'react-native';
10
10
 
@@ -135,6 +135,8 @@ interface MessengerDeps {
135
135
  onMessage: (message: MessengerMessage, conversation: MessengerConversation) => void;
136
136
  onStartGuide: (key: string) => void;
137
137
  onError: (err: unknown) => void;
138
+ /** The SDK API's circuit breaker, told how each reply stream went. */
139
+ health?: ServerHealth;
138
140
  /** Poll intervals (ms): open thread, and unread badge otherwise. */
139
141
  pollMs?: {
140
142
  thread: number;
@@ -216,8 +218,9 @@ interface GuidelyOptions {
216
218
  /** Base URL of your Guidely deployment, e.g. `https://guidelytech.com`. */
217
219
  apiUrl?: string;
218
220
  /**
219
- * Where identity, cached config and queued events are persisted. Pass AsyncStorage
220
- * (`@react-native-async-storage/async-storage`); without it state lasts only for the app session.
221
+ * Where identity, cached config, queued events and unsent survey answers are persisted. Pass AsyncStorage
222
+ * (`@react-native-async-storage/async-storage`); without it state lasts only for the app session,
223
+ * so anything not yet sent during a Guidely outage is lost when the app restarts.
221
224
  */
222
225
  storage?: GuidelyStorage;
223
226
  debug?: boolean;
@@ -331,7 +334,7 @@ interface UiState {
331
334
  }
332
335
 
333
336
  declare const SDK_NAME = "@guidelytech/react-native";
334
- declare const SDK_VERSION = "0.8.0";
337
+ declare const SDK_VERSION = "0.10.0";
335
338
  declare const DEFAULT_API_URL = "https://guidelytech.com";
336
339
  /** Host-platform services the engine needs; the provider supplies React Native implementations. */
337
340
  interface PlatformBridge {
@@ -362,6 +365,8 @@ declare class GuidelyClient {
362
365
  private readonly store;
363
366
  private readonly emitter;
364
367
  private queue;
368
+ /** Survey answers, guide completions/dismissals and checklist progress, kept until the server has them. */
369
+ private outbox;
365
370
  private config;
366
371
  private configFetchedAt;
367
372
  private etag;
@@ -411,6 +416,8 @@ declare class GuidelyClient {
411
416
  private wireTimers;
412
417
  /** Re-fetches the published config and re-evaluates triggers. */
413
418
  refresh(): Promise<void>;
419
+ /** Re-renders after a config change (refresh, or a config that arrived after start). */
420
+ private applyConfigChange;
414
421
  /** Called by the provider with React Native `AppState` changes. */
415
422
  setAppState(state: "active" | "background" | "inactive" | string): void;
416
423
  private sessionExpired;
@@ -459,6 +466,8 @@ declare class GuidelyClient {
459
466
  private recordImpression;
460
467
  private recordEnd;
461
468
  private syncGuideState;
469
+ /** Queues a write in the persisted outbox (sent now, or once the API is reachable again). */
470
+ private sendDurably;
462
471
  private show;
463
472
  private showFlow;
464
473
  private showChecklist;
@@ -574,6 +583,7 @@ declare class GuidelyClient {
574
583
  audienceIds: string[];
575
584
  session: MobileSession;
576
585
  pendingEvents: number;
586
+ pendingWrites: number;
577
587
  targets: string[];
578
588
  flagsReady: boolean;
579
589
  };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { SelectorStrategy, MessengerConfig, MessengerMessage, MessengerConversat
4
4
  export { GuideStep, PublishedGuide, SdkConfigResponse } from '@guidelytech/shared';
5
5
  import { FlagsClientOptions, FlagsClient, JsonValue, FlagValue, FlagDetails, FlagsBootstrap, Attributes } from '@guidelytech/flags';
6
6
  export { Attributes, EvaluationResult, FlagDetails, FlagsBootstrap, FlagsClient, FlagsClientOptions, FlagsPayload, InMemoryStickyBucketStore, JsonValue, createFlagsClient } from '@guidelytech/flags';
7
- import { KeyValueStore, ChecklistProgressState, GuidelyEnvironment, ConsentState, GuidelyUser, GuidelyAccount, GuideLocalState, SessionState } from '@guidelytech/sdk-core/headless';
7
+ import { KeyValueStore, ServerHealth, ChecklistProgressState, GuidelyEnvironment, ConsentState, GuidelyUser, GuidelyAccount, GuideLocalState, SessionState } from '@guidelytech/sdk-core/headless';
8
8
  export { ChecklistProgressState, ConsentState, GuidelyAccount, GuidelyEnvironment, GuidelyUser } from '@guidelytech/sdk-core/headless';
9
9
  import { ViewProps, StyleProp, ViewStyle, View, GestureResponderEvent } from 'react-native';
10
10
 
@@ -135,6 +135,8 @@ interface MessengerDeps {
135
135
  onMessage: (message: MessengerMessage, conversation: MessengerConversation) => void;
136
136
  onStartGuide: (key: string) => void;
137
137
  onError: (err: unknown) => void;
138
+ /** The SDK API's circuit breaker, told how each reply stream went. */
139
+ health?: ServerHealth;
138
140
  /** Poll intervals (ms): open thread, and unread badge otherwise. */
139
141
  pollMs?: {
140
142
  thread: number;
@@ -216,8 +218,9 @@ interface GuidelyOptions {
216
218
  /** Base URL of your Guidely deployment, e.g. `https://guidelytech.com`. */
217
219
  apiUrl?: string;
218
220
  /**
219
- * Where identity, cached config and queued events are persisted. Pass AsyncStorage
220
- * (`@react-native-async-storage/async-storage`); without it state lasts only for the app session.
221
+ * Where identity, cached config, queued events and unsent survey answers are persisted. Pass AsyncStorage
222
+ * (`@react-native-async-storage/async-storage`); without it state lasts only for the app session,
223
+ * so anything not yet sent during a Guidely outage is lost when the app restarts.
221
224
  */
222
225
  storage?: GuidelyStorage;
223
226
  debug?: boolean;
@@ -331,7 +334,7 @@ interface UiState {
331
334
  }
332
335
 
333
336
  declare const SDK_NAME = "@guidelytech/react-native";
334
- declare const SDK_VERSION = "0.8.0";
337
+ declare const SDK_VERSION = "0.10.0";
335
338
  declare const DEFAULT_API_URL = "https://guidelytech.com";
336
339
  /** Host-platform services the engine needs; the provider supplies React Native implementations. */
337
340
  interface PlatformBridge {
@@ -362,6 +365,8 @@ declare class GuidelyClient {
362
365
  private readonly store;
363
366
  private readonly emitter;
364
367
  private queue;
368
+ /** Survey answers, guide completions/dismissals and checklist progress, kept until the server has them. */
369
+ private outbox;
365
370
  private config;
366
371
  private configFetchedAt;
367
372
  private etag;
@@ -411,6 +416,8 @@ declare class GuidelyClient {
411
416
  private wireTimers;
412
417
  /** Re-fetches the published config and re-evaluates triggers. */
413
418
  refresh(): Promise<void>;
419
+ /** Re-renders after a config change (refresh, or a config that arrived after start). */
420
+ private applyConfigChange;
414
421
  /** Called by the provider with React Native `AppState` changes. */
415
422
  setAppState(state: "active" | "background" | "inactive" | string): void;
416
423
  private sessionExpired;
@@ -459,6 +466,8 @@ declare class GuidelyClient {
459
466
  private recordImpression;
460
467
  private recordEnd;
461
468
  private syncGuideState;
469
+ /** Queues a write in the persisted outbox (sent now, or once the API is reachable again). */
470
+ private sendDurably;
462
471
  private show;
463
472
  private showFlow;
464
473
  private showChecklist;
@@ -574,6 +583,7 @@ declare class GuidelyClient {
574
583
  audienceIds: string[];
575
584
  session: MobileSession;
576
585
  pendingEvents: number;
586
+ pendingWrites: number;
577
587
  targets: string[];
578
588
  flagsReady: boolean;
579
589
  };