diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b857fb4..04fcea7 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 7a2c976b-8158-4d12-8b59-c491e9e10cfd management: - docChecksum: 9fbd6321083c0c2d44365ff84b8e2cb8 + docChecksum: 7b0a21df5c4526c3e13357d16d9397df docVersion: 1.0.0 - speakeasyVersion: 1.453.8 + speakeasyVersion: 1.453.10 generationVersion: 2.474.15 - releaseVersion: 0.14.34 - configChecksum: 653799ef0753f5cf472e8709d9b76716 + releaseVersion: 0.14.35 + configChecksum: cbc6aa60beca585043a7651b972b9db3 repoURL: https://github.com/ding-live/ding-typescript.git repoSubDirectory: . installationURL: https://github.com/ding-live/ding-typescript @@ -73,6 +73,7 @@ generatedFiles: - docs/models/errors/errorresponse.md - docs/models/operations/getauthenticationstatusrequest.md - docs/models/operations/lookuprequest.md + - docs/models/operations/type.md - docs/sdks/ding/README.md - docs/sdks/lookup/README.md - docs/sdks/otp/README.md @@ -185,6 +186,7 @@ examples: parameters: path: phone_number: "" + query: {} header: customer-uuid: "6e93aa15-9177-4d09-8395-b69ce50db1c8" responses: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 51492d5..b7f66f7 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.453.8 +speakeasyVersion: 1.453.10 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:43cbb041df8ded714db89cfafd4cb5f70950ed3047d5bb8fa973edc5f93e9630 - sourceBlobDigest: sha256:4d3dd890b21d2c069d944869e00ea2505c58a172c1b06fa3cb7b59c56c21a500 + sourceRevisionDigest: sha256:19049754db9673ddbc40b82ab5ee9890d164f9dfcb8fac0c4f97a1bfd31f6771 + sourceBlobDigest: sha256:1bc8346f862d17395d3ec227c51c74504f59eabaf83eb40c2932c517c8a40bf8 tags: - latest - - speakeasy-sdk-regen-1733789053 + - speakeasy-sdk-regen-1733875425 - 1.0.0 targets: '@ding-live/ding': source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:43cbb041df8ded714db89cfafd4cb5f70950ed3047d5bb8fa973edc5f93e9630 - sourceBlobDigest: sha256:4d3dd890b21d2c069d944869e00ea2505c58a172c1b06fa3cb7b59c56c21a500 + sourceRevisionDigest: sha256:19049754db9673ddbc40b82ab5ee9890d164f9dfcb8fac0c4f97a1bfd31f6771 + sourceBlobDigest: sha256:1bc8346f862d17395d3ec227c51c74504f59eabaf83eb40c2932c517c8a40bf8 codeSamplesNamespace: my-source-typescript-code-samples - codeSamplesRevisionDigest: sha256:a29e9ab5cac38def3fc5d9ed98d4bf9cbf3d2c80d5e76115eaaa432f1e4cfa82 + codeSamplesRevisionDigest: sha256:1f8ea72effcc48423702fbee4e1d6d0d0766f111ca22c324dea5c442533aa3d4 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index 08a3946..f9416e4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -946,4 +946,14 @@ Based on: ### Generated - [typescript v0.14.34] . ### Releases -- [NPM v0.14.34] https://www.npmjs.com/package/@ding-live/ding/v/0.14.34 - . \ No newline at end of file +- [NPM v0.14.34] https://www.npmjs.com/package/@ding-live/ding/v/0.14.34 - . + +## 2024-12-11 00:03:42 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.453.10 (2.474.15) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.14.35] . +### Releases +- [NPM v0.14.35] https://www.npmjs.com/package/@ding-live/ding/v/0.14.35 - . \ No newline at end of file diff --git a/docs/models/components/lookupresponse.md b/docs/models/components/lookupresponse.md index 539e75a..3d49982 100644 --- a/docs/models/components/lookupresponse.md +++ b/docs/models/components/lookupresponse.md @@ -19,6 +19,7 @@ let value: LookupResponse = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `callerName` | *string* | :heavy_minus_sign: | The CNAM (Caller ID Name) associated with the phone number. Contact us if you need to use this functionality. Once enabled, put `cnam` option to `type` query parameter. | | | `carrier` | *string* | :heavy_minus_sign: | The carrier of the phone number. | AT&T | | `countryCode` | *string* | :heavy_minus_sign: | The ISO 3166-1 alpha-2 country code of the phone number. | US | | `lineType` | [components.LineType](../../models/components/linetype.md) | :heavy_minus_sign: | The type of phone line.
* `CallingCards` - Numbers that are associated with providers of pre-paid domestic and international calling cards.
* `FixedLine` - Landline phone numbers.
* `InternetServiceProvider` - Numbers reserved for ISPs.
* `LocalRate` - Numbers that can be assigned non-geographically.
* `Mobile` - Mobile phone numbers.
* `Other` - Other types of services.
* `Pager` - Number ranges specifically allocated to paging devices.
* `PayPhone` - Allocated numbers for payphone kiosks in some countries.
* `PremiumRate` - Landline numbers where the calling party pays more than standard.
* `Satellite` - Satellite phone numbers.
* `Service` - Automated applications.
* `SharedCost` - Specific landline ranges where the cost of making the call is shared between the calling and called party.
* `ShortCodesCommercial` - Short codes are memorable, easy-to-use numbers, like the UK's NHS 111, often sold to businesses. Not available in all countries.
* `TollFree` - Number where the called party pays for the cost of the call not the calling party.
* `UniversalAccess` - Number ranges reserved for Universal Access initiatives.
* `Unknown` - Unknown phone number type.
* `VPN` - Numbers are used exclusively within a private telecommunications network, connecting the operator's terminals internally and not accessible via the public telephone network.
* `VoiceMail` - A specific category of Interactive Voice Response (IVR) services.
* `Voip` - Specific ranges for providers of VoIP services to allow incoming calls from the regular telephony network.
| Mobile | diff --git a/docs/models/operations/lookuprequest.md b/docs/models/operations/lookuprequest.md index a960027..68c8a4b 100644 --- a/docs/models/operations/lookuprequest.md +++ b/docs/models/operations/lookuprequest.md @@ -13,7 +13,8 @@ let value: LookupRequest = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `customerUuid` | *string* | :heavy_check_mark: | N/A | -| `phoneNumber` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `customerUuid` | *string* | :heavy_check_mark: | N/A | +| `phoneNumber` | *string* | :heavy_check_mark: | N/A | +| `type` | [operations.Type](../../models/operations/type.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/type.md b/docs/models/operations/type.md new file mode 100644 index 0000000..e1277ed --- /dev/null +++ b/docs/models/operations/type.md @@ -0,0 +1,15 @@ +# Type + +## Example Usage + +```typescript +import { Type } from "@ding-live/ding/models/operations"; + +let value: Type = "cnam"; +``` + +## Values + +```typescript +"cnam" +``` \ No newline at end of file diff --git a/docs/sdks/lookup/README.md b/docs/sdks/lookup/README.md index bad0e0b..c609a1b 100644 --- a/docs/sdks/lookup/README.md +++ b/docs/sdks/lookup/README.md @@ -68,6 +68,7 @@ run(); | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `customerUuid` | *string* | :heavy_check_mark: | N/A | | `phoneNumber` | *string* | :heavy_check_mark: | N/A | +| `type` | [operations.Type](../../models/operations/type.md)[] | :heavy_minus_sign: | N/A | | `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. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | diff --git a/gen.yaml b/gen.yaml index 866a70d..7a10653 100644 --- a/gen.yaml +++ b/gen.yaml @@ -11,7 +11,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false typescript: - version: 0.14.34 + version: 0.14.35 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/jsr.json b/jsr.json index 088c5c6..5a36f8c 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@ding-live/ding", - "version": "0.14.34", + "version": "0.14.35", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 3b2aa6f..badcdd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ding-live/ding", - "version": "0.14.34", + "version": "0.14.35", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@ding-live/ding", - "version": "0.14.34", + "version": "0.14.35", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index 2762b1d..b4acb49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ding-live/ding", - "version": "0.14.34", + "version": "0.14.35", "author": "Ding", "main": "./index.js", "sideEffects": false, diff --git a/src/funcs/lookupLookup.ts b/src/funcs/lookupLookup.ts index d1547ce..bfd4730 100644 --- a/src/funcs/lookupLookup.ts +++ b/src/funcs/lookupLookup.ts @@ -3,7 +3,7 @@ */ import { DingCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; import * as M from "../lib/matchers.js"; import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; @@ -30,6 +30,7 @@ export async function lookupLookup( client: DingCore, customerUuid: string, phoneNumber: string, + type?: Array | undefined, options?: RequestOptions, ): Promise< Result< @@ -47,6 +48,7 @@ export async function lookupLookup( const input: operations.LookupRequest = { customerUuid: customerUuid, phoneNumber: phoneNumber, + type: type, }; const parsed = safeParse( @@ -69,6 +71,10 @@ export async function lookupLookup( const path = pathToFunc("/lookup/{phone_number}")(pathParams); + const query = encodeFormQuery({ + "type": payload.type, + }); + const headers = new Headers({ Accept: "application/json", "customer-uuid": encodeSimple("customer-uuid", payload["customer-uuid"], { @@ -99,6 +105,7 @@ export async function lookupLookup( method: "GET", path: path, headers: headers, + query: query, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); diff --git a/src/lib/config.ts b/src/lib/config.ts index 574d8fe..a716489 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -57,7 +57,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.14.34", + sdkVersion: "0.14.35", genVersion: "2.474.15", - userAgent: "speakeasy-sdk/typescript 0.14.34 2.474.15 1.0.0 @ding-live/ding", + userAgent: "speakeasy-sdk/typescript 0.14.35 2.474.15 1.0.0 @ding-live/ding", } as const; diff --git a/src/models/components/lookupresponse.ts b/src/models/components/lookupresponse.ts index 5b6be52..08939bb 100644 --- a/src/models/components/lookupresponse.ts +++ b/src/models/components/lookupresponse.ts @@ -81,6 +81,10 @@ export const LineType = { export type LineType = ClosedEnum; export type LookupResponse = { + /** + * The CNAM (Caller ID Name) associated with the phone number. Contact us if you need to use this functionality. Once enabled, put `cnam` option to `type` query parameter. + */ + callerName?: string | undefined; /** * The carrier of the phone number. */ @@ -161,6 +165,7 @@ export const LookupResponse$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ + caller_name: z.string().optional(), carrier: z.string().optional(), country_code: z.string().optional(), line_type: LineType$inboundSchema.optional(), @@ -171,6 +176,7 @@ export const LookupResponse$inboundSchema: z.ZodType< temporary_phone_number: z.boolean().optional(), }).transform((v) => { return remap$(v, { + "caller_name": "callerName", "country_code": "countryCode", "line_type": "lineType", "number_ported": "numberPorted", @@ -181,6 +187,7 @@ export const LookupResponse$inboundSchema: z.ZodType< /** @internal */ export type LookupResponse$Outbound = { + caller_name?: string | undefined; carrier?: string | undefined; country_code?: string | undefined; line_type?: string | undefined; @@ -197,6 +204,7 @@ export const LookupResponse$outboundSchema: z.ZodType< z.ZodTypeDef, LookupResponse > = z.object({ + callerName: z.string().optional(), carrier: z.string().optional(), countryCode: z.string().optional(), lineType: LineType$outboundSchema.optional(), @@ -207,6 +215,7 @@ export const LookupResponse$outboundSchema: z.ZodType< temporaryPhoneNumber: z.boolean().optional(), }).transform((v) => { return remap$(v, { + callerName: "caller_name", countryCode: "country_code", lineType: "line_type", numberPorted: "number_ported", diff --git a/src/models/operations/lookup.ts b/src/models/operations/lookup.ts index 87a43d1..43f15a6 100644 --- a/src/models/operations/lookup.ts +++ b/src/models/operations/lookup.ts @@ -5,14 +5,41 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +export const Type = { + Cnam: "cnam", +} as const; +export type Type = ClosedEnum; + export type LookupRequest = { customerUuid: string; phoneNumber: string; + type?: Array | undefined; }; +/** @internal */ +export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum( + Type, +); + +/** @internal */ +export const Type$outboundSchema: z.ZodNativeEnum = + Type$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Type$ { + /** @deprecated use `Type$inboundSchema` instead. */ + export const inboundSchema = Type$inboundSchema; + /** @deprecated use `Type$outboundSchema` instead. */ + export const outboundSchema = Type$outboundSchema; +} + /** @internal */ export const LookupRequest$inboundSchema: z.ZodType< LookupRequest, @@ -21,6 +48,7 @@ export const LookupRequest$inboundSchema: z.ZodType< > = z.object({ "customer-uuid": z.string(), phone_number: z.string(), + type: z.array(Type$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "customer-uuid": "customerUuid", @@ -32,6 +60,7 @@ export const LookupRequest$inboundSchema: z.ZodType< export type LookupRequest$Outbound = { "customer-uuid": string; phone_number: string; + type?: Array | undefined; }; /** @internal */ @@ -42,6 +71,7 @@ export const LookupRequest$outboundSchema: z.ZodType< > = z.object({ customerUuid: z.string(), phoneNumber: z.string(), + type: z.array(Type$outboundSchema).optional(), }).transform((v) => { return remap$(v, { customerUuid: "customer-uuid", diff --git a/src/sdk/lookup.ts b/src/sdk/lookup.ts index 5a7db01..78ad7b6 100644 --- a/src/sdk/lookup.ts +++ b/src/sdk/lookup.ts @@ -5,6 +5,7 @@ import { lookupLookup } from "../funcs/lookupLookup.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Lookup extends ClientSDK { @@ -14,12 +15,14 @@ export class Lookup extends ClientSDK { async lookup( customerUuid: string, phoneNumber: string, + type?: Array | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(lookupLookup( this, customerUuid, phoneNumber, + type, options, )); }