@candypoets/nipworker 0.93.0 → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/NarrowTypes.js +139 -119
  2. package/dist/cache/index.js +55 -55
  3. package/dist/cache/pkg/cache.d.ts +1 -1
  4. package/dist/cache/pkg/cache_bg.wasm.d.ts +1 -1
  5. package/dist/connections/index.js +16 -16
  6. package/dist/connections/pkg/connections.d.ts +2 -2
  7. package/dist/connections/pkg/connections_bg.wasm.d.ts +2 -2
  8. package/dist/connections/proxy.js +1 -1
  9. package/dist/connections/proxy.js.map +4 -4
  10. package/dist/crypto/index.js +40 -40
  11. package/dist/generated/nostr/fb/content-block.d.ts +3 -2
  12. package/dist/generated/nostr/fb/content-block.d.ts.map +1 -1
  13. package/dist/generated/nostr/fb/content-data.d.ts +5 -3
  14. package/dist/generated/nostr/fb/content-data.d.ts.map +1 -1
  15. package/dist/generated/nostr/fb/emoji-data.d.ts +30 -0
  16. package/dist/generated/nostr/fb/emoji-data.d.ts.map +1 -0
  17. package/dist/generated/nostr/fb/kind1018-parsed.d.ts +37 -0
  18. package/dist/generated/nostr/fb/kind1018-parsed.d.ts.map +1 -0
  19. package/dist/generated/nostr/fb/kind1068-parsed.d.ts +58 -0
  20. package/dist/generated/nostr/fb/kind1068-parsed.d.ts.map +1 -0
  21. package/dist/generated/nostr/fb/kind20-parsed.d.ts.map +1 -1
  22. package/dist/generated/nostr/fb/parsed-data-union.d.ts +2 -0
  23. package/dist/generated/nostr/fb/parsed-data-union.d.ts.map +1 -1
  24. package/dist/generated/nostr/fb/parsed-data.d.ts +17 -13
  25. package/dist/generated/nostr/fb/parsed-data.d.ts.map +1 -1
  26. package/dist/generated/nostr/fb/parsed-event.d.ts +4 -2
  27. package/dist/generated/nostr/fb/parsed-event.d.ts.map +1 -1
  28. package/dist/generated/nostr/fb/poll-option.d.ts +26 -0
  29. package/dist/generated/nostr/fb/poll-option.d.ts.map +1 -0
  30. package/dist/generated/nostr/fb/poll-type.d.ts +5 -0
  31. package/dist/generated/nostr/fb/poll-type.d.ts.map +1 -0
  32. package/dist/generated/nostr/fb.d.ts +5 -0
  33. package/dist/generated/nostr/fb.d.ts.map +1 -1
  34. package/dist/index.js +159 -150
  35. package/dist/index2.js +31 -31
  36. package/dist/lib/ConnectionTracker.d.ts +2 -0
  37. package/dist/lib/ConnectionTracker.d.ts.map +1 -1
  38. package/dist/lib/NarrowTypes.d.ts +6 -1
  39. package/dist/lib/NarrowTypes.d.ts.map +1 -1
  40. package/dist/parser/index.js +306 -306
  41. package/dist/relayProxyServer.js +298 -352
  42. package/dist/utils.js +91 -82
  43. package/dist/worker-message.js +1151 -763
  44. package/package.json +1 -1
@@ -1,32 +1,32 @@
1
- import { M as d, C as B, E as F, a as M, B as H, V as I, P as R, N as S, b as e, K as u, c as i, d as l, e as p, f as o, g as K, h as f, i as P, j as c, k as w, l as y, m as T, n as D, o as C, p as E, q as N, r as G, L as h, s as L, t as s, u as x, H as j, v as q, I as z, w as A, x as g, y as J, z as O, A as Q, D as U, F as W } from "./worker-message.js";
1
+ import { M as d, C as M, E as j, a as H, B as I, V as R, P as S, N as m, b as e, K as u, c as i, d as l, e as p, f as o, g as K, h as f, i as P, j as c, k as w, l as y, m as T, n as D, o as C, p as E, q as N, r as G, s as h, t as L, L as V, u as B, v as s, w as x, H as q, x as z, I as A, y as g, z as J, A as O, D as Q, F as U, G as W } from "./worker-message.js";
2
2
  import "flatbuffers";
3
3
  function X(n) {
4
- return n.type() !== d.ConnectionStatus ? null : n.content(new B()) ?? null;
4
+ return n.type() !== d.ConnectionStatus ? null : n.content(new M()) ?? null;
5
5
  }
6
- const nn = X;
6
+ const en = X;
7
7
  function Y(n) {
8
- return n.type() !== d.Eoce ? null : n.content(new F()) ?? null;
8
+ return n.type() !== d.Eoce ? null : n.content(new j()) ?? null;
9
9
  }
10
- const en = Y;
10
+ const an = Y;
11
11
  function Z(n) {
12
- return n.type() !== d.CountResponse ? null : n.content(new M()) ?? null;
12
+ return n.type() !== d.CountResponse ? null : n.content(new H()) ?? null;
13
13
  }
14
- const an = Z;
14
+ const rn = Z;
15
15
  function _(n) {
16
- return n.type() !== d.BufferFull ? null : n.content(new H()) ?? null;
16
+ return n.type() !== d.BufferFull ? null : n.content(new I()) ?? null;
17
17
  }
18
- const rn = _;
18
+ const sn = _;
19
19
  function $(n) {
20
- return n.type() !== d.ValidProofs ? null : n.content(new I()) ?? null;
20
+ return n.type() !== d.ValidProofs ? null : n.content(new R()) ?? null;
21
21
  }
22
- const sn = $;
23
- function V(n) {
24
- return n.type() !== d.ParsedNostrEvent ? null : n.content(new R()) ?? null;
22
+ const dn = $;
23
+ function F(n) {
24
+ return n.type() !== d.ParsedNostrEvent ? null : n.content(new S()) ?? null;
25
25
  }
26
- const dn = V, m = (n) => n.type() !== d.NostrEvent ? null : n.content(new S()) ?? null, tn = m;
26
+ const tn = F, k = (n) => n.type() !== d.NostrEvent ? null : n.content(new m()) ?? null, un = k;
27
27
  function r(n, t) {
28
28
  if (!n) return null;
29
- const a = V(n);
29
+ const a = F(n);
30
30
  if (!a || a.parsedType() !== t) return null;
31
31
  switch (t) {
32
32
  case e.Kind0Parsed:
@@ -44,195 +44,210 @@ function r(n, t) {
44
44
  case e.Kind17Parsed:
45
45
  return a.parsed(new f());
46
46
  case e.Kind20Parsed:
47
- return a.parsed(new W());
47
+ return a.parsed(new P());
48
48
  case e.Kind22Parsed:
49
- return a.parsed(new U());
49
+ return a.parsed(new c());
50
50
  case e.Kind1111Parsed:
51
- return a.parsed(new P());
51
+ return a.parsed(new w());
52
52
  case e.Kind1311Parsed:
53
- return a.parsed(new c());
53
+ return a.parsed(new y());
54
54
  case e.Kind10002Parsed:
55
- return a.parsed(new w());
55
+ return a.parsed(new T());
56
56
  case e.Kind10019Parsed:
57
- return a.parsed(new y());
57
+ return a.parsed(new D());
58
58
  case e.Kind17375Parsed:
59
- return a.parsed(new T());
59
+ return a.parsed(new C());
60
60
  case e.Kind7374Parsed:
61
- return a.parsed(new D());
61
+ return a.parsed(new E());
62
62
  case e.Kind7375Parsed:
63
- return a.parsed(new C());
63
+ return a.parsed(new N());
64
64
  case e.Kind7376Parsed:
65
- return a.parsed(new E());
65
+ return a.parsed(new G());
66
66
  case e.Kind9321Parsed:
67
- return a.parsed(new N());
67
+ return a.parsed(new h());
68
68
  case e.Kind9735Parsed:
69
- return a.parsed(new G());
69
+ return a.parsed(new L());
70
70
  case e.Kind30023Parsed:
71
- return a.parsed(new Q());
71
+ return a.parsed(new W());
72
72
  case e.ListParsed:
73
- return a.parsed(new h());
73
+ return a.parsed(new V());
74
74
  case e.PreGenericParsed:
75
- return a.parsed(new L());
75
+ return a.parsed(new B());
76
76
  default:
77
77
  return null;
78
78
  }
79
79
  }
80
- function un(n) {
81
- return r(n, e.Kind0Parsed);
82
- }
83
80
  function ln(n) {
84
- return !n || n.parsedType() !== e.Kind0Parsed ? null : n.parsed(new u()) ?? null;
81
+ return r(n, e.Kind0Parsed);
85
82
  }
86
83
  function pn(n) {
87
- return r(n, e.Kind1Parsed);
84
+ return !n || n.parsedType() !== e.Kind0Parsed ? null : n.parsed(new u()) ?? null;
88
85
  }
89
86
  function on(n) {
90
- return n.parsedType() !== e.Kind1Parsed ? null : n.parsed(new i()) ?? null;
87
+ return r(n, e.Kind1Parsed);
91
88
  }
92
89
  function Kn(n) {
93
- return r(n, e.Kind3Parsed);
90
+ return n.parsedType() !== e.Kind1Parsed ? null : n.parsed(new i()) ?? null;
94
91
  }
95
92
  function fn(n) {
96
- return n.parsedType() !== e.Kind3Parsed ? null : n.parsed(new l()) ?? null;
93
+ return r(n, e.Kind3Parsed);
97
94
  }
98
95
  function Pn(n) {
99
- return r(n, e.Kind4Parsed);
96
+ return n.parsedType() !== e.Kind3Parsed ? null : n.parsed(new l()) ?? null;
100
97
  }
101
98
  function cn(n) {
102
- return n.parsedType() !== e.Kind4Parsed ? null : n.parsed(new p()) ?? null;
99
+ return r(n, e.Kind4Parsed);
103
100
  }
104
101
  function wn(n) {
105
- return r(n, e.Kind6Parsed);
102
+ return n.parsedType() !== e.Kind4Parsed ? null : n.parsed(new p()) ?? null;
106
103
  }
107
104
  function yn(n) {
108
- return n.parsedType() !== e.Kind6Parsed ? null : n.parsed(new o()) ?? null;
105
+ return r(n, e.Kind6Parsed);
109
106
  }
110
107
  function Tn(n) {
111
- return r(n, e.Kind7Parsed);
108
+ return n.parsedType() !== e.Kind6Parsed ? null : n.parsed(new o()) ?? null;
112
109
  }
113
110
  function Dn(n) {
114
- return n.parsedType() !== e.Kind7Parsed ? null : n.parsed(new K()) ?? null;
111
+ return r(n, e.Kind7Parsed);
115
112
  }
116
113
  function Cn(n) {
117
- return r(n, e.Kind17Parsed);
114
+ return n.parsedType() !== e.Kind7Parsed ? null : n.parsed(new K()) ?? null;
118
115
  }
119
116
  function En(n) {
120
- return n.parsedType() !== e.Kind17Parsed ? null : n.parsed(new f()) ?? null;
117
+ return r(n, e.Kind17Parsed);
121
118
  }
122
119
  function Nn(n) {
123
- return r(n, e.Kind1111Parsed);
120
+ return n.parsedType() !== e.Kind17Parsed ? null : n.parsed(new f()) ?? null;
124
121
  }
125
122
  function Gn(n) {
126
- return n.parsedType() !== e.Kind1111Parsed ? null : n.parsed(new P()) ?? null;
123
+ return r(n, e.Kind20Parsed);
127
124
  }
128
125
  function hn(n) {
129
- return r(n, e.Kind1311Parsed);
126
+ return n.parsedType() !== e.Kind20Parsed ? null : n.parsed(new P()) ?? null;
130
127
  }
131
128
  function Ln(n) {
132
- return n.parsedType() !== e.Kind1311Parsed ? null : n.parsed(new c()) ?? null;
129
+ return r(n, e.Kind22Parsed);
133
130
  }
134
131
  function Vn(n) {
135
- return r(n, e.Kind10002Parsed);
132
+ return n.parsedType() !== e.Kind22Parsed ? null : n.parsed(new c()) ?? null;
136
133
  }
137
134
  function Bn(n) {
138
- return n.parsedType() !== e.Kind10002Parsed ? null : n.parsed(new w()) ?? null;
135
+ return r(n, e.Kind1111Parsed);
139
136
  }
140
137
  function Fn(n) {
141
- return r(n, e.Kind10019Parsed);
138
+ return n.parsedType() !== e.Kind1111Parsed ? null : n.parsed(new w()) ?? null;
142
139
  }
143
140
  function Mn(n) {
144
- return n.parsedType() !== e.Kind10019Parsed ? null : n.parsed(new y()) ?? null;
141
+ return r(n, e.Kind1311Parsed);
142
+ }
143
+ function jn(n) {
144
+ return n.parsedType() !== e.Kind1311Parsed ? null : n.parsed(new y()) ?? null;
145
145
  }
146
146
  function Hn(n) {
147
- return r(n, e.Kind17375Parsed);
147
+ return r(n, e.Kind10002Parsed);
148
148
  }
149
149
  function In(n) {
150
- return n.parsedType() !== e.Kind17375Parsed ? null : n.parsed(new T()) ?? null;
150
+ return n.parsedType() !== e.Kind10002Parsed ? null : n.parsed(new T()) ?? null;
151
151
  }
152
152
  function Rn(n) {
153
- return r(n, e.Kind7374Parsed);
153
+ return r(n, e.Kind10019Parsed);
154
154
  }
155
155
  function Sn(n) {
156
- return n.parsedType() !== e.Kind7374Parsed ? null : n.parsed(new D()) ?? null;
156
+ return n.parsedType() !== e.Kind10019Parsed ? null : n.parsed(new D()) ?? null;
157
157
  }
158
- function xn(n) {
159
- return r(n, e.Kind7375Parsed);
158
+ function mn(n) {
159
+ return r(n, e.Kind17375Parsed);
160
160
  }
161
- function jn(n) {
162
- return n.parsedType() !== e.Kind7375Parsed ? null : n.parsed(new C()) ?? null;
161
+ function xn(n) {
162
+ return n.parsedType() !== e.Kind17375Parsed ? null : n.parsed(new C()) ?? null;
163
163
  }
164
164
  function qn(n) {
165
- return r(n, e.Kind7376Parsed);
165
+ return r(n, e.Kind7374Parsed);
166
166
  }
167
167
  function zn(n) {
168
- return n.parsedType() !== e.Kind7376Parsed ? null : n.parsed(new E()) ?? null;
168
+ return n.parsedType() !== e.Kind7374Parsed ? null : n.parsed(new E()) ?? null;
169
169
  }
170
170
  function An(n) {
171
- return r(n, e.Kind9321Parsed);
171
+ return r(n, e.Kind7375Parsed);
172
172
  }
173
173
  function gn(n) {
174
- return n.parsedType() !== e.Kind9321Parsed ? null : n.parsed(new N()) ?? null;
174
+ return n.parsedType() !== e.Kind7375Parsed ? null : n.parsed(new N()) ?? null;
175
175
  }
176
176
  function Jn(n) {
177
- return r(n, e.Kind9735Parsed);
177
+ return r(n, e.Kind7376Parsed);
178
178
  }
179
179
  function On(n) {
180
- return n.parsedType() !== e.Kind9735Parsed ? null : n.parsed(new G()) ?? null;
180
+ return n.parsedType() !== e.Kind7376Parsed ? null : n.parsed(new G()) ?? null;
181
181
  }
182
182
  function Qn(n) {
183
- return r(n, e.ListParsed);
183
+ return r(n, e.Kind9321Parsed);
184
184
  }
185
185
  function Un(n) {
186
- return n.parsedType() !== e.ListParsed ? null : n.parsed(new h()) ?? null;
186
+ return n.parsedType() !== e.Kind9321Parsed ? null : n.parsed(new h()) ?? null;
187
187
  }
188
188
  function Wn(n) {
189
- return r(n, e.PreGenericParsed);
189
+ return r(n, e.Kind9735Parsed);
190
190
  }
191
191
  function Xn(n) {
192
- return n.parsedType() !== e.PreGenericParsed ? null : n.parsed(new L()) ?? null;
192
+ return n.parsedType() !== e.Kind9735Parsed ? null : n.parsed(new L()) ?? null;
193
193
  }
194
194
  function Yn(n) {
195
- return n.dataType() !== s.CodeData ? null : n.data(new x()) ?? null;
195
+ return r(n, e.ListParsed);
196
196
  }
197
197
  function Zn(n) {
198
- return n.dataType() !== s.HashtagData ? null : n.data(new j()) ?? null;
198
+ return n.parsedType() !== e.ListParsed ? null : n.parsed(new V()) ?? null;
199
199
  }
200
200
  function _n(n) {
201
- return n.dataType() !== s.CashuData ? null : n.data(new q()) ?? null;
201
+ return r(n, e.PreGenericParsed);
202
202
  }
203
203
  function $n(n) {
204
- return n.dataType() !== s.ImageData ? null : n.data(new z()) ?? null;
205
- }
206
- function mn(n) {
207
- return n.dataType() !== s.VideoData ? null : n.data(new A()) ?? null;
204
+ return n.parsedType() !== e.PreGenericParsed ? null : n.parsed(new B()) ?? null;
208
205
  }
209
206
  function kn(n) {
210
- return n.dataType() !== s.MediaGroupData ? null : n.data(new g()) ?? null;
207
+ return n.dataType() !== s.CodeData ? null : n.data(new x()) ?? null;
211
208
  }
212
209
  function bn(n) {
213
- return n.dataType() !== s.NostrData ? null : n.data(new J()) ?? null;
210
+ return n.dataType() !== s.HashtagData ? null : n.data(new q()) ?? null;
214
211
  }
215
212
  function vn(n) {
216
- return n.dataType() !== s.LinkPreviewData ? null : n.data(new O()) ?? null;
213
+ return n.dataType() !== s.CashuData ? null : n.data(new z()) ?? null;
214
+ }
215
+ function ne(n) {
216
+ return n.dataType() !== s.ImageData ? null : n.data(new A()) ?? null;
217
+ }
218
+ function ee(n) {
219
+ return n.dataType() !== s.VideoData ? null : n.data(new g()) ?? null;
220
+ }
221
+ function ae(n) {
222
+ return n.dataType() !== s.MediaGroupData ? null : n.data(new J()) ?? null;
223
+ }
224
+ function re(n) {
225
+ return n.dataType() !== s.NostrData ? null : n.data(new O()) ?? null;
226
+ }
227
+ function se(n) {
228
+ return n.dataType() !== s.LinkPreviewData ? null : n.data(new Q()) ?? null;
229
+ }
230
+ function de(n) {
231
+ return n.dataType() !== s.EmojiData ? null : n.data(new U()) ?? null;
217
232
  }
218
233
  export {
219
234
  Zn as $,
220
- Cn as A,
221
- En as B,
222
- Nn as C,
223
- Gn as D,
224
- hn as E,
225
- Ln as F,
226
- Vn as G,
227
- Bn as H,
228
- Fn as I,
229
- Mn as J,
235
+ En as A,
236
+ Nn as B,
237
+ Gn as C,
238
+ hn as D,
239
+ Ln as E,
240
+ Vn as F,
241
+ Bn as G,
242
+ Fn as H,
243
+ Mn as I,
244
+ jn as J,
230
245
  Hn as K,
231
246
  In as L,
232
247
  Rn as M,
233
248
  Sn as N,
234
- xn as O,
235
- jn as P,
249
+ mn as O,
250
+ xn as P,
236
251
  qn as Q,
237
252
  zn as R,
238
253
  An as S,
@@ -244,36 +259,41 @@ export {
244
259
  Wn as Y,
245
260
  Xn as Z,
246
261
  Yn as _,
247
- m as a,
262
+ k as a,
248
263
  _n as a0,
249
264
  $n as a1,
250
- mn as a2,
251
- kn as a3,
252
- bn as a4,
253
- vn as a5,
265
+ kn as a2,
266
+ bn as a3,
267
+ vn as a4,
268
+ ne as a5,
269
+ ee as a6,
270
+ ae as a7,
271
+ re as a8,
272
+ se as a9,
273
+ de as aa,
254
274
  X as b,
255
275
  Y as c,
256
- dn as d,
257
- tn as e,
258
- nn as f,
259
- en as g,
276
+ tn as d,
277
+ un as e,
278
+ en as f,
279
+ an as g,
260
280
  Z as h,
261
- V as i,
262
- an as j,
281
+ F as i,
282
+ rn as j,
263
283
  _ as k,
264
- rn as l,
284
+ sn as l,
265
285
  $ as m,
266
- sn as n,
267
- un as o,
268
- ln as p,
269
- pn as q,
270
- on as r,
271
- Kn as s,
272
- fn as t,
273
- Pn as u,
274
- cn as v,
275
- wn as w,
276
- yn as x,
277
- Tn as y,
278
- Dn as z
286
+ dn as n,
287
+ ln as o,
288
+ pn as p,
289
+ on as q,
290
+ Kn as r,
291
+ fn as s,
292
+ Pn as t,
293
+ cn as u,
294
+ wn as v,
295
+ yn as w,
296
+ Tn as x,
297
+ Dn as y,
298
+ Cn as z
279
299
  };