From 9626bb92b6adb0c4f68064a7bc59e3479fb7d2ef Mon Sep 17 00:00:00 2001 From: "band-swi[bot]" <143147434+band-swi[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:46:03 -0400 Subject: [PATCH] SWI-6218 Update SDK Based on Recent Spec Changes (#45) * Generate SDK with OpenAPI Generator Version 7.6.0 * fix tsconfig template * fix potentially undefined Verb `content` and `attributes` * don't use ?? --------- Co-authored-by: DX-Bandwidth Co-authored-by: ckoegel --- bandwidth.yml | 2 -- custom_templates/tsconfig.mustache | 3 +-- models/bxml/Verb.ts | 9 +++++---- models/message-failed-callback-message.ts | 2 +- models/message-sending-callback-message.ts | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bandwidth.yml b/bandwidth.yml index 5362a7c..c4b1fb2 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -1862,7 +1862,6 @@ components: - from - text - media - - priority messageDeliveredCallback: description: Message Delivered Callback type: object @@ -2035,7 +2034,6 @@ components: - from - text - tag - - priority callbackMethodEnum: type: string nullable: true diff --git a/custom_templates/tsconfig.mustache b/custom_templates/tsconfig.mustache index ae0d76b..6e58ae9 100644 --- a/custom_templates/tsconfig.mustache +++ b/custom_templates/tsconfig.mustache @@ -23,6 +23,5 @@ "dist", "tests", "node_modules" - ], - "include": ["global.d.ts"] + ] } diff --git a/models/bxml/Verb.ts b/models/bxml/Verb.ts index b2180db..567a4bd 100644 --- a/models/bxml/Verb.ts +++ b/models/bxml/Verb.ts @@ -8,8 +8,8 @@ import { XMLBuilder, XMLWriterOptions } from 'xmlbuilder2/lib/interfaces'; */ export class Verb { name: string; - content: string; - attributes: object; + content: string | undefined; + attributes: object | undefined; /** * Creates an instance of Verb @@ -19,15 +19,16 @@ export class Verb { */ constructor(name: string, content?: string, attributes?: object) { this.name = name; - this.attributes = attributes; this.content = content; + this.attributes = attributes; } /** * Generate an XML element for the verb */ generateXml(): XMLBuilder { - const xml = create().ele(this.name, this.attributes).txt(this.content); + const xml = create().ele(this.name, this.attributes); + if (this.content) { xml.txt(this.content); } return xml; } diff --git a/models/message-failed-callback-message.ts b/models/message-failed-callback-message.ts index eb2a7b8..e4bfffc 100644 --- a/models/message-failed-callback-message.ts +++ b/models/message-failed-callback-message.ts @@ -97,7 +97,7 @@ export interface MessageFailedCallbackMessage { * @type {PriorityEnum} * @memberof MessageFailedCallbackMessage */ - 'priority': PriorityEnum; + 'priority'?: PriorityEnum; } diff --git a/models/message-sending-callback-message.ts b/models/message-sending-callback-message.ts index 3f373f4..c6bc540 100644 --- a/models/message-sending-callback-message.ts +++ b/models/message-sending-callback-message.ts @@ -97,7 +97,7 @@ export interface MessageSendingCallbackMessage { * @type {PriorityEnum} * @memberof MessageSendingCallbackMessage */ - 'priority': PriorityEnum; + 'priority'?: PriorityEnum; }