From 74db4d7b079634925855c6bd084fceb14fde1656 Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 24 Sep 2024 14:08:18 +0000 Subject: [PATCH 1/4] Generate SDK with OpenAPI Generator Version 7.6.0 --- bandwidth.yml | 2 -- models/message-failed-callback-message.ts | 2 +- models/message-sending-callback-message.ts | 2 +- tsconfig.json | 3 ++- 4 files changed, 4 insertions(+), 5 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/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; } diff --git a/tsconfig.json b/tsconfig.json index ed6a30a..0c497fd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,5 +18,6 @@ "dist", "tests", "node_modules" - ] + ], + "include": ["global.d.ts"] } From 61954d1282c499c569c81a8d049d98349fe76d73 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 24 Sep 2024 10:16:18 -0400 Subject: [PATCH 2/4] fix tsconfig template --- custom_templates/tsconfig.mustache | 3 +-- tsconfig.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) 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/tsconfig.json b/tsconfig.json index 0c497fd..ed6a30a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,5 @@ "dist", "tests", "node_modules" - ], - "include": ["global.d.ts"] + ] } From 9693a66a70288395870ee4f36c2d88b4b85cecf2 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 24 Sep 2024 10:17:09 -0400 Subject: [PATCH 3/4] fix potentially undefined Verb `content` and `attributes` --- models/bxml/Verb.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/bxml/Verb.ts b/models/bxml/Verb.ts index b2180db..ac026b1 100644 --- a/models/bxml/Verb.ts +++ b/models/bxml/Verb.ts @@ -19,8 +19,8 @@ export class Verb { */ constructor(name: string, content?: string, attributes?: object) { this.name = name; - this.attributes = attributes; - this.content = content; + this.content = content ?? ''; + this.attributes = attributes ?? {}; } /** From 7b73285703c8722066afbc680f3460004c57a0b7 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 24 Sep 2024 10:22:04 -0400 Subject: [PATCH 4/4] don't use ?? --- models/bxml/Verb.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/models/bxml/Verb.ts b/models/bxml/Verb.ts index ac026b1..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.content = content ?? ''; - 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; }