@centive/aria-sdk 0.8.4 → 0.8.5
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.js +15 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/AriaSessionManager.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -400,10 +400,13 @@ class U {
|
|
|
400
400
|
console.warn("[AriaSessionManager] Cannot request session token: WebSocket not connected");
|
|
401
401
|
return;
|
|
402
402
|
}
|
|
403
|
-
console.log("[AriaSessionManager] Requesting session token with user_trigger=true"), this.setStatus("preloading");
|
|
403
|
+
console.log("[AriaSessionManager] Requesting session token with user_trigger=true for user:", this.config.userId), this.setStatus("preloading");
|
|
404
404
|
try {
|
|
405
|
-
const e = JSON.stringify({
|
|
406
|
-
|
|
405
|
+
const e = JSON.stringify({
|
|
406
|
+
user_trigger: !0,
|
|
407
|
+
...this.config.userId && { userId: this.config.userId }
|
|
408
|
+
});
|
|
409
|
+
console.log("[AriaSessionManager] Sending message:", e), this.ws.send(e);
|
|
407
410
|
} catch (e) {
|
|
408
411
|
const t = e instanceof Error ? e.message : "Failed to request session token";
|
|
409
412
|
console.error("[AriaSessionManager] Session token request error:", t), this.handleSessionError(t);
|
|
@@ -430,8 +433,11 @@ class U {
|
|
|
430
433
|
return;
|
|
431
434
|
}
|
|
432
435
|
try {
|
|
433
|
-
const t = JSON.stringify({
|
|
434
|
-
|
|
436
|
+
const t = JSON.stringify({
|
|
437
|
+
user_trigger: !0,
|
|
438
|
+
userId: this.config.userId
|
|
439
|
+
});
|
|
440
|
+
this.ws.send(t), console.log("[AriaSessionManager] Sent session request with user_trigger: true, userId:", this.config.userId), e && this.config.userId && this.config.onManualTrigger?.(this.config.userId);
|
|
435
441
|
} catch (t) {
|
|
436
442
|
const o = t instanceof Error ? t.message : "Failed to trigger session";
|
|
437
443
|
console.error("[AriaSessionManager] Trigger error:", o), this.config.onError?.(t instanceof Error ? t : new Error(o));
|
|
@@ -709,7 +715,10 @@ class U {
|
|
|
709
715
|
}
|
|
710
716
|
console.log("[AriaSessionManager] Refreshing session token (proactive refresh)"), this.updateSessionState({ isRefreshing: !0 }), this.setStatus("refreshing");
|
|
711
717
|
try {
|
|
712
|
-
const e = JSON.stringify({
|
|
718
|
+
const e = JSON.stringify({
|
|
719
|
+
user_trigger: !0,
|
|
720
|
+
userId: this.config.userId
|
|
721
|
+
});
|
|
713
722
|
this.ws.send(e);
|
|
714
723
|
} catch (e) {
|
|
715
724
|
const t = e instanceof Error ? e.message : "Failed to refresh session";
|