@econ-v1/app-sdk 7.6.63 → 7.6.65

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.
@@ -3,7 +3,7 @@
3
3
  * they become. Everything here is data; `classifySpecifier` is the only
4
4
  * decision function.
5
5
  */
6
- export declare const BURGER_MODULES: readonly ["burger:host", "burger:fs", "burger:fs/promises", "burger:path", "burger:os", "burger:worker_threads", "burger:crypto", "burger:buffer", "burger:sqlite", "burger:zlib", "burger:async_hooks", "burger:test"];
6
+ export declare const BURGER_MODULES: readonly ["burger:host", "burger:fs", "burger:fs/promises", "burger:path", "burger:os", "burger:worker_threads", "burger:crypto", "burger:buffer", "burger:sqlite", "burger:zlib", "burger:async_hooks", "burger:zod", "burger:net", "burger:tls", "burger:dns/promises", "burger:test"];
7
7
  export type BurgerModule = (typeof BURGER_MODULES)[number];
8
8
  /** C5/C6 "Aliased from" columns (plus `fs/promises`, the module form of `fs.promises`). */
9
9
  export declare const ALIASES: ReadonlyMap<string, BurgerModule>;
@@ -38,6 +38,16 @@ export declare const NODE_BUILTINS: ReadonlySet<string>;
38
38
  * release that ships them. `createCipheriv`, `createDecipheriv` (aes-256-gcm)
39
39
  * and `scryptSync` arrive with the crypto pack (node-app-burger ADR 006, for
40
40
  * node-app-pii and node-app-distributed-backup), also ahead of its release.
41
+ *
42
+ * `burger:zod` (node-app-burger ADR 015, >= 0.3.12) has no `node:`/`bun:`
43
+ * alias: an app imports it by name (`import { install } from "burger:zod";
44
+ * install(z);`) to compile its zod 3 schemas into plain check functions.
45
+ *
46
+ * SOCKET PACK (node-app-burger ADR 018, >= 0.3.15): `burger:net`, `burger:tls`
47
+ * and `burger:dns/promises` are a client subset, what node-app-api-store's
48
+ * timed HTTP client (ADR-120) uses: `net.connect`/`createConnection`, `isIP`,
49
+ * `Socket` (no `createServer`), `tls.connect` with certificate checks always
50
+ * on (`rejectUnauthorized: false` throws), and `lookup`.
41
51
  */
42
52
  export declare const BURGER_EXPORTS: Readonly<Record<BurgerModule, readonly string[]>>;
43
53
  /**
@@ -34,6 +34,10 @@ var BURGER_MODULES = [
34
34
  "burger:sqlite",
35
35
  "burger:zlib",
36
36
  "burger:async_hooks",
37
+ "burger:zod",
38
+ "burger:net",
39
+ "burger:tls",
40
+ "burger:dns/promises",
37
41
  "burger:test"
38
42
  ];
39
43
  var ALIASES = new Map([
@@ -56,7 +60,13 @@ var ALIASES = new Map([
56
60
  ["zlib", "burger:zlib"],
57
61
  ["node:async_hooks", "burger:async_hooks"],
58
62
  ["async_hooks", "burger:async_hooks"],
59
- ["bun:test", "burger:test"]
63
+ ["bun:test", "burger:test"],
64
+ ["node:net", "burger:net"],
65
+ ["net", "burger:net"],
66
+ ["node:tls", "burger:tls"],
67
+ ["tls", "burger:tls"],
68
+ ["node:dns/promises", "burger:dns/promises"],
69
+ ["dns/promises", "burger:dns/promises"]
60
70
  ]);
61
71
  var NODE_BUILTINS = new Set([
62
72
  "_http_agent",
@@ -216,6 +226,10 @@ var BURGER_EXPORTS = {
216
226
  "inflateRawSync"
217
227
  ],
218
228
  "burger:async_hooks": ["AsyncLocalStorage"],
229
+ "burger:zod": ["install", "compile"],
230
+ "burger:net": ["Socket", "connect", "createConnection", "isIP", "isIPv4", "isIPv6"],
231
+ "burger:tls": ["TLSSocket", "connect"],
232
+ "burger:dns/promises": ["lookup"],
219
233
  "burger:test": [
220
234
  "describe",
221
235
  "test",
@@ -240,7 +254,11 @@ var BURGER_DEFAULT_EXPORT = {
240
254
  "burger:buffer": true,
241
255
  "burger:sqlite": true,
242
256
  "burger:zlib": true,
243
- "burger:async_hooks": true
257
+ "burger:async_hooks": true,
258
+ "burger:zod": true,
259
+ "burger:net": true,
260
+ "burger:tls": true,
261
+ "burger:dns/promises": true
244
262
  };
245
263
  var BURGER_MODULE_SET = new Set(BURGER_MODULES);
246
264
  function classifySpecifier(specifier) {
@@ -29,6 +29,10 @@ var BURGER_MODULES = [
29
29
  "burger:sqlite",
30
30
  "burger:zlib",
31
31
  "burger:async_hooks",
32
+ "burger:zod",
33
+ "burger:net",
34
+ "burger:tls",
35
+ "burger:dns/promises",
32
36
  "burger:test"
33
37
  ];
34
38
  var ALIASES = new Map([
@@ -51,7 +55,13 @@ var ALIASES = new Map([
51
55
  ["zlib", "burger:zlib"],
52
56
  ["node:async_hooks", "burger:async_hooks"],
53
57
  ["async_hooks", "burger:async_hooks"],
54
- ["bun:test", "burger:test"]
58
+ ["bun:test", "burger:test"],
59
+ ["node:net", "burger:net"],
60
+ ["net", "burger:net"],
61
+ ["node:tls", "burger:tls"],
62
+ ["tls", "burger:tls"],
63
+ ["node:dns/promises", "burger:dns/promises"],
64
+ ["dns/promises", "burger:dns/promises"]
55
65
  ]);
56
66
  var NODE_BUILTINS = new Set([
57
67
  "_http_agent",
@@ -211,6 +221,10 @@ var BURGER_EXPORTS = {
211
221
  "inflateRawSync"
212
222
  ],
213
223
  "burger:async_hooks": ["AsyncLocalStorage"],
224
+ "burger:zod": ["install", "compile"],
225
+ "burger:net": ["Socket", "connect", "createConnection", "isIP", "isIPv4", "isIPv6"],
226
+ "burger:tls": ["TLSSocket", "connect"],
227
+ "burger:dns/promises": ["lookup"],
214
228
  "burger:test": [
215
229
  "describe",
216
230
  "test",
@@ -235,7 +249,11 @@ var BURGER_DEFAULT_EXPORT = {
235
249
  "burger:buffer": true,
236
250
  "burger:sqlite": true,
237
251
  "burger:zlib": true,
238
- "burger:async_hooks": true
252
+ "burger:async_hooks": true,
253
+ "burger:zod": true,
254
+ "burger:net": true,
255
+ "burger:tls": true,
256
+ "burger:dns/promises": true
239
257
  };
240
258
  var BURGER_MODULE_SET = new Set(BURGER_MODULES);
241
259
  function classifySpecifier(specifier) {
@@ -24,3 +24,10 @@ declare module "zlib" { export * from "burger:zlib"; export { default } from "bu
24
24
  declare module "node:async_hooks" { export * from "burger:async_hooks"; export { default } from "burger:async_hooks"; }
25
25
  declare module "async_hooks" { export * from "burger:async_hooks"; export { default } from "burger:async_hooks"; }
26
26
  declare module "bun:test" { export * from "burger:test"; }
27
+ // Socket pack (node-app-burger ADR 018, >= 0.3.15): the client subset of net, tls and dns/promises.
28
+ declare module "node:net" { export * from "burger:net"; export { default } from "burger:net"; }
29
+ declare module "net" { export * from "burger:net"; export { default } from "burger:net"; }
30
+ declare module "node:tls" { export * from "burger:tls"; export { default } from "burger:tls"; }
31
+ declare module "tls" { export * from "burger:tls"; export { default } from "burger:tls"; }
32
+ declare module "node:dns/promises" { export * from "burger:dns/promises"; export { default } from "burger:dns/promises"; }
33
+ declare module "dns/promises" { export * from "burger:dns/promises"; export { default } from "burger:dns/promises"; }
@@ -498,6 +498,211 @@ declare module "burger:async_hooks" {
498
498
  export default asyncHooks;
499
499
  }
500
500
 
501
+ /** Compiled zod 3 checks (node-app-burger ADR 015, >= 0.3.12). `install(z)` makes every
502
+ * synchronous `parse`/`safeParse` of the zod 3 namespace `z` (`import * as z from "zod"`) run a
503
+ * compiled check first; an input that check does not accept always goes to zod, so errors and
504
+ * issues are zod's own. Throws a `TypeError` when `z` is not the zod 3 namespace. Idempotent. */
505
+ declare module "burger:zod" {
506
+ export function install(z: object): void;
507
+ /** The compiled check of a zod 3 schema, or `null` when the schema holds a type the compiler
508
+ * does not know. Internal to `install`; exported for tests. */
509
+ export function compile(schema: object): ((data: unknown) => unknown) | null;
510
+ const burgerZod: { install: typeof install; compile: typeof compile };
511
+ export default burgerZod;
512
+ }
513
+
514
+ /** Socket pack (node-app-burger ADR 018, >= 0.3.15): the client subset of `node:net` that
515
+ * node-app-api-store's timed HTTP client (ADR-120) uses. No servers, no IPC paths, no
516
+ * `allowHalfOpen`. At most 32 open sockets per app (one more fails with `EMFILE`). */
517
+ declare module "burger:net" {
518
+ import type { Buffer, BufferEncoding } from "burger:buffer";
519
+
520
+ export interface SocketConnectOpts {
521
+ port: number | string;
522
+ host?: string;
523
+ noDelay?: boolean;
524
+ }
525
+
526
+ export interface SocketAddress {
527
+ address: string;
528
+ family: "IPv4" | "IPv6";
529
+ port: number;
530
+ }
531
+
532
+ export interface SocketEvents {
533
+ connect: [];
534
+ ready: [];
535
+ data: [data: Buffer];
536
+ end: [];
537
+ finish: [];
538
+ drain: [];
539
+ error: [error: Error];
540
+ close: [hadError: boolean];
541
+ lookup: [error: Error | null, address: string, family: number, host: string];
542
+ }
543
+
544
+ type Listener<Args extends unknown[]> = (...args: Args) => void;
545
+ /** Any listener: every function type is assignable to it. */
546
+ export type AnyListener = (...args: never[]) => void;
547
+
548
+ /** A TCP client socket: Node's net.Socket events and methods, the part a client uses. */
549
+ export class Socket {
550
+ constructor(options?: { noDelay?: boolean });
551
+ readonly connecting: boolean;
552
+ readonly destroyed: boolean;
553
+ readonly pending: boolean;
554
+ readonly readable: boolean;
555
+ readonly writable: boolean;
556
+ readonly readyState: "opening" | "open" | "readOnly" | "writeOnly" | "closed";
557
+ readonly remoteAddress: string | undefined;
558
+ readonly remotePort: number | undefined;
559
+ readonly remoteFamily: "IPv4" | "IPv6" | undefined;
560
+ readonly localAddress: string | undefined;
561
+ readonly localPort: number | undefined;
562
+ readonly localFamily: "IPv4" | "IPv6" | undefined;
563
+ readonly bytesRead: number;
564
+ readonly bytesWritten: number;
565
+ connect(options: SocketConnectOpts, connectListener?: () => void): this;
566
+ connect(port: number, host?: string, connectListener?: () => void): this;
567
+ /** `false` once 16 KiB wait to be sent; `drain` follows when they are gone. */
568
+ write(data: string | Uint8Array, callback?: (error: Error | null) => void): boolean;
569
+ write(data: string | Uint8Array, encoding?: BufferEncoding, callback?: (error: Error | null) => void): boolean;
570
+ end(callback?: () => void): this;
571
+ end(data: string | Uint8Array, callback?: () => void): this;
572
+ end(data: string | Uint8Array, encoding?: BufferEncoding, callback?: () => void): this;
573
+ destroy(error?: Error): this;
574
+ pause(): this;
575
+ resume(): this;
576
+ isPaused(): boolean;
577
+ setNoDelay(noDelay?: boolean): this;
578
+ ref(): this;
579
+ unref(): this;
580
+ address(): SocketAddress | Record<string, never>;
581
+ on<Name extends keyof SocketEvents>(event: Name, listener: Listener<SocketEvents[Name]>): this;
582
+ on(event: string | symbol, listener: AnyListener): this;
583
+ addListener<Name extends keyof SocketEvents>(event: Name, listener: Listener<SocketEvents[Name]>): this;
584
+ addListener(event: string | symbol, listener: AnyListener): this;
585
+ prependListener<Name extends keyof SocketEvents>(event: Name, listener: Listener<SocketEvents[Name]>): this;
586
+ prependListener(event: string | symbol, listener: AnyListener): this;
587
+ once<Name extends keyof SocketEvents>(event: Name, listener: Listener<SocketEvents[Name]>): this;
588
+ once(event: string | symbol, listener: AnyListener): this;
589
+ prependOnceListener<Name extends keyof SocketEvents>(event: Name, listener: Listener<SocketEvents[Name]>): this;
590
+ prependOnceListener(event: string | symbol, listener: AnyListener): this;
591
+ off(event: string | symbol, listener: AnyListener): this;
592
+ removeListener(event: string | symbol, listener: AnyListener): this;
593
+ removeAllListeners(event?: string | symbol): this;
594
+ emit(event: string | symbol, ...args: unknown[]): boolean;
595
+ listenerCount(event: string | symbol, listener?: AnyListener): number;
596
+ listeners(event: string | symbol): AnyListener[];
597
+ rawListeners(event: string | symbol): AnyListener[];
598
+ eventNames(): Array<string | symbol>;
599
+ setMaxListeners(n: number): this;
600
+ getMaxListeners(): number;
601
+ }
602
+
603
+ export function connect(options: SocketConnectOpts, connectListener?: () => void): Socket;
604
+ export function connect(port: number, host?: string, connectListener?: () => void): Socket;
605
+ export function createConnection(options: SocketConnectOpts, connectListener?: () => void): Socket;
606
+ export function createConnection(port: number, host?: string, connectListener?: () => void): Socket;
607
+ /** 4, 6, or 0 when `input` is no IP address (Node's patterns, zone ids included). */
608
+ export function isIP(input: string): number;
609
+ export function isIPv4(input: string): boolean;
610
+ export function isIPv6(input: string): boolean;
611
+
612
+ type SocketClass = Socket;
613
+ type SocketConnectOptsType = SocketConnectOpts;
614
+ const net: {
615
+ Socket: typeof Socket;
616
+ connect: typeof connect;
617
+ createConnection: typeof createConnection;
618
+ isIP: typeof isIP;
619
+ isIPv4: typeof isIPv4;
620
+ isIPv6: typeof isIPv6;
621
+ };
622
+ /** `net.Socket` as a type through the default import, as Node's typings allow. */
623
+ namespace net {
624
+ export type Socket = SocketClass;
625
+ export type SocketConnectOpts = SocketConnectOptsType;
626
+ }
627
+ export default net;
628
+ }
629
+
630
+ /** Socket pack (node-app-burger ADR 018, >= 0.3.15): `tls.connect` over rustls, Mozilla's roots
631
+ * plus `NODE_EXTRA_CA_CERTS`, certificate and host checks always on. `rejectUnauthorized: false`
632
+ * and the options that change the handshake (`key`, `cert`, `ciphers`, `minVersion`, ...) throw. */
633
+ declare module "burger:tls" {
634
+ import type { Buffer } from "burger:buffer";
635
+ import { Socket, type AnyListener, type SocketEvents } from "burger:net";
636
+
637
+ export interface ConnectionOptions {
638
+ host?: string;
639
+ port?: number;
640
+ /** A connected or connecting `net.Socket` to run the handshake over. */
641
+ socket?: Socket;
642
+ /** The name the certificate is checked against and sent as SNI. */
643
+ servername?: string;
644
+ ALPNProtocols?: Array<string | Uint8Array> | Uint8Array;
645
+ /** PEM certificates that replace the bundled roots, as Node's `ca`. */
646
+ ca?: string | Buffer | Array<string | Buffer>;
647
+ noDelay?: boolean;
648
+ /** Only `true` (the default) is accepted. */
649
+ rejectUnauthorized?: true;
650
+ }
651
+
652
+ export interface TLSSocketEvents extends SocketEvents {
653
+ secureConnect: [];
654
+ }
655
+
656
+ type Listener<Args extends unknown[]> = (...args: Args) => void;
657
+
658
+ export class TLSSocket extends Socket {
659
+ readonly encrypted: true;
660
+ readonly authorized: boolean;
661
+ readonly authorizationError: Error | null;
662
+ /** The protocol the server chose by ALPN, or `false`. */
663
+ readonly alpnProtocol: string | false;
664
+ /** "TLSv1.3" or "TLSv1.2" once connected; `null` before. */
665
+ getProtocol(): string | null;
666
+ on<Name extends keyof TLSSocketEvents>(event: Name, listener: Listener<TLSSocketEvents[Name]>): this;
667
+ on(event: string | symbol, listener: AnyListener): this;
668
+ once<Name extends keyof TLSSocketEvents>(event: Name, listener: Listener<TLSSocketEvents[Name]>): this;
669
+ once(event: string | symbol, listener: AnyListener): this;
670
+ }
671
+
672
+ export function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
673
+ export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
674
+ export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
675
+
676
+ type TLSSocketClass = TLSSocket;
677
+ type ConnectionOptionsType = ConnectionOptions;
678
+ const tls: { TLSSocket: typeof TLSSocket; connect: typeof connect };
679
+ /** `tls.ConnectionOptions` and `tls.TLSSocket` as types through the default import. */
680
+ namespace tls {
681
+ export type TLSSocket = TLSSocketClass;
682
+ export type ConnectionOptions = ConnectionOptionsType;
683
+ }
684
+ export default tls;
685
+ }
686
+
687
+ /** Socket pack (node-app-burger ADR 018, >= 0.3.15): `lookup` from `node:dns/promises`,
688
+ * `getaddrinfo` off the app thread and not cached. `node:dns` itself is not provided. */
689
+ declare module "burger:dns/promises" {
690
+ export interface LookupAddress {
691
+ address: string;
692
+ family: number;
693
+ }
694
+
695
+ export interface LookupOptions {
696
+ family?: 0 | 4 | 6 | "IPv4" | "IPv6";
697
+ all?: boolean;
698
+ }
699
+
700
+ export function lookup(hostname: string, options: LookupOptions & { all: true }): Promise<LookupAddress[]>;
701
+ export function lookup(hostname: string, options?: LookupOptions | 0 | 4 | 6): Promise<LookupAddress>;
702
+ const dnsPromises: { lookup: typeof lookup };
703
+ export default dnsPromises;
704
+ }
705
+
501
706
  declare module "burger:buffer" {
502
707
  export type BufferEncoding = "utf8" | "utf-8" | "hex" | "base64" | "base64url" | "latin1" | "binary" | "ascii";
503
708
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@econ-v1/app-sdk",
3
- "version": "7.6.63",
3
+ "version": "7.6.65",
4
4
  "description": "TypeScript SDK for building Node mini-app plugins (Bun runtime) on the Lightning-powered marketplace daemon",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "author": "Node contributors",