@bibike/erp-sdk 1.0.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.
@@ -0,0 +1,748 @@
1
+ /**
2
+ * Bibike ERP SDK Types
3
+ */
4
+ interface ApiResponse<T> {
5
+ success: boolean;
6
+ data?: T;
7
+ message?: string;
8
+ error?: string;
9
+ code?: string;
10
+ }
11
+ interface PaginatedResponse<T> {
12
+ success: boolean;
13
+ data: T[];
14
+ pagination: {
15
+ page: number;
16
+ per_page: number;
17
+ total: number;
18
+ total_pages: number;
19
+ };
20
+ }
21
+ interface PaginationParams {
22
+ page?: number;
23
+ per_page?: number;
24
+ [key: string]: string | number | boolean | undefined;
25
+ }
26
+ interface DateRangeParams {
27
+ start_date?: string;
28
+ end_date?: string;
29
+ [key: string]: string | number | boolean | undefined;
30
+ }
31
+ interface LoginCredentials {
32
+ email: string;
33
+ password: string;
34
+ }
35
+ interface AuthResponse {
36
+ token: string;
37
+ user: User;
38
+ expires_at: string;
39
+ }
40
+ interface User {
41
+ id: number;
42
+ email: string;
43
+ full_name: string;
44
+ role: string;
45
+ organization_id: number;
46
+ organization_name?: string;
47
+ permissions?: string[];
48
+ }
49
+ interface Product {
50
+ id: number;
51
+ organization_id: number;
52
+ name: string;
53
+ sku: string;
54
+ barcode?: string;
55
+ description?: string;
56
+ category?: string;
57
+ category_id?: number;
58
+ unit_id?: number;
59
+ unit_name?: string;
60
+ unit_price: number;
61
+ cost_price?: number;
62
+ reorder_level?: number;
63
+ is_active: boolean;
64
+ created_at: string;
65
+ updated_at?: string;
66
+ }
67
+ interface CreateProductInput {
68
+ name: string;
69
+ sku?: string;
70
+ barcode?: string;
71
+ description?: string;
72
+ category?: string;
73
+ category_id?: number;
74
+ unit_id?: number;
75
+ unit_price: number;
76
+ cost_price?: number;
77
+ reorder_level?: number;
78
+ }
79
+ interface UpdateProductInput extends Partial<CreateProductInput> {
80
+ is_active?: boolean;
81
+ }
82
+ interface InventoryItem {
83
+ id: number;
84
+ product_id: number;
85
+ product_name: string;
86
+ sku: string;
87
+ warehouse_id?: number;
88
+ warehouse_name?: string;
89
+ shop_id?: number;
90
+ shop_name?: string;
91
+ quantity: number;
92
+ reorder_level?: number;
93
+ }
94
+ interface StockTransfer {
95
+ id: number;
96
+ transfer_number: string;
97
+ from_warehouse_id?: number;
98
+ from_shop_id?: number;
99
+ to_warehouse_id?: number;
100
+ to_shop_id?: number;
101
+ status: 'pending' | 'approved' | 'completed' | 'cancelled';
102
+ notes?: string;
103
+ created_at: string;
104
+ items?: StockTransferItem[];
105
+ }
106
+ interface StockTransferItem {
107
+ product_id: number;
108
+ quantity: number;
109
+ }
110
+ interface CreateTransferInput {
111
+ from_warehouse_id?: number;
112
+ from_shop_id?: number;
113
+ to_warehouse_id?: number;
114
+ to_shop_id?: number;
115
+ notes?: string;
116
+ items: StockTransferItem[];
117
+ }
118
+ interface StockAdjustment {
119
+ id: number;
120
+ product_id: number;
121
+ warehouse_id?: number;
122
+ shop_id?: number;
123
+ quantity: number;
124
+ adjustment_type: 'increase' | 'decrease';
125
+ reason: string;
126
+ notes?: string;
127
+ created_at: string;
128
+ }
129
+ interface CreateAdjustmentInput {
130
+ product_id: number;
131
+ warehouse_id?: number;
132
+ shop_id?: number;
133
+ quantity: number;
134
+ adjustment_type: 'increase' | 'decrease';
135
+ reason: string;
136
+ notes?: string;
137
+ }
138
+ interface Sale {
139
+ id: number;
140
+ sale_number: string;
141
+ customer_id?: number;
142
+ customer_name?: string;
143
+ total_amount: number;
144
+ discount_amount?: number;
145
+ tax_amount?: number;
146
+ payment_method?: string;
147
+ payment_status: 'pending' | 'partial' | 'paid';
148
+ status: 'draft' | 'completed' | 'voided';
149
+ sale_date: string;
150
+ notes?: string;
151
+ created_at: string;
152
+ items?: SaleItem[];
153
+ }
154
+ interface SaleItem {
155
+ product_id: number;
156
+ product_name?: string;
157
+ quantity: number;
158
+ unit_price: number;
159
+ discount?: number;
160
+ total: number;
161
+ }
162
+ interface CreateSaleInput {
163
+ customer_id?: number;
164
+ warehouse_id?: number;
165
+ shop_id?: number;
166
+ payment_method?: string;
167
+ discount_amount?: number;
168
+ notes?: string;
169
+ sale_date?: string;
170
+ items: Array<{
171
+ product_id: number;
172
+ quantity: number;
173
+ unit_price?: number;
174
+ discount?: number;
175
+ }>;
176
+ }
177
+ interface Quotation {
178
+ id: number;
179
+ quotation_number: string;
180
+ customer_id?: number;
181
+ customer_name?: string;
182
+ total_amount: number;
183
+ status: 'draft' | 'sent' | 'accepted' | 'rejected' | 'expired';
184
+ valid_until?: string;
185
+ created_at: string;
186
+ items?: SaleItem[];
187
+ }
188
+ interface SalesOrder {
189
+ id: number;
190
+ order_number: string;
191
+ customer_id?: number;
192
+ customer_name?: string;
193
+ total_amount: number;
194
+ status: 'pending' | 'confirmed' | 'processing' | 'shipped' | 'delivered' | 'cancelled';
195
+ order_date: string;
196
+ items?: SaleItem[];
197
+ }
198
+ interface Customer {
199
+ id: number;
200
+ organization_id: number;
201
+ name: string;
202
+ email?: string;
203
+ phone?: string;
204
+ address?: string;
205
+ tin?: string;
206
+ credit_limit?: number;
207
+ balance?: number;
208
+ is_active: boolean;
209
+ created_at: string;
210
+ }
211
+ interface CreateCustomerInput {
212
+ name: string;
213
+ email?: string;
214
+ phone?: string;
215
+ address?: string;
216
+ tin?: string;
217
+ credit_limit?: number;
218
+ }
219
+ interface Supplier {
220
+ id: number;
221
+ organization_id: number;
222
+ name: string;
223
+ email?: string;
224
+ phone?: string;
225
+ address?: string;
226
+ tin?: string;
227
+ balance?: number;
228
+ is_active: boolean;
229
+ created_at: string;
230
+ }
231
+ interface CreateSupplierInput {
232
+ name: string;
233
+ email?: string;
234
+ phone?: string;
235
+ address?: string;
236
+ tin?: string;
237
+ }
238
+ interface PurchaseOrder {
239
+ id: number;
240
+ order_number: string;
241
+ supplier_id: number;
242
+ supplier_name?: string;
243
+ total_amount: number;
244
+ status: 'draft' | 'pending' | 'approved' | 'submitted' | 'received' | 'cancelled';
245
+ order_date: string;
246
+ expected_date?: string;
247
+ items?: PurchaseOrderItem[];
248
+ }
249
+ interface PurchaseOrderItem {
250
+ product_id: number;
251
+ product_name?: string;
252
+ quantity: number;
253
+ unit_price: number;
254
+ total: number;
255
+ }
256
+ interface CreatePurchaseOrderInput {
257
+ supplier_id: number;
258
+ warehouse_id?: number;
259
+ expected_date?: string;
260
+ notes?: string;
261
+ items: Array<{
262
+ product_id: number;
263
+ quantity: number;
264
+ unit_price: number;
265
+ }>;
266
+ }
267
+ interface PurchaseRequisition {
268
+ id: number;
269
+ requisition_number: string;
270
+ status: 'draft' | 'pending' | 'approved' | 'rejected' | 'ordered';
271
+ priority: 'low' | 'normal' | 'high' | 'urgent';
272
+ requested_by: number;
273
+ approved_by?: number;
274
+ notes?: string;
275
+ created_at: string;
276
+ items?: Array<{
277
+ product_id: number;
278
+ quantity: number;
279
+ notes?: string;
280
+ }>;
281
+ }
282
+ interface Account {
283
+ id: number;
284
+ code: string;
285
+ name: string;
286
+ type: 'asset' | 'liability' | 'equity' | 'revenue' | 'expense';
287
+ parent_id?: number;
288
+ opening_balance: number;
289
+ current_balance: number;
290
+ is_active: boolean;
291
+ }
292
+ interface JournalEntry {
293
+ id: number;
294
+ entry_number: string;
295
+ entry_date: string;
296
+ description: string;
297
+ status: 'draft' | 'posted' | 'voided';
298
+ total_debit: number;
299
+ total_credit: number;
300
+ lines?: JournalLine[];
301
+ }
302
+ interface JournalLine {
303
+ account_id: number;
304
+ account_name?: string;
305
+ debit: number;
306
+ credit: number;
307
+ description?: string;
308
+ }
309
+ interface CreateJournalEntryInput {
310
+ entry_date: string;
311
+ description: string;
312
+ lines: Array<{
313
+ account_id: number;
314
+ debit: number;
315
+ credit: number;
316
+ description?: string;
317
+ }>;
318
+ }
319
+ interface TaxRate {
320
+ id: number;
321
+ name: string;
322
+ rate: number;
323
+ type: 'vat' | 'wht' | 'other';
324
+ is_active: boolean;
325
+ }
326
+ interface Employee {
327
+ id: number;
328
+ employee_number: string;
329
+ full_name: string;
330
+ email?: string;
331
+ phone?: string;
332
+ department_id?: number;
333
+ department_name?: string;
334
+ position_id?: number;
335
+ position_name?: string;
336
+ hire_date: string;
337
+ employment_status: 'active' | 'on_leave' | 'suspended' | 'terminated';
338
+ employment_type: 'full_time' | 'part_time' | 'contract' | 'intern';
339
+ basic_salary?: number;
340
+ }
341
+ interface Department {
342
+ id: number;
343
+ name: string;
344
+ description?: string;
345
+ manager_id?: number;
346
+ }
347
+ interface Position {
348
+ id: number;
349
+ name: string;
350
+ department_id?: number;
351
+ min_salary?: number;
352
+ max_salary?: number;
353
+ }
354
+ interface Attendance {
355
+ id: number;
356
+ employee_id: number;
357
+ employee_name?: string;
358
+ date: string;
359
+ check_in?: string;
360
+ check_out?: string;
361
+ status: 'present' | 'absent' | 'late' | 'half_day' | 'on_leave';
362
+ }
363
+ interface LeaveRequest {
364
+ id: number;
365
+ employee_id: number;
366
+ employee_name?: string;
367
+ leave_type_id: number;
368
+ leave_type_name?: string;
369
+ start_date: string;
370
+ end_date: string;
371
+ days: number;
372
+ status: 'pending' | 'approved' | 'rejected' | 'cancelled';
373
+ reason?: string;
374
+ }
375
+ interface Lead {
376
+ id: number;
377
+ lead_number: string;
378
+ name: string;
379
+ email?: string;
380
+ phone?: string;
381
+ company?: string;
382
+ source?: string;
383
+ status: 'new' | 'contacted' | 'qualified' | 'converted' | 'lost';
384
+ assigned_to?: number;
385
+ created_at: string;
386
+ }
387
+ interface Opportunity {
388
+ id: number;
389
+ opportunity_number: string;
390
+ name: string;
391
+ customer_id?: number;
392
+ customer_name?: string;
393
+ value: number;
394
+ stage_id?: number;
395
+ stage_name?: string;
396
+ probability?: number;
397
+ expected_close_date?: string;
398
+ is_won?: boolean;
399
+ owner_id?: number;
400
+ }
401
+ interface Activity {
402
+ id: number;
403
+ activity_number: string;
404
+ type: 'call' | 'email' | 'meeting' | 'task' | 'note';
405
+ subject: string;
406
+ description?: string;
407
+ due_date?: string;
408
+ status: 'pending' | 'completed' | 'cancelled';
409
+ assigned_to?: number;
410
+ opportunity_id?: number;
411
+ customer_id?: number;
412
+ }
413
+ interface Webhook {
414
+ id: number;
415
+ url: string;
416
+ events: string[];
417
+ is_active: boolean;
418
+ created_at: string;
419
+ recent_deliveries?: WebhookDelivery[];
420
+ }
421
+ interface WebhookDelivery {
422
+ id: number;
423
+ event: string;
424
+ status_code: number;
425
+ success: boolean;
426
+ created_at: string;
427
+ }
428
+ interface CreateWebhookInput {
429
+ url: string;
430
+ events: WebhookEvent[];
431
+ }
432
+ type WebhookEvent = 'sale.created' | 'sale.completed' | 'sale.voided' | 'inventory.stock_in' | 'inventory.stock_out' | 'inventory.low_stock' | 'purchase.created' | 'purchase.received' | 'customer.created' | 'customer.updated' | 'product.created' | 'product.updated';
433
+ interface POSSession {
434
+ id: number;
435
+ user_id: number;
436
+ cashier_name?: string;
437
+ warehouse_id?: number;
438
+ warehouse_name?: string;
439
+ shop_id?: number;
440
+ shop_name?: string;
441
+ opening_balance: number;
442
+ closing_balance?: number;
443
+ expected_balance?: number;
444
+ difference?: number;
445
+ status: 'open' | 'closed';
446
+ opened_at: string;
447
+ closed_at?: string;
448
+ sales?: Sale[];
449
+ }
450
+ interface SalesReport {
451
+ periods: Array<{
452
+ period: string;
453
+ sales_count: number;
454
+ total_sales: number;
455
+ total_discounts: number;
456
+ avg_sale: number;
457
+ }>;
458
+ totals: {
459
+ total_count: number;
460
+ total_amount: number;
461
+ total_discounts: number;
462
+ };
463
+ filters: {
464
+ start_date: string;
465
+ end_date: string;
466
+ group_by: string;
467
+ };
468
+ }
469
+ interface InventoryReport {
470
+ summary: {
471
+ total_products: number;
472
+ total_quantity: number;
473
+ total_cost_value: number;
474
+ total_retail_value: number;
475
+ };
476
+ low_stock_count: number;
477
+ out_of_stock_count: number;
478
+ }
479
+ interface ProfitLossReport {
480
+ revenue: number;
481
+ cost_of_goods_sold: number;
482
+ gross_profit: number;
483
+ gross_margin: number;
484
+ purchases: number;
485
+ net_profit: number;
486
+ period: {
487
+ start_date: string;
488
+ end_date: string;
489
+ };
490
+ }
491
+ interface DashboardStats {
492
+ today_sales: {
493
+ count: number;
494
+ total: number;
495
+ };
496
+ month_sales: {
497
+ count: number;
498
+ total: number;
499
+ };
500
+ low_stock_count: number;
501
+ pending_orders: number;
502
+ }
503
+ interface Warehouse {
504
+ id: number;
505
+ name: string;
506
+ address?: string;
507
+ is_active: boolean;
508
+ }
509
+ interface Shop {
510
+ id: number;
511
+ name: string;
512
+ address?: string;
513
+ is_active: boolean;
514
+ }
515
+ interface Location {
516
+ id: number;
517
+ name: string;
518
+ type_id: number;
519
+ type_name?: string;
520
+ address?: string;
521
+ is_active: boolean;
522
+ }
523
+
524
+ /**
525
+ * Bibike ERP SDK Client
526
+ */
527
+
528
+ interface BibikeConfig {
529
+ baseUrl: string;
530
+ token?: string;
531
+ timeout?: number;
532
+ headers?: Record<string, string>;
533
+ }
534
+ declare class BibikeClient {
535
+ private baseUrl;
536
+ private token;
537
+ private timeout;
538
+ private customHeaders;
539
+ constructor(config: BibikeConfig);
540
+ login(credentials: LoginCredentials): Promise<AuthResponse>;
541
+ logout(): Promise<void>;
542
+ me(): Promise<User>;
543
+ setToken(token: string): void;
544
+ readonly products: {
545
+ list: (params?: PaginationParams & {
546
+ search?: string;
547
+ category?: string;
548
+ }) => Promise<ApiResponse<Product[]>>;
549
+ get: (id: number) => Promise<ApiResponse<Product>>;
550
+ create: (data: CreateProductInput) => Promise<ApiResponse<Product>>;
551
+ update: (id: number, data: UpdateProductInput) => Promise<ApiResponse<Product>>;
552
+ delete: (id: number) => Promise<ApiResponse<unknown>>;
553
+ search: (query: string) => Promise<ApiResponse<Product[]>>;
554
+ };
555
+ readonly inventory: {
556
+ list: (params?: {
557
+ warehouse_id?: number;
558
+ shop_id?: number;
559
+ low_stock?: boolean;
560
+ }) => Promise<ApiResponse<InventoryItem[]>>;
561
+ transfers: () => Promise<ApiResponse<StockTransfer[]>>;
562
+ createTransfer: (data: CreateTransferInput) => Promise<ApiResponse<StockTransfer>>;
563
+ approveTransfer: (id: number) => Promise<ApiResponse<unknown>>;
564
+ adjustments: () => Promise<ApiResponse<StockAdjustment[]>>;
565
+ createAdjustment: (data: CreateAdjustmentInput) => Promise<ApiResponse<StockAdjustment>>;
566
+ lowStock: () => Promise<ApiResponse<Product[]>>;
567
+ outOfStock: () => Promise<ApiResponse<Product[]>>;
568
+ valuation: () => Promise<ApiResponse<unknown>>;
569
+ movementHistory: (params?: DateRangeParams & {
570
+ product_id?: number;
571
+ }) => Promise<ApiResponse<unknown>>;
572
+ };
573
+ readonly sales: {
574
+ list: (params?: PaginationParams & DateRangeParams & {
575
+ customer_id?: number;
576
+ }) => Promise<ApiResponse<Sale[]>>;
577
+ get: (id: number) => Promise<ApiResponse<Sale>>;
578
+ create: (data: CreateSaleInput) => Promise<ApiResponse<Sale>>;
579
+ quotations: (params?: PaginationParams & {
580
+ status?: string;
581
+ }) => Promise<ApiResponse<Quotation[]>>;
582
+ createQuotation: (data: CreateSaleInput & {
583
+ valid_until?: string;
584
+ }) => Promise<ApiResponse<Quotation>>;
585
+ orders: (params?: PaginationParams & {
586
+ status?: string;
587
+ }) => Promise<ApiResponse<SalesOrder[]>>;
588
+ createOrder: (data: CreateSaleInput) => Promise<ApiResponse<SalesOrder>>;
589
+ analytics: (params?: DateRangeParams) => Promise<ApiResponse<unknown>>;
590
+ };
591
+ readonly customers: {
592
+ list: (params?: PaginationParams & {
593
+ search?: string;
594
+ }) => Promise<ApiResponse<Customer[]>>;
595
+ get: (id: number) => Promise<ApiResponse<Customer>>;
596
+ create: (data: CreateCustomerInput) => Promise<ApiResponse<Customer>>;
597
+ update: (id: number, data: Partial<CreateCustomerInput>) => Promise<ApiResponse<Customer>>;
598
+ delete: (id: number) => Promise<ApiResponse<unknown>>;
599
+ balance: (id: number) => Promise<ApiResponse<{
600
+ balance: number;
601
+ }>>;
602
+ };
603
+ readonly suppliers: {
604
+ list: (params?: PaginationParams & {
605
+ search?: string;
606
+ }) => Promise<ApiResponse<Supplier[]>>;
607
+ get: (id: number) => Promise<ApiResponse<Supplier>>;
608
+ create: (data: CreateSupplierInput) => Promise<ApiResponse<Supplier>>;
609
+ update: (id: number, data: Partial<CreateSupplierInput>) => Promise<ApiResponse<Supplier>>;
610
+ delete: (id: number) => Promise<ApiResponse<unknown>>;
611
+ };
612
+ readonly purchasing: {
613
+ orders: (params?: PaginationParams & {
614
+ status?: string;
615
+ supplier_id?: number;
616
+ }) => Promise<ApiResponse<PurchaseOrder[]>>;
617
+ getOrder: (id: number) => Promise<ApiResponse<PurchaseOrder>>;
618
+ createOrder: (data: CreatePurchaseOrderInput) => Promise<ApiResponse<PurchaseOrder>>;
619
+ approveOrder: (id: number) => Promise<ApiResponse<unknown>>;
620
+ requisitions: (params?: PaginationParams & {
621
+ status?: string;
622
+ }) => Promise<ApiResponse<PurchaseRequisition[]>>;
623
+ createRequisition: (data: {
624
+ items: Array<{
625
+ product_id: number;
626
+ quantity: number;
627
+ }>;
628
+ }) => Promise<ApiResponse<PurchaseRequisition>>;
629
+ analytics: (params?: DateRangeParams) => Promise<ApiResponse<unknown>>;
630
+ };
631
+ readonly accounting: {
632
+ accounts: (params?: {
633
+ type?: string;
634
+ is_active?: boolean;
635
+ }) => Promise<ApiResponse<Account[]>>;
636
+ getAccount: (id: number) => Promise<ApiResponse<Account>>;
637
+ createAccount: (data: {
638
+ code: string;
639
+ name: string;
640
+ type: string;
641
+ parent_id?: number;
642
+ }) => Promise<ApiResponse<Account>>;
643
+ journals: (params?: PaginationParams & {
644
+ status?: string;
645
+ }) => Promise<ApiResponse<JournalEntry[]>>;
646
+ getJournal: (id: number) => Promise<ApiResponse<JournalEntry>>;
647
+ createJournal: (data: CreateJournalEntryInput) => Promise<ApiResponse<JournalEntry>>;
648
+ postJournal: (id: number) => Promise<ApiResponse<unknown>>;
649
+ trialBalance: (asOfDate?: string) => Promise<ApiResponse<unknown>>;
650
+ taxRates: () => Promise<ApiResponse<TaxRate[]>>;
651
+ };
652
+ readonly hr: {
653
+ employees: (params?: PaginationParams & {
654
+ department_id?: number;
655
+ status?: string;
656
+ }) => Promise<ApiResponse<Employee[]>>;
657
+ getEmployee: (id: number) => Promise<ApiResponse<Employee>>;
658
+ createEmployee: (data: Partial<Employee>) => Promise<ApiResponse<Employee>>;
659
+ departments: () => Promise<ApiResponse<Department[]>>;
660
+ positions: () => Promise<ApiResponse<Position[]>>;
661
+ attendance: (params?: DateRangeParams & {
662
+ employee_id?: number;
663
+ }) => Promise<ApiResponse<Attendance[]>>;
664
+ clockIn: (employeeId: number) => Promise<ApiResponse<unknown>>;
665
+ clockOut: (employeeId: number) => Promise<ApiResponse<unknown>>;
666
+ leaveRequests: (params?: {
667
+ employee_id?: number;
668
+ status?: string;
669
+ }) => Promise<ApiResponse<LeaveRequest[]>>;
670
+ approveLeave: (id: number) => Promise<ApiResponse<unknown>>;
671
+ };
672
+ readonly crm: {
673
+ leads: (params?: PaginationParams & {
674
+ status?: string;
675
+ assigned_to?: number;
676
+ }) => Promise<ApiResponse<Lead[]>>;
677
+ getLead: (id: number) => Promise<ApiResponse<Lead>>;
678
+ createLead: (data: Partial<Lead>) => Promise<ApiResponse<Lead>>;
679
+ convertLead: (id: number) => Promise<ApiResponse<unknown>>;
680
+ opportunities: (params?: PaginationParams & {
681
+ stage_id?: number;
682
+ }) => Promise<ApiResponse<Opportunity[]>>;
683
+ getOpportunity: (id: number) => Promise<ApiResponse<Opportunity>>;
684
+ createOpportunity: (data: Partial<Opportunity>) => Promise<ApiResponse<Opportunity>>;
685
+ activities: (params?: {
686
+ type?: string;
687
+ status?: string;
688
+ opportunity_id?: number;
689
+ }) => Promise<ApiResponse<Activity[]>>;
690
+ createActivity: (data: Partial<Activity>) => Promise<ApiResponse<Activity>>;
691
+ pipeline: () => Promise<ApiResponse<unknown>>;
692
+ };
693
+ readonly webhooks: {
694
+ list: () => Promise<ApiResponse<Webhook[]>>;
695
+ get: (id: number) => Promise<ApiResponse<Webhook>>;
696
+ create: (data: CreateWebhookInput) => Promise<ApiResponse<{
697
+ id: number;
698
+ secret: string;
699
+ }>>;
700
+ update: (id: number, data: {
701
+ url?: string;
702
+ events?: string[];
703
+ is_active?: boolean;
704
+ }) => Promise<ApiResponse<unknown>>;
705
+ delete: (id: number) => Promise<ApiResponse<unknown>>;
706
+ logs: (id: number) => Promise<ApiResponse<unknown>>;
707
+ test: (id: number) => Promise<ApiResponse<unknown>>;
708
+ };
709
+ readonly pos: {
710
+ sessions: () => Promise<ApiResponse<POSSession[]>>;
711
+ getSession: (id: number) => Promise<ApiResponse<POSSession>>;
712
+ openSession: (data: {
713
+ warehouse_id?: number;
714
+ shop_id?: number;
715
+ opening_balance?: number;
716
+ }) => Promise<ApiResponse<{
717
+ id: number;
718
+ }>>;
719
+ closeSession: (id: number, data: {
720
+ closing_balance: number;
721
+ notes?: string;
722
+ }) => Promise<ApiResponse<unknown>>;
723
+ };
724
+ readonly reports: {
725
+ sales: (params?: DateRangeParams & {
726
+ group_by?: "day" | "week" | "month";
727
+ }) => Promise<ApiResponse<SalesReport>>;
728
+ inventory: () => Promise<ApiResponse<InventoryReport>>;
729
+ profitLoss: (params?: DateRangeParams) => Promise<ApiResponse<ProfitLossReport>>;
730
+ dashboard: () => Promise<ApiResponse<DashboardStats>>;
731
+ };
732
+ readonly locations: {
733
+ warehouses: () => Promise<ApiResponse<Warehouse[]>>;
734
+ shops: () => Promise<ApiResponse<Shop[]>>;
735
+ all: (params?: {
736
+ type_id?: number;
737
+ capability?: string;
738
+ }) => Promise<ApiResponse<Location[]>>;
739
+ };
740
+ private request;
741
+ }
742
+ declare class BibikeApiError extends Error {
743
+ readonly statusCode: number;
744
+ readonly code?: string | undefined;
745
+ constructor(message: string, statusCode: number, code?: string | undefined);
746
+ }
747
+
748
+ export { type Account, type Activity, type ApiResponse, type Attendance, type AuthResponse, BibikeApiError, BibikeClient, type BibikeConfig, type CreateAdjustmentInput, type CreateCustomerInput, type CreateJournalEntryInput, type CreateProductInput, type CreatePurchaseOrderInput, type CreateSaleInput, type CreateSupplierInput, type CreateTransferInput, type CreateWebhookInput, type Customer, type DashboardStats, type DateRangeParams, type Department, type Employee, type InventoryItem, type InventoryReport, type JournalEntry, type JournalLine, type Lead, type LeaveRequest, type Location, type LoginCredentials, type Opportunity, type POSSession, type PaginatedResponse, type PaginationParams, type Position, type Product, type ProfitLossReport, type PurchaseOrder, type PurchaseOrderItem, type PurchaseRequisition, type Quotation, type Sale, type SaleItem, type SalesOrder, type SalesReport, type Shop, type StockAdjustment, type StockTransfer, type StockTransferItem, type Supplier, type TaxRate, type UpdateProductInput, type User, type Warehouse, type Webhook, type WebhookDelivery, type WebhookEvent };