@xorgate/react-native 0.2.1 → 0.3.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 +35 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/readme.md +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
Tracks `@xorgate/react` 0.3.0 (live scope) and `@xorgate/sdk` 0.7.0 (device
|
|
6
|
+
transfer). No native change: the same `dist`, plus re-exports.
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- **`useLiveScope()` and `useDeviceScope(deviceId)`**, re-exported unchanged
|
|
11
|
+
from `@xorgate/react`. A device can be transferred to another workspace or
|
|
12
|
+
organization while a viewer is open; the vended live credential is cached for
|
|
13
|
+
up to ~50 minutes, and neither plane fails loudly when it goes stale —
|
|
14
|
+
telemetry simply stops arriving and video keeps flowing until the next
|
|
15
|
+
reconnect. `useDeviceScope` turns that into a typed `DEVICE_OUT_OF_SCOPE`,
|
|
16
|
+
re-vending once first. `useLiveScope().invalidate()` makes every open live
|
|
17
|
+
consumer re-resolve after you transfer a device yourself.
|
|
18
|
+
|
|
19
|
+
**This matters more on a phone than on the web.** A backgrounded app resumes
|
|
20
|
+
onto the same cached credential, and `appStateWake` nudges the live planes
|
|
21
|
+
back up — straight onto the stale scope. The scope guard is what makes the
|
|
22
|
+
resume honest.
|
|
23
|
+
|
|
24
|
+
- The transfer vocabulary from `@xorgate/sdk` (`TransferSummary`,
|
|
25
|
+
`TransferPreview`, `TransferOffer`, `TransferOfferPreview`,
|
|
26
|
+
`TransferAdoption`, `ScopeAttributeResult` and the rest), so a screen and a
|
|
27
|
+
server route pass the same objects around.
|
|
28
|
+
|
|
29
|
+
### Unchanged, and checked
|
|
30
|
+
|
|
31
|
+
- **Replay carries no tenancy assumption.** Segment playback runs on presigned
|
|
32
|
+
URLs minted per manifest and refreshed from `manifest.urlExpiresAt`; nothing
|
|
33
|
+
in `replay-engine.ts` caches an organization or workspace id, so a transfer
|
|
34
|
+
cannot strand a replay. (Replay does become unreadable to the OLD owner once
|
|
35
|
+
the device moves — media is device-keyed and travels with it — but that shows
|
|
36
|
+
up as a plain 404 from the manifest route, not as a stale URL.)
|
|
37
|
+
|
|
3
38
|
## 0.2.1
|
|
4
39
|
|
|
5
40
|
- **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 StreamKey, type TelemetryHistory, type TelemetryReading, 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, 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";
|
|
31
31
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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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,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,7 +47,14 @@ 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,
|
|
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
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,8EAA8E;AAC9E,2BAA2B;AAC3B,8EAA8E;AAE9E,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY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1
1
|
{
|
|
2
2
|
"name": "@xorgate/react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.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.
|
|
80
|
+
"@xorgate/react": "^0.3.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
|