@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.
@@ -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
- var solution_common_1 = require("@esri/solution-common");
26
- var hub_common_1 = require("@esri/hub-common");
27
- var add_content_to_solution_1 = require("./helpers/add-content-to-solution");
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
- var noOp = function () { };
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 authentication Credentials for the request
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, authentication, options) {
39
- var createOptions = options || {};
40
- var progressCb = createOptions.progressCallback || noOp;
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, authentication),
45
- solution_common_1.getGroupContents(sourceId, authentication)
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
- function (responses) {
51
+ responses => {
50
52
  createOptions.itemIds = responses[1];
51
53
  progressCb(15);
52
- return new Promise(function (resolve) {
54
+ return new Promise(resolve => {
53
55
  // Update the createOptions with values from the group
54
- resolve(_applySourceToCreateOptions(createOptions, responses[0], authentication, true));
56
+ resolve(_applySourceToCreateOptions(createOptions, responses[0], srcAuthentication, true));
55
57
  });
56
58
  },
57
59
  // Assumption incorrect; try source as an item
58
- function () {
59
- return new Promise(function (resolve, reject) {
60
+ () => {
61
+ return new Promise((resolve, reject) => {
60
62
  createOptions.itemIds = [sourceId];
61
- solution_common_1.getItemBase(sourceId, authentication).then(
63
+ (0, solution_common_1.getItemBase)(sourceId, srcAuthentication).then(
62
64
  // Update the createOptions with values from the item
63
- function (itemBase) {
64
- return resolve(_applySourceToCreateOptions(createOptions, itemBase, authentication, false));
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
- function (createOptions) {
71
- return _addThumbnailFileToCreateOptions(createOptions, authentication);
83
+ createOptions => {
84
+ return _addThumbnailFileToCreateOptions(createOptions, srcAuthentication);
72
85
  })
73
86
  .then(
74
87
  // Create a solution
75
- function (createOptions) {
76
- return _createSolutionFromItemIds(createOptions, authentication);
88
+ createOptions => {
89
+ return _createSolutionFromItemIds(createOptions, srcAuthentication, destAuthentication);
77
90
  })
78
91
  .then(
79
92
  // Successfully created solution
80
- function (createdSolutionId) {
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
- function (error) {
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, authentication, isGroup) {
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(function (prop) {
106
- var _a;
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(authentication.portal, sourceInfo.id, sourceInfo.thumbnail, isGroup);
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 authentication
132
+ * @param srcAuthentication
122
133
  * @internal
123
134
  */
124
- function _addThumbnailFileToCreateOptions(createOptions, authentication) {
125
- return new Promise(function (resolve) {
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
- var filename = solution_common_1.getFilenameFromUrl(createOptions.thumbnailurl) || "thumbnail";
129
- var thumbnailurl = solution_common_1.appendQueryParam(createOptions.thumbnailurl, "w=400");
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, authentication).then(function (thumbnail) {
143
+ (0, solution_common_1.getBlobAsFile)(thumbnailurl, filename, srcAuthentication).then(thumbnail => {
133
144
  createOptions.thumbnail = thumbnail;
134
145
  resolve(createOptions);
135
- }, function () {
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 authentication Credentials for the request
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, authentication) {
155
- var solutionId = "";
166
+ function _createSolutionFromItemIds(options, srcAuthentication, destAuthentication) {
167
+ let solutionId = "";
156
168
  // Create a solution from the list of items
157
- return _createSolutionItem(authentication, options)
158
- .then(function (id) {
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, authentication);
173
+ return (0, add_content_to_solution_1.addContentToSolution)(solutionId, options, srcAuthentication, destAuthentication);
162
174
  })
163
- .catch(function (addError) {
175
+ .catch(addError => {
164
176
  // If the solution item got created, delete it
165
177
  if (solutionId) {
166
- var failSafeRemove = hub_common_1.failSafe(solution_common_1.removeItem, { success: true });
167
- return failSafeRemove(solutionId, authentication).then(function () {
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
- return new Promise(function (resolve, reject) {
188
- var model = _createSolutionItemModel(options);
189
- // Create new solution item
190
- delete model.item.thumbnailurl;
191
- model.item.thumbnail = options === null || options === void 0 ? void 0 : options.thumbnail;
192
- solution_common_1.createItemWithData(model.item, model.data, authentication, options === null || options === void 0 ? void 0 : options.folderId).then(function (createResponse) {
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
- var creationTags = (_a = options === null || options === void 0 ? void 0 : options.tags) !== null && _a !== void 0 ? _a : [];
211
- var solutionItem = {
217
+ const creationTags = options?.tags ?? [];
218
+ const solutionItem = {
212
219
  type: "Solution",
213
- title: (_b = options === null || options === void 0 ? void 0 : options.title) !== null && _b !== void 0 ? _b : solution_common_1.createShortId(),
214
- snippet: (_c = options === null || options === void 0 ? void 0 : options.snippet) !== null && _c !== void 0 ? _c : "",
215
- description: (_d = options === null || options === void 0 ? void 0 : options.description) !== null && _d !== void 0 ? _d : "",
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: (_e = options === null || options === void 0 ? void 0 : options.thumbnailurl) !== null && _e !== void 0 ? _e : "",
220
- tags: creationTags.filter(function (tag) { return !tag.startsWith("deploy."); }),
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
- var sanitizedItem = solution_common_1.sanitizeJSONAndReportChanges(solutionItem);
225
- var addlKeywords = (options === null || options === void 0 ? void 0 : options.additionalTypeKeywords) || [];
226
- sanitizedItem.typeKeywords = tslib_1.__spread(solutionItem.typeKeywords, addlKeywords);
227
- var solutionData = {
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 ocntaining the two values found in the tags, or defaulting to a new GUID and "1.0", respectively,
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
- ((_a = _getDeploymentProperty("deploy.id.", tags)) !== null && _a !== void 0 ? _a : solution_common_1.createLongId()),
255
+ (_getDeploymentProperty("deploy.id.", tags) ?? (0, solution_common_1.createLongId)()),
250
256
  "solutionversion-" +
251
- ((_b = _getDeploymentProperty("deploy.version.", tags)) !== null && _b !== void 0 ? _b : "1.0")
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
- var foundTagAsList = tags.filter(function (tag) { return tag.startsWith(desiredTagPrefix); });
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
  }
@@ -1 +1 @@
1
- {"version":3,"file":"creator.js","sourceRoot":"","sources":["../../src/creator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,yDAmB+B;AAC/B,+CAAoD;AACpD,6EAAyE;AAEzE,uDAAuD;AACvD,IAAM,IAAI,GAAG,cAAO,CAAC,CAAC;AAEtB;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,QAAgB,EAChB,cAA2B,EAC3B,OAAgC;IAEhC,IAAM,aAAa,GAA2B,OAAO,IAAI,EAAE,CAAC;IAC5D,IAAM,UAAU,GAAG,aAAa,CAAC,gBAAgB,IAAI,IAAI,CAAC;IAE1D,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,yCAAyC;IAEx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A4B,EAAC,YAAY,CAAC,CAAC;IAEjE,MAAM,YAAY,GAAG,OAAO,EAAE,sBAAsB,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 authentication Credentials for the request
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, authentication: UserSession): Promise<string>;
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 authentication Credentials for request organization info
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[], authentication: UserSession): Promise<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
  *