@travetto/model-mongo 3.4.0-rc.7 → 3.4.0
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 +5 -5
- package/package.json +5 -5
- package/src/config.ts +4 -4
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ where the [MongoModelConfig](https://github.com/travetto/travetto/tree/main/modu
|
|
|
48
48
|
```typescript
|
|
49
49
|
import type mongo from 'mongodb';
|
|
50
50
|
|
|
51
|
-
import {
|
|
51
|
+
import { ResourceLoader, GlobalEnv, TimeSpan } from '@travetto/base';
|
|
52
52
|
import { Config } from '@travetto/config';
|
|
53
53
|
import { Field } from '@travetto/schema';
|
|
54
54
|
|
|
@@ -84,7 +84,7 @@ export class MongoModelConfig {
|
|
|
84
84
|
/**
|
|
85
85
|
* Is using the SRV DNS record configuration
|
|
86
86
|
*/
|
|
87
|
-
srvRecord
|
|
87
|
+
srvRecord?: boolean;
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Mongo client options
|
|
@@ -111,8 +111,8 @@ export class MongoModelConfig {
|
|
|
111
111
|
* Load all the ssl certs as needed
|
|
112
112
|
*/
|
|
113
113
|
async postConstruct(): Promise<void> {
|
|
114
|
-
const resources = new
|
|
115
|
-
const resolve = (file: string): Promise<string> => resources.resolve(file).then(
|
|
114
|
+
const resources = new ResourceLoader();
|
|
115
|
+
const resolve = (file: string): Promise<string> => resources.resolve(file).then(v => v, () => file);
|
|
116
116
|
|
|
117
117
|
if (this.connectionString) {
|
|
118
118
|
const details = new URL(this.connectionString);
|
|
@@ -175,4 +175,4 @@ export class MongoModelConfig {
|
|
|
175
175
|
}
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
-
Additionally, you can see that the class is registered with the [@Config](https://github.com/travetto/travetto/tree/main/module/config/src/decorator.ts#L13) annotation, and so these values can be overridden using the standard [Configuration](https://github.com/travetto/travetto/tree/main/module/config#readme "Configuration support") resolution paths.The SSL file options in `clientOptions` will automatically be resolved to files when given a path. This path can be a [
|
|
178
|
+
Additionally, you can see that the class is registered with the [@Config](https://github.com/travetto/travetto/tree/main/module/config/src/decorator.ts#L13) annotation, and so these values can be overridden using the standard [Configuration](https://github.com/travetto/travetto/tree/main/module/config#readme "Configuration support") resolution paths.The SSL file options in `clientOptions` will automatically be resolved to files when given a path. This path can be a [ResourceLoader](https://github.com/travetto/travetto/tree/main/module/base/src/resource.ts#L9) path or just a standard file path.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-mongo",
|
|
3
|
-
"version": "3.4.0
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Mongo backing for the travetto model module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mongo",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"directory": "module/model-mongo"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/config": "^3.4.0
|
|
29
|
-
"@travetto/model": "^3.4.0
|
|
30
|
-
"@travetto/model-query": "^3.4.0
|
|
28
|
+
"@travetto/config": "^3.4.0",
|
|
29
|
+
"@travetto/model": "^3.4.0",
|
|
30
|
+
"@travetto/model-query": "^3.4.0",
|
|
31
31
|
"mongodb": "^6.2.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@travetto/command": "^3.4.0
|
|
34
|
+
"@travetto/command": "^3.4.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@travetto/command": {
|
package/src/config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type mongo from 'mongodb';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { ResourceLoader, GlobalEnv, TimeSpan } from '@travetto/base';
|
|
4
4
|
import { Config } from '@travetto/config';
|
|
5
5
|
import { Field } from '@travetto/schema';
|
|
6
6
|
|
|
@@ -36,7 +36,7 @@ export class MongoModelConfig {
|
|
|
36
36
|
/**
|
|
37
37
|
* Is using the SRV DNS record configuration
|
|
38
38
|
*/
|
|
39
|
-
srvRecord
|
|
39
|
+
srvRecord?: boolean;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Mongo client options
|
|
@@ -63,8 +63,8 @@ export class MongoModelConfig {
|
|
|
63
63
|
* Load all the ssl certs as needed
|
|
64
64
|
*/
|
|
65
65
|
async postConstruct(): Promise<void> {
|
|
66
|
-
const resources = new
|
|
67
|
-
const resolve = (file: string): Promise<string> => resources.resolve(file).then(
|
|
66
|
+
const resources = new ResourceLoader();
|
|
67
|
+
const resolve = (file: string): Promise<string> => resources.resolve(file).then(v => v, () => file);
|
|
68
68
|
|
|
69
69
|
if (this.connectionString) {
|
|
70
70
|
const details = new URL(this.connectionString);
|