@event-driven-io/pongo 0.17.0-beta.4 → 0.17.0-beta.40

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 (67) hide show
  1. package/dist/cli.cjs +311 -487
  2. package/dist/cli.cjs.map +1 -1
  3. package/dist/cli.d.cts +4 -4
  4. package/dist/cli.d.ts +4 -3
  5. package/dist/cli.js +279 -487
  6. package/dist/cli.js.map +1 -1
  7. package/dist/cloudflare.cjs +41 -0
  8. package/dist/cloudflare.cjs.map +1 -0
  9. package/dist/cloudflare.d.cts +12 -0
  10. package/dist/cloudflare.d.ts +12 -0
  11. package/dist/cloudflare.js +35 -0
  12. package/dist/cloudflare.js.map +1 -0
  13. package/dist/core-BHdOCUrr.js +1429 -0
  14. package/dist/core-BHdOCUrr.js.map +1 -0
  15. package/dist/core-C9SB3XMx.cjs +1717 -0
  16. package/dist/core-C9SB3XMx.cjs.map +1 -0
  17. package/dist/core-CH0SOCr3.js +361 -0
  18. package/dist/core-CH0SOCr3.js.map +1 -0
  19. package/dist/core-CkmE5dkK.cjs +373 -0
  20. package/dist/core-CkmE5dkK.cjs.map +1 -0
  21. package/dist/index-C3pnS1S_.d.cts +720 -0
  22. package/dist/index-CZOmOsQt.d.ts +10 -0
  23. package/dist/index-FXnldVnn.d.cts +10 -0
  24. package/dist/index-r7V4paf_.d.ts +720 -0
  25. package/dist/index.cjs +67 -74
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +16 -105
  28. package/dist/index.d.ts +16 -105
  29. package/dist/index.js +17 -73
  30. package/dist/index.js.map +1 -1
  31. package/dist/pg.cjs +319 -288
  32. package/dist/pg.cjs.map +1 -1
  33. package/dist/pg.d.cts +29 -25
  34. package/dist/pg.d.ts +29 -25
  35. package/dist/pg.js +309 -284
  36. package/dist/pg.js.map +1 -1
  37. package/dist/shim.cjs +291 -368
  38. package/dist/shim.cjs.map +1 -1
  39. package/dist/shim.d.cts +141 -137
  40. package/dist/shim.d.ts +141 -137
  41. package/dist/shim.js +285 -367
  42. package/dist/shim.js.map +1 -1
  43. package/dist/sqlite3.cjs +43 -62
  44. package/dist/sqlite3.cjs.map +1 -1
  45. package/dist/sqlite3.d.cts +12 -11
  46. package/dist/sqlite3.d.ts +12 -11
  47. package/dist/sqlite3.js +36 -61
  48. package/dist/sqlite3.js.map +1 -1
  49. package/package.json +42 -44
  50. package/dist/chunk-4BL6YWLW.cjs +0 -872
  51. package/dist/chunk-4BL6YWLW.cjs.map +0 -1
  52. package/dist/chunk-ECQ2CKZE.cjs +0 -330
  53. package/dist/chunk-ECQ2CKZE.cjs.map +0 -1
  54. package/dist/chunk-NCNRRYVE.js +0 -872
  55. package/dist/chunk-NCNRRYVE.js.map +0 -1
  56. package/dist/chunk-Y7LRKJLJ.js +0 -330
  57. package/dist/chunk-Y7LRKJLJ.js.map +0 -1
  58. package/dist/d1.cjs +0 -53
  59. package/dist/d1.cjs.map +0 -1
  60. package/dist/d1.d.cts +0 -11
  61. package/dist/d1.d.ts +0 -11
  62. package/dist/d1.js +0 -53
  63. package/dist/d1.js.map +0 -1
  64. package/dist/index-BJopB-em.d.cts +0 -7
  65. package/dist/index-G5DECNb_.d.ts +0 -7
  66. package/dist/pongoCollectionSchemaComponent-t_e9n2Wc.d.cts +0 -426
  67. package/dist/pongoCollectionSchemaComponent-t_e9n2Wc.d.ts +0 -426
package/dist/index.cjs CHANGED
@@ -1,75 +1,68 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
- var _chunk4BL6YWLWcjs = require('./chunk-4BL6YWLW.cjs');
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
- exports.ConcurrencyError = _chunk4BL6YWLWcjs.ConcurrencyError; exports.DOCUMENT_DOES_NOT_EXIST = _chunk4BL6YWLWcjs.DOCUMENT_DOES_NOT_EXIST; exports.DOCUMENT_EXISTS = _chunk4BL6YWLWcjs.DOCUMENT_EXISTS; exports.NO_CONCURRENCY_CHECK = _chunk4BL6YWLWcjs.NO_CONCURRENCY_CHECK; exports.ObjectId = _chunk4BL6YWLWcjs.ObjectId; exports.OperatorMap = _chunk4BL6YWLWcjs.OperatorMap; exports.PongoCollectionSchemaComponent = _chunk4BL6YWLWcjs.PongoCollectionSchemaComponent; exports.PongoDatabase = _chunk4BL6YWLWcjs.PongoDatabase; exports.PongoDatabaseCache = _chunk4BL6YWLWcjs.PongoDatabaseCache; exports.PongoDatabaseDriverRegistry = _chunk4BL6YWLWcjs.PongoDatabaseDriverRegistry; exports.PongoDatabaseSchemaComponent = _chunk4BL6YWLWcjs.PongoDatabaseSchemaComponent; exports.PongoError = _chunk4BL6YWLWcjs.PongoError; exports.QueryOperators = _chunk4BL6YWLWcjs.QueryOperators; exports.deepEquals = _chunk4BL6YWLWcjs.deepEquals; exports.expectedVersion = _chunk4BL6YWLWcjs.expectedVersion; exports.expectedVersionValue = _chunk4BL6YWLWcjs.expectedVersionValue; exports.hasOperators = _chunk4BL6YWLWcjs.hasOperators; exports.isEquatable = _chunk4BL6YWLWcjs.isEquatable; exports.isGeneralExpectedDocumentVersion = _chunk4BL6YWLWcjs.isGeneralExpectedDocumentVersion; exports.isNumber = _chunk4BL6YWLWcjs.isNumber; exports.isOperator = _chunk4BL6YWLWcjs.isOperator; exports.isString = _chunk4BL6YWLWcjs.isString; exports.objectEntries = _chunk4BL6YWLWcjs.objectEntries; exports.operationResult = _chunk4BL6YWLWcjs.operationResult; exports.pongoClient = _chunk4BL6YWLWcjs.pongoClient; exports.pongoCollection = _chunk4BL6YWLWcjs.pongoCollection; exports.pongoDatabaseDriverRegistry = _chunk4BL6YWLWcjs.pongoDatabaseDriverRegistry; exports.pongoSchema = _chunk4BL6YWLWcjs.pongoSchema; exports.pongoSession = _chunk4BL6YWLWcjs.pongoSession; exports.pongoTransaction = _chunk4BL6YWLWcjs.pongoTransaction; exports.proxyClientWithSchema = _chunk4BL6YWLWcjs.proxyClientWithSchema; exports.proxyPongoDbWithSchema = _chunk4BL6YWLWcjs.proxyPongoDbWithSchema; exports.toClientSchemaMetadata = _chunk4BL6YWLWcjs.toClientSchemaMetadata; exports.toDbSchemaMetadata = _chunk4BL6YWLWcjs.toDbSchemaMetadata; exports.transactionExecutorOrDefault = _chunk4BL6YWLWcjs.transactionExecutorOrDefault;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_core = require('./core-C9SB3XMx.cjs');
3
+
4
+ //#region src/index.ts
5
+ pongoDriverRegistry.register(`PostgreSQL:pg`, () => loadPongoClient("pg"));
6
+ pongoDriverRegistry.register(`SQLite:sqlite3`, () => loadPongoClient("sqlite3"));
7
+ pongoDriverRegistry.register(`SQLite:d1`, () => loadPongoClient("d1"));
8
+ const loadPongoClient = async (path) => {
9
+ let module;
10
+ if (path === "pg") module = await Promise.resolve().then(() => require("./pg.cjs"));
11
+ else if (path === "sqlite3") module = await Promise.resolve().then(() => require("./sqlite3.cjs"));
12
+ else if (path === "d1") module = await Promise.resolve().then(() => require("./cloudflare.cjs"));
13
+ else throw new Error(`Unknown path: ${path}`);
14
+ if (!module.pongoDriver) throw new Error(`Failed to load Pongo client for ${path}`);
15
+ return module.pongoDriver;
16
+ };
17
+
18
+ //#endregion
19
+ exports.ConcurrencyError = require_core.ConcurrencyError;
20
+ exports.DOCUMENT_DOES_NOT_EXIST = require_core.DOCUMENT_DOES_NOT_EXIST;
21
+ exports.DOCUMENT_EXISTS = require_core.DOCUMENT_EXISTS;
22
+ exports.DocumentCommandHandler = require_core.DocumentCommandHandler;
23
+ exports.NO_CONCURRENCY_CHECK = require_core.NO_CONCURRENCY_CHECK;
24
+ exports.ObjectId = require_core.ObjectId;
25
+ exports.OperatorMap = require_core.OperatorMap;
26
+ exports.PongoCollectionSchemaComponent = require_core.PongoCollectionSchemaComponent;
27
+ exports.PongoDatabase = require_core.PongoDatabase;
28
+ exports.PongoDatabaseCache = require_core.PongoDatabaseCache;
29
+ exports.PongoDatabaseSchemaComponent = require_core.PongoDatabaseSchemaComponent;
30
+ exports.PongoDriverRegistry = require_core.PongoDriverRegistry;
31
+ exports.PongoError = require_core.PongoError;
32
+ exports.QueryOperators = require_core.QueryOperators;
33
+ exports.deepEquals = require_core.deepEquals;
34
+ exports.expectedVersion = require_core.expectedVersion;
35
+ exports.expectedVersionPredicate = require_core.expectedVersionPredicate;
36
+ exports.expectedVersionValue = require_core.expectedVersionValue;
37
+ exports.getIdsFromIdOnlyFilter = require_core.getIdsFromIdOnlyFilter;
38
+ exports.hasOperators = require_core.hasOperators;
39
+ exports.idFromFilter = require_core.idFromFilter;
40
+ exports.identityMapCache = require_core.identityMapCache;
41
+ exports.isEquatable = require_core.isEquatable;
42
+ exports.isGeneralExpectedDocumentVersion = require_core.isGeneralExpectedDocumentVersion;
43
+ exports.isNumber = require_core.isNumber;
44
+ exports.isOperator = require_core.isOperator;
45
+ exports.isString = require_core.isString;
46
+ exports.loadPongoClient = loadPongoClient;
47
+ exports.lruCache = require_core.lruCache;
48
+ exports.mapAsync = require_core.mapAsync;
49
+ exports.mapParallel = require_core.mapParallel;
50
+ exports.mapSequential = require_core.mapSequential;
51
+ exports.noopCacheProvider = require_core.noopCacheProvider;
52
+ exports.objectEntries = require_core.objectEntries;
53
+ exports.operationResult = require_core.operationResult;
54
+ exports.pongoCache = require_core.pongoCache;
55
+ exports.pongoCacheWrapper = require_core.pongoCacheWrapper;
56
+ exports.pongoClient = require_core.pongoClient;
57
+ exports.pongoCollection = require_core.pongoCollection;
58
+ exports.pongoDriverRegistry = require_core.pongoDriverRegistry;
59
+ exports.pongoSchema = require_core.pongoSchema;
60
+ exports.pongoSession = require_core.pongoSession;
61
+ exports.pongoTransaction = require_core.pongoTransaction;
62
+ exports.pongoTransactionCache = require_core.pongoTransactionCache;
63
+ exports.proxyClientWithSchema = require_core.proxyClientWithSchema;
64
+ exports.proxyPongoDbWithSchema = require_core.proxyPongoDbWithSchema;
65
+ exports.toClientSchemaMetadata = require_core.toClientSchemaMetadata;
66
+ exports.toDbSchemaMetadata = require_core.toDbSchemaMetadata;
67
+ exports.transactionExecutorOrDefault = require_core.transactionExecutorOrDefault;
75
68
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/pongo/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wtEAAC","file":"/home/runner/work/Pongo/Pongo/src/packages/pongo/dist/index.cjs"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { AnyPongoDriver } from './core';\n\nexport * from './core';\n\npongoDriverRegistry.register(`PostgreSQL:pg`, () => loadPongoClient('pg'));\npongoDriverRegistry.register(`SQLite:sqlite3`, () =>\n loadPongoClient('sqlite3'),\n);\npongoDriverRegistry.register(`SQLite:d1`, () => loadPongoClient('d1'));\n\nexport const loadPongoClient = async (\n path: 'pg' | 'sqlite3' | 'd1',\n): Promise<AnyPongoDriver> => {\n let module;\n\n if (path === 'pg') {\n module = await import('./pg');\n } else if (path === 'sqlite3') {\n module = await import('./sqlite3');\n } else if (path === 'd1') {\n module = await import('./cloudflare');\n } else {\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unknown path: ${path}`);\n }\n\n if (!module.pongoDriver) {\n throw new Error(`Failed to load Pongo client for ${path}`);\n }\n\n return module.pongoDriver;\n};\n"],"mappings":";;;;AAIA,oBAAoB,SAAS,uBAAuB,gBAAgB,KAAK,CAAC;AAC1E,oBAAoB,SAAS,wBAC3B,gBAAgB,UAAU,CAC3B;AACD,oBAAoB,SAAS,mBAAmB,gBAAgB,KAAK,CAAC;AAEtE,MAAa,kBAAkB,OAC7B,SAC4B;CAC5B,IAAI;AAEJ,KAAI,SAAS,KACX,UAAS,2CAAM;UACN,SAAS,UAClB,UAAS,2CAAM;UACN,SAAS,KAClB,UAAS,2CAAM;KAGf,OAAM,IAAI,MAAM,iBAAiB,OAAO;AAG1C,KAAI,CAAC,OAAO,YACV,OAAM,IAAI,MAAM,mCAAmC,OAAO;AAG5D,QAAO,OAAO"}
package/dist/index.d.cts CHANGED
@@ -1,110 +1,21 @@
1
- import { DatabaseDriverType, Dumbo, MigrationStyle, SQLExecutor } from '@event-driven-io/dumbo';
2
- import { a as PongoDb, c as PongoCollectionSchemaComponent, C as CollectionOperationOptions, d as PongoDocument, e as PongoCollection, f as PongoClientSchema, P as PongoDatabaseDriver, g as PongoCollectionSchema, h as PongoDatabaseFactoryOptions, i as PongoDatabaseSchemaComponent, j as PongoDbSchema, A as AnyPongoDb, k as AnyPongoDatabaseDriver, l as PongoClientOptions, m as PongoClient, E as ExtractPongoDatabaseTypeFromDriver, n as PongoClientWithSchema, o as PongoTransactionOptions, p as PongoSession, q as PongoDbTransaction } from './pongoCollectionSchemaComponent-t_e9n2Wc.cjs';
3
- export { as as $inc, at as $push, aq as $set, ar as $unset, al as AlternativeType, z as AnyPongoDatabaseDriverOptions, I as CollectionsMap, am as Condition, K as DBsMap, ay as DOCUMENT_DOES_NOT_EXIST, ax as DOCUMENT_EXISTS, B as DatabaseDriverOptionsWithConnectionString, D as DatabaseDriverOptionsWithDatabaseName, a0 as DeleteManyOptions, $ as DeleteOneOptions, ag as Document, aN as DocumentHandler, a5 as EnhancedOmit, aw as ExpectedDocumentVersion, au as ExpectedDocumentVersionGeneral, av as ExpectedDocumentVersionValue, F as ExtractPongoDatabaseDriverOptions, a1 as FindOptions, Z as HandleOptions, a3 as HasId, a4 as InferIdType, W as InsertManyOptions, V as InsertOneOptions, az as NO_CONCURRENCY_CHECK, ak as NonObjectIdLikeDocument, a2 as ObjectId, aj as ObjectIdLike, aE as OperationResult, ah as OptionalId, a6 as OptionalUnlessRequiredId, a8 as OptionalUnlessRequiredIdAndVersion, a7 as OptionalUnlessRequiredVersion, ai as OptionalVersion, R as PongoClientSchemaMetadata, r as PongoCollectionSQLBuilder, u as PongoCollectionSchemaComponentOptions, O as PongoCollectionSchemaMetadata, t as PongoCollectionURN, s as PongoCollectionURNType, b as PongoDatabaseDriverOptions, G as PongoDatabaseDriverRegistry, y as PongoDatabaseSQLBuilder, x as PongoDatabaseSchemaComponentOptions, w as PongoDatabaseURN, v as PongoDatabaseURNType, Q as PongoDbSchemaMetadata, J as PongoDbWithSchema, aL as PongoDeleteManyResult, aK as PongoDeleteResult, an as PongoFilter, ap as PongoFilterOperator, aM as PongoHandleResult, aH as PongoInsertManyResult, aG as PongoInsertOneResult, U as PongoSchemaConfig, aD as PongoUpdate, aJ as PongoUpdateManyResult, aI as PongoUpdateResult, af as RegExpOrString, _ as ReplaceOneOptions, ao as RootFilterOperators, Y as UpdateManyOptions, X as UpdateOneOptions, a9 as WithId, ad as WithIdAndVersion, ab as WithVersion, aa as WithoutId, ae as WithoutIdAndVersion, ac as WithoutVersion, aC as expectedVersion, aB as expectedVersionValue, aA as isGeneralExpectedDocumentVersion, aF as operationResult, H as pongoDatabaseDriverRegistry, L as pongoSchema, N as proxyClientWithSchema, M as proxyPongoDbWithSchema, T as toClientSchemaMetadata, S as toDbSchemaMetadata } from './pongoCollectionSchemaComponent-t_e9n2Wc.cjs';
4
-
5
- type PongoCollectionOptions<DriverType extends DatabaseDriverType = DatabaseDriverType> = {
6
- db: PongoDb<DriverType>;
7
- collectionName: string;
8
- pool: Dumbo<DatabaseDriverType>;
9
- schemaComponent: PongoCollectionSchemaComponent;
10
- schema?: {
11
- autoMigration?: MigrationStyle;
12
- };
13
- errors?: {
14
- throwOnOperationFailures?: boolean;
15
- };
16
- };
17
- declare const transactionExecutorOrDefault: <DriverType extends DatabaseDriverType = DatabaseDriverType>(db: PongoDb<DriverType>, options: CollectionOperationOptions | undefined, defaultSqlExecutor: SQLExecutor) => Promise<SQLExecutor>;
18
- declare const pongoCollection: <T extends PongoDocument, DriverType extends DatabaseDriverType = DatabaseDriverType>({ db, collectionName, pool, schemaComponent, schema, errors, }: PongoCollectionOptions<DriverType>) => PongoCollection<T>;
19
-
20
- type Entry<T> = {
21
- [K in keyof Required<T>]: [K, Required<T>[K]];
22
- }[keyof Required<T>];
23
- type IterableEntry<T> = Entry<T> & {
24
- [Symbol.iterator](): Iterator<Entry<T>>;
25
- };
26
- declare const objectEntries: <T extends object>(obj: T) => IterableEntry<T>[];
27
- type NonPartial<T> = {
28
- [K in keyof Required<T>]: T[K];
29
- };
30
-
31
- declare const QueryOperators: {
32
- $eq: string;
33
- $gt: string;
34
- $gte: string;
35
- $lt: string;
36
- $lte: string;
37
- $ne: string;
38
- $in: string;
39
- $nin: string;
40
- $elemMatch: string;
41
- $all: string;
42
- $size: string;
43
- };
44
- declare const OperatorMap: {
45
- $gt: string;
46
- $gte: string;
47
- $lt: string;
48
- $lte: string;
49
- $ne: string;
50
- };
51
- declare const isOperator: (key: string) => boolean;
52
- declare const hasOperators: (value: Record<string, unknown>) => boolean;
53
-
54
- declare const PongoDatabaseCache: <Database extends PongoDb<DatabaseDriverType> = PongoDb<DatabaseDriverType>, TypedClientSchema extends PongoClientSchema = PongoClientSchema>({ driver, typedSchema, }: {
55
- driver: PongoDatabaseDriver<Database>;
56
- typedSchema?: TypedClientSchema | undefined;
57
- }) => {
58
- getOrCreate: <CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema<PongoDocument>>>(createOptions: Omit<PongoDatabaseFactoryOptions<CollectionsSchema>, "schema"> & {
59
- schema?: {
60
- autoMigration?: MigrationStyle;
61
- };
62
- }) => Database;
63
- all: () => Database[];
64
- forAll: (func: (db: Database) => Promise<void>) => Promise<void[]>;
65
- };
66
-
67
- type PongoDatabaseOptions<DumboType extends Dumbo<DatabaseDriverType, any> = Dumbo<DatabaseDriverType, any>, CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema>> = {
68
- databaseName: string;
69
- pool: DumboType;
70
- schemaComponent: PongoDatabaseSchemaComponent<DumboType['driverType']>;
71
- schema?: {
72
- autoMigration?: MigrationStyle;
73
- definition?: PongoDbSchema<CollectionsSchema>;
74
- } | undefined;
75
- errors?: {
76
- throwOnOperationFailures?: boolean;
77
- } | undefined;
78
- };
79
- declare const PongoDatabase: <Database extends AnyPongoDb = AnyPongoDb, DumboType extends Dumbo<Database["driverType"], any> = Dumbo<Database["driverType"], any>>(options: PongoDatabaseOptions<DumboType>) => Database;
80
-
81
- declare const isNumber: (val: unknown) => val is number;
82
- declare const isString: (val: unknown) => val is string;
83
- declare class PongoError extends Error {
84
- errorCode: number;
85
- constructor(options?: {
86
- errorCode: number;
87
- message?: string;
88
- } | string | number);
89
- }
90
- declare class ConcurrencyError extends PongoError {
91
- constructor(message?: string);
92
- }
93
-
94
- declare const pongoClient: <DatabaseDriver extends AnyPongoDatabaseDriver, TypedClientSchema extends PongoClientSchema = PongoClientSchema>(options: PongoClientOptions<DatabaseDriver, TypedClientSchema>) => PongoClient<DatabaseDriver["driverType"], ExtractPongoDatabaseTypeFromDriver<DatabaseDriver>> & PongoClientWithSchema<TypedClientSchema>;
95
-
96
- type PongoSessionOptions = {
97
- explicit?: boolean;
98
- defaultTransactionOptions: PongoTransactionOptions;
99
- };
100
- declare const pongoSession: (options?: PongoSessionOptions) => PongoSession;
101
-
102
- declare const pongoTransaction: (options: PongoTransactionOptions) => PongoDbTransaction;
1
+ import { $ as HasId, $t as AnyPongoDriverOptions, A as MaybePromise, An as hasOperators, At as PongoSession, B as DOCUMENT_DOES_NOT_EXIST, Bn as DocumentCommandHandler, Bt as UpdateOneOptions, C as PongoCacheType, Cn as pongoSchema, Ct as PongoFilter, D as LRUCacheOptions, Dn as toDbSchemaMetadata, Dt as PongoInsertOneResult, E as noopCacheProvider, En as toClientSchemaMetadata, Et as PongoInsertManyResult, F as AlternativeType, Fn as PongoCollectionURNType, Ft as RegExpOrString, G as DocumentHandler, Gn as NonPartial, Gt as WithoutIdAndVersion, H as DeleteManyOptions, Hn as DocumentCommandHandlerOptions, Ht as WithIdAndVersion, I as AnyPongoDb, In as PongoCollectionSQLBuilder, It as ReplaceManyOptions, J as ExpectedDocumentVersionGeneral, Jt as expectedVersionPredicate, K as EnhancedOmit, Kn as objectEntries, Kt as WithoutVersion, L as BatchHandleOptions, Ln as PongoCollectionOptions, Lt as ReplaceOneOptions, M as $push, Mn as PongoCollectionSchemaComponent, Mt as PongoUpdate, N as $set, Nn as PongoCollectionSchemaComponentOptions, Nt as PongoUpdateManyResult, O as lruCache, On as OperatorMap, Ot as PongoMigrationOptions, P as $unset, Pn as PongoCollectionURN, Pt as PongoUpdateResult, Q as HandleOptions, Qt as AnyPongoDriver, R as CollectionOperationOptions, Rn as pongoCollection, Rt as RootFilterOperators, S as PongoCacheSetEntry, Sn as PongoSchemaConfig, St as PongoDocument, T as pongoCache, Tn as proxyPongoDbWithSchema, Tt as PongoHandleResult, U as DeleteOneOptions, Un as getIdsFromIdOnlyFilter, Ut as WithVersion, V as DOCUMENT_EXISTS, Vn as DocumentCommandHandlerInput, Vt as WithId, W as Document, Wn as idFromFilter, Wt as WithoutId, X as ExpectedVersionPredicate, Xt as isGeneralExpectedDocumentVersion, Y as ExpectedDocumentVersionValue, Yt as expectedVersionValue, Z as FindOptions, Zt as operationResult, _ as CacheHooks, _n as PongoCollectionSchema, _t as PongoDb, a as ConcurrencyError, an as PongoDriverRegistry, at as ObjectId, b as CacheType, bn as PongoDbSchemaMetadata, bt as PongoDeleteManyResult, c as isString, cn as PongoDatabaseSchemaComponent, ct as OptionalId, d as PongoDatabaseCache, dn as PongoDatabaseURNType, dt as OptionalUnlessRequiredVersion, en as ExtractPongoDatabaseTypeFromDriver, et as InferIdType, f as PongoTransactionCache, fn as CollectionsMap, ft as OptionalVersion, g as CacheConfig, gn as PongoClientWithSchema, gt as PongoDBCollectionOptions, h as pongoCacheWrapper, hn as PongoClientSchemaMetadata, ht as PongoCollection, i as pongoClient, in as PongoDriverOptions, it as NonObjectIdLikeDocument, j as $inc, jn as isOperator, jt as PongoTransactionOptions, k as identityMapCache, kn as QueryOperators, kt as PongoReplaceManyResult, l as PongoDatabase, ln as PongoDatabaseSchemaComponentOptions, lt as OptionalUnlessRequiredId, m as pongoTransactionCache, mn as PongoClientSchema, mt as PongoClientOptions, n as PongoSessionOptions, nn as PongoDatabaseFactoryOptions, nt as InsertOneOptions, o as PongoError, on as pongoDriverRegistry, ot as ObjectIdLike, p as PongoTransactionCacheOperationOptions, pn as DBsMap, pt as PongoClient, q as ExpectedDocumentVersion, qt as expectedVersion, r as pongoSession, rn as PongoDriver, rt as NO_CONCURRENCY_CHECK, s as isNumber, sn as PongoDatabaseSQLBuilder, st as OperationResult, t as pongoTransaction, tn as ExtractPongoDriverOptions, tt as InsertManyOptions, u as PongoDatabaseOptions, un as PongoDatabaseURN, ut as OptionalUnlessRequiredIdAndVersion, v as CacheOptions, vn as PongoCollectionSchemaMetadata, vt as PongoDbOptions, w as PongoDocumentCacheKey, wn as proxyClientWithSchema, wt as PongoFilterOperator, x as PongoCache, xn as PongoDbWithSchema, xt as PongoDeleteResult, y as CacheSettings, yn as PongoDbSchema, yt as PongoDbTransaction, z as Condition, zn as transactionExecutorOrDefault, zt as UpdateManyOptions } from "./index-C3pnS1S_.cjs";
103
2
 
3
+ //#region src/core/utils/deepEquals.d.ts
104
4
  declare const deepEquals: <T>(left: T, right: T) => boolean;
105
5
  type Equatable<T> = {
106
- equals: (right: T) => boolean;
6
+ equals: (right: T) => boolean;
107
7
  } & T;
108
8
  declare const isEquatable: <T>(left: T) => left is Equatable<T>;
109
-
110
- export { AnyPongoDatabaseDriver, AnyPongoDb, CollectionOperationOptions, ConcurrencyError, type Equatable, ExtractPongoDatabaseTypeFromDriver, type NonPartial, OperatorMap, PongoClient, PongoClientOptions, PongoClientSchema, PongoClientWithSchema, PongoCollection, type PongoCollectionOptions, PongoCollectionSchema, PongoCollectionSchemaComponent, PongoDatabase, PongoDatabaseCache, PongoDatabaseDriver, PongoDatabaseFactoryOptions, type PongoDatabaseOptions, PongoDatabaseSchemaComponent, PongoDb, PongoDbSchema, PongoDbTransaction, PongoDocument, PongoError, PongoSession, type PongoSessionOptions, PongoTransactionOptions, QueryOperators, deepEquals, hasOperators, isEquatable, isNumber, isOperator, isString, objectEntries, pongoClient, pongoCollection, pongoSession, pongoTransaction, transactionExecutorOrDefault };
9
+ //#endregion
10
+ //#region src/core/utils/mapAsync.d.ts
11
+ declare function mapSequential<T, R>(items: T[], fn: (item: T, index: number) => Promise<R>): Promise<R[]>;
12
+ declare const mapParallel: <T, R>(items: T[], fn: (item: T, index: number) => Promise<R>) => Promise<R[]>;
13
+ declare const mapAsync: <T, R>(items: T[], fn: (item: T, index: number) => Promise<R>, options?: {
14
+ parallel: boolean | undefined;
15
+ }) => Promise<R[]>;
16
+ //#endregion
17
+ //#region src/index.d.ts
18
+ declare const loadPongoClient: (path: "pg" | "sqlite3" | "d1") => Promise<AnyPongoDriver>;
19
+ //#endregion
20
+ export { $inc, $push, $set, $unset, AlternativeType, AnyPongoDb, AnyPongoDriver, AnyPongoDriverOptions, BatchHandleOptions, CacheConfig, CacheHooks, CacheOptions, CacheSettings, CacheType, CollectionOperationOptions, CollectionsMap, ConcurrencyError, Condition, DBsMap, DOCUMENT_DOES_NOT_EXIST, DOCUMENT_EXISTS, DeleteManyOptions, DeleteOneOptions, Document, DocumentCommandHandler, DocumentCommandHandlerInput, DocumentCommandHandlerOptions, DocumentHandler, EnhancedOmit, Equatable, ExpectedDocumentVersion, ExpectedDocumentVersionGeneral, ExpectedDocumentVersionValue, ExpectedVersionPredicate, ExtractPongoDatabaseTypeFromDriver, ExtractPongoDriverOptions, FindOptions, HandleOptions, HasId, InferIdType, InsertManyOptions, InsertOneOptions, LRUCacheOptions, MaybePromise, NO_CONCURRENCY_CHECK, NonObjectIdLikeDocument, NonPartial, ObjectId, ObjectIdLike, OperationResult, OperatorMap, OptionalId, OptionalUnlessRequiredId, OptionalUnlessRequiredIdAndVersion, OptionalUnlessRequiredVersion, OptionalVersion, PongoCache, PongoCacheSetEntry, PongoCacheType, PongoClient, PongoClientOptions, PongoClientSchema, PongoClientSchemaMetadata, PongoClientWithSchema, PongoCollection, PongoCollectionOptions, PongoCollectionSQLBuilder, PongoCollectionSchema, PongoCollectionSchemaComponent, PongoCollectionSchemaComponentOptions, PongoCollectionSchemaMetadata, PongoCollectionURN, PongoCollectionURNType, PongoDBCollectionOptions, PongoDatabase, PongoDatabaseCache, PongoDatabaseFactoryOptions, PongoDatabaseOptions, PongoDatabaseSQLBuilder, PongoDatabaseSchemaComponent, PongoDatabaseSchemaComponentOptions, PongoDatabaseURN, PongoDatabaseURNType, PongoDb, PongoDbOptions, PongoDbSchema, PongoDbSchemaMetadata, PongoDbTransaction, PongoDbWithSchema, PongoDeleteManyResult, PongoDeleteResult, PongoDocument, PongoDocumentCacheKey, PongoDriver, PongoDriverOptions, PongoDriverRegistry, PongoError, PongoFilter, PongoFilterOperator, PongoHandleResult, PongoInsertManyResult, PongoInsertOneResult, PongoMigrationOptions, PongoReplaceManyResult, PongoSchemaConfig, PongoSession, PongoSessionOptions, PongoTransactionCache, PongoTransactionCacheOperationOptions, PongoTransactionOptions, PongoUpdate, PongoUpdateManyResult, PongoUpdateResult, QueryOperators, RegExpOrString, ReplaceManyOptions, ReplaceOneOptions, RootFilterOperators, UpdateManyOptions, UpdateOneOptions, WithId, WithIdAndVersion, WithVersion, WithoutId, WithoutIdAndVersion, WithoutVersion, deepEquals, expectedVersion, expectedVersionPredicate, expectedVersionValue, getIdsFromIdOnlyFilter, hasOperators, idFromFilter, identityMapCache, isEquatable, isGeneralExpectedDocumentVersion, isNumber, isOperator, isString, loadPongoClient, lruCache, mapAsync, mapParallel, mapSequential, noopCacheProvider, objectEntries, operationResult, pongoCache, pongoCacheWrapper, pongoClient, pongoCollection, pongoDriverRegistry, pongoSchema, pongoSession, pongoTransaction, pongoTransactionCache, proxyClientWithSchema, proxyPongoDbWithSchema, toClientSchemaMetadata, toDbSchemaMetadata, transactionExecutorOrDefault };
21
+ //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,110 +1,21 @@
1
- import { DatabaseDriverType, Dumbo, MigrationStyle, SQLExecutor } from '@event-driven-io/dumbo';
2
- import { a as PongoDb, c as PongoCollectionSchemaComponent, C as CollectionOperationOptions, d as PongoDocument, e as PongoCollection, f as PongoClientSchema, P as PongoDatabaseDriver, g as PongoCollectionSchema, h as PongoDatabaseFactoryOptions, i as PongoDatabaseSchemaComponent, j as PongoDbSchema, A as AnyPongoDb, k as AnyPongoDatabaseDriver, l as PongoClientOptions, m as PongoClient, E as ExtractPongoDatabaseTypeFromDriver, n as PongoClientWithSchema, o as PongoTransactionOptions, p as PongoSession, q as PongoDbTransaction } from './pongoCollectionSchemaComponent-t_e9n2Wc.js';
3
- export { as as $inc, at as $push, aq as $set, ar as $unset, al as AlternativeType, z as AnyPongoDatabaseDriverOptions, I as CollectionsMap, am as Condition, K as DBsMap, ay as DOCUMENT_DOES_NOT_EXIST, ax as DOCUMENT_EXISTS, B as DatabaseDriverOptionsWithConnectionString, D as DatabaseDriverOptionsWithDatabaseName, a0 as DeleteManyOptions, $ as DeleteOneOptions, ag as Document, aN as DocumentHandler, a5 as EnhancedOmit, aw as ExpectedDocumentVersion, au as ExpectedDocumentVersionGeneral, av as ExpectedDocumentVersionValue, F as ExtractPongoDatabaseDriverOptions, a1 as FindOptions, Z as HandleOptions, a3 as HasId, a4 as InferIdType, W as InsertManyOptions, V as InsertOneOptions, az as NO_CONCURRENCY_CHECK, ak as NonObjectIdLikeDocument, a2 as ObjectId, aj as ObjectIdLike, aE as OperationResult, ah as OptionalId, a6 as OptionalUnlessRequiredId, a8 as OptionalUnlessRequiredIdAndVersion, a7 as OptionalUnlessRequiredVersion, ai as OptionalVersion, R as PongoClientSchemaMetadata, r as PongoCollectionSQLBuilder, u as PongoCollectionSchemaComponentOptions, O as PongoCollectionSchemaMetadata, t as PongoCollectionURN, s as PongoCollectionURNType, b as PongoDatabaseDriverOptions, G as PongoDatabaseDriverRegistry, y as PongoDatabaseSQLBuilder, x as PongoDatabaseSchemaComponentOptions, w as PongoDatabaseURN, v as PongoDatabaseURNType, Q as PongoDbSchemaMetadata, J as PongoDbWithSchema, aL as PongoDeleteManyResult, aK as PongoDeleteResult, an as PongoFilter, ap as PongoFilterOperator, aM as PongoHandleResult, aH as PongoInsertManyResult, aG as PongoInsertOneResult, U as PongoSchemaConfig, aD as PongoUpdate, aJ as PongoUpdateManyResult, aI as PongoUpdateResult, af as RegExpOrString, _ as ReplaceOneOptions, ao as RootFilterOperators, Y as UpdateManyOptions, X as UpdateOneOptions, a9 as WithId, ad as WithIdAndVersion, ab as WithVersion, aa as WithoutId, ae as WithoutIdAndVersion, ac as WithoutVersion, aC as expectedVersion, aB as expectedVersionValue, aA as isGeneralExpectedDocumentVersion, aF as operationResult, H as pongoDatabaseDriverRegistry, L as pongoSchema, N as proxyClientWithSchema, M as proxyPongoDbWithSchema, T as toClientSchemaMetadata, S as toDbSchemaMetadata } from './pongoCollectionSchemaComponent-t_e9n2Wc.js';
4
-
5
- type PongoCollectionOptions<DriverType extends DatabaseDriverType = DatabaseDriverType> = {
6
- db: PongoDb<DriverType>;
7
- collectionName: string;
8
- pool: Dumbo<DatabaseDriverType>;
9
- schemaComponent: PongoCollectionSchemaComponent;
10
- schema?: {
11
- autoMigration?: MigrationStyle;
12
- };
13
- errors?: {
14
- throwOnOperationFailures?: boolean;
15
- };
16
- };
17
- declare const transactionExecutorOrDefault: <DriverType extends DatabaseDriverType = DatabaseDriverType>(db: PongoDb<DriverType>, options: CollectionOperationOptions | undefined, defaultSqlExecutor: SQLExecutor) => Promise<SQLExecutor>;
18
- declare const pongoCollection: <T extends PongoDocument, DriverType extends DatabaseDriverType = DatabaseDriverType>({ db, collectionName, pool, schemaComponent, schema, errors, }: PongoCollectionOptions<DriverType>) => PongoCollection<T>;
19
-
20
- type Entry<T> = {
21
- [K in keyof Required<T>]: [K, Required<T>[K]];
22
- }[keyof Required<T>];
23
- type IterableEntry<T> = Entry<T> & {
24
- [Symbol.iterator](): Iterator<Entry<T>>;
25
- };
26
- declare const objectEntries: <T extends object>(obj: T) => IterableEntry<T>[];
27
- type NonPartial<T> = {
28
- [K in keyof Required<T>]: T[K];
29
- };
30
-
31
- declare const QueryOperators: {
32
- $eq: string;
33
- $gt: string;
34
- $gte: string;
35
- $lt: string;
36
- $lte: string;
37
- $ne: string;
38
- $in: string;
39
- $nin: string;
40
- $elemMatch: string;
41
- $all: string;
42
- $size: string;
43
- };
44
- declare const OperatorMap: {
45
- $gt: string;
46
- $gte: string;
47
- $lt: string;
48
- $lte: string;
49
- $ne: string;
50
- };
51
- declare const isOperator: (key: string) => boolean;
52
- declare const hasOperators: (value: Record<string, unknown>) => boolean;
53
-
54
- declare const PongoDatabaseCache: <Database extends PongoDb<DatabaseDriverType> = PongoDb<DatabaseDriverType>, TypedClientSchema extends PongoClientSchema = PongoClientSchema>({ driver, typedSchema, }: {
55
- driver: PongoDatabaseDriver<Database>;
56
- typedSchema?: TypedClientSchema | undefined;
57
- }) => {
58
- getOrCreate: <CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema<PongoDocument>>>(createOptions: Omit<PongoDatabaseFactoryOptions<CollectionsSchema>, "schema"> & {
59
- schema?: {
60
- autoMigration?: MigrationStyle;
61
- };
62
- }) => Database;
63
- all: () => Database[];
64
- forAll: (func: (db: Database) => Promise<void>) => Promise<void[]>;
65
- };
66
-
67
- type PongoDatabaseOptions<DumboType extends Dumbo<DatabaseDriverType, any> = Dumbo<DatabaseDriverType, any>, CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema>> = {
68
- databaseName: string;
69
- pool: DumboType;
70
- schemaComponent: PongoDatabaseSchemaComponent<DumboType['driverType']>;
71
- schema?: {
72
- autoMigration?: MigrationStyle;
73
- definition?: PongoDbSchema<CollectionsSchema>;
74
- } | undefined;
75
- errors?: {
76
- throwOnOperationFailures?: boolean;
77
- } | undefined;
78
- };
79
- declare const PongoDatabase: <Database extends AnyPongoDb = AnyPongoDb, DumboType extends Dumbo<Database["driverType"], any> = Dumbo<Database["driverType"], any>>(options: PongoDatabaseOptions<DumboType>) => Database;
80
-
81
- declare const isNumber: (val: unknown) => val is number;
82
- declare const isString: (val: unknown) => val is string;
83
- declare class PongoError extends Error {
84
- errorCode: number;
85
- constructor(options?: {
86
- errorCode: number;
87
- message?: string;
88
- } | string | number);
89
- }
90
- declare class ConcurrencyError extends PongoError {
91
- constructor(message?: string);
92
- }
93
-
94
- declare const pongoClient: <DatabaseDriver extends AnyPongoDatabaseDriver, TypedClientSchema extends PongoClientSchema = PongoClientSchema>(options: PongoClientOptions<DatabaseDriver, TypedClientSchema>) => PongoClient<DatabaseDriver["driverType"], ExtractPongoDatabaseTypeFromDriver<DatabaseDriver>> & PongoClientWithSchema<TypedClientSchema>;
95
-
96
- type PongoSessionOptions = {
97
- explicit?: boolean;
98
- defaultTransactionOptions: PongoTransactionOptions;
99
- };
100
- declare const pongoSession: (options?: PongoSessionOptions) => PongoSession;
101
-
102
- declare const pongoTransaction: (options: PongoTransactionOptions) => PongoDbTransaction;
1
+ import { $ as HasId, $t as AnyPongoDriverOptions, A as MaybePromise, An as hasOperators, At as PongoSession, B as DOCUMENT_DOES_NOT_EXIST, Bn as DocumentCommandHandler, Bt as UpdateOneOptions, C as PongoCacheType, Cn as pongoSchema, Ct as PongoFilter, D as LRUCacheOptions, Dn as toDbSchemaMetadata, Dt as PongoInsertOneResult, E as noopCacheProvider, En as toClientSchemaMetadata, Et as PongoInsertManyResult, F as AlternativeType, Fn as PongoCollectionURNType, Ft as RegExpOrString, G as DocumentHandler, Gn as NonPartial, Gt as WithoutIdAndVersion, H as DeleteManyOptions, Hn as DocumentCommandHandlerOptions, Ht as WithIdAndVersion, I as AnyPongoDb, In as PongoCollectionSQLBuilder, It as ReplaceManyOptions, J as ExpectedDocumentVersionGeneral, Jt as expectedVersionPredicate, K as EnhancedOmit, Kn as objectEntries, Kt as WithoutVersion, L as BatchHandleOptions, Ln as PongoCollectionOptions, Lt as ReplaceOneOptions, M as $push, Mn as PongoCollectionSchemaComponent, Mt as PongoUpdate, N as $set, Nn as PongoCollectionSchemaComponentOptions, Nt as PongoUpdateManyResult, O as lruCache, On as OperatorMap, Ot as PongoMigrationOptions, P as $unset, Pn as PongoCollectionURN, Pt as PongoUpdateResult, Q as HandleOptions, Qt as AnyPongoDriver, R as CollectionOperationOptions, Rn as pongoCollection, Rt as RootFilterOperators, S as PongoCacheSetEntry, Sn as PongoSchemaConfig, St as PongoDocument, T as pongoCache, Tn as proxyPongoDbWithSchema, Tt as PongoHandleResult, U as DeleteOneOptions, Un as getIdsFromIdOnlyFilter, Ut as WithVersion, V as DOCUMENT_EXISTS, Vn as DocumentCommandHandlerInput, Vt as WithId, W as Document, Wn as idFromFilter, Wt as WithoutId, X as ExpectedVersionPredicate, Xt as isGeneralExpectedDocumentVersion, Y as ExpectedDocumentVersionValue, Yt as expectedVersionValue, Z as FindOptions, Zt as operationResult, _ as CacheHooks, _n as PongoCollectionSchema, _t as PongoDb, a as ConcurrencyError, an as PongoDriverRegistry, at as ObjectId, b as CacheType, bn as PongoDbSchemaMetadata, bt as PongoDeleteManyResult, c as isString, cn as PongoDatabaseSchemaComponent, ct as OptionalId, d as PongoDatabaseCache, dn as PongoDatabaseURNType, dt as OptionalUnlessRequiredVersion, en as ExtractPongoDatabaseTypeFromDriver, et as InferIdType, f as PongoTransactionCache, fn as CollectionsMap, ft as OptionalVersion, g as CacheConfig, gn as PongoClientWithSchema, gt as PongoDBCollectionOptions, h as pongoCacheWrapper, hn as PongoClientSchemaMetadata, ht as PongoCollection, i as pongoClient, in as PongoDriverOptions, it as NonObjectIdLikeDocument, j as $inc, jn as isOperator, jt as PongoTransactionOptions, k as identityMapCache, kn as QueryOperators, kt as PongoReplaceManyResult, l as PongoDatabase, ln as PongoDatabaseSchemaComponentOptions, lt as OptionalUnlessRequiredId, m as pongoTransactionCache, mn as PongoClientSchema, mt as PongoClientOptions, n as PongoSessionOptions, nn as PongoDatabaseFactoryOptions, nt as InsertOneOptions, o as PongoError, on as pongoDriverRegistry, ot as ObjectIdLike, p as PongoTransactionCacheOperationOptions, pn as DBsMap, pt as PongoClient, q as ExpectedDocumentVersion, qt as expectedVersion, r as pongoSession, rn as PongoDriver, rt as NO_CONCURRENCY_CHECK, s as isNumber, sn as PongoDatabaseSQLBuilder, st as OperationResult, t as pongoTransaction, tn as ExtractPongoDriverOptions, tt as InsertManyOptions, u as PongoDatabaseOptions, un as PongoDatabaseURN, ut as OptionalUnlessRequiredIdAndVersion, v as CacheOptions, vn as PongoCollectionSchemaMetadata, vt as PongoDbOptions, w as PongoDocumentCacheKey, wn as proxyClientWithSchema, wt as PongoFilterOperator, x as PongoCache, xn as PongoDbWithSchema, xt as PongoDeleteResult, y as CacheSettings, yn as PongoDbSchema, yt as PongoDbTransaction, z as Condition, zn as transactionExecutorOrDefault, zt as UpdateManyOptions } from "./index-r7V4paf_.js";
103
2
 
3
+ //#region src/core/utils/deepEquals.d.ts
104
4
  declare const deepEquals: <T>(left: T, right: T) => boolean;
105
5
  type Equatable<T> = {
106
- equals: (right: T) => boolean;
6
+ equals: (right: T) => boolean;
107
7
  } & T;
108
8
  declare const isEquatable: <T>(left: T) => left is Equatable<T>;
109
-
110
- export { AnyPongoDatabaseDriver, AnyPongoDb, CollectionOperationOptions, ConcurrencyError, type Equatable, ExtractPongoDatabaseTypeFromDriver, type NonPartial, OperatorMap, PongoClient, PongoClientOptions, PongoClientSchema, PongoClientWithSchema, PongoCollection, type PongoCollectionOptions, PongoCollectionSchema, PongoCollectionSchemaComponent, PongoDatabase, PongoDatabaseCache, PongoDatabaseDriver, PongoDatabaseFactoryOptions, type PongoDatabaseOptions, PongoDatabaseSchemaComponent, PongoDb, PongoDbSchema, PongoDbTransaction, PongoDocument, PongoError, PongoSession, type PongoSessionOptions, PongoTransactionOptions, QueryOperators, deepEquals, hasOperators, isEquatable, isNumber, isOperator, isString, objectEntries, pongoClient, pongoCollection, pongoSession, pongoTransaction, transactionExecutorOrDefault };
9
+ //#endregion
10
+ //#region src/core/utils/mapAsync.d.ts
11
+ declare function mapSequential<T, R>(items: T[], fn: (item: T, index: number) => Promise<R>): Promise<R[]>;
12
+ declare const mapParallel: <T, R>(items: T[], fn: (item: T, index: number) => Promise<R>) => Promise<R[]>;
13
+ declare const mapAsync: <T, R>(items: T[], fn: (item: T, index: number) => Promise<R>, options?: {
14
+ parallel: boolean | undefined;
15
+ }) => Promise<R[]>;
16
+ //#endregion
17
+ //#region src/index.d.ts
18
+ declare const loadPongoClient: (path: "pg" | "sqlite3" | "d1") => Promise<AnyPongoDriver>;
19
+ //#endregion
20
+ export { $inc, $push, $set, $unset, AlternativeType, AnyPongoDb, AnyPongoDriver, AnyPongoDriverOptions, BatchHandleOptions, CacheConfig, CacheHooks, CacheOptions, CacheSettings, CacheType, CollectionOperationOptions, CollectionsMap, ConcurrencyError, Condition, DBsMap, DOCUMENT_DOES_NOT_EXIST, DOCUMENT_EXISTS, DeleteManyOptions, DeleteOneOptions, Document, DocumentCommandHandler, DocumentCommandHandlerInput, DocumentCommandHandlerOptions, DocumentHandler, EnhancedOmit, Equatable, ExpectedDocumentVersion, ExpectedDocumentVersionGeneral, ExpectedDocumentVersionValue, ExpectedVersionPredicate, ExtractPongoDatabaseTypeFromDriver, ExtractPongoDriverOptions, FindOptions, HandleOptions, HasId, InferIdType, InsertManyOptions, InsertOneOptions, LRUCacheOptions, MaybePromise, NO_CONCURRENCY_CHECK, NonObjectIdLikeDocument, NonPartial, ObjectId, ObjectIdLike, OperationResult, OperatorMap, OptionalId, OptionalUnlessRequiredId, OptionalUnlessRequiredIdAndVersion, OptionalUnlessRequiredVersion, OptionalVersion, PongoCache, PongoCacheSetEntry, PongoCacheType, PongoClient, PongoClientOptions, PongoClientSchema, PongoClientSchemaMetadata, PongoClientWithSchema, PongoCollection, PongoCollectionOptions, PongoCollectionSQLBuilder, PongoCollectionSchema, PongoCollectionSchemaComponent, PongoCollectionSchemaComponentOptions, PongoCollectionSchemaMetadata, PongoCollectionURN, PongoCollectionURNType, PongoDBCollectionOptions, PongoDatabase, PongoDatabaseCache, PongoDatabaseFactoryOptions, PongoDatabaseOptions, PongoDatabaseSQLBuilder, PongoDatabaseSchemaComponent, PongoDatabaseSchemaComponentOptions, PongoDatabaseURN, PongoDatabaseURNType, PongoDb, PongoDbOptions, PongoDbSchema, PongoDbSchemaMetadata, PongoDbTransaction, PongoDbWithSchema, PongoDeleteManyResult, PongoDeleteResult, PongoDocument, PongoDocumentCacheKey, PongoDriver, PongoDriverOptions, PongoDriverRegistry, PongoError, PongoFilter, PongoFilterOperator, PongoHandleResult, PongoInsertManyResult, PongoInsertOneResult, PongoMigrationOptions, PongoReplaceManyResult, PongoSchemaConfig, PongoSession, PongoSessionOptions, PongoTransactionCache, PongoTransactionCacheOperationOptions, PongoTransactionOptions, PongoUpdate, PongoUpdateManyResult, PongoUpdateResult, QueryOperators, RegExpOrString, ReplaceManyOptions, ReplaceOneOptions, RootFilterOperators, UpdateManyOptions, UpdateOneOptions, WithId, WithIdAndVersion, WithVersion, WithoutId, WithoutIdAndVersion, WithoutVersion, deepEquals, expectedVersion, expectedVersionPredicate, expectedVersionValue, getIdsFromIdOnlyFilter, hasOperators, idFromFilter, identityMapCache, isEquatable, isGeneralExpectedDocumentVersion, isNumber, isOperator, isString, loadPongoClient, lruCache, mapAsync, mapParallel, mapSequential, noopCacheProvider, objectEntries, operationResult, pongoCache, pongoCacheWrapper, pongoClient, pongoCollection, pongoDriverRegistry, pongoSchema, pongoSession, pongoTransaction, pongoTransactionCache, proxyClientWithSchema, proxyPongoDbWithSchema, toClientSchemaMetadata, toDbSchemaMetadata, transactionExecutorOrDefault };
21
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,75 +1,19 @@
1
- import {
2
- ConcurrencyError,
3
- DOCUMENT_DOES_NOT_EXIST,
4
- DOCUMENT_EXISTS,
5
- NO_CONCURRENCY_CHECK,
6
- ObjectId,
7
- OperatorMap,
8
- PongoCollectionSchemaComponent,
9
- PongoDatabase,
10
- PongoDatabaseCache,
11
- PongoDatabaseDriverRegistry,
12
- PongoDatabaseSchemaComponent,
13
- PongoError,
14
- QueryOperators,
15
- deepEquals,
16
- expectedVersion,
17
- expectedVersionValue,
18
- hasOperators,
19
- isEquatable,
20
- isGeneralExpectedDocumentVersion,
21
- isNumber,
22
- isOperator,
23
- isString,
24
- objectEntries,
25
- operationResult,
26
- pongoClient,
27
- pongoCollection,
28
- pongoDatabaseDriverRegistry,
29
- pongoSchema,
30
- pongoSession,
31
- pongoTransaction,
32
- proxyClientWithSchema,
33
- proxyPongoDbWithSchema,
34
- toClientSchemaMetadata,
35
- toDbSchemaMetadata,
36
- transactionExecutorOrDefault
37
- } from "./chunk-NCNRRYVE.js";
38
- export {
39
- ConcurrencyError,
40
- DOCUMENT_DOES_NOT_EXIST,
41
- DOCUMENT_EXISTS,
42
- NO_CONCURRENCY_CHECK,
43
- ObjectId,
44
- OperatorMap,
45
- PongoCollectionSchemaComponent,
46
- PongoDatabase,
47
- PongoDatabaseCache,
48
- PongoDatabaseDriverRegistry,
49
- PongoDatabaseSchemaComponent,
50
- PongoError,
51
- QueryOperators,
52
- deepEquals,
53
- expectedVersion,
54
- expectedVersionValue,
55
- hasOperators,
56
- isEquatable,
57
- isGeneralExpectedDocumentVersion,
58
- isNumber,
59
- isOperator,
60
- isString,
61
- objectEntries,
62
- operationResult,
63
- pongoClient,
64
- pongoCollection,
65
- pongoDatabaseDriverRegistry,
66
- pongoSchema,
67
- pongoSession,
68
- pongoTransaction,
69
- proxyClientWithSchema,
70
- proxyPongoDbWithSchema,
71
- toClientSchemaMetadata,
72
- toDbSchemaMetadata,
73
- transactionExecutorOrDefault
1
+ import { A as isString, B as DocumentCommandHandler, C as expectedVersionPredicate, D as ConcurrencyError, E as operationResult, F as hasOperators, G as noopCacheProvider, H as idFromFilter, I as isOperator, J as pongoCacheWrapper, K as lruCache, L as PongoCollectionSchemaComponent, M as PongoDatabaseCache, N as OperatorMap, O as PongoError, P as QueryOperators, R as pongoCollection, S as expectedVersion, T as isGeneralExpectedDocumentVersion, U as pongoTransactionCache, V as getIdsFromIdOnlyFilter, W as pongoCache, _ as toDbSchemaMetadata, a as isEquatable, b as NO_CONCURRENCY_CHECK, c as pongoTransaction, d as PongoDatabase, f as PongoDatabaseSchemaComponent, g as toClientSchemaMetadata, h as proxyPongoDbWithSchema, i as deepEquals, j as objectEntries, k as isNumber, l as PongoDriverRegistry, m as proxyClientWithSchema, n as mapParallel, o as pongoClient, p as pongoSchema, q as identityMapCache, r as mapSequential, s as pongoSession, t as mapAsync, u as pongoDriverRegistry$1, v as DOCUMENT_DOES_NOT_EXIST, w as expectedVersionValue, x as ObjectId, y as DOCUMENT_EXISTS, z as transactionExecutorOrDefault } from "./core-BHdOCUrr.js";
2
+
3
+ //#region src/index.ts
4
+ pongoDriverRegistry.register(`PostgreSQL:pg`, () => loadPongoClient("pg"));
5
+ pongoDriverRegistry.register(`SQLite:sqlite3`, () => loadPongoClient("sqlite3"));
6
+ pongoDriverRegistry.register(`SQLite:d1`, () => loadPongoClient("d1"));
7
+ const loadPongoClient = async (path) => {
8
+ let module;
9
+ if (path === "pg") module = await import("./pg.js");
10
+ else if (path === "sqlite3") module = await import("./sqlite3.js");
11
+ else if (path === "d1") module = await import("./cloudflare.js");
12
+ else throw new Error(`Unknown path: ${path}`);
13
+ if (!module.pongoDriver) throw new Error(`Failed to load Pongo client for ${path}`);
14
+ return module.pongoDriver;
74
15
  };
16
+
17
+ //#endregion
18
+ export { ConcurrencyError, DOCUMENT_DOES_NOT_EXIST, DOCUMENT_EXISTS, DocumentCommandHandler, NO_CONCURRENCY_CHECK, ObjectId, OperatorMap, PongoCollectionSchemaComponent, PongoDatabase, PongoDatabaseCache, PongoDatabaseSchemaComponent, PongoDriverRegistry, PongoError, QueryOperators, deepEquals, expectedVersion, expectedVersionPredicate, expectedVersionValue, getIdsFromIdOnlyFilter, hasOperators, idFromFilter, identityMapCache, isEquatable, isGeneralExpectedDocumentVersion, isNumber, isOperator, isString, loadPongoClient, lruCache, mapAsync, mapParallel, mapSequential, noopCacheProvider, objectEntries, operationResult, pongoCache, pongoCacheWrapper, pongoClient, pongoCollection, pongoDriverRegistry$1 as pongoDriverRegistry, pongoSchema, pongoSession, pongoTransaction, pongoTransactionCache, proxyClientWithSchema, proxyPongoDbWithSchema, toClientSchemaMetadata, toDbSchemaMetadata, transactionExecutorOrDefault };
75
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { AnyPongoDriver } from './core';\n\nexport * from './core';\n\npongoDriverRegistry.register(`PostgreSQL:pg`, () => loadPongoClient('pg'));\npongoDriverRegistry.register(`SQLite:sqlite3`, () =>\n loadPongoClient('sqlite3'),\n);\npongoDriverRegistry.register(`SQLite:d1`, () => loadPongoClient('d1'));\n\nexport const loadPongoClient = async (\n path: 'pg' | 'sqlite3' | 'd1',\n): Promise<AnyPongoDriver> => {\n let module;\n\n if (path === 'pg') {\n module = await import('./pg');\n } else if (path === 'sqlite3') {\n module = await import('./sqlite3');\n } else if (path === 'd1') {\n module = await import('./cloudflare');\n } else {\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unknown path: ${path}`);\n }\n\n if (!module.pongoDriver) {\n throw new Error(`Failed to load Pongo client for ${path}`);\n }\n\n return module.pongoDriver;\n};\n"],"mappings":";;;AAIA,oBAAoB,SAAS,uBAAuB,gBAAgB,KAAK,CAAC;AAC1E,oBAAoB,SAAS,wBAC3B,gBAAgB,UAAU,CAC3B;AACD,oBAAoB,SAAS,mBAAmB,gBAAgB,KAAK,CAAC;AAEtE,MAAa,kBAAkB,OAC7B,SAC4B;CAC5B,IAAI;AAEJ,KAAI,SAAS,KACX,UAAS,MAAM,OAAO;UACb,SAAS,UAClB,UAAS,MAAM,OAAO;UACb,SAAS,KAClB,UAAS,MAAM,OAAO;KAGtB,OAAM,IAAI,MAAM,iBAAiB,OAAO;AAG1C,KAAI,CAAC,OAAO,YACV,OAAM,IAAI,MAAM,mCAAmC,OAAO;AAG5D,QAAO,OAAO"}