@esri/solution-deployer 1.3.10 → 1.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/deploySolutionFromTemplate.d.ts +3 -3
- package/dist/esm/deploySolutionFromTemplate.js +9 -3
- package/dist/esm/deploySolutionFromTemplate.js.map +1 -1
- package/dist/esm/deploySolutionItems.d.ts +23 -21
- package/dist/esm/deploySolutionItems.js +25 -21
- package/dist/esm/deploySolutionItems.js.map +1 -1
- package/dist/esm/deployer.d.ts +1 -1
- package/dist/esm/deployer.js +1 -1
- package/dist/esm/deployerUtils.d.ts +1 -0
- package/dist/esm/deployerUtils.js +1 -0
- package/dist/esm/deployerUtils.js.map +1 -1
- package/dist/node/deploySolutionFromTemplate.d.ts +3 -3
- package/dist/node/deploySolutionFromTemplate.js +9 -3
- package/dist/node/deploySolutionFromTemplate.js.map +1 -1
- package/dist/node/deploySolutionItems.d.ts +23 -21
- package/dist/node/deploySolutionItems.js +25 -21
- package/dist/node/deploySolutionItems.js.map +1 -1
- package/dist/node/deployer.d.ts +1 -1
- package/dist/node/deployer.js +1 -1
- package/dist/node/deployerUtils.d.ts +1 -0
- package/dist/node/deployerUtils.js +1 -0
- package/dist/node/deployerUtils.js.map +1 -1
- package/dist/umd/deploySolutionFromTemplate.d.ts +3 -3
- package/dist/umd/deploySolutionItems.d.ts +23 -21
- package/dist/umd/deployer.d.ts +1 -1
- package/dist/umd/deployer.umd.js +37 -26
- package/dist/umd/deployer.umd.js.map +1 -1
- package/dist/umd/deployer.umd.min.js +2 -2
- package/dist/umd/deployer.umd.min.js.map +1 -1
- package/dist/umd/deployerUtils.d.ts +1 -0
- package/package.json +24 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployerUtils.js","sourceRoot":"","sources":["../../src/deployerUtils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,sEAAgD;AAEhD;;;;;;GAMG;AACH,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BAkBC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,IAAkB;IACvD,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC;IAC/B,iBAAiB;IACjB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;QAC5B,IACE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YAC7B,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EACxE;YACA,MAAM,GAAG,IAAI,CAAC;SACf;KACF;IACD,yDAAyD;IACzD,IAAI,IAAI,CAAC,IAAI,KAAK,yBAAyB,EAAE;QAC3C,IAAI,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAAE;YAC5C,MAAM,GAAG,IAAI,CAAC;SACf;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAnBD,wDAmBC"}
|
|
@@ -19,7 +19,7 @@ export declare function deploySolutionFromTemplate(templateSolutionId: string, s
|
|
|
19
19
|
* Add source-id to items/groups typeKeywords
|
|
20
20
|
*
|
|
21
21
|
* @param template the array of solution data templates
|
|
22
|
-
* @
|
|
22
|
+
* @private
|
|
23
23
|
*/
|
|
24
24
|
export declare function _addSourceId(templates: common.IItemTemplate[]): common.IItemTemplate[];
|
|
25
25
|
/**
|
|
@@ -29,7 +29,7 @@ export declare function _addSourceId(templates: common.IItemTemplate[]): common.
|
|
|
29
29
|
* @param sourceInfo
|
|
30
30
|
* @param authentication
|
|
31
31
|
* @param isGroup Boolean to indicate if the files are associated with a group or item
|
|
32
|
-
* @
|
|
32
|
+
* @private
|
|
33
33
|
*/
|
|
34
34
|
export declare function _applySourceToDeployOptions(deployOptions: common.IDeploySolutionOptions, solutionTemplateBase: any, templateDictionary: any, authentication: common.UserSession): common.IDeploySolutionOptions;
|
|
35
35
|
export declare function _replaceParamVariables(solutionTemplateData: any, templateDictionary: any): void;
|
|
@@ -43,6 +43,6 @@ export declare function _purgeTemplateProperties(itemTemplate: any): any;
|
|
|
43
43
|
*
|
|
44
44
|
* @param id Id to look for
|
|
45
45
|
* @param templateDictionary Hash mapping property names to replacement values
|
|
46
|
-
* @
|
|
46
|
+
* @returns Match in template dictionary or original id
|
|
47
47
|
*/
|
|
48
48
|
export declare function _getNewItemId(id: string, templateDictionary: any): string;
|
|
@@ -30,7 +30,7 @@ import * as common from "@esri/solution-common";
|
|
|
30
30
|
* @param deployedSolutionId Id of deployed Solution item
|
|
31
31
|
* @param destinationAuthentication Credentials for the destination organization
|
|
32
32
|
* @param options Options to tune deployment
|
|
33
|
-
* @
|
|
33
|
+
* @returns A promise that will resolve with the list of information about the created items
|
|
34
34
|
*/
|
|
35
35
|
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[]>;
|
|
36
36
|
/**
|
|
@@ -39,6 +39,7 @@ export declare function deploySolutionItems(portalSharingUrl: string, storageIte
|
|
|
39
39
|
* @param itemsToBePatched List of items that need to have their dependencies patched
|
|
40
40
|
* @param templateDictionary Hash of facts: org URL, adlib replacements
|
|
41
41
|
* @param templates A collection of AGO item templates
|
|
42
|
+
* @private
|
|
42
43
|
*/
|
|
43
44
|
export declare function _flagPatchItemsForPostProcessing(itemsToBePatched: common.IKeyedListsOfStrings, templateDictionary: any, templates: common.ICreateItemFromTemplateResponse[]): void;
|
|
44
45
|
/**
|
|
@@ -49,7 +50,7 @@ export declare function _flagPatchItemsForPostProcessing(itemsToBePatched: commo
|
|
|
49
50
|
* @param templates a collection of AGO item templates
|
|
50
51
|
*
|
|
51
52
|
* @returns An updated array of item templates
|
|
52
|
-
*
|
|
53
|
+
* @private
|
|
53
54
|
*/
|
|
54
55
|
export declare function _evaluateSharedViewSources(templates: common.IItemTemplate[]): common.IItemTemplate[];
|
|
55
56
|
/**
|
|
@@ -61,7 +62,7 @@ export declare function _evaluateSharedViewSources(templates: common.IItemTempla
|
|
|
61
62
|
* @param views an array of view template details
|
|
62
63
|
*
|
|
63
64
|
* @returns An updated array of item templates
|
|
64
|
-
*
|
|
65
|
+
* @private
|
|
65
66
|
*/
|
|
66
67
|
export declare function _updateViewTemplates(templates: common.IItemTemplate[], views: any[]): common.IItemTemplate[];
|
|
67
68
|
/**
|
|
@@ -72,7 +73,7 @@ export declare function _updateViewTemplates(templates: common.IItemTemplate[],
|
|
|
72
73
|
* @returns an array of objects with the source FS id as the key and a list of views that are
|
|
73
74
|
* dependant upon it
|
|
74
75
|
*
|
|
75
|
-
* @
|
|
76
|
+
* @private
|
|
76
77
|
*/
|
|
77
78
|
export declare function _getViewHash(views: any[]): any;
|
|
78
79
|
/**
|
|
@@ -82,7 +83,7 @@ export declare function _getViewHash(views: any[]): any;
|
|
|
82
83
|
*
|
|
83
84
|
* @returns an array with the view id and its dependencies
|
|
84
85
|
*
|
|
85
|
-
* @
|
|
86
|
+
* @private
|
|
86
87
|
*/
|
|
87
88
|
export declare function _getViews(templates: common.IItemTemplate[]): any[];
|
|
88
89
|
/**
|
|
@@ -95,7 +96,7 @@ export declare function _getViews(templates: common.IItemTemplate[]): any[];
|
|
|
95
96
|
*
|
|
96
97
|
* @returns A Promise that will resolve once existing items have been evaluated
|
|
97
98
|
*
|
|
98
|
-
* @
|
|
99
|
+
* @private
|
|
99
100
|
*/
|
|
100
101
|
export declare function _reuseDeployedItems(templates: common.IItemTemplate[], reuseItems: boolean, templateDictionary: any, authentication: common.UserSession): Promise<any>;
|
|
101
102
|
/**
|
|
@@ -116,7 +117,7 @@ export declare function _reuseDeployedItems(templates: common.IItemTemplate[], r
|
|
|
116
117
|
*
|
|
117
118
|
* @returns A Promise that will resolve once existing items have been evaluated
|
|
118
119
|
*
|
|
119
|
-
* @
|
|
120
|
+
* @private
|
|
120
121
|
*/
|
|
121
122
|
export declare function _useExistingItems(templates: common.IItemTemplate[], useExisting: boolean, templateDictionary: any, authentication: common.UserSession): Promise<any>;
|
|
122
123
|
/**
|
|
@@ -128,7 +129,8 @@ export declare function _useExistingItems(templates: common.IItemTemplate[], use
|
|
|
128
129
|
* @param sourceIdHash key value pairs..actual itemId is the key and the source itemId is the value
|
|
129
130
|
* @param authentication credentials for the requests
|
|
130
131
|
*
|
|
131
|
-
* @
|
|
132
|
+
* @returns a promise to indicate when the requests are complete
|
|
133
|
+
* @private
|
|
132
134
|
*/
|
|
133
135
|
export declare function _setTypekeywordForExisting(itemDefs: Array<Promise<any>>, sourceIdHash: any, authentication: common.UserSession): Promise<any>;
|
|
134
136
|
/**
|
|
@@ -137,7 +139,7 @@ export declare function _setTypekeywordForExisting(itemDefs: Array<Promise<any>>
|
|
|
137
139
|
* @param templates A collection of AGO item templates
|
|
138
140
|
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
139
141
|
*
|
|
140
|
-
* @
|
|
142
|
+
* @private
|
|
141
143
|
*/
|
|
142
144
|
export declare function _updateTemplateDictionary(templates: common.IItemTemplate[], templateDictionary: any, authentication: common.UserSession): Promise<any>;
|
|
143
145
|
/**
|
|
@@ -148,7 +150,7 @@ export declare function _updateTemplateDictionary(templates: common.IItemTemplat
|
|
|
148
150
|
* @param layerId the id for the layer
|
|
149
151
|
* @param fields the fields to transfer
|
|
150
152
|
*
|
|
151
|
-
* @
|
|
153
|
+
* @private
|
|
152
154
|
*/
|
|
153
155
|
export declare function _setFields(templateDictionary: any, itemId: string, layerId: string, fields: any[]): void;
|
|
154
156
|
/**
|
|
@@ -161,7 +163,7 @@ export declare function _setFields(templateDictionary: any, itemId: string, laye
|
|
|
161
163
|
* @param result the service request result
|
|
162
164
|
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
163
165
|
*
|
|
164
|
-
* @
|
|
166
|
+
* @private
|
|
165
167
|
*/
|
|
166
168
|
export declare function _updateTemplateDictionaryForError(templateDictionary: any, itemId: string): any;
|
|
167
169
|
/**
|
|
@@ -171,8 +173,8 @@ export declare function _updateTemplateDictionaryForError(templateDictionary: an
|
|
|
171
173
|
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
172
174
|
* @param authentication Credentials for the request
|
|
173
175
|
* @param addTagQuery Boolean to indicate if a search by tag should happen
|
|
174
|
-
* @
|
|
175
|
-
* @
|
|
176
|
+
* @returns A promise that will resolve with an array of results
|
|
177
|
+
* @private
|
|
176
178
|
*/
|
|
177
179
|
export declare function _handleExistingItems(existingItemsResponse: any[], templateDictionary: any, authentication: common.UserSession, addTagQuery: boolean): Array<Promise<any>>;
|
|
178
180
|
export declare function _updateTemplateDictionaryById(templateDictionary: any, sourceId: string, itemId: string, v: any): void;
|
|
@@ -181,8 +183,8 @@ export declare function _updateTemplateDictionaryById(templateDictionary: any, s
|
|
|
181
183
|
*
|
|
182
184
|
* @param query Query string to use
|
|
183
185
|
* @param authentication Credentials for the request
|
|
184
|
-
* @
|
|
185
|
-
* @
|
|
186
|
+
* @returns A promise that will resolve with an array of results
|
|
187
|
+
* @private
|
|
186
188
|
*/
|
|
187
189
|
export declare function _findExistingItemByKeyword(templates: common.IItemTemplate[], templateDictionary: any, authentication: common.UserSession): Array<Promise<any>>;
|
|
188
190
|
/**
|
|
@@ -190,8 +192,8 @@ export declare function _findExistingItemByKeyword(templates: common.IItemTempla
|
|
|
190
192
|
*
|
|
191
193
|
* @param query Query string to use
|
|
192
194
|
* @param authentication Credentials for the request
|
|
193
|
-
* @
|
|
194
|
-
* @
|
|
195
|
+
* @returns A promise that will resolve with an array of results
|
|
196
|
+
* @private
|
|
195
197
|
*/
|
|
196
198
|
export declare function _findExistingItem(query: string, authentication: common.UserSession): Promise<any>;
|
|
197
199
|
/**
|
|
@@ -202,17 +204,17 @@ export declare function _findExistingItem(query: string, authentication: common.
|
|
|
202
204
|
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
203
205
|
* @param userSession Options for the request
|
|
204
206
|
* @param itemProgressCallback Function for reporting progress updates from type-specific template handlers
|
|
205
|
-
* @
|
|
207
|
+
* @returns A promise that will resolve with the id of the deployed item (which is simply returned if it's
|
|
206
208
|
* already in the templates list
|
|
207
|
-
* @
|
|
209
|
+
* @private
|
|
208
210
|
*/
|
|
209
211
|
export declare function _createItemFromTemplateWhenReady(template: common.IItemTemplate, resourceFilePaths: common.IDeployFileCopyPath[], storageAuthentication: common.UserSession, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
|
210
212
|
/**
|
|
211
213
|
* Accumulates the estimated deployment cost of a set of templates.
|
|
212
214
|
*
|
|
213
215
|
* @param templates Templates to examine
|
|
214
|
-
* @
|
|
215
|
-
* @
|
|
216
|
+
* @returns Sum of estimated deployment costs
|
|
217
|
+
* @private
|
|
216
218
|
*/
|
|
217
219
|
export declare function _estimateDeploymentCost(templates: common.IItemTemplate[]): number;
|
|
218
220
|
export declare function _getGroupUpdates(template: common.IItemTemplate, authentication: common.UserSession, templateDictionary: any): Array<Promise<any>>;
|
package/dist/umd/deployer.d.ts
CHANGED
|
@@ -29,6 +29,6 @@ import { IModel } from "@esri/hub-common";
|
|
|
29
29
|
* @param maybeModel Item Id or IModel
|
|
30
30
|
* @param authentication Credentials for the destination organization
|
|
31
31
|
* @param options Options to override deployed information and to provide additional credentials
|
|
32
|
-
* @
|
|
32
|
+
* @returns The id of the created deployed solution item
|
|
33
33
|
*/
|
|
34
34
|
export declare function deploySolution(maybeModel: string | IModel, authentication: common.UserSession, options?: common.IDeploySolutionOptions): Promise<string>;
|
package/dist/umd/deployer.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-deployer - v1.3.
|
|
2
|
+
* @esri/solution-deployer - v1.3.13 - Apache-2.0
|
|
3
3
|
* Copyright (c) 2018-2022 Esri, Inc.
|
|
4
|
-
* Tue
|
|
4
|
+
* Tue Apr 26 2022 15:05:39 GMT-0700 (Pacific Daylight 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.
|
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
* @param deployedSolutionId Id of deployed Solution item
|
|
257
257
|
* @param destinationAuthentication Credentials for the destination organization
|
|
258
258
|
* @param options Options to tune deployment
|
|
259
|
-
* @
|
|
259
|
+
* @returns A promise that will resolve with the list of information about the created items
|
|
260
260
|
*/
|
|
261
261
|
function deploySolutionItems(portalSharingUrl, storageItemId, templates, storageAuthentication, templateDictionary, deployedSolutionId, destinationAuthentication, options) {
|
|
262
262
|
return new Promise((resolve, reject) => {
|
|
@@ -358,6 +358,7 @@
|
|
|
358
358
|
* @param itemsToBePatched List of items that need to have their dependencies patched
|
|
359
359
|
* @param templateDictionary Hash of facts: org URL, adlib replacements
|
|
360
360
|
* @param templates A collection of AGO item templates
|
|
361
|
+
* @private
|
|
361
362
|
*/
|
|
362
363
|
function _flagPatchItemsForPostProcessing(itemsToBePatched, templateDictionary, templates) {
|
|
363
364
|
let itemIdsToBePatched = Object.keys(itemsToBePatched);
|
|
@@ -382,7 +383,7 @@
|
|
|
382
383
|
* @param templates a collection of AGO item templates
|
|
383
384
|
*
|
|
384
385
|
* @returns An updated array of item templates
|
|
385
|
-
*
|
|
386
|
+
* @private
|
|
386
387
|
*/
|
|
387
388
|
function _evaluateSharedViewSources(templates) {
|
|
388
389
|
// update the templates so we can defer the deployment when more than one view shares the same source
|
|
@@ -428,7 +429,7 @@
|
|
|
428
429
|
* @param views an array of view template details
|
|
429
430
|
*
|
|
430
431
|
* @returns An updated array of item templates
|
|
431
|
-
*
|
|
432
|
+
* @private
|
|
432
433
|
*/
|
|
433
434
|
function _updateViewTemplates(templates, views) {
|
|
434
435
|
views.forEach(v => {
|
|
@@ -461,7 +462,7 @@
|
|
|
461
462
|
* @returns an array of objects with the source FS id as the key and a list of views that are
|
|
462
463
|
* dependant upon it
|
|
463
464
|
*
|
|
464
|
-
* @
|
|
465
|
+
* @private
|
|
465
466
|
*/
|
|
466
467
|
function _getViewHash(views) {
|
|
467
468
|
const viewHash = {};
|
|
@@ -485,7 +486,7 @@
|
|
|
485
486
|
*
|
|
486
487
|
* @returns an array with the view id and its dependencies
|
|
487
488
|
*
|
|
488
|
-
* @
|
|
489
|
+
* @private
|
|
489
490
|
*/
|
|
490
491
|
function _getViews(templates) {
|
|
491
492
|
return templates.reduce((acc, v) => {
|
|
@@ -509,7 +510,7 @@
|
|
|
509
510
|
*
|
|
510
511
|
* @returns A Promise that will resolve once existing items have been evaluated
|
|
511
512
|
*
|
|
512
|
-
* @
|
|
513
|
+
* @private
|
|
513
514
|
*/
|
|
514
515
|
function _reuseDeployedItems(templates, reuseItems, templateDictionary, authentication) {
|
|
515
516
|
return new Promise((resolve, reject) => {
|
|
@@ -547,7 +548,7 @@
|
|
|
547
548
|
*
|
|
548
549
|
* @returns A Promise that will resolve once existing items have been evaluated
|
|
549
550
|
*
|
|
550
|
-
* @
|
|
551
|
+
* @private
|
|
551
552
|
*/
|
|
552
553
|
function _useExistingItems(templates, useExisting, templateDictionary, authentication) {
|
|
553
554
|
return new Promise(resolve => {
|
|
@@ -590,7 +591,8 @@
|
|
|
590
591
|
* @param sourceIdHash key value pairs..actual itemId is the key and the source itemId is the value
|
|
591
592
|
* @param authentication credentials for the requests
|
|
592
593
|
*
|
|
593
|
-
* @
|
|
594
|
+
* @returns a promise to indicate when the requests are complete
|
|
595
|
+
* @private
|
|
594
596
|
*/
|
|
595
597
|
function _setTypekeywordForExisting(itemDefs, sourceIdHash, authentication) {
|
|
596
598
|
return new Promise(resolve => {
|
|
@@ -631,7 +633,7 @@
|
|
|
631
633
|
* @param templates A collection of AGO item templates
|
|
632
634
|
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
633
635
|
*
|
|
634
|
-
* @
|
|
636
|
+
* @private
|
|
635
637
|
*/
|
|
636
638
|
function _updateTemplateDictionary(templates, templateDictionary, authentication) {
|
|
637
639
|
return new Promise(resolve => {
|
|
@@ -757,7 +759,7 @@
|
|
|
757
759
|
* @param layerId the id for the layer
|
|
758
760
|
* @param fields the fields to transfer
|
|
759
761
|
*
|
|
760
|
-
* @
|
|
762
|
+
* @private
|
|
761
763
|
*/
|
|
762
764
|
function _setFields(templateDictionary, itemId, layerId, fields) {
|
|
763
765
|
const layerInfo = common__namespace.getProp(templateDictionary, `${itemId}.layer${layerId}`);
|
|
@@ -776,7 +778,7 @@
|
|
|
776
778
|
* @param result the service request result
|
|
777
779
|
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
778
780
|
*
|
|
779
|
-
* @
|
|
781
|
+
* @private
|
|
780
782
|
*/
|
|
781
783
|
function _updateTemplateDictionaryForError(templateDictionary, itemId) {
|
|
782
784
|
/* istanbul ignore else */
|
|
@@ -803,8 +805,8 @@
|
|
|
803
805
|
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
804
806
|
* @param authentication Credentials for the request
|
|
805
807
|
* @param addTagQuery Boolean to indicate if a search by tag should happen
|
|
806
|
-
* @
|
|
807
|
-
* @
|
|
808
|
+
* @returns A promise that will resolve with an array of results
|
|
809
|
+
* @private
|
|
808
810
|
*/
|
|
809
811
|
function _handleExistingItems(existingItemsResponse, templateDictionary, authentication, addTagQuery) {
|
|
810
812
|
// if items are not found by type keyword search by tag
|
|
@@ -842,6 +844,7 @@
|
|
|
842
844
|
}
|
|
843
845
|
return existingItemsByTag;
|
|
844
846
|
}
|
|
847
|
+
//???
|
|
845
848
|
function _updateTemplateDictionaryById(templateDictionary, sourceId, itemId, v) {
|
|
846
849
|
templateDictionary[sourceId] = Object.assign(templateDictionary[sourceId] || {}, {
|
|
847
850
|
def: Promise.resolve(common__namespace.generateEmptyCreationResponse(v.type, itemId)),
|
|
@@ -856,8 +859,8 @@
|
|
|
856
859
|
*
|
|
857
860
|
* @param query Query string to use
|
|
858
861
|
* @param authentication Credentials for the request
|
|
859
|
-
* @
|
|
860
|
-
* @
|
|
862
|
+
* @returns A promise that will resolve with an array of results
|
|
863
|
+
* @private
|
|
861
864
|
*/
|
|
862
865
|
function _findExistingItemByKeyword(templates, templateDictionary, authentication) {
|
|
863
866
|
const existingItemsDefs = [];
|
|
@@ -888,8 +891,8 @@
|
|
|
888
891
|
*
|
|
889
892
|
* @param query Query string to use
|
|
890
893
|
* @param authentication Credentials for the request
|
|
891
|
-
* @
|
|
892
|
-
* @
|
|
894
|
+
* @returns A promise that will resolve with an array of results
|
|
895
|
+
* @private
|
|
893
896
|
*/
|
|
894
897
|
function _findExistingItem(query, authentication) {
|
|
895
898
|
const searchOptions = {
|
|
@@ -907,9 +910,9 @@
|
|
|
907
910
|
* @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
|
|
908
911
|
* @param userSession Options for the request
|
|
909
912
|
* @param itemProgressCallback Function for reporting progress updates from type-specific template handlers
|
|
910
|
-
* @
|
|
913
|
+
* @returns A promise that will resolve with the id of the deployed item (which is simply returned if it's
|
|
911
914
|
* already in the templates list
|
|
912
|
-
* @
|
|
915
|
+
* @private
|
|
913
916
|
*/
|
|
914
917
|
function _createItemFromTemplateWhenReady(template, resourceFilePaths, storageAuthentication, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
915
918
|
// ensure this is present
|
|
@@ -1008,14 +1011,15 @@
|
|
|
1008
1011
|
* Accumulates the estimated deployment cost of a set of templates.
|
|
1009
1012
|
*
|
|
1010
1013
|
* @param templates Templates to examine
|
|
1011
|
-
* @
|
|
1012
|
-
* @
|
|
1014
|
+
* @returns Sum of estimated deployment costs
|
|
1015
|
+
* @private
|
|
1013
1016
|
*/
|
|
1014
1017
|
function _estimateDeploymentCost(templates) {
|
|
1015
1018
|
return templates.reduce((accumulatedEstimatedCost, template) => {
|
|
1016
1019
|
return (accumulatedEstimatedCost + (template.estimatedDeploymentCostFactor || 1));
|
|
1017
1020
|
}, 0);
|
|
1018
1021
|
}
|
|
1022
|
+
//???
|
|
1019
1023
|
// TODO: Return a Promise vs array of promises
|
|
1020
1024
|
function _getGroupUpdates(template, authentication, templateDictionary) {
|
|
1021
1025
|
const groups = template.groups || [];
|
|
@@ -1327,7 +1331,7 @@
|
|
|
1327
1331
|
* Add source-id to items/groups typeKeywords
|
|
1328
1332
|
*
|
|
1329
1333
|
* @param template the array of solution data templates
|
|
1330
|
-
* @
|
|
1334
|
+
* @private
|
|
1331
1335
|
*/
|
|
1332
1336
|
function _addSourceId(templates) {
|
|
1333
1337
|
return templates.map((template) => {
|
|
@@ -1347,7 +1351,7 @@
|
|
|
1347
1351
|
* @param sourceInfo
|
|
1348
1352
|
* @param authentication
|
|
1349
1353
|
* @param isGroup Boolean to indicate if the files are associated with a group or item
|
|
1350
|
-
* @
|
|
1354
|
+
* @private
|
|
1351
1355
|
*/
|
|
1352
1356
|
function _applySourceToDeployOptions(deployOptions, solutionTemplateBase, templateDictionary, authentication) {
|
|
1353
1357
|
// Deploy a solution from the template's contents,
|
|
@@ -1367,6 +1371,7 @@
|
|
|
1367
1371
|
}
|
|
1368
1372
|
return deployOptions;
|
|
1369
1373
|
}
|
|
1374
|
+
//???
|
|
1370
1375
|
function _replaceParamVariables(solutionTemplateData, templateDictionary) {
|
|
1371
1376
|
// a custom params object can be passed in with the options to deploy a solution
|
|
1372
1377
|
// in most cases we can defer to the item type handlers to use these values
|
|
@@ -1387,6 +1392,7 @@
|
|
|
1387
1392
|
return template;
|
|
1388
1393
|
});
|
|
1389
1394
|
}
|
|
1395
|
+
//???
|
|
1390
1396
|
function _updateProp(template, path, lookup, templateDictionary) {
|
|
1391
1397
|
const wkid = common__namespace.getProp(template, path);
|
|
1392
1398
|
/* istanbul ignore else */
|
|
@@ -1395,6 +1401,7 @@
|
|
|
1395
1401
|
}
|
|
1396
1402
|
return template;
|
|
1397
1403
|
}
|
|
1404
|
+
//???
|
|
1398
1405
|
function _checkedReplaceAll(template, oldValue, newValue) {
|
|
1399
1406
|
let newTemplate;
|
|
1400
1407
|
if (template && template.indexOf(oldValue) > -1) {
|
|
@@ -1406,6 +1413,7 @@
|
|
|
1406
1413
|
}
|
|
1407
1414
|
return newTemplate;
|
|
1408
1415
|
}
|
|
1416
|
+
//???
|
|
1409
1417
|
function _getPortalBaseUrl(portalResponse, authentication) {
|
|
1410
1418
|
// As of Spring 2020, only HTTPS (see
|
|
1411
1419
|
// https://www.esri.com/arcgis-blog/products/product/administration/2019-arcgis-transport-security-improvements/)
|
|
@@ -1419,6 +1427,7 @@
|
|
|
1419
1427
|
? `${scheme}://${enterpriseBaseUrl}`
|
|
1420
1428
|
: authentication.portal.replace("/sharing/rest", "");
|
|
1421
1429
|
}
|
|
1430
|
+
//???
|
|
1422
1431
|
function _updateGroupReferences(itemTemplates, templateDictionary) {
|
|
1423
1432
|
const groupIds = itemTemplates.reduce((result, t) => {
|
|
1424
1433
|
if (t.type === "Group") {
|
|
@@ -1436,6 +1445,7 @@
|
|
|
1436
1445
|
});
|
|
1437
1446
|
return itemTemplates;
|
|
1438
1447
|
}
|
|
1448
|
+
//???
|
|
1439
1449
|
function _purgeTemplateProperties(itemTemplate) {
|
|
1440
1450
|
const retainProps = ["itemId", "type", "dependencies", "groups"];
|
|
1441
1451
|
const deleteProps = Object.keys(itemTemplate).filter(k => retainProps.indexOf(k) < 0);
|
|
@@ -1514,6 +1524,7 @@
|
|
|
1514
1524
|
* Check if an object is an Model
|
|
1515
1525
|
*
|
|
1516
1526
|
* @param obj any object
|
|
1527
|
+
* @private
|
|
1517
1528
|
*/
|
|
1518
1529
|
function _isModel(obj) {
|
|
1519
1530
|
let result = false;
|
|
@@ -1581,7 +1592,7 @@
|
|
|
1581
1592
|
* @param maybeModel Item Id or IModel
|
|
1582
1593
|
* @param authentication Credentials for the destination organization
|
|
1583
1594
|
* @param options Options to override deployed information and to provide additional credentials
|
|
1584
|
-
* @
|
|
1595
|
+
* @returns The id of the created deployed solution item
|
|
1585
1596
|
*/
|
|
1586
1597
|
function deploySolution(maybeModel, authentication, options) {
|
|
1587
1598
|
// if we are not passed the maybeModel, reject
|