Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
// Init template
const itemTemplate: common.IItemTemplate = common.createInitializedItemTemplate(
itemInfo
);
itemTemplate.estimatedDeploymentCostFactor = 2; // minimal set is starting, creating, done|failed
// Templatize item info property values
itemTemplate.item.id = common.templatizeTerm(
itemTemplate.item.id,
itemTemplate.item.id,
".itemId"
);
// Request item resources
const resourcePromise = common
.getItemResources(itemTemplate.itemId, authentication)
.then(resourcesResponse => {
// Save resources to solution item
return new Promise((resolve, reject) => {
const requestOptions: common.IUserRequestOptions = {
authentication: authentication
};
// Init template
const template: common.IItemTemplate = common.createInitializedItemTemplate(
itemInfo
);
// Update the estimated cost factor to deploy this item
template.estimatedDeploymentCostFactor = 3;
common
.getItemDataAsJson(template.item.id, requestOptions.authentication)
.then(
data => {
template.data = data;
common
.getServiceLayersAndTables(template, requestOptions.authentication)
.then(
itemTemplate => {
// Extract dependencies
return new Promise((resolve, reject) => {
// Init template
const itemTemplate: common.IItemTemplate = common.createInitializedItemTemplate(
itemInfo
);
itemTemplate.estimatedDeploymentCostFactor = 2; // minimal set is starting, creating, done|failed
// Templatize item info property values
itemTemplate.item.id = common.templatizeTerm(
itemTemplate.item.id,
itemTemplate.item.id,
".itemId"
);
// Request file
const dataPromise = new Promise(dataResolve => {
common
.getItemDataAsFile(
itemTemplate.itemId,