@extropysk/nest-mongo 1.0.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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/modules/index.d.ts +16 -0
- package/dist/nest-mongo.js +247 -0
- package/dist/nest-mongo.umd.cjs +254 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# nest-mongo
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './modules';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
|
|
3
|
+
export declare const DATABASE = "database";
|
|
4
|
+
interface Config {
|
|
5
|
+
uri: string;
|
|
6
|
+
}
|
|
7
|
+
interface AsyncConfig {
|
|
8
|
+
imports?: any[];
|
|
9
|
+
inject?: any[];
|
|
10
|
+
useFactory: (...args: unknown[]) => Promise<Config> | Config;
|
|
11
|
+
}
|
|
12
|
+
export declare class DatabaseModule {
|
|
13
|
+
static forRoot(options: Config): DynamicModule;
|
|
14
|
+
static forRootAsync(options: AsyncConfig): DynamicModule;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { Global, Module } from '@nestjs/common';
|
|
2
|
+
import { MongoClient } from 'mongodb';
|
|
3
|
+
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5
|
+
try {
|
|
6
|
+
var info = gen[key](arg);
|
|
7
|
+
var value = info.value;
|
|
8
|
+
} catch (error) {
|
|
9
|
+
reject(error);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (info.done) {
|
|
13
|
+
resolve(value);
|
|
14
|
+
} else {
|
|
15
|
+
Promise.resolve(value).then(_next, _throw);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function _async_to_generator(fn) {
|
|
19
|
+
return function() {
|
|
20
|
+
var self = this, args = arguments;
|
|
21
|
+
return new Promise(function(resolve, reject) {
|
|
22
|
+
var gen = fn.apply(self, args);
|
|
23
|
+
function _next(value) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
25
|
+
}
|
|
26
|
+
function _throw(err) {
|
|
27
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
28
|
+
}
|
|
29
|
+
_next(undefined);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function _class_call_check(instance, Constructor) {
|
|
34
|
+
if (!(instance instanceof Constructor)) {
|
|
35
|
+
throw new TypeError("Cannot call a class as a function");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function _defineProperties(target, props) {
|
|
39
|
+
for(var i = 0; i < props.length; i++){
|
|
40
|
+
var descriptor = props[i];
|
|
41
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
42
|
+
descriptor.configurable = true;
|
|
43
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
44
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
48
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
49
|
+
return Constructor;
|
|
50
|
+
}
|
|
51
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
52
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
53
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
54
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
55
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
56
|
+
}
|
|
57
|
+
function _ts_generator(thisArg, body) {
|
|
58
|
+
var f, y, t, _ = {
|
|
59
|
+
label: 0,
|
|
60
|
+
sent: function() {
|
|
61
|
+
if (t[0] & 1) throw t[1];
|
|
62
|
+
return t[1];
|
|
63
|
+
},
|
|
64
|
+
trys: [],
|
|
65
|
+
ops: []
|
|
66
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
67
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
68
|
+
return this;
|
|
69
|
+
}), g;
|
|
70
|
+
function verb(n) {
|
|
71
|
+
return function(v) {
|
|
72
|
+
return step([
|
|
73
|
+
n,
|
|
74
|
+
v
|
|
75
|
+
]);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function step(op) {
|
|
79
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
80
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
81
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
82
|
+
if (y = 0, t) op = [
|
|
83
|
+
op[0] & 2,
|
|
84
|
+
t.value
|
|
85
|
+
];
|
|
86
|
+
switch(op[0]){
|
|
87
|
+
case 0:
|
|
88
|
+
case 1:
|
|
89
|
+
t = op;
|
|
90
|
+
break;
|
|
91
|
+
case 4:
|
|
92
|
+
_.label++;
|
|
93
|
+
return {
|
|
94
|
+
value: op[1],
|
|
95
|
+
done: false
|
|
96
|
+
};
|
|
97
|
+
case 5:
|
|
98
|
+
_.label++;
|
|
99
|
+
y = op[1];
|
|
100
|
+
op = [
|
|
101
|
+
0
|
|
102
|
+
];
|
|
103
|
+
continue;
|
|
104
|
+
case 7:
|
|
105
|
+
op = _.ops.pop();
|
|
106
|
+
_.trys.pop();
|
|
107
|
+
continue;
|
|
108
|
+
default:
|
|
109
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
110
|
+
_ = 0;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
114
|
+
_.label = op[1];
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
118
|
+
_.label = t[1];
|
|
119
|
+
t = op;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
if (t && _.label < t[2]) {
|
|
123
|
+
_.label = t[2];
|
|
124
|
+
_.ops.push(op);
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
if (t[2]) _.ops.pop();
|
|
128
|
+
_.trys.pop();
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
op = body.call(thisArg, _);
|
|
132
|
+
} catch (e) {
|
|
133
|
+
op = [
|
|
134
|
+
6,
|
|
135
|
+
e
|
|
136
|
+
];
|
|
137
|
+
y = 0;
|
|
138
|
+
} finally{
|
|
139
|
+
f = t = 0;
|
|
140
|
+
}
|
|
141
|
+
if (op[0] & 5) throw op[1];
|
|
142
|
+
return {
|
|
143
|
+
value: op[0] ? op[1] : void 0,
|
|
144
|
+
done: true
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
var DATABASE = 'database';
|
|
149
|
+
var CONFIG = 'config';
|
|
150
|
+
var DatabaseModule = /*#__PURE__*/ function() {
|
|
151
|
+
function DatabaseModule() {
|
|
152
|
+
_class_call_check(this, DatabaseModule);
|
|
153
|
+
}
|
|
154
|
+
_create_class(DatabaseModule, null, [
|
|
155
|
+
{
|
|
156
|
+
key: "forRoot",
|
|
157
|
+
value: function forRoot(options) {
|
|
158
|
+
return {
|
|
159
|
+
module: DatabaseModule,
|
|
160
|
+
providers: [
|
|
161
|
+
{
|
|
162
|
+
provide: DATABASE,
|
|
163
|
+
useFactory: function() {
|
|
164
|
+
return _async_to_generator(function() {
|
|
165
|
+
var client;
|
|
166
|
+
return _ts_generator(this, function(_state) {
|
|
167
|
+
switch(_state.label){
|
|
168
|
+
case 0:
|
|
169
|
+
client = new MongoClient(options.uri);
|
|
170
|
+
return [
|
|
171
|
+
4,
|
|
172
|
+
client.connect()
|
|
173
|
+
];
|
|
174
|
+
case 1:
|
|
175
|
+
_state.sent();
|
|
176
|
+
return [
|
|
177
|
+
2,
|
|
178
|
+
client.db()
|
|
179
|
+
];
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
})();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
exports: [
|
|
187
|
+
DATABASE
|
|
188
|
+
]
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
key: "forRootAsync",
|
|
194
|
+
value: function forRootAsync(options) {
|
|
195
|
+
var _options_imports;
|
|
196
|
+
return {
|
|
197
|
+
module: DatabaseModule,
|
|
198
|
+
imports: (_options_imports = options.imports) !== null && _options_imports !== void 0 ? _options_imports : [],
|
|
199
|
+
providers: [
|
|
200
|
+
{
|
|
201
|
+
provide: CONFIG,
|
|
202
|
+
inject: options.inject || [],
|
|
203
|
+
useFactory: options.useFactory
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
provide: DATABASE,
|
|
207
|
+
inject: [
|
|
208
|
+
CONFIG
|
|
209
|
+
],
|
|
210
|
+
useFactory: function(mongoOptions) {
|
|
211
|
+
return _async_to_generator(function() {
|
|
212
|
+
var client;
|
|
213
|
+
return _ts_generator(this, function(_state) {
|
|
214
|
+
switch(_state.label){
|
|
215
|
+
case 0:
|
|
216
|
+
client = new MongoClient(mongoOptions.uri);
|
|
217
|
+
return [
|
|
218
|
+
4,
|
|
219
|
+
client.connect()
|
|
220
|
+
];
|
|
221
|
+
case 1:
|
|
222
|
+
_state.sent();
|
|
223
|
+
return [
|
|
224
|
+
2,
|
|
225
|
+
client.db()
|
|
226
|
+
];
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
})();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
exports: [
|
|
234
|
+
DATABASE
|
|
235
|
+
]
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
]);
|
|
240
|
+
return DatabaseModule;
|
|
241
|
+
}();
|
|
242
|
+
DatabaseModule = _ts_decorate([
|
|
243
|
+
Global(),
|
|
244
|
+
Module({})
|
|
245
|
+
], DatabaseModule);
|
|
246
|
+
|
|
247
|
+
export { DATABASE, DatabaseModule };
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@nestjs/common'), require('mongodb')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@nestjs/common', 'mongodb'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["nest-mongo"] = {}, global.common, global.mongodb));
|
|
5
|
+
})(this, (function (exports, common, mongodb) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8
|
+
try {
|
|
9
|
+
var info = gen[key](arg);
|
|
10
|
+
var value = info.value;
|
|
11
|
+
} catch (error) {
|
|
12
|
+
reject(error);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (info.done) {
|
|
16
|
+
resolve(value);
|
|
17
|
+
} else {
|
|
18
|
+
Promise.resolve(value).then(_next, _throw);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function _async_to_generator(fn) {
|
|
22
|
+
return function() {
|
|
23
|
+
var self = this, args = arguments;
|
|
24
|
+
return new Promise(function(resolve, reject) {
|
|
25
|
+
var gen = fn.apply(self, args);
|
|
26
|
+
function _next(value) {
|
|
27
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
28
|
+
}
|
|
29
|
+
function _throw(err) {
|
|
30
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
31
|
+
}
|
|
32
|
+
_next(undefined);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function _class_call_check(instance, Constructor) {
|
|
37
|
+
if (!(instance instanceof Constructor)) {
|
|
38
|
+
throw new TypeError("Cannot call a class as a function");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function _defineProperties(target, props) {
|
|
42
|
+
for(var i = 0; i < props.length; i++){
|
|
43
|
+
var descriptor = props[i];
|
|
44
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
45
|
+
descriptor.configurable = true;
|
|
46
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
47
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
51
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
52
|
+
return Constructor;
|
|
53
|
+
}
|
|
54
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
55
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
56
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
57
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
58
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
59
|
+
}
|
|
60
|
+
function _ts_generator(thisArg, body) {
|
|
61
|
+
var f, y, t, _ = {
|
|
62
|
+
label: 0,
|
|
63
|
+
sent: function() {
|
|
64
|
+
if (t[0] & 1) throw t[1];
|
|
65
|
+
return t[1];
|
|
66
|
+
},
|
|
67
|
+
trys: [],
|
|
68
|
+
ops: []
|
|
69
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
70
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
71
|
+
return this;
|
|
72
|
+
}), g;
|
|
73
|
+
function verb(n) {
|
|
74
|
+
return function(v) {
|
|
75
|
+
return step([
|
|
76
|
+
n,
|
|
77
|
+
v
|
|
78
|
+
]);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function step(op) {
|
|
82
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
83
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
84
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
85
|
+
if (y = 0, t) op = [
|
|
86
|
+
op[0] & 2,
|
|
87
|
+
t.value
|
|
88
|
+
];
|
|
89
|
+
switch(op[0]){
|
|
90
|
+
case 0:
|
|
91
|
+
case 1:
|
|
92
|
+
t = op;
|
|
93
|
+
break;
|
|
94
|
+
case 4:
|
|
95
|
+
_.label++;
|
|
96
|
+
return {
|
|
97
|
+
value: op[1],
|
|
98
|
+
done: false
|
|
99
|
+
};
|
|
100
|
+
case 5:
|
|
101
|
+
_.label++;
|
|
102
|
+
y = op[1];
|
|
103
|
+
op = [
|
|
104
|
+
0
|
|
105
|
+
];
|
|
106
|
+
continue;
|
|
107
|
+
case 7:
|
|
108
|
+
op = _.ops.pop();
|
|
109
|
+
_.trys.pop();
|
|
110
|
+
continue;
|
|
111
|
+
default:
|
|
112
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
113
|
+
_ = 0;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
117
|
+
_.label = op[1];
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
121
|
+
_.label = t[1];
|
|
122
|
+
t = op;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
if (t && _.label < t[2]) {
|
|
126
|
+
_.label = t[2];
|
|
127
|
+
_.ops.push(op);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
if (t[2]) _.ops.pop();
|
|
131
|
+
_.trys.pop();
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
op = body.call(thisArg, _);
|
|
135
|
+
} catch (e) {
|
|
136
|
+
op = [
|
|
137
|
+
6,
|
|
138
|
+
e
|
|
139
|
+
];
|
|
140
|
+
y = 0;
|
|
141
|
+
} finally{
|
|
142
|
+
f = t = 0;
|
|
143
|
+
}
|
|
144
|
+
if (op[0] & 5) throw op[1];
|
|
145
|
+
return {
|
|
146
|
+
value: op[0] ? op[1] : void 0,
|
|
147
|
+
done: true
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
var DATABASE = 'database';
|
|
152
|
+
var CONFIG = 'config';
|
|
153
|
+
exports.DatabaseModule = /*#__PURE__*/ function() {
|
|
154
|
+
function DatabaseModule() {
|
|
155
|
+
_class_call_check(this, DatabaseModule);
|
|
156
|
+
}
|
|
157
|
+
_create_class(DatabaseModule, null, [
|
|
158
|
+
{
|
|
159
|
+
key: "forRoot",
|
|
160
|
+
value: function forRoot(options) {
|
|
161
|
+
return {
|
|
162
|
+
module: DatabaseModule,
|
|
163
|
+
providers: [
|
|
164
|
+
{
|
|
165
|
+
provide: DATABASE,
|
|
166
|
+
useFactory: function() {
|
|
167
|
+
return _async_to_generator(function() {
|
|
168
|
+
var client;
|
|
169
|
+
return _ts_generator(this, function(_state) {
|
|
170
|
+
switch(_state.label){
|
|
171
|
+
case 0:
|
|
172
|
+
client = new mongodb.MongoClient(options.uri);
|
|
173
|
+
return [
|
|
174
|
+
4,
|
|
175
|
+
client.connect()
|
|
176
|
+
];
|
|
177
|
+
case 1:
|
|
178
|
+
_state.sent();
|
|
179
|
+
return [
|
|
180
|
+
2,
|
|
181
|
+
client.db()
|
|
182
|
+
];
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
})();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
exports: [
|
|
190
|
+
DATABASE
|
|
191
|
+
]
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
key: "forRootAsync",
|
|
197
|
+
value: function forRootAsync(options) {
|
|
198
|
+
var _options_imports;
|
|
199
|
+
return {
|
|
200
|
+
module: DatabaseModule,
|
|
201
|
+
imports: (_options_imports = options.imports) !== null && _options_imports !== void 0 ? _options_imports : [],
|
|
202
|
+
providers: [
|
|
203
|
+
{
|
|
204
|
+
provide: CONFIG,
|
|
205
|
+
inject: options.inject || [],
|
|
206
|
+
useFactory: options.useFactory
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
provide: DATABASE,
|
|
210
|
+
inject: [
|
|
211
|
+
CONFIG
|
|
212
|
+
],
|
|
213
|
+
useFactory: function(mongoOptions) {
|
|
214
|
+
return _async_to_generator(function() {
|
|
215
|
+
var client;
|
|
216
|
+
return _ts_generator(this, function(_state) {
|
|
217
|
+
switch(_state.label){
|
|
218
|
+
case 0:
|
|
219
|
+
client = new mongodb.MongoClient(mongoOptions.uri);
|
|
220
|
+
return [
|
|
221
|
+
4,
|
|
222
|
+
client.connect()
|
|
223
|
+
];
|
|
224
|
+
case 1:
|
|
225
|
+
_state.sent();
|
|
226
|
+
return [
|
|
227
|
+
2,
|
|
228
|
+
client.db()
|
|
229
|
+
];
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
})();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
exports: [
|
|
237
|
+
DATABASE
|
|
238
|
+
]
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
]);
|
|
243
|
+
return DatabaseModule;
|
|
244
|
+
}();
|
|
245
|
+
exports.DatabaseModule = _ts_decorate([
|
|
246
|
+
common.Global(),
|
|
247
|
+
common.Module({})
|
|
248
|
+
], exports.DatabaseModule);
|
|
249
|
+
|
|
250
|
+
exports.DATABASE = DATABASE;
|
|
251
|
+
|
|
252
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
253
|
+
|
|
254
|
+
}));
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@extropysk/nest-mongo",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./dist/nest-mongo.umd.cjs",
|
|
11
|
+
"module": "./dist/nest-mongo.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/nest-mongo.js",
|
|
17
|
+
"require": "./dist/nest-mongo.umd.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "tsc && vite build --watch",
|
|
22
|
+
"build": "tsc && vite build",
|
|
23
|
+
"test": "vitest",
|
|
24
|
+
"lint": "eslint ./src --ext .ts"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@eslint/js": "^8.56.0",
|
|
28
|
+
"@nestjs/common": "9.4.3",
|
|
29
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
30
|
+
"@semantic-release/git": "^10.0.1",
|
|
31
|
+
"@semantic-release/github": "^11.0.1",
|
|
32
|
+
"@semantic-release/npm": "^12.0.1",
|
|
33
|
+
"@types/express": "^5.0.3",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
|
35
|
+
"eslint": "^8.56.0",
|
|
36
|
+
"eslint-config-prettier": "^9.1.0",
|
|
37
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
38
|
+
"mongodb": "^7.0.0",
|
|
39
|
+
"prettier": "^3.3.2",
|
|
40
|
+
"semantic-release": "^24.2.3",
|
|
41
|
+
"typescript": "^5.2.2",
|
|
42
|
+
"typescript-eslint": "^7.13.0",
|
|
43
|
+
"vite": "^5.2.0",
|
|
44
|
+
"vite-plugin-dts": "^3.9.1",
|
|
45
|
+
"vite-plugin-swc-transform": "^1.1.0",
|
|
46
|
+
"vitest": "^2.0.1"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@nestjs/common": ">=9.0.0",
|
|
51
|
+
"mongodb": ">=7.0.0"
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"dist"
|
|
55
|
+
],
|
|
56
|
+
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
|
|
57
|
+
}
|