@fleetmesh/leaf 0.1.0 → 0.1.1

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.
@@ -1,4 +1,4 @@
1
- import { type NostrEvent, type Tags } from './event.js;
1
+ import { type NostrEvent, type Tags } from './event.ts';
2
2
  export declare const KIND = 11801;
3
3
  export declare const SOFTWARE: [string, string];
4
4
  export interface LeafDescriptorOptions {
package/dist/did.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type KeyKind } from './keys.js;
1
+ import { type KeyKind } from './keys.ts';
2
2
  export interface ServiceEndpoint {
3
3
  uri?: string;
4
4
  accept?: string[];
@@ -1,4 +1,4 @@
1
- import { type NostrEvent } from './event.js;
1
+ import { type NostrEvent } from './event.ts';
2
2
  export declare const SEAL = 13;
3
3
  export declare const WRAP_LIVE = 21059;
4
4
  export declare const WRAP_STORED = 1059;
package/dist/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- export * as descriptor from './descriptor.js;
2
- export * as did from './did.js;
3
- export * as didcomm from './didcomm.js;
4
- export * as encoding from './encoding.js;
5
- export * as event from './event.js;
6
- export * as giftwrap from './giftwrap.js;
7
- export * as keys from './keys.js;
8
- export * as mediation from './mediation/leaf.js;
9
- export * as mediationMessages from './mediation/messages.js;
10
- export * as negentropy from './negentropy.js;
11
- export * as nip44 from './nip44.js;
12
- export * as relay from './relay.js;
13
- export * as seal from './seal.js;
14
- export { LeafSession, type LeafSessionOptions, SessionError } from './session.js;
15
- export { type BrowserLeafOptions, startBrowserLeaf, SW_PICKUP } from './pwa/browser-leaf.js;
16
- export { type HubEvent, LeafHub, type LeafStatus } from './pwa/hub.js;
17
- export { LeafStore } from './pwa/store.js;
1
+ export * as descriptor from './descriptor.ts';
2
+ export * as did from './did.ts';
3
+ export * as didcomm from './didcomm.ts';
4
+ export * as encoding from './encoding.ts';
5
+ export * as event from './event.ts';
6
+ export * as giftwrap from './giftwrap.ts';
7
+ export * as keys from './keys.ts';
8
+ export * as mediation from './mediation/leaf.ts';
9
+ export * as mediationMessages from './mediation/messages.ts';
10
+ export * as negentropy from './negentropy.ts';
11
+ export * as nip44 from './nip44.ts';
12
+ export * as relay from './relay.ts';
13
+ export * as seal from './seal.ts';
14
+ export { LeafSession, type LeafSessionOptions, SessionError } from './session.ts';
15
+ export { type BrowserLeafOptions, startBrowserLeaf, SW_PICKUP } from './pwa/browser-leaf.ts';
16
+ export { type HubEvent, LeafHub, type LeafStatus } from './pwa/hub.ts';
17
+ export { LeafStore } from './pwa/store.ts';
@@ -1,5 +1,5 @@
1
- import { type NostrEvent } from '../event.js;
2
- import { type ForwardBody, type KeylistUpdateBody, type KeylistUpdateResponseBody, type MediateDenyBody, type MediateGrantBody, type Message, type PickupDeliveryBody, type PickupDeliveryRequestBody, type PickupMessagesReceivedBody } from './messages.js;
1
+ import { type NostrEvent } from '../event.ts';
2
+ import { type ForwardBody, type KeylistUpdateBody, type KeylistUpdateResponseBody, type MediateDenyBody, type MediateGrantBody, type Message, type PickupDeliveryBody, type PickupDeliveryRequestBody, type PickupMessagesReceivedBody } from './messages.ts';
3
3
  /** NIP-66 / kind 11801 query a leaf with no peers sends to bootstrap relays. */
4
4
  export declare const DESCRIPTOR_KIND = 11801;
5
5
  export declare const COLD_START_FILTER: {
@@ -1,6 +1,6 @@
1
- import { LeafHub } from './hub.js;
2
- import { type MediatorConfig } from './store.js;
3
- import type { SocketFactory } from '../relay.js;
1
+ import { LeafHub } from './hub.ts';
2
+ import { type MediatorConfig } from './store.ts';
3
+ import type { SocketFactory } from '../relay.ts';
4
4
  export interface BrowserLeafOptions {
5
5
  mediator: MediatorConfig;
6
6
  name?: string;
package/dist/pwa/hub.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { OpenedDelivery } from '../mediation/leaf.js;
1
+ import type { OpenedDelivery } from '../mediation/leaf.ts';
2
2
  export type LeafStatus = 'idle' | 'connecting' | 'connected' | 'offline' | 'error';
3
3
  /** What the leader tab runs. */
4
4
  export interface Leader {
@@ -1,4 +1,4 @@
1
- import type { LeafClientState, OpenedDelivery } from '../mediation/leaf.js;
1
+ import type { LeafClientState, OpenedDelivery } from '../mediation/leaf.ts';
2
2
  export declare const DB_NAME = "fleetmesh-leaf";
3
3
  export interface LeafIdentity {
4
4
  nodeSk: string;
package/dist/relay.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { NostrEvent } from './event.js;
1
+ import type { NostrEvent } from './event.ts';
2
2
  /** The slice of the WHATWG WebSocket this module uses. */
3
3
  export interface SocketLike {
4
4
  readonly readyState: number;
package/dist/seal.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as didcomm from './didcomm.js;
2
- import type { NostrEvent } from './event.js;
1
+ import * as didcomm from './didcomm.ts';
2
+ import type { NostrEvent } from './event.ts';
3
3
  export declare const FRAGMENT_BYTES = 24000;
4
4
  export declare const MAX_FRAGMENTS = 64;
5
5
  export declare const ENVELOPE_MAX: number;
package/dist/session.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { type NostrEvent } from './event.js;
2
- import { LeafClient, type LeafClientState, type OpenedDelivery } from './mediation/leaf.js;
3
- import { type SocketFactory } from './relay.js;
4
- import { type Opened } from './seal.js;
1
+ import { type NostrEvent } from './event.ts';
2
+ import { LeafClient, type LeafClientState, type OpenedDelivery } from './mediation/leaf.ts';
3
+ import { type SocketFactory } from './relay.ts';
4
+ import { type Opened } from './seal.ts';
5
5
  export declare class SessionError extends Error {
6
6
  }
7
7
  export interface LeafSessionOptions {
@@ -63,7 +63,7 @@ export declare class LeafSession {
63
63
  /** Send a message and wait for the mediator's answer on its thread. */
64
64
  private request;
65
65
  requestMediation(): Promise<'granted' | 'denied'>;
66
- updateKeylist(add?: string[], remove?: string[]): Promise<import("./mediation/messages.js).KeylistUpdated[]>;
66
+ updateKeylist(add?: string[], remove?: string[]): Promise<import("./mediation/messages.ts").KeylistUpdated[]>;
67
67
  /** Drain every registered key until the mediator has nothing left, acking
68
68
  * each batch so it purges what was taken. maxRounds bounds a mediator that
69
69
  * keeps returning the same batch. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetmesh/leaf",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Fleetmesh leaf profile in TypeScript: browsers and PWAs as mediated mesh leaves",
5
5
  "license": "CC0-1.0",
6
6
  "type": "module",
@@ -18,7 +18,7 @@
18
18
  "src"
19
19
  ],
20
20
  "scripts": {
21
- "build": "tsc --ignoreConfig --target ES2022 --module ESNext --moduleResolution Bundler --lib ES2022,DOM --strict --declaration --rewriteRelativeImportExtensions --outDir dist --rootDir src src/index.ts && node -e \"const fs=require('fs'),path=require('path');const walk=d=>fs.readdirSync(d,{withFileTypes:true}).forEach(e=>{const p=path.join(d,e.name);if(e.isDirectory())walk(p);else if(p.endsWith('.d.ts'))fs.writeFileSync(p,fs.readFileSync(p,'utf8').replace(/\\.ts(['\\\"])/g,'.js$1'))});walk('dist')\"",
21
+ "build": "tsc --ignoreConfig --target ES2022 --module ESNext --moduleResolution Bundler --lib ES2022,DOM --strict --declaration --rewriteRelativeImportExtensions --outDir dist --rootDir src src/index.ts",
22
22
  "prepack": "npm run build",
23
23
  "test": "vitest run --project node",
24
24
  "test:browser": "vitest run --project browser",