BookmarkSubscribeRSS Feed
EyalGonen
Barite | Level 11

Looking at https://developer.sas.com/sdk/vi/apiDocs/index.html I see an example code that uses the StoredObjectDTO object but I cannot find any documentation about it within the SDK documentation. It seems like @sassoftware/vi-api/svi-datahub is completely undocumented even though it appears in the example code which is kind of odd...

Where can I find the doc for @sassoftware/vi-api/svi-datahub?

 

import { SviWindow } from "@sassoftware/vi-api";
import { StoredObjectDTO } from "@sassoftware/vi-api/svi-datahub";

const sviWindow = window as SviWindow;
sviWindow.sas.vi.metadata.getEntity("person").then((entity: StoredObjectDTO | undefined) => {
    if (entity) {
        console.log("Retrieved entity:", entity.label);
    }
});

 

 

3 REPLIES 3
susantrueman
SAS Employee

Hello, 

 

Thanks for your SAS Communities question. The link you shared in the original post provides the documentation for the VI Client API

The SAS REST APIs are documented in a separate area of the sas developers site - here are some links: 

Please let me know if this helps. 

Thanks

Susan

 

EyalGonen
Barite | Level 11

Hi @susantrueman 

 

Thank you for replying.

My question is about the SAS VI Client API (SDK) and not the REST API.

Don't you find it odd that the SAS sample code references an undocumented SDK namely @sassoftware/vi-api/svi-datahub?

 

import { StoredObjectDTO } from "@sassoftware/vi-api/svi-datahub";

I do not understand why the @sassoftware/vi-api/svi-datahub is undocumented and in addition, I still do not understand what is a StoredObjectDTO 😞

 

Thanks,

Eyal

NajiShehab
SAS Employee

Hi @EyalGonen,

Thanks for reaching out.

For context, StoredObjectDTO is the full configuration behind created/stored entities within VI. It carries specific entity properties such as its name, label, id, type, fields configured, relationship settings, file categories, and so on. As this is a TypeScript package you should be able to see the full definition of the object under ' node_modules/@sassoftware/vi-api/svi-datahub/index.d.ts '. For you convenience, please see below snippet that resembles the defined type as of today.

export interface StoredObjectDTO extends DataObjectWithHistoryDTO, StoredDataObject, Comparable<StoredObjectDTO>, ETagAndLastModifiedProvider {
    indexedForSearch?: boolean;
    reindexRequired?: boolean;
    fields?: StoredObjectFieldDTO[];
    relationshipsFrom?: RelationshipDTO[];
    relationshipsTo?: RelationshipDTO[];
    transactionsFrom?: TransactionDTO[];
    transactionsTo?: TransactionDTO[];
    defaultRegularIcon?: IconDTO;
    allowElementGroupRootAssignment?: boolean;
    urnFormat?: string;
    urnLength?: number;
    urnStartValue?: number;
    urnType?: UrnType;
    publishCode?: PublishCode;
    fileCategories?: FileCategoryDTO[];
    conditions?: ConditionDTO[];
    icons?: IconDTO[];
}


For additional context, this interface type is an internal type that is auto-generated by our datahub backend service. By default, internal references aren't being exported onto our public docs, but the concern is valid and I've raised a ticket within R&D to potentially investigate this in the future.

 

I hope this helps clarify things! Let me know if you have any further questions.

 

Cheers,

Naji