Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async getRequestBuilder(
builderType: ApiName,
abortSignal?: AbortSignal
): Promise {
return RequestFactory.create(
builderType,
this.apiVersion,
this.settings,
HRN.fromString(this.hrn),
abortSignal
).catch(err =>
Promise.reject(
`Error retrieving from cache builder for resource "${this.hrn}" and api: "${builderType}.\n${err}"`
)
);
}
private async getRequestBuilder(
builderType: ApiName,
abortSignal?: AbortSignal
): Promise {
return RequestFactory.create(
builderType,
this.apiVersion,
this.settings,
HRN.fromString(this.hrn),
abortSignal
).catch(err =>
Promise.reject(
`Error retrieving from cache builder for resource "${this.hrn}" and api: "${builderType}.\n${err}"`
)
);
}
async getCopyrightCoverageData(): Promise {
if (this.m_cachedCopyrightResponse !== undefined) {
return this.m_cachedCopyrightResponse;
}
const hrn = HRN.fromString(this.m_params.hrn);
const context = new DataStoreContext({
getToken: this.m_params.getToken,
environment: hrn.data.partition
});
const catalogClient = new CatalogClient({
context,
hrn: this.m_params.hrn
});
this.m_cachedCopyrightResponse = catalogClient
.getVolatileOrVersionedLayer(this.m_params.layer || DEFAULT_LAYER)
.then()
.then(layer => layer.getPartition(this.m_params.partition || DEFAULT_PARTITION))
.then(response => response.json())
.then(json => json[this.m_params.baseScheme || "normal"])
.catch(error => {