@hosterai/types 0.0.28 → 0.0.29

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 (100) hide show
  1. package/README.md +5 -1
  2. package/dist/decorators/all-or-none-validator.spec.js +9 -3
  3. package/dist/decorators/at-least-one-non-empty-validator.spec.js +1 -1
  4. package/dist/decorators/at-least-one-non-empty.validator.js +2 -2
  5. package/dist/decorators/is-of-allowed-types-validator.spec.js +10 -8
  6. package/dist/decorators/is-of-allowed-types.validator.js +4 -2
  7. package/dist/decorators/is-one-of.validator.d.ts +2 -2
  8. package/dist/decorators/is-one-of.validator.js +1 -1
  9. package/dist/decorators/is-plain-object.validator.d.ts +1 -1
  10. package/dist/decorators/is-plain-object.validator.js +3 -1
  11. package/dist/decorators/is-property-forbidden-validator.spec.js +12 -4
  12. package/dist/decorators/is-property-forbidden.validator.d.ts +1 -1
  13. package/dist/decorators/is-regex.validator.d.ts +1 -1
  14. package/dist/decorators/min-less-or-equal-validator.spec.js +6 -2
  15. package/dist/dtos/action.dto.js +5 -5
  16. package/dist/dtos/addon-field.dto.d.ts +1 -1
  17. package/dist/dtos/admin-panel.dto.js +16 -18
  18. package/dist/dtos/attribute-field.dto.d.ts +1 -1
  19. package/dist/dtos/client-panel.dto.d.ts +3 -3
  20. package/dist/dtos/client-panel.dto.js +11 -10
  21. package/dist/dtos/company-data.dto.d.ts +4 -0
  22. package/dist/dtos/company-data.dto.js +19 -8
  23. package/dist/dtos/error-response.dto.js +1 -4
  24. package/dist/dtos/field-option.dto.js +3 -3
  25. package/dist/dtos/info.dto.js +10 -10
  26. package/dist/dtos/invoice/invoice-info.dto.d.ts +3 -3
  27. package/dist/dtos/invoice/invoice-info.dto.js +1 -1
  28. package/dist/dtos/invoice/invoice-item-data.dto.d.ts +2 -2
  29. package/dist/dtos/invoice/requests/base-invoice-request.dto.d.ts +30 -0
  30. package/dist/dtos/invoice/requests/base-invoice-request.dto.js +108 -0
  31. package/dist/dtos/invoice/requests/credit-note-request.dto.d.ts +2 -2
  32. package/dist/dtos/invoice/requests/credit-note-request.dto.js +2 -2
  33. package/dist/dtos/invoice/requests/invoice-request.dto.d.ts +2 -2
  34. package/dist/dtos/invoice/requests/invoice-request.dto.js +2 -2
  35. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.d.ts +2 -19
  36. package/dist/dtos/invoice/requests/proforma-invoice-request.dto.js +2 -95
  37. package/dist/dtos/invoice/responses/credit-note-response.dto.d.ts +1 -1
  38. package/dist/dtos/invoice/responses/invoice-response.dto.d.ts +1 -1
  39. package/dist/dtos/invoice/responses/tax-details-response.dto.js +1 -1
  40. package/dist/dtos/invoice-contact-data.dto.d.ts +2 -2
  41. package/dist/dtos/invoice-contact-data.dto.js +5 -5
  42. package/dist/dtos/menu.dto.js +8 -4
  43. package/dist/dtos/notification/responses/notification-send-response.dto.d.ts +1 -1
  44. package/dist/dtos/notification/sender/sender-sms.dto.js +1 -1
  45. package/dist/dtos/product/product-info.dto.js +11 -5
  46. package/dist/dtos/product/product-item-data.dto.d.ts +2 -2
  47. package/dist/dtos/product/requests/product-create-request.dto.js +1 -1
  48. package/dist/dtos/product/requests/product-delete-request.dto.js +3 -3
  49. package/dist/dtos/product/requests/product-downgradable-request.dto.js +1 -1
  50. package/dist/dtos/product/requests/product-downgrade-request.dto.js +1 -1
  51. package/dist/dtos/product/requests/product-renew-request.dto.js +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.js +1 -1
  54. package/dist/dtos/product/requests/product-upgradable-request.dto.js +1 -1
  55. package/dist/dtos/product/requests/product-upgrade-request.dto.js +1 -1
  56. package/dist/dtos/product/responses/product-info-response.dto.js +1 -1
  57. package/dist/dtos/responses/validate-attributes-response.dto.d.ts +2 -2
  58. package/dist/dtos/tab.dto.js +2 -2
  59. package/dist/dtos/tax-manager/tax-details-request.dto.d.ts +31 -0
  60. package/dist/dtos/tax-manager/tax-details-request.dto.js +84 -0
  61. package/dist/dtos/unit.dto.js +3 -3
  62. package/dist/enums/country.enum.d.ts +1 -1
  63. package/dist/enums/country.enum.js +312 -78
  64. package/dist/enums/currency.enum.d.ts +43 -0
  65. package/dist/enums/currency.enum.js +47 -0
  66. package/dist/index.d.ts +2 -1
  67. package/dist/index.js +2 -1
  68. package/dist/openapi/schemas/components.schemas.d.ts +0 -30
  69. package/dist/openapi/schemas/components.schemas.js +10 -40
  70. package/dist/validators/action-validator.spec.js +3 -3
  71. package/dist/validators/addon-field-validator.spec.js +10 -3
  72. package/dist/validators/admin-panel-more-actions-validator.spec.js +12 -8
  73. package/dist/validators/admin-panel-more-actions.validator.d.ts +1 -1
  74. package/dist/validators/admin-panel-tabs-validator.spec.js +74 -10
  75. package/dist/validators/admin-panel-tabs.validator.d.ts +1 -1
  76. package/dist/validators/admin-panel-validator.spec.js +164 -32
  77. package/dist/validators/attachment-validator.spec.js +8 -8
  78. package/dist/validators/attribute-field-validator.spec.js +18 -7
  79. package/dist/validators/client-panel-validator.spec.js +57 -9
  80. package/dist/validators/country-validator.spec.js +7 -7
  81. package/dist/validators/field-validator.spec.js +35 -10
  82. package/dist/validators/info-validator.spec.js +10 -10
  83. package/dist/validators/invoice-contact-data-validator.spec.js +18 -10
  84. package/dist/validators/invoice-info-validator.spec.js +14 -10
  85. package/dist/validators/invoice-item-data-validator.spec.js +4 -4
  86. package/dist/validators/item-data-validator.spec.js +17 -9
  87. package/dist/validators/menu-with-submenu-validator.spec.js +13 -11
  88. package/dist/validators/menu-with-url-validator.spec.js +15 -5
  89. package/dist/validators/notification-info-validator.spec.js +23 -15
  90. package/dist/validators/product-info-validator.spec.js +46 -32
  91. package/dist/validators/product-info.validator.d.ts +1 -1
  92. package/dist/validators/product-item-data-validator.spec.js +12 -4
  93. package/dist/validators/sender-sms-validator.spec.js +5 -2
  94. package/dist/validators/settings-with-tabs-validator.spec.js +176 -12
  95. package/dist/validators/settings-with-url-validator.spec.js +89 -11
  96. package/dist/validators/tab-validator.spec.js +7 -7
  97. package/dist/validators/tin-validation-details-validator.spec.js +8 -8
  98. package/dist/validators/transaction-data-validator.spec.js +13 -8
  99. package/dist/validators/unit-validator.spec.js +13 -4
  100. package/package.json +1 -1
@@ -44,7 +44,7 @@ __decorate([
44
44
  title: 'Product Attributes',
45
45
  description: 'Configurable attributes that apply at the product level.',
46
46
  type: 'array',
47
- items: { $ref: '#/components/schemas/AttributeFieldDto' }
47
+ items: { $ref: '#/components/schemas/AttributeFieldDto' },
48
48
  }),
49
49
  __metadata("design:type", Array)
50
50
  ], ProductInfoDto.prototype, "productAttributes", void 0);
@@ -59,7 +59,7 @@ __decorate([
59
59
  title: 'Item Attributes',
60
60
  description: 'Configurable attributes that apply at the item level.',
61
61
  type: 'array',
62
- items: { $ref: '#/components/schemas/AttributeFieldDto' }
62
+ items: { $ref: '#/components/schemas/AttributeFieldDto' },
63
63
  }),
64
64
  __metadata("design:type", Array)
65
65
  ], ProductInfoDto.prototype, "itemAttributes", void 0);
@@ -74,7 +74,13 @@ __decorate([
74
74
  description: 'Optional metering units for pay-per-use billing.',
75
75
  type: 'array',
76
76
  items: { $ref: '#/components/schemas/UnitDto' },
77
- example: [{ id: 'requests', unitDescription: 'API request', intervalDescription: 'Per month' }]
77
+ example: [
78
+ {
79
+ id: 'requests',
80
+ unitDescription: 'API request',
81
+ intervalDescription: 'Per month',
82
+ },
83
+ ],
78
84
  }),
79
85
  __metadata("design:type", Array)
80
86
  ], ProductInfoDto.prototype, "payPerUseUnits", void 0);
@@ -86,7 +92,7 @@ __decorate([
86
92
  description: 'Mapping of field names used in provider responses.',
87
93
  type: 'object',
88
94
  additionalProperties: { type: 'string' },
89
- example: { external_id: 'id', status_text: 'status' }
95
+ example: { external_id: 'id', status_text: 'status' },
90
96
  }),
91
97
  __metadata("design:type", Object)
92
98
  ], ProductInfoDto.prototype, "responseDataFieldNames", void 0);
@@ -98,7 +104,7 @@ __decorate([
98
104
  title: 'Supported Actions',
99
105
  description: 'Actions supported by this integration.',
100
106
  type: 'array',
101
- items: { type: 'string', enum: Object.values(item_actions_enum_1.ProductItemActionsEnum) }
107
+ items: { type: 'string', enum: Object.values(item_actions_enum_1.ProductItemActionsEnum) },
102
108
  }),
103
109
  __metadata("design:type", Array)
104
110
  ], ProductInfoDto.prototype, "supportedActions", void 0);
@@ -1,5 +1,5 @@
1
- import { ProductItemActionsEnum } from "../../enums/item-actions.enum";
2
- import { ItemDataDto } from "../item-data.dto";
1
+ import { ProductItemActionsEnum } from '../../enums/item-actions.enum';
2
+ import { ItemDataDto } from '../item-data.dto';
3
3
  /**
4
4
  * Product item data sent to product integrations.
5
5
  * Uses product-specific actions distinct from invoice integration actions.
@@ -29,7 +29,7 @@ __decorate([
29
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
30
  (0, class_validator_jsonschema_1.JSONSchema)({
31
31
  title: 'Client Data',
32
- description: 'The client\'s data for the request.',
32
+ description: "The client's data for the request.",
33
33
  $ref: '#/components/schemas/ClientDataDto',
34
34
  }),
35
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
@@ -29,8 +29,8 @@ __decorate([
29
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
30
  (0, class_validator_jsonschema_1.JSONSchema)({
31
31
  title: 'Client Data',
32
- description: 'The client\'s data initiating the request.',
33
- type: 'object',
32
+ description: "The client's data initiating the request.",
33
+ $ref: '#/components/schemas/ClientDataDto',
34
34
  }),
35
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
36
36
  ], ProductDeleteRequestDto.prototype, "clientData", void 0);
@@ -42,7 +42,7 @@ __decorate([
42
42
  (0, class_validator_jsonschema_1.JSONSchema)({
43
43
  title: 'Item Data',
44
44
  description: 'The data of the product item to be deleted.',
45
- type: 'object',
45
+ $ref: '#/components/schemas/ProductItemDataDto',
46
46
  }),
47
47
  __metadata("design:type", product_item_data_dto_1.ProductItemDataDto)
48
48
  ], ProductDeleteRequestDto.prototype, "itemData", void 0);
@@ -29,7 +29,7 @@ __decorate([
29
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
30
  (0, class_validator_jsonschema_1.JSONSchema)({
31
31
  title: 'Client Data',
32
- description: 'The client\'s data for the request.',
32
+ description: "The client's data for the request.",
33
33
  $ref: '#/components/schemas/ClientDataDto',
34
34
  }),
35
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
@@ -29,7 +29,7 @@ __decorate([
29
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
30
  (0, class_validator_jsonschema_1.JSONSchema)({
31
31
  title: 'Client Data',
32
- description: 'The client\'s data for the request.',
32
+ description: "The client's data for the request.",
33
33
  $ref: '#/components/schemas/ClientDataDto',
34
34
  }),
35
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
@@ -29,7 +29,7 @@ __decorate([
29
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
30
  (0, class_validator_jsonschema_1.JSONSchema)({
31
31
  title: 'Client Data',
32
- description: 'The client\'s data for the request.',
32
+ description: "The client's data for the request.",
33
33
  $ref: '#/components/schemas/ClientDataDto',
34
34
  }),
35
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
@@ -29,7 +29,7 @@ __decorate([
29
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
30
  (0, class_validator_jsonschema_1.JSONSchema)({
31
31
  title: 'Client Data',
32
- description: 'The client\'s data for the request.',
32
+ description: "The client's data for the request.",
33
33
  $ref: '#/components/schemas/ClientDataDto',
34
34
  }),
35
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
@@ -29,7 +29,7 @@ __decorate([
29
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
30
  (0, class_validator_jsonschema_1.JSONSchema)({
31
31
  title: 'Client Data',
32
- description: 'The client\'s data for the request.',
32
+ description: "The client's data for the request.",
33
33
  $ref: '#/components/schemas/ClientDataDto',
34
34
  }),
35
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
@@ -29,7 +29,7 @@ __decorate([
29
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
30
  (0, class_validator_jsonschema_1.JSONSchema)({
31
31
  title: 'Client Data',
32
- description: 'The client\'s data for the request.',
32
+ description: "The client's data for the request.",
33
33
  $ref: '#/components/schemas/ClientDataDto',
34
34
  }),
35
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
@@ -29,7 +29,7 @@ __decorate([
29
29
  (0, class_transformer_1.Type)(() => client_data_dto_1.ClientDataDto),
30
30
  (0, class_validator_jsonschema_1.JSONSchema)({
31
31
  title: 'Client Data',
32
- description: 'The client\'s data for the request.',
32
+ description: "The client's data for the request.",
33
33
  $ref: '#/components/schemas/ClientDataDto',
34
34
  }),
35
35
  __metadata("design:type", client_data_dto_1.ClientDataDto)
@@ -28,7 +28,7 @@ __decorate([
28
28
  (0, class_validator_jsonschema_1.JSONSchema)({
29
29
  title: 'Info',
30
30
  description: 'The detailed information of the product.',
31
- type: 'object',
31
+ $ref: '#/components/schemas/ProductInfoDto',
32
32
  }),
33
33
  __metadata("design:type", product_info_dto_1.ProductInfoDto)
34
34
  ], ProductInfoResponseDto.prototype, "info", void 0);
@@ -1,5 +1,5 @@
1
- import { BaseResponse } from "../base-response.dto";
2
- import { FieldDto } from "../field.dto";
1
+ import { BaseResponse } from '../base-response.dto';
2
+ import { FieldDto } from '../field.dto';
3
3
  /**
4
4
  * Represents the response from validating product attributes.
5
5
  * Contains the list of attributes that have been validated.
@@ -25,7 +25,7 @@ __decorate([
25
25
  (0, class_validator_jsonschema_1.JSONSchema)({
26
26
  title: 'Label',
27
27
  description: 'Text label for the tab.',
28
- type: 'string'
28
+ type: 'string',
29
29
  }),
30
30
  __metadata("design:type", String)
31
31
  ], TabDto.prototype, "label", void 0);
@@ -36,7 +36,7 @@ __decorate([
36
36
  title: 'URL',
37
37
  description: 'URL associated with the tab.',
38
38
  type: 'string',
39
- format: 'uri'
39
+ format: 'uri',
40
40
  }),
41
41
  __metadata("design:type", String)
42
42
  ], TabDto.prototype, "url", void 0);
@@ -0,0 +1,31 @@
1
+ import { CountryEnum } from '../../enums/country.enum';
2
+ /**
3
+ * Request payload for calculating tax details.
4
+ * Contains company and customer location information for tax rate determination.
5
+ */
6
+ export declare class TaxDetailsRequestDto {
7
+ /**
8
+ * Country where the company is registered
9
+ */
10
+ companyCountry: CountryEnum;
11
+ /**
12
+ * Country where the customer is located
13
+ */
14
+ customerCountry: CountryEnum;
15
+ /**
16
+ * Customer's Tax Identification Number
17
+ */
18
+ customerTIN: string;
19
+ /**
20
+ * Customer's postal code
21
+ */
22
+ customerPostalCode?: string;
23
+ /**
24
+ * Customer's state or province
25
+ */
26
+ customerState?: string;
27
+ /**
28
+ * Indicates whether the customer address has been validated
29
+ */
30
+ validatedAddress?: boolean;
31
+ }
@@ -0,0 +1,84 @@
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.TaxDetailsRequestDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const country_enum_1 = require("../../enums/country.enum");
15
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
16
+ /**
17
+ * Request payload for calculating tax details.
18
+ * Contains company and customer location information for tax rate determination.
19
+ */
20
+ class TaxDetailsRequestDto {
21
+ }
22
+ exports.TaxDetailsRequestDto = TaxDetailsRequestDto;
23
+ __decorate([
24
+ (0, class_validator_1.IsDefined)(),
25
+ (0, class_validator_1.IsEnum)(country_enum_1.CountryEnum),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'Company Country',
28
+ description: 'Country where the company is registered.',
29
+ type: 'string',
30
+ enum: Object.values(country_enum_1.CountryEnum),
31
+ }),
32
+ __metadata("design:type", String)
33
+ ], TaxDetailsRequestDto.prototype, "companyCountry", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsDefined)(),
36
+ (0, class_validator_1.IsEnum)(country_enum_1.CountryEnum),
37
+ (0, class_validator_jsonschema_1.JSONSchema)({
38
+ title: 'Customer Country',
39
+ description: 'Country where the customer is located.',
40
+ type: 'string',
41
+ enum: Object.values(country_enum_1.CountryEnum),
42
+ }),
43
+ __metadata("design:type", String)
44
+ ], TaxDetailsRequestDto.prototype, "customerCountry", void 0);
45
+ __decorate([
46
+ (0, class_validator_1.IsDefined)(),
47
+ (0, class_validator_1.IsString)(),
48
+ (0, class_validator_jsonschema_1.JSONSchema)({
49
+ title: 'Customer TIN',
50
+ description: "Customer's Tax Identification Number.",
51
+ type: 'string',
52
+ }),
53
+ __metadata("design:type", String)
54
+ ], TaxDetailsRequestDto.prototype, "customerTIN", void 0);
55
+ __decorate([
56
+ (0, class_validator_1.IsOptional)(),
57
+ (0, class_validator_1.IsString)(),
58
+ (0, class_validator_jsonschema_1.JSONSchema)({
59
+ title: 'Customer Postal Code',
60
+ description: "Customer's postal code.",
61
+ type: 'string',
62
+ }),
63
+ __metadata("design:type", String)
64
+ ], TaxDetailsRequestDto.prototype, "customerPostalCode", void 0);
65
+ __decorate([
66
+ (0, class_validator_1.IsOptional)(),
67
+ (0, class_validator_1.IsString)(),
68
+ (0, class_validator_jsonschema_1.JSONSchema)({
69
+ title: 'Customer State',
70
+ description: "Customer's state or province.",
71
+ type: 'string',
72
+ }),
73
+ __metadata("design:type", String)
74
+ ], TaxDetailsRequestDto.prototype, "customerState", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.IsOptional)(),
77
+ (0, class_validator_1.IsBoolean)(),
78
+ (0, class_validator_jsonschema_1.JSONSchema)({
79
+ title: 'Validated Address',
80
+ description: 'Whether the customer address has been validated.',
81
+ type: 'boolean',
82
+ }),
83
+ __metadata("design:type", Boolean)
84
+ ], TaxDetailsRequestDto.prototype, "validatedAddress", void 0);
@@ -27,7 +27,7 @@ __decorate([
27
27
  title: 'Unit ID',
28
28
  description: 'Unit identifier.',
29
29
  type: 'string',
30
- example: 'messages'
30
+ example: 'messages',
31
31
  }),
32
32
  __metadata("design:type", String)
33
33
  ], UnitDto.prototype, "id", void 0);
@@ -39,7 +39,7 @@ __decorate([
39
39
  title: 'Unit Description',
40
40
  description: 'What is measured.',
41
41
  type: 'string',
42
- example: 'Message sent'
42
+ example: 'Message sent',
43
43
  }),
44
44
  __metadata("design:type", String)
45
45
  ], UnitDto.prototype, "unitDescription", void 0);
@@ -51,7 +51,7 @@ __decorate([
51
51
  title: 'Interval Description',
52
52
  description: 'Billing interval.',
53
53
  type: 'string',
54
- example: 'Per month'
54
+ example: 'Per month',
55
55
  }),
56
56
  __metadata("design:type", String)
57
57
  ], UnitDto.prototype, "intervalDescription", void 0);
@@ -1,4 +1,4 @@
1
- import { CountryDto } from "../dtos/country.dto";
1
+ import { CountryDto } from '../dtos/country.dto';
2
2
  export declare enum CountryEnum {
3
3
  AFGHANISTAN = "AF",
4
4
  ALAND_ISLANDS = "AX",