How to use the @esri/solution-common.copyFilesToStorageItem 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 / group / src / group.ts View on Github external
.then(resourcesResponse => {
                // Save resources to solution item
                itemTemplate.resources = (resourcesResponse.resources as any[]).map(
                  (resourceDetail: any) => resourceDetail.resource
                );
                const resourceFilePaths: common.ISourceFileCopyPath[] = common.generateSourceFilePaths(
                  authentication.portal,
                  itemTemplate.itemId,
                  itemTemplate.item.thumbnail,
                  itemTemplate.resources,
                  true
                );
                common
                  .copyFilesToStorageItem(
                    authentication,
                    resourceFilePaths,
                    solutionItemId,
                    authentication
                  )
                  .then(savedResourceFilenames => {
                    itemTemplate.resources = (savedResourceFilenames as any[]).filter(
                      item => !!item
                    );
                    resolve(itemTemplate);
                  }, reject);
              })
              .catch(() => Promise.resolve([]));
github Esri / solution.js / packages / simple-types / src / simple-types.ts View on Github external
.then(resourcesResponse => {
        // Save resources to solution item
        itemTemplate.resources = (resourcesResponse.resources as any[]).map(
          (resourceDetail: any) => resourceDetail.resource
        );
        const resourceItemFilePaths: common.ISourceFileCopyPath[] = common.generateSourceFilePaths(
          authentication.portal,
          itemTemplate.itemId,
          itemTemplate.item.thumbnail,
          itemTemplate.resources
        );
        return common.copyFilesToStorageItem(
          authentication,
          resourceItemFilePaths,
          solutionItemId,
          authentication
        );
      })
      .catch(() => Promise.resolve([]));
github Esri / solution.js / packages / file / src / file.ts View on Github external
.then(resourcesResponse => {
        // Save resources to solution item
        itemTemplate.resources = (resourcesResponse.resources as any[]).map(
          (resourceDetail: any) => resourceDetail.resource
        );
        const resourceItemFilePaths: common.ISourceFileCopyPath[] = common.generateSourceFilePaths(
          authentication.portal,
          itemTemplate.itemId,
          itemTemplate.item.thumbnail,
          itemTemplate.resources
        );
        return common.copyFilesToStorageItem(
          authentication,
          resourceItemFilePaths,
          solutionItemId,
          authentication
        );
      });