How to use the @esri/solution-common.createInitializedItemTemplate function in @esri/solution-common

To help you get started, we’ve selected a few @esri/solution-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Esri / solution.js / packages / simple-types / src / simple-types.ts View on Github external
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
github Esri / solution.js / packages / feature-layer / src / feature-layer.ts View on Github external
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
github Esri / solution.js / packages / file / src / file.ts View on Github external
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,