RunExtensionMethod
Runs the specified vault extension method. Prefer this method over 'ExecuteExtensionMethod' and 'ExecuteExtensionMethodEx' methods.
Syntax
// Assumes shellUI has been initialized with IShellUI instance
const results =
await shellUI.Vault.VaultExtensionMethodsOperations.RunExtensionMethod({
method_name: "<method_name>",
input: "<input>",
});
Message
There are two different use cases for calling extension methods, each requiring different parameters.
Use Case 1: VBScript/VAF Extension Methods
Use this when calling VBScript event handlers or VAF application methods.
| Name | Description | Type |
|---|---|---|
method_name | The event handler name of the VaultExtensionMethod handler that receives the call. | string |
input | The method input as clear text. Use empty string if compressed_input is used instead. | string |
compressed_input | Optional. Can be used instead of input to avoid size limits or inefficiencies with large data. | Uint8Array |
// VBScript/VAF Extension Method call
const results =
await shellUI.Vault.VaultExtensionMethodsOperations.RunExtensionMethod({
method_name: "<method_name>",
input: "<input>",
});
Use Case 2: IML Application Methods
Use this when calling methods exposed by IML applications and their services.
| Name | Description | Type |
|---|---|---|
application_id | The GUID of the target IML application (from the application definition file). | string |
extension | The GUID of the IML service that the application exposes. | string |
instance | The ID of the service instance. Leave empty to interact with the service directly. Services generate instance IDs (typically GUIDs) for each configured instance. | string |
method_name | The name of the method that the service or instance exposes. | string |
input | The data for the method as clear text. Use empty string if compressed_input is used instead. | string |
compressed_input | Optional. Can be used instead of input to avoid size limits or inefficiencies with large data. | Uint8Array |
// IML Application Method call
const results =
await shellUI.Vault.VaultExtensionMethodsOperations.RunExtensionMethod({
application_id: "<application_guid>",
extension: "<service_guid>",
instance: "<instance_id>", // Leave empty for service-level calls
method_name: "<method_name>",
input: "<input>",
});
Return type
| Name | Description | Type |
|---|---|---|
output | The method output as a clear text. Empty string if compressed output field is used instead. | string |
compressed_output | The method input as compressed data (utf8 text as zlib-compressed byte array). Empty data if the clear-text output was used. | Uint8Array |
Example
{
"output": "<output>",
"compressed_output": 0 /*Uint8Array*/
}