@esri/solution-deployer 1.1.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /* @preserve
2
- * @esri/solution-deployer - v1.1.3 - Apache-2.0
3
- * Copyright (c) 2018-2021 Esri, Inc.
4
- * Mon Oct 18 2021 09:05:22 GMT-0700 (Pacific Daylight Time)
2
+ * @esri/solution-deployer - v1.3.0 - Apache-2.0
3
+ * Copyright (c) 2018-2022 Esri, Inc.
4
+ * Thu Feb 17 2022 09:47:08 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,33 @@
18
18
  (function (global, factory) {
19
19
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@esri/solution-common'), require('@esri/solution-feature-layer'), require('@esri/solution-file'), require('@esri/solution-form'), require('@esri/solution-group'), require('@esri/solution-simple-types'), require('@esri/solution-storymap'), require('@esri/solution-velocity'), require('@esri/solution-web-experience'), require('@esri/solution-hub-types'), require('@esri/hub-common'), require('@esri/arcgis-rest-portal')) :
20
20
  typeof define === 'function' && define.amd ? define(['exports', '@esri/solution-common', '@esri/solution-feature-layer', '@esri/solution-file', '@esri/solution-form', '@esri/solution-group', '@esri/solution-simple-types', '@esri/solution-storymap', '@esri/solution-velocity', '@esri/solution-web-experience', '@esri/solution-hub-types', '@esri/hub-common', '@esri/arcgis-rest-portal'], factory) :
21
- (global = global || self, factory(global.arcgisSolution = global.arcgisSolution || {}, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisHub, global.arcgisRest));
22
- }(this, (function (exports, common, featureLayer, fileProcessor, formProcessor, group, solutionSimpleTypes, solutionStorymap, solutionVelocity, solutionWebExperience, solutionHubTypes, hubCommon, portal) { 'use strict';
21
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.arcgisSolution = global.arcgisSolution || {}, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisSolution, global.arcgisHub, global.arcgisRest));
22
+ })(this, (function (exports, common, featureLayer, fileProcessor, formProcessor, group, solutionSimpleTypes, solutionStorymap, solutionVelocity, solutionWebExperience, solutionHubTypes, hubCommon, portal) { '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);
43
+ var featureLayer__namespace = /*#__PURE__*/_interopNamespace(featureLayer);
44
+ var fileProcessor__namespace = /*#__PURE__*/_interopNamespace(fileProcessor);
45
+ var formProcessor__namespace = /*#__PURE__*/_interopNamespace(formProcessor);
46
+ var group__namespace = /*#__PURE__*/_interopNamespace(group);
47
+ var portal__namespace = /*#__PURE__*/_interopNamespace(portal);
23
48
 
24
49
  /** @license
25
50
  * Copyright 2020 Esri
@@ -36,7 +61,7 @@
36
61
  * See the License for the specific language governing permissions and
37
62
  * limitations under the License.
38
63
  */
39
- const UNSUPPORTED = null;
64
+ const UNSUPPORTED$1 = null;
40
65
  /**
41
66
  * Mapping from item type to module with type-specific template-handling code.
42
67
  * AGO types come from a blend of arcgis-portal-app\src\js\arcgisonline\pages\item\_Info.js and
@@ -45,12 +70,12 @@
45
70
  const moduleMap = {
46
71
  ////////////////////////////////////////////////////////
47
72
  // Group type
48
- Group: group,
73
+ Group: group__namespace,
49
74
  ////////////////////////////////////////////////////////
50
75
  // Layer types
51
76
  "Big Data Analytic": solutionVelocity.VelocityProcessor,
52
77
  "Feature Collection": solutionSimpleTypes.simpleTypes,
53
- "Feature Service": featureLayer,
78
+ "Feature Service": featureLayer__namespace,
54
79
  Feed: solutionVelocity.VelocityProcessor,
55
80
  "Geocoding Service": undefined,
56
81
  "Geodata Service": undefined,
@@ -59,7 +84,7 @@
59
84
  "Globe Service": undefined,
60
85
  "Image Service": undefined,
61
86
  KML: undefined,
62
- "Map Service": featureLayer,
87
+ "Map Service": featureLayer__namespace,
63
88
  "Network Analysis Service": undefined,
64
89
  "Real Time Analytic": solutionVelocity.VelocityProcessor,
65
90
  "Relational Database Connection": undefined,
@@ -83,8 +108,8 @@
83
108
  "Data Store": undefined,
84
109
  "Desktop Application": undefined,
85
110
  "Excalibur Imagery Project": undefined,
86
- Form: formProcessor,
87
- "Hub Initiative": UNSUPPORTED,
111
+ Form: formProcessor__namespace,
112
+ "Hub Initiative": UNSUPPORTED$1,
88
113
  "Hub Page": solutionHubTypes.HubPageProcessor,
89
114
  "Hub Site Application": solutionHubTypes.HubSiteProcessor,
90
115
  "Insights Model": solutionSimpleTypes.simpleTypes,
@@ -99,7 +124,7 @@
99
124
  "QuickCapture Project": solutionSimpleTypes.quickcaptureProcessor,
100
125
  "Site Application": solutionHubTypes.HubSiteProcessor,
101
126
  "Site Page": solutionHubTypes.HubPageProcessor,
102
- Solution: UNSUPPORTED,
127
+ Solution: UNSUPPORTED$1,
103
128
  StoryMap: solutionStorymap.StoryMapProcessor,
104
129
  "Urban Model": undefined,
105
130
  "Web Experience Template": undefined,
@@ -108,99 +133,99 @@
108
133
  "Workforce Project": solutionSimpleTypes.simpleTypes,
109
134
  ////////////////////////////////////////////////////////
110
135
  // File types
111
- "360 VR Experience": fileProcessor,
112
- "AppBuilder Extension": fileProcessor,
113
- "AppBuilder Widget Package": fileProcessor,
114
- "Application Configuration": fileProcessor,
115
- "ArcGIS Pro Add In": fileProcessor,
116
- "ArcGIS Pro Configuration": fileProcessor,
117
- "ArcPad Package": fileProcessor,
118
- "Basemap Package": fileProcessor,
119
- "CAD Drawing": fileProcessor,
120
- "CityEngine Web Scene": fileProcessor,
121
- "Code Attachment": UNSUPPORTED,
122
- "Code Sample": fileProcessor,
123
- "Color Set": fileProcessor,
124
- "Compact Tile Package": fileProcessor,
125
- "CSV Collection": fileProcessor,
126
- CSV: fileProcessor,
127
- "Deep Learning Package": fileProcessor,
128
- "Desktop Add In": fileProcessor,
129
- "Desktop Application Template": fileProcessor,
130
- "Desktop Style": fileProcessor,
131
- "Document Link": fileProcessor,
132
- "Explorer Add In": fileProcessor,
133
- "Explorer Layer": fileProcessor,
134
- "Explorer Map": fileProcessor,
135
- "Feature Collection Template": fileProcessor,
136
- "File Geodatabase": fileProcessor,
137
- GeoJson: fileProcessor,
138
- GeoPackage: fileProcessor,
139
- "Geoprocessing Package": fileProcessor,
140
- "Geoprocessing Sample": fileProcessor,
141
- "Globe Document": fileProcessor,
142
- "Image Collection": fileProcessor,
143
- Image: fileProcessor,
144
- "iWork Keynote": fileProcessor,
145
- "iWork Numbers": fileProcessor,
146
- "iWork Pages": fileProcessor,
147
- "KML Collection": fileProcessor,
148
- "Layer Package": fileProcessor,
149
- "Layer Template": fileProcessor,
150
- Layer: fileProcessor,
151
- Layout: fileProcessor,
152
- "Locator Package": fileProcessor,
153
- "Map Document": fileProcessor,
154
- "Map Package": fileProcessor,
155
- "Map Template": fileProcessor,
156
- "Microsoft Excel": fileProcessor,
157
- "Microsoft Powerpoint": fileProcessor,
158
- "Microsoft Word": fileProcessor,
159
- "Mobile Basemap Package": fileProcessor,
160
- "Mobile Map Package": fileProcessor,
161
- "Mobile Scene Package": fileProcessor,
162
- "Native Application": fileProcessor,
163
- "Native Application Installer": fileProcessor,
164
- "Native Application Template": fileProcessor,
165
- netCDF: fileProcessor,
166
- "Operation View": fileProcessor,
167
- "Operations Dashboard Add In": fileProcessor,
168
- "Operations Dashboard Extension": fileProcessor,
169
- PDF: fileProcessor,
170
- "Pro Layer Package": fileProcessor,
171
- "Pro Layer": fileProcessor,
172
- "Pro Map Package": fileProcessor,
173
- "Pro Map": fileProcessor,
174
- "Pro Report": fileProcessor,
175
- "Project Package": fileProcessor,
176
- "Project Template": fileProcessor,
177
- "Published Map": fileProcessor,
178
- "Raster function template": fileProcessor,
179
- "Report Template": fileProcessor,
180
- "Rule Package": fileProcessor,
181
- "Scene Document": fileProcessor,
182
- "Scene Package": fileProcessor,
183
- "Service Definition": fileProcessor,
184
- Shapefile: fileProcessor,
185
- "Statistical Data Collection": fileProcessor,
186
- Style: fileProcessor,
187
- "Survey123 Add In": fileProcessor,
188
- "Symbol Set": fileProcessor,
189
- "Task File": fileProcessor,
190
- "Tile Package": fileProcessor,
191
- "Toolbox Package": fileProcessor,
192
- "Vector Tile Package": fileProcessor,
193
- "Viewer Configuration": fileProcessor,
194
- "Visio Document": fileProcessor,
195
- "Window Mobile Package": fileProcessor,
196
- "Windows Mobile Package": fileProcessor,
197
- "Windows Viewer Add In": fileProcessor,
198
- "Windows Viewer Configuration": fileProcessor,
199
- "Workflow Manager Package": fileProcessor,
136
+ "360 VR Experience": fileProcessor__namespace,
137
+ "AppBuilder Extension": fileProcessor__namespace,
138
+ "AppBuilder Widget Package": fileProcessor__namespace,
139
+ "Application Configuration": fileProcessor__namespace,
140
+ "ArcGIS Pro Add In": fileProcessor__namespace,
141
+ "ArcGIS Pro Configuration": fileProcessor__namespace,
142
+ "ArcPad Package": fileProcessor__namespace,
143
+ "Basemap Package": fileProcessor__namespace,
144
+ "CAD Drawing": fileProcessor__namespace,
145
+ "CityEngine Web Scene": fileProcessor__namespace,
146
+ "Code Attachment": UNSUPPORTED$1,
147
+ "Code Sample": fileProcessor__namespace,
148
+ "Color Set": fileProcessor__namespace,
149
+ "Compact Tile Package": fileProcessor__namespace,
150
+ "CSV Collection": fileProcessor__namespace,
151
+ CSV: fileProcessor__namespace,
152
+ "Deep Learning Package": fileProcessor__namespace,
153
+ "Desktop Add In": fileProcessor__namespace,
154
+ "Desktop Application Template": fileProcessor__namespace,
155
+ "Desktop Style": fileProcessor__namespace,
156
+ "Document Link": fileProcessor__namespace,
157
+ "Explorer Add In": fileProcessor__namespace,
158
+ "Explorer Layer": fileProcessor__namespace,
159
+ "Explorer Map": fileProcessor__namespace,
160
+ "Feature Collection Template": fileProcessor__namespace,
161
+ "File Geodatabase": fileProcessor__namespace,
162
+ GeoJson: fileProcessor__namespace,
163
+ GeoPackage: fileProcessor__namespace,
164
+ "Geoprocessing Package": fileProcessor__namespace,
165
+ "Geoprocessing Sample": fileProcessor__namespace,
166
+ "Globe Document": fileProcessor__namespace,
167
+ "Image Collection": fileProcessor__namespace,
168
+ Image: fileProcessor__namespace,
169
+ "iWork Keynote": fileProcessor__namespace,
170
+ "iWork Numbers": fileProcessor__namespace,
171
+ "iWork Pages": fileProcessor__namespace,
172
+ "KML Collection": fileProcessor__namespace,
173
+ "Layer Package": fileProcessor__namespace,
174
+ "Layer Template": fileProcessor__namespace,
175
+ Layer: fileProcessor__namespace,
176
+ Layout: fileProcessor__namespace,
177
+ "Locator Package": fileProcessor__namespace,
178
+ "Map Document": fileProcessor__namespace,
179
+ "Map Package": fileProcessor__namespace,
180
+ "Map Template": fileProcessor__namespace,
181
+ "Microsoft Excel": fileProcessor__namespace,
182
+ "Microsoft Powerpoint": fileProcessor__namespace,
183
+ "Microsoft Word": fileProcessor__namespace,
184
+ "Mobile Basemap Package": fileProcessor__namespace,
185
+ "Mobile Map Package": fileProcessor__namespace,
186
+ "Mobile Scene Package": fileProcessor__namespace,
187
+ "Native Application": fileProcessor__namespace,
188
+ "Native Application Installer": fileProcessor__namespace,
189
+ "Native Application Template": fileProcessor__namespace,
190
+ netCDF: fileProcessor__namespace,
191
+ "Operation View": fileProcessor__namespace,
192
+ "Operations Dashboard Add In": fileProcessor__namespace,
193
+ "Operations Dashboard Extension": fileProcessor__namespace,
194
+ PDF: fileProcessor__namespace,
195
+ "Pro Layer Package": fileProcessor__namespace,
196
+ "Pro Layer": fileProcessor__namespace,
197
+ "Pro Map Package": fileProcessor__namespace,
198
+ "Pro Map": fileProcessor__namespace,
199
+ "Pro Report": fileProcessor__namespace,
200
+ "Project Package": fileProcessor__namespace,
201
+ "Project Template": fileProcessor__namespace,
202
+ "Published Map": fileProcessor__namespace,
203
+ "Raster function template": fileProcessor__namespace,
204
+ "Report Template": fileProcessor__namespace,
205
+ "Rule Package": fileProcessor__namespace,
206
+ "Scene Document": fileProcessor__namespace,
207
+ "Scene Package": fileProcessor__namespace,
208
+ "Service Definition": fileProcessor__namespace,
209
+ Shapefile: fileProcessor__namespace,
210
+ "Statistical Data Collection": fileProcessor__namespace,
211
+ Style: fileProcessor__namespace,
212
+ "Survey123 Add In": fileProcessor__namespace,
213
+ "Symbol Set": fileProcessor__namespace,
214
+ "Task File": fileProcessor__namespace,
215
+ "Tile Package": fileProcessor__namespace,
216
+ "Toolbox Package": fileProcessor__namespace,
217
+ "Vector Tile Package": fileProcessor__namespace,
218
+ "Viewer Configuration": fileProcessor__namespace,
219
+ "Visio Document": fileProcessor__namespace,
220
+ "Window Mobile Package": fileProcessor__namespace,
221
+ "Windows Mobile Package": fileProcessor__namespace,
222
+ "Windows Viewer Add In": fileProcessor__namespace,
223
+ "Windows Viewer Configuration": fileProcessor__namespace,
224
+ "Workflow Manager Package": fileProcessor__namespace,
200
225
  ////////////////////////////////////////////////////////
201
226
  // Testing "types"
202
227
  Undefined: undefined,
203
- Unsupported: UNSUPPORTED
228
+ Unsupported: UNSUPPORTED$1
204
229
  };
205
230
 
206
231
  /** @license
@@ -218,7 +243,7 @@
218
243
  * See the License for the specific language governing permissions and
219
244
  * limitations under the License.
220
245
  */
221
- const UNSUPPORTED$1 = null;
246
+ const UNSUPPORTED = null;
222
247
  // ------------------------------------------------------------------------------------------------------------------ //
223
248
  /**
224
249
  * Deploys a set of items defined by templates.
@@ -248,9 +273,9 @@
248
273
  percentDone += progressPercentStep * costUsed;
249
274
  /* istanbul ignore else */
250
275
  if (options.progressCallback) {
251
- if (status === common.EItemProgressStatus.Finished) {
276
+ if (status === common__namespace.EItemProgressStatus.Finished) {
252
277
  const event = {
253
- event: common.SItemProgressStatus[status],
278
+ event: common__namespace.SItemProgressStatus[status],
254
279
  data: itemId
255
280
  };
256
281
  options.progressCallback(Math.round(percentDone), options.jobId, event);
@@ -261,12 +286,12 @@
261
286
  }
262
287
  /* istanbul ignore if */
263
288
  if (options.consoleProgress) {
264
- console.log(Date.now(), itemId, options.jobId ?? "", common.SItemProgressStatus[status], percentDone.toFixed(0) + "%", costUsed, createdItemId ? "==> " + createdItemId : "");
289
+ console.log(Date.now(), itemId, options.jobId ?? "", common__namespace.SItemProgressStatus[status], percentDone.toFixed(0) + "%", costUsed, createdItemId ? "==> " + createdItemId : "");
265
290
  }
266
- if (status === common.EItemProgressStatus.Created) {
291
+ if (status === common__namespace.EItemProgressStatus.Created) {
267
292
  deployedItemIds.push(createdItemId);
268
293
  }
269
- else if (status === common.EItemProgressStatus.Failed) {
294
+ else if (status === common__namespace.EItemProgressStatus.Failed) {
270
295
  failedTemplateItemIds.push(itemId);
271
296
  console.error("Item " + itemId + " has failed");
272
297
  statusOK = false;
@@ -275,13 +300,13 @@
275
300
  // ---------------------------------------------------------------------------------------------------------------
276
301
  };
277
302
  // portal does not allow views of a single source to be created at the same time
278
- if (common.getProp(templateDictionary, "organization.isPortal")) {
303
+ if (common__namespace.getProp(templateDictionary, "organization.isPortal")) {
279
304
  templates = _evaluateSharedViewSources(templates);
280
305
  }
281
306
  // Create an ordered graph of the templates so that dependencies are created before the items that need them.
282
307
  // Because cycles are permitted, we also keep track of items that need to be patched later because their
283
308
  // dependencies are necessarily created after they are created.
284
- const { buildOrder, itemsToBePatched } = common.topologicallySortItems(templates);
309
+ const { buildOrder, itemsToBePatched } = common__namespace.topologicallySortItems(templates);
285
310
  // For each item in order from no dependencies to dependent on other items,
286
311
  // * replace template symbols using template dictionary
287
312
  // * create item in destination group
@@ -290,14 +315,14 @@
290
315
  const reuseItemsDef = _reuseDeployedItems(templates, options.enableItemReuse ?? false, templateDictionary, destinationAuthentication);
291
316
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
292
317
  reuseItemsDef.then(() => {
293
- const useExistingItemsDef = _useExistingItems(templates, common.getProp(templateDictionary, "params.useExisting"), templateDictionary, destinationAuthentication);
318
+ const useExistingItemsDef = _useExistingItems(templates, common__namespace.getProp(templateDictionary, "params.useExisting"), templateDictionary, destinationAuthentication);
294
319
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
295
320
  useExistingItemsDef.then(() => {
296
- templates = common.setNamesAndTitles(templates, templateDictionary.solutionItemId);
321
+ templates = common__namespace.setNamesAndTitles(templates, templateDictionary.solutionItemId);
297
322
  buildOrder.forEach((id) => {
298
323
  // Get the item's template out of the list of templates
299
- const template = common.findTemplateInList(templates, id);
300
- awaitAllItems.push(_createItemFromTemplateWhenReady(template, common.generateStorageFilePaths(portalSharingUrl, storageItemId, template.resources, options.storageVersion), storageAuthentication, templateDictionary, destinationAuthentication, itemProgressCallback));
324
+ const template = common__namespace.findTemplateInList(templates, id);
325
+ awaitAllItems.push(_createItemFromTemplateWhenReady(template, common__namespace.generateStorageFilePaths(portalSharingUrl, storageItemId, template.resources, options.storageVersion), storageAuthentication, templateDictionary, destinationAuthentication, itemProgressCallback));
301
326
  });
302
327
  // Wait until all items have been created
303
328
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
@@ -315,14 +340,15 @@
315
340
  consoleProgress: true
316
341
  };
317
342
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
318
- common.deleteSolutionByComponents(deployedSolutionId, deployedItemIds, templates, templateDictionary, destinationAuthentication, progressOptions)
319
- .then(() => reject(common.failWithIds(failedTemplateItemIds)));
343
+ common__namespace
344
+ .deleteSolutionByComponents(deployedSolutionId, deployedItemIds, templates, templateDictionary, destinationAuthentication, progressOptions)
345
+ .then(() => reject(common__namespace.failWithIds(failedTemplateItemIds)));
320
346
  }
321
347
  });
322
348
  });
323
349
  }, e => {
324
350
  console.error(e);
325
- reject(common.fail(e));
351
+ reject(common__namespace.fail(e));
326
352
  });
327
353
  });
328
354
  }
@@ -369,8 +395,8 @@
369
395
  Object.keys(viewHash).forEach(k => {
370
396
  const _views = viewHash[k];
371
397
  _views.forEach(cv => {
372
- const template = common.findTemplateInList(templates, cv);
373
- const syncViews = common.getProp(template, "properties.syncViews");
398
+ const template = common__namespace.findTemplateInList(templates, cv);
399
+ const syncViews = common__namespace.getProp(template, "properties.syncViews");
374
400
  /* istanbul ignore else */
375
401
  if (visited.indexOf(template.itemId) > -1) {
376
402
  processed = processed.concat(syncViews);
@@ -378,7 +404,7 @@
378
404
  /* istanbul ignore else */
379
405
  if (syncViews && syncViews.length > 0) {
380
406
  // when a view has multiple dependencies we need to retain the syncViews if they have been set already...
381
- common.setProp(template, "properties.syncViews", common.cloneObject(processed));
407
+ common__namespace.setProp(template, "properties.syncViews", common__namespace.cloneObject(processed));
382
408
  }
383
409
  /* istanbul ignore else */
384
410
  if (processed.indexOf(cv) < 0) {
@@ -409,7 +435,7 @@
409
435
  v.dependencies.forEach((id) => {
410
436
  templates = templates.map(t => {
411
437
  /* istanbul ignore else */
412
- if (common.getProp(t, "properties.service.isView") &&
438
+ if (common__namespace.getProp(t, "properties.service.isView") &&
413
439
  t.dependencies.indexOf(id) > -1 &&
414
440
  t.itemId !== v.id) {
415
441
  /* istanbul ignore else */
@@ -464,7 +490,7 @@
464
490
  function _getViews(templates) {
465
491
  return templates.reduce((acc, v) => {
466
492
  /* istanbul ignore else */
467
- if (common.getProp(v, "properties.service.isView")) {
493
+ if (common__namespace.getProp(v, "properties.service.isView")) {
468
494
  acc.push({
469
495
  id: v.itemId,
470
496
  dependencies: v.dependencies
@@ -495,8 +521,8 @@
495
521
  _handleExistingItems(existingItemsByTagResponse, templateDictionary, authentication, false);
496
522
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
497
523
  _updateTemplateDictionary(templates, templateDictionary, authentication).then(resolve);
498
- }, e => reject(common.fail(e)));
499
- }, e => reject(common.fail(e)));
524
+ }, e => reject(common__namespace.fail(e)));
525
+ }, e => reject(common__namespace.fail(e)));
500
526
  }
501
527
  else {
502
528
  resolve(null);
@@ -536,7 +562,7 @@
536
562
  _updateTemplateDictionaryById(templateDictionary, k, v.itemId, v);
537
563
  // need to check and set the typeKeyword if it doesn't exist on this service yet
538
564
  // when the user has passed in an itemId that does not come from a previous deployment
539
- itemDefs.push(common.getItemBase(v.itemId, authentication));
565
+ itemDefs.push(common__namespace.getItemBase(v.itemId, authentication));
540
566
  sourceIdHash[v.itemId] = k;
541
567
  /* istanbul ignore else */
542
568
  if (itemIds.indexOf(k) < 0) {
@@ -547,7 +573,7 @@
547
573
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
548
574
  _setTypekeywordForExisting(itemDefs, sourceIdHash, authentication).then(() => {
549
575
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
550
- _updateTemplateDictionary(itemIds.map(id => common.getTemplateById(templates, id)), templateDictionary, authentication).then(resolve);
576
+ _updateTemplateDictionary(itemIds.map(id => common__namespace.getTemplateById(templates, id)), templateDictionary, authentication).then(resolve);
551
577
  });
552
578
  }
553
579
  else {
@@ -581,7 +607,7 @@
581
607
  if (typeKeywords.indexOf(sourceKeyword) < 0) {
582
608
  typeKeywords.push(sourceKeyword);
583
609
  const itemUpdate = { id: result.id, typeKeywords };
584
- itemUpdateDefs.push(common.updateItem(itemUpdate, authentication));
610
+ itemUpdateDefs.push(common__namespace.updateItem(itemUpdate, authentication));
585
611
  }
586
612
  }
587
613
  });
@@ -619,13 +645,13 @@
619
645
  if (templateInfo && templateInfo.url && templateInfo.itemId) {
620
646
  /* istanbul ignore else */
621
647
  if (t.item.type === "Feature Service") {
622
- const enterpriseIDMapping = common.getProp(templateDictionary, `params.${t.itemId}.enterpriseIDMapping`);
623
- Object.assign(templateDictionary[t.itemId], common.getLayerSettings(common.getLayersAndTables(t), templateInfo.url, templateInfo.itemId, enterpriseIDMapping));
648
+ const enterpriseIDMapping = common__namespace.getProp(templateDictionary, `params.${t.itemId}.enterpriseIDMapping`);
649
+ Object.assign(templateDictionary[t.itemId], common__namespace.getLayerSettings(common__namespace.getLayersAndTables(t), templateInfo.url, templateInfo.itemId, enterpriseIDMapping));
624
650
  // if the service has veiws keep track of the fields so we can use them to
625
651
  // compare with the view fields
626
652
  /* istanbul ignore else */
627
- if (common.getProp(t, "properties.service.hasViews")) {
628
- common._updateTemplateDictionaryFields(t, templateDictionary, false);
653
+ if (common__namespace.getProp(t, "properties.service.hasViews")) {
654
+ common__namespace._updateTemplateDictionaryFields(t, templateDictionary, false);
629
655
  }
630
656
  }
631
657
  // for fs query with its url...for non fs query the item
@@ -635,8 +661,8 @@
635
661
  /* istanbul ignore else */
636
662
  if (urls.indexOf(templateInfo.url) < 0) {
637
663
  defs.push(t.item.type === "Feature Service"
638
- ? common.rest_request(templateInfo.url, { authentication })
639
- : common.getItemBase(templateInfo.itemId, authentication));
664
+ ? common__namespace.rest_request(templateInfo.url, { authentication })
665
+ : common__namespace.getItemBase(templateInfo.itemId, authentication));
640
666
  urls.push(templateInfo.url);
641
667
  types.push(t.item.type);
642
668
  ids.push(templateInfo.itemId);
@@ -656,19 +682,19 @@
656
682
  const v = templateDictionary[k];
657
683
  /* istanbul ignore else */
658
684
  if (v.itemId && v.itemId === r.serviceItemId) {
659
- common.setDefaultSpatialReference(templateDictionary, k, r.spatialReference);
685
+ common__namespace.setDefaultSpatialReference(templateDictionary, k, r.spatialReference);
660
686
  // keep the extent values from these responses as well
661
- common.setCreateProp(templateDictionary, `${k}.defaultExtent`, r.fullExtent || r.initialExtent);
687
+ common__namespace.setCreateProp(templateDictionary, `${k}.defaultExtent`, r.fullExtent || r.initialExtent);
662
688
  const layerIds = (r.layers || []).map((l) => l.id);
663
689
  const tablesIds = (r.tables || []).map((t) => t.id);
664
- fieldDefs.push(common.getExistingLayersAndTables(urls[i], layerIds.concat(tablesIds), authentication));
690
+ fieldDefs.push(common__namespace.getExistingLayersAndTables(urls[i], layerIds.concat(tablesIds), authentication));
665
691
  }
666
692
  });
667
693
  }
668
694
  else {
669
695
  /* istanbul ignore else */
670
696
  if (types[i] === "Feature Service" ||
671
- common.getProp(r, "response.error")) {
697
+ common__namespace.getProp(r, "response.error")) {
672
698
  // if an error is returned we need to clean up the templateDictionary
673
699
  templateDictionary = _updateTemplateDictionaryForError(templateDictionary, ids[i]);
674
700
  }
@@ -690,7 +716,7 @@
690
716
  return true;
691
717
  }
692
718
  });
693
- const enterpriseIDMapping = common.getProp(templateDictionary, `params.${sourceId}.enterpriseIDMapping`);
719
+ const enterpriseIDMapping = common__namespace.getProp(templateDictionary, `params.${sourceId}.enterpriseIDMapping`);
694
720
  if (enterpriseIDMapping) {
695
721
  Object.keys(enterpriseIDMapping).forEach(id => {
696
722
  if (enterpriseIDMapping[id].toString() ===
@@ -734,7 +760,7 @@
734
760
  * @protected
735
761
  */
736
762
  function _setFields(templateDictionary, itemId, layerId, fields) {
737
- const layerInfo = common.getProp(templateDictionary, `${itemId}.layer${layerId}`);
763
+ const layerInfo = common__namespace.getProp(templateDictionary, `${itemId}.layer${layerId}`);
738
764
  /* istanbul ignore else */
739
765
  if (layerInfo && fields) {
740
766
  layerInfo.fields = fields;
@@ -818,7 +844,7 @@
818
844
  }
819
845
  function _updateTemplateDictionaryById(templateDictionary, sourceId, itemId, v) {
820
846
  templateDictionary[sourceId] = Object.assign(templateDictionary[sourceId] || {}, {
821
- def: Promise.resolve(common.generateEmptyCreationResponse(v.type, itemId)),
847
+ def: Promise.resolve(common__namespace.generateEmptyCreationResponse(v.type, itemId)),
822
848
  itemId,
823
849
  name: v.name,
824
850
  title: v.title,
@@ -842,7 +868,7 @@
842
868
  if (Array.isArray(userGroups)) {
843
869
  existingItemsDefs.push(Promise.resolve({
844
870
  results: userGroups
845
- .filter(g => g.tags.indexOf(`source-${template.itemId}`) > -1)
871
+ .filter(g => g.tags.indexOf(`source-${template.itemId}`) > -1 || g.typeKeywords.indexOf(`source-${template.itemId}`) > -1)
846
872
  .map(g => {
847
873
  g.type = "Group";
848
874
  return g;
@@ -871,7 +897,7 @@
871
897
  authentication: authentication,
872
898
  pagingParam: { start: 1, num: 100 }
873
899
  };
874
- return common.searchItems(searchOptions);
900
+ return common__namespace.searchItems(searchOptions);
875
901
  }
876
902
  /**
877
903
  * Creates an item from a template once the item's dependencies have been created.
@@ -891,9 +917,9 @@
891
917
  // if there is no entry in the templateDictionary
892
918
  // or if we have a basic entry without the deferred request for its creation, add it
893
919
  if (!templateDictionary.hasOwnProperty(template.itemId) ||
894
- !common.getProp(templateDictionary[template.itemId], "def")) {
920
+ !common__namespace.getProp(templateDictionary[template.itemId], "def")) {
895
921
  let createResponse;
896
- let statusCode = common.EItemProgressStatus.Unknown;
922
+ let statusCode = common__namespace.EItemProgressStatus.Unknown;
897
923
  let itemHandler;
898
924
  templateDictionary[template.itemId] =
899
925
  templateDictionary[template.itemId] || {};
@@ -901,7 +927,7 @@
901
927
  templateDictionary[template.itemId].def = new Promise(resolve => {
902
928
  // Wait until all of the item's dependencies are deployed
903
929
  const _awaitDependencies = template.dependencies.reduce((acc, id) => {
904
- const def = common.getProp(templateDictionary, `${id}.def`);
930
+ const def = common__namespace.getProp(templateDictionary, `${id}.def`);
905
931
  // can't use maybePush as that clones the object, which does not work for Promises
906
932
  /* istanbul ignore else */
907
933
  if (def) {
@@ -909,10 +935,10 @@
909
935
  }
910
936
  return acc;
911
937
  }, []);
912
- const syncViews = common.getProp(template, "properties.syncViews");
938
+ const syncViews = common__namespace.getProp(template, "properties.syncViews");
913
939
  const awaitDependencies = syncViews && syncViews.length > 0
914
940
  ? syncViews.reduce((acc, v) => {
915
- const def = common.getProp(templateDictionary, `${v}.def`);
941
+ const def = common__namespace.getProp(templateDictionary, `${v}.def`);
916
942
  /* istanbul ignore else */
917
943
  if (def) {
918
944
  acc.push(def);
@@ -925,18 +951,18 @@
925
951
  // Find the conversion handler for this item type
926
952
  const templateType = template.type;
927
953
  itemHandler = moduleMap[templateType];
928
- if (!itemHandler || itemHandler === UNSUPPORTED$1) {
929
- if (itemHandler === UNSUPPORTED$1) {
930
- statusCode = common.EItemProgressStatus.Ignored;
954
+ if (!itemHandler || itemHandler === UNSUPPORTED) {
955
+ if (itemHandler === UNSUPPORTED) {
956
+ statusCode = common__namespace.EItemProgressStatus.Ignored;
931
957
  throw new Error();
932
958
  }
933
959
  else {
934
- statusCode = common.EItemProgressStatus.Failed;
960
+ statusCode = common__namespace.EItemProgressStatus.Failed;
935
961
  throw new Error();
936
962
  }
937
963
  }
938
964
  // Get the item's thumbnail
939
- return common.getThumbnailFromStorageItem(storageAuthentication, resourceFilePaths);
965
+ return common__namespace.getThumbnailFromStorageItem(storageAuthentication, resourceFilePaths);
940
966
  })
941
967
  .then(thumbnail => {
942
968
  template.item.thumbnail = thumbnail;
@@ -946,17 +972,17 @@
946
972
  })
947
973
  .then((response) => {
948
974
  if (response.id === "") {
949
- statusCode = common.EItemProgressStatus.Failed;
975
+ statusCode = common__namespace.EItemProgressStatus.Failed;
950
976
  throw new Error("handled"); // fails to create item
951
977
  }
952
978
  /* istanbul ignore else */
953
979
  createResponse = response;
954
980
  if (createResponse.item.item.url) {
955
- common.setCreateProp(templateDictionary, template.itemId + ".url", createResponse.item.item.url);
981
+ common__namespace.setCreateProp(templateDictionary, template.itemId + ".url", createResponse.item.item.url);
956
982
  }
957
983
  if (resourceFilePaths.length > 0) {
958
984
  // Copy resources, metadata, form
959
- return common.copyFilesFromStorageItem(storageAuthentication, resourceFilePaths, templateDictionary.folderId, createResponse.id, destinationAuthentication, createResponse.item);
985
+ return common__namespace.copyFilesFromStorageItem(storageAuthentication, resourceFilePaths, templateDictionary.folderId, createResponse.id, destinationAuthentication, createResponse.item);
960
986
  }
961
987
  else {
962
988
  return Promise.resolve(null);
@@ -967,12 +993,12 @@
967
993
  })
968
994
  .catch(error => {
969
995
  if (!error || error.message !== "handled") {
970
- itemProgressCallback(template.itemId, statusCode === common.EItemProgressStatus.Unknown
971
- ? common.EItemProgressStatus.Failed
996
+ itemProgressCallback(template.itemId, statusCode === common__namespace.EItemProgressStatus.Unknown
997
+ ? common__namespace.EItemProgressStatus.Failed
972
998
  : statusCode, 0);
973
999
  }
974
1000
  // Item type not supported or fails to get item dependencies
975
- resolve(common.generateEmptyCreationResponse(template.type));
1001
+ resolve(common__namespace.generateEmptyCreationResponse(template.type));
976
1002
  });
977
1003
  });
978
1004
  }
@@ -994,7 +1020,7 @@
994
1020
  function _getGroupUpdates(template, authentication, templateDictionary) {
995
1021
  const groups = template.groups || [];
996
1022
  return groups.map((sourceGroupId) => {
997
- return common.shareItem(templateDictionary[sourceGroupId].itemId, template.itemId, authentication, common.isTrackingViewTemplate(template) ? templateDictionary.locationTracking.owner : undefined);
1023
+ return common__namespace.shareItem(templateDictionary[sourceGroupId].itemId, template.itemId, authentication, common__namespace.isTrackingViewTemplate(template) ? templateDictionary.locationTracking.owner : undefined);
998
1024
  });
999
1025
  }
1000
1026
 
@@ -1139,7 +1165,7 @@
1139
1165
  */
1140
1166
  // NOTE: Moved to separate file to allow stubbing in main deploySolution tests
1141
1167
  function deploySolutionFromTemplate(templateSolutionId, solutionTemplateBase, solutionTemplateData, authentication, options) {
1142
- options.storageVersion = common.extractSolutionVersion(solutionTemplateData);
1168
+ options.storageVersion = common__namespace.extractSolutionVersion(solutionTemplateData);
1143
1169
  return new Promise((resolve, reject) => {
1144
1170
  // It is possible to provide a separate authentication for the source
1145
1171
  const storageAuthentication = options.storageAuthentication
@@ -1160,18 +1186,18 @@
1160
1186
  if (!options.thumbnail && options.thumbnailurl) {
1161
1187
  // Figure out the thumbnail's filename
1162
1188
  thumbFilename =
1163
- common.getFilenameFromUrl(options.thumbnailurl) || thumbFilename;
1164
- const thumbnailurl = common.appendQueryParam(options.thumbnailurl, "w=400");
1189
+ common__namespace.getFilenameFromUrl(options.thumbnailurl) || thumbFilename;
1190
+ const thumbnailurl = common__namespace.appendQueryParam(options.thumbnailurl, "w=400");
1165
1191
  delete options.thumbnailurl;
1166
1192
  // Fetch the thumbnail
1167
- thumbDef = common.getBlobAsFile(thumbnailurl, thumbFilename, storageAuthentication, [400]);
1193
+ thumbDef = common__namespace.getBlobAsFile(thumbnailurl, thumbFilename, storageAuthentication, [400]);
1168
1194
  }
1169
1195
  _replaceParamVariables(solutionTemplateData, templateDictionary);
1170
1196
  // Get information about deployment environment
1171
1197
  Promise.all([
1172
- common.getPortal("", authentication),
1173
- common.getUser(authentication),
1174
- common.getFoldersAndGroups(authentication),
1198
+ common__namespace.getPortal("", authentication),
1199
+ common__namespace.getUser(authentication),
1200
+ common__namespace.getFoldersAndGroups(authentication),
1175
1201
  thumbDef
1176
1202
  ])
1177
1203
  .then(responses => {
@@ -1180,22 +1206,7 @@
1180
1206
  options.thumbnail = thumbnailFile;
1181
1207
  }
1182
1208
  // update template items with source-itemId type keyword
1183
- solutionTemplateData.templates = solutionTemplateData.templates.map((template) => {
1184
- const sourceId = "source-" + template.itemId;
1185
- /* istanbul ignore else */
1186
- if (template.item) {
1187
- /* istanbul ignore else */
1188
- if (template.item.typeKeywords) {
1189
- template.item.typeKeywords.push(sourceId);
1190
- }
1191
- /* istanbul ignore else */
1192
- if (template.item.tags &&
1193
- common.getProp(template, "item.type") === "Group") {
1194
- template.item.tags.push(sourceId);
1195
- }
1196
- }
1197
- return template;
1198
- });
1209
+ solutionTemplateData.templates = _addSourceId(solutionTemplateData.templates);
1199
1210
  templateDictionary.isPortal = portalResponse.isPortal;
1200
1211
  templateDictionary.organization = Object.assign(templateDictionary.organization || {}, portalResponse);
1201
1212
  // TODO: Add more computed properties here
@@ -1207,17 +1218,17 @@
1207
1218
  templateDictionary.user.folders = foldersAndGroupsResponse.folders;
1208
1219
  templateDictionary.user.groups = foldersAndGroupsResponse.groups.filter((group) => group.owner === templateDictionary.user.username);
1209
1220
  // if we have tracking views and the user is not admin or the org doesn't support tracking an error is thrown
1210
- common.setLocationTrackingEnabled(portalResponse, userResponse, templateDictionary, solutionTemplateData.templates);
1211
- const trackingOwnerPromise = common.getTackingServiceOwner(templateDictionary, authentication);
1221
+ common__namespace.setLocationTrackingEnabled(portalResponse, userResponse, templateDictionary, solutionTemplateData.templates);
1222
+ const trackingOwnerPromise = common__namespace.getTackingServiceOwner(templateDictionary, authentication);
1212
1223
  // Create a folder to hold the deployed solution. We use the solution name, appending a sequential
1213
1224
  // suffix if the folder exists, e.g.,
1214
1225
  // * Manage Right of Way Activities
1215
1226
  // * Manage Right of Way Activities 1
1216
1227
  // * Manage Right of Way Activities 2
1217
- const folderPromise = common.createUniqueFolder(solutionTemplateBase.title, templateDictionary, authentication);
1228
+ const folderPromise = common__namespace.createUniqueFolder(solutionTemplateBase.title, templateDictionary, authentication);
1218
1229
  // Apply the portal extents to the solution
1219
1230
  const portalExtent = portalResponse.defaultExtent;
1220
- const extentsPromise = common.convertExtentWithFallback(portalExtent, undefined, { wkid: 4326 }, portalResponse.helperServices.geometry.url, authentication);
1231
+ const extentsPromise = common__namespace.convertExtentWithFallback(portalExtent, undefined, { wkid: 4326 }, portalResponse.helperServices.geometry.url, authentication);
1221
1232
  // Await completion of async actions: folder creation & extents conversion
1222
1233
  return Promise.all([folderPromise, extentsPromise, trackingOwnerPromise]);
1223
1234
  })
@@ -1246,7 +1257,7 @@
1246
1257
  }
1247
1258
  // Create a deployed Solution item
1248
1259
  const createSolutionItemBase = {
1249
- ...common.sanitizeJSONAndReportChanges(solutionTemplateBase),
1260
+ ...common__namespace.sanitizeJSONAndReportChanges(solutionTemplateBase),
1250
1261
  type: "Solution",
1251
1262
  typeKeywords: ["Solution"]
1252
1263
  };
@@ -1255,7 +1266,7 @@
1255
1266
  }
1256
1267
  // Create deployed solution item
1257
1268
  createSolutionItemBase.thumbnail = options.thumbnail;
1258
- return common.createItemWithData(createSolutionItemBase, {}, authentication, deployedFolderId);
1269
+ return common__namespace.createItemWithData(createSolutionItemBase, {}, authentication, deployedFolderId);
1259
1270
  })
1260
1271
  .then(createSolutionResponse => {
1261
1272
  deployedSolutionId = createSolutionResponse.id;
@@ -1264,7 +1275,7 @@
1264
1275
  id: deployedSolutionId,
1265
1276
  authentication
1266
1277
  };
1267
- return portal.protectItem(protectOptions);
1278
+ return portal__namespace.protectItem(protectOptions);
1268
1279
  })
1269
1280
  .then(() => {
1270
1281
  // TODO: Attach the whole solution model so we can
@@ -1279,7 +1290,7 @@
1279
1290
  .then((clonedSolutionsResponse) => {
1280
1291
  solutionTemplateData.templates = solutionTemplateData.templates.map((itemTemplate) => {
1281
1292
  // Update ids present in template dictionary
1282
- itemTemplate.itemId = common.getProp(templateDictionary, `${itemTemplate.itemId}.itemId`);
1293
+ itemTemplate.itemId = common__namespace.getProp(templateDictionary, `${itemTemplate.itemId}.itemId`);
1283
1294
  // Update the dependencies hash to point to the new item ids
1284
1295
  itemTemplate.dependencies = itemTemplate.dependencies.map((id) => hubCommon.getWithDefault(templateDictionary, `${id}.itemId`, id));
1285
1296
  return itemTemplate;
@@ -1301,17 +1312,34 @@
1301
1312
  solutionTemplateData.templates = _updateGroupReferences(solutionTemplateData.templates, templateDictionary);
1302
1313
  // Update solution items data using template dictionary, and then update the
1303
1314
  // itemId & dependencies in each item template
1304
- solutionTemplateBase.data = common.replaceInTemplate(solutionTemplateData, templateDictionary);
1315
+ solutionTemplateBase.data = common__namespace.replaceInTemplate(solutionTemplateData, templateDictionary);
1305
1316
  // Write any user defined params to the solution
1306
1317
  /* istanbul ignore else */
1307
1318
  if (templateDictionary.params) {
1308
1319
  solutionTemplateBase.data.params = templateDictionary.params;
1309
1320
  }
1310
- return common.updateItem(solutionTemplateBase, authentication, deployedFolderId);
1321
+ return common__namespace.updateItem(solutionTemplateBase, authentication, deployedFolderId);
1311
1322
  })
1312
1323
  .then(() => resolve(solutionTemplateBase.id), reject);
1313
1324
  });
1314
1325
  }
1326
+ /**
1327
+ * Add source-id to items/groups typeKeywords
1328
+ *
1329
+ * @param template the array of solution data templates
1330
+ * @internal
1331
+ */
1332
+ function _addSourceId(templates) {
1333
+ return templates.map((template) => {
1334
+ /* istanbul ignore else */
1335
+ if (template.item) {
1336
+ const typeKeywords = template.item.typeKeywords || [];
1337
+ typeKeywords.push("source-" + template.itemId);
1338
+ template.item.typeKeywords = typeKeywords;
1339
+ }
1340
+ return template;
1341
+ });
1342
+ }
1315
1343
  /**
1316
1344
  * Update the deployOptions with the group properties
1317
1345
  *
@@ -1334,7 +1362,7 @@
1334
1362
  });
1335
1363
  if (!deployOptions.thumbnailurl && solutionTemplateBase.thumbnail) {
1336
1364
  // Get the full path to the thumbnail
1337
- deployOptions.thumbnailurl = common.generateSourceThumbnailUrl(authentication.portal, solutionTemplateBase.id, solutionTemplateBase.thumbnail);
1365
+ deployOptions.thumbnailurl = common__namespace.generateSourceThumbnailUrl(authentication.portal, solutionTemplateBase.id, solutionTemplateBase.thumbnail);
1338
1366
  delete solutionTemplateBase.thumbnail;
1339
1367
  }
1340
1368
  return deployOptions;
@@ -1360,10 +1388,10 @@
1360
1388
  });
1361
1389
  }
1362
1390
  function _updateProp(template, path, lookup, templateDictionary) {
1363
- const wkid = common.getProp(template, path);
1391
+ const wkid = common__namespace.getProp(template, path);
1364
1392
  /* istanbul ignore else */
1365
1393
  if (wkid && typeof wkid === "string" && wkid.indexOf(lookup) > -1) {
1366
- common.setProp(template, path, common.replaceInTemplate(wkid, templateDictionary));
1394
+ common__namespace.setProp(template, path, common__namespace.replaceInTemplate(wkid, templateDictionary));
1367
1395
  }
1368
1396
  return template;
1369
1397
  }
@@ -1382,9 +1410,9 @@
1382
1410
  // As of Spring 2020, only HTTPS (see
1383
1411
  // https://www.esri.com/arcgis-blog/products/product/administration/2019-arcgis-transport-security-improvements/)
1384
1412
  const scheme = "https"; // portalResponse.allSSL ? "https" : "http";
1385
- const urlKey = common.getProp(portalResponse, "urlKey");
1386
- const customBaseUrl = common.getProp(portalResponse, "customBaseUrl");
1387
- const enterpriseBaseUrl = common.getProp(portalResponse, "portalHostname");
1413
+ const urlKey = common__namespace.getProp(portalResponse, "urlKey");
1414
+ const customBaseUrl = common__namespace.getProp(portalResponse, "customBaseUrl");
1415
+ const enterpriseBaseUrl = common__namespace.getProp(portalResponse, "portalHostname");
1388
1416
  return urlKey && customBaseUrl
1389
1417
  ? `${scheme}://${urlKey}.${customBaseUrl}`
1390
1418
  : enterpriseBaseUrl
@@ -1411,7 +1439,7 @@
1411
1439
  function _purgeTemplateProperties(itemTemplate) {
1412
1440
  const retainProps = ["itemId", "type", "dependencies", "groups"];
1413
1441
  const deleteProps = Object.keys(itemTemplate).filter(k => retainProps.indexOf(k) < 0);
1414
- common.deleteProps(itemTemplate, deleteProps);
1442
+ common__namespace.deleteProps(itemTemplate, deleteProps);
1415
1443
  return itemTemplate;
1416
1444
  }
1417
1445
 
@@ -1441,11 +1469,11 @@
1441
1469
  if (typeof idOrObject === "string") {
1442
1470
  // get the item + data
1443
1471
  return Promise.all([
1444
- common.getItemBase(idOrObject, authentication),
1445
- common.getItemDataAsJson(idOrObject, authentication)
1472
+ common__namespace.getItemBase(idOrObject, authentication),
1473
+ common__namespace.getItemDataAsJson(idOrObject, authentication)
1446
1474
  ]).then(([item, data]) => {
1447
1475
  // format into a model and migrate the schema
1448
- return common.migrateSchema({
1476
+ return common__namespace.migrateSchema({
1449
1477
  item,
1450
1478
  data
1451
1479
  });
@@ -1455,10 +1483,10 @@
1455
1483
  // check if it is a "Model"
1456
1484
  if (_isModel(idOrObject)) {
1457
1485
  // run migrations
1458
- return common.migrateSchema(idOrObject);
1486
+ return common__namespace.migrateSchema(idOrObject);
1459
1487
  }
1460
1488
  else {
1461
- return Promise.reject(common.fail(`getSolutionTemplateItem must be passed an item id or a model object`));
1489
+ return Promise.reject(common__namespace.fail(`getSolutionTemplateItem must be passed an item id or a model object`));
1462
1490
  }
1463
1491
  }
1464
1492
  }
@@ -1478,7 +1506,7 @@
1478
1506
  deployOptions.tags = deployOptions.tags ?? item.tags;
1479
1507
  // add the thumbnail url
1480
1508
  deployOptions.thumbnailurl = item.thumbnail
1481
- ? common.getItemThumbnailUrl(item.id, item.thumbnail, false, authentication)
1509
+ ? common__namespace.getItemThumbnailUrl(item.id, item.thumbnail, false, authentication)
1482
1510
  : null;
1483
1511
  return deployOptions;
1484
1512
  }
@@ -1558,7 +1586,7 @@
1558
1586
  function deploySolution(maybeModel, authentication, options) {
1559
1587
  // if we are not passed the maybeModel, reject
1560
1588
  if (!maybeModel) {
1561
- return Promise.reject(common.fail("The Solution Template id is missing"));
1589
+ return Promise.reject(common__namespace.fail("The Solution Template id is missing"));
1562
1590
  }
1563
1591
  let deployOptions = options || {};
1564
1592
  /* istanbul ignore else */
@@ -1573,7 +1601,7 @@
1573
1601
  return getSolutionTemplateItem(maybeModel, storageAuthentication)
1574
1602
  .then(model => {
1575
1603
  if (!isSolutionTemplateItem(model.item)) {
1576
- return Promise.reject(common.fail(`${model.item.id} is not a Solution Template`));
1604
+ return Promise.reject(common__namespace.fail(`${model.item.id} is not a Solution Template`));
1577
1605
  }
1578
1606
  else {
1579
1607
  // fetch the metadata if the model's id is a GUID and pass the item & data forward
@@ -1587,8 +1615,8 @@
1587
1615
  // extract responses
1588
1616
  const [itemBase, itemData] = responses;
1589
1617
  // sanitize all the things
1590
- const sanitizer = new common.Sanitizer();
1591
- const item = common.sanitizeJSONAndReportChanges(itemBase, sanitizer);
1618
+ const sanitizer = new common__namespace.Sanitizer();
1619
+ const item = common__namespace.sanitizeJSONAndReportChanges(itemBase, sanitizer);
1592
1620
  // TODO: we should delegate data sanization to the type-specific modules
1593
1621
  const data = itemData;
1594
1622
  // get the item id before it is deleted
@@ -1596,7 +1624,7 @@
1596
1624
  // apply item props to deployOptions
1597
1625
  deployOptions = updateDeployOptions(deployOptions, item, storageAuthentication);
1598
1626
  // Clone before mutating? This was messing me up in some testing...
1599
- common.deleteItemProps(item);
1627
+ common__namespace.deleteItemProps(item);
1600
1628
  return deploySolutionFromTemplate(itemId, item, data, authentication, deployOptions);
1601
1629
  })
1602
1630
  .then(createdSolutionId => {
@@ -1618,7 +1646,7 @@
1618
1646
  });
1619
1647
  }
1620
1648
 
1621
- exports.UNSUPPORTED = UNSUPPORTED;
1649
+ exports.UNSUPPORTED = UNSUPPORTED$1;
1622
1650
  exports._createItemFromTemplateWhenReady = _createItemFromTemplateWhenReady;
1623
1651
  exports._estimateDeploymentCost = _estimateDeploymentCost;
1624
1652
  exports._evaluateSharedViewSources = _evaluateSharedViewSources;
@@ -1647,5 +1675,5 @@
1647
1675
 
1648
1676
  Object.defineProperty(exports, '__esModule', { value: true });
1649
1677
 
1650
- })));
1678
+ }));
1651
1679
  //# sourceMappingURL=deployer.umd.js.map