bukku-client 0.1.0-test.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/LICENSE +674 -0
- package/README.md +85 -0
- package/dist/accounting/accounts/index.d.ts +52 -0
- package/dist/accounting/accounts/index.d.ts.map +1 -0
- package/dist/accounting/accounts/index.js +72 -0
- package/dist/accounting/accounts/index.js.map +1 -0
- package/dist/accounting/accounts/type.d.ts +125 -0
- package/dist/accounting/accounts/type.d.ts.map +1 -0
- package/dist/accounting/accounts/type.js +4 -0
- package/dist/accounting/accounts/type.js.map +1 -0
- package/dist/accounting/index.d.ts +10 -0
- package/dist/accounting/index.d.ts.map +1 -0
- package/dist/accounting/index.js +16 -0
- package/dist/accounting/index.js.map +1 -0
- package/dist/accounting/journal-entries/index.d.ts +52 -0
- package/dist/accounting/journal-entries/index.d.ts.map +1 -0
- package/dist/accounting/journal-entries/index.js +72 -0
- package/dist/accounting/journal-entries/index.js.map +1 -0
- package/dist/accounting/journal-entries/type.d.ts +151 -0
- package/dist/accounting/journal-entries/type.d.ts.map +1 -0
- package/dist/accounting/journal-entries/type.js +4 -0
- package/dist/accounting/journal-entries/type.js.map +1 -0
- package/dist/common/type.d.ts +105 -0
- package/dist/common/type.d.ts.map +1 -0
- package/dist/common/type.js +3 -0
- package/dist/common/type.js.map +1 -0
- package/dist/contacts/contacts/index.d.ts +57 -0
- package/dist/contacts/contacts/index.d.ts.map +1 -0
- package/dist/contacts/contacts/index.js +82 -0
- package/dist/contacts/contacts/index.js.map +1 -0
- package/dist/contacts/contacts/type.d.ts +286 -0
- package/dist/contacts/contacts/type.d.ts.map +1 -0
- package/dist/contacts/contacts/type.js +4 -0
- package/dist/contacts/contacts/type.js.map +1 -0
- package/dist/contacts/groups/index.d.ts +42 -0
- package/dist/contacts/groups/index.d.ts.map +1 -0
- package/dist/contacts/groups/index.js +59 -0
- package/dist/contacts/groups/index.js.map +1 -0
- package/dist/contacts/groups/type.d.ts +34 -0
- package/dist/contacts/groups/type.d.ts.map +1 -0
- package/dist/contacts/groups/type.js +4 -0
- package/dist/contacts/groups/type.js.map +1 -0
- package/dist/contacts/index.d.ts +10 -0
- package/dist/contacts/index.d.ts.map +1 -0
- package/dist/contacts/index.js +15 -0
- package/dist/contacts/index.js.map +1 -0
- package/dist/control-panel/index.d.ts +15 -0
- package/dist/control-panel/index.d.ts.map +1 -0
- package/dist/control-panel/index.js +35 -0
- package/dist/control-panel/index.js.map +1 -0
- package/dist/control-panel/locations/index.d.ts +51 -0
- package/dist/control-panel/locations/index.d.ts.map +1 -0
- package/dist/control-panel/locations/index.js +70 -0
- package/dist/control-panel/locations/index.js.map +1 -0
- package/dist/control-panel/locations/type.d.ts +91 -0
- package/dist/control-panel/locations/type.d.ts.map +1 -0
- package/dist/control-panel/locations/type.js +4 -0
- package/dist/control-panel/locations/type.js.map +1 -0
- package/dist/control-panel/tag-groups/index.d.ts +44 -0
- package/dist/control-panel/tag-groups/index.d.ts.map +1 -0
- package/dist/control-panel/tag-groups/index.js +63 -0
- package/dist/control-panel/tag-groups/index.js.map +1 -0
- package/dist/control-panel/tag-groups/type.d.ts +64 -0
- package/dist/control-panel/tag-groups/type.d.ts.map +1 -0
- package/dist/control-panel/tag-groups/type.js +4 -0
- package/dist/control-panel/tag-groups/type.js.map +1 -0
- package/dist/control-panel/tags/index.d.ts +43 -0
- package/dist/control-panel/tags/index.d.ts.map +1 -0
- package/dist/control-panel/tags/index.js +60 -0
- package/dist/control-panel/tags/index.js.map +1 -0
- package/dist/control-panel/tags/type.d.ts +60 -0
- package/dist/control-panel/tags/type.d.ts.map +1 -0
- package/dist/control-panel/tags/type.js +4 -0
- package/dist/control-panel/tags/type.js.map +1 -0
- package/dist/files/index.d.ts +29 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/index.js +42 -0
- package/dist/files/index.js.map +1 -0
- package/dist/files/type.d.ts +50 -0
- package/dist/files/type.d.ts.map +1 -0
- package/dist/files/type.js +4 -0
- package/dist/files/type.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +130 -0
- package/dist/index.js.map +1 -0
- package/dist/lists/index.d.ts +24 -0
- package/dist/lists/index.d.ts.map +1 -0
- package/dist/lists/index.js +33 -0
- package/dist/lists/index.js.map +1 -0
- package/dist/lists/type.d.ts +781 -0
- package/dist/lists/type.d.ts.map +1 -0
- package/dist/lists/type.js +3 -0
- package/dist/lists/type.js.map +1 -0
- package/dist/products/groups/index.d.ts +42 -0
- package/dist/products/groups/index.d.ts.map +1 -0
- package/dist/products/groups/index.js +59 -0
- package/dist/products/groups/index.js.map +1 -0
- package/dist/products/groups/type.d.ts +53 -0
- package/dist/products/groups/type.d.ts.map +1 -0
- package/dist/products/groups/type.js +5 -0
- package/dist/products/groups/type.js.map +1 -0
- package/dist/products/index.d.ts +10 -0
- package/dist/products/index.d.ts.map +1 -0
- package/dist/products/index.js +15 -0
- package/dist/products/index.js.map +1 -0
- package/dist/products/products/index.d.ts +51 -0
- package/dist/products/products/index.d.ts.map +1 -0
- package/dist/products/products/index.js +70 -0
- package/dist/products/products/index.js.map +1 -0
- package/dist/products/products/type.d.ts +270 -0
- package/dist/products/products/type.d.ts.map +1 -0
- package/dist/products/products/type.js +4 -0
- package/dist/products/products/type.js.map +1 -0
- package/dist/purchases/bills/index.d.ts +51 -0
- package/dist/purchases/bills/index.d.ts.map +1 -0
- package/dist/purchases/bills/index.js +75 -0
- package/dist/purchases/bills/index.js.map +1 -0
- package/dist/purchases/bills/type.d.ts +254 -0
- package/dist/purchases/bills/type.d.ts.map +1 -0
- package/dist/purchases/bills/type.js +4 -0
- package/dist/purchases/bills/type.js.map +1 -0
- package/dist/purchases/credit-notes/index.d.ts +51 -0
- package/dist/purchases/credit-notes/index.d.ts.map +1 -0
- package/dist/purchases/credit-notes/index.js +71 -0
- package/dist/purchases/credit-notes/index.js.map +1 -0
- package/dist/purchases/credit-notes/type.d.ts +204 -0
- package/dist/purchases/credit-notes/type.d.ts.map +1 -0
- package/dist/purchases/credit-notes/type.js +4 -0
- package/dist/purchases/credit-notes/type.js.map +1 -0
- package/dist/purchases/goods-received-notes/index.d.ts +51 -0
- package/dist/purchases/goods-received-notes/index.d.ts.map +1 -0
- package/dist/purchases/goods-received-notes/index.js +71 -0
- package/dist/purchases/goods-received-notes/index.js.map +1 -0
- package/dist/purchases/goods-received-notes/type.d.ts +184 -0
- package/dist/purchases/goods-received-notes/type.d.ts.map +1 -0
- package/dist/purchases/goods-received-notes/type.js +4 -0
- package/dist/purchases/goods-received-notes/type.js.map +1 -0
- package/dist/purchases/index.d.ts +18 -0
- package/dist/purchases/index.d.ts.map +1 -0
- package/dist/purchases/index.js +23 -0
- package/dist/purchases/index.js.map +1 -0
- package/dist/purchases/payments/index.d.ts +51 -0
- package/dist/purchases/payments/index.d.ts.map +1 -0
- package/dist/purchases/payments/index.js +71 -0
- package/dist/purchases/payments/index.js.map +1 -0
- package/dist/purchases/payments/type.d.ts +183 -0
- package/dist/purchases/payments/type.d.ts.map +1 -0
- package/dist/purchases/payments/type.js +4 -0
- package/dist/purchases/payments/type.js.map +1 -0
- package/dist/purchases/purchase-orders/index.d.ts +51 -0
- package/dist/purchases/purchase-orders/index.d.ts.map +1 -0
- package/dist/purchases/purchase-orders/index.js +71 -0
- package/dist/purchases/purchase-orders/index.js.map +1 -0
- package/dist/purchases/purchase-orders/type.d.ts +182 -0
- package/dist/purchases/purchase-orders/type.d.ts.map +1 -0
- package/dist/purchases/purchase-orders/type.js +4 -0
- package/dist/purchases/purchase-orders/type.js.map +1 -0
- package/dist/purchases/refunds/index.d.ts +51 -0
- package/dist/purchases/refunds/index.d.ts.map +1 -0
- package/dist/purchases/refunds/index.js +71 -0
- package/dist/purchases/refunds/index.js.map +1 -0
- package/dist/purchases/refunds/type.d.ts +181 -0
- package/dist/purchases/refunds/type.d.ts.map +1 -0
- package/dist/purchases/refunds/type.js +4 -0
- package/dist/purchases/refunds/type.js.map +1 -0
- package/dist/sales/credit-notes/index.d.ts +52 -0
- package/dist/sales/credit-notes/index.d.ts.map +1 -0
- package/dist/sales/credit-notes/index.js +72 -0
- package/dist/sales/credit-notes/index.js.map +1 -0
- package/dist/sales/credit-notes/type.d.ts +304 -0
- package/dist/sales/credit-notes/type.d.ts.map +1 -0
- package/dist/sales/credit-notes/type.js +4 -0
- package/dist/sales/credit-notes/type.js.map +1 -0
- package/dist/sales/delivery-orders/index.d.ts +51 -0
- package/dist/sales/delivery-orders/index.d.ts.map +1 -0
- package/dist/sales/delivery-orders/index.js +72 -0
- package/dist/sales/delivery-orders/index.js.map +1 -0
- package/dist/sales/delivery-orders/type.d.ts +212 -0
- package/dist/sales/delivery-orders/type.d.ts.map +1 -0
- package/dist/sales/delivery-orders/type.js +4 -0
- package/dist/sales/delivery-orders/type.js.map +1 -0
- package/dist/sales/index.d.ts +20 -0
- package/dist/sales/index.d.ts.map +1 -0
- package/dist/sales/index.js +24 -0
- package/dist/sales/index.js.map +1 -0
- package/dist/sales/invoices/index.d.ts +52 -0
- package/dist/sales/invoices/index.d.ts.map +1 -0
- package/dist/sales/invoices/index.js +73 -0
- package/dist/sales/invoices/index.js.map +1 -0
- package/dist/sales/invoices/type.d.ts +335 -0
- package/dist/sales/invoices/type.d.ts.map +1 -0
- package/dist/sales/invoices/type.js +4 -0
- package/dist/sales/invoices/type.js.map +1 -0
- package/dist/sales/payments/index.d.ts +52 -0
- package/dist/sales/payments/index.d.ts.map +1 -0
- package/dist/sales/payments/index.js +72 -0
- package/dist/sales/payments/index.js.map +1 -0
- package/dist/sales/payments/type.d.ts +242 -0
- package/dist/sales/payments/type.d.ts.map +1 -0
- package/dist/sales/payments/type.js +4 -0
- package/dist/sales/payments/type.js.map +1 -0
- package/dist/sales/quotations/index.d.ts +51 -0
- package/dist/sales/quotations/index.d.ts.map +1 -0
- package/dist/sales/quotations/index.js +71 -0
- package/dist/sales/quotations/index.js.map +1 -0
- package/dist/sales/quotations/type.d.ts +202 -0
- package/dist/sales/quotations/type.d.ts.map +1 -0
- package/dist/sales/quotations/type.js +3 -0
- package/dist/sales/quotations/type.js.map +1 -0
- package/dist/sales/refunds/index.d.ts +52 -0
- package/dist/sales/refunds/index.d.ts.map +1 -0
- package/dist/sales/refunds/index.js +72 -0
- package/dist/sales/refunds/index.js.map +1 -0
- package/dist/sales/refunds/type.d.ts +225 -0
- package/dist/sales/refunds/type.d.ts.map +1 -0
- package/dist/sales/refunds/type.js +4 -0
- package/dist/sales/refunds/type.js.map +1 -0
- package/dist/sales/sales-orders/index.d.ts +52 -0
- package/dist/sales/sales-orders/index.d.ts.map +1 -0
- package/dist/sales/sales-orders/index.js +72 -0
- package/dist/sales/sales-orders/index.js.map +1 -0
- package/dist/sales/sales-orders/type.d.ts +202 -0
- package/dist/sales/sales-orders/type.d.ts.map +1 -0
- package/dist/sales/sales-orders/type.js +4 -0
- package/dist/sales/sales-orders/type.js.map +1 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { BukkuEmailDetails, BukkuFileAttachment, BukkuListPagination, BukkuFormItem } from "../../common/type";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a form item for creating or updating a Bukku Delivery Order.
|
|
4
|
+
* Based on the detailed schema provided for `form_items`.
|
|
5
|
+
*/
|
|
6
|
+
export interface BukkuDeliveryOrderFormItemCreateParams {
|
|
7
|
+
/** The id of the item, required when you're updating an item. */
|
|
8
|
+
id?: number;
|
|
9
|
+
/** The transferred item's id, required for transfer items. Obtained from the to be transferred transaction's form_item's ID. */
|
|
10
|
+
transfer_item_id?: number;
|
|
11
|
+
/** The type of the item, leave null for normal item. */
|
|
12
|
+
type?: null | "bundle" | "subtitle" | "subtotal";
|
|
13
|
+
/** The account of the item, required for normal item. (Potentially not applicable for DO if purely inventory) */
|
|
14
|
+
account_id?: number;
|
|
15
|
+
/** The description of the item, required for normal / bundle & subtitle items. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** The service date of the item, following format YYYY-MM-DD. */
|
|
18
|
+
service_date?: string;
|
|
19
|
+
/** The product of the item. */
|
|
20
|
+
product_id?: number;
|
|
21
|
+
/** The product unit / UOM of the product, leave blank to use the product's default unit. */
|
|
22
|
+
product_unit_id?: number;
|
|
23
|
+
/** The location of the product, used for inventory product, leave blank to use the system default location. */
|
|
24
|
+
location_id?: number;
|
|
25
|
+
/** The unit price of the item, supports up to 4 decimal points. (May not be relevant for DO if not priced) */
|
|
26
|
+
unit_price?: number;
|
|
27
|
+
/** The quantity of the item, supports up to 4 decimal points, required for normal items. */
|
|
28
|
+
quantity?: number;
|
|
29
|
+
/** The discount of the item. (May not be relevant for DO) */
|
|
30
|
+
discount?: string;
|
|
31
|
+
/** The tax code of the item. (May not be relevant for DO) */
|
|
32
|
+
tax_code_id?: number;
|
|
33
|
+
/** The child items, used by bundle. */
|
|
34
|
+
children?: BukkuDeliveryOrderFormItemCreateParams[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parameters for creating a Bukku Delivery Order.
|
|
38
|
+
* Based on POST /sales/delivery_orders
|
|
39
|
+
*/
|
|
40
|
+
export interface BukkuDeliveryOrderCreateParams {
|
|
41
|
+
contact_id: number;
|
|
42
|
+
number?: string;
|
|
43
|
+
number2?: string;
|
|
44
|
+
date: string;
|
|
45
|
+
currency_code: string;
|
|
46
|
+
exchange_rate: number;
|
|
47
|
+
billing_party?: string;
|
|
48
|
+
show_shipping?: boolean;
|
|
49
|
+
shipping_party?: string;
|
|
50
|
+
shipping_info?: string;
|
|
51
|
+
tag_ids?: number[];
|
|
52
|
+
title?: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
remarks?: string;
|
|
55
|
+
tax_mode: "inclusive" | "exclusive";
|
|
56
|
+
form_items: Array<BukkuDeliveryOrderFormItemCreateParams>;
|
|
57
|
+
status: "draft" | "pending_approval" | "ready";
|
|
58
|
+
email?: BukkuEmailDetails;
|
|
59
|
+
files?: Array<BukkuFileAttachment>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Represents a Bukku Delivery Order object as returned by the API.
|
|
63
|
+
* This is a general structure and should be verified with actual API responses.
|
|
64
|
+
*/
|
|
65
|
+
export interface BukkuDeliveryOrder {
|
|
66
|
+
id: number;
|
|
67
|
+
contact_id: number;
|
|
68
|
+
contact_name: string;
|
|
69
|
+
number: string;
|
|
70
|
+
number2?: string;
|
|
71
|
+
date: string;
|
|
72
|
+
currency_code: string;
|
|
73
|
+
currency_symbol: string;
|
|
74
|
+
exchange_rate: number;
|
|
75
|
+
billing_party?: string;
|
|
76
|
+
show_shipping?: boolean;
|
|
77
|
+
shipping_info?: string;
|
|
78
|
+
shipping_party?: string;
|
|
79
|
+
tag_ids?: number[];
|
|
80
|
+
tag_names?: string[];
|
|
81
|
+
term_id?: number;
|
|
82
|
+
term_name?: string;
|
|
83
|
+
title: string | null;
|
|
84
|
+
description?: string;
|
|
85
|
+
remarks?: string;
|
|
86
|
+
tax_mode: "inclusive" | "exclusive";
|
|
87
|
+
form_items: BukkuFormItem[];
|
|
88
|
+
amount?: number;
|
|
89
|
+
status: string;
|
|
90
|
+
type?: string;
|
|
91
|
+
short_link: string;
|
|
92
|
+
files: BukkuDeliveryOrderFileEntry[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Represents the detailed file information within a Bukku Delivery Order's file entry.
|
|
96
|
+
*/
|
|
97
|
+
export interface BukkuDeliveryOrderFileDetail {
|
|
98
|
+
id: number;
|
|
99
|
+
url: string;
|
|
100
|
+
filename: string;
|
|
101
|
+
mime_type: string;
|
|
102
|
+
size: number;
|
|
103
|
+
created_at: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Represents a file entry attached to a Bukku Delivery Order.
|
|
107
|
+
* This structure is specific to how files are returned in the DO sample response.
|
|
108
|
+
*/
|
|
109
|
+
export interface BukkuDeliveryOrderFileEntry {
|
|
110
|
+
id: number;
|
|
111
|
+
file_id: number;
|
|
112
|
+
file: BukkuDeliveryOrderFileDetail[];
|
|
113
|
+
is_shared: boolean;
|
|
114
|
+
created_at: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Represents the API response structure when a delivery order is created or retrieved.
|
|
118
|
+
*/
|
|
119
|
+
export interface BukkuDeliveryOrderResponse {
|
|
120
|
+
transaction: BukkuDeliveryOrder;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Parameters for updating a Bukku Delivery Order.
|
|
124
|
+
* Based on PUT /sales/delivery_orders/{transactionId}
|
|
125
|
+
* 'status' is typically managed by a separate PATCH endpoint.
|
|
126
|
+
*/
|
|
127
|
+
export interface BukkuDeliveryOrderUpdateParams {
|
|
128
|
+
contact_id: number;
|
|
129
|
+
number: string;
|
|
130
|
+
number2?: string;
|
|
131
|
+
date: string;
|
|
132
|
+
currency_code: string;
|
|
133
|
+
exchange_rate: number;
|
|
134
|
+
billing_party?: string;
|
|
135
|
+
show_shipping?: boolean;
|
|
136
|
+
shipping_party?: string;
|
|
137
|
+
shipping_info?: string;
|
|
138
|
+
tag_ids?: number[];
|
|
139
|
+
title?: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
remarks?: string;
|
|
142
|
+
tax_mode: "inclusive" | "exclusive";
|
|
143
|
+
form_items: Array<BukkuDeliveryOrderFormItemCreateParams>;
|
|
144
|
+
email?: BukkuEmailDetails;
|
|
145
|
+
files?: Array<BukkuFileAttachment>;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Parameters for updating the status of a Bukku Delivery Order.
|
|
149
|
+
* Based on PATCH /sales/delivery_orders/{transactionId} request body schema.
|
|
150
|
+
*/
|
|
151
|
+
export interface BukkuDeliveryOrderStatusUpdateParams {
|
|
152
|
+
/** The new status for the delivery order. */
|
|
153
|
+
status: "ready" | "draft" | "pending_approval" | "void";
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Parameters for listing Bukku Delivery Orders (GET /sales/delivery_orders).
|
|
157
|
+
* Refined based on the provided API documentation for list parameters.
|
|
158
|
+
*/
|
|
159
|
+
export interface BukkuDeliveryOrderListParams {
|
|
160
|
+
search?: string;
|
|
161
|
+
custom_search?: string;
|
|
162
|
+
contact_id?: number;
|
|
163
|
+
date_from?: string;
|
|
164
|
+
date_to?: string;
|
|
165
|
+
/** Search by status, default to All but Void. */
|
|
166
|
+
status?: "all" | "draft" | "pending_approval" | "ready" | "void";
|
|
167
|
+
email_status?: "UNSENT" | "PENDING" | "SENT" | "BOUNCED" | "OPENED" | "VIEWED";
|
|
168
|
+
transfer_status?: "ALL" | "NOT_TRANSFERRED" | "PARTIAL_TRANSFERRED" | "TRANSFERRED";
|
|
169
|
+
page?: number;
|
|
170
|
+
page_size?: number;
|
|
171
|
+
sort_by?: "number" | "date" | "contact_name" | "number2" | "title" | "description" | "amount" | "created_at";
|
|
172
|
+
sort_dir?: "asc" | "desc";
|
|
173
|
+
[key: string]: any;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Represents a summary of a Bukku Delivery Order as it appears in a list.
|
|
177
|
+
* Refined based on the provided sample response for list items.
|
|
178
|
+
*/
|
|
179
|
+
export interface BukkuDeliveryOrderListItem {
|
|
180
|
+
id: number;
|
|
181
|
+
number: string;
|
|
182
|
+
number2: string;
|
|
183
|
+
contact_id: number;
|
|
184
|
+
contact_name: string;
|
|
185
|
+
contact_email: string;
|
|
186
|
+
date: string;
|
|
187
|
+
billing_party: string;
|
|
188
|
+
shipping_party: string;
|
|
189
|
+
tag_names?: string[];
|
|
190
|
+
title: string | null;
|
|
191
|
+
description: string;
|
|
192
|
+
currency_code: string;
|
|
193
|
+
currency_symbol: string;
|
|
194
|
+
exchange_rate: number;
|
|
195
|
+
amount: number;
|
|
196
|
+
status: string;
|
|
197
|
+
transfer_status: string;
|
|
198
|
+
email_status: string;
|
|
199
|
+
file_count: number;
|
|
200
|
+
short_link: string;
|
|
201
|
+
created_by: string;
|
|
202
|
+
created_at: string;
|
|
203
|
+
updated_at: string;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Represents the API response structure for listing delivery orders.
|
|
207
|
+
*/
|
|
208
|
+
export interface BukkuDeliveryOrderListApiResponse {
|
|
209
|
+
paging: BukkuListPagination;
|
|
210
|
+
transactions: BukkuDeliveryOrderListItem[];
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/sales/delivery-orders/type.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EAEnB,mBAAmB,EACnB,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD,iEAAiE;IACjE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gIAAgI;IAChI,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;IACjD,iHAAiH;IACjH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4FAA4F;IAC5F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+GAA+G;IAC/G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8GAA8G;IAC9G,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7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"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/sales/delivery-orders/type.ts"],"names":[],"mappings":";AAAA,oCAAoC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BukkuAPIRequestFunction } from "../types";
|
|
2
|
+
import { QuotationsAPI } from "./quotations";
|
|
3
|
+
import { SalesOrdersAPI } from "./sales-orders";
|
|
4
|
+
import { DeliveryOrdersAPI } from "./delivery-orders";
|
|
5
|
+
import { InvoicesAPI } from "./invoices";
|
|
6
|
+
import { CreditNotesAPI } from "./credit-notes";
|
|
7
|
+
import { PaymentsAPI } from "./payments";
|
|
8
|
+
import { RefundsAPI } from "./refunds";
|
|
9
|
+
export declare class SalesAPI {
|
|
10
|
+
private _request;
|
|
11
|
+
readonly quotations: QuotationsAPI;
|
|
12
|
+
readonly salesOrders: SalesOrdersAPI;
|
|
13
|
+
readonly deliveryOrders: DeliveryOrdersAPI;
|
|
14
|
+
readonly invoices: InvoicesAPI;
|
|
15
|
+
readonly creditNotes: CreditNotesAPI;
|
|
16
|
+
readonly payments: PaymentsAPI;
|
|
17
|
+
readonly refunds: RefundsAPI;
|
|
18
|
+
constructor(_request: BukkuAPIRequestFunction);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sales/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,qBAAa,QAAQ;IASP,OAAO,CAAC,QAAQ;IAR5B,SAAgB,UAAU,EAAE,aAAa,CAAC;IAC1C,SAAgB,WAAW,EAAE,cAAc,CAAC;IAC5C,SAAgB,cAAc,EAAE,iBAAiB,CAAC;IAClD,SAAgB,QAAQ,EAAE,WAAW,CAAC;IACtC,SAAgB,WAAW,EAAE,cAAc,CAAC;IAC5C,SAAgB,QAAQ,EAAE,WAAW,CAAC;IACtC,SAAgB,OAAO,EAAE,UAAU,CAAC;gBAEhB,QAAQ,EAAE,uBAAuB;CAkBtD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SalesAPI = void 0;
|
|
4
|
+
const quotations_1 = require("./quotations");
|
|
5
|
+
const sales_orders_1 = require("./sales-orders");
|
|
6
|
+
const delivery_orders_1 = require("./delivery-orders");
|
|
7
|
+
const invoices_1 = require("./invoices"); // Assuming this will be created
|
|
8
|
+
const credit_notes_1 = require("./credit-notes");
|
|
9
|
+
const payments_1 = require("./payments");
|
|
10
|
+
const refunds_1 = require("./refunds");
|
|
11
|
+
class SalesAPI {
|
|
12
|
+
constructor(_request) {
|
|
13
|
+
this._request = _request;
|
|
14
|
+
this.quotations = new quotations_1.QuotationsAPI(this._request);
|
|
15
|
+
this.salesOrders = new sales_orders_1.SalesOrdersAPI(this._request);
|
|
16
|
+
this.deliveryOrders = new delivery_orders_1.DeliveryOrdersAPI(this._request);
|
|
17
|
+
this.invoices = new invoices_1.InvoicesAPI(this._request);
|
|
18
|
+
this.creditNotes = new credit_notes_1.CreditNotesAPI(this._request);
|
|
19
|
+
this.payments = new payments_1.PaymentsAPI(this._request);
|
|
20
|
+
this.refunds = new refunds_1.RefundsAPI(this._request);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.SalesAPI = SalesAPI;
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sales/index.ts"],"names":[],"mappings":";;;AAEA,6CAA6C;AAC7C,iDAAgD;AAChD,uDAAsD;AACtD,yCAAyC,CAAC,gCAAgC;AAC1E,iDAAgD;AAChD,yCAAyC;AACzC,uCAAuC;AAEvC,MAAa,QAAQ;IASnB,YAAoB,QAAiC;QAAjC,aAAQ,GAAR,QAAQ,CAAyB;QACnD,IAAI,CAAC,UAAU,GAAG,IAAI,0BAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,CAAC,WAAW,GAAG,IAAI,6BAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,GAAG,IAAI,mCAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3D,IAAI,CAAC,QAAQ,GAAG,IAAI,sBAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,IAAI,6BAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,sBAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,IAAI,oBAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;CAUF;AA3BD,4BA2BC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { BukkuAPIRequestFunction } from "../../types";
|
|
2
|
+
import { BukkuInvoice, BukkuInvoiceCreateParams, BukkuInvoiceListParams, BukkuInvoiceListApiResponse, BukkuInvoiceUpdateParams, BukkuInvoiceStatusUpdateParams } from "./type";
|
|
3
|
+
export declare class InvoicesAPI {
|
|
4
|
+
private _request;
|
|
5
|
+
constructor(_request: BukkuAPIRequestFunction);
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new invoice.
|
|
8
|
+
* Endpoint: POST /sales/invoices
|
|
9
|
+
* @param data - The data for the new invoice.
|
|
10
|
+
* @returns A promise that resolves to the created invoice.
|
|
11
|
+
*/
|
|
12
|
+
create(data: BukkuInvoiceCreateParams): Promise<BukkuInvoice>;
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves a paginated list of invoices.
|
|
15
|
+
* Endpoint: GET /sales/invoices
|
|
16
|
+
* @param params - Optional parameters for filtering and pagination.
|
|
17
|
+
* @returns A promise that resolves to the API response for listing invoices.
|
|
18
|
+
*/
|
|
19
|
+
list(params?: BukkuInvoiceListParams): Promise<BukkuInvoiceListApiResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves a specific invoice by its ID.
|
|
22
|
+
* Endpoint: GET /sales/invoices/{id}
|
|
23
|
+
* @param id - The ID of the invoice to retrieve.
|
|
24
|
+
* @returns A promise that resolves to the invoice.
|
|
25
|
+
*/
|
|
26
|
+
get(id: string | number): Promise<BukkuInvoice>;
|
|
27
|
+
/**
|
|
28
|
+
* Updates an existing invoice.
|
|
29
|
+
* Endpoint: PUT /sales/invoices/{id}
|
|
30
|
+
* @param id - The ID of the invoice to update.
|
|
31
|
+
* @param data - The data to update the invoice with.
|
|
32
|
+
* @returns A promise that resolves to the updated invoice.
|
|
33
|
+
*/
|
|
34
|
+
update(id: string | number, data: BukkuInvoiceUpdateParams): Promise<BukkuInvoice>;
|
|
35
|
+
/**
|
|
36
|
+
* Deletes an invoice.
|
|
37
|
+
* Endpoint: DELETE /sales/invoices/{id}
|
|
38
|
+
* Note: Only transactions with draft and void statuses can be deleted.
|
|
39
|
+
* @param id - The ID of the invoice to delete.
|
|
40
|
+
* @returns A promise that resolves when the invoice is deleted.
|
|
41
|
+
*/
|
|
42
|
+
delete(id: string | number): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Updates the status of an existing invoice.
|
|
45
|
+
* Endpoint: PATCH /sales/invoices/{id}
|
|
46
|
+
* @param id - The ID of the invoice to update.
|
|
47
|
+
* @param data - The data containing the new status.
|
|
48
|
+
* @returns A promise that resolves to the updated invoice.
|
|
49
|
+
*/
|
|
50
|
+
updateStatus(id: string | number, data: BukkuInvoiceStatusUpdateParams): Promise<BukkuInvoice>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sales/invoices/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,wBAAwB,EAExB,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,QAAQ,CAAC;AAEhB,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,uBAAuB;IAErD;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC;IASnE;;;;;OAKG;IACG,IAAI,CACR,MAAM,CAAC,EAAE,sBAAsB,GAC9B,OAAO,CAAC,2BAA2B,CAAC;IASvC;;;;;OAKG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAUrD;;;;;;OAMG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,YAAY,CAAC;IASxB;;;;;;OAMG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD;;;;;;OAMG;IACG,YAAY,CAChB,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,IAAI,EAAE,8BAA8B,GACnC,OAAO,CAAC,YAAY,CAAC;CAQzB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/sales/invoices/index.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.InvoicesAPI = void 0;
|
|
5
|
+
class InvoicesAPI {
|
|
6
|
+
constructor(_request) {
|
|
7
|
+
this._request = _request;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new invoice.
|
|
11
|
+
* Endpoint: POST /sales/invoices
|
|
12
|
+
* @param data - The data for the new invoice.
|
|
13
|
+
* @returns A promise that resolves to the created invoice.
|
|
14
|
+
*/
|
|
15
|
+
async create(data) {
|
|
16
|
+
const response = await this._request("/sales/invoices", "POST", data);
|
|
17
|
+
return response.transaction;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a paginated list of invoices.
|
|
21
|
+
* Endpoint: GET /sales/invoices
|
|
22
|
+
* @param params - Optional parameters for filtering and pagination.
|
|
23
|
+
* @returns A promise that resolves to the API response for listing invoices.
|
|
24
|
+
*/
|
|
25
|
+
async list(params) {
|
|
26
|
+
return this._request("/sales/invoices", "GET", undefined, params);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a specific invoice by its ID.
|
|
30
|
+
* Endpoint: GET /sales/invoices/{id}
|
|
31
|
+
* @param id - The ID of the invoice to retrieve.
|
|
32
|
+
* @returns A promise that resolves to the invoice.
|
|
33
|
+
*/
|
|
34
|
+
async get(id) {
|
|
35
|
+
const response = await this._request(`/sales/invoices/${id}`, "GET");
|
|
36
|
+
return response.transaction;
|
|
37
|
+
}
|
|
38
|
+
// --- Placeholder for other Invoice methods ---
|
|
39
|
+
/**
|
|
40
|
+
* Updates an existing invoice.
|
|
41
|
+
* Endpoint: PUT /sales/invoices/{id}
|
|
42
|
+
* @param id - The ID of the invoice to update.
|
|
43
|
+
* @param data - The data to update the invoice with.
|
|
44
|
+
* @returns A promise that resolves to the updated invoice.
|
|
45
|
+
*/
|
|
46
|
+
async update(id, data) {
|
|
47
|
+
const response = await this._request(`/sales/invoices/${id}`, "PUT", data);
|
|
48
|
+
return response.transaction;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Deletes an invoice.
|
|
52
|
+
* Endpoint: DELETE /sales/invoices/{id}
|
|
53
|
+
* Note: Only transactions with draft and void statuses can be deleted.
|
|
54
|
+
* @param id - The ID of the invoice to delete.
|
|
55
|
+
* @returns A promise that resolves when the invoice is deleted.
|
|
56
|
+
*/
|
|
57
|
+
async delete(id) {
|
|
58
|
+
await this._request(`/sales/invoices/${id}`, "DELETE");
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Updates the status of an existing invoice.
|
|
62
|
+
* Endpoint: PATCH /sales/invoices/{id}
|
|
63
|
+
* @param id - The ID of the invoice to update.
|
|
64
|
+
* @param data - The data containing the new status.
|
|
65
|
+
* @returns A promise that resolves to the updated invoice.
|
|
66
|
+
*/
|
|
67
|
+
async updateStatus(id, data) {
|
|
68
|
+
const response = await this._request(`/sales/invoices/${id}`, "PATCH", data);
|
|
69
|
+
return response.transaction;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.InvoicesAPI = InvoicesAPI;
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sales/invoices/index.ts"],"names":[],"mappings":";AAAA,8BAA8B;;;AAa9B,MAAa,WAAW;IACtB,YAAoB,QAAiC;QAAjC,aAAQ,GAAR,QAAQ,CAAyB;IAAG,CAAC;IAEzD;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CAAC,IAA8B;QACzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,iBAAiB,EACjB,MAAM,EACN,IAAI,CACL,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR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