@lingxia/rong 0.0.1 → 0.3.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 (66) hide show
  1. package/README.md +9 -7
  2. package/dist/command.d.ts +93 -0
  3. package/dist/command.d.ts.map +1 -0
  4. package/dist/command.js +6 -0
  5. package/dist/compression.d.ts +12 -0
  6. package/dist/compression.d.ts.map +1 -0
  7. package/dist/compression.js +6 -0
  8. package/dist/console.d.ts +20 -7
  9. package/dist/console.d.ts.map +1 -1
  10. package/dist/error.d.ts +40 -13
  11. package/dist/error.d.ts.map +1 -1
  12. package/dist/error.js +63 -28
  13. package/dist/fs.d.ts +111 -310
  14. package/dist/fs.d.ts.map +1 -1
  15. package/dist/fs.js +7 -4
  16. package/dist/global.d.ts +44 -37
  17. package/dist/global.d.ts.map +1 -1
  18. package/dist/http.d.ts +10 -0
  19. package/dist/http.d.ts.map +1 -1
  20. package/dist/index.d.ts +15 -12
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +15 -12
  23. package/dist/redis.d.ts +109 -0
  24. package/dist/redis.d.ts.map +1 -0
  25. package/dist/redis.js +13 -0
  26. package/dist/s3.d.ts +174 -0
  27. package/dist/s3.d.ts.map +1 -0
  28. package/dist/s3.js +10 -0
  29. package/dist/sqlite.d.ts +98 -0
  30. package/dist/sqlite.d.ts.map +1 -0
  31. package/dist/sqlite.js +8 -0
  32. package/dist/sse.d.ts +26 -0
  33. package/dist/sse.d.ts.map +1 -0
  34. package/dist/sse.js +2 -0
  35. package/dist/storage.d.ts +5 -16
  36. package/dist/storage.d.ts.map +1 -1
  37. package/dist/storage.js +4 -1
  38. package/dist/stream.d.ts +5 -8
  39. package/dist/stream.d.ts.map +1 -1
  40. package/dist/stream.js +5 -8
  41. package/dist/timer.d.ts +1 -18
  42. package/dist/timer.d.ts.map +1 -1
  43. package/dist/worker.d.ts +31 -0
  44. package/dist/worker.d.ts.map +1 -0
  45. package/dist/worker.js +14 -0
  46. package/package.json +12 -4
  47. package/src/abort.ts +0 -50
  48. package/src/assert.ts +0 -51
  49. package/src/buffer.ts +0 -60
  50. package/src/child_process.ts +0 -116
  51. package/src/console.ts +0 -53
  52. package/src/encoding.ts +0 -10
  53. package/src/error.ts +0 -149
  54. package/src/event.ts +0 -128
  55. package/src/exception.ts +0 -77
  56. package/src/fs.ts +0 -514
  57. package/src/global.ts +0 -98
  58. package/src/http.ts +0 -151
  59. package/src/index.ts +0 -67
  60. package/src/navigator.ts +0 -20
  61. package/src/path.ts +0 -83
  62. package/src/process.ts +0 -74
  63. package/src/storage.ts +0 -64
  64. package/src/stream.ts +0 -98
  65. package/src/timer.ts +0 -61
  66. package/src/url.ts +0 -106
package/dist/global.d.ts CHANGED
@@ -5,60 +5,67 @@
5
5
  * These declarations enable IDE autocomplete and TypeScript type checking.
6
6
  */
7
7
  import type { AssertFunction } from './assert';
8
- import type { ChildProcessModule } from './child_process';
9
- import type { DirEntry, FileInfo, FileOpenOptions, FsFile, MkdirOptions, ReadFileOptions, RemoveOptions, SeekMode, UTimeOptions, WriteFileOptions } from './fs';
10
- import type { PathModule } from './path';
11
- import type { Process } from './process';
12
- import type { StorageConstructor, StorageModule } from './storage';
8
+ import type { RongGzipCompressOptions, RongCompressionInput, RongZstdCompressOptions } from './compression';
9
+ import type { RongEnvMap, RongOutputHandle, RongShellError, RongShellTag, RongReadableProcessStream, RongSpawnOptions, RongSpawnOptionsWithCmd, RongSubprocess, RongSyncSubprocess } from './command';
10
+ import type { RongSleepValue } from './timer';
11
+ import type { DirEntry, MkdirOptions, RemoveOptions, RongFile, SeekMode, UTimeOptions } from './fs';
12
+ import type { RedisClientConstructor } from './redis';
13
+ import type { SSEConstructor } from './sse';
14
+ import type { S3Client } from './s3';
15
+ import type { SQLite } from './sqlite';
13
16
  declare global {
14
17
  /**
15
- * Rong runtime namespace - Core APIs for file system and storage
18
+ * Rong runtime namespace - host APIs exposed by the Rong runtime
16
19
  */
17
20
  const Rong: {
18
- readTextFile(path: string, options?: ReadFileOptions): Promise<string>;
19
- readFile(path: string, options?: ReadFileOptions): Promise<ArrayBuffer>;
20
- writeTextFile(path: string, text: string, options?: WriteFileOptions): Promise<void>;
21
- writeFile(path: string, data: ArrayBufferView, options?: WriteFileOptions): Promise<void>;
22
- copyFile(from: string, to: string): Promise<void>;
23
- truncate(path: string, len?: number): Promise<void>;
24
- open(path: string, options?: FileOpenOptions): Promise<FsFile>;
21
+ file(path: string): RongFile;
22
+ write(dest: string | RongFile, data: string | ArrayBufferView | ArrayBuffer | RongFile): Promise<number>;
25
23
  mkdir(path: string, options?: MkdirOptions): Promise<void>;
26
24
  readDir(path: string): Promise<AsyncIterableIterator<DirEntry>>;
27
- stat(path: string): Promise<FileInfo>;
28
- lstat(path: string): Promise<FileInfo>;
29
25
  remove(path: string, options?: RemoveOptions): Promise<void>;
30
26
  chdir(path: string): Promise<void>;
31
27
  symlink(target: string, path: string): Promise<void>;
32
28
  readlink(path: string): Promise<string>;
33
- /**
34
- * Change file permissions (Unix only)
35
- * @platform unix
36
- */
29
+ /** Change file permissions (Unix only) @platform unix */
37
30
  chmod(path: string, mode: number): Promise<void>;
38
- /**
39
- * Change file ownership (Unix only)
40
- * @platform unix
41
- */
31
+ /** Change file ownership (Unix only) @platform unix */
42
32
  chown(path: string, uid: number, gid: number): Promise<void>;
43
33
  utime(path: string, options: UTimeOptions): Promise<void>;
44
34
  rename(oldPath: string, newPath: string): Promise<void>;
45
35
  realPath(path: string): Promise<string>;
46
36
  readonly SeekMode: typeof SeekMode;
47
- readonly Storage: StorageConstructor;
48
- readonly storage: StorageModule;
37
+ readonly version: string;
38
+ readonly revision: string;
39
+ readonly argv: string[];
40
+ readonly args: string[];
41
+ readonly env: RongEnvMap;
42
+ readonly stdin: RongReadableProcessStream;
43
+ readonly stdout: RongOutputHandle;
44
+ readonly stderr: RongOutputHandle;
45
+ spawn(cmd: string[], options?: RongSpawnOptions): RongSubprocess;
46
+ spawn(options: RongSpawnOptionsWithCmd): RongSubprocess;
47
+ spawnSync(cmd: string[], options?: RongSpawnOptions): RongSyncSubprocess;
48
+ spawnSync(options: RongSpawnOptionsWithCmd): RongSyncSubprocess;
49
+ sleep(delay?: RongSleepValue): Promise<void>;
50
+ sleepSync(delay?: number): void;
51
+ zstdCompress(data: RongCompressionInput, options?: RongZstdCompressOptions): Promise<Uint8Array>;
52
+ zstdCompressSync(data: RongCompressionInput, options?: RongZstdCompressOptions): Uint8Array;
53
+ zstdDecompress(data: RongCompressionInput): Promise<Uint8Array>;
54
+ zstdDecompressSync(data: RongCompressionInput): Uint8Array;
55
+ gzip(data: RongCompressionInput, options?: RongGzipCompressOptions): Promise<Uint8Array>;
56
+ gzipSync(data: RongCompressionInput, options?: RongGzipCompressOptions): Uint8Array;
57
+ gunzip(data: RongCompressionInput): Promise<Uint8Array>;
58
+ gunzipSync(data: RongCompressionInput): Uint8Array;
59
+ readonly $: RongShellTag;
60
+ readonly ShellError: {
61
+ new (message: string): RongShellError;
62
+ prototype: RongShellError;
63
+ };
64
+ readonly RedisClient: RedisClientConstructor;
65
+ readonly S3Client: typeof S3Client;
66
+ readonly SQLite: typeof SQLite;
67
+ readonly SSE: SSEConstructor;
49
68
  };
50
- /**
51
- * Process object - Access to process information and environment
52
- */
53
- const process: Process;
54
- /**
55
- * Child Process module - Node.js compatible child process spawning (globalThis.child_process)
56
- */
57
- const child_process: ChildProcessModule;
58
- /**
59
- * Path module - Path manipulation utilities (Node.js compatible)
60
- */
61
- const path: PathModule;
62
69
  /**
63
70
  * Base64 decode - Decode base64 string to binary string
64
71
  */
@@ -1 +1 @@
1
- {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EACV,QAAQ,EACR,QAA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AAI,CACF,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,UAAU,CAAC,CAAC;QACvB,QAAQ,CACN,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,uBAAuB,GAChC,UAAU,CAAC;QACd,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACxD,UAAU,CAAC,IAAI,EAAE,oBAAoB,GAAG,UAAU,CAAC;QACnD,QAAQ,CAAC,CAAC,EAAE,YAAY,CAAC;QACzB,QAAQ,CAAC,UAAU,EAAE;YACnB,KAAK,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC;YACtC,SAAS,EAAE,cAAc,CAAC;SAC3B,CAAC;QACF,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC;QAC7C,QAAQ,CAAC,QAAQ,EAAE,OAAO,QAAQ,CAAC;QACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,MAAM,CAAC;QAC/B,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;KAC9B,CAAC;IAEF;;OAEG;IACH,SAAS,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEpC;;OAEG;IACH,SAAS,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEpC;;OAEG;IACH,MAAM,MAAM,EAAE,cAAc,CAAC;CAE9B;AAED,OAAO,EAAE,CAAC"}
package/dist/http.d.ts CHANGED
@@ -39,6 +39,8 @@ export interface FetchResponse {
39
39
  blob(): Promise<Blob>;
40
40
  /** Get response body as FormData */
41
41
  formData(): Promise<FormData>;
42
+ /** Clone the response */
43
+ clone(): FetchResponse;
42
44
  /** Get response body as ReadableStream */
43
45
  readonly body: ReadableStream<Uint8Array> | null;
44
46
  }
@@ -46,6 +48,12 @@ declare global {
46
48
  /**
47
49
  * Fetch API - Make HTTP requests
48
50
  *
51
+ * Timeout behavior:
52
+ * - Default request timeout is 60000ms (60s).
53
+ * - `RequestInit` does not support a `timeout` field.
54
+ * - Use `AbortSignal` for per-request cancellation, or configure runtime-level
55
+ * HTTP timeout from Rust (`rong_http::set_request_timeout(...)`).
56
+ *
49
57
  * @example
50
58
  * ```typescript
51
59
  * const response = await fetch('https://api.example.com/data', {
@@ -89,6 +97,8 @@ export interface Request extends Body {
89
97
  readonly redirect: string;
90
98
  readonly signal: AbortSignal | null;
91
99
  readonly url: string;
100
+ readonly cache: string;
101
+ readonly keepalive: boolean;
92
102
  clone(): Request;
93
103
  }
94
104
  export interface RequestConstructor {
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IAChC,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC1C;AAED,MAAM,WAAW,aAAa;IAC5B,uBAAuB;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,uBAAuB;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IAErB,uBAAuB;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B,oBAAoB;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B,mBAAmB;IACnB,QAAQ,CAAC,GAAG,EAAE,MA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MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,GAAG,CAAC;AAEjD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AAErF,MAAM,WAAW,OAAO;IACtB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAC7F,OAAO,IAAI,gBAAgB,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,IAAI,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACjC,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEnC,qDAAqD;IACrD,YAAY,IAAI,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAI,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IACjC,SAAS,EAAE,OAAO,CAAC;CACpB"}
package/dist/index.d.ts CHANGED
@@ -18,39 +18,42 @@
18
18
  * Then use the global APIs:
19
19
  * ```typescript
20
20
  * // File system
21
- * const text = await Rong.readTextFile('/path/to/file.txt');
22
- * await Rong.writeTextFile('/output.txt', 'Hello World');
21
+ * const text = await Rong.file('/path/to/file.txt').text();
22
+ * await Rong.write('/output.txt', 'Hello World');
23
23
  *
24
- * // Process
25
- * console.log(process.pid);
26
- * console.log(process.env.PATH);
24
+ * // Runtime
25
+ * console.log(Rong.argv);
26
+ * console.log(Rong.env.PATH);
27
+ *
28
+ * // Commands
29
+ * const child = Rong.spawn(['ls', '-la']);
27
30
  *
28
31
  * // HTTP
29
32
  * const response = await fetch('https://api.example.com');
30
- *
31
- * // Child process
32
- * const child = child_process.spawn('ls', ['-la']);
33
33
  * ```
34
34
  *
35
35
  * For detailed API documentation, see individual module exports below.
36
36
  */
37
37
  import './global';
38
- export * from './process';
39
- export * from './child_process';
38
+ export * from './compression';
39
+ export * from './command';
40
40
  export * from './stream';
41
41
  export * from './encoding';
42
42
  export * from './storage';
43
43
  export * from './http';
44
+ export * from './sse';
45
+ export * from './worker';
44
46
  export * from './fs';
45
47
  export * from './url';
46
48
  export * from './buffer';
47
49
  export * from './event';
48
50
  export * from './abort';
49
51
  export * from './exception';
50
- export * from './navigator';
51
52
  export * from './timer';
52
- export * from './path';
53
53
  export * from './assert';
54
54
  export * from './console';
55
+ export * from './sqlite';
56
+ export * from './redis';
57
+ export * from './s3';
55
58
  export * from './error';
56
59
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,UAAU,CAAC;AAGlB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AAGvB,cAAc,MAAM,CAAC;AAGrB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAG5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAG1B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,UAAU,CAAC;AAGlB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AAGzB,cAAc,MAAM,CAAC;AAGrB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC;AAGrB,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -19,18 +19,18 @@
19
19
  * Then use the global APIs:
20
20
  * ```typescript
21
21
  * // File system
22
- * const text = await Rong.readTextFile('/path/to/file.txt');
23
- * await Rong.writeTextFile('/output.txt', 'Hello World');
22
+ * const text = await Rong.file('/path/to/file.txt').text();
23
+ * await Rong.write('/output.txt', 'Hello World');
24
24
  *
25
- * // Process
26
- * console.log(process.pid);
27
- * console.log(process.env.PATH);
25
+ * // Runtime
26
+ * console.log(Rong.argv);
27
+ * console.log(Rong.env.PATH);
28
+ *
29
+ * // Commands
30
+ * const child = Rong.spawn(['ls', '-la']);
28
31
  *
29
32
  * // HTTP
30
33
  * const response = await fetch('https://api.example.com');
31
- *
32
- * // Child process
33
- * const child = child_process.spawn('ls', ['-la']);
34
34
  * ```
35
35
  *
36
36
  * For detailed API documentation, see individual module exports below.
@@ -53,12 +53,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
53
53
  // Global API declarations - Import this for full IDE autocomplete
54
54
  require("./global");
55
55
  // Core runtime modules
56
- __exportStar(require("./process"), exports);
57
- __exportStar(require("./child_process"), exports);
56
+ __exportStar(require("./compression"), exports);
57
+ __exportStar(require("./command"), exports);
58
58
  __exportStar(require("./stream"), exports);
59
59
  __exportStar(require("./encoding"), exports);
60
60
  __exportStar(require("./storage"), exports);
61
61
  __exportStar(require("./http"), exports);
62
+ __exportStar(require("./sse"), exports);
63
+ __exportStar(require("./worker"), exports);
62
64
  // File system
63
65
  __exportStar(require("./fs"), exports);
64
66
  // Web APIs
@@ -68,10 +70,11 @@ __exportStar(require("./event"), exports);
68
70
  __exportStar(require("./abort"), exports);
69
71
  __exportStar(require("./exception"), exports);
70
72
  // Utility modules
71
- __exportStar(require("./navigator"), exports);
72
73
  __exportStar(require("./timer"), exports);
73
- __exportStar(require("./path"), exports);
74
74
  __exportStar(require("./assert"), exports);
75
75
  __exportStar(require("./console"), exports);
76
+ __exportStar(require("./sqlite"), exports);
77
+ __exportStar(require("./redis"), exports);
78
+ __exportStar(require("./s3"), exports);
76
79
  // Error types
77
80
  __exportStar(require("./error"), exports);
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Redis client API — follows Bun's RedisClient API design.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * const client = new Rong.RedisClient("redis://localhost:6379");
7
+ * await client.set("key", "value");
8
+ * const val = await client.get("key"); // "value"
9
+ * client.close();
10
+ * ```
11
+ */
12
+ export type RedisReply = null | string | number | bigint | boolean | RedisReply[] | {
13
+ [key: string]: RedisReply;
14
+ };
15
+ export interface RedisSubscribeOptions {
16
+ signal?: AbortSignal;
17
+ }
18
+ export interface RedisMessage {
19
+ channel: string;
20
+ message: string;
21
+ }
22
+ export interface RedisSubscription extends AsyncIterableIterator<RedisMessage> {
23
+ readonly channel: string;
24
+ close(): void;
25
+ }
26
+ export interface RedisClientInstance {
27
+ /** Whether the client currently holds an open connection. */
28
+ readonly connected: boolean;
29
+ /** Explicitly connect to the Redis server. Commands auto-connect on first use. */
30
+ connect(): Promise<void>;
31
+ /** Close the connection. */
32
+ close(): void;
33
+ /** Set a string value. */
34
+ set(key: string, value: string): Promise<string>;
35
+ /** Get a string value, or `null` if the key does not exist. */
36
+ get(key: string): Promise<string | null>;
37
+ /** Delete a key. Returns the number of keys removed. */
38
+ del(key: string): Promise<number>;
39
+ /** Check if a key exists. */
40
+ exists(key: string): Promise<boolean>;
41
+ /** Set a timeout on a key (seconds). Returns `true` if the timeout was set. */
42
+ expire(key: string, seconds: number): Promise<boolean>;
43
+ /** Get the remaining time to live of a key (seconds). Returns -1 if no expiry, -2 if key does not exist. */
44
+ ttl(key: string): Promise<number>;
45
+ /** Increment the integer value of a key by 1. Returns the new value. */
46
+ incr(key: string): Promise<number>;
47
+ /** Decrement the integer value of a key by 1. Returns the new value. */
48
+ decr(key: string): Promise<number>;
49
+ /** Set a hash field. Returns 1 if field is new, 0 if updated. */
50
+ hset(key: string, field: string, value: string): Promise<number>;
51
+ /** Get a hash field value, or `null` if the field does not exist. */
52
+ hget(key: string, field: string): Promise<string | null>;
53
+ /** Set multiple hash fields. `fields` is `[field, value, ...]`. */
54
+ hmset(key: string, fields: string[]): Promise<string>;
55
+ /** Get multiple hash field values. Returns an array with `null` for missing fields. */
56
+ hmget(key: string, fields: string[]): Promise<(string | null)[]>;
57
+ /** Increment a hash field by an integer amount. Returns the new value. */
58
+ hincrby(key: string, field: string, increment: number): Promise<number>;
59
+ /** Increment a hash field by a float amount. Returns the new value. */
60
+ hincrbyfloat(key: string, field: string, increment: number): Promise<number>;
61
+ /** Add a member to a set. Returns 1 if added, 0 if already present. */
62
+ sadd(key: string, member: string): Promise<number>;
63
+ /** Remove a member from a set. Returns 1 if removed, 0 if not present. */
64
+ srem(key: string, member: string): Promise<number>;
65
+ /** Check if a member is in a set. */
66
+ sismember(key: string, member: string): Promise<boolean>;
67
+ /** Get all members of a set. */
68
+ smembers(key: string): Promise<string[]>;
69
+ /** Get a random member from a set, or `null` if empty. */
70
+ srandmember(key: string): Promise<string | null>;
71
+ /** Remove and return a random member, or `null` if empty. */
72
+ spop(key: string): Promise<string | null>;
73
+ /** Push a value to the head of a list. Returns the new list length. */
74
+ lpush(key: string, value: string): Promise<number>;
75
+ /** Push a value to the tail of a list. Returns the new list length. */
76
+ rpush(key: string, value: string): Promise<number>;
77
+ /** Remove and return the first element, or `null` if empty. */
78
+ lpop(key: string): Promise<string | null>;
79
+ /** Remove and return the last element, or `null` if empty. */
80
+ rpop(key: string): Promise<string | null>;
81
+ /** Get a range of elements from a list. Use -1 for end of list. */
82
+ lrange(key: string, start: number, stop: number): Promise<string[]>;
83
+ /** Get the length of a list. */
84
+ llen(key: string): Promise<number>;
85
+ /** Publish a message to a channel. Returns the number of clients that received it. */
86
+ publish(channel: string, message: string): Promise<number>;
87
+ /**
88
+ * Subscribe to a channel and receive messages through an async iterator.
89
+ * `break` in `for await...of` closes the underlying subscription via `return()`.
90
+ */
91
+ subscribe(channel: string, options?: RedisSubscribeOptions): Promise<RedisSubscription>;
92
+ /** Execute any Redis command. Integer replies may be returned as `bigint` when needed for precision. */
93
+ send(command: string, args: string[]): Promise<RedisReply>;
94
+ }
95
+ export interface RedisClientConstructor {
96
+ /**
97
+ * Create a new Redis client.
98
+ *
99
+ * @param url - Explicit Redis URL.
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * const client = new Rong.RedisClient("redis://localhost:6379");
104
+ * const client = new Rong.RedisClient("redis://user:pass@host:6379/0");
105
+ * ```
106
+ */
107
+ new (url: string): RedisClientInstance;
108
+ }
109
+ //# sourceMappingURL=redis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.d.ts","sourceRo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SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAIxF,wGAAwG;IACxG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;OAUG;IACH,KAAK,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACxC"}
package/dist/redis.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * Redis client API — follows Bun's RedisClient API design.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * const client = new Rong.RedisClient("redis://localhost:6379");
8
+ * await client.set("key", "value");
9
+ * const val = await client.get("key"); // "value"
10
+ * client.close();
11
+ * ```
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/s3.d.ts ADDED
@@ -0,0 +1,174 @@
1
+ /**
2
+ * S3-compatible object storage module type definitions.
3
+ * Corresponds to: modules/rong_s3
4
+ *
5
+ * Core API:
6
+ * new Rong.S3Client(options?) → S3Client
7
+ * client.file(path) → S3File (lazy reference, no network)
8
+ */
9
+ /**
10
+ * S3 client configuration options.
11
+ * All fields are optional at construction time, but actual requests
12
+ * require accessKeyId, secretAccessKey, and bucket.
13
+ */
14
+ export interface S3ClientOptions {
15
+ /** AWS access key ID. */
16
+ accessKeyId?: string;
17
+ /** AWS secret access key. */
18
+ secretAccessKey?: string;
19
+ /** AWS session token (STS). */
20
+ sessionToken?: string;
21
+ /** AWS region. @default "us-east-1" */
22
+ region?: string;
23
+ /** Custom endpoint URL (for S3-compatible services). */
24
+ endpoint?: string;
25
+ /** Bucket name. */
26
+ bucket?: string;
27
+ /** Default ACL for uploads (e.g. "public-read"). */
28
+ acl?: string;
29
+ /** Use virtual-hosted-style URLs instead of path-style. @default false */
30
+ virtualHostedStyle?: boolean;
31
+ }
32
+ /**
33
+ * Options for presigning URLs.
34
+ */
35
+ export interface S3PresignOptions {
36
+ /** Expiration in seconds. @default 86400 (24 hours) */
37
+ expiresIn?: number;
38
+ /** HTTP method. @default "GET" */
39
+ method?: "GET" | "PUT" | "DELETE";
40
+ }
41
+ /**
42
+ * Options for write operations.
43
+ */
44
+ export interface S3WriteOptions {
45
+ /** Content-Type header. @default "application/octet-stream" */
46
+ type?: string;
47
+ }
48
+ /**
49
+ * Options for list operations.
50
+ */
51
+ export interface S3ListOptions {
52
+ /** Filter objects by key prefix. */
53
+ prefix?: string;
54
+ /** Maximum number of keys to return. */
55
+ maxKeys?: number;
56
+ /** Start listing after this key (for pagination). */
57
+ startAfter?: string;
58
+ }
59
+ /**
60
+ * Object metadata returned by `stat()`.
61
+ */
62
+ export interface S3StatResult {
63
+ /** ETag of the object. */
64
+ etag?: string;
65
+ /** Last modified timestamp (ISO 8601 string). */
66
+ lastModified?: string;
67
+ /** Object size in bytes. */
68
+ size: number;
69
+ /** Content-Type of the object. */
70
+ type?: string;
71
+ }
72
+ /**
73
+ * Single object entry in a list result.
74
+ */
75
+ export interface S3ListEntry {
76
+ /** Object key. */
77
+ key: string;
78
+ /** Object size in bytes. */
79
+ size: number;
80
+ /** Last modified timestamp (ISO 8601 string). */
81
+ lastModified: string;
82
+ /** ETag of the object. */
83
+ etag?: string;
84
+ }
85
+ /**
86
+ * Result of a list operation.
87
+ */
88
+ export interface S3ListResult {
89
+ /** List of matching objects. */
90
+ contents: S3ListEntry[];
91
+ /** Whether there are more results (use `startAfter` to paginate). */
92
+ isTruncated: boolean;
93
+ }
94
+ /**
95
+ * Lazy reference to an S3 object. No network request on creation.
96
+ * Obtained from `S3Client.file()`.
97
+ *
98
+ * @example
99
+ * ```typescript
100
+ * const file = client.file("data.json");
101
+ * const text = await file.text();
102
+ * const data = await file.json();
103
+ * await file.write("new content");
104
+ * await file.delete();
105
+ * ```
106
+ */
107
+ export interface S3File {
108
+ /** The object key. */
109
+ readonly name: string;
110
+ /** Always NaN — use stat().size for object size. */
111
+ readonly size: number;
112
+ /** Read object contents as UTF-8 string. */
113
+ text(): Promise<string>;
114
+ /** Read object contents and parse as JSON. */
115
+ json(): Promise<any>;
116
+ /** Read object contents as ArrayBuffer. */
117
+ bytes(): Promise<ArrayBuffer>;
118
+ /** Read object contents as ArrayBuffer (alias for bytes). */
119
+ arrayBuffer(): Promise<ArrayBuffer>;
120
+ /** Write data to this S3 object. Returns bytes written. */
121
+ write(data: string | ArrayBuffer | Uint8Array, options?: S3WriteOptions): Promise<number>;
122
+ /** Delete this object. */
123
+ delete(): Promise<void>;
124
+ /** Delete this object (alias for delete). */
125
+ unlink(): Promise<void>;
126
+ /** Check if this object exists. */
127
+ exists(): Promise<boolean>;
128
+ /** Get object metadata (HEAD request). */
129
+ stat(): Promise<S3StatResult>;
130
+ /** Generate a presigned URL for this object. */
131
+ presign(options?: S3PresignOptions): Promise<string>;
132
+ /** Create a new S3File referencing a byte range of this object. */
133
+ slice(start: number, end?: number): S3File;
134
+ }
135
+ /**
136
+ * S3-compatible object storage client.
137
+ *
138
+ * @example
139
+ * ```typescript
140
+ * const client = new Rong.S3Client({
141
+ * accessKeyId: "...",
142
+ * secretAccessKey: "...",
143
+ * bucket: "my-bucket",
144
+ * endpoint: "https://s3.us-east-1.amazonaws.com",
145
+ * });
146
+ *
147
+ * await client.write("hello.txt", "Hello World!");
148
+ * const file = client.file("hello.txt");
149
+ * const text = await file.text();
150
+ * ```
151
+ */
152
+ export declare class S3Client {
153
+ constructor(options?: S3ClientOptions);
154
+ /** Create a lazy S3File reference. No network request. */
155
+ file(path: string, options?: S3ClientOptions): S3File;
156
+ /** Write data to an S3 object. Returns bytes written. */
157
+ write(path: string, data: string | ArrayBuffer | Uint8Array, options?: S3WriteOptions & S3ClientOptions): Promise<number>;
158
+ /** Delete an object. */
159
+ delete(path: string): Promise<void>;
160
+ /** Delete an object (alias for delete). */
161
+ unlink(path: string): Promise<void>;
162
+ /** Check if an object exists. */
163
+ exists(path: string): Promise<boolean>;
164
+ /** Get object size in bytes. */
165
+ size(path: string): Promise<number>;
166
+ /** Get object metadata (HEAD request). */
167
+ stat(path: string): Promise<S3StatResult>;
168
+ /** Generate a presigned URL. */
169
+ presign(path: string, options?: S3PresignOptions & S3ClientOptions): Promise<string>;
170
+ /** List objects in the bucket. */
171
+ list(options?: S3ListOptions & S3ClientOptions): Promise<S3ListResult>;
172
+ }
173
+ export {};
174
+ //# sourceMappingURL=s3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../src/s3.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wC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G,OAAO,CAAC,YAAY,CAAC;IAEzC,gCAAgC;IAChC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAEpF,kCAAkC;IAClC,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;CACvE;AAED,OAAO,EAAE,CAAC"}
package/dist/s3.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * S3-compatible object storage module type definitions.
4
+ * Corresponds to: modules/rong_s3
5
+ *
6
+ * Core API:
7
+ * new Rong.S3Client(options?) → S3Client
8
+ * client.file(path) → S3File (lazy reference, no network)
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });