mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-10 17:04:36 +00:00
fix: defensively coded for potential empty 'name' properties in the viya types response
This commit is contained in:
@@ -57,7 +57,7 @@ interface IViyaTypesItem {
|
|||||||
mappedTypes?: string[]
|
mappedTypes?: string[]
|
||||||
mediaType?: string
|
mediaType?: string
|
||||||
mediaTypes?: string[]
|
mediaTypes?: string[]
|
||||||
name: string
|
name?: string | undefined
|
||||||
pluralLabel?: string
|
pluralLabel?: string
|
||||||
properties?: IViyaTypesProperties
|
properties?: IViyaTypesProperties
|
||||||
resourceUri?: string
|
resourceUri?: string
|
||||||
@@ -86,7 +86,7 @@ type IViyaTypesProperties = Record<string, string>
|
|||||||
* create and patch a new file.
|
* create and patch a new file.
|
||||||
*/
|
*/
|
||||||
interface IViyaTypesExtensionInfo {
|
interface IViyaTypesExtensionInfo {
|
||||||
typeDefName: string
|
typeDefName: string | undefined
|
||||||
properties: IViyaTypesProperties | undefined
|
properties: IViyaTypesProperties | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,8 +524,14 @@ export class SASViyaApiClient {
|
|||||||
.forEach((e) => {
|
.forEach((e) => {
|
||||||
e.extensions?.forEach((ext) => {
|
e.extensions?.forEach((ext) => {
|
||||||
this.fileExtensionMap.set(ext, {
|
this.fileExtensionMap.set(ext, {
|
||||||
// "name:" is the typeDefName value required for file creation.
|
// `name` becomes the typeDefName value at file creation time.
|
||||||
typeDefName: e.name,
|
// `name` is ignored here if it is not populated in the map, or
|
||||||
|
// has a blank/empty value.
|
||||||
|
typeDefName: e.name
|
||||||
|
? e.name.trim().length
|
||||||
|
? e.name.trim()
|
||||||
|
: undefined
|
||||||
|
: undefined,
|
||||||
properties: e.properties
|
properties: e.properties
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user