@arkadiuminc/sdk 2.78.0 → 2.78.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.
@@ -1,11 +1,21 @@
1
1
  import { ObserverFn } from '../utils/observable';
2
2
  import { IDebugMenuRuntimeDependencies } from '../debug';
3
3
 
4
+ export declare enum AssignMode {
5
+ Normal = "normal",
6
+ Block = "block",
7
+ Override = "override"
8
+ }
9
+ export declare type DebugModeOptions = {
10
+ assignMode: AssignMode;
11
+ stopPropagation?: boolean;
12
+ };
4
13
  export declare class DebugProvider {
5
14
  private static _instance;
6
15
  private observers;
7
16
  private isDebug;
8
17
  private debugMenuDependencies;
18
+ private assignMode;
9
19
  private constructor();
10
20
  registerRpcHandlers(): void;
11
21
  static get Instance(): DebugProvider;
@@ -14,9 +24,10 @@ export declare class DebugProvider {
14
24
  private initDebugMode;
15
25
  private syncWithLogger;
16
26
  isDebugMode(): boolean;
17
- setDebugMode(isEnabled: boolean): void;
27
+ setDebugMode(isEnabled: boolean, { assignMode, stopPropagation }?: Partial<DebugModeOptions>): void;
18
28
  private updateDebugMode;
19
29
  private propagateDebugMode;
30
+ getAssignMode(): AssignMode;
20
31
  sendDebugEvent(type: string, ...args: any[]): void;
21
32
  onDebugEvent(observer: ObserverFn<string>): void;
22
33
  setDebugMenuDependencies(deps: IDebugMenuRuntimeDependencies): void;
@@ -0,0 +1,8 @@
1
+ import { ApiEnv } from '../features/backend/backend.api';
2
+ import { AssignMode } from './debug-provider';
3
+
4
+ export interface EnvDiscovererResult {
5
+ env: ApiEnv;
6
+ isDebugMode: boolean;
7
+ debugAssignMode: AssignMode;
8
+ }
@@ -40,14 +40,30 @@ export declare class AuthArena extends Auth {
40
40
  private eagleId?;
41
41
  private arkUserId?;
42
42
  private arkUserIdPromise?;
43
- private arkSessionId?;
44
43
  private userProfilePromise?;
45
44
  constructor(backendApi: Backend, host: IHost, rpcProvider: RpcProvider, persistence: PersistenceArena);
46
45
  getUserProfile(): Promise<UserProfile | null>;
47
- getUserIdentity(): Promise<UserIdentity>;
46
+ getUserIdentity(updateSessionActivity?: boolean): Promise<UserIdentity>;
47
+ private getEagleId;
48
+ /**
49
+ * Returns a stable ark user id for this browser/device. The id is read from local persistence
50
+ * (`unique-arkadium-id`); if none exists, a new UUID is generated, stored, and reused on later
51
+ * calls. Cleared browser storage yields a new id. Cached in memory and deduped while in flight.
52
+ */
48
53
  private getOrCreateArkUserId;
49
54
  private resolveArkUserId;
55
+ /**
56
+ * Returns a persisted ark session id. State is stored in local persistence (`arkadium-ark-session`)
57
+ * (id, createdAt, lastActivityAt). A new id is generated when storage is missing or cleared,
58
+ * when the session is older than 24 hours, or — only when `updateSessionActivity` is true —
59
+ * when no analytics activity was recorded for 30 minutes. Pass `updateSessionActivity` from
60
+ * analytics sends; game-facing `getUserIdentity()` uses the default (read-only, no inactivity bump).
61
+ */
50
62
  private getOrCreateArkSessionId;
63
+ private loadArkSessionState;
64
+ private isArkSessionExpired;
65
+ private createArkSession;
66
+ private persistArkSessionState;
51
67
  }
52
68
  export declare class AuthGame extends Auth {
53
69
  private rpcProvider;
@@ -14,6 +14,7 @@ import { TournamentsGame } from './api/features/tournaments';
14
14
  import { RecorderGame } from './api/features/recorder';
15
15
  import { ILogger } from './api/features/logger';
16
16
  import { ConfigGame } from './api/features/config';
17
+ import { EnvDiscovererResult } from './api/core/types';
17
18
 
18
19
  export declare class ArkadiumGameSdk {
19
20
  version: string;
@@ -69,7 +70,7 @@ declare global {
69
70
  }
70
71
  }
71
72
  interface EnvDiscoverer {
72
- discover(): Promise<ApiEnv>;
73
+ discover(): Promise<EnvDiscovererResult>;
73
74
  }
74
75
  export declare class GameApi {
75
76
  static version: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.78.0",
3
+ "version": "2.78.2",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",