@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/node/creator.js
CHANGED
|
@@ -16,73 +16,86 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports._getDeploymentProperty = exports._getDeploymentProperties = exports._createSolutionItemModel = exports._createSolutionItem = exports._createSolutionFromItemIds = exports._addThumbnailFileToCreateOptions = exports._applySourceToCreateOptions = exports.createSolution = void 0;
|
|
19
|
-
var tslib_1 = require("tslib");
|
|
20
19
|
/**
|
|
21
20
|
* Manages the creation of a Solution item.
|
|
22
21
|
*
|
|
23
22
|
* @module creator
|
|
24
23
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const solution_common_1 = require("@esri/solution-common");
|
|
25
|
+
const hub_common_1 = require("@esri/hub-common");
|
|
26
|
+
const add_content_to_solution_1 = require("./helpers/add-content-to-solution");
|
|
28
27
|
// Simple no-op to clean up progressCallback management
|
|
29
|
-
|
|
28
|
+
const noOp = () => { };
|
|
30
29
|
/**
|
|
31
30
|
* Creates a solution item.
|
|
32
31
|
*
|
|
33
32
|
* @param sourceId AGO id of group whose contents are to be added to solution or of an item to convert into a solution
|
|
34
|
-
* @param
|
|
33
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
34
|
+
* @param destAuthentication Credentials for the requests to destination solution
|
|
35
35
|
* @param options Customizations for creating the solution
|
|
36
36
|
* @return A promise that resolves with the AGO id of the new solution
|
|
37
37
|
*/
|
|
38
|
-
function createSolution(sourceId,
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
function createSolution(sourceId, srcAuthentication, destAuthentication, options) {
|
|
39
|
+
const createOptions = options || {};
|
|
40
|
+
const progressCb = createOptions.progressCallback || noOp;
|
|
41
|
+
createOptions.templateDictionary = Object.assign({}, createOptions.templateDictionary);
|
|
41
42
|
progressCb(1); // let the caller know that we've started
|
|
42
43
|
// Assume that source is a group and try to get group's information
|
|
43
44
|
return Promise.all([
|
|
44
|
-
solution_common_1.getGroupBase(sourceId,
|
|
45
|
-
solution_common_1.getGroupContents(sourceId,
|
|
45
|
+
(0, solution_common_1.getGroupBase)(sourceId, srcAuthentication),
|
|
46
|
+
(0, solution_common_1.getGroupContents)(sourceId, srcAuthentication),
|
|
47
|
+
(0, solution_common_1.getVelocityUrlBase)(srcAuthentication, createOptions.templateDictionary)
|
|
46
48
|
])
|
|
47
49
|
.then(
|
|
48
50
|
// Group fetches worked; assumption was correct
|
|
49
|
-
|
|
51
|
+
responses => {
|
|
50
52
|
createOptions.itemIds = responses[1];
|
|
51
53
|
progressCb(15);
|
|
52
|
-
return new Promise(
|
|
54
|
+
return new Promise(resolve => {
|
|
53
55
|
// Update the createOptions with values from the group
|
|
54
|
-
resolve(_applySourceToCreateOptions(createOptions, responses[0],
|
|
56
|
+
resolve(_applySourceToCreateOptions(createOptions, responses[0], srcAuthentication, true));
|
|
55
57
|
});
|
|
56
58
|
},
|
|
57
59
|
// Assumption incorrect; try source as an item
|
|
58
|
-
|
|
59
|
-
return new Promise(
|
|
60
|
+
() => {
|
|
61
|
+
return new Promise((resolve, reject) => {
|
|
60
62
|
createOptions.itemIds = [sourceId];
|
|
61
|
-
solution_common_1.getItemBase(sourceId,
|
|
63
|
+
(0, solution_common_1.getItemBase)(sourceId, srcAuthentication).then(
|
|
62
64
|
// Update the createOptions with values from the item
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
itemBase => resolve(_applySourceToCreateOptions(createOptions, itemBase, srcAuthentication, false)), reject);
|
|
66
|
+
});
|
|
67
|
+
})
|
|
68
|
+
.then(createOptions => {
|
|
69
|
+
return new Promise((resolve, reject) => {
|
|
70
|
+
Promise.all([
|
|
71
|
+
(0, solution_common_1.getPortal)("", srcAuthentication),
|
|
72
|
+
(0, solution_common_1.getUser)(srcAuthentication)
|
|
73
|
+
]).then(responses => {
|
|
74
|
+
// check tracking
|
|
75
|
+
const [portalResponse, userResponse] = responses;
|
|
76
|
+
(0, solution_common_1.setLocationTrackingEnabled)(portalResponse, userResponse, createOptions.templateDictionary);
|
|
77
|
+
resolve(createOptions);
|
|
65
78
|
}, reject);
|
|
66
79
|
});
|
|
67
80
|
})
|
|
68
81
|
.then(
|
|
69
82
|
// Use a copy of the thumbnail rather than a URL to it
|
|
70
|
-
|
|
71
|
-
return _addThumbnailFileToCreateOptions(createOptions,
|
|
83
|
+
createOptions => {
|
|
84
|
+
return _addThumbnailFileToCreateOptions(createOptions, srcAuthentication);
|
|
72
85
|
})
|
|
73
86
|
.then(
|
|
74
87
|
// Create a solution
|
|
75
|
-
|
|
76
|
-
return _createSolutionFromItemIds(createOptions,
|
|
88
|
+
createOptions => {
|
|
89
|
+
return _createSolutionFromItemIds(createOptions, srcAuthentication, destAuthentication);
|
|
77
90
|
})
|
|
78
91
|
.then(
|
|
79
92
|
// Successfully created solution
|
|
80
|
-
|
|
93
|
+
createdSolutionId => {
|
|
81
94
|
progressCb(100); // finished
|
|
82
95
|
return createdSolutionId;
|
|
83
96
|
},
|
|
84
97
|
// Error fetching group, group contents, or item, or error creating solution from ids
|
|
85
|
-
|
|
98
|
+
error => {
|
|
86
99
|
progressCb(1);
|
|
87
100
|
console.error(error);
|
|
88
101
|
throw error;
|
|
@@ -98,17 +111,15 @@ exports.createSolution = createSolution;
|
|
|
98
111
|
* @param isGroup Boolean to indicate if the files are associated with a group or item
|
|
99
112
|
* @internal
|
|
100
113
|
*/
|
|
101
|
-
function _applySourceToCreateOptions(createOptions, sourceInfo,
|
|
102
|
-
if (isGroup === void 0) { isGroup = false; }
|
|
114
|
+
function _applySourceToCreateOptions(createOptions, sourceInfo, srcAuthentication, isGroup = false) {
|
|
103
115
|
// Create a solution from the group's or item's contents,
|
|
104
116
|
// using the group's or item's information as defaults for the solution item
|
|
105
|
-
["title", "snippet", "description", "tags"].forEach(
|
|
106
|
-
|
|
107
|
-
createOptions[prop] = (_a = createOptions[prop]) !== null && _a !== void 0 ? _a : sourceInfo[prop];
|
|
117
|
+
["title", "snippet", "description", "tags"].forEach(prop => {
|
|
118
|
+
createOptions[prop] = createOptions[prop] ?? sourceInfo[prop];
|
|
108
119
|
});
|
|
109
120
|
if (!createOptions.thumbnailurl && sourceInfo.thumbnail) {
|
|
110
121
|
// Get the full path to the thumbnail
|
|
111
|
-
createOptions.thumbnailurl = solution_common_1.generateSourceThumbnailUrl(
|
|
122
|
+
createOptions.thumbnailurl = (0, solution_common_1.generateSourceThumbnailUrl)(srcAuthentication.portal, sourceInfo.id, sourceInfo.thumbnail, isGroup);
|
|
112
123
|
delete sourceInfo.thumbnail;
|
|
113
124
|
}
|
|
114
125
|
return createOptions;
|
|
@@ -118,21 +129,21 @@ exports._applySourceToCreateOptions = _applySourceToCreateOptions;
|
|
|
118
129
|
* Update the createOptions with the thumbnail file
|
|
119
130
|
*
|
|
120
131
|
* @param createOptions
|
|
121
|
-
* @param
|
|
132
|
+
* @param srcAuthentication
|
|
122
133
|
* @internal
|
|
123
134
|
*/
|
|
124
|
-
function _addThumbnailFileToCreateOptions(createOptions,
|
|
125
|
-
return new Promise(
|
|
135
|
+
function _addThumbnailFileToCreateOptions(createOptions, srcAuthentication) {
|
|
136
|
+
return new Promise(resolve => {
|
|
126
137
|
if (!createOptions.thumbnail && createOptions.thumbnailurl) {
|
|
127
138
|
// Figure out the thumbnail's filename
|
|
128
|
-
|
|
129
|
-
|
|
139
|
+
const filename = (0, solution_common_1.getFilenameFromUrl)(createOptions.thumbnailurl) || "thumbnail";
|
|
140
|
+
const thumbnailurl = (0, solution_common_1.appendQueryParam)(createOptions.thumbnailurl, "w=400");
|
|
130
141
|
delete createOptions.thumbnailurl;
|
|
131
142
|
// Fetch the thumbnail
|
|
132
|
-
solution_common_1.getBlobAsFile(thumbnailurl, filename,
|
|
143
|
+
(0, solution_common_1.getBlobAsFile)(thumbnailurl, filename, srcAuthentication).then(thumbnail => {
|
|
133
144
|
createOptions.thumbnail = thumbnail;
|
|
134
145
|
resolve(createOptions);
|
|
135
|
-
},
|
|
146
|
+
}, () => {
|
|
136
147
|
resolve(createOptions);
|
|
137
148
|
});
|
|
138
149
|
}
|
|
@@ -146,25 +157,26 @@ exports._addThumbnailFileToCreateOptions = _addThumbnailFileToCreateOptions;
|
|
|
146
157
|
* Creates a solution item using a list of AGO item ids.
|
|
147
158
|
*
|
|
148
159
|
* @param options Customizations for creating the solution
|
|
149
|
-
* @param
|
|
160
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
161
|
+
* @param destAuthentication Credentials for the requests to destination solution
|
|
150
162
|
* @return A promise that resolves with the AGO id of the new solution; solution item is deleted if its
|
|
151
163
|
* there is a problem updating it
|
|
152
164
|
* @internal
|
|
153
165
|
*/
|
|
154
|
-
function _createSolutionFromItemIds(options,
|
|
155
|
-
|
|
166
|
+
function _createSolutionFromItemIds(options, srcAuthentication, destAuthentication) {
|
|
167
|
+
let solutionId = "";
|
|
156
168
|
// Create a solution from the list of items
|
|
157
|
-
return _createSolutionItem(
|
|
158
|
-
.then(
|
|
169
|
+
return _createSolutionItem(destAuthentication, options)
|
|
170
|
+
.then(id => {
|
|
159
171
|
solutionId = id;
|
|
160
172
|
// Add list of items to the new solution
|
|
161
|
-
return add_content_to_solution_1.addContentToSolution(solutionId, options,
|
|
173
|
+
return (0, add_content_to_solution_1.addContentToSolution)(solutionId, options, srcAuthentication, destAuthentication);
|
|
162
174
|
})
|
|
163
|
-
.catch(
|
|
175
|
+
.catch(addError => {
|
|
164
176
|
// If the solution item got created, delete it
|
|
165
177
|
if (solutionId) {
|
|
166
|
-
|
|
167
|
-
return failSafeRemove(solutionId,
|
|
178
|
+
const failSafeRemove = (0, hub_common_1.failSafe)(solution_common_1.removeItem, { success: true });
|
|
179
|
+
return failSafeRemove(solutionId, destAuthentication).then(() => {
|
|
168
180
|
throw addError;
|
|
169
181
|
});
|
|
170
182
|
}
|
|
@@ -184,16 +196,12 @@ exports._createSolutionFromItemIds = _createSolutionFromItemIds;
|
|
|
184
196
|
* @internal
|
|
185
197
|
*/
|
|
186
198
|
function _createSolutionItem(authentication, options) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
resolve(createResponse.id);
|
|
194
|
-
}, function (err) {
|
|
195
|
-
reject(err);
|
|
196
|
-
});
|
|
199
|
+
const model = _createSolutionItemModel(options);
|
|
200
|
+
// Create new solution item
|
|
201
|
+
delete model.item.thumbnailurl;
|
|
202
|
+
model.item.thumbnail = options?.thumbnail;
|
|
203
|
+
return (0, solution_common_1.createItemWithData)(model.item, model.data, authentication, options?.folderId).then(createResponse => {
|
|
204
|
+
return Promise.resolve(createResponse.id);
|
|
197
205
|
});
|
|
198
206
|
}
|
|
199
207
|
exports._createSolutionItem = _createSolutionItem;
|
|
@@ -205,26 +213,25 @@ exports._createSolutionItem = _createSolutionItem;
|
|
|
205
213
|
* @internal
|
|
206
214
|
*/
|
|
207
215
|
function _createSolutionItemModel(options) {
|
|
208
|
-
var _a, _b, _c, _d, _e;
|
|
209
216
|
// Solution uses all supplied tags but for deploy.* tags; that information goes into properties
|
|
210
|
-
|
|
211
|
-
|
|
217
|
+
const creationTags = options?.tags ?? [];
|
|
218
|
+
const solutionItem = {
|
|
212
219
|
type: "Solution",
|
|
213
|
-
title:
|
|
214
|
-
snippet:
|
|
215
|
-
description:
|
|
220
|
+
title: options?.title ?? (0, solution_common_1.createShortId)(),
|
|
221
|
+
snippet: options?.snippet ?? "",
|
|
222
|
+
description: options?.description ?? "",
|
|
216
223
|
properties: {
|
|
217
224
|
schemaVersion: solution_common_1.CURRENT_SCHEMA_VERSION
|
|
218
225
|
},
|
|
219
|
-
thumbnailurl:
|
|
220
|
-
tags: creationTags.filter(
|
|
226
|
+
thumbnailurl: options?.thumbnailurl ?? "",
|
|
227
|
+
tags: creationTags.filter((tag) => !tag.startsWith("deploy.")),
|
|
221
228
|
typeKeywords: ["Solution", "Template"].concat(_getDeploymentProperties(creationTags))
|
|
222
229
|
};
|
|
223
230
|
// ensure that snippet and description are not nefarious
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
sanitizedItem.typeKeywords =
|
|
227
|
-
|
|
231
|
+
const sanitizedItem = (0, solution_common_1.sanitizeJSONAndReportChanges)(solutionItem);
|
|
232
|
+
const addlKeywords = options?.additionalTypeKeywords || [];
|
|
233
|
+
sanitizedItem.typeKeywords = [].concat(solutionItem.typeKeywords, addlKeywords);
|
|
234
|
+
const solutionData = {
|
|
228
235
|
metadata: {},
|
|
229
236
|
templates: []
|
|
230
237
|
};
|
|
@@ -238,17 +245,16 @@ exports._createSolutionItemModel = _createSolutionItemModel;
|
|
|
238
245
|
* Gets the deploy.id and deploy.version tag values.
|
|
239
246
|
*
|
|
240
247
|
* @param tags A list of item tags
|
|
241
|
-
* @return A list
|
|
248
|
+
* @return A list containing the two values found in the tags, or defaulting to a new GUID and "1.0", respectively,
|
|
242
249
|
* as needed
|
|
243
250
|
* @internal
|
|
244
251
|
*/
|
|
245
252
|
function _getDeploymentProperties(tags) {
|
|
246
|
-
var _a, _b;
|
|
247
253
|
return [
|
|
248
254
|
"solutionid-" +
|
|
249
|
-
(
|
|
255
|
+
(_getDeploymentProperty("deploy.id.", tags) ?? (0, solution_common_1.createLongId)()),
|
|
250
256
|
"solutionversion-" +
|
|
251
|
-
(
|
|
257
|
+
(_getDeploymentProperty("deploy.version.", tags) ?? "1.0")
|
|
252
258
|
];
|
|
253
259
|
}
|
|
254
260
|
exports._getDeploymentProperties = _getDeploymentProperties;
|
|
@@ -261,7 +267,7 @@ exports._getDeploymentProperties = _getDeploymentProperties;
|
|
|
261
267
|
* @internal
|
|
262
268
|
*/
|
|
263
269
|
function _getDeploymentProperty(desiredTagPrefix, tags) {
|
|
264
|
-
|
|
270
|
+
const foundTagAsList = tags.filter(tag => tag.startsWith(desiredTagPrefix));
|
|
265
271
|
if (foundTagAsList.length > 0) {
|
|
266
272
|
return foundTagAsList[0].substr(desiredTagPrefix.length);
|
|
267
273
|
}
|
package/dist/node/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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,IAAI,EAAE,CAAC;IAC3D,aAAa,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;AApCD,4DAoCC;AAED;;;;;;;GAOG;AACH,SAAgB,wBAAwB,CAAC,IAAc;IACrD,OAAO;QACL,aAAa;YACX,CAAC,sBAAsB,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,IAAA,8BAAY,GAAE,CAAC;QAChE,kBAAkB;YAChB,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC;KAC7D,CAAC;AACJ,CAAC;AAPD,4DAOC;AAED;;;;;;;GAOG;AACH,SAAgB,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;AAVD,wDAUC"}
|
|
@@ -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
|
*
|