Interface ObjectApi

This API provides the functionality related to objects within SAS Visual Investigator.

Accessed from the window at window.sas.vi.object.

window.sas.vi.object.getObjectAccessRules(objectType, objectId);
interface ObjectApi {
    createAndRelateObject(from: LinkObject, to: NewLinkObject, relationship: ObjectRelationship): Promise<ObjectRelationship>;
    createObject(objectType: string, objectTypeId: number, fieldValues: FieldValues, options?: CreateObjectOptions): Promise<VIObject>;
    deleteAttachment(objectType: string, objectId: string, attachmentId: string): Promise<void>;
    deleteObject(objectType: string, objectId: string): Promise<void>;
    deleteObjectRelationship(relationshipId: string): Promise<void>;
    formatObjectFieldsForDisplay(objects: VIObject[], objectType: string, options?: FormatObjectFieldsOptions): Promise<VIObject[]>;
    getAttachment(objectType: string, objectId: string, attachmentId: string): Promise<FileAssociationResponse>;
    getChildObjects(objectType: string, objectId: string, childObjectType: string, limit?: number): Promise<VIObject[]>;
    getObject(objectType: string, objectId: string, includeDisplayLabel?: boolean, includeChildObjects?: boolean): Promise<VIObject>;
    getObjectAccessRules(objectType: string, objectId: string): ObjectAccessRules;
    getObjectRelationship(relationshipId: string): Promise<ObjectRelationship>;
    getObjectSummaryLabel(objectType: string, objectId: string): Promise<string>;
    openCreateAndLinkDialog(wizardValues: CreateDialogModel): Promise<CreateDialogModel>;
    patchObject(objectType: string, objectId: string, objectTypeId: number, objectTypeVersion: number, originalFieldValues: FieldValues, newFieldValues: FieldValues, objectVersion: number, options?: UpdateObjectOptions): Promise<VIObject>;
    patchObjectRelationship(relationshipId: string, originalFieldValues: FieldValues, newFieldValues: FieldValues): Promise<ObjectRelationship>;
    relateObject(from: LinkObject, to: LinkObject, relationship: ObjectRelationship): Promise<ObjectRelationship>;
    updateObject(objectType: string, objectId: string, objectTypeId: number, objectTypeVersion: number, fieldValues: FieldValues, options?: UpdateObjectOptions): Promise<VIObject>;
    updateObjectRelationship(relationshipId: string, payload: any): Promise<ObjectRelationship>;
    uploadAttachment(attachmentModel: AttachmentModel, objectType: string, objectId: string): Promise<FileAssociationResponse>;
    validate(model: PageModel, childObject: StoredObjectMetadata): Promise<ValidationResult[]>;
}

Methods

  • Parameters

    • from: LinkObject

      {LinkObject} Existing Object that the relationship is from.

    • to: NewLinkObject

      {NewLinkObject} New Object to be created and related to.

    • relationship: ObjectRelationship

      {ObjectRelationship} The relationship.

    Returns Promise<ObjectRelationship>

    A Promise that resolves to a newly created relationship.

    Creates a new object and relates it with an existing one.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectTypeId: number

      {number} Object type ID.

    • fieldValues: FieldValues

      {FieldValues} Field values of the object.

    • Optionaloptions: CreateObjectOptions

      {CreateObjectOptions} Optional extra parameters.

    Returns Promise<VIObject>

    A Promise that resolves to the created object when the object has successfully been created.

    Creates an object.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Object ID.

    • attachmentId: string

      {string} Attachment ID.

    Returns Promise<void>

    A Promise that resolves to an empty HttpResponse when the attachment is successfully deleted.

    Deletes the specified attachment of the associated object.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Object ID.

    Returns Promise<void>

    A Promise that resolves to void when the specified object is successfully deleted.

    Deletes an object.

  • Parameters

    • relationshipId: string

      {string} Relationship ID.

    Returns Promise<void>

    A Promise that resolves to void when the object is successfully deleted.

    Deletes relationship with the specified ID.

  • Parameters

    • objects: VIObject[]

      {VIObject[]} Array of objects.

    • objectType: string

      {string} Type of the objects in the array.

    • Optionaloptions: FormatObjectFieldsOptions

      {FormatObjectFieldsOptions} Optional parameters to control the formatting. By default, nothing is skipped and there is no formatCallback.

    Returns Promise<VIObject[]>

    A Promise that resolves to the formatted array of objects.

    Processes an array of objects and formats them for display.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Object ID.

    • attachmentId: string

      {string} Attachment ID.

    Returns Promise<FileAssociationResponse>

    A Promise that resolves to a HttpResponse with a FileAssociationResponse as the data.

    Gets an attachment of the associated object.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Gets the child objects relating to the object ID.

    • childObjectType: string

      {string} Child object type.

    • Optionallimit: number

      {number} Maximum number of child objects to be returned.

    Returns Promise<VIObject[]>

    A Promise that resolves to an array of objects, that are child objects of the specified object.

    Gets the child objects of an object.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Object ID.

    • OptionalincludeDisplayLabel: boolean

      {boolean} Checks whether or not to return the object with a display label.

    • OptionalincludeChildObjects: boolean

      {boolean} Checks whether or not to return the child objects associated with this object.

    Returns Promise<VIObject>

    The specified object.

    Gets the specified object.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Object ID.

    Returns ObjectAccessRules

    Object with three boolean methods which provide boolean data on a specified object.

    Gets the object access rules for an object: The three methods that return booleans based on specified object are:

    canReadObject, canUpdateObject, and canDeleteObject.

  • Parameters

    • relationshipId: string

      {string} Relationship ID.

    Returns Promise<ObjectRelationship>

    A Promise that resolves to a relationship.

    Gets relationship via the relationship ID.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Object ID.

    Returns Promise<string>

    Summary label as a String.

    Gets object summary label.

  • Parameters

    • wizardValues: CreateDialogModel

      {CreateDialogModel} Object containing entity and relationship data.

    Returns Promise<CreateDialogModel>

    A Promise which resolves when the dialog box is closed.

    Launches a wizard allowing users to create an object/relationship. The relationship wizard is determined by the relateToParentLabel or relateToParentName defined in the wizardValues parameter.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Object ID.

    • objectTypeId: number

      {number} Object type ID.

    • objectTypeVersion: number

      {number} Object type version.

    • originalFieldValues: FieldValues

      {FieldValues} Field values before the object was edited

    • newFieldValues: FieldValues

      {FieldValues} Field values after the object was edited

    • objectVersion: number

      {number} Object Version

    • Optionaloptions: UpdateObjectOptions

      {UpdateObjectOptions} Optional extra parameters.

    Returns Promise<VIObject>

    A Promise that resolves to the updated object when the object has successfully been updated.

    Updates an existing object with the provided data.

  • Parameters

    • relationshipId: string

      {string} Relationship ID.

    • originalFieldValues: FieldValues

      {FieldValues} Field values before the relationship was edited

    • newFieldValues: FieldValues

      {FieldValues} Field values after the relationship was edited

    Returns Promise<ObjectRelationship>

    A Promise that resolves to a relationship.

    Updates an existing relationship in SAS Visual Investigator.

  • Parameters

    • from: LinkObject

      {LinkObject} Object that relationship is from.

    • to: LinkObject

      {LinkObject} Object that relationship is to.

    • relationship: ObjectRelationship

      {ObjectRelationship} The relationship.

    Returns Promise<ObjectRelationship>

    A Promise that resolves to an object.

    Creates a relationship between two objects.

  • Parameters

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Object ID.

    • objectTypeId: number

      {number} Object type ID.

    • objectTypeVersion: number

      {number} Object type version.

    • fieldValues: FieldValues

      {FieldValues} Field values of the object.

    • Optionaloptions: UpdateObjectOptions

      {UpdateObjectOptions} Optional extra parameters.

    Returns Promise<VIObject>

    A Promise that resolves to the updated object when the object has successfully been updated.

    Updates an existing object with the provided data.

  • Parameters

    • relationshipId: string

      {string} Relationship ID.

    • payload: any

      {any} HTTP request content.

    Returns Promise<ObjectRelationship>

    A Promise that resolves to a relationship.

    Updates an existing relationship in SAS Visual Investigator.

  • Parameters

    • attachmentModel: AttachmentModel

      {AttachmentModel} Attachment model.

    • objectType: string

      {string} Object type.

    • objectId: string

      {string} Object ID.

    Returns Promise<FileAssociationResponse>

    A Promise that resolves to a HttpResponse with a FileAssociationResponse as the data.

    Uploads an attachment.

  • Parameters

    Returns Promise<ValidationResult[]>

    An observable that resolves to an array of validation results.

    Validates the fields, controls, and file categories of a child object.