diff --git a/CHANGELOG.md b/CHANGELOG.md index 301c10f..b63bd27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm None + + +## [4.1.2] - 2025-06-30 + +### Changed + +- Change all model constructors to check for user provided values and assign the values accordingly + ## [4.1.1] - 2025-02-18 diff --git a/README.md b/README.md index cfc632c..1ca4718 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-g ## Installing ```sh -npm install @freeclimb/sdk@4.1.1 +npm install @freeclimb/sdk@4.1.2 or -yarn add @freeclimb/sdk@4.1.1 +yarn add @freeclimb/sdk@4.1.2 ``` ## Getting Started diff --git a/__tests__/models/AccountRequest.spec.ts b/__tests__/models/AccountRequest.spec.ts index 68de954..c2cab4f 100644 --- a/__tests__/models/AccountRequest.spec.ts +++ b/__tests__/models/AccountRequest.spec.ts @@ -2,25 +2,76 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AccountRequest", () => { - let model: freeclimb.AccountRequest = new freeclimb.AccountRequest({ - alias: "test_alias", - label: "test_label", - }); - describe("AccountRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.AccountRequest); + describe("Test with truthy values", () => { + const Klass = freeclimb.AccountRequest; + let model: freeclimb.AccountRequest = new freeclimb.AccountRequest({ + alias: "test_alias", + label: "test_label", + }); + describe("AccountRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AccountRequest); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); + }); + describe(".label", () => { + it("resolves to particular value on initialization", () => { + const value = "test_label"; + expect(model.label).toBe(value); + }); }); }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.AccountRequest; + let model: freeclimb.AccountRequest = new freeclimb.AccountRequest({ + alias: "", + label: "", + }); + describe("AccountRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AccountRequest); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".label", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.label).toBe(value); + }); }); }); - describe(".label", () => { - it("resolves to particular value on initialization", () => { - const value = "test_label"; - expect(model.label).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.AccountRequest; + let constructorArguments = {}; + let model: freeclimb.AccountRequest = new freeclimb.AccountRequest( + constructorArguments, + ); + + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#label", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "label", + )?.defaultValue; + expect(model.label).toBe(value); + }); }); }); }); diff --git a/__tests__/models/AccountResult.spec.ts b/__tests__/models/AccountResult.spec.ts index 5bed6bc..c63e0a0 100644 --- a/__tests__/models/AccountResult.spec.ts +++ b/__tests__/models/AccountResult.spec.ts @@ -2,91 +2,253 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AccountResult", () => { - let model: freeclimb.AccountResult = new freeclimb.AccountResult({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - accountId: "test_accountId", - apiKey: "test_apiKey", - alias: "test_alias", - label: "test_label", + describe("Test with truthy values", () => { + const Klass = freeclimb.AccountResult; + let model: freeclimb.AccountResult = new freeclimb.AccountResult({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + accountId: "test_accountId", + apiKey: "test_apiKey", + alias: "test_alias", + label: "test_label", - type: freeclimb.AccountType.TRIAL, + type: freeclimb.AccountType.TRIAL, - status: freeclimb.AccountStatus.CLOSED, - subresourceUris: {}, - }); - describe("AccountResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.AccountResult); + status: freeclimb.AccountStatus.CLOSED, + subresourceUris: {}, }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("AccountResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AccountResult); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".apiKey", () => { - it("resolves to particular value on initialization", () => { - const value = "test_apiKey"; - expect(model.apiKey).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe(".apiKey", () => { + it("resolves to particular value on initialization", () => { + const value = "test_apiKey"; + expect(model.apiKey).toBe(value); + }); }); - }); - describe(".label", () => { - it("resolves to particular value on initialization", () => { - const value = "test_label"; - expect(model.label).toBe(value); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); }); - }); - describe(".type", () => { - it("resolves to particular value on initialization", () => { - const value = "trial"; - expect(model.type).toBe(value); + describe(".label", () => { + it("resolves to particular value on initialization", () => { + const value = "test_label"; + expect(model.label).toBe(value); + }); + }); + describe(".type", () => { + it("resolves to particular value on initialization", () => { + const value = "trial"; + expect(model.type).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "closed"; + expect(model.status).toBe(value); + }); + }); + describe(".subresourceUris", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); + }); }); }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "closed"; - expect(model.status).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.AccountResult; + let model: freeclimb.AccountResult = new freeclimb.AccountResult({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + accountId: "", + apiKey: "", + alias: "", + label: "", + + type: freeclimb.AccountType.TRIAL, + + status: freeclimb.AccountStatus.CLOSED, + subresourceUris: {}, + }); + describe("AccountResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AccountResult); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".apiKey", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.apiKey).toBe(value); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".label", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.label).toBe(value); + }); + }); + describe(".type", () => { + it("resolves to particular value on initialization", () => { + const value = "trial"; + expect(model.type).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "closed"; + expect(model.status).toBe(value); + }); + }); + describe(".subresourceUris", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); + }); }); }); - describe(".subresourceUris", () => { - it("resolves to particular value on initialization", () => { - const value = {}; - const receivedValue: any = model.subresourceUris; - expect(receivedValue).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.AccountResult; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.AccountResult = new freeclimb.AccountResult( + constructorArguments, + ); + + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#apiKey", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "apiKey", + )?.defaultValue; + expect(model.apiKey).toBe(value); + }); + }); + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#label", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "label", + )?.defaultValue; + expect(model.label).toBe(value); + }); + }); + describe("#type", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "type", + )?.defaultValue; + expect(model.type).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#subresourceUris", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subresourceUris", + )?.defaultValue; + expect(model.subresourceUris).toBe(value); + }); }); }); }); diff --git a/__tests__/models/AccountStatus.spec.ts b/__tests__/models/AccountStatus.spec.ts index d17e15f..415745b 100644 --- a/__tests__/models/AccountStatus.spec.ts +++ b/__tests__/models/AccountStatus.spec.ts @@ -2,19 +2,21 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AccountStatus", () => { - describe(".CLOSED", () => { - it("resolves to correct value for CLOSED enum property", () => { - expect(freeclimb.AccountStatus.CLOSED).toBe("closed"); + describe("Test with truthy values", () => { + describe(".CLOSED", () => { + it("resolves to correct value for CLOSED enum property", () => { + expect(freeclimb.AccountStatus.CLOSED).toBe("closed"); + }); }); - }); - describe(".SUSPENDED", () => { - it("resolves to correct value for SUSPENDED enum property", () => { - expect(freeclimb.AccountStatus.SUSPENDED).toBe("suspended"); + describe(".SUSPENDED", () => { + it("resolves to correct value for SUSPENDED enum property", () => { + expect(freeclimb.AccountStatus.SUSPENDED).toBe("suspended"); + }); }); - }); - describe(".ACTIVE", () => { - it("resolves to correct value for ACTIVE enum property", () => { - expect(freeclimb.AccountStatus.ACTIVE).toBe("active"); + describe(".ACTIVE", () => { + it("resolves to correct value for ACTIVE enum property", () => { + expect(freeclimb.AccountStatus.ACTIVE).toBe("active"); + }); }); }); }); diff --git a/__tests__/models/AccountType.spec.ts b/__tests__/models/AccountType.spec.ts index e9cc4da..ae26d14 100644 --- a/__tests__/models/AccountType.spec.ts +++ b/__tests__/models/AccountType.spec.ts @@ -2,14 +2,16 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AccountType", () => { - describe(".TRIAL", () => { - it("resolves to correct value for TRIAL enum property", () => { - expect(freeclimb.AccountType.TRIAL).toBe("trial"); + describe("Test with truthy values", () => { + describe(".TRIAL", () => { + it("resolves to correct value for TRIAL enum property", () => { + expect(freeclimb.AccountType.TRIAL).toBe("trial"); + }); }); - }); - describe(".FULL", () => { - it("resolves to correct value for FULL enum property", () => { - expect(freeclimb.AccountType.FULL).toBe("full"); + describe(".FULL", () => { + it("resolves to correct value for FULL enum property", () => { + expect(freeclimb.AccountType.FULL).toBe("full"); + }); }); }); }); diff --git a/__tests__/models/AddToConference.spec.ts b/__tests__/models/AddToConference.spec.ts index f523510..8ba1c98 100644 --- a/__tests__/models/AddToConference.spec.ts +++ b/__tests__/models/AddToConference.spec.ts @@ -2,82 +2,253 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AddToConference", () => { - let model: freeclimb.AddToConference = new freeclimb.AddToConference({ - allowCallControl: true, - callControlSequence: "test_callControlSequence", - callControlUrl: "https://123.abc", - conferenceId: "test_conferenceId", - leaveConferenceUrl: "https://123.abc", - listen: true, - notificationUrl: "https://123.abc", - startConfOnEnter: true, - talk: true, - dtmfPassThrough: true, - }); - describe("AddToConference class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.AddToConference); + describe("Test with truthy values", () => { + const Klass = freeclimb.AddToConference; + let model: freeclimb.AddToConference = new freeclimb.AddToConference({ + allowCallControl: true, + callControlSequence: "test_callControlSequence", + callControlUrl: "https://123.abc", + conferenceId: "test_conferenceId", + leaveConferenceUrl: "https://123.abc", + listen: true, + notificationUrl: "https://123.abc", + startConfOnEnter: true, + talk: true, + dtmfPassThrough: true, + }); + describe("AddToConference class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AddToConference); + }); }); - }); - describe(".allowCallControl", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.allowCallControl).toBe(value); + describe(".allowCallControl", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.allowCallControl).toBe(value); + }); }); - }); - describe(".callControlSequence", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callControlSequence"; - expect(model.callControlSequence).toBe(value); + describe(".callControlSequence", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callControlSequence"; + expect(model.callControlSequence).toBe(value); + }); }); - }); - describe(".callControlUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.callControlUrl).toBe(value); + describe(".callControlUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.callControlUrl).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".leaveConferenceUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.leaveConferenceUrl).toBe(value); + describe(".leaveConferenceUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.leaveConferenceUrl).toBe(value); + }); }); - }); - describe(".listen", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.listen).toBe(value); + describe(".listen", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.listen).toBe(value); + }); }); - }); - describe(".notificationUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.notificationUrl).toBe(value); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.notificationUrl).toBe(value); + }); }); - }); - describe(".startConfOnEnter", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.startConfOnEnter).toBe(value); + describe(".startConfOnEnter", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.startConfOnEnter).toBe(value); + }); + }); + describe(".talk", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.talk).toBe(value); + }); + }); + describe(".dtmfPassThrough", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.dtmfPassThrough).toBe(value); + }); }); }); - describe(".talk", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.talk).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.AddToConference; + let model: freeclimb.AddToConference = new freeclimb.AddToConference({ + allowCallControl: false, + callControlSequence: "", + callControlUrl: "", + conferenceId: "", + leaveConferenceUrl: "", + listen: false, + notificationUrl: "", + startConfOnEnter: false, + talk: false, + dtmfPassThrough: false, + }); + describe("AddToConference class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AddToConference); + }); + }); + + describe(".allowCallControl", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.allowCallControl).toBe(value); + }); + }); + describe(".callControlSequence", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callControlSequence).toBe(value); + }); + }); + describe(".callControlUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callControlUrl).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".leaveConferenceUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.leaveConferenceUrl).toBe(value); + }); + }); + describe(".listen", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.listen).toBe(value); + }); + }); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.notificationUrl).toBe(value); + }); + }); + describe(".startConfOnEnter", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.startConfOnEnter).toBe(value); + }); + }); + describe(".talk", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.talk).toBe(value); + }); + }); + describe(".dtmfPassThrough", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.dtmfPassThrough).toBe(value); + }); }); }); - describe(".dtmfPassThrough", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.dtmfPassThrough).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.AddToConference; + let constructorArguments = { + conferenceId: "test_conferenceId", + }; + let model: freeclimb.AddToConference = new freeclimb.AddToConference( + constructorArguments, + ); + + describe("#allowCallControl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "allowCallControl", + )?.defaultValue; + expect(model.allowCallControl).toBe(value); + }); + }); + describe("#callControlSequence", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callControlSequence", + )?.defaultValue; + expect(model.callControlSequence).toBe(value); + }); + }); + describe("#callControlUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callControlUrl", + )?.defaultValue; + expect(model.callControlUrl).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to initialization value", () => { + expect(model.conferenceId).toBe(constructorArguments["conferenceId"]); + }); + }); + describe("#leaveConferenceUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "leaveConferenceUrl", + )?.defaultValue; + expect(model.leaveConferenceUrl).toBe(value); + }); + }); + describe("#listen", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "listen", + )?.defaultValue; + expect(model.listen).toBe(value); + }); + }); + describe("#notificationUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "notificationUrl", + )?.defaultValue; + expect(model.notificationUrl).toBe(value); + }); + }); + describe("#startConfOnEnter", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "startConfOnEnter", + )?.defaultValue; + expect(model.startConfOnEnter).toBe(value); + }); + }); + describe("#talk", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "talk", + )?.defaultValue; + expect(model.talk).toBe(value); + }); + }); + describe("#dtmfPassThrough", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "dtmfPassThrough", + )?.defaultValue; + expect(model.dtmfPassThrough).toBe(value); + }); }); }); }); diff --git a/__tests__/models/AddToConferenceNotificationWebhook.spec.ts b/__tests__/models/AddToConferenceNotificationWebhook.spec.ts index f63e17f..0c76d3a 100644 --- a/__tests__/models/AddToConferenceNotificationWebhook.spec.ts +++ b/__tests__/models/AddToConferenceNotificationWebhook.spec.ts @@ -2,118 +2,349 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AddToConferenceNotificationWebhook", () => { - let model: freeclimb.AddToConferenceNotificationWebhook = - new freeclimb.AddToConferenceNotificationWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.AddToConferenceNotificationWebhook; + let model: freeclimb.AddToConferenceNotificationWebhook = + new freeclimb.AddToConferenceNotificationWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", - status: freeclimb.ConferenceStatus.EMPTY, - recordingUrl: "https://123.abc", - recordingId: "test_recordingId", - recordingDurationSec: 1, + status: freeclimb.ConferenceStatus.EMPTY, + recordingUrl: "https://123.abc", + recordingId: "test_recordingId", + recordingDurationSec: 1, + }); + describe("AddToConferenceNotificationWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.AddToConferenceNotificationWebhook, + ); + }); }); - describe("AddToConferenceNotificationWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf( - freeclimb.AddToConferenceNotificationWebhook, - ); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); + }); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.recordingUrl).toBe(value); + }); + }); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingId"; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of AddToConferenceNotificationWebhook", () => { + expect( + freeclimb.AddToConferenceNotificationWebhook.deserialize( + '{ "requestType": "addToConferenceNotification"}', + ), + ).toBeInstanceOf(freeclimb.AddToConferenceNotificationWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.AddToConferenceNotificationWebhook; + let model: freeclimb.AddToConferenceNotificationWebhook = + new freeclimb.AddToConferenceNotificationWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + + status: freeclimb.ConferenceStatus.EMPTY, + recordingUrl: "", + recordingId: "", + recordingDurationSec: 0, + }); + describe("AddToConferenceNotificationWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.AddToConferenceNotificationWebhook, + ); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "empty"; - expect(model.status).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".recordingUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.recordingUrl).toBe(value); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); }); - }); - describe(".recordingId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingId"; - expect(model.recordingId).toBe(value); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingUrl).toBe(value); + }); }); - }); - describe(".recordingDurationSec", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.recordingDurationSec).toBe(value); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of AddToConferenceNotificationWebhook", () => { + expect( + freeclimb.AddToConferenceNotificationWebhook.deserialize( + '{ "requestType": "addToConferenceNotification"}', + ), + ).toBeInstanceOf(freeclimb.AddToConferenceNotificationWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of AddToConferenceNotificationWebhook", () => { - expect( - freeclimb.AddToConferenceNotificationWebhook.deserialize( - '{ "requestType": "addToConferenceNotification"}', - ), - ).toBeInstanceOf(freeclimb.AddToConferenceNotificationWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.AddToConferenceNotificationWebhook; + let constructorArguments = {}; + let model: freeclimb.AddToConferenceNotificationWebhook = + new freeclimb.AddToConferenceNotificationWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#recordingUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingUrl", + )?.defaultValue; + expect(model.recordingUrl).toBe(value); + }); + }); + describe("#recordingId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingId", + )?.defaultValue; + expect(model.recordingId).toBe(value); + }); + }); + describe("#recordingDurationSec", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingDurationSec", + )?.defaultValue; + expect(model.recordingDurationSec).toBe(value); + }); }); }); }); diff --git a/__tests__/models/AddToQueueNotificationWebhook.spec.ts b/__tests__/models/AddToQueueNotificationWebhook.spec.ts index aa4da0b..d19df85 100644 --- a/__tests__/models/AddToQueueNotificationWebhook.spec.ts +++ b/__tests__/models/AddToQueueNotificationWebhook.spec.ts @@ -2,87 +2,255 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AddToQueueNotificationWebhook", () => { - let model: freeclimb.AddToQueueNotificationWebhook = - new freeclimb.AddToQueueNotificationWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.AddToQueueNotificationWebhook; + let model: freeclimb.AddToQueueNotificationWebhook = + new freeclimb.AddToQueueNotificationWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + }); + describe("AddToQueueNotificationWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook); + }); }); - describe("AddToQueueNotificationWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of AddToQueueNotificationWebhook", () => { + expect( + freeclimb.AddToQueueNotificationWebhook.deserialize( + '{ "requestType": "addToQueueNotification"}', + ), + ).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.AddToQueueNotificationWebhook; + let model: freeclimb.AddToQueueNotificationWebhook = + new freeclimb.AddToQueueNotificationWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + }); + describe("AddToQueueNotificationWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of AddToQueueNotificationWebhook", () => { + expect( + freeclimb.AddToQueueNotificationWebhook.deserialize( + '{ "requestType": "addToQueueNotification"}', + ), + ).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of AddToQueueNotificationWebhook", () => { - expect( - freeclimb.AddToQueueNotificationWebhook.deserialize( - '{ "requestType": "addToQueueNotification"}', - ), - ).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.AddToQueueNotificationWebhook; + let constructorArguments = {}; + let model: freeclimb.AddToQueueNotificationWebhook = + new freeclimb.AddToQueueNotificationWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/AnsweredBy.spec.ts b/__tests__/models/AnsweredBy.spec.ts index 8cd5f6c..d2b2f14 100644 --- a/__tests__/models/AnsweredBy.spec.ts +++ b/__tests__/models/AnsweredBy.spec.ts @@ -2,14 +2,16 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AnsweredBy", () => { - describe(".HUMAN", () => { - it("resolves to correct value for HUMAN enum property", () => { - expect(freeclimb.AnsweredBy.HUMAN).toBe("human"); + describe("Test with truthy values", () => { + describe(".HUMAN", () => { + it("resolves to correct value for HUMAN enum property", () => { + expect(freeclimb.AnsweredBy.HUMAN).toBe("human"); + }); }); - }); - describe(".MACHINE", () => { - it("resolves to correct value for MACHINE enum property", () => { - expect(freeclimb.AnsweredBy.MACHINE).toBe("machine"); + describe(".MACHINE", () => { + it("resolves to correct value for MACHINE enum property", () => { + expect(freeclimb.AnsweredBy.MACHINE).toBe("machine"); + }); }); }); }); diff --git a/__tests__/models/ApplicationList.spec.ts b/__tests__/models/ApplicationList.spec.ts index ded5e90..64311f2 100644 --- a/__tests__/models/ApplicationList.spec.ts +++ b/__tests__/models/ApplicationList.spec.ts @@ -2,67 +2,160 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ApplicationList", () => { - let model: freeclimb.ApplicationList = new freeclimb.ApplicationList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - applications: [], - }); - describe("ApplicationList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.ApplicationList); + describe("Test with truthy values", () => { + const Klass = freeclimb.ApplicationList; + let model: freeclimb.ApplicationList = new freeclimb.ApplicationList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + applications: [], }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("ApplicationList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ApplicationList); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".applications", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.ApplicationResult[] = []; + expect(model.applications).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.ApplicationList; + let model: freeclimb.ApplicationList = new freeclimb.ApplicationList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + applications: [], + }); + describe("ApplicationList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ApplicationList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".applications", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.ApplicationResult[] = []; + expect(model.applications).toStrictEqual(value); + }); }); }); - describe(".applications", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.ApplicationResult[] = []; - expect(model.applications).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.ApplicationList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.ApplicationList = new freeclimb.ApplicationList( + constructorArguments, + ); + + describe("#applications", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applications", + )?.defaultValue; + expect(model.applications).toBe(value); + }); }); }); }); diff --git a/__tests__/models/ApplicationRequest.spec.ts b/__tests__/models/ApplicationRequest.spec.ts index f80e26c..cef9fe4 100644 --- a/__tests__/models/ApplicationRequest.spec.ts +++ b/__tests__/models/ApplicationRequest.spec.ts @@ -2,60 +2,186 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ApplicationRequest", () => { - let model: freeclimb.ApplicationRequest = new freeclimb.ApplicationRequest({ - alias: "test_alias", - voiceUrl: "https://123.abc", - voiceFallbackUrl: "https://123.abc", - callConnectUrl: "https://123.abc", - statusCallbackUrl: "https://123.abc", - smsUrl: "https://123.abc", - smsFallbackUrl: "https://123.abc", - }); - describe("ApplicationRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.ApplicationRequest); + describe("Test with truthy values", () => { + const Klass = freeclimb.ApplicationRequest; + let model: freeclimb.ApplicationRequest = new freeclimb.ApplicationRequest({ + alias: "test_alias", + voiceUrl: "https://123.abc", + voiceFallbackUrl: "https://123.abc", + callConnectUrl: "https://123.abc", + statusCallbackUrl: "https://123.abc", + smsUrl: "https://123.abc", + smsFallbackUrl: "https://123.abc", }); - }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe("ApplicationRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ApplicationRequest); + }); }); - }); - describe(".voiceUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.voiceUrl).toBe(value); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); }); - }); - describe(".voiceFallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.voiceFallbackUrl).toBe(value); + describe(".voiceUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.voiceUrl).toBe(value); + }); }); - }); - describe(".callConnectUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.callConnectUrl).toBe(value); + describe(".voiceFallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.voiceFallbackUrl).toBe(value); + }); }); - }); - describe(".statusCallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.statusCallbackUrl).toBe(value); + describe(".callConnectUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.callConnectUrl).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".smsUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.smsUrl).toBe(value); + }); + }); + describe(".smsFallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.smsFallbackUrl).toBe(value); + }); }); }); - describe(".smsUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.smsUrl).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.ApplicationRequest; + let model: freeclimb.ApplicationRequest = new freeclimb.ApplicationRequest({ + alias: "", + voiceUrl: "", + voiceFallbackUrl: "", + callConnectUrl: "", + statusCallbackUrl: "", + smsUrl: "", + smsFallbackUrl: "", + }); + describe("ApplicationRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ApplicationRequest); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".voiceUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.voiceUrl).toBe(value); + }); + }); + describe(".voiceFallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.voiceFallbackUrl).toBe(value); + }); + }); + describe(".callConnectUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callConnectUrl).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".smsUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.smsUrl).toBe(value); + }); + }); + describe(".smsFallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.smsFallbackUrl).toBe(value); + }); }); }); - describe(".smsFallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.smsFallbackUrl).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.ApplicationRequest; + let constructorArguments = {}; + let model: freeclimb.ApplicationRequest = new freeclimb.ApplicationRequest( + constructorArguments, + ); + + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#voiceUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "voiceUrl", + )?.defaultValue; + expect(model.voiceUrl).toBe(value); + }); + }); + describe("#voiceFallbackUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "voiceFallbackUrl", + )?.defaultValue; + expect(model.voiceFallbackUrl).toBe(value); + }); + }); + describe("#callConnectUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callConnectUrl", + )?.defaultValue; + expect(model.callConnectUrl).toBe(value); + }); + }); + describe("#statusCallbackUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "statusCallbackUrl", + )?.defaultValue; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe("#smsUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "smsUrl", + )?.defaultValue; + expect(model.smsUrl).toBe(value); + }); + }); + describe("#smsFallbackUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "smsFallbackUrl", + )?.defaultValue; + expect(model.smsFallbackUrl).toBe(value); + }); }); }); }); diff --git a/__tests__/models/ApplicationResult.spec.ts b/__tests__/models/ApplicationResult.spec.ts index 442f7e1..93a10cb 100644 --- a/__tests__/models/ApplicationResult.spec.ts +++ b/__tests__/models/ApplicationResult.spec.ts @@ -2,102 +2,291 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ApplicationResult", () => { - let model: freeclimb.ApplicationResult = new freeclimb.ApplicationResult({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - accountId: "test_accountId", - applicationId: "test_applicationId", - alias: "test_alias", - voiceUrl: "https://123.abc", - voiceFallbackUrl: "https://123.abc", - callConnectUrl: "https://123.abc", - statusCallbackUrl: "https://123.abc", - smsUrl: "https://123.abc", - smsFallbackUrl: "https://123.abc", - }); - describe("ApplicationResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.ApplicationResult); + describe("Test with truthy values", () => { + const Klass = freeclimb.ApplicationResult; + let model: freeclimb.ApplicationResult = new freeclimb.ApplicationResult({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + accountId: "test_accountId", + applicationId: "test_applicationId", + alias: "test_alias", + voiceUrl: "https://123.abc", + voiceFallbackUrl: "https://123.abc", + callConnectUrl: "https://123.abc", + statusCallbackUrl: "https://123.abc", + smsUrl: "https://123.abc", + smsFallbackUrl: "https://123.abc", }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("ApplicationResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ApplicationResult); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".applicationId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_applicationId"; - expect(model.applicationId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); }); - }); - describe(".voiceUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.voiceUrl).toBe(value); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); }); - }); - describe(".voiceFallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.voiceFallbackUrl).toBe(value); + describe(".voiceUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.voiceUrl).toBe(value); + }); }); - }); - describe(".callConnectUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.callConnectUrl).toBe(value); + describe(".voiceFallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.voiceFallbackUrl).toBe(value); + }); }); - }); - describe(".statusCallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.statusCallbackUrl).toBe(value); + describe(".callConnectUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.callConnectUrl).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".smsUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.smsUrl).toBe(value); + }); + }); + describe(".smsFallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.smsFallbackUrl).toBe(value); + }); }); }); - describe(".smsUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.smsUrl).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.ApplicationResult; + let model: freeclimb.ApplicationResult = new freeclimb.ApplicationResult({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + accountId: "", + applicationId: "", + alias: "", + voiceUrl: "", + voiceFallbackUrl: "", + callConnectUrl: "", + statusCallbackUrl: "", + smsUrl: "", + smsFallbackUrl: "", + }); + describe("ApplicationResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ApplicationResult); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.applicationId).toBe(value); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".voiceUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.voiceUrl).toBe(value); + }); + }); + describe(".voiceFallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.voiceFallbackUrl).toBe(value); + }); + }); + describe(".callConnectUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callConnectUrl).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".smsUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.smsUrl).toBe(value); + }); + }); + describe(".smsFallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.smsFallbackUrl).toBe(value); + }); }); }); - describe(".smsFallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.smsFallbackUrl).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.ApplicationResult; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.ApplicationResult = new freeclimb.ApplicationResult( + constructorArguments, + ); + + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#applicationId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applicationId", + )?.defaultValue; + expect(model.applicationId).toBe(value); + }); + }); + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#voiceUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "voiceUrl", + )?.defaultValue; + expect(model.voiceUrl).toBe(value); + }); + }); + describe("#voiceFallbackUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "voiceFallbackUrl", + )?.defaultValue; + expect(model.voiceFallbackUrl).toBe(value); + }); + }); + describe("#callConnectUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callConnectUrl", + )?.defaultValue; + expect(model.callConnectUrl).toBe(value); + }); + }); + describe("#statusCallbackUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "statusCallbackUrl", + )?.defaultValue; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe("#smsUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "smsUrl", + )?.defaultValue; + expect(model.smsUrl).toBe(value); + }); + }); + describe("#smsFallbackUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "smsFallbackUrl", + )?.defaultValue; + expect(model.smsFallbackUrl).toBe(value); + }); }); }); }); diff --git a/__tests__/models/AvailableNumber.spec.ts b/__tests__/models/AvailableNumber.spec.ts index 41b2add..916dd2a 100644 --- a/__tests__/models/AvailableNumber.spec.ts +++ b/__tests__/models/AvailableNumber.spec.ts @@ -2,72 +2,210 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AvailableNumber", () => { - let model: freeclimb.AvailableNumber = new freeclimb.AvailableNumber({ - capabilities: new freeclimb.Capabilities({ - voice: null as any, - sms: null as any, - tollFree: null as any, - tenDLC: null as any, - shortCode: null as any, - }), - campaignId: "test_campaignId", - phoneNumber: "test_phoneNumber", - voiceEnabled: true, - smsEnabled: true, - region: "test_region", - country: "test_country", - }); - describe("AvailableNumber class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.AvailableNumber); + describe("Test with truthy values", () => { + const Klass = freeclimb.AvailableNumber; + let model: freeclimb.AvailableNumber = new freeclimb.AvailableNumber({ + capabilities: new freeclimb.Capabilities({ + voice: null as any, + sms: null as any, + tollFree: null as any, + tenDLC: null as any, + shortCode: null as any, + }), + campaignId: "test_campaignId", + phoneNumber: "test_phoneNumber", + voiceEnabled: true, + smsEnabled: true, + region: "test_region", + country: "test_country", + }); + describe("AvailableNumber class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AvailableNumber); + }); + }); + describe(".capabilities", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.Capabilities({ + voice: null as any, + sms: null as any, + tollFree: null as any, + tenDLC: null as any, + shortCode: null as any, + }); + expect(model.capabilities).toStrictEqual(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); + }); + }); + describe(".phoneNumber", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phoneNumber"; + expect(model.phoneNumber).toBe(value); + }); + }); + describe(".voiceEnabled", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.voiceEnabled).toBe(value); + }); + }); + describe(".smsEnabled", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.smsEnabled).toBe(value); + }); + }); + describe(".region", () => { + it("resolves to particular value on initialization", () => { + const value = "test_region"; + expect(model.region).toBe(value); + }); + }); + describe(".country", () => { + it("resolves to particular value on initialization", () => { + const value = "test_country"; + expect(model.country).toBe(value); + }); }); }); - describe(".capabilities", () => { - it("resolves to particular value on initialization", () => { - const value = new freeclimb.Capabilities({ + describe("Test with falsy values", () => { + const Klass = freeclimb.AvailableNumber; + let model: freeclimb.AvailableNumber = new freeclimb.AvailableNumber({ + capabilities: new freeclimb.Capabilities({ voice: null as any, sms: null as any, tollFree: null as any, tenDLC: null as any, shortCode: null as any, + }), + campaignId: "", + phoneNumber: "", + voiceEnabled: false, + smsEnabled: false, + region: "", + country: "", + }); + describe("AvailableNumber class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AvailableNumber); }); - expect(model.capabilities).toStrictEqual(value); }); - }); - describe(".campaignId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_campaignId"; - expect(model.campaignId).toBe(value); + describe(".capabilities", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.Capabilities({ + voice: null as any, + sms: null as any, + tollFree: null as any, + tenDLC: null as any, + shortCode: null as any, + }); + expect(model.capabilities).toStrictEqual(value); + }); }); - }); - describe(".phoneNumber", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phoneNumber"; - expect(model.phoneNumber).toBe(value); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.campaignId).toBe(value); + }); }); - }); - describe(".voiceEnabled", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.voiceEnabled).toBe(value); + describe(".phoneNumber", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phoneNumber).toBe(value); + }); }); - }); - describe(".smsEnabled", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.smsEnabled).toBe(value); + describe(".voiceEnabled", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.voiceEnabled).toBe(value); + }); }); - }); - describe(".region", () => { - it("resolves to particular value on initialization", () => { - const value = "test_region"; - expect(model.region).toBe(value); + describe(".smsEnabled", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.smsEnabled).toBe(value); + }); + }); + describe(".region", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.region).toBe(value); + }); + }); + describe(".country", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.country).toBe(value); + }); }); }); - describe(".country", () => { - it("resolves to particular value on initialization", () => { - const value = "test_country"; - expect(model.country).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.AvailableNumber; + let constructorArguments = {}; + let model: freeclimb.AvailableNumber = new freeclimb.AvailableNumber( + constructorArguments, + ); + + describe("#capabilities", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "capabilities", + )?.defaultValue; + expect(model.capabilities).toBe(value); + }); + }); + describe("#campaignId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "campaignId", + )?.defaultValue; + expect(model.campaignId).toBe(value); + }); + }); + describe("#phoneNumber", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "phoneNumber", + )?.defaultValue; + expect(model.phoneNumber).toBe(value); + }); + }); + describe("#voiceEnabled", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "voiceEnabled", + )?.defaultValue; + expect(model.voiceEnabled).toBe(value); + }); + }); + describe("#smsEnabled", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "smsEnabled", + )?.defaultValue; + expect(model.smsEnabled).toBe(value); + }); + }); + describe("#region", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "region", + )?.defaultValue; + expect(model.region).toBe(value); + }); + }); + describe("#country", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "country", + )?.defaultValue; + expect(model.country).toBe(value); + }); }); }); }); diff --git a/__tests__/models/AvailableNumberList.spec.ts b/__tests__/models/AvailableNumberList.spec.ts index e4c8e1c..ae3abdd 100644 --- a/__tests__/models/AvailableNumberList.spec.ts +++ b/__tests__/models/AvailableNumberList.spec.ts @@ -2,67 +2,161 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("AvailableNumberList", () => { - let model: freeclimb.AvailableNumberList = new freeclimb.AvailableNumberList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - availablePhoneNumbers: [], - }); - describe("AvailableNumberList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.AvailableNumberList); + describe("Test with truthy values", () => { + const Klass = freeclimb.AvailableNumberList; + let model: freeclimb.AvailableNumberList = + new freeclimb.AvailableNumberList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + availablePhoneNumbers: [], + }); + describe("AvailableNumberList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AvailableNumberList); + }); }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".availablePhoneNumbers", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.AvailableNumber[] = []; + expect(model.availablePhoneNumbers).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.AvailableNumberList; + let model: freeclimb.AvailableNumberList = + new freeclimb.AvailableNumberList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + availablePhoneNumbers: [], + }); + describe("AvailableNumberList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.AvailableNumberList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".availablePhoneNumbers", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.AvailableNumber[] = []; + expect(model.availablePhoneNumbers).toStrictEqual(value); + }); }); }); - describe(".availablePhoneNumbers", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.AvailableNumber[] = []; - expect(model.availablePhoneNumbers).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.AvailableNumberList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.AvailableNumberList = + new freeclimb.AvailableNumberList(constructorArguments); + + describe("#availablePhoneNumbers", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "availablePhoneNumbers", + )?.defaultValue; + expect(model.availablePhoneNumbers).toBe(value); + }); }); }); }); diff --git a/__tests__/models/BargeInReason.spec.ts b/__tests__/models/BargeInReason.spec.ts index 920c26f..9aef105 100644 --- a/__tests__/models/BargeInReason.spec.ts +++ b/__tests__/models/BargeInReason.spec.ts @@ -2,21 +2,23 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("BargeInReason", () => { - describe(".NO_BARGE_IN", () => { - it("resolves to correct value for NO_BARGE_IN enum property", () => { - expect(freeclimb.BargeInReason.NO_BARGE_IN).toBe("noBargeIn"); + describe("Test with truthy values", () => { + describe(".NO_BARGE_IN", () => { + it("resolves to correct value for NO_BARGE_IN enum property", () => { + expect(freeclimb.BargeInReason.NO_BARGE_IN).toBe("noBargeIn"); + }); }); - }); - describe(".BARGE_IN_BY_DTMF", () => { - it("resolves to correct value for BARGE_IN_BY_DTMF enum property", () => { - expect(freeclimb.BargeInReason.BARGE_IN_BY_DTMF).toBe("bargeInByDTMF"); + describe(".BARGE_IN_BY_DTMF", () => { + it("resolves to correct value for BARGE_IN_BY_DTMF enum property", () => { + expect(freeclimb.BargeInReason.BARGE_IN_BY_DTMF).toBe("bargeInByDTMF"); + }); }); - }); - describe(".BARGE_IN_BY_ENERGY", () => { - it("resolves to correct value for BARGE_IN_BY_ENERGY enum property", () => { - expect(freeclimb.BargeInReason.BARGE_IN_BY_ENERGY).toBe( - "bargeInByEnergy", - ); + describe(".BARGE_IN_BY_ENERGY", () => { + it("resolves to correct value for BARGE_IN_BY_ENERGY enum property", () => { + expect(freeclimb.BargeInReason.BARGE_IN_BY_ENERGY).toBe( + "bargeInByEnergy", + ); + }); }); }); }); diff --git a/__tests__/models/BuyIncomingNumberRequest.spec.ts b/__tests__/models/BuyIncomingNumberRequest.spec.ts index bf166d1..4c57fea 100644 --- a/__tests__/models/BuyIncomingNumberRequest.spec.ts +++ b/__tests__/models/BuyIncomingNumberRequest.spec.ts @@ -2,33 +2,98 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("BuyIncomingNumberRequest", () => { - let model: freeclimb.BuyIncomingNumberRequest = - new freeclimb.BuyIncomingNumberRequest({ - phoneNumber: "test_phoneNumber", - alias: "test_alias", - applicationId: "test_applicationId", + describe("Test with truthy values", () => { + const Klass = freeclimb.BuyIncomingNumberRequest; + let model: freeclimb.BuyIncomingNumberRequest = + new freeclimb.BuyIncomingNumberRequest({ + phoneNumber: "test_phoneNumber", + alias: "test_alias", + applicationId: "test_applicationId", + }); + describe("BuyIncomingNumberRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.BuyIncomingNumberRequest); + }); }); - describe("BuyIncomingNumberRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.BuyIncomingNumberRequest); + describe(".phoneNumber", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phoneNumber"; + expect(model.phoneNumber).toBe(value); + }); }); - }); - describe(".phoneNumber", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phoneNumber"; - expect(model.phoneNumber).toBe(value); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); }); }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.BuyIncomingNumberRequest; + let model: freeclimb.BuyIncomingNumberRequest = + new freeclimb.BuyIncomingNumberRequest({ + phoneNumber: "", + alias: "", + applicationId: "", + }); + describe("BuyIncomingNumberRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.BuyIncomingNumberRequest); + }); + }); + describe(".phoneNumber", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phoneNumber).toBe(value); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.applicationId).toBe(value); + }); }); }); - describe(".applicationId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_applicationId"; - expect(model.applicationId).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.BuyIncomingNumberRequest; + let constructorArguments = { + phoneNumber: "test_phoneNumber", + }; + let model: freeclimb.BuyIncomingNumberRequest = + new freeclimb.BuyIncomingNumberRequest(constructorArguments); + + describe("#phoneNumber", () => { + it("resolves to initialization value", () => { + expect(model.phoneNumber).toBe(constructorArguments["phoneNumber"]); + }); + }); + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#applicationId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applicationId", + )?.defaultValue; + expect(model.applicationId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/CallControlWebhook.spec.ts b/__tests__/models/CallControlWebhook.spec.ts index 0176f43..4ca4602 100644 --- a/__tests__/models/CallControlWebhook.spec.ts +++ b/__tests__/models/CallControlWebhook.spec.ts @@ -2,56 +2,162 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CallControlWebhook", () => { - let model: freeclimb.CallControlWebhook = new freeclimb.CallControlWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - conferenceId: "test_conferenceId", - digits: "test_digits", - }); - describe("CallControlWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CallControlWebhook); + describe("Test with truthy values", () => { + const Klass = freeclimb.CallControlWebhook; + let model: freeclimb.CallControlWebhook = new freeclimb.CallControlWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + conferenceId: "test_conferenceId", + digits: "test_digits", + }); + describe("CallControlWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CallControlWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".digits", () => { + it("resolves to particular value on initialization", () => { + const value = "test_digits"; + expect(model.digits).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of CallControlWebhook", () => { + expect( + freeclimb.CallControlWebhook.deserialize( + '{ "requestType": "callControl"}', + ), + ).toBeInstanceOf(freeclimb.CallControlWebhook); + }); }); }); - describe(".digits", () => { - it("resolves to particular value on initialization", () => { - const value = "test_digits"; - expect(model.digits).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.CallControlWebhook; + let model: freeclimb.CallControlWebhook = new freeclimb.CallControlWebhook({ + requestType: "", + callId: "", + accountId: "", + conferenceId: "", + digits: "", + }); + describe("CallControlWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CallControlWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".digits", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.digits).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of CallControlWebhook", () => { + expect( + freeclimb.CallControlWebhook.deserialize( + '{ "requestType": "callControl"}', + ), + ).toBeInstanceOf(freeclimb.CallControlWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of CallControlWebhook", () => { - expect( - freeclimb.CallControlWebhook.deserialize( - '{ "requestType": "callControl"}', - ), - ).toBeInstanceOf(freeclimb.CallControlWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.CallControlWebhook; + let constructorArguments = {}; + let model: freeclimb.CallControlWebhook = new freeclimb.CallControlWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#digits", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "digits", + )?.defaultValue; + expect(model.digits).toBe(value); + }); }); }); }); diff --git a/__tests__/models/CallDirection.spec.ts b/__tests__/models/CallDirection.spec.ts index 59cd1ee..36a8d7a 100644 --- a/__tests__/models/CallDirection.spec.ts +++ b/__tests__/models/CallDirection.spec.ts @@ -2,19 +2,21 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CallDirection", () => { - describe(".INBOUND", () => { - it("resolves to correct value for INBOUND enum property", () => { - expect(freeclimb.CallDirection.INBOUND).toBe("inbound"); + describe("Test with truthy values", () => { + describe(".INBOUND", () => { + it("resolves to correct value for INBOUND enum property", () => { + expect(freeclimb.CallDirection.INBOUND).toBe("inbound"); + }); }); - }); - describe(".OUTBOUND_API", () => { - it("resolves to correct value for OUTBOUND_API enum property", () => { - expect(freeclimb.CallDirection.OUTBOUND_API).toBe("outboundAPI"); + describe(".OUTBOUND_API", () => { + it("resolves to correct value for OUTBOUND_API enum property", () => { + expect(freeclimb.CallDirection.OUTBOUND_API).toBe("outboundAPI"); + }); }); - }); - describe(".OUTBOUND_DIAL", () => { - it("resolves to correct value for OUTBOUND_DIAL enum property", () => { - expect(freeclimb.CallDirection.OUTBOUND_DIAL).toBe("outboundDial"); + describe(".OUTBOUND_DIAL", () => { + it("resolves to correct value for OUTBOUND_DIAL enum property", () => { + expect(freeclimb.CallDirection.OUTBOUND_DIAL).toBe("outboundDial"); + }); }); }); }); diff --git a/__tests__/models/CallEndedReason.spec.ts b/__tests__/models/CallEndedReason.spec.ts index 594c9be..7eea3db 100644 --- a/__tests__/models/CallEndedReason.spec.ts +++ b/__tests__/models/CallEndedReason.spec.ts @@ -2,139 +2,141 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CallEndedReason", () => { - describe(".BUSY", () => { - it("resolves to correct value for BUSY enum property", () => { - expect(freeclimb.CallEndedReason.BUSY).toBe("busy"); - }); - }); - describe(".FAILED", () => { - it("resolves to correct value for FAILED enum property", () => { - expect(freeclimb.CallEndedReason.FAILED).toBe("failed"); - }); - }); - describe(".NO_ANSWER", () => { - it("resolves to correct value for NO_ANSWER enum property", () => { - expect(freeclimb.CallEndedReason.NO_ANSWER).toBe("noAnswer"); - }); - }); - describe(".CALL_CANCELED", () => { - it("resolves to correct value for CALL_CANCELED enum property", () => { - expect(freeclimb.CallEndedReason.CALL_CANCELED).toBe("callCanceled"); - }); - }); - describe(".FAR_END_HANGUP", () => { - it("resolves to correct value for FAR_END_HANGUP enum property", () => { - expect(freeclimb.CallEndedReason.FAR_END_HANGUP).toBe("farEndHangup"); - }); - }); - describe(".APP_HANGUP", () => { - it("resolves to correct value for APP_HANGUP enum property", () => { - expect(freeclimb.CallEndedReason.APP_HANGUP).toBe("appHangup"); - }); - }); - describe(".APP_REJECT", () => { - it("resolves to correct value for APP_REJECT enum property", () => { - expect(freeclimb.CallEndedReason.APP_REJECT).toBe("appReject"); - }); - }); - describe(".APP_NO_PERCL", () => { - it("resolves to correct value for APP_NO_PERCL enum property", () => { - expect(freeclimb.CallEndedReason.APP_NO_PERCL).toBe("appNoPercl"); - }); - }); - describe(".APP_INVALID_PERCL", () => { - it("resolves to correct value for APP_INVALID_PERCL enum property", () => { - expect(freeclimb.CallEndedReason.APP_INVALID_PERCL).toBe( - "appInvalidPercl", - ); - }); - }); - describe(".CONFERENCE_TERMINATED", () => { - it("resolves to correct value for CONFERENCE_TERMINATED enum property", () => { - expect(freeclimb.CallEndedReason.CONFERENCE_TERMINATED).toBe( - "conferenceTerminated", - ); - }); - }); - describe(".CONFERENCE_EMPTIED", () => { - it("resolves to correct value for CONFERENCE_EMPTIED enum property", () => { - expect(freeclimb.CallEndedReason.CONFERENCE_EMPTIED).toBe( - "conferenceEmptied", - ); - }); - }); - describe(".REMOVED_FROM_CONFERENCE", () => { - it("resolves to correct value for REMOVED_FROM_CONFERENCE enum property", () => { - expect(freeclimb.CallEndedReason.REMOVED_FROM_CONFERENCE).toBe( - "removedFromConference", - ); - }); - }); - describe(".MACHINE_DETECTED", () => { - it("resolves to correct value for MACHINE_DETECTED enum property", () => { - expect(freeclimb.CallEndedReason.MACHINE_DETECTED).toBe( - "machineDetected", - ); - }); - }); - describe(".WEBHOOK_FAILED", () => { - it("resolves to correct value for WEBHOOK_FAILED enum property", () => { - expect(freeclimb.CallEndedReason.WEBHOOK_FAILED).toBe("webhookFailed"); - }); - }); - describe(".WEBHOOK_INVALID_RESPONSE", () => { - it("resolves to correct value for WEBHOOK_INVALID_RESPONSE enum property", () => { - expect(freeclimb.CallEndedReason.WEBHOOK_INVALID_RESPONSE).toBe( - "webhookInvalidResponse", - ); - }); - }); - describe(".VOICE_DISABLED", () => { - it("resolves to correct value for VOICE_DISABLED enum property", () => { - expect(freeclimb.CallEndedReason.VOICE_DISABLED).toBe("voiceDisabled"); - }); - }); - describe(".CONFIG_ERROR_NO_APPLICATION", () => { - it("resolves to correct value for CONFIG_ERROR_NO_APPLICATION enum property", () => { - expect(freeclimb.CallEndedReason.CONFIG_ERROR_NO_APPLICATION).toBe( - "configErrorNoApplication", - ); - }); - }); - describe(".CONFIG_ERROR_NO_VOICE_URL", () => { - it("resolves to correct value for CONFIG_ERROR_NO_VOICE_URL enum property", () => { - expect(freeclimb.CallEndedReason.CONFIG_ERROR_NO_VOICE_URL).toBe( - "configErrorNoVoiceUrl", - ); - }); - }); - describe(".MAX_REDIRECTS_ERROR", () => { - it("resolves to correct value for MAX_REDIRECTS_ERROR enum property", () => { - expect(freeclimb.CallEndedReason.MAX_REDIRECTS_ERROR).toBe( - "maxRedirectsError", - ); - }); - }); - describe(".PERCL_PROCESSING_ERROR", () => { - it("resolves to correct value for PERCL_PROCESSING_ERROR enum property", () => { - expect(freeclimb.CallEndedReason.PERCL_PROCESSING_ERROR).toBe( - "perclProcessingError", - ); - }); - }); - describe(".INTERNAL_ERROR", () => { - it("resolves to correct value for INTERNAL_ERROR enum property", () => { - expect(freeclimb.CallEndedReason.INTERNAL_ERROR).toBe("internalError"); - }); - }); - describe(".GRPC_HANGUP", () => { - it("resolves to correct value for GRPC_HANGUP enum property", () => { - expect(freeclimb.CallEndedReason.GRPC_HANGUP).toBe("grpcHangup"); - }); - }); - describe(".MAX_DURATION", () => { - it("resolves to correct value for MAX_DURATION enum property", () => { - expect(freeclimb.CallEndedReason.MAX_DURATION).toBe("maxDuration"); + describe("Test with truthy values", () => { + describe(".BUSY", () => { + it("resolves to correct value for BUSY enum property", () => { + expect(freeclimb.CallEndedReason.BUSY).toBe("busy"); + }); + }); + describe(".FAILED", () => { + it("resolves to correct value for FAILED enum property", () => { + expect(freeclimb.CallEndedReason.FAILED).toBe("failed"); + }); + }); + describe(".NO_ANSWER", () => { + it("resolves to correct value for NO_ANSWER enum property", () => { + expect(freeclimb.CallEndedReason.NO_ANSWER).toBe("noAnswer"); + }); + }); + describe(".CALL_CANCELED", () => { + it("resolves to correct value for CALL_CANCELED enum property", () => { + expect(freeclimb.CallEndedReason.CALL_CANCELED).toBe("callCanceled"); + }); + }); + describe(".FAR_END_HANGUP", () => { + it("resolves to correct value for FAR_END_HANGUP enum property", () => { + expect(freeclimb.CallEndedReason.FAR_END_HANGUP).toBe("farEndHangup"); + }); + }); + describe(".APP_HANGUP", () => { + it("resolves to correct value for APP_HANGUP enum property", () => { + expect(freeclimb.CallEndedReason.APP_HANGUP).toBe("appHangup"); + }); + }); + describe(".APP_REJECT", () => { + it("resolves to correct value for APP_REJECT enum property", () => { + expect(freeclimb.CallEndedReason.APP_REJECT).toBe("appReject"); + }); + }); + describe(".APP_NO_PERCL", () => { + it("resolves to correct value for APP_NO_PERCL enum property", () => { + expect(freeclimb.CallEndedReason.APP_NO_PERCL).toBe("appNoPercl"); + }); + }); + describe(".APP_INVALID_PERCL", () => { + it("resolves to correct value for APP_INVALID_PERCL enum property", () => { + expect(freeclimb.CallEndedReason.APP_INVALID_PERCL).toBe( + "appInvalidPercl", + ); + }); + }); + describe(".CONFERENCE_TERMINATED", () => { + it("resolves to correct value for CONFERENCE_TERMINATED enum property", () => { + expect(freeclimb.CallEndedReason.CONFERENCE_TERMINATED).toBe( + "conferenceTerminated", + ); + }); + }); + describe(".CONFERENCE_EMPTIED", () => { + it("resolves to correct value for CONFERENCE_EMPTIED enum property", () => { + expect(freeclimb.CallEndedReason.CONFERENCE_EMPTIED).toBe( + "conferenceEmptied", + ); + }); + }); + describe(".REMOVED_FROM_CONFERENCE", () => { + it("resolves to correct value for REMOVED_FROM_CONFERENCE enum property", () => { + expect(freeclimb.CallEndedReason.REMOVED_FROM_CONFERENCE).toBe( + "removedFromConference", + ); + }); + }); + describe(".MACHINE_DETECTED", () => { + it("resolves to correct value for MACHINE_DETECTED enum property", () => { + expect(freeclimb.CallEndedReason.MACHINE_DETECTED).toBe( + "machineDetected", + ); + }); + }); + describe(".WEBHOOK_FAILED", () => { + it("resolves to correct value for WEBHOOK_FAILED enum property", () => { + expect(freeclimb.CallEndedReason.WEBHOOK_FAILED).toBe("webhookFailed"); + }); + }); + describe(".WEBHOOK_INVALID_RESPONSE", () => { + it("resolves to correct value for WEBHOOK_INVALID_RESPONSE enum property", () => { + expect(freeclimb.CallEndedReason.WEBHOOK_INVALID_RESPONSE).toBe( + "webhookInvalidResponse", + ); + }); + }); + describe(".VOICE_DISABLED", () => { + it("resolves to correct value for VOICE_DISABLED enum property", () => { + expect(freeclimb.CallEndedReason.VOICE_DISABLED).toBe("voiceDisabled"); + }); + }); + describe(".CONFIG_ERROR_NO_APPLICATION", () => { + it("resolves to correct value for CONFIG_ERROR_NO_APPLICATION enum property", () => { + expect(freeclimb.CallEndedReason.CONFIG_ERROR_NO_APPLICATION).toBe( + "configErrorNoApplication", + ); + }); + }); + describe(".CONFIG_ERROR_NO_VOICE_URL", () => { + it("resolves to correct value for CONFIG_ERROR_NO_VOICE_URL enum property", () => { + expect(freeclimb.CallEndedReason.CONFIG_ERROR_NO_VOICE_URL).toBe( + "configErrorNoVoiceUrl", + ); + }); + }); + describe(".MAX_REDIRECTS_ERROR", () => { + it("resolves to correct value for MAX_REDIRECTS_ERROR enum property", () => { + expect(freeclimb.CallEndedReason.MAX_REDIRECTS_ERROR).toBe( + "maxRedirectsError", + ); + }); + }); + describe(".PERCL_PROCESSING_ERROR", () => { + it("resolves to correct value for PERCL_PROCESSING_ERROR enum property", () => { + expect(freeclimb.CallEndedReason.PERCL_PROCESSING_ERROR).toBe( + "perclProcessingError", + ); + }); + }); + describe(".INTERNAL_ERROR", () => { + it("resolves to correct value for INTERNAL_ERROR enum property", () => { + expect(freeclimb.CallEndedReason.INTERNAL_ERROR).toBe("internalError"); + }); + }); + describe(".GRPC_HANGUP", () => { + it("resolves to correct value for GRPC_HANGUP enum property", () => { + expect(freeclimb.CallEndedReason.GRPC_HANGUP).toBe("grpcHangup"); + }); + }); + describe(".MAX_DURATION", () => { + it("resolves to correct value for MAX_DURATION enum property", () => { + expect(freeclimb.CallEndedReason.MAX_DURATION).toBe("maxDuration"); + }); }); }); }); diff --git a/__tests__/models/CallList.spec.ts b/__tests__/models/CallList.spec.ts index 2eebe1a..af402de 100644 --- a/__tests__/models/CallList.spec.ts +++ b/__tests__/models/CallList.spec.ts @@ -2,67 +2,160 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CallList", () => { - let model: freeclimb.CallList = new freeclimb.CallList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - calls: [], - }); - describe("CallList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CallList); + describe("Test with truthy values", () => { + const Klass = freeclimb.CallList; + let model: freeclimb.CallList = new freeclimb.CallList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + calls: [], }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("CallList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CallList); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".calls", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.CallResult[] = []; + expect(model.calls).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.CallList; + let model: freeclimb.CallList = new freeclimb.CallList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + calls: [], + }); + describe("CallList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CallList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".calls", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.CallResult[] = []; + expect(model.calls).toStrictEqual(value); + }); }); }); - describe(".calls", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.CallResult[] = []; - expect(model.calls).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.CallList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.CallList = new freeclimb.CallList( + constructorArguments, + ); + + describe("#calls", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "calls", + )?.defaultValue; + expect(model.calls).toBe(value); + }); }); }); }); diff --git a/__tests__/models/CallResult.spec.ts b/__tests__/models/CallResult.spec.ts index 4fee26f..f9ff925 100644 --- a/__tests__/models/CallResult.spec.ts +++ b/__tests__/models/CallResult.spec.ts @@ -2,156 +2,455 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CallResult", () => { - let model: freeclimb.CallResult = new freeclimb.CallResult({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - callId: "test_callId", - parentCallId: "test_parentCallId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", - phoneNumberId: "test_phoneNumberId", + describe("Test with truthy values", () => { + const Klass = freeclimb.CallResult; + let model: freeclimb.CallResult = new freeclimb.CallResult({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + callId: "test_callId", + parentCallId: "test_parentCallId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", + phoneNumberId: "test_phoneNumberId", - callStatus: freeclimb.CallStatus.QUEUED, - startTime: "test_startTime", - connectTime: "test_connectTime", - endTime: "test_endTime", - duration: 1, - connectDuration: 1, + callStatus: freeclimb.CallStatus.QUEUED, + startTime: "test_startTime", + connectTime: "test_connectTime", + endTime: "test_endTime", + duration: 1, + connectDuration: 1, - direction: freeclimb.CallDirection.INBOUND, + direction: freeclimb.CallDirection.INBOUND, - answeredBy: freeclimb.AnsweredBy.HUMAN, - subresourceUris: {}, + answeredBy: freeclimb.AnsweredBy.HUMAN, + subresourceUris: {}, - applicationId: "test_applicationId", - }); - describe("CallResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CallResult); + applicationId: "test_applicationId", }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("CallResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CallResult); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".phoneNumberId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phoneNumberId"; - expect(model.phoneNumberId).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phoneNumberId"; + expect(model.phoneNumberId).toBe(value); + }); }); - }); - describe(".startTime", () => { - it("resolves to particular value on initialization", () => { - const value = "test_startTime"; - expect(model.startTime).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".connectTime", () => { - it("resolves to particular value on initialization", () => { - const value = "test_connectTime"; - expect(model.connectTime).toBe(value); + describe(".startTime", () => { + it("resolves to particular value on initialization", () => { + const value = "test_startTime"; + expect(model.startTime).toBe(value); + }); }); - }); - describe(".endTime", () => { - it("resolves to particular value on initialization", () => { - const value = "test_endTime"; - expect(model.endTime).toBe(value); + describe(".connectTime", () => { + it("resolves to particular value on initialization", () => { + const value = "test_connectTime"; + expect(model.connectTime).toBe(value); + }); }); - }); - describe(".duration", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.duration).toBe(value); + describe(".endTime", () => { + it("resolves to particular value on initialization", () => { + const value = "test_endTime"; + expect(model.endTime).toBe(value); + }); }); - }); - describe(".connectDuration", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.connectDuration).toBe(value); + describe(".duration", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.duration).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".connectDuration", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.connectDuration).toBe(value); + }); }); - }); - describe(".answeredBy", () => { - it("resolves to particular value on initialization", () => { - const value = "human"; - expect(model.answeredBy).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".answeredBy", () => { + it("resolves to particular value on initialization", () => { + const value = "human"; + expect(model.answeredBy).toBe(value); + }); + }); + describe(".subresourceUris", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); }); }); - describe(".subresourceUris", () => { - it("resolves to particular value on initialization", () => { - const value = {}; - const receivedValue: any = model.subresourceUris; - expect(receivedValue).toStrictEqual(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.CallResult; + let model: freeclimb.CallResult = new freeclimb.CallResult({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + callId: "", + parentCallId: "", + accountId: "", + from: "", + to: "", + phoneNumberId: "", + + callStatus: freeclimb.CallStatus.QUEUED, + startTime: "", + connectTime: "", + endTime: "", + duration: 0, + connectDuration: 0, + + direction: freeclimb.CallDirection.INBOUND, + + answeredBy: freeclimb.AnsweredBy.HUMAN, + subresourceUris: {}, + + applicationId: "", + }); + describe("CallResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CallResult); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".startTime", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.startTime).toBe(value); + }); + }); + describe(".connectTime", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.connectTime).toBe(value); + }); + }); + describe(".endTime", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.endTime).toBe(value); + }); + }); + describe(".duration", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.duration).toBe(value); + }); + }); + describe(".connectDuration", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.connectDuration).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".answeredBy", () => { + it("resolves to particular value on initialization", () => { + const value = "human"; + expect(model.answeredBy).toBe(value); + }); + }); + describe(".subresourceUris", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.applicationId).toBe(value); + }); }); }); - describe(".applicationId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_applicationId"; - expect(model.applicationId).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.CallResult; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.CallResult = new freeclimb.CallResult( + constructorArguments, + ); + + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#phoneNumberId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "phoneNumberId", + )?.defaultValue; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#startTime", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "startTime", + )?.defaultValue; + expect(model.startTime).toBe(value); + }); + }); + describe("#connectTime", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "connectTime", + )?.defaultValue; + expect(model.connectTime).toBe(value); + }); + }); + describe("#endTime", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "endTime", + )?.defaultValue; + expect(model.endTime).toBe(value); + }); + }); + describe("#duration", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "duration", + )?.defaultValue; + expect(model.duration).toBe(value); + }); + }); + describe("#connectDuration", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "connectDuration", + )?.defaultValue; + expect(model.connectDuration).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#answeredBy", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "answeredBy", + )?.defaultValue; + expect(model.answeredBy).toBe(value); + }); + }); + describe("#subresourceUris", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subresourceUris", + )?.defaultValue; + expect(model.subresourceUris).toBe(value); + }); + }); + describe("#applicationId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applicationId", + )?.defaultValue; + expect(model.applicationId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/CallStatus.spec.ts b/__tests__/models/CallStatus.spec.ts index 3fbbbe8..cc6bc0f 100644 --- a/__tests__/models/CallStatus.spec.ts +++ b/__tests__/models/CallStatus.spec.ts @@ -2,44 +2,46 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CallStatus", () => { - describe(".QUEUED", () => { - it("resolves to correct value for QUEUED enum property", () => { - expect(freeclimb.CallStatus.QUEUED).toBe("queued"); - }); - }); - describe(".RINGING", () => { - it("resolves to correct value for RINGING enum property", () => { - expect(freeclimb.CallStatus.RINGING).toBe("ringing"); - }); - }); - describe(".IN_PROGRESS", () => { - it("resolves to correct value for IN_PROGRESS enum property", () => { - expect(freeclimb.CallStatus.IN_PROGRESS).toBe("inProgress"); - }); - }); - describe(".CANCELED", () => { - it("resolves to correct value for CANCELED enum property", () => { - expect(freeclimb.CallStatus.CANCELED).toBe("canceled"); - }); - }); - describe(".COMPLETED", () => { - it("resolves to correct value for COMPLETED enum property", () => { - expect(freeclimb.CallStatus.COMPLETED).toBe("completed"); - }); - }); - describe(".FAILED", () => { - it("resolves to correct value for FAILED enum property", () => { - expect(freeclimb.CallStatus.FAILED).toBe("failed"); - }); - }); - describe(".BUSY", () => { - it("resolves to correct value for BUSY enum property", () => { - expect(freeclimb.CallStatus.BUSY).toBe("busy"); - }); - }); - describe(".NO_ANSWER", () => { - it("resolves to correct value for NO_ANSWER enum property", () => { - expect(freeclimb.CallStatus.NO_ANSWER).toBe("noAnswer"); + describe("Test with truthy values", () => { + describe(".QUEUED", () => { + it("resolves to correct value for QUEUED enum property", () => { + expect(freeclimb.CallStatus.QUEUED).toBe("queued"); + }); + }); + describe(".RINGING", () => { + it("resolves to correct value for RINGING enum property", () => { + expect(freeclimb.CallStatus.RINGING).toBe("ringing"); + }); + }); + describe(".IN_PROGRESS", () => { + it("resolves to correct value for IN_PROGRESS enum property", () => { + expect(freeclimb.CallStatus.IN_PROGRESS).toBe("inProgress"); + }); + }); + describe(".CANCELED", () => { + it("resolves to correct value for CANCELED enum property", () => { + expect(freeclimb.CallStatus.CANCELED).toBe("canceled"); + }); + }); + describe(".COMPLETED", () => { + it("resolves to correct value for COMPLETED enum property", () => { + expect(freeclimb.CallStatus.COMPLETED).toBe("completed"); + }); + }); + describe(".FAILED", () => { + it("resolves to correct value for FAILED enum property", () => { + expect(freeclimb.CallStatus.FAILED).toBe("failed"); + }); + }); + describe(".BUSY", () => { + it("resolves to correct value for BUSY enum property", () => { + expect(freeclimb.CallStatus.BUSY).toBe("busy"); + }); + }); + describe(".NO_ANSWER", () => { + it("resolves to correct value for NO_ANSWER enum property", () => { + expect(freeclimb.CallStatus.NO_ANSWER).toBe("noAnswer"); + }); }); }); }); diff --git a/__tests__/models/CallStatusWebhook.spec.ts b/__tests__/models/CallStatusWebhook.spec.ts index fd8ffa7..7cc05d2 100644 --- a/__tests__/models/CallStatusWebhook.spec.ts +++ b/__tests__/models/CallStatusWebhook.spec.ts @@ -2,94 +2,278 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CallStatusWebhook", () => { - let model: freeclimb.CallStatusWebhook = new freeclimb.CallStatusWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.CallStatusWebhook; + let model: freeclimb.CallStatusWebhook = new freeclimb.CallStatusWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - callEndedReason: freeclimb.CallEndedReason.BUSY, + callEndedReason: freeclimb.CallEndedReason.BUSY, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - }); - describe("CallStatusWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CallStatusWebhook); + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + }); + describe("CallStatusWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CallStatusWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".callEndedReason", () => { - it("resolves to particular value on initialization", () => { - const value = "busy"; - expect(model.callEndedReason).toBe(value); + describe(".callEndedReason", () => { + it("resolves to particular value on initialization", () => { + const value = "busy"; + expect(model.callEndedReason).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of CallStatusWebhook", () => { + expect( + freeclimb.CallStatusWebhook.deserialize( + '{ "requestType": "callStatus"}', + ), + ).toBeInstanceOf(freeclimb.CallStatusWebhook); + }); }); }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.CallStatusWebhook; + let model: freeclimb.CallStatusWebhook = new freeclimb.CallStatusWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, + + callEndedReason: freeclimb.CallEndedReason.BUSY, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + }); + describe("CallStatusWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CallStatusWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".callEndedReason", () => { + it("resolves to particular value on initialization", () => { + const value = "busy"; + expect(model.callEndedReason).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of CallStatusWebhook", () => { + expect( + freeclimb.CallStatusWebhook.deserialize( + '{ "requestType": "callStatus"}', + ), + ).toBeInstanceOf(freeclimb.CallStatusWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of CallStatusWebhook", () => { - expect( - freeclimb.CallStatusWebhook.deserialize( - '{ "requestType": "callStatus"}', - ), - ).toBeInstanceOf(freeclimb.CallStatusWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.CallStatusWebhook; + let constructorArguments = {}; + let model: freeclimb.CallStatusWebhook = new freeclimb.CallStatusWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#callEndedReason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callEndedReason", + )?.defaultValue; + expect(model.callEndedReason).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Capabilities.spec.ts b/__tests__/models/Capabilities.spec.ts index fa0460d..ce35539 100644 --- a/__tests__/models/Capabilities.spec.ts +++ b/__tests__/models/Capabilities.spec.ts @@ -2,46 +2,133 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Capabilities", () => { - let model: freeclimb.Capabilities = new freeclimb.Capabilities({ - voice: true, - sms: true, - tollFree: true, - tenDLC: true, - shortCode: true, - }); - describe("Capabilities class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Capabilities); + describe("Test with truthy values", () => { + const Klass = freeclimb.Capabilities; + let model: freeclimb.Capabilities = new freeclimb.Capabilities({ + voice: true, + sms: true, + tollFree: true, + tenDLC: true, + shortCode: true, }); - }); - describe(".voice", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.voice).toBe(value); + describe("Capabilities class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Capabilities); + }); }); - }); - describe(".sms", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.sms).toBe(value); + describe(".voice", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.voice).toBe(value); + }); }); - }); - describe(".tollFree", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.tollFree).toBe(value); + describe(".sms", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.sms).toBe(value); + }); + }); + describe(".tollFree", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.tollFree).toBe(value); + }); + }); + describe(".tenDLC", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.tenDLC).toBe(value); + }); + }); + describe(".shortCode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.shortCode).toBe(value); + }); }); }); - describe(".tenDLC", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.tenDLC).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.Capabilities; + let model: freeclimb.Capabilities = new freeclimb.Capabilities({ + voice: false, + sms: false, + tollFree: false, + tenDLC: false, + shortCode: false, + }); + describe("Capabilities class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Capabilities); + }); + }); + describe(".voice", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.voice).toBe(value); + }); + }); + describe(".sms", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.sms).toBe(value); + }); + }); + describe(".tollFree", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.tollFree).toBe(value); + }); + }); + describe(".tenDLC", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.tenDLC).toBe(value); + }); + }); + describe(".shortCode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.shortCode).toBe(value); + }); }); }); - describe(".shortCode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.shortCode).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.Capabilities; + let constructorArguments = { + voice: true, + sms: true, + tollFree: true, + tenDLC: true, + shortCode: true, + }; + let model: freeclimb.Capabilities = new freeclimb.Capabilities( + constructorArguments, + ); + + describe("#voice", () => { + it("resolves to initialization value", () => { + expect(model.voice).toBe(constructorArguments["voice"]); + }); + }); + describe("#sms", () => { + it("resolves to initialization value", () => { + expect(model.sms).toBe(constructorArguments["sms"]); + }); + }); + describe("#tollFree", () => { + it("resolves to initialization value", () => { + expect(model.tollFree).toBe(constructorArguments["tollFree"]); + }); + }); + describe("#tenDLC", () => { + it("resolves to initialization value", () => { + expect(model.tenDLC).toBe(constructorArguments["tenDLC"]); + }); + }); + describe("#shortCode", () => { + it("resolves to initialization value", () => { + expect(model.shortCode).toBe(constructorArguments["shortCode"]); + }); }); }); }); diff --git a/__tests__/models/CompletionRequest.spec.ts b/__tests__/models/CompletionRequest.spec.ts index bf41521..506fbd2 100644 --- a/__tests__/models/CompletionRequest.spec.ts +++ b/__tests__/models/CompletionRequest.spec.ts @@ -2,18 +2,53 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CompletionRequest", () => { - let model: freeclimb.CompletionRequest = new freeclimb.CompletionRequest({ - query: "test_query", + describe("Test with truthy values", () => { + const Klass = freeclimb.CompletionRequest; + let model: freeclimb.CompletionRequest = new freeclimb.CompletionRequest({ + query: "test_query", + }); + describe("CompletionRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CompletionRequest); + }); + }); + describe(".query", () => { + it("resolves to particular value on initialization", () => { + const value = "test_query"; + expect(model.query).toBe(value); + }); + }); }); - describe("CompletionRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CompletionRequest); + describe("Test with falsy values", () => { + const Klass = freeclimb.CompletionRequest; + let model: freeclimb.CompletionRequest = new freeclimb.CompletionRequest({ + query: "", + }); + describe("CompletionRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CompletionRequest); + }); + }); + describe(".query", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.query).toBe(value); + }); }); }); - describe(".query", () => { - it("resolves to particular value on initialization", () => { - const value = "test_query"; - expect(model.query).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.CompletionRequest; + let constructorArguments = { + query: "test_query", + }; + let model: freeclimb.CompletionRequest = new freeclimb.CompletionRequest( + constructorArguments, + ); + + describe("#query", () => { + it("resolves to initialization value", () => { + expect(model.query).toBe(constructorArguments["query"]); + }); }); }); }); diff --git a/__tests__/models/CompletionResult.spec.ts b/__tests__/models/CompletionResult.spec.ts index 3c6ba26..b2d9ab9 100644 --- a/__tests__/models/CompletionResult.spec.ts +++ b/__tests__/models/CompletionResult.spec.ts @@ -2,26 +2,76 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CompletionResult", () => { - let model: freeclimb.CompletionResult = new freeclimb.CompletionResult({ - response: "test_response", + describe("Test with truthy values", () => { + const Klass = freeclimb.CompletionResult; + let model: freeclimb.CompletionResult = new freeclimb.CompletionResult({ + response: "test_response", - status: freeclimb.CompletionResultStatus.SUCCESS, - }); - describe("CompletionResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CompletionResult); + status: freeclimb.CompletionResultStatus.SUCCESS, + }); + describe("CompletionResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CompletionResult); + }); + }); + describe(".response", () => { + it("resolves to particular value on initialization", () => { + const value = "test_response"; + expect(model.response).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "success"; + expect(model.status).toBe(value); + }); }); }); - describe(".response", () => { - it("resolves to particular value on initialization", () => { - const value = "test_response"; - expect(model.response).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.CompletionResult; + let model: freeclimb.CompletionResult = new freeclimb.CompletionResult({ + response: "", + + status: freeclimb.CompletionResultStatus.SUCCESS, + }); + describe("CompletionResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CompletionResult); + }); + }); + describe(".response", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.response).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "success"; + expect(model.status).toBe(value); + }); }); }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "success"; - expect(model.status).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.CompletionResult; + let constructorArguments = { + response: "test_response", + + status: freeclimb.CompletionResultStatus.SUCCESS, + }; + let model: freeclimb.CompletionResult = new freeclimb.CompletionResult( + constructorArguments, + ); + + describe("#response", () => { + it("resolves to initialization value", () => { + expect(model.response).toBe(constructorArguments["response"]); + }); + }); + describe("#status", () => { + it("resolves to initialization value", () => { + expect(model.status).toBe(constructorArguments["status"]); + }); }); }); }); diff --git a/__tests__/models/CompletionResultStatus.spec.ts b/__tests__/models/CompletionResultStatus.spec.ts index 420d6cf..03d3cc5 100644 --- a/__tests__/models/CompletionResultStatus.spec.ts +++ b/__tests__/models/CompletionResultStatus.spec.ts @@ -2,14 +2,16 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CompletionResultStatus", () => { - describe(".SUCCESS", () => { - it("resolves to correct value for SUCCESS enum property", () => { - expect(freeclimb.CompletionResultStatus.SUCCESS).toBe("success"); + describe("Test with truthy values", () => { + describe(".SUCCESS", () => { + it("resolves to correct value for SUCCESS enum property", () => { + expect(freeclimb.CompletionResultStatus.SUCCESS).toBe("success"); + }); }); - }); - describe(".NO_CONTEXT", () => { - it("resolves to correct value for NO_CONTEXT enum property", () => { - expect(freeclimb.CompletionResultStatus.NO_CONTEXT).toBe("no_context"); + describe(".NO_CONTEXT", () => { + it("resolves to correct value for NO_CONTEXT enum property", () => { + expect(freeclimb.CompletionResultStatus.NO_CONTEXT).toBe("no_context"); + }); }); }); }); diff --git a/__tests__/models/ConferenceList.spec.ts b/__tests__/models/ConferenceList.spec.ts index 6ffe04c..141dd6c 100644 --- a/__tests__/models/ConferenceList.spec.ts +++ b/__tests__/models/ConferenceList.spec.ts @@ -2,67 +2,160 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ConferenceList", () => { - let model: freeclimb.ConferenceList = new freeclimb.ConferenceList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - conferences: [], - }); - describe("ConferenceList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.ConferenceList); + describe("Test with truthy values", () => { + const Klass = freeclimb.ConferenceList; + let model: freeclimb.ConferenceList = new freeclimb.ConferenceList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + conferences: [], }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("ConferenceList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceList); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".conferences", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.ConferenceResult[] = []; + expect(model.conferences).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.ConferenceList; + let model: freeclimb.ConferenceList = new freeclimb.ConferenceList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + conferences: [], + }); + describe("ConferenceList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".conferences", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.ConferenceResult[] = []; + expect(model.conferences).toStrictEqual(value); + }); }); }); - describe(".conferences", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.ConferenceResult[] = []; - expect(model.conferences).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.ConferenceList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.ConferenceList = new freeclimb.ConferenceList( + constructorArguments, + ); + + describe("#conferences", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferences", + )?.defaultValue; + expect(model.conferences).toBe(value); + }); }); }); }); diff --git a/__tests__/models/ConferenceParticipantList.spec.ts b/__tests__/models/ConferenceParticipantList.spec.ts index a6075b1..a248c46 100644 --- a/__tests__/models/ConferenceParticipantList.spec.ts +++ b/__tests__/models/ConferenceParticipantList.spec.ts @@ -2,68 +2,161 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ConferenceParticipantList", () => { - let model: freeclimb.ConferenceParticipantList = - new freeclimb.ConferenceParticipantList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - participants: [], + describe("Test with truthy values", () => { + const Klass = freeclimb.ConferenceParticipantList; + let model: freeclimb.ConferenceParticipantList = + new freeclimb.ConferenceParticipantList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + participants: [], + }); + describe("ConferenceParticipantList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantList); + }); }); - describe("ConferenceParticipantList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantList); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".participants", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.ConferenceParticipantResult[] = []; + expect(model.participants).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.ConferenceParticipantList; + let model: freeclimb.ConferenceParticipantList = + new freeclimb.ConferenceParticipantList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + participants: [], + }); + describe("ConferenceParticipantList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".participants", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.ConferenceParticipantResult[] = []; + expect(model.participants).toStrictEqual(value); + }); }); }); - describe(".participants", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.ConferenceParticipantResult[] = []; - expect(model.participants).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.ConferenceParticipantList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.ConferenceParticipantList = + new freeclimb.ConferenceParticipantList(constructorArguments); + + describe("#participants", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "participants", + )?.defaultValue; + expect(model.participants).toBe(value); + }); }); }); }); diff --git a/__tests__/models/ConferenceParticipantResult.spec.ts b/__tests__/models/ConferenceParticipantResult.spec.ts index 7850e23..f6a848a 100644 --- a/__tests__/models/ConferenceParticipantResult.spec.ts +++ b/__tests__/models/ConferenceParticipantResult.spec.ts @@ -2,89 +2,248 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ConferenceParticipantResult", () => { - let model: freeclimb.ConferenceParticipantResult = - new freeclimb.ConferenceParticipantResult({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - accountId: "test_accountId", - conferenceId: "test_conferenceId", - callId: "test_callId", - talk: true, - listen: true, - dtmfPassThrough: true, - startConfOnEnter: true, - }); - describe("ConferenceParticipantResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantResult); + describe("Test with truthy values", () => { + const Klass = freeclimb.ConferenceParticipantResult; + let model: freeclimb.ConferenceParticipantResult = + new freeclimb.ConferenceParticipantResult({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + accountId: "test_accountId", + conferenceId: "test_conferenceId", + callId: "test_callId", + talk: true, + listen: true, + dtmfPassThrough: true, + startConfOnEnter: true, + }); + describe("ConferenceParticipantResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantResult); + }); }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".talk", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.talk).toBe(value); + describe(".talk", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.talk).toBe(value); + }); }); - }); - describe(".listen", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.listen).toBe(value); + describe(".listen", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.listen).toBe(value); + }); + }); + describe(".dtmfPassThrough", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.dtmfPassThrough).toBe(value); + }); + }); + describe(".startConfOnEnter", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.startConfOnEnter).toBe(value); + }); }); }); - describe(".dtmfPassThrough", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.dtmfPassThrough).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.ConferenceParticipantResult; + let model: freeclimb.ConferenceParticipantResult = + new freeclimb.ConferenceParticipantResult({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + accountId: "", + conferenceId: "", + callId: "", + talk: false, + listen: false, + dtmfPassThrough: false, + startConfOnEnter: false, + }); + describe("ConferenceParticipantResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantResult); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".talk", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.talk).toBe(value); + }); + }); + describe(".listen", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.listen).toBe(value); + }); + }); + describe(".dtmfPassThrough", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.dtmfPassThrough).toBe(value); + }); + }); + describe(".startConfOnEnter", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.startConfOnEnter).toBe(value); + }); }); }); - describe(".startConfOnEnter", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.startConfOnEnter).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.ConferenceParticipantResult; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.ConferenceParticipantResult = + new freeclimb.ConferenceParticipantResult(constructorArguments); + + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#talk", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "talk", + )?.defaultValue; + expect(model.talk).toBe(value); + }); + }); + describe("#listen", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "listen", + )?.defaultValue; + expect(model.listen).toBe(value); + }); + }); + describe("#dtmfPassThrough", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "dtmfPassThrough", + )?.defaultValue; + expect(model.dtmfPassThrough).toBe(value); + }); + }); + describe("#startConfOnEnter", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "startConfOnEnter", + )?.defaultValue; + expect(model.startConfOnEnter).toBe(value); + }); }); }); }); diff --git a/__tests__/models/ConferenceRecordingStatusWebhook.spec.ts b/__tests__/models/ConferenceRecordingStatusWebhook.spec.ts index 51d3cd8..1136b42 100644 --- a/__tests__/models/ConferenceRecordingStatusWebhook.spec.ts +++ b/__tests__/models/ConferenceRecordingStatusWebhook.spec.ts @@ -2,116 +2,349 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ConferenceRecordingStatusWebhook", () => { - let model: freeclimb.ConferenceRecordingStatusWebhook = - new freeclimb.ConferenceRecordingStatusWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.ConferenceRecordingStatusWebhook; + let model: freeclimb.ConferenceRecordingStatusWebhook = + new freeclimb.ConferenceRecordingStatusWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", - status: freeclimb.ConferenceStatus.EMPTY, - recordingUrl: "https://123.abc", - recordingId: "test_recordingId", - recordingDurationSec: 1, + status: freeclimb.ConferenceStatus.EMPTY, + recordingUrl: "https://123.abc", + recordingId: "test_recordingId", + recordingDurationSec: 1, + }); + describe("ConferenceRecordingStatusWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.ConferenceRecordingStatusWebhook, + ); + }); }); - describe("ConferenceRecordingStatusWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.ConferenceRecordingStatusWebhook); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); + }); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.recordingUrl).toBe(value); + }); + }); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingId"; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of ConferenceRecordingStatusWebhook", () => { + expect( + freeclimb.ConferenceRecordingStatusWebhook.deserialize( + '{ "requestType": "conferenceRecordingStatus"}', + ), + ).toBeInstanceOf(freeclimb.ConferenceRecordingStatusWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.ConferenceRecordingStatusWebhook; + let model: freeclimb.ConferenceRecordingStatusWebhook = + new freeclimb.ConferenceRecordingStatusWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + + status: freeclimb.ConferenceStatus.EMPTY, + recordingUrl: "", + recordingId: "", + recordingDurationSec: 0, + }); + describe("ConferenceRecordingStatusWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.ConferenceRecordingStatusWebhook, + ); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "empty"; - expect(model.status).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".recordingUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.recordingUrl).toBe(value); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); }); - }); - describe(".recordingId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingId"; - expect(model.recordingId).toBe(value); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingUrl).toBe(value); + }); }); - }); - describe(".recordingDurationSec", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.recordingDurationSec).toBe(value); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of ConferenceRecordingStatusWebhook", () => { + expect( + freeclimb.ConferenceRecordingStatusWebhook.deserialize( + '{ "requestType": "conferenceRecordingStatus"}', + ), + ).toBeInstanceOf(freeclimb.ConferenceRecordingStatusWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of ConferenceRecordingStatusWebhook", () => { - expect( - freeclimb.ConferenceRecordingStatusWebhook.deserialize( - '{ "requestType": "conferenceRecordingStatus"}', - ), - ).toBeInstanceOf(freeclimb.ConferenceRecordingStatusWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.ConferenceRecordingStatusWebhook; + let constructorArguments = {}; + let model: freeclimb.ConferenceRecordingStatusWebhook = + new freeclimb.ConferenceRecordingStatusWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#recordingUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingUrl", + )?.defaultValue; + expect(model.recordingUrl).toBe(value); + }); + }); + describe("#recordingId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingId", + )?.defaultValue; + expect(model.recordingId).toBe(value); + }); + }); + describe("#recordingDurationSec", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingDurationSec", + )?.defaultValue; + expect(model.recordingDurationSec).toBe(value); + }); }); }); }); diff --git a/__tests__/models/ConferenceResult.spec.ts b/__tests__/models/ConferenceResult.spec.ts index c23dd27..05fac0e 100644 --- a/__tests__/models/ConferenceResult.spec.ts +++ b/__tests__/models/ConferenceResult.spec.ts @@ -2,112 +2,319 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ConferenceResult", () => { - let model: freeclimb.ConferenceResult = new freeclimb.ConferenceResult({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - conferenceId: "test_conferenceId", - accountId: "test_accountId", - alias: "test_alias", + describe("Test with truthy values", () => { + const Klass = freeclimb.ConferenceResult; + let model: freeclimb.ConferenceResult = new freeclimb.ConferenceResult({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + conferenceId: "test_conferenceId", + accountId: "test_accountId", + alias: "test_alias", - playBeep: freeclimb.PlayBeep.ALWAYS, - record: true, + playBeep: freeclimb.PlayBeep.ALWAYS, + record: true, - status: freeclimb.ConferenceStatus.EMPTY, - waitUrl: "https://123.abc", - actionUrl: "https://123.abc", - statusCallbackUrl: "https://123.abc", - subresourceUris: {}, - }); - describe("ConferenceResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.ConferenceResult); + status: freeclimb.ConferenceStatus.EMPTY, + waitUrl: "https://123.abc", + actionUrl: "https://123.abc", + statusCallbackUrl: "https://123.abc", + subresourceUris: {}, }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("ConferenceResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceResult); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".playBeep", () => { - it("resolves to particular value on initialization", () => { - const value = "always"; - expect(model.playBeep).toBe(value); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); }); - }); - describe(".record", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.record).toBe(value); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = "always"; + expect(model.playBeep).toBe(value); + }); }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "empty"; - expect(model.status).toBe(value); + describe(".record", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.record).toBe(value); + }); }); - }); - describe(".waitUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.waitUrl).toBe(value); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); }); - }); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.waitUrl).toBe(value); + }); + }); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".subresourceUris", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); + }); }); }); - describe(".statusCallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.statusCallbackUrl).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.ConferenceResult; + let model: freeclimb.ConferenceResult = new freeclimb.ConferenceResult({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + conferenceId: "", + accountId: "", + alias: "", + + playBeep: freeclimb.PlayBeep.ALWAYS, + record: false, + + status: freeclimb.ConferenceStatus.EMPTY, + waitUrl: "", + actionUrl: "", + statusCallbackUrl: "", + subresourceUris: {}, + }); + describe("ConferenceResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceResult); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = "always"; + expect(model.playBeep).toBe(value); + }); + }); + describe(".record", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.record).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); + }); + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.waitUrl).toBe(value); + }); + }); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".subresourceUris", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); + }); }); }); - describe(".subresourceUris", () => { - it("resolves to particular value on initialization", () => { - const value = {}; - const receivedValue: any = model.subresourceUris; - expect(receivedValue).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.ConferenceResult; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.ConferenceResult = new freeclimb.ConferenceResult( + constructorArguments, + ); + + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#playBeep", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "playBeep", + )?.defaultValue; + expect(model.playBeep).toBe(value); + }); + }); + describe("#record", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "record", + )?.defaultValue; + expect(model.record).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#waitUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "waitUrl", + )?.defaultValue; + expect(model.waitUrl).toBe(value); + }); + }); + describe("#actionUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "actionUrl", + )?.defaultValue; + expect(model.actionUrl).toBe(value); + }); + }); + describe("#statusCallbackUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "statusCallbackUrl", + )?.defaultValue; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe("#subresourceUris", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subresourceUris", + )?.defaultValue; + expect(model.subresourceUris).toBe(value); + }); }); }); }); diff --git a/__tests__/models/ConferenceStatus.spec.ts b/__tests__/models/ConferenceStatus.spec.ts index 9d31700..af2d1b5 100644 --- a/__tests__/models/ConferenceStatus.spec.ts +++ b/__tests__/models/ConferenceStatus.spec.ts @@ -2,24 +2,26 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ConferenceStatus", () => { - describe(".EMPTY", () => { - it("resolves to correct value for EMPTY enum property", () => { - expect(freeclimb.ConferenceStatus.EMPTY).toBe("empty"); + describe("Test with truthy values", () => { + describe(".EMPTY", () => { + it("resolves to correct value for EMPTY enum property", () => { + expect(freeclimb.ConferenceStatus.EMPTY).toBe("empty"); + }); }); - }); - describe(".POPULATED", () => { - it("resolves to correct value for POPULATED enum property", () => { - expect(freeclimb.ConferenceStatus.POPULATED).toBe("populated"); + describe(".POPULATED", () => { + it("resolves to correct value for POPULATED enum property", () => { + expect(freeclimb.ConferenceStatus.POPULATED).toBe("populated"); + }); }); - }); - describe(".IN_PROGRESS", () => { - it("resolves to correct value for IN_PROGRESS enum property", () => { - expect(freeclimb.ConferenceStatus.IN_PROGRESS).toBe("inProgress"); + describe(".IN_PROGRESS", () => { + it("resolves to correct value for IN_PROGRESS enum property", () => { + expect(freeclimb.ConferenceStatus.IN_PROGRESS).toBe("inProgress"); + }); }); - }); - describe(".TERMINATED", () => { - it("resolves to correct value for TERMINATED enum property", () => { - expect(freeclimb.ConferenceStatus.TERMINATED).toBe("terminated"); + describe(".TERMINATED", () => { + it("resolves to correct value for TERMINATED enum property", () => { + expect(freeclimb.ConferenceStatus.TERMINATED).toBe("terminated"); + }); }); }); }); diff --git a/__tests__/models/ConferenceStatusWebhook.spec.ts b/__tests__/models/ConferenceStatusWebhook.spec.ts index 92a96fe..61e3db2 100644 --- a/__tests__/models/ConferenceStatusWebhook.spec.ts +++ b/__tests__/models/ConferenceStatusWebhook.spec.ts @@ -2,116 +2,345 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("ConferenceStatusWebhook", () => { - let model: freeclimb.ConferenceStatusWebhook = - new freeclimb.ConferenceStatusWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.ConferenceStatusWebhook; + let model: freeclimb.ConferenceStatusWebhook = + new freeclimb.ConferenceStatusWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", - status: freeclimb.ConferenceStatus.EMPTY, - recordingUrl: "https://123.abc", - recordingId: "test_recordingId", - recordingDurationSec: 1, + status: freeclimb.ConferenceStatus.EMPTY, + recordingUrl: "https://123.abc", + recordingId: "test_recordingId", + recordingDurationSec: 1, + }); + describe("ConferenceStatusWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceStatusWebhook); + }); }); - describe("ConferenceStatusWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.ConferenceStatusWebhook); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); + }); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.recordingUrl).toBe(value); + }); + }); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingId"; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of ConferenceStatusWebhook", () => { + expect( + freeclimb.ConferenceStatusWebhook.deserialize( + '{ "requestType": "conferenceStatus"}', + ), + ).toBeInstanceOf(freeclimb.ConferenceStatusWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.ConferenceStatusWebhook; + let model: freeclimb.ConferenceStatusWebhook = + new freeclimb.ConferenceStatusWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + + status: freeclimb.ConferenceStatus.EMPTY, + recordingUrl: "", + recordingId: "", + recordingDurationSec: 0, + }); + describe("ConferenceStatusWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.ConferenceStatusWebhook); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "empty"; - expect(model.status).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".recordingUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.recordingUrl).toBe(value); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); }); - }); - describe(".recordingId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingId"; - expect(model.recordingId).toBe(value); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingUrl).toBe(value); + }); }); - }); - describe(".recordingDurationSec", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.recordingDurationSec).toBe(value); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of ConferenceStatusWebhook", () => { + expect( + freeclimb.ConferenceStatusWebhook.deserialize( + '{ "requestType": "conferenceStatus"}', + ), + ).toBeInstanceOf(freeclimb.ConferenceStatusWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of ConferenceStatusWebhook", () => { - expect( - freeclimb.ConferenceStatusWebhook.deserialize( - '{ "requestType": "conferenceStatus"}', - ), - ).toBeInstanceOf(freeclimb.ConferenceStatusWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.ConferenceStatusWebhook; + let constructorArguments = {}; + let model: freeclimb.ConferenceStatusWebhook = + new freeclimb.ConferenceStatusWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#recordingUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingUrl", + )?.defaultValue; + expect(model.recordingUrl).toBe(value); + }); + }); + describe("#recordingId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingId", + )?.defaultValue; + expect(model.recordingId).toBe(value); + }); + }); + describe("#recordingDurationSec", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingDurationSec", + )?.defaultValue; + expect(model.recordingDurationSec).toBe(value); + }); }); }); }); diff --git a/__tests__/models/CreateConference.spec.ts b/__tests__/models/CreateConference.spec.ts index 3e686f5..ebcb5c8 100644 --- a/__tests__/models/CreateConference.spec.ts +++ b/__tests__/models/CreateConference.spec.ts @@ -2,55 +2,167 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CreateConference", () => { - let model: freeclimb.CreateConference = new freeclimb.CreateConference({ - actionUrl: "https://123.abc", - alias: true, + describe("Test with truthy values", () => { + const Klass = freeclimb.CreateConference; + let model: freeclimb.CreateConference = new freeclimb.CreateConference({ + actionUrl: "https://123.abc", + alias: true, - playBeep: freeclimb.PlayBeep.ALWAYS, - record: true, - statusCallbackUrl: "https://123.abc", - waitUrl: "https://123.abc", - }); - describe("CreateConference class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CreateConference); + playBeep: freeclimb.PlayBeep.ALWAYS, + record: true, + statusCallbackUrl: "https://123.abc", + waitUrl: "https://123.abc", + }); + describe("CreateConference class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CreateConference); + }); }); - }); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); }); - }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.alias).toBe(value); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.alias).toBe(value); + }); }); - }); - describe(".playBeep", () => { - it("resolves to particular value on initialization", () => { - const value = "always"; - expect(model.playBeep).toBe(value); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = "always"; + expect(model.playBeep).toBe(value); + }); }); - }); - describe(".record", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.record).toBe(value); + describe(".record", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.record).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.waitUrl).toBe(value); + }); }); }); - describe(".statusCallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.statusCallbackUrl).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.CreateConference; + let model: freeclimb.CreateConference = new freeclimb.CreateConference({ + actionUrl: "", + alias: false, + + playBeep: freeclimb.PlayBeep.ALWAYS, + record: false, + statusCallbackUrl: "", + waitUrl: "", + }); + describe("CreateConference class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CreateConference); + }); + }); + + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.alias).toBe(value); + }); + }); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = "always"; + expect(model.playBeep).toBe(value); + }); + }); + describe(".record", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.record).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.waitUrl).toBe(value); + }); }); }); - describe(".waitUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.waitUrl).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.CreateConference; + let constructorArguments = { + actionUrl: "https://123.abc", + }; + let model: freeclimb.CreateConference = new freeclimb.CreateConference( + constructorArguments, + ); + + describe("#actionUrl", () => { + it("resolves to initialization value", () => { + expect(model.actionUrl).toBe(constructorArguments["actionUrl"]); + }); + }); + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#playBeep", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "playBeep", + )?.defaultValue; + expect(model.playBeep).toBe(value); + }); + }); + describe("#record", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "record", + )?.defaultValue; + expect(model.record).toBe(value); + }); + }); + describe("#statusCallbackUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "statusCallbackUrl", + )?.defaultValue; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe("#waitUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "waitUrl", + )?.defaultValue; + expect(model.waitUrl).toBe(value); + }); }); }); }); diff --git a/__tests__/models/CreateConferenceRequest.spec.ts b/__tests__/models/CreateConferenceRequest.spec.ts index aabd512..52b27bf 100644 --- a/__tests__/models/CreateConferenceRequest.spec.ts +++ b/__tests__/models/CreateConferenceRequest.spec.ts @@ -2,48 +2,146 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CreateConferenceRequest", () => { - let model: freeclimb.CreateConferenceRequest = - new freeclimb.CreateConferenceRequest({ - alias: "test_alias", + describe("Test with truthy values", () => { + const Klass = freeclimb.CreateConferenceRequest; + let model: freeclimb.CreateConferenceRequest = + new freeclimb.CreateConferenceRequest({ + alias: "test_alias", - playBeep: freeclimb.PlayBeep.ALWAYS, - record: true, - waitUrl: "https://123.abc", - statusCallbackUrl: "https://123.abc", + playBeep: freeclimb.PlayBeep.ALWAYS, + record: true, + waitUrl: "https://123.abc", + statusCallbackUrl: "https://123.abc", + }); + describe("CreateConferenceRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CreateConferenceRequest); + }); }); - describe("CreateConferenceRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CreateConferenceRequest); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); }); - }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = "always"; + expect(model.playBeep).toBe(value); + }); }); - }); - describe(".playBeep", () => { - it("resolves to particular value on initialization", () => { - const value = "always"; - expect(model.playBeep).toBe(value); + describe(".record", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.record).toBe(value); + }); }); - }); - describe(".record", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.record).toBe(value); + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.waitUrl).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.statusCallbackUrl).toBe(value); + }); }); }); - describe(".waitUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.waitUrl).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.CreateConferenceRequest; + let model: freeclimb.CreateConferenceRequest = + new freeclimb.CreateConferenceRequest({ + alias: "", + + playBeep: freeclimb.PlayBeep.ALWAYS, + record: false, + waitUrl: "", + statusCallbackUrl: "", + }); + describe("CreateConferenceRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CreateConferenceRequest); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = "always"; + expect(model.playBeep).toBe(value); + }); + }); + describe(".record", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.record).toBe(value); + }); + }); + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.waitUrl).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.statusCallbackUrl).toBe(value); + }); }); }); - describe(".statusCallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.statusCallbackUrl).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.CreateConferenceRequest; + let constructorArguments = { + statusCallbackUrl: "https://123.abc", + }; + let model: freeclimb.CreateConferenceRequest = + new freeclimb.CreateConferenceRequest(constructorArguments); + + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#playBeep", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "playBeep", + )?.defaultValue; + expect(model.playBeep).toBe(value); + }); + }); + describe("#record", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "record", + )?.defaultValue; + expect(model.record).toBe(value); + }); + }); + describe("#waitUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "waitUrl", + )?.defaultValue; + expect(model.waitUrl).toBe(value); + }); + }); + describe("#statusCallbackUrl", () => { + it("resolves to initialization value", () => { + expect(model.statusCallbackUrl).toBe( + constructorArguments["statusCallbackUrl"], + ); + }); }); }); }); diff --git a/__tests__/models/CreateConferenceWebhook.spec.ts b/__tests__/models/CreateConferenceWebhook.spec.ts index 573e7c1..bcd798d 100644 --- a/__tests__/models/CreateConferenceWebhook.spec.ts +++ b/__tests__/models/CreateConferenceWebhook.spec.ts @@ -2,116 +2,345 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CreateConferenceWebhook", () => { - let model: freeclimb.CreateConferenceWebhook = - new freeclimb.CreateConferenceWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.CreateConferenceWebhook; + let model: freeclimb.CreateConferenceWebhook = + new freeclimb.CreateConferenceWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", - status: freeclimb.ConferenceStatus.EMPTY, - recordingUrl: "https://123.abc", - recordingId: "test_recordingId", - recordingDurationSec: 1, + status: freeclimb.ConferenceStatus.EMPTY, + recordingUrl: "https://123.abc", + recordingId: "test_recordingId", + recordingDurationSec: 1, + }); + describe("CreateConferenceWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CreateConferenceWebhook); + }); }); - describe("CreateConferenceWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CreateConferenceWebhook); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); + }); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.recordingUrl).toBe(value); + }); + }); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingId"; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of CreateConferenceWebhook", () => { + expect( + freeclimb.CreateConferenceWebhook.deserialize( + '{ "requestType": "createConference"}', + ), + ).toBeInstanceOf(freeclimb.CreateConferenceWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.CreateConferenceWebhook; + let model: freeclimb.CreateConferenceWebhook = + new freeclimb.CreateConferenceWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + + status: freeclimb.ConferenceStatus.EMPTY, + recordingUrl: "", + recordingId: "", + recordingDurationSec: 0, + }); + describe("CreateConferenceWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CreateConferenceWebhook); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "empty"; - expect(model.status).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".recordingUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.recordingUrl).toBe(value); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); }); - }); - describe(".recordingId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingId"; - expect(model.recordingId).toBe(value); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingUrl).toBe(value); + }); }); - }); - describe(".recordingDurationSec", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.recordingDurationSec).toBe(value); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of CreateConferenceWebhook", () => { + expect( + freeclimb.CreateConferenceWebhook.deserialize( + '{ "requestType": "createConference"}', + ), + ).toBeInstanceOf(freeclimb.CreateConferenceWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of CreateConferenceWebhook", () => { - expect( - freeclimb.CreateConferenceWebhook.deserialize( - '{ "requestType": "createConference"}', - ), - ).toBeInstanceOf(freeclimb.CreateConferenceWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.CreateConferenceWebhook; + let constructorArguments = {}; + let model: freeclimb.CreateConferenceWebhook = + new freeclimb.CreateConferenceWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#recordingUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingUrl", + )?.defaultValue; + expect(model.recordingUrl).toBe(value); + }); + }); + describe("#recordingId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingId", + )?.defaultValue; + expect(model.recordingId).toBe(value); + }); + }); + describe("#recordingDurationSec", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingDurationSec", + )?.defaultValue; + expect(model.recordingDurationSec).toBe(value); + }); }); }); }); diff --git a/__tests__/models/CreateWebRTCToken.spec.ts b/__tests__/models/CreateWebRTCToken.spec.ts index 74e8e2a..915d31e 100644 --- a/__tests__/models/CreateWebRTCToken.spec.ts +++ b/__tests__/models/CreateWebRTCToken.spec.ts @@ -2,32 +2,93 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("CreateWebRTCToken", () => { - let model: freeclimb.CreateWebRTCToken = new freeclimb.CreateWebRTCToken({ - to: "test_to", - from: "test_from", - uses: 1, - }); - describe("CreateWebRTCToken class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.CreateWebRTCToken); + describe("Test with truthy values", () => { + const Klass = freeclimb.CreateWebRTCToken; + let model: freeclimb.CreateWebRTCToken = new freeclimb.CreateWebRTCToken({ + to: "test_to", + from: "test_from", + uses: 1, }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe("CreateWebRTCToken class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CreateWebRTCToken); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".uses", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.uses).toBe(value); + }); }); }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.CreateWebRTCToken; + let model: freeclimb.CreateWebRTCToken = new freeclimb.CreateWebRTCToken({ + to: "", + from: "", + uses: 0, + }); + describe("CreateWebRTCToken class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.CreateWebRTCToken); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".uses", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.uses).toBe(value); + }); }); }); - describe(".uses", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.uses).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.CreateWebRTCToken; + let constructorArguments = { + to: "test_to", + from: "test_from", + uses: 1, + }; + let model: freeclimb.CreateWebRTCToken = new freeclimb.CreateWebRTCToken( + constructorArguments, + ); + + describe("#to", () => { + it("resolves to initialization value", () => { + expect(model.to).toBe(constructorArguments["to"]); + }); + }); + describe("#from", () => { + it("resolves to initialization value", () => { + expect(model.from).toBe(constructorArguments["from"]); + }); + }); + describe("#uses", () => { + it("resolves to initialization value", () => { + expect(model.uses).toBe(constructorArguments["uses"]); + }); }); }); }); diff --git a/__tests__/models/Dequeue.spec.ts b/__tests__/models/Dequeue.spec.ts index 4a2e5eb..226c213 100644 --- a/__tests__/models/Dequeue.spec.ts +++ b/__tests__/models/Dequeue.spec.ts @@ -2,10 +2,27 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Dequeue", () => { - let model: freeclimb.Dequeue = new freeclimb.Dequeue({}); - describe("Dequeue class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Dequeue); + describe("Test with truthy values", () => { + const Klass = freeclimb.Dequeue; + let model: freeclimb.Dequeue = new freeclimb.Dequeue({}); + describe("Dequeue class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Dequeue); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.Dequeue; + let model: freeclimb.Dequeue = new freeclimb.Dequeue({}); + describe("Dequeue class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Dequeue); + }); + }); + }); + describe("Test with only required values", () => { + const Klass = freeclimb.Dequeue; + let constructorArguments = {}; + let model: freeclimb.Dequeue = new freeclimb.Dequeue(constructorArguments); + }); }); diff --git a/__tests__/models/DequeueWebhook.spec.ts b/__tests__/models/DequeueWebhook.spec.ts index ef3fd86..bed2389 100644 --- a/__tests__/models/DequeueWebhook.spec.ts +++ b/__tests__/models/DequeueWebhook.spec.ts @@ -2,98 +2,294 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("DequeueWebhook", () => { - let model: freeclimb.DequeueWebhook = new freeclimb.DequeueWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.DequeueWebhook; + let model: freeclimb.DequeueWebhook = new freeclimb.DequeueWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - queueResult: "test_queueResult", - queueTime: 1, - }); - describe("DequeueWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.DequeueWebhook); + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + queueResult: "test_queueResult", + queueTime: 1, + }); + describe("DequeueWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.DequeueWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".queueResult", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueResult"; - expect(model.queueResult).toBe(value); + describe(".queueResult", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueResult"; + expect(model.queueResult).toBe(value); + }); + }); + describe(".queueTime", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.queueTime).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of DequeueWebhook", () => { + expect( + freeclimb.DequeueWebhook.deserialize('{ "requestType": "dequeue"}'), + ).toBeInstanceOf(freeclimb.DequeueWebhook); + }); }); }); - describe(".queueTime", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.queueTime).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.DequeueWebhook; + let model: freeclimb.DequeueWebhook = new freeclimb.DequeueWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + queueResult: "", + queueTime: 0, + }); + describe("DequeueWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.DequeueWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".queueResult", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueResult).toBe(value); + }); + }); + describe(".queueTime", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.queueTime).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of DequeueWebhook", () => { + expect( + freeclimb.DequeueWebhook.deserialize('{ "requestType": "dequeue"}'), + ).toBeInstanceOf(freeclimb.DequeueWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of DequeueWebhook", () => { - expect( - freeclimb.DequeueWebhook.deserialize('{ "requestType": "dequeue"}'), - ).toBeInstanceOf(freeclimb.DequeueWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.DequeueWebhook; + let constructorArguments = {}; + let model: freeclimb.DequeueWebhook = new freeclimb.DequeueWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#queueResult", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueResult", + )?.defaultValue; + expect(model.queueResult).toBe(value); + }); + }); + describe("#queueTime", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueTime", + )?.defaultValue; + expect(model.queueTime).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Enqueue.spec.ts b/__tests__/models/Enqueue.spec.ts index c07b61b..c5f95f1 100644 --- a/__tests__/models/Enqueue.spec.ts +++ b/__tests__/models/Enqueue.spec.ts @@ -2,40 +2,115 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Enqueue", () => { - let model: freeclimb.Enqueue = new freeclimb.Enqueue({ - actionUrl: "https://123.abc", - notificationUrl: "https://123.abc", - queueId: "test_queueId", - waitUrl: "https://123.abc", - }); - describe("Enqueue class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Enqueue); + describe("Test with truthy values", () => { + const Klass = freeclimb.Enqueue; + let model: freeclimb.Enqueue = new freeclimb.Enqueue({ + actionUrl: "https://123.abc", + notificationUrl: "https://123.abc", + queueId: "test_queueId", + waitUrl: "https://123.abc", + }); + describe("Enqueue class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Enqueue); + }); }); - }); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); }); - }); - describe(".notificationUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.notificationUrl).toBe(value); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.notificationUrl).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.waitUrl).toBe(value); + }); }); }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.Enqueue; + let model: freeclimb.Enqueue = new freeclimb.Enqueue({ + actionUrl: "", + notificationUrl: "", + queueId: "", + waitUrl: "", + }); + describe("Enqueue class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Enqueue); + }); + }); + + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.notificationUrl).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.waitUrl).toBe(value); + }); }); }); - describe(".waitUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.waitUrl).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.Enqueue; + let constructorArguments = { + actionUrl: "https://123.abc", + queueId: "test_queueId", + waitUrl: "https://123.abc", + }; + let model: freeclimb.Enqueue = new freeclimb.Enqueue(constructorArguments); + + describe("#actionUrl", () => { + it("resolves to initialization value", () => { + expect(model.actionUrl).toBe(constructorArguments["actionUrl"]); + }); + }); + describe("#notificationUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "notificationUrl", + )?.defaultValue; + expect(model.notificationUrl).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to initialization value", () => { + expect(model.queueId).toBe(constructorArguments["queueId"]); + }); + }); + describe("#waitUrl", () => { + it("resolves to initialization value", () => { + expect(model.waitUrl).toBe(constructorArguments["waitUrl"]); + }); }); }); }); diff --git a/__tests__/models/FilterLogsRequest.spec.ts b/__tests__/models/FilterLogsRequest.spec.ts index 760adad..dd7f8a6 100644 --- a/__tests__/models/FilterLogsRequest.spec.ts +++ b/__tests__/models/FilterLogsRequest.spec.ts @@ -2,18 +2,53 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("FilterLogsRequest", () => { - let model: freeclimb.FilterLogsRequest = new freeclimb.FilterLogsRequest({ - pql: "test_pql", + describe("Test with truthy values", () => { + const Klass = freeclimb.FilterLogsRequest; + let model: freeclimb.FilterLogsRequest = new freeclimb.FilterLogsRequest({ + pql: "test_pql", + }); + describe("FilterLogsRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.FilterLogsRequest); + }); + }); + describe(".pql", () => { + it("resolves to particular value on initialization", () => { + const value = "test_pql"; + expect(model.pql).toBe(value); + }); + }); }); - describe("FilterLogsRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.FilterLogsRequest); + describe("Test with falsy values", () => { + const Klass = freeclimb.FilterLogsRequest; + let model: freeclimb.FilterLogsRequest = new freeclimb.FilterLogsRequest({ + pql: "", + }); + describe("FilterLogsRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.FilterLogsRequest); + }); + }); + describe(".pql", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.pql).toBe(value); + }); }); }); - describe(".pql", () => { - it("resolves to particular value on initialization", () => { - const value = "test_pql"; - expect(model.pql).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.FilterLogsRequest; + let constructorArguments = { + pql: "test_pql", + }; + let model: freeclimb.FilterLogsRequest = new freeclimb.FilterLogsRequest( + constructorArguments, + ); + + describe("#pql", () => { + it("resolves to initialization value", () => { + expect(model.pql).toBe(constructorArguments["pql"]); + }); }); }); }); diff --git a/__tests__/models/GetDigits.spec.ts b/__tests__/models/GetDigits.spec.ts index 836dad2..d2938fb 100644 --- a/__tests__/models/GetDigits.spec.ts +++ b/__tests__/models/GetDigits.spec.ts @@ -2,75 +2,231 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("GetDigits", () => { - let model: freeclimb.GetDigits = new freeclimb.GetDigits({ - actionUrl: "https://123.abc", - digitTimeoutMs: 1, - finishOnKey: "test_finishOnKey", - flushBuffer: true, - initialTimeoutMs: 1, - maxDigits: 1, - minDigits: 1, - prompts: [], - privacyMode: true, - }); - describe("GetDigits class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.GetDigits); + describe("Test with truthy values", () => { + const Klass = freeclimb.GetDigits; + let model: freeclimb.GetDigits = new freeclimb.GetDigits({ + actionUrl: "https://123.abc", + digitTimeoutMs: 1, + finishOnKey: "test_finishOnKey", + flushBuffer: true, + initialTimeoutMs: 1, + maxDigits: 1, + minDigits: 1, + prompts: [], + privacyMode: true, + }); + describe("GetDigits class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.GetDigits); + }); }); - }); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); }); - }); - describe(".digitTimeoutMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.digitTimeoutMs).toBe(value); + describe(".digitTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.digitTimeoutMs).toBe(value); + }); }); - }); - describe(".finishOnKey", () => { - it("resolves to particular value on initialization", () => { - const value = "test_finishOnKey"; - expect(model.finishOnKey).toBe(value); + describe(".finishOnKey", () => { + it("resolves to particular value on initialization", () => { + const value = "test_finishOnKey"; + expect(model.finishOnKey).toBe(value); + }); }); - }); - describe(".flushBuffer", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.flushBuffer).toBe(value); + describe(".flushBuffer", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.flushBuffer).toBe(value); + }); }); - }); - describe(".initialTimeoutMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.initialTimeoutMs).toBe(value); + describe(".initialTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.initialTimeoutMs).toBe(value); + }); }); - }); - describe(".maxDigits", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.maxDigits).toBe(value); + describe(".maxDigits", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.maxDigits).toBe(value); + }); }); - }); - describe(".minDigits", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.minDigits).toBe(value); + describe(".minDigits", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.minDigits).toBe(value); + }); + }); + describe(".prompts", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.PerclCommand[] = []; + expect(model.prompts).toStrictEqual(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".prompts", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.PerclCommand[] = []; - expect(model.prompts).toStrictEqual(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.GetDigits; + let model: freeclimb.GetDigits = new freeclimb.GetDigits({ + actionUrl: "", + digitTimeoutMs: 0, + finishOnKey: "", + flushBuffer: false, + initialTimeoutMs: 0, + maxDigits: 0, + minDigits: 0, + prompts: [], + privacyMode: false, + }); + describe("GetDigits class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.GetDigits); + }); + }); + + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".digitTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.digitTimeoutMs).toBe(value); + }); + }); + describe(".finishOnKey", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.finishOnKey).toBe(value); + }); + }); + describe(".flushBuffer", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.flushBuffer).toBe(value); + }); + }); + describe(".initialTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.initialTimeoutMs).toBe(value); + }); + }); + describe(".maxDigits", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.maxDigits).toBe(value); + }); + }); + describe(".minDigits", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.minDigits).toBe(value); + }); + }); + describe(".prompts", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.PerclCommand[] = []; + expect(model.prompts).toStrictEqual(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".privacyMode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyMode).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.GetDigits; + let constructorArguments = { + actionUrl: "https://123.abc", + }; + let model: freeclimb.GetDigits = new freeclimb.GetDigits( + constructorArguments, + ); + + describe("#actionUrl", () => { + it("resolves to initialization value", () => { + expect(model.actionUrl).toBe(constructorArguments["actionUrl"]); + }); + }); + describe("#digitTimeoutMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "digitTimeoutMs", + )?.defaultValue; + expect(model.digitTimeoutMs).toBe(value); + }); + }); + describe("#finishOnKey", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "finishOnKey", + )?.defaultValue; + expect(model.finishOnKey).toBe(value); + }); + }); + describe("#flushBuffer", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "flushBuffer", + )?.defaultValue; + expect(model.flushBuffer).toBe(value); + }); + }); + describe("#initialTimeoutMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "initialTimeoutMs", + )?.defaultValue; + expect(model.initialTimeoutMs).toBe(value); + }); + }); + describe("#maxDigits", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "maxDigits", + )?.defaultValue; + expect(model.maxDigits).toBe(value); + }); + }); + describe("#minDigits", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "minDigits", + )?.defaultValue; + expect(model.minDigits).toBe(value); + }); + }); + describe("#prompts", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "prompts", + )?.defaultValue; + expect(model.prompts).toBe(value); + }); + }); + describe("#privacyMode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyMode", + )?.defaultValue; + expect(model.privacyMode).toBe(value); + }); }); }); }); diff --git a/__tests__/models/GetDigitsReason.spec.ts b/__tests__/models/GetDigitsReason.spec.ts index 5594640..18b2b58 100644 --- a/__tests__/models/GetDigitsReason.spec.ts +++ b/__tests__/models/GetDigitsReason.spec.ts @@ -2,24 +2,26 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("GetDigitsReason", () => { - describe(".FINISH_KEY", () => { - it("resolves to correct value for FINISH_KEY enum property", () => { - expect(freeclimb.GetDigitsReason.FINISH_KEY).toBe("finishKey"); + describe("Test with truthy values", () => { + describe(".FINISH_KEY", () => { + it("resolves to correct value for FINISH_KEY enum property", () => { + expect(freeclimb.GetDigitsReason.FINISH_KEY).toBe("finishKey"); + }); }); - }); - describe(".TIMEOUT", () => { - it("resolves to correct value for TIMEOUT enum property", () => { - expect(freeclimb.GetDigitsReason.TIMEOUT).toBe("timeout"); + describe(".TIMEOUT", () => { + it("resolves to correct value for TIMEOUT enum property", () => { + expect(freeclimb.GetDigitsReason.TIMEOUT).toBe("timeout"); + }); }); - }); - describe(".MAX_DIGITS", () => { - it("resolves to correct value for MAX_DIGITS enum property", () => { - expect(freeclimb.GetDigitsReason.MAX_DIGITS).toBe("maxDigits"); + describe(".MAX_DIGITS", () => { + it("resolves to correct value for MAX_DIGITS enum property", () => { + expect(freeclimb.GetDigitsReason.MAX_DIGITS).toBe("maxDigits"); + }); }); - }); - describe(".TONE", () => { - it("resolves to correct value for TONE enum property", () => { - expect(freeclimb.GetDigitsReason.TONE).toBe("tone"); + describe(".TONE", () => { + it("resolves to correct value for TONE enum property", () => { + expect(freeclimb.GetDigitsReason.TONE).toBe("tone"); + }); }); }); }); diff --git a/__tests__/models/GetDigitsWebhook.spec.ts b/__tests__/models/GetDigitsWebhook.spec.ts index 6796df9..ddb2d44 100644 --- a/__tests__/models/GetDigitsWebhook.spec.ts +++ b/__tests__/models/GetDigitsWebhook.spec.ts @@ -2,106 +2,322 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("GetDigitsWebhook", () => { - let model: freeclimb.GetDigitsWebhook = new freeclimb.GetDigitsWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.GetDigitsWebhook; + let model: freeclimb.GetDigitsWebhook = new freeclimb.GetDigitsWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - digits: "test_digits", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + digits: "test_digits", - reason: freeclimb.GetDigitsReason.FINISH_KEY, - parentCallId: "test_parentCallId", - }); - describe("GetDigitsWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.GetDigitsWebhook); + reason: freeclimb.GetDigitsReason.FINISH_KEY, + parentCallId: "test_parentCallId", + }); + describe("GetDigitsWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.GetDigitsWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".digits", () => { - it("resolves to particular value on initialization", () => { - const value = "test_digits"; - expect(model.digits).toBe(value); + describe(".digits", () => { + it("resolves to particular value on initialization", () => { + const value = "test_digits"; + expect(model.digits).toBe(value); + }); }); - }); - describe(".reason", () => { - it("resolves to particular value on initialization", () => { - const value = "finishKey"; - expect(model.reason).toBe(value); + describe(".reason", () => { + it("resolves to particular value on initialization", () => { + const value = "finishKey"; + expect(model.reason).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of GetDigitsWebhook", () => { + expect( + freeclimb.GetDigitsWebhook.deserialize( + '{ "requestType": "getDigits"}', + ), + ).toBeInstanceOf(freeclimb.GetDigitsWebhook); + }); }); }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.GetDigitsWebhook; + let model: freeclimb.GetDigitsWebhook = new freeclimb.GetDigitsWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + digits: "", + + reason: freeclimb.GetDigitsReason.FINISH_KEY, + parentCallId: "", + }); + describe("GetDigitsWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.GetDigitsWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".digits", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.digits).toBe(value); + }); + }); + describe(".reason", () => { + it("resolves to particular value on initialization", () => { + const value = "finishKey"; + expect(model.reason).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of GetDigitsWebhook", () => { + expect( + freeclimb.GetDigitsWebhook.deserialize( + '{ "requestType": "getDigits"}', + ), + ).toBeInstanceOf(freeclimb.GetDigitsWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of GetDigitsWebhook", () => { - expect( - freeclimb.GetDigitsWebhook.deserialize('{ "requestType": "getDigits"}'), - ).toBeInstanceOf(freeclimb.GetDigitsWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.GetDigitsWebhook; + let constructorArguments = {}; + let model: freeclimb.GetDigitsWebhook = new freeclimb.GetDigitsWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#digits", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "digits", + )?.defaultValue; + expect(model.digits).toBe(value); + }); + }); + describe("#reason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "reason", + )?.defaultValue; + expect(model.reason).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/GetSpeech.spec.ts b/__tests__/models/GetSpeech.spec.ts index 66a362f..18e9443 100644 --- a/__tests__/models/GetSpeech.spec.ts +++ b/__tests__/models/GetSpeech.spec.ts @@ -2,104 +2,319 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("GetSpeech", () => { - let model: freeclimb.GetSpeech = new freeclimb.GetSpeech({ - actionUrl: "https://123.abc", + describe("Test with truthy values", () => { + const Klass = freeclimb.GetSpeech; + let model: freeclimb.GetSpeech = new freeclimb.GetSpeech({ + actionUrl: "https://123.abc", - grammarType: freeclimb.GrammarType.URL, - grammarFile: "test_grammarFile", - grammarRule: "test_grammarRule", - playBeep: true, - prompts: [], - noInputTimeoutMs: 1, - recognitionTimeoutMs: 1, - confidenceThreshold: 1.0, - sensitivityLevel: 1.0, - speechCompleteTimeoutMs: 1, - speechIncompleteTimeoutMs: 1, - privacyMode: true, - }); - describe("GetSpeech class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.GetSpeech); + grammarType: freeclimb.GrammarType.URL, + grammarFile: "test_grammarFile", + grammarRule: "test_grammarRule", + playBeep: true, + prompts: [], + noInputTimeoutMs: 1, + recognitionTimeoutMs: 1, + confidenceThreshold: 1.0, + sensitivityLevel: 1.0, + speechCompleteTimeoutMs: 1, + speechIncompleteTimeoutMs: 1, + privacyMode: true, + }); + describe("GetSpeech class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.GetSpeech); + }); }); - }); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); }); - }); - describe(".grammarType", () => { - it("resolves to particular value on initialization", () => { - const value = "URL"; - expect(model.grammarType).toBe(value); + describe(".grammarType", () => { + it("resolves to particular value on initialization", () => { + const value = "URL"; + expect(model.grammarType).toBe(value); + }); }); - }); - describe(".grammarFile", () => { - it("resolves to particular value on initialization", () => { - const value = "test_grammarFile"; - expect(model.grammarFile).toBe(value); + describe(".grammarFile", () => { + it("resolves to particular value on initialization", () => { + const value = "test_grammarFile"; + expect(model.grammarFile).toBe(value); + }); }); - }); - describe(".grammarRule", () => { - it("resolves to particular value on initialization", () => { - const value = "test_grammarRule"; - expect(model.grammarRule).toBe(value); + describe(".grammarRule", () => { + it("resolves to particular value on initialization", () => { + const value = "test_grammarRule"; + expect(model.grammarRule).toBe(value); + }); }); - }); - describe(".playBeep", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.playBeep).toBe(value); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.playBeep).toBe(value); + }); }); - }); - describe(".prompts", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.PerclCommand[] = []; - expect(model.prompts).toStrictEqual(value); + describe(".prompts", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.PerclCommand[] = []; + expect(model.prompts).toStrictEqual(value); + }); }); - }); - describe(".noInputTimeoutMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.noInputTimeoutMs).toBe(value); + describe(".noInputTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.noInputTimeoutMs).toBe(value); + }); }); - }); - describe(".recognitionTimeoutMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.recognitionTimeoutMs).toBe(value); + describe(".recognitionTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.recognitionTimeoutMs).toBe(value); + }); }); - }); - describe(".confidenceThreshold", () => { - it("resolves to particular value on initialization", () => { - const value = 1.0; - expect(model.confidenceThreshold).toBe(value); + describe(".confidenceThreshold", () => { + it("resolves to particular value on initialization", () => { + const value = 1.0; + expect(model.confidenceThreshold).toBe(value); + }); }); - }); - describe(".sensitivityLevel", () => { - it("resolves to particular value on initialization", () => { - const value = 1.0; - expect(model.sensitivityLevel).toBe(value); + describe(".sensitivityLevel", () => { + it("resolves to particular value on initialization", () => { + const value = 1.0; + expect(model.sensitivityLevel).toBe(value); + }); }); - }); - describe(".speechCompleteTimeoutMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.speechCompleteTimeoutMs).toBe(value); + describe(".speechCompleteTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.speechCompleteTimeoutMs).toBe(value); + }); + }); + describe(".speechIncompleteTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.speechIncompleteTimeoutMs).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".speechIncompleteTimeoutMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.speechIncompleteTimeoutMs).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.GetSpeech; + let model: freeclimb.GetSpeech = new freeclimb.GetSpeech({ + actionUrl: "", + + grammarType: freeclimb.GrammarType.URL, + grammarFile: "", + grammarRule: "", + playBeep: false, + prompts: [], + noInputTimeoutMs: 0, + recognitionTimeoutMs: 0, + confidenceThreshold: 0.0, + sensitivityLevel: 0.0, + speechCompleteTimeoutMs: 0, + speechIncompleteTimeoutMs: 0, + privacyMode: false, + }); + describe("GetSpeech class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.GetSpeech); + }); + }); + + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".grammarType", () => { + it("resolves to particular value on initialization", () => { + const value = "URL"; + expect(model.grammarType).toBe(value); + }); + }); + describe(".grammarFile", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.grammarFile).toBe(value); + }); + }); + describe(".grammarRule", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.grammarRule).toBe(value); + }); + }); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.playBeep).toBe(value); + }); + }); + describe(".prompts", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.PerclCommand[] = []; + expect(model.prompts).toStrictEqual(value); + }); + }); + describe(".noInputTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.noInputTimeoutMs).toBe(value); + }); + }); + describe(".recognitionTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.recognitionTimeoutMs).toBe(value); + }); + }); + describe(".confidenceThreshold", () => { + it("resolves to particular value on initialization", () => { + const value = 0.0; + expect(model.confidenceThreshold).toBe(value); + }); + }); + describe(".sensitivityLevel", () => { + it("resolves to particular value on initialization", () => { + const value = 0.0; + expect(model.sensitivityLevel).toBe(value); + }); + }); + describe(".speechCompleteTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.speechCompleteTimeoutMs).toBe(value); + }); + }); + describe(".speechIncompleteTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.speechIncompleteTimeoutMs).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".privacyMode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyMode).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.GetSpeech; + let constructorArguments = { + actionUrl: "https://123.abc", + grammarFile: "test_grammarFile", + }; + let model: freeclimb.GetSpeech = new freeclimb.GetSpeech( + constructorArguments, + ); + + describe("#actionUrl", () => { + it("resolves to initialization value", () => { + expect(model.actionUrl).toBe(constructorArguments["actionUrl"]); + }); + }); + describe("#grammarType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "grammarType", + )?.defaultValue; + expect(model.grammarType).toBe(value); + }); + }); + describe("#grammarFile", () => { + it("resolves to initialization value", () => { + expect(model.grammarFile).toBe(constructorArguments["grammarFile"]); + }); + }); + describe("#grammarRule", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "grammarRule", + )?.defaultValue; + expect(model.grammarRule).toBe(value); + }); + }); + describe("#playBeep", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "playBeep", + )?.defaultValue; + expect(model.playBeep).toBe(value); + }); + }); + describe("#prompts", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "prompts", + )?.defaultValue; + expect(model.prompts).toBe(value); + }); + }); + describe("#noInputTimeoutMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "noInputTimeoutMs", + )?.defaultValue; + expect(model.noInputTimeoutMs).toBe(value); + }); + }); + describe("#recognitionTimeoutMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recognitionTimeoutMs", + )?.defaultValue; + expect(model.recognitionTimeoutMs).toBe(value); + }); + }); + describe("#confidenceThreshold", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "confidenceThreshold", + )?.defaultValue; + expect(model.confidenceThreshold).toBe(value); + }); + }); + describe("#sensitivityLevel", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sensitivityLevel", + )?.defaultValue; + expect(model.sensitivityLevel).toBe(value); + }); + }); + describe("#speechCompleteTimeoutMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "speechCompleteTimeoutMs", + )?.defaultValue; + expect(model.speechCompleteTimeoutMs).toBe(value); + }); + }); + describe("#speechIncompleteTimeoutMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "speechIncompleteTimeoutMs", + )?.defaultValue; + expect(model.speechIncompleteTimeoutMs).toBe(value); + }); + }); + describe("#privacyMode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyMode", + )?.defaultValue; + expect(model.privacyMode).toBe(value); + }); }); }); }); diff --git a/__tests__/models/GetSpeechReason.spec.ts b/__tests__/models/GetSpeechReason.spec.ts index 8aa73ec..977e24a 100644 --- a/__tests__/models/GetSpeechReason.spec.ts +++ b/__tests__/models/GetSpeechReason.spec.ts @@ -2,34 +2,36 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("GetSpeechReason", () => { - describe(".ERROR", () => { - it("resolves to correct value for ERROR enum property", () => { - expect(freeclimb.GetSpeechReason.ERROR).toBe("error"); + describe("Test with truthy values", () => { + describe(".ERROR", () => { + it("resolves to correct value for ERROR enum property", () => { + expect(freeclimb.GetSpeechReason.ERROR).toBe("error"); + }); }); - }); - describe(".HANGUP", () => { - it("resolves to correct value for HANGUP enum property", () => { - expect(freeclimb.GetSpeechReason.HANGUP).toBe("hangup"); + describe(".HANGUP", () => { + it("resolves to correct value for HANGUP enum property", () => { + expect(freeclimb.GetSpeechReason.HANGUP).toBe("hangup"); + }); }); - }); - describe(".DIGIT", () => { - it("resolves to correct value for DIGIT enum property", () => { - expect(freeclimb.GetSpeechReason.DIGIT).toBe("digit"); + describe(".DIGIT", () => { + it("resolves to correct value for DIGIT enum property", () => { + expect(freeclimb.GetSpeechReason.DIGIT).toBe("digit"); + }); }); - }); - describe(".NO_INPUT", () => { - it("resolves to correct value for NO_INPUT enum property", () => { - expect(freeclimb.GetSpeechReason.NO_INPUT).toBe("noInput"); + describe(".NO_INPUT", () => { + it("resolves to correct value for NO_INPUT enum property", () => { + expect(freeclimb.GetSpeechReason.NO_INPUT).toBe("noInput"); + }); }); - }); - describe(".NO_MATCH", () => { - it("resolves to correct value for NO_MATCH enum property", () => { - expect(freeclimb.GetSpeechReason.NO_MATCH).toBe("noMatch"); + describe(".NO_MATCH", () => { + it("resolves to correct value for NO_MATCH enum property", () => { + expect(freeclimb.GetSpeechReason.NO_MATCH).toBe("noMatch"); + }); }); - }); - describe(".RECOGNITION", () => { - it("resolves to correct value for RECOGNITION enum property", () => { - expect(freeclimb.GetSpeechReason.RECOGNITION).toBe("recognition"); + describe(".RECOGNITION", () => { + it("resolves to correct value for RECOGNITION enum property", () => { + expect(freeclimb.GetSpeechReason.RECOGNITION).toBe("recognition"); + }); }); }); }); diff --git a/__tests__/models/GetSpeechWebhook.spec.ts b/__tests__/models/GetSpeechWebhook.spec.ts index 8ae2d6e..a4f81f5 100644 --- a/__tests__/models/GetSpeechWebhook.spec.ts +++ b/__tests__/models/GetSpeechWebhook.spec.ts @@ -2,141 +2,432 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("GetSpeechWebhook", () => { - let model: freeclimb.GetSpeechWebhook = new freeclimb.GetSpeechWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.GetSpeechWebhook; + let model: freeclimb.GetSpeechWebhook = new freeclimb.GetSpeechWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", - reason: freeclimb.GetSpeechReason.ERROR, - recognitionResult: "test_recognitionResult", - confidence: 1, - parentCallId: "test_parentCallId", - completionReason: "test_completionReason", - completionCause: "test_completionCause", - mrcpCode: 1, - mrcpDiagnostic: "test_mrcpDiagnostic", - }); - describe("GetSpeechWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.GetSpeechWebhook); + reason: freeclimb.GetSpeechReason.ERROR, + recognitionResult: "test_recognitionResult", + confidence: 1, + parentCallId: "test_parentCallId", + completionReason: "test_completionReason", + completionCause: "test_completionCause", + mrcpCode: 1, + mrcpDiagnostic: "test_mrcpDiagnostic", + }); + describe("GetSpeechWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.GetSpeechWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".reason", () => { - it("resolves to particular value on initialization", () => { - const value = "error"; - expect(model.reason).toBe(value); + describe(".reason", () => { + it("resolves to particular value on initialization", () => { + const value = "error"; + expect(model.reason).toBe(value); + }); }); - }); - describe(".recognitionResult", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recognitionResult"; - expect(model.recognitionResult).toBe(value); + describe(".recognitionResult", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recognitionResult"; + expect(model.recognitionResult).toBe(value); + }); }); - }); - describe(".confidence", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.confidence).toBe(value); + describe(".confidence", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.confidence).toBe(value); + }); }); - }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); }); - }); - describe(".completionReason", () => { - it("resolves to particular value on initialization", () => { - const value = "test_completionReason"; - expect(model.completionReason).toBe(value); + describe(".completionReason", () => { + it("resolves to particular value on initialization", () => { + const value = "test_completionReason"; + expect(model.completionReason).toBe(value); + }); }); - }); - describe(".completionCause", () => { - it("resolves to particular value on initialization", () => { - const value = "test_completionCause"; - expect(model.completionCause).toBe(value); + describe(".completionCause", () => { + it("resolves to particular value on initialization", () => { + const value = "test_completionCause"; + expect(model.completionCause).toBe(value); + }); }); - }); - describe(".mrcpCode", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.mrcpCode).toBe(value); + describe(".mrcpCode", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.mrcpCode).toBe(value); + }); + }); + describe(".mrcpDiagnostic", () => { + it("resolves to particular value on initialization", () => { + const value = "test_mrcpDiagnostic"; + expect(model.mrcpDiagnostic).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of GetSpeechWebhook", () => { + expect( + freeclimb.GetSpeechWebhook.deserialize( + '{ "requestType": "getSpeech"}', + ), + ).toBeInstanceOf(freeclimb.GetSpeechWebhook); + }); }); }); - describe(".mrcpDiagnostic", () => { - it("resolves to particular value on initialization", () => { - const value = "test_mrcpDiagnostic"; - expect(model.mrcpDiagnostic).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.GetSpeechWebhook; + let model: freeclimb.GetSpeechWebhook = new freeclimb.GetSpeechWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + + reason: freeclimb.GetSpeechReason.ERROR, + recognitionResult: "", + confidence: 0, + parentCallId: "", + completionReason: "", + completionCause: "", + mrcpCode: 0, + mrcpDiagnostic: "", + }); + describe("GetSpeechWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.GetSpeechWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".reason", () => { + it("resolves to particular value on initialization", () => { + const value = "error"; + expect(model.reason).toBe(value); + }); + }); + describe(".recognitionResult", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recognitionResult).toBe(value); + }); + }); + describe(".confidence", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.confidence).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".completionReason", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.completionReason).toBe(value); + }); + }); + describe(".completionCause", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.completionCause).toBe(value); + }); + }); + describe(".mrcpCode", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.mrcpCode).toBe(value); + }); + }); + describe(".mrcpDiagnostic", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.mrcpDiagnostic).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of GetSpeechWebhook", () => { + expect( + freeclimb.GetSpeechWebhook.deserialize( + '{ "requestType": "getSpeech"}', + ), + ).toBeInstanceOf(freeclimb.GetSpeechWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of GetSpeechWebhook", () => { - expect( - freeclimb.GetSpeechWebhook.deserialize('{ "requestType": "getSpeech"}'), - ).toBeInstanceOf(freeclimb.GetSpeechWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.GetSpeechWebhook; + let constructorArguments = {}; + let model: freeclimb.GetSpeechWebhook = new freeclimb.GetSpeechWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#reason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "reason", + )?.defaultValue; + expect(model.reason).toBe(value); + }); + }); + describe("#recognitionResult", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recognitionResult", + )?.defaultValue; + expect(model.recognitionResult).toBe(value); + }); + }); + describe("#confidence", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "confidence", + )?.defaultValue; + expect(model.confidence).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); + }); + describe("#completionReason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "completionReason", + )?.defaultValue; + expect(model.completionReason).toBe(value); + }); + }); + describe("#completionCause", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "completionCause", + )?.defaultValue; + expect(model.completionCause).toBe(value); + }); + }); + describe("#mrcpCode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "mrcpCode", + )?.defaultValue; + expect(model.mrcpCode).toBe(value); + }); + }); + describe("#mrcpDiagnostic", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "mrcpDiagnostic", + )?.defaultValue; + expect(model.mrcpDiagnostic).toBe(value); + }); }); }); }); diff --git a/__tests__/models/GrammarFileBuiltIn.spec.ts b/__tests__/models/GrammarFileBuiltIn.spec.ts index b5e312d..4539f9b 100644 --- a/__tests__/models/GrammarFileBuiltIn.spec.ts +++ b/__tests__/models/GrammarFileBuiltIn.spec.ts @@ -2,81 +2,83 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("GrammarFileBuiltIn", () => { - describe(".ALPHNUM6", () => { - it("resolves to correct value for ALPHNUM6 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.ALPHNUM6).toBe("ALPHNUM6"); + describe("Test with truthy values", () => { + describe(".ALPHNUM6", () => { + it("resolves to correct value for ALPHNUM6 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.ALPHNUM6).toBe("ALPHNUM6"); + }); }); - }); - describe(".ANY_DIG", () => { - it("resolves to correct value for ANY_DIG enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.ANY_DIG).toBe("ANY_DIG"); + describe(".ANY_DIG", () => { + it("resolves to correct value for ANY_DIG enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.ANY_DIG).toBe("ANY_DIG"); + }); }); - }); - describe(".DIG1", () => { - it("resolves to correct value for DIG1 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG1).toBe("DIG1"); + describe(".DIG1", () => { + it("resolves to correct value for DIG1 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG1).toBe("DIG1"); + }); }); - }); - describe(".DIG2", () => { - it("resolves to correct value for DIG2 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG2).toBe("DIG2"); + describe(".DIG2", () => { + it("resolves to correct value for DIG2 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG2).toBe("DIG2"); + }); }); - }); - describe(".DIG3", () => { - it("resolves to correct value for DIG3 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG3).toBe("DIG3"); + describe(".DIG3", () => { + it("resolves to correct value for DIG3 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG3).toBe("DIG3"); + }); }); - }); - describe(".DIG4", () => { - it("resolves to correct value for DIG4 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG4).toBe("DIG4"); + describe(".DIG4", () => { + it("resolves to correct value for DIG4 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG4).toBe("DIG4"); + }); }); - }); - describe(".DIG5", () => { - it("resolves to correct value for DIG5 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG5).toBe("DIG5"); + describe(".DIG5", () => { + it("resolves to correct value for DIG5 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG5).toBe("DIG5"); + }); }); - }); - describe(".DIG6", () => { - it("resolves to correct value for DIG6 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG6).toBe("DIG6"); + describe(".DIG6", () => { + it("resolves to correct value for DIG6 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG6).toBe("DIG6"); + }); }); - }); - describe(".DIG7", () => { - it("resolves to correct value for DIG7 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG7).toBe("DIG7"); + describe(".DIG7", () => { + it("resolves to correct value for DIG7 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG7).toBe("DIG7"); + }); }); - }); - describe(".DIG8", () => { - it("resolves to correct value for DIG8 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG8).toBe("DIG8"); + describe(".DIG8", () => { + it("resolves to correct value for DIG8 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG8).toBe("DIG8"); + }); }); - }); - describe(".DIG9", () => { - it("resolves to correct value for DIG9 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG9).toBe("DIG9"); + describe(".DIG9", () => { + it("resolves to correct value for DIG9 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG9).toBe("DIG9"); + }); }); - }); - describe(".DIG10", () => { - it("resolves to correct value for DIG10 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG10).toBe("DIG10"); + describe(".DIG10", () => { + it("resolves to correct value for DIG10 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG10).toBe("DIG10"); + }); }); - }); - describe(".DIG11", () => { - it("resolves to correct value for DIG11 enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.DIG11).toBe("DIG11"); + describe(".DIG11", () => { + it("resolves to correct value for DIG11 enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.DIG11).toBe("DIG11"); + }); }); - }); - describe(".UP_TO_20_DIGIT_SEQUENCE", () => { - it("resolves to correct value for UP_TO_20_DIGIT_SEQUENCE enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.UP_TO_20_DIGIT_SEQUENCE).toBe( - "UP_TO_20_DIGIT_SEQUENCE", - ); + describe(".UP_TO_20_DIGIT_SEQUENCE", () => { + it("resolves to correct value for UP_TO_20_DIGIT_SEQUENCE enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.UP_TO_20_DIGIT_SEQUENCE).toBe( + "UP_TO_20_DIGIT_SEQUENCE", + ); + }); }); - }); - describe(".VERSAY_YESNO", () => { - it("resolves to correct value for VERSAY_YESNO enum property", () => { - expect(freeclimb.GrammarFileBuiltIn.VERSAY_YESNO).toBe("VERSAY_YESNO"); + describe(".VERSAY_YESNO", () => { + it("resolves to correct value for VERSAY_YESNO enum property", () => { + expect(freeclimb.GrammarFileBuiltIn.VERSAY_YESNO).toBe("VERSAY_YESNO"); + }); }); }); }); diff --git a/__tests__/models/GrammarType.spec.ts b/__tests__/models/GrammarType.spec.ts index e5c7efc..7d161ed 100644 --- a/__tests__/models/GrammarType.spec.ts +++ b/__tests__/models/GrammarType.spec.ts @@ -2,14 +2,16 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("GrammarType", () => { - describe(".URL", () => { - it("resolves to correct value for URL enum property", () => { - expect(freeclimb.GrammarType.URL).toBe("URL"); + describe("Test with truthy values", () => { + describe(".URL", () => { + it("resolves to correct value for URL enum property", () => { + expect(freeclimb.GrammarType.URL).toBe("URL"); + }); }); - }); - describe(".BUILT_IN", () => { - it("resolves to correct value for BUILT_IN enum property", () => { - expect(freeclimb.GrammarType.BUILT_IN).toBe("BUILTIN"); + describe(".BUILT_IN", () => { + it("resolves to correct value for BUILT_IN enum property", () => { + expect(freeclimb.GrammarType.BUILT_IN).toBe("BUILTIN"); + }); }); }); }); diff --git a/__tests__/models/Hangup.spec.ts b/__tests__/models/Hangup.spec.ts index 8a839ba..83b28eb 100644 --- a/__tests__/models/Hangup.spec.ts +++ b/__tests__/models/Hangup.spec.ts @@ -2,19 +2,54 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Hangup", () => { - let model: freeclimb.Hangup = new freeclimb.Hangup({ - reason: "test_reason", + describe("Test with truthy values", () => { + const Klass = freeclimb.Hangup; + let model: freeclimb.Hangup = new freeclimb.Hangup({ + reason: "test_reason", + }); + describe("Hangup class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Hangup); + }); + }); + + describe(".reason", () => { + it("resolves to particular value on initialization", () => { + const value = "test_reason"; + expect(model.reason).toBe(value); + }); + }); }); - describe("Hangup class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Hangup); + describe("Test with falsy values", () => { + const Klass = freeclimb.Hangup; + let model: freeclimb.Hangup = new freeclimb.Hangup({ + reason: "", + }); + describe("Hangup class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Hangup); + }); + }); + + describe(".reason", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.reason).toBe(value); + }); }); }); + describe("Test with only required values", () => { + const Klass = freeclimb.Hangup; + let constructorArguments = {}; + let model: freeclimb.Hangup = new freeclimb.Hangup(constructorArguments); - describe(".reason", () => { - it("resolves to particular value on initialization", () => { - const value = "test_reason"; - expect(model.reason).toBe(value); + describe("#reason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "reason", + )?.defaultValue; + expect(model.reason).toBe(value); + }); }); }); }); diff --git a/__tests__/models/IfMachine.spec.ts b/__tests__/models/IfMachine.spec.ts index 0f47738..bff0752 100644 --- a/__tests__/models/IfMachine.spec.ts +++ b/__tests__/models/IfMachine.spec.ts @@ -2,14 +2,16 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("IfMachine", () => { - describe(".REDIRECT", () => { - it("resolves to correct value for REDIRECT enum property", () => { - expect(freeclimb.IfMachine.REDIRECT).toBe("redirect"); + describe("Test with truthy values", () => { + describe(".REDIRECT", () => { + it("resolves to correct value for REDIRECT enum property", () => { + expect(freeclimb.IfMachine.REDIRECT).toBe("redirect"); + }); }); - }); - describe(".HANGUP", () => { - it("resolves to correct value for HANGUP enum property", () => { - expect(freeclimb.IfMachine.HANGUP).toBe("hangup"); + describe(".HANGUP", () => { + it("resolves to correct value for HANGUP enum property", () => { + expect(freeclimb.IfMachine.HANGUP).toBe("hangup"); + }); }); }); }); diff --git a/__tests__/models/InboundCallWebhook.spec.ts b/__tests__/models/InboundCallWebhook.spec.ts index 37008ef..d0a1767 100644 --- a/__tests__/models/InboundCallWebhook.spec.ts +++ b/__tests__/models/InboundCallWebhook.spec.ts @@ -2,93 +2,276 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("InboundCallWebhook", () => { - let model: freeclimb.InboundCallWebhook = new freeclimb.InboundCallWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.InboundCallWebhook; + let model: freeclimb.InboundCallWebhook = new freeclimb.InboundCallWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - parentCallId: "test_parentCallId", - }); - describe("InboundCallWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.InboundCallWebhook); + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + parentCallId: "test_parentCallId", + }); + describe("InboundCallWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.InboundCallWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of InboundCallWebhook", () => { + expect( + freeclimb.InboundCallWebhook.deserialize( + '{ "requestType": "inboundCall"}', + ), + ).toBeInstanceOf(freeclimb.InboundCallWebhook); + }); }); }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.InboundCallWebhook; + let model: freeclimb.InboundCallWebhook = new freeclimb.InboundCallWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + parentCallId: "", + }); + describe("InboundCallWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.InboundCallWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of InboundCallWebhook", () => { + expect( + freeclimb.InboundCallWebhook.deserialize( + '{ "requestType": "inboundCall"}', + ), + ).toBeInstanceOf(freeclimb.InboundCallWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of InboundCallWebhook", () => { - expect( - freeclimb.InboundCallWebhook.deserialize( - '{ "requestType": "inboundCall"}', - ), - ).toBeInstanceOf(freeclimb.InboundCallWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.InboundCallWebhook; + let constructorArguments = {}; + let model: freeclimb.InboundCallWebhook = new freeclimb.InboundCallWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/IncomingNumberList.spec.ts b/__tests__/models/IncomingNumberList.spec.ts index 5eb4874..b449081 100644 --- a/__tests__/models/IncomingNumberList.spec.ts +++ b/__tests__/models/IncomingNumberList.spec.ts @@ -2,67 +2,160 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("IncomingNumberList", () => { - let model: freeclimb.IncomingNumberList = new freeclimb.IncomingNumberList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - incomingPhoneNumbers: [], - }); - describe("IncomingNumberList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.IncomingNumberList); + describe("Test with truthy values", () => { + const Klass = freeclimb.IncomingNumberList; + let model: freeclimb.IncomingNumberList = new freeclimb.IncomingNumberList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + incomingPhoneNumbers: [], }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("IncomingNumberList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.IncomingNumberList); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".incomingPhoneNumbers", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.IncomingNumberResult[] = []; + expect(model.incomingPhoneNumbers).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.IncomingNumberList; + let model: freeclimb.IncomingNumberList = new freeclimb.IncomingNumberList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + incomingPhoneNumbers: [], + }); + describe("IncomingNumberList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.IncomingNumberList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".incomingPhoneNumbers", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.IncomingNumberResult[] = []; + expect(model.incomingPhoneNumbers).toStrictEqual(value); + }); }); }); - describe(".incomingPhoneNumbers", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.IncomingNumberResult[] = []; - expect(model.incomingPhoneNumbers).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.IncomingNumberList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.IncomingNumberList = new freeclimb.IncomingNumberList( + constructorArguments, + ); + + describe("#incomingPhoneNumbers", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "incomingPhoneNumbers", + )?.defaultValue; + expect(model.incomingPhoneNumbers).toBe(value); + }); }); }); }); diff --git a/__tests__/models/IncomingNumberRequest.spec.ts b/__tests__/models/IncomingNumberRequest.spec.ts index 4d23d92..ac9d8be 100644 --- a/__tests__/models/IncomingNumberRequest.spec.ts +++ b/__tests__/models/IncomingNumberRequest.spec.ts @@ -2,33 +2,99 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("IncomingNumberRequest", () => { - let model: freeclimb.IncomingNumberRequest = - new freeclimb.IncomingNumberRequest({ - applicationId: "test_applicationId", - alias: "test_alias", - campaignId: "test_campaignId", + describe("Test with truthy values", () => { + const Klass = freeclimb.IncomingNumberRequest; + let model: freeclimb.IncomingNumberRequest = + new freeclimb.IncomingNumberRequest({ + applicationId: "test_applicationId", + alias: "test_alias", + campaignId: "test_campaignId", + }); + describe("IncomingNumberRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.IncomingNumberRequest); + }); }); - describe("IncomingNumberRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.IncomingNumberRequest); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); }); - }); - describe(".applicationId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_applicationId"; - expect(model.applicationId).toBe(value); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); + }); }); }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.IncomingNumberRequest; + let model: freeclimb.IncomingNumberRequest = + new freeclimb.IncomingNumberRequest({ + applicationId: "", + alias: "", + campaignId: "", + }); + describe("IncomingNumberRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.IncomingNumberRequest); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.applicationId).toBe(value); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.campaignId).toBe(value); + }); }); }); - describe(".campaignId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_campaignId"; - expect(model.campaignId).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.IncomingNumberRequest; + let constructorArguments = {}; + let model: freeclimb.IncomingNumberRequest = + new freeclimb.IncomingNumberRequest(constructorArguments); + + describe("#applicationId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applicationId", + )?.defaultValue; + expect(model.applicationId).toBe(value); + }); + }); + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#campaignId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "campaignId", + )?.defaultValue; + expect(model.campaignId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/IncomingNumberResult.spec.ts b/__tests__/models/IncomingNumberResult.spec.ts index 866e20a..4e1606a 100644 --- a/__tests__/models/IncomingNumberResult.spec.ts +++ b/__tests__/models/IncomingNumberResult.spec.ts @@ -2,149 +2,416 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("IncomingNumberResult", () => { - let model: freeclimb.IncomingNumberResult = - new freeclimb.IncomingNumberResult({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, + describe("Test with truthy values", () => { + const Klass = freeclimb.IncomingNumberResult; + let model: freeclimb.IncomingNumberResult = + new freeclimb.IncomingNumberResult({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, - capabilities: new freeclimb.Capabilities({ - voice: null as any, - sms: null as any, - tollFree: null as any, - tenDLC: null as any, - shortCode: null as any, - }), - campaignId: "test_campaignId", - phoneNumberId: "test_phoneNumberId", - accountId: "test_accountId", - applicationId: "test_applicationId", - phoneNumber: "test_phoneNumber", - alias: "test_alias", - region: "test_region", - country: "test_country", - voiceEnabled: true, - smsEnabled: true, - offnet: true, + capabilities: new freeclimb.Capabilities({ + voice: null as any, + sms: null as any, + tollFree: null as any, + tenDLC: null as any, + shortCode: null as any, + }), + campaignId: "test_campaignId", + phoneNumberId: "test_phoneNumberId", + accountId: "test_accountId", + applicationId: "test_applicationId", + phoneNumber: "test_phoneNumber", + alias: "test_alias", + region: "test_region", + country: "test_country", + voiceEnabled: true, + smsEnabled: true, + offnet: true, - tfn: new freeclimb.TFN({ - campaignId: null as any, - }), + tfn: new freeclimb.TFN({ + campaignId: null as any, + }), + }); + describe("IncomingNumberResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.IncomingNumberResult); + }); }); - describe("IncomingNumberResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.IncomingNumberResult); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".capabilities", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.Capabilities({ + voice: null as any, + sms: null as any, + tollFree: null as any, + tenDLC: null as any, + shortCode: null as any, + }); + expect(model.capabilities).toStrictEqual(value); + }); }); - }); - describe(".capabilities", () => { - it("resolves to particular value on initialization", () => { - const value = new freeclimb.Capabilities({ - voice: null as any, - sms: null as any, - tollFree: null as any, - tenDLC: null as any, - shortCode: null as any, + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); }); - expect(model.capabilities).toStrictEqual(value); }); - }); - describe(".campaignId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_campaignId"; - expect(model.campaignId).toBe(value); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phoneNumberId"; + expect(model.phoneNumberId).toBe(value); + }); }); - }); - describe(".phoneNumberId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phoneNumberId"; - expect(model.phoneNumberId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); }); - }); - describe(".applicationId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_applicationId"; - expect(model.applicationId).toBe(value); + describe(".phoneNumber", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phoneNumber"; + expect(model.phoneNumber).toBe(value); + }); }); - }); - describe(".phoneNumber", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phoneNumber"; - expect(model.phoneNumber).toBe(value); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); }); - }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe(".region", () => { + it("resolves to particular value on initialization", () => { + const value = "test_region"; + expect(model.region).toBe(value); + }); }); - }); - describe(".region", () => { - it("resolves to particular value on initialization", () => { - const value = "test_region"; - expect(model.region).toBe(value); + describe(".country", () => { + it("resolves to particular value on initialization", () => { + const value = "test_country"; + expect(model.country).toBe(value); + }); }); - }); - describe(".country", () => { - it("resolves to particular value on initialization", () => { - const value = "test_country"; - expect(model.country).toBe(value); + describe(".voiceEnabled", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.voiceEnabled).toBe(value); + }); }); - }); - describe(".voiceEnabled", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.voiceEnabled).toBe(value); + describe(".smsEnabled", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.smsEnabled).toBe(value); + }); }); - }); - describe(".smsEnabled", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.smsEnabled).toBe(value); + describe(".offnet", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.offnet).toBe(value); + }); + }); + describe(".tfn", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.TFN({ + campaignId: null as any, + }); + expect(model.tfn).toStrictEqual(value); + }); }); }); - describe(".offnet", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.offnet).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.IncomingNumberResult; + let model: freeclimb.IncomingNumberResult = + new freeclimb.IncomingNumberResult({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + + capabilities: new freeclimb.Capabilities({ + voice: null as any, + sms: null as any, + tollFree: null as any, + tenDLC: null as any, + shortCode: null as any, + }), + campaignId: "", + phoneNumberId: "", + accountId: "", + applicationId: "", + phoneNumber: "", + alias: "", + region: "", + country: "", + voiceEnabled: false, + smsEnabled: false, + offnet: false, + + tfn: new freeclimb.TFN({ + campaignId: null as any, + }), + }); + describe("IncomingNumberResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.IncomingNumberResult); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".capabilities", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.Capabilities({ + voice: null as any, + sms: null as any, + tollFree: null as any, + tenDLC: null as any, + shortCode: null as any, + }); + expect(model.capabilities).toStrictEqual(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.campaignId).toBe(value); + }); + }); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.applicationId).toBe(value); + }); + }); + describe(".phoneNumber", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phoneNumber).toBe(value); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".region", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.region).toBe(value); + }); + }); + describe(".country", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.country).toBe(value); + }); + }); + describe(".voiceEnabled", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.voiceEnabled).toBe(value); + }); + }); + describe(".smsEnabled", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.smsEnabled).toBe(value); + }); + }); + describe(".offnet", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.offnet).toBe(value); + }); + }); + describe(".tfn", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.TFN({ + campaignId: null as any, + }); + expect(model.tfn).toStrictEqual(value); + }); }); }); - describe(".tfn", () => { - it("resolves to particular value on initialization", () => { - const value = new freeclimb.TFN({ - campaignId: null as any, + describe("Test with only required values", () => { + const Klass = freeclimb.IncomingNumberResult; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.IncomingNumberResult = + new freeclimb.IncomingNumberResult(constructorArguments); + + describe("#capabilities", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "capabilities", + )?.defaultValue; + expect(model.capabilities).toBe(value); + }); + }); + describe("#campaignId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "campaignId", + )?.defaultValue; + expect(model.campaignId).toBe(value); + }); + }); + describe("#phoneNumberId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "phoneNumberId", + )?.defaultValue; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#applicationId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applicationId", + )?.defaultValue; + expect(model.applicationId).toBe(value); + }); + }); + describe("#phoneNumber", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "phoneNumber", + )?.defaultValue; + expect(model.phoneNumber).toBe(value); + }); + }); + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#region", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "region", + )?.defaultValue; + expect(model.region).toBe(value); + }); + }); + describe("#country", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "country", + )?.defaultValue; + expect(model.country).toBe(value); + }); + }); + describe("#voiceEnabled", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "voiceEnabled", + )?.defaultValue; + expect(model.voiceEnabled).toBe(value); + }); + }); + describe("#smsEnabled", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "smsEnabled", + )?.defaultValue; + expect(model.smsEnabled).toBe(value); + }); + }); + describe("#offnet", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "offnet", + )?.defaultValue; + expect(model.offnet).toBe(value); + }); + }); + describe("#tfn", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "tfn", + )?.defaultValue; + expect(model.tfn).toBe(value); }); - expect(model.tfn).toStrictEqual(value); }); }); }); diff --git a/__tests__/models/Language.spec.ts b/__tests__/models/Language.spec.ts index a858f95..6e977fb 100644 --- a/__tests__/models/Language.spec.ts +++ b/__tests__/models/Language.spec.ts @@ -2,134 +2,136 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Language", () => { - describe(".CATALAN", () => { - it("resolves to correct value for CATALAN enum property", () => { - expect(freeclimb.Language.CATALAN).toBe("ca-ES"); - }); - }); - describe(".DANISH", () => { - it("resolves to correct value for DANISH enum property", () => { - expect(freeclimb.Language.DANISH).toBe("da-DK"); - }); - }); - describe(".GERMAN", () => { - it("resolves to correct value for GERMAN enum property", () => { - expect(freeclimb.Language.GERMAN).toBe("de-DE"); - }); - }); - describe(".ENGLISH_AU", () => { - it("resolves to correct value for ENGLISH_AU enum property", () => { - expect(freeclimb.Language.ENGLISH_AU).toBe("en-AU"); - }); - }); - describe(".ENGLISH_CA", () => { - it("resolves to correct value for ENGLISH_CA enum property", () => { - expect(freeclimb.Language.ENGLISH_CA).toBe("en-CA"); - }); - }); - describe(".ENGLISH_UK", () => { - it("resolves to correct value for ENGLISH_UK enum property", () => { - expect(freeclimb.Language.ENGLISH_UK).toBe("en-GB"); - }); - }); - describe(".ENGLISH_IN", () => { - it("resolves to correct value for ENGLISH_IN enum property", () => { - expect(freeclimb.Language.ENGLISH_IN).toBe("en-IN"); - }); - }); - describe(".ENGLISH_US", () => { - it("resolves to correct value for ENGLISH_US enum property", () => { - expect(freeclimb.Language.ENGLISH_US).toBe("en-US"); - }); - }); - describe(".ENGLISH_ES", () => { - it("resolves to correct value for ENGLISH_ES enum property", () => { - expect(freeclimb.Language.ENGLISH_ES).toBe("es-ES"); - }); - }); - describe(".ENGLISH_MX", () => { - it("resolves to correct value for ENGLISH_MX enum property", () => { - expect(freeclimb.Language.ENGLISH_MX).toBe("es-MX"); - }); - }); - describe(".FINNISH", () => { - it("resolves to correct value for FINNISH enum property", () => { - expect(freeclimb.Language.FINNISH).toBe("fi-FI"); - }); - }); - describe(".FRENCH_CA", () => { - it("resolves to correct value for FRENCH_CA enum property", () => { - expect(freeclimb.Language.FRENCH_CA).toBe("fr-CA"); - }); - }); - describe(".FRENCH_FR", () => { - it("resolves to correct value for FRENCH_FR enum property", () => { - expect(freeclimb.Language.FRENCH_FR).toBe("fr-FR"); - }); - }); - describe(".ITALIAN", () => { - it("resolves to correct value for ITALIAN enum property", () => { - expect(freeclimb.Language.ITALIAN).toBe("it-IT"); - }); - }); - describe(".JAPANESE", () => { - it("resolves to correct value for JAPANESE enum property", () => { - expect(freeclimb.Language.JAPANESE).toBe("ja-JP"); - }); - }); - describe(".KOREAN", () => { - it("resolves to correct value for KOREAN enum property", () => { - expect(freeclimb.Language.KOREAN).toBe("ko-KR"); - }); - }); - describe(".NORWEGIAN", () => { - it("resolves to correct value for NORWEGIAN enum property", () => { - expect(freeclimb.Language.NORWEGIAN).toBe("nb-NO"); - }); - }); - describe(".DUTCH", () => { - it("resolves to correct value for DUTCH enum property", () => { - expect(freeclimb.Language.DUTCH).toBe("nl-NL"); - }); - }); - describe(".POLISH", () => { - it("resolves to correct value for POLISH enum property", () => { - expect(freeclimb.Language.POLISH).toBe("pl-PL"); - }); - }); - describe(".PORTUGESE_BR", () => { - it("resolves to correct value for PORTUGESE_BR enum property", () => { - expect(freeclimb.Language.PORTUGESE_BR).toBe("pt-BR"); - }); - }); - describe(".PORTUGESE_PT", () => { - it("resolves to correct value for PORTUGESE_PT enum property", () => { - expect(freeclimb.Language.PORTUGESE_PT).toBe("pt-PT"); - }); - }); - describe(".RUSSIAN", () => { - it("resolves to correct value for RUSSIAN enum property", () => { - expect(freeclimb.Language.RUSSIAN).toBe("ru-RU"); - }); - }); - describe(".SWEDISH", () => { - it("resolves to correct value for SWEDISH enum property", () => { - expect(freeclimb.Language.SWEDISH).toBe("sv-SE"); - }); - }); - describe(".CHINESE_CN", () => { - it("resolves to correct value for CHINESE_CN enum property", () => { - expect(freeclimb.Language.CHINESE_CN).toBe("zh-CN"); - }); - }); - describe(".CHINESE_HK", () => { - it("resolves to correct value for CHINESE_HK enum property", () => { - expect(freeclimb.Language.CHINESE_HK).toBe("zh-HK"); - }); - }); - describe(".CHINESE_TW", () => { - it("resolves to correct value for CHINESE_TW enum property", () => { - expect(freeclimb.Language.CHINESE_TW).toBe("zh-TW"); + describe("Test with truthy values", () => { + describe(".CATALAN", () => { + it("resolves to correct value for CATALAN enum property", () => { + expect(freeclimb.Language.CATALAN).toBe("ca-ES"); + }); + }); + describe(".DANISH", () => { + it("resolves to correct value for DANISH enum property", () => { + expect(freeclimb.Language.DANISH).toBe("da-DK"); + }); + }); + describe(".GERMAN", () => { + it("resolves to correct value for GERMAN enum property", () => { + expect(freeclimb.Language.GERMAN).toBe("de-DE"); + }); + }); + describe(".ENGLISH_AU", () => { + it("resolves to correct value for ENGLISH_AU enum property", () => { + expect(freeclimb.Language.ENGLISH_AU).toBe("en-AU"); + }); + }); + describe(".ENGLISH_CA", () => { + it("resolves to correct value for ENGLISH_CA enum property", () => { + expect(freeclimb.Language.ENGLISH_CA).toBe("en-CA"); + }); + }); + describe(".ENGLISH_UK", () => { + it("resolves to correct value for ENGLISH_UK enum property", () => { + expect(freeclimb.Language.ENGLISH_UK).toBe("en-GB"); + }); + }); + describe(".ENGLISH_IN", () => { + it("resolves to correct value for ENGLISH_IN enum property", () => { + expect(freeclimb.Language.ENGLISH_IN).toBe("en-IN"); + }); + }); + describe(".ENGLISH_US", () => { + it("resolves to correct value for ENGLISH_US enum property", () => { + expect(freeclimb.Language.ENGLISH_US).toBe("en-US"); + }); + }); + describe(".ENGLISH_ES", () => { + it("resolves to correct value for ENGLISH_ES enum property", () => { + expect(freeclimb.Language.ENGLISH_ES).toBe("es-ES"); + }); + }); + describe(".ENGLISH_MX", () => { + it("resolves to correct value for ENGLISH_MX enum property", () => { + expect(freeclimb.Language.ENGLISH_MX).toBe("es-MX"); + }); + }); + describe(".FINNISH", () => { + it("resolves to correct value for FINNISH enum property", () => { + expect(freeclimb.Language.FINNISH).toBe("fi-FI"); + }); + }); + describe(".FRENCH_CA", () => { + it("resolves to correct value for FRENCH_CA enum property", () => { + expect(freeclimb.Language.FRENCH_CA).toBe("fr-CA"); + }); + }); + describe(".FRENCH_FR", () => { + it("resolves to correct value for FRENCH_FR enum property", () => { + expect(freeclimb.Language.FRENCH_FR).toBe("fr-FR"); + }); + }); + describe(".ITALIAN", () => { + it("resolves to correct value for ITALIAN enum property", () => { + expect(freeclimb.Language.ITALIAN).toBe("it-IT"); + }); + }); + describe(".JAPANESE", () => { + it("resolves to correct value for JAPANESE enum property", () => { + expect(freeclimb.Language.JAPANESE).toBe("ja-JP"); + }); + }); + describe(".KOREAN", () => { + it("resolves to correct value for KOREAN enum property", () => { + expect(freeclimb.Language.KOREAN).toBe("ko-KR"); + }); + }); + describe(".NORWEGIAN", () => { + it("resolves to correct value for NORWEGIAN enum property", () => { + expect(freeclimb.Language.NORWEGIAN).toBe("nb-NO"); + }); + }); + describe(".DUTCH", () => { + it("resolves to correct value for DUTCH enum property", () => { + expect(freeclimb.Language.DUTCH).toBe("nl-NL"); + }); + }); + describe(".POLISH", () => { + it("resolves to correct value for POLISH enum property", () => { + expect(freeclimb.Language.POLISH).toBe("pl-PL"); + }); + }); + describe(".PORTUGESE_BR", () => { + it("resolves to correct value for PORTUGESE_BR enum property", () => { + expect(freeclimb.Language.PORTUGESE_BR).toBe("pt-BR"); + }); + }); + describe(".PORTUGESE_PT", () => { + it("resolves to correct value for PORTUGESE_PT enum property", () => { + expect(freeclimb.Language.PORTUGESE_PT).toBe("pt-PT"); + }); + }); + describe(".RUSSIAN", () => { + it("resolves to correct value for RUSSIAN enum property", () => { + expect(freeclimb.Language.RUSSIAN).toBe("ru-RU"); + }); + }); + describe(".SWEDISH", () => { + it("resolves to correct value for SWEDISH enum property", () => { + expect(freeclimb.Language.SWEDISH).toBe("sv-SE"); + }); + }); + describe(".CHINESE_CN", () => { + it("resolves to correct value for CHINESE_CN enum property", () => { + expect(freeclimb.Language.CHINESE_CN).toBe("zh-CN"); + }); + }); + describe(".CHINESE_HK", () => { + it("resolves to correct value for CHINESE_HK enum property", () => { + expect(freeclimb.Language.CHINESE_HK).toBe("zh-HK"); + }); + }); + describe(".CHINESE_TW", () => { + it("resolves to correct value for CHINESE_TW enum property", () => { + expect(freeclimb.Language.CHINESE_TW).toBe("zh-TW"); + }); }); }); }); diff --git a/__tests__/models/LeaveConferenceWebhook.spec.ts b/__tests__/models/LeaveConferenceWebhook.spec.ts index eb52636..d025b16 100644 --- a/__tests__/models/LeaveConferenceWebhook.spec.ts +++ b/__tests__/models/LeaveConferenceWebhook.spec.ts @@ -2,87 +2,255 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("LeaveConferenceWebhook", () => { - let model: freeclimb.LeaveConferenceWebhook = - new freeclimb.LeaveConferenceWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.LeaveConferenceWebhook; + let model: freeclimb.LeaveConferenceWebhook = + new freeclimb.LeaveConferenceWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + }); + describe("LeaveConferenceWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.LeaveConferenceWebhook); + }); }); - describe("LeaveConferenceWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.LeaveConferenceWebhook); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of LeaveConferenceWebhook", () => { + expect( + freeclimb.LeaveConferenceWebhook.deserialize( + '{ "requestType": "leaveConference"}', + ), + ).toBeInstanceOf(freeclimb.LeaveConferenceWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.LeaveConferenceWebhook; + let model: freeclimb.LeaveConferenceWebhook = + new freeclimb.LeaveConferenceWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + }); + describe("LeaveConferenceWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.LeaveConferenceWebhook); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of LeaveConferenceWebhook", () => { + expect( + freeclimb.LeaveConferenceWebhook.deserialize( + '{ "requestType": "leaveConference"}', + ), + ).toBeInstanceOf(freeclimb.LeaveConferenceWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of LeaveConferenceWebhook", () => { - expect( - freeclimb.LeaveConferenceWebhook.deserialize( - '{ "requestType": "leaveConference"}', - ), - ).toBeInstanceOf(freeclimb.LeaveConferenceWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.LeaveConferenceWebhook; + let constructorArguments = {}; + let model: freeclimb.LeaveConferenceWebhook = + new freeclimb.LeaveConferenceWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/LogLevel.spec.ts b/__tests__/models/LogLevel.spec.ts index 6174568..093eeba 100644 --- a/__tests__/models/LogLevel.spec.ts +++ b/__tests__/models/LogLevel.spec.ts @@ -2,19 +2,21 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("LogLevel", () => { - describe(".INFO", () => { - it("resolves to correct value for INFO enum property", () => { - expect(freeclimb.LogLevel.INFO).toBe("info"); + describe("Test with truthy values", () => { + describe(".INFO", () => { + it("resolves to correct value for INFO enum property", () => { + expect(freeclimb.LogLevel.INFO).toBe("info"); + }); }); - }); - describe(".WARNING", () => { - it("resolves to correct value for WARNING enum property", () => { - expect(freeclimb.LogLevel.WARNING).toBe("warning"); + describe(".WARNING", () => { + it("resolves to correct value for WARNING enum property", () => { + expect(freeclimb.LogLevel.WARNING).toBe("warning"); + }); }); - }); - describe(".ERROR", () => { - it("resolves to correct value for ERROR enum property", () => { - expect(freeclimb.LogLevel.ERROR).toBe("error"); + describe(".ERROR", () => { + it("resolves to correct value for ERROR enum property", () => { + expect(freeclimb.LogLevel.ERROR).toBe("error"); + }); }); }); }); diff --git a/__tests__/models/LogList.spec.ts b/__tests__/models/LogList.spec.ts index 6f7e07e..fe9854e 100644 --- a/__tests__/models/LogList.spec.ts +++ b/__tests__/models/LogList.spec.ts @@ -2,67 +2,158 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("LogList", () => { - let model: freeclimb.LogList = new freeclimb.LogList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - logs: [], - }); - describe("LogList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.LogList); + describe("Test with truthy values", () => { + const Klass = freeclimb.LogList; + let model: freeclimb.LogList = new freeclimb.LogList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + logs: [], }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("LogList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.LogList); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".logs", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.LogResult[] = []; + expect(model.logs).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.LogList; + let model: freeclimb.LogList = new freeclimb.LogList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + logs: [], + }); + describe("LogList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.LogList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".logs", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.LogResult[] = []; + expect(model.logs).toStrictEqual(value); + }); }); }); - describe(".logs", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.LogResult[] = []; - expect(model.logs).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.LogList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.LogList = new freeclimb.LogList(constructorArguments); + + describe("#logs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "logs", + )?.defaultValue; + expect(model.logs).toBe(value); + }); }); }); }); diff --git a/__tests__/models/LogResult.spec.ts b/__tests__/models/LogResult.spec.ts index 257bfee..6993da0 100644 --- a/__tests__/models/LogResult.spec.ts +++ b/__tests__/models/LogResult.spec.ts @@ -2,61 +2,188 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("LogResult", () => { - let model: freeclimb.LogResult = new freeclimb.LogResult({ - timestamp: 1, + describe("Test with truthy values", () => { + const Klass = freeclimb.LogResult; + let model: freeclimb.LogResult = new freeclimb.LogResult({ + timestamp: 1, - level: freeclimb.LogLevel.INFO, - requestId: "test_requestId", - accountId: "test_accountId", - callId: "test_callId", - message: "test_message", - metadata: {}, - }); - describe("LogResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.LogResult); + level: freeclimb.LogLevel.INFO, + requestId: "test_requestId", + accountId: "test_accountId", + callId: "test_callId", + message: "test_message", + metadata: {}, }); - }); - describe(".timestamp", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.timestamp).toBe(value); + describe("LogResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.LogResult); + }); }); - }); - describe(".level", () => { - it("resolves to particular value on initialization", () => { - const value = "info"; - expect(model.level).toBe(value); + describe(".timestamp", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.timestamp).toBe(value); + }); }); - }); - describe(".requestId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestId"; - expect(model.requestId).toBe(value); + describe(".level", () => { + it("resolves to particular value on initialization", () => { + const value = "info"; + expect(model.level).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".requestId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestId"; + expect(model.requestId).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".message", () => { + it("resolves to particular value on initialization", () => { + const value = "test_message"; + expect(model.message).toBe(value); + }); + }); + describe(".metadata", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + expect(model.metadata).toStrictEqual(value); + }); }); }); - describe(".message", () => { - it("resolves to particular value on initialization", () => { - const value = "test_message"; - expect(model.message).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.LogResult; + let model: freeclimb.LogResult = new freeclimb.LogResult({ + timestamp: 0, + + level: freeclimb.LogLevel.INFO, + requestId: "", + accountId: "", + callId: "", + message: "", + metadata: {}, + }); + describe("LogResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.LogResult); + }); + }); + describe(".timestamp", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.timestamp).toBe(value); + }); + }); + describe(".level", () => { + it("resolves to particular value on initialization", () => { + const value = "info"; + expect(model.level).toBe(value); + }); + }); + describe(".requestId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".message", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.message).toBe(value); + }); + }); + describe(".metadata", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + expect(model.metadata).toStrictEqual(value); + }); }); }); - describe(".metadata", () => { - it("resolves to particular value on initialization", () => { - const value = {}; - expect(model.metadata).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.LogResult; + let constructorArguments = {}; + let model: freeclimb.LogResult = new freeclimb.LogResult( + constructorArguments, + ); + + describe("#timestamp", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "timestamp", + )?.defaultValue; + expect(model.timestamp).toBe(value); + }); + }); + describe("#level", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "level", + )?.defaultValue; + expect(model.level).toBe(value); + }); + }); + describe("#requestId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestId", + )?.defaultValue; + expect(model.requestId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#message", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "message", + )?.defaultValue; + expect(model.message).toBe(value); + }); + }); + describe("#metadata", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "metadata", + )?.defaultValue; + expect(model.metadata).toBe(value); + }); }); }); }); diff --git a/__tests__/models/MachineDetectedWebhook.spec.ts b/__tests__/models/MachineDetectedWebhook.spec.ts index 239ee29..d082ae9 100644 --- a/__tests__/models/MachineDetectedWebhook.spec.ts +++ b/__tests__/models/MachineDetectedWebhook.spec.ts @@ -2,102 +2,301 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MachineDetectedWebhook", () => { - let model: freeclimb.MachineDetectedWebhook = - new freeclimb.MachineDetectedWebhook({ - requestType: "test_requestType", - callId: "test_callId", - accountId: "test_accountId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.MachineDetectedWebhook; + let model: freeclimb.MachineDetectedWebhook = + new freeclimb.MachineDetectedWebhook({ + requestType: "test_requestType", + callId: "test_callId", + accountId: "test_accountId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - parentCallId: "test_parentCallId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + parentCallId: "test_parentCallId", - machineType: freeclimb.MachineType.ANSWERING_MACHINE, + machineType: freeclimb.MachineType.ANSWERING_MACHINE, + }); + describe("MachineDetectedWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MachineDetectedWebhook); + }); }); - describe("MachineDetectedWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.MachineDetectedWebhook); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".machineType", () => { + it("resolves to particular value on initialization", () => { + const value = "answering machine"; + expect(model.machineType).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of MachineDetectedWebhook", () => { + expect( + freeclimb.MachineDetectedWebhook.deserialize( + '{ "requestType": "machineDetected"}', + ), + ).toBeInstanceOf(freeclimb.MachineDetectedWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.MachineDetectedWebhook; + let model: freeclimb.MachineDetectedWebhook = + new freeclimb.MachineDetectedWebhook({ + requestType: "", + callId: "", + accountId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + parentCallId: "", + + machineType: freeclimb.MachineType.ANSWERING_MACHINE, + }); + describe("MachineDetectedWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MachineDetectedWebhook); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".machineType", () => { - it("resolves to particular value on initialization", () => { - const value = "answering machine"; - expect(model.machineType).toBe(value); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".machineType", () => { + it("resolves to particular value on initialization", () => { + const value = "answering machine"; + expect(model.machineType).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of MachineDetectedWebhook", () => { + expect( + freeclimb.MachineDetectedWebhook.deserialize( + '{ "requestType": "machineDetected"}', + ), + ).toBeInstanceOf(freeclimb.MachineDetectedWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of MachineDetectedWebhook", () => { - expect( - freeclimb.MachineDetectedWebhook.deserialize( - '{ "requestType": "machineDetected"}', - ), - ).toBeInstanceOf(freeclimb.MachineDetectedWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.MachineDetectedWebhook; + let constructorArguments = {}; + let model: freeclimb.MachineDetectedWebhook = + new freeclimb.MachineDetectedWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); + }); + describe("#machineType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "machineType", + )?.defaultValue; + expect(model.machineType).toBe(value); + }); }); }); }); diff --git a/__tests__/models/MachineType.spec.ts b/__tests__/models/MachineType.spec.ts index b588a8b..c7726c2 100644 --- a/__tests__/models/MachineType.spec.ts +++ b/__tests__/models/MachineType.spec.ts @@ -2,14 +2,18 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MachineType", () => { - describe(".ANSWERING_MACHINE", () => { - it("resolves to correct value for ANSWERING_MACHINE enum property", () => { - expect(freeclimb.MachineType.ANSWERING_MACHINE).toBe("answering machine"); + describe("Test with truthy values", () => { + describe(".ANSWERING_MACHINE", () => { + it("resolves to correct value for ANSWERING_MACHINE enum property", () => { + expect(freeclimb.MachineType.ANSWERING_MACHINE).toBe( + "answering machine", + ); + }); }); - }); - describe(".FAX_MODEM", () => { - it("resolves to correct value for FAX_MODEM enum property", () => { - expect(freeclimb.MachineType.FAX_MODEM).toBe("fax modem"); + describe(".FAX_MODEM", () => { + it("resolves to correct value for FAX_MODEM enum property", () => { + expect(freeclimb.MachineType.FAX_MODEM).toBe("fax modem"); + }); }); }); }); diff --git a/__tests__/models/MakeCallRequest.spec.ts b/__tests__/models/MakeCallRequest.spec.ts index 91ea4fb..403d767 100644 --- a/__tests__/models/MakeCallRequest.spec.ts +++ b/__tests__/models/MakeCallRequest.spec.ts @@ -2,81 +2,249 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MakeCallRequest", () => { - let model: freeclimb.MakeCallRequest = new freeclimb.MakeCallRequest({ - from: "test_from", - to: "test_to", - applicationId: "test_applicationId", - sendDigits: "test_sendDigits", - ifMachine: "test_ifMachine", - ifMachineUrl: "https://123.abc", - timeout: 1, - parentCallId: "test_parentCallId", - privacyMode: true, - callConnectUrl: "https://123.abc", - }); - describe("MakeCallRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.MakeCallRequest); + describe("Test with truthy values", () => { + const Klass = freeclimb.MakeCallRequest; + let model: freeclimb.MakeCallRequest = new freeclimb.MakeCallRequest({ + from: "test_from", + to: "test_to", + applicationId: "test_applicationId", + sendDigits: "test_sendDigits", + ifMachine: "test_ifMachine", + ifMachineUrl: "https://123.abc", + timeout: 1, + parentCallId: "test_parentCallId", + privacyMode: true, + callConnectUrl: "https://123.abc", }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe("MakeCallRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MakeCallRequest); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".applicationId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_applicationId"; - expect(model.applicationId).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".sendDigits", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sendDigits"; - expect(model.sendDigits).toBe(value); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); }); - }); - describe(".ifMachine", () => { - it("resolves to particular value on initialization", () => { - const value = "test_ifMachine"; - expect(model.ifMachine).toBe(value); + describe(".sendDigits", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sendDigits"; + expect(model.sendDigits).toBe(value); + }); }); - }); - describe(".ifMachineUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.ifMachineUrl).toBe(value); + describe(".ifMachine", () => { + it("resolves to particular value on initialization", () => { + const value = "test_ifMachine"; + expect(model.ifMachine).toBe(value); + }); }); - }); - describe(".timeout", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.timeout).toBe(value); + describe(".ifMachineUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.ifMachineUrl).toBe(value); + }); }); - }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe(".timeout", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.timeout).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyMode).toBe(value); + }); + }); + describe(".callConnectUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.callConnectUrl).toBe(value); + }); }); }); - describe(".privacyMode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyMode).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.MakeCallRequest; + let model: freeclimb.MakeCallRequest = new freeclimb.MakeCallRequest({ + from: "", + to: "", + applicationId: "", + sendDigits: "", + ifMachine: "", + ifMachineUrl: "", + timeout: 0, + parentCallId: "", + privacyMode: false, + callConnectUrl: "", + }); + describe("MakeCallRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MakeCallRequest); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.applicationId).toBe(value); + }); + }); + describe(".sendDigits", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sendDigits).toBe(value); + }); + }); + describe(".ifMachine", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.ifMachine).toBe(value); + }); + }); + describe(".ifMachineUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.ifMachineUrl).toBe(value); + }); + }); + describe(".timeout", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.timeout).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyMode).toBe(value); + }); + }); + describe(".callConnectUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callConnectUrl).toBe(value); + }); }); }); - describe(".callConnectUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.callConnectUrl).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.MakeCallRequest; + let constructorArguments = { + from: "test_from", + to: "test_to", + }; + let model: freeclimb.MakeCallRequest = new freeclimb.MakeCallRequest( + constructorArguments, + ); + + describe("#from", () => { + it("resolves to initialization value", () => { + expect(model.from).toBe(constructorArguments["from"]); + }); + }); + describe("#to", () => { + it("resolves to initialization value", () => { + expect(model.to).toBe(constructorArguments["to"]); + }); + }); + describe("#applicationId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applicationId", + )?.defaultValue; + expect(model.applicationId).toBe(value); + }); + }); + describe("#sendDigits", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sendDigits", + )?.defaultValue; + expect(model.sendDigits).toBe(value); + }); + }); + describe("#ifMachine", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "ifMachine", + )?.defaultValue; + expect(model.ifMachine).toBe(value); + }); + }); + describe("#ifMachineUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "ifMachineUrl", + )?.defaultValue; + expect(model.ifMachineUrl).toBe(value); + }); + }); + describe("#timeout", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "timeout", + )?.defaultValue; + expect(model.timeout).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); + }); + describe("#privacyMode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyMode", + )?.defaultValue; + expect(model.privacyMode).toBe(value); + }); + }); + describe("#callConnectUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callConnectUrl", + )?.defaultValue; + expect(model.callConnectUrl).toBe(value); + }); }); }); }); diff --git a/__tests__/models/MessageDeliveryWebhook.spec.ts b/__tests__/models/MessageDeliveryWebhook.spec.ts index aec8033..7ddca61 100644 --- a/__tests__/models/MessageDeliveryWebhook.spec.ts +++ b/__tests__/models/MessageDeliveryWebhook.spec.ts @@ -2,92 +2,273 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MessageDeliveryWebhook", () => { - let model: freeclimb.MessageDeliveryWebhook = - new freeclimb.MessageDeliveryWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - from: "test_from", - to: "test_to", - text: "test_text", - direction: "test_direction", - applicationId: "test_applicationId", - status: "test_status", - phoneNumberId: "test_phoneNumberId", - uri: "test_uri", - }); - describe("MessageDeliveryWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.MessageDeliveryWebhook); + describe("Test with truthy values", () => { + const Klass = freeclimb.MessageDeliveryWebhook; + let model: freeclimb.MessageDeliveryWebhook = + new freeclimb.MessageDeliveryWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + from: "test_from", + to: "test_to", + text: "test_text", + direction: "test_direction", + applicationId: "test_applicationId", + status: "test_status", + phoneNumberId: "test_phoneNumberId", + uri: "test_uri", + }); + describe("MessageDeliveryWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessageDeliveryWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".text", () => { - it("resolves to particular value on initialization", () => { - const value = "test_text"; - expect(model.text).toBe(value); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = "test_text"; + expect(model.text).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "test_direction"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "test_direction"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".applicationId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_applicationId"; - expect(model.applicationId).toBe(value); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "test_status"; - expect(model.status).toBe(value); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "test_status"; + expect(model.status).toBe(value); + }); }); - }); - describe(".phoneNumberId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phoneNumberId"; - expect(model.phoneNumberId).toBe(value); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phoneNumberId"; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of MessageDeliveryWebhook", () => { + expect( + freeclimb.MessageDeliveryWebhook.deserialize( + '{ "requestType": "messageDelivery"}', + ), + ).toBeInstanceOf(freeclimb.MessageDeliveryWebhook); + }); }); }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.MessageDeliveryWebhook; + let model: freeclimb.MessageDeliveryWebhook = + new freeclimb.MessageDeliveryWebhook({ + requestType: "", + accountId: "", + from: "", + to: "", + text: "", + direction: "", + applicationId: "", + status: "", + phoneNumberId: "", + uri: "", + }); + describe("MessageDeliveryWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessageDeliveryWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.text).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.direction).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.applicationId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.status).toBe(value); + }); + }); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of MessageDeliveryWebhook", () => { + expect( + freeclimb.MessageDeliveryWebhook.deserialize( + '{ "requestType": "messageDelivery"}', + ), + ).toBeInstanceOf(freeclimb.MessageDeliveryWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of MessageDeliveryWebhook", () => { - expect( - freeclimb.MessageDeliveryWebhook.deserialize( - '{ "requestType": "messageDelivery"}', - ), - ).toBeInstanceOf(freeclimb.MessageDeliveryWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.MessageDeliveryWebhook; + let constructorArguments = {}; + let model: freeclimb.MessageDeliveryWebhook = + new freeclimb.MessageDeliveryWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#text", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "text", + )?.defaultValue; + expect(model.text).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#applicationId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applicationId", + )?.defaultValue; + expect(model.applicationId).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#phoneNumberId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "phoneNumberId", + )?.defaultValue; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe("#uri", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "uri", + )?.defaultValue; + expect(model.uri).toBe(value); + }); }); }); }); diff --git a/__tests__/models/MessageDirection.spec.ts b/__tests__/models/MessageDirection.spec.ts index 274a8d1..770c7bd 100644 --- a/__tests__/models/MessageDirection.spec.ts +++ b/__tests__/models/MessageDirection.spec.ts @@ -2,14 +2,16 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MessageDirection", () => { - describe(".INBOUND", () => { - it("resolves to correct value for INBOUND enum property", () => { - expect(freeclimb.MessageDirection.INBOUND).toBe("inbound"); + describe("Test with truthy values", () => { + describe(".INBOUND", () => { + it("resolves to correct value for INBOUND enum property", () => { + expect(freeclimb.MessageDirection.INBOUND).toBe("inbound"); + }); }); - }); - describe(".OUTBOUND", () => { - it("resolves to correct value for OUTBOUND enum property", () => { - expect(freeclimb.MessageDirection.OUTBOUND).toBe("outbound"); + describe(".OUTBOUND", () => { + it("resolves to correct value for OUTBOUND enum property", () => { + expect(freeclimb.MessageDirection.OUTBOUND).toBe("outbound"); + }); }); }); }); diff --git a/__tests__/models/MessageRequest.spec.ts b/__tests__/models/MessageRequest.spec.ts index 528955f..73449b2 100644 --- a/__tests__/models/MessageRequest.spec.ts +++ b/__tests__/models/MessageRequest.spec.ts @@ -2,74 +2,197 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MessageRequest", () => { - let model: freeclimb.MessageRequest = new freeclimb.MessageRequest({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - from: "test_from", - to: "test_to", - text: "test_text", - notificationUrl: "https://123.abc", - mediaUrls: [], - }); - describe("MessageRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.MessageRequest); + describe("Test with truthy values", () => { + const Klass = freeclimb.MessageRequest; + let model: freeclimb.MessageRequest = new freeclimb.MessageRequest({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + from: "test_from", + to: "test_to", + text: "test_text", + notificationUrl: "https://123.abc", + mediaUrls: [], }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("MessageRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessageRequest); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".text", () => { - it("resolves to particular value on initialization", () => { - const value = "test_text"; - expect(model.text).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = "test_text"; + expect(model.text).toBe(value); + }); + }); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.notificationUrl).toBe(value); + }); + }); + describe(".mediaUrls", () => { + it("resolves to particular value on initialization", () => { + const value: any[] = []; + expect(model.mediaUrls).toStrictEqual(value); + }); }); }); - describe(".notificationUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.notificationUrl).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.MessageRequest; + let model: freeclimb.MessageRequest = new freeclimb.MessageRequest({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + from: "", + to: "", + text: "", + notificationUrl: "", + mediaUrls: [], + }); + describe("MessageRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessageRequest); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.text).toBe(value); + }); + }); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.notificationUrl).toBe(value); + }); + }); + describe(".mediaUrls", () => { + it("resolves to particular value on initialization", () => { + const value: any[] = []; + expect(model.mediaUrls).toStrictEqual(value); + }); }); }); - describe(".mediaUrls", () => { - it("resolves to particular value on initialization", () => { - const value: any[] = []; - expect(model.mediaUrls).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.MessageRequest; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + from: "test_from", + to: "test_to", + text: "test_text", + }; + let model: freeclimb.MessageRequest = new freeclimb.MessageRequest( + constructorArguments, + ); + + describe("#from", () => { + it("resolves to initialization value", () => { + expect(model.from).toBe(constructorArguments["from"]); + }); + }); + describe("#to", () => { + it("resolves to initialization value", () => { + expect(model.to).toBe(constructorArguments["to"]); + }); + }); + describe("#text", () => { + it("resolves to initialization value", () => { + expect(model.text).toBe(constructorArguments["text"]); + }); + }); + describe("#notificationUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "notificationUrl", + )?.defaultValue; + expect(model.notificationUrl).toBe(value); + }); + }); + describe("#mediaUrls", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "mediaUrls", + )?.defaultValue; + expect(model.mediaUrls).toBe(value); + }); }); }); }); diff --git a/__tests__/models/MessageResult.spec.ts b/__tests__/models/MessageResult.spec.ts index 0c8073b..5f0e9f5 100644 --- a/__tests__/models/MessageResult.spec.ts +++ b/__tests__/models/MessageResult.spec.ts @@ -2,150 +2,435 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MessageResult", () => { - let model: freeclimb.MessageResult = new freeclimb.MessageResult({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - accountId: "test_accountId", - messageId: "test_messageId", + describe("Test with truthy values", () => { + const Klass = freeclimb.MessageResult; + let model: freeclimb.MessageResult = new freeclimb.MessageResult({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + accountId: "test_accountId", + messageId: "test_messageId", - status: freeclimb.MessageStatus.NEW, - from: "test_from", - to: "test_to", - text: "test_text", - direction: "test_direction", - notificationUrl: "https://123.abc", - brandId: "test_brandId", - campaignId: "test_campaignId", - segmentCount: 1.0, - mediaUrls: [], + status: freeclimb.MessageStatus.NEW, + from: "test_from", + to: "test_to", + text: "test_text", + direction: "test_direction", + notificationUrl: "https://123.abc", + brandId: "test_brandId", + campaignId: "test_campaignId", + segmentCount: 1.0, + mediaUrls: [], - tfn: new freeclimb.TFN({ - campaignId: null as any, - }), - phoneNumberId: "test_phoneNumberId", - applicationId: "test_applicationId", - }); - describe("MessageResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.MessageResult); + tfn: new freeclimb.TFN({ + campaignId: null as any, + }), + phoneNumberId: "test_phoneNumberId", + applicationId: "test_applicationId", }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("MessageResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessageResult); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".messageId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_messageId"; - expect(model.messageId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "new"; - expect(model.status).toBe(value); + describe(".messageId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_messageId"; + expect(model.messageId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "new"; + expect(model.status).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".text", () => { - it("resolves to particular value on initialization", () => { - const value = "test_text"; - expect(model.text).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "test_direction"; - expect(model.direction).toBe(value); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = "test_text"; + expect(model.text).toBe(value); + }); }); - }); - describe(".notificationUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.notificationUrl).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "test_direction"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".brandId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_brandId"; - expect(model.brandId).toBe(value); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.notificationUrl).toBe(value); + }); }); - }); - describe(".campaignId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_campaignId"; - expect(model.campaignId).toBe(value); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_brandId"; + expect(model.brandId).toBe(value); + }); }); - }); - describe(".segmentCount", () => { - it("resolves to particular value on initialization", () => { - const value = 1.0; - expect(model.segmentCount).toBe(value); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); + }); }); - }); - describe(".mediaUrls", () => { - it("resolves to particular value on initialization", () => { - const value: any[] = []; - expect(model.mediaUrls).toStrictEqual(value); + describe(".segmentCount", () => { + it("resolves to particular value on initialization", () => { + const value = 1.0; + expect(model.segmentCount).toBe(value); + }); + }); + describe(".mediaUrls", () => { + it("resolves to particular value on initialization", () => { + const value: any[] = []; + expect(model.mediaUrls).toStrictEqual(value); + }); + }); + describe(".tfn", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.TFN({ + campaignId: null as any, + }); + expect(model.tfn).toStrictEqual(value); + }); + }); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phoneNumberId"; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); }); }); - describe(".tfn", () => { - it("resolves to particular value on initialization", () => { - const value = new freeclimb.TFN({ + describe("Test with falsy values", () => { + const Klass = freeclimb.MessageResult; + let model: freeclimb.MessageResult = new freeclimb.MessageResult({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + accountId: "", + messageId: "", + + status: freeclimb.MessageStatus.NEW, + from: "", + to: "", + text: "", + direction: "", + notificationUrl: "", + brandId: "", + campaignId: "", + segmentCount: 0.0, + mediaUrls: [], + + tfn: new freeclimb.TFN({ campaignId: null as any, + }), + phoneNumberId: "", + applicationId: "", + }); + describe("MessageResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessageResult); }); - expect(model.tfn).toStrictEqual(value); }); - }); - describe(".phoneNumberId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phoneNumberId"; - expect(model.phoneNumberId).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".messageId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.messageId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "new"; + expect(model.status).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.text).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.direction).toBe(value); + }); + }); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.notificationUrl).toBe(value); + }); + }); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.brandId).toBe(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.campaignId).toBe(value); + }); + }); + describe(".segmentCount", () => { + it("resolves to particular value on initialization", () => { + const value = 0.0; + expect(model.segmentCount).toBe(value); + }); + }); + describe(".mediaUrls", () => { + it("resolves to particular value on initialization", () => { + const value: any[] = []; + expect(model.mediaUrls).toStrictEqual(value); + }); + }); + describe(".tfn", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.TFN({ + campaignId: null as any, + }); + expect(model.tfn).toStrictEqual(value); + }); + }); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.applicationId).toBe(value); + }); }); }); - describe(".applicationId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_applicationId"; - expect(model.applicationId).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.MessageResult; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.MessageResult = new freeclimb.MessageResult( + constructorArguments, + ); + + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#messageId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "messageId", + )?.defaultValue; + expect(model.messageId).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#text", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "text", + )?.defaultValue; + expect(model.text).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#notificationUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "notificationUrl", + )?.defaultValue; + expect(model.notificationUrl).toBe(value); + }); + }); + describe("#brandId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "brandId", + )?.defaultValue; + expect(model.brandId).toBe(value); + }); + }); + describe("#campaignId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "campaignId", + )?.defaultValue; + expect(model.campaignId).toBe(value); + }); + }); + describe("#segmentCount", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "segmentCount", + )?.defaultValue; + expect(model.segmentCount).toBe(value); + }); + }); + describe("#mediaUrls", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "mediaUrls", + )?.defaultValue; + expect(model.mediaUrls).toBe(value); + }); + }); + describe("#tfn", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "tfn", + )?.defaultValue; + expect(model.tfn).toBe(value); + }); + }); + describe("#phoneNumberId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "phoneNumberId", + )?.defaultValue; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe("#applicationId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applicationId", + )?.defaultValue; + expect(model.applicationId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/MessageStatus.spec.ts b/__tests__/models/MessageStatus.spec.ts index abe20f0..bc7a88e 100644 --- a/__tests__/models/MessageStatus.spec.ts +++ b/__tests__/models/MessageStatus.spec.ts @@ -2,59 +2,61 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MessageStatus", () => { - describe(".NEW", () => { - it("resolves to correct value for NEW enum property", () => { - expect(freeclimb.MessageStatus.NEW).toBe("new"); - }); - }); - describe(".QUEUED", () => { - it("resolves to correct value for QUEUED enum property", () => { - expect(freeclimb.MessageStatus.QUEUED).toBe("queued"); - }); - }); - describe(".REJECTED", () => { - it("resolves to correct value for REJECTED enum property", () => { - expect(freeclimb.MessageStatus.REJECTED).toBe("rejected"); - }); - }); - describe(".SENDING", () => { - it("resolves to correct value for SENDING enum property", () => { - expect(freeclimb.MessageStatus.SENDING).toBe("sending"); - }); - }); - describe(".SENT", () => { - it("resolves to correct value for SENT enum property", () => { - expect(freeclimb.MessageStatus.SENT).toBe("sent"); - }); - }); - describe(".FAILED", () => { - it("resolves to correct value for FAILED enum property", () => { - expect(freeclimb.MessageStatus.FAILED).toBe("failed"); - }); - }); - describe(".RECEIVED", () => { - it("resolves to correct value for RECEIVED enum property", () => { - expect(freeclimb.MessageStatus.RECEIVED).toBe("received"); - }); - }); - describe(".UNDELIVERED", () => { - it("resolves to correct value for UNDELIVERED enum property", () => { - expect(freeclimb.MessageStatus.UNDELIVERED).toBe("undelivered"); - }); - }); - describe(".EXPIRED", () => { - it("resolves to correct value for EXPIRED enum property", () => { - expect(freeclimb.MessageStatus.EXPIRED).toBe("expired"); - }); - }); - describe(".DELETED", () => { - it("resolves to correct value for DELETED enum property", () => { - expect(freeclimb.MessageStatus.DELETED).toBe("deleted"); - }); - }); - describe(".UNKNOWN", () => { - it("resolves to correct value for UNKNOWN enum property", () => { - expect(freeclimb.MessageStatus.UNKNOWN).toBe("unknown"); + describe("Test with truthy values", () => { + describe(".NEW", () => { + it("resolves to correct value for NEW enum property", () => { + expect(freeclimb.MessageStatus.NEW).toBe("new"); + }); + }); + describe(".QUEUED", () => { + it("resolves to correct value for QUEUED enum property", () => { + expect(freeclimb.MessageStatus.QUEUED).toBe("queued"); + }); + }); + describe(".REJECTED", () => { + it("resolves to correct value for REJECTED enum property", () => { + expect(freeclimb.MessageStatus.REJECTED).toBe("rejected"); + }); + }); + describe(".SENDING", () => { + it("resolves to correct value for SENDING enum property", () => { + expect(freeclimb.MessageStatus.SENDING).toBe("sending"); + }); + }); + describe(".SENT", () => { + it("resolves to correct value for SENT enum property", () => { + expect(freeclimb.MessageStatus.SENT).toBe("sent"); + }); + }); + describe(".FAILED", () => { + it("resolves to correct value for FAILED enum property", () => { + expect(freeclimb.MessageStatus.FAILED).toBe("failed"); + }); + }); + describe(".RECEIVED", () => { + it("resolves to correct value for RECEIVED enum property", () => { + expect(freeclimb.MessageStatus.RECEIVED).toBe("received"); + }); + }); + describe(".UNDELIVERED", () => { + it("resolves to correct value for UNDELIVERED enum property", () => { + expect(freeclimb.MessageStatus.UNDELIVERED).toBe("undelivered"); + }); + }); + describe(".EXPIRED", () => { + it("resolves to correct value for EXPIRED enum property", () => { + expect(freeclimb.MessageStatus.EXPIRED).toBe("expired"); + }); + }); + describe(".DELETED", () => { + it("resolves to correct value for DELETED enum property", () => { + expect(freeclimb.MessageStatus.DELETED).toBe("deleted"); + }); + }); + describe(".UNKNOWN", () => { + it("resolves to correct value for UNKNOWN enum property", () => { + expect(freeclimb.MessageStatus.UNKNOWN).toBe("unknown"); + }); }); }); }); diff --git a/__tests__/models/MessageStatusWebhook.spec.ts b/__tests__/models/MessageStatusWebhook.spec.ts index fec2111..a8c4305 100644 --- a/__tests__/models/MessageStatusWebhook.spec.ts +++ b/__tests__/models/MessageStatusWebhook.spec.ts @@ -2,100 +2,297 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MessageStatusWebhook", () => { - let model: freeclimb.MessageStatusWebhook = - new freeclimb.MessageStatusWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - messageId: "test_messageId", - callId: "test_callId", - from: "test_from", - to: "test_to", - text: "test_text", - direction: "test_direction", - applicationId: "test_applicationId", + describe("Test with truthy values", () => { + const Klass = freeclimb.MessageStatusWebhook; + let model: freeclimb.MessageStatusWebhook = + new freeclimb.MessageStatusWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + messageId: "test_messageId", + callId: "test_callId", + from: "test_from", + to: "test_to", + text: "test_text", + direction: "test_direction", + applicationId: "test_applicationId", - status: freeclimb.MessageStatus.NEW, - phoneNumberId: "test_phoneNumberId", + status: freeclimb.MessageStatus.NEW, + phoneNumberId: "test_phoneNumberId", + }); + describe("MessageStatusWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessageStatusWebhook); + }); }); - describe("MessageStatusWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.MessageStatusWebhook); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".messageId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_messageId"; + expect(model.messageId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = "test_text"; + expect(model.text).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "test_direction"; + expect(model.direction).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "new"; + expect(model.status).toBe(value); + }); + }); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phoneNumberId"; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of MessageStatusWebhook", () => { + expect( + freeclimb.MessageStatusWebhook.deserialize( + '{ "requestType": "messageStatus"}', + ), + ).toBeInstanceOf(freeclimb.MessageStatusWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.MessageStatusWebhook; + let model: freeclimb.MessageStatusWebhook = + new freeclimb.MessageStatusWebhook({ + requestType: "", + accountId: "", + messageId: "", + callId: "", + from: "", + to: "", + text: "", + direction: "", + applicationId: "", - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + status: freeclimb.MessageStatus.NEW, + phoneNumberId: "", + }); + describe("MessageStatusWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessageStatusWebhook); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".messageId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_messageId"; - expect(model.messageId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".messageId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.messageId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".text", () => { - it("resolves to particular value on initialization", () => { - const value = "test_text"; - expect(model.text).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "test_direction"; - expect(model.direction).toBe(value); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.text).toBe(value); + }); }); - }); - describe(".applicationId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_applicationId"; - expect(model.applicationId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.direction).toBe(value); + }); }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "new"; - expect(model.status).toBe(value); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.applicationId).toBe(value); + }); }); - }); - describe(".phoneNumberId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phoneNumberId"; - expect(model.phoneNumberId).toBe(value); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "new"; + expect(model.status).toBe(value); + }); + }); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of MessageStatusWebhook", () => { + expect( + freeclimb.MessageStatusWebhook.deserialize( + '{ "requestType": "messageStatus"}', + ), + ).toBeInstanceOf(freeclimb.MessageStatusWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of MessageStatusWebhook", () => { - expect( - freeclimb.MessageStatusWebhook.deserialize( - '{ "requestType": "messageStatus"}', - ), - ).toBeInstanceOf(freeclimb.MessageStatusWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.MessageStatusWebhook; + let constructorArguments = {}; + let model: freeclimb.MessageStatusWebhook = + new freeclimb.MessageStatusWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#messageId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "messageId", + )?.defaultValue; + expect(model.messageId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#text", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "text", + )?.defaultValue; + expect(model.text).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#applicationId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "applicationId", + )?.defaultValue; + expect(model.applicationId).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#phoneNumberId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "phoneNumberId", + )?.defaultValue; + expect(model.phoneNumberId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/MessagesList.spec.ts b/__tests__/models/MessagesList.spec.ts index a4134af..95dd51e 100644 --- a/__tests__/models/MessagesList.spec.ts +++ b/__tests__/models/MessagesList.spec.ts @@ -2,67 +2,160 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MessagesList", () => { - let model: freeclimb.MessagesList = new freeclimb.MessagesList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - messages: [], - }); - describe("MessagesList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.MessagesList); + describe("Test with truthy values", () => { + const Klass = freeclimb.MessagesList; + let model: freeclimb.MessagesList = new freeclimb.MessagesList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + messages: [], }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("MessagesList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessagesList); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".messages", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.MessageResult[] = []; + expect(model.messages).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.MessagesList; + let model: freeclimb.MessagesList = new freeclimb.MessagesList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + messages: [], + }); + describe("MessagesList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MessagesList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".messages", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.MessageResult[] = []; + expect(model.messages).toStrictEqual(value); + }); }); }); - describe(".messages", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.MessageResult[] = []; - expect(model.messages).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.MessagesList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.MessagesList = new freeclimb.MessagesList( + constructorArguments, + ); + + describe("#messages", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "messages", + )?.defaultValue; + expect(model.messages).toBe(value); + }); }); }); }); diff --git a/__tests__/models/MutableResourceModel.spec.ts b/__tests__/models/MutableResourceModel.spec.ts index bb1cb59..49a1fb7 100644 --- a/__tests__/models/MutableResourceModel.spec.ts +++ b/__tests__/models/MutableResourceModel.spec.ts @@ -2,40 +2,121 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("MutableResourceModel", () => { - let model: freeclimb.MutableResourceModel = - new freeclimb.MutableResourceModel({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, + describe("Test with truthy values", () => { + const Klass = freeclimb.MutableResourceModel; + let model: freeclimb.MutableResourceModel = + new freeclimb.MutableResourceModel({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }); + describe("MutableResourceModel class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MutableResourceModel); + }); }); - describe("MutableResourceModel class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.MutableResourceModel); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.MutableResourceModel; + let model: freeclimb.MutableResourceModel = + new freeclimb.MutableResourceModel({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + }); + describe("MutableResourceModel class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.MutableResourceModel); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); }); }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.MutableResourceModel; + let constructorArguments = {}; + let model: freeclimb.MutableResourceModel = + new freeclimb.MutableResourceModel(constructorArguments); + + describe("#uri", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "uri", + )?.defaultValue; + expect(model.uri).toBe(value); + }); + }); + describe("#dateCreated", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "dateCreated", + )?.defaultValue; + expect(model.dateCreated).toBe(value); + }); + }); + describe("#dateUpdated", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "dateUpdated", + )?.defaultValue; + expect(model.dateUpdated).toBe(value); + }); + }); + describe("#revision", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "revision", + )?.defaultValue; + expect(model.revision).toBe(value); + }); }); }); }); diff --git a/__tests__/models/OutDial.spec.ts b/__tests__/models/OutDial.spec.ts index bc9af56..8189ae4 100644 --- a/__tests__/models/OutDial.spec.ts +++ b/__tests__/models/OutDial.spec.ts @@ -2,83 +2,249 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("OutDial", () => { - let model: freeclimb.OutDial = new freeclimb.OutDial({ - actionUrl: "https://123.abc", - callConnectUrl: "https://123.abc", - callingNumber: "test_callingNumber", - destination: "test_destination", + describe("Test with truthy values", () => { + const Klass = freeclimb.OutDial; + let model: freeclimb.OutDial = new freeclimb.OutDial({ + actionUrl: "https://123.abc", + callConnectUrl: "https://123.abc", + callingNumber: "test_callingNumber", + destination: "test_destination", - ifMachine: freeclimb.IfMachine.REDIRECT, - ifMachineUrl: "https://123.abc", - sendDigits: "test_sendDigits", - statusCallbackUrl: "https://123.abc", - timeout: 1, - privacyMode: true, - }); - describe("OutDial class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.OutDial); + ifMachine: freeclimb.IfMachine.REDIRECT, + ifMachineUrl: "https://123.abc", + sendDigits: "test_sendDigits", + statusCallbackUrl: "https://123.abc", + timeout: 1, + privacyMode: true, + }); + describe("OutDial class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.OutDial); + }); }); - }); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); }); - }); - describe(".callConnectUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.callConnectUrl).toBe(value); + describe(".callConnectUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.callConnectUrl).toBe(value); + }); }); - }); - describe(".callingNumber", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callingNumber"; - expect(model.callingNumber).toBe(value); + describe(".callingNumber", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callingNumber"; + expect(model.callingNumber).toBe(value); + }); }); - }); - describe(".destination", () => { - it("resolves to particular value on initialization", () => { - const value = "test_destination"; - expect(model.destination).toBe(value); + describe(".destination", () => { + it("resolves to particular value on initialization", () => { + const value = "test_destination"; + expect(model.destination).toBe(value); + }); }); - }); - describe(".ifMachine", () => { - it("resolves to particular value on initialization", () => { - const value = "redirect"; - expect(model.ifMachine).toBe(value); + describe(".ifMachine", () => { + it("resolves to particular value on initialization", () => { + const value = "redirect"; + expect(model.ifMachine).toBe(value); + }); }); - }); - describe(".ifMachineUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.ifMachineUrl).toBe(value); + describe(".ifMachineUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.ifMachineUrl).toBe(value); + }); }); - }); - describe(".sendDigits", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sendDigits"; - expect(model.sendDigits).toBe(value); + describe(".sendDigits", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sendDigits"; + expect(model.sendDigits).toBe(value); + }); }); - }); - describe(".statusCallbackUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.statusCallbackUrl).toBe(value); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".timeout", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.timeout).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".timeout", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.timeout).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.OutDial; + let model: freeclimb.OutDial = new freeclimb.OutDial({ + actionUrl: "", + callConnectUrl: "", + callingNumber: "", + destination: "", + + ifMachine: freeclimb.IfMachine.REDIRECT, + ifMachineUrl: "", + sendDigits: "", + statusCallbackUrl: "", + timeout: 0, + privacyMode: false, + }); + describe("OutDial class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.OutDial); + }); + }); + + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".callConnectUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callConnectUrl).toBe(value); + }); + }); + describe(".callingNumber", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callingNumber).toBe(value); + }); + }); + describe(".destination", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.destination).toBe(value); + }); + }); + describe(".ifMachine", () => { + it("resolves to particular value on initialization", () => { + const value = "redirect"; + expect(model.ifMachine).toBe(value); + }); + }); + describe(".ifMachineUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.ifMachineUrl).toBe(value); + }); + }); + describe(".sendDigits", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sendDigits).toBe(value); + }); + }); + describe(".statusCallbackUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe(".timeout", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.timeout).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".privacyMode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyMode).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.OutDial; + let constructorArguments = { + actionUrl: "https://123.abc", + callConnectUrl: "https://123.abc", + callingNumber: "test_callingNumber", + destination: "test_destination", + }; + let model: freeclimb.OutDial = new freeclimb.OutDial(constructorArguments); + + describe("#actionUrl", () => { + it("resolves to initialization value", () => { + expect(model.actionUrl).toBe(constructorArguments["actionUrl"]); + }); + }); + describe("#callConnectUrl", () => { + it("resolves to initialization value", () => { + expect(model.callConnectUrl).toBe( + constructorArguments["callConnectUrl"], + ); + }); + }); + describe("#callingNumber", () => { + it("resolves to initialization value", () => { + expect(model.callingNumber).toBe(constructorArguments["callingNumber"]); + }); + }); + describe("#destination", () => { + it("resolves to initialization value", () => { + expect(model.destination).toBe(constructorArguments["destination"]); + }); + }); + describe("#ifMachine", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "ifMachine", + )?.defaultValue; + expect(model.ifMachine).toBe(value); + }); + }); + describe("#ifMachineUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "ifMachineUrl", + )?.defaultValue; + expect(model.ifMachineUrl).toBe(value); + }); + }); + describe("#sendDigits", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sendDigits", + )?.defaultValue; + expect(model.sendDigits).toBe(value); + }); + }); + describe("#statusCallbackUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "statusCallbackUrl", + )?.defaultValue; + expect(model.statusCallbackUrl).toBe(value); + }); + }); + describe("#timeout", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "timeout", + )?.defaultValue; + expect(model.timeout).toBe(value); + }); + }); + describe("#privacyMode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyMode", + )?.defaultValue; + expect(model.privacyMode).toBe(value); + }); }); }); }); diff --git a/__tests__/models/OutDialApiConnectWebhook.spec.ts b/__tests__/models/OutDialApiConnectWebhook.spec.ts index 31c12bf..a92790e 100644 --- a/__tests__/models/OutDialApiConnectWebhook.spec.ts +++ b/__tests__/models/OutDialApiConnectWebhook.spec.ts @@ -2,94 +2,277 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("OutDialApiConnectWebhook", () => { - let model: freeclimb.OutDialApiConnectWebhook = - new freeclimb.OutDialApiConnectWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - callId: "test_callId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.OutDialApiConnectWebhook; + let model: freeclimb.OutDialApiConnectWebhook = + new freeclimb.OutDialApiConnectWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + callId: "test_callId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - parentCallId: "test_parentCallId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + parentCallId: "test_parentCallId", + }); + describe("OutDialApiConnectWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook); + }); }); - describe("OutDialApiConnectWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of OutDialApiConnectWebhook", () => { + expect( + freeclimb.OutDialApiConnectWebhook.deserialize( + '{ "requestType": "outDialApiConnect"}', + ), + ).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.OutDialApiConnectWebhook; + let model: freeclimb.OutDialApiConnectWebhook = + new freeclimb.OutDialApiConnectWebhook({ + requestType: "", + accountId: "", + callId: "", + from: "", + to: "", - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + parentCallId: "", + }); + describe("OutDialApiConnectWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of OutDialApiConnectWebhook", () => { + expect( + freeclimb.OutDialApiConnectWebhook.deserialize( + '{ "requestType": "outDialApiConnect"}', + ), + ).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of OutDialApiConnectWebhook", () => { - expect( - freeclimb.OutDialApiConnectWebhook.deserialize( - '{ "requestType": "outDialApiConnect"}', - ), - ).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.OutDialApiConnectWebhook; + let constructorArguments = {}; + let model: freeclimb.OutDialApiConnectWebhook = + new freeclimb.OutDialApiConnectWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/OutDialConnectWebhook.spec.ts b/__tests__/models/OutDialConnectWebhook.spec.ts index 8e1850a..b6e32bc 100644 --- a/__tests__/models/OutDialConnectWebhook.spec.ts +++ b/__tests__/models/OutDialConnectWebhook.spec.ts @@ -2,94 +2,277 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("OutDialConnectWebhook", () => { - let model: freeclimb.OutDialConnectWebhook = - new freeclimb.OutDialConnectWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - callId: "test_callId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.OutDialConnectWebhook; + let model: freeclimb.OutDialConnectWebhook = + new freeclimb.OutDialConnectWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + callId: "test_callId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - parentCallId: "test_parentCallId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + parentCallId: "test_parentCallId", + }); + describe("OutDialConnectWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.OutDialConnectWebhook); + }); }); - describe("OutDialConnectWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.OutDialConnectWebhook); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of OutDialConnectWebhook", () => { + expect( + freeclimb.OutDialConnectWebhook.deserialize( + '{ "requestType": "outDialConnect"}', + ), + ).toBeInstanceOf(freeclimb.OutDialConnectWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.OutDialConnectWebhook; + let model: freeclimb.OutDialConnectWebhook = + new freeclimb.OutDialConnectWebhook({ + requestType: "", + accountId: "", + callId: "", + from: "", + to: "", - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + parentCallId: "", + }); + describe("OutDialConnectWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.OutDialConnectWebhook); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of OutDialConnectWebhook", () => { + expect( + freeclimb.OutDialConnectWebhook.deserialize( + '{ "requestType": "outDialConnect"}', + ), + ).toBeInstanceOf(freeclimb.OutDialConnectWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of OutDialConnectWebhook", () => { - expect( - freeclimb.OutDialConnectWebhook.deserialize( - '{ "requestType": "outDialConnect"}', - ), - ).toBeInstanceOf(freeclimb.OutDialConnectWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.OutDialConnectWebhook; + let constructorArguments = {}; + let model: freeclimb.OutDialConnectWebhook = + new freeclimb.OutDialConnectWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/OutDialStartWebhook.spec.ts b/__tests__/models/OutDialStartWebhook.spec.ts index 80367c3..1638d7c 100644 --- a/__tests__/models/OutDialStartWebhook.spec.ts +++ b/__tests__/models/OutDialStartWebhook.spec.ts @@ -2,100 +2,299 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("OutDialStartWebhook", () => { - let model: freeclimb.OutDialStartWebhook = new freeclimb.OutDialStartWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - callId: "test_callId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.OutDialStartWebhook; + let model: freeclimb.OutDialStartWebhook = + new freeclimb.OutDialStartWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + callId: "test_callId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - dialCallId: "test_dialCallId", - parentCallId: "test_parentCallId", - }); - describe("OutDialStartWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.OutDialStartWebhook); + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + dialCallId: "test_dialCallId", + parentCallId: "test_parentCallId", + }); + describe("OutDialStartWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.OutDialStartWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".dialCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dialCallId"; - expect(model.dialCallId).toBe(value); + describe(".dialCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dialCallId"; + expect(model.dialCallId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of OutDialStartWebhook", () => { + expect( + freeclimb.OutDialStartWebhook.deserialize( + '{ "requestType": "outDialStart"}', + ), + ).toBeInstanceOf(freeclimb.OutDialStartWebhook); + }); }); }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.OutDialStartWebhook; + let model: freeclimb.OutDialStartWebhook = + new freeclimb.OutDialStartWebhook({ + requestType: "", + accountId: "", + callId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + dialCallId: "", + parentCallId: "", + }); + describe("OutDialStartWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.OutDialStartWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".dialCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dialCallId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of OutDialStartWebhook", () => { + expect( + freeclimb.OutDialStartWebhook.deserialize( + '{ "requestType": "outDialStart"}', + ), + ).toBeInstanceOf(freeclimb.OutDialStartWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of OutDialStartWebhook", () => { - expect( - freeclimb.OutDialStartWebhook.deserialize( - '{ "requestType": "outDialStart"}', - ), - ).toBeInstanceOf(freeclimb.OutDialStartWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.OutDialStartWebhook; + let constructorArguments = {}; + let model: freeclimb.OutDialStartWebhook = + new freeclimb.OutDialStartWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#dialCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "dialCallId", + )?.defaultValue; + expect(model.dialCallId).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/PaginationModel.spec.ts b/__tests__/models/PaginationModel.spec.ts index 0349f23..4434477 100644 --- a/__tests__/models/PaginationModel.spec.ts +++ b/__tests__/models/PaginationModel.spec.ts @@ -2,60 +2,186 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("PaginationModel", () => { - let model: freeclimb.PaginationModel = new freeclimb.PaginationModel({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - }); - describe("PaginationModel class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.PaginationModel); + describe("Test with truthy values", () => { + const Klass = freeclimb.PaginationModel; + let model: freeclimb.PaginationModel = new freeclimb.PaginationModel({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("PaginationModel class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.PaginationModel); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); }); }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.PaginationModel; + let model: freeclimb.PaginationModel = new freeclimb.PaginationModel({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + }); + describe("PaginationModel class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.PaginationModel); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.PaginationModel; + let constructorArguments = {}; + let model: freeclimb.PaginationModel = new freeclimb.PaginationModel( + constructorArguments, + ); + + describe("#total", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "total", + )?.defaultValue; + expect(model.total).toBe(value); + }); + }); + describe("#start", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "start", + )?.defaultValue; + expect(model.start).toBe(value); + }); + }); + describe("#end", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "end", + )?.defaultValue; + expect(model.end).toBe(value); + }); + }); + describe("#page", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "page", + )?.defaultValue; + expect(model.page).toBe(value); + }); + }); + describe("#numPages", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "numPages", + )?.defaultValue; + expect(model.numPages).toBe(value); + }); + }); + describe("#pageSize", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "pageSize", + )?.defaultValue; + expect(model.pageSize).toBe(value); + }); + }); + describe("#nextPageUri", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "nextPageUri", + )?.defaultValue; + expect(model.nextPageUri).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Park.spec.ts b/__tests__/models/Park.spec.ts index 81d7ccb..2f6f62a 100644 --- a/__tests__/models/Park.spec.ts +++ b/__tests__/models/Park.spec.ts @@ -2,33 +2,95 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Park", () => { - let model: freeclimb.Park = new freeclimb.Park({ - waitUrl: "https://123.abc", - actionUrl: "https://123.abc", - notificationUrl: "https://123.abc", - }); - describe("Park class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Park); + describe("Test with truthy values", () => { + const Klass = freeclimb.Park; + let model: freeclimb.Park = new freeclimb.Park({ + waitUrl: "https://123.abc", + actionUrl: "https://123.abc", + notificationUrl: "https://123.abc", + }); + describe("Park class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Park); + }); }); - }); - describe(".waitUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.waitUrl).toBe(value); + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.waitUrl).toBe(value); + }); + }); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.notificationUrl).toBe(value); + }); }); }); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.Park; + let model: freeclimb.Park = new freeclimb.Park({ + waitUrl: "", + actionUrl: "", + notificationUrl: "", + }); + describe("Park class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Park); + }); + }); + + describe(".waitUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.waitUrl).toBe(value); + }); + }); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.notificationUrl).toBe(value); + }); }); }); - describe(".notificationUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.notificationUrl).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.Park; + let constructorArguments = { + waitUrl: "https://123.abc", + actionUrl: "https://123.abc", + }; + let model: freeclimb.Park = new freeclimb.Park(constructorArguments); + + describe("#waitUrl", () => { + it("resolves to initialization value", () => { + expect(model.waitUrl).toBe(constructorArguments["waitUrl"]); + }); + }); + describe("#actionUrl", () => { + it("resolves to initialization value", () => { + expect(model.actionUrl).toBe(constructorArguments["actionUrl"]); + }); + }); + describe("#notificationUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "notificationUrl", + )?.defaultValue; + expect(model.notificationUrl).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Pause.spec.ts b/__tests__/models/Pause.spec.ts index b6679fb..5962dd6 100644 --- a/__tests__/models/Pause.spec.ts +++ b/__tests__/models/Pause.spec.ts @@ -2,19 +2,53 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Pause", () => { - let model: freeclimb.Pause = new freeclimb.Pause({ - length: 1, + describe("Test with truthy values", () => { + const Klass = freeclimb.Pause; + let model: freeclimb.Pause = new freeclimb.Pause({ + length: 1, + }); + describe("Pause class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Pause); + }); + }); + + describe(".length", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.length).toBe(value); + }); + }); }); - describe("Pause class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Pause); + describe("Test with falsy values", () => { + const Klass = freeclimb.Pause; + let model: freeclimb.Pause = new freeclimb.Pause({ + length: 0, + }); + describe("Pause class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Pause); + }); + }); + + describe(".length", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.length).toBe(value); + }); }); }); + describe("Test with only required values", () => { + const Klass = freeclimb.Pause; + let constructorArguments = { + length: 1, + }; + let model: freeclimb.Pause = new freeclimb.Pause(constructorArguments); - describe(".length", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.length).toBe(value); + describe("#length", () => { + it("resolves to initialization value", () => { + expect(model.length).toBe(constructorArguments["length"]); + }); }); }); }); diff --git a/__tests__/models/PerclCommand.spec.ts b/__tests__/models/PerclCommand.spec.ts index 2ccdff9..8f915a4 100644 --- a/__tests__/models/PerclCommand.spec.ts +++ b/__tests__/models/PerclCommand.spec.ts @@ -2,10 +2,38 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("PerclCommand", () => { - let model: freeclimb.PerclCommand = new freeclimb.PerclCommand({}); - describe("PerclCommand class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.PerclCommand); + describe("Test with truthy values", () => { + const Klass = freeclimb.PerclCommand; + let model: freeclimb.PerclCommand = new freeclimb.PerclCommand({}); + describe("PerclCommand class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.PerclCommand); + }); + }); + }); + describe("Test with falsy values", () => { + const Klass = freeclimb.PerclCommand; + let model: freeclimb.PerclCommand = new freeclimb.PerclCommand({}); + describe("PerclCommand class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.PerclCommand); + }); + }); + }); + describe("Test with only required values", () => { + const Klass = freeclimb.PerclCommand; + let constructorArguments = {}; + let model: freeclimb.PerclCommand = new freeclimb.PerclCommand( + constructorArguments, + ); + + describe("#command", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "command", + )?.defaultValue; + expect(model.command).toBe(value); + }); }); }); }); diff --git a/__tests__/models/PerclScript.spec.ts b/__tests__/models/PerclScript.spec.ts index 6256e0a..d3ca17c 100644 --- a/__tests__/models/PerclScript.spec.ts +++ b/__tests__/models/PerclScript.spec.ts @@ -2,18 +2,54 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("PerclScript", () => { - let model: freeclimb.PerclScript = new freeclimb.PerclScript({ - commands: [], + describe("Test with truthy values", () => { + const Klass = freeclimb.PerclScript; + let model: freeclimb.PerclScript = new freeclimb.PerclScript({ + commands: [], + }); + describe("PerclScript class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.PerclScript); + }); + }); + describe(".commands", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.PerclCommand[] = []; + expect(model.commands).toStrictEqual(value); + }); + }); }); - describe("PerclScript class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.PerclScript); + describe("Test with falsy values", () => { + const Klass = freeclimb.PerclScript; + let model: freeclimb.PerclScript = new freeclimb.PerclScript({ + commands: [], + }); + describe("PerclScript class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.PerclScript); + }); + }); + describe(".commands", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.PerclCommand[] = []; + expect(model.commands).toStrictEqual(value); + }); }); }); - describe(".commands", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.PerclCommand[] = []; - expect(model.commands).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.PerclScript; + let constructorArguments = {}; + let model: freeclimb.PerclScript = new freeclimb.PerclScript( + constructorArguments, + ); + + describe("#commands", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "commands", + )?.defaultValue; + expect(model.commands).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Play.spec.ts b/__tests__/models/Play.spec.ts index b3d63ba..e0eaaae 100644 --- a/__tests__/models/Play.spec.ts +++ b/__tests__/models/Play.spec.ts @@ -2,33 +2,97 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Play", () => { - let model: freeclimb.Play = new freeclimb.Play({ - file: "test_file", - loop: 1, - privacyMode: true, - }); - describe("Play class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Play); + describe("Test with truthy values", () => { + const Klass = freeclimb.Play; + let model: freeclimb.Play = new freeclimb.Play({ + file: "test_file", + loop: 1, + privacyMode: true, + }); + describe("Play class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Play); + }); }); - }); - describe(".file", () => { - it("resolves to particular value on initialization", () => { - const value = "test_file"; - expect(model.file).toBe(value); + describe(".file", () => { + it("resolves to particular value on initialization", () => { + const value = "test_file"; + expect(model.file).toBe(value); + }); + }); + describe(".loop", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.loop).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".loop", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.loop).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.Play; + let model: freeclimb.Play = new freeclimb.Play({ + file: "", + loop: 0, + privacyMode: false, + }); + describe("Play class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Play); + }); + }); + + describe(".file", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.file).toBe(value); + }); + }); + describe(".loop", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.loop).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".privacyMode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyMode).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.Play; + let constructorArguments = { + file: "test_file", + }; + let model: freeclimb.Play = new freeclimb.Play(constructorArguments); + + describe("#file", () => { + it("resolves to initialization value", () => { + expect(model.file).toBe(constructorArguments["file"]); + }); + }); + describe("#loop", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "loop", + )?.defaultValue; + expect(model.loop).toBe(value); + }); + }); + describe("#privacyMode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyMode", + )?.defaultValue; + expect(model.privacyMode).toBe(value); + }); }); }); }); diff --git a/__tests__/models/PlayBeep.spec.ts b/__tests__/models/PlayBeep.spec.ts index faf5816..f2e9c9a 100644 --- a/__tests__/models/PlayBeep.spec.ts +++ b/__tests__/models/PlayBeep.spec.ts @@ -2,24 +2,26 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("PlayBeep", () => { - describe(".ALWAYS", () => { - it("resolves to correct value for ALWAYS enum property", () => { - expect(freeclimb.PlayBeep.ALWAYS).toBe("always"); + describe("Test with truthy values", () => { + describe(".ALWAYS", () => { + it("resolves to correct value for ALWAYS enum property", () => { + expect(freeclimb.PlayBeep.ALWAYS).toBe("always"); + }); }); - }); - describe(".NEVER", () => { - it("resolves to correct value for NEVER enum property", () => { - expect(freeclimb.PlayBeep.NEVER).toBe("never"); + describe(".NEVER", () => { + it("resolves to correct value for NEVER enum property", () => { + expect(freeclimb.PlayBeep.NEVER).toBe("never"); + }); }); - }); - describe(".ENTRY_ONLY", () => { - it("resolves to correct value for ENTRY_ONLY enum property", () => { - expect(freeclimb.PlayBeep.ENTRY_ONLY).toBe("entryOnly"); + describe(".ENTRY_ONLY", () => { + it("resolves to correct value for ENTRY_ONLY enum property", () => { + expect(freeclimb.PlayBeep.ENTRY_ONLY).toBe("entryOnly"); + }); }); - }); - describe(".EXIT_ONLY", () => { - it("resolves to correct value for EXIT_ONLY enum property", () => { - expect(freeclimb.PlayBeep.EXIT_ONLY).toBe("exitOnly"); + describe(".EXIT_ONLY", () => { + it("resolves to correct value for EXIT_ONLY enum property", () => { + expect(freeclimb.PlayBeep.EXIT_ONLY).toBe("exitOnly"); + }); }); }); }); diff --git a/__tests__/models/PlayEarlyMedia.spec.ts b/__tests__/models/PlayEarlyMedia.spec.ts index af8fefc..243efeb 100644 --- a/__tests__/models/PlayEarlyMedia.spec.ts +++ b/__tests__/models/PlayEarlyMedia.spec.ts @@ -2,19 +2,55 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("PlayEarlyMedia", () => { - let model: freeclimb.PlayEarlyMedia = new freeclimb.PlayEarlyMedia({ - file: "test_file", + describe("Test with truthy values", () => { + const Klass = freeclimb.PlayEarlyMedia; + let model: freeclimb.PlayEarlyMedia = new freeclimb.PlayEarlyMedia({ + file: "test_file", + }); + describe("PlayEarlyMedia class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.PlayEarlyMedia); + }); + }); + + describe(".file", () => { + it("resolves to particular value on initialization", () => { + const value = "test_file"; + expect(model.file).toBe(value); + }); + }); }); - describe("PlayEarlyMedia class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.PlayEarlyMedia); + describe("Test with falsy values", () => { + const Klass = freeclimb.PlayEarlyMedia; + let model: freeclimb.PlayEarlyMedia = new freeclimb.PlayEarlyMedia({ + file: "", + }); + describe("PlayEarlyMedia class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.PlayEarlyMedia); + }); + }); + + describe(".file", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.file).toBe(value); + }); }); }); + describe("Test with only required values", () => { + const Klass = freeclimb.PlayEarlyMedia; + let constructorArguments = { + file: "test_file", + }; + let model: freeclimb.PlayEarlyMedia = new freeclimb.PlayEarlyMedia( + constructorArguments, + ); - describe(".file", () => { - it("resolves to particular value on initialization", () => { - const value = "test_file"; - expect(model.file).toBe(value); + describe("#file", () => { + it("resolves to initialization value", () => { + expect(model.file).toBe(constructorArguments["file"]); + }); }); }); }); diff --git a/__tests__/models/QueueList.spec.ts b/__tests__/models/QueueList.spec.ts index 6435a59..6c110c5 100644 --- a/__tests__/models/QueueList.spec.ts +++ b/__tests__/models/QueueList.spec.ts @@ -2,67 +2,160 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("QueueList", () => { - let model: freeclimb.QueueList = new freeclimb.QueueList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - queues: [], - }); - describe("QueueList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.QueueList); + describe("Test with truthy values", () => { + const Klass = freeclimb.QueueList; + let model: freeclimb.QueueList = new freeclimb.QueueList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + queues: [], }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("QueueList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueList); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".queues", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.QueueResult[] = []; + expect(model.queues).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.QueueList; + let model: freeclimb.QueueList = new freeclimb.QueueList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + queues: [], + }); + describe("QueueList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".queues", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.QueueResult[] = []; + expect(model.queues).toStrictEqual(value); + }); }); }); - describe(".queues", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.QueueResult[] = []; - expect(model.queues).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.QueueList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.QueueList = new freeclimb.QueueList( + constructorArguments, + ); + + describe("#queues", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queues", + )?.defaultValue; + expect(model.queues).toBe(value); + }); }); }); }); diff --git a/__tests__/models/QueueMember.spec.ts b/__tests__/models/QueueMember.spec.ts index ef4e1cc..3f3591e 100644 --- a/__tests__/models/QueueMember.spec.ts +++ b/__tests__/models/QueueMember.spec.ts @@ -2,46 +2,142 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("QueueMember", () => { - let model: freeclimb.QueueMember = new freeclimb.QueueMember({ - uri: "test_uri", - callId: "test_callId", - waitTime: 1, - position: 1, - dateEnqueued: "test_dateEnqueued", - }); - describe("QueueMember class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.QueueMember); + describe("Test with truthy values", () => { + const Klass = freeclimb.QueueMember; + let model: freeclimb.QueueMember = new freeclimb.QueueMember({ + uri: "test_uri", + callId: "test_callId", + waitTime: 1, + position: 1, + dateEnqueued: "test_dateEnqueued", }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("QueueMember class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueMember); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".waitTime", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.waitTime).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".waitTime", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.waitTime).toBe(value); + }); + }); + describe(".position", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.position).toBe(value); + }); + }); + describe(".dateEnqueued", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateEnqueued"; + expect(model.dateEnqueued).toBe(value); + }); }); }); - describe(".position", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.position).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.QueueMember; + let model: freeclimb.QueueMember = new freeclimb.QueueMember({ + uri: "", + callId: "", + waitTime: 0, + position: 0, + dateEnqueued: "", + }); + describe("QueueMember class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueMember); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".waitTime", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.waitTime).toBe(value); + }); + }); + describe(".position", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.position).toBe(value); + }); + }); + describe(".dateEnqueued", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateEnqueued).toBe(value); + }); }); }); - describe(".dateEnqueued", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateEnqueued"; - expect(model.dateEnqueued).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.QueueMember; + let constructorArguments = {}; + let model: freeclimb.QueueMember = new freeclimb.QueueMember( + constructorArguments, + ); + + describe("#uri", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "uri", + )?.defaultValue; + expect(model.uri).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#waitTime", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "waitTime", + )?.defaultValue; + expect(model.waitTime).toBe(value); + }); + }); + describe("#position", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "position", + )?.defaultValue; + expect(model.position).toBe(value); + }); + }); + describe("#dateEnqueued", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "dateEnqueued", + )?.defaultValue; + expect(model.dateEnqueued).toBe(value); + }); }); }); }); diff --git a/__tests__/models/QueueMemberList.spec.ts b/__tests__/models/QueueMemberList.spec.ts index 67281a7..52fa046 100644 --- a/__tests__/models/QueueMemberList.spec.ts +++ b/__tests__/models/QueueMemberList.spec.ts @@ -2,67 +2,160 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("QueueMemberList", () => { - let model: freeclimb.QueueMemberList = new freeclimb.QueueMemberList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - queueMembers: [], - }); - describe("QueueMemberList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.QueueMemberList); + describe("Test with truthy values", () => { + const Klass = freeclimb.QueueMemberList; + let model: freeclimb.QueueMemberList = new freeclimb.QueueMemberList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + queueMembers: [], }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("QueueMemberList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueMemberList); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".queueMembers", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.QueueMember[] = []; + expect(model.queueMembers).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.QueueMemberList; + let model: freeclimb.QueueMemberList = new freeclimb.QueueMemberList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + queueMembers: [], + }); + describe("QueueMemberList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueMemberList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".queueMembers", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.QueueMember[] = []; + expect(model.queueMembers).toStrictEqual(value); + }); }); }); - describe(".queueMembers", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.QueueMember[] = []; - expect(model.queueMembers).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.QueueMemberList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.QueueMemberList = new freeclimb.QueueMemberList( + constructorArguments, + ); + + describe("#queueMembers", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueMembers", + )?.defaultValue; + expect(model.queueMembers).toBe(value); + }); }); }); }); diff --git a/__tests__/models/QueueRequest.spec.ts b/__tests__/models/QueueRequest.spec.ts index 5ad6ed4..726e447 100644 --- a/__tests__/models/QueueRequest.spec.ts +++ b/__tests__/models/QueueRequest.spec.ts @@ -2,25 +2,76 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("QueueRequest", () => { - let model: freeclimb.QueueRequest = new freeclimb.QueueRequest({ - alias: "test_alias", - maxSize: 1, - }); - describe("QueueRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.QueueRequest); + describe("Test with truthy values", () => { + const Klass = freeclimb.QueueRequest; + let model: freeclimb.QueueRequest = new freeclimb.QueueRequest({ + alias: "test_alias", + maxSize: 1, + }); + describe("QueueRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueRequest); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); + }); + describe(".maxSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.maxSize).toBe(value); + }); }); }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.QueueRequest; + let model: freeclimb.QueueRequest = new freeclimb.QueueRequest({ + alias: "", + maxSize: 0, + }); + describe("QueueRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueRequest); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".maxSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.maxSize).toBe(value); + }); }); }); - describe(".maxSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.maxSize).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.QueueRequest; + let constructorArguments = {}; + let model: freeclimb.QueueRequest = new freeclimb.QueueRequest( + constructorArguments, + ); + + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#maxSize", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "maxSize", + )?.defaultValue; + expect(model.maxSize).toBe(value); + }); }); }); }); diff --git a/__tests__/models/QueueResult.spec.ts b/__tests__/models/QueueResult.spec.ts index 5d7e86c..bb97a8f 100644 --- a/__tests__/models/QueueResult.spec.ts +++ b/__tests__/models/QueueResult.spec.ts @@ -2,89 +2,249 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("QueueResult", () => { - let model: freeclimb.QueueResult = new freeclimb.QueueResult({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - accountId: "test_accountId", - queueId: "test_queueId", - alias: "test_alias", - maxSize: 1, - currentSize: 1, - averageQueueRemovalTime: 1, - subresourceUris: {}, - }); - describe("QueueResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.QueueResult); + describe("Test with truthy values", () => { + const Klass = freeclimb.QueueResult; + let model: freeclimb.QueueResult = new freeclimb.QueueResult({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + accountId: "test_accountId", + queueId: "test_queueId", + alias: "test_alias", + maxSize: 1, + currentSize: 1, + averageQueueRemovalTime: 1, + subresourceUris: {}, }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("QueueResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueResult); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".maxSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.maxSize).toBe(value); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); }); - }); - describe(".currentSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.currentSize).toBe(value); + describe(".maxSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.maxSize).toBe(value); + }); + }); + describe(".currentSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.currentSize).toBe(value); + }); + }); + describe(".averageQueueRemovalTime", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.averageQueueRemovalTime).toBe(value); + }); + }); + describe(".subresourceUris", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); + }); }); }); - describe(".averageQueueRemovalTime", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.averageQueueRemovalTime).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.QueueResult; + let model: freeclimb.QueueResult = new freeclimb.QueueResult({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + accountId: "", + queueId: "", + alias: "", + maxSize: 0, + currentSize: 0, + averageQueueRemovalTime: 0, + subresourceUris: {}, + }); + describe("QueueResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueResult); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".maxSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.maxSize).toBe(value); + }); + }); + describe(".currentSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.currentSize).toBe(value); + }); + }); + describe(".averageQueueRemovalTime", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.averageQueueRemovalTime).toBe(value); + }); + }); + describe(".subresourceUris", () => { + it("resolves to particular value on initialization", () => { + const value = {}; + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); + }); }); }); - describe(".subresourceUris", () => { - it("resolves to particular value on initialization", () => { - const value = {}; - const receivedValue: any = model.subresourceUris; - expect(receivedValue).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.QueueResult; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.QueueResult = new freeclimb.QueueResult( + constructorArguments, + ); + + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#maxSize", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "maxSize", + )?.defaultValue; + expect(model.maxSize).toBe(value); + }); + }); + describe("#currentSize", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "currentSize", + )?.defaultValue; + expect(model.currentSize).toBe(value); + }); + }); + describe("#averageQueueRemovalTime", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "averageQueueRemovalTime", + )?.defaultValue; + expect(model.averageQueueRemovalTime).toBe(value); + }); + }); + describe("#subresourceUris", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subresourceUris", + )?.defaultValue; + expect(model.subresourceUris).toBe(value); + }); }); }); }); diff --git a/__tests__/models/QueueResultStatus.spec.ts b/__tests__/models/QueueResultStatus.spec.ts index 8abbf42..5862c5d 100644 --- a/__tests__/models/QueueResultStatus.spec.ts +++ b/__tests__/models/QueueResultStatus.spec.ts @@ -2,24 +2,26 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("QueueResultStatus", () => { - describe(".QUEUE_FULL", () => { - it("resolves to correct value for QUEUE_FULL enum property", () => { - expect(freeclimb.QueueResultStatus.QUEUE_FULL).toBe("queueFull"); + describe("Test with truthy values", () => { + describe(".QUEUE_FULL", () => { + it("resolves to correct value for QUEUE_FULL enum property", () => { + expect(freeclimb.QueueResultStatus.QUEUE_FULL).toBe("queueFull"); + }); }); - }); - describe(".DEQUEUED", () => { - it("resolves to correct value for DEQUEUED enum property", () => { - expect(freeclimb.QueueResultStatus.DEQUEUED).toBe("dequeued"); + describe(".DEQUEUED", () => { + it("resolves to correct value for DEQUEUED enum property", () => { + expect(freeclimb.QueueResultStatus.DEQUEUED).toBe("dequeued"); + }); }); - }); - describe(".HANGUP", () => { - it("resolves to correct value for HANGUP enum property", () => { - expect(freeclimb.QueueResultStatus.HANGUP).toBe("hangup"); + describe(".HANGUP", () => { + it("resolves to correct value for HANGUP enum property", () => { + expect(freeclimb.QueueResultStatus.HANGUP).toBe("hangup"); + }); }); - }); - describe(".SYSTEM_ERROR", () => { - it("resolves to correct value for SYSTEM_ERROR enum property", () => { - expect(freeclimb.QueueResultStatus.SYSTEM_ERROR).toBe("systemError"); + describe(".SYSTEM_ERROR", () => { + it("resolves to correct value for SYSTEM_ERROR enum property", () => { + expect(freeclimb.QueueResultStatus.SYSTEM_ERROR).toBe("systemError"); + }); }); }); }); diff --git a/__tests__/models/QueueWaitWebhook.spec.ts b/__tests__/models/QueueWaitWebhook.spec.ts index 1e123f0..5f503bf 100644 --- a/__tests__/models/QueueWaitWebhook.spec.ts +++ b/__tests__/models/QueueWaitWebhook.spec.ts @@ -2,105 +2,320 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("QueueWaitWebhook", () => { - let model: freeclimb.QueueWaitWebhook = new freeclimb.QueueWaitWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - callId: "test_callId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.QueueWaitWebhook; + let model: freeclimb.QueueWaitWebhook = new freeclimb.QueueWaitWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + callId: "test_callId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - queuePosition: "test_queuePosition", - queueTime: 1, - currentQueueSize: 1, - }); - describe("QueueWaitWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.QueueWaitWebhook); + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + queuePosition: "test_queuePosition", + queueTime: 1, + currentQueueSize: 1, + }); + describe("QueueWaitWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueWaitWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".queuePosition", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queuePosition"; - expect(model.queuePosition).toBe(value); + describe(".queuePosition", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queuePosition"; + expect(model.queuePosition).toBe(value); + }); }); - }); - describe(".queueTime", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.queueTime).toBe(value); + describe(".queueTime", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.queueTime).toBe(value); + }); + }); + describe(".currentQueueSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.currentQueueSize).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of QueueWaitWebhook", () => { + expect( + freeclimb.QueueWaitWebhook.deserialize( + '{ "requestType": "queueWait"}', + ), + ).toBeInstanceOf(freeclimb.QueueWaitWebhook); + }); }); }); - describe(".currentQueueSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.currentQueueSize).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.QueueWaitWebhook; + let model: freeclimb.QueueWaitWebhook = new freeclimb.QueueWaitWebhook({ + requestType: "", + accountId: "", + callId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + queuePosition: "", + queueTime: 0, + currentQueueSize: 0, + }); + describe("QueueWaitWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.QueueWaitWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".queuePosition", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queuePosition).toBe(value); + }); + }); + describe(".queueTime", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.queueTime).toBe(value); + }); + }); + describe(".currentQueueSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.currentQueueSize).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of QueueWaitWebhook", () => { + expect( + freeclimb.QueueWaitWebhook.deserialize( + '{ "requestType": "queueWait"}', + ), + ).toBeInstanceOf(freeclimb.QueueWaitWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of QueueWaitWebhook", () => { - expect( - freeclimb.QueueWaitWebhook.deserialize('{ "requestType": "queueWait"}'), - ).toBeInstanceOf(freeclimb.QueueWaitWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.QueueWaitWebhook; + let constructorArguments = {}; + let model: freeclimb.QueueWaitWebhook = new freeclimb.QueueWaitWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#queuePosition", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queuePosition", + )?.defaultValue; + expect(model.queuePosition).toBe(value); + }); + }); + describe("#queueTime", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueTime", + )?.defaultValue; + expect(model.queueTime).toBe(value); + }); + }); + describe("#currentQueueSize", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "currentQueueSize", + )?.defaultValue; + expect(model.currentQueueSize).toBe(value); + }); }); }); }); diff --git a/__tests__/models/RecordUtterance.spec.ts b/__tests__/models/RecordUtterance.spec.ts index 276bc0c..d5c238a 100644 --- a/__tests__/models/RecordUtterance.spec.ts +++ b/__tests__/models/RecordUtterance.spec.ts @@ -2,61 +2,187 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("RecordUtterance", () => { - let model: freeclimb.RecordUtterance = new freeclimb.RecordUtterance({ - actionUrl: "https://123.abc", - silenceTimeoutMs: 1, - finishOnKey: "test_finishOnKey", - maxLengthSec: 1, - playBeep: true, - autoStart: true, - privacyMode: true, - }); - describe("RecordUtterance class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.RecordUtterance); + describe("Test with truthy values", () => { + const Klass = freeclimb.RecordUtterance; + let model: freeclimb.RecordUtterance = new freeclimb.RecordUtterance({ + actionUrl: "https://123.abc", + silenceTimeoutMs: 1, + finishOnKey: "test_finishOnKey", + maxLengthSec: 1, + playBeep: true, + autoStart: true, + privacyMode: true, + }); + describe("RecordUtterance class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RecordUtterance); + }); }); - }); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); }); - }); - describe(".silenceTimeoutMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.silenceTimeoutMs).toBe(value); + describe(".silenceTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.silenceTimeoutMs).toBe(value); + }); }); - }); - describe(".finishOnKey", () => { - it("resolves to particular value on initialization", () => { - const value = "test_finishOnKey"; - expect(model.finishOnKey).toBe(value); + describe(".finishOnKey", () => { + it("resolves to particular value on initialization", () => { + const value = "test_finishOnKey"; + expect(model.finishOnKey).toBe(value); + }); }); - }); - describe(".maxLengthSec", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.maxLengthSec).toBe(value); + describe(".maxLengthSec", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.maxLengthSec).toBe(value); + }); }); - }); - describe(".playBeep", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.playBeep).toBe(value); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.playBeep).toBe(value); + }); + }); + describe(".autoStart", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.autoStart).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".autoStart", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.autoStart).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.RecordUtterance; + let model: freeclimb.RecordUtterance = new freeclimb.RecordUtterance({ + actionUrl: "", + silenceTimeoutMs: 0, + finishOnKey: "", + maxLengthSec: 0, + playBeep: false, + autoStart: false, + privacyMode: false, + }); + describe("RecordUtterance class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RecordUtterance); + }); + }); + + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".silenceTimeoutMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.silenceTimeoutMs).toBe(value); + }); + }); + describe(".finishOnKey", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.finishOnKey).toBe(value); + }); + }); + describe(".maxLengthSec", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.maxLengthSec).toBe(value); + }); + }); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.playBeep).toBe(value); + }); + }); + describe(".autoStart", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.autoStart).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".privacyMode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyMode).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.RecordUtterance; + let constructorArguments = { + actionUrl: "https://123.abc", + }; + let model: freeclimb.RecordUtterance = new freeclimb.RecordUtterance( + constructorArguments, + ); + + describe("#actionUrl", () => { + it("resolves to initialization value", () => { + expect(model.actionUrl).toBe(constructorArguments["actionUrl"]); + }); + }); + describe("#silenceTimeoutMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "silenceTimeoutMs", + )?.defaultValue; + expect(model.silenceTimeoutMs).toBe(value); + }); + }); + describe("#finishOnKey", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "finishOnKey", + )?.defaultValue; + expect(model.finishOnKey).toBe(value); + }); + }); + describe("#maxLengthSec", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "maxLengthSec", + )?.defaultValue; + expect(model.maxLengthSec).toBe(value); + }); + }); + describe("#playBeep", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "playBeep", + )?.defaultValue; + expect(model.playBeep).toBe(value); + }); + }); + describe("#autoStart", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "autoStart", + )?.defaultValue; + expect(model.autoStart).toBe(value); + }); + }); + describe("#privacyMode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyMode", + )?.defaultValue; + expect(model.privacyMode).toBe(value); + }); }); }); }); diff --git a/__tests__/models/RecordUtteranceTermReason.spec.ts b/__tests__/models/RecordUtteranceTermReason.spec.ts index ec921d1..0ac9076 100644 --- a/__tests__/models/RecordUtteranceTermReason.spec.ts +++ b/__tests__/models/RecordUtteranceTermReason.spec.ts @@ -2,24 +2,30 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("RecordUtteranceTermReason", () => { - describe(".FINISH_KEY", () => { - it("resolves to correct value for FINISH_KEY enum property", () => { - expect(freeclimb.RecordUtteranceTermReason.FINISH_KEY).toBe("finishKey"); + describe("Test with truthy values", () => { + describe(".FINISH_KEY", () => { + it("resolves to correct value for FINISH_KEY enum property", () => { + expect(freeclimb.RecordUtteranceTermReason.FINISH_KEY).toBe( + "finishKey", + ); + }); }); - }); - describe(".TIMEOUT", () => { - it("resolves to correct value for TIMEOUT enum property", () => { - expect(freeclimb.RecordUtteranceTermReason.TIMEOUT).toBe("timeout"); + describe(".TIMEOUT", () => { + it("resolves to correct value for TIMEOUT enum property", () => { + expect(freeclimb.RecordUtteranceTermReason.TIMEOUT).toBe("timeout"); + }); }); - }); - describe(".HANGUP", () => { - it("resolves to correct value for HANGUP enum property", () => { - expect(freeclimb.RecordUtteranceTermReason.HANGUP).toBe("hangup"); + describe(".HANGUP", () => { + it("resolves to correct value for HANGUP enum property", () => { + expect(freeclimb.RecordUtteranceTermReason.HANGUP).toBe("hangup"); + }); }); - }); - describe(".MAX_LENGTH", () => { - it("resolves to correct value for MAX_LENGTH enum property", () => { - expect(freeclimb.RecordUtteranceTermReason.MAX_LENGTH).toBe("maxLength"); + describe(".MAX_LENGTH", () => { + it("resolves to correct value for MAX_LENGTH enum property", () => { + expect(freeclimb.RecordUtteranceTermReason.MAX_LENGTH).toBe( + "maxLength", + ); + }); }); }); }); diff --git a/__tests__/models/RecordWebhook.spec.ts b/__tests__/models/RecordWebhook.spec.ts index 4916e72..4571e2e 100644 --- a/__tests__/models/RecordWebhook.spec.ts +++ b/__tests__/models/RecordWebhook.spec.ts @@ -2,141 +2,428 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("RecordWebhook", () => { - let model: freeclimb.RecordWebhook = new freeclimb.RecordWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - callId: "test_callId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.RecordWebhook; + let model: freeclimb.RecordWebhook = new freeclimb.RecordWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + callId: "test_callId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - recordingId: "test_recordingId", - recordingUrl: "https://123.abc", - recordingSize: "test_recordingSize", - recordingFormat: "test_recordingFormat", - recordingDurationSec: 1, + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + recordingId: "test_recordingId", + recordingUrl: "https://123.abc", + recordingSize: "test_recordingSize", + recordingFormat: "test_recordingFormat", + recordingDurationSec: 1, - termReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY, - parentCallId: "test_parentCallId", - privacyMode: true, - }); - describe("RecordWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.RecordWebhook); + termReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY, + parentCallId: "test_parentCallId", + privacyMode: true, + }); + describe("RecordWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RecordWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".recordingId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingId"; - expect(model.recordingId).toBe(value); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingId"; + expect(model.recordingId).toBe(value); + }); }); - }); - describe(".recordingUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.recordingUrl).toBe(value); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.recordingUrl).toBe(value); + }); }); - }); - describe(".recordingSize", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingSize"; - expect(model.recordingSize).toBe(value); + describe(".recordingSize", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingSize"; + expect(model.recordingSize).toBe(value); + }); }); - }); - describe(".recordingFormat", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingFormat"; - expect(model.recordingFormat).toBe(value); + describe(".recordingFormat", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingFormat"; + expect(model.recordingFormat).toBe(value); + }); }); - }); - describe(".recordingDurationSec", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.recordingDurationSec).toBe(value); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.recordingDurationSec).toBe(value); + }); }); - }); - describe(".termReason", () => { - it("resolves to particular value on initialization", () => { - const value = "finishKey"; - expect(model.termReason).toBe(value); + describe(".termReason", () => { + it("resolves to particular value on initialization", () => { + const value = "finishKey"; + expect(model.termReason).toBe(value); + }); }); - }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyMode).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of RecordWebhook", () => { + expect( + freeclimb.RecordWebhook.deserialize('{ "requestType": "record"}'), + ).toBeInstanceOf(freeclimb.RecordWebhook); + }); }); }); - describe(".privacyMode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyMode).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.RecordWebhook; + let model: freeclimb.RecordWebhook = new freeclimb.RecordWebhook({ + requestType: "", + accountId: "", + callId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + recordingId: "", + recordingUrl: "", + recordingSize: "", + recordingFormat: "", + recordingDurationSec: 0, + + termReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY, + parentCallId: "", + privacyMode: false, + }); + describe("RecordWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RecordWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingUrl).toBe(value); + }); + }); + describe(".recordingSize", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingSize).toBe(value); + }); + }); + describe(".recordingFormat", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingFormat).toBe(value); + }); + }); + describe(".recordingDurationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe(".termReason", () => { + it("resolves to particular value on initialization", () => { + const value = "finishKey"; + expect(model.termReason).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyMode).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of RecordWebhook", () => { + expect( + freeclimb.RecordWebhook.deserialize('{ "requestType": "record"}'), + ).toBeInstanceOf(freeclimb.RecordWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of RecordWebhook", () => { - expect( - freeclimb.RecordWebhook.deserialize('{ "requestType": "record"}'), - ).toBeInstanceOf(freeclimb.RecordWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.RecordWebhook; + let constructorArguments = {}; + let model: freeclimb.RecordWebhook = new freeclimb.RecordWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#recordingId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingId", + )?.defaultValue; + expect(model.recordingId).toBe(value); + }); + }); + describe("#recordingUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingUrl", + )?.defaultValue; + expect(model.recordingUrl).toBe(value); + }); + }); + describe("#recordingSize", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingSize", + )?.defaultValue; + expect(model.recordingSize).toBe(value); + }); + }); + describe("#recordingFormat", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingFormat", + )?.defaultValue; + expect(model.recordingFormat).toBe(value); + }); + }); + describe("#recordingDurationSec", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingDurationSec", + )?.defaultValue; + expect(model.recordingDurationSec).toBe(value); + }); + }); + describe("#termReason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "termReason", + )?.defaultValue; + expect(model.termReason).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); + }); + describe("#privacyMode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyMode", + )?.defaultValue; + expect(model.privacyMode).toBe(value); + }); }); }); }); diff --git a/__tests__/models/RecordingList.spec.ts b/__tests__/models/RecordingList.spec.ts index b6d01e8..120f709 100644 --- a/__tests__/models/RecordingList.spec.ts +++ b/__tests__/models/RecordingList.spec.ts @@ -2,67 +2,160 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("RecordingList", () => { - let model: freeclimb.RecordingList = new freeclimb.RecordingList({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - recordings: [], - }); - describe("RecordingList class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.RecordingList); + describe("Test with truthy values", () => { + const Klass = freeclimb.RecordingList; + let model: freeclimb.RecordingList = new freeclimb.RecordingList({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + recordings: [], }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe("RecordingList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RecordingList); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".recordings", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.RecordingResult[] = []; + expect(model.recordings).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.RecordingList; + let model: freeclimb.RecordingList = new freeclimb.RecordingList({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + recordings: [], + }); + describe("RecordingList class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RecordingList); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".recordings", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.RecordingResult[] = []; + expect(model.recordings).toStrictEqual(value); + }); }); }); - describe(".recordings", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.RecordingResult[] = []; - expect(model.recordings).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.RecordingList; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.RecordingList = new freeclimb.RecordingList( + constructorArguments, + ); + + describe("#recordings", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordings", + )?.defaultValue; + expect(model.recordings).toBe(value); + }); }); }); }); diff --git a/__tests__/models/RecordingResult.spec.ts b/__tests__/models/RecordingResult.spec.ts index d74b380..e92d89d 100644 --- a/__tests__/models/RecordingResult.spec.ts +++ b/__tests__/models/RecordingResult.spec.ts @@ -2,74 +2,203 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("RecordingResult", () => { - let model: freeclimb.RecordingResult = new freeclimb.RecordingResult({ - uri: "test_uri", - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - recordingId: "test_recordingId", - accountId: "test_accountId", - callId: "test_callId", - durationSec: 1, - conferenceId: "test_conferenceId", - }); - describe("RecordingResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.RecordingResult); + describe("Test with truthy values", () => { + const Klass = freeclimb.RecordingResult; + let model: freeclimb.RecordingResult = new freeclimb.RecordingResult({ + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + recordingId: "test_recordingId", + accountId: "test_accountId", + callId: "test_callId", + durationSec: 1, + conferenceId: "test_conferenceId", }); - }); - describe(".uri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_uri"; - expect(model.uri).toBe(value); + describe("RecordingResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RecordingResult); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_uri"; + expect(model.uri).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); }); - }); - describe(".recordingId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingId"; - expect(model.recordingId).toBe(value); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingId"; + expect(model.recordingId).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".durationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.durationSec).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); }); - describe(".durationSec", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.durationSec).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.RecordingResult; + let model: freeclimb.RecordingResult = new freeclimb.RecordingResult({ + uri: "", + dateCreated: "", + dateUpdated: "", + revision: 0, + recordingId: "", + accountId: "", + callId: "", + durationSec: 0, + conferenceId: "", + }); + describe("RecordingResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RecordingResult); + }); + }); + describe(".uri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.uri).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); + }); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingId).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".durationSec", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.durationSec).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); }); }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.RecordingResult; + let constructorArguments = { + uri: "test_uri", + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.RecordingResult = new freeclimb.RecordingResult( + constructorArguments, + ); + + describe("#recordingId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingId", + )?.defaultValue; + expect(model.recordingId).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#durationSec", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "durationSec", + )?.defaultValue; + expect(model.durationSec).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Redirect.spec.ts b/__tests__/models/Redirect.spec.ts index 7932e0e..d93e526 100644 --- a/__tests__/models/Redirect.spec.ts +++ b/__tests__/models/Redirect.spec.ts @@ -2,19 +2,55 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Redirect", () => { - let model: freeclimb.Redirect = new freeclimb.Redirect({ - actionUrl: "https://123.abc", + describe("Test with truthy values", () => { + const Klass = freeclimb.Redirect; + let model: freeclimb.Redirect = new freeclimb.Redirect({ + actionUrl: "https://123.abc", + }); + describe("Redirect class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Redirect); + }); + }); + + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); + }); }); - describe("Redirect class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Redirect); + describe("Test with falsy values", () => { + const Klass = freeclimb.Redirect; + let model: freeclimb.Redirect = new freeclimb.Redirect({ + actionUrl: "", + }); + describe("Redirect class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Redirect); + }); + }); + + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); }); }); + describe("Test with only required values", () => { + const Klass = freeclimb.Redirect; + let constructorArguments = { + actionUrl: "https://123.abc", + }; + let model: freeclimb.Redirect = new freeclimb.Redirect( + constructorArguments, + ); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe("#actionUrl", () => { + it("resolves to initialization value", () => { + expect(model.actionUrl).toBe(constructorArguments["actionUrl"]); + }); }); }); }); diff --git a/__tests__/models/RedirectWebhook.spec.ts b/__tests__/models/RedirectWebhook.spec.ts index c03ce38..1e19ca1 100644 --- a/__tests__/models/RedirectWebhook.spec.ts +++ b/__tests__/models/RedirectWebhook.spec.ts @@ -2,91 +2,272 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("RedirectWebhook", () => { - let model: freeclimb.RedirectWebhook = new freeclimb.RedirectWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - callId: "test_callId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.RedirectWebhook; + let model: freeclimb.RedirectWebhook = new freeclimb.RedirectWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + callId: "test_callId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", - parentCallId: "test_parentCallId", - }); - describe("RedirectWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.RedirectWebhook); + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", + parentCallId: "test_parentCallId", + }); + describe("RedirectWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RedirectWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_parentCallId"; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of RedirectWebhook", () => { + expect( + freeclimb.RedirectWebhook.deserialize('{ "requestType": "redirect"}'), + ).toBeInstanceOf(freeclimb.RedirectWebhook); + }); }); }); - describe(".parentCallId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_parentCallId"; - expect(model.parentCallId).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.RedirectWebhook; + let model: freeclimb.RedirectWebhook = new freeclimb.RedirectWebhook({ + requestType: "", + accountId: "", + callId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, + + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + parentCallId: "", + }); + describe("RedirectWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RedirectWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); + }); + describe(".parentCallId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.parentCallId).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of RedirectWebhook", () => { + expect( + freeclimb.RedirectWebhook.deserialize('{ "requestType": "redirect"}'), + ).toBeInstanceOf(freeclimb.RedirectWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of RedirectWebhook", () => { - expect( - freeclimb.RedirectWebhook.deserialize('{ "requestType": "redirect"}'), - ).toBeInstanceOf(freeclimb.RedirectWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.RedirectWebhook; + let constructorArguments = {}; + let model: freeclimb.RedirectWebhook = new freeclimb.RedirectWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#parentCallId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "parentCallId", + )?.defaultValue; + expect(model.parentCallId).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Reject.spec.ts b/__tests__/models/Reject.spec.ts index b469710..8d532dc 100644 --- a/__tests__/models/Reject.spec.ts +++ b/__tests__/models/Reject.spec.ts @@ -2,19 +2,54 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Reject", () => { - let model: freeclimb.Reject = new freeclimb.Reject({ - reason: "test_reason", + describe("Test with truthy values", () => { + const Klass = freeclimb.Reject; + let model: freeclimb.Reject = new freeclimb.Reject({ + reason: "test_reason", + }); + describe("Reject class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Reject); + }); + }); + + describe(".reason", () => { + it("resolves to particular value on initialization", () => { + const value = "test_reason"; + expect(model.reason).toBe(value); + }); + }); }); - describe("Reject class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Reject); + describe("Test with falsy values", () => { + const Klass = freeclimb.Reject; + let model: freeclimb.Reject = new freeclimb.Reject({ + reason: "", + }); + describe("Reject class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Reject); + }); + }); + + describe(".reason", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.reason).toBe(value); + }); }); }); + describe("Test with only required values", () => { + const Klass = freeclimb.Reject; + let constructorArguments = {}; + let model: freeclimb.Reject = new freeclimb.Reject(constructorArguments); - describe(".reason", () => { - it("resolves to particular value on initialization", () => { - const value = "test_reason"; - expect(model.reason).toBe(value); + describe("#reason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "reason", + )?.defaultValue; + expect(model.reason).toBe(value); + }); }); }); }); diff --git a/__tests__/models/RemoveFromConference.spec.ts b/__tests__/models/RemoveFromConference.spec.ts index b02db97..7030936 100644 --- a/__tests__/models/RemoveFromConference.spec.ts +++ b/__tests__/models/RemoveFromConference.spec.ts @@ -2,11 +2,30 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("RemoveFromConference", () => { - let model: freeclimb.RemoveFromConference = - new freeclimb.RemoveFromConference({}); - describe("RemoveFromConference class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.RemoveFromConference); + describe("Test with truthy values", () => { + const Klass = freeclimb.RemoveFromConference; + let model: freeclimb.RemoveFromConference = + new freeclimb.RemoveFromConference({}); + describe("RemoveFromConference class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RemoveFromConference); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.RemoveFromConference; + let model: freeclimb.RemoveFromConference = + new freeclimb.RemoveFromConference({}); + describe("RemoveFromConference class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.RemoveFromConference); + }); + }); + }); + describe("Test with only required values", () => { + const Klass = freeclimb.RemoveFromConference; + let constructorArguments = {}; + let model: freeclimb.RemoveFromConference = + new freeclimb.RemoveFromConference(constructorArguments); + }); }); diff --git a/__tests__/models/RemoveFromQueueNotificationWebhook.spec.ts b/__tests__/models/RemoveFromQueueNotificationWebhook.spec.ts index e78ed46..8f3735f 100644 --- a/__tests__/models/RemoveFromQueueNotificationWebhook.spec.ts +++ b/__tests__/models/RemoveFromQueueNotificationWebhook.spec.ts @@ -2,104 +2,305 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("RemoveFromQueueNotificationWebhook", () => { - let model: freeclimb.RemoveFromQueueNotificationWebhook = - new freeclimb.RemoveFromQueueNotificationWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - callId: "test_callId", - from: "test_from", - to: "test_to", + describe("Test with truthy values", () => { + const Klass = freeclimb.RemoveFromQueueNotificationWebhook; + let model: freeclimb.RemoveFromQueueNotificationWebhook = + new freeclimb.RemoveFromQueueNotificationWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + callId: "test_callId", + from: "test_from", + to: "test_to", - callStatus: freeclimb.CallStatus.QUEUED, + callStatus: freeclimb.CallStatus.QUEUED, - direction: freeclimb.CallDirection.INBOUND, - conferenceId: "test_conferenceId", - queueId: "test_queueId", + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "test_conferenceId", + queueId: "test_queueId", - queueResult: freeclimb.QueueResultStatus.QUEUE_FULL, - queueTime: 1, + queueResult: freeclimb.QueueResultStatus.QUEUE_FULL, + queueTime: 1, + }); + describe("RemoveFromQueueNotificationWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.RemoveFromQueueNotificationWebhook, + ); + }); }); - describe("RemoveFromQueueNotificationWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf( - freeclimb.RemoveFromQueueNotificationWebhook, - ); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); + }); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); + }); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); + }); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_conferenceId"; + expect(model.conferenceId).toBe(value); + }); + }); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_queueId"; + expect(model.queueId).toBe(value); + }); + }); + describe(".queueResult", () => { + it("resolves to particular value on initialization", () => { + const value = "queueFull"; + expect(model.queueResult).toBe(value); + }); + }); + describe(".queueTime", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.queueTime).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of RemoveFromQueueNotificationWebhook", () => { + expect( + freeclimb.RemoveFromQueueNotificationWebhook.deserialize( + '{ "requestType": "removeFromQueueNotification"}', + ), + ).toBeInstanceOf(freeclimb.RemoveFromQueueNotificationWebhook); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.RemoveFromQueueNotificationWebhook; + let model: freeclimb.RemoveFromQueueNotificationWebhook = + new freeclimb.RemoveFromQueueNotificationWebhook({ + requestType: "", + accountId: "", + callId: "", + from: "", + to: "", + + callStatus: freeclimb.CallStatus.QUEUED, - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + direction: freeclimb.CallDirection.INBOUND, + conferenceId: "", + queueId: "", + + queueResult: freeclimb.QueueResultStatus.QUEUE_FULL, + queueTime: 0, + }); + describe("RemoveFromQueueNotificationWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.RemoveFromQueueNotificationWebhook, + ); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); }); - }); - describe(".callStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "queued"; - expect(model.callStatus).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); }); - }); - describe(".direction", () => { - it("resolves to particular value on initialization", () => { - const value = "inbound"; - expect(model.direction).toBe(value); + describe(".callStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "queued"; + expect(model.callStatus).toBe(value); + }); }); - }); - describe(".conferenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_conferenceId"; - expect(model.conferenceId).toBe(value); + describe(".direction", () => { + it("resolves to particular value on initialization", () => { + const value = "inbound"; + expect(model.direction).toBe(value); + }); }); - }); - describe(".queueId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_queueId"; - expect(model.queueId).toBe(value); + describe(".conferenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.conferenceId).toBe(value); + }); }); - }); - describe(".queueResult", () => { - it("resolves to particular value on initialization", () => { - const value = "queueFull"; - expect(model.queueResult).toBe(value); + describe(".queueId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.queueId).toBe(value); + }); }); - }); - describe(".queueTime", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.queueTime).toBe(value); + describe(".queueResult", () => { + it("resolves to particular value on initialization", () => { + const value = "queueFull"; + expect(model.queueResult).toBe(value); + }); + }); + describe(".queueTime", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.queueTime).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of RemoveFromQueueNotificationWebhook", () => { + expect( + freeclimb.RemoveFromQueueNotificationWebhook.deserialize( + '{ "requestType": "removeFromQueueNotification"}', + ), + ).toBeInstanceOf(freeclimb.RemoveFromQueueNotificationWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of RemoveFromQueueNotificationWebhook", () => { - expect( - freeclimb.RemoveFromQueueNotificationWebhook.deserialize( - '{ "requestType": "removeFromQueueNotification"}', - ), - ).toBeInstanceOf(freeclimb.RemoveFromQueueNotificationWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.RemoveFromQueueNotificationWebhook; + let constructorArguments = {}; + let model: freeclimb.RemoveFromQueueNotificationWebhook = + new freeclimb.RemoveFromQueueNotificationWebhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#callStatus", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callStatus", + )?.defaultValue; + expect(model.callStatus).toBe(value); + }); + }); + describe("#direction", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "direction", + )?.defaultValue; + expect(model.direction).toBe(value); + }); + }); + describe("#conferenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "conferenceId", + )?.defaultValue; + expect(model.conferenceId).toBe(value); + }); + }); + describe("#queueId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueId", + )?.defaultValue; + expect(model.queueId).toBe(value); + }); + }); + describe("#queueResult", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueResult", + )?.defaultValue; + expect(model.queueResult).toBe(value); + }); + }); + describe("#queueTime", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "queueTime", + )?.defaultValue; + expect(model.queueTime).toBe(value); + }); }); }); }); diff --git a/__tests__/models/RequestType.spec.ts b/__tests__/models/RequestType.spec.ts index b958d3e..c7ea80b 100644 --- a/__tests__/models/RequestType.spec.ts +++ b/__tests__/models/RequestType.spec.ts @@ -2,131 +2,137 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("RequestType", () => { - describe(".INBOUND_CALL", () => { - it("resolves to correct value for INBOUND_CALL enum property", () => { - expect(freeclimb.RequestType.INBOUND_CALL).toBe("inboundCall"); - }); - }); - describe(".RECORD", () => { - it("resolves to correct value for RECORD enum property", () => { - expect(freeclimb.RequestType.RECORD).toBe("record"); - }); - }); - describe(".GET_DIGITS", () => { - it("resolves to correct value for GET_DIGITS enum property", () => { - expect(freeclimb.RequestType.GET_DIGITS).toBe("getDigits"); - }); - }); - describe(".GET_SPEECH", () => { - it("resolves to correct value for GET_SPEECH enum property", () => { - expect(freeclimb.RequestType.GET_SPEECH).toBe("getSpeech"); - }); - }); - describe(".REDIRECT", () => { - it("resolves to correct value for REDIRECT enum property", () => { - expect(freeclimb.RequestType.REDIRECT).toBe("redirect"); - }); - }); - describe(".PAUSE", () => { - it("resolves to correct value for PAUSE enum property", () => { - expect(freeclimb.RequestType.PAUSE).toBe("pause"); - }); - }); - describe(".OUT_DIAL_START", () => { - it("resolves to correct value for OUT_DIAL_START enum property", () => { - expect(freeclimb.RequestType.OUT_DIAL_START).toBe("outDialStart"); - }); - }); - describe(".OUT_DIAL_CONNECT", () => { - it("resolves to correct value for OUT_DIAL_CONNECT enum property", () => { - expect(freeclimb.RequestType.OUT_DIAL_CONNECT).toBe("outDialConnect"); - }); - }); - describe(".OUT_DIAL_API_CONNECT", () => { - it("resolves to correct value for OUT_DIAL_API_CONNECT enum property", () => { - expect(freeclimb.RequestType.OUT_DIAL_API_CONNECT).toBe( - "outDialApiConnect", - ); - }); - }); - describe(".MACHINE_DETECTED", () => { - it("resolves to correct value for MACHINE_DETECTED enum property", () => { - expect(freeclimb.RequestType.MACHINE_DETECTED).toBe("machineDetected"); - }); - }); - describe(".DEQUEUE", () => { - it("resolves to correct value for DEQUEUE enum property", () => { - expect(freeclimb.RequestType.DEQUEUE).toBe("dequeue"); - }); - }); - describe(".QUEUE_WAIT", () => { - it("resolves to correct value for QUEUE_WAIT enum property", () => { - expect(freeclimb.RequestType.QUEUE_WAIT).toBe("queueWait"); - }); - }); - describe(".ADD_TO_QUEUE_NOTIFICATION", () => { - it("resolves to correct value for ADD_TO_QUEUE_NOTIFICATION enum property", () => { - expect(freeclimb.RequestType.ADD_TO_QUEUE_NOTIFICATION).toBe( - "addToQueueNotification", - ); - }); - }); - describe(".REMOVE_FROM_QUEUE_NOTIFICATION", () => { - it("resolves to correct value for REMOVE_FROM_QUEUE_NOTIFICATION enum property", () => { - expect(freeclimb.RequestType.REMOVE_FROM_QUEUE_NOTIFICATION).toBe( - "removeFromQueueNotification", - ); - }); - }); - describe(".CALL_STATUS", () => { - it("resolves to correct value for CALL_STATUS enum property", () => { - expect(freeclimb.RequestType.CALL_STATUS).toBe("callStatus"); - }); - }); - describe(".CREATE_CONFERENCE", () => { - it("resolves to correct value for CREATE_CONFERENCE enum property", () => { - expect(freeclimb.RequestType.CREATE_CONFERENCE).toBe("createConference"); - }); - }); - describe(".CONFERENCE_STATUS", () => { - it("resolves to correct value for CONFERENCE_STATUS enum property", () => { - expect(freeclimb.RequestType.CONFERENCE_STATUS).toBe("conferenceStatus"); - }); - }); - describe(".LEAVE_CONFERENCE", () => { - it("resolves to correct value for LEAVE_CONFERENCE enum property", () => { - expect(freeclimb.RequestType.LEAVE_CONFERENCE).toBe("leaveConference"); - }); - }); - describe(".ADD_TO_CONFERENCE_NOTIFICATION", () => { - it("resolves to correct value for ADD_TO_CONFERENCE_NOTIFICATION enum property", () => { - expect(freeclimb.RequestType.ADD_TO_CONFERENCE_NOTIFICATION).toBe( - "addToConferenceNotification", - ); - }); - }); - describe(".CONFERENCE_RECORDING_STATUS", () => { - it("resolves to correct value for CONFERENCE_RECORDING_STATUS enum property", () => { - expect(freeclimb.RequestType.CONFERENCE_RECORDING_STATUS).toBe( - "conferenceRecordingStatus", - ); - }); - }); - describe(".CONFERENCE_CALL_CONTROL", () => { - it("resolves to correct value for CONFERENCE_CALL_CONTROL enum property", () => { - expect(freeclimb.RequestType.CONFERENCE_CALL_CONTROL).toBe( - "conferenceCallControl", - ); - }); - }); - describe(".MESSAGE_DELIVERY", () => { - it("resolves to correct value for MESSAGE_DELIVERY enum property", () => { - expect(freeclimb.RequestType.MESSAGE_DELIVERY).toBe("messageDelivery"); - }); - }); - describe(".MESSAGE_STATUS", () => { - it("resolves to correct value for MESSAGE_STATUS enum property", () => { - expect(freeclimb.RequestType.MESSAGE_STATUS).toBe("messageStatus"); + describe("Test with truthy values", () => { + describe(".INBOUND_CALL", () => { + it("resolves to correct value for INBOUND_CALL enum property", () => { + expect(freeclimb.RequestType.INBOUND_CALL).toBe("inboundCall"); + }); + }); + describe(".RECORD", () => { + it("resolves to correct value for RECORD enum property", () => { + expect(freeclimb.RequestType.RECORD).toBe("record"); + }); + }); + describe(".GET_DIGITS", () => { + it("resolves to correct value for GET_DIGITS enum property", () => { + expect(freeclimb.RequestType.GET_DIGITS).toBe("getDigits"); + }); + }); + describe(".GET_SPEECH", () => { + it("resolves to correct value for GET_SPEECH enum property", () => { + expect(freeclimb.RequestType.GET_SPEECH).toBe("getSpeech"); + }); + }); + describe(".REDIRECT", () => { + it("resolves to correct value for REDIRECT enum property", () => { + expect(freeclimb.RequestType.REDIRECT).toBe("redirect"); + }); + }); + describe(".PAUSE", () => { + it("resolves to correct value for PAUSE enum property", () => { + expect(freeclimb.RequestType.PAUSE).toBe("pause"); + }); + }); + describe(".OUT_DIAL_START", () => { + it("resolves to correct value for OUT_DIAL_START enum property", () => { + expect(freeclimb.RequestType.OUT_DIAL_START).toBe("outDialStart"); + }); + }); + describe(".OUT_DIAL_CONNECT", () => { + it("resolves to correct value for OUT_DIAL_CONNECT enum property", () => { + expect(freeclimb.RequestType.OUT_DIAL_CONNECT).toBe("outDialConnect"); + }); + }); + describe(".OUT_DIAL_API_CONNECT", () => { + it("resolves to correct value for OUT_DIAL_API_CONNECT enum property", () => { + expect(freeclimb.RequestType.OUT_DIAL_API_CONNECT).toBe( + "outDialApiConnect", + ); + }); + }); + describe(".MACHINE_DETECTED", () => { + it("resolves to correct value for MACHINE_DETECTED enum property", () => { + expect(freeclimb.RequestType.MACHINE_DETECTED).toBe("machineDetected"); + }); + }); + describe(".DEQUEUE", () => { + it("resolves to correct value for DEQUEUE enum property", () => { + expect(freeclimb.RequestType.DEQUEUE).toBe("dequeue"); + }); + }); + describe(".QUEUE_WAIT", () => { + it("resolves to correct value for QUEUE_WAIT enum property", () => { + expect(freeclimb.RequestType.QUEUE_WAIT).toBe("queueWait"); + }); + }); + describe(".ADD_TO_QUEUE_NOTIFICATION", () => { + it("resolves to correct value for ADD_TO_QUEUE_NOTIFICATION enum property", () => { + expect(freeclimb.RequestType.ADD_TO_QUEUE_NOTIFICATION).toBe( + "addToQueueNotification", + ); + }); + }); + describe(".REMOVE_FROM_QUEUE_NOTIFICATION", () => { + it("resolves to correct value for REMOVE_FROM_QUEUE_NOTIFICATION enum property", () => { + expect(freeclimb.RequestType.REMOVE_FROM_QUEUE_NOTIFICATION).toBe( + "removeFromQueueNotification", + ); + }); + }); + describe(".CALL_STATUS", () => { + it("resolves to correct value for CALL_STATUS enum property", () => { + expect(freeclimb.RequestType.CALL_STATUS).toBe("callStatus"); + }); + }); + describe(".CREATE_CONFERENCE", () => { + it("resolves to correct value for CREATE_CONFERENCE enum property", () => { + expect(freeclimb.RequestType.CREATE_CONFERENCE).toBe( + "createConference", + ); + }); + }); + describe(".CONFERENCE_STATUS", () => { + it("resolves to correct value for CONFERENCE_STATUS enum property", () => { + expect(freeclimb.RequestType.CONFERENCE_STATUS).toBe( + "conferenceStatus", + ); + }); + }); + describe(".LEAVE_CONFERENCE", () => { + it("resolves to correct value for LEAVE_CONFERENCE enum property", () => { + expect(freeclimb.RequestType.LEAVE_CONFERENCE).toBe("leaveConference"); + }); + }); + describe(".ADD_TO_CONFERENCE_NOTIFICATION", () => { + it("resolves to correct value for ADD_TO_CONFERENCE_NOTIFICATION enum property", () => { + expect(freeclimb.RequestType.ADD_TO_CONFERENCE_NOTIFICATION).toBe( + "addToConferenceNotification", + ); + }); + }); + describe(".CONFERENCE_RECORDING_STATUS", () => { + it("resolves to correct value for CONFERENCE_RECORDING_STATUS enum property", () => { + expect(freeclimb.RequestType.CONFERENCE_RECORDING_STATUS).toBe( + "conferenceRecordingStatus", + ); + }); + }); + describe(".CONFERENCE_CALL_CONTROL", () => { + it("resolves to correct value for CONFERENCE_CALL_CONTROL enum property", () => { + expect(freeclimb.RequestType.CONFERENCE_CALL_CONTROL).toBe( + "conferenceCallControl", + ); + }); + }); + describe(".MESSAGE_DELIVERY", () => { + it("resolves to correct value for MESSAGE_DELIVERY enum property", () => { + expect(freeclimb.RequestType.MESSAGE_DELIVERY).toBe("messageDelivery"); + }); + }); + describe(".MESSAGE_STATUS", () => { + it("resolves to correct value for MESSAGE_STATUS enum property", () => { + expect(freeclimb.RequestType.MESSAGE_STATUS).toBe("messageStatus"); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCBrand.spec.ts b/__tests__/models/SMSTenDLCBrand.spec.ts index d596cba..2f51035 100644 --- a/__tests__/models/SMSTenDLCBrand.spec.ts +++ b/__tests__/models/SMSTenDLCBrand.spec.ts @@ -2,230 +2,707 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCBrand", () => { - let model: freeclimb.SMSTenDLCBrand = new freeclimb.SMSTenDLCBrand({ - accountId: "test_accountId", - - entityType: freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT, - cspId: "test_cspId", - brandId: "test_brandId", - firstName: "test_firstName", - lastName: "test_lastName", - displayName: "test_displayName", - companyName: "test_companyName", - ein: "test_ein", - einIssuingCountry: "test_einIssuingCountry", - phone: "test_phone", - street: "test_street", - city: "test_city", - state: "test_state", - postalCode: "test_postalCode", - country: "test_country", - email: "test_email", - stockSymbol: "test_stockSymbol", - - stockExchange: freeclimb.SMSTenDLCBrandStockExchange.NONE, - ipAddress: "test_ipAddress", - website: "test_website", - - brandRelationship: freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT, - vertical: "test_vertical", - altBusinessId: "test_altBusinessId", - - altBusinessIdType: freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE, - universalEin: "test_universalEin", - referenceId: "test_referenceId", - - mock: true, - - identityStatus: freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED, - createDate: new Date("December 17, 1995 03:24:00"), - }); - describe("SMSTenDLCBrand class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrand); + describe("Test with truthy values", () => { + const Klass = freeclimb.SMSTenDLCBrand; + let model: freeclimb.SMSTenDLCBrand = new freeclimb.SMSTenDLCBrand({ + accountId: "test_accountId", + + entityType: freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT, + cspId: "test_cspId", + brandId: "test_brandId", + firstName: "test_firstName", + lastName: "test_lastName", + displayName: "test_displayName", + companyName: "test_companyName", + ein: "test_ein", + einIssuingCountry: "test_einIssuingCountry", + phone: "test_phone", + street: "test_street", + city: "test_city", + state: "test_state", + postalCode: "test_postalCode", + country: "test_country", + email: "test_email", + stockSymbol: "test_stockSymbol", + + stockExchange: freeclimb.SMSTenDLCBrandStockExchange.NONE, + ipAddress: "test_ipAddress", + website: "test_website", + + brandRelationship: freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT, + vertical: "test_vertical", + altBusinessId: "test_altBusinessId", + + altBusinessIdType: freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE, + universalEin: "test_universalEin", + referenceId: "test_referenceId", + + mock: true, + + identityStatus: freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED, + createDate: new Date("December 17, 1995 03:24:00"), }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe("SMSTenDLCBrand class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrand); + }); }); - }); - describe(".entityType", () => { - it("resolves to particular value on initialization", () => { - const value = "PRIVATE_PROFIT"; - expect(model.entityType).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".cspId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_cspId"; - expect(model.cspId).toBe(value); + describe(".entityType", () => { + it("resolves to particular value on initialization", () => { + const value = "PRIVATE_PROFIT"; + expect(model.entityType).toBe(value); + }); }); - }); - describe(".brandId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_brandId"; - expect(model.brandId).toBe(value); + describe(".cspId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_cspId"; + expect(model.cspId).toBe(value); + }); }); - }); - describe(".firstName", () => { - it("resolves to particular value on initialization", () => { - const value = "test_firstName"; - expect(model.firstName).toBe(value); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_brandId"; + expect(model.brandId).toBe(value); + }); }); - }); - describe(".lastName", () => { - it("resolves to particular value on initialization", () => { - const value = "test_lastName"; - expect(model.lastName).toBe(value); + describe(".firstName", () => { + it("resolves to particular value on initialization", () => { + const value = "test_firstName"; + expect(model.firstName).toBe(value); + }); }); - }); - describe(".displayName", () => { - it("resolves to particular value on initialization", () => { - const value = "test_displayName"; - expect(model.displayName).toBe(value); + describe(".lastName", () => { + it("resolves to particular value on initialization", () => { + const value = "test_lastName"; + expect(model.lastName).toBe(value); + }); }); - }); - describe(".companyName", () => { - it("resolves to particular value on initialization", () => { - const value = "test_companyName"; - expect(model.companyName).toBe(value); + describe(".displayName", () => { + it("resolves to particular value on initialization", () => { + const value = "test_displayName"; + expect(model.displayName).toBe(value); + }); }); - }); - describe(".ein", () => { - it("resolves to particular value on initialization", () => { - const value = "test_ein"; - expect(model.ein).toBe(value); + describe(".companyName", () => { + it("resolves to particular value on initialization", () => { + const value = "test_companyName"; + expect(model.companyName).toBe(value); + }); }); - }); - describe(".einIssuingCountry", () => { - it("resolves to particular value on initialization", () => { - const value = "test_einIssuingCountry"; - expect(model.einIssuingCountry).toBe(value); + describe(".ein", () => { + it("resolves to particular value on initialization", () => { + const value = "test_ein"; + expect(model.ein).toBe(value); + }); }); - }); - describe(".phone", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phone"; - expect(model.phone).toBe(value); + describe(".einIssuingCountry", () => { + it("resolves to particular value on initialization", () => { + const value = "test_einIssuingCountry"; + expect(model.einIssuingCountry).toBe(value); + }); }); - }); - describe(".street", () => { - it("resolves to particular value on initialization", () => { - const value = "test_street"; - expect(model.street).toBe(value); + describe(".phone", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phone"; + expect(model.phone).toBe(value); + }); }); - }); - describe(".city", () => { - it("resolves to particular value on initialization", () => { - const value = "test_city"; - expect(model.city).toBe(value); + describe(".street", () => { + it("resolves to particular value on initialization", () => { + const value = "test_street"; + expect(model.street).toBe(value); + }); }); - }); - describe(".state", () => { - it("resolves to particular value on initialization", () => { - const value = "test_state"; - expect(model.state).toBe(value); + describe(".city", () => { + it("resolves to particular value on initialization", () => { + const value = "test_city"; + expect(model.city).toBe(value); + }); }); - }); - describe(".postalCode", () => { - it("resolves to particular value on initialization", () => { - const value = "test_postalCode"; - expect(model.postalCode).toBe(value); + describe(".state", () => { + it("resolves to particular value on initialization", () => { + const value = "test_state"; + expect(model.state).toBe(value); + }); }); - }); - describe(".country", () => { - it("resolves to particular value on initialization", () => { - const value = "test_country"; - expect(model.country).toBe(value); + describe(".postalCode", () => { + it("resolves to particular value on initialization", () => { + const value = "test_postalCode"; + expect(model.postalCode).toBe(value); + }); }); - }); - describe(".email", () => { - it("resolves to particular value on initialization", () => { - const value = "test_email"; - expect(model.email).toBe(value); + describe(".country", () => { + it("resolves to particular value on initialization", () => { + const value = "test_country"; + expect(model.country).toBe(value); + }); }); - }); - describe(".stockSymbol", () => { - it("resolves to particular value on initialization", () => { - const value = "test_stockSymbol"; - expect(model.stockSymbol).toBe(value); + describe(".email", () => { + it("resolves to particular value on initialization", () => { + const value = "test_email"; + expect(model.email).toBe(value); + }); }); - }); - describe(".stockExchange", () => { - it("resolves to particular value on initialization", () => { - const value = "NONE"; - expect(model.stockExchange).toBe(value); + describe(".stockSymbol", () => { + it("resolves to particular value on initialization", () => { + const value = "test_stockSymbol"; + expect(model.stockSymbol).toBe(value); + }); }); - }); - describe(".ipAddress", () => { - it("resolves to particular value on initialization", () => { - const value = "test_ipAddress"; - expect(model.ipAddress).toBe(value); + describe(".stockExchange", () => { + it("resolves to particular value on initialization", () => { + const value = "NONE"; + expect(model.stockExchange).toBe(value); + }); }); - }); - describe(".website", () => { - it("resolves to particular value on initialization", () => { - const value = "test_website"; - expect(model.website).toBe(value); + describe(".ipAddress", () => { + it("resolves to particular value on initialization", () => { + const value = "test_ipAddress"; + expect(model.ipAddress).toBe(value); + }); }); - }); - describe(".brandRelationship", () => { - it("resolves to particular value on initialization", () => { - const value = "BASIC_ACCOUNT"; - expect(model.brandRelationship).toBe(value); + describe(".website", () => { + it("resolves to particular value on initialization", () => { + const value = "test_website"; + expect(model.website).toBe(value); + }); }); - }); - describe(".vertical", () => { - it("resolves to particular value on initialization", () => { - const value = "test_vertical"; - expect(model.vertical).toBe(value); + describe(".brandRelationship", () => { + it("resolves to particular value on initialization", () => { + const value = "BASIC_ACCOUNT"; + expect(model.brandRelationship).toBe(value); + }); }); - }); - describe(".altBusinessId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_altBusinessId"; - expect(model.altBusinessId).toBe(value); + describe(".vertical", () => { + it("resolves to particular value on initialization", () => { + const value = "test_vertical"; + expect(model.vertical).toBe(value); + }); }); - }); - describe(".altBusinessIdType", () => { - it("resolves to particular value on initialization", () => { - const value = "NONE"; - expect(model.altBusinessIdType).toBe(value); + describe(".altBusinessId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_altBusinessId"; + expect(model.altBusinessId).toBe(value); + }); }); - }); - describe(".universalEin", () => { - it("resolves to particular value on initialization", () => { - const value = "test_universalEin"; - expect(model.universalEin).toBe(value); + describe(".altBusinessIdType", () => { + it("resolves to particular value on initialization", () => { + const value = "NONE"; + expect(model.altBusinessIdType).toBe(value); + }); }); - }); - describe(".referenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_referenceId"; - expect(model.referenceId).toBe(value); + describe(".universalEin", () => { + it("resolves to particular value on initialization", () => { + const value = "test_universalEin"; + expect(model.universalEin).toBe(value); + }); }); - }); - describe(".optionalAttributes", () => { - it("resolves to particular value on initialization", () => {}); - }); - describe(".mock", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.mock).toBe(value); + describe(".referenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_referenceId"; + expect(model.referenceId).toBe(value); + }); + }); + describe(".optionalAttributes", () => { + it("resolves to particular value on initialization", () => {}); + }); + describe(".mock", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.mock).toBe(value); + }); + }); + describe(".identityStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "SELF_DECLARED"; + expect(model.identityStatus).toBe(value); + }); + }); + describe(".createDate", () => { + it("resolves to particular value on initialization", () => { + const value = new Date("December 17, 1995 03:24:00"); + expect(model.createDate).toStrictEqual(value); + }); }); }); - describe(".identityStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "SELF_DECLARED"; - expect(model.identityStatus).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.SMSTenDLCBrand; + let model: freeclimb.SMSTenDLCBrand = new freeclimb.SMSTenDLCBrand({ + accountId: "", + + entityType: freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT, + cspId: "", + brandId: "", + firstName: "", + lastName: "", + displayName: "", + companyName: "", + ein: "", + einIssuingCountry: "", + phone: "", + street: "", + city: "", + state: "", + postalCode: "", + country: "", + email: "", + stockSymbol: "", + + stockExchange: freeclimb.SMSTenDLCBrandStockExchange.NONE, + ipAddress: "", + website: "", + + brandRelationship: freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT, + vertical: "", + altBusinessId: "", + + altBusinessIdType: freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE, + universalEin: "", + referenceId: "", + + mock: false, + + identityStatus: freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED, + createDate: undefined, + }); + describe("SMSTenDLCBrand class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrand); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".entityType", () => { + it("resolves to particular value on initialization", () => { + const value = "PRIVATE_PROFIT"; + expect(model.entityType).toBe(value); + }); + }); + describe(".cspId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.cspId).toBe(value); + }); + }); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.brandId).toBe(value); + }); + }); + describe(".firstName", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.firstName).toBe(value); + }); + }); + describe(".lastName", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.lastName).toBe(value); + }); + }); + describe(".displayName", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.displayName).toBe(value); + }); + }); + describe(".companyName", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.companyName).toBe(value); + }); + }); + describe(".ein", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.ein).toBe(value); + }); + }); + describe(".einIssuingCountry", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.einIssuingCountry).toBe(value); + }); + }); + describe(".phone", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phone).toBe(value); + }); + }); + describe(".street", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.street).toBe(value); + }); + }); + describe(".city", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.city).toBe(value); + }); + }); + describe(".state", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.state).toBe(value); + }); + }); + describe(".postalCode", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.postalCode).toBe(value); + }); + }); + describe(".country", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.country).toBe(value); + }); + }); + describe(".email", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.email).toBe(value); + }); + }); + describe(".stockSymbol", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.stockSymbol).toBe(value); + }); + }); + describe(".stockExchange", () => { + it("resolves to particular value on initialization", () => { + const value = "NONE"; + expect(model.stockExchange).toBe(value); + }); + }); + describe(".ipAddress", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.ipAddress).toBe(value); + }); + }); + describe(".website", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.website).toBe(value); + }); + }); + describe(".brandRelationship", () => { + it("resolves to particular value on initialization", () => { + const value = "BASIC_ACCOUNT"; + expect(model.brandRelationship).toBe(value); + }); + }); + describe(".vertical", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.vertical).toBe(value); + }); + }); + describe(".altBusinessId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.altBusinessId).toBe(value); + }); + }); + describe(".altBusinessIdType", () => { + it("resolves to particular value on initialization", () => { + const value = "NONE"; + expect(model.altBusinessIdType).toBe(value); + }); + }); + describe(".universalEin", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.universalEin).toBe(value); + }); + }); + describe(".referenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.referenceId).toBe(value); + }); + }); + describe(".optionalAttributes", () => { + it("resolves to particular value on initialization", () => {}); + }); + describe(".mock", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.mock).toBe(value); + }); + }); + describe(".identityStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "SELF_DECLARED"; + expect(model.identityStatus).toBe(value); + }); + }); + describe(".createDate", () => { + it("resolves to particular value on initialization", () => { + const value = undefined; + expect(model.createDate).toStrictEqual(value); + }); }); }); - describe(".createDate", () => { - it("resolves to particular value on initialization", () => { - const value = new Date("December 17, 1995 03:24:00"); - expect(model.createDate).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.SMSTenDLCBrand; + let constructorArguments = { + entityType: freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT, + displayName: "test_displayName", + phone: "test_phone", + country: "test_country", + email: "test_email", + + brandRelationship: freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT, + vertical: "test_vertical", + mock: true, + + identityStatus: freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED, + }; + let model: freeclimb.SMSTenDLCBrand = new freeclimb.SMSTenDLCBrand( + constructorArguments, + ); + + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#entityType", () => { + it("resolves to initialization value", () => { + expect(model.entityType).toBe(constructorArguments["entityType"]); + }); + }); + describe("#cspId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "cspId", + )?.defaultValue; + expect(model.cspId).toBe(value); + }); + }); + describe("#brandId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "brandId", + )?.defaultValue; + expect(model.brandId).toBe(value); + }); + }); + describe("#firstName", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "firstName", + )?.defaultValue; + expect(model.firstName).toBe(value); + }); + }); + describe("#lastName", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "lastName", + )?.defaultValue; + expect(model.lastName).toBe(value); + }); + }); + describe("#displayName", () => { + it("resolves to initialization value", () => { + expect(model.displayName).toBe(constructorArguments["displayName"]); + }); + }); + describe("#companyName", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "companyName", + )?.defaultValue; + expect(model.companyName).toBe(value); + }); + }); + describe("#ein", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "ein", + )?.defaultValue; + expect(model.ein).toBe(value); + }); + }); + describe("#einIssuingCountry", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "einIssuingCountry", + )?.defaultValue; + expect(model.einIssuingCountry).toBe(value); + }); + }); + describe("#phone", () => { + it("resolves to initialization value", () => { + expect(model.phone).toBe(constructorArguments["phone"]); + }); + }); + describe("#street", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "street", + )?.defaultValue; + expect(model.street).toBe(value); + }); + }); + describe("#city", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "city", + )?.defaultValue; + expect(model.city).toBe(value); + }); + }); + describe("#state", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "state", + )?.defaultValue; + expect(model.state).toBe(value); + }); + }); + describe("#postalCode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "postalCode", + )?.defaultValue; + expect(model.postalCode).toBe(value); + }); + }); + describe("#country", () => { + it("resolves to initialization value", () => { + expect(model.country).toBe(constructorArguments["country"]); + }); + }); + describe("#email", () => { + it("resolves to initialization value", () => { + expect(model.email).toBe(constructorArguments["email"]); + }); + }); + describe("#stockSymbol", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "stockSymbol", + )?.defaultValue; + expect(model.stockSymbol).toBe(value); + }); + }); + describe("#stockExchange", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "stockExchange", + )?.defaultValue; + expect(model.stockExchange).toBe(value); + }); + }); + describe("#ipAddress", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "ipAddress", + )?.defaultValue; + expect(model.ipAddress).toBe(value); + }); + }); + describe("#website", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "website", + )?.defaultValue; + expect(model.website).toBe(value); + }); + }); + describe("#brandRelationship", () => { + it("resolves to initialization value", () => { + expect(model.brandRelationship).toBe( + constructorArguments["brandRelationship"], + ); + }); + }); + describe("#vertical", () => { + it("resolves to initialization value", () => { + expect(model.vertical).toBe(constructorArguments["vertical"]); + }); + }); + describe("#altBusinessId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "altBusinessId", + )?.defaultValue; + expect(model.altBusinessId).toBe(value); + }); + }); + describe("#altBusinessIdType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "altBusinessIdType", + )?.defaultValue; + expect(model.altBusinessIdType).toBe(value); + }); + }); + describe("#universalEin", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "universalEin", + )?.defaultValue; + expect(model.universalEin).toBe(value); + }); + }); + describe("#referenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "referenceId", + )?.defaultValue; + expect(model.referenceId).toBe(value); + }); + }); + describe("#optionalAttributes", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optionalAttributes", + )?.defaultValue; + expect(model.optionalAttributes).toBe(value); + }); + }); + describe("#mock", () => { + it("resolves to initialization value", () => { + expect(model.mock).toBe(constructorArguments["mock"]); + }); + }); + describe("#identityStatus", () => { + it("resolves to initialization value", () => { + expect(model.identityStatus).toBe( + constructorArguments["identityStatus"], + ); + }); + }); + describe("#createDate", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "createDate", + )?.defaultValue; + expect(model.createDate).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCBrandAltBusinessIdType.spec.ts b/__tests__/models/SMSTenDLCBrandAltBusinessIdType.spec.ts index e57434c..2d74a2c 100644 --- a/__tests__/models/SMSTenDLCBrandAltBusinessIdType.spec.ts +++ b/__tests__/models/SMSTenDLCBrandAltBusinessIdType.spec.ts @@ -2,24 +2,26 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCBrandAltBusinessIdType", () => { - describe(".NONE", () => { - it("resolves to correct value for NONE enum property", () => { - expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE).toBe("NONE"); + describe("Test with truthy values", () => { + describe(".NONE", () => { + it("resolves to correct value for NONE enum property", () => { + expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE).toBe("NONE"); + }); }); - }); - describe(".DUNS", () => { - it("resolves to correct value for DUNS enum property", () => { - expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.DUNS).toBe("DUNS"); + describe(".DUNS", () => { + it("resolves to correct value for DUNS enum property", () => { + expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.DUNS).toBe("DUNS"); + }); }); - }); - describe(".GIIN", () => { - it("resolves to correct value for GIIN enum property", () => { - expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.GIIN).toBe("GIIN"); + describe(".GIIN", () => { + it("resolves to correct value for GIIN enum property", () => { + expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.GIIN).toBe("GIIN"); + }); }); - }); - describe(".LEI", () => { - it("resolves to correct value for LEI enum property", () => { - expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.LEI).toBe("LEI"); + describe(".LEI", () => { + it("resolves to correct value for LEI enum property", () => { + expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.LEI).toBe("LEI"); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCBrandEntityType.spec.ts b/__tests__/models/SMSTenDLCBrandEntityType.spec.ts index 15baa37..3476f57 100644 --- a/__tests__/models/SMSTenDLCBrandEntityType.spec.ts +++ b/__tests__/models/SMSTenDLCBrandEntityType.spec.ts @@ -2,35 +2,41 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCBrandEntityType", () => { - describe(".PRIVATE_PROFIT", () => { - it("resolves to correct value for PRIVATE_PROFIT enum property", () => { - expect(freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT).toBe( - "PRIVATE_PROFIT", - ); + describe("Test with truthy values", () => { + describe(".PRIVATE_PROFIT", () => { + it("resolves to correct value for PRIVATE_PROFIT enum property", () => { + expect(freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT).toBe( + "PRIVATE_PROFIT", + ); + }); }); - }); - describe(".PUBLIC_PROFIT", () => { - it("resolves to correct value for PUBLIC_PROFIT enum property", () => { - expect(freeclimb.SMSTenDLCBrandEntityType.PUBLIC_PROFIT).toBe( - "PUBLIC_PROFIT", - ); + describe(".PUBLIC_PROFIT", () => { + it("resolves to correct value for PUBLIC_PROFIT enum property", () => { + expect(freeclimb.SMSTenDLCBrandEntityType.PUBLIC_PROFIT).toBe( + "PUBLIC_PROFIT", + ); + }); }); - }); - describe(".NON_PROFIT", () => { - it("resolves to correct value for NON_PROFIT enum property", () => { - expect(freeclimb.SMSTenDLCBrandEntityType.NON_PROFIT).toBe("NON_PROFIT"); + describe(".NON_PROFIT", () => { + it("resolves to correct value for NON_PROFIT enum property", () => { + expect(freeclimb.SMSTenDLCBrandEntityType.NON_PROFIT).toBe( + "NON_PROFIT", + ); + }); }); - }); - describe(".GOVERNMENT", () => { - it("resolves to correct value for GOVERNMENT enum property", () => { - expect(freeclimb.SMSTenDLCBrandEntityType.GOVERNMENT).toBe("GOVERNMENT"); + describe(".GOVERNMENT", () => { + it("resolves to correct value for GOVERNMENT enum property", () => { + expect(freeclimb.SMSTenDLCBrandEntityType.GOVERNMENT).toBe( + "GOVERNMENT", + ); + }); }); - }); - describe(".SOLE_PROPRIETOR", () => { - it("resolves to correct value for SOLE_PROPRIETOR enum property", () => { - expect(freeclimb.SMSTenDLCBrandEntityType.SOLE_PROPRIETOR).toBe( - "SOLE_PROPRIETOR", - ); + describe(".SOLE_PROPRIETOR", () => { + it("resolves to correct value for SOLE_PROPRIETOR enum property", () => { + expect(freeclimb.SMSTenDLCBrandEntityType.SOLE_PROPRIETOR).toBe( + "SOLE_PROPRIETOR", + ); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCBrandIdentityStatus.spec.ts b/__tests__/models/SMSTenDLCBrandIdentityStatus.spec.ts index 5dbaa56..f9fc2e3 100644 --- a/__tests__/models/SMSTenDLCBrandIdentityStatus.spec.ts +++ b/__tests__/models/SMSTenDLCBrandIdentityStatus.spec.ts @@ -2,30 +2,34 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCBrandIdentityStatus", () => { - describe(".SELF_DECLARED", () => { - it("resolves to correct value for SELF_DECLARED enum property", () => { - expect(freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED).toBe( - "SELF_DECLARED", - ); + describe("Test with truthy values", () => { + describe(".SELF_DECLARED", () => { + it("resolves to correct value for SELF_DECLARED enum property", () => { + expect(freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED).toBe( + "SELF_DECLARED", + ); + }); }); - }); - describe(".UNVERIFIED", () => { - it("resolves to correct value for UNVERIFIED enum property", () => { - expect(freeclimb.SMSTenDLCBrandIdentityStatus.UNVERIFIED).toBe( - "UNVERIFIED", - ); + describe(".UNVERIFIED", () => { + it("resolves to correct value for UNVERIFIED enum property", () => { + expect(freeclimb.SMSTenDLCBrandIdentityStatus.UNVERIFIED).toBe( + "UNVERIFIED", + ); + }); }); - }); - describe(".VERIFIED", () => { - it("resolves to correct value for VERIFIED enum property", () => { - expect(freeclimb.SMSTenDLCBrandIdentityStatus.VERIFIED).toBe("VERIFIED"); + describe(".VERIFIED", () => { + it("resolves to correct value for VERIFIED enum property", () => { + expect(freeclimb.SMSTenDLCBrandIdentityStatus.VERIFIED).toBe( + "VERIFIED", + ); + }); }); - }); - describe(".VETTED_VERIFIED", () => { - it("resolves to correct value for VETTED_VERIFIED enum property", () => { - expect(freeclimb.SMSTenDLCBrandIdentityStatus.VETTED_VERIFIED).toBe( - "VETTED_VERIFIED", - ); + describe(".VETTED_VERIFIED", () => { + it("resolves to correct value for VETTED_VERIFIED enum property", () => { + expect(freeclimb.SMSTenDLCBrandIdentityStatus.VETTED_VERIFIED).toBe( + "VETTED_VERIFIED", + ); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCBrandRelationship.spec.ts b/__tests__/models/SMSTenDLCBrandRelationship.spec.ts index 1877cea..bc4260f 100644 --- a/__tests__/models/SMSTenDLCBrandRelationship.spec.ts +++ b/__tests__/models/SMSTenDLCBrandRelationship.spec.ts @@ -2,39 +2,41 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCBrandRelationship", () => { - describe(".BASIC_ACCOUNT", () => { - it("resolves to correct value for BASIC_ACCOUNT enum property", () => { - expect(freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT).toBe( - "BASIC_ACCOUNT", - ); + describe("Test with truthy values", () => { + describe(".BASIC_ACCOUNT", () => { + it("resolves to correct value for BASIC_ACCOUNT enum property", () => { + expect(freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT).toBe( + "BASIC_ACCOUNT", + ); + }); }); - }); - describe(".SMALL_ACCOUNT", () => { - it("resolves to correct value for SMALL_ACCOUNT enum property", () => { - expect(freeclimb.SMSTenDLCBrandRelationship.SMALL_ACCOUNT).toBe( - "SMALL_ACCOUNT", - ); + describe(".SMALL_ACCOUNT", () => { + it("resolves to correct value for SMALL_ACCOUNT enum property", () => { + expect(freeclimb.SMSTenDLCBrandRelationship.SMALL_ACCOUNT).toBe( + "SMALL_ACCOUNT", + ); + }); }); - }); - describe(".MEDIUM_ACCOUNT", () => { - it("resolves to correct value for MEDIUM_ACCOUNT enum property", () => { - expect(freeclimb.SMSTenDLCBrandRelationship.MEDIUM_ACCOUNT).toBe( - "MEDIUM_ACCOUNT", - ); + describe(".MEDIUM_ACCOUNT", () => { + it("resolves to correct value for MEDIUM_ACCOUNT enum property", () => { + expect(freeclimb.SMSTenDLCBrandRelationship.MEDIUM_ACCOUNT).toBe( + "MEDIUM_ACCOUNT", + ); + }); }); - }); - describe(".LARGE_ACCOUNT", () => { - it("resolves to correct value for LARGE_ACCOUNT enum property", () => { - expect(freeclimb.SMSTenDLCBrandRelationship.LARGE_ACCOUNT).toBe( - "LARGE_ACCOUNT", - ); + describe(".LARGE_ACCOUNT", () => { + it("resolves to correct value for LARGE_ACCOUNT enum property", () => { + expect(freeclimb.SMSTenDLCBrandRelationship.LARGE_ACCOUNT).toBe( + "LARGE_ACCOUNT", + ); + }); }); - }); - describe(".KEY_ACCOUNT", () => { - it("resolves to correct value for KEY_ACCOUNT enum property", () => { - expect(freeclimb.SMSTenDLCBrandRelationship.KEY_ACCOUNT).toBe( - "KEY_ACCOUNT", - ); + describe(".KEY_ACCOUNT", () => { + it("resolves to correct value for KEY_ACCOUNT enum property", () => { + expect(freeclimb.SMSTenDLCBrandRelationship.KEY_ACCOUNT).toBe( + "KEY_ACCOUNT", + ); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCBrandStockExchange.spec.ts b/__tests__/models/SMSTenDLCBrandStockExchange.spec.ts index 59f7d57..bf5b3d5 100644 --- a/__tests__/models/SMSTenDLCBrandStockExchange.spec.ts +++ b/__tests__/models/SMSTenDLCBrandStockExchange.spec.ts @@ -2,139 +2,141 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCBrandStockExchange", () => { - describe(".NONE", () => { - it("resolves to correct value for NONE enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.NONE).toBe("NONE"); - }); - }); - describe(".NASDAQ", () => { - it("resolves to correct value for NASDAQ enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.NASDAQ).toBe("NASDAQ"); - }); - }); - describe(".NYSE", () => { - it("resolves to correct value for NYSE enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.NYSE).toBe("NYSE"); - }); - }); - describe(".AMEX", () => { - it("resolves to correct value for AMEX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.AMEX).toBe("AMEX"); - }); - }); - describe(".AMX", () => { - it("resolves to correct value for AMX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.AMX).toBe("AMX"); - }); - }); - describe(".ASX", () => { - it("resolves to correct value for ASX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.ASX).toBe("ASX"); - }); - }); - describe(".B3", () => { - it("resolves to correct value for B3 enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.B3).toBe("B3"); - }); - }); - describe(".BME", () => { - it("resolves to correct value for BME enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.BME).toBe("BME"); - }); - }); - describe(".BSE", () => { - it("resolves to correct value for BSE enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.BSE).toBe("BSE"); - }); - }); - describe(".FRA", () => { - it("resolves to correct value for FRA enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.FRA).toBe("FRA"); - }); - }); - describe(".ICEX", () => { - it("resolves to correct value for ICEX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.ICEX).toBe("ICEX"); - }); - }); - describe(".JPX", () => { - it("resolves to correct value for JPX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.JPX).toBe("JPX"); - }); - }); - describe(".JSE", () => { - it("resolves to correct value for JSE enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.JSE).toBe("JSE"); - }); - }); - describe(".KRX", () => { - it("resolves to correct value for KRX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.KRX).toBe("KRX"); - }); - }); - describe(".LON", () => { - it("resolves to correct value for LON enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.LON).toBe("LON"); - }); - }); - describe(".NSE", () => { - it("resolves to correct value for NSE enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.NSE).toBe("NSE"); - }); - }); - describe(".OMX", () => { - it("resolves to correct value for OMX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.OMX).toBe("OMX"); - }); - }); - describe(".SEHK", () => { - it("resolves to correct value for SEHK enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.SEHK).toBe("SEHK"); - }); - }); - describe(".SGX", () => { - it("resolves to correct value for SGX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.SGX).toBe("SGX"); - }); - }); - describe(".SSE", () => { - it("resolves to correct value for SSE enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.SSE).toBe("SSE"); - }); - }); - describe(".STO", () => { - it("resolves to correct value for STO enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.STO).toBe("STO"); - }); - }); - describe(".SWX", () => { - it("resolves to correct value for SWX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.SWX).toBe("SWX"); - }); - }); - describe(".SZSE", () => { - it("resolves to correct value for SZSE enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.SZSE).toBe("SZSE"); - }); - }); - describe(".TSX", () => { - it("resolves to correct value for TSX enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.TSX).toBe("TSX"); - }); - }); - describe(".TWSE", () => { - it("resolves to correct value for TWSE enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.TWSE).toBe("TWSE"); - }); - }); - describe(".VSE", () => { - it("resolves to correct value for VSE enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.VSE).toBe("VSE"); - }); - }); - describe(".OTHER", () => { - it("resolves to correct value for OTHER enum property", () => { - expect(freeclimb.SMSTenDLCBrandStockExchange.OTHER).toBe("OTHER"); + describe("Test with truthy values", () => { + describe(".NONE", () => { + it("resolves to correct value for NONE enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.NONE).toBe("NONE"); + }); + }); + describe(".NASDAQ", () => { + it("resolves to correct value for NASDAQ enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.NASDAQ).toBe("NASDAQ"); + }); + }); + describe(".NYSE", () => { + it("resolves to correct value for NYSE enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.NYSE).toBe("NYSE"); + }); + }); + describe(".AMEX", () => { + it("resolves to correct value for AMEX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.AMEX).toBe("AMEX"); + }); + }); + describe(".AMX", () => { + it("resolves to correct value for AMX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.AMX).toBe("AMX"); + }); + }); + describe(".ASX", () => { + it("resolves to correct value for ASX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.ASX).toBe("ASX"); + }); + }); + describe(".B3", () => { + it("resolves to correct value for B3 enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.B3).toBe("B3"); + }); + }); + describe(".BME", () => { + it("resolves to correct value for BME enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.BME).toBe("BME"); + }); + }); + describe(".BSE", () => { + it("resolves to correct value for BSE enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.BSE).toBe("BSE"); + }); + }); + describe(".FRA", () => { + it("resolves to correct value for FRA enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.FRA).toBe("FRA"); + }); + }); + describe(".ICEX", () => { + it("resolves to correct value for ICEX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.ICEX).toBe("ICEX"); + }); + }); + describe(".JPX", () => { + it("resolves to correct value for JPX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.JPX).toBe("JPX"); + }); + }); + describe(".JSE", () => { + it("resolves to correct value for JSE enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.JSE).toBe("JSE"); + }); + }); + describe(".KRX", () => { + it("resolves to correct value for KRX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.KRX).toBe("KRX"); + }); + }); + describe(".LON", () => { + it("resolves to correct value for LON enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.LON).toBe("LON"); + }); + }); + describe(".NSE", () => { + it("resolves to correct value for NSE enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.NSE).toBe("NSE"); + }); + }); + describe(".OMX", () => { + it("resolves to correct value for OMX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.OMX).toBe("OMX"); + }); + }); + describe(".SEHK", () => { + it("resolves to correct value for SEHK enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.SEHK).toBe("SEHK"); + }); + }); + describe(".SGX", () => { + it("resolves to correct value for SGX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.SGX).toBe("SGX"); + }); + }); + describe(".SSE", () => { + it("resolves to correct value for SSE enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.SSE).toBe("SSE"); + }); + }); + describe(".STO", () => { + it("resolves to correct value for STO enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.STO).toBe("STO"); + }); + }); + describe(".SWX", () => { + it("resolves to correct value for SWX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.SWX).toBe("SWX"); + }); + }); + describe(".SZSE", () => { + it("resolves to correct value for SZSE enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.SZSE).toBe("SZSE"); + }); + }); + describe(".TSX", () => { + it("resolves to correct value for TSX enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.TSX).toBe("TSX"); + }); + }); + describe(".TWSE", () => { + it("resolves to correct value for TWSE enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.TWSE).toBe("TWSE"); + }); + }); + describe(".VSE", () => { + it("resolves to correct value for VSE enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.VSE).toBe("VSE"); + }); + }); + describe(".OTHER", () => { + it("resolves to correct value for OTHER enum property", () => { + expect(freeclimb.SMSTenDLCBrandStockExchange.OTHER).toBe("OTHER"); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCBrandsListResult.spec.ts b/__tests__/models/SMSTenDLCBrandsListResult.spec.ts index 8b8f3df..6fc417b 100644 --- a/__tests__/models/SMSTenDLCBrandsListResult.spec.ts +++ b/__tests__/models/SMSTenDLCBrandsListResult.spec.ts @@ -2,68 +2,161 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCBrandsListResult", () => { - let model: freeclimb.SMSTenDLCBrandsListResult = - new freeclimb.SMSTenDLCBrandsListResult({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - brands: [], + describe("Test with truthy values", () => { + const Klass = freeclimb.SMSTenDLCBrandsListResult; + let model: freeclimb.SMSTenDLCBrandsListResult = + new freeclimb.SMSTenDLCBrandsListResult({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + brands: [], + }); + describe("SMSTenDLCBrandsListResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrandsListResult); + }); }); - describe("SMSTenDLCBrandsListResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrandsListResult); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".brands", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.SMSTenDLCBrand[] = []; + expect(model.brands).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.SMSTenDLCBrandsListResult; + let model: freeclimb.SMSTenDLCBrandsListResult = + new freeclimb.SMSTenDLCBrandsListResult({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + brands: [], + }); + describe("SMSTenDLCBrandsListResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrandsListResult); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".brands", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.SMSTenDLCBrand[] = []; + expect(model.brands).toStrictEqual(value); + }); }); }); - describe(".brands", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.SMSTenDLCBrand[] = []; - expect(model.brands).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.SMSTenDLCBrandsListResult; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.SMSTenDLCBrandsListResult = + new freeclimb.SMSTenDLCBrandsListResult(constructorArguments); + + describe("#brands", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "brands", + )?.defaultValue; + expect(model.brands).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCCampaign.spec.ts b/__tests__/models/SMSTenDLCCampaign.spec.ts index 899da10..a43abc8 100644 --- a/__tests__/models/SMSTenDLCCampaign.spec.ts +++ b/__tests__/models/SMSTenDLCCampaign.spec.ts @@ -2,264 +2,813 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCCampaign", () => { - let model: freeclimb.SMSTenDLCCampaign = new freeclimb.SMSTenDLCCampaign({ - accountId: "test_accountId", - campaignId: "test_campaignId", - cspId: "test_cspId", - resellerId: "test_resellerId", + describe("Test with truthy values", () => { + const Klass = freeclimb.SMSTenDLCCampaign; + let model: freeclimb.SMSTenDLCCampaign = new freeclimb.SMSTenDLCCampaign({ + accountId: "test_accountId", + campaignId: "test_campaignId", + cspId: "test_cspId", + resellerId: "test_resellerId", - status: freeclimb.SMSTenDLCCampaignStatus.ACTIVE, - createDate: new Date("December 17, 1995 03:24:00"), - autoRenewal: true, - billedDate: new Date("December 17, 1995 03:24:00"), - brandId: "test_brandId", - usecase: "test_usecase", - subUsecases: new Set([]), - description: "test_description", - embeddedLink: true, - embeddedPhone: true, - affiliateMarketing: true, - numberPool: true, - ageGated: true, - directLending: true, - subscriberOptin: true, - subscriberOptout: true, - subscriberHelp: true, - sample1: "test_sample1", - sample2: "test_sample2", - sample3: "test_sample3", - sample4: "test_sample4", - sample5: "test_sample5", - messageFlow: "test_messageFlow", - helpMessage: "test_helpMessage", - optinKeywords: "test_optinKeywords", - optoutKeywords: "test_optoutKeywords", - helpKeywords: "test_helpKeywords", - optinMessage: "test_optinMessage", - optoutMessage: "test_optoutMessage", - referenceId: "test_referenceId", - mock: true, - nextRenewalOrExpirationDate: "test_nextRenewalOrExpirationDate", - }); - describe("SMSTenDLCCampaign class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaign); - }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); - }); - }); - describe(".campaignId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_campaignId"; - expect(model.campaignId).toBe(value); - }); - }); - describe(".cspId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_cspId"; - expect(model.cspId).toBe(value); - }); - }); - describe(".resellerId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_resellerId"; - expect(model.resellerId).toBe(value); - }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "ACTIVE"; - expect(model.status).toBe(value); - }); - }); - describe(".createDate", () => { - it("resolves to particular value on initialization", () => { - const value = new Date("December 17, 1995 03:24:00"); - expect(model.createDate).toStrictEqual(value); - }); - }); - describe(".autoRenewal", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.autoRenewal).toBe(value); - }); - }); - describe(".billedDate", () => { - it("resolves to particular value on initialization", () => { - const value = new Date("December 17, 1995 03:24:00"); - expect(model.billedDate).toStrictEqual(value); - }); - }); - describe(".brandId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_brandId"; - expect(model.brandId).toBe(value); - }); - }); - describe(".usecase", () => { - it("resolves to particular value on initialization", () => { - const value = "test_usecase"; - expect(model.usecase).toBe(value); - }); - }); - describe(".subUsecases", () => { - it("resolves to particular value on initialization", () => { - const value = new Set([]); - expect(model.subUsecases).toStrictEqual(value); - }); - }); - describe(".description", () => { - it("resolves to particular value on initialization", () => { - const value = "test_description"; - expect(model.description).toBe(value); - }); - }); - describe(".embeddedLink", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.embeddedLink).toBe(value); - }); - }); - describe(".embeddedPhone", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.embeddedPhone).toBe(value); - }); - }); - describe(".affiliateMarketing", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.affiliateMarketing).toBe(value); - }); - }); - describe(".numberPool", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.numberPool).toBe(value); - }); - }); - describe(".ageGated", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.ageGated).toBe(value); - }); - }); - describe(".directLending", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.directLending).toBe(value); - }); - }); - describe(".subscriberOptin", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.subscriberOptin).toBe(value); - }); - }); - describe(".subscriberOptout", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.subscriberOptout).toBe(value); - }); - }); - describe(".subscriberHelp", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.subscriberHelp).toBe(value); - }); - }); - describe(".sample1", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample1"; - expect(model.sample1).toBe(value); - }); - }); - describe(".sample2", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample2"; - expect(model.sample2).toBe(value); - }); - }); - describe(".sample3", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample3"; - expect(model.sample3).toBe(value); - }); - }); - describe(".sample4", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample4"; - expect(model.sample4).toBe(value); - }); - }); - describe(".sample5", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample5"; - expect(model.sample5).toBe(value); - }); - }); - describe(".messageFlow", () => { - it("resolves to particular value on initialization", () => { - const value = "test_messageFlow"; - expect(model.messageFlow).toBe(value); - }); - }); - describe(".helpMessage", () => { - it("resolves to particular value on initialization", () => { - const value = "test_helpMessage"; - expect(model.helpMessage).toBe(value); - }); - }); - describe(".optinKeywords", () => { - it("resolves to particular value on initialization", () => { - const value = "test_optinKeywords"; - expect(model.optinKeywords).toBe(value); - }); - }); - describe(".optoutKeywords", () => { - it("resolves to particular value on initialization", () => { - const value = "test_optoutKeywords"; - expect(model.optoutKeywords).toBe(value); - }); - }); - describe(".helpKeywords", () => { - it("resolves to particular value on initialization", () => { - const value = "test_helpKeywords"; - expect(model.helpKeywords).toBe(value); - }); - }); - describe(".optinMessage", () => { - it("resolves to particular value on initialization", () => { - const value = "test_optinMessage"; - expect(model.optinMessage).toBe(value); - }); - }); - describe(".optoutMessage", () => { - it("resolves to particular value on initialization", () => { - const value = "test_optoutMessage"; - expect(model.optoutMessage).toBe(value); - }); - }); - describe(".referenceId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_referenceId"; - expect(model.referenceId).toBe(value); - }); - }); - describe(".mock", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.mock).toBe(value); - }); - }); - describe(".nextRenewalOrExpirationDate", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextRenewalOrExpirationDate"; - expect(model.nextRenewalOrExpirationDate).toBe(value); + status: freeclimb.SMSTenDLCCampaignStatus.ACTIVE, + createDate: new Date("December 17, 1995 03:24:00"), + autoRenewal: true, + billedDate: new Date("December 17, 1995 03:24:00"), + brandId: "test_brandId", + usecase: "test_usecase", + subUsecases: new Set([]), + description: "test_description", + embeddedLink: true, + embeddedPhone: true, + affiliateMarketing: true, + numberPool: true, + ageGated: true, + directLending: true, + subscriberOptin: true, + subscriberOptout: true, + subscriberHelp: true, + sample1: "test_sample1", + sample2: "test_sample2", + sample3: "test_sample3", + sample4: "test_sample4", + sample5: "test_sample5", + messageFlow: "test_messageFlow", + helpMessage: "test_helpMessage", + optinKeywords: "test_optinKeywords", + optoutKeywords: "test_optoutKeywords", + helpKeywords: "test_helpKeywords", + optinMessage: "test_optinMessage", + optoutMessage: "test_optoutMessage", + referenceId: "test_referenceId", + mock: true, + nextRenewalOrExpirationDate: "test_nextRenewalOrExpirationDate", + }); + describe("SMSTenDLCCampaign class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaign); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); + }); + }); + describe(".cspId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_cspId"; + expect(model.cspId).toBe(value); + }); + }); + describe(".resellerId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_resellerId"; + expect(model.resellerId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "ACTIVE"; + expect(model.status).toBe(value); + }); + }); + describe(".createDate", () => { + it("resolves to particular value on initialization", () => { + const value = new Date("December 17, 1995 03:24:00"); + expect(model.createDate).toStrictEqual(value); + }); + }); + describe(".autoRenewal", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.autoRenewal).toBe(value); + }); + }); + describe(".billedDate", () => { + it("resolves to particular value on initialization", () => { + const value = new Date("December 17, 1995 03:24:00"); + expect(model.billedDate).toStrictEqual(value); + }); + }); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_brandId"; + expect(model.brandId).toBe(value); + }); + }); + describe(".usecase", () => { + it("resolves to particular value on initialization", () => { + const value = "test_usecase"; + expect(model.usecase).toBe(value); + }); + }); + describe(".subUsecases", () => { + it("resolves to particular value on initialization", () => { + const value = new Set([]); + expect(model.subUsecases).toStrictEqual(value); + }); + }); + describe(".description", () => { + it("resolves to particular value on initialization", () => { + const value = "test_description"; + expect(model.description).toBe(value); + }); + }); + describe(".embeddedLink", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.embeddedLink).toBe(value); + }); + }); + describe(".embeddedPhone", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.embeddedPhone).toBe(value); + }); + }); + describe(".affiliateMarketing", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.affiliateMarketing).toBe(value); + }); + }); + describe(".numberPool", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.numberPool).toBe(value); + }); + }); + describe(".ageGated", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.ageGated).toBe(value); + }); + }); + describe(".directLending", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.directLending).toBe(value); + }); + }); + describe(".subscriberOptin", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.subscriberOptin).toBe(value); + }); + }); + describe(".subscriberOptout", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.subscriberOptout).toBe(value); + }); + }); + describe(".subscriberHelp", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.subscriberHelp).toBe(value); + }); + }); + describe(".sample1", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample1"; + expect(model.sample1).toBe(value); + }); + }); + describe(".sample2", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample2"; + expect(model.sample2).toBe(value); + }); + }); + describe(".sample3", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample3"; + expect(model.sample3).toBe(value); + }); + }); + describe(".sample4", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample4"; + expect(model.sample4).toBe(value); + }); + }); + describe(".sample5", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample5"; + expect(model.sample5).toBe(value); + }); + }); + describe(".messageFlow", () => { + it("resolves to particular value on initialization", () => { + const value = "test_messageFlow"; + expect(model.messageFlow).toBe(value); + }); + }); + describe(".helpMessage", () => { + it("resolves to particular value on initialization", () => { + const value = "test_helpMessage"; + expect(model.helpMessage).toBe(value); + }); + }); + describe(".optinKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = "test_optinKeywords"; + expect(model.optinKeywords).toBe(value); + }); + }); + describe(".optoutKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = "test_optoutKeywords"; + expect(model.optoutKeywords).toBe(value); + }); + }); + describe(".helpKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = "test_helpKeywords"; + expect(model.helpKeywords).toBe(value); + }); + }); + describe(".optinMessage", () => { + it("resolves to particular value on initialization", () => { + const value = "test_optinMessage"; + expect(model.optinMessage).toBe(value); + }); + }); + describe(".optoutMessage", () => { + it("resolves to particular value on initialization", () => { + const value = "test_optoutMessage"; + expect(model.optoutMessage).toBe(value); + }); + }); + describe(".referenceId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_referenceId"; + expect(model.referenceId).toBe(value); + }); + }); + describe(".mock", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.mock).toBe(value); + }); + }); + describe(".nextRenewalOrExpirationDate", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextRenewalOrExpirationDate"; + expect(model.nextRenewalOrExpirationDate).toBe(value); + }); + }); + }); + describe("Test with falsy values", () => { + const Klass = freeclimb.SMSTenDLCCampaign; + let model: freeclimb.SMSTenDLCCampaign = new freeclimb.SMSTenDLCCampaign({ + accountId: "", + campaignId: "", + cspId: "", + resellerId: "", + + status: freeclimb.SMSTenDLCCampaignStatus.ACTIVE, + createDate: undefined, + autoRenewal: false, + billedDate: undefined, + brandId: "", + usecase: "", + subUsecases: new Set([]), + description: "", + embeddedLink: false, + embeddedPhone: false, + affiliateMarketing: false, + numberPool: false, + ageGated: false, + directLending: false, + subscriberOptin: false, + subscriberOptout: false, + subscriberHelp: false, + sample1: "", + sample2: "", + sample3: "", + sample4: "", + sample5: "", + messageFlow: "", + helpMessage: "", + optinKeywords: "", + optoutKeywords: "", + helpKeywords: "", + optinMessage: "", + optoutMessage: "", + referenceId: "", + mock: false, + nextRenewalOrExpirationDate: "", + }); + describe("SMSTenDLCCampaign class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaign); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.campaignId).toBe(value); + }); + }); + describe(".cspId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.cspId).toBe(value); + }); + }); + describe(".resellerId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.resellerId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "ACTIVE"; + expect(model.status).toBe(value); + }); + }); + describe(".createDate", () => { + it("resolves to particular value on initialization", () => { + const value = undefined; + expect(model.createDate).toStrictEqual(value); + }); + }); + describe(".autoRenewal", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.autoRenewal).toBe(value); + }); + }); + describe(".billedDate", () => { + it("resolves to particular value on initialization", () => { + const value = undefined; + expect(model.billedDate).toStrictEqual(value); + }); + }); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.brandId).toBe(value); + }); + }); + describe(".usecase", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.usecase).toBe(value); + }); + }); + describe(".subUsecases", () => { + it("resolves to particular value on initialization", () => { + const value = new Set([]); + expect(model.subUsecases).toStrictEqual(value); + }); + }); + describe(".description", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.description).toBe(value); + }); + }); + describe(".embeddedLink", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.embeddedLink).toBe(value); + }); + }); + describe(".embeddedPhone", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.embeddedPhone).toBe(value); + }); + }); + describe(".affiliateMarketing", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.affiliateMarketing).toBe(value); + }); + }); + describe(".numberPool", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.numberPool).toBe(value); + }); + }); + describe(".ageGated", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.ageGated).toBe(value); + }); + }); + describe(".directLending", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.directLending).toBe(value); + }); + }); + describe(".subscriberOptin", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.subscriberOptin).toBe(value); + }); + }); + describe(".subscriberOptout", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.subscriberOptout).toBe(value); + }); + }); + describe(".subscriberHelp", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.subscriberHelp).toBe(value); + }); + }); + describe(".sample1", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample1).toBe(value); + }); + }); + describe(".sample2", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample2).toBe(value); + }); + }); + describe(".sample3", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample3).toBe(value); + }); + }); + describe(".sample4", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample4).toBe(value); + }); + }); + describe(".sample5", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample5).toBe(value); + }); + }); + describe(".messageFlow", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.messageFlow).toBe(value); + }); + }); + describe(".helpMessage", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.helpMessage).toBe(value); + }); + }); + describe(".optinKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.optinKeywords).toBe(value); + }); + }); + describe(".optoutKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.optoutKeywords).toBe(value); + }); + }); + describe(".helpKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.helpKeywords).toBe(value); + }); + }); + describe(".optinMessage", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.optinMessage).toBe(value); + }); + }); + describe(".optoutMessage", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.optoutMessage).toBe(value); + }); + }); + describe(".referenceId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.referenceId).toBe(value); + }); + }); + describe(".mock", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.mock).toBe(value); + }); + }); + describe(".nextRenewalOrExpirationDate", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextRenewalOrExpirationDate).toBe(value); + }); + }); + }); + describe("Test with only required values", () => { + const Klass = freeclimb.SMSTenDLCCampaign; + let constructorArguments = { + campaignId: "test_campaignId", + cspId: "test_cspId", + brandId: "test_brandId", + usecase: "test_usecase", + subUsecases: new Set([]), + description: "test_description", + mock: true, + }; + let model: freeclimb.SMSTenDLCCampaign = new freeclimb.SMSTenDLCCampaign( + constructorArguments, + ); + + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#campaignId", () => { + it("resolves to initialization value", () => { + expect(model.campaignId).toBe(constructorArguments["campaignId"]); + }); + }); + describe("#cspId", () => { + it("resolves to initialization value", () => { + expect(model.cspId).toBe(constructorArguments["cspId"]); + }); + }); + describe("#resellerId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "resellerId", + )?.defaultValue; + expect(model.resellerId).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#createDate", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "createDate", + )?.defaultValue; + expect(model.createDate).toBe(value); + }); + }); + describe("#autoRenewal", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "autoRenewal", + )?.defaultValue; + expect(model.autoRenewal).toBe(value); + }); + }); + describe("#billedDate", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "billedDate", + )?.defaultValue; + expect(model.billedDate).toBe(value); + }); + }); + describe("#brandId", () => { + it("resolves to initialization value", () => { + expect(model.brandId).toBe(constructorArguments["brandId"]); + }); + }); + describe("#usecase", () => { + it("resolves to initialization value", () => { + expect(model.usecase).toBe(constructorArguments["usecase"]); + }); + }); + describe("#subUsecases", () => { + it("resolves to initialization value", () => { + expect(model.subUsecases).toBe(constructorArguments["subUsecases"]); + }); + }); + describe("#description", () => { + it("resolves to initialization value", () => { + expect(model.description).toBe(constructorArguments["description"]); + }); + }); + describe("#embeddedLink", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "embeddedLink", + )?.defaultValue; + expect(model.embeddedLink).toBe(value); + }); + }); + describe("#embeddedPhone", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "embeddedPhone", + )?.defaultValue; + expect(model.embeddedPhone).toBe(value); + }); + }); + describe("#affiliateMarketing", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "affiliateMarketing", + )?.defaultValue; + expect(model.affiliateMarketing).toBe(value); + }); + }); + describe("#numberPool", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "numberPool", + )?.defaultValue; + expect(model.numberPool).toBe(value); + }); + }); + describe("#ageGated", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "ageGated", + )?.defaultValue; + expect(model.ageGated).toBe(value); + }); + }); + describe("#directLending", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "directLending", + )?.defaultValue; + expect(model.directLending).toBe(value); + }); + }); + describe("#subscriberOptin", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subscriberOptin", + )?.defaultValue; + expect(model.subscriberOptin).toBe(value); + }); + }); + describe("#subscriberOptout", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subscriberOptout", + )?.defaultValue; + expect(model.subscriberOptout).toBe(value); + }); + }); + describe("#subscriberHelp", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subscriberHelp", + )?.defaultValue; + expect(model.subscriberHelp).toBe(value); + }); + }); + describe("#sample1", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample1", + )?.defaultValue; + expect(model.sample1).toBe(value); + }); + }); + describe("#sample2", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample2", + )?.defaultValue; + expect(model.sample2).toBe(value); + }); + }); + describe("#sample3", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample3", + )?.defaultValue; + expect(model.sample3).toBe(value); + }); + }); + describe("#sample4", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample4", + )?.defaultValue; + expect(model.sample4).toBe(value); + }); + }); + describe("#sample5", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample5", + )?.defaultValue; + expect(model.sample5).toBe(value); + }); + }); + describe("#messageFlow", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "messageFlow", + )?.defaultValue; + expect(model.messageFlow).toBe(value); + }); + }); + describe("#helpMessage", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "helpMessage", + )?.defaultValue; + expect(model.helpMessage).toBe(value); + }); + }); + describe("#optinKeywords", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optinKeywords", + )?.defaultValue; + expect(model.optinKeywords).toBe(value); + }); + }); + describe("#optoutKeywords", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optoutKeywords", + )?.defaultValue; + expect(model.optoutKeywords).toBe(value); + }); + }); + describe("#helpKeywords", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "helpKeywords", + )?.defaultValue; + expect(model.helpKeywords).toBe(value); + }); + }); + describe("#optinMessage", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optinMessage", + )?.defaultValue; + expect(model.optinMessage).toBe(value); + }); + }); + describe("#optoutMessage", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optoutMessage", + )?.defaultValue; + expect(model.optoutMessage).toBe(value); + }); + }); + describe("#referenceId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "referenceId", + )?.defaultValue; + expect(model.referenceId).toBe(value); + }); + }); + describe("#mock", () => { + it("resolves to initialization value", () => { + expect(model.mock).toBe(constructorArguments["mock"]); + }); + }); + describe("#nextRenewalOrExpirationDate", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "nextRenewalOrExpirationDate", + )?.defaultValue; + expect(model.nextRenewalOrExpirationDate).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCCampaignStatus.spec.ts b/__tests__/models/SMSTenDLCCampaignStatus.spec.ts index 84f0f7a..d85c596 100644 --- a/__tests__/models/SMSTenDLCCampaignStatus.spec.ts +++ b/__tests__/models/SMSTenDLCCampaignStatus.spec.ts @@ -2,14 +2,16 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCCampaignStatus", () => { - describe(".ACTIVE", () => { - it("resolves to correct value for ACTIVE enum property", () => { - expect(freeclimb.SMSTenDLCCampaignStatus.ACTIVE).toBe("ACTIVE"); + describe("Test with truthy values", () => { + describe(".ACTIVE", () => { + it("resolves to correct value for ACTIVE enum property", () => { + expect(freeclimb.SMSTenDLCCampaignStatus.ACTIVE).toBe("ACTIVE"); + }); }); - }); - describe(".EXPIRED", () => { - it("resolves to correct value for EXPIRED enum property", () => { - expect(freeclimb.SMSTenDLCCampaignStatus.EXPIRED).toBe("EXPIRED"); + describe(".EXPIRED", () => { + it("resolves to correct value for EXPIRED enum property", () => { + expect(freeclimb.SMSTenDLCCampaignStatus.EXPIRED).toBe("EXPIRED"); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCCampaignsListResult.spec.ts b/__tests__/models/SMSTenDLCCampaignsListResult.spec.ts index 5b3924e..113a977 100644 --- a/__tests__/models/SMSTenDLCCampaignsListResult.spec.ts +++ b/__tests__/models/SMSTenDLCCampaignsListResult.spec.ts @@ -2,68 +2,161 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCCampaignsListResult", () => { - let model: freeclimb.SMSTenDLCCampaignsListResult = - new freeclimb.SMSTenDLCCampaignsListResult({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - campaigns: [], + describe("Test with truthy values", () => { + const Klass = freeclimb.SMSTenDLCCampaignsListResult; + let model: freeclimb.SMSTenDLCCampaignsListResult = + new freeclimb.SMSTenDLCCampaignsListResult({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + campaigns: [], + }); + describe("SMSTenDLCCampaignsListResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaignsListResult); + }); }); - describe("SMSTenDLCCampaignsListResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaignsListResult); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".campaigns", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.SMSTenDLCCampaign[] = []; + expect(model.campaigns).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.SMSTenDLCCampaignsListResult; + let model: freeclimb.SMSTenDLCCampaignsListResult = + new freeclimb.SMSTenDLCCampaignsListResult({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + campaigns: [], + }); + describe("SMSTenDLCCampaignsListResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaignsListResult); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".campaigns", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.SMSTenDLCCampaign[] = []; + expect(model.campaigns).toStrictEqual(value); + }); }); }); - describe(".campaigns", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.SMSTenDLCCampaign[] = []; - expect(model.campaigns).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.SMSTenDLCCampaignsListResult; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.SMSTenDLCCampaignsListResult = + new freeclimb.SMSTenDLCCampaignsListResult(constructorArguments); + + describe("#campaigns", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "campaigns", + )?.defaultValue; + expect(model.campaigns).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCPartnerCampaign.spec.ts b/__tests__/models/SMSTenDLCPartnerCampaign.spec.ts index 5411acb..171fa5b 100644 --- a/__tests__/models/SMSTenDLCPartnerCampaign.spec.ts +++ b/__tests__/models/SMSTenDLCPartnerCampaign.spec.ts @@ -2,223 +2,680 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCPartnerCampaign", () => { - let model: freeclimb.SMSTenDLCPartnerCampaign = - new freeclimb.SMSTenDLCPartnerCampaign({ - accountId: "test_accountId", - campaignId: "test_campaignId", + describe("Test with truthy values", () => { + const Klass = freeclimb.SMSTenDLCPartnerCampaign; + let model: freeclimb.SMSTenDLCPartnerCampaign = + new freeclimb.SMSTenDLCPartnerCampaign({ + accountId: "test_accountId", + campaignId: "test_campaignId", - status: freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE, - createDate: new Date("December 17, 1995 03:24:00"), - brandId: "test_brandId", - usecase: "test_usecase", - description: "test_description", - embeddedLink: true, - embeddedPhone: true, - affiliateMarketing: true, - numberPool: true, - ageGated: true, - directLending: true, - subscriberOptin: true, - subscriberOptout: true, - subscriberHelp: true, - sample1: "test_sample1", - sample2: "test_sample2", - sample3: "test_sample3", - sample4: "test_sample4", - sample5: "test_sample5", - messageFlow: "test_messageFlow", - helpMessage: "test_helpMessage", - optinKeywords: "test_optinKeywords", - optoutKeywords: "test_optoutKeywords", - helpKeywords: "test_helpKeywords", - optinMessage: "test_optinMessage", - optoutMessage: "test_optoutMessage", + status: freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE, + createDate: new Date("December 17, 1995 03:24:00"), + brandId: "test_brandId", + usecase: "test_usecase", + description: "test_description", + embeddedLink: true, + embeddedPhone: true, + affiliateMarketing: true, + numberPool: true, + ageGated: true, + directLending: true, + subscriberOptin: true, + subscriberOptout: true, + subscriberHelp: true, + sample1: "test_sample1", + sample2: "test_sample2", + sample3: "test_sample3", + sample4: "test_sample4", + sample5: "test_sample5", + messageFlow: "test_messageFlow", + helpMessage: "test_helpMessage", + optinKeywords: "test_optinKeywords", + optoutKeywords: "test_optoutKeywords", + helpKeywords: "test_helpKeywords", + optinMessage: "test_optinMessage", + optoutMessage: "test_optoutMessage", - brand: new freeclimb.SMSTenDLCPartnerCampaignBrand({ - email: null as any, - phone: null as any, - }), + brand: new freeclimb.SMSTenDLCPartnerCampaignBrand({ + email: null as any, + phone: null as any, + }), + }); + describe("SMSTenDLCPartnerCampaign class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaign); + }); }); - describe("SMSTenDLCPartnerCampaign class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaign); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); + }); }); - }); - describe(".campaignId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_campaignId"; - expect(model.campaignId).toBe(value); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "ACTIVE"; + expect(model.status).toBe(value); + }); }); - }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "ACTIVE"; - expect(model.status).toBe(value); + describe(".createDate", () => { + it("resolves to particular value on initialization", () => { + const value = new Date("December 17, 1995 03:24:00"); + expect(model.createDate).toStrictEqual(value); + }); }); - }); - describe(".createDate", () => { - it("resolves to particular value on initialization", () => { - const value = new Date("December 17, 1995 03:24:00"); - expect(model.createDate).toStrictEqual(value); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_brandId"; + expect(model.brandId).toBe(value); + }); }); - }); - describe(".brandId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_brandId"; - expect(model.brandId).toBe(value); + describe(".usecase", () => { + it("resolves to particular value on initialization", () => { + const value = "test_usecase"; + expect(model.usecase).toBe(value); + }); }); - }); - describe(".usecase", () => { - it("resolves to particular value on initialization", () => { - const value = "test_usecase"; - expect(model.usecase).toBe(value); + describe(".description", () => { + it("resolves to particular value on initialization", () => { + const value = "test_description"; + expect(model.description).toBe(value); + }); }); - }); - describe(".description", () => { - it("resolves to particular value on initialization", () => { - const value = "test_description"; - expect(model.description).toBe(value); + describe(".embeddedLink", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.embeddedLink).toBe(value); + }); }); - }); - describe(".embeddedLink", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.embeddedLink).toBe(value); + describe(".embeddedPhone", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.embeddedPhone).toBe(value); + }); }); - }); - describe(".embeddedPhone", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.embeddedPhone).toBe(value); + describe(".affiliateMarketing", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.affiliateMarketing).toBe(value); + }); }); - }); - describe(".affiliateMarketing", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.affiliateMarketing).toBe(value); + describe(".numberPool", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.numberPool).toBe(value); + }); }); - }); - describe(".numberPool", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.numberPool).toBe(value); + describe(".ageGated", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.ageGated).toBe(value); + }); }); - }); - describe(".ageGated", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.ageGated).toBe(value); + describe(".directLending", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.directLending).toBe(value); + }); }); - }); - describe(".directLending", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.directLending).toBe(value); + describe(".subscriberOptin", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.subscriberOptin).toBe(value); + }); }); - }); - describe(".subscriberOptin", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.subscriberOptin).toBe(value); + describe(".subscriberOptout", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.subscriberOptout).toBe(value); + }); }); - }); - describe(".subscriberOptout", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.subscriberOptout).toBe(value); + describe(".subscriberHelp", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.subscriberHelp).toBe(value); + }); }); - }); - describe(".subscriberHelp", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.subscriberHelp).toBe(value); + describe(".sample1", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample1"; + expect(model.sample1).toBe(value); + }); }); - }); - describe(".sample1", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample1"; - expect(model.sample1).toBe(value); + describe(".sample2", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample2"; + expect(model.sample2).toBe(value); + }); }); - }); - describe(".sample2", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample2"; - expect(model.sample2).toBe(value); + describe(".sample3", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample3"; + expect(model.sample3).toBe(value); + }); }); - }); - describe(".sample3", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample3"; - expect(model.sample3).toBe(value); + describe(".sample4", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample4"; + expect(model.sample4).toBe(value); + }); }); - }); - describe(".sample4", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample4"; - expect(model.sample4).toBe(value); + describe(".sample5", () => { + it("resolves to particular value on initialization", () => { + const value = "test_sample5"; + expect(model.sample5).toBe(value); + }); }); - }); - describe(".sample5", () => { - it("resolves to particular value on initialization", () => { - const value = "test_sample5"; - expect(model.sample5).toBe(value); + describe(".messageFlow", () => { + it("resolves to particular value on initialization", () => { + const value = "test_messageFlow"; + expect(model.messageFlow).toBe(value); + }); }); - }); - describe(".messageFlow", () => { - it("resolves to particular value on initialization", () => { - const value = "test_messageFlow"; - expect(model.messageFlow).toBe(value); + describe(".helpMessage", () => { + it("resolves to particular value on initialization", () => { + const value = "test_helpMessage"; + expect(model.helpMessage).toBe(value); + }); }); - }); - describe(".helpMessage", () => { - it("resolves to particular value on initialization", () => { - const value = "test_helpMessage"; - expect(model.helpMessage).toBe(value); + describe(".optinKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = "test_optinKeywords"; + expect(model.optinKeywords).toBe(value); + }); }); - }); - describe(".optinKeywords", () => { - it("resolves to particular value on initialization", () => { - const value = "test_optinKeywords"; - expect(model.optinKeywords).toBe(value); + describe(".optoutKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = "test_optoutKeywords"; + expect(model.optoutKeywords).toBe(value); + }); }); - }); - describe(".optoutKeywords", () => { - it("resolves to particular value on initialization", () => { - const value = "test_optoutKeywords"; - expect(model.optoutKeywords).toBe(value); + describe(".helpKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = "test_helpKeywords"; + expect(model.helpKeywords).toBe(value); + }); }); - }); - describe(".helpKeywords", () => { - it("resolves to particular value on initialization", () => { - const value = "test_helpKeywords"; - expect(model.helpKeywords).toBe(value); + describe(".optinMessage", () => { + it("resolves to particular value on initialization", () => { + const value = "test_optinMessage"; + expect(model.optinMessage).toBe(value); + }); }); - }); - describe(".optinMessage", () => { - it("resolves to particular value on initialization", () => { - const value = "test_optinMessage"; - expect(model.optinMessage).toBe(value); + describe(".optoutMessage", () => { + it("resolves to particular value on initialization", () => { + const value = "test_optoutMessage"; + expect(model.optoutMessage).toBe(value); + }); + }); + describe(".brand", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.SMSTenDLCPartnerCampaignBrand({ + email: null as any, + phone: null as any, + }); + expect(model.brand).toStrictEqual(value); + }); }); }); - describe(".optoutMessage", () => { - it("resolves to particular value on initialization", () => { - const value = "test_optoutMessage"; - expect(model.optoutMessage).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.SMSTenDLCPartnerCampaign; + let model: freeclimb.SMSTenDLCPartnerCampaign = + new freeclimb.SMSTenDLCPartnerCampaign({ + accountId: "", + campaignId: "", + + status: freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE, + createDate: undefined, + brandId: "", + usecase: "", + description: "", + embeddedLink: false, + embeddedPhone: false, + affiliateMarketing: false, + numberPool: false, + ageGated: false, + directLending: false, + subscriberOptin: false, + subscriberOptout: false, + subscriberHelp: false, + sample1: "", + sample2: "", + sample3: "", + sample4: "", + sample5: "", + messageFlow: "", + helpMessage: "", + optinKeywords: "", + optoutKeywords: "", + helpKeywords: "", + optinMessage: "", + optoutMessage: "", + + brand: new freeclimb.SMSTenDLCPartnerCampaignBrand({ + email: null as any, + phone: null as any, + }), + }); + describe("SMSTenDLCPartnerCampaign class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaign); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.campaignId).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "ACTIVE"; + expect(model.status).toBe(value); + }); + }); + describe(".createDate", () => { + it("resolves to particular value on initialization", () => { + const value = undefined; + expect(model.createDate).toStrictEqual(value); + }); + }); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.brandId).toBe(value); + }); + }); + describe(".usecase", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.usecase).toBe(value); + }); + }); + describe(".description", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.description).toBe(value); + }); + }); + describe(".embeddedLink", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.embeddedLink).toBe(value); + }); + }); + describe(".embeddedPhone", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.embeddedPhone).toBe(value); + }); + }); + describe(".affiliateMarketing", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.affiliateMarketing).toBe(value); + }); + }); + describe(".numberPool", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.numberPool).toBe(value); + }); + }); + describe(".ageGated", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.ageGated).toBe(value); + }); + }); + describe(".directLending", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.directLending).toBe(value); + }); + }); + describe(".subscriberOptin", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.subscriberOptin).toBe(value); + }); + }); + describe(".subscriberOptout", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.subscriberOptout).toBe(value); + }); + }); + describe(".subscriberHelp", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.subscriberHelp).toBe(value); + }); + }); + describe(".sample1", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample1).toBe(value); + }); + }); + describe(".sample2", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample2).toBe(value); + }); + }); + describe(".sample3", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample3).toBe(value); + }); + }); + describe(".sample4", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample4).toBe(value); + }); + }); + describe(".sample5", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.sample5).toBe(value); + }); + }); + describe(".messageFlow", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.messageFlow).toBe(value); + }); + }); + describe(".helpMessage", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.helpMessage).toBe(value); + }); + }); + describe(".optinKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.optinKeywords).toBe(value); + }); + }); + describe(".optoutKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.optoutKeywords).toBe(value); + }); + }); + describe(".helpKeywords", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.helpKeywords).toBe(value); + }); + }); + describe(".optinMessage", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.optinMessage).toBe(value); + }); + }); + describe(".optoutMessage", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.optoutMessage).toBe(value); + }); + }); + describe(".brand", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.SMSTenDLCPartnerCampaignBrand({ + email: null as any, + phone: null as any, + }); + expect(model.brand).toStrictEqual(value); + }); }); }); - describe(".brand", () => { - it("resolves to particular value on initialization", () => { - const value = new freeclimb.SMSTenDLCPartnerCampaignBrand({ - email: null as any, - phone: null as any, + describe("Test with only required values", () => { + const Klass = freeclimb.SMSTenDLCPartnerCampaign; + let constructorArguments = { + campaignId: "test_campaignId", + brandId: "test_brandId", + usecase: "test_usecase", + description: "test_description", + }; + let model: freeclimb.SMSTenDLCPartnerCampaign = + new freeclimb.SMSTenDLCPartnerCampaign(constructorArguments); + + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#campaignId", () => { + it("resolves to initialization value", () => { + expect(model.campaignId).toBe(constructorArguments["campaignId"]); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); + }); + describe("#createDate", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "createDate", + )?.defaultValue; + expect(model.createDate).toBe(value); + }); + }); + describe("#brandId", () => { + it("resolves to initialization value", () => { + expect(model.brandId).toBe(constructorArguments["brandId"]); + }); + }); + describe("#usecase", () => { + it("resolves to initialization value", () => { + expect(model.usecase).toBe(constructorArguments["usecase"]); + }); + }); + describe("#description", () => { + it("resolves to initialization value", () => { + expect(model.description).toBe(constructorArguments["description"]); + }); + }); + describe("#embeddedLink", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "embeddedLink", + )?.defaultValue; + expect(model.embeddedLink).toBe(value); + }); + }); + describe("#embeddedPhone", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "embeddedPhone", + )?.defaultValue; + expect(model.embeddedPhone).toBe(value); + }); + }); + describe("#affiliateMarketing", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "affiliateMarketing", + )?.defaultValue; + expect(model.affiliateMarketing).toBe(value); + }); + }); + describe("#numberPool", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "numberPool", + )?.defaultValue; + expect(model.numberPool).toBe(value); + }); + }); + describe("#ageGated", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "ageGated", + )?.defaultValue; + expect(model.ageGated).toBe(value); + }); + }); + describe("#directLending", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "directLending", + )?.defaultValue; + expect(model.directLending).toBe(value); + }); + }); + describe("#subscriberOptin", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subscriberOptin", + )?.defaultValue; + expect(model.subscriberOptin).toBe(value); + }); + }); + describe("#subscriberOptout", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subscriberOptout", + )?.defaultValue; + expect(model.subscriberOptout).toBe(value); + }); + }); + describe("#subscriberHelp", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "subscriberHelp", + )?.defaultValue; + expect(model.subscriberHelp).toBe(value); + }); + }); + describe("#sample1", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample1", + )?.defaultValue; + expect(model.sample1).toBe(value); + }); + }); + describe("#sample2", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample2", + )?.defaultValue; + expect(model.sample2).toBe(value); + }); + }); + describe("#sample3", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample3", + )?.defaultValue; + expect(model.sample3).toBe(value); + }); + }); + describe("#sample4", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample4", + )?.defaultValue; + expect(model.sample4).toBe(value); + }); + }); + describe("#sample5", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "sample5", + )?.defaultValue; + expect(model.sample5).toBe(value); + }); + }); + describe("#messageFlow", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "messageFlow", + )?.defaultValue; + expect(model.messageFlow).toBe(value); + }); + }); + describe("#helpMessage", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "helpMessage", + )?.defaultValue; + expect(model.helpMessage).toBe(value); + }); + }); + describe("#optinKeywords", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optinKeywords", + )?.defaultValue; + expect(model.optinKeywords).toBe(value); + }); + }); + describe("#optoutKeywords", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optoutKeywords", + )?.defaultValue; + expect(model.optoutKeywords).toBe(value); + }); + }); + describe("#helpKeywords", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "helpKeywords", + )?.defaultValue; + expect(model.helpKeywords).toBe(value); + }); + }); + describe("#optinMessage", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optinMessage", + )?.defaultValue; + expect(model.optinMessage).toBe(value); + }); + }); + describe("#optoutMessage", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optoutMessage", + )?.defaultValue; + expect(model.optoutMessage).toBe(value); + }); + }); + describe("#brand", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "brand", + )?.defaultValue; + expect(model.brand).toBe(value); }); - expect(model.brand).toStrictEqual(value); }); }); }); diff --git a/__tests__/models/SMSTenDLCPartnerCampaignBrand.spec.ts b/__tests__/models/SMSTenDLCPartnerCampaignBrand.spec.ts index b3fbd84..d4a741b 100644 --- a/__tests__/models/SMSTenDLCPartnerCampaignBrand.spec.ts +++ b/__tests__/models/SMSTenDLCPartnerCampaignBrand.spec.ts @@ -2,86 +2,266 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCPartnerCampaignBrand", () => { - let model: freeclimb.SMSTenDLCPartnerCampaignBrand = - new freeclimb.SMSTenDLCPartnerCampaignBrand({ - accountId: "test_accountId", - brandId: "test_brandId", - firstName: "test_firstName", - lastName: "test_lastName", - displayName: "test_displayName", - companyName: "test_companyName", - phone: "test_phone", - email: "test_email", - website: "test_website", + describe("Test with truthy values", () => { + const Klass = freeclimb.SMSTenDLCPartnerCampaignBrand; + let model: freeclimb.SMSTenDLCPartnerCampaignBrand = + new freeclimb.SMSTenDLCPartnerCampaignBrand({ + accountId: "test_accountId", + brandId: "test_brandId", + firstName: "test_firstName", + lastName: "test_lastName", + displayName: "test_displayName", + companyName: "test_companyName", + phone: "test_phone", + email: "test_email", + website: "test_website", - evpVettingScore: 1, + evpVettingScore: 1, + }); + describe("SMSTenDLCPartnerCampaignBrand class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaignBrand); + }); }); - describe("SMSTenDLCPartnerCampaignBrand class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaignBrand); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_brandId"; + expect(model.brandId).toBe(value); + }); }); - }); - describe(".brandId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_brandId"; - expect(model.brandId).toBe(value); + describe(".firstName", () => { + it("resolves to particular value on initialization", () => { + const value = "test_firstName"; + expect(model.firstName).toBe(value); + }); }); - }); - describe(".firstName", () => { - it("resolves to particular value on initialization", () => { - const value = "test_firstName"; - expect(model.firstName).toBe(value); + describe(".lastName", () => { + it("resolves to particular value on initialization", () => { + const value = "test_lastName"; + expect(model.lastName).toBe(value); + }); }); - }); - describe(".lastName", () => { - it("resolves to particular value on initialization", () => { - const value = "test_lastName"; - expect(model.lastName).toBe(value); + describe(".displayName", () => { + it("resolves to particular value on initialization", () => { + const value = "test_displayName"; + expect(model.displayName).toBe(value); + }); }); - }); - describe(".displayName", () => { - it("resolves to particular value on initialization", () => { - const value = "test_displayName"; - expect(model.displayName).toBe(value); + describe(".companyName", () => { + it("resolves to particular value on initialization", () => { + const value = "test_companyName"; + expect(model.companyName).toBe(value); + }); }); - }); - describe(".companyName", () => { - it("resolves to particular value on initialization", () => { - const value = "test_companyName"; - expect(model.companyName).toBe(value); + describe(".phone", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phone"; + expect(model.phone).toBe(value); + }); }); - }); - describe(".phone", () => { - it("resolves to particular value on initialization", () => { - const value = "test_phone"; - expect(model.phone).toBe(value); + describe(".email", () => { + it("resolves to particular value on initialization", () => { + const value = "test_email"; + expect(model.email).toBe(value); + }); }); - }); - describe(".email", () => { - it("resolves to particular value on initialization", () => { - const value = "test_email"; - expect(model.email).toBe(value); + describe(".website", () => { + it("resolves to particular value on initialization", () => { + const value = "test_website"; + expect(model.website).toBe(value); + }); }); - }); - describe(".website", () => { - it("resolves to particular value on initialization", () => { - const value = "test_website"; - expect(model.website).toBe(value); + describe(".optionalAttributes", () => { + it("resolves to particular value on initialization", () => {}); + }); + describe(".evpVettingScore", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.evpVettingScore).toBe(value); + }); }); }); - describe(".optionalAttributes", () => { - it("resolves to particular value on initialization", () => {}); + describe("Test with falsy values", () => { + const Klass = freeclimb.SMSTenDLCPartnerCampaignBrand; + let model: freeclimb.SMSTenDLCPartnerCampaignBrand = + new freeclimb.SMSTenDLCPartnerCampaignBrand({ + accountId: "", + brandId: "", + firstName: "", + lastName: "", + displayName: "", + companyName: "", + phone: "", + email: "", + website: "", + + evpVettingScore: 0, + }); + describe("SMSTenDLCPartnerCampaignBrand class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaignBrand); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".brandId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.brandId).toBe(value); + }); + }); + describe(".firstName", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.firstName).toBe(value); + }); + }); + describe(".lastName", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.lastName).toBe(value); + }); + }); + describe(".displayName", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.displayName).toBe(value); + }); + }); + describe(".companyName", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.companyName).toBe(value); + }); + }); + describe(".phone", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.phone).toBe(value); + }); + }); + describe(".email", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.email).toBe(value); + }); + }); + describe(".website", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.website).toBe(value); + }); + }); + describe(".optionalAttributes", () => { + it("resolves to particular value on initialization", () => {}); + }); + describe(".evpVettingScore", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.evpVettingScore).toBe(value); + }); + }); }); - describe(".evpVettingScore", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.evpVettingScore).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.SMSTenDLCPartnerCampaignBrand; + let constructorArguments = { + phone: "test_phone", + email: "test_email", + }; + let model: freeclimb.SMSTenDLCPartnerCampaignBrand = + new freeclimb.SMSTenDLCPartnerCampaignBrand(constructorArguments); + + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#brandId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "brandId", + )?.defaultValue; + expect(model.brandId).toBe(value); + }); + }); + describe("#firstName", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "firstName", + )?.defaultValue; + expect(model.firstName).toBe(value); + }); + }); + describe("#lastName", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "lastName", + )?.defaultValue; + expect(model.lastName).toBe(value); + }); + }); + describe("#displayName", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "displayName", + )?.defaultValue; + expect(model.displayName).toBe(value); + }); + }); + describe("#companyName", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "companyName", + )?.defaultValue; + expect(model.companyName).toBe(value); + }); + }); + describe("#phone", () => { + it("resolves to initialization value", () => { + expect(model.phone).toBe(constructorArguments["phone"]); + }); + }); + describe("#email", () => { + it("resolves to initialization value", () => { + expect(model.email).toBe(constructorArguments["email"]); + }); + }); + describe("#website", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "website", + )?.defaultValue; + expect(model.website).toBe(value); + }); + }); + describe("#optionalAttributes", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "optionalAttributes", + )?.defaultValue; + expect(model.optionalAttributes).toBe(value); + }); + }); + describe("#evpVettingScore", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "evpVettingScore", + )?.defaultValue; + expect(model.evpVettingScore).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCPartnerCampaignStatus.spec.ts b/__tests__/models/SMSTenDLCPartnerCampaignStatus.spec.ts index a48a442..89fd790 100644 --- a/__tests__/models/SMSTenDLCPartnerCampaignStatus.spec.ts +++ b/__tests__/models/SMSTenDLCPartnerCampaignStatus.spec.ts @@ -2,14 +2,18 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCPartnerCampaignStatus", () => { - describe(".ACTIVE", () => { - it("resolves to correct value for ACTIVE enum property", () => { - expect(freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE).toBe("ACTIVE"); + describe("Test with truthy values", () => { + describe(".ACTIVE", () => { + it("resolves to correct value for ACTIVE enum property", () => { + expect(freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE).toBe("ACTIVE"); + }); }); - }); - describe(".EXPIRED", () => { - it("resolves to correct value for EXPIRED enum property", () => { - expect(freeclimb.SMSTenDLCPartnerCampaignStatus.EXPIRED).toBe("EXPIRED"); + describe(".EXPIRED", () => { + it("resolves to correct value for EXPIRED enum property", () => { + expect(freeclimb.SMSTenDLCPartnerCampaignStatus.EXPIRED).toBe( + "EXPIRED", + ); + }); }); }); }); diff --git a/__tests__/models/SMSTenDLCPartnerCampaignsListResult.spec.ts b/__tests__/models/SMSTenDLCPartnerCampaignsListResult.spec.ts index 3addab8..a9291e7 100644 --- a/__tests__/models/SMSTenDLCPartnerCampaignsListResult.spec.ts +++ b/__tests__/models/SMSTenDLCPartnerCampaignsListResult.spec.ts @@ -2,70 +2,165 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTenDLCPartnerCampaignsListResult", () => { - let model: freeclimb.SMSTenDLCPartnerCampaignsListResult = - new freeclimb.SMSTenDLCPartnerCampaignsListResult({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - partnerCampaigns: [], + describe("Test with truthy values", () => { + const Klass = freeclimb.SMSTenDLCPartnerCampaignsListResult; + let model: freeclimb.SMSTenDLCPartnerCampaignsListResult = + new freeclimb.SMSTenDLCPartnerCampaignsListResult({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + partnerCampaigns: [], + }); + describe("SMSTenDLCPartnerCampaignsListResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.SMSTenDLCPartnerCampaignsListResult, + ); + }); }); - describe("SMSTenDLCPartnerCampaignsListResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf( - freeclimb.SMSTenDLCPartnerCampaignsListResult, - ); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".partnerCampaigns", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.SMSTenDLCPartnerCampaign[] = []; + expect(model.partnerCampaigns).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.SMSTenDLCPartnerCampaignsListResult; + let model: freeclimb.SMSTenDLCPartnerCampaignsListResult = + new freeclimb.SMSTenDLCPartnerCampaignsListResult({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + partnerCampaigns: [], + }); + describe("SMSTenDLCPartnerCampaignsListResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.SMSTenDLCPartnerCampaignsListResult, + ); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".partnerCampaigns", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.SMSTenDLCPartnerCampaign[] = []; + expect(model.partnerCampaigns).toStrictEqual(value); + }); }); }); - describe(".partnerCampaigns", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.SMSTenDLCPartnerCampaign[] = []; - expect(model.partnerCampaigns).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.SMSTenDLCPartnerCampaignsListResult; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.SMSTenDLCPartnerCampaignsListResult = + new freeclimb.SMSTenDLCPartnerCampaignsListResult(constructorArguments); + + describe("#partnerCampaigns", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "partnerCampaigns", + )?.defaultValue; + expect(model.partnerCampaigns).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SMSTollFreeCampaign.spec.ts b/__tests__/models/SMSTollFreeCampaign.spec.ts index 1aa1cc5..e0dff3b 100644 --- a/__tests__/models/SMSTollFreeCampaign.spec.ts +++ b/__tests__/models/SMSTollFreeCampaign.spec.ts @@ -2,62 +2,182 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTollFreeCampaign", () => { - let model: freeclimb.SMSTollFreeCampaign = new freeclimb.SMSTollFreeCampaign({ - accountId: "test_accountId", - campaignId: "test_campaignId", - useCase: "test_useCase", + describe("Test with truthy values", () => { + const Klass = freeclimb.SMSTollFreeCampaign; + let model: freeclimb.SMSTollFreeCampaign = + new freeclimb.SMSTollFreeCampaign({ + accountId: "test_accountId", + campaignId: "test_campaignId", + useCase: "test_useCase", - registrationStatus: - freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - revision: 1, - }); - describe("SMSTollFreeCampaign class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaign); + registrationStatus: + freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }); + describe("SMSTollFreeCampaign class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaign); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".campaignId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_campaignId"; - expect(model.campaignId).toBe(value); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); + }); }); - }); - describe(".useCase", () => { - it("resolves to particular value on initialization", () => { - const value = "test_useCase"; - expect(model.useCase).toBe(value); + describe(".useCase", () => { + it("resolves to particular value on initialization", () => { + const value = "test_useCase"; + expect(model.useCase).toBe(value); + }); }); - }); - describe(".registrationStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "UNREGISTERED"; - expect(model.registrationStatus).toBe(value); + describe(".registrationStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "UNREGISTERED"; + expect(model.registrationStatus).toBe(value); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.SMSTollFreeCampaign; + let model: freeclimb.SMSTollFreeCampaign = + new freeclimb.SMSTollFreeCampaign({ + accountId: "", + campaignId: "", + useCase: "", + + registrationStatus: + freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, + dateCreated: "", + dateUpdated: "", + revision: 0, + }); + describe("SMSTollFreeCampaign class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaign); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.campaignId).toBe(value); + }); + }); + describe(".useCase", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.useCase).toBe(value); + }); + }); + describe(".registrationStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "UNREGISTERED"; + expect(model.registrationStatus).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); }); }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.SMSTollFreeCampaign; + let constructorArguments = { + accountId: "test_accountId", + campaignId: "test_campaignId", + useCase: "test_useCase", + + registrationStatus: + freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + revision: 1, + }; + let model: freeclimb.SMSTollFreeCampaign = + new freeclimb.SMSTollFreeCampaign(constructorArguments); + + describe("#accountId", () => { + it("resolves to initialization value", () => { + expect(model.accountId).toBe(constructorArguments["accountId"]); + }); + }); + describe("#campaignId", () => { + it("resolves to initialization value", () => { + expect(model.campaignId).toBe(constructorArguments["campaignId"]); + }); + }); + describe("#useCase", () => { + it("resolves to initialization value", () => { + expect(model.useCase).toBe(constructorArguments["useCase"]); + }); + }); + describe("#registrationStatus", () => { + it("resolves to initialization value", () => { + expect(model.registrationStatus).toBe( + constructorArguments["registrationStatus"], + ); + }); + }); + describe("#dateCreated", () => { + it("resolves to initialization value", () => { + expect(model.dateCreated).toBe(constructorArguments["dateCreated"]); + }); + }); + describe("#dateUpdated", () => { + it("resolves to initialization value", () => { + expect(model.dateUpdated).toBe(constructorArguments["dateUpdated"]); + }); + }); + describe("#revision", () => { + it("resolves to initialization value", () => { + expect(model.revision).toBe(constructorArguments["revision"]); + }); }); }); }); diff --git a/__tests__/models/SMSTollFreeCampaignRegistrationStatus.spec.ts b/__tests__/models/SMSTollFreeCampaignRegistrationStatus.spec.ts index 43ccde2..1f62e46 100644 --- a/__tests__/models/SMSTollFreeCampaignRegistrationStatus.spec.ts +++ b/__tests__/models/SMSTollFreeCampaignRegistrationStatus.spec.ts @@ -2,39 +2,41 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTollFreeCampaignRegistrationStatus", () => { - describe(".UNREGISTERED", () => { - it("resolves to correct value for UNREGISTERED enum property", () => { - expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED).toBe( - "UNREGISTERED", - ); + describe("Test with truthy values", () => { + describe(".UNREGISTERED", () => { + it("resolves to correct value for UNREGISTERED enum property", () => { + expect( + freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, + ).toBe("UNREGISTERED"); + }); }); - }); - describe(".INITIATED", () => { - it("resolves to correct value for INITIATED enum property", () => { - expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.INITIATED).toBe( - "INITIATED", - ); + describe(".INITIATED", () => { + it("resolves to correct value for INITIATED enum property", () => { + expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.INITIATED).toBe( + "INITIATED", + ); + }); }); - }); - describe(".PENDING", () => { - it("resolves to correct value for PENDING enum property", () => { - expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.PENDING).toBe( - "PENDING", - ); + describe(".PENDING", () => { + it("resolves to correct value for PENDING enum property", () => { + expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.PENDING).toBe( + "PENDING", + ); + }); }); - }); - describe(".DECLINED", () => { - it("resolves to correct value for DECLINED enum property", () => { - expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.DECLINED).toBe( - "DECLINED", - ); + describe(".DECLINED", () => { + it("resolves to correct value for DECLINED enum property", () => { + expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.DECLINED).toBe( + "DECLINED", + ); + }); }); - }); - describe(".REGISTERED", () => { - it("resolves to correct value for REGISTERED enum property", () => { - expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.REGISTERED).toBe( - "REGISTERED", - ); + describe(".REGISTERED", () => { + it("resolves to correct value for REGISTERED enum property", () => { + expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.REGISTERED).toBe( + "REGISTERED", + ); + }); }); }); }); diff --git a/__tests__/models/SMSTollFreeCampaignsListResult.spec.ts b/__tests__/models/SMSTollFreeCampaignsListResult.spec.ts index ebae732..7c21a36 100644 --- a/__tests__/models/SMSTollFreeCampaignsListResult.spec.ts +++ b/__tests__/models/SMSTollFreeCampaignsListResult.spec.ts @@ -2,68 +2,161 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SMSTollFreeCampaignsListResult", () => { - let model: freeclimb.SMSTollFreeCampaignsListResult = - new freeclimb.SMSTollFreeCampaignsListResult({ - total: 1, - start: 1, - end: 1, - page: 1, - numPages: 1, - pageSize: 1, - nextPageUri: "test_nextPageUri", - brands: [], + describe("Test with truthy values", () => { + const Klass = freeclimb.SMSTollFreeCampaignsListResult; + let model: freeclimb.SMSTollFreeCampaignsListResult = + new freeclimb.SMSTollFreeCampaignsListResult({ + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + brands: [], + }); + describe("SMSTollFreeCampaignsListResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaignsListResult); + }); }); - describe("SMSTollFreeCampaignsListResult class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaignsListResult); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.total).toBe(value); + }); }); - }); - describe(".total", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.total).toBe(value); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.start).toBe(value); + }); }); - }); - describe(".start", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.start).toBe(value); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.end).toBe(value); + }); }); - }); - describe(".end", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.end).toBe(value); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.page).toBe(value); + }); }); - }); - describe(".page", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.page).toBe(value); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.numPages).toBe(value); + }); }); - }); - describe(".numPages", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.numPages).toBe(value); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pageSize).toBe(value); + }); }); - }); - describe(".pageSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pageSize).toBe(value); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = "test_nextPageUri"; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".brands", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.SMSTollFreeCampaign[] = []; + expect(model.brands).toStrictEqual(value); + }); }); }); - describe(".nextPageUri", () => { - it("resolves to particular value on initialization", () => { - const value = "test_nextPageUri"; - expect(model.nextPageUri).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.SMSTollFreeCampaignsListResult; + let model: freeclimb.SMSTollFreeCampaignsListResult = + new freeclimb.SMSTollFreeCampaignsListResult({ + total: 0, + start: 0, + end: 0, + page: 0, + numPages: 0, + pageSize: 0, + nextPageUri: "", + brands: [], + }); + describe("SMSTollFreeCampaignsListResult class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaignsListResult); + }); + }); + describe(".total", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.total).toBe(value); + }); + }); + describe(".start", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.start).toBe(value); + }); + }); + describe(".end", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.end).toBe(value); + }); + }); + describe(".page", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.page).toBe(value); + }); + }); + describe(".numPages", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.numPages).toBe(value); + }); + }); + describe(".pageSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pageSize).toBe(value); + }); + }); + describe(".nextPageUri", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.nextPageUri).toBe(value); + }); + }); + describe(".brands", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.SMSTollFreeCampaign[] = []; + expect(model.brands).toStrictEqual(value); + }); }); }); - describe(".brands", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.SMSTollFreeCampaign[] = []; - expect(model.brands).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.SMSTollFreeCampaignsListResult; + let constructorArguments = { + total: 1, + start: 1, + end: 1, + page: 1, + numPages: 1, + pageSize: 1, + nextPageUri: "test_nextPageUri", + }; + let model: freeclimb.SMSTollFreeCampaignsListResult = + new freeclimb.SMSTollFreeCampaignsListResult(constructorArguments); + + describe("#brands", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "brands", + )?.defaultValue; + expect(model.brands).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Say.spec.ts b/__tests__/models/Say.spec.ts index bf4e809..a8c3200 100644 --- a/__tests__/models/Say.spec.ts +++ b/__tests__/models/Say.spec.ts @@ -2,40 +2,119 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Say", () => { - let model: freeclimb.Say = new freeclimb.Say({ - text: "test_text", - language: "test_language", - loop: 1, - privacyMode: true, - }); - describe("Say class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Say); + describe("Test with truthy values", () => { + const Klass = freeclimb.Say; + let model: freeclimb.Say = new freeclimb.Say({ + text: "test_text", + language: "test_language", + loop: 1, + privacyMode: true, + }); + describe("Say class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Say); + }); }); - }); - describe(".text", () => { - it("resolves to particular value on initialization", () => { - const value = "test_text"; - expect(model.text).toBe(value); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = "test_text"; + expect(model.text).toBe(value); + }); }); - }); - describe(".language", () => { - it("resolves to particular value on initialization", () => { - const value = "test_language"; - expect(model.language).toBe(value); + describe(".language", () => { + it("resolves to particular value on initialization", () => { + const value = "test_language"; + expect(model.language).toBe(value); + }); + }); + describe(".loop", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.loop).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".loop", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.loop).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.Say; + let model: freeclimb.Say = new freeclimb.Say({ + text: "", + language: "", + loop: 0, + privacyMode: false, + }); + describe("Say class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Say); + }); + }); + + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.text).toBe(value); + }); + }); + describe(".language", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.language).toBe(value); + }); + }); + describe(".loop", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.loop).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".privacyMode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyMode).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.Say; + let constructorArguments = { + text: "test_text", + }; + let model: freeclimb.Say = new freeclimb.Say(constructorArguments); + + describe("#text", () => { + it("resolves to initialization value", () => { + expect(model.text).toBe(constructorArguments["text"]); + }); + }); + describe("#language", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "language", + )?.defaultValue; + expect(model.language).toBe(value); + }); + }); + describe("#loop", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "loop", + )?.defaultValue; + expect(model.loop).toBe(value); + }); + }); + describe("#privacyMode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyMode", + )?.defaultValue; + expect(model.privacyMode).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SendDigits.spec.ts b/__tests__/models/SendDigits.spec.ts index 829729e..231c56c 100644 --- a/__tests__/models/SendDigits.spec.ts +++ b/__tests__/models/SendDigits.spec.ts @@ -2,33 +2,99 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SendDigits", () => { - let model: freeclimb.SendDigits = new freeclimb.SendDigits({ - digits: "test_digits", - pauseMs: 1, - privacyMode: true, - }); - describe("SendDigits class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SendDigits); + describe("Test with truthy values", () => { + const Klass = freeclimb.SendDigits; + let model: freeclimb.SendDigits = new freeclimb.SendDigits({ + digits: "test_digits", + pauseMs: 1, + privacyMode: true, + }); + describe("SendDigits class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SendDigits); + }); }); - }); - describe(".digits", () => { - it("resolves to particular value on initialization", () => { - const value = "test_digits"; - expect(model.digits).toBe(value); + describe(".digits", () => { + it("resolves to particular value on initialization", () => { + const value = "test_digits"; + expect(model.digits).toBe(value); + }); + }); + describe(".pauseMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.pauseMs).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".pauseMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.pauseMs).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.SendDigits; + let model: freeclimb.SendDigits = new freeclimb.SendDigits({ + digits: "", + pauseMs: 0, + privacyMode: false, + }); + describe("SendDigits class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SendDigits); + }); + }); + + describe(".digits", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.digits).toBe(value); + }); + }); + describe(".pauseMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.pauseMs).toBe(value); + }); + }); + describe(".privacyMode", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyMode).toBe(value); + }); }); }); - describe(".privacyMode", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyMode).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.SendDigits; + let constructorArguments = { + digits: "test_digits", + }; + let model: freeclimb.SendDigits = new freeclimb.SendDigits( + constructorArguments, + ); + + describe("#digits", () => { + it("resolves to initialization value", () => { + expect(model.digits).toBe(constructorArguments["digits"]); + }); + }); + describe("#pauseMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "pauseMs", + )?.defaultValue; + expect(model.pauseMs).toBe(value); + }); + }); + describe("#privacyMode", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyMode", + )?.defaultValue; + expect(model.privacyMode).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SetDTMFPassThrough.spec.ts b/__tests__/models/SetDTMFPassThrough.spec.ts index eab0ec4..efb6c83 100644 --- a/__tests__/models/SetDTMFPassThrough.spec.ts +++ b/__tests__/models/SetDTMFPassThrough.spec.ts @@ -2,19 +2,56 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SetDTMFPassThrough", () => { - let model: freeclimb.SetDTMFPassThrough = new freeclimb.SetDTMFPassThrough({ - dtmfPassThrough: true, + describe("Test with truthy values", () => { + const Klass = freeclimb.SetDTMFPassThrough; + let model: freeclimb.SetDTMFPassThrough = new freeclimb.SetDTMFPassThrough({ + dtmfPassThrough: true, + }); + describe("SetDTMFPassThrough class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SetDTMFPassThrough); + }); + }); + + describe(".dtmfPassThrough", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.dtmfPassThrough).toBe(value); + }); + }); }); - describe("SetDTMFPassThrough class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SetDTMFPassThrough); + describe("Test with falsy values", () => { + const Klass = freeclimb.SetDTMFPassThrough; + let model: freeclimb.SetDTMFPassThrough = new freeclimb.SetDTMFPassThrough({ + dtmfPassThrough: false, + }); + describe("SetDTMFPassThrough class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SetDTMFPassThrough); + }); + }); + + describe(".dtmfPassThrough", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.dtmfPassThrough).toBe(value); + }); }); }); + describe("Test with only required values", () => { + const Klass = freeclimb.SetDTMFPassThrough; + let constructorArguments = {}; + let model: freeclimb.SetDTMFPassThrough = new freeclimb.SetDTMFPassThrough( + constructorArguments, + ); - describe(".dtmfPassThrough", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.dtmfPassThrough).toBe(value); + describe("#dtmfPassThrough", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "dtmfPassThrough", + )?.defaultValue; + expect(model.dtmfPassThrough).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SetListen.spec.ts b/__tests__/models/SetListen.spec.ts index fd82988..34519dc 100644 --- a/__tests__/models/SetListen.spec.ts +++ b/__tests__/models/SetListen.spec.ts @@ -2,19 +2,56 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SetListen", () => { - let model: freeclimb.SetListen = new freeclimb.SetListen({ - listen: true, + describe("Test with truthy values", () => { + const Klass = freeclimb.SetListen; + let model: freeclimb.SetListen = new freeclimb.SetListen({ + listen: true, + }); + describe("SetListen class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SetListen); + }); + }); + + describe(".listen", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.listen).toBe(value); + }); + }); }); - describe("SetListen class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SetListen); + describe("Test with falsy values", () => { + const Klass = freeclimb.SetListen; + let model: freeclimb.SetListen = new freeclimb.SetListen({ + listen: false, + }); + describe("SetListen class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SetListen); + }); + }); + + describe(".listen", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.listen).toBe(value); + }); }); }); + describe("Test with only required values", () => { + const Klass = freeclimb.SetListen; + let constructorArguments = {}; + let model: freeclimb.SetListen = new freeclimb.SetListen( + constructorArguments, + ); - describe(".listen", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.listen).toBe(value); + describe("#listen", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "listen", + )?.defaultValue; + expect(model.listen).toBe(value); + }); }); }); }); diff --git a/__tests__/models/SetTalk.spec.ts b/__tests__/models/SetTalk.spec.ts index 3e6de5b..9534b2e 100644 --- a/__tests__/models/SetTalk.spec.ts +++ b/__tests__/models/SetTalk.spec.ts @@ -2,19 +2,54 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("SetTalk", () => { - let model: freeclimb.SetTalk = new freeclimb.SetTalk({ - talk: true, + describe("Test with truthy values", () => { + const Klass = freeclimb.SetTalk; + let model: freeclimb.SetTalk = new freeclimb.SetTalk({ + talk: true, + }); + describe("SetTalk class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SetTalk); + }); + }); + + describe(".talk", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.talk).toBe(value); + }); + }); }); - describe("SetTalk class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.SetTalk); + describe("Test with falsy values", () => { + const Klass = freeclimb.SetTalk; + let model: freeclimb.SetTalk = new freeclimb.SetTalk({ + talk: false, + }); + describe("SetTalk class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.SetTalk); + }); + }); + + describe(".talk", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.talk).toBe(value); + }); }); }); + describe("Test with only required values", () => { + const Klass = freeclimb.SetTalk; + let constructorArguments = {}; + let model: freeclimb.SetTalk = new freeclimb.SetTalk(constructorArguments); - describe(".talk", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.talk).toBe(value); + describe("#talk", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "talk", + )?.defaultValue; + expect(model.talk).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Sms.spec.ts b/__tests__/models/Sms.spec.ts index ae2ae9c..a5369d9 100644 --- a/__tests__/models/Sms.spec.ts +++ b/__tests__/models/Sms.spec.ts @@ -2,40 +2,115 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Sms", () => { - let model: freeclimb.Sms = new freeclimb.Sms({ - to: "test_to", - from: "test_from", - text: "test_text", - notificationUrl: "https://123.abc", - }); - describe("Sms class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Sms); + describe("Test with truthy values", () => { + const Klass = freeclimb.Sms; + let model: freeclimb.Sms = new freeclimb.Sms({ + to: "test_to", + from: "test_from", + text: "test_text", + notificationUrl: "https://123.abc", + }); + describe("Sms class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Sms); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); + }); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = "test_text"; + expect(model.text).toBe(value); + }); + }); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.notificationUrl).toBe(value); + }); }); }); - describe(".text", () => { - it("resolves to particular value on initialization", () => { - const value = "test_text"; - expect(model.text).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.Sms; + let model: freeclimb.Sms = new freeclimb.Sms({ + to: "", + from: "", + text: "", + notificationUrl: "", + }); + describe("Sms class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Sms); + }); + }); + + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".text", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.text).toBe(value); + }); + }); + describe(".notificationUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.notificationUrl).toBe(value); + }); }); }); - describe(".notificationUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.notificationUrl).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.Sms; + let constructorArguments = { + to: "test_to", + from: "test_from", + text: "test_text", + }; + let model: freeclimb.Sms = new freeclimb.Sms(constructorArguments); + + describe("#to", () => { + it("resolves to initialization value", () => { + expect(model.to).toBe(constructorArguments["to"]); + }); + }); + describe("#from", () => { + it("resolves to initialization value", () => { + expect(model.from).toBe(constructorArguments["from"]); + }); + }); + describe("#text", () => { + it("resolves to initialization value", () => { + expect(model.text).toBe(constructorArguments["text"]); + }); + }); + describe("#notificationUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "notificationUrl", + )?.defaultValue; + expect(model.notificationUrl).toBe(value); + }); }); }); }); diff --git a/__tests__/models/StartRecordCall.spec.ts b/__tests__/models/StartRecordCall.spec.ts index 9e1d270..ab4fcae 100644 --- a/__tests__/models/StartRecordCall.spec.ts +++ b/__tests__/models/StartRecordCall.spec.ts @@ -2,10 +2,29 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("StartRecordCall", () => { - let model: freeclimb.StartRecordCall = new freeclimb.StartRecordCall({}); - describe("StartRecordCall class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.StartRecordCall); + describe("Test with truthy values", () => { + const Klass = freeclimb.StartRecordCall; + let model: freeclimb.StartRecordCall = new freeclimb.StartRecordCall({}); + describe("StartRecordCall class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.StartRecordCall); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.StartRecordCall; + let model: freeclimb.StartRecordCall = new freeclimb.StartRecordCall({}); + describe("StartRecordCall class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.StartRecordCall); + }); + }); + }); + describe("Test with only required values", () => { + const Klass = freeclimb.StartRecordCall; + let constructorArguments = {}; + let model: freeclimb.StartRecordCall = new freeclimb.StartRecordCall( + constructorArguments, + ); + }); }); diff --git a/__tests__/models/TFN.spec.ts b/__tests__/models/TFN.spec.ts index 01b6760..aed18e2 100644 --- a/__tests__/models/TFN.spec.ts +++ b/__tests__/models/TFN.spec.ts @@ -2,18 +2,51 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("TFN", () => { - let model: freeclimb.TFN = new freeclimb.TFN({ - campaignId: "test_campaignId", + describe("Test with truthy values", () => { + const Klass = freeclimb.TFN; + let model: freeclimb.TFN = new freeclimb.TFN({ + campaignId: "test_campaignId", + }); + describe("TFN class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TFN); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); + }); + }); }); - describe("TFN class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.TFN); + describe("Test with falsy values", () => { + const Klass = freeclimb.TFN; + let model: freeclimb.TFN = new freeclimb.TFN({ + campaignId: "", + }); + describe("TFN class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TFN); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.campaignId).toBe(value); + }); }); }); - describe(".campaignId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_campaignId"; - expect(model.campaignId).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.TFN; + let constructorArguments = { + campaignId: "test_campaignId", + }; + let model: freeclimb.TFN = new freeclimb.TFN(constructorArguments); + + describe("#campaignId", () => { + it("resolves to initialization value", () => { + expect(model.campaignId).toBe(constructorArguments["campaignId"]); + }); }); }); }); diff --git a/__tests__/models/TFNCampaign.spec.ts b/__tests__/models/TFNCampaign.spec.ts index 7e895da..686f75b 100644 --- a/__tests__/models/TFNCampaign.spec.ts +++ b/__tests__/models/TFNCampaign.spec.ts @@ -2,77 +2,228 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("TFNCampaign", () => { - let model: freeclimb.TFNCampaign = new freeclimb.TFNCampaign({ - accountId: "test_accountId", - campaignId: "test_campaignId", + describe("Test with truthy values", () => { + const Klass = freeclimb.TFNCampaign; + let model: freeclimb.TFNCampaign = new freeclimb.TFNCampaign({ + accountId: "test_accountId", + campaignId: "test_campaignId", - useCase: "test_useCase", + useCase: "test_useCase", - registrationStatus: - freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, - dateCreated: "test_dateCreated", - dateUpdated: "test_dateUpdated", - dateCreatedISO: "test_dateCreatedISO", - dateUpdatedISO: "test_dateUpdatedISO", - revision: 1, - }); - describe("TFNCampaign class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.TFNCampaign); + registrationStatus: + freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + dateCreatedISO: "test_dateCreatedISO", + dateUpdatedISO: "test_dateUpdatedISO", + revision: 1, }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe("TFNCampaign class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TFNCampaign); + }); }); - }); - describe(".campaignId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_campaignId"; - expect(model.campaignId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".useCase", () => { - it("resolves to particular value on initialization", () => { - const value = "test_useCase"; - expect(model.useCase).toBe(value); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); + }); }); - }); - describe(".registrationStatus", () => { - it("resolves to particular value on initialization", () => { - const value = "UNREGISTERED"; - expect(model.registrationStatus).toBe(value); + describe(".useCase", () => { + it("resolves to particular value on initialization", () => { + const value = "test_useCase"; + expect(model.useCase).toBe(value); + }); }); - }); - describe(".dateCreated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreated"; - expect(model.dateCreated).toBe(value); + describe(".registrationStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "UNREGISTERED"; + expect(model.registrationStatus).toBe(value); + }); }); - }); - describe(".dateUpdated", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdated"; - expect(model.dateUpdated).toBe(value); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); }); - }); - describe(".dateCreatedISO", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateCreatedISO"; - expect(model.dateCreatedISO).toBe(value); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".dateCreatedISO", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreatedISO"; + expect(model.dateCreatedISO).toBe(value); + }); + }); + describe(".dateUpdatedISO", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdatedISO"; + expect(model.dateUpdatedISO).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); }); }); - describe(".dateUpdatedISO", () => { - it("resolves to particular value on initialization", () => { - const value = "test_dateUpdatedISO"; - expect(model.dateUpdatedISO).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.TFNCampaign; + let model: freeclimb.TFNCampaign = new freeclimb.TFNCampaign({ + accountId: "", + campaignId: "", + + useCase: "", + + registrationStatus: + freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, + dateCreated: "", + dateUpdated: "", + dateCreatedISO: "", + dateUpdatedISO: "", + revision: 0, + }); + describe("TFNCampaign class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TFNCampaign); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.campaignId).toBe(value); + }); + }); + describe(".useCase", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.useCase).toBe(value); + }); + }); + describe(".registrationStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "UNREGISTERED"; + expect(model.registrationStatus).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".dateCreatedISO", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateCreatedISO).toBe(value); + }); + }); + describe(".dateUpdatedISO", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.dateUpdatedISO).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.revision).toBe(value); + }); }); }); - describe(".revision", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.revision).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.TFNCampaign; + let constructorArguments = { + accountId: "test_accountId", + campaignId: "test_campaignId", + + useCase: "test_useCase", + + registrationStatus: + freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + dateCreatedISO: "test_dateCreatedISO", + dateUpdatedISO: "test_dateUpdatedISO", + revision: 1, + }; + let model: freeclimb.TFNCampaign = new freeclimb.TFNCampaign( + constructorArguments, + ); + + describe("#accountId", () => { + it("resolves to initialization value", () => { + expect(model.accountId).toBe(constructorArguments["accountId"]); + }); + }); + describe("#campaignId", () => { + it("resolves to initialization value", () => { + expect(model.campaignId).toBe(constructorArguments["campaignId"]); + }); + }); + describe("#useCase", () => { + it("resolves to initialization value", () => { + expect(model.useCase).toBe(constructorArguments["useCase"]); + }); + }); + describe("#registrationStatus", () => { + it("resolves to initialization value", () => { + expect(model.registrationStatus).toBe( + constructorArguments["registrationStatus"], + ); + }); + }); + describe("#dateCreated", () => { + it("resolves to initialization value", () => { + expect(model.dateCreated).toBe(constructorArguments["dateCreated"]); + }); + }); + describe("#dateUpdated", () => { + it("resolves to initialization value", () => { + expect(model.dateUpdated).toBe(constructorArguments["dateUpdated"]); + }); + }); + describe("#dateCreatedISO", () => { + it("resolves to initialization value", () => { + expect(model.dateCreatedISO).toBe( + constructorArguments["dateCreatedISO"], + ); + }); + }); + describe("#dateUpdatedISO", () => { + it("resolves to initialization value", () => { + expect(model.dateUpdatedISO).toBe( + constructorArguments["dateUpdatedISO"], + ); + }); + }); + describe("#revision", () => { + it("resolves to initialization value", () => { + expect(model.revision).toBe(constructorArguments["revision"]); + }); }); }); }); diff --git a/__tests__/models/TerminateConference.spec.ts b/__tests__/models/TerminateConference.spec.ts index e7c3f87..9bf1f7d 100644 --- a/__tests__/models/TerminateConference.spec.ts +++ b/__tests__/models/TerminateConference.spec.ts @@ -2,12 +2,30 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("TerminateConference", () => { - let model: freeclimb.TerminateConference = new freeclimb.TerminateConference( - {}, - ); - describe("TerminateConference class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.TerminateConference); + describe("Test with truthy values", () => { + const Klass = freeclimb.TerminateConference; + let model: freeclimb.TerminateConference = + new freeclimb.TerminateConference({}); + describe("TerminateConference class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TerminateConference); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.TerminateConference; + let model: freeclimb.TerminateConference = + new freeclimb.TerminateConference({}); + describe("TerminateConference class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TerminateConference); + }); + }); + }); + describe("Test with only required values", () => { + const Klass = freeclimb.TerminateConference; + let constructorArguments = {}; + let model: freeclimb.TerminateConference = + new freeclimb.TerminateConference(constructorArguments); + }); }); diff --git a/__tests__/models/TranscribeReason.spec.ts b/__tests__/models/TranscribeReason.spec.ts index 1af9d26..ac4b1b6 100644 --- a/__tests__/models/TranscribeReason.spec.ts +++ b/__tests__/models/TranscribeReason.spec.ts @@ -2,29 +2,31 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("TranscribeReason", () => { - describe(".INTERNAL_ERROR", () => { - it("resolves to correct value for INTERNAL_ERROR enum property", () => { - expect(freeclimb.TranscribeReason.INTERNAL_ERROR).toBe("internalError"); + describe("Test with truthy values", () => { + describe(".INTERNAL_ERROR", () => { + it("resolves to correct value for INTERNAL_ERROR enum property", () => { + expect(freeclimb.TranscribeReason.INTERNAL_ERROR).toBe("internalError"); + }); }); - }); - describe(".HANGUP", () => { - it("resolves to correct value for HANGUP enum property", () => { - expect(freeclimb.TranscribeReason.HANGUP).toBe("hangup"); + describe(".HANGUP", () => { + it("resolves to correct value for HANGUP enum property", () => { + expect(freeclimb.TranscribeReason.HANGUP).toBe("hangup"); + }); }); - }); - describe(".MAX_LENGTH", () => { - it("resolves to correct value for MAX_LENGTH enum property", () => { - expect(freeclimb.TranscribeReason.MAX_LENGTH).toBe("maxLength"); + describe(".MAX_LENGTH", () => { + it("resolves to correct value for MAX_LENGTH enum property", () => { + expect(freeclimb.TranscribeReason.MAX_LENGTH).toBe("maxLength"); + }); }); - }); - describe(".DIGIT", () => { - it("resolves to correct value for DIGIT enum property", () => { - expect(freeclimb.TranscribeReason.DIGIT).toBe("digit"); + describe(".DIGIT", () => { + it("resolves to correct value for DIGIT enum property", () => { + expect(freeclimb.TranscribeReason.DIGIT).toBe("digit"); + }); }); - }); - describe(".NO_INPUT", () => { - it("resolves to correct value for NO_INPUT enum property", () => { - expect(freeclimb.TranscribeReason.NO_INPUT).toBe("noInput"); + describe(".NO_INPUT", () => { + it("resolves to correct value for NO_INPUT enum property", () => { + expect(freeclimb.TranscribeReason.NO_INPUT).toBe("noInput"); + }); }); }); }); diff --git a/__tests__/models/TranscribeTermReason.spec.ts b/__tests__/models/TranscribeTermReason.spec.ts index 473ac19..6ac7996 100644 --- a/__tests__/models/TranscribeTermReason.spec.ts +++ b/__tests__/models/TranscribeTermReason.spec.ts @@ -2,14 +2,16 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("TranscribeTermReason", () => { - describe(".ERROR", () => { - it("resolves to correct value for ERROR enum property", () => { - expect(freeclimb.TranscribeTermReason.ERROR).toBe("error"); + describe("Test with truthy values", () => { + describe(".ERROR", () => { + it("resolves to correct value for ERROR enum property", () => { + expect(freeclimb.TranscribeTermReason.ERROR).toBe("error"); + }); }); - }); - describe(".COMPLETED", () => { - it("resolves to correct value for COMPLETED enum property", () => { - expect(freeclimb.TranscribeTermReason.COMPLETED).toBe("completed"); + describe(".COMPLETED", () => { + it("resolves to correct value for COMPLETED enum property", () => { + expect(freeclimb.TranscribeTermReason.COMPLETED).toBe("completed"); + }); }); }); }); diff --git a/__tests__/models/TranscribeUtterance.spec.ts b/__tests__/models/TranscribeUtterance.spec.ts index 67b7319..e2851ef 100644 --- a/__tests__/models/TranscribeUtterance.spec.ts +++ b/__tests__/models/TranscribeUtterance.spec.ts @@ -2,51 +2,160 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("TranscribeUtterance", () => { - let model: freeclimb.TranscribeUtterance = new freeclimb.TranscribeUtterance({ - actionUrl: "https://123.abc", - playBeep: true, + describe("Test with truthy values", () => { + const Klass = freeclimb.TranscribeUtterance; + let model: freeclimb.TranscribeUtterance = + new freeclimb.TranscribeUtterance({ + actionUrl: "https://123.abc", + playBeep: true, - privacyForLogging: true, - privacyForRecording: true, - prompts: [], - }); - describe("TranscribeUtterance class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.TranscribeUtterance); + privacyForLogging: true, + privacyForRecording: true, + prompts: [], + }); + describe("TranscribeUtterance class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TranscribeUtterance); + }); }); - }); - describe(".actionUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.actionUrl).toBe(value); + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.actionUrl).toBe(value); + }); }); - }); - describe(".playBeep", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.playBeep).toBe(value); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.playBeep).toBe(value); + }); }); - }); - describe(".record", () => { - it("resolves to particular value on initialization", () => {}); - }); - describe(".privacyForLogging", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyForLogging).toBe(value); + describe(".record", () => { + it("resolves to particular value on initialization", () => {}); + }); + describe(".privacyForLogging", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyForLogging).toBe(value); + }); + }); + describe(".privacyForRecording", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyForRecording).toBe(value); + }); + }); + describe(".prompts", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.PerclCommand[] = []; + expect(model.prompts).toStrictEqual(value); + }); }); }); - describe(".privacyForRecording", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyForRecording).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.TranscribeUtterance; + let model: freeclimb.TranscribeUtterance = + new freeclimb.TranscribeUtterance({ + actionUrl: "", + playBeep: false, + + privacyForLogging: false, + privacyForRecording: false, + prompts: [], + }); + describe("TranscribeUtterance class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TranscribeUtterance); + }); + }); + + describe(".actionUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.actionUrl).toBe(value); + }); + }); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.playBeep).toBe(value); + }); + }); + describe(".record", () => { + it("resolves to particular value on initialization", () => {}); + }); + describe(".privacyForLogging", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyForLogging).toBe(value); + }); + }); + describe(".privacyForRecording", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyForRecording).toBe(value); + }); + }); + describe(".prompts", () => { + it("resolves to particular value on initialization", () => { + const value: freeclimb.PerclCommand[] = []; + expect(model.prompts).toStrictEqual(value); + }); }); }); - describe(".prompts", () => { - it("resolves to particular value on initialization", () => { - const value: freeclimb.PerclCommand[] = []; - expect(model.prompts).toStrictEqual(value); + describe("Test with only required values", () => { + const Klass = freeclimb.TranscribeUtterance; + let constructorArguments = { + actionUrl: "https://123.abc", + }; + let model: freeclimb.TranscribeUtterance = + new freeclimb.TranscribeUtterance(constructorArguments); + + describe("#actionUrl", () => { + it("resolves to initialization value", () => { + expect(model.actionUrl).toBe(constructorArguments["actionUrl"]); + }); + }); + describe("#playBeep", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "playBeep", + )?.defaultValue; + expect(model.playBeep).toBe(value); + }); + }); + describe("#record", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "record", + )?.defaultValue; + expect(model.record).toBe(value); + }); + }); + describe("#privacyForLogging", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyForLogging", + )?.defaultValue; + expect(model.privacyForLogging).toBe(value); + }); + }); + describe("#privacyForRecording", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyForRecording", + )?.defaultValue; + expect(model.privacyForRecording).toBe(value); + }); + }); + describe("#prompts", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "prompts", + )?.defaultValue; + expect(model.prompts).toBe(value); + }); }); }); }); diff --git a/__tests__/models/TranscribeUtteranceRecord.spec.ts b/__tests__/models/TranscribeUtteranceRecord.spec.ts index 25061fc..3ba0b16 100644 --- a/__tests__/models/TranscribeUtteranceRecord.spec.ts +++ b/__tests__/models/TranscribeUtteranceRecord.spec.ts @@ -2,33 +2,99 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("TranscribeUtteranceRecord", () => { - let model: freeclimb.TranscribeUtteranceRecord = - new freeclimb.TranscribeUtteranceRecord({ - saveRecording: true, - maxLengthSec: 1, - rcrdTerminationSilenceTimeMs: 1, + describe("Test with truthy values", () => { + const Klass = freeclimb.TranscribeUtteranceRecord; + let model: freeclimb.TranscribeUtteranceRecord = + new freeclimb.TranscribeUtteranceRecord({ + saveRecording: true, + maxLengthSec: 1, + rcrdTerminationSilenceTimeMs: 1, + }); + describe("TranscribeUtteranceRecord class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TranscribeUtteranceRecord); + }); }); - describe("TranscribeUtteranceRecord class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.TranscribeUtteranceRecord); + describe(".saveRecording", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.saveRecording).toBe(value); + }); }); - }); - describe(".saveRecording", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.saveRecording).toBe(value); + describe(".maxLengthSec", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.maxLengthSec).toBe(value); + }); + }); + describe(".rcrdTerminationSilenceTimeMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.rcrdTerminationSilenceTimeMs).toBe(value); + }); }); }); - describe(".maxLengthSec", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.maxLengthSec).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.TranscribeUtteranceRecord; + let model: freeclimb.TranscribeUtteranceRecord = + new freeclimb.TranscribeUtteranceRecord({ + saveRecording: false, + maxLengthSec: 0, + rcrdTerminationSilenceTimeMs: 0, + }); + describe("TranscribeUtteranceRecord class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TranscribeUtteranceRecord); + }); + }); + describe(".saveRecording", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.saveRecording).toBe(value); + }); + }); + describe(".maxLengthSec", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.maxLengthSec).toBe(value); + }); + }); + describe(".rcrdTerminationSilenceTimeMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.rcrdTerminationSilenceTimeMs).toBe(value); + }); }); }); - describe(".rcrdTerminationSilenceTimeMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.rcrdTerminationSilenceTimeMs).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.TranscribeUtteranceRecord; + let constructorArguments = {}; + let model: freeclimb.TranscribeUtteranceRecord = + new freeclimb.TranscribeUtteranceRecord(constructorArguments); + + describe("#saveRecording", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "saveRecording", + )?.defaultValue; + expect(model.saveRecording).toBe(value); + }); + }); + describe("#maxLengthSec", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "maxLengthSec", + )?.defaultValue; + expect(model.maxLengthSec).toBe(value); + }); + }); + describe("#rcrdTerminationSilenceTimeMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "rcrdTerminationSilenceTimeMs", + )?.defaultValue; + expect(model.rcrdTerminationSilenceTimeMs).toBe(value); + }); }); }); }); diff --git a/__tests__/models/TranscribeWebhook.spec.ts b/__tests__/models/TranscribeWebhook.spec.ts index 46c8fc4..ddd4676 100644 --- a/__tests__/models/TranscribeWebhook.spec.ts +++ b/__tests__/models/TranscribeWebhook.spec.ts @@ -2,186 +2,566 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("TranscribeWebhook", () => { - let model: freeclimb.TranscribeWebhook = new freeclimb.TranscribeWebhook({ - requestType: "test_requestType", - accountId: "test_accountId", - callId: "test_callId", - from: "test_from", - to: "test_to", - recordingId: "test_recordingId", - recordingUrl: "https://123.abc", - recordingSize: 1, - recordingFormat: "test_recordingFormat", - recordingDurationMs: 1, + describe("Test with truthy values", () => { + const Klass = freeclimb.TranscribeWebhook; + let model: freeclimb.TranscribeWebhook = new freeclimb.TranscribeWebhook({ + requestType: "test_requestType", + accountId: "test_accountId", + callId: "test_callId", + from: "test_from", + to: "test_to", + recordingId: "test_recordingId", + recordingUrl: "https://123.abc", + recordingSize: 1, + recordingFormat: "test_recordingFormat", + recordingDurationMs: 1, - termReason: freeclimb.TranscribeTermReason.ERROR, + termReason: freeclimb.TranscribeTermReason.ERROR, - recordTermReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY, - digit: "test_digit", - privacyForLogging: true, - privacyForRecording: true, + recordTermReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY, + digit: "test_digit", + privacyForLogging: true, + privacyForRecording: true, - bargeInReason: freeclimb.BargeInReason.NO_BARGE_IN, - bargedInPromptNo: 1, - bargedInPromptMs: 1, - bargedInPromptLoopNo: 1, - bargeInTimeMs: 1, - transcript: "test_transcript", + bargeInReason: freeclimb.BargeInReason.NO_BARGE_IN, + bargedInPromptNo: 1, + bargedInPromptMs: 1, + bargedInPromptLoopNo: 1, + bargeInTimeMs: 1, + transcript: "test_transcript", - transcribeReason: freeclimb.TranscribeReason.INTERNAL_ERROR, - transcriptionDurationMs: 1, - }); - describe("TranscribeWebhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.TranscribeWebhook); + transcribeReason: freeclimb.TranscribeReason.INTERNAL_ERROR, + transcriptionDurationMs: 1, + }); + describe("TranscribeWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TranscribeWebhook); + }); }); - }); - describe(".requestType", () => { - it("resolves to particular value on initialization", () => { - const value = "test_requestType"; - expect(model.requestType).toBe(value); + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = "test_requestType"; + expect(model.requestType).toBe(value); + }); }); - }); - describe(".accountId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_accountId"; - expect(model.accountId).toBe(value); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); }); - }); - describe(".callId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_callId"; - expect(model.callId).toBe(value); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_callId"; + expect(model.callId).toBe(value); + }); }); - }); - describe(".from", () => { - it("resolves to particular value on initialization", () => { - const value = "test_from"; - expect(model.from).toBe(value); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = "test_from"; + expect(model.from).toBe(value); + }); }); - }); - describe(".to", () => { - it("resolves to particular value on initialization", () => { - const value = "test_to"; - expect(model.to).toBe(value); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = "test_to"; + expect(model.to).toBe(value); + }); }); - }); - describe(".recordingId", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingId"; - expect(model.recordingId).toBe(value); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingId"; + expect(model.recordingId).toBe(value); + }); }); - }); - describe(".recordingUrl", () => { - it("resolves to particular value on initialization", () => { - const value = "https://123.abc"; - expect(model.recordingUrl).toBe(value); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = "https://123.abc"; + expect(model.recordingUrl).toBe(value); + }); }); - }); - describe(".recordingSize", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.recordingSize).toBe(value); + describe(".recordingSize", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.recordingSize).toBe(value); + }); }); - }); - describe(".recordingFormat", () => { - it("resolves to particular value on initialization", () => { - const value = "test_recordingFormat"; - expect(model.recordingFormat).toBe(value); + describe(".recordingFormat", () => { + it("resolves to particular value on initialization", () => { + const value = "test_recordingFormat"; + expect(model.recordingFormat).toBe(value); + }); }); - }); - describe(".recordingDurationMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.recordingDurationMs).toBe(value); + describe(".recordingDurationMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.recordingDurationMs).toBe(value); + }); }); - }); - describe(".termReason", () => { - it("resolves to particular value on initialization", () => { - const value = "error"; - expect(model.termReason).toBe(value); + describe(".termReason", () => { + it("resolves to particular value on initialization", () => { + const value = "error"; + expect(model.termReason).toBe(value); + }); }); - }); - describe(".recordTermReason", () => { - it("resolves to particular value on initialization", () => { - const value = "finishKey"; - expect(model.recordTermReason).toBe(value); + describe(".recordTermReason", () => { + it("resolves to particular value on initialization", () => { + const value = "finishKey"; + expect(model.recordTermReason).toBe(value); + }); }); - }); - describe(".digit", () => { - it("resolves to particular value on initialization", () => { - const value = "test_digit"; - expect(model.digit).toBe(value); + describe(".digit", () => { + it("resolves to particular value on initialization", () => { + const value = "test_digit"; + expect(model.digit).toBe(value); + }); }); - }); - describe(".privacyForLogging", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyForLogging).toBe(value); + describe(".privacyForLogging", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyForLogging).toBe(value); + }); }); - }); - describe(".privacyForRecording", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.privacyForRecording).toBe(value); + describe(".privacyForRecording", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.privacyForRecording).toBe(value); + }); }); - }); - describe(".bargeInReason", () => { - it("resolves to particular value on initialization", () => { - const value = "noBargeIn"; - expect(model.bargeInReason).toBe(value); + describe(".bargeInReason", () => { + it("resolves to particular value on initialization", () => { + const value = "noBargeIn"; + expect(model.bargeInReason).toBe(value); + }); }); - }); - describe(".bargedInPromptNo", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.bargedInPromptNo).toBe(value); + describe(".bargedInPromptNo", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.bargedInPromptNo).toBe(value); + }); }); - }); - describe(".bargedInPromptMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.bargedInPromptMs).toBe(value); + describe(".bargedInPromptMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.bargedInPromptMs).toBe(value); + }); }); - }); - describe(".bargedInPromptLoopNo", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.bargedInPromptLoopNo).toBe(value); + describe(".bargedInPromptLoopNo", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.bargedInPromptLoopNo).toBe(value); + }); }); - }); - describe(".bargeInTimeMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.bargeInTimeMs).toBe(value); + describe(".bargeInTimeMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.bargeInTimeMs).toBe(value); + }); }); - }); - describe(".transcript", () => { - it("resolves to particular value on initialization", () => { - const value = "test_transcript"; - expect(model.transcript).toBe(value); + describe(".transcript", () => { + it("resolves to particular value on initialization", () => { + const value = "test_transcript"; + expect(model.transcript).toBe(value); + }); }); - }); - describe(".transcribeReason", () => { - it("resolves to particular value on initialization", () => { - const value = "internalError"; - expect(model.transcribeReason).toBe(value); + describe(".transcribeReason", () => { + it("resolves to particular value on initialization", () => { + const value = "internalError"; + expect(model.transcribeReason).toBe(value); + }); + }); + describe(".transcriptionDurationMs", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.transcriptionDurationMs).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of TranscribeWebhook", () => { + expect( + freeclimb.TranscribeWebhook.deserialize( + '{ "requestType": "transcribe"}', + ), + ).toBeInstanceOf(freeclimb.TranscribeWebhook); + }); }); }); - describe(".transcriptionDurationMs", () => { - it("resolves to particular value on initialization", () => { - const value = 1; - expect(model.transcriptionDurationMs).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.TranscribeWebhook; + let model: freeclimb.TranscribeWebhook = new freeclimb.TranscribeWebhook({ + requestType: "", + accountId: "", + callId: "", + from: "", + to: "", + recordingId: "", + recordingUrl: "", + recordingSize: 0, + recordingFormat: "", + recordingDurationMs: 0, + + termReason: freeclimb.TranscribeTermReason.ERROR, + + recordTermReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY, + digit: "", + privacyForLogging: false, + privacyForRecording: false, + + bargeInReason: freeclimb.BargeInReason.NO_BARGE_IN, + bargedInPromptNo: 0, + bargedInPromptMs: 0, + bargedInPromptLoopNo: 0, + bargeInTimeMs: 0, + transcript: "", + + transcribeReason: freeclimb.TranscribeReason.INTERNAL_ERROR, + transcriptionDurationMs: 0, + }); + describe("TranscribeWebhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TranscribeWebhook); + }); + }); + + describe(".requestType", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.requestType).toBe(value); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.accountId).toBe(value); + }); + }); + describe(".callId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.callId).toBe(value); + }); + }); + describe(".from", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.from).toBe(value); + }); + }); + describe(".to", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.to).toBe(value); + }); + }); + describe(".recordingId", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingId).toBe(value); + }); + }); + describe(".recordingUrl", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingUrl).toBe(value); + }); + }); + describe(".recordingSize", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.recordingSize).toBe(value); + }); + }); + describe(".recordingFormat", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.recordingFormat).toBe(value); + }); + }); + describe(".recordingDurationMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.recordingDurationMs).toBe(value); + }); + }); + describe(".termReason", () => { + it("resolves to particular value on initialization", () => { + const value = "error"; + expect(model.termReason).toBe(value); + }); + }); + describe(".recordTermReason", () => { + it("resolves to particular value on initialization", () => { + const value = "finishKey"; + expect(model.recordTermReason).toBe(value); + }); + }); + describe(".digit", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.digit).toBe(value); + }); + }); + describe(".privacyForLogging", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyForLogging).toBe(value); + }); + }); + describe(".privacyForRecording", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.privacyForRecording).toBe(value); + }); + }); + describe(".bargeInReason", () => { + it("resolves to particular value on initialization", () => { + const value = "noBargeIn"; + expect(model.bargeInReason).toBe(value); + }); + }); + describe(".bargedInPromptNo", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.bargedInPromptNo).toBe(value); + }); + }); + describe(".bargedInPromptMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.bargedInPromptMs).toBe(value); + }); + }); + describe(".bargedInPromptLoopNo", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.bargedInPromptLoopNo).toBe(value); + }); + }); + describe(".bargeInTimeMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.bargeInTimeMs).toBe(value); + }); + }); + describe(".transcript", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.transcript).toBe(value); + }); + }); + describe(".transcribeReason", () => { + it("resolves to particular value on initialization", () => { + const value = "internalError"; + expect(model.transcribeReason).toBe(value); + }); + }); + describe(".transcriptionDurationMs", () => { + it("resolves to particular value on initialization", () => { + const value = 0; + expect(model.transcriptionDurationMs).toBe(value); + }); + }); + describe(".deserialize", () => { + it("returns an instance of TranscribeWebhook", () => { + expect( + freeclimb.TranscribeWebhook.deserialize( + '{ "requestType": "transcribe"}', + ), + ).toBeInstanceOf(freeclimb.TranscribeWebhook); + }); }); }); - describe(".deserialize", () => { - it("returns an instance of TranscribeWebhook", () => { - expect( - freeclimb.TranscribeWebhook.deserialize( - '{ "requestType": "transcribe"}', - ), - ).toBeInstanceOf(freeclimb.TranscribeWebhook); + describe("Test with only required values", () => { + const Klass = freeclimb.TranscribeWebhook; + let constructorArguments = {}; + let model: freeclimb.TranscribeWebhook = new freeclimb.TranscribeWebhook( + constructorArguments, + ); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); + }); + describe("#accountId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "accountId", + )?.defaultValue; + expect(model.accountId).toBe(value); + }); + }); + describe("#callId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "callId", + )?.defaultValue; + expect(model.callId).toBe(value); + }); + }); + describe("#from", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "from", + )?.defaultValue; + expect(model.from).toBe(value); + }); + }); + describe("#to", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "to", + )?.defaultValue; + expect(model.to).toBe(value); + }); + }); + describe("#recordingId", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingId", + )?.defaultValue; + expect(model.recordingId).toBe(value); + }); + }); + describe("#recordingUrl", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingUrl", + )?.defaultValue; + expect(model.recordingUrl).toBe(value); + }); + }); + describe("#recordingSize", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingSize", + )?.defaultValue; + expect(model.recordingSize).toBe(value); + }); + }); + describe("#recordingFormat", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingFormat", + )?.defaultValue; + expect(model.recordingFormat).toBe(value); + }); + }); + describe("#recordingDurationMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordingDurationMs", + )?.defaultValue; + expect(model.recordingDurationMs).toBe(value); + }); + }); + describe("#termReason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "termReason", + )?.defaultValue; + expect(model.termReason).toBe(value); + }); + }); + describe("#recordTermReason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "recordTermReason", + )?.defaultValue; + expect(model.recordTermReason).toBe(value); + }); + }); + describe("#digit", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "digit", + )?.defaultValue; + expect(model.digit).toBe(value); + }); + }); + describe("#privacyForLogging", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyForLogging", + )?.defaultValue; + expect(model.privacyForLogging).toBe(value); + }); + }); + describe("#privacyForRecording", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "privacyForRecording", + )?.defaultValue; + expect(model.privacyForRecording).toBe(value); + }); + }); + describe("#bargeInReason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "bargeInReason", + )?.defaultValue; + expect(model.bargeInReason).toBe(value); + }); + }); + describe("#bargedInPromptNo", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "bargedInPromptNo", + )?.defaultValue; + expect(model.bargedInPromptNo).toBe(value); + }); + }); + describe("#bargedInPromptMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "bargedInPromptMs", + )?.defaultValue; + expect(model.bargedInPromptMs).toBe(value); + }); + }); + describe("#bargedInPromptLoopNo", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "bargedInPromptLoopNo", + )?.defaultValue; + expect(model.bargedInPromptLoopNo).toBe(value); + }); + }); + describe("#bargeInTimeMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "bargeInTimeMs", + )?.defaultValue; + expect(model.bargeInTimeMs).toBe(value); + }); + }); + describe("#transcript", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "transcript", + )?.defaultValue; + expect(model.transcript).toBe(value); + }); + }); + describe("#transcribeReason", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "transcribeReason", + )?.defaultValue; + expect(model.transcribeReason).toBe(value); + }); + }); + describe("#transcriptionDurationMs", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "transcriptionDurationMs", + )?.defaultValue; + expect(model.transcriptionDurationMs).toBe(value); + }); }); }); }); diff --git a/__tests__/models/Unpark.spec.ts b/__tests__/models/Unpark.spec.ts index 2b2fb1a..8e8fc82 100644 --- a/__tests__/models/Unpark.spec.ts +++ b/__tests__/models/Unpark.spec.ts @@ -2,10 +2,27 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Unpark", () => { - let model: freeclimb.Unpark = new freeclimb.Unpark({}); - describe("Unpark class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Unpark); + describe("Test with truthy values", () => { + const Klass = freeclimb.Unpark; + let model: freeclimb.Unpark = new freeclimb.Unpark({}); + describe("Unpark class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Unpark); + }); }); }); + describe("Test with falsy values", () => { + const Klass = freeclimb.Unpark; + let model: freeclimb.Unpark = new freeclimb.Unpark({}); + describe("Unpark class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Unpark); + }); + }); + }); + describe("Test with only required values", () => { + const Klass = freeclimb.Unpark; + let constructorArguments = {}; + let model: freeclimb.Unpark = new freeclimb.Unpark(constructorArguments); + }); }); diff --git a/__tests__/models/UpdateCallRequest.spec.ts b/__tests__/models/UpdateCallRequest.spec.ts index 68466e1..0cd72d1 100644 --- a/__tests__/models/UpdateCallRequest.spec.ts +++ b/__tests__/models/UpdateCallRequest.spec.ts @@ -2,18 +2,53 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("UpdateCallRequest", () => { - let model: freeclimb.UpdateCallRequest = new freeclimb.UpdateCallRequest({ - status: freeclimb.UpdateCallRequestStatus.CANCELED, + describe("Test with truthy values", () => { + const Klass = freeclimb.UpdateCallRequest; + let model: freeclimb.UpdateCallRequest = new freeclimb.UpdateCallRequest({ + status: freeclimb.UpdateCallRequestStatus.CANCELED, + }); + describe("UpdateCallRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.UpdateCallRequest); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "canceled"; + expect(model.status).toBe(value); + }); + }); }); - describe("UpdateCallRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.UpdateCallRequest); + describe("Test with falsy values", () => { + const Klass = freeclimb.UpdateCallRequest; + let model: freeclimb.UpdateCallRequest = new freeclimb.UpdateCallRequest({ + status: freeclimb.UpdateCallRequestStatus.CANCELED, + }); + describe("UpdateCallRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.UpdateCallRequest); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "canceled"; + expect(model.status).toBe(value); + }); }); }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "canceled"; - expect(model.status).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.UpdateCallRequest; + let constructorArguments = { + status: freeclimb.UpdateCallRequestStatus.CANCELED, + }; + let model: freeclimb.UpdateCallRequest = new freeclimb.UpdateCallRequest( + constructorArguments, + ); + + describe("#status", () => { + it("resolves to initialization value", () => { + expect(model.status).toBe(constructorArguments["status"]); + }); }); }); }); diff --git a/__tests__/models/UpdateCallRequestStatus.spec.ts b/__tests__/models/UpdateCallRequestStatus.spec.ts index e9999d2..c35826b 100644 --- a/__tests__/models/UpdateCallRequestStatus.spec.ts +++ b/__tests__/models/UpdateCallRequestStatus.spec.ts @@ -2,14 +2,16 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("UpdateCallRequestStatus", () => { - describe(".CANCELED", () => { - it("resolves to correct value for CANCELED enum property", () => { - expect(freeclimb.UpdateCallRequestStatus.CANCELED).toBe("canceled"); + describe("Test with truthy values", () => { + describe(".CANCELED", () => { + it("resolves to correct value for CANCELED enum property", () => { + expect(freeclimb.UpdateCallRequestStatus.CANCELED).toBe("canceled"); + }); }); - }); - describe(".COMPLETED", () => { - it("resolves to correct value for COMPLETED enum property", () => { - expect(freeclimb.UpdateCallRequestStatus.COMPLETED).toBe("completed"); + describe(".COMPLETED", () => { + it("resolves to correct value for COMPLETED enum property", () => { + expect(freeclimb.UpdateCallRequestStatus.COMPLETED).toBe("completed"); + }); }); }); }); diff --git a/__tests__/models/UpdateConferenceParticipantRequest.spec.ts b/__tests__/models/UpdateConferenceParticipantRequest.spec.ts index c5ad952..ab17a98 100644 --- a/__tests__/models/UpdateConferenceParticipantRequest.spec.ts +++ b/__tests__/models/UpdateConferenceParticipantRequest.spec.ts @@ -2,35 +2,103 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("UpdateConferenceParticipantRequest", () => { - let model: freeclimb.UpdateConferenceParticipantRequest = - new freeclimb.UpdateConferenceParticipantRequest({ - talk: true, - listen: true, - dtmfPassThrough: true, - }); - describe("UpdateConferenceParticipantRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf( - freeclimb.UpdateConferenceParticipantRequest, - ); + describe("Test with truthy values", () => { + const Klass = freeclimb.UpdateConferenceParticipantRequest; + let model: freeclimb.UpdateConferenceParticipantRequest = + new freeclimb.UpdateConferenceParticipantRequest({ + talk: true, + listen: true, + dtmfPassThrough: true, + }); + describe("UpdateConferenceParticipantRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.UpdateConferenceParticipantRequest, + ); + }); }); - }); - describe(".talk", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.talk).toBe(value); + describe(".talk", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.talk).toBe(value); + }); + }); + describe(".listen", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.listen).toBe(value); + }); + }); + describe(".dtmfPassThrough", () => { + it("resolves to particular value on initialization", () => { + const value = true; + expect(model.dtmfPassThrough).toBe(value); + }); }); }); - describe(".listen", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.listen).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.UpdateConferenceParticipantRequest; + let model: freeclimb.UpdateConferenceParticipantRequest = + new freeclimb.UpdateConferenceParticipantRequest({ + talk: false, + listen: false, + dtmfPassThrough: false, + }); + describe("UpdateConferenceParticipantRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf( + freeclimb.UpdateConferenceParticipantRequest, + ); + }); + }); + describe(".talk", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.talk).toBe(value); + }); + }); + describe(".listen", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.listen).toBe(value); + }); + }); + describe(".dtmfPassThrough", () => { + it("resolves to particular value on initialization", () => { + const value = false; + expect(model.dtmfPassThrough).toBe(value); + }); }); }); - describe(".dtmfPassThrough", () => { - it("resolves to particular value on initialization", () => { - const value = true; - expect(model.dtmfPassThrough).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.UpdateConferenceParticipantRequest; + let constructorArguments = {}; + let model: freeclimb.UpdateConferenceParticipantRequest = + new freeclimb.UpdateConferenceParticipantRequest(constructorArguments); + + describe("#talk", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "talk", + )?.defaultValue; + expect(model.talk).toBe(value); + }); + }); + describe("#listen", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "listen", + )?.defaultValue; + expect(model.listen).toBe(value); + }); + }); + describe("#dtmfPassThrough", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "dtmfPassThrough", + )?.defaultValue; + expect(model.dtmfPassThrough).toBe(value); + }); }); }); }); diff --git a/__tests__/models/UpdateConferenceRequest.spec.ts b/__tests__/models/UpdateConferenceRequest.spec.ts index cac88a5..022c965 100644 --- a/__tests__/models/UpdateConferenceRequest.spec.ts +++ b/__tests__/models/UpdateConferenceRequest.spec.ts @@ -2,35 +2,103 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("UpdateConferenceRequest", () => { - let model: freeclimb.UpdateConferenceRequest = - new freeclimb.UpdateConferenceRequest({ - alias: "test_alias", + describe("Test with truthy values", () => { + const Klass = freeclimb.UpdateConferenceRequest; + let model: freeclimb.UpdateConferenceRequest = + new freeclimb.UpdateConferenceRequest({ + alias: "test_alias", - playBeep: freeclimb.PlayBeep.ALWAYS, + playBeep: freeclimb.PlayBeep.ALWAYS, - status: freeclimb.UpdateConferenceRequestStatus.EMPTY, + status: freeclimb.UpdateConferenceRequestStatus.EMPTY, + }); + describe("UpdateConferenceRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.UpdateConferenceRequest); + }); }); - describe("UpdateConferenceRequest class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.UpdateConferenceRequest); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = "test_alias"; + expect(model.alias).toBe(value); + }); }); - }); - describe(".alias", () => { - it("resolves to particular value on initialization", () => { - const value = "test_alias"; - expect(model.alias).toBe(value); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = "always"; + expect(model.playBeep).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); }); }); - describe(".playBeep", () => { - it("resolves to particular value on initialization", () => { - const value = "always"; - expect(model.playBeep).toBe(value); + describe("Test with falsy values", () => { + const Klass = freeclimb.UpdateConferenceRequest; + let model: freeclimb.UpdateConferenceRequest = + new freeclimb.UpdateConferenceRequest({ + alias: "", + + playBeep: freeclimb.PlayBeep.ALWAYS, + + status: freeclimb.UpdateConferenceRequestStatus.EMPTY, + }); + describe("UpdateConferenceRequest class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.UpdateConferenceRequest); + }); + }); + describe(".alias", () => { + it("resolves to particular value on initialization", () => { + const value = ""; + expect(model.alias).toBe(value); + }); + }); + describe(".playBeep", () => { + it("resolves to particular value on initialization", () => { + const value = "always"; + expect(model.playBeep).toBe(value); + }); + }); + describe(".status", () => { + it("resolves to particular value on initialization", () => { + const value = "empty"; + expect(model.status).toBe(value); + }); }); }); - describe(".status", () => { - it("resolves to particular value on initialization", () => { - const value = "empty"; - expect(model.status).toBe(value); + describe("Test with only required values", () => { + const Klass = freeclimb.UpdateConferenceRequest; + let constructorArguments = {}; + let model: freeclimb.UpdateConferenceRequest = + new freeclimb.UpdateConferenceRequest(constructorArguments); + + describe("#alias", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "alias", + )?.defaultValue; + expect(model.alias).toBe(value); + }); + }); + describe("#playBeep", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "playBeep", + )?.defaultValue; + expect(model.playBeep).toBe(value); + }); + }); + describe("#status", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "status", + )?.defaultValue; + expect(model.status).toBe(value); + }); }); }); }); diff --git a/__tests__/models/UpdateConferenceRequestStatus.spec.ts b/__tests__/models/UpdateConferenceRequestStatus.spec.ts index 6550d98..cec9879 100644 --- a/__tests__/models/UpdateConferenceRequestStatus.spec.ts +++ b/__tests__/models/UpdateConferenceRequestStatus.spec.ts @@ -2,16 +2,18 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("UpdateConferenceRequestStatus", () => { - describe(".EMPTY", () => { - it("resolves to correct value for EMPTY enum property", () => { - expect(freeclimb.UpdateConferenceRequestStatus.EMPTY).toBe("empty"); + describe("Test with truthy values", () => { + describe(".EMPTY", () => { + it("resolves to correct value for EMPTY enum property", () => { + expect(freeclimb.UpdateConferenceRequestStatus.EMPTY).toBe("empty"); + }); }); - }); - describe(".TERMINATED", () => { - it("resolves to correct value for TERMINATED enum property", () => { - expect(freeclimb.UpdateConferenceRequestStatus.TERMINATED).toBe( - "terminated", - ); + describe(".TERMINATED", () => { + it("resolves to correct value for TERMINATED enum property", () => { + expect(freeclimb.UpdateConferenceRequestStatus.TERMINATED).toBe( + "terminated", + ); + }); }); }); }); diff --git a/__tests__/models/Webhook.spec.ts b/__tests__/models/Webhook.spec.ts index 1f2837d..007e352 100644 --- a/__tests__/models/Webhook.spec.ts +++ b/__tests__/models/Webhook.spec.ts @@ -2,10 +2,36 @@ import * as freeclimb from "../../index"; import { describe, expect, it } from "@jest/globals"; describe("Webhook", () => { - let model: freeclimb.Webhook = new freeclimb.Webhook({}); - describe("Webhook class test", () => { - it("resolves to the class type upon initialization", () => { - expect(model).toBeInstanceOf(freeclimb.Webhook); + describe("Test with truthy values", () => { + const Klass = freeclimb.Webhook; + let model: freeclimb.Webhook = new freeclimb.Webhook({}); + describe("Webhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Webhook); + }); + }); + }); + describe("Test with falsy values", () => { + const Klass = freeclimb.Webhook; + let model: freeclimb.Webhook = new freeclimb.Webhook({}); + describe("Webhook class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.Webhook); + }); + }); + }); + describe("Test with only required values", () => { + const Klass = freeclimb.Webhook; + let constructorArguments = {}; + let model: freeclimb.Webhook = new freeclimb.Webhook(constructorArguments); + + describe("#requestType", () => { + it("resolves to default value on initialization if no value is provided", () => { + const value = Klass.attributeTypeMap.find( + (attribute) => attribute.name === "requestType", + )?.defaultValue; + expect(model.requestType).toBe(value); + }); }); }); }); diff --git a/models/AccountRequest.ts b/models/AccountRequest.ts index 86ee221..da815b3 100644 --- a/models/AccountRequest.ts +++ b/models/AccountRequest.ts @@ -59,15 +59,15 @@ export class AccountRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - AccountRequest.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : AccountRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["label"]) { - this["label"] = assign("label"); - } + this["alias"] = assign("alias"); + this["label"] = assign("label"); } } diff --git a/models/AccountResult.ts b/models/AccountResult.ts index 0259daf..5f0c39b 100644 --- a/models/AccountResult.ts +++ b/models/AccountResult.ts @@ -172,42 +172,24 @@ export class AccountResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - AccountResult.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : AccountResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["apiKey"]) { - this["apiKey"] = assign("apiKey"); - } - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["label"]) { - this["label"] = assign("label"); - } - if (args["type"]) { - this["type"] = assign("type"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["subresourceUris"]) { - this["subresourceUris"] = assign("subresourceUris"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["accountId"] = assign("accountId"); + this["apiKey"] = assign("apiKey"); + this["alias"] = assign("alias"); + this["label"] = assign("label"); + this["type"] = assign("type"); + this["status"] = assign("status"); + this["subresourceUris"] = assign("subresourceUris"); } } diff --git a/models/AddToConference.ts b/models/AddToConference.ts index 5a4c7cf..ed2d05e 100644 --- a/models/AddToConference.ts +++ b/models/AddToConference.ts @@ -169,39 +169,23 @@ export class AddToConference extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "AddToConference" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - AddToConference.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : AddToConference.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["allowCallControl"]) { - this["allowCallControl"] = assign("allowCallControl"); - } - if (args["callControlSequence"]) { - this["callControlSequence"] = assign("callControlSequence"); - } - if (args["callControlUrl"]) { - this["callControlUrl"] = assign("callControlUrl"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["leaveConferenceUrl"]) { - this["leaveConferenceUrl"] = assign("leaveConferenceUrl"); - } - if (args["listen"]) { - this["listen"] = assign("listen"); - } - if (args["notificationUrl"]) { - this["notificationUrl"] = assign("notificationUrl"); - } - if (args["startConfOnEnter"]) { - this["startConfOnEnter"] = assign("startConfOnEnter"); - } - if (args["talk"]) { - this["talk"] = assign("talk"); - } - if (args["dtmfPassThrough"]) { - this["dtmfPassThrough"] = assign("dtmfPassThrough"); - } + this["allowCallControl"] = assign("allowCallControl"); + this["callControlSequence"] = assign("callControlSequence"); + this["callControlUrl"] = assign("callControlUrl"); + this["conferenceId"] = assign("conferenceId"); + this["leaveConferenceUrl"] = assign("leaveConferenceUrl"); + this["listen"] = assign("listen"); + this["notificationUrl"] = assign("notificationUrl"); + this["startConfOnEnter"] = assign("startConfOnEnter"); + this["talk"] = assign("talk"); + this["dtmfPassThrough"] = assign("dtmfPassThrough"); } } diff --git a/models/AddToConferenceNotificationWebhook.ts b/models/AddToConferenceNotificationWebhook.ts index cdcdc93..1623a3c 100644 --- a/models/AddToConferenceNotificationWebhook.ts +++ b/models/AddToConferenceNotificationWebhook.ts @@ -204,50 +204,27 @@ export class AddToConferenceNotificationWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "addToConferenceNotification" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - AddToConferenceNotificationWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : AddToConferenceNotificationWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["recordingUrl"]) { - this["recordingUrl"] = assign("recordingUrl"); - } - if (args["recordingId"]) { - this["recordingId"] = assign("recordingId"); - } - if (args["recordingDurationSec"]) { - this["recordingDurationSec"] = assign("recordingDurationSec"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["status"] = assign("status"); + this["recordingUrl"] = assign("recordingUrl"); + this["recordingId"] = assign("recordingId"); + this["recordingDurationSec"] = assign("recordingDurationSec"); } public static deserialize( payload: string, diff --git a/models/AddToQueueNotificationWebhook.ts b/models/AddToQueueNotificationWebhook.ts index 34c0143..03d1c51 100644 --- a/models/AddToQueueNotificationWebhook.ts +++ b/models/AddToQueueNotificationWebhook.ts @@ -154,38 +154,23 @@ export class AddToQueueNotificationWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "addToQueueNotification" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - AddToQueueNotificationWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : AddToQueueNotificationWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); } public static deserialize(payload: string): AddToQueueNotificationWebhook { return new AddToQueueNotificationWebhook(JSON.parse(payload)); diff --git a/models/ApplicationList.ts b/models/ApplicationList.ts index 8625202..4f18cba 100644 --- a/models/ApplicationList.ts +++ b/models/ApplicationList.ts @@ -135,33 +135,21 @@ export class ApplicationList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - ApplicationList.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : ApplicationList.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["applications"]) { - this["applications"] = assign>("applications"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["applications"] = assign>("applications"); } } diff --git a/models/ApplicationRequest.ts b/models/ApplicationRequest.ts index f045944..b355b3a 100644 --- a/models/ApplicationRequest.ts +++ b/models/ApplicationRequest.ts @@ -124,31 +124,20 @@ export class ApplicationRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - ApplicationRequest.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : ApplicationRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["voiceUrl"]) { - this["voiceUrl"] = assign("voiceUrl"); - } - if (args["voiceFallbackUrl"]) { - this["voiceFallbackUrl"] = assign("voiceFallbackUrl"); - } - if (args["callConnectUrl"]) { - this["callConnectUrl"] = assign("callConnectUrl"); - } - if (args["statusCallbackUrl"]) { - this["statusCallbackUrl"] = assign("statusCallbackUrl"); - } - if (args["smsUrl"]) { - this["smsUrl"] = assign("smsUrl"); - } - if (args["smsFallbackUrl"]) { - this["smsFallbackUrl"] = assign("smsFallbackUrl"); - } + this["alias"] = assign("alias"); + this["voiceUrl"] = assign("voiceUrl"); + this["voiceFallbackUrl"] = assign("voiceFallbackUrl"); + this["callConnectUrl"] = assign("callConnectUrl"); + this["statusCallbackUrl"] = assign("statusCallbackUrl"); + this["smsUrl"] = assign("smsUrl"); + this["smsFallbackUrl"] = assign("smsFallbackUrl"); } } diff --git a/models/ApplicationResult.ts b/models/ApplicationResult.ts index 04d367e..76fff1e 100644 --- a/models/ApplicationResult.ts +++ b/models/ApplicationResult.ts @@ -202,49 +202,26 @@ export class ApplicationResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - ApplicationResult.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : ApplicationResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["applicationId"]) { - this["applicationId"] = assign("applicationId"); - } - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["voiceUrl"]) { - this["voiceUrl"] = assign("voiceUrl"); - } - if (args["voiceFallbackUrl"]) { - this["voiceFallbackUrl"] = assign("voiceFallbackUrl"); - } - if (args["callConnectUrl"]) { - this["callConnectUrl"] = assign("callConnectUrl"); - } - if (args["statusCallbackUrl"]) { - this["statusCallbackUrl"] = assign("statusCallbackUrl"); - } - if (args["smsUrl"]) { - this["smsUrl"] = assign("smsUrl"); - } - if (args["smsFallbackUrl"]) { - this["smsFallbackUrl"] = assign("smsFallbackUrl"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["accountId"] = assign("accountId"); + this["applicationId"] = assign("applicationId"); + this["alias"] = assign("alias"); + this["voiceUrl"] = assign("voiceUrl"); + this["voiceFallbackUrl"] = assign("voiceFallbackUrl"); + this["callConnectUrl"] = assign("callConnectUrl"); + this["statusCallbackUrl"] = assign("statusCallbackUrl"); + this["smsUrl"] = assign("smsUrl"); + this["smsFallbackUrl"] = assign("smsFallbackUrl"); } } diff --git a/models/AvailableNumber.ts b/models/AvailableNumber.ts index 612efba..6c4e89f 100644 --- a/models/AvailableNumber.ts +++ b/models/AvailableNumber.ts @@ -122,30 +122,20 @@ export class AvailableNumber { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - AvailableNumber.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : AvailableNumber.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["capabilities"]) { - this["capabilities"] = assign("capabilities"); - } - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } - if (args["phoneNumber"]) { - this["phoneNumber"] = assign("phoneNumber"); - } - if (args["voiceEnabled"]) { - this["voiceEnabled"] = assign("voiceEnabled"); - } - if (args["smsEnabled"]) { - this["smsEnabled"] = assign("smsEnabled"); - } - if (args["region"]) { - this["region"] = assign("region"); - } - if (args["country"]) { - this["country"] = assign("country"); - } + this["capabilities"] = assign("capabilities"); + this["campaignId"] = assign("campaignId"); + this["phoneNumber"] = assign("phoneNumber"); + this["voiceEnabled"] = assign("voiceEnabled"); + this["smsEnabled"] = assign("smsEnabled"); + this["region"] = assign("region"); + this["country"] = assign("country"); } } diff --git a/models/AvailableNumberList.ts b/models/AvailableNumberList.ts index ff7a942..31a5558 100644 --- a/models/AvailableNumberList.ts +++ b/models/AvailableNumberList.ts @@ -135,36 +135,23 @@ export class AvailableNumberList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - AvailableNumberList.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : AvailableNumberList.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["availablePhoneNumbers"]) { - this["availablePhoneNumbers"] = assign>( - "availablePhoneNumbers", - ); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["availablePhoneNumbers"] = assign>( + "availablePhoneNumbers", + ); } } diff --git a/models/BuyIncomingNumberRequest.ts b/models/BuyIncomingNumberRequest.ts index 88b0632..85e1544 100644 --- a/models/BuyIncomingNumberRequest.ts +++ b/models/BuyIncomingNumberRequest.ts @@ -72,19 +72,16 @@ export class BuyIncomingNumberRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - BuyIncomingNumberRequest.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : BuyIncomingNumberRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["phoneNumber"]) { - this["phoneNumber"] = assign("phoneNumber"); - } - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["applicationId"]) { - this["applicationId"] = assign("applicationId"); - } + this["phoneNumber"] = assign("phoneNumber"); + this["alias"] = assign("alias"); + this["applicationId"] = assign("applicationId"); } } diff --git a/models/CallControlWebhook.ts b/models/CallControlWebhook.ts index 4769794..92941ac 100644 --- a/models/CallControlWebhook.ts +++ b/models/CallControlWebhook.ts @@ -106,26 +106,19 @@ export class CallControlWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "callControl" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CallControlWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CallControlWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["digits"]) { - this["digits"] = assign("digits"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["conferenceId"] = assign("conferenceId"); + this["digits"] = assign("digits"); } public static deserialize(payload: string): CallControlWebhook { return new CallControlWebhook(JSON.parse(payload)); diff --git a/models/CallList.ts b/models/CallList.ts index e42f8ea..b211c8a 100644 --- a/models/CallList.ts +++ b/models/CallList.ts @@ -135,33 +135,20 @@ export class CallList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CallList.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CallList.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["calls"]) { - this["calls"] = assign>("calls"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["calls"] = assign>("calls"); } } diff --git a/models/CallResult.ts b/models/CallResult.ts index f9ab984..1797718 100644 --- a/models/CallResult.ts +++ b/models/CallResult.ts @@ -287,69 +287,32 @@ export class CallResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CallResult.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CallResult.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["phoneNumberId"]) { - this["phoneNumberId"] = assign("phoneNumberId"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["startTime"]) { - this["startTime"] = assign("startTime"); - } - if (args["connectTime"]) { - this["connectTime"] = assign("connectTime"); - } - if (args["endTime"]) { - this["endTime"] = assign("endTime"); - } - if (args["duration"]) { - this["duration"] = assign("duration"); - } - if (args["connectDuration"]) { - this["connectDuration"] = assign("connectDuration"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["answeredBy"]) { - this["answeredBy"] = assign("answeredBy"); - } - if (args["subresourceUris"]) { - this["subresourceUris"] = assign("subresourceUris"); - } - if (args["applicationId"]) { - this["applicationId"] = assign("applicationId"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["callId"] = assign("callId"); + this["parentCallId"] = assign("parentCallId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["phoneNumberId"] = assign("phoneNumberId"); + this["callStatus"] = assign("callStatus"); + this["startTime"] = assign("startTime"); + this["connectTime"] = assign("connectTime"); + this["endTime"] = assign("endTime"); + this["duration"] = assign("duration"); + this["connectDuration"] = assign("connectDuration"); + this["direction"] = assign("direction"); + this["answeredBy"] = assign("answeredBy"); + this["subresourceUris"] = assign("subresourceUris"); + this["applicationId"] = assign("applicationId"); } } diff --git a/models/CallStatusWebhook.ts b/models/CallStatusWebhook.ts index 53022fb..52066e2 100644 --- a/models/CallStatusWebhook.ts +++ b/models/CallStatusWebhook.ts @@ -165,41 +165,24 @@ export class CallStatusWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "callStatus" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CallStatusWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CallStatusWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["callEndedReason"]) { - this["callEndedReason"] = assign("callEndedReason"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["callEndedReason"] = assign("callEndedReason"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); } public static deserialize(payload: string): CallStatusWebhook { return new CallStatusWebhook(JSON.parse(payload)); diff --git a/models/Capabilities.ts b/models/Capabilities.ts index 6e47ce1..e0f45d2 100644 --- a/models/Capabilities.ts +++ b/models/Capabilities.ts @@ -102,24 +102,18 @@ export class Capabilities { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Capabilities.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Capabilities.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["voice"]) { - this["voice"] = assign("voice"); - } - if (args["sms"]) { - this["sms"] = assign("sms"); - } - if (args["tollFree"]) { - this["tollFree"] = assign("tollFree"); - } - if (args["tenDLC"]) { - this["tenDLC"] = assign("tenDLC"); - } - if (args["shortCode"]) { - this["shortCode"] = assign("shortCode"); - } + this["voice"] = assign("voice"); + this["sms"] = assign("sms"); + this["tollFree"] = assign("tollFree"); + this["tenDLC"] = assign("tenDLC"); + this["shortCode"] = assign("shortCode"); } } diff --git a/models/CompletionRequest.ts b/models/CompletionRequest.ts index ea32a5b..befa9ad 100644 --- a/models/CompletionRequest.ts +++ b/models/CompletionRequest.ts @@ -46,13 +46,14 @@ export class CompletionRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CompletionRequest.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CompletionRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["query"]) { - this["query"] = assign("query"); - } + this["query"] = assign("query"); } } diff --git a/models/CompletionResult.ts b/models/CompletionResult.ts index d5f4163..e935217 100644 --- a/models/CompletionResult.ts +++ b/models/CompletionResult.ts @@ -57,16 +57,15 @@ export class CompletionResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CompletionResult.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CompletionResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["response"]) { - this["response"] = assign("response"); - } - if (args["status"]) { - this["status"] = assign("status"); - } + this["response"] = assign("response"); + this["status"] = assign("status"); } } diff --git a/models/ConferenceList.ts b/models/ConferenceList.ts index ee7cf24..b98824b 100644 --- a/models/ConferenceList.ts +++ b/models/ConferenceList.ts @@ -135,33 +135,21 @@ export class ConferenceList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - ConferenceList.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : ConferenceList.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["conferences"]) { - this["conferences"] = assign>("conferences"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["conferences"] = assign>("conferences"); } } diff --git a/models/ConferenceParticipantList.ts b/models/ConferenceParticipantList.ts index 0bf9948..2ea9916 100644 --- a/models/ConferenceParticipantList.ts +++ b/models/ConferenceParticipantList.ts @@ -135,35 +135,22 @@ export class ConferenceParticipantList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - ConferenceParticipantList.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : ConferenceParticipantList.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["participants"]) { - this["participants"] = - assign>("participants"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["participants"] = + assign>("participants"); } } diff --git a/models/ConferenceParticipantResult.ts b/models/ConferenceParticipantResult.ts index d815bf4..84d5fc7 100644 --- a/models/ConferenceParticipantResult.ts +++ b/models/ConferenceParticipantResult.ts @@ -176,43 +176,24 @@ export class ConferenceParticipantResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - ConferenceParticipantResult.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : ConferenceParticipantResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["talk"]) { - this["talk"] = assign("talk"); - } - if (args["listen"]) { - this["listen"] = assign("listen"); - } - if (args["dtmfPassThrough"]) { - this["dtmfPassThrough"] = assign("dtmfPassThrough"); - } - if (args["startConfOnEnter"]) { - this["startConfOnEnter"] = assign("startConfOnEnter"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["accountId"] = assign("accountId"); + this["conferenceId"] = assign("conferenceId"); + this["callId"] = assign("callId"); + this["talk"] = assign("talk"); + this["listen"] = assign("listen"); + this["dtmfPassThrough"] = assign("dtmfPassThrough"); + this["startConfOnEnter"] = assign("startConfOnEnter"); } } diff --git a/models/ConferenceRecordingStatusWebhook.ts b/models/ConferenceRecordingStatusWebhook.ts index e3ff026..4f4640c 100644 --- a/models/ConferenceRecordingStatusWebhook.ts +++ b/models/ConferenceRecordingStatusWebhook.ts @@ -204,50 +204,27 @@ export class ConferenceRecordingStatusWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "conferenceRecordingStatus" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - ConferenceRecordingStatusWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : ConferenceRecordingStatusWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["recordingUrl"]) { - this["recordingUrl"] = assign("recordingUrl"); - } - if (args["recordingId"]) { - this["recordingId"] = assign("recordingId"); - } - if (args["recordingDurationSec"]) { - this["recordingDurationSec"] = assign("recordingDurationSec"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["status"] = assign("status"); + this["recordingUrl"] = assign("recordingUrl"); + this["recordingId"] = assign("recordingId"); + this["recordingDurationSec"] = assign("recordingDurationSec"); } public static deserialize(payload: string): ConferenceRecordingStatusWebhook { return new ConferenceRecordingStatusWebhook(JSON.parse(payload)); diff --git a/models/ConferenceResult.ts b/models/ConferenceResult.ts index e34d862..3338d2b 100644 --- a/models/ConferenceResult.ts +++ b/models/ConferenceResult.ts @@ -211,52 +211,27 @@ export class ConferenceResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - ConferenceResult.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : ConferenceResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["playBeep"]) { - this["playBeep"] = assign("playBeep"); - } - if (args["record"]) { - this["record"] = assign("record"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["waitUrl"]) { - this["waitUrl"] = assign("waitUrl"); - } - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } - if (args["statusCallbackUrl"]) { - this["statusCallbackUrl"] = assign("statusCallbackUrl"); - } - if (args["subresourceUris"]) { - this["subresourceUris"] = assign("subresourceUris"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["conferenceId"] = assign("conferenceId"); + this["accountId"] = assign("accountId"); + this["alias"] = assign("alias"); + this["playBeep"] = assign("playBeep"); + this["record"] = assign("record"); + this["status"] = assign("status"); + this["waitUrl"] = assign("waitUrl"); + this["actionUrl"] = assign("actionUrl"); + this["statusCallbackUrl"] = assign("statusCallbackUrl"); + this["subresourceUris"] = assign("subresourceUris"); } } diff --git a/models/ConferenceStatusWebhook.ts b/models/ConferenceStatusWebhook.ts index 10429e0..f3fd050 100644 --- a/models/ConferenceStatusWebhook.ts +++ b/models/ConferenceStatusWebhook.ts @@ -204,50 +204,27 @@ export class ConferenceStatusWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "conferenceStatus" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - ConferenceStatusWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : ConferenceStatusWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["recordingUrl"]) { - this["recordingUrl"] = assign("recordingUrl"); - } - if (args["recordingId"]) { - this["recordingId"] = assign("recordingId"); - } - if (args["recordingDurationSec"]) { - this["recordingDurationSec"] = assign("recordingDurationSec"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["status"] = assign("status"); + this["recordingUrl"] = assign("recordingUrl"); + this["recordingId"] = assign("recordingId"); + this["recordingDurationSec"] = assign("recordingDurationSec"); } public static deserialize(payload: string): ConferenceStatusWebhook { return new ConferenceStatusWebhook(JSON.parse(payload)); diff --git a/models/CreateConference.ts b/models/CreateConference.ts index 830f182..0bfe908 100644 --- a/models/CreateConference.ts +++ b/models/CreateConference.ts @@ -117,28 +117,19 @@ export class CreateConference extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "CreateConference" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CreateConference.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CreateConference.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["playBeep"]) { - this["playBeep"] = assign("playBeep"); - } - if (args["record"]) { - this["record"] = assign("record"); - } - if (args["statusCallbackUrl"]) { - this["statusCallbackUrl"] = assign("statusCallbackUrl"); - } - if (args["waitUrl"]) { - this["waitUrl"] = assign("waitUrl"); - } + this["actionUrl"] = assign("actionUrl"); + this["alias"] = assign("alias"); + this["playBeep"] = assign("playBeep"); + this["record"] = assign("record"); + this["statusCallbackUrl"] = assign("statusCallbackUrl"); + this["waitUrl"] = assign("waitUrl"); } } diff --git a/models/CreateConferenceRequest.ts b/models/CreateConferenceRequest.ts index 95acc01..2cd5460 100644 --- a/models/CreateConferenceRequest.ts +++ b/models/CreateConferenceRequest.ts @@ -96,25 +96,18 @@ export class CreateConferenceRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CreateConferenceRequest.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CreateConferenceRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["playBeep"]) { - this["playBeep"] = assign("playBeep"); - } - if (args["record"]) { - this["record"] = assign("record"); - } - if (args["waitUrl"]) { - this["waitUrl"] = assign("waitUrl"); - } - if (args["statusCallbackUrl"]) { - this["statusCallbackUrl"] = assign("statusCallbackUrl"); - } + this["alias"] = assign("alias"); + this["playBeep"] = assign("playBeep"); + this["record"] = assign("record"); + this["waitUrl"] = assign("waitUrl"); + this["statusCallbackUrl"] = assign("statusCallbackUrl"); } } diff --git a/models/CreateConferenceWebhook.ts b/models/CreateConferenceWebhook.ts index e32b69d..4c9d0ff 100644 --- a/models/CreateConferenceWebhook.ts +++ b/models/CreateConferenceWebhook.ts @@ -204,50 +204,27 @@ export class CreateConferenceWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "createConference" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CreateConferenceWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CreateConferenceWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["recordingUrl"]) { - this["recordingUrl"] = assign("recordingUrl"); - } - if (args["recordingId"]) { - this["recordingId"] = assign("recordingId"); - } - if (args["recordingDurationSec"]) { - this["recordingDurationSec"] = assign("recordingDurationSec"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["status"] = assign("status"); + this["recordingUrl"] = assign("recordingUrl"); + this["recordingId"] = assign("recordingId"); + this["recordingDurationSec"] = assign("recordingDurationSec"); } public static deserialize(payload: string): CreateConferenceWebhook { return new CreateConferenceWebhook(JSON.parse(payload)); diff --git a/models/CreateWebRTCToken.ts b/models/CreateWebRTCToken.ts index 52d2588..ee26d96 100644 --- a/models/CreateWebRTCToken.ts +++ b/models/CreateWebRTCToken.ts @@ -72,19 +72,16 @@ export class CreateWebRTCToken { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - CreateWebRTCToken.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : CreateWebRTCToken.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["uses"]) { - this["uses"] = assign("uses"); - } + this["to"] = assign("to"); + this["from"] = assign("from"); + this["uses"] = assign("uses"); } } diff --git a/models/Dequeue.ts b/models/Dequeue.ts index 12e9aca..c7eb3b1 100644 --- a/models/Dequeue.ts +++ b/models/Dequeue.ts @@ -36,9 +36,12 @@ export class Dequeue extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Dequeue" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Dequeue.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Dequeue.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; } } diff --git a/models/DequeueWebhook.ts b/models/DequeueWebhook.ts index 9cab137..6149298 100644 --- a/models/DequeueWebhook.ts +++ b/models/DequeueWebhook.ts @@ -178,43 +178,25 @@ export class DequeueWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "dequeue" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - DequeueWebhook.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : DequeueWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["queueResult"]) { - this["queueResult"] = assign("queueResult"); - } - if (args["queueTime"]) { - this["queueTime"] = assign("queueTime"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["queueResult"] = assign("queueResult"); + this["queueTime"] = assign("queueTime"); } public static deserialize(payload: string): DequeueWebhook { return new DequeueWebhook(JSON.parse(payload)); diff --git a/models/Enqueue.ts b/models/Enqueue.ts index acea49c..1e8e9ae 100644 --- a/models/Enqueue.ts +++ b/models/Enqueue.ts @@ -91,21 +91,16 @@ export class Enqueue extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Enqueue" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Enqueue.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Enqueue.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } - if (args["notificationUrl"]) { - this["notificationUrl"] = assign("notificationUrl"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["waitUrl"]) { - this["waitUrl"] = assign("waitUrl"); - } + this["actionUrl"] = assign("actionUrl"); + this["notificationUrl"] = assign("notificationUrl"); + this["queueId"] = assign("queueId"); + this["waitUrl"] = assign("waitUrl"); } } diff --git a/models/FilterLogsRequest.ts b/models/FilterLogsRequest.ts index c8f4bb2..63495a6 100644 --- a/models/FilterLogsRequest.ts +++ b/models/FilterLogsRequest.ts @@ -46,13 +46,14 @@ export class FilterLogsRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - FilterLogsRequest.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : FilterLogsRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["pql"]) { - this["pql"] = assign("pql"); - } + this["pql"] = assign("pql"); } } diff --git a/models/GetDigits.ts b/models/GetDigits.ts index 026b091..128613a 100644 --- a/models/GetDigits.ts +++ b/models/GetDigits.ts @@ -156,36 +156,21 @@ export class GetDigits extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "GetDigits" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - GetDigits.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : GetDigits.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } - if (args["digitTimeoutMs"]) { - this["digitTimeoutMs"] = assign("digitTimeoutMs"); - } - if (args["finishOnKey"]) { - this["finishOnKey"] = assign("finishOnKey"); - } - if (args["flushBuffer"]) { - this["flushBuffer"] = assign("flushBuffer"); - } - if (args["initialTimeoutMs"]) { - this["initialTimeoutMs"] = assign("initialTimeoutMs"); - } - if (args["maxDigits"]) { - this["maxDigits"] = assign("maxDigits"); - } - if (args["minDigits"]) { - this["minDigits"] = assign("minDigits"); - } - if (args["prompts"]) { - this["prompts"] = assign>("prompts"); - } - if (args["privacyMode"]) { - this["privacyMode"] = assign("privacyMode"); - } + this["actionUrl"] = assign("actionUrl"); + this["digitTimeoutMs"] = assign("digitTimeoutMs"); + this["finishOnKey"] = assign("finishOnKey"); + this["flushBuffer"] = assign("flushBuffer"); + this["initialTimeoutMs"] = assign("initialTimeoutMs"); + this["maxDigits"] = assign("maxDigits"); + this["minDigits"] = assign("minDigits"); + this["prompts"] = assign>("prompts"); + this["privacyMode"] = assign("privacyMode"); } } diff --git a/models/GetDigitsWebhook.ts b/models/GetDigitsWebhook.ts index 5e6127d..09430c3 100644 --- a/models/GetDigitsWebhook.ts +++ b/models/GetDigitsWebhook.ts @@ -191,47 +191,26 @@ export class GetDigitsWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "getDigits" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - GetDigitsWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : GetDigitsWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["digits"]) { - this["digits"] = assign("digits"); - } - if (args["reason"]) { - this["reason"] = assign("reason"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["digits"] = assign("digits"); + this["reason"] = assign("reason"); + this["parentCallId"] = assign("parentCallId"); } public static deserialize(payload: string): GetDigitsWebhook { return new GetDigitsWebhook(JSON.parse(payload)); diff --git a/models/GetSpeech.ts b/models/GetSpeech.ts index ae88675..a3cc450 100644 --- a/models/GetSpeech.ts +++ b/models/GetSpeech.ts @@ -206,52 +206,27 @@ export class GetSpeech extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "GetSpeech" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - GetSpeech.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : GetSpeech.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } - if (args["grammarType"]) { - this["grammarType"] = assign("grammarType"); - } - if (args["grammarFile"]) { - this["grammarFile"] = assign("grammarFile"); - } - if (args["grammarRule"]) { - this["grammarRule"] = assign("grammarRule"); - } - if (args["playBeep"]) { - this["playBeep"] = assign("playBeep"); - } - if (args["prompts"]) { - this["prompts"] = assign>("prompts"); - } - if (args["noInputTimeoutMs"]) { - this["noInputTimeoutMs"] = assign("noInputTimeoutMs"); - } - if (args["recognitionTimeoutMs"]) { - this["recognitionTimeoutMs"] = assign("recognitionTimeoutMs"); - } - if (args["confidenceThreshold"]) { - this["confidenceThreshold"] = assign("confidenceThreshold"); - } - if (args["sensitivityLevel"]) { - this["sensitivityLevel"] = assign("sensitivityLevel"); - } - if (args["speechCompleteTimeoutMs"]) { - this["speechCompleteTimeoutMs"] = assign( - "speechCompleteTimeoutMs", - ); - } - if (args["speechIncompleteTimeoutMs"]) { - this["speechIncompleteTimeoutMs"] = assign( - "speechIncompleteTimeoutMs", - ); - } - if (args["privacyMode"]) { - this["privacyMode"] = assign("privacyMode"); - } + this["actionUrl"] = assign("actionUrl"); + this["grammarType"] = assign("grammarType"); + this["grammarFile"] = assign("grammarFile"); + this["grammarRule"] = assign("grammarRule"); + this["playBeep"] = assign("playBeep"); + this["prompts"] = assign>("prompts"); + this["noInputTimeoutMs"] = assign("noInputTimeoutMs"); + this["recognitionTimeoutMs"] = assign("recognitionTimeoutMs"); + this["confidenceThreshold"] = assign("confidenceThreshold"); + this["sensitivityLevel"] = assign("sensitivityLevel"); + this["speechCompleteTimeoutMs"] = assign("speechCompleteTimeoutMs"); + this["speechIncompleteTimeoutMs"] = assign( + "speechIncompleteTimeoutMs", + ); + this["privacyMode"] = assign("privacyMode"); } } diff --git a/models/GetSpeechWebhook.ts b/models/GetSpeechWebhook.ts index 87da5cd..b19dc1f 100644 --- a/models/GetSpeechWebhook.ts +++ b/models/GetSpeechWebhook.ts @@ -256,62 +256,31 @@ export class GetSpeechWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "getSpeech" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - GetSpeechWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : GetSpeechWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["reason"]) { - this["reason"] = assign("reason"); - } - if (args["recognitionResult"]) { - this["recognitionResult"] = assign("recognitionResult"); - } - if (args["confidence"]) { - this["confidence"] = assign("confidence"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } - if (args["completionReason"]) { - this["completionReason"] = assign("completionReason"); - } - if (args["completionCause"]) { - this["completionCause"] = assign("completionCause"); - } - if (args["mrcpCode"]) { - this["mrcpCode"] = assign("mrcpCode"); - } - if (args["mrcpDiagnostic"]) { - this["mrcpDiagnostic"] = assign("mrcpDiagnostic"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["reason"] = assign("reason"); + this["recognitionResult"] = assign("recognitionResult"); + this["confidence"] = assign("confidence"); + this["parentCallId"] = assign("parentCallId"); + this["completionReason"] = assign("completionReason"); + this["completionCause"] = assign("completionCause"); + this["mrcpCode"] = assign("mrcpCode"); + this["mrcpDiagnostic"] = assign("mrcpDiagnostic"); } public static deserialize(payload: string): GetSpeechWebhook { return new GetSpeechWebhook(JSON.parse(payload)); diff --git a/models/Hangup.ts b/models/Hangup.ts index a06c822..018d495 100644 --- a/models/Hangup.ts +++ b/models/Hangup.ts @@ -52,12 +52,13 @@ export class Hangup extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Hangup" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Hangup.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Hangup.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["reason"]) { - this["reason"] = assign("reason"); - } + this["reason"] = assign("reason"); } } diff --git a/models/InboundCallWebhook.ts b/models/InboundCallWebhook.ts index 6f02934..68c05e6 100644 --- a/models/InboundCallWebhook.ts +++ b/models/InboundCallWebhook.ts @@ -164,41 +164,24 @@ export class InboundCallWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "inboundCall" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - InboundCallWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : InboundCallWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["parentCallId"] = assign("parentCallId"); } public static deserialize(payload: string): InboundCallWebhook { return new InboundCallWebhook(JSON.parse(payload)); diff --git a/models/IncomingNumberList.ts b/models/IncomingNumberList.ts index c2c84a4..b22f2d3 100644 --- a/models/IncomingNumberList.ts +++ b/models/IncomingNumberList.ts @@ -135,36 +135,23 @@ export class IncomingNumberList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - IncomingNumberList.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : IncomingNumberList.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["incomingPhoneNumbers"]) { - this["incomingPhoneNumbers"] = assign>( - "incomingPhoneNumbers", - ); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["incomingPhoneNumbers"] = assign>( + "incomingPhoneNumbers", + ); } } diff --git a/models/IncomingNumberRequest.ts b/models/IncomingNumberRequest.ts index d3732e7..8eb2542 100644 --- a/models/IncomingNumberRequest.ts +++ b/models/IncomingNumberRequest.ts @@ -72,19 +72,16 @@ export class IncomingNumberRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - IncomingNumberRequest.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : IncomingNumberRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["applicationId"]) { - this["applicationId"] = assign("applicationId"); - } - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } + this["applicationId"] = assign("applicationId"); + this["alias"] = assign("alias"); + this["campaignId"] = assign("campaignId"); } } diff --git a/models/IncomingNumberResult.ts b/models/IncomingNumberResult.ts index 42a76ac..9cda807 100644 --- a/models/IncomingNumberResult.ts +++ b/models/IncomingNumberResult.ts @@ -250,61 +250,30 @@ export class IncomingNumberResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - IncomingNumberResult.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : IncomingNumberResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["capabilities"]) { - this["capabilities"] = assign("capabilities"); - } - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } - if (args["phoneNumberId"]) { - this["phoneNumberId"] = assign("phoneNumberId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["applicationId"]) { - this["applicationId"] = assign("applicationId"); - } - if (args["phoneNumber"]) { - this["phoneNumber"] = assign("phoneNumber"); - } - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["region"]) { - this["region"] = assign("region"); - } - if (args["country"]) { - this["country"] = assign("country"); - } - if (args["voiceEnabled"]) { - this["voiceEnabled"] = assign("voiceEnabled"); - } - if (args["smsEnabled"]) { - this["smsEnabled"] = assign("smsEnabled"); - } - if (args["offnet"]) { - this["offnet"] = assign("offnet"); - } - if (args["tfn"]) { - this["tfn"] = assign("tfn"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["capabilities"] = assign("capabilities"); + this["campaignId"] = assign("campaignId"); + this["phoneNumberId"] = assign("phoneNumberId"); + this["accountId"] = assign("accountId"); + this["applicationId"] = assign("applicationId"); + this["phoneNumber"] = assign("phoneNumber"); + this["alias"] = assign("alias"); + this["region"] = assign("region"); + this["country"] = assign("country"); + this["voiceEnabled"] = assign("voiceEnabled"); + this["smsEnabled"] = assign("smsEnabled"); + this["offnet"] = assign("offnet"); + this["tfn"] = assign("tfn"); } } diff --git a/models/LeaveConferenceWebhook.ts b/models/LeaveConferenceWebhook.ts index f6a581f..8dd1442 100644 --- a/models/LeaveConferenceWebhook.ts +++ b/models/LeaveConferenceWebhook.ts @@ -154,38 +154,23 @@ export class LeaveConferenceWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "leaveConference" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - LeaveConferenceWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : LeaveConferenceWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); } public static deserialize(payload: string): LeaveConferenceWebhook { return new LeaveConferenceWebhook(JSON.parse(payload)); diff --git a/models/LogList.ts b/models/LogList.ts index 7e5a39c..ebdaa64 100644 --- a/models/LogList.ts +++ b/models/LogList.ts @@ -135,33 +135,20 @@ export class LogList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - LogList.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : LogList.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["logs"]) { - this["logs"] = assign>("logs"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["logs"] = assign>("logs"); } } diff --git a/models/LogResult.ts b/models/LogResult.ts index b362f62..3f524d1 100644 --- a/models/LogResult.ts +++ b/models/LogResult.ts @@ -122,30 +122,19 @@ export class LogResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - LogResult.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : LogResult.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["timestamp"]) { - this["timestamp"] = assign("timestamp"); - } - if (args["level"]) { - this["level"] = assign("level"); - } - if (args["requestId"]) { - this["requestId"] = assign("requestId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["message"]) { - this["message"] = assign("message"); - } - if (args["metadata"]) { - this["metadata"] = assign("metadata"); - } + this["timestamp"] = assign("timestamp"); + this["level"] = assign("level"); + this["requestId"] = assign("requestId"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["message"] = assign("message"); + this["metadata"] = assign("metadata"); } } diff --git a/models/MachineDetectedWebhook.ts b/models/MachineDetectedWebhook.ts index e00293b..9da12da 100644 --- a/models/MachineDetectedWebhook.ts +++ b/models/MachineDetectedWebhook.ts @@ -178,44 +178,25 @@ export class MachineDetectedWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "machineDetected" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - MachineDetectedWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : MachineDetectedWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } - if (args["machineType"]) { - this["machineType"] = assign("machineType"); - } + this["requestType"] = assign("requestType"); + this["callId"] = assign("callId"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["parentCallId"] = assign("parentCallId"); + this["machineType"] = assign("machineType"); } public static deserialize(payload: string): MachineDetectedWebhook { return new MachineDetectedWebhook(JSON.parse(payload)); diff --git a/models/MakeCallRequest.ts b/models/MakeCallRequest.ts index 634c235..b1ad606 100644 --- a/models/MakeCallRequest.ts +++ b/models/MakeCallRequest.ts @@ -163,39 +163,23 @@ export class MakeCallRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - MakeCallRequest.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : MakeCallRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["applicationId"]) { - this["applicationId"] = assign("applicationId"); - } - if (args["sendDigits"]) { - this["sendDigits"] = assign("sendDigits"); - } - if (args["ifMachine"]) { - this["ifMachine"] = assign("ifMachine"); - } - if (args["ifMachineUrl"]) { - this["ifMachineUrl"] = assign("ifMachineUrl"); - } - if (args["timeout"]) { - this["timeout"] = assign("timeout"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } - if (args["privacyMode"]) { - this["privacyMode"] = assign("privacyMode"); - } - if (args["callConnectUrl"]) { - this["callConnectUrl"] = assign("callConnectUrl"); - } + this["from"] = assign("from"); + this["to"] = assign("to"); + this["applicationId"] = assign("applicationId"); + this["sendDigits"] = assign("sendDigits"); + this["ifMachine"] = assign("ifMachine"); + this["ifMachineUrl"] = assign("ifMachineUrl"); + this["timeout"] = assign("timeout"); + this["parentCallId"] = assign("parentCallId"); + this["privacyMode"] = assign("privacyMode"); + this["callConnectUrl"] = assign("callConnectUrl"); } } diff --git a/models/MessageDeliveryWebhook.ts b/models/MessageDeliveryWebhook.ts index b23735b..9c1edb4 100644 --- a/models/MessageDeliveryWebhook.ts +++ b/models/MessageDeliveryWebhook.ts @@ -171,41 +171,24 @@ export class MessageDeliveryWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "messageDelivery" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - MessageDeliveryWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : MessageDeliveryWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["text"]) { - this["text"] = assign("text"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["applicationId"]) { - this["applicationId"] = assign("applicationId"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["phoneNumberId"]) { - this["phoneNumberId"] = assign("phoneNumberId"); - } - if (args["uri"]) { - this["uri"] = assign("uri"); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["text"] = assign("text"); + this["direction"] = assign("direction"); + this["applicationId"] = assign("applicationId"); + this["status"] = assign("status"); + this["phoneNumberId"] = assign("phoneNumberId"); + this["uri"] = assign("uri"); } public static deserialize(payload: string): MessageDeliveryWebhook { return new MessageDeliveryWebhook(JSON.parse(payload)); diff --git a/models/MessageRequest.ts b/models/MessageRequest.ts index af4cc8b..e5e333f 100644 --- a/models/MessageRequest.ts +++ b/models/MessageRequest.ts @@ -150,36 +150,22 @@ export class MessageRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - MessageRequest.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : MessageRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["text"]) { - this["text"] = assign("text"); - } - if (args["notificationUrl"]) { - this["notificationUrl"] = assign("notificationUrl"); - } - if (args["mediaUrls"]) { - this["mediaUrls"] = assign>("mediaUrls"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["text"] = assign("text"); + this["notificationUrl"] = assign("notificationUrl"); + this["mediaUrls"] = assign>("mediaUrls"); } } diff --git a/models/MessageResult.ts b/models/MessageResult.ts index 2f99ac4..d963cca 100644 --- a/models/MessageResult.ts +++ b/models/MessageResult.ts @@ -276,66 +276,32 @@ export class MessageResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - MessageResult.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : MessageResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["messageId"]) { - this["messageId"] = assign("messageId"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["text"]) { - this["text"] = assign("text"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["notificationUrl"]) { - this["notificationUrl"] = assign("notificationUrl"); - } - if (args["brandId"]) { - this["brandId"] = assign("brandId"); - } - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } - if (args["segmentCount"]) { - this["segmentCount"] = assign("segmentCount"); - } - if (args["mediaUrls"]) { - this["mediaUrls"] = assign>("mediaUrls"); - } - if (args["tfn"]) { - this["tfn"] = assign("tfn"); - } - if (args["phoneNumberId"]) { - this["phoneNumberId"] = assign("phoneNumberId"); - } - if (args["applicationId"]) { - this["applicationId"] = assign("applicationId"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["accountId"] = assign("accountId"); + this["messageId"] = assign("messageId"); + this["status"] = assign("status"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["text"] = assign("text"); + this["direction"] = assign("direction"); + this["notificationUrl"] = assign("notificationUrl"); + this["brandId"] = assign("brandId"); + this["campaignId"] = assign("campaignId"); + this["segmentCount"] = assign("segmentCount"); + this["mediaUrls"] = assign>("mediaUrls"); + this["tfn"] = assign("tfn"); + this["phoneNumberId"] = assign("phoneNumberId"); + this["applicationId"] = assign("applicationId"); } } diff --git a/models/MessageStatusWebhook.ts b/models/MessageStatusWebhook.ts index eca68d6..d8e68f9 100644 --- a/models/MessageStatusWebhook.ts +++ b/models/MessageStatusWebhook.ts @@ -182,44 +182,25 @@ export class MessageStatusWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "messageStatus" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - MessageStatusWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : MessageStatusWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["messageId"]) { - this["messageId"] = assign("messageId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["text"]) { - this["text"] = assign("text"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["applicationId"]) { - this["applicationId"] = assign("applicationId"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["phoneNumberId"]) { - this["phoneNumberId"] = assign("phoneNumberId"); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["messageId"] = assign("messageId"); + this["callId"] = assign("callId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["text"] = assign("text"); + this["direction"] = assign("direction"); + this["applicationId"] = assign("applicationId"); + this["status"] = assign("status"); + this["phoneNumberId"] = assign("phoneNumberId"); } public static deserialize(payload: string): MessageStatusWebhook { return new MessageStatusWebhook(JSON.parse(payload)); diff --git a/models/MessagesList.ts b/models/MessagesList.ts index 1aa65b0..93bac7f 100644 --- a/models/MessagesList.ts +++ b/models/MessagesList.ts @@ -138,33 +138,21 @@ export class MessagesList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - MessagesList.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : MessagesList.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["messages"]) { - this["messages"] = assign>("messages"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["messages"] = assign>("messages"); } } diff --git a/models/MutableResourceModel.ts b/models/MutableResourceModel.ts index d49394d..d141303 100644 --- a/models/MutableResourceModel.ts +++ b/models/MutableResourceModel.ts @@ -85,22 +85,17 @@ export class MutableResourceModel { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - MutableResourceModel.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : MutableResourceModel.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); } } diff --git a/models/OutDial.ts b/models/OutDial.ts index 41aa5fe..6f3af23 100644 --- a/models/OutDial.ts +++ b/models/OutDial.ts @@ -167,39 +167,22 @@ export class OutDial extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "OutDial" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - OutDial.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : OutDial.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } - if (args["callConnectUrl"]) { - this["callConnectUrl"] = assign("callConnectUrl"); - } - if (args["callingNumber"]) { - this["callingNumber"] = assign("callingNumber"); - } - if (args["destination"]) { - this["destination"] = assign("destination"); - } - if (args["ifMachine"]) { - this["ifMachine"] = assign("ifMachine"); - } - if (args["ifMachineUrl"]) { - this["ifMachineUrl"] = assign("ifMachineUrl"); - } - if (args["sendDigits"]) { - this["sendDigits"] = assign("sendDigits"); - } - if (args["statusCallbackUrl"]) { - this["statusCallbackUrl"] = assign("statusCallbackUrl"); - } - if (args["timeout"]) { - this["timeout"] = assign("timeout"); - } - if (args["privacyMode"]) { - this["privacyMode"] = assign("privacyMode"); - } + this["actionUrl"] = assign("actionUrl"); + this["callConnectUrl"] = assign("callConnectUrl"); + this["callingNumber"] = assign("callingNumber"); + this["destination"] = assign("destination"); + this["ifMachine"] = assign("ifMachine"); + this["ifMachineUrl"] = assign("ifMachineUrl"); + this["sendDigits"] = assign("sendDigits"); + this["statusCallbackUrl"] = assign("statusCallbackUrl"); + this["timeout"] = assign("timeout"); + this["privacyMode"] = assign("privacyMode"); } } diff --git a/models/OutDialApiConnectWebhook.ts b/models/OutDialApiConnectWebhook.ts index 5e77334..20fe51d 100644 --- a/models/OutDialApiConnectWebhook.ts +++ b/models/OutDialApiConnectWebhook.ts @@ -167,41 +167,24 @@ export class OutDialApiConnectWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "outDialApiConnect" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - OutDialApiConnectWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : OutDialApiConnectWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["parentCallId"] = assign("parentCallId"); } public static deserialize(payload: string): OutDialApiConnectWebhook { return new OutDialApiConnectWebhook(JSON.parse(payload)); diff --git a/models/OutDialConnectWebhook.ts b/models/OutDialConnectWebhook.ts index f7bc861..89a5b56 100644 --- a/models/OutDialConnectWebhook.ts +++ b/models/OutDialConnectWebhook.ts @@ -167,41 +167,24 @@ export class OutDialConnectWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "outDialConnect" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - OutDialConnectWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : OutDialConnectWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["parentCallId"] = assign("parentCallId"); } public static deserialize(payload: string): OutDialConnectWebhook { return new OutDialConnectWebhook(JSON.parse(payload)); diff --git a/models/OutDialStartWebhook.ts b/models/OutDialStartWebhook.ts index 37c7f9d..66976ae 100644 --- a/models/OutDialStartWebhook.ts +++ b/models/OutDialStartWebhook.ts @@ -180,44 +180,25 @@ export class OutDialStartWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "outDialStart" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - OutDialStartWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : OutDialStartWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["dialCallId"]) { - this["dialCallId"] = assign("dialCallId"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["dialCallId"] = assign("dialCallId"); + this["parentCallId"] = assign("parentCallId"); } public static deserialize(payload: string): OutDialStartWebhook { return new OutDialStartWebhook(JSON.parse(payload)); diff --git a/models/PaginationModel.ts b/models/PaginationModel.ts index 54910dc..5d44b2b 100644 --- a/models/PaginationModel.ts +++ b/models/PaginationModel.ts @@ -124,30 +124,20 @@ export class PaginationModel { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - PaginationModel.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : PaginationModel.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); } } diff --git a/models/Park.ts b/models/Park.ts index 3b61ef7..08e8870 100644 --- a/models/Park.ts +++ b/models/Park.ts @@ -78,18 +78,15 @@ export class Park extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Park" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Park.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Park.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["waitUrl"]) { - this["waitUrl"] = assign("waitUrl"); - } - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } - if (args["notificationUrl"]) { - this["notificationUrl"] = assign("notificationUrl"); - } + this["waitUrl"] = assign("waitUrl"); + this["actionUrl"] = assign("actionUrl"); + this["notificationUrl"] = assign("notificationUrl"); } } diff --git a/models/Pause.ts b/models/Pause.ts index c17aa45..e9ccbd0 100644 --- a/models/Pause.ts +++ b/models/Pause.ts @@ -52,12 +52,13 @@ export class Pause extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Pause" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Pause.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Pause.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["length"]) { - this["length"] = assign("length"); - } + this["length"] = assign("length"); } } diff --git a/models/PerclCommand.ts b/models/PerclCommand.ts index 62285e5..272f4f2 100644 --- a/models/PerclCommand.ts +++ b/models/PerclCommand.ts @@ -50,13 +50,15 @@ export class PerclCommand { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - PerclCommand.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : PerclCommand.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["command"]) { - this["command"] = assign("command"); - } + this["command"] = assign("command"); } public toPerclObject() { const reduce = (acc: any, attr: AttributeType) => { diff --git a/models/PerclScript.ts b/models/PerclScript.ts index a68638f..541fae1 100644 --- a/models/PerclScript.ts +++ b/models/PerclScript.ts @@ -51,13 +51,14 @@ export class PerclScript { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - PerclScript.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : PerclScript.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["commands"]) { - this["commands"] = assign>("commands"); - } + this["commands"] = assign>("commands"); } public build() { return this.commands?.map((command) => command.toPerclObject()) ?? []; diff --git a/models/Play.ts b/models/Play.ts index 7ba9a06..641e4cd 100644 --- a/models/Play.ts +++ b/models/Play.ts @@ -78,18 +78,15 @@ export class Play extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Play" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Play.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Play.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["file"]) { - this["file"] = assign("file"); - } - if (args["loop"]) { - this["loop"] = assign("loop"); - } - if (args["privacyMode"]) { - this["privacyMode"] = assign("privacyMode"); - } + this["file"] = assign("file"); + this["loop"] = assign("loop"); + this["privacyMode"] = assign("privacyMode"); } } diff --git a/models/PlayEarlyMedia.ts b/models/PlayEarlyMedia.ts index 3e67c43..fb9eaf4 100644 --- a/models/PlayEarlyMedia.ts +++ b/models/PlayEarlyMedia.ts @@ -52,12 +52,14 @@ export class PlayEarlyMedia extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "PlayEarlyMedia" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - PlayEarlyMedia.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : PlayEarlyMedia.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["file"]) { - this["file"] = assign("file"); - } + this["file"] = assign("file"); } } diff --git a/models/QueueList.ts b/models/QueueList.ts index e6270b0..e4cf3d0 100644 --- a/models/QueueList.ts +++ b/models/QueueList.ts @@ -135,33 +135,20 @@ export class QueueList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - QueueList.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : QueueList.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["queues"]) { - this["queues"] = assign>("queues"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["queues"] = assign>("queues"); } } diff --git a/models/QueueMember.ts b/models/QueueMember.ts index 414875e..e7b02a0 100644 --- a/models/QueueMember.ts +++ b/models/QueueMember.ts @@ -98,24 +98,17 @@ export class QueueMember { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - QueueMember.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : QueueMember.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["waitTime"]) { - this["waitTime"] = assign("waitTime"); - } - if (args["position"]) { - this["position"] = assign("position"); - } - if (args["dateEnqueued"]) { - this["dateEnqueued"] = assign("dateEnqueued"); - } + this["uri"] = assign("uri"); + this["callId"] = assign("callId"); + this["waitTime"] = assign("waitTime"); + this["position"] = assign("position"); + this["dateEnqueued"] = assign("dateEnqueued"); } } diff --git a/models/QueueMemberList.ts b/models/QueueMemberList.ts index e850e86..abf03f1 100644 --- a/models/QueueMemberList.ts +++ b/models/QueueMemberList.ts @@ -135,33 +135,21 @@ export class QueueMemberList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - QueueMemberList.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : QueueMemberList.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["queueMembers"]) { - this["queueMembers"] = assign>("queueMembers"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["queueMembers"] = assign>("queueMembers"); } } diff --git a/models/QueueRequest.ts b/models/QueueRequest.ts index daefc54..d652d15 100644 --- a/models/QueueRequest.ts +++ b/models/QueueRequest.ts @@ -59,15 +59,15 @@ export class QueueRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - QueueRequest.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : QueueRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["maxSize"]) { - this["maxSize"] = assign("maxSize"); - } + this["alias"] = assign("alias"); + this["maxSize"] = assign("maxSize"); } } diff --git a/models/QueueResult.ts b/models/QueueResult.ts index 1339b76..42ea5f9 100644 --- a/models/QueueResult.ts +++ b/models/QueueResult.ts @@ -176,44 +176,23 @@ export class QueueResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - QueueResult.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : QueueResult.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["maxSize"]) { - this["maxSize"] = assign("maxSize"); - } - if (args["currentSize"]) { - this["currentSize"] = assign("currentSize"); - } - if (args["averageQueueRemovalTime"]) { - this["averageQueueRemovalTime"] = assign( - "averageQueueRemovalTime", - ); - } - if (args["subresourceUris"]) { - this["subresourceUris"] = assign("subresourceUris"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["accountId"] = assign("accountId"); + this["queueId"] = assign("queueId"); + this["alias"] = assign("alias"); + this["maxSize"] = assign("maxSize"); + this["currentSize"] = assign("currentSize"); + this["averageQueueRemovalTime"] = assign("averageQueueRemovalTime"); + this["subresourceUris"] = assign("subresourceUris"); } } diff --git a/models/QueueWaitWebhook.ts b/models/QueueWaitWebhook.ts index eaedd0d..4613181 100644 --- a/models/QueueWaitWebhook.ts +++ b/models/QueueWaitWebhook.ts @@ -193,47 +193,26 @@ export class QueueWaitWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "queueWait" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - QueueWaitWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : QueueWaitWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["queuePosition"]) { - this["queuePosition"] = assign("queuePosition"); - } - if (args["queueTime"]) { - this["queueTime"] = assign("queueTime"); - } - if (args["currentQueueSize"]) { - this["currentQueueSize"] = assign("currentQueueSize"); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["queuePosition"] = assign("queuePosition"); + this["queueTime"] = assign("queueTime"); + this["currentQueueSize"] = assign("currentQueueSize"); } public static deserialize(payload: string): QueueWaitWebhook { return new QueueWaitWebhook(JSON.parse(payload)); diff --git a/models/RecordUtterance.ts b/models/RecordUtterance.ts index 0904310..5c13936 100644 --- a/models/RecordUtterance.ts +++ b/models/RecordUtterance.ts @@ -130,30 +130,20 @@ export class RecordUtterance extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "RecordUtterance" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - RecordUtterance.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : RecordUtterance.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } - if (args["silenceTimeoutMs"]) { - this["silenceTimeoutMs"] = assign("silenceTimeoutMs"); - } - if (args["finishOnKey"]) { - this["finishOnKey"] = assign("finishOnKey"); - } - if (args["maxLengthSec"]) { - this["maxLengthSec"] = assign("maxLengthSec"); - } - if (args["playBeep"]) { - this["playBeep"] = assign("playBeep"); - } - if (args["autoStart"]) { - this["autoStart"] = assign("autoStart"); - } - if (args["privacyMode"]) { - this["privacyMode"] = assign("privacyMode"); - } + this["actionUrl"] = assign("actionUrl"); + this["silenceTimeoutMs"] = assign("silenceTimeoutMs"); + this["finishOnKey"] = assign("finishOnKey"); + this["maxLengthSec"] = assign("maxLengthSec"); + this["playBeep"] = assign("playBeep"); + this["autoStart"] = assign("autoStart"); + this["privacyMode"] = assign("privacyMode"); } } diff --git a/models/RecordWebhook.ts b/models/RecordWebhook.ts index b9801f9..3822b3a 100644 --- a/models/RecordWebhook.ts +++ b/models/RecordWebhook.ts @@ -254,61 +254,31 @@ export class RecordWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "record" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - RecordWebhook.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : RecordWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["recordingId"]) { - this["recordingId"] = assign("recordingId"); - } - if (args["recordingUrl"]) { - this["recordingUrl"] = assign("recordingUrl"); - } - if (args["recordingSize"]) { - this["recordingSize"] = assign("recordingSize"); - } - if (args["recordingFormat"]) { - this["recordingFormat"] = assign("recordingFormat"); - } - if (args["recordingDurationSec"]) { - this["recordingDurationSec"] = assign("recordingDurationSec"); - } - if (args["termReason"]) { - this["termReason"] = assign("termReason"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } - if (args["privacyMode"]) { - this["privacyMode"] = assign("privacyMode"); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["recordingId"] = assign("recordingId"); + this["recordingUrl"] = assign("recordingUrl"); + this["recordingSize"] = assign("recordingSize"); + this["recordingFormat"] = assign("recordingFormat"); + this["recordingDurationSec"] = assign("recordingDurationSec"); + this["termReason"] = assign("termReason"); + this["parentCallId"] = assign("parentCallId"); + this["privacyMode"] = assign("privacyMode"); } public static deserialize(payload: string): RecordWebhook { return new RecordWebhook(JSON.parse(payload)); diff --git a/models/RecordingList.ts b/models/RecordingList.ts index 2b0aacf..606026b 100644 --- a/models/RecordingList.ts +++ b/models/RecordingList.ts @@ -135,33 +135,21 @@ export class RecordingList { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - RecordingList.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : RecordingList.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["recordings"]) { - this["recordings"] = assign>("recordings"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["recordings"] = assign>("recordings"); } } diff --git a/models/RecordingResult.ts b/models/RecordingResult.ts index 28e7876..f122e28 100644 --- a/models/RecordingResult.ts +++ b/models/RecordingResult.ts @@ -150,36 +150,22 @@ export class RecordingResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - RecordingResult.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : RecordingResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["uri"]) { - this["uri"] = assign("uri"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } - if (args["recordingId"]) { - this["recordingId"] = assign("recordingId"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["durationSec"]) { - this["durationSec"] = assign("durationSec"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } + this["uri"] = assign("uri"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); + this["recordingId"] = assign("recordingId"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["durationSec"] = assign("durationSec"); + this["conferenceId"] = assign("conferenceId"); } } diff --git a/models/Redirect.ts b/models/Redirect.ts index a991fed..e50d0c1 100644 --- a/models/Redirect.ts +++ b/models/Redirect.ts @@ -52,12 +52,13 @@ export class Redirect extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Redirect" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Redirect.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Redirect.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } + this["actionUrl"] = assign("actionUrl"); } } diff --git a/models/RedirectWebhook.ts b/models/RedirectWebhook.ts index ab85440..39c5b2b 100644 --- a/models/RedirectWebhook.ts +++ b/models/RedirectWebhook.ts @@ -165,40 +165,24 @@ export class RedirectWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "redirect" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - RedirectWebhook.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : RedirectWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["parentCallId"]) { - this["parentCallId"] = assign("parentCallId"); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["parentCallId"] = assign("parentCallId"); } public static deserialize(payload: string): RedirectWebhook { return new RedirectWebhook(JSON.parse(payload)); diff --git a/models/Reject.ts b/models/Reject.ts index 7dab3ad..4957b2a 100644 --- a/models/Reject.ts +++ b/models/Reject.ts @@ -52,12 +52,13 @@ export class Reject extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Reject" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Reject.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Reject.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["reason"]) { - this["reason"] = assign("reason"); - } + this["reason"] = assign("reason"); } } diff --git a/models/RemoveFromConference.ts b/models/RemoveFromConference.ts index 7bdd7a0..644c44c 100644 --- a/models/RemoveFromConference.ts +++ b/models/RemoveFromConference.ts @@ -38,10 +38,13 @@ export class RemoveFromConference extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "RemoveFromConference" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - RemoveFromConference.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : RemoveFromConference.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; } } diff --git a/models/RemoveFromQueueNotificationWebhook.ts b/models/RemoveFromQueueNotificationWebhook.ts index c4ca3ab..1a35ff3 100644 --- a/models/RemoveFromQueueNotificationWebhook.ts +++ b/models/RemoveFromQueueNotificationWebhook.ts @@ -178,44 +178,25 @@ export class RemoveFromQueueNotificationWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "removeFromQueueNotification" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - RemoveFromQueueNotificationWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : RemoveFromQueueNotificationWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["callStatus"]) { - this["callStatus"] = assign("callStatus"); - } - if (args["direction"]) { - this["direction"] = assign("direction"); - } - if (args["conferenceId"]) { - this["conferenceId"] = assign("conferenceId"); - } - if (args["queueId"]) { - this["queueId"] = assign("queueId"); - } - if (args["queueResult"]) { - this["queueResult"] = assign("queueResult"); - } - if (args["queueTime"]) { - this["queueTime"] = assign("queueTime"); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["callStatus"] = assign("callStatus"); + this["direction"] = assign("direction"); + this["conferenceId"] = assign("conferenceId"); + this["queueId"] = assign("queueId"); + this["queueResult"] = assign("queueResult"); + this["queueTime"] = assign("queueTime"); } public static deserialize( payload: string, diff --git a/models/SMSTenDLCBrand.ts b/models/SMSTenDLCBrand.ts index 9e82263..c6732a3 100644 --- a/models/SMSTenDLCBrand.ts +++ b/models/SMSTenDLCBrand.ts @@ -430,108 +430,50 @@ export class SMSTenDLCBrand { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SMSTenDLCBrand.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SMSTenDLCBrand.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["entityType"]) { - this["entityType"] = assign("entityType"); - } - if (args["cspId"]) { - this["cspId"] = assign("cspId"); - } - if (args["brandId"]) { - this["brandId"] = assign("brandId"); - } - if (args["firstName"]) { - this["firstName"] = assign("firstName"); - } - if (args["lastName"]) { - this["lastName"] = assign("lastName"); - } - if (args["displayName"]) { - this["displayName"] = assign("displayName"); - } - if (args["companyName"]) { - this["companyName"] = assign("companyName"); - } - if (args["ein"]) { - this["ein"] = assign("ein"); - } - if (args["einIssuingCountry"]) { - this["einIssuingCountry"] = assign("einIssuingCountry"); - } - if (args["phone"]) { - this["phone"] = assign("phone"); - } - if (args["street"]) { - this["street"] = assign("street"); - } - if (args["city"]) { - this["city"] = assign("city"); - } - if (args["state"]) { - this["state"] = assign("state"); - } - if (args["postalCode"]) { - this["postalCode"] = assign("postalCode"); - } - if (args["country"]) { - this["country"] = assign("country"); - } - if (args["email"]) { - this["email"] = assign("email"); - } - if (args["stockSymbol"]) { - this["stockSymbol"] = assign("stockSymbol"); - } - if (args["stockExchange"]) { - this["stockExchange"] = - assign("stockExchange"); - } - if (args["ipAddress"]) { - this["ipAddress"] = assign("ipAddress"); - } - if (args["website"]) { - this["website"] = assign("website"); - } - if (args["brandRelationship"]) { - this["brandRelationship"] = - assign("brandRelationship"); - } - if (args["vertical"]) { - this["vertical"] = assign("vertical"); - } - if (args["altBusinessId"]) { - this["altBusinessId"] = assign("altBusinessId"); - } - if (args["altBusinessIdType"]) { - this["altBusinessIdType"] = - assign("altBusinessIdType"); - } - if (args["universalEin"]) { - this["universalEin"] = assign("universalEin"); - } - if (args["referenceId"]) { - this["referenceId"] = assign("referenceId"); - } - if (args["optionalAttributes"]) { - this["optionalAttributes"] = assign<{ [key: string]: any }>( - "optionalAttributes", - ); - } - if (args["mock"]) { - this["mock"] = assign("mock"); - } - if (args["identityStatus"]) { - this["identityStatus"] = - assign("identityStatus"); - } - if (args["createDate"]) { - this["createDate"] = assign("createDate"); - } + this["accountId"] = assign("accountId"); + this["entityType"] = assign("entityType"); + this["cspId"] = assign("cspId"); + this["brandId"] = assign("brandId"); + this["firstName"] = assign("firstName"); + this["lastName"] = assign("lastName"); + this["displayName"] = assign("displayName"); + this["companyName"] = assign("companyName"); + this["ein"] = assign("ein"); + this["einIssuingCountry"] = assign("einIssuingCountry"); + this["phone"] = assign("phone"); + this["street"] = assign("street"); + this["city"] = assign("city"); + this["state"] = assign("state"); + this["postalCode"] = assign("postalCode"); + this["country"] = assign("country"); + this["email"] = assign("email"); + this["stockSymbol"] = assign("stockSymbol"); + this["stockExchange"] = + assign("stockExchange"); + this["ipAddress"] = assign("ipAddress"); + this["website"] = assign("website"); + this["brandRelationship"] = + assign("brandRelationship"); + this["vertical"] = assign("vertical"); + this["altBusinessId"] = assign("altBusinessId"); + this["altBusinessIdType"] = + assign("altBusinessIdType"); + this["universalEin"] = assign("universalEin"); + this["referenceId"] = assign("referenceId"); + this["optionalAttributes"] = assign<{ [key: string]: any }>( + "optionalAttributes", + ); + this["mock"] = assign("mock"); + this["identityStatus"] = + assign("identityStatus"); + this["createDate"] = assign("createDate"); } } diff --git a/models/SMSTenDLCBrandsListResult.ts b/models/SMSTenDLCBrandsListResult.ts index 36b5178..6ffa8e3 100644 --- a/models/SMSTenDLCBrandsListResult.ts +++ b/models/SMSTenDLCBrandsListResult.ts @@ -135,34 +135,21 @@ export class SMSTenDLCBrandsListResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SMSTenDLCBrandsListResult.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SMSTenDLCBrandsListResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["brands"]) { - this["brands"] = assign>("brands"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["brands"] = assign>("brands"); } } diff --git a/models/SMSTenDLCCampaign.ts b/models/SMSTenDLCCampaign.ts index 248d690..e54681b 100644 --- a/models/SMSTenDLCCampaign.ts +++ b/models/SMSTenDLCCampaign.ts @@ -496,120 +496,51 @@ export class SMSTenDLCCampaign { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SMSTenDLCCampaign.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SMSTenDLCCampaign.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } - if (args["cspId"]) { - this["cspId"] = assign("cspId"); - } - if (args["resellerId"]) { - this["resellerId"] = assign("resellerId"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["createDate"]) { - this["createDate"] = assign("createDate"); - } - if (args["autoRenewal"]) { - this["autoRenewal"] = assign("autoRenewal"); - } - if (args["billedDate"]) { - this["billedDate"] = assign("billedDate"); - } - if (args["brandId"]) { - this["brandId"] = assign("brandId"); - } - if (args["usecase"]) { - this["usecase"] = assign("usecase"); - } - if (args["subUsecases"]) { - this["subUsecases"] = assign>("subUsecases"); - } - if (args["description"]) { - this["description"] = assign("description"); - } - if (args["embeddedLink"]) { - this["embeddedLink"] = assign("embeddedLink"); - } - if (args["embeddedPhone"]) { - this["embeddedPhone"] = assign("embeddedPhone"); - } - if (args["affiliateMarketing"]) { - this["affiliateMarketing"] = assign("affiliateMarketing"); - } - if (args["numberPool"]) { - this["numberPool"] = assign("numberPool"); - } - if (args["ageGated"]) { - this["ageGated"] = assign("ageGated"); - } - if (args["directLending"]) { - this["directLending"] = assign("directLending"); - } - if (args["subscriberOptin"]) { - this["subscriberOptin"] = assign("subscriberOptin"); - } - if (args["subscriberOptout"]) { - this["subscriberOptout"] = assign("subscriberOptout"); - } - if (args["subscriberHelp"]) { - this["subscriberHelp"] = assign("subscriberHelp"); - } - if (args["sample1"]) { - this["sample1"] = assign("sample1"); - } - if (args["sample2"]) { - this["sample2"] = assign("sample2"); - } - if (args["sample3"]) { - this["sample3"] = assign("sample3"); - } - if (args["sample4"]) { - this["sample4"] = assign("sample4"); - } - if (args["sample5"]) { - this["sample5"] = assign("sample5"); - } - if (args["messageFlow"]) { - this["messageFlow"] = assign("messageFlow"); - } - if (args["helpMessage"]) { - this["helpMessage"] = assign("helpMessage"); - } - if (args["optinKeywords"]) { - this["optinKeywords"] = assign("optinKeywords"); - } - if (args["optoutKeywords"]) { - this["optoutKeywords"] = assign("optoutKeywords"); - } - if (args["helpKeywords"]) { - this["helpKeywords"] = assign("helpKeywords"); - } - if (args["optinMessage"]) { - this["optinMessage"] = assign("optinMessage"); - } - if (args["optoutMessage"]) { - this["optoutMessage"] = assign("optoutMessage"); - } - if (args["referenceId"]) { - this["referenceId"] = assign("referenceId"); - } - if (args["mock"]) { - this["mock"] = assign("mock"); - } - if (args["nextRenewalOrExpirationDate"]) { - this["nextRenewalOrExpirationDate"] = assign( - "nextRenewalOrExpirationDate", - ); - } + this["accountId"] = assign("accountId"); + this["campaignId"] = assign("campaignId"); + this["cspId"] = assign("cspId"); + this["resellerId"] = assign("resellerId"); + this["status"] = assign("status"); + this["createDate"] = assign("createDate"); + this["autoRenewal"] = assign("autoRenewal"); + this["billedDate"] = assign("billedDate"); + this["brandId"] = assign("brandId"); + this["usecase"] = assign("usecase"); + this["subUsecases"] = assign>("subUsecases"); + this["description"] = assign("description"); + this["embeddedLink"] = assign("embeddedLink"); + this["embeddedPhone"] = assign("embeddedPhone"); + this["affiliateMarketing"] = assign("affiliateMarketing"); + this["numberPool"] = assign("numberPool"); + this["ageGated"] = assign("ageGated"); + this["directLending"] = assign("directLending"); + this["subscriberOptin"] = assign("subscriberOptin"); + this["subscriberOptout"] = assign("subscriberOptout"); + this["subscriberHelp"] = assign("subscriberHelp"); + this["sample1"] = assign("sample1"); + this["sample2"] = assign("sample2"); + this["sample3"] = assign("sample3"); + this["sample4"] = assign("sample4"); + this["sample5"] = assign("sample5"); + this["messageFlow"] = assign("messageFlow"); + this["helpMessage"] = assign("helpMessage"); + this["optinKeywords"] = assign("optinKeywords"); + this["optoutKeywords"] = assign("optoutKeywords"); + this["helpKeywords"] = assign("helpKeywords"); + this["optinMessage"] = assign("optinMessage"); + this["optoutMessage"] = assign("optoutMessage"); + this["referenceId"] = assign("referenceId"); + this["mock"] = assign("mock"); + this["nextRenewalOrExpirationDate"] = assign( + "nextRenewalOrExpirationDate", + ); } } diff --git a/models/SMSTenDLCCampaignsListResult.ts b/models/SMSTenDLCCampaignsListResult.ts index 6a58f9f..57dd7e8 100644 --- a/models/SMSTenDLCCampaignsListResult.ts +++ b/models/SMSTenDLCCampaignsListResult.ts @@ -135,34 +135,21 @@ export class SMSTenDLCCampaignsListResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SMSTenDLCCampaignsListResult.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SMSTenDLCCampaignsListResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["campaigns"]) { - this["campaigns"] = assign>("campaigns"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["campaigns"] = assign>("campaigns"); } } diff --git a/models/SMSTenDLCPartnerCampaign.ts b/models/SMSTenDLCPartnerCampaign.ts index 8cc1eb1..4cd2de0 100644 --- a/models/SMSTenDLCPartnerCampaign.ts +++ b/models/SMSTenDLCPartnerCampaign.ts @@ -403,97 +403,42 @@ export class SMSTenDLCPartnerCampaign { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SMSTenDLCPartnerCampaign.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SMSTenDLCPartnerCampaign.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } - if (args["status"]) { - this["status"] = assign("status"); - } - if (args["createDate"]) { - this["createDate"] = assign("createDate"); - } - if (args["brandId"]) { - this["brandId"] = assign("brandId"); - } - if (args["usecase"]) { - this["usecase"] = assign("usecase"); - } - if (args["description"]) { - this["description"] = assign("description"); - } - if (args["embeddedLink"]) { - this["embeddedLink"] = assign("embeddedLink"); - } - if (args["embeddedPhone"]) { - this["embeddedPhone"] = assign("embeddedPhone"); - } - if (args["affiliateMarketing"]) { - this["affiliateMarketing"] = assign("affiliateMarketing"); - } - if (args["numberPool"]) { - this["numberPool"] = assign("numberPool"); - } - if (args["ageGated"]) { - this["ageGated"] = assign("ageGated"); - } - if (args["directLending"]) { - this["directLending"] = assign("directLending"); - } - if (args["subscriberOptin"]) { - this["subscriberOptin"] = assign("subscriberOptin"); - } - if (args["subscriberOptout"]) { - this["subscriberOptout"] = assign("subscriberOptout"); - } - if (args["subscriberHelp"]) { - this["subscriberHelp"] = assign("subscriberHelp"); - } - if (args["sample1"]) { - this["sample1"] = assign("sample1"); - } - if (args["sample2"]) { - this["sample2"] = assign("sample2"); - } - if (args["sample3"]) { - this["sample3"] = assign("sample3"); - } - if (args["sample4"]) { - this["sample4"] = assign("sample4"); - } - if (args["sample5"]) { - this["sample5"] = assign("sample5"); - } - if (args["messageFlow"]) { - this["messageFlow"] = assign("messageFlow"); - } - if (args["helpMessage"]) { - this["helpMessage"] = assign("helpMessage"); - } - if (args["optinKeywords"]) { - this["optinKeywords"] = assign("optinKeywords"); - } - if (args["optoutKeywords"]) { - this["optoutKeywords"] = assign("optoutKeywords"); - } - if (args["helpKeywords"]) { - this["helpKeywords"] = assign("helpKeywords"); - } - if (args["optinMessage"]) { - this["optinMessage"] = assign("optinMessage"); - } - if (args["optoutMessage"]) { - this["optoutMessage"] = assign("optoutMessage"); - } - if (args["brand"]) { - this["brand"] = assign("brand"); - } + this["accountId"] = assign("accountId"); + this["campaignId"] = assign("campaignId"); + this["status"] = assign("status"); + this["createDate"] = assign("createDate"); + this["brandId"] = assign("brandId"); + this["usecase"] = assign("usecase"); + this["description"] = assign("description"); + this["embeddedLink"] = assign("embeddedLink"); + this["embeddedPhone"] = assign("embeddedPhone"); + this["affiliateMarketing"] = assign("affiliateMarketing"); + this["numberPool"] = assign("numberPool"); + this["ageGated"] = assign("ageGated"); + this["directLending"] = assign("directLending"); + this["subscriberOptin"] = assign("subscriberOptin"); + this["subscriberOptout"] = assign("subscriberOptout"); + this["subscriberHelp"] = assign("subscriberHelp"); + this["sample1"] = assign("sample1"); + this["sample2"] = assign("sample2"); + this["sample3"] = assign("sample3"); + this["sample4"] = assign("sample4"); + this["sample5"] = assign("sample5"); + this["messageFlow"] = assign("messageFlow"); + this["helpMessage"] = assign("helpMessage"); + this["optinKeywords"] = assign("optinKeywords"); + this["optoutKeywords"] = assign("optoutKeywords"); + this["helpKeywords"] = assign("helpKeywords"); + this["optinMessage"] = assign("optinMessage"); + this["optoutMessage"] = assign("optoutMessage"); + this["brand"] = assign("brand"); } } diff --git a/models/SMSTenDLCPartnerCampaignBrand.ts b/models/SMSTenDLCPartnerCampaignBrand.ts index 46b91e5..58dea18 100644 --- a/models/SMSTenDLCPartnerCampaignBrand.ts +++ b/models/SMSTenDLCPartnerCampaignBrand.ts @@ -176,45 +176,26 @@ export class SMSTenDLCPartnerCampaignBrand { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SMSTenDLCPartnerCampaignBrand.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SMSTenDLCPartnerCampaignBrand.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["brandId"]) { - this["brandId"] = assign("brandId"); - } - if (args["firstName"]) { - this["firstName"] = assign("firstName"); - } - if (args["lastName"]) { - this["lastName"] = assign("lastName"); - } - if (args["displayName"]) { - this["displayName"] = assign("displayName"); - } - if (args["companyName"]) { - this["companyName"] = assign("companyName"); - } - if (args["phone"]) { - this["phone"] = assign("phone"); - } - if (args["email"]) { - this["email"] = assign("email"); - } - if (args["website"]) { - this["website"] = assign("website"); - } - if (args["optionalAttributes"]) { - this["optionalAttributes"] = assign<{ [key: string]: any }>( - "optionalAttributes", - ); - } - if (args["evpVettingScore"]) { - this["evpVettingScore"] = assign("evpVettingScore"); - } + this["accountId"] = assign("accountId"); + this["brandId"] = assign("brandId"); + this["firstName"] = assign("firstName"); + this["lastName"] = assign("lastName"); + this["displayName"] = assign("displayName"); + this["companyName"] = assign("companyName"); + this["phone"] = assign("phone"); + this["email"] = assign("email"); + this["website"] = assign("website"); + this["optionalAttributes"] = assign<{ [key: string]: any }>( + "optionalAttributes", + ); + this["evpVettingScore"] = assign("evpVettingScore"); } } diff --git a/models/SMSTenDLCPartnerCampaignsListResult.ts b/models/SMSTenDLCPartnerCampaignsListResult.ts index 6012fd9..88b95e4 100644 --- a/models/SMSTenDLCPartnerCampaignsListResult.ts +++ b/models/SMSTenDLCPartnerCampaignsListResult.ts @@ -135,35 +135,22 @@ export class SMSTenDLCPartnerCampaignsListResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SMSTenDLCPartnerCampaignsListResult.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SMSTenDLCPartnerCampaignsListResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["partnerCampaigns"]) { - this["partnerCampaigns"] = - assign>("partnerCampaigns"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["partnerCampaigns"] = + assign>("partnerCampaigns"); } } diff --git a/models/SMSTollFreeCampaign.ts b/models/SMSTollFreeCampaign.ts index 760ffde..1572a65 100644 --- a/models/SMSTollFreeCampaign.ts +++ b/models/SMSTollFreeCampaign.ts @@ -110,32 +110,21 @@ export class SMSTollFreeCampaign { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SMSTollFreeCampaign.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SMSTollFreeCampaign.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } - if (args["useCase"]) { - this["useCase"] = assign("useCase"); - } - if (args["registrationStatus"]) { - this["registrationStatus"] = - assign("registrationStatus"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } + this["accountId"] = assign("accountId"); + this["campaignId"] = assign("campaignId"); + this["useCase"] = assign("useCase"); + this["registrationStatus"] = + assign("registrationStatus"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["revision"] = assign("revision"); } } diff --git a/models/SMSTollFreeCampaignsListResult.ts b/models/SMSTollFreeCampaignsListResult.ts index 9881305..099c58a 100644 --- a/models/SMSTollFreeCampaignsListResult.ts +++ b/models/SMSTollFreeCampaignsListResult.ts @@ -135,34 +135,21 @@ export class SMSTollFreeCampaignsListResult { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SMSTollFreeCampaignsListResult.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SMSTollFreeCampaignsListResult.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["total"]) { - this["total"] = assign("total"); - } - if (args["start"]) { - this["start"] = assign("start"); - } - if (args["end"]) { - this["end"] = assign("end"); - } - if (args["page"]) { - this["page"] = assign("page"); - } - if (args["numPages"]) { - this["numPages"] = assign("numPages"); - } - if (args["pageSize"]) { - this["pageSize"] = assign("pageSize"); - } - if (args["nextPageUri"]) { - this["nextPageUri"] = assign("nextPageUri"); - } - if (args["brands"]) { - this["brands"] = assign>("brands"); - } + this["total"] = assign("total"); + this["start"] = assign("start"); + this["end"] = assign("end"); + this["page"] = assign("page"); + this["numPages"] = assign("numPages"); + this["pageSize"] = assign("pageSize"); + this["nextPageUri"] = assign("nextPageUri"); + this["brands"] = assign>("brands"); } } diff --git a/models/Say.ts b/models/Say.ts index 0ce8946..e133719 100644 --- a/models/Say.ts +++ b/models/Say.ts @@ -91,21 +91,16 @@ export class Say extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Say" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Say.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Say.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["text"]) { - this["text"] = assign("text"); - } - if (args["language"]) { - this["language"] = assign("language"); - } - if (args["loop"]) { - this["loop"] = assign("loop"); - } - if (args["privacyMode"]) { - this["privacyMode"] = assign("privacyMode"); - } + this["text"] = assign("text"); + this["language"] = assign("language"); + this["loop"] = assign("loop"); + this["privacyMode"] = assign("privacyMode"); } } diff --git a/models/SendDigits.ts b/models/SendDigits.ts index 5ae51d7..ca87ac9 100644 --- a/models/SendDigits.ts +++ b/models/SendDigits.ts @@ -78,18 +78,15 @@ export class SendDigits extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "SendDigits" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SendDigits.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SendDigits.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["digits"]) { - this["digits"] = assign("digits"); - } - if (args["pauseMs"]) { - this["pauseMs"] = assign("pauseMs"); - } - if (args["privacyMode"]) { - this["privacyMode"] = assign("privacyMode"); - } + this["digits"] = assign("digits"); + this["pauseMs"] = assign("pauseMs"); + this["privacyMode"] = assign("privacyMode"); } } diff --git a/models/SetDTMFPassThrough.ts b/models/SetDTMFPassThrough.ts index 8933750..c10cec3 100644 --- a/models/SetDTMFPassThrough.ts +++ b/models/SetDTMFPassThrough.ts @@ -54,13 +54,14 @@ export class SetDTMFPassThrough extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "SetDTMFPassThrough" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SetDTMFPassThrough.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SetDTMFPassThrough.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["dtmfPassThrough"]) { - this["dtmfPassThrough"] = assign("dtmfPassThrough"); - } + this["dtmfPassThrough"] = assign("dtmfPassThrough"); } } diff --git a/models/SetListen.ts b/models/SetListen.ts index 604c325..f6b3faf 100644 --- a/models/SetListen.ts +++ b/models/SetListen.ts @@ -52,12 +52,13 @@ export class SetListen extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "SetListen" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SetListen.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SetListen.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["listen"]) { - this["listen"] = assign("listen"); - } + this["listen"] = assign("listen"); } } diff --git a/models/SetTalk.ts b/models/SetTalk.ts index 8f2cd1a..f16ca4b 100644 --- a/models/SetTalk.ts +++ b/models/SetTalk.ts @@ -52,12 +52,13 @@ export class SetTalk extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "SetTalk" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - SetTalk.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : SetTalk.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["talk"]) { - this["talk"] = assign("talk"); - } + this["talk"] = assign("talk"); } } diff --git a/models/Sms.ts b/models/Sms.ts index b225a7b..868de39 100644 --- a/models/Sms.ts +++ b/models/Sms.ts @@ -91,21 +91,16 @@ export class Sms extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Sms" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Sms.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Sms.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["text"]) { - this["text"] = assign("text"); - } - if (args["notificationUrl"]) { - this["notificationUrl"] = assign("notificationUrl"); - } + this["to"] = assign("to"); + this["from"] = assign("from"); + this["text"] = assign("text"); + this["notificationUrl"] = assign("notificationUrl"); } } diff --git a/models/StartRecordCall.ts b/models/StartRecordCall.ts index 0705795..4a58cbb 100644 --- a/models/StartRecordCall.ts +++ b/models/StartRecordCall.ts @@ -36,9 +36,13 @@ export class StartRecordCall extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "StartRecordCall" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - StartRecordCall.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : StartRecordCall.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; } } diff --git a/models/TFN.ts b/models/TFN.ts index 40c2969..f157097 100644 --- a/models/TFN.ts +++ b/models/TFN.ts @@ -50,12 +50,13 @@ export class TFN { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - TFN.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : TFN.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } + this["campaignId"] = assign("campaignId"); } } diff --git a/models/TFNCampaign.ts b/models/TFNCampaign.ts index 8eaa5ce..e76902d 100644 --- a/models/TFNCampaign.ts +++ b/models/TFNCampaign.ts @@ -130,37 +130,22 @@ export class TFNCampaign { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - TFNCampaign.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : TFNCampaign.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } - if (args["useCase"]) { - this["useCase"] = assign("useCase"); - } - if (args["registrationStatus"]) { - this["registrationStatus"] = - assign("registrationStatus"); - } - if (args["dateCreated"]) { - this["dateCreated"] = assign("dateCreated"); - } - if (args["dateUpdated"]) { - this["dateUpdated"] = assign("dateUpdated"); - } - if (args["dateCreatedISO"]) { - this["dateCreatedISO"] = assign("dateCreatedISO"); - } - if (args["dateUpdatedISO"]) { - this["dateUpdatedISO"] = assign("dateUpdatedISO"); - } - if (args["revision"]) { - this["revision"] = assign("revision"); - } + this["accountId"] = assign("accountId"); + this["campaignId"] = assign("campaignId"); + this["useCase"] = assign("useCase"); + this["registrationStatus"] = + assign("registrationStatus"); + this["dateCreated"] = assign("dateCreated"); + this["dateUpdated"] = assign("dateUpdated"); + this["dateCreatedISO"] = assign("dateCreatedISO"); + this["dateUpdatedISO"] = assign("dateUpdatedISO"); + this["revision"] = assign("revision"); } } diff --git a/models/TerminateConference.ts b/models/TerminateConference.ts index 5608d64..89d762a 100644 --- a/models/TerminateConference.ts +++ b/models/TerminateConference.ts @@ -38,10 +38,13 @@ export class TerminateConference extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "TerminateConference" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - TerminateConference.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : TerminateConference.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; } } diff --git a/models/TranscribeUtterance.ts b/models/TranscribeUtterance.ts index e275521..2da2b00 100644 --- a/models/TranscribeUtterance.ts +++ b/models/TranscribeUtterance.ts @@ -102,28 +102,19 @@ export class TranscribeUtterance extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "TranscribeUtterance" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - TranscribeUtterance.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : TranscribeUtterance.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["actionUrl"]) { - this["actionUrl"] = assign("actionUrl"); - } - if (args["playBeep"]) { - this["playBeep"] = assign("playBeep"); - } - if (args["record"]) { - this["record"] = assign("record"); - } - if (args["privacyForLogging"]) { - this["privacyForLogging"] = assign("privacyForLogging"); - } - if (args["privacyForRecording"]) { - this["privacyForRecording"] = assign("privacyForRecording"); - } - if (args["prompts"]) { - this["prompts"] = assign>("prompts"); - } + this["actionUrl"] = assign("actionUrl"); + this["playBeep"] = assign("playBeep"); + this["record"] = assign("record"); + this["privacyForLogging"] = assign("privacyForLogging"); + this["privacyForRecording"] = assign("privacyForRecording"); + this["prompts"] = assign>("prompts"); } } diff --git a/models/TranscribeUtteranceRecord.ts b/models/TranscribeUtteranceRecord.ts index 2ba84b1..a04d056 100644 --- a/models/TranscribeUtteranceRecord.ts +++ b/models/TranscribeUtteranceRecord.ts @@ -63,21 +63,18 @@ export class TranscribeUtteranceRecord { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - TranscribeUtteranceRecord.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : TranscribeUtteranceRecord.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["saveRecording"]) { - this["saveRecording"] = assign("saveRecording"); - } - if (args["maxLengthSec"]) { - this["maxLengthSec"] = assign("maxLengthSec"); - } - if (args["rcrdTerminationSilenceTimeMs"]) { - this["rcrdTerminationSilenceTimeMs"] = assign( - "rcrdTerminationSilenceTimeMs", - ); - } + this["saveRecording"] = assign("saveRecording"); + this["maxLengthSec"] = assign("maxLengthSec"); + this["rcrdTerminationSilenceTimeMs"] = assign( + "rcrdTerminationSilenceTimeMs", + ); } } diff --git a/models/TranscribeWebhook.ts b/models/TranscribeWebhook.ts index 016e944..f96ab01 100644 --- a/models/TranscribeWebhook.ts +++ b/models/TranscribeWebhook.ts @@ -322,83 +322,38 @@ export class TranscribeWebhook extends Webhook { public constructor(args: ArgumentsType) { super({ requestType: "transcribe" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - TranscribeWebhook.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : TranscribeWebhook.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } - if (args["accountId"]) { - this["accountId"] = assign("accountId"); - } - if (args["callId"]) { - this["callId"] = assign("callId"); - } - if (args["from"]) { - this["from"] = assign("from"); - } - if (args["to"]) { - this["to"] = assign("to"); - } - if (args["recordingId"]) { - this["recordingId"] = assign("recordingId"); - } - if (args["recordingUrl"]) { - this["recordingUrl"] = assign("recordingUrl"); - } - if (args["recordingSize"]) { - this["recordingSize"] = assign("recordingSize"); - } - if (args["recordingFormat"]) { - this["recordingFormat"] = assign("recordingFormat"); - } - if (args["recordingDurationMs"]) { - this["recordingDurationMs"] = assign("recordingDurationMs"); - } - if (args["termReason"]) { - this["termReason"] = assign("termReason"); - } - if (args["recordTermReason"]) { - this["recordTermReason"] = - assign("recordTermReason"); - } - if (args["digit"]) { - this["digit"] = assign("digit"); - } - if (args["privacyForLogging"]) { - this["privacyForLogging"] = assign("privacyForLogging"); - } - if (args["privacyForRecording"]) { - this["privacyForRecording"] = assign("privacyForRecording"); - } - if (args["bargeInReason"]) { - this["bargeInReason"] = assign("bargeInReason"); - } - if (args["bargedInPromptNo"]) { - this["bargedInPromptNo"] = assign("bargedInPromptNo"); - } - if (args["bargedInPromptMs"]) { - this["bargedInPromptMs"] = assign("bargedInPromptMs"); - } - if (args["bargedInPromptLoopNo"]) { - this["bargedInPromptLoopNo"] = assign("bargedInPromptLoopNo"); - } - if (args["bargeInTimeMs"]) { - this["bargeInTimeMs"] = assign("bargeInTimeMs"); - } - if (args["transcript"]) { - this["transcript"] = assign("transcript"); - } - if (args["transcribeReason"]) { - this["transcribeReason"] = assign("transcribeReason"); - } - if (args["transcriptionDurationMs"]) { - this["transcriptionDurationMs"] = assign( - "transcriptionDurationMs", - ); - } + this["requestType"] = assign("requestType"); + this["accountId"] = assign("accountId"); + this["callId"] = assign("callId"); + this["from"] = assign("from"); + this["to"] = assign("to"); + this["recordingId"] = assign("recordingId"); + this["recordingUrl"] = assign("recordingUrl"); + this["recordingSize"] = assign("recordingSize"); + this["recordingFormat"] = assign("recordingFormat"); + this["recordingDurationMs"] = assign("recordingDurationMs"); + this["termReason"] = assign("termReason"); + this["recordTermReason"] = + assign("recordTermReason"); + this["digit"] = assign("digit"); + this["privacyForLogging"] = assign("privacyForLogging"); + this["privacyForRecording"] = assign("privacyForRecording"); + this["bargeInReason"] = assign("bargeInReason"); + this["bargedInPromptNo"] = assign("bargedInPromptNo"); + this["bargedInPromptMs"] = assign("bargedInPromptMs"); + this["bargedInPromptLoopNo"] = assign("bargedInPromptLoopNo"); + this["bargeInTimeMs"] = assign("bargeInTimeMs"); + this["transcript"] = assign("transcript"); + this["transcribeReason"] = assign("transcribeReason"); + this["transcriptionDurationMs"] = assign("transcriptionDurationMs"); } public static deserialize(payload: string): TranscribeWebhook { return new TranscribeWebhook(JSON.parse(payload)); diff --git a/models/Unpark.ts b/models/Unpark.ts index d8ce302..9f17c05 100644 --- a/models/Unpark.ts +++ b/models/Unpark.ts @@ -36,9 +36,12 @@ export class Unpark extends PerclCommand { public constructor(args: ArgumentsType) { super({ command: "Unpark" }); const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Unpark.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Unpark.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; } } diff --git a/models/UpdateCallRequest.ts b/models/UpdateCallRequest.ts index 82be3ab..4ace32b 100644 --- a/models/UpdateCallRequest.ts +++ b/models/UpdateCallRequest.ts @@ -44,13 +44,14 @@ export class UpdateCallRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - UpdateCallRequest.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : UpdateCallRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["status"]) { - this["status"] = assign("status"); - } + this["status"] = assign("status"); } } diff --git a/models/UpdateConferenceParticipantRequest.ts b/models/UpdateConferenceParticipantRequest.ts index 1261b27..f8a164c 100644 --- a/models/UpdateConferenceParticipantRequest.ts +++ b/models/UpdateConferenceParticipantRequest.ts @@ -72,19 +72,16 @@ export class UpdateConferenceParticipantRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - UpdateConferenceParticipantRequest.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : UpdateConferenceParticipantRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["talk"]) { - this["talk"] = assign("talk"); - } - if (args["listen"]) { - this["listen"] = assign("listen"); - } - if (args["dtmfPassThrough"]) { - this["dtmfPassThrough"] = assign("dtmfPassThrough"); - } + this["talk"] = assign("talk"); + this["listen"] = assign("listen"); + this["dtmfPassThrough"] = assign("dtmfPassThrough"); } } diff --git a/models/UpdateConferenceRequest.ts b/models/UpdateConferenceRequest.ts index 69ad439..604b8ed 100644 --- a/models/UpdateConferenceRequest.ts +++ b/models/UpdateConferenceRequest.ts @@ -68,19 +68,16 @@ export class UpdateConferenceRequest { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - UpdateConferenceRequest.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : UpdateConferenceRequest.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue + ) as T; }; - if (args["alias"]) { - this["alias"] = assign("alias"); - } - if (args["playBeep"]) { - this["playBeep"] = assign("playBeep"); - } - if (args["status"]) { - this["status"] = assign("status"); - } + this["alias"] = assign("alias"); + this["playBeep"] = assign("playBeep"); + this["status"] = assign("status"); } } diff --git a/models/Webhook.ts b/models/Webhook.ts index cb728af..560349b 100644 --- a/models/Webhook.ts +++ b/models/Webhook.ts @@ -46,12 +46,13 @@ export class Webhook { } public constructor(args: ArgumentsType) { const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - Webhook.attributeTypeMap.find((attr) => attr.name === attribute) - ?.defaultValue) as T; + return ( + args.hasOwnProperty(attribute) + ? args[attribute] + : Webhook.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue + ) as T; }; - if (args["requestType"]) { - this["requestType"] = assign("requestType"); - } + this["requestType"] = assign("requestType"); } } diff --git a/package.json b/package.json index 9a80aae..fc6737b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@freeclimb/sdk", - "version": "4.1.1", + "version": "4.1.2", "description": "OpenAPI client for @freeclimb/sdk", "author": "OpenAPI-Generator Contributors", "keywords": [ @@ -46,7 +46,7 @@ }, "devDependencies": { "@babel/preset-env": "^7.19.3", - "@stoplight/prism-cli": "5.6.0", + "@stoplight/prism-cli": "5.14.2", "@types/jest": "^29.0.3", "@types/qs": "^6.9.7", "jest": "^29.0.0", diff --git a/yarn.lock b/yarn.lock index a016285..9381454 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,243 +10,248 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.25.9", "@babel/code-frame@^7.26.0", "@babel/code-frame@^7.26.2": - version "7.26.2" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85" - integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.27.1.tgz#200f715e66d52a23b221a9435534a91cc13ad5be" + integrity sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg== dependencies: - "@babel/helper-validator-identifier" "^7.25.9" + "@babel/helper-validator-identifier" "^7.27.1" js-tokens "^4.0.0" - picocolors "^1.0.0" + picocolors "^1.1.1" -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.25.9", "@babel/compat-data@^7.26.0": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.3.tgz#99488264a56b2aded63983abd6a417f03b92ed02" - integrity sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g== +"@babel/compat-data@^7.27.2", "@babel/compat-data@^7.27.7", "@babel/compat-data@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.0.tgz#9fc6fd58c2a6a15243cd13983224968392070790" + integrity sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw== "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40" - integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.0.tgz#55dad808d5bf3445a108eefc88ea3fdf034749a4" + integrity sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.26.0" - "@babel/generator" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helpers" "^7.26.0" - "@babel/parser" "^7.26.0" - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.26.0" + "@babel/code-frame" "^7.27.1" + "@babel/generator" "^7.28.0" + "@babel/helper-compilation-targets" "^7.27.2" + "@babel/helper-module-transforms" "^7.27.3" + "@babel/helpers" "^7.27.6" + "@babel/parser" "^7.28.0" + "@babel/template" "^7.27.2" + "@babel/traverse" "^7.28.0" + "@babel/types" "^7.28.0" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.26.0", "@babel/generator@^7.26.3", "@babel/generator@^7.7.2": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.26.3.tgz#ab8d4360544a425c90c248df7059881f4b2ce019" - integrity sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ== +"@babel/generator@^7.28.0", "@babel/generator@^7.7.2": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.0.tgz#9cc2f7bd6eb054d77dc66c2664148a0c5118acd2" + integrity sha512-lJjzvrbEeWrhB4P3QBsH7tey117PjLZnDbLiQEKjQ/fNJTjuq4HSqgFA+UNSwZT8D7dxxbnuSBMsa1lrWzKlQg== dependencies: - "@babel/parser" "^7.26.3" - "@babel/types" "^7.26.3" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" + "@babel/parser" "^7.28.0" + "@babel/types" "^7.28.0" + "@jridgewell/gen-mapping" "^0.3.12" + "@jridgewell/trace-mapping" "^0.3.28" jsesc "^3.0.2" -"@babel/helper-annotate-as-pure@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" - integrity sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== +"@babel/helper-annotate-as-pure@^7.27.1", "@babel/helper-annotate-as-pure@^7.27.3": + version "7.27.3" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz#f31fd86b915fc4daf1f3ac6976c59be7084ed9c5" + integrity sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg== dependencies: - "@babel/types" "^7.25.9" + "@babel/types" "^7.27.3" -"@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" - integrity sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ== +"@babel/helper-compilation-targets@^7.27.1", "@babel/helper-compilation-targets@^7.27.2": + version "7.27.2" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz#46a0f6efab808d51d29ce96858dd10ce8732733d" + integrity sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ== dependencies: - "@babel/compat-data" "^7.25.9" - "@babel/helper-validator-option" "^7.25.9" + "@babel/compat-data" "^7.27.2" + "@babel/helper-validator-option" "^7.27.1" browserslist "^4.24.0" lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-create-class-features-plugin@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" - integrity sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - "@babel/helper-member-expression-to-functions" "^7.25.9" - "@babel/helper-optimise-call-expression" "^7.25.9" - "@babel/helper-replace-supers" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" - "@babel/traverse" "^7.25.9" +"@babel/helper-create-class-features-plugin@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.1.tgz#5bee4262a6ea5ddc852d0806199eb17ca3de9281" + integrity sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A== + dependencies: + "@babel/helper-annotate-as-pure" "^7.27.1" + "@babel/helper-member-expression-to-functions" "^7.27.1" + "@babel/helper-optimise-call-expression" "^7.27.1" + "@babel/helper-replace-supers" "^7.27.1" + "@babel/helper-skip-transparent-expression-wrappers" "^7.27.1" + "@babel/traverse" "^7.27.1" semver "^6.3.1" -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.25.9": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.26.3.tgz#5169756ecbe1d95f7866b90bb555b022595302a0" - integrity sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong== +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.27.1.tgz#05b0882d97ba1d4d03519e4bce615d70afa18c53" + integrity sha512-uVDC72XVf8UbrH5qQTc18Agb8emwjTiZrQE11Nv3CuBEZmVvTwwE9CBUEvHku06gQCAyYf8Nv6ja1IN+6LMbxQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" + "@babel/helper-annotate-as-pure" "^7.27.1" regexpu-core "^6.2.0" semver "^6.3.1" -"@babel/helper-define-polyfill-provider@^0.6.2", "@babel/helper-define-polyfill-provider@^0.6.3": - version "0.6.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz#f4f2792fae2ef382074bc2d713522cf24e6ddb21" - integrity sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg== +"@babel/helper-define-polyfill-provider@^0.6.5": + version "0.6.5" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.5.tgz#742ccf1cb003c07b48859fc9fa2c1bbe40e5f753" + integrity sha512-uJnGFcPsWQK8fvjgGP5LZUZZsYGIoPeRjSF5PGwrelYgq7Q15/Ft9NGFp1zglwgIv//W0uG4BevRuSJRyylZPg== dependencies: - "@babel/helper-compilation-targets" "^7.22.6" - "@babel/helper-plugin-utils" "^7.22.5" - debug "^4.1.1" + "@babel/helper-compilation-targets" "^7.27.2" + "@babel/helper-plugin-utils" "^7.27.1" + debug "^4.4.1" lodash.debounce "^4.0.8" - resolve "^1.14.2" - -"@babel/helper-member-expression-to-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" - integrity sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helper-module-imports@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" - integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helper-module-transforms@^7.25.9", "@babel/helper-module-transforms@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz#8ce54ec9d592695e58d84cd884b7b5c6a2fdeeae" - integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== - dependencies: - "@babel/helper-module-imports" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/traverse" "^7.25.9" + resolve "^1.22.10" + +"@babel/helper-globals@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" + integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== + +"@babel/helper-member-expression-to-functions@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.27.1.tgz#ea1211276be93e798ce19037da6f06fbb994fa44" + integrity sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA== + dependencies: + "@babel/traverse" "^7.27.1" + "@babel/types" "^7.27.1" + +"@babel/helper-module-imports@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz#7ef769a323e2655e126673bb6d2d6913bbead204" + integrity sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w== + dependencies: + "@babel/traverse" "^7.27.1" + "@babel/types" "^7.27.1" + +"@babel/helper-module-transforms@^7.27.1", "@babel/helper-module-transforms@^7.27.3": + version "7.27.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz#db0bbcfba5802f9ef7870705a7ef8788508ede02" + integrity sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg== + dependencies: + "@babel/helper-module-imports" "^7.27.1" + "@babel/helper-validator-identifier" "^7.27.1" + "@babel/traverse" "^7.27.3" + +"@babel/helper-optimise-call-expression@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz#c65221b61a643f3e62705e5dd2b5f115e35f9200" + integrity sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw== + dependencies: + "@babel/types" "^7.27.1" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.27.1", "@babel/helper-plugin-utils@^7.8.0": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz#ddb2f876534ff8013e6c2b299bf4d39b3c51d44c" + integrity sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw== + +"@babel/helper-remap-async-to-generator@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.27.1.tgz#4601d5c7ce2eb2aea58328d43725523fcd362ce6" + integrity sha512-7fiA521aVw8lSPeI4ZOD3vRFkoqkJcS+z4hFo82bFSH/2tNd6eJ5qCVMS5OzDmZh/kaHQeBaeyxK6wljcPtveA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.27.1" + "@babel/helper-wrap-function" "^7.27.1" + "@babel/traverse" "^7.27.1" + +"@babel/helper-replace-supers@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.27.1.tgz#b1ed2d634ce3bdb730e4b52de30f8cccfd692bc0" + integrity sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.27.1" + "@babel/helper-optimise-call-expression" "^7.27.1" + "@babel/traverse" "^7.27.1" + +"@babel/helper-skip-transparent-expression-wrappers@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz#62bb91b3abba8c7f1fec0252d9dbea11b3ee7a56" + integrity sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg== + dependencies: + "@babel/traverse" "^7.27.1" + "@babel/types" "^7.27.1" + +"@babel/helper-string-parser@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" + integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== + +"@babel/helper-validator-identifier@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8" + integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow== + +"@babel/helper-validator-option@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" + integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== + +"@babel/helper-wrap-function@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.27.1.tgz#b88285009c31427af318d4fe37651cd62a142409" + integrity sha512-NFJK2sHUvrjo8wAU/nQTWU890/zB2jj0qBcCbZbbf+005cAsv6tMjXz31fBign6M5ov1o0Bllu+9nbqkfsjjJQ== + dependencies: + "@babel/template" "^7.27.1" + "@babel/traverse" "^7.27.1" + "@babel/types" "^7.27.1" + +"@babel/helpers@^7.27.6": + version "7.27.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.27.6.tgz#6456fed15b2cb669d2d1fabe84b66b34991d812c" + integrity sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug== + dependencies: + "@babel/template" "^7.27.2" + "@babel/types" "^7.27.6" -"@babel/helper-optimise-call-expression@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz#3324ae50bae7e2ab3c33f60c9a877b6a0146b54e" - integrity sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ== - dependencies: - "@babel/types" "^7.25.9" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" - integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== - -"@babel/helper-remap-async-to-generator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz#e53956ab3d5b9fb88be04b3e2f31b523afd34b92" - integrity sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.27.2", "@babel/parser@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.0.tgz#979829fbab51a29e13901e5a80713dbcb840825e" + integrity sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g== dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - "@babel/helper-wrap-function" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/helper-replace-supers@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz#ba447224798c3da3f8713fc272b145e33da6a5c5" - integrity sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ== + "@babel/types" "^7.28.0" + +"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.27.1.tgz#61dd8a8e61f7eb568268d1b5f129da3eee364bf9" + integrity sha512-QPG3C9cCVRQLxAVwmefEmwdTanECuUBMQZ/ym5kiw3XKCGA7qkuQLcjWWHcrD/GKbn/WmJwaezfuuAOcyKlRPA== dependencies: - "@babel/helper-member-expression-to-functions" "^7.25.9" - "@babel/helper-optimise-call-expression" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/helper-skip-transparent-expression-wrappers@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz#0b2e1b62d560d6b1954893fd2b705dc17c91f0c9" - integrity sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA== + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/traverse" "^7.27.1" + +"@babel/plugin-bugfix-safari-class-field-initializer-scope@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.27.1.tgz#43f70a6d7efd52370eefbdf55ae03d91b293856d" + integrity sha512-qNeq3bCKnGgLkEXUuFry6dPlGfCdQNZbn7yUAPCInwAJHMU7THJfrBSozkcWq5sNM6RcF3S8XyQL2A52KNR9IA== dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helper-string-parser@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" - integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + "@babel/helper-plugin-utils" "^7.27.1" + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.27.1.tgz#beb623bd573b8b6f3047bd04c32506adc3e58a72" + integrity sha512-g4L7OYun04N1WyqMNjldFwlfPCLVkgB54A/YCXICZYBsvJJE3kByKv9c9+R/nAfmIfjl2rKYLNyMHboYbZaWaA== + dependencies: + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/helper-validator-identifier@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" - integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== - -"@babel/helper-validator-option@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz#86e45bd8a49ab7e03f276577f96179653d41da72" - integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== - -"@babel/helper-wrap-function@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz#d99dfd595312e6c894bd7d237470025c85eea9d0" - integrity sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g== - dependencies: - "@babel/template" "^7.25.9" - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helpers@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.26.0.tgz#30e621f1eba5aa45fe6f4868d2e9154d884119a4" - integrity sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.27.1.tgz#e134a5479eb2ba9c02714e8c1ebf1ec9076124fd" + integrity sha512-oO02gcONcD5O1iTLi/6frMJBIwWEHceWGSGqrpCmEL8nogiS6J9PBlE48CaK20/Jx1LuRml9aDftLgdjXT8+Cw== dependencies: - "@babel/template" "^7.25.9" - "@babel/types" "^7.26.0" - -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.25.9", "@babel/parser@^7.26.0", "@babel/parser@^7.26.3": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.3.tgz#8c51c5db6ddf08134af1ddbacf16aaab48bac234" - integrity sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA== - dependencies: - "@babel/types" "^7.26.3" - -"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.9.tgz#cc2e53ebf0a0340777fff5ed521943e253b4d8fe" - integrity sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/plugin-bugfix-safari-class-field-initializer-scope@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.9.tgz#af9e4fb63ccb8abcb92375b2fcfe36b60c774d30" - integrity sha512-MrGRLZxLD/Zjj0gdU15dfs+HH/OXvnw/U4jJD8vpcP2CJQapPEv1IWwjc/qMg7ItBlPwSv1hRBbb7LeuANdcnw== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz#e8dc26fcd616e6c5bf2bd0d5a2c151d4f92a9137" - integrity sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz#807a667f9158acac6f6164b4beb85ad9ebc9e1d1" - integrity sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" - "@babel/plugin-transform-optional-chaining" "^7.25.9" - -"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz#de7093f1e7deaf68eadd7cc6b07f2ab82543269e" - integrity sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/traverse" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-skip-transparent-expression-wrappers" "^7.27.1" + "@babel/plugin-transform-optional-chaining" "^7.27.1" + +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.27.1.tgz#bb1c25af34d75115ce229a1de7fa44bf8f955670" + integrity sha512-6BpaYGDavZqkI6yT+KSPdpZFfpnd68UKXbcjI9pJ13pvHhPrCKWOOLp+ysvMeA+DxnhuPpgIaRpxRxo5A9t5jw== + dependencies: + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/traverse" "^7.27.1" "@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": version "7.21.0-placeholder-for-preset-env.2" @@ -281,19 +286,19 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-import-assertions@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz#620412405058efa56e4a564903b79355020f445f" - integrity sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg== +"@babel/plugin-syntax-import-assertions@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.27.1.tgz#88894aefd2b03b5ee6ad1562a7c8e1587496aecd" + integrity sha512-UT/Jrhw57xg4ILHLFnzFpPDlMbcdEicaAtjPQpbj9wa8T4r5KVWCimHcL/460g8Ht0DMxDyjsLgiWSkVjnwPFg== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-syntax-import-attributes@^7.24.7", "@babel/plugin-syntax-import-attributes@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz#3b1412847699eea739b4f2602c74ce36f6b0b0f7" - integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== +"@babel/plugin-syntax-import-attributes@^7.24.7", "@babel/plugin-syntax-import-attributes@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz#34c017d54496f9b11b61474e7ea3dfd5563ffe07" + integrity sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" @@ -310,11 +315,11 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz#a34313a178ea56f1951599b929c1ceacee719290" - integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz#2f9beb5eff30fa507c5532d107daac7b888fa34c" + integrity sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" @@ -373,11 +378,11 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz#67dda2b74da43727cf21d46cf9afef23f4365399" - integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz#5147d29066a793450f220c63fa3a9431b7e6dd18" + integrity sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" "@babel/plugin-syntax-unicode-sets-regex@^7.18.6": version "7.18.6" @@ -387,466 +392,477 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-arrow-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz#7821d4410bee5daaadbb4cdd9a6649704e176845" - integrity sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg== +"@babel/plugin-transform-arrow-functions@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.27.1.tgz#6e2061067ba3ab0266d834a9f94811196f2aba9a" + integrity sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA== + dependencies: + "@babel/helper-plugin-utils" "^7.27.1" + +"@babel/plugin-transform-async-generator-functions@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.28.0.tgz#1276e6c7285ab2cd1eccb0bc7356b7a69ff842c2" + integrity sha512-BEOdvX4+M765icNPZeidyADIvQ1m1gmunXufXxvRESy/jNNyfovIqUyE7MVgGBjWktCoJlzvFA1To2O4ymIO3Q== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-remap-async-to-generator" "^7.27.1" + "@babel/traverse" "^7.28.0" -"@babel/plugin-transform-async-generator-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz#1b18530b077d18a407c494eb3d1d72da505283a2" - integrity sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw== +"@babel/plugin-transform-async-to-generator@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.27.1.tgz#9a93893b9379b39466c74474f55af03de78c66e7" + integrity sha512-NREkZsZVJS4xmTr8qzE5y8AfIPqsdQfRuUiLRTEzb7Qii8iFWCyDKaUV2c0rCuh4ljDZ98ALHP/PetiBV2nddA== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-remap-async-to-generator" "^7.25.9" - "@babel/traverse" "^7.25.9" + "@babel/helper-module-imports" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-remap-async-to-generator" "^7.27.1" -"@babel/plugin-transform-async-to-generator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz#c80008dacae51482793e5a9c08b39a5be7e12d71" - integrity sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ== +"@babel/plugin-transform-block-scoped-functions@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.27.1.tgz#558a9d6e24cf72802dd3b62a4b51e0d62c0f57f9" + integrity sha512-cnqkuOtZLapWYZUYM5rVIdv1nXYuFVIltZ6ZJ7nIj585QsjKM5dhL2Fu/lICXZ1OyIAFc7Qy+bvDAtTXqGrlhg== dependencies: - "@babel/helper-module-imports" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-remap-async-to-generator" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-block-scoped-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.9.tgz#5700691dbd7abb93de300ca7be94203764fce458" - integrity sha512-toHc9fzab0ZfenFpsyYinOX0J/5dgJVA2fm64xPewu7CoYHWEivIWKxkK2rMi4r3yQqLnVmheMXRdG+k239CgA== +"@babel/plugin-transform-block-scoping@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.28.0.tgz#e7c50cbacc18034f210b93defa89638666099451" + integrity sha512-gKKnwjpdx5sER/wl0WN0efUBFzF/56YZO0RJrSYP4CljXnP31ByY7fol89AzomdlLNzI36AvOTmYHsnZTCkq8Q== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-block-scoping@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz#c33665e46b06759c93687ca0f84395b80c0473a1" - integrity sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg== +"@babel/plugin-transform-class-properties@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.27.1.tgz#dd40a6a370dfd49d32362ae206ddaf2bb082a925" + integrity sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-class-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-class-properties@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.9.tgz#a8ce84fedb9ad512549984101fa84080a9f5f51f" - integrity sha512-bbMAII8GRSkcd0h0b4X+36GksxuheLFjP65ul9w6C3KgAamI3JqErNgSrosX6ZPj+Mpim5VvEbawXxJCyEUV3Q== +"@babel/plugin-transform-class-static-block@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.27.1.tgz#7e920d5625b25bbccd3061aefbcc05805ed56ce4" + integrity sha512-s734HmYU78MVzZ++joYM+NkJusItbdRcbm+AGRgJCt3iA+yux0QpD9cBVdz3tKyrjVYWRl7j0mHSmv4lhV0aoA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-class-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-class-static-block@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz#6c8da219f4eb15cae9834ec4348ff8e9e09664a0" - integrity sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ== +"@babel/plugin-transform-classes@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.28.0.tgz#12fa46cffc32a6e084011b650539e880add8a0f8" + integrity sha512-IjM1IoJNw72AZFlj33Cu8X0q2XK/6AaVC3jQu+cgQ5lThWD5ajnuUAml80dqRmOhmPkTH8uAwnpMu9Rvj0LTRA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-annotate-as-pure" "^7.27.3" + "@babel/helper-compilation-targets" "^7.27.2" + "@babel/helper-globals" "^7.28.0" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-replace-supers" "^7.27.1" + "@babel/traverse" "^7.28.0" -"@babel/plugin-transform-classes@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz#7152457f7880b593a63ade8a861e6e26a4469f52" - integrity sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg== +"@babel/plugin-transform-computed-properties@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.27.1.tgz#81662e78bf5e734a97982c2b7f0a793288ef3caa" + integrity sha512-lj9PGWvMTVksbWiDT2tW68zGS/cyo4AkZ/QTp0sQT0mjPopCmrSkzxeXkznjqBxzDI6TclZhOJbBmbBLjuOZUw== dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-replace-supers" "^7.25.9" - "@babel/traverse" "^7.25.9" - globals "^11.1.0" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/template" "^7.27.1" -"@babel/plugin-transform-computed-properties@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz#db36492c78460e534b8852b1d5befe3c923ef10b" - integrity sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA== +"@babel/plugin-transform-destructuring@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.28.0.tgz#0f156588f69c596089b7d5b06f5af83d9aa7f97a" + integrity sha512-v1nrSMBiKcodhsyJ4Gf+Z0U/yawmJDBOTpEB3mcQY52r9RIyPneGyAS/yM6seP/8I+mWI3elOMtT5dB8GJVs+A== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/template" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/traverse" "^7.28.0" -"@babel/plugin-transform-destructuring@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz#966ea2595c498224340883602d3cfd7a0c79cea1" - integrity sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ== +"@babel/plugin-transform-dotall-regex@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.27.1.tgz#aa6821de864c528b1fecf286f0a174e38e826f4d" + integrity sha512-gEbkDVGRvjj7+T1ivxrfgygpT7GUd4vmODtYpbs0gZATdkX8/iSnOtZSxiZnsgm1YjTgjI6VKBGSJJevkrclzw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-regexp-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-dotall-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz#bad7945dd07734ca52fe3ad4e872b40ed09bb09a" - integrity sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA== +"@babel/plugin-transform-duplicate-keys@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.27.1.tgz#f1fbf628ece18e12e7b32b175940e68358f546d1" + integrity sha512-MTyJk98sHvSs+cvZ4nOauwTTG1JeonDjSGvGGUNHreGQns+Mpt6WX/dVzWBHgg+dYZhkC4X+zTDfkTU+Vy9y7Q== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-duplicate-keys@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz#8850ddf57dce2aebb4394bb434a7598031059e6d" - integrity sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw== +"@babel/plugin-transform-duplicate-named-capturing-groups-regex@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.27.1.tgz#5043854ca620a94149372e69030ff8cb6a9eb0ec" + integrity sha512-hkGcueTEzuhB30B3eJCbCYeCaaEQOmQR0AdvzpD4LoN0GXMWzzGSuRrxR2xTnCrvNbVwK9N6/jQ92GSLfiZWoQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-regexp-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-duplicate-named-capturing-groups-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.9.tgz#6f7259b4de127721a08f1e5165b852fcaa696d31" - integrity sha512-0UfuJS0EsXbRvKnwcLjFtJy/Sxc5J5jhLHnFhy7u4zih97Hz6tJkLU+O+FMMrNZrosUPxDi6sYxJ/EA8jDiAog== +"@babel/plugin-transform-dynamic-import@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.27.1.tgz#4c78f35552ac0e06aa1f6e3c573d67695e8af5a4" + integrity sha512-MHzkWQcEmjzzVW9j2q8LGjwGWpG2mjwaaB0BNQwst3FIjqsg8Ct/mIZlvSPJvfi9y2AC8mi/ktxbFVL9pZ1I4A== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-dynamic-import@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz#23e917de63ed23c6600c5dd06d94669dce79f7b8" - integrity sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg== +"@babel/plugin-transform-explicit-resource-management@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-explicit-resource-management/-/plugin-transform-explicit-resource-management-7.28.0.tgz#45be6211b778dbf4b9d54c4e8a2b42fa72e09a1a" + integrity sha512-K8nhUcn3f6iB+P3gwCv/no7OdzOZQcKchW6N389V6PD8NUWKZHzndOd9sPDVbMoBsbmjMqlB4L9fm+fEFNVlwQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/plugin-transform-destructuring" "^7.28.0" -"@babel/plugin-transform-exponentiation-operator@^7.25.9": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz#e29f01b6de302c7c2c794277a48f04a9ca7f03bc" - integrity sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ== +"@babel/plugin-transform-exponentiation-operator@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.27.1.tgz#fc497b12d8277e559747f5a3ed868dd8064f83e1" + integrity sha512-uspvXnhHvGKf2r4VVtBpeFnuDWsJLQ6MF6lGJLC89jBR1uoVeqM416AZtTuhTezOfgHicpJQmoD5YUakO/YmXQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-export-namespace-from@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz#90745fe55053394f554e40584cda81f2c8a402a2" - integrity sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww== +"@babel/plugin-transform-export-namespace-from@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.27.1.tgz#71ca69d3471edd6daa711cf4dfc3400415df9c23" + integrity sha512-tQvHWSZ3/jH2xuq/vZDy0jNn+ZdXJeM8gHvX4lnJmsc3+50yPlWdZXIc5ay+umX+2/tJIqHqiEqcJvxlmIvRvQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-for-of@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz#4bdc7d42a213397905d89f02350c5267866d5755" - integrity sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A== +"@babel/plugin-transform-for-of@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.27.1.tgz#bc24f7080e9ff721b63a70ac7b2564ca15b6c40a" + integrity sha512-BfbWFFEJFQzLCQ5N8VocnCtA8J1CLkNTe2Ms2wocj75dd6VpiqS5Z5quTYcUoo4Yq+DN0rtikODccuv7RU81sw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-skip-transparent-expression-wrappers" "^7.27.1" -"@babel/plugin-transform-function-name@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz#939d956e68a606661005bfd550c4fc2ef95f7b97" - integrity sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA== +"@babel/plugin-transform-function-name@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.27.1.tgz#4d0bf307720e4dce6d7c30fcb1fd6ca77bdeb3a7" + integrity sha512-1bQeydJF9Nr1eBCMMbC+hdwmRlsv5XYOMu03YSWFwNs0HsAmtSxxF1fyuYPqemVldVyFmlCU7w8UE14LupUSZQ== dependencies: - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/traverse" "^7.25.9" + "@babel/helper-compilation-targets" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/traverse" "^7.27.1" -"@babel/plugin-transform-json-strings@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz#c86db407cb827cded902a90c707d2781aaa89660" - integrity sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw== +"@babel/plugin-transform-json-strings@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.27.1.tgz#a2e0ce6ef256376bd527f290da023983527a4f4c" + integrity sha512-6WVLVJiTjqcQauBhn1LkICsR2H+zm62I3h9faTDKt1qP4jn2o72tSvqMwtGFKGTpojce0gJs+76eZ2uCHRZh0Q== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz#1a1c6b4d4aa59bc4cad5b6b3a223a0abd685c9de" - integrity sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ== +"@babel/plugin-transform-literals@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.27.1.tgz#baaefa4d10a1d4206f9dcdda50d7d5827bb70b24" + integrity sha512-0HCFSepIpLTkLcsi86GG3mTUzxV5jpmbv97hTETW3yzrAij8aqlD36toB1D0daVFJM8NK6GvKO0gslVQmm+zZA== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-logical-assignment-operators@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz#b19441a8c39a2fda0902900b306ea05ae1055db7" - integrity sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q== +"@babel/plugin-transform-logical-assignment-operators@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.27.1.tgz#890cb20e0270e0e5bebe3f025b434841c32d5baa" + integrity sha512-SJvDs5dXxiae4FbSL1aBJlG4wvl594N6YEVVn9e3JGulwioy6z3oPjx/sQBO3Y4NwUu5HNix6KJ3wBZoewcdbw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-member-expression-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz#63dff19763ea64a31f5e6c20957e6a25e41ed5de" - integrity sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA== +"@babel/plugin-transform-member-expression-literals@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.27.1.tgz#37b88ba594d852418e99536f5612f795f23aeaf9" + integrity sha512-hqoBX4dcZ1I33jCSWcXrP+1Ku7kdqXf1oeah7ooKOIiAdKQ+uqftgCFNOSzA5AMS2XIHEYeGFg4cKRCdpxzVOQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-modules-amd@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz#49ba478f2295101544abd794486cd3088dddb6c5" - integrity sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw== +"@babel/plugin-transform-modules-amd@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.27.1.tgz#a4145f9d87c2291fe2d05f994b65dba4e3e7196f" + integrity sha512-iCsytMg/N9/oFq6n+gFTvUYDZQOMK5kEdeYxmxt91fcJGycfxVP9CnrxoliM0oumFERba2i8ZtwRUCMhvP1LnA== dependencies: - "@babel/helper-module-transforms" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-module-transforms" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-modules-commonjs@^7.25.9": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz#8f011d44b20d02c3de44d8850d971d8497f981fb" - integrity sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ== +"@babel/plugin-transform-modules-commonjs@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.27.1.tgz#8e44ed37c2787ecc23bdc367f49977476614e832" + integrity sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw== dependencies: - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-module-transforms" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-modules-systemjs@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz#8bd1b43836269e3d33307151a114bcf3ba6793f8" - integrity sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA== +"@babel/plugin-transform-modules-systemjs@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.27.1.tgz#00e05b61863070d0f3292a00126c16c0e024c4ed" + integrity sha512-w5N1XzsRbc0PQStASMksmUeqECuzKuTJer7kFagK8AXgpCMkeDMO5S+aaFb7A51ZYDF7XI34qsTX+fkHiIm5yA== dependencies: - "@babel/helper-module-transforms" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/traverse" "^7.25.9" + "@babel/helper-module-transforms" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-validator-identifier" "^7.27.1" + "@babel/traverse" "^7.27.1" -"@babel/plugin-transform-modules-umd@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz#6710079cdd7c694db36529a1e8411e49fcbf14c9" - integrity sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw== +"@babel/plugin-transform-modules-umd@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.27.1.tgz#63f2cf4f6dc15debc12f694e44714863d34cd334" + integrity sha512-iQBE/xC5BV1OxJbp6WG7jq9IWiD+xxlZhLrdwpPkTX3ydmXdvoCpyfJN7acaIBZaOqTfr76pgzqBJflNbeRK+w== dependencies: - "@babel/helper-module-transforms" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-module-transforms" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-named-capturing-groups-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz#454990ae6cc22fd2a0fa60b3a2c6f63a38064e6a" - integrity sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA== +"@babel/plugin-transform-named-capturing-groups-regex@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.27.1.tgz#f32b8f7818d8fc0cc46ee20a8ef75f071af976e1" + integrity sha512-SstR5JYy8ddZvD6MhV0tM/j16Qds4mIpJTOd1Yu9J9pJjH93bxHECF7pgtc28XvkzTD6Pxcm/0Z73Hvk7kb3Ng== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-regexp-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-new-target@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz#42e61711294b105c248336dcb04b77054ea8becd" - integrity sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ== +"@babel/plugin-transform-new-target@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.27.1.tgz#259c43939728cad1706ac17351b7e6a7bea1abeb" + integrity sha512-f6PiYeqXQ05lYq3TIfIDu/MtliKUbNwkGApPUvyo6+tc7uaR4cPjPe7DFPr15Uyycg2lZU6btZ575CuQoYh7MQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-nullish-coalescing-operator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.9.tgz#bcb1b0d9e948168102d5f7104375ca21c3266949" - integrity sha512-ENfftpLZw5EItALAD4WsY/KUWvhUlZndm5GC7G3evUsVeSJB6p0pBeLQUnRnBCBx7zV0RKQjR9kCuwrsIrjWog== +"@babel/plugin-transform-nullish-coalescing-operator@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.27.1.tgz#4f9d3153bf6782d73dd42785a9d22d03197bc91d" + integrity sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-numeric-separator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz#bfed75866261a8b643468b0ccfd275f2033214a1" - integrity sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q== +"@babel/plugin-transform-numeric-separator@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.27.1.tgz#614e0b15cc800e5997dadd9bd6ea524ed6c819c6" + integrity sha512-fdPKAcujuvEChxDBJ5c+0BTaS6revLV7CJL08e4m3de8qJfNIuCc2nc7XJYOjBoTMJeqSmwXJ0ypE14RCjLwaw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-object-rest-spread@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.9.tgz#0203725025074164808bcf1a2cfa90c652c99f18" - integrity sha512-fSaXafEE9CVHPweLYw4J0emp1t8zYTXyzN3UuG+lylqkvYd7RMrsOQ8TYx5RF231be0vqtFC6jnx3UmpJmKBYg== +"@babel/plugin-transform-object-rest-spread@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.28.0.tgz#d23021857ffd7cd809f54d624299b8086402ed8d" + integrity sha512-9VNGikXxzu5eCiQjdE4IZn8sb9q7Xsk5EXLDBKUYg1e/Tve8/05+KJEtcxGxAgCY5t/BpKQM+JEL/yT4tvgiUA== dependencies: - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/plugin-transform-parameters" "^7.25.9" + "@babel/helper-compilation-targets" "^7.27.2" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/plugin-transform-destructuring" "^7.28.0" + "@babel/plugin-transform-parameters" "^7.27.7" + "@babel/traverse" "^7.28.0" -"@babel/plugin-transform-object-super@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz#385d5de135162933beb4a3d227a2b7e52bb4cf03" - integrity sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A== +"@babel/plugin-transform-object-super@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.27.1.tgz#1c932cd27bf3874c43a5cac4f43ebf970c9871b5" + integrity sha512-SFy8S9plRPbIcxlJ8A6mT/CxFdJx/c04JEctz4jf8YZaVS2px34j7NXRrlGlHkN/M2gnpL37ZpGRGVFLd3l8Ng== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-replace-supers" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-replace-supers" "^7.27.1" -"@babel/plugin-transform-optional-catch-binding@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz#10e70d96d52bb1f10c5caaac59ac545ea2ba7ff3" - integrity sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g== +"@babel/plugin-transform-optional-catch-binding@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.27.1.tgz#84c7341ebde35ccd36b137e9e45866825072a30c" + integrity sha512-txEAEKzYrHEX4xSZN4kJ+OfKXFVSWKB2ZxM9dpcE3wT7smwkNmXo5ORRlVzMVdJbD+Q8ILTgSD7959uj+3Dm3Q== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-optional-chaining@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz#e142eb899d26ef715435f201ab6e139541eee7dd" - integrity sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A== +"@babel/plugin-transform-optional-chaining@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.27.1.tgz#874ce3c4f06b7780592e946026eb76a32830454f" + integrity sha512-BQmKPPIuc8EkZgNKsv0X4bPmOoayeu4F1YCwx2/CfmDSXDbp7GnzlUH+/ul5VGfRg1AoFPsrIThlEBj2xb4CAg== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-skip-transparent-expression-wrappers" "^7.27.1" -"@babel/plugin-transform-parameters@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz#b856842205b3e77e18b7a7a1b94958069c7ba257" - integrity sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g== +"@babel/plugin-transform-parameters@^7.27.7": + version "7.27.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.27.7.tgz#1fd2febb7c74e7d21cf3b05f7aebc907940af53a" + integrity sha512-qBkYTYCb76RRxUM6CcZA5KRu8K4SM8ajzVeUgVdMVO9NN9uI/GaVmBg/WKJJGnNokV9SY8FxNOVWGXzqzUidBg== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-private-methods@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz#847f4139263577526455d7d3223cd8bda51e3b57" - integrity sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw== +"@babel/plugin-transform-private-methods@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.27.1.tgz#fdacbab1c5ed81ec70dfdbb8b213d65da148b6af" + integrity sha512-10FVt+X55AjRAYI9BrdISN9/AQWHqldOeZDUoLyif1Kn05a56xVBXb8ZouL8pZ9jem8QpXaOt8TS7RHUIS+GPA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-class-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-private-property-in-object@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz#9c8b73e64e6cc3cbb2743633885a7dd2c385fe33" - integrity sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw== +"@babel/plugin-transform-private-property-in-object@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.27.1.tgz#4dbbef283b5b2f01a21e81e299f76e35f900fb11" + integrity sha512-5J+IhqTi1XPa0DXF83jYOaARrX+41gOewWbkPyjMNRDqgOCqdffGh8L3f/Ek5utaEBZExjSAzcyjmV9SSAWObQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - "@babel/helper-create-class-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-annotate-as-pure" "^7.27.1" + "@babel/helper-create-class-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-property-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz#d72d588bd88b0dec8b62e36f6fda91cedfe28e3f" - integrity sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA== +"@babel/plugin-transform-property-literals@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.27.1.tgz#07eafd618800591e88073a0af1b940d9a42c6424" + integrity sha512-oThy3BCuCha8kDZ8ZkgOg2exvPYUlprMukKQXI1r1pJ47NCvxfkEy8vK+r/hT9nF0Aa4H1WUPZZjHTFtAhGfmQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-regenerator@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz#03a8a4670d6cebae95305ac6defac81ece77740b" - integrity sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg== +"@babel/plugin-transform-regenerator@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.28.0.tgz#f19ca3558f7121924fc4ba6cd2afe3a5cdac89b1" + integrity sha512-LOAozRVbqxEVjSKfhGnuLoE4Kz4Oc5UJzuvFUhSsQzdCdaAQu06mG8zDv2GFSerM62nImUZ7K92vxnQcLSDlCQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - regenerator-transform "^0.15.2" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-regexp-modifiers@^7.26.0": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.26.0.tgz#2f5837a5b5cd3842a919d8147e9903cc7455b850" - integrity sha512-vN6saax7lrA2yA/Pak3sCxuD6F5InBjn9IcrIKQPjpsLvuHYLVroTxjdlVRHjjBWxKOqIwpTXDkOssYT4BFdRw== +"@babel/plugin-transform-regexp-modifiers@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.27.1.tgz#df9ba5577c974e3f1449888b70b76169998a6d09" + integrity sha512-TtEciroaiODtXvLZv4rmfMhkCv8jx3wgKpL68PuiPh2M4fvz5jhsA7697N1gMvkvr/JTF13DrFYyEbY9U7cVPA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-regexp-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-reserved-words@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz#0398aed2f1f10ba3f78a93db219b27ef417fb9ce" - integrity sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg== +"@babel/plugin-transform-reserved-words@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.27.1.tgz#40fba4878ccbd1c56605a4479a3a891ac0274bb4" + integrity sha512-V2ABPHIJX4kC7HegLkYoDpfg9PVmuWy/i6vUM5eGK22bx4YVFD3M5F0QQnWQoDs6AGsUWTVOopBiMFQgHaSkVw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-shorthand-properties@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz#bb785e6091f99f826a95f9894fc16fde61c163f2" - integrity sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng== +"@babel/plugin-transform-shorthand-properties@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.27.1.tgz#532abdacdec87bfee1e0ef8e2fcdee543fe32b90" + integrity sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-spread@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz#24a35153931b4ba3d13cec4a7748c21ab5514ef9" - integrity sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A== +"@babel/plugin-transform-spread@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.27.1.tgz#1a264d5fc12750918f50e3fe3e24e437178abb08" + integrity sha512-kpb3HUqaILBJcRFVhFUs6Trdd4mkrzcGXss+6/mxUd273PfbWqSDHRzMT2234gIg2QYfAjvXLSquP1xECSg09Q== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-skip-transparent-expression-wrappers" "^7.27.1" -"@babel/plugin-transform-sticky-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz#c7f02b944e986a417817b20ba2c504dfc1453d32" - integrity sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA== +"@babel/plugin-transform-sticky-regex@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.27.1.tgz#18984935d9d2296843a491d78a014939f7dcd280" + integrity sha512-lhInBO5bi/Kowe2/aLdBAawijx+q1pQzicSgnkB6dUPc1+RC8QmJHKf2OjvU+NZWitguJHEaEmbV6VWEouT58g== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-template-literals@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz#6dbd4a24e8fad024df76d1fac6a03cf413f60fe1" - integrity sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw== +"@babel/plugin-transform-template-literals@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.27.1.tgz#1a0eb35d8bb3e6efc06c9fd40eb0bcef548328b8" + integrity sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-typeof-symbol@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.9.tgz#224ba48a92869ddbf81f9b4a5f1204bbf5a2bc4b" - integrity sha512-v61XqUMiueJROUv66BVIOi0Fv/CUuZuZMl5NkRoCVxLAnMexZ0A3kMe7vvZ0nulxMuMp0Mk6S5hNh48yki08ZA== +"@babel/plugin-transform-typeof-symbol@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.27.1.tgz#70e966bb492e03509cf37eafa6dcc3051f844369" + integrity sha512-RiSILC+nRJM7FY5srIyc4/fGIwUhyDuuBSdWn4y6yT6gm652DpCHZjIipgn6B7MQ1ITOUnAKWixEUjQRIBIcLw== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-unicode-escapes@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz#a75ef3947ce15363fccaa38e2dd9bc70b2788b82" - integrity sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q== +"@babel/plugin-transform-unicode-escapes@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.27.1.tgz#3e3143f8438aef842de28816ece58780190cf806" + integrity sha512-Ysg4v6AmF26k9vpfFuTZg8HRfVWzsh1kVfowA23y9j/Gu6dOuahdUVhkLqpObp3JIv27MLSii6noRnuKN8H0Mg== dependencies: - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-unicode-property-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz#a901e96f2c1d071b0d1bb5dc0d3c880ce8f53dd3" - integrity sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg== +"@babel/plugin-transform-unicode-property-regex@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.27.1.tgz#bdfe2d3170c78c5691a3c3be934c8c0087525956" + integrity sha512-uW20S39PnaTImxp39O5qFlHLS9LJEmANjMG7SxIhap8rCHqu0Ik+tLEPX5DKmHn6CsWQ7j3lix2tFOa5YtL12Q== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-regexp-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-unicode-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz#5eae747fe39eacf13a8bd006a4fb0b5d1fa5e9b1" - integrity sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA== +"@babel/plugin-transform-unicode-regex@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.27.1.tgz#25948f5c395db15f609028e370667ed8bae9af97" + integrity sha512-xvINq24TRojDuyt6JGtHmkVkrfVV3FPT16uytxImLeBZqW3/H52yN+kM1MGuyPkIQxrzKwPHs5U/MP3qKyzkGw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-regexp-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-unicode-sets-regex@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz#65114c17b4ffc20fa5b163c63c70c0d25621fabe" - integrity sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ== +"@babel/plugin-transform-unicode-sets-regex@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.27.1.tgz#6ab706d10f801b5c72da8bb2548561fa04193cd1" + integrity sha512-EtkOujbc4cgvb0mlpQefi4NTPBzhSIevblFevACNLUspmrALgmEBdL/XfnyyITfd8fKBZrZys92zOWcik7j9Tw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" + "@babel/helper-create-regexp-features-plugin" "^7.27.1" + "@babel/helper-plugin-utils" "^7.27.1" "@babel/preset-env@^7.19.3": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.26.0.tgz#30e5c6bc1bcc54865bff0c5a30f6d4ccdc7fa8b1" - integrity sha512-H84Fxq0CQJNdPFT2DrfnylZ3cf5K43rGfWK4LJGPpjKHiZlk0/RzwEus3PDDZZg+/Er7lCA03MVacueUuXdzfw== - dependencies: - "@babel/compat-data" "^7.26.0" - "@babel/helper-compilation-targets" "^7.25.9" - "@babel/helper-plugin-utils" "^7.25.9" - "@babel/helper-validator-option" "^7.25.9" - "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.25.9" - "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.25.9" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.25.9" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.25.9" - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.25.9" + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.28.0.tgz#d23a6bc17b43227d11db77081a0779c706b5569c" + integrity sha512-VmaxeGOwuDqzLl5JUkIRM1X2Qu2uKGxHEQWh+cvvbl7JuJRgKGJSfsEF/bUaxFhJl/XAyxBe7q7qSuTbKFuCyg== + dependencies: + "@babel/compat-data" "^7.28.0" + "@babel/helper-compilation-targets" "^7.27.2" + "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-validator-option" "^7.27.1" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.27.1" + "@babel/plugin-bugfix-safari-class-field-initializer-scope" "^7.27.1" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.27.1" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.27.1" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.27.1" "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" - "@babel/plugin-syntax-import-assertions" "^7.26.0" - "@babel/plugin-syntax-import-attributes" "^7.26.0" + "@babel/plugin-syntax-import-assertions" "^7.27.1" + "@babel/plugin-syntax-import-attributes" "^7.27.1" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" - "@babel/plugin-transform-arrow-functions" "^7.25.9" - "@babel/plugin-transform-async-generator-functions" "^7.25.9" - "@babel/plugin-transform-async-to-generator" "^7.25.9" - "@babel/plugin-transform-block-scoped-functions" "^7.25.9" - "@babel/plugin-transform-block-scoping" "^7.25.9" - "@babel/plugin-transform-class-properties" "^7.25.9" - "@babel/plugin-transform-class-static-block" "^7.26.0" - "@babel/plugin-transform-classes" "^7.25.9" - "@babel/plugin-transform-computed-properties" "^7.25.9" - "@babel/plugin-transform-destructuring" "^7.25.9" - "@babel/plugin-transform-dotall-regex" "^7.25.9" - "@babel/plugin-transform-duplicate-keys" "^7.25.9" - "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.25.9" - "@babel/plugin-transform-dynamic-import" "^7.25.9" - "@babel/plugin-transform-exponentiation-operator" "^7.25.9" - "@babel/plugin-transform-export-namespace-from" "^7.25.9" - "@babel/plugin-transform-for-of" "^7.25.9" - "@babel/plugin-transform-function-name" "^7.25.9" - "@babel/plugin-transform-json-strings" "^7.25.9" - "@babel/plugin-transform-literals" "^7.25.9" - "@babel/plugin-transform-logical-assignment-operators" "^7.25.9" - "@babel/plugin-transform-member-expression-literals" "^7.25.9" - "@babel/plugin-transform-modules-amd" "^7.25.9" - "@babel/plugin-transform-modules-commonjs" "^7.25.9" - "@babel/plugin-transform-modules-systemjs" "^7.25.9" - "@babel/plugin-transform-modules-umd" "^7.25.9" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.25.9" - "@babel/plugin-transform-new-target" "^7.25.9" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.25.9" - "@babel/plugin-transform-numeric-separator" "^7.25.9" - "@babel/plugin-transform-object-rest-spread" "^7.25.9" - "@babel/plugin-transform-object-super" "^7.25.9" - "@babel/plugin-transform-optional-catch-binding" "^7.25.9" - "@babel/plugin-transform-optional-chaining" "^7.25.9" - "@babel/plugin-transform-parameters" "^7.25.9" - "@babel/plugin-transform-private-methods" "^7.25.9" - "@babel/plugin-transform-private-property-in-object" "^7.25.9" - "@babel/plugin-transform-property-literals" "^7.25.9" - "@babel/plugin-transform-regenerator" "^7.25.9" - "@babel/plugin-transform-regexp-modifiers" "^7.26.0" - "@babel/plugin-transform-reserved-words" "^7.25.9" - "@babel/plugin-transform-shorthand-properties" "^7.25.9" - "@babel/plugin-transform-spread" "^7.25.9" - "@babel/plugin-transform-sticky-regex" "^7.25.9" - "@babel/plugin-transform-template-literals" "^7.25.9" - "@babel/plugin-transform-typeof-symbol" "^7.25.9" - "@babel/plugin-transform-unicode-escapes" "^7.25.9" - "@babel/plugin-transform-unicode-property-regex" "^7.25.9" - "@babel/plugin-transform-unicode-regex" "^7.25.9" - "@babel/plugin-transform-unicode-sets-regex" "^7.25.9" + "@babel/plugin-transform-arrow-functions" "^7.27.1" + "@babel/plugin-transform-async-generator-functions" "^7.28.0" + "@babel/plugin-transform-async-to-generator" "^7.27.1" + "@babel/plugin-transform-block-scoped-functions" "^7.27.1" + "@babel/plugin-transform-block-scoping" "^7.28.0" + "@babel/plugin-transform-class-properties" "^7.27.1" + "@babel/plugin-transform-class-static-block" "^7.27.1" + "@babel/plugin-transform-classes" "^7.28.0" + "@babel/plugin-transform-computed-properties" "^7.27.1" + "@babel/plugin-transform-destructuring" "^7.28.0" + "@babel/plugin-transform-dotall-regex" "^7.27.1" + "@babel/plugin-transform-duplicate-keys" "^7.27.1" + "@babel/plugin-transform-duplicate-named-capturing-groups-regex" "^7.27.1" + "@babel/plugin-transform-dynamic-import" "^7.27.1" + "@babel/plugin-transform-explicit-resource-management" "^7.28.0" + "@babel/plugin-transform-exponentiation-operator" "^7.27.1" + "@babel/plugin-transform-export-namespace-from" "^7.27.1" + "@babel/plugin-transform-for-of" "^7.27.1" + "@babel/plugin-transform-function-name" "^7.27.1" + "@babel/plugin-transform-json-strings" "^7.27.1" + "@babel/plugin-transform-literals" "^7.27.1" + "@babel/plugin-transform-logical-assignment-operators" "^7.27.1" + "@babel/plugin-transform-member-expression-literals" "^7.27.1" + "@babel/plugin-transform-modules-amd" "^7.27.1" + "@babel/plugin-transform-modules-commonjs" "^7.27.1" + "@babel/plugin-transform-modules-systemjs" "^7.27.1" + "@babel/plugin-transform-modules-umd" "^7.27.1" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.27.1" + "@babel/plugin-transform-new-target" "^7.27.1" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.27.1" + "@babel/plugin-transform-numeric-separator" "^7.27.1" + "@babel/plugin-transform-object-rest-spread" "^7.28.0" + "@babel/plugin-transform-object-super" "^7.27.1" + "@babel/plugin-transform-optional-catch-binding" "^7.27.1" + "@babel/plugin-transform-optional-chaining" "^7.27.1" + "@babel/plugin-transform-parameters" "^7.27.7" + "@babel/plugin-transform-private-methods" "^7.27.1" + "@babel/plugin-transform-private-property-in-object" "^7.27.1" + "@babel/plugin-transform-property-literals" "^7.27.1" + "@babel/plugin-transform-regenerator" "^7.28.0" + "@babel/plugin-transform-regexp-modifiers" "^7.27.1" + "@babel/plugin-transform-reserved-words" "^7.27.1" + "@babel/plugin-transform-shorthand-properties" "^7.27.1" + "@babel/plugin-transform-spread" "^7.27.1" + "@babel/plugin-transform-sticky-regex" "^7.27.1" + "@babel/plugin-transform-template-literals" "^7.27.1" + "@babel/plugin-transform-typeof-symbol" "^7.27.1" + "@babel/plugin-transform-unicode-escapes" "^7.27.1" + "@babel/plugin-transform-unicode-property-regex" "^7.27.1" + "@babel/plugin-transform-unicode-regex" "^7.27.1" + "@babel/plugin-transform-unicode-sets-regex" "^7.27.1" "@babel/preset-modules" "0.1.6-no-external-plugins" - babel-plugin-polyfill-corejs2 "^0.4.10" - babel-plugin-polyfill-corejs3 "^0.10.6" - babel-plugin-polyfill-regenerator "^0.6.1" - core-js-compat "^3.38.1" + babel-plugin-polyfill-corejs2 "^0.4.14" + babel-plugin-polyfill-corejs3 "^0.13.0" + babel-plugin-polyfill-regenerator "^0.6.5" + core-js-compat "^3.43.0" semver "^6.3.1" "@babel/preset-modules@0.1.6-no-external-plugins": @@ -858,42 +874,35 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/runtime@^7.8.4": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" - integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/template@^7.25.9", "@babel/template@^7.3.3": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" - integrity sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg== - dependencies: - "@babel/code-frame" "^7.25.9" - "@babel/parser" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/traverse@^7.25.9": - version "7.26.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.26.4.tgz#ac3a2a84b908dde6d463c3bfa2c5fdc1653574bd" - integrity sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w== - dependencies: - "@babel/code-frame" "^7.26.2" - "@babel/generator" "^7.26.3" - "@babel/parser" "^7.26.3" - "@babel/template" "^7.25.9" - "@babel/types" "^7.26.3" +"@babel/template@^7.27.1", "@babel/template@^7.27.2", "@babel/template@^7.3.3": + version "7.27.2" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.27.2.tgz#fa78ceed3c4e7b63ebf6cb39e5852fca45f6809d" + integrity sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw== + dependencies: + "@babel/code-frame" "^7.27.1" + "@babel/parser" "^7.27.2" + "@babel/types" "^7.27.1" + +"@babel/traverse@^7.27.1", "@babel/traverse@^7.27.3", "@babel/traverse@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.0.tgz#518aa113359b062042379e333db18380b537e34b" + integrity sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg== + dependencies: + "@babel/code-frame" "^7.27.1" + "@babel/generator" "^7.28.0" + "@babel/helper-globals" "^7.28.0" + "@babel/parser" "^7.28.0" + "@babel/template" "^7.27.2" + "@babel/types" "^7.28.0" debug "^4.3.1" - globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.9", "@babel/types@^7.26.0", "@babel/types@^7.26.3", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.26.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.3.tgz#37e79830f04c2b5687acc77db97fbc75fb81f3c0" - integrity sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.27.1", "@babel/types@^7.27.3", "@babel/types@^7.27.6", "@babel/types@^7.28.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.0.tgz#2fd0159a6dc7353933920c43136335a9b264d950" + integrity sha512-jYnje+JyZG5YThjHiF28oT4SIZLnYOcSBb6+SDaFIyzDVSkXQmQQYclJ2R+YxcdmK0AX6x1E5OQNtuh3jHDrUg== dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" + "@babel/helper-string-parser" "^7.27.1" + "@babel/helper-validator-identifier" "^7.27.1" "@bcoe/v8-coverage@^0.2.3": version "0.2.3" @@ -1118,13 +1127,12 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.3.5": - version "0.3.8" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz#4f0e06362e01362f823d348f1872b08f666d8142" - integrity sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA== +"@jridgewell/gen-mapping@^0.3.12", "@jridgewell/gen-mapping@^0.3.5": + version "0.3.12" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.12.tgz#2234ce26c62889f03db3d7fea43c1932ab3e927b" + integrity sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg== dependencies: - "@jridgewell/set-array" "^1.2.1" - "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/sourcemap-codec" "^1.5.0" "@jridgewell/trace-mapping" "^0.3.24" "@jridgewell/resolve-uri@^3.1.0": @@ -1132,20 +1140,15 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== -"@jridgewell/set-array@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" - integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== +"@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.4" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz#7358043433b2e5da569aa02cbc4c121da3af27d7" + integrity sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw== -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" - integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== - -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": - version "0.3.25" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.28": + version "0.3.29" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.29.tgz#a58d31eaadaf92c6695680b2e1d464a9b8fbf7fc" + integrity sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ== dependencies: "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" @@ -1184,7 +1187,7 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@stoplight/http-spec@^7.0.2", "@stoplight/http-spec@^7.0.3": +"@stoplight/http-spec@^7.0.3": version "7.1.0" resolved "https://registry.yarnpkg.com/@stoplight/http-spec/-/http-spec-7.1.0.tgz#516fec5f4b08cc93dadfb4969a6f9616165b0553" integrity sha512-Z2XqKX2SV8a1rrgSzFqccX2TolfcblT+l4pNvUU+THaLl50tKDoeidwWWZTzYUzqU0+UV97ponvqEbWWN3PaXg== @@ -1265,33 +1268,33 @@ resolved "https://registry.yarnpkg.com/@stoplight/path/-/path-1.3.2.tgz#96e591496b72fde0f0cdae01a61d64f065bd9ede" integrity sha512-lyIc6JUlUA8Ve5ELywPC8I2Sdnh1zc1zmbYgVarhXIp9YeAB0ReeqmGEOWNtlHkbP2DAA1AL65Wfn2ncjK/jtQ== -"@stoplight/prism-cli@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@stoplight/prism-cli/-/prism-cli-5.6.0.tgz#fc6590936eb290bf60bfe289eb6ac3b3366c2031" - integrity sha512-BCCeWKjmjtFDQQv0qCATIE3L0HtnQQa3tUNvcMoCfZWIEe2McSGZkudckBsmGFfv6xycUrTkHSI/HNxhKYp5fg== +"@stoplight/prism-cli@5.14.2": + version "5.14.2" + resolved "https://registry.yarnpkg.com/@stoplight/prism-cli/-/prism-cli-5.14.2.tgz#4729662fddb08f4ce03a7ccb98817f368e3940e1" + integrity sha512-S/x47zQa7NgoGAD0Q1JlijV7GRDd1zP/FcIpxSh+cJRUUImfALJJm1R3ONLweP97oG/b9BrwRyC+0GNYuzrviw== dependencies: - "@stoplight/http-spec" "^7.0.2" - "@stoplight/json" "^3.18.1" + "@stoplight/json" "3.21.7" "@stoplight/json-schema-ref-parser" "9.2.7" - "@stoplight/prism-core" "^5.6.0" - "@stoplight/prism-http" "^5.6.0" - "@stoplight/prism-http-server" "^5.6.0" + "@stoplight/prism-core" "^5.8.0" + "@stoplight/prism-http" "5.12.0" + "@stoplight/prism-http-server" "^5.12.0" "@stoplight/types" "^14.1.0" chalk "^4.1.2" chokidar "^3.5.2" fp-ts "^2.11.5" - json-schema-faker "0.5.3" + json-schema-faker "0.5.8" + jsonrepair "^3.12.0" lodash "^4.17.21" node-fetch "^2.6.5" pino "^6.13.3" signale "^1.4.0" - split2 "^3.2.2" + split2 "^4.2.0" tslib "^2.3.1" uri-template-lite "^22.9.0" urijs "^1.19.11" yargs "^16.2.0" -"@stoplight/prism-core@^5.6.0", "@stoplight/prism-core@^5.8.0": +"@stoplight/prism-core@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@stoplight/prism-core/-/prism-core-5.8.0.tgz#850917e1c45bfcd92012b3b235d20e3087600372" integrity sha512-fmH7n6e0thzOGcD5uZBu/Xx1iFNfpc9ACTxPie+lFD54SJ214M2FIFXD7kV+NCFlC+w5OFw+lJRaYM859uMnAg== @@ -1301,10 +1304,10 @@ pino "^6.13.3" tslib "^2.3.1" -"@stoplight/prism-http-server@^5.6.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@stoplight/prism-http-server/-/prism-http-server-5.12.0.tgz#c1fdc86bcb7d42d3420b9b84f05f9ae8977bc953" - integrity sha512-rnACUB950kvgDGXk1MsVk1v8nAZNCRaxdrTlACoJpQA0qzF8eBszYikoDsVmx2BbGsOrCC/49+nQc+HyFFpMdQ== +"@stoplight/prism-http-server@^5.12.0": + version "5.12.2" + resolved "https://registry.yarnpkg.com/@stoplight/prism-http-server/-/prism-http-server-5.12.2.tgz#d8de94f6b3506b464a5c89ff049b1e0fc9822ef9" + integrity sha512-h7MpOuv/WPvf4MhQmXw3CygAZp64Ts0SOM4BdoafcgAOJZyvRAOjUNJeelGJsHYdPK0aB9NZsqsaKBtNfkYj+A== dependencies: "@stoplight/prism-core" "^5.8.0" "@stoplight/prism-http" "^5.12.0" @@ -1319,7 +1322,7 @@ tslib "^2.3.1" type-is "^1.6.18" -"@stoplight/prism-http@^5.12.0", "@stoplight/prism-http@^5.6.0": +"@stoplight/prism-http@5.12.0", "@stoplight/prism-http@^5.12.0": version "5.12.0" resolved "https://registry.yarnpkg.com/@stoplight/prism-http/-/prism-http-5.12.0.tgz#b763292c5044e9213b558cbc44e5a2187cfffea4" integrity sha512-H+B/SO4SgQ6DT3CHIDCMQFGOe48Yecj0Eu+6rXwrs5m1JFyA2nlDwz+r73QJLGQanN4Biod2s0V9pZRcs2JnPA== @@ -1410,9 +1413,9 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.8" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.8.tgz#f836c61f48b1346e7d2b0d93c6dacc5b9535d3ab" - integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== + version "7.27.0" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.27.0.tgz#b5819294c51179957afaec341442f9341e4108a9" + integrity sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg== dependencies: "@babel/types" "^7.0.0" @@ -1425,9 +1428,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.20.6" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.6.tgz#8dc9f0ae0f202c08d8d4dab648912c8d6038e3f7" - integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== + version "7.20.7" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.7.tgz#968cdc2366ec3da159f61166428ee40f370e56c2" + integrity sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng== dependencies: "@babel/types" "^7.20.7" @@ -1484,16 +1487,16 @@ form-data "^4.0.0" "@types/node@*": - version "22.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.5.tgz#95af89a3fb74a2bb41ef9927f206e6472026e48b" - integrity sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ== + version "24.0.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.0.10.tgz#f65a169779bf0d70203183a1890be7bee8ca2ddb" + integrity sha512-ENHwaH+JIRTDIEEbDK6QSQntAYGtbvdDXnMXnZaZ6k13Du1dPMmprkEHIL7ok2Wl2aZevetwTAb5S+7yIF+enA== dependencies: - undici-types "~6.20.0" + undici-types "~7.8.0" "@types/qs@^6.9.7": - version "6.9.17" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.17.tgz#fc560f60946d0aeff2f914eb41679659d3310e1a" - integrity sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ== + version "6.14.0" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.14.0.tgz#d8b60cecf62f2db0fb68e5e006077b9178b85de5" + integrity sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ== "@types/stack-utils@^2.0.0": version "2.0.3" @@ -1506,9 +1509,9 @@ integrity sha512-T92Xav+Gf/Ik1uPW581nA+JftmjWPgskw/WBf4TJzxRG/SJ+DfNnNE+WuZ4mrXuzflQMqMkm1LSYjzYW7MB1Cg== "@types/type-is@^1.6.3": - version "1.6.6" - resolved "https://registry.yarnpkg.com/@types/type-is/-/type-is-1.6.6.tgz#0adeafa0d6879f0ce17c81228d487270e8b80d7d" - integrity sha512-fs1KHv/f9OvmTMsu4sBNaUu32oyda9Y9uK25naJG8gayxNrfqGIjPQsbLIYyfe7xFkppnPlJB+BuTldOaX9bXw== + version "1.6.7" + resolved "https://registry.yarnpkg.com/@types/type-is/-/type-is-1.6.7.tgz#4d7934d2c795749800e767cd9af7ffbd4f16cf1c" + integrity sha512-gEsh7n8824nusZ2Sidh6POxNsIdTSvIAl5gXbeFj+TUaD1CO2r4i7MQYNMfEQkChU42s2bVWAda6x6BzIhtFbQ== dependencies: "@types/node" "*" @@ -1656,29 +1659,29 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" -babel-plugin-polyfill-corejs2@^0.4.10: - version "0.4.12" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.12.tgz#ca55bbec8ab0edeeef3d7b8ffd75322e210879a9" - integrity sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og== +babel-plugin-polyfill-corejs2@^0.4.14: + version "0.4.14" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.14.tgz#8101b82b769c568835611542488d463395c2ef8f" + integrity sha512-Co2Y9wX854ts6U8gAAPXfn0GmAyctHuK8n0Yhfjd6t30g7yvKjspvvOo9yG+z52PZRgFErt7Ka2pYnXCjLKEpg== dependencies: - "@babel/compat-data" "^7.22.6" - "@babel/helper-define-polyfill-provider" "^0.6.3" + "@babel/compat-data" "^7.27.7" + "@babel/helper-define-polyfill-provider" "^0.6.5" semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.10.6: - version "0.10.6" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz#2deda57caef50f59c525aeb4964d3b2f867710c7" - integrity sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA== +babel-plugin-polyfill-corejs3@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.13.0.tgz#bb7f6aeef7addff17f7602a08a6d19a128c30164" + integrity sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A== dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.2" - core-js-compat "^3.38.0" + "@babel/helper-define-polyfill-provider" "^0.6.5" + core-js-compat "^3.43.0" -babel-plugin-polyfill-regenerator@^0.6.1: - version "0.6.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.3.tgz#abeb1f3f1c762eace37587f42548b08b57789bc8" - integrity sha512-LiWSbl4CRSIa5x/JAU6jZiG9eit9w6mz+yVMFwDE83LAWvt0AfGBoZ7HS/mkhrKuh2ZlzfVZYKoLjXdqw6Yt7Q== +babel-plugin-polyfill-regenerator@^0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.5.tgz#32752e38ab6f6767b92650347bf26a31b16ae8c5" + integrity sha512-ISqQ2frbiNU9vIJkzg7dlPpznPZ4jOiUQ1uSmB0fEHeowtN3COYRsXr/xexn64NpU13P06jc/L5TgiJXOgrbEg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.3" + "@babel/helper-define-polyfill-provider" "^0.6.5" babel-preset-current-node-syntax@^1.0.0: version "1.1.0" @@ -1725,17 +1728,17 @@ bluebird@*: integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + version "1.1.12" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" + integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + version "2.0.2" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7" + integrity sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ== dependencies: balanced-match "^1.0.0" @@ -1746,15 +1749,15 @@ braces@^3.0.3, braces@~3.0.2: dependencies: fill-range "^7.1.1" -browserslist@^4.24.0, browserslist@^4.24.3: - version "4.24.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" - integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== +browserslist@^4.24.0, browserslist@^4.25.0: + version "4.25.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.25.1.tgz#ba9e8e6f298a1d86f829c9b975e07948967bb111" + integrity sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw== dependencies: - caniuse-lite "^1.0.30001688" - electron-to-chromium "^1.5.73" + caniuse-lite "^1.0.30001726" + electron-to-chromium "^1.5.173" node-releases "^2.0.19" - update-browserslist-db "^1.1.1" + update-browserslist-db "^1.1.3" bs-logger@^0.2.6: version "0.2.6" @@ -1780,21 +1783,21 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -call-bind-apply-helpers@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz#32e5892e6361b29b0b545ba6f7763378daca2840" - integrity sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g== +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== dependencies: es-errors "^1.3.0" function-bind "^1.1.2" call-bound@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.3.tgz#41cfd032b593e39176a71533ab4f384aa04fd681" - integrity sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA== + version "1.0.4" + resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" + integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== dependencies: - call-bind-apply-helpers "^1.0.1" - get-intrinsic "^1.2.6" + call-bind-apply-helpers "^1.0.2" + get-intrinsic "^1.3.0" call-me-maybe@^1.0.1: version "1.0.2" @@ -1816,10 +1819,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001688: - version "1.0.30001690" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz#f2d15e3aaf8e18f76b2b8c1481abde063b8104c8" - integrity sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w== +caniuse-lite@^1.0.30001726: + version "1.0.30001726" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001726.tgz#a15bd87d5a4bf01f6b6f70ae7c97fdfd28b5ae47" + integrity sha512-VQAUIUzBiZ/UnlM28fSp2CRF3ivUn1BWEvxMcVTNwpw91Py1pGbPIyIKtd+tzct9C3ouceCVdGAXxZOpZAsgdw== caseless@^0.12.0: version "0.12.0" @@ -1874,9 +1877,9 @@ ci-info@^3.2.0: integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== cjs-module-lexer@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz#707413784dbb3a72aa11c2f2b042a0bef4004170" - integrity sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA== + version "1.4.3" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz#0f79731eb8cfe1ec72acd4066efac9d61991b00d" + integrity sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q== cliui@^7.0.2: version "7.0.4" @@ -1930,7 +1933,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -combined-stream@^1.0.6, combined-stream@^1.0.8: +combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -1971,12 +1974,12 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -core-js-compat@^3.38.0, core-js-compat@^3.38.1: - version "3.40.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.40.0.tgz#7485912a5a4a4315c2fdb2cbdc623e6881c88b38" - integrity sha512-0XEDpr5y5mijvw8Lbc6E5AkjrHfp7eEoPlu36SWeAbcL8fn1G1ANe8DBlo2XoNN89oVpxWwOjYIPVzR4ZvsKCQ== +core-js-compat@^3.43.0: + version "3.43.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.43.0.tgz#055587369c458795ef316f65e0aabb808fb15840" + integrity sha512-2GML2ZsCc5LR7hZYz4AXmjQw8zuy2T//2QntwdnpuYI7jteT6GVYJL7F6C2C57R7gSYrcqVW3lAALefdbhBLDA== dependencies: - browserslist "^4.24.3" + browserslist "^4.25.0" create-jest@^29.7.0: version "29.7.0" @@ -2012,17 +2015,17 @@ crypto@^1.0.1: resolved "https://registry.yarnpkg.com/crypto/-/crypto-1.0.1.tgz#2af1b7cad8175d24c8a1b0778255794a21803037" integrity sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig== -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: - version "4.4.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" - integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.4.1: + version "4.4.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.1.tgz#e5a8bc6cbc4c6cd3e64308b0693a3d4fa550189b" + integrity sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ== dependencies: ms "^2.1.3" dedent@^1.0.0: - version "1.5.3" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.3.tgz#99aee19eb9bae55a67327717b6e848d0bf777e5a" - integrity sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ== + version "1.6.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.6.0.tgz#79d52d6389b1ffa67d2bcef59ba51847a9d503b2" + integrity sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA== deepmerge@^4.2.2: version "4.3.1" @@ -2060,10 +2063,10 @@ ejs@^3.1.10: dependencies: jake "^10.8.5" -electron-to-chromium@^1.5.73: - version "1.5.79" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.79.tgz#4424f23f319db7a653cf9ee76102e4ac283e6b3e" - integrity sha512-nYOxJNxQ9Om4EC88BE4pPoNI8xwSFf8pU/BAeOl4Hh/b/i6V4biTAzwV7pXi3ARKeoYO5JZKMIXTryXSVer5RA== +electron-to-chromium@^1.5.173: + version "1.5.179" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.179.tgz#453d53f360014a2604d40ccd41c4ea0a6e31b99a" + integrity sha512-UWKi/EbBopgfFsc5k61wFpV7WrnnSlSzW/e2XcBmS6qKYTivZlLtoll5/rdqRTxGglGHkmkW0j0pFNJG10EUIQ== emittery@^0.13.1: version "0.13.1" @@ -2092,13 +2095,23 @@ es-errors@^1.3.0: resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -es-object-atoms@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz#ddb55cd47ac2e240701260bc2a8e31ecb643d941" - integrity sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw== +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== dependencies: es-errors "^1.3.0" +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + es6-promise@^4.2.4: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" @@ -2181,16 +2194,16 @@ fast-safe-stringify@^2.0.8: integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== fast-uri@^3.0.1: - version "3.0.5" - resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.5.tgz#19f5f9691d0dab9b85861a7bb5d98fca961da9cd" - integrity sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q== + version "3.0.6" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.6.tgz#88f130b77cfaea2378d56bf970dea21257a68748" + integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw== fast-xml-parser@^4.2.0, fast-xml-parser@^4.5.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz#a7e665ff79b7919100a5202f23984b6150f9b31e" - integrity sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w== + version "4.5.3" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz#c54d6b35aa0f23dc1ea60b6c884340c006dc6efb" + integrity sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig== dependencies: - strnum "^1.0.5" + strnum "^1.1.1" fastestsmallesttextencoderdecoder@^1.0.22: version "1.0.22" @@ -2261,22 +2274,25 @@ foreach@^2.0.4: integrity sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg== form-data@^2.5.0: - version "2.5.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.2.tgz#dc653743d1de2fcc340ceea38079daf6e9069fd2" - integrity sha512-GgwY0PS7DbXqajuGf4OYlsrIu3zgxD6Vvql43IBhm6MahqA5SK/7mwhtNj2AdH2z35YR34ujJ7BN+3fFC3jP5Q== + version "2.5.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.3.tgz#f9bcf87418ce748513c0c3494bb48ec270c97acc" + integrity sha512-XHIrMD0NpDrNM/Ckf7XJiBbLl57KEhT3+i3yY+eWm+cqYZJQTZrKo8Y8AWKnuV5GT4scfuUGt9LzNoIx3dU1nQ== dependencies: asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" + combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + mime-types "^2.1.35" safe-buffer "^5.2.1" form-data@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.1.tgz#ba1076daaaa5bfd7e99c1a6cb02aa0a5cff90d48" - integrity sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== + version "4.0.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.3.tgz#608b1b3f3e28be0fccf5901fc85fb3641e5cf0ae" + integrity sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + hasown "^2.0.2" mime-types "^2.1.12" format-util@^1.0.3: @@ -2285,9 +2301,9 @@ format-util@^1.0.3: integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== fp-ts@^2.11.5: - version "2.16.9" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.9.tgz#99628fc5e0bb3b432c4a16d8f4455247380bae8a" - integrity sha512-+I2+FnVB+tVaxcYyQkHUq7ZdKScaBlX53A41mxQtpIccsfyv8PzdzP7fzp2AY832T4aoK6UZ5WRX/ebGd8uZuQ== + version "2.16.10" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.10.tgz#829b82a46571c2dc202bed38a9c2eeec603e38c4" + integrity sha512-vuROzbNVfCmUkZSUbnWSltR1sbheyQbTzug7LB/46fEa1c0EucLeBaCEUE0gF3ZGUGBt9lVUiziGOhhj6K1ORA== fs.realpath@^1.0.0: version "1.0.0" @@ -2314,17 +2330,17 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.2.5, get-intrinsic@^1.2.6: - version "1.2.7" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.7.tgz#dcfcb33d3272e15f445d15124bc0a216189b9044" - integrity sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA== +get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== dependencies: - call-bind-apply-helpers "^1.0.1" + call-bind-apply-helpers "^1.0.2" es-define-property "^1.0.1" es-errors "^1.3.0" - es-object-atoms "^1.0.0" + es-object-atoms "^1.1.1" function-bind "^1.1.2" - get-proto "^1.0.0" + get-proto "^1.0.1" gopd "^1.2.0" has-symbols "^1.1.0" hasown "^2.0.2" @@ -2335,7 +2351,7 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-proto@^1.0.0: +get-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== @@ -2367,11 +2383,6 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - gopd@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" @@ -2397,11 +2408,18 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.1.0: +has-symbols@^1.0.3, has-symbols@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + hasown@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" @@ -2469,7 +2487,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3: +inherits@2: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -2906,7 +2924,7 @@ jest-snapshot@^29.7.0: pretty-format "^29.7.0" semver "^7.5.3" -jest-util@^29.0.0, jest-util@^29.7.0: +jest-util@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== @@ -3023,14 +3041,6 @@ json-schema-compare@^0.2.2: dependencies: lodash "^4.17.4" -json-schema-faker@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/json-schema-faker/-/json-schema-faker-0.5.3.tgz#92f8a102037acf68e1c8e3a2e7c85726d285512d" - integrity sha512-BeIrR0+YSrTbAR9dOMnjbFl1MvHyXnq+Wpdw1FpWZDHWKLzK229hZ5huyPcmzFUfVq1ODwf40WdGVoE266UBUg== - dependencies: - json-schema-ref-parser "^6.1.0" - jsonpath-plus "^7.2.0" - json-schema-faker@0.5.8: version "0.5.8" resolved "https://registry.yarnpkg.com/json-schema-faker/-/json-schema-faker-0.5.8.tgz#13e8b53fef4d86de5c5d164763c80427da892b0c" @@ -3063,16 +3073,7 @@ jsonc-parser@~2.2.1: resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc" integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w== -jsonpath-plus@^10.1.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-10.2.0.tgz#84d680544d9868579cc7c8f59bbe153a5aad54c4" - integrity sha512-T9V+8iNYKFL2n2rF+w02LBOT2JjDnTjioaNFrxRy0Bv1y/hNsqR/EBK7Ojy2ythRHwmz2cRIls+9JitQGZC/sw== - dependencies: - "@jsep-plugin/assignment" "^1.3.0" - "@jsep-plugin/regex" "^1.0.4" - jsep "^1.4.0" - -jsonpath-plus@^10.3.0: +jsonpath-plus@^10.1.0, jsonpath-plus@^10.3.0: version "10.3.0" resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-10.3.0.tgz#59e22e4fa2298c68dfcd70659bb47f0cad525238" integrity sha512-8TNmfeTCk2Le33A3vRRwtuworG/L5RrgMvdjhKZxvyShO+mBu2fP50OWUjRLNtvw344DdDarFh9buFAZs5ujeA== @@ -3081,10 +3082,10 @@ jsonpath-plus@^10.3.0: "@jsep-plugin/regex" "^1.0.4" jsep "^1.4.0" -jsonpath-plus@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-7.2.0.tgz#7ad94e147b3ed42f7939c315d2b9ce490c5a3899" - integrity sha512-zBfiUPM5nD0YZSBT/o/fbCUlCcepMIdP0CJZxM1+KgA4f2T206f6VAg9e7mX35+KlMaIc5qXW34f3BnwJ3w+RA== +jsonrepair@^3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/jsonrepair/-/jsonrepair-3.12.0.tgz#a0c9f97f5628156a44b78597fc8cdaf3561db751" + integrity sha512-SWfjz8SuQ0wZjwsxtSJ3Zy8vvLg6aO/kxcp9TWNPGwJKgTZVfhNEQBMk/vPOpYCDFWRxD6QWuI6IHR1t615f0w== kleur@^3.0.3: version "3.0.3" @@ -3219,7 +3220,7 @@ mime-format@2.0.1: dependencies: charset "^1.0.0" -mime-types@2.1.35, mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@2.1.35, mime-types@^2.1.12, mime-types@^2.1.35, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -3317,9 +3318,9 @@ npm-run-path@^4.0.1: path-key "^3.0.0" object-inspect@^1.13.3: - version "1.13.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" - integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== + version "1.13.4" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" + integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== once@^1.3.0: version "1.4.0" @@ -3449,7 +3450,7 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -picocolors@^1.0.0, picocolors@^1.1.1: +picocolors@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== @@ -3483,9 +3484,9 @@ pino@^6.13.3: sonic-boom "^1.0.2" pirates@^4.0.4: - version "4.0.6" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" - integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== + version "4.0.7" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.7.tgz#643b4a18c4257c8a65104b73f3049ce9a0a15e22" + integrity sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA== pkg-conf@^2.1.0: version "2.1.0" @@ -3527,9 +3528,9 @@ postman-url-encoder@3.0.5: punycode "^2.1.1" prettier@^3.4.2: - version "3.4.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f" - integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ== + version "3.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393" + integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ== pretty-data@0.40.x: version "0.40.0" @@ -3569,11 +3570,11 @@ pure-rand@^6.0.0: integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== qs@^6.11.1: - version "6.13.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.1.tgz#3ce5fc72bd3a8171b85c99b93c65dd20b7d1b16e" - integrity sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg== + version "6.14.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" + integrity sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w== dependencies: - side-channel "^1.0.6" + side-channel "^1.1.0" querystringify@^2.1.1: version "2.2.0" @@ -3590,15 +3591,6 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== -readable-stream@^3.0.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -3623,18 +3615,6 @@ regenerate@^1.4.2: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - -regenerator-transform@^0.15.2: - version "0.15.2" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" - integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== - dependencies: - "@babel/runtime" "^7.8.4" - regexpu-core@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-6.2.0.tgz#0e5190d79e542bf294955dccabae04d3c7d53826" @@ -3691,7 +3671,7 @@ resolve.exports@^2.0.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.3.tgz#41955e6f1b4013b7586f873749a635dea07ebe3f" integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== -resolve@^1.14.2, resolve@^1.20.0: +resolve@^1.20.0, resolve@^1.22.10: version "1.22.10" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== @@ -3700,7 +3680,7 @@ resolve@^1.14.2, resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -3720,7 +3700,7 @@ seedrandom@^3.0.5: resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.5.tgz#54edc85c95222525b0c7a6f6b3543d8e0b3aa0a7" integrity sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg== -semver@7.6.3, semver@^7.5.3, semver@^7.5.4, semver@^7.6.3: +semver@7.6.3: version "7.6.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -3730,6 +3710,11 @@ semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== +semver@^7.5.3, semver@^7.5.4, semver@^7.7.2: + version "7.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58" + integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3771,7 +3756,7 @@ side-channel-weakmap@^1.0.2: object-inspect "^1.13.3" side-channel-map "^1.0.1" -side-channel@^1.0.6: +side-channel@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== @@ -3827,12 +3812,10 @@ source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -split2@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" +split2@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== sprintf-js@~1.0.2: version "1.0.3" @@ -3863,13 +3846,6 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -3897,10 +3873,10 @@ strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -strnum@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.0.5.tgz#5c4e829fe15ad4ff0d20c3db5ac97b73c9b072db" - integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA== +strnum@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.1.2.tgz#57bca4fbaa6f271081715dbc9ed7cee5493e28e4" + integrity sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA== supports-color@^5.3.0: version "5.5.0" @@ -3955,18 +3931,18 @@ tr46@~0.0.3: integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-jest@^29.0.2: - version "29.2.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.2.5.tgz#591a3c108e1f5ebd013d3152142cb5472b399d63" - integrity sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA== + version "29.4.0" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.0.tgz#bef0ee98d94c83670af7462a1617bf2367a83740" + integrity sha512-d423TJMnJGu80/eSgfQ5w/R+0zFJvdtTxwtF9KzFFunOpSeD+79lHJQIiAhluJoyGRbvj9NZJsl9WjCUo0ND7Q== dependencies: bs-logger "^0.2.6" ejs "^3.1.10" fast-json-stable-stringify "^2.1.0" - jest-util "^29.0.0" json5 "^2.2.3" lodash.memoize "^4.1.2" make-error "^1.3.6" - semver "^7.6.3" + semver "^7.7.2" + type-fest "^4.41.0" yargs-parser "^21.1.1" tslib@^2.2.0, tslib@^2.3.1, tslib@^2.6.2: @@ -3984,6 +3960,11 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== +type-fest@^4.41.0: + version "4.41.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" + integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== + type-is@^1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -3997,10 +3978,10 @@ typescript@^4.8.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -undici-types@~6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" - integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== +undici-types@~7.8.0: + version "7.8.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.8.0.tgz#de00b85b710c54122e44fbfd911f8d70174cd294" + integrity sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.1" @@ -4025,10 +4006,10 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== -update-browserslist-db@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz#97e9c96ab0ae7bcac08e9ae5151d26e6bc6b5580" - integrity sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg== +update-browserslist-db@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz#348377dd245216f9e7060ff50b15a1b740b75420" + integrity sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw== dependencies: escalade "^3.2.0" picocolors "^1.1.1" @@ -4051,11 +4032,6 @@ url-parse@^1.4.3: querystringify "^2.1.1" requires-port "^1.0.0" -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - utility-types@^3.10.0: version "3.11.0" resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.11.0.tgz#607c40edb4f258915e901ea7995607fdf319424c"