@xylabs/mongo 4.13.4 → 4.13.5
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/browser/index.d.ts +46 -60
- package/dist/neutral/index.d.ts +46 -60
- package/dist/node/index.d.ts +46 -60
- package/package.json +4 -4
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,60 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
maxPoolSize?: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export declare class MongoClientWrapper {
|
|
51
|
-
static readonly clients: Map<string, MongoClientWrapper>;
|
|
52
|
-
private client;
|
|
53
|
-
constructor(uri: string, maxPoolSize?: number, closeDelay?: number);
|
|
54
|
-
static get(uri: string, poolSize?: number, closeDelay?: number): MongoClientWrapper;
|
|
55
|
-
connect(): Promise<MongoClient>;
|
|
56
|
-
disconnect(): Promise<number>;
|
|
57
|
-
initiateClose(): Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { }
|
|
1
|
+
import * as mongodb from 'mongodb';
|
|
2
|
+
import { Document, Filter, DeleteResult, FindCursor, WithId, OptionalUnlessRequiredId, BulkWriteOptions, InsertOneOptions, ReplaceOptions, UpdateFilter, Collection, MongoClient } from 'mongodb';
|
|
3
|
+
|
|
4
|
+
interface BaseMongoSdkPublicConfig {
|
|
5
|
+
closeDelay?: number;
|
|
6
|
+
collection: string;
|
|
7
|
+
maxPoolSize?: number;
|
|
8
|
+
}
|
|
9
|
+
interface BaseMongoSdkPrivateConfig {
|
|
10
|
+
dbConnectionString?: string;
|
|
11
|
+
dbDomain?: string;
|
|
12
|
+
dbName?: string;
|
|
13
|
+
dbPassword?: string;
|
|
14
|
+
dbUserName?: string;
|
|
15
|
+
}
|
|
16
|
+
type BaseMongoSdkConfig = BaseMongoSdkPublicConfig & BaseMongoSdkPrivateConfig;
|
|
17
|
+
|
|
18
|
+
declare class BaseMongoSdk<T extends Document> {
|
|
19
|
+
config: BaseMongoSdkConfig;
|
|
20
|
+
constructor(config: BaseMongoSdkConfig);
|
|
21
|
+
get uri(): string;
|
|
22
|
+
deleteMany(filter: Filter<T>): Promise<DeleteResult>;
|
|
23
|
+
deleteOne(filter: Filter<T>): Promise<DeleteResult>;
|
|
24
|
+
find(filter: Filter<T>): Promise<FindCursor<WithId<T>>>;
|
|
25
|
+
findOne(filter: Filter<T>): Promise<WithId<T> | null>;
|
|
26
|
+
insertMany(items: OptionalUnlessRequiredId<T>[], options?: BulkWriteOptions): Promise<mongodb.InsertManyResult<T>>;
|
|
27
|
+
insertOne(item: OptionalUnlessRequiredId<T>, options?: InsertOneOptions): Promise<mongodb.InsertOneResult<T>>;
|
|
28
|
+
replaceOne(filter: Filter<T>, item: OptionalUnlessRequiredId<T>, options?: ReplaceOptions): Promise<mongodb.UpdateResult<T>>;
|
|
29
|
+
updateOne(filter: Filter<T>, fields: UpdateFilter<T>): Promise<mongodb.UpdateResult<T>>;
|
|
30
|
+
upsertOne(filter: Filter<T>, fields: UpdateFilter<T>): Promise<mongodb.UpdateResult<T>>;
|
|
31
|
+
useCollection<R>(func: (collection: Collection<T>) => Promise<R> | R): Promise<R>;
|
|
32
|
+
useMongo<R>(func: (client: MongoClient) => Promise<R> | R): Promise<R>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class MongoClientWrapper {
|
|
36
|
+
static readonly clients: Map<string, MongoClientWrapper>;
|
|
37
|
+
private client;
|
|
38
|
+
constructor(uri: string, maxPoolSize?: number, closeDelay?: number);
|
|
39
|
+
static get(uri: string, poolSize?: number, closeDelay?: number): MongoClientWrapper;
|
|
40
|
+
connect(): Promise<MongoClient>;
|
|
41
|
+
disconnect(): Promise<number>;
|
|
42
|
+
initiateClose(): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { BaseMongoSdk, MongoClientWrapper };
|
|
46
|
+
export type { BaseMongoSdkConfig, BaseMongoSdkPrivateConfig, BaseMongoSdkPublicConfig };
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,60 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
maxPoolSize?: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export declare class MongoClientWrapper {
|
|
51
|
-
static readonly clients: Map<string, MongoClientWrapper>;
|
|
52
|
-
private client;
|
|
53
|
-
constructor(uri: string, maxPoolSize?: number, closeDelay?: number);
|
|
54
|
-
static get(uri: string, poolSize?: number, closeDelay?: number): MongoClientWrapper;
|
|
55
|
-
connect(): Promise<MongoClient>;
|
|
56
|
-
disconnect(): Promise<number>;
|
|
57
|
-
initiateClose(): Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { }
|
|
1
|
+
import * as mongodb from 'mongodb';
|
|
2
|
+
import { Document, Filter, DeleteResult, FindCursor, WithId, OptionalUnlessRequiredId, BulkWriteOptions, InsertOneOptions, ReplaceOptions, UpdateFilter, Collection, MongoClient } from 'mongodb';
|
|
3
|
+
|
|
4
|
+
interface BaseMongoSdkPublicConfig {
|
|
5
|
+
closeDelay?: number;
|
|
6
|
+
collection: string;
|
|
7
|
+
maxPoolSize?: number;
|
|
8
|
+
}
|
|
9
|
+
interface BaseMongoSdkPrivateConfig {
|
|
10
|
+
dbConnectionString?: string;
|
|
11
|
+
dbDomain?: string;
|
|
12
|
+
dbName?: string;
|
|
13
|
+
dbPassword?: string;
|
|
14
|
+
dbUserName?: string;
|
|
15
|
+
}
|
|
16
|
+
type BaseMongoSdkConfig = BaseMongoSdkPublicConfig & BaseMongoSdkPrivateConfig;
|
|
17
|
+
|
|
18
|
+
declare class BaseMongoSdk<T extends Document> {
|
|
19
|
+
config: BaseMongoSdkConfig;
|
|
20
|
+
constructor(config: BaseMongoSdkConfig);
|
|
21
|
+
get uri(): string;
|
|
22
|
+
deleteMany(filter: Filter<T>): Promise<DeleteResult>;
|
|
23
|
+
deleteOne(filter: Filter<T>): Promise<DeleteResult>;
|
|
24
|
+
find(filter: Filter<T>): Promise<FindCursor<WithId<T>>>;
|
|
25
|
+
findOne(filter: Filter<T>): Promise<WithId<T> | null>;
|
|
26
|
+
insertMany(items: OptionalUnlessRequiredId<T>[], options?: BulkWriteOptions): Promise<mongodb.InsertManyResult<T>>;
|
|
27
|
+
insertOne(item: OptionalUnlessRequiredId<T>, options?: InsertOneOptions): Promise<mongodb.InsertOneResult<T>>;
|
|
28
|
+
replaceOne(filter: Filter<T>, item: OptionalUnlessRequiredId<T>, options?: ReplaceOptions): Promise<mongodb.UpdateResult<T>>;
|
|
29
|
+
updateOne(filter: Filter<T>, fields: UpdateFilter<T>): Promise<mongodb.UpdateResult<T>>;
|
|
30
|
+
upsertOne(filter: Filter<T>, fields: UpdateFilter<T>): Promise<mongodb.UpdateResult<T>>;
|
|
31
|
+
useCollection<R>(func: (collection: Collection<T>) => Promise<R> | R): Promise<R>;
|
|
32
|
+
useMongo<R>(func: (client: MongoClient) => Promise<R> | R): Promise<R>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class MongoClientWrapper {
|
|
36
|
+
static readonly clients: Map<string, MongoClientWrapper>;
|
|
37
|
+
private client;
|
|
38
|
+
constructor(uri: string, maxPoolSize?: number, closeDelay?: number);
|
|
39
|
+
static get(uri: string, poolSize?: number, closeDelay?: number): MongoClientWrapper;
|
|
40
|
+
connect(): Promise<MongoClient>;
|
|
41
|
+
disconnect(): Promise<number>;
|
|
42
|
+
initiateClose(): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { BaseMongoSdk, MongoClientWrapper };
|
|
46
|
+
export type { BaseMongoSdkConfig, BaseMongoSdkPrivateConfig, BaseMongoSdkPublicConfig };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,60 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
maxPoolSize?: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export declare class MongoClientWrapper {
|
|
51
|
-
static readonly clients: Map<string, MongoClientWrapper>;
|
|
52
|
-
private client;
|
|
53
|
-
constructor(uri: string, maxPoolSize?: number, closeDelay?: number);
|
|
54
|
-
static get(uri: string, poolSize?: number, closeDelay?: number): MongoClientWrapper;
|
|
55
|
-
connect(): Promise<MongoClient>;
|
|
56
|
-
disconnect(): Promise<number>;
|
|
57
|
-
initiateClose(): Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { }
|
|
1
|
+
import * as mongodb from 'mongodb';
|
|
2
|
+
import { Document, Filter, DeleteResult, FindCursor, WithId, OptionalUnlessRequiredId, BulkWriteOptions, InsertOneOptions, ReplaceOptions, UpdateFilter, Collection, MongoClient } from 'mongodb';
|
|
3
|
+
|
|
4
|
+
interface BaseMongoSdkPublicConfig {
|
|
5
|
+
closeDelay?: number;
|
|
6
|
+
collection: string;
|
|
7
|
+
maxPoolSize?: number;
|
|
8
|
+
}
|
|
9
|
+
interface BaseMongoSdkPrivateConfig {
|
|
10
|
+
dbConnectionString?: string;
|
|
11
|
+
dbDomain?: string;
|
|
12
|
+
dbName?: string;
|
|
13
|
+
dbPassword?: string;
|
|
14
|
+
dbUserName?: string;
|
|
15
|
+
}
|
|
16
|
+
type BaseMongoSdkConfig = BaseMongoSdkPublicConfig & BaseMongoSdkPrivateConfig;
|
|
17
|
+
|
|
18
|
+
declare class BaseMongoSdk<T extends Document> {
|
|
19
|
+
config: BaseMongoSdkConfig;
|
|
20
|
+
constructor(config: BaseMongoSdkConfig);
|
|
21
|
+
get uri(): string;
|
|
22
|
+
deleteMany(filter: Filter<T>): Promise<DeleteResult>;
|
|
23
|
+
deleteOne(filter: Filter<T>): Promise<DeleteResult>;
|
|
24
|
+
find(filter: Filter<T>): Promise<FindCursor<WithId<T>>>;
|
|
25
|
+
findOne(filter: Filter<T>): Promise<WithId<T> | null>;
|
|
26
|
+
insertMany(items: OptionalUnlessRequiredId<T>[], options?: BulkWriteOptions): Promise<mongodb.InsertManyResult<T>>;
|
|
27
|
+
insertOne(item: OptionalUnlessRequiredId<T>, options?: InsertOneOptions): Promise<mongodb.InsertOneResult<T>>;
|
|
28
|
+
replaceOne(filter: Filter<T>, item: OptionalUnlessRequiredId<T>, options?: ReplaceOptions): Promise<mongodb.UpdateResult<T>>;
|
|
29
|
+
updateOne(filter: Filter<T>, fields: UpdateFilter<T>): Promise<mongodb.UpdateResult<T>>;
|
|
30
|
+
upsertOne(filter: Filter<T>, fields: UpdateFilter<T>): Promise<mongodb.UpdateResult<T>>;
|
|
31
|
+
useCollection<R>(func: (collection: Collection<T>) => Promise<R> | R): Promise<R>;
|
|
32
|
+
useMongo<R>(func: (client: MongoClient) => Promise<R> | R): Promise<R>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class MongoClientWrapper {
|
|
36
|
+
static readonly clients: Map<string, MongoClientWrapper>;
|
|
37
|
+
private client;
|
|
38
|
+
constructor(uri: string, maxPoolSize?: number, closeDelay?: number);
|
|
39
|
+
static get(uri: string, poolSize?: number, closeDelay?: number): MongoClientWrapper;
|
|
40
|
+
connect(): Promise<MongoClient>;
|
|
41
|
+
disconnect(): Promise<number>;
|
|
42
|
+
initiateClose(): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { BaseMongoSdk, MongoClientWrapper };
|
|
46
|
+
export type { BaseMongoSdkConfig, BaseMongoSdkPrivateConfig, BaseMongoSdkPublicConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/mongo",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.5",
|
|
4
4
|
"description": "Base functionality used throughout XYO TypeScript/JavaScript libraries that access Mongo DB",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mongo",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"module": "dist/node/index.mjs",
|
|
41
41
|
"types": "dist/node/index.d.ts",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@xylabs/assert": "^4.13.
|
|
43
|
+
"@xylabs/assert": "^4.13.5",
|
|
44
44
|
"mongodb": "~6.17.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.
|
|
48
|
-
"@xylabs/tsconfig": "^7.0.0-rc.
|
|
47
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.8",
|
|
48
|
+
"@xylabs/tsconfig": "^7.0.0-rc.8",
|
|
49
49
|
"typescript": "^5.8.3",
|
|
50
50
|
"vitest": "^3.2.4"
|
|
51
51
|
},
|