@stripchatdev/ext-helper 0.1.45 → 0.1.46
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/ext-helper.js +272 -217
- package/dist/helpers/index.d.ts +16 -4
- package/dist/helpers/react.d.ts +16 -4
- package/dist/index.d.ts +16 -4
- package/package.json +1 -1
package/dist/ext-helper.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
const
|
|
2
|
-
var
|
|
1
|
+
const L = (e) => !!e && typeof e == "object" && "protocol" in e && e.protocol === "platform_pubsub" && "version" in e && e.version === "1.0", I = (e) => e, k = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
2
|
+
var f;
|
|
3
3
|
(function(e) {
|
|
4
4
|
e.Base32IncorrectEncoding = "B32_ENC_INVALID", e.DecodeTimeInvalidCharacter = "DEC_TIME_CHAR", e.DecodeTimeValueMalformed = "DEC_TIME_MALFORMED", e.EncodeTimeNegative = "ENC_TIME_NEG", e.EncodeTimeSizeExceeded = "ENC_TIME_SIZE_EXCEED", e.EncodeTimeValueMalformed = "ENC_TIME_MALFORMED", e.PRNGDetectFailure = "PRNG_DETECT", e.ULIDInvalid = "ULID_INVALID", e.Unexpected = "UNEXPECTED", e.UUIDInvalid = "UUID_INVALID";
|
|
5
|
-
})(
|
|
6
|
-
class
|
|
5
|
+
})(f || (f = {}));
|
|
6
|
+
class y extends Error {
|
|
7
7
|
constructor(t, r) {
|
|
8
8
|
super(`${r} (${t})`), this.name = "ULIDError", this.code = t;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function O(e) {
|
|
12
12
|
const t = Math.floor(e() * 32) % 32;
|
|
13
|
-
return
|
|
13
|
+
return k.charAt(t);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const t =
|
|
15
|
+
function A(e) {
|
|
16
|
+
const t = x(), r = t && (t.crypto || t.msCrypto) || null;
|
|
17
17
|
if (typeof (r == null ? void 0 : r.getRandomValues) == "function")
|
|
18
18
|
return () => {
|
|
19
|
-
const
|
|
20
|
-
return r.getRandomValues(
|
|
19
|
+
const n = new Uint8Array(1);
|
|
20
|
+
return r.getRandomValues(n), n[0] / 255;
|
|
21
21
|
};
|
|
22
22
|
if (typeof (r == null ? void 0 : r.randomBytes) == "function")
|
|
23
23
|
return () => r.randomBytes(1).readUInt8() / 255;
|
|
24
|
-
throw new
|
|
24
|
+
throw new y(f.PRNGDetectFailure, "Failed to find a reliable PRNG");
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function x() {
|
|
27
|
+
return F() ? self : typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : null;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function C(e, t) {
|
|
30
30
|
let r = "";
|
|
31
31
|
for (; e > 0; e--)
|
|
32
|
-
r =
|
|
32
|
+
r = O(t) + r;
|
|
33
33
|
return r;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function D(e, t = 10) {
|
|
36
36
|
if (isNaN(e))
|
|
37
|
-
throw new
|
|
37
|
+
throw new y(f.EncodeTimeValueMalformed, `Time must be a number: ${e}`);
|
|
38
38
|
if (e > 281474976710655)
|
|
39
|
-
throw new
|
|
39
|
+
throw new y(f.EncodeTimeSizeExceeded, `Cannot encode a time larger than ${281474976710655}: ${e}`);
|
|
40
40
|
if (e < 0)
|
|
41
|
-
throw new
|
|
41
|
+
throw new y(f.EncodeTimeNegative, `Time must be positive: ${e}`);
|
|
42
42
|
if (Number.isInteger(e) === !1)
|
|
43
|
-
throw new
|
|
44
|
-
let r,
|
|
45
|
-
for (let
|
|
46
|
-
r = e % 32,
|
|
47
|
-
return
|
|
43
|
+
throw new y(f.EncodeTimeValueMalformed, `Time must be an integer: ${e}`);
|
|
44
|
+
let r, n = "";
|
|
45
|
+
for (let s = t; s > 0; s--)
|
|
46
|
+
r = e % 32, n = k.charAt(r) + n, e = (e - r) / 32;
|
|
47
|
+
return n;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function F() {
|
|
50
50
|
return typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const r = t ||
|
|
54
|
-
return
|
|
52
|
+
function E(e, t) {
|
|
53
|
+
const r = t || A(), n = !e || isNaN(e) ? Date.now() : e;
|
|
54
|
+
return D(n, 10) + C(16, r);
|
|
55
55
|
}
|
|
56
|
-
const
|
|
56
|
+
const j = ({ seq: e, uniqId: t }) => (r) => ({
|
|
57
57
|
...{
|
|
58
58
|
protocol: "platform_pubsub",
|
|
59
59
|
version: "1.0",
|
|
@@ -62,69 +62,69 @@ const A = ({ seq: e, uniqId: t }) => (r) => ({
|
|
|
62
62
|
timestamp: Date.now()
|
|
63
63
|
},
|
|
64
64
|
...r
|
|
65
|
-
}),
|
|
66
|
-
uniqId: () =>
|
|
67
|
-
seq: () =>
|
|
65
|
+
}), v = j({
|
|
66
|
+
uniqId: () => E(),
|
|
67
|
+
seq: () => E()
|
|
68
68
|
});
|
|
69
|
-
class
|
|
69
|
+
class G {
|
|
70
70
|
constructor(t) {
|
|
71
|
-
this.eventHandlerMap = /* @__PURE__ */ new Map(), this.transportMessageHandler = (
|
|
72
|
-
const { data:
|
|
73
|
-
if (
|
|
74
|
-
if (
|
|
75
|
-
const { eventName: i } =
|
|
71
|
+
this.eventHandlerMap = /* @__PURE__ */ new Map(), this.transportMessageHandler = (s) => {
|
|
72
|
+
const { data: o, senderId: a } = s;
|
|
73
|
+
if (L(o)) {
|
|
74
|
+
if (o.type === "event") {
|
|
75
|
+
const { eventName: i } = o, c = this.eventHandlerMap.get(i);
|
|
76
76
|
if (!c)
|
|
77
77
|
return;
|
|
78
|
-
c.forEach((
|
|
78
|
+
c.forEach((h) => {
|
|
79
79
|
try {
|
|
80
|
-
|
|
81
|
-
} catch (
|
|
82
|
-
console.error("[PubSubSubscriber] transportMessageHandler: failed to handle income message",
|
|
80
|
+
h(o.data, a);
|
|
81
|
+
} catch (m) {
|
|
82
|
+
console.error("[PubSubSubscriber] transportMessageHandler: failed to handle income message", m);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
console.error("[PubSubSubscriber] transportMessageHandler: unhandled message",
|
|
87
|
+
console.error("[PubSubSubscriber] transportMessageHandler: unhandled message", o);
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
-
const { brokerId: r, transport:
|
|
91
|
-
this.brokerId = r, this.transport =
|
|
90
|
+
const { brokerId: r, transport: n } = t;
|
|
91
|
+
this.brokerId = r, this.transport = n, this.transport.onMessage(this.transportMessageHandler);
|
|
92
92
|
}
|
|
93
93
|
subscribe(t, r) {
|
|
94
|
-
const
|
|
95
|
-
let
|
|
96
|
-
|
|
97
|
-
const
|
|
94
|
+
const n = I(t);
|
|
95
|
+
let s = this.eventHandlerMap.get(n);
|
|
96
|
+
s || (s = /* @__PURE__ */ new Set(), this.eventHandlerMap.set(n, s)), s.add(r);
|
|
97
|
+
const o = v({
|
|
98
98
|
type: "subscribe",
|
|
99
99
|
eventName: t
|
|
100
100
|
});
|
|
101
|
-
this.transport.send(this.brokerId,
|
|
101
|
+
this.transport.send(this.brokerId, o);
|
|
102
102
|
}
|
|
103
103
|
unsubscribe(t, r) {
|
|
104
|
-
const
|
|
105
|
-
let
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
104
|
+
const n = I(t);
|
|
105
|
+
let s = this.eventHandlerMap.get(n);
|
|
106
|
+
if (s && (r ? (s.delete(r), s.size || this.eventHandlerMap.delete(n)) : this.eventHandlerMap.delete(n), !this.eventHandlerMap.has(n))) {
|
|
107
|
+
const o = v({
|
|
108
108
|
type: "unsubscribe",
|
|
109
109
|
eventName: t
|
|
110
110
|
});
|
|
111
|
-
this.transport.send(this.brokerId,
|
|
111
|
+
this.transport.send(this.brokerId, o);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
const
|
|
116
|
-
class
|
|
115
|
+
const z = !!Error.captureStackTrace, B = "APP_ERROR";
|
|
116
|
+
class b extends Error {
|
|
117
117
|
constructor(t, r) {
|
|
118
|
-
super(t), this.name = new.target.name ||
|
|
118
|
+
super(t), this.name = new.target.name || B, this.cause = r, z && Error.captureStackTrace(this, this.constructor);
|
|
119
119
|
}
|
|
120
120
|
static serializeCause(t) {
|
|
121
|
-
return t instanceof
|
|
121
|
+
return t instanceof b ? t.toJSON() : t instanceof Error ? { name: t.name, message: t.message } : t !== null && typeof t == "object" ? t : String(t);
|
|
122
122
|
}
|
|
123
123
|
toJSON() {
|
|
124
124
|
return {
|
|
125
125
|
name: this.name,
|
|
126
126
|
message: this.message,
|
|
127
|
-
cause: this.cause ?
|
|
127
|
+
cause: this.cause ? b.serializeCause(this.cause) : void 0
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
toString() {
|
|
@@ -136,12 +136,12 @@ class E extends Error {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
const
|
|
139
|
+
const V = {
|
|
140
140
|
INTERNAL_ERROR: "INTERNAL_ERROR"
|
|
141
|
-
},
|
|
142
|
-
class
|
|
141
|
+
}, X = "RPC_ERROR";
|
|
142
|
+
class W extends b {
|
|
143
143
|
constructor(t) {
|
|
144
|
-
super(t.message || "rpc error", t.cause), this.name =
|
|
144
|
+
super(t.message || "rpc error", t.cause), this.name = X, this.code = (t == null ? void 0 : t.code) || V.INTERNAL_ERROR, this.method = t.method, this.params = t.params;
|
|
145
145
|
}
|
|
146
146
|
toJSON() {
|
|
147
147
|
return {
|
|
@@ -152,7 +152,7 @@ class z extends E {
|
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const $ = (e) => !!e && typeof e == "object" && "protocol" in e && e.protocol === "platform_rpc" && "version" in e && e.version === "1.0", J = ({ uniqId: e }) => (t) => ({
|
|
156
156
|
...{
|
|
157
157
|
requestId: e(),
|
|
158
158
|
protocol: "platform_rpc",
|
|
@@ -160,48 +160,48 @@ const B = (e) => !!e && typeof e == "object" && "protocol" in e && e.protocol ==
|
|
|
160
160
|
timestamp: Date.now()
|
|
161
161
|
},
|
|
162
162
|
...t
|
|
163
|
-
}),
|
|
164
|
-
uniqId: () =>
|
|
163
|
+
}), U = J({
|
|
164
|
+
uniqId: () => E()
|
|
165
165
|
});
|
|
166
|
-
class
|
|
166
|
+
class K {
|
|
167
167
|
constructor(t) {
|
|
168
|
-
this.pendingEntryMap = /* @__PURE__ */ new Map(), this.transportMessageHandler = (
|
|
169
|
-
const { data:
|
|
170
|
-
if (
|
|
171
|
-
if (
|
|
172
|
-
const a = this.pendingEntryMap.get(
|
|
168
|
+
this.pendingEntryMap = /* @__PURE__ */ new Map(), this.transportMessageHandler = (s) => {
|
|
169
|
+
const { data: o } = s;
|
|
170
|
+
if ($(o)) {
|
|
171
|
+
if (o.type === "response" && o.status === "ok") {
|
|
172
|
+
const a = this.pendingEntryMap.get(o.requestId);
|
|
173
173
|
if (!a) {
|
|
174
|
-
console.error("[RpcClient] transportMessageHandler: got success response without pending request",
|
|
174
|
+
console.error("[RpcClient] transportMessageHandler: got success response without pending request", o);
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
-
this.pendingEntryMap.delete(
|
|
177
|
+
this.pendingEntryMap.delete(o.requestId), a.resolve(o.result);
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
|
-
if (
|
|
181
|
-
const a = this.pendingEntryMap.get(
|
|
180
|
+
if (o.type === "response" && o.status === "error") {
|
|
181
|
+
const a = this.pendingEntryMap.get(o.requestId);
|
|
182
182
|
if (!a) {
|
|
183
|
-
console.error("[RpcClient] transportMessageHandler: got error response without pending request",
|
|
183
|
+
console.error("[RpcClient] transportMessageHandler: got error response without pending request", o);
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
this.pendingEntryMap.delete(
|
|
186
|
+
this.pendingEntryMap.delete(o.requestId), a.reject(new W(o.error));
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
|
-
console.error("[RpcClient] transportMessageHandler: invalid message schema",
|
|
189
|
+
console.error("[RpcClient] transportMessageHandler: invalid message schema", o);
|
|
190
190
|
}
|
|
191
191
|
};
|
|
192
|
-
const { serverId: r, transport:
|
|
193
|
-
this.serverId = r, this.transport =
|
|
192
|
+
const { serverId: r, transport: n } = t;
|
|
193
|
+
this.serverId = r, this.transport = n, this.transport.onMessage(this.transportMessageHandler);
|
|
194
194
|
}
|
|
195
195
|
makeRequest(t, r) {
|
|
196
|
-
const
|
|
196
|
+
const n = U({
|
|
197
197
|
type: "request",
|
|
198
198
|
method: t,
|
|
199
199
|
params: r
|
|
200
|
-
}),
|
|
201
|
-
this.pendingEntryMap.set(
|
|
200
|
+
}), s = new Promise((o, a) => {
|
|
201
|
+
this.pendingEntryMap.set(n.requestId, {
|
|
202
202
|
method: t,
|
|
203
203
|
resolve: (i) => {
|
|
204
|
-
|
|
204
|
+
o(i);
|
|
205
205
|
},
|
|
206
206
|
reject: (i) => {
|
|
207
207
|
a(i);
|
|
@@ -209,44 +209,44 @@ class W {
|
|
|
209
209
|
});
|
|
210
210
|
});
|
|
211
211
|
try {
|
|
212
|
-
this.transport.send(this.serverId,
|
|
213
|
-
} catch (
|
|
214
|
-
console.error("[RpcClient] makeRequest: failed to send rpc message",
|
|
215
|
-
const a = this.pendingEntryMap.get(
|
|
216
|
-
a && (this.pendingEntryMap.delete(
|
|
212
|
+
this.transport.send(this.serverId, n);
|
|
213
|
+
} catch (o) {
|
|
214
|
+
console.error("[RpcClient] makeRequest: failed to send rpc message", o);
|
|
215
|
+
const a = this.pendingEntryMap.get(n.requestId);
|
|
216
|
+
a && (this.pendingEntryMap.delete(n.requestId), a.reject(o));
|
|
217
217
|
}
|
|
218
|
-
return
|
|
218
|
+
return s;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
const
|
|
221
|
+
const Z = (e) => !!e && typeof e == "object" && "protocol" in e && e.protocol === "platform_transport" && "version" in e && e.version === "1.0", Q = ({ uniqId: e }) => (t) => ({
|
|
222
222
|
messageId: e(),
|
|
223
223
|
protocol: "platform_transport",
|
|
224
224
|
version: "1.0",
|
|
225
225
|
...t
|
|
226
|
-
}),
|
|
227
|
-
uniqId:
|
|
226
|
+
}), S = Q({
|
|
227
|
+
uniqId: E
|
|
228
228
|
});
|
|
229
|
-
class
|
|
229
|
+
class Y {
|
|
230
230
|
constructor(t) {
|
|
231
|
-
this.peers = /* @__PURE__ */ new Map(), this.handlers = /* @__PURE__ */ new Set(), this.onMessage = (
|
|
232
|
-
const
|
|
233
|
-
const { data: i, origin: c, source:
|
|
234
|
-
if (!
|
|
231
|
+
this.peers = /* @__PURE__ */ new Map(), this.handlers = /* @__PURE__ */ new Set(), this.onMessage = (s) => {
|
|
232
|
+
const o = (a) => {
|
|
233
|
+
const { data: i, origin: c, source: h } = a;
|
|
234
|
+
if (!h || !Z(i))
|
|
235
235
|
return;
|
|
236
|
-
const { recipientId:
|
|
237
|
-
if (!(
|
|
236
|
+
const { recipientId: m } = i;
|
|
237
|
+
if (!(m !== this.transportId || !this.findPeer(h, c)))
|
|
238
238
|
try {
|
|
239
|
-
|
|
240
|
-
} catch (
|
|
241
|
-
console.error("[PostMessageTransport] onMessage: failed to call cb on message",
|
|
239
|
+
s(i);
|
|
240
|
+
} catch (w) {
|
|
241
|
+
console.error("[PostMessageTransport] onMessage: failed to call cb on message", w);
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
|
-
return this.localWindow.addEventListener("message",
|
|
245
|
-
this.localWindow.removeEventListener("message",
|
|
244
|
+
return this.localWindow.addEventListener("message", o), this.handlers.add(o), () => {
|
|
245
|
+
this.localWindow.removeEventListener("message", o), this.handlers.delete(o);
|
|
246
246
|
};
|
|
247
247
|
};
|
|
248
|
-
const { localWindow: r, transportId:
|
|
249
|
-
this.transportId =
|
|
248
|
+
const { localWindow: r, transportId: n } = t;
|
|
249
|
+
this.transportId = n, this.localWindow = r || window;
|
|
250
250
|
}
|
|
251
251
|
destroy() {
|
|
252
252
|
this.handlers.forEach((t) => {
|
|
@@ -254,29 +254,29 @@ class U {
|
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
send(t, r) {
|
|
257
|
-
const
|
|
258
|
-
if (
|
|
259
|
-
const
|
|
257
|
+
const n = this.peers.get(t);
|
|
258
|
+
if (n) {
|
|
259
|
+
const s = S({
|
|
260
260
|
data: r,
|
|
261
261
|
senderId: this.transportId,
|
|
262
|
-
recipientId:
|
|
262
|
+
recipientId: n.id
|
|
263
263
|
});
|
|
264
|
-
|
|
264
|
+
n.source.postMessage(s, n.origin);
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
broadcast(t) {
|
|
268
268
|
this.peers.forEach((r) => {
|
|
269
|
-
const
|
|
269
|
+
const n = S({
|
|
270
270
|
data: t,
|
|
271
271
|
senderId: this.transportId,
|
|
272
272
|
recipientId: r.id
|
|
273
273
|
});
|
|
274
|
-
r.source.postMessage(
|
|
274
|
+
r.source.postMessage(n, r.origin);
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
277
|
broadcastGroup(t, r) {
|
|
278
|
-
t.forEach((
|
|
279
|
-
this.send(
|
|
278
|
+
t.forEach((n) => {
|
|
279
|
+
this.send(n, r);
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
addPeer(t) {
|
|
@@ -286,52 +286,52 @@ class U {
|
|
|
286
286
|
this.peers.delete(t);
|
|
287
287
|
}
|
|
288
288
|
findPeer(t, r) {
|
|
289
|
-
for (const [
|
|
290
|
-
if (
|
|
291
|
-
return
|
|
289
|
+
for (const [n, s] of this.peers)
|
|
290
|
+
if (s.source === t && s.origin === r)
|
|
291
|
+
return s;
|
|
292
292
|
return null;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
const
|
|
295
|
+
const g = {
|
|
296
296
|
name: "unknownError",
|
|
297
297
|
message: "unknown error"
|
|
298
|
-
},
|
|
298
|
+
}, P = (e, t = 3, r = 0) => {
|
|
299
299
|
if (e instanceof Error) {
|
|
300
|
-
const
|
|
300
|
+
const n = r < t && e.cause ? P(e.cause, t, r + 1) : void 0;
|
|
301
301
|
return {
|
|
302
302
|
name: e.name,
|
|
303
303
|
message: e.message,
|
|
304
304
|
stack: e.stack,
|
|
305
|
-
cause:
|
|
305
|
+
cause: n
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
if (typeof e == "string")
|
|
309
309
|
return {
|
|
310
|
-
name:
|
|
310
|
+
name: g.name,
|
|
311
311
|
message: e
|
|
312
312
|
};
|
|
313
313
|
if (typeof e == "number" || typeof e == "bigint" || typeof e == "boolean")
|
|
314
314
|
return {
|
|
315
|
-
name:
|
|
315
|
+
name: g.name,
|
|
316
316
|
message: String(e)
|
|
317
317
|
};
|
|
318
318
|
if (e && typeof e == "object")
|
|
319
319
|
try {
|
|
320
320
|
return {
|
|
321
|
-
name:
|
|
321
|
+
name: g.name,
|
|
322
322
|
message: "message" in e && typeof e.message == "string" && e.message !== "" ? e.message : JSON.stringify(e)
|
|
323
323
|
};
|
|
324
324
|
} catch {
|
|
325
325
|
return {
|
|
326
|
-
name:
|
|
326
|
+
name: g.name,
|
|
327
327
|
message: "failed to serialize error: unserializable error object"
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
|
-
return
|
|
331
|
-
},
|
|
330
|
+
return g;
|
|
331
|
+
}, q = (e) => {
|
|
332
332
|
const t = [];
|
|
333
333
|
if (e instanceof Error)
|
|
334
|
-
t.push(e.message), "cause" in e && t.push(
|
|
334
|
+
t.push(e.message), "cause" in e && t.push(q(e.cause));
|
|
335
335
|
else
|
|
336
336
|
try {
|
|
337
337
|
const r = JSON.stringify(e);
|
|
@@ -340,7 +340,7 @@ const f = {
|
|
|
340
340
|
t.push("failed to get chained error message: unserializable error object");
|
|
341
341
|
}
|
|
342
342
|
return t.join(":");
|
|
343
|
-
},
|
|
343
|
+
}, ee = [
|
|
344
344
|
// browser internals — harmless noise
|
|
345
345
|
/resizeObserver loop/ig,
|
|
346
346
|
// cross-origin script errors with zero useful info
|
|
@@ -363,31 +363,31 @@ const f = {
|
|
|
363
363
|
// generic network noise already captured by fetch/xhr integrations
|
|
364
364
|
/networkError when attempting to fetch resource/ig,
|
|
365
365
|
/load failed/ig
|
|
366
|
-
],
|
|
367
|
-
const t =
|
|
368
|
-
return [t, r].filter((
|
|
369
|
-
},
|
|
370
|
-
const t =
|
|
371
|
-
return r && /^(chrome|moz|safari)-extension:\/\//.test(r) ? !0 : !!t &&
|
|
372
|
-
},
|
|
373
|
-
var
|
|
374
|
-
let r,
|
|
375
|
-
return e instanceof Request ? (r = e.url,
|
|
376
|
-
method:
|
|
366
|
+
], te = (e) => ee.some((t) => (t.lastIndex = 0, t.test(e))), re = (e) => {
|
|
367
|
+
const t = q(e.error), r = typeof e.data == "object" && "message" in e.data && typeof e.data.message == "string" ? e.data.message : "";
|
|
368
|
+
return [t, r].filter((n) => !!n).join(":");
|
|
369
|
+
}, ne = (e) => e.data && typeof e.data == "object" && "filename" in e.data ? String(e.data.filename ?? "") : "", se = (e) => {
|
|
370
|
+
const t = re(e), r = ne(e);
|
|
371
|
+
return r && /^(chrome|moz|safari)-extension:\/\//.test(r) ? !0 : !!t && te(t);
|
|
372
|
+
}, oe = "get", ae = (e, t) => {
|
|
373
|
+
var s;
|
|
374
|
+
let r, n;
|
|
375
|
+
return e instanceof Request ? (r = e.url, n = e.method) : e instanceof URL ? r = e.toString() : r = e, {
|
|
376
|
+
method: n || ((s = t == null ? void 0 : t.method) == null ? void 0 : s.toString()) || oe,
|
|
377
377
|
url: r
|
|
378
378
|
};
|
|
379
|
-
},
|
|
379
|
+
}, ie = (e, t, r) => ({
|
|
380
380
|
statusCode: r.status,
|
|
381
|
-
...
|
|
382
|
-
}),
|
|
381
|
+
...ae(e, t)
|
|
382
|
+
}), ce = (e) => {
|
|
383
383
|
const t = window.fetch;
|
|
384
384
|
Object.defineProperty(window, "fetch", {
|
|
385
|
-
value: async (
|
|
385
|
+
value: async (n, s) => {
|
|
386
386
|
try {
|
|
387
|
-
const
|
|
387
|
+
const o = new Error("synthetic error"), a = await t(n, s), i = a.clone(), c = ie(n, s, i);
|
|
388
388
|
if (a.status >= 500) {
|
|
389
389
|
const d = new Error("fetch response error");
|
|
390
|
-
d.stack =
|
|
390
|
+
d.stack = o.stack, e.report({
|
|
391
391
|
kind: "fetchResponseError",
|
|
392
392
|
type: "network",
|
|
393
393
|
data: c,
|
|
@@ -395,14 +395,14 @@ const f = {
|
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
397
|
const {
|
|
398
|
-
arrayBuffer:
|
|
399
|
-
blob:
|
|
400
|
-
json:
|
|
401
|
-
text:
|
|
398
|
+
arrayBuffer: h,
|
|
399
|
+
blob: m,
|
|
400
|
+
json: M,
|
|
401
|
+
text: w
|
|
402
402
|
} = a;
|
|
403
403
|
return a.json = async function() {
|
|
404
404
|
try {
|
|
405
|
-
return await
|
|
405
|
+
return await M.call(this);
|
|
406
406
|
} catch (d) {
|
|
407
407
|
throw e.report({
|
|
408
408
|
type: "network",
|
|
@@ -416,7 +416,7 @@ const f = {
|
|
|
416
416
|
}
|
|
417
417
|
}, a.text = async function() {
|
|
418
418
|
try {
|
|
419
|
-
return await
|
|
419
|
+
return await w.call(this);
|
|
420
420
|
} catch (d) {
|
|
421
421
|
throw e.report({
|
|
422
422
|
type: "network",
|
|
@@ -430,7 +430,7 @@ const f = {
|
|
|
430
430
|
}
|
|
431
431
|
}, a.blob = async function() {
|
|
432
432
|
try {
|
|
433
|
-
return await
|
|
433
|
+
return await m.call(this);
|
|
434
434
|
} catch (d) {
|
|
435
435
|
throw e.report({
|
|
436
436
|
type: "network",
|
|
@@ -444,7 +444,7 @@ const f = {
|
|
|
444
444
|
}
|
|
445
445
|
}, a.arrayBuffer = async function() {
|
|
446
446
|
try {
|
|
447
|
-
return await
|
|
447
|
+
return await h.call(this);
|
|
448
448
|
} catch (d) {
|
|
449
449
|
throw e.report({
|
|
450
450
|
type: "network",
|
|
@@ -457,50 +457,50 @@ const f = {
|
|
|
457
457
|
}), d;
|
|
458
458
|
}
|
|
459
459
|
}, a;
|
|
460
|
-
} catch (
|
|
461
|
-
throw
|
|
460
|
+
} catch (o) {
|
|
461
|
+
throw o instanceof Error && o.name === "AbortError", o;
|
|
462
462
|
}
|
|
463
463
|
},
|
|
464
464
|
configurable: !0,
|
|
465
465
|
writable: !0
|
|
466
466
|
});
|
|
467
|
-
},
|
|
467
|
+
}, ue = (e) => {
|
|
468
468
|
window.addEventListener("unhandledrejection", ({ reason: t }) => {
|
|
469
469
|
e.report({
|
|
470
470
|
type: "runtime",
|
|
471
471
|
kind: "unhandledRejection",
|
|
472
472
|
error: t
|
|
473
473
|
});
|
|
474
|
-
}), window.addEventListener("error", ({ colno: t, error: r, filename:
|
|
474
|
+
}), window.addEventListener("error", ({ colno: t, error: r, filename: n, lineno: s, message: o }) => {
|
|
475
475
|
e.report({
|
|
476
476
|
type: "runtime",
|
|
477
477
|
kind: "uncaughtError",
|
|
478
478
|
error: r,
|
|
479
479
|
data: {
|
|
480
|
-
lineno:
|
|
480
|
+
lineno: s,
|
|
481
481
|
colno: t,
|
|
482
|
-
message:
|
|
483
|
-
filename:
|
|
482
|
+
message: o,
|
|
483
|
+
filename: n
|
|
484
484
|
}
|
|
485
485
|
});
|
|
486
486
|
});
|
|
487
|
-
}, _ = Symbol("patchedXHLHttpRequest"),
|
|
487
|
+
}, _ = Symbol("patchedXHLHttpRequest"), p = Symbol("requestInfo"), de = (e) => ({
|
|
488
488
|
statusCode: e.status,
|
|
489
|
-
...e[
|
|
490
|
-
}),
|
|
489
|
+
...e[p]
|
|
490
|
+
}), le = (e) => (e[p] || (e[p] = {}), e[p]), pe = (e) => {
|
|
491
491
|
e[_] = !0;
|
|
492
|
-
},
|
|
493
|
-
const t = XMLHttpRequest.prototype.send, r = XMLHttpRequest.prototype.open,
|
|
494
|
-
const [a, i] =
|
|
495
|
-
this[
|
|
492
|
+
}, he = (e) => e[_] === !0, fe = (e) => {
|
|
493
|
+
const t = XMLHttpRequest.prototype.send, r = XMLHttpRequest.prototype.open, n = function(...o) {
|
|
494
|
+
const [a, i] = o;
|
|
495
|
+
this[p] = {
|
|
496
496
|
method: a,
|
|
497
497
|
url: typeof i == "string" ? i : i.toString()
|
|
498
|
-
},
|
|
498
|
+
}, he(this) || (pe(this), this.addEventListener("error", () => {
|
|
499
499
|
const c = new Error("XMLHttpRequest network error");
|
|
500
500
|
e.report({
|
|
501
501
|
type: "network",
|
|
502
502
|
kind: "xmlHttpRequestError",
|
|
503
|
-
data: this[
|
|
503
|
+
data: this[p],
|
|
504
504
|
error: c
|
|
505
505
|
});
|
|
506
506
|
}), this.addEventListener("timeout", () => {
|
|
@@ -508,7 +508,7 @@ const f = {
|
|
|
508
508
|
e.report({
|
|
509
509
|
type: "network",
|
|
510
510
|
kind: "xmlHttpRequestTimeoutError",
|
|
511
|
-
data: this[
|
|
511
|
+
data: this[p],
|
|
512
512
|
error: c
|
|
513
513
|
});
|
|
514
514
|
}), this.addEventListener("load", () => {
|
|
@@ -517,88 +517,88 @@ const f = {
|
|
|
517
517
|
e.report({
|
|
518
518
|
type: "network",
|
|
519
519
|
kind: "xmlHttpRequestLoadError",
|
|
520
|
-
data:
|
|
520
|
+
data: de(this),
|
|
521
521
|
error: c
|
|
522
522
|
});
|
|
523
523
|
}
|
|
524
524
|
}));
|
|
525
525
|
try {
|
|
526
|
-
r.apply(this,
|
|
526
|
+
r.apply(this, o);
|
|
527
527
|
} catch (c) {
|
|
528
528
|
throw e.report({
|
|
529
529
|
type: "network",
|
|
530
530
|
kind: "xmlHttpRequestOpenError",
|
|
531
531
|
error: c,
|
|
532
|
-
data: this[
|
|
532
|
+
data: this[p]
|
|
533
533
|
}), c;
|
|
534
534
|
}
|
|
535
|
-
},
|
|
535
|
+
}, s = function(o) {
|
|
536
536
|
try {
|
|
537
|
-
const a =
|
|
538
|
-
a.requestStack = i.stack, t.call(this,
|
|
537
|
+
const a = le(this), i = new Error("XMLHttpRequest request initiator");
|
|
538
|
+
a.requestStack = i.stack, t.call(this, o);
|
|
539
539
|
} catch (a) {
|
|
540
540
|
throw e.report({
|
|
541
541
|
type: "network",
|
|
542
542
|
kind: "xmlHttpRequestSendError",
|
|
543
543
|
error: a,
|
|
544
|
-
data: this[
|
|
544
|
+
data: this[p]
|
|
545
545
|
}), a;
|
|
546
546
|
}
|
|
547
547
|
};
|
|
548
548
|
Object.defineProperty(XMLHttpRequest.prototype, "open", {
|
|
549
|
-
value:
|
|
549
|
+
value: n,
|
|
550
550
|
configurable: !0,
|
|
551
551
|
writable: !0
|
|
552
552
|
}), Object.defineProperty(XMLHttpRequest.prototype, "send", {
|
|
553
|
-
value:
|
|
553
|
+
value: s,
|
|
554
554
|
configurable: !0,
|
|
555
555
|
writable: !0
|
|
556
556
|
});
|
|
557
557
|
};
|
|
558
|
-
let
|
|
559
|
-
class
|
|
558
|
+
let N;
|
|
559
|
+
class me {
|
|
560
560
|
constructor(t) {
|
|
561
561
|
this.onError = t;
|
|
562
562
|
}
|
|
563
563
|
report(t) {
|
|
564
|
-
if (
|
|
564
|
+
if (se(t))
|
|
565
565
|
return;
|
|
566
|
-
const { error: r, ...
|
|
566
|
+
const { error: r, ...n } = t;
|
|
567
567
|
this.onError({
|
|
568
|
-
...
|
|
569
|
-
error: r ?
|
|
568
|
+
...n,
|
|
569
|
+
error: r ? P(r) : void 0
|
|
570
570
|
});
|
|
571
571
|
}
|
|
572
572
|
init() {
|
|
573
573
|
this.applyIntegrations();
|
|
574
574
|
}
|
|
575
575
|
applyIntegrations() {
|
|
576
|
-
|
|
576
|
+
N || (N = !0, ue(this), fe(this), ce(this));
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
class
|
|
579
|
+
class ge {
|
|
580
580
|
constructor(t) {
|
|
581
581
|
const {
|
|
582
582
|
frameId: r,
|
|
583
|
-
serverId:
|
|
584
|
-
serverOrigin:
|
|
585
|
-
serverSource:
|
|
583
|
+
serverId: n,
|
|
584
|
+
serverOrigin: s,
|
|
585
|
+
serverSource: o,
|
|
586
586
|
theme: a
|
|
587
587
|
} = t, i = {
|
|
588
|
-
id:
|
|
589
|
-
origin:
|
|
590
|
-
source:
|
|
591
|
-
}, c = new
|
|
588
|
+
id: n,
|
|
589
|
+
origin: s,
|
|
590
|
+
source: o
|
|
591
|
+
}, c = new Y({
|
|
592
592
|
transportId: r
|
|
593
593
|
});
|
|
594
|
-
c.addPeer(i), this.rpcClient = new
|
|
594
|
+
c.addPeer(i), this.rpcClient = new K({
|
|
595
595
|
transport: c,
|
|
596
|
-
serverId:
|
|
597
|
-
}), this.subscriber = new
|
|
596
|
+
serverId: n
|
|
597
|
+
}), this.subscriber = new G({
|
|
598
598
|
transport: c,
|
|
599
599
|
brokerId: i.id
|
|
600
|
-
}), document.documentElement.dataset.theme = a, this.crashReporter = new
|
|
601
|
-
this.makeRequest("v1.system.report.crash",
|
|
600
|
+
}), document.documentElement.dataset.theme = a, this.crashReporter = new me((h) => {
|
|
601
|
+
this.makeRequest("v1.system.report.crash", h);
|
|
602
602
|
});
|
|
603
603
|
}
|
|
604
604
|
makeRequest(t, r) {
|
|
@@ -618,17 +618,17 @@ class he {
|
|
|
618
618
|
i.offsetHeight,
|
|
619
619
|
i.scrollHeight
|
|
620
620
|
);
|
|
621
|
-
},
|
|
621
|
+
}, n = () => {
|
|
622
622
|
const i = document.body;
|
|
623
623
|
return Math.max(
|
|
624
624
|
i.offsetWidth,
|
|
625
625
|
i.scrollWidth
|
|
626
626
|
);
|
|
627
|
-
},
|
|
628
|
-
const i =
|
|
627
|
+
}, s = () => {
|
|
628
|
+
const i = n(), c = r();
|
|
629
629
|
(t.height !== c || t.width !== i) && (t = { height: c, width: i }, this.makeRequest("v1.system.resize.notify", { height: c, width: i }));
|
|
630
630
|
};
|
|
631
|
-
|
|
631
|
+
s(), new ResizeObserver(s).observe(document.body), new MutationObserver(s).observe(document.body, {
|
|
632
632
|
childList: !0,
|
|
633
633
|
subtree: !0,
|
|
634
634
|
attributes: !0,
|
|
@@ -636,22 +636,77 @@ class he {
|
|
|
636
636
|
}), this.crashReporter.init();
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
639
|
+
const ye = HTMLElement.prototype.focus, Ee = SVGElement.prototype.focus;
|
|
640
|
+
function T(e) {
|
|
641
|
+
const t = typeof e == "object" && e ? { ...e, preventScroll: !0 } : { preventScroll: !0 };
|
|
642
|
+
if (this instanceof HTMLElement)
|
|
643
|
+
return ye.call(this, t);
|
|
644
|
+
if (this instanceof SVGElement)
|
|
645
|
+
return Ee.call(this, t);
|
|
646
|
+
}
|
|
647
|
+
const be = HTMLFormElement.prototype.submit, we = HTMLFormElement.prototype.requestSubmit, Re = /* @__PURE__ */ new Set(["_top", "_blank", "_parent"]), R = (e) => !!e && Re.has(e.toLowerCase());
|
|
648
|
+
function Me() {
|
|
649
|
+
const e = this.getAttribute("target");
|
|
650
|
+
if (!R(e))
|
|
651
|
+
return be.call(this);
|
|
652
|
+
}
|
|
653
|
+
function Ie(e) {
|
|
654
|
+
const t = (e == null ? void 0 : e.getAttribute("formtarget")) || this.getAttribute("target");
|
|
655
|
+
if (!R(t))
|
|
656
|
+
return we.call(this, e);
|
|
657
|
+
}
|
|
658
|
+
function ve(e) {
|
|
659
|
+
var s;
|
|
660
|
+
const t = e.target;
|
|
661
|
+
if (!(t instanceof HTMLFormElement))
|
|
662
|
+
return;
|
|
663
|
+
const r = e instanceof SubmitEvent ? e.submitter : null, n = (r == null ? void 0 : r.getAttribute("formtarget")) || t.getAttribute("target") || ((s = document.querySelector("base[target]")) == null ? void 0 : s.getAttribute("target")) || "_self";
|
|
664
|
+
R(n) && (e.preventDefault(), e.stopImmediatePropagation());
|
|
665
|
+
}
|
|
666
|
+
const l = () => {
|
|
667
|
+
}, u = (e, t, r) => {
|
|
668
|
+
const n = e;
|
|
669
|
+
if (!n || typeof n[t] != "function")
|
|
670
|
+
return;
|
|
671
|
+
const s = Object.getOwnPropertyDescriptor(n, t);
|
|
672
|
+
if (!(s && s.configurable === !1 && s.writable === !1))
|
|
673
|
+
try {
|
|
674
|
+
Object.defineProperty(n, t, {
|
|
675
|
+
configurable: !1,
|
|
676
|
+
enumerable: (s == null ? void 0 : s.enumerable) ?? !1,
|
|
677
|
+
value: r,
|
|
678
|
+
writable: !1
|
|
679
|
+
});
|
|
680
|
+
} catch {
|
|
681
|
+
}
|
|
682
|
+
}, Se = () => {
|
|
683
|
+
u(Window.prototype, "open", () => null), u(window, "open", () => null), u(Element.prototype, "scrollIntoView", l), u(
|
|
684
|
+
Element.prototype,
|
|
685
|
+
"scrollIntoViewIfNeeded",
|
|
686
|
+
l
|
|
687
|
+
), u(HTMLElement.prototype, "focus", T), u(SVGElement.prototype, "focus", T), u(History.prototype, "back", l), u(History.prototype, "forward", l), u(History.prototype, "go", l), u(History.prototype, "pushState", l), u(History.prototype, "replaceState", l), u(
|
|
688
|
+
HTMLVideoElement.prototype,
|
|
689
|
+
"requestPictureInPicture",
|
|
690
|
+
() => Promise.resolve({})
|
|
691
|
+
), u(HTMLFormElement.prototype, "submit", Me), u(HTMLFormElement.prototype, "requestSubmit", Ie), typeof Location < "u" && (u(Location.prototype, "assign", l), u(Location.prototype, "replace", l), u(Location.prototype, "reload", l)), document.addEventListener("submit", ve, !0);
|
|
692
|
+
};
|
|
693
|
+
let H = !1;
|
|
694
|
+
typeof window < "u" && typeof document < "u" && Se();
|
|
695
|
+
const Ne = () => {
|
|
696
|
+
if (H)
|
|
642
697
|
throw new Error("ext helper already created, only one instance is allowed");
|
|
643
|
-
const e = new URL(window.location.href), t = e.searchParams.get("origin") || "", r = e.searchParams.get("theme") || "dark",
|
|
644
|
-
if (!
|
|
698
|
+
const e = new URL(window.location.href), t = e.searchParams.get("origin") || "", r = e.searchParams.get("theme") || "dark", n = e.searchParams.get("frameId");
|
|
699
|
+
if (!n)
|
|
645
700
|
throw new Error("failed to create ext helper, frameId is empty");
|
|
646
|
-
const
|
|
701
|
+
const s = new ge({
|
|
647
702
|
serverId: "server",
|
|
648
703
|
serverOrigin: t || window.parent.origin,
|
|
649
704
|
serverSource: window.parent,
|
|
650
|
-
frameId:
|
|
705
|
+
frameId: n,
|
|
651
706
|
theme: r
|
|
652
707
|
});
|
|
653
|
-
return
|
|
708
|
+
return s.bootstrap(), H = !0, s;
|
|
654
709
|
};
|
|
655
710
|
export {
|
|
656
|
-
|
|
711
|
+
Ne as createExtHelper
|
|
657
712
|
};
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -85,8 +85,8 @@ declare type TMethods = TV1Methods;
|
|
|
85
85
|
/**
|
|
86
86
|
* Status of the movable overlay.
|
|
87
87
|
* `active` - pulsing green
|
|
88
|
-
* `inactive` -
|
|
89
|
-
* `connecting` -
|
|
88
|
+
* `inactive` - green
|
|
89
|
+
* `connecting` - orange
|
|
90
90
|
* `error` - red
|
|
91
91
|
*/
|
|
92
92
|
declare type TMovableOverlayStatus = 'active' | 'inactive' | 'connecting' | 'error';
|
|
@@ -498,7 +498,8 @@ declare type TV1ModelMethods = {
|
|
|
498
498
|
};
|
|
499
499
|
};
|
|
500
500
|
|
|
501
|
-
|
|
501
|
+
/** Status that indicates which type of show model is producing now */
|
|
502
|
+
declare type TV1ModelStatus = Exclude<TV1ShowStatus, 'spy'>;
|
|
502
503
|
|
|
503
504
|
declare type TV1MonitoringMethods = {
|
|
504
505
|
'v1.monitoring.report.error': {
|
|
@@ -664,6 +665,8 @@ declare type TV1SessionUpdate = {
|
|
|
664
665
|
|
|
665
666
|
declare type TV1SessionWhisperData = TUnknownDictionary;
|
|
666
667
|
|
|
668
|
+
declare type TV1ShowStatus = (typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES];
|
|
669
|
+
|
|
667
670
|
declare type TV1StorageMethods = {
|
|
668
671
|
'v1.storage.int.get': {
|
|
669
672
|
params: {
|
|
@@ -1007,18 +1010,27 @@ declare type TV1UsersFanClubSubscribed = {
|
|
|
1007
1010
|
tier: TV1FanClubTier;
|
|
1008
1011
|
};
|
|
1009
1012
|
|
|
1010
|
-
|
|
1013
|
+
/** Status that indicates which type of show user is watching now */
|
|
1014
|
+
declare type TV1UserStatus = Exclude<TV1ShowStatus, 'idle'>;
|
|
1011
1015
|
|
|
1012
1016
|
declare type TV1WhisperData = TUnknownDictionary;
|
|
1013
1017
|
|
|
1014
1018
|
declare const V1_SHOW_STATUSES: {
|
|
1019
|
+
/** Ticket show */
|
|
1015
1020
|
readonly STATUS_TICKET_SHOW: "ticketShow";
|
|
1021
|
+
/** Group show */
|
|
1016
1022
|
readonly STATUS_GROUP_SHOW: "groupShow";
|
|
1023
|
+
/** Model is not on the site */
|
|
1017
1024
|
readonly STATUS_OFF: "off";
|
|
1025
|
+
/** Private show */
|
|
1018
1026
|
readonly STATUS_PRIVATE: "private";
|
|
1027
|
+
/** Exclusive private show */
|
|
1019
1028
|
readonly STATUS_EXCLUSIVE_PRIVATE: "exclusivePrivate";
|
|
1029
|
+
/** Public show */
|
|
1020
1030
|
readonly STATUS_PUBLIC: "public";
|
|
1031
|
+
/** Model is idle but on the site */
|
|
1021
1032
|
readonly STATUS_IDLE: "idle";
|
|
1033
|
+
/** In spy mode */
|
|
1022
1034
|
readonly STATUS_SPY: "spy";
|
|
1023
1035
|
};
|
|
1024
1036
|
|
package/dist/helpers/react.d.ts
CHANGED
|
@@ -47,8 +47,8 @@ declare type TMethods = TV1Methods;
|
|
|
47
47
|
/**
|
|
48
48
|
* Status of the movable overlay.
|
|
49
49
|
* `active` - pulsing green
|
|
50
|
-
* `inactive` -
|
|
51
|
-
* `connecting` -
|
|
50
|
+
* `inactive` - green
|
|
51
|
+
* `connecting` - orange
|
|
52
52
|
* `error` - red
|
|
53
53
|
*/
|
|
54
54
|
declare type TMovableOverlayStatus = 'active' | 'inactive' | 'connecting' | 'error';
|
|
@@ -432,7 +432,8 @@ declare type TV1ModelMethods = {
|
|
|
432
432
|
};
|
|
433
433
|
};
|
|
434
434
|
|
|
435
|
-
|
|
435
|
+
/** Status that indicates which type of show model is producing now */
|
|
436
|
+
declare type TV1ModelStatus = Exclude<TV1ShowStatus, 'spy'>;
|
|
436
437
|
|
|
437
438
|
declare type TV1MonitoringMethods = {
|
|
438
439
|
'v1.monitoring.report.error': {
|
|
@@ -598,6 +599,8 @@ declare type TV1SessionUpdate = {
|
|
|
598
599
|
|
|
599
600
|
declare type TV1SessionWhisperData = TUnknownDictionary;
|
|
600
601
|
|
|
602
|
+
declare type TV1ShowStatus = (typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES];
|
|
603
|
+
|
|
601
604
|
declare type TV1StorageMethods = {
|
|
602
605
|
'v1.storage.int.get': {
|
|
603
606
|
params: {
|
|
@@ -941,7 +944,8 @@ declare type TV1UsersFanClubSubscribed = {
|
|
|
941
944
|
tier: TV1FanClubTier;
|
|
942
945
|
};
|
|
943
946
|
|
|
944
|
-
|
|
947
|
+
/** Status that indicates which type of show user is watching now */
|
|
948
|
+
declare type TV1UserStatus = Exclude<TV1ShowStatus, 'idle'>;
|
|
945
949
|
|
|
946
950
|
declare type TV1WhisperData = TUnknownDictionary;
|
|
947
951
|
|
|
@@ -964,13 +968,21 @@ export declare const useSlotState: <State extends object>({ channel, extHelper,
|
|
|
964
968
|
};
|
|
965
969
|
|
|
966
970
|
declare const V1_SHOW_STATUSES: {
|
|
971
|
+
/** Ticket show */
|
|
967
972
|
readonly STATUS_TICKET_SHOW: "ticketShow";
|
|
973
|
+
/** Group show */
|
|
968
974
|
readonly STATUS_GROUP_SHOW: "groupShow";
|
|
975
|
+
/** Model is not on the site */
|
|
969
976
|
readonly STATUS_OFF: "off";
|
|
977
|
+
/** Private show */
|
|
970
978
|
readonly STATUS_PRIVATE: "private";
|
|
979
|
+
/** Exclusive private show */
|
|
971
980
|
readonly STATUS_EXCLUSIVE_PRIVATE: "exclusivePrivate";
|
|
981
|
+
/** Public show */
|
|
972
982
|
readonly STATUS_PUBLIC: "public";
|
|
983
|
+
/** Model is idle but on the site */
|
|
973
984
|
readonly STATUS_IDLE: "idle";
|
|
985
|
+
/** In spy mode */
|
|
974
986
|
readonly STATUS_SPY: "spy";
|
|
975
987
|
};
|
|
976
988
|
|
package/dist/index.d.ts
CHANGED
|
@@ -81,8 +81,8 @@ export declare type TModelId = TUserId;
|
|
|
81
81
|
/**
|
|
82
82
|
* Status of the movable overlay.
|
|
83
83
|
* `active` - pulsing green
|
|
84
|
-
* `inactive` -
|
|
85
|
-
* `connecting` -
|
|
84
|
+
* `inactive` - green
|
|
85
|
+
* `connecting` - orange
|
|
86
86
|
* `error` - red
|
|
87
87
|
*/
|
|
88
88
|
export declare type TMovableOverlayStatus = 'active' | 'inactive' | 'connecting' | 'error';
|
|
@@ -468,7 +468,8 @@ declare type TV1ModelMethods = {
|
|
|
468
468
|
};
|
|
469
469
|
};
|
|
470
470
|
|
|
471
|
-
|
|
471
|
+
/** Status that indicates which type of show model is producing now */
|
|
472
|
+
export declare type TV1ModelStatus = Exclude<TV1ShowStatus, 'spy'>;
|
|
472
473
|
|
|
473
474
|
declare type TV1MonitoringMethods = {
|
|
474
475
|
'v1.monitoring.report.error': {
|
|
@@ -634,6 +635,8 @@ export declare type TV1SessionUpdate = {
|
|
|
634
635
|
|
|
635
636
|
export declare type TV1SessionWhisperData = TUnknownDictionary;
|
|
636
637
|
|
|
638
|
+
export declare type TV1ShowStatus = (typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES];
|
|
639
|
+
|
|
637
640
|
declare type TV1StorageMethods = {
|
|
638
641
|
'v1.storage.int.get': {
|
|
639
642
|
params: {
|
|
@@ -977,18 +980,27 @@ export declare type TV1UsersFanClubSubscribed = {
|
|
|
977
980
|
tier: TV1FanClubTier;
|
|
978
981
|
};
|
|
979
982
|
|
|
980
|
-
|
|
983
|
+
/** Status that indicates which type of show user is watching now */
|
|
984
|
+
export declare type TV1UserStatus = Exclude<TV1ShowStatus, 'idle'>;
|
|
981
985
|
|
|
982
986
|
export declare type TV1WhisperData = TUnknownDictionary;
|
|
983
987
|
|
|
984
988
|
export declare const V1_SHOW_STATUSES: {
|
|
989
|
+
/** Ticket show */
|
|
985
990
|
readonly STATUS_TICKET_SHOW: "ticketShow";
|
|
991
|
+
/** Group show */
|
|
986
992
|
readonly STATUS_GROUP_SHOW: "groupShow";
|
|
993
|
+
/** Model is not on the site */
|
|
987
994
|
readonly STATUS_OFF: "off";
|
|
995
|
+
/** Private show */
|
|
988
996
|
readonly STATUS_PRIVATE: "private";
|
|
997
|
+
/** Exclusive private show */
|
|
989
998
|
readonly STATUS_EXCLUSIVE_PRIVATE: "exclusivePrivate";
|
|
999
|
+
/** Public show */
|
|
990
1000
|
readonly STATUS_PUBLIC: "public";
|
|
1001
|
+
/** Model is idle but on the site */
|
|
991
1002
|
readonly STATUS_IDLE: "idle";
|
|
1003
|
+
/** In spy mode */
|
|
992
1004
|
readonly STATUS_SPY: "spy";
|
|
993
1005
|
};
|
|
994
1006
|
|