@hosterai/types 0.0.12 → 0.0.14

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 (130) hide show
  1. package/README.md +8 -1
  2. package/dist/dtos/action.dto.d.ts +21 -3
  3. package/dist/dtos/action.dto.js +10 -0
  4. package/dist/dtos/attachment.dto.d.ts +1 -1
  5. package/dist/dtos/attachment.dto.js +1 -1
  6. package/dist/dtos/client-data.dto.d.ts +65 -0
  7. package/dist/dtos/client-data.dto.js +106 -0
  8. package/dist/dtos/company-data.dto.d.ts +57 -0
  9. package/dist/dtos/company-data.dto.js +5 -2
  10. package/dist/dtos/error-response.dto.d.ts +8 -6
  11. package/dist/dtos/error-response.dto.js +2 -2
  12. package/dist/dtos/field.dto.d.ts +7 -2
  13. package/dist/dtos/field.dto.js +8 -3
  14. package/dist/dtos/info.dto.d.ts +61 -64
  15. package/dist/dtos/info.dto.js +6 -4
  16. package/dist/dtos/jwt.dto.d.ts +12 -9
  17. package/dist/dtos/jwt.dto.js +6 -2
  18. package/dist/dtos/menu.dto.d.ts +26 -11
  19. package/dist/dtos/multilang-text.dto.d.ts +11 -0
  20. package/dist/dtos/multilang-text.dto.js +4 -0
  21. package/dist/dtos/notification/notification-info.dto.d.ts +15 -0
  22. package/dist/dtos/notification/notification-info.dto.js +4 -0
  23. package/dist/dtos/notification/{notification-request.dto.d.ts → notification-send-request.dto.d.ts} +6 -1
  24. package/dist/dtos/notification/{notification-request.dto.js → notification-send-request.dto.js} +11 -6
  25. package/dist/dtos/product/product-info.dto.d.ts +30 -0
  26. package/dist/dtos/product/product-info.dto.js +11 -0
  27. package/dist/dtos/product/product-item-data.dto.d.ts +31 -0
  28. package/dist/dtos/product/product-item-data.dto.js +43 -0
  29. package/dist/dtos/product/product.interface.d.ts +44 -0
  30. package/dist/dtos/product/product.interface.js +2 -0
  31. package/dist/dtos/product/requests/product-create-request.dto.d.ts +18 -0
  32. package/dist/dtos/product/requests/product-create-request.dto.js +37 -0
  33. package/dist/dtos/product/requests/product-delete-request.dto.d.ts +18 -0
  34. package/dist/dtos/product/requests/product-delete-request.dto.js +37 -0
  35. package/dist/dtos/product/requests/product-downgradable-request.dto.d.ts +18 -0
  36. package/dist/dtos/product/requests/product-downgradable-request.dto.js +37 -0
  37. package/dist/dtos/product/requests/product-downgrade-request.dto.d.ts +24 -0
  38. package/dist/dtos/product/requests/product-downgrade-request.dto.js +44 -0
  39. package/dist/dtos/product/requests/product-downgradeable-request.dto.d.ts +18 -0
  40. package/dist/dtos/product/requests/product-downgradeable-request.dto.js +37 -0
  41. package/dist/dtos/product/requests/product-renew-request.dto.d.ts +18 -0
  42. package/dist/dtos/product/requests/product-renew-request.dto.js +37 -0
  43. package/dist/dtos/product/requests/product-suspend-request.dto.d.ts +18 -0
  44. package/dist/dtos/product/requests/product-suspend-request.dto.js +37 -0
  45. package/dist/dtos/product/requests/product-unsuspend-request.dto.d.ts +18 -0
  46. package/dist/dtos/product/requests/product-unsuspend-request.dto.js +37 -0
  47. package/dist/dtos/product/requests/product-upgradable-request.dto.d.ts +18 -0
  48. package/dist/dtos/product/requests/product-upgradable-request.dto.js +37 -0
  49. package/dist/dtos/product/requests/product-upgrade-request.dto.d.ts +24 -0
  50. package/dist/dtos/product/requests/product-upgrade-request.dto.js +44 -0
  51. package/dist/dtos/product/requests/product-upgradeable-request.dto.d.ts +18 -0
  52. package/dist/dtos/product/requests/product-upgradeable-request.dto.js +37 -0
  53. package/dist/dtos/product/requests/product-validate-attributes-request.dto.d.ts +18 -0
  54. package/dist/dtos/product/requests/product-validate-attributes-request.dto.js +31 -0
  55. package/dist/dtos/product/responses/product-create-response.dto.d.ts +21 -0
  56. package/dist/dtos/product/responses/product-create-response.dto.js +11 -0
  57. package/dist/dtos/product/responses/product-delete-response.dto.d.ts +21 -0
  58. package/dist/dtos/product/responses/product-delete-response.dto.js +11 -0
  59. package/dist/dtos/product/responses/product-downgradable-response.dto.d.ts +22 -0
  60. package/dist/dtos/product/responses/product-downgradable-response.dto.js +11 -0
  61. package/dist/dtos/product/responses/product-downgrade-response.dto.d.ts +21 -0
  62. package/dist/dtos/product/responses/product-downgrade-response.dto.js +11 -0
  63. package/dist/dtos/product/responses/product-downgradeable-response.dto.d.ts +22 -0
  64. package/dist/dtos/product/responses/product-downgradeable-response.dto.js +11 -0
  65. package/dist/dtos/product/responses/product-info-response.dto.d.ts +13 -0
  66. package/dist/dtos/product/responses/product-info-response.dto.js +11 -0
  67. package/dist/dtos/product/responses/product-renew-response.dto.d.ts +21 -0
  68. package/dist/dtos/product/responses/product-renew-response.dto.js +11 -0
  69. package/dist/dtos/product/responses/product-suspend-response.dto.d.ts +21 -0
  70. package/dist/dtos/product/responses/product-suspend-response.dto.js +11 -0
  71. package/dist/dtos/product/responses/product-unsuspend-response.dto.d.ts +21 -0
  72. package/dist/dtos/product/responses/product-unsuspend-response.dto.js +11 -0
  73. package/dist/dtos/product/responses/product-upgradable-response.dto.d.ts +22 -0
  74. package/dist/dtos/product/responses/product-upgradable-response.dto.js +11 -0
  75. package/dist/dtos/product/responses/product-upgrade-response.dto.d.ts +22 -0
  76. package/dist/dtos/product/responses/product-upgrade-response.dto.js +11 -0
  77. package/dist/dtos/product/responses/product-upgradeable-response.dto.d.ts +22 -0
  78. package/dist/dtos/product/responses/product-upgradeable-response.dto.js +11 -0
  79. package/dist/dtos/product/responses/product-validate-attributes-response.dto.d.ts +13 -0
  80. package/dist/dtos/product/responses/product-validate-attributes-response.dto.js +11 -0
  81. package/dist/dtos/response-data.dto.d.ts +7 -0
  82. package/dist/dtos/response-data.dto.js +4 -0
  83. package/dist/dtos/setup-status-response.dto.d.ts +8 -0
  84. package/dist/dtos/setup-status-response.dto.js +4 -0
  85. package/dist/dtos/submenu.dto.d.ts +7 -0
  86. package/dist/dtos/submenu.dto.js +11 -0
  87. package/dist/dtos/success-response.dto.d.ts +4 -0
  88. package/dist/dtos/success-response.dto.js +4 -0
  89. package/dist/dtos/tab.dto.d.ts +0 -2
  90. package/dist/dtos/tab.dto.js +1 -4
  91. package/dist/dtos/task-response.dto.d.ts +4 -0
  92. package/dist/dtos/task-response.dto.js +4 -0
  93. package/dist/dtos/unit.dto.d.ts +16 -0
  94. package/dist/dtos/unit.dto.js +4 -0
  95. package/dist/enums/duration.enum.d.ts +23 -0
  96. package/dist/enums/duration.enum.js +27 -0
  97. package/dist/enums/events.enum.d.ts +11 -8
  98. package/dist/enums/events.enum.js +11 -8
  99. package/dist/enums/response-status.enum.d.ts +5 -0
  100. package/dist/enums/response-status.enum.js +9 -0
  101. package/dist/index.d.ts +57 -14
  102. package/dist/index.js +65 -19
  103. package/dist/validators/client-data-validator.d.ts +8 -0
  104. package/dist/validators/client-data-validator.js +17 -0
  105. package/dist/validators/notification-request-validator.js +2 -2
  106. package/dist/validators/product-create-request-validator.d.ts +8 -0
  107. package/dist/validators/product-create-request-validator.js +17 -0
  108. package/dist/validators/product-delete-request-validator.d.ts +8 -0
  109. package/dist/validators/product-delete-request-validator.js +17 -0
  110. package/dist/validators/product-downgradable-request-validator.d.ts +8 -0
  111. package/dist/validators/product-downgradable-request-validator.js +17 -0
  112. package/dist/validators/product-downgrade-request-validator.d.ts +8 -0
  113. package/dist/validators/product-downgrade-request-validator.js +17 -0
  114. package/dist/validators/product-downgradeable-request-validator.d.ts +8 -0
  115. package/dist/validators/product-downgradeable-request-validator.js +17 -0
  116. package/dist/validators/product-renew-request-validator.d.ts +8 -0
  117. package/dist/validators/product-renew-request-validator.js +17 -0
  118. package/dist/validators/product-suspend-request-validator.d.ts +8 -0
  119. package/dist/validators/product-suspend-request-validator.js +17 -0
  120. package/dist/validators/product-unsuspend-request-validator.d.ts +8 -0
  121. package/dist/validators/product-unsuspend-request-validator.js +17 -0
  122. package/dist/validators/product-upgradable-request-validator.d.ts +8 -0
  123. package/dist/validators/product-upgradable-request-validator.js +17 -0
  124. package/dist/validators/product-upgrade-request-validator.d.ts +8 -0
  125. package/dist/validators/product-upgrade-request-validator.js +17 -0
  126. package/dist/validators/product-upgradeable-request-validator.d.ts +8 -0
  127. package/dist/validators/product-upgradeable-request-validator.js +17 -0
  128. package/dist/validators/product-validate-attributes-request-validator.d.ts +8 -0
  129. package/dist/validators/product-validate-attributes-request-validator.js +17 -0
  130. package/package.json +9 -4
@@ -2,15 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InfoDto = void 0;
4
4
  /**
5
- * DTO for integration information
6
- * Contains all information related to a service integration
5
+ * DTO for integration information.
6
+ * This is a central DTO that contains all the necessary information
7
+ * for a service integration, including UI configuration, supported features,
8
+ * and billing details.
7
9
  */
8
10
  class InfoDto {
9
11
  constructor() {
10
12
  /**
11
- * Actions that are not supported by the integration.
13
+ * A list of actions that are supported by this integration.
12
14
  */
13
- this.unsupportedActions = [];
15
+ this.supportedActions = [];
14
16
  }
15
17
  }
16
18
  exports.InfoDto = InfoDto;
@@ -1,31 +1,34 @@
1
1
  import { RolesEnum } from '../enums/roles.enum';
2
+ /**
3
+ * DTO for the JWT payload.
4
+ * This defines the structure of the data contained within the JWT.
5
+ */
2
6
  declare class JwtPayloadDto {
3
7
  /**
4
- * Integration identifier
8
+ * The unique identifier for the integration.
5
9
  */
6
10
  integrationId: string;
7
11
  /**
8
- * Unique user identifier that triggers the API call (only the /send method will not contain userId).
12
+ * The unique identifier for the user who triggered the API call.
13
+ * This is optional and may not be present in all requests (e.g., /send).
9
14
  */
10
15
  userId?: string;
11
16
  /**
12
- * Unique company identifier
17
+ * The unique identifier for the company.
13
18
  */
14
19
  companyId: string;
15
20
  /**
16
- * The roles accepted by the company for this integration
21
+ * The roles that have been accepted by the company for this integration.
17
22
  */
18
23
  acceptedRoles: RolesEnum[];
19
24
  }
20
25
  /**
21
- * DTO for JWT payload
22
- * Used for user authentication and authorization
26
+ * DTO for the JWT itself.
27
+ * This is the main DTO used for user authentication and authorization.
23
28
  */
24
29
  export declare class JwtDto {
25
30
  /**
26
- * User information contained in the JWT token
27
- * Includes user and company identifiers, admin rights
28
- * and optional sender details
31
+ * The JWT payload containing user and company information.
29
32
  */
30
33
  jwt: JwtPayloadDto;
31
34
  }
@@ -13,6 +13,10 @@ exports.JwtDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const roles_enum_1 = require("../enums/roles.enum");
16
+ /**
17
+ * DTO for the JWT payload.
18
+ * This defines the structure of the data contained within the JWT.
19
+ */
16
20
  class JwtPayloadDto {
17
21
  }
18
22
  __decorate([
@@ -36,8 +40,8 @@ __decorate([
36
40
  __metadata("design:type", Array)
37
41
  ], JwtPayloadDto.prototype, "acceptedRoles", void 0);
38
42
  /**
39
- * DTO for JWT payload
40
- * Used for user authentication and authorization
43
+ * DTO for the JWT itself.
44
+ * This is the main DTO used for user authentication and authorization.
41
45
  */
42
46
  class JwtDto {
43
47
  }
@@ -1,39 +1,54 @@
1
- import { SubmenuDto } from './tab.dto';
1
+ import { SubmenuDto } from './submenu.dto';
2
2
  /**
3
- * Base properties shared by all menu items
3
+ * Base properties shared by all menu items.
4
4
  */
5
5
  interface BaseMenuDto {
6
6
  /**
7
- * The icon to be displayed for the menu item
7
+ * The icon to be displayed for the menu item.
8
+ * @example "home"
8
9
  */
9
10
  icon: string;
10
11
  /**
11
- * The name to be displayed for the menu item
12
+ * The name to be displayed for the menu item.
13
+ * @example "Dashboard"
12
14
  */
13
15
  label: string;
14
16
  }
15
17
  /**
16
- * Menu item with URL (no submenu)
18
+ * Represents a menu item that links directly to a URL.
19
+ * This type of menu item does not have a submenu.
17
20
  */
18
21
  export interface MenuDtoWithUrl extends BaseMenuDto {
22
+ /**
23
+ * The type of the menu item. This is a discriminator property.
24
+ */
19
25
  type: 'only-url';
20
26
  /**
21
- * The URL associated with the tab.
22
- * The requests coming from the hoster will be signed
23
- * with jwt, which will contain information about the company
27
+ * The URL associated with the menu item.
28
+ * Requests from the hoster will be signed with a JWT containing company information.
24
29
  */
25
30
  url: string;
31
+ /**
32
+ * Explicitly prevents a submenu from being added to this type of menu item.
33
+ */
26
34
  submenu?: never;
27
35
  }
28
36
  /**
29
- * Menu item with submenu (no URL)
37
+ * Represents a menu item that contains a submenu.
38
+ * This type of menu item does not have a direct URL.
30
39
  */
31
40
  export interface MenuDtoWithSubmenu extends BaseMenuDto {
41
+ /**
42
+ * The type of the menu item. This is a discriminator property.
43
+ */
32
44
  type: 'with-submenu';
45
+ /**
46
+ * Explicitly prevents a URL from being added to this type of menu item.
47
+ */
33
48
  url?: never;
34
49
  /**
35
- * The list of tabs that will appear in the submenu and as a navigation bar above the main content
36
- * In case of only one tab, there will be neither a submenu nor a navigation bar.
50
+ * The list of tabs that will appear in the submenu.
51
+ * If there is only one tab, no submenu or navigation bar will be displayed.
37
52
  */
38
53
  submenu: SubmenuDto[];
39
54
  }
@@ -1,5 +1,16 @@
1
1
  import { LanguageEnum } from '../enums/language.enum';
2
+ /**
3
+ * DTO for multilingual text.
4
+ * Used for providing text in multiple languages.
5
+ */
2
6
  export declare class MultilangTextDto {
7
+ /**
8
+ * The language of the text.
9
+ * @see LanguageEnum
10
+ */
3
11
  language: LanguageEnum;
12
+ /**
13
+ * The text content in the specified language.
14
+ */
4
15
  text: string;
5
16
  }
@@ -12,6 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MultilangTextDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const language_enum_1 = require("../enums/language.enum");
15
+ /**
16
+ * DTO for multilingual text.
17
+ * Used for providing text in multiple languages.
18
+ */
15
19
  class MultilangTextDto {
16
20
  }
17
21
  exports.MultilangTextDto = MultilangTextDto;
@@ -1,5 +1,20 @@
1
1
  import { NotificationMessageTypeEnum } from '../../enums/notification/notification-message-type.enum';
2
2
  import { InfoDto } from '../info.dto';
3
+ import { UnitDto } from '../unit.dto';
4
+ /**
5
+ * DTO for notification information.
6
+ * Extends the base InfoDto to include the notification message type.
7
+ */
3
8
  export declare class NotificationInfoDto extends InfoDto {
9
+ /**
10
+ * The type of the notification message.
11
+ * @see NotificationMessageTypeEnum
12
+ */
4
13
  type: NotificationMessageTypeEnum;
14
+ /**
15
+ * Defines the units for pay-per-use billing.
16
+ * This allows the administrator to set a price for each unit per interval.
17
+ * @example [{ id: "ram", unitDescription: "MB", intervalDescription: "month" }]
18
+ */
19
+ payPerUseUnits?: UnitDto[];
5
20
  }
@@ -2,6 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NotificationInfoDto = void 0;
4
4
  const info_dto_1 = require("../info.dto");
5
+ /**
6
+ * DTO for notification information.
7
+ * Extends the base InfoDto to include the notification message type.
8
+ */
5
9
  class NotificationInfoDto extends info_dto_1.InfoDto {
6
10
  }
7
11
  exports.NotificationInfoDto = NotificationInfoDto;
@@ -4,7 +4,12 @@ import { SmsReceiverDto } from './receiver/receiver-sms.dto';
4
4
  import { EmailSenderDto } from './sender/sender-email.dto';
5
5
  import { PushSenderDto } from './sender/sender-push.dto';
6
6
  import { SmsSenderDto } from './sender/sender-sms.dto';
7
- export declare class NotificationRequestDto {
7
+ /**
8
+ * Represents a request to send a notification.
9
+ * This DTO encapsulates all the necessary information for sending a notification,
10
+ * including the notification ID, sender details, and receiver details.
11
+ */
12
+ export declare class NotificationSendRequestDto {
8
13
  /**
9
14
  * Unique identifier of the hoster message
10
15
  */
@@ -9,23 +9,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.NotificationRequestDto = void 0;
12
+ exports.NotificationSendRequestDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- class NotificationRequestDto {
14
+ /**
15
+ * Represents a request to send a notification.
16
+ * This DTO encapsulates all the necessary information for sending a notification,
17
+ * including the notification ID, sender details, and receiver details.
18
+ */
19
+ class NotificationSendRequestDto {
15
20
  }
16
- exports.NotificationRequestDto = NotificationRequestDto;
21
+ exports.NotificationSendRequestDto = NotificationSendRequestDto;
17
22
  __decorate([
18
23
  (0, class_validator_1.IsNotEmpty)(),
19
24
  (0, class_validator_1.IsString)(),
20
25
  __metadata("design:type", String)
21
- ], NotificationRequestDto.prototype, "notificationId", void 0);
26
+ ], NotificationSendRequestDto.prototype, "notificationId", void 0);
22
27
  __decorate([
23
28
  (0, class_validator_1.IsNotEmpty)(),
24
29
  (0, class_validator_1.IsObject)(),
25
30
  __metadata("design:type", Object)
26
- ], NotificationRequestDto.prototype, "sender", void 0);
31
+ ], NotificationSendRequestDto.prototype, "sender", void 0);
27
32
  __decorate([
28
33
  (0, class_validator_1.IsNotEmpty)(),
29
34
  (0, class_validator_1.IsObject)(),
30
35
  __metadata("design:type", Object)
31
- ], NotificationRequestDto.prototype, "receiver", void 0);
36
+ ], NotificationSendRequestDto.prototype, "receiver", void 0);
@@ -0,0 +1,30 @@
1
+ import { FieldDto } from '../field.dto';
2
+ import { InfoDto } from '../info.dto';
3
+ import { UnitDto } from '../unit.dto';
4
+ /**
5
+ * DTO for notification information.
6
+ * Extends the base InfoDto to include the notification message type.
7
+ */
8
+ export declare class ProductInfoDto extends InfoDto {
9
+ /**
10
+ * Custom attributes that can be defined for products.
11
+ * These attributes will be displayed in the product configuration section.
12
+ */
13
+ productAttributes?: FieldDto[];
14
+ /**
15
+ * Custom attributes that can be defined for items.
16
+ * These attributes will be displayed in the item details section.
17
+ */
18
+ itemAttributes?: FieldDto[];
19
+ /**
20
+ * Defines the units for pay-per-use billing.
21
+ * This allows the administrator to set a price for each unit per interval.
22
+ * @example [{ id: "ram", unitDescription: "MB", intervalDescription: "month" }]
23
+ */
24
+ payPerUseUnits?: UnitDto[];
25
+ /**
26
+ * Specifies the field names that will be returned in the response data after a successful creation.
27
+ * This allows the system to know what to expect in the response before the creation is executed.
28
+ */
29
+ responseDataFieldNames?: Record<string, unknown>;
30
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductInfoDto = void 0;
4
+ const info_dto_1 = require("../info.dto");
5
+ /**
6
+ * DTO for notification information.
7
+ * Extends the base InfoDto to include the notification message type.
8
+ */
9
+ class ProductInfoDto extends info_dto_1.InfoDto {
10
+ }
11
+ exports.ProductInfoDto = ProductInfoDto;
@@ -0,0 +1,31 @@
1
+ import { DurationEnum } from '../../enums/duration.enum';
2
+ /**
3
+ * Represents the data of a specific product item.
4
+ * This DTO is used to transfer detailed information about a product instance.
5
+ */
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;
31
+ }
@@ -0,0 +1,43 @@
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.ProductItemDataDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const duration_enum_1 = require("../../enums/duration.enum");
15
+ /**
16
+ * Represents the data of a specific product item.
17
+ * This DTO is used to transfer detailed information about a product instance.
18
+ */
19
+ class ProductItemDataDto {
20
+ }
21
+ exports.ProductItemDataDto = ProductItemDataDto;
22
+ __decorate([
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_validator_1.IsString)(),
25
+ __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);
@@ -0,0 +1,44 @@
1
+ import { Request } from 'express';
2
+ import { JwtDto } from '../jwt.dto';
3
+ import { ProductInfoResponseDto } from './responses/product-info-response.dto';
4
+ import { ErrorResponseDto } from '../error-response.dto';
5
+ import { ProductCreateRequestDto } from './requests/product-create-request.dto';
6
+ import { ProductCreateResponseDto } from './responses/product-create-response.dto';
7
+ import { ProductRenewRequestDto } from './requests/product-renew-request.dto';
8
+ import { ProductRenewResponseDto } from './responses/product-renew-response.dto';
9
+ import { ProductUpgradeResponseDto } from './responses/product-upgrade-response.dto';
10
+ import { ProductUpgradeRequestDto } from './requests/product-upgrade-request.dto';
11
+ import { ProductDowngradeRequestDto } from './requests/product-downgrade-request.dto';
12
+ import { ProductSuspendRequestDto } from './requests/product-suspend-request.dto';
13
+ import { ProductUnsuspendRequestDto } from './requests/product-unsuspend-request.dto';
14
+ import { ProductUpgradableRequestDto } from './requests/product-upgradable-request.dto';
15
+ import { ProductDowngradableRequestDto } from './requests/product-downgradable-request.dto';
16
+ import { ProductDowngradeResponseDto } from './responses/product-downgrade-response.dto';
17
+ import { ProductUpgradableResponseDto } from './responses/product-upgradable-response.dto';
18
+ import { ProductSuspendResponseDto } from './responses/product-suspend-response.dto';
19
+ import { ProductUnsuspendResponseDto } from './responses/product-unsuspend-response.dto';
20
+ import { ProductDowngradableResponseDto } from './responses/product-downgradable-response.dto';
21
+ import { ProductDeleteResponseDto } from './responses/product-delete-response.dto';
22
+ import { ProductDeleteRequestDto } from './requests/product-delete-request.dto';
23
+ import { ProductValidateAttributesRequestDto } from './requests/product-validate-attributes-request.dto';
24
+ import { ProductValidateAttributesResponseDto } from './responses/product-validate-attributes-response.dto';
25
+ import { SetupStatusResponseDto } from '../setup-status-response.dto';
26
+ export interface ProductControllerInterface {
27
+ info(request: Request & JwtDto): ProductInfoResponseDto | ErrorResponseDto;
28
+ create(requestBody: ProductCreateRequestDto & JwtDto): Promise<ProductCreateResponseDto>;
29
+ renew(requestBody: ProductRenewRequestDto & JwtDto): Promise<ProductRenewResponseDto>;
30
+ upgrade(requestBody: ProductUpgradeRequestDto & JwtDto): Promise<ProductUpgradeResponseDto>;
31
+ downgrade(requestBody: ProductDowngradeRequestDto & JwtDto): Promise<ProductDowngradeResponseDto>;
32
+ suspend(requestBody: ProductSuspendRequestDto & JwtDto): Promise<ProductSuspendResponseDto>;
33
+ unsuspend(requestBody: ProductUnsuspendRequestDto & JwtDto): Promise<ProductUnsuspendResponseDto>;
34
+ upgradable(requestBody: ProductUpgradableRequestDto & JwtDto): Promise<ProductUpgradableResponseDto>;
35
+ Downgradable(requestBody: ProductDowngradableRequestDto & JwtDto): Promise<ProductDowngradableResponseDto>;
36
+ delete(requestBody: ProductDeleteRequestDto & JwtDto): Promise<ProductDeleteResponseDto>;
37
+ validateProductAttributes(requestBody: ProductValidateAttributesRequestDto): Promise<ProductValidateAttributesResponseDto | ErrorResponseDto>;
38
+ validateItemAttributes(requestBody: ProductValidateAttributesRequestDto): Promise<ProductValidateAttributesResponseDto | ErrorResponseDto>;
39
+ setupStatus(): Promise<SetupStatusResponseDto>;
40
+ install(request: Request & JwtDto): Promise<null | ErrorResponseDto>;
41
+ uninstall(request: Request & JwtDto, requestBody: {
42
+ companyId: string;
43
+ }): Promise<null | ErrorResponseDto>;
44
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 create a new product item.
5
+ * This DTO contains all the necessary information for the creation process.
6
+ */
7
+ export declare class ProductCreateRequestDto {
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 for the new product item to be created.
15
+ * This object contains the specific details of the product instance being provisioned.
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.ProductCreateRequestDto = 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 create a new product item.
19
+ * This DTO contains all the necessary information for the creation process.
20
+ */
21
+ class ProductCreateRequestDto {
22
+ }
23
+ exports.ProductCreateRequestDto = ProductCreateRequestDto;
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
+ ], ProductCreateRequestDto.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
+ ], ProductCreateRequestDto.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 delete a product item.
5
+ * This DTO contains all the necessary information for the deletion process.
6
+ */
7
+ export declare class ProductDeleteRequestDto {
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 deleted.
15
+ * This object contains the specific details of the product instance being removed.
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.ProductDeleteRequestDto = 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 delete a product item.
19
+ * This DTO contains all the necessary information for the deletion process.
20
+ */
21
+ class ProductDeleteRequestDto {
22
+ }
23
+ exports.ProductDeleteRequestDto = ProductDeleteRequestDto;
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
+ ], ProductDeleteRequestDto.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
+ ], ProductDeleteRequestDto.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 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,24 @@
1
+ import { ProductItemDataDto } from '../product-item-data.dto';
2
+ import { ClientDataDto } from '../../client-data.dto';
3
+ /**
4
+ * Represents a request to downgrade a product item.
5
+ * This DTO contains all the necessary information for the downgrade process.
6
+ */
7
+ export declare class ProductDowngradeRequestDto {
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 downgraded.
15
+ * This object contains the specific details of the product instance being modified.
16
+ */
17
+ itemData: ProductItemDataDto;
18
+ /**
19
+ * The data of the product item before the downgrade.
20
+ * This object contains the state of the product instance prior to the downgrade.
21
+ * @optional
22
+ */
23
+ previousItemData?: ProductItemDataDto;
24
+ }