@wayq/beekon-rn 0.0.5 → 0.0.7

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.
Files changed (64) hide show
  1. package/BeekonRn.podspec +4 -2
  2. package/CHANGELOG.md +127 -0
  3. package/README.md +303 -81
  4. package/android/build.gradle +3 -2
  5. package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +164 -7
  6. package/ios/BeekonRn.mm +23 -0
  7. package/ios/BeekonRn.swift +199 -10
  8. package/ios/Frameworks/BeekonKit.xcframework/Info.plist +5 -5
  9. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/BeekonKit +0 -0
  10. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Info.plist +0 -0
  11. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.abi.json +7784 -2697
  12. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  13. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftinterface +111 -3
  14. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
  15. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Info.plist +0 -0
  16. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.abi.json +7784 -2697
  17. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  18. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +111 -3
  19. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +7784 -2697
  20. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  21. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +111 -3
  22. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +1 -1
  23. package/lib/module/NativeBeekonRn.js +20 -0
  24. package/lib/module/NativeBeekonRn.js.map +1 -1
  25. package/lib/module/beekon.js +90 -7
  26. package/lib/module/beekon.js.map +1 -1
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/internal/mappers.js +98 -4
  29. package/lib/module/internal/mappers.js.map +1 -1
  30. package/lib/module/types/auth.js +4 -0
  31. package/lib/module/types/auth.js.map +1 -0
  32. package/lib/module/types/error.js +13 -3
  33. package/lib/module/types/error.js.map +1 -1
  34. package/lib/module/types/license.js +2 -0
  35. package/lib/module/types/license.js.map +1 -0
  36. package/lib/typescript/src/NativeBeekonRn.d.ts +84 -0
  37. package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
  38. package/lib/typescript/src/beekon.d.ts +45 -1
  39. package/lib/typescript/src/beekon.d.ts.map +1 -1
  40. package/lib/typescript/src/index.d.ts +3 -1
  41. package/lib/typescript/src/index.d.ts.map +1 -1
  42. package/lib/typescript/src/internal/mappers.d.ts +12 -1
  43. package/lib/typescript/src/internal/mappers.d.ts.map +1 -1
  44. package/lib/typescript/src/types/auth.d.ts +99 -0
  45. package/lib/typescript/src/types/auth.d.ts.map +1 -0
  46. package/lib/typescript/src/types/config.d.ts +29 -0
  47. package/lib/typescript/src/types/config.d.ts.map +1 -1
  48. package/lib/typescript/src/types/enums.d.ts +14 -0
  49. package/lib/typescript/src/types/enums.d.ts.map +1 -1
  50. package/lib/typescript/src/types/error.d.ts +14 -4
  51. package/lib/typescript/src/types/error.d.ts.map +1 -1
  52. package/lib/typescript/src/types/license.d.ts +50 -0
  53. package/lib/typescript/src/types/license.d.ts.map +1 -0
  54. package/package.json +10 -2
  55. package/scripts/fetch-beekonkit.sh +4 -4
  56. package/src/NativeBeekonRn.ts +93 -0
  57. package/src/beekon.ts +104 -6
  58. package/src/index.tsx +4 -0
  59. package/src/internal/mappers.ts +109 -1
  60. package/src/types/auth.ts +101 -0
  61. package/src/types/config.ts +29 -0
  62. package/src/types/enums.ts +16 -0
  63. package/src/types/error.ts +19 -4
  64. package/src/types/license.ts +47 -0
@@ -1 +1 @@
1
- {"version":3,"names":["BeekonError","Error","constructor","kind","message","name"],"sourceRoot":"../../../src","sources":["types/error.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,SAASC,KAAK,CAAC;EAGrCC,WAAWA,CAACC,IAAqB,EAAEC,OAAe,EAAE;IAClD,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,aAAa;IACzB,IAAI,CAACF,IAAI,GAAGA,IAAI;EAClB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["BeekonError","Error","constructor","kind","message","name"],"sourceRoot":"../../../src","sources":["types/error.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,SAASC,KAAK,CAAC;EAGrCC,WAAWA,CAACC,IAAqB,EAAEC,OAAe,EAAE;IAClD,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,aAAa;IACzB,IAAI,CAACF,IAAI,GAAGA,IAAI;EAClB;AACF","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=license.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/license.ts"],"mappings":"","ignoreList":[]}
@@ -24,16 +24,44 @@ export type WireKeyValue = {
24
24
  key: string;
25
25
  value: string;
26
26
  };
27
+ /** Flat wire form of `AuthResponseMapping`. Omitted keys use common-name detection. */
28
+ export type WireAuthResponseMapping = {
29
+ accessToken?: string;
30
+ refreshToken?: string;
31
+ expiresIn?: string;
32
+ expiresAt?: string;
33
+ };
34
+ /**
35
+ * Flat wire form of `AuthConfig` on {@link WireSyncConfig.auth}. Enums travel as
36
+ * strings (`strategy`: 'bearer'|'raw'; `refreshBodyFormat`: 'form'|'json'),
37
+ * string maps as `WireKeyValue[]`, and `expiresAtMs` is epoch milliseconds.
38
+ */
39
+ export type WireAuthConfig = {
40
+ accessToken?: string;
41
+ refreshToken?: string;
42
+ expiresAtMs?: number;
43
+ strategy: string;
44
+ refreshUrl?: string;
45
+ refreshPayload: WireKeyValue[];
46
+ refreshHeaders: WireKeyValue[];
47
+ refreshBodyFormat: string;
48
+ responseMapping: WireAuthResponseMapping;
49
+ skewMarginSeconds: number;
50
+ seedEpoch?: number;
51
+ };
27
52
  export type WireSyncConfig = {
28
53
  url: string;
29
54
  headers: WireKeyValue[];
30
55
  intervalSeconds: number;
31
56
  batchSize: number;
57
+ /** Token-refresh recipe; omitted keeps static-header auth. */
58
+ auth?: WireAuthConfig;
32
59
  };
33
60
  /** Android-only foreground-service notification overrides. iOS ignores it. */
34
61
  export type WireNotificationConfig = {
35
62
  title?: string;
36
63
  text?: string;
64
+ smallIcon?: string;
37
65
  };
38
66
  export type WireConfig = {
39
67
  /** All fields required at the wire level — the TS facade applies defaults. */
@@ -49,6 +77,13 @@ export type WireConfig = {
49
77
  sync?: WireSyncConfig;
50
78
  /** Android-only; the iOS native module ignores it. */
51
79
  notification?: WireNotificationConfig;
80
+ /**
81
+ * License token (license-format-v1 §9). Omitted/`undefined` means unset — the
82
+ * native SDK falls through to the manifest / Info.plist. The wrapper passes it
83
+ * through verbatim (no trimming or fallback). `configure` crosses as an untyped
84
+ * object, so this field documents the shape rather than altering codegen.
85
+ */
86
+ licenseKey?: string;
52
87
  };
53
88
  export type WireLocation = {
54
89
  id: string;
@@ -101,6 +136,38 @@ export type WireSyncStatus = {
101
136
  /** Only populated when `type === 'failed'`. One of: 'auth' | 'rejected'. */
102
137
  failure?: string;
103
138
  };
139
+ /**
140
+ * A token set the SDK rotated, delivered on `onAuthTokens`. `expiresAtMs` is
141
+ * epoch milliseconds; both it and `refreshToken` are `null` when absent.
142
+ */
143
+ export type WireAuthTokens = {
144
+ accessToken: string;
145
+ refreshToken: string | null;
146
+ expiresAtMs: number | null;
147
+ epoch: number;
148
+ };
149
+ /**
150
+ * Flat wire form of the current platform's native license status
151
+ * (license-format-v1 §8). `status` is the wire-stable identifier; `tier` and
152
+ * `entitlements` are populated only when `status === 'licensed'` (null / empty
153
+ * otherwise), and `reason` only when `status === 'invalid'`.
154
+ */
155
+ export type WireLicenseStatus = {
156
+ /**
157
+ * One of: 'notDetermined' | 'licensed' | 'evaluation' | 'expired' |
158
+ * 'updateEntitlementLapsed' | 'invalid'.
159
+ */
160
+ status: string;
161
+ /** The opaque pricing tier; `null` unless `status === 'licensed'`. */
162
+ tier: string | null;
163
+ /** Opaque feature-gate strings; empty unless `status === 'licensed'`. */
164
+ entitlements: string[];
165
+ /**
166
+ * `null` unless `status === 'invalid'`. One of: 'malformed' | 'unknownKey' |
167
+ * 'badSignature' | 'appIdMismatch' | 'productMismatch' | 'unsupportedVersion'.
168
+ */
169
+ reason: string | null;
170
+ };
104
171
  export interface Spec extends TurboModule {
105
172
  /**
106
173
  * The config crosses as an untyped object (`ReadableMap` on Android,
@@ -113,6 +180,15 @@ export interface Spec extends TurboModule {
113
180
  start(): Promise<void>;
114
181
  stop(): Promise<void>;
115
182
  resumeIfNeeded(): Promise<void>;
183
+ /**
184
+ * One immediate fix. `accuracy` `''` uses the configured mode (a plain
185
+ * `string` rather than `string | null` for portable Codegen, matching
186
+ * `deleteLocations`). Resolves a 0- or 1-element array — empty means timeout /
187
+ * no fix — rather than a nullable struct, which Codegen does not portably
188
+ * support. Rejects with `PERMISSION_DENIED` / `LOCATION_SERVICES_DISABLED` /
189
+ * `LOCATION_UNAVAILABLE` on a precondition failure.
190
+ */
191
+ getCurrentLocation(timeoutMs: number, accuracy: string): Promise<WireLocation[]>;
116
192
  getLocations(fromMs: number, toMs: number): Promise<WireLocation[]>;
117
193
  /**
118
194
  * A negative `beforeMs` deletes all stored locations (the wire encoding of
@@ -126,10 +202,18 @@ export interface Spec extends TurboModule {
126
202
  addGeofences(geofences: WireGeofence[]): Promise<void>;
127
203
  removeGeofences(ids: string[]): Promise<void>;
128
204
  listGeofences(): Promise<WireGeofence[]>;
205
+ /**
206
+ * The current platform's native license status (license-format-v1 §8). Each
207
+ * native SDK validates independently; this reflects only the platform you are
208
+ * running on — no cross-platform merging.
209
+ */
210
+ licenseStatus(): Promise<WireLicenseStatus>;
129
211
  readonly onState: CodegenTypes.EventEmitter<WireState>;
130
212
  readonly onLocation: CodegenTypes.EventEmitter<WireLocation>;
131
213
  readonly onGeofenceEvent: CodegenTypes.EventEmitter<WireGeofenceEvent>;
132
214
  readonly onSyncStatus: CodegenTypes.EventEmitter<WireSyncStatus>;
215
+ readonly onAuthTokens: CodegenTypes.EventEmitter<WireAuthTokens>;
216
+ readonly onLicenseStatus: CodegenTypes.EventEmitter<WireLicenseStatus>;
133
217
  }
134
218
  declare const _default: Spec;
135
219
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeBeekonRn.d.ts","sourceRoot":"","sources":["../../../src/NativeBeekonRn.ts"],"names":[],"mappings":"AAAA;;;;;;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AAC,CAAC;IACnD,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD,YAAY,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,aAAa,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAEzC;;;;OAIG;IACH,aAAa,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE5C,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACvD,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC7D,QAAQ,CAAC,eAAe,EAAE,YAAY,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;IACvE,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IACjE,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IACjE,QAAQ,CAAC,eAAe,EAAE,YAAY,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;CACxE;;AAED,wBAAkE"}
@@ -1,5 +1,8 @@
1
+ import type { AuthTokens } from './types/auth';
1
2
  import type { BeekonConfig } from './types/config';
3
+ import type { AccuracyMode } from './types/enums';
2
4
  import type { BeekonGeofence, GeofenceEvent } from './types/geofence';
5
+ import type { LicenseStatus } from './types/license';
3
6
  import type { Location } from './types/location';
4
7
  import type { BeekonState } from './types/state';
5
8
  import type { SyncStatus } from './types/sync';
@@ -49,6 +52,26 @@ declare class BeekonImpl {
49
52
  * in the AppDelegate). See the README.
50
53
  */
51
54
  resumeIfNeeded(): Promise<void>;
55
+ /**
56
+ * Return a single fresh fix on demand — for the moment a host needs an
57
+ * immediate position (e.g. the instant a trip starts).
58
+ *
59
+ * Independent of tracking: works whether or not a session is running and never
60
+ * starts, stops, or disturbs one. The fix is not persisted and does not appear
61
+ * on `onLocation` — it is returned here only, tagged `'manual'`.
62
+ *
63
+ * Resolves `null` if no usable fix arrives within `timeoutMs` (default
64
+ * 15000). `accuracy` overrides the configured mode for this call only;
65
+ * omitted uses the configured mode.
66
+ *
67
+ * Throws `BeekonError` with kind `'permissionDenied'`,
68
+ * `'locationServicesDisabled'`, or `'locationUnavailable'` on a precondition
69
+ * failure.
70
+ */
71
+ getCurrentLocation(options?: {
72
+ timeoutMs?: number;
73
+ accuracy?: AccuracyMode;
74
+ }): Promise<Location | null>;
52
75
  /**
53
76
  * Read persisted fixes in the inclusive range `[from, to]`, oldest first.
54
77
  * Reads come from the SDK's local storage (Room on Android, GRDB on iOS) — the
@@ -59,7 +82,7 @@ declare class BeekonImpl {
59
82
  */
60
83
  getLocations(from: Date, to: Date): Promise<Location[]>;
61
84
  /**
62
- * Delete stored locations captured at or before `before` (all of them when
85
+ * Delete stored locations captured before `before` (all of them when
63
86
  * `before` is omitted). Returns the number of rows removed. Throws
64
87
  * `BeekonError` with kind `'storage'` on a failure.
65
88
  */
@@ -86,6 +109,13 @@ declare class BeekonImpl {
86
109
  removeGeofences(ids: string[]): Promise<void>;
87
110
  /** The currently registered geofences. */
88
111
  listGeofences(): Promise<BeekonGeofence[]>;
112
+ /**
113
+ * The current platform's license status (license-format-v1 §8). Android and
114
+ * iOS validate independently — this reflects the platform you are running on,
115
+ * with no cross-platform merging. Purely observational: a license never blocks,
116
+ * degrades, or delays the SDK. For live transitions use {@link onLicenseStatus}.
117
+ */
118
+ licenseStatus(): Promise<LicenseStatus>;
89
119
  /**
90
120
  * Subscribe to tracking-state transitions (`idle` / `tracking` /
91
121
  * `stopped(reason)`). The current state is delivered to new subscribers
@@ -109,6 +139,20 @@ declare class BeekonImpl {
109
139
  * Returns an unsubscribe function.
110
140
  */
111
141
  onSyncStatus(cb: (s: SyncStatus) => void): () => void;
142
+ /**
143
+ * Subscribe to token rotations the SDK performed during a native refresh (see
144
+ * `SyncConfig.auth`). Mirror them into your own session store. The latest
145
+ * rotation is delivered to new subscribers immediately (replay-1). Sensitive —
146
+ * delivered in-process only, never logged. Returns an unsubscribe function.
147
+ */
148
+ onAuthTokens(cb: (t: AuthTokens) => void): () => void;
149
+ /**
150
+ * Subscribe to license-status transitions for the current platform
151
+ * (license-format-v1 §8). The current status is delivered to new subscribers
152
+ * immediately (replay-1), then again on each transition (the first validation
153
+ * is lazy). Purely observational. Returns an unsubscribe function.
154
+ */
155
+ onLicenseStatus(cb: (s: LicenseStatus) => void): () => void;
112
156
  }
113
157
  export declare const Beekon: BeekonImpl;
114
158
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"beekon.d.ts","sourceRoot":"","sources":["../../../src/beekon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8F/C;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAM,UAAU;IACd,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkB;IAEtC;;;;;OAKG;IACG,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B,mEAAmE;IAC7D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3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ig, NotificationConfig, } from './types/config';
3
- export type { AccuracyMode, StationaryMode, LocationTrigger, LocationQuality, MotionState, ActivityType, } from './types/enums';
3
+ export type { AccuracyMode, StationaryMode, LocationTrigger, LocationQuality, MotionState, ActivityType, AuthStrategy, AuthBodyFormat, } from './types/enums';
4
+ export type { AuthConfig, AuthResponseMapping, AuthTokens } from './types/auth';
4
5
  export type { Location } from './types/location';
5
6
  export type { BeekonGeofence, GeofenceEvent, Transition, } from './types/geofence';
6
7
  export type { BeekonState, StopReason } from './types/state';
7
8
  export type { SyncStatus, SyncFailure } from './types/sync';
9
+ export type { LicenseStatus, LicenseInvalidReason } from './types/license';
8
10
  export { BeekonError, type BeekonErrorKind } from './types/error';
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,YAAY,EACV,YAAY,EACZ,UAAU,EACV,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,eAAe,EACf,eAAe,EACf,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EACV,cAAc,EACd,aAAa,EACb,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,YAAY,EACV,YAAY,EACZ,UAAU,EACV,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,eAAe,EACf,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChF,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EACV,cAAc,EACd,aAAa,EACb,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -1,17 +1,28 @@
1
+ import type { AuthConfig, AuthTokens } from '../types/auth';
1
2
  import type { BeekonConfig } from '../types/config';
2
3
  import type { BeekonGeofence, GeofenceEvent } from '../types/geofence';
4
+ import type { LicenseStatus } from '../types/license';
3
5
  import type { Location } from '../types/location';
4
6
  import type { BeekonState } from '../types/state';
5
7
  import type { SyncStatus } from '../types/sync';
6
- import type { WireConfig, WireGeofence, WireGeofenceEvent, WireKeyValue, WireLocation, WireState, WireSyncStatus } from '../NativeBeekonRn';
8
+ import type { WireAuthConfig, WireAuthTokens, WireConfig, WireGeofence, WireGeofenceEvent, WireKeyValue, WireLicenseStatus, WireLocation, WireState, WireSyncStatus } from '../NativeBeekonRn';
7
9
  export declare function recordToEntries(record: Record<string, string> | undefined): WireKeyValue[];
8
10
  export declare function configToWire(config: BeekonConfig): WireConfig;
9
11
  export declare function geofenceToWire(g: BeekonGeofence): WireGeofence;
12
+ export declare function authToWire(a: AuthConfig): WireAuthConfig;
10
13
  export declare function wireToLocation(w: WireLocation): Location;
11
14
  export declare function wireToGeofence(w: WireGeofence): BeekonGeofence;
12
15
  export declare function wireToGeofenceEvent(w: WireGeofenceEvent): GeofenceEvent;
13
16
  export declare function wireToState(w: WireState): BeekonState;
14
17
  export declare function wireToSyncStatus(w: WireSyncStatus): SyncStatus;
18
+ /** `expiresAtMs` (epoch millis) becomes a `Date`; `null` propagates faithfully. */
19
+ export declare function wireToAuthTokens(w: WireAuthTokens): AuthTokens;
20
+ /**
21
+ * Decode the wire-stable license status into the public discriminated union. The
22
+ * native side already decided the status (the wrapper performs no validation) —
23
+ * this only re-shapes the flat wire form and validates the enum strings.
24
+ */
25
+ export declare function wireToLicenseStatus(w: WireLicenseStatus): LicenseStatus;
15
26
  /**
16
27
  * Re-throw a native promise rejection as a typed {@link BeekonError}. The native
17
28
  * modules encode the kind in the error-code string (`STORAGE_FAILURE`,
@@ -1 +1 @@
1
- {"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../../src/internal/mappers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AASpD,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EAEd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAe,UAAU,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,EACf,MAAM,mBAAmB,CAAC;AAiB3B,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACzC,YAAY,EAAE,CAGhB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAA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GAAG,SAAS,GACzC,YAAY,EAAE,CAGhB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAmC7D;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,GAAG,YAAY,CAS9D;AAID,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,cAAc,CAqBxD;AAID,wBAAgB,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,QAAQ,CA0CxD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,cAAc,CAS9D;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,iBAAiB,GAAG,aAAa,CAOvE;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,GAAG,WAAW,CAYrD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,cAAc,GAAG,UAAU,CAW9D;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,cAAc,GAAG,UAAU,CAO9D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,iBAAiB,GAAG,aAAa,CAqCvE;AAoCD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,KAAK,CAQtD"}
@@ -0,0 +1,99 @@
1
+ import type { AuthBodyFormat, AuthStrategy } from './enums';
2
+ /**
3
+ * Where the SDK reads rotated tokens from the JSON response to a refresh
4
+ * request. Mirrors the native `AuthResponseMapping` (iOS) / `ResponseMapping`
5
+ * (Android).
6
+ *
7
+ * Each value is a response key. An omitted field falls back to common-name
8
+ * detection: `access_token`/`accessToken`/`token` for the access token,
9
+ * `refresh_token`/`refreshToken` for a rotated refresh token, and `expires_in`
10
+ * (relative seconds) or `expires_at`/`expires` (absolute epoch seconds) for the
11
+ * expiry. The default (all-omitted) is pure common-name detection.
12
+ */
13
+ export type AuthResponseMapping = {
14
+ /** Response key holding the new access token. Omitted uses common-name detection. */
15
+ accessToken?: string;
16
+ /** Response key holding a rotated refresh token. Omitted uses common-name detection. */
17
+ refreshToken?: string;
18
+ /** Response key holding a relative lifetime in seconds. Omitted uses detection. */
19
+ expiresIn?: string;
20
+ /** Response key holding an absolute expiry in epoch seconds. Omitted uses detection. */
21
+ expiresAt?: string;
22
+ };
23
+ /**
24
+ * Declarative recipe for native token refresh, set on `SyncConfig.auth`.
25
+ * Mirrors the native `AuthConfig`.
26
+ *
27
+ * When present, the SDK attaches the access token to every upload (per
28
+ * {@link AuthConfig.strategy}), refreshes it **proactively** before
29
+ * {@link AuthConfig.expiresAt} and **reactively** on a `401`/`403`, then retries
30
+ * the upload — all natively, so it works in the background and on a cold launch
31
+ * with no host involvement. Omit {@link AuthConfig.refreshUrl} to disable
32
+ * refresh and keep the legacy behaviour (a `401`/`403` pauses sync and surfaces
33
+ * `SyncFailure 'auth'`).
34
+ *
35
+ * **Tokens are a seed, not config.** {@link AuthConfig.accessToken},
36
+ * {@link AuthConfig.refreshToken} and {@link AuthConfig.expiresAt} are supplied
37
+ * once; the SDK then owns and rotates the live token set in secure storage
38
+ * (Keychain / encrypted prefs). Observe rotations via `Beekon.onAuthTokens()` to
39
+ * mirror the tokens into your own session store.
40
+ *
41
+ * Requires the native SDK ≥ 0.0.6; with an older native binary the recipe is
42
+ * ignored and only static `SyncConfig.headers` apply.
43
+ */
44
+ export type AuthConfig = {
45
+ /** Initial access token. A seed: the SDK owns and rotates it after first persist. */
46
+ accessToken?: string;
47
+ /** Initial refresh token POSTed to {@link AuthConfig.refreshUrl}. A seed. */
48
+ refreshToken?: string;
49
+ /** Absolute expiry of {@link AuthConfig.accessToken}. Omitted disables proactive refresh. */
50
+ expiresAt?: Date;
51
+ /** How the access token is attached. Default: `'bearer'`. */
52
+ strategy?: AuthStrategy;
53
+ /** Authorization server's refresh endpoint. Omitted disables refresh. */
54
+ refreshUrl?: string;
55
+ /**
56
+ * Form fields POSTed to {@link AuthConfig.refreshUrl}. A value containing
57
+ * `{refreshToken}` is substituted with the current refresh token. Default: empty.
58
+ */
59
+ refreshPayload?: Record<string, string>;
60
+ /**
61
+ * Headers sent on the refresh request. A value containing `{accessToken}` is
62
+ * substituted with the current access token. Default:
63
+ * `{ Authorization: 'Bearer {accessToken}' }`.
64
+ */
65
+ refreshHeaders?: Record<string, string>;
66
+ /** Encoding of the refresh request body. Default: `'form'`. */
67
+ refreshBodyFormat?: AuthBodyFormat;
68
+ /** Where to read rotated tokens from the refresh response. Default: detection. */
69
+ responseMapping?: AuthResponseMapping;
70
+ /** Seconds before {@link AuthConfig.expiresAt} at which a proactive refresh fires. Default: `60`. */
71
+ skewMarginSeconds?: number;
72
+ /**
73
+ * Optional monotonic re-seed signal. When greater than the SDK's stored epoch,
74
+ * a re-supplied seed replaces the rotated token set (e.g. after the user
75
+ * re-authenticates). Omitted adopts a re-supplied seed only when no token has
76
+ * been stored yet.
77
+ */
78
+ seedEpoch?: number;
79
+ };
80
+ /**
81
+ * A token set the SDK rotated, delivered via `Beekon.onAuthTokens()`. Mirrors
82
+ * the native `AuthTokens` (iOS) / `TokenRefresh` (Android).
83
+ *
84
+ * Treat these as sensitive: they are delivered in-process only and are never
85
+ * logged or persisted to plaintext. Use them to mirror the SDK's current
86
+ * credentials into your own session store. The latest rotation is replayed to
87
+ * new subscribers (replay-1).
88
+ */
89
+ export type AuthTokens = {
90
+ /** The rotated access token now in use. */
91
+ accessToken: string;
92
+ /** The current refresh token (rotated if the server returned a new one), or `null`. */
93
+ refreshToken: string | null;
94
+ /** Absolute expiry of {@link AuthTokens.accessToken}, or `null` if the response carried none. */
95
+ expiresAt: Date | null;
96
+ /** The SDK's monotonic token generation, incremented on each successful refresh. */
97
+ epoch: number;
98
+ };
99
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/types/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,S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AM,CAAC;CACf,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { AuthConfig } from './auth';
1
2
  import type { AccuracyMode, StationaryMode } from './enums';
2
3
  /**
3
4
  * Foreground-service notification overrides. **Android-only** — the platform
@@ -10,6 +11,14 @@ export type NotificationConfig = {
10
11
  title?: string;
11
12
  /** Notification body text. Defaults to no body. */
12
13
  text?: string;
14
+ /**
15
+ * Status-bar icon, given as an Android drawable or mipmap resource **name**
16
+ * — `"ic_notification"`, `"drawable/ic_x"`, or `"mipmap/ic_x"`. Android
17
+ * renders the small icon from its alpha channel only, so supply a monochrome
18
+ * silhouette on a transparent background. Falls back to the host app's
19
+ * launcher icon when omitted or unresolvable.
20
+ */
21
+ smallIcon?: string;
13
22
  };
14
23
  /**
15
24
  * Server-upload configuration. Presence of {@link BeekonConfig.sync} turns on
@@ -28,6 +37,13 @@ export type SyncConfig = {
28
37
  intervalSeconds?: number;
29
38
  /** Maximum locations per upload. Clamped to `[1, 1000]`. Default: `100`. */
30
39
  batchSize?: number;
40
+ /**
41
+ * Declarative token-refresh recipe. When set, the SDK attaches and natively
42
+ * refreshes the access token (proactively before expiry, reactively on
43
+ * `401`/`403`). Omit to keep the legacy static-{@link SyncConfig.headers}
44
+ * behaviour. Requires the native SDK ≥ 0.0.6. See {@link AuthConfig}.
45
+ */
46
+ auth?: AuthConfig;
31
47
  };
32
48
  /**
33
49
  * Tracking configuration. Every field is optional — `Beekon.start()` falls back
@@ -59,5 +75,18 @@ export type BeekonConfig = {
59
75
  sync?: SyncConfig;
60
76
  /** Android-only notification overrides. Ignored on iOS. */
61
77
  notification?: NotificationConfig;
78
+ /**
79
+ * Beekon license token (a `license-format-v1` JWS). The **highest-priority**
80
+ * supply channel (spec §9): it overrides the platform manifest value
81
+ * (`in.wayq.beekon.license` meta-data on Android, `BeekonLicenseKey` in
82
+ * `Info.plist` on iOS). `undefined`, blank, or whitespace-only means unset —
83
+ * the SDK falls through to the manifest, then to evaluation mode.
84
+ *
85
+ * The license **never blocks** the SDK; observe the outcome via
86
+ * {@link Beekon.licenseStatus} / {@link Beekon.onLicenseStatus}. Safe to commit
87
+ * to source control: a token is app-id-bound and product-bound, so it is
88
+ * useless to anyone else. Default: unset.
89
+ */
90
+ licenseKey?: string;
62
91
  };
63
92
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,yEAAyE;IACzE,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,8EAA8E;IAC9E,iCAAiC,CAAC,EAAE,MAAM,CAAC;IAC3C,wDAAwD;IACxD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,sDAAsD;IACtD,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,6EAA6E;IAC7E,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qEAAqE;IACrE,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,2DAA2D;IAC3D,Y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AAC,EAAE,kBAAkB,CAAC;IAClC;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -45,4 +45,18 @@ export type MotionState = 'moving' | 'stationary' | 'unknown';
45
45
  * {@link BeekonConfig.detectActivity} is enabled; otherwise `null`.
46
46
  */
47
47
  export type ActivityType = 'stationary' | 'walking' | 'running' | 'cycling' | 'automotive' | 'unknown';
48
+ /**
49
+ * How the access token is attached to upload requests (token refresh).
50
+ *
51
+ * - `'bearer'` — `Authorization: Bearer <accessToken>` (JWT / OAuth2 style, default).
52
+ * - `'raw'` — `Authorization: <accessToken>` (the raw token, no scheme).
53
+ */
54
+ export type AuthStrategy = 'bearer' | 'raw';
55
+ /**
56
+ * Encoding of the token-refresh request body.
57
+ *
58
+ * - `'form'` — `application/x-www-form-urlencoded` (default; most OAuth2 endpoints).
59
+ * - `'json'` — `application/json`.
60
+ */
61
+ export type AuthBodyFormat = 'form' | 'json';
48
62
  //# sourceMappingURL=enums.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../../src/types/enums.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,OAAO,GAAG,mBAAmB,CAAC;AAE5E;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,QAAQ,GACR,SAAS,GACT,UAAU,GACV,QAAQ,CAAC;AAEb;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,aAAa,GAAG,kBAAkB,CAAC;AAExE,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,YAAY,GACZ,SAAS,GACT,SAAS,GACT,SAAS,GACT,YAAY,GACZ,SAAS,CAAC"}
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../../src/types/enums.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,OAAO,GAAG,mBAAmB,CAAC;AAE5E;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,QAAQ,GACR,SAAS,GACT,UAAU,GACV,QAAQ,CAAC;AAEb;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,aAAa,GAAG,kBAAkB,CAAC;AAExE,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,YAAY,GACZ,SAAS,GACT,SAAS,GACT,SAAS,GACT,YAAY,GACZ,SAAS,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC"}
@@ -1,14 +1,24 @@
1
1
  /**
2
- * Error kinds thrown across the bridge. These are the **only** errors Beekon
3
- * throws — permission / location-services / lifecycle problems never throw; they
4
- * surface on the `onState` stream as `stopped(reason)` instead.
2
+ * Error kinds thrown across the bridge.
3
+ *
4
+ * Lifecycle problems on the tracking path never throw — they surface on the
5
+ * `onState` stream as `stopped(reason)`. The exceptions are the storage/geofence
6
+ * kinds below and the precondition kinds thrown by the explicit one-shot
7
+ * `getCurrentLocation()` (which has no `onState` arc of its own to report on; a
8
+ * plain timeout returns `null` instead of throwing).
5
9
  *
6
10
  * - `'storage'` — a local-store (SQLite) read/write failed. Thrown by
7
11
  * `getLocations()`, `deleteLocations()`, and `pendingUploadCount()`.
8
12
  * - `'invalidGeofence'` — a geofence passed to `addGeofences()` failed
9
13
  * validation (empty/oversized id, or non-positive radius).
14
+ * - `'permissionDenied'` — location permission is missing. Thrown by
15
+ * `getCurrentLocation()`.
16
+ * - `'locationServicesDisabled'` — system location services are off. Thrown by
17
+ * `getCurrentLocation()`.
18
+ * - `'locationUnavailable'` — location is otherwise unavailable (e.g. Play
19
+ * Services absent/old). Thrown by `getCurrentLocation()`.
10
20
  */
11
- export type BeekonErrorKind = 'storage' | 'invalidGeofence';
21
+ export type BeekonErrorKind = 'storage' | 'invalidGeofence' | 'permissionDenied' | 'locationServicesDisabled' | 'locationUnavailable';
12
22
  /**
13
23
  * Typed error surfaced from the bridge. The native module rejects promises with
14
24
  * the kind encoded as the error code; the facade re-wraps into this.
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/types/error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,iBAAiB,CAAC;AAE5D;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,SAAgB,IAAI,EAAE,eAAe,CAAC;gBAE1B,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;CAKnD"}
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/types/error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,iBAAiB,GACjB,kBAAkB,GAClB,0BAA0B,GAC1B,qBAAqB,CAAC;AAE1B;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,SAAgB,IAAI,EAAE,eAAe,CAAC;gBAE1B,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;CAKnD"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Why an invalid license token failed verification (license-format-v1 §8.1).
3
+ * These are the exact wire-stable identifiers — the string names *are* the
4
+ * contract, shared verbatim with both native SDKs.
5
+ *
6
+ * - `'malformed'` — unparseable: bad encoding, structure, header, or claim types.
7
+ * - `'unknownKey'` — signed with a key this SDK build does not embed (update the SDK).
8
+ * - `'badSignature'` — the ES256 signature does not verify.
9
+ * - `'appIdMismatch'` — the license does not cover this application id.
10
+ * - `'productMismatch'` — the license does not cover this framework (here, `rn`).
11
+ * - `'unsupportedVersion'` — the token's claim schema is newer than this SDK understands.
12
+ */
13
+ export type LicenseInvalidReason = 'malformed' | 'unknownKey' | 'badSignature' | 'appIdMismatch' | 'productMismatch' | 'unsupportedVersion';
14
+ /**
15
+ * License verification status for the **current platform** (license-format-v1
16
+ * §8). Purely observational — no status ever blocks, degrades, or delays the
17
+ * SDK. Use the `status` field as a discriminator.
18
+ *
19
+ * - `'notDetermined'` — before the first (lazy) validation completes.
20
+ * - `'evaluation'` — no license key supplied through any channel; running free.
21
+ * - `'expired'` — the license's expiry has passed.
22
+ * - `'updateEntitlementLapsed'` — this SDK build is newer than the license's
23
+ * covered update window. Still fully functional; renew to cover newer releases.
24
+ * - `'licensed'` — a valid license covering this app, framework, and SDK release;
25
+ * carries the opaque `tier` and `entitlements` (empty when the token carried none).
26
+ * - `'invalid'` — verification failed; see {@link LicenseInvalidReason}.
27
+ *
28
+ * **Platform divergence is legal** (spec §8.2): Android and iOS validate
29
+ * independently, so for one app the two platforms may report different statuses
30
+ * (e.g. a license scoped to `["android"]` reads `licensed` on Android and
31
+ * `invalid` / `productMismatch` on iOS). This value reflects only the platform
32
+ * you are running on; the wrapper never merges across platforms.
33
+ */
34
+ export type LicenseStatus = {
35
+ status: 'notDetermined';
36
+ } | {
37
+ status: 'evaluation';
38
+ } | {
39
+ status: 'expired';
40
+ } | {
41
+ status: 'updateEntitlementLapsed';
42
+ } | {
43
+ status: 'licensed';
44
+ tier: string;
45
+ entitlements: string[];
46
+ } | {
47
+ status: 'invalid';
48
+ reason: LicenseInvalidReason;
49
+ };
50
+ //# sourceMappingURL=license.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../../../src/types/license.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAC5B,WAAW,GACX,YAAY,GACZ,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,oBAAoB,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,GAC3B;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,yBAAyB,CAAA;CAAE,GACrC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GAC5D;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,CAAC"}