diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index aa4aebf8..c3e23ae6 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: 5f3530e1b29cad621760a07269fb6df8 + docChecksum: 59d2f5c3153947aecd9df397497acc52 docVersion: "2018-02-08" - speakeasyVersion: 1.304.0 + speakeasyVersion: 1.305.0 generationVersion: 2.340.3 - releaseVersion: 2.2.10 - configChecksum: 3653f14e9e309a06c295dd874c8097c9 + releaseVersion: 2.3.0 + configChecksum: 90703ed87561cdf055b3e5323c6799d5 repoURL: https://github.com/goshippo/shippo-javascript-sdk.git installationURL: https://github.com/goshippo/shippo-javascript-sdk published: true @@ -24,6 +24,7 @@ features: hiddenGlobals: 0.1.0 includes: 2.81.1 nameOverrides: 2.81.2 + nullables: 0.1.0 responseFormat: 0.2.3 sdkHooks: 0.1.0 unions: 2.85.5 @@ -280,6 +281,8 @@ generatedFiles: - src/models/components/index.ts - src/models/operations/index.ts - docs/models/components/addresspaginatedlist.md + - docs/models/components/latitude.md + - docs/models/components/longitude.md - docs/models/components/address.md - docs/models/components/addressvalidationresults.md - docs/models/components/code.md @@ -463,6 +466,7 @@ generatedFiles: - docs/models/components/trackingstatuslocationbase.md - docs/models/components/tracksrequest.md - docs/models/components/transactionpaginatedlist.md + - docs/models/components/createdby.md - docs/models/components/transactionrate.md - docs/models/components/transaction.md - docs/models/components/transactionstatusenum.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 7704f3d9..7838607e 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true typescript: - version: 2.2.10 + version: 2.3.0 additionalDependencies: dependencies: {} devDependencies: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 3c83d9a7..145875f5 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.304.0 +speakeasyVersion: 1.305.0 sources: openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:b991e2d47c37fec4a13c48145527fce86e7267efa058be2fd52c27895dbaf427 - sourceBlobDigest: sha256:412901bee886ccd8a5e455681e12da460dfb0d437c39fba95ffed319d3d855c4 + sourceRevisionDigest: sha256:f2fd896da11bd9554c26b5a65b3191f6bc70e24e04846130d025370cbebd928f + sourceBlobDigest: sha256:11bdc0d399416614e7aa2a47a27d8c5c30ab25e57addfc7dc2c3aaab1348b15e tags: - latest - main @@ -11,8 +11,8 @@ targets: first-target: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:b991e2d47c37fec4a13c48145527fce86e7267efa058be2fd52c27895dbaf427 - sourceBlobDigest: sha256:412901bee886ccd8a5e455681e12da460dfb0d437c39fba95ffed319d3d855c4 + sourceRevisionDigest: sha256:f2fd896da11bd9554c26b5a65b3191f6bc70e24e04846130d025370cbebd928f + sourceBlobDigest: sha256:11bdc0d399416614e7aa2a47a27d8c5c30ab25e57addfc7dc2c3aaab1348b15e outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index 5e734c86..58b9b9b5 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -166,4 +166,14 @@ Based on: ### Generated - [typescript v2.2.10] . ### Releases -- [NPM v2.2.10] https://www.npmjs.com/package/shippo/v/2.2.10 - . \ No newline at end of file +- [NPM v2.2.10] https://www.npmjs.com/package/shippo/v/2.2.10 - . + +## 2024-06-12 19:28:37 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.305.0 (2.340.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v2.3.0] . +### Releases +- [NPM v2.3.0] https://www.npmjs.com/package/shippo/v/2.3.0 - . \ No newline at end of file diff --git a/docs/models/components/address.md b/docs/models/components/address.md index 28d56961..44ea883b 100644 --- a/docs/models/components/address.md +++ b/docs/models/components/address.md @@ -22,8 +22,8 @@ Address represents the address as retrieved from the database | `isResidential` | *boolean* | :heavy_minus_sign: | N/A | true | | `metadata` | *string* | :heavy_minus_sign: | A string of up to 100 characters that can be filled with any additional information you want
to attach to the object. | Customer ID 123456 | | `isComplete` | *boolean* | :heavy_minus_sign: | Complete addresses contain all required values.

Incomplete addresses have failed one or multiple
validations.
Incomplete Addresses are eligible for requesting rates but lack at least one required
value for purchasing labels. | true | -| `latitude` | *number* | :heavy_minus_sign: | Latitude of address | | -| `longitude` | *number* | :heavy_minus_sign: | Longitude of address | | +| `latitude` | *components.Latitude* | :heavy_minus_sign: | Latitude of address | | +| `longitude` | *components.Longitude* | :heavy_minus_sign: | Longitude of address | | | `objectCreated` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Date and time of Address creation. | 2014-07-09T02:19:13.174Z | | `objectId` | *string* | :heavy_minus_sign: | Unique identifier of the given Address object.
This ID is required to create a Shipment object. | d799c2679e644279b59fe661ac8fa488 | | `objectOwner` | *string* | :heavy_minus_sign: | Username of the user who created the Address object. | shippotle@shippo.com | diff --git a/docs/models/components/createdby.md b/docs/models/components/createdby.md new file mode 100644 index 00000000..4c1a3be5 --- /dev/null +++ b/docs/models/components/createdby.md @@ -0,0 +1,15 @@ +# CreatedBy + +An object with details about the user who created the Transaction (purchased the label). +A value will be returned only for Transactions that can be associated with a specific user, e.g. when a logged-in +user purchases a label via the Shippo Web application; but not for Transactions purchased e.g. via the API using a ShippoToken, +which is associated with the account but not any specific user. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | +| `firstName` | *string* | :heavy_minus_sign: | N/A | Shwan | +| `lastName` | *string* | :heavy_minus_sign: | N/A | Ippotle | +| `username` | *string* | :heavy_minus_sign: | N/A | shippotle@shippo.com | \ No newline at end of file diff --git a/docs/models/components/latitude.md b/docs/models/components/latitude.md new file mode 100644 index 00000000..968babf5 --- /dev/null +++ b/docs/models/components/latitude.md @@ -0,0 +1,2 @@ +# Latitude + diff --git a/docs/models/components/longitude.md b/docs/models/components/longitude.md new file mode 100644 index 00000000..2f1b8502 --- /dev/null +++ b/docs/models/components/longitude.md @@ -0,0 +1,2 @@ +# Longitude + diff --git a/docs/models/components/transaction.md b/docs/models/components/transaction.md index b451c74b..579271b9 100644 --- a/docs/models/components/transaction.md +++ b/docs/models/components/transaction.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `commercialInvoiceUrl` | *string* | :heavy_minus_sign: | A URL pointing to the commercial invoice as a 8.5x11 inch PDF file.
A value will only be returned if the Transactions has been processed successfully and if the shipment is international. | | +| `createdBy` | [components.CreatedBy](../../models/components/createdby.md) | :heavy_minus_sign: | N/A | | | `eta` | *string* | :heavy_minus_sign: | The estimated time of arrival according to the carrier. | | | `labelFileType` | [components.LabelFileTypeEnum](../../models/components/labelfiletypeenum.md) | :heavy_minus_sign: | Print format of the label. If empty, will use the default format set from
the Shippo dashboard. | PDF_4x6 | | `labelUrl` | *string* | :heavy_minus_sign: | A URL pointing directly to the label in the format you've set in your settings.
A value will only be returned if the Transactions has been processed successfully. | https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA | diff --git a/jsr.json b/jsr.json index c886302f..b64a22c8 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "shippo", - "version": "2.2.10", + "version": "2.3.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 95f51a19..cc08973e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "shippo", - "version": "2.2.10", + "version": "2.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shippo", - "version": "2.2.10", + "version": "2.3.0", "license": "MIT", "devDependencies": { "@types/chai": "^4.3.14", diff --git a/package.json b/package.json index ef6e7c0f..49506cb1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shippo", - "version": "2.2.10", + "version": "2.3.0", "author": "Shippo", "license": "MIT", "main": "./index.js", diff --git a/src/lib/config.ts b/src/lib/config.ts index 46f3d49c..0bf00080 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.2.10", + sdkVersion: "2.3.0", genVersion: "2.340.3", - userAgent: "speakeasy-sdk/typescript 2.2.10 2.340.3 2018-02-08 shippo", + userAgent: "speakeasy-sdk/typescript 2.3.0 2.340.3 2018-02-08 shippo", } as const; diff --git a/src/models/components/address.ts b/src/models/components/address.ts index c5c39fa4..8f480a90 100644 --- a/src/models/components/address.ts +++ b/src/models/components/address.ts @@ -6,6 +6,10 @@ import { remap as remap$ } from "../../lib/primitives"; import { AddressValidationResults, AddressValidationResults$ } from "./addressvalidationresults"; import * as z from "zod"; +export type Latitude = number | string; + +export type Longitude = number | string; + /** * Address represents the address as retrieved from the database */ @@ -110,11 +114,11 @@ export type Address = { /** * Latitude of address */ - latitude?: number | undefined; + latitude?: number | string | undefined; /** * Longitude of address */ - longitude?: number | undefined; + longitude?: number | string | undefined; /** * Date and time of Address creation. */ @@ -151,6 +155,34 @@ export type Address = { test?: boolean | undefined; }; +/** @internal */ +export namespace Latitude$ { + export const inboundSchema: z.ZodType = z.union([ + z.number(), + z.string(), + ]); + + export type Outbound = number | string; + export const outboundSchema: z.ZodType = z.union([ + z.number(), + z.string(), + ]); +} + +/** @internal */ +export namespace Longitude$ { + export const inboundSchema: z.ZodType = z.union([ + z.number(), + z.string(), + ]); + + export type Outbound = number | string; + export const outboundSchema: z.ZodType = z.union([ + z.number(), + z.string(), + ]); +} + /** @internal */ export namespace Address$ { export const inboundSchema: z.ZodType = z @@ -170,8 +202,8 @@ export namespace Address$ { is_residential: z.boolean().optional(), metadata: z.string().optional(), is_complete: z.boolean().optional(), - latitude: z.number().optional(), - longitude: z.number().optional(), + latitude: z.union([z.number(), z.string()]).optional(), + longitude: z.union([z.number(), z.string()]).optional(), object_created: z .string() .datetime({ offset: true }) @@ -216,8 +248,8 @@ export namespace Address$ { is_residential?: boolean | undefined; metadata?: string | undefined; is_complete?: boolean | undefined; - latitude?: number | undefined; - longitude?: number | undefined; + latitude?: number | string | undefined; + longitude?: number | string | undefined; object_created?: string | undefined; object_id?: string | undefined; object_owner?: string | undefined; @@ -243,8 +275,8 @@ export namespace Address$ { isResidential: z.boolean().optional(), metadata: z.string().optional(), isComplete: z.boolean().optional(), - latitude: z.number().optional(), - longitude: z.number().optional(), + latitude: z.union([z.number(), z.string()]).optional(), + longitude: z.union([z.number(), z.string()]).optional(), objectCreated: z .date() .transform((v) => v.toISOString()) diff --git a/src/models/components/transaction.ts b/src/models/components/transaction.ts index 70df4b6f..cb635392 100644 --- a/src/models/components/transaction.ts +++ b/src/models/components/transaction.ts @@ -11,6 +11,20 @@ import { TrackingStatusEnum, TrackingStatusEnum$ } from "./trackingstatusenum"; import { TransactionStatusEnum, TransactionStatusEnum$ } from "./transactionstatusenum"; import * as z from "zod"; +/** + * An object with details about the user who created the Transaction (purchased the label). + * + * @remarks + * A value will be returned only for Transactions that can be associated with a specific user, e.g. when a logged-in + * user purchases a label via the Shippo Web application; but not for Transactions purchased e.g. via the API using a ShippoToken, + * which is associated with the account but not any specific user. + */ +export type CreatedBy = { + firstName?: string | undefined; + lastName?: string | undefined; + username?: string | undefined; +}; + /** * ID of the Rate object for which a Label has to be obtained. * @@ -29,6 +43,7 @@ export type Transaction = { * A value will only be returned if the Transactions has been processed successfully and if the shipment is international. */ commercialInvoiceUrl?: string | undefined; + createdBy?: CreatedBy | null | undefined; /** * The estimated time of arrival according to the carrier. */ @@ -119,6 +134,41 @@ export type Transaction = { trackingUrlProvider?: string | undefined; }; +/** @internal */ +export namespace CreatedBy$ { + export const inboundSchema: z.ZodType = z + .object({ + first_name: z.string().optional(), + last_name: z.string().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + first_name: "firstName", + last_name: "lastName", + }); + }); + + export type Outbound = { + first_name?: string | undefined; + last_name?: string | undefined; + username?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + firstName: z.string().optional(), + lastName: z.string().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + firstName: "first_name", + lastName: "last_name", + }); + }); +} + /** @internal */ export namespace TransactionRate$ { export const inboundSchema: z.ZodType = z.union([ @@ -138,6 +188,7 @@ export namespace Transaction$ { export const inboundSchema: z.ZodType = z .object({ commercial_invoice_url: z.string().optional(), + created_by: z.nullable(z.lazy(() => CreatedBy$.inboundSchema)).optional(), eta: z.string().optional(), label_file_type: LabelFileTypeEnum$.inboundSchema.optional(), label_url: z.string().optional(), @@ -167,6 +218,7 @@ export namespace Transaction$ { .transform((v) => { return remap$(v, { commercial_invoice_url: "commercialInvoiceUrl", + created_by: "createdBy", label_file_type: "labelFileType", label_url: "labelUrl", object_created: "objectCreated", @@ -183,6 +235,7 @@ export namespace Transaction$ { export type Outbound = { commercial_invoice_url?: string | undefined; + created_by?: CreatedBy$.Outbound | null | undefined; eta?: string | undefined; label_file_type?: string | undefined; label_url?: string | undefined; @@ -205,6 +258,7 @@ export namespace Transaction$ { export const outboundSchema: z.ZodType = z .object({ commercialInvoiceUrl: z.string().optional(), + createdBy: z.nullable(z.lazy(() => CreatedBy$.outboundSchema)).optional(), eta: z.string().optional(), labelFileType: LabelFileTypeEnum$.outboundSchema.optional(), labelUrl: z.string().optional(), @@ -232,6 +286,7 @@ export namespace Transaction$ { .transform((v) => { return remap$(v, { commercialInvoiceUrl: "commercial_invoice_url", + createdBy: "created_by", labelFileType: "label_file_type", labelUrl: "label_url", objectCreated: "object_created", diff --git a/src/sdk/carrieraccounts.ts b/src/sdk/carrieraccounts.ts index 4d3edbc4..2ec48c23 100644 --- a/src/sdk/carrieraccounts.ts +++ b/src/sdk/carrieraccounts.ts @@ -72,11 +72,11 @@ export class CarrierAccounts extends ClientSDK { const path$ = this.templateURLComponent("/carrier_accounts")(); const query$ = encodeFormQuery$({ - carrier: payload$.carrier, - account_id: payload$.account_id, page: payload$.page, results: payload$.results, service_levels: payload$.service_levels, + carrier: payload$.carrier, + account_id: payload$.account_id, }); headers$.set( @@ -409,8 +409,8 @@ export class CarrierAccounts extends ClientSDK { )(pathParams$); const query$ = encodeFormQuery$({ - state: payload$.state, redirect_uri: payload$.redirect_uri, + state: payload$.state, }); headers$.set( diff --git a/src/sdk/orders.ts b/src/sdk/orders.ts index 1fec59e5..573e8433 100644 --- a/src/sdk/orders.ts +++ b/src/sdk/orders.ts @@ -71,8 +71,8 @@ export class Orders extends ClientSDK { const path$ = this.templateURLComponent("/orders")(); const query$ = encodeFormQuery$({ - results: payload$.results, page: payload$.page, + results: payload$.results, }); headers$.set( diff --git a/src/sdk/parcels.ts b/src/sdk/parcels.ts index 2f639942..584df2a3 100644 --- a/src/sdk/parcels.ts +++ b/src/sdk/parcels.ts @@ -71,8 +71,8 @@ export class Parcels extends ClientSDK { const path$ = this.templateURLComponent("/parcels")(); const query$ = encodeFormQuery$({ - results: payload$.results, page: payload$.page, + results: payload$.results, }); headers$.set( diff --git a/src/sdk/shippoaccounts.ts b/src/sdk/shippoaccounts.ts index 16bce2e9..dc6b7c38 100644 --- a/src/sdk/shippoaccounts.ts +++ b/src/sdk/shippoaccounts.ts @@ -71,8 +71,8 @@ export class ShippoAccounts extends ClientSDK { const path$ = this.templateURLComponent("/shippo-accounts")(); const query$ = encodeFormQuery$({ - page: payload$.page, results: payload$.results, + page: payload$.page, }); headers$.set( diff --git a/src/sdk/transactions.ts b/src/sdk/transactions.ts index a1f2088b..342f0c96 100644 --- a/src/sdk/transactions.ts +++ b/src/sdk/transactions.ts @@ -67,11 +67,11 @@ export class Transactions extends ClientSDK { const path$ = this.templateURLComponent("/transactions")(); const query$ = encodeFormQuery$({ + tracking_status: payload$.tracking_status, page: payload$.page, results: payload$.results, rate: payload$.rate, object_status: payload$.object_status, - tracking_status: payload$.tracking_status, }); headers$.set(