@chatlychat/react-native 0.0.0-stage → 0.1.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/README.md +208 -2
- package/dist/ChatlyProvider.d.ts +69 -0
- package/dist/ChatlyProvider.d.ts.map +1 -0
- package/dist/ChatlyProvider.js +146 -0
- package/dist/ChatlyProvider.js.map +1 -0
- package/dist/ChatlyWidget.d.ts +15 -0
- package/dist/ChatlyWidget.d.ts.map +1 -0
- package/dist/ChatlyWidget.js +122 -0
- package/dist/ChatlyWidget.js.map +1 -0
- package/dist/blocks/money.d.ts +56 -0
- package/dist/blocks/money.d.ts.map +1 -0
- package/dist/blocks/money.js +82 -0
- package/dist/blocks/money.js.map +1 -0
- package/dist/blocks/money.parity.spec.d.ts +2 -0
- package/dist/blocks/money.parity.spec.d.ts.map +1 -0
- package/dist/blocks/money.parity.spec.js +87 -0
- package/dist/blocks/money.parity.spec.js.map +1 -0
- package/dist/blocks/read-envelope.d.ts +15 -0
- package/dist/blocks/read-envelope.d.ts.map +1 -0
- package/dist/blocks/read-envelope.js +196 -0
- package/dist/blocks/read-envelope.js.map +1 -0
- package/dist/blocks/read-envelope.parity.spec.d.ts +2 -0
- package/dist/blocks/read-envelope.parity.spec.d.ts.map +1 -0
- package/dist/blocks/read-envelope.parity.spec.js +146 -0
- package/dist/blocks/read-envelope.parity.spec.js.map +1 -0
- package/dist/blocks/types.d.ts +171 -0
- package/dist/blocks/types.d.ts.map +1 -0
- package/dist/blocks/types.js +3 -0
- package/dist/blocks/types.js.map +1 -0
- package/dist/client/RealtimeClient.d.ts +29 -0
- package/dist/client/RealtimeClient.d.ts.map +1 -0
- package/dist/client/RealtimeClient.js +113 -0
- package/dist/client/RealtimeClient.js.map +1 -0
- package/dist/client/RealtimeClient.spec.d.ts +2 -0
- package/dist/client/RealtimeClient.spec.d.ts.map +1 -0
- package/dist/client/RealtimeClient.spec.js +123 -0
- package/dist/client/RealtimeClient.spec.js.map +1 -0
- package/dist/client/RestClient.d.ts +160 -0
- package/dist/client/RestClient.d.ts.map +1 -0
- package/dist/client/RestClient.js +395 -0
- package/dist/client/RestClient.js.map +1 -0
- package/dist/client/RestClient.spec.d.ts +2 -0
- package/dist/client/RestClient.spec.d.ts.map +1 -0
- package/dist/client/RestClient.spec.js +267 -0
- package/dist/client/RestClient.spec.js.map +1 -0
- package/dist/client/types.d.ts +148 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +14 -0
- package/dist/client/types.js.map +1 -0
- package/dist/components/Composer.d.ts +35 -0
- package/dist/components/Composer.d.ts.map +1 -0
- package/dist/components/Composer.js +180 -0
- package/dist/components/Composer.js.map +1 -0
- package/dist/components/HelpCenter.d.ts +13 -0
- package/dist/components/HelpCenter.d.ts.map +1 -0
- package/dist/components/HelpCenter.js +96 -0
- package/dist/components/HelpCenter.js.map +1 -0
- package/dist/components/MessageBlocks.d.ts +41 -0
- package/dist/components/MessageBlocks.d.ts.map +1 -0
- package/dist/components/MessageBlocks.js +167 -0
- package/dist/components/MessageBlocks.js.map +1 -0
- package/dist/components/MessageBubble.d.ts +14 -0
- package/dist/components/MessageBubble.d.ts.map +1 -0
- package/dist/components/MessageBubble.js +87 -0
- package/dist/components/MessageBubble.js.map +1 -0
- package/dist/components/MessageBubble.spec.d.ts +2 -0
- package/dist/components/MessageBubble.spec.d.ts.map +1 -0
- package/dist/components/MessageBubble.spec.js +207 -0
- package/dist/components/MessageBubble.spec.js.map +1 -0
- package/dist/components/MessageCanvas.d.ts +39 -0
- package/dist/components/MessageCanvas.d.ts.map +1 -0
- package/dist/components/MessageCanvas.js +144 -0
- package/dist/components/MessageCanvas.js.map +1 -0
- package/dist/components/MessageCanvas.spec.d.ts +2 -0
- package/dist/components/MessageCanvas.spec.d.ts.map +1 -0
- package/dist/components/MessageCanvas.spec.js +142 -0
- package/dist/components/MessageCanvas.spec.js.map +1 -0
- package/dist/components/MessagesList.d.ts +8 -0
- package/dist/components/MessagesList.d.ts.map +1 -0
- package/dist/components/MessagesList.js +58 -0
- package/dist/components/MessagesList.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/push/registerPushToken.d.ts +12 -0
- package/dist/push/registerPushToken.d.ts.map +1 -0
- package/dist/push/registerPushToken.js +32 -0
- package/dist/push/registerPushToken.js.map +1 -0
- package/dist/storage/TokenStore.d.ts +53 -0
- package/dist/storage/TokenStore.d.ts.map +1 -0
- package/dist/storage/TokenStore.js +89 -0
- package/dist/storage/TokenStore.js.map +1 -0
- package/dist/test/react-native-dom.d.ts +97 -0
- package/dist/test/react-native-dom.d.ts.map +1 -0
- package/dist/test/react-native-dom.js +155 -0
- package/dist/test/react-native-dom.js.map +1 -0
- package/dist/test/react-native-dom.spec.d.ts +2 -0
- package/dist/test/react-native-dom.spec.d.ts.map +1 -0
- package/dist/test/react-native-dom.spec.js +83 -0
- package/dist/test/react-native-dom.spec.js.map +1 -0
- package/dist/theme/ChatlyTheme.d.ts +37 -0
- package/dist/theme/ChatlyTheme.d.ts.map +1 -0
- package/dist/theme/ChatlyTheme.js +2 -0
- package/dist/theme/ChatlyTheme.js.map +1 -0
- package/dist/theme/defaultTheme.d.ts +7 -0
- package/dist/theme/defaultTheme.d.ts.map +1 -0
- package/dist/theme/defaultTheme.js +37 -0
- package/dist/theme/defaultTheme.js.map +1 -0
- package/dist/useChatly.d.ts +3 -0
- package/dist/useChatly.d.ts.map +1 -0
- package/dist/useChatly.js +10 -0
- package/dist/useChatly.js.map +1 -0
- package/package.json +50 -4
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin wrapper around the widget REST surface (see `apps/widget/src/client.ts`).
|
|
3
|
+
*
|
|
4
|
+
* All write endpoints accept the `publicId` + `visitorToken` in the JSON body.
|
|
5
|
+
* The visitor token is persisted via `TokenStore` and rotated whenever
|
|
6
|
+
* `/v1/widget/init` returns a fresh one.
|
|
7
|
+
*/
|
|
8
|
+
import { Platform } from 'react-native';
|
|
9
|
+
import { IdentityStore, TokenStore } from '../storage/TokenStore';
|
|
10
|
+
const DEFAULT_API_HOST = 'api.chatly.com';
|
|
11
|
+
export class RestClient {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.tokenCache = null;
|
|
14
|
+
/** `undefined` = not yet read from disk; `null` = read, nothing stored. */
|
|
15
|
+
this.identityCache = undefined;
|
|
16
|
+
this.publicId = config.publicId;
|
|
17
|
+
const host = config.apiHost ?? DEFAULT_API_HOST;
|
|
18
|
+
const scheme = config.secure === false ? 'http' : 'https';
|
|
19
|
+
this.apiUrl = `${scheme}://${host}`;
|
|
20
|
+
this.tokenStore = new TokenStore(config.publicId);
|
|
21
|
+
this.identityStore = new IdentityStore(config.publicId);
|
|
22
|
+
}
|
|
23
|
+
get baseUrl() {
|
|
24
|
+
return this.apiUrl;
|
|
25
|
+
}
|
|
26
|
+
async getToken() {
|
|
27
|
+
if (this.tokenCache !== null) {
|
|
28
|
+
return this.tokenCache;
|
|
29
|
+
}
|
|
30
|
+
this.tokenCache = await this.tokenStore.get();
|
|
31
|
+
return this.tokenCache;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Forget this device's session entirely. Backs `logout()`.
|
|
35
|
+
*
|
|
36
|
+
* Drops the remembered identity too: after a logout, a stale-session
|
|
37
|
+
* recovery must NOT quietly re-identify as the person who just signed out.
|
|
38
|
+
*/
|
|
39
|
+
async clearToken() {
|
|
40
|
+
await this.dropToken();
|
|
41
|
+
this.identityCache = null;
|
|
42
|
+
await this.identityStore.clear();
|
|
43
|
+
}
|
|
44
|
+
/** Drop only the session credential, keeping the remembered identity so a
|
|
45
|
+
* recovery can replay it. */
|
|
46
|
+
async dropToken() {
|
|
47
|
+
this.tokenCache = null;
|
|
48
|
+
await this.tokenStore.clear();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The identity to replay after the server refuses a stale session.
|
|
52
|
+
*
|
|
53
|
+
* Only offered when we hold BOTH an external id and its hash — mirroring
|
|
54
|
+
* `rememberedIdentity()` in `apps/widget/src/client.ts`. On a channel with
|
|
55
|
+
* identity verification enabled a claim without a hash is refused, and on a
|
|
56
|
+
* channel without it a legacy token is still accepted, so an unverifiable
|
|
57
|
+
* replay could only ever turn one refusal into two. Without both, the SDK
|
|
58
|
+
* re-inits anonymously and history returns as soon as the host app calls
|
|
59
|
+
* `identify()` again.
|
|
60
|
+
*/
|
|
61
|
+
async rememberedIdentity() {
|
|
62
|
+
if (this.identityCache === undefined) {
|
|
63
|
+
this.identityCache = await this.identityStore.get();
|
|
64
|
+
}
|
|
65
|
+
return this.identityCache ?? undefined;
|
|
66
|
+
}
|
|
67
|
+
async init(identity) {
|
|
68
|
+
const token = await this.getToken();
|
|
69
|
+
const body = {
|
|
70
|
+
publicId: this.publicId,
|
|
71
|
+
visitorToken: token ?? undefined,
|
|
72
|
+
locale: 'en-US',
|
|
73
|
+
timezone: 'UTC',
|
|
74
|
+
page: { url: `app://${Platform.OS}`, title: 'native' },
|
|
75
|
+
};
|
|
76
|
+
if (identity !== undefined) {
|
|
77
|
+
body.identity = identity;
|
|
78
|
+
}
|
|
79
|
+
const parsed = await this.post('/v1/widget/init', body);
|
|
80
|
+
if (parsed.session.token) {
|
|
81
|
+
this.tokenCache = parsed.session.token;
|
|
82
|
+
await this.tokenStore.set(parsed.session.token);
|
|
83
|
+
}
|
|
84
|
+
// Remembered only once the server has ACCEPTED the identity, and only
|
|
85
|
+
// when it carries a hash — see `rememberedIdentity()`.
|
|
86
|
+
if (identity !== undefined && identity.userHash !== undefined) {
|
|
87
|
+
this.identityCache = identity;
|
|
88
|
+
await this.identityStore.set(identity);
|
|
89
|
+
}
|
|
90
|
+
return parsed;
|
|
91
|
+
}
|
|
92
|
+
async start(body, attachments) {
|
|
93
|
+
return this.post('/v1/widget/conversations', {
|
|
94
|
+
publicId: this.publicId,
|
|
95
|
+
visitorToken: (await this.getToken()) ?? '',
|
|
96
|
+
body,
|
|
97
|
+
...(attachments !== undefined && attachments.length > 0 ? { attachments } : {}),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async reply(conversationId, body, attachments) {
|
|
101
|
+
return this.post('/v1/widget/messages', {
|
|
102
|
+
publicId: this.publicId,
|
|
103
|
+
visitorToken: (await this.getToken()) ?? '',
|
|
104
|
+
conversationId,
|
|
105
|
+
body,
|
|
106
|
+
...(attachments !== undefined && attachments.length > 0 ? { attachments } : {}),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A card's `postback` action: a reply the bot reads, optionally invisible.
|
|
111
|
+
*
|
|
112
|
+
* `silent` is what makes a filter chip work — the agent hears "under_50"
|
|
113
|
+
* and the shopper does not see their own tap echoed as a message bubble.
|
|
114
|
+
* It is a separate method rather than an option on `reply` because the two
|
|
115
|
+
* differ in whether anything renders.
|
|
116
|
+
*/
|
|
117
|
+
async postback(conversationId, input) {
|
|
118
|
+
return this.post('/v1/widget/messages', {
|
|
119
|
+
publicId: this.publicId,
|
|
120
|
+
visitorToken: (await this.getToken()) ?? '',
|
|
121
|
+
conversationId,
|
|
122
|
+
body: input.value,
|
|
123
|
+
...(input.payload === undefined ? {} : { payload: input.payload }),
|
|
124
|
+
...(input.silent === true ? { silent: true } : {}),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Report what the APP did about a `host_event` card action.
|
|
129
|
+
*
|
|
130
|
+
* This is the other half of the one feature a native SDK exists for. A card
|
|
131
|
+
* saying "Pay $48.20" cannot run Stripe from inside a chat library — the
|
|
132
|
+
* app does it, with the buyer's real session and a native payment sheet —
|
|
133
|
+
* and then has to say what happened, or the shopper is left looking at a
|
|
134
|
+
* card with nothing under it and the bot asks again.
|
|
135
|
+
*
|
|
136
|
+
* `text` appends a visible line under the card. `status: 'failed'` with no
|
|
137
|
+
* text is legitimate: the bot is told, and the shopper sees the card
|
|
138
|
+
* unchanged rather than an error they can do nothing about.
|
|
139
|
+
*/
|
|
140
|
+
async reportAction(conversationId, input) {
|
|
141
|
+
return this.post(`/v1/widget/conversations/${encodeURIComponent(conversationId)}/action-result`, {
|
|
142
|
+
publicId: this.publicId,
|
|
143
|
+
visitorToken: (await this.getToken()) ?? '',
|
|
144
|
+
messageId: input.messageId,
|
|
145
|
+
actionId: input.actionId,
|
|
146
|
+
status: input.status,
|
|
147
|
+
...(input.text === undefined ? {} : { text: input.text }),
|
|
148
|
+
...(input.data === undefined ? {} : { data: input.data }),
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/** A `step` card action: ask for the first step of a flow and post it. */
|
|
152
|
+
async requestCanvasStep(conversationId, canvasId, params) {
|
|
153
|
+
return this.post(`/v1/widget/conversations/${encodeURIComponent(conversationId)}/canvas-step`, {
|
|
154
|
+
publicId: this.publicId,
|
|
155
|
+
visitorToken: (await this.getToken()) ?? '',
|
|
156
|
+
canvasId,
|
|
157
|
+
...(params === undefined ? {} : { params }),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Submit a canvas step.
|
|
162
|
+
*
|
|
163
|
+
* `errors` comes back keyed by field name when the server refuses, and the
|
|
164
|
+
* canvas comes back either way — a refused submission returns the SAME
|
|
165
|
+
* canvas with messages on it, which is why the renderer replaces what it
|
|
166
|
+
* holds rather than keeping its own copy.
|
|
167
|
+
*/
|
|
168
|
+
async submitCanvas(conversationId, input) {
|
|
169
|
+
return this.post(`/v1/widget/conversations/${encodeURIComponent(conversationId)}/canvas`, {
|
|
170
|
+
publicId: this.publicId,
|
|
171
|
+
visitorToken: (await this.getToken()) ?? '',
|
|
172
|
+
messageId: input.messageId,
|
|
173
|
+
actionId: input.actionId,
|
|
174
|
+
values: input.values,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Uploads raw bytes to the public widget upload endpoint and returns the
|
|
179
|
+
* persisted [Attachment] reference. The widget surface accepts only JSON,
|
|
180
|
+
* so the bytes are base64-encoded before transport. The server enforces
|
|
181
|
+
* the size cap — clients must not pre-check.
|
|
182
|
+
*/
|
|
183
|
+
async uploadAttachment(input) {
|
|
184
|
+
const data = bytesToBase64(input.bytes);
|
|
185
|
+
return this.post('/v1/widget/uploads/presign', {
|
|
186
|
+
publicId: this.publicId,
|
|
187
|
+
visitorToken: (await this.getToken()) ?? '',
|
|
188
|
+
filename: input.filename,
|
|
189
|
+
mimeType: input.mimeType,
|
|
190
|
+
data,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
async listConversations(limit = 20) {
|
|
194
|
+
return this.post('/v1/widget/conversations/list', {
|
|
195
|
+
publicId: this.publicId,
|
|
196
|
+
visitorToken: (await this.getToken()) ?? '',
|
|
197
|
+
limit,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
async listMessages(conversationId, limit = 50) {
|
|
201
|
+
return this.post('/v1/widget/messages/list', {
|
|
202
|
+
publicId: this.publicId,
|
|
203
|
+
visitorToken: (await this.getToken()) ?? '',
|
|
204
|
+
conversationId,
|
|
205
|
+
limit,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
async searchKb(query, limit = 8) {
|
|
209
|
+
return this.post('/v1/widget/kb/search', {
|
|
210
|
+
publicId: this.publicId,
|
|
211
|
+
visitorToken: (await this.getToken()) ?? undefined,
|
|
212
|
+
query,
|
|
213
|
+
limit,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
async getKbArticle(slug) {
|
|
217
|
+
return this.post('/v1/widget/kb/article', {
|
|
218
|
+
publicId: this.publicId,
|
|
219
|
+
visitorToken: (await this.getToken()) ?? undefined,
|
|
220
|
+
slug,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
async registerPushToken(input) {
|
|
224
|
+
const visitorToken = await this.getToken();
|
|
225
|
+
if (visitorToken === null) {
|
|
226
|
+
throw new Error('[chatly] cannot register push token before init()');
|
|
227
|
+
}
|
|
228
|
+
return this.post('/v1/widget/push/register', {
|
|
229
|
+
publicId: this.publicId,
|
|
230
|
+
visitorToken,
|
|
231
|
+
platform: input.platform,
|
|
232
|
+
token: input.token,
|
|
233
|
+
...(input.appVersion !== undefined ? { appVersion: input.appVersion } : {}),
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* @param idempotencyKey minted once per logical call and REUSED on the
|
|
238
|
+
* stale-session replay below, so a replayed write coalesces server-side
|
|
239
|
+
* instead of double-sending.
|
|
240
|
+
* @param isRetry set only by `recoverSession`, to bound recovery to a
|
|
241
|
+
* single attempt. A second refusal is a real error and is thrown.
|
|
242
|
+
*/
|
|
243
|
+
async post(path, body, idempotencyKey, isRetry = false) {
|
|
244
|
+
const key = idempotencyKey ?? newIdempotencyKey();
|
|
245
|
+
const res = await fetch(`${this.apiUrl}${path}`, {
|
|
246
|
+
method: 'POST',
|
|
247
|
+
headers: {
|
|
248
|
+
'content-type': 'application/json',
|
|
249
|
+
accept: 'application/json',
|
|
250
|
+
'idempotency-key': key,
|
|
251
|
+
},
|
|
252
|
+
body: JSON.stringify(body),
|
|
253
|
+
});
|
|
254
|
+
if (!res.ok) {
|
|
255
|
+
const text = await safeText(res);
|
|
256
|
+
if (res.status === 403 && !isRetry && isStaleSession(text)) {
|
|
257
|
+
return this.recoverSession(path, body, key);
|
|
258
|
+
}
|
|
259
|
+
throw new Error(`[chatly] ${path} failed: ${res.status} ${text}`);
|
|
260
|
+
}
|
|
261
|
+
return (await res.json());
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* The server refused the token in this device's storage. Get a new one and
|
|
265
|
+
* replay the call, once.
|
|
266
|
+
*
|
|
267
|
+
* This is what a mid-session mobile visitor hits on the deploy that closes
|
|
268
|
+
* the identity-verification bypass: the token in the token store predates
|
|
269
|
+
* signed visitor sessions, and on a channel with verification enabled it is
|
|
270
|
+
* refused rather than honoured. Without this the app surfaces one failed
|
|
271
|
+
* send and only self-heals on the NEXT launch, because the dead token stays
|
|
272
|
+
* on disk. Handled here rather than surfaced, because from the visitor's
|
|
273
|
+
* side nothing has gone wrong.
|
|
274
|
+
*
|
|
275
|
+
* The dead token is cleared from the token store, not just the in-memory
|
|
276
|
+
* cache — otherwise the next launch repeats the failure.
|
|
277
|
+
*/
|
|
278
|
+
async recoverSession(path, body, idempotencyKey) {
|
|
279
|
+
const retry = { ...body };
|
|
280
|
+
const identity = await this.rememberedIdentity();
|
|
281
|
+
await this.dropToken();
|
|
282
|
+
if (path === '/v1/widget/init') {
|
|
283
|
+
// Re-boot in place: drop the dead token and keep whatever identity the
|
|
284
|
+
// caller asked for, falling back to the remembered one.
|
|
285
|
+
delete retry['visitorToken'];
|
|
286
|
+
if (retry['identity'] === undefined && identity !== undefined) {
|
|
287
|
+
retry['identity'] = identity;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
await this.init(identity);
|
|
292
|
+
retry['visitorToken'] = this.tokenCache ?? '';
|
|
293
|
+
}
|
|
294
|
+
return this.post(path, retry, idempotencyKey, true);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Does this 403 mean "your session token is no good", as opposed to any of
|
|
299
|
+
* the other things a widget call can be forbidden for (a disallowed origin, a
|
|
300
|
+
* missing identity hash)? Only the session codes are cured by fetching a new
|
|
301
|
+
* token; retrying the others would just fail again, more slowly.
|
|
302
|
+
*
|
|
303
|
+
* Both `visitor_session_upgrade_required` and `visitor_session_invalid` are
|
|
304
|
+
* matched by prefix, so a future third session code recovers for free.
|
|
305
|
+
*/
|
|
306
|
+
function isStaleSession(responseText) {
|
|
307
|
+
try {
|
|
308
|
+
/*
|
|
309
|
+
* The API NESTS every error: `app-exception.filter.ts` ends with
|
|
310
|
+
* `send({ error: body })`, so a refusal is `{ error: { code, ... } }`.
|
|
311
|
+
* This read `body.code` at the top level, which is `undefined` for every
|
|
312
|
+
* real response — so it returned false every time and the recovery below
|
|
313
|
+
* never fired. A visitor holding an expired token got the failures this
|
|
314
|
+
* client was written to absorb.
|
|
315
|
+
*
|
|
316
|
+
* The third place with this exact bug: the widget (fixed 2026-10-08),
|
|
317
|
+
* `sdk-js`, and here. Each was written by reading the previous one.
|
|
318
|
+
*/
|
|
319
|
+
const body = JSON.parse(responseText);
|
|
320
|
+
const code = body.error?.code ?? body.code;
|
|
321
|
+
return typeof code === 'string' && code.startsWith('visitor_session_');
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Lightweight UUID-ish token for the `Idempotency-Key` header. RN has
|
|
329
|
+
* `crypto.randomUUID` on modern Hermes builds but it's not universal — fall
|
|
330
|
+
* back to a time + random hex string when missing.
|
|
331
|
+
*/
|
|
332
|
+
function newIdempotencyKey() {
|
|
333
|
+
const g = globalThis;
|
|
334
|
+
if (g.crypto?.randomUUID !== undefined) {
|
|
335
|
+
return g.crypto.randomUUID();
|
|
336
|
+
}
|
|
337
|
+
const t = Date.now().toString(36);
|
|
338
|
+
const r = Math.floor(Math.random() * 1e16).toString(36);
|
|
339
|
+
return `rn-${t}-${r}`;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Base64-encodes a Uint8Array without pulling in `Buffer`. RN exposes
|
|
343
|
+
* `globalThis.btoa` on Hermes; older builds need the manual path.
|
|
344
|
+
*/
|
|
345
|
+
function bytesToBase64(bytes) {
|
|
346
|
+
const g = globalThis;
|
|
347
|
+
let binary = '';
|
|
348
|
+
// Chunk to avoid blowing the call stack on large fromCharCode applies.
|
|
349
|
+
const chunkSize = 0x8000;
|
|
350
|
+
for (let i = 0; i < bytes.length; i += chunkSize) {
|
|
351
|
+
binary += String.fromCharCode.apply(null, Array.from(bytes.subarray(i, i + chunkSize)));
|
|
352
|
+
}
|
|
353
|
+
if (g.btoa !== undefined) {
|
|
354
|
+
return g.btoa(binary);
|
|
355
|
+
}
|
|
356
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
357
|
+
// Every index below is the result of bit-masks that produce values in
|
|
358
|
+
// [0, 63] and `chars` is exactly 64 characters long, so the lookup is always
|
|
359
|
+
// defined. `charAt` says that in the type system — it returns `string`, not
|
|
360
|
+
// `string | undefined` — where `chars[n]!` only asserted it past
|
|
361
|
+
// `noUncheckedIndexedAccess`. Same output for every reachable index.
|
|
362
|
+
const at = (n) => chars.charAt(n);
|
|
363
|
+
let result = '';
|
|
364
|
+
let i = 0;
|
|
365
|
+
for (; i + 2 < binary.length; i += 3) {
|
|
366
|
+
const a = binary.charCodeAt(i);
|
|
367
|
+
const b = binary.charCodeAt(i + 1);
|
|
368
|
+
const c = binary.charCodeAt(i + 2);
|
|
369
|
+
result +=
|
|
370
|
+
at(a >> 2) +
|
|
371
|
+
at(((a & 0x03) << 4) | (b >> 4)) +
|
|
372
|
+
at(((b & 0x0f) << 2) | (c >> 6)) +
|
|
373
|
+
at(c & 0x3f);
|
|
374
|
+
}
|
|
375
|
+
if (i < binary.length) {
|
|
376
|
+
const a = binary.charCodeAt(i);
|
|
377
|
+
if (i + 1 === binary.length) {
|
|
378
|
+
result += at(a >> 2) + at((a & 0x03) << 4) + '==';
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
const b = binary.charCodeAt(i + 1);
|
|
382
|
+
result += at(a >> 2) + at(((a & 0x03) << 4) | (b >> 4)) + at((b & 0x0f) << 2) + '=';
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return result;
|
|
386
|
+
}
|
|
387
|
+
async function safeText(res) {
|
|
388
|
+
try {
|
|
389
|
+
return await res.text();
|
|
390
|
+
}
|
|
391
|
+
catch {
|
|
392
|
+
return '';
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
//# sourceMappingURL=RestClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RestClient.js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