@pi-r/mongodb 0.8.1 → 0.8.3

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/README.md CHANGED
@@ -1,9 +1,7 @@
1
- ### @pi-r/mongodb
2
-
3
- https://e-mc.readthedocs.io/en/latest/db/mongodb.html
4
-
5
- PEP 402 - Forever Dodgers
6
-
7
- ### LICENSE
8
-
1
+ ### @pi-r/mongodb
2
+
3
+ https://e-mc.readthedocs.io/en/latest/db/mongodb.html
4
+
5
+ ### LICENSE
6
+
9
7
  MIT
package/client/pool.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import type { DbPoolConstructor } from '@e-mc/types/lib/db';
2
-
3
- import type { DbPoolCredential, MongoDBDataSource } from '../types';
4
-
5
- import type { MongoClient } from 'mongodb';
6
-
7
- declare const MongoDBPool: DbPoolConstructor<MongoDBDataSource, MongoClient, MongoClient, DbPoolCredential>;
8
-
1
+ import type { DbPoolConstructor } from '@e-mc/types/lib/db';
2
+
3
+ import type { DbPoolCredential, MongoDBDataSource } from '../types';
4
+
5
+ import type { MongoClient } from 'mongodb';
6
+
7
+ declare const MongoDBPool: DbPoolConstructor<MongoDBDataSource, MongoClient, MongoClient, DbPoolCredential>;
8
+
9
9
  export = MongoDBPool;
package/client/pool.js CHANGED
@@ -3,7 +3,6 @@ const util_1 = require("@e-mc/db/util");
3
3
  const DbPool = require('@e-mc/db/pool');
4
4
  const POOL_ACTIVE = new WeakSet();
5
5
  class MongoDBPool extends DbPool {
6
- static CACHE_UNUSED = ['maxPoolSize', 'minPoolSize', 'connectTimeoutMS', 'socketTimeoutMS', 'maxConnecting', 'maxIdleTimeMS', 'waitQueueTimeoutMS', 'maxStalenessSeconds', 'localThresholdMS', 'serverSelectionTimeoutMS', 'heartbeatFrequencyMS', 'minHeartbeatFrequencyMS', 'compressors', 'zlibCompressionLevel', 'srvMaxHosts'];
7
6
  static asString(credential) {
8
7
  const { options, uri } = credential;
9
8
  if (uri && options) {
@@ -58,4 +57,5 @@ class MongoDBPool extends DbPool {
58
57
  return this.client.s?.hasBeenClosed === true;
59
58
  }
60
59
  }
60
+ MongoDBPool.CACHE_UNUSED = ['maxPoolSize', 'minPoolSize', 'connectTimeoutMS', 'socketTimeoutMS', 'maxConnecting', 'maxIdleTimeMS', 'waitQueueTimeoutMS', 'maxStalenessSeconds', 'localThresholdMS', 'serverSelectionTimeoutMS', 'heartbeatFrequencyMS', 'minHeartbeatFrequencyMS', 'compressors', 'zlibCompressionLevel', 'srvMaxHosts'];
61
61
  module.exports = MongoDBPool;
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
- {
2
- "name": "@pi-r/mongodb",
3
- "version": "0.8.1",
4
- "description": "MongoDB client driver for E-mc.",
5
- "main": "client/index.js",
6
- "types": "client/index.d.ts",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/anpham6/pi-r.git",
13
- "directory": "src/db/mongodb"
14
- },
15
- "keywords": [
16
- "squared",
17
- "e-mc",
18
- "squared-functions"
19
- ],
20
- "author": "An Pham <anpham6@gmail.com>",
21
- "license": "MIT",
22
- "homepage": "https://github.com/anpham6/pi-r#readme",
23
- "dependencies": {
24
- "@e-mc/db": "^0.10.0",
25
- "@e-mc/request": "^0.10.0",
26
- "@e-mc/types": "^0.10.0",
27
- "mongodb": "^6.8.0"
28
- }
29
- }
1
+ {
2
+ "name": "@pi-r/mongodb",
3
+ "version": "0.8.3",
4
+ "description": "MongoDB client driver for E-mc.",
5
+ "main": "client/index.js",
6
+ "types": "client/index.d.ts",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/anpham6/pi-r.git",
13
+ "directory": "src/db/mongodb"
14
+ },
15
+ "keywords": [
16
+ "squared",
17
+ "e-mc",
18
+ "squared-functions"
19
+ ],
20
+ "author": "An Pham <anpham6@gmail.com>",
21
+ "license": "MIT",
22
+ "homepage": "https://github.com/anpham6/pi-r#readme",
23
+ "dependencies": {
24
+ "@e-mc/db": "^0.10.3",
25
+ "@e-mc/request": "^0.10.3",
26
+ "@e-mc/types": "^0.10.3",
27
+ "mongodb": "^6.9.0"
28
+ }
29
+ }
package/types/index.d.ts CHANGED
@@ -1,49 +1,49 @@
1
- import type { DbDataSource } from '@e-mc/types/lib/squared';
2
-
3
- import type { IdentifierAction } from '@e-mc/types/lib/core';
4
- import type { CascadeAction, ServerAuth } from '@e-mc/types/lib/db';
5
-
6
- import type { AggregateOptions, CollectionOptions, CommandOperationOptions, DbOptions, Document, Filter, MongoClientOptions, OptionalUnlessRequiredId, RunCommandOptions, Sort, SortDirection, UpdateFilter } from 'mongodb';
7
-
8
- export interface MongoDBDataSource extends DbDataSource<Filter<Document> | MongoDBFilterValue, MongoClientOptions, UpdateFilter<Document> | OptionalUnlessRequiredId<unknown>[], MongoDBCredential, string>, MongoDBClientDBOptions, CascadeAction {
9
- source: "mongodb";
10
- id?: string;
11
- updateType?: 0 | 1 | 2 | 3;
12
- }
13
-
14
- export interface MongoDBCredential extends ServerAuth, Pick<MongoClientOptions, "auth" | "authMechanism" | "authSource" | "tlsCertificateKeyFile" | "tlsCertificateKeyFilePassword" | "tlsCAFile" | "tlsCRLFile" | "tlsAllowInvalidHostnames" | "tlsAllowInvalidCertificates" | "tlsInsecure"> {}
15
-
16
- export interface MongoDBSortValue {
17
- value?: Sort;
18
- direction?: SortDirection;
19
- }
20
-
21
- export interface MongoDBAggregate {
22
- pipeline?: Document[];
23
- options?: AggregateOptions;
24
- }
25
-
26
- export interface MongoDBClientDBOptions {
27
- client?: {
28
- db?: DbOptions;
29
- collection?: CollectionOptions;
30
- command?: RunCommandOptions;
31
- };
32
- execute?: {
33
- insert?: CommandOperationOptions;
34
- update?: CommandOperationOptions;
35
- };
36
- command?: ArrayOf<Document>;
37
- aggregate?: MongoDBAggregate | Document[];
38
- sort?: Sort | string | MongoDBSortValue;
39
- }
40
-
41
- export interface MongoDBFilterValue {
42
- value?: Filter<Document>;
43
- options?: CommandOperationOptions;
44
- }
45
-
46
- export interface DbPoolCredential extends IdentifierAction {
47
- uri?: string;
48
- options?: MongoClientOptions;
1
+ import type { DbDataSource } from '@e-mc/types/lib/squared';
2
+
3
+ import type { IdentifierAction } from '@e-mc/types/lib/core';
4
+ import type { CascadeAction, ServerAuth } from '@e-mc/types/lib/db';
5
+
6
+ import type { AggregateOptions, CollectionOptions, CommandOperationOptions, DbOptions, Document, Filter, MongoClientOptions, OptionalUnlessRequiredId, RunCommandOptions, Sort, SortDirection, UpdateFilter } from 'mongodb';
7
+
8
+ export interface MongoDBDataSource extends DbDataSource<Filter<Document> | MongoDBFilterValue, MongoClientOptions, UpdateFilter<Document> | OptionalUnlessRequiredId<unknown>[], MongoDBCredential, string>, MongoDBClientDBOptions, CascadeAction {
9
+ source: "mongodb";
10
+ id?: string;
11
+ updateType?: 0 | 1 | 2 | 3;
12
+ }
13
+
14
+ export interface MongoDBCredential extends ServerAuth, Pick<MongoClientOptions, "auth" | "authMechanism" | "authSource" | "tlsCertificateKeyFile" | "tlsCertificateKeyFilePassword" | "tlsCAFile" | "tlsCRLFile" | "tlsAllowInvalidHostnames" | "tlsAllowInvalidCertificates" | "tlsInsecure"> {}
15
+
16
+ export interface MongoDBSortValue {
17
+ value?: Sort;
18
+ direction?: SortDirection;
19
+ }
20
+
21
+ export interface MongoDBAggregate {
22
+ pipeline?: Document[];
23
+ options?: AggregateOptions;
24
+ }
25
+
26
+ export interface MongoDBClientDBOptions {
27
+ client?: {
28
+ db?: DbOptions;
29
+ collection?: CollectionOptions;
30
+ command?: RunCommandOptions;
31
+ };
32
+ execute?: {
33
+ insert?: CommandOperationOptions;
34
+ update?: CommandOperationOptions;
35
+ };
36
+ command?: ArrayOf<Document>;
37
+ aggregate?: MongoDBAggregate | Document[];
38
+ sort?: Sort | string | MongoDBSortValue;
39
+ }
40
+
41
+ export interface MongoDBFilterValue {
42
+ value?: Filter<Document>;
43
+ options?: CommandOperationOptions;
44
+ }
45
+
46
+ export interface DbPoolCredential extends IdentifierAction {
47
+ uri?: string;
48
+ options?: MongoClientOptions;
49
49
  }