@esri/solution-file 1.1.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/file.d.ts +3 -2
- package/dist/esm/file.js +5 -4
- package/dist/esm/file.js.map +1 -1
- package/dist/node/file.d.ts +3 -2
- package/dist/node/file.js +7 -5
- package/dist/node/file.js.map +1 -1
- package/dist/umd/file.d.ts +3 -2
- package/dist/umd/file.umd.js +53 -28
- package/dist/umd/file.umd.js.map +1 -1
- package/dist/umd/file.umd.min.js +4 -4
- package/dist/umd/file.umd.min.js.map +1 -1
- package/package.json +24 -25
package/dist/esm/file.d.ts
CHANGED
|
@@ -24,8 +24,9 @@ import * as common from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId The solution to contain the template
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
28
29
|
* @return A promise that will resolve when the template has been created
|
|
29
30
|
*/
|
|
30
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
31
32
|
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
package/dist/esm/file.js
CHANGED
|
@@ -25,10 +25,11 @@ import * as common from "@esri/solution-common";
|
|
|
25
25
|
*
|
|
26
26
|
* @param solutionItemId The solution to contain the template
|
|
27
27
|
* @param itemInfo Info about the item
|
|
28
|
-
* @param
|
|
28
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
29
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
29
30
|
* @return A promise that will resolve when the template has been created
|
|
30
31
|
*/
|
|
31
|
-
export function convertItemToTemplate(solutionItemId, itemInfo,
|
|
32
|
+
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication) {
|
|
32
33
|
return new Promise(resolve => {
|
|
33
34
|
// Init template
|
|
34
35
|
const itemTemplate = common.createInitializedItemTemplate(itemInfo);
|
|
@@ -38,7 +39,7 @@ export function convertItemToTemplate(solutionItemId, itemInfo, authentication)
|
|
|
38
39
|
const dataPromise = new Promise(dataResolve => {
|
|
39
40
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
40
41
|
common
|
|
41
|
-
.getItemDataAsFile(itemTemplate.itemId, itemTemplate.item.name,
|
|
42
|
+
.getItemDataAsFile(itemTemplate.itemId, itemTemplate.item.name, srcAuthentication)
|
|
42
43
|
.then(response => {
|
|
43
44
|
if (!response || response.size === 0) {
|
|
44
45
|
dataResolve(null);
|
|
@@ -62,7 +63,7 @@ export function convertItemToTemplate(solutionItemId, itemInfo, authentication)
|
|
|
62
63
|
? "_info_data"
|
|
63
64
|
: "_info_dataz"), resource.blob.name, common.SolutionTemplateFormatVersion);
|
|
64
65
|
common
|
|
65
|
-
.addResourceFromBlob(resource.blob, solutionItemId, storageName.folder, storageName.filename,
|
|
66
|
+
.addResourceFromBlob(resource.blob, solutionItemId, storageName.folder, storageName.filename, destAuthentication)
|
|
66
67
|
.then(() => {
|
|
67
68
|
itemTemplate.resources.push(storageName.folder + "/" + storageName.filename);
|
|
68
69
|
resolve(itemTemplate);
|
package/dist/esm/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,wHAAwH;AAExH
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/file.ts"],"names":[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IAAI,CAAC,CAAC,EAC9D,GAAG,EAAE,CACH,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAC/D,CAAC;aACL;iBAAM;gBACL,mCAAmC;gBACnC,eAAe,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,CAAC;gBAC3C,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG;oBACpC,MAAM,EAAE,cAAc,CAAC,EAAE;iBAC1B,CAAC;gBAEF,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EACnC,QAAQ,CAAC,6BAA6B,GAAG,CAAC,EAC1C,cAAc,CAAC,EAAE,CAClB,CAAC;gBAEF,OAAO,CAAC;oBACN,IAAI,EAAE,eAAe;oBACrB,EAAE,EAAE,cAAc,CAAC,EAAE;oBACrB,IAAI,EAAE,eAAe,CAAC,IAAI;oBAC1B,WAAW,EAAE,KAAK;iBACnB,CAAC,CAAC;aACJ;QACH,CAAC,EACD,GAAG,EAAE;YACH,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;YACF,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uBAAuB;QACvF,CAAC,CACF,CAAC;IACN,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/node/file.d.ts
CHANGED
|
@@ -24,8 +24,9 @@ import * as common from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId The solution to contain the template
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
28
29
|
* @return A promise that will resolve when the template has been created
|
|
29
30
|
*/
|
|
30
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
31
32
|
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
package/dist/node/file.js
CHANGED
|
@@ -16,22 +16,24 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
19
20
|
/**
|
|
20
21
|
* Manages the creation and deployment of item types that contain files.
|
|
21
22
|
*
|
|
22
23
|
* @module file
|
|
23
24
|
*/
|
|
24
|
-
const common = require("@esri/solution-common");
|
|
25
|
+
const common = (0, tslib_1.__importStar)(require("@esri/solution-common"));
|
|
25
26
|
// ------------------------------------------------------------------------------------------------------------------ //
|
|
26
27
|
/**
|
|
27
28
|
* Converts a file item into a template.
|
|
28
29
|
*
|
|
29
30
|
* @param solutionItemId The solution to contain the template
|
|
30
31
|
* @param itemInfo Info about the item
|
|
31
|
-
* @param
|
|
32
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
33
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
32
34
|
* @return A promise that will resolve when the template has been created
|
|
33
35
|
*/
|
|
34
|
-
function convertItemToTemplate(solutionItemId, itemInfo,
|
|
36
|
+
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication) {
|
|
35
37
|
return new Promise(resolve => {
|
|
36
38
|
// Init template
|
|
37
39
|
const itemTemplate = common.createInitializedItemTemplate(itemInfo);
|
|
@@ -41,7 +43,7 @@ function convertItemToTemplate(solutionItemId, itemInfo, authentication) {
|
|
|
41
43
|
const dataPromise = new Promise(dataResolve => {
|
|
42
44
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
43
45
|
common
|
|
44
|
-
.getItemDataAsFile(itemTemplate.itemId, itemTemplate.item.name,
|
|
46
|
+
.getItemDataAsFile(itemTemplate.itemId, itemTemplate.item.name, srcAuthentication)
|
|
45
47
|
.then(response => {
|
|
46
48
|
if (!response || response.size === 0) {
|
|
47
49
|
dataResolve(null);
|
|
@@ -65,7 +67,7 @@ function convertItemToTemplate(solutionItemId, itemInfo, authentication) {
|
|
|
65
67
|
? "_info_data"
|
|
66
68
|
: "_info_dataz"), resource.blob.name, common.SolutionTemplateFormatVersion);
|
|
67
69
|
common
|
|
68
|
-
.addResourceFromBlob(resource.blob, solutionItemId, storageName.folder, storageName.filename,
|
|
70
|
+
.addResourceFromBlob(resource.blob, solutionItemId, storageName.folder, storageName.filename, destAuthentication)
|
|
69
71
|
.then(() => {
|
|
70
72
|
itemTemplate.resources.push(storageName.folder + "/" + storageName.filename);
|
|
71
73
|
resolve(itemTemplate);
|
package/dist/node/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/file.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/file.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,2EAAgD;AAEhD,wHAAwH;AAExH;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC;IAErC,OAAO,IAAI,OAAO,CAAuB,OAAO,CAAC,EAAE;QACjD,gBAAgB;QAChB,MAAM,YAAY,GAAyB,MAAM,CAAC,6BAA6B,CAC7E,QAAQ,CACT,CAAC;QAEF,uCAAuC;QACvC,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,cAAc,CAC1C,YAAY,CAAC,IAAI,CAAC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cAAc,CAAC,EAAE,CAClB,CAAC;gBAEF,OAAO,CAAC;oBACN,IAAI,EAAE,eAAe;oBACrB,EAAE,EAAE,cAAc,CAAC,EAAE;oBACrB,IAAI,EAAE,eAAe,CAAC,IAAI;oBAC1B,WAAW,EAAE,KAAK;iBACnB,CAAC,CAAC;aACJ;QACH,CAAC,EACD,GAAG,EAAE;YACH,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;YACF,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uBAAuB;QACvF,CAAC,CACF,CAAC;IACN,CAAC,CAAC,CAAC;AACL,CAAC;AAnGD,wDAmGC"}
|
package/dist/umd/file.d.ts
CHANGED
|
@@ -24,8 +24,9 @@ import * as common from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId The solution to contain the template
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
28
29
|
* @return A promise that will resolve when the template has been created
|
|
29
30
|
*/
|
|
30
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
31
32
|
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
package/dist/umd/file.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-file - v1.
|
|
3
|
-
* Copyright (c) 2018-
|
|
4
|
-
*
|
|
2
|
+
* @esri/solution-file - v1.3.0 - Apache-2.0
|
|
3
|
+
* Copyright (c) 2018-2022 Esri, Inc.
|
|
4
|
+
* Thu Feb 17 2022 09:42:25 GMT-0800 (Pacific Standard Time)
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -18,8 +18,28 @@
|
|
|
18
18
|
(function (global, factory) {
|
|
19
19
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@esri/solution-common')) :
|
|
20
20
|
typeof define === 'function' && define.amd ? define(['exports', '@esri/solution-common'], factory) :
|
|
21
|
-
(global = global || self, factory(global.arcgisSolution = global.arcgisSolution || {}, global.arcgisSolution));
|
|
22
|
-
}(this, (function (exports, common) { 'use strict';
|
|
21
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.arcgisSolution = global.arcgisSolution || {}, global.arcgisSolution));
|
|
22
|
+
})(this, (function (exports, common) { 'use strict';
|
|
23
|
+
|
|
24
|
+
function _interopNamespace(e) {
|
|
25
|
+
if (e && e.__esModule) return e;
|
|
26
|
+
var n = Object.create(null);
|
|
27
|
+
if (e) {
|
|
28
|
+
Object.keys(e).forEach(function (k) {
|
|
29
|
+
if (k !== 'default') {
|
|
30
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
31
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return e[k]; }
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
n["default"] = e;
|
|
39
|
+
return Object.freeze(n);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var common__namespace = /*#__PURE__*/_interopNamespace(common);
|
|
23
43
|
|
|
24
44
|
/** @license
|
|
25
45
|
* Copyright 2018 Esri
|
|
@@ -42,19 +62,21 @@
|
|
|
42
62
|
*
|
|
43
63
|
* @param solutionItemId The solution to contain the template
|
|
44
64
|
* @param itemInfo Info about the item
|
|
45
|
-
* @param
|
|
65
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
66
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
46
67
|
* @return A promise that will resolve when the template has been created
|
|
47
68
|
*/
|
|
48
|
-
function convertItemToTemplate(solutionItemId, itemInfo,
|
|
69
|
+
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication) {
|
|
49
70
|
return new Promise(resolve => {
|
|
50
71
|
// Init template
|
|
51
|
-
const itemTemplate =
|
|
72
|
+
const itemTemplate = common__namespace.createInitializedItemTemplate(itemInfo);
|
|
52
73
|
// Templatize item info property values
|
|
53
|
-
itemTemplate.item.id =
|
|
74
|
+
itemTemplate.item.id = common__namespace.templatizeTerm(itemTemplate.item.id, itemTemplate.item.id, ".itemId");
|
|
54
75
|
// Request file
|
|
55
76
|
const dataPromise = new Promise(dataResolve => {
|
|
56
77
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
57
|
-
|
|
78
|
+
common__namespace
|
|
79
|
+
.getItemDataAsFile(itemTemplate.itemId, itemTemplate.item.name, srcAuthentication)
|
|
58
80
|
.then(response => {
|
|
59
81
|
if (!response || response.size === 0) {
|
|
60
82
|
dataResolve(null);
|
|
@@ -71,13 +93,14 @@
|
|
|
71
93
|
Promise.all([dataPromise, relatedPromise]).then(responses => {
|
|
72
94
|
const [itemDataResponse] = responses;
|
|
73
95
|
if (itemDataResponse) {
|
|
74
|
-
const resource =
|
|
96
|
+
const resource = common__namespace.convertBlobToSupportableResource(itemDataResponse, itemTemplate.item.name);
|
|
75
97
|
itemTemplate.properties[resource.filename] = resource.mimeType;
|
|
76
|
-
const storageName =
|
|
98
|
+
const storageName = common__namespace.convertItemResourceToStorageResource(itemTemplate.itemId +
|
|
77
99
|
(resource.blob.name === resource.filename
|
|
78
100
|
? "_info_data"
|
|
79
|
-
: "_info_dataz"), resource.blob.name,
|
|
80
|
-
|
|
101
|
+
: "_info_dataz"), resource.blob.name, common__namespace.SolutionTemplateFormatVersion);
|
|
102
|
+
common__namespace
|
|
103
|
+
.addResourceFromBlob(resource.blob, solutionItemId, storageName.folder, storageName.filename, destAuthentication)
|
|
81
104
|
.then(() => {
|
|
82
105
|
itemTemplate.resources.push(storageName.folder + "/" + storageName.filename);
|
|
83
106
|
resolve(itemTemplate);
|
|
@@ -95,26 +118,28 @@
|
|
|
95
118
|
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
96
119
|
return new Promise(resolve => {
|
|
97
120
|
// Interrupt process if progress callback returns `false`
|
|
98
|
-
if (!itemProgressCallback(template.itemId,
|
|
99
|
-
itemProgressCallback(template.itemId,
|
|
100
|
-
resolve(
|
|
121
|
+
if (!itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Started, 0)) {
|
|
122
|
+
itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Ignored, 0);
|
|
123
|
+
resolve(common__namespace.generateEmptyCreationResponse(template.type));
|
|
101
124
|
return;
|
|
102
125
|
}
|
|
103
126
|
// Replace the templatized symbols in a copy of the template
|
|
104
|
-
let newItemTemplate =
|
|
105
|
-
newItemTemplate =
|
|
127
|
+
let newItemTemplate = common__namespace.cloneObject(template);
|
|
128
|
+
newItemTemplate = common__namespace.replaceInTemplate(newItemTemplate, templateDictionary);
|
|
106
129
|
/* istanbul ignore else */
|
|
107
130
|
if (template.item.thumbnail) {
|
|
108
131
|
newItemTemplate.item.thumbnail = template.item.thumbnail;
|
|
109
132
|
}
|
|
110
133
|
// Create the item, then update its URL with its new id
|
|
111
|
-
|
|
134
|
+
common__namespace
|
|
135
|
+
.createItemWithData(newItemTemplate.item, newItemTemplate.data, destinationAuthentication, templateDictionary.folderId)
|
|
112
136
|
.then(createResponse => {
|
|
113
137
|
// Interrupt process if progress callback returns `false`
|
|
114
|
-
if (!itemProgressCallback(template.itemId,
|
|
115
|
-
itemProgressCallback(template.itemId,
|
|
116
|
-
|
|
117
|
-
.
|
|
138
|
+
if (!itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.id)) {
|
|
139
|
+
itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Cancelled, 0);
|
|
140
|
+
common__namespace
|
|
141
|
+
.removeItem(createResponse.id, destinationAuthentication)
|
|
142
|
+
.then(() => resolve(common__namespace.generateEmptyCreationResponse(template.type)), () => resolve(common__namespace.generateEmptyCreationResponse(template.type)));
|
|
118
143
|
}
|
|
119
144
|
else {
|
|
120
145
|
// Add the new item to the settings
|
|
@@ -122,7 +147,7 @@
|
|
|
122
147
|
templateDictionary[template.itemId] = {
|
|
123
148
|
itemId: createResponse.id
|
|
124
149
|
};
|
|
125
|
-
itemProgressCallback(template.itemId,
|
|
150
|
+
itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor / 2, createResponse.id);
|
|
126
151
|
resolve({
|
|
127
152
|
item: newItemTemplate,
|
|
128
153
|
id: createResponse.id,
|
|
@@ -131,8 +156,8 @@
|
|
|
131
156
|
});
|
|
132
157
|
}
|
|
133
158
|
}, () => {
|
|
134
|
-
itemProgressCallback(template.itemId,
|
|
135
|
-
resolve(
|
|
159
|
+
itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Failed, 0);
|
|
160
|
+
resolve(common__namespace.generateEmptyCreationResponse(template.type)); // fails to create item
|
|
136
161
|
});
|
|
137
162
|
});
|
|
138
163
|
}
|
|
@@ -142,5 +167,5 @@
|
|
|
142
167
|
|
|
143
168
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
144
169
|
|
|
145
|
-
}))
|
|
170
|
+
}));
|
|
146
171
|
//# sourceMappingURL=file.umd.js.map
|
package/dist/umd/file.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.umd.js","sources":["../../src/file.ts"],"sourcesContent":["/** @license\r\n * Copyright 2018 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Manages the creation and deployment of item types that contain files.\r\n *\r\n * @module file\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Converts a file item into a template.\r\n *\r\n * @param solutionItemId The solution to contain the template\r\n * @param itemInfo Info about the item\r\n * @param authentication Credentials for working with AGO\r\n * @return A promise that will resolve when the template has been created\r\n */\r\nexport function convertItemToTemplate(\r\n solutionItemId: string,\r\n itemInfo: any,\r\n authentication: common.UserSession\r\n): Promise<common.IItemTemplate> {\r\n return new Promise<common.IItemTemplate>(resolve => {\r\n // Init template\r\n const itemTemplate: common.IItemTemplate = common.createInitializedItemTemplate(\r\n itemInfo\r\n );\r\n\r\n // Templatize item info property values\r\n itemTemplate.item.id = common.templatizeTerm(\r\n itemTemplate.item.id,\r\n itemTemplate.item.id,\r\n \".itemId\"\r\n );\r\n\r\n // Request file\r\n const dataPromise = new Promise<File>(dataResolve => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .getItemDataAsFile(\r\n itemTemplate.itemId,\r\n itemTemplate.item.name,\r\n authentication\r\n )\r\n .then(response => {\r\n if (!response || response.size === 0) {\r\n dataResolve(null);\r\n } else {\r\n dataResolve(response);\r\n }\r\n });\r\n });\r\n\r\n // Request related items\r\n const relatedPromise = Promise.resolve(\r\n {} as common.IGetRelatedItemsResponse\r\n );\r\n\r\n // Errors are handled as resolved empty values; this means that there's no `reject` clause to handle, hence:\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n Promise.all([dataPromise, relatedPromise]).then(responses => {\r\n const [itemDataResponse] = responses;\r\n\r\n if (itemDataResponse) {\r\n const resource: common.IFileMimeTyped = common.convertBlobToSupportableResource(\r\n itemDataResponse,\r\n itemTemplate.item.name\r\n );\r\n itemTemplate.properties[resource.filename] = resource.mimeType;\r\n\r\n const storageName = common.convertItemResourceToStorageResource(\r\n itemTemplate.itemId +\r\n ((resource.blob as File).name === resource.filename\r\n ? \"_info_data\"\r\n : \"_info_dataz\"),\r\n (resource.blob as File).name,\r\n common.SolutionTemplateFormatVersion\r\n );\r\n common\r\n .addResourceFromBlob(\r\n resource.blob,\r\n solutionItemId,\r\n storageName.folder,\r\n storageName.filename,\r\n authentication\r\n )\r\n .then(\r\n () => {\r\n itemTemplate.resources.push(\r\n storageName.folder + \"/\" + storageName.filename\r\n );\r\n resolve(itemTemplate);\r\n },\r\n error => {\r\n itemTemplate.properties[\"error\"] = JSON.stringify(error);\r\n resolve(itemTemplate);\r\n }\r\n );\r\n } else {\r\n resolve(itemTemplate);\r\n }\r\n });\r\n });\r\n}\r\n\r\nexport function createItemFromTemplate(\r\n template: common.IItemTemplate,\r\n templateDictionary: any,\r\n destinationAuthentication: common.UserSession,\r\n itemProgressCallback: common.IItemProgressCallback\r\n): Promise<common.ICreateItemFromTemplateResponse> {\r\n return new Promise<common.ICreateItemFromTemplateResponse>(resolve => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Started,\r\n 0\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Ignored,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type));\r\n return;\r\n }\r\n\r\n // Replace the templatized symbols in a copy of the template\r\n let newItemTemplate: common.IItemTemplate = common.cloneObject(template);\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n /* istanbul ignore else */\r\n if (template.item.thumbnail) {\r\n newItemTemplate.item.thumbnail = template.item.thumbnail;\r\n }\r\n\r\n // Create the item, then update its URL with its new id\r\n common\r\n .createItemWithData(\r\n newItemTemplate.item,\r\n newItemTemplate.data,\r\n destinationAuthentication,\r\n templateDictionary.folderId\r\n )\r\n .then(\r\n createResponse => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n common\r\n .removeItem(createResponse.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type)),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n // Add the new item to the settings\r\n newItemTemplate.itemId = createResponse.id;\r\n templateDictionary[template.itemId] = {\r\n itemId: createResponse.id\r\n };\r\n\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Finished,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.id\r\n );\r\n\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.id,\r\n type: newItemTemplate.type,\r\n postProcess: false\r\n });\r\n }\r\n },\r\n () => {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n );\r\n });\r\n}\r\n"],"names":["common.createInitializedItemTemplate","common.templatizeTerm","common\r\n .getItemDataAsFile","common.convertBlobToSupportableResource","common.convertItemResourceToStorageResource","common.SolutionTemplateFormatVersion","common\r\n .addResourceFromBlob","common.EItemProgressStatus","common.generateEmptyCreationResponse","common.cloneObject","common.replaceInTemplate","common\r\n .createItemWithData","common\r\n .removeItem"],"mappings":";;;;;;;;;;;;;;;;;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CAAC,MAAM,EACfA,0BAA0B,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;cACF,OAAO,CAACC,oCAAoC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;WAC9D,CACF,CAAC;OACL,CAAC,CAAC;EACL;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"file.umd.js","sources":["../../src/file.ts"],"sourcesContent":["/** @license\r\n * Copyright 2018 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Manages the creation and deployment of item types that contain files.\r\n *\r\n * @module file\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Converts a file item into a template.\r\n *\r\n * @param solutionItemId The solution to contain the template\r\n * @param itemInfo Info about the item\r\n * @param destAuthentication Credentials for requests to the destination organization\r\n * @param srcAuthentication Credentials for requests to source items\r\n * @return A promise that will resolve when the template has been created\r\n */\r\nexport function convertItemToTemplate(\r\n solutionItemId: string,\r\n itemInfo: any,\r\n destAuthentication: common.UserSession,\r\n srcAuthentication: common.UserSession\r\n): Promise<common.IItemTemplate> {\r\n return new Promise<common.IItemTemplate>(resolve => {\r\n // Init template\r\n const itemTemplate: common.IItemTemplate = common.createInitializedItemTemplate(\r\n itemInfo\r\n );\r\n\r\n // Templatize item info property values\r\n itemTemplate.item.id = common.templatizeTerm(\r\n itemTemplate.item.id,\r\n itemTemplate.item.id,\r\n \".itemId\"\r\n );\r\n\r\n // Request file\r\n const dataPromise = new Promise<File>(dataResolve => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .getItemDataAsFile(\r\n itemTemplate.itemId,\r\n itemTemplate.item.name,\r\n srcAuthentication\r\n )\r\n .then(response => {\r\n if (!response || response.size === 0) {\r\n dataResolve(null);\r\n } else {\r\n dataResolve(response);\r\n }\r\n });\r\n });\r\n\r\n // Request related items\r\n const relatedPromise = Promise.resolve(\r\n {} as common.IGetRelatedItemsResponse\r\n );\r\n\r\n // Errors are handled as resolved empty values; this means that there's no `reject` clause to handle, hence:\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n Promise.all([dataPromise, relatedPromise]).then(responses => {\r\n const [itemDataResponse] = responses;\r\n\r\n if (itemDataResponse) {\r\n const resource: common.IFileMimeTyped = common.convertBlobToSupportableResource(\r\n itemDataResponse,\r\n itemTemplate.item.name\r\n );\r\n itemTemplate.properties[resource.filename] = resource.mimeType;\r\n\r\n const storageName = common.convertItemResourceToStorageResource(\r\n itemTemplate.itemId +\r\n ((resource.blob as File).name === resource.filename\r\n ? \"_info_data\"\r\n : \"_info_dataz\"),\r\n (resource.blob as File).name,\r\n common.SolutionTemplateFormatVersion\r\n );\r\n common\r\n .addResourceFromBlob(\r\n resource.blob,\r\n solutionItemId,\r\n storageName.folder,\r\n storageName.filename,\r\n destAuthentication\r\n )\r\n .then(\r\n () => {\r\n itemTemplate.resources.push(\r\n storageName.folder + \"/\" + storageName.filename\r\n );\r\n resolve(itemTemplate);\r\n },\r\n error => {\r\n itemTemplate.properties[\"error\"] = JSON.stringify(error);\r\n resolve(itemTemplate);\r\n }\r\n );\r\n } else {\r\n resolve(itemTemplate);\r\n }\r\n });\r\n });\r\n}\r\n\r\nexport function createItemFromTemplate(\r\n template: common.IItemTemplate,\r\n templateDictionary: any,\r\n destinationAuthentication: common.UserSession,\r\n itemProgressCallback: common.IItemProgressCallback\r\n): Promise<common.ICreateItemFromTemplateResponse> {\r\n return new Promise<common.ICreateItemFromTemplateResponse>(resolve => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Started,\r\n 0\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Ignored,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type));\r\n return;\r\n }\r\n\r\n // Replace the templatized symbols in a copy of the template\r\n let newItemTemplate: common.IItemTemplate = common.cloneObject(template);\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n /* istanbul ignore else */\r\n if (template.item.thumbnail) {\r\n newItemTemplate.item.thumbnail = template.item.thumbnail;\r\n }\r\n\r\n // Create the item, then update its URL with its new id\r\n common\r\n .createItemWithData(\r\n newItemTemplate.item,\r\n newItemTemplate.data,\r\n destinationAuthentication,\r\n templateDictionary.folderId\r\n )\r\n .then(\r\n createResponse => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n common\r\n .removeItem(createResponse.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type)),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n // Add the new item to the settings\r\n newItemTemplate.itemId = createResponse.id;\r\n templateDictionary[template.itemId] = {\r\n itemId: createResponse.id\r\n };\r\n\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Finished,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.id\r\n );\r\n\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.id,\r\n type: newItemTemplate.type,\r\n postProcess: false\r\n });\r\n }\r\n },\r\n () => {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n );\r\n });\r\n}\r\n"],"names":["common"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;;;;;;EAwBA;EAEA;;;;;;;;;WASgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC;MAErC,OAAO,IAAI,OAAO,CAAuB,OAAO;;UAE9C,MAAM,YAAY,GAAyBA,iBAAM,CAAC,6BAA6B,CAC7E,QAAQ,CACT,CAAC;;UAGF,YAAY,CAAC,IAAI,CAAC,EAAE,GAAGA,iBAAM,CAAC,cAAc,CAC1C,YAAY,CAAC,IAAI,CAAC,EAAE,EACpB,YAAY,CAAC,IAAI,CAAC,EAAE,EACpB,SAAS,CACV,CAAC;;UAGF,MAAM,WAAW,GAAG,IAAI,OAAO,CAAO,WAAW;;cAE/CA,iBAAM;mBACH,iBAAiB,CAChB,YAAY,CAAC,MAAM,EACnB,YAAY,CAAC,IAAI,CAAC,IAAI,EACtB,iBAAiB,CAClB;mBACA,IAAI,CAAC,QAAQ;kBACZ,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE;sBACpC,WAAW,CAAC,IAAI,CAAC,CAAC;mBACnB;uBAAM;sBACL,WAAW,CAAC,QAAQ,CAAC,CAAC;mBACvB;eACF,CAAC,CAAC;WACN,CAAC,CAAC;;UAGH,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CACpC,EAAqC,CACtC,CAAC;;;UAIF,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;cACvD,MAAM,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;cAErC,IAAI,gBAAgB,EAAE;kBACpB,MAAM,QAAQ,GAA0BA,iBAAM,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QAAQ,CAAC,MAAM,CAAC,GAAG;sBACpC,MAAM,EAAE,cAAc,CAAC,EAAE;mBAC1B,CAAC;kBAEF,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACfA,iBAAM,CAAC,mBAAmB,CAAC,QAAQ,EACnC,QAAQ,CAAC,6BAA6B,GAAG,CAAC,EAC1C,cAAc,CAAC,EAAE,CAClB,CAAC;kBAEF,OAAO,CAAC;sBACN,IAAI,EAAE,eAAe;sBACrB,EAAE,EAAE,cAAc,CAAC,EAAE;sBACrB,IAAI,EAAE,eAAe,CAAC,IAAI;sBAC1B,WAAW,EAAE,KAAK;mBACnB,CAAC,CAAC;eACJ;WACF,EACD;cACE,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACfA,iBAAM,CAAC,mBAAmB,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;cACF,OAAO,CAACA,iBAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;WAC9D,CACF,CAAC;OACL,CAAC,CAAC;EACL;;;;;;;;;;;"}
|
package/dist/umd/file.umd.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-file - v1.
|
|
3
|
-
* Copyright (c) 2018-
|
|
4
|
-
*
|
|
2
|
+
* @esri/solution-file - v1.3.0 - Apache-2.0
|
|
3
|
+
* Copyright (c) 2018-2022 Esri, Inc.
|
|
4
|
+
* Thu Feb 17 2022 09:42:33 GMT-0800 (Pacific Standard Time)
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@esri/solution-common")):"function"==typeof define&&define.amd?define(["exports","@esri/solution-common"],t):t((e=e||self).arcgisSolution=e.arcgisSolution||{},e.arcgisSolution)}(this,(function(e,t){"use strict";e.
|
|
18
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@esri/solution-common")):"function"==typeof define&&define.amd?define(["exports","@esri/solution-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arcgisSolution=e.arcgisSolution||{},e.arcgisSolution)}(this,(function(e,t){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var i=o(t);e.convertItemToTemplate=function(e,t,o,r){return new Promise((n=>{const m=i.createInitializedItemTemplate(t);m.item.id=i.templatizeTerm(m.item.id,m.item.id,".itemId");const s=new Promise((e=>{i.getItemDataAsFile(m.itemId,m.item.name,r).then((t=>{t&&0!==t.size?e(t):e(null)}))})),a=Promise.resolve({});Promise.all([s,a]).then((t=>{const[r]=t;if(r){const t=i.convertBlobToSupportableResource(r,m.item.name);m.properties[t.filename]=t.mimeType;const s=i.convertItemResourceToStorageResource(m.itemId+(t.blob.name===t.filename?"_info_data":"_info_dataz"),t.blob.name,i.SolutionTemplateFormatVersion);i.addResourceFromBlob(t.blob,e,s.folder,s.filename,o).then((()=>{m.resources.push(s.folder+"/"+s.filename),n(m)}),(e=>{m.properties.error=JSON.stringify(e),n(m)}))}else n(m)}))}))},e.createItemFromTemplate=function(e,t,o,r){return new Promise((n=>{if(!r(e.itemId,i.EItemProgressStatus.Started,0))return r(e.itemId,i.EItemProgressStatus.Ignored,0),void n(i.generateEmptyCreationResponse(e.type));let m=i.cloneObject(e);m=i.replaceInTemplate(m,t),e.item.thumbnail&&(m.item.thumbnail=e.item.thumbnail),i.createItemWithData(m.item,m.data,o,t.folderId).then((s=>{r(e.itemId,i.EItemProgressStatus.Created,e.estimatedDeploymentCostFactor/2,s.id)?(m.itemId=s.id,t[e.itemId]={itemId:s.id},r(e.itemId,i.EItemProgressStatus.Finished,e.estimatedDeploymentCostFactor/2,s.id),n({item:m,id:s.id,type:m.type,postProcess:!1})):(r(e.itemId,i.EItemProgressStatus.Cancelled,0),i.removeItem(s.id,o).then((()=>n(i.generateEmptyCreationResponse(e.type))),(()=>n(i.generateEmptyCreationResponse(e.type)))))}),(()=>{r(e.itemId,i.EItemProgressStatus.Failed,0),n(i.generateEmptyCreationResponse(e.type))}))}))},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
19
19
|
//# sourceMappingURL=file.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.umd.min.js","sources":["../../src/file.ts"],"sourcesContent":["/** @license\r\n * Copyright 2018 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Manages the creation and deployment of item types that contain files.\r\n *\r\n * @module file\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Converts a file item into a template.\r\n *\r\n * @param solutionItemId The solution to contain the template\r\n * @param itemInfo Info about the item\r\n * @param authentication Credentials for working with AGO\r\n * @return A promise that will resolve when the template has been created\r\n */\r\nexport function convertItemToTemplate(\r\n solutionItemId: string,\r\n itemInfo: any,\r\n authentication: common.UserSession\r\n): Promise<common.IItemTemplate> {\r\n return new Promise<common.IItemTemplate>(resolve => {\r\n // Init template\r\n const itemTemplate: common.IItemTemplate = common.createInitializedItemTemplate(\r\n itemInfo\r\n );\r\n\r\n // Templatize item info property values\r\n itemTemplate.item.id = common.templatizeTerm(\r\n itemTemplate.item.id,\r\n itemTemplate.item.id,\r\n \".itemId\"\r\n );\r\n\r\n // Request file\r\n const dataPromise = new Promise<File>(dataResolve => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .getItemDataAsFile(\r\n itemTemplate.itemId,\r\n itemTemplate.item.name,\r\n authentication\r\n )\r\n .then(response => {\r\n if (!response || response.size === 0) {\r\n dataResolve(null);\r\n } else {\r\n dataResolve(response);\r\n }\r\n });\r\n });\r\n\r\n // Request related items\r\n const relatedPromise = Promise.resolve(\r\n {} as common.IGetRelatedItemsResponse\r\n );\r\n\r\n // Errors are handled as resolved empty values; this means that there's no `reject` clause to handle, hence:\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n Promise.all([dataPromise, relatedPromise]).then(responses => {\r\n const [itemDataResponse] = responses;\r\n\r\n if (itemDataResponse) {\r\n const resource: common.IFileMimeTyped = common.convertBlobToSupportableResource(\r\n itemDataResponse,\r\n itemTemplate.item.name\r\n );\r\n itemTemplate.properties[resource.filename] = resource.mimeType;\r\n\r\n const storageName = common.convertItemResourceToStorageResource(\r\n itemTemplate.itemId +\r\n ((resource.blob as File).name === resource.filename\r\n ? \"_info_data\"\r\n : \"_info_dataz\"),\r\n (resource.blob as File).name,\r\n common.SolutionTemplateFormatVersion\r\n );\r\n common\r\n .addResourceFromBlob(\r\n resource.blob,\r\n solutionItemId,\r\n storageName.folder,\r\n storageName.filename,\r\n authentication\r\n )\r\n .then(\r\n () => {\r\n itemTemplate.resources.push(\r\n storageName.folder + \"/\" + storageName.filename\r\n );\r\n resolve(itemTemplate);\r\n },\r\n error => {\r\n itemTemplate.properties[\"error\"] = JSON.stringify(error);\r\n resolve(itemTemplate);\r\n }\r\n );\r\n } else {\r\n resolve(itemTemplate);\r\n }\r\n });\r\n });\r\n}\r\n\r\nexport function createItemFromTemplate(\r\n template: common.IItemTemplate,\r\n templateDictionary: any,\r\n destinationAuthentication: common.UserSession,\r\n itemProgressCallback: common.IItemProgressCallback\r\n): Promise<common.ICreateItemFromTemplateResponse> {\r\n return new Promise<common.ICreateItemFromTemplateResponse>(resolve => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Started,\r\n 0\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Ignored,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type));\r\n return;\r\n }\r\n\r\n // Replace the templatized symbols in a copy of the template\r\n let newItemTemplate: common.IItemTemplate = common.cloneObject(template);\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n /* istanbul ignore else */\r\n if (template.item.thumbnail) {\r\n newItemTemplate.item.thumbnail = template.item.thumbnail;\r\n }\r\n\r\n // Create the item, then update its URL with its new id\r\n common\r\n .createItemWithData(\r\n newItemTemplate.item,\r\n newItemTemplate.data,\r\n destinationAuthentication,\r\n templateDictionary.folderId\r\n )\r\n .then(\r\n createResponse => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n common\r\n .removeItem(createResponse.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type)),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n // Add the new item to the settings\r\n newItemTemplate.itemId = createResponse.id;\r\n templateDictionary[template.itemId] = {\r\n itemId: createResponse.id\r\n };\r\n\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Finished,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.id\r\n );\r\n\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.id,\r\n type: newItemTemplate.type,\r\n postProcess: false\r\n });\r\n }\r\n },\r\n () => {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n );\r\n });\r\n}\r\n"],"names":["solutionItemId","itemInfo","authentication","Promise","resolve","itemTemplate","common.createInitializedItemTemplate","item","id","common.templatizeTerm","dataPromise","dataResolve","common\r\n .getItemDataAsFile","itemId","name","then","response","size","relatedPromise","all","responses","itemDataResponse","resource","common.convertBlobToSupportableResource","properties","filename","mimeType","storageName","common.convertItemResourceToStorageResource","blob","common.SolutionTemplateFormatVersion","common\r\n .addResourceFromBlob","folder","resources","push","error","JSON","stringify","template","templateDictionary","destinationAuthentication","itemProgressCallback","common.EItemProgressStatus","Started","Ignored","common.generateEmptyCreationResponse","type","newItemTemplate","common.cloneObject","common.replaceInTemplate","thumbnail","common\r\n .createItemWithData","data","folderId","createResponse","Created","estimatedDeploymentCostFactor","Finished","postProcess","Cancelled","common\r\n .removeItem","Failed"],"mappings":";;;;;;;;;;;;;;;;;2UAmCEA,EACAC,EACAC,GAEA,OAAO,IAAIC,SAA8BC,IAEvC,MAAMC,EAAqCC,gCACzCL,GAIFI,EAAaE,KAAKC,GAAKC,iBACrBJ,EAAaE,KAAKC,GAClBH,EAAaE,KAAKC,GAClB,WAIF,MAAME,EAAc,IAAIP,SAAcQ,IAEpCC,oBAEIP,EAAaQ,OACbR,EAAaE,KAAKO,KAClBZ,GAEDa,MAAKC,IACCA,GAA8B,IAAlBA,EAASC,KAGxBN,EAAYK,GAFZL,EAAY,YAQdO,EAAiBf,QAAQC,QAC7B,IAKFD,QAAQgB,IAAI,CAACT,EAAaQ,IAAiBH,MAAKK,IAC9C,MAAOC,GAAoBD,EAE3B,GAAIC,EAAkB,C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B,GAEFC,aACcN,EAAe9C,GAAIgC,GAC9BzB,MACC,IACEX,EAAQyC,gCAAqCP,EAASQ,SACxD,IACE1C,EAAQyC,gCAAqCP,EAASQ,aAwBhE,KACEL,EACEH,EAASzB,OACT6B,sBAA2BmB,OAC3B,GAEFzD,EAAQyC,gCAAqCP,EAASQ"}
|
|
1
|
+
{"version":3,"file":"file.umd.min.js","sources":["../../src/file.ts"],"sourcesContent":["/** @license\r\n * Copyright 2018 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Manages the creation and deployment of item types that contain files.\r\n *\r\n * @module file\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Converts a file item into a template.\r\n *\r\n * @param solutionItemId The solution to contain the template\r\n * @param itemInfo Info about the item\r\n * @param destAuthentication Credentials for requests to the destination organization\r\n * @param srcAuthentication Credentials for requests to source items\r\n * @return A promise that will resolve when the template has been created\r\n */\r\nexport function convertItemToTemplate(\r\n solutionItemId: string,\r\n itemInfo: any,\r\n destAuthentication: common.UserSession,\r\n srcAuthentication: common.UserSession\r\n): Promise<common.IItemTemplate> {\r\n return new Promise<common.IItemTemplate>(resolve => {\r\n // Init template\r\n const itemTemplate: common.IItemTemplate = common.createInitializedItemTemplate(\r\n itemInfo\r\n );\r\n\r\n // Templatize item info property values\r\n itemTemplate.item.id = common.templatizeTerm(\r\n itemTemplate.item.id,\r\n itemTemplate.item.id,\r\n \".itemId\"\r\n );\r\n\r\n // Request file\r\n const dataPromise = new Promise<File>(dataResolve => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .getItemDataAsFile(\r\n itemTemplate.itemId,\r\n itemTemplate.item.name,\r\n srcAuthentication\r\n )\r\n .then(response => {\r\n if (!response || response.size === 0) {\r\n dataResolve(null);\r\n } else {\r\n dataResolve(response);\r\n }\r\n });\r\n });\r\n\r\n // Request related items\r\n const relatedPromise = Promise.resolve(\r\n {} as common.IGetRelatedItemsResponse\r\n );\r\n\r\n // Errors are handled as resolved empty values; this means that there's no `reject` clause to handle, hence:\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n Promise.all([dataPromise, relatedPromise]).then(responses => {\r\n const [itemDataResponse] = responses;\r\n\r\n if (itemDataResponse) {\r\n const resource: common.IFileMimeTyped = common.convertBlobToSupportableResource(\r\n itemDataResponse,\r\n itemTemplate.item.name\r\n );\r\n itemTemplate.properties[resource.filename] = resource.mimeType;\r\n\r\n const storageName = common.convertItemResourceToStorageResource(\r\n itemTemplate.itemId +\r\n ((resource.blob as File).name === resource.filename\r\n ? \"_info_data\"\r\n : \"_info_dataz\"),\r\n (resource.blob as File).name,\r\n common.SolutionTemplateFormatVersion\r\n );\r\n common\r\n .addResourceFromBlob(\r\n resource.blob,\r\n solutionItemId,\r\n storageName.folder,\r\n storageName.filename,\r\n destAuthentication\r\n )\r\n .then(\r\n () => {\r\n itemTemplate.resources.push(\r\n storageName.folder + \"/\" + storageName.filename\r\n );\r\n resolve(itemTemplate);\r\n },\r\n error => {\r\n itemTemplate.properties[\"error\"] = JSON.stringify(error);\r\n resolve(itemTemplate);\r\n }\r\n );\r\n } else {\r\n resolve(itemTemplate);\r\n }\r\n });\r\n });\r\n}\r\n\r\nexport function createItemFromTemplate(\r\n template: common.IItemTemplate,\r\n templateDictionary: any,\r\n destinationAuthentication: common.UserSession,\r\n itemProgressCallback: common.IItemProgressCallback\r\n): Promise<common.ICreateItemFromTemplateResponse> {\r\n return new Promise<common.ICreateItemFromTemplateResponse>(resolve => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Started,\r\n 0\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Ignored,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type));\r\n return;\r\n }\r\n\r\n // Replace the templatized symbols in a copy of the template\r\n let newItemTemplate: common.IItemTemplate = common.cloneObject(template);\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n /* istanbul ignore else */\r\n if (template.item.thumbnail) {\r\n newItemTemplate.item.thumbnail = template.item.thumbnail;\r\n }\r\n\r\n // Create the item, then update its URL with its new id\r\n common\r\n .createItemWithData(\r\n newItemTemplate.item,\r\n newItemTemplate.data,\r\n destinationAuthentication,\r\n templateDictionary.folderId\r\n )\r\n .then(\r\n createResponse => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n common\r\n .removeItem(createResponse.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type)),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n // Add the new item to the settings\r\n newItemTemplate.itemId = createResponse.id;\r\n templateDictionary[template.itemId] = {\r\n itemId: createResponse.id\r\n };\r\n\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Finished,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.id\r\n );\r\n\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.id,\r\n type: newItemTemplate.type,\r\n postProcess: false\r\n });\r\n }\r\n },\r\n () => {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n );\r\n });\r\n}\r\n"],"names":["solutionItemId","itemInfo","destAuthentication","srcAuthentication","Promise","resolve","itemTemplate","common","createInitializedItemTemplate","item","id","templatizeTerm","dataPromise","dataResolve","getItemDataAsFile","itemId","name","then","response","size","relatedPromise","all","responses","itemDataResponse","resource","convertBlobToSupportableResource","properties","filename","mimeType","storageName","convertItemResourceToStorageResource","blob","SolutionTemplateFormatVersion","addResourceFromBlob","folder","resources","push","error","JSON","stringify","template","templateDictionary","destinationAuthentication","itemProgressCallback","EItemProgressStatus","Started","Ignored","generateEmptyCreationResponse","type","newItemTemplate","cloneObject","replaceInTemplate","thumbnail","createItemWithData","data","folderId","createResponse","Created","estimatedDeploymentCostFactor","Finished","postProcess","Cancelled","removeItem","Failed"],"mappings":";;;;;;;;;;;;;;;;;+pBAoCEA,EACAC,EACAC,EACAC,GAEA,OAAO,IAAIC,SAA8BC,IAEvC,MAAMC,EAAqCC,EAAOC,8BAChDP,GAIFK,EAAaG,KAAKC,GAAKH,EAAOI,eAC5BL,EAAaG,KAAKC,GAClBJ,EAAaG,KAAKC,GAClB,WAIF,MAAME,EAAc,IAAIR,SAAcS,IAEpCN,EACGO,kBACCR,EAAaS,OACbT,EAAaG,KAAKO,KAClBb,GAEDc,MAAKC,IACCA,GAA8B,IAAlBA,EAASC,KAGxBN,EAAYK,GAFZL,EAAY,YAQdO,EAAiBhB,QAAQC,QAC7B,IAKFD,QAAQiB,IAAI,CAACT,EAAaQ,IAAiBH,MAAKK,IAC9C,MAAOC,GAAoBD,EAE3B,GAAIC,EAAkB,CACpB,MAAMC,EAAkCjB,EAAOkB,iCAC7CF,EACAjB,EAAaG,KAAKO,MAEpBV,EAAaoB,WAAWF,EAASG,UAAYH,EAASI,SAEtD,MAAMC,EAActB,EAAOuB,qCACzBxB,EAAaS,Q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MACC,IACEZ,EAAQE,EAAOwC,8BAA8BP,EAASQ,SACxD,IACE3C,EAAQE,EAAOwC,8BAA8BP,EAASQ,aAwBhE,KACEL,EACEH,EAASzB,OACTR,EAAOqC,oBAAoBmB,OAC3B,GAEF1D,EAAQE,EAAOwC,8BAA8BP,EAASQ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esri/solution-file",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Manages the creation and deployment of
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Manages the creation and deployment of item types that contain files for @esri/solution.js.",
|
|
5
5
|
"main": "dist/node/index.js",
|
|
6
6
|
"unpkg": "dist/umd/file.umd.min.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -13,32 +13,31 @@
|
|
|
13
13
|
"dist/**"
|
|
14
14
|
],
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@esri/arcgis-rest-auth": "3.4.
|
|
17
|
-
"@esri/arcgis-rest-feature-layer": "3.4.
|
|
18
|
-
"@esri/arcgis-rest-portal": "3.4.
|
|
19
|
-
"@esri/arcgis-rest-request": "3.4.
|
|
20
|
-
"@esri/arcgis-rest-service-admin": "3.4.
|
|
21
|
-
"@esri/hub-common": "9.
|
|
22
|
-
"@esri/hub-initiatives": "9.
|
|
23
|
-
"@esri/hub-sites": "9.
|
|
24
|
-
"@esri/hub-teams": "9.
|
|
25
|
-
"rollup": "^
|
|
26
|
-
"typescript": "^4.3.4"
|
|
16
|
+
"@esri/arcgis-rest-auth": "3.4.3",
|
|
17
|
+
"@esri/arcgis-rest-feature-layer": "3.4.3",
|
|
18
|
+
"@esri/arcgis-rest-portal": "3.4.3",
|
|
19
|
+
"@esri/arcgis-rest-request": "3.4.3",
|
|
20
|
+
"@esri/arcgis-rest-service-admin": "3.4.3",
|
|
21
|
+
"@esri/hub-common": "9.15.0",
|
|
22
|
+
"@esri/hub-initiatives": "9.15.0",
|
|
23
|
+
"@esri/hub-sites": "9.15.0",
|
|
24
|
+
"@esri/hub-teams": "9.15.0",
|
|
25
|
+
"rollup": "^2.60.0"
|
|
27
26
|
},
|
|
28
27
|
"peerDependencies": {
|
|
29
|
-
"@esri/arcgis-rest-auth": "3.4.
|
|
30
|
-
"@esri/arcgis-rest-feature-layer": "3.4.
|
|
31
|
-
"@esri/arcgis-rest-portal": "3.4.
|
|
32
|
-
"@esri/arcgis-rest-request": "3.4.
|
|
33
|
-
"@esri/arcgis-rest-service-admin": "3.4.
|
|
34
|
-
"@esri/hub-common": "9.
|
|
35
|
-
"@esri/hub-initiatives": "9.
|
|
36
|
-
"@esri/hub-sites": "9.
|
|
37
|
-
"@esri/hub-teams": "9.
|
|
28
|
+
"@esri/arcgis-rest-auth": "3.4.3",
|
|
29
|
+
"@esri/arcgis-rest-feature-layer": "3.4.3",
|
|
30
|
+
"@esri/arcgis-rest-portal": "3.4.3",
|
|
31
|
+
"@esri/arcgis-rest-request": "3.4.3",
|
|
32
|
+
"@esri/arcgis-rest-service-admin": "3.4.3",
|
|
33
|
+
"@esri/hub-common": "9.15.0",
|
|
34
|
+
"@esri/hub-initiatives": "9.15.0",
|
|
35
|
+
"@esri/hub-sites": "9.15.0",
|
|
36
|
+
"@esri/hub-teams": "9.15.0"
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
|
-
"@esri/solution-common": "^1.
|
|
41
|
-
"tslib": "
|
|
39
|
+
"@esri/solution-common": "^1.3.0",
|
|
40
|
+
"tslib": "1.13.0"
|
|
42
41
|
},
|
|
43
42
|
"scripts": {
|
|
44
43
|
"prepare": "npm run build",
|
|
@@ -90,5 +89,5 @@
|
|
|
90
89
|
"esri",
|
|
91
90
|
"ES6"
|
|
92
91
|
],
|
|
93
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "b8f04e56c71adb7aadaa0293f8708800cdaa9c81"
|
|
94
93
|
}
|