@event-driven-io/pongo 0.17.0-beta.1 → 0.17.0-beta.2
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.
- package/dist/{chunk-YLV7YIPZ.cjs → chunk-4BL6YWLW.cjs} +3 -7
- package/dist/chunk-4BL6YWLW.cjs.map +1 -0
- package/dist/chunk-ECQ2CKZE.cjs +330 -0
- package/dist/chunk-ECQ2CKZE.cjs.map +1 -0
- package/dist/{chunk-5LN762VW.js → chunk-EYQDS752.js} +5 -3
- package/dist/chunk-EYQDS752.js.map +1 -0
- package/dist/{chunk-DL4E3N6J.js → chunk-NCNRRYVE.js} +3 -7
- package/dist/chunk-NCNRRYVE.js.map +1 -0
- package/dist/chunk-WH26IXHN.js +10 -0
- package/dist/{chunk-7W6X4QGY.cjs → chunk-WKW4LGF6.cjs} +4 -4
- package/dist/{chunk-7W6X4QGY.cjs.map → chunk-WKW4LGF6.cjs.map} +1 -1
- package/dist/chunk-Y7LRKJLJ.js +330 -0
- package/dist/chunk-Y7LRKJLJ.js.map +1 -0
- package/dist/{chunk-3KNMMQUV.cjs → chunk-ZPWKWNK2.cjs} +20 -18
- package/dist/chunk-ZPWKWNK2.cjs.map +1 -0
- package/dist/cli.cjs +38 -21
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +29 -12
- package/dist/cli.js.map +1 -1
- package/dist/d1.cjs +54 -0
- package/dist/d1.cjs.map +1 -0
- package/dist/d1.d.cts +11 -0
- package/dist/d1.d.ts +11 -0
- package/dist/d1.js +54 -0
- package/dist/d1.js.map +1 -0
- package/dist/index-BJopB-em.d.cts +7 -0
- package/dist/index-G5DECNb_.d.ts +7 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{pg-WUYRNGST.js → pg-73DOKU64.js} +3 -3
- package/dist/pg-I267A7IL.cjs +11 -0
- package/dist/{pg-XCWP4FAM.cjs.map → pg-I267A7IL.cjs.map} +1 -1
- package/dist/pg.cjs +4 -4
- package/dist/pg.d.cts +5 -2
- package/dist/pg.d.ts +5 -2
- package/dist/pg.js +3 -3
- package/dist/{pongoCollectionSchemaComponent-BsHlVyN-.d.cts → pongoCollectionSchemaComponent-t_e9n2Wc.d.cts} +12 -8
- package/dist/{pongoCollectionSchemaComponent-BsHlVyN-.d.ts → pongoCollectionSchemaComponent-t_e9n2Wc.d.ts} +12 -8
- package/dist/shim.cjs +16 -11
- package/dist/shim.cjs.map +1 -1
- package/dist/shim.d.cts +4 -3
- package/dist/shim.d.ts +4 -3
- package/dist/shim.js +12 -7
- package/dist/shim.js.map +1 -1
- package/dist/sqlite3.cjs +16 -332
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +8 -7
- package/dist/sqlite3.d.ts +8 -7
- package/dist/sqlite3.js +9 -325
- package/dist/sqlite3.js.map +1 -1
- package/package.json +16 -2
- package/dist/chunk-3KNMMQUV.cjs.map +0 -1
- package/dist/chunk-5LN762VW.js.map +0 -1
- package/dist/chunk-DL4E3N6J.js.map +0 -1
- package/dist/chunk-IBJKZ6TS.js +0 -10
- package/dist/chunk-YLV7YIPZ.cjs.map +0 -1
- package/dist/pg-XCWP4FAM.cjs +0 -11
- /package/dist/{chunk-IBJKZ6TS.js.map → chunk-WH26IXHN.js.map} +0 -0
- /package/dist/{pg-WUYRNGST.js.map → pg-73DOKU64.js.map} +0 -0
package/dist/d1.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pongoCollectionSQLiteMigrations,
|
|
3
|
+
sqliteSQLBuilder
|
|
4
|
+
} from "./chunk-Y7LRKJLJ.js";
|
|
5
|
+
import "./chunk-WH26IXHN.js";
|
|
6
|
+
import {
|
|
7
|
+
PongoCollectionSchemaComponent,
|
|
8
|
+
PongoDatabase,
|
|
9
|
+
PongoDatabaseSchemaComponent,
|
|
10
|
+
pongoDatabaseDriverRegistry,
|
|
11
|
+
pongoSchema
|
|
12
|
+
} from "./chunk-NCNRRYVE.js";
|
|
13
|
+
|
|
14
|
+
// src/storage/sqlite/d1/index.ts
|
|
15
|
+
import { D1DriverType, d1Pool } from "@event-driven-io/dumbo/d1";
|
|
16
|
+
var d1DatabaseDriver = {
|
|
17
|
+
driverType: D1DriverType,
|
|
18
|
+
databaseFactory: (options) => {
|
|
19
|
+
const databaseName = "d1:default";
|
|
20
|
+
return PongoDatabase({
|
|
21
|
+
...options,
|
|
22
|
+
pool: d1Pool(options),
|
|
23
|
+
schemaComponent: PongoDatabaseSchemaComponent({
|
|
24
|
+
driverType: D1DriverType,
|
|
25
|
+
collectionFactory: (schema) => PongoCollectionSchemaComponent({
|
|
26
|
+
driverType: D1DriverType,
|
|
27
|
+
definition: schema,
|
|
28
|
+
migrationsOrSchemaComponents: {
|
|
29
|
+
migrations: pongoCollectionSQLiteMigrations(schema.name)
|
|
30
|
+
},
|
|
31
|
+
sqlBuilder: sqliteSQLBuilder(schema.name)
|
|
32
|
+
}),
|
|
33
|
+
definition: options.schema?.definition ?? pongoSchema.db(databaseName, {})
|
|
34
|
+
}),
|
|
35
|
+
databaseName
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
getDatabaseNameOrDefault: () => {
|
|
39
|
+
return "d1://default";
|
|
40
|
+
},
|
|
41
|
+
defaultConnectionString: "d1://default"
|
|
42
|
+
};
|
|
43
|
+
var useSqlite3DatabaseDriver = () => {
|
|
44
|
+
pongoDatabaseDriverRegistry.register(D1DriverType, d1DatabaseDriver);
|
|
45
|
+
};
|
|
46
|
+
useSqlite3DatabaseDriver();
|
|
47
|
+
export {
|
|
48
|
+
d1DatabaseDriver as d1Driver,
|
|
49
|
+
d1DatabaseDriver as databaseDriver,
|
|
50
|
+
pongoCollectionSQLiteMigrations,
|
|
51
|
+
sqliteSQLBuilder,
|
|
52
|
+
useSqlite3DatabaseDriver
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=d1.js.map
|
package/dist/d1.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/storage/sqlite/d1/index.ts"],"sourcesContent":["import { D1DriverType, d1Pool } from '@event-driven-io/dumbo/d1';\nimport type { D1PoolOptions } from '@event-driven-io/dumbo/d1';\nimport {\n PongoCollectionSchemaComponent,\n PongoDatabase,\n pongoDatabaseDriverRegistry,\n PongoDatabaseSchemaComponent,\n pongoSchema,\n type PongoDatabaseDriver,\n type PongoDatabaseDriverOptions,\n type PongoDb,\n} from '../../../core';\nimport { pongoCollectionSQLiteMigrations, sqliteSQLBuilder } from '../core';\n\nexport type SQLitePongoClientOptions = object;\n\ntype D1DatabaseDriverOptions = PongoDatabaseDriverOptions<never> &\n D1PoolOptions;\n\nconst d1DatabaseDriver: PongoDatabaseDriver<\n PongoDb<D1DriverType>,\n D1DatabaseDriverOptions\n> = {\n driverType: D1DriverType,\n databaseFactory: (options) => {\n const databaseName = 'd1:default';\n\n return PongoDatabase({\n ...options,\n pool: d1Pool(options),\n schemaComponent: PongoDatabaseSchemaComponent({\n driverType: D1DriverType,\n collectionFactory: (schema) =>\n PongoCollectionSchemaComponent({\n driverType: D1DriverType,\n definition: schema,\n migrationsOrSchemaComponents: {\n migrations: pongoCollectionSQLiteMigrations(schema.name),\n },\n sqlBuilder: sqliteSQLBuilder(schema.name),\n }),\n definition:\n options.schema?.definition ?? pongoSchema.db(databaseName, {}),\n }),\n databaseName,\n });\n },\n getDatabaseNameOrDefault: () => {\n return 'd1://default';\n },\n defaultConnectionString: 'd1://default',\n};\n\nexport const useSqlite3DatabaseDriver = () => {\n pongoDatabaseDriverRegistry.register(D1DriverType, d1DatabaseDriver);\n};\n\nuseSqlite3DatabaseDriver();\n\nexport { d1DatabaseDriver as d1Driver, d1DatabaseDriver as databaseDriver };\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,cAAc,cAAc;AAmBrC,IAAM,mBAGF;AAAA,EACF,YAAY;AAAA,EACZ,iBAAiB,CAAC,YAAY;AAC5B,UAAM,eAAe;AAErB,WAAO,cAAc;AAAA,MACnB,GAAG;AAAA,MACH,MAAM,OAAO,OAAO;AAAA,MACpB,iBAAiB,6BAA6B;AAAA,QAC5C,YAAY;AAAA,QACZ,mBAAmB,CAAC,WAClB,+BAA+B;AAAA,UAC7B,YAAY;AAAA,UACZ,YAAY;AAAA,UACZ,8BAA8B;AAAA,YAC5B,YAAY,gCAAgC,OAAO,IAAI;AAAA,UACzD;AAAA,UACA,YAAY,iBAAiB,OAAO,IAAI;AAAA,QAC1C,CAAC;AAAA,QACH,YACE,QAAQ,QAAQ,cAAc,YAAY,GAAG,cAAc,CAAC,CAAC;AAAA,MACjE,CAAC;AAAA,MACD;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EACA,0BAA0B,MAAM;AAC9B,WAAO;AAAA,EACT;AAAA,EACA,yBAAyB;AAC3B;AAEO,IAAM,2BAA2B,MAAM;AAC5C,8BAA4B,SAAS,cAAc,gBAAgB;AACrE;AAEA,yBAAyB;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _event_driven_io_dumbo from '@event-driven-io/dumbo';
|
|
2
|
+
import { r as PongoCollectionSQLBuilder } from './pongoCollectionSchemaComponent-t_e9n2Wc.cjs';
|
|
3
|
+
|
|
4
|
+
declare const pongoCollectionSQLiteMigrations: (collectionName: string) => _event_driven_io_dumbo.SQLMigration[];
|
|
5
|
+
declare const sqliteSQLBuilder: (collectionName: string) => PongoCollectionSQLBuilder;
|
|
6
|
+
|
|
7
|
+
export { pongoCollectionSQLiteMigrations as p, sqliteSQLBuilder as s };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _event_driven_io_dumbo from '@event-driven-io/dumbo';
|
|
2
|
+
import { r as PongoCollectionSQLBuilder } from './pongoCollectionSchemaComponent-t_e9n2Wc.js';
|
|
3
|
+
|
|
4
|
+
declare const pongoCollectionSQLiteMigrations: (collectionName: string) => _event_driven_io_dumbo.SQLMigration[];
|
|
5
|
+
declare const sqliteSQLBuilder: (collectionName: string) => PongoCollectionSQLBuilder;
|
|
6
|
+
|
|
7
|
+
export { pongoCollectionSQLiteMigrations as p, sqliteSQLBuilder as s };
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-WKW4LGF6.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunk4BL6YWLWcjs = require('./chunk-4BL6YWLW.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -72,5 +72,5 @@ var _chunkYLV7YIPZcjs = require('./chunk-YLV7YIPZ.cjs');
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
exports.ConcurrencyError =
|
|
75
|
+
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;
|
|
76
76
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DatabaseDriverType, Dumbo, MigrationStyle, SQLExecutor
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
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
4
|
|
|
5
5
|
type PongoCollectionOptions<DriverType extends DatabaseDriverType = DatabaseDriverType> = {
|
|
6
6
|
db: PongoDb<DriverType>;
|
|
@@ -91,7 +91,7 @@ declare class ConcurrencyError extends PongoError {
|
|
|
91
91
|
constructor(message?: string);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
declare const pongoClient: <DatabaseDriver extends AnyPongoDatabaseDriver,
|
|
94
|
+
declare const pongoClient: <DatabaseDriver extends AnyPongoDatabaseDriver, TypedClientSchema extends PongoClientSchema = PongoClientSchema>(options: PongoClientOptions<DatabaseDriver, TypedClientSchema>) => PongoClient<DatabaseDriver["driverType"], ExtractPongoDatabaseTypeFromDriver<DatabaseDriver>> & PongoClientWithSchema<TypedClientSchema>;
|
|
95
95
|
|
|
96
96
|
type PongoSessionOptions = {
|
|
97
97
|
explicit?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DatabaseDriverType, Dumbo, MigrationStyle, SQLExecutor
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
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
4
|
|
|
5
5
|
type PongoCollectionOptions<DriverType extends DatabaseDriverType = DatabaseDriverType> = {
|
|
6
6
|
db: PongoDb<DriverType>;
|
|
@@ -91,7 +91,7 @@ declare class ConcurrencyError extends PongoError {
|
|
|
91
91
|
constructor(message?: string);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
declare const pongoClient: <DatabaseDriver extends AnyPongoDatabaseDriver,
|
|
94
|
+
declare const pongoClient: <DatabaseDriver extends AnyPongoDatabaseDriver, TypedClientSchema extends PongoClientSchema = PongoClientSchema>(options: PongoClientOptions<DatabaseDriver, TypedClientSchema>) => PongoClient<DatabaseDriver["driverType"], ExtractPongoDatabaseTypeFromDriver<DatabaseDriver>> & PongoClientWithSchema<TypedClientSchema>;
|
|
95
95
|
|
|
96
96
|
type PongoSessionOptions = {
|
|
97
97
|
explicit?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-WH26IXHN.js";
|
|
2
2
|
import {
|
|
3
3
|
ConcurrencyError,
|
|
4
4
|
DOCUMENT_DOES_NOT_EXIST,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
toClientSchemaMetadata,
|
|
36
36
|
toDbSchemaMetadata,
|
|
37
37
|
transactionExecutorOrDefault
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-NCNRRYVE.js";
|
|
39
39
|
export {
|
|
40
40
|
ConcurrencyError,
|
|
41
41
|
DOCUMENT_DOES_NOT_EXIST,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pgDatabaseDriver,
|
|
3
3
|
usePgDatabaseDriver
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-EYQDS752.js";
|
|
5
|
+
import "./chunk-NCNRRYVE.js";
|
|
6
6
|
export {
|
|
7
7
|
pgDatabaseDriver as databaseDriver,
|
|
8
8
|
pgDatabaseDriver as pgDriver,
|
|
9
9
|
usePgDatabaseDriver
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=pg-
|
|
11
|
+
//# sourceMappingURL=pg-73DOKU64.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkZPWKWNK2cjs = require('./chunk-ZPWKWNK2.cjs');
|
|
5
|
+
require('./chunk-4BL6YWLW.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.databaseDriver = _chunkZPWKWNK2cjs.pgDatabaseDriver; exports.pgDriver = _chunkZPWKWNK2cjs.pgDatabaseDriver; exports.usePgDatabaseDriver = _chunkZPWKWNK2cjs.usePgDatabaseDriver;
|
|
11
|
+
//# sourceMappingURL=pg-I267A7IL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/pongo/dist/pg-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/pongo/dist/pg-I267A7IL.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACF,wLAAC","file":"/home/runner/work/Pongo/Pongo/src/packages/pongo/dist/pg-I267A7IL.cjs"}
|
package/dist/pg.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-WKW4LGF6.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkZPWKWNK2cjs = require('./chunk-ZPWKWNK2.cjs');
|
|
8
|
+
require('./chunk-4BL6YWLW.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
exports.databaseDriver =
|
|
15
|
+
exports.databaseDriver = _chunkZPWKWNK2cjs.pgDatabaseDriver; exports.pgDriver = _chunkZPWKWNK2cjs.pgDatabaseDriver; exports.pongoCollectionPostgreSQLMigrations = _chunkZPWKWNK2cjs.pongoCollectionPostgreSQLMigrations; exports.postgresSQLBuilder = _chunkZPWKWNK2cjs.postgresSQLBuilder; exports.usePgDatabaseDriver = _chunkZPWKWNK2cjs.usePgDatabaseDriver;
|
|
16
16
|
//# sourceMappingURL=pg.cjs.map
|
package/dist/pg.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _event_driven_io_dumbo from '@event-driven-io/dumbo';
|
|
2
|
-
import {
|
|
2
|
+
import { r as PongoCollectionSQLBuilder, P as PongoDatabaseDriver, a as PongoDb, b as PongoDatabaseDriverOptions } from './pongoCollectionSchemaComponent-t_e9n2Wc.cjs';
|
|
3
3
|
import { NodePostgresDriverType, NodePostgresConnection } from '@event-driven-io/dumbo/pg';
|
|
4
4
|
import pg from 'pg';
|
|
5
5
|
|
|
@@ -26,7 +26,10 @@ type NotPooledPongoOptions = {
|
|
|
26
26
|
connection: NodePostgresConnection;
|
|
27
27
|
pooled?: false;
|
|
28
28
|
};
|
|
29
|
-
type NodePostgresDatabaseDriverOptions = PongoDatabaseDriverOptions<NodePostgresPongoClientOptions
|
|
29
|
+
type NodePostgresDatabaseDriverOptions = PongoDatabaseDriverOptions<NodePostgresPongoClientOptions> & {
|
|
30
|
+
databaseName?: string | undefined;
|
|
31
|
+
connectionString: string;
|
|
32
|
+
};
|
|
30
33
|
declare const pgDatabaseDriver: PongoDatabaseDriver<PongoDb<NodePostgresDriverType>, NodePostgresDatabaseDriverOptions>;
|
|
31
34
|
declare const usePgDatabaseDriver: () => void;
|
|
32
35
|
|
package/dist/pg.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _event_driven_io_dumbo from '@event-driven-io/dumbo';
|
|
2
|
-
import {
|
|
2
|
+
import { r as PongoCollectionSQLBuilder, P as PongoDatabaseDriver, a as PongoDb, b as PongoDatabaseDriverOptions } from './pongoCollectionSchemaComponent-t_e9n2Wc.js';
|
|
3
3
|
import { NodePostgresDriverType, NodePostgresConnection } from '@event-driven-io/dumbo/pg';
|
|
4
4
|
import pg from 'pg';
|
|
5
5
|
|
|
@@ -26,7 +26,10 @@ type NotPooledPongoOptions = {
|
|
|
26
26
|
connection: NodePostgresConnection;
|
|
27
27
|
pooled?: false;
|
|
28
28
|
};
|
|
29
|
-
type NodePostgresDatabaseDriverOptions = PongoDatabaseDriverOptions<NodePostgresPongoClientOptions
|
|
29
|
+
type NodePostgresDatabaseDriverOptions = PongoDatabaseDriverOptions<NodePostgresPongoClientOptions> & {
|
|
30
|
+
databaseName?: string | undefined;
|
|
31
|
+
connectionString: string;
|
|
32
|
+
};
|
|
30
33
|
declare const pgDatabaseDriver: PongoDatabaseDriver<PongoDb<NodePostgresDriverType>, NodePostgresDatabaseDriverOptions>;
|
|
31
34
|
declare const usePgDatabaseDriver: () => void;
|
|
32
35
|
|
package/dist/pg.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-WH26IXHN.js";
|
|
2
2
|
import {
|
|
3
3
|
pgDatabaseDriver,
|
|
4
4
|
pongoCollectionPostgreSQLMigrations,
|
|
5
5
|
postgresSQLBuilder,
|
|
6
6
|
usePgDatabaseDriver
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-EYQDS752.js";
|
|
8
|
+
import "./chunk-NCNRRYVE.js";
|
|
9
9
|
export {
|
|
10
10
|
pgDatabaseDriver as databaseDriver,
|
|
11
11
|
pgDatabaseDriver as pgDriver,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatabaseDriverType, SchemaComponent, MigrationStyle,
|
|
1
|
+
import { DatabaseDriverType, SchemaComponent, MigrationStyle, WithDatabaseTransactionFactory, AnyConnection, DatabaseTransaction, SQLExecutor, SQL, QueryResultRow, QueryResult, SchemaComponentOptions } from '@event-driven-io/dumbo';
|
|
2
2
|
|
|
3
3
|
interface PongoCollectionSchema<T extends PongoDocument = PongoDocument> {
|
|
4
4
|
name: string;
|
|
@@ -74,7 +74,6 @@ interface PongoDatabaseDriverOptions<ConnectionOptions = unknown> {
|
|
|
74
74
|
type AnyPongoDatabaseDriverOptions = PongoDatabaseDriverOptions<any>;
|
|
75
75
|
type PongoDatabaseFactoryOptions<CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema>, DriverOptions extends AnyPongoDatabaseDriverOptions = AnyPongoDatabaseDriverOptions> = {
|
|
76
76
|
databaseName?: string | undefined;
|
|
77
|
-
connectionString: string;
|
|
78
77
|
schema?: {
|
|
79
78
|
autoMigration?: MigrationStyle;
|
|
80
79
|
definition?: PongoDbSchema<CollectionsSchema>;
|
|
@@ -83,10 +82,16 @@ type PongoDatabaseFactoryOptions<CollectionsSchema extends Record<string, PongoC
|
|
|
83
82
|
throwOnOperationFailures?: boolean;
|
|
84
83
|
} | undefined;
|
|
85
84
|
} & DriverOptions;
|
|
85
|
+
type DatabaseDriverOptionsWithDatabaseName = {
|
|
86
|
+
databaseName?: string | undefined;
|
|
87
|
+
};
|
|
88
|
+
type DatabaseDriverOptionsWithConnectionString = {
|
|
89
|
+
connectionString?: string | undefined;
|
|
90
|
+
};
|
|
86
91
|
interface PongoDatabaseDriver<Database extends AnyPongoDb = AnyPongoDb, DriverOptions extends AnyPongoDatabaseDriverOptions = AnyPongoDatabaseDriverOptions> {
|
|
87
92
|
driverType: Database['driverType'];
|
|
88
93
|
databaseFactory<CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema>>(options: PongoDatabaseFactoryOptions<CollectionsSchema, DriverOptions>): Database & PongoDb<Database['driverType']>;
|
|
89
|
-
getDatabaseNameOrDefault(
|
|
94
|
+
getDatabaseNameOrDefault?<CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema>>(options: PongoDatabaseFactoryOptions<CollectionsSchema, DriverOptions>): string;
|
|
90
95
|
defaultConnectionString: string;
|
|
91
96
|
}
|
|
92
97
|
type AnyPongoDatabaseDriver = PongoDatabaseDriver<AnyPongoDb, AnyPongoDatabaseDriverOptions>;
|
|
@@ -118,9 +123,8 @@ interface PongoClient<DriverType extends DatabaseDriverType = DatabaseDriverType
|
|
|
118
123
|
startSession(): PongoSession<DriverType>;
|
|
119
124
|
withSession<T = unknown>(callback: (session: PongoSession<DriverType>) => Promise<T>): Promise<T>;
|
|
120
125
|
}
|
|
121
|
-
type PongoClientOptions<DatabaseDriver extends AnyPongoDatabaseDriver = AnyPongoDatabaseDriver,
|
|
126
|
+
type PongoClientOptions<DatabaseDriver extends AnyPongoDatabaseDriver = AnyPongoDatabaseDriver, TypedClientSchema extends PongoClientSchema = PongoClientSchema> = ExtractPongoDatabaseDriverOptions<DatabaseDriver> extends infer Options ? Options extends unknown ? {
|
|
122
127
|
driver: DatabaseDriver;
|
|
123
|
-
connectionString: ConnectionString | string;
|
|
124
128
|
schema?: {
|
|
125
129
|
autoMigration?: MigrationStyle;
|
|
126
130
|
definition?: TypedClientSchema;
|
|
@@ -136,7 +140,7 @@ declare interface PongoTransactionOptions {
|
|
|
136
140
|
interface PongoDbTransaction<DriverType extends DatabaseDriverType = DatabaseDriverType, Database extends PongoDb<DriverType> = PongoDb<DriverType>> {
|
|
137
141
|
get databaseName(): string | null;
|
|
138
142
|
options: PongoTransactionOptions;
|
|
139
|
-
enlistDatabase: (database: Database) => Promise<DatabaseTransaction<
|
|
143
|
+
enlistDatabase: (database: Database) => Promise<DatabaseTransaction<AnyConnection>>;
|
|
140
144
|
commit: () => Promise<void>;
|
|
141
145
|
rollback: (error?: unknown) => Promise<void>;
|
|
142
146
|
get sqlExecutor(): SQLExecutor;
|
|
@@ -158,7 +162,7 @@ interface PongoSession<DriverType extends DatabaseDriverType = DatabaseDriverTyp
|
|
|
158
162
|
abortTransaction(): Promise<void>;
|
|
159
163
|
withTransaction<T = unknown>(fn: (session: PongoSession<DriverType>) => Promise<T>, options?: PongoTransactionOptions): Promise<T>;
|
|
160
164
|
}
|
|
161
|
-
interface PongoDb<DriverType extends DatabaseDriverType = DatabaseDriverType> extends
|
|
165
|
+
interface PongoDb<DriverType extends DatabaseDriverType = DatabaseDriverType> extends WithDatabaseTransactionFactory<AnyConnection> {
|
|
162
166
|
driverType: DriverType;
|
|
163
167
|
databaseName: string;
|
|
164
168
|
connect(): Promise<void>;
|
|
@@ -419,4 +423,4 @@ type PongoCollectionSchemaComponent = SchemaComponent<PongoCollectionURN> & {
|
|
|
419
423
|
};
|
|
420
424
|
declare const PongoCollectionSchemaComponent: <DriverType extends DatabaseDriverType = DatabaseDriverType>({ definition, migrationsOrSchemaComponents, sqlBuilder, }: PongoCollectionSchemaComponentOptions<DriverType>) => PongoCollectionSchemaComponent;
|
|
421
425
|
|
|
422
|
-
export { type
|
|
426
|
+
export { type DeleteOneOptions as $, type AnyPongoDb as A, type DatabaseDriverOptionsWithConnectionString as B, type CollectionOperationOptions as C, type DatabaseDriverOptionsWithDatabaseName as D, type ExtractPongoDatabaseTypeFromDriver as E, type ExtractPongoDatabaseDriverOptions as F, PongoDatabaseDriverRegistry as G, pongoDatabaseDriverRegistry as H, type CollectionsMap as I, type PongoDbWithSchema as J, type DBsMap as K, pongoSchema as L, proxyPongoDbWithSchema as M, proxyClientWithSchema as N, type PongoCollectionSchemaMetadata as O, type PongoDatabaseDriver as P, type PongoDbSchemaMetadata as Q, type PongoClientSchemaMetadata as R, toDbSchemaMetadata as S, toClientSchemaMetadata as T, type PongoSchemaConfig as U, type InsertOneOptions as V, type InsertManyOptions as W, type UpdateOneOptions as X, type UpdateManyOptions as Y, type HandleOptions as Z, type ReplaceOneOptions as _, type PongoDb as a, type DeleteManyOptions as a0, type FindOptions as a1, ObjectId as a2, type HasId as a3, type InferIdType as a4, type EnhancedOmit as a5, type OptionalUnlessRequiredId as a6, type OptionalUnlessRequiredVersion as a7, type OptionalUnlessRequiredIdAndVersion as a8, type WithId as a9, isGeneralExpectedDocumentVersion as aA, expectedVersionValue as aB, expectedVersion as aC, type PongoUpdate as aD, type OperationResult as aE, operationResult as aF, type PongoInsertOneResult as aG, type PongoInsertManyResult as aH, type PongoUpdateResult as aI, type PongoUpdateManyResult as aJ, type PongoDeleteResult as aK, type PongoDeleteManyResult as aL, type PongoHandleResult as aM, type DocumentHandler as aN, type WithoutId as aa, type WithVersion as ab, type WithoutVersion as ac, type WithIdAndVersion as ad, type WithoutIdAndVersion as ae, type RegExpOrString as af, type Document as ag, type OptionalId as ah, type OptionalVersion as ai, type ObjectIdLike as aj, type NonObjectIdLikeDocument as ak, type AlternativeType as al, type Condition as am, type PongoFilter as an, type RootFilterOperators as ao, type PongoFilterOperator as ap, type $set as aq, type $unset as ar, type $inc as as, type $push as at, type ExpectedDocumentVersionGeneral as au, type ExpectedDocumentVersionValue as av, type ExpectedDocumentVersion as aw, DOCUMENT_EXISTS as ax, DOCUMENT_DOES_NOT_EXIST as ay, NO_CONCURRENCY_CHECK as az, type PongoDatabaseDriverOptions as b, PongoCollectionSchemaComponent as c, type PongoDocument as d, type PongoCollection as e, type PongoClientSchema as f, type PongoCollectionSchema as g, type PongoDatabaseFactoryOptions as h, PongoDatabaseSchemaComponent as i, type PongoDbSchema as j, type AnyPongoDatabaseDriver as k, type PongoClientOptions as l, type PongoClient as m, type PongoClientWithSchema as n, type PongoTransactionOptions as o, type PongoSession as p, type PongoDbTransaction as q, type PongoCollectionSQLBuilder as r, type PongoCollectionURNType as s, type PongoCollectionURN as t, type PongoCollectionSchemaComponentOptions as u, type PongoDatabaseURNType as v, type PongoDatabaseURN as w, type PongoDatabaseSchemaComponentOptions as x, type PongoDatabaseSQLBuilder as y, type AnyPongoDatabaseDriverOptions as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatabaseDriverType, SchemaComponent, MigrationStyle,
|
|
1
|
+
import { DatabaseDriverType, SchemaComponent, MigrationStyle, WithDatabaseTransactionFactory, AnyConnection, DatabaseTransaction, SQLExecutor, SQL, QueryResultRow, QueryResult, SchemaComponentOptions } from '@event-driven-io/dumbo';
|
|
2
2
|
|
|
3
3
|
interface PongoCollectionSchema<T extends PongoDocument = PongoDocument> {
|
|
4
4
|
name: string;
|
|
@@ -74,7 +74,6 @@ interface PongoDatabaseDriverOptions<ConnectionOptions = unknown> {
|
|
|
74
74
|
type AnyPongoDatabaseDriverOptions = PongoDatabaseDriverOptions<any>;
|
|
75
75
|
type PongoDatabaseFactoryOptions<CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema>, DriverOptions extends AnyPongoDatabaseDriverOptions = AnyPongoDatabaseDriverOptions> = {
|
|
76
76
|
databaseName?: string | undefined;
|
|
77
|
-
connectionString: string;
|
|
78
77
|
schema?: {
|
|
79
78
|
autoMigration?: MigrationStyle;
|
|
80
79
|
definition?: PongoDbSchema<CollectionsSchema>;
|
|
@@ -83,10 +82,16 @@ type PongoDatabaseFactoryOptions<CollectionsSchema extends Record<string, PongoC
|
|
|
83
82
|
throwOnOperationFailures?: boolean;
|
|
84
83
|
} | undefined;
|
|
85
84
|
} & DriverOptions;
|
|
85
|
+
type DatabaseDriverOptionsWithDatabaseName = {
|
|
86
|
+
databaseName?: string | undefined;
|
|
87
|
+
};
|
|
88
|
+
type DatabaseDriverOptionsWithConnectionString = {
|
|
89
|
+
connectionString?: string | undefined;
|
|
90
|
+
};
|
|
86
91
|
interface PongoDatabaseDriver<Database extends AnyPongoDb = AnyPongoDb, DriverOptions extends AnyPongoDatabaseDriverOptions = AnyPongoDatabaseDriverOptions> {
|
|
87
92
|
driverType: Database['driverType'];
|
|
88
93
|
databaseFactory<CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema>>(options: PongoDatabaseFactoryOptions<CollectionsSchema, DriverOptions>): Database & PongoDb<Database['driverType']>;
|
|
89
|
-
getDatabaseNameOrDefault(
|
|
94
|
+
getDatabaseNameOrDefault?<CollectionsSchema extends Record<string, PongoCollectionSchema> = Record<string, PongoCollectionSchema>>(options: PongoDatabaseFactoryOptions<CollectionsSchema, DriverOptions>): string;
|
|
90
95
|
defaultConnectionString: string;
|
|
91
96
|
}
|
|
92
97
|
type AnyPongoDatabaseDriver = PongoDatabaseDriver<AnyPongoDb, AnyPongoDatabaseDriverOptions>;
|
|
@@ -118,9 +123,8 @@ interface PongoClient<DriverType extends DatabaseDriverType = DatabaseDriverType
|
|
|
118
123
|
startSession(): PongoSession<DriverType>;
|
|
119
124
|
withSession<T = unknown>(callback: (session: PongoSession<DriverType>) => Promise<T>): Promise<T>;
|
|
120
125
|
}
|
|
121
|
-
type PongoClientOptions<DatabaseDriver extends AnyPongoDatabaseDriver = AnyPongoDatabaseDriver,
|
|
126
|
+
type PongoClientOptions<DatabaseDriver extends AnyPongoDatabaseDriver = AnyPongoDatabaseDriver, TypedClientSchema extends PongoClientSchema = PongoClientSchema> = ExtractPongoDatabaseDriverOptions<DatabaseDriver> extends infer Options ? Options extends unknown ? {
|
|
122
127
|
driver: DatabaseDriver;
|
|
123
|
-
connectionString: ConnectionString | string;
|
|
124
128
|
schema?: {
|
|
125
129
|
autoMigration?: MigrationStyle;
|
|
126
130
|
definition?: TypedClientSchema;
|
|
@@ -136,7 +140,7 @@ declare interface PongoTransactionOptions {
|
|
|
136
140
|
interface PongoDbTransaction<DriverType extends DatabaseDriverType = DatabaseDriverType, Database extends PongoDb<DriverType> = PongoDb<DriverType>> {
|
|
137
141
|
get databaseName(): string | null;
|
|
138
142
|
options: PongoTransactionOptions;
|
|
139
|
-
enlistDatabase: (database: Database) => Promise<DatabaseTransaction<
|
|
143
|
+
enlistDatabase: (database: Database) => Promise<DatabaseTransaction<AnyConnection>>;
|
|
140
144
|
commit: () => Promise<void>;
|
|
141
145
|
rollback: (error?: unknown) => Promise<void>;
|
|
142
146
|
get sqlExecutor(): SQLExecutor;
|
|
@@ -158,7 +162,7 @@ interface PongoSession<DriverType extends DatabaseDriverType = DatabaseDriverTyp
|
|
|
158
162
|
abortTransaction(): Promise<void>;
|
|
159
163
|
withTransaction<T = unknown>(fn: (session: PongoSession<DriverType>) => Promise<T>, options?: PongoTransactionOptions): Promise<T>;
|
|
160
164
|
}
|
|
161
|
-
interface PongoDb<DriverType extends DatabaseDriverType = DatabaseDriverType> extends
|
|
165
|
+
interface PongoDb<DriverType extends DatabaseDriverType = DatabaseDriverType> extends WithDatabaseTransactionFactory<AnyConnection> {
|
|
162
166
|
driverType: DriverType;
|
|
163
167
|
databaseName: string;
|
|
164
168
|
connect(): Promise<void>;
|
|
@@ -419,4 +423,4 @@ type PongoCollectionSchemaComponent = SchemaComponent<PongoCollectionURN> & {
|
|
|
419
423
|
};
|
|
420
424
|
declare const PongoCollectionSchemaComponent: <DriverType extends DatabaseDriverType = DatabaseDriverType>({ definition, migrationsOrSchemaComponents, sqlBuilder, }: PongoCollectionSchemaComponentOptions<DriverType>) => PongoCollectionSchemaComponent;
|
|
421
425
|
|
|
422
|
-
export { type
|
|
426
|
+
export { type DeleteOneOptions as $, type AnyPongoDb as A, type DatabaseDriverOptionsWithConnectionString as B, type CollectionOperationOptions as C, type DatabaseDriverOptionsWithDatabaseName as D, type ExtractPongoDatabaseTypeFromDriver as E, type ExtractPongoDatabaseDriverOptions as F, PongoDatabaseDriverRegistry as G, pongoDatabaseDriverRegistry as H, type CollectionsMap as I, type PongoDbWithSchema as J, type DBsMap as K, pongoSchema as L, proxyPongoDbWithSchema as M, proxyClientWithSchema as N, type PongoCollectionSchemaMetadata as O, type PongoDatabaseDriver as P, type PongoDbSchemaMetadata as Q, type PongoClientSchemaMetadata as R, toDbSchemaMetadata as S, toClientSchemaMetadata as T, type PongoSchemaConfig as U, type InsertOneOptions as V, type InsertManyOptions as W, type UpdateOneOptions as X, type UpdateManyOptions as Y, type HandleOptions as Z, type ReplaceOneOptions as _, type PongoDb as a, type DeleteManyOptions as a0, type FindOptions as a1, ObjectId as a2, type HasId as a3, type InferIdType as a4, type EnhancedOmit as a5, type OptionalUnlessRequiredId as a6, type OptionalUnlessRequiredVersion as a7, type OptionalUnlessRequiredIdAndVersion as a8, type WithId as a9, isGeneralExpectedDocumentVersion as aA, expectedVersionValue as aB, expectedVersion as aC, type PongoUpdate as aD, type OperationResult as aE, operationResult as aF, type PongoInsertOneResult as aG, type PongoInsertManyResult as aH, type PongoUpdateResult as aI, type PongoUpdateManyResult as aJ, type PongoDeleteResult as aK, type PongoDeleteManyResult as aL, type PongoHandleResult as aM, type DocumentHandler as aN, type WithoutId as aa, type WithVersion as ab, type WithoutVersion as ac, type WithIdAndVersion as ad, type WithoutIdAndVersion as ae, type RegExpOrString as af, type Document as ag, type OptionalId as ah, type OptionalVersion as ai, type ObjectIdLike as aj, type NonObjectIdLikeDocument as ak, type AlternativeType as al, type Condition as am, type PongoFilter as an, type RootFilterOperators as ao, type PongoFilterOperator as ap, type $set as aq, type $unset as ar, type $inc as as, type $push as at, type ExpectedDocumentVersionGeneral as au, type ExpectedDocumentVersionValue as av, type ExpectedDocumentVersion as aw, DOCUMENT_EXISTS as ax, DOCUMENT_DOES_NOT_EXIST as ay, NO_CONCURRENCY_CHECK as az, type PongoDatabaseDriverOptions as b, PongoCollectionSchemaComponent as c, type PongoDocument as d, type PongoCollection as e, type PongoClientSchema as f, type PongoCollectionSchema as g, type PongoDatabaseFactoryOptions as h, PongoDatabaseSchemaComponent as i, type PongoDbSchema as j, type AnyPongoDatabaseDriver as k, type PongoClientOptions as l, type PongoClient as m, type PongoClientWithSchema as n, type PongoTransactionOptions as o, type PongoSession as p, type PongoDbTransaction as q, type PongoCollectionSQLBuilder as r, type PongoCollectionURNType as s, type PongoCollectionURN as t, type PongoCollectionSchemaComponentOptions as u, type PongoDatabaseURNType as v, type PongoDatabaseURN as w, type PongoDatabaseSchemaComponentOptions as x, type PongoDatabaseSQLBuilder as y, type AnyPongoDatabaseDriverOptions as z };
|
package/dist/shim.cjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;require('./chunk-WKW4LGF6.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var _chunkYLV7YIPZcjs = require('./chunk-YLV7YIPZ.cjs');
|
|
5
|
+
var _chunk4BL6YWLWcjs = require('./chunk-4BL6YWLW.cjs');
|
|
7
6
|
|
|
8
7
|
// src/mongo/findCursor.ts
|
|
9
8
|
var FindCursor = (_class = class {
|
|
@@ -328,9 +327,15 @@ var Db = class {
|
|
|
328
327
|
// src/mongo/mongoClient.ts
|
|
329
328
|
var MongoClient = class {
|
|
330
329
|
|
|
331
|
-
constructor(
|
|
332
|
-
|
|
333
|
-
|
|
330
|
+
constructor(connectionStringOrOptions, options) {
|
|
331
|
+
if (typeof connectionStringOrOptions !== "string") {
|
|
332
|
+
this.pongoClient = _chunk4BL6YWLWcjs.pongoClient.call(void 0, connectionStringOrOptions);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
const { databaseType, driverName } = _dumbo.parseConnectionString.call(void 0,
|
|
336
|
+
connectionStringOrOptions
|
|
337
|
+
);
|
|
338
|
+
const driver = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _8 => _8.driver]), () => ( pongoDatabaseDriverRegistry.tryGet(
|
|
334
339
|
_dumbo.toDatabaseDriverType.call(void 0, databaseType, driverName)
|
|
335
340
|
)));
|
|
336
341
|
if (driver === null) {
|
|
@@ -338,10 +343,10 @@ var MongoClient = class {
|
|
|
338
343
|
`No database driver registered for ${databaseType} with name ${driverName}`
|
|
339
344
|
);
|
|
340
345
|
}
|
|
341
|
-
this.pongoClient =
|
|
346
|
+
this.pongoClient = _chunk4BL6YWLWcjs.pongoClient.call(void 0, {
|
|
342
347
|
..._nullishCoalesce(options, () => ( {})),
|
|
343
|
-
|
|
344
|
-
|
|
348
|
+
...{ connectionString: connectionStringOrOptions },
|
|
349
|
+
driver
|
|
345
350
|
});
|
|
346
351
|
}
|
|
347
352
|
async connect() {
|
|
@@ -355,12 +360,12 @@ var MongoClient = class {
|
|
|
355
360
|
return new Db(this.pongoClient.db(dbName));
|
|
356
361
|
}
|
|
357
362
|
startSession(_options) {
|
|
358
|
-
return
|
|
363
|
+
return _chunk4BL6YWLWcjs.pongoSession.call(void 0, );
|
|
359
364
|
}
|
|
360
365
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
361
366
|
async withSession(optionsOrExecutor, executor) {
|
|
362
367
|
const callback = typeof optionsOrExecutor === "function" ? optionsOrExecutor : executor;
|
|
363
|
-
const session =
|
|
368
|
+
const session = _chunk4BL6YWLWcjs.pongoSession.call(void 0, );
|
|
364
369
|
try {
|
|
365
370
|
return await callback(session);
|
|
366
371
|
} finally {
|