@esri/solution-file 1.1.5 → 1.2.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/umd/file.umd.js +49 -25
- package/dist/umd/file.umd.js.map +1 -1
- package/dist/umd/file.umd.min.js +3 -3
- package/dist/umd/file.umd.min.js.map +1 -1
- package/package.json +25 -25
package/dist/umd/file.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-file - v1.
|
|
2
|
+
* @esri/solution-file - v1.2.0 - Apache-2.0
|
|
3
3
|
* Copyright (c) 2018-2021 Esri, Inc.
|
|
4
|
-
*
|
|
4
|
+
* Thu Dec 09 2021 16:02:16 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
|
|
@@ -49,13 +69,14 @@
|
|
|
49
69
|
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication) {
|
|
50
70
|
return new Promise(resolve => {
|
|
51
71
|
// Init template
|
|
52
|
-
const itemTemplate =
|
|
72
|
+
const itemTemplate = common__namespace.createInitializedItemTemplate(itemInfo);
|
|
53
73
|
// Templatize item info property values
|
|
54
|
-
itemTemplate.item.id =
|
|
74
|
+
itemTemplate.item.id = common__namespace.templatizeTerm(itemTemplate.item.id, itemTemplate.item.id, ".itemId");
|
|
55
75
|
// Request file
|
|
56
76
|
const dataPromise = new Promise(dataResolve => {
|
|
57
77
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
58
|
-
|
|
78
|
+
common__namespace
|
|
79
|
+
.getItemDataAsFile(itemTemplate.itemId, itemTemplate.item.name, srcAuthentication)
|
|
59
80
|
.then(response => {
|
|
60
81
|
if (!response || response.size === 0) {
|
|
61
82
|
dataResolve(null);
|
|
@@ -72,13 +93,14 @@
|
|
|
72
93
|
Promise.all([dataPromise, relatedPromise]).then(responses => {
|
|
73
94
|
const [itemDataResponse] = responses;
|
|
74
95
|
if (itemDataResponse) {
|
|
75
|
-
const resource =
|
|
96
|
+
const resource = common__namespace.convertBlobToSupportableResource(itemDataResponse, itemTemplate.item.name);
|
|
76
97
|
itemTemplate.properties[resource.filename] = resource.mimeType;
|
|
77
|
-
const storageName =
|
|
98
|
+
const storageName = common__namespace.convertItemResourceToStorageResource(itemTemplate.itemId +
|
|
78
99
|
(resource.blob.name === resource.filename
|
|
79
100
|
? "_info_data"
|
|
80
|
-
: "_info_dataz"), resource.blob.name,
|
|
81
|
-
|
|
101
|
+
: "_info_dataz"), resource.blob.name, common__namespace.SolutionTemplateFormatVersion);
|
|
102
|
+
common__namespace
|
|
103
|
+
.addResourceFromBlob(resource.blob, solutionItemId, storageName.folder, storageName.filename, destAuthentication)
|
|
82
104
|
.then(() => {
|
|
83
105
|
itemTemplate.resources.push(storageName.folder + "/" + storageName.filename);
|
|
84
106
|
resolve(itemTemplate);
|
|
@@ -96,26 +118,28 @@
|
|
|
96
118
|
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
97
119
|
return new Promise(resolve => {
|
|
98
120
|
// Interrupt process if progress callback returns `false`
|
|
99
|
-
if (!itemProgressCallback(template.itemId,
|
|
100
|
-
itemProgressCallback(template.itemId,
|
|
101
|
-
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));
|
|
102
124
|
return;
|
|
103
125
|
}
|
|
104
126
|
// Replace the templatized symbols in a copy of the template
|
|
105
|
-
let newItemTemplate =
|
|
106
|
-
newItemTemplate =
|
|
127
|
+
let newItemTemplate = common__namespace.cloneObject(template);
|
|
128
|
+
newItemTemplate = common__namespace.replaceInTemplate(newItemTemplate, templateDictionary);
|
|
107
129
|
/* istanbul ignore else */
|
|
108
130
|
if (template.item.thumbnail) {
|
|
109
131
|
newItemTemplate.item.thumbnail = template.item.thumbnail;
|
|
110
132
|
}
|
|
111
133
|
// Create the item, then update its URL with its new id
|
|
112
|
-
|
|
134
|
+
common__namespace
|
|
135
|
+
.createItemWithData(newItemTemplate.item, newItemTemplate.data, destinationAuthentication, templateDictionary.folderId)
|
|
113
136
|
.then(createResponse => {
|
|
114
137
|
// Interrupt process if progress callback returns `false`
|
|
115
|
-
if (!itemProgressCallback(template.itemId,
|
|
116
|
-
itemProgressCallback(template.itemId,
|
|
117
|
-
|
|
118
|
-
.
|
|
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)));
|
|
119
143
|
}
|
|
120
144
|
else {
|
|
121
145
|
// Add the new item to the settings
|
|
@@ -123,7 +147,7 @@
|
|
|
123
147
|
templateDictionary[template.itemId] = {
|
|
124
148
|
itemId: createResponse.id
|
|
125
149
|
};
|
|
126
|
-
itemProgressCallback(template.itemId,
|
|
150
|
+
itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor / 2, createResponse.id);
|
|
127
151
|
resolve({
|
|
128
152
|
item: newItemTemplate,
|
|
129
153
|
id: createResponse.id,
|
|
@@ -132,8 +156,8 @@
|
|
|
132
156
|
});
|
|
133
157
|
}
|
|
134
158
|
}, () => {
|
|
135
|
-
itemProgressCallback(template.itemId,
|
|
136
|
-
resolve(
|
|
159
|
+
itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Failed, 0);
|
|
160
|
+
resolve(common__namespace.generateEmptyCreationResponse(template.type)); // fails to create item
|
|
137
161
|
});
|
|
138
162
|
});
|
|
139
163
|
}
|
|
@@ -143,5 +167,5 @@
|
|
|
143
167
|
|
|
144
168
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
145
169
|
|
|
146
|
-
}))
|
|
170
|
+
}));
|
|
147
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 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.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":";;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;;;;;;EAwBA;EAEA;;;;;;;;;WASgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC;MAErC,OAAO,IAAI,OAAO,CAAuB,OAAO;;UAE9C,MAAM,YAAY,GAAyBA,oCAAoC,CAC7E,QAAQ,CACT,CAAC;;UAGF,YAAY,CAAC,IAAI,CAAC,EAAE,GAAGC,qBAAqB,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/CC,wBACoB,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,GAA0BC,uCAAuC,CAC7E,gBAAgB,EAChB,YAAY,CAAC,IAA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F,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,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;;;UA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,CAAC,CAAC,EAC9D,MACE,OAAO,CAACA,iBAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAC/D,CAAC;eACL;mBAAM;;kBAEL,eAAe,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,CAAC;kBAC3C,kBAAkB,CAAC,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.
|
|
2
|
+
* @esri/solution-file - v1.2.0 - Apache-2.0
|
|
3
3
|
* Copyright (c) 2018-2021 Esri, Inc.
|
|
4
|
-
*
|
|
4
|
+
* Thu Dec 09 2021 16:02:20 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 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","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":";;;;;;;;;;;;;;;;;2UAoCEA,EACAC,EACAC,EACAC,GAEA,OAAO,IAAIC,SAA8BC,IAEvC,MAAMC,EAAqCC,gCACzCN,GAIFK,EAAaE,KAAKC,GAAKC,iBACrBJ,EAAaE,KAAKC,GAClBH,EAAaE,KAAKC,GAClB,WAIF,MAAME,EAAc,IAAI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AAmBD,EAASzB,QAAU,CACpCA,OAAQyC,EAAe9C,IAGzBiC,EACEH,EAASzB,OACT6B,sBAA2Be,SAC3BnB,EAASkB,8BAAgC,EACzCF,EAAe9C,IAGjBJ,EAAQ,CACNG,KAAMwC,EACNvC,GAAI8C,EAAe9C,GACnBsC,KAAMC,EAAgBD,KACtBY,aAAa,MA/BfjB,EACEH,EAASzB,OACT6B,sBAA2BiB,UAC3B,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,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B,OACTR,EAAOqC,oBAAoBe,SAC3BnB,EAASkB,8BAAgC,EACzCF,EAAe9C,IAGjBL,EAAQ,CACNI,KAAMwC,EACNvC,GAAI8C,EAAe9C,GACnBsC,KAAMC,EAAgBD,KACtBY,aAAa,MA/BfjB,EACEH,EAASzB,OACTR,EAAOqC,oBAAoBiB,UAC3B,GAEFtD,EACGuD,WAAWN,EAAe9C,GAAIgC,GAC9BzB,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.2.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,32 @@
|
|
|
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.2
|
|
22
|
-
"@esri/hub-initiatives": "9.2
|
|
23
|
-
"@esri/hub-sites": "9.2
|
|
24
|
-
"@esri/hub-teams": "9.2
|
|
25
|
-
"rollup": "^
|
|
26
|
-
"typescript": "^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.7.2",
|
|
22
|
+
"@esri/hub-initiatives": "9.7.2",
|
|
23
|
+
"@esri/hub-sites": "9.7.2",
|
|
24
|
+
"@esri/hub-teams": "9.7.2",
|
|
25
|
+
"rollup": "^2.60.0",
|
|
26
|
+
"typescript": "^4.4.4"
|
|
27
27
|
},
|
|
28
28
|
"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.2
|
|
35
|
-
"@esri/hub-initiatives": "9.2
|
|
36
|
-
"@esri/hub-sites": "9.2
|
|
37
|
-
"@esri/hub-teams": "9.2
|
|
29
|
+
"@esri/arcgis-rest-auth": "3.4.3",
|
|
30
|
+
"@esri/arcgis-rest-feature-layer": "3.4.3",
|
|
31
|
+
"@esri/arcgis-rest-portal": "3.4.3",
|
|
32
|
+
"@esri/arcgis-rest-request": "3.4.3",
|
|
33
|
+
"@esri/arcgis-rest-service-admin": "3.4.3",
|
|
34
|
+
"@esri/hub-common": "9.7.2",
|
|
35
|
+
"@esri/hub-initiatives": "9.7.2",
|
|
36
|
+
"@esri/hub-sites": "9.7.2",
|
|
37
|
+
"@esri/hub-teams": "9.7.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@esri/solution-common": "^1.
|
|
41
|
-
"tslib": "
|
|
40
|
+
"@esri/solution-common": "^1.2.0",
|
|
41
|
+
"tslib": "1.13.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"prepare": "npm run build",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"esri",
|
|
91
91
|
"ES6"
|
|
92
92
|
],
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "70f706fb28a50db0b9b13030f263f8e9e270b98d"
|
|
94
94
|
}
|