@hosterai/types 0.0.25 → 0.0.26

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 (78) hide show
  1. package/dist/dtos/addon-field.dto.d.ts +7 -0
  2. package/dist/dtos/addon-field.dto.js +11 -0
  3. package/dist/dtos/attribute-field.dto.d.ts +20 -0
  4. package/dist/dtos/attribute-field.dto.js +74 -0
  5. package/dist/dtos/country.dto.d.ts +7 -0
  6. package/dist/dtos/country.dto.js +4 -0
  7. package/dist/dtos/field.dto.d.ts +2 -23
  8. package/dist/dtos/field.dto.js +8 -64
  9. package/dist/dtos/info.dto.d.ts +3 -2
  10. package/dist/dtos/info.dto.js +10 -5
  11. package/dist/dtos/invoice/invoice-info.dto.d.ts +15 -0
  12. package/dist/dtos/invoice/invoice-info.dto.js +42 -0
  13. package/dist/dtos/invoice/invoice-item-data.dto.d.ts +10 -0
  14. package/dist/dtos/invoice/invoice-item-data.dto.js +27 -0
  15. package/dist/dtos/invoice/requests/credit-note-request.dto.d.ts +9 -0
  16. package/dist/dtos/invoice/requests/credit-note-request.dto.js +26 -0
  17. package/dist/dtos/invoice/requests/invoice-request.dto.d.ts +9 -0
  18. package/dist/dtos/invoice/requests/invoice-request.dto.js +26 -0
  19. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.d.ts +21 -0
  20. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.js +56 -0
  21. package/dist/dtos/invoice/responses/credit-note-response.dto.d.ts +7 -0
  22. package/dist/dtos/invoice/responses/credit-note-response.dto.js +11 -0
  23. package/dist/dtos/invoice/responses/invoice-response.dto.d.ts +7 -0
  24. package/dist/dtos/invoice/responses/invoice-response.dto.js +11 -0
  25. package/dist/dtos/invoice/responses/proforma-invoice-response.dto.d.ts +12 -0
  26. package/dist/dtos/invoice/responses/proforma-invoice-response.dto.js +35 -0
  27. package/dist/dtos/invoice/transaction-data.dto.d.ts +14 -0
  28. package/dist/dtos/invoice/transaction-data.dto.js +42 -0
  29. package/dist/dtos/invoice-contact-data.dto.d.ts +43 -0
  30. package/dist/dtos/invoice-contact-data.dto.js +120 -0
  31. package/dist/dtos/item-data.dto.d.ts +44 -0
  32. package/dist/dtos/item-data.dto.js +70 -0
  33. package/dist/dtos/notification/requests/notification-send-request.dto.d.ts +18 -0
  34. package/dist/dtos/notification/requests/notification-send-request.dto.js +66 -0
  35. package/dist/dtos/notification/responses/notification-send-response.dto.d.ts +9 -0
  36. package/dist/dtos/notification/responses/notification-send-response.dto.js +26 -0
  37. package/dist/dtos/product/product-info.dto.d.ts +5 -0
  38. package/dist/dtos/product/product-info.dto.js +20 -0
  39. package/dist/dtos/product/product-item-data.dto.d.ts +7 -28
  40. package/dist/dtos/product/product-item-data.dto.js +7 -23
  41. package/dist/dtos/product/requests/product-create-request.dto.d.ts +1 -1
  42. package/dist/dtos/product/requests/product-create-request.dto.js +1 -1
  43. package/dist/dtos/product/requests/product-delete-request.dto.d.ts +1 -1
  44. package/dist/dtos/product/requests/product-delete-request.dto.js +1 -1
  45. package/dist/dtos/product/requests/product-downgradable-request.dto.d.ts +1 -1
  46. package/dist/dtos/product/requests/product-downgradable-request.dto.js +1 -1
  47. package/dist/dtos/product/requests/product-downgrade-request.dto.d.ts +1 -1
  48. package/dist/dtos/product/requests/product-downgrade-request.dto.js +1 -1
  49. package/dist/dtos/product/requests/product-renew-request.dto.d.ts +1 -1
  50. package/dist/dtos/product/requests/product-renew-request.dto.js +1 -1
  51. package/dist/dtos/product/requests/product-suspend-request.dto.d.ts +1 -1
  52. package/dist/dtos/product/requests/product-suspend-request.dto.js +1 -1
  53. package/dist/dtos/product/requests/product-unsuspend-request.dto.d.ts +1 -1
  54. package/dist/dtos/product/requests/product-unsuspend-request.dto.js +1 -1
  55. package/dist/dtos/product/requests/product-upgradable-request.dto.d.ts +1 -1
  56. package/dist/dtos/product/requests/product-upgradable-request.dto.js +1 -1
  57. package/dist/dtos/product/requests/product-upgrade-request.dto.d.ts +1 -1
  58. package/dist/dtos/product/requests/product-upgrade-request.dto.js +1 -1
  59. package/dist/dtos/product/responses/product-info-response.dto.js +17 -0
  60. package/dist/dtos/responses/validate-attributes-response.dto.js +18 -0
  61. package/dist/dtos/settings.dto.d.ts +18 -0
  62. package/dist/dtos/settings.dto.js +19 -2
  63. package/dist/dtos/success-response.dto.d.ts +0 -4
  64. package/dist/dtos/success-response.dto.js +0 -14
  65. package/dist/enums/invoice/invoice-item-actions.enum.d.ts +8 -0
  66. package/dist/enums/invoice/invoice-item-actions.enum.js +12 -0
  67. package/dist/enums/invoice/invoice-types.enum.d.ts +5 -0
  68. package/dist/enums/invoice/invoice-types.enum.js +9 -0
  69. package/dist/enums/item-actions.enum.d.ts +11 -0
  70. package/dist/enums/item-actions.enum.js +16 -0
  71. package/dist/index.d.ts +13 -6
  72. package/dist/index.js +14 -8
  73. package/dist/openapi/schemas/components.schemas.d.ts +35 -47
  74. package/dist/openapi/schemas/components.schemas.js +83 -63
  75. package/dist/validators/notification-info-validator.spec.js +6 -6
  76. package/dist/validators/notification-request-validator.js +1 -1
  77. package/dist/validators/product-info-validator.spec.js +19 -31
  78. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ import { FieldDto } from "./field.dto";
2
+ /**
3
+ * Fields defined by the seller for a product, requested during checkout setup.
4
+ * These fields contain information relevant only to the seller, not to the integration.
5
+ */
6
+ export declare class AddonFieldDto extends FieldDto {
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddonFieldDto = void 0;
4
+ const field_dto_1 = require("./field.dto");
5
+ /**
6
+ * Fields defined by the seller for a product, requested during checkout setup.
7
+ * These fields contain information relevant only to the seller, not to the integration.
8
+ */
9
+ class AddonFieldDto extends field_dto_1.FieldDto {
10
+ }
11
+ exports.AddonFieldDto = AddonFieldDto;
@@ -0,0 +1,20 @@
1
+ import { FieldDto } from "./field.dto";
2
+ import { MultilangTextDto } from "./multilang-text.dto";
3
+ export declare class AttributeFieldDto extends FieldDto {
4
+ /**
5
+ * Indicates if the field is hidden in order
6
+ */
7
+ hidden?: boolean;
8
+ /**
9
+ * Indicates if the field is disabled
10
+ */
11
+ disabled: boolean;
12
+ /**
13
+ * Indicates if the field triggers remote validation
14
+ */
15
+ triggersRemoteValidation?: boolean;
16
+ /**
17
+ * Error message for the field for supported languages
18
+ */
19
+ remoteValidationErrorMessage?: MultilangTextDto[];
20
+ }
@@ -0,0 +1,74 @@
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.AttributeFieldDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
16
+ const field_dto_1 = require("./field.dto");
17
+ const multilang_text_dto_1 = require("./multilang-text.dto");
18
+ class AttributeFieldDto extends field_dto_1.FieldDto {
19
+ constructor() {
20
+ super(...arguments);
21
+ /**
22
+ * Indicates if the field is hidden in order
23
+ */
24
+ this.hidden = false;
25
+ /**
26
+ * Indicates if the field triggers remote validation
27
+ */
28
+ this.triggersRemoteValidation = false;
29
+ }
30
+ }
31
+ exports.AttributeFieldDto = AttributeFieldDto;
32
+ __decorate([
33
+ (0, class_validator_1.IsBoolean)(),
34
+ (0, class_validator_1.IsDefined)(),
35
+ (0, class_validator_jsonschema_1.JSONSchema)({
36
+ title: 'Hidden',
37
+ description: 'Whether the field is hidden.',
38
+ type: 'boolean',
39
+ }),
40
+ __metadata("design:type", Boolean)
41
+ ], AttributeFieldDto.prototype, "hidden", void 0);
42
+ __decorate([
43
+ (0, class_validator_1.IsBoolean)(),
44
+ (0, class_validator_1.IsDefined)(),
45
+ (0, class_validator_jsonschema_1.JSONSchema)({
46
+ title: 'Disabled',
47
+ description: 'Whether the field is disabled.',
48
+ type: 'boolean',
49
+ }),
50
+ __metadata("design:type", Boolean)
51
+ ], AttributeFieldDto.prototype, "disabled", void 0);
52
+ __decorate([
53
+ (0, class_validator_1.IsBoolean)(),
54
+ (0, class_validator_1.IsOptional)(),
55
+ (0, class_validator_jsonschema_1.JSONSchema)({
56
+ title: 'Triggers Remote Validation',
57
+ description: 'If true, field triggers remote validation.',
58
+ type: 'boolean',
59
+ }),
60
+ __metadata("design:type", Boolean)
61
+ ], AttributeFieldDto.prototype, "triggersRemoteValidation", void 0);
62
+ __decorate([
63
+ (0, class_validator_1.ValidateIf)((o) => o.triggersRemoteValidation === true),
64
+ (0, class_validator_1.ValidateNested)({ each: true }),
65
+ (0, class_transformer_1.Type)(() => multilang_text_dto_1.MultilangTextDto),
66
+ (0, class_validator_1.IsOptional)(),
67
+ (0, class_validator_jsonschema_1.JSONSchema)({
68
+ title: 'Remote Validation Error Message',
69
+ description: 'Localized error messages for remote validation.',
70
+ type: 'array',
71
+ items: { $ref: '#/components/schemas/MultilangTextDto' },
72
+ }),
73
+ __metadata("design:type", Array)
74
+ ], AttributeFieldDto.prototype, "remoteValidationErrorMessage", void 0);
@@ -1,6 +1,13 @@
1
1
  import { CountryEnum } from '../enums/country.enum';
2
+ /**
3
+ * Country information returned by the hoster.ai helper function.
4
+ * Used to provide a list of all available countries.
5
+ */
2
6
  export declare class CountryDto {
7
+ /** Country name */
3
8
  name: string;
9
+ /** Country code */
4
10
  code: CountryEnum;
11
+ /** Whether the country is in Europe */
5
12
  isEurope?: boolean;
6
13
  }
@@ -12,6 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CountryDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const country_enum_1 = require("../enums/country.enum");
15
+ /**
16
+ * Country information returned by the hoster.ai helper function.
17
+ * Used to provide a list of all available countries.
18
+ */
15
19
  class CountryDto {
16
20
  }
17
21
  exports.CountryDto = CountryDto;
@@ -28,24 +28,10 @@ export declare class FieldDto {
28
28
  * Type of the field
29
29
  */
30
30
  type: FieldTypeEnum;
31
- repeatableMin?: number;
32
- repeatableMax?: number;
33
31
  /**
34
32
  * Indicates if the field is required
35
33
  */
36
34
  required: boolean;
37
- /**
38
- * Indicates if the field is disabled
39
- */
40
- disabled: boolean;
41
- /**
42
- * Indicates if the field is hidden in order
43
- */
44
- visibleInOrder: boolean;
45
- /**
46
- * Indicates if the field is visible in client panel
47
- */
48
- visibleInClientPanel: boolean;
49
35
  /**
50
36
  * Regex validation pattern for the field
51
37
  */
@@ -54,18 +40,11 @@ export declare class FieldDto {
54
40
  * Error message for the field for supported languages
55
41
  */
56
42
  regexValidationErrorMessage?: MultilangTextDto[];
57
- /**
58
- * Indicates if the field triggers remote validation
59
- */
60
- triggersRemoteValidation?: boolean;
61
- /**
62
- * Error message for the field for supported languages
63
- */
64
- remoteValidationErrorMessage?: MultilangTextDto[];
65
43
  /**
66
44
  * The item attribute is upgradable
67
45
  * If the user has the permission to upgrade the item from his panel
68
46
  * TODO: Let's see if this approach is the best way for the user to upgrade their item
69
47
  */
70
- upgradable: boolean;
48
+ upgradable?: boolean;
49
+ downgradable?: boolean;
71
50
  }
@@ -27,16 +27,13 @@ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
27
27
  */
28
28
  let FieldDto = class FieldDto {
29
29
  constructor() {
30
- /**
31
- * Indicates if the field triggers remote validation
32
- */
33
- this.triggersRemoteValidation = false;
34
30
  /**
35
31
  * The item attribute is upgradable
36
32
  * If the user has the permission to upgrade the item from his panel
37
33
  * TODO: Let's see if this approach is the best way for the user to upgrade their item
38
34
  */
39
35
  this.upgradable = false;
36
+ this.downgradable = false;
40
37
  }
41
38
  };
42
39
  exports.FieldDto = FieldDto;
@@ -99,16 +96,6 @@ __decorate([
99
96
  }),
100
97
  __metadata("design:type", String)
101
98
  ], FieldDto.prototype, "type", void 0);
102
- __decorate([
103
- (0, class_validator_1.IsOptional)(),
104
- (0, class_validator_1.IsNumber)(),
105
- __metadata("design:type", Number)
106
- ], FieldDto.prototype, "repeatableMin", void 0);
107
- __decorate([
108
- (0, class_validator_1.IsOptional)(),
109
- (0, class_validator_1.IsNumber)(),
110
- __metadata("design:type", Number)
111
- ], FieldDto.prototype, "repeatableMax", void 0);
112
99
  __decorate([
113
100
  (0, class_validator_1.IsBoolean)(),
114
101
  (0, class_validator_1.IsDefined)(),
@@ -119,36 +106,6 @@ __decorate([
119
106
  }),
120
107
  __metadata("design:type", Boolean)
121
108
  ], FieldDto.prototype, "required", void 0);
122
- __decorate([
123
- (0, class_validator_1.IsBoolean)(),
124
- (0, class_validator_1.IsDefined)(),
125
- (0, class_validator_jsonschema_1.JSONSchema)({
126
- title: 'Disabled',
127
- description: 'Whether the field is disabled.',
128
- type: 'boolean',
129
- }),
130
- __metadata("design:type", Boolean)
131
- ], FieldDto.prototype, "disabled", void 0);
132
- __decorate([
133
- (0, class_validator_1.IsBoolean)(),
134
- (0, class_validator_1.IsDefined)(),
135
- (0, class_validator_jsonschema_1.JSONSchema)({
136
- title: 'Visible In Order',
137
- description: 'Whether the field is visible in order.',
138
- type: 'boolean',
139
- }),
140
- __metadata("design:type", Boolean)
141
- ], FieldDto.prototype, "visibleInOrder", void 0);
142
- __decorate([
143
- (0, class_validator_1.IsBoolean)(),
144
- (0, class_validator_1.IsDefined)(),
145
- (0, class_validator_jsonschema_1.JSONSchema)({
146
- title: 'Visible In Client Panel',
147
- description: 'Whether the field is visible in client panel.',
148
- type: 'boolean',
149
- }),
150
- __metadata("design:type", Boolean)
151
- ], FieldDto.prototype, "visibleInClientPanel", void 0);
152
109
  __decorate([
153
110
  (0, class_validator_1.IsString)(),
154
111
  (0, is_regex_validator_1.IsRegex)(),
@@ -176,37 +133,24 @@ __decorate([
176
133
  ], FieldDto.prototype, "regexValidationErrorMessage", void 0);
177
134
  __decorate([
178
135
  (0, class_validator_1.IsBoolean)(),
179
- (0, class_validator_1.IsOptional)(),
136
+ (0, class_validator_1.IsDefined)(),
180
137
  (0, class_validator_jsonschema_1.JSONSchema)({
181
- title: 'Triggers Remote Validation',
182
- description: 'If true, field triggers remote validation.',
138
+ title: 'Upgradable',
139
+ description: 'Whether the item attribute is upgradable by the user.',
183
140
  type: 'boolean',
184
141
  }),
185
142
  __metadata("design:type", Boolean)
186
- ], FieldDto.prototype, "triggersRemoteValidation", void 0);
187
- __decorate([
188
- (0, class_validator_1.ValidateIf)((o) => o.triggersRemoteValidation === true),
189
- (0, class_validator_1.ValidateNested)({ each: true }),
190
- (0, class_transformer_1.Type)(() => multilang_text_dto_1.MultilangTextDto),
191
- (0, class_validator_1.IsOptional)(),
192
- (0, class_validator_jsonschema_1.JSONSchema)({
193
- title: 'Remote Validation Error Message',
194
- description: 'Localized error messages for remote validation.',
195
- type: 'array',
196
- items: { $ref: '#/components/schemas/MultilangTextDto' },
197
- }),
198
- __metadata("design:type", Array)
199
- ], FieldDto.prototype, "remoteValidationErrorMessage", void 0);
143
+ ], FieldDto.prototype, "upgradable", void 0);
200
144
  __decorate([
201
145
  (0, class_validator_1.IsBoolean)(),
202
146
  (0, class_validator_1.IsDefined)(),
203
147
  (0, class_validator_jsonschema_1.JSONSchema)({
204
- title: 'Upgradable',
205
- description: 'Whether the item attribute is upgradable by the user.',
148
+ title: 'Downgradable',
149
+ description: 'Whether the item attribute is downgradable by the user.',
206
150
  type: 'boolean',
207
151
  }),
208
152
  __metadata("design:type", Boolean)
209
- ], FieldDto.prototype, "upgradable", void 0);
153
+ ], FieldDto.prototype, "downgradable", void 0);
210
154
  exports.FieldDto = FieldDto = __decorate([
211
155
  (0, all_or_none_validator_1.AllOrNoneProperty)(['repeatableMin', 'repeatableMax']),
212
156
  (0, min_less_or_equal_validator_1.MinLessOrEqualMaxProperty)(['repeatableMin', 'repeatableMax'])
@@ -1,10 +1,11 @@
1
- import { ActionsEnum } from '../enums/actions.enum';
1
+ import { ProductItemActionsEnum } from '../enums/item-actions.enum';
2
2
  import { EventsEnum } from '../enums/events.enum';
3
3
  import { LanguageEnum } from '../enums/language.enum';
4
4
  import { RolesEnum } from '../enums/roles.enum';
5
5
  import { AdminPanelDto } from './admin-panel.dto';
6
6
  import { ClientPanelDto } from './client-panel.dto';
7
7
  import { FieldDto } from './field.dto';
8
+ import { InvoiceTypesEnum } from '../enums/invoice/invoice-types.enum';
8
9
  /**
9
10
  * DTO for integration information.
10
11
  * This is a central DTO that contains all the necessary information
@@ -34,7 +35,7 @@ export declare class InfoDto {
34
35
  /**
35
36
  * A list of actions that are supported by this integration.
36
37
  */
37
- supportedActions?: ActionsEnum[];
38
+ supportedTypes?: ProductItemActionsEnum[] | InvoiceTypesEnum[];
38
39
  /**
39
40
  * A list of events that the integration listens to.
40
41
  * This allows the integration to react to specific events in the system.
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.InfoDto = void 0;
13
- const actions_enum_1 = require("../enums/actions.enum");
13
+ const item_actions_enum_1 = require("../enums/item-actions.enum");
14
14
  const events_enum_1 = require("../enums/events.enum");
15
15
  const language_enum_1 = require("../enums/language.enum");
16
16
  const roles_enum_1 = require("../enums/roles.enum");
@@ -24,6 +24,7 @@ const client_panel_dto_1 = require("./client-panel.dto");
24
24
  const class_validator_jsonschema_1 = require("class-validator-jsonschema");
25
25
  const field_dto_1 = require("./field.dto");
26
26
  const unique_field_in_array_validator_1 = require("../decorators/unique-field-in-array.validator");
27
+ const invoice_types_enum_1 = require("../enums/invoice/invoice-types.enum");
27
28
  /**
28
29
  * DTO for integration information.
29
30
  * This is a central DTO that contains all the necessary information
@@ -35,7 +36,8 @@ class InfoDto {
35
36
  /**
36
37
  * A list of actions that are supported by this integration.
37
38
  */
38
- this.supportedActions = [];
39
+ //TODO Να φυγει απο εδω
40
+ this.supportedTypes = [];
39
41
  }
40
42
  }
41
43
  exports.InfoDto = InfoDto;
@@ -90,15 +92,18 @@ __decorate([
90
92
  __decorate([
91
93
  (0, class_validator_1.IsOptional)(),
92
94
  (0, class_validator_1.IsArray)(),
93
- (0, class_validator_1.IsEnum)(actions_enum_1.ActionsEnum, { each: true }),
95
+ (0, class_validator_1.IsEnum)(item_actions_enum_1.ProductItemActionsEnum, { each: true }),
94
96
  (0, class_validator_jsonschema_1.JSONSchema)({
95
97
  title: 'Supported Actions',
96
98
  description: 'Actions supported by this integration.',
97
99
  type: 'array',
98
- items: { type: 'string', enum: Object.values(actions_enum_1.ActionsEnum) }
100
+ oneOf: [
101
+ { type: 'string', enum: Object.values(item_actions_enum_1.ProductItemActionsEnum) },
102
+ { type: 'string', enum: Object.values(invoice_types_enum_1.InvoiceTypesEnum) }
103
+ ]
99
104
  }),
100
105
  __metadata("design:type", Array)
101
- ], InfoDto.prototype, "supportedActions", void 0);
106
+ ], InfoDto.prototype, "supportedTypes", void 0);
102
107
  __decorate([
103
108
  (0, class_validator_1.IsOptional)(),
104
109
  (0, class_validator_1.IsArray)(),
@@ -0,0 +1,15 @@
1
+ import { CountryEnum } from "../../enums/country.enum";
2
+ import { InfoDto } from "../info.dto";
3
+ import { InvoiceTypesEnum } from "../../enums/invoice/invoice-types.enum";
4
+ /**
5
+ * Invoice integration information.
6
+ * Extends base integration info with invoice-specific configuration.
7
+ */
8
+ export declare class InvoiceInfoDto extends InfoDto {
9
+ /** Countries supported by this invoice integration */
10
+ supportedCountries: CountryEnum[];
11
+ /**
12
+ * A list of actions that are supported by this integration.
13
+ */
14
+ supportedTypes: InvoiceTypesEnum[];
15
+ }
@@ -0,0 +1,42 @@
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.InvoiceInfoDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const info_dto_1 = require("../info.dto");
15
+ const invoice_types_enum_1 = require("../../enums/invoice/invoice-types.enum");
16
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
17
+ /**
18
+ * Invoice integration information.
19
+ * Extends base integration info with invoice-specific configuration.
20
+ */
21
+ class InvoiceInfoDto extends info_dto_1.InfoDto {
22
+ constructor() {
23
+ super(...arguments);
24
+ /**
25
+ * A list of actions that are supported by this integration.
26
+ */
27
+ this.supportedTypes = [];
28
+ }
29
+ }
30
+ exports.InvoiceInfoDto = InvoiceInfoDto;
31
+ __decorate([
32
+ (0, class_validator_1.IsNotEmpty)(),
33
+ (0, class_validator_1.IsArray)(),
34
+ (0, class_validator_1.IsEnum)(invoice_types_enum_1.InvoiceTypesEnum, { each: true }),
35
+ (0, class_validator_jsonschema_1.JSONSchema)({
36
+ title: 'Supported Types',
37
+ description: 'Types of invoice supported by this integration.',
38
+ type: 'array',
39
+ items: { type: 'string', enum: Object.values(invoice_types_enum_1.InvoiceTypesEnum) }
40
+ }),
41
+ __metadata("design:type", Array)
42
+ ], InvoiceInfoDto.prototype, "supportedTypes", void 0);
@@ -0,0 +1,10 @@
1
+ import { InvoiceItemActionsEnum } from "../../enums/invoice/invoice-item-actions.enum";
2
+ import { ItemDataDto } from "../item-data.dto";
3
+ /**
4
+ * Order product item data sent to invoice integrations.
5
+ * Uses invoice-specific actions to avoid confusion with product integration actions.
6
+ */
7
+ export declare class InvoiceItemDataDto extends ItemDataDto {
8
+ /** Invoice-specific action type for this item */
9
+ action: InvoiceItemActionsEnum;
10
+ }
@@ -0,0 +1,27 @@
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.InvoiceItemDataDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const invoice_item_actions_enum_1 = require("../../enums/invoice/invoice-item-actions.enum");
15
+ const item_data_dto_1 = require("../item-data.dto");
16
+ /**
17
+ * Order product item data sent to invoice integrations.
18
+ * Uses invoice-specific actions to avoid confusion with product integration actions.
19
+ */
20
+ class InvoiceItemDataDto extends item_data_dto_1.ItemDataDto {
21
+ }
22
+ exports.InvoiceItemDataDto = InvoiceItemDataDto;
23
+ __decorate([
24
+ (0, class_validator_1.IsDefined)(),
25
+ (0, class_validator_1.IsEnum)(invoice_item_actions_enum_1.InvoiceItemActionsEnum),
26
+ __metadata("design:type", String)
27
+ ], InvoiceItemDataDto.prototype, "action", void 0);
@@ -0,0 +1,9 @@
1
+ import { ProformaInvoiceRequestDto } from "./proforma-invoice-request.dto";
2
+ /**
3
+ * Request payload for creating a credit note.
4
+ * Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
5
+ */
6
+ export declare class CreditNoteRequestDto extends ProformaInvoiceRequestDto {
7
+ /** Reference to the parent invoice being credited */
8
+ parentInvoiceId: string;
9
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreditNoteRequestDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const proforma_invoice_request_dto_1 = require("./proforma-invoice-request.dto");
15
+ /**
16
+ * Request payload for creating a credit note.
17
+ * Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
18
+ */
19
+ class CreditNoteRequestDto extends proforma_invoice_request_dto_1.ProformaInvoiceRequestDto {
20
+ }
21
+ exports.CreditNoteRequestDto = CreditNoteRequestDto;
22
+ __decorate([
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_validator_1.IsString)(),
25
+ __metadata("design:type", String)
26
+ ], CreditNoteRequestDto.prototype, "parentInvoiceId", void 0);
@@ -0,0 +1,9 @@
1
+ import { ProformaInvoiceRequestDto } from "./proforma-invoice-request.dto";
2
+ /**
3
+ * Request payload for creating a standard invoice.
4
+ * Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
5
+ */
6
+ export declare class InvoiceRequestDto extends ProformaInvoiceRequestDto {
7
+ /** Reference to parent invoice if applicable */
8
+ parentInvoiceId?: string;
9
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.InvoiceRequestDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const proforma_invoice_request_dto_1 = require("./proforma-invoice-request.dto");
15
+ /**
16
+ * Request payload for creating a standard invoice.
17
+ * Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
18
+ */
19
+ class InvoiceRequestDto extends proforma_invoice_request_dto_1.ProformaInvoiceRequestDto {
20
+ }
21
+ exports.InvoiceRequestDto = InvoiceRequestDto;
22
+ __decorate([
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_validator_1.IsString)(),
25
+ __metadata("design:type", String)
26
+ ], InvoiceRequestDto.prototype, "parentInvoiceId", void 0);
@@ -0,0 +1,21 @@
1
+ import { InvoiceContactData } from "../../invoice-contact-data.dto";
2
+ import { InvoiceItemDataDto } from "../invoice-item-data.dto";
3
+ import { TransactionData } from "../transaction-data.dto";
4
+ /**
5
+ * Request payload for creating a proforma invoice.
6
+ * Sent from hoster.ai to invoice integrations to issue a proforma document.
7
+ */
8
+ export declare class ProformaInvoiceRequestDto {
9
+ /** Unique identifier for the invoice */
10
+ invoiceId: string;
11
+ /** Company identifier issuing the invoice */
12
+ companyId: string;
13
+ /** List of transactions associated with this invoice */
14
+ transactions: TransactionData[];
15
+ /** Billing contact information for the invoice recipient */
16
+ invoiceContact: InvoiceContactData;
17
+ /** Line items included in the invoice */
18
+ items: InvoiceItemDataDto[];
19
+ /** Total invoice amount */
20
+ totalAmount: number;
21
+ }
@@ -0,0 +1,56 @@
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.ProformaInvoiceRequestDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const invoice_contact_data_dto_1 = require("../../invoice-contact-data.dto");
16
+ const invoice_item_data_dto_1 = require("../invoice-item-data.dto");
17
+ const transaction_data_dto_1 = require("../transaction-data.dto");
18
+ /**
19
+ * Request payload for creating a proforma invoice.
20
+ * Sent from hoster.ai to invoice integrations to issue a proforma document.
21
+ */
22
+ class ProformaInvoiceRequestDto {
23
+ }
24
+ exports.ProformaInvoiceRequestDto = ProformaInvoiceRequestDto;
25
+ __decorate([
26
+ (0, class_validator_1.IsString)(),
27
+ (0, class_validator_1.IsNotEmpty)(),
28
+ __metadata("design:type", String)
29
+ ], ProformaInvoiceRequestDto.prototype, "invoiceId", void 0);
30
+ __decorate([
31
+ (0, class_validator_1.IsString)(),
32
+ (0, class_validator_1.IsNotEmpty)(),
33
+ __metadata("design:type", String)
34
+ ], ProformaInvoiceRequestDto.prototype, "companyId", void 0);
35
+ __decorate([
36
+ (0, class_validator_1.IsArray)(),
37
+ (0, class_validator_1.ValidateNested)({ each: true }),
38
+ (0, class_transformer_1.Type)(() => transaction_data_dto_1.TransactionData),
39
+ __metadata("design:type", Array)
40
+ ], ProformaInvoiceRequestDto.prototype, "transactions", void 0);
41
+ __decorate([
42
+ (0, class_validator_1.ValidateNested)(),
43
+ (0, class_transformer_1.Type)(() => invoice_contact_data_dto_1.InvoiceContactData),
44
+ __metadata("design:type", invoice_contact_data_dto_1.InvoiceContactData)
45
+ ], ProformaInvoiceRequestDto.prototype, "invoiceContact", void 0);
46
+ __decorate([
47
+ (0, class_validator_1.IsArray)(),
48
+ (0, class_validator_1.ValidateNested)({ each: true }),
49
+ (0, class_transformer_1.Type)(() => invoice_item_data_dto_1.InvoiceItemDataDto),
50
+ __metadata("design:type", Array)
51
+ ], ProformaInvoiceRequestDto.prototype, "items", void 0);
52
+ __decorate([
53
+ (0, class_validator_1.IsNumber)(),
54
+ (0, class_validator_1.IsNotEmpty)(),
55
+ __metadata("design:type", Number)
56
+ ], ProformaInvoiceRequestDto.prototype, "totalAmount", void 0);
@@ -0,0 +1,7 @@
1
+ import { ProformaInvoiceResponseDto } from "./proforma-invoice-response.dto";
2
+ /**
3
+ * Response from invoice integrations after successfully creating a credit note.
4
+ * Maintains consistency with request/response naming (CreditNoteRequest → CreditNoteResponse).
5
+ */
6
+ export declare class CreditNoteResponseDto extends ProformaInvoiceResponseDto {
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreditNoteResponseDto = void 0;
4
+ const proforma_invoice_response_dto_1 = require("./proforma-invoice-response.dto");
5
+ /**
6
+ * Response from invoice integrations after successfully creating a credit note.
7
+ * Maintains consistency with request/response naming (CreditNoteRequest → CreditNoteResponse).
8
+ */
9
+ class CreditNoteResponseDto extends proforma_invoice_response_dto_1.ProformaInvoiceResponseDto {
10
+ }
11
+ exports.CreditNoteResponseDto = CreditNoteResponseDto;