diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index a252aa42..897720c0 100755
--- a/.speakeasy/gen.lock
+++ b/.speakeasy/gen.lock
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 4f7e8ab5-4c00-496a-9710-e7c707e4ee78
management:
- docChecksum: 21e24cc6937caa9e711e620b7c454d02
+ docChecksum: 23a72be327507578ca959897c0ec25d9
docVersion: "2018-02-08"
- speakeasyVersion: 1.326.0
- generationVersion: 2.359.0
- releaseVersion: 2.6.0
- configChecksum: f9f3460580d552d54f32ebf43069ea2c
+ speakeasyVersion: 1.327.0
+ generationVersion: 2.359.6
+ releaseVersion: 2.6.1
+ configChecksum: 54cd46c14300d12f69e6e58c612c7b56
repoURL: https://github.com/goshippo/shippo-javascript-sdk.git
installationURL: https://github.com/goshippo/shippo-javascript-sdk
published: true
@@ -14,7 +14,7 @@ features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.5
- core: 3.11.0
+ core: 3.11.3
flattening: 2.81.1
globalSecurity: 2.82.9
globalSecurityCallbacks: 0.1.0
@@ -171,6 +171,7 @@ generatedFiles:
- src/models/components/manifestcreaterequest.ts
- src/models/components/orderpaginatedlist.ts
- src/models/components/order.ts
+ - src/models/components/ordershopappenum.ts
- src/models/components/orderstatusenum.ts
- src/models/components/ordercreaterequest.ts
- src/models/components/lineitembase.ts
@@ -444,8 +445,8 @@ generatedFiles:
- docs/models/components/manifestcreaterequestaddressfrom.md
- docs/models/components/manifestcreaterequest.md
- docs/models/components/orderpaginatedlist.md
- - docs/models/components/shopapp.md
- docs/models/components/order.md
+ - docs/models/components/ordershopappenum.md
- docs/models/components/orderstatusenum.md
- docs/models/components/ordercreaterequest.md
- docs/models/components/lineitembase.md
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index b52ced15..49afdd23 100755
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
typescript:
- version: 2.6.0
+ version: 2.6.1
additionalDependencies:
dependencies: {}
devDependencies:
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 36988088..4a0c57e3 100644
--- a/.speakeasy/workflow.lock
+++ b/.speakeasy/workflow.lock
@@ -1,9 +1,9 @@
-speakeasyVersion: 1.326.0
+speakeasyVersion: 1.327.0
sources:
openapi:
sourceNamespace: openapi
- sourceRevisionDigest: sha256:f406ac8cb06cb2b0add2e9c5bddbb8da87f8e23cba028f21593cb9f6fb372b4d
- sourceBlobDigest: sha256:84ad15f1d2a3fa7e731c1a9cefaab3414ba25b757579b7803a10c3f4a02df3ca
+ sourceRevisionDigest: sha256:c8fd96db0a5b7677259e2759dc2cf39a5f14769cb80e908a170599846263d733
+ sourceBlobDigest: sha256:1e1de117a29c1be1f402cdf662657e96ae5452ccfeaf18e3e6339afeee51f216
tags:
- latest
- main
@@ -11,8 +11,8 @@ targets:
first-target:
source: openapi
sourceNamespace: openapi
- sourceRevisionDigest: sha256:f406ac8cb06cb2b0add2e9c5bddbb8da87f8e23cba028f21593cb9f6fb372b4d
- sourceBlobDigest: sha256:84ad15f1d2a3fa7e731c1a9cefaab3414ba25b757579b7803a10c3f4a02df3ca
+ sourceRevisionDigest: sha256:c8fd96db0a5b7677259e2759dc2cf39a5f14769cb80e908a170599846263d733
+ sourceBlobDigest: sha256:1e1de117a29c1be1f402cdf662657e96ae5452ccfeaf18e3e6339afeee51f216
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
diff --git a/RELEASES.md b/RELEASES.md
index 7e0d868c..f52f6e55 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -276,4 +276,14 @@ Based on:
### Generated
- [typescript v2.6.0] .
### Releases
-- [NPM v2.6.0] https://www.npmjs.com/package/shippo/v/2.6.0 - .
\ No newline at end of file
+- [NPM v2.6.0] https://www.npmjs.com/package/shippo/v/2.6.0 - .
+
+## 2024-07-08 17:39:53
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.327.0 (2.359.6) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [typescript v2.6.1] .
+### Releases
+- [NPM v2.6.1] https://www.npmjs.com/package/shippo/v/2.6.1 - .
\ No newline at end of file
diff --git a/docs/models/components/order.md b/docs/models/components/order.md
index a92bcceb..f6f41426 100644
--- a/docs/models/components/order.md
+++ b/docs/models/components/order.md
@@ -23,5 +23,5 @@
| `lineItems` | [components.LineItem](../../models/components/lineitem.md)[] | :heavy_minus_sign: | Array of line item objects representing the items in this order.
All objects will be returned expanded by default. | |
| `objectId` | *string* | :heavy_minus_sign: | Unique identifier of the order object. | adcfdddf8ec64b84ad22772bce3ea37a |
| `objectOwner` | *string* | :heavy_minus_sign: | Username of the user who created the object. | shippotle@shippo.com |
-| `shopApp` | [components.ShopApp](../../models/components/shopapp.md) | :heavy_minus_sign: | Platform the order was created on and, if applicable, imported from.
Orders created via the Shippo API or dashboard will have the value "Shippo". | Shippo |
+| `shopApp` | [components.OrderShopAppEnum](../../models/components/ordershopappenum.md) | :heavy_minus_sign: | Platform the order was created on and, if applicable, imported from.
Orders created via the Shippo API or dashboard will have the value "Shippo". | Shippo |
| `transactions` | *string*[] | :heavy_minus_sign: | Array of transaction objects representing all shipping labels purchased for this order.
All objects are returned expanded with a limited number of fields by default. | |
\ No newline at end of file
diff --git a/docs/models/components/shopapp.md b/docs/models/components/ordershopappenum.md
similarity index 93%
rename from docs/models/components/shopapp.md
rename to docs/models/components/ordershopappenum.md
index 4977b34b..7cbcaeba 100644
--- a/docs/models/components/shopapp.md
+++ b/docs/models/components/ordershopappenum.md
@@ -1,4 +1,4 @@
-# ShopApp
+# OrderShopAppEnum
Platform the order was created on and, if applicable, imported from.
Orders created via the Shippo API or dashboard will have the value "Shippo".
@@ -20,5 +20,6 @@ Orders created via the Shippo API or dashboard will have the value "Shippo".
| `Shopify` | Shopify |
| `Spreecommerce` | Spreecommerce |
| `StripeRelay` | StripeRelay |
+| `Walmart` | Walmart |
| `Weebly` | Weebly |
| `WooCommerce` | WooCommerce |
\ No newline at end of file
diff --git a/docs/models/components/shipment.md b/docs/models/components/shipment.md
index 955c1bb7..ad7c4eb1 100644
--- a/docs/models/components/shipment.md
+++ b/docs/models/components/shipment.md
@@ -22,5 +22,5 @@ Shipment represents the parcel as retrieved from the database
| `objectUpdated` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Date and time of last Shipment update. | |
| `parcels` | [components.Parcel](../../models/components/parcel.md)[] | :heavy_check_mark: | List of Parcel objects to be shipped. | |
| `rates` | [components.Rate](../../models/components/rate.md)[] | :heavy_check_mark: | An array with all available rates. If async
has been set to false
in the request,
this will be populated with all available rates in the response. Otherwise rates will be created
asynchronously and this array will initially be empty. | |
-| `status` | [components.ShipmentStatus](../../models/components/shipmentstatus.md) | :heavy_check_mark: | `Waiting` shipments have been successfully submitted but not yet been processed.
`Queued` shipments are currently being processed.
`Success` shipments have been processed successfully, meaning that rate generation has concluded.
`Error` does not occur currently and is reserved for future use. | SUCCESS |
+| `status` | [components.ShipmentStatus](../../models/components/shipmentstatus.md) | :heavy_check_mark: | `Waiting` shipments have been successfully submitted but not yet been processed.
`Queued` shipments are currently being processed.
`Success` shipments have been processed successfully, meaning that rate generation has concluded.
`Error` does not occur currently and is reserved for future use. | QUEUED |
| `test` | *boolean* | :heavy_minus_sign: | Indicates whether the object has been created in test mode. | |
\ No newline at end of file
diff --git a/docs/models/components/shipmentstatus.md b/docs/models/components/shipmentstatus.md
index 904ebd63..2f4dc3f1 100644
--- a/docs/models/components/shipmentstatus.md
+++ b/docs/models/components/shipmentstatus.md
@@ -13,4 +13,4 @@
| `Error` | ERROR |
| `Queued` | QUEUED |
| `Success` | SUCCESS |
-| `Status` | STATUS |
\ No newline at end of file
+| `Waiting` | WAITING |
\ No newline at end of file
diff --git a/docs/models/components/transaction.md b/docs/models/components/transaction.md
index 579271b9..aac2f349 100644
--- a/docs/models/components/transaction.md
+++ b/docs/models/components/transaction.md
@@ -17,6 +17,7 @@
| `objectOwner` | *string* | :heavy_minus_sign: | Username of the user who created the Transaction object. | shippotle@shippo.com |
| `objectState` | [components.ObjectStateEnum](../../models/components/objectstateenum.md) | :heavy_minus_sign: | Indicates the validity of the enclosing object | |
| `objectUpdated` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Date and time of last Transaction update. | |
+| `parcel` | *string* | :heavy_minus_sign: | Object ID of the Parcel object that is being shipped. | e94c7fdfdc7b495dbb390a28d929d90a |
| `qrCodeUrl` | *string* | :heavy_minus_sign: | A URL pointing directly to the QR code in PNG format.
A value will only be returned if requested using qr_code_requested flag and the carrier provides such an option. | https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA |
| `rate` | *components.TransactionRate* | :heavy_minus_sign: | ID of the Rate object for which a Label has to be obtained.
If you purchase a label by calling the transaction endpoint without a rate (instalabel),
this field will be a simplified Rate object in the Transaction model returned from the POST request.
Note, only rates less than 7 days old can be purchased to ensure up-to-date pricing. | |
| `status` | [components.TransactionStatusEnum](../../models/components/transactionstatusenum.md) | :heavy_minus_sign: | Indicates the status of the Transaction. | SUCCESS |
diff --git a/docs/models/components/webhook.md b/docs/models/components/webhook.md
index 27a5bd32..4fe91ba4 100644
--- a/docs/models/components/webhook.md
+++ b/docs/models/components/webhook.md
@@ -3,13 +3,13 @@
## Fields
-| Field | Type | Required | Description |
-| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
-| `event` | *string* | :heavy_check_mark: | Type of event that triggers the webhook. |
-| `url` | *string* | :heavy_check_mark: | URL webhook events are sent to. |
-| `active` | *boolean* | :heavy_minus_sign: | Determines whether the webhook is active or not. |
-| `isTest` | *boolean* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. |
-| `objectCreated` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Timestamp of the creation of the webhook. |
-| `objectId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook. This can be used to retrieve or delete the webhook. |
-| `objectUpdated` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Timestamp of the last update of the webhook. |
-| `objectOwner` | *string* | :heavy_minus_sign: | Username of the user who created the webhook. |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
+| `event` | *string* | :heavy_check_mark: | Type of event that triggers the webhook. | track_updated |
+| `url` | *string* | :heavy_check_mark: | URL webhook events are sent to. | https://example.com/shippo-webhook |
+| `active` | *boolean* | :heavy_minus_sign: | Determines whether the webhook is active or not. | true |
+| `isTest` | *boolean* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | false |
+| `objectCreated` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Timestamp of the creation of the webhook. | |
+| `objectId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook. This can be used to retrieve or delete the webhook. | |
+| `objectUpdated` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Timestamp of the last update of the webhook. | |
+| `objectOwner` | *string* | :heavy_minus_sign: | Username of the user who created the webhook. | |
\ No newline at end of file
diff --git a/docs/models/components/webhookupdaterequest.md b/docs/models/components/webhookupdaterequest.md
index 8afa9ca3..33e7d93f 100644
--- a/docs/models/components/webhookupdaterequest.md
+++ b/docs/models/components/webhookupdaterequest.md
@@ -3,9 +3,9 @@
## Fields
-| Field | Type | Required | Description |
-| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
-| `event` | [components.WebhookEventTypeEnum](../../models/components/webhookeventtypeenum.md) | :heavy_check_mark: | Type of event that triggered the webhook. |
-| `url` | *string* | :heavy_check_mark: | URL webhook events are sent to. |
-| `active` | *boolean* | :heavy_minus_sign: | Determines whether the webhook is active or not. |
-| `isTest` | *boolean* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
+| `event` | [components.WebhookEventTypeEnum](../../models/components/webhookeventtypeenum.md) | :heavy_check_mark: | Type of event that triggered the webhook. | |
+| `url` | *string* | :heavy_check_mark: | URL webhook events are sent to. | https://example.com/shippo-webhook |
+| `active` | *boolean* | :heavy_minus_sign: | Determines whether the webhook is active or not. | true |
+| `isTest` | *boolean* | :heavy_minus_sign: | Determines whether the webhook is a test webhook or not. | false |
\ No newline at end of file
diff --git a/docs/models/operations/listordersrequest.md b/docs/models/operations/listordersrequest.md
index 8262b6e1..38c7af0d 100644
--- a/docs/models/operations/listordersrequest.md
+++ b/docs/models/operations/listordersrequest.md
@@ -3,7 +3,11 @@
## Fields
-| Field | Type | Required | Description |
-| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
-| `page` | *number* | :heavy_minus_sign: | The page number you want to select |
-| `results` | *number* | :heavy_minus_sign: | The number of results to return per page (max 100) |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `page` | *number* | :heavy_minus_sign: | The page number you want to select | |
+| `results` | *number* | :heavy_minus_sign: | The number of results to return per page (max 100) | |
+| `orderStatus` | [components.OrderStatusEnum](../../models/components/orderstatusenum.md)[] | :heavy_minus_sign: | Filter orders by order status | |
+| `shopApp` | [components.OrderShopAppEnum](../../models/components/ordershopappenum.md) | :heavy_minus_sign: | Filter orders by shop app | Shippo |
+| `startDate` | *string* | :heavy_minus_sign: | Filter orders created after the input date and time (ISO 8601 UTC format). This is based on the
`placed_at` field, meaning when the order has been placed, not when the order object was created. | |
+| `endDate` | *string* | :heavy_minus_sign: | Filter orders created before the input date and time (ISO 8601 UTC format). This is based on the
`placed_at` field, meaning when the order has been placed, not when the order object was created. | |
\ No newline at end of file
diff --git a/docs/sdks/orders/README.md b/docs/sdks/orders/README.md
index a4b8c79d..8c2ee8e6 100644
--- a/docs/sdks/orders/README.md
+++ b/docs/sdks/orders/README.md
@@ -38,7 +38,12 @@ const shippo = new Shippo({
});
async function run() {
- const result = await shippo.orders.list(1, 25);
+ const result = await shippo.orders.list({
+ orderStatus: [
+ "PAID",
+ ],
+ shopApp: "Shippo",
+ });
// Handle the result
console.log(result)
@@ -51,8 +56,7 @@ run();
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `page` | *number* | :heavy_minus_sign: | The page number you want to select |
-| `results` | *number* | :heavy_minus_sign: | The number of results to return per page (max 100) |
+| `request` | [operations.ListOrdersRequest](../../models/operations/listordersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md
index 696b4984..97927a88 100644
--- a/docs/sdks/webhooks/README.md
+++ b/docs/sdks/webhooks/README.md
@@ -35,7 +35,9 @@ const shippo = new Shippo({
async function run() {
const result = await shippo.webhooks.createWebhook({
event: "batch_created",
- url: "https://wobbly-marmalade.org",
+ url: "https://example.com/shippo-webhook",
+ active: true,
+ isTest: false,
});
// Handle the result
@@ -163,7 +165,9 @@ const shippo = new Shippo({
async function run() {
const result = await shippo.webhooks.updateWebhook("", {
event: "batch_created",
- url: "http://crooked-acknowledgment.biz",
+ url: "https://example.com/shippo-webhook",
+ active: true,
+ isTest: false,
});
// Handle the result
diff --git a/jsr.json b/jsr.json
index 9aafe033..4d213144 100644
--- a/jsr.json
+++ b/jsr.json
@@ -2,7 +2,7 @@
{
"name": "shippo",
- "version": "2.6.0",
+ "version": "2.6.1",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
diff --git a/package-lock.json b/package-lock.json
index 94858851..c6e15857 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "shippo",
- "version": "2.6.0",
+ "version": "2.6.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "shippo",
- "version": "2.6.0",
+ "version": "2.6.1",
"license": "MIT",
"devDependencies": {
"@types/chai": "^4.3.14",
diff --git a/package.json b/package.json
index 565d2093..7955df5f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "shippo",
- "version": "2.6.0",
+ "version": "2.6.1",
"author": "Shippo",
"license": "MIT",
"main": "./index.js",
diff --git a/src/lib/config.ts b/src/lib/config.ts
index e7fad70f..7d59281b 100644
--- a/src/lib/config.ts
+++ b/src/lib/config.ts
@@ -54,7 +54,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "2018-02-08",
- sdkVersion: "2.6.0",
- genVersion: "2.359.0",
- userAgent: "speakeasy-sdk/typescript 2.6.0 2.359.0 2018-02-08 shippo",
+ sdkVersion: "2.6.1",
+ genVersion: "2.359.6",
+ userAgent: "speakeasy-sdk/typescript 2.6.1 2.359.6 2018-02-08 shippo",
} as const;
diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts
index b6f45cfc..b8c0252b 100644
--- a/src/lib/sdks.ts
+++ b/src/lib/sdks.ts
@@ -7,6 +7,7 @@ import { SecurityState, resolveSecurity, resolveGlobalSecurity } from "./securit
import { pathToFunc } from "./url.js";
import { encodeForm } from "./encodings.js";
import { stringToBase64 } from "./base64.js";
+import { SDK_METADATA } from "./config.js";
import { SDKHooks } from "../hooks/hooks.js";
import { HookContext } from "../hooks/types.js";
@@ -22,8 +23,20 @@ type RequestConfig = {
body?: RequestInit["body"];
headers?: HeadersInit;
security?: SecurityState | null;
+ uaHeader?: string;
};
+const gt: unknown = typeof globalThis === "undefined" ? null : globalThis;
+const webWorkerLike =
+ typeof gt === "object" &&
+ gt != null &&
+ "importScripts" in gt &&
+ typeof gt["importScripts"] === "function";
+const isBrowserLike =
+ webWorkerLike ||
+ (typeof navigator !== "undefined" && "serviceWorker" in navigator) ||
+ typeof window === "object";
+
export class ClientSDK {
private readonly client: HTTPClient;
protected readonly baseURL: URL | null;
@@ -100,6 +113,12 @@ export class ClientSDK {
headers.set(k, v);
}
+ // Only set user agent header in non-browser-like environments since CORS
+ // policy disallows setting it in browsers e.g. Chrome throws an error.
+ if (!isBrowserLike) {
+ headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
+ }
+
const input = this.hooks$.beforeCreateRequest(context, {
url: reqURL,
options: {
diff --git a/src/models/components/index.ts b/src/models/components/index.ts
index 6c5f0d3c..ee5c0b94 100644
--- a/src/models/components/index.ts
+++ b/src/models/components/index.ts
@@ -88,6 +88,7 @@ export * from "./objectstateenum.js";
export * from "./order.js";
export * from "./ordercreaterequest.js";
export * from "./orderpaginatedlist.js";
+export * from "./ordershopappenum.js";
export * from "./orderstatusenum.js";
export * from "./parcel.js";
export * from "./parcelcreatefromtemplaterequest.js";
diff --git a/src/models/components/order.ts b/src/models/components/order.ts
index f0bb4ef4..478b2194 100644
--- a/src/models/components/order.ts
+++ b/src/models/components/order.ts
@@ -3,43 +3,13 @@
*/
import { remap as remap$ } from "../../lib/primitives.js";
-import { ClosedEnum } from "../../types/enums.js";
import { Address, Address$ } from "./address.js";
import { LineItem, LineItem$ } from "./lineitem.js";
+import { OrderShopAppEnum, OrderShopAppEnum$ } from "./ordershopappenum.js";
import { OrderStatusEnum, OrderStatusEnum$ } from "./orderstatusenum.js";
import { WeightUnitEnum, WeightUnitEnum$ } from "./weightunitenum.js";
import * as z from "zod";
-/**
- * Platform the order was created on and, if applicable, imported from.
- *
- * @remarks
- * Orders created via the Shippo API or dashboard will have the value "Shippo".
- */
-export const ShopApp = {
- Amazon: "Amazon",
- Bigcommerce: "Bigcommerce",
- CSVImport: "CSV_Import",
- EBay: "eBay",
- EPages: "ePages",
- Etsy: "Etsy",
- Godaddy: "Godaddy",
- Magento: "Magento",
- Shippo: "Shippo",
- Shopify: "Shopify",
- Spreecommerce: "Spreecommerce",
- StripeRelay: "StripeRelay",
- Weebly: "Weebly",
- WooCommerce: "WooCommerce",
-} as const;
-/**
- * Platform the order was created on and, if applicable, imported from.
- *
- * @remarks
- * Orders created via the Shippo API or dashboard will have the value "Shippo".
- */
-export type ShopApp = ClosedEnum;
-
export type Order = {
/**
* **Required if total_price is provided**
@@ -131,7 +101,7 @@ export type Order = {
* @remarks
* Orders created via the Shippo API or dashboard will have the value "Shippo".
*/
- shopApp?: ShopApp | undefined;
+ shopApp?: OrderShopAppEnum | undefined;
/**
* Array of transaction objects representing all shipping labels purchased for this order.
*
@@ -141,12 +111,6 @@ export type Order = {
transactions?: Array | undefined;
};
-/** @internal */
-export namespace ShopApp$ {
- export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(ShopApp);
- export const outboundSchema: z.ZodNativeEnum = inboundSchema;
-}
-
/** @internal */
export namespace Order$ {
export const inboundSchema: z.ZodType = z
@@ -169,7 +133,7 @@ export namespace Order$ {
line_items: z.array(LineItem$.inboundSchema).optional(),
object_id: z.string().optional(),
object_owner: z.string().optional(),
- shop_app: ShopApp$.inboundSchema.optional(),
+ shop_app: OrderShopAppEnum$.inboundSchema.optional(),
transactions: z.array(z.string()).optional(),
})
.transform((v) => {
@@ -236,7 +200,7 @@ export namespace Order$ {
lineItems: z.array(LineItem$.outboundSchema).optional(),
objectId: z.string().optional(),
objectOwner: z.string().optional(),
- shopApp: ShopApp$.outboundSchema.optional(),
+ shopApp: OrderShopAppEnum$.outboundSchema.optional(),
transactions: z.array(z.string()).optional(),
})
.transform((v) => {
diff --git a/src/models/components/ordershopappenum.ts b/src/models/components/ordershopappenum.ts
new file mode 100644
index 00000000..497b0b4b
--- /dev/null
+++ b/src/models/components/ordershopappenum.ts
@@ -0,0 +1,44 @@
+/*
+ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+ */
+
+import { ClosedEnum } from "../../types/enums.js";
+import * as z from "zod";
+
+/**
+ * Platform the order was created on and, if applicable, imported from.
+ *
+ * @remarks
+ * Orders created via the Shippo API or dashboard will have the value "Shippo".
+ */
+export const OrderShopAppEnum = {
+ Amazon: "Amazon",
+ Bigcommerce: "Bigcommerce",
+ CSVImport: "CSV_Import",
+ EBay: "eBay",
+ EPages: "ePages",
+ Etsy: "Etsy",
+ Godaddy: "Godaddy",
+ Magento: "Magento",
+ Shippo: "Shippo",
+ Shopify: "Shopify",
+ Spreecommerce: "Spreecommerce",
+ StripeRelay: "StripeRelay",
+ Walmart: "Walmart",
+ Weebly: "Weebly",
+ WooCommerce: "WooCommerce",
+} as const;
+/**
+ * Platform the order was created on and, if applicable, imported from.
+ *
+ * @remarks
+ * Orders created via the Shippo API or dashboard will have the value "Shippo".
+ */
+export type OrderShopAppEnum = ClosedEnum;
+
+/** @internal */
+export namespace OrderShopAppEnum$ {
+ export const inboundSchema: z.ZodNativeEnum =
+ z.nativeEnum(OrderShopAppEnum);
+ export const outboundSchema: z.ZodNativeEnum = inboundSchema;
+}
diff --git a/src/models/components/shipment.ts b/src/models/components/shipment.ts
index 39a44c9d..3d8b46e0 100644
--- a/src/models/components/shipment.ts
+++ b/src/models/components/shipment.ts
@@ -24,7 +24,7 @@ export const ShipmentStatus = {
Error: "ERROR",
Queued: "QUEUED",
Success: "SUCCESS",
- Status: "STATUS",
+ Waiting: "WAITING",
} as const;
/**
* `Waiting` shipments have been successfully submitted but not yet been processed.
diff --git a/src/models/components/transaction.ts b/src/models/components/transaction.ts
index 7a3ef82f..fa01e19c 100644
--- a/src/models/components/transaction.ts
+++ b/src/models/components/transaction.ts
@@ -90,6 +90,10 @@ export type Transaction = {
* Date and time of last Transaction update.
*/
objectUpdated?: Date | undefined;
+ /**
+ * Object ID of the Parcel object that is being shipped.
+ */
+ parcel?: string | undefined;
/**
* A URL pointing directly to the QR code in PNG format.
*
@@ -207,6 +211,7 @@ export namespace Transaction$ {
.datetime({ offset: true })
.transform((v) => new Date(v))
.optional(),
+ parcel: z.string().optional(),
qr_code_url: z.string().optional(),
rate: z.union([CoreRate$.inboundSchema, z.string()]).optional(),
status: TransactionStatusEnum$.inboundSchema.optional(),
@@ -246,6 +251,7 @@ export namespace Transaction$ {
object_owner?: string | undefined;
object_state?: string | undefined;
object_updated?: string | undefined;
+ parcel?: string | undefined;
qr_code_url?: string | undefined;
rate?: CoreRate$.Outbound | string | undefined;
status?: string | undefined;
@@ -275,6 +281,7 @@ export namespace Transaction$ {
.date()
.transform((v) => v.toISOString())
.optional(),
+ parcel: z.string().optional(),
qrCodeUrl: z.string().optional(),
rate: z.union([CoreRate$.outboundSchema, z.string()]).optional(),
status: TransactionStatusEnum$.outboundSchema.optional(),
diff --git a/src/models/operations/listorders.ts b/src/models/operations/listorders.ts
index 1e2a37c9..98544d7c 100644
--- a/src/models/operations/listorders.ts
+++ b/src/models/operations/listorders.ts
@@ -3,6 +3,7 @@
*/
import { remap as remap$ } from "../../lib/primitives.js";
+import * as components from "../components/index.js";
import * as z from "zod";
export type ListOrdersGlobals = {
@@ -21,6 +22,28 @@ export type ListOrdersRequest = {
* The number of results to return per page (max 100)
*/
results?: number | undefined;
+ /**
+ * Filter orders by order status
+ */
+ orderStatus?: Array | undefined;
+ /**
+ * Filter orders by shop app
+ */
+ shopApp?: components.OrderShopAppEnum | undefined;
+ /**
+ * Filter orders created after the input date and time (ISO 8601 UTC format). This is based on the
+ *
+ * @remarks
+ * `placed_at` field, meaning when the order has been placed, not when the order object was created.
+ */
+ startDate?: string | undefined;
+ /**
+ * Filter orders created before the input date and time (ISO 8601 UTC format). This is based on the
+ *
+ * @remarks
+ * `placed_at` field, meaning when the order has been placed, not when the order object was created.
+ */
+ endDate?: string | undefined;
};
/** @internal */
@@ -52,18 +75,48 @@ export namespace ListOrdersGlobals$ {
/** @internal */
export namespace ListOrdersRequest$ {
- export const inboundSchema: z.ZodType = z.object({
- page: z.number().int().default(1),
- results: z.number().int().default(25),
- });
+ export const inboundSchema: z.ZodType = z
+ .object({
+ page: z.number().int().default(1),
+ results: z.number().int().default(25),
+ "order_status[]": z.array(components.OrderStatusEnum$.inboundSchema).optional(),
+ shop_app: components.OrderShopAppEnum$.inboundSchema.optional(),
+ start_date: z.string().optional(),
+ end_date: z.string().optional(),
+ })
+ .transform((v) => {
+ return remap$(v, {
+ "order_status[]": "orderStatus",
+ shop_app: "shopApp",
+ start_date: "startDate",
+ end_date: "endDate",
+ });
+ });
export type Outbound = {
page: number;
results: number;
+ "order_status[]"?: Array | undefined;
+ shop_app?: string | undefined;
+ start_date?: string | undefined;
+ end_date?: string | undefined;
};
- export const outboundSchema: z.ZodType = z.object({
- page: z.number().int().default(1),
- results: z.number().int().default(25),
- });
+ export const outboundSchema: z.ZodType = z
+ .object({
+ page: z.number().int().default(1),
+ results: z.number().int().default(25),
+ orderStatus: z.array(components.OrderStatusEnum$.outboundSchema).optional(),
+ shopApp: components.OrderShopAppEnum$.outboundSchema.optional(),
+ startDate: z.string().optional(),
+ endDate: z.string().optional(),
+ })
+ .transform((v) => {
+ return remap$(v, {
+ orderStatus: "order_status[]",
+ shopApp: "shop_app",
+ startDate: "start_date",
+ endDate: "end_date",
+ });
+ });
}
diff --git a/src/sdk/addresses.ts b/src/sdk/addresses.ts
index 57073dd8..48e5b771 100644
--- a/src/sdk/addresses.ts
+++ b/src/sdk/addresses.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -57,9 +57,6 @@ export class Addresses extends ClientSDK {
page: page,
results: results,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -75,13 +72,14 @@ export class Addresses extends ClientSDK {
results: payload$.results,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -98,7 +96,6 @@ export class Addresses extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -112,7 +109,7 @@ export class Addresses extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.AddressPaginatedList$)
@@ -133,10 +130,6 @@ export class Addresses extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -149,13 +142,15 @@ export class Addresses extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -172,7 +167,6 @@ export class Addresses extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -186,7 +180,7 @@ export class Addresses extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Address$)
@@ -206,9 +200,6 @@ export class Addresses extends ClientSDK {
const input$: operations.GetAddressRequest = {
addressId: addressId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -227,13 +218,14 @@ export class Addresses extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -250,7 +242,6 @@ export class Addresses extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -264,7 +255,7 @@ export class Addresses extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Address$)
@@ -284,9 +275,6 @@ export class Addresses extends ClientSDK {
const input$: operations.ValidateAddressRequest = {
addressId: addressId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -305,13 +293,14 @@ export class Addresses extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -328,7 +317,6 @@ export class Addresses extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -342,7 +330,7 @@ export class Addresses extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Address$)
diff --git a/src/sdk/batches.ts b/src/sdk/batches.ts
index dc479d7c..8c6f1083 100644
--- a/src/sdk/batches.ts
+++ b/src/sdk/batches.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
import { HTTPClient } from "../lib/http.js";
import * as schemas$ from "../lib/schemas.js";
@@ -49,10 +49,6 @@ export class Batches extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -65,13 +61,15 @@ export class Batches extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -88,7 +86,6 @@ export class Batches extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -102,7 +99,7 @@ export class Batches extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Batch$)
@@ -125,9 +122,6 @@ export class Batches extends ClientSDK {
const input$: operations.GetBatchRequest = {
batchId: batchId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -146,13 +140,14 @@ export class Batches extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -169,7 +164,6 @@ export class Batches extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -183,7 +177,7 @@ export class Batches extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Batch$)
@@ -208,10 +202,6 @@ export class Batches extends ClientSDK {
batchId: batchId,
requestBody: requestBody,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -230,13 +220,15 @@ export class Batches extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -253,7 +245,6 @@ export class Batches extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -267,7 +258,7 @@ export class Batches extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Batch$)
@@ -290,9 +281,6 @@ export class Batches extends ClientSDK {
const input$: operations.PurchaseBatchRequest = {
batchId: batchId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -311,13 +299,14 @@ export class Batches extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -334,7 +323,6 @@ export class Batches extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -348,7 +336,7 @@ export class Batches extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(202, components.Batch$)
@@ -373,10 +361,6 @@ export class Batches extends ClientSDK {
batchId: batchId,
requestBody: requestBody,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -395,13 +379,15 @@ export class Batches extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -418,7 +404,6 @@ export class Batches extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -432,7 +417,7 @@ export class Batches extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Batch$)
diff --git a/src/sdk/carrieraccounts.ts b/src/sdk/carrieraccounts.ts
index a86f3b96..9434be95 100644
--- a/src/sdk/carrieraccounts.ts
+++ b/src/sdk/carrieraccounts.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -58,9 +58,6 @@ export class CarrierAccounts extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = typeof request === "undefined" ? {} : request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -79,13 +76,14 @@ export class CarrierAccounts extends ClientSDK {
service_levels: payload$.service_levels,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -102,7 +100,6 @@ export class CarrierAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -116,7 +113,7 @@ export class CarrierAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CarrierAccountPaginatedList$)
@@ -137,10 +134,6 @@ export class CarrierAccounts extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -153,13 +146,15 @@ export class CarrierAccounts extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -176,7 +171,6 @@ export class CarrierAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -190,7 +184,7 @@ export class CarrierAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.CarrierAccount$)
@@ -213,9 +207,6 @@ export class CarrierAccounts extends ClientSDK {
const input$: operations.GetCarrierAccountRequest = {
carrierAccountId: carrierAccountId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -236,13 +227,14 @@ export class CarrierAccounts extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -259,7 +251,6 @@ export class CarrierAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -273,7 +264,7 @@ export class CarrierAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CarrierAccount$)
@@ -298,10 +289,6 @@ export class CarrierAccounts extends ClientSDK {
carrierAccountId: carrierAccountId,
carrierAccountBase: carrierAccountBase,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -322,13 +309,15 @@ export class CarrierAccounts extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -345,7 +334,6 @@ export class CarrierAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -359,7 +347,7 @@ export class CarrierAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CarrierAccount$)
@@ -386,9 +374,6 @@ export class CarrierAccounts extends ClientSDK {
redirectUri: redirectUri,
state: state,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -413,13 +398,14 @@ export class CarrierAccounts extends ClientSDK {
state: payload$.state,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -436,7 +422,6 @@ export class CarrierAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "401", "404", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -450,7 +435,10 @@ export class CarrierAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, {
+ context,
+ errorCodes: ["400", "401", "404", "4XX", "5XX"],
+ });
const responseFields$ = {
HttpMeta: { Response: response, Request: request$ },
@@ -482,10 +470,6 @@ export class CarrierAccounts extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -498,13 +482,15 @@ export class CarrierAccounts extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -521,7 +507,6 @@ export class CarrierAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -535,7 +520,7 @@ export class CarrierAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.CarrierAccount$)
@@ -558,9 +543,6 @@ export class CarrierAccounts extends ClientSDK {
const input$: operations.GetCarrierRegistrationStatusRequest = {
carrier: carrier,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -576,13 +558,14 @@ export class CarrierAccounts extends ClientSDK {
carrier: payload$.carrier,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -599,7 +582,6 @@ export class CarrierAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -613,7 +595,7 @@ export class CarrierAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CarrierAccountRegistrationStatus$)
diff --git a/src/sdk/carrierparceltemplates.ts b/src/sdk/carrierparceltemplates.ts
index b1c00452..3568ae3b 100644
--- a/src/sdk/carrierparceltemplates.ts
+++ b/src/sdk/carrierparceltemplates.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeSimple as encodeSimple$,
@@ -62,9 +62,6 @@ export class CarrierParcelTemplates extends ClientSDK {
include: include,
carrier: carrier,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -80,13 +77,14 @@ export class CarrierParcelTemplates extends ClientSDK {
include: payload$.include,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -103,7 +101,6 @@ export class CarrierParcelTemplates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -117,7 +114,7 @@ export class CarrierParcelTemplates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CarrierParcelTemplateList$)
@@ -140,9 +137,6 @@ export class CarrierParcelTemplates extends ClientSDK {
const input$: operations.GetCarrierParcelTemplateRequest = {
carrierParcelTemplateToken: carrierParcelTemplateToken,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -164,13 +158,14 @@ export class CarrierParcelTemplates extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -187,7 +182,6 @@ export class CarrierParcelTemplates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -201,7 +195,7 @@ export class CarrierParcelTemplates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CarrierParcelTemplate$)
diff --git a/src/sdk/customsdeclarations.ts b/src/sdk/customsdeclarations.ts
index 7a8e2bc9..2eaf65ac 100644
--- a/src/sdk/customsdeclarations.ts
+++ b/src/sdk/customsdeclarations.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -57,9 +57,6 @@ export class CustomsDeclarations extends ClientSDK {
page: page,
results: results,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -75,13 +72,14 @@ export class CustomsDeclarations extends ClientSDK {
results: payload$.results,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -98,7 +96,6 @@ export class CustomsDeclarations extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -112,7 +109,7 @@ export class CustomsDeclarations extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CustomsDeclarationPaginatedList$)
@@ -133,10 +130,6 @@ export class CustomsDeclarations extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -149,13 +142,15 @@ export class CustomsDeclarations extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -172,7 +167,6 @@ export class CustomsDeclarations extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -186,7 +180,7 @@ export class CustomsDeclarations extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.CustomsDeclaration$)
@@ -211,9 +205,6 @@ export class CustomsDeclarations extends ClientSDK {
customsDeclarationId: customsDeclarationId,
page: page,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -237,13 +228,14 @@ export class CustomsDeclarations extends ClientSDK {
page: payload$.page,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -260,7 +252,6 @@ export class CustomsDeclarations extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -274,7 +265,7 @@ export class CustomsDeclarations extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CustomsDeclaration$)
diff --git a/src/sdk/customsitems.ts b/src/sdk/customsitems.ts
index 521cb6b8..a0d661f7 100644
--- a/src/sdk/customsitems.ts
+++ b/src/sdk/customsitems.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -57,9 +57,6 @@ export class CustomsItems extends ClientSDK {
page: page,
results: results,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -75,13 +72,14 @@ export class CustomsItems extends ClientSDK {
results: payload$.results,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -98,7 +96,6 @@ export class CustomsItems extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -112,7 +109,7 @@ export class CustomsItems extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CustomsItemPaginatedList$)
@@ -133,10 +130,6 @@ export class CustomsItems extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -149,13 +142,15 @@ export class CustomsItems extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -172,7 +167,6 @@ export class CustomsItems extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -186,7 +180,7 @@ export class CustomsItems extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.CustomsItem$)
@@ -211,9 +205,6 @@ export class CustomsItems extends ClientSDK {
customsItemId: customsItemId,
page: page,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -234,13 +225,14 @@ export class CustomsItems extends ClientSDK {
page: payload$.page,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -257,7 +249,6 @@ export class CustomsItems extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -271,7 +262,7 @@ export class CustomsItems extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.CustomsItem$)
diff --git a/src/sdk/manifests.ts b/src/sdk/manifests.ts
index 251262bd..88b6c6b0 100644
--- a/src/sdk/manifests.ts
+++ b/src/sdk/manifests.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -57,9 +57,6 @@ export class Manifests extends ClientSDK {
page: page,
results: results,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -75,13 +72,14 @@ export class Manifests extends ClientSDK {
results: payload$.results,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -98,7 +96,6 @@ export class Manifests extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -112,7 +109,7 @@ export class Manifests extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.ManifestPaginatedList$)
@@ -133,10 +130,6 @@ export class Manifests extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -149,13 +142,15 @@ export class Manifests extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -172,7 +167,6 @@ export class Manifests extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -186,7 +180,7 @@ export class Manifests extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Manifest$)
@@ -206,9 +200,6 @@ export class Manifests extends ClientSDK {
const input$: operations.GetManifestRequest = {
manifestId: manifestId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -227,13 +218,14 @@ export class Manifests extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -250,7 +242,6 @@ export class Manifests extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -264,7 +255,7 @@ export class Manifests extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Manifest$)
diff --git a/src/sdk/orders.ts b/src/sdk/orders.ts
index 7fa72605..430072ec 100644
--- a/src/sdk/orders.ts
+++ b/src/sdk/orders.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -49,17 +49,10 @@ export class Orders extends ClientSDK {
* Returns a list of all order objects.
*/
async list(
- page?: number | undefined,
- results?: number | undefined,
+ request: operations.ListOrdersRequest,
options?: RequestOptions
): Promise {
- const input$: operations.ListOrdersRequest = {
- page: page,
- results: results,
- };
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
+ const input$ = typeof request === "undefined" ? {} : request;
const payload$ = schemas$.parse(
input$,
@@ -71,17 +64,22 @@ export class Orders extends ClientSDK {
const path$ = this.templateURLComponent("/orders")();
const query$ = encodeFormQuery$({
+ end_date: payload$.end_date,
+ "order_status[]": payload$["order_status[]"],
page: payload$.page,
results: payload$.results,
+ shop_app: payload$.shop_app,
+ start_date: payload$.start_date,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -98,7 +96,6 @@ export class Orders extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -112,7 +109,7 @@ export class Orders extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.OrderPaginatedList$)
@@ -133,10 +130,6 @@ export class Orders extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -149,13 +142,15 @@ export class Orders extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -172,7 +167,6 @@ export class Orders extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -186,7 +180,7 @@ export class Orders extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Order$)
@@ -206,9 +200,6 @@ export class Orders extends ClientSDK {
const input$: operations.GetOrderRequest = {
orderId: orderId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -227,13 +218,14 @@ export class Orders extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -250,7 +242,6 @@ export class Orders extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -264,7 +255,7 @@ export class Orders extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Order$)
diff --git a/src/sdk/parcels.ts b/src/sdk/parcels.ts
index 033832ac..593b3a6a 100644
--- a/src/sdk/parcels.ts
+++ b/src/sdk/parcels.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -57,9 +57,6 @@ export class Parcels extends ClientSDK {
page: page,
results: results,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -75,13 +72,14 @@ export class Parcels extends ClientSDK {
results: payload$.results,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -98,7 +96,6 @@ export class Parcels extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -112,7 +109,7 @@ export class Parcels extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.ParcelPaginatedList$)
@@ -133,10 +130,6 @@ export class Parcels extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -149,13 +142,15 @@ export class Parcels extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -172,7 +167,6 @@ export class Parcels extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -186,7 +180,7 @@ export class Parcels extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Parcel$)
@@ -206,9 +200,6 @@ export class Parcels extends ClientSDK {
const input$: operations.GetParcelRequest = {
parcelId: parcelId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -227,13 +218,14 @@ export class Parcels extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -250,7 +242,6 @@ export class Parcels extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -264,7 +255,7 @@ export class Parcels extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Parcel$)
diff --git a/src/sdk/pickups.ts b/src/sdk/pickups.ts
index 865a7736..e1746602 100644
--- a/src/sdk/pickups.ts
+++ b/src/sdk/pickups.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
import { HTTPClient } from "../lib/http.js";
import * as schemas$ from "../lib/schemas.js";
@@ -48,10 +48,6 @@ export class Pickups extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -64,13 +60,15 @@ export class Pickups extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -87,7 +85,6 @@ export class Pickups extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -101,7 +98,7 @@ export class Pickups extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Pickup$)
diff --git a/src/sdk/rates.ts b/src/sdk/rates.ts
index 93ce73a4..05493f04 100644
--- a/src/sdk/rates.ts
+++ b/src/sdk/rates.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeSimple as encodeSimple$,
@@ -51,9 +51,6 @@ export class Rates extends ClientSDK {
const input$: operations.GetRateRequest = {
rateId: rateId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -72,13 +69,14 @@ export class Rates extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -95,7 +93,6 @@ export class Rates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -109,7 +106,7 @@ export class Rates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Rate$)
@@ -136,9 +133,6 @@ export class Rates extends ClientSDK {
page: page,
results: results,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -160,13 +154,14 @@ export class Rates extends ClientSDK {
results: payload$.results,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -183,7 +178,6 @@ export class Rates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -197,7 +191,7 @@ export class Rates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.RatePaginatedList$)
@@ -224,9 +218,6 @@ export class Rates extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -255,13 +246,14 @@ export class Rates extends ClientSDK {
results: payload$.results,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -278,7 +270,6 @@ export class Rates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -292,7 +283,7 @@ export class Rates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.RatePaginatedList$)
diff --git a/src/sdk/ratesatcheckout.ts b/src/sdk/ratesatcheckout.ts
index 3bf8d64e..688f295b 100644
--- a/src/sdk/ratesatcheckout.ts
+++ b/src/sdk/ratesatcheckout.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
import { HTTPClient } from "../lib/http.js";
import * as schemas$ from "../lib/schemas.js";
@@ -53,10 +53,6 @@ export class RatesAtCheckout extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -69,13 +65,15 @@ export class RatesAtCheckout extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -92,7 +90,6 @@ export class RatesAtCheckout extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -106,7 +103,7 @@ export class RatesAtCheckout extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.LiveRatePaginatedList$)
@@ -127,21 +124,19 @@ export class RatesAtCheckout extends ClientSDK {
): Promise {
const input$: operations.GetDefaultParcelTemplateRequest = {};
void input$; // request input is unused
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const path$ = this.templateURLComponent("/live-rates/settings/parcel-template")();
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -158,7 +153,6 @@ export class RatesAtCheckout extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -171,7 +165,7 @@ export class RatesAtCheckout extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.DefaultParcelTemplate$)
@@ -194,10 +188,6 @@ export class RatesAtCheckout extends ClientSDK {
const input$: components.DefaultParcelTemplateUpdateRequest | undefined = {
objectId: objectId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -214,13 +204,15 @@ export class RatesAtCheckout extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -237,7 +229,6 @@ export class RatesAtCheckout extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -251,7 +242,7 @@ export class RatesAtCheckout extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.DefaultParcelTemplate$)
@@ -270,21 +261,19 @@ export class RatesAtCheckout extends ClientSDK {
async deleteDefaultParcelTemplate(options?: RequestOptions): Promise {
const input$: operations.DeleteDefaultParcelTemplateRequest = {};
void input$; // request input is unused
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "*/*");
const path$ = this.templateURLComponent("/live-rates/settings/parcel-template")();
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "*/*",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -301,7 +290,6 @@ export class RatesAtCheckout extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -314,7 +302,7 @@ export class RatesAtCheckout extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.void(204, z.void())
diff --git a/src/sdk/refunds.ts b/src/sdk/refunds.ts
index 9a1ce076..3ccf2903 100644
--- a/src/sdk/refunds.ts
+++ b/src/sdk/refunds.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
import { HTTPClient } from "../lib/http.js";
import * as schemas$ from "../lib/schemas.js";
@@ -53,10 +53,6 @@ export class Refunds extends ClientSDK {
async: async,
transaction: transaction,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -69,13 +65,15 @@ export class Refunds extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -92,7 +90,6 @@ export class Refunds extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -106,7 +103,7 @@ export class Refunds extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Refund$)
@@ -125,21 +122,19 @@ export class Refunds extends ClientSDK {
async list(options?: RequestOptions): Promise {
const input$: operations.ListRefundsRequest = {};
void input$; // request input is unused
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const path$ = this.templateURLComponent("/refunds/")();
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -156,7 +151,6 @@ export class Refunds extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -169,7 +163,7 @@ export class Refunds extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.RefundPaginatedList$)
@@ -189,9 +183,6 @@ export class Refunds extends ClientSDK {
const input$: operations.GetRefundRequest = {
refundId: refundId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -210,13 +201,14 @@ export class Refunds extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -233,7 +225,6 @@ export class Refunds extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -247,7 +238,7 @@ export class Refunds extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Refund$)
diff --git a/src/sdk/servicegroups.ts b/src/sdk/servicegroups.ts
index 19e663ca..e5f2e96c 100644
--- a/src/sdk/servicegroups.ts
+++ b/src/sdk/servicegroups.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
import { HTTPClient } from "../lib/http.js";
import * as schemas$ from "../lib/schemas.js";
@@ -48,21 +48,19 @@ export class ServiceGroups extends ClientSDK {
async list(options?: RequestOptions): Promise> {
const input$: operations.ListServiceGroupsRequest = {};
void input$; // request input is unused
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const path$ = this.templateURLComponent("/service-groups")();
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -79,7 +77,6 @@ export class ServiceGroups extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -92,7 +89,7 @@ export class ServiceGroups extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher>()
.json(200, z.array(components.ServiceGroup$.inboundSchema))
@@ -113,10 +110,6 @@ export class ServiceGroups extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -129,13 +122,15 @@ export class ServiceGroups extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -152,7 +147,6 @@ export class ServiceGroups extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -166,7 +160,7 @@ export class ServiceGroups extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.ServiceGroup$)
@@ -187,10 +181,6 @@ export class ServiceGroups extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -205,13 +195,15 @@ export class ServiceGroups extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -228,7 +220,6 @@ export class ServiceGroups extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -242,7 +233,7 @@ export class ServiceGroups extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.ServiceGroup$)
@@ -262,9 +253,6 @@ export class ServiceGroups extends ClientSDK {
const input$: operations.DeleteServiceGroupRequest = {
serviceGroupId: serviceGroupId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "*/*");
const payload$ = schemas$.parse(
input$,
@@ -283,13 +271,14 @@ export class ServiceGroups extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "*/*",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -306,7 +295,6 @@ export class ServiceGroups extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -320,7 +308,7 @@ export class ServiceGroups extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.void(204, z.void())
diff --git a/src/sdk/shipments.ts b/src/sdk/shipments.ts
index 010c876f..07f042db 100644
--- a/src/sdk/shipments.ts
+++ b/src/sdk/shipments.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -70,9 +70,6 @@ export class Shipments extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = typeof request === "undefined" ? {} : request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -92,13 +89,14 @@ export class Shipments extends ClientSDK {
results: payload$.results,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -115,7 +113,6 @@ export class Shipments extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -129,7 +126,7 @@ export class Shipments extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.ShipmentPaginatedList$)
@@ -150,10 +147,6 @@ export class Shipments extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -166,13 +159,15 @@ export class Shipments extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -189,7 +184,6 @@ export class Shipments extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -203,7 +197,7 @@ export class Shipments extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Shipment$)
@@ -223,9 +217,6 @@ export class Shipments extends ClientSDK {
const input$: operations.GetShipmentRequest = {
shipmentId: shipmentId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -244,13 +235,14 @@ export class Shipments extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -267,7 +259,6 @@ export class Shipments extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -281,7 +272,7 @@ export class Shipments extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Shipment$)
diff --git a/src/sdk/shippoaccounts.ts b/src/sdk/shippoaccounts.ts
index b7a7a74c..679b470c 100644
--- a/src/sdk/shippoaccounts.ts
+++ b/src/sdk/shippoaccounts.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -57,9 +57,6 @@ export class ShippoAccounts extends ClientSDK {
page: page,
results: results,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -75,13 +72,14 @@ export class ShippoAccounts extends ClientSDK {
results: payload$.results,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -98,7 +96,6 @@ export class ShippoAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -112,7 +109,7 @@ export class ShippoAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.ShippoAccountPaginatedList$)
@@ -133,10 +130,6 @@ export class ShippoAccounts extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -149,13 +142,15 @@ export class ShippoAccounts extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -172,7 +167,6 @@ export class ShippoAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -186,7 +180,7 @@ export class ShippoAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.ShippoAccount$)
@@ -209,9 +203,6 @@ export class ShippoAccounts extends ClientSDK {
const input$: operations.GetShippoAccountRequest = {
shippoAccountId: shippoAccountId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -230,13 +221,14 @@ export class ShippoAccounts extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -253,7 +245,6 @@ export class ShippoAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -267,7 +258,7 @@ export class ShippoAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.ShippoAccount$)
@@ -292,10 +283,6 @@ export class ShippoAccounts extends ClientSDK {
shippoAccountId: shippoAccountId,
shippoAccountUpdateRequest: shippoAccountUpdateRequest,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -314,13 +301,15 @@ export class ShippoAccounts extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -337,7 +326,6 @@ export class ShippoAccounts extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -351,7 +339,7 @@ export class ShippoAccounts extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.ShippoAccount$)
diff --git a/src/sdk/trackingstatus.ts b/src/sdk/trackingstatus.ts
index 638882c9..7149944e 100644
--- a/src/sdk/trackingstatus.ts
+++ b/src/sdk/trackingstatus.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
import { HTTPClient } from "../lib/http.js";
import * as schemas$ from "../lib/schemas.js";
@@ -55,10 +55,6 @@ export class TrackingStatus extends ClientSDK {
metadata: metadata,
trackingNumber: trackingNumber,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -71,13 +67,15 @@ export class TrackingStatus extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -94,7 +92,6 @@ export class TrackingStatus extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -108,7 +105,7 @@ export class TrackingStatus extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Track$)
@@ -133,9 +130,6 @@ export class TrackingStatus extends ClientSDK {
trackingNumber: trackingNumber,
carrier: carrier,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -158,13 +152,14 @@ export class TrackingStatus extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -181,7 +176,6 @@ export class TrackingStatus extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -195,7 +189,7 @@ export class TrackingStatus extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Track$)
diff --git a/src/sdk/transactions.ts b/src/sdk/transactions.ts
index 112ee29c..51ffc1dc 100644
--- a/src/sdk/transactions.ts
+++ b/src/sdk/transactions.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import {
encodeFormQuery as encodeFormQuery$,
encodeJSON as encodeJSON$,
@@ -53,9 +53,6 @@ export class Transactions extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = typeof request === "undefined" ? {} : request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -74,13 +71,14 @@ export class Transactions extends ClientSDK {
tracking_status: payload$.tracking_status,
});
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -97,7 +95,6 @@ export class Transactions extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -111,7 +108,7 @@ export class Transactions extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.TransactionPaginatedList$)
@@ -132,10 +129,6 @@ export class Transactions extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -148,13 +141,15 @@ export class Transactions extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -171,7 +166,6 @@ export class Transactions extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -185,7 +179,7 @@ export class Transactions extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Transaction$)
@@ -205,9 +199,6 @@ export class Transactions extends ClientSDK {
const input$: operations.GetTransactionRequest = {
transactionId: transactionId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -226,13 +217,14 @@ export class Transactions extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -249,7 +241,6 @@ export class Transactions extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -263,7 +254,7 @@ export class Transactions extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Transaction$)
diff --git a/src/sdk/userparceltemplates.ts b/src/sdk/userparceltemplates.ts
index fa0a7981..8af953ef 100644
--- a/src/sdk/userparceltemplates.ts
+++ b/src/sdk/userparceltemplates.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
import { HTTPClient } from "../lib/http.js";
import * as schemas$ from "../lib/schemas.js";
@@ -48,21 +48,19 @@ export class UserParcelTemplates extends ClientSDK {
async list(options?: RequestOptions): Promise {
const input$: operations.ListUserParcelTemplatesRequest = {};
void input$; // request input is unused
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const path$ = this.templateURLComponent("/user-parcel-templates")();
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -79,7 +77,6 @@ export class UserParcelTemplates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -92,7 +89,7 @@ export class UserParcelTemplates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.UserParcelTemplateList$)
@@ -119,10 +116,6 @@ export class UserParcelTemplates extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -135,13 +128,15 @@ export class UserParcelTemplates extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -158,7 +153,6 @@ export class UserParcelTemplates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -172,7 +166,7 @@ export class UserParcelTemplates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.UserParcelTemplate$)
@@ -192,9 +186,6 @@ export class UserParcelTemplates extends ClientSDK {
const input$: operations.DeleteUserParcelTemplateRequest = {
userParcelTemplateObjectId: userParcelTemplateObjectId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "*/*");
const payload$ = schemas$.parse(
input$,
@@ -216,13 +207,14 @@ export class UserParcelTemplates extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "*/*",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -239,7 +231,6 @@ export class UserParcelTemplates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -253,7 +244,7 @@ export class UserParcelTemplates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.void(204, z.void())
@@ -277,9 +268,6 @@ export class UserParcelTemplates extends ClientSDK {
const input$: operations.GetUserParcelTemplateRequest = {
userParcelTemplateObjectId: userParcelTemplateObjectId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -301,13 +289,14 @@ export class UserParcelTemplates extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -324,7 +313,6 @@ export class UserParcelTemplates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -338,7 +326,7 @@ export class UserParcelTemplates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.UserParcelTemplate$)
@@ -363,10 +351,6 @@ export class UserParcelTemplates extends ClientSDK {
userParcelTemplateObjectId: userParcelTemplateObjectId,
userParcelTemplateUpdateRequest: userParcelTemplateUpdateRequest,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -390,13 +374,15 @@ export class UserParcelTemplates extends ClientSDK {
const query$ = "";
- headers$.set(
- "SHIPPO-API-VERSION",
- encodeSimple$("SHIPPO-API-VERSION", this.options$.shippoApiVersion, {
- explode: false,
- charEncoding: "none",
- })
- );
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "SHIPPO-API-VERSION": encodeSimple$(
+ "SHIPPO-API-VERSION",
+ this.options$.shippoApiVersion,
+ { explode: false, charEncoding: "none" }
+ ),
+ });
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
@@ -413,7 +399,6 @@ export class UserParcelTemplates extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -427,7 +412,7 @@ export class UserParcelTemplates extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.UserParcelTemplate$)
diff --git a/src/sdk/webhooks.ts b/src/sdk/webhooks.ts
index 89740422..8ec5433f 100644
--- a/src/sdk/webhooks.ts
+++ b/src/sdk/webhooks.ts
@@ -3,7 +3,7 @@
*/
import { SDKHooks } from "../hooks/hooks.js";
-import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
+import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
import { HTTPClient } from "../lib/http.js";
import * as schemas$ from "../lib/schemas.js";
@@ -50,10 +50,6 @@ export class Webhooks extends ClientSDK {
options?: RequestOptions
): Promise {
const input$ = request;
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -66,6 +62,11 @@ export class Webhooks extends ClientSDK {
const query$ = "";
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ });
+
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
security$ = { apiKeyHeader: await this.options$.apiKeyHeader() };
@@ -81,7 +82,6 @@ export class Webhooks extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -95,7 +95,7 @@ export class Webhooks extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["4XX", "5XX"] });
const [result$] = await this.matcher()
.json(201, components.Webhook$)
@@ -112,14 +112,14 @@ export class Webhooks extends ClientSDK {
* Returns a list of all webhooks you have created.
*/
async listWebhooks(options?: RequestOptions): Promise {
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
-
const path$ = this.templateURLComponent("/webhooks")();
const query$ = "";
+ const headers$ = new Headers({
+ Accept: "application/json",
+ });
+
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
security$ = { apiKeyHeader: await this.options$.apiKeyHeader() };
@@ -135,7 +135,6 @@ export class Webhooks extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -148,7 +147,7 @@ export class Webhooks extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.WebhookPaginatedList$)
@@ -168,9 +167,6 @@ export class Webhooks extends ClientSDK {
const input$: operations.GetWebhookRequest = {
webhookId: webhookId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -189,6 +185,10 @@ export class Webhooks extends ClientSDK {
const query$ = "";
+ const headers$ = new Headers({
+ Accept: "application/json",
+ });
+
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
security$ = { apiKeyHeader: await this.options$.apiKeyHeader() };
@@ -204,7 +204,6 @@ export class Webhooks extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -218,7 +217,7 @@ export class Webhooks extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Webhook$)
@@ -243,10 +242,6 @@ export class Webhooks extends ClientSDK {
webhookId: webhookId,
webhookUpdateRequest: webhookUpdateRequest,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Content-Type", "application/json");
- headers$.set("Accept", "application/json");
const payload$ = schemas$.parse(
input$,
@@ -265,6 +260,11 @@ export class Webhooks extends ClientSDK {
const query$ = "";
+ const headers$ = new Headers({
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ });
+
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
security$ = { apiKeyHeader: await this.options$.apiKeyHeader() };
@@ -280,7 +280,6 @@ export class Webhooks extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -294,7 +293,7 @@ export class Webhooks extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["4XX", "5XX"] });
const [result$] = await this.matcher()
.json(200, components.Webhook$)
@@ -314,9 +313,6 @@ export class Webhooks extends ClientSDK {
const input$: operations.DeleteWebhookRequest = {
webhookId: webhookId,
};
- const headers$ = new Headers();
- headers$.set("user-agent", SDK_METADATA.userAgent);
- headers$.set("Accept", "*/*");
const payload$ = schemas$.parse(
input$,
@@ -335,6 +331,10 @@ export class Webhooks extends ClientSDK {
const query$ = "";
+ const headers$ = new Headers({
+ Accept: "*/*",
+ });
+
let security$;
if (typeof this.options$.apiKeyHeader === "function") {
security$ = { apiKeyHeader: await this.options$.apiKeyHeader() };
@@ -350,7 +350,6 @@ export class Webhooks extends ClientSDK {
};
const securitySettings$ = this.resolveGlobalSecurity(security$);
- const doOptions = { context, errorCodes: ["4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{
@@ -364,7 +363,7 @@ export class Webhooks extends ClientSDK {
options
);
- const response = await this.do$(request$, doOptions);
+ const response = await this.do$(request$, { context, errorCodes: ["4XX", "5XX"] });
const [result$] = await this.matcher()
.void(204, z.void())