didox 1.0.2 → 1.0.5
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/CHANGELOG.md +172 -0
- package/README.md +370 -280
- package/dist/index.d.mts +3192 -16
- package/dist/index.d.ts +3192 -16
- package/dist/index.js +3668 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3657 -72
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Didox SDK will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.5] - 2026-01-17
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Documents Module** - Complete electronic document management API
|
|
13
|
+
- `list()` - List documents with filtering, sorting, and pagination
|
|
14
|
+
- `get()` - Get detailed document information by ID
|
|
15
|
+
- `getStatistics()` - Get document statistics with customizable date ranges
|
|
16
|
+
- `createDraft()` - Universal method for creating document drafts with builders
|
|
17
|
+
|
|
18
|
+
- **Document Builders** - Fluent API for creating type-safe documents
|
|
19
|
+
- **InvoiceBuilder (002)** - Electronic invoices with VAT calculation
|
|
20
|
+
- **ActBuilder (005)** - Acts of completed work and services
|
|
21
|
+
- **EmpowermentBuilder (006)** - Power of attorney documents
|
|
22
|
+
- **TTNBuilder (041)** - Transport waybills (TTN)
|
|
23
|
+
- **ArbitraryBuilder (000)** - Custom documents with flexible structure
|
|
24
|
+
- **MultiPartyBuilder (010)** - Multi-party contracts and agreements
|
|
25
|
+
- **FoundersProtocolBuilder (075)** - Founders' meeting protocols
|
|
26
|
+
- **LetterNKBuilder (013)** - Letters to tax authorities (NK)
|
|
27
|
+
|
|
28
|
+
### Developer Experience
|
|
29
|
+
|
|
30
|
+
- **Fluent Builder API** - Chainable methods for intuitive document creation
|
|
31
|
+
- **Full TypeScript Support** - Comprehensive type definitions for all builders
|
|
32
|
+
- **Validation Layer** - Built-in validation for all document fields
|
|
33
|
+
- **Smart Defaults** - Automatic field population where possible
|
|
34
|
+
- **Zero Breaking Changes** - Fully backward compatible with existing APIs
|
|
35
|
+
|
|
36
|
+
### Production Ready
|
|
37
|
+
|
|
38
|
+
- Complete test coverage for all document types
|
|
39
|
+
- Production-grade error handling and validation
|
|
40
|
+
- Enterprise-ready document workflows
|
|
41
|
+
- Comprehensive documentation and examples
|
|
42
|
+
|
|
43
|
+
## [1.0.4] - 2026-01-17
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- **Utilities: Legal Entity Information by TIN**
|
|
47
|
+
- `getLegalEntityInfoByTin()` - Get detailed legal entity information by TIN
|
|
48
|
+
- Comprehensive company data including legal form, director info, banking details
|
|
49
|
+
- Address, OKED classification, VAT status, organizational flags
|
|
50
|
+
- Full TypeScript types with detailed JSDoc documentation
|
|
51
|
+
|
|
52
|
+
## [1.0.3] - 2026-01-16
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
- **Product Classes (ИКПУ) Management**
|
|
56
|
+
- `getProductClassCodes()` - Get attached product class codes for current profile
|
|
57
|
+
- `searchProductClasses()` - Search available product classes with pagination
|
|
58
|
+
- `addProductClass()` - Add product class code to profile
|
|
59
|
+
- `removeProductClass()` - Remove product class code from profile
|
|
60
|
+
- `checkProductClassCode()` - Check product class code packages by TIN
|
|
61
|
+
- **VAT & Taxpayer Information**
|
|
62
|
+
- `getVatRegStatus()` - Get VAT registration status by TIN or PINFL
|
|
63
|
+
- `getTaxpayerType()` - Get taxpayer type information
|
|
64
|
+
- Support for historical data queries with date parameters
|
|
65
|
+
- **Warehouses Management**
|
|
66
|
+
- `getWarehouses()` - Get warehouses by TIN or PINFL
|
|
67
|
+
- **Company Users & Permissions**
|
|
68
|
+
- `updateCompanyUsersPermissions()` - Update company users permissions with signed tokens
|
|
69
|
+
- Support for GNK (tax committee) and Didox internal roles
|
|
70
|
+
- **Enhanced Profile Module**
|
|
71
|
+
- Modular architecture with sub-APIs for better organization
|
|
72
|
+
- Convenience methods for direct access to extended features
|
|
73
|
+
- **Comprehensive Type Definitions**
|
|
74
|
+
- Full TypeScript support for all new APIs
|
|
75
|
+
- Enums for VAT status codes and role codes
|
|
76
|
+
- Detailed interface definitions for all request/response objects
|
|
77
|
+
|
|
78
|
+
### Technical Improvements
|
|
79
|
+
- Extended validation for TIN/PINFL formats
|
|
80
|
+
- Enhanced error handling for new endpoint types
|
|
81
|
+
- Maintained backward compatibility with existing APIs
|
|
82
|
+
|
|
83
|
+
## [1.0.2] - 2026-01-16
|
|
84
|
+
|
|
85
|
+
### Added
|
|
86
|
+
|
|
87
|
+
- **Profile module** - Complete company profile management API
|
|
88
|
+
- **Get current profile** - Retrieve detailed company information (`didox.profile.getProfile()`)
|
|
89
|
+
- **Update profile** - Update company profile with comprehensive validation (`didox.profile.updateProfile()`)
|
|
90
|
+
- **Profile operators** - Get operators associated with the profile (`didox.profile.getOperators()`)
|
|
91
|
+
- **Utilities module** - Helper functions for company data operations
|
|
92
|
+
- **Get branches by TIN** - Retrieve company branches by Tax ID (`didox.utilities.getBranchesByTin()`)
|
|
93
|
+
|
|
94
|
+
### Technical Features
|
|
95
|
+
|
|
96
|
+
- **Enhanced validation** - Support for TIN (9 digits), PINFL (14 digits), VAT rates, regions
|
|
97
|
+
- **Comprehensive typing** - Full TypeScript support for all profile fields
|
|
98
|
+
- **Operator management** - Access to integrated platform operators (Didox, Faktura, etc.)
|
|
99
|
+
- **Branch queries** - Geographic and organizational branch information
|
|
100
|
+
- **Field filtering** - Only expose documented API fields in public types
|
|
101
|
+
|
|
102
|
+
### Validation Rules
|
|
103
|
+
|
|
104
|
+
- **TIN validation** - Exactly 9 digits for company/director identification
|
|
105
|
+
- **PINFL validation** - Exactly 14 digits for personal identification
|
|
106
|
+
- **Notifications** - Only 0 (disabled) or 1 (enabled)
|
|
107
|
+
- **Region ID** - Numeric regional identifiers
|
|
108
|
+
- **VAT settings** - Number validation for VAT rates and excise flags
|
|
109
|
+
|
|
110
|
+
### API Methods
|
|
111
|
+
|
|
112
|
+
- `didox.profile.getProfile()` - Get comprehensive company profile
|
|
113
|
+
- `didox.profile.updateProfile()` - Update company information
|
|
114
|
+
- `didox.profile.getOperators()` - List profile operators
|
|
115
|
+
- `didox.utilities.getBranchesByTin()` - Query branches by company TIN
|
|
116
|
+
|
|
117
|
+
## [1.0.1] - 2026-01-16
|
|
118
|
+
|
|
119
|
+
### Added
|
|
120
|
+
|
|
121
|
+
- **Account module** - Complete account/profile management API
|
|
122
|
+
- **Get current profile** - Retrieve authenticated user profile information (`didox.account.getProfile()`)
|
|
123
|
+
- **Update profile** - Update user profile with validation (`didox.account.updateProfile()`)
|
|
124
|
+
- **Input validation for profile update** - Strict validation for mobile, email, password, notifications
|
|
125
|
+
- **Enhanced authorization headers** - Automatic Partner-Authorization header management
|
|
126
|
+
- **TypeScript support for Account** - Full type definitions for profile operations
|
|
127
|
+
|
|
128
|
+
### Technical Features
|
|
129
|
+
|
|
130
|
+
- **Mobile validation** - Format 998XXXXXXXXX (12 digits)
|
|
131
|
+
- **Email validation** - Standard email format validation
|
|
132
|
+
- **Password validation** - Optional field, minimum 8 characters when provided
|
|
133
|
+
- **Notifications validation** - Accepts only 0 (disabled) or 1 (enabled)
|
|
134
|
+
- **Dual authentication** - Supports both user-key and Partner-Authorization headers
|
|
135
|
+
|
|
136
|
+
### API Methods
|
|
137
|
+
|
|
138
|
+
- `didox.account.getProfile()` - Get current user profile
|
|
139
|
+
- `didox.account.updateProfile()` - Update user profile information
|
|
140
|
+
|
|
141
|
+
## [1.0.0] - 2026-01-16
|
|
142
|
+
|
|
143
|
+
### Added
|
|
144
|
+
|
|
145
|
+
- **DidoxClient initialization** - Main SDK client with configuration management
|
|
146
|
+
- **Auth module** - Complete authentication API implementation
|
|
147
|
+
- **Legal entity login** - Authenticate legal entities with Tax ID and password
|
|
148
|
+
- **Individual to company login** - Switch context to company using individual token
|
|
149
|
+
- **Input validation** - Strict validation for all API parameters before requests
|
|
150
|
+
- **Typed errors** - Custom error classes for different failure scenarios:
|
|
151
|
+
- `DidoxValidationError` - Input validation failures
|
|
152
|
+
- `DidoxAuthError` - Authentication failures (422 status)
|
|
153
|
+
- `DidoxApiError` - API error responses (4xx, 5xx)
|
|
154
|
+
- `DidoxNetworkError` - Network and timeout errors
|
|
155
|
+
- **TypeScript support** - Full TypeScript definitions with strict typing
|
|
156
|
+
- **Environment configuration** - Support for development and production environments
|
|
157
|
+
- **Partner token authentication** - Secure API authorization using partner tokens
|
|
158
|
+
- **Token management** - Automatic token handling for authenticated requests
|
|
159
|
+
- **JSDoc documentation** - Complete IDE hints for all public methods
|
|
160
|
+
- **ESM + CJS builds** - Universal module support for modern and legacy Node.js
|
|
161
|
+
|
|
162
|
+
### Technical Features
|
|
163
|
+
|
|
164
|
+
- **Node.js ≥ 18 support** - Modern Node.js runtime requirement
|
|
165
|
+
- **Zero external dependencies** - Uses native fetch API for HTTP requests
|
|
166
|
+
- **Modular architecture** - Clean separation of concerns across modules
|
|
167
|
+
- **Production-ready code** - Enterprise-grade error handling and validation
|
|
168
|
+
|
|
169
|
+
### API Methods
|
|
170
|
+
|
|
171
|
+
- `didox.auth.loginLegalEntity()` - Legal entity authentication
|
|
172
|
+
- `didox.auth.loginCompanyAsIndividual()` - Company context switching
|