@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.
Files changed (142) hide show
  1. package/README.md +200 -0
  2. package/dist/core/client.d.ts +54 -0
  3. package/dist/core/client.d.ts.map +1 -0
  4. package/dist/core/client.js +67 -0
  5. package/dist/core/client.js.map +1 -0
  6. package/dist/http/transport.d.ts +34 -0
  7. package/dist/http/transport.d.ts.map +1 -0
  8. package/dist/http/transport.js +8 -0
  9. package/dist/http/transport.js.map +1 -0
  10. package/dist/index.d.ts +56 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +48 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/services/actService.d.ts +21 -0
  15. package/dist/services/actService.d.ts.map +1 -0
  16. package/dist/services/actService.js +23 -0
  17. package/dist/services/actService.js.map +1 -0
  18. package/dist/services/arrivalService.d.ts +21 -0
  19. package/dist/services/arrivalService.d.ts.map +1 -0
  20. package/dist/services/arrivalService.js +23 -0
  21. package/dist/services/arrivalService.js.map +1 -0
  22. package/dist/services/cashOrderService.d.ts +21 -0
  23. package/dist/services/cashOrderService.d.ts.map +1 -0
  24. package/dist/services/cashOrderService.js +23 -0
  25. package/dist/services/cashOrderService.js.map +1 -0
  26. package/dist/services/categoryService.d.ts +27 -0
  27. package/dist/services/categoryService.d.ts.map +1 -0
  28. package/dist/services/categoryService.js +39 -0
  29. package/dist/services/categoryService.js.map +1 -0
  30. package/dist/services/checkService.d.ts +21 -0
  31. package/dist/services/checkService.d.ts.map +1 -0
  32. package/dist/services/checkService.js +23 -0
  33. package/dist/services/checkService.js.map +1 -0
  34. package/dist/services/contractService.d.ts +21 -0
  35. package/dist/services/contractService.d.ts.map +1 -0
  36. package/dist/services/contractService.js +23 -0
  37. package/dist/services/contractService.js.map +1 -0
  38. package/dist/services/currencyService.d.ts +27 -0
  39. package/dist/services/currencyService.d.ts.map +1 -0
  40. package/dist/services/currencyService.js +32 -0
  41. package/dist/services/currencyService.js.map +1 -0
  42. package/dist/services/invoiceService.d.ts +23 -0
  43. package/dist/services/invoiceService.d.ts.map +1 -0
  44. package/dist/services/invoiceService.js +25 -0
  45. package/dist/services/invoiceService.js.map +1 -0
  46. package/dist/services/orderService.d.ts +31 -0
  47. package/dist/services/orderService.d.ts.map +1 -0
  48. package/dist/services/orderService.js +41 -0
  49. package/dist/services/orderService.js.map +1 -0
  50. package/dist/services/paymentService.d.ts +27 -0
  51. package/dist/services/paymentService.d.ts.map +1 -0
  52. package/dist/services/paymentService.js +33 -0
  53. package/dist/services/paymentService.js.map +1 -0
  54. package/dist/services/productService.d.ts +29 -0
  55. package/dist/services/productService.d.ts.map +1 -0
  56. package/dist/services/productService.js +42 -0
  57. package/dist/services/productService.js.map +1 -0
  58. package/dist/services/referenceService.d.ts +31 -0
  59. package/dist/services/referenceService.d.ts.map +1 -0
  60. package/dist/services/referenceService.js +38 -0
  61. package/dist/services/referenceService.js.map +1 -0
  62. package/dist/services/salesInvoiceService.d.ts +21 -0
  63. package/dist/services/salesInvoiceService.d.ts.map +1 -0
  64. package/dist/services/salesInvoiceService.js +23 -0
  65. package/dist/services/salesInvoiceService.js.map +1 -0
  66. package/dist/types/act.d.ts +52 -0
  67. package/dist/types/act.d.ts.map +1 -0
  68. package/dist/types/act.js +6 -0
  69. package/dist/types/act.js.map +1 -0
  70. package/dist/types/arrival.d.ts +59 -0
  71. package/dist/types/arrival.d.ts.map +1 -0
  72. package/dist/types/arrival.js +6 -0
  73. package/dist/types/arrival.js.map +1 -0
  74. package/dist/types/base.d.ts +160 -0
  75. package/dist/types/base.d.ts.map +1 -0
  76. package/dist/types/base.js +8 -0
  77. package/dist/types/base.js.map +1 -0
  78. package/dist/types/call.d.ts +29 -0
  79. package/dist/types/call.d.ts.map +1 -0
  80. package/dist/types/call.js +6 -0
  81. package/dist/types/call.js.map +1 -0
  82. package/dist/types/cashOrder.d.ts +53 -0
  83. package/dist/types/cashOrder.d.ts.map +1 -0
  84. package/dist/types/cashOrder.js +6 -0
  85. package/dist/types/cashOrder.js.map +1 -0
  86. package/dist/types/category.d.ts +28 -0
  87. package/dist/types/category.d.ts.map +1 -0
  88. package/dist/types/category.js +8 -0
  89. package/dist/types/category.js.map +1 -0
  90. package/dist/types/check.d.ts +71 -0
  91. package/dist/types/check.d.ts.map +1 -0
  92. package/dist/types/check.js +6 -0
  93. package/dist/types/check.js.map +1 -0
  94. package/dist/types/contact.d.ts +41 -0
  95. package/dist/types/contact.d.ts.map +1 -0
  96. package/dist/types/contact.js +8 -0
  97. package/dist/types/contact.js.map +1 -0
  98. package/dist/types/contract.d.ts +46 -0
  99. package/dist/types/contract.d.ts.map +1 -0
  100. package/dist/types/contract.js +6 -0
  101. package/dist/types/contract.js.map +1 -0
  102. package/dist/types/currency.d.ts +36 -0
  103. package/dist/types/currency.d.ts.map +1 -0
  104. package/dist/types/currency.js +8 -0
  105. package/dist/types/currency.js.map +1 -0
  106. package/dist/types/delivery.d.ts +88 -0
  107. package/dist/types/delivery.d.ts.map +1 -0
  108. package/dist/types/delivery.js +8 -0
  109. package/dist/types/delivery.js.map +1 -0
  110. package/dist/types/errors.d.ts +38 -0
  111. package/dist/types/errors.d.ts.map +1 -0
  112. package/dist/types/errors.js +70 -0
  113. package/dist/types/errors.js.map +1 -0
  114. package/dist/types/invoice.d.ts +55 -0
  115. package/dist/types/invoice.d.ts.map +1 -0
  116. package/dist/types/invoice.js +8 -0
  117. package/dist/types/invoice.js.map +1 -0
  118. package/dist/types/order.d.ts +196 -0
  119. package/dist/types/order.d.ts.map +1 -0
  120. package/dist/types/order.js +8 -0
  121. package/dist/types/order.js.map +1 -0
  122. package/dist/types/payment.d.ts +91 -0
  123. package/dist/types/payment.d.ts.map +1 -0
  124. package/dist/types/payment.js +8 -0
  125. package/dist/types/payment.js.map +1 -0
  126. package/dist/types/product.d.ts +140 -0
  127. package/dist/types/product.d.ts.map +1 -0
  128. package/dist/types/product.js +8 -0
  129. package/dist/types/product.js.map +1 -0
  130. package/dist/types/reference.d.ts +51 -0
  131. package/dist/types/reference.d.ts.map +1 -0
  132. package/dist/types/reference.js +8 -0
  133. package/dist/types/reference.js.map +1 -0
  134. package/dist/types/salesInvoice.d.ts +52 -0
  135. package/dist/types/salesInvoice.d.ts.map +1 -0
  136. package/dist/types/salesInvoice.js +6 -0
  137. package/dist/types/salesInvoice.js.map +1 -0
  138. package/dist/types/webhook.d.ts +107 -0
  139. package/dist/types/webhook.d.ts.map +1 -0
  140. package/dist/types/webhook.js +8 -0
  141. package/dist/types/webhook.js.map +1 -0
  142. package/package.json +47 -0
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Contact Types
3
+ *
4
+ * Shared contact structure used in orders, payments, invoices, etc.
5
+ */
6
+ /**
7
+ * Full contact entity
8
+ */
9
+ export interface Contact {
10
+ readonly id: number;
11
+ readonly formId: number;
12
+ readonly version?: number;
13
+ readonly active?: number;
14
+ readonly lName?: string;
15
+ readonly fName?: string;
16
+ readonly mName?: string;
17
+ readonly phone?: string[];
18
+ readonly email?: string[];
19
+ readonly counterpartyId?: number;
20
+ readonly company?: string;
21
+ readonly comment?: string;
22
+ readonly userId?: number;
23
+ readonly telegram?: string;
24
+ readonly instagramNick?: string;
25
+ readonly dateOfBirth?: string;
26
+ readonly createTime?: string;
27
+ readonly leadsCount?: number;
28
+ readonly leadsSalesCount?: number;
29
+ readonly leadsSalesAmount?: number;
30
+ }
31
+ /**
32
+ * Short contact reference (used in documents)
33
+ */
34
+ export interface ContactReference {
35
+ readonly id: number;
36
+ readonly formId: number;
37
+ readonly fName?: string;
38
+ readonly lName?: string;
39
+ readonly mName?: string;
40
+ }
41
+ //# sourceMappingURL=contact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../src/types/contact.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,EAAE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EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Contact Types
4
+ *
5
+ * Shared contact structure used in orders, payments, invoices, etc.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.js","sourceRoot":"","sources":["../../src/types/contact.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Contract Types (Договори)
3
+ */
4
+ import type { ListRequestParams, DateFilterParams, Organization, OrganizationAccount, Counterparty, OrderReference } from './base.js';
5
+ import type { ContactReference } from './contact.js';
6
+ /**
7
+ * Full contract entity
8
+ */
9
+ export interface Contract {
10
+ readonly id: number;
11
+ readonly number: string;
12
+ readonly date: string;
13
+ readonly userId?: number;
14
+ readonly comment?: string;
15
+ readonly payerTypeId?: number;
16
+ readonly createdAt?: string;
17
+ readonly updatedAt?: string;
18
+ readonly responsibleId?: number;
19
+ readonly token?: string;
20
+ readonly organizationAccount?: OrganizationAccount;
21
+ readonly organization?: Organization;
22
+ readonly contact?: ContactReference;
23
+ readonly counterparty?: Counterparty;
24
+ readonly order?: OrderReference;
25
+ }
26
+ /**
27
+ * Parameters for listing contracts
28
+ */
29
+ export interface ListContractsRequest extends ListRequestParams, DateFilterParams {
30
+ }
31
+ /**
32
+ * Response from list contracts
33
+ */
34
+ export interface ListContractsResponse {
35
+ readonly status: 'success' | 'error';
36
+ readonly data?: Contract[];
37
+ readonly pagination?: {
38
+ readonly currentPage: number;
39
+ readonly pageCount: number;
40
+ readonly perPage: number;
41
+ };
42
+ readonly totals?: {
43
+ readonly count: number;
44
+ };
45
+ }
46
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/types/contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,iB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C;QAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACxB,CAAC;CACH"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Contract Types (Договори)
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/types/contract.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Currency Types
3
+ *
4
+ * Types for currency rate management.
5
+ */
6
+ /**
7
+ * Currency rate
8
+ */
9
+ export interface CurrencyRate {
10
+ readonly code: string;
11
+ readonly abbreviation?: string;
12
+ readonly rate: number;
13
+ }
14
+ /**
15
+ * Request to update currency rates
16
+ */
17
+ export interface UpdateCurrencyRequest {
18
+ readonly currencies: Array<{
19
+ readonly code: string;
20
+ readonly rate: number;
21
+ }>;
22
+ }
23
+ /**
24
+ * Response from update currency rates
25
+ */
26
+ export interface UpdateCurrencyResponse {
27
+ readonly status: 'success' | 'error';
28
+ }
29
+ /**
30
+ * Response from get currency rates
31
+ */
32
+ export interface GetCurrencyResponse {
33
+ readonly baseCurrency: string;
34
+ readonly currencies: CurrencyRate[];
35
+ }
36
+ //# sourceMappingURL=currency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../src/types/currency.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,YAAY,EAAE,CAAC;CACrC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Currency Types
4
+ *
5
+ * Types for currency rate management.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=currency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency.js","sourceRoot":"","sources":["../../src/types/currency.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Delivery Types
3
+ *
4
+ * Structures for different delivery providers supported by SalesDrive.
5
+ */
6
+ /**
7
+ * Nova Poshta delivery data
8
+ */
9
+ export interface NovaPoshtaDelivery {
10
+ readonly ServiceType?: 'Warehouse' | 'Doors';
11
+ readonly payer?: 'sender' | 'recipient';
12
+ readonly area?: string;
13
+ readonly region?: string;
14
+ readonly city?: string;
15
+ readonly cityNameFormat?: 'short' | 'full';
16
+ readonly WarehouseNumber?: string;
17
+ readonly Street?: string;
18
+ readonly BuildingNumber?: string;
19
+ readonly Flat?: string;
20
+ readonly ttn?: string;
21
+ }
22
+ /**
23
+ * Ukrposhta delivery data
24
+ */
25
+ export interface UkrposhtaDelivery {
26
+ readonly ServiceType?: 'Warehouse' | 'Doors';
27
+ readonly payer?: 'sender' | 'recipient';
28
+ readonly type?: 'express' | 'standard';
29
+ readonly city?: string;
30
+ readonly WarehouseNumber?: string;
31
+ readonly Street?: string;
32
+ readonly BuildingNumber?: string;
33
+ readonly Flat?: string;
34
+ readonly ttn?: string;
35
+ }
36
+ /**
37
+ * Meest Express delivery data
38
+ */
39
+ export interface MeestDelivery {
40
+ readonly ServiceType?: 'Warehouse' | 'Doors';
41
+ readonly payer?: 'sender' | 'recipient';
42
+ readonly area?: string;
43
+ readonly city?: string;
44
+ readonly WarehouseNumber?: string;
45
+ readonly ttn?: string;
46
+ }
47
+ /**
48
+ * Rozetka delivery data
49
+ */
50
+ export interface RozetkaDelivery {
51
+ readonly WarehouseNumber?: string;
52
+ readonly payer?: 'sender' | 'recipient';
53
+ readonly ttn?: string;
54
+ }
55
+ /**
56
+ * Delivery data structure in order response
57
+ */
58
+ export interface OrderDeliveryData {
59
+ readonly senderId?: number;
60
+ readonly idEntity?: number;
61
+ readonly provider?: 'novaposhta' | 'ukrposhta' | 'meest' | 'rozetka';
62
+ readonly type?: string;
63
+ readonly parentTrackingNumber?: string | null;
64
+ readonly trackingNumber?: string;
65
+ readonly trackingNumberRef?: string;
66
+ readonly statusCode?: number;
67
+ readonly deliveryDateAndTime?: string;
68
+ readonly areaName?: string;
69
+ readonly regionName?: string;
70
+ readonly cityName?: string;
71
+ readonly cityType?: string;
72
+ readonly cityRef?: string;
73
+ readonly settlementRef?: string;
74
+ readonly branchNumber?: number;
75
+ readonly branchRef?: string;
76
+ readonly streetName?: string;
77
+ readonly house?: string;
78
+ readonly flat?: string;
79
+ readonly address?: string;
80
+ readonly payer?: 'Sender' | 'Recipient';
81
+ readonly hasPostpay?: number;
82
+ readonly postpaySum?: number;
83
+ readonly postpayPayer?: 'Sender' | 'Recipient';
84
+ readonly paymentMethod?: 'Cash' | 'Card';
85
+ readonly cargoType?: 'Parcel' | 'Cargo';
86
+ readonly ukrposhtaType?: 'EXPRESS' | 'STANDARD';
87
+ }
88
+ //# sourceMappingURL=delivery.d.ts.map
@@ -0,0 +1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7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IAC/C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IACxC,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CACjD"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Delivery Types
4
+ *
5
+ * Structures for different delivery providers supported by SalesDrive.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=delivery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery.js","sourceRoot":"","sources":["../../src/types/delivery.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * SalesDrive API Error Types
3
+ */
4
+ /**
5
+ * Base error class for SalesDrive API errors
6
+ */
7
+ export declare class SalesDriveError extends Error {
8
+ readonly code?: string | undefined;
9
+ readonly statusCode?: number | undefined;
10
+ constructor(message: string, code?: string | undefined, statusCode?: number | undefined);
11
+ }
12
+ /**
13
+ * Error thrown when API returns an error response
14
+ */
15
+ export declare class ApiError extends SalesDriveError {
16
+ readonly response?: unknown | undefined;
17
+ constructor(message: string, statusCode?: number, response?: unknown | undefined);
18
+ }
19
+ /**
20
+ * Error thrown when rate limit is exceeded
21
+ */
22
+ export declare class RateLimitError extends SalesDriveError {
23
+ constructor(message?: string);
24
+ }
25
+ /**
26
+ * Error thrown when authentication fails
27
+ */
28
+ export declare class AuthenticationError extends SalesDriveError {
29
+ constructor(message?: string);
30
+ }
31
+ /**
32
+ * Error thrown for network/transport issues
33
+ */
34
+ export declare class NetworkError extends SalesDriveError {
35
+ readonly cause?: Error | undefined;
36
+ constructor(message: string, cause?: Error | undefined);
37
+ }
38
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;aAGtB,IAAI,CAAC,EAAE,MAAM;aACb,UAAU,CAAC,EAAE,MAAM;gBAFnC,OAAO,EAAE,MAAM,EACC,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,UAAU,CAAC,EAAE,MAAM,YAAA;CAMtC;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,eAAe;aAIzB,QAAQ,CAAC,EAAE,OAAO;gBAFlC,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,EACH,QAAQ,CAAC,EAAE,OAAO,YAAA;CAMrC;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,eAAe;gBACrC,OAAO,SAAwB;CAK5C;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,eAAe;gBAC1C,OAAO,SAA0B;CAK9C;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,eAAe;aAG7B,KAAK,CAAC,EAAE,KAAK;gBAD7B,OAAO,EAAE,MAAM,EACC,KAAK,CAAC,EAAE,KAAK,YAAA;CAMhC"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /**
3
+ * SalesDrive API Error Types
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NetworkError = exports.AuthenticationError = exports.RateLimitError = exports.ApiError = exports.SalesDriveError = void 0;
7
+ /**
8
+ * Base error class for SalesDrive API errors
9
+ */
10
+ class SalesDriveError extends Error {
11
+ code;
12
+ statusCode;
13
+ constructor(message, code, statusCode) {
14
+ super(message);
15
+ this.code = code;
16
+ this.statusCode = statusCode;
17
+ this.name = 'SalesDriveError';
18
+ Object.setPrototypeOf(this, SalesDriveError.prototype);
19
+ }
20
+ }
21
+ exports.SalesDriveError = SalesDriveError;
22
+ /**
23
+ * Error thrown when API returns an error response
24
+ */
25
+ class ApiError extends SalesDriveError {
26
+ response;
27
+ constructor(message, statusCode, response) {
28
+ super(message, 'API_ERROR', statusCode);
29
+ this.response = response;
30
+ this.name = 'ApiError';
31
+ Object.setPrototypeOf(this, ApiError.prototype);
32
+ }
33
+ }
34
+ exports.ApiError = ApiError;
35
+ /**
36
+ * Error thrown when rate limit is exceeded
37
+ */
38
+ class RateLimitError extends SalesDriveError {
39
+ constructor(message = 'Rate limit exceeded') {
40
+ super(message, 'RATE_LIMIT', 429);
41
+ this.name = 'RateLimitError';
42
+ Object.setPrototypeOf(this, RateLimitError.prototype);
43
+ }
44
+ }
45
+ exports.RateLimitError = RateLimitError;
46
+ /**
47
+ * Error thrown when authentication fails
48
+ */
49
+ class AuthenticationError extends SalesDriveError {
50
+ constructor(message = 'Authentication failed') {
51
+ super(message, 'AUTH_ERROR', 401);
52
+ this.name = 'AuthenticationError';
53
+ Object.setPrototypeOf(this, AuthenticationError.prototype);
54
+ }
55
+ }
56
+ exports.AuthenticationError = AuthenticationError;
57
+ /**
58
+ * Error thrown for network/transport issues
59
+ */
60
+ class NetworkError extends SalesDriveError {
61
+ cause;
62
+ constructor(message, cause) {
63
+ super(message, 'NETWORK_ERROR');
64
+ this.cause = cause;
65
+ this.name = 'NetworkError';
66
+ Object.setPrototypeOf(this, NetworkError.prototype);
67
+ }
68
+ }
69
+ exports.NetworkError = NetworkError;
70
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;GAEG;AACH,MAAa,eAAgB,SAAQ,KAAK;IAGtB;IACA;IAHlB,YACE,OAAe,EACC,IAAa,EACb,UAAmB;QAEnC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAS;QACb,eAAU,GAAV,UAAU,CAAS;QAGnC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF;AAVD,0CAUC;AAED;;GAEG;AACH,MAAa,QAAS,SAAQ,eAAe;IAIzB;IAHlB,YACE,OAAe,EACf,UAAmB,EACH,QAAkB;QAElC,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAFxB,aAAQ,GAAR,QAAQ,CAAU;QAGlC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC;CACF;AAVD,4BAUC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,eAAe;IACjD,YAAY,OAAO,GAAG,qBAAqB;QACzC,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACF;AAND,wCAMC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,eAAe;IACtD,YAAY,OAAO,GAAG,uBAAuB;QAC3C,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;CACF;AAND,kDAMC;AAED;;GAEG;AACH,MAAa,YAAa,SAAQ,eAAe;IAG7B;IAFlB,YACE,OAAe,EACC,KAAa;QAE7B,KAAK,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QAFhB,UAAK,GAAL,KAAK,CAAQ;QAG7B,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACF;AATD,oCASC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Invoice Types
3
+ *
4
+ * Types for invoice listing.
5
+ */
6
+ import type { ListRequestParams, DateFilterParams, Organization, OrganizationAccount, Counterparty, OrderReference, ContractReference, DocumentItem } from './base.js';
7
+ import type { ContactReference } from './contact.js';
8
+ /**
9
+ * Full invoice entity
10
+ */
11
+ export interface Invoice {
12
+ readonly id: number;
13
+ readonly number: string;
14
+ readonly date: string;
15
+ readonly payerTypeId?: number;
16
+ readonly maxPaymentDate?: string;
17
+ readonly userId?: number;
18
+ readonly totalSum: number;
19
+ readonly createdAt?: string;
20
+ readonly updatedAt?: string;
21
+ readonly nds?: number;
22
+ readonly comment?: string;
23
+ readonly responsibleId?: number;
24
+ readonly token?: string;
25
+ readonly documentItems?: DocumentItem[];
26
+ readonly organizationAccount?: OrganizationAccount;
27
+ readonly organization?: Organization;
28
+ readonly contact?: ContactReference;
29
+ readonly counterparty?: Counterparty;
30
+ readonly contract?: ContractReference;
31
+ readonly order?: OrderReference;
32
+ readonly payed?: number;
33
+ }
34
+ /**
35
+ * Parameters for listing invoices
36
+ */
37
+ export interface ListInvoicesRequest extends ListRequestParams, DateFilterParams {
38
+ }
39
+ /**
40
+ * Response from list invoices
41
+ */
42
+ export interface ListInvoicesResponse {
43
+ readonly status: 'success' | 'error';
44
+ readonly data?: Invoice[];
45
+ readonly pagination?: {
46
+ readonly currentPage: number;
47
+ readonly pageCount: number;
48
+ readonly perPage: number;
49
+ };
50
+ readonly totals?: {
51
+ readonly count: number;
52
+ readonly sum?: number;
53
+ };
54
+ }
55
+ //# sourceMappingURL=invoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice.d.ts","sourceRoot":"","sources":["../../src/types/invoice.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAA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
+ /**
3
+ * Invoice Types
4
+ *
5
+ * Types for invoice listing.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=invoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../src/types/invoice.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,196 @@
1
+ /**
2
+ * Order Types
3
+ *
4
+ * Types for order management - the core of SalesDrive API.
5
+ */
6
+ import type { Contact } from './contact.js';
7
+ import type { NovaPoshtaDelivery, UkrposhtaDelivery, MeestDelivery, RozetkaDelivery, OrderDeliveryData } from './delivery.js';
8
+ import type { OrderProduct } from './product.js';
9
+ import type { ListRequestParams, DateFilterParams } from './base.js';
10
+ /**
11
+ * Product input for order creation
12
+ */
13
+ export interface OrderProductInput {
14
+ readonly id: string;
15
+ readonly name?: string;
16
+ readonly costPerItem: number;
17
+ readonly amount: number;
18
+ readonly description?: string;
19
+ readonly discount?: string;
20
+ readonly sku?: string;
21
+ readonly commission?: string;
22
+ }
23
+ /**
24
+ * Request to create a new order
25
+ */
26
+ export interface CreateOrderRequest {
27
+ readonly getResultData?: 0 | 1;
28
+ readonly lName?: string;
29
+ readonly fName?: string;
30
+ readonly mName?: string;
31
+ readonly phone: string;
32
+ readonly email?: string;
33
+ readonly dateOfBirth?: string;
34
+ readonly products: OrderProductInput[];
35
+ readonly payment_method?: string;
36
+ readonly shipping_method?: string;
37
+ readonly shipping_address?: string;
38
+ readonly novaposhta?: NovaPoshtaDelivery;
39
+ readonly ukrposhta?: UkrposhtaDelivery;
40
+ readonly meest?: MeestDelivery;
41
+ readonly rozetka_delivery?: RozetkaDelivery;
42
+ readonly con_comment?: string;
43
+ readonly con_telegram?: string;
44
+ readonly comment?: string;
45
+ readonly externalId?: string;
46
+ readonly sajt?: string;
47
+ readonly stockId?: number;
48
+ readonly commission?: number;
49
+ readonly costPrice?: number;
50
+ readonly shipping_costs?: number;
51
+ readonly organizationId?: number;
52
+ readonly salesdrive_manager?: number;
53
+ readonly utmSourceFull?: string;
54
+ readonly utmSource?: string;
55
+ readonly utmMedium?: string;
56
+ readonly utmCampaign?: string;
57
+ readonly utmContent?: string;
58
+ readonly utmTerm?: string;
59
+ readonly utmPage?: string;
60
+ }
61
+ /**
62
+ * Response from order creation
63
+ */
64
+ export interface CreateOrderResponse {
65
+ readonly success: boolean;
66
+ readonly data?: {
67
+ readonly orderId: number;
68
+ readonly userId: number;
69
+ };
70
+ }
71
+ /**
72
+ * Data for order update
73
+ */
74
+ export interface UpdateOrderData {
75
+ readonly statusId?: number;
76
+ readonly paymentDate?: string;
77
+ readonly rejectionReasonId?: number;
78
+ readonly salesdrive_manager?: number;
79
+ readonly comment?: string;
80
+ readonly payment_method?: string;
81
+ readonly shipping_method?: string;
82
+ readonly shipping_address?: string;
83
+ readonly sajt?: string;
84
+ readonly lName?: string;
85
+ readonly fName?: string;
86
+ readonly mName?: string;
87
+ readonly phone?: string;
88
+ readonly email?: string;
89
+ readonly dateOfBirth?: string;
90
+ readonly novaposhta?: {
91
+ ttn?: string;
92
+ };
93
+ readonly ukrposhta?: {
94
+ ttn?: string;
95
+ };
96
+ readonly meest?: {
97
+ ttn?: string;
98
+ };
99
+ readonly rozetka_delivery?: {
100
+ ttn?: string;
101
+ };
102
+ }
103
+ /**
104
+ * Request to update an order
105
+ */
106
+ export interface UpdateOrderRequest {
107
+ readonly id?: number;
108
+ readonly externalId?: string;
109
+ readonly data: UpdateOrderData;
110
+ }
111
+ /**
112
+ * Response from order update
113
+ */
114
+ export interface UpdateOrderResponse {
115
+ readonly success: boolean;
116
+ }
117
+ /**
118
+ * Parameters for listing orders
119
+ */
120
+ export interface ListOrdersRequest extends ListRequestParams, DateFilterParams {
121
+ readonly 'filter[orderTime][from]'?: string;
122
+ readonly 'filter[orderTime][to]'?: string;
123
+ readonly 'filter[statusId]'?: string;
124
+ readonly 'filter[id][from]'?: number;
125
+ readonly 'filter[id][to]'?: number;
126
+ readonly 'filter[setStatusId][]'?: number[];
127
+ readonly 'filter[setStatusTime][from]'?: string;
128
+ readonly 'filter[setStatusTime][to]'?: string;
129
+ }
130
+ /**
131
+ * Full order entity from API
132
+ */
133
+ export interface Order {
134
+ readonly id: number;
135
+ readonly formId: number;
136
+ readonly version?: number;
137
+ readonly ord_delivery_data?: OrderDeliveryData[];
138
+ readonly primaryContact?: Contact;
139
+ readonly contacts?: Contact[];
140
+ readonly products?: OrderProduct[];
141
+ readonly shipping_method?: number;
142
+ readonly payment_method?: string;
143
+ readonly shipping_address?: string;
144
+ readonly comment?: string;
145
+ readonly organizationId?: number;
146
+ readonly typeId?: number;
147
+ readonly orderTime?: string;
148
+ readonly updateAt?: string;
149
+ readonly paymentDate?: string;
150
+ readonly statusId?: number;
151
+ readonly rejectionReason?: number | null;
152
+ readonly userId?: number;
153
+ readonly paymentAmount?: number;
154
+ readonly costPriceAmount?: number;
155
+ readonly shipping_costs?: number;
156
+ readonly commissionAmount?: number;
157
+ readonly expensesAmount?: number;
158
+ readonly profitAmount?: number;
159
+ readonly payedAmount?: number;
160
+ readonly restPay?: number;
161
+ readonly document_ord_check?: number;
162
+ readonly discountAmount?: number;
163
+ readonly sajt?: number;
164
+ readonly externalId?: string;
165
+ readonly utmPage?: string;
166
+ readonly utmMedium?: string;
167
+ readonly campaignId?: number;
168
+ readonly utmSourceFull?: string;
169
+ readonly utmSource?: string;
170
+ readonly utmCampaign?: string;
171
+ readonly utmContent?: string;
172
+ readonly utmTerm?: string;
173
+ readonly token?: string;
174
+ }
175
+ /**
176
+ * Response from list orders endpoint
177
+ */
178
+ export interface ListOrdersResponse {
179
+ readonly status: 'success' | 'error';
180
+ readonly data?: Order[];
181
+ readonly meta?: {
182
+ readonly fields?: Record<string, unknown>;
183
+ };
184
+ readonly pagination?: {
185
+ readonly currentPage: number;
186
+ readonly pageCount: number;
187
+ readonly perPage: number;
188
+ };
189
+ readonly totals?: {
190
+ readonly count: number;
191
+ readonly paymentAmount?: number;
192
+ readonly commission?: number;
193
+ readonly expenses?: number;
194
+ };
195
+ }
196
+ //# sourceMappingURL=order.d.ts.map