@dannychirkov/salesdrive-api-client 0.1.0
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 +200 -0
- package/dist/core/client.d.ts +54 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +67 -0
- package/dist/core/client.js.map +1 -0
- package/dist/http/transport.d.ts +34 -0
- package/dist/http/transport.d.ts.map +1 -0
- package/dist/http/transport.js +8 -0
- package/dist/http/transport.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/services/actService.d.ts +21 -0
- package/dist/services/actService.d.ts.map +1 -0
- package/dist/services/actService.js +23 -0
- package/dist/services/actService.js.map +1 -0
- package/dist/services/arrivalService.d.ts +21 -0
- package/dist/services/arrivalService.d.ts.map +1 -0
- package/dist/services/arrivalService.js +23 -0
- package/dist/services/arrivalService.js.map +1 -0
- package/dist/services/cashOrderService.d.ts +21 -0
- package/dist/services/cashOrderService.d.ts.map +1 -0
- package/dist/services/cashOrderService.js +23 -0
- package/dist/services/cashOrderService.js.map +1 -0
- package/dist/services/categoryService.d.ts +27 -0
- package/dist/services/categoryService.d.ts.map +1 -0
- package/dist/services/categoryService.js +39 -0
- package/dist/services/categoryService.js.map +1 -0
- package/dist/services/checkService.d.ts +21 -0
- package/dist/services/checkService.d.ts.map +1 -0
- package/dist/services/checkService.js +23 -0
- package/dist/services/checkService.js.map +1 -0
- package/dist/services/contractService.d.ts +21 -0
- package/dist/services/contractService.d.ts.map +1 -0
- package/dist/services/contractService.js +23 -0
- package/dist/services/contractService.js.map +1 -0
- package/dist/services/currencyService.d.ts +27 -0
- package/dist/services/currencyService.d.ts.map +1 -0
- package/dist/services/currencyService.js +32 -0
- package/dist/services/currencyService.js.map +1 -0
- package/dist/services/invoiceService.d.ts +23 -0
- package/dist/services/invoiceService.d.ts.map +1 -0
- package/dist/services/invoiceService.js +25 -0
- package/dist/services/invoiceService.js.map +1 -0
- package/dist/services/orderService.d.ts +31 -0
- package/dist/services/orderService.d.ts.map +1 -0
- package/dist/services/orderService.js +41 -0
- package/dist/services/orderService.js.map +1 -0
- package/dist/services/paymentService.d.ts +27 -0
- package/dist/services/paymentService.d.ts.map +1 -0
- package/dist/services/paymentService.js +33 -0
- package/dist/services/paymentService.js.map +1 -0
- package/dist/services/productService.d.ts +29 -0
- package/dist/services/productService.d.ts.map +1 -0
- package/dist/services/productService.js +42 -0
- package/dist/services/productService.js.map +1 -0
- package/dist/services/referenceService.d.ts +31 -0
- package/dist/services/referenceService.d.ts.map +1 -0
- package/dist/services/referenceService.js +38 -0
- package/dist/services/referenceService.js.map +1 -0
- package/dist/services/salesInvoiceService.d.ts +21 -0
- package/dist/services/salesInvoiceService.d.ts.map +1 -0
- package/dist/services/salesInvoiceService.js +23 -0
- package/dist/services/salesInvoiceService.js.map +1 -0
- package/dist/types/act.d.ts +52 -0
- package/dist/types/act.d.ts.map +1 -0
- package/dist/types/act.js +6 -0
- package/dist/types/act.js.map +1 -0
- package/dist/types/arrival.d.ts +59 -0
- package/dist/types/arrival.d.ts.map +1 -0
- package/dist/types/arrival.js +6 -0
- package/dist/types/arrival.js.map +1 -0
- package/dist/types/base.d.ts +160 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +8 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/call.d.ts +29 -0
- package/dist/types/call.d.ts.map +1 -0
- package/dist/types/call.js +6 -0
- package/dist/types/call.js.map +1 -0
- package/dist/types/cashOrder.d.ts +53 -0
- package/dist/types/cashOrder.d.ts.map +1 -0
- package/dist/types/cashOrder.js +6 -0
- package/dist/types/cashOrder.js.map +1 -0
- package/dist/types/category.d.ts +28 -0
- package/dist/types/category.d.ts.map +1 -0
- package/dist/types/category.js +8 -0
- package/dist/types/category.js.map +1 -0
- package/dist/types/check.d.ts +71 -0
- package/dist/types/check.d.ts.map +1 -0
- package/dist/types/check.js +6 -0
- package/dist/types/check.js.map +1 -0
- package/dist/types/contact.d.ts +41 -0
- package/dist/types/contact.d.ts.map +1 -0
- package/dist/types/contact.js +8 -0
- package/dist/types/contact.js.map +1 -0
- package/dist/types/contract.d.ts +46 -0
- package/dist/types/contract.d.ts.map +1 -0
- package/dist/types/contract.js +6 -0
- package/dist/types/contract.js.map +1 -0
- package/dist/types/currency.d.ts +36 -0
- package/dist/types/currency.d.ts.map +1 -0
- package/dist/types/currency.js +8 -0
- package/dist/types/currency.js.map +1 -0
- package/dist/types/delivery.d.ts +88 -0
- package/dist/types/delivery.d.ts.map +1 -0
- package/dist/types/delivery.js +8 -0
- package/dist/types/delivery.js.map +1 -0
- package/dist/types/errors.d.ts +38 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +70 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/invoice.d.ts +55 -0
- package/dist/types/invoice.d.ts.map +1 -0
- package/dist/types/invoice.js +8 -0
- package/dist/types/invoice.js.map +1 -0
- package/dist/types/order.d.ts +196 -0
- package/dist/types/order.d.ts.map +1 -0
- package/dist/types/order.js +8 -0
- package/dist/types/order.js.map +1 -0
- package/dist/types/payment.d.ts +91 -0
- package/dist/types/payment.d.ts.map +1 -0
- package/dist/types/payment.js +8 -0
- package/dist/types/payment.js.map +1 -0
- package/dist/types/product.d.ts +140 -0
- package/dist/types/product.d.ts.map +1 -0
- package/dist/types/product.js +8 -0
- package/dist/types/product.js.map +1 -0
- package/dist/types/reference.d.ts +51 -0
- package/dist/types/reference.d.ts.map +1 -0
- package/dist/types/reference.js +8 -0
- package/dist/types/reference.js.map +1 -0
- package/dist/types/salesInvoice.d.ts +52 -0
- package/dist/types/salesInvoice.d.ts.map +1 -0
- package/dist/types/salesInvoice.js +6 -0
- package/dist/types/salesInvoice.js.map +1 -0
- package/dist/types/webhook.d.ts +107 -0
- package/dist/types/webhook.d.ts.map +1 -0
- package/dist/types/webhook.js +8 -0
- package/dist/types/webhook.js.map +1 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# @dannychirkov/salesdrive-api-client
|
|
2
|
+
|
|
3
|
+
TypeScript API client for [SalesDrive CRM](https://salesdrive.ua).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @dannychirkov/salesdrive-api-client @dannychirkov/salesdrive-transport-fetch
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { createClient, orderService, referenceService } from '@dannychirkov/salesdrive-api-client';
|
|
15
|
+
import { createFetchTransport } from '@dannychirkov/salesdrive-transport-fetch';
|
|
16
|
+
|
|
17
|
+
// Create transport
|
|
18
|
+
const transport = createFetchTransport({
|
|
19
|
+
apiKey: 'your-api-key',
|
|
20
|
+
baseUrl: 'https://your-account.salesdrive.me',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Create client with services
|
|
24
|
+
const client = createClient({
|
|
25
|
+
transport,
|
|
26
|
+
apiKey: 'your-api-key',
|
|
27
|
+
baseUrl: 'https://your-account.salesdrive.me',
|
|
28
|
+
})
|
|
29
|
+
.extend(orderService)
|
|
30
|
+
.extend(referenceService);
|
|
31
|
+
|
|
32
|
+
// List orders
|
|
33
|
+
const orders = await client.orders.list({ limit: 10 });
|
|
34
|
+
console.log(orders.data);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Available Services
|
|
38
|
+
|
|
39
|
+
### Order Service
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { orderService } from '@dannychirkov/salesdrive-api-client';
|
|
43
|
+
|
|
44
|
+
const client = createClient(ctx).extend(orderService);
|
|
45
|
+
|
|
46
|
+
// List orders
|
|
47
|
+
const orders = await client.orders.list({
|
|
48
|
+
page: 1,
|
|
49
|
+
limit: 50,
|
|
50
|
+
'filter[statusId]': '2',
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Create order
|
|
54
|
+
const result = await client.orders.create({
|
|
55
|
+
phone: '0501234567',
|
|
56
|
+
fName: 'John',
|
|
57
|
+
lName: 'Doe',
|
|
58
|
+
products: [
|
|
59
|
+
{ id: '101', costPerItem: 500, amount: 2 },
|
|
60
|
+
],
|
|
61
|
+
payment_method: 'card',
|
|
62
|
+
shipping_method: 'novaposhta',
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Update order
|
|
66
|
+
await client.orders.update({
|
|
67
|
+
id: 1001,
|
|
68
|
+
data: {
|
|
69
|
+
statusId: 3,
|
|
70
|
+
comment: 'Updated',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Product Service
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import { productService } from '@dannychirkov/salesdrive-api-client';
|
|
79
|
+
|
|
80
|
+
const client = createClient(ctx).extend(productService);
|
|
81
|
+
|
|
82
|
+
// Update products (batch)
|
|
83
|
+
await client.products.update([
|
|
84
|
+
{ id: '101', name: 'Product 1', costPerItem: 500 },
|
|
85
|
+
{ id: '102', name: 'Product 2', costPerItem: 750 },
|
|
86
|
+
]);
|
|
87
|
+
|
|
88
|
+
// Delete products
|
|
89
|
+
await client.products.delete(['101', '102']);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Payment Service
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { paymentService } from '@dannychirkov/salesdrive-api-client';
|
|
96
|
+
|
|
97
|
+
const client = createClient(ctx).extend(paymentService);
|
|
98
|
+
|
|
99
|
+
// Add payment
|
|
100
|
+
await client.payments.add({
|
|
101
|
+
sum: 500,
|
|
102
|
+
orderId: 1001,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// List payments
|
|
106
|
+
const payments = await client.payments.list({
|
|
107
|
+
type: 'incoming',
|
|
108
|
+
page: 1,
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Reference Service
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
import { referenceService } from '@dannychirkov/salesdrive-api-client';
|
|
116
|
+
|
|
117
|
+
const client = createClient(ctx).extend(referenceService);
|
|
118
|
+
|
|
119
|
+
// Get payment methods
|
|
120
|
+
const paymentMethods = await client.reference.getPaymentMethods();
|
|
121
|
+
|
|
122
|
+
// Get delivery methods
|
|
123
|
+
const deliveryMethods = await client.reference.getDeliveryMethods();
|
|
124
|
+
|
|
125
|
+
// Get order statuses
|
|
126
|
+
const statuses = await client.reference.getStatuses();
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Currency Service
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import { currencyService } from '@dannychirkov/salesdrive-api-client';
|
|
133
|
+
|
|
134
|
+
const client = createClient(ctx).extend(currencyService);
|
|
135
|
+
|
|
136
|
+
// Get rates
|
|
137
|
+
const rates = await client.currencies.get();
|
|
138
|
+
|
|
139
|
+
// Update rates
|
|
140
|
+
await client.currencies.update({
|
|
141
|
+
currencies: [
|
|
142
|
+
{ code: 'USD', rate: 42 },
|
|
143
|
+
{ code: 'EUR', rate: 45 },
|
|
144
|
+
],
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## All Available Services
|
|
149
|
+
|
|
150
|
+
- `orderService` - Orders management
|
|
151
|
+
- `productService` - Products management
|
|
152
|
+
- `categoryService` - Categories management
|
|
153
|
+
- `paymentService` - Payments management
|
|
154
|
+
- `referenceService` - Reference data (payment methods, delivery methods, statuses)
|
|
155
|
+
- `currencyService` - Currency rates
|
|
156
|
+
- `invoiceService` - Invoices listing
|
|
157
|
+
- `salesInvoiceService` - Sales invoices listing
|
|
158
|
+
- `cashOrderService` - Cash orders listing
|
|
159
|
+
- `contractService` - Contracts listing
|
|
160
|
+
- `checkService` - Fiscal receipts listing
|
|
161
|
+
- `actService` - Acts listing
|
|
162
|
+
- `arrivalService` - Product arrivals listing
|
|
163
|
+
|
|
164
|
+
## Types
|
|
165
|
+
|
|
166
|
+
All types are exported from the package:
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
import type {
|
|
170
|
+
Order,
|
|
171
|
+
CreateOrderRequest,
|
|
172
|
+
Product,
|
|
173
|
+
Payment,
|
|
174
|
+
PaymentMethod,
|
|
175
|
+
DeliveryMethod,
|
|
176
|
+
OrderStatus,
|
|
177
|
+
} from '@dannychirkov/salesdrive-api-client';
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Error Handling
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
import { ApiError, RateLimitError, AuthenticationError } from '@dannychirkov/salesdrive-api-client';
|
|
184
|
+
|
|
185
|
+
try {
|
|
186
|
+
await client.orders.list();
|
|
187
|
+
} catch (error) {
|
|
188
|
+
if (error instanceof RateLimitError) {
|
|
189
|
+
console.log('Rate limited, try again later');
|
|
190
|
+
} else if (error instanceof AuthenticationError) {
|
|
191
|
+
console.log('Invalid API key');
|
|
192
|
+
} else if (error instanceof ApiError) {
|
|
193
|
+
console.log('API error:', error.message);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
[Apache License 2.0](../../LICENSE)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SalesDrive API Client Core
|
|
3
|
+
*
|
|
4
|
+
* Factory function and plugin system for creating typed API clients.
|
|
5
|
+
*/
|
|
6
|
+
import type { TransportFunction } from '../http/transport.js';
|
|
7
|
+
/**
|
|
8
|
+
* Client context passed to all service plugins
|
|
9
|
+
*/
|
|
10
|
+
export interface ClientContext {
|
|
11
|
+
readonly transport: TransportFunction;
|
|
12
|
+
readonly baseUrl: string;
|
|
13
|
+
readonly apiKey: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Service plugin function type
|
|
17
|
+
*/
|
|
18
|
+
export type ServicePlugin<T> = (ctx: ClientContext) => T;
|
|
19
|
+
/**
|
|
20
|
+
* Base client type with extend capability
|
|
21
|
+
*/
|
|
22
|
+
export interface Client<API extends object = object> {
|
|
23
|
+
/**
|
|
24
|
+
* Extend client with additional service plugins
|
|
25
|
+
*/
|
|
26
|
+
extend<T extends object>(plugin: ServicePlugin<T>): Client<API & T> & API & T;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Create a new SalesDrive API client
|
|
30
|
+
*
|
|
31
|
+
* @param ctx - Client context with transport and configuration
|
|
32
|
+
* @returns Client instance with extend capability
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* import { createClient, orderService, referenceService } from '@dannychirkov/salesdrive-api-client';
|
|
37
|
+
* import { createFetchTransport } from '@dannychirkov/salesdrive-transport-fetch';
|
|
38
|
+
*
|
|
39
|
+
* const transport = createFetchTransport({
|
|
40
|
+
* baseUrl: 'https://demo.salesdrive.me',
|
|
41
|
+
* apiKey: 'your-api-key',
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* const client = createClient({ transport, baseUrl: 'https://demo.salesdrive.me', apiKey: 'your-api-key' })
|
|
45
|
+
* .extend(orderService)
|
|
46
|
+
* .extend(referenceService);
|
|
47
|
+
*
|
|
48
|
+
* // Now you can use:
|
|
49
|
+
* // client.orders.list()
|
|
50
|
+
* // client.reference.getPaymentMethods()
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function createClient<API extends object = object>(ctx: ClientContext): Client<API> & API;
|
|
54
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,KAAK,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,MAAM,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACjD;;OAEG;IACH,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;CAC/E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,YAAY,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,EACtD,GAAG,EAAE,aAAa,GACjB,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAmCnB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SalesDrive API Client Core
|
|
4
|
+
*
|
|
5
|
+
* Factory function and plugin system for creating typed API clients.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.createClient = createClient;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new SalesDrive API client
|
|
11
|
+
*
|
|
12
|
+
* @param ctx - Client context with transport and configuration
|
|
13
|
+
* @returns Client instance with extend capability
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { createClient, orderService, referenceService } from '@dannychirkov/salesdrive-api-client';
|
|
18
|
+
* import { createFetchTransport } from '@dannychirkov/salesdrive-transport-fetch';
|
|
19
|
+
*
|
|
20
|
+
* const transport = createFetchTransport({
|
|
21
|
+
* baseUrl: 'https://demo.salesdrive.me',
|
|
22
|
+
* apiKey: 'your-api-key',
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* const client = createClient({ transport, baseUrl: 'https://demo.salesdrive.me', apiKey: 'your-api-key' })
|
|
26
|
+
* .extend(orderService)
|
|
27
|
+
* .extend(referenceService);
|
|
28
|
+
*
|
|
29
|
+
* // Now you can use:
|
|
30
|
+
* // client.orders.list()
|
|
31
|
+
* // client.reference.getPaymentMethods()
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
function createClient(ctx) {
|
|
35
|
+
const api = {};
|
|
36
|
+
const clientMethods = {
|
|
37
|
+
extend(plugin) {
|
|
38
|
+
const service = plugin(ctx);
|
|
39
|
+
Object.assign(api, service);
|
|
40
|
+
return proxy;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
// Create proxy that exposes both client methods and API services
|
|
44
|
+
const proxy = new Proxy(clientMethods, {
|
|
45
|
+
get(target, prop) {
|
|
46
|
+
if (typeof prop === 'string') {
|
|
47
|
+
// First check client methods
|
|
48
|
+
if (prop in target) {
|
|
49
|
+
return target[prop];
|
|
50
|
+
}
|
|
51
|
+
// Then check API services
|
|
52
|
+
if (prop in api) {
|
|
53
|
+
return api[prop];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
},
|
|
58
|
+
has(_target, prop) {
|
|
59
|
+
if (typeof prop === 'string') {
|
|
60
|
+
return prop in clientMethods || prop in api;
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
return proxy;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAqDH,oCAqCC;AA9DD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,YAAY,CAC1B,GAAkB;IAElB,MAAM,GAAG,GAA4B,EAAE,CAAC;IAExC,MAAM,aAAa,GAAG;QACpB,MAAM,CAAmB,MAAwB;YAC/C,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YAC5B,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAC5B,OAAO,KAAkC,CAAC;QAC5C,CAAC;KACF,CAAC;IAEF,iEAAiE;IACjE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,aAAa,EAAE;QACrC,GAAG,CAAC,MAAM,EAAE,IAAqB;YAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,6BAA6B;gBAC7B,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;oBACnB,OAAQ,MAAkC,CAAC,IAAI,CAAC,CAAC;gBACnD,CAAC;gBACD,0BAA0B;gBAC1B,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;oBAChB,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,GAAG,CAAC,OAAO,EAAE,IAAqB;YAChC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,OAAO,IAAI,IAAI,aAAa,IAAI,IAAI,IAAI,GAAG,CAAC;YAC9C,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,KAA0B,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Transport Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for HTTP transport implementations.
|
|
5
|
+
*/
|
|
6
|
+
import type { SalesDriveResponse } from '../types/base.js';
|
|
7
|
+
/**
|
|
8
|
+
* HTTP request configuration
|
|
9
|
+
*/
|
|
10
|
+
export interface HttpRequestConfig {
|
|
11
|
+
readonly method: 'GET' | 'POST';
|
|
12
|
+
readonly endpoint: string;
|
|
13
|
+
readonly params?: Record<string, unknown>;
|
|
14
|
+
readonly body?: Record<string, unknown>;
|
|
15
|
+
readonly signal?: AbortSignal;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* HTTP transport result
|
|
19
|
+
*/
|
|
20
|
+
export interface HttpTransportResult<T> {
|
|
21
|
+
readonly status: number;
|
|
22
|
+
readonly data: T;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* HTTP transport interface that all transport implementations must follow
|
|
26
|
+
*/
|
|
27
|
+
export interface HttpTransport {
|
|
28
|
+
request<T>(config: HttpRequestConfig): Promise<HttpTransportResult<SalesDriveResponse<T>>>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Type for the raw transport function (used internally)
|
|
32
|
+
*/
|
|
33
|
+
export type TransportFunction = <T>(config: HttpRequestConfig) => Promise<HttpTransportResult<SalesDriveResponse<T>>>;
|
|
34
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/http/transport.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5F;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,EAChC,MAAM,EAAE,iBAAiB,KACtB,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/http/transport.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SalesDrive API Client
|
|
3
|
+
*
|
|
4
|
+
* TypeScript client for SalesDrive CRM API.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export { createClient } from './core/client.js';
|
|
9
|
+
export type { Client, ClientContext, ServicePlugin } from './core/client.js';
|
|
10
|
+
export type { HttpTransport, HttpRequestConfig, HttpTransportResult, TransportFunction, } from './http/transport.js';
|
|
11
|
+
export { orderService } from './services/orderService.js';
|
|
12
|
+
export type { OrderServiceApi } from './services/orderService.js';
|
|
13
|
+
export { productService } from './services/productService.js';
|
|
14
|
+
export type { ProductServiceApi } from './services/productService.js';
|
|
15
|
+
export { categoryService } from './services/categoryService.js';
|
|
16
|
+
export type { CategoryServiceApi } from './services/categoryService.js';
|
|
17
|
+
export { paymentService } from './services/paymentService.js';
|
|
18
|
+
export type { PaymentServiceApi } from './services/paymentService.js';
|
|
19
|
+
export { referenceService } from './services/referenceService.js';
|
|
20
|
+
export type { ReferenceServiceApi } from './services/referenceService.js';
|
|
21
|
+
export { currencyService } from './services/currencyService.js';
|
|
22
|
+
export type { CurrencyServiceApi } from './services/currencyService.js';
|
|
23
|
+
export { invoiceService } from './services/invoiceService.js';
|
|
24
|
+
export type { InvoiceServiceApi } from './services/invoiceService.js';
|
|
25
|
+
export { salesInvoiceService } from './services/salesInvoiceService.js';
|
|
26
|
+
export type { SalesInvoiceServiceApi } from './services/salesInvoiceService.js';
|
|
27
|
+
export { cashOrderService } from './services/cashOrderService.js';
|
|
28
|
+
export type { CashOrderServiceApi } from './services/cashOrderService.js';
|
|
29
|
+
export { contractService } from './services/contractService.js';
|
|
30
|
+
export type { ContractServiceApi } from './services/contractService.js';
|
|
31
|
+
export { checkService } from './services/checkService.js';
|
|
32
|
+
export type { CheckServiceApi } from './services/checkService.js';
|
|
33
|
+
export { actService } from './services/actService.js';
|
|
34
|
+
export type { ActServiceApi } from './services/actService.js';
|
|
35
|
+
export { arrivalService } from './services/arrivalService.js';
|
|
36
|
+
export type { ArrivalServiceApi } from './services/arrivalService.js';
|
|
37
|
+
export type { SalesDriveResponse, PaginationInfo, TotalsInfo, MetaInfo, ListRequestParams, DateFilterParams, Organization, OrganizationAccount, Counterparty, ContractReference, InvoiceReference, OrderReference, Unit, DocumentItem, DocumentProduct, SuccessResponse, ErrorResponse, } from './types/base.js';
|
|
38
|
+
export type { Contact, ContactReference } from './types/contact.js';
|
|
39
|
+
export type { NovaPoshtaDelivery, UkrposhtaDelivery, MeestDelivery, RozetkaDelivery, OrderDeliveryData, } from './types/delivery.js';
|
|
40
|
+
export type { OrderProductInput, CreateOrderRequest, CreateOrderResponse, UpdateOrderData, UpdateOrderRequest, UpdateOrderResponse, ListOrdersRequest, Order, ListOrdersResponse, } from './types/order.js';
|
|
41
|
+
export type { ProductDiscount, ProductParam, AdditionalPrice, ProductImage, ProductCategory, ProductSetItem, ProductInput, ProductUpdateRequest, ProductDeleteRequest, ProductActionRequest, ProductActionResponse, OrderProduct, } from './types/product.js';
|
|
42
|
+
export type { AddPaymentRequest, AddPaymentResponse, PaymentBreakdown, Payment, ListPaymentsRequest, ListPaymentsResponse, } from './types/payment.js';
|
|
43
|
+
export type { PaymentMethod, DeliveryMethod, OrderStatus, PaymentMethodsResponse, DeliveryMethodsResponse, OrderStatusesResponse, } from './types/reference.js';
|
|
44
|
+
export type { CurrencyRate, UpdateCurrencyRequest, UpdateCurrencyResponse, GetCurrencyResponse, } from './types/currency.js';
|
|
45
|
+
export type { CategoryInput, CategoryActionRequest, CategoryActionResponse, } from './types/category.js';
|
|
46
|
+
export type { Invoice, ListInvoicesRequest, ListInvoicesResponse } from './types/invoice.js';
|
|
47
|
+
export type { SalesInvoice, ListSalesInvoicesRequest, ListSalesInvoicesResponse, } from './types/salesInvoice.js';
|
|
48
|
+
export type { CashOrder, ListCashOrdersRequest, ListCashOrdersResponse, } from './types/cashOrder.js';
|
|
49
|
+
export type { Contract, ListContractsRequest, ListContractsResponse } from './types/contract.js';
|
|
50
|
+
export type { Cashier, CashRegister, Check, ListChecksRequest, ListChecksResponse, } from './types/check.js';
|
|
51
|
+
export type { Act, ListActsRequest, ListActsResponse } from './types/act.js';
|
|
52
|
+
export type { ArrivalDocumentItem, ProductArrival, ListArrivalsRequest, ListArrivalsResponse, } from './types/arrival.js';
|
|
53
|
+
export type { CallManager, CallClient, CallResponse } from './types/call.js';
|
|
54
|
+
export type { WebhookInfo, WebhookProduct, WebhookOrderData, WebhookPayload, } from './types/webhook.js';
|
|
55
|
+
export { SalesDriveError, ApiError, RateLimitError, AuthenticationError, NetworkError, } from './types/errors.js';
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,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Documentation
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.NetworkError = exports.AuthenticationError = exports.RateLimitError = exports.ApiError = exports.SalesDriveError = exports.arrivalService = exports.actService = exports.checkService = exports.contractService = exports.cashOrderService = exports.salesInvoiceService = exports.invoiceService = exports.currencyService = exports.referenceService = exports.paymentService = exports.categoryService = exports.productService = exports.orderService = exports.createClient = void 0;
|
|
11
|
+
// Core
|
|
12
|
+
var client_js_1 = require("./core/client.js");
|
|
13
|
+
Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return client_js_1.createClient; } });
|
|
14
|
+
// Services
|
|
15
|
+
var orderService_js_1 = require("./services/orderService.js");
|
|
16
|
+
Object.defineProperty(exports, "orderService", { enumerable: true, get: function () { return orderService_js_1.orderService; } });
|
|
17
|
+
var productService_js_1 = require("./services/productService.js");
|
|
18
|
+
Object.defineProperty(exports, "productService", { enumerable: true, get: function () { return productService_js_1.productService; } });
|
|
19
|
+
var categoryService_js_1 = require("./services/categoryService.js");
|
|
20
|
+
Object.defineProperty(exports, "categoryService", { enumerable: true, get: function () { return categoryService_js_1.categoryService; } });
|
|
21
|
+
var paymentService_js_1 = require("./services/paymentService.js");
|
|
22
|
+
Object.defineProperty(exports, "paymentService", { enumerable: true, get: function () { return paymentService_js_1.paymentService; } });
|
|
23
|
+
var referenceService_js_1 = require("./services/referenceService.js");
|
|
24
|
+
Object.defineProperty(exports, "referenceService", { enumerable: true, get: function () { return referenceService_js_1.referenceService; } });
|
|
25
|
+
var currencyService_js_1 = require("./services/currencyService.js");
|
|
26
|
+
Object.defineProperty(exports, "currencyService", { enumerable: true, get: function () { return currencyService_js_1.currencyService; } });
|
|
27
|
+
var invoiceService_js_1 = require("./services/invoiceService.js");
|
|
28
|
+
Object.defineProperty(exports, "invoiceService", { enumerable: true, get: function () { return invoiceService_js_1.invoiceService; } });
|
|
29
|
+
var salesInvoiceService_js_1 = require("./services/salesInvoiceService.js");
|
|
30
|
+
Object.defineProperty(exports, "salesInvoiceService", { enumerable: true, get: function () { return salesInvoiceService_js_1.salesInvoiceService; } });
|
|
31
|
+
var cashOrderService_js_1 = require("./services/cashOrderService.js");
|
|
32
|
+
Object.defineProperty(exports, "cashOrderService", { enumerable: true, get: function () { return cashOrderService_js_1.cashOrderService; } });
|
|
33
|
+
var contractService_js_1 = require("./services/contractService.js");
|
|
34
|
+
Object.defineProperty(exports, "contractService", { enumerable: true, get: function () { return contractService_js_1.contractService; } });
|
|
35
|
+
var checkService_js_1 = require("./services/checkService.js");
|
|
36
|
+
Object.defineProperty(exports, "checkService", { enumerable: true, get: function () { return checkService_js_1.checkService; } });
|
|
37
|
+
var actService_js_1 = require("./services/actService.js");
|
|
38
|
+
Object.defineProperty(exports, "actService", { enumerable: true, get: function () { return actService_js_1.actService; } });
|
|
39
|
+
var arrivalService_js_1 = require("./services/arrivalService.js");
|
|
40
|
+
Object.defineProperty(exports, "arrivalService", { enumerable: true, get: function () { return arrivalService_js_1.arrivalService; } });
|
|
41
|
+
// Errors
|
|
42
|
+
var errors_js_1 = require("./types/errors.js");
|
|
43
|
+
Object.defineProperty(exports, "SalesDriveError", { enumerable: true, get: function () { return errors_js_1.SalesDriveError; } });
|
|
44
|
+
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return errors_js_1.ApiError; } });
|
|
45
|
+
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return errors_js_1.RateLimitError; } });
|
|
46
|
+
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return errors_js_1.AuthenticationError; } });
|
|
47
|
+
Object.defineProperty(exports, "NetworkError", { enumerable: true, get: function () { return errors_js_1.NetworkError; } });
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,OAAO;AACP,8CAAgD;AAAvC,yGAAA,YAAY,OAAA;AAWrB,WAAW;AACX,8DAA0D;AAAjD,+GAAA,YAAY,OAAA;AAGrB,kEAA8D;AAArD,mHAAA,cAAc,OAAA;AAGvB,oEAAgE;AAAvD,qHAAA,eAAe,OAAA;AAGxB,kEAA8D;AAArD,mHAAA,cAAc,OAAA;AAGvB,sEAAkE;AAAzD,uHAAA,gBAAgB,OAAA;AAGzB,oEAAgE;AAAvD,qHAAA,eAAe,OAAA;AAGxB,kEAA8D;AAArD,mHAAA,cAAc,OAAA;AAGvB,4EAAwE;AAA/D,6HAAA,mBAAmB,OAAA;AAG5B,sEAAkE;AAAzD,uHAAA,gBAAgB,OAAA;AAGzB,oEAAgE;AAAvD,qHAAA,eAAe,OAAA;AAGxB,8DAA0D;AAAjD,+GAAA,YAAY,OAAA;AAGrB,0DAAsD;AAA7C,2GAAA,UAAU,OAAA;AAGnB,kEAA8D;AAArD,mHAAA,cAAc,OAAA;AAuJvB,SAAS;AACT,+CAM2B;AALzB,4GAAA,eAAe,OAAA;AACf,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AACd,gHAAA,mBAAmB,OAAA;AACnB,yGAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Act Service (Акти)
|
|
3
|
+
*/
|
|
4
|
+
import type { ServicePlugin } from '../core/client.js';
|
|
5
|
+
import type { ListActsRequest, ListActsResponse } from '../types/act.js';
|
|
6
|
+
/**
|
|
7
|
+
* Act service API
|
|
8
|
+
*/
|
|
9
|
+
export interface ActServiceApi {
|
|
10
|
+
readonly acts: {
|
|
11
|
+
/**
|
|
12
|
+
* List acts with filters
|
|
13
|
+
*/
|
|
14
|
+
list(params?: ListActsRequest): Promise<ListActsResponse>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Act service plugin
|
|
19
|
+
*/
|
|
20
|
+
export declare const actService: ServicePlugin<ActServiceApi>;
|
|
21
|
+
//# sourceMappingURL=actService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actService.d.ts","sourceRoot":"","sources":["../../src/services/actService.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE;QACb;;WAEG;QACH,IAAI,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;KAC3D,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,aAAa,CAWlD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Act Service (Акти)
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.actService = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Act service plugin
|
|
9
|
+
*/
|
|
10
|
+
const actService = (ctx) => ({
|
|
11
|
+
acts: {
|
|
12
|
+
async list(params) {
|
|
13
|
+
const result = await ctx.transport({
|
|
14
|
+
method: 'GET',
|
|
15
|
+
endpoint: '/api/act/list/',
|
|
16
|
+
params: params,
|
|
17
|
+
});
|
|
18
|
+
return result.data;
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
exports.actService = actService;
|
|
23
|
+
//# sourceMappingURL=actService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actService.js","sourceRoot":"","sources":["../../src/services/actService.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAiBH;;GAEG;AACI,MAAM,UAAU,GAAiC,CAAC,GAAkB,EAAE,EAAE,CAAC,CAAC;IAC/E,IAAI,EAAE;QACJ,KAAK,CAAC,IAAI,CAAC,MAAwB;YACjC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,SAAS,CAAmB;gBACnD,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,gBAAgB;gBAC1B,MAAM,EAAE,MAA4C;aACrD,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,IAAwB,CAAC;QACzC,CAAC;KACF;CACF,CAAC,CAAC;AAXU,QAAA,UAAU,cAWpB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arrival Service (Product Arrivals / Надходження товарів)
|
|
3
|
+
*/
|
|
4
|
+
import type { ServicePlugin } from '../core/client.js';
|
|
5
|
+
import type { ListArrivalsRequest, ListArrivalsResponse } from '../types/arrival.js';
|
|
6
|
+
/**
|
|
7
|
+
* Arrival service API
|
|
8
|
+
*/
|
|
9
|
+
export interface ArrivalServiceApi {
|
|
10
|
+
readonly arrivals: {
|
|
11
|
+
/**
|
|
12
|
+
* List product arrivals with filters
|
|
13
|
+
*/
|
|
14
|
+
list(params?: ListArrivalsRequest): Promise<ListArrivalsResponse>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Arrival service plugin
|
|
19
|
+
*/
|
|
20
|
+
export declare const arrivalService: ServicePlugin<ArrivalServiceApi>;
|
|
21
|
+
//# sourceMappingURL=arrivalService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrivalService.d.ts","sourceRoot":"","sources":["../../src/services/arrivalService.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAErF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE;QACjB;;WAEG;QACH,IAAI,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;KACnE,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,iBAAiB,CAW1D,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Arrival Service (Product Arrivals / Надходження товарів)
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.arrivalService = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Arrival service plugin
|
|
9
|
+
*/
|
|
10
|
+
const arrivalService = (ctx) => ({
|
|
11
|
+
arrivals: {
|
|
12
|
+
async list(params) {
|
|
13
|
+
const result = await ctx.transport({
|
|
14
|
+
method: 'GET',
|
|
15
|
+
endpoint: '/api/arrival-product/list/',
|
|
16
|
+
params: params,
|
|
17
|
+
});
|
|
18
|
+
return result.data;
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
exports.arrivalService = arrivalService;
|
|
23
|
+
//# sourceMappingURL=arrivalService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrivalService.js","sourceRoot":"","sources":["../../src/services/arrivalService.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAiBH;;GAEG;AACI,MAAM,cAAc,GAAqC,CAAC,GAAkB,EAAE,EAAE,CAAC,CAAC;IACvF,QAAQ,EAAE;QACR,KAAK,CAAC,IAAI,CAAC,MAA4B;YACrC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,SAAS,CAAuB;gBACvD,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,4BAA4B;gBACtC,MAAM,EAAE,MAA4C;aACrD,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,IAA4B,CAAC;QAC7C,CAAC;KACF;CACF,CAAC,CAAC;AAXU,QAAA,cAAc,kBAWxB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cash Order Service (Касові ордери)
|
|
3
|
+
*/
|
|
4
|
+
import type { ServicePlugin } from '../core/client.js';
|
|
5
|
+
import type { ListCashOrdersRequest, ListCashOrdersResponse } from '../types/cashOrder.js';
|
|
6
|
+
/**
|
|
7
|
+
* Cash order service API
|
|
8
|
+
*/
|
|
9
|
+
export interface CashOrderServiceApi {
|
|
10
|
+
readonly cashOrders: {
|
|
11
|
+
/**
|
|
12
|
+
* List cash orders with filters
|
|
13
|
+
*/
|
|
14
|
+
list(params?: ListCashOrdersRequest): Promise<ListCashOrdersResponse>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Cash order service plugin
|
|
19
|
+
*/
|
|
20
|
+
export declare const cashOrderService: ServicePlugin<CashOrderServiceApi>;
|
|
21
|
+
//# sourceMappingURL=cashOrderService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cashOrderService.d.ts","sourceRoot":"","sources":["../../src/services/cashOrderService.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE;QACnB;;WAEG;QACH,IAAI,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;KACvE,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,mBAAmB,CAW9D,CAAC"}
|