@elaraai/east-node-io 0.0.1-beta.1 → 0.0.1-beta.10

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 (115) hide show
  1. package/README.md +38 -0
  2. package/dist/compression/gzip.d.ts +108 -0
  3. package/dist/compression/gzip.d.ts.map +1 -0
  4. package/dist/compression/gzip.js +153 -0
  5. package/dist/compression/gzip.js.map +1 -0
  6. package/dist/compression/index.d.ts +308 -0
  7. package/dist/compression/index.d.ts.map +1 -0
  8. package/dist/compression/index.js +289 -0
  9. package/dist/compression/index.js.map +1 -0
  10. package/dist/compression/tar.d.ts +115 -0
  11. package/dist/compression/tar.d.ts.map +1 -0
  12. package/dist/compression/tar.js +254 -0
  13. package/dist/compression/tar.js.map +1 -0
  14. package/dist/compression/types.d.ts +124 -0
  15. package/dist/compression/types.d.ts.map +1 -0
  16. package/dist/compression/types.js +106 -0
  17. package/dist/compression/types.js.map +1 -0
  18. package/dist/compression/zip.d.ts +121 -0
  19. package/dist/compression/zip.d.ts.map +1 -0
  20. package/dist/compression/zip.js +200 -0
  21. package/dist/compression/zip.js.map +1 -0
  22. package/dist/connection/index.d.ts +78 -0
  23. package/dist/connection/index.d.ts.map +1 -0
  24. package/dist/connection/index.js +134 -0
  25. package/dist/connection/index.js.map +1 -0
  26. package/dist/format/index.d.ts +421 -0
  27. package/dist/format/index.d.ts.map +1 -0
  28. package/dist/format/index.js +326 -0
  29. package/dist/format/index.js.map +1 -0
  30. package/dist/format/types.d.ts +176 -0
  31. package/dist/format/types.d.ts.map +1 -0
  32. package/dist/format/types.js +122 -0
  33. package/dist/format/types.js.map +1 -0
  34. package/dist/format/xlsx.d.ts +178 -0
  35. package/dist/format/xlsx.d.ts.map +1 -0
  36. package/dist/format/xlsx.js +313 -0
  37. package/dist/format/xlsx.js.map +1 -0
  38. package/dist/format/xml.d.ts +302 -0
  39. package/dist/format/xml.d.ts.map +1 -0
  40. package/dist/format/xml.js +602 -0
  41. package/dist/format/xml.js.map +1 -0
  42. package/dist/index.d.ts +25 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +32 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/nosql/index.d.ts +503 -0
  47. package/dist/nosql/index.d.ts.map +1 -0
  48. package/dist/nosql/index.js +483 -0
  49. package/dist/nosql/index.js.map +1 -0
  50. package/dist/nosql/mongodb.d.ts +306 -0
  51. package/dist/nosql/mongodb.d.ts.map +1 -0
  52. package/dist/nosql/mongodb.js +552 -0
  53. package/dist/nosql/mongodb.js.map +1 -0
  54. package/dist/nosql/redis.d.ts +268 -0
  55. package/dist/nosql/redis.d.ts.map +1 -0
  56. package/dist/nosql/redis.js +371 -0
  57. package/dist/nosql/redis.js.map +1 -0
  58. package/dist/nosql/types.d.ts +70 -0
  59. package/dist/nosql/types.d.ts.map +1 -0
  60. package/dist/nosql/types.js +79 -0
  61. package/dist/nosql/types.js.map +1 -0
  62. package/dist/platform.d.ts +12 -0
  63. package/dist/platform.d.ts.map +1 -0
  64. package/dist/platform.js +51 -0
  65. package/dist/platform.js.map +1 -0
  66. package/dist/sql/index.d.ts +777 -0
  67. package/dist/sql/index.d.ts.map +1 -0
  68. package/dist/sql/index.js +515 -0
  69. package/dist/sql/index.js.map +1 -0
  70. package/dist/sql/mysql.d.ts +238 -0
  71. package/dist/sql/mysql.d.ts.map +1 -0
  72. package/dist/sql/mysql.js +396 -0
  73. package/dist/sql/mysql.js.map +1 -0
  74. package/dist/sql/postgres.d.ts +237 -0
  75. package/dist/sql/postgres.d.ts.map +1 -0
  76. package/dist/sql/postgres.js +381 -0
  77. package/dist/sql/postgres.js.map +1 -0
  78. package/dist/sql/sqlite.d.ts +217 -0
  79. package/dist/sql/sqlite.d.ts.map +1 -0
  80. package/dist/sql/sqlite.js +366 -0
  81. package/dist/sql/sqlite.js.map +1 -0
  82. package/dist/sql/types.d.ts +205 -0
  83. package/dist/sql/types.d.ts.map +1 -0
  84. package/dist/sql/types.js +175 -0
  85. package/dist/sql/types.js.map +1 -0
  86. package/dist/storage/index.d.ts +304 -0
  87. package/dist/storage/index.d.ts.map +1 -0
  88. package/dist/storage/index.js +234 -0
  89. package/dist/storage/index.js.map +1 -0
  90. package/dist/storage/s3.d.ts +373 -0
  91. package/dist/storage/s3.d.ts.map +1 -0
  92. package/dist/storage/s3.js +502 -0
  93. package/dist/storage/s3.js.map +1 -0
  94. package/dist/storage/types.d.ts +117 -0
  95. package/dist/storage/types.d.ts.map +1 -0
  96. package/dist/storage/types.js +94 -0
  97. package/dist/storage/types.js.map +1 -0
  98. package/dist/transfer/ftp.d.ts +333 -0
  99. package/dist/transfer/ftp.d.ts.map +1 -0
  100. package/dist/transfer/ftp.js +437 -0
  101. package/dist/transfer/ftp.js.map +1 -0
  102. package/dist/transfer/index.d.ts +456 -0
  103. package/dist/transfer/index.d.ts.map +1 -0
  104. package/dist/transfer/index.js +414 -0
  105. package/dist/transfer/index.js.map +1 -0
  106. package/dist/transfer/sftp.d.ts +333 -0
  107. package/dist/transfer/sftp.d.ts.map +1 -0
  108. package/dist/transfer/sftp.js +436 -0
  109. package/dist/transfer/sftp.js.map +1 -0
  110. package/dist/transfer/types.d.ts +108 -0
  111. package/dist/transfer/types.d.ts.map +1 -0
  112. package/dist/transfer/types.js +110 -0
  113. package/dist/transfer/types.js.map +1 -0
  114. package/dist/tsconfig.tsbuildinfo +1 -0
  115. package/package.json +17 -9
package/dist/index.js ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * East Node IO - I/O platform functions for the East language on Node.js
7
+ *
8
+ * Provides type-safe I/O operations for East programs including:
9
+ * - SQL databases (SQLite, PostgreSQL, MySQL)
10
+ * - Cloud storage (S3)
11
+ * - File transfer (FTP, SFTP)
12
+ * - NoSQL databases (Redis, MongoDB)
13
+ * - File formats (XLSX/Excel, CSV, XML)
14
+ * - Compression (gzip, zip, tar)
15
+ *
16
+ * @packageDocumentation
17
+ */
18
+ // Export SQL modules
19
+ export * from "./sql/index.js";
20
+ // Export Storage modules
21
+ export * from "./storage/index.js";
22
+ // Export Transfer modules
23
+ export * from "./transfer/index.js";
24
+ // Export NoSQL modules
25
+ export * from "./nosql/index.js";
26
+ // Export Format modules
27
+ export * from "./format/index.js";
28
+ // Export Compression modules
29
+ export * from "./compression/index.js";
30
+ // Re-export all exports as a nested EastNodeIO namespace (matching East.East pattern)
31
+ export * as EastNodeIO from './index.js';
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,qBAAqB;AACrB,cAAc,gBAAgB,CAAC;AAE/B,yBAAyB;AACzB,cAAc,oBAAoB,CAAC;AAEnC,0BAA0B;AAC1B,cAAc,qBAAqB,CAAC;AAEpC,uBAAuB;AACvB,cAAc,kBAAkB,CAAC;AAEjC,wBAAwB;AACxB,cAAc,mBAAmB,CAAC;AAElC,6BAA6B;AAC7B,cAAc,wBAAwB,CAAC;AAEvC,sFAAsF;AACtF,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC"}
@@ -0,0 +1,503 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * NoSQL database platform functions.
7
+ *
8
+ * Provides Redis and MongoDB operations for East programs,
9
+ * supporting caching and document storage use cases.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ export * from "./redis.js";
14
+ export * from "./mongodb.js";
15
+ export { RedisConfigType, MongoConfigType, BsonValueType, MongoFindOptionsType } from "./types.js";
16
+ /**
17
+ * NoSQL database platform functions.
18
+ *
19
+ * Provides Redis and MongoDB operations for East programs with type-safe
20
+ * caching and document storage capabilities.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * import { East, StringType, OptionType, variant } from "@elaraai/east";
25
+ * import { NoSQL } from "@elaraai/east-node-io";
26
+ *
27
+ * const cacheExample = East.function([StringType], OptionType(StringType), ($, key) => {
28
+ * const config = $.let({
29
+ * host: "localhost",
30
+ * port: 6379n,
31
+ * password: variant('none', null),
32
+ * db: variant('none', null),
33
+ * keyPrefix: variant('none', null),
34
+ * });
35
+ *
36
+ * const conn = $.let(NoSQL.Redis.connect(config));
37
+ * const value = $.let(NoSQL.Redis.get(conn, key));
38
+ * $(NoSQL.Redis.close(conn));
39
+ *
40
+ * $.return(value);
41
+ * });
42
+ *
43
+ * // All NoSQL operations are async
44
+ * const compiled = East.compileAsync(cacheExample.toIR(), NoSQL.Redis.Implementation);
45
+ * await compiled("user:42");
46
+ * ```
47
+ */
48
+ export declare const NoSQL: {
49
+ /**
50
+ * Redis key-value store operations.
51
+ *
52
+ * Provides platform functions for Redis caching and data storage,
53
+ * supporting get, set, delete, and expiration operations.
54
+ */
55
+ readonly Redis: {
56
+ /**
57
+ * Connects to a Redis server.
58
+ *
59
+ * Creates a connection to a Redis server and returns an
60
+ * opaque handle for use in key-value operations.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const getValue = East.function([StringType], OptionType(StringType), ($, key) => {
65
+ * const config = $.let({
66
+ * host: "localhost",
67
+ * port: 6379n,
68
+ * password: variant('none', null),
69
+ * db: variant('none', null),
70
+ * keyPrefix: variant('none', null),
71
+ * });
72
+ *
73
+ * const conn = $.let(NoSQL.Redis.connect(config));
74
+ * const value = $.let(NoSQL.Redis.get(conn, key));
75
+ * $(NoSQL.Redis.close(conn));
76
+ * $.return(value);
77
+ * });
78
+ *
79
+ * const compiled = East.compileAsync(getValue.toIR(), NoSQL.Redis.Implementation);
80
+ * await compiled("user:42"); // Some("Alice") or None
81
+ * ```
82
+ */
83
+ readonly connect: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StructType<{
84
+ host: import("@elaraai/east").StringType;
85
+ port: import("@elaraai/east").IntegerType;
86
+ password: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
87
+ db: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
88
+ keyPrefix: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
89
+ }>], import("@elaraai/east").StringType>;
90
+ /**
91
+ * Gets a value by key from Redis.
92
+ *
93
+ * Retrieves the string value associated with the given key.
94
+ * Returns None if the key doesn't exist.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const getValue = East.function([StringType], OptionType(StringType), ($, key) => {
99
+ * const config = $.let({
100
+ * host: "localhost",
101
+ * port: 6379n,
102
+ * password: variant('none', null),
103
+ * db: variant('none', null),
104
+ * keyPrefix: variant('none', null),
105
+ * });
106
+ * const conn = $.let(NoSQL.Redis.connect(config));
107
+ * const value = $.let(NoSQL.Redis.get(conn, key));
108
+ * $(NoSQL.Redis.close(conn));
109
+ * $.return(value);
110
+ * });
111
+ *
112
+ * const compiled = East.compileAsync(getValue.toIR(), NoSQL.Redis.Implementation);
113
+ * await compiled("user:42"); // variant('some', "Alice") or variant('none', null)
114
+ * ```
115
+ */
116
+ readonly get: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType, import("@elaraai/east").StringType], import("@elaraai/east").OptionType<import("@elaraai/east").StringType>>;
117
+ /**
118
+ * Sets a key-value pair in Redis.
119
+ *
120
+ * Stores a string value associated with the given key.
121
+ * Overwrites existing values.
122
+ *
123
+ * @example
124
+ * ```ts
125
+ * const setValue = East.function([StringType, StringType], NullType, ($, key, value) => {
126
+ * const config = $.let({
127
+ * host: "localhost",
128
+ * port: 6379n,
129
+ * password: variant('none', null),
130
+ * db: variant('none', null),
131
+ * keyPrefix: variant('none', null),
132
+ * });
133
+ * const conn = $.let(NoSQL.Redis.connect(config));
134
+ * $(NoSQL.Redis.set(conn, key, value));
135
+ * $(NoSQL.Redis.close(conn));
136
+ * $.return(null);
137
+ * });
138
+ *
139
+ * const compiled = East.compileAsync(setValue.toIR(), NoSQL.Redis.Implementation);
140
+ * await compiled("user:42", "Alice");
141
+ * ```
142
+ */
143
+ readonly set: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType, import("@elaraai/east").StringType, import("@elaraai/east").StringType], import("@elaraai/east").NullType>;
144
+ /**
145
+ * Sets a key-value pair with expiration in Redis.
146
+ *
147
+ * Stores a string value with a TTL (time-to-live) in seconds.
148
+ * The key will automatically expire after the specified duration.
149
+ *
150
+ * @example
151
+ * ```ts
152
+ * const setSession = East.function([StringType, StringType], NullType, ($, sessionId, data) => {
153
+ * const config = $.let({
154
+ * host: "localhost",
155
+ * port: 6379n,
156
+ * password: variant('none', null),
157
+ * db: variant('none', null),
158
+ * keyPrefix: variant('none', null),
159
+ * });
160
+ * const conn = $.let(NoSQL.Redis.connect(config));
161
+ * $(NoSQL.Redis.setex(conn, sessionId, data, 3600n)); // 1 hour TTL
162
+ * $(NoSQL.Redis.close(conn));
163
+ * $.return(null);
164
+ * });
165
+ *
166
+ * const compiled = East.compileAsync(setSession.toIR(), NoSQL.Redis.Implementation);
167
+ * await compiled("session:xyz", "user_data");
168
+ * ```
169
+ */
170
+ readonly setex: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType, import("@elaraai/east").StringType, import("@elaraai/east").StringType, import("@elaraai/east").IntegerType], import("@elaraai/east").NullType>;
171
+ /**
172
+ * Deletes a key from Redis.
173
+ *
174
+ * Removes the key and its associated value from Redis.
175
+ * Returns the number of keys deleted (0 or 1).
176
+ *
177
+ * @example
178
+ * ```ts
179
+ * const deleteKey = East.function([StringType], IntegerType, ($, key) => {
180
+ * const config = $.let({
181
+ * host: "localhost",
182
+ * port: 6379n,
183
+ * password: variant('none', null),
184
+ * db: variant('none', null),
185
+ * keyPrefix: variant('none', null),
186
+ * });
187
+ * const conn = $.let(NoSQL.Redis.connect(config));
188
+ * const deleted = $.let(NoSQL.Redis.delete(conn, key));
189
+ * $(NoSQL.Redis.close(conn));
190
+ * $.return(deleted);
191
+ * });
192
+ *
193
+ * const compiled = East.compileAsync(deleteKey.toIR(), NoSQL.Redis.Implementation);
194
+ * await compiled("user:42"); // 1n (deleted) or 0n (not found)
195
+ * ```
196
+ */
197
+ readonly delete: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType, import("@elaraai/east").StringType], import("@elaraai/east").IntegerType>;
198
+ /**
199
+ * Closes the Redis connection.
200
+ *
201
+ * Closes the connection and releases all resources.
202
+ *
203
+ * @example
204
+ * ```ts
205
+ * const cleanup = East.function([], NullType, $ => {
206
+ * const config = $.let({
207
+ * host: "localhost",
208
+ * port: 6379n,
209
+ * password: variant('none', null),
210
+ * db: variant('none', null),
211
+ * keyPrefix: variant('none', null),
212
+ * });
213
+ * const conn = $.let(NoSQL.Redis.connect(config));
214
+ * // ... do work ...
215
+ * $(NoSQL.Redis.close(conn));
216
+ * });
217
+ *
218
+ * const compiled = East.compileAsync(cleanup.toIR(), NoSQL.Redis.Implementation);
219
+ * await compiled();
220
+ * ```
221
+ */
222
+ readonly close: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType], import("@elaraai/east").NullType>;
223
+ /**
224
+ * Closes all Redis connections.
225
+ *
226
+ * Closes all active Redis connections and releases all resources.
227
+ * Useful for test cleanup to ensure all connections are closed.
228
+ *
229
+ * @returns Null on success
230
+ *
231
+ * @example
232
+ * ```ts
233
+ * const cleanupAll = East.function([], NullType, $ => {
234
+ * // ... test code that may have left connections open ...
235
+ * $(NoSQL.Redis.closeAll());
236
+ * return $.return(null);
237
+ * });
238
+ *
239
+ * const compiled = East.compileAsync(cleanupAll.toIR(), NoSQL.Redis.Implementation);
240
+ * await compiled();
241
+ * ```
242
+ *
243
+ * @internal
244
+ */
245
+ readonly closeAll: import("@elaraai/east").AsyncPlatformDefinition<[], import("@elaraai/east").NullType>;
246
+ /**
247
+ * Node.js implementation of Redis platform functions.
248
+ *
249
+ * Pass this to East.compileAsync() to enable Redis operations.
250
+ */
251
+ readonly Implementation: import("@elaraai/east/internal").PlatformFunction[];
252
+ /**
253
+ * Type definitions for Redis operations.
254
+ */
255
+ readonly Types: {
256
+ /**
257
+ * Redis connection configuration type.
258
+ */
259
+ readonly Config: import("@elaraai/east").StructType<{
260
+ host: import("@elaraai/east").StringType;
261
+ port: import("@elaraai/east").IntegerType;
262
+ password: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
263
+ db: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
264
+ keyPrefix: import("@elaraai/east").OptionType<import("@elaraai/east").StringType>;
265
+ }>;
266
+ };
267
+ };
268
+ /**
269
+ * MongoDB document database operations.
270
+ *
271
+ * Provides platform functions for MongoDB document storage,
272
+ * supporting find, insert, update, and delete operations.
273
+ */
274
+ readonly MongoDB: {
275
+ /**
276
+ * Connects to a MongoDB server.
277
+ *
278
+ * Creates a connection to a MongoDB database and returns an
279
+ * opaque handle for use in document operations.
280
+ *
281
+ * @example
282
+ * ```ts
283
+ * const findUser = East.function([StringType], OptionType(BsonDocumentType), ($, username) => {
284
+ * const config = $.let({
285
+ * uri: "mongodb://localhost:27017",
286
+ * database: "myapp",
287
+ * collection: "users",
288
+ * });
289
+ *
290
+ * const conn = $.let(NoSQL.MongoDB.connect(config));
291
+ * const query = $.let(new Map([["username", variant('String', username)]]), BsonDocumentType);
292
+ * const result = $.let(NoSQL.MongoDB.findOne(conn, query));
293
+ * $(NoSQL.MongoDB.close(conn));
294
+ * $.return(result);
295
+ * });
296
+ *
297
+ * const compiled = East.compileAsync(findUser.toIR(), NoSQL.MongoDB.Implementation);
298
+ * await compiled("alice"); // variant('some', document) or variant('none', null)
299
+ * ```
300
+ */
301
+ readonly connect: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StructType<{
302
+ uri: import("@elaraai/east").StringType;
303
+ database: import("@elaraai/east").StringType;
304
+ collection: import("@elaraai/east").StringType;
305
+ }>], import("@elaraai/east").StringType>;
306
+ /**
307
+ * Finds a single document in MongoDB.
308
+ *
309
+ * Searches for a document matching the query object.
310
+ * Returns None if no document is found.
311
+ *
312
+ * @example
313
+ * ```ts
314
+ * const findUser = East.function([StringType], OptionType(BsonDocumentType), ($, username) => {
315
+ * const config = $.let({
316
+ * uri: "mongodb://localhost:27017",
317
+ * database: "myapp",
318
+ * collection: "users",
319
+ * });
320
+ * const conn = $.let(NoSQL.MongoDB.connect(config));
321
+ * const query = $.let(new Map([["username", variant('String', username)]]), BsonDocumentType);
322
+ * const result = $.let(NoSQL.MongoDB.findOne(conn, query));
323
+ * $(NoSQL.MongoDB.close(conn));
324
+ * $.return(result);
325
+ * });
326
+ *
327
+ * const compiled = East.compileAsync(findUser.toIR(), NoSQL.MongoDB.Implementation);
328
+ * await compiled("alice"); // variant('some', document) or variant('none', null)
329
+ * ```
330
+ */
331
+ readonly findOne: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType, import("@elaraai/east").DictType<import("@elaraai/east").StringType, import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>>], import("@elaraai/east").OptionType<import("@elaraai/east").DictType<import("@elaraai/east").StringType, import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>>>>;
332
+ /**
333
+ * Finds multiple documents in MongoDB.
334
+ *
335
+ * Searches for documents matching the query object with optional
336
+ * limit and skip for pagination.
337
+ *
338
+ * @example
339
+ * ```ts
340
+ * const findUsers = East.function([], ArrayType(BsonDocumentType), $ => {
341
+ * const config = $.let({
342
+ * uri: "mongodb://localhost:27017",
343
+ * database: "myapp",
344
+ * collection: "users",
345
+ * });
346
+ * const conn = $.let(NoSQL.MongoDB.connect(config));
347
+ * const query = $.let(new Map(), BsonDocumentType);
348
+ * const options = $.let({ limit: variant('some',10n), skip: variant('none', null) });
349
+ * const result = $.let(NoSQL.MongoDB.findMany(conn, query, options));
350
+ * $(NoSQL.MongoDB.close(conn));
351
+ * $.return(result);
352
+ * });
353
+ *
354
+ * const compiled = East.compileAsync(findUsers.toIR(), NoSQL.MongoDB.Implementation);
355
+ * await compiled(); // [doc1, doc2, ...]
356
+ * ```
357
+ */
358
+ readonly findMany: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType, import("@elaraai/east").DictType<import("@elaraai/east").StringType, import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>>, import("@elaraai/east").StructType<{
359
+ limit: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
360
+ skip: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
361
+ }>], import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("@elaraai/east").StringType, import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>>>>;
362
+ /**
363
+ * Inserts a document into MongoDB.
364
+ *
365
+ * Inserts a new document into the collection.
366
+ * Returns the inserted document's _id as a string.
367
+ *
368
+ * @example
369
+ * ```ts
370
+ * const createUser = East.function([StringType, StringType], StringType, ($, username, email) => {
371
+ * const config = $.let({
372
+ * uri: "mongodb://localhost:27017",
373
+ * database: "myapp",
374
+ * collection: "users",
375
+ * });
376
+ * const conn = $.let(NoSQL.MongoDB.connect(config));
377
+ * const doc = $.let(new Map([
378
+ * ["username", variant('String', username)],
379
+ * ["email", variant('String', email)],
380
+ * ]), BsonDocumentType);
381
+ * const id = $.let(NoSQL.MongoDB.insertOne(conn, doc));
382
+ * $(NoSQL.MongoDB.close(conn));
383
+ * $.return(id);
384
+ * });
385
+ *
386
+ * const compiled = East.compileAsync(createUser.toIR(), NoSQL.MongoDB.Implementation);
387
+ * await compiled("alice", "alice@example.com"); // "507f1f77bcf86cd799439011"
388
+ * ```
389
+ */
390
+ readonly insertOne: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType, import("@elaraai/east").DictType<import("@elaraai/east").StringType, import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>>], import("@elaraai/east").StringType>;
391
+ /**
392
+ * Updates a document in MongoDB.
393
+ *
394
+ * Updates a single document matching the query with the update operations.
395
+ * Returns the number of documents modified (0 or 1).
396
+ *
397
+ * @example
398
+ * ```ts
399
+ * const updateUser = East.function([StringType, StringType], IntegerType, ($, username, newEmail) => {
400
+ * const config = $.let({
401
+ * uri: "mongodb://localhost:27017",
402
+ * database: "myapp",
403
+ * collection: "users",
404
+ * });
405
+ * const conn = $.let(NoSQL.MongoDB.connect(config));
406
+ * const query = $.let(new Map([["username", variant('String', username)]]), BsonDocumentType);
407
+ * const update = $.let(new Map([["email", variant('String', newEmail)]]), BsonDocumentType);
408
+ * const modified = $.let(NoSQL.MongoDB.updateOne(conn, query, update));
409
+ * $(NoSQL.MongoDB.close(conn));
410
+ * $.return(modified);
411
+ * });
412
+ *
413
+ * const compiled = East.compileAsync(updateUser.toIR(), NoSQL.MongoDB.Implementation);
414
+ * await compiled("alice", "newemail@example.com"); // 1n (updated) or 0n (not found)
415
+ * ```
416
+ */
417
+ readonly updateOne: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType, import("@elaraai/east").DictType<import("@elaraai/east").StringType, import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>>, import("@elaraai/east").DictType<import("@elaraai/east").StringType, import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>>], import("@elaraai/east").IntegerType>;
418
+ /**
419
+ * Deletes a document from MongoDB.
420
+ *
421
+ * Deletes a single document matching the query object.
422
+ * Returns the number of documents deleted (0 or 1).
423
+ *
424
+ * @example
425
+ * ```ts
426
+ * const deleteUser = East.function([StringType], IntegerType, ($, username) => {
427
+ * const config = $.let({
428
+ * uri: "mongodb://localhost:27017",
429
+ * database: "myapp",
430
+ * collection: "users",
431
+ * });
432
+ * const conn = $.let(NoSQL.MongoDB.connect(config));
433
+ * const query = $.let(new Map([["username", variant('String', username)]]), BsonDocumentType);
434
+ * const deleted = $.let(NoSQL.MongoDB.deleteOne(conn, query));
435
+ * $(NoSQL.MongoDB.close(conn));
436
+ * $.return(deleted);
437
+ * });
438
+ *
439
+ * const compiled = East.compileAsync(deleteUser.toIR(), NoSQL.MongoDB.Implementation);
440
+ * await compiled("alice"); // 1n (deleted) or 0n (not found)
441
+ * ```
442
+ */
443
+ readonly deleteOne: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType, import("@elaraai/east").DictType<import("@elaraai/east").StringType, import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>>], import("@elaraai/east").IntegerType>;
444
+ /**
445
+ * Closes the MongoDB connection.
446
+ *
447
+ * Closes the connection and releases all resources.
448
+ *
449
+ * @example
450
+ * ```ts
451
+ * const cleanup = East.function([], NullType, $ => {
452
+ * const config = $.let({
453
+ * uri: "mongodb://localhost:27017",
454
+ * database: "myapp",
455
+ * collection: "users",
456
+ * });
457
+ * const conn = $.let(NoSQL.MongoDB.connect(config));
458
+ * // ... do work ...
459
+ * $(NoSQL.MongoDB.close(conn));
460
+ * });
461
+ *
462
+ * const compiled = East.compileAsync(cleanup.toIR(), NoSQL.MongoDB.Implementation);
463
+ * await compiled();
464
+ * ```
465
+ */
466
+ readonly close: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StringType], import("@elaraai/east").NullType>;
467
+ /**
468
+ * Node.js implementation of MongoDB platform functions.
469
+ *
470
+ * Pass this to East.compileAsync() to enable MongoDB operations.
471
+ */
472
+ readonly Implementation: import("@elaraai/east/internal").PlatformFunction[];
473
+ /**
474
+ * Type definitions for MongoDB operations.
475
+ */
476
+ readonly Types: {
477
+ /**
478
+ * MongoDB connection configuration type.
479
+ */
480
+ readonly Config: import("@elaraai/east").StructType<{
481
+ uri: import("@elaraai/east").StringType;
482
+ database: import("@elaraai/east").StringType;
483
+ collection: import("@elaraai/east").StringType;
484
+ }>;
485
+ /**
486
+ * BSON value type (recursive type for MongoDB values).
487
+ */
488
+ readonly BsonValue: import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>;
489
+ /**
490
+ * BSON document type (dictionary of string keys to BSON values).
491
+ */
492
+ readonly BsonDocument: import("@elaraai/east").DictType<import("@elaraai/east").StringType, import("@elaraai/east").RecursiveType<import("@elaraai/east").EastType>>;
493
+ /**
494
+ * MongoDB find operation options type.
495
+ */
496
+ readonly FindOptions: import("@elaraai/east").StructType<{
497
+ limit: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
498
+ skip: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
499
+ }>;
500
+ };
501
+ };
502
+ };
503
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nosql/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAGH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AA0BnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,KAAK;IACd;;;;;OAKG;;QAEC;;;;;;;;;;;;;;;;;;;;;;;;;;WA0BG;;;;;;;;QAGH;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;;QAGH;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;;QAGH;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;;QAGH;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;;QAGH;;;;;;;;;;;;;;;;;;;;;;;WAuBG;;QAGH;;;;;;;;;;;;;;;;;;;;;WAqBG;;QAGH;;;;WAIG;;QAGH;;WAEG;;YAEC;;eAEG;;;;;;;;;;IAKX;;;;;OAKG;;QAEC;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;;;;;;QAGH;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;;QAGH;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;;;;;QAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2BG;;QAGH;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;;QAGH;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;;QAGH;;;;;;;;;;;;;;;;;;;;;WAqBG;;QAGH;;;;WAIG;;QAGH;;WAEG;;YAEC;;eAEG;;;;;;YAGH;;eAEG;;YAGH;;eAEG;;YAGH;;eAEG;;;;;;;CAIL,CAAC"}