@hosterai/types 0.0.18 → 0.0.20

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 (63) hide show
  1. package/dist/decorators/all-or-none-validator.spec.d.ts +1 -0
  2. package/dist/decorators/all-or-none-validator.spec.js +91 -0
  3. package/dist/decorators/all-or-none.validator.d.ts +2 -0
  4. package/dist/decorators/all-or-none.validator.js +71 -0
  5. package/dist/decorators/min-less-or-equal-validator.spec.d.ts +1 -0
  6. package/dist/decorators/min-less-or-equal-validator.spec.js +60 -0
  7. package/dist/decorators/min-less-or-equal.validator.d.ts +2 -0
  8. package/dist/decorators/min-less-or-equal.validator.js +58 -0
  9. package/dist/dtos/action.dto.js +21 -0
  10. package/dist/dtos/admin-panel.dto.js +91 -0
  11. package/dist/dtos/client-panel.dto.js +30 -0
  12. package/dist/dtos/field-option.dto.js +16 -0
  13. package/dist/dtos/field.dto.d.ts +2 -0
  14. package/dist/dtos/field.dto.js +94 -16
  15. package/dist/dtos/info.dto.js +62 -0
  16. package/dist/dtos/menu.dto.d.ts +2 -2
  17. package/dist/dtos/menu.dto.js +35 -2
  18. package/dist/dtos/notification/notification-info.dto.js +17 -0
  19. package/dist/dtos/product/product-info.dto.js +27 -0
  20. package/dist/dtos/product/requests/product-downgradeable-request.dto.d.ts +18 -0
  21. package/dist/dtos/product/requests/product-downgradeable-request.dto.js +37 -0
  22. package/dist/dtos/product/requests/product-upgradeable-request.dto.d.ts +18 -0
  23. package/dist/dtos/product/requests/product-upgradeable-request.dto.js +37 -0
  24. package/dist/dtos/product/responses/product-downgradeable-response.dto.d.ts +22 -0
  25. package/dist/dtos/product/responses/product-downgradeable-response.dto.js +11 -0
  26. package/dist/dtos/product/responses/product-upgradeable-response.dto.d.ts +22 -0
  27. package/dist/dtos/product/responses/product-upgradeable-response.dto.js +11 -0
  28. package/dist/dtos/settings.dto.js +22 -0
  29. package/dist/dtos/tab.dto.js +12 -0
  30. package/dist/dtos/unit.dto.js +19 -0
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.js +4 -0
  33. package/dist/openapi/schemas/components.schemas.d.ts +991 -0
  34. package/dist/openapi/schemas/components.schemas.js +2552 -0
  35. package/dist/validators/field-validator.spec.js +26 -0
  36. package/dist/validators/product-downgradeable-request-validator.d.ts +8 -0
  37. package/dist/validators/product-downgradeable-request-validator.js +17 -0
  38. package/dist/validators/product-info-validator.spec.js +87 -0
  39. package/dist/validators/product-upgradeable-request-validator.d.ts +8 -0
  40. package/dist/validators/product-upgradeable-request-validator.js +17 -0
  41. package/package.json +4 -1
  42. package/dist/dtos/info/info-notification.dto.d.ts +0 -5
  43. package/dist/dtos/info/info-notification.dto.js +0 -7
  44. package/dist/dtos/info/info.dto.d.ts +0 -196
  45. package/dist/dtos/info/info.dto.js +0 -278
  46. package/dist/dtos/notification/notification-request.dto.d.ts +0 -20
  47. package/dist/dtos/notification/notification-request.dto.js +0 -31
  48. package/dist/dtos/receiver/receiver-email.dto.d.ts +0 -20
  49. package/dist/dtos/receiver/receiver-email.dto.js +0 -39
  50. package/dist/dtos/receiver/receiver-push.dto.d.ts +0 -15
  51. package/dist/dtos/receiver/receiver-push.dto.js +0 -31
  52. package/dist/dtos/receiver/receiver-sms.dto.d.ts +0 -11
  53. package/dist/dtos/receiver/receiver-sms.dto.js +0 -26
  54. package/dist/dtos/request.dto.d.ts +0 -20
  55. package/dist/dtos/request.dto.js +0 -31
  56. package/dist/dtos/sender/sender-email.dto.d.ts +0 -25
  57. package/dist/dtos/sender/sender-email.dto.js +0 -46
  58. package/dist/dtos/sender/sender-push.dto.d.ts +0 -31
  59. package/dist/dtos/sender/sender-push.dto.js +0 -50
  60. package/dist/dtos/sender/sender-sms.dto.d.ts +0 -15
  61. package/dist/dtos/sender/sender-sms.dto.js +0 -30
  62. package/dist/enums/message-type.enum.d.ts +0 -5
  63. package/dist/enums/message-type.enum.js +0 -9
@@ -17,12 +17,15 @@ const field_type_enum_1 = require("../enums/field-type.enum");
17
17
  const multilang_text_dto_1 = require("./multilang-text.dto");
18
18
  const field_option_dto_1 = require("./field-option.dto");
19
19
  const is_regex_validator_1 = require("../decorators/is-regex.validator");
20
+ const all_or_none_validator_1 = require("../decorators/all-or-none.validator");
21
+ const min_less_or_equal_validator_1 = require("../decorators/min-less-or-equal.validator");
22
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
20
23
  /**
21
24
  * Data Transfer Object for a form field.
22
25
  * This class defines the structure and properties of a single field
23
26
  * that can be used in a user interface form.
24
27
  */
25
- class FieldDto {
28
+ let FieldDto = class FieldDto {
26
29
  constructor() {
27
30
  /**
28
31
  * Indicates if the field triggers remote validation
@@ -35,11 +38,16 @@ class FieldDto {
35
38
  */
36
39
  this.upgradable = false;
37
40
  }
38
- }
41
+ };
39
42
  exports.FieldDto = FieldDto;
40
43
  __decorate([
41
44
  (0, class_validator_1.IsString)(),
42
45
  (0, class_validator_1.IsDefined)(),
46
+ (0, class_validator_jsonschema_1.JSONSchema)({
47
+ title: 'ID',
48
+ description: 'Unique identifier for the field.',
49
+ type: 'string',
50
+ }),
43
51
  __metadata("design:type", String)
44
52
  ], FieldDto.prototype, "id", void 0);
45
53
  __decorate([
@@ -47,6 +55,12 @@ __decorate([
47
55
  (0, class_transformer_1.Type)(() => multilang_text_dto_1.MultilangTextDto),
48
56
  (0, class_validator_1.IsArray)(),
49
57
  (0, class_validator_1.ArrayMinSize)(1),
58
+ (0, class_validator_jsonschema_1.JSONSchema)({
59
+ title: 'Label',
60
+ description: 'Multilingual label for the field.',
61
+ type: 'array',
62
+ items: { $ref: '#/components/schemas/MultilangTextDto' },
63
+ }),
50
64
  __metadata("design:type", Array)
51
65
  ], FieldDto.prototype, "label", void 0);
52
66
  __decorate([
@@ -57,46 +71,84 @@ __decorate([
57
71
  require: true,
58
72
  objectNotEmpty: true,
59
73
  arrayNotEmpty: true,
60
- })
61
- // @IsDefined()
62
- // @ValidateIf(o => typeof o.value === 'string')
63
- // @IsString({ message: 'Value must be a valid string' })
64
- // @ValidateIf(o => typeof o.value === 'number')
65
- // @IsNumber({}, { message: 'Value must be a valid number' })
66
- // @ValidateIf(o => Array.isArray(o.value))
67
- // @IsArray({ message: 'Value must be an array' })
68
- // @ValidateNested({ each: true })
69
- // @Type(() => FieldOptionDto)
70
- // @ValidateIf(o => typeof o.value === 'object' && !Array.isArray(o.value))
71
- // @ValidateNested()
72
- // @Type(() => FieldOptionDto)
73
- ,
74
+ }),
75
+ (0, class_validator_jsonschema_1.JSONSchema)({
76
+ title: 'Value',
77
+ description: 'Value of the field. String/Number, or FieldOptionDto/FieldOptionDto[] depending on type.',
78
+ oneOf: [
79
+ { title: 'String', type: 'string' },
80
+ { title: 'Number', type: 'number' },
81
+ { title: 'Option', $ref: '#/components/schemas/FieldOptionDto' },
82
+ {
83
+ title: 'Options Array',
84
+ type: 'array',
85
+ items: { $ref: '#/components/schemas/FieldOptionDto' },
86
+ },
87
+ ],
88
+ }),
74
89
  __metadata("design:type", Object)
75
90
  ], FieldDto.prototype, "value", void 0);
76
91
  __decorate([
77
92
  (0, class_validator_1.IsEnum)(field_type_enum_1.FieldTypeEnum),
78
93
  (0, class_validator_1.IsDefined)(),
94
+ (0, class_validator_jsonschema_1.JSONSchema)({
95
+ title: 'Field Type',
96
+ description: 'Type of the field.',
97
+ type: 'string',
98
+ enum: Object.values(field_type_enum_1.FieldTypeEnum),
99
+ }),
79
100
  __metadata("design:type", String)
80
101
  ], FieldDto.prototype, "type", void 0);
102
+ __decorate([
103
+ (0, class_validator_1.IsOptional)(),
104
+ (0, class_validator_1.IsNumber)(),
105
+ __metadata("design:type", Number)
106
+ ], FieldDto.prototype, "reapetableMin", void 0);
107
+ __decorate([
108
+ (0, class_validator_1.IsOptional)(),
109
+ (0, class_validator_1.IsNumber)(),
110
+ __metadata("design:type", Number)
111
+ ], FieldDto.prototype, "reapetableMax", void 0);
81
112
  __decorate([
82
113
  (0, class_validator_1.IsBoolean)(),
83
114
  (0, class_validator_1.IsDefined)(),
115
+ (0, class_validator_jsonschema_1.JSONSchema)({
116
+ title: 'Required',
117
+ description: 'Whether the field is required.',
118
+ type: 'boolean',
119
+ }),
84
120
  __metadata("design:type", Boolean)
85
121
  ], FieldDto.prototype, "required", void 0);
86
122
  __decorate([
87
123
  (0, class_validator_1.IsBoolean)(),
88
124
  (0, class_validator_1.IsDefined)(),
125
+ (0, class_validator_jsonschema_1.JSONSchema)({
126
+ title: 'Disabled',
127
+ description: 'Whether the field is disabled.',
128
+ type: 'boolean',
129
+ }),
89
130
  __metadata("design:type", Boolean)
90
131
  ], FieldDto.prototype, "disabled", void 0);
91
132
  __decorate([
92
133
  (0, class_validator_1.IsBoolean)(),
93
134
  (0, class_validator_1.IsDefined)(),
135
+ (0, class_validator_jsonschema_1.JSONSchema)({
136
+ title: 'Hidden',
137
+ description: 'Whether the field is hidden.',
138
+ type: 'boolean',
139
+ }),
94
140
  __metadata("design:type", Boolean)
95
141
  ], FieldDto.prototype, "hidden", void 0);
96
142
  __decorate([
97
143
  (0, class_validator_1.IsString)(),
98
144
  (0, is_regex_validator_1.IsRegex)(),
99
145
  (0, class_validator_1.IsOptional)(),
146
+ (0, class_validator_jsonschema_1.JSONSchema)({
147
+ title: 'Regex Validation',
148
+ description: 'Optional regex to validate input.',
149
+ type: 'string',
150
+ example: '^[A-Za-z0-9_-]+$',
151
+ }),
100
152
  __metadata("design:type", String)
101
153
  ], FieldDto.prototype, "regexValidation", void 0);
102
154
  __decorate([
@@ -104,11 +156,22 @@ __decorate([
104
156
  (0, class_validator_1.ValidateNested)({ each: true }),
105
157
  (0, class_transformer_1.Type)(() => multilang_text_dto_1.MultilangTextDto),
106
158
  (0, class_validator_1.IsOptional)(),
159
+ (0, class_validator_jsonschema_1.JSONSchema)({
160
+ title: 'Regex Validation Error Message',
161
+ description: 'Localized error message shown when regex validation fails.',
162
+ type: 'array',
163
+ items: { $ref: '#/components/schemas/MultilangTextDto' },
164
+ }),
107
165
  __metadata("design:type", Array)
108
166
  ], FieldDto.prototype, "regexValidationErrorMessage", void 0);
109
167
  __decorate([
110
168
  (0, class_validator_1.IsBoolean)(),
111
169
  (0, class_validator_1.IsOptional)(),
170
+ (0, class_validator_jsonschema_1.JSONSchema)({
171
+ title: 'Triggers Remote Validation',
172
+ description: 'If true, field triggers remote validation.',
173
+ type: 'boolean',
174
+ }),
112
175
  __metadata("design:type", Boolean)
113
176
  ], FieldDto.prototype, "triggersRemoteValidation", void 0);
114
177
  __decorate([
@@ -116,10 +179,25 @@ __decorate([
116
179
  (0, class_validator_1.ValidateNested)({ each: true }),
117
180
  (0, class_transformer_1.Type)(() => multilang_text_dto_1.MultilangTextDto),
118
181
  (0, class_validator_1.IsOptional)(),
182
+ (0, class_validator_jsonschema_1.JSONSchema)({
183
+ title: 'Remote Validation Error Message',
184
+ description: 'Localized error messages for remote validation.',
185
+ type: 'array',
186
+ items: { $ref: '#/components/schemas/MultilangTextDto' },
187
+ }),
119
188
  __metadata("design:type", Array)
120
189
  ], FieldDto.prototype, "remoteValidationErrorMessage", void 0);
121
190
  __decorate([
122
191
  (0, class_validator_1.IsBoolean)(),
123
192
  (0, class_validator_1.IsDefined)(),
193
+ (0, class_validator_jsonschema_1.JSONSchema)({
194
+ title: 'Upgradable',
195
+ description: 'Whether the item attribute is upgradable by the user.',
196
+ type: 'boolean',
197
+ }),
124
198
  __metadata("design:type", Boolean)
125
199
  ], FieldDto.prototype, "upgradable", void 0);
200
+ exports.FieldDto = FieldDto = __decorate([
201
+ (0, all_or_none_validator_1.AllOrNoneProperty)(['reapetableMin', 'reapetableMax']),
202
+ (0, min_less_or_equal_validator_1.MinLessOrEqualMaxProperty)(['reapetableMin', 'reapetableMax'])
203
+ ], FieldDto);
@@ -21,6 +21,7 @@ const class_validator_1 = require("class-validator");
21
21
  const class_transformer_1 = require("class-transformer");
22
22
  const admin_panel_dto_1 = require("./admin-panel.dto");
23
23
  const client_panel_dto_1 = require("./client-panel.dto");
24
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
24
25
  /**
25
26
  * DTO for integration information.
26
27
  * This is a central DTO that contains all the necessary information
@@ -39,16 +40,35 @@ exports.InfoDto = InfoDto;
39
40
  __decorate([
40
41
  (0, class_validator_1.IsString)(),
41
42
  (0, class_validator_1.IsNotEmpty)(),
43
+ (0, class_validator_jsonschema_1.JSONSchema)({
44
+ title: 'Title',
45
+ description: 'Integration display title.',
46
+ type: 'string',
47
+ example: 'Example Product'
48
+ }),
42
49
  __metadata("design:type", String)
43
50
  ], InfoDto.prototype, "title", void 0);
44
51
  __decorate([
45
52
  (0, class_validator_1.IsUrl)({ protocols: ['https'], require_protocol: true }),
46
53
  (0, class_validator_1.IsOptional)(),
54
+ (0, class_validator_jsonschema_1.JSONSchema)({
55
+ title: 'Logo URL',
56
+ description: 'Public HTTPS URL for the integration logo.',
57
+ type: 'string',
58
+ format: 'uri',
59
+ example: 'https://cdn.example.com/logo.png'
60
+ }),
47
61
  __metadata("design:type", String)
48
62
  ], InfoDto.prototype, "logo", void 0);
49
63
  __decorate([
50
64
  (0, class_validator_1.IsString)(),
51
65
  (0, class_validator_1.IsOptional)(),
66
+ (0, class_validator_jsonschema_1.JSONSchema)({
67
+ title: 'Description',
68
+ description: 'Short description of the integration.',
69
+ type: 'string',
70
+ example: 'An example product integration.'
71
+ }),
52
72
  __metadata("design:type", String)
53
73
  ], InfoDto.prototype, "description", void 0);
54
74
  __decorate([
@@ -56,12 +76,25 @@ __decorate([
56
76
  (0, class_validator_1.IsArray)(),
57
77
  (0, class_validator_1.IsEnum)(language_enum_1.LanguageEnum, { each: true }),
58
78
  (0, class_validator_1.ArrayMinSize)(1),
79
+ (0, class_validator_jsonschema_1.JSONSchema)({
80
+ title: 'Supported Languages',
81
+ description: 'Locales supported by the integration.',
82
+ type: 'array',
83
+ items: { type: 'string', enum: Object.values(language_enum_1.LanguageEnum) },
84
+ example: ['en']
85
+ }),
59
86
  __metadata("design:type", Array)
60
87
  ], InfoDto.prototype, "supportedLanguages", void 0);
61
88
  __decorate([
62
89
  (0, class_validator_1.IsOptional)(),
63
90
  (0, class_validator_1.IsArray)(),
64
91
  (0, class_validator_1.IsEnum)(actions_enum_1.ActionsEnum, { each: true }),
92
+ (0, class_validator_jsonschema_1.JSONSchema)({
93
+ title: 'Supported Actions',
94
+ description: 'Actions supported by this integration.',
95
+ type: 'array',
96
+ items: { type: 'string', enum: Object.values(actions_enum_1.ActionsEnum) }
97
+ }),
65
98
  __metadata("design:type", Array)
66
99
  ], InfoDto.prototype, "supportedActions", void 0);
67
100
  __decorate([
@@ -69,6 +102,12 @@ __decorate([
69
102
  (0, class_validator_1.IsArray)(),
70
103
  (0, class_validator_1.IsEnum)(events_enum_1.EventsEnum, { each: true }),
71
104
  (0, class_validator_1.ArrayMinSize)(1),
105
+ (0, class_validator_jsonschema_1.JSONSchema)({
106
+ title: 'Listen Events',
107
+ description: 'Platform events the integration can subscribe to.',
108
+ type: 'array',
109
+ items: { type: 'string', enum: Object.values(events_enum_1.EventsEnum) }
110
+ }),
72
111
  __metadata("design:type", Array)
73
112
  ], InfoDto.prototype, "listenEvents", void 0);
74
113
  __decorate([
@@ -76,22 +115,45 @@ __decorate([
76
115
  (0, class_validator_1.IsArray)(),
77
116
  (0, class_validator_1.IsEnum)(roles_enum_1.RolesEnum, { each: true }),
78
117
  (0, class_validator_1.ArrayMinSize)(1),
118
+ (0, class_validator_jsonschema_1.JSONSchema)({
119
+ title: 'Required Roles',
120
+ description: 'Roles required for this integration to operate.',
121
+ type: 'array',
122
+ items: { type: 'string', enum: Object.values(roles_enum_1.RolesEnum) }
123
+ }),
79
124
  __metadata("design:type", Array)
80
125
  ], InfoDto.prototype, "requiredRoles", void 0);
81
126
  __decorate([
82
127
  (0, class_validator_1.IsOptional)(),
83
128
  (0, class_validator_1.ValidateNested)(),
84
129
  (0, class_transformer_1.Type)(() => admin_panel_dto_1.AdminPanelDto),
130
+ (0, class_validator_jsonschema_1.JSONSchema)({
131
+ title: 'Admin Panel',
132
+ description: 'Admin UI links, tabs, and actions provided by the integration.',
133
+ type: 'object'
134
+ }),
85
135
  __metadata("design:type", admin_panel_dto_1.AdminPanelDto)
86
136
  ], InfoDto.prototype, "adminPanel", void 0);
87
137
  __decorate([
88
138
  (0, class_validator_1.IsOptional)(),
89
139
  (0, class_validator_1.ValidateNested)(),
90
140
  (0, class_transformer_1.Type)(() => client_panel_dto_1.ClientPanelDto),
141
+ (0, class_validator_jsonschema_1.JSONSchema)({
142
+ title: 'Client Panel',
143
+ description: 'Client UI links, tabs, and actions provided by the integration.',
144
+ type: 'object'
145
+ }),
91
146
  __metadata("design:type", client_panel_dto_1.ClientPanelDto)
92
147
  ], InfoDto.prototype, "clientPanel", void 0);
93
148
  __decorate([
94
149
  (0, class_validator_1.IsOptional)(),
95
150
  (0, class_validator_1.IsUrl)({ protocols: ['https'], require_protocol: true }),
151
+ (0, class_validator_jsonschema_1.JSONSchema)({
152
+ title: 'Onboarding URL',
153
+ description: 'URL to onboard/configure the integration.',
154
+ type: 'string',
155
+ format: 'uri',
156
+ example: 'https://example.com/onboarding'
157
+ }),
96
158
  __metadata("design:type", String)
97
159
  ], InfoDto.prototype, "onboardingUrl", void 0);
@@ -1,4 +1,4 @@
1
- import { SubmenuDto } from './submenu.dto';
1
+ import { TabDto } from './tab.dto';
2
2
  /**
3
3
  * Base properties shared by all menu items.
4
4
  */
@@ -50,5 +50,5 @@ export declare class MenuDtoWithSubmenu extends BaseMenuDto {
50
50
  * The list of tabs that will appear in the submenu.
51
51
  * If there is only one tab, no submenu or navigation bar will be displayed.
52
52
  */
53
- submenu: SubmenuDto[];
53
+ submenu: TabDto[];
54
54
  }
@@ -11,9 +11,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MenuDtoWithSubmenu = exports.MenuDtoWithUrl = exports.BaseMenuDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- const submenu_dto_1 = require("./submenu.dto");
15
14
  const class_transformer_1 = require("class-transformer");
16
15
  const is_property_forbidden_validator_1 = require("../decorators/is-property-forbidden.validator");
16
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
17
+ const tab_dto_1 = require("./tab.dto");
17
18
  /**
18
19
  * Base properties shared by all menu items.
19
20
  */
@@ -23,11 +24,21 @@ exports.BaseMenuDto = BaseMenuDto;
23
24
  __decorate([
24
25
  (0, class_validator_1.IsString)(),
25
26
  (0, class_validator_1.IsNotEmpty)(),
27
+ (0, class_validator_jsonschema_1.JSONSchema)({
28
+ title: 'Icon',
29
+ description: 'Icon for the menu item.',
30
+ type: 'string',
31
+ }),
26
32
  __metadata("design:type", String)
27
33
  ], BaseMenuDto.prototype, "icon", void 0);
28
34
  __decorate([
29
35
  (0, class_validator_1.IsString)(),
30
36
  (0, class_validator_1.IsNotEmpty)(),
37
+ (0, class_validator_jsonschema_1.JSONSchema)({
38
+ title: 'Label',
39
+ description: 'Label for the menu item.',
40
+ type: 'string',
41
+ }),
31
42
  __metadata("design:type", String)
32
43
  ], BaseMenuDto.prototype, "label", void 0);
33
44
  /**
@@ -40,12 +51,23 @@ exports.MenuDtoWithUrl = MenuDtoWithUrl;
40
51
  __decorate([
41
52
  (0, class_validator_1.IsString)(),
42
53
  (0, class_validator_1.IsNotEmpty)(),
54
+ (0, class_validator_jsonschema_1.JSONSchema)({
55
+ title: 'Type',
56
+ description: 'Type of the menu item.',
57
+ type: 'string',
58
+ }),
43
59
  (0, class_validator_1.IsIn)(['only-url']),
44
60
  __metadata("design:type", String)
45
61
  ], MenuDtoWithUrl.prototype, "type", void 0);
46
62
  __decorate([
47
63
  (0, class_validator_1.IsUrl)({ protocols: ['https'], require_protocol: true }),
48
64
  (0, class_validator_1.IsNotEmpty)(),
65
+ (0, class_validator_jsonschema_1.JSONSchema)({
66
+ title: 'URL',
67
+ description: 'URL associated with the menu item.',
68
+ type: 'string',
69
+ format: 'uri'
70
+ }),
49
71
  __metadata("design:type", String)
50
72
  ], MenuDtoWithUrl.prototype, "url", void 0);
51
73
  __decorate([
@@ -63,6 +85,11 @@ __decorate([
63
85
  (0, class_validator_1.IsString)(),
64
86
  (0, class_validator_1.IsNotEmpty)(),
65
87
  (0, class_validator_1.IsIn)(['with-submenu']),
88
+ (0, class_validator_jsonschema_1.JSONSchema)({
89
+ title: 'Type',
90
+ description: 'Type of the menu item.',
91
+ type: 'string',
92
+ }),
66
93
  __metadata("design:type", String)
67
94
  ], MenuDtoWithSubmenu.prototype, "type", void 0);
68
95
  __decorate([
@@ -72,6 +99,12 @@ __decorate([
72
99
  __decorate([
73
100
  (0, class_validator_1.IsDefined)(),
74
101
  (0, class_validator_1.ValidateNested)({ each: true }),
75
- (0, class_transformer_1.Type)(() => submenu_dto_1.SubmenuDto),
102
+ (0, class_transformer_1.Type)(() => tab_dto_1.TabDto),
103
+ (0, class_validator_jsonschema_1.JSONSchema)({
104
+ title: 'Submenu',
105
+ description: 'List of tabs that will appear in the submenu.',
106
+ type: 'array',
107
+ items: { $ref: '#/components/schemas/TabDto' }
108
+ }),
76
109
  __metadata("design:type", Array)
77
110
  ], MenuDtoWithSubmenu.prototype, "submenu", void 0);
@@ -15,6 +15,7 @@ const notification_message_type_enum_1 = require("../../enums/notification/notif
15
15
  const info_dto_1 = require("../info.dto");
16
16
  const unit_dto_1 = require("../unit.dto");
17
17
  const class_transformer_1 = require("class-transformer");
18
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
18
19
  /**
19
20
  * DTO for notification information.
20
21
  * Extends the base InfoDto to include the notification message type.
@@ -25,6 +26,13 @@ exports.NotificationInfoDto = NotificationInfoDto;
25
26
  __decorate([
26
27
  (0, class_validator_1.IsEnum)(notification_message_type_enum_1.NotificationMessageTypeEnum),
27
28
  (0, class_validator_1.IsDefined)(),
29
+ (0, class_validator_jsonschema_1.JSONSchema)({
30
+ title: 'Notification Type',
31
+ description: 'Notification channel type.',
32
+ type: 'string',
33
+ enum: Object.values(notification_message_type_enum_1.NotificationMessageTypeEnum),
34
+ example: Object.values(notification_message_type_enum_1.NotificationMessageTypeEnum)[0]
35
+ }),
28
36
  __metadata("design:type", String)
29
37
  ], NotificationInfoDto.prototype, "type", void 0);
30
38
  __decorate([
@@ -32,5 +40,14 @@ __decorate([
32
40
  (0, class_validator_1.IsArray)(),
33
41
  (0, class_validator_1.ValidateNested)({ each: true }),
34
42
  (0, class_transformer_1.Type)(() => unit_dto_1.UnitDto),
43
+ (0, class_validator_jsonschema_1.JSONSchema)({
44
+ title: 'Pay-Per-Use Units',
45
+ description: 'Optional metering units for pay-per-use billing.',
46
+ type: 'array',
47
+ items: { $ref: '#/components/schemas/UnitDto' },
48
+ example: [
49
+ { id: 'messages', unitDescription: 'Message sent', intervalDescription: 'Per month' }
50
+ ]
51
+ }),
35
52
  __metadata("design:type", Array)
36
53
  ], NotificationInfoDto.prototype, "payPerUseUnits", void 0);
@@ -17,6 +17,7 @@ const unit_dto_1 = require("../unit.dto");
17
17
  const class_transformer_1 = require("class-transformer");
18
18
  const is_plain_object_validator_1 = require("../../decorators/is-plain-object.validator");
19
19
  const unique_field_in_array_validator_1 = require("../../decorators/unique-field-in-array.validator");
20
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
20
21
  /**
21
22
  * DTO for notification information.
22
23
  * Extends the base InfoDto to include the notification message type.
@@ -31,6 +32,12 @@ __decorate([
31
32
  (0, class_validator_1.ValidateNested)({ each: true }),
32
33
  (0, class_transformer_1.Type)(() => field_dto_1.FieldDto),
33
34
  (0, unique_field_in_array_validator_1.UniqueFieldInArray)('id'),
35
+ (0, class_validator_jsonschema_1.JSONSchema)({
36
+ title: 'Product Attributes',
37
+ description: 'Configurable attributes that apply at the product level.',
38
+ type: 'array',
39
+ items: { $ref: '#/components/schemas/FieldDto' }
40
+ }),
34
41
  __metadata("design:type", Array)
35
42
  ], ProductInfoDto.prototype, "productAttributes", void 0);
36
43
  __decorate([
@@ -40,6 +47,12 @@ __decorate([
40
47
  (0, class_validator_1.ValidateNested)({ each: true }),
41
48
  (0, class_transformer_1.Type)(() => field_dto_1.FieldDto),
42
49
  (0, unique_field_in_array_validator_1.UniqueFieldInArray)('id'),
50
+ (0, class_validator_jsonschema_1.JSONSchema)({
51
+ title: 'Item Attributes',
52
+ description: 'Configurable attributes that apply at the item level.',
53
+ type: 'array',
54
+ items: { $ref: '#/components/schemas/FieldDto' }
55
+ }),
43
56
  __metadata("design:type", Array)
44
57
  ], ProductInfoDto.prototype, "itemAttributes", void 0);
45
58
  __decorate([
@@ -48,10 +61,24 @@ __decorate([
48
61
  (0, class_validator_1.ArrayMinSize)(1),
49
62
  (0, class_validator_1.ValidateNested)({ each: true }),
50
63
  (0, class_transformer_1.Type)(() => unit_dto_1.UnitDto),
64
+ (0, class_validator_jsonschema_1.JSONSchema)({
65
+ title: 'Pay-Per-Use Units',
66
+ description: 'Optional metering units for pay-per-use billing.',
67
+ type: 'array',
68
+ items: { $ref: '#/components/schemas/UnitDto' },
69
+ example: [{ id: 'requests', unitDescription: 'API request', intervalDescription: 'Per month' }]
70
+ }),
51
71
  __metadata("design:type", Array)
52
72
  ], ProductInfoDto.prototype, "payPerUseUnits", void 0);
53
73
  __decorate([
54
74
  (0, class_validator_1.IsOptional)(),
55
75
  (0, is_plain_object_validator_1.IsPlainObject)(),
76
+ (0, class_validator_jsonschema_1.JSONSchema)({
77
+ title: 'Response Data Field Names',
78
+ description: 'Mapping of field names used in provider responses.',
79
+ type: 'object',
80
+ additionalProperties: { type: 'string' },
81
+ example: { external_id: 'id', status_text: 'status' }
82
+ }),
56
83
  __metadata("design:type", Object)
57
84
  ], ProductInfoDto.prototype, "responseDataFieldNames", void 0);
@@ -0,0 +1,18 @@
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
+ }
@@ -0,0 +1,37 @@
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);
@@ -0,0 +1,18 @@
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
+ }
@@ -0,0 +1,37 @@
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);
@@ -0,0 +1,22 @@
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
+ }
@@ -0,0 +1,11 @@
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;