sitcod3 commited on
Commit
7962ac9
·
verified ·
1 Parent(s): 111f4d6

Upload folder using huggingface_hub (part 10)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. node_modules/@supabase/realtime-js/LICENSE +21 -0
  3. node_modules/@supabase/realtime-js/README.md +447 -0
  4. node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts +62 -0
  5. node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts.map +1 -0
  6. node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js +38 -0
  7. node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js.map +1 -0
  8. node_modules/@supabase/realtime-js/dist/tsconfig.module.tsbuildinfo +1 -0
  9. node_modules/@supabase/realtime-js/dist/tsconfig.tsbuildinfo +1 -0
  10. node_modules/@supabase/realtime-js/migrations/README.md +25 -0
  11. node_modules/@supabase/realtime-js/migrations/httpsend-server-version.md +88 -0
  12. node_modules/@supabase/realtime-js/package.json +63 -0
  13. node_modules/@supabase/realtime-js/src/RealtimeChannel.ts +1340 -0
  14. node_modules/@supabase/realtime-js/src/RealtimeClient.ts +867 -0
  15. node_modules/@supabase/realtime-js/src/RealtimePostgresFilterBuilder.ts +253 -0
  16. node_modules/@supabase/realtime-js/src/RealtimePresence.ts +71 -0
  17. node_modules/@supabase/realtime-js/src/index.ts +61 -0
  18. node_modules/@supabase/realtime-js/src/lib/constants.ts +62 -0
  19. node_modules/@supabase/realtime-js/src/lib/normalizeChannelError.ts +30 -0
  20. node_modules/@supabase/realtime-js/src/lib/serializer.ts +214 -0
  21. node_modules/@supabase/realtime-js/src/lib/transformers.ts +270 -0
  22. node_modules/@supabase/realtime-js/src/lib/version.ts +7 -0
  23. node_modules/@supabase/realtime-js/src/lib/websocket-factory.ts +185 -0
  24. node_modules/@supabase/realtime-js/src/phoenix/channelAdapter.ts +149 -0
  25. node_modules/@supabase/realtime-js/src/phoenix/presenceAdapter.ts +119 -0
  26. node_modules/@supabase/realtime-js/src/phoenix/socketAdapter.ts +168 -0
  27. node_modules/@supabase/realtime-js/src/phoenix/types.ts +32 -0
  28. node_modules/@supabase/storage-js/AGENTS.md +11 -0
  29. node_modules/@supabase/storage-js/LICENSE +21 -0
  30. node_modules/@supabase/storage-js/README.md +1266 -0
  31. node_modules/@supabase/storage-js/dist/index.cjs +0 -0
  32. node_modules/@supabase/storage-js/dist/index.cjs.map +0 -0
  33. node_modules/@supabase/storage-js/dist/index.d.cts +0 -0
  34. node_modules/@supabase/storage-js/dist/index.d.cts.map +1 -0
  35. node_modules/@supabase/storage-js/dist/index.d.mts +0 -0
  36. node_modules/@supabase/storage-js/dist/index.d.mts.map +1 -0
  37. node_modules/@supabase/storage-js/dist/index.mjs +0 -0
  38. node_modules/@supabase/storage-js/dist/index.mjs.map +0 -0
  39. node_modules/@supabase/storage-js/dist/umd/supabase.js +1 -0
  40. node_modules/@supabase/storage-js/migrations/README.md +25 -0
  41. node_modules/@supabase/storage-js/package.json +70 -0
  42. node_modules/@supabase/storage-js/src/StorageClient.ts +98 -0
  43. node_modules/@supabase/storage-js/src/index.ts +19 -0
  44. node_modules/@supabase/storage-js/src/lib/common/BaseApiClient.ts +104 -0
  45. node_modules/@supabase/storage-js/src/lib/common/errors.ts +171 -0
  46. node_modules/@supabase/storage-js/src/lib/common/fetch.ts +305 -0
  47. node_modules/@supabase/storage-js/src/lib/common/headers.ts +43 -0
  48. node_modules/@supabase/storage-js/src/lib/common/helpers.ts +159 -0
  49. node_modules/@supabase/storage-js/src/lib/constants.ts +4 -0
  50. node_modules/@supabase/storage-js/src/lib/types.ts +662 -0
.gitattributes CHANGED
@@ -36,3 +36,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
36
  node_modules/@esbuild/win32-x64/esbuild.exe filter=lfs diff=lfs merge=lfs -text
37
  node_modules/@rollup/rollup-win32-x64-gnu/rollup.win32-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
38
  node_modules/@rollup/rollup-win32-x64-msvc/rollup.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
 
 
36
  node_modules/@esbuild/win32-x64/esbuild.exe filter=lfs diff=lfs merge=lfs -text
37
  node_modules/@rollup/rollup-win32-x64-gnu/rollup.win32-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
38
  node_modules/@rollup/rollup-win32-x64-msvc/rollup.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
39
+ node_modules/@tailwindcss/oxide-win32-x64-msvc/tailwindcss-oxide.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
node_modules/@supabase/realtime-js/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Supabase
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
node_modules/@supabase/realtime-js/README.md ADDED
@@ -0,0 +1,447 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <br />
2
+ <p align="center">
3
+ <a href="https://supabase.io">
4
+ <picture>
5
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/supabase-logo-wordmark--dark.svg">
6
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/supabase-logo-wordmark--light.svg">
7
+ <img alt="Supabase Logo" width="300" src="https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/logo-preview.jpg">
8
+ </picture>
9
+ </a>
10
+
11
+ <h1 align="center">Supabase Realtime JS SDK</h1>
12
+
13
+ <h3 align="center">Send ephemeral messages with <b>Broadcast</b>, track and synchronize state with <b>Presence</b>, and listen to database changes with <b>Postgres Change Data Capture (CDC)</b>.</h3>
14
+
15
+ <p align="center">
16
+ <a href="https://supabase.com/docs/guides/realtime">Guides</a>
17
+ ·
18
+ <a href="https://supabase.com/docs/reference/javascript">Reference Docs</a>
19
+ ·
20
+ <a href="https://multiplayer.dev">Multiplayer Demo</a>
21
+ </p>
22
+ </p>
23
+
24
+ <div align="center">
25
+
26
+ [![Build](https://github.com/supabase/supabase-js/workflows/CI/badge.svg)](https://github.com/supabase/supabase-js/actions?query=branch%3Amaster)
27
+ [![Package](https://img.shields.io/npm/v/@supabase/realtime-js)](https://www.npmjs.com/package/@supabase/realtime-js)
28
+ [![License: MIT](https://img.shields.io/npm/l/@supabase/supabase-js)](#license)
29
+ [![pkg.pr.new](https://pkg.pr.new/badge/supabase/realtime-js)](https://pkg.pr.new/~/supabase/realtime-js)
30
+
31
+ </div>
32
+
33
+ # Overview
34
+
35
+ This SDK enables you to use the following Supabase Realtime's features:
36
+
37
+ - **Broadcast**: send ephemeral messages from client to clients with minimal latency. Use cases include sharing cursor positions between users.
38
+ - **Presence**: track and synchronize shared state across clients with the help of CRDTs. Use cases include tracking which users are currently viewing a specific webpage.
39
+ - **Postgres Change Data Capture (CDC)**: listen for changes in your PostgreSQL database and send them to clients.
40
+
41
+ # Usage
42
+
43
+ ## Installing the Package
44
+
45
+ ```bash
46
+ npm install @supabase/realtime-js
47
+ ```
48
+
49
+ ## Creating a Channel
50
+
51
+ ```js
52
+ import { RealtimeClient } from '@supabase/realtime-js'
53
+
54
+ const client = new RealtimeClient(REALTIME_URL, {
55
+ params: {
56
+ apikey: API_KEY,
57
+ },
58
+ })
59
+
60
+ const channel = client.channel('test-channel', {})
61
+
62
+ channel.subscribe((status, err) => {
63
+ if (status === 'SUBSCRIBED') {
64
+ console.log('Connected!')
65
+ }
66
+
67
+ if (status === 'CHANNEL_ERROR') {
68
+ console.log(`There was an error subscribing to channel: ${err.message}`)
69
+ }
70
+
71
+ if (status === 'TIMED_OUT') {
72
+ console.log('Realtime server did not respond in time.')
73
+ }
74
+
75
+ if (status === 'CLOSED') {
76
+ console.log('Realtime channel was unexpectedly closed.')
77
+ }
78
+ })
79
+ ```
80
+
81
+ ### Notes:
82
+
83
+ - `REALTIME_URL` is `'ws://localhost:4000/socket'` when developing locally and `'wss://<project_ref>.supabase.co/realtime/v1'` when connecting to your Supabase project.
84
+ - `API_KEY` is a JWT whose claims must contain `exp` and `role` (existing database role).
85
+ - Channel name can be any `string`.
86
+ - Setting `private` to `true` means that the client will use RLS to determine if the user can connect or not to a given channel.
87
+
88
+ ## Broadcast
89
+
90
+ Your client can send and receive messages based on the `event`.
91
+
92
+ ```js
93
+ // Setup...
94
+
95
+ const channel = client.channel('broadcast-test', { broadcast: { ack: false, self: false } })
96
+
97
+ channel.on('broadcast', { event: 'some-event' }, (payload) => console.log(payload))
98
+
99
+ channel.subscribe(async (status) => {
100
+ if (status === 'SUBSCRIBED') {
101
+ // Send message to other clients listening to 'broadcast-test' channel
102
+ await channel.send({
103
+ type: 'broadcast',
104
+ event: 'some-event',
105
+ payload: { hello: 'world' },
106
+ })
107
+ }
108
+ })
109
+ ```
110
+
111
+ ### Notes:
112
+
113
+ - Setting `ack` to `true` means that the `channel.send` promise will resolve once server replies with acknowledgment that it received the broadcast message request.
114
+ - Setting `self` to `true` means that the client will receive the broadcast message it sent out.
115
+
116
+ ### Broadcast Replay
117
+
118
+ Broadcast Replay enables **private** channels to access messages that were sent earlier. Only messages published via [Broadcast From the Database](https://supabase.com/docs/guides/realtime/broadcast#trigger-broadcast-messages-from-your-database) are available for replay.
119
+
120
+ You can configure replay with the following options:
121
+
122
+ - **`since`** (Required): The epoch timestamp in milliseconds, specifying the earliest point from which messages should be retrieved.
123
+ - **`limit`** (Optional): The number of messages to return. This must be a positive integer, with a maximum value of 25.
124
+
125
+ Example:
126
+
127
+ ```typescript
128
+ const twelveHours = 12 * 60 * 60 * 1000
129
+ const twelveHoursAgo = Date.now() - twelveHours
130
+
131
+ const config = { private: true, broadcast: { replay: { since: twelveHoursAgo, limit: 10 } } }
132
+
133
+ supabase
134
+ .channel('main:room', { config })
135
+ .on('broadcast', { event: 'my_event' }, (payload) => {
136
+ if (payload?.meta?.replayed) {
137
+ console.log('This message was sent earlier:', payload)
138
+ } else {
139
+ console.log('This is a new message', payload)
140
+ }
141
+ // ...
142
+ })
143
+ .subscribe()
144
+ ```
145
+
146
+ ## Presence
147
+
148
+ Your client can track and sync state that's stored in the channel.
149
+
150
+ ```js
151
+ // Setup...
152
+
153
+ const channel = client.channel('presence-test', {
154
+ config: {
155
+ presence: {
156
+ key: '',
157
+ },
158
+ },
159
+ })
160
+
161
+ channel.on('presence', { event: 'sync' }, () => {
162
+ console.log('Online users: ', channel.presenceState())
163
+ })
164
+
165
+ channel.on('presence', { event: 'join' }, ({ newPresences }) => {
166
+ console.log('New users have joined: ', newPresences)
167
+ })
168
+
169
+ channel.on('presence', { event: 'leave' }, ({ leftPresences }) => {
170
+ console.log('Users have left: ', leftPresences)
171
+ })
172
+
173
+ channel.subscribe(async (status) => {
174
+ if (status === 'SUBSCRIBED') {
175
+ const status = await channel.track({ user_id: 1 })
176
+ console.log(status)
177
+ }
178
+ })
179
+ ```
180
+
181
+ > `config.presence.enabled` (set automatically if you add an `.on('presence', ...)` listener)
182
+ > controls whether _this_ client receives presence state and updates from other clients —
183
+ > without it, `presenceState()` stays empty for you. It does not affect whether other clients
184
+ > see you: calling `track()` always makes you visible to subscribers that do have presence
185
+ > enabled. On RLS-protected channels, receiving presence updates additionally requires the
186
+ > `presence.read` policy to authorize this client.
187
+
188
+ ## Postgres CDC
189
+
190
+ Receive database changes on the client.
191
+
192
+ ```js
193
+ // Setup...
194
+
195
+ const channel = client.channel('db-changes')
196
+
197
+ channel.on('postgres_changes', { event: '*', schema: 'public' }, (payload) => {
198
+ console.log('All changes in public schema: ', payload)
199
+ })
200
+
201
+ channel.on(
202
+ 'postgres_changes',
203
+ { event: 'INSERT', schema: 'public', table: 'messages' },
204
+ (payload) => {
205
+ console.log('All inserts in messages table: ', payload)
206
+ }
207
+ )
208
+
209
+ channel.on(
210
+ 'postgres_changes',
211
+ { event: 'UPDATE', schema: 'public', table: 'users', filter: 'username=eq.Realtime' },
212
+ (payload) => {
213
+ console.log('All updates on users table when username is Realtime: ', payload)
214
+ }
215
+ )
216
+
217
+ channel.subscribe(async (status) => {
218
+ if (status === 'SUBSCRIBED') {
219
+ console.log('Ready to receive database changes!')
220
+ }
221
+ })
222
+ ```
223
+
224
+ ### Filters
225
+
226
+ The `filter` option accepts **either** a raw string **or** a
227
+ `postgresChangesFilter()` builder — both produce the exact same wire format, so
228
+ you can mix and match and existing string filters keep working unchanged:
229
+
230
+ ```js
231
+ // Raw string — always supported, fully backward compatible
232
+ { event: 'UPDATE', schema: 'public', table: 'users', filter: 'id=eq.1' }
233
+
234
+ // Builder — type-checked, ergonomic; the SDK serializes it for you
235
+ { event: 'UPDATE', schema: 'public', table: 'users', filter: postgresChangesFilter().eq('id', 1) }
236
+ ```
237
+
238
+ A filter is a `column=operator.value` expression evaluated server-side. The
239
+ following operators are supported:
240
+
241
+ | Operator | String form | Builder | Meaning |
242
+ | --------------------- | ---------------------------- | -------------------------------------- | --------------------------------- |
243
+ | `eq` | `id=eq.1` | `.eq('id', 1)` | equal |
244
+ | `neq` | `id=neq.1` | `.neq('id', 1)` | not equal |
245
+ | `lt` `lte` `gt` `gte` | `age=gte.18` | `.gte('age', 18)` | comparison |
246
+ | `in` | `status=in.(active,pending)` | `.in('status', ['active', 'pending'])` | in list |
247
+ | `like` `ilike` | `title=like.%foo%` | `.like('title', '%foo%')` | pattern match (case in/sensitive) |
248
+ | `is` | `deleted_at=is.null` | `.is('deleted_at', null)` | `IS null/true/false/unknown` |
249
+ | `match` `imatch` | `title=match.^foo` | `.match('title', '^foo')` | POSIX regex match (`~` / `~*`) |
250
+ | `isdistinct` | `value=isdistinct.1` | `.isDistinct('value', 1)` | NULL-safe inequality |
251
+
252
+ **Negation** — prefix any operator with `not.` (string) or use
253
+ `.not(column, operator, value)` (builder):
254
+
255
+ ```js
256
+ // String
257
+ { event: '*', schema: 'public', table: 'posts', filter: 'status=not.in.(draft,archived)' }
258
+
259
+ // Builder
260
+ {
261
+ event: '*',
262
+ schema: 'public',
263
+ table: 'posts',
264
+ filter: postgresChangesFilter().not('status', 'in', ['draft', 'archived']),
265
+ }
266
+ ```
267
+
268
+ **AND composition** — multiple conditions are combined with commas and applied
269
+ as an `AND`. With the builder you just chain calls:
270
+
271
+ ```js
272
+ // String
273
+ { event: 'UPDATE', schema: 'public', table: 'orders', filter: 'amount=gt.100,status=in.(open,pending)' }
274
+
275
+ // Builder — equivalent, chained
276
+ {
277
+ event: 'UPDATE',
278
+ schema: 'public',
279
+ table: 'orders',
280
+ filter: postgresChangesFilter().gt('amount', 100).in('status', ['open', 'pending']),
281
+ }
282
+ ```
283
+
284
+ #### Building filters with `postgresChangesFilter()`
285
+
286
+ The builder (modeled on the `postgrest-js` filter methods) is the recommended,
287
+ type-checked way to compose filters — but it is entirely optional; raw strings
288
+ remain fully supported.
289
+
290
+ ```js
291
+ import { postgresChangesFilter } from '@supabase/realtime-js'
292
+
293
+ channel.on(
294
+ 'postgres_changes',
295
+ {
296
+ event: 'UPDATE',
297
+ schema: 'public',
298
+ table: 'orders',
299
+ // → 'amount=gt.100,status=not.in.(draft,archived)'
300
+ filter: postgresChangesFilter().gt('amount', 100).not('status', 'in', ['draft', 'archived']),
301
+ },
302
+ (payload) => console.log(payload)
303
+ )
304
+ ```
305
+
306
+ The builder exposes `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `in`, `like`,
307
+ `ilike`, `match`, `imatch`, `is`, `isDistinct` and `not`. Call `.build()` if you
308
+ need the raw string yourself (e.g. to log it or store it).
309
+
310
+ **Values are sent verbatim** — the server has no quoting/escaping, so spaces and
311
+ quotes are preserved as-is. The server separates conditions by commas outside
312
+ parentheses, so a literal comma in a scalar value can't be expressed (commas
313
+ inside `in.(…)` are fine); the builder throws on such values rather than
314
+ silently producing a broken filter.
315
+
316
+ > **Note for PostgREST users:** Realtime evaluates filters server-side over a
317
+ > single table's WAL — there is no resource embedding (`!inner`, embedded
318
+ > filters) and no `or()` grouping. Use `%` (not `*`) for `like`/`ilike`
319
+ > wildcards, since filters travel in the WebSocket payload rather than a URL.
320
+
321
+ ### Selecting columns
322
+
323
+ Use `select` to receive only a subset of columns instead of the full row. This
324
+ reduces payload size (helpful for large `bytea`/`jsonb` columns). The selected
325
+ columns must be selectable by the subscribing role:
326
+
327
+ ```js
328
+ channel.on(
329
+ 'postgres_changes',
330
+ { event: '*', schema: 'public', table: 'users', select: ['id', 'first_name'] },
331
+ (payload) => {
332
+ // payload.new only contains { id, first_name }
333
+ console.log(payload)
334
+ }
335
+ )
336
+ ```
337
+
338
+ ## Get All Channels
339
+
340
+ You can see all the channels that your client has instantiatied.
341
+
342
+ ```js
343
+ // Setup...
344
+
345
+ client.getChannels()
346
+ ```
347
+
348
+ ## Cleanup
349
+
350
+ It is highly recommended that you clean up your channels after you're done with them.
351
+
352
+ - Remove a single channel
353
+
354
+ ```js
355
+ // Setup...
356
+
357
+ const channel = client.channel('some-channel-to-remove')
358
+
359
+ channel.unsubscribe()
360
+ client.removeChannel(channel)
361
+ ```
362
+
363
+ - Remove all channels and close the connection
364
+
365
+ ```js
366
+ // Setup...
367
+
368
+ client.removeAllChannels()
369
+ client.disconnect()
370
+ ```
371
+
372
+ ## Development
373
+
374
+ This package is part of the [Supabase JavaScript monorepo](https://github.com/supabase/supabase-js). To work on this package:
375
+
376
+ ### Building
377
+
378
+ ```bash
379
+ # Complete build (from monorepo root)
380
+ pnpm nx build realtime-js
381
+
382
+ # Build with watch mode for development
383
+ pnpm nx build realtime-js --watch
384
+
385
+ # Individual build targets
386
+ pnpm nx build:main realtime-js # CommonJS build (dist/main/)
387
+ pnpm nx build:module realtime-js # ES Modules build (dist/module/)
388
+
389
+ # Other useful commands
390
+ pnpm nx clean realtime-js # Clean build artifacts
391
+ pnpm nx lint realtime-js # Run ESLint
392
+ pnpm nx typecheck realtime-js # TypeScript type checking
393
+ ```
394
+
395
+ #### Build Outputs
396
+
397
+ - **CommonJS (`dist/main/`)** - For Node.js environments
398
+ - **ES Modules (`dist/module/`)** - For modern bundlers (Webpack, Vite, Rollup)
399
+ - **TypeScript definitions (`dist/module/index.d.ts`)** - Type definitions for TypeScript projects
400
+
401
+ Note: Unlike some other packages, realtime-js doesn't include a UMD build since it's primarily used in Node.js or bundled applications.
402
+
403
+ #### Validating Package Exports
404
+
405
+ ```bash
406
+ # Check if package exports are correctly configured
407
+ pnpm nx check-exports realtime-js
408
+ ```
409
+
410
+ This command uses ["Are the types wrong?"](https://github.com/arethetypeswrong/arethetypeswrong.github.io) to verify that the package exports work correctly in different environments. Run this before publishing to ensure your package can be imported correctly by all consumers.
411
+
412
+ ### Testing
413
+
414
+ **No Docker or Supabase instance required!** The realtime-js tests use mocked WebSocket connections, so they're completely self-contained.
415
+
416
+ ```bash
417
+ # Run unit tests (from monorepo root)
418
+ pnpm nx test realtime-js
419
+
420
+ # Run tests with coverage report
421
+ pnpm nx test:coverage realtime-js
422
+
423
+ # Run tests in watch mode during development
424
+ pnpm nx test:watch realtime-js
425
+ ```
426
+
427
+ #### Test Scripts Explained
428
+
429
+ - **test** - Runs all unit tests once using Vitest
430
+ - **test:coverage** - Runs tests and generates coverage report with terminal output
431
+ - **test:watch** - Runs tests in interactive watch mode for development
432
+
433
+ The tests mock WebSocket connections using `mock-socket`, so you can run them anytime without any external dependencies.
434
+
435
+ ### Contributing
436
+
437
+ We welcome contributions! Please see our [Contributing Guide](../../../CONTRIBUTING.md) for details on how to get started.
438
+
439
+ For major changes or if you're unsure about something, please open an issue first to discuss your proposed changes.
440
+
441
+ ## Credits
442
+
443
+ This repo draws heavily from [phoenix-js](https://github.com/phoenixframework/phoenix/tree/master/assets/js/phoenix).
444
+
445
+ ## License
446
+
447
+ MIT.
node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import type RealtimeChannel from './RealtimeChannel';
2
+ export type Presence<T extends {
3
+ [key: string]: any;
4
+ } = {}> = {
5
+ presence_ref: string;
6
+ } & T;
7
+ export type RealtimePresenceState<T extends {
8
+ [key: string]: any;
9
+ } = {}> = {
10
+ [key: string]: Presence<T>[];
11
+ };
12
+ export type RealtimePresenceJoinPayload<T extends {
13
+ [key: string]: any;
14
+ }> = {
15
+ event: `${REALTIME_PRESENCE_LISTEN_EVENTS.JOIN}`;
16
+ key: string;
17
+ currentPresences: Presence<T>[];
18
+ newPresences: Presence<T>[];
19
+ };
20
+ export type RealtimePresenceLeavePayload<T extends {
21
+ [key: string]: any;
22
+ }> = {
23
+ event: `${REALTIME_PRESENCE_LISTEN_EVENTS.LEAVE}`;
24
+ key: string;
25
+ currentPresences: Presence<T>[];
26
+ leftPresences: Presence<T>[];
27
+ };
28
+ export declare enum REALTIME_PRESENCE_LISTEN_EVENTS {
29
+ SYNC = "sync",
30
+ JOIN = "join",
31
+ LEAVE = "leave"
32
+ }
33
+ export type RealtimePresenceOptions = {
34
+ events?: {
35
+ state: string;
36
+ diff: string;
37
+ };
38
+ };
39
+ export default class RealtimePresence {
40
+ channel: RealtimeChannel;
41
+ get state(): RealtimePresenceState;
42
+ private presenceAdapter;
43
+ /**
44
+ * Creates a Presence helper that keeps the local presence state in sync with the server.
45
+ *
46
+ * @param channel - The realtime channel to bind to.
47
+ * @param opts - Optional custom event names, e.g. `{ events: { state: 'state', diff: 'diff' } }`.
48
+ *
49
+ * @category Realtime
50
+ *
51
+ * @example Example for a presence channel
52
+ * ```ts
53
+ * const presence = new RealtimePresence(channel)
54
+ *
55
+ * channel.on('presence', ({ event, key }) => {
56
+ * console.log(`Presence ${event} on ${key}`)
57
+ * })
58
+ * ```
59
+ */
60
+ constructor(channel: RealtimeChannel, opts?: RealtimePresenceOptions);
61
+ }
62
+ //# sourceMappingURL=RealtimePresence.d.ts.map
node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"RealtimePresence.d.ts","sourceRoot":"","sources":["../../src/RealtimePresence.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAA;AAGpD,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,EAAE,IAAI;IAC5D,YAAY,EAAE,MAAM,CAAA;CACrB,GAAG,CAAC,CAAA;AAEL,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,EAAE,IAAI;IACzE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAAI;IAC1E,KAAK,EAAE,GAAG,+BAA+B,CAAC,IAAI,EAAE,CAAA;IAChD,GAAG,EAAE,MAAM,CAAA;IACX,gBAAgB,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/B,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,4BAA4B,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAAI;IAC3E,KAAK,EAAE,GAAG,+BAA+B,CAAC,KAAK,EAAE,CAAA;IACjD,GAAG,EAAE,MAAM,CAAA;IACX,gBAAgB,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/B,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;CAC7B,CAAA;AAED,oBAAY,+BAA+B;IACzC,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CACzC,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAyB1B,OAAO,EAAE,eAAe;IAxBjC,IAAI,KAAK,0BAER;IAED,OAAO,CAAC,eAAe,CAAiB;IAExC;;;;;;;;;;;;;;;;OAgBG;gBAEM,OAAO,EAAE,eAAe,EAC/B,IAAI,CAAC,EAAE,uBAAuB;CAIjC"}
node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ This file draws heavily from https://github.com/phoenixframework/phoenix/blob/d344ec0a732ab4ee204215b31de69cf4be72e3bf/assets/js/phoenix/presence.js
3
+ License: https://github.com/phoenixframework/phoenix/blob/d344ec0a732ab4ee204215b31de69cf4be72e3bf/LICENSE.md
4
+ */
5
+ import PresenceAdapter from './phoenix/presenceAdapter';
6
+ export var REALTIME_PRESENCE_LISTEN_EVENTS;
7
+ (function (REALTIME_PRESENCE_LISTEN_EVENTS) {
8
+ REALTIME_PRESENCE_LISTEN_EVENTS["SYNC"] = "sync";
9
+ REALTIME_PRESENCE_LISTEN_EVENTS["JOIN"] = "join";
10
+ REALTIME_PRESENCE_LISTEN_EVENTS["LEAVE"] = "leave";
11
+ })(REALTIME_PRESENCE_LISTEN_EVENTS || (REALTIME_PRESENCE_LISTEN_EVENTS = {}));
12
+ export default class RealtimePresence {
13
+ get state() {
14
+ return this.presenceAdapter.state;
15
+ }
16
+ /**
17
+ * Creates a Presence helper that keeps the local presence state in sync with the server.
18
+ *
19
+ * @param channel - The realtime channel to bind to.
20
+ * @param opts - Optional custom event names, e.g. `{ events: { state: 'state', diff: 'diff' } }`.
21
+ *
22
+ * @category Realtime
23
+ *
24
+ * @example Example for a presence channel
25
+ * ```ts
26
+ * const presence = new RealtimePresence(channel)
27
+ *
28
+ * channel.on('presence', ({ event, key }) => {
29
+ * console.log(`Presence ${event} on ${key}`)
30
+ * })
31
+ * ```
32
+ */
33
+ constructor(channel, opts) {
34
+ this.channel = channel;
35
+ this.presenceAdapter = new PresenceAdapter(this.channel.channelAdapter, opts);
36
+ }
37
+ }
38
+ //# sourceMappingURL=RealtimePresence.js.map
node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"RealtimePresence.js","sourceRoot":"","sources":["../../src/RealtimePresence.ts"],"names":[],"mappings":"AAAA;;;EAGE;AAGF,OAAO,eAAe,MAAM,2BAA2B,CAAA;AAwBvD,MAAM,CAAN,IAAY,+BAIX;AAJD,WAAY,+BAA+B;IACzC,gDAAa,CAAA;IACb,gDAAa,CAAA;IACb,kDAAe,CAAA;AACjB,CAAC,EAJW,+BAA+B,KAA/B,+BAA+B,QAI1C;AAMD,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAA;IACnC,CAAC;IAID;;;;;;;;;;;;;;;;OAgBG;IACH,YACS,OAAwB,EAC/B,IAA8B;QADvB,YAAO,GAAP,OAAO,CAAiB;QAG/B,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;IAC/E,CAAC;CACF"}
node_modules/@supabase/realtime-js/dist/tsconfig.module.tsbuildinfo ADDED
@@ -0,0 +1 @@
 
 
1
+ {"fileNames":["../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts","../src/lib/version.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/types.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/push.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/index.d.ts","../src/phoenix/types.ts","../src/lib/constants.ts","../src/lib/websocket-factory.ts","../src/lib/serializer.ts","../src/lib/transformers.ts","../src/phoenix/socketAdapter.ts","../src/RealtimeClient.ts","../src/phoenix/channelAdapter.ts","../src/phoenix/presenceAdapter.ts","../src/RealtimePresence.ts","../src/lib/normalizeChannelError.ts","../src/RealtimePostgresFilterBuilder.ts","../src/RealtimeChannel.ts","../src/index.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/compatibility/disposable.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/compatibility/indexable.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/compatibility/iterators.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/compatibility/index.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/globals.typedarray.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/buffer.buffer.d.ts","../../../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/header.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/readable.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/file.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/fetch.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/formdata.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/connector.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/client.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/errors.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/dispatcher.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-dispatcher.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-origin.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool-stats.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/handlers.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/balanced-pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-interceptor.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-client.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-errors.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/proxy-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-handler.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/api.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/interceptors.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/util.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cookies.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/patch.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/websocket.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/eventsource.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/filereader.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/content-type.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cache.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/index.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/globals.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/assert.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/buffer.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/child_process.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/cluster.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/console.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/constants.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/crypto.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/dgram.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/dns.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/domain.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/dom-events.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/events.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/fs.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/http.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/http2.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/https.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/inspector.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/module.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/net.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/os.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/path.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/process.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/punycode.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/querystring.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/readline.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/readline/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/repl.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/sea.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/stream.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/stream/web.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/test.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/timers.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/tls.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/trace_events.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/tty.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/url.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/util.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/v8.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/vm.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/wasi.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/zlib.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/index.d.ts","../../../../node_modules/.pnpm/@types+jsonwebtoken@8.5.9/node_modules/@types/jsonwebtoken/index.d.ts"],"fileIdsList":[[63,64,65,66,90,133],[90,133],[62,63,64,65,66,67,68,69,90,133],[63,67,90,133],[63,90,133],[62,63,64,67,90,133],[61,62,90,133],[90,133,182],[90,130,133],[90,132,133],[133],[90,133,138,167],[90,133,134,139,145,146,153,164,175],[90,133,134,135,145,153],[85,86,87,90,133],[90,133,136,176],[90,133,137,138,146,154],[90,133,138,164,172],[90,133,139,141,145,153],[90,132,133,140],[90,133,141,142],[90,133,143,145],[90,132,133,145],[90,133,145,146,147,164,175],[90,133,145,146,147,160,164,167],[90,128,133],[90,133,141,145,148,153,164,175],[90,133,145,146,148,149,153,164,172,175],[90,133,148,150,164,172,175],[88,89,90,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[90,133,145,151],[90,133,152,175,180],[90,133,141,145,153,164],[90,133,154],[90,133,155],[90,132,133,156],[90,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[90,133,158],[90,133,159],[90,133,145,160,161],[90,133,160,162,176,178],[90,133,145,164,165,167],[90,133,166,167],[90,133,164,165],[90,133,167],[90,133,168],[90,130,133,164,169],[90,133,145,170,171],[90,133,170,171],[90,133,138,153,164,172],[90,133,173],[90,133,153,174],[90,133,148,159,175],[90,133,138,176],[90,133,164,177],[90,133,152,178],[90,133,179],[90,133,145,147,156,164,167,175,178,180],[90,133,164,181],[90,100,104,133,175],[90,100,133,164,175],[90,95,133],[90,97,100,133,172,175],[90,133,153,172],[90,95,133,182],[90,97,100,133,153,175],[90,92,93,96,99,133,145,164,175],[90,100,107,133],[90,92,98,133],[90,100,121,122,133],[90,96,100,133,167,175,182],[90,121,133,182],[90,94,95,133,182],[90,100,133],[90,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,122,123,124,125,126,127,133],[90,100,115,133],[90,100,107,108,133],[90,98,100,108,109,133],[90,99,133],[90,92,95,100,133],[90,100,104,108,109,133],[90,104,133],[90,98,100,103,133,175],[90,92,97,100,107,133],[90,133,164],[90,95,100,121,133,180,182],[59,71,72,75,77,78,80,81,82,90,133],[59,71,72,73,74,75,76,83,90,133],[59,90,133],[59,79,83,90,133],[59,73,77,80,83,90,133],[59,60,71,90,133],[59,70,71,72,76,83,90,133],[59,70,71,78,80,90,133],[59,70,71,72,77,90,133],[59,70,90,133]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec","impliedFormat":1},{"version":"440cb49331c56cd592851f31d646721775359ba1eec5451c1a2b011840e14740","signature":"be0899822ae6a4989051302579dfb478226abcbb204ae2fff49ff68bb35ad362"},{"version":"1621da3c4da45c37b79d6d361f7de9f0ea40b171dd11ef1ef1bb026665965fc9","impliedFormat":1},{"version":"3878700a966f0201a3e2b9aea8b75cc65008741c359889314e7b0c56c0c07b56","impliedFormat":1},{"version":"f040575209f695a7616fba0045e6a0c88d19d77b246a0098caeb4c9384447d15","impliedFormat":1},{"version":"1fcc4bb6d083b31e1587711ab5a8b0467b52a125f9735467774285bc8cc127e6","impliedFormat":1},{"version":"2193f35e13aee12b162670006604b914edb47fa0e391f39a8fe94a5402b60139","impliedFormat":1},{"version":"0e085cc503ad1332728d56244e9f7a603404beca17c0c5b2d815ed29e0727d4b","impliedFormat":1},{"version":"deda38d3245acb0404dd845dae172547c895c99c442082f176071cbb40d092f3","impliedFormat":1},{"version":"89659dc89f3a21d2a29c898297c96d56ef49f25eee0ee54aace7bd00758b6334","impliedFormat":1},{"version":"df4e0cf0d4a4ea996065de24fb0f621f96321f048869fbf4ef58a55593084d16","impliedFormat":1},{"version":"e6f3d02d69394dae0771c088b3c0b982cf15b6a91678c59f1d5fbd7c5e6ad8f8","impliedFormat":1},{"version":"b8a1713ca8c673a77f367cb999fb99e38857a3a63773563f957ba7aa35773c64","signature":"ef182902b33ac9b9ad90c163b313722d2bc9d8c2cfefeb418b3205d70504a486"},{"version":"999422164f1c0a7e6752769e1895f37ddcc30ef38bb747a2f95c859dd14c99d7","signature":"24911a68c2bf41d4c1ef50f348c4a8ff5dce2c24fdbad4b3dfa6b13416586347"},{"version":"2ff46c35f9aa3a1b53d02da9fdb7dcacf993dc5d7b2b47e9d504b3aa0d78de0b","signature":"5a800cb44fd70e436adf02e020dea317b0026786910e4bbc7ca014208c894ffd"},{"version":"1f4bc648881142502012c47a20f58810bd05fbb77ce1bbc8ec375cdb3c48128e","signature":"2b6c6039f4d2f656904d66f82231488f4852f861d27147884895097f74e3e812"},{"version":"a7f36938ca5806a4dcf38b49552c99361173d8e71a50fe87576b3820163a26b8","signature":"963de0b3445cc4323b606aeb7f9ce711425700088c766aac88fbd5fffd4b5c5f"},{"version":"6533d0e6ba8c44aa52b5149c6e1c3ab4a2e30a9d335ace2bbd86f98efe8d0b15","signature":"f433c0d7201ac0aa6904dbd08e9ab5fa3edf986ffa839ba90153201775d30a46"},{"version":"45b389dd47cf9fad7d097bbbf6bdba054d324f160ac768046a75695213b23b2f","signature":"cc06f33fc3cf6fe668cb89ea339a94b9d4a34ac1a97f72b9c7cf8d461eaf3416"},{"version":"8d68260e686f4c39abfd4534611598dbf46e78effb8d3fb53f8aedf45c1f0195","signature":"648f8efc20f2b0f36b1e90235aae754e3570fc78aeac5fd870ea447f0664a3d7"},{"version":"ff8007a9dd6ce59acb658e3002a53bfb71adc96ad0f312df17cc92023b56f9fb","signature":"26e665c1d4e03ceb2ea99fad6492cf213acc650bf41939cd8388ba3b60900427"},{"version":"8f46c9fad693160b323821763473ad0694db52eb158276ea14bc0fcd6b709e67","signature":"95bdd836ed77c23e530fcd3a0823df8fd611035590dfd8d38ee164c56f2bd2c4"},{"version":"9d2514a52535fcc0b50cadddeaca991246cff67acd4f046dd2a9ced348333708","signature":"db8fefaee4e14c6b8dd507c69ceebee78422cb938374d30dfd1f21e84d6a75f1"},{"version":"b034df3bfd937ddf8b2cb2431c0444360682bbca7e46665cb1fb132289395816","signature":"f96537f0fcfd0379e3254479573ffebc8a67c13a2cd3144c744b032af33800b9"},{"version":"69c17ac55199aa7405f50dc5ade2e339f7dcc47af334f88a38f756b9d8de6779","signature":"c2d50e73c775fee10c2361880cd227f3497a67677536208cd0e8a5d5ab562a0d"},{"version":"261881658863312a66b3912ec63de3d2a8cfda57cc3f244d2ad7248b255a6bb4","signature":"435279e408da8dba444c8ba93bbefddcae9e99b33acfc9a7c3318583e8f4a745"},{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"49a5a44f2e68241a1d2bd9ec894535797998841c09729e506a7cbfcaa40f2180","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"1ca84b44ad1d8e4576f24904d8b95dd23b94ea67e1575f89614ac90062fc67f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d586db0a09a9495ebb5dece28f54df9684bfbd6e1f568426ca153126dac4a40","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"8c0bcd6c6b67b4b503c11e91a1fb91522ed585900eab2ab1f61bba7d7caa9d6f","impliedFormat":1},{"version":"567b7f607f400873151d7bc63a049514b53c3c00f5f56e9e95695d93b66a138e","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","impliedFormat":1},{"version":"84c1930e33d1bb12ad01bcbe11d656f9646bd21b2fb2afd96e8e10615a021aef","impliedFormat":1},{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","impliedFormat":1},{"version":"9d19808c8c291a9010a6c788e8532a2da70f811adb431c97520803e0ec649991","impliedFormat":1},{"version":"2bf469abae4cc9c0f340d4e05d9d26e37f936f9c8ca8f007a6534f109dcc77e4","impliedFormat":1},{"version":"4aacb0dd020eeaef65426153686cc639a78ec2885dc72ad220be1d25f1a439df","impliedFormat":1},{"version":"f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45","impliedFormat":1},{"version":"71450bbc2d82821d24ca05699a533e72758964e9852062c53b30f31c36978ab8","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c21aaa8257d7950a5b75a251d9075b6a371208fc948c9c8402f6690ef3b5b55","impliedFormat":1},{"version":"b5895e6353a5d708f55d8685c38a235c3a6d8138e374dee8ceb8ffde5aa8002a","impliedFormat":1},{"version":"54c4f21f578864961efc94e8f42bc893a53509e886370ec7dd602e0151b9266c","impliedFormat":1},{"version":"de735eca2c51dd8b860254e9fdb6d9ec19fe402dfe597c23090841ce3937cfc5","impliedFormat":1},{"version":"4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","impliedFormat":1},{"version":"5650cf3dace09e7c25d384e3e6b818b938f68f4e8de96f52d9c5a1b3db068e86","impliedFormat":1},{"version":"1354ca5c38bd3fd3836a68e0f7c9f91f172582ba30ab15bb8c075891b91502b7","affectsGlobalScope":true,"impliedFormat":1},{"version":"5155da3047ef977944d791a2188ff6e6c225f6975cc1910ab7bb6838ab84cede","impliedFormat":1},{"version":"93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","impliedFormat":1},{"version":"afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5","impliedFormat":1},{"version":"e16d218a30f6a6810b57f7e968124eaa08c7bb366133ea34bbf01e7cd6b8c0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb8692dea24c27821f77e397272d9ed2eda0b95e4a75beb0fdda31081d15a8ae","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","impliedFormat":1},{"version":"b4f70ec656a11d570e1a9edce07d118cd58d9760239e2ece99306ee9dfe61d02","impliedFormat":1},{"version":"3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","impliedFormat":1},{"version":"9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","impliedFormat":1},{"version":"5b6844ad931dcc1d3aca53268f4bd671428421464b1286746027aede398094f2","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093","impliedFormat":1},{"version":"0dbcebe2126d03936c70545e96a6e41007cf065be38a1ce4d32a39fcedefead4","affectsGlobalScope":true,"impliedFormat":1},{"version":"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb","impliedFormat":1},{"version":"461e54289e6287e8494a0178ba18182acce51a02bca8dea219149bf2cf96f105","impliedFormat":1},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","impliedFormat":1},{"version":"e31e51c55800014d926e3f74208af49cb7352803619855c89296074d1ecbb524","impliedFormat":1},{"version":"ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","impliedFormat":1},{"version":"a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9","impliedFormat":1},{"version":"dfb96ba5177b68003deec9e773c47257da5c4c8a74053d8956389d832df72002","affectsGlobalScope":true,"impliedFormat":1},{"version":"92d3070580cf72b4bb80959b7f16ede9a3f39e6f4ef2ac87cfa4561844fdc69f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","impliedFormat":1},{"version":"613deebaec53731ff6b74fe1a89f094b708033db6396b601df3e6d5ab0ec0a47","impliedFormat":1},{"version":"d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c","impliedFormat":1},{"version":"e56eb632f0281c9f8210eb8c86cc4839a427a4ffffcfd2a5e40b956050b3e042","affectsGlobalScope":true,"impliedFormat":1},{"version":"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","impliedFormat":1},{"version":"cac793cc47c29e26e4ac3601dcb00b4435ebed26203485790e44f2ad8b6ad847","impliedFormat":1},{"version":"bb4ed283cfb3db7ec1d4bb79c37f5e96d39b340f1f4de995c4b0b836c8d5fa05","impliedFormat":1}],"root":[60,[71,84]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"importHelpers":true,"module":6,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"outDir":"./module","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":4},"referencedMap":[[67,1],[61,2],[70,3],[62,2],[68,4],[66,4],[69,5],[65,6],[64,2],[63,7],[183,8],[130,9],[131,9],[132,10],[90,11],[133,12],[134,13],[135,14],[85,2],[88,15],[86,2],[87,2],[136,16],[137,17],[138,18],[139,19],[140,20],[141,21],[142,21],[144,2],[143,22],[145,23],[146,24],[147,25],[129,26],[89,2],[148,27],[149,28],[150,29],[182,30],[151,31],[152,32],[153,33],[154,34],[155,35],[156,36],[157,37],[158,38],[159,39],[160,40],[161,40],[162,41],[163,2],[164,42],[166,43],[165,44],[167,45],[168,46],[169,47],[170,48],[171,49],[172,50],[173,51],[174,52],[175,53],[176,54],[177,55],[178,56],[179,57],[180,58],[181,59],[91,2],[59,2],[57,2],[58,2],[10,2],[12,2],[11,2],[2,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[3,2],[21,2],[22,2],[4,2],[23,2],[27,2],[24,2],[25,2],[26,2],[28,2],[29,2],[30,2],[5,2],[31,2],[32,2],[33,2],[34,2],[6,2],[38,2],[35,2],[36,2],[37,2],[39,2],[7,2],[40,2],[45,2],[46,2],[41,2],[42,2],[43,2],[44,2],[8,2],[50,2],[47,2],[48,2],[49,2],[51,2],[9,2],[52,2],[53,2],[54,2],[56,2],[55,2],[1,2],[107,60],[117,61],[106,60],[127,62],[98,63],[97,64],[126,8],[120,65],[125,66],[100,67],[114,68],[99,69],[123,70],[95,71],[94,8],[124,72],[96,73],[101,74],[102,2],[105,74],[92,2],[128,75],[118,76],[109,77],[110,78],[112,79],[108,80],[111,81],[121,8],[103,82],[104,83],[113,84],[93,85],[116,76],[115,74],[119,2],[122,86],[83,87],[77,88],[82,89],[80,90],[84,91],[72,92],[81,89],[74,89],[75,89],[60,89],[73,89],[78,93],[79,94],[76,95],[71,96]],"latestChangedDtsFile":"./module/index.d.ts","version":"5.8.3"}
node_modules/@supabase/realtime-js/dist/tsconfig.tsbuildinfo ADDED
@@ -0,0 +1 @@
 
 
1
+ {"fileNames":["../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.d.ts","../src/lib/version.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/types.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/push.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts","../../../../node_modules/.pnpm/@supabase+phoenix@0.4.5/node_modules/@supabase/phoenix/priv/static/types/index.d.ts","../src/phoenix/types.ts","../src/lib/constants.ts","../src/lib/websocket-factory.ts","../src/lib/serializer.ts","../src/lib/transformers.ts","../src/phoenix/socketAdapter.ts","../src/RealtimeClient.ts","../src/phoenix/channelAdapter.ts","../src/phoenix/presenceAdapter.ts","../src/RealtimePresence.ts","../src/lib/normalizeChannelError.ts","../src/RealtimePostgresFilterBuilder.ts","../src/RealtimeChannel.ts","../src/index.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/compatibility/disposable.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/compatibility/indexable.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/compatibility/iterators.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/compatibility/index.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/globals.typedarray.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/buffer.buffer.d.ts","../../../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/header.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/readable.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/file.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/fetch.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/formdata.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/connector.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/client.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/errors.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/dispatcher.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-dispatcher.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-origin.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool-stats.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/handlers.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/balanced-pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-interceptor.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-client.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-errors.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/proxy-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-handler.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/api.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/interceptors.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/util.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cookies.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/patch.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/websocket.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/eventsource.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/filereader.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/content-type.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cache.d.ts","../../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/index.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/globals.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/assert.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/buffer.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/child_process.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/cluster.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/console.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/constants.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/crypto.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/dgram.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/dns.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/domain.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/dom-events.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/events.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/fs.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/http.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/http2.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/https.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/inspector.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/module.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/net.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/os.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/path.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/process.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/punycode.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/querystring.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/readline.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/readline/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/repl.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/sea.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/stream.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/stream/web.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/test.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/timers.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/tls.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/trace_events.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/tty.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/url.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/util.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/v8.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/vm.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/wasi.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/zlib.d.ts","../../../../node_modules/.pnpm/@types+node@20.19.9/node_modules/@types/node/index.d.ts","../../../../node_modules/.pnpm/@types+jsonwebtoken@8.5.9/node_modules/@types/jsonwebtoken/index.d.ts"],"fileIdsList":[[63,64,65,66,90,133],[90,133],[62,63,64,65,66,67,68,69,90,133],[63,67,90,133],[63,90,133],[62,63,64,67,90,133],[61,62,90,133],[90,133,182],[90,130,133],[90,132,133],[133],[90,133,138,167],[90,133,134,139,145,146,153,164,175],[90,133,134,135,145,153],[85,86,87,90,133],[90,133,136,176],[90,133,137,138,146,154],[90,133,138,164,172],[90,133,139,141,145,153],[90,132,133,140],[90,133,141,142],[90,133,143,145],[90,132,133,145],[90,133,145,146,147,164,175],[90,133,145,146,147,160,164,167],[90,128,133],[90,133,141,145,148,153,164,175],[90,133,145,146,148,149,153,164,172,175],[90,133,148,150,164,172,175],[88,89,90,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[90,133,145,151],[90,133,152,175,180],[90,133,141,145,153,164],[90,133,154],[90,133,155],[90,132,133,156],[90,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181],[90,133,158],[90,133,159],[90,133,145,160,161],[90,133,160,162,176,178],[90,133,145,164,165,167],[90,133,166,167],[90,133,164,165],[90,133,167],[90,133,168],[90,130,133,164,169],[90,133,145,170,171],[90,133,170,171],[90,133,138,153,164,172],[90,133,173],[90,133,153,174],[90,133,148,159,175],[90,133,138,176],[90,133,164,177],[90,133,152,178],[90,133,179],[90,133,145,147,156,164,167,175,178,180],[90,133,164,181],[90,100,104,133,175],[90,100,133,164,175],[90,95,133],[90,97,100,133,172,175],[90,133,153,172],[90,95,133,182],[90,97,100,133,153,175],[90,92,93,96,99,133,145,164,175],[90,100,107,133],[90,92,98,133],[90,100,121,122,133],[90,96,100,133,167,175,182],[90,121,133,182],[90,94,95,133,182],[90,100,133],[90,94,95,96,97,98,99,100,101,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,122,123,124,125,126,127,133],[90,100,115,133],[90,100,107,108,133],[90,98,100,108,109,133],[90,99,133],[90,92,95,100,133],[90,100,104,108,109,133],[90,104,133],[90,98,100,103,133,175],[90,92,97,100,107,133],[90,133,164],[90,95,100,121,133,180,182],[59,71,72,75,77,78,80,81,82,90,133],[59,71,72,73,74,75,76,83,90,133],[59,90,133],[59,79,83,90,133],[59,73,77,80,83,90,133],[59,60,71,90,133],[59,70,71,72,76,83,90,133],[59,70,71,78,80,90,133],[59,70,71,72,77,90,133],[59,70,90,133]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec","impliedFormat":1},{"version":"440cb49331c56cd592851f31d646721775359ba1eec5451c1a2b011840e14740","signature":"be0899822ae6a4989051302579dfb478226abcbb204ae2fff49ff68bb35ad362"},{"version":"1621da3c4da45c37b79d6d361f7de9f0ea40b171dd11ef1ef1bb026665965fc9","impliedFormat":1},{"version":"3878700a966f0201a3e2b9aea8b75cc65008741c359889314e7b0c56c0c07b56","impliedFormat":1},{"version":"f040575209f695a7616fba0045e6a0c88d19d77b246a0098caeb4c9384447d15","impliedFormat":1},{"version":"1fcc4bb6d083b31e1587711ab5a8b0467b52a125f9735467774285bc8cc127e6","impliedFormat":1},{"version":"2193f35e13aee12b162670006604b914edb47fa0e391f39a8fe94a5402b60139","impliedFormat":1},{"version":"0e085cc503ad1332728d56244e9f7a603404beca17c0c5b2d815ed29e0727d4b","impliedFormat":1},{"version":"deda38d3245acb0404dd845dae172547c895c99c442082f176071cbb40d092f3","impliedFormat":1},{"version":"89659dc89f3a21d2a29c898297c96d56ef49f25eee0ee54aace7bd00758b6334","impliedFormat":1},{"version":"df4e0cf0d4a4ea996065de24fb0f621f96321f048869fbf4ef58a55593084d16","impliedFormat":1},{"version":"e6f3d02d69394dae0771c088b3c0b982cf15b6a91678c59f1d5fbd7c5e6ad8f8","impliedFormat":1},{"version":"b8a1713ca8c673a77f367cb999fb99e38857a3a63773563f957ba7aa35773c64","signature":"ef182902b33ac9b9ad90c163b313722d2bc9d8c2cfefeb418b3205d70504a486"},{"version":"999422164f1c0a7e6752769e1895f37ddcc30ef38bb747a2f95c859dd14c99d7","signature":"24911a68c2bf41d4c1ef50f348c4a8ff5dce2c24fdbad4b3dfa6b13416586347"},{"version":"2ff46c35f9aa3a1b53d02da9fdb7dcacf993dc5d7b2b47e9d504b3aa0d78de0b","signature":"5a800cb44fd70e436adf02e020dea317b0026786910e4bbc7ca014208c894ffd"},{"version":"1f4bc648881142502012c47a20f58810bd05fbb77ce1bbc8ec375cdb3c48128e","signature":"2b6c6039f4d2f656904d66f82231488f4852f861d27147884895097f74e3e812"},{"version":"a7f36938ca5806a4dcf38b49552c99361173d8e71a50fe87576b3820163a26b8","signature":"963de0b3445cc4323b606aeb7f9ce711425700088c766aac88fbd5fffd4b5c5f"},{"version":"6533d0e6ba8c44aa52b5149c6e1c3ab4a2e30a9d335ace2bbd86f98efe8d0b15","signature":"f433c0d7201ac0aa6904dbd08e9ab5fa3edf986ffa839ba90153201775d30a46"},{"version":"45b389dd47cf9fad7d097bbbf6bdba054d324f160ac768046a75695213b23b2f","signature":"cc06f33fc3cf6fe668cb89ea339a94b9d4a34ac1a97f72b9c7cf8d461eaf3416"},{"version":"8d68260e686f4c39abfd4534611598dbf46e78effb8d3fb53f8aedf45c1f0195","signature":"648f8efc20f2b0f36b1e90235aae754e3570fc78aeac5fd870ea447f0664a3d7"},{"version":"ff8007a9dd6ce59acb658e3002a53bfb71adc96ad0f312df17cc92023b56f9fb","signature":"26e665c1d4e03ceb2ea99fad6492cf213acc650bf41939cd8388ba3b60900427"},{"version":"8f46c9fad693160b323821763473ad0694db52eb158276ea14bc0fcd6b709e67","signature":"95bdd836ed77c23e530fcd3a0823df8fd611035590dfd8d38ee164c56f2bd2c4"},{"version":"9d2514a52535fcc0b50cadddeaca991246cff67acd4f046dd2a9ced348333708","signature":"db8fefaee4e14c6b8dd507c69ceebee78422cb938374d30dfd1f21e84d6a75f1"},{"version":"b034df3bfd937ddf8b2cb2431c0444360682bbca7e46665cb1fb132289395816","signature":"f96537f0fcfd0379e3254479573ffebc8a67c13a2cd3144c744b032af33800b9"},{"version":"69c17ac55199aa7405f50dc5ade2e339f7dcc47af334f88a38f756b9d8de6779","signature":"c2d50e73c775fee10c2361880cd227f3497a67677536208cd0e8a5d5ab562a0d"},{"version":"261881658863312a66b3912ec63de3d2a8cfda57cc3f244d2ad7248b255a6bb4","signature":"435279e408da8dba444c8ba93bbefddcae9e99b33acfc9a7c3318583e8f4a745"},{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"49a5a44f2e68241a1d2bd9ec894535797998841c09729e506a7cbfcaa40f2180","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"1ca84b44ad1d8e4576f24904d8b95dd23b94ea67e1575f89614ac90062fc67f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d586db0a09a9495ebb5dece28f54df9684bfbd6e1f568426ca153126dac4a40","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"8c0bcd6c6b67b4b503c11e91a1fb91522ed585900eab2ab1f61bba7d7caa9d6f","impliedFormat":1},{"version":"567b7f607f400873151d7bc63a049514b53c3c00f5f56e9e95695d93b66a138e","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","impliedFormat":1},{"version":"84c1930e33d1bb12ad01bcbe11d656f9646bd21b2fb2afd96e8e10615a021aef","impliedFormat":1},{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","impliedFormat":1},{"version":"9d19808c8c291a9010a6c788e8532a2da70f811adb431c97520803e0ec649991","impliedFormat":1},{"version":"2bf469abae4cc9c0f340d4e05d9d26e37f936f9c8ca8f007a6534f109dcc77e4","impliedFormat":1},{"version":"4aacb0dd020eeaef65426153686cc639a78ec2885dc72ad220be1d25f1a439df","impliedFormat":1},{"version":"f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45","impliedFormat":1},{"version":"71450bbc2d82821d24ca05699a533e72758964e9852062c53b30f31c36978ab8","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c21aaa8257d7950a5b75a251d9075b6a371208fc948c9c8402f6690ef3b5b55","impliedFormat":1},{"version":"b5895e6353a5d708f55d8685c38a235c3a6d8138e374dee8ceb8ffde5aa8002a","impliedFormat":1},{"version":"54c4f21f578864961efc94e8f42bc893a53509e886370ec7dd602e0151b9266c","impliedFormat":1},{"version":"de735eca2c51dd8b860254e9fdb6d9ec19fe402dfe597c23090841ce3937cfc5","impliedFormat":1},{"version":"4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","impliedFormat":1},{"version":"5650cf3dace09e7c25d384e3e6b818b938f68f4e8de96f52d9c5a1b3db068e86","impliedFormat":1},{"version":"1354ca5c38bd3fd3836a68e0f7c9f91f172582ba30ab15bb8c075891b91502b7","affectsGlobalScope":true,"impliedFormat":1},{"version":"5155da3047ef977944d791a2188ff6e6c225f6975cc1910ab7bb6838ab84cede","impliedFormat":1},{"version":"93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","impliedFormat":1},{"version":"afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5","impliedFormat":1},{"version":"e16d218a30f6a6810b57f7e968124eaa08c7bb366133ea34bbf01e7cd6b8c0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb8692dea24c27821f77e397272d9ed2eda0b95e4a75beb0fdda31081d15a8ae","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","impliedFormat":1},{"version":"b4f70ec656a11d570e1a9edce07d118cd58d9760239e2ece99306ee9dfe61d02","impliedFormat":1},{"version":"3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","impliedFormat":1},{"version":"9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","impliedFormat":1},{"version":"5b6844ad931dcc1d3aca53268f4bd671428421464b1286746027aede398094f2","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093","impliedFormat":1},{"version":"0dbcebe2126d03936c70545e96a6e41007cf065be38a1ce4d32a39fcedefead4","affectsGlobalScope":true,"impliedFormat":1},{"version":"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb","impliedFormat":1},{"version":"461e54289e6287e8494a0178ba18182acce51a02bca8dea219149bf2cf96f105","impliedFormat":1},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","impliedFormat":1},{"version":"e31e51c55800014d926e3f74208af49cb7352803619855c89296074d1ecbb524","impliedFormat":1},{"version":"ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","impliedFormat":1},{"version":"a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9","impliedFormat":1},{"version":"dfb96ba5177b68003deec9e773c47257da5c4c8a74053d8956389d832df72002","affectsGlobalScope":true,"impliedFormat":1},{"version":"92d3070580cf72b4bb80959b7f16ede9a3f39e6f4ef2ac87cfa4561844fdc69f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","impliedFormat":1},{"version":"613deebaec53731ff6b74fe1a89f094b708033db6396b601df3e6d5ab0ec0a47","impliedFormat":1},{"version":"d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c","impliedFormat":1},{"version":"e56eb632f0281c9f8210eb8c86cc4839a427a4ffffcfd2a5e40b956050b3e042","affectsGlobalScope":true,"impliedFormat":1},{"version":"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","impliedFormat":1},{"version":"cac793cc47c29e26e4ac3601dcb00b4435ebed26203485790e44f2ad8b6ad847","impliedFormat":1},{"version":"bb4ed283cfb3db7ec1d4bb79c37f5e96d39b340f1f4de995c4b0b836c8d5fa05","impliedFormat":1}],"root":[60,[71,84]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"importHelpers":true,"module":1,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"outDir":"./main","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":4},"referencedMap":[[67,1],[61,2],[70,3],[62,2],[68,4],[66,4],[69,5],[65,6],[64,2],[63,7],[183,8],[130,9],[131,9],[132,10],[90,11],[133,12],[134,13],[135,14],[85,2],[88,15],[86,2],[87,2],[136,16],[137,17],[138,18],[139,19],[140,20],[141,21],[142,21],[144,2],[143,22],[145,23],[146,24],[147,25],[129,26],[89,2],[148,27],[149,28],[150,29],[182,30],[151,31],[152,32],[153,33],[154,34],[155,35],[156,36],[157,37],[158,38],[159,39],[160,40],[161,40],[162,41],[163,2],[164,42],[166,43],[165,44],[167,45],[168,46],[169,47],[170,48],[171,49],[172,50],[173,51],[174,52],[175,53],[176,54],[177,55],[178,56],[179,57],[180,58],[181,59],[91,2],[59,2],[57,2],[58,2],[10,2],[12,2],[11,2],[2,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[3,2],[21,2],[22,2],[4,2],[23,2],[27,2],[24,2],[25,2],[26,2],[28,2],[29,2],[30,2],[5,2],[31,2],[32,2],[33,2],[34,2],[6,2],[38,2],[35,2],[36,2],[37,2],[39,2],[7,2],[40,2],[45,2],[46,2],[41,2],[42,2],[43,2],[44,2],[8,2],[50,2],[47,2],[48,2],[49,2],[51,2],[9,2],[52,2],[53,2],[54,2],[56,2],[55,2],[1,2],[107,60],[117,61],[106,60],[127,62],[98,63],[97,64],[126,8],[120,65],[125,66],[100,67],[114,68],[99,69],[123,70],[95,71],[94,8],[124,72],[96,73],[101,74],[102,2],[105,74],[92,2],[128,75],[118,76],[109,77],[110,78],[112,79],[108,80],[111,81],[121,8],[103,82],[104,83],[113,84],[93,85],[116,76],[115,74],[119,2],[122,86],[83,87],[77,88],[82,89],[80,90],[84,91],[72,92],[81,89],[74,89],[75,89],[60,89],[73,89],[78,93],[79,94],[76,95],[71,96]],"latestChangedDtsFile":"./main/index.d.ts","version":"5.8.3"}
node_modules/@supabase/realtime-js/migrations/README.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Migration notes for `@supabase/realtime-js`
2
+
3
+ Each file in this directory describes one migration theme — what changed in `@supabase/realtime-js`, who is affected, and what callers need to do.
4
+
5
+ Files are shipped with the npm package, so the migration notes you see here are pinned to the version of `@supabase/realtime-js` you have installed. Upgrading the package brings the relevant migration notes along with it.
6
+
7
+ ## How agents should use this directory
8
+
9
+ When helping a developer upgrade `@supabase/realtime-js`:
10
+
11
+ 1. Read the migration files in `node_modules/@supabase/realtime-js/migrations/` for the version they have installed.
12
+ 2. Cross-reference against the version they are upgrading to.
13
+ 3. Apply the migration steps described in each relevant file.
14
+
15
+ ## How humans should use this directory
16
+
17
+ Browse the files for the migration theme you care about. Each file is self-contained and explains its own scope, audience, and steps.
18
+
19
+ ## File naming
20
+
21
+ One file per migration theme, named by topic rather than version (e.g. `<theme>.md`, kebab-case). A single version can ship multiple theme files; a single theme can span multiple versions. Each file documents its own `Since` / `Will require action by` version range internally.
22
+
23
+ ## Cross-cutting migration notes
24
+
25
+ Migrations that span multiple Supabase packages (e.g. Node.js version drops, monorepo restructures) live in [`docs/MIGRATION.md`](../../../../docs/MIGRATION.md) at the repository root, not here. This directory is scoped to `@supabase/realtime-js` only.
node_modules/@supabase/realtime-js/migrations/httpsend-server-version.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # `httpSend()` server version requirement
2
+
3
+ **Since:** v2.107.0
4
+ **Applies to:** anyone calling `RealtimeChannel.httpSend()` (or `RealtimeChannel.broadcast()` configured to use HTTP)
5
+
6
+ `httpSend()` sends broadcast events through a per-event REST endpoint:
7
+
8
+ ```
9
+ POST /api/broadcast/:topic/events/:event
10
+ ```
11
+
12
+ This endpoint was added in **Realtime server v2.97.0** ([supabase/realtime#1864](https://github.com/supabase/realtime/pull/1864)). It also enables binary broadcast payloads (`application/octet-stream`), which the older batch endpoint does not support.
13
+
14
+ ## What changed
15
+
16
+ - `httpSend()` calls the new per-event endpoint and expects HTTP `202`.
17
+ - On `404`, the client now rejects with a message that names the requirement and the escape hatches (see below) instead of returning the generic `Not Found` text from the server.
18
+ - The original `RealtimeChannel.send()` (and its REST fallback) still target the older `POST /api/broadcast` batch endpoint and are unaffected.
19
+
20
+ ## Who is affected
21
+
22
+ You are affected if **all** of the following are true:
23
+
24
+ 1. You upgraded `@supabase/realtime-js` (or `@supabase/supabase-js`) to **v2.107.0 or later**, **and**
25
+ 2. You call `httpSend()` (or `broadcast()` with `type: 'broadcast'` routed through HTTP), **and**
26
+ 3. Your Realtime server is **older than v2.97.0**.
27
+
28
+ If you only use the WebSocket `send()` API, or your Realtime server is already on v2.97.0+, nothing changes for you.
29
+
30
+ ## How to verify the server version
31
+
32
+ The Realtime server does not currently emit a version header, so the easiest checks are:
33
+
34
+ - **Hosted Supabase:** version is rolled forward continuously and is on v2.97.0+.
35
+ - **Local development with the Supabase CLI:** recent CLI versions bundle Realtime v2.97.0+. Update the CLI to the latest stable.
36
+ - **Self-hosted:** check the `image:` tag of the Realtime container in your `docker-compose.yml`.
37
+
38
+ ## What to do
39
+
40
+ ### If you are on a recent Supabase CLI
41
+
42
+ You should already be on a compatible Realtime version. If you still see the 404 error, update the CLI:
43
+
44
+ ```bash
45
+ # macOS / Homebrew
46
+ brew upgrade supabase/tap/supabase
47
+
48
+ # npm
49
+ npm install -g supabase
50
+
51
+ # scoop / etc — see https://supabase.com/docs/guides/local-development
52
+ ```
53
+
54
+ Then restart the local Supabase stack.
55
+
56
+ ### If you need to pin a specific Realtime version locally
57
+
58
+ The CLI honors a per-project pin file. Create the file with the desired image tag:
59
+
60
+ ```bash
61
+ mkdir -p supabase/.temp
62
+ echo "v2.97.3" > supabase/.temp/realtime-version
63
+ supabase stop && supabase start
64
+ ```
65
+
66
+ (This is the same mechanism the `@supabase/supabase-js` test harness uses internally.)
67
+
68
+ ### If you self-host
69
+
70
+ Bump the Realtime image in your deployment to `v2.97.3` or newer:
71
+
72
+ ```yaml
73
+ services:
74
+ realtime:
75
+ image: supabase/realtime:v2.97.3
76
+ ```
77
+
78
+ ### If you cannot update the server right now
79
+
80
+ Downgrade `@supabase/realtime-js` (and `@supabase/supabase-js`) back to **v2.106.x**, which only uses the older `POST /api/broadcast` batch endpoint:
81
+
82
+ ```bash
83
+ npm install @supabase/supabase-js@2.106.2
84
+ ```
85
+
86
+ ## Why the message is more specific now
87
+
88
+ Prior to this release, a 404 from the new endpoint surfaced as a plain `Not Found` error, which was hard to act on. The client now rejects with a message that points at this migration file and the escape hatches above.
node_modules/@supabase/realtime-js/package.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@supabase/realtime-js",
3
+ "version": "2.112.3",
4
+ "description": "Listen to realtime updates to your PostgreSQL database",
5
+ "keywords": [
6
+ "realtime",
7
+ "phoenix",
8
+ "elixir",
9
+ "javascript",
10
+ "typescript",
11
+ "firebase",
12
+ "supabase"
13
+ ],
14
+ "homepage": "https://github.com/supabase/supabase-js/tree/master/packages/core/realtime-js",
15
+ "bugs": "https://github.com/supabase/supabase-js/issues",
16
+ "files": [
17
+ "dist",
18
+ "src",
19
+ "migrations",
20
+ "AGENTS.md"
21
+ ],
22
+ "main": "dist/main/index.js",
23
+ "module": "dist/module/index.js",
24
+ "types": "dist/module/index.d.ts",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/supabase/supabase-js.git",
28
+ "directory": "packages/core/realtime-js"
29
+ },
30
+ "author": "Supabase",
31
+ "license": "MIT",
32
+ "dependencies": {
33
+ "@supabase/phoenix": "0.4.5",
34
+ "tslib": "2.8.1"
35
+ },
36
+ "devDependencies": {
37
+ "@arethetypeswrong/cli": "^0.18.2",
38
+ "@types/jsonwebtoken": "^8.5.8",
39
+ "@vitest/coverage-v8": "^4.1.5",
40
+ "jsdom": "^26.0.0",
41
+ "jsonwebtoken": "^9.0.0",
42
+ "mock-socket": "^9.3.1",
43
+ "typedoc": "^0.27.9",
44
+ "typescript": "~5.8.3",
45
+ "vitest": "4.1.6",
46
+ "web-worker": "1.2.0"
47
+ },
48
+ "engines": {
49
+ "node": ">=22.0.0"
50
+ },
51
+ "scripts": {
52
+ "build": "npm run build:main && npm run build:module",
53
+ "build:main": "tsc -p tsconfig.json",
54
+ "build:module": "tsc -p tsconfig.module.json",
55
+ "test": "vitest run",
56
+ "test:watch": "vitest",
57
+ "test:coverage": "vitest run --coverage.enabled true --coverage.reporter=text",
58
+ "docs": "typedoc --options ../../../typedoc.base.mjs src/index.ts --out docs/v2",
59
+ "docs:json": "typedoc --options ../../../typedoc.base.mjs --json docs/v2/spec.json --excludeExternals src/index.ts",
60
+ "check-exports": "attw --pack .",
61
+ "test:ci": "vitest run --coverage"
62
+ }
63
+ }
node_modules/@supabase/realtime-js/src/RealtimeChannel.ts ADDED
@@ -0,0 +1,1340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { CHANNEL_EVENTS, CHANNEL_STATES } from './lib/constants'
2
+ import type { ChannelState } from './lib/constants'
3
+ import type RealtimeClient from './RealtimeClient'
4
+ import RealtimePresence, { REALTIME_PRESENCE_LISTEN_EVENTS } from './RealtimePresence'
5
+ import type {
6
+ RealtimePresenceJoinPayload,
7
+ RealtimePresenceLeavePayload,
8
+ RealtimePresenceState,
9
+ } from './RealtimePresence'
10
+ import * as Transformers from './lib/transformers'
11
+ import { httpEndpointURL } from './lib/transformers'
12
+ import { normalizeChannelError } from './lib/normalizeChannelError'
13
+ import ChannelAdapter from './phoenix/channelAdapter'
14
+ import { ChannelBindingCallback, ChannelOnErrorCallback } from './phoenix/types'
15
+ import type { Timer } from './phoenix/types'
16
+ import { RealtimePostgresFilterBuilder } from './RealtimePostgresFilterBuilder'
17
+ import type { RealtimePostgresChangesFilterOperator } from './RealtimePostgresFilterBuilder'
18
+
19
+ export type { RealtimePostgresChangesFilterOperator } from './RealtimePostgresFilterBuilder'
20
+ export {
21
+ RealtimePostgresFilterBuilder,
22
+ postgresChangesFilter,
23
+ } from './RealtimePostgresFilterBuilder'
24
+
25
+ type ReplayOption = {
26
+ since: number
27
+ limit?: number
28
+ }
29
+
30
+ export type RealtimeChannelOptions = {
31
+ config: {
32
+ /**
33
+ * self option enables client to receive message it broadcast
34
+ * ack option instructs server to acknowledge that broadcast message was received
35
+ * replay option instructs server to replay broadcast messages
36
+ * replication_ready option instructs the server to emit a `system` event once the
37
+ * Postgres replication connection backing this channel is established and ready to
38
+ * stream changes. Listen for it with `channel.on('system', {}, (payload) => ...)`;
39
+ * the payload's `status` is `'ok'` (`message: 'Replication connection established'`)
40
+ * on success or `'error'` if the connection is not ready in time.
41
+ */
42
+ broadcast?: {
43
+ self?: boolean
44
+ ack?: boolean
45
+ replay?: ReplayOption
46
+ replication_ready?: boolean
47
+ }
48
+ /**
49
+ * key option is used to track presence payload across clients
50
+ *
51
+ * enabled controls whether this client receives presence state and updates from other
52
+ * clients — set it to true (or add an `.on('presence', ...)` listener, which enables it
53
+ * automatically) if you want to see who else is present. Without it, this client's
54
+ * `presenceState()` stays empty and no `presence` events fire for you, because the
55
+ * underlying presence state machine buffers incoming updates until it has received an
56
+ * initial snapshot, which is only requested when this flag is set.
57
+ *
58
+ * It does not gate the other direction: calling `track()` always makes this client
59
+ * visible to other subscribers that have presence enabled, regardless of this client's
60
+ * own `enabled` setting. On RLS-protected (private) channels, receiving presence updates
61
+ * additionally requires the `presence.read` policy to authorize this client.
62
+ */
63
+ presence?: { key?: string; enabled?: boolean }
64
+ /**
65
+ * defines if the channel is private or not and if RLS policies will be used to check data
66
+ */
67
+ private?: boolean
68
+ }
69
+ }
70
+
71
+ type RealtimeChangesPayloadBase = {
72
+ schema: string
73
+ table: string
74
+ }
75
+
76
+ type RealtimeBroadcastChangesPayloadBase = RealtimeChangesPayloadBase & {
77
+ id: string
78
+ }
79
+
80
+ export type RealtimeBroadcastInsertPayload<T extends { [key: string]: any }> =
81
+ RealtimeBroadcastChangesPayloadBase & {
82
+ operation: `${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.INSERT}`
83
+ record: T
84
+ old_record: null
85
+ }
86
+
87
+ export type RealtimeBroadcastUpdatePayload<T extends { [key: string]: any }> =
88
+ RealtimeBroadcastChangesPayloadBase & {
89
+ operation: `${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.UPDATE}`
90
+ record: T
91
+ old_record: T
92
+ }
93
+
94
+ export type RealtimeBroadcastDeletePayload<T extends { [key: string]: any }> =
95
+ RealtimeBroadcastChangesPayloadBase & {
96
+ operation: `${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.DELETE}`
97
+ record: null
98
+ old_record: T
99
+ }
100
+
101
+ export type RealtimeBroadcastPayload<T extends { [key: string]: any }> =
102
+ | RealtimeBroadcastInsertPayload<T>
103
+ | RealtimeBroadcastUpdatePayload<T>
104
+ | RealtimeBroadcastDeletePayload<T>
105
+
106
+ type RealtimePostgresChangesPayloadBase = {
107
+ schema: string
108
+ table: string
109
+ commit_timestamp: string
110
+ errors: string[]
111
+ }
112
+
113
+ export type RealtimePostgresInsertPayload<T extends { [key: string]: any }> =
114
+ RealtimePostgresChangesPayloadBase & {
115
+ eventType: `${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.INSERT}`
116
+ new: T
117
+ old: {}
118
+ }
119
+
120
+ export type RealtimePostgresUpdatePayload<T extends { [key: string]: any }> =
121
+ RealtimePostgresChangesPayloadBase & {
122
+ eventType: `${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.UPDATE}`
123
+ new: T
124
+ old: Partial<T>
125
+ }
126
+
127
+ export type RealtimePostgresDeletePayload<T extends { [key: string]: any }> =
128
+ RealtimePostgresChangesPayloadBase & {
129
+ eventType: `${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.DELETE}`
130
+ new: {}
131
+ old: Partial<T>
132
+ }
133
+
134
+ export type RealtimePostgresChangesPayload<T extends { [key: string]: any }> =
135
+ | RealtimePostgresInsertPayload<T>
136
+ | RealtimePostgresUpdatePayload<T>
137
+ | RealtimePostgresDeletePayload<T>
138
+
139
+ export type RealtimePostgresChangesFilter<T extends `${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT}`> = {
140
+ /**
141
+ * The type of database change to listen to.
142
+ */
143
+ event: T
144
+ /**
145
+ * The database schema to listen to.
146
+ */
147
+ schema: string
148
+ /**
149
+ * The database table to listen to.
150
+ */
151
+ table?: string
152
+ /**
153
+ * Receive database changes only when the filter is matched.
154
+ *
155
+ * A filter is a `column=operator.value` expression, e.g. `id=eq.1` or
156
+ * `title=like.%foo%`. See {@link RealtimePostgresChangesFilterOperator} for
157
+ * the available operators.
158
+ *
159
+ * Multiple filters can be combined with commas; they are applied as an `AND`
160
+ * condition: `filter: 'id=gt.0,id=lt.100'`.
161
+ *
162
+ * Any operator can be negated with the `not.` prefix: `filter: 'status=not.in.(draft,archived)'`.
163
+ *
164
+ * The server splits conditions on commas outside quotes/parentheses. To
165
+ * include a reserved character (`,`, `(`, `)`) in a value, wrap it in double
166
+ * quotes PostgREST-style: `name=eq."a,b"`. The {@link RealtimePostgresFilterBuilder}
167
+ * does this quoting for you.
168
+ *
169
+ * Instead of a raw string you can pass a {@link RealtimePostgresFilterBuilder}
170
+ * (via `postgresChangesFilter()`) for a type-checked, ergonomic way to compose filters; the
171
+ * SDK serializes it to a string automatically.
172
+ */
173
+ filter?: string | RealtimePostgresFilterBuilder
174
+ /**
175
+ * Restrict the change payload to a subset of columns instead of receiving the
176
+ * full row. Reduces payload size (helpful for large `bytea`/`jsonb` columns)
177
+ * and the data transferred per event.
178
+ *
179
+ * The listed columns must be selectable by the subscribing role.
180
+ *
181
+ * @example
182
+ * channel.on('postgres_changes', {
183
+ * event: '*',
184
+ * schema: 'public',
185
+ * table: 'users',
186
+ * select: ['id', 'first_name'],
187
+ * }, (payload) => {
188
+ * // payload.new only contains { id, first_name }
189
+ * })
190
+ */
191
+ select?: string[]
192
+ }
193
+
194
+ export type RealtimeChannelSendResponse = 'ok' | 'timed out' | 'error' | (string & {})
195
+
196
+ /**
197
+ * Payload of a `system` event emitted by the server.
198
+ *
199
+ * Most notably, when a channel is created with `config.broadcast.replication_ready: true`,
200
+ * the server sends one of these once the Postgres replication connection is ready
201
+ * (`status: 'ok'`) or fails to become ready in time (`status: 'error'`).
202
+ */
203
+ export type RealtimeSystemPayload = {
204
+ /** The extension that produced the message, e.g. `'system'` or `'postgres_changes'`. */
205
+ extension: 'system' | 'postgres_changes' | (string & {})
206
+ /** `'ok'` on success, `'error'` on failure. */
207
+ status: 'ok' | 'error' | (string & {})
208
+ /** Human-readable description, e.g. `'Replication connection established'`. */
209
+ message: string
210
+ /** The channel (sub)topic the message refers to. */
211
+ channel: string
212
+ }
213
+
214
+ export enum REALTIME_POSTGRES_CHANGES_LISTEN_EVENT {
215
+ ALL = '*',
216
+ INSERT = 'INSERT',
217
+ UPDATE = 'UPDATE',
218
+ DELETE = 'DELETE',
219
+ }
220
+
221
+ export enum REALTIME_LISTEN_TYPES {
222
+ BROADCAST = 'broadcast',
223
+ PRESENCE = 'presence',
224
+ POSTGRES_CHANGES = 'postgres_changes',
225
+ SYSTEM = 'system',
226
+ }
227
+
228
+ export enum REALTIME_SUBSCRIBE_STATES {
229
+ SUBSCRIBED = 'SUBSCRIBED',
230
+ TIMED_OUT = 'TIMED_OUT',
231
+ CLOSED = 'CLOSED',
232
+ CHANNEL_ERROR = 'CHANNEL_ERROR',
233
+ }
234
+
235
+ export const REALTIME_CHANNEL_STATES = CHANNEL_STATES
236
+
237
+ type PostgresChangesFilters = {
238
+ postgres_changes: {
239
+ id: string
240
+ event: string
241
+ schema?: string
242
+ table?: string
243
+ filter?: string
244
+ select?: string[]
245
+ }[]
246
+ }
247
+
248
+ /**
249
+ * The `postgres_changes` filter fields that determine whether the server collapses two
250
+ * subscriptions into one. `filter` is always the serialized string form by the time it is compared.
251
+ */
252
+ type PostgresChangesFilterShape = {
253
+ event?: string
254
+ schema?: string
255
+ table?: string
256
+ filter?: string
257
+ select?: string[]
258
+ }
259
+
260
+ type Binding = {
261
+ type: string
262
+ filter: { [key: string]: any }
263
+ callback: ChannelBindingCallback
264
+ ref: number
265
+ id?: string
266
+ }
267
+
268
+ /** A channel is the basic building block of Realtime
269
+ * and narrows the scope of data flow to subscribed clients.
270
+ * You can think of a channel as a chatroom where participants are able to see who's online
271
+ * and send and receive messages.
272
+ */
273
+ export default class RealtimeChannel {
274
+ bindings: Record<string, Binding[]> = {}
275
+ subTopic: string
276
+ broadcastEndpointURL: string
277
+ private: boolean
278
+ presence: RealtimePresence
279
+ /** @internal */
280
+ channelAdapter: ChannelAdapter
281
+
282
+ get state() {
283
+ return this.channelAdapter.state
284
+ }
285
+
286
+ set state(state: ChannelState) {
287
+ this.channelAdapter.state = state
288
+ }
289
+
290
+ get joinedOnce() {
291
+ return this.channelAdapter.joinedOnce
292
+ }
293
+
294
+ get timeout() {
295
+ return this.socket.timeout
296
+ }
297
+
298
+ get joinPush() {
299
+ return this.channelAdapter.joinPush
300
+ }
301
+
302
+ get rejoinTimer(): Timer {
303
+ return this.channelAdapter.rejoinTimer
304
+ }
305
+
306
+ /**
307
+ * Creates a channel that can broadcast messages, sync presence, and listen to Postgres changes.
308
+ *
309
+ * The topic determines which realtime stream you are subscribing to. Config options let you
310
+ * enable acknowledgement for broadcasts, presence tracking, or private channels.
311
+ *
312
+ * @category Realtime
313
+ *
314
+ * @example Using supabase-js (recommended)
315
+ * ```ts
316
+ * import { createClient } from '@supabase/supabase-js'
317
+ *
318
+ * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')
319
+ * const channel = supabase.channel('room1')
320
+ * channel
321
+ * .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))
322
+ * .subscribe()
323
+ * ```
324
+ *
325
+ * @example Standalone import for bundle-sensitive environments
326
+ * ```ts
327
+ * import RealtimeClient from '@supabase/realtime-js'
328
+ *
329
+ * const client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {
330
+ * params: { apikey: 'your-publishable-key' },
331
+ * })
332
+ * const channel = new RealtimeChannel('realtime:public:messages', { config: {} }, client)
333
+ * ```
334
+ */
335
+ constructor(
336
+ /** Topic name can be any string. */
337
+ public topic: string,
338
+ public params: RealtimeChannelOptions = { config: {} },
339
+ public socket: RealtimeClient
340
+ ) {
341
+ this.subTopic = topic.replace(/^realtime:/i, '')
342
+ this.params.config = {
343
+ ...{
344
+ broadcast: { ack: false, self: false },
345
+ presence: { key: '', enabled: false },
346
+ private: false,
347
+ },
348
+ ...params.config,
349
+ }
350
+
351
+ this.channelAdapter = new ChannelAdapter(this.socket.socketAdapter, topic, this.params)
352
+ this.presence = new RealtimePresence(this)
353
+
354
+ this._onClose(() => {
355
+ this.socket._remove(this)
356
+ })
357
+
358
+ this._updateFilterTransform()
359
+
360
+ this.broadcastEndpointURL = httpEndpointURL(this.socket.socketAdapter.endPointURL())
361
+ this.private = this.params.config.private || false
362
+
363
+ if (!this.private && this.params.config?.broadcast?.replay) {
364
+ throw new Error(
365
+ `tried to use replay on public channel '${this.topic}'. It must be a private channel.`
366
+ )
367
+ }
368
+ }
369
+
370
+ /**
371
+ * Subscribe registers your client with the server.
372
+ *
373
+ * The optional `callback` receives a `status` and, on failure, an `err` argument.
374
+ * Log the full `err` so its `cause`, `name`, and any structured fields aren't hidden
375
+ * behind `err.message`.
376
+ *
377
+ * @category Realtime
378
+ *
379
+ * @example Handling errors
380
+ * ```js
381
+ * supabase.channel('room1').subscribe((status, err) => {
382
+ * if (status === 'CHANNEL_ERROR' || status === 'TIMED_OUT') {
383
+ * // Log the full error: its `cause` often holds the underlying reason.
384
+ * console.error(status, err)
385
+ * }
386
+ * })
387
+ * ```
388
+ */
389
+ subscribe(
390
+ callback?: (status: REALTIME_SUBSCRIBE_STATES, err?: Error) => void,
391
+ timeout = this.timeout
392
+ ): RealtimeChannel {
393
+ if (!this.socket.isConnected()) {
394
+ this.socket.connect()
395
+ }
396
+ if (this.channelAdapter.isClosed()) {
397
+ const {
398
+ config: { broadcast, presence, private: isPrivate },
399
+ } = this.params
400
+
401
+ const postgres_changes = this.bindings.postgres_changes?.map((r) => r.filter) ?? []
402
+
403
+ const presence_enabled =
404
+ (!!this.bindings[REALTIME_LISTEN_TYPES.PRESENCE] &&
405
+ this.bindings[REALTIME_LISTEN_TYPES.PRESENCE].length > 0) ||
406
+ this.params.config.presence?.enabled === true
407
+ const accessTokenPayload: { access_token?: string } = {}
408
+ const config = {
409
+ broadcast,
410
+ presence: { ...presence, enabled: presence_enabled },
411
+ postgres_changes,
412
+ private: isPrivate,
413
+ }
414
+
415
+ if (this.socket.accessTokenValue) {
416
+ accessTokenPayload.access_token = this.socket.accessTokenValue
417
+ }
418
+
419
+ this._onError((reason: unknown) => {
420
+ callback?.(REALTIME_SUBSCRIBE_STATES.CHANNEL_ERROR, normalizeChannelError(reason))
421
+ })
422
+
423
+ this._onClose(() => callback?.(REALTIME_SUBSCRIBE_STATES.CLOSED))
424
+
425
+ this.updateJoinPayload({ ...{ config }, ...accessTokenPayload })
426
+
427
+ this._updateFilterMessage()
428
+
429
+ this.channelAdapter
430
+ .subscribe(timeout)
431
+ .receive('ok', async ({ postgres_changes }: PostgresChangesFilters) => {
432
+ // Only refresh auth if using callback-based tokens
433
+ if (!this.socket._isManualToken()) {
434
+ this.socket.setAuth()
435
+ }
436
+ if (postgres_changes === undefined) {
437
+ callback?.(REALTIME_SUBSCRIBE_STATES.SUBSCRIBED)
438
+ return
439
+ }
440
+
441
+ this._updatePostgresBindings(postgres_changes, callback)
442
+ })
443
+ .receive('error', (error: { [key: string]: any }) => {
444
+ this.state = CHANNEL_STATES.errored
445
+ const message = Object.values(error).join(', ') || 'error'
446
+ callback?.(REALTIME_SUBSCRIBE_STATES.CHANNEL_ERROR, new Error(message, { cause: error }))
447
+ })
448
+ .receive('timeout', () => {
449
+ callback?.(REALTIME_SUBSCRIBE_STATES.TIMED_OUT)
450
+ })
451
+ }
452
+ return this
453
+ }
454
+
455
+ private _updatePostgresBindings(
456
+ postgres_changes: PostgresChangesFilters['postgres_changes'],
457
+ callback?: (status: REALTIME_SUBSCRIBE_STATES, err?: Error) => void
458
+ ) {
459
+ const clientPostgresBindings = this.bindings.postgres_changes
460
+ const bindingsLen = clientPostgresBindings?.length ?? 0
461
+ const newPostgresBindings = []
462
+
463
+ for (let i = 0; i < bindingsLen; i++) {
464
+ const clientPostgresBinding = clientPostgresBindings[i]
465
+ const {
466
+ filter: { event, schema, table, filter },
467
+ } = clientPostgresBinding
468
+ const serverPostgresFilter = postgres_changes && postgres_changes[i]
469
+
470
+ if (
471
+ serverPostgresFilter &&
472
+ serverPostgresFilter.event === event &&
473
+ RealtimeChannel.isFilterValueEqual(serverPostgresFilter.schema, schema) &&
474
+ RealtimeChannel.isFilterValueEqual(serverPostgresFilter.table, table) &&
475
+ RealtimeChannel.isFilterValueEqual(serverPostgresFilter.filter, filter)
476
+ ) {
477
+ newPostgresBindings.push({
478
+ ...clientPostgresBinding,
479
+ id: serverPostgresFilter.id,
480
+ })
481
+ } else {
482
+ this.unsubscribe()
483
+ this.state = CHANNEL_STATES.errored
484
+
485
+ callback?.(
486
+ REALTIME_SUBSCRIBE_STATES.CHANNEL_ERROR,
487
+ new Error('mismatch between server and client bindings for postgres changes')
488
+ )
489
+ return
490
+ }
491
+ }
492
+
493
+ this.bindings.postgres_changes = newPostgresBindings
494
+
495
+ if (this.state != CHANNEL_STATES.errored && callback) {
496
+ callback(REALTIME_SUBSCRIBE_STATES.SUBSCRIBED)
497
+ }
498
+ }
499
+
500
+ /**
501
+ * Returns the current presence state for this channel.
502
+ *
503
+ * The shape is a map keyed by presence key (for example a user id) where each entry contains the
504
+ * tracked metadata for that user.
505
+ *
506
+ * @category Realtime
507
+ */
508
+ presenceState<T extends { [key: string]: any } = {}>(): RealtimePresenceState<T> {
509
+ return this.presence.state as RealtimePresenceState<T>
510
+ }
511
+
512
+ /**
513
+ * Sends the supplied payload to the presence tracker so other subscribers can see that this
514
+ * client is online. Use `untrack` to stop broadcasting presence for the same key.
515
+ *
516
+ * Tracking makes this client visible to other subscribers immediately, regardless of this
517
+ * channel's `config.presence.enabled` setting or whether it has a `presence` listener — that
518
+ * flag only affects whether *this* client receives presence updates from others (and, on
519
+ * RLS-protected channels, whether it's authorized to do so).
520
+ *
521
+ * @category Realtime
522
+ */
523
+ async track(
524
+ payload: { [key: string]: any },
525
+ opts: { [key: string]: any } = {}
526
+ ): Promise<RealtimeChannelSendResponse> {
527
+ return await this.send(
528
+ {
529
+ type: 'presence',
530
+ event: 'track',
531
+ payload,
532
+ },
533
+ opts
534
+ )
535
+ }
536
+
537
+ /**
538
+ * Removes the current presence state for this client.
539
+ *
540
+ * @category Realtime
541
+ */
542
+ async untrack(opts: { [key: string]: any } = {}): Promise<RealtimeChannelSendResponse> {
543
+ return await this.send(
544
+ {
545
+ type: 'presence',
546
+ event: 'untrack',
547
+ },
548
+ opts
549
+ )
550
+ }
551
+
552
+ /**
553
+ * Listen for presence events on this channel — when peers join, leave, or
554
+ * sync presence state.
555
+ */
556
+ on(
557
+ type: `${REALTIME_LISTEN_TYPES.PRESENCE}`,
558
+ filter: { event: `${REALTIME_PRESENCE_LISTEN_EVENTS.SYNC}` },
559
+ callback: () => void
560
+ ): RealtimeChannel
561
+ on<T extends { [key: string]: any }>(
562
+ type: `${REALTIME_LISTEN_TYPES.PRESENCE}`,
563
+ filter: { event: `${REALTIME_PRESENCE_LISTEN_EVENTS.JOIN}` },
564
+ callback: (payload: RealtimePresenceJoinPayload<T>) => void
565
+ ): RealtimeChannel
566
+ on<T extends { [key: string]: any }>(
567
+ type: `${REALTIME_LISTEN_TYPES.PRESENCE}`,
568
+ filter: { event: `${REALTIME_PRESENCE_LISTEN_EVENTS.LEAVE}` },
569
+ callback: (payload: RealtimePresenceLeavePayload<T>) => void
570
+ ): RealtimeChannel
571
+ on<T extends { [key: string]: any }>(
572
+ type: `${REALTIME_LISTEN_TYPES.PRESENCE}`,
573
+ filter: { event: '*' },
574
+ callback: (payload?: RealtimePresenceJoinPayload<T> | RealtimePresenceLeavePayload<T>) => void
575
+ ): RealtimeChannel
576
+ /**
577
+ * Listen for Postgres database changes (insert / update / delete) streamed
578
+ * over this channel.
579
+ */
580
+ on<T extends { [key: string]: any }>(
581
+ type: `${REALTIME_LISTEN_TYPES.POSTGRES_CHANGES}`,
582
+ filter: RealtimePostgresChangesFilter<`${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.ALL}`>,
583
+ callback: (payload: RealtimePostgresChangesPayload<T>) => void
584
+ ): RealtimeChannel
585
+ on<T extends { [key: string]: any }>(
586
+ type: `${REALTIME_LISTEN_TYPES.POSTGRES_CHANGES}`,
587
+ filter: RealtimePostgresChangesFilter<`${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.INSERT}`>,
588
+ callback: (payload: RealtimePostgresInsertPayload<T>) => void
589
+ ): RealtimeChannel
590
+ on<T extends { [key: string]: any }>(
591
+ type: `${REALTIME_LISTEN_TYPES.POSTGRES_CHANGES}`,
592
+ filter: RealtimePostgresChangesFilter<`${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.UPDATE}`>,
593
+ callback: (payload: RealtimePostgresUpdatePayload<T>) => void
594
+ ): RealtimeChannel
595
+ on<T extends { [key: string]: any }>(
596
+ type: `${REALTIME_LISTEN_TYPES.POSTGRES_CHANGES}`,
597
+ filter: RealtimePostgresChangesFilter<`${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.DELETE}`>,
598
+ callback: (payload: RealtimePostgresDeletePayload<T>) => void
599
+ ): RealtimeChannel
600
+ on<T extends { [key: string]: any }>(
601
+ type: `${REALTIME_LISTEN_TYPES.POSTGRES_CHANGES}`,
602
+ filter: RealtimePostgresChangesFilter<`${REALTIME_POSTGRES_CHANGES_LISTEN_EVENT}`>,
603
+ callback: (payload: RealtimePostgresChangesPayload<T>) => void
604
+ ): RealtimeChannel
605
+ /**
606
+ * Listen for broadcast messages sent on this channel.
607
+ *
608
+ * @param type One of "broadcast", "presence", or "postgres_changes".
609
+ * @param filter Custom object specific to the Realtime feature detailing which payloads to receive.
610
+ * @param callback Function to be invoked when event handler is triggered.
611
+ */
612
+ on(
613
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`,
614
+ filter: { event: string },
615
+ callback: (payload: {
616
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`
617
+ event: string
618
+ meta?: {
619
+ replayed?: boolean
620
+ id: string
621
+ }
622
+ [key: string]: any
623
+ }) => void
624
+ ): RealtimeChannel
625
+ on<T extends { [key: string]: any }>(
626
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`,
627
+ filter: { event: string },
628
+ callback: (payload: {
629
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`
630
+ event: string
631
+ meta?: {
632
+ replayed?: boolean
633
+ id: string
634
+ }
635
+ payload: T
636
+ }) => void
637
+ ): RealtimeChannel
638
+ on<T extends Record<string, unknown>>(
639
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`,
640
+ filter: { event: REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.ALL },
641
+ callback: (payload: {
642
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`
643
+ event: REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.ALL
644
+ payload: RealtimeBroadcastPayload<T>
645
+ }) => void
646
+ ): RealtimeChannel
647
+ on<T extends { [key: string]: any }>(
648
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`,
649
+ filter: { event: REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.INSERT },
650
+ callback: (payload: {
651
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`
652
+ event: REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.INSERT
653
+ payload: RealtimeBroadcastInsertPayload<T>
654
+ }) => void
655
+ ): RealtimeChannel
656
+ on<T extends { [key: string]: any }>(
657
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`,
658
+ filter: { event: REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.UPDATE },
659
+ callback: (payload: {
660
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`
661
+ event: REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.UPDATE
662
+ payload: RealtimeBroadcastUpdatePayload<T>
663
+ }) => void
664
+ ): RealtimeChannel
665
+ on<T extends { [key: string]: any }>(
666
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`,
667
+ filter: { event: REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.DELETE },
668
+ callback: (payload: {
669
+ type: `${REALTIME_LISTEN_TYPES.BROADCAST}`
670
+ event: REALTIME_POSTGRES_CHANGES_LISTEN_EVENT.DELETE
671
+ payload: RealtimeBroadcastDeletePayload<T>
672
+ }) => void
673
+ ): RealtimeChannel
674
+ /**
675
+ * Listen for `system` events on this channel.
676
+ *
677
+ * The payload follows the {@link RealtimeSystemPayload} shape. Opt in to the replication-ready
678
+ * notification with `config.broadcast.replication_ready: true` when creating the channel, then
679
+ * watch for `payload.status === 'ok'` to know the Postgres replication connection is ready.
680
+ *
681
+ * @example Know when the replication connection is ready
682
+ * ```js
683
+ * const channel = supabase.channel('room1', {
684
+ * config: { broadcast: { replication_ready: true } },
685
+ * })
686
+ *
687
+ * channel
688
+ * .on('postgres_changes', { event: '*', schema: 'public', table: 'messages' }, (payload) => {
689
+ * console.log('Change received!', payload)
690
+ * })
691
+ * .on('system', {}, (payload) => {
692
+ * if (payload.extension === 'system' && payload.status === 'ok') {
693
+ * console.log('Replication connection is ready:', payload.message)
694
+ * }
695
+ * })
696
+ * .subscribe()
697
+ * ```
698
+ */
699
+ on<T extends { [key: string]: any }>(
700
+ type: `${REALTIME_LISTEN_TYPES.SYSTEM}`,
701
+ filter: {},
702
+ callback: (payload: any) => void
703
+ ): RealtimeChannel
704
+ /**
705
+ * Listen to realtime events on this channel.
706
+ * @category Realtime
707
+ *
708
+ * @remarks
709
+ * - By default, Broadcast and Presence are enabled for all projects.
710
+ * - By default, listening to database changes is disabled for new projects due to database performance and security concerns. You can turn it on by managing Realtime's [replication](/docs/guides/api#realtime-api-overview).
711
+ * - You can receive the "previous" data for updates and deletes by setting the table's `REPLICA IDENTITY` to `FULL` (e.g., `ALTER TABLE your_table REPLICA IDENTITY FULL;`).
712
+ * - Row level security is not applied to delete statements. When RLS is enabled and replica identity is set to full, only the primary key is sent to clients.
713
+ *
714
+ * @example Listen to broadcast messages
715
+ * ```js
716
+ * const channel = supabase.channel("room1")
717
+ *
718
+ * channel.on("broadcast", { event: "cursor-pos" }, (payload) => {
719
+ * console.log("Cursor position received!", payload);
720
+ * }).subscribe((status) => {
721
+ * if (status === "SUBSCRIBED") {
722
+ * channel.send({
723
+ * type: "broadcast",
724
+ * event: "cursor-pos",
725
+ * payload: { x: Math.random(), y: Math.random() },
726
+ * });
727
+ * }
728
+ * });
729
+ * ```
730
+ *
731
+ * @example Listen to presence sync
732
+ * ```js
733
+ * const channel = supabase.channel('room1')
734
+ * channel
735
+ * .on('presence', { event: 'sync' }, () => {
736
+ * console.log('Synced presence state: ', channel.presenceState())
737
+ * })
738
+ * .subscribe(async (status) => {
739
+ * if (status === 'SUBSCRIBED') {
740
+ * await channel.track({ online_at: new Date().toISOString() })
741
+ * }
742
+ * })
743
+ * ```
744
+ *
745
+ * @example Listen to presence join
746
+ * ```js
747
+ * const channel = supabase.channel('room1')
748
+ * channel
749
+ * .on('presence', { event: 'join' }, ({ newPresences }) => {
750
+ * console.log('Newly joined presences: ', newPresences)
751
+ * })
752
+ * .subscribe(async (status) => {
753
+ * if (status === 'SUBSCRIBED') {
754
+ * await channel.track({ online_at: new Date().toISOString() })
755
+ * }
756
+ * })
757
+ * ```
758
+ *
759
+ * @example Listen to presence leave
760
+ * ```js
761
+ * const channel = supabase.channel('room1')
762
+ * channel
763
+ * .on('presence', { event: 'leave' }, ({ leftPresences }) => {
764
+ * console.log('Newly left presences: ', leftPresences)
765
+ * })
766
+ * .subscribe(async (status) => {
767
+ * if (status === 'SUBSCRIBED') {
768
+ * await channel.track({ online_at: new Date().toISOString() })
769
+ * await channel.untrack()
770
+ * }
771
+ * })
772
+ * ```
773
+ *
774
+ * Registering the same `postgres_changes` filter more than once on a channel is a no-op: the
775
+ * duplicate is ignored and an error is logged, since the server only ever creates one
776
+ * subscription per distinct filter.
777
+ *
778
+ * @example Listen to all database changes
779
+ * ```js
780
+ * supabase
781
+ * .channel('room1')
782
+ * .on('postgres_changes', { event: '*', schema: '*' }, payload => {
783
+ * console.log('Change received!', payload)
784
+ * })
785
+ * .subscribe()
786
+ * ```
787
+ *
788
+ * @example Listen to a specific table
789
+ * ```js
790
+ * supabase
791
+ * .channel('room1')
792
+ * .on('postgres_changes', { event: '*', schema: 'public', table: 'countries' }, payload => {
793
+ * console.log('Change received!', payload)
794
+ * })
795
+ * .subscribe()
796
+ * ```
797
+ *
798
+ * @example Listen to inserts
799
+ * ```js
800
+ * supabase
801
+ * .channel('room1')
802
+ * .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'countries' }, payload => {
803
+ * console.log('Change received!', payload)
804
+ * })
805
+ * .subscribe()
806
+ * ```
807
+ *
808
+ * @exampleDescription Listen to updates
809
+ * By default, Supabase will send only the updated record. If you want to receive the previous values as well you can
810
+ * enable full replication for the table you are listening to:
811
+ *
812
+ * ```sql
813
+ * alter table "your_table" replica identity full;
814
+ * ```
815
+ *
816
+ * @example Listen to updates
817
+ * ```js
818
+ * supabase
819
+ * .channel('room1')
820
+ * .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'countries' }, payload => {
821
+ * console.log('Change received!', payload)
822
+ * })
823
+ * .subscribe()
824
+ * ```
825
+ *
826
+ * @exampleDescription Listen to deletes
827
+ * By default, Supabase does not send deleted records. If you want to receive the deleted record you can
828
+ * enable full replication for the table you are listening to:
829
+ *
830
+ * ```sql
831
+ * alter table "your_table" replica identity full;
832
+ * ```
833
+ *
834
+ * @example Listen to deletes
835
+ * ```js
836
+ * supabase
837
+ * .channel('room1')
838
+ * .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'countries' }, payload => {
839
+ * console.log('Change received!', payload)
840
+ * })
841
+ * .subscribe()
842
+ * ```
843
+ *
844
+ * @exampleDescription Listen to multiple events
845
+ * You can chain listeners if you want to listen to multiple events for each table.
846
+ *
847
+ * @example Listen to multiple events
848
+ * ```js
849
+ * supabase
850
+ * .channel('room1')
851
+ * .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'countries' }, handleRecordInserted)
852
+ * .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'countries' }, handleRecordDeleted)
853
+ * .subscribe()
854
+ * ```
855
+ *
856
+ * @exampleDescription Listen to row level changes
857
+ * You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match.
858
+ *
859
+ * @example Listen to row level changes
860
+ * ```js
861
+ * supabase
862
+ * .channel('room1')
863
+ * .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'countries', filter: 'id=eq.200' }, handleRecordUpdated)
864
+ * .subscribe()
865
+ * ```
866
+ */
867
+ on(
868
+ type: `${REALTIME_LISTEN_TYPES}`,
869
+ filter: { event: string; [key: string]: any },
870
+ callback: (payload: any) => void
871
+ ): RealtimeChannel {
872
+ const stateCheck = this.channelAdapter.isJoined() || this.channelAdapter.isJoining()
873
+ const typeCheck =
874
+ type === REALTIME_LISTEN_TYPES.PRESENCE || type === REALTIME_LISTEN_TYPES.POSTGRES_CHANGES
875
+
876
+ if (stateCheck && typeCheck) {
877
+ this.socket.log(
878
+ 'channel',
879
+ `cannot add \`${type}\` callbacks for ${this.topic} after \`subscribe()\`.`
880
+ )
881
+ throw new Error(`cannot add \`${type}\` callbacks for ${this.topic} after \`subscribe()\`.`)
882
+ }
883
+ return this._on(type, filter, callback)
884
+ }
885
+ /**
886
+ * Sends a broadcast message explicitly via REST API.
887
+ *
888
+ * This method always uses the REST API endpoint regardless of WebSocket connection state.
889
+ * Useful when you want to guarantee REST delivery or when gradually migrating from implicit REST fallback.
890
+ *
891
+ * Payloads that are `ArrayBuffer` or `ArrayBufferView` (e.g. `Uint8Array`) are sent as
892
+ * `application/octet-stream`; all other payloads are JSON-encoded.
893
+ *
894
+ * @param event The name of the broadcast event
895
+ * @param payload Payload to be sent (required)
896
+ * @param opts Options including timeout
897
+ * @returns Promise resolving to object with success status, and error details if failed
898
+ *
899
+ * @category Realtime
900
+ */
901
+ async httpSend(
902
+ event: string,
903
+ payload: any,
904
+ opts: { timeout?: number } = {}
905
+ ): Promise<{ success: true } | { success: false; status: number; error: string }> {
906
+ if (payload === undefined || payload === null) {
907
+ return Promise.reject(new Error('Payload is required for httpSend()'))
908
+ }
909
+
910
+ const isBinary = payload instanceof ArrayBuffer || ArrayBuffer.isView(payload)
911
+
912
+ const headers: Record<string, string> = {
913
+ apikey: this.socket.apiKey ? this.socket.apiKey : '',
914
+ 'Content-Type': isBinary ? 'application/octet-stream' : 'application/json',
915
+ }
916
+
917
+ if (this.socket.accessTokenValue) {
918
+ headers['Authorization'] = `Bearer ${this.socket.accessTokenValue}`
919
+ }
920
+
921
+ const url = new URL(this.broadcastEndpointURL)
922
+ url.pathname += `/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(event)}`
923
+ if (this.private) {
924
+ url.searchParams.set('private', 'true')
925
+ }
926
+
927
+ const options = {
928
+ method: 'POST',
929
+ headers,
930
+ body: isBinary ? (payload as ArrayBuffer | ArrayBufferView) : JSON.stringify(payload),
931
+ }
932
+
933
+ const response = await this._fetchWithTimeout(
934
+ url.toString(),
935
+ options,
936
+ opts.timeout ?? this.timeout
937
+ )
938
+
939
+ if (response.status === 202) {
940
+ return { success: true }
941
+ }
942
+
943
+ if (response.status === 404) {
944
+ return Promise.reject(
945
+ new Error(
946
+ 'httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. ' +
947
+ 'Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. ' +
948
+ 'See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md'
949
+ )
950
+ )
951
+ }
952
+
953
+ let errorMessage = response.statusText
954
+ try {
955
+ const errorBody = await response.json()
956
+ errorMessage = errorBody.error || errorBody.message || errorMessage
957
+ } catch {}
958
+
959
+ return Promise.reject(new Error(errorMessage))
960
+ }
961
+
962
+ /**
963
+ * Sends a message into the channel.
964
+ *
965
+ * @param args Arguments to send to channel
966
+ * @param args.type The type of event to send
967
+ * @param args.event The name of the event being sent
968
+ * @param args.payload Payload to be sent
969
+ * @param opts Options to be used during the send process
970
+ *
971
+ * @category Realtime
972
+ *
973
+ * @remarks
974
+ * - When using REST you don't need to subscribe to the channel
975
+ * - REST calls are only available from 2.37.0 onwards
976
+ * - If you create a channel only to send a REST broadcast, remove it from
977
+ * the client when the send completes
978
+ *
979
+ * @example Send a message via websocket
980
+ * ```js
981
+ * const channel = supabase.channel('room1')
982
+ *
983
+ * channel.subscribe((status) => {
984
+ * if (status === 'SUBSCRIBED') {
985
+ * channel.send({
986
+ * type: 'broadcast',
987
+ * event: 'cursor-pos',
988
+ * payload: { x: Math.random(), y: Math.random() },
989
+ * })
990
+ * }
991
+ * })
992
+ * ```
993
+ *
994
+ * @exampleResponse Send a message via websocket
995
+ * ```js
996
+ * ok | timed out | error
997
+ * ```
998
+ *
999
+ * @example Send a message via REST
1000
+ * ```js
1001
+ * const channel = supabase.channel('room1')
1002
+ *
1003
+ * try {
1004
+ * await channel.httpSend('cursor-pos', { x: Math.random(), y: Math.random() })
1005
+ * } finally {
1006
+ * await supabase.removeChannel(channel)
1007
+ * }
1008
+ * ```
1009
+ */
1010
+ async send(
1011
+ args: {
1012
+ type: 'broadcast' | 'presence' | 'postgres_changes'
1013
+ event: string
1014
+ payload?: any
1015
+ [key: string]: any
1016
+ },
1017
+ opts: { [key: string]: any } = {}
1018
+ ): Promise<RealtimeChannelSendResponse> {
1019
+ if (!this.channelAdapter.canPush() && args.type === 'broadcast') {
1020
+ console.warn(
1021
+ 'Realtime send() is automatically falling back to REST API. ' +
1022
+ 'This behavior will be deprecated in the future. ' +
1023
+ 'Please use httpSend() explicitly for REST delivery.'
1024
+ )
1025
+
1026
+ const { event, payload: endpoint_payload } = args
1027
+ const headers: Record<string, string> = {
1028
+ apikey: this.socket.apiKey ? this.socket.apiKey : '',
1029
+ 'Content-Type': 'application/json',
1030
+ }
1031
+
1032
+ if (this.socket.accessTokenValue) {
1033
+ headers['Authorization'] = `Bearer ${this.socket.accessTokenValue}`
1034
+ }
1035
+
1036
+ const options = {
1037
+ method: 'POST',
1038
+ headers,
1039
+ body: JSON.stringify({
1040
+ messages: [
1041
+ {
1042
+ topic: this.subTopic,
1043
+ event,
1044
+ payload: endpoint_payload,
1045
+ private: this.private,
1046
+ },
1047
+ ],
1048
+ }),
1049
+ }
1050
+
1051
+ try {
1052
+ const response = await this._fetchWithTimeout(
1053
+ this.broadcastEndpointURL,
1054
+ options,
1055
+ opts.timeout ?? this.timeout
1056
+ )
1057
+
1058
+ await response.body?.cancel()
1059
+ return response.ok ? 'ok' : 'error'
1060
+ } catch (error) {
1061
+ if (error instanceof Error && error.name === 'AbortError') {
1062
+ return 'timed out'
1063
+ } else {
1064
+ return 'error'
1065
+ }
1066
+ }
1067
+ } else {
1068
+ return new Promise((resolve) => {
1069
+ const push = this.channelAdapter.push(args.type, args, opts.timeout || this.timeout)
1070
+
1071
+ if (args.type === 'broadcast' && !this.params?.config?.broadcast?.ack) {
1072
+ resolve('ok')
1073
+ }
1074
+
1075
+ push.receive('ok', () => resolve('ok'))
1076
+ push.receive('error', () => resolve('error'))
1077
+ push.receive('timeout', () => resolve('timed out'))
1078
+ })
1079
+ }
1080
+ }
1081
+
1082
+ /**
1083
+ * Updates the payload that will be sent the next time the channel joins (reconnects).
1084
+ * Useful for rotating access tokens or updating config without re-creating the channel.
1085
+ *
1086
+ * @category Realtime
1087
+ */
1088
+ updateJoinPayload(payload: Record<string, any>) {
1089
+ this.channelAdapter.updateJoinPayload(payload)
1090
+ }
1091
+
1092
+ /**
1093
+ * Leaves the channel.
1094
+ *
1095
+ * Unsubscribes from server events, and instructs channel to terminate on server.
1096
+ * Triggers onClose() hooks.
1097
+ *
1098
+ * To receive leave acknowledgements, use the a `receive` hook to bind to the server ack, ie:
1099
+ * channel.unsubscribe().receive("ok", () => alert("left!") )
1100
+ *
1101
+ * @category Realtime
1102
+ */
1103
+ async unsubscribe(timeout = this.timeout) {
1104
+ return new Promise<RealtimeChannelSendResponse>((resolve) => {
1105
+ this.channelAdapter
1106
+ .unsubscribe(timeout)
1107
+ .receive('ok', () => resolve('ok'))
1108
+ .receive('timeout', () => resolve('timed out'))
1109
+ .receive('error', () => resolve('error'))
1110
+ })
1111
+ }
1112
+
1113
+ /**
1114
+ * Destroys and stops related timers.
1115
+ *
1116
+ * @category Realtime
1117
+ */
1118
+ teardown() {
1119
+ this.channelAdapter.teardown()
1120
+ }
1121
+
1122
+ /** @internal */
1123
+ async _fetchWithTimeout(url: string, options: { [key: string]: any }, timeout: number) {
1124
+ const controller = new AbortController()
1125
+ const id = setTimeout(() => controller.abort(), timeout)
1126
+
1127
+ const response = await this.socket.fetch(url, {
1128
+ ...options,
1129
+ signal: controller.signal,
1130
+ })
1131
+
1132
+ clearTimeout(id)
1133
+
1134
+ return response
1135
+ }
1136
+
1137
+ /** @internal */
1138
+ _on(type: string, filter: { [key: string]: any }, callback: ChannelBindingCallback) {
1139
+ const typeLower = type.toLocaleLowerCase()
1140
+
1141
+ // Serialize a postgres_changes filter builder into its string form so the
1142
+ // rest of the pipeline (join payload, server binding match) sees a string.
1143
+ // Duck-type `build()` in addition to `instanceof` so a builder constructed
1144
+ // against a duplicate copy of the package (separate module realm) still works.
1145
+ const filterValue = filter?.filter
1146
+ if (
1147
+ filterValue instanceof RealtimePostgresFilterBuilder ||
1148
+ (typeof filterValue === 'object' &&
1149
+ filterValue !== null &&
1150
+ typeof (filterValue as { build?: unknown }).build === 'function')
1151
+ ) {
1152
+ filter = { ...filter, filter: (filterValue as RealtimePostgresFilterBuilder).build() }
1153
+ }
1154
+
1155
+ // The server collapses identical postgres_changes filters, so keeping a duplicate here would
1156
+ // desync the client and server binding lists and make `subscribe()` fail with a mismatch.
1157
+ if (typeLower === REALTIME_LISTEN_TYPES.POSTGRES_CHANGES) {
1158
+ const duplicate = this.bindings[typeLower]?.find((bind) =>
1159
+ RealtimeChannel.isSamePostgresFilter(bind.filter, filter)
1160
+ )
1161
+
1162
+ if (duplicate) {
1163
+ this.socket.log(
1164
+ 'error',
1165
+ `duplicate \`postgres_changes\` binding for ${this.topic} ignored`,
1166
+ filter
1167
+ )
1168
+ return this
1169
+ }
1170
+ }
1171
+
1172
+ const ref = this.channelAdapter.on(type, callback)
1173
+
1174
+ const binding: Binding = {
1175
+ type: typeLower,
1176
+ filter: filter,
1177
+ callback: callback,
1178
+ ref: ref,
1179
+ }
1180
+
1181
+ if (this.bindings[typeLower]) {
1182
+ this.bindings[typeLower].push(binding)
1183
+ } else {
1184
+ this.bindings[typeLower] = [binding]
1185
+ }
1186
+
1187
+ this._updateFilterMessage()
1188
+
1189
+ return this
1190
+ }
1191
+
1192
+ /**
1193
+ * Registers a callback that will be executed when the channel closes.
1194
+ *
1195
+ * @internal
1196
+ */
1197
+ private _onClose(callback: ChannelBindingCallback) {
1198
+ this.channelAdapter.onClose(callback)
1199
+ }
1200
+
1201
+ /**
1202
+ * Registers a callback that will be executed when the channel encounteres an error.
1203
+ *
1204
+ * @internal
1205
+ */
1206
+ private _onError(callback: ChannelOnErrorCallback) {
1207
+ this.channelAdapter.onError(callback)
1208
+ }
1209
+
1210
+ /** @internal */
1211
+ private _updateFilterMessage() {
1212
+ this.channelAdapter.updateFilterBindings((binding, payload: any, ref) => {
1213
+ const typeLower = binding.event.toLocaleLowerCase()
1214
+
1215
+ if (this._notThisChannelEvent(typeLower, ref)) {
1216
+ return false
1217
+ }
1218
+
1219
+ const bind = this.bindings[typeLower]?.find((bind) => bind.ref === binding.ref)
1220
+
1221
+ if (!bind) {
1222
+ return true
1223
+ }
1224
+
1225
+ if (['broadcast', 'presence', 'postgres_changes'].includes(typeLower)) {
1226
+ if ('id' in bind) {
1227
+ const bindId = bind.id
1228
+ const bindEvent = bind.filter?.event
1229
+ return (
1230
+ bindId &&
1231
+ payload.ids?.includes(bindId) &&
1232
+ (bindEvent === '*' ||
1233
+ bindEvent?.toLocaleLowerCase() === payload.data?.type.toLocaleLowerCase())
1234
+ )
1235
+ } else {
1236
+ const bindEvent = bind?.filter?.event?.toLocaleLowerCase()
1237
+ return bindEvent === '*' || bindEvent === payload?.event?.toLocaleLowerCase()
1238
+ }
1239
+ } else {
1240
+ return bind.type.toLocaleLowerCase() === typeLower
1241
+ }
1242
+ })
1243
+ }
1244
+
1245
+ /** @internal */
1246
+ private _notThisChannelEvent(event: string, ref?: string | null) {
1247
+ const { close, error, leave, join } = CHANNEL_EVENTS
1248
+ const events: string[] = [close, error, leave, join]
1249
+ return ref && events.includes(event) && ref !== this.joinPush.ref
1250
+ }
1251
+
1252
+ /** @internal */
1253
+ private _updateFilterTransform() {
1254
+ this.channelAdapter.updatePayloadTransform((event, payload: any, ref) => {
1255
+ if (typeof payload === 'object' && 'ids' in payload) {
1256
+ const postgresChanges = payload.data
1257
+ const { schema, table, commit_timestamp, type, errors } = postgresChanges
1258
+ const enrichedPayload = {
1259
+ schema: schema,
1260
+ table: table,
1261
+ commit_timestamp: commit_timestamp,
1262
+ eventType: type,
1263
+ new: {},
1264
+ old: {},
1265
+ errors: errors,
1266
+ }
1267
+ return {
1268
+ ...enrichedPayload,
1269
+ ...this._getPayloadRecords(postgresChanges),
1270
+ }
1271
+ }
1272
+
1273
+ return payload
1274
+ })
1275
+ }
1276
+
1277
+ copyBindings(other: RealtimeChannel) {
1278
+ if (this.joinedOnce) {
1279
+ throw new Error('cannot copy bindings into joined channel')
1280
+ }
1281
+ for (const kind in other.bindings) {
1282
+ for (const binding of other.bindings[kind]) {
1283
+ this._on(binding.type, binding.filter, binding.callback)
1284
+ }
1285
+ }
1286
+ }
1287
+
1288
+ /**
1289
+ * Compares two optional filter values for equality.
1290
+ * Treats undefined, null, and empty string as equivalent empty values.
1291
+ * @internal
1292
+ */
1293
+ private static isFilterValueEqual(
1294
+ serverValue: string | undefined | null,
1295
+ clientValue: string | undefined
1296
+ ): boolean {
1297
+ const normalizedServer = serverValue ?? undefined
1298
+ const normalizedClient = clientValue ?? undefined
1299
+ return normalizedServer === normalizedClient
1300
+ }
1301
+
1302
+ /**
1303
+ * Two `postgres_changes` filters are the same when the server would collapse them into a single
1304
+ * subscription.
1305
+ * @internal
1306
+ */
1307
+ private static isSamePostgresFilter(
1308
+ a: PostgresChangesFilterShape,
1309
+ b: PostgresChangesFilterShape
1310
+ ): boolean {
1311
+ const selectA = a?.select?.join() ?? undefined
1312
+ const selectB = b?.select?.join() ?? undefined
1313
+
1314
+ return (
1315
+ a?.event === b?.event &&
1316
+ RealtimeChannel.isFilterValueEqual(a?.schema, b?.schema) &&
1317
+ RealtimeChannel.isFilterValueEqual(a?.table, b?.table) &&
1318
+ RealtimeChannel.isFilterValueEqual(a?.filter, b?.filter) &&
1319
+ selectA === selectB
1320
+ )
1321
+ }
1322
+
1323
+ /** @internal */
1324
+ private _getPayloadRecords(payload: any) {
1325
+ const records = {
1326
+ new: {},
1327
+ old: {},
1328
+ }
1329
+
1330
+ if (payload.type === 'INSERT' || payload.type === 'UPDATE') {
1331
+ records.new = Transformers.convertChangeData(payload.columns, payload.record)
1332
+ }
1333
+
1334
+ if (payload.type === 'UPDATE' || payload.type === 'DELETE') {
1335
+ records.old = Transformers.convertChangeData(payload.columns, payload.old_record)
1336
+ }
1337
+
1338
+ return records
1339
+ }
1340
+ }
node_modules/@supabase/realtime-js/src/RealtimeClient.ts ADDED
@@ -0,0 +1,867 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import WebSocketFactory, { WebSocketLike } from './lib/websocket-factory'
2
+
3
+ import {
4
+ CHANNEL_EVENTS,
5
+ CONNECTION_STATE,
6
+ DEFAULT_VERSION,
7
+ DEFAULT_TIMEOUT,
8
+ DEFAULT_VSN,
9
+ VSN_1_0_0,
10
+ VSN_2_0_0,
11
+ } from './lib/constants'
12
+
13
+ import Serializer from './lib/serializer'
14
+ import { httpEndpointURL } from './lib/transformers'
15
+ import RealtimeChannel from './RealtimeChannel'
16
+ import type { RealtimeChannelOptions } from './RealtimeChannel'
17
+ import SocketAdapter from './phoenix/socketAdapter'
18
+ import type {
19
+ Message,
20
+ SocketOptions,
21
+ HeartbeatCallback,
22
+ Encode,
23
+ Decode,
24
+ Timer,
25
+ Vsn,
26
+ } from './phoenix/types'
27
+
28
+ type Fetch = typeof fetch
29
+
30
+ export type LogLevel = 'info' | 'warn' | 'error' | (string & {})
31
+
32
+ export type RealtimeMessage = {
33
+ topic: string
34
+ event: string
35
+ payload: any
36
+ ref: string
37
+ join_ref?: string
38
+ }
39
+
40
+ export type RealtimeRemoveChannelResponse = 'ok' | 'timed out' | 'error' | (string & {})
41
+ export type HeartbeatStatus = 'sent' | 'ok' | 'error' | 'timeout' | 'disconnected' | (string & {})
42
+ export type HeartbeatTimer = ReturnType<typeof setTimeout> | undefined
43
+
44
+ // Connection-related constants
45
+ const CONNECTION_TIMEOUTS = {
46
+ HEARTBEAT_INTERVAL: 25000,
47
+ RECONNECT_DELAY: 10,
48
+ HEARTBEAT_TIMEOUT_FALLBACK: 100,
49
+ } as const
50
+
51
+ const RECONNECT_INTERVALS = [1000, 2000, 5000, 10000] as const
52
+ const DEFAULT_RECONNECT_FALLBACK = 10000
53
+
54
+ /**
55
+ * Minimal WebSocket constructor interface that RealtimeClient can work with.
56
+ * Supply a compatible implementation (native WebSocket, `ws`, etc) when running outside the browser.
57
+ */
58
+ export interface WebSocketLikeConstructor {
59
+ new (address: string | URL, subprotocols?: string | string[] | undefined): WebSocketLike
60
+ // Allow additional properties that may exist on WebSocket constructors
61
+ [key: string]: any
62
+ }
63
+
64
+ export type RealtimeClientOptions = {
65
+ transport?: WebSocketLikeConstructor
66
+ timeout?: number
67
+ heartbeatIntervalMs?: number
68
+ heartbeatCallback?: (status: HeartbeatStatus, latency?: number) => void
69
+ vsn?: string
70
+ logger?: (kind: string, msg: string, data?: any) => void
71
+ encode?: Encode<void>
72
+ decode?: Decode<void>
73
+ reconnectAfterMs?: (tries: number) => number
74
+ headers?: { [key: string]: string }
75
+ params?: { [key: string]: any }
76
+ //Deprecated: Use it in favour of correct casing `logLevel`
77
+ log_level?: LogLevel
78
+ logLevel?: LogLevel
79
+ fetch?: Fetch
80
+ worker?: boolean
81
+ workerUrl?: string
82
+ accessToken?: () => Promise<string | null>
83
+ disconnectOnEmptyChannelsAfterMs?: number
84
+ /**
85
+ * Storage compatible object used by the underlying socket for longpoll fallback history.
86
+ * Provide a custom implementation in environments where reading `globalThis.sessionStorage`
87
+ * throws (sandboxed iframes, in-app webviews, "block third-party storage" privacy modes).
88
+ * Defaults to `globalThis.sessionStorage` when accessible, otherwise an in-memory store.
89
+ */
90
+ sessionStorage?: Storage
91
+ }
92
+
93
+ function createMemorySessionStorage(): Storage {
94
+ const store = new Map<string, string>()
95
+ return {
96
+ get length() {
97
+ return store.size
98
+ },
99
+ clear() {
100
+ store.clear()
101
+ },
102
+ getItem(key: string) {
103
+ return store.has(key) ? (store.get(key) as string) : null
104
+ },
105
+ key(index: number) {
106
+ return Array.from(store.keys())[index] ?? null
107
+ },
108
+ removeItem(key: string) {
109
+ store.delete(key)
110
+ },
111
+ setItem(key: string, value: string) {
112
+ store.set(key, String(value))
113
+ },
114
+ }
115
+ }
116
+
117
+ function resolveSessionStorage(): Storage {
118
+ try {
119
+ if (typeof globalThis !== 'undefined' && globalThis.sessionStorage) {
120
+ return globalThis.sessionStorage
121
+ }
122
+ } catch {
123
+ // Property access on `sessionStorage` itself throws in restricted-storage browsers.
124
+ }
125
+ return createMemorySessionStorage()
126
+ }
127
+
128
+ const WORKER_SCRIPT = `
129
+ addEventListener("message", (e) => {
130
+ if (e.data.event === "start") {
131
+ setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
132
+ }
133
+ });`
134
+
135
+ export default class RealtimeClient {
136
+ /** @internal */
137
+ socketAdapter: SocketAdapter
138
+ channels: RealtimeChannel[] = new Array()
139
+
140
+ accessTokenValue: string | null = null
141
+ accessToken: (() => Promise<string | null>) | null = null
142
+ apiKey: string | null = null
143
+
144
+ httpEndpoint: string = ''
145
+ /** @deprecated headers cannot be set on websocket connections */
146
+ headers?: { [key: string]: string } = {}
147
+ params?: { [key: string]: string } = {}
148
+
149
+ ref: number = 0
150
+
151
+ logLevel?: LogLevel
152
+
153
+ fetch: Fetch
154
+ worker?: boolean
155
+ workerUrl?: string
156
+ workerRef?: Worker
157
+
158
+ serializer: Serializer = new Serializer()
159
+
160
+ get endPoint() {
161
+ return this.socketAdapter.endPoint
162
+ }
163
+
164
+ get timeout() {
165
+ return this.socketAdapter.timeout
166
+ }
167
+
168
+ get transport() {
169
+ return this.socketAdapter.transport
170
+ }
171
+
172
+ get heartbeatCallback() {
173
+ return this.socketAdapter.heartbeatCallback
174
+ }
175
+
176
+ get heartbeatIntervalMs() {
177
+ return this.socketAdapter.heartbeatIntervalMs
178
+ }
179
+
180
+ get heartbeatTimer() {
181
+ if (this.worker) {
182
+ return this._workerHeartbeatTimer
183
+ }
184
+ return this.socketAdapter.heartbeatTimer
185
+ }
186
+
187
+ get pendingHeartbeatRef() {
188
+ if (this.worker) {
189
+ return this._pendingWorkerHeartbeatRef
190
+ }
191
+ return this.socketAdapter.pendingHeartbeatRef
192
+ }
193
+
194
+ get reconnectTimer(): Timer {
195
+ return this.socketAdapter.reconnectTimer
196
+ }
197
+
198
+ get vsn(): Vsn {
199
+ return this.socketAdapter.vsn
200
+ }
201
+
202
+ get encode() {
203
+ return this.socketAdapter.encode
204
+ }
205
+
206
+ get decode() {
207
+ return this.socketAdapter.decode
208
+ }
209
+
210
+ get reconnectAfterMs() {
211
+ return this.socketAdapter.reconnectAfterMs
212
+ }
213
+
214
+ get sendBuffer() {
215
+ return this.socketAdapter.sendBuffer
216
+ }
217
+
218
+ get stateChangeCallbacks(): {
219
+ open: [string, Function][]
220
+ close: [string, Function][]
221
+ error: [string, Function][]
222
+ message: [string, Function][]
223
+ } {
224
+ return this.socketAdapter.stateChangeCallbacks
225
+ }
226
+
227
+ private _manuallySetToken: boolean = false
228
+ private _authPromise: Promise<void> | null = null
229
+ private _authGeneration: number = 0
230
+ private _workerHeartbeatTimer: HeartbeatTimer = undefined
231
+ private _pendingWorkerHeartbeatRef: string | null = null
232
+ private _pendingDisconnectTimer: ReturnType<typeof setTimeout> | null = null
233
+ private _disconnectOnEmptyChannelsAfterMs: number = 0
234
+
235
+ /**
236
+ * Initializes the Socket.
237
+ *
238
+ * @param endPoint The string WebSocket endpoint, ie, "ws://example.com/socket", "wss://example.com", "/socket" (inherited host & protocol)
239
+ * @param options.transport The Websocket Transport, for example WebSocket. This can be a custom implementation
240
+ * @param options.timeout The default timeout in milliseconds to trigger push timeouts.
241
+ * @param options.params The optional params to pass when connecting.
242
+ * @param options.headers Deprecated: headers cannot be set on websocket connections and this option will be removed in the future.
243
+ * @param options.heartbeatIntervalMs The millisec interval to send a heartbeat message.
244
+ * @param options.heartbeatCallback The optional function to handle heartbeat status and latency.
245
+ * @param options.logger The optional function for specialized logging, ie: logger: (kind, msg, data) => { console.log(`${kind}: ${msg}`, data) }
246
+ * @param options.logLevel Sets the log level for Realtime
247
+ * @param options.encode The function to encode outgoing messages. Defaults to JSON: (payload, callback) => callback(JSON.stringify(payload))
248
+ * @param options.decode The function to decode incoming messages. Defaults to Serializer's decode.
249
+ * @param options.reconnectAfterMs he optional function that returns the millsec reconnect interval. Defaults to stepped backoff off.
250
+ * @param options.worker Use Web Worker to set a side flow. Defaults to false.
251
+ * @param options.workerUrl The URL of the worker script. Defaults to https://realtime.supabase.com/worker.js that includes a heartbeat event call to keep the connection alive.
252
+ * @param options.vsn The protocol version to use when connecting. Supported versions are "1.0.0" and "2.0.0". Defaults to "2.0.0".
253
+ *
254
+ * @category Realtime
255
+ *
256
+ * @example Using supabase-js (recommended)
257
+ * ```ts
258
+ * import { createClient } from '@supabase/supabase-js'
259
+ *
260
+ * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')
261
+ * const channel = supabase.channel('room1')
262
+ * channel
263
+ * .on('broadcast', { event: 'cursor-pos' }, (payload) => console.log(payload))
264
+ * .subscribe()
265
+ * ```
266
+ *
267
+ * @example Standalone import for bundle-sensitive environments
268
+ * ```ts
269
+ * import RealtimeClient from '@supabase/realtime-js'
270
+ *
271
+ * const client = new RealtimeClient('https://xyzcompany.supabase.co/realtime/v1', {
272
+ * params: { apikey: 'your-publishable-key' },
273
+ * })
274
+ * client.connect()
275
+ * ```
276
+ */
277
+ constructor(endPoint: string, options?: RealtimeClientOptions) {
278
+ // Validate required parameters
279
+ if (!options?.params?.apikey) {
280
+ throw new Error('API key is required to connect to Realtime')
281
+ }
282
+ this.apiKey = options.params.apikey
283
+
284
+ const socketAdapterOptions = this._initializeOptions(options)
285
+
286
+ this.socketAdapter = new SocketAdapter(endPoint, socketAdapterOptions)
287
+ this.httpEndpoint = httpEndpointURL(endPoint)
288
+
289
+ this.fetch = this._resolveFetch(options?.fetch)
290
+ }
291
+
292
+ /**
293
+ * Connects the socket, unless already connected.
294
+ *
295
+ * @category Realtime
296
+ */
297
+ connect(): void {
298
+ // Skip if already connecting, disconnecting, or connected
299
+ if (this.isConnecting() || this.isDisconnecting() || this.isConnected()) {
300
+ return
301
+ }
302
+
303
+ // Trigger auth if needed and not already in progress
304
+ // This ensures auth is called for standalone RealtimeClient usage
305
+ // while avoiding race conditions with SupabaseClient's immediate setAuth call
306
+ if (this.accessToken && !this._authPromise) {
307
+ this._setAuthSafely('connect')
308
+ }
309
+
310
+ this._setupConnectionHandlers()
311
+
312
+ try {
313
+ this.socketAdapter.connect()
314
+ } catch (error) {
315
+ const errorMessage = (error as Error).message
316
+ throw new Error(`WebSocket not available: ${errorMessage}`)
317
+ }
318
+
319
+ this._handleNodeJsRaceCondition()
320
+ }
321
+
322
+ /**
323
+ * Returns the URL of the websocket.
324
+ * @returns string The URL of the websocket.
325
+ *
326
+ * @category Realtime
327
+ */
328
+ endpointURL(): string {
329
+ return this.socketAdapter.endPointURL()
330
+ }
331
+
332
+ /**
333
+ * Disconnects the socket.
334
+ *
335
+ * @param code A numeric status code to send on disconnect.
336
+ * @param reason A custom reason for the disconnect.
337
+ *
338
+ * @category Realtime
339
+ */
340
+ async disconnect(code?: number, reason?: string) {
341
+ this._cancelPendingDisconnect()
342
+ if (this.isDisconnecting()) {
343
+ return 'ok'
344
+ }
345
+ return await this.socketAdapter.disconnect(
346
+ () => {
347
+ clearInterval(this._workerHeartbeatTimer)
348
+ this._terminateWorker()
349
+ },
350
+ code,
351
+ reason
352
+ )
353
+ }
354
+
355
+ /**
356
+ * Returns all created channels
357
+ *
358
+ * @category Realtime
359
+ */
360
+ getChannels(): RealtimeChannel[] {
361
+ return this.channels
362
+ }
363
+
364
+ /**
365
+ * Unsubscribes, removes and tears down a single channel
366
+ * @param channel A RealtimeChannel instance
367
+ *
368
+ * @category Realtime
369
+ */
370
+ async removeChannel(channel: RealtimeChannel): Promise<RealtimeRemoveChannelResponse> {
371
+ const status = await channel.unsubscribe()
372
+
373
+ if (status === 'ok') {
374
+ channel.teardown()
375
+ }
376
+
377
+ return status
378
+ }
379
+
380
+ /**
381
+ * Unsubscribes, removes and tears down all channels
382
+ *
383
+ * @category Realtime
384
+ */
385
+ async removeAllChannels(): Promise<RealtimeRemoveChannelResponse[]> {
386
+ const promises = this.channels.map(async (channel) => {
387
+ const result = await channel.unsubscribe()
388
+ channel.teardown()
389
+ return result
390
+ })
391
+
392
+ const result = await Promise.all(promises)
393
+ await this.disconnect()
394
+ return result
395
+ }
396
+
397
+ /**
398
+ * Logs the message.
399
+ *
400
+ * For customized logging, `this.logger` can be overridden in Client constructor.
401
+ *
402
+ * @category Realtime
403
+ */
404
+ log(kind: string, msg: string, data?: any) {
405
+ this.socketAdapter.log(kind, msg, data)
406
+ }
407
+
408
+ /**
409
+ * Returns the current state of the socket.
410
+ *
411
+ * @category Realtime
412
+ */
413
+ connectionState() {
414
+ return this.socketAdapter.connectionState() || CONNECTION_STATE.closed
415
+ }
416
+
417
+ /**
418
+ * Returns `true` is the connection is open.
419
+ *
420
+ * @category Realtime
421
+ */
422
+ isConnected(): boolean {
423
+ return this.socketAdapter.isConnected()
424
+ }
425
+
426
+ /**
427
+ * Returns `true` if the connection is currently connecting.
428
+ *
429
+ * @category Realtime
430
+ */
431
+ isConnecting(): boolean {
432
+ return this.socketAdapter.isConnecting()
433
+ }
434
+
435
+ /**
436
+ * Returns `true` if the connection is currently disconnecting.
437
+ *
438
+ * @category Realtime
439
+ */
440
+ isDisconnecting(): boolean {
441
+ return this.socketAdapter.isDisconnecting()
442
+ }
443
+
444
+ /**
445
+ * Creates (or reuses) a {@link RealtimeChannel} for the provided topic.
446
+ *
447
+ * Topics are automatically prefixed with `realtime:` to match the Realtime service.
448
+ * If a channel with the same topic already exists it will be returned instead of creating
449
+ * a duplicate connection.
450
+ *
451
+ * @category Realtime
452
+ */
453
+ channel(topic: string, params: RealtimeChannelOptions = { config: {} }): RealtimeChannel {
454
+ const realtimeTopic = `realtime:${topic}`
455
+ const exists = this.getChannels().find((c: RealtimeChannel) => c.topic === realtimeTopic)
456
+
457
+ if (!exists) {
458
+ const chan = new RealtimeChannel(`realtime:${topic}`, params, this)
459
+ this._cancelPendingDisconnect()
460
+ this.channels.push(chan)
461
+
462
+ return chan
463
+ } else {
464
+ return exists
465
+ }
466
+ }
467
+
468
+ /**
469
+ * Push out a message if the socket is connected.
470
+ *
471
+ * If the socket is not connected, the message gets enqueued within a local buffer, and sent out when a connection is next established.
472
+ *
473
+ * @category Realtime
474
+ */
475
+ push(data: RealtimeMessage): void {
476
+ this.socketAdapter.push(data)
477
+ }
478
+
479
+ /**
480
+ * Sets the JWT access token used for channel subscription authorization and Realtime RLS.
481
+ *
482
+ * If param is null it will use the `accessToken` callback function or the token set on the client.
483
+ *
484
+ * On callback used, it will set the value of the token internal to the client.
485
+ *
486
+ * When a token is explicitly provided AND no `accessToken` callback is configured,
487
+ * it will be preserved across channel operations (including removeChannel and
488
+ * resubscribe) and the client stays in manual-token mode.
489
+ *
490
+ * When an `accessToken` callback IS configured, the callback is the source of truth:
491
+ * the client remains in callback mode and continues to refresh from it on heartbeat,
492
+ * even after a bootstrap/override `setAuth(token)` call.
493
+ *
494
+ * @param token A JWT string to override the token set on the client.
495
+ *
496
+ * @example Setting the authorization header
497
+ * // Use a manual token (preserved across resubscribes when no accessToken callback is set)
498
+ * client.realtime.setAuth('my-custom-jwt')
499
+ *
500
+ * // Switch back to using the accessToken callback
501
+ * client.realtime.setAuth()
502
+ *
503
+ * @category Realtime
504
+ */
505
+ async setAuth(token: string | null = null): Promise<void> {
506
+ const authGeneration = ++this._authGeneration
507
+ const authPromise = this._performAuth(token, authGeneration)
508
+ if (authGeneration === this._authGeneration) {
509
+ this._authPromise = authPromise
510
+ }
511
+ try {
512
+ await authPromise
513
+ } finally {
514
+ if (this._authPromise === authPromise) {
515
+ this._authPromise = null
516
+ }
517
+ }
518
+ }
519
+
520
+ /**
521
+ * Returns true if the current access token was explicitly set via setAuth(token),
522
+ * false if it was obtained via the accessToken callback.
523
+ * @internal
524
+ */
525
+ _isManualToken(): boolean {
526
+ return this._manuallySetToken
527
+ }
528
+
529
+ /**
530
+ * Sends a heartbeat message if the socket is connected.
531
+ *
532
+ * @category Realtime
533
+ */
534
+ async sendHeartbeat() {
535
+ this.socketAdapter.sendHeartbeat()
536
+ }
537
+
538
+ /**
539
+ * Sets a callback that receives lifecycle events for internal heartbeat messages.
540
+ * Useful for instrumenting connection health (e.g. sent/ok/timeout).
541
+ *
542
+ * @category Realtime
543
+ */
544
+ onHeartbeat(callback: HeartbeatCallback) {
545
+ this.socketAdapter.heartbeatCallback = this._wrapHeartbeatCallback(callback)
546
+ }
547
+
548
+ /**
549
+ * Use either custom fetch, if provided, or default fetch to make HTTP requests
550
+ *
551
+ * @internal
552
+ */
553
+ _resolveFetch = (customFetch?: Fetch): Fetch => {
554
+ if (customFetch) {
555
+ return (...args) => customFetch(...args)
556
+ }
557
+ return (...args) => fetch(...args)
558
+ }
559
+
560
+ /**
561
+ * Return the next message ref, accounting for overflows
562
+ *
563
+ * @internal
564
+ */
565
+ _makeRef(): string {
566
+ return this.socketAdapter.makeRef()
567
+ }
568
+
569
+ /**
570
+ * Removes a channel from RealtimeClient
571
+ *
572
+ * @param channel An open subscription.
573
+ *
574
+ * @internal
575
+ */
576
+ _remove(channel: RealtimeChannel) {
577
+ this.channels = this.channels.filter((c) => c.topic !== channel.topic)
578
+ if (this.channels.length === 0) {
579
+ this.log('transport', 'no channels remaining, scheduling disconnect')
580
+ this._schedulePendingDisconnect()
581
+ }
582
+ }
583
+
584
+ /** @internal */
585
+ private _schedulePendingDisconnect() {
586
+ this._cancelPendingDisconnect()
587
+ if (this._disconnectOnEmptyChannelsAfterMs === 0) {
588
+ this.log('transport', 'disconnecting immediately - no channels')
589
+ this.disconnect()
590
+ return
591
+ }
592
+ this._pendingDisconnectTimer = setTimeout(() => {
593
+ this._pendingDisconnectTimer = null
594
+ if (this.channels.length === 0) {
595
+ this.log('transport', 'deferred disconnect fired - no channels, disconnecting')
596
+ this.disconnect()
597
+ }
598
+ }, this._disconnectOnEmptyChannelsAfterMs)
599
+ this.log(
600
+ 'transport',
601
+ `deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`
602
+ )
603
+ }
604
+
605
+ /** @internal */
606
+ private _cancelPendingDisconnect() {
607
+ if (this._pendingDisconnectTimer !== null) {
608
+ this.log('transport', 'pending disconnect cancelled - channel activity detected')
609
+ clearTimeout(this._pendingDisconnectTimer)
610
+ this._pendingDisconnectTimer = null
611
+ }
612
+ }
613
+
614
+ /**
615
+ * Perform the actual auth operation
616
+ * @internal
617
+ */
618
+ private async _performAuth(token: string | null, authGeneration: number): Promise<void> {
619
+ let tokenToSend: string | null
620
+ let isManualToken = false
621
+
622
+ if (token) {
623
+ tokenToSend = token
624
+ // Track if this is a manually-provided token
625
+ isManualToken = true
626
+ } else if (this.accessToken) {
627
+ // Call the accessToken callback to get fresh token
628
+ try {
629
+ tokenToSend = await this.accessToken()
630
+ } catch (e) {
631
+ this.log('error', 'Error fetching access token from callback', e)
632
+ // Fall back to cached value if callback fails
633
+ tokenToSend = this.accessTokenValue
634
+ }
635
+ } else {
636
+ tokenToSend = this.accessTokenValue
637
+ }
638
+
639
+ if (authGeneration !== this._authGeneration) {
640
+ return
641
+ }
642
+
643
+ // Track whether this token was manually set or fetched via callback.
644
+ // The callback is the source of truth for token refresh
645
+ if (this.accessToken) {
646
+ this._manuallySetToken = false
647
+ } else if (isManualToken) {
648
+ this._manuallySetToken = true
649
+ }
650
+
651
+ if (this.accessTokenValue != tokenToSend) {
652
+ this.accessTokenValue = tokenToSend
653
+ this.channels.forEach((channel) => {
654
+ const payload = {
655
+ access_token: tokenToSend,
656
+ version: DEFAULT_VERSION,
657
+ }
658
+
659
+ channel.updateJoinPayload(payload)
660
+
661
+ if (channel.joinedOnce && channel.channelAdapter.isJoined()) {
662
+ channel.channelAdapter.push(CHANNEL_EVENTS.access_token, {
663
+ access_token: tokenToSend,
664
+ })
665
+ }
666
+ })
667
+ }
668
+ }
669
+
670
+ /**
671
+ * Wait for any in-flight auth operations to complete
672
+ * @internal
673
+ */
674
+ private async _waitForAuthIfNeeded(): Promise<void> {
675
+ if (this._authPromise) {
676
+ await this._authPromise
677
+ }
678
+ }
679
+
680
+ /**
681
+ * Safely call setAuth with standardized error handling
682
+ * @internal
683
+ */
684
+ private _setAuthSafely(context = 'general'): void {
685
+ // Only refresh auth if using callback-based tokens
686
+ if (!this._isManualToken()) {
687
+ this.setAuth().catch((e) => {
688
+ this.log('error', `Error setting auth in ${context}`, e)
689
+ })
690
+ }
691
+ }
692
+
693
+ /** @internal */
694
+ private _setupConnectionHandlers(): void {
695
+ this.socketAdapter.onOpen(() => {
696
+ const authPromise =
697
+ this._authPromise ||
698
+ (this.accessToken && !this.accessTokenValue ? this.setAuth() : Promise.resolve())
699
+
700
+ authPromise.catch((e) => {
701
+ this.log('error', 'error waiting for auth on connect', e)
702
+ })
703
+
704
+ if (this.worker && !this.workerRef) {
705
+ this._startWorkerHeartbeat()
706
+ }
707
+ })
708
+ this.socketAdapter.onClose(() => {
709
+ if (this.worker && this.workerRef) {
710
+ this._terminateWorker()
711
+ }
712
+ })
713
+ this.socketAdapter.onMessage((message: Message<any>) => {
714
+ if (message.ref && message.ref === this._pendingWorkerHeartbeatRef) {
715
+ this._pendingWorkerHeartbeatRef = null
716
+ }
717
+ })
718
+ }
719
+
720
+ /** @internal */
721
+ private _handleNodeJsRaceCondition() {
722
+ if (this.socketAdapter.isConnected()) {
723
+ // hack: ensure onConnOpen is called
724
+ this.socketAdapter.getSocket().onConnOpen()
725
+ }
726
+ }
727
+
728
+ /** @internal */
729
+ private _wrapHeartbeatCallback(heartbeatCallback?: HeartbeatCallback): HeartbeatCallback {
730
+ return (status, latency) => {
731
+ if (status === 'disconnected') return
732
+ if (status == 'sent') this._setAuthSafely()
733
+ if (heartbeatCallback) heartbeatCallback(status, latency)
734
+ }
735
+ }
736
+
737
+ /** @internal */
738
+ private _startWorkerHeartbeat() {
739
+ if (this.workerUrl) {
740
+ this.log('worker', `starting worker for from ${this.workerUrl}`)
741
+ } else {
742
+ this.log('worker', `starting default worker`)
743
+ }
744
+ const objectUrl = this._workerObjectUrl(this.workerUrl!)
745
+ this.workerRef = new Worker(objectUrl)
746
+ this.workerRef.onerror = (error) => {
747
+ this.log('worker', 'worker error', (error as ErrorEvent).message)
748
+ this._terminateWorker()
749
+ this.disconnect()
750
+ }
751
+ this.workerRef.onmessage = (event) => {
752
+ if (event.data.event === 'keepAlive') {
753
+ this.sendHeartbeat()
754
+ }
755
+ }
756
+ this.workerRef.postMessage({
757
+ event: 'start',
758
+ interval: this.heartbeatIntervalMs,
759
+ })
760
+ }
761
+
762
+ /**
763
+ * Terminate the Web Worker and clear the reference
764
+ * @internal
765
+ */
766
+ private _terminateWorker(): void {
767
+ if (this.workerRef) {
768
+ this.log('worker', 'terminating worker')
769
+ this.workerRef.terminate()
770
+ this.workerRef = undefined
771
+ }
772
+ }
773
+
774
+ /** @internal */
775
+ private _workerObjectUrl(url: string | undefined): string {
776
+ let result_url: string
777
+ if (url) {
778
+ result_url = url
779
+ } else {
780
+ const blob = new Blob([WORKER_SCRIPT], { type: 'application/javascript' })
781
+ result_url = URL.createObjectURL(blob)
782
+ }
783
+ return result_url
784
+ }
785
+
786
+ /**
787
+ * Initialize socket options with defaults
788
+ * @internal
789
+ */
790
+ private _initializeOptions(options?: RealtimeClientOptions): SocketOptions {
791
+ this.worker = options?.worker ?? false
792
+ this.accessToken = options?.accessToken ?? null
793
+
794
+ const result: SocketOptions = {}
795
+ result.timeout = options?.timeout ?? DEFAULT_TIMEOUT
796
+ result.heartbeatIntervalMs =
797
+ options?.heartbeatIntervalMs ?? CONNECTION_TIMEOUTS.HEARTBEAT_INTERVAL
798
+
799
+ this._disconnectOnEmptyChannelsAfterMs =
800
+ options?.disconnectOnEmptyChannelsAfterMs ??
801
+ 2 * (options?.heartbeatIntervalMs ?? CONNECTION_TIMEOUTS.HEARTBEAT_INTERVAL)
802
+
803
+ // @ts-ignore - mismatch between phoenix and supabase
804
+ result.transport = options?.transport ?? WebSocketFactory.getWebSocketConstructor()
805
+ result.params = options?.params
806
+ result.logger = options?.logger
807
+ result.heartbeatCallback = this._wrapHeartbeatCallback(options?.heartbeatCallback)
808
+ result.sessionStorage = options?.sessionStorage ?? resolveSessionStorage()
809
+ result.reconnectAfterMs =
810
+ options?.reconnectAfterMs ??
811
+ ((tries: number) => {
812
+ return RECONNECT_INTERVALS[tries - 1] || DEFAULT_RECONNECT_FALLBACK
813
+ })
814
+
815
+ let defaultEncode: Encode<void>
816
+ let defaultDecode: Decode<void>
817
+
818
+ const vsn = options?.vsn ?? DEFAULT_VSN
819
+
820
+ switch (vsn) {
821
+ case VSN_1_0_0:
822
+ defaultEncode = (payload, callback) => {
823
+ return callback(JSON.stringify(payload))
824
+ }
825
+ defaultDecode = (payload, callback) => {
826
+ return callback(JSON.parse(payload as string))
827
+ }
828
+ break
829
+ case VSN_2_0_0:
830
+ defaultEncode = this.serializer.encode.bind(this.serializer)
831
+ defaultDecode = this.serializer.decode.bind(this.serializer)
832
+ break
833
+ default:
834
+ throw new Error(`Unsupported serializer version: ${result.vsn}`)
835
+ }
836
+
837
+ result.vsn = vsn
838
+ result.encode = options?.encode ?? defaultEncode
839
+ result.decode = options?.decode ?? defaultDecode
840
+
841
+ result.beforeReconnect = this._reconnectAuth.bind(this)
842
+
843
+ if (options?.logLevel || options?.log_level) {
844
+ this.logLevel = options.logLevel || options.log_level
845
+ result.params = { ...result.params, log_level: this.logLevel as string }
846
+ }
847
+
848
+ // Handle worker setup
849
+ if (this.worker) {
850
+ if (typeof window !== 'undefined' && !window.Worker) {
851
+ throw new Error('Web Worker is not supported')
852
+ }
853
+ this.workerUrl = options?.workerUrl
854
+ result.autoSendHeartbeat = !this.worker
855
+ }
856
+
857
+ return result
858
+ }
859
+
860
+ /** @internal */
861
+ private async _reconnectAuth() {
862
+ await this._waitForAuthIfNeeded()
863
+ if (!this.isConnected()) {
864
+ this.connect()
865
+ }
866
+ }
867
+ }
node_modules/@supabase/realtime-js/src/RealtimePostgresFilterBuilder.ts ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Comparison operators accepted in a Postgres Changes `filter` string.
3
+ *
4
+ * These mirror the PostgREST operator surface and are evaluated server-side.
5
+ * Any operator can be negated via {@link RealtimePostgresFilterBuilder.not}
6
+ * (the `not.` prefix).
7
+ *
8
+ * This is the subset of PostgREST's `FilterOperator` (see `postgrest-js`) that
9
+ * Realtime Postgres Changes supports. Containment, range and full-text search
10
+ * operators (`cs`, `cd`, `ov`, range ops, `fts`, …) are intentionally not
11
+ * included because the Realtime server does not evaluate them.
12
+ *
13
+ * - `eq`, `neq`, `lt`, `lte`, `gt`, `gte` — comparison
14
+ * - `in` — membership: `status=in.(active,pending)`
15
+ * - `like`, `ilike` — pattern match (case-sensitive / insensitive): `title=like.%foo%`
16
+ * - `is` — `IS` check against `null` / `true` / `false` / `unknown`: `deleted_at=is.null`
17
+ * - `match`, `imatch` — POSIX regex match (`~` / `~*`)
18
+ * - `isdistinct` — NULL-safe inequality (`IS DISTINCT FROM`)
19
+ */
20
+ export type RealtimePostgresChangesFilterOperator =
21
+ | 'eq'
22
+ | 'neq'
23
+ | 'lt'
24
+ | 'lte'
25
+ | 'gt'
26
+ | 'gte'
27
+ | 'in'
28
+ | 'like'
29
+ | 'ilike'
30
+ | 'is'
31
+ | 'match'
32
+ | 'imatch'
33
+ | 'isdistinct'
34
+
35
+ /** Scalar value accepted by a single filter operator. */
36
+ export type RealtimeFilterValue = string | number | boolean | null
37
+
38
+ /** Value accepted by the `is` operator. */
39
+ export type RealtimeIsFilterValue = null | boolean | 'null' | 'true' | 'false' | 'unknown'
40
+
41
+ // Reserved characters that force PostgREST-style quoting: `[,()]` (which the
42
+ // server reads as condition/list delimiters) plus `"`/`\` (escaped inside quotes).
43
+ const PostgrestReservedCharsRegexp = /[,()"\\]/
44
+
45
+ const needsQuoting = (value: string): boolean =>
46
+ PostgrestReservedCharsRegexp.test(value) || value !== value.trim()
47
+
48
+ const quote = (value: string): string => `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`
49
+
50
+ const serializeScalar = (value: RealtimeFilterValue): string => {
51
+ const serialized = value === null ? 'null' : String(value)
52
+ return needsQuoting(serialized) ? quote(serialized) : serialized
53
+ }
54
+
55
+ const serializeIsValue = (value: RealtimeIsFilterValue): string =>
56
+ value === null ? 'null' : String(value)
57
+
58
+ // Builds the `operator.value` portion of a filter (everything after `column=`).
59
+ const serialize = (operator: RealtimePostgresChangesFilterOperator, value: unknown): string => {
60
+ if (operator === 'in') {
61
+ const values = Array.isArray(value) ? value : [value]
62
+ if (values.length === 0) {
63
+ throw new Error('Realtime `in` filter requires at least one value.')
64
+ }
65
+ const items = Array.from(new Set(values))
66
+ .map((v) => serializeScalar(v as RealtimeFilterValue))
67
+ .join(',')
68
+ return `in.(${items})`
69
+ }
70
+
71
+ if (operator === 'is') {
72
+ return `is.${serializeIsValue(value as RealtimeIsFilterValue)}`
73
+ }
74
+
75
+ return `${operator}.${serializeScalar(value as RealtimeFilterValue)}`
76
+ }
77
+
78
+ /**
79
+ * Fluent builder for Postgres Changes `filter` strings.
80
+ *
81
+ * Each method appends a single `column=operator.value` condition. Multiple
82
+ * conditions are combined with commas, which the Realtime server applies as an
83
+ * `AND`. Pass an instance straight to `channel.on('postgres_changes', …)` — the
84
+ * SDK serializes it to a string automatically — or call {@link build} to obtain
85
+ * the string yourself.
86
+ *
87
+ * The builder mirrors the `postgrest-js` filter API (`eq`, `neq`, `in`, `like`,
88
+ * `not`, …) for the operators that Realtime supports. Values containing reserved
89
+ * characters (`,`, `(`, `)`, `"`, `\`) — or surrounding whitespace — are
90
+ * automatically double-quoted and escaped the same way PostgREST does, so they
91
+ * survive the server's filter parser; all other values are sent verbatim.
92
+ *
93
+ * The filter is snapshotted when passed to `channel.on(...)`; mutating the
94
+ * builder afterwards does not affect an existing subscription. An empty builder
95
+ * serializes to `''`, which the server treats as "no filter".
96
+ *
97
+ * @example
98
+ * channel.on('postgres_changes', {
99
+ * event: '*',
100
+ * schema: 'public',
101
+ * table: 'users',
102
+ * filter: postgresChangesFilter().eq('id', 1).lt('age', 30), // → 'id=eq.1,age=lt.30'
103
+ * }, (payload) => { ... })
104
+ */
105
+ export class RealtimePostgresFilterBuilder {
106
+ private readonly filters: string[] = []
107
+
108
+ private add(
109
+ column: string,
110
+ operator: RealtimePostgresChangesFilterOperator,
111
+ value: unknown,
112
+ negate = false
113
+ ): this {
114
+ const prefix = negate ? 'not.' : ''
115
+ this.filters.push(`${column}=${prefix}${serialize(operator, value)}`)
116
+ return this
117
+ }
118
+
119
+ /** Match rows where `column` equals `value` (`column=eq.value`). */
120
+ eq(column: string, value: RealtimeFilterValue): this {
121
+ return this.add(column, 'eq', value)
122
+ }
123
+
124
+ /** Match rows where `column` does not equal `value` (`column=neq.value`). */
125
+ neq(column: string, value: RealtimeFilterValue): this {
126
+ return this.add(column, 'neq', value)
127
+ }
128
+
129
+ /** Match rows where `column` is greater than `value` (`column=gt.value`). */
130
+ gt(column: string, value: RealtimeFilterValue): this {
131
+ return this.add(column, 'gt', value)
132
+ }
133
+
134
+ /** Match rows where `column` is greater than or equal to `value` (`column=gte.value`). */
135
+ gte(column: string, value: RealtimeFilterValue): this {
136
+ return this.add(column, 'gte', value)
137
+ }
138
+
139
+ /** Match rows where `column` is less than `value` (`column=lt.value`). */
140
+ lt(column: string, value: RealtimeFilterValue): this {
141
+ return this.add(column, 'lt', value)
142
+ }
143
+
144
+ /** Match rows where `column` is less than or equal to `value` (`column=lte.value`). */
145
+ lte(column: string, value: RealtimeFilterValue): this {
146
+ return this.add(column, 'lte', value)
147
+ }
148
+
149
+ /**
150
+ * Match rows where `column` is one of `values` (`column=in.(a,b,c)`).
151
+ * Requires at least one value; duplicates are removed. An element containing a
152
+ * reserved character is double-quoted (`in.("a,b",c)`), so commas inside an
153
+ * element are preserved. `null` is intentionally not accepted (`IN (null)`
154
+ * never matches in SQL) — use `is`/`not('col','is',null)` for null checks.
155
+ */
156
+ in(column: string, values: ReadonlyArray<string | number | boolean>): this {
157
+ return this.add(column, 'in', values)
158
+ }
159
+
160
+ /** Match rows where `column` matches the case-sensitive `pattern` (`column=like.pattern`). */
161
+ like(column: string, pattern: string): this {
162
+ return this.add(column, 'like', pattern)
163
+ }
164
+
165
+ /** Match rows where `column` matches the case-insensitive `pattern` (`column=ilike.pattern`). */
166
+ ilike(column: string, pattern: string): this {
167
+ return this.add(column, 'ilike', pattern)
168
+ }
169
+
170
+ /** Match rows where `column` matches the POSIX regex `pattern` (`column=match.pattern`). */
171
+ match(column: string, pattern: string): this {
172
+ return this.add(column, 'match', pattern)
173
+ }
174
+
175
+ /** Match rows where `column` matches the case-insensitive POSIX regex `pattern` (`column=imatch.pattern`). */
176
+ imatch(column: string, pattern: string): this {
177
+ return this.add(column, 'imatch', pattern)
178
+ }
179
+
180
+ /**
181
+ * Match rows where `column` `IS` the given value (`column=is.null`).
182
+ * Accepts `null`, a boolean, or the keywords `'null' | 'true' | 'false' | 'unknown'`.
183
+ */
184
+ is(column: string, value: RealtimeIsFilterValue): this {
185
+ return this.add(column, 'is', value)
186
+ }
187
+
188
+ /** Match rows where `column` is distinct from `value` (`column=isdistinct.value`). NULL-safe inequality. */
189
+ isDistinct(column: string, value: RealtimeFilterValue): this {
190
+ return this.add(column, 'isdistinct', value)
191
+ }
192
+
193
+ /**
194
+ * Negate any operator with the `not.` prefix (`column=not.operator.value`).
195
+ * `in` takes an array, `is` takes an `IS` keyword/boolean/null, and every
196
+ * other operator takes a scalar value.
197
+ *
198
+ * @example
199
+ * postgresChangesFilter().not('status', 'in', ['draft', 'archived'])
200
+ * // → status=not.in.(draft,archived)
201
+ * postgresChangesFilter().not('deleted_at', 'is', null)
202
+ * // → deleted_at=not.is.null
203
+ */
204
+ not(column: string, operator: 'in', value: ReadonlyArray<string | number | boolean>): this
205
+ not(column: string, operator: 'is', value: RealtimeIsFilterValue): this
206
+ not(
207
+ column: string,
208
+ operator: Exclude<RealtimePostgresChangesFilterOperator, 'in' | 'is'>,
209
+ value: RealtimeFilterValue
210
+ ): this
211
+ not(
212
+ column: string,
213
+ operator: RealtimePostgresChangesFilterOperator,
214
+ value: RealtimeFilterValue | ReadonlyArray<string | number | boolean>
215
+ ): this {
216
+ return this.add(column, operator, value, true)
217
+ }
218
+
219
+ /**
220
+ * Serialize all conditions into the comma-separated (AND) filter string.
221
+ *
222
+ * Conditions are joined by commas, which the server applies as `AND`. A scalar
223
+ * value (or single `in` element) that contains a reserved character — `,`,
224
+ * `(`, `)`, `"`, `\` — or surrounding whitespace is double-quoted and escaped
225
+ * the way PostgREST does, so commas inside a value are preserved rather than
226
+ * read as a condition boundary.
227
+ */
228
+ build(): string {
229
+ return this.filters.join(',')
230
+ }
231
+
232
+ /** Alias for {@link build}; lets the builder be used wherever a string is expected. */
233
+ toString(): string {
234
+ return this.build()
235
+ }
236
+ }
237
+
238
+ /**
239
+ * Create a {@link RealtimePostgresFilterBuilder} for composing a Postgres
240
+ * Changes `filter`. Conditions are combined with `AND`.
241
+ *
242
+ * @example
243
+ * import { postgresChangesFilter } from '@supabase/realtime-js'
244
+ *
245
+ * channel.on('postgres_changes', {
246
+ * event: 'UPDATE',
247
+ * schema: 'public',
248
+ * table: 'orders',
249
+ * filter: postgresChangesFilter().gt('amount', 100).eq('status', 'open'),
250
+ * }, (payload) => { ... })
251
+ */
252
+ export const postgresChangesFilter = (): RealtimePostgresFilterBuilder =>
253
+ new RealtimePostgresFilterBuilder()
node_modules/@supabase/realtime-js/src/RealtimePresence.ts ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ This file draws heavily from https://github.com/phoenixframework/phoenix/blob/d344ec0a732ab4ee204215b31de69cf4be72e3bf/assets/js/phoenix/presence.js
3
+ License: https://github.com/phoenixframework/phoenix/blob/d344ec0a732ab4ee204215b31de69cf4be72e3bf/LICENSE.md
4
+ */
5
+
6
+ import type RealtimeChannel from './RealtimeChannel'
7
+ import PresenceAdapter from './phoenix/presenceAdapter'
8
+
9
+ export type Presence<T extends { [key: string]: any } = {}> = {
10
+ presence_ref: string
11
+ } & T
12
+
13
+ export type RealtimePresenceState<T extends { [key: string]: any } = {}> = {
14
+ [key: string]: Presence<T>[]
15
+ }
16
+
17
+ export type RealtimePresenceJoinPayload<T extends { [key: string]: any }> = {
18
+ event: `${REALTIME_PRESENCE_LISTEN_EVENTS.JOIN}`
19
+ key: string
20
+ currentPresences: Presence<T>[]
21
+ newPresences: Presence<T>[]
22
+ }
23
+
24
+ export type RealtimePresenceLeavePayload<T extends { [key: string]: any }> = {
25
+ event: `${REALTIME_PRESENCE_LISTEN_EVENTS.LEAVE}`
26
+ key: string
27
+ currentPresences: Presence<T>[]
28
+ leftPresences: Presence<T>[]
29
+ }
30
+
31
+ export enum REALTIME_PRESENCE_LISTEN_EVENTS {
32
+ SYNC = 'sync',
33
+ JOIN = 'join',
34
+ LEAVE = 'leave',
35
+ }
36
+
37
+ export type RealtimePresenceOptions = {
38
+ events?: { state: string; diff: string }
39
+ }
40
+
41
+ export default class RealtimePresence {
42
+ get state() {
43
+ return this.presenceAdapter.state
44
+ }
45
+
46
+ private presenceAdapter: PresenceAdapter
47
+
48
+ /**
49
+ * Creates a Presence helper that keeps the local presence state in sync with the server.
50
+ *
51
+ * @param channel - The realtime channel to bind to.
52
+ * @param opts - Optional custom event names, e.g. `{ events: { state: 'state', diff: 'diff' } }`.
53
+ *
54
+ * @category Realtime
55
+ *
56
+ * @example Example for a presence channel
57
+ * ```ts
58
+ * const presence = new RealtimePresence(channel)
59
+ *
60
+ * channel.on('presence', ({ event, key }) => {
61
+ * console.log(`Presence ${event} on ${key}`)
62
+ * })
63
+ * ```
64
+ */
65
+ constructor(
66
+ public channel: RealtimeChannel,
67
+ opts?: RealtimePresenceOptions
68
+ ) {
69
+ this.presenceAdapter = new PresenceAdapter(this.channel.channelAdapter, opts)
70
+ }
71
+ }
node_modules/@supabase/realtime-js/src/index.ts ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import RealtimeClient, {
2
+ RealtimeClientOptions,
3
+ RealtimeMessage,
4
+ RealtimeRemoveChannelResponse,
5
+ WebSocketLikeConstructor,
6
+ } from './RealtimeClient'
7
+ import RealtimeChannel, {
8
+ RealtimeChannelOptions,
9
+ RealtimeChannelSendResponse,
10
+ RealtimePostgresChangesFilter,
11
+ RealtimePostgresChangesFilterOperator,
12
+ RealtimePostgresFilterBuilder,
13
+ postgresChangesFilter,
14
+ RealtimePostgresChangesPayload,
15
+ RealtimePostgresInsertPayload,
16
+ RealtimePostgresUpdatePayload,
17
+ RealtimePostgresDeletePayload,
18
+ RealtimeSystemPayload,
19
+ REALTIME_LISTEN_TYPES,
20
+ REALTIME_POSTGRES_CHANGES_LISTEN_EVENT,
21
+ REALTIME_SUBSCRIBE_STATES,
22
+ REALTIME_CHANNEL_STATES,
23
+ } from './RealtimeChannel'
24
+ import RealtimePresence, {
25
+ RealtimePresenceState,
26
+ RealtimePresenceJoinPayload,
27
+ RealtimePresenceLeavePayload,
28
+ REALTIME_PRESENCE_LISTEN_EVENTS,
29
+ } from './RealtimePresence'
30
+ import WebSocketFactory, { WebSocketLike } from './lib/websocket-factory'
31
+
32
+ export {
33
+ RealtimePresence,
34
+ RealtimeChannel,
35
+ RealtimeChannelOptions,
36
+ RealtimeChannelSendResponse,
37
+ RealtimeClient,
38
+ RealtimeClientOptions,
39
+ RealtimeMessage,
40
+ RealtimePostgresChangesFilter,
41
+ RealtimePostgresChangesFilterOperator,
42
+ RealtimePostgresFilterBuilder,
43
+ postgresChangesFilter,
44
+ RealtimePostgresChangesPayload,
45
+ RealtimePostgresInsertPayload,
46
+ RealtimePostgresUpdatePayload,
47
+ RealtimePostgresDeletePayload,
48
+ RealtimeSystemPayload,
49
+ RealtimePresenceJoinPayload,
50
+ RealtimePresenceLeavePayload,
51
+ RealtimePresenceState,
52
+ RealtimeRemoveChannelResponse,
53
+ REALTIME_LISTEN_TYPES,
54
+ REALTIME_POSTGRES_CHANGES_LISTEN_EVENT,
55
+ REALTIME_PRESENCE_LISTEN_EVENTS,
56
+ REALTIME_SUBSCRIBE_STATES,
57
+ REALTIME_CHANNEL_STATES,
58
+ WebSocketFactory,
59
+ WebSocketLike,
60
+ WebSocketLikeConstructor,
61
+ }
node_modules/@supabase/realtime-js/src/lib/constants.ts ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { version } from './version'
2
+ import type {
3
+ SocketState,
4
+ ChannelState,
5
+ ChannelEvent as PhoenixChannelEvent,
6
+ Transport,
7
+ Vsn,
8
+ } from '../phoenix/types'
9
+
10
+ export type { SocketState, ChannelState, Transport }
11
+
12
+ export const DEFAULT_VERSION = `realtime-js/${version}`
13
+
14
+ export const VSN_1_0_0: Vsn = '1.0.0'
15
+ export const VSN_2_0_0: Vsn = '2.0.0'
16
+ export const DEFAULT_VSN: Vsn = VSN_2_0_0
17
+
18
+ export const VERSION = version
19
+
20
+ export const DEFAULT_TIMEOUT = 10000
21
+
22
+ export const WS_CLOSE_NORMAL = 1000
23
+ export const MAX_PUSH_BUFFER_SIZE = 100
24
+
25
+ export const SOCKET_STATES = {
26
+ connecting: 0,
27
+ open: 1,
28
+ closing: 2,
29
+ closed: 3,
30
+ } as const
31
+
32
+ export const CHANNEL_STATES = {
33
+ closed: 'closed',
34
+ errored: 'errored',
35
+ joined: 'joined',
36
+ joining: 'joining',
37
+ leaving: 'leaving',
38
+ } as const
39
+
40
+ export type ChannelEvent = PhoenixChannelEvent | 'access_token'
41
+
42
+ export const CHANNEL_EVENTS = {
43
+ close: 'phx_close',
44
+ error: 'phx_error',
45
+ join: 'phx_join',
46
+ reply: 'phx_reply',
47
+ leave: 'phx_leave',
48
+ access_token: 'access_token',
49
+ } as const
50
+
51
+ export const TRANSPORTS = {
52
+ websocket: 'websocket',
53
+ } as const
54
+
55
+ export type ConnectionState = 'connecting' | 'open' | 'closing' | 'closed' | (string & {})
56
+
57
+ export const CONNECTION_STATE = {
58
+ connecting: 'connecting',
59
+ open: 'open',
60
+ closing: 'closing',
61
+ closed: 'closed',
62
+ } as const
node_modules/@supabase/realtime-js/src/lib/normalizeChannelError.ts ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Normalize the various shapes a channel error reason can take into a real `Error`.
3
+ *
4
+ * Transport-level channel errors arrive as a `CloseEvent`, a transport `Event`, an `Error`,
5
+ * a string, or `undefined` depending on which path in the underlying socket fired. Server-reply
6
+ * errors arrive as a payload object. This helper produces a consistent `Error` for every case
7
+ * and preserves the original via `cause` so callers can still inspect the raw event.
8
+ */
9
+ export function normalizeChannelError(reason: unknown): Error {
10
+ if (reason instanceof Error) {
11
+ return reason
12
+ }
13
+
14
+ if (typeof reason === 'string') {
15
+ return new Error(reason)
16
+ }
17
+
18
+ if (reason && typeof reason === 'object') {
19
+ const obj = reason as Record<string, unknown>
20
+
21
+ if (typeof obj.code === 'number') {
22
+ const detail = typeof obj.reason === 'string' && obj.reason ? ` (${obj.reason})` : ''
23
+ return new Error(`socket closed: ${obj.code}${detail}`, { cause: reason })
24
+ }
25
+
26
+ return new Error('channel error: transport failure', { cause: reason })
27
+ }
28
+
29
+ return new Error('channel error: connection lost')
30
+ }
node_modules/@supabase/realtime-js/src/lib/serializer.ts ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This file draws heavily from https://github.com/phoenixframework/phoenix/commit/cf098e9cf7a44ee6479d31d911a97d3c7430c6fe
2
+ // License: https://github.com/phoenixframework/phoenix/blob/master/LICENSE.md
3
+ export type Msg<T> = {
4
+ join_ref?: string | null
5
+ ref?: string | null
6
+ topic: string
7
+ event: string
8
+ payload: T
9
+ }
10
+
11
+ export default class Serializer {
12
+ HEADER_LENGTH = 1
13
+ USER_BROADCAST_PUSH_META_LENGTH = 6
14
+ KINDS = { userBroadcastPush: 3, userBroadcast: 4 }
15
+ BINARY_ENCODING = 0
16
+ JSON_ENCODING = 1
17
+ BROADCAST_EVENT = 'broadcast'
18
+
19
+ allowedMetadataKeys: string[] = []
20
+
21
+ constructor(allowedMetadataKeys?: string[] | null) {
22
+ this.allowedMetadataKeys = allowedMetadataKeys ?? []
23
+ }
24
+
25
+ encode(msg: Msg<{ [key: string]: any }>, callback: (result: ArrayBuffer | string) => any) {
26
+ if (
27
+ msg.event === this.BROADCAST_EVENT &&
28
+ !(msg.payload instanceof ArrayBuffer) &&
29
+ typeof msg.payload.event === 'string'
30
+ ) {
31
+ return callback(
32
+ this._binaryEncodeUserBroadcastPush(msg as Msg<{ event: string } & { [key: string]: any }>)
33
+ )
34
+ }
35
+
36
+ let payload = [msg.join_ref, msg.ref, msg.topic, msg.event, msg.payload]
37
+ return callback(JSON.stringify(payload))
38
+ }
39
+
40
+ private _binaryEncodeUserBroadcastPush(message: Msg<{ event: string } & { [key: string]: any }>) {
41
+ if (this._isArrayBuffer(message.payload?.payload)) {
42
+ return this._encodeBinaryUserBroadcastPush(message)
43
+ } else {
44
+ return this._encodeJsonUserBroadcastPush(message)
45
+ }
46
+ }
47
+
48
+ private _encodeBinaryUserBroadcastPush(message: Msg<{ event: string } & { [key: string]: any }>) {
49
+ const userPayload = message.payload?.payload ?? new ArrayBuffer(0)
50
+ return this._encodeUserBroadcastPush(message, this.BINARY_ENCODING, userPayload)
51
+ }
52
+
53
+ private _encodeJsonUserBroadcastPush(message: Msg<{ event: string } & { [key: string]: any }>) {
54
+ const userPayload = message.payload?.payload ?? {}
55
+ const encoder = new TextEncoder()
56
+ const encodedUserPayload = encoder.encode(JSON.stringify(userPayload)).buffer
57
+ return this._encodeUserBroadcastPush(message, this.JSON_ENCODING, encodedUserPayload)
58
+ }
59
+
60
+ private _encodeUserBroadcastPush(
61
+ message: Msg<{ event: string } & { [key: string]: any }>,
62
+ encodingType: number,
63
+ encodedPayload: ArrayBuffer
64
+ ) {
65
+ // Encode each header field as UTF-8. The length prefixes are byte counts and
66
+ // the decode side uses TextDecoder (UTF-8), so measuring with String.length
67
+ // and writing with charCodeAt would corrupt any multi-byte character (e.g.
68
+ // accents or emoji) and desynchronize the buffer.
69
+ const encoder = new TextEncoder()
70
+ const topic = encoder.encode(message.topic)
71
+ const ref = encoder.encode(message.ref ?? '')
72
+ const joinRef = encoder.encode(message.join_ref ?? '')
73
+ const userEvent = encoder.encode(message.payload.event)
74
+
75
+ // Filter metadata based on allowed keys
76
+ const rest = this.allowedMetadataKeys
77
+ ? this._pick(message.payload, this.allowedMetadataKeys)
78
+ : {}
79
+
80
+ const metadata = encoder.encode(Object.keys(rest).length === 0 ? '' : JSON.stringify(rest))
81
+
82
+ // Validate byte lengths don't exceed uint8 max value (255)
83
+ if (joinRef.length > 255) {
84
+ throw new Error(`joinRef length ${joinRef.length} exceeds maximum of 255`)
85
+ }
86
+ if (ref.length > 255) {
87
+ throw new Error(`ref length ${ref.length} exceeds maximum of 255`)
88
+ }
89
+ if (topic.length > 255) {
90
+ throw new Error(`topic length ${topic.length} exceeds maximum of 255`)
91
+ }
92
+ if (userEvent.length > 255) {
93
+ throw new Error(`userEvent length ${userEvent.length} exceeds maximum of 255`)
94
+ }
95
+ if (metadata.length > 255) {
96
+ throw new Error(`metadata length ${metadata.length} exceeds maximum of 255`)
97
+ }
98
+
99
+ const metaLength =
100
+ this.USER_BROADCAST_PUSH_META_LENGTH +
101
+ joinRef.length +
102
+ ref.length +
103
+ topic.length +
104
+ userEvent.length +
105
+ metadata.length
106
+
107
+ const header = new ArrayBuffer(this.HEADER_LENGTH + metaLength)
108
+ const view = new DataView(header)
109
+ const bytes = new Uint8Array(header)
110
+ let offset = 0
111
+
112
+ view.setUint8(offset++, this.KINDS.userBroadcastPush) // kind
113
+ view.setUint8(offset++, joinRef.length)
114
+ view.setUint8(offset++, ref.length)
115
+ view.setUint8(offset++, topic.length)
116
+ view.setUint8(offset++, userEvent.length)
117
+ view.setUint8(offset++, metadata.length)
118
+ view.setUint8(offset++, encodingType)
119
+ bytes.set(joinRef, offset)
120
+ offset += joinRef.length
121
+ bytes.set(ref, offset)
122
+ offset += ref.length
123
+ bytes.set(topic, offset)
124
+ offset += topic.length
125
+ bytes.set(userEvent, offset)
126
+ offset += userEvent.length
127
+ bytes.set(metadata, offset)
128
+ offset += metadata.length
129
+
130
+ var combined = new Uint8Array(header.byteLength + encodedPayload.byteLength)
131
+ combined.set(new Uint8Array(header), 0)
132
+ combined.set(new Uint8Array(encodedPayload), header.byteLength)
133
+
134
+ return combined.buffer
135
+ }
136
+
137
+ decode(rawPayload: ArrayBuffer | string, callback: Function) {
138
+ if (this._isArrayBuffer(rawPayload)) {
139
+ let result = this._binaryDecode(rawPayload as ArrayBuffer)
140
+ return callback(result)
141
+ }
142
+
143
+ if (typeof rawPayload === 'string') {
144
+ const jsonPayload = JSON.parse(rawPayload)
145
+ const [join_ref, ref, topic, event, payload] = jsonPayload
146
+ return callback({ join_ref, ref, topic, event, payload })
147
+ }
148
+
149
+ return callback({})
150
+ }
151
+
152
+ private _binaryDecode(buffer: ArrayBuffer) {
153
+ const view = new DataView(buffer)
154
+ const kind = view.getUint8(0)
155
+ const decoder = new TextDecoder()
156
+ switch (kind) {
157
+ case this.KINDS.userBroadcast:
158
+ return this._decodeUserBroadcast(buffer, view, decoder)
159
+ }
160
+ }
161
+
162
+ private _decodeUserBroadcast(
163
+ buffer: ArrayBuffer,
164
+ view: DataView,
165
+ decoder: TextDecoder
166
+ ): {
167
+ join_ref: null
168
+ ref: null
169
+ topic: string
170
+ event: string
171
+ payload: { [key: string]: any }
172
+ } {
173
+ const topicSize = view.getUint8(1)
174
+ const userEventSize = view.getUint8(2)
175
+ const metadataSize = view.getUint8(3)
176
+ const payloadEncoding = view.getUint8(4)
177
+
178
+ let offset = this.HEADER_LENGTH + 4
179
+ const topic = decoder.decode(buffer.slice(offset, offset + topicSize))
180
+ offset = offset + topicSize
181
+ const userEvent = decoder.decode(buffer.slice(offset, offset + userEventSize))
182
+ offset = offset + userEventSize
183
+ const metadata = decoder.decode(buffer.slice(offset, offset + metadataSize))
184
+ offset = offset + metadataSize
185
+
186
+ const payload = buffer.slice(offset, buffer.byteLength)
187
+ const parsedPayload =
188
+ payloadEncoding === this.JSON_ENCODING ? JSON.parse(decoder.decode(payload)) : payload
189
+
190
+ const data: { [key: string]: any } = {
191
+ type: this.BROADCAST_EVENT,
192
+ event: userEvent,
193
+ payload: parsedPayload,
194
+ }
195
+
196
+ // Metadata is optional and always JSON encoded
197
+ if (metadataSize > 0) {
198
+ data['meta'] = JSON.parse(metadata)
199
+ }
200
+
201
+ return { join_ref: null, ref: null, topic: topic, event: this.BROADCAST_EVENT, payload: data }
202
+ }
203
+
204
+ private _isArrayBuffer(buffer: any): boolean {
205
+ return buffer instanceof ArrayBuffer || buffer?.constructor?.name === 'ArrayBuffer'
206
+ }
207
+
208
+ private _pick(obj: Record<string, any> | null | undefined, keys: string[]): Record<string, any> {
209
+ if (!obj || typeof obj !== 'object') {
210
+ return {}
211
+ }
212
+ return Object.fromEntries(Object.entries(obj).filter(([key]) => keys.includes(key)))
213
+ }
214
+ }
node_modules/@supabase/realtime-js/src/lib/transformers.ts ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Helpers to convert the change Payload into native JS types.
3
+ */
4
+
5
+ // Adapted from epgsql (src/epgsql_binary.erl), this module licensed under
6
+ // 3-clause BSD found here: https://raw.githubusercontent.com/epgsql/epgsql/devel/LICENSE
7
+
8
+ export enum PostgresTypes {
9
+ abstime = 'abstime',
10
+ bool = 'bool',
11
+ date = 'date',
12
+ daterange = 'daterange',
13
+ float4 = 'float4',
14
+ float8 = 'float8',
15
+ int2 = 'int2',
16
+ int4 = 'int4',
17
+ int4range = 'int4range',
18
+ int8 = 'int8',
19
+ int8range = 'int8range',
20
+ json = 'json',
21
+ jsonb = 'jsonb',
22
+ money = 'money',
23
+ numeric = 'numeric',
24
+ oid = 'oid',
25
+ reltime = 'reltime',
26
+ text = 'text',
27
+ time = 'time',
28
+ timestamp = 'timestamp',
29
+ timestamptz = 'timestamptz',
30
+ timetz = 'timetz',
31
+ tsrange = 'tsrange',
32
+ tstzrange = 'tstzrange',
33
+ }
34
+
35
+ type Columns = {
36
+ name: string // the column name. eg: "user_id"
37
+ type: string // the column type. eg: "uuid"
38
+ flags?: string[] // any special flags for the column. eg: ["key"]
39
+ type_modifier?: number // the type modifier. eg: 4294967295
40
+ }[]
41
+
42
+ type BaseValue = null | string | number | boolean
43
+ type RecordValue = BaseValue | BaseValue[]
44
+
45
+ type Record = {
46
+ [key: string]: RecordValue
47
+ }
48
+
49
+ /**
50
+ * Takes an array of columns and an object of string values then converts each string value
51
+ * to its mapped type.
52
+ *
53
+ * @param {{name: String, type: String}[]} columns
54
+ * @param {Object} record
55
+ * @param {Object} options The map of various options that can be applied to the mapper
56
+ * @param {Array} options.skipTypes The array of types that should not be converted
57
+ *
58
+ * @example convertChangeData([{name: 'first_name', type: 'text'}, {name: 'age', type: 'int4'}], {first_name: 'Paul', age:'33'}, {})
59
+ * //=>{ first_name: 'Paul', age: 33 }
60
+ */
61
+ export const convertChangeData = (
62
+ columns: Columns,
63
+ record: Record | null,
64
+ options: { skipTypes?: string[] } = {}
65
+ ): Record => {
66
+ const skipTypes = options.skipTypes ?? []
67
+
68
+ if (!record) {
69
+ return {}
70
+ }
71
+
72
+ return Object.keys(record).reduce((acc, rec_key) => {
73
+ acc[rec_key] = convertColumn(rec_key, columns, record, skipTypes)
74
+ return acc
75
+ }, {} as Record)
76
+ }
77
+
78
+ /**
79
+ * Converts the value of an individual column.
80
+ *
81
+ * @param {String} columnName The column that you want to convert
82
+ * @param {{name: String, type: String}[]} columns All of the columns
83
+ * @param {Object} record The map of string values
84
+ * @param {Array} skipTypes An array of types that should not be converted
85
+ * @return {object} Useless information
86
+ *
87
+ * @example convertColumn('age', [{name: 'first_name', type: 'text'}, {name: 'age', type: 'int4'}], {first_name: 'Paul', age: '33'}, [])
88
+ * //=> 33
89
+ * @example convertColumn('age', [{name: 'first_name', type: 'text'}, {name: 'age', type: 'int4'}], {first_name: 'Paul', age: '33'}, ['int4'])
90
+ * //=> "33"
91
+ */
92
+ export const convertColumn = (
93
+ columnName: string,
94
+ columns: Columns,
95
+ record: Record,
96
+ skipTypes: string[]
97
+ ): RecordValue => {
98
+ const column = columns.find((x) => x.name === columnName)
99
+ const colType = column?.type
100
+ const value = record[columnName]
101
+
102
+ if (colType && !skipTypes.includes(colType)) {
103
+ return convertCell(colType, value)
104
+ }
105
+
106
+ return noop(value)
107
+ }
108
+
109
+ /**
110
+ * If the value of the cell is `null`, returns null.
111
+ * Otherwise converts the string value to the correct type.
112
+ * @param {String} type A postgres column type
113
+ * @param {String} value The cell value
114
+ *
115
+ * @example convertCell('bool', 't')
116
+ * //=> true
117
+ * @example convertCell('int8', '10')
118
+ * //=> 10
119
+ * @example convertCell('_int4', '{1,2,3,4}')
120
+ * //=> [1,2,3,4]
121
+ */
122
+ export const convertCell = (type: string, value: RecordValue): RecordValue => {
123
+ // if data type is an array
124
+ if (type.charAt(0) === '_') {
125
+ const dataType = type.slice(1, type.length)
126
+ return toArray(value, dataType)
127
+ }
128
+
129
+ // If not null, convert to correct type.
130
+ switch (type) {
131
+ case PostgresTypes.bool:
132
+ return toBoolean(value)
133
+ case PostgresTypes.float4:
134
+ case PostgresTypes.float8:
135
+ case PostgresTypes.int2:
136
+ case PostgresTypes.int4:
137
+ case PostgresTypes.int8:
138
+ case PostgresTypes.numeric:
139
+ case PostgresTypes.oid:
140
+ return toNumber(value)
141
+ case PostgresTypes.json:
142
+ case PostgresTypes.jsonb:
143
+ return toJson(value)
144
+ case PostgresTypes.timestamp:
145
+ return toTimestampString(value) // Format to be consistent with PostgREST
146
+ case PostgresTypes.abstime: // To allow users to cast it based on Timezone
147
+ case PostgresTypes.date: // To allow users to cast it based on Timezone
148
+ case PostgresTypes.daterange:
149
+ case PostgresTypes.int4range:
150
+ case PostgresTypes.int8range:
151
+ case PostgresTypes.money:
152
+ case PostgresTypes.reltime: // To allow users to cast it based on Timezone
153
+ case PostgresTypes.text:
154
+ case PostgresTypes.time: // To allow users to cast it based on Timezone
155
+ case PostgresTypes.timestamptz: // To allow users to cast it based on Timezone
156
+ case PostgresTypes.timetz: // To allow users to cast it based on Timezone
157
+ case PostgresTypes.tsrange:
158
+ case PostgresTypes.tstzrange:
159
+ return noop(value)
160
+ default:
161
+ // Return the value for remaining types
162
+ return noop(value)
163
+ }
164
+ }
165
+
166
+ const noop = (value: RecordValue): RecordValue => {
167
+ return value
168
+ }
169
+ export const toBoolean = (value: RecordValue): RecordValue => {
170
+ switch (value) {
171
+ case 't':
172
+ return true
173
+ case 'f':
174
+ return false
175
+ default:
176
+ return value
177
+ }
178
+ }
179
+ export const toNumber = (value: RecordValue): RecordValue => {
180
+ if (typeof value === 'string') {
181
+ const parsedValue = parseFloat(value)
182
+ if (!Number.isNaN(parsedValue)) {
183
+ return parsedValue
184
+ }
185
+ }
186
+ return value
187
+ }
188
+ export const toJson = (value: RecordValue): RecordValue => {
189
+ if (typeof value === 'string') {
190
+ try {
191
+ return JSON.parse(value)
192
+ } catch {
193
+ return value
194
+ }
195
+ }
196
+ return value
197
+ }
198
+
199
+ /**
200
+ * Converts a Postgres Array into a native JS array
201
+ *
202
+ * @example toArray('{}', 'int4')
203
+ * //=> []
204
+ * @example toArray('{"[2021-01-01,2021-12-31)","(2021-01-01,2021-12-32]"}', 'daterange')
205
+ * //=> ['[2021-01-01,2021-12-31)', '(2021-01-01,2021-12-32]']
206
+ * @example toArray([1,2,3,4], 'int4')
207
+ * //=> [1,2,3,4]
208
+ */
209
+ export const toArray = (value: RecordValue, type: string): RecordValue => {
210
+ if (typeof value !== 'string') {
211
+ return value
212
+ }
213
+
214
+ const lastIdx = value.length - 1
215
+ const closeBrace = value[lastIdx]
216
+ const openBrace = value[0]
217
+
218
+ // Confirm value is a Postgres array by checking curly brackets
219
+ if (openBrace === '{' && closeBrace === '}') {
220
+ let arr
221
+ const valTrim = value.slice(1, lastIdx)
222
+
223
+ // TODO: find a better solution to separate Postgres array data
224
+ try {
225
+ arr = JSON.parse('[' + valTrim + ']')
226
+ } catch (_) {
227
+ // WARNING: splitting on comma does not cover all edge cases
228
+ arr = valTrim ? valTrim.split(',') : []
229
+ }
230
+
231
+ return arr.map((val: BaseValue) => convertCell(type, val))
232
+ }
233
+
234
+ return value
235
+ }
236
+
237
+ /**
238
+ * Fixes timestamp to be ISO-8601. Swaps the space between the date and time for a 'T'
239
+ * See https://github.com/supabase/supabase/issues/18
240
+ *
241
+ * @example toTimestampString('2019-09-10 00:00:00')
242
+ * //=> '2019-09-10T00:00:00'
243
+ */
244
+ export const toTimestampString = (value: RecordValue): RecordValue => {
245
+ if (typeof value === 'string') {
246
+ return value.replace(' ', 'T')
247
+ }
248
+
249
+ return value
250
+ }
251
+
252
+ export const httpEndpointURL = (socketUrl: string): string => {
253
+ const wsUrl = new URL(socketUrl)
254
+
255
+ wsUrl.protocol = wsUrl.protocol.replace(/^ws/i, 'http')
256
+
257
+ wsUrl.pathname = wsUrl.pathname
258
+ .replace(/\/+$/, '') // remove all trailing slashes
259
+ .replace(/\/socket\/websocket$/i, '') // remove the socket/websocket path
260
+ .replace(/\/socket$/i, '') // remove the socket path
261
+ .replace(/\/websocket$/i, '') // remove the websocket path
262
+
263
+ if (wsUrl.pathname === '' || wsUrl.pathname === '/') {
264
+ wsUrl.pathname = '/api/broadcast'
265
+ } else {
266
+ wsUrl.pathname = wsUrl.pathname + '/api/broadcast'
267
+ }
268
+
269
+ return wsUrl.href
270
+ }
node_modules/@supabase/realtime-js/src/lib/version.ts ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ // Generated automatically during releases by scripts/update-version-files.ts
2
+ // This file provides runtime access to the package version for:
3
+ // - HTTP request headers (e.g., X-Client-Info header for API requests)
4
+ // - Debugging and support (identifying which version is running)
5
+ // - Telemetry and logging (version reporting in errors/analytics)
6
+ // - Ensuring build artifacts match the published package version
7
+ export const version = '2.112.3'
node_modules/@supabase/realtime-js/src/lib/websocket-factory.ts ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export interface WebSocketLike {
2
+ readonly CONNECTING: number
3
+ readonly OPEN: number
4
+ readonly CLOSING: number
5
+ readonly CLOSED: number
6
+ readonly readyState: number
7
+ readonly url: string
8
+ readonly protocol: string
9
+
10
+ /**
11
+ * Closes the socket, optionally providing a close code and reason.
12
+ */
13
+ close(code?: number, reason?: string): void
14
+ /**
15
+ * Sends data through the socket using the underlying implementation.
16
+ */
17
+ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void
18
+
19
+ onopen: ((this: any, ev: Event) => any) | null
20
+ onmessage: ((this: any, ev: MessageEvent) => any) | null
21
+ onclose: ((this: any, ev: CloseEvent) => any) | null
22
+ onerror: ((this: any, ev: Event) => any) | null
23
+
24
+ /**
25
+ * Registers an event listener on the socket (compatible with browser WebSocket API).
26
+ */
27
+ addEventListener(type: string, listener: EventListener): void
28
+ /**
29
+ * Removes a previously registered event listener.
30
+ */
31
+ removeEventListener(type: string, listener: EventListener): void
32
+
33
+ // Add additional properties that may exist on WebSocket implementations
34
+ binaryType?: string
35
+ bufferedAmount?: number
36
+ extensions?: string
37
+ dispatchEvent?: (event: Event) => boolean
38
+ }
39
+
40
+ export interface WebSocketEnvironment {
41
+ type: 'native' | 'cloudflare' | 'unsupported'
42
+ /** WebSocket constructor for this environment, if available. */
43
+ wsConstructor?: typeof WebSocket
44
+ error?: string
45
+ workaround?: string
46
+ }
47
+
48
+ /**
49
+ * Extended globalThis with optional runtime-specific properties
50
+ * that may or may not exist depending on the environment.
51
+ */
52
+ interface RuntimeGlobals {
53
+ WebSocket?: { new (url: string, protocols?: string | string[]): WebSocketLike }
54
+ WebSocketPair?: unknown
55
+ EdgeRuntime?: unknown
56
+ }
57
+
58
+ /**
59
+ * Utilities for creating WebSocket instances across runtimes.
60
+ */
61
+ export class WebSocketFactory {
62
+ /**
63
+ * Static-only utility – prevent instantiation.
64
+ */
65
+ private constructor() {}
66
+ private static detectEnvironment(): WebSocketEnvironment {
67
+ if (typeof WebSocket !== 'undefined') {
68
+ return { type: 'native', wsConstructor: WebSocket }
69
+ }
70
+
71
+ const gt = globalThis as typeof globalThis & RuntimeGlobals
72
+ if (typeof globalThis !== 'undefined' && typeof gt.WebSocket !== 'undefined') {
73
+ return { type: 'native', wsConstructor: gt.WebSocket as typeof WebSocket }
74
+ }
75
+
76
+ const gl =
77
+ typeof global !== 'undefined' ? (global as typeof global & RuntimeGlobals) : undefined
78
+ if (gl && typeof gl.WebSocket !== 'undefined') {
79
+ return { type: 'native', wsConstructor: gl.WebSocket as typeof WebSocket }
80
+ }
81
+
82
+ if (
83
+ typeof globalThis !== 'undefined' &&
84
+ typeof gt.WebSocketPair !== 'undefined' &&
85
+ typeof globalThis.WebSocket === 'undefined'
86
+ ) {
87
+ return {
88
+ type: 'cloudflare',
89
+ error:
90
+ 'Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.',
91
+ workaround:
92
+ 'Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime.',
93
+ }
94
+ }
95
+
96
+ if (
97
+ (typeof globalThis !== 'undefined' && gt.EdgeRuntime) ||
98
+ (typeof navigator !== 'undefined' && navigator.userAgent?.includes('Vercel-Edge'))
99
+ ) {
100
+ return {
101
+ type: 'unsupported',
102
+ error:
103
+ 'Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.',
104
+ workaround:
105
+ 'Use serverless functions or a different deployment target for WebSocket functionality.',
106
+ }
107
+ }
108
+
109
+ // Use dynamic property access to avoid Next.js Edge Runtime static analysis warnings
110
+ const _process = (globalThis as Record<string, unknown>)['process'] as
111
+ | { versions?: { node?: string } }
112
+ | undefined
113
+ if (_process) {
114
+ const processVersions = _process['versions']
115
+ if (processVersions && processVersions['node']) {
116
+ // Reaching here means an earlier check did not find a native WebSocket,
117
+ // so this Node.js process is missing the global WebSocket (Node.js 22+).
118
+ return {
119
+ type: 'unsupported',
120
+ error: 'Node.js detected but native WebSocket not found.',
121
+ workaround:
122
+ 'Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option.',
123
+ }
124
+ }
125
+ }
126
+
127
+ return {
128
+ type: 'unsupported',
129
+ error: 'Unknown JavaScript runtime without WebSocket support.',
130
+ workaround:
131
+ "Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation.",
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Returns the best available WebSocket constructor for the current runtime.
137
+ *
138
+ * @category Realtime
139
+ *
140
+ * @example Example with error handling
141
+ * ```ts
142
+ * try {
143
+ * const WS = WebSocketFactory.getWebSocketConstructor()
144
+ * const socket = new WS('wss://example.com/socket')
145
+ * } catch (error) {
146
+ * console.error('WebSocket not available in this environment.', error)
147
+ * }
148
+ * ```
149
+ */
150
+ public static getWebSocketConstructor(): typeof WebSocket {
151
+ const env = this.detectEnvironment()
152
+ if (env.wsConstructor) {
153
+ return env.wsConstructor
154
+ }
155
+ let errorMessage = env.error || 'WebSocket not supported in this environment.'
156
+ if (env.workaround) {
157
+ errorMessage += `\n\nSuggested solution: ${env.workaround}`
158
+ }
159
+ throw new Error(errorMessage)
160
+ }
161
+
162
+ /**
163
+ * Detects whether the runtime can establish WebSocket connections.
164
+ *
165
+ * @category Realtime
166
+ *
167
+ * @example Example in a Node.js script
168
+ * ```ts
169
+ * if (!WebSocketFactory.isWebSocketSupported()) {
170
+ * console.error('WebSockets are required for this script.')
171
+ * process.exitCode = 1
172
+ * }
173
+ * ```
174
+ */
175
+ public static isWebSocketSupported(): boolean {
176
+ try {
177
+ const env = this.detectEnvironment()
178
+ return env.type === 'native'
179
+ } catch {
180
+ return false
181
+ }
182
+ }
183
+ }
184
+
185
+ export default WebSocketFactory
node_modules/@supabase/realtime-js/src/phoenix/channelAdapter.ts ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Channel } from '@supabase/phoenix'
2
+ import { CHANNEL_STATES, MAX_PUSH_BUFFER_SIZE } from '../lib/constants'
3
+ import type { RealtimeChannelOptions } from '../RealtimeChannel'
4
+ import SocketAdapter from './socketAdapter'
5
+ import type {
6
+ ChannelBindingCallback,
7
+ ChannelOnMessage,
8
+ ChannelOnErrorCallback,
9
+ ChannelFilterBindings,
10
+ Params,
11
+ ChannelState,
12
+ Push,
13
+ Timer,
14
+ } from './types'
15
+
16
+ export default class ChannelAdapter {
17
+ private channel: Channel
18
+ private socket: SocketAdapter
19
+
20
+ constructor(socket: SocketAdapter, topic: string, params: RealtimeChannelOptions) {
21
+ const phoenixParams = phoenixChannelParams(params)
22
+ this.channel = socket.getSocket().channel(topic, phoenixParams)
23
+ this.socket = socket
24
+ }
25
+
26
+ get state(): ChannelState {
27
+ return this.channel.state
28
+ }
29
+
30
+ set state(state: ChannelState) {
31
+ this.channel.state = state
32
+ }
33
+
34
+ get joinedOnce(): boolean {
35
+ return this.channel.joinedOnce
36
+ }
37
+
38
+ get joinPush(): Push {
39
+ return this.channel.joinPush
40
+ }
41
+
42
+ get rejoinTimer(): Timer {
43
+ return this.channel.rejoinTimer
44
+ }
45
+
46
+ on(event: string, callback: ChannelBindingCallback): number {
47
+ return this.channel.on(event, callback)
48
+ }
49
+
50
+ off(event: string, refNumber?: number) {
51
+ this.channel.off(event, refNumber)
52
+ }
53
+
54
+ subscribe(timeout?: number): Push {
55
+ return this.channel.join(timeout)
56
+ }
57
+
58
+ unsubscribe(timeout?: number): Push {
59
+ return this.channel.leave(timeout)
60
+ }
61
+
62
+ teardown() {
63
+ this.channel.teardown()
64
+ }
65
+
66
+ onClose(callback: ChannelBindingCallback) {
67
+ this.channel.onClose(callback)
68
+ }
69
+
70
+ onError(callback: ChannelOnErrorCallback): number {
71
+ return this.channel.onError(callback)
72
+ }
73
+
74
+ push(event: string, payload: { [key: string]: any }, timeout?: number): Push {
75
+ let push: Push
76
+
77
+ try {
78
+ push = this.channel.push(event, payload, timeout)
79
+ } catch (error) {
80
+ throw new Error(
81
+ `tried to push '${event}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`
82
+ )
83
+ }
84
+
85
+ if (this.channel.pushBuffer.length > MAX_PUSH_BUFFER_SIZE) {
86
+ const removedPush = this.channel.pushBuffer.shift()!
87
+ removedPush.cancelTimeout()
88
+ this.socket.log(
89
+ 'channel',
90
+ `discarded push due to buffer overflow: ${removedPush.event}`,
91
+ removedPush.payload()
92
+ )
93
+ }
94
+ return push
95
+ }
96
+
97
+ updateJoinPayload(payload: Record<string, any>) {
98
+ const oldPayload = this.channel.joinPush.payload()
99
+ this.channel.joinPush.payload = () => ({ ...oldPayload, ...payload })
100
+ }
101
+
102
+ canPush() {
103
+ return this.socket.isConnected() && this.state === CHANNEL_STATES.joined
104
+ }
105
+
106
+ isJoined() {
107
+ return this.state === CHANNEL_STATES.joined
108
+ }
109
+
110
+ isJoining() {
111
+ return this.state === CHANNEL_STATES.joining
112
+ }
113
+
114
+ isClosed() {
115
+ return this.state === CHANNEL_STATES.closed
116
+ }
117
+
118
+ isLeaving() {
119
+ return this.state === CHANNEL_STATES.leaving
120
+ }
121
+
122
+ updateFilterBindings(filterBindings: ChannelFilterBindings) {
123
+ this.channel.filterBindings = filterBindings
124
+ }
125
+
126
+ updatePayloadTransform(callback: ChannelOnMessage) {
127
+ this.channel.onMessage = callback
128
+ }
129
+
130
+ /**
131
+ * @internal
132
+ */
133
+ getChannel() {
134
+ return this.channel
135
+ }
136
+ }
137
+
138
+ function phoenixChannelParams(options: RealtimeChannelOptions): Params {
139
+ return {
140
+ config: {
141
+ ...{
142
+ broadcast: { ack: false, self: false },
143
+ presence: { key: '', enabled: false },
144
+ private: false,
145
+ },
146
+ ...options.config,
147
+ },
148
+ }
149
+ }
node_modules/@supabase/realtime-js/src/phoenix/presenceAdapter.ts ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Presence } from '@supabase/phoenix'
2
+ import type { PresenceState, PresenceStates } from './types'
3
+ import type {
4
+ RealtimePresenceOptions,
5
+ RealtimePresenceState,
6
+ Presence as RealtimePresenceType,
7
+ } from '../RealtimePresence'
8
+ import ChannelAdapter from './channelAdapter'
9
+
10
+ export default class PresenceAdapter {
11
+ private presence: Presence
12
+
13
+ constructor(channel: ChannelAdapter, opts?: RealtimePresenceOptions) {
14
+ const phoenixOptions = phoenixPresenceOptions(opts)
15
+ this.presence = new Presence(channel.getChannel(), phoenixOptions)
16
+
17
+ this.presence.onJoin((key, currentPresence, newPresence) => {
18
+ const onJoinPayload = PresenceAdapter.onJoinPayload(key, currentPresence, newPresence)
19
+ channel.getChannel().trigger('presence', onJoinPayload)
20
+ })
21
+
22
+ this.presence.onLeave((key, currentPresence, leftPresence) => {
23
+ const onLeavePayload = PresenceAdapter.onLeavePayload(key, currentPresence, leftPresence)
24
+ channel.getChannel().trigger('presence', onLeavePayload)
25
+ })
26
+
27
+ this.presence.onSync(() => {
28
+ channel.getChannel().trigger('presence', { event: 'sync' })
29
+ })
30
+ }
31
+
32
+ get state() {
33
+ return PresenceAdapter.transformState(this.presence.state)
34
+ }
35
+
36
+ /**
37
+ * @private
38
+ * Remove 'metas' key
39
+ * Change 'phx_ref' to 'presence_ref'
40
+ * Remove 'phx_ref' and 'phx_ref_prev'
41
+ *
42
+ * @example Transform state
43
+ * // returns {
44
+ * abc123: [
45
+ * { presence_ref: '2', user_id: 1 },
46
+ * { presence_ref: '3', user_id: 2 }
47
+ * ]
48
+ * }
49
+ * RealtimePresence.transformState({
50
+ * abc123: {
51
+ * metas: [
52
+ * { phx_ref: '2', phx_ref_prev: '1' user_id: 1 },
53
+ * { phx_ref: '3', user_id: 2 }
54
+ * ]
55
+ * }
56
+ * })
57
+ *
58
+ */
59
+ static transformState(state: PresenceStates): RealtimePresenceState {
60
+ state = cloneState(state)
61
+
62
+ return Object.getOwnPropertyNames(state).reduce((newState, key) => {
63
+ const presences = state[key]
64
+ newState[key] = transformState(presences)
65
+
66
+ return newState
67
+ }, {} as RealtimePresenceState)
68
+ }
69
+
70
+ static onJoinPayload(key: string, currentPresence: PresenceState, newPresence: PresenceState) {
71
+ const currentPresences = parseCurrentPresences(currentPresence)
72
+ const newPresences = transformState(newPresence)
73
+
74
+ return {
75
+ event: 'join',
76
+ key,
77
+ currentPresences,
78
+ newPresences,
79
+ }
80
+ }
81
+
82
+ static onLeavePayload(key: string, currentPresence: PresenceState, leftPresence: PresenceState) {
83
+ const currentPresences = parseCurrentPresences(currentPresence)
84
+ const leftPresences = transformState(leftPresence)
85
+
86
+ return {
87
+ event: 'leave',
88
+ key,
89
+ currentPresences,
90
+ leftPresences,
91
+ }
92
+ }
93
+ }
94
+
95
+ function transformState(presences: PresenceState) {
96
+ return presences.metas.map((presence) => {
97
+ // Object spread compiles to Object.assign for ES2017, which treats __proto__ as a setter.
98
+ const descriptors = Object.getOwnPropertyDescriptors(presence)
99
+ const transformedPresence = Object.defineProperties({}, descriptors) as typeof presence
100
+ transformedPresence['presence_ref'] = transformedPresence['phx_ref']
101
+
102
+ delete transformedPresence['phx_ref']
103
+ delete transformedPresence['phx_ref_prev']
104
+
105
+ return transformedPresence
106
+ }) as RealtimePresenceType[]
107
+ }
108
+
109
+ function cloneState(state: PresenceStates): PresenceStates {
110
+ return JSON.parse(JSON.stringify(state))
111
+ }
112
+
113
+ function phoenixPresenceOptions(opts?: RealtimePresenceOptions) {
114
+ return opts?.events && { events: opts.events }
115
+ }
116
+
117
+ function parseCurrentPresences(currentPresences?: PresenceState) {
118
+ return currentPresences?.metas ? transformState(currentPresences) : []
119
+ }
node_modules/@supabase/realtime-js/src/phoenix/socketAdapter.ts ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Socket } from '@supabase/phoenix'
2
+ import type {
3
+ Message,
4
+ SocketOnClose,
5
+ SocketOnMessage,
6
+ SocketOnOpen,
7
+ SocketOnError,
8
+ SocketOptions,
9
+ SocketStateChangeCallbacks,
10
+ Vsn,
11
+ Encode,
12
+ Decode,
13
+ HeartbeatCallback,
14
+ Timer,
15
+ } from './types'
16
+ import { CONNECTION_STATE, ConnectionState } from '../lib/constants'
17
+ import type { HeartbeatTimer, WebSocketLikeConstructor } from '../RealtimeClient'
18
+
19
+ export default class SocketAdapter {
20
+ private socket: Socket
21
+
22
+ constructor(endPoint: string, options: SocketOptions) {
23
+ this.socket = new Socket(endPoint, options)
24
+ }
25
+
26
+ get timeout(): number {
27
+ return this.socket.timeout
28
+ }
29
+
30
+ get endPoint(): string {
31
+ return this.socket.endPoint
32
+ }
33
+
34
+ get transport(): WebSocketLikeConstructor {
35
+ return this.socket.transport as WebSocketLikeConstructor
36
+ }
37
+
38
+ get heartbeatIntervalMs(): number {
39
+ return this.socket.heartbeatIntervalMs
40
+ }
41
+
42
+ get heartbeatCallback(): HeartbeatCallback {
43
+ return this.socket.heartbeatCallback
44
+ }
45
+
46
+ set heartbeatCallback(callback: HeartbeatCallback) {
47
+ this.socket.heartbeatCallback = callback
48
+ }
49
+
50
+ get heartbeatTimer(): HeartbeatTimer {
51
+ return this.socket.heartbeatTimer
52
+ }
53
+
54
+ get pendingHeartbeatRef(): string | null {
55
+ return this.socket.pendingHeartbeatRef
56
+ }
57
+
58
+ get reconnectTimer(): Timer {
59
+ return this.socket.reconnectTimer
60
+ }
61
+
62
+ get vsn(): Vsn {
63
+ return this.socket.vsn
64
+ }
65
+
66
+ get encode(): Encode<void> {
67
+ return this.socket.encode
68
+ }
69
+
70
+ get decode(): Decode<void> {
71
+ return this.socket.decode
72
+ }
73
+
74
+ get reconnectAfterMs(): (tries: number) => number {
75
+ return this.socket.reconnectAfterMs
76
+ }
77
+
78
+ get sendBuffer(): (() => void)[] {
79
+ return this.socket.sendBuffer
80
+ }
81
+
82
+ get stateChangeCallbacks(): SocketStateChangeCallbacks {
83
+ return this.socket.stateChangeCallbacks
84
+ }
85
+
86
+ connect() {
87
+ this.socket.connect()
88
+ }
89
+
90
+ disconnect(
91
+ callback: () => void,
92
+ code?: number,
93
+ reason?: string,
94
+ timeout: number = 10000
95
+ ): Promise<'ok' | 'timeout'> {
96
+ return new Promise((resolve) => {
97
+ setTimeout(() => resolve('timeout'), timeout)
98
+ this.socket.disconnect(
99
+ () => {
100
+ callback()
101
+ resolve('ok')
102
+ },
103
+ code,
104
+ reason
105
+ )
106
+ })
107
+ }
108
+
109
+ push(data: Message<Record<string, unknown>>) {
110
+ this.socket.push(data)
111
+ }
112
+
113
+ log(kind: string, msg: string, data?: any) {
114
+ this.socket.log(kind, msg, data)
115
+ }
116
+
117
+ makeRef(): string {
118
+ return this.socket.makeRef()
119
+ }
120
+
121
+ onOpen(callback: SocketOnOpen) {
122
+ this.socket.onOpen(callback)
123
+ }
124
+
125
+ onClose(callback: SocketOnClose) {
126
+ this.socket.onClose(callback)
127
+ }
128
+
129
+ onError(callback: SocketOnError) {
130
+ this.socket.onError(callback)
131
+ }
132
+
133
+ onMessage(callback: SocketOnMessage) {
134
+ this.socket.onMessage(callback)
135
+ }
136
+
137
+ isConnected() {
138
+ return this.socket.isConnected()
139
+ }
140
+
141
+ isConnecting() {
142
+ return this.socket.connectionState() == CONNECTION_STATE.connecting
143
+ }
144
+
145
+ isDisconnecting() {
146
+ return this.socket.connectionState() == CONNECTION_STATE.closing
147
+ }
148
+
149
+ connectionState(): ConnectionState {
150
+ // @ts-ignore - requires better typing and exposing type in phoenix
151
+ return this.socket.connectionState()
152
+ }
153
+
154
+ endPointURL(): string {
155
+ return this.socket.endPointURL()
156
+ }
157
+
158
+ sendHeartbeat() {
159
+ this.socket.sendHeartbeat()
160
+ }
161
+
162
+ /**
163
+ * @internal
164
+ */
165
+ getSocket() {
166
+ return this.socket
167
+ }
168
+ }
node_modules/@supabase/realtime-js/src/phoenix/types.ts ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type {
2
+ Socket,
3
+ SocketOptions,
4
+ SocketState,
5
+ SocketOnOpen,
6
+ SocketOnError,
7
+ SocketOnMessage,
8
+ SocketOnClose,
9
+ SocketStateChangeCallbacks,
10
+ Channel,
11
+ ChannelState,
12
+ ChannelEvent,
13
+ ChannelBindingCallback,
14
+ ChannelFilterBindings,
15
+ ChannelOnMessage,
16
+ ChannelOnErrorCallback,
17
+ PresenceState,
18
+ Message,
19
+ Params,
20
+ Transport,
21
+ Timer,
22
+ Vsn,
23
+ Encode,
24
+ Decode,
25
+ HeartbeatCallback,
26
+ HeartbeatStatus,
27
+ } from '@supabase/phoenix'
28
+
29
+ import type { Channel, PresenceState } from '@supabase/phoenix'
30
+
31
+ export type Push = ReturnType<Channel['push']>
32
+ export type PresenceStates = Record<string, PresenceState>
node_modules/@supabase/storage-js/AGENTS.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Agent instructions for `@supabase/storage-js`
2
+
3
+ Isomorphic storage client for Supabase. Handles bucket and object operations: upload, download, list, signed URLs, transformations.
4
+
5
+ When helping a user work with this package:
6
+
7
+ - **Usage and quick start**: [`README.md`](./README.md)
8
+ - **Full API reference**: [`src/`](./src/) — every public method and type has TSDoc with `@example` blocks. Read the source for the canonical, version-pinned answer.
9
+ - **Migration notes**: [`migrations/`](./migrations/) — per-theme markdown files for changes that need caller action.
10
+
11
+ For broader Supabase guidance (docs site, MCP tools, schema and project workflows), use the centralized [Supabase agent skills](https://github.com/supabase/agent-skills): `npx skills add supabase/agent-skills`. Or pair with the Supabase MCP server via the [Supabase Plugin for AI Coding Agents](https://supabase.com/docs/guides/getting-started/plugins).
node_modules/@supabase/storage-js/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Supabase
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
node_modules/@supabase/storage-js/README.md ADDED
@@ -0,0 +1,1266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <br />
2
+ <p align="center">
3
+ <a href="https://supabase.io">
4
+ <picture>
5
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/supabase-logo-wordmark--dark.svg">
6
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/supabase-logo-wordmark--light.svg">
7
+ <img alt="Supabase Logo" width="300" src="https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/logo-preview.jpg">
8
+ </picture>
9
+ </a>
10
+
11
+ <h1 align="center">Supabase Storage JS SDK</h1>
12
+
13
+ <h3 align="center">JavaScript SDK to interact with Supabase Storage, including file storage and vector embeddings.</h3>
14
+
15
+ <p align="center">
16
+ <a href="https://supabase.com/docs/guides/storage">Guides</a>
17
+ ·
18
+ <a href="https://supabase.com/docs/reference/javascript/storage-createbucket">Reference Docs</a>
19
+ ·
20
+ <a href="https://supabase.github.io/supabase-js/storage-js/v2/spec.json">TypeDoc</a>
21
+ </p>
22
+ </p>
23
+
24
+ <div align="center">
25
+
26
+ [![Build](https://github.com/supabase/supabase-js/workflows/CI/badge.svg)](https://github.com/supabase/supabase-js/actions?query=branch%3Amaster)
27
+ [![Package](https://img.shields.io/npm/v/@supabase/storage-js)](https://www.npmjs.com/package/@supabase/storage-js)
28
+ [![License: MIT](https://img.shields.io/npm/l/@supabase/supabase-js)](#license)
29
+ [![pkg.pr.new](https://pkg.pr.new/badge/supabase/storage-js)](https://pkg.pr.new/~/supabase/storage-js)
30
+
31
+ </div>
32
+
33
+ ## Requirements
34
+
35
+ - **Node.js 22 or later** (Node.js 20 support dropped in v2.110.0)
36
+ - For browser support, all modern browsers are supported
37
+
38
+ > ⚠️ **Node.js 18 Deprecation Notice**
39
+ >
40
+ > Node.js 18 reached end-of-life on April 30, 2025. As announced in [our deprecation notice](https://github.com/orgs/supabase/discussions/37217), support for Node.js 18 was dropped on October 31, 2025.
41
+
42
+ > ⚠️ **Node.js 20 Deprecation Notice**
43
+ >
44
+ > Node.js 20 reached end-of-life on April 30, 2026. As announced in [our deprecation notice](https://github.com/orgs/supabase/discussions/45715), support for Node.js 20 was dropped in v2.110.0.
45
+
46
+ ## Features
47
+
48
+ - **File Storage**: Upload, download, list, move, and delete files
49
+ - **Access Control**: Public and private buckets with fine-grained permissions
50
+ - **Signed URLs**: Generate time-limited URLs for secure file access
51
+ - **Image Transformations**: On-the-fly image resizing and optimization
52
+ - **Vector Embeddings**: Store and query high-dimensional embeddings with similarity search
53
+ - **Analytics Buckets**: Iceberg table-based buckets optimized for analytical queries and data processing
54
+
55
+ ## Quick Start Guide
56
+
57
+ ### Installing the module
58
+
59
+ ```bash
60
+ npm install @supabase/storage-js
61
+ ```
62
+
63
+ ### Connecting to the storage backend
64
+
65
+ There are two ways to use the Storage SDK:
66
+
67
+ #### Option 1: Via Supabase Client (Recommended)
68
+
69
+ If you're already using `@supabase/supabase-js`, access storage through the client:
70
+
71
+ ```js
72
+ import { createClient } from '@supabase/supabase-js'
73
+
74
+ // Use publishable key for frontend applications
75
+ const supabase = createClient('https://<project_ref>.supabase.co', '<your-publishable-key>')
76
+
77
+ // Access storage
78
+ const storage = supabase.storage
79
+
80
+ // Access different bucket types
81
+ const regularBucket = storage.from('my-bucket')
82
+ const vectorBucket = storage.vectors.from('embeddings-bucket')
83
+ const analyticsBucket = storage.analytics // Analytics API
84
+ ```
85
+
86
+ #### Option 2: Standalone StorageClient
87
+
88
+ For backend applications or when you need to bypass Row Level Security:
89
+
90
+ ```js
91
+ import { StorageClient } from '@supabase/storage-js'
92
+
93
+ const STORAGE_URL = 'https://<project_ref>.supabase.co/storage/v1'
94
+ const SERVICE_KEY = '<your-secret-key>' // Use secret key for backend operations
95
+
96
+ const storageClient = new StorageClient(STORAGE_URL, {
97
+ apikey: SERVICE_KEY,
98
+ Authorization: `Bearer ${SERVICE_KEY}`,
99
+ })
100
+
101
+ // Access different bucket types
102
+ const regularBucket = storageClient.from('my-bucket')
103
+ const vectorBucket = storageClient.vectors.from('embeddings-bucket')
104
+ const analyticsBucket = storageClient.analytics // Analytics API
105
+ ```
106
+
107
+ > **When to use each approach:**
108
+ >
109
+ > - Use `supabase.storage` when working with other Supabase features (auth, database, etc.) in frontend applications
110
+ > - Use `new StorageClient()` for backend applications, Edge Functions, or when you need to bypass RLS policies
111
+
112
+ > **Note:** Refer to the [Storage Access Control guide](https://supabase.com/docs/guides/storage/access-control) for detailed information on creating RLS policies.
113
+
114
+ ### Understanding Bucket Types
115
+
116
+ Supabase Storage supports three types of buckets, each optimized for different use cases:
117
+
118
+ #### 1. Regular Storage Buckets (File Storage)
119
+
120
+ Standard buckets for storing files, images, videos, and other assets.
121
+
122
+ ```js
123
+ // Create regular storage bucket
124
+ const { data, error } = await storageClient.createBucket('my-files', {
125
+ public: false,
126
+ })
127
+
128
+ // Upload files
129
+ await storageClient.from('my-files').upload('avatar.png', file)
130
+ ```
131
+
132
+ **Use cases:** User uploads, media assets, documents, backups
133
+
134
+ #### 2. Vector Buckets (Embeddings Storage)
135
+
136
+ Specialized buckets for storing and querying high-dimensional vector embeddings.
137
+
138
+ ```js
139
+ // Create vector bucket
140
+ await storageClient.vectors.createBucket('embeddings-prod')
141
+
142
+ // Create index and insert vectors
143
+ const bucket = storageClient.vectors.from('embeddings-prod')
144
+ await bucket.createIndex({
145
+ indexName: 'documents',
146
+ dimension: 1536,
147
+ distanceMetric: 'cosine',
148
+ })
149
+ ```
150
+
151
+ **Use cases:** Semantic search, AI-powered recommendations, similarity matching
152
+
153
+ **[See full Vector Embeddings documentation below](#vector-embeddings)**
154
+
155
+ #### 3. Analytics Buckets
156
+
157
+ Specialized buckets using Apache Iceberg table format, optimized for analytical queries and large-scale data processing.
158
+
159
+ ```js
160
+ // Create analytics bucket
161
+ await storageClient.analytics.createBucket('analytics-data')
162
+
163
+ // List analytics buckets
164
+ const { data, error } = await storageClient.analytics.listBuckets()
165
+
166
+ // Delete analytics bucket
167
+ await storageClient.analytics.deleteBucket('analytics-data')
168
+ ```
169
+
170
+ **Use cases:** Time-series data, analytical queries, data lakes, large-scale data processing, business intelligence
171
+
172
+ **[See full Analytics Buckets documentation below](#analytics-buckets)**
173
+
174
+ ---
175
+
176
+ ### Handling resources
177
+
178
+ #### Handling Storage Buckets
179
+
180
+ - Create a new Storage bucket:
181
+
182
+ ```js
183
+ const { data, error } = await storageClient.createBucket(
184
+ 'test_bucket', // Bucket name (must be unique)
185
+ { public: false } // Bucket options
186
+ )
187
+ ```
188
+
189
+ - Retrieve the details of an existing Storage bucket:
190
+
191
+ ```js
192
+ const { data, error } = await storageClient.getBucket('test_bucket')
193
+ ```
194
+
195
+ - Update a new Storage bucket:
196
+
197
+ ```js
198
+ const { data, error } = await storageClient.updateBucket(
199
+ 'test_bucket', // Bucket name
200
+ { public: false } // Bucket options
201
+ )
202
+ ```
203
+
204
+ - Remove all objects inside a single bucket:
205
+
206
+ ```js
207
+ const { data, error } = await storageClient.emptyBucket('test_bucket')
208
+ ```
209
+
210
+ - Delete an existing bucket (a bucket can't be deleted with existing objects inside it):
211
+
212
+ ```js
213
+ const { data, error } = await storageClient.deleteBucket('test_bucket')
214
+ ```
215
+
216
+ - Retrieve the details of all Storage buckets within an existing project:
217
+
218
+ ```js
219
+ // List all buckets
220
+ const { data, error } = await storageClient.listBuckets()
221
+
222
+ // List buckets with options (pagination, sorting, search)
223
+ const { data, error } = await storageClient.listBuckets({
224
+ limit: 10,
225
+ offset: 0,
226
+ sortColumn: 'created_at',
227
+ sortOrder: 'desc',
228
+ search: 'prod',
229
+ })
230
+ ```
231
+
232
+ #### Handling Files
233
+
234
+ - Upload a file to an existing bucket:
235
+
236
+ ```js
237
+ const fileBody = ... // load your file here
238
+
239
+ const { data, error } = await storageClient.from('bucket').upload('path/to/file', fileBody)
240
+ ```
241
+
242
+ > Note:
243
+ > The path in `data.Key` is prefixed by the bucket ID and is not the value which should be passed to the `download` method in order to fetch the file.
244
+ > To fetch the file via the `download` method, use `data.path` and `data.bucketId` as follows:
245
+ >
246
+ > ```javascript
247
+ > const { data, error } = await storageClient.from('bucket').upload('/folder/file.txt', fileBody)
248
+ > // check for errors
249
+ > const { data2, error2 } = await storageClient.from(data.bucketId).download(data.path)
250
+ > ```
251
+
252
+ > Note: The `upload` method also accepts a map of optional parameters. For a complete list see the [Supabase API reference](https://supabase.com/docs/reference/javascript/storage-from-upload).
253
+
254
+ - Download a file from an exisiting bucket:
255
+
256
+ ```js
257
+ const { data, error } = await storageClient.from('bucket').download('path/to/file')
258
+ ```
259
+
260
+ - List all the files within a bucket:
261
+
262
+ ```js
263
+ const { data, error } = await storageClient.from('bucket').list('folder')
264
+ ```
265
+
266
+ > Note: The `list` method also accepts a map of optional parameters. For a complete list see the [Supabase API reference](https://supabase.com/docs/reference/javascript/storage-from-list).
267
+
268
+ - Replace an existing file at the specified path with a new one:
269
+
270
+ ```js
271
+ const fileBody = ... // load your file here
272
+
273
+ const { data, error } = await storageClient
274
+ .from('bucket')
275
+ .update('path/to/file', fileBody)
276
+ ```
277
+
278
+ > Note: The `upload` method also accepts a map of optional parameters. For a complete list see the [Supabase API reference](https://supabase.com/docs/reference/javascript/storage-from-upload).
279
+
280
+ - Move an existing file:
281
+
282
+ ```js
283
+ const { data, error } = await storageClient
284
+ .from('bucket')
285
+ .move('old/path/to/file', 'new/path/to/file')
286
+ ```
287
+
288
+ - Delete files within the same bucket:
289
+
290
+ ```js
291
+ const { data, error } = await storageClient.from('bucket').remove(['path/to/file'])
292
+ ```
293
+
294
+ - Create signed URL to download file without requiring permissions:
295
+
296
+ ```js
297
+ const expireIn = 60
298
+
299
+ const { data, error } = await storageClient
300
+ .from('bucket')
301
+ .createSignedUrl('path/to/file', expireIn)
302
+ ```
303
+
304
+ - Retrieve URLs for assets in public buckets:
305
+
306
+ ```js
307
+ const { data, error } = await storageClient.from('public-bucket').getPublicUrl('path/to/file')
308
+ ```
309
+
310
+ ## Analytics Buckets
311
+
312
+ Supabase Storage provides specialized analytics buckets using Apache Iceberg table format, optimized for analytical workloads and large-scale data processing. These buckets are designed for data lake architectures, time-series data, and business intelligence applications.
313
+
314
+ ### What are Analytics Buckets?
315
+
316
+ Analytics buckets use the Apache Iceberg open table format, providing:
317
+
318
+ - **ACID transactions** for data consistency
319
+ - **Schema evolution** without data rewrites
320
+ - **Time travel** to query historical data
321
+ - **Efficient metadata management** for large datasets
322
+ - **Optimized for analytical queries** rather than individual file operations
323
+
324
+ ### When to Use Analytics Buckets
325
+
326
+ **Use analytics buckets for:**
327
+
328
+ - Time-series data (logs, metrics, events)
329
+ - Data lake architectures
330
+ - Business intelligence and reporting
331
+ - Large-scale batch processing
332
+ - Analytical workloads requiring ACID guarantees
333
+
334
+ **Use regular storage buckets for:**
335
+
336
+ - User file uploads (images, documents, videos)
337
+ - Individual file management
338
+ - Content delivery
339
+ - Simple object storage needs
340
+
341
+ ### Quick Start
342
+
343
+ You can access analytics functionality through the `analytics` property on your storage client:
344
+
345
+ #### Via Supabase Client
346
+
347
+ ```typescript
348
+ import { createClient } from '@supabase/supabase-js'
349
+
350
+ const supabase = createClient('https://your-project.supabase.co', 'your-publishable-key')
351
+
352
+ // Access analytics operations
353
+ const analytics = supabase.storage.analytics
354
+
355
+ // Create an analytics bucket
356
+ const { data, error } = await analytics.createBucket('analytics-data')
357
+ if (error) {
358
+ console.error('Failed to create analytics bucket:', error.message)
359
+ } else {
360
+ console.log('Created bucket:', data.name)
361
+ }
362
+ ```
363
+
364
+ #### Via StorageClient
365
+
366
+ ```typescript
367
+ import { StorageClient } from '@supabase/storage-js'
368
+
369
+ const storageClient = new StorageClient('https://your-project.supabase.co/storage/v1', {
370
+ apikey: 'YOUR_API_KEY',
371
+ Authorization: 'Bearer YOUR_TOKEN',
372
+ })
373
+
374
+ // Access analytics operations
375
+ const analytics = storageClient.analytics
376
+
377
+ // Create an analytics bucket
378
+ await analytics.createBucket('analytics-data')
379
+ ```
380
+
381
+ ### API Reference
382
+
383
+ #### Create Analytics Bucket
384
+
385
+ Creates a new analytics bucket using Iceberg table format:
386
+
387
+ ```typescript
388
+ const { data, error } = await analytics.createBucket('my-analytics-bucket')
389
+
390
+ if (error) {
391
+ console.error('Error:', error.message)
392
+ } else {
393
+ console.log('Created bucket:', data)
394
+ }
395
+ ```
396
+
397
+ **Returns:**
398
+
399
+ ```typescript
400
+ {
401
+ data: {
402
+ id: string
403
+ type: 'ANALYTICS'
404
+ format: string
405
+ created_at: string
406
+ updated_at: string
407
+ } | null
408
+ error: StorageError | null
409
+ }
410
+ ```
411
+
412
+ #### List Analytics Buckets
413
+
414
+ Retrieves all analytics buckets in your project with optional filtering and pagination:
415
+
416
+ ```typescript
417
+ const { data, error } = await analytics.listBuckets({
418
+ limit: 10,
419
+ offset: 0,
420
+ sortColumn: 'created_at',
421
+ sortOrder: 'desc',
422
+ search: 'prod',
423
+ })
424
+
425
+ if (data) {
426
+ console.log(`Found ${data.length} analytics buckets`)
427
+ data.forEach((bucket) => {
428
+ console.log(`- ${bucket.id} (created: ${bucket.created_at})`)
429
+ })
430
+ }
431
+ ```
432
+
433
+ **Parameters:**
434
+
435
+ - `limit?: number` - Maximum number of buckets to return
436
+ - `offset?: number` - Number of buckets to skip (for pagination)
437
+ - `sortColumn?: 'id' | 'name' | 'created_at' | 'updated_at'` - Column to sort by
438
+ - `sortOrder?: 'asc' | 'desc'` - Sort direction
439
+ - `search?: string` - Search term to filter bucket names
440
+
441
+ **Returns:**
442
+
443
+ ```typescript
444
+ {
445
+ data: AnalyticBucket[] | null
446
+ error: StorageError | null
447
+ }
448
+ ```
449
+
450
+ **Example with Pagination:**
451
+
452
+ ```typescript
453
+ // Fetch first page
454
+ const firstPage = await analytics.listBuckets({
455
+ limit: 100,
456
+ offset: 0,
457
+ sortColumn: 'created_at',
458
+ sortOrder: 'desc',
459
+ })
460
+
461
+ // Fetch second page
462
+ const secondPage = await analytics.listBuckets({
463
+ limit: 100,
464
+ offset: 100,
465
+ sortColumn: 'created_at',
466
+ sortOrder: 'desc',
467
+ })
468
+ ```
469
+
470
+ #### Delete Analytics Bucket
471
+
472
+ Deletes an analytics bucket. The bucket must be empty before deletion.
473
+
474
+ ```typescript
475
+ const { data, error } = await analytics.deleteBucket('old-analytics-bucket')
476
+
477
+ if (error) {
478
+ console.error('Failed to delete:', error.message)
479
+ } else {
480
+ console.log('Bucket deleted:', data.message)
481
+ }
482
+ ```
483
+
484
+ **Returns:**
485
+
486
+ ```typescript
487
+ {
488
+ data: { message: string } | null
489
+ error: StorageError | null
490
+ }
491
+ ```
492
+
493
+ > **Note:** A bucket cannot be deleted if it contains data. You must empty the bucket first.
494
+
495
+ #### Get Iceberg Catalog for Advanced Operations
496
+
497
+ For advanced operations like creating tables, namespaces, and querying Iceberg metadata, use the `from()` method to get a configured [iceberg-js](https://github.com/supabase/iceberg-js) client:
498
+
499
+ ```typescript
500
+ // Get an Iceberg REST Catalog client for your analytics bucket
501
+ const catalog = analytics.from('analytics-data')
502
+
503
+ // Create a namespace
504
+ await catalog.createNamespace({ namespace: ['default'] }, { properties: { owner: 'data-team' } })
505
+
506
+ // Create a table with schema
507
+ await catalog.createTable(
508
+ { namespace: ['default'] },
509
+ {
510
+ name: 'events',
511
+ schema: {
512
+ type: 'struct',
513
+ fields: [
514
+ { id: 1, name: 'id', type: 'long', required: true },
515
+ { id: 2, name: 'timestamp', type: 'timestamp', required: true },
516
+ { id: 3, name: 'user_id', type: 'string', required: false },
517
+ ],
518
+ 'schema-id': 0,
519
+ 'identifier-field-ids': [1],
520
+ },
521
+ 'partition-spec': {
522
+ 'spec-id': 0,
523
+ fields: [],
524
+ },
525
+ 'write-order': {
526
+ 'order-id': 0,
527
+ fields: [],
528
+ },
529
+ properties: {
530
+ 'write.format.default': 'parquet',
531
+ },
532
+ }
533
+ )
534
+
535
+ // List tables in namespace
536
+ const tables = await catalog.listTables({ namespace: ['default'] })
537
+ console.log(tables) // [{ namespace: ['default'], name: 'events' }]
538
+
539
+ // Load table metadata
540
+ const table = await catalog.loadTable({ namespace: ['default'], name: 'events' })
541
+
542
+ // Update table properties
543
+ await catalog.updateTable(
544
+ { namespace: ['default'], name: 'events' },
545
+ { properties: { 'read.split.target-size': '134217728' } }
546
+ )
547
+
548
+ // Drop table
549
+ await catalog.dropTable({ namespace: ['default'], name: 'events' })
550
+
551
+ // Drop namespace
552
+ await catalog.dropNamespace({ namespace: ['default'] })
553
+ ```
554
+
555
+ **Returns:** `IcebergRestCatalog` instance from [iceberg-js](https://github.com/supabase/iceberg-js)
556
+
557
+ > **Note:** The `from()` method returns an Iceberg REST Catalog client that provides full access to the Apache Iceberg REST API. For complete documentation of available operations, see the [iceberg-js documentation](https://supabase.github.io/iceberg-js/).
558
+
559
+ ### Error Handling
560
+
561
+ Analytics buckets use the same error handling pattern as the rest of the Storage SDK:
562
+
563
+ ```typescript
564
+ const { data, error } = await analytics.createBucket('my-bucket')
565
+
566
+ if (error) {
567
+ console.error('Error:', error.message)
568
+ console.error('Status:', error.status)
569
+ console.error('Status Code:', error.statusCode)
570
+ // Handle error appropriately
571
+ }
572
+ ```
573
+
574
+ #### Throwing Errors
575
+
576
+ You can configure the client to throw errors instead of returning them:
577
+
578
+ ```typescript
579
+ const analytics = storageClient.analytics
580
+ analytics.throwOnError()
581
+
582
+ try {
583
+ const { data } = await analytics.createBucket('my-bucket')
584
+ // data is guaranteed to be present
585
+ console.log('Success:', data)
586
+ } catch (error) {
587
+ if (error instanceof StorageApiError) {
588
+ console.error('API Error:', error.statusCode, error.message)
589
+ }
590
+ }
591
+ ```
592
+
593
+ ### TypeScript Types
594
+
595
+ The library exports TypeScript types for analytics buckets:
596
+
597
+ ```typescript
598
+ import type { AnalyticBucket, BucketType, StorageError } from '@supabase/storage-js'
599
+
600
+ // AnalyticBucket type
601
+ interface AnalyticBucket {
602
+ id: string
603
+ type: 'ANALYTICS'
604
+ format: string
605
+ created_at: string
606
+ updated_at: string
607
+ }
608
+ ```
609
+
610
+ ### Common Patterns
611
+
612
+ #### Checking if a Bucket Exists
613
+
614
+ ```typescript
615
+ async function bucketExists(bucketName: string): Promise<boolean> {
616
+ const { data, error } = await analytics.listBuckets({
617
+ search: bucketName,
618
+ })
619
+
620
+ if (error) {
621
+ console.error('Error checking bucket:', error.message)
622
+ return false
623
+ }
624
+
625
+ return data?.some((bucket) => bucket.id === bucketName) ?? false
626
+ }
627
+ ```
628
+
629
+ #### Creating Bucket with Error Handling
630
+
631
+ ```typescript
632
+ async function ensureAnalyticsBucket(bucketName: string) {
633
+ // Try to create the bucket
634
+ const { data, error } = await analytics.createBucket(bucketName)
635
+
636
+ if (error) {
637
+ // Check if bucket already exists (conflict error)
638
+ if (error.statusCode === '409') {
639
+ console.log(`Bucket '${bucketName}' already exists`)
640
+ return { success: true, created: false }
641
+ }
642
+
643
+ // Other error occurred
644
+ console.error('Failed to create bucket:', error.message)
645
+ return { success: false, error }
646
+ }
647
+
648
+ console.log(`Created new bucket: '${bucketName}'`)
649
+ return { success: true, created: true, data }
650
+ }
651
+ ```
652
+
653
+ #### Listing All Buckets with Pagination
654
+
655
+ ```typescript
656
+ async function getAllAnalyticsBuckets() {
657
+ const allBuckets: AnalyticBucket[] = []
658
+ let offset = 0
659
+ const limit = 100
660
+
661
+ while (true) {
662
+ const { data, error } = await analytics.listBuckets({
663
+ limit,
664
+ offset,
665
+ sortColumn: 'created_at',
666
+ sortOrder: 'desc',
667
+ })
668
+
669
+ if (error) {
670
+ console.error('Error fetching buckets:', error.message)
671
+ break
672
+ }
673
+
674
+ if (!data || data.length === 0) {
675
+ break
676
+ }
677
+
678
+ allBuckets.push(...data)
679
+
680
+ // If we got fewer results than the limit, we've reached the end
681
+ if (data.length < limit) {
682
+ break
683
+ }
684
+
685
+ offset += limit
686
+ }
687
+
688
+ return allBuckets
689
+ }
690
+ ```
691
+
692
+ ## Vector Embeddings
693
+
694
+ Supabase Storage provides built-in support for storing and querying high-dimensional vector embeddings, powered by S3 Vectors. This enables semantic search, similarity matching, and AI-powered applications without needing a separate vector database.
695
+
696
+ > **Note:** Vector embeddings functionality is available in `@supabase/storage-js` v2.76 and later.
697
+
698
+ ### Features
699
+
700
+ - **Vector Buckets**: Organize vector indexes into logical containers
701
+ - **Vector Indexes**: Define schemas with configurable dimensions and distance metrics
702
+ - **Batch Operations**: Insert/update/delete up to 500 vectors per request
703
+ - **Similarity Search**: Query for nearest neighbors using cosine, euclidean, or dot product distance
704
+ - **Metadata Filtering**: Store and filter vectors by arbitrary JSON metadata
705
+ - **Pagination**: Efficiently scan large vector datasets
706
+ - **Parallel Scanning**: Distribute scans across multiple workers for high throughput
707
+ - **Cross-platform**: Works in Node.js, browsers, and edge runtimes
708
+
709
+ ### Quick Start
710
+
711
+ You can access vector functionality in three ways, depending on your use case:
712
+
713
+ #### Option 1: Via Supabase Client (Most Common)
714
+
715
+ If you're using the full Supabase client:
716
+
717
+ ```typescript
718
+ import { createClient } from '@supabase/supabase-js'
719
+
720
+ const supabase = createClient('https://your-project.supabase.co', 'your-publishable-key')
721
+
722
+ // Access vector operations through storage
723
+ const vectors = supabase.storage.vectors
724
+
725
+ // Create a vector bucket
726
+ await vectors.createBucket('embeddings-prod')
727
+
728
+ // Create an index
729
+ const bucket = vectors.from('embeddings-prod')
730
+ await bucket.createIndex({
731
+ indexName: 'documents-openai',
732
+ dataType: 'float32',
733
+ dimension: 1536,
734
+ distanceMetric: 'cosine',
735
+ })
736
+
737
+ // Insert vectors
738
+ const index = bucket.index('documents-openai')
739
+ await index.putVectors({
740
+ vectors: [
741
+ {
742
+ key: 'doc-1',
743
+ data: { float32: [0.1, 0.2, 0.3 /* ...1536 dimensions */] },
744
+ metadata: { title: 'Introduction', category: 'docs' },
745
+ },
746
+ ],
747
+ })
748
+
749
+ // Query similar vectors
750
+ const { data, error } = await index.queryVectors({
751
+ queryVector: { float32: [0.15, 0.25, 0.35 /* ...1536 dimensions */] },
752
+ topK: 5,
753
+ returnDistance: true,
754
+ returnMetadata: true,
755
+ })
756
+
757
+ if (data) {
758
+ data.matches.forEach((match) => {
759
+ console.log(`${match.key}: distance=${match.distance}`)
760
+ console.log('Metadata:', match.metadata)
761
+ })
762
+ }
763
+ ```
764
+
765
+ #### Option 2: Via StorageClient
766
+
767
+ If you're using the standalone `StorageClient` for storage operations, access vectors through the `vectors` property:
768
+
769
+ ```typescript
770
+ import { StorageClient } from '@supabase/storage-js'
771
+
772
+ const storageClient = new StorageClient('https://your-project.supabase.co/storage/v1', {
773
+ apikey: 'YOUR_API_KEY',
774
+ Authorization: 'Bearer YOUR_TOKEN',
775
+ })
776
+
777
+ // Access vector operations
778
+ const vectors = storageClient.vectors
779
+
780
+ // Use the same API as shown in Option 1
781
+ await vectors.createBucket('embeddings-prod')
782
+ const bucket = vectors.from('embeddings-prod')
783
+ // ... rest of operations
784
+ ```
785
+
786
+ #### Option 3: Standalone Vector Client
787
+
788
+ For vector-only applications that don't need regular file storage operations:
789
+
790
+ ```typescript
791
+ import { StorageVectorsClient } from '@supabase/storage-js'
792
+
793
+ // Initialize standalone vector client
794
+ const vectorClient = new StorageVectorsClient('https://your-project.supabase.co/storage/v1', {
795
+ headers: { Authorization: 'Bearer YOUR_TOKEN' },
796
+ })
797
+
798
+ // Use the same API as shown in Option 1
799
+ await vectorClient.createBucket('embeddings-prod')
800
+ const bucket = vectorClient.from('embeddings-prod')
801
+ // ... rest of operations
802
+ ```
803
+
804
+ > **When to use each approach:**
805
+ >
806
+ > - **Option 1**: When using other Supabase features (auth, database, realtime)
807
+ > - **Option 2**: When working with both file storage and vectors
808
+ > - **Option 3**: For dedicated vector-only applications without file storage
809
+
810
+ ### API Reference
811
+
812
+ #### Client Initialization
813
+
814
+ ```typescript
815
+ const vectorClient = new StorageVectorsClient(url, options?)
816
+ ```
817
+
818
+ **Options:**
819
+
820
+ - `headers?: Record<string, string>` - Custom HTTP headers (e.g., Authorization)
821
+ - `fetch?: Fetch` - Custom fetch implementation
822
+
823
+ #### Vector Buckets
824
+
825
+ Vector buckets are top-level containers for organizing vector indexes.
826
+
827
+ ##### Create Bucket
828
+
829
+ ```typescript
830
+ const { data, error } = await vectorClient.createBucket('my-bucket')
831
+ ```
832
+
833
+ ##### Get Bucket
834
+
835
+ ```typescript
836
+ const { data, error } = await vectorClient.getBucket('my-bucket')
837
+ console.log('Created at:', new Date(data.vectorBucket.creationTime! * 1000))
838
+ ```
839
+
840
+ ##### List Buckets
841
+
842
+ ```typescript
843
+ const { data, error } = await vectorClient.listBuckets({
844
+ prefix: 'prod-',
845
+ maxResults: 100,
846
+ })
847
+
848
+ // Pagination
849
+ if (data?.nextToken) {
850
+ const next = await vectorClient.listBuckets({ nextToken: data.nextToken })
851
+ }
852
+ ```
853
+
854
+ ##### Delete Bucket
855
+
856
+ ```typescript
857
+ // Bucket must be empty (all indexes deleted first)
858
+ const { error } = await vectorClient.deleteBucket('my-bucket')
859
+ ```
860
+
861
+ #### Vector Indexes
862
+
863
+ Vector indexes define the schema for embeddings including dimension and distance metric.
864
+
865
+ ##### Create Index
866
+
867
+ ```typescript
868
+ const bucket = vectorClient.from('my-bucket')
869
+
870
+ await bucket.createIndex({
871
+ indexName: 'my-index',
872
+ dataType: 'float32',
873
+ dimension: 1536,
874
+ distanceMetric: 'cosine', // 'cosine' | 'euclidean' | 'dotproduct'
875
+ metadataConfiguration: {
876
+ nonFilterableMetadataKeys: ['raw_text', 'internal_id'],
877
+ },
878
+ })
879
+ ```
880
+
881
+ **Distance Metrics:**
882
+
883
+ - `cosine` - Cosine similarity (normalized dot product)
884
+ - `euclidean` - Euclidean distance (L2 norm)
885
+ - `dotproduct` - Dot product similarity
886
+
887
+ ##### Get Index
888
+
889
+ ```typescript
890
+ const { data, error } = await bucket.getIndex('my-index')
891
+ console.log('Dimension:', data?.index.dimension)
892
+ console.log('Distance metric:', data?.index.distanceMetric)
893
+ ```
894
+
895
+ ##### List Indexes
896
+
897
+ ```typescript
898
+ const { data, error } = await bucket.listIndexes({
899
+ prefix: 'documents-',
900
+ maxResults: 100,
901
+ })
902
+ ```
903
+
904
+ ##### Delete Index
905
+
906
+ ```typescript
907
+ // Deletes index and all its vectors
908
+ await bucket.deleteIndex('my-index')
909
+ ```
910
+
911
+ #### Vector Operations
912
+
913
+ ##### Insert/Update Vectors (Upsert)
914
+
915
+ ```typescript
916
+ const index = vectorClient.from('my-bucket').index('my-index')
917
+
918
+ await index.putVectors({
919
+ vectors: [
920
+ {
921
+ key: 'unique-id-1',
922
+ data: {
923
+ float32: [
924
+ /* 1536 numbers */
925
+ ],
926
+ },
927
+ metadata: {
928
+ title: 'Document Title',
929
+ category: 'technical',
930
+ page: 1,
931
+ },
932
+ },
933
+ // ... up to 500 vectors per request
934
+ ],
935
+ })
936
+ ```
937
+
938
+ **Limitations:**
939
+
940
+ - 1-500 vectors per request
941
+ - Vectors must match index dimension
942
+ - Keys must be unique within index
943
+
944
+ ##### Get Vectors by Key
945
+
946
+ ```typescript
947
+ const { data, error } = await index.getVectors({
948
+ keys: ['doc-1', 'doc-2', 'doc-3'],
949
+ returnData: true, // Include embeddings
950
+ returnMetadata: true, // Include metadata
951
+ })
952
+
953
+ data?.vectors.forEach((v) => {
954
+ console.log(v.key, v.metadata)
955
+ })
956
+ ```
957
+
958
+ ##### Query Similar Vectors (ANN Search)
959
+
960
+ ```typescript
961
+ const { data, error } = await index.queryVectors({
962
+ queryVector: {
963
+ float32: [
964
+ /* 1536 numbers */
965
+ ],
966
+ },
967
+ topK: 10,
968
+ filter: {
969
+ category: 'technical',
970
+ published: true,
971
+ },
972
+ returnDistance: true,
973
+ returnMetadata: true,
974
+ })
975
+
976
+ // Results ordered by similarity
977
+ data?.matches.forEach((match) => {
978
+ console.log(`${match.key}: distance=${match.distance}`)
979
+ })
980
+ ```
981
+
982
+ **Filter Syntax:**
983
+ The `filter` parameter accepts arbitrary JSON for metadata filtering. Non-filterable keys (configured at index creation) cannot be used in filters but can still be returned.
984
+
985
+ ##### List/Scan Vectors
986
+
987
+ ```typescript
988
+ // Simple pagination
989
+ let nextToken: string | undefined
990
+ do {
991
+ const { data } = await index.listVectors({
992
+ maxResults: 500,
993
+ nextToken,
994
+ returnMetadata: true,
995
+ })
996
+
997
+ console.log('Batch:', data?.vectors.length)
998
+ nextToken = data?.nextToken
999
+ } while (nextToken)
1000
+
1001
+ // Parallel scanning (4 workers)
1002
+ const workers = [0, 1, 2, 3].map(async (segmentIndex) => {
1003
+ const { data } = await index.listVectors({
1004
+ segmentCount: 4,
1005
+ segmentIndex,
1006
+ returnMetadata: true,
1007
+ })
1008
+ return data?.vectors || []
1009
+ })
1010
+
1011
+ const results = await Promise.all(workers)
1012
+ const allVectors = results.flat()
1013
+ ```
1014
+
1015
+ **Limitations:**
1016
+
1017
+ - `maxResults`: 1-1000 (default: 500)
1018
+ - `segmentCount`: 1-16
1019
+ - Response may be limited by 1MB size
1020
+
1021
+ ##### Delete Vectors
1022
+
1023
+ ```typescript
1024
+ await index.deleteVectors({
1025
+ keys: ['doc-1', 'doc-2', 'doc-3'],
1026
+ // ... up to 500 keys per request
1027
+ })
1028
+ ```
1029
+
1030
+ ### Error Handling
1031
+
1032
+ The library uses a consistent error handling pattern:
1033
+
1034
+ ```typescript
1035
+ const { data, error } = await vectorClient.createBucket('my-bucket')
1036
+
1037
+ if (error) {
1038
+ console.error('Error:', error.message)
1039
+ console.error('Status:', error.status)
1040
+ console.error('Code:', error.statusCode)
1041
+ }
1042
+ ```
1043
+
1044
+ #### Error Codes
1045
+
1046
+ | Code | HTTP | Description |
1047
+ | ---------------------------- | ---- | ----------------------- |
1048
+ | `InternalError` | 500 | Internal server error |
1049
+ | `S3VectorConflictException` | 409 | Resource already exists |
1050
+ | `S3VectorNotFoundException` | 404 | Resource not found |
1051
+ | `S3VectorBucketNotEmpty` | 400 | Bucket contains indexes |
1052
+ | `S3VectorMaxBucketsExceeded` | 400 | Bucket quota exceeded |
1053
+ | `S3VectorMaxIndexesExceeded` | 400 | Index quota exceeded |
1054
+
1055
+ #### Throwing Errors
1056
+
1057
+ You can configure the client to throw errors instead:
1058
+
1059
+ ```typescript
1060
+ const vectorClient = new StorageVectorsClient(url, options)
1061
+ vectorClient.throwOnError()
1062
+
1063
+ try {
1064
+ const { data } = await vectorClient.createBucket('my-bucket')
1065
+ // data is guaranteed to be present
1066
+ } catch (error) {
1067
+ if (error instanceof StorageVectorsApiError) {
1068
+ console.error('API Error:', error.statusCode)
1069
+ }
1070
+ }
1071
+ ```
1072
+
1073
+ ### Advanced Usage
1074
+
1075
+ #### Scoped Clients
1076
+
1077
+ Create scoped clients for cleaner code:
1078
+
1079
+ ```typescript
1080
+ // Bucket-scoped operations
1081
+ const bucket = vectorClient.from('embeddings-prod')
1082
+ await bucket.createIndex({
1083
+ /* ... */
1084
+ })
1085
+ await bucket.listIndexes()
1086
+
1087
+ // Index-scoped operations
1088
+ const index = bucket.index('documents-openai')
1089
+ await index.putVectors({
1090
+ /* ... */
1091
+ })
1092
+ await index.queryVectors({
1093
+ /* ... */
1094
+ })
1095
+ ```
1096
+
1097
+ #### Custom Fetch
1098
+
1099
+ Provide a custom fetch implementation:
1100
+
1101
+ ```typescript
1102
+ import { StorageVectorsClient } from '@supabase/storage-js'
1103
+
1104
+ const vectorClient = new StorageVectorsClient(url, {
1105
+ fetch: customFetch,
1106
+ headers: {
1107
+ /* ... */
1108
+ },
1109
+ })
1110
+ ```
1111
+
1112
+ #### Batch Processing
1113
+
1114
+ Process large datasets in batches:
1115
+
1116
+ ```typescript
1117
+ async function insertLargeDataset(vectors: VectorObject[]) {
1118
+ const batchSize = 500
1119
+
1120
+ for (let i = 0; i < vectors.length; i += batchSize) {
1121
+ const batch = vectors.slice(i, i + batchSize)
1122
+ await index.putVectors({ vectors: batch })
1123
+ console.log(`Inserted ${i + batch.length}/${vectors.length}`)
1124
+ }
1125
+ }
1126
+ ```
1127
+
1128
+ #### Float32 Validation
1129
+
1130
+ Ensure vectors are properly normalized to float32:
1131
+
1132
+ ```typescript
1133
+ import { normalizeToFloat32 } from '@supabase/storage-js'
1134
+
1135
+ const vector = normalizeToFloat32([0.1, 0.2, 0.3 /* ... */])
1136
+ ```
1137
+
1138
+ ### Type Definitions
1139
+
1140
+ The library exports comprehensive TypeScript types:
1141
+
1142
+ ```typescript
1143
+ import type {
1144
+ VectorBucket,
1145
+ VectorIndex,
1146
+ VectorData,
1147
+ VectorObject,
1148
+ VectorMatch,
1149
+ VectorMetadata,
1150
+ DistanceMetric,
1151
+ ApiResponse,
1152
+ StorageVectorsError,
1153
+ } from '@supabase/storage-js'
1154
+ ```
1155
+
1156
+ ## Development
1157
+
1158
+ This package is part of the [Supabase JavaScript monorepo](https://github.com/supabase/supabase-js). To work on this package:
1159
+
1160
+ ### Building
1161
+
1162
+ #### Build Scripts Overview
1163
+
1164
+ ```bash
1165
+ # Build the package
1166
+ pnpm nx build storage-js
1167
+
1168
+ # Watch mode for development
1169
+ pnpm nx build storage-js --watch
1170
+
1171
+ # Generate documentation
1172
+ pnpm nx docs storage-js
1173
+ ```
1174
+
1175
+ ### Testing
1176
+
1177
+ **Important:** The storage-js tests require a local Supabase stack running via the Supabase CLI. Docker must be running since the Supabase CLI uses it internally.
1178
+
1179
+ #### Prerequisites
1180
+
1181
+ 1. **Docker** must be installed and running (used by Supabase CLI internally)
1182
+ 2. **Supabase CLI** — installed automatically via `pnpm exec supabase`
1183
+
1184
+ #### Test Scripts Overview
1185
+
1186
+ | Script | Description | What it does |
1187
+ | ----------------- | --------------------------------- | ----------------------------------------------------------------- |
1188
+ | `test:storage` | **Complete test workflow** | Runs the full test cycle: clean → start infra → run tests → clean |
1189
+ | `test:suite` | **Jest tests only** | Runs Jest tests with coverage (requires infra to be running) |
1190
+ | `test:infra` | **Start test infrastructure** | Starts Supabase CLI stack (PostgreSQL, Storage API, Kong, etc.) |
1191
+ | `test:clean-post` | **Stop and clean infrastructure** | Stops the Supabase CLI stack |
1192
+
1193
+ #### Running Tests
1194
+
1195
+ ##### Option 1: Complete Test Run (Recommended)
1196
+
1197
+ This handles everything automatically - starting infrastructure, running tests, and cleaning up:
1198
+
1199
+ ```bash
1200
+ # From monorepo root
1201
+ pnpm nx test:storage storage-js
1202
+ ```
1203
+
1204
+ This command will:
1205
+
1206
+ 1. Stop any existing test containers
1207
+ 2. Build and start fresh test infrastructure
1208
+ 3. Wait for services to be ready
1209
+ 4. Run all Jest tests with coverage
1210
+ 5. Clean up all containers after tests complete
1211
+
1212
+ ##### Option 2: Manual Infrastructure Management
1213
+
1214
+ Useful for development when you want to run tests multiple times without restarting Docker:
1215
+
1216
+ ```bash
1217
+ # Step 1: Start the test infrastructure
1218
+ # From root
1219
+ pnpm nx test:infra storage-js
1220
+ # This starts: PostgreSQL, Storage API, Kong Gateway, and imgproxy
1221
+
1222
+ # Step 2: Run tests (can run multiple times)
1223
+ pnpm nx test:suite storage-js
1224
+
1225
+ # Step 3: When done, clean up the infrastructure
1226
+ pnpm nx test:clean-post storage-js
1227
+ ```
1228
+
1229
+ ##### Option 3: Development Mode
1230
+
1231
+ For actively developing and debugging tests:
1232
+
1233
+ ```bash
1234
+ # Start infrastructure once (from root)
1235
+ pnpm nx test:infra storage-js
1236
+
1237
+ # Run tests in watch mode
1238
+ pnpm nx test:suite storage-js --watch
1239
+
1240
+ # Clean up when done
1241
+ pnpm nx test:clean-post storage-js
1242
+ ```
1243
+
1244
+ #### Test Infrastructure Details
1245
+
1246
+ The test infrastructure is managed via the Supabase CLI (`pnpm exec supabase start --workdir test`), which starts a local Supabase stack defined by the config in `test/`. This includes PostgreSQL, the Storage API, Kong Gateway, and supporting services.
1247
+
1248
+ #### Common Issues and Solutions
1249
+
1250
+ | Issue | Solution |
1251
+ | --------------------------------- | ------------------------------------------------------------------------------------------------- |
1252
+ | Port conflicts | Another service is using a required port. Run `pnpm nx test:clean-post storage-js` then try again |
1253
+ | "request failed, reason:" errors | Infrastructure isn't running. Run `pnpm nx test:infra storage-js` first |
1254
+ | Tests fail with connection errors | Ensure Docker is running (Supabase CLI requires Docker) |
1255
+ | Stack already running | Run `pnpm nx test:clean-post storage-js` to stop it before restarting |
1256
+
1257
+ #### Understanding Test Failures
1258
+
1259
+ - **StorageUnknownError with "request failed"**: Infrastructure not running
1260
+ - **Snapshot failures**: Expected test data has changed — review and update snapshots if needed
1261
+
1262
+ ### Contributing
1263
+
1264
+ We welcome contributions! Please see our [Contributing Guide](../../../CONTRIBUTING.md) for details on how to get started.
1265
+
1266
+ For major changes or if you're unsure about something, please open an issue first to discuss your proposed changes.
node_modules/@supabase/storage-js/dist/index.cjs ADDED
The diff for this file is too large to render. See raw diff
 
node_modules/@supabase/storage-js/dist/index.cjs.map ADDED
The diff for this file is too large to render. See raw diff
 
node_modules/@supabase/storage-js/dist/index.d.cts ADDED
The diff for this file is too large to render. See raw diff
 
node_modules/@supabase/storage-js/dist/index.d.cts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/lib/common/errors.ts","../src/lib/types.ts","../src/lib/common/fetch.ts","../src/lib/common/BaseApiClient.ts","../src/packages/StreamDownloadBuilder.ts","../src/packages/BlobDownloadBuilder.ts","../src/packages/StorageFileApi.ts","../src/packages/StorageBucketApi.ts","../src/packages/StorageAnalyticsClient.ts","../src/packages/VectorIndexApi.ts","../src/packages/VectorDataApi.ts","../src/packages/VectorBucketApi.ts","../src/packages/StorageVectorsClient.ts","../src/StorageClient.ts"],"sourcesContent":[],"mappings":";;;;;;;AAIA;AAMa,KAND,cAAA,GAMc,SAAA,GAAA,SAAA;;;;;AAuCV,cAvCH,YAAA,SAAqB,KAAA,CAuCmC;EAQxD,UAAA,gBAAgB,EAAA,OAed;EA4BF,UAAA,SAAA,EAxFU,cA2F2C;EAerD,MAAA,EAAA,MAAA,GAAA,SAAoB;EAWjB,UAAA,EAAA,MAAA,GAAA,SAAqB;EAQxB,WAAA,CAAA,OAAA,EAAA,MAAuB,EAAA,SAAuB,CAAf,EAvH7B,cAuH4C,EAAA,MAAA,CAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EAAA,MAAA;EAU9C,MAAA,CAAA,CAAA,EAAA;IAUD,IAAA,EAAA,MAAA;;;;ECtJA,CAAA;AAEZ;AAYA;AAQA;AAYA;AAiBA;AA0BA;AAkCiB,iBDrED,cAAA,CC2FH,KAAY,EAAA,OAAA,CAAA,EAAA,KAAA,ID3FgC,YC2FhC;AAQzB;AAKA;AA6BA;AAIA;AAuBiB,cDxJJ,eAAA,SAAwB,YAAA,CCwJZ;EAKR,MAAA,EAAA,MAAA;EAwCA,UAAA,EAAA,MAAc;EAoBd;AAOjB;AAOA;AAmBA;AAIA;AA6BC;EAEkC,IAAA,EAAA,MAAA,GAAA,SAAA;EAClB,WAAA,CAAA,OAAA,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raw diff
 
node_modules/@supabase/storage-js/dist/index.d.mts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/common/errors.ts","../src/lib/types.ts","../src/lib/common/fetch.ts","../src/lib/common/BaseApiClient.ts","../src/packages/StreamDownloadBuilder.ts","../src/packages/BlobDownloadBuilder.ts","../src/packages/StorageFileApi.ts","../src/packages/StorageBucketApi.ts","../src/packages/StorageAnalyticsClient.ts","../src/packages/VectorIndexApi.ts","../src/packages/VectorDataApi.ts","../src/packages/VectorBucketApi.ts","../src/packages/StorageVectorsClient.ts","../src/StorageClient.ts"],"sourcesContent":[],"mappings":";;;;;;;AAIA;AAMa,KAND,cAAA,GAMc,SAAA,GAAA,SAAA;;;;;AAuCV,cAvCH,YAAA,SAAqB,KAAA,CAuCmC;EAQxD,UAAA,gBAAgB,EAAA,OAed;EA4BF,UAAA,SAAA,EAxFU,cA2F2C;EAerD,MAAA,EAAA,MAAA,GAAA,SAAoB;EAWjB,UAAA,EAAA,MAAA,GAAA,SAAqB;EAQxB,WAAA,CAAA,OAAA,EAAA,MAAuB,EAAA,SAAuB,CAAf,EAvH7B,cAuH4C,EAAA,MAAA,CAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EAAA,MAAA;EAU9C,MAAA,CAAA,CAAA,EAAA;IAUD,IAAA,EAAA,MAAA;;;;ECtJA,CAAA;AAEZ;AAYA;AAQA;AAYA;AAiBA;AA0BA;AAkCiB,iBDrED,cAAA,CC2FH,KAAY,EAAA,OAAA,CAAA,EAAA,KAAA,ID3FgC,YC2FhC;AAQzB;AAKA;AA6BA;AAIA;AAuBiB,cDxJJ,eAAA,SAAwB,YAAA,CCwJZ;EAKR,MAAA,EAAA,MAAA;EAwCA,UAAA,EAAA,MAAc;EAoBd;AAOjB;AAOA;AAmBA;AAIA;AA6BC;EAEkC,IAAA,EAAA,MAAA,GAAA,SAAA;EAClB,WAAA,CAAA,OAAA,EAAA,MAAA,EAAA,MAAA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storage-js/dist/index.mjs.map ADDED
The diff for this file is too large to render. See raw diff
 
node_modules/@supabase/storage-js/dist/umd/supabase.js ADDED
@@ -0,0 +1 @@
 
 
1
+ var supabase=(function(e){var t=class extends Error{constructor(e,t=`storage`,n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t===`vectors`?`StorageVectorsError`:`StorageError`,this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function n(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var r=class extends t{constructor(e,t,n,r=`storage`,i){super(e,r,t,n),this.name=r===`vectors`?`StorageVectorsApiError`:`StorageApiError`,this.status=t,this.statusCode=n,this.code=i}toJSON(){return{...super.toJSON(),code:this.code}}},i=class extends t{constructor(e,t,n=`storage`){super(e,n),this.name=n===`vectors`?`StorageVectorsUnknownError`:`StorageUnknownError`,this.originalError=t}},a=class extends t{constructor(e){super(e,`vectors`)}};function o(e){return n(e)&&e.namespace===`vectors`}var s=class extends r{constructor(e,t,n){super(e,t,n,`vectors`)}},c=class extends i{constructor(e,t){super(e,t,`vectors`)}};let l=function(e){return e.InternalError=`InternalError`,e.S3VectorConflictException=`S3VectorConflictException`,e.S3VectorNotFoundException=`S3VectorNotFoundException`,e.S3VectorBucketNotEmpty=`S3VectorBucketNotEmpty`,e.S3VectorMaxBucketsExceeded=`S3VectorMaxBucketsExceeded`,e.S3VectorMaxIndexesExceeded=`S3VectorMaxIndexesExceeded`,e}({});function u(e,t,n){let r={...e},i=t.toLowerCase();for(let e of Object.keys(r))e.toLowerCase()===i&&delete r[e];return r[i]=n,r}function d(e){let t={};for(let[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}let f=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),p=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},m=e=>{if(Array.isArray(e))return e.map(e=>m(e));if(typeof e==`function`||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,n])=>{let r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,``));t[r]=m(n)}),t},h=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),g=e=>e.split(`/`).map(encodeURIComponent).join(`/`),_=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error;if(typeof t.error==`object`&&t.error!==null){let e=t.error;if(typeof e.message==`string`)return e.message}}return JSON.stringify(e)},v=async(e,t,n,a)=>{if(typeof e==`object`&&e&&`json`in e&&typeof e.json==`function`){let n=e,i=parseInt(String(n.status),10);Number.isFinite(i)||(i=500),n.json().then(e=>{let n=e?.statusCode||e?.code||i+``;t(new r(_(e),i,n,a,e?.code))}).catch(()=>{let e=i+``;t(new r(n.statusText||`HTTP ${i} error`,i,e,a))})}else t(new i(_(e),e,a))},y=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return{...i,...n};if(p(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=u(e,`Content-Type`,n??`application/json`),i.body=JSON.stringify(r)}else i.body=r;return t?.duplex&&(i.duplex=t.duplex),{...i,...n}};async function b(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,y(t,r,i,a)).then(e=>{if(!e.ok)throw e;if(r?.noResolveJson)return e;if(o===`vectors`){let t=e.headers.get(`content-type`);if(e.headers.get(`content-length`)===`0`||e.status===204||!t||!t.includes(`application/json`))return{}}return e.json()}).then(e=>s(e)).catch(e=>v(e,c,r,o))})}function x(e=`storage`){return{get:async(t,n,r,i)=>b(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>b(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>b(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>b(t,`HEAD`,n,{...r,noResolveJson:!0},i,void 0,e),remove:async(t,n,r,i,a)=>b(t,`DELETE`,n,i,a,r,e)}}let{get:S,post:C,put:w,head:T,remove:E}=x(`storage`),D=x(`vectors`);var O=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=d(t),this.fetch=f(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=u(this.headers,e,t),this}async handleOperation(e){try{return{data:await e(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(n(e))return{data:null,error:e};throw e}}};let k;var A=class{static{k=Symbol.toStringTag}constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[k]=`StreamDownloadBuilder`,this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){try{return{data:(await this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(n(e))return{data:null,error:e};throw e}}};let j;var M=class{static{j=Symbol.toStringTag}constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[j]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new A(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){try{return{data:await(await this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(n(e))return{data:null,error:e};throw e}}};let N={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},P={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1};var F=class extends O{constructor(e,t={},n,r){super(e,t,r,`storage`),this.bucketId=n}async uploadOrUpdate(e,t,n,r){return this.handleOperation(async()=>{let i,a={...P,...r},o={...this.headers,...e===`POST`&&{"x-upsert":String(a.upsert)}},s=a.metadata;if(typeof Blob<`u`&&n instanceof Blob?(i=new FormData,i.append(`cacheControl`,a.cacheControl),s&&i.append(`metadata`,this.encodeMetadata(s)),i.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(i=n,i.has(`cacheControl`)||i.append(`cacheControl`,a.cacheControl),s&&!i.has(`metadata`)&&i.append(`metadata`,this.encodeMetadata(s))):(i=n,o[`cache-control`]=`max-age=${a.cacheControl}`,o[`content-type`]=a.contentType,s&&(o[`x-metadata`]=this.toBase64(this.encodeMetadata(s))),(typeof ReadableStream<`u`&&i instanceof ReadableStream||i&&typeof i==`object`&&`pipe`in i&&typeof i.pipe==`function`)&&!a.duplex&&(a.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))o=u(o,e,t);let c=this._removeEmptyFolders(t),l=this._getFinalPath(c),d=await(e==`PUT`?w:C)(this.fetch,`${this.url}/object/${l}`,i,{headers:o,...a?.duplex?{duplex:a.duplex}:{}});return{path:c,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate(`POST`,e,t,n)}async uploadToSignedUrl(e,t,n,r){let i=this._removeEmptyFolders(e),a=this._getFinalPath(i),o=new URL(this.url+`/object/upload/sign/${a}`);return o.searchParams.set(`token`,t),this.handleOperation(async()=>{let e,t={...P,...r},a={...this.headers,"x-upsert":String(t.upsert)},s=t.metadata;if(typeof Blob<`u`&&n instanceof Blob?(e=new FormData,e.append(`cacheControl`,t.cacheControl),s&&e.append(`metadata`,this.encodeMetadata(s)),e.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(e=n,e.has(`cacheControl`)||e.append(`cacheControl`,t.cacheControl),s&&!e.has(`metadata`)&&e.append(`metadata`,this.encodeMetadata(s))):(e=n,a[`cache-control`]=`max-age=${t.cacheControl}`,a[`content-type`]=t.contentType,s&&(a[`x-metadata`]=this.toBase64(this.encodeMetadata(s))),(typeof ReadableStream<`u`&&e instanceof ReadableStream||e&&typeof e==`object`&&`pipe`in e&&typeof e.pipe==`function`)&&!t.duplex&&(t.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))a=u(a,e,t);return{path:i,fullPath:(await w(this.fetch,o.toString(),e,{headers:a,...t?.duplex?{duplex:t.duplex}:{}})).Key}})}async createSignedUploadUrl(e,n){return this.handleOperation(async()=>{let r=this._getFinalPath(e),i={...this.headers};n?.upsert&&(i[`x-upsert`]=`true`);let a=await C(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(this.url+a.url),s=o.searchParams.get(`token`);if(!s)throw new t(`No token returned by API`);return{signedUrl:o.toString(),path:e,token:s}})}async update(e,t,n){return this.uploadOrUpdate(`PUT`,e,t,n)}async move(e,t,n){return this.handleOperation(async()=>await C(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:this.headers}))}async copy(e,t,n){return this.handleOperation(async()=>({path:(await C(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key}))}async createSignedUrl(e,t,n){return this.handleOperation(async()=>{let r=this._getFinalPath(e),i=typeof n?.transform==`object`&&n.transform!==null&&Object.keys(n.transform).length>0,a=await C(this.fetch,`${this.url}/object/sign/${r}`,{expiresIn:t,...i?{transform:n.transform}:{}},{headers:this.headers}),o=new URLSearchParams;n?.download&&o.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&o.set(`cacheNonce`,String(n.cacheNonce));let s=o.toString();return{signedUrl:encodeURI(`${this.url}${a.signedURL}${s?`&${s}`:``}`)}})}async createSignedUrls(e,t,n){return this.handleOperation(async()=>{let r=await C(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=new URLSearchParams;n?.download&&i.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&i.set(`cacheNonce`,String(n.cacheNonce));let a=i.toString();return r.map(e=>({...e,signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${a?`&${a}`:``}`):null}))})}download(e,t,n){let r=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image/authenticated`:`object`,i=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set(`cacheNonce`,String(t.cacheNonce));let a=i.toString(),o=this._getFinalPath(e);return new M(()=>S(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){let t=this._getFinalPath(e);return this.handleOperation(async()=>m(await S(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers})))}async exists(e){let t=this._getFinalPath(e);try{return await T(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(n(e)){let t=e instanceof r?e.status:e instanceof i?e.originalError?.status:void 0;if(t!==void 0&&[400,404].includes(t))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let n=this._getFinalPath(e),r=new URLSearchParams;t?.download&&r.set(`download`,t.download===!0?``:t.download),t?.transform&&this.applyTransformOptsToQuery(r,t.transform),t?.cacheNonce!=null&&r.set(`cacheNonce`,String(t.cacheNonce));let i=r.toString(),a=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image`:`object`;return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}`)+(i?`?${i}`:``)}}}async remove(e){return this.handleOperation(async()=>await E(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}))}async purgeCache(e,t,n){return this.handleOperation(async()=>{let r=g(this._getFinalPath(e)),i=new URLSearchParams;t?.transformations&&i.set(`transformations`,`true`);let a=i.toString();return await E(this.fetch,`${this.url}/cdn/${r}${a?`?${a}`:``}`,{},{headers:this.headers},n)})}async list(e,t,n){return this.handleOperation(async()=>{let r=t?.sortBy?{...N.sortBy,...t.sortBy}:N.sortBy,i={...N,...t,sortBy:r,prefix:e||``};return await C(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n)})}async listV2(e,t){return this.handleOperation(async()=>{let n={...e};return await C(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,``)}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,``).replace(/\/+/g,`/`)}applyTransformOptsToQuery(e,t){return t.width&&e.set(`width`,t.width.toString()),t.height&&e.set(`height`,t.height.toString()),t.resize&&e.set(`resize`,t.resize),t.format&&e.set(`format`,t.format),t.quality&&e.set(`quality`,t.quality.toString()),e}};let I={"X-Client-Info":`storage-js/2.112.3`};var L=class extends O{constructor(e,t={},n,r){let i=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes(`storage.supabase.`)&&(i.hostname=i.hostname.replace(`supabase.`,`storage.supabase.`));let a=i.href.replace(/\/$/,``),o={...I,...t};super(a,o,n,`storage`)}async listBuckets(e){return this.handleOperation(async()=>{let t=this.listBucketOptionsToQueryString(e);return await S(this.fetch,`${this.url}/bucket${t}`,{headers:this.headers})})}async getBucket(e){return this.handleOperation(async()=>await S(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}))}async createBucket(e,t={public:!1}){return this.handleOperation(async()=>await C(this.fetch,`${this.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}))}async updateBucket(e,t){return this.handleOperation(async()=>await w(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}))}async emptyBucket(e){return this.handleOperation(async()=>await C(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}))}async deleteBucket(e){return this.handleOperation(async()=>await E(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}))}async purgeBucketCache(e,t,n){return this.handleOperation(async()=>{let r=new URLSearchParams;t?.transformations&&r.set(`transformations`,`true`);let i=r.toString();return await E(this.fetch,`${this.url}/cdn/${g(e)}${i?`?${i}`:``}`,{},{headers:this.headers},n)})}listBucketOptionsToQueryString(e){let t={};return e&&(`limit`in e&&(t.limit=String(e.limit)),`offset`in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?`?`+new URLSearchParams(t).toString():``}},R=class extends Error{constructor(e,t){super(e),this.name=`IcebergError`,this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType===`CommitStateUnknownException`||[500,502,504].includes(t.status)&&t.icebergType?.includes(`CommitState`)===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function z(e,t,n){let r=new URL(t,e);if(n)for(let[e,t]of Object.entries(n))t!==void 0&&r.searchParams.set(e,t);return r.toString()}async function B(e){return!e||e.type===`none`?{}:e.type===`bearer`?{Authorization:`Bearer ${e.token}`}:e.type===`header`?{[e.name]:e.value}:e.type===`custom`?await e.getHeaders():{}}function V(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=z(e.baseUrl,r,i),c=await B(e.auth),l=await t(s,{method:n,headers:{...a?{"Content-Type":`application/json`}:{},...c,...o},body:a?JSON.stringify(a):void 0}),u=await l.text(),d=(l.headers.get(`content-type`)||``).includes(`application/json`),f=d&&u?JSON.parse(u):u;if(!l.ok){let e=d?f:void 0,t=e?.error;throw new R(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:f}}}}function H(e){return e.join(``)}var U=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:H(e.namespace)}:void 0;return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${H(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${H(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${H(e.namespace)}`}),!0}catch(e){if(e instanceof R&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof R&&e.status===409)return;throw e}}};function W(e){return e.join(``)}var G=class{constructor(e,t=``,n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${W(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let n={};return this.accessDelegation&&(n[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${W(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){let n=await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${W(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data[`metadata-location`],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${W(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${W(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation);try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${W(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof R&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof R&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},K=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`),this.client=V({baseUrl:e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new U(this.client,t),this.tableOps=new G(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},q=class extends O{constructor(e,t={},n){let r=e.replace(/\/$/,``),i={...I,...t};super(r,i,n,`storage`)}async createBucket(e){return this.handleOperation(async()=>await C(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}))}async listBuckets(e){return this.handleOperation(async()=>{let t=new URLSearchParams;e?.limit!==void 0&&t.set(`limit`,e.limit.toString()),e?.offset!==void 0&&t.set(`offset`,e.offset.toString()),e?.sortColumn&&t.set(`sortColumn`,e.sortColumn),e?.sortOrder&&t.set(`sortOrder`,e.sortOrder),e?.search&&t.set(`search`,e.search);let n=t.toString(),r=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return await S(this.fetch,r,{headers:this.headers})})}async deleteBucket(e){return this.handleOperation(async()=>await E(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}))}from(e){if(!h(e))throw new t(`Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.`);let n=new K({baseUrl:this.url,catalogName:e,auth:{type:`custom`,getHeaders:async()=>this.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){let n=e[t];return typeof n==`function`?async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(e){if(r)throw e;return{data:null,error:e}}}:n}})}},J=class extends O{constructor(e,t={},n){let r=e.replace(/\/$/,``),i={...I,"Content-Type":`application/json`,...t};super(r,i,n,`vectors`)}async createIndex(e){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers})||{})}async getIndex(e,t){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:this.headers}))}async listIndexes(e){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}))}async deleteIndex(e,t){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:this.headers})||{})}},Y=class extends O{constructor(e,t={},n){let r=e.replace(/\/$/,``),i={...I,"Content-Type":`application/json`,...t};super(r,i,n,`vectors`)}async putVectors(e){if(e.vectors.length<1||e.vectors.length>500)throw Error(`Vector batch size must be between 1 and 500 items`);return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers})||{})}async getVectors(e){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}))}async listVectors(e){if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw Error(`segmentCount must be between 1 and 16`);if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}))}async queryVectors(e){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}))}async deleteVectors(e){if(e.keys.length<1||e.keys.length>500)throw Error(`Keys batch size must be between 1 and 500 items`);return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers})||{})}},X=class extends O{constructor(e,t={},n){let r=e.replace(/\/$/,``),i={...I,"Content-Type":`application/json`,...t};super(r,i,n,`vectors`)}async createBucket(e){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers})||{})}async getBucket(e){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}))}async listBuckets(e={}){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}))}async deleteBucket(e){return this.handleOperation(async()=>await D.post(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers})||{})}},Z=class extends X{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new Q(this.url,this.headers,e,this.fetch)}async createBucket(e){return super.createBucket(e)}async getBucket(e){return super.getBucket(e)}async listBuckets(e={}){return super.listBuckets(e)}async deleteBucket(e){return super.deleteBucket(e)}},Q=class extends J{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){return super.createIndex({...e,vectorBucketName:this.vectorBucketName})}async listIndexes(e={}){return super.listIndexes({...e,vectorBucketName:this.vectorBucketName})}async getIndex(e){return super.getIndex(this.vectorBucketName,e)}async deleteIndex(e){return super.deleteIndex(this.vectorBucketName,e)}index(e){return new $(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},$=class extends Y{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){return super.putVectors({...e,vectorBucketName:this.vectorBucketName,indexName:this.indexName})}async getVectors(e){return super.getVectors({...e,vectorBucketName:this.vectorBucketName,indexName:this.indexName})}async listVectors(e={}){return super.listVectors({...e,vectorBucketName:this.vectorBucketName,indexName:this.indexName})}async queryVectors(e){return super.queryVectors({...e,vectorBucketName:this.vectorBucketName,indexName:this.indexName})}async deleteVectors(e){return super.deleteVectors({...e,vectorBucketName:this.vectorBucketName,indexName:this.indexName})}},ee=class extends L{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new F(this.url,this.headers,e,this.fetch)}get vectors(){return new Z(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new q(this.url+`/iceberg`,this.headers,this.fetch)}};return e.StorageAnalyticsClient=q,e.StorageApiError=r,e.StorageClient=ee,e.StorageError=t,e.StorageUnknownError=i,e.StorageVectorsApiError=s,e.StorageVectorsClient=Z,e.StorageVectorsError=a,e.StorageVectorsErrorCode=l,e.StorageVectorsUnknownError=c,e.VectorBucketApi=X,e.VectorBucketScope=Q,e.VectorDataApi=Y,e.VectorIndexApi=J,e.VectorIndexScope=$,e.isStorageError=n,e.isStorageVectorsError=o,e})({});
node_modules/@supabase/storage-js/migrations/README.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Migration notes for `@supabase/storage-js`
2
+
3
+ Each file in this directory describes one migration theme — what changed in `@supabase/storage-js`, who is affected, and what callers need to do.
4
+
5
+ Files are shipped with the npm package, so the migration notes you see here are pinned to the version of `@supabase/storage-js` you have installed. Upgrading the package brings the relevant migration notes along with it.
6
+
7
+ ## How agents should use this directory
8
+
9
+ When helping a developer upgrade `@supabase/storage-js`:
10
+
11
+ 1. Read the migration files in `node_modules/@supabase/storage-js/migrations/` for the version they have installed.
12
+ 2. Cross-reference against the version they are upgrading to.
13
+ 3. Apply the migration steps described in each relevant file.
14
+
15
+ ## How humans should use this directory
16
+
17
+ Browse the files for the migration theme you care about. Each file is self-contained and explains its own scope, audience, and steps.
18
+
19
+ ## File naming
20
+
21
+ One file per migration theme, named by topic rather than version (e.g. `<theme>.md`, kebab-case). A single version can ship multiple theme files; a single theme can span multiple versions. Each file documents its own `Since` / `Will require action by` version range internally.
22
+
23
+ ## Cross-cutting migration notes
24
+
25
+ Migrations that span multiple Supabase packages (e.g. Node.js version drops, monorepo restructures) live in [`docs/MIGRATION.md`](../../../../docs/MIGRATION.md) at the repository root, not here. This directory is scoped to `@supabase/storage-js` only.
node_modules/@supabase/storage-js/package.json ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@supabase/storage-js",
3
+ "version": "2.112.3",
4
+ "description": "Isomorphic storage client for Supabase.",
5
+ "keywords": [
6
+ "javascript",
7
+ "typescript",
8
+ "supabase"
9
+ ],
10
+ "homepage": "https://github.com/supabase/supabase-js/tree/master/packages/core/storage-js",
11
+ "bugs": "https://github.com/supabase/supabase-js/issues",
12
+ "license": "MIT",
13
+ "author": "Supabase",
14
+ "files": [
15
+ "dist",
16
+ "src",
17
+ "migrations",
18
+ "AGENTS.md"
19
+ ],
20
+ "main": "dist/index.cjs",
21
+ "module": "dist/index.mjs",
22
+ "types": "dist/index.d.cts",
23
+ "exports": {
24
+ ".": {
25
+ "import": {
26
+ "types": "./dist/index.d.mts",
27
+ "default": "./dist/index.mjs"
28
+ },
29
+ "require": {
30
+ "types": "./dist/index.d.cts",
31
+ "default": "./dist/index.cjs"
32
+ }
33
+ },
34
+ "./dist/*": "./dist/*",
35
+ "./package.json": "./package.json"
36
+ },
37
+ "sideEffects": false,
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/supabase/supabase-js.git",
41
+ "directory": "packages/core/storage-js"
42
+ },
43
+ "dependencies": {
44
+ "iceberg-js": "^0.8.1",
45
+ "tslib": "2.8.1"
46
+ },
47
+ "devDependencies": {
48
+ "@types/jest": "30.0.0",
49
+ "@types/node": "20.19.9",
50
+ "jest": "30.4.2",
51
+ "ts-jest": "^29.4.9",
52
+ "tsdown": "^0.18.0",
53
+ "typedoc": "^0.27.9",
54
+ "typescript": "~5.8.3"
55
+ },
56
+ "jsdelivr": "dist/umd/supabase.js",
57
+ "unpkg": "dist/umd/supabase.js",
58
+ "publishConfig": {
59
+ "access": "public"
60
+ },
61
+ "engines": {
62
+ "node": ">=22.0.0"
63
+ },
64
+ "scripts": {
65
+ "build": "tsdown",
66
+ "build:watch": "tsdown --watch",
67
+ "docs": "typedoc --options ../../../typedoc.base.mjs --entryPoints src/index.ts --out docs/v2 --entryPoints src/packages/* --excludePrivate --excludeProtected",
68
+ "docs:json": "typedoc --options ../../../typedoc.base.mjs --json docs/v2/spec.json --entryPoints src/index.ts --entryPoints src/packages/* --excludePrivate --excludeExternals --excludeProtected"
69
+ }
70
+ }
node_modules/@supabase/storage-js/src/StorageClient.ts ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import StorageFileApi from './packages/StorageFileApi'
2
+ import StorageBucketApi from './packages/StorageBucketApi'
3
+ import StorageAnalyticsClient from './packages/StorageAnalyticsClient'
4
+ import { Fetch } from './lib/common/fetch'
5
+ import { StorageVectorsClient } from './packages/StorageVectorsClient'
6
+
7
+ export interface StorageClientOptions {
8
+ useNewHostname?: boolean
9
+ }
10
+
11
+ export class StorageClient extends StorageBucketApi {
12
+ /**
13
+ * Creates a client for Storage buckets, files, analytics, and vectors.
14
+ *
15
+ * @category Storage
16
+ * @subcategory File Buckets
17
+ *
18
+ * @example Using supabase-js (recommended)
19
+ * ```ts
20
+ * import { createClient } from '@supabase/supabase-js'
21
+ *
22
+ * const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')
23
+ * const avatars = supabase.storage.from('avatars')
24
+ * ```
25
+ *
26
+ * @example Standalone import for bundle-sensitive environments
27
+ * ```ts
28
+ * import { StorageClient } from '@supabase/storage-js'
29
+ *
30
+ * const storage = new StorageClient('https://xyzcompany.supabase.co/storage/v1', {
31
+ * apikey: 'your-publishable-key',
32
+ * })
33
+ * const avatars = storage.from('avatars')
34
+ * ```
35
+ */
36
+ constructor(
37
+ url: string,
38
+ headers: { [key: string]: string } = {},
39
+ fetch?: Fetch,
40
+ opts?: StorageClientOptions
41
+ ) {
42
+ super(url, headers, fetch, opts)
43
+ }
44
+
45
+ /**
46
+ * Perform file operation in a bucket.
47
+ *
48
+ * @category Storage
49
+ * @subcategory File Buckets
50
+ *
51
+ * @param id The bucket id to operate on.
52
+ *
53
+ * @example Accessing a bucket
54
+ * ```typescript
55
+ * const avatars = supabase.storage.from('avatars')
56
+ * ```
57
+ */
58
+ from(id: string): StorageFileApi {
59
+ return new StorageFileApi(this.url, this.headers, id, this.fetch)
60
+ }
61
+
62
+ /**
63
+ *
64
+ * @alpha
65
+ *
66
+ * Access vector storage operations.
67
+ *
68
+ * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
69
+ *
70
+ * @category Storage
71
+ * @subcategory Vector Buckets
72
+ *
73
+ * @returns A StorageVectorsClient instance configured with the current storage settings.
74
+ */
75
+ get vectors(): StorageVectorsClient {
76
+ return new StorageVectorsClient(this.url + '/vector', {
77
+ headers: this.headers,
78
+ fetch: this.fetch,
79
+ })
80
+ }
81
+
82
+ /**
83
+ *
84
+ * @alpha
85
+ *
86
+ * Access analytics storage operations using Iceberg tables.
87
+ *
88
+ * **Public alpha:** This API is part of a public alpha release and may not be available to your account type.
89
+ *
90
+ * @category Storage
91
+ * @subcategory Analytics Buckets
92
+ *
93
+ * @returns A StorageAnalyticsClient instance configured with the current storage settings.
94
+ */
95
+ get analytics(): StorageAnalyticsClient {
96
+ return new StorageAnalyticsClient(this.url + '/iceberg', this.headers, this.fetch)
97
+ }
98
+ }
node_modules/@supabase/storage-js/src/index.ts ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export { StorageClient } from './StorageClient'
2
+ export type { StorageClientOptions } from './StorageClient'
3
+ export { default as StorageAnalyticsClient } from './packages/StorageAnalyticsClient'
4
+
5
+ // Vector Storage
6
+ export {
7
+ StorageVectorsClient,
8
+ VectorBucketScope,
9
+ VectorIndexScope,
10
+ } from './packages/StorageVectorsClient'
11
+ export type { StorageVectorsClientOptions } from './packages/StorageVectorsClient'
12
+ export { default as VectorBucketApi } from './packages/VectorBucketApi'
13
+ export { default as VectorDataApi } from './packages/VectorDataApi'
14
+ export { default as VectorIndexApi } from './packages/VectorIndexApi'
15
+ export type { CreateIndexOptions } from './packages/VectorIndexApi'
16
+
17
+ // Types and Errors
18
+ export * from './lib/types'
19
+ export * from './lib/common/errors'
node_modules/@supabase/storage-js/src/lib/common/BaseApiClient.ts ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { ErrorNamespace, isStorageError, StorageError } from './errors'
2
+ import { Fetch } from './fetch'
3
+ import { normalizeHeaders, setHeader as setHeaderUtil } from './headers'
4
+ import { resolveFetch } from './helpers'
5
+
6
+ /**
7
+ * @ignore
8
+ * Base API client class for all Storage API classes
9
+ * Provides common infrastructure for error handling and configuration
10
+ *
11
+ * @typeParam TError - The error type (StorageError or subclass)
12
+ */
13
+ export default abstract class BaseApiClient<TError extends StorageError = StorageError> {
14
+ protected url: string
15
+ protected headers: { [key: string]: string }
16
+ protected fetch: Fetch
17
+ protected shouldThrowOnError = false
18
+ protected namespace: ErrorNamespace
19
+
20
+ /**
21
+ * Creates a new BaseApiClient instance
22
+ * @param url - Base URL for API requests
23
+ * @param headers - Default headers for API requests
24
+ * @param fetch - Optional custom fetch implementation
25
+ * @param namespace - Error namespace ('storage' or 'vectors')
26
+ */
27
+ constructor(
28
+ url: string,
29
+ headers: { [key: string]: string } = {},
30
+ fetch?: Fetch,
31
+ namespace: ErrorNamespace = 'storage'
32
+ ) {
33
+ this.url = url
34
+ this.headers = normalizeHeaders(headers)
35
+ this.fetch = resolveFetch(fetch)
36
+ this.namespace = namespace
37
+ }
38
+
39
+ /**
40
+ * Enable throwing errors instead of returning them.
41
+ * When enabled, errors are thrown instead of returned in { data, error } format.
42
+ *
43
+ * @returns this - For method chaining
44
+ */
45
+ public throwOnError(): this {
46
+ this.shouldThrowOnError = true
47
+ return this
48
+ }
49
+
50
+ /**
51
+ * Set an HTTP header for the request.
52
+ * Creates a shallow copy of headers to avoid mutating shared state.
53
+ *
54
+ * @param name - Header name
55
+ * @param value - Header value
56
+ * @returns this - For method chaining
57
+ */
58
+ public setHeader(name: string, value: string): this {
59
+ this.headers = setHeaderUtil(this.headers, name, value)
60
+ return this
61
+ }
62
+
63
+ /**
64
+ * Handles API operation with standardized error handling
65
+ * Eliminates repetitive try-catch blocks across all API methods
66
+ *
67
+ * This wrapper:
68
+ * 1. Executes the operation
69
+ * 2. Returns { data, error: null } on success
70
+ * 3. Returns { data: null, error } on failure (if shouldThrowOnError is false)
71
+ * 4. Throws error on failure (if shouldThrowOnError is true)
72
+ *
73
+ * @typeParam T - The expected data type from the operation
74
+ * @param operation - Async function that performs the API call
75
+ * @returns Promise with { data, error } tuple
76
+ *
77
+ * @example Handling an operation
78
+ * ```typescript
79
+ * async listBuckets() {
80
+ * return this.handleOperation(async () => {
81
+ * return await get(this.fetch, `${this.url}/bucket`, {
82
+ * headers: this.headers,
83
+ * })
84
+ * })
85
+ * }
86
+ * ```
87
+ */
88
+ protected async handleOperation<T>(
89
+ operation: () => Promise<T>
90
+ ): Promise<{ data: T; error: null } | { data: null; error: TError }> {
91
+ try {
92
+ const data = await operation()
93
+ return { data, error: null }
94
+ } catch (error) {
95
+ if (this.shouldThrowOnError) {
96
+ throw error
97
+ }
98
+ if (isStorageError(error)) {
99
+ return { data: null, error: error as TError }
100
+ }
101
+ throw error
102
+ }
103
+ }
104
+ }
node_modules/@supabase/storage-js/src/lib/common/errors.ts ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Namespace type for error classes
3
+ * Determines the error class names and type guards
4
+ */
5
+ export type ErrorNamespace = 'storage' | 'vectors'
6
+
7
+ /**
8
+ * Base error class for all Storage errors
9
+ * Supports both 'storage' and 'vectors' namespaces
10
+ */
11
+ export class StorageError extends Error {
12
+ protected __isStorageError = true
13
+ protected namespace: ErrorNamespace
14
+ status: number | undefined
15
+ statusCode: string | undefined
16
+
17
+ constructor(
18
+ message: string,
19
+ namespace: ErrorNamespace = 'storage',
20
+ status?: number,
21
+ statusCode?: string
22
+ ) {
23
+ super(message)
24
+ this.namespace = namespace
25
+ this.name = namespace === 'vectors' ? 'StorageVectorsError' : 'StorageError'
26
+ this.status = status
27
+ this.statusCode = statusCode
28
+ }
29
+
30
+ toJSON(): {
31
+ name: string
32
+ message: string
33
+ status: number | undefined
34
+ statusCode: string | undefined
35
+ } {
36
+ return {
37
+ name: this.name,
38
+ message: this.message,
39
+ status: this.status,
40
+ statusCode: this.statusCode,
41
+ }
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Type guard to check if an error is a StorageError
47
+ * @param error - The error to check
48
+ * @returns True if the error is a StorageError
49
+ */
50
+ export function isStorageError(error: unknown): error is StorageError {
51
+ return typeof error === 'object' && error !== null && '__isStorageError' in error
52
+ }
53
+
54
+ /**
55
+ * API error returned from Storage service
56
+ * Includes HTTP status code and service-specific error code
57
+ */
58
+ export class StorageApiError extends StorageError {
59
+ override status: number
60
+ override statusCode: string
61
+ /**
62
+ * Service-specific error code from the Storage API response body, such as
63
+ * `NoSuchKey`, `AccessDenied` or `ResourceAlreadyExists`. Use this to branch
64
+ * on the specific error rather than parsing the message.
65
+ * @see https://supabase.com/docs/guides/storage/debugging/error-codes
66
+ */
67
+ code: string | undefined
68
+
69
+ constructor(
70
+ message: string,
71
+ status: number,
72
+ statusCode: string,
73
+ namespace: ErrorNamespace = 'storage',
74
+ code?: string
75
+ ) {
76
+ super(message, namespace, status, statusCode)
77
+ this.name = namespace === 'vectors' ? 'StorageVectorsApiError' : 'StorageApiError'
78
+ this.status = status
79
+ this.statusCode = statusCode
80
+ this.code = code
81
+ }
82
+
83
+ toJSON(): {
84
+ name: string
85
+ message: string
86
+ status: number | undefined
87
+ statusCode: string | undefined
88
+ code: string | undefined
89
+ } {
90
+ return {
91
+ ...super.toJSON(),
92
+ code: this.code,
93
+ }
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Unknown error that doesn't match expected error patterns
99
+ * Wraps the original error for debugging
100
+ */
101
+ export class StorageUnknownError extends StorageError {
102
+ originalError: unknown
103
+
104
+ constructor(message: string, originalError: unknown, namespace: ErrorNamespace = 'storage') {
105
+ super(message, namespace)
106
+ this.name = namespace === 'vectors' ? 'StorageVectorsUnknownError' : 'StorageUnknownError'
107
+ this.originalError = originalError
108
+ }
109
+ }
110
+
111
+ // ============================================================================
112
+ // Backward Compatibility Exports for Vectors
113
+ // ============================================================================
114
+
115
+ /**
116
+ * @deprecated Use StorageError with namespace='vectors' instead
117
+ * Alias for backward compatibility with existing vector storage code
118
+ */
119
+ export class StorageVectorsError extends StorageError {
120
+ constructor(message: string) {
121
+ super(message, 'vectors')
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Type guard to check if an error is a StorageVectorsError
127
+ * @param error - The error to check
128
+ * @returns True if the error is a StorageVectorsError
129
+ */
130
+ export function isStorageVectorsError(error: unknown): error is StorageVectorsError {
131
+ return isStorageError(error) && (error as StorageError)['namespace'] === 'vectors'
132
+ }
133
+
134
+ /**
135
+ * @deprecated Use StorageApiError with namespace='vectors' instead
136
+ * Alias for backward compatibility with existing vector storage code
137
+ */
138
+ export class StorageVectorsApiError extends StorageApiError {
139
+ constructor(message: string, status: number, statusCode: string) {
140
+ super(message, status, statusCode, 'vectors')
141
+ }
142
+ }
143
+
144
+ /**
145
+ * @deprecated Use StorageUnknownError with namespace='vectors' instead
146
+ * Alias for backward compatibility with existing vector storage code
147
+ */
148
+ export class StorageVectorsUnknownError extends StorageUnknownError {
149
+ constructor(message: string, originalError: unknown) {
150
+ super(message, originalError, 'vectors')
151
+ }
152
+ }
153
+
154
+ /**
155
+ * Error codes specific to S3 Vectors API
156
+ * Maps AWS service errors to application-friendly error codes
157
+ */
158
+ export enum StorageVectorsErrorCode {
159
+ /** Internal server fault (HTTP 500) */
160
+ InternalError = 'InternalError',
161
+ /** Resource already exists / conflict (HTTP 409) */
162
+ S3VectorConflictException = 'S3VectorConflictException',
163
+ /** Resource not found (HTTP 404) */
164
+ S3VectorNotFoundException = 'S3VectorNotFoundException',
165
+ /** Delete bucket while not empty (HTTP 400) */
166
+ S3VectorBucketNotEmpty = 'S3VectorBucketNotEmpty',
167
+ /** Exceeds bucket quota/limit (HTTP 400) */
168
+ S3VectorMaxBucketsExceeded = 'S3VectorMaxBucketsExceeded',
169
+ /** Exceeds index quota/limit (HTTP 400) */
170
+ S3VectorMaxIndexesExceeded = 'S3VectorMaxIndexesExceeded',
171
+ }
node_modules/@supabase/storage-js/src/lib/common/fetch.ts ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { StorageApiError, StorageError, StorageUnknownError, ErrorNamespace } from './errors'
2
+ import { setHeader } from './headers'
3
+ import { isPlainObject, resolveResponse } from './helpers'
4
+ import { FetchParameters } from '../types'
5
+
6
+ export type Fetch = typeof fetch
7
+
8
+ /**
9
+ * Options for fetch requests
10
+ */
11
+ export interface FetchOptions {
12
+ headers?: {
13
+ [key: string]: string
14
+ }
15
+ duplex?: string
16
+ noResolveJson?: boolean
17
+ }
18
+
19
+ /**
20
+ * HTTP methods supported by the API
21
+ */
22
+ export type RequestMethodType = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD'
23
+
24
+ /**
25
+ * Extracts error message from various error response formats
26
+ * @param err - Error object from API
27
+ * @returns Human-readable error message
28
+ */
29
+ const _getErrorMessage = (err: unknown): string => {
30
+ if (typeof err === 'object' && err !== null) {
31
+ const e = err as Record<string, unknown>
32
+ if (typeof e.msg === 'string') return e.msg
33
+ if (typeof e.message === 'string') return e.message
34
+ if (typeof e.error_description === 'string') return e.error_description
35
+ if (typeof e.error === 'string') return e.error
36
+ if (typeof e.error === 'object' && e.error !== null) {
37
+ const nested = e.error as Record<string, unknown>
38
+ if (typeof nested.message === 'string') return nested.message
39
+ }
40
+ }
41
+ return JSON.stringify(err)
42
+ }
43
+
44
+ /**
45
+ * Handles fetch errors and converts them to Storage error types
46
+ * @param error - The error caught from fetch
47
+ * @param reject - Promise rejection function
48
+ * @param options - Fetch options that may affect error handling
49
+ * @param namespace - Error namespace ('storage' or 'vectors')
50
+ */
51
+ const handleError = async (
52
+ error: unknown,
53
+ reject: (reason: StorageError) => void,
54
+ options: FetchOptions | undefined,
55
+ namespace: ErrorNamespace
56
+ ) => {
57
+ // Structural detection of json() method, present in all Response implementations
58
+ // (native, node-fetch, cross-fetch, undici) and absent from standard Error objects.
59
+ // Checking 'ok' or 'status' via `in` is unreliable across fetch polyfills/realms.
60
+ const isResponseLike =
61
+ error !== null &&
62
+ typeof error === 'object' &&
63
+ 'json' in error &&
64
+ typeof (error as Record<string, unknown>).json === 'function'
65
+
66
+ if (isResponseLike) {
67
+ const responseError = error as Response
68
+ // Defensive coercion: some fetch polyfills have historically returned status as a string.
69
+ let status = parseInt(String(responseError.status), 10)
70
+ if (!Number.isFinite(status)) {
71
+ status = 500
72
+ }
73
+
74
+ responseError
75
+ .json()
76
+ .then(
77
+ (err: { statusCode?: string; code?: string; error?: string; message?: string } | null) => {
78
+ const statusCode = err?.statusCode || err?.code || status + ''
79
+ reject(
80
+ new StorageApiError(_getErrorMessage(err), status, statusCode, namespace, err?.code)
81
+ )
82
+ }
83
+ )
84
+ .catch(() => {
85
+ const statusCode = status + ''
86
+ const message = responseError.statusText || `HTTP ${status} error`
87
+ reject(new StorageApiError(message, status, statusCode, namespace))
88
+ })
89
+ } else {
90
+ reject(new StorageUnknownError(_getErrorMessage(error), error, namespace))
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Builds request parameters for fetch calls
96
+ * @param method - HTTP method
97
+ * @param options - Custom fetch options
98
+ * @param parameters - Additional fetch parameters like AbortSignal
99
+ * @param body - Request body (will be JSON stringified if plain object)
100
+ * @returns Complete fetch request parameters
101
+ */
102
+ const _getRequestParams = (
103
+ method: RequestMethodType,
104
+ options?: FetchOptions,
105
+ parameters?: FetchParameters,
106
+ body?: object
107
+ ) => {
108
+ const params: { [k: string]: any } = { method, headers: options?.headers || {} }
109
+
110
+ if (method === 'GET' || method === 'HEAD' || !body) {
111
+ return { ...params, ...parameters }
112
+ }
113
+
114
+ if (isPlainObject(body)) {
115
+ const headers = options?.headers || {}
116
+ let contentType: string | undefined
117
+
118
+ for (const [key, value] of Object.entries(headers)) {
119
+ if (key.toLowerCase() === 'content-type') {
120
+ contentType = value
121
+ }
122
+ }
123
+
124
+ params.headers = setHeader(headers, 'Content-Type', contentType ?? 'application/json')
125
+ params.body = JSON.stringify(body)
126
+ } else {
127
+ params.body = body
128
+ }
129
+
130
+ if (options?.duplex) {
131
+ params.duplex = options.duplex
132
+ }
133
+
134
+ return { ...params, ...parameters }
135
+ }
136
+
137
+ /**
138
+ * Internal request handler that wraps fetch with error handling
139
+ * @param fetcher - Fetch function to use
140
+ * @param method - HTTP method
141
+ * @param url - Request URL
142
+ * @param options - Custom fetch options
143
+ * @param parameters - Additional fetch parameters
144
+ * @param body - Request body
145
+ * @param namespace - Error namespace ('storage' or 'vectors')
146
+ * @returns Promise with parsed response or error
147
+ */
148
+ async function _handleRequest(
149
+ fetcher: Fetch,
150
+ method: RequestMethodType,
151
+ url: string,
152
+ options: FetchOptions | undefined,
153
+ parameters: FetchParameters | undefined,
154
+ body: object | undefined,
155
+ namespace: ErrorNamespace
156
+ ): Promise<any> {
157
+ return new Promise((resolve, reject) => {
158
+ fetcher(url, _getRequestParams(method, options, parameters, body))
159
+ .then((result) => {
160
+ if (!result.ok) throw result
161
+ if (options?.noResolveJson) return result
162
+
163
+ // AWS S3 Vectors API returns 200 OK with content-length: 0 for successful mutations
164
+ // (putVectors, deleteVectors) instead of 204 or JSON response. This is AWS's design choice
165
+ // for performance optimization of bulk operations (up to 500 vectors per request).
166
+ // We handle this to prevent "Unexpected end of JSON input" errors when calling result.json()
167
+ if (namespace === 'vectors') {
168
+ const contentType = result.headers.get('content-type')
169
+ const contentLength = result.headers.get('content-length')
170
+
171
+ // Return empty object for explicitly empty responses
172
+ if (contentLength === '0' || result.status === 204) {
173
+ return {}
174
+ }
175
+
176
+ // Return empty object if no JSON content type
177
+ if (!contentType || !contentType.includes('application/json')) {
178
+ return {}
179
+ }
180
+ }
181
+
182
+ return result.json()
183
+ })
184
+ .then((data) => resolve(data))
185
+ .catch((error) => handleError(error, reject, options, namespace))
186
+ })
187
+ }
188
+
189
+ /**
190
+ * Creates a fetch API with the specified namespace
191
+ * @param namespace - Error namespace ('storage' or 'vectors')
192
+ * @returns Object with HTTP method functions
193
+ */
194
+ export function createFetchApi(namespace: ErrorNamespace = 'storage') {
195
+ return {
196
+ /**
197
+ * Performs a GET request
198
+ * @param fetcher - Fetch function to use
199
+ * @param url - Request URL
200
+ * @param options - Custom fetch options
201
+ * @param parameters - Additional fetch parameters
202
+ * @returns Promise with parsed response
203
+ */
204
+ get: async (
205
+ fetcher: Fetch,
206
+ url: string,
207
+ options?: FetchOptions,
208
+ parameters?: FetchParameters
209
+ ): Promise<any> => {
210
+ return _handleRequest(fetcher, 'GET', url, options, parameters, undefined, namespace)
211
+ },
212
+
213
+ /**
214
+ * Performs a POST request
215
+ * @param fetcher - Fetch function to use
216
+ * @param url - Request URL
217
+ * @param body - Request body to be JSON stringified
218
+ * @param options - Custom fetch options
219
+ * @param parameters - Additional fetch parameters
220
+ * @returns Promise with parsed response
221
+ */
222
+ post: async (
223
+ fetcher: Fetch,
224
+ url: string,
225
+ body: object,
226
+ options?: FetchOptions,
227
+ parameters?: FetchParameters
228
+ ): Promise<any> => {
229
+ return _handleRequest(fetcher, 'POST', url, options, parameters, body, namespace)
230
+ },
231
+
232
+ /**
233
+ * Performs a PUT request
234
+ * @param fetcher - Fetch function to use
235
+ * @param url - Request URL
236
+ * @param body - Request body to be JSON stringified
237
+ * @param options - Custom fetch options
238
+ * @param parameters - Additional fetch parameters
239
+ * @returns Promise with parsed response
240
+ */
241
+ put: async (
242
+ fetcher: Fetch,
243
+ url: string,
244
+ body: object,
245
+ options?: FetchOptions,
246
+ parameters?: FetchParameters
247
+ ): Promise<any> => {
248
+ return _handleRequest(fetcher, 'PUT', url, options, parameters, body, namespace)
249
+ },
250
+
251
+ /**
252
+ * Performs a HEAD request
253
+ * @param fetcher - Fetch function to use
254
+ * @param url - Request URL
255
+ * @param options - Custom fetch options
256
+ * @param parameters - Additional fetch parameters
257
+ * @returns Promise with Response object (not JSON parsed)
258
+ */
259
+ head: async (
260
+ fetcher: Fetch,
261
+ url: string,
262
+ options?: FetchOptions,
263
+ parameters?: FetchParameters
264
+ ): Promise<any> => {
265
+ return _handleRequest(
266
+ fetcher,
267
+ 'HEAD',
268
+ url,
269
+ {
270
+ ...options,
271
+ noResolveJson: true,
272
+ },
273
+ parameters,
274
+ undefined,
275
+ namespace
276
+ )
277
+ },
278
+
279
+ /**
280
+ * Performs a DELETE request
281
+ * @param fetcher - Fetch function to use
282
+ * @param url - Request URL
283
+ * @param body - Request body to be JSON stringified
284
+ * @param options - Custom fetch options
285
+ * @param parameters - Additional fetch parameters
286
+ * @returns Promise with parsed response
287
+ */
288
+ remove: async (
289
+ fetcher: Fetch,
290
+ url: string,
291
+ body: object,
292
+ options?: FetchOptions,
293
+ parameters?: FetchParameters
294
+ ): Promise<any> => {
295
+ return _handleRequest(fetcher, 'DELETE', url, options, parameters, body, namespace)
296
+ },
297
+ }
298
+ }
299
+
300
+ // Default exports for backward compatibility with 'storage' namespace
301
+ const defaultApi = createFetchApi('storage')
302
+ export const { get, post, put, head, remove } = defaultApi
303
+
304
+ // Vectors API with 'vectors' namespace for proper error handling
305
+ export const vectorsApi = createFetchApi('vectors')
node_modules/@supabase/storage-js/src/lib/common/headers.ts ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Sets a header with case-insensitive deduplication.
3
+ * Removes any existing headers whose name matches (case-insensitive),
4
+ * then sets the value under the lowercase key. Does not mutate the input object.
5
+ *
6
+ * @param headers - Existing headers object
7
+ * @param name - Header name to set (stored as lowercase)
8
+ * @param value - Header value
9
+ * @returns New headers object with the header set
10
+ */
11
+ export function setHeader(
12
+ headers: Record<string, string>,
13
+ name: string,
14
+ value: string
15
+ ): Record<string, string> {
16
+ const result = { ...headers }
17
+ const nameLower = name.toLowerCase()
18
+
19
+ for (const key of Object.keys(result)) {
20
+ if (key.toLowerCase() === nameLower) {
21
+ delete result[key]
22
+ }
23
+ }
24
+
25
+ result[nameLower] = value
26
+ return result
27
+ }
28
+
29
+ /**
30
+ * Normalizes all header keys to lowercase with case-insensitive deduplication.
31
+ * When duplicate keys exist (differing only in case), the last value wins.
32
+ * Does not mutate the input object.
33
+ *
34
+ * @param headers - Headers object to normalize
35
+ * @returns New headers object with all keys lowercased
36
+ */
37
+ export function normalizeHeaders(headers: Record<string, string>): Record<string, string> {
38
+ const result: Record<string, string> = {}
39
+ for (const [key, value] of Object.entries(headers)) {
40
+ result[key.toLowerCase()] = value
41
+ }
42
+ return result
43
+ }
node_modules/@supabase/storage-js/src/lib/common/helpers.ts ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ type Fetch = typeof fetch
2
+
3
+ /**
4
+ * Resolves the fetch implementation to use
5
+ * Uses custom fetch if provided, otherwise uses native fetch
6
+ *
7
+ * @param customFetch - Optional custom fetch implementation
8
+ * @returns Resolved fetch function
9
+ */
10
+ export const resolveFetch = (customFetch?: Fetch): Fetch => {
11
+ if (customFetch) {
12
+ return (...args) => customFetch(...args)
13
+ }
14
+ return (...args) => fetch(...args)
15
+ }
16
+
17
+ /**
18
+ * Resolves the Response constructor to use
19
+ * Returns native Response constructor
20
+ *
21
+ * @returns Response constructor
22
+ */
23
+ export const resolveResponse = (): typeof Response => {
24
+ return Response
25
+ }
26
+
27
+ /**
28
+ * Determine if input is a plain object
29
+ * An object is plain if it's created by either {}, new Object(), or Object.create(null)
30
+ *
31
+ * @param value - Value to check
32
+ * @returns True if value is a plain object
33
+ * @source https://github.com/sindresorhus/is-plain-obj
34
+ */
35
+ export const isPlainObject = (value: object): boolean => {
36
+ if (typeof value !== 'object' || value === null) {
37
+ return false
38
+ }
39
+
40
+ const prototype = Object.getPrototypeOf(value)
41
+ return (
42
+ (prototype === null ||
43
+ prototype === Object.prototype ||
44
+ Object.getPrototypeOf(prototype) === null) &&
45
+ !(Symbol.toStringTag in value) &&
46
+ !(Symbol.iterator in value)
47
+ )
48
+ }
49
+
50
+ /**
51
+ * Recursively converts object keys from snake_case to camelCase
52
+ * Used for normalizing API responses
53
+ *
54
+ * @param item - Object to convert
55
+ * @returns Converted object with camelCase keys
56
+ */
57
+ export const recursiveToCamel = (item: Record<string, any>): unknown => {
58
+ if (Array.isArray(item)) {
59
+ return item.map((el) => recursiveToCamel(el))
60
+ } else if (typeof item === 'function' || item !== Object(item)) {
61
+ return item
62
+ }
63
+
64
+ const result: Record<string, any> = {}
65
+ Object.entries(item).forEach(([key, value]) => {
66
+ const newKey = key.replace(/([-_][a-z])/gi, (c) => c.toUpperCase().replace(/[-_]/g, ''))
67
+ result[newKey] = recursiveToCamel(value)
68
+ })
69
+
70
+ return result
71
+ }
72
+
73
+ /**
74
+ * Validates if a given bucket name is valid according to Supabase Storage API rules
75
+ * Mirrors backend validation from: storage/src/storage/limits.ts:isValidBucketName()
76
+ *
77
+ * Rules:
78
+ * - Length: 1-100 characters
79
+ * - Allowed characters: alphanumeric (a-z, A-Z, 0-9), underscore (_), and safe special characters
80
+ * - Safe special characters: ! - . * ' ( ) space & $ @ = ; : + , ?
81
+ * - Forbidden: path separators (/, \), path traversal (..), leading/trailing whitespace
82
+ *
83
+ * AWS S3 Reference: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
84
+ *
85
+ * @param bucketName - The bucket name to validate
86
+ * @returns true if valid, false otherwise
87
+ */
88
+ export const isValidBucketName = (bucketName: string): boolean => {
89
+ if (!bucketName || typeof bucketName !== 'string') {
90
+ return false
91
+ }
92
+
93
+ // Check length constraints (1-100 characters)
94
+ if (bucketName.length === 0 || bucketName.length > 100) {
95
+ return false
96
+ }
97
+
98
+ // Check for leading/trailing whitespace
99
+ if (bucketName.trim() !== bucketName) {
100
+ return false
101
+ }
102
+
103
+ // Explicitly reject path separators (security)
104
+ // Note: Consecutive periods (..) are allowed by backend - the AWS restriction
105
+ // on relative paths applies to object keys, not bucket names
106
+ if (bucketName.includes('/') || bucketName.includes('\\')) {
107
+ return false
108
+ }
109
+
110
+ // Validate against allowed character set
111
+ // Pattern matches backend regex: /^(\w|!|-|\.|\*|'|\(|\)| |&|\$|@|=|;|:|\+|,|\?)*$/
112
+ // This explicitly excludes path separators (/, \) and other problematic characters
113
+ const bucketNameRegex = /^[\w!.\*'() &$@=;:+,?-]+$/
114
+ return bucketNameRegex.test(bucketName)
115
+ }
116
+
117
+ /**
118
+ * Normalizes a number array to float32 format
119
+ * Ensures all vector values are valid 32-bit floats
120
+ *
121
+ * @param values - Array of numbers to normalize
122
+ * @returns Normalized float32 array
123
+ */
124
+ export const normalizeToFloat32 = (values: number[]): number[] => {
125
+ // Use Float32Array to ensure proper precision
126
+ return Array.from(new Float32Array(values))
127
+ }
128
+
129
+ /**
130
+ * Validates vector dimensions match expected dimension
131
+ * Throws error if dimensions don't match
132
+ *
133
+ * @param vector - Vector data to validate
134
+ * @param expectedDimension - Expected vector dimension
135
+ * @throws Error if dimensions don't match
136
+ */
137
+ export const validateVectorDimension = (
138
+ vector: { float32: number[] },
139
+ expectedDimension?: number
140
+ ): void => {
141
+ if (expectedDimension !== undefined && vector.float32.length !== expectedDimension) {
142
+ throw new Error(
143
+ `Vector dimension mismatch: expected ${expectedDimension}, got ${vector.float32.length}`
144
+ )
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Percent-encodes each segment of a storage path so URL delimiters within a
150
+ * key (e.g. `?`, `#`) can't be interpreted as a querystring/fragment start.
151
+ *
152
+ * Splits on `/` so real path separators stay literal — the storage server
153
+ * routes on them and decodes each segment back to the original key.
154
+ *
155
+ * @param path - A bucket id or `bucketId/objectKey` path
156
+ * @returns The path with each `/`-delimited segment percent-encoded
157
+ */
158
+ export const encodeStoragePath = (path: string): string =>
159
+ path.split('/').map(encodeURIComponent).join('/')
node_modules/@supabase/storage-js/src/lib/constants.ts ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ import { version } from './version'
2
+ export const DEFAULT_HEADERS = {
3
+ 'X-Client-Info': `storage-js/${version}`,
4
+ }
node_modules/@supabase/storage-js/src/lib/types.ts ADDED
@@ -0,0 +1,662 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { StorageError } from './common/errors'
2
+
3
+ /**
4
+ * Type of storage bucket
5
+ * - STANDARD: Regular file storage buckets
6
+ * - ANALYTICS: Iceberg table-based buckets for analytical workloads
7
+ */
8
+ export type BucketType = 'STANDARD' | 'ANALYTICS' | (string & {})
9
+
10
+ export interface Bucket {
11
+ id: string
12
+ type?: BucketType
13
+ name: string
14
+ owner: string
15
+ file_size_limit?: number
16
+ allowed_mime_types?: string[]
17
+ created_at: string
18
+ updated_at: string
19
+ public: boolean
20
+ }
21
+
22
+ export interface ListBucketOptions {
23
+ limit?: number
24
+ offset?: number
25
+ sortColumn?: 'id' | 'name' | 'created_at' | 'updated_at'
26
+ sortOrder?: 'asc' | 'desc'
27
+ search?: string
28
+ }
29
+
30
+ export interface PurgeCacheOptions {
31
+ /**
32
+ * If true, purges only the transformations (resized/formatted variants) for the object or bucket,
33
+ * leaving the original cached file intact. If omitted, purges all cached versions.
34
+ */
35
+ transformations?: true
36
+ }
37
+
38
+ /**
39
+ * Represents an Analytics Bucket using Apache Iceberg table format.
40
+ * Analytics buckets are optimized for analytical queries and data processing.
41
+ */
42
+ export interface AnalyticBucket {
43
+ /** Unique identifier for the bucket */
44
+ name: string
45
+ /** Bucket type - always 'ANALYTICS' for analytics buckets */
46
+ type: 'ANALYTICS'
47
+ /** Storage format used (e.g., 'iceberg') */
48
+ format: string
49
+ /** ISO 8601 timestamp of bucket creation */
50
+ created_at: string
51
+ /** ISO 8601 timestamp of last update */
52
+ updated_at: string
53
+ }
54
+
55
+ /**
56
+ * Metadata object returned by the Storage API for files
57
+ * Contains information about file size, type, caching, and HTTP response details
58
+ */
59
+ export interface FileMetadata {
60
+ /** Entity tag for caching and conditional requests */
61
+ eTag: string
62
+ /** File size in bytes */
63
+ size: number
64
+ /** MIME type of the file */
65
+ mimetype: string
66
+ /** Cache control directive (e.g., "max-age=3600") */
67
+ cacheControl: string
68
+ /** Last modification timestamp (ISO 8601) */
69
+ lastModified: string
70
+ /** Content length in bytes (usually same as size) */
71
+ contentLength: number
72
+ /** HTTP status code from the storage backend */
73
+ httpStatusCode: number
74
+ /** Any additional custom metadata stored with the file */
75
+ [key: string]: any
76
+ }
77
+
78
+ /**
79
+ * File object returned by the List V1 API (list() method)
80
+ * Note: Folder entries will have null values for most fields except name
81
+ *
82
+ * Warning: Some fields may not be present in all API responses. Fields like
83
+ * bucket_id, owner, and buckets are not returned by list() operations.
84
+ */
85
+ export interface FileObject {
86
+ /** File or folder name (relative to the prefix) - always present */
87
+ name: string
88
+ /** Unique identifier for the file (null for folders) */
89
+ id: string | null
90
+ /** Last update timestamp (null for folders) */
91
+ updated_at: string | null
92
+ /** Creation timestamp (null for folders) */
93
+ created_at: string | null
94
+ /** @deprecated Last access timestamp (null for folders) */
95
+ last_accessed_at: string | null
96
+ /** File metadata including size, mimetype, etc. (null for folders) */
97
+ metadata: FileMetadata | null
98
+ /**
99
+ * @deprecated Bucket identifier - NOT returned by list() operations.
100
+ * May be present in remove() responses. Do not rely on this field.
101
+ */
102
+ bucket_id?: string
103
+ /**
104
+ * @deprecated Owner identifier - NOT returned by list() or remove() operations.
105
+ * This field should not be relied upon.
106
+ */
107
+ owner?: string
108
+ /**
109
+ * @deprecated Bucket object - NOT returned by list() or remove() operations.
110
+ * This field should not be relied upon.
111
+ */
112
+ buckets?: Bucket
113
+ }
114
+
115
+ /**
116
+ * File object returned by the Info endpoint (info() method)
117
+ * Contains detailed metadata for a specific file
118
+ */
119
+ export interface FileObjectV2 {
120
+ /** Unique identifier for the file */
121
+ id: string
122
+ /** File version identifier */
123
+ version: string
124
+ /** File name */
125
+ name: string
126
+ /** Bucket identifier */
127
+ bucket_id: string
128
+ /** Creation timestamp */
129
+ created_at: string
130
+ /** File size in bytes */
131
+ size?: number
132
+ /** Cache control header value */
133
+ cache_control?: string
134
+ /** MIME content type */
135
+ content_type?: string
136
+ /** Entity tag for caching */
137
+ etag?: string
138
+ /** Last modification timestamp (replaces updated_at) */
139
+ last_modified?: string
140
+ /** Custom file metadata */
141
+ metadata?: FileMetadata
142
+ /**
143
+ * @deprecated The API returns last_modified instead.
144
+ * This field may not be present in responses.
145
+ */
146
+ updated_at?: string
147
+ }
148
+
149
+ export interface SortBy {
150
+ column?: string
151
+ order?: string
152
+ }
153
+
154
+ export interface FileOptions {
155
+ /**
156
+ * The number of seconds the asset is cached in the browser and in the Supabase CDN. This is set in the `Cache-Control: max-age=<seconds>` header. Defaults to 3600 seconds.
157
+ */
158
+ cacheControl?: string
159
+ /**
160
+ * the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`.
161
+ */
162
+ contentType?: string
163
+ /**
164
+ * When upsert is set to true, the file is overwritten if it exists. When set to false, an error is thrown if the object already exists. Defaults to false.
165
+ */
166
+ upsert?: boolean
167
+ /**
168
+ * The duplex option is a string parameter that enables or disables duplex streaming, allowing for both reading and writing data in the same stream. It can be passed as an option to the fetch() method.
169
+ */
170
+ duplex?: string
171
+
172
+ /**
173
+ * The metadata option is an object that allows you to store additional information about the file. This information can be used to filter and search for files. The metadata object can contain any key-value pairs you want to store.
174
+ */
175
+ metadata?: Record<string, any>
176
+
177
+ /**
178
+ * Optionally add extra headers
179
+ */
180
+ headers?: Record<string, string>
181
+ }
182
+
183
+ export interface DestinationOptions {
184
+ destinationBucket?: string
185
+ }
186
+
187
+ export interface SearchOptions {
188
+ /**
189
+ * The number of files you want to be returned.
190
+ * @default 100
191
+ */
192
+ limit?: number
193
+
194
+ /**
195
+ * The starting position.
196
+ */
197
+ offset?: number
198
+
199
+ /**
200
+ * The column to sort by. Can be any column inside a FileObject.
201
+ */
202
+ sortBy?: SortBy
203
+
204
+ /**
205
+ * The search string to filter files by.
206
+ */
207
+ search?: string
208
+ }
209
+
210
+ export interface SortByV2 {
211
+ column: 'name' | 'updated_at' | 'created_at'
212
+ order?: 'asc' | 'desc'
213
+ }
214
+
215
+ export interface SearchV2Options {
216
+ /**
217
+ * The number of files you want to be returned.
218
+ * @default 1000
219
+ */
220
+ limit?: number
221
+
222
+ /**
223
+ * The prefix search string to filter files by.
224
+ */
225
+ prefix?: string
226
+
227
+ /**
228
+ * The cursor used for pagination. Pass the value received from nextCursor of the previous request.
229
+ */
230
+ cursor?: string
231
+
232
+ /**
233
+ * Whether to emulate a hierarchical listing of objects using delimiters.
234
+ *
235
+ * - When `false` (default), all objects are listed as flat key/value pairs.
236
+ * - When `true`, the response groups objects by delimiter, making it appear
237
+ * like a file/folder hierarchy.
238
+ *
239
+ * @default false
240
+ */
241
+ with_delimiter?: boolean
242
+
243
+ /**
244
+ * The column and order to sort by
245
+ * @default 'name asc'
246
+ */
247
+ sortBy?: SortByV2
248
+ }
249
+
250
+ /**
251
+ * File object returned by the List V2 API (listV2() method)
252
+ * Objects and folders are returned in separate arrays - this type represents
253
+ * actual files only. Use SearchV2Folder for folder entries.
254
+ */
255
+ export interface SearchV2Object {
256
+ /** File name */
257
+ name: string
258
+ /** Full object key/path */
259
+ key?: string
260
+ /** Unique identifier for the file */
261
+ id: string
262
+ /** Last update timestamp */
263
+ updated_at: string
264
+ /** Creation timestamp */
265
+ created_at: string
266
+ /** File metadata including size, mimetype, etc. (null if not yet set) */
267
+ metadata: FileMetadata | null
268
+ /** @deprecated Last access timestamp */
269
+ last_accessed_at: string
270
+ }
271
+
272
+ /**
273
+ * Folder entry returned by the List V2 API (listV2() method) when using with_delimiter: true
274
+ */
275
+ export interface SearchV2Folder {
276
+ /** Folder name/prefix */
277
+ name: string
278
+ /** Full folder key/path */
279
+ key?: string
280
+ }
281
+
282
+ export interface SearchV2Result {
283
+ hasNext: boolean
284
+ folders: SearchV2Folder[]
285
+ objects: SearchV2Object[]
286
+ nextCursor?: string
287
+ }
288
+
289
+ export interface FetchParameters {
290
+ /**
291
+ * Pass in an AbortController's signal to cancel the request.
292
+ */
293
+ signal?: AbortSignal
294
+
295
+ /**
296
+ * Controls how the request interacts with the browser's HTTP cache.
297
+ * - 'default': Use standard cache behavior
298
+ * - 'no-store': Bypass cache entirely (useful in Edge Functions)
299
+ * - 'reload': Bypass cache but update it with response
300
+ * - 'no-cache': Validate with server before using cached response
301
+ * - 'force-cache': Use cache even if stale
302
+ * - 'only-if-cached': Only use cache, fail if not cached
303
+ */
304
+ cache?: 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached'
305
+ }
306
+
307
+ // TODO: need to check for metadata props. The api swagger doesnt have.
308
+ export interface Metadata {
309
+ name: string
310
+ }
311
+
312
+ export interface TransformOptions {
313
+ /**
314
+ * The width of the image in pixels.
315
+ */
316
+ width?: number
317
+ /**
318
+ * The height of the image in pixels.
319
+ */
320
+ height?: number
321
+ /**
322
+ * The resize mode can be cover, contain or fill. Defaults to cover.
323
+ * Cover resizes the image to maintain it's aspect ratio while filling the entire width and height.
324
+ * Contain resizes the image to maintain it's aspect ratio while fitting the entire image within the width and height.
325
+ * Fill resizes the image to fill the entire width and height. If the object's aspect ratio does not match the width and height, the image will be stretched to fit.
326
+ */
327
+ resize?: 'cover' | 'contain' | 'fill'
328
+ /**
329
+ * Set the quality of the returned image.
330
+ * A number from 20 to 100, with 100 being the highest quality.
331
+ * Defaults to 80
332
+ */
333
+ quality?: number
334
+ /**
335
+ * Specify the format of the image requested.
336
+ *
337
+ * When using 'origin' we force the format to be the same as the original image.
338
+ * When this option is not passed in, images are optimized to modern image formats like Webp.
339
+ */
340
+ format?: 'origin'
341
+ }
342
+
343
+ type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}`
344
+ ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}`
345
+ : S
346
+
347
+ export type Camelize<T> = {
348
+ [K in keyof T as CamelCase<Extract<K, string>>]: T[K]
349
+ }
350
+
351
+ export type DownloadResult<T> =
352
+ | {
353
+ data: T
354
+ error: null
355
+ }
356
+ | {
357
+ data: null
358
+ error: StorageError
359
+ }
360
+ // ============================================================================
361
+ // VECTOR STORAGE TYPES
362
+ // ============================================================================
363
+
364
+ /**
365
+ * Configuration for encryption at rest
366
+ * @property kmsKeyArn - ARN of the KMS key used for encryption
367
+ * @property sseType - Server-side encryption type (e.g., 'KMS')
368
+ */
369
+ export interface EncryptionConfiguration {
370
+ kmsKeyArn?: string
371
+ sseType?: string
372
+ }
373
+
374
+ /**
375
+ * Vector bucket metadata
376
+ * @property vectorBucketName - Unique name of the vector bucket
377
+ * @property creationTime - Unix timestamp of when the bucket was created
378
+ * @property encryptionConfiguration - Optional encryption settings
379
+ */
380
+ export interface VectorBucket {
381
+ vectorBucketName: string
382
+ creationTime?: number
383
+ encryptionConfiguration?: EncryptionConfiguration
384
+ }
385
+
386
+ /**
387
+ * Metadata configuration for vector index
388
+ * Defines which metadata keys should not be indexed for filtering
389
+ * @property nonFilterableMetadataKeys - Array of metadata keys that cannot be used in filters
390
+ */
391
+ export interface MetadataConfiguration {
392
+ nonFilterableMetadataKeys?: string[]
393
+ }
394
+
395
+ /**
396
+ * Supported data types for vectors
397
+ * Currently only float32 is supported
398
+ */
399
+ export type VectorDataType = 'float32' | (string & {})
400
+
401
+ /**
402
+ * Distance metrics for vector similarity search
403
+ */
404
+ export type DistanceMetric = 'cosine' | 'euclidean' | 'dotproduct' | (string & {})
405
+
406
+ /**
407
+ * Vector index configuration and metadata
408
+ * @property indexName - Unique name of the index within the bucket
409
+ * @property vectorBucketName - Name of the parent vector bucket
410
+ * @property dataType - Data type of vector components (currently only 'float32')
411
+ * @property dimension - Dimensionality of vectors (e.g., 384, 768, 1536)
412
+ * @property distanceMetric - Similarity metric used for queries
413
+ * @property metadataConfiguration - Configuration for metadata filtering
414
+ * @property creationTime - Unix timestamp of when the index was created
415
+ */
416
+ export interface VectorIndex {
417
+ indexName: string
418
+ vectorBucketName: string
419
+ dataType: VectorDataType
420
+ dimension: number
421
+ distanceMetric: DistanceMetric
422
+ metadataConfiguration?: MetadataConfiguration
423
+ creationTime?: number
424
+ }
425
+
426
+ /**
427
+ * Vector data representation
428
+ * Vectors must be float32 arrays with dimensions matching the index
429
+ * @property float32 - Array of 32-bit floating point numbers
430
+ */
431
+ export interface VectorData {
432
+ float32: number[]
433
+ }
434
+
435
+ /**
436
+ * Arbitrary JSON metadata attached to vectors
437
+ * Keys configured as non-filterable in the index can be stored but not queried
438
+ */
439
+ export type VectorMetadata = Record<string, any>
440
+
441
+ /**
442
+ * Single vector object for insertion/update
443
+ * @property key - Unique identifier for the vector
444
+ * @property data - Vector embedding data
445
+ * @property metadata - Optional arbitrary metadata
446
+ */
447
+ export interface VectorObject {
448
+ key: string
449
+ data: VectorData
450
+ metadata?: VectorMetadata
451
+ }
452
+
453
+ /**
454
+ * Vector object returned from queries with optional distance
455
+ * @property key - Unique identifier for the vector
456
+ * @property data - Vector embedding data (if requested)
457
+ * @property metadata - Arbitrary metadata (if requested)
458
+ * @property distance - Similarity distance from query vector (if requested)
459
+ */
460
+ export interface VectorMatch {
461
+ key: string
462
+ data?: VectorData
463
+ metadata?: VectorMetadata
464
+ distance?: number
465
+ }
466
+
467
+ /**
468
+ * Options for fetching vector buckets
469
+ * @property prefix - Filter buckets by name prefix
470
+ * @property maxResults - Maximum number of results to return (default: 100)
471
+ * @property nextToken - Token for pagination from previous response
472
+ */
473
+ export interface ListVectorBucketsOptions {
474
+ prefix?: string
475
+ maxResults?: number
476
+ nextToken?: string
477
+ }
478
+
479
+ /**
480
+ * Response from listing vector buckets
481
+ * @property vectorBuckets - Array of bucket names
482
+ * @property nextToken - Token for fetching next page (if more results exist)
483
+ */
484
+ export interface ListVectorBucketsResponse {
485
+ vectorBuckets: { vectorBucketName: string }[]
486
+ nextToken?: string
487
+ }
488
+
489
+ /**
490
+ * Options for listing indexes within a bucket
491
+ * @property vectorBucketName - Name of the parent vector bucket
492
+ * @property prefix - Filter indexes by name prefix
493
+ * @property maxResults - Maximum number of results to return (default: 100)
494
+ * @property nextToken - Token for pagination from previous response
495
+ */
496
+ export interface ListIndexesOptions {
497
+ vectorBucketName: string
498
+ prefix?: string
499
+ maxResults?: number
500
+ nextToken?: string
501
+ }
502
+
503
+ /**
504
+ * Response from listing indexes
505
+ * @property indexes - Array of index names
506
+ * @property nextToken - Token for fetching next page (if more results exist)
507
+ */
508
+ export interface ListIndexesResponse {
509
+ indexes: { indexName: string }[]
510
+ nextToken?: string
511
+ }
512
+
513
+ /**
514
+ * Options for batch reading vectors
515
+ * @property vectorBucketName - Name of the vector bucket
516
+ * @property indexName - Name of the index
517
+ * @property keys - Array of vector keys to retrieve
518
+ * @property returnData - Whether to include vector data in response
519
+ * @property returnMetadata - Whether to include metadata in response
520
+ */
521
+ export interface GetVectorsOptions {
522
+ vectorBucketName: string
523
+ indexName: string
524
+ keys: string[]
525
+ returnData?: boolean
526
+ returnMetadata?: boolean
527
+ }
528
+
529
+ /**
530
+ * Response from getting vectors
531
+ * @property vectors - Array of retrieved vector objects
532
+ */
533
+ export interface GetVectorsResponse {
534
+ vectors: VectorMatch[]
535
+ }
536
+
537
+ /**
538
+ * Options for batch inserting/updating vectors
539
+ * @property vectorBucketName - Name of the vector bucket
540
+ * @property indexName - Name of the index
541
+ * @property vectors - Array of vectors to insert/upsert (1-500 items)
542
+ */
543
+ export interface PutVectorsOptions {
544
+ vectorBucketName: string
545
+ indexName: string
546
+ vectors: VectorObject[]
547
+ }
548
+
549
+ /**
550
+ * Options for batch deleting vectors
551
+ * @property vectorBucketName - Name of the vector bucket
552
+ * @property indexName - Name of the index
553
+ * @property keys - Array of vector keys to delete (1-500 items)
554
+ */
555
+ export interface DeleteVectorsOptions {
556
+ vectorBucketName: string
557
+ indexName: string
558
+ keys: string[]
559
+ }
560
+
561
+ /**
562
+ * Options for listing/scanning vectors in an index
563
+ * Supports parallel scanning via segment configuration
564
+ * @property vectorBucketName - Name of the vector bucket
565
+ * @property indexName - Name of the index
566
+ * @property maxResults - Maximum number of results to return (default: 500, max: 1000)
567
+ * @property nextToken - Token for pagination from previous response
568
+ * @property returnData - Whether to include vector data in response
569
+ * @property returnMetadata - Whether to include metadata in response
570
+ * @property segmentCount - Total number of parallel segments (1-16)
571
+ * @property segmentIndex - Zero-based index of this segment (0 to segmentCount-1)
572
+ */
573
+ export interface ListVectorsOptions {
574
+ vectorBucketName: string
575
+ indexName: string
576
+ maxResults?: number
577
+ nextToken?: string
578
+ returnData?: boolean
579
+ returnMetadata?: boolean
580
+ segmentCount?: number
581
+ segmentIndex?: number
582
+ }
583
+
584
+ /**
585
+ * Response from listing vectors
586
+ * @property vectors - Array of vector objects
587
+ * @property nextToken - Token for fetching next page (if more results exist)
588
+ */
589
+ export interface ListVectorsResponse {
590
+ vectors: VectorMatch[]
591
+ nextToken?: string
592
+ }
593
+
594
+ /**
595
+ * JSON filter expression for metadata filtering
596
+ * Format and syntax depend on the S3 Vectors service implementation
597
+ */
598
+ export type VectorFilter = Record<string, any>
599
+
600
+ /**
601
+ * Options for querying similar vectors (ANN search)
602
+ * @property vectorBucketName - Name of the vector bucket
603
+ * @property indexName - Name of the index
604
+ * @property queryVector - Query vector to find similar vectors
605
+ * @property topK - Number of nearest neighbors to return (default: 10)
606
+ * @property filter - Optional JSON filter for metadata
607
+ * @property returnDistance - Whether to include distance scores
608
+ * @property returnMetadata - Whether to include metadata in results
609
+ */
610
+ export interface QueryVectorsOptions {
611
+ vectorBucketName: string
612
+ indexName: string
613
+ queryVector: VectorData
614
+ topK?: number
615
+ filter?: VectorFilter
616
+ returnDistance?: boolean
617
+ returnMetadata?: boolean
618
+ }
619
+
620
+ /**
621
+ * Response from vector similarity query
622
+ * @property vectors - Array of similar vectors ordered by distance
623
+ * @property distanceMetric - The distance metric used for the similarity search
624
+ */
625
+ export interface QueryVectorsResponse {
626
+ vectors: VectorMatch[]
627
+ distanceMetric?: DistanceMetric
628
+ }
629
+
630
+ /**
631
+ * Fetch-specific parameters like abort signals
632
+ * @property signal - AbortSignal for cancelling requests
633
+ */
634
+ export interface VectorFetchParameters {
635
+ signal?: AbortSignal
636
+ }
637
+
638
+ /**
639
+ * Standard response wrapper for successful operations
640
+ * @property data - Response data of type T
641
+ * @property error - Null on success
642
+ */
643
+ export interface SuccessResponse<T> {
644
+ data: T
645
+ error: null
646
+ }
647
+
648
+ /**
649
+ * Standard response wrapper for failed operations
650
+ * @property data - Null on error
651
+ * @property error - StorageError with details (named StorageVectorsError for vector operations)
652
+ */
653
+ export interface ErrorResponse {
654
+ data: null
655
+ error: StorageError
656
+ }
657
+
658
+ /**
659
+ * Union type for all API responses
660
+ * Follows the pattern: { data: T, error: null } | { data: null, error: Error }
661
+ */
662
+ export type ApiResponse<T> = SuccessResponse<T> | ErrorResponse