Upgrade Nostrify

This commit is contained in:
Alex Gleason 2024-09-23 22:16:03 -05:00
parent 6a8b22d018
commit fc73cb2961
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
5 changed files with 72 additions and 31 deletions

View file

@ -32,8 +32,9 @@
"@isaacs/ttlcache": "npm:@isaacs/ttlcache@^1.4.1", "@isaacs/ttlcache": "npm:@isaacs/ttlcache@^1.4.1",
"@lambdalisue/async": "jsr:@lambdalisue/async@^2.1.1", "@lambdalisue/async": "jsr:@lambdalisue/async@^2.1.1",
"@noble/secp256k1": "npm:@noble/secp256k1@^2.0.0", "@noble/secp256k1": "npm:@noble/secp256k1@^2.0.0",
"@nostrify/db": "jsr:@nostrify/db@^0.32.2", "@nostrify/db": "jsr:@nostrify/db@^0.35.0",
"@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.30.1", "@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.36.0",
"@nostrify/policies": "jsr:@nostrify/policies@^0.35.0",
"@scure/base": "npm:@scure/base@^1.1.6", "@scure/base": "npm:@scure/base@^1.1.6",
"@sentry/deno": "https://deno.land/x/sentry@7.112.2/index.mjs", "@sentry/deno": "https://deno.land/x/sentry@7.112.2/index.mjs",
"@soapbox/kysely-pglite": "jsr:@soapbox/kysely-pglite@^0.0.1", "@soapbox/kysely-pglite": "jsr:@soapbox/kysely-pglite@^0.0.1",

88
deno.lock generated
View file

@ -17,21 +17,23 @@
"jsr:@gleasonator/policy@0.6.1": "jsr:@gleasonator/policy@0.6.1", "jsr:@gleasonator/policy@0.6.1": "jsr:@gleasonator/policy@0.6.1",
"jsr:@gleasonator/policy@0.6.3": "jsr:@gleasonator/policy@0.6.3", "jsr:@gleasonator/policy@0.6.3": "jsr:@gleasonator/policy@0.6.3",
"jsr:@gleasonator/policy@0.6.4": "jsr:@gleasonator/policy@0.6.4", "jsr:@gleasonator/policy@0.6.4": "jsr:@gleasonator/policy@0.6.4",
"jsr:@hono/hono@^4.4.6": "jsr:@hono/hono@4.5.11", "jsr:@hono/hono@^4.4.6": "jsr:@hono/hono@4.6.2",
"jsr:@lambdalisue/async@^2.1.1": "jsr:@lambdalisue/async@2.1.1", "jsr:@lambdalisue/async@^2.1.1": "jsr:@lambdalisue/async@2.1.1",
"jsr:@nostrify/db@^0.32.2": "jsr:@nostrify/db@0.32.2", "jsr:@nostrify/db@^0.35.0": "jsr:@nostrify/db@0.35.0",
"jsr:@nostrify/nostrify@^0.22.1": "jsr:@nostrify/nostrify@0.22.5", "jsr:@nostrify/nostrify@^0.22.1": "jsr:@nostrify/nostrify@0.22.5",
"jsr:@nostrify/nostrify@^0.22.4": "jsr:@nostrify/nostrify@0.22.4", "jsr:@nostrify/nostrify@^0.22.4": "jsr:@nostrify/nostrify@0.22.4",
"jsr:@nostrify/nostrify@^0.22.5": "jsr:@nostrify/nostrify@0.22.5", "jsr:@nostrify/nostrify@^0.22.5": "jsr:@nostrify/nostrify@0.22.5",
"jsr:@nostrify/nostrify@^0.30.0": "jsr:@nostrify/nostrify@0.30.1",
"jsr:@nostrify/nostrify@^0.30.1": "jsr:@nostrify/nostrify@0.30.1",
"jsr:@nostrify/nostrify@^0.31.0": "jsr:@nostrify/nostrify@0.31.0", "jsr:@nostrify/nostrify@^0.31.0": "jsr:@nostrify/nostrify@0.31.0",
"jsr:@nostrify/nostrify@^0.32.0": "jsr:@nostrify/nostrify@0.32.0", "jsr:@nostrify/nostrify@^0.32.0": "jsr:@nostrify/nostrify@0.32.0",
"jsr:@nostrify/nostrify@^0.35.0": "jsr:@nostrify/nostrify@0.35.0",
"jsr:@nostrify/nostrify@^0.36.0": "jsr:@nostrify/nostrify@0.36.0",
"jsr:@nostrify/policies@^0.33.0": "jsr:@nostrify/policies@0.33.0", "jsr:@nostrify/policies@^0.33.0": "jsr:@nostrify/policies@0.33.0",
"jsr:@nostrify/policies@^0.33.1": "jsr:@nostrify/policies@0.33.1", "jsr:@nostrify/policies@^0.33.1": "jsr:@nostrify/policies@0.33.1",
"jsr:@nostrify/policies@^0.34.0": "jsr:@nostrify/policies@0.34.0", "jsr:@nostrify/policies@^0.34.0": "jsr:@nostrify/policies@0.34.0",
"jsr:@nostrify/policies@^0.35.0": "jsr:@nostrify/policies@0.35.0",
"jsr:@nostrify/types@^0.30.0": "jsr:@nostrify/types@0.30.1", "jsr:@nostrify/types@^0.30.0": "jsr:@nostrify/types@0.30.1",
"jsr:@nostrify/types@^0.30.1": "jsr:@nostrify/types@0.30.1", "jsr:@nostrify/types@^0.30.1": "jsr:@nostrify/types@0.30.1",
"jsr:@nostrify/types@^0.35.0": "jsr:@nostrify/types@0.35.0",
"jsr:@soapbox/kysely-pglite@^0.0.1": "jsr:@soapbox/kysely-pglite@0.0.1", "jsr:@soapbox/kysely-pglite@^0.0.1": "jsr:@soapbox/kysely-pglite@0.0.1",
"jsr:@soapbox/stickynotes@^0.4.0": "jsr:@soapbox/stickynotes@0.4.0", "jsr:@soapbox/stickynotes@^0.4.0": "jsr:@soapbox/stickynotes@0.4.0",
"jsr:@std/assert@^0.213.1": "jsr:@std/assert@0.213.1", "jsr:@std/assert@^0.213.1": "jsr:@std/assert@0.213.1",
@ -55,7 +57,7 @@
"jsr:@std/fs@^0.229.3": "jsr:@std/fs@0.229.3", "jsr:@std/fs@^0.229.3": "jsr:@std/fs@0.229.3",
"jsr:@std/internal@^1.0.0": "jsr:@std/internal@1.0.3", "jsr:@std/internal@^1.0.0": "jsr:@std/internal@1.0.3",
"jsr:@std/io@^0.223.0": "jsr:@std/io@0.223.0", "jsr:@std/io@^0.223.0": "jsr:@std/io@0.223.0",
"jsr:@std/io@^0.224": "jsr:@std/io@0.224.7", "jsr:@std/io@^0.224": "jsr:@std/io@0.224.8",
"jsr:@std/json@^0.223.0": "jsr:@std/json@0.223.0", "jsr:@std/json@^0.223.0": "jsr:@std/json@0.223.0",
"jsr:@std/media-types@^0.224.1": "jsr:@std/media-types@0.224.1", "jsr:@std/media-types@^0.224.1": "jsr:@std/media-types@0.224.1",
"jsr:@std/path@0.213.1": "jsr:@std/path@0.213.1", "jsr:@std/path@0.213.1": "jsr:@std/path@0.213.1",
@ -229,14 +231,17 @@
"@hono/hono@4.5.9": { "@hono/hono@4.5.9": {
"integrity": "47f561e67aedbd6d1e21e3a1ae26c1b80ffdb62a51c161d502e75bee17ca40af" "integrity": "47f561e67aedbd6d1e21e3a1ae26c1b80ffdb62a51c161d502e75bee17ca40af"
}, },
"@hono/hono@4.6.2": {
"integrity": "35fcf3be4687825080b01bed7bbe2ac66f8d8b8939f0bad459661bf3b46d916f"
},
"@lambdalisue/async@2.1.1": { "@lambdalisue/async@2.1.1": {
"integrity": "1fc9bc6f4ed50215cd2f7217842b18cea80f81c25744f88f8c5eb4be5a1c9ab4" "integrity": "1fc9bc6f4ed50215cd2f7217842b18cea80f81c25744f88f8c5eb4be5a1c9ab4"
}, },
"@nostrify/db@0.32.2": { "@nostrify/db@0.35.0": {
"integrity": "265fb41e9d5810b99f1003ce56c89e4b468e6d0c04e7b9d9e3126c4efd49c1c2", "integrity": "637191c41812544e361b7997dc44ea098f8bd7efebb28f37a8a7142a0ecada8d",
"dependencies": [ "dependencies": [
"jsr:@nostrify/nostrify@^0.31.0", "jsr:@nostrify/nostrify@^0.35.0",
"jsr:@nostrify/types@^0.30.1", "jsr:@nostrify/types@^0.35.0",
"npm:kysely@^0.27.3", "npm:kysely@^0.27.3",
"npm:nostr-tools@^2.7.0" "npm:nostr-tools@^2.7.0"
] ]
@ -285,21 +290,6 @@
"npm:zod@^3.23.8" "npm:zod@^3.23.8"
] ]
}, },
"@nostrify/nostrify@0.30.1": {
"integrity": "fcc923707e87a9fbecc82dbb18756d1d3d134cd0763f4b1254c4bce709e811eb",
"dependencies": [
"jsr:@nostrify/types@^0.30.0",
"jsr:@std/crypto@^0.224.0",
"jsr:@std/encoding@^0.224.1",
"npm:@scure/base@^1.1.6",
"npm:@scure/bip32@^1.4.0",
"npm:@scure/bip39@^1.3.0",
"npm:lru-cache@^10.2.0",
"npm:nostr-tools@^2.7.0",
"npm:websocket-ts@^2.1.5",
"npm:zod@^3.23.8"
]
},
"@nostrify/nostrify@0.31.0": { "@nostrify/nostrify@0.31.0": {
"integrity": "1c1b686bb9ca3ad8d19807e3b96ef3793a65d70fd0f433fe6ef8b3fdb9f45557", "integrity": "1c1b686bb9ca3ad8d19807e3b96ef3793a65d70fd0f433fe6ef8b3fdb9f45557",
"dependencies": [ "dependencies": [
@ -326,6 +316,34 @@
"npm:zod@^3.23.8" "npm:zod@^3.23.8"
] ]
}, },
"@nostrify/nostrify@0.35.0": {
"integrity": "9bfef4883838b8b4cb2e2b28a60b72de95391ca5b789bc7206a2baea054dea55",
"dependencies": [
"jsr:@nostrify/types@^0.35.0",
"jsr:@std/encoding@^0.224.1",
"npm:@scure/bip32@^1.4.0",
"npm:@scure/bip39@^1.3.0",
"npm:lru-cache@^10.2.0",
"npm:nostr-tools@^2.7.0",
"npm:websocket-ts@^2.1.5",
"npm:zod@^3.23.8"
]
},
"@nostrify/nostrify@0.36.0": {
"integrity": "f00dbff1f02a2c496c5e85eeeb7a84101b7dd874d87456449dc71b6d037e40fc",
"dependencies": [
"jsr:@nostrify/types@^0.35.0",
"jsr:@std/crypto@^0.224.0",
"jsr:@std/encoding@^0.224.1",
"npm:@scure/base@^1.1.6",
"npm:@scure/bip32@^1.4.0",
"npm:@scure/bip39@^1.3.0",
"npm:lru-cache@^10.2.0",
"npm:nostr-tools@^2.7.0",
"npm:websocket-ts@^2.1.5",
"npm:zod@^3.23.8"
]
},
"@nostrify/policies@0.33.0": { "@nostrify/policies@0.33.0": {
"integrity": "c946b06d0527298b4d7c9819d142a10f522ba09eee76c37525aa4acfc5d87aee", "integrity": "c946b06d0527298b4d7c9819d142a10f522ba09eee76c37525aa4acfc5d87aee",
"dependencies": [ "dependencies": [
@ -348,12 +366,23 @@
"npm:nostr-tools@^2.7.0" "npm:nostr-tools@^2.7.0"
] ]
}, },
"@nostrify/policies@0.35.0": {
"integrity": "b828fac9f253e460a9587c05588b7dae6a0a32c5a9c9083e449219887b9e8e20",
"dependencies": [
"jsr:@nostrify/nostrify@^0.35.0",
"jsr:@nostrify/types@^0.35.0",
"npm:nostr-tools@^2.7.0"
]
},
"@nostrify/types@0.30.0": { "@nostrify/types@0.30.0": {
"integrity": "1f38fa849cff930bd709edbf94ef9ac02f46afb8b851f86c8736517b354616da" "integrity": "1f38fa849cff930bd709edbf94ef9ac02f46afb8b851f86c8736517b354616da"
}, },
"@nostrify/types@0.30.1": { "@nostrify/types@0.30.1": {
"integrity": "245da176f6893a43250697db51ad32bfa29bf9b1cdc1ca218043d9abf6de5ae5" "integrity": "245da176f6893a43250697db51ad32bfa29bf9b1cdc1ca218043d9abf6de5ae5"
}, },
"@nostrify/types@0.35.0": {
"integrity": "b8d515563d467072694557d5626fa1600f74e83197eef45dd86a9a99c64f7fe6"
},
"@soapbox/kysely-pglite@0.0.1": { "@soapbox/kysely-pglite@0.0.1": {
"integrity": "7a4221aa780aad6fba9747c45c59dfb1c62017ba8cad9db5607f6e5822c058d5", "integrity": "7a4221aa780aad6fba9747c45c59dfb1c62017ba8cad9db5607f6e5822c058d5",
"dependencies": [ "dependencies": [
@ -483,6 +512,12 @@
"jsr:@std/bytes@^1.0.2" "jsr:@std/bytes@^1.0.2"
] ]
}, },
"@std/io@0.224.8": {
"integrity": "f525d05d51fd873de6352b9afcf35cab9ab5dc448bf3c20e0c8b521ded9be392",
"dependencies": [
"jsr:@std/bytes@^1.0.2"
]
},
"@std/json@0.223.0": { "@std/json@0.223.0": {
"integrity": "9a4a255931dd0397924c6b10bb6a72fe3e28ddd876b981ada2e3b8dd0764163f", "integrity": "9a4a255931dd0397924c6b10bb6a72fe3e28ddd876b981ada2e3b8dd0764163f",
"dependencies": [ "dependencies": [
@ -2064,8 +2099,9 @@
"jsr:@bradenmacdonald/s3-lite-client@^0.7.4", "jsr:@bradenmacdonald/s3-lite-client@^0.7.4",
"jsr:@hono/hono@^4.4.6", "jsr:@hono/hono@^4.4.6",
"jsr:@lambdalisue/async@^2.1.1", "jsr:@lambdalisue/async@^2.1.1",
"jsr:@nostrify/db@^0.32.2", "jsr:@nostrify/db@^0.35.0",
"jsr:@nostrify/nostrify@^0.30.1", "jsr:@nostrify/nostrify@^0.36.0",
"jsr:@nostrify/policies@^0.35.0",
"jsr:@soapbox/kysely-pglite@^0.0.1", "jsr:@soapbox/kysely-pglite@^0.0.1",
"jsr:@soapbox/stickynotes@^0.4.0", "jsr:@soapbox/stickynotes@^0.4.0",
"jsr:@std/assert@^0.225.1", "jsr:@std/assert@^0.225.1",

View file

@ -15,7 +15,7 @@ export class Storages {
private static _db: Promise<EventsDB> | undefined; private static _db: Promise<EventsDB> | undefined;
private static _database: Promise<DittoDatabase> | undefined; private static _database: Promise<DittoDatabase> | undefined;
private static _admin: Promise<AdminStore> | undefined; private static _admin: Promise<AdminStore> | undefined;
private static _client: Promise<NPool> | undefined; private static _client: Promise<NPool<NRelay1>> | undefined;
private static _pubsub: Promise<InternalRelay> | undefined; private static _pubsub: Promise<InternalRelay> | undefined;
private static _search: Promise<SearchStore> | undefined; private static _search: Promise<SearchStore> | undefined;
@ -68,7 +68,7 @@ export class Storages {
} }
/** Relay pool storage. */ /** Relay pool storage. */
public static async client(): Promise<NPool> { public static async client(): Promise<NPool<NRelay1>> {
if (!this._client) { if (!this._client) {
this._client = (async () => { this._client = (async () => {
const db = await this.db(); const db = await this.db();

View file

@ -79,4 +79,8 @@ export class InternalRelay implements NRelay {
async query(): Promise<NostrEvent[]> { async query(): Promise<NostrEvent[]> {
return []; return [];
} }
async close(): Promise<void> {
return Promise.resolve();
}
} }

View file

@ -1,6 +1,6 @@
import 'deno-safe-fetch/load'; import 'deno-safe-fetch/load';
import { NostrEvent, NostrRelayOK, NPolicy } from '@nostrify/nostrify'; import { NostrEvent, NostrRelayOK, NPolicy } from '@nostrify/nostrify';
import { NoOpPolicy, ReadOnlyPolicy } from '@nostrify/nostrify/policies'; import { NoOpPolicy, ReadOnlyPolicy } from '@nostrify/policies';
import * as Comlink from 'comlink'; import * as Comlink from 'comlink';
import { DittoDB } from '@/db/DittoDB.ts'; import { DittoDB } from '@/db/DittoDB.ts';