@darraghor/nest-backend-libs 1.5.0 → 1.9.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/dist/authz/RequestWithUser.d.ts +1 -0
- package/dist/core-config/CoreConfigurationService.d.ts +1 -0
- package/dist/core-config/CoreConfigurationService.js +9 -0
- package/dist/core-config/CoreConfigurationService.js.map +1 -1
- package/dist/core-config/CoreConfigurationVariables.d.ts +1 -0
- package/dist/core-config/CoreConfigurationVariables.js +1 -0
- package/dist/core-config/CoreConfigurationVariables.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/open-api-generation/api-client-templates/api-client-ts-config-template.json +13 -0
- package/dist/open-api-generation/api-client-templates/package-json-template.json +16 -0
- package/dist/open-api-generation/generate.sh +18 -0
- package/dist/organisation/entities/organisation.entity.d.ts +1 -0
- package/dist/organisation/entities/organisation.entity.js +14 -0
- package/dist/organisation/entities/organisation.entity.js.map +1 -1
- package/dist/person/entities/person.entity.d.ts +1 -0
- package/dist/person/entities/person.entity.js +17 -0
- package/dist/person/entities/person.entity.js.map +1 -1
- package/dist/root-app/SwaggerGen.js +1 -1
- package/dist/root-app/SwaggerGen.js.map +1 -1
- package/package.json +14 -11
|
@@ -8,6 +8,7 @@ export declare class CoreConfigurationService extends ValidatedConfigurationServ
|
|
|
8
8
|
get shouldUseNestCors(): boolean;
|
|
9
9
|
get webPort(): number;
|
|
10
10
|
get clientCorsUrl(): string;
|
|
11
|
+
get appTitle(): string;
|
|
11
12
|
get appEnvironmentSpecificUrl(): string;
|
|
12
13
|
get nodeEnv(): string;
|
|
13
14
|
}
|
|
@@ -36,6 +36,9 @@ let CoreConfigurationService = class CoreConfigurationService extends ValidatedC
|
|
|
36
36
|
get clientCorsUrl() {
|
|
37
37
|
return this.configService.get("core.clientCorsUrl");
|
|
38
38
|
}
|
|
39
|
+
get appTitle() {
|
|
40
|
+
return this.configService.get("core.appTitle");
|
|
41
|
+
}
|
|
39
42
|
get appEnvironmentSpecificUrl() {
|
|
40
43
|
return this.configService.get("core.appEnvironmentSpecificUrl");
|
|
41
44
|
}
|
|
@@ -73,6 +76,12 @@ __decorate([
|
|
|
73
76
|
__metadata("design:type", String),
|
|
74
77
|
__metadata("design:paramtypes", [])
|
|
75
78
|
], CoreConfigurationService.prototype, "clientCorsUrl", null);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, class_validator_1.IsDefined)(),
|
|
81
|
+
(0, class_validator_1.IsString)(),
|
|
82
|
+
__metadata("design:type", String),
|
|
83
|
+
__metadata("design:paramtypes", [])
|
|
84
|
+
], CoreConfigurationService.prototype, "appTitle", null);
|
|
76
85
|
__decorate([
|
|
77
86
|
(0, class_validator_1.IsDefined)(),
|
|
78
87
|
(0, class_validator_1.IsString)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreConfigurationService.js","sourceRoot":"","sources":["../../src/core-config/CoreConfigurationService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA6D;AAC7D,2CAA0C;AAC1C,2CAA6C;AAC7C,qDAAsE;AACtE,kGAA6F;AAG7F,IAAa,wBAAwB,GAArC,MAAa,wBAAyB,SAAQ,6DAA6B;IACvE,YAAoB,aAA4B;QAC5C,KAAK,EAAE,CAAC;QADQ,kBAAa,GAAb,aAAa,CAAe;IAEhD,CAAC;IAID,IAAI,qBAAqB;QACrB,OAAO,CACH,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,4BAA4B,CAAC;YAC5D,MAAM,CACT,CAAC;IACN,CAAC;IAID,IAAI,mCAAmC;QACnC,OAAO,CACH,IAAI,CAAC,aAAa,CAAC,GAAG,CAClB,0CAA0C,CAC7C,KAAK,MAAM,CACf,CAAC;IACN,CAAC;IAID,IAAI,iBAAiB;QACjB,OAAO,CACH,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,wBAAwB,CAAC,KAAK,MAAM,CACtE,CAAC;IACN,CAAC;IAID,IAAI,OAAO;QACP,OAAO,MAAM,CAAC,QAAQ,CAClB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAE,EAC/C,EAAE,CACL,CAAC;IACN,CAAC;IAID,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,oBAAoB,CAAE,CAAC;IACjE,CAAC;IAID,IAAI,yBAAyB;QACzB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CACzB,gCAAgC,CAClC,CAAC;IACP,CAAC;IAID,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAE,CAAC;IAC3D,CAAC;CACJ,CAAA;
|
|
1
|
+
{"version":3,"file":"CoreConfigurationService.js","sourceRoot":"","sources":["../../src/core-config/CoreConfigurationService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA6D;AAC7D,2CAA0C;AAC1C,2CAA6C;AAC7C,qDAAsE;AACtE,kGAA6F;AAG7F,IAAa,wBAAwB,GAArC,MAAa,wBAAyB,SAAQ,6DAA6B;IACvE,YAAoB,aAA4B;QAC5C,KAAK,EAAE,CAAC;QADQ,kBAAa,GAAb,aAAa,CAAe;IAEhD,CAAC;IAID,IAAI,qBAAqB;QACrB,OAAO,CACH,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,4BAA4B,CAAC;YAC5D,MAAM,CACT,CAAC;IACN,CAAC;IAID,IAAI,mCAAmC;QACnC,OAAO,CACH,IAAI,CAAC,aAAa,CAAC,GAAG,CAClB,0CAA0C,CAC7C,KAAK,MAAM,CACf,CAAC;IACN,CAAC;IAID,IAAI,iBAAiB;QACjB,OAAO,CACH,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,wBAAwB,CAAC,KAAK,MAAM,CACtE,CAAC;IACN,CAAC;IAID,IAAI,OAAO;QACP,OAAO,MAAM,CAAC,QAAQ,CAClB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAE,EAC/C,EAAE,CACL,CAAC;IACN,CAAC;IAID,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,oBAAoB,CAAE,CAAC;IACjE,CAAC;IAID,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,eAAe,CAAE,CAAC;IAC5D,CAAC;IAID,IAAI,yBAAyB;QACzB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CACzB,gCAAgC,CAClC,CAAC;IACP,CAAC;IAID,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAE,CAAC;IAC3D,CAAC;CACJ,CAAA;AA3DG;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,2BAAS,GAAE;;;qEAMX;AAID;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,2BAAS,GAAE;;;mFAOX;AAID;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,2BAAS,GAAE;;;iEAKX;AAID;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,uBAAK,GAAE;;;uDAMP;AAID;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;;6DAGV;AAID;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;;wDAGV;AAID;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;;yEAKV;AAID;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;;;uDAGV;AAjEQ,wBAAwB;IADpC,IAAA,mBAAU,GAAE;qCAE0B,sBAAa;GADvC,wBAAwB,CAkEpC;AAlEY,4DAAwB"}
|
|
@@ -7,5 +7,6 @@ declare const _default: (() => {
|
|
|
7
7
|
appEnvironmentSpecificUrl: string | undefined;
|
|
8
8
|
shouldUseNestCors: string | undefined;
|
|
9
9
|
shouldAutomaticallyInstallApiModels: string | undefined;
|
|
10
|
+
appTitle: string | undefined;
|
|
10
11
|
}) & import("@nestjs/config").ConfigFactoryKeyHost;
|
|
11
12
|
export default _default;
|
|
@@ -10,5 +10,6 @@ exports.default = (0, config_1.registerAs)("core", () => ({
|
|
|
10
10
|
appEnvironmentSpecificUrl: process.env.APP_ENVIRONMENT_SPECIFIC_URL,
|
|
11
11
|
shouldUseNestCors: process.env.ENABLE_NEST_CORS,
|
|
12
12
|
shouldAutomaticallyInstallApiModels: process.env.AUTO_INSTALL_API_MODELS,
|
|
13
|
+
appTitle: process.env.APP_TITLE,
|
|
13
14
|
}));
|
|
14
15
|
//# sourceMappingURL=CoreConfigurationVariables.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreConfigurationVariables.js","sourceRoot":"","sources":["../../src/core-config/CoreConfigurationVariables.ts"],"names":[],"mappings":";;AAAA,2CAA0C;AAE1C,kBAAe,IAAA,mBAAU,EAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW;IACnC,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;IACnD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ;IAC7B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ;IAC7B,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe;IAC1C,yBAAyB,EAAE,OAAO,CAAC,GAAG,CAAC,4BAA4B;IACnE,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;IAC/C,mCAAmC,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB;
|
|
1
|
+
{"version":3,"file":"CoreConfigurationVariables.js","sourceRoot":"","sources":["../../src/core-config/CoreConfigurationVariables.ts"],"names":[],"mappings":";;AAAA,2CAA0C;AAE1C,kBAAe,IAAA,mBAAU,EAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW;IACnC,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;IACnD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ;IAC7B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ;IAC7B,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe;IAC1C,yBAAyB,EAAE,OAAO,CAAC,GAAG,CAAC,4BAA4B;IACnE,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;IAC/C,mCAAmC,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB;IACxE,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS;CAClC,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import CoreLoggerService from "./logger/CoreLoggerService";
|
|
|
12
12
|
import { OrganisationModule } from "./organisation/organisation.module";
|
|
13
13
|
import { Person } from "./person/entities/person.entity";
|
|
14
14
|
import { PersonModule } from "./person/person.module";
|
|
15
|
+
import { PersonService } from "./person/person.service";
|
|
15
16
|
import { CoreModule } from "./root-app/core-app.module";
|
|
16
17
|
import { SwaggerGen } from "./root-app/SwaggerGen";
|
|
17
|
-
export { CoreLoggerService, CoreConfigurationService, EmailClientModule, CoreModule, SwaggerGen, DefaultAuthGuard, DatabaseModule, JwtStrategy, AuthzModule, Person, TypeOrmConfigurationProvider, EmailClient, ValidatedConfigurationService, RequestWithUser, PersonModule, OrganisationModule, };
|
|
18
|
+
export { CoreLoggerService, CoreConfigurationService, EmailClientModule, CoreModule, SwaggerGen, DefaultAuthGuard, DatabaseModule, JwtStrategy, AuthzModule, Person, TypeOrmConfigurationProvider, EmailClient, ValidatedConfigurationService, RequestWithUser, PersonModule, OrganisationModule, PersonService, };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.OrganisationModule = exports.PersonModule = exports.ValidatedConfigurationService = exports.EmailClient = exports.TypeOrmConfigurationProvider = exports.Person = exports.AuthzModule = exports.JwtStrategy = exports.DatabaseModule = exports.DefaultAuthGuard = exports.SwaggerGen = exports.CoreModule = exports.EmailClientModule = exports.CoreConfigurationService = exports.CoreLoggerService = void 0;
|
|
6
|
+
exports.PersonService = exports.OrganisationModule = exports.PersonModule = exports.ValidatedConfigurationService = exports.EmailClient = exports.TypeOrmConfigurationProvider = exports.Person = exports.AuthzModule = exports.JwtStrategy = exports.DatabaseModule = exports.DefaultAuthGuard = exports.SwaggerGen = exports.CoreModule = exports.EmailClientModule = exports.CoreConfigurationService = exports.CoreLoggerService = void 0;
|
|
7
7
|
const authz_module_1 = require("./authz/authz.module");
|
|
8
8
|
Object.defineProperty(exports, "AuthzModule", { enumerable: true, get: function () { return authz_module_1.AuthzModule; } });
|
|
9
9
|
const authzstrategy_1 = require("./authz/authzstrategy");
|
|
@@ -30,6 +30,8 @@ const person_entity_1 = require("./person/entities/person.entity");
|
|
|
30
30
|
Object.defineProperty(exports, "Person", { enumerable: true, get: function () { return person_entity_1.Person; } });
|
|
31
31
|
const person_module_1 = require("./person/person.module");
|
|
32
32
|
Object.defineProperty(exports, "PersonModule", { enumerable: true, get: function () { return person_module_1.PersonModule; } });
|
|
33
|
+
const person_service_1 = require("./person/person.service");
|
|
34
|
+
Object.defineProperty(exports, "PersonService", { enumerable: true, get: function () { return person_service_1.PersonService; } });
|
|
33
35
|
const core_app_module_1 = require("./root-app/core-app.module");
|
|
34
36
|
Object.defineProperty(exports, "CoreModule", { enumerable: true, get: function () { return core_app_module_1.CoreModule; } });
|
|
35
37
|
const SwaggerGen_1 = require("./root-app/SwaggerGen");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAiD;AA2B7C,4FA3BI,0BAAW,OA2BJ;AA1Bf,yDAAkD;AAyB9C,4FAzBI,2BAAW,OAyBJ;AAxBf,+DAA0D;AAsBtD,iGAtBI,mCAAgB,OAsBJ;AApBpB,iGAA4F;AA2BxF,8GA3BI,6DAA6B,OA2BJ;AA1BjC,qFAAgF;AAe5E,yGAfI,mDAAwB,OAeJ;AAd5B,gEAA0D;AAmBtD,+FAnBI,gCAAc,OAmBJ;AAlBlB,0FAAqF;AAsBjF,6GAtBI,2DAA4B,OAsBJ;AArBhC,4EAAqE;AAajE,kGAbI,uCAAiB,OAaJ;AAZrB,8EAAgE;AAqB5D,4FArBI,kCAAW,OAqBJ;AApBf,mFAA2D;AASvD,4BATG,2BAAiB,CASH;AARrB,4EAAsE;AAuBlE,mGAvBI,wCAAkB,OAuBJ;AAtBtB,mEAAuD;AAgBnD,uFAhBI,sBAAM,OAgBJ;AAfV,0DAAoD;AAoBhD,6FApBI,4BAAY,OAoBJ;AAnBhB,4DAAsD;AAqBlD,8FArBI,8BAAa,OAqBJ;AApBjB,gEAAsD;AAOlD,2FAPI,4BAAU,OAOJ;AANd,sDAAiD;AAO7C,2FAPI,uBAAU,OAOJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"declaration": true,
|
|
4
|
+
"target": "es2019",
|
|
5
|
+
"lib": ["es2019", "dom"],
|
|
6
|
+
"module": "esnext",
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"isolatedModules": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"typeRoots": ["node_modules/@types"]
|
|
11
|
+
},
|
|
12
|
+
"exclude": ["dist", "node_modules"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "shared-api-client",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "OpenAPI client for shared-api-client",
|
|
5
|
+
"author": "OpenAPI-Generator",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"typings": "./dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"prepare": "yarn build"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"typescript": "^3.6"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
rm -rf ../shared-api-client/src
|
|
3
|
+
rm -rf ../shared-api-client/dist
|
|
4
|
+
npx @openapitools/openapi-generator-cli generate -i ./open-api/swagger.json -g typescript-fetch -o ../shared-api-client --additional-properties=typescriptThreePlus=true,withInterfaces=true,npmName=shared-api-client,supportsES6=true,modelPropertyNaming=original,enumPropertyNaming=original
|
|
5
|
+
cp ./api-client-templates/api-client-ts-config-template.json ../shared-api-client/tsconfig.json
|
|
6
|
+
cp ./api-client-templates/package-json-template.json ../shared-api-client/package.json
|
|
7
|
+
cd ../shared-api-client
|
|
8
|
+
yarn
|
|
9
|
+
|
|
10
|
+
# install latest into the client
|
|
11
|
+
cd ../frontend
|
|
12
|
+
rm -rf ./node_modules/shared-api-client
|
|
13
|
+
yarn install --check-files
|
|
14
|
+
|
|
15
|
+
# install latest into the e2e tests
|
|
16
|
+
cd ../e2e-backend
|
|
17
|
+
rm -rf ./node_modules/shared-api-client
|
|
18
|
+
yarn install --check-files
|
|
@@ -15,6 +15,12 @@ const class_transformer_1 = require("class-transformer");
|
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const person_entity_1 = require("../../person/entities/person.entity");
|
|
17
17
|
let Organisation = class Organisation {
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
19
|
+
async nullChecks() {
|
|
20
|
+
if (!this.members) {
|
|
21
|
+
this.members = [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
18
24
|
};
|
|
19
25
|
__decorate([
|
|
20
26
|
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
@@ -73,6 +79,14 @@ __decorate([
|
|
|
73
79
|
(0, swagger_1.ApiProperty)(),
|
|
74
80
|
__metadata("design:type", Date)
|
|
75
81
|
], Organisation.prototype, "deletedDate", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, typeorm_1.AfterLoad)(),
|
|
84
|
+
(0, typeorm_1.AfterInsert)(),
|
|
85
|
+
(0, typeorm_1.AfterUpdate)(),
|
|
86
|
+
__metadata("design:type", Function),
|
|
87
|
+
__metadata("design:paramtypes", []),
|
|
88
|
+
__metadata("design:returntype", Promise)
|
|
89
|
+
], Organisation.prototype, "nullChecks", null);
|
|
76
90
|
Organisation = __decorate([
|
|
77
91
|
(0, typeorm_1.Entity)()
|
|
78
92
|
], Organisation);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisation.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/organisation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAC5C,yDAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"organisation.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/organisation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAC5C,yDAA0C;AAC1C,qCAiBiB;AACjB,uEAA2D;AAG3D,IAAa,YAAY,GAAzB,MAAa,YAAY;IAiDrB,4DAA4D;IAI5D,KAAK,CAAC,UAAU;QACZ,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACf,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;SACrB;IACL,CAAC;CACJ,CAAA;AAvDG;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,GAAE;;wCACF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,CA0DxB;AA1DY,oCAAY"}
|
|
@@ -15,6 +15,15 @@ const class_transformer_1 = require("class-transformer");
|
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const organisation_entity_1 = require("../../organisation/entities/organisation.entity");
|
|
17
17
|
let Person = class Person {
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
19
|
+
async nullChecks() {
|
|
20
|
+
if (!this.memberOfOrganisations) {
|
|
21
|
+
this.memberOfOrganisations = [];
|
|
22
|
+
}
|
|
23
|
+
if (!this.ownerOfOrganisations) {
|
|
24
|
+
this.ownerOfOrganisations = [];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
18
27
|
};
|
|
19
28
|
__decorate([
|
|
20
29
|
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
@@ -106,6 +115,14 @@ __decorate([
|
|
|
106
115
|
(0, swagger_1.ApiProperty)(),
|
|
107
116
|
__metadata("design:type", Date)
|
|
108
117
|
], Person.prototype, "deletedDate", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, typeorm_1.AfterLoad)(),
|
|
120
|
+
(0, typeorm_1.AfterInsert)(),
|
|
121
|
+
(0, typeorm_1.AfterUpdate)(),
|
|
122
|
+
__metadata("design:type", Function),
|
|
123
|
+
__metadata("design:paramtypes", []),
|
|
124
|
+
__metadata("design:returntype", Promise)
|
|
125
|
+
], Person.prototype, "nullChecks", null);
|
|
109
126
|
Person = __decorate([
|
|
110
127
|
(0, typeorm_1.Entity)()
|
|
111
128
|
], Person);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.entity.js","sourceRoot":"","sources":["../../../src/person/entities/person.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiE;AACjE,yDAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"person.entity.js","sourceRoot":"","sources":["../../../src/person/entities/person.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiE;AACjE,yDAA0C;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A,qBAAW,GAAE;IACb,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;;2CACD;AAIrB;IAFC,IAAA,6BAAmB,GAAE;IACrB,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;wCACP;AAOlB;IALC,IAAA,2BAAO,GAAE;IACT,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE;QAClD,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,SAAS;KACtB,CAAC;;qDACqC;AAMvC;IAJC,IAAA,2BAAO,GAAE;IACT,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE;QAC/C,OAAO,EAAE,IAAI;KAChB,CAAC;;oDACoC;AAItC;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;2CAAC;AAInB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;0CAAC;AAIlB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;2CAAC;AAMnB;IAHC,IAAA,mBAAS,GAAE;IACX,IAAA,qBAAW,GAAE;IACb,IAAA,qBAAW,GAAE;;;;wCAQb;AAtFQ,MAAM;IADlB,IAAA,gBAAM,GAAE;GACI,MAAM,CAuFlB;AAvFY,wBAAM"}
|
|
@@ -34,7 +34,7 @@ class SwaggerGen {
|
|
|
34
34
|
}
|
|
35
35
|
const config = new swagger_1.DocumentBuilder()
|
|
36
36
|
.addBearerAuth()
|
|
37
|
-
.setTitle(
|
|
37
|
+
.setTitle(this.config.appTitle)
|
|
38
38
|
.setDescription("Describes the backend api")
|
|
39
39
|
.build();
|
|
40
40
|
const document = swagger_1.SwaggerModule.createDocument(app, config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwaggerGen.js","sourceRoot":"","sources":["../../src/root-app/SwaggerGen.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,6CAA+D;AAC/D,4CAAoB;AAEpB,iDAAoC;AACpC,oFAA4D;AAC5D,0BAA4C;AAE5C,0BAA0B;AAG1B,IAAa,UAAU;AADvB,iFAAiF;AACjF,MAAa,UAAU;IACnB,YACY,MAAyB,EACzB,MAAgC;QADhC,WAAM,GAAN,MAAM,CAAmB;QACzB,WAAM,GAAN,MAAM,CAA0B;IACzC,CAAC;
|
|
1
|
+
{"version":3,"file":"SwaggerGen.js","sourceRoot":"","sources":["../../src/root-app/SwaggerGen.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,6CAA+D;AAC/D,4CAAoB;AAEpB,iDAAoC;AACpC,oFAA4D;AAC5D,0BAA4C;AAE5C,0BAA0B;AAG1B,IAAa,UAAU;AADvB,iFAAiF;AACjF,MAAa,UAAU;IACnB,YACY,MAAyB,EACzB,MAAgC;QADhC,WAAM,GAAN,MAAM,CAAmB;QACzB,WAAM,GAAN,MAAM,CAA0B;IACzC,CAAC;IAEG,QAAQ,CAAC,GAAqB,EAAE,UAAkB;QACrD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;YACpC,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,wDAAwD,CAC3D,CAAC;YACF,OAAO;SACV;QACD,MAAM,MAAM,GAAG,IAAI,yBAAe,EAAE;aAC/B,aAAa,EAAE;aACf,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;aAC9B,cAAc,CAAC,2BAA2B,CAAC;aAC3C,KAAK,EAAE,CAAC;QACb,MAAM,QAAQ,GAAG,uBAAa,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC3D,uBAAa,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAE9C,gDAAgD;QAChD,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,UAAU,EAAE,CAAC,CAAC;QAC1D,IAAI,IAAI,CAAC,MAAM,CAAC,mCAAmC,EAAE;YACjD,MAAM,cAAc,GAAG,IAAA,qBAAK,EAAC,eAAe,EAAE;gBAC1C,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;gBACtC,KAAK,EAAE,IAAI;aACd,CAAC,CAAC;YAEH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;gBAC3B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;SACN;IACL,CAAC;CACJ,CAAA;AAnCY,UAAU;IAFtB,IAAA,mBAAU,GAAE;IACb,iFAAiF;;qCAGzD,2BAAiB;QACjB,4BAAwB;GAHnC,UAAU,CAmCtB;AAnCY,gCAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darraghor/nest-backend-libs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Some helpers for personal projects",
|
|
5
5
|
"homepage": "https://github.com/darraghoriordan/nest-backend-libs",
|
|
6
6
|
"repository": {
|
|
@@ -28,15 +28,16 @@
|
|
|
28
28
|
"license": "ISC",
|
|
29
29
|
"scripts": {
|
|
30
30
|
"clean": "rm -Rf ./dist/",
|
|
31
|
-
"build:ci": "
|
|
32
|
-
"build": "
|
|
31
|
+
"build:ci": "yarn build",
|
|
32
|
+
"build": "yarn clean && mkdir ./dist && tsc --project tsconfig.build.json && yarn copyOpenApiGenerationModule",
|
|
33
33
|
"lint": "npx eslint -c .eslintrc.js --ext .ts './src/**/*.ts' './tests/**/*.ts' --no-error-on-unmatched-pattern",
|
|
34
34
|
"test": "export NODE_OPTIONS=\"--max-old-space-size=8192\" && npx jest --runInBand --color --reporters=default --no-cache --coverage=false --passWithNoTests",
|
|
35
35
|
"pre-commit": "npx lint-staged",
|
|
36
36
|
"prettier": "prettier --write src/*",
|
|
37
37
|
"prepare": "husky install",
|
|
38
38
|
"release": "npx semantic-release",
|
|
39
|
-
"semantic-release": "semantic-release"
|
|
39
|
+
"semantic-release": "semantic-release",
|
|
40
|
+
"copyOpenApiGenerationModule": "copyfiles --error --up 1 \"src/open-api-generation/**/*\" \"src/open-api-generation/*\" dist"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
43
|
"@nestjs/common": "^7.6.18",
|
|
@@ -47,10 +48,10 @@
|
|
|
47
48
|
"@nestjs/swagger": "^4.8.2",
|
|
48
49
|
"@nestjs/typeorm": "^7.1.5",
|
|
49
50
|
"auth0": "^2.36.1",
|
|
50
|
-
"dotenv": "^10.0.0",
|
|
51
51
|
"class-transformer": "0.4.0",
|
|
52
52
|
"class-validator": "0.13.1",
|
|
53
53
|
"date-fns": "^2.23.0",
|
|
54
|
+
"dotenv": "^10.0.0",
|
|
54
55
|
"jwks-rsa": "^2.0.4",
|
|
55
56
|
"nodemailer": "^6.6.3",
|
|
56
57
|
"passport": "^0.4.1",
|
|
@@ -61,27 +62,29 @@
|
|
|
61
62
|
"resource": "^0.8.1",
|
|
62
63
|
"rimraf": "^3.0.2",
|
|
63
64
|
"rxjs": "^7.3.0",
|
|
64
|
-
"tslog": "^3.2.1",
|
|
65
65
|
"swagger-ui-express": "^4.1.6",
|
|
66
|
+
"tslog": "^3.2.1",
|
|
66
67
|
"typeorm": "^0.2.37"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
|
-
"@darraghor/eslint-plugin-nestjs-typed": "3.2.0",
|
|
70
70
|
"@commitlint/cli": "12.1.1",
|
|
71
71
|
"@commitlint/config-conventional": "12.1.1",
|
|
72
|
-
"@
|
|
73
|
-
"@semantic-release/exec": "5.0.0",
|
|
72
|
+
"@darraghor/eslint-plugin-nestjs-typed": "3.2.0",
|
|
74
73
|
"@nestjs/cli": "^7.6.0",
|
|
75
74
|
"@nestjs/schematics": "^7.3.1",
|
|
75
|
+
"@semantic-release/changelog": "5.0.1",
|
|
76
|
+
"@semantic-release/exec": "5.0.0",
|
|
76
77
|
"@types/auth0": "^2.33.4",
|
|
77
78
|
"@types/express": "^4.17.13",
|
|
78
79
|
"@types/jest": "^26.0.24",
|
|
79
80
|
"@types/node": "16.11.6",
|
|
80
81
|
"@types/nodemailer": "^6.4.4",
|
|
81
82
|
"@types/passport-jwt": "^3.0.6",
|
|
83
|
+
"@types/rimraf": "^3.0.2",
|
|
82
84
|
"@types/supertest": "^2.0.11",
|
|
83
85
|
"@typescript-eslint/eslint-plugin": "5.2.0",
|
|
84
86
|
"@typescript-eslint/parser": "5.2.0",
|
|
87
|
+
"copyfiles": "2.4.1",
|
|
85
88
|
"eslint": "8.1.0",
|
|
86
89
|
"eslint-config-prettier": "8.3.0",
|
|
87
90
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
@@ -93,11 +96,11 @@
|
|
|
93
96
|
"eslint-plugin-sonarjs": "0.10.0",
|
|
94
97
|
"eslint-plugin-unicorn": "37.0.1",
|
|
95
98
|
"husky": "6.0.0",
|
|
96
|
-
"lint-staged": "11.0.0",
|
|
97
99
|
"jest": "^27.0.6",
|
|
98
|
-
"semantic-release": "17.4.3",
|
|
99
100
|
"jest-create-mock-instance": "^1.1.0",
|
|
101
|
+
"lint-staged": "11.0.0",
|
|
100
102
|
"prettier": "^2.3.2",
|
|
103
|
+
"semantic-release": "17.4.3",
|
|
101
104
|
"ts-jest": "^27.0.4",
|
|
102
105
|
"ts-loader": "^9.2.5",
|
|
103
106
|
"ts-node": "^10.2.0",
|