@hosterai/types 0.0.27 → 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.
- package/README.md +5 -1
- package/dist/decorators/all-or-none-validator.spec.js +9 -3
- package/dist/decorators/at-least-one-non-empty-validator.spec.js +1 -1
- package/dist/decorators/at-least-one-non-empty.validator.js +2 -2
- package/dist/decorators/is-of-allowed-types-validator.spec.js +10 -8
- package/dist/decorators/is-of-allowed-types.validator.js +4 -2
- package/dist/decorators/is-one-of.validator.d.ts +2 -2
- package/dist/decorators/is-one-of.validator.js +1 -1
- package/dist/decorators/is-plain-object.validator.d.ts +1 -1
- package/dist/decorators/is-plain-object.validator.js +3 -1
- package/dist/decorators/is-property-forbidden-validator.spec.js +12 -4
- package/dist/decorators/is-property-forbidden.validator.d.ts +1 -1
- package/dist/decorators/is-regex.validator.d.ts +1 -1
- package/dist/decorators/min-less-or-equal-validator.spec.js +6 -2
- package/dist/dtos/action.dto.js +5 -5
- package/dist/dtos/addon-field.dto.d.ts +1 -1
- package/dist/dtos/admin-panel.dto.js +16 -18
- package/dist/dtos/attribute-field.dto.d.ts +1 -1
- package/dist/dtos/client-panel.dto.d.ts +3 -3
- package/dist/dtos/client-panel.dto.js +11 -10
- package/dist/dtos/company-data.dto.d.ts +4 -0
- package/dist/dtos/company-data.dto.js +19 -8
- package/dist/dtos/error-response.dto.js +1 -4
- package/dist/dtos/field-option.dto.js +3 -3
- package/dist/dtos/info.dto.js +10 -10
- package/dist/dtos/invoice/invoice-info.dto.d.ts +3 -3
- package/dist/dtos/invoice/invoice-info.dto.js +1 -1
- package/dist/dtos/invoice/invoice-item-data.dto.d.ts +2 -2
- package/dist/dtos/invoice/requests/base-invoice-request.dto.d.ts +30 -0
- package/dist/dtos/invoice/requests/base-invoice-request.dto.js +108 -0
- package/dist/dtos/invoice/requests/credit-note-request.dto.d.ts +2 -2
- package/dist/dtos/invoice/requests/credit-note-request.dto.js +2 -2
- package/dist/dtos/invoice/requests/invoice-request.dto.d.ts +2 -2
- package/dist/dtos/invoice/requests/invoice-request.dto.js +2 -2
- package/dist/dtos/invoice/requests/proforma-invoice-request.dto.d.ts +2 -19
- package/dist/dtos/invoice/requests/proforma-invoice-request.dto.js +2 -95
- package/dist/dtos/invoice/responses/credit-note-response.dto.d.ts +1 -1
- package/dist/dtos/invoice/responses/invoice-response.dto.d.ts +1 -1
- package/dist/dtos/invoice/responses/tax-details-response.dto.js +1 -1
- package/dist/dtos/invoice-contact-data.dto.d.ts +2 -2
- package/dist/dtos/invoice-contact-data.dto.js +5 -5
- package/dist/dtos/menu.dto.js +8 -4
- package/dist/dtos/notification/responses/notification-send-response.dto.d.ts +1 -1
- package/dist/dtos/notification/sender/sender-sms.dto.js +1 -1
- package/dist/dtos/product/product-info.dto.js +11 -5
- package/dist/dtos/product/product-item-data.dto.d.ts +2 -2
- package/dist/dtos/product/requests/product-create-request.dto.js +1 -1
- package/dist/dtos/product/requests/product-delete-request.dto.js +3 -3
- package/dist/dtos/product/requests/product-downgradable-request.dto.js +1 -1
- package/dist/dtos/product/requests/product-downgrade-request.dto.js +1 -1
- 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.js +1 -1
- package/dist/dtos/product/requests/product-suspend-request.dto.js +1 -1
- package/dist/dtos/product/requests/product-unsuspend-request.dto.js +1 -1
- package/dist/dtos/product/requests/product-upgradable-request.dto.js +1 -1
- package/dist/dtos/product/requests/product-upgrade-request.dto.js +1 -1
- 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/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.js +1 -1
- 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/responses/validate-attributes-response.dto.d.ts +2 -2
- package/dist/dtos/tab.dto.js +2 -2
- package/dist/dtos/tax-manager/tax-details-request.dto.d.ts +31 -0
- package/dist/dtos/tax-manager/tax-details-request.dto.js +84 -0
- package/dist/dtos/unit.dto.js +3 -3
- package/dist/enums/country.enum.d.ts +1 -1
- package/dist/enums/country.enum.js +312 -78
- package/dist/enums/currency.enum.d.ts +43 -0
- package/dist/enums/currency.enum.js +47 -0
- package/dist/enums/events.enum.d.ts +3 -0
- package/dist/enums/events.enum.js +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/openapi/schemas/components.schemas.d.ts +3 -33
- package/dist/openapi/schemas/components.schemas.js +19 -40
- package/dist/validators/action-validator.spec.js +3 -3
- package/dist/validators/addon-field-validator.spec.js +10 -3
- package/dist/validators/admin-panel-more-actions-validator.spec.js +12 -8
- package/dist/validators/admin-panel-more-actions.validator.d.ts +1 -1
- package/dist/validators/admin-panel-tabs-validator.spec.js +74 -10
- package/dist/validators/admin-panel-tabs.validator.d.ts +1 -1
- package/dist/validators/admin-panel-validator.spec.js +164 -32
- package/dist/validators/attachment-validator.spec.js +8 -8
- package/dist/validators/attribute-field-validator.spec.js +18 -7
- package/dist/validators/client-panel-validator.spec.js +57 -9
- package/dist/validators/country-validator.spec.js +7 -7
- package/dist/validators/field-validator.spec.js +35 -10
- package/dist/validators/info-validator.spec.js +10 -10
- package/dist/validators/invoice-contact-data-validator.spec.js +18 -10
- package/dist/validators/invoice-info-validator.spec.js +14 -10
- package/dist/validators/invoice-item-data-validator.spec.js +4 -4
- package/dist/validators/item-data-validator.spec.js +17 -9
- package/dist/validators/menu-with-submenu-validator.spec.js +13 -11
- package/dist/validators/menu-with-url-validator.spec.js +15 -5
- package/dist/validators/notification-info-validator.spec.js +23 -15
- 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-info-validator.spec.js +46 -32
- package/dist/validators/product-info.validator.d.ts +1 -1
- package/dist/validators/product-item-data-validator.spec.js +12 -4
- package/dist/validators/product-upgradeable-request-validator.d.ts +8 -0
- package/dist/validators/product-upgradeable-request-validator.js +17 -0
- package/dist/validators/sender-sms-validator.spec.js +5 -2
- package/dist/validators/settings-with-tabs-validator.spec.js +176 -12
- package/dist/validators/settings-with-url-validator.spec.js +89 -11
- package/dist/validators/tab-validator.spec.js +7 -7
- package/dist/validators/tin-validation-details-validator.spec.js +8 -8
- package/dist/validators/transaction-data-validator.spec.js +13 -8
- package/dist/validators/unit-validator.spec.js +13 -4
- package/package.json +1 -1
- package/dist/dtos/info/info-notification.dto.d.ts +0 -5
- package/dist/dtos/info/info-notification.dto.js +0 -7
- package/dist/dtos/info/info.dto.d.ts +0 -196
- package/dist/dtos/info/info.dto.js +0 -278
- package/dist/dtos/notification/notification-request.dto.d.ts +0 -20
- package/dist/dtos/notification/notification-request.dto.js +0 -31
- package/dist/dtos/receiver/receiver-email.dto.d.ts +0 -20
- package/dist/dtos/receiver/receiver-email.dto.js +0 -39
- package/dist/dtos/receiver/receiver-push.dto.d.ts +0 -15
- package/dist/dtos/receiver/receiver-push.dto.js +0 -31
- package/dist/dtos/receiver/receiver-sms.dto.d.ts +0 -11
- package/dist/dtos/receiver/receiver-sms.dto.js +0 -26
- package/dist/dtos/request.dto.d.ts +0 -20
- package/dist/dtos/request.dto.js +0 -31
- package/dist/dtos/sender/sender-email.dto.d.ts +0 -25
- package/dist/dtos/sender/sender-email.dto.js +0 -46
- package/dist/dtos/sender/sender-push.dto.d.ts +0 -31
- package/dist/dtos/sender/sender-push.dto.js +0 -50
- package/dist/dtos/sender/sender-sms.dto.d.ts +0 -15
- package/dist/dtos/sender/sender-sms.dto.js +0 -30
- package/dist/enums/message-type.enum.d.ts +0 -5
- package/dist/enums/message-type.enum.js +0 -9
|
@@ -32,7 +32,7 @@ __decorate([
|
|
|
32
32
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
33
33
|
title: 'Key',
|
|
34
34
|
description: 'Internal key for the option.',
|
|
35
|
-
type: 'string'
|
|
35
|
+
type: 'string',
|
|
36
36
|
}),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
38
|
], FieldOptionDto.prototype, "key", void 0);
|
|
@@ -42,7 +42,7 @@ __decorate([
|
|
|
42
42
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
43
43
|
title: 'Value',
|
|
44
44
|
description: 'Display value for the option.',
|
|
45
|
-
type: 'string'
|
|
45
|
+
type: 'string',
|
|
46
46
|
}),
|
|
47
47
|
__metadata("design:type", String)
|
|
48
48
|
], FieldOptionDto.prototype, "value", void 0);
|
|
@@ -52,7 +52,7 @@ __decorate([
|
|
|
52
52
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
53
53
|
title: 'Disabled',
|
|
54
54
|
description: 'Whether the option is disabled.',
|
|
55
|
-
type: 'boolean'
|
|
55
|
+
type: 'boolean',
|
|
56
56
|
}),
|
|
57
57
|
__metadata("design:type", Boolean)
|
|
58
58
|
], FieldOptionDto.prototype, "disabled", void 0);
|
package/dist/dtos/info.dto.js
CHANGED
|
@@ -39,7 +39,7 @@ __decorate([
|
|
|
39
39
|
title: 'Title',
|
|
40
40
|
description: 'Integration display title.',
|
|
41
41
|
type: 'string',
|
|
42
|
-
example: 'Example Product'
|
|
42
|
+
example: 'Example Product',
|
|
43
43
|
}),
|
|
44
44
|
__metadata("design:type", String)
|
|
45
45
|
], InfoDto.prototype, "title", void 0);
|
|
@@ -51,7 +51,7 @@ __decorate([
|
|
|
51
51
|
description: 'Public HTTPS URL for the integration logo.',
|
|
52
52
|
type: 'string',
|
|
53
53
|
format: 'uri',
|
|
54
|
-
example: 'https://cdn.example.com/logo.png'
|
|
54
|
+
example: 'https://cdn.example.com/logo.png',
|
|
55
55
|
}),
|
|
56
56
|
__metadata("design:type", String)
|
|
57
57
|
], InfoDto.prototype, "logo", void 0);
|
|
@@ -62,7 +62,7 @@ __decorate([
|
|
|
62
62
|
title: 'Description',
|
|
63
63
|
description: 'Short description of the integration.',
|
|
64
64
|
type: 'string',
|
|
65
|
-
example: 'An example product integration.'
|
|
65
|
+
example: 'An example product integration.',
|
|
66
66
|
}),
|
|
67
67
|
__metadata("design:type", String)
|
|
68
68
|
], InfoDto.prototype, "description", void 0);
|
|
@@ -76,7 +76,7 @@ __decorate([
|
|
|
76
76
|
description: 'Locales supported by the integration.',
|
|
77
77
|
type: 'array',
|
|
78
78
|
items: { type: 'string', enum: Object.values(language_enum_1.LanguageEnum) },
|
|
79
|
-
example: ['EN']
|
|
79
|
+
example: ['EN'],
|
|
80
80
|
}),
|
|
81
81
|
__metadata("design:type", Array)
|
|
82
82
|
], InfoDto.prototype, "supportedLanguages", void 0);
|
|
@@ -89,7 +89,7 @@ __decorate([
|
|
|
89
89
|
title: 'Listen Events',
|
|
90
90
|
description: 'Platform events the integration can subscribe to.',
|
|
91
91
|
type: 'array',
|
|
92
|
-
items: { type: 'string', enum: Object.values(events_enum_1.EventsEnum) }
|
|
92
|
+
items: { type: 'string', enum: Object.values(events_enum_1.EventsEnum) },
|
|
93
93
|
}),
|
|
94
94
|
__metadata("design:type", Array)
|
|
95
95
|
], InfoDto.prototype, "listenEvents", void 0);
|
|
@@ -102,7 +102,7 @@ __decorate([
|
|
|
102
102
|
title: 'Required Roles',
|
|
103
103
|
description: 'Roles required for this integration to operate.',
|
|
104
104
|
type: 'array',
|
|
105
|
-
items: { type: 'string', enum: Object.values(roles_enum_1.RolesEnum) }
|
|
105
|
+
items: { type: 'string', enum: Object.values(roles_enum_1.RolesEnum) },
|
|
106
106
|
}),
|
|
107
107
|
__metadata("design:type", Array)
|
|
108
108
|
], InfoDto.prototype, "requiredRoles", void 0);
|
|
@@ -113,7 +113,7 @@ __decorate([
|
|
|
113
113
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
114
114
|
title: 'Admin Panel',
|
|
115
115
|
description: 'Admin UI links, tabs, and actions provided by the integration.',
|
|
116
|
-
|
|
116
|
+
$ref: '#/components/schemas/AdminPanelDto',
|
|
117
117
|
}),
|
|
118
118
|
__metadata("design:type", admin_panel_dto_1.AdminPanelDto)
|
|
119
119
|
], InfoDto.prototype, "adminPanel", void 0);
|
|
@@ -124,7 +124,7 @@ __decorate([
|
|
|
124
124
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
125
125
|
title: 'Client Panel',
|
|
126
126
|
description: 'Client UI links, tabs, and actions provided by the integration.',
|
|
127
|
-
|
|
127
|
+
$ref: '#/components/schemas/ClientPanelDto',
|
|
128
128
|
}),
|
|
129
129
|
__metadata("design:type", client_panel_dto_1.ClientPanelDto)
|
|
130
130
|
], InfoDto.prototype, "clientPanel", void 0);
|
|
@@ -136,7 +136,7 @@ __decorate([
|
|
|
136
136
|
description: 'URL to onboard/configure the integration.',
|
|
137
137
|
type: 'string',
|
|
138
138
|
format: 'uri',
|
|
139
|
-
example: 'https://example.com/onboarding'
|
|
139
|
+
example: 'https://example.com/onboarding',
|
|
140
140
|
}),
|
|
141
141
|
__metadata("design:type", String)
|
|
142
142
|
], InfoDto.prototype, "onboardingUrl", void 0);
|
|
@@ -151,7 +151,7 @@ __decorate([
|
|
|
151
151
|
title: 'Setup Attributes',
|
|
152
152
|
description: 'Configurable attributes that are used in the setup process.',
|
|
153
153
|
type: 'array',
|
|
154
|
-
items: { $ref: '#/components/schemas/FieldDto' }
|
|
154
|
+
items: { $ref: '#/components/schemas/FieldDto' },
|
|
155
155
|
}),
|
|
156
156
|
__metadata("design:type", Array)
|
|
157
157
|
], InfoDto.prototype, "setupAttributes", void 0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CountryEnum } from
|
|
2
|
-
import { InfoDto } from
|
|
3
|
-
import { InvoiceTypesEnum } from
|
|
1
|
+
import { CountryEnum } from '../../enums/country.enum';
|
|
2
|
+
import { InfoDto } from '../info.dto';
|
|
3
|
+
import { InvoiceTypesEnum } from '../../enums/invoice/invoice-types.enum';
|
|
4
4
|
/**
|
|
5
5
|
* Invoice integration information.
|
|
6
6
|
* Extends base integration info with invoice-specific configuration.
|
|
@@ -36,7 +36,7 @@ __decorate([
|
|
|
36
36
|
title: 'Supported Types',
|
|
37
37
|
description: 'Types of invoice supported by this integration.',
|
|
38
38
|
type: 'array',
|
|
39
|
-
items: { type: 'string', enum: Object.values(invoice_types_enum_1.InvoiceTypesEnum) }
|
|
39
|
+
items: { type: 'string', enum: Object.values(invoice_types_enum_1.InvoiceTypesEnum) },
|
|
40
40
|
}),
|
|
41
41
|
__metadata("design:type", Array)
|
|
42
42
|
], InvoiceInfoDto.prototype, "supportedTypes", void 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InvoiceItemActionsEnum } from
|
|
2
|
-
import { ItemDataDto } from
|
|
1
|
+
import { InvoiceItemActionsEnum } from '../../enums/invoice/invoice-item-actions.enum';
|
|
2
|
+
import { ItemDataDto } from '../item-data.dto';
|
|
3
3
|
/**
|
|
4
4
|
* Order product item data sent to invoice integrations.
|
|
5
5
|
* Uses invoice-specific actions to avoid confusion with product integration actions.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CompanyDataDto } from '../../company-data.dto';
|
|
2
|
+
import { InvoiceItemDataDto } from '../invoice-item-data.dto';
|
|
3
|
+
import { TransactionData } from '../transaction-data.dto';
|
|
4
|
+
import { InvoiceContactData } from '../../invoice-contact-data.dto';
|
|
5
|
+
import { CurrencyEnum } from '../../../enums/currency.enum';
|
|
6
|
+
/**
|
|
7
|
+
* Request payload for calculating tax details.
|
|
8
|
+
* Contains company and customer location information for tax rate determination.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class BaseInvoiceRequestDto {
|
|
11
|
+
/**
|
|
12
|
+
* Company data
|
|
13
|
+
*/
|
|
14
|
+
company: CompanyDataDto;
|
|
15
|
+
/**
|
|
16
|
+
* Invoice contact data (without invoiceContactId)
|
|
17
|
+
*/
|
|
18
|
+
invoiceContact: Omit<InvoiceContactData, 'invoiceContactId'>;
|
|
19
|
+
currency: CurrencyEnum;
|
|
20
|
+
/** Line items included in the invoice */
|
|
21
|
+
items: InvoiceItemDataDto[];
|
|
22
|
+
/** List of transactions associated with this invoice */
|
|
23
|
+
transactions: TransactionData[];
|
|
24
|
+
/** Total invoice amount */
|
|
25
|
+
totalAmount: number;
|
|
26
|
+
/**
|
|
27
|
+
* Discount amount
|
|
28
|
+
*/
|
|
29
|
+
discountAmount: number;
|
|
30
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
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.BaseInvoiceRequestDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
16
|
+
const company_data_dto_1 = require("../../company-data.dto");
|
|
17
|
+
const invoice_item_data_dto_1 = require("../invoice-item-data.dto");
|
|
18
|
+
const transaction_data_dto_1 = require("../transaction-data.dto");
|
|
19
|
+
const invoice_contact_data_dto_1 = require("../../invoice-contact-data.dto");
|
|
20
|
+
const currency_enum_1 = require("../../../enums/currency.enum");
|
|
21
|
+
/**
|
|
22
|
+
* Request payload for calculating tax details.
|
|
23
|
+
* Contains company and customer location information for tax rate determination.
|
|
24
|
+
*/
|
|
25
|
+
class BaseInvoiceRequestDto {
|
|
26
|
+
}
|
|
27
|
+
exports.BaseInvoiceRequestDto = BaseInvoiceRequestDto;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsDefined)(),
|
|
30
|
+
(0, class_validator_1.IsObject)(),
|
|
31
|
+
(0, class_validator_1.ValidateNested)(),
|
|
32
|
+
(0, class_transformer_1.Type)(() => company_data_dto_1.CompanyDataDto),
|
|
33
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
34
|
+
title: 'Company',
|
|
35
|
+
description: 'Company data.',
|
|
36
|
+
$ref: '#/components/schemas/CompanyDataDto',
|
|
37
|
+
}),
|
|
38
|
+
__metadata("design:type", company_data_dto_1.CompanyDataDto)
|
|
39
|
+
], BaseInvoiceRequestDto.prototype, "company", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsDefined)(),
|
|
42
|
+
(0, class_validator_1.IsObject)(),
|
|
43
|
+
(0, class_validator_1.ValidateNested)(),
|
|
44
|
+
(0, class_transformer_1.Type)(() => invoice_contact_data_dto_1.InvoiceContactData),
|
|
45
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
46
|
+
title: 'Invoice Contact',
|
|
47
|
+
description: 'Invoice contact data (without invoiceContactId).',
|
|
48
|
+
$ref: '#/components/schemas/InvoiceContactData',
|
|
49
|
+
}),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], BaseInvoiceRequestDto.prototype, "invoiceContact", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_validator_1.IsDefined)(),
|
|
54
|
+
(0, class_validator_1.IsEnum)(currency_enum_1.CurrencyEnum),
|
|
55
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
56
|
+
title: 'Currency',
|
|
57
|
+
description: 'Currency of the invoice.',
|
|
58
|
+
type: 'string',
|
|
59
|
+
enum: Object.values(currency_enum_1.CurrencyEnum),
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], BaseInvoiceRequestDto.prototype, "currency", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsDefined)(),
|
|
65
|
+
(0, class_validator_1.IsArray)(),
|
|
66
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
67
|
+
(0, class_transformer_1.Type)(() => invoice_item_data_dto_1.InvoiceItemDataDto),
|
|
68
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
69
|
+
title: 'Items',
|
|
70
|
+
description: 'Line items included in the invoice.',
|
|
71
|
+
type: 'array',
|
|
72
|
+
items: { $ref: '#/components/schemas/InvoiceItemDataDto' },
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:type", Array)
|
|
75
|
+
], BaseInvoiceRequestDto.prototype, "items", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, class_validator_1.IsDefined)(),
|
|
78
|
+
(0, class_validator_1.IsArray)(),
|
|
79
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
80
|
+
(0, class_transformer_1.Type)(() => transaction_data_dto_1.TransactionData),
|
|
81
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
82
|
+
title: 'Transactions',
|
|
83
|
+
description: 'List of transactions associated with this invoice.',
|
|
84
|
+
type: 'array',
|
|
85
|
+
items: { $ref: '#/components/schemas/TransactionData' },
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Array)
|
|
88
|
+
], BaseInvoiceRequestDto.prototype, "transactions", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, class_validator_1.IsDefined)(),
|
|
91
|
+
(0, class_validator_1.IsNumber)(),
|
|
92
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
93
|
+
title: 'Total Amount',
|
|
94
|
+
description: 'Total invoice amount.',
|
|
95
|
+
type: 'number',
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", Number)
|
|
98
|
+
], BaseInvoiceRequestDto.prototype, "totalAmount", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, class_validator_1.IsDefined)(),
|
|
101
|
+
(0, class_validator_1.IsNumber)(),
|
|
102
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
103
|
+
title: 'Discount Amount',
|
|
104
|
+
description: 'Discount amount.',
|
|
105
|
+
type: 'number',
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:type", Number)
|
|
108
|
+
], BaseInvoiceRequestDto.prototype, "discountAmount", void 0);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseInvoiceRequestDto } from './base-invoice-request.dto';
|
|
2
2
|
/**
|
|
3
3
|
* Request payload for creating a credit note.
|
|
4
4
|
* Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
|
|
5
5
|
*/
|
|
6
|
-
export declare class CreditNoteRequestDto extends
|
|
6
|
+
export declare class CreditNoteRequestDto extends BaseInvoiceRequestDto {
|
|
7
7
|
/** Reference to the parent invoice being credited */
|
|
8
8
|
parentInvoiceId: string;
|
|
9
9
|
}
|
|
@@ -12,12 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CreditNoteRequestDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
15
|
-
const
|
|
15
|
+
const base_invoice_request_dto_1 = require("./base-invoice-request.dto");
|
|
16
16
|
/**
|
|
17
17
|
* Request payload for creating a credit note.
|
|
18
18
|
* Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
|
|
19
19
|
*/
|
|
20
|
-
class CreditNoteRequestDto extends
|
|
20
|
+
class CreditNoteRequestDto extends base_invoice_request_dto_1.BaseInvoiceRequestDto {
|
|
21
21
|
}
|
|
22
22
|
exports.CreditNoteRequestDto = CreditNoteRequestDto;
|
|
23
23
|
__decorate([
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseInvoiceRequestDto } from './base-invoice-request.dto';
|
|
2
2
|
/**
|
|
3
3
|
* Request payload for creating a standard invoice.
|
|
4
4
|
* Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
|
|
5
5
|
*/
|
|
6
|
-
export declare class InvoiceRequestDto extends
|
|
6
|
+
export declare class InvoiceRequestDto extends BaseInvoiceRequestDto {
|
|
7
7
|
/** Reference to parent invoice if applicable */
|
|
8
8
|
parentInvoiceId?: string;
|
|
9
9
|
}
|
|
@@ -12,12 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.InvoiceRequestDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
15
|
-
const
|
|
15
|
+
const base_invoice_request_dto_1 = require("./base-invoice-request.dto");
|
|
16
16
|
/**
|
|
17
17
|
* Request payload for creating a standard invoice.
|
|
18
18
|
* Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
|
|
19
19
|
*/
|
|
20
|
-
class InvoiceRequestDto extends
|
|
20
|
+
class InvoiceRequestDto extends base_invoice_request_dto_1.BaseInvoiceRequestDto {
|
|
21
21
|
}
|
|
22
22
|
exports.InvoiceRequestDto = InvoiceRequestDto;
|
|
23
23
|
__decorate([
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { InvoiceItemDataDto } from "../invoice-item-data.dto";
|
|
3
|
-
import { TransactionData } from "../transaction-data.dto";
|
|
4
|
-
import { CountryEnum } from '../../../enums/country.enum';
|
|
1
|
+
import { BaseInvoiceRequestDto } from './base-invoice-request.dto';
|
|
5
2
|
/**
|
|
6
3
|
* Request payload for creating a proforma invoice.
|
|
7
4
|
* Sent from hoster.ai to invoice integrations to issue a proforma document.
|
|
8
5
|
*/
|
|
9
|
-
export declare class ProformaInvoiceRequestDto {
|
|
10
|
-
/** Unique identifier for the invoice */
|
|
11
|
-
invoiceId: string;
|
|
12
|
-
/** Company identifier issuing the invoice */
|
|
13
|
-
companyId: string;
|
|
14
|
-
/** Country where the company is registered */
|
|
15
|
-
companyCountry: CountryEnum;
|
|
16
|
-
/** List of transactions associated with this invoice */
|
|
17
|
-
transactions: TransactionData[];
|
|
18
|
-
/** Billing contact information for the invoice recipient */
|
|
19
|
-
invoiceContact: InvoiceContactData;
|
|
20
|
-
/** Line items included in the invoice */
|
|
21
|
-
items: InvoiceItemDataDto[];
|
|
22
|
-
/** Total invoice amount */
|
|
23
|
-
totalAmount: number;
|
|
6
|
+
export declare class ProformaInvoiceRequestDto extends BaseInvoiceRequestDto {
|
|
24
7
|
}
|
|
@@ -1,104 +1,11 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.ProformaInvoiceRequestDto = void 0;
|
|
13
|
-
const
|
|
14
|
-
const class_validator_1 = require("class-validator");
|
|
15
|
-
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
16
|
-
const invoice_contact_data_dto_1 = require("../../invoice-contact-data.dto");
|
|
17
|
-
const invoice_item_data_dto_1 = require("../invoice-item-data.dto");
|
|
18
|
-
const transaction_data_dto_1 = require("../transaction-data.dto");
|
|
19
|
-
const country_enum_1 = require("../../../enums/country.enum");
|
|
4
|
+
const base_invoice_request_dto_1 = require("./base-invoice-request.dto");
|
|
20
5
|
/**
|
|
21
6
|
* Request payload for creating a proforma invoice.
|
|
22
7
|
* Sent from hoster.ai to invoice integrations to issue a proforma document.
|
|
23
8
|
*/
|
|
24
|
-
class ProformaInvoiceRequestDto {
|
|
9
|
+
class ProformaInvoiceRequestDto extends base_invoice_request_dto_1.BaseInvoiceRequestDto {
|
|
25
10
|
}
|
|
26
11
|
exports.ProformaInvoiceRequestDto = ProformaInvoiceRequestDto;
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, class_validator_1.IsDefined)(),
|
|
29
|
-
(0, class_validator_1.IsString)(),
|
|
30
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
31
|
-
title: 'Invoice ID',
|
|
32
|
-
description: 'Unique identifier for the invoice.',
|
|
33
|
-
type: 'string',
|
|
34
|
-
}),
|
|
35
|
-
__metadata("design:type", String)
|
|
36
|
-
], ProformaInvoiceRequestDto.prototype, "invoiceId", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, class_validator_1.IsDefined)(),
|
|
39
|
-
(0, class_validator_1.IsString)(),
|
|
40
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
41
|
-
title: 'Company ID',
|
|
42
|
-
description: 'Company identifier issuing the invoice.',
|
|
43
|
-
type: 'string',
|
|
44
|
-
}),
|
|
45
|
-
__metadata("design:type", String)
|
|
46
|
-
], ProformaInvoiceRequestDto.prototype, "companyId", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, class_validator_1.IsDefined)(),
|
|
49
|
-
(0, class_validator_1.IsEnum)(country_enum_1.CountryEnum),
|
|
50
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
51
|
-
title: 'Company Country',
|
|
52
|
-
description: 'Country where the company is registered.',
|
|
53
|
-
type: 'string',
|
|
54
|
-
enum: Object.values(country_enum_1.CountryEnum),
|
|
55
|
-
}),
|
|
56
|
-
__metadata("design:type", String)
|
|
57
|
-
], ProformaInvoiceRequestDto.prototype, "companyCountry", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
(0, class_validator_1.IsDefined)(),
|
|
60
|
-
(0, class_validator_1.IsArray)(),
|
|
61
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
62
|
-
(0, class_transformer_1.Type)(() => transaction_data_dto_1.TransactionData),
|
|
63
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
64
|
-
title: 'Transactions',
|
|
65
|
-
description: 'List of transactions associated with this invoice.',
|
|
66
|
-
type: 'array',
|
|
67
|
-
items: { $ref: '#/components/schemas/TransactionData' },
|
|
68
|
-
}),
|
|
69
|
-
__metadata("design:type", Array)
|
|
70
|
-
], ProformaInvoiceRequestDto.prototype, "transactions", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, class_validator_1.IsDefined)(),
|
|
73
|
-
(0, class_validator_1.ValidateNested)(),
|
|
74
|
-
(0, class_transformer_1.Type)(() => invoice_contact_data_dto_1.InvoiceContactData),
|
|
75
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
76
|
-
title: 'Invoice Contact',
|
|
77
|
-
description: 'Billing contact information for the invoice recipient.',
|
|
78
|
-
$ref: '#/components/schemas/InvoiceContactData',
|
|
79
|
-
}),
|
|
80
|
-
__metadata("design:type", invoice_contact_data_dto_1.InvoiceContactData)
|
|
81
|
-
], ProformaInvoiceRequestDto.prototype, "invoiceContact", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, class_validator_1.IsDefined)(),
|
|
84
|
-
(0, class_validator_1.IsArray)(),
|
|
85
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
86
|
-
(0, class_transformer_1.Type)(() => invoice_item_data_dto_1.InvoiceItemDataDto),
|
|
87
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
88
|
-
title: 'Items',
|
|
89
|
-
description: 'Line items included in the invoice.',
|
|
90
|
-
type: 'array',
|
|
91
|
-
items: { $ref: '#/components/schemas/InvoiceItemDataDto' },
|
|
92
|
-
}),
|
|
93
|
-
__metadata("design:type", Array)
|
|
94
|
-
], ProformaInvoiceRequestDto.prototype, "items", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
(0, class_validator_1.IsDefined)(),
|
|
97
|
-
(0, class_validator_1.IsNumber)(),
|
|
98
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
99
|
-
title: 'Total Amount',
|
|
100
|
-
description: 'Total invoice amount.',
|
|
101
|
-
type: 'number',
|
|
102
|
-
}),
|
|
103
|
-
__metadata("design:type", Number)
|
|
104
|
-
], ProformaInvoiceRequestDto.prototype, "totalAmount", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProformaInvoiceResponseDto } from
|
|
1
|
+
import { ProformaInvoiceResponseDto } from './proforma-invoice-response.dto';
|
|
2
2
|
/**
|
|
3
3
|
* Response from invoice integrations after successfully creating a credit note.
|
|
4
4
|
* Maintains consistency with request/response naming (CreditNoteRequest → CreditNoteResponse).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProformaInvoiceResponseDto } from
|
|
1
|
+
import { ProformaInvoiceResponseDto } from './proforma-invoice-response.dto';
|
|
2
2
|
/**
|
|
3
3
|
* Response from invoice integrations after successfully creating a standard invoice.
|
|
4
4
|
* Maintains consistency with request/response naming (InvoiceRequest → InvoiceResponse).
|
|
@@ -50,7 +50,7 @@ __decorate([
|
|
|
50
50
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
51
51
|
title: 'Tax Details',
|
|
52
52
|
description: 'Detailed tax validation information including company details.',
|
|
53
|
-
|
|
53
|
+
$ref: '#/components/schemas/TINValidationDetails',
|
|
54
54
|
}),
|
|
55
55
|
__metadata("design:type", tin_validation_details_dto_1.TINValidationDetails)
|
|
56
56
|
], TaxDetailsResponseDto.prototype, "taxDetails", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CountryEnum } from
|
|
1
|
+
import { CountryEnum } from '../enums/country.enum';
|
|
2
2
|
/**
|
|
3
3
|
* Billing contact information sent from hoster.ai to invoice integrations.
|
|
4
4
|
* Contains the details of the person or business for whom an invoice will be issued.
|
|
@@ -35,7 +35,7 @@ export declare class InvoiceContactData {
|
|
|
35
35
|
/** State/province/region (for countries that use this) */
|
|
36
36
|
state?: string;
|
|
37
37
|
/** Tax Identification Number (TIN/VAT number) */
|
|
38
|
-
|
|
38
|
+
TIN?: string;
|
|
39
39
|
/** Tax office name or code */
|
|
40
40
|
taxOffice?: string;
|
|
41
41
|
/** Contact's profession or business activity */
|
|
@@ -45,7 +45,7 @@ __decorate([
|
|
|
45
45
|
(0, class_validator_1.IsNotEmpty)(),
|
|
46
46
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
47
47
|
title: 'First Name',
|
|
48
|
-
description:
|
|
48
|
+
description: "Contact's first name.",
|
|
49
49
|
type: 'string',
|
|
50
50
|
}),
|
|
51
51
|
__metadata("design:type", String)
|
|
@@ -55,7 +55,7 @@ __decorate([
|
|
|
55
55
|
(0, class_validator_1.IsNotEmpty)(),
|
|
56
56
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
57
57
|
title: 'Last Name',
|
|
58
|
-
description:
|
|
58
|
+
description: "Contact's last name.",
|
|
59
59
|
type: 'string',
|
|
60
60
|
}),
|
|
61
61
|
__metadata("design:type", String)
|
|
@@ -75,7 +75,7 @@ __decorate([
|
|
|
75
75
|
(0, class_validator_1.IsNotEmpty)(),
|
|
76
76
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
77
77
|
title: 'Email',
|
|
78
|
-
description:
|
|
78
|
+
description: "Contact's email address.",
|
|
79
79
|
type: 'string',
|
|
80
80
|
format: 'email',
|
|
81
81
|
}),
|
|
@@ -199,7 +199,7 @@ __decorate([
|
|
|
199
199
|
type: 'string',
|
|
200
200
|
}),
|
|
201
201
|
__metadata("design:type", String)
|
|
202
|
-
], InvoiceContactData.prototype, "
|
|
202
|
+
], InvoiceContactData.prototype, "TIN", void 0);
|
|
203
203
|
__decorate([
|
|
204
204
|
(0, class_validator_1.IsString)(),
|
|
205
205
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -215,7 +215,7 @@ __decorate([
|
|
|
215
215
|
(0, class_validator_1.IsOptional)(),
|
|
216
216
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
217
217
|
title: 'Profession',
|
|
218
|
-
description:
|
|
218
|
+
description: "Contact's profession or business activity.",
|
|
219
219
|
type: 'string',
|
|
220
220
|
}),
|
|
221
221
|
__metadata("design:type", String)
|
package/dist/dtos/menu.dto.js
CHANGED
|
@@ -66,12 +66,14 @@ __decorate([
|
|
|
66
66
|
title: 'URL',
|
|
67
67
|
description: 'URL associated with the menu item.',
|
|
68
68
|
type: 'string',
|
|
69
|
-
format: 'uri'
|
|
69
|
+
format: 'uri',
|
|
70
70
|
}),
|
|
71
71
|
__metadata("design:type", String)
|
|
72
72
|
], MenuDtoWithUrl.prototype, "url", void 0);
|
|
73
73
|
__decorate([
|
|
74
|
-
(0, is_property_forbidden_validator_1.IsPropertyForbidden)('submenu', {
|
|
74
|
+
(0, is_property_forbidden_validator_1.IsPropertyForbidden)('submenu', {
|
|
75
|
+
message: 'submenu is forbidden in MenuDtoWithUrl',
|
|
76
|
+
}),
|
|
75
77
|
__metadata("design:type", void 0)
|
|
76
78
|
], MenuDtoWithUrl.prototype, "submenu", void 0);
|
|
77
79
|
/**
|
|
@@ -93,7 +95,9 @@ __decorate([
|
|
|
93
95
|
__metadata("design:type", String)
|
|
94
96
|
], MenuDtoWithSubmenu.prototype, "type", void 0);
|
|
95
97
|
__decorate([
|
|
96
|
-
(0, is_property_forbidden_validator_1.IsPropertyForbidden)('url', {
|
|
98
|
+
(0, is_property_forbidden_validator_1.IsPropertyForbidden)('url', {
|
|
99
|
+
message: 'url is forbidden in MenuDtoWithSubmenu',
|
|
100
|
+
}),
|
|
97
101
|
__metadata("design:type", void 0)
|
|
98
102
|
], MenuDtoWithSubmenu.prototype, "url", void 0);
|
|
99
103
|
__decorate([
|
|
@@ -104,7 +108,7 @@ __decorate([
|
|
|
104
108
|
title: 'Submenu',
|
|
105
109
|
description: 'List of tabs that will appear in the submenu.',
|
|
106
110
|
type: 'array',
|
|
107
|
-
items: { $ref: '#/components/schemas/TabDto' }
|
|
111
|
+
items: { $ref: '#/components/schemas/TabDto' },
|
|
108
112
|
}),
|
|
109
113
|
__metadata("design:type", Array)
|
|
110
114
|
], MenuDtoWithSubmenu.prototype, "submenu", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SuccessResponseDto } from
|
|
1
|
+
import { SuccessResponseDto } from '../../success-response.dto';
|
|
2
2
|
/**
|
|
3
3
|
* Response from notification integrations after successfully sending a notification.
|
|
4
4
|
* Returned to hoster.ai confirming the notification was sent.
|
|
@@ -24,7 +24,7 @@ __decorate([
|
|
|
24
24
|
(0, class_validator_1.IsPhoneNumber)(),
|
|
25
25
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
26
26
|
title: 'Sender Phone',
|
|
27
|
-
description:
|
|
27
|
+
description: "Sender's phone number.",
|
|
28
28
|
type: 'string',
|
|
29
29
|
}),
|
|
30
30
|
__metadata("design:type", String)
|