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