@izak0s/spacebring-api 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -480,12 +480,19 @@ var SpacebringError = class extends Error {
480
480
  status;
481
481
  /** Parsed error body returned by the API, if any. */
482
482
  body;
483
- constructor(status, body) {
483
+ /** The operation the request targeted, e.g. `GET /billing/invoices/v1/{invoiceId}`. */
484
+ operation;
485
+ /** Full URL of the failed request, if known. */
486
+ url;
487
+ constructor(status, body, request) {
484
488
  const parsed = isErrorBody(body) ? body : void 0;
485
- super(parsed?.message ?? `Spacebring API request failed with status ${status}`);
489
+ const base = parsed?.message ?? `Spacebring API request failed with status ${status}`;
490
+ super(request?.operation ? `${base} (${request.operation})` : base);
486
491
  this.name = "SpacebringError";
487
492
  this.status = status;
488
493
  this.body = parsed;
494
+ this.operation = request?.operation;
495
+ this.url = request?.url;
489
496
  }
490
497
  };
491
498
  function isErrorBody(body) {
@@ -493,18 +500,23 @@ function isErrorBody(body) {
493
500
  }
494
501
 
495
502
  // src/core.ts
496
- function unwrap(result) {
503
+ function unwrap(result, operation) {
497
504
  if (result.error !== void 0 || !result.response.ok) {
498
- throw new SpacebringError(result.response.status, result.error);
505
+ throw new SpacebringError(result.response.status, result.error, {
506
+ operation,
507
+ url: result.response.url || void 0
508
+ });
499
509
  }
500
510
  return result.data;
501
511
  }
502
- function unwrapProp(result, key) {
503
- const value = unwrap(result)?.[key];
512
+ function unwrapProp(result, key, operation) {
513
+ const value = unwrap(result, operation)?.[key];
504
514
  if (value === void 0 || value === null) {
505
- throw new SpacebringError(result.response.status, {
506
- message: `Response is missing the "${String(key)}" property`
507
- });
515
+ throw new SpacebringError(
516
+ result.response.status,
517
+ { message: `Response is missing the "${String(key)}" property` },
518
+ { operation, url: result.response.url || void 0 }
519
+ );
508
520
  }
509
521
  return value;
510
522
  }
@@ -530,31 +542,31 @@ function createAltcurrencies(client, defaults) {
530
542
  *
531
543
  * Retrieve all alternative currencies in the location.
532
544
  */
533
- async list(query) {
534
- return unwrap(await client.GET("/alt_currencies/v1", { params: { query } }));
545
+ async list(query, options) {
546
+ return unwrap(await client.GET("/alt_currencies/v1", { params: { query }, signal: options?.signal }), "GET /alt_currencies/v1");
535
547
  },
536
548
  /**
537
549
  * Retrieve alternative currencies — iterates every item across all pages.
538
550
  *
539
551
  * Retrieve all alternative currencies in the location.
540
552
  */
541
- iterate(query) {
553
+ iterate(query, options) {
542
554
  return paginate(
543
- async (nextPageToken) => unwrap(await client.GET("/alt_currencies/v1", { params: { query: { ...query, nextPageToken } } })),
555
+ async (nextPageToken) => unwrap(await client.GET("/alt_currencies/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /alt_currencies/v1"),
544
556
  "altCurrencies"
545
557
  );
546
558
  },
547
559
  /** Create an alternative currency */
548
- async create(body) {
549
- return unwrapProp(await client.POST("/alt_currencies/v1", { body }), "altCurrency");
560
+ async create(body, options) {
561
+ return unwrapProp(await client.POST("/alt_currencies/v1", { body, signal: options?.signal }), "altCurrency", "POST /alt_currencies/v1");
550
562
  },
551
563
  /** Update an alternative currency */
552
- async update(id, body) {
553
- return unwrap(await client.PATCH("/alt_currencies/v1/{id}", { params: { path: { id } }, body }));
564
+ async update(id, body, options) {
565
+ return unwrap(await client.PATCH("/alt_currencies/v1/{id}", { params: { path: { id } }, body, signal: options?.signal }), "PATCH /alt_currencies/v1/{id}");
554
566
  },
555
567
  /** Delete an alternative currency */
556
- async delete(id) {
557
- return unwrap(await client.DELETE("/alt_currencies/v1/{id}", { params: { path: { id } } }));
568
+ async delete(id, options) {
569
+ return unwrap(await client.DELETE("/alt_currencies/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /alt_currencies/v1/{id}");
558
570
  }
559
571
  };
560
572
  }
@@ -567,35 +579,35 @@ function createBenefits(client, defaults) {
567
579
  *
568
580
  * Retrieve all benefits in the location.
569
581
  */
570
- async list(query) {
571
- return unwrap(await client.GET("/benefits/v1", { params: { query } }));
582
+ async list(query, options) {
583
+ return unwrap(await client.GET("/benefits/v1", { params: { query }, signal: options?.signal }), "GET /benefits/v1");
572
584
  },
573
585
  /**
574
586
  * Retrieve benefits — iterates every item across all pages.
575
587
  *
576
588
  * Retrieve all benefits in the location.
577
589
  */
578
- iterate(query) {
590
+ iterate(query, options) {
579
591
  return paginate(
580
- async (nextPageToken) => unwrap(await client.GET("/benefits/v1", { params: { query: { ...query, nextPageToken } } })),
592
+ async (nextPageToken) => unwrap(await client.GET("/benefits/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /benefits/v1"),
581
593
  "benefits"
582
594
  );
583
595
  },
584
596
  /** Retrieve a benefit */
585
- async get(benefitId) {
586
- return unwrapProp(await client.GET("/benefits/v1/{benefitId}", { params: { path: { benefitId } } }), "benefit");
597
+ async get(benefitId, options) {
598
+ return unwrapProp(await client.GET("/benefits/v1/{benefitId}", { params: { path: { benefitId } }, signal: options?.signal }), "benefit", "GET /benefits/v1/{benefitId}");
587
599
  },
588
600
  /** Create a benefit */
589
- async create(body) {
590
- return unwrap(await client.POST("/benefits/v1", { body }));
601
+ async create(body, options) {
602
+ return unwrap(await client.POST("/benefits/v1", { body, signal: options?.signal }), "POST /benefits/v1");
591
603
  },
592
604
  /** Update a benefit */
593
- async update(benefitId, body) {
594
- return unwrapProp(await client.PUT("/benefits/v1/{benefitId}", { params: { path: { benefitId } }, body }), "benefit");
605
+ async update(benefitId, body, options) {
606
+ return unwrapProp(await client.PUT("/benefits/v1/{benefitId}", { params: { path: { benefitId } }, body, signal: options?.signal }), "benefit", "PUT /benefits/v1/{benefitId}");
595
607
  },
596
608
  /** Delete a benefit */
597
- async delete(benefitId) {
598
- return unwrap(await client.DELETE("/benefits/v1/{benefitId}", { params: { path: { benefitId } } }));
609
+ async delete(benefitId, options) {
610
+ return unwrap(await client.DELETE("/benefits/v1/{benefitId}", { params: { path: { benefitId } }, signal: options?.signal }), "DELETE /benefits/v1/{benefitId}");
599
611
  },
600
612
  applications: {
601
613
  /**
@@ -603,17 +615,17 @@ function createBenefits(client, defaults) {
603
615
  *
604
616
  * Retrieve all benefit applications in the location or for certain benefit.
605
617
  */
606
- async list(query) {
607
- return unwrap(await client.GET("/benefits/applications/v1", { params: { query } }));
618
+ async list(query, options) {
619
+ return unwrap(await client.GET("/benefits/applications/v1", { params: { query }, signal: options?.signal }), "GET /benefits/applications/v1");
608
620
  },
609
621
  /**
610
622
  * Retrieve applications — iterates every item across all pages.
611
623
  *
612
624
  * Retrieve all benefit applications in the location or for certain benefit.
613
625
  */
614
- iterate(query) {
626
+ iterate(query, options) {
615
627
  return paginate(
616
- async (nextPageToken) => unwrap(await client.GET("/benefits/applications/v1", { params: { query: { ...query, nextPageToken } } })),
628
+ async (nextPageToken) => unwrap(await client.GET("/benefits/applications/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /benefits/applications/v1"),
617
629
  "applications"
618
630
  );
619
631
  },
@@ -622,12 +634,12 @@ function createBenefits(client, defaults) {
622
634
  *
623
635
  * Retrieve a benefit application by id.
624
636
  */
625
- async get(benefitApplicationId) {
626
- return unwrapProp(await client.GET("/benefits/applications/v1/{benefitApplicationId}", { params: { path: { benefitApplicationId } } }), "application");
637
+ async get(benefitApplicationId, options) {
638
+ return unwrapProp(await client.GET("/benefits/applications/v1/{benefitApplicationId}", { params: { path: { benefitApplicationId } }, signal: options?.signal }), "application", "GET /benefits/applications/v1/{benefitApplicationId}");
627
639
  },
628
640
  /** Apply for a benefit */
629
- async create(body) {
630
- return unwrapProp(await client.POST("/benefits/applications/v1", { body }), "application");
641
+ async create(body, options) {
642
+ return unwrapProp(await client.POST("/benefits/applications/v1", { body, signal: options?.signal }), "application", "POST /benefits/applications/v1");
631
643
  }
632
644
  },
633
645
  categories: {
@@ -636,40 +648,40 @@ function createBenefits(client, defaults) {
636
648
  *
637
649
  * Retrieve all benefit categories in the location.
638
650
  */
639
- async list(query) {
640
- return unwrapProp(await client.GET("/benefits/categories/v1", { params: { query } }), "categories");
651
+ async list(query, options) {
652
+ return unwrapProp(await client.GET("/benefits/categories/v1", { params: { query }, signal: options?.signal }), "categories", "GET /benefits/categories/v1");
641
653
  },
642
654
  /**
643
655
  * Get a category
644
656
  *
645
657
  * Get a benefit category.
646
658
  */
647
- async get(categoryId) {
648
- return unwrapProp(await client.GET("/benefits/categories/v1/{categoryId}", { params: { path: { categoryId } } }), "category");
659
+ async get(categoryId, options) {
660
+ return unwrapProp(await client.GET("/benefits/categories/v1/{categoryId}", { params: { path: { categoryId } }, signal: options?.signal }), "category", "GET /benefits/categories/v1/{categoryId}");
649
661
  },
650
662
  /**
651
663
  * Create a category
652
664
  *
653
665
  * Create a benefit category.
654
666
  */
655
- async create(body) {
656
- return unwrapProp(await client.POST("/benefits/categories/v1", { body }), "category");
667
+ async create(body, options) {
668
+ return unwrapProp(await client.POST("/benefits/categories/v1", { body, signal: options?.signal }), "category", "POST /benefits/categories/v1");
657
669
  },
658
670
  /**
659
671
  * Update a category
660
672
  *
661
673
  * Update a benefit category.
662
674
  */
663
- async update(categoryId, body) {
664
- return unwrapProp(await client.PUT("/benefits/categories/v1/{categoryId}", { params: { path: { categoryId } }, body }), "category");
675
+ async update(categoryId, body, options) {
676
+ return unwrapProp(await client.PUT("/benefits/categories/v1/{categoryId}", { params: { path: { categoryId } }, body, signal: options?.signal }), "category", "PUT /benefits/categories/v1/{categoryId}");
665
677
  },
666
678
  /**
667
679
  * Delete a category
668
680
  *
669
681
  * Delete a benefit category.
670
682
  */
671
- async delete(categoryId) {
672
- return unwrap(await client.DELETE("/benefits/categories/v1/{categoryId}", { params: { path: { categoryId } } }));
683
+ async delete(categoryId, options) {
684
+ return unwrap(await client.DELETE("/benefits/categories/v1/{categoryId}", { params: { path: { categoryId } }, signal: options?.signal }), "DELETE /benefits/categories/v1/{categoryId}");
673
685
  }
674
686
  }
675
687
  };
@@ -684,17 +696,17 @@ function createBilling(client, defaults) {
684
696
  *
685
697
  * Retrieve all credit notes for a specific invoice or location. One of invoiceRef or locationRef is required.
686
698
  */
687
- async list(query) {
688
- return unwrap(await client.GET("/billing/credit_notes/v1", { params: { query } }));
699
+ async list(query, options) {
700
+ return unwrap(await client.GET("/billing/credit_notes/v1", { params: { query }, signal: options?.signal }), "GET /billing/credit_notes/v1");
689
701
  },
690
702
  /**
691
703
  * Retrieve credit notes — iterates every item across all pages.
692
704
  *
693
705
  * Retrieve all credit notes for a specific invoice or location. One of invoiceRef or locationRef is required.
694
706
  */
695
- iterate(query) {
707
+ iterate(query, options) {
696
708
  return paginate(
697
- async (nextPageToken) => unwrap(await client.GET("/billing/credit_notes/v1", { params: { query: { ...query, nextPageToken } } })),
709
+ async (nextPageToken) => unwrap(await client.GET("/billing/credit_notes/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /billing/credit_notes/v1"),
698
710
  "creditNotes"
699
711
  );
700
712
  },
@@ -703,28 +715,28 @@ function createBilling(client, defaults) {
703
715
  *
704
716
  * Retrieve a specific credit note.
705
717
  */
706
- async get(id) {
707
- return unwrapProp(await client.GET("/billing/credit_notes/v1/{id}", { params: { path: { id } } }), "creditNote");
718
+ async get(id, options) {
719
+ return unwrapProp(await client.GET("/billing/credit_notes/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "creditNote", "GET /billing/credit_notes/v1/{id}");
708
720
  },
709
721
  /**
710
722
  * Create a credit note
711
723
  *
712
724
  * Create a credit note for an invoice.
713
725
  */
714
- async create(body) {
715
- return unwrapProp(await client.POST("/billing/credit_notes/v1", { body }), "creditNote");
726
+ async create(body, options) {
727
+ return unwrapProp(await client.POST("/billing/credit_notes/v1", { body, signal: options?.signal }), "creditNote", "POST /billing/credit_notes/v1");
716
728
  },
717
729
  /** Update a credit note */
718
- async update(id, body) {
719
- return unwrap(await client.PATCH("/billing/credit_notes/v1/{id}", { params: { path: { id } }, body }));
730
+ async update(id, body, options) {
731
+ return unwrap(await client.PATCH("/billing/credit_notes/v1/{id}", { params: { path: { id } }, body, signal: options?.signal }), "PATCH /billing/credit_notes/v1/{id}");
720
732
  },
721
733
  /**
722
734
  * Preview a credit note
723
735
  *
724
736
  * Preview a credit note for an invoice without creating it.
725
737
  */
726
- async preview(body) {
727
- return unwrapProp(await client.POST("/billing/credit_notes/v1/preview", { body }), "creditNote");
738
+ async preview(body, options) {
739
+ return unwrapProp(await client.POST("/billing/credit_notes/v1/preview", { body, signal: options?.signal }), "creditNote", "POST /billing/credit_notes/v1/preview");
728
740
  }
729
741
  },
730
742
  invoices: {
@@ -733,17 +745,17 @@ function createBilling(client, defaults) {
733
745
  *
734
746
  * Retrieve all invoices based on certain parameters.
735
747
  */
736
- async list(query) {
737
- return unwrap(await client.GET("/billing/invoices/v1", { params: { query } }));
748
+ async list(query, options) {
749
+ return unwrap(await client.GET("/billing/invoices/v1", { params: { query }, signal: options?.signal }), "GET /billing/invoices/v1");
738
750
  },
739
751
  /**
740
752
  * Retrieve invoices — iterates every item across all pages.
741
753
  *
742
754
  * Retrieve all invoices based on certain parameters.
743
755
  */
744
- iterate(query) {
756
+ iterate(query, options) {
745
757
  return paginate(
746
- async (nextPageToken) => unwrap(await client.GET("/billing/invoices/v1", { params: { query: { ...query, nextPageToken } } })),
758
+ async (nextPageToken) => unwrap(await client.GET("/billing/invoices/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /billing/invoices/v1"),
747
759
  "invoices"
748
760
  );
749
761
  },
@@ -752,96 +764,96 @@ function createBilling(client, defaults) {
752
764
  *
753
765
  * Retrieve a certain invoice.
754
766
  */
755
- async get(invoiceId) {
756
- return unwrapProp(await client.GET("/billing/invoices/v1/{invoiceId}", { params: { path: { invoiceId } } }), "invoice");
767
+ async get(invoiceId, options) {
768
+ return unwrapProp(await client.GET("/billing/invoices/v1/{invoiceId}", { params: { path: { invoiceId } }, signal: options?.signal }), "invoice", "GET /billing/invoices/v1/{invoiceId}");
757
769
  },
758
770
  /**
759
771
  * Create an invoice
760
772
  *
761
773
  * Create an invoice for a member or a company.
762
774
  */
763
- async create(body) {
764
- return unwrapProp(await client.POST("/billing/invoices/v1", { body }), "invoice");
775
+ async create(body, options) {
776
+ return unwrapProp(await client.POST("/billing/invoices/v1", { body, signal: options?.signal }), "invoice", "POST /billing/invoices/v1");
765
777
  },
766
778
  /**
767
779
  * Update an invoice
768
780
  *
769
781
  * Update a draft invoice.
770
782
  */
771
- async update(invoiceId, body) {
772
- return unwrap(await client.PATCH("/billing/invoices/v1/{invoiceId}", { params: { path: { invoiceId } }, body }));
783
+ async update(invoiceId, body, options) {
784
+ return unwrap(await client.PATCH("/billing/invoices/v1/{invoiceId}", { params: { path: { invoiceId } }, body, signal: options?.signal }), "PATCH /billing/invoices/v1/{invoiceId}");
773
785
  },
774
786
  /**
775
787
  * Delete an invoice
776
788
  *
777
789
  * Delete a draft invoice.
778
790
  */
779
- async delete(invoiceId) {
780
- return unwrap(await client.DELETE("/billing/invoices/v1/{invoiceId}", { params: { path: { invoiceId } } }));
791
+ async delete(invoiceId, options) {
792
+ return unwrap(await client.DELETE("/billing/invoices/v1/{invoiceId}", { params: { path: { invoiceId } }, signal: options?.signal }), "DELETE /billing/invoices/v1/{invoiceId}");
781
793
  },
782
794
  /**
783
795
  * Cancel a payment
784
796
  *
785
797
  * Cancel a payment on an invoice.
786
798
  */
787
- async cancelPayment(invoiceId) {
788
- return unwrap(await client.POST("/billing/invoices/v1/{invoiceId}/cancel_payment", { params: { path: { invoiceId } } }));
799
+ async cancelPayment(invoiceId, options) {
800
+ return unwrap(await client.POST("/billing/invoices/v1/{invoiceId}/cancel_payment", { params: { path: { invoiceId } }, signal: options?.signal }), "POST /billing/invoices/v1/{invoiceId}/cancel_payment");
789
801
  },
790
802
  /**
791
803
  * Duplicate an invoice
792
804
  *
793
805
  * Duplicate an invoice, creating a new draft invoice with the same items.
794
806
  */
795
- async duplicate(invoiceId) {
796
- return unwrapProp(await client.POST("/billing/invoices/v1/{invoiceId}/duplicate", { params: { path: { invoiceId } } }), "invoice");
807
+ async duplicate(invoiceId, options) {
808
+ return unwrapProp(await client.POST("/billing/invoices/v1/{invoiceId}/duplicate", { params: { path: { invoiceId } }, signal: options?.signal }), "invoice", "POST /billing/invoices/v1/{invoiceId}/duplicate");
797
809
  },
798
810
  /**
799
811
  * List invoice items
800
812
  *
801
813
  * List all items for a specific invoice.
802
814
  */
803
- async getItems(invoiceId) {
804
- return unwrap(await client.GET("/billing/invoices/v1/{invoiceId}/items", { params: { path: { invoiceId } } }));
815
+ async getItems(invoiceId, options) {
816
+ return unwrap(await client.GET("/billing/invoices/v1/{invoiceId}/items", { params: { path: { invoiceId } }, signal: options?.signal }), "GET /billing/invoices/v1/{invoiceId}/items");
805
817
  },
806
818
  /**
807
819
  * Retrieve the upcoming invoice
808
820
  *
809
821
  * Retrieve the upcoming invoice preview for a membership or subscription.
810
822
  */
811
- async getUpcoming(query) {
812
- return unwrap(await client.GET("/billing/invoices/v1/upcoming", { params: { query } }));
823
+ async getUpcoming(query, options) {
824
+ return unwrap(await client.GET("/billing/invoices/v1/upcoming", { params: { query }, signal: options?.signal }), "GET /billing/invoices/v1/upcoming");
813
825
  },
814
826
  /**
815
827
  * Issue an invoice
816
828
  *
817
829
  * Issue (finalize) a draft invoice, making it ready for payment.
818
830
  */
819
- async issue(invoiceId, body) {
820
- return unwrap(await client.POST("/billing/invoices/v1/{invoiceId}/issue", { params: { path: { invoiceId } }, body }));
831
+ async issue(invoiceId, body, options) {
832
+ return unwrap(await client.POST("/billing/invoices/v1/{invoiceId}/issue", { params: { path: { invoiceId } }, body, signal: options?.signal }), "POST /billing/invoices/v1/{invoiceId}/issue");
821
833
  },
822
834
  /**
823
835
  * Pay an invoice
824
836
  *
825
837
  * Mark an invoice as paid by `External Payment`.
826
838
  */
827
- async pay(invoiceId, body) {
828
- return unwrap(await client.POST("/billing/invoices/v1/{invoiceId}/pay", { params: { path: { invoiceId } }, body }));
839
+ async pay(invoiceId, body, options) {
840
+ return unwrap(await client.POST("/billing/invoices/v1/{invoiceId}/pay", { params: { path: { invoiceId } }, body, signal: options?.signal }), "POST /billing/invoices/v1/{invoiceId}/pay");
829
841
  },
830
842
  /**
831
843
  * Resend an invoice
832
844
  *
833
845
  * Resend an issued invoice notification to the customer.
834
846
  */
835
- async resend(invoiceId) {
836
- return unwrap(await client.POST("/billing/invoices/v1/{invoiceId}/resend", { params: { path: { invoiceId } } }));
847
+ async resend(invoiceId, options) {
848
+ return unwrap(await client.POST("/billing/invoices/v1/{invoiceId}/resend", { params: { path: { invoiceId } }, signal: options?.signal }), "POST /billing/invoices/v1/{invoiceId}/resend");
837
849
  },
838
850
  /**
839
851
  * Void an invoice
840
852
  *
841
853
  * Void an issued invoice.
842
854
  */
843
- async void(invoiceId) {
844
- return unwrap(await client.PATCH("/billing/invoices/v1/{invoiceId}/void", { params: { path: { invoiceId } } }));
855
+ async void(invoiceId, options) {
856
+ return unwrap(await client.PATCH("/billing/invoices/v1/{invoiceId}/void", { params: { path: { invoiceId } }, signal: options?.signal }), "PATCH /billing/invoices/v1/{invoiceId}/void");
845
857
  },
846
858
  items: {
847
859
  /**
@@ -849,36 +861,36 @@ function createBilling(client, defaults) {
849
861
  *
850
862
  * Retrieve a specific invoice item.
851
863
  */
852
- async get(id) {
853
- return unwrapProp(await client.GET("/billing/invoices/v1/items/{id}", { params: { path: { id } } }), "invoiceItem");
864
+ async get(id, options) {
865
+ return unwrapProp(await client.GET("/billing/invoices/v1/items/{id}", { params: { path: { id } }, signal: options?.signal }), "invoiceItem", "GET /billing/invoices/v1/items/{id}");
854
866
  },
855
867
  /**
856
868
  * Create an invoice item
857
869
  *
858
870
  * Create an item in an invoice.
859
871
  */
860
- async create(body) {
861
- return unwrapProp(await client.POST("/billing/invoices/v1/items", { body }), "invoiceItem");
872
+ async create(body, options) {
873
+ return unwrapProp(await client.POST("/billing/invoices/v1/items", { body, signal: options?.signal }), "invoiceItem", "POST /billing/invoices/v1/items");
862
874
  },
863
875
  /**
864
876
  * Update an invoice item
865
877
  *
866
878
  * Update an invoice item on a draft invoice.
867
879
  */
868
- async update(id, body) {
869
- return unwrap(await client.PATCH("/billing/invoices/v1/items/{id}", { params: { path: { id } }, body }));
880
+ async update(id, body, options) {
881
+ return unwrap(await client.PATCH("/billing/invoices/v1/items/{id}", { params: { path: { id } }, body, signal: options?.signal }), "PATCH /billing/invoices/v1/items/{id}");
870
882
  },
871
883
  /**
872
884
  * Delete an invoice item
873
885
  *
874
886
  * Delete an invoice item from a draft invoice.
875
887
  */
876
- async delete(id) {
877
- return unwrap(await client.DELETE("/billing/invoices/v1/items/{id}", { params: { path: { id } } }));
888
+ async delete(id, options) {
889
+ return unwrap(await client.DELETE("/billing/invoices/v1/items/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /billing/invoices/v1/items/{id}");
878
890
  },
879
891
  /** List upcoming invoice items */
880
- async getUpcoming(query) {
881
- return unwrapProp(await client.GET("/billing/invoices/v1/items/upcoming", { params: { query } }), "invoiceItems");
892
+ async getUpcoming(query, options) {
893
+ return unwrapProp(await client.GET("/billing/invoices/v1/items/upcoming", { params: { query }, signal: options?.signal }), "invoiceItems", "GET /billing/invoices/v1/items/upcoming");
882
894
  }
883
895
  }
884
896
  }
@@ -894,17 +906,17 @@ function createCommunity(client, defaults) {
894
906
  *
895
907
  * Retrieve all companies.
896
908
  */
897
- async list(query) {
898
- return unwrap(await client.GET("/community/companies/v1", { params: { query } }));
909
+ async list(query, options) {
910
+ return unwrap(await client.GET("/community/companies/v1", { params: { query }, signal: options?.signal }), "GET /community/companies/v1");
899
911
  },
900
912
  /**
901
913
  * Retrieve companies — iterates every item across all pages.
902
914
  *
903
915
  * Retrieve all companies.
904
916
  */
905
- iterate(query) {
917
+ iterate(query, options) {
906
918
  return paginate(
907
- async (nextPageToken) => unwrap(await client.GET("/community/companies/v1", { params: { query: { ...query, nextPageToken } } })),
919
+ async (nextPageToken) => unwrap(await client.GET("/community/companies/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /community/companies/v1"),
908
920
  "companies"
909
921
  );
910
922
  },
@@ -913,20 +925,20 @@ function createCommunity(client, defaults) {
913
925
  *
914
926
  * Retrieve a certain company.
915
927
  */
916
- async get(id) {
917
- return unwrapProp(await client.GET("/community/companies/v1/{id}", { params: { path: { id } } }), "company");
928
+ async get(id, options) {
929
+ return unwrapProp(await client.GET("/community/companies/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "company", "GET /community/companies/v1/{id}");
918
930
  },
919
931
  /** Create a company */
920
- async create(body) {
921
- return unwrapProp(await client.POST("/community/companies/v1", { body }), "company");
932
+ async create(body, options) {
933
+ return unwrapProp(await client.POST("/community/companies/v1", { body, signal: options?.signal }), "company", "POST /community/companies/v1");
922
934
  },
923
935
  /**
924
936
  * Update a company
925
937
  *
926
938
  * Update a certain company.
927
939
  */
928
- async update(id, body) {
929
- return unwrapProp(await client.PUT("/community/companies/v1/{id}", { params: { path: { id } }, body }), "company");
940
+ async update(id, body, options) {
941
+ return unwrapProp(await client.PUT("/community/companies/v1/{id}", { params: { path: { id } }, body, signal: options?.signal }), "company", "PUT /community/companies/v1/{id}");
930
942
  }
931
943
  },
932
944
  memberships: {
@@ -935,17 +947,17 @@ function createCommunity(client, defaults) {
935
947
  *
936
948
  * Retrieve all memberships.
937
949
  */
938
- async list(query) {
939
- return unwrap(await client.GET("/community/memberships/v1", { params: { query } }));
950
+ async list(query, options) {
951
+ return unwrap(await client.GET("/community/memberships/v1", { params: { query }, signal: options?.signal }), "GET /community/memberships/v1");
940
952
  },
941
953
  /**
942
954
  * Retrieve memberships — iterates every item across all pages.
943
955
  *
944
956
  * Retrieve all memberships.
945
957
  */
946
- iterate(query) {
958
+ iterate(query, options) {
947
959
  return paginate(
948
- async (nextPageToken) => unwrap(await client.GET("/community/memberships/v1", { params: { query: { ...query, nextPageToken } } })),
960
+ async (nextPageToken) => unwrap(await client.GET("/community/memberships/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /community/memberships/v1"),
949
961
  "memberships"
950
962
  );
951
963
  },
@@ -954,41 +966,41 @@ function createCommunity(client, defaults) {
954
966
  *
955
967
  * Retrieve a certain membership.
956
968
  */
957
- async get(id) {
958
- return unwrapProp(await client.GET("/community/memberships/v1/{id}", { params: { path: { id } } }), "membership");
969
+ async get(id, options) {
970
+ return unwrapProp(await client.GET("/community/memberships/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "membership", "GET /community/memberships/v1/{id}");
959
971
  },
960
972
  /**
961
973
  * Create a membership
962
974
  *
963
975
  * Create a membership and send an email invitation to join if type is member.
964
976
  */
965
- async create(body) {
966
- return unwrapProp(await client.POST("/community/memberships/v1", { body }), "membership");
977
+ async create(body, options) {
978
+ return unwrapProp(await client.POST("/community/memberships/v1", { body, signal: options?.signal }), "membership", "POST /community/memberships/v1");
967
979
  },
968
980
  /**
969
981
  * Update a membership
970
982
  *
971
983
  * Update a certain membership.
972
984
  */
973
- async update(id, body) {
974
- return unwrapProp(await client.PUT("/community/memberships/v1/{id}", { params: { path: { id } }, body }), "membership");
985
+ async update(id, body, options) {
986
+ return unwrapProp(await client.PUT("/community/memberships/v1/{id}", { params: { path: { id } }, body, signal: options?.signal }), "membership", "PUT /community/memberships/v1/{id}");
975
987
  },
976
988
  /**
977
989
  * Delete a membership
978
990
  *
979
991
  * Delete a certain membership.
980
992
  */
981
- async delete(id) {
982
- return unwrap(await client.DELETE("/community/memberships/v1/{id}", { params: { path: { id } } }));
993
+ async delete(id, options) {
994
+ return unwrap(await client.DELETE("/community/memberships/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /community/memberships/v1/{id}");
983
995
  },
984
996
  /**
985
997
  * Retrieve deleted memberships — iterates every item across all pages.
986
998
  *
987
999
  * Retrieve all deleted memberships.
988
1000
  */
989
- iterateDeleted(query) {
1001
+ iterateDeleted(query, options) {
990
1002
  return paginate(
991
- async (nextPageToken) => unwrap(await client.GET("/community/memberships/v1/deleted", { params: { query: { ...query, nextPageToken } } })),
1003
+ async (nextPageToken) => unwrap(await client.GET("/community/memberships/v1/deleted", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /community/memberships/v1/deleted"),
992
1004
  "memberships"
993
1005
  );
994
1006
  },
@@ -997,8 +1009,8 @@ function createCommunity(client, defaults) {
997
1009
  *
998
1010
  * Retrieve all deleted memberships.
999
1011
  */
1000
- async listDeleted(query) {
1001
- return unwrap(await client.GET("/community/memberships/v1/deleted", { params: { query } }));
1012
+ async listDeleted(query, options) {
1013
+ return unwrap(await client.GET("/community/memberships/v1/deleted", { params: { query }, signal: options?.signal }), "GET /community/memberships/v1/deleted");
1002
1014
  }
1003
1015
  }
1004
1016
  };
@@ -1012,39 +1024,39 @@ function createContracts(client, defaults) {
1012
1024
  *
1013
1025
  * Retrieve all contracts in the location.
1014
1026
  */
1015
- async list(query) {
1016
- return unwrap(await client.GET("/contracts/v1", { params: { query } }));
1027
+ async list(query, options) {
1028
+ return unwrap(await client.GET("/contracts/v1", { params: { query }, signal: options?.signal }), "GET /contracts/v1");
1017
1029
  },
1018
1030
  /**
1019
1031
  * Retrieve contracts — iterates every item across all pages.
1020
1032
  *
1021
1033
  * Retrieve all contracts in the location.
1022
1034
  */
1023
- iterate(query) {
1035
+ iterate(query, options) {
1024
1036
  return paginate(
1025
- async (nextPageToken) => unwrap(await client.GET("/contracts/v1", { params: { query: { ...query, nextPageToken } } })),
1037
+ async (nextPageToken) => unwrap(await client.GET("/contracts/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /contracts/v1"),
1026
1038
  "contracts"
1027
1039
  );
1028
1040
  },
1029
1041
  /** Get a contract */
1030
- async get(contractId) {
1031
- return unwrapProp(await client.GET("/contracts/v1/{contractId}", { params: { path: { contractId } } }), "contract");
1042
+ async get(contractId, options) {
1043
+ return unwrapProp(await client.GET("/contracts/v1/{contractId}", { params: { path: { contractId } }, signal: options?.signal }), "contract", "GET /contracts/v1/{contractId}");
1032
1044
  },
1033
1045
  /** Create a contract */
1034
- async create(body) {
1035
- return unwrapProp(await client.POST("/contracts/v1", { body }), "contract");
1046
+ async create(body, options) {
1047
+ return unwrapProp(await client.POST("/contracts/v1", { body, signal: options?.signal }), "contract", "POST /contracts/v1");
1036
1048
  },
1037
1049
  /** Delete a contract */
1038
- async delete(contractId) {
1039
- return unwrap(await client.DELETE("/contracts/v1/{contractId}", { params: { path: { contractId } } }));
1050
+ async delete(contractId, options) {
1051
+ return unwrap(await client.DELETE("/contracts/v1/{contractId}", { params: { path: { contractId } }, signal: options?.signal }), "DELETE /contracts/v1/{contractId}");
1040
1052
  },
1041
1053
  /** Issue a contract */
1042
- async issue(contractId, body) {
1043
- return unwrapProp(await client.POST("/contracts/v1/{contractId}/issue", { params: { path: { contractId } }, body }), "contract");
1054
+ async issue(contractId, body, options) {
1055
+ return unwrapProp(await client.POST("/contracts/v1/{contractId}/issue", { params: { path: { contractId } }, body, signal: options?.signal }), "contract", "POST /contracts/v1/{contractId}/issue");
1044
1056
  },
1045
1057
  /** Terminate a contract */
1046
- async terminate(contractId, body) {
1047
- return unwrap(await client.PATCH("/contracts/v1/{contractId}/terminate", { params: { path: { contractId } }, body }));
1058
+ async terminate(contractId, body, options) {
1059
+ return unwrap(await client.PATCH("/contracts/v1/{contractId}/terminate", { params: { path: { contractId } }, body, signal: options?.signal }), "PATCH /contracts/v1/{contractId}/terminate");
1048
1060
  }
1049
1061
  };
1050
1062
  }
@@ -1058,35 +1070,35 @@ function createDiscounts(client, defaults) {
1058
1070
  *
1059
1071
  * Retrieve all coupons in the location.
1060
1072
  */
1061
- async list(query) {
1062
- return unwrap(await client.GET("/discounts/coupons/v1", { params: { query } }));
1073
+ async list(query, options) {
1074
+ return unwrap(await client.GET("/discounts/coupons/v1", { params: { query }, signal: options?.signal }), "GET /discounts/coupons/v1");
1063
1075
  },
1064
1076
  /**
1065
1077
  * Retrieve coupons — iterates every item across all pages.
1066
1078
  *
1067
1079
  * Retrieve all coupons in the location.
1068
1080
  */
1069
- iterate(query) {
1081
+ iterate(query, options) {
1070
1082
  return paginate(
1071
- async (nextPageToken) => unwrap(await client.GET("/discounts/coupons/v1", { params: { query: { ...query, nextPageToken } } })),
1083
+ async (nextPageToken) => unwrap(await client.GET("/discounts/coupons/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /discounts/coupons/v1"),
1072
1084
  "coupons"
1073
1085
  );
1074
1086
  },
1075
1087
  /** Get a coupon */
1076
- async get(id) {
1077
- return unwrapProp(await client.GET("/discounts/coupons/v1/{id}", { params: { path: { id } } }), "coupon");
1088
+ async get(id, options) {
1089
+ return unwrapProp(await client.GET("/discounts/coupons/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "coupon", "GET /discounts/coupons/v1/{id}");
1078
1090
  },
1079
1091
  /** Create a coupon */
1080
- async create(body) {
1081
- return unwrapProp(await client.POST("/discounts/coupons/v1", { body }), "coupon");
1092
+ async create(body, options) {
1093
+ return unwrapProp(await client.POST("/discounts/coupons/v1", { body, signal: options?.signal }), "coupon", "POST /discounts/coupons/v1");
1082
1094
  },
1083
1095
  /** Update a coupon */
1084
- async update(id, body) {
1085
- return unwrap(await client.PATCH("/discounts/coupons/v1/{id}", { params: { path: { id } }, body }));
1096
+ async update(id, body, options) {
1097
+ return unwrap(await client.PATCH("/discounts/coupons/v1/{id}", { params: { path: { id } }, body, signal: options?.signal }), "PATCH /discounts/coupons/v1/{id}");
1086
1098
  },
1087
1099
  /** Delete a coupon */
1088
- async delete(id) {
1089
- return unwrap(await client.DELETE("/discounts/coupons/v1/{id}", { params: { path: { id } } }));
1100
+ async delete(id, options) {
1101
+ return unwrap(await client.DELETE("/discounts/coupons/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /discounts/coupons/v1/{id}");
1090
1102
  }
1091
1103
  },
1092
1104
  promocodes: {
@@ -1095,20 +1107,20 @@ function createDiscounts(client, defaults) {
1095
1107
  *
1096
1108
  * Retrieve all promocodes.
1097
1109
  */
1098
- async list(query) {
1099
- return unwrapProp(await client.GET("/discounts/promocodes/v1", { params: { query } }), "promocodes");
1110
+ async list(query, options) {
1111
+ return unwrapProp(await client.GET("/discounts/promocodes/v1", { params: { query }, signal: options?.signal }), "promocodes", "GET /discounts/promocodes/v1");
1100
1112
  },
1101
1113
  /** Get a promocode */
1102
- async get(id) {
1103
- return unwrapProp(await client.GET("/discounts/promocodes/v1/{id}", { params: { path: { id } } }), "promocode");
1114
+ async get(id, options) {
1115
+ return unwrapProp(await client.GET("/discounts/promocodes/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "promocode", "GET /discounts/promocodes/v1/{id}");
1104
1116
  },
1105
1117
  /** Create a promocode */
1106
- async create(body) {
1107
- return unwrapProp(await client.POST("/discounts/promocodes/v1", { body }), "promocode");
1118
+ async create(body, options) {
1119
+ return unwrapProp(await client.POST("/discounts/promocodes/v1", { body, signal: options?.signal }), "promocode", "POST /discounts/promocodes/v1");
1108
1120
  },
1109
1121
  /** Archive a promocode */
1110
- async archive(id) {
1111
- return unwrapProp(await client.PUT("/discounts/promocodes/v1/{id}/archive", { params: { path: { id } } }), "promocode");
1122
+ async archive(id, options) {
1123
+ return unwrapProp(await client.PUT("/discounts/promocodes/v1/{id}/archive", { params: { path: { id } }, signal: options?.signal }), "promocode", "PUT /discounts/promocodes/v1/{id}/archive");
1112
1124
  }
1113
1125
  },
1114
1126
  redemptions: {
@@ -1117,17 +1129,17 @@ function createDiscounts(client, defaults) {
1117
1129
  *
1118
1130
  * Retrieve all discount redemptions. Either couponRef or promocodeRef is required.
1119
1131
  */
1120
- async list(query) {
1121
- return unwrap(await client.GET("/discounts/redemptions/v1", { params: { query } }));
1132
+ async list(query, options) {
1133
+ return unwrap(await client.GET("/discounts/redemptions/v1", { params: { query }, signal: options?.signal }), "GET /discounts/redemptions/v1");
1122
1134
  },
1123
1135
  /**
1124
1136
  * Retrieve redemptions — iterates every item across all pages.
1125
1137
  *
1126
1138
  * Retrieve all discount redemptions. Either couponRef or promocodeRef is required.
1127
1139
  */
1128
- iterate(query) {
1140
+ iterate(query, options) {
1129
1141
  return paginate(
1130
- async (nextPageToken) => unwrap(await client.GET("/discounts/redemptions/v1", { params: { query: { ...query, nextPageToken } } })),
1142
+ async (nextPageToken) => unwrap(await client.GET("/discounts/redemptions/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /discounts/redemptions/v1"),
1131
1143
  "redemptions"
1132
1144
  );
1133
1145
  }
@@ -1139,28 +1151,28 @@ function createDiscounts(client, defaults) {
1139
1151
  function createEvents(client, defaults) {
1140
1152
  return {
1141
1153
  /** Retrieve events */
1142
- async list(query) {
1143
- return unwrap(await client.GET("/events/v1", { params: { query } }));
1154
+ async list(query, options) {
1155
+ return unwrap(await client.GET("/events/v1", { params: { query }, signal: options?.signal }), "GET /events/v1");
1144
1156
  },
1145
1157
  /** Retrieve an event */
1146
- async get(id) {
1147
- return unwrapProp(await client.GET("/events/v1/{id}", { params: { header: { "spacebring-network-id": defaults.networkId }, path: { id } } }), "event");
1158
+ async get(id, options) {
1159
+ return unwrapProp(await client.GET("/events/v1/{id}", { params: { header: { "spacebring-network-id": defaults.networkId }, path: { id } }, signal: options?.signal }), "event", "GET /events/v1/{id}");
1148
1160
  },
1149
1161
  /** Create an event */
1150
- async create(body) {
1151
- return unwrapProp(await client.POST("/events/v1", { body }), "event");
1162
+ async create(body, options) {
1163
+ return unwrapProp(await client.POST("/events/v1", { body, signal: options?.signal }), "event", "POST /events/v1");
1152
1164
  },
1153
1165
  /** Delete an event */
1154
- async delete(id) {
1155
- return unwrap(await client.DELETE("/events/v1/{id}", { params: { path: { id } } }));
1166
+ async delete(id, options) {
1167
+ return unwrap(await client.DELETE("/events/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /events/v1/{id}");
1156
1168
  },
1157
1169
  /** Cancel an event */
1158
- async cancel(id) {
1159
- return unwrapProp(await client.PUT("/events/v1/{id}/cancel", { params: { path: { id } } }), "event");
1170
+ async cancel(id, options) {
1171
+ return unwrapProp(await client.PUT("/events/v1/{id}/cancel", { params: { path: { id } }, signal: options?.signal }), "event", "PUT /events/v1/{id}/cancel");
1160
1172
  },
1161
1173
  /** Copy an event */
1162
- async copy(id) {
1163
- return unwrapProp(await client.POST("/events/v1/{id}/copy", { params: { path: { id } } }), "event");
1174
+ async copy(id, options) {
1175
+ return unwrapProp(await client.POST("/events/v1/{id}/copy", { params: { path: { id } }, signal: options?.signal }), "event", "POST /events/v1/{id}/copy");
1164
1176
  },
1165
1177
  tickets: {
1166
1178
  /**
@@ -1168,17 +1180,17 @@ function createEvents(client, defaults) {
1168
1180
  *
1169
1181
  * Retrieve all event tickets.
1170
1182
  */
1171
- async list(query) {
1172
- return unwrap(await client.GET("/events/tickets/v1", { params: { query } }));
1183
+ async list(query, options) {
1184
+ return unwrap(await client.GET("/events/tickets/v1", { params: { query }, signal: options?.signal }), "GET /events/tickets/v1");
1173
1185
  },
1174
1186
  /**
1175
1187
  * Retrieve tickets — iterates every item across all pages.
1176
1188
  *
1177
1189
  * Retrieve all event tickets.
1178
1190
  */
1179
- iterate(query) {
1191
+ iterate(query, options) {
1180
1192
  return paginate(
1181
- async (nextPageToken) => unwrap(await client.GET("/events/tickets/v1", { params: { query: { ...query, nextPageToken } } })),
1193
+ async (nextPageToken) => unwrap(await client.GET("/events/tickets/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /events/tickets/v1"),
1182
1194
  "tickets"
1183
1195
  );
1184
1196
  },
@@ -1187,8 +1199,8 @@ function createEvents(client, defaults) {
1187
1199
  *
1188
1200
  * Retrieve an event ticket.
1189
1201
  */
1190
- async get(id) {
1191
- return unwrapProp(await client.GET("/events/tickets/v1/{id}", { params: { path: { id } } }), "ticket");
1202
+ async get(id, options) {
1203
+ return unwrapProp(await client.GET("/events/tickets/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "ticket", "GET /events/tickets/v1/{id}");
1192
1204
  }
1193
1205
  }
1194
1206
  };
@@ -1203,20 +1215,20 @@ function createFeed(client, defaults) {
1203
1215
  *
1204
1216
  * Create a feed post comment.
1205
1217
  */
1206
- async create(body) {
1207
- return unwrapProp(await client.POST("/feed/comments/v1", { body }), "comment");
1218
+ async create(body, options) {
1219
+ return unwrapProp(await client.POST("/feed/comments/v1", { body, signal: options?.signal }), "comment", "POST /feed/comments/v1");
1208
1220
  },
1209
1221
  /** Delete a post comment */
1210
- async delete(id) {
1211
- return unwrap(await client.DELETE("/feed/comments/v1/{id}", { params: { path: { id } } }));
1222
+ async delete(id, options) {
1223
+ return unwrap(await client.DELETE("/feed/comments/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /feed/comments/v1/{id}");
1212
1224
  },
1213
1225
  /** Create a like for a post comment */
1214
- async createLike(id) {
1215
- return unwrapProp(await client.POST("/feed/comments/v1/{id}/likes", { params: { path: { id } } }), "like");
1226
+ async createLike(id, options) {
1227
+ return unwrapProp(await client.POST("/feed/comments/v1/{id}/likes", { params: { path: { id } }, signal: options?.signal }), "like", "POST /feed/comments/v1/{id}/likes");
1216
1228
  },
1217
1229
  /** Delete a like for a post comment */
1218
- async deleteLike(id) {
1219
- return unwrap(await client.DELETE("/feed/comments/v1/{id}/likes", { params: { path: { id } } }));
1230
+ async deleteLike(id, options) {
1231
+ return unwrap(await client.DELETE("/feed/comments/v1/{id}/likes", { params: { path: { id } }, signal: options?.signal }), "DELETE /feed/comments/v1/{id}/likes");
1220
1232
  }
1221
1233
  },
1222
1234
  posts: {
@@ -1225,17 +1237,17 @@ function createFeed(client, defaults) {
1225
1237
  *
1226
1238
  * Get feed posts.
1227
1239
  */
1228
- async list(query) {
1229
- return unwrap(await client.GET("/feed/posts/v1", { params: { query } }));
1240
+ async list(query, options) {
1241
+ return unwrap(await client.GET("/feed/posts/v1", { params: { query }, signal: options?.signal }), "GET /feed/posts/v1");
1230
1242
  },
1231
1243
  /**
1232
1244
  * Get posts — iterates every item across all pages.
1233
1245
  *
1234
1246
  * Get feed posts.
1235
1247
  */
1236
- iterate(query) {
1248
+ iterate(query, options) {
1237
1249
  return paginate(
1238
- async (nextPageToken) => unwrap(await client.GET("/feed/posts/v1", { params: { query: { ...query, nextPageToken } } })),
1250
+ async (nextPageToken) => unwrap(await client.GET("/feed/posts/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /feed/posts/v1"),
1239
1251
  "posts"
1240
1252
  );
1241
1253
  },
@@ -1244,48 +1256,48 @@ function createFeed(client, defaults) {
1244
1256
  *
1245
1257
  * Get a feed post.
1246
1258
  */
1247
- async get(id) {
1248
- return unwrapProp(await client.GET("/feed/posts/v1/{id}", { params: { path: { id } } }), "post");
1259
+ async get(id, options) {
1260
+ return unwrapProp(await client.GET("/feed/posts/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "post", "GET /feed/posts/v1/{id}");
1249
1261
  },
1250
1262
  /**
1251
1263
  * Create a post
1252
1264
  *
1253
1265
  * Create a feed post.
1254
1266
  */
1255
- async create(body) {
1256
- return unwrapProp(await client.POST("/feed/posts/v1", { body }), "post");
1267
+ async create(body, options) {
1268
+ return unwrapProp(await client.POST("/feed/posts/v1", { body, signal: options?.signal }), "post", "POST /feed/posts/v1");
1257
1269
  },
1258
1270
  /**
1259
1271
  * Update a post
1260
1272
  *
1261
1273
  * Update a feed post.
1262
1274
  */
1263
- async update(id, body) {
1264
- return unwrapProp(await client.PUT("/feed/posts/v1/{id}", { params: { path: { id } }, body }), "post");
1275
+ async update(id, body, options) {
1276
+ return unwrapProp(await client.PUT("/feed/posts/v1/{id}", { params: { path: { id } }, body, signal: options?.signal }), "post", "PUT /feed/posts/v1/{id}");
1265
1277
  },
1266
1278
  /**
1267
1279
  * Delete a post
1268
1280
  *
1269
1281
  * Delete a feed post.
1270
1282
  */
1271
- async delete(id) {
1272
- return unwrap(await client.DELETE("/feed/posts/v1/{id}", { params: { path: { id } } }));
1283
+ async delete(id, options) {
1284
+ return unwrap(await client.DELETE("/feed/posts/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /feed/posts/v1/{id}");
1273
1285
  },
1274
1286
  /** Create a like for a post */
1275
- async createLike(id) {
1276
- return unwrapProp(await client.POST("/feed/posts/v1/{id}/likes", { params: { path: { id } } }), "like");
1287
+ async createLike(id, options) {
1288
+ return unwrapProp(await client.POST("/feed/posts/v1/{id}/likes", { params: { path: { id } }, signal: options?.signal }), "like", "POST /feed/posts/v1/{id}/likes");
1277
1289
  },
1278
1290
  /** Delete a like for a post */
1279
- async deleteLike(id) {
1280
- return unwrap(await client.DELETE("/feed/posts/v1/{id}/likes", { params: { path: { id } } }));
1291
+ async deleteLike(id, options) {
1292
+ return unwrap(await client.DELETE("/feed/posts/v1/{id}/likes", { params: { path: { id } }, signal: options?.signal }), "DELETE /feed/posts/v1/{id}/likes");
1281
1293
  },
1282
1294
  /** Get comments for a post */
1283
- async getComments(id) {
1284
- return unwrapProp(await client.GET("/feed/posts/v1/{id}/comments", { params: { path: { id } } }), "comments");
1295
+ async getComments(id, options) {
1296
+ return unwrapProp(await client.GET("/feed/posts/v1/{id}/comments", { params: { path: { id } }, signal: options?.signal }), "comments", "GET /feed/posts/v1/{id}/comments");
1285
1297
  },
1286
1298
  /** Get likes for a post */
1287
- async getLikes(id) {
1288
- return unwrapProp(await client.GET("/feed/posts/v1/{id}/likes", { params: { path: { id } } }), "likes");
1299
+ async getLikes(id, options) {
1300
+ return unwrapProp(await client.GET("/feed/posts/v1/{id}/likes", { params: { path: { id } }, signal: options?.signal }), "likes", "GET /feed/posts/v1/{id}/likes");
1289
1301
  }
1290
1302
  }
1291
1303
  };
@@ -1295,12 +1307,12 @@ function createFeed(client, defaults) {
1295
1307
  function createFloors(client, defaults) {
1296
1308
  return {
1297
1309
  /** Get floors */
1298
- async list(query) {
1299
- return unwrap(await client.GET("/floors/v1", { params: { query } }));
1310
+ async list(query, options) {
1311
+ return unwrap(await client.GET("/floors/v1", { params: { query }, signal: options?.signal }), "GET /floors/v1");
1300
1312
  },
1301
1313
  /** Delete a floor */
1302
- async delete(id) {
1303
- return unwrap(await client.DELETE("/floors/v1/{id}", { params: { path: { id } } }));
1314
+ async delete(id, options) {
1315
+ return unwrap(await client.DELETE("/floors/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /floors/v1/{id}");
1304
1316
  }
1305
1317
  };
1306
1318
  }
@@ -1313,17 +1325,17 @@ function createGuides(client, defaults) {
1313
1325
  *
1314
1326
  * Retrieve all guides for an organization. Requires locationRef. When using bearer token (non-basic auth), results are filtered by the user's access.
1315
1327
  */
1316
- async list(query) {
1317
- return unwrap(await client.GET("/guides/v1", { params: { query } }));
1328
+ async list(query, options) {
1329
+ return unwrap(await client.GET("/guides/v1", { params: { query }, signal: options?.signal }), "GET /guides/v1");
1318
1330
  },
1319
1331
  /**
1320
1332
  * Retrieve guides — iterates every item across all pages.
1321
1333
  *
1322
1334
  * Retrieve all guides for an organization. Requires locationRef. When using bearer token (non-basic auth), results are filtered by the user's access.
1323
1335
  */
1324
- iterate(query) {
1336
+ iterate(query, options) {
1325
1337
  return paginate(
1326
- async (nextPageToken) => unwrap(await client.GET("/guides/v1", { params: { query: { ...query, nextPageToken } } })),
1338
+ async (nextPageToken) => unwrap(await client.GET("/guides/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /guides/v1"),
1327
1339
  "guides"
1328
1340
  );
1329
1341
  },
@@ -1332,28 +1344,28 @@ function createGuides(client, defaults) {
1332
1344
  *
1333
1345
  * Retrieve a guide by id.
1334
1346
  */
1335
- async get(guideId) {
1336
- return unwrapProp(await client.GET("/guides/v1/{guideId}", { params: { path: { guideId } } }), "guide");
1347
+ async get(guideId, options) {
1348
+ return unwrapProp(await client.GET("/guides/v1/{guideId}", { params: { path: { guideId } }, signal: options?.signal }), "guide", "GET /guides/v1/{guideId}");
1337
1349
  },
1338
1350
  /**
1339
1351
  * Create a guide
1340
1352
  *
1341
1353
  * Create a guide in an organization.
1342
1354
  */
1343
- async create(body) {
1344
- return unwrapProp(await client.POST("/guides/v1", { body }), "guide");
1355
+ async create(body, options) {
1356
+ return unwrapProp(await client.POST("/guides/v1", { body, signal: options?.signal }), "guide", "POST /guides/v1");
1345
1357
  },
1346
1358
  /**
1347
1359
  * Update a guide
1348
1360
  *
1349
1361
  * Update a guide. At least one guide property must be provided.
1350
1362
  */
1351
- async update(guideId, body) {
1352
- return unwrapProp(await client.PATCH("/guides/v1/{guideId}", { params: { path: { guideId } }, body }), "guide");
1363
+ async update(guideId, body, options) {
1364
+ return unwrapProp(await client.PATCH("/guides/v1/{guideId}", { params: { path: { guideId } }, body, signal: options?.signal }), "guide", "PATCH /guides/v1/{guideId}");
1353
1365
  },
1354
1366
  /** Delete a guide */
1355
- async delete(guideId) {
1356
- return unwrap(await client.DELETE("/guides/v1/{guideId}", { params: { path: { guideId } } }));
1367
+ async delete(guideId, options) {
1368
+ return unwrap(await client.DELETE("/guides/v1/{guideId}", { params: { path: { guideId } }, signal: options?.signal }), "DELETE /guides/v1/{guideId}");
1357
1369
  }
1358
1370
  };
1359
1371
  }
@@ -1362,12 +1374,12 @@ function createGuides(client, defaults) {
1362
1374
  function createLocations(client, defaults) {
1363
1375
  return {
1364
1376
  /** Retrieve all locations */
1365
- async list() {
1366
- return unwrapProp(await client.GET("/locations/v1", {}), "locations");
1377
+ async list(options) {
1378
+ return unwrapProp(await client.GET("/locations/v1", { signal: options?.signal }), "locations", "GET /locations/v1");
1367
1379
  },
1368
1380
  /** Get a location */
1369
- async get(locationId) {
1370
- return unwrapProp(await client.GET("/locations/v1/{locationId}", { params: { path: { locationId } } }), "location");
1381
+ async get(locationId, options) {
1382
+ return unwrapProp(await client.GET("/locations/v1/{locationId}", { params: { path: { locationId } }, signal: options?.signal }), "location", "GET /locations/v1/{locationId}");
1371
1383
  }
1372
1384
  };
1373
1385
  }
@@ -1380,8 +1392,8 @@ function createNetworks(client, defaults) {
1380
1392
  *
1381
1393
  * Retrieve all networks you are in.
1382
1394
  */
1383
- async list() {
1384
- return unwrapProp(await client.GET("/networks/v1", {}), "networks");
1395
+ async list(options) {
1396
+ return unwrapProp(await client.GET("/networks/v1", { signal: options?.signal }), "networks", "GET /networks/v1");
1385
1397
  }
1386
1398
  };
1387
1399
  }
@@ -1394,17 +1406,17 @@ function createPlans(client, defaults) {
1394
1406
  *
1395
1407
  * Retrieve all plans.
1396
1408
  */
1397
- async list(query) {
1398
- return unwrap(await client.GET("/plans/v1", { params: { query } }));
1409
+ async list(query, options) {
1410
+ return unwrap(await client.GET("/plans/v1", { params: { query }, signal: options?.signal }), "GET /plans/v1");
1399
1411
  },
1400
1412
  /**
1401
1413
  * Retrieve plans — iterates every item across all pages.
1402
1414
  *
1403
1415
  * Retrieve all plans.
1404
1416
  */
1405
- iterate(query) {
1417
+ iterate(query, options) {
1406
1418
  return paginate(
1407
- async (nextPageToken) => unwrap(await client.GET("/plans/v1", { params: { query: { ...query, nextPageToken } } })),
1419
+ async (nextPageToken) => unwrap(await client.GET("/plans/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /plans/v1"),
1408
1420
  "plans"
1409
1421
  );
1410
1422
  },
@@ -1413,28 +1425,28 @@ function createPlans(client, defaults) {
1413
1425
  *
1414
1426
  * Retrieve a certain plan.
1415
1427
  */
1416
- async get(planId) {
1417
- return unwrapProp(await client.GET("/plans/v1/{planId}", { params: { path: { planId } } }), "plan");
1428
+ async get(planId, options) {
1429
+ return unwrapProp(await client.GET("/plans/v1/{planId}", { params: { path: { planId } }, signal: options?.signal }), "plan", "GET /plans/v1/{planId}");
1418
1430
  },
1419
1431
  /** Create a plan */
1420
- async create(body) {
1421
- return unwrapProp(await client.POST("/plans/v1", { body }), "plan");
1432
+ async create(body, options) {
1433
+ return unwrapProp(await client.POST("/plans/v1", { body, signal: options?.signal }), "plan", "POST /plans/v1");
1422
1434
  },
1423
1435
  /**
1424
1436
  * Update a plan
1425
1437
  *
1426
1438
  * Update a certain plan.
1427
1439
  */
1428
- async update(planId, body) {
1429
- return unwrap(await client.PATCH("/plans/v1/{planId}", { params: { path: { planId } }, body }));
1440
+ async update(planId, body, options) {
1441
+ return unwrap(await client.PATCH("/plans/v1/{planId}", { params: { path: { planId } }, body, signal: options?.signal }), "PATCH /plans/v1/{planId}");
1430
1442
  },
1431
1443
  /**
1432
1444
  * Delete a plan
1433
1445
  *
1434
1446
  * Delete a certain plan.
1435
1447
  */
1436
- async delete(planId) {
1437
- return unwrap(await client.DELETE("/plans/v1/{planId}", { params: { path: { planId } } }));
1448
+ async delete(planId, options) {
1449
+ return unwrap(await client.DELETE("/plans/v1/{planId}", { params: { path: { planId } }, signal: options?.signal }), "DELETE /plans/v1/{planId}");
1438
1450
  }
1439
1451
  };
1440
1452
  }
@@ -1447,17 +1459,17 @@ function createRegistrations(client, defaults) {
1447
1459
  *
1448
1460
  * Retrieve all registrations in network.
1449
1461
  */
1450
- async list(query) {
1451
- return unwrap(await client.GET("/registrations/v1", { params: { query } }));
1462
+ async list(query, options) {
1463
+ return unwrap(await client.GET("/registrations/v1", { params: { query }, signal: options?.signal }), "GET /registrations/v1");
1452
1464
  },
1453
1465
  /**
1454
1466
  * Retrieve registrations — iterates every item across all pages.
1455
1467
  *
1456
1468
  * Retrieve all registrations in network.
1457
1469
  */
1458
- iterate(query) {
1470
+ iterate(query, options) {
1459
1471
  return paginate(
1460
- async (nextPageToken) => unwrap(await client.GET("/registrations/v1", { params: { query: { ...query, nextPageToken } } })),
1472
+ async (nextPageToken) => unwrap(await client.GET("/registrations/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /registrations/v1"),
1461
1473
  "registrations"
1462
1474
  );
1463
1475
  }
@@ -1472,17 +1484,17 @@ function createResources(client, defaults) {
1472
1484
  *
1473
1485
  * Retrieve resources in the location. Resources represent all kind of bookable items like rooms, hot desks, dedicated desks, parking lots.
1474
1486
  */
1475
- async list(query) {
1476
- return unwrap(await client.GET("/resources/v1", { params: { query } }));
1487
+ async list(query, options) {
1488
+ return unwrap(await client.GET("/resources/v1", { params: { query }, signal: options?.signal }), "GET /resources/v1");
1477
1489
  },
1478
1490
  /**
1479
1491
  * Retrieve resources — iterates every item across all pages.
1480
1492
  *
1481
1493
  * Retrieve resources in the location. Resources represent all kind of bookable items like rooms, hot desks, dedicated desks, parking lots.
1482
1494
  */
1483
- iterate(query) {
1495
+ iterate(query, options) {
1484
1496
  return paginate(
1485
- async (nextPageToken) => unwrap(await client.GET("/resources/v1", { params: { query: { ...query, nextPageToken } } })),
1497
+ async (nextPageToken) => unwrap(await client.GET("/resources/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /resources/v1"),
1486
1498
  "resources"
1487
1499
  );
1488
1500
  },
@@ -1491,24 +1503,24 @@ function createResources(client, defaults) {
1491
1503
  *
1492
1504
  * Get a certain resource.
1493
1505
  */
1494
- async get(id) {
1495
- return unwrapProp(await client.GET("/resources/v1/{id}", { params: { path: { id } } }), "resource");
1506
+ async get(id, options) {
1507
+ return unwrapProp(await client.GET("/resources/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "resource", "GET /resources/v1/{id}");
1496
1508
  },
1497
1509
  /**
1498
1510
  * Create a resource
1499
1511
  *
1500
1512
  * Create a new resource in a location. The request body must match the schema exactly—unknown properties are rejected.
1501
1513
  */
1502
- async create(body) {
1503
- return unwrapProp(await client.POST("/resources/v1", { body }), "resource");
1514
+ async create(body, options) {
1515
+ return unwrapProp(await client.POST("/resources/v1", { body, signal: options?.signal }), "resource", "POST /resources/v1");
1504
1516
  },
1505
1517
  /**
1506
1518
  * Patch a resource
1507
1519
  *
1508
1520
  * Patch a certain resource.
1509
1521
  */
1510
- async update(id, body) {
1511
- return unwrap(await client.PATCH("/resources/v1/{id}", { params: { path: { id } }, body }));
1522
+ async update(id, body, options) {
1523
+ return unwrap(await client.PATCH("/resources/v1/{id}", { params: { path: { id } }, body, signal: options?.signal }), "PATCH /resources/v1/{id}");
1512
1524
  },
1513
1525
  bookings: {
1514
1526
  /**
@@ -1516,31 +1528,31 @@ function createResources(client, defaults) {
1516
1528
  *
1517
1529
  * Retrieve all bookings of resources.
1518
1530
  */
1519
- async list(query) {
1520
- return unwrap(await client.GET("/resources/bookings/v1", { params: { query } }));
1531
+ async list(query, options) {
1532
+ return unwrap(await client.GET("/resources/bookings/v1", { params: { query }, signal: options?.signal }), "GET /resources/bookings/v1");
1521
1533
  },
1522
1534
  /**
1523
1535
  * Retrieve bookings — iterates every item across all pages.
1524
1536
  *
1525
1537
  * Retrieve all bookings of resources.
1526
1538
  */
1527
- iterate(query) {
1539
+ iterate(query, options) {
1528
1540
  return paginate(
1529
- async (nextPageToken) => unwrap(await client.GET("/resources/bookings/v1", { params: { query: { ...query, nextPageToken } } })),
1541
+ async (nextPageToken) => unwrap(await client.GET("/resources/bookings/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /resources/bookings/v1"),
1530
1542
  "bookings"
1531
1543
  );
1532
1544
  },
1533
1545
  /** Get a booking */
1534
- async get(id) {
1535
- return unwrapProp(await client.GET("/resources/bookings/v1/{id}", { params: { path: { id } } }), "booking");
1546
+ async get(id, options) {
1547
+ return unwrapProp(await client.GET("/resources/bookings/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "booking", "GET /resources/bookings/v1/{id}");
1536
1548
  },
1537
1549
  /** Create a booking */
1538
- async create(body) {
1539
- return unwrapProp(await client.POST("/resources/bookings/v1", { body }), "booking");
1550
+ async create(body, options) {
1551
+ return unwrapProp(await client.POST("/resources/bookings/v1", { body, signal: options?.signal }), "booking", "POST /resources/bookings/v1");
1540
1552
  },
1541
1553
  /** Delete a booking */
1542
- async delete(id) {
1543
- return unwrap(await client.DELETE("/resources/bookings/v1/{id}", { params: { path: { id } } }));
1554
+ async delete(id, options) {
1555
+ return unwrap(await client.DELETE("/resources/bookings/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /resources/bookings/v1/{id}");
1544
1556
  }
1545
1557
  }
1546
1558
  };
@@ -1555,40 +1567,40 @@ function createShop(client, defaults) {
1555
1567
  *
1556
1568
  * Retrieve all shop categories in the location.
1557
1569
  */
1558
- async list(query) {
1559
- return unwrapProp(await client.GET("/shop/categories/v1", { params: { query } }), "categories");
1570
+ async list(query, options) {
1571
+ return unwrapProp(await client.GET("/shop/categories/v1", { params: { query }, signal: options?.signal }), "categories", "GET /shop/categories/v1");
1560
1572
  },
1561
1573
  /**
1562
1574
  * Get a category
1563
1575
  *
1564
1576
  * Get a shop category.
1565
1577
  */
1566
- async get(categoryId) {
1567
- return unwrapProp(await client.GET("/shop/categories/v1/{categoryId}", { params: { path: { categoryId } } }), "category");
1578
+ async get(categoryId, options) {
1579
+ return unwrapProp(await client.GET("/shop/categories/v1/{categoryId}", { params: { path: { categoryId } }, signal: options?.signal }), "category", "GET /shop/categories/v1/{categoryId}");
1568
1580
  },
1569
1581
  /**
1570
1582
  * Create a category
1571
1583
  *
1572
1584
  * Create a shop category.
1573
1585
  */
1574
- async create(body) {
1575
- return unwrapProp(await client.POST("/shop/categories/v1", { body }), "category");
1586
+ async create(body, options) {
1587
+ return unwrapProp(await client.POST("/shop/categories/v1", { body, signal: options?.signal }), "category", "POST /shop/categories/v1");
1576
1588
  },
1577
1589
  /**
1578
1590
  * Update a category
1579
1591
  *
1580
1592
  * Update a shop category.
1581
1593
  */
1582
- async update(categoryId, body) {
1583
- return unwrapProp(await client.PUT("/shop/categories/v1/{categoryId}", { params: { path: { categoryId } }, body }), "category");
1594
+ async update(categoryId, body, options) {
1595
+ return unwrapProp(await client.PUT("/shop/categories/v1/{categoryId}", { params: { path: { categoryId } }, body, signal: options?.signal }), "category", "PUT /shop/categories/v1/{categoryId}");
1584
1596
  },
1585
1597
  /**
1586
1598
  * Delete a category
1587
1599
  *
1588
1600
  * Delete a shop category.
1589
1601
  */
1590
- async delete(categoryId) {
1591
- return unwrap(await client.DELETE("/shop/categories/v1/{categoryId}", { params: { path: { categoryId } } }));
1602
+ async delete(categoryId, options) {
1603
+ return unwrap(await client.DELETE("/shop/categories/v1/{categoryId}", { params: { path: { categoryId } }, signal: options?.signal }), "DELETE /shop/categories/v1/{categoryId}");
1592
1604
  }
1593
1605
  },
1594
1606
  orders: {
@@ -1597,17 +1609,17 @@ function createShop(client, defaults) {
1597
1609
  *
1598
1610
  * Retrieve all orders of products from shop.
1599
1611
  */
1600
- async list(query) {
1601
- return unwrap(await client.GET("/shop/orders/v1", { params: { query } }));
1612
+ async list(query, options) {
1613
+ return unwrap(await client.GET("/shop/orders/v1", { params: { query }, signal: options?.signal }), "GET /shop/orders/v1");
1602
1614
  },
1603
1615
  /**
1604
1616
  * Retrieve orders — iterates every item across all pages.
1605
1617
  *
1606
1618
  * Retrieve all orders of products from shop.
1607
1619
  */
1608
- iterate(query) {
1620
+ iterate(query, options) {
1609
1621
  return paginate(
1610
- async (nextPageToken) => unwrap(await client.GET("/shop/orders/v1", { params: { query: { ...query, nextPageToken } } })),
1622
+ async (nextPageToken) => unwrap(await client.GET("/shop/orders/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /shop/orders/v1"),
1611
1623
  "orders"
1612
1624
  );
1613
1625
  },
@@ -1616,8 +1628,8 @@ function createShop(client, defaults) {
1616
1628
  *
1617
1629
  * Get a certain order.
1618
1630
  */
1619
- async get(orderId) {
1620
- return unwrapProp(await client.GET("/shop/orders/v1/{orderId}", { params: { path: { orderId } } }), "order");
1631
+ async get(orderId, options) {
1632
+ return unwrapProp(await client.GET("/shop/orders/v1/{orderId}", { params: { path: { orderId } }, signal: options?.signal }), "order", "GET /shop/orders/v1/{orderId}");
1621
1633
  }
1622
1634
  },
1623
1635
  products: {
@@ -1626,17 +1638,17 @@ function createShop(client, defaults) {
1626
1638
  *
1627
1639
  * Retrieve products from shop.
1628
1640
  */
1629
- async list(query) {
1630
- return unwrap(await client.GET("/shop/products/v1", { params: { query } }));
1641
+ async list(query, options) {
1642
+ return unwrap(await client.GET("/shop/products/v1", { params: { query }, signal: options?.signal }), "GET /shop/products/v1");
1631
1643
  },
1632
1644
  /**
1633
1645
  * Retrieve products — iterates every item across all pages.
1634
1646
  *
1635
1647
  * Retrieve products from shop.
1636
1648
  */
1637
- iterate(query) {
1649
+ iterate(query, options) {
1638
1650
  return paginate(
1639
- async (nextPageToken) => unwrap(await client.GET("/shop/products/v1", { params: { query: { ...query, nextPageToken } } })),
1651
+ async (nextPageToken) => unwrap(await client.GET("/shop/products/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /shop/products/v1"),
1640
1652
  "products"
1641
1653
  );
1642
1654
  },
@@ -1645,32 +1657,32 @@ function createShop(client, defaults) {
1645
1657
  *
1646
1658
  * Get a certain product.
1647
1659
  */
1648
- async get(productId) {
1649
- return unwrapProp(await client.GET("/shop/products/v1/{productId}", { params: { path: { productId } } }), "product");
1660
+ async get(productId, options) {
1661
+ return unwrapProp(await client.GET("/shop/products/v1/{productId}", { params: { path: { productId } }, signal: options?.signal }), "product", "GET /shop/products/v1/{productId}");
1650
1662
  },
1651
1663
  /**
1652
1664
  * Create a product
1653
1665
  *
1654
1666
  * Create a product in shop.
1655
1667
  */
1656
- async create(body) {
1657
- return unwrapProp(await client.POST("/shop/products/v1", { body }), "product");
1668
+ async create(body, options) {
1669
+ return unwrapProp(await client.POST("/shop/products/v1", { body, signal: options?.signal }), "product", "POST /shop/products/v1");
1658
1670
  },
1659
1671
  /**
1660
1672
  * Update a product
1661
1673
  *
1662
1674
  * Update a certain product.
1663
1675
  */
1664
- async update(productId, body) {
1665
- return unwrapProp(await client.PUT("/shop/products/v1/{productId}", { params: { path: { productId } }, body }), "product");
1676
+ async update(productId, body, options) {
1677
+ return unwrapProp(await client.PUT("/shop/products/v1/{productId}", { params: { path: { productId } }, body, signal: options?.signal }), "product", "PUT /shop/products/v1/{productId}");
1666
1678
  },
1667
1679
  /**
1668
1680
  * Delete a product
1669
1681
  *
1670
1682
  * Delete a certain product.
1671
1683
  */
1672
- async delete(productId) {
1673
- return unwrap(await client.DELETE("/shop/products/v1/{productId}", { params: { path: { productId } } }));
1684
+ async delete(productId, options) {
1685
+ return unwrap(await client.DELETE("/shop/products/v1/{productId}", { params: { path: { productId } }, signal: options?.signal }), "DELETE /shop/products/v1/{productId}");
1674
1686
  }
1675
1687
  }
1676
1688
  };
@@ -1680,13 +1692,13 @@ function createShop(client, defaults) {
1680
1692
  function createSubscriptions(client, defaults) {
1681
1693
  return {
1682
1694
  /** Retrieve subscriptions */
1683
- async list(query) {
1684
- return unwrap(await client.GET("/subscriptions/v1", { params: { query } }));
1695
+ async list(query, options) {
1696
+ return unwrap(await client.GET("/subscriptions/v1", { params: { query }, signal: options?.signal }), "GET /subscriptions/v1");
1685
1697
  },
1686
1698
  /** Retrieve subscriptions — iterates every item across all pages. */
1687
- iterate(query) {
1699
+ iterate(query, options) {
1688
1700
  return paginate(
1689
- async (nextPageToken) => unwrap(await client.GET("/subscriptions/v1", { params: { query: { ...query, nextPageToken } } })),
1701
+ async (nextPageToken) => unwrap(await client.GET("/subscriptions/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /subscriptions/v1"),
1690
1702
  "subscriptions"
1691
1703
  );
1692
1704
  },
@@ -1695,44 +1707,44 @@ function createSubscriptions(client, defaults) {
1695
1707
  *
1696
1708
  * Retrieve a certain subscription.
1697
1709
  */
1698
- async get(subscriptionId) {
1699
- return unwrapProp(await client.GET("/subscriptions/v1/{subscriptionId}", { params: { path: { subscriptionId } } }), "subscription");
1710
+ async get(subscriptionId, options) {
1711
+ return unwrapProp(await client.GET("/subscriptions/v1/{subscriptionId}", { params: { path: { subscriptionId } }, signal: options?.signal }), "subscription", "GET /subscriptions/v1/{subscriptionId}");
1700
1712
  },
1701
1713
  /**
1702
1714
  * Create a subscription
1703
1715
  *
1704
1716
  * Create a subscription for a membership or company.
1705
1717
  */
1706
- async create(body) {
1707
- return unwrapProp(await client.POST("/subscriptions/v1", { body }), "subscription");
1718
+ async create(body, options) {
1719
+ return unwrapProp(await client.POST("/subscriptions/v1", { body, signal: options?.signal }), "subscription", "POST /subscriptions/v1");
1708
1720
  },
1709
1721
  /**
1710
1722
  * Update a subscription
1711
1723
  *
1712
1724
  * Update a certain subscription.
1713
1725
  */
1714
- async update(subscriptionId, body) {
1715
- return unwrap(await client.PATCH("/subscriptions/v1/{subscriptionId}", { params: { path: { subscriptionId } }, body }));
1726
+ async update(subscriptionId, body, options) {
1727
+ return unwrap(await client.PATCH("/subscriptions/v1/{subscriptionId}", { params: { path: { subscriptionId } }, body, signal: options?.signal }), "PATCH /subscriptions/v1/{subscriptionId}");
1716
1728
  },
1717
1729
  /**
1718
1730
  * Delete a subscription
1719
1731
  *
1720
1732
  * Delete a certain subscription.
1721
1733
  */
1722
- async delete(subscriptionId) {
1723
- return unwrap(await client.DELETE("/subscriptions/v1/{subscriptionId}", { params: { path: { subscriptionId } } }));
1734
+ async delete(subscriptionId, options) {
1735
+ return unwrap(await client.DELETE("/subscriptions/v1/{subscriptionId}", { params: { path: { subscriptionId } }, signal: options?.signal }), "DELETE /subscriptions/v1/{subscriptionId}");
1724
1736
  },
1725
1737
  /** Create a subscription item */
1726
- async createItem(subscriptionId, body) {
1727
- return unwrapProp(await client.POST("/subscriptions/v1/{subscriptionId}/items", { params: { path: { subscriptionId } }, body }), "subscription");
1738
+ async createItem(subscriptionId, body, options) {
1739
+ return unwrapProp(await client.POST("/subscriptions/v1/{subscriptionId}/items", { params: { path: { subscriptionId } }, body, signal: options?.signal }), "subscription", "POST /subscriptions/v1/{subscriptionId}/items");
1728
1740
  },
1729
1741
  /** Delete a subscription item */
1730
- async deleteItem(subscriptionId, itemId) {
1731
- return unwrap(await client.DELETE("/subscriptions/v1/{subscriptionId}/items/{itemId}", { params: { path: { subscriptionId, itemId } } }));
1742
+ async deleteItem(subscriptionId, itemId, options) {
1743
+ return unwrap(await client.DELETE("/subscriptions/v1/{subscriptionId}/items/{itemId}", { params: { path: { subscriptionId, itemId } }, signal: options?.signal }), "DELETE /subscriptions/v1/{subscriptionId}/items/{itemId}");
1732
1744
  },
1733
1745
  /** Update a subscription item */
1734
- async updateItem(subscriptionId, itemId, body) {
1735
- return unwrap(await client.PATCH("/subscriptions/v1/{subscriptionId}/items/{itemId}", { params: { path: { subscriptionId, itemId } }, body }));
1746
+ async updateItem(subscriptionId, itemId, body, options) {
1747
+ return unwrap(await client.PATCH("/subscriptions/v1/{subscriptionId}/items/{itemId}", { params: { path: { subscriptionId, itemId } }, body, signal: options?.signal }), "PATCH /subscriptions/v1/{subscriptionId}/items/{itemId}");
1736
1748
  }
1737
1749
  };
1738
1750
  }
@@ -1746,17 +1758,17 @@ function createSupport(client, defaults) {
1746
1758
  *
1747
1759
  * Retrieve all support tickets.
1748
1760
  */
1749
- async list(query) {
1750
- return unwrap(await client.GET("/support/tickets/v1", { params: { query } }));
1761
+ async list(query, options) {
1762
+ return unwrap(await client.GET("/support/tickets/v1", { params: { query }, signal: options?.signal }), "GET /support/tickets/v1");
1751
1763
  },
1752
1764
  /**
1753
1765
  * Retrieve tickets — iterates every item across all pages.
1754
1766
  *
1755
1767
  * Retrieve all support tickets.
1756
1768
  */
1757
- iterate(query) {
1769
+ iterate(query, options) {
1758
1770
  return paginate(
1759
- async (nextPageToken) => unwrap(await client.GET("/support/tickets/v1", { params: { query: { ...query, nextPageToken } } })),
1771
+ async (nextPageToken) => unwrap(await client.GET("/support/tickets/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /support/tickets/v1"),
1760
1772
  "tickets"
1761
1773
  );
1762
1774
  },
@@ -1765,40 +1777,40 @@ function createSupport(client, defaults) {
1765
1777
  *
1766
1778
  * Retrieve a support ticket.
1767
1779
  */
1768
- async get(id) {
1769
- return unwrap(await client.GET("/support/tickets/v1/{id}", { params: { path: { id } } }));
1780
+ async get(id, options) {
1781
+ return unwrap(await client.GET("/support/tickets/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "GET /support/tickets/v1/{id}");
1770
1782
  },
1771
1783
  /**
1772
1784
  * Create a ticket
1773
1785
  *
1774
1786
  * Create a support ticket.
1775
1787
  */
1776
- async create(body) {
1777
- return unwrap(await client.POST("/support/tickets/v1", { body }));
1788
+ async create(body, options) {
1789
+ return unwrap(await client.POST("/support/tickets/v1", { body, signal: options?.signal }), "POST /support/tickets/v1");
1778
1790
  },
1779
1791
  /**
1780
1792
  * Update a ticket's assignee
1781
1793
  *
1782
1794
  * Update support ticket assignee.
1783
1795
  */
1784
- async updateAssignee(id, body) {
1785
- return unwrap(await client.PUT("/support/tickets/v1/{id}/assignee", { params: { path: { id } }, body }));
1796
+ async updateAssignee(id, body, options) {
1797
+ return unwrap(await client.PUT("/support/tickets/v1/{id}/assignee", { params: { path: { id } }, body, signal: options?.signal }), "PUT /support/tickets/v1/{id}/assignee");
1786
1798
  },
1787
1799
  /**
1788
1800
  * Update a ticket's status
1789
1801
  *
1790
1802
  * Update support ticket status.
1791
1803
  */
1792
- async updateStatus(id, body) {
1793
- return unwrap(await client.PUT("/support/tickets/v1/{id}/status", { params: { path: { id } }, body }));
1804
+ async updateStatus(id, body, options) {
1805
+ return unwrap(await client.PUT("/support/tickets/v1/{id}/status", { params: { path: { id } }, body, signal: options?.signal }), "PUT /support/tickets/v1/{id}/status");
1794
1806
  },
1795
1807
  /**
1796
1808
  * Update a ticket's type
1797
1809
  *
1798
1810
  * Update a support ticket type.
1799
1811
  */
1800
- async updateType(id, body) {
1801
- return unwrap(await client.PATCH("/support/tickets/v1/{id}/type", { params: { path: { id } }, body }));
1812
+ async updateType(id, body, options) {
1813
+ return unwrap(await client.PATCH("/support/tickets/v1/{id}/type", { params: { path: { id } }, body, signal: options?.signal }), "PATCH /support/tickets/v1/{id}/type");
1802
1814
  },
1803
1815
  comment: {
1804
1816
  /**
@@ -1806,16 +1818,16 @@ function createSupport(client, defaults) {
1806
1818
  *
1807
1819
  * Create a support ticket comment.
1808
1820
  */
1809
- async create(body) {
1810
- return unwrapProp(await client.POST("/support/tickets/v1/comment", { body }), "activity");
1821
+ async create(body, options) {
1822
+ return unwrapProp(await client.POST("/support/tickets/v1/comment", { body, signal: options?.signal }), "activity", "POST /support/tickets/v1/comment");
1811
1823
  },
1812
1824
  /**
1813
1825
  * Delete a ticket comment
1814
1826
  *
1815
1827
  * Delete a support ticket comment.
1816
1828
  */
1817
- async delete(id) {
1818
- return unwrap(await client.DELETE("/support/tickets/v1/comment/{id}", { params: { path: { id } } }));
1829
+ async delete(id, options) {
1830
+ return unwrap(await client.DELETE("/support/tickets/v1/comment/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /support/tickets/v1/comment/{id}");
1819
1831
  }
1820
1832
  }
1821
1833
  }
@@ -1831,12 +1843,12 @@ function createTransactions(client, defaults) {
1831
1843
  *
1832
1844
  * Retrieve credits balance.
1833
1845
  */
1834
- async getCredits(id) {
1835
- return unwrapProp(await client.GET("/transactions/v1/balances/{id}/credits", { params: { path: { id } } }), "balances");
1846
+ async getCredits(id, options) {
1847
+ return unwrapProp(await client.GET("/transactions/v1/balances/{id}/credits", { params: { path: { id } }, signal: options?.signal }), "balances", "GET /transactions/v1/balances/{id}/credits");
1836
1848
  },
1837
1849
  /** Retrieve day passes balance */
1838
- async getDayPasses(id) {
1839
- return unwrapProp(await client.GET("/transactions/v1/balances/{id}/day_passes", { params: { path: { id } } }), "balances");
1850
+ async getDayPasses(id, options) {
1851
+ return unwrapProp(await client.GET("/transactions/v1/balances/{id}/day_passes", { params: { path: { id } }, signal: options?.signal }), "balances", "GET /transactions/v1/balances/{id}/day_passes");
1840
1852
  }
1841
1853
  },
1842
1854
  credits: {
@@ -1845,17 +1857,17 @@ function createTransactions(client, defaults) {
1845
1857
  *
1846
1858
  * Retrieve credits transactions.
1847
1859
  */
1848
- async list(query) {
1849
- return unwrap(await client.GET("/transactions/credits/v1", { params: { query } }));
1860
+ async list(query, options) {
1861
+ return unwrap(await client.GET("/transactions/credits/v1", { params: { query }, signal: options?.signal }), "GET /transactions/credits/v1");
1850
1862
  },
1851
1863
  /**
1852
1864
  * Retrieve credit transactions — iterates every item across all pages.
1853
1865
  *
1854
1866
  * Retrieve credits transactions.
1855
1867
  */
1856
- iterate(query) {
1868
+ iterate(query, options) {
1857
1869
  return paginate(
1858
- async (nextPageToken) => unwrap(await client.GET("/transactions/credits/v1", { params: { query: { ...query, nextPageToken } } })),
1870
+ async (nextPageToken) => unwrap(await client.GET("/transactions/credits/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /transactions/credits/v1"),
1859
1871
  "transactions"
1860
1872
  );
1861
1873
  },
@@ -1864,8 +1876,8 @@ function createTransactions(client, defaults) {
1864
1876
  *
1865
1877
  * Create a credits transaction.
1866
1878
  */
1867
- async create(body) {
1868
- return unwrapProp(await client.POST("/transactions/credits/v1", { body }), "transaction");
1879
+ async create(body, options) {
1880
+ return unwrapProp(await client.POST("/transactions/credits/v1", { body, signal: options?.signal }), "transaction", "POST /transactions/credits/v1");
1869
1881
  }
1870
1882
  },
1871
1883
  dayPasses: {
@@ -1874,17 +1886,17 @@ function createTransactions(client, defaults) {
1874
1886
  *
1875
1887
  * Retrieve day passes transactions.
1876
1888
  */
1877
- async list(query) {
1878
- return unwrap(await client.GET("/transactions/day_passes/v1", { params: { query } }));
1889
+ async list(query, options) {
1890
+ return unwrap(await client.GET("/transactions/day_passes/v1", { params: { query }, signal: options?.signal }), "GET /transactions/day_passes/v1");
1879
1891
  },
1880
1892
  /**
1881
1893
  * Retrieve day pass transactions — iterates every item across all pages.
1882
1894
  *
1883
1895
  * Retrieve day passes transactions.
1884
1896
  */
1885
- iterate(query) {
1897
+ iterate(query, options) {
1886
1898
  return paginate(
1887
- async (nextPageToken) => unwrap(await client.GET("/transactions/day_passes/v1", { params: { query: { ...query, nextPageToken } } })),
1899
+ async (nextPageToken) => unwrap(await client.GET("/transactions/day_passes/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /transactions/day_passes/v1"),
1888
1900
  "transactions"
1889
1901
  );
1890
1902
  },
@@ -1893,25 +1905,25 @@ function createTransactions(client, defaults) {
1893
1905
  *
1894
1906
  * Create a day passes transaction.
1895
1907
  */
1896
- async create(body) {
1897
- return unwrapProp(await client.POST("/transactions/day_passes/v1", { body }), "transaction");
1908
+ async create(body, options) {
1909
+ return unwrapProp(await client.POST("/transactions/day_passes/v1", { body, signal: options?.signal }), "transaction", "POST /transactions/day_passes/v1");
1898
1910
  }
1899
1911
  },
1900
1912
  money: {
1901
1913
  /** Retrieve money transactions */
1902
- async list(query) {
1903
- return unwrap(await client.GET("/transactions/money/v1", { params: { query } }));
1914
+ async list(query, options) {
1915
+ return unwrap(await client.GET("/transactions/money/v1", { params: { query }, signal: options?.signal }), "GET /transactions/money/v1");
1904
1916
  },
1905
1917
  /** Retrieve money transactions — iterates every item across all pages. */
1906
- iterate(query) {
1918
+ iterate(query, options) {
1907
1919
  return paginate(
1908
- async (nextPageToken) => unwrap(await client.GET("/transactions/money/v1", { params: { query: { ...query, nextPageToken } } })),
1920
+ async (nextPageToken) => unwrap(await client.GET("/transactions/money/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /transactions/money/v1"),
1909
1921
  "transactions"
1910
1922
  );
1911
1923
  },
1912
1924
  /** Retrieve a money transaction */
1913
- async get(id) {
1914
- return unwrapProp(await client.GET("/transactions/money/v1/{id}", { params: { path: { id } } }), "transaction");
1925
+ async get(id, options) {
1926
+ return unwrapProp(await client.GET("/transactions/money/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "transaction", "GET /transactions/money/v1/{id}");
1915
1927
  }
1916
1928
  }
1917
1929
  };
@@ -1922,63 +1934,63 @@ function createVisitors(client, defaults) {
1922
1934
  return {
1923
1935
  contacts: {
1924
1936
  /** Get contacts */
1925
- async list(query) {
1926
- return unwrap(await client.GET("/visitors/contacts/v1", { params: { query } }));
1937
+ async list(query, options) {
1938
+ return unwrap(await client.GET("/visitors/contacts/v1", { params: { query }, signal: options?.signal }), "GET /visitors/contacts/v1");
1927
1939
  },
1928
1940
  /** Get contacts — iterates every item across all pages. */
1929
- iterate(query) {
1941
+ iterate(query, options) {
1930
1942
  return paginate(
1931
- async (nextPageToken) => unwrap(await client.GET("/visitors/contacts/v1", { params: { query: { ...query, nextPageToken } } })),
1943
+ async (nextPageToken) => unwrap(await client.GET("/visitors/contacts/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /visitors/contacts/v1"),
1932
1944
  "contacts"
1933
1945
  );
1934
1946
  },
1935
1947
  /** Get a contact */
1936
- async get(contactId) {
1937
- return unwrapProp(await client.GET("/visitors/contacts/v1/{contactId}", { params: { path: { contactId } } }), "contact");
1948
+ async get(contactId, options) {
1949
+ return unwrapProp(await client.GET("/visitors/contacts/v1/{contactId}", { params: { path: { contactId } }, signal: options?.signal }), "contact", "GET /visitors/contacts/v1/{contactId}");
1938
1950
  },
1939
1951
  /** Create a contact */
1940
- async create(body) {
1941
- return unwrapProp(await client.POST("/visitors/contacts/v1", { body }), "contact");
1952
+ async create(body, options) {
1953
+ return unwrapProp(await client.POST("/visitors/contacts/v1", { body, signal: options?.signal }), "contact", "POST /visitors/contacts/v1");
1942
1954
  }
1943
1955
  },
1944
1956
  requests: {
1945
1957
  /** Get requests */
1946
- async list(query) {
1947
- return unwrap(await client.GET("/visitors/requests/v1", { params: { query } }));
1958
+ async list(query, options) {
1959
+ return unwrap(await client.GET("/visitors/requests/v1", { params: { query }, signal: options?.signal }), "GET /visitors/requests/v1");
1948
1960
  },
1949
1961
  /** Get requests — iterates every item across all pages. */
1950
- iterate(query) {
1962
+ iterate(query, options) {
1951
1963
  return paginate(
1952
- async (nextPageToken) => unwrap(await client.GET("/visitors/requests/v1", { params: { query: { ...query, nextPageToken } } })),
1964
+ async (nextPageToken) => unwrap(await client.GET("/visitors/requests/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /visitors/requests/v1"),
1953
1965
  "requests"
1954
1966
  );
1955
1967
  },
1956
1968
  /** Retrieve a request */
1957
- async get(id) {
1958
- return unwrapProp(await client.GET("/visitors/requests/v1/{id}", { params: { path: { id } } }), "request");
1969
+ async get(id, options) {
1970
+ return unwrapProp(await client.GET("/visitors/requests/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "request", "GET /visitors/requests/v1/{id}");
1959
1971
  },
1960
1972
  /** Create a request */
1961
- async create(body) {
1962
- return unwrapProp(await client.POST("/visitors/requests/v1", { body }), "request");
1973
+ async create(body, options) {
1974
+ return unwrapProp(await client.POST("/visitors/requests/v1", { body, signal: options?.signal }), "request", "POST /visitors/requests/v1");
1963
1975
  },
1964
1976
  /** Approve a request */
1965
- async approve(id) {
1966
- return unwrapProp(await client.POST("/visitors/requests/v1/{id}/approve", { params: { path: { id } } }), "visit");
1977
+ async approve(id, options) {
1978
+ return unwrapProp(await client.POST("/visitors/requests/v1/{id}/approve", { params: { path: { id } }, signal: options?.signal }), "visit", "POST /visitors/requests/v1/{id}/approve");
1967
1979
  },
1968
1980
  /** Reject a request */
1969
- async reject(id) {
1970
- return unwrap(await client.POST("/visitors/requests/v1/{id}/reject", { params: { path: { id } } }));
1981
+ async reject(id, options) {
1982
+ return unwrap(await client.POST("/visitors/requests/v1/{id}/reject", { params: { path: { id } }, signal: options?.signal }), "POST /visitors/requests/v1/{id}/reject");
1971
1983
  }
1972
1984
  },
1973
1985
  visits: {
1974
1986
  /** Retrieve visits */
1975
- async list(query) {
1976
- return unwrap(await client.GET("/visitors/visits/v1", { params: { query } }));
1987
+ async list(query, options) {
1988
+ return unwrap(await client.GET("/visitors/visits/v1", { params: { query }, signal: options?.signal }), "GET /visitors/visits/v1");
1977
1989
  },
1978
1990
  /** Retrieve visits — iterates every item across all pages. */
1979
- iterate(query) {
1991
+ iterate(query, options) {
1980
1992
  return paginate(
1981
- async (nextPageToken) => unwrap(await client.GET("/visitors/visits/v1", { params: { query: { ...query, nextPageToken } } })),
1993
+ async (nextPageToken) => unwrap(await client.GET("/visitors/visits/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /visitors/visits/v1"),
1982
1994
  "visits"
1983
1995
  );
1984
1996
  },
@@ -1987,36 +1999,36 @@ function createVisitors(client, defaults) {
1987
1999
  *
1988
2000
  * Retrieve a visit by id.
1989
2001
  */
1990
- async get(id) {
1991
- return unwrapProp(await client.GET("/visitors/visits/v1/{id}", { params: { path: { id } } }), "visit");
2002
+ async get(id, options) {
2003
+ return unwrapProp(await client.GET("/visitors/visits/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "visit", "GET /visitors/visits/v1/{id}");
1992
2004
  },
1993
2005
  /** Create a visit */
1994
- async create(body) {
1995
- return unwrapProp(await client.POST("/visitors/visits/v1", { body }), "visit");
2006
+ async create(body, options) {
2007
+ return unwrapProp(await client.POST("/visitors/visits/v1", { body, signal: options?.signal }), "visit", "POST /visitors/visits/v1");
1996
2008
  },
1997
2009
  /**
1998
2010
  * Update a visit
1999
2011
  *
2000
2012
  * Update a visit by id.
2001
2013
  */
2002
- async update(id, body) {
2003
- return unwrapProp(await client.PUT("/visitors/visits/v1/{id}", { params: { path: { id } }, body }), "visit");
2014
+ async update(id, body, options) {
2015
+ return unwrapProp(await client.PUT("/visitors/visits/v1/{id}", { params: { path: { id } }, body, signal: options?.signal }), "visit", "PUT /visitors/visits/v1/{id}");
2004
2016
  },
2005
2017
  /**
2006
2018
  * Delete a visit
2007
2019
  *
2008
2020
  * Delete a visit by id.
2009
2021
  */
2010
- async delete(id) {
2011
- return unwrap(await client.DELETE("/visitors/visits/v1/{id}", { params: { path: { id } } }));
2022
+ async delete(id, options) {
2023
+ return unwrap(await client.DELETE("/visitors/visits/v1/{id}", { params: { path: { id } }, signal: options?.signal }), "DELETE /visitors/visits/v1/{id}");
2012
2024
  },
2013
2025
  /** Check in a visit */
2014
- async checkIn(body) {
2015
- return unwrapProp(await client.POST("/visitors/visits/v1/checkin", { body }), "visit");
2026
+ async checkIn(body, options) {
2027
+ return unwrapProp(await client.POST("/visitors/visits/v1/checkin", { body, signal: options?.signal }), "visit", "POST /visitors/visits/v1/checkin");
2016
2028
  },
2017
2029
  /** Check out a visit */
2018
- async checkOut(body) {
2019
- return unwrapProp(await client.POST("/visitors/visits/v1/checkout", { body }), "visit");
2030
+ async checkOut(body, options) {
2031
+ return unwrapProp(await client.POST("/visitors/visits/v1/checkout", { body, signal: options?.signal }), "visit", "POST /visitors/visits/v1/checkout");
2020
2032
  }
2021
2033
  }
2022
2034
  };
@@ -2062,25 +2074,73 @@ var Spacebring = class {
2062
2074
  this.raw = createClient({
2063
2075
  baseUrl: config.baseUrl ?? "https://api.spacebring.com",
2064
2076
  headers,
2065
- fetch: withRetry(config.fetch ?? globalThis.fetch, config.maxRetries ?? 3)
2077
+ fetch: withRetry(config.fetch ?? globalThis.fetch, config.maxRetries ?? 3, config.timeoutMs)
2066
2078
  });
2067
2079
  Object.assign(this, createResources2(this.raw, { networkId: config.networkId }));
2068
2080
  }
2069
2081
  };
2070
- function withRetry(fetchImpl, maxRetries) {
2071
- if (maxRetries <= 0) return fetchImpl;
2082
+ var IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "PUT", "DELETE", "OPTIONS"]);
2083
+ var RETRYABLE_STATUSES = /* @__PURE__ */ new Set([502, 503, 504]);
2084
+ function withRetry(fetchImpl, maxRetries, timeoutMs) {
2085
+ if (maxRetries <= 0 && timeoutMs === void 0) return fetchImpl;
2072
2086
  return async (input, init) => {
2073
2087
  const request = input instanceof Request && init === void 0 ? input : new Request(input, init);
2088
+ const idempotent = IDEMPOTENT_METHODS.has(request.method);
2074
2089
  for (let attempt = 0; ; attempt += 1) {
2075
- const response = await fetchImpl(request.clone());
2076
- if (response.status !== 429 || attempt >= maxRetries) return response;
2077
- const retryAfterHeader = response.headers.get("retry-after");
2078
- const retryAfter = retryAfterHeader === null ? Number.NaN : Number(retryAfterHeader);
2079
- const delayMs = Number.isFinite(retryAfter) && retryAfter >= 0 ? Math.min(retryAfter * 1e3, 6e4) : Math.min(250 * 2 ** attempt + Math.random() * 100, 5e3);
2080
- await new Promise((resolve) => setTimeout(resolve, delayMs));
2090
+ let response;
2091
+ try {
2092
+ response = await fetchImpl(request.clone(), attemptInit(request, timeoutMs));
2093
+ } catch (error) {
2094
+ const retryable = attempt < maxRetries && idempotent && !request.signal.aborted && isTransientError(error);
2095
+ if (!retryable) throw error;
2096
+ await sleep(backoffMs(attempt), request.signal);
2097
+ continue;
2098
+ }
2099
+ const retryableStatus = response.status === 429 || idempotent && RETRYABLE_STATUSES.has(response.status);
2100
+ if (!retryableStatus || attempt >= maxRetries) return response;
2101
+ await sleep(retryDelayMs(response.headers.get("retry-after"), attempt), request.signal);
2081
2102
  }
2082
2103
  };
2083
2104
  }
2105
+ function attemptInit(request, timeoutMs) {
2106
+ if (timeoutMs === void 0) return void 0;
2107
+ const timeout = AbortSignal.timeout(timeoutMs);
2108
+ return {
2109
+ signal: typeof AbortSignal.any === "function" ? AbortSignal.any([request.signal, timeout]) : timeout
2110
+ };
2111
+ }
2112
+ function isTransientError(error) {
2113
+ return error instanceof TypeError || error instanceof Error && error.name === "TimeoutError";
2114
+ }
2115
+ function retryDelayMs(retryAfter, attempt) {
2116
+ if (retryAfter !== null) {
2117
+ const seconds = Number(retryAfter);
2118
+ if (Number.isFinite(seconds) && seconds >= 0) return Math.min(seconds * 1e3, 6e4);
2119
+ const date = Date.parse(retryAfter);
2120
+ if (!Number.isNaN(date)) return Math.min(Math.max(date - Date.now(), 0), 6e4);
2121
+ }
2122
+ return backoffMs(attempt);
2123
+ }
2124
+ function backoffMs(attempt) {
2125
+ return Math.min(250 * 2 ** attempt + Math.random() * 100, 5e3);
2126
+ }
2127
+ function sleep(ms, signal) {
2128
+ return new Promise((resolve, reject) => {
2129
+ if (signal.aborted) {
2130
+ reject(signal.reason);
2131
+ return;
2132
+ }
2133
+ const onAbort = () => {
2134
+ clearTimeout(timer);
2135
+ reject(signal.reason);
2136
+ };
2137
+ const timer = setTimeout(() => {
2138
+ signal.removeEventListener("abort", onAbort);
2139
+ resolve();
2140
+ }, ms);
2141
+ signal.addEventListener("abort", onAbort, { once: true });
2142
+ });
2143
+ }
2084
2144
  function toBase64(value) {
2085
2145
  if (typeof Buffer !== "undefined") {
2086
2146
  return Buffer.from(value, "utf8").toString("base64");