@tsed/adapters 6.102.5 → 6.102.8-rc.2
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/lib/cjs/index.js +5 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/esm/adapters/FileSyncAdapter.js +1 -1
- package/lib/esm/adapters/LowDbAdapter.js +1 -1
- package/lib/esm/adapters/MemoryAdapter.js +1 -1
- package/lib/esm/decorators/injectAdapter.js +1 -1
- package/lib/esm/index.js +11 -8
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/Adapters.js +1 -1
- package/lib/types/index.d.ts +5 -2
- package/package.json +21 -16
- package/readme.md +0 -54
package/lib/cjs/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Automatically generated by barrelsby.
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const tslib_1 = require("tslib");
|
|
4
7
|
(0, tslib_1.__exportStar)(require("./adapters/FileSyncAdapter"), exports);
|
|
5
8
|
(0, tslib_1.__exportStar)(require("./adapters/LowDbAdapter"), exports);
|
|
6
9
|
(0, tslib_1.__exportStar)(require("./adapters/MemoryAdapter"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./decorators/indexed"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./decorators/injectAdapter"), exports);
|
|
7
12
|
(0, tslib_1.__exportStar)(require("./domain/Adapter"), exports);
|
|
8
13
|
(0, tslib_1.__exportStar)(require("./domain/AdaptersSettings"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./decorators/injectAdapter"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./decorators/indexed"), exports);
|
|
11
14
|
(0, tslib_1.__exportStar)(require("./services/Adapters"), exports);
|
|
12
15
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,0EAA2C;AAC3C,uEAAwC;AACxC,wEAAyC;AACzC,oEAAqC;AACrC,0EAA2C;AAC3C,gEAAiC;AACjC,yEAA0C;AAC1C,mEAAoC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./adapters/FileSyncAdapter\";\nexport * from \"./adapters/LowDbAdapter\";\nexport * from \"./adapters/MemoryAdapter\";\nexport * from \"./decorators/indexed\";\nexport * from \"./decorators/injectAdapter\";\nexport * from \"./domain/Adapter\";\nexport * from \"./domain/AdaptersSettings\";\nexport * from \"./services/Adapters\";\n"]}
|
|
@@ -5,7 +5,7 @@ import { ensureDirSync } from "fs-extra";
|
|
|
5
5
|
import low from "lowdb";
|
|
6
6
|
import FileSync from "lowdb/adapters/FileSync";
|
|
7
7
|
import { dirname } from "path";
|
|
8
|
-
import { LowDbAdapter } from "./LowDbAdapter";
|
|
8
|
+
import { LowDbAdapter } from "./LowDbAdapter.js";
|
|
9
9
|
let FileSyncAdapter = class FileSyncAdapter extends LowDbAdapter {
|
|
10
10
|
constructor(options, configuration) {
|
|
11
11
|
super(options, configuration);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import isMatch from "lodash/isMatch";
|
|
2
2
|
import { v4 as uuid } from "uuid";
|
|
3
|
-
import { Adapter } from "../domain/Adapter";
|
|
3
|
+
import { Adapter } from "../domain/Adapter.js";
|
|
4
4
|
export class LowDbAdapter extends Adapter {
|
|
5
5
|
get collection() {
|
|
6
6
|
return this.db.get("collection");
|
|
@@ -2,7 +2,7 @@ import { __decorate, __metadata, __param } from "tslib";
|
|
|
2
2
|
import { Configuration, Injectable, Opts, ProviderScope, Scope } from "@tsed/di";
|
|
3
3
|
import low from "lowdb";
|
|
4
4
|
import Memory from "lowdb/adapters/Memory";
|
|
5
|
-
import { LowDbAdapter } from "./LowDbAdapter";
|
|
5
|
+
import { LowDbAdapter } from "./LowDbAdapter.js";
|
|
6
6
|
let MemoryAdapter = class MemoryAdapter extends LowDbAdapter {
|
|
7
7
|
constructor(options, configuration) {
|
|
8
8
|
super(options, configuration);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { classOf, descriptorOf, isClass, isString } from "@tsed/core";
|
|
2
2
|
import { Inject } from "@tsed/di";
|
|
3
|
-
import { Adapters } from "../services/Adapters";
|
|
3
|
+
import { Adapters } from "../services/Adapters.js";
|
|
4
4
|
function mapOptions(args) {
|
|
5
5
|
return args.reduce((options, item, index) => {
|
|
6
6
|
if (isString(item)) {
|
package/lib/esm/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./decorators/indexed";
|
|
8
|
-
export * from "./
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./adapters/FileSyncAdapter.js";
|
|
5
|
+
export * from "./adapters/LowDbAdapter.js";
|
|
6
|
+
export * from "./adapters/MemoryAdapter.js";
|
|
7
|
+
export * from "./decorators/indexed.js";
|
|
8
|
+
export * from "./decorators/injectAdapter.js";
|
|
9
|
+
export * from "./domain/Adapter.js";
|
|
10
|
+
export * from "./domain/AdaptersSettings.js";
|
|
11
|
+
export * from "./services/Adapters.js";
|
|
9
12
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./adapters/FileSyncAdapter\";\nexport * from \"./adapters/LowDbAdapter\";\nexport * from \"./adapters/MemoryAdapter\";\nexport * from \"./decorators/indexed\";\nexport * from \"./decorators/injectAdapter\";\nexport * from \"./domain/Adapter\";\nexport * from \"./domain/AdaptersSettings\";\nexport * from \"./services/Adapters\";\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { Type } from "@tsed/core";
|
|
3
3
|
import { Constant, DI_PARAM_OPTIONS, Inject, Injectable, InjectorService } from "@tsed/di";
|
|
4
|
-
import { MemoryAdapter } from "../adapters/MemoryAdapter";
|
|
4
|
+
import { MemoryAdapter } from "../adapters/MemoryAdapter.js";
|
|
5
5
|
let Adapters = class Adapters {
|
|
6
6
|
invokeAdapter(options) {
|
|
7
7
|
const { adapter = this.adapter, ...props } = options;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
1
4
|
export * from "./adapters/FileSyncAdapter";
|
|
2
5
|
export * from "./adapters/LowDbAdapter";
|
|
3
6
|
export * from "./adapters/MemoryAdapter";
|
|
7
|
+
export * from "./decorators/indexed";
|
|
8
|
+
export * from "./decorators/injectAdapter";
|
|
4
9
|
export * from "./domain/Adapter";
|
|
5
10
|
export * from "./domain/AdaptersSettings";
|
|
6
|
-
export * from "./decorators/injectAdapter";
|
|
7
|
-
export * from "./decorators/indexed";
|
|
8
11
|
export * from "./services/Adapters";
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/adapters",
|
|
3
|
-
"version": "6.102.
|
|
3
|
+
"version": "6.102.8-rc.2",
|
|
4
4
|
"description": "Database adapters for Ts.ED",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/cjs/index.js",
|
|
8
|
+
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
"types": "./lib/types/index.d.ts",
|
|
@@ -13,9 +14,10 @@
|
|
|
13
14
|
"default": "./lib/esm/index.js"
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|
|
16
|
-
"build": "yarn run build:esm && yarn run build:cjs",
|
|
17
|
+
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
|
|
17
18
|
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
18
19
|
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
20
|
+
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
|
|
19
21
|
"test": "cross-env NODE_ENV=test yarn jest"
|
|
20
22
|
},
|
|
21
23
|
"dependencies": {
|
|
@@ -27,21 +29,21 @@
|
|
|
27
29
|
"uuid": "8.3.2"
|
|
28
30
|
},
|
|
29
31
|
"devDependencies": {
|
|
30
|
-
"@tsed/ajv": "6.102.
|
|
31
|
-
"@tsed/common": "6.102.
|
|
32
|
-
"@tsed/core": "6.102.
|
|
33
|
-
"@tsed/di": "6.102.
|
|
34
|
-
"@tsed/json-mapper": "6.102.
|
|
35
|
-
"@tsed/schema": "6.102.
|
|
32
|
+
"@tsed/ajv": "6.102.8-rc.2",
|
|
33
|
+
"@tsed/common": "6.102.8-rc.2",
|
|
34
|
+
"@tsed/core": "6.102.8-rc.2",
|
|
35
|
+
"@tsed/di": "6.102.8-rc.2",
|
|
36
|
+
"@tsed/json-mapper": "6.102.8-rc.2",
|
|
37
|
+
"@tsed/schema": "6.102.8-rc.2",
|
|
36
38
|
"@types/fs-extra": "9.0.6"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
|
-
"@tsed/ajv": "^6.102.
|
|
40
|
-
"@tsed/common": "^6.102.
|
|
41
|
-
"@tsed/core": "^6.102.
|
|
42
|
-
"@tsed/di": "^6.102.
|
|
43
|
-
"@tsed/json-mapper": "^6.102.
|
|
44
|
-
"@tsed/schema": "^6.102.
|
|
41
|
+
"@tsed/ajv": "^6.102.8-rc.2",
|
|
42
|
+
"@tsed/common": "^6.102.8-rc.2",
|
|
43
|
+
"@tsed/core": "^6.102.8-rc.2",
|
|
44
|
+
"@tsed/di": "^6.102.8-rc.2",
|
|
45
|
+
"@tsed/json-mapper": "^6.102.8-rc.2",
|
|
46
|
+
"@tsed/schema": "^6.102.8-rc.2",
|
|
45
47
|
"change-case": "^4.1.2",
|
|
46
48
|
"lodash": "^4.17.21"
|
|
47
49
|
},
|
|
@@ -49,7 +51,10 @@
|
|
|
49
51
|
"bugs": {
|
|
50
52
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
51
53
|
},
|
|
52
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
54
|
+
"homepage": "https://github.com/tsedio/tsed/tree/rc/packages/orm/adapters",
|
|
53
55
|
"author": "Romain Lenzotti",
|
|
54
|
-
"license": "MIT"
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"tag": "rc"
|
|
59
|
+
}
|
|
55
60
|
}
|
package/readme.md
CHANGED
|
@@ -29,60 +29,6 @@
|
|
|
29
29
|
|
|
30
30
|
A package of Ts.ED framework. See website: https://tsed.io/tutorials/adapters
|
|
31
31
|
|
|
32
|
-
## Feature
|
|
33
|
-
|
|
34
|
-
Currently, `@tsed/adapters` allows you:
|
|
35
|
-
|
|
36
|
-
- Create
|
|
37
|
-
|
|
38
|
-
## Installation
|
|
39
|
-
|
|
40
|
-
To begin, install the TypeORM module for TS.ED:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
npm install --save @tsed/oidc-provider
|
|
44
|
-
npm install --save oidc-provider
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Then import `@tsed/oidc-provider` in your Server:
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
import {Configuration} from "@tsed/common";
|
|
51
|
-
import "@tsed/oidc-provider"; // import typeorm ts.ed module
|
|
52
|
-
import {Accounts} from "../services/Accounts";
|
|
53
|
-
import {MemoryAdapter} from "../adapters/MemoryAdapter";
|
|
54
|
-
|
|
55
|
-
export const rootDir = __dirname;
|
|
56
|
-
|
|
57
|
-
@Configuration({
|
|
58
|
-
oidc: {
|
|
59
|
-
jwksPath: `${rootDir}/../keys/jwks.json`, // don't forget add this path to .gitignore
|
|
60
|
-
Adapter: MemoryAdapter,
|
|
61
|
-
Accounts: Accounts,
|
|
62
|
-
// Clients: Clients,
|
|
63
|
-
clients: [
|
|
64
|
-
{
|
|
65
|
-
client_id: "client_id",
|
|
66
|
-
client_secret: "client_secret",
|
|
67
|
-
redirect_uris: ["https://host.fr/"]
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
options: {
|
|
71
|
-
// Oidc-provider options See https://github.com/panva/node-oidc-provider/blob/master/docs/README.md
|
|
72
|
-
formats: {
|
|
73
|
-
AccessToken: "jwt"
|
|
74
|
-
},
|
|
75
|
-
features: {
|
|
76
|
-
encryption: {enabled: true},
|
|
77
|
-
introspection: {enabled: true},
|
|
78
|
-
revocation: {enabled: true}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
})
|
|
83
|
-
export class Server {}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
32
|
## Contributors
|
|
87
33
|
|
|
88
34
|
Please read [contributing guidelines here](https://tsed.io/CONTRIBUTING.html)
|