@esri/solution-deployer 5.2.1 → 5.2.3

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.
Files changed (43) hide show
  1. package/README.md +4 -7
  2. package/dist/esm/deploySolutionItems.d.ts +0 -9
  3. package/dist/esm/deploySolutionItems.js +11 -76
  4. package/dist/esm/deploySolutionItems.js.map +1 -1
  5. package/dist/esm/index.d.ts +1 -1
  6. package/dist/esm/index.js +1 -1
  7. package/dist/esm/index.js.map +1 -1
  8. package/dist/esm/module-map.js +3 -2
  9. package/dist/esm/module-map.js.map +1 -1
  10. package/package.json +14 -14
  11. package/dist/cjs/deploySolutionFromTemplate.d.ts +0 -48
  12. package/dist/cjs/deploySolutionFromTemplate.js +0 -332
  13. package/dist/cjs/deploySolutionFromTemplate.js.map +0 -1
  14. package/dist/cjs/deploySolutionItems.d.ts +0 -233
  15. package/dist/cjs/deploySolutionItems.js +0 -948
  16. package/dist/cjs/deploySolutionItems.js.map +0 -1
  17. package/dist/cjs/deployer.d.ts +0 -34
  18. package/dist/cjs/deployer.js +0 -102
  19. package/dist/cjs/deployer.js.map +0 -1
  20. package/dist/cjs/deployerUtils.d.ts +0 -47
  21. package/dist/cjs/deployerUtils.js +0 -124
  22. package/dist/cjs/deployerUtils.js.map +0 -1
  23. package/dist/cjs/helpers/post-process.d.ts +0 -29
  24. package/dist/cjs/helpers/post-process.js +0 -62
  25. package/dist/cjs/helpers/post-process.js.map +0 -1
  26. package/dist/cjs/helpers/share-templates-to-groups.d.ts +0 -24
  27. package/dist/cjs/helpers/share-templates-to-groups.js +0 -65
  28. package/dist/cjs/helpers/share-templates-to-groups.js.map +0 -1
  29. package/dist/cjs/helpers/sortTemplates.d.ts +0 -23
  30. package/dist/cjs/helpers/sortTemplates.js +0 -15
  31. package/dist/cjs/helpers/sortTemplates.js.map +0 -1
  32. package/dist/cjs/helpers/zip-utils.d.ts +0 -44
  33. package/dist/cjs/helpers/zip-utils.js +0 -60
  34. package/dist/cjs/helpers/zip-utils.js.map +0 -1
  35. package/dist/cjs/index.d.ts +0 -24
  36. package/dist/cjs/index.js +0 -28
  37. package/dist/cjs/index.js.map +0 -1
  38. package/dist/cjs/module-map.d.ts +0 -23
  39. package/dist/cjs/module-map.js +0 -232
  40. package/dist/cjs/module-map.js.map +0 -1
  41. package/dist/esm/helpers/zip-utils.d.ts +0 -44
  42. package/dist/esm/helpers/zip-utils.js +0 -54
  43. package/dist/esm/helpers/zip-utils.js.map +0 -1
@@ -1,332 +0,0 @@
1
- "use strict";
2
- /** @license
3
- * Copyright 2018 Esri
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports._getNewItemId = exports._purgeTemplateProperties = exports._updateGroupReferences = exports._getPortalBaseUrl = exports._checkedReplaceAll = exports._updateProp = exports._replaceParamVariables = exports._applySourceToDeployOptions = exports._addSourceId = exports.deploySolutionFromTemplate = void 0;
19
- const tslib_1 = require("tslib");
20
- const common = tslib_1.__importStar(require("@esri/solution-common"));
21
- const deployItems = tslib_1.__importStar(require("./deploySolutionItems"));
22
- const hub_common_1 = require("@esri/hub-common");
23
- const portal = tslib_1.__importStar(require("@esri/arcgis-rest-portal"));
24
- const post_process_1 = require("./helpers/post-process");
25
- const sortTemplates_1 = require("./helpers/sortTemplates");
26
- const solution_common_1 = require("@esri/solution-common");
27
- // NOTE: Moved to separate file to allow stubbing in main deploySolution tests
28
- function deploySolutionFromTemplate(templateSolutionId, solutionTemplateBase, solutionTemplateData, authentication, options) {
29
- options.storageVersion = common.extractSolutionVersion(solutionTemplateData);
30
- return new Promise((resolve, reject) => {
31
- // It is possible to provide a separate authentication for the source
32
- const storageAuthentication = options.storageAuthentication
33
- ? options.storageAuthentication
34
- : authentication;
35
- // Replacement dictionary and high-level deployment ids for cleanup
36
- // TODO: Extract all templateDictionary prep into a separate function
37
- const templateDictionary = options.templateDictionary ?? {};
38
- let deployedFolderId;
39
- let deployedSolutionId;
40
- _applySourceToDeployOptions(options, solutionTemplateBase, templateDictionary, authentication);
41
- if (options.additionalTypeKeywords) {
42
- solutionTemplateBase.typeKeywords = [].concat(solutionTemplateBase.typeKeywords, options.additionalTypeKeywords);
43
- }
44
- // Get the thumbnail file
45
- let thumbFilename = "thumbnail";
46
- let thumbDef = Promise.resolve(null);
47
- if (!options.thumbnail && options.thumbnailurl) {
48
- // Figure out the thumbnail's filename
49
- thumbFilename =
50
- common.getFilenameFromUrl(options.thumbnailurl) || thumbFilename;
51
- const thumbnailurl = common.appendQueryParam(options.thumbnailurl, "w=400");
52
- delete options.thumbnailurl;
53
- // Fetch the thumbnail
54
- thumbDef = common.getBlobAsFile(thumbnailurl, thumbFilename, storageAuthentication, [400]);
55
- }
56
- _replaceParamVariables(solutionTemplateData, templateDictionary);
57
- // Get information about deployment environment
58
- Promise.all([
59
- common.getPortal("", authentication),
60
- common.getUser(authentication),
61
- common.getFoldersAndGroups(authentication),
62
- thumbDef
63
- ])
64
- .then(responses => {
65
- const [portalResponse, userResponse, foldersAndGroupsResponse, thumbnailFile] = responses;
66
- if (!options.thumbnail && thumbnailFile) {
67
- options.thumbnail = thumbnailFile;
68
- }
69
- // update template items with source-itemId type keyword
70
- solutionTemplateData.templates = _addSourceId(solutionTemplateData.templates);
71
- templateDictionary.isPortal = portalResponse.isPortal;
72
- templateDictionary.organization = Object.assign(templateDictionary.organization || {}, portalResponse);
73
- // TODO: Add more computed properties here
74
- // portal: portalResponse
75
- // orgextent as bbox for assignment onto items
76
- // more info in #266 https://github.com/Esri/solution.js/issues/266
77
- templateDictionary.portalBaseUrl = _getPortalBaseUrl(portalResponse, authentication);
78
- templateDictionary.user = userResponse;
79
- templateDictionary.user.folders = foldersAndGroupsResponse.folders;
80
- templateDictionary.user.groups = foldersAndGroupsResponse.groups.filter((group) => group.owner === templateDictionary.user.username);
81
- // if we have tracking views and the user is not admin or the org doesn't support tracking an error is thrown
82
- common.setLocationTrackingEnabled(portalResponse, userResponse, templateDictionary, solutionTemplateData.templates);
83
- const trackingOwnerPromise = common.getTackingServiceOwner(templateDictionary, authentication);
84
- // Create a folder to hold the deployed solution. We use the solution name, appending a sequential
85
- // suffix if the folder exists, e.g.,
86
- // * Manage Right of Way Activities
87
- // * Manage Right of Way Activities 1
88
- // * Manage Right of Way Activities 2
89
- const folderPromise = common.createUniqueFolder(solutionTemplateBase.title, templateDictionary, authentication);
90
- // Apply the portal extents to the solution
91
- const portalExtent = portalResponse.defaultExtent;
92
- const extentsPromise = common.convertExtentWithFallback(portalExtent, undefined, { wkid: 4326 }, portalResponse.helperServices.geometry.url, authentication);
93
- // Await completion of async actions: folder creation & extents conversion
94
- return Promise.all([folderPromise, extentsPromise, trackingOwnerPromise]);
95
- })
96
- .then(responses => {
97
- const [folderResponse, wgs84Extent, trackingOwnerResponse] = responses;
98
- deployedFolderId = folderResponse.folder.id;
99
- templateDictionary.folderId = deployedFolderId;
100
- templateDictionary.solutionItemExtent =
101
- wgs84Extent.xmin +
102
- "," +
103
- wgs84Extent.ymin +
104
- "," +
105
- wgs84Extent.xmax +
106
- "," +
107
- wgs84Extent.ymax;
108
- // Hub Solutions depend on organization defaultExtentBBox as a nested array not a string
109
- templateDictionary.organization.defaultExtentBBox = [
110
- [wgs84Extent.xmin, wgs84Extent.ymin],
111
- [wgs84Extent.xmax, wgs84Extent.ymax]
112
- ];
113
- // update templateDictionary to indicate if the user owns the tracking service
114
- // this will affect how we handle group sharing
115
- /* istanbul ignore else */
116
- if (templateDictionary.locationTrackingEnabled) {
117
- (0, solution_common_1.setCreateProp)(templateDictionary, "locationTracking.userIsOwner", trackingOwnerResponse);
118
- }
119
- // Create a deployed Solution item
120
- const createSolutionItemBase = {
121
- ...common.sanitizeJSON(solutionTemplateBase),
122
- type: "Solution",
123
- typeKeywords: ["Solution"]
124
- };
125
- if (options.additionalTypeKeywords) {
126
- createSolutionItemBase.typeKeywords = ["Solution"].concat(options.additionalTypeKeywords);
127
- }
128
- // Create deployed solution item
129
- createSolutionItemBase.thumbnail = options.thumbnail;
130
- return common.createItemWithData(createSolutionItemBase, {}, authentication, deployedFolderId);
131
- })
132
- .then(createSolutionResponse => {
133
- deployedSolutionId = createSolutionResponse.id;
134
- // Protect the solution item
135
- const protectOptions = {
136
- id: deployedSolutionId,
137
- authentication
138
- };
139
- return portal.protectItem(protectOptions);
140
- })
141
- .then(() => {
142
- // TODO: Attach the whole solution model so we can
143
- // have stuff like `{{solution.item.title}}
144
- templateDictionary.solutionItemId = deployedSolutionId;
145
- solutionTemplateBase.id = deployedSolutionId;
146
- solutionTemplateBase.tryitUrl = _checkedReplaceAll(solutionTemplateBase.tryitUrl, templateSolutionId, deployedSolutionId);
147
- solutionTemplateBase.url = _checkedReplaceAll(solutionTemplateBase.url, templateSolutionId, deployedSolutionId);
148
- // Handle the contained item templates
149
- return deployItems.deploySolutionItems(storageAuthentication.portal, templateSolutionId, solutionTemplateData.templates, storageAuthentication, templateDictionary, deployedSolutionId, authentication, options);
150
- })
151
- .then((clonedSolutionsResponse) => {
152
- solutionTemplateData.templates = solutionTemplateData.templates.map((itemTemplate) => {
153
- // Update ids present in template dictionary
154
- itemTemplate.itemId = common.getProp(templateDictionary, `${itemTemplate.itemId}.itemId`);
155
- // Update the dependencies hash to point to the new item ids
156
- itemTemplate.dependencies = itemTemplate.dependencies.map((id) => (0, hub_common_1.getWithDefault)(templateDictionary, `${id}.itemId`, id));
157
- return itemTemplate;
158
- });
159
- // Sort the templates into build order, which is provided by clonedSolutionsResponse
160
- (0, sortTemplates_1.sortTemplates)(solutionTemplateData.templates, clonedSolutionsResponse.map(response => response.id));
161
- // Wrap up with post-processing, in which we deal with groups and cycle remnants
162
- return (0, post_process_1.postProcess)(deployedSolutionId, solutionTemplateData.templates, clonedSolutionsResponse, authentication, templateDictionary);
163
- })
164
- .then(() => {
165
- // Update solution item using internal representation & and the updated data JSON
166
- solutionTemplateBase.typeKeywords = [].concat(solutionTemplateBase.typeKeywords, ["Deployed"]);
167
- const iTemplateKeyword = solutionTemplateBase.typeKeywords.indexOf("Template");
168
- /* istanbul ignore else */
169
- if (iTemplateKeyword >= 0) {
170
- solutionTemplateBase.typeKeywords.splice(iTemplateKeyword, 1);
171
- }
172
- solutionTemplateData.templates = solutionTemplateData.templates.map((itemTemplate) => _purgeTemplateProperties(itemTemplate));
173
- solutionTemplateData.templates = _updateGroupReferences(solutionTemplateData.templates, templateDictionary);
174
- // Update solution items data using template dictionary, and then update the
175
- // itemId & dependencies in each item template
176
- solutionTemplateBase.data = common.replaceInTemplate(solutionTemplateData, templateDictionary);
177
- // Write any user defined params to the solution
178
- /* istanbul ignore else */
179
- if (templateDictionary.params) {
180
- solutionTemplateBase.data.params = templateDictionary.params;
181
- }
182
- return common.updateItem(solutionTemplateBase, authentication, deployedFolderId);
183
- })
184
- .then(() => resolve(solutionTemplateBase.id), reject);
185
- });
186
- }
187
- exports.deploySolutionFromTemplate = deploySolutionFromTemplate;
188
- /**
189
- * Add source-id to items/groups typeKeywords
190
- *
191
- * @param template the array of solution data templates
192
- * @private
193
- */
194
- function _addSourceId(templates) {
195
- return templates.map((template) => {
196
- /* istanbul ignore else */
197
- if (template.item) {
198
- const typeKeywords = template.item.typeKeywords || [];
199
- typeKeywords.push("source-" + template.itemId);
200
- template.item.typeKeywords = typeKeywords;
201
- }
202
- return template;
203
- });
204
- }
205
- exports._addSourceId = _addSourceId;
206
- /**
207
- * Update the deployOptions with the group properties
208
- *
209
- * @param deployOptions
210
- * @param sourceInfo
211
- * @param authentication
212
- * @param isGroup Boolean to indicate if the files are associated with a group or item
213
- * @private
214
- */
215
- function _applySourceToDeployOptions(deployOptions, solutionTemplateBase, templateDictionary, authentication) {
216
- // Deploy a solution from the template's contents,
217
- // using the template's information as defaults for the deployed solution item
218
- ["title", "snippet", "description", "tags"].forEach(prop => {
219
- deployOptions[prop] = deployOptions[prop] ?? solutionTemplateBase[prop];
220
- if (deployOptions[prop]) {
221
- solutionTemplateBase[prop] = deployOptions[prop];
222
- // carry these options forward on the templateDict
223
- templateDictionary[prop] = deployOptions[prop];
224
- }
225
- });
226
- if (!deployOptions.thumbnailurl && solutionTemplateBase.thumbnail) {
227
- // Get the full path to the thumbnail
228
- deployOptions.thumbnailurl = common.generateSourceThumbnailUrl(authentication.portal, solutionTemplateBase.id, solutionTemplateBase.thumbnail);
229
- delete solutionTemplateBase.thumbnail;
230
- }
231
- return deployOptions;
232
- }
233
- exports._applySourceToDeployOptions = _applySourceToDeployOptions;
234
- //TODO: function doc
235
- function _replaceParamVariables(solutionTemplateData, templateDictionary) {
236
- // a custom params object can be passed in with the options to deploy a solution
237
- // in most cases we can defer to the item type handlers to use these values
238
- // for variable replacement
239
- // for spatial reference specifically we need to replace up front so the default extent
240
- // logic can execute as expected
241
- solutionTemplateData.templates = solutionTemplateData.templates.map((template) => {
242
- // can't do this as it causes other values that don't exist in the dict yet to revert to defaults they may have defined
243
- // return common.replaceInTemplate(template, templateDictionary);
244
- /* istanbul ignore else */
245
- if (template.type === "Feature Service") {
246
- const paramsLookup = "params.";
247
- const wkidItemPath = "item.spatialReference.wkid";
248
- template = _updateProp(template, wkidItemPath, paramsLookup, templateDictionary);
249
- const wkidServicePath = "properties.service.spatialReference.wkid";
250
- template = _updateProp(template, wkidServicePath, paramsLookup, templateDictionary);
251
- }
252
- return template;
253
- });
254
- }
255
- exports._replaceParamVariables = _replaceParamVariables;
256
- //TODO: function doc
257
- function _updateProp(template, path, lookup, templateDictionary) {
258
- const wkid = common.getProp(template, path);
259
- /* istanbul ignore else */
260
- if (wkid && typeof wkid === "string" && wkid.indexOf(lookup) > -1) {
261
- common.setProp(template, path, common.replaceInTemplate(wkid, templateDictionary));
262
- }
263
- return template;
264
- }
265
- exports._updateProp = _updateProp;
266
- //TODO: function doc
267
- function _checkedReplaceAll(template, oldValue, newValue) {
268
- let newTemplate;
269
- if (template && template.indexOf(oldValue) > -1) {
270
- const re = new RegExp(oldValue, "g");
271
- newTemplate = template.replace(re, newValue);
272
- }
273
- else {
274
- newTemplate = template;
275
- }
276
- return newTemplate;
277
- }
278
- exports._checkedReplaceAll = _checkedReplaceAll;
279
- //TODO: function doc
280
- function _getPortalBaseUrl(portalResponse, authentication) {
281
- // As of Spring 2020, only HTTPS (see
282
- // https://www.esri.com/arcgis-blog/products/product/administration/2019-arcgis-transport-security-improvements/)
283
- const scheme = "https"; // portalResponse.allSSL ? "https" : "http";
284
- const urlKey = common.getProp(portalResponse, "urlKey");
285
- const customBaseUrl = common.getProp(portalResponse, "customBaseUrl");
286
- const enterpriseBaseUrl = common.getProp(portalResponse, "portalHostname");
287
- return urlKey && customBaseUrl
288
- ? `${scheme}://${urlKey}.${customBaseUrl}`
289
- : enterpriseBaseUrl
290
- ? `${scheme}://${enterpriseBaseUrl}`
291
- : authentication.portal.replace("/sharing/rest", "");
292
- }
293
- exports._getPortalBaseUrl = _getPortalBaseUrl;
294
- //TODO: function doc
295
- function _updateGroupReferences(itemTemplates, templateDictionary) {
296
- const groupIds = itemTemplates.reduce((result, t) => {
297
- if (t.type === "Group") {
298
- result.push(t.itemId);
299
- }
300
- return result;
301
- }, []);
302
- Object.keys(templateDictionary).forEach(k => {
303
- const newId = templateDictionary[k].itemId;
304
- if (groupIds.indexOf(newId) > -1) {
305
- itemTemplates.forEach(t => {
306
- t.groups = t.groups.map((id) => (id === k ? newId : id));
307
- });
308
- }
309
- });
310
- return itemTemplates;
311
- }
312
- exports._updateGroupReferences = _updateGroupReferences;
313
- //TODO: function doc
314
- function _purgeTemplateProperties(itemTemplate) {
315
- const retainProps = ["itemId", "type", "dependencies", "groups"];
316
- const deleteProps = Object.keys(itemTemplate).filter(k => retainProps.indexOf(k) < 0);
317
- common.deleteProps(itemTemplate, deleteProps);
318
- return itemTemplate;
319
- }
320
- exports._purgeTemplateProperties = _purgeTemplateProperties;
321
- /**
322
- * Returns a match of a supplied id with the suffix ".itemId" in the template dictionary.
323
- *
324
- * @param id Id to look for
325
- * @param templateDictionary Hash mapping property names to replacement values
326
- * @returns Match in template dictionary or original id
327
- */
328
- function _getNewItemId(id, templateDictionary) {
329
- return common.getProp(templateDictionary, id + ".itemId") ?? id;
330
- }
331
- exports._getNewItemId = _getNewItemId;
332
- //# sourceMappingURL=deploySolutionFromTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploySolutionFromTemplate.js","sourceRoot":"","sources":["../../src/deploySolutionFromTemplate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,sEAAgD;AAChD,2EAAqD;AACrD,iDAAkD;AAClD,yEAAmD;AACnD,yDAAqD;AACrD,2DAAwD;AACxD,2DAAsD;AAEtD,8EAA8E;AAE9E,SAAgB,0BAA0B,CACxC,kBAA0B,EAC1B,oBAAyB,EACzB,oBAAyB,EACzB,cAAkC,EAClC,OAAsC;IAEtC,OAAO,CAAC,cAAc,GAAG,MAAM,CAAC,sBAAsB,CAAC,oBAAoB,CAAC,CAAC;IAE7E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,qEAAqE;QACrE,MAAM,qBAAqB,GAAuB,OAAO,CAAC,qBAAqB;YAC7E,CAAC,CAAC,OAAO,CAAC,qBAAqB;YAC/B,CAAC,CAAC,cAAc,CAAC;QAEnB,mEAAmE;QAEnE,qEAAqE;QACrE,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC;QAC5D,IAAI,gBAAwB,CAAC;QAC7B,IAAI,kBAA0B,CAAC;QAE/B,2BAA2B,CACzB,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,cAA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ACJ;IACH,CAAC,CAAC,CAAC;IACH,OAAO,aAAa,CAAC;AACvB,CAAC;AAvBD,wDAuBC;AAED,oBAAoB;AACpB,SAAgB,wBAAwB,CAAC,YAAiB;IACxD,MAAM,WAAW,GAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;IAC3E,MAAM,WAAW,GAAa,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAC5D,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAChC,CAAC;IACF,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC9C,OAAO,YAAY,CAAC;AACtB,CAAC;AAPD,4DAOC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,EAAU,EAAE,kBAAuB;IAC/D,OAAO,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;AAClE,CAAC;AAFD,sCAEC"}
@@ -1,233 +0,0 @@
1
- /** @license
2
- * Copyright 2018 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * Manages deployment of items via the REST API.
18
- *
19
- * @module deployItems
20
- */
21
- import * as common from "@esri/solution-common";
22
- import JSZip from "jszip";
23
- /**
24
- * Deploys a set of items defined by templates.
25
- *
26
- * @param portalSharingUrl Server/sharing
27
- * @param storageItemId Id of storage item
28
- * @param templates A collection of AGO item templates
29
- * @param storageAuthentication Credentials for the organization with the source items
30
- * @param templateDictionary Hash of facts: org URL, adlib replacements
31
- * @param deployedSolutionId Id of deployed Solution item
32
- * @param destinationAuthentication Credentials for the destination organization
33
- * @param options Options to tune deployment
34
- * @returns A promise that will resolve with the list of information about the created items
35
- */
36
- export declare function deploySolutionItems(portalSharingUrl: string, storageItemId: string, templates: common.IItemTemplate[], storageAuthentication: common.UserSession, templateDictionary: any, deployedSolutionId: string, destinationAuthentication: common.UserSession, options: common.IDeploySolutionOptions): Promise<common.ICreateItemFromTemplateResponse[]>;
37
- /**
38
- * For each item to be patched, convert it to its cloned id and mark the item as needing post processing.
39
- *
40
- * @param itemsToBePatched List of items that need to have their dependencies patched
41
- * @param templateDictionary Hash of facts: org URL, adlib replacements
42
- * @param templates A collection of AGO item templates
43
- * @private
44
- */
45
- export declare function _flagPatchItemsForPostProcessing(itemsToBePatched: common.IKeyedListsOfStrings, templateDictionary: any, templates: common.ICreateItemFromTemplateResponse[]): void;
46
- /**
47
- * Portal does not allow views of a single source to be created at the same time.
48
- *
49
- * Update view templates with an array of other view template ids that it should wait on.
50
- *
51
- * @param templates a collection of AGO item templates
52
- *
53
- * @returns An updated array of item templates
54
- * @private
55
- */
56
- export declare function _evaluateSharedViewSources(templates: common.IItemTemplate[]): common.IItemTemplate[];
57
- /**
58
- * Add a syncViews array to each template that will hold all other view ids that
59
- * have the same FS dependency.
60
- * These arrays will be processed later to only contain ids that each view will need to wait on.
61
- *
62
- * @param templates a collection of AGO item templates
63
- * @param views an array of view template details
64
- *
65
- * @returns An updated array of item templates
66
- * @private
67
- */
68
- export declare function _updateViewTemplates(templates: common.IItemTemplate[], views: any[]): common.IItemTemplate[];
69
- /**
70
- * Get all view templates from the source templates collection
71
- *
72
- * @param views A collection of view ID and dependencies
73
- *
74
- * @returns an array of objects with the source FS id as the key and a list of views that are
75
- * dependant upon it
76
- *
77
- * @private
78
- */
79
- export declare function _getViewHash(views: any[]): any;
80
- /**
81
- * Get all view templates from the source templates collection
82
- *
83
- * @param templates A collection of AGO item templates
84
- *
85
- * @returns an array with the view id and its dependencies
86
- *
87
- * @private
88
- */
89
- export declare function _getViews(templates: common.IItemTemplate[]): any[];
90
- /**
91
- * Search for existing items and update the templateDictionary with key details
92
- *
93
- * @param templates A collection of AGO item templates
94
- * @param reuseItems Option to search for existing items
95
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
96
- * @param authentication Credentials for the requests
97
- *
98
- * @returns A Promise that will resolve once existing items have been evaluated
99
- *
100
- * @private
101
- */
102
- export declare function _reuseDeployedItems(templates: common.IItemTemplate[], reuseItems: boolean, templateDictionary: any, authentication: common.UserSession): Promise<any>;
103
- /**
104
- * Search for existing items and update the templateDictionary with key details
105
- *
106
- * Subtle difference between _reuseDeployedItems and _useExistingItems
107
- * _reuseDeployedItems: will search all existing items based on specific type keywords
108
- * that would have been added by a previous deployment
109
- * _useExistingItems: will search for an existing item that the user provided
110
- * the item id for while configuring in the deployment app.
111
- * This type of item would not necessarily have been laid down by a previous deployment and
112
- * can thus not expect that it will have the type keywords
113
- *
114
- * @param templates A collection of AGO item templates
115
- * @param useExisting Option to search for existing items
116
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
117
- * @param authentication Credentials for the requests
118
- *
119
- * @returns A Promise that will resolve once existing items have been evaluated
120
- *
121
- * @private
122
- */
123
- export declare function _useExistingItems(templates: common.IItemTemplate[], useExisting: boolean, templateDictionary: any, authentication: common.UserSession): Promise<any>;
124
- /**
125
- * Verify if the existing item has the source-<itemId> typeKeyword and set it if not
126
- * This allows items that did not come from deployment to be found for reuse after they
127
- * have been used once via a custom itemId param
128
- *
129
- * @param itemDefs
130
- * @param sourceIdHash key value pairs..actual itemId is the key and the source itemId is the value
131
- * @param authentication credentials for the requests
132
- *
133
- * @returns a promise to indicate when the requests are complete
134
- * @private
135
- */
136
- export declare function _setTypekeywordForExisting(itemDefs: Array<Promise<any>>, sourceIdHash: any, authentication: common.UserSession): Promise<any>;
137
- /**
138
- * Update the templateDictionary with key details by item type
139
- *
140
- * @param templates A collection of AGO item templates
141
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
142
- *
143
- * @private
144
- */
145
- export declare function _updateTemplateDictionary(templates: common.IItemTemplate[], templateDictionary: any, authentication: common.UserSession): Promise<any>;
146
- /**
147
- * Add the fields from the source layer to the template dictionary for any required replacements
148
- *
149
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
150
- * @param itemId the id for the item
151
- * @param layerId the id for the layer
152
- * @param fields the fields to transfer
153
- *
154
- * @private
155
- */
156
- export declare function _setFields(templateDictionary: any, itemId: string, layerId: string, fields: any[]): void;
157
- /**
158
- * In some cases an item id search will return a stale item reference
159
- * it will subsequently fail when we try to fetch the underlying service.
160
- *
161
- * We need to remove the item info that has been added to the template dictionary
162
- * and treat the item as we do other items that don't already exist on deployment.
163
- *
164
- * @param result the service request result
165
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
166
- *
167
- * @private
168
- */
169
- export declare function _updateTemplateDictionaryForError(templateDictionary: any, itemId: string): any;
170
- /**
171
- * Optionally search by tags and then update the templateDictionary based on the search results
172
- *
173
- * @param existingItemsResponse response object from search by typeKeyword and type
174
- * @param existingItemIds list of the template ids we have queried
175
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
176
- * @param authentication Credentials for the request
177
- * @param addTagQuery Boolean to indicate if a search by tag should happen
178
- * @returns IFindExistingItemsResponse object with promise that will resolve with an array of results
179
- * and an array of item ids
180
- * @private
181
- */
182
- export declare function _handleExistingItems(existingItemsResponse: any[], existingItemInfos: common.IFindExistingItemInfos[], templateDictionary: any, authentication: common.UserSession, addTagQuery: boolean): common.IFindExistingItemsResponse;
183
- export declare function _updateTemplateDictionaryById(templateDictionary: any, sourceId: string, itemId: string, v: any): void;
184
- /**
185
- * Search items based on user query
186
- *
187
- * @param templates Templates to examine
188
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
189
- * @param authentication Credentials for the request
190
- * @returns IFindExistingItemsResponse object with promise that will resolve with an array of results
191
- * and an array of item ids
192
- * @private
193
- */
194
- export declare function _findExistingItemByKeyword(templates: common.IItemTemplate[], templateDictionary: any, authentication: common.UserSession): common.IFindExistingItemsResponse;
195
- /**
196
- * Search items based on user query
197
- *
198
- * @param query Query string to use
199
- * @param authentication Credentials for the request
200
- * @returns A promise that will resolve with an array of results
201
- * @private
202
- */
203
- export declare function _findExistingItem(query: string, authentication: common.UserSession): Promise<any>;
204
- /**
205
- * Creates an item from a template once the item's dependencies have been created.
206
- *
207
- * @param template Template of item to deploy
208
- * @param resourceFilePaths URL, folder, and filename for each item resource/metadata/thumbnail
209
- * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
210
- * @param userSession Options for the request
211
- * @param itemProgressCallback Function for reporting progress updates from type-specific template handlers
212
- * @returns A promise that will resolve with the id of the deployed item (which is simply returned if it's
213
- * already in the templates list
214
- * @private
215
- */
216
- export declare function _createItemFromTemplateWhenReady(template: common.IItemTemplate, resourceFilePaths: common.IDeployFileCopyPath[], storageAuthentication: common.UserSession, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
217
- /**
218
- * Templatize the contents of the form.json file in a zip file and then replace the templates.
219
- *
220
- * @param zip Zip file containing the form.json file; modified in place
221
- * @param templateDictionary Dictionary of replacement values
222
- * @returns Promise that resolves to webhooks in the form.info file
223
- */
224
- export declare function swizzleFormInfoContents(zip: JSZip, templateDictionary: any): Promise<any[]>;
225
- /**
226
- * Accumulates the estimated deployment cost of a set of templates.
227
- *
228
- * @param templates Templates to examine
229
- * @returns Sum of estimated deployment costs
230
- * @private
231
- */
232
- export declare function _estimateDeploymentCost(templates: common.IItemTemplate[]): number;
233
- export declare function _getGroupUpdates(template: common.IItemTemplate, authentication: common.UserSession, templateDictionary: any): Array<Promise<any>>;