@hosterai/types 0.0.25 → 0.0.27

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 (162) hide show
  1. package/README.md +49 -8
  2. package/dist/dtos/addon-field.dto.d.ts +7 -0
  3. package/dist/dtos/addon-field.dto.js +11 -0
  4. package/dist/dtos/attachment.dto.js +17 -0
  5. package/dist/dtos/attribute-field.dto.d.ts +19 -0
  6. package/dist/dtos/attribute-field.dto.js +64 -0
  7. package/dist/dtos/base-response.dto.js +11 -0
  8. package/dist/dtos/client-data.dto.js +82 -0
  9. package/dist/dtos/company-data.dto.js +97 -0
  10. package/dist/dtos/country.dto.d.ts +7 -0
  11. package/dist/dtos/country.dto.js +21 -0
  12. package/dist/dtos/error-response.dto.js +15 -0
  13. package/dist/dtos/field.dto.d.ts +8 -13
  14. package/dist/dtos/field.dto.js +22 -47
  15. package/dist/dtos/info.dto.d.ts +0 -5
  16. package/dist/dtos/info.dto.js +0 -19
  17. package/dist/dtos/invoice/invoice-info.dto.d.ts +15 -0
  18. package/dist/dtos/invoice/invoice-info.dto.js +42 -0
  19. package/dist/dtos/invoice/invoice-item-data.dto.d.ts +10 -0
  20. package/dist/dtos/invoice/invoice-item-data.dto.js +34 -0
  21. package/dist/dtos/invoice/requests/credit-note-request.dto.d.ts +9 -0
  22. package/dist/dtos/invoice/requests/credit-note-request.dto.js +32 -0
  23. package/dist/dtos/invoice/requests/invoice-request.dto.d.ts +9 -0
  24. package/dist/dtos/invoice/requests/invoice-request.dto.js +32 -0
  25. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.d.ts +24 -0
  26. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.js +104 -0
  27. package/dist/dtos/invoice/requests/tax-details-request.dto.d.ts +31 -0
  28. package/dist/dtos/invoice/requests/tax-details-request.dto.js +84 -0
  29. package/dist/dtos/invoice/responses/credit-note-response.dto.d.ts +7 -0
  30. package/dist/dtos/invoice/responses/credit-note-response.dto.js +11 -0
  31. package/dist/dtos/invoice/responses/invoice-response.dto.d.ts +7 -0
  32. package/dist/dtos/invoice/responses/invoice-response.dto.js +11 -0
  33. package/dist/dtos/invoice/responses/proforma-invoice-response.dto.d.ts +12 -0
  34. package/dist/dtos/invoice/responses/proforma-invoice-response.dto.js +52 -0
  35. package/dist/dtos/invoice/responses/tax-details-response.dto.d.ts +20 -0
  36. package/dist/dtos/invoice/responses/tax-details-response.dto.js +56 -0
  37. package/dist/dtos/invoice/tin-validation-details.dto.d.ts +51 -0
  38. package/dist/dtos/invoice/tin-validation-details.dto.js +165 -0
  39. package/dist/dtos/invoice/transaction-data.dto.d.ts +14 -0
  40. package/dist/dtos/invoice/transaction-data.dto.js +64 -0
  41. package/dist/dtos/invoice-contact-data.dto.d.ts +43 -0
  42. package/dist/dtos/invoice-contact-data.dto.js +222 -0
  43. package/dist/dtos/item-data.dto.d.ts +44 -0
  44. package/dist/dtos/item-data.dto.js +131 -0
  45. package/dist/dtos/jwt.dto.js +27 -0
  46. package/dist/dtos/multilang-text.dto.js +12 -0
  47. package/dist/dtos/notification/receiver/receiver-email.dto.js +19 -0
  48. package/dist/dtos/notification/receiver/receiver-sms.dto.js +7 -0
  49. package/dist/dtos/notification/requests/notification-send-request.dto.d.ts +18 -0
  50. package/dist/dtos/notification/requests/notification-send-request.dto.js +90 -0
  51. package/dist/dtos/notification/responses/notification-send-response.dto.d.ts +9 -0
  52. package/dist/dtos/notification/responses/notification-send-response.dto.js +32 -0
  53. package/dist/dtos/notification/sender/sender-email.dto.js +26 -0
  54. package/dist/dtos/notification/sender/sender-push.dto.js +36 -0
  55. package/dist/dtos/notification/sender/sender-sms.dto.js +11 -0
  56. package/dist/dtos/product/product-info.dto.d.ts +8 -3
  57. package/dist/dtos/product/product-info.dto.js +25 -5
  58. package/dist/dtos/product/product-item-data.dto.d.ts +7 -28
  59. package/dist/dtos/product/product-item-data.dto.js +14 -23
  60. package/dist/dtos/product/requests/product-create-request.dto.js +11 -0
  61. package/dist/dtos/product/requests/product-delete-request.dto.js +11 -0
  62. package/dist/dtos/product/requests/product-downgradable-request.dto.js +11 -0
  63. package/dist/dtos/product/requests/product-downgrade-request.dto.js +16 -0
  64. package/dist/dtos/product/requests/product-renew-request.dto.js +11 -0
  65. package/dist/dtos/product/requests/product-suspend-request.dto.js +11 -0
  66. package/dist/dtos/product/requests/product-unsuspend-request.dto.js +11 -0
  67. package/dist/dtos/product/requests/product-upgradable-request.dto.js +11 -0
  68. package/dist/dtos/product/requests/product-upgrade-request.dto.js +16 -0
  69. package/dist/dtos/product/responses/product-create-response.dto.js +37 -0
  70. package/dist/dtos/product/responses/product-delete-response.dto.js +37 -0
  71. package/dist/dtos/product/responses/product-downgradable-response.dto.js +37 -0
  72. package/dist/dtos/product/responses/product-downgrade-response.dto.js +37 -0
  73. package/dist/dtos/product/responses/product-info-response.dto.js +23 -0
  74. package/dist/dtos/product/responses/product-renew-response.dto.js +37 -0
  75. package/dist/dtos/product/responses/product-suspend-response.dto.js +37 -0
  76. package/dist/dtos/product/responses/product-unsuspend-response.dto.js +37 -0
  77. package/dist/dtos/product/responses/product-upgradable-response.dto.js +37 -0
  78. package/dist/dtos/product/responses/product-upgrade-response.dto.js +37 -0
  79. package/dist/dtos/requests/validate-attributes-request.dto.js +12 -0
  80. package/dist/dtos/response-data.dto.js +19 -0
  81. package/dist/dtos/responses/validate-attributes-response.dto.js +25 -0
  82. package/dist/dtos/settings.dto.d.ts +18 -0
  83. package/dist/dtos/settings.dto.js +19 -2
  84. package/dist/dtos/setup-status-response.dto.js +20 -0
  85. package/dist/dtos/success-response.dto.d.ts +0 -4
  86. package/dist/dtos/success-response.dto.js +0 -14
  87. package/dist/enums/invoice/invoice-item-actions.enum.d.ts +8 -0
  88. package/dist/enums/invoice/invoice-item-actions.enum.js +12 -0
  89. package/dist/enums/invoice/invoice-types.enum.d.ts +5 -0
  90. package/dist/enums/invoice/invoice-types.enum.js +9 -0
  91. package/dist/enums/item-actions.enum.d.ts +11 -0
  92. package/dist/enums/item-actions.enum.js +16 -0
  93. package/dist/index.d.ts +36 -5
  94. package/dist/index.js +37 -7
  95. package/dist/openapi/schemas/components.schemas.d.ts +152 -49
  96. package/dist/openapi/schemas/components.schemas.js +191 -89
  97. package/dist/validators/addon-field-validator.d.ts +9 -0
  98. package/dist/validators/addon-field-validator.js +14 -0
  99. package/dist/validators/addon-field-validator.spec.d.ts +1 -0
  100. package/dist/validators/addon-field-validator.spec.js +38 -0
  101. package/dist/validators/attachment-validator.d.ts +8 -0
  102. package/dist/validators/attachment-validator.js +17 -0
  103. package/dist/validators/attachment-validator.spec.d.ts +1 -0
  104. package/dist/validators/attachment-validator.spec.js +58 -0
  105. package/dist/validators/attribute-field-validator.d.ts +8 -0
  106. package/dist/validators/attribute-field-validator.js +17 -0
  107. package/dist/validators/attribute-field-validator.spec.d.ts +1 -0
  108. package/dist/validators/attribute-field-validator.spec.js +84 -0
  109. package/dist/validators/country-validator.d.ts +8 -0
  110. package/dist/validators/country-validator.js +17 -0
  111. package/dist/validators/country-validator.spec.d.ts +1 -0
  112. package/dist/validators/country-validator.spec.js +58 -0
  113. package/dist/validators/field-validator.spec.js +1 -29
  114. package/dist/validators/info-validator.d.ts +8 -0
  115. package/dist/validators/info-validator.js +17 -0
  116. package/dist/validators/info-validator.spec.d.ts +1 -0
  117. package/dist/validators/info-validator.spec.js +85 -0
  118. package/dist/validators/invoice-contact-data-validator.d.ts +8 -0
  119. package/dist/validators/invoice-contact-data-validator.js +17 -0
  120. package/dist/validators/invoice-contact-data-validator.spec.d.ts +1 -0
  121. package/dist/validators/invoice-contact-data-validator.spec.js +88 -0
  122. package/dist/validators/invoice-info-validator.d.ts +8 -0
  123. package/dist/validators/invoice-info-validator.js +17 -0
  124. package/dist/validators/invoice-info-validator.spec.d.ts +1 -0
  125. package/dist/validators/invoice-info-validator.spec.js +81 -0
  126. package/dist/validators/invoice-item-data-validator.d.ts +8 -0
  127. package/dist/validators/invoice-item-data-validator.js +17 -0
  128. package/dist/validators/invoice-item-data-validator.spec.d.ts +1 -0
  129. package/dist/validators/invoice-item-data-validator.spec.js +45 -0
  130. package/dist/validators/item-data-validator.d.ts +8 -0
  131. package/dist/validators/item-data-validator.js +17 -0
  132. package/dist/validators/item-data-validator.spec.d.ts +1 -0
  133. package/dist/validators/item-data-validator.spec.js +79 -0
  134. package/dist/validators/notification-info-validator.spec.js +6 -6
  135. package/dist/validators/notification-request-validator.js +2 -2
  136. package/dist/validators/product-create-request-validator.js +1 -1
  137. package/dist/validators/product-delete-request-validator.js +1 -1
  138. package/dist/validators/product-downgradable-request-validator.js +1 -1
  139. package/dist/validators/product-downgrade-request-validator.js +1 -1
  140. package/dist/validators/product-info-validator.spec.js +20 -28
  141. package/dist/validators/product-item-data-validator.d.ts +8 -0
  142. package/dist/validators/product-item-data-validator.js +17 -0
  143. package/dist/validators/product-item-data-validator.spec.d.ts +1 -0
  144. package/dist/validators/product-item-data-validator.spec.js +60 -0
  145. package/dist/validators/product-renew-request-validator.js +1 -1
  146. package/dist/validators/product-suspend-request-validator.js +1 -1
  147. package/dist/validators/product-unsuspend-request-validator.js +1 -1
  148. package/dist/validators/product-upgradable-request-validator.js +1 -1
  149. package/dist/validators/product-upgrade-request-validator.js +1 -1
  150. package/dist/validators/tab-validator.d.ts +8 -0
  151. package/dist/validators/tab-validator.js +17 -0
  152. package/dist/validators/tab-validator.spec.d.ts +1 -0
  153. package/dist/validators/tab-validator.spec.js +49 -0
  154. package/dist/validators/tin-validation-details-validator.d.ts +8 -0
  155. package/dist/validators/tin-validation-details-validator.js +17 -0
  156. package/dist/validators/tin-validation-details-validator.spec.d.ts +1 -0
  157. package/dist/validators/tin-validation-details-validator.spec.js +77 -0
  158. package/dist/validators/transaction-data-validator.d.ts +8 -0
  159. package/dist/validators/transaction-data-validator.js +17 -0
  160. package/dist/validators/transaction-data-validator.spec.d.ts +1 -0
  161. package/dist/validators/transaction-data-validator.spec.js +62 -0
  162. package/package.json +1 -1
@@ -0,0 +1,32 @@
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.NotificationSendResponseDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
15
+ const success_response_dto_1 = require("../../success-response.dto");
16
+ /**
17
+ * Response from notification integrations after successfully sending a notification.
18
+ * Returned to hoster.ai confirming the notification was sent.
19
+ */
20
+ class NotificationSendResponseDto extends success_response_dto_1.SuccessResponseDto {
21
+ }
22
+ exports.NotificationSendResponseDto = NotificationSendResponseDto;
23
+ __decorate([
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.IsNotEmpty)(),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'Notification ID',
28
+ description: 'Unique identifier for the sent notification.',
29
+ type: 'string',
30
+ }),
31
+ __metadata("design:type", String)
32
+ ], NotificationSendResponseDto.prototype, "notificationId", void 0);
@@ -13,6 +13,7 @@ exports.EmailSenderDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const attachment_dto_1 = require("../../attachment.dto");
16
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
16
17
  /**
17
18
  * DTO for email sender
18
19
  * Used to define the details for sending an email
@@ -23,18 +24,37 @@ exports.EmailSenderDto = EmailSenderDto;
23
24
  __decorate([
24
25
  (0, class_validator_1.IsNotEmpty)(),
25
26
  (0, class_validator_1.IsString)(),
27
+ (0, class_validator_jsonschema_1.JSONSchema)({
28
+ title: 'Full Name',
29
+ description: 'The full name of the sender.',
30
+ type: 'string',
31
+ }),
26
32
  __metadata("design:type", String)
27
33
  ], EmailSenderDto.prototype, "fullName", void 0);
28
34
  __decorate([
29
35
  (0, class_validator_1.IsNotEmpty)(),
30
36
  (0, class_validator_1.IsString)(),
31
37
  (0, class_validator_1.Length)(1, 500),
38
+ (0, class_validator_jsonschema_1.JSONSchema)({
39
+ title: 'Subject',
40
+ description: 'The email subject.',
41
+ type: 'string',
42
+ minLength: 1,
43
+ maxLength: 500,
44
+ }),
32
45
  __metadata("design:type", String)
33
46
  ], EmailSenderDto.prototype, "subject", void 0);
34
47
  __decorate([
35
48
  (0, class_validator_1.IsNotEmpty)(),
36
49
  (0, class_validator_1.IsString)(),
37
50
  (0, class_validator_1.Length)(1, 50000),
51
+ (0, class_validator_jsonschema_1.JSONSchema)({
52
+ title: 'Message',
53
+ description: 'The message content.',
54
+ type: 'string',
55
+ minLength: 1,
56
+ maxLength: 50000,
57
+ }),
38
58
  __metadata("design:type", String)
39
59
  ], EmailSenderDto.prototype, "message", void 0);
40
60
  __decorate([
@@ -42,5 +62,11 @@ __decorate([
42
62
  (0, class_validator_1.IsArray)(),
43
63
  (0, class_validator_1.ValidateNested)({ each: true }),
44
64
  (0, class_transformer_1.Type)(() => attachment_dto_1.AttachmentDto),
65
+ (0, class_validator_jsonschema_1.JSONSchema)({
66
+ title: 'Attachments',
67
+ description: 'File attachments.',
68
+ type: 'array',
69
+ items: { $ref: '#/components/schemas/AttachmentDto' },
70
+ }),
45
71
  __metadata("design:type", Array)
46
72
  ], EmailSenderDto.prototype, "attachments", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PushSenderDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  /**
15
16
  * DTO for push notification sender
16
17
  * Used to define the details for sending a push notification
@@ -22,29 +23,64 @@ __decorate([
22
23
  (0, class_validator_1.IsNotEmpty)(),
23
24
  (0, class_validator_1.IsString)(),
24
25
  (0, class_validator_1.Length)(1, 255),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'Message ID',
28
+ description: 'Unique identifier of the message.',
29
+ type: 'string',
30
+ minLength: 1,
31
+ maxLength: 255,
32
+ }),
25
33
  __metadata("design:type", String)
26
34
  ], PushSenderDto.prototype, "messageId", void 0);
27
35
  __decorate([
28
36
  (0, class_validator_1.IsNotEmpty)(),
29
37
  (0, class_validator_1.IsString)(),
30
38
  (0, class_validator_1.Length)(1, 255),
39
+ (0, class_validator_jsonschema_1.JSONSchema)({
40
+ title: 'User ID',
41
+ description: 'The user ID that will receive the push notification.',
42
+ type: 'string',
43
+ minLength: 1,
44
+ maxLength: 255,
45
+ }),
31
46
  __metadata("design:type", String)
32
47
  ], PushSenderDto.prototype, "userId", void 0);
33
48
  __decorate([
34
49
  (0, class_validator_1.IsNotEmpty)(),
35
50
  (0, class_validator_1.IsString)(),
36
51
  (0, class_validator_1.Length)(1, 255),
52
+ (0, class_validator_jsonschema_1.JSONSchema)({
53
+ title: 'Title',
54
+ description: 'The title of the push notification.',
55
+ type: 'string',
56
+ minLength: 1,
57
+ maxLength: 255,
58
+ }),
37
59
  __metadata("design:type", String)
38
60
  ], PushSenderDto.prototype, "title", void 0);
39
61
  __decorate([
40
62
  (0, class_validator_1.IsNotEmpty)(),
41
63
  (0, class_validator_1.IsString)(),
42
64
  (0, class_validator_1.Length)(1, 1000),
65
+ (0, class_validator_jsonschema_1.JSONSchema)({
66
+ title: 'Message',
67
+ description: 'The content of the push notification.',
68
+ type: 'string',
69
+ minLength: 1,
70
+ maxLength: 1000,
71
+ }),
43
72
  __metadata("design:type", String)
44
73
  ], PushSenderDto.prototype, "message", void 0);
45
74
  __decorate([
46
75
  (0, class_validator_1.IsOptional)(),
47
76
  (0, class_validator_1.IsString)(),
48
77
  (0, class_validator_1.Length)(1, 255),
78
+ (0, class_validator_jsonschema_1.JSONSchema)({
79
+ title: 'Subtitle',
80
+ description: 'The subtitle of the push notification.',
81
+ type: 'string',
82
+ minLength: 1,
83
+ maxLength: 255,
84
+ }),
49
85
  __metadata("design:type", String)
50
86
  ], PushSenderDto.prototype, "subtitle", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SmsSenderDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  /**
15
16
  * DTO for SMS sender
16
17
  * Used to define the details for sending an SMS message
@@ -21,10 +22,20 @@ exports.SmsSenderDto = SmsSenderDto;
21
22
  __decorate([
22
23
  (0, class_validator_1.IsNotEmpty)(),
23
24
  (0, class_validator_1.IsPhoneNumber)(),
25
+ (0, class_validator_jsonschema_1.JSONSchema)({
26
+ title: 'Sender Phone',
27
+ description: 'Sender\'s phone number.',
28
+ type: 'string',
29
+ }),
24
30
  __metadata("design:type", String)
25
31
  ], SmsSenderDto.prototype, "senderPhone", void 0);
26
32
  __decorate([
27
33
  (0, class_validator_1.IsNotEmpty)(),
28
34
  (0, class_validator_1.IsString)(),
35
+ (0, class_validator_jsonschema_1.JSONSchema)({
36
+ title: 'Message',
37
+ description: 'The content of the SMS message.',
38
+ type: 'string',
39
+ }),
29
40
  __metadata("design:type", String)
30
41
  ], SmsSenderDto.prototype, "message", void 0);
@@ -1,6 +1,7 @@
1
- import { FieldDto } from '../field.dto';
1
+ import { AttributeFieldDto } from '../attribute-field.dto';
2
2
  import { InfoDto } from '../info.dto';
3
3
  import { UnitDto } from '../unit.dto';
4
+ import { ProductItemActionsEnum } from '../../enums/item-actions.enum';
4
5
  /**
5
6
  * DTO for notification information.
6
7
  * Extends the base InfoDto to include the notification message type.
@@ -10,12 +11,12 @@ export declare class ProductInfoDto extends InfoDto {
10
11
  * Custom attributes that can be defined for products.
11
12
  * These attributes will be displayed in the product configuration section.
12
13
  */
13
- productAttributes?: FieldDto[];
14
+ productAttributes?: AttributeFieldDto[];
14
15
  /**
15
16
  * Custom attributes that can be defined for items.
16
17
  * These attributes will be displayed in the item details section.
17
18
  */
18
- itemAttributes?: FieldDto[];
19
+ itemAttributes?: AttributeFieldDto[];
19
20
  /**
20
21
  * Defines the units for pay-per-use billing.
21
22
  * This allows the administrator to set a price for each unit per interval.
@@ -27,4 +28,8 @@ export declare class ProductInfoDto extends InfoDto {
27
28
  * This allows the system to know what to expect in the response before the creation is executed.
28
29
  */
29
30
  responseDataFieldNames?: Record<string, unknown>;
31
+ /**
32
+ * A list of actions that are supported by this integration.
33
+ */
34
+ supportedActions: ProductItemActionsEnum[];
30
35
  }
@@ -11,18 +11,26 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductInfoDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- const field_dto_1 = require("../field.dto");
14
+ const attribute_field_dto_1 = require("../attribute-field.dto");
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
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
20
  const class_validator_jsonschema_1 = require("class-validator-jsonschema");
21
+ const item_actions_enum_1 = require("../../enums/item-actions.enum");
21
22
  /**
22
23
  * DTO for notification information.
23
24
  * Extends the base InfoDto to include the notification message type.
24
25
  */
25
26
  class ProductInfoDto extends info_dto_1.InfoDto {
27
+ constructor() {
28
+ super(...arguments);
29
+ /**
30
+ * A list of actions that are supported by this integration.
31
+ */
32
+ this.supportedActions = [];
33
+ }
26
34
  }
27
35
  exports.ProductInfoDto = ProductInfoDto;
28
36
  __decorate([
@@ -30,13 +38,13 @@ __decorate([
30
38
  (0, class_validator_1.IsArray)(),
31
39
  (0, class_validator_1.ArrayMinSize)(1),
32
40
  (0, class_validator_1.ValidateNested)({ each: true }),
33
- (0, class_transformer_1.Type)(() => field_dto_1.FieldDto),
41
+ (0, class_transformer_1.Type)(() => attribute_field_dto_1.AttributeFieldDto),
34
42
  (0, unique_field_in_array_validator_1.UniqueFieldInArray)('id'),
35
43
  (0, class_validator_jsonschema_1.JSONSchema)({
36
44
  title: 'Product Attributes',
37
45
  description: 'Configurable attributes that apply at the product level.',
38
46
  type: 'array',
39
- items: { $ref: '#/components/schemas/FieldDto' }
47
+ items: { $ref: '#/components/schemas/AttributeFieldDto' }
40
48
  }),
41
49
  __metadata("design:type", Array)
42
50
  ], ProductInfoDto.prototype, "productAttributes", void 0);
@@ -45,13 +53,13 @@ __decorate([
45
53
  (0, class_validator_1.IsArray)(),
46
54
  (0, class_validator_1.ArrayMinSize)(1),
47
55
  (0, class_validator_1.ValidateNested)({ each: true }),
48
- (0, class_transformer_1.Type)(() => field_dto_1.FieldDto),
56
+ (0, class_transformer_1.Type)(() => attribute_field_dto_1.AttributeFieldDto),
49
57
  (0, unique_field_in_array_validator_1.UniqueFieldInArray)('id'),
50
58
  (0, class_validator_jsonschema_1.JSONSchema)({
51
59
  title: 'Item Attributes',
52
60
  description: 'Configurable attributes that apply at the item level.',
53
61
  type: 'array',
54
- items: { $ref: '#/components/schemas/FieldDto' }
62
+ items: { $ref: '#/components/schemas/AttributeFieldDto' }
55
63
  }),
56
64
  __metadata("design:type", Array)
57
65
  ], ProductInfoDto.prototype, "itemAttributes", void 0);
@@ -82,3 +90,15 @@ __decorate([
82
90
  }),
83
91
  __metadata("design:type", Object)
84
92
  ], ProductInfoDto.prototype, "responseDataFieldNames", void 0);
93
+ __decorate([
94
+ (0, class_validator_1.IsNotEmpty)(),
95
+ (0, class_validator_1.IsArray)(),
96
+ (0, class_validator_1.IsEnum)(item_actions_enum_1.ProductItemActionsEnum, { each: true }),
97
+ (0, class_validator_jsonschema_1.JSONSchema)({
98
+ title: 'Supported Actions',
99
+ description: 'Actions supported by this integration.',
100
+ type: 'array',
101
+ items: { type: 'string', enum: Object.values(item_actions_enum_1.ProductItemActionsEnum) }
102
+ }),
103
+ __metadata("design:type", Array)
104
+ ], ProductInfoDto.prototype, "supportedActions", void 0);
@@ -1,31 +1,10 @@
1
- import { DurationEnum } from '../../enums/duration.enum';
1
+ import { ProductItemActionsEnum } from "../../enums/item-actions.enum";
2
+ import { ItemDataDto } from "../item-data.dto";
2
3
  /**
3
- * Represents the data of a specific product item.
4
- * This DTO is used to transfer detailed information about a product instance.
4
+ * Product item data sent to product integrations.
5
+ * Uses product-specific actions distinct from invoice integration actions.
5
6
  */
6
- export declare class ProductItemDataDto {
7
- /**
8
- * The unique identifier for the product item.
9
- */
10
- itemId?: string;
11
- /**
12
- * A record of product-level attributes.
13
- * These are general attributes defined for the product type.
14
- */
15
- productAttributes: Record<string, unknown>;
16
- /**
17
- * A record of item-specific attributes.
18
- * These are attributes that are unique to this particular instance of the product.
19
- */
20
- itemAttributes: Record<string, unknown>;
21
- /**
22
- * Data returned from the creation response.
23
- * This field should not be present in the create request.
24
- * @optional
25
- */
26
- creationResponseData?: Record<string, unknown>;
27
- /**
28
- * The duration of the product subscription or license.
29
- */
30
- duration: DurationEnum;
7
+ export declare class ProductItemDataDto extends ItemDataDto {
8
+ /** Product-specific action type for this item */
9
+ action?: ProductItemActionsEnum;
31
10
  }
@@ -11,33 +11,24 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductItemDataDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- const duration_enum_1 = require("../../enums/duration.enum");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
15
+ const item_actions_enum_1 = require("../../enums/item-actions.enum");
16
+ const item_data_dto_1 = require("../item-data.dto");
15
17
  /**
16
- * Represents the data of a specific product item.
17
- * This DTO is used to transfer detailed information about a product instance.
18
+ * Product item data sent to product integrations.
19
+ * Uses product-specific actions distinct from invoice integration actions.
18
20
  */
19
- class ProductItemDataDto {
21
+ class ProductItemDataDto extends item_data_dto_1.ItemDataDto {
20
22
  }
21
23
  exports.ProductItemDataDto = ProductItemDataDto;
22
24
  __decorate([
23
25
  (0, class_validator_1.IsOptional)(),
24
- (0, class_validator_1.IsString)(),
26
+ (0, class_validator_1.IsEnum)(item_actions_enum_1.ProductItemActionsEnum),
27
+ (0, class_validator_jsonschema_1.JSONSchema)({
28
+ title: 'Action',
29
+ description: 'Product-specific action type for this item.',
30
+ type: 'string',
31
+ enum: Object.values(item_actions_enum_1.ProductItemActionsEnum),
32
+ }),
25
33
  __metadata("design:type", String)
26
- ], ProductItemDataDto.prototype, "itemId", void 0);
27
- __decorate([
28
- (0, class_validator_1.IsDefined)(),
29
- __metadata("design:type", Object)
30
- ], ProductItemDataDto.prototype, "productAttributes", void 0);
31
- __decorate([
32
- (0, class_validator_1.IsDefined)(),
33
- __metadata("design:type", Object)
34
- ], ProductItemDataDto.prototype, "itemAttributes", void 0);
35
- __decorate([
36
- (0, class_validator_1.IsOptional)(),
37
- __metadata("design:type", Object)
38
- ], ProductItemDataDto.prototype, "creationResponseData", void 0);
39
- __decorate([
40
- (0, class_validator_1.IsDefined)(),
41
- (0, class_validator_1.IsEnum)(duration_enum_1.DurationEnum),
42
- __metadata("design:type", String)
43
- ], ProductItemDataDto.prototype, "duration", void 0);
34
+ ], ProductItemDataDto.prototype, "action", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductCreateRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  const class_transformer_1 = require("class-transformer");
15
16
  const product_item_data_dto_1 = require("../product-item-data.dto");
16
17
  const client_data_dto_1 = require("../../client-data.dto");
@@ -26,6 +27,11 @@ __decorate([
26
27
  (0, class_validator_1.IsObject)(),
27
28
  (0, class_validator_1.ValidateNested)(),
28
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
+ (0, class_validator_jsonschema_1.JSONSchema)({
31
+ title: 'Client Data',
32
+ description: 'The client\'s data for the request.',
33
+ $ref: '#/components/schemas/ClientDataDto',
34
+ }),
29
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
30
36
  ], ProductCreateRequestDto.prototype, "clientData", void 0);
31
37
  __decorate([
@@ -33,5 +39,10 @@ __decorate([
33
39
  (0, class_validator_1.IsObject)(),
34
40
  (0, class_validator_1.ValidateNested)(),
35
41
  (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
42
+ (0, class_validator_jsonschema_1.JSONSchema)({
43
+ title: 'Item Data',
44
+ description: 'The data for the new product item to be created.',
45
+ $ref: '#/components/schemas/ProductItemDataDto',
46
+ }),
36
47
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
37
48
  ], ProductCreateRequestDto.prototype, "itemData", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductDeleteRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  const class_transformer_1 = require("class-transformer");
15
16
  const product_item_data_dto_1 = require("../product-item-data.dto");
16
17
  const client_data_dto_1 = require("../../client-data.dto");
@@ -26,6 +27,11 @@ __decorate([
26
27
  (0, class_validator_1.IsObject)(),
27
28
  (0, class_validator_1.ValidateNested)(),
28
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
+ (0, class_validator_jsonschema_1.JSONSchema)({
31
+ title: 'Client Data',
32
+ description: 'The client\'s data initiating the request.',
33
+ type: 'object',
34
+ }),
29
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
30
36
  ], ProductDeleteRequestDto.prototype, "clientData", void 0);
31
37
  __decorate([
@@ -33,5 +39,10 @@ __decorate([
33
39
  (0, class_validator_1.IsObject)(),
34
40
  (0, class_validator_1.ValidateNested)(),
35
41
  (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
42
+ (0, class_validator_jsonschema_1.JSONSchema)({
43
+ title: 'Item Data',
44
+ description: 'The data of the product item to be deleted.',
45
+ type: 'object',
46
+ }),
36
47
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
37
48
  ], ProductDeleteRequestDto.prototype, "itemData", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductDowngradableRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  const class_transformer_1 = require("class-transformer");
15
16
  const product_item_data_dto_1 = require("../product-item-data.dto");
16
17
  const client_data_dto_1 = require("../../client-data.dto");
@@ -26,6 +27,11 @@ __decorate([
26
27
  (0, class_validator_1.IsObject)(),
27
28
  (0, class_validator_1.ValidateNested)(),
28
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
+ (0, class_validator_jsonschema_1.JSONSchema)({
31
+ title: 'Client Data',
32
+ description: 'The client\'s data for the request.',
33
+ $ref: '#/components/schemas/ClientDataDto',
34
+ }),
29
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
30
36
  ], ProductDowngradableRequestDto.prototype, "clientData", void 0);
31
37
  __decorate([
@@ -33,5 +39,10 @@ __decorate([
33
39
  (0, class_validator_1.IsObject)(),
34
40
  (0, class_validator_1.ValidateNested)(),
35
41
  (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
42
+ (0, class_validator_jsonschema_1.JSONSchema)({
43
+ title: 'Item Data',
44
+ description: 'The data of the product item to be checked.',
45
+ $ref: '#/components/schemas/ProductItemDataDto',
46
+ }),
36
47
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
37
48
  ], ProductDowngradableRequestDto.prototype, "itemData", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductDowngradeRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  const class_transformer_1 = require("class-transformer");
15
16
  const product_item_data_dto_1 = require("../product-item-data.dto");
16
17
  const client_data_dto_1 = require("../../client-data.dto");
@@ -26,6 +27,11 @@ __decorate([
26
27
  (0, class_validator_1.IsObject)(),
27
28
  (0, class_validator_1.ValidateNested)(),
28
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
+ (0, class_validator_jsonschema_1.JSONSchema)({
31
+ title: 'Client Data',
32
+ description: 'The client\'s data for the request.',
33
+ $ref: '#/components/schemas/ClientDataDto',
34
+ }),
29
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
30
36
  ], ProductDowngradeRequestDto.prototype, "clientData", void 0);
31
37
  __decorate([
@@ -33,6 +39,11 @@ __decorate([
33
39
  (0, class_validator_1.IsObject)(),
34
40
  (0, class_validator_1.ValidateNested)(),
35
41
  (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
42
+ (0, class_validator_jsonschema_1.JSONSchema)({
43
+ title: 'Item Data',
44
+ description: 'The data of the product item to be downgraded.',
45
+ $ref: '#/components/schemas/ProductItemDataDto',
46
+ }),
36
47
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
37
48
  ], ProductDowngradeRequestDto.prototype, "itemData", void 0);
38
49
  __decorate([
@@ -40,5 +51,10 @@ __decorate([
40
51
  (0, class_validator_1.IsObject)(),
41
52
  (0, class_validator_1.ValidateNested)(),
42
53
  (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
54
+ (0, class_validator_jsonschema_1.JSONSchema)({
55
+ title: 'Previous Item Data',
56
+ description: 'The data of the product item before the downgrade.',
57
+ $ref: '#/components/schemas/ProductItemDataDto',
58
+ }),
43
59
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
44
60
  ], ProductDowngradeRequestDto.prototype, "previousItemData", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductRenewRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  const class_transformer_1 = require("class-transformer");
15
16
  const product_item_data_dto_1 = require("../product-item-data.dto");
16
17
  const client_data_dto_1 = require("../../client-data.dto");
@@ -26,6 +27,11 @@ __decorate([
26
27
  (0, class_validator_1.IsObject)(),
27
28
  (0, class_validator_1.ValidateNested)(),
28
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
+ (0, class_validator_jsonschema_1.JSONSchema)({
31
+ title: 'Client Data',
32
+ description: 'The client\'s data for the request.',
33
+ $ref: '#/components/schemas/ClientDataDto',
34
+ }),
29
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
30
36
  ], ProductRenewRequestDto.prototype, "clientData", void 0);
31
37
  __decorate([
@@ -33,5 +39,10 @@ __decorate([
33
39
  (0, class_validator_1.IsObject)(),
34
40
  (0, class_validator_1.ValidateNested)(),
35
41
  (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
42
+ (0, class_validator_jsonschema_1.JSONSchema)({
43
+ title: 'Item Data',
44
+ description: 'The data of the product item to be renewed.',
45
+ $ref: '#/components/schemas/ProductItemDataDto',
46
+ }),
36
47
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
37
48
  ], ProductRenewRequestDto.prototype, "itemData", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductSuspendRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  const class_transformer_1 = require("class-transformer");
15
16
  const product_item_data_dto_1 = require("../product-item-data.dto");
16
17
  const client_data_dto_1 = require("../../client-data.dto");
@@ -26,6 +27,11 @@ __decorate([
26
27
  (0, class_validator_1.IsObject)(),
27
28
  (0, class_validator_1.ValidateNested)(),
28
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
+ (0, class_validator_jsonschema_1.JSONSchema)({
31
+ title: 'Client Data',
32
+ description: 'The client\'s data for the request.',
33
+ $ref: '#/components/schemas/ClientDataDto',
34
+ }),
29
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
30
36
  ], ProductSuspendRequestDto.prototype, "clientData", void 0);
31
37
  __decorate([
@@ -33,5 +39,10 @@ __decorate([
33
39
  (0, class_validator_1.IsObject)(),
34
40
  (0, class_validator_1.ValidateNested)(),
35
41
  (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
42
+ (0, class_validator_jsonschema_1.JSONSchema)({
43
+ title: 'Item Data',
44
+ description: 'The data of the product item to be suspended.',
45
+ $ref: '#/components/schemas/ProductItemDataDto',
46
+ }),
36
47
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
37
48
  ], ProductSuspendRequestDto.prototype, "itemData", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductUnsuspendRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  const class_transformer_1 = require("class-transformer");
15
16
  const product_item_data_dto_1 = require("../product-item-data.dto");
16
17
  const client_data_dto_1 = require("../../client-data.dto");
@@ -26,6 +27,11 @@ __decorate([
26
27
  (0, class_validator_1.IsObject)(),
27
28
  (0, class_validator_1.ValidateNested)(),
28
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
+ (0, class_validator_jsonschema_1.JSONSchema)({
31
+ title: 'Client Data',
32
+ description: 'The client\'s data for the request.',
33
+ $ref: '#/components/schemas/ClientDataDto',
34
+ }),
29
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
30
36
  ], ProductUnsuspendRequestDto.prototype, "clientData", void 0);
31
37
  __decorate([
@@ -33,5 +39,10 @@ __decorate([
33
39
  (0, class_validator_1.IsObject)(),
34
40
  (0, class_validator_1.ValidateNested)(),
35
41
  (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
42
+ (0, class_validator_jsonschema_1.JSONSchema)({
43
+ title: 'Item Data',
44
+ description: 'The data of the product item to be unsuspended.',
45
+ $ref: '#/components/schemas/ProductItemDataDto',
46
+ }),
36
47
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
37
48
  ], ProductUnsuspendRequestDto.prototype, "itemData", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProductUpgradableRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  const class_transformer_1 = require("class-transformer");
15
16
  const product_item_data_dto_1 = require("../product-item-data.dto");
16
17
  const client_data_dto_1 = require("../../client-data.dto");
@@ -26,6 +27,11 @@ __decorate([
26
27
  (0, class_validator_1.IsObject)(),
27
28
  (0, class_validator_1.ValidateNested)(),
28
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
+ (0, class_validator_jsonschema_1.JSONSchema)({
31
+ title: 'Client Data',
32
+ description: 'The client\'s data for the request.',
33
+ $ref: '#/components/schemas/ClientDataDto',
34
+ }),
29
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
30
36
  ], ProductUpgradableRequestDto.prototype, "clientData", void 0);
31
37
  __decorate([
@@ -33,5 +39,10 @@ __decorate([
33
39
  (0, class_validator_1.IsObject)(),
34
40
  (0, class_validator_1.ValidateNested)(),
35
41
  (0, class_transformer_1.Type)(() => product_item_data_dto_1.ProductItemDataDto),
42
+ (0, class_validator_jsonschema_1.JSONSchema)({
43
+ title: 'Item Data',
44
+ description: 'The data of the product item to be checked.',
45
+ $ref: '#/components/schemas/ProductItemDataDto',
46
+ }),
36
47
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
37
48
  ], ProductUpgradableRequestDto.prototype, "itemData", void 0);