@merkaly/api 0.2.5-5 → 0.2.5-7
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/.output/abstracts/abstract.entity.d.ts +14 -0
- package/.output/{abstract → abstracts}/abstract.validator.d.ts +13 -9
- package/.output/{abstract → abstracts}/abstract.validator.js +36 -23
- package/.output/exceptions/missing-identity.exception.js +1 -1
- package/.output/modules/asset/files/file.entity.d.ts +1 -2
- package/.output/modules/{sale/orders/item/item.schema.d.ts → asset/files/file.schema.d.ts} +9 -2
- package/.output/modules/asset/files/file.schema.js +10 -0
- package/.output/modules/auth/organizations/organization.entity.d.ts +8 -0
- package/.output/modules/auth/users/user.entity.d.ts +9 -0
- package/.output/modules/{inventory/products/schemas/variant.schema.d.ts → auth/users/user.schema.d.ts} +9 -2
- package/.output/modules/auth/users/user.schema.js +10 -0
- package/.output/modules/auth/users/user.validator.d.ts +11 -9
- package/.output/modules/auth/users/user.validator.js +24 -16
- package/.output/modules/inventory/brands/brand.entity.d.ts +1 -4
- package/.output/modules/inventory/brands/brand.schema.d.ts +34 -0
- package/.output/modules/inventory/brands/brand.schema.js +10 -0
- package/.output/modules/inventory/brands/brand.validator.d.ts +1 -1
- package/.output/modules/inventory/brands/brand.validator.js +4 -5
- package/.output/modules/inventory/categories/category.entity.d.ts +2 -8
- package/.output/modules/inventory/categories/category.schema.d.ts +34 -0
- package/.output/modules/inventory/categories/category.schema.js +10 -0
- package/.output/modules/inventory/categories/category.validator.d.ts +2 -7
- package/.output/modules/inventory/categories/category.validator.js +4 -50
- package/.output/modules/inventory/complements/complement.entity.d.ts +6 -0
- package/.output/modules/inventory/complements/complement.validator.d.ts +10 -0
- package/.output/modules/inventory/{products/validators/variant.validator.js → complements/complement.validator.js} +27 -24
- package/.output/modules/inventory/products/documents/attribute.document.d.ts +5 -0
- package/.output/modules/{sale/orders/billing/validators/customer.validator.js → inventory/products/documents/attribute.document.js} +15 -18
- package/.output/modules/inventory/products/{entities/dimension.entity.d.ts → documents/dimension.document.d.ts} +1 -1
- package/.output/modules/inventory/products/documents/dimension.document.js +35 -0
- package/.output/modules/inventory/products/product.entity.d.ts +11 -18
- package/.output/modules/inventory/products/product.schema.d.ts +34 -0
- package/.output/modules/inventory/products/product.schema.js +18 -0
- package/.output/modules/inventory/products/product.validator.d.ts +17 -26
- package/.output/modules/inventory/products/product.validator.js +76 -132
- package/.output/modules/inventory/products/validators/attributes.validator.d.ts +5 -0
- package/.output/modules/inventory/products/validators/{seo.validator.js → attributes.validator.js} +14 -13
- package/.output/modules/inventory/products/validators/dimension.validator.d.ts +5 -5
- package/.output/modules/inventory/products/validators/dimension.validator.js +16 -21
- package/.output/modules/sale/customers/customer.entity.d.ts +7 -11
- package/.output/modules/sale/customers/customer.schema.d.ts +34 -0
- package/.output/modules/sale/customers/customer.schema.js +10 -0
- package/.output/modules/sale/customers/customer.validator.d.ts +9 -13
- package/.output/modules/sale/customers/customer.validator.js +26 -39
- package/.output/modules/sale/orders/documents/address.document.d.ts +8 -0
- package/.output/modules/sale/orders/documents/address.document.js +43 -0
- package/.output/modules/sale/orders/documents/status.document.d.ts +8 -0
- package/.output/modules/sale/orders/{shipping/validators/customer.validator.js → documents/status.document.js} +17 -19
- package/.output/modules/sale/orders/entities/item.entity.d.ts +38 -0
- package/.output/modules/sale/orders/{status/status.validator.d.ts → enums/order.status.d.ts} +1 -3
- package/.output/modules/sale/orders/enums/order.status.js +10 -0
- package/.output/modules/sale/orders/order.entity.d.ts +16 -16
- package/.output/modules/sale/orders/order.validator.d.ts +11 -23
- package/.output/modules/sale/orders/order.validator.js +26 -80
- package/.output/modules/sale/orders/validators/address.validator.d.ts +17 -0
- package/.output/modules/sale/orders/validators/address.validator.js +81 -0
- package/.output/modules/sale/orders/validators/billing.validator.d.ts +8 -0
- package/.output/modules/sale/orders/validators/billing.validator.js +13 -0
- package/.output/modules/sale/orders/{item → validators}/item.validator.d.ts +2 -1
- package/.output/modules/sale/orders/{item → validators}/item.validator.js +11 -8
- package/.output/modules/sale/orders/validators/payment.validator.d.ts +10 -0
- package/.output/modules/sale/orders/validators/payment.validator.js +62 -0
- package/.output/modules/sale/orders/validators/shipping.validator.d.ts +9 -0
- package/.output/modules/sale/orders/validators/shipping.validator.js +14 -0
- package/.output/modules/sale/payments/entities/status.entity.d.ts +8 -0
- package/.output/modules/sale/payments/enums/billing.type.d.ts +6 -0
- package/.output/modules/sale/payments/enums/billing.type.js +10 -0
- package/.output/modules/sale/payments/enums/payment.status.d.ts +7 -0
- package/.output/modules/sale/payments/enums/payment.status.js +11 -0
- package/.output/modules/sale/payments/enums/shipping.type.d.ts +4 -0
- package/.output/modules/sale/payments/enums/shipping.type.js +8 -0
- package/.output/modules/sale/payments/payment.entity.d.ts +12 -0
- package/.output/modules/sale/payments/payment.schema.d.ts +34 -0
- package/.output/modules/sale/payments/payment.schema.js +14 -0
- package/.output/modules/sale/payments/payment.validator.d.ts +16 -0
- package/.output/modules/sale/payments/payment.validator.js +77 -0
- package/.output/tsconfig.package.tsbuildinfo +1 -0
- package/package.json +69 -78
- package/.output/abstract/abstract.entity.d.ts +0 -9
- package/.output/abstract/abstract.exception.d.ts +0 -11
- package/.output/abstract/abstract.exception.js +0 -53
- package/.output/abstract/abstract.fixture.d.ts +0 -4
- package/.output/abstract/abstract.fixture.js +0 -11
- package/.output/exceptions/store-not-implemented.exception.d.ts +0 -5
- package/.output/exceptions/store-not-implemented.exception.js +0 -31
- package/.output/exceptions/store-not-recognized.exception.d.ts +0 -5
- package/.output/exceptions/store-not-recognized.exception.js +0 -30
- package/.output/modules/auth/auth.types.d.ts +0 -3
- package/.output/modules/auth/auth.types.js +0 -7
- package/.output/modules/config/organization/organization.entity.d.ts +0 -21
- package/.output/modules/config/organization/organization.types.d.ts +0 -23
- package/.output/modules/config/organization/organization.types.js +0 -107
- package/.output/modules/config/organization/organization.validator.d.ts +0 -18
- package/.output/modules/config/organization/organization.validator.js +0 -88
- package/.output/modules/insight/validators/order.validator.d.ts +0 -4
- package/.output/modules/insight/validators/order.validator.js +0 -27
- package/.output/modules/inventory/brands/brand.exception.d.ts +0 -5
- package/.output/modules/inventory/brands/brand.exception.js +0 -40
- package/.output/modules/inventory/categories/category.exception.d.ts +0 -5
- package/.output/modules/inventory/categories/category.exception.js +0 -40
- package/.output/modules/inventory/categories/category.fixture.d.ts +0 -5
- package/.output/modules/inventory/categories/category.fixture.js +0 -38
- package/.output/modules/inventory/products/entities/code.entity.d.ts +0 -5
- package/.output/modules/inventory/products/entities/seo.entity.d.ts +0 -5
- package/.output/modules/inventory/products/entities/variant.entity.d.ts +0 -13
- package/.output/modules/inventory/products/product.exception.d.ts +0 -5
- package/.output/modules/inventory/products/product.exception.js +0 -40
- package/.output/modules/inventory/products/product.fixture.d.ts +0 -5
- package/.output/modules/inventory/products/product.fixture.js +0 -39
- package/.output/modules/inventory/products/schemas/variant.schema.js +0 -6
- package/.output/modules/inventory/products/validators/code.validator.d.ts +0 -5
- package/.output/modules/inventory/products/validators/code.validator.js +0 -37
- package/.output/modules/inventory/products/validators/seo.validator.d.ts +0 -5
- package/.output/modules/inventory/products/validators/variant.validator.d.ts +0 -10
- package/.output/modules/inventory/properties/property.entity.d.ts +0 -8
- package/.output/modules/inventory/properties/property.exception.d.ts +0 -5
- package/.output/modules/inventory/properties/property.exception.js +0 -40
- package/.output/modules/inventory/properties/property.types.d.ts +0 -6
- package/.output/modules/inventory/properties/property.types.js +0 -10
- package/.output/modules/inventory/properties/property.validator.d.ts +0 -12
- package/.output/modules/inventory/properties/property.validator.js +0 -79
- package/.output/modules/layout/pages/page.entity.d.ts +0 -8
- package/.output/modules/layout/pages/page.fixture.d.ts +0 -5
- package/.output/modules/layout/pages/page.fixture.js +0 -36
- package/.output/modules/layout/pages/page.types.d.ts +0 -20
- package/.output/modules/layout/pages/page.types.js +0 -2
- package/.output/modules/layout/pages/page.validator.d.ts +0 -8
- package/.output/modules/layout/pages/page.validator.js +0 -61
- package/.output/modules/sale/customers/customer.exception.d.ts +0 -5
- package/.output/modules/sale/customers/customer.exception.js +0 -40
- package/.output/modules/sale/orders/billing/billing.entity.d.ts +0 -10
- package/.output/modules/sale/orders/billing/billing.types.d.ts +0 -9
- package/.output/modules/sale/orders/billing/billing.types.js +0 -14
- package/.output/modules/sale/orders/billing/billing.validator.d.ts +0 -9
- package/.output/modules/sale/orders/billing/billing.validator.js +0 -42
- package/.output/modules/sale/orders/billing/entities/address.entity.d.ts +0 -10
- package/.output/modules/sale/orders/billing/entities/customer.entity.d.ts +0 -5
- package/.output/modules/sale/orders/billing/entities/status.entity.d.ts +0 -6
- package/.output/modules/sale/orders/billing/validators/address.validator.d.ts +0 -10
- package/.output/modules/sale/orders/billing/validators/address.validator.js +0 -56
- package/.output/modules/sale/orders/billing/validators/customer.validator.d.ts +0 -5
- package/.output/modules/sale/orders/customer/customer.entity.d.ts +0 -5
- package/.output/modules/sale/orders/customer/customer.validator.d.ts +0 -5
- package/.output/modules/sale/orders/customer/customer.validator.js +0 -36
- package/.output/modules/sale/orders/item/item.entity.d.ts +0 -9
- package/.output/modules/sale/orders/item/item.schema.js +0 -9
- package/.output/modules/sale/orders/order.exception.d.ts +0 -13
- package/.output/modules/sale/orders/order.exception.js +0 -46
- package/.output/modules/sale/orders/shipping/entities/address.entity.d.ts +0 -10
- package/.output/modules/sale/orders/shipping/entities/customer.entity.d.ts +0 -5
- package/.output/modules/sale/orders/shipping/entities/status.entity.d.ts +0 -6
- package/.output/modules/sale/orders/shipping/shipping.entity.d.ts +0 -11
- package/.output/modules/sale/orders/shipping/shipping.types.d.ts +0 -11
- package/.output/modules/sale/orders/shipping/shipping.types.js +0 -16
- package/.output/modules/sale/orders/shipping/shipping.validator.d.ts +0 -10
- package/.output/modules/sale/orders/shipping/shipping.validator.js +0 -48
- package/.output/modules/sale/orders/shipping/validators/address.validator.d.ts +0 -10
- package/.output/modules/sale/orders/shipping/validators/address.validator.js +0 -56
- package/.output/modules/sale/orders/shipping/validators/customer.validator.d.ts +0 -5
- package/.output/modules/sale/orders/status/status.entity.d.ts +0 -6
- package/.output/modules/sale/orders/status/status.validator.js +0 -12
- package/.output/services/logger.service.d.ts +0 -11
- package/.output/services/logger.service.js +0 -50
- package/.output/types.d.ts +0 -18
- package/.output/types.js +0 -2
- package/LICENSE +0 -674
package/package.json
CHANGED
|
@@ -1,105 +1,96 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkaly/api",
|
|
3
|
-
"version": "0.2.5-
|
|
4
|
-
"
|
|
3
|
+
"version": "0.2.5-7",
|
|
4
|
+
"files": [
|
|
5
|
+
".output"
|
|
6
|
+
],
|
|
5
7
|
"repository": {
|
|
6
8
|
"type": "git",
|
|
7
9
|
"url": "https://github.com/merkaly-io/api.git"
|
|
8
10
|
},
|
|
9
11
|
"license": "UNLICENSED",
|
|
10
|
-
"author": "Randy Tellez Galan <kronhyx@gmail.com>",
|
|
11
|
-
"main": "./.output/main",
|
|
12
|
-
"types": "./.output/types.d.ts",
|
|
13
|
-
"files": [
|
|
14
|
-
".output"
|
|
15
|
-
],
|
|
16
12
|
"scripts": {
|
|
17
|
-
"prebuild": "yarn run clean",
|
|
18
13
|
"build": "nest build",
|
|
19
14
|
"clean": "tsc -b --clean",
|
|
20
15
|
"console": "yarn clean && ts-node -r tsconfig-paths/register ./src/app.console.ts",
|
|
21
|
-
"dev": "
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"prepack": ".bin/package.sh",
|
|
16
|
+
"dev": "nest start --watch",
|
|
17
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
18
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
25
19
|
"postpack": "yarn run clean",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"start
|
|
20
|
+
"prebuild": "yarn run clean",
|
|
21
|
+
"prepack": ".bin/package.sh",
|
|
22
|
+
"start": "node dist/src/main",
|
|
29
23
|
"test": "jest",
|
|
30
|
-
"test:cov": "
|
|
24
|
+
"test:cov": "jest --coverage",
|
|
31
25
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
32
|
-
"test:
|
|
33
|
-
|
|
34
|
-
"lint-staged": {
|
|
35
|
-
"*.**": "yarn lint --cache --fix"
|
|
26
|
+
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
27
|
+
"test:watch": "jest --watch"
|
|
36
28
|
},
|
|
37
29
|
"dependencies": {
|
|
38
|
-
"
|
|
39
|
-
"@nestjs/swagger": "^6.1.0",
|
|
40
|
-
"@types/auth0": "^3.3.1",
|
|
30
|
+
"auth0": "^4.2.0",
|
|
41
31
|
"class-transformer": "^0.5.1",
|
|
42
32
|
"class-validator": "^0.14.0",
|
|
43
|
-
"mongoose": "^
|
|
44
|
-
"reflect-metadata": "^0.1.
|
|
33
|
+
"mongoose": "^7.5.3",
|
|
34
|
+
"reflect-metadata": "^0.1.14"
|
|
45
35
|
},
|
|
46
36
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@nestjs/
|
|
51
|
-
"@nestjs/
|
|
52
|
-
"@nestjs/
|
|
53
|
-
"@nestjs/
|
|
54
|
-
"@nestjs/
|
|
55
|
-
"@nestjs/
|
|
56
|
-
"@nestjs/
|
|
57
|
-
"@nestjs/
|
|
58
|
-
"@nestjs/
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"@types/
|
|
64
|
-
"@types/
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"commitlint": "^17.0.1",
|
|
77
|
-
"eslint": "7.32.0",
|
|
78
|
-
"eslint-plugin-import": "^2.23.4",
|
|
79
|
-
"express": "^4.17.3",
|
|
80
|
-
"husky": "^8.0.1",
|
|
81
|
-
"jest": "27.5.1",
|
|
82
|
-
"lint-staged": "^13.0.3",
|
|
83
|
-
"migrate-mongoose": "^4.0.0",
|
|
84
|
-
"nestjs-console": "^8.0.0",
|
|
37
|
+
"@faker-js/faker": "^8.3.1",
|
|
38
|
+
"@nestjs/cli": "^10.2.1",
|
|
39
|
+
"@nestjs/common": "^9.0.0",
|
|
40
|
+
"@nestjs/config": "^3.1.1",
|
|
41
|
+
"@nestjs/core": "^9.0.0",
|
|
42
|
+
"@nestjs/jwt": "^10.2.0",
|
|
43
|
+
"@nestjs/mongoose": "^10.0.1",
|
|
44
|
+
"@nestjs/passport": "^10.0.3",
|
|
45
|
+
"@nestjs/platform-express": "^9.0.0",
|
|
46
|
+
"@nestjs/schematics": "^10.0.3",
|
|
47
|
+
"@nestjs/swagger": "^7.1.16",
|
|
48
|
+
"@nestjs/testing": "^9.0.0",
|
|
49
|
+
"@types/express": "^4.17.21",
|
|
50
|
+
"@types/jest": "29.5.11",
|
|
51
|
+
"@types/multer": "^1.4.11",
|
|
52
|
+
"@types/node": "20.10.3",
|
|
53
|
+
"@types/passport-jwt": "^3.0.13",
|
|
54
|
+
"@types/supertest": "^2.0.16",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
56
|
+
"@typescript-eslint/parser": "^5.0.0",
|
|
57
|
+
"class-transformer": "^0.5.1",
|
|
58
|
+
"class-validator": "^0.14.0",
|
|
59
|
+
"dotenv": "^16.3.1",
|
|
60
|
+
"eslint": "^8.56.0",
|
|
61
|
+
"eslint-config-prettier": "^8.3.0",
|
|
62
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
63
|
+
"jest": "29.7.0",
|
|
64
|
+
"mongoose": "^7.5.3",
|
|
65
|
+
"nestjs-console": "^9.0.0",
|
|
85
66
|
"passport": "^0.6.0",
|
|
86
|
-
"passport-jwt": "^4.0.
|
|
87
|
-
"
|
|
67
|
+
"passport-jwt": "^4.0.1",
|
|
68
|
+
"prettier": "^2.3.2",
|
|
69
|
+
"reflect-metadata": "^0.1.14",
|
|
88
70
|
"rxjs": "^7.2.0",
|
|
89
|
-
"
|
|
71
|
+
"source-map-support": "^0.5.20",
|
|
90
72
|
"supertest": "^6.1.3",
|
|
91
|
-
"
|
|
92
|
-
"ts-
|
|
93
|
-
"ts-loader": "^9.2.3",
|
|
73
|
+
"ts-jest": "29.1.1",
|
|
74
|
+
"ts-loader": "^9.5.1",
|
|
94
75
|
"ts-node": "^10.0.0",
|
|
95
|
-
"tsconfig-paths": "
|
|
96
|
-
"typescript": "
|
|
97
|
-
"webpack": "^5"
|
|
98
|
-
},
|
|
99
|
-
"publishConfig": {
|
|
100
|
-
"access": "public"
|
|
76
|
+
"tsconfig-paths": "4.2.0",
|
|
77
|
+
"typescript": "<5.2.0"
|
|
101
78
|
},
|
|
102
|
-
"
|
|
103
|
-
"
|
|
79
|
+
"jest": {
|
|
80
|
+
"moduleFileExtensions": [
|
|
81
|
+
"js",
|
|
82
|
+
"json",
|
|
83
|
+
"ts"
|
|
84
|
+
],
|
|
85
|
+
"rootDir": "src",
|
|
86
|
+
"testRegex": ".*\\.spec\\.ts$",
|
|
87
|
+
"transform": {
|
|
88
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
89
|
+
},
|
|
90
|
+
"collectCoverageFrom": [
|
|
91
|
+
"**/*.(t|j)s"
|
|
92
|
+
],
|
|
93
|
+
"coverageDirectory": "../coverage",
|
|
94
|
+
"testEnvironment": "node"
|
|
104
95
|
}
|
|
105
96
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ArgumentsHost, ExceptionFilter, HttpException } from '@nestjs/common';
|
|
2
|
-
import { Request, Response } from 'express';
|
|
3
|
-
import { LoggerService } from '../services/logger.service';
|
|
4
|
-
export declare abstract class AbstractException implements ExceptionFilter {
|
|
5
|
-
protected readonly $logger: LoggerService;
|
|
6
|
-
protected request: Request;
|
|
7
|
-
protected response: Response;
|
|
8
|
-
protected host: ArgumentsHost;
|
|
9
|
-
catch(exception: HttpException, host: ArgumentsHost): Response<any, Record<string, any>>;
|
|
10
|
-
protected abstract handleError(exception: HttpException): HttpException;
|
|
11
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AbstractException = void 0;
|
|
13
|
-
var common_1 = require("@nestjs/common");
|
|
14
|
-
var logger_service_1 = require("../services/logger.service");
|
|
15
|
-
var AbstractException = (function () {
|
|
16
|
-
function AbstractException() {
|
|
17
|
-
}
|
|
18
|
-
AbstractException.prototype.catch = function (exception, host) {
|
|
19
|
-
this.host = host;
|
|
20
|
-
var ctx = this.host.switchToHttp();
|
|
21
|
-
this.response = ctx.getResponse();
|
|
22
|
-
this.request = ctx.getRequest();
|
|
23
|
-
this.$logger.error(exception);
|
|
24
|
-
var handledError = this.handleError(exception);
|
|
25
|
-
if (handledError instanceof common_1.HttpException) {
|
|
26
|
-
var trace = exception.getResponse().message;
|
|
27
|
-
this.response.statusMessage = handledError.name
|
|
28
|
-
.slice(0, -9)
|
|
29
|
-
.replace(/([A-Z])/g, ' $1')
|
|
30
|
-
.trim();
|
|
31
|
-
return this.response
|
|
32
|
-
.status(handledError.getStatus())
|
|
33
|
-
.json({
|
|
34
|
-
statusCode: handledError.getStatus(),
|
|
35
|
-
message: handledError.message,
|
|
36
|
-
error: this.response.statusMessage,
|
|
37
|
-
trace: trace,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return this.response
|
|
41
|
-
.status(500)
|
|
42
|
-
.json(new common_1.InternalServerErrorException(handledError));
|
|
43
|
-
};
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, common_1.Inject)(),
|
|
46
|
-
__metadata("design:type", logger_service_1.LoggerService)
|
|
47
|
-
], AbstractException.prototype, "$logger", void 0);
|
|
48
|
-
AbstractException = __decorate([
|
|
49
|
-
(0, common_1.Injectable)()
|
|
50
|
-
], AbstractException);
|
|
51
|
-
return AbstractException;
|
|
52
|
-
}());
|
|
53
|
-
exports.AbstractException = AbstractException;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AbstractFixture = void 0;
|
|
4
|
-
var faker_1 = require("@faker-js/faker");
|
|
5
|
-
var AbstractFixture = (function () {
|
|
6
|
-
function AbstractFixture() {
|
|
7
|
-
this.$faker = faker_1.faker;
|
|
8
|
-
}
|
|
9
|
-
return AbstractFixture;
|
|
10
|
-
}());
|
|
11
|
-
exports.AbstractFixture = AbstractFixture;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.StoreNotImplementedException = void 0;
|
|
19
|
-
var common_1 = require("@nestjs/common");
|
|
20
|
-
var StoreNotImplementedException = (function (_super) {
|
|
21
|
-
__extends(StoreNotImplementedException, _super);
|
|
22
|
-
function StoreNotImplementedException(identity) {
|
|
23
|
-
return _super.call(this, "No store found by that id or name: [" + identity + "]") || this;
|
|
24
|
-
}
|
|
25
|
-
StoreNotImplementedException.throw = function (identity) {
|
|
26
|
-
common_1.Logger.warn('Store not found or implemented', identity);
|
|
27
|
-
throw new StoreNotImplementedException(identity);
|
|
28
|
-
};
|
|
29
|
-
return StoreNotImplementedException;
|
|
30
|
-
}(common_1.NotFoundException));
|
|
31
|
-
exports.StoreNotImplementedException = StoreNotImplementedException;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.StoreNotRecognizedException = void 0;
|
|
19
|
-
var not_acceptable_exception_1 = require("@nestjs/common/exceptions/not-acceptable.exception");
|
|
20
|
-
var StoreNotRecognizedException = (function (_super) {
|
|
21
|
-
__extends(StoreNotRecognizedException, _super);
|
|
22
|
-
function StoreNotRecognizedException() {
|
|
23
|
-
return _super.call(this, "The store could not be accepted") || this;
|
|
24
|
-
}
|
|
25
|
-
StoreNotRecognizedException.throw = function () {
|
|
26
|
-
throw new StoreNotRecognizedException();
|
|
27
|
-
};
|
|
28
|
-
return StoreNotRecognizedException;
|
|
29
|
-
}(not_acceptable_exception_1.NotAcceptableException));
|
|
30
|
-
exports.StoreNotRecognizedException = StoreNotRecognizedException;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
2
|
-
import { OrganizationMetadataAddress, OrganizationMetadataInformation, OrganizationMetadataLocalization, OrganizationMetadataSocial } from "./organization.types";
|
|
3
|
-
import { Organization } from 'auth0';
|
|
4
|
-
export interface OrganizationMetadata {
|
|
5
|
-
address?: OrganizationMetadataAddress;
|
|
6
|
-
domain: {
|
|
7
|
-
name: string;
|
|
8
|
-
forceRedirect?: boolean;
|
|
9
|
-
};
|
|
10
|
-
information?: OrganizationMetadataInformation;
|
|
11
|
-
localization?: OrganizationMetadataLocalization;
|
|
12
|
-
social?: OrganizationMetadataSocial[];
|
|
13
|
-
theme: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class OrganizationEntity extends AbstractEntity {
|
|
16
|
-
static readonly $index = "config_organization";
|
|
17
|
-
name: string;
|
|
18
|
-
display_name: string;
|
|
19
|
-
metadata: OrganizationMetadata;
|
|
20
|
-
branding: Organization['branding'];
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { MetaAddress } from '../../../types';
|
|
2
|
-
export declare class OrganizationMetadataInformation {
|
|
3
|
-
title: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
keywords: string[];
|
|
6
|
-
}
|
|
7
|
-
export declare class OrganizationMetadataLocalization {
|
|
8
|
-
language: string;
|
|
9
|
-
currency: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class OrganizationMetadataSocial {
|
|
12
|
-
name: string;
|
|
13
|
-
url: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class OrganizationMetadataAddress implements MetaAddress {
|
|
16
|
-
country: string;
|
|
17
|
-
code: string;
|
|
18
|
-
street: string;
|
|
19
|
-
number: string;
|
|
20
|
-
complement?: string;
|
|
21
|
-
city: string;
|
|
22
|
-
state: string;
|
|
23
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.OrganizationMetadataAddress = exports.OrganizationMetadataSocial = exports.OrganizationMetadataLocalization = exports.OrganizationMetadataInformation = void 0;
|
|
13
|
-
var class_validator_1 = require("class-validator");
|
|
14
|
-
var OrganizationMetadataInformation = (function () {
|
|
15
|
-
function OrganizationMetadataInformation() {
|
|
16
|
-
this.keywords = [];
|
|
17
|
-
}
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, class_validator_1.IsOptional)(),
|
|
20
|
-
(0, class_validator_1.IsString)(),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], OrganizationMetadataInformation.prototype, "title", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, class_validator_1.IsOptional)(),
|
|
25
|
-
(0, class_validator_1.IsString)(),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], OrganizationMetadataInformation.prototype, "description", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, class_validator_1.IsOptional)(),
|
|
30
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
31
|
-
__metadata("design:type", Array)
|
|
32
|
-
], OrganizationMetadataInformation.prototype, "keywords", void 0);
|
|
33
|
-
return OrganizationMetadataInformation;
|
|
34
|
-
}());
|
|
35
|
-
exports.OrganizationMetadataInformation = OrganizationMetadataInformation;
|
|
36
|
-
var OrganizationMetadataLocalization = (function () {
|
|
37
|
-
function OrganizationMetadataLocalization() {
|
|
38
|
-
}
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, class_validator_1.IsOptional)(),
|
|
41
|
-
(0, class_validator_1.IsString)(),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], OrganizationMetadataLocalization.prototype, "language", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, class_validator_1.IsOptional)(),
|
|
46
|
-
(0, class_validator_1.IsString)(),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], OrganizationMetadataLocalization.prototype, "currency", void 0);
|
|
49
|
-
return OrganizationMetadataLocalization;
|
|
50
|
-
}());
|
|
51
|
-
exports.OrganizationMetadataLocalization = OrganizationMetadataLocalization;
|
|
52
|
-
var OrganizationMetadataSocial = (function () {
|
|
53
|
-
function OrganizationMetadataSocial() {
|
|
54
|
-
}
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, class_validator_1.IsOptional)(),
|
|
57
|
-
(0, class_validator_1.IsString)(),
|
|
58
|
-
__metadata("design:type", String)
|
|
59
|
-
], OrganizationMetadataSocial.prototype, "name", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, class_validator_1.IsOptional)(),
|
|
62
|
-
(0, class_validator_1.IsUrl)(),
|
|
63
|
-
__metadata("design:type", String)
|
|
64
|
-
], OrganizationMetadataSocial.prototype, "url", void 0);
|
|
65
|
-
return OrganizationMetadataSocial;
|
|
66
|
-
}());
|
|
67
|
-
exports.OrganizationMetadataSocial = OrganizationMetadataSocial;
|
|
68
|
-
var OrganizationMetadataAddress = (function () {
|
|
69
|
-
function OrganizationMetadataAddress() {
|
|
70
|
-
}
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, class_validator_1.IsOptional)(),
|
|
73
|
-
__metadata("design:type", String)
|
|
74
|
-
], OrganizationMetadataAddress.prototype, "country", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
(0, class_validator_1.IsString)(),
|
|
77
|
-
(0, class_validator_1.IsOptional)(),
|
|
78
|
-
__metadata("design:type", String)
|
|
79
|
-
], OrganizationMetadataAddress.prototype, "code", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
(0, class_validator_1.IsString)(),
|
|
82
|
-
(0, class_validator_1.IsOptional)(),
|
|
83
|
-
__metadata("design:type", String)
|
|
84
|
-
], OrganizationMetadataAddress.prototype, "street", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
(0, class_validator_1.IsString)(),
|
|
87
|
-
(0, class_validator_1.IsOptional)(),
|
|
88
|
-
__metadata("design:type", String)
|
|
89
|
-
], OrganizationMetadataAddress.prototype, "number", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
(0, class_validator_1.IsString)(),
|
|
92
|
-
(0, class_validator_1.IsOptional)(),
|
|
93
|
-
__metadata("design:type", String)
|
|
94
|
-
], OrganizationMetadataAddress.prototype, "complement", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
(0, class_validator_1.IsOptional)(),
|
|
97
|
-
(0, class_validator_1.IsString)(),
|
|
98
|
-
__metadata("design:type", String)
|
|
99
|
-
], OrganizationMetadataAddress.prototype, "city", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
(0, class_validator_1.IsString)(),
|
|
102
|
-
(0, class_validator_1.IsOptional)(),
|
|
103
|
-
__metadata("design:type", String)
|
|
104
|
-
], OrganizationMetadataAddress.prototype, "state", void 0);
|
|
105
|
-
return OrganizationMetadataAddress;
|
|
106
|
-
}());
|
|
107
|
-
exports.OrganizationMetadataAddress = OrganizationMetadataAddress;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CreateOrganization, UpdateOrganization } from 'auth0';
|
|
2
|
-
import { OrganizationMetadataAddress, OrganizationMetadataInformation, OrganizationMetadataLocalization, OrganizationMetadataSocial } from './organization.types';
|
|
3
|
-
export declare class OrganizationMetadataValidator {
|
|
4
|
-
information?: OrganizationMetadataInformation;
|
|
5
|
-
localization?: OrganizationMetadataLocalization;
|
|
6
|
-
address?: OrganizationMetadataAddress;
|
|
7
|
-
social?: OrganizationMetadataSocial[];
|
|
8
|
-
}
|
|
9
|
-
export declare class CreateOrganizationValidator implements CreateOrganization {
|
|
10
|
-
name: string;
|
|
11
|
-
email: string;
|
|
12
|
-
password?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class UpdateOrganizationValidator implements UpdateOrganization {
|
|
15
|
-
display_name?: string;
|
|
16
|
-
branding?: UpdateOrganization['branding'];
|
|
17
|
-
metadata: OrganizationMetadataValidator;
|
|
18
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UpdateOrganizationValidator = exports.CreateOrganizationValidator = exports.OrganizationMetadataValidator = void 0;
|
|
13
|
-
var class_transformer_1 = require("class-transformer");
|
|
14
|
-
var class_validator_1 = require("class-validator");
|
|
15
|
-
var organization_types_1 = require("./organization.types");
|
|
16
|
-
var OrganizationMetadataValidator = (function () {
|
|
17
|
-
function OrganizationMetadataValidator() {
|
|
18
|
-
}
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, class_validator_1.IsOptional)(),
|
|
21
|
-
(0, class_validator_1.ValidateNested)(),
|
|
22
|
-
(0, class_transformer_1.Type)(function () { return organization_types_1.OrganizationMetadataInformation; }),
|
|
23
|
-
__metadata("design:type", organization_types_1.OrganizationMetadataInformation)
|
|
24
|
-
], OrganizationMetadataValidator.prototype, "information", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, class_validator_1.IsOptional)(),
|
|
27
|
-
(0, class_validator_1.ValidateNested)(),
|
|
28
|
-
(0, class_transformer_1.Type)(function () { return organization_types_1.OrganizationMetadataLocalization; }),
|
|
29
|
-
__metadata("design:type", organization_types_1.OrganizationMetadataLocalization)
|
|
30
|
-
], OrganizationMetadataValidator.prototype, "localization", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, class_validator_1.IsOptional)(),
|
|
33
|
-
(0, class_validator_1.ValidateNested)(),
|
|
34
|
-
(0, class_transformer_1.Type)(function () { return organization_types_1.OrganizationMetadataAddress; }),
|
|
35
|
-
__metadata("design:type", organization_types_1.OrganizationMetadataAddress)
|
|
36
|
-
], OrganizationMetadataValidator.prototype, "address", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, class_validator_1.IsOptional)(),
|
|
39
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
40
|
-
(0, class_transformer_1.Type)(function () { return organization_types_1.OrganizationMetadataSocial; }),
|
|
41
|
-
__metadata("design:type", Array)
|
|
42
|
-
], OrganizationMetadataValidator.prototype, "social", void 0);
|
|
43
|
-
return OrganizationMetadataValidator;
|
|
44
|
-
}());
|
|
45
|
-
exports.OrganizationMetadataValidator = OrganizationMetadataValidator;
|
|
46
|
-
var CreateOrganizationValidator = (function () {
|
|
47
|
-
function CreateOrganizationValidator() {
|
|
48
|
-
}
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, class_validator_1.IsString)(),
|
|
51
|
-
(0, class_validator_1.Length)(3, 255),
|
|
52
|
-
__metadata("design:type", String)
|
|
53
|
-
], CreateOrganizationValidator.prototype, "name", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, class_validator_1.IsString)(),
|
|
56
|
-
(0, class_validator_1.IsEmail)(),
|
|
57
|
-
__metadata("design:type", String)
|
|
58
|
-
], CreateOrganizationValidator.prototype, "email", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, class_validator_1.IsString)(),
|
|
61
|
-
__metadata("design:type", String)
|
|
62
|
-
], CreateOrganizationValidator.prototype, "password", void 0);
|
|
63
|
-
return CreateOrganizationValidator;
|
|
64
|
-
}());
|
|
65
|
-
exports.CreateOrganizationValidator = CreateOrganizationValidator;
|
|
66
|
-
var UpdateOrganizationValidator = (function () {
|
|
67
|
-
function UpdateOrganizationValidator() {
|
|
68
|
-
}
|
|
69
|
-
__decorate([
|
|
70
|
-
(0, class_validator_1.IsString)(),
|
|
71
|
-
(0, class_validator_1.IsOptional)(),
|
|
72
|
-
(0, class_validator_1.Length)(3, 255),
|
|
73
|
-
__metadata("design:type", String)
|
|
74
|
-
], UpdateOrganizationValidator.prototype, "display_name", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
(0, class_validator_1.IsOptional)(),
|
|
77
|
-
(0, class_validator_1.IsObject)(),
|
|
78
|
-
__metadata("design:type", Object)
|
|
79
|
-
], UpdateOrganizationValidator.prototype, "branding", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
(0, class_validator_1.IsOptional)(),
|
|
82
|
-
(0, class_validator_1.ValidateNested)(),
|
|
83
|
-
(0, class_transformer_1.Type)(function () { return OrganizationMetadataValidator; }),
|
|
84
|
-
__metadata("design:type", OrganizationMetadataValidator)
|
|
85
|
-
], UpdateOrganizationValidator.prototype, "metadata", void 0);
|
|
86
|
-
return UpdateOrganizationValidator;
|
|
87
|
-
}());
|
|
88
|
-
exports.UpdateOrganizationValidator = UpdateOrganizationValidator;
|