@renterra/sdk 0.2.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,1014 @@
1
+ import type { RenterraCallOptions, createResourceTransport } from "../transport.js";
2
+ import type { operations } from "./rest.js";
3
+ type OperationQuery<Operation extends keyof operations> = operations[Operation] extends {
4
+ parameters: {
5
+ query?: infer Query;
6
+ };
7
+ } ? NonNullable<Query> : never;
8
+ type OperationPath<Operation extends keyof operations> = operations[Operation] extends {
9
+ parameters: {
10
+ path: infer Path;
11
+ };
12
+ } ? Path : never;
13
+ type OperationBody<Operation extends keyof operations> = operations[Operation] extends {
14
+ requestBody: {
15
+ content: {
16
+ "application/json": infer Body;
17
+ };
18
+ };
19
+ } ? Body : never;
20
+ export declare function createResources({ client, requestOptions, unwrap }: ReturnType<typeof createResourceTransport>): {
21
+ customers: {
22
+ list: (query?: OperationQuery<"listCustomers">, options?: RenterraCallOptions) => Promise<{
23
+ data: {
24
+ id: string;
25
+ created_at: string;
26
+ updated_at: string;
27
+ is_archived: boolean;
28
+ archived_at: string | null;
29
+ deleted_at: string | null;
30
+ name: string;
31
+ type: "Individual" | "Company";
32
+ status: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
33
+ account_type: "Cash" | "Account";
34
+ billing_email: string | null;
35
+ website: string | null;
36
+ primary_contact_id: string | null;
37
+ credit_balance: number;
38
+ total_revenue: number;
39
+ ytd_revenue: number;
40
+ address: {
41
+ address_line_1: string;
42
+ address_line_2: string | null;
43
+ locality: string;
44
+ administrative_area: string;
45
+ postal_code: string | null;
46
+ country: string | null;
47
+ } | null;
48
+ }[];
49
+ pagination: {
50
+ page: number;
51
+ page_size: number;
52
+ has_more: boolean;
53
+ };
54
+ }>;
55
+ create: (input: OperationBody<"createCustomer">, options?: RenterraCallOptions) => Promise<{
56
+ id: string;
57
+ created_at: string;
58
+ updated_at: string;
59
+ is_archived: boolean;
60
+ archived_at: string | null;
61
+ deleted_at: string | null;
62
+ name: string;
63
+ type: "Individual" | "Company";
64
+ status: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
65
+ account_type: "Cash" | "Account";
66
+ billing_email: string | null;
67
+ website: string | null;
68
+ primary_contact_id: string | null;
69
+ credit_balance: number;
70
+ total_revenue: number;
71
+ ytd_revenue: number;
72
+ address: {
73
+ address_line_1: string;
74
+ address_line_2: string | null;
75
+ locality: string;
76
+ administrative_area: string;
77
+ postal_code: string | null;
78
+ country: string | null;
79
+ } | null;
80
+ }>;
81
+ get: (id: OperationPath<"getCustomer">["id"], options?: RenterraCallOptions) => Promise<{
82
+ id: string;
83
+ created_at: string;
84
+ updated_at: string;
85
+ is_archived: boolean;
86
+ archived_at: string | null;
87
+ deleted_at: string | null;
88
+ name: string;
89
+ type: "Individual" | "Company";
90
+ status: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
91
+ account_type: "Cash" | "Account";
92
+ billing_email: string | null;
93
+ website: string | null;
94
+ primary_contact_id: string | null;
95
+ credit_balance: number;
96
+ total_revenue: number;
97
+ ytd_revenue: number;
98
+ address: {
99
+ address_line_1: string;
100
+ address_line_2: string | null;
101
+ locality: string;
102
+ administrative_area: string;
103
+ postal_code: string | null;
104
+ country: string | null;
105
+ } | null;
106
+ }>;
107
+ update: (id: OperationPath<"updateCustomer">["id"], input: OperationBody<"updateCustomer">, options?: RenterraCallOptions) => Promise<{
108
+ id: string;
109
+ created_at: string;
110
+ updated_at: string;
111
+ is_archived: boolean;
112
+ archived_at: string | null;
113
+ deleted_at: string | null;
114
+ name: string;
115
+ type: "Individual" | "Company";
116
+ status: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
117
+ account_type: "Cash" | "Account";
118
+ billing_email: string | null;
119
+ website: string | null;
120
+ primary_contact_id: string | null;
121
+ credit_balance: number;
122
+ total_revenue: number;
123
+ ytd_revenue: number;
124
+ address: {
125
+ address_line_1: string;
126
+ address_line_2: string | null;
127
+ locality: string;
128
+ administrative_area: string;
129
+ postal_code: string | null;
130
+ country: string | null;
131
+ } | null;
132
+ }>;
133
+ };
134
+ contacts: {
135
+ list: (query?: OperationQuery<"listContacts">, options?: RenterraCallOptions) => Promise<{
136
+ data: {
137
+ id: string;
138
+ created_at: string;
139
+ updated_at: string;
140
+ customer_id: string;
141
+ first_name: string | null;
142
+ last_name: string | null;
143
+ email: string | null;
144
+ phone: string | null;
145
+ title: string | null;
146
+ }[];
147
+ pagination: {
148
+ page: number;
149
+ page_size: number;
150
+ has_more: boolean;
151
+ };
152
+ }>;
153
+ update: (id: OperationPath<"updateContact">["id"], input: OperationBody<"updateContact">, options?: RenterraCallOptions) => Promise<{
154
+ id: string;
155
+ created_at: string;
156
+ updated_at: string;
157
+ customer_id: string;
158
+ first_name: string | null;
159
+ last_name: string | null;
160
+ email: string | null;
161
+ phone: string | null;
162
+ title: string | null;
163
+ }>;
164
+ };
165
+ tasks: {
166
+ list: (query?: OperationQuery<"listTasks">, options?: RenterraCallOptions) => Promise<{
167
+ data: {
168
+ [x: string]: unknown;
169
+ id: string;
170
+ created_at: string;
171
+ updated_at: string;
172
+ deleted_at: string | null;
173
+ title: string;
174
+ description: string | null;
175
+ status: "Open" | "Completed" | "Canceled";
176
+ priority: "None" | "Low" | "Medium" | "High" | "Urgent";
177
+ source: "Web" | "Api";
178
+ due_at: string | null;
179
+ completed_at: string | null;
180
+ canceled_at: string | null;
181
+ created_by_user_id: string | null;
182
+ assignee_user_id: string | null;
183
+ location_id: string | null;
184
+ customer_id: string | null;
185
+ order_id: string | null;
186
+ item_id: string | null;
187
+ work_order_id: string | null;
188
+ purchase_order_id: string | null;
189
+ conversation_id: string | null;
190
+ reminders: {
191
+ id: string;
192
+ scheduled_at: string;
193
+ sent_at: string | null;
194
+ canceled_at: string | null;
195
+ }[];
196
+ }[];
197
+ pagination: {
198
+ page: number;
199
+ page_size: number;
200
+ has_more: boolean;
201
+ total: number;
202
+ };
203
+ }>;
204
+ create: (input: OperationBody<"createTask">, options?: RenterraCallOptions) => Promise<{
205
+ [x: string]: unknown;
206
+ id: string;
207
+ created_at: string;
208
+ updated_at: string;
209
+ deleted_at: string | null;
210
+ title: string;
211
+ description: string | null;
212
+ status: "Open" | "Completed" | "Canceled";
213
+ priority: "None" | "Low" | "Medium" | "High" | "Urgent";
214
+ source: "Web" | "Api";
215
+ due_at: string | null;
216
+ completed_at: string | null;
217
+ canceled_at: string | null;
218
+ created_by_user_id: string | null;
219
+ assignee_user_id: string | null;
220
+ location_id: string | null;
221
+ customer_id: string | null;
222
+ order_id: string | null;
223
+ item_id: string | null;
224
+ work_order_id: string | null;
225
+ purchase_order_id: string | null;
226
+ conversation_id: string | null;
227
+ reminders: {
228
+ id: string;
229
+ scheduled_at: string;
230
+ sent_at: string | null;
231
+ canceled_at: string | null;
232
+ }[];
233
+ }>;
234
+ get: (id: OperationPath<"getTask">["id"], options?: RenterraCallOptions) => Promise<{
235
+ [x: string]: unknown;
236
+ id: string;
237
+ created_at: string;
238
+ updated_at: string;
239
+ deleted_at: string | null;
240
+ title: string;
241
+ description: string | null;
242
+ status: "Open" | "Completed" | "Canceled";
243
+ priority: "None" | "Low" | "Medium" | "High" | "Urgent";
244
+ source: "Web" | "Api";
245
+ due_at: string | null;
246
+ completed_at: string | null;
247
+ canceled_at: string | null;
248
+ created_by_user_id: string | null;
249
+ assignee_user_id: string | null;
250
+ location_id: string | null;
251
+ customer_id: string | null;
252
+ order_id: string | null;
253
+ item_id: string | null;
254
+ work_order_id: string | null;
255
+ purchase_order_id: string | null;
256
+ conversation_id: string | null;
257
+ reminders: {
258
+ id: string;
259
+ scheduled_at: string;
260
+ sent_at: string | null;
261
+ canceled_at: string | null;
262
+ }[];
263
+ }>;
264
+ update: (id: OperationPath<"updateTask">["id"], input: OperationBody<"updateTask">, options?: RenterraCallOptions) => Promise<{
265
+ [x: string]: unknown;
266
+ id: string;
267
+ created_at: string;
268
+ updated_at: string;
269
+ deleted_at: string | null;
270
+ title: string;
271
+ description: string | null;
272
+ status: "Open" | "Completed" | "Canceled";
273
+ priority: "None" | "Low" | "Medium" | "High" | "Urgent";
274
+ source: "Web" | "Api";
275
+ due_at: string | null;
276
+ completed_at: string | null;
277
+ canceled_at: string | null;
278
+ created_by_user_id: string | null;
279
+ assignee_user_id: string | null;
280
+ location_id: string | null;
281
+ customer_id: string | null;
282
+ order_id: string | null;
283
+ item_id: string | null;
284
+ work_order_id: string | null;
285
+ purchase_order_id: string | null;
286
+ conversation_id: string | null;
287
+ reminders: {
288
+ id: string;
289
+ scheduled_at: string;
290
+ sent_at: string | null;
291
+ canceled_at: string | null;
292
+ }[];
293
+ }>;
294
+ delete: (id: OperationPath<"deleteTask">["id"], options?: RenterraCallOptions) => Promise<void>;
295
+ };
296
+ reports: {
297
+ list: (options?: RenterraCallOptions) => Promise<undefined>;
298
+ get: (id: OperationPath<"getReport">["id"], options?: RenterraCallOptions) => Promise<undefined>;
299
+ };
300
+ inventory: {
301
+ items: {
302
+ list: (query?: OperationQuery<"listInventoryItems">, options?: RenterraCallOptions) => Promise<{
303
+ data: {
304
+ id: string;
305
+ updated_at: string;
306
+ kind: "Actual" | "Slot";
307
+ type: "Serial" | "Sale" | "Bulk" | "Part";
308
+ make: string | null;
309
+ model: string | null;
310
+ model_year: number | null;
311
+ condition: ("Excellent" | "Good" | "Ok" | "Bad" | "Terrible") | null;
312
+ item_number: string | null;
313
+ part_number: string | null;
314
+ serial_number: string | null;
315
+ description: string;
316
+ category: string;
317
+ class: string;
318
+ group: string;
319
+ }[];
320
+ pagination: {
321
+ page: number;
322
+ page_size: number;
323
+ has_more: boolean;
324
+ };
325
+ }>;
326
+ get: (id: OperationPath<"getInventoryItem">["id"], options?: RenterraCallOptions) => Promise<{
327
+ id: string;
328
+ updated_at: string;
329
+ kind: "Actual" | "Slot";
330
+ type: "Serial" | "Sale" | "Bulk" | "Part";
331
+ make: string | null;
332
+ model: string | null;
333
+ model_year: number | null;
334
+ condition: ("Excellent" | "Good" | "Ok" | "Bad" | "Terrible") | null;
335
+ item_number: string | null;
336
+ part_number: string | null;
337
+ serial_number: string | null;
338
+ description: string;
339
+ category: string;
340
+ class: string;
341
+ group: string;
342
+ }>;
343
+ analytics: (id: OperationPath<"getInventoryItemAnalytics">["id"], options?: RenterraCallOptions) => Promise<undefined>;
344
+ };
345
+ kits: {
346
+ list: (query?: OperationQuery<"listInventoryKits">, options?: RenterraCallOptions) => Promise<{
347
+ data: {
348
+ id: string;
349
+ name: string;
350
+ status: "active" | "archived";
351
+ items: {
352
+ item_id: string;
353
+ quantity: number;
354
+ }[];
355
+ }[];
356
+ pagination: {
357
+ page: number;
358
+ page_size: number;
359
+ has_more: boolean;
360
+ };
361
+ }>;
362
+ };
363
+ orders: {
364
+ list: (query?: OperationQuery<"listInventoryOnOrders">, options?: RenterraCallOptions) => Promise<{
365
+ data: ({
366
+ id: string;
367
+ source: "order" | "work_order";
368
+ order_id: string | null;
369
+ work_order_id: string | null;
370
+ line_id: string;
371
+ item_id: string;
372
+ slot_id: string | null;
373
+ description: string;
374
+ quantity: number;
375
+ status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
376
+ type: "rental";
377
+ billing_start_time: string;
378
+ billing_end_time: string | null;
379
+ } | {
380
+ id: string;
381
+ source: "order" | "work_order";
382
+ order_id: string | null;
383
+ work_order_id: string | null;
384
+ line_id: string;
385
+ item_id: string;
386
+ slot_id: string | null;
387
+ description: string;
388
+ quantity: number;
389
+ status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
390
+ type: "sale";
391
+ sale_time: string | null;
392
+ })[];
393
+ pagination: {
394
+ page: number;
395
+ page_size: number;
396
+ has_more: boolean;
397
+ };
398
+ }>;
399
+ get: (id: OperationPath<"getInventoryOnOrder">["id"], options?: RenterraCallOptions) => Promise<{
400
+ id: string;
401
+ source: "order" | "work_order";
402
+ order_id: string | null;
403
+ work_order_id: string | null;
404
+ line_id: string;
405
+ item_id: string;
406
+ slot_id: string | null;
407
+ description: string;
408
+ 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;
421
+ description: string;
422
+ 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: {
432
+ id: string;
433
+ updated_at: string;
434
+ name: string;
435
+ }[];
436
+ pagination: {
437
+ page: number;
438
+ page_size: number;
439
+ has_more: boolean;
440
+ };
441
+ }>;
442
+ };
443
+ vendors: {
444
+ list: (query?: OperationQuery<"listVendors">, options?: RenterraCallOptions) => Promise<{
445
+ data: {
446
+ id: string;
447
+ updated_at: string;
448
+ name: string;
449
+ phone_number: string | null;
450
+ email: string | null;
451
+ }[];
452
+ pagination: {
453
+ page: number;
454
+ page_size: number;
455
+ has_more: boolean;
456
+ };
457
+ }>;
458
+ };
459
+ orders: {
460
+ list: (query?: OperationQuery<"listOrders">, options?: RenterraCallOptions) => Promise<{
461
+ data: {
462
+ id: string;
463
+ number: number;
464
+ source: "Online" | "Manual";
465
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
466
+ customer_id: string;
467
+ branch_id: string;
468
+ start_time: string;
469
+ end_time: string | null;
470
+ job_number: string | null;
471
+ job_description: string | null;
472
+ po_number: string | null;
473
+ contract_signed_at: string | null;
474
+ is_historical: boolean;
475
+ items: {
476
+ description: string;
477
+ quantity: number;
478
+ item_id: string | null;
479
+ }[];
480
+ lines: {
481
+ description: string;
482
+ quantity: number;
483
+ item_id: string | null;
484
+ id: string;
485
+ inventory_on_order_ids: string[];
486
+ }[];
487
+ }[];
488
+ pagination: {
489
+ page: number;
490
+ page_size: number;
491
+ has_more: boolean;
492
+ };
493
+ }>;
494
+ get: (id: OperationPath<"getOrder">["id"], options?: RenterraCallOptions) => Promise<{
495
+ id: string;
496
+ number: number;
497
+ source: "Online" | "Manual";
498
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
499
+ customer_id: string;
500
+ branch_id: string;
501
+ start_time: string;
502
+ end_time: string | null;
503
+ job_number: string | null;
504
+ job_description: string | null;
505
+ po_number: string | null;
506
+ contract_signed_at: string | null;
507
+ is_historical: boolean;
508
+ items: {
509
+ description: string;
510
+ quantity: number;
511
+ item_id: string | null;
512
+ }[];
513
+ lines: {
514
+ description: string;
515
+ quantity: number;
516
+ item_id: string | null;
517
+ id: string;
518
+ inventory_on_order_ids: string[];
519
+ }[];
520
+ }>;
521
+ billingSummary: (id: OperationPath<"getOrderBillingSummary">["id"], options?: RenterraCallOptions) => Promise<{
522
+ items: {
523
+ description: string;
524
+ item_id: string | null;
525
+ qty: number;
526
+ total: number;
527
+ }[];
528
+ subtotal: number;
529
+ tax: number;
530
+ total: number | null;
531
+ }>;
532
+ contracts: {
533
+ list: (id: OperationPath<"listOrderContracts">["id"], options?: RenterraCallOptions) => Promise<{
534
+ data: {
535
+ id: string;
536
+ created_at: string;
537
+ signed_by: string | null;
538
+ is_downloadable: boolean;
539
+ }[];
540
+ }>;
541
+ download: (id: OperationPath<"downloadOrderContract">["id"], contractId: OperationPath<"downloadOrderContract">["contractId"], options?: RenterraCallOptions) => Promise<Blob>;
542
+ };
543
+ };
544
+ accounting: {
545
+ chart: {
546
+ list: (query?: OperationQuery<"listChartAccounts">, options?: RenterraCallOptions) => Promise<{
547
+ data: {
548
+ id: string;
549
+ name: string;
550
+ type: "Asset" | "Liability" | "Equity" | "Income" | "Expense";
551
+ status: "active" | "archived";
552
+ }[];
553
+ pagination: {
554
+ page: number;
555
+ page_size: number;
556
+ has_more: boolean;
557
+ };
558
+ }>;
559
+ };
560
+ ledger: {
561
+ list: (query?: OperationQuery<"listLedgerEntries">, options?: RenterraCallOptions) => Promise<{
562
+ data: {
563
+ id: string;
564
+ time: string;
565
+ account_id: string;
566
+ debit_cents: number;
567
+ credit_cents: number;
568
+ transaction_key: string;
569
+ basis: "Accrual" | "Cash";
570
+ location_id: string | null;
571
+ customer_id: string | null;
572
+ invoice_id: string | null;
573
+ order_id: string | null;
574
+ item_id: string | null;
575
+ vendor_id: string | null;
576
+ }[];
577
+ pagination: {
578
+ page: number;
579
+ page_size: number;
580
+ has_more: boolean;
581
+ };
582
+ }>;
583
+ };
584
+ };
585
+ invoices: {
586
+ list: (query?: OperationQuery<"listInvoices">, options?: RenterraCallOptions) => Promise<{
587
+ data: {
588
+ id: string;
589
+ number: string;
590
+ status: "Unpaid" | "Paid" | "Void" | "BadDebt";
591
+ customer_id: string | null;
592
+ order_id: string | null;
593
+ total_cents: number;
594
+ tax_total_cents: number;
595
+ paid_cents: number;
596
+ issue_date: string | null;
597
+ due_date: string;
598
+ paid_at: string | null;
599
+ items: {
600
+ description: string;
601
+ quantity: number;
602
+ total_cents: number;
603
+ item_id: string | null;
604
+ }[];
605
+ lines: {
606
+ description: string;
607
+ quantity: number;
608
+ total_cents: number;
609
+ item_id: string | null;
610
+ id: string;
611
+ group_id: string;
612
+ sales_tax_cents: number;
613
+ ledger_account_id: string;
614
+ revenue_allocations: {
615
+ item_id: string;
616
+ ledger_account_id: string;
617
+ percentage: number;
618
+ }[];
619
+ }[];
620
+ payments: {
621
+ allocation_id: string;
622
+ payment_id: string;
623
+ amount_cents: number;
624
+ allocated_at: string;
625
+ type: "Payment" | "Refund";
626
+ method: "Cash" | "Card" | "Bank" | "Check" | "Credit" | "Other";
627
+ created_at: string;
628
+ succeeded_at: string | null;
629
+ refunded_payment_id: string | null;
630
+ }[];
631
+ }[];
632
+ pagination: {
633
+ page: number;
634
+ page_size: number;
635
+ has_more: boolean;
636
+ };
637
+ }>;
638
+ get: (id: OperationPath<"getInvoice">["id"], options?: RenterraCallOptions) => Promise<{
639
+ id: string;
640
+ number: string;
641
+ status: "Unpaid" | "Paid" | "Void" | "BadDebt";
642
+ customer_id: string | null;
643
+ order_id: string | null;
644
+ total_cents: number;
645
+ tax_total_cents: number;
646
+ paid_cents: number;
647
+ issue_date: string | null;
648
+ due_date: string;
649
+ paid_at: string | null;
650
+ items: {
651
+ description: string;
652
+ quantity: number;
653
+ total_cents: number;
654
+ item_id: string | null;
655
+ }[];
656
+ lines: {
657
+ description: string;
658
+ quantity: number;
659
+ total_cents: number;
660
+ item_id: string | null;
661
+ id: string;
662
+ group_id: string;
663
+ sales_tax_cents: number;
664
+ ledger_account_id: string;
665
+ revenue_allocations: {
666
+ item_id: string;
667
+ ledger_account_id: string;
668
+ percentage: number;
669
+ }[];
670
+ }[];
671
+ payments: {
672
+ allocation_id: string;
673
+ payment_id: string;
674
+ amount_cents: number;
675
+ allocated_at: string;
676
+ type: "Payment" | "Refund";
677
+ method: "Cash" | "Card" | "Bank" | "Check" | "Credit" | "Other";
678
+ created_at: string;
679
+ succeeded_at: string | null;
680
+ refunded_payment_id: string | null;
681
+ }[];
682
+ }>;
683
+ };
684
+ payments: {
685
+ list: (query?: OperationQuery<"listPayments">, options?: RenterraCallOptions) => Promise<{
686
+ data: {
687
+ id: string;
688
+ type: "Payment" | "Refund";
689
+ method: "Cash" | "Card" | "Bank" | "Check" | "Credit" | "Other";
690
+ amount_cents: number;
691
+ customer_id: string | null;
692
+ branch_id: string;
693
+ order_id: string | null;
694
+ refunded_payment_id: string | null;
695
+ created_at: string;
696
+ succeeded_at: string | null;
697
+ allocations: {
698
+ id: string;
699
+ invoice_id: string;
700
+ amount_cents: number;
701
+ created_at: string;
702
+ }[];
703
+ }[];
704
+ pagination: {
705
+ page: number;
706
+ page_size: number;
707
+ has_more: boolean;
708
+ };
709
+ }>;
710
+ get: (id: OperationPath<"getPayment">["id"], options?: RenterraCallOptions) => Promise<{
711
+ id: string;
712
+ type: "Payment" | "Refund";
713
+ method: "Cash" | "Card" | "Bank" | "Check" | "Credit" | "Other";
714
+ amount_cents: number;
715
+ customer_id: string | null;
716
+ branch_id: string;
717
+ order_id: string | null;
718
+ refunded_payment_id: string | null;
719
+ created_at: string;
720
+ succeeded_at: string | null;
721
+ allocations: {
722
+ id: string;
723
+ invoice_id: string;
724
+ amount_cents: number;
725
+ created_at: string;
726
+ }[];
727
+ }>;
728
+ };
729
+ maintenance: {
730
+ workOrders: {
731
+ list: (query?: OperationQuery<"listMaintenanceWorkOrders">, options?: RenterraCallOptions) => Promise<{
732
+ data: {
733
+ id: string;
734
+ number: number;
735
+ status: "Open" | "Closed";
736
+ type: ("Preventative" | "Repair") | null;
737
+ severity: ("Hard" | "Soft") | null;
738
+ item_id: string | null;
739
+ start_date: string;
740
+ end_date: string | null;
741
+ created_at: string;
742
+ inventory_on_order_ids: string[];
743
+ is_historical: boolean;
744
+ }[];
745
+ pagination: {
746
+ page: number;
747
+ page_size: number;
748
+ has_more: boolean;
749
+ };
750
+ }>;
751
+ };
752
+ serviceOrders: {
753
+ list: (query?: OperationQuery<"listMaintenanceServiceOrders">, options?: RenterraCallOptions) => Promise<{
754
+ data: {
755
+ id: string;
756
+ number: number;
757
+ status: "Open" | "Closed";
758
+ customer_id: string | null;
759
+ item_id: string | null;
760
+ start_date: string;
761
+ end_date: string | null;
762
+ created_at: string;
763
+ inventory_on_order_ids: string[];
764
+ is_historical: boolean;
765
+ }[];
766
+ pagination: {
767
+ page: number;
768
+ page_size: number;
769
+ has_more: boolean;
770
+ };
771
+ }>;
772
+ };
773
+ };
774
+ automation: {
775
+ rules: {
776
+ list: (query?: OperationQuery<"automation.rules.list">, options?: RenterraCallOptions) => Promise<{
777
+ rules: {
778
+ id: string;
779
+ name: string;
780
+ revision: number;
781
+ status: "draft";
782
+ definition: {
783
+ schema_version: 1;
784
+ subject: "invoice" | "order";
785
+ triggers: ({
786
+ id: string;
787
+ kind: "event";
788
+ type: "invoice.paid";
789
+ } | {
790
+ id: string;
791
+ kind: "event";
792
+ type: "order.created" | "order.completed";
793
+ } | {
794
+ id: string;
795
+ kind: "business_date";
796
+ type: "unpaid_invoice_due";
797
+ offset_hours: number;
798
+ } | {
799
+ id: string;
800
+ kind: "business_date";
801
+ type: "completed_order";
802
+ offset_hours: number;
803
+ })[];
804
+ conditions: {
805
+ all: ({
806
+ field: "invoice.outstanding_balance_cents";
807
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
808
+ value: number;
809
+ } | {
810
+ field: "order.starting_location_id";
811
+ operator: "in";
812
+ value: string[];
813
+ })[];
814
+ };
815
+ actions: ({
816
+ id: string;
817
+ type: "order.close";
818
+ } | {
819
+ id: string;
820
+ type: "message.send_template";
821
+ template_id: string;
822
+ channel: "email" | "sms";
823
+ 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")[];
826
+ };
827
+ attachments?: "invoice_pdf"[] | undefined;
828
+ })[];
829
+ };
830
+ created_at: string;
831
+ updated_at: string;
832
+ archived_at: string | null;
833
+ }[];
834
+ next_cursor: string | null;
835
+ }>;
836
+ create: (input: OperationBody<"automation.rules.create">, options?: RenterraCallOptions) => Promise<{
837
+ id: string;
838
+ name: string;
839
+ revision: number;
840
+ status: "draft";
841
+ definition: {
842
+ schema_version: 1;
843
+ subject: "invoice" | "order";
844
+ triggers: ({
845
+ id: string;
846
+ kind: "event";
847
+ type: "invoice.paid";
848
+ } | {
849
+ id: string;
850
+ kind: "event";
851
+ type: "order.created" | "order.completed";
852
+ } | {
853
+ id: string;
854
+ kind: "business_date";
855
+ type: "unpaid_invoice_due";
856
+ offset_hours: number;
857
+ } | {
858
+ id: string;
859
+ kind: "business_date";
860
+ type: "completed_order";
861
+ offset_hours: number;
862
+ })[];
863
+ conditions: {
864
+ all: ({
865
+ field: "invoice.outstanding_balance_cents";
866
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
867
+ value: number;
868
+ } | {
869
+ field: "order.starting_location_id";
870
+ operator: "in";
871
+ value: string[];
872
+ })[];
873
+ };
874
+ actions: ({
875
+ id: string;
876
+ type: "order.close";
877
+ } | {
878
+ id: string;
879
+ type: "message.send_template";
880
+ template_id: string;
881
+ channel: "email" | "sms";
882
+ 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")[];
885
+ };
886
+ attachments?: "invoice_pdf"[] | undefined;
887
+ })[];
888
+ };
889
+ created_at: string;
890
+ updated_at: string;
891
+ archived_at: string | null;
892
+ }>;
893
+ get: (id: OperationPath<"automation.rules.get">["id"], options?: RenterraCallOptions) => Promise<{
894
+ id: string;
895
+ name: string;
896
+ revision: number;
897
+ status: "draft";
898
+ definition: {
899
+ schema_version: 1;
900
+ subject: "invoice" | "order";
901
+ triggers: ({
902
+ id: string;
903
+ kind: "event";
904
+ type: "invoice.paid";
905
+ } | {
906
+ id: string;
907
+ kind: "event";
908
+ type: "order.created" | "order.completed";
909
+ } | {
910
+ id: string;
911
+ kind: "business_date";
912
+ type: "unpaid_invoice_due";
913
+ offset_hours: number;
914
+ } | {
915
+ id: string;
916
+ kind: "business_date";
917
+ type: "completed_order";
918
+ offset_hours: number;
919
+ })[];
920
+ conditions: {
921
+ all: ({
922
+ field: "invoice.outstanding_balance_cents";
923
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
924
+ value: number;
925
+ } | {
926
+ field: "order.starting_location_id";
927
+ operator: "in";
928
+ value: string[];
929
+ })[];
930
+ };
931
+ actions: ({
932
+ id: string;
933
+ type: "order.close";
934
+ } | {
935
+ id: string;
936
+ type: "message.send_template";
937
+ template_id: string;
938
+ channel: "email" | "sms";
939
+ 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")[];
942
+ };
943
+ attachments?: "invoice_pdf"[] | undefined;
944
+ })[];
945
+ };
946
+ created_at: string;
947
+ updated_at: string;
948
+ archived_at: string | null;
949
+ }>;
950
+ update: (id: OperationPath<"automation.rules.update">["id"], input: OperationBody<"automation.rules.update">, options?: RenterraCallOptions) => Promise<{
951
+ id: string;
952
+ name: string;
953
+ revision: number;
954
+ status: "draft";
955
+ definition: {
956
+ schema_version: 1;
957
+ subject: "invoice" | "order";
958
+ triggers: ({
959
+ id: string;
960
+ kind: "event";
961
+ type: "invoice.paid";
962
+ } | {
963
+ id: string;
964
+ kind: "event";
965
+ type: "order.created" | "order.completed";
966
+ } | {
967
+ id: string;
968
+ kind: "business_date";
969
+ type: "unpaid_invoice_due";
970
+ offset_hours: number;
971
+ } | {
972
+ id: string;
973
+ kind: "business_date";
974
+ type: "completed_order";
975
+ offset_hours: number;
976
+ })[];
977
+ conditions: {
978
+ all: ({
979
+ field: "invoice.outstanding_balance_cents";
980
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
981
+ value: number;
982
+ } | {
983
+ field: "order.starting_location_id";
984
+ operator: "in";
985
+ value: string[];
986
+ })[];
987
+ };
988
+ actions: ({
989
+ id: string;
990
+ type: "order.close";
991
+ } | {
992
+ id: string;
993
+ type: "message.send_template";
994
+ template_id: string;
995
+ channel: "email" | "sms";
996
+ 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")[];
999
+ };
1000
+ attachments?: "invoice_pdf"[] | undefined;
1001
+ })[];
1002
+ };
1003
+ created_at: string;
1004
+ updated_at: string;
1005
+ archived_at: string | null;
1006
+ }>;
1007
+ delete: (id: OperationPath<"automation.rules.delete">["id"], query: OperationQuery<"automation.rules.delete">, options?: RenterraCallOptions) => Promise<{
1008
+ id: string;
1009
+ revision: number;
1010
+ }>;
1011
+ };
1012
+ };
1013
+ };
1014
+ export {};