@hosterai/types 0.0.15 → 0.0.16
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/dtos/info/info-notification.dto.d.ts +5 -0
- package/dist/dtos/info/info-notification.dto.js +7 -0
- package/dist/dtos/info/info.dto.d.ts +196 -0
- package/dist/dtos/info/info.dto.js +278 -0
- package/dist/dtos/notification/notification-request.dto.d.ts +20 -0
- package/dist/dtos/notification/notification-request.dto.js +31 -0
- package/dist/dtos/receiver/receiver-email.dto.d.ts +20 -0
- package/dist/dtos/receiver/receiver-email.dto.js +39 -0
- package/dist/dtos/receiver/receiver-push.dto.d.ts +15 -0
- package/dist/dtos/receiver/receiver-push.dto.js +31 -0
- package/dist/dtos/receiver/receiver-sms.dto.d.ts +11 -0
- package/dist/dtos/receiver/receiver-sms.dto.js +26 -0
- package/dist/dtos/request.dto.d.ts +20 -0
- package/dist/dtos/request.dto.js +31 -0
- package/dist/dtos/sender/sender-email.dto.d.ts +25 -0
- package/dist/dtos/sender/sender-email.dto.js +46 -0
- package/dist/dtos/sender/sender-push.dto.d.ts +31 -0
- package/dist/dtos/sender/sender-push.dto.js +50 -0
- package/dist/dtos/sender/sender-sms.dto.d.ts +15 -0
- package/dist/dtos/sender/sender-sms.dto.js +30 -0
- package/dist/enums/message-type.enum.d.ts +5 -0
- package/dist/enums/message-type.enum.js +9 -0
- package/package.json +1 -1
- package/dist/dtos/product/requests/product-downgradeable-request.dto.d.ts +0 -18
- package/dist/dtos/product/requests/product-downgradeable-request.dto.js +0 -37
- package/dist/dtos/product/requests/product-upgradeable-request.dto.d.ts +0 -18
- package/dist/dtos/product/requests/product-upgradeable-request.dto.js +0 -37
- package/dist/dtos/product/responses/product-downgradeable-response.dto.d.ts +0 -22
- package/dist/dtos/product/responses/product-downgradeable-response.dto.js +0 -11
- package/dist/dtos/product/responses/product-upgradeable-response.dto.d.ts +0 -22
- package/dist/dtos/product/responses/product-upgradeable-response.dto.js +0 -11
- package/dist/validators/product-downgradeable-request-validator.d.ts +0 -8
- package/dist/validators/product-downgradeable-request-validator.js +0 -17
- package/dist/validators/product-upgradeable-request-validator.d.ts +0 -8
- package/dist/validators/product-upgradeable-request-validator.js +0 -17
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { ActionsEnum } from '../../enums/actions.enum';
|
|
2
|
+
import { EventsEnum } from '../../enums/events.enum';
|
|
3
|
+
import { FieldDto } from '../field.dto';
|
|
4
|
+
import { ResponseDataDto } from '../response-data.dto';
|
|
5
|
+
import { UnitDto } from '../unit.dto';
|
|
6
|
+
import { LanguageEnum } from '../../enums/language.enum';
|
|
7
|
+
import { RolesEnum } from '../../enums/roles.enum';
|
|
8
|
+
import { ActionDto } from '../action.dto';
|
|
9
|
+
/**
|
|
10
|
+
* DTO for integration information
|
|
11
|
+
* Contains all information related to a service integration
|
|
12
|
+
*/
|
|
13
|
+
export declare class InfoDto {
|
|
14
|
+
/**
|
|
15
|
+
* The title of the integration
|
|
16
|
+
*/
|
|
17
|
+
title: string;
|
|
18
|
+
/**
|
|
19
|
+
* The logo of the integration (optional)
|
|
20
|
+
*/
|
|
21
|
+
logo?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Description of the integration and its services (optional)
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
/**
|
|
27
|
+
* List of supported languages for the integration.
|
|
28
|
+
*/
|
|
29
|
+
supported_languages: LanguageEnum[];
|
|
30
|
+
/**
|
|
31
|
+
* Custom attributes for products.
|
|
32
|
+
*/
|
|
33
|
+
product_attributes?: FieldDto[];
|
|
34
|
+
/**
|
|
35
|
+
* Custom attributes for items.
|
|
36
|
+
*/
|
|
37
|
+
item_attributes?: FieldDto[];
|
|
38
|
+
/**
|
|
39
|
+
* Events that the integration listens to.
|
|
40
|
+
*/
|
|
41
|
+
listen_events?: EventsEnum[];
|
|
42
|
+
/**
|
|
43
|
+
* The roles that need to be accepted by the company
|
|
44
|
+
*/
|
|
45
|
+
requiredRoles?: RolesEnum[];
|
|
46
|
+
/**
|
|
47
|
+
* Actions that are not supported by the integration.
|
|
48
|
+
*/
|
|
49
|
+
unsupportedActions?: ActionsEnum[];
|
|
50
|
+
/**
|
|
51
|
+
* Configuration for the admin panel.
|
|
52
|
+
*/
|
|
53
|
+
adminPanel?: AdminPanelDto;
|
|
54
|
+
/**
|
|
55
|
+
* Configuration for the client panel.
|
|
56
|
+
*/
|
|
57
|
+
clientPanel?: ClientPanelDto;
|
|
58
|
+
/**
|
|
59
|
+
* The url for the onboarding process after installation of the integration
|
|
60
|
+
*/
|
|
61
|
+
onboardingUrl?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Units for pay-per-use billing.
|
|
64
|
+
*/
|
|
65
|
+
payPerUseUnits?: UnitDto[];
|
|
66
|
+
/**
|
|
67
|
+
* Mapping of response data field names.
|
|
68
|
+
*/
|
|
69
|
+
responseDataFieldNames?: Record<keyof ResponseDataDto, string>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* DTO for tabs
|
|
73
|
+
* Used for defining tabs in the user interface
|
|
74
|
+
*/
|
|
75
|
+
declare class TabDto {
|
|
76
|
+
/**
|
|
77
|
+
* The label displayed on the tab
|
|
78
|
+
*/
|
|
79
|
+
label: string;
|
|
80
|
+
/**
|
|
81
|
+
* The URL associated with the tab.
|
|
82
|
+
* The requests coming from the hoster will be signed
|
|
83
|
+
* with jwt, which will contain information about the company
|
|
84
|
+
*/
|
|
85
|
+
url: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* DTO for menu items
|
|
89
|
+
* Extends TabDto and adds icon information
|
|
90
|
+
*/
|
|
91
|
+
declare class MenuDto {
|
|
92
|
+
/**
|
|
93
|
+
* The icon to be displayed for the menu item
|
|
94
|
+
*/
|
|
95
|
+
icon: string;
|
|
96
|
+
/**
|
|
97
|
+
* The name to be displayed for the menu item
|
|
98
|
+
*/
|
|
99
|
+
label: string;
|
|
100
|
+
/**
|
|
101
|
+
* The list of tabs that will appear in the submenu and as a navigation bar above the main content
|
|
102
|
+
* In case of only one tab, there will be neither a submenu nor a navigation bar.
|
|
103
|
+
*/
|
|
104
|
+
tabs: TabDto[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* DTO for the tabs in the admin panel.
|
|
108
|
+
*/
|
|
109
|
+
declare class AdminPanelTabsDto {
|
|
110
|
+
/**
|
|
111
|
+
* Tabs related to products.
|
|
112
|
+
*/
|
|
113
|
+
product: TabDto[];
|
|
114
|
+
/**
|
|
115
|
+
* Tabs related to items.
|
|
116
|
+
*/
|
|
117
|
+
item: TabDto[];
|
|
118
|
+
/**
|
|
119
|
+
* Tabs related to clients.
|
|
120
|
+
*/
|
|
121
|
+
client: TabDto[];
|
|
122
|
+
/**
|
|
123
|
+
* Tabs related to orders.
|
|
124
|
+
*/
|
|
125
|
+
order: TabDto[];
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* DTO for actions available in a panel.
|
|
129
|
+
*/
|
|
130
|
+
declare class PanelActionsDto {
|
|
131
|
+
/**
|
|
132
|
+
* Actions related to clients.
|
|
133
|
+
*/
|
|
134
|
+
client?: ActionDto[];
|
|
135
|
+
/**
|
|
136
|
+
* Actions related to items.
|
|
137
|
+
*/
|
|
138
|
+
item?: ActionDto[];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* DTO for the admin panel configuration.
|
|
142
|
+
*/
|
|
143
|
+
declare class AdminPanelDto {
|
|
144
|
+
/**
|
|
145
|
+
* Configuration for the tabs in the admin panel.
|
|
146
|
+
*/
|
|
147
|
+
tabs?: AdminPanelTabsDto;
|
|
148
|
+
/**
|
|
149
|
+
* Additional actions available in the admin panel.
|
|
150
|
+
*/
|
|
151
|
+
moreActions?: PanelActionsDto;
|
|
152
|
+
/**
|
|
153
|
+
* Main menu for the admin panel.
|
|
154
|
+
*/
|
|
155
|
+
menu?: MenuDto;
|
|
156
|
+
/**
|
|
157
|
+
* Settings menu for the admin panel.
|
|
158
|
+
*/
|
|
159
|
+
settings?: MenuDto;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* DTO for the tabs in the client panel.
|
|
163
|
+
*/
|
|
164
|
+
declare class ClientPanelTabsDto {
|
|
165
|
+
/**
|
|
166
|
+
* Tabs related to items.
|
|
167
|
+
*/
|
|
168
|
+
item: TabDto[];
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* DTO for actions available in the client panel.
|
|
172
|
+
*/
|
|
173
|
+
declare class ClientPanelActionsDto {
|
|
174
|
+
/**
|
|
175
|
+
* Actions related to items.
|
|
176
|
+
*/
|
|
177
|
+
item?: ActionDto[];
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* DTO for the client panel configuration.
|
|
181
|
+
*/
|
|
182
|
+
declare class ClientPanelDto {
|
|
183
|
+
/**
|
|
184
|
+
* Configuration for the tabs in the client panel.
|
|
185
|
+
*/
|
|
186
|
+
tabs?: ClientPanelTabsDto;
|
|
187
|
+
/**
|
|
188
|
+
* Additional actions available in the client panel.
|
|
189
|
+
*/
|
|
190
|
+
moreActions?: ClientPanelActionsDto;
|
|
191
|
+
/**
|
|
192
|
+
* Main menu for the client panel.
|
|
193
|
+
*/
|
|
194
|
+
menu?: MenuDto;
|
|
195
|
+
}
|
|
196
|
+
export {};
|
|
@@ -0,0 +1,278 @@
|
|
|
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.InfoDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const actions_enum_1 = require("../../enums/actions.enum");
|
|
16
|
+
const events_enum_1 = require("../../enums/events.enum");
|
|
17
|
+
const field_dto_1 = require("../field.dto");
|
|
18
|
+
const unit_dto_1 = require("../unit.dto");
|
|
19
|
+
const language_enum_1 = require("../../enums/language.enum");
|
|
20
|
+
const roles_enum_1 = require("../../enums/roles.enum");
|
|
21
|
+
const action_dto_1 = require("../action.dto");
|
|
22
|
+
/**
|
|
23
|
+
* DTO for integration information
|
|
24
|
+
* Contains all information related to a service integration
|
|
25
|
+
*/
|
|
26
|
+
class InfoDto {
|
|
27
|
+
constructor() {
|
|
28
|
+
/**
|
|
29
|
+
* Actions that are not supported by the integration.
|
|
30
|
+
*/
|
|
31
|
+
this.unsupportedActions = [];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.InfoDto = InfoDto;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], InfoDto.prototype, "title", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], InfoDto.prototype, "logo", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsString)(),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], InfoDto.prototype, "description", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsArray)(),
|
|
52
|
+
(0, class_validator_1.IsEnum)(language_enum_1.LanguageEnum, { each: true }),
|
|
53
|
+
__metadata("design:type", Array)
|
|
54
|
+
], InfoDto.prototype, "supported_languages", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.IsArray)(),
|
|
57
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
58
|
+
(0, class_transformer_1.Type)(() => field_dto_1.FieldDto),
|
|
59
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
__metadata("design:type", Array)
|
|
61
|
+
], InfoDto.prototype, "product_attributes", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_validator_1.IsArray)(),
|
|
64
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
65
|
+
(0, class_transformer_1.Type)(() => field_dto_1.FieldDto),
|
|
66
|
+
(0, class_validator_1.IsOptional)(),
|
|
67
|
+
__metadata("design:type", Array)
|
|
68
|
+
], InfoDto.prototype, "item_attributes", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_validator_1.IsArray)(),
|
|
71
|
+
(0, class_validator_1.IsEnum)(events_enum_1.EventsEnum, { each: true }),
|
|
72
|
+
(0, class_validator_1.IsOptional)(),
|
|
73
|
+
__metadata("design:type", Array)
|
|
74
|
+
], InfoDto.prototype, "listen_events", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, class_validator_1.IsArray)(),
|
|
77
|
+
(0, class_validator_1.IsEnum)(roles_enum_1.RolesEnum, { each: true }),
|
|
78
|
+
(0, class_validator_1.IsOptional)(),
|
|
79
|
+
__metadata("design:type", Array)
|
|
80
|
+
], InfoDto.prototype, "requiredRoles", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_validator_1.IsArray)(),
|
|
83
|
+
(0, class_validator_1.IsEnum)(actions_enum_1.ActionsEnum, { each: true }),
|
|
84
|
+
(0, class_validator_1.IsOptional)(),
|
|
85
|
+
__metadata("design:type", Array)
|
|
86
|
+
], InfoDto.prototype, "unsupportedActions", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
(0, class_validator_1.ValidateNested)(),
|
|
90
|
+
(0, class_transformer_1.Type)(() => AdminPanelDto),
|
|
91
|
+
__metadata("design:type", AdminPanelDto)
|
|
92
|
+
], InfoDto.prototype, "adminPanel", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, class_validator_1.IsOptional)(),
|
|
95
|
+
(0, class_validator_1.ValidateNested)(),
|
|
96
|
+
(0, class_transformer_1.Type)(() => ClientPanelDto),
|
|
97
|
+
__metadata("design:type", ClientPanelDto)
|
|
98
|
+
], InfoDto.prototype, "clientPanel", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, class_validator_1.IsOptional)(),
|
|
101
|
+
(0, class_validator_1.IsUrl)(),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], InfoDto.prototype, "onboardingUrl", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, class_validator_1.IsArray)(),
|
|
106
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
107
|
+
(0, class_transformer_1.Type)(() => unit_dto_1.UnitDto),
|
|
108
|
+
(0, class_validator_1.IsOptional)(),
|
|
109
|
+
__metadata("design:type", Array)
|
|
110
|
+
], InfoDto.prototype, "payPerUseUnits", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, class_validator_1.IsObject)(),
|
|
113
|
+
(0, class_validator_1.IsOptional)(),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], InfoDto.prototype, "responseDataFieldNames", void 0);
|
|
116
|
+
/**
|
|
117
|
+
* DTO for tabs
|
|
118
|
+
* Used for defining tabs in the user interface
|
|
119
|
+
*/
|
|
120
|
+
class TabDto {
|
|
121
|
+
}
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, class_validator_1.IsString)(),
|
|
124
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
125
|
+
__metadata("design:type", String)
|
|
126
|
+
], TabDto.prototype, "label", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, class_validator_1.IsString)(),
|
|
129
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
130
|
+
(0, class_validator_1.IsUrl)(),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], TabDto.prototype, "url", void 0);
|
|
133
|
+
/**
|
|
134
|
+
* DTO for menu items
|
|
135
|
+
* Extends TabDto and adds icon information
|
|
136
|
+
*/
|
|
137
|
+
class MenuDto {
|
|
138
|
+
}
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, class_validator_1.IsString)(),
|
|
141
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
142
|
+
__metadata("design:type", String)
|
|
143
|
+
], MenuDto.prototype, "icon", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, class_validator_1.IsString)(),
|
|
146
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
147
|
+
__metadata("design:type", String)
|
|
148
|
+
], MenuDto.prototype, "label", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, class_validator_1.IsArray)(),
|
|
151
|
+
(0, class_validator_1.MinLength)(1),
|
|
152
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
153
|
+
(0, class_transformer_1.Type)(() => TabDto),
|
|
154
|
+
__metadata("design:type", Array)
|
|
155
|
+
], MenuDto.prototype, "tabs", void 0);
|
|
156
|
+
/**
|
|
157
|
+
* DTO for the tabs in the admin panel.
|
|
158
|
+
*/
|
|
159
|
+
class AdminPanelTabsDto {
|
|
160
|
+
}
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, class_validator_1.IsArray)(),
|
|
163
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
164
|
+
(0, class_transformer_1.Type)(() => TabDto),
|
|
165
|
+
__metadata("design:type", Array)
|
|
166
|
+
], AdminPanelTabsDto.prototype, "product", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, class_validator_1.IsArray)(),
|
|
169
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
170
|
+
(0, class_transformer_1.Type)(() => TabDto),
|
|
171
|
+
__metadata("design:type", Array)
|
|
172
|
+
], AdminPanelTabsDto.prototype, "item", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, class_validator_1.IsArray)(),
|
|
175
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
176
|
+
(0, class_transformer_1.Type)(() => TabDto),
|
|
177
|
+
__metadata("design:type", Array)
|
|
178
|
+
], AdminPanelTabsDto.prototype, "client", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
(0, class_validator_1.IsArray)(),
|
|
181
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
182
|
+
(0, class_transformer_1.Type)(() => TabDto),
|
|
183
|
+
__metadata("design:type", Array)
|
|
184
|
+
], AdminPanelTabsDto.prototype, "order", void 0);
|
|
185
|
+
/**
|
|
186
|
+
* DTO for actions available in a panel.
|
|
187
|
+
*/
|
|
188
|
+
class PanelActionsDto {
|
|
189
|
+
}
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, class_validator_1.IsArray)(),
|
|
192
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
193
|
+
(0, class_transformer_1.Type)(() => action_dto_1.ActionDto),
|
|
194
|
+
(0, class_validator_1.IsOptional)(),
|
|
195
|
+
__metadata("design:type", Array)
|
|
196
|
+
], PanelActionsDto.prototype, "client", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, class_validator_1.IsArray)(),
|
|
199
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
200
|
+
(0, class_transformer_1.Type)(() => action_dto_1.ActionDto),
|
|
201
|
+
(0, class_validator_1.IsOptional)(),
|
|
202
|
+
__metadata("design:type", Array)
|
|
203
|
+
], PanelActionsDto.prototype, "item", void 0);
|
|
204
|
+
/**
|
|
205
|
+
* DTO for the admin panel configuration.
|
|
206
|
+
*/
|
|
207
|
+
class AdminPanelDto {
|
|
208
|
+
}
|
|
209
|
+
__decorate([
|
|
210
|
+
(0, class_validator_1.IsOptional)(),
|
|
211
|
+
(0, class_validator_1.ValidateNested)(),
|
|
212
|
+
(0, class_transformer_1.Type)(() => AdminPanelTabsDto),
|
|
213
|
+
__metadata("design:type", AdminPanelTabsDto)
|
|
214
|
+
], AdminPanelDto.prototype, "tabs", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
(0, class_validator_1.IsOptional)(),
|
|
217
|
+
(0, class_validator_1.ValidateNested)(),
|
|
218
|
+
(0, class_transformer_1.Type)(() => PanelActionsDto),
|
|
219
|
+
__metadata("design:type", PanelActionsDto)
|
|
220
|
+
], AdminPanelDto.prototype, "moreActions", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
(0, class_validator_1.IsOptional)(),
|
|
223
|
+
(0, class_validator_1.ValidateNested)(),
|
|
224
|
+
(0, class_transformer_1.Type)(() => MenuDto),
|
|
225
|
+
__metadata("design:type", MenuDto)
|
|
226
|
+
], AdminPanelDto.prototype, "menu", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
(0, class_validator_1.IsOptional)(),
|
|
229
|
+
(0, class_validator_1.ValidateNested)(),
|
|
230
|
+
(0, class_transformer_1.Type)(() => MenuDto),
|
|
231
|
+
__metadata("design:type", MenuDto)
|
|
232
|
+
], AdminPanelDto.prototype, "settings", void 0);
|
|
233
|
+
/**
|
|
234
|
+
* DTO for the tabs in the client panel.
|
|
235
|
+
*/
|
|
236
|
+
class ClientPanelTabsDto {
|
|
237
|
+
}
|
|
238
|
+
__decorate([
|
|
239
|
+
(0, class_validator_1.IsArray)(),
|
|
240
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
241
|
+
(0, class_transformer_1.Type)(() => TabDto),
|
|
242
|
+
__metadata("design:type", Array)
|
|
243
|
+
], ClientPanelTabsDto.prototype, "item", void 0);
|
|
244
|
+
/**
|
|
245
|
+
* DTO for actions available in the client panel.
|
|
246
|
+
*/
|
|
247
|
+
class ClientPanelActionsDto {
|
|
248
|
+
}
|
|
249
|
+
__decorate([
|
|
250
|
+
(0, class_validator_1.IsArray)(),
|
|
251
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
252
|
+
(0, class_transformer_1.Type)(() => action_dto_1.ActionDto),
|
|
253
|
+
(0, class_validator_1.IsOptional)(),
|
|
254
|
+
__metadata("design:type", Array)
|
|
255
|
+
], ClientPanelActionsDto.prototype, "item", void 0);
|
|
256
|
+
/**
|
|
257
|
+
* DTO for the client panel configuration.
|
|
258
|
+
*/
|
|
259
|
+
class ClientPanelDto {
|
|
260
|
+
}
|
|
261
|
+
__decorate([
|
|
262
|
+
(0, class_validator_1.IsOptional)(),
|
|
263
|
+
(0, class_validator_1.ValidateNested)(),
|
|
264
|
+
(0, class_transformer_1.Type)(() => ClientPanelTabsDto),
|
|
265
|
+
__metadata("design:type", ClientPanelTabsDto)
|
|
266
|
+
], ClientPanelDto.prototype, "tabs", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
(0, class_validator_1.IsOptional)(),
|
|
269
|
+
(0, class_validator_1.ValidateNested)(),
|
|
270
|
+
(0, class_transformer_1.Type)(() => ClientPanelActionsDto),
|
|
271
|
+
__metadata("design:type", ClientPanelActionsDto)
|
|
272
|
+
], ClientPanelDto.prototype, "moreActions", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
(0, class_validator_1.IsOptional)(),
|
|
275
|
+
(0, class_validator_1.ValidateNested)(),
|
|
276
|
+
(0, class_transformer_1.Type)(() => MenuDto),
|
|
277
|
+
__metadata("design:type", MenuDto)
|
|
278
|
+
], ClientPanelDto.prototype, "menu", void 0);
|
|
@@ -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);
|
|
@@ -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,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,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);
|
|
@@ -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/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ProductItemDataDto } from '../product-item-data.dto';
|
|
2
|
-
import { ClientDataDto } from '../../client-data.dto';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a request to check if a product item is downgradable.
|
|
5
|
-
* This DTO contains all the necessary information for the check.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProductDowngradableRequestDto {
|
|
8
|
-
/**
|
|
9
|
-
* The client's data.
|
|
10
|
-
* This object holds all the relevant information about the client initiating the request.
|
|
11
|
-
*/
|
|
12
|
-
clientData: ClientDataDto;
|
|
13
|
-
/**
|
|
14
|
-
* The data of the product item to be checked.
|
|
15
|
-
* This object contains the specific details of the product instance being evaluated.
|
|
16
|
-
*/
|
|
17
|
-
itemData: ProductItemDataDto;
|
|
18
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ProductDowngradableRequestDto = void 0;
|
|
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
|
-
/**
|
|
18
|
-
* Represents a request to check if a product item is downgradable.
|
|
19
|
-
* This DTO contains all the necessary information for the check.
|
|
20
|
-
*/
|
|
21
|
-
class ProductDowngradableRequestDto {
|
|
22
|
-
}
|
|
23
|
-
exports.ProductDowngradableRequestDto = ProductDowngradableRequestDto;
|
|
24
|
-
__decorate([
|
|
25
|
-
(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
|
-
], ProductDowngradableRequestDto.prototype, "clientData", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, class_validator_1.IsDefined)(),
|
|
33
|
-
(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
|
-
], ProductDowngradableRequestDto.prototype, "itemData", void 0);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ProductItemDataDto } from '../product-item-data.dto';
|
|
2
|
-
import { ClientDataDto } from '../../client-data.dto';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a request to check if a product item is upgradeable.
|
|
5
|
-
* This DTO contains all the necessary information for the check.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProductUpgradeableRequestDto {
|
|
8
|
-
/**
|
|
9
|
-
* The client's data.
|
|
10
|
-
* This object holds all the relevant information about the client initiating the request.
|
|
11
|
-
*/
|
|
12
|
-
clientData: ClientDataDto;
|
|
13
|
-
/**
|
|
14
|
-
* The data of the product item to be checked.
|
|
15
|
-
* This object contains the specific details of the product instance being evaluated.
|
|
16
|
-
*/
|
|
17
|
-
itemData: ProductItemDataDto;
|
|
18
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ProductUpgradeableRequestDto = void 0;
|
|
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
|
-
/**
|
|
18
|
-
* Represents a request to check if a product item is upgradeable.
|
|
19
|
-
* This DTO contains all the necessary information for the check.
|
|
20
|
-
*/
|
|
21
|
-
class ProductUpgradeableRequestDto {
|
|
22
|
-
}
|
|
23
|
-
exports.ProductUpgradeableRequestDto = ProductUpgradeableRequestDto;
|
|
24
|
-
__decorate([
|
|
25
|
-
(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);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, class_validator_1.IsDefined)(),
|
|
33
|
-
(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);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ResponseStatusEnum } from '../../../enums/response-status.enum';
|
|
2
|
-
import { BaseResponse } from '../../base-response.dto';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the response for a product downgradeable check.
|
|
5
|
-
* It indicates whether a product item is downgradeable and may contain additional data.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProductDowngradeableResponseDto extends BaseResponse {
|
|
8
|
-
/**
|
|
9
|
-
* The status of the response, indicating success or failure.
|
|
10
|
-
*/
|
|
11
|
-
status: ResponseStatusEnum;
|
|
12
|
-
/**
|
|
13
|
-
* The unique identifier of the product item being checked.
|
|
14
|
-
*/
|
|
15
|
-
itemId: string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional data associated with the downgradeable check.
|
|
18
|
-
* Can contain details about available downgrades or reasons for failure.
|
|
19
|
-
* @optional
|
|
20
|
-
*/
|
|
21
|
-
data?: Record<string, unknown>;
|
|
22
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductDowngradeableResponseDto = void 0;
|
|
4
|
-
const base_response_dto_1 = require("../../base-response.dto");
|
|
5
|
-
/**
|
|
6
|
-
* Represents the response for a product downgradeable check.
|
|
7
|
-
* It indicates whether a product item is downgradeable and may contain additional data.
|
|
8
|
-
*/
|
|
9
|
-
class ProductDowngradeableResponseDto extends base_response_dto_1.BaseResponse {
|
|
10
|
-
}
|
|
11
|
-
exports.ProductDowngradeableResponseDto = ProductDowngradeableResponseDto;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ResponseStatusEnum } from '../../../enums/response-status.enum';
|
|
2
|
-
import { BaseResponse } from '../../base-response.dto';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the response for a product upgradeable check.
|
|
5
|
-
* It indicates whether a product item is upgradeable and may contain additional data.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProductUpgradeableResponseDto extends BaseResponse {
|
|
8
|
-
/**
|
|
9
|
-
* The status of the response, indicating success or failure.
|
|
10
|
-
*/
|
|
11
|
-
status: ResponseStatusEnum;
|
|
12
|
-
/**
|
|
13
|
-
* The unique identifier of the product item being checked.
|
|
14
|
-
*/
|
|
15
|
-
itemId: string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional data associated with the upgradeable check.
|
|
18
|
-
* Can contain details about available upgrades or reasons for failure.
|
|
19
|
-
* @optional
|
|
20
|
-
*/
|
|
21
|
-
data?: Record<string, unknown>;
|
|
22
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductUpgradeableResponseDto = void 0;
|
|
4
|
-
const base_response_dto_1 = require("../../base-response.dto");
|
|
5
|
-
/**
|
|
6
|
-
* Represents the response for a product upgradeable check.
|
|
7
|
-
* It indicates whether a product item is upgradeable and may contain additional data.
|
|
8
|
-
*/
|
|
9
|
-
class ProductUpgradeableResponseDto extends base_response_dto_1.BaseResponse {
|
|
10
|
-
}
|
|
11
|
-
exports.ProductUpgradeableResponseDto = ProductUpgradeableResponseDto;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from 'class-validator';
|
|
2
|
-
/**
|
|
3
|
-
* Validates a product downgradable request object.
|
|
4
|
-
*
|
|
5
|
-
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
6
|
-
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
7
|
-
*/
|
|
8
|
-
export declare const validateProductDowngradableRequestDto: (plainObject: Record<string, unknown>) => Promise<ValidationError[]>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateProductDowngradableRequestDto = void 0;
|
|
4
|
-
const class_validator_1 = require("class-validator");
|
|
5
|
-
const class_transformer_1 = require("class-transformer");
|
|
6
|
-
const product_downgradable_request_dto_1 = require("../dtos/product/requests/product-downgradable-request.dto");
|
|
7
|
-
/**
|
|
8
|
-
* Validates a product downgradable request object.
|
|
9
|
-
*
|
|
10
|
-
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
11
|
-
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
12
|
-
*/
|
|
13
|
-
const validateProductDowngradableRequestDto = async (plainObject) => {
|
|
14
|
-
const request = (0, class_transformer_1.plainToInstance)(product_downgradable_request_dto_1.ProductDowngradableRequestDto, plainObject);
|
|
15
|
-
return await (0, class_validator_1.validate)(request);
|
|
16
|
-
};
|
|
17
|
-
exports.validateProductDowngradableRequestDto = validateProductDowngradableRequestDto;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from 'class-validator';
|
|
2
|
-
/**
|
|
3
|
-
* Validates a product upgradeable request object.
|
|
4
|
-
*
|
|
5
|
-
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
6
|
-
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
7
|
-
*/
|
|
8
|
-
export declare const validateProductUpgradeableRequestDto: (plainObject: Record<string, unknown>) => Promise<ValidationError[]>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateProductUpgradeableRequestDto = void 0;
|
|
4
|
-
const class_validator_1 = require("class-validator");
|
|
5
|
-
const class_transformer_1 = require("class-transformer");
|
|
6
|
-
const product_upgradeable_request_dto_1 = require("../dtos/product/requests/product-upgradeable-request.dto");
|
|
7
|
-
/**
|
|
8
|
-
* Validates a product upgradeable request object.
|
|
9
|
-
*
|
|
10
|
-
* @param {Record<string, unknown>} plainObject - The plain object to validate.
|
|
11
|
-
* @returns {Promise<ValidationError[]>} - A promise that resolves with an array of validation errors.
|
|
12
|
-
*/
|
|
13
|
-
const validateProductUpgradeableRequestDto = async (plainObject) => {
|
|
14
|
-
const request = (0, class_transformer_1.plainToInstance)(product_upgradeable_request_dto_1.ProductUpgradeableRequestDto, plainObject);
|
|
15
|
-
return await (0, class_validator_1.validate)(request);
|
|
16
|
-
};
|
|
17
|
-
exports.validateProductUpgradeableRequestDto = validateProductUpgradeableRequestDto;
|