@xorgate/react-native 0.2.1 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ Tracks `@xorgate/react` 0.4.0: recorded telemetry read straight from S3
6
+ when the replay manifest carries its `telemetry` block. No native change:
7
+ the same `dist`, plus re-exports.
8
+
9
+ ### Added
10
+
11
+ - **`useReplayTelemetry` artifact mode**, re-exported unchanged from
12
+ `@xorgate/react`. When `useReplayManifest` (or your own manifest fetch)
13
+ returns a manifest with a `telemetry` block, the hook reads one presigned
14
+ overview object per telemetry session for the route line and the scrub
15
+ preview, and the device's own 60 s segments for the readouts around the
16
+ playhead: no `/telemetry` call through your relay, no Lambda, no database.
17
+ Without the block, the REST path works as before, with its
18
+ `Promise.all` bug fixed (one throttled group no longer wipes the route).
19
+ `useReplayTelemetry().source` says which path served the replay.
20
+ - **`useReplayManifest` polls every 60 s while a session is open**, so a
21
+ replay opened mid-drive grows on a phone the same way it does on the web.
22
+ `player.telemetry` (the block, from the latest manifest) and
23
+ `player.notifyUrlsExpired()` (the 403 seam) are on the native
24
+ `useReplayPlayer` too, because it spreads the core.
25
+ - The artifact helpers and types (`overviewToSeries`, `segmentToSeries`,
26
+ `insightsFromOverview`, `mergeSeries`, `buildOverviewSeries`,
27
+ `chooseBucketMs`, `segmentsCovering`, `artifactKey`,
28
+ `manifestHasOpenSession`, `REPLAY_OPEN_POLL_MS`, `OverviewV1`,
29
+ `ReplayTelemetrySource`, ...) and the `ReplayTelemetry*`,
30
+ `TelemetryInsights`, `TelemetryInsightEvent` and `TelemetrySession` types.
31
+
32
+ ### Verified on hardware
33
+
34
+ - **No inflater, on purpose.** Every artifact URL the manifest hands out is
35
+ served with `Content-Encoding: gzip`; React Native has no
36
+ `DecompressionStream` and this package adds no dependency for it. A plain
37
+ `fetch()` of a normalised segment returns the JSONL text and of an overview
38
+ returns the JSON, inflated by the platform's own networking stack, on both
39
+ an iOS simulator and an Android emulator (the check and its numbers are
40
+ recorded in the telemetry-session-artifacts plan's PROGRESS.md).
41
+
42
+ ## 0.3.0
43
+
44
+ Tracks `@xorgate/react` 0.3.0 (live scope) and `@xorgate/sdk` 0.7.0 (device
45
+ transfer). No native change: the same `dist`, plus re-exports.
46
+
47
+ ### Added
48
+
49
+ - **`useLiveScope()` and `useDeviceScope(deviceId)`**, re-exported unchanged
50
+ from `@xorgate/react`. A device can be transferred to another workspace or
51
+ organization while a viewer is open; the vended live credential is cached for
52
+ up to ~50 minutes, and neither plane fails loudly when it goes stale —
53
+ telemetry simply stops arriving and video keeps flowing until the next
54
+ reconnect. `useDeviceScope` turns that into a typed `DEVICE_OUT_OF_SCOPE`,
55
+ re-vending once first. `useLiveScope().invalidate()` makes every open live
56
+ consumer re-resolve after you transfer a device yourself.
57
+
58
+ **This matters more on a phone than on the web.** A backgrounded app resumes
59
+ onto the same cached credential, and `appStateWake` nudges the live planes
60
+ back up — straight onto the stale scope. The scope guard is what makes the
61
+ resume honest.
62
+
63
+ - The transfer vocabulary from `@xorgate/sdk` (`TransferSummary`,
64
+ `TransferPreview`, `TransferOffer`, `TransferOfferPreview`,
65
+ `TransferAdoption`, `ScopeAttributeResult` and the rest), so a screen and a
66
+ server route pass the same objects around.
67
+
68
+ ### Unchanged, and checked
69
+
70
+ - **Replay carries no tenancy assumption.** Segment playback runs on presigned
71
+ URLs minted per manifest and refreshed from `manifest.urlExpiresAt`; nothing
72
+ in `replay-engine.ts` caches an organization or workspace id, so a transfer
73
+ cannot strand a replay. (Replay does become unreadable to the OLD owner once
74
+ the device moves — media is device-keyed and travels with it — but that shows
75
+ up as a plain 404 from the manifest route, not as a stale URL.)
76
+
3
77
  ## 0.2.1
4
78
 
5
79
  - **Fix: a replay lane froze for a whole segment at a time on Android.** The
package/dist/index.d.ts CHANGED
@@ -27,5 +27,5 @@ export { LiveVideo, type LiveVideoProps } from "./live-video.js";
27
27
  export { ExpoVideoReplayEngine, type ExpoVideoReplayEngineOptions, } from "./replay-engine.js";
28
28
  export { useReplayPlayer, type UseReplayPlayer, type UseReplayPlayerNativeOptions, type ReplayLaneMedia, type ReplayLaneState, type ReplayLaneStatus, type UseReplayPlayerOptions, } from "./use-replay-player.js";
29
29
  export { ReplayVideo, type ReplayVideoProps } from "./replay-video.js";
30
- export { XorgateProvider, useXorgate, useXorgateTenancy, DEFAULT_BASE_URL, type XorgateProviderProps, type XorgateConfig, type XorgateAuth, type FirstPartyAuth, type SessionTokenAuth, type ApiKeyAuth, type LiveCredentialsAuth, type LiveCredentials, type LiveUnavailableReason, type Awaitable, type XorgatePlatform, XorgateError, isXorgateError, type Device, type DeviceModel, type LatestByMetric, type LatestReading, type MediaSession, type Me, type MetricName, type Organization, type PageMeta, type RecordingRun, type ReplayGap, type ReplayManifest, type ReplaySegment, type ReplaySession, type StreamKey, type TelemetryHistory, type TelemetryReading, type VideoChannel, type Workspace, type XorgateClient, useMe, useOrganizations, useWorkspaces, useDevices, useDevice, useDeviceModel, useTelemetryLatest, useTelemetryHistory, useVideoChannels, useRecordingRuns, useSessions, type QueryResult, type QueryOptions, type UseDevicesParams, type UseDevicesResult, type UseTelemetryHistoryParams, type UseSessionsParams, type UseRunsResult, type UseSessionsResult, useLiveTelemetry, useLivePlane, useLiveCredentials, parseTelemetryPayload, presignIotWssUrl, type UseLiveTelemetry, type UseLiveTelemetryOptions, type LiveStatus, type TelemetryPoint, type TelemetrySnapshot, type TelemetryFeedDeps, type MqttLikeClient, type MqttConnectionSpec, type ResolvedLiveCredentials, type ParsedTelemetryPayload, type TelemetryRecordingStatus, type TelemetryMediaStatus, type TelemetryStreamStatus, type LiveBlockPayload, useLiveBlock, resolveLiveBlock, liveBlockElapsedMs, LIVE_BLOCK_STALE_MS, type LiveBlockReason, type LiveBlockOpenReason, type LiveBlockState, type ResolveLiveBlockInput, useLiveVideoSession, type UseLiveVideoSession, type UseLiveVideoSessionOptions, type LiveVideoStatus, type LiveVideoStats, type WebRtcPlatform, type PeerConnectionLike, type SignalingLike, type TimerHost, useReplayManifest, useReplayPlayerCore, useReplayTelemetry, buildTimeline, segmentEnd, segmentAt, hasCoverageAt, gapAt, nextSegmentAfter, prevBoundary, nextBoundary, clampTs, buildLanes, buildClockTimeline, segmentUrlKey, ReplayClock, REPLAY_RATES, parseSegmentMediaInfo, seriesFromReadings, floorIndex, latestWithin, metricGroup, stalenessMs, overviewStalenessMs, chooseIntervalSeconds, windowBoundsFor, windowNeedsRefetch, buildTrace, traceLines, traveledLines, positionAt, GROUP_STALENESS_MS, DEFAULT_STALENESS_MS, WINDOW_SPAN_MS, WINDOW_MIN_SPAN_MS, type UseReplayManifestParams, type UseReplayManifestResult, type UseReplayPlayerCore, type UseReplayTelemetry, type UseReplayTelemetryOptions, type ReplayEngine, type ReplayEngineOptions, type ReplayEngineFactory, type ReplayTimeline, type ReplayLane, type LaneSegment, type ReplayClockState, type ReplayRate, type PacerCandidate, type GapSkipEvent, type SegmentMediaInfo, type MetricSeries, type GpsTrace, type WindowBounds, type PositionResolution, } from "@xorgate/react";
30
+ export { XorgateProvider, useXorgate, useXorgateTenancy, DEFAULT_BASE_URL, type XorgateProviderProps, type XorgateConfig, type XorgateAuth, type FirstPartyAuth, type SessionTokenAuth, type ApiKeyAuth, type LiveCredentialsAuth, type LiveCredentials, type LiveUnavailableReason, type Awaitable, type XorgatePlatform, XorgateError, isXorgateError, type AcceptedTransferOffer, type BulkTransferItem, type CreatedTransferOffer, type Device, type DeviceModel, type LatestByMetric, type LatestReading, type MediaSession, type Me, type MetricName, type Organization, type PageMeta, type RecordingRun, type ReplayGap, type ReplayManifest, type ReplaySegment, type ReplaySession, type ReplayTelemetry, type ReplayTelemetryOverview, type ReplayTelemetrySegment, type ReplayTelemetrySession, type StreamKey, type TelemetryHistory, type TelemetryInsightEvent, type TelemetryInsightNotComputable, type TelemetryInsights, type TelemetryReading, type TelemetrySession, type TransferAdoption, type TransferBlocker, type TransferBlockerCode, type TransferDeviceInput, type TransferOffer, type TransferOfferPreview, type TransferOfferStatus, type TransferPreview, type TransferResult, type TransferSummary, type TransferTenancy, type ScopeAttributeResult, type VideoChannel, type Workspace, type XorgateClient, useMe, useOrganizations, useWorkspaces, useDevices, useDevice, useDeviceModel, useTelemetryLatest, useTelemetryHistory, useVideoChannels, useRecordingRuns, useSessions, type QueryResult, type QueryOptions, type UseDevicesParams, type UseDevicesResult, type UseTelemetryHistoryParams, type UseSessionsParams, type UseRunsResult, type UseSessionsResult, useLiveTelemetry, useLivePlane, useLiveCredentials, useLiveScope, useDeviceScope, type UseLiveScope, type UseDeviceScope, type UseDeviceScopeOptions, type DeviceScopeStatus, type LiveScope, parseTelemetryPayload, presignIotWssUrl, type UseLiveTelemetry, type UseLiveTelemetryOptions, type LiveStatus, type TelemetryPoint, type TelemetrySnapshot, type TelemetryFeedDeps, type MqttLikeClient, type MqttConnectionSpec, type ResolvedLiveCredentials, type ParsedTelemetryPayload, type TelemetryRecordingStatus, type TelemetryMediaStatus, type TelemetryStreamStatus, type LiveBlockPayload, useLiveBlock, resolveLiveBlock, liveBlockElapsedMs, LIVE_BLOCK_STALE_MS, type LiveBlockReason, type LiveBlockOpenReason, type LiveBlockState, type ResolveLiveBlockInput, useLiveVideoSession, type UseLiveVideoSession, type UseLiveVideoSessionOptions, type LiveVideoStatus, type LiveVideoStats, type WebRtcPlatform, type PeerConnectionLike, type SignalingLike, type TimerHost, useReplayManifest, manifestHasOpenSession, REPLAY_OPEN_POLL_MS, useReplayPlayerCore, useReplayTelemetry, buildTimeline, segmentEnd, segmentAt, hasCoverageAt, gapAt, nextSegmentAfter, prevBoundary, nextBoundary, clampTs, buildLanes, buildClockTimeline, segmentUrlKey, ReplayClock, REPLAY_RATES, parseSegmentMediaInfo, seriesFromReadings, floorIndex, latestWithin, metricGroup, stalenessMs, overviewStalenessMs, chooseIntervalSeconds, windowBoundsFor, windowNeedsRefetch, buildTrace, traceLines, traveledLines, positionAt, GROUP_STALENESS_MS, DEFAULT_STALENESS_MS, WINDOW_SPAN_MS, WINDOW_MIN_SPAN_MS, artifactKey, overviewToSeries, segmentToSeries, insightsFromOverview, mergeSeries, buildOverviewSeries, chooseBucketMs, segmentsCovering, OVERVIEW_GPS_TARGET_BUCKETS, OVERVIEW_DEFAULT_TARGET_BUCKETS, type UseReplayManifestParams, type UseReplayManifestResult, type UseReplayPlayerCore, type UseReplayTelemetry, type UseReplayTelemetryOptions, type ReplayTelemetrySource, type OverviewV1, type OverviewGroupV1, type SegmentHeader, type DecodedSegment, type ReplayEngine, type ReplayEngineOptions, type ReplayEngineFactory, type ReplayTimeline, type ReplayLane, type LaneSegment, type ReplayClockState, type ReplayRate, type PacerCandidate, type GapSkipEvent, type SegmentMediaInfo, type MetricSeries, type GpsTrace, type WindowBounds, type PositionResolution, } from "@xorgate/react";
31
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMjE,OAAO,EACL,qBAAqB,EACrB,KAAK,4BAA4B,GAClC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,KAAK,eA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B,EAChB,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,2BAA2B,EAC3B,+BAA+B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -47,11 +47,23 @@ XorgateError, isXorgateError,
47
47
  // Data hooks
48
48
  useMe, useOrganizations, useWorkspaces, useDevices, useDevice, useDeviceModel, useTelemetryLatest, useTelemetryHistory, useVideoChannels, useRecordingRuns, useSessions,
49
49
  // Live telemetry and the live plane
50
- useLiveTelemetry, useLivePlane, useLiveCredentials, parseTelemetryPayload, presignIotWssUrl,
50
+ useLiveTelemetry, useLivePlane, useLiveCredentials,
51
+ // Live SCOPE: a device can be transferred to another workspace or
52
+ // organization while a viewer is open, and a vended credential is cached for
53
+ // up to ~50 minutes. On a phone that window is longer in practice, because a
54
+ // backgrounded app resumes onto the same cached credential. Neither plane
55
+ // fails loudly: telemetry simply stops arriving and video keeps flowing until
56
+ // the next reconnect. `useDeviceScope` is how that becomes a typed error.
57
+ useLiveScope, useDeviceScope, parseTelemetryPayload, presignIotWssUrl,
51
58
  // Live-block policy
52
59
  useLiveBlock, resolveLiveBlock, liveBlockElapsedMs, LIVE_BLOCK_STALE_MS,
53
60
  // The video session core and its platform boundary
54
61
  useLiveVideoSession,
55
62
  // Replay: pure timeline, lanes, clock and telemetry math (the engine is N3)
56
- useReplayManifest, useReplayPlayerCore, useReplayTelemetry, buildTimeline, segmentEnd, segmentAt, hasCoverageAt, gapAt, nextSegmentAfter, prevBoundary, nextBoundary, clampTs, buildLanes, buildClockTimeline, segmentUrlKey, ReplayClock, REPLAY_RATES, parseSegmentMediaInfo, seriesFromReadings, floorIndex, latestWithin, metricGroup, stalenessMs, overviewStalenessMs, chooseIntervalSeconds, windowBoundsFor, windowNeedsRefetch, buildTrace, traceLines, traveledLines, positionAt, GROUP_STALENESS_MS, DEFAULT_STALENESS_MS, WINDOW_SPAN_MS, WINDOW_MIN_SPAN_MS, } from "@xorgate/react";
63
+ useReplayManifest, manifestHasOpenSession, REPLAY_OPEN_POLL_MS, useReplayPlayerCore,
64
+ // Reads the manifest's `telemetry` block (presigned S3 artifacts) when the
65
+ // server sends one and the REST history routes otherwise. The artifacts
66
+ // are served with `Content-Encoding: gzip`, which iOS and Android `fetch`
67
+ // inflate natively; nothing here decompresses anything.
68
+ useReplayTelemetry, buildTimeline, segmentEnd, segmentAt, hasCoverageAt, gapAt, nextSegmentAfter, prevBoundary, nextBoundary, clampTs, buildLanes, buildClockTimeline, segmentUrlKey, ReplayClock, REPLAY_RATES, parseSegmentMediaInfo, seriesFromReadings, floorIndex, latestWithin, metricGroup, stalenessMs, overviewStalenessMs, chooseIntervalSeconds, windowBoundsFor, windowNeedsRefetch, buildTrace, traceLines, traveledLines, positionAt, GROUP_STALENESS_MS, DEFAULT_STALENESS_MS, WINDOW_SPAN_MS, WINDOW_MIN_SPAN_MS, artifactKey, overviewToSeries, segmentToSeries, insightsFromOverview, mergeSeries, buildOverviewSeries, chooseBucketMs, segmentsCovering, OVERVIEW_GPS_TARGET_BUCKETS, OVERVIEW_DEFAULT_TARGET_BUCKETS, } from "@xorgate/react";
57
69
  //# sourceMappingURL=index.js.map
package/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2B,EAC3B,+BAA+B,GA0BhC,MAAM,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xorgate/react-native",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "React Native adapters for @xorgate/react: live telemetry over MQTT, live video over WebRTC (react-native-webrtc / RTCView), and the recorded-media replay player over expo-video.",
5
5
  "license": "MIT",
6
6
  "author": "Epye Labs",
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "dependencies": {
79
79
  "@aws-crypto/sha256-js": "^5.2.0",
80
- "@xorgate/react": "^0.2.1"
80
+ "@xorgate/react": "^0.4.0"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@testing-library/react": "^16.3.3",
package/readme.md CHANGED
@@ -213,6 +213,27 @@ Unchanged from the web package — `mqtt.js` 5 runs on React Native's global
213
213
  const { latest, history, status, receivedAt } = useLiveTelemetry(deviceId)
214
214
  ```
215
215
 
216
+ ### Live scope
217
+
218
+ A device can be transferred to another workspace or organization while a screen
219
+ is open. The vended live credential encodes the old tenancy and is cached for up
220
+ to ~50 minutes, and **nothing fails**: telemetry simply stops arriving and video
221
+ keeps flowing until the next reconnect. On a phone that window is effectively
222
+ longer, because a backgrounded app resumes onto the same cached credential and
223
+ `appStateWake` nudges the live planes straight back onto the stale scope.
224
+
225
+ ```tsx
226
+ const scope = useDeviceScope(deviceId)
227
+ const live = useLiveTelemetry(scope.outOfScope ? null : deviceId)
228
+
229
+ if (scope.error) return <Text>{scope.error.message}</Text> // DEVICE_OUT_OF_SCOPE
230
+ ```
231
+
232
+ `useDeviceScope` re-vends once before complaining, since the ordinary cause is
233
+ just a stale cached credential. If your app moves devices itself, call
234
+ `useLiveScope().invalidate()` afterwards and every open live consumer
235
+ re-resolves immediately.
236
+
216
237
  Read freshness off `receivedAt`, not `status`. A phone that loses signal keeps
217
238
  a socket that reads `connected` until the OS surfaces the close, which can take
218
239
  20 s or more; the age of the last frame is the honest signal, and the web app