@hosterai/types 0.0.21 → 0.0.23

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.
Files changed (56) hide show
  1. package/README.md +29 -2
  2. package/dist/dtos/field.dto.d.ts +8 -4
  3. package/dist/dtos/field.dto.js +17 -7
  4. package/dist/dtos/info/info-notification.dto.d.ts +5 -0
  5. package/dist/dtos/info/info-notification.dto.js +7 -0
  6. package/dist/dtos/info/info.dto.d.ts +196 -0
  7. package/dist/dtos/info/info.dto.js +278 -0
  8. package/dist/dtos/info.dto.d.ts +2 -0
  9. package/dist/dtos/info.dto.js +17 -0
  10. package/dist/dtos/notification/notification-info.dto.js +7 -3
  11. package/dist/dtos/notification/notification-request.dto.d.ts +20 -0
  12. package/dist/dtos/notification/notification-request.dto.js +31 -0
  13. package/dist/dtos/product/product.interface.d.ts +4 -4
  14. package/dist/dtos/receiver/receiver-email.dto.d.ts +20 -0
  15. package/dist/dtos/receiver/receiver-email.dto.js +39 -0
  16. package/dist/dtos/receiver/receiver-push.dto.d.ts +15 -0
  17. package/dist/dtos/receiver/receiver-push.dto.js +31 -0
  18. package/dist/dtos/receiver/receiver-sms.dto.d.ts +11 -0
  19. package/dist/dtos/receiver/receiver-sms.dto.js +26 -0
  20. package/dist/dtos/request.dto.d.ts +20 -0
  21. package/dist/dtos/request.dto.js +31 -0
  22. package/dist/dtos/requests/validate-attributes-request.dto.d.ts +18 -0
  23. package/dist/dtos/{product/requests/product-upgradeable-request.dto.js → requests/validate-attributes-request.dto.js} +11 -17
  24. package/dist/dtos/responses/validate-attributes-response.dto.d.ts +13 -0
  25. package/dist/dtos/responses/validate-attributes-response.dto.js +11 -0
  26. package/dist/dtos/sender/sender-email.dto.d.ts +25 -0
  27. package/dist/dtos/sender/sender-email.dto.js +46 -0
  28. package/dist/dtos/sender/sender-push.dto.d.ts +31 -0
  29. package/dist/dtos/sender/sender-push.dto.js +50 -0
  30. package/dist/dtos/sender/sender-sms.dto.d.ts +15 -0
  31. package/dist/dtos/sender/sender-sms.dto.js +30 -0
  32. package/dist/enums/actions.enum.d.ts +1 -0
  33. package/dist/enums/actions.enum.js +1 -0
  34. package/dist/enums/message-type.enum.d.ts +5 -0
  35. package/dist/enums/message-type.enum.js +9 -0
  36. package/dist/index.d.ts +2 -4
  37. package/dist/index.js +4 -4
  38. package/dist/openapi/schemas/components.schemas.d.ts +166 -221
  39. package/dist/openapi/schemas/components.schemas.js +549 -600
  40. package/dist/validators/field-validator.spec.js +11 -10
  41. package/dist/validators/product-info-validator.spec.js +18 -13
  42. package/dist/validators/product-validate-attributes-request-validator.d.ts +1 -1
  43. package/dist/validators/product-validate-attributes-request-validator.js +5 -5
  44. package/dist/validators/product-validate-attributes-request-validator.spec.js +3 -3
  45. package/package.json +1 -1
  46. package/dist/dtos/product/requests/product-downgradeable-request.dto.d.ts +0 -18
  47. package/dist/dtos/product/requests/product-downgradeable-request.dto.js +0 -37
  48. package/dist/dtos/product/requests/product-upgradeable-request.dto.d.ts +0 -18
  49. package/dist/dtos/product/responses/product-downgradeable-response.dto.d.ts +0 -22
  50. package/dist/dtos/product/responses/product-downgradeable-response.dto.js +0 -11
  51. package/dist/dtos/product/responses/product-upgradeable-response.dto.d.ts +0 -22
  52. package/dist/dtos/product/responses/product-upgradeable-response.dto.js +0 -11
  53. package/dist/validators/product-downgradeable-request-validator.d.ts +0 -8
  54. package/dist/validators/product-downgradeable-request-validator.js +0 -17
  55. package/dist/validators/product-upgradeable-request-validator.d.ts +0 -8
  56. package/dist/validators/product-upgradeable-request-validator.js +0 -17
@@ -0,0 +1,20 @@
1
+ import { EmailReceiverDto } from './receiver/receiver-email.dto';
2
+ import { PushReceiverDto } from './receiver/receiver-push.dto';
3
+ import { SmsReceiverDto } from './receiver/receiver-sms.dto';
4
+ import { EmailSenderDto } from './sender/sender-email.dto';
5
+ import { PushSenderDto } from './sender/sender-push.dto';
6
+ import { SmsSenderDto } from './sender/sender-sms.dto';
7
+ export declare class NotificationRequestDto {
8
+ /**
9
+ * Unique identifier of the hoster message
10
+ */
11
+ notificationId: string;
12
+ /**
13
+ * Sender details according to the integration's notification type
14
+ */
15
+ sender: EmailSenderDto | SmsSenderDto | PushSenderDto;
16
+ /**
17
+ * Recipient details according to the integration's notification type
18
+ */
19
+ receiver: EmailReceiverDto | SmsReceiverDto | PushReceiverDto;
20
+ }
@@ -0,0 +1,31 @@
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.NotificationRequestDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class NotificationRequestDto {
15
+ }
16
+ exports.NotificationRequestDto = NotificationRequestDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsNotEmpty)(),
19
+ (0, class_validator_1.IsString)(),
20
+ __metadata("design:type", String)
21
+ ], NotificationRequestDto.prototype, "notificationId", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_validator_1.IsObject)(),
25
+ __metadata("design:type", Object)
26
+ ], NotificationRequestDto.prototype, "sender", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ (0, class_validator_1.IsObject)(),
30
+ __metadata("design:type", Object)
31
+ ], NotificationRequestDto.prototype, "receiver", void 0);
@@ -19,8 +19,8 @@ import { ProductUnsuspendResponseDto } from './responses/product-unsuspend-respo
19
19
  import { ProductDowngradableResponseDto } from './responses/product-downgradable-response.dto';
20
20
  import { ProductDeleteResponseDto } from './responses/product-delete-response.dto';
21
21
  import { ProductDeleteRequestDto } from './requests/product-delete-request.dto';
22
- import { ProductValidateAttributesRequestDto } from './requests/product-validate-attributes-request.dto';
23
- import { ProductValidateAttributesResponseDto } from './responses/product-validate-attributes-response.dto';
22
+ import { ValidateAttributesRequestDto } from '../requests/validate-attributes-request.dto';
23
+ import { ValidateAttributesResponseDto } from '../responses/validate-attributes-response.dto';
24
24
  import { SetupStatusResponseDto } from '../setup-status-response.dto';
25
25
  import { CompanyDataDto } from '../company-data.dto';
26
26
  export interface ProductControllerInterface {
@@ -34,8 +34,8 @@ export interface ProductControllerInterface {
34
34
  upgradable(requestBody: ProductUpgradableRequestDto & JwtDto): Promise<ProductUpgradableResponseDto>;
35
35
  downgradeable(requestBody: ProductDowngradableRequestDto & JwtDto): Promise<ProductDowngradableResponseDto>;
36
36
  delete(requestBody: ProductDeleteRequestDto & JwtDto): Promise<ProductDeleteResponseDto>;
37
- validateProductAttributes(requestBody: ProductValidateAttributesRequestDto): Promise<ProductValidateAttributesResponseDto | ErrorResponseDto>;
38
- validateItemAttributes(requestBody: ProductValidateAttributesRequestDto): Promise<ProductValidateAttributesResponseDto | ErrorResponseDto>;
37
+ validateProductAttributes(requestBody: ValidateAttributesRequestDto): Promise<ValidateAttributesResponseDto | ErrorResponseDto>;
38
+ validateItemAttributes(requestBody: ValidateAttributesRequestDto): Promise<ValidateAttributesResponseDto | ErrorResponseDto>;
39
39
  setupStatus(): Promise<SetupStatusResponseDto>;
40
40
  install(requestBody: CompanyDataDto & JwtDto): Promise<null | ErrorResponseDto>;
41
41
  uninstall(requestBody: JwtDto): Promise<null | ErrorResponseDto>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * DTO for email recipients
3
+ * Used to define the recipients of an email
4
+ */
5
+ export declare class EmailReceiverDto {
6
+ /**
7
+ * The main email address
8
+ */
9
+ to: string;
10
+ /**
11
+ * List of email addresses for carbon copy (optional)
12
+ * Must be valid and unique email addresses
13
+ */
14
+ cc?: string[];
15
+ /**
16
+ * List of email addresses for blind carbon copy (optional)
17
+ * Must be valid and unique email addresses
18
+ */
19
+ bcc?: string[];
20
+ }
@@ -0,0 +1,39 @@
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.EmailReceiverDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /**
15
+ * DTO for email recipients
16
+ * Used to define the recipients of an email
17
+ */
18
+ class EmailReceiverDto {
19
+ }
20
+ exports.EmailReceiverDto = EmailReceiverDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsNotEmpty)(),
23
+ (0, class_validator_1.IsEmail)(),
24
+ __metadata("design:type", String)
25
+ ], EmailReceiverDto.prototype, "to", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsOptional)(),
28
+ (0, class_validator_1.IsArray)(),
29
+ (0, class_validator_1.IsEmail)({}, { each: true }),
30
+ (0, class_validator_1.ArrayUnique)(),
31
+ __metadata("design:type", Array)
32
+ ], EmailReceiverDto.prototype, "cc", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsOptional)(),
35
+ (0, class_validator_1.IsArray)(),
36
+ (0, class_validator_1.IsEmail)({}, { each: true }),
37
+ (0, class_validator_1.ArrayUnique)(),
38
+ __metadata("design:type", Array)
39
+ ], EmailReceiverDto.prototype, "bcc", void 0);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * DTO for push notification recipients
3
+ * Used to define the recipients of a push notification
4
+ */
5
+ export declare class PushReceiverDto {
6
+ /**
7
+ * The user ID that will receive the push notification
8
+ */
9
+ userId: string;
10
+ /**
11
+ * List of user device tokens
12
+ * Must contain at least one token
13
+ */
14
+ deviceTokens: string[];
15
+ }
@@ -0,0 +1,31 @@
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.PushReceiverDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /**
15
+ * DTO for push notification recipients
16
+ * Used to define the recipients of a push notification
17
+ */
18
+ class PushReceiverDto {
19
+ }
20
+ exports.PushReceiverDto = PushReceiverDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsNotEmpty)(),
23
+ (0, class_validator_1.IsString)(),
24
+ __metadata("design:type", String)
25
+ ], PushReceiverDto.prototype, "userId", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsArray)(),
28
+ (0, class_validator_1.ArrayNotEmpty)(),
29
+ (0, class_validator_1.ArrayMinSize)(1),
30
+ __metadata("design:type", Array)
31
+ ], PushReceiverDto.prototype, "deviceTokens", void 0);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * DTO for SMS recipients
3
+ * Used to define the recipients of an SMS message
4
+ */
5
+ export declare class SmsReceiverDto {
6
+ /**
7
+ * List of recipient phone numbers
8
+ * Must be valid phone numbers
9
+ */
10
+ receiverPhones: string[];
11
+ }
@@ -0,0 +1,26 @@
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.SmsReceiverDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /**
15
+ * DTO for SMS recipients
16
+ * Used to define the recipients of an SMS message
17
+ */
18
+ class SmsReceiverDto {
19
+ }
20
+ exports.SmsReceiverDto = SmsReceiverDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsArray)(),
23
+ (0, class_validator_1.ArrayUnique)(),
24
+ (0, class_validator_1.IsPhoneNumber)(undefined, { each: true }),
25
+ __metadata("design:type", Array)
26
+ ], SmsReceiverDto.prototype, "receiverPhones", void 0);
@@ -0,0 +1,20 @@
1
+ import { EmailReceiverDto } from './receiver/receiver-email.dto';
2
+ import { EmailSenderDto } from './sender/sender-email.dto';
3
+ import { PushSenderDto } from './sender/sender-push.dto';
4
+ import { SmsSenderDto } from './sender/sender-sms.dto';
5
+ import { PushReceiverDto } from './receiver/receiver-push.dto';
6
+ import { SmsReceiverDto } from './receiver/receiver-sms.dto';
7
+ export declare class RequestDto {
8
+ /**
9
+ * Unique identifier of the hoster message
10
+ */
11
+ notificationId: string;
12
+ /**
13
+ * Sender details according to the integration's notification type
14
+ */
15
+ sender: EmailSenderDto | SmsSenderDto | PushSenderDto;
16
+ /**
17
+ * Recipient details according to the integration's notification type
18
+ */
19
+ receiver: EmailReceiverDto | SmsReceiverDto | PushReceiverDto;
20
+ }
@@ -0,0 +1,31 @@
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.RequestDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class RequestDto {
15
+ }
16
+ exports.RequestDto = RequestDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsNotEmpty)(),
19
+ (0, class_validator_1.IsString)(),
20
+ __metadata("design:type", String)
21
+ ], RequestDto.prototype, "notificationId", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsNotEmpty)(),
24
+ (0, class_validator_1.IsObject)(),
25
+ __metadata("design:type", Object)
26
+ ], RequestDto.prototype, "sender", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ (0, class_validator_1.IsObject)(),
30
+ __metadata("design:type", Object)
31
+ ], RequestDto.prototype, "receiver", void 0);
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Represents a request to validate attributes.
3
+ * This DTO is used when a client needs to check the validity of a set of attribute values
4
+ * before proceeding with an action, such as creating or updating a product.
5
+ */
6
+ export declare class ValidateAttributesRequestDto {
7
+ /**
8
+ * The key of the attribute that triggered the validation.
9
+ * This helps the server understand the context of the validation request,
10
+ * especially in cases where validation rules are interdependent.
11
+ */
12
+ triggeredByKey: string;
13
+ /**
14
+ * A record of attribute values to be validated.
15
+ * The keys are the attribute identifiers, and the values are the data to be checked.
16
+ */
17
+ attributeValues: Record<string, unknown>;
18
+ }
@@ -9,29 +9,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ProductUpgradeableRequestDto = void 0;
12
+ exports.ValidateAttributesRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- const class_transformer_1 = require("class-transformer");
15
- const product_item_data_dto_1 = require("../product-item-data.dto");
16
- const client_data_dto_1 = require("../../client-data.dto");
17
14
  /**
18
- * Represents a request to check if a product item is upgradeable.
19
- * This DTO contains all the necessary information for the check.
15
+ * Represents a request to validate attributes.
16
+ * This DTO is used when a client needs to check the validity of a set of attribute values
17
+ * before proceeding with an action, such as creating or updating a product.
20
18
  */
21
- class ProductUpgradeableRequestDto {
19
+ class ValidateAttributesRequestDto {
22
20
  }
23
- exports.ProductUpgradeableRequestDto = ProductUpgradeableRequestDto;
21
+ exports.ValidateAttributesRequestDto = ValidateAttributesRequestDto;
24
22
  __decorate([
25
23
  (0, class_validator_1.IsDefined)(),
26
- (0, class_validator_1.IsObject)(),
27
- (0, class_validator_1.ValidateNested)(),
28
- (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
29
- __metadata("design:type", client_data_dto_1.ClientDataDto)
30
- ], ProductUpgradeableRequestDto.prototype, "clientData", void 0);
24
+ (0, class_validator_1.IsString)(),
25
+ __metadata("design:type", String)
26
+ ], ValidateAttributesRequestDto.prototype, "triggeredByKey", void 0);
31
27
  __decorate([
32
28
  (0, class_validator_1.IsDefined)(),
33
29
  (0, class_validator_1.IsObject)(),
34
- (0, class_validator_1.ValidateNested)(),
35
- (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
36
- __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
37
- ], ProductUpgradeableRequestDto.prototype, "itemData", void 0);
30
+ __metadata("design:type", Object)
31
+ ], ValidateAttributesRequestDto.prototype, "attributeValues", void 0);
@@ -0,0 +1,13 @@
1
+ import { BaseResponse } from "../base-response.dto";
2
+ import { FieldDto } from "../field.dto";
3
+ /**
4
+ * Represents the response from validating product attributes.
5
+ * Contains the list of attributes that have been validated.
6
+ */
7
+ export declare class ValidateAttributesResponseDto extends BaseResponse {
8
+ /**
9
+ * An array of field DTOs representing the validated attributes.
10
+ * Each `FieldDto` contains details about a single attribute.
11
+ */
12
+ validatedAttributes: FieldDto[];
13
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidateAttributesResponseDto = void 0;
4
+ const base_response_dto_1 = require("../base-response.dto");
5
+ /**
6
+ * Represents the response from validating product attributes.
7
+ * Contains the list of attributes that have been validated.
8
+ */
9
+ class ValidateAttributesResponseDto extends base_response_dto_1.BaseResponse {
10
+ }
11
+ exports.ValidateAttributesResponseDto = ValidateAttributesResponseDto;
@@ -0,0 +1,25 @@
1
+ import { AttachmentDto } from '../attachment.dto';
2
+ /**
3
+ * DTO for email sender
4
+ * Used to define the details for sending an email
5
+ */
6
+ export declare class EmailSenderDto {
7
+ /**
8
+ * The full name of the sender
9
+ */
10
+ fullName: string;
11
+ /**
12
+ * The email subject
13
+ * Length restriction from 1 to 500 characters
14
+ */
15
+ subject: string;
16
+ /**
17
+ * The message content
18
+ * Length restriction from 1 to 50000 characters
19
+ */
20
+ message: string;
21
+ /**
22
+ * File attachments (optional)
23
+ */
24
+ attachments?: AttachmentDto[];
25
+ }
@@ -0,0 +1,46 @@
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.EmailSenderDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const attachment_dto_1 = require("../attachment.dto");
16
+ /**
17
+ * DTO for email sender
18
+ * Used to define the details for sending an email
19
+ */
20
+ class EmailSenderDto {
21
+ }
22
+ exports.EmailSenderDto = EmailSenderDto;
23
+ __decorate([
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", String)
27
+ ], EmailSenderDto.prototype, "fullName", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsNotEmpty)(),
30
+ (0, class_validator_1.IsString)(),
31
+ (0, class_validator_1.Length)(1, 500),
32
+ __metadata("design:type", String)
33
+ ], EmailSenderDto.prototype, "subject", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsNotEmpty)(),
36
+ (0, class_validator_1.IsString)(),
37
+ (0, class_validator_1.Length)(1, 50000),
38
+ __metadata("design:type", String)
39
+ ], EmailSenderDto.prototype, "message", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsOptional)(),
42
+ (0, class_validator_1.IsArray)(),
43
+ (0, class_validator_1.ValidateNested)({ each: true }),
44
+ (0, class_transformer_1.Type)(() => attachment_dto_1.AttachmentDto),
45
+ __metadata("design:type", Array)
46
+ ], EmailSenderDto.prototype, "attachments", void 0);
@@ -0,0 +1,31 @@
1
+ /**
2
+ * DTO for push notification sender
3
+ * Used to define the details for sending a push notification
4
+ */
5
+ export declare class PushSenderDto {
6
+ /**
7
+ * Unique identifier of the message
8
+ * Length restriction from 1 to 255 characters
9
+ */
10
+ messageId: string;
11
+ /**
12
+ * The user ID that will receive the push notification
13
+ * Length restriction from 1 to 255 characters
14
+ */
15
+ userId: string;
16
+ /**
17
+ * The title of the push notification
18
+ * Length restriction from 1 to 255 characters
19
+ */
20
+ title: string;
21
+ /**
22
+ * The content of the push notification
23
+ * Length restriction from 1 to 1000 characters
24
+ */
25
+ message: string;
26
+ /**
27
+ * The subtitle of the push notification (optional)
28
+ * Length restriction from 1 to 255 characters
29
+ */
30
+ subtitle?: string;
31
+ }
@@ -0,0 +1,50 @@
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.PushSenderDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /**
15
+ * DTO for push notification sender
16
+ * Used to define the details for sending a push notification
17
+ */
18
+ class PushSenderDto {
19
+ }
20
+ exports.PushSenderDto = PushSenderDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsNotEmpty)(),
23
+ (0, class_validator_1.IsString)(),
24
+ (0, class_validator_1.Length)(1, 255),
25
+ __metadata("design:type", String)
26
+ ], PushSenderDto.prototype, "messageId", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.Length)(1, 255),
31
+ __metadata("design:type", String)
32
+ ], PushSenderDto.prototype, "userId", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ (0, class_validator_1.IsString)(),
36
+ (0, class_validator_1.Length)(1, 255),
37
+ __metadata("design:type", String)
38
+ ], PushSenderDto.prototype, "title", void 0);
39
+ __decorate([
40
+ (0, class_validator_1.IsNotEmpty)(),
41
+ (0, class_validator_1.IsString)(),
42
+ (0, class_validator_1.Length)(1, 1000),
43
+ __metadata("design:type", String)
44
+ ], PushSenderDto.prototype, "message", void 0);
45
+ __decorate([
46
+ (0, class_validator_1.IsOptional)(),
47
+ (0, class_validator_1.IsString)(),
48
+ (0, class_validator_1.Length)(1, 255),
49
+ __metadata("design:type", String)
50
+ ], PushSenderDto.prototype, "subtitle", void 0);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * DTO for SMS sender
3
+ * Used to define the details for sending an SMS message
4
+ */
5
+ export declare class SmsSenderDto {
6
+ /**
7
+ * Sender's phone number
8
+ * Must be a valid phone number
9
+ */
10
+ senderPhone: string;
11
+ /**
12
+ * The content of the SMS message
13
+ */
14
+ message: string;
15
+ }
@@ -0,0 +1,30 @@
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.SmsSenderDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /**
15
+ * DTO for SMS sender
16
+ * Used to define the details for sending an SMS message
17
+ */
18
+ class SmsSenderDto {
19
+ }
20
+ exports.SmsSenderDto = SmsSenderDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsNotEmpty)(),
23
+ (0, class_validator_1.IsPhoneNumber)(),
24
+ __metadata("design:type", String)
25
+ ], SmsSenderDto.prototype, "senderPhone", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsNotEmpty)(),
28
+ (0, class_validator_1.IsString)(),
29
+ __metadata("design:type", String)
30
+ ], SmsSenderDto.prototype, "message", void 0);
@@ -4,6 +4,7 @@ export declare enum ActionsEnum {
4
4
  UPGRADE = "upgrade",
5
5
  DOWNGRADE = "downgrade",
6
6
  TRANSFER = "transfer",
7
+ TRADE = "trade",
7
8
  SUSPEND = "suspend",
8
9
  UNSUSPEND = "unsuspend",
9
10
  DELETE = "delete"
@@ -8,6 +8,7 @@ var ActionsEnum;
8
8
  ActionsEnum["UPGRADE"] = "upgrade";
9
9
  ActionsEnum["DOWNGRADE"] = "downgrade";
10
10
  ActionsEnum["TRANSFER"] = "transfer";
11
+ ActionsEnum["TRADE"] = "trade";
11
12
  ActionsEnum["SUSPEND"] = "suspend";
12
13
  ActionsEnum["UNSUSPEND"] = "unsuspend";
13
14
  ActionsEnum["DELETE"] = "delete";
@@ -0,0 +1,5 @@
1
+ export declare enum MessageTypeEnum {
2
+ EMAIL = "email",
3
+ SMS = "sms",
4
+ PUSH = "push"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MessageTypeEnum = void 0;
4
+ var MessageTypeEnum;
5
+ (function (MessageTypeEnum) {
6
+ MessageTypeEnum["EMAIL"] = "email";
7
+ MessageTypeEnum["SMS"] = "sms";
8
+ MessageTypeEnum["PUSH"] = "push";
9
+ })(MessageTypeEnum || (exports.MessageTypeEnum = MessageTypeEnum = {}));
package/dist/index.d.ts CHANGED
@@ -21,6 +21,8 @@ export * from './dtos/unit.dto';
21
21
  export * from './dtos/admin-panel.dto';
22
22
  export * from './dtos/client-panel.dto';
23
23
  export * from './dtos/settings.dto';
24
+ export * from './dtos/requests/validate-attributes-request.dto';
25
+ export * from './dtos/responses/validate-attributes-response.dto';
24
26
  export * from './dtos/notification/notification-info.dto';
25
27
  export * from './dtos/notification/notification-send-request.dto';
26
28
  export * from './dtos/notification/receiver/receiver-email.dto';
@@ -40,8 +42,6 @@ export * from './dtos/product/requests/product-suspend-request.dto';
40
42
  export * from './dtos/product/requests/product-unsuspend-request.dto';
41
43
  export * from './dtos/product/requests/product-upgrade-request.dto';
42
44
  export * from './dtos/product/requests/product-upgradable-request.dto';
43
- export * from './dtos/product/requests/product-validate-attributes-request.dto';
44
- export * from './dtos/product/requests/item-validate-attributes-request.dto';
45
45
  export * from './dtos/product/responses/product-create-response.dto';
46
46
  export * from './dtos/product/responses/product-delete-response.dto';
47
47
  export * from './dtos/product/responses/product-downgrade-response.dto';
@@ -52,8 +52,6 @@ export * from './dtos/product/responses/product-suspend-response.dto';
52
52
  export * from './dtos/product/responses/product-unsuspend-response.dto';
53
53
  export * from './dtos/product/responses/product-upgrade-response.dto';
54
54
  export * from './dtos/product/responses/product-upgradable-response.dto';
55
- export * from './dtos/product/responses/product-validate-attributes-response.dto';
56
- export * from './dtos/product/responses/item-validate-attributes-response.dto';
57
55
  export * from './enums/actions.enum';
58
56
  export * from './enums/country.enum';
59
57
  export * from './enums/duration.enum';