@e22m4u/js-repository 0.2.4 → 0.2.6
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 +4 -6
- package/dist/cjs/index.cjs +3 -3
- package/package.json +34 -35
- package/src/chai.js +0 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## @e22m4u/js-repository
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Реализация паттерна «Репозиторий» для работы с базами данных в Node.js
|
|
4
4
|
|
|
5
5
|
- [Установка](#Установка)
|
|
6
6
|
- [Импорт](#Импорт)
|
|
@@ -825,7 +825,7 @@ schema.defineModel({
|
|
|
825
825
|
discriminator: 'referenceType', // свойство для названия целевой модели
|
|
826
826
|
},
|
|
827
827
|
},
|
|
828
|
-
})
|
|
828
|
+
});
|
|
829
829
|
```
|
|
830
830
|
|
|
831
831
|
Полиморфная версия `hasMany` с указанием названия связи целевой модели.
|
|
@@ -840,7 +840,7 @@ schema.defineModel({
|
|
|
840
840
|
polymorphic: 'reference', // название полиморфной связи целевой модели
|
|
841
841
|
},
|
|
842
842
|
},
|
|
843
|
-
})
|
|
843
|
+
});
|
|
844
844
|
```
|
|
845
845
|
|
|
846
846
|
Полиморфная версия `hasMany` с указанием свойств целевой модели.
|
|
@@ -857,7 +857,7 @@ schema.defineModel({
|
|
|
857
857
|
discriminator: 'referenceType', // свойство целевой модели для названия текущей
|
|
858
858
|
},
|
|
859
859
|
},
|
|
860
|
-
})
|
|
860
|
+
});
|
|
861
861
|
```
|
|
862
862
|
|
|
863
863
|
## Расширение
|
|
@@ -942,8 +942,6 @@ interface City {
|
|
|
942
942
|
timeZone?: string;
|
|
943
943
|
countryId?: number;
|
|
944
944
|
country?: Country;
|
|
945
|
-
// открыть свойства (опционально)
|
|
946
|
-
[property: string]: unknown;
|
|
947
945
|
}
|
|
948
946
|
|
|
949
947
|
// получаем репозиторий по названию модели
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -6379,8 +6379,8 @@ var init_repository2 = __esm({
|
|
|
6379
6379
|
});
|
|
6380
6380
|
|
|
6381
6381
|
// src/index.js
|
|
6382
|
-
var
|
|
6383
|
-
__export(
|
|
6382
|
+
var index_exports = {};
|
|
6383
|
+
__export(index_exports, {
|
|
6384
6384
|
ADAPTER_CLASS_NAME: () => ADAPTER_CLASS_NAME,
|
|
6385
6385
|
Adapter: () => Adapter,
|
|
6386
6386
|
AdapterLoader: () => AdapterLoader,
|
|
@@ -6435,7 +6435,7 @@ __export(src_exports, {
|
|
|
6435
6435
|
stringToRegexp: () => stringToRegexp,
|
|
6436
6436
|
transformPromise: () => transformPromise
|
|
6437
6437
|
});
|
|
6438
|
-
module.exports = __toCommonJS(
|
|
6438
|
+
module.exports = __toCommonJS(index_exports);
|
|
6439
6439
|
|
|
6440
6440
|
// src/schema.js
|
|
6441
6441
|
var import_js_service37 = require("@e22m4u/js-service");
|
package/package.json
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e22m4u/js-repository",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.6",
|
|
4
|
+
"description": "Реализация репозитория для работы с базами данных в Node.js",
|
|
5
|
+
"author": "e22m4u <e22m4u@yandex.ru>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"Repository",
|
|
9
|
+
"ORM",
|
|
10
|
+
"ODM",
|
|
11
|
+
"Database",
|
|
12
|
+
"Datasource",
|
|
13
|
+
"Relations"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/e22m4u/js-repository",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/e22m4u/js-repository.git"
|
|
19
|
+
},
|
|
5
20
|
"type": "module",
|
|
6
21
|
"types": "./src/index.d.ts",
|
|
7
22
|
"module": "./src/index.js",
|
|
@@ -23,49 +38,33 @@
|
|
|
23
38
|
"build:cjs": "rimraf ./dist/cjs && node --no-warnings=ExperimentalWarning build-cjs.js",
|
|
24
39
|
"prepare": "husky"
|
|
25
40
|
},
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/e22m4u/js-repository.git"
|
|
29
|
-
},
|
|
30
|
-
"keywords": [
|
|
31
|
-
"Repository",
|
|
32
|
-
"ORM",
|
|
33
|
-
"ODM",
|
|
34
|
-
"Database",
|
|
35
|
-
"Datasource",
|
|
36
|
-
"Relations"
|
|
37
|
-
],
|
|
38
|
-
"author": "e22m4u <e22m4u@yandex.ru>",
|
|
39
|
-
"license": "MIT",
|
|
40
|
-
"homepage": "https://github.com/e22m4u/js-repository",
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@e22m4u/js-format": "0.1.
|
|
43
|
-
"@e22m4u/js-service": "0.2.
|
|
42
|
+
"@e22m4u/js-format": "~0.1.0",
|
|
43
|
+
"@e22m4u/js-service": "~0.2.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@commitlint/cli": "~19.
|
|
47
|
-
"@commitlint/config-conventional": "~19.
|
|
48
|
-
"@types/chai": "~5.
|
|
49
|
-
"@types/chai-as-promised": "~8.0.
|
|
46
|
+
"@commitlint/cli": "~19.8.0",
|
|
47
|
+
"@commitlint/config-conventional": "~19.8.0",
|
|
48
|
+
"@types/chai": "~5.2.1",
|
|
49
|
+
"@types/chai-as-promised": "~8.0.2",
|
|
50
50
|
"@types/chai-spies": "~1.0.6",
|
|
51
51
|
"@types/mocha": "~10.0.10",
|
|
52
|
-
"c8": "~10.1.
|
|
53
|
-
"chai": "~5.
|
|
52
|
+
"c8": "~10.1.3",
|
|
53
|
+
"chai": "~5.2.0",
|
|
54
54
|
"chai-as-promised": "~8.0.1",
|
|
55
55
|
"chai-spies": "~1.1.0",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"eslint": "~
|
|
59
|
-
"eslint-config-prettier": "~9.1.0",
|
|
56
|
+
"esbuild": "~0.25.3",
|
|
57
|
+
"eslint": "~9.25.1",
|
|
58
|
+
"eslint-config-prettier": "~10.1.2",
|
|
60
59
|
"eslint-plugin-chai-expect": "~3.1.0",
|
|
61
|
-
"eslint-plugin-jsdoc": "~50.6.
|
|
60
|
+
"eslint-plugin-jsdoc": "~50.6.10",
|
|
62
61
|
"eslint-plugin-mocha": "~10.5.0",
|
|
63
62
|
"husky": "~9.1.7",
|
|
64
|
-
"mocha": "~
|
|
65
|
-
"prettier": "~3.
|
|
63
|
+
"mocha": "~11.1.0",
|
|
64
|
+
"prettier": "~3.5.3",
|
|
66
65
|
"rimraf": "~6.0.1",
|
|
67
|
-
"tsx": "~4.19.
|
|
68
|
-
"typescript": "~5.
|
|
69
|
-
"typescript-eslint": "~8.
|
|
66
|
+
"tsx": "~4.19.3",
|
|
67
|
+
"typescript": "~5.8.3",
|
|
68
|
+
"typescript-eslint": "~8.31.0"
|
|
70
69
|
}
|
|
71
70
|
}
|
package/src/chai.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as chaiModule from 'chai';
|
|
2
2
|
import chaiSpies from 'chai-spies';
|
|
3
|
-
import chaiSubset from 'chai-subset';
|
|
4
3
|
import chaiAsPromised from 'chai-as-promised';
|
|
5
4
|
const chai = {...chaiModule};
|
|
6
5
|
|
|
7
6
|
chaiSpies(chai, chai.util);
|
|
8
|
-
chaiSubset(chai, chai.util);
|
|
9
7
|
chaiAsPromised(chai, chai.util);
|
|
10
8
|
|
|
11
9
|
export {chai};
|