@renterra/sdk 0.2.0 → 0.2.1

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.
@@ -1,10 +1,13 @@
1
1
  import type { RenterraCallOptions, createResourceTransport } from "../transport.js";
2
2
  import type { operations } from "./rest.js";
3
+ import type { ListFiltersByOperation } from "./list-filters.js";
3
4
  type OperationQuery<Operation extends keyof operations> = operations[Operation] extends {
4
5
  parameters: {
5
6
  query?: infer Query;
6
7
  };
7
- } ? NonNullable<Query> : never;
8
+ } ? Operation extends keyof ListFiltersByOperation ? Omit<NonNullable<Query>, "filters"> & {
9
+ filters?: string | ListFiltersByOperation[Operation];
10
+ } : NonNullable<Query> : never;
8
11
  type OperationPath<Operation extends keyof operations> = operations[Operation] extends {
9
12
  parameters: {
10
13
  path: infer Path;
@@ -18,6 +21,103 @@ type OperationBody<Operation extends keyof operations> = operations[Operation] e
18
21
  };
19
22
  } ? Body : never;
20
23
  export declare function createResources({ client, requestOptions, unwrap }: ReturnType<typeof createResourceTransport>): {
24
+ navigation: {
25
+ get: (options?: RenterraCallOptions) => Promise<{
26
+ overrides: {
27
+ hidden: boolean;
28
+ label: string | null;
29
+ icon: string | null;
30
+ position: number | null;
31
+ artifact_id: string | null;
32
+ destination_key: "communications" | "orders" | "inventory" | "customers" | "yard" | "dispatch" | "maintenance" | "procurement" | "analytics" | "finance" | "accounting" | "storefront" | "marketing" | "leads";
33
+ }[];
34
+ entries: {
35
+ id: string;
36
+ path: string;
37
+ label: string;
38
+ icon: string | null;
39
+ artifact_id: string;
40
+ permission_source_key: "communications" | "orders" | "inventory" | "customers" | "yard" | "dispatch" | "maintenance" | "procurement" | "analytics" | "finance" | "accounting" | "storefront" | "marketing" | "leads";
41
+ position: number;
42
+ }[];
43
+ groups: {
44
+ id: "operations" | "growth" | "administrative";
45
+ label: string;
46
+ destinations: ("orders" | "customers" | "inventory" | "communications" | "yard" | "dispatch" | "maintenance" | "procurement" | "analytics" | "finance" | "accounting" | "storefront" | "marketing" | "leads")[];
47
+ }[];
48
+ }>;
49
+ saveOverride: (destination_key: OperationPath<"saveNavigationOverride">["destination_key"], input: OperationBody<"saveNavigationOverride">, options?: RenterraCallOptions) => Promise<{
50
+ success: true;
51
+ }>;
52
+ createEntry: (input: OperationBody<"createNavigationEntry">, options?: RenterraCallOptions) => Promise<{
53
+ id: string;
54
+ }>;
55
+ updateEntry: (id: OperationPath<"updateNavigationEntry">["id"], input: OperationBody<"updateNavigationEntry">, options?: RenterraCallOptions) => Promise<{
56
+ id: string;
57
+ }>;
58
+ deleteEntry: (id: OperationPath<"deleteNavigationEntry">["id"], options?: RenterraCallOptions) => Promise<{
59
+ success: true;
60
+ }>;
61
+ saveOrder: (input: OperationBody<"saveNavigationOrder">, options?: RenterraCallOptions) => Promise<{
62
+ success: true;
63
+ }>;
64
+ };
65
+ members: {
66
+ list: (query?: OperationQuery<"listMembers">, options?: RenterraCallOptions) => Promise<{
67
+ data: {
68
+ id: string;
69
+ first_name: string | null;
70
+ last_name: string | null;
71
+ branch_id: string | null;
72
+ is_driver: boolean;
73
+ is_maintenance_staff: boolean;
74
+ }[];
75
+ pagination: {
76
+ page: number;
77
+ page_size: number;
78
+ has_more: boolean;
79
+ };
80
+ }>;
81
+ };
82
+ pricing: {
83
+ rentalIntervals: {
84
+ list: (query?: OperationQuery<"listRentalIntervals">, options?: RenterraCallOptions) => Promise<{
85
+ data: {
86
+ id: string;
87
+ name: string;
88
+ duration: string;
89
+ proration_duration: string | null;
90
+ proration_measurement_duration: string | null;
91
+ is_default: boolean;
92
+ is_storefront_enabled: boolean;
93
+ }[];
94
+ pagination: {
95
+ page: number;
96
+ page_size: number;
97
+ has_more: boolean;
98
+ };
99
+ }>;
100
+ };
101
+ specialRateDefinitions: {
102
+ list: (query?: OperationQuery<"listSpecialRateDefinitions">, options?: RenterraCallOptions) => Promise<{
103
+ data: {
104
+ id: string;
105
+ name: string;
106
+ day_of_week_start: number;
107
+ time_of_day_start: string;
108
+ day_of_week_end: number;
109
+ time_of_day_end: string;
110
+ order_priority: number;
111
+ is_default: boolean;
112
+ }[];
113
+ pagination: {
114
+ page: number;
115
+ page_size: number;
116
+ has_more: boolean;
117
+ };
118
+ }>;
119
+ };
120
+ };
21
121
  customers: {
22
122
  list: (query?: OperationQuery<"listCustomers">, options?: RenterraCallOptions) => Promise<{
23
123
  data: {
@@ -150,6 +250,17 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
150
250
  has_more: boolean;
151
251
  };
152
252
  }>;
253
+ create: (input: OperationBody<"createContact">, options?: RenterraCallOptions) => Promise<{
254
+ id: string;
255
+ created_at: string;
256
+ updated_at: string;
257
+ customer_id: string;
258
+ first_name: string | null;
259
+ last_name: string | null;
260
+ email: string | null;
261
+ phone: string | null;
262
+ title: string | null;
263
+ }>;
153
264
  update: (id: OperationPath<"updateContact">["id"], input: OperationBody<"updateContact">, options?: RenterraCallOptions) => Promise<{
154
265
  id: string;
155
266
  created_at: string;
@@ -298,6 +409,58 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
298
409
  get: (id: OperationPath<"getReport">["id"], options?: RenterraCallOptions) => Promise<undefined>;
299
410
  };
300
411
  inventory: {
412
+ availability: (query: OperationQuery<"searchInventoryAvailability">, options?: RenterraCallOptions) => Promise<{
413
+ data: ({
414
+ id: string;
415
+ updated_at: string;
416
+ kind: "Actual" | "Slot";
417
+ type: "Serial" | "Sale" | "Bulk" | "Part";
418
+ make: string | null;
419
+ model: string | null;
420
+ model_year: number | null;
421
+ condition: ("Excellent" | "Good" | "Ok" | "Bad" | "Terrible") | null;
422
+ item_number: string | null;
423
+ part_number: string | null;
424
+ serial_number: string | null;
425
+ description: string;
426
+ category: string;
427
+ class: string;
428
+ group: string;
429
+ entity_type: "item" | "slot" | "part";
430
+ availability: {
431
+ id: string;
432
+ branch_id: string;
433
+ start_time: string;
434
+ end_time: string | null;
435
+ quantity: number;
436
+ available_quantity: number;
437
+ available: boolean;
438
+ };
439
+ } | {
440
+ id: string;
441
+ name: string;
442
+ status: "active" | "archived";
443
+ items: {
444
+ item_id: string;
445
+ quantity: number;
446
+ }[];
447
+ entity_type: "kit";
448
+ availability: {
449
+ id: string;
450
+ branch_id: string;
451
+ start_time: string;
452
+ end_time: string | null;
453
+ quantity: number;
454
+ available_quantity: number;
455
+ available: boolean;
456
+ };
457
+ })[];
458
+ pagination: {
459
+ page: number;
460
+ page_size: number;
461
+ has_more: boolean;
462
+ };
463
+ }>;
301
464
  items: {
302
465
  list: (query?: OperationQuery<"listInventoryItems">, options?: RenterraCallOptions) => Promise<{
303
466
  data: {
@@ -323,6 +486,23 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
323
486
  has_more: boolean;
324
487
  };
325
488
  }>;
489
+ create: (input: OperationBody<"createInventoryItem">, options?: RenterraCallOptions) => Promise<{
490
+ id: string;
491
+ updated_at: string;
492
+ kind: "Actual" | "Slot";
493
+ type: "Serial" | "Sale" | "Bulk" | "Part";
494
+ make: string | null;
495
+ model: string | null;
496
+ model_year: number | null;
497
+ condition: ("Excellent" | "Good" | "Ok" | "Bad" | "Terrible") | null;
498
+ item_number: string | null;
499
+ part_number: string | null;
500
+ serial_number: string | null;
501
+ description: string;
502
+ category: string;
503
+ class: string;
504
+ group: string;
505
+ }>;
326
506
  get: (id: OperationPath<"getInventoryItem">["id"], options?: RenterraCallOptions) => Promise<{
327
507
  id: string;
328
508
  updated_at: string;
@@ -341,6 +521,64 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
341
521
  group: string;
342
522
  }>;
343
523
  analytics: (id: OperationPath<"getInventoryItemAnalytics">["id"], options?: RenterraCallOptions) => Promise<undefined>;
524
+ availability: (id: OperationPath<"getInventoryItemAvailability">["id"], query: OperationQuery<"getInventoryItemAvailability">, options?: RenterraCallOptions) => Promise<{
525
+ id: string;
526
+ branch_id: string;
527
+ start_time: string;
528
+ end_time: string | null;
529
+ quantity: number;
530
+ available_quantity: number;
531
+ available: boolean;
532
+ }>;
533
+ };
534
+ categories: {
535
+ list: (query?: OperationQuery<"listCategories">, options?: RenterraCallOptions) => Promise<{
536
+ data: {
537
+ id: string;
538
+ category: string;
539
+ class: string;
540
+ group: string;
541
+ ara_code: number | null;
542
+ created_at: string;
543
+ updated_at: string;
544
+ archived_at: string | null;
545
+ }[];
546
+ pagination: {
547
+ page: number;
548
+ page_size: number;
549
+ has_more: boolean;
550
+ };
551
+ }>;
552
+ create: (input: OperationBody<"createCategory">, options?: RenterraCallOptions) => Promise<{
553
+ id: string;
554
+ category: string;
555
+ class: string;
556
+ group: string;
557
+ ara_code: number | null;
558
+ created_at: string;
559
+ updated_at: string;
560
+ archived_at: string | null;
561
+ }>;
562
+ get: (id: OperationPath<"getCategory">["id"], options?: RenterraCallOptions) => Promise<{
563
+ id: string;
564
+ category: string;
565
+ class: string;
566
+ group: string;
567
+ ara_code: number | null;
568
+ created_at: string;
569
+ updated_at: string;
570
+ archived_at: string | null;
571
+ }>;
572
+ update: (id: OperationPath<"updateCategory">["id"], input: OperationBody<"updateCategory">, options?: RenterraCallOptions) => Promise<{
573
+ id: string;
574
+ category: string;
575
+ class: string;
576
+ group: string;
577
+ ara_code: number | null;
578
+ created_at: string;
579
+ updated_at: string;
580
+ archived_at: string | null;
581
+ }>;
344
582
  };
345
583
  kits: {
346
584
  list: (query?: OperationQuery<"listInventoryKits">, options?: RenterraCallOptions) => Promise<{
@@ -406,57 +644,718 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
406
644
  slot_id: string | null;
407
645
  description: string;
408
646
  quantity: number;
409
- status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
410
- type: "rental";
411
- billing_start_time: string;
412
- billing_end_time: string | null;
413
- } | {
414
- id: string;
415
- source: "order" | "work_order";
416
- order_id: string | null;
417
- work_order_id: string | null;
418
- line_id: string;
419
- item_id: string;
420
- slot_id: string | null;
647
+ status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
648
+ type: "rental";
649
+ billing_start_time: string;
650
+ billing_end_time: string | null;
651
+ } | {
652
+ id: string;
653
+ source: "order" | "work_order";
654
+ order_id: string | null;
655
+ work_order_id: string | null;
656
+ line_id: string;
657
+ item_id: string;
658
+ slot_id: string | null;
659
+ description: string;
660
+ quantity: number;
661
+ status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
662
+ type: "sale";
663
+ sale_time: string | null;
664
+ }>;
665
+ };
666
+ };
667
+ branches: {
668
+ list: (query?: OperationQuery<"listBranches">, options?: RenterraCallOptions) => Promise<{
669
+ data: {
670
+ id: string;
671
+ updated_at: string;
672
+ name: string;
673
+ }[];
674
+ pagination: {
675
+ page: number;
676
+ page_size: number;
677
+ has_more: boolean;
678
+ };
679
+ }>;
680
+ };
681
+ vendors: {
682
+ list: (query?: OperationQuery<"listVendors">, options?: RenterraCallOptions) => Promise<{
683
+ data: {
684
+ id: string;
685
+ updated_at: string;
686
+ name: string;
687
+ phone_number: string | null;
688
+ email: string | null;
689
+ }[];
690
+ pagination: {
691
+ page: number;
692
+ page_size: number;
693
+ has_more: boolean;
694
+ };
695
+ }>;
696
+ };
697
+ audit: {
698
+ list: (query?: OperationQuery<"listAudit">, options?: RenterraCallOptions) => Promise<{
699
+ data: {
700
+ id: number;
701
+ created_at: string;
702
+ domain: "order" | "customer" | "invoice" | "purchase_order";
703
+ domain_id: string | null;
704
+ domain_label: string | null;
705
+ action: string;
706
+ actor_type: "User" | "Agent" | "ApiKey" | "System" | "Public";
707
+ user_id: string | null;
708
+ agent_id: string | null;
709
+ api_key_id: string | null;
710
+ details: {
711
+ field: string;
712
+ old: string | {
713
+ [x: string]: string | null;
714
+ } | (string | {
715
+ [x: string]: string | null;
716
+ })[] | null;
717
+ new: string | {
718
+ [x: string]: string | null;
719
+ } | (string | {
720
+ [x: string]: string | null;
721
+ })[] | null;
722
+ }[] | null;
723
+ metadata?: {
724
+ [x: string]: string | {
725
+ id: string;
726
+ label: string;
727
+ } | {
728
+ id: string;
729
+ label: string;
730
+ }[];
731
+ } | undefined;
732
+ }[];
733
+ pagination: {
734
+ page: number;
735
+ page_size: number;
736
+ has_more: boolean;
737
+ };
738
+ }>;
739
+ };
740
+ purchaseOrders: {
741
+ receive: (id: OperationPath<"receivePurchaseOrder">["id"], input: OperationBody<"receivePurchaseOrder">, options?: RenterraCallOptions) => Promise<{
742
+ id: string;
743
+ }>;
744
+ receiveSerialUnits: (id: OperationPath<"receivePurchaseOrderSerialUnits">["id"], line_item_id: OperationPath<"receivePurchaseOrderSerialUnits">["line_item_id"], input: OperationBody<"receivePurchaseOrderSerialUnits">, options?: RenterraCallOptions) => Promise<{
745
+ id: string;
746
+ }>;
747
+ list: (query?: OperationQuery<"listPurchaseOrders">, options?: RenterraCallOptions) => Promise<{
748
+ data: {
749
+ id: string;
750
+ number: number;
751
+ status: "Draft" | "Discarded" | "Open" | "Completed" | "Closed";
752
+ vendor_id: string | null;
753
+ branch_id: string;
754
+ brand_id: string | null;
755
+ requested_for_work_order_id: string | null;
756
+ ordered_for_id: string | null;
757
+ notes: string | null;
758
+ total_cents: number | null;
759
+ expected_delivery_date: string | null;
760
+ created_at: string;
761
+ updated_at: string;
762
+ opened_at: string | null;
763
+ closed_at: string | null;
764
+ lines: {
765
+ id: string;
766
+ type: "Item" | "Custom" | "Serial";
767
+ status: "Pending" | "Received" | "BackOrdered";
768
+ item_id: string | null;
769
+ description: string;
770
+ number: string | null;
771
+ bundle_count: number;
772
+ bundle_size: number;
773
+ bundle_price_cents: number;
774
+ acquisition_cost_cents: number;
775
+ bundle_count_received: number;
776
+ created_item_ids: string[];
777
+ }[];
778
+ }[];
779
+ pagination: {
780
+ page: number;
781
+ page_size: number;
782
+ has_more: boolean;
783
+ };
784
+ }>;
785
+ get: (id: OperationPath<"getPurchaseOrder">["id"], options?: RenterraCallOptions) => Promise<{
786
+ id: string;
787
+ number: number;
788
+ status: "Draft" | "Discarded" | "Open" | "Completed" | "Closed";
789
+ vendor_id: string | null;
790
+ branch_id: string;
791
+ brand_id: string | null;
792
+ requested_for_work_order_id: string | null;
793
+ ordered_for_id: string | null;
794
+ notes: string | null;
795
+ total_cents: number | null;
796
+ expected_delivery_date: string | null;
797
+ created_at: string;
798
+ updated_at: string;
799
+ opened_at: string | null;
800
+ closed_at: string | null;
801
+ lines: {
802
+ id: string;
803
+ type: "Item" | "Custom" | "Serial";
804
+ status: "Pending" | "Received" | "BackOrdered";
805
+ item_id: string | null;
806
+ description: string;
807
+ number: string | null;
808
+ bundle_count: number;
809
+ bundle_size: number;
810
+ bundle_price_cents: number;
811
+ acquisition_cost_cents: number;
812
+ bundle_count_received: number;
813
+ created_item_ids: string[];
814
+ }[];
815
+ }>;
816
+ };
817
+ inbox: {
818
+ send: (input: OperationBody<"sendInboxMessage">, options?: RenterraCallOptions) => Promise<{
819
+ id: string;
820
+ conversation_id: string | null;
821
+ channel: "EMAIL" | "SMS";
822
+ from: string | null;
823
+ to: string | null;
824
+ created_at: string;
825
+ }>;
826
+ };
827
+ orders: {
828
+ get: (id: OperationPath<"getOrder">["id"], options?: RenterraCallOptions) => Promise<{
829
+ id: string;
830
+ number: number;
831
+ source: "Online" | "Manual";
832
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
833
+ customer_id: string;
834
+ branch_id: string;
835
+ start_time: string;
836
+ end_time: string | null;
837
+ metadata: {
838
+ po_number: string | null;
839
+ job_number: string | null;
840
+ job_description: string | null;
841
+ };
842
+ contract_signed_at: string | null;
843
+ is_historical: boolean;
844
+ items: {
845
+ description: string;
846
+ quantity: number;
847
+ item_id: string | null;
848
+ }[];
849
+ lines: {
850
+ description: string;
851
+ quantity: number;
852
+ item_id: string | null;
853
+ id: string;
854
+ inventory_on_order_ids: string[];
855
+ }[];
856
+ }>;
857
+ update: (id: OperationPath<"updateOrder">["id"], input: OperationBody<"updateOrder">, options?: RenterraCallOptions) => Promise<{
858
+ id: string;
859
+ }>;
860
+ items: {
861
+ add: (id: OperationPath<"addOrderItems">["id"], input: OperationBody<"addOrderItems">, options?: RenterraCallOptions) => Promise<{
862
+ id: string;
863
+ number: number;
864
+ source: "Online" | "Manual";
865
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
866
+ customer_id: string;
867
+ branch_id: string;
868
+ start_time: string;
869
+ end_time: string | null;
870
+ metadata: {
871
+ po_number: string | null;
872
+ job_number: string | null;
873
+ job_description: string | null;
874
+ };
875
+ contract_signed_at: string | null;
876
+ is_historical: boolean;
877
+ items: {
878
+ description: string;
879
+ quantity: number;
880
+ item_id: string | null;
881
+ }[];
882
+ lines: {
883
+ description: string;
884
+ quantity: number;
885
+ item_id: string | null;
886
+ id: string;
887
+ inventory_on_order_ids: string[];
888
+ }[];
889
+ fee_errors: {
890
+ fee_id: string;
891
+ message: string;
892
+ }[];
893
+ }>;
894
+ remove: (id: OperationPath<"removeOrderItem">["id"], order_item_id: OperationPath<"removeOrderItem">["order_item_id"], options?: RenterraCallOptions) => Promise<{
895
+ id: string;
896
+ number: number;
897
+ source: "Online" | "Manual";
898
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
899
+ customer_id: string;
900
+ branch_id: string;
901
+ start_time: string;
902
+ end_time: string | null;
903
+ metadata: {
904
+ po_number: string | null;
905
+ job_number: string | null;
906
+ job_description: string | null;
907
+ };
908
+ contract_signed_at: string | null;
909
+ is_historical: boolean;
910
+ items: {
911
+ description: string;
912
+ quantity: number;
913
+ item_id: string | null;
914
+ }[];
915
+ lines: {
916
+ description: string;
917
+ quantity: number;
918
+ item_id: string | null;
919
+ id: string;
920
+ inventory_on_order_ids: string[];
921
+ }[];
922
+ }>;
923
+ };
924
+ checkout: (id: OperationPath<"checkoutOrder">["id"], input: OperationBody<"checkoutOrder">, options?: RenterraCallOptions) => Promise<{
925
+ id: string;
926
+ number: number;
927
+ source: "Online" | "Manual";
928
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
929
+ customer_id: string;
930
+ branch_id: string;
931
+ start_time: string;
932
+ end_time: string | null;
933
+ metadata: {
934
+ po_number: string | null;
935
+ job_number: string | null;
936
+ job_description: string | null;
937
+ };
938
+ contract_signed_at: string | null;
939
+ is_historical: boolean;
940
+ items: {
941
+ description: string;
942
+ quantity: number;
943
+ item_id: string | null;
944
+ }[];
945
+ lines: {
946
+ description: string;
947
+ quantity: number;
948
+ item_id: string | null;
949
+ id: string;
950
+ inventory_on_order_ids: string[];
951
+ }[];
952
+ }>;
953
+ delivery: (id: OperationPath<"deliverOrder">["id"], input: OperationBody<"deliverOrder">, options?: RenterraCallOptions) => Promise<{
954
+ id: string;
955
+ number: number;
956
+ source: "Online" | "Manual";
957
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
958
+ customer_id: string;
959
+ branch_id: string;
960
+ start_time: string;
961
+ end_time: string | null;
962
+ metadata: {
963
+ po_number: string | null;
964
+ job_number: string | null;
965
+ job_description: string | null;
966
+ };
967
+ contract_signed_at: string | null;
968
+ is_historical: boolean;
969
+ items: {
970
+ description: string;
971
+ quantity: number;
972
+ item_id: string | null;
973
+ }[];
974
+ lines: {
975
+ description: string;
976
+ quantity: number;
977
+ item_id: string | null;
978
+ id: string;
979
+ inventory_on_order_ids: string[];
980
+ }[];
981
+ }>;
982
+ checkin: (id: OperationPath<"checkinOrder">["id"], input: OperationBody<"checkinOrder">, options?: RenterraCallOptions) => Promise<{
983
+ id: string;
984
+ number: number;
985
+ source: "Online" | "Manual";
986
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
987
+ customer_id: string;
988
+ branch_id: string;
989
+ start_time: string;
990
+ end_time: string | null;
991
+ metadata: {
992
+ po_number: string | null;
993
+ job_number: string | null;
994
+ job_description: string | null;
995
+ };
996
+ contract_signed_at: string | null;
997
+ is_historical: boolean;
998
+ items: {
999
+ description: string;
1000
+ quantity: number;
1001
+ item_id: string | null;
1002
+ }[];
1003
+ lines: {
1004
+ description: string;
1005
+ quantity: number;
1006
+ item_id: string | null;
1007
+ id: string;
1008
+ inventory_on_order_ids: string[];
1009
+ }[];
1010
+ }>;
1011
+ pickup: (id: OperationPath<"pickupOrder">["id"], input: OperationBody<"pickupOrder">, options?: RenterraCallOptions) => Promise<{
1012
+ id: string;
1013
+ number: number;
1014
+ source: "Online" | "Manual";
1015
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1016
+ customer_id: string;
1017
+ branch_id: string;
1018
+ start_time: string;
1019
+ end_time: string | null;
1020
+ metadata: {
1021
+ po_number: string | null;
1022
+ job_number: string | null;
1023
+ job_description: string | null;
1024
+ };
1025
+ contract_signed_at: string | null;
1026
+ is_historical: boolean;
1027
+ items: {
1028
+ description: string;
1029
+ quantity: number;
1030
+ item_id: string | null;
1031
+ }[];
1032
+ lines: {
1033
+ description: string;
1034
+ quantity: number;
1035
+ item_id: string | null;
1036
+ id: string;
1037
+ inventory_on_order_ids: string[];
1038
+ }[];
1039
+ }>;
1040
+ calloff: (id: OperationPath<"calloffOrder">["id"], input: OperationBody<"calloffOrder">, options?: RenterraCallOptions) => Promise<{
1041
+ id: string;
1042
+ number: number;
1043
+ source: "Online" | "Manual";
1044
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1045
+ customer_id: string;
1046
+ branch_id: string;
1047
+ start_time: string;
1048
+ end_time: string | null;
1049
+ metadata: {
1050
+ po_number: string | null;
1051
+ job_number: string | null;
1052
+ job_description: string | null;
1053
+ };
1054
+ contract_signed_at: string | null;
1055
+ is_historical: boolean;
1056
+ items: {
1057
+ description: string;
1058
+ quantity: number;
1059
+ item_id: string | null;
1060
+ }[];
1061
+ lines: {
1062
+ description: string;
1063
+ quantity: number;
1064
+ item_id: string | null;
1065
+ id: string;
1066
+ inventory_on_order_ids: string[];
1067
+ }[];
1068
+ }>;
1069
+ close: (id: OperationPath<"closeOrder">["id"], options?: RenterraCallOptions) => Promise<{
1070
+ id: string;
1071
+ number: number;
1072
+ source: "Online" | "Manual";
1073
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1074
+ customer_id: string;
1075
+ branch_id: string;
1076
+ start_time: string;
1077
+ end_time: string | null;
1078
+ metadata: {
1079
+ po_number: string | null;
1080
+ job_number: string | null;
1081
+ job_description: string | null;
1082
+ };
1083
+ contract_signed_at: string | null;
1084
+ is_historical: boolean;
1085
+ items: {
1086
+ description: string;
1087
+ quantity: number;
1088
+ item_id: string | null;
1089
+ }[];
1090
+ lines: {
1091
+ description: string;
1092
+ quantity: number;
1093
+ item_id: string | null;
1094
+ id: string;
1095
+ inventory_on_order_ids: string[];
1096
+ }[];
1097
+ }>;
1098
+ undoCheckout: (id: OperationPath<"undoOrderCheckout">["id"], input: OperationBody<"undoOrderCheckout">, options?: RenterraCallOptions) => Promise<{
1099
+ id: string;
1100
+ number: number;
1101
+ source: "Online" | "Manual";
1102
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1103
+ customer_id: string;
1104
+ branch_id: string;
1105
+ start_time: string;
1106
+ end_time: string | null;
1107
+ metadata: {
1108
+ po_number: string | null;
1109
+ job_number: string | null;
1110
+ job_description: string | null;
1111
+ };
1112
+ contract_signed_at: string | null;
1113
+ is_historical: boolean;
1114
+ items: {
1115
+ description: string;
1116
+ quantity: number;
1117
+ item_id: string | null;
1118
+ }[];
1119
+ lines: {
1120
+ description: string;
1121
+ quantity: number;
1122
+ item_id: string | null;
1123
+ id: string;
1124
+ inventory_on_order_ids: string[];
1125
+ }[];
1126
+ }>;
1127
+ undoDelivery: (id: OperationPath<"undoOrderDelivery">["id"], input: OperationBody<"undoOrderDelivery">, options?: RenterraCallOptions) => Promise<{
1128
+ id: string;
1129
+ number: number;
1130
+ source: "Online" | "Manual";
1131
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1132
+ customer_id: string;
1133
+ branch_id: string;
1134
+ start_time: string;
1135
+ end_time: string | null;
1136
+ metadata: {
1137
+ po_number: string | null;
1138
+ job_number: string | null;
1139
+ job_description: string | null;
1140
+ };
1141
+ contract_signed_at: string | null;
1142
+ is_historical: boolean;
1143
+ items: {
1144
+ description: string;
1145
+ quantity: number;
1146
+ item_id: string | null;
1147
+ }[];
1148
+ lines: {
1149
+ description: string;
1150
+ quantity: number;
1151
+ item_id: string | null;
1152
+ id: string;
1153
+ inventory_on_order_ids: string[];
1154
+ }[];
1155
+ }>;
1156
+ undoCalloff: (id: OperationPath<"undoOrderCalloff">["id"], input: OperationBody<"undoOrderCalloff">, options?: RenterraCallOptions) => Promise<{
1157
+ id: string;
1158
+ number: number;
1159
+ source: "Online" | "Manual";
1160
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1161
+ customer_id: string;
1162
+ branch_id: string;
1163
+ start_time: string;
1164
+ end_time: string | null;
1165
+ metadata: {
1166
+ po_number: string | null;
1167
+ job_number: string | null;
1168
+ job_description: string | null;
1169
+ };
1170
+ contract_signed_at: string | null;
1171
+ is_historical: boolean;
1172
+ items: {
1173
+ description: string;
1174
+ quantity: number;
1175
+ item_id: string | null;
1176
+ }[];
1177
+ lines: {
1178
+ description: string;
1179
+ quantity: number;
1180
+ item_id: string | null;
1181
+ id: string;
1182
+ inventory_on_order_ids: string[];
1183
+ }[];
1184
+ }>;
1185
+ undoPickup: (id: OperationPath<"undoOrderPickup">["id"], input: OperationBody<"undoOrderPickup">, options?: RenterraCallOptions) => Promise<{
1186
+ id: string;
1187
+ number: number;
1188
+ source: "Online" | "Manual";
1189
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1190
+ customer_id: string;
1191
+ branch_id: string;
1192
+ start_time: string;
1193
+ end_time: string | null;
1194
+ metadata: {
1195
+ po_number: string | null;
1196
+ job_number: string | null;
1197
+ job_description: string | null;
1198
+ };
1199
+ contract_signed_at: string | null;
1200
+ is_historical: boolean;
1201
+ items: {
1202
+ description: string;
1203
+ quantity: number;
1204
+ item_id: string | null;
1205
+ }[];
1206
+ lines: {
1207
+ description: string;
1208
+ quantity: number;
1209
+ item_id: string | null;
1210
+ id: string;
1211
+ inventory_on_order_ids: string[];
1212
+ }[];
1213
+ }>;
1214
+ undoCheckin: (id: OperationPath<"undoOrderCheckin">["id"], input: OperationBody<"undoOrderCheckin">, options?: RenterraCallOptions) => Promise<{
1215
+ id: string;
1216
+ number: number;
1217
+ source: "Online" | "Manual";
1218
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1219
+ customer_id: string;
1220
+ branch_id: string;
1221
+ start_time: string;
1222
+ end_time: string | null;
1223
+ metadata: {
1224
+ po_number: string | null;
1225
+ job_number: string | null;
1226
+ job_description: string | null;
1227
+ };
1228
+ contract_signed_at: string | null;
1229
+ is_historical: boolean;
1230
+ items: {
1231
+ description: string;
1232
+ quantity: number;
1233
+ item_id: string | null;
1234
+ }[];
1235
+ lines: {
1236
+ description: string;
1237
+ quantity: number;
1238
+ item_id: string | null;
1239
+ id: string;
1240
+ inventory_on_order_ids: string[];
1241
+ }[];
1242
+ }>;
1243
+ undoSale: (id: OperationPath<"undoOrderSale">["id"], input: OperationBody<"undoOrderSale">, options?: RenterraCallOptions) => Promise<{
1244
+ id: string;
1245
+ number: number;
1246
+ source: "Online" | "Manual";
1247
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1248
+ customer_id: string;
1249
+ branch_id: string;
1250
+ start_time: string;
1251
+ end_time: string | null;
1252
+ metadata: {
1253
+ po_number: string | null;
1254
+ job_number: string | null;
1255
+ job_description: string | null;
1256
+ };
1257
+ contract_signed_at: string | null;
1258
+ is_historical: boolean;
1259
+ items: {
1260
+ description: string;
1261
+ quantity: number;
1262
+ item_id: string | null;
1263
+ }[];
1264
+ lines: {
1265
+ description: string;
1266
+ quantity: number;
1267
+ item_id: string | null;
1268
+ id: string;
1269
+ inventory_on_order_ids: string[];
1270
+ }[];
1271
+ }>;
1272
+ reserve: (id: OperationPath<"reserveOrder">["id"], options?: RenterraCallOptions) => Promise<{
1273
+ id: string;
1274
+ number: number;
1275
+ source: "Online" | "Manual";
1276
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1277
+ customer_id: string;
1278
+ branch_id: string;
1279
+ start_time: string;
1280
+ end_time: string | null;
1281
+ metadata: {
1282
+ po_number: string | null;
1283
+ job_number: string | null;
1284
+ job_description: string | null;
1285
+ };
1286
+ contract_signed_at: string | null;
1287
+ is_historical: boolean;
1288
+ items: {
1289
+ description: string;
1290
+ quantity: number;
1291
+ item_id: string | null;
1292
+ }[];
1293
+ lines: {
421
1294
  description: string;
422
1295
  quantity: number;
423
- status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
424
- type: "sale";
425
- sale_time: string | null;
426
- }>;
427
- };
428
- };
429
- branches: {
430
- list: (query?: OperationQuery<"listBranches">, options?: RenterraCallOptions) => Promise<{
431
- data: {
1296
+ item_id: string | null;
432
1297
  id: string;
433
- updated_at: string;
434
- name: string;
1298
+ inventory_on_order_ids: string[];
435
1299
  }[];
436
- pagination: {
437
- page: number;
438
- page_size: number;
439
- has_more: boolean;
440
- };
441
1300
  }>;
442
- };
443
- vendors: {
444
- list: (query?: OperationQuery<"listVendors">, options?: RenterraCallOptions) => Promise<{
445
- data: {
1301
+ expire: (id: OperationPath<"expireOrder">["id"], options?: RenterraCallOptions) => Promise<{
1302
+ id: string;
1303
+ number: number;
1304
+ source: "Online" | "Manual";
1305
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1306
+ customer_id: string;
1307
+ branch_id: string;
1308
+ start_time: string;
1309
+ end_time: string | null;
1310
+ metadata: {
1311
+ po_number: string | null;
1312
+ job_number: string | null;
1313
+ job_description: string | null;
1314
+ };
1315
+ contract_signed_at: string | null;
1316
+ is_historical: boolean;
1317
+ items: {
1318
+ description: string;
1319
+ quantity: number;
1320
+ item_id: string | null;
1321
+ }[];
1322
+ lines: {
1323
+ description: string;
1324
+ quantity: number;
1325
+ item_id: string | null;
446
1326
  id: string;
447
- updated_at: string;
448
- name: string;
449
- phone_number: string | null;
450
- email: string | null;
1327
+ inventory_on_order_ids: string[];
451
1328
  }[];
452
- pagination: {
453
- page: number;
454
- page_size: number;
455
- has_more: boolean;
1329
+ }>;
1330
+ cancel: (id: OperationPath<"cancelOrder">["id"], options?: RenterraCallOptions) => Promise<{
1331
+ id: string;
1332
+ number: number;
1333
+ source: "Online" | "Manual";
1334
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
1335
+ customer_id: string;
1336
+ branch_id: string;
1337
+ start_time: string;
1338
+ end_time: string | null;
1339
+ metadata: {
1340
+ po_number: string | null;
1341
+ job_number: string | null;
1342
+ job_description: string | null;
456
1343
  };
1344
+ contract_signed_at: string | null;
1345
+ is_historical: boolean;
1346
+ items: {
1347
+ description: string;
1348
+ quantity: number;
1349
+ item_id: string | null;
1350
+ }[];
1351
+ lines: {
1352
+ description: string;
1353
+ quantity: number;
1354
+ item_id: string | null;
1355
+ id: string;
1356
+ inventory_on_order_ids: string[];
1357
+ }[];
457
1358
  }>;
458
- };
459
- orders: {
460
1359
  list: (query?: OperationQuery<"listOrders">, options?: RenterraCallOptions) => Promise<{
461
1360
  data: {
462
1361
  id: string;
@@ -467,9 +1366,11 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
467
1366
  branch_id: string;
468
1367
  start_time: string;
469
1368
  end_time: string | null;
470
- job_number: string | null;
471
- job_description: string | null;
472
- po_number: string | null;
1369
+ metadata: {
1370
+ po_number: string | null;
1371
+ job_number: string | null;
1372
+ job_description: string | null;
1373
+ };
473
1374
  contract_signed_at: string | null;
474
1375
  is_historical: boolean;
475
1376
  items: {
@@ -491,7 +1392,7 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
491
1392
  has_more: boolean;
492
1393
  };
493
1394
  }>;
494
- get: (id: OperationPath<"getOrder">["id"], options?: RenterraCallOptions) => Promise<{
1395
+ create: (input: OperationBody<"createOrder">, options?: RenterraCallOptions) => Promise<{
495
1396
  id: string;
496
1397
  number: number;
497
1398
  source: "Online" | "Manual";
@@ -500,9 +1401,11 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
500
1401
  branch_id: string;
501
1402
  start_time: string;
502
1403
  end_time: string | null;
503
- job_number: string | null;
504
- job_description: string | null;
505
- po_number: string | null;
1404
+ metadata: {
1405
+ po_number: string | null;
1406
+ job_number: string | null;
1407
+ job_description: string | null;
1408
+ };
506
1409
  contract_signed_at: string | null;
507
1410
  is_historical: boolean;
508
1411
  items: {
@@ -680,6 +1583,13 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
680
1583
  refunded_payment_id: string | null;
681
1584
  }[];
682
1585
  }>;
1586
+ pdf: (id: OperationPath<"getInvoice">["id"], options?: RenterraCallOptions) => Promise<Blob>;
1587
+ update: (id: OperationPath<"updateInvoice">["id"], input: OperationBody<"updateInvoice">, options?: RenterraCallOptions) => Promise<{
1588
+ id: string;
1589
+ }>;
1590
+ void: (id: OperationPath<"voidInvoice">["id"], options?: RenterraCallOptions) => Promise<{
1591
+ id: string;
1592
+ }>;
683
1593
  };
684
1594
  payments: {
685
1595
  list: (query?: OperationQuery<"listPayments">, options?: RenterraCallOptions) => Promise<{
@@ -730,6 +1640,9 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
730
1640
  workOrders: {
731
1641
  list: (query?: OperationQuery<"listMaintenanceWorkOrders">, options?: RenterraCallOptions) => Promise<{
732
1642
  data: {
1643
+ metadata: {
1644
+ po_number: string | null;
1645
+ };
733
1646
  id: string;
734
1647
  number: number;
735
1648
  status: "Open" | "Closed";
@@ -749,9 +1662,28 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
749
1662
  };
750
1663
  }>;
751
1664
  };
1665
+ createWorkOrder: (input: OperationBody<"createMaintenanceWorkOrder">, options?: RenterraCallOptions) => Promise<{
1666
+ metadata: {
1667
+ po_number: string | null;
1668
+ };
1669
+ id: string;
1670
+ number: number;
1671
+ status: "Open" | "Closed";
1672
+ type: ("Preventative" | "Repair") | null;
1673
+ severity: ("Hard" | "Soft") | null;
1674
+ item_id: string | null;
1675
+ start_date: string;
1676
+ end_date: string | null;
1677
+ created_at: string;
1678
+ inventory_on_order_ids: string[];
1679
+ is_historical: boolean;
1680
+ }>;
752
1681
  serviceOrders: {
753
1682
  list: (query?: OperationQuery<"listMaintenanceServiceOrders">, options?: RenterraCallOptions) => Promise<{
754
1683
  data: {
1684
+ metadata: {
1685
+ po_number: string | null;
1686
+ };
755
1687
  id: string;
756
1688
  number: number;
757
1689
  status: "Open" | "Closed";
@@ -770,6 +1702,82 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
770
1702
  };
771
1703
  }>;
772
1704
  };
1705
+ createServiceOrder: (input: OperationBody<"createMaintenanceServiceOrder">, options?: RenterraCallOptions) => Promise<{
1706
+ metadata: {
1707
+ po_number: string | null;
1708
+ };
1709
+ id: string;
1710
+ number: number;
1711
+ status: "Open" | "Closed";
1712
+ customer_id: string | null;
1713
+ item_id: string | null;
1714
+ start_date: string;
1715
+ end_date: string | null;
1716
+ created_at: string;
1717
+ inventory_on_order_ids: string[];
1718
+ is_historical: boolean;
1719
+ }>;
1720
+ getWorkOrder: (id: OperationPath<"getMaintenanceWorkOrder">["id"], options?: RenterraCallOptions) => Promise<{
1721
+ metadata: {
1722
+ po_number: string | null;
1723
+ };
1724
+ id: string;
1725
+ number: number;
1726
+ status: "Open" | "Closed";
1727
+ type: ("Preventative" | "Repair") | null;
1728
+ severity: ("Hard" | "Soft") | null;
1729
+ item_id: string | null;
1730
+ start_date: string;
1731
+ end_date: string | null;
1732
+ created_at: string;
1733
+ inventory_on_order_ids: string[];
1734
+ is_historical: boolean;
1735
+ assigned_to_id: string | null;
1736
+ description: string;
1737
+ branch_id: string;
1738
+ order_id: string | null;
1739
+ notes: string | null;
1740
+ public_notes: string | null;
1741
+ tax_exempt: boolean;
1742
+ quantity: number | null;
1743
+ external_inventory_id: string | null;
1744
+ }>;
1745
+ updateWorkOrder: (id: OperationPath<"updateMaintenanceWorkOrder">["id"], input: OperationBody<"updateMaintenanceWorkOrder">, options?: RenterraCallOptions) => Promise<{
1746
+ id: string;
1747
+ }>;
1748
+ getServiceOrder: (id: OperationPath<"getMaintenanceServiceOrder">["id"], options?: RenterraCallOptions) => Promise<{
1749
+ metadata: {
1750
+ po_number: string | null;
1751
+ };
1752
+ id: string;
1753
+ number: number;
1754
+ status: "Open" | "Closed";
1755
+ customer_id: string | null;
1756
+ item_id: string | null;
1757
+ start_date: string;
1758
+ end_date: string | null;
1759
+ created_at: string;
1760
+ inventory_on_order_ids: string[];
1761
+ is_historical: boolean;
1762
+ assigned_to_id: string | null;
1763
+ description: string;
1764
+ branch_id: string;
1765
+ order_id: string | null;
1766
+ notes: string | null;
1767
+ public_notes: string | null;
1768
+ tax_exempt: boolean;
1769
+ quantity: number | null;
1770
+ external_inventory_id: string | null;
1771
+ }>;
1772
+ updateServiceOrder: (id: OperationPath<"updateMaintenanceServiceOrder">["id"], input: OperationBody<"updateMaintenanceServiceOrder">, options?: RenterraCallOptions) => Promise<{
1773
+ id: string;
1774
+ }>;
1775
+ closeWorkOrder: (id: OperationPath<"closeMaintenanceWorkOrder">["id"], options?: RenterraCallOptions) => Promise<{
1776
+ id: string;
1777
+ }>;
1778
+ closeServiceOrder: (id: OperationPath<"closeMaintenanceServiceOrder">["id"], options?: RenterraCallOptions) => Promise<{
1779
+ id: string;
1780
+ }>;
773
1781
  };
774
1782
  automation: {
775
1783
  rules: {
@@ -778,10 +1786,16 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
778
1786
  id: string;
779
1787
  name: string;
780
1788
  revision: number;
781
- status: "draft";
1789
+ status: "draft" | "active";
782
1790
  definition: {
783
1791
  schema_version: 1;
784
- subject: "invoice" | "order";
1792
+ task_execution_enabled?: boolean | undefined;
1793
+ execution_enabled?: boolean | undefined;
1794
+ subject: "invoice" | "order" | "contact" | "customer" | "task" | "statement" | "work_order" | "purchase_order";
1795
+ managed_source?: {
1796
+ kind: "communication" | "organization" | "statement";
1797
+ key: string;
1798
+ } | undefined;
785
1799
  triggers: ({
786
1800
  id: string;
787
1801
  kind: "event";
@@ -790,6 +1804,14 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
790
1804
  id: string;
791
1805
  kind: "event";
792
1806
  type: "order.created" | "order.completed";
1807
+ } | {
1808
+ id: string;
1809
+ kind: "event";
1810
+ type: "contract.signed" | "quote.submitted" | "delivery.dispatched" | "delivery.completed" | "task.call_off.completed" | "task.call_off.cancelled" | "task.extend.completed" | "task.extend.cancelled" | "task.general.completed" | "task.general.cancelled" | "task.delete_payment_method.completed" | "task.delete_payment_method.cancelled";
1811
+ } | {
1812
+ id: string;
1813
+ kind: "event";
1814
+ type: "invoice.created" | "customer.created" | "contact.created" | "work_order.created" | "purchase_order.created";
793
1815
  } | {
794
1816
  id: string;
795
1817
  kind: "business_date";
@@ -800,6 +1822,18 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
800
1822
  kind: "business_date";
801
1823
  type: "completed_order";
802
1824
  offset_hours: number;
1825
+ } | {
1826
+ id: string;
1827
+ kind: "business_date";
1828
+ type: "contact_license_expiry" | "customer_insurance_expiry" | "reservation_start" | "quote_start" | "rental_item_due" | "rental_item_overdue" | "quote_created" | "bad_debt_invoice_due";
1829
+ offset_hours: number;
1830
+ } | {
1831
+ id: string;
1832
+ kind: "schedule";
1833
+ type: "statement.schedule";
1834
+ cron: string;
1835
+ timezone: string;
1836
+ schedule_id: string;
803
1837
  })[];
804
1838
  conditions: {
805
1839
  all: ({
@@ -810,6 +1844,18 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
810
1844
  field: "order.starting_location_id";
811
1845
  operator: "in";
812
1846
  value: string[];
1847
+ } | {
1848
+ field: "customer.type";
1849
+ operator: "equals" | "not_equals";
1850
+ value: "Individual" | "Company";
1851
+ } | {
1852
+ field: "customer.status";
1853
+ operator: "equals" | "not_equals";
1854
+ value: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
1855
+ } | {
1856
+ field: "customer.account_type";
1857
+ operator: "equals" | "not_equals";
1858
+ value: "Cash" | "Account";
813
1859
  })[];
814
1860
  };
815
1861
  actions: ({
@@ -821,10 +1867,30 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
821
1867
  template_id: string;
822
1868
  channel: "email" | "sms";
823
1869
  enabled?: boolean | undefined;
824
- recipient: "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | {
825
- first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
1870
+ recipient: "contact" | "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | "task.requester" | {
1871
+ first_available: ("contact" | "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | "task.requester")[];
826
1872
  };
827
- attachments?: "invoice_pdf"[] | undefined;
1873
+ attachments?: ("invoice_pdf" | "contract_pdf")[] | undefined;
1874
+ } | {
1875
+ id: string;
1876
+ type: "order.expire_quote";
1877
+ enabled: boolean;
1878
+ } | {
1879
+ id: string;
1880
+ type: "invoice.mark_bad_debt";
1881
+ enabled: boolean;
1882
+ reason: "Automated Bad Debt";
1883
+ } | {
1884
+ id: string;
1885
+ type: "statement.send";
1886
+ enabled: boolean;
1887
+ customer_id?: string | undefined;
1888
+ } | {
1889
+ id: string;
1890
+ type: "task.create";
1891
+ title: string;
1892
+ description?: string | null | undefined;
1893
+ priority?: "None" | "Low" | "Medium" | "High" | "Urgent" | undefined;
828
1894
  })[];
829
1895
  };
830
1896
  created_at: string;
@@ -837,10 +1903,16 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
837
1903
  id: string;
838
1904
  name: string;
839
1905
  revision: number;
840
- status: "draft";
1906
+ status: "draft" | "active";
841
1907
  definition: {
842
1908
  schema_version: 1;
843
- subject: "invoice" | "order";
1909
+ task_execution_enabled?: boolean | undefined;
1910
+ execution_enabled?: boolean | undefined;
1911
+ subject: "invoice" | "order" | "contact" | "customer" | "task" | "statement" | "work_order" | "purchase_order";
1912
+ managed_source?: {
1913
+ kind: "communication" | "organization" | "statement";
1914
+ key: string;
1915
+ } | undefined;
844
1916
  triggers: ({
845
1917
  id: string;
846
1918
  kind: "event";
@@ -849,6 +1921,14 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
849
1921
  id: string;
850
1922
  kind: "event";
851
1923
  type: "order.created" | "order.completed";
1924
+ } | {
1925
+ id: string;
1926
+ kind: "event";
1927
+ type: "contract.signed" | "quote.submitted" | "delivery.dispatched" | "delivery.completed" | "task.call_off.completed" | "task.call_off.cancelled" | "task.extend.completed" | "task.extend.cancelled" | "task.general.completed" | "task.general.cancelled" | "task.delete_payment_method.completed" | "task.delete_payment_method.cancelled";
1928
+ } | {
1929
+ id: string;
1930
+ kind: "event";
1931
+ type: "invoice.created" | "customer.created" | "contact.created" | "work_order.created" | "purchase_order.created";
852
1932
  } | {
853
1933
  id: string;
854
1934
  kind: "business_date";
@@ -859,6 +1939,18 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
859
1939
  kind: "business_date";
860
1940
  type: "completed_order";
861
1941
  offset_hours: number;
1942
+ } | {
1943
+ id: string;
1944
+ kind: "business_date";
1945
+ type: "contact_license_expiry" | "customer_insurance_expiry" | "reservation_start" | "quote_start" | "rental_item_due" | "rental_item_overdue" | "quote_created" | "bad_debt_invoice_due";
1946
+ offset_hours: number;
1947
+ } | {
1948
+ id: string;
1949
+ kind: "schedule";
1950
+ type: "statement.schedule";
1951
+ cron: string;
1952
+ timezone: string;
1953
+ schedule_id: string;
862
1954
  })[];
863
1955
  conditions: {
864
1956
  all: ({
@@ -869,6 +1961,18 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
869
1961
  field: "order.starting_location_id";
870
1962
  operator: "in";
871
1963
  value: string[];
1964
+ } | {
1965
+ field: "customer.type";
1966
+ operator: "equals" | "not_equals";
1967
+ value: "Individual" | "Company";
1968
+ } | {
1969
+ field: "customer.status";
1970
+ operator: "equals" | "not_equals";
1971
+ value: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
1972
+ } | {
1973
+ field: "customer.account_type";
1974
+ operator: "equals" | "not_equals";
1975
+ value: "Cash" | "Account";
872
1976
  })[];
873
1977
  };
874
1978
  actions: ({
@@ -880,10 +1984,30 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
880
1984
  template_id: string;
881
1985
  channel: "email" | "sms";
882
1986
  enabled?: boolean | undefined;
883
- recipient: "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | {
884
- first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
1987
+ recipient: "contact" | "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | "task.requester" | {
1988
+ first_available: ("contact" | "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | "task.requester")[];
885
1989
  };
886
- attachments?: "invoice_pdf"[] | undefined;
1990
+ attachments?: ("invoice_pdf" | "contract_pdf")[] | undefined;
1991
+ } | {
1992
+ id: string;
1993
+ type: "order.expire_quote";
1994
+ enabled: boolean;
1995
+ } | {
1996
+ id: string;
1997
+ type: "invoice.mark_bad_debt";
1998
+ enabled: boolean;
1999
+ reason: "Automated Bad Debt";
2000
+ } | {
2001
+ id: string;
2002
+ type: "statement.send";
2003
+ enabled: boolean;
2004
+ customer_id?: string | undefined;
2005
+ } | {
2006
+ id: string;
2007
+ type: "task.create";
2008
+ title: string;
2009
+ description?: string | null | undefined;
2010
+ priority?: "None" | "Low" | "Medium" | "High" | "Urgent" | undefined;
887
2011
  })[];
888
2012
  };
889
2013
  created_at: string;
@@ -894,10 +2018,16 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
894
2018
  id: string;
895
2019
  name: string;
896
2020
  revision: number;
897
- status: "draft";
2021
+ status: "draft" | "active";
898
2022
  definition: {
899
2023
  schema_version: 1;
900
- subject: "invoice" | "order";
2024
+ task_execution_enabled?: boolean | undefined;
2025
+ execution_enabled?: boolean | undefined;
2026
+ subject: "invoice" | "order" | "contact" | "customer" | "task" | "statement" | "work_order" | "purchase_order";
2027
+ managed_source?: {
2028
+ kind: "communication" | "organization" | "statement";
2029
+ key: string;
2030
+ } | undefined;
901
2031
  triggers: ({
902
2032
  id: string;
903
2033
  kind: "event";
@@ -906,6 +2036,14 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
906
2036
  id: string;
907
2037
  kind: "event";
908
2038
  type: "order.created" | "order.completed";
2039
+ } | {
2040
+ id: string;
2041
+ kind: "event";
2042
+ type: "contract.signed" | "quote.submitted" | "delivery.dispatched" | "delivery.completed" | "task.call_off.completed" | "task.call_off.cancelled" | "task.extend.completed" | "task.extend.cancelled" | "task.general.completed" | "task.general.cancelled" | "task.delete_payment_method.completed" | "task.delete_payment_method.cancelled";
2043
+ } | {
2044
+ id: string;
2045
+ kind: "event";
2046
+ type: "invoice.created" | "customer.created" | "contact.created" | "work_order.created" | "purchase_order.created";
909
2047
  } | {
910
2048
  id: string;
911
2049
  kind: "business_date";
@@ -916,6 +2054,18 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
916
2054
  kind: "business_date";
917
2055
  type: "completed_order";
918
2056
  offset_hours: number;
2057
+ } | {
2058
+ id: string;
2059
+ kind: "business_date";
2060
+ type: "contact_license_expiry" | "customer_insurance_expiry" | "reservation_start" | "quote_start" | "rental_item_due" | "rental_item_overdue" | "quote_created" | "bad_debt_invoice_due";
2061
+ offset_hours: number;
2062
+ } | {
2063
+ id: string;
2064
+ kind: "schedule";
2065
+ type: "statement.schedule";
2066
+ cron: string;
2067
+ timezone: string;
2068
+ schedule_id: string;
919
2069
  })[];
920
2070
  conditions: {
921
2071
  all: ({
@@ -926,6 +2076,18 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
926
2076
  field: "order.starting_location_id";
927
2077
  operator: "in";
928
2078
  value: string[];
2079
+ } | {
2080
+ field: "customer.type";
2081
+ operator: "equals" | "not_equals";
2082
+ value: "Individual" | "Company";
2083
+ } | {
2084
+ field: "customer.status";
2085
+ operator: "equals" | "not_equals";
2086
+ value: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
2087
+ } | {
2088
+ field: "customer.account_type";
2089
+ operator: "equals" | "not_equals";
2090
+ value: "Cash" | "Account";
929
2091
  })[];
930
2092
  };
931
2093
  actions: ({
@@ -937,10 +2099,30 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
937
2099
  template_id: string;
938
2100
  channel: "email" | "sms";
939
2101
  enabled?: boolean | undefined;
940
- recipient: "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | {
941
- first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
2102
+ recipient: "contact" | "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | "task.requester" | {
2103
+ first_available: ("contact" | "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | "task.requester")[];
942
2104
  };
943
- attachments?: "invoice_pdf"[] | undefined;
2105
+ attachments?: ("invoice_pdf" | "contract_pdf")[] | undefined;
2106
+ } | {
2107
+ id: string;
2108
+ type: "order.expire_quote";
2109
+ enabled: boolean;
2110
+ } | {
2111
+ id: string;
2112
+ type: "invoice.mark_bad_debt";
2113
+ enabled: boolean;
2114
+ reason: "Automated Bad Debt";
2115
+ } | {
2116
+ id: string;
2117
+ type: "statement.send";
2118
+ enabled: boolean;
2119
+ customer_id?: string | undefined;
2120
+ } | {
2121
+ id: string;
2122
+ type: "task.create";
2123
+ title: string;
2124
+ description?: string | null | undefined;
2125
+ priority?: "None" | "Low" | "Medium" | "High" | "Urgent" | undefined;
944
2126
  })[];
945
2127
  };
946
2128
  created_at: string;
@@ -951,10 +2133,16 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
951
2133
  id: string;
952
2134
  name: string;
953
2135
  revision: number;
954
- status: "draft";
2136
+ status: "draft" | "active";
955
2137
  definition: {
956
2138
  schema_version: 1;
957
- subject: "invoice" | "order";
2139
+ task_execution_enabled?: boolean | undefined;
2140
+ execution_enabled?: boolean | undefined;
2141
+ subject: "invoice" | "order" | "contact" | "customer" | "task" | "statement" | "work_order" | "purchase_order";
2142
+ managed_source?: {
2143
+ kind: "communication" | "organization" | "statement";
2144
+ key: string;
2145
+ } | undefined;
958
2146
  triggers: ({
959
2147
  id: string;
960
2148
  kind: "event";
@@ -963,6 +2151,14 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
963
2151
  id: string;
964
2152
  kind: "event";
965
2153
  type: "order.created" | "order.completed";
2154
+ } | {
2155
+ id: string;
2156
+ kind: "event";
2157
+ type: "contract.signed" | "quote.submitted" | "delivery.dispatched" | "delivery.completed" | "task.call_off.completed" | "task.call_off.cancelled" | "task.extend.completed" | "task.extend.cancelled" | "task.general.completed" | "task.general.cancelled" | "task.delete_payment_method.completed" | "task.delete_payment_method.cancelled";
2158
+ } | {
2159
+ id: string;
2160
+ kind: "event";
2161
+ type: "invoice.created" | "customer.created" | "contact.created" | "work_order.created" | "purchase_order.created";
966
2162
  } | {
967
2163
  id: string;
968
2164
  kind: "business_date";
@@ -973,6 +2169,18 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
973
2169
  kind: "business_date";
974
2170
  type: "completed_order";
975
2171
  offset_hours: number;
2172
+ } | {
2173
+ id: string;
2174
+ kind: "business_date";
2175
+ type: "contact_license_expiry" | "customer_insurance_expiry" | "reservation_start" | "quote_start" | "rental_item_due" | "rental_item_overdue" | "quote_created" | "bad_debt_invoice_due";
2176
+ offset_hours: number;
2177
+ } | {
2178
+ id: string;
2179
+ kind: "schedule";
2180
+ type: "statement.schedule";
2181
+ cron: string;
2182
+ timezone: string;
2183
+ schedule_id: string;
976
2184
  })[];
977
2185
  conditions: {
978
2186
  all: ({
@@ -983,6 +2191,18 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
983
2191
  field: "order.starting_location_id";
984
2192
  operator: "in";
985
2193
  value: string[];
2194
+ } | {
2195
+ field: "customer.type";
2196
+ operator: "equals" | "not_equals";
2197
+ value: "Individual" | "Company";
2198
+ } | {
2199
+ field: "customer.status";
2200
+ operator: "equals" | "not_equals";
2201
+ value: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
2202
+ } | {
2203
+ field: "customer.account_type";
2204
+ operator: "equals" | "not_equals";
2205
+ value: "Cash" | "Account";
986
2206
  })[];
987
2207
  };
988
2208
  actions: ({
@@ -994,10 +2214,30 @@ export declare function createResources({ client, requestOptions, unwrap }: Retu
994
2214
  template_id: string;
995
2215
  channel: "email" | "sms";
996
2216
  enabled?: boolean | undefined;
997
- recipient: "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | {
998
- first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
2217
+ recipient: "contact" | "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | "task.requester" | {
2218
+ first_available: ("contact" | "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | "task.requester")[];
999
2219
  };
1000
- attachments?: "invoice_pdf"[] | undefined;
2220
+ attachments?: ("invoice_pdf" | "contract_pdf")[] | undefined;
2221
+ } | {
2222
+ id: string;
2223
+ type: "order.expire_quote";
2224
+ enabled: boolean;
2225
+ } | {
2226
+ id: string;
2227
+ type: "invoice.mark_bad_debt";
2228
+ enabled: boolean;
2229
+ reason: "Automated Bad Debt";
2230
+ } | {
2231
+ id: string;
2232
+ type: "statement.send";
2233
+ enabled: boolean;
2234
+ customer_id?: string | undefined;
2235
+ } | {
2236
+ id: string;
2237
+ type: "task.create";
2238
+ title: string;
2239
+ description?: string | null | undefined;
2240
+ priority?: "None" | "Low" | "Medium" | "High" | "Urgent" | undefined;
1001
2241
  })[];
1002
2242
  };
1003
2243
  created_at: string;