@candypoets/nipworker 0.93.0 → 0.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NarrowTypes.js +82 -66
- package/dist/cache/index.js +14 -14
- package/dist/cache/pkg/cache.d.ts +3 -3
- package/dist/cache/pkg/cache_bg.wasm.d.ts +3 -3
- package/dist/connections/index.js +19 -19
- package/dist/connections/pkg/connections.d.ts +5 -5
- package/dist/connections/pkg/connections_bg.wasm.d.ts +5 -5
- package/dist/connections/proxy.js +1 -1
- package/dist/connections/proxy.js.map +2 -2
- package/dist/crypto/index.js +2 -2
- package/dist/generated/nostr/fb/kind20-parsed.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/NarrowTypes.d.ts +5 -1
- package/dist/lib/NarrowTypes.d.ts.map +1 -1
- package/dist/parser/index.js +57 -57
- package/dist/utils.js +66 -62
- package/dist/worker-message.js +22 -23
- package/package.json +1 -1
package/dist/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { nip19 as $, generateSecretKey as B, getPublicKey as A } from "nostr-tools";
|
|
2
2
|
import { g as G } from "./index2.js";
|
|
3
3
|
import { b as N } from "./NarrowTypes.js";
|
|
4
|
-
import { l as ee,
|
|
5
|
-
import { J as h,
|
|
4
|
+
import { l as ee, a4 as te, a2 as ne, f as se, j as ae, g as oe, a3 as ie, a5 as re, p as ce, r as de, L as le, N as ue, H as pe, J as ge, B as he, P as fe, D as ye, F as we, t as Ke, v as ke, x as me, z as ve, R as De, T as Se, V as xe, X as Ce, Z as be, a9 as Me, a7 as Te, $ as Be, a8 as Ae, e as Ie, d as Pe, a1 as Re, n as Ee, a6 as $e, k as Ge, h as Ne, c as Le, o as Ve, q as ze, K as Ze, M as _e, G as He, I as Oe, A as Ue, O as Qe, C as Fe, E as We, s as je, u as Je, w as Xe, y as Ye, Q as qe, S as et, U as tt, W as nt, Y as st, _ as at, a as ot, i as it, a0 as rt, m as ct } from "./NarrowTypes.js";
|
|
5
|
+
import { J as h, v as d, O as k, Q as M, T, U as I, X as L, Y as V, Z as z, _ as Z, $ as _ } from "./worker-message.js";
|
|
6
6
|
class F {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.knownRelays = /* @__PURE__ */ new Map(), this.incomingCount = 0, this.resolvedCount = 0;
|
|
@@ -69,7 +69,7 @@ async function W(c) {
|
|
|
69
69
|
t.encode(e),
|
|
70
70
|
d.CashuData,
|
|
71
71
|
new V(t.encode(e))
|
|
72
|
-
),
|
|
72
|
+
), m = (e) => new h(
|
|
73
73
|
t.encode("hashtag"),
|
|
74
74
|
t.encode(`#${e}`),
|
|
75
75
|
d.HashtagData,
|
|
@@ -131,7 +131,7 @@ async function W(c) {
|
|
|
131
131
|
type: "hashtag",
|
|
132
132
|
// Match hashtags that are not part of a URL
|
|
133
133
|
regex: new RegExp(`(?<![^\\s"'(])(#[a-zA-Z0-9_]+)(?![a-zA-Z0-9_])`, "g"),
|
|
134
|
-
processMatch: (e) =>
|
|
134
|
+
processMatch: (e) => m(e[0].substring(1))
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
type: "image",
|
|
@@ -175,7 +175,7 @@ async function W(c) {
|
|
|
175
175
|
for (const { start: e, end: s, block: n } of x)
|
|
176
176
|
e > D && i.push(r(c.substring(D, e))), i.push(n), D = s;
|
|
177
177
|
D < c.length && i.push(r(c.substring(D)));
|
|
178
|
-
const
|
|
178
|
+
const K = [];
|
|
179
179
|
let u = [];
|
|
180
180
|
const E = (e) => /^\s+$/.test(e);
|
|
181
181
|
for (let e = 0; e < i.length; e++) {
|
|
@@ -190,21 +190,21 @@ async function W(c) {
|
|
|
190
190
|
const n = u.map((a) => {
|
|
191
191
|
if (a.dataType === d.ImageData) {
|
|
192
192
|
const g = a.data;
|
|
193
|
-
return new
|
|
193
|
+
return new k(
|
|
194
194
|
new M(t.encode(g.url ?? a.text), null),
|
|
195
195
|
null
|
|
196
196
|
);
|
|
197
197
|
} else if (a.dataType === d.VideoData) {
|
|
198
198
|
const g = a.data;
|
|
199
|
-
return new
|
|
199
|
+
return new k(
|
|
200
200
|
null,
|
|
201
201
|
new T(t.encode(g.url ?? a.text), null)
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
|
-
return new
|
|
204
|
+
return new k(null, null);
|
|
205
205
|
}), p = u.map((a) => String(a.text ?? "")).join(`
|
|
206
206
|
`);
|
|
207
|
-
|
|
207
|
+
K.push(
|
|
208
208
|
new h(
|
|
209
209
|
t.encode("mediaGrid"),
|
|
210
210
|
t.encode(p),
|
|
@@ -213,10 +213,10 @@ async function W(c) {
|
|
|
213
213
|
)
|
|
214
214
|
);
|
|
215
215
|
} else
|
|
216
|
-
|
|
216
|
+
K.push(u[0]);
|
|
217
217
|
u = [];
|
|
218
218
|
}
|
|
219
|
-
|
|
219
|
+
K.push(s);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
if (u.length > 0)
|
|
@@ -224,21 +224,21 @@ async function W(c) {
|
|
|
224
224
|
const e = u.map((n) => {
|
|
225
225
|
if (n.dataType === d.ImageData) {
|
|
226
226
|
const p = n.data;
|
|
227
|
-
return new
|
|
227
|
+
return new k(
|
|
228
228
|
new M(t.encode(p.url ?? n.text), null),
|
|
229
229
|
null
|
|
230
230
|
);
|
|
231
231
|
} else if (n.dataType === d.VideoData) {
|
|
232
232
|
const p = n.data;
|
|
233
|
-
return new
|
|
233
|
+
return new k(
|
|
234
234
|
null,
|
|
235
235
|
new T(t.encode(p.url ?? n.text), null)
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
return new
|
|
238
|
+
return new k(null, null);
|
|
239
239
|
}), s = u.map((n) => String(n.text ?? "")).join(`
|
|
240
240
|
`);
|
|
241
|
-
|
|
241
|
+
K.push(
|
|
242
242
|
new h(
|
|
243
243
|
t.encode("mediaGrid"),
|
|
244
244
|
t.encode(s),
|
|
@@ -247,8 +247,8 @@ async function W(c) {
|
|
|
247
247
|
)
|
|
248
248
|
);
|
|
249
249
|
} else
|
|
250
|
-
|
|
251
|
-
return
|
|
250
|
+
K.push(u[0]);
|
|
251
|
+
return K;
|
|
252
252
|
}
|
|
253
253
|
function j(c, i) {
|
|
254
254
|
const r = c[`${String(i)}Length`]();
|
|
@@ -285,8 +285,8 @@ async function X(c, i) {
|
|
|
285
285
|
for (const v of i)
|
|
286
286
|
y.append("relay", v);
|
|
287
287
|
y.set("secret", w), y.set("name", c);
|
|
288
|
-
const
|
|
289
|
-
return console.log("connect url:",
|
|
288
|
+
const m = `nostrconnect://${l}?${y.toString()}`;
|
|
289
|
+
return console.log("connect url:", m), G().setNip46QR(m, f), m;
|
|
290
290
|
}
|
|
291
291
|
export {
|
|
292
292
|
F as ConnectionTracker,
|
|
@@ -306,52 +306,56 @@ export {
|
|
|
306
306
|
ge as asKind1311,
|
|
307
307
|
he as asKind17,
|
|
308
308
|
fe as asKind17375,
|
|
309
|
-
ye as
|
|
310
|
-
we as
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
ve as
|
|
315
|
-
De as
|
|
316
|
-
Se as
|
|
317
|
-
xe as
|
|
318
|
-
Ce as
|
|
319
|
-
be as
|
|
320
|
-
Me as
|
|
321
|
-
Te as
|
|
322
|
-
Be as
|
|
323
|
-
Ae as
|
|
324
|
-
Ie as
|
|
325
|
-
Pe as
|
|
326
|
-
Re as
|
|
309
|
+
ye as asKind20,
|
|
310
|
+
we as asKind22,
|
|
311
|
+
Ke as asKind3,
|
|
312
|
+
ke as asKind4,
|
|
313
|
+
me as asKind6,
|
|
314
|
+
ve as asKind7,
|
|
315
|
+
De as asKind7374,
|
|
316
|
+
Se as asKind7375,
|
|
317
|
+
xe as asKind7376,
|
|
318
|
+
Ce as asKind9321,
|
|
319
|
+
be as asKind9735,
|
|
320
|
+
Me as asLinkPreview,
|
|
321
|
+
Te as asMediaGroupData,
|
|
322
|
+
Be as asNip51,
|
|
323
|
+
Ae as asNostrData,
|
|
324
|
+
Ie as asNostrEvent,
|
|
325
|
+
Pe as asParsedEvent,
|
|
326
|
+
Re as asPreGeneric,
|
|
327
|
+
Ee as asValidProofs,
|
|
328
|
+
$e as asVideoData,
|
|
327
329
|
X as connectWithQRCode,
|
|
328
330
|
J as fbArray,
|
|
329
331
|
j as fbIterable,
|
|
330
|
-
|
|
332
|
+
Ge as isBufferFull,
|
|
331
333
|
N as isConnectionStatus,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
334
|
+
Ne as isCountResponse,
|
|
335
|
+
Le as isEoce,
|
|
336
|
+
Ve as isKind0,
|
|
337
|
+
ze as isKind1,
|
|
338
|
+
Ze as isKind10002,
|
|
339
|
+
_e as isKind10019,
|
|
340
|
+
He as isKind1111,
|
|
341
|
+
Oe as isKind1311,
|
|
342
|
+
Ue as isKind17,
|
|
343
|
+
Qe as isKind17375,
|
|
344
|
+
Fe as isKind20,
|
|
345
|
+
We as isKind22,
|
|
346
|
+
je as isKind3,
|
|
347
|
+
Je as isKind4,
|
|
348
|
+
Xe as isKind6,
|
|
349
|
+
Ye as isKind7,
|
|
350
|
+
qe as isKind7374,
|
|
351
|
+
et as isKind7375,
|
|
352
|
+
tt as isKind7376,
|
|
353
|
+
nt as isKind9321,
|
|
354
|
+
st as isKind9735,
|
|
355
|
+
at as isNip51,
|
|
356
|
+
ot as isNostrEvent,
|
|
357
|
+
it as isParsedEvent,
|
|
358
|
+
rt as isPreGeneric,
|
|
359
|
+
ct as isValidProofs,
|
|
356
360
|
W as parseContent
|
|
357
361
|
};
|
package/dist/worker-message.js
CHANGED
|
@@ -2794,8 +2794,7 @@ class P {
|
|
|
2794
2794
|
t.startVector(4, s, 4);
|
|
2795
2795
|
}
|
|
2796
2796
|
static endKind20Parsed(t) {
|
|
2797
|
-
|
|
2798
|
-
return t.requiredField(s, 8), s;
|
|
2797
|
+
return t.endObject();
|
|
2799
2798
|
}
|
|
2800
2799
|
static createKind20Parsed(t, s, e, i, o, r, a, h, d) {
|
|
2801
2800
|
return P.startKind20Parsed(t), P.addTitle(t, s), P.addDescription(t, e), P.addImages(t, i), P.addContentWarning(t, o), P.addLocation(t, r), P.addGeohash(t, a), P.addHashtags(t, h), P.addMentions(t, d), P.endKind20Parsed(t);
|
|
@@ -6731,12 +6730,12 @@ class be {
|
|
|
6731
6730
|
}
|
|
6732
6731
|
export {
|
|
6733
6732
|
_s as $,
|
|
6734
|
-
|
|
6733
|
+
U as A,
|
|
6735
6734
|
St as B,
|
|
6736
6735
|
bt as C,
|
|
6737
|
-
|
|
6736
|
+
tt as D,
|
|
6738
6737
|
wt as E,
|
|
6739
|
-
|
|
6738
|
+
R as F,
|
|
6740
6739
|
Ht as G,
|
|
6741
6740
|
Rt as H,
|
|
6742
6741
|
nt as I,
|
|
@@ -6854,22 +6853,22 @@ export {
|
|
|
6854
6853
|
Et as f,
|
|
6855
6854
|
M as g,
|
|
6856
6855
|
G as h,
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6856
|
+
P as i,
|
|
6857
|
+
L as j,
|
|
6858
|
+
_ as k,
|
|
6859
|
+
N as l,
|
|
6860
|
+
It as m,
|
|
6861
|
+
W as n,
|
|
6862
|
+
X as o,
|
|
6863
|
+
ht as p,
|
|
6864
|
+
H as q,
|
|
6865
|
+
v as r,
|
|
6866
|
+
I as s,
|
|
6867
|
+
F as t,
|
|
6868
|
+
f as u,
|
|
6869
|
+
qt as v,
|
|
6870
|
+
yt as w,
|
|
6871
|
+
Vt as x,
|
|
6872
|
+
ot as y,
|
|
6873
|
+
Lt as z
|
|
6875
6874
|
};
|