@valentine-efagene/qshelter-common 1.0.4 → 1.1.4
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/encryption/encryption.module.d.ts +2 -0
- package/dist/encryption/encryption.module.js +24 -0
- package/dist/encryption/encryption.module.js.map +1 -0
- package/dist/encryption/encryption.service.d.ts +17 -0
- package/dist/encryption/encryption.service.js +95 -0
- package/dist/encryption/encryption.service.js.map +1 -0
- package/dist/entities/amenity.entity.js +1 -0
- package/dist/entities/amenity.entity.js.map +1 -1
- package/dist/entities/common.entity.js +6 -5
- package/dist/entities/common.entity.js.map +1 -1
- package/dist/entities/contract-document.entity.d.ts +39 -0
- package/dist/entities/contract-document.entity.js +115 -0
- package/dist/entities/contract-document.entity.js.map +1 -0
- package/dist/entities/contract.entity.d.ts +62 -0
- package/dist/entities/contract.entity.js +191 -0
- package/dist/entities/contract.entity.js.map +1 -0
- package/dist/entities/device_endpoint.entity.d.ts +10 -0
- package/dist/entities/device_endpoint.entity.js +50 -0
- package/dist/entities/device_endpoint.entity.js.map +1 -0
- package/dist/entities/email_preference.entity.d.ts +6 -0
- package/dist/entities/email_preference.entity.js +45 -0
- package/dist/entities/email_preference.entity.js.map +1 -0
- package/dist/entities/index.d.ts +10 -0
- package/dist/entities/index.js +10 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/mortgage-document.entity.js +6 -6
- package/dist/entities/mortgage-document.entity.js.map +1 -1
- package/dist/entities/mortgage-downpayment-installment.entity.d.ts +2 -2
- package/dist/entities/mortgage-downpayment-installment.entity.js +15 -15
- package/dist/entities/mortgage-downpayment-installment.entity.js.map +1 -1
- package/dist/entities/mortgage-downpayment-payment.entity.js +8 -8
- package/dist/entities/mortgage-downpayment-payment.entity.js.map +1 -1
- package/dist/entities/mortgage-downpayment.entity.js +6 -6
- package/dist/entities/mortgage-downpayment.entity.js.map +1 -1
- package/dist/entities/mortgage-step.entity.js +6 -6
- package/dist/entities/mortgage-step.entity.js.map +1 -1
- package/dist/entities/mortgage-transition-event.entity.d.ts +26 -0
- package/dist/entities/mortgage-transition-event.entity.js +111 -0
- package/dist/entities/mortgage-transition-event.entity.js.map +1 -0
- package/dist/entities/mortgage-transition.entity.d.ts +25 -0
- package/dist/entities/mortgage-transition.entity.js +91 -0
- package/dist/entities/mortgage-transition.entity.js.map +1 -0
- package/dist/entities/mortgage-type.entity.js +6 -6
- package/dist/entities/mortgage-type.entity.js.map +1 -1
- package/dist/entities/password_reset_tokens.entity.js +2 -0
- package/dist/entities/password_reset_tokens.entity.js.map +1 -1
- package/dist/entities/payment-installment.entity.d.ts +39 -0
- package/dist/entities/payment-installment.entity.js +134 -0
- package/dist/entities/payment-installment.entity.js.map +1 -0
- package/dist/entities/payment-plan.entity.d.ts +62 -0
- package/dist/entities/payment-plan.entity.js +174 -0
- package/dist/entities/payment-plan.entity.js.map +1 -0
- package/dist/entities/payment-schedule.entity.d.ts +44 -0
- package/dist/entities/payment-schedule.entity.js +134 -0
- package/dist/entities/payment-schedule.entity.js.map +1 -0
- package/dist/entities/payment.entity.d.ts +55 -0
- package/dist/entities/payment.entity.js +157 -0
- package/dist/entities/payment.entity.js.map +1 -0
- package/dist/entities/permission.entity.js +1 -1
- package/dist/entities/permission.entity.js.map +1 -1
- package/dist/entities/property-document.entity.js +1 -1
- package/dist/entities/property-document.entity.js.map +1 -1
- package/dist/entities/property-media.entity.js +1 -0
- package/dist/entities/property-media.entity.js.map +1 -1
- package/dist/entities/property.entity.d.ts +5 -1
- package/dist/entities/property.entity.js +27 -10
- package/dist/entities/property.entity.js.map +1 -1
- package/dist/entities/refresh_token.entity.js +2 -2
- package/dist/entities/refresh_token.entity.js.map +1 -1
- package/dist/entities/role.entity.js +1 -1
- package/dist/entities/role.entity.js.map +1 -1
- package/dist/entities/settings.entity.js +9 -7
- package/dist/entities/settings.entity.js.map +1 -1
- package/dist/entities/social.entity.js +3 -1
- package/dist/entities/social.entity.js.map +1 -1
- package/dist/entities/tenant.entity.js +14 -14
- package/dist/entities/tenant.entity.js.map +1 -1
- package/dist/entities/transaction.entity.js +9 -6
- package/dist/entities/transaction.entity.js.map +1 -1
- package/dist/entities/user.entity.d.ts +2 -0
- package/dist/entities/user.entity.js +13 -7
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/entities/user_suspensions.entity.js +2 -0
- package/dist/entities/user_suspensions.entity.js.map +1 -1
- package/dist/entities/wallet.entity.js +2 -2
- package/dist/entities/wallet.entity.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/qr-code/qr-code.dto.d.ts +3 -0
- package/dist/qr-code/qr-code.dto.js +21 -0
- package/dist/qr-code/qr-code.dto.js.map +1 -0
- package/dist/qr-code/qr-code.module.d.ts +2 -0
- package/dist/qr-code/qr-code.module.js +24 -0
- package/dist/qr-code/qr-code.module.js.map +1 -0
- package/dist/qr-code/qr-code.service.d.ts +11 -0
- package/dist/qr-code/qr-code.service.js +99 -0
- package/dist/qr-code/qr-code.service.js.map +1 -0
- package/dist/qr-code/qr-code.type.d.ts +5 -0
- package/dist/qr-code/qr-code.type.js +3 -0
- package/dist/qr-code/qr-code.type.js.map +1 -0
- package/dist/services/notifications/src/common/common.entity.d.ts +6 -0
- package/dist/services/notifications/src/common/common.entity.js +37 -0
- package/dist/services/notifications/src/common/common.entity.js.map +1 -0
- package/dist/shared/common/OpenApiHelper.d.ts +9 -0
- package/dist/shared/common/OpenApiHelper.js +118 -0
- package/dist/shared/common/OpenApiHelper.js.map +1 -0
- package/dist/shared/common/decorator/index.d.ts +2 -0
- package/dist/shared/common/decorator/index.js +19 -0
- package/dist/shared/common/decorator/index.js.map +1 -0
- package/dist/shared/common/decorator/permission.decorator.d.ts +2 -0
- package/dist/shared/common/decorator/permission.decorator.js +6 -0
- package/dist/shared/common/decorator/permission.decorator.js.map +1 -0
- package/dist/shared/common/decorator/tenant.decorator.d.ts +2 -0
- package/dist/shared/common/decorator/tenant.decorator.js +13 -0
- package/dist/shared/common/decorator/tenant.decorator.js.map +1 -0
- package/dist/shared/common/entities/BaseEntity.d.ts +11 -0
- package/dist/shared/common/entities/BaseEntity.js +54 -0
- package/dist/shared/common/entities/BaseEntity.js.map +1 -0
- package/dist/shared/common/entities/TenantAwareEntity.d.ts +10 -0
- package/dist/shared/common/entities/TenantAwareEntity.js +52 -0
- package/dist/shared/common/entities/TenantAwareEntity.js.map +1 -0
- package/dist/shared/common/entities/TenantAwareRepository.d.ts +13 -0
- package/dist/shared/common/entities/TenantAwareRepository.js +65 -0
- package/dist/shared/common/entities/TenantAwareRepository.js.map +1 -0
- package/dist/shared/common/entities/amenity.entity.d.ts +4 -0
- package/dist/shared/common/entities/amenity.entity.js +28 -0
- package/dist/shared/common/entities/amenity.entity.js.map +1 -0
- package/dist/shared/common/entities/common.entity.d.ts +17 -0
- package/dist/shared/common/entities/common.entity.js +64 -0
- package/dist/shared/common/entities/common.entity.js.map +1 -0
- package/dist/shared/common/entities/common.pure.entity.d.ts +11 -0
- package/dist/shared/common/entities/common.pure.entity.js +52 -0
- package/dist/shared/common/entities/common.pure.entity.js.map +1 -0
- package/dist/shared/common/entities/contract-document.entity.d.ts +39 -0
- package/dist/shared/common/entities/contract-document.entity.js +115 -0
- package/dist/shared/common/entities/contract-document.entity.js.map +1 -0
- package/dist/shared/common/entities/contract.entity.d.ts +62 -0
- package/dist/shared/common/entities/contract.entity.js +191 -0
- package/dist/shared/common/entities/contract.entity.js.map +1 -0
- package/dist/shared/common/entities/device_endpoint.entity.d.ts +10 -0
- package/dist/shared/common/entities/device_endpoint.entity.js +50 -0
- package/dist/shared/common/entities/device_endpoint.entity.js.map +1 -0
- package/dist/shared/common/entities/email_preference.entity.d.ts +6 -0
- package/dist/shared/common/entities/email_preference.entity.js +42 -0
- package/dist/shared/common/entities/email_preference.entity.js.map +1 -0
- package/dist/shared/common/entities/index.d.ts +35 -0
- package/dist/shared/common/entities/index.js +52 -0
- package/dist/shared/common/entities/index.js.map +1 -0
- package/dist/shared/common/entities/mortgage-document.entity.d.ts +14 -0
- package/dist/shared/common/entities/mortgage-document.entity.js +58 -0
- package/dist/shared/common/entities/mortgage-document.entity.js.map +1 -0
- package/dist/shared/common/entities/mortgage-downpayment-installment.entity.d.ts +19 -0
- package/dist/shared/common/entities/mortgage-downpayment-installment.entity.js +63 -0
- package/dist/shared/common/entities/mortgage-downpayment-installment.entity.js.map +1 -0
- package/dist/shared/common/entities/mortgage-downpayment-payment.entity.d.ts +28 -0
- package/dist/shared/common/entities/mortgage-downpayment-payment.entity.js +84 -0
- package/dist/shared/common/entities/mortgage-downpayment-payment.entity.js.map +1 -0
- package/dist/shared/common/entities/mortgage-downpayment.entity.d.ts +22 -0
- package/dist/shared/common/entities/mortgage-downpayment.entity.js +66 -0
- package/dist/shared/common/entities/mortgage-downpayment.entity.js.map +1 -0
- package/dist/shared/common/entities/mortgage-step.entity.d.ts +12 -0
- package/dist/shared/common/entities/mortgage-step.entity.js +52 -0
- package/dist/shared/common/entities/mortgage-step.entity.js.map +1 -0
- package/dist/shared/common/entities/mortgage-transition-event.entity.d.ts +26 -0
- package/dist/shared/common/entities/mortgage-transition-event.entity.js +111 -0
- package/dist/shared/common/entities/mortgage-transition-event.entity.js.map +1 -0
- package/dist/shared/common/entities/mortgage-transition.entity.d.ts +25 -0
- package/dist/shared/common/entities/mortgage-transition.entity.js +91 -0
- package/dist/shared/common/entities/mortgage-transition.entity.js.map +1 -0
- package/dist/shared/common/entities/mortgage-type.entity.d.ts +10 -0
- package/dist/shared/common/entities/mortgage-type.entity.js +46 -0
- package/dist/shared/common/entities/mortgage-type.entity.js.map +1 -0
- package/dist/shared/common/entities/mortgage.entity.d.ts +37 -0
- package/dist/shared/common/entities/mortgage.entity.js +124 -0
- package/dist/shared/common/entities/mortgage.entity.js.map +1 -0
- package/dist/shared/common/entities/password_reset_tokens.entity.d.ts +7 -0
- package/dist/shared/common/entities/password_reset_tokens.entity.js +45 -0
- package/dist/shared/common/entities/password_reset_tokens.entity.js.map +1 -0
- package/dist/shared/common/entities/payment-installment.entity.d.ts +39 -0
- package/dist/shared/common/entities/payment-installment.entity.js +134 -0
- package/dist/shared/common/entities/payment-installment.entity.js.map +1 -0
- package/dist/shared/common/entities/payment-plan.entity.d.ts +62 -0
- package/dist/shared/common/entities/payment-plan.entity.js +174 -0
- package/dist/shared/common/entities/payment-plan.entity.js.map +1 -0
- package/dist/shared/common/entities/payment-schedule.entity.d.ts +44 -0
- package/dist/shared/common/entities/payment-schedule.entity.js +134 -0
- package/dist/shared/common/entities/payment-schedule.entity.js.map +1 -0
- package/dist/shared/common/entities/payment.entity.d.ts +55 -0
- package/dist/shared/common/entities/payment.entity.js +157 -0
- package/dist/shared/common/entities/payment.entity.js.map +1 -0
- package/dist/shared/common/entities/permission.entity.d.ts +6 -0
- package/dist/shared/common/entities/permission.entity.js +30 -0
- package/dist/shared/common/entities/permission.entity.js.map +1 -0
- package/dist/shared/common/entities/property-document.entity.d.ts +6 -0
- package/dist/shared/common/entities/property-document.entity.js +34 -0
- package/dist/shared/common/entities/property-document.entity.js.map +1 -0
- package/dist/shared/common/entities/property-media.entity.d.ts +6 -0
- package/dist/shared/common/entities/property-media.entity.js +37 -0
- package/dist/shared/common/entities/property-media.entity.js.map +1 -0
- package/dist/shared/common/entities/property.entity.d.ts +39 -0
- package/dist/shared/common/entities/property.entity.js +193 -0
- package/dist/shared/common/entities/property.entity.js.map +1 -0
- package/dist/shared/common/entities/refresh_token.entity.d.ts +7 -0
- package/dist/shared/common/entities/refresh_token.entity.js +35 -0
- package/dist/shared/common/entities/refresh_token.entity.js.map +1 -0
- package/dist/shared/common/entities/role.entity.d.ts +8 -0
- package/dist/shared/common/entities/role.entity.js +39 -0
- package/dist/shared/common/entities/role.entity.js.map +1 -0
- package/dist/shared/common/entities/settings.entity.d.ts +17 -0
- package/dist/shared/common/entities/settings.entity.js +81 -0
- package/dist/shared/common/entities/settings.entity.js.map +1 -0
- package/dist/shared/common/entities/social.entity.d.ts +8 -0
- package/dist/shared/common/entities/social.entity.js +48 -0
- package/dist/shared/common/entities/social.entity.js.map +1 -0
- package/dist/shared/common/entities/tenant.entity.d.ts +29 -0
- package/dist/shared/common/entities/tenant.entity.js +82 -0
- package/dist/shared/common/entities/tenant.entity.js.map +1 -0
- package/dist/shared/common/entities/transaction.entity.d.ts +17 -0
- package/dist/shared/common/entities/transaction.entity.js +87 -0
- package/dist/shared/common/entities/transaction.entity.js.map +1 -0
- package/dist/shared/common/entities/user.entity.d.ts +26 -0
- package/dist/shared/common/entities/user.entity.js +104 -0
- package/dist/shared/common/entities/user.entity.js.map +1 -0
- package/dist/shared/common/entities/user_suspensions.entity.d.ts +7 -0
- package/dist/shared/common/entities/user_suspensions.entity.js +44 -0
- package/dist/shared/common/entities/user_suspensions.entity.js.map +1 -0
- package/dist/shared/common/entities/wallet.entity.d.ts +17 -0
- package/dist/shared/common/entities/wallet.entity.js +79 -0
- package/dist/shared/common/entities/wallet.entity.js.map +1 -0
- package/dist/shared/common/guard/index.d.ts +2 -0
- package/dist/shared/common/guard/index.js +19 -0
- package/dist/shared/common/guard/index.js.map +1 -0
- package/dist/shared/common/guard/permission.guard.d.ts +10 -0
- package/dist/shared/common/guard/permission.guard.js +47 -0
- package/dist/shared/common/guard/permission.guard.js.map +1 -0
- package/dist/shared/common/guard/swagger-auth.guard.d.ts +1 -0
- package/dist/shared/common/guard/swagger-auth.guard.js +9 -0
- package/dist/shared/common/guard/swagger-auth.guard.js.map +1 -0
- package/dist/shared/common/helpers/ArrayHelper.d.ts +2 -0
- package/dist/shared/common/helpers/ArrayHelper.js +6 -0
- package/dist/shared/common/helpers/ArrayHelper.js.map +1 -0
- package/dist/shared/common/helpers/ConstantHelper.d.ts +36 -0
- package/dist/shared/common/helpers/ConstantHelper.js +90 -0
- package/dist/shared/common/helpers/ConstantHelper.js.map +1 -0
- package/dist/shared/common/helpers/CustomNamingStrategy.d.ts +7 -0
- package/dist/shared/common/helpers/CustomNamingStrategy.js +22 -0
- package/dist/shared/common/helpers/CustomNamingStrategy.js.map +1 -0
- package/dist/shared/common/helpers/DateHelper.d.ts +3 -0
- package/dist/shared/common/helpers/DateHelper.js +20 -0
- package/dist/shared/common/helpers/DateHelper.js.map +1 -0
- package/dist/shared/common/helpers/EmailHelper.d.ts +4 -0
- package/dist/shared/common/helpers/EmailHelper.js +65 -0
- package/dist/shared/common/helpers/EmailHelper.js.map +1 -0
- package/dist/shared/common/helpers/FileSystemHelper.d.ts +15 -0
- package/dist/shared/common/helpers/FileSystemHelper.js +112 -0
- package/dist/shared/common/helpers/FileSystemHelper.js.map +1 -0
- package/dist/shared/common/helpers/index.d.ts +5 -0
- package/dist/shared/common/helpers/index.js +22 -0
- package/dist/shared/common/helpers/index.js.map +1 -0
- package/dist/shared/common/index.d.ts +9 -0
- package/dist/shared/common/index.js +26 -0
- package/dist/shared/common/index.js.map +1 -0
- package/dist/shared/common/middleware/AccessLoggerMiddleware.d.ts +6 -0
- package/dist/shared/common/middleware/AccessLoggerMiddleware.js +64 -0
- package/dist/shared/common/middleware/AccessLoggerMiddleware.js.map +1 -0
- package/dist/shared/common/middleware/AuthenticationMiddleware.d.ts +5 -0
- package/dist/shared/common/middleware/AuthenticationMiddleware.js +19 -0
- package/dist/shared/common/middleware/AuthenticationMiddleware.js.map +1 -0
- package/dist/shared/common/middleware/TenantMiddleware.d.ts +14 -0
- package/dist/shared/common/middleware/TenantMiddleware.js +49 -0
- package/dist/shared/common/middleware/TenantMiddleware.js.map +1 -0
- package/dist/shared/common/middleware/index.d.ts +3 -0
- package/dist/shared/common/middleware/index.js +20 -0
- package/dist/shared/common/middleware/index.js.map +1 -0
- package/dist/shared/common/pagination/index.d.ts +2 -0
- package/dist/shared/common/pagination/index.js +19 -0
- package/dist/shared/common/pagination/index.js.map +1 -0
- package/dist/shared/common/pagination/pagination.helper.d.ts +7 -0
- package/dist/shared/common/pagination/pagination.helper.js +40 -0
- package/dist/shared/common/pagination/pagination.helper.js.map +1 -0
- package/dist/shared/common/pagination/pagination.types.d.ts +19 -0
- package/dist/shared/common/pagination/pagination.types.js +3 -0
- package/dist/shared/common/pagination/pagination.types.js.map +1 -0
- package/dist/shared/common/standard-response.d.ts +7 -0
- package/dist/shared/common/standard-response.js +27 -0
- package/dist/shared/common/standard-response.js.map +1 -0
- package/dist/shared/common/types/common.type.d.ts +54 -0
- package/dist/shared/common/types/common.type.js +55 -0
- package/dist/shared/common/types/common.type.js.map +1 -0
- package/dist/shared/common/types/index.d.ts +8 -0
- package/dist/shared/common/types/index.js +25 -0
- package/dist/shared/common/types/index.js.map +1 -0
- package/dist/shared/common/types/mortgage-fsm.type.d.ts +180 -0
- package/dist/shared/common/types/mortgage-fsm.type.js +130 -0
- package/dist/shared/common/types/mortgage-fsm.type.js.map +1 -0
- package/dist/shared/common/types/permission.type.d.ts +42 -0
- package/dist/shared/common/types/permission.type.js +47 -0
- package/dist/shared/common/types/permission.type.js.map +1 -0
- package/dist/shared/common/types/policy.type.d.ts +18 -0
- package/dist/shared/common/types/policy.type.js +3 -0
- package/dist/shared/common/types/policy.type.js.map +1 -0
- package/dist/shared/common/types/property.type.d.ts +9 -0
- package/dist/shared/common/types/property.type.js +15 -0
- package/dist/shared/common/types/property.type.js.map +1 -0
- package/dist/shared/common/types/tenant.type.d.ts +13 -0
- package/dist/shared/common/types/tenant.type.js +19 -0
- package/dist/shared/common/types/tenant.type.js.map +1 -0
- package/dist/shared/common/types/transaction.type.d.ts +8 -0
- package/dist/shared/common/types/transaction.type.js +14 -0
- package/dist/shared/common/types/transaction.type.js.map +1 -0
- package/dist/shared/common/types/user.type.d.ts +10 -0
- package/dist/shared/common/types/user.type.js +16 -0
- package/dist/shared/common/types/user.type.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/common.type.d.ts +1 -5
- package/dist/types/common.type.js.map +1 -1
- package/dist/types/social.enums.d.ts +4 -7
- package/dist/types/social.enums.js +5 -9
- package/dist/types/social.enums.js.map +1 -1
- package/package.json +13 -11
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ArrayHelper"), exports);
|
|
18
|
+
__exportStar(require("./ConstantHelper"), exports);
|
|
19
|
+
__exportStar(require("./DateHelper"), exports);
|
|
20
|
+
__exportStar(require("./EmailHelper"), exports);
|
|
21
|
+
__exportStar(require("./FileSystemHelper"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,mDAAiC;AACjC,+CAA6B;AAC7B,gDAA8B;AAC9B,qDAAmC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './pagination';
|
|
2
|
+
export * from './standard-response';
|
|
3
|
+
export * from './entities';
|
|
4
|
+
export * from './middleware';
|
|
5
|
+
export * from './helpers';
|
|
6
|
+
export * from './decorator';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './guard';
|
|
9
|
+
export * from './OpenApiHelper';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./pagination"), exports);
|
|
18
|
+
__exportStar(require("./standard-response"), exports);
|
|
19
|
+
__exportStar(require("./entities"), exports);
|
|
20
|
+
__exportStar(require("./middleware"), exports);
|
|
21
|
+
__exportStar(require("./helpers"), exports);
|
|
22
|
+
__exportStar(require("./decorator"), exports);
|
|
23
|
+
__exportStar(require("./types"), exports);
|
|
24
|
+
__exportStar(require("./guard"), exports);
|
|
25
|
+
__exportStar(require("./OpenApiHelper"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,+CAA6B;AAG7B,sDAAoC;AAGpC,6CAA2B;AAG3B,+CAA6B;AAC7B,4CAA0B;AAC1B,8CAA4B;AAG5B,0CAAwB;AACxB,0CAAwB;AACxB,kDAAgC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NestMiddleware } from '@nestjs/common';
|
|
2
|
+
import { Request, Response, NextFunction } from 'express';
|
|
3
|
+
export declare class AccessLoggerMiddleware implements NestMiddleware {
|
|
4
|
+
private readonly logger;
|
|
5
|
+
use: (request: Request, response: Response, next: NextFunction) => void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AccessLoggerMiddleware = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let AccessLoggerMiddleware = class AccessLoggerMiddleware {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.logger = new common_1.Logger('HTTP');
|
|
14
|
+
this.use = (request, response, next) => {
|
|
15
|
+
const { ip, method, originalUrl: url } = request;
|
|
16
|
+
const userAgent = request.get('user-agent') || '';
|
|
17
|
+
const startTime = Date.now();
|
|
18
|
+
const originalSend = response.send;
|
|
19
|
+
let responseBody;
|
|
20
|
+
response.send = function (body) {
|
|
21
|
+
responseBody = body;
|
|
22
|
+
return originalSend.call(this, body);
|
|
23
|
+
};
|
|
24
|
+
response.on('finish', () => {
|
|
25
|
+
const { statusCode } = response;
|
|
26
|
+
const contentLength = response.get('content-length');
|
|
27
|
+
const responseTime = Date.now() - startTime;
|
|
28
|
+
const message = {
|
|
29
|
+
method,
|
|
30
|
+
url,
|
|
31
|
+
statusCode,
|
|
32
|
+
contentLength,
|
|
33
|
+
responseTime: `${responseTime}ms`,
|
|
34
|
+
userAgent,
|
|
35
|
+
ip,
|
|
36
|
+
timestamp: new Date().toISOString(),
|
|
37
|
+
};
|
|
38
|
+
if (statusCode >= 500) {
|
|
39
|
+
this.logger.error(JSON.stringify(message));
|
|
40
|
+
try {
|
|
41
|
+
if (typeof responseBody === 'object') {
|
|
42
|
+
console.log('Response body:', JSON.stringify(responseBody, null, 2));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log('Response body:', responseBody);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
console.log('Response body (unserializable):', responseBody);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.logger.log(JSON.stringify(message));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
next();
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.AccessLoggerMiddleware = AccessLoggerMiddleware;
|
|
61
|
+
exports.AccessLoggerMiddleware = AccessLoggerMiddleware = __decorate([
|
|
62
|
+
(0, common_1.Injectable)()
|
|
63
|
+
], AccessLoggerMiddleware);
|
|
64
|
+
//# sourceMappingURL=AccessLoggerMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessLoggerMiddleware.js","sourceRoot":"","sources":["../../../../middleware/AccessLoggerMiddleware.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoE;AAI7D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAA5B;QACY,WAAM,GAAG,IAAI,eAAM,CAAC,MAAM,CAAC,CAAC;QAE7C,QAAG,GAAG,CAAC,OAAgB,EAAE,QAAkB,EAAE,IAAkB,EAAQ,EAAE;YACvE,MAAM,EAAE,E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4BACN,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;wBAC9C,CAAC;oBACH,CAAC;oBAAC,OAAO,GAAG,EAAE,CAAC;wBACb,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,YAAY,CAAC,CAAC;oBAC/D,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,IAAI,EAAE,CAAC;QACT,CAAC,CAAC;IACJ,CAAC;CAAA,CAAA;AArDY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;GACA,sBAAsB,CAqDlC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const common_1 = require("@nestjs/common");
|
|
10
|
+
let AuthenticationMiddleware = class AuthenticationMiddleware {
|
|
11
|
+
use(req, _res, next) {
|
|
12
|
+
return next();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
AuthenticationMiddleware = __decorate([
|
|
16
|
+
(0, common_1.Injectable)()
|
|
17
|
+
], AuthenticationMiddleware);
|
|
18
|
+
exports.default = AuthenticationMiddleware;
|
|
19
|
+
//# sourceMappingURL=AuthenticationMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationMiddleware.js","sourceRoot":"","sources":["../../../../middleware/AuthenticationMiddleware.ts"],"names":[],"mappings":";;;;;;;;AAAA,2CAA4D;AAI7C,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACzC,GAAG,CAAC,GAAY,EAAE,IAAc,EAAE,IAAkB;QAKhD,OAAO,IAAI,EAAE,CAAC;IAClB,CAAC;CACJ,CAAA;AARoB,wBAAwB;IAD5C,IAAA,mBAAU,GAAE;GACQ,wBAAwB,CAQ5C;kBARoB,wBAAwB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NestMiddleware } from '@nestjs/common';
|
|
2
|
+
import { Request, Response, NextFunction } from 'express';
|
|
3
|
+
declare global {
|
|
4
|
+
namespace Express {
|
|
5
|
+
interface Request {
|
|
6
|
+
tenantId?: number;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class TenantMiddleware implements NestMiddleware {
|
|
11
|
+
use(req: Request, _res: Response, next: NextFunction): Promise<void>;
|
|
12
|
+
private extractSubdomain;
|
|
13
|
+
}
|
|
14
|
+
export default TenantMiddleware;
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.TenantMiddleware = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let TenantMiddleware = class TenantMiddleware {
|
|
12
|
+
async use(req, _res, next) {
|
|
13
|
+
const tenantIdHeader = req.headers['x-tenant-id'] || req.headers['X-Tenant-Id'];
|
|
14
|
+
if (tenantIdHeader) {
|
|
15
|
+
const id = parseInt(tenantIdHeader, 10);
|
|
16
|
+
if (!isNaN(id)) {
|
|
17
|
+
req.tenantId = id;
|
|
18
|
+
return next();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const host = (req.hostname || req.headers.host || '').toString();
|
|
22
|
+
const subdomain = this.extractSubdomain(host);
|
|
23
|
+
if (subdomain) {
|
|
24
|
+
const id = parseInt(subdomain, 10);
|
|
25
|
+
if (!isNaN(id)) {
|
|
26
|
+
req.tenantId = id;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
next();
|
|
30
|
+
}
|
|
31
|
+
extractSubdomain(host) {
|
|
32
|
+
if (!host)
|
|
33
|
+
return null;
|
|
34
|
+
const hostname = host.split(':')[0];
|
|
35
|
+
const parts = hostname.split('.');
|
|
36
|
+
if (hostname === 'localhost' || /^(\d{1,3}\.){3}\d{1,3}$/.test(hostname)) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
if (parts.length >= 3)
|
|
40
|
+
return parts[0];
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.TenantMiddleware = TenantMiddleware;
|
|
45
|
+
exports.TenantMiddleware = TenantMiddleware = __decorate([
|
|
46
|
+
(0, common_1.Injectable)()
|
|
47
|
+
], TenantMiddleware);
|
|
48
|
+
exports.default = TenantMiddleware;
|
|
49
|
+
//# sourceMappingURL=TenantMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantMiddleware.js","sourceRoot":"","sources":["../../../../middleware/TenantMiddleware.ts"],"names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,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvE,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AApCY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;GACA,gBAAgB,CAoC5B;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AccessLoggerMiddleware"), exports);
|
|
18
|
+
__exportStar(require("./AuthenticationMiddleware"), exports);
|
|
19
|
+
__exportStar(require("./TenantMiddleware"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../middleware/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,6DAA2C;AAC3C,qDAAmC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./pagination.types"), exports);
|
|
18
|
+
__exportStar(require("./pagination.helper"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../pagination/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,sDAAoC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PaginatedResponse, PaginationQuery } from './pagination.types';
|
|
2
|
+
export declare class PaginationHelper {
|
|
3
|
+
static paginate<T>(items: T[], total: number, query: PaginationQuery): PaginatedResponse<T>;
|
|
4
|
+
static getSkip(page?: number, limit?: number): number;
|
|
5
|
+
static getLimit(limit?: number): number;
|
|
6
|
+
static parseQuery(query: any): PaginationQuery;
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaginationHelper = void 0;
|
|
4
|
+
class PaginationHelper {
|
|
5
|
+
static paginate(items, total, query) {
|
|
6
|
+
const page = Math.max(1, query.page || 1);
|
|
7
|
+
const limit = this.getLimit(query.limit);
|
|
8
|
+
const totalPages = Math.ceil(total / limit);
|
|
9
|
+
return {
|
|
10
|
+
data: items,
|
|
11
|
+
meta: {
|
|
12
|
+
total,
|
|
13
|
+
page,
|
|
14
|
+
limit,
|
|
15
|
+
totalPages,
|
|
16
|
+
hasNext: page < totalPages,
|
|
17
|
+
hasPrev: page > 1,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
static getSkip(page, limit) {
|
|
22
|
+
const actualPage = Math.max(1, page || 1);
|
|
23
|
+
const actualLimit = this.getLimit(limit);
|
|
24
|
+
return (actualPage - 1) * actualLimit;
|
|
25
|
+
}
|
|
26
|
+
static getLimit(limit) {
|
|
27
|
+
return Math.min(100, Math.max(1, limit || 10));
|
|
28
|
+
}
|
|
29
|
+
static parseQuery(query) {
|
|
30
|
+
return {
|
|
31
|
+
page: query.page ? parseInt(query.page, 10) : 1,
|
|
32
|
+
limit: query.limit ? parseInt(query.limit, 10) : 10,
|
|
33
|
+
sortBy: query.sortBy || 'id',
|
|
34
|
+
sortOrder: query.sortOrder?.toUpperCase() === 'ASC' ? 'ASC' : 'DESC',
|
|
35
|
+
search: query.search || undefined,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.PaginationHelper = PaginationHelper;
|
|
40
|
+
//# sourceMappingURL=pagination.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.helper.js","sourceRoot":"","sources":["../../../../pagination/pagination.helper.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;IAIzB,MAAM,CAAC,QAAQ,CACX,KAAU,EACV,KAAa,EACb,KAAsB;QAEtB,MAAM,IAAI,GAAG,IAAI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I,IAAI;YAC5B,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;YACpE,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,SAAS;SACpC,CAAC;IACN,CAAC;CACJ;AAtDD,4CAsDC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface PaginationQuery {
|
|
2
|
+
page?: number;
|
|
3
|
+
limit?: number;
|
|
4
|
+
sortBy?: string;
|
|
5
|
+
sortOrder?: 'ASC' | 'DESC';
|
|
6
|
+
search?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PaginationMeta {
|
|
9
|
+
total: number;
|
|
10
|
+
page: number;
|
|
11
|
+
limit: number;
|
|
12
|
+
totalPages: number;
|
|
13
|
+
hasNext: boolean;
|
|
14
|
+
hasPrev: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface PaginatedResponse<T> {
|
|
17
|
+
data: T[];
|
|
18
|
+
meta: PaginationMeta;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.types.js","sourceRoot":"","sources":["../../../../pagination/pagination.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
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.StandardApiResponse = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
let StandardApiResponse = class StandardApiResponse {
|
|
15
|
+
constructor(status, message, body) {
|
|
16
|
+
this.message = message;
|
|
17
|
+
this.status = status;
|
|
18
|
+
this.body = body;
|
|
19
|
+
this.ok = status >= 200 && status < 300;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.StandardApiResponse = StandardApiResponse;
|
|
23
|
+
exports.StandardApiResponse = StandardApiResponse = __decorate([
|
|
24
|
+
(0, swagger_1.ApiExtraModels)(StandardApiResponse),
|
|
25
|
+
__metadata("design:paramtypes", [Number, String, Object])
|
|
26
|
+
], StandardApiResponse);
|
|
27
|
+
//# sourceMappingURL=standard-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard-response.js","sourceRoot":"","sources":["../../../standard-response.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiD;AAG1C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAM5B,YAAY,MAAc,EAAE,OAAe,EAAE,IAAQ;QACjD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC;IAC5C,CAAC;CACJ,CAAA;AAZY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,wBAAc,EAAC,mBAAmB,CAAC;;GACvB,mBAAmB,CAY/B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare enum DocumentStatus {
|
|
2
|
+
APPROVED = "APPROVED",
|
|
3
|
+
PENDING = "PENDING",
|
|
4
|
+
DECLINED = "DECLINED"
|
|
5
|
+
}
|
|
6
|
+
export declare enum Status {
|
|
7
|
+
APPROVED = "APPROVED",
|
|
8
|
+
PENDING = "PENDING",
|
|
9
|
+
DECLINED = "DECLINED"
|
|
10
|
+
}
|
|
11
|
+
export declare class CreateDocumentDto {
|
|
12
|
+
url: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
size?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class UpdateDocumentDto {
|
|
18
|
+
url?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class UpdateDocumentStatusDto {
|
|
23
|
+
status: DocumentStatus;
|
|
24
|
+
comment?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare class DocumentReuploadDto {
|
|
27
|
+
url: string;
|
|
28
|
+
}
|
|
29
|
+
export declare class PaginatedData {
|
|
30
|
+
total: number;
|
|
31
|
+
totalPages: number;
|
|
32
|
+
currentPage: number;
|
|
33
|
+
}
|
|
34
|
+
export declare enum Frequency {
|
|
35
|
+
MONTHLY = "MONTHLY",
|
|
36
|
+
YEARLY = "YEARLY",
|
|
37
|
+
ONE_TIME = "ONE_TIME",
|
|
38
|
+
DAILY = "DAILY"
|
|
39
|
+
}
|
|
40
|
+
export declare enum ResponseMessage {
|
|
41
|
+
CREATED = "Created successfully",
|
|
42
|
+
UPDATED = "Updated successfully",
|
|
43
|
+
DELETED = "Deleted successfully",
|
|
44
|
+
FETCHED = "Fetched successfully",
|
|
45
|
+
SUCCESS = "Operation successful",
|
|
46
|
+
ERROR = "An error occurred"
|
|
47
|
+
}
|
|
48
|
+
export declare enum Currency {
|
|
49
|
+
USD = "USD",
|
|
50
|
+
EUR = "EUR",
|
|
51
|
+
GBP = "GBP",
|
|
52
|
+
JPY = "JPY",
|
|
53
|
+
NGN = "NGN"
|
|
54
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Currency = exports.ResponseMessage = exports.Frequency = exports.PaginatedData = exports.DocumentReuploadDto = exports.UpdateDocumentStatusDto = exports.UpdateDocumentDto = exports.CreateDocumentDto = exports.Status = exports.DocumentStatus = void 0;
|
|
4
|
+
var DocumentStatus;
|
|
5
|
+
(function (DocumentStatus) {
|
|
6
|
+
DocumentStatus["APPROVED"] = "APPROVED";
|
|
7
|
+
DocumentStatus["PENDING"] = "PENDING";
|
|
8
|
+
DocumentStatus["DECLINED"] = "DECLINED";
|
|
9
|
+
})(DocumentStatus || (exports.DocumentStatus = DocumentStatus = {}));
|
|
10
|
+
var Status;
|
|
11
|
+
(function (Status) {
|
|
12
|
+
Status["APPROVED"] = "APPROVED";
|
|
13
|
+
Status["PENDING"] = "PENDING";
|
|
14
|
+
Status["DECLINED"] = "DECLINED";
|
|
15
|
+
})(Status || (exports.Status = Status = {}));
|
|
16
|
+
class CreateDocumentDto {
|
|
17
|
+
}
|
|
18
|
+
exports.CreateDocumentDto = CreateDocumentDto;
|
|
19
|
+
class UpdateDocumentDto {
|
|
20
|
+
}
|
|
21
|
+
exports.UpdateDocumentDto = UpdateDocumentDto;
|
|
22
|
+
class UpdateDocumentStatusDto {
|
|
23
|
+
}
|
|
24
|
+
exports.UpdateDocumentStatusDto = UpdateDocumentStatusDto;
|
|
25
|
+
class DocumentReuploadDto {
|
|
26
|
+
}
|
|
27
|
+
exports.DocumentReuploadDto = DocumentReuploadDto;
|
|
28
|
+
class PaginatedData {
|
|
29
|
+
}
|
|
30
|
+
exports.PaginatedData = PaginatedData;
|
|
31
|
+
var Frequency;
|
|
32
|
+
(function (Frequency) {
|
|
33
|
+
Frequency["MONTHLY"] = "MONTHLY";
|
|
34
|
+
Frequency["YEARLY"] = "YEARLY";
|
|
35
|
+
Frequency["ONE_TIME"] = "ONE_TIME";
|
|
36
|
+
Frequency["DAILY"] = "DAILY";
|
|
37
|
+
})(Frequency || (exports.Frequency = Frequency = {}));
|
|
38
|
+
var ResponseMessage;
|
|
39
|
+
(function (ResponseMessage) {
|
|
40
|
+
ResponseMessage["CREATED"] = "Created successfully";
|
|
41
|
+
ResponseMessage["UPDATED"] = "Updated successfully";
|
|
42
|
+
ResponseMessage["DELETED"] = "Deleted successfully";
|
|
43
|
+
ResponseMessage["FETCHED"] = "Fetched successfully";
|
|
44
|
+
ResponseMessage["SUCCESS"] = "Operation successful";
|
|
45
|
+
ResponseMessage["ERROR"] = "An error occurred";
|
|
46
|
+
})(ResponseMessage || (exports.ResponseMessage = ResponseMessage = {}));
|
|
47
|
+
var Currency;
|
|
48
|
+
(function (Currency) {
|
|
49
|
+
Currency["USD"] = "USD";
|
|
50
|
+
Currency["EUR"] = "EUR";
|
|
51
|
+
Currency["GBP"] = "GBP";
|
|
52
|
+
Currency["JPY"] = "JPY";
|
|
53
|
+
Currency["NGN"] = "NGN";
|
|
54
|
+
})(Currency || (exports.Currency = Currency = {}));
|
|
55
|
+
//# sourceMappingURL=common.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.type.js","sourceRoot":"","sources":["../../../../types/common.type.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;AACvB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,+BAAqB,CAAA;IACrB,6BAAmB,CAAA;IACnB,+BAAqB,CAAA;AACvB,CAAC,EAJW,MAAM,sBAAN,MAAM,QAIjB;AAED,MAAa,iBAAiB;CAK7B;AALD,8CAKC;AAED,MAAa,iBAAiB;CAI7B;AAJD,8CAIC;AAED,MAAa,uBAAuB;CAGnC;AAHD,0DAGC;AAED,MAAa,mBAAmB;CAE/B;AAFD,kDAEC;AAED,MAAa,aAAa;CAMzB;AAND,sCAMC;AAED,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,gCAAmB,CAAA;IACnB,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,4BAAe,CAAA;AACjB,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB;AAED,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,mDAAgC,CAAA;IAChC,mDAAgC,CAAA;IAChC,mDAAgC,CAAA;IAChC,mDAAgC,CAAA;IAChC,mDAAgC,CAAA;IAChC,8CAA2B,CAAA;AAC7B,CAAC,EAPW,eAAe,+BAAf,eAAe,QAO1B;AAED,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;AACb,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './common.type';
|
|
2
|
+
export * from './mortgage-fsm.type';
|
|
3
|
+
export * from './policy.type';
|
|
4
|
+
export * from './property.type';
|
|
5
|
+
export * from './permission.type';
|
|
6
|
+
export * from './tenant.type';
|
|
7
|
+
export * from './transaction.type';
|
|
8
|
+
export * from './user.type';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./common.type"), exports);
|
|
18
|
+
__exportStar(require("./mortgage-fsm.type"), exports);
|
|
19
|
+
__exportStar(require("./policy.type"), exports);
|
|
20
|
+
__exportStar(require("./property.type"), exports);
|
|
21
|
+
__exportStar(require("./permission.type"), exports);
|
|
22
|
+
__exportStar(require("./tenant.type"), exports);
|
|
23
|
+
__exportStar(require("./transaction.type"), exports);
|
|
24
|
+
__exportStar(require("./user.type"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,sDAAoC;AACpC,gDAA8B;AAC9B,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,qDAAmC;AACnC,8CAA4B"}
|