@hosterai/types 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -39
- package/dist/dtos/action.dto.d.ts +21 -3
- package/dist/dtos/action.dto.js +10 -0
- package/dist/dtos/attachment.dto.d.ts +1 -1
- package/dist/dtos/attachment.dto.js +1 -1
- package/dist/dtos/client-data.dto.d.ts +65 -0
- package/dist/dtos/client-data.dto.js +106 -0
- package/dist/dtos/company-data.dto.d.ts +57 -0
- package/dist/dtos/company-data.dto.js +5 -2
- package/dist/dtos/error-response.dto.d.ts +8 -6
- package/dist/dtos/error-response.dto.js +2 -2
- package/dist/dtos/field.dto.d.ts +5 -0
- package/dist/dtos/field.dto.js +5 -0
- package/dist/dtos/info.dto.d.ts +61 -64
- package/dist/dtos/info.dto.js +6 -4
- package/dist/dtos/jwt.dto.d.ts +12 -9
- package/dist/dtos/jwt.dto.js +6 -2
- package/dist/dtos/menu.dto.d.ts +26 -11
- package/dist/dtos/multilang-text.dto.d.ts +11 -0
- package/dist/dtos/multilang-text.dto.js +4 -0
- package/dist/dtos/notification/notification-info.dto.d.ts +15 -0
- package/dist/dtos/notification/notification-info.dto.js +4 -0
- package/dist/dtos/notification/{notification-request.dto.d.ts → notification-send-request.dto.d.ts} +6 -1
- package/dist/dtos/notification/{notification-request.dto.js → notification-send-request.dto.js} +11 -6
- package/dist/dtos/product/product-info.dto.d.ts +30 -0
- package/dist/dtos/product/product-info.dto.js +11 -0
- package/dist/dtos/product/product-item-data.dto.d.ts +31 -0
- package/dist/dtos/product/product-item-data.dto.js +43 -0
- package/dist/dtos/product/product.interface.d.ts +44 -0
- package/dist/dtos/product/product.interface.js +2 -0
- package/dist/dtos/product/requests/product-create-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-create-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-delete-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-delete-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-downgrade-request.dto.d.ts +24 -0
- package/dist/dtos/product/requests/product-downgrade-request.dto.js +44 -0
- package/dist/dtos/product/requests/product-downgradeable-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-downgradeable-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-renew-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-renew-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-suspend-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-suspend-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-unsuspend-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-unsuspend-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-upgrade-request.dto.d.ts +24 -0
- package/dist/dtos/product/requests/product-upgrade-request.dto.js +44 -0
- package/dist/dtos/product/requests/product-upgradeable-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-upgradeable-request.dto.js +37 -0
- package/dist/dtos/product/requests/product-validate-attributes-request.dto.d.ts +18 -0
- package/dist/dtos/product/requests/product-validate-attributes-request.dto.js +31 -0
- package/dist/dtos/product/responses/product-create-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-create-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-delete-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-delete-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-downgrade-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-downgrade-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-downgradeable-response.dto.d.ts +22 -0
- package/dist/dtos/product/responses/product-downgradeable-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-info-response.dto.d.ts +13 -0
- package/dist/dtos/product/responses/product-info-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-renew-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-renew-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-suspend-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-suspend-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-unsuspend-response.dto.d.ts +21 -0
- package/dist/dtos/product/responses/product-unsuspend-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-upgrade-response.dto.d.ts +22 -0
- package/dist/dtos/product/responses/product-upgrade-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-upgradeable-response.dto.d.ts +22 -0
- package/dist/dtos/product/responses/product-upgradeable-response.dto.js +11 -0
- package/dist/dtos/product/responses/product-validate-attributes-response.dto.d.ts +13 -0
- package/dist/dtos/product/responses/product-validate-attributes-response.dto.js +11 -0
- package/dist/dtos/response-data.dto.d.ts +7 -0
- package/dist/dtos/response-data.dto.js +4 -0
- package/dist/dtos/setup-status-response.dto.d.ts +8 -0
- package/dist/dtos/setup-status-response.dto.js +4 -0
- package/dist/dtos/submenu.dto.d.ts +7 -0
- package/dist/dtos/submenu.dto.js +11 -0
- package/dist/dtos/success-response.dto.d.ts +4 -0
- package/dist/dtos/success-response.dto.js +4 -0
- package/dist/dtos/tab.dto.d.ts +0 -2
- package/dist/dtos/tab.dto.js +1 -4
- package/dist/dtos/task-response.dto.d.ts +4 -0
- package/dist/dtos/task-response.dto.js +4 -0
- package/dist/dtos/unit.dto.d.ts +16 -0
- package/dist/dtos/unit.dto.js +4 -0
- package/dist/enums/duration.enum.d.ts +23 -0
- package/dist/enums/duration.enum.js +27 -0
- package/dist/enums/events.enum.d.ts +2 -0
- package/dist/enums/events.enum.js +2 -0
- package/dist/enums/response-status.enum.d.ts +5 -0
- package/dist/enums/response-status.enum.js +9 -0
- package/dist/index.d.ts +57 -14
- package/dist/index.js +65 -19
- package/dist/validators/client-data-validator.d.ts +8 -0
- package/dist/validators/client-data-validator.js +17 -0
- package/dist/validators/notification-request-validator.js +2 -2
- package/dist/validators/product-create-request-validator.d.ts +8 -0
- package/dist/validators/product-create-request-validator.js +17 -0
- package/dist/validators/product-delete-request-validator.d.ts +8 -0
- package/dist/validators/product-delete-request-validator.js +17 -0
- package/dist/validators/product-downgrade-request-validator.d.ts +8 -0
- package/dist/validators/product-downgrade-request-validator.js +17 -0
- package/dist/validators/product-downgradeable-request-validator.d.ts +8 -0
- package/dist/validators/product-downgradeable-request-validator.js +17 -0
- package/dist/validators/product-renew-request-validator.d.ts +8 -0
- package/dist/validators/product-renew-request-validator.js +17 -0
- package/dist/validators/product-suspend-request-validator.d.ts +8 -0
- package/dist/validators/product-suspend-request-validator.js +17 -0
- package/dist/validators/product-unsuspend-request-validator.d.ts +8 -0
- package/dist/validators/product-unsuspend-request-validator.js +17 -0
- package/dist/validators/product-upgrade-request-validator.d.ts +8 -0
- package/dist/validators/product-upgrade-request-validator.js +17 -0
- package/dist/validators/product-upgradeable-request-validator.d.ts +8 -0
- package/dist/validators/product-upgradeable-request-validator.js +17 -0
- package/dist/validators/product-validate-attributes-request-validator.d.ts +8 -0
- package/dist/validators/product-validate-attributes-request-validator.js +17 -0
- package/package.json +5 -2
package/dist/dtos/info.dto.d.ts
CHANGED
|
@@ -1,91 +1,100 @@
|
|
|
1
1
|
import { ActionsEnum } from '../enums/actions.enum';
|
|
2
2
|
import { EventsEnum } from '../enums/events.enum';
|
|
3
|
-
import { FieldDto } from './field.dto';
|
|
4
|
-
import { ResponseDataDto } from './response-data.dto';
|
|
5
|
-
import { UnitDto } from './unit.dto';
|
|
6
3
|
import { LanguageEnum } from '../enums/language.enum';
|
|
7
4
|
import { RolesEnum } from '../enums/roles.enum';
|
|
8
5
|
import { ActionDto } from './action.dto';
|
|
9
6
|
import { TabDto } from './tab.dto';
|
|
10
7
|
import { MenuDtoWithSubmenu, MenuDtoWithUrl } from './menu.dto';
|
|
11
8
|
/**
|
|
12
|
-
* DTO for integration information
|
|
13
|
-
*
|
|
9
|
+
* DTO for integration information.
|
|
10
|
+
* This is a central DTO that contains all the necessary information
|
|
11
|
+
* for a service integration, including UI configuration, supported features,
|
|
12
|
+
* and billing details.
|
|
14
13
|
*/
|
|
15
14
|
export declare class InfoDto {
|
|
16
15
|
/**
|
|
17
|
-
* The title of the integration
|
|
16
|
+
* The display title of the integration.
|
|
17
|
+
* @example "My Awesome Integration"
|
|
18
18
|
*/
|
|
19
19
|
title: string;
|
|
20
20
|
/**
|
|
21
|
-
* The
|
|
21
|
+
* The URL of the integration's logo.
|
|
22
|
+
* @example "https://example.com/logo.png"
|
|
22
23
|
*/
|
|
23
24
|
logo?: string;
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
+
* A brief description of the integration and its services.
|
|
27
|
+
* @example "This integration provides a set of tools for managing your products."
|
|
26
28
|
*/
|
|
27
29
|
description?: string;
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* A list of languages supported by the integration.
|
|
30
32
|
*/
|
|
31
|
-
|
|
33
|
+
supportedLanguages: LanguageEnum[];
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
35
|
+
* A list of actions that are supported by this integration.
|
|
34
36
|
*/
|
|
35
|
-
|
|
37
|
+
supportedActions?: ActionsEnum[];
|
|
36
38
|
/**
|
|
37
|
-
*
|
|
39
|
+
* A list of events that the integration listens to.
|
|
40
|
+
* This allows the integration to react to specific events in the system.
|
|
38
41
|
*/
|
|
39
|
-
|
|
42
|
+
listenEvents?: EventsEnum[];
|
|
40
43
|
/**
|
|
41
|
-
*
|
|
42
|
-
*/
|
|
43
|
-
listen_events?: EventsEnum[];
|
|
44
|
-
/**
|
|
45
|
-
* The roles that need to be accepted by the company
|
|
44
|
+
* A list of roles that the company needs to accept for this integration to function correctly.
|
|
46
45
|
*/
|
|
47
46
|
requiredRoles?: RolesEnum[];
|
|
48
|
-
/**
|
|
49
|
-
* Actions that are not supported by the integration.
|
|
50
|
-
*/
|
|
51
|
-
unsupportedActions?: ActionsEnum[];
|
|
52
47
|
/**
|
|
53
48
|
* Configuration for the admin panel.
|
|
54
|
-
*
|
|
49
|
+
* This section defines the entire user interface for the integration's admin panel.
|
|
55
50
|
*/
|
|
56
51
|
adminPanel?: {
|
|
57
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Defines the tab structure for different sections of the admin panel.
|
|
54
|
+
* Each property represents a section (e.g., product, item) and contains an array of TabDto objects.
|
|
55
|
+
*/
|
|
58
56
|
tabs?: {
|
|
59
|
-
/** Tabs
|
|
57
|
+
/** Tabs for the product management section. */
|
|
60
58
|
product: TabDto[];
|
|
61
|
-
/** Tabs
|
|
59
|
+
/** Tabs for the item management section. */
|
|
62
60
|
item: TabDto[];
|
|
63
|
-
/** Tabs
|
|
61
|
+
/** Tabs for the client management section. */
|
|
64
62
|
client: TabDto[];
|
|
65
|
-
/** Tabs
|
|
63
|
+
/** Tabs for the user management section. */
|
|
66
64
|
user: TabDto[];
|
|
67
|
-
/** Tabs
|
|
65
|
+
/** Tabs for the order management section. */
|
|
68
66
|
order: TabDto[];
|
|
69
67
|
};
|
|
70
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Defines additional actions that can be performed in different sections of the admin panel.
|
|
70
|
+
*/
|
|
71
71
|
moreActions?: {
|
|
72
|
-
/** Actions
|
|
72
|
+
/** Actions available in the client management section. */
|
|
73
73
|
client?: ActionDto[];
|
|
74
|
-
/** Actions
|
|
74
|
+
/** Actions available in the item management section. */
|
|
75
75
|
item?: ActionDto[];
|
|
76
|
-
/** Actions
|
|
76
|
+
/** Actions available in the invoice management section. */
|
|
77
77
|
invoice?: ActionDto[];
|
|
78
|
-
/** Actions
|
|
78
|
+
/** Actions available in the user management section. */
|
|
79
79
|
user?: ActionDto[];
|
|
80
|
-
/** Actions
|
|
80
|
+
/** Actions available in the order management section. */
|
|
81
81
|
order?: ActionDto[];
|
|
82
82
|
};
|
|
83
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* The main menu for the admin panel.
|
|
85
|
+
* This can be a simple menu with a URL or a menu with submenus.
|
|
86
|
+
*/
|
|
84
87
|
menu?: MenuDtoWithSubmenu | MenuDtoWithUrl;
|
|
88
|
+
/**
|
|
89
|
+
* Configuration for the integration's settings page.
|
|
90
|
+
*/
|
|
85
91
|
settings?: {
|
|
92
|
+
/** The label for the settings page. */
|
|
86
93
|
label: string;
|
|
94
|
+
/** The icon for the settings page. */
|
|
87
95
|
icon: string;
|
|
88
|
-
description
|
|
96
|
+
/** A description of the settings page. */
|
|
97
|
+
descrition: string;
|
|
89
98
|
} & ({
|
|
90
99
|
url: string;
|
|
91
100
|
tabs?: never;
|
|
@@ -96,44 +105,32 @@ export declare class InfoDto {
|
|
|
96
105
|
};
|
|
97
106
|
/**
|
|
98
107
|
* Configuration for the client panel.
|
|
99
|
-
*
|
|
108
|
+
* This section defines the user interface for the integration's client-facing panel.
|
|
100
109
|
*/
|
|
101
110
|
clientPanel?: {
|
|
102
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* Defines the tab structure for the client panel.
|
|
113
|
+
*/
|
|
103
114
|
tabs?: {
|
|
104
|
-
/** Tabs
|
|
115
|
+
/** Tabs for the item management section. */
|
|
105
116
|
item: TabDto[];
|
|
106
117
|
};
|
|
107
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* Defines additional actions that can be performed in the client panel.
|
|
120
|
+
*/
|
|
108
121
|
moreActions?: {
|
|
109
|
-
/** Actions
|
|
122
|
+
/** Actions available in the item management section. */
|
|
110
123
|
item?: ActionDto[];
|
|
111
124
|
};
|
|
112
|
-
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* If there are submenus, the label of the MenuDto and the TabDtos of the MenuDto will be displayed in the panel.
|
|
116
|
-
* The TabDtos of the MenuDto will be the submenus of the MenuDto.
|
|
125
|
+
/**
|
|
126
|
+
* The main menu for the client panel.
|
|
127
|
+
* This can be a simple menu with a URL or a menu with submenus.
|
|
117
128
|
*/
|
|
118
129
|
menu?: MenuDtoWithSubmenu | MenuDtoWithUrl;
|
|
119
130
|
};
|
|
120
131
|
/**
|
|
121
|
-
* The
|
|
122
|
-
*
|
|
123
|
-
* with this url and the jwt in the url
|
|
132
|
+
* The URL for the onboarding process after the integration is installed.
|
|
133
|
+
* This URL will be displayed in a popup or side sheet with a JWT for authentication.
|
|
124
134
|
*/
|
|
125
135
|
onboardingUrl?: string;
|
|
126
|
-
/**
|
|
127
|
-
* Units for pay-per-use billing.
|
|
128
|
-
* e.g. id: ram, unitDescription: MB, intervalDescription: month
|
|
129
|
-
* With the above in the admin the administrator will be able to set a price for
|
|
130
|
-
* MB per month (the id is the unit's unique identifier)
|
|
131
|
-
*/
|
|
132
|
-
payPerUseUnits?: UnitDto[];
|
|
133
|
-
/**
|
|
134
|
-
* Here we need to specify the fields (keys) that a successful create will return
|
|
135
|
-
* In other words, we want to know the information that a successful create will
|
|
136
|
-
* return, before the create is executed
|
|
137
|
-
*/
|
|
138
|
-
responseDataFieldNames?: Record<keyof ResponseDataDto, string>;
|
|
139
136
|
}
|
package/dist/dtos/info.dto.js
CHANGED
|
@@ -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
|
-
*
|
|
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
|
-
*
|
|
13
|
+
* A list of actions that are supported by this integration.
|
|
12
14
|
*/
|
|
13
|
-
this.
|
|
15
|
+
this.supportedActions = [];
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
exports.InfoDto = InfoDto;
|
package/dist/dtos/jwt.dto.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
8
|
+
* The unique identifier for the integration.
|
|
5
9
|
*/
|
|
6
10
|
integrationId: string;
|
|
7
11
|
/**
|
|
8
|
-
*
|
|
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
|
-
*
|
|
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
|
|
22
|
-
*
|
|
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
|
-
*
|
|
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
|
}
|
package/dist/dtos/jwt.dto.js
CHANGED
|
@@ -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
|
|
40
|
-
*
|
|
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
|
}
|
package/dist/dtos/menu.dto.d.ts
CHANGED
|
@@ -1,39 +1,54 @@
|
|
|
1
|
-
import { SubmenuDto } from './
|
|
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
|
-
*
|
|
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
|
|
22
|
-
*
|
|
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
|
-
*
|
|
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
|
|
36
|
-
*
|
|
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;
|
package/dist/dtos/notification/{notification-request.dto.d.ts → notification-send-request.dto.d.ts}
RENAMED
|
@@ -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
|
-
|
|
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
|
*/
|
package/dist/dtos/notification/{notification-request.dto.js → notification-send-request.dto.js}
RENAMED
|
@@ -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.
|
|
12
|
+
exports.NotificationSendRequestDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
-
|
|
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.
|
|
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
|
-
],
|
|
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
|
-
],
|
|
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
|
-
],
|
|
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 { ProductUpgradeableRequestDto } from './requests/product-upgradeable-request.dto';
|
|
15
|
+
import { ProductDowngradableRequestDto } from './requests/product-downgradeable-request.dto';
|
|
16
|
+
import { ProductDowngradeResponseDto } from './responses/product-downgrade-response.dto';
|
|
17
|
+
import { ProductUpgradeableResponseDto } from './responses/product-upgradeable-response.dto';
|
|
18
|
+
import { ProductSuspendResponseDto } from './responses/product-suspend-response.dto';
|
|
19
|
+
import { ProductUnsuspendResponseDto } from './responses/product-unsuspend-response.dto';
|
|
20
|
+
import { ProductDowngradeableResponseDto } from './responses/product-downgradeable-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
|
+
upgradeable(requestBody: ProductUpgradeableRequestDto & JwtDto): Promise<ProductUpgradeableResponseDto>;
|
|
35
|
+
downgradeable(requestBody: ProductDowngradableRequestDto & JwtDto): Promise<ProductDowngradeableResponseDto>;
|
|
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
|
+
}
|