@esri/solution-creator 0.24.0 → 1.1.4
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/createItemTemplate.d.ts +5 -4
- package/dist/esm/createItemTemplate.js +89 -87
- package/dist/esm/createItemTemplate.js.map +1 -1
- package/dist/esm/creator.d.ts +10 -8
- package/dist/esm/creator.js +78 -72
- package/dist/esm/creator.js.map +1 -1
- package/dist/esm/helpers/add-content-to-solution.d.ts +5 -4
- package/dist/esm/helpers/add-content-to-solution.js +100 -92
- package/dist/esm/helpers/add-content-to-solution.js.map +1 -1
- package/dist/esm/module-map.js +7 -6
- package/dist/esm/module-map.js.map +1 -1
- package/dist/node/createItemTemplate.d.ts +5 -4
- package/dist/node/createItemTemplate.js +102 -100
- package/dist/node/createItemTemplate.js.map +1 -1
- package/dist/node/creator.d.ts +10 -8
- package/dist/node/creator.js +80 -74
- package/dist/node/creator.js.map +1 -1
- package/dist/node/helpers/add-content-to-solution.d.ts +5 -4
- package/dist/node/helpers/add-content-to-solution.js +112 -104
- package/dist/node/helpers/add-content-to-solution.js.map +1 -1
- package/dist/node/index.js +4 -4
- package/dist/node/index.js.map +1 -1
- package/dist/node/module-map.js +13 -12
- package/dist/node/module-map.js.map +1 -1
- package/dist/umd/createItemTemplate.d.ts +5 -4
- package/dist/umd/creator.d.ts +10 -8
- package/dist/umd/creator.umd.js +1240 -1271
- package/dist/umd/creator.umd.js.map +1 -1
- package/dist/umd/creator.umd.min.js +3 -3
- package/dist/umd/creator.umd.min.js.map +1 -1
- package/dist/umd/helpers/add-content-to-solution.d.ts +5 -4
- package/package.json +31 -30
package/dist/esm/creator.js
CHANGED
|
@@ -13,73 +13,86 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { __read, __spread } from "tslib";
|
|
17
16
|
/**
|
|
18
17
|
* Manages the creation of a Solution item.
|
|
19
18
|
*
|
|
20
19
|
* @module creator
|
|
21
20
|
*/
|
|
22
|
-
import { appendQueryParam, createItemWithData, createLongId, createShortId, CURRENT_SCHEMA_VERSION, generateSourceThumbnailUrl, getBlobAsFile, getFilenameFromUrl, getGroupBase, getGroupContents, getItemBase, removeItem, sanitizeJSONAndReportChanges } from "@esri/solution-common";
|
|
21
|
+
import { appendQueryParam, createItemWithData, createLongId, createShortId, CURRENT_SCHEMA_VERSION, generateSourceThumbnailUrl, getBlobAsFile, getFilenameFromUrl, getGroupBase, getGroupContents, getItemBase, getPortal, getUser, getVelocityUrlBase, removeItem, sanitizeJSONAndReportChanges, setLocationTrackingEnabled } from "@esri/solution-common";
|
|
23
22
|
import { failSafe } from "@esri/hub-common";
|
|
24
23
|
import { addContentToSolution } from "./helpers/add-content-to-solution";
|
|
25
24
|
// Simple no-op to clean up progressCallback management
|
|
26
|
-
|
|
25
|
+
const noOp = () => { };
|
|
27
26
|
/**
|
|
28
27
|
* Creates a solution item.
|
|
29
28
|
*
|
|
30
29
|
* @param sourceId AGO id of group whose contents are to be added to solution or of an item to convert into a solution
|
|
31
|
-
* @param
|
|
30
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
31
|
+
* @param destAuthentication Credentials for the requests to destination solution
|
|
32
32
|
* @param options Customizations for creating the solution
|
|
33
33
|
* @return A promise that resolves with the AGO id of the new solution
|
|
34
34
|
*/
|
|
35
|
-
export function createSolution(sourceId,
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
export function createSolution(sourceId, srcAuthentication, destAuthentication, options) {
|
|
36
|
+
const createOptions = options || {};
|
|
37
|
+
const progressCb = createOptions.progressCallback || noOp;
|
|
38
|
+
createOptions.templateDictionary = Object.assign({}, createOptions.templateDictionary);
|
|
38
39
|
progressCb(1); // let the caller know that we've started
|
|
39
40
|
// Assume that source is a group and try to get group's information
|
|
40
41
|
return Promise.all([
|
|
41
|
-
getGroupBase(sourceId,
|
|
42
|
-
getGroupContents(sourceId,
|
|
42
|
+
getGroupBase(sourceId, srcAuthentication),
|
|
43
|
+
getGroupContents(sourceId, srcAuthentication),
|
|
44
|
+
getVelocityUrlBase(srcAuthentication, createOptions.templateDictionary)
|
|
43
45
|
])
|
|
44
46
|
.then(
|
|
45
47
|
// Group fetches worked; assumption was correct
|
|
46
|
-
|
|
48
|
+
responses => {
|
|
47
49
|
createOptions.itemIds = responses[1];
|
|
48
50
|
progressCb(15);
|
|
49
|
-
return new Promise(
|
|
51
|
+
return new Promise(resolve => {
|
|
50
52
|
// Update the createOptions with values from the group
|
|
51
|
-
resolve(_applySourceToCreateOptions(createOptions, responses[0],
|
|
53
|
+
resolve(_applySourceToCreateOptions(createOptions, responses[0], srcAuthentication, true));
|
|
52
54
|
});
|
|
53
55
|
},
|
|
54
56
|
// Assumption incorrect; try source as an item
|
|
55
|
-
|
|
56
|
-
return new Promise(
|
|
57
|
+
() => {
|
|
58
|
+
return new Promise((resolve, reject) => {
|
|
57
59
|
createOptions.itemIds = [sourceId];
|
|
58
|
-
getItemBase(sourceId,
|
|
60
|
+
getItemBase(sourceId, srcAuthentication).then(
|
|
59
61
|
// Update the createOptions with values from the item
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
itemBase => resolve(_applySourceToCreateOptions(createOptions, itemBase, srcAuthentication, false)), reject);
|
|
63
|
+
});
|
|
64
|
+
})
|
|
65
|
+
.then(createOptions => {
|
|
66
|
+
return new Promise((resolve, reject) => {
|
|
67
|
+
Promise.all([
|
|
68
|
+
getPortal("", srcAuthentication),
|
|
69
|
+
getUser(srcAuthentication)
|
|
70
|
+
]).then(responses => {
|
|
71
|
+
// check tracking
|
|
72
|
+
const [portalResponse, userResponse] = responses;
|
|
73
|
+
setLocationTrackingEnabled(portalResponse, userResponse, createOptions.templateDictionary);
|
|
74
|
+
resolve(createOptions);
|
|
62
75
|
}, reject);
|
|
63
76
|
});
|
|
64
77
|
})
|
|
65
78
|
.then(
|
|
66
79
|
// Use a copy of the thumbnail rather than a URL to it
|
|
67
|
-
|
|
68
|
-
return _addThumbnailFileToCreateOptions(createOptions,
|
|
80
|
+
createOptions => {
|
|
81
|
+
return _addThumbnailFileToCreateOptions(createOptions, srcAuthentication);
|
|
69
82
|
})
|
|
70
83
|
.then(
|
|
71
84
|
// Create a solution
|
|
72
|
-
|
|
73
|
-
return _createSolutionFromItemIds(createOptions,
|
|
85
|
+
createOptions => {
|
|
86
|
+
return _createSolutionFromItemIds(createOptions, srcAuthentication, destAuthentication);
|
|
74
87
|
})
|
|
75
88
|
.then(
|
|
76
89
|
// Successfully created solution
|
|
77
|
-
|
|
90
|
+
createdSolutionId => {
|
|
78
91
|
progressCb(100); // finished
|
|
79
92
|
return createdSolutionId;
|
|
80
93
|
},
|
|
81
94
|
// Error fetching group, group contents, or item, or error creating solution from ids
|
|
82
|
-
|
|
95
|
+
error => {
|
|
83
96
|
progressCb(1);
|
|
84
97
|
console.error(error);
|
|
85
98
|
throw error;
|
|
@@ -94,17 +107,15 @@ export function createSolution(sourceId, authentication, options) {
|
|
|
94
107
|
* @param isGroup Boolean to indicate if the files are associated with a group or item
|
|
95
108
|
* @internal
|
|
96
109
|
*/
|
|
97
|
-
export function _applySourceToCreateOptions(createOptions, sourceInfo,
|
|
98
|
-
if (isGroup === void 0) { isGroup = false; }
|
|
110
|
+
export function _applySourceToCreateOptions(createOptions, sourceInfo, srcAuthentication, isGroup = false) {
|
|
99
111
|
// Create a solution from the group's or item's contents,
|
|
100
112
|
// using the group's or item's information as defaults for the solution item
|
|
101
|
-
["title", "snippet", "description", "tags"].forEach(
|
|
102
|
-
|
|
103
|
-
createOptions[prop] = (_a = createOptions[prop]) !== null && _a !== void 0 ? _a : sourceInfo[prop];
|
|
113
|
+
["title", "snippet", "description", "tags"].forEach(prop => {
|
|
114
|
+
createOptions[prop] = createOptions[prop] ?? sourceInfo[prop];
|
|
104
115
|
});
|
|
105
116
|
if (!createOptions.thumbnailurl && sourceInfo.thumbnail) {
|
|
106
117
|
// Get the full path to the thumbnail
|
|
107
|
-
createOptions.thumbnailurl = generateSourceThumbnailUrl(
|
|
118
|
+
createOptions.thumbnailurl = generateSourceThumbnailUrl(srcAuthentication.portal, sourceInfo.id, sourceInfo.thumbnail, isGroup);
|
|
108
119
|
delete sourceInfo.thumbnail;
|
|
109
120
|
}
|
|
110
121
|
return createOptions;
|
|
@@ -113,21 +124,21 @@ export function _applySourceToCreateOptions(createOptions, sourceInfo, authentic
|
|
|
113
124
|
* Update the createOptions with the thumbnail file
|
|
114
125
|
*
|
|
115
126
|
* @param createOptions
|
|
116
|
-
* @param
|
|
127
|
+
* @param srcAuthentication
|
|
117
128
|
* @internal
|
|
118
129
|
*/
|
|
119
|
-
export function _addThumbnailFileToCreateOptions(createOptions,
|
|
120
|
-
return new Promise(
|
|
130
|
+
export function _addThumbnailFileToCreateOptions(createOptions, srcAuthentication) {
|
|
131
|
+
return new Promise(resolve => {
|
|
121
132
|
if (!createOptions.thumbnail && createOptions.thumbnailurl) {
|
|
122
133
|
// Figure out the thumbnail's filename
|
|
123
|
-
|
|
124
|
-
|
|
134
|
+
const filename = getFilenameFromUrl(createOptions.thumbnailurl) || "thumbnail";
|
|
135
|
+
const thumbnailurl = appendQueryParam(createOptions.thumbnailurl, "w=400");
|
|
125
136
|
delete createOptions.thumbnailurl;
|
|
126
137
|
// Fetch the thumbnail
|
|
127
|
-
getBlobAsFile(thumbnailurl, filename,
|
|
138
|
+
getBlobAsFile(thumbnailurl, filename, srcAuthentication).then(thumbnail => {
|
|
128
139
|
createOptions.thumbnail = thumbnail;
|
|
129
140
|
resolve(createOptions);
|
|
130
|
-
},
|
|
141
|
+
}, () => {
|
|
131
142
|
resolve(createOptions);
|
|
132
143
|
});
|
|
133
144
|
}
|
|
@@ -140,25 +151,26 @@ export function _addThumbnailFileToCreateOptions(createOptions, authentication)
|
|
|
140
151
|
* Creates a solution item using a list of AGO item ids.
|
|
141
152
|
*
|
|
142
153
|
* @param options Customizations for creating the solution
|
|
143
|
-
* @param
|
|
154
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
155
|
+
* @param destAuthentication Credentials for the requests to destination solution
|
|
144
156
|
* @return A promise that resolves with the AGO id of the new solution; solution item is deleted if its
|
|
145
157
|
* there is a problem updating it
|
|
146
158
|
* @internal
|
|
147
159
|
*/
|
|
148
|
-
export function _createSolutionFromItemIds(options,
|
|
149
|
-
|
|
160
|
+
export function _createSolutionFromItemIds(options, srcAuthentication, destAuthentication) {
|
|
161
|
+
let solutionId = "";
|
|
150
162
|
// Create a solution from the list of items
|
|
151
|
-
return _createSolutionItem(
|
|
152
|
-
.then(
|
|
163
|
+
return _createSolutionItem(destAuthentication, options)
|
|
164
|
+
.then(id => {
|
|
153
165
|
solutionId = id;
|
|
154
166
|
// Add list of items to the new solution
|
|
155
|
-
return addContentToSolution(solutionId, options,
|
|
167
|
+
return addContentToSolution(solutionId, options, srcAuthentication, destAuthentication);
|
|
156
168
|
})
|
|
157
|
-
.catch(
|
|
169
|
+
.catch(addError => {
|
|
158
170
|
// If the solution item got created, delete it
|
|
159
171
|
if (solutionId) {
|
|
160
|
-
|
|
161
|
-
return failSafeRemove(solutionId,
|
|
172
|
+
const failSafeRemove = failSafe(removeItem, { success: true });
|
|
173
|
+
return failSafeRemove(solutionId, destAuthentication).then(() => {
|
|
162
174
|
throw addError;
|
|
163
175
|
});
|
|
164
176
|
}
|
|
@@ -177,16 +189,12 @@ export function _createSolutionFromItemIds(options, authentication) {
|
|
|
177
189
|
* @internal
|
|
178
190
|
*/
|
|
179
191
|
export function _createSolutionItem(authentication, options) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
resolve(createResponse.id);
|
|
187
|
-
}, function (err) {
|
|
188
|
-
reject(err);
|
|
189
|
-
});
|
|
192
|
+
const model = _createSolutionItemModel(options);
|
|
193
|
+
// Create new solution item
|
|
194
|
+
delete model.item.thumbnailurl;
|
|
195
|
+
model.item.thumbnail = options?.thumbnail;
|
|
196
|
+
return createItemWithData(model.item, model.data, authentication, options?.folderId).then(createResponse => {
|
|
197
|
+
return Promise.resolve(createResponse.id);
|
|
190
198
|
});
|
|
191
199
|
}
|
|
192
200
|
/**
|
|
@@ -197,26 +205,25 @@ export function _createSolutionItem(authentication, options) {
|
|
|
197
205
|
* @internal
|
|
198
206
|
*/
|
|
199
207
|
export function _createSolutionItemModel(options) {
|
|
200
|
-
var _a, _b, _c, _d, _e;
|
|
201
208
|
// Solution uses all supplied tags but for deploy.* tags; that information goes into properties
|
|
202
|
-
|
|
203
|
-
|
|
209
|
+
const creationTags = options?.tags ?? [];
|
|
210
|
+
const solutionItem = {
|
|
204
211
|
type: "Solution",
|
|
205
|
-
title:
|
|
206
|
-
snippet:
|
|
207
|
-
description:
|
|
212
|
+
title: options?.title ?? createShortId(),
|
|
213
|
+
snippet: options?.snippet ?? "",
|
|
214
|
+
description: options?.description ?? "",
|
|
208
215
|
properties: {
|
|
209
216
|
schemaVersion: CURRENT_SCHEMA_VERSION
|
|
210
217
|
},
|
|
211
|
-
thumbnailurl:
|
|
212
|
-
tags: creationTags.filter(
|
|
218
|
+
thumbnailurl: options?.thumbnailurl ?? "",
|
|
219
|
+
tags: creationTags.filter((tag) => !tag.startsWith("deploy.")),
|
|
213
220
|
typeKeywords: ["Solution", "Template"].concat(_getDeploymentProperties(creationTags))
|
|
214
221
|
};
|
|
215
222
|
// ensure that snippet and description are not nefarious
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
sanitizedItem.typeKeywords =
|
|
219
|
-
|
|
223
|
+
const sanitizedItem = sanitizeJSONAndReportChanges(solutionItem);
|
|
224
|
+
const addlKeywords = options?.additionalTypeKeywords || [];
|
|
225
|
+
sanitizedItem.typeKeywords = [].concat(solutionItem.typeKeywords, addlKeywords);
|
|
226
|
+
const solutionData = {
|
|
220
227
|
metadata: {},
|
|
221
228
|
templates: []
|
|
222
229
|
};
|
|
@@ -229,17 +236,16 @@ export function _createSolutionItemModel(options) {
|
|
|
229
236
|
* Gets the deploy.id and deploy.version tag values.
|
|
230
237
|
*
|
|
231
238
|
* @param tags A list of item tags
|
|
232
|
-
* @return A list
|
|
239
|
+
* @return A list containing the two values found in the tags, or defaulting to a new GUID and "1.0", respectively,
|
|
233
240
|
* as needed
|
|
234
241
|
* @internal
|
|
235
242
|
*/
|
|
236
243
|
export function _getDeploymentProperties(tags) {
|
|
237
|
-
var _a, _b;
|
|
238
244
|
return [
|
|
239
245
|
"solutionid-" +
|
|
240
|
-
(
|
|
246
|
+
(_getDeploymentProperty("deploy.id.", tags) ?? createLongId()),
|
|
241
247
|
"solutionversion-" +
|
|
242
|
-
(
|
|
248
|
+
(_getDeploymentProperty("deploy.version.", tags) ?? "1.0")
|
|
243
249
|
];
|
|
244
250
|
}
|
|
245
251
|
/**
|
|
@@ -251,7 +257,7 @@ export function _getDeploymentProperties(tags) {
|
|
|
251
257
|
* @internal
|
|
252
258
|
*/
|
|
253
259
|
export function _getDeploymentProperty(desiredTagPrefix, tags) {
|
|
254
|
-
|
|
260
|
+
const foundTagAsList = tags.filter(tag => tag.startsWith(desiredTagPrefix));
|
|
255
261
|
if (foundTagAsList.length > 0) {
|
|
256
262
|
return foundTagAsList[0].substr(desiredTagPrefix.length);
|
|
257
263
|
}
|
package/dist/esm/creator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creator.js","sourceRoot":"","sources":["../../src/creator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"creator.js","sourceRoot":"","sources":["../../src/creator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,OAAO,EACP,kBAAkB,EAKlB,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AAa,CAAC,YAAY,GAAG,EAAE,CAAC,MAAM,CACpC,YAAY,CAAC,YAAY,EACzB,YAAY,CACb,CAAC;IAEF,MAAM,YAAY,GAAsB;QACtC,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;KACd,CAAC;IACF,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,YAAY;KACnB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAc;IACrD,OAAO;QACL,aAAa;YACX,CAAC,sBAAsB,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,YAAY,EAAE,CAAC;QAChE,kBAAkB;YAChB,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC;KAC7D,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,gBAAwB,EACxB,IAAc;IAEd,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC5E,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7B,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;KAC1D;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC"}
|
|
@@ -19,11 +19,12 @@ import { ICreateSolutionOptions, IItemTemplate, UserSession } from "@esri/soluti
|
|
|
19
19
|
*
|
|
20
20
|
* @param solutionItemId AGO id of solution to receive items
|
|
21
21
|
* @param options Customizations for creating the solution
|
|
22
|
-
* @param
|
|
22
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
23
|
+
* @param destAuthentication Credentials for the requests to destination solution
|
|
23
24
|
* @return A promise that resolves with the AGO id of the updated solution
|
|
24
25
|
* @internal
|
|
25
26
|
*/
|
|
26
|
-
export declare function addContentToSolution(solutionItemId: string, options: ICreateSolutionOptions,
|
|
27
|
+
export declare function addContentToSolution(solutionItemId: string, options: ICreateSolutionOptions, srcAuthentication: UserSession, destAuthentication: UserSession): Promise<string>;
|
|
27
28
|
/**
|
|
28
29
|
* Gets the dependencies of an item by merging its dependencies list with item references in template variables.
|
|
29
30
|
*
|
|
@@ -110,11 +111,11 @@ export declare function _simplifyUrlsInItemDescriptions(templates: IItemTemplate
|
|
|
110
111
|
* Templatizes occurrences of the URL to the user's organization in the `item` and `data` template sections.
|
|
111
112
|
*
|
|
112
113
|
* @param templates The array of templates to evaluate; templates is modified in place
|
|
113
|
-
* @param
|
|
114
|
+
* @param destAuthentication Credentials for request organization info
|
|
114
115
|
* @return Promise resolving with `templates`
|
|
115
116
|
* @private
|
|
116
117
|
*/
|
|
117
|
-
export declare function _templatizeOrgUrl(templates: IItemTemplate[],
|
|
118
|
+
export declare function _templatizeOrgUrl(templates: IItemTemplate[], destAuthentication: UserSession): Promise<IItemTemplate[]>;
|
|
118
119
|
/**
|
|
119
120
|
* Finds and templatizes any references to solution's items.
|
|
120
121
|
*
|