@bontabil/sdk 0.1.3

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,966 @@
1
+ //#region src/api/chatbot/types.d.ts
2
+ /**
3
+ * The roles that can be assigned to messages in a language model conversation.
4
+ */
5
+ type LlmRole = "user" | "assistant" | "system";
6
+ /**
7
+ * The history message interface, representing a past message in the conversation.
8
+ */
9
+ interface HistoryMessage {
10
+ /**
11
+ * The content of the message.
12
+ */
13
+ content: string;
14
+ /**
15
+ * The role of the message sender.
16
+ */
17
+ role: LlmRole;
18
+ }
19
+ /**
20
+ * The chatbot request interface, including the current message and optional history.
21
+ */
22
+ interface ChatbotRequest {
23
+ /**
24
+ * The current message from the user.
25
+ */
26
+ message: string;
27
+ /**
28
+ * The history of past messages in the conversation.
29
+ */
30
+ history?: HistoryMessage[];
31
+ }
32
+ /**
33
+ * The chatbot response interface, representing the assistant's reply.
34
+ */
35
+ interface ChatbotResponse {
36
+ /**
37
+ * The response message from the assistant.
38
+ */
39
+ message: string;
40
+ }
41
+ //#endregion
42
+ //#region src/client/types.d.ts
43
+ /**
44
+ * The client options.
45
+ */
46
+ interface ClientOptions {
47
+ /**
48
+ * The API endpoint. If not provided, the default endpoint will be used.
49
+ */
50
+ endpoint?: string;
51
+ /**
52
+ * The API token.
53
+ */
54
+ token: string;
55
+ /**
56
+ * The request options to use for all requests.
57
+ */
58
+ requestOptions?: RequestInit;
59
+ }
60
+ //#endregion
61
+ //#region src/client/client.d.ts
62
+ /**
63
+ * The API client.
64
+ */
65
+ declare class Client {
66
+ /**
67
+ * The client options.
68
+ */
69
+ protected options: Required<ClientOptions>;
70
+ /**
71
+ * The client constructor.
72
+ *
73
+ * @param options The client options.
74
+ */
75
+ constructor(options: ClientOptions);
76
+ /**
77
+ * Make a generic request to the API.
78
+ *
79
+ * @param path The path to request.
80
+ * @param options The request options.
81
+ * @returns The response.
82
+ */
83
+ request(path: string, options?: RequestInit): Promise<Response>;
84
+ /**
85
+ * Handle an error response.
86
+ *
87
+ * @param res The response.
88
+ * @param data The response data.
89
+ */
90
+ private handleError;
91
+ /**
92
+ * Builds a full URL from the given path.
93
+ *
94
+ * @param path The path to build the URL for.
95
+ * @returns The full URL.
96
+ */
97
+ buildUrl(path: string): URL;
98
+ }
99
+ //#endregion
100
+ //#region src/client/constants.d.ts
101
+ declare const DEFAULT_ENDPOINT = "https://api.bontabil.ro/api";
102
+ declare const DEFAULT_OPTIONS: Omit<Required<ClientOptions>, "token">;
103
+ //#endregion
104
+ //#region src/api/resource.d.ts
105
+ /**
106
+ * The base resource class.
107
+ */
108
+ declare abstract class Resource {
109
+ protected readonly client: Client;
110
+ /**
111
+ * The base resource constructor.
112
+ *
113
+ * @param client The API client.
114
+ */
115
+ constructor(client: Client);
116
+ }
117
+ //#endregion
118
+ //#region src/api/chatbot/resource.d.ts
119
+ /**
120
+ * The chatbot resource.
121
+ */
122
+ declare class ChatbotResource extends Resource {
123
+ /**
124
+ * Send a message to the chatbot.
125
+ *
126
+ * @param request The chatbot request.
127
+ * @returns The chatbot response.
128
+ */
129
+ sendMessage(request?: ChatbotRequest): Promise<ChatbotResponse>;
130
+ }
131
+ //#endregion
132
+ //#region src/api/types.d.ts
133
+ /**
134
+ * The client or client options type.
135
+ */
136
+ type ClientOrClientOptions = Client | ClientOptions;
137
+ /**
138
+ * The filter object type.
139
+ */
140
+ type FilterObject = Record<string, string | number | boolean | Date>;
141
+ /**
142
+ * The filter options type.
143
+ */
144
+ type FilterOptions<T extends FilterObject = FilterObject> = Partial<T>;
145
+ /**
146
+ * The include options type.
147
+ */
148
+ type IncludeOptions<T extends string = string> = T[];
149
+ /**
150
+ * The sort options type.
151
+ */
152
+ interface SortOptions<T extends string = string> {
153
+ /**
154
+ * The field to sort by.
155
+ */
156
+ field: T;
157
+ /**
158
+ * The sort direction.
159
+ */
160
+ direction?: "asc" | "desc";
161
+ }
162
+ /**
163
+ * The pagination options type.
164
+ */
165
+ interface PaginationOptions {
166
+ /**
167
+ * The page number.
168
+ */
169
+ page?: number;
170
+ /**
171
+ * The number of items per page.
172
+ */
173
+ per_page?: number;
174
+ }
175
+ /**
176
+ * The filter request type.
177
+ */
178
+ interface FilterRequest<T extends FilterObject = FilterObject> {
179
+ /**
180
+ * The filter options.
181
+ */
182
+ filter?: FilterOptions<T>;
183
+ }
184
+ /**
185
+ * The include request type.
186
+ */
187
+ interface IncludeRequest<T extends string = string> {
188
+ /**
189
+ * The include options.
190
+ */
191
+ include?: IncludeOptions<T>;
192
+ }
193
+ /**
194
+ * The sort request type.
195
+ */
196
+ interface SortRequest<T extends string = string> {
197
+ /**
198
+ * The sort options.
199
+ */
200
+ sort?: SortOptions<T>;
201
+ }
202
+ /**
203
+ * The pagination request type.
204
+ */
205
+ interface PaginationRequest {
206
+ /**
207
+ * The pagination options.
208
+ */
209
+ pagination?: PaginationOptions;
210
+ }
211
+ /**
212
+ * The pagination links type.
213
+ */
214
+ interface PaginationLinks {
215
+ /**
216
+ * The first page link.
217
+ */
218
+ first: string;
219
+ /**
220
+ * The last page link.
221
+ */
222
+ last: string;
223
+ /**
224
+ * The previous page link.
225
+ */
226
+ prev: string | null;
227
+ /**
228
+ * The next page link.
229
+ */
230
+ next: string | null;
231
+ }
232
+ /**
233
+ * The pagination meta link type.
234
+ */
235
+ interface PaginationMetaLink {
236
+ /**
237
+ * The URL of the link.
238
+ */
239
+ url: string | null;
240
+ /**
241
+ * The label of the link.
242
+ */
243
+ label: string;
244
+ /**
245
+ * The page number of the link.
246
+ */
247
+ page: number | null;
248
+ /**
249
+ * The active status of the link.
250
+ */
251
+ active: boolean;
252
+ }
253
+ /**
254
+ * The pagination meta type.
255
+ */
256
+ interface PaginationMeta {
257
+ /**
258
+ * The current page number.
259
+ */
260
+ current_page: number;
261
+ /**
262
+ * The pagination starting item number.
263
+ */
264
+ from: number;
265
+ /**
266
+ * The pagination ending item number.
267
+ */
268
+ to: number;
269
+ /**
270
+ * The last page number.
271
+ */
272
+ last_page: number;
273
+ /**
274
+ * The current page path.
275
+ */
276
+ path: string;
277
+ /**
278
+ * The number of items per page.
279
+ */
280
+ per_page: number;
281
+ /**
282
+ * The total number of items.
283
+ */
284
+ total: number;
285
+ }
286
+ /**
287
+ * The list request type.
288
+ */
289
+ interface ListRequest<TFilter extends FilterObject = FilterObject, TInclude extends string = string, TSort extends string = string> extends FilterRequest<TFilter>, IncludeRequest<TInclude>, SortRequest<TSort>, PaginationRequest {}
290
+ /**
291
+ * The paginated response type.
292
+ */
293
+ interface PaginatedResponse<T> {
294
+ /**
295
+ * The data array.
296
+ */
297
+ data: T[];
298
+ /**
299
+ * The pagination links.
300
+ */
301
+ links: PaginationLinks;
302
+ /**
303
+ * The pagination meta information.
304
+ */
305
+ meta: PaginationMeta;
306
+ }
307
+ //#endregion
308
+ //#region src/api/counties/types.d.ts
309
+ /**
310
+ * The interface representing a county.
311
+ */
312
+ interface County {
313
+ /**
314
+ * The unique identifier of the county.
315
+ */
316
+ id: number;
317
+ /**
318
+ * The name of the county.
319
+ */
320
+ name: string;
321
+ /**
322
+ * The code of the county.
323
+ */
324
+ code: string;
325
+ /**
326
+ * The cities within the county.
327
+ */
328
+ cities?: City[];
329
+ }
330
+ /**
331
+ * The interface representing the request parameters for listing counties.
332
+ */
333
+ type ListCountiesRequest = ListRequest<{
334
+ id: number;
335
+ name: string;
336
+ code: string;
337
+ }, "cities", "id" | "name" | "code">;
338
+ //#endregion
339
+ //#region src/api/counties/resource.d.ts
340
+ /**
341
+ * The counties resource.
342
+ */
343
+ declare class CountiesResource extends Resource {
344
+ /**
345
+ * Get a paginated list of counties.
346
+ *
347
+ * @param request The counties request parameters.
348
+ * @returns The paginated list of counties.
349
+ */
350
+ list(request?: ListCountiesRequest): Promise<PaginatedResponse<County>>;
351
+ }
352
+ //#endregion
353
+ //#region src/api/cities/types.d.ts
354
+ /**
355
+ * The interface representing a city.
356
+ */
357
+ interface City {
358
+ /**
359
+ * The unique identifier of the city.
360
+ */
361
+ id: number;
362
+ /**
363
+ * The name of the city.
364
+ */
365
+ name: string;
366
+ /**
367
+ * The county to which the city belongs.
368
+ */
369
+ county?: County;
370
+ /**
371
+ * The stores within the city.
372
+ *
373
+ * TODO: Replace `unknown` with the actual Store interface when available.
374
+ */
375
+ stores?: unknown[];
376
+ }
377
+ /**
378
+ * The interface representing the request parameters for listing cities.
379
+ */
380
+ type ListCitiesRequest = ListRequest<{
381
+ id: number;
382
+ name: string;
383
+ county_id: number;
384
+ }, "county" | "stores", "id" | "name" | "county_id">;
385
+ //#endregion
386
+ //#region src/api/cities/resource.d.ts
387
+ /**
388
+ * The cities resource.
389
+ */
390
+ declare class CitiesResource extends Resource {
391
+ /**
392
+ * Get a paginated list of cities.
393
+ *
394
+ * @param request The cities request parameters.
395
+ * @returns The paginated list of cities.
396
+ */
397
+ list(request?: ListCitiesRequest): Promise<PaginatedResponse<City>>;
398
+ }
399
+ //#endregion
400
+ //#region src/api/stores/types.d.ts
401
+ /**
402
+ * The interface representing a store.
403
+ */
404
+ interface Store {
405
+ /**
406
+ * The unique identifier of the store.
407
+ */
408
+ id: number;
409
+ /**
410
+ * The street address of the store.
411
+ */
412
+ address: string;
413
+ /**
414
+ * The latitude of the store's location.
415
+ */
416
+ latitude: string;
417
+ /**
418
+ * The longitude of the store's location.
419
+ */
420
+ longitude: string;
421
+ /**
422
+ * The merchant associated with the store.
423
+ *
424
+ * TODO: Replace `unknown` with the actual Merchant interface when available.
425
+ */
426
+ merchant?: unknown;
427
+ /**
428
+ * The city where the store is located.
429
+ */
430
+ city?: City;
431
+ /**
432
+ * The receipts associated with the store.
433
+ *
434
+ * TODO: Replace `unknown` with the actual Receipt interface when available.
435
+ */
436
+ receipts?: unknown[];
437
+ }
438
+ /**
439
+ * The interface representing the request parameters for listing stores.
440
+ */
441
+ type ListStoresRequest = ListRequest<{
442
+ id: number;
443
+ address: string;
444
+ city_id: number;
445
+ }, "city" | "merchant" | "receipts", "id" | "address" | "city_id" | "store_id">;
446
+ //#endregion
447
+ //#region src/api/stores/resource.d.ts
448
+ /**
449
+ * The stores resource.
450
+ */
451
+ declare class StoresResource extends Resource {
452
+ /**
453
+ * Get a paginated list of stores.
454
+ *
455
+ * @param request The stores request parameters.
456
+ * @returns The paginated list of stores.
457
+ */
458
+ list(request?: ListStoresRequest): Promise<PaginatedResponse<Store>>;
459
+ }
460
+ //#endregion
461
+ //#region src/api/merchants/types.d.ts
462
+ /**
463
+ * The interface representing a merchant.
464
+ */
465
+ interface Merchant {
466
+ /**
467
+ * The unique identifier of the merchant.
468
+ */
469
+ id: number;
470
+ /**
471
+ * The name of the merchant.
472
+ */
473
+ name: string;
474
+ /**
475
+ * The merchant's registration number.
476
+ */
477
+ company_registration_number: string;
478
+ /**
479
+ * The flag indicating whether the merchant is a VAT payer.
480
+ */
481
+ is_vat_payer: boolean;
482
+ /**
483
+ * The stores associated with the merchant.
484
+ */
485
+ stores?: Store[];
486
+ }
487
+ /**
488
+ * The interface representing the request parameters for listing merchants.
489
+ */
490
+ type ListMerchantsRequest = ListRequest<{
491
+ id: number;
492
+ name: string;
493
+ company_registration_number: string;
494
+ is_vat_payer: boolean;
495
+ }, "stores", "id" | "name" | "company_registration_number" | "is_vat_payer">;
496
+ //#endregion
497
+ //#region src/api/merchants/resource.d.ts
498
+ /**
499
+ * The merchants resource.
500
+ */
501
+ declare class MerchantsResource extends Resource {
502
+ /**
503
+ * Get a paginated list of merchants.
504
+ *
505
+ * @param request The merchants request parameters.
506
+ * @returns The paginated list of merchants.
507
+ */
508
+ list(request?: ListMerchantsRequest): Promise<PaginatedResponse<Merchant>>;
509
+ }
510
+ //#endregion
511
+ //#region src/api/personal-access-tokens/types.d.ts
512
+ /**
513
+ * The interface representing a personal access token.
514
+ */
515
+ interface PersonalAccessToken {
516
+ /**
517
+ * The unique identifier of the personal access token.
518
+ */
519
+ id: number;
520
+ /**
521
+ * The name of the personal access token.
522
+ */
523
+ name: string;
524
+ /**
525
+ * The actual token string. This is only available when the token is created.
526
+ */
527
+ token: string | null;
528
+ /**
529
+ * The abilities granted to the personal access token.
530
+ */
531
+ abilities: string[];
532
+ /**
533
+ * The timestamp when the personal access token was last used.
534
+ */
535
+ last_used_at: string | null;
536
+ /**
537
+ * The timestamp when the personal access token expires. If null, the token does not expire.
538
+ */
539
+ expires_at: string | null;
540
+ /**
541
+ * The timestamp when the personal access token was created.
542
+ */
543
+ created_at: string;
544
+ /**
545
+ * The timestamp when the personal access token was last updated.
546
+ */
547
+ updated_at: string;
548
+ }
549
+ /**
550
+ * The interface representing the request body for creating or updating a personal access token.
551
+ */
552
+ interface PersonalAccessTokenRequest {
553
+ /**
554
+ * The name of the personal access token.
555
+ */
556
+ name: string;
557
+ /**
558
+ * The abilities to be granted to the personal access token.
559
+ */
560
+ abilities: string[];
561
+ /**
562
+ * The expiration date of the personal access token in ISO 8601 format. If null, the token does not expire.
563
+ */
564
+ expires_at?: string | null;
565
+ }
566
+ //#endregion
567
+ //#region src/api/personal-access-tokens/resource.d.ts
568
+ /**
569
+ * The personal access tokens resource.
570
+ */
571
+ declare class PersonalAccessTokensResource extends Resource {
572
+ /**
573
+ * List all personal access tokens.
574
+ *
575
+ * @returns A list of personal access tokens.
576
+ */
577
+ all(): Promise<PersonalAccessToken[]>;
578
+ /**
579
+ * Create a new personal access token.
580
+ *
581
+ * @param request The create personal access token request.
582
+ * @returns The created personal access token.
583
+ */
584
+ create(request: PersonalAccessTokenRequest): Promise<PersonalAccessToken>;
585
+ /**
586
+ * Update a personal access token by ID.
587
+ *
588
+ * @param id The personal access token ID.
589
+ * @param request The update personal access token request.
590
+ * @returns The updated personal access token.
591
+ */
592
+ update(id: number, request: PersonalAccessTokenRequest): Promise<PersonalAccessToken>;
593
+ /**
594
+ * Get a personal access token by ID.
595
+ *
596
+ * @param id The personal access token ID.
597
+ * @returns The personal access token.
598
+ */
599
+ get(id: number): Promise<PersonalAccessToken>;
600
+ /**
601
+ * Delete a personal access token by ID.
602
+ *
603
+ * @param id The personal access token ID.
604
+ */
605
+ delete(id: number): Promise<void>;
606
+ }
607
+ //#endregion
608
+ //#region src/api/profile/types.d.ts
609
+ /**
610
+ * The interface representing a user's profile.
611
+ */
612
+ interface Profile {
613
+ /**
614
+ * The user's unique identifier.
615
+ */
616
+ id: number;
617
+ /**
618
+ * The user's name.
619
+ */
620
+ name: string;
621
+ /**
622
+ * The user's email address.
623
+ */
624
+ email: string;
625
+ /**
626
+ * The user's available credits.
627
+ */
628
+ credits: number;
629
+ /**
630
+ * The user's permissions.
631
+ */
632
+ permissions: string[];
633
+ }
634
+ //#endregion
635
+ //#region src/api/profile/resource.d.ts
636
+ /**
637
+ * The profile resource.
638
+ */
639
+ declare class ProfileResource extends Resource {
640
+ /**
641
+ * Get the current user's profile.
642
+ *
643
+ * @returns The current user's profile.
644
+ */
645
+ me(): Promise<Profile>;
646
+ }
647
+ //#endregion
648
+ //#region src/api/receipts/types.d.ts
649
+ /**
650
+ * The receipt type.
651
+ */
652
+ interface Receipt {
653
+ /**
654
+ * The unique identifier of the receipt (ULID).
655
+ */
656
+ id: string;
657
+ /**
658
+ * The status of the receipt.
659
+ */
660
+ status: ReceiptStatus;
661
+ /**
662
+ * The receipt details.
663
+ */
664
+ details?: ReceiptDetails;
665
+ /**
666
+ * The receipt messages.
667
+ */
668
+ messages: ReceiptMessage[];
669
+ }
670
+ interface ReceiptItem {
671
+ /**
672
+ * The unique identifier of the receipt item.
673
+ */
674
+ id: number;
675
+ /**
676
+ * The name of the receipt item.
677
+ */
678
+ name: string;
679
+ /**
680
+ * The quantity of the receipt item.
681
+ */
682
+ quantity: number;
683
+ /**
684
+ * The unit of measurement for the quantity.
685
+ */
686
+ quantity_unit: QuantityUnit;
687
+ /**
688
+ * The unit price of the receipt item.
689
+ */
690
+ unit_price: number;
691
+ /**
692
+ * The total price of the receipt item.
693
+ */
694
+ total_price: number;
695
+ /**
696
+ * The VAT category of the receipt item.
697
+ */
698
+ vat_category: string;
699
+ /**
700
+ * The VAT percentage of the receipt item.
701
+ */
702
+ vat_percentage: number;
703
+ /**
704
+ * The category of the receipt item.
705
+ */
706
+ category?: ReceiptItemCategory;
707
+ }
708
+ /**
709
+ * The receipt details type.
710
+ */
711
+ interface ReceiptDetails {
712
+ /**
713
+ * The receipt code.
714
+ */
715
+ code: string;
716
+ /**
717
+ * The date of the receipt in ISO 8601 format.
718
+ */
719
+ date: string;
720
+ /**
721
+ * The total price of the receipt.
722
+ */
723
+ total_price: number;
724
+ /**
725
+ * The store where the receipt was issued.
726
+ */
727
+ store?: Store;
728
+ }
729
+ /**
730
+ * The receipt message type.
731
+ */
732
+ interface ReceiptMessage {
733
+ /**
734
+ * The type of the receipt message.
735
+ */
736
+ type: ReceiptMessageType;
737
+ /**
738
+ * The content of the receipt message.
739
+ */
740
+ message: string;
741
+ }
742
+ /**
743
+ * The possible statuses of a receipt.
744
+ */
745
+ type ReceiptStatus = "created" | "processing" | "processed" | "error";
746
+ /**
747
+ * The possible types of receipt messages.
748
+ */
749
+ type ReceiptMessageType = "info" | "warning" | "error";
750
+ /**
751
+ * The receipt item category type.
752
+ */
753
+ interface ReceiptItemCategory {
754
+ /**
755
+ * The unique identifier of the receipt item category.
756
+ */
757
+ id: number;
758
+ /**
759
+ * The name of the receipt item category.
760
+ */
761
+ name: string;
762
+ /**
763
+ * The parent category of the receipt item category.
764
+ */
765
+ parent?: ReceiptItemCategory;
766
+ }
767
+ /**
768
+ * The quantity unit type.
769
+ */
770
+ type QuantityUnit = "piece" | "kilogram" | "gram" | "liter" | "milliliter" | "meter" | "point" | "set" | "roll" | "box" | "package";
771
+ /**
772
+ * The interface representing the request parameters for listing receipts.
773
+ */
774
+ type ListReceiptsRequest = ListRequest<{
775
+ id: number;
776
+ status: ReceiptStatus;
777
+ code: string;
778
+ item_name: string;
779
+ start_date: string;
780
+ end_date: string;
781
+ store_id: number;
782
+ }, "store" | "store.merchant" | "items" | "items.category" | "items.category.parent" | "messages", "id" | "code" | "status" | "date">;
783
+ /**
784
+ * The interface representing the request to create a receipt.
785
+ */
786
+ interface CreateReceiptRequest {
787
+ /**
788
+ * The file representing the receipt image or document.
789
+ */
790
+ file: File;
791
+ }
792
+ /**
793
+ * The interface representing the request parameters for exporting receipts.
794
+ */
795
+ type ExportReceiptsRequest = FilterRequest<{
796
+ /**
797
+ * The unique identifier of the receipt (ULID).
798
+ */
799
+ receipt_id: string;
800
+ /**
801
+ * The receipt code.
802
+ */
803
+ receipt_code: string;
804
+ /**
805
+ * The name of the receipt item.
806
+ */
807
+ item_name: string;
808
+ /**
809
+ * The start date for filtering receipts (ISO 8601 format).
810
+ */
811
+ start_date: string;
812
+ /**
813
+ * The end date for filtering receipts (ISO 8601 format).
814
+ */
815
+ end_date: string;
816
+ /**
817
+ * The unique identifier of the store.
818
+ */
819
+ store_id: number;
820
+ }>;
821
+ //#endregion
822
+ //#region src/api/receipts/resource.d.ts
823
+ /**
824
+ * The receipts resource.
825
+ */
826
+ declare class ReceiptsResource extends Resource {
827
+ /**
828
+ * Get a paginated list of receipts.
829
+ *
830
+ * @param request The receipts request parameters.
831
+ * @returns The paginated list of receipts.
832
+ */
833
+ list(request?: ListReceiptsRequest): Promise<PaginatedResponse<Receipt>>;
834
+ /**
835
+ * Create a receipt.
836
+ *
837
+ * @param request The create receipt request.
838
+ * @returns The created receipt.
839
+ */
840
+ create(request: CreateReceiptRequest): Promise<Receipt>;
841
+ /**
842
+ * Get a receipt by ID.
843
+ *
844
+ * @param id The receipt ID.
845
+ * @returns The receipt.
846
+ */
847
+ get(id?: string): Promise<Receipt>;
848
+ /**
849
+ * Delete a receipt by ID.
850
+ *
851
+ * @param id The receipt ID.
852
+ */
853
+ delete(id: number): Promise<void>;
854
+ /**
855
+ * Export receipts.
856
+ *
857
+ * @param request The export receipts request.
858
+ * @returns The exported receipts.
859
+ */
860
+ export(request?: ExportReceiptsRequest): Promise<Blob>;
861
+ }
862
+ //#endregion
863
+ //#region src/api/reports/types.d.ts
864
+ /**
865
+ * The interface representing a spending by category.
866
+ */
867
+ interface SpendingByCategory {
868
+ /**
869
+ * The name of the category.
870
+ */
871
+ name: string;
872
+ /**
873
+ * The spending category children.
874
+ */
875
+ children: SpendingByCategory[];
876
+ /**
877
+ * The total spending for the category.
878
+ */
879
+ total: number;
880
+ }
881
+ /**
882
+ * The type representing the request parameters for listing spending by categories.
883
+ */
884
+ type SpendingByCategoriesRequest = FilterRequest<{
885
+ /**
886
+ * The start date for filtering spendings (ISO 8601 format).
887
+ */
888
+ start_date: string;
889
+ /**
890
+ * The end date for filtering spendings (ISO 8601 format).
891
+ */
892
+ end_date: string;
893
+ }>;
894
+ //#endregion
895
+ //#region src/api/reports/resource.d.ts
896
+ /**
897
+ * The reports resource.
898
+ */
899
+ declare class ReportsResource extends Resource {
900
+ /**
901
+ * Get spending by categories report.
902
+ *
903
+ * @param request The spending by categories request parameters.
904
+ * @returns The list of spending by category objects.
905
+ */
906
+ spendingByCategories(request?: SpendingByCategoriesRequest): Promise<SpendingByCategory[]>;
907
+ }
908
+ //#endregion
909
+ //#region src/api/api.d.ts
910
+ /**
911
+ * The Bontabil API.
912
+ */
913
+ declare class BontabilApi {
914
+ /**
915
+ * The API client.
916
+ */
917
+ protected readonly client: Client;
918
+ /**
919
+ * The profile resource.
920
+ */
921
+ readonly profile: ProfileResource;
922
+ /**
923
+ * The personal access tokens resource.
924
+ */
925
+ readonly personalAccessTokens: PersonalAccessTokensResource;
926
+ /**
927
+ * The counties resource.
928
+ */
929
+ readonly counties: CountiesResource;
930
+ /**
931
+ * The cities resource.
932
+ */
933
+ readonly cities: CitiesResource;
934
+ /**
935
+ * The stores resource.
936
+ */
937
+ readonly stores: StoresResource;
938
+ /**
939
+ * The merchants resource.
940
+ */
941
+ readonly merchants: MerchantsResource;
942
+ /**
943
+ * The chatbot resource.
944
+ */
945
+ readonly chatbot: ChatbotResource;
946
+ /**
947
+ * The receipts resource.
948
+ */
949
+ readonly receipts: ReceiptsResource;
950
+ /**
951
+ * The reports resource.
952
+ */
953
+ readonly reports: ReportsResource;
954
+ /**
955
+ * The Bontabil API constructor.
956
+ *
957
+ * @param client The API client or client options.
958
+ */
959
+ constructor(client: ClientOrClientOptions);
960
+ }
961
+ //#endregion
962
+ //#region src/api/constants.d.ts
963
+ declare const DEFAULT_REQUEST_HEADERS: NonNullable<RequestInit["headers"]>;
964
+ declare const DEFAULT_REQUEST_OPTIONS: RequestInit;
965
+ //#endregion
966
+ export { BontabilApi, ChatbotRequest, ChatbotResource, ChatbotResponse, CitiesResource, City, Client, ClientOptions, ClientOrClientOptions, CountiesResource, County, CreateReceiptRequest, DEFAULT_ENDPOINT, DEFAULT_OPTIONS, DEFAULT_REQUEST_HEADERS, DEFAULT_REQUEST_OPTIONS, ExportReceiptsRequest, FilterObject, FilterOptions, FilterRequest, HistoryMessage, IncludeOptions, IncludeRequest, ListCitiesRequest, ListCountiesRequest, ListMerchantsRequest, ListReceiptsRequest, ListRequest, ListStoresRequest, LlmRole, Merchant, MerchantsResource, PaginatedResponse, PaginationLinks, PaginationMeta, PaginationMetaLink, PaginationOptions, PaginationRequest, PersonalAccessToken, PersonalAccessTokenRequest, PersonalAccessTokensResource, Profile, ProfileResource, QuantityUnit, Receipt, ReceiptDetails, ReceiptItem, ReceiptItemCategory, ReceiptMessage, ReceiptMessageType, ReceiptStatus, ReceiptsResource, Resource, SortOptions, SortRequest, Store, StoresResource };