How to use the @esri/solution-common.getItemDataAsFile 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
let dataPromise = Promise.resolve({});
    let relatedPromise = Promise.resolve({} as common.IGetRelatedItemsResponse);
    switch (itemInfo.type) {
      case "Dashboard":
      case "Feature Service":
      case "Project Package":
      case "Workforce Project":
      case "Web Map":
      case "Web Mapping Application":
        dataPromise = common.getItemDataAsJson(
          itemTemplate.itemId,
          authentication
        );
        break;
      case "Form":
        dataPromise = common.getItemDataAsFile(
          itemTemplate.itemId,
          itemTemplate.item.name,
          authentication
        );
        relatedPromise = common.getItemRelatedItems(
          itemTemplate.itemId,
          "Survey2Service",
          "forward",
          authentication
        );
        break;
    }

    // Errors are handled as resolved empty values; this means that there's no `reject` clause to handle, hence:
    // tslint:disable-next-line:no-floating-promises
    Promise.all([dataPromise, resourcePromise, relatedPromise]).then(
github Esri / solution.js / packages / common / examples / getItemInfo / src / main.ts View on Github external
(itemBase: any) => {
          common
            .getItemDataAsFile(itemId, itemBase.name, authentication)
            .then(resolve2, (error: any) => reject2(JSON.stringify(error)));
        }
      );
github Esri / solution.js / packages / file / src / file.ts View on Github external
const dataPromise = new Promise(dataResolve => {
      common
        .getItemDataAsFile(
          itemTemplate.itemId,
          itemTemplate.item.name,
          authentication
        )
        .then(
          response => {
            if (!response || response.size === 0) {
              dataResolve();
            } else {
              dataResolve(response);
            }
          },
          () => {
            dataResolve();
          }
github Esri / solution.js / packages / creator / examples / createSolutionFromItem / lib / getItemInfo.ts View on Github external
(itemBase: any) => {
          solutionCommon
            .getItemDataAsFile(itemId, itemBase.name, authentication)
            .then(resolve2, (error: any) => reject2(error));
        }
      );
github Esri / solution.js / packages / common / examples / copyItemInfo / src / main.ts View on Github external
(itemBase: any) => {
          common
            .getItemDataAsFile(itemId, itemBase.name, authentication)
            .then(resolve2, (error: any) => reject2(JSON.stringify(error)));
        }
      );
github Esri / solution.js / packages / common / examples / copySolutions / src / main.ts View on Github external
(itemBase: any) => {
          common
            .getItemDataAsFile(itemId, itemBase.name, sourceAuthentication)
            .then(resolve2, (error: any) => reject2(JSON.stringify(error)));
        }
      );