@hosterai/types 0.0.10 → 0.0.12
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/LICENSE +21 -0
- package/README.md +156 -46
- package/dist/dtos/action.dto.d.ts +1 -1
- package/dist/dtos/action.dto.js +28 -0
- package/dist/dtos/attachment.dto.d.ts +1 -1
- package/dist/dtos/attachment.dto.js +1 -1
- package/dist/dtos/company-data.dto.d.ts +2 -2
- package/dist/dtos/company-data.dto.js +94 -0
- package/dist/dtos/error-response.dto.d.ts +1 -1
- package/dist/dtos/error-response.dto.js +1 -1
- package/dist/dtos/field.dto.d.ts +3 -3
- package/dist/dtos/field.dto.js +70 -0
- package/dist/dtos/info.dto.d.ts +2 -3
- package/dist/dtos/jwt.dto.d.ts +21 -19
- package/dist/dtos/jwt.dto.js +40 -0
- package/dist/dtos/menu.dto.d.ts +1 -1
- package/dist/dtos/multilang-text.dto.d.ts +1 -1
- package/dist/dtos/notification/notification-info.dto.d.ts +2 -2
- package/dist/dtos/notification/notification-request.dto.d.ts +2 -2
- package/dist/dtos/response-data.dto.d.ts +1 -1
- package/dist/dtos/setup-status-response.dto.d.ts +2 -2
- package/dist/enums/country.enum.js +3 -3
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/validators/action-validator.d.ts +8 -0
- package/dist/validators/action-validator.js +17 -0
- package/dist/validators/company-data-validator.d.ts +8 -0
- package/dist/validators/company-data-validator.js +17 -0
- package/dist/validators/field-validator.d.ts +8 -0
- package/dist/validators/field-validator.js +17 -0
- package/dist/validators/jwt-validator.d.ts +8 -0
- package/dist/validators/jwt-validator.js +17 -0
- package/dist/validators/multilang-text-validator.d.ts +8 -0
- package/dist/validators/multilang-text-validator.js +17 -0
- package/dist/validators/receiver-email-validator.d.ts +8 -0
- package/dist/validators/receiver-email-validator.js +17 -0
- package/dist/validators/receiver-push-validator.d.ts +8 -0
- package/dist/validators/receiver-push-validator.js +17 -0
- package/dist/validators/receiver-sms-validator.d.ts +8 -0
- package/dist/validators/receiver-sms-validator.js +17 -0
- package/dist/validators/sender-email-validator.d.ts +8 -0
- package/dist/validators/sender-email-validator.js +17 -0
- package/dist/validators/sender-push-validator.d.ts +8 -0
- package/dist/validators/sender-push-validator.js +17 -0
- package/dist/validators/sender-sms-validator.d.ts +8 -0
- package/dist/validators/sender-sms-validator.js +17 -0
- package/package.json +20 -5
- package/dist/dtos/info/info-notification.dto.d.ts +0 -5
- package/dist/dtos/info/info-notification.dto.js +0 -7
- package/dist/dtos/info/info.dto.d.ts +0 -196
- package/dist/dtos/info/info.dto.js +0 -278
- package/dist/dtos/receiver/receiver-email.dto.d.ts +0 -20
- package/dist/dtos/receiver/receiver-email.dto.js +0 -39
- package/dist/dtos/receiver/receiver-push.dto.d.ts +0 -15
- package/dist/dtos/receiver/receiver-push.dto.js +0 -31
- package/dist/dtos/receiver/receiver-sms.dto.d.ts +0 -11
- package/dist/dtos/receiver/receiver-sms.dto.js +0 -26
- package/dist/dtos/request.dto.d.ts +0 -20
- package/dist/dtos/request.dto.js +0 -31
- package/dist/dtos/sender/sender-email.dto.d.ts +0 -25
- package/dist/dtos/sender/sender-email.dto.js +0 -46
- package/dist/dtos/sender/sender-push.dto.d.ts +0 -31
- package/dist/dtos/sender/sender-push.dto.js +0 -50
- package/dist/dtos/sender/sender-sms.dto.d.ts +0 -15
- package/dist/dtos/sender/sender-sms.dto.js +0 -30
- package/dist/enums/message-type.enum.d.ts +0 -5
- package/dist/enums/message-type.enum.js +0 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NotificationMessageTypeEnum } from
|
|
2
|
-
import { InfoDto } from
|
|
1
|
+
import { NotificationMessageTypeEnum } from '../../enums/notification/notification-message-type.enum';
|
|
2
|
+
import { InfoDto } from '../info.dto';
|
|
3
3
|
export declare class NotificationInfoDto extends InfoDto {
|
|
4
4
|
type: NotificationMessageTypeEnum;
|
|
5
5
|
}
|
|
@@ -12,9 +12,9 @@ export declare class NotificationRequestDto {
|
|
|
12
12
|
/**
|
|
13
13
|
* Sender details according to the integration's notification type
|
|
14
14
|
*/
|
|
15
|
-
sender: EmailSenderDto |
|
|
15
|
+
sender: EmailSenderDto | PushSenderDto | SmsSenderDto;
|
|
16
16
|
/**
|
|
17
17
|
* Recipient details according to the integration's notification type
|
|
18
18
|
*/
|
|
19
|
-
receiver: EmailReceiverDto |
|
|
19
|
+
receiver: EmailReceiverDto | PushReceiverDto | SmsReceiverDto;
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SetupStatusEnum } from
|
|
2
|
-
import { BaseResponse } from
|
|
1
|
+
import { SetupStatusEnum } from '../enums/setup-status.enum';
|
|
2
|
+
import { BaseResponse } from './base-response.dto';
|
|
3
3
|
export declare class SetupStatusResponseDto extends BaseResponse {
|
|
4
4
|
status: SetupStatusEnum;
|
|
5
5
|
}
|
|
@@ -307,7 +307,7 @@ exports.country_name = {
|
|
|
307
307
|
CD: 'Congo, Democratic Republic',
|
|
308
308
|
CK: 'Cook Islands',
|
|
309
309
|
CR: 'Costa Rica',
|
|
310
|
-
CI:
|
|
310
|
+
CI: "Cote D'Ivoire",
|
|
311
311
|
HR: 'Croatia',
|
|
312
312
|
CU: 'Cuba',
|
|
313
313
|
CW: 'Curaçao',
|
|
@@ -370,11 +370,11 @@ exports.country_name = {
|
|
|
370
370
|
KZ: 'Kazakhstan',
|
|
371
371
|
KE: 'Kenya',
|
|
372
372
|
KI: 'Kiribati',
|
|
373
|
-
KP:
|
|
373
|
+
KP: "Korea (Democratic People's Republic of)",
|
|
374
374
|
KR: 'Korea',
|
|
375
375
|
KW: 'Kuwait',
|
|
376
376
|
KG: 'Kyrgyzstan',
|
|
377
|
-
LA:
|
|
377
|
+
LA: "Lao People's Democratic Republic",
|
|
378
378
|
LV: 'Latvia',
|
|
379
379
|
LB: 'Lebanon',
|
|
380
380
|
LS: 'Lesotho',
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
1
2
|
export * from './dtos/attachment.dto';
|
|
2
3
|
export * from './dtos/base-response.dto';
|
|
3
4
|
export * from './dtos/company-data.dto';
|
|
@@ -28,3 +29,14 @@ export * from './enums/actions.enum';
|
|
|
28
29
|
export * from './enums/events.enum';
|
|
29
30
|
export * from './enums/field-type.enum';
|
|
30
31
|
export * from './validators/notification-request-validator';
|
|
32
|
+
export * from './validators/company-data-validator';
|
|
33
|
+
export * from './validators/jwt-validator';
|
|
34
|
+
export * from './validators/action-validator';
|
|
35
|
+
export * from './validators/field-validator';
|
|
36
|
+
export * from './validators/multilang-text-validator';
|
|
37
|
+
export * from './validators/receiver-email-validator';
|
|
38
|
+
export * from './validators/receiver-sms-validator';
|
|
39
|
+
export * from './validators/receiver-push-validator';
|
|
40
|
+
export * from './validators/sender-email-validator';
|
|
41
|
+
export * from './validators/sender-sms-validator';
|
|
42
|
+
export * from './validators/sender-push-validator';
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("reflect-metadata");
|
|
17
18
|
// Export all DTOs
|
|
18
19
|
__exportStar(require("./dtos/attachment.dto"), exports);
|
|
19
20
|
__exportStar(require("./dtos/base-response.dto"), exports);
|
|
@@ -49,3 +50,14 @@ __exportStar(require("./enums/events.enum"), exports);
|
|
|
49
50
|
__exportStar(require("./enums/field-type.enum"), exports);
|
|
50
51
|
// Export validators
|
|
51
52
|
__exportStar(require("./validators/notification-request-validator"), exports);
|
|
53
|
+
__exportStar(require("./validators/company-data-validator"), exports);
|
|
54
|
+
__exportStar(require("./validators/jwt-validator"), exports);
|
|
55
|
+
__exportStar(require("./validators/action-validator"), exports);
|
|
56
|
+
__exportStar(require("./validators/field-validator"), exports);
|
|
57
|
+
__exportStar(require("./validators/multilang-text-validator"), exports);
|
|
58
|
+
__exportStar(require("./validators/receiver-email-validator"), exports);
|
|
59
|
+
__exportStar(require("./validators/receiver-sms-validator"), exports);
|
|
60
|
+
__exportStar(require("./validators/receiver-push-validator"), exports);
|
|
61
|
+
__exportStar(require("./validators/sender-email-validator"), exports);
|
|
62
|
+
__exportStar(require("./validators/sender-sms-validator"), exports);
|
|
63
|
+
__exportStar(require("./validators/sender-push-validator"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a ActionDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a ActionDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateActionDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateActionDto = validateActionDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const action_dto_1 = require("../dtos/action.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a ActionDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a ActionDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateActionDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(action_dto_1.ActionDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a CompanyDataDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a CompanyDataDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateCompanyDataDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateCompanyDataDto = validateCompanyDataDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const company_data_dto_1 = require("../dtos/company-data.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a CompanyDataDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a CompanyDataDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateCompanyDataDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(company_data_dto_1.CompanyDataDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a FieldDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a FieldDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateFieldDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateFieldDto = validateFieldDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const field_dto_1 = require("../dtos/field.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a FieldDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a FieldDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateFieldDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(field_dto_1.FieldDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a JwtDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a JwtDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateJwtDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateJwtDto = validateJwtDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const jwt_dto_1 = require("../dtos/jwt.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a JwtDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a JwtDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateJwtDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(jwt_dto_1.JwtDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a MultilangTextDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a MultilangTextDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateMultilangTextDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateMultilangTextDto = validateMultilangTextDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const multilang_text_dto_1 = require("../dtos/multilang-text.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a MultilangTextDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a MultilangTextDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateMultilangTextDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(multilang_text_dto_1.MultilangTextDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a EmailReceiverDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a EmailReceiverDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateEmailReceiverDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateEmailReceiverDto = validateEmailReceiverDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const receiver_email_dto_1 = require("../dtos/notification/receiver/receiver-email.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a EmailReceiverDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a EmailReceiverDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateEmailReceiverDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(receiver_email_dto_1.EmailReceiverDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a PushReceiverDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a PushReceiverDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validatePushReceiverDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validatePushReceiverDto = validatePushReceiverDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const receiver_push_dto_1 = require("../dtos/notification/receiver/receiver-push.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a PushReceiverDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a PushReceiverDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validatePushReceiverDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(receiver_push_dto_1.PushReceiverDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a SmsReceiverDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a SmsReceiverDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateSmsReceiverDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSmsReceiverDto = validateSmsReceiverDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const receiver_sms_dto_1 = require("../dtos/notification/receiver/receiver-sms.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a SmsReceiverDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a SmsReceiverDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateSmsReceiverDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(receiver_sms_dto_1.SmsReceiverDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a EmailSenderDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a EmailSenderDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateEmailSenderDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateEmailSenderDto = validateEmailSenderDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const sender_email_dto_1 = require("../dtos/notification/sender/sender-email.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a EmailSenderDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a EmailSenderDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateEmailSenderDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(sender_email_dto_1.EmailSenderDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a PushSenderDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a PushSenderDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validatePushSenderDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validatePushSenderDto = validatePushSenderDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const sender_push_dto_1 = require("../dtos/notification/sender/sender-push.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a PushSenderDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a PushSenderDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validatePushSenderDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(sender_push_dto_1.PushSenderDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a SmsSenderDto object using class-validator decorators.
|
|
4
|
+
*
|
|
5
|
+
* @param data The object to validate as a SmsSenderDto.
|
|
6
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateSmsSenderDto(data: object): ValidationError[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSmsSenderDto = validateSmsSenderDto;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const sender_sms_dto_1 = require("../dtos/notification/sender/sender-sms.dto");
|
|
7
|
+
/**
|
|
8
|
+
* Validates a SmsSenderDto object using class-validator decorators.
|
|
9
|
+
*
|
|
10
|
+
* @param data The object to validate as a SmsSenderDto.
|
|
11
|
+
* @returns An array of validation errors, empty if validation succeeds.
|
|
12
|
+
*/
|
|
13
|
+
function validateSmsSenderDto(data) {
|
|
14
|
+
const dto = (0, class_transformer_1.plainToInstance)(sender_sms_dto_1.SmsSenderDto, data);
|
|
15
|
+
const errors = (0, class_validator_1.validateSync)(dto);
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hosterai/types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
|
8
|
-
"test": "jest"
|
|
8
|
+
"test": "jest",
|
|
9
|
+
"coverage": "jest --coverage",
|
|
10
|
+
"lint": "eslint . --ext .ts",
|
|
11
|
+
"format": "prettier --write ."
|
|
9
12
|
},
|
|
10
13
|
"keywords": [],
|
|
11
14
|
"author": "",
|
|
12
|
-
"license": "
|
|
15
|
+
"license": "MIT",
|
|
13
16
|
"description": "",
|
|
14
17
|
"devDependencies": {
|
|
18
|
+
"@types/express": "^5.0.3",
|
|
15
19
|
"@types/fs-extra": "^11.0.4",
|
|
16
20
|
"@types/jest": "^30.0.0",
|
|
21
|
+
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
|
22
|
+
"@typescript-eslint/parser": "^8.35.0",
|
|
23
|
+
"eslint": "^9.29.0",
|
|
24
|
+
"eslint-config-prettier": "^10.1.5",
|
|
25
|
+
"eslint-plugin-prettier": "^5.5.1",
|
|
17
26
|
"fs-extra": "^11.3.0",
|
|
18
|
-
"jest": "^30.0.
|
|
27
|
+
"jest": "^30.0.3",
|
|
28
|
+
"prettier": "^3.6.1",
|
|
19
29
|
"ts-jest": "^29.4.0",
|
|
20
30
|
"ts-node": "^10.9.2",
|
|
21
31
|
"typescript": "^5.8.3"
|
|
22
32
|
},
|
|
23
33
|
"dependencies": {
|
|
34
|
+
"libphonenumber-js": "^1.12.9"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
24
37
|
"class-transformer": "^0.5.1",
|
|
25
|
-
"class-validator": "^0.14.2"
|
|
38
|
+
"class-validator": "^0.14.2",
|
|
39
|
+
"express": "^5.1.0",
|
|
40
|
+
"reflect-metadata": "^0.2.2"
|
|
26
41
|
},
|
|
27
42
|
"files": [
|
|
28
43
|
"dist"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InfoNotificationDto = void 0;
|
|
4
|
-
const info_dto_1 = require("./info.dto");
|
|
5
|
-
class InfoNotificationDto extends info_dto_1.InfoDto {
|
|
6
|
-
}
|
|
7
|
-
exports.InfoNotificationDto = InfoNotificationDto;
|