Applications
@thotnr-aws-accl/custom-app-api / Exports / Applications
Class: Applications
Get the metadata for application instances, applications, objects and fields
Table of contents
Methods
Methods
createConfigRecords
▸ Static createConfigRecords(data): Promise<number>
Creates a config record for
Parameters
data
Record<string, any>
The object properties sample - Record<string, any> = { "configs_external_id": "conf1", "is_deleted": false, "settings": "qqq", "groups":[{group_id:1,is_deleted:false any other fields used to configure mapping table....},{group_id:2,is_deleted:false any other fields used to configure mapping table}] groups is required }
Returns
Promise<number>
createExecutionProfile
▸ Static createExecutionProfile(jobCode, data): Promise<number>
Creates an execution profile record for the supplied jobcode
Parameters
jobCode
string
The job code of the pipeline for which you are creating this record
data
Record<string, any>
The object properties sample - { Record<string, any> = { "": "text1", "is_deleted": false, "name": "abc", "description":"cde", "schedule":"123", "groups":[{group_id:1,is_deleted:false any other fields used to configure mapping table....},{group_id:2,is_deleted:false any other fields used to configure mapping table}] groups is required
Returns
Promise<number>
A Promise that resolves to the internal ID of the newly created execution profile record.
Throws
If there is an error creating the execution profile record.
downloadObjectsFromTenantBucket
▸ Static downloadObjectsFromTenantBucket(bucket, key): Promise<void>
Downloads the objects from the tenant bucket
Parameters
bucket
string
the bucket name
key
string
the key of the object
Returns
Promise<void>
downloadObjectsFromTenantBucketV2
▸ Static downloadObjectsFromTenantBucketV2(key): Promise<void>
Downloads objects from the tenant bucket using a provided key. The method retrieves a pre-signed URL for the object in the tenant data bucket and opens it in a new browser tab.
Parameters
key
string
The key of the object in the tenant bucket.
Returns
Promise<void>
A Promise that resolves when the operation has completed.
Throws
If there is an error retrieving the pre-signed URL or opening the URL.
getAllArtifactObjectsForJobCode
▸ Static getAllArtifactObjectsForJobCode(jobCode): Promise<AppObject[]>
Retrieves all artifact objects for a given job code.
Parameters
jobCode
string
The job code used to filter the application objects.
Returns
Promise<AppObject[]>
A Promise that resolves to an array of AppObject.
Throws
If there is an error retrieving the application objects.
getAllConfigObjectsToBeConfiguredForPipelineInCurrentApp
▸ Static getAllConfigObjectsToBeConfiguredForPipelineInCurrentApp(): Promise<readonly AppObject[]>
This method is used to get all configuration objects that need to be configured for pipelines in the current application.
Returns
Promise<readonly AppObject[]>
A Promise that resolves to a readonly array of AppObject or undefined if no application objects are found.
Throws
If there is an error retrieving the current application objects.
getAllExecutionProfiles
▸ Static getAllExecutionProfiles(): Promise<{ groupMappings: Map<ConfigIdentifier, any> ; records: Map<ConfigIdentifier, any> }>
Returns all execution profiles present across pipelines.
In order for this to work:
Objects holding execution profiles should have plural name of the format "execution_profile__". ObjectType is standard bitemporal.
There should be a transactional object with lookup on object created in step 1, field name should be internal Id of object created in step 1. and a lookup on groups table with field name group_id, the plural name of this object should be of the format "group_mapping_execution_profile_". The candidate key for this transactional object should be [<internalIdOfObject created in step 1>, group_id].
Returns
Promise<{ groupMappings: Map<ConfigIdentifier, any> ; records: Map<ConfigIdentifier, any> }>
A Promise that resolves to an object containing two maps: 'records' and 'groupMappings'.
Throws
If there is an error retrieving the execution profiles.
getAllExecutionProfilesByJobCode
▸ Static getAllExecutionProfilesByJobCode(jobCode): Promise<{ groupMappings: Map<ConfigIdentifier, any> ; records: Map<ConfigIdentifier, any> }>
Returns all execution profiles present for a jobcode In order for this to work
Objects holding execution profiles should have plural name of the format "execution_profile__" ObjectType is standard bitemporal
There should be a transactional object with lookup on object created in step 1, field name should be internal Id of object created in step1 and a lookup on groups table with field name group_id, the plural name of this object should be of the format "group_mapping_execution_profile_" The candidate key for this transactional object should be [,group_id]
Parameters
jobCode
string
The job code used to filter the execution profiles.
Returns
Promise<{ groupMappings: Map<ConfigIdentifier, any> ; records: Map<ConfigIdentifier, any> }>
A Promise that resolves to an object containing two maps: 'records' and 'groupMappings'.
Throws
If there is an error retrieving the execution profiles.
getAllObjectsToBeConfiguredForPipelineInCurrentApp
▸ Static getAllObjectsToBeConfiguredForPipelineInCurrentApp(jobCode): Promise<readonly AppObject[]>
This method is used to get all objects that need to be configured for pipelines in the current application.
Parameters
jobCode
string
The job code used to filter the application objects.
Returns
Promise<readonly AppObject[]>
A Promise that resolves to a readonly array of AppObject or undefined if no application objects are found.
Throws
If there is an error retrieving the current application objects.
getAllPipelineObjectsForCurrentApp
▸ Static getAllPipelineObjectsForCurrentApp(): Promise<Map<string, string>>
This method is used to get all pipeline objects for the current application.
Returns
Promise<Map<string, string>>
A Promise that resolves to a Map where the key is the job code and the value is the job definition name.
Throws
If there is an error retrieving the current application objects, tagged version for job code, or job definitions.
getChartsLabelObject
▸ Static getChartsLabelObject(): Promise<AppObject>
retrieves the chart labels object
Returns
Promise<AppObject>
getConfigObjectsForCurrentApp
▸ Static getConfigObjectsForCurrentApp(): Promise<readonly AppObject[]>
This method is used to get all configuration objects for the current application.
Returns
Promise<readonly AppObject[]>
A Promise that resolves to a readonly array of AppObject or undefined if no application objects are found.
Throws
If there is an error retrieving the current application objects.
getConfigurationRecords
▸ Static getConfigurationRecords(): Promise<{ groupMappings: Map<ConfigIdentifier, any> ; records: Map<ConfigIdentifier, any> }>
Returns all configuration records present.
In order for this to work:
There has to be only one Object holding configuration records and should have plural name of the format "setup_config_". ObjectType is standard bitemporal.
There should be a transactional object with lookup on object created in step 1, field name should be internal Id of object created in step 1. and a lookup on groups table with field name group_id, the plural name of this object should be of the format "group_mapping_setup_config_". The candidate key for this transactional object should be [<internalIdOfObject created in step 1>, group_id].
Returns
Promise<{ groupMappings: Map<ConfigIdentifier, any> ; records: Map<ConfigIdentifier, any> }>
A Promise that resolves to an object containing two maps: 'records' and 'groupMappings'.
Throws
If there is an error retrieving the configuration records.
getCurrentAppGroupInstanceId
▸ Static getCurrentAppGroupInstanceId(): Promise<number>
Returns the application group instance ID of the current application.
This method retrieves the current application instance using the ApplicationInstanceClient and then returns the applicationGroupInstanceId property of the retrieved instance.
Returns
Promise<number>
A Promise that resolves to a string representing the application group instance ID of the current application.
Throws
If there is an error retrieving the current application instance.
getCurrentApplicationInfo
▸ Static getCurrentApplicationInfo(): Promise<Application>
Retrieves the current application information.
Returns
Promise<Application>
A Promise that resolves to an Application object representing the current application.
Throws
If there is an error retrieving the current application instance or the application details.
getCurrentApplicationObjects
▸ Static getCurrentApplicationObjects(): Promise<readonly AppObject[]>
This method is used to get the current application objects.
Returns
Promise<readonly AppObject[]>
A Promise that resolves to a readonly array of AppObject or undefined if no application objects are found.
Throws
If there is an error retrieving the current application instance or the application details.
getCurrentApplications
▸ Static getCurrentApplications(): Promise<readonly Application[]>
Gets a list of all current applications
Returns
Promise<readonly Application[]>
getCustomHtmlComponentDraft
▸ Static getCustomHtmlComponentDraft(componentCode): Promise<string>
retrieves a draft custom component based of off a component code
Parameters
componentCode
string
Returns
Promise<string>
getCustomHtmlComponentPublished
▸ Static getCustomHtmlComponentPublished(componentCode): Promise<string>
retrieves a published custom component based of off a component code
Parameters
componentCode
string
Returns
Promise<string>
getDriftChartsLabelObject
▸ Static getDriftChartsLabelObject(): Promise<AppObject>
retrieves the drift charts object
Returns
Promise<AppObject>
getJobDefinitionForJobCode
▸ Static getJobDefinitionForJobCode(jc): Promise<JobDefinition>
Returns the job definition of a particular job code
Parameters
jc
string
Returns
Promise<JobDefinition>
getModelVersionChartsLabelObject
▸ Static getModelVersionChartsLabelObject(): Promise<AppObject>
retrieves the model version charts object
Returns
Promise<AppObject>
getSQLEditorEntryPoint
▸ Static getSQLEditorEntryPoint(): Promise<string>
Get the entry point URL for the SQL Editor. Note that SQL Editor will only be available for apps where Custom App Extension schema is enabled
Returns
Promise<string>
A Promise that resolves to the SQL Editor Entry Point URL as a string.
getSQLEditorForDevEntryPoint
▸ Static getSQLEditorForDevEntryPoint(): Promise<string>
Get the entry point URL for the SQL Editor for dev. Note that SQL Editor will only be available for apps where Custom App Extension schema is enabled
Returns
Promise<string>
A Promise that resolves to the SQL Editor for dev Entry Point URL as a string.
getUserApplicationInstances
▸ Static getUserApplicationInstances(): Promise<readonly ApplicationInstance[]>
This method is used to get the user's application instances. It fetches all the application enrollments for the user and maps them to an array of ApplicationInstance objects. Each ApplicationInstance object contains the id, name, description, appEntryUrl, customAppEntryUrl, appGroupDescription, and appGroupName of the application.
Returns
Promise<readonly ApplicationInstance[]>
A Promise that resolves to a readonly array of ApplicationInstance objects.
Throws
If there is an error retrieving the application enrollments, application group instance, application groups, or current application info.
Deprecated
Use getUserApplicationInstancesV2 instead.
getUserApplicationInstancesV2
▸ Static getUserApplicationInstancesV2(): Promise<readonly ApplicationInstance[]>
This method is used to get the user's application instances. It fetches all the application enrollments for the user and maps them to an array of ApplicationInstance objects. Each ApplicationInstance object contains the id, name, description, appEntryUrl, customAppEntryUrl, appGroupDescription, and appGroupName of the application.
Returns
Promise<readonly ApplicationInstance[]>
A Promise that resolves to a readonly array of ApplicationInstance objects.
Throws
If there is an error retrieving the application enrollments, application group instance, application groups, or current application info.
logout
▸ Static logout(): Promise<void>
This method is used to log out of the application.
Returns
Promise<void>
A Promise that resolves when the logout operation has completed.
updateConfigRecords
▸ Static updateConfigRecords(data): Promise<number>
Updates a configuration record.
Parameters
data
Record<string, any>
The properties of the configuration record to be updated. This should be an object with the following structure: { "configs_external_id": "conf1", "is_deleted": false, "settings": "qqq", "configs_id":1, "groups":[{group_id:1,is_deleted:false any other fields used to configure mapping table....},{group_id:2,is_deleted:false any other fields used to configure mapping table}] groups is required }
Returns
Promise<number>
A Promise that resolves to the internal ID of the updated configuration record.
Throws
If there is an error updating the configuration record.
updateExecutionProfile
▸ Static updateExecutionProfile(jobCode, data): Promise<number>
Updates an execution profile record for the supplied jobcode
Parameters
jobCode
string
The job code of the pipeline for which you are creating this record
data
Record<string, any>
The object properties sample - Record<string, any> = { "": "text1", "": 1, "is_deleted": false, "name": "abc", "description":"cde", "schedule":"123", "groups":[{group_id:1,is_deleted:false any other fields used to configure mapping table....},{group_id:2,is_deleted:false any other fields used to configure mapping table}] groups is required } *
Returns
Promise<number>
A Promise that resolves to the internal ID of the updated execution profile record.
Throws
If there is an error updating the execution profile record.
Last updated