@esri/solution-feature-layer 1.1.2 → 1.2.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.
- package/dist/esm/feature-layer.d.ts +3 -2
- package/dist/esm/feature-layer.js +36 -54
- package/dist/esm/feature-layer.js.map +1 -1
- package/dist/node/feature-layer.d.ts +3 -2
- package/dist/node/feature-layer.js +37 -55
- package/dist/node/feature-layer.js.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/umd/feature-layer.d.ts +3 -2
- package/dist/umd/feature-layer.umd.js +231 -242
- package/dist/umd/feature-layer.umd.js.map +1 -1
- package/dist/umd/feature-layer.umd.min.js +3 -3
- package/dist/umd/feature-layer.umd.min.js.map +1 -1
- package/package.json +24 -24
|
@@ -24,11 +24,12 @@ import * as common from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId
|
|
26
26
|
* @param itemInfo Feature service item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
28
29
|
* @param templateDictionary Hash mapping property names to replacement values
|
|
29
30
|
* @return A promise that will resolve when fullItem has been updated
|
|
30
31
|
*/
|
|
31
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
32
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary?: any): Promise<common.IItemTemplate>;
|
|
32
33
|
/**
|
|
33
34
|
* Creates an item in a specified folder (except for Group item type).
|
|
34
35
|
*
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { __assign } from "tslib";
|
|
17
16
|
/**
|
|
18
17
|
* Manages the creation and deployment of feature layers and services.
|
|
19
18
|
*
|
|
@@ -28,35 +27,36 @@ import * as common from "@esri/solution-common";
|
|
|
28
27
|
*
|
|
29
28
|
* @param solutionItemId
|
|
30
29
|
* @param itemInfo Feature service item
|
|
31
|
-
* @param
|
|
30
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
31
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
32
32
|
* @param templateDictionary Hash mapping property names to replacement values
|
|
33
33
|
* @return A promise that will resolve when fullItem has been updated
|
|
34
34
|
*/
|
|
35
|
-
export function convertItemToTemplate(solutionItemId, itemInfo,
|
|
36
|
-
return new Promise(
|
|
35
|
+
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
37
|
// Init template
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const template = common.createInitializedItemTemplate(itemInfo);
|
|
39
|
+
const hasInvalidDesignations = common.hasInvalidGroupDesignations(itemInfo.groupDesignations);
|
|
40
40
|
if (hasInvalidDesignations) {
|
|
41
41
|
common
|
|
42
|
-
.updateTemplateForInvalidDesignations(template,
|
|
43
|
-
.then(
|
|
42
|
+
.updateTemplateForInvalidDesignations(template, srcAuthentication)
|
|
43
|
+
.then(_template => resolve(_template), e => reject(common.fail(e)));
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
46
|
// Update the estimated cost factor to deploy this item
|
|
47
47
|
template.estimatedDeploymentCostFactor = 10;
|
|
48
48
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
49
|
-
common.getItemDataAsJson(template.item.id,
|
|
49
|
+
common.getItemDataAsJson(template.item.id, srcAuthentication).then(data => {
|
|
50
50
|
template.data = data;
|
|
51
|
-
common.getServiceLayersAndTables(template,
|
|
51
|
+
common.getServiceLayersAndTables(template, srcAuthentication).then(itemTemplate => {
|
|
52
52
|
// Extract dependencies
|
|
53
|
-
common.extractDependencies(itemTemplate,
|
|
53
|
+
common.extractDependencies(itemTemplate, srcAuthentication).then((dependencies) => {
|
|
54
54
|
// set the dependencies as an array of IDs from the array of IDependency
|
|
55
|
-
itemTemplate.dependencies = dependencies.map(
|
|
55
|
+
itemTemplate.dependencies = dependencies.map((dep) => dep.id);
|
|
56
56
|
// resolve the template with templatized values
|
|
57
57
|
resolve(common.templatize(itemTemplate, dependencies, false, templateDictionary));
|
|
58
|
-
},
|
|
59
|
-
},
|
|
58
|
+
}, (e) => reject(common.fail(e)));
|
|
59
|
+
}, e => reject(common.fail(e)));
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
});
|
|
@@ -75,7 +75,7 @@ export function convertItemToTemplate(solutionItemId, itemInfo, authentication,
|
|
|
75
75
|
* @protected
|
|
76
76
|
*/
|
|
77
77
|
export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
78
|
-
return new Promise(
|
|
78
|
+
return new Promise(resolve => {
|
|
79
79
|
// Interrupt process if progress callback returns `false`
|
|
80
80
|
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Started, 0)) {
|
|
81
81
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Ignored, 0);
|
|
@@ -83,27 +83,23 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
85
|
// Replace the templatized symbols in a copy of the template
|
|
86
|
-
|
|
86
|
+
let newItemTemplate = common.cloneObject(template);
|
|
87
87
|
newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
|
|
88
88
|
// Thumbnail has to be updated separately; doesn't work in create service call
|
|
89
89
|
delete newItemTemplate.item.thumbnail;
|
|
90
90
|
// cache the popup info to be added later
|
|
91
|
-
|
|
91
|
+
const popupInfos = common.cachePopupInfos(newItemTemplate.data);
|
|
92
92
|
// Create the item, then update its URL with its new id
|
|
93
93
|
common
|
|
94
94
|
.createFeatureService(newItemTemplate, destinationAuthentication, templateDictionary)
|
|
95
|
-
.then(
|
|
95
|
+
.then(createResponse => {
|
|
96
96
|
if (createResponse.success) {
|
|
97
97
|
// Interrupt process if progress callback returns `false`
|
|
98
98
|
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.serviceItemId)) {
|
|
99
99
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
|
|
100
100
|
common
|
|
101
101
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
102
|
-
.then(
|
|
103
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
104
|
-
}, function () {
|
|
105
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
106
|
-
});
|
|
102
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
107
103
|
}
|
|
108
104
|
else {
|
|
109
105
|
// Detemplatize what we can now that the service has been created
|
|
@@ -111,29 +107,27 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
111
107
|
// Add the layers and tables to the feature service
|
|
112
108
|
common
|
|
113
109
|
.addFeatureServiceLayersAndTables(newItemTemplate, templateDictionary, popupInfos, destinationAuthentication)
|
|
114
|
-
.then(
|
|
110
|
+
.then(() => {
|
|
115
111
|
newItemTemplate = common.updateTemplate(newItemTemplate, templateDictionary, createResponse);
|
|
116
112
|
// Update the item with snippet, description, popupInfo, etc.
|
|
117
113
|
common
|
|
118
|
-
.updateItemExtended(
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
.updateItemExtended({
|
|
115
|
+
...newItemTemplate.item,
|
|
116
|
+
url: undefined // can't update the URL of a feature service
|
|
117
|
+
}, newItemTemplate.data, destinationAuthentication, template.item.thumbnail, undefined, templateDictionary)
|
|
118
|
+
.then(() => {
|
|
121
119
|
// Interrupt process if progress callback returns `false`
|
|
122
120
|
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor / 2, createResponse.serviceItemId)) {
|
|
123
121
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
|
|
124
122
|
common
|
|
125
123
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
126
|
-
.then(
|
|
127
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
128
|
-
}, function () {
|
|
129
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
130
|
-
});
|
|
124
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
131
125
|
}
|
|
132
126
|
else {
|
|
133
127
|
// Update the template to match what we've stored in AGO
|
|
134
128
|
common
|
|
135
129
|
.getItemBase(newItemTemplate.itemId, destinationAuthentication)
|
|
136
|
-
.then(
|
|
130
|
+
.then(updatedItem => {
|
|
137
131
|
newItemTemplate.item = updatedItem;
|
|
138
132
|
/* istanbul ignore else */
|
|
139
133
|
if (common.getProp(newItemTemplate, "item.url") &&
|
|
@@ -150,38 +144,26 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
150
144
|
}) ||
|
|
151
145
|
common.isWorkforceProject(newItemTemplate)
|
|
152
146
|
});
|
|
153
|
-
},
|
|
147
|
+
}, () => {
|
|
154
148
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
155
149
|
common
|
|
156
150
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
157
|
-
.then(
|
|
158
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
159
|
-
}, function () {
|
|
160
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
161
|
-
});
|
|
151
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
162
152
|
} // fails to update item
|
|
163
153
|
);
|
|
164
154
|
}
|
|
165
|
-
},
|
|
155
|
+
}, () => {
|
|
166
156
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
167
157
|
common
|
|
168
158
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
169
|
-
.then(
|
|
170
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
171
|
-
}, function () {
|
|
172
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
173
|
-
});
|
|
159
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
174
160
|
} // fails to update item
|
|
175
161
|
);
|
|
176
|
-
},
|
|
162
|
+
}, () => {
|
|
177
163
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
178
164
|
common
|
|
179
165
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
180
|
-
.then(
|
|
181
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
182
|
-
}, function () {
|
|
183
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
184
|
-
});
|
|
166
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
185
167
|
} // fails to add service layers and/or tables
|
|
186
168
|
);
|
|
187
169
|
}
|
|
@@ -190,7 +172,7 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
190
172
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
191
173
|
resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
|
|
192
174
|
}
|
|
193
|
-
},
|
|
175
|
+
}, () => {
|
|
194
176
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
195
177
|
resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
|
|
196
178
|
});
|
|
@@ -207,10 +189,10 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
207
189
|
* @returns Promise resolving to successfulness of update
|
|
208
190
|
*/
|
|
209
191
|
export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
210
|
-
return new Promise(
|
|
192
|
+
return new Promise((resolve, reject) => {
|
|
211
193
|
common
|
|
212
194
|
.updateItemTemplateFromDictionary(itemId, templateDictionary, authentication)
|
|
213
|
-
.then(
|
|
195
|
+
.then(results => {
|
|
214
196
|
if (common.isWorkforceProject(template)) {
|
|
215
197
|
template = common.replaceInTemplate(template, templateDictionary);
|
|
216
198
|
common
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-layer.js","sourceRoot":"","sources":["../../src/feature-layer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"feature-layer.js","sourceRoot":"","sources":["../../src/feature-layer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,kHAAkH;AAElH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,YAAY;AAEZ,kHAAkH;AAElH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAwB;IAExB,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,gBAAgB;QAChB,MAAM,QAAQ,GAAyB,MAAM,CAAC,6BAA6B,CACzE,QAAQ,CACT,CAAC;QAEF,MAAM,sBAAsB,GAAY,MAAM,CAAC,2BAA2B,CACxE,QAAQ,CAAC,iBAAiB,CAC3B,CAAC;QACF,IAAI,sBAAsB,EAAE;YAC1B,MAAM;iBACH,oCAAoC,CAAC,QAAQ,EAAE,iBAAiB,CAAC;iBACjE,IAAI,CACH,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,EAC/B,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAC5B,CAAC;SACL;aAAM;YACL,uDAAuD;YACvD,QAAQ,CAAC,6BAA6B,GAAG,EAAE,CAAC;YAE5C,mEAAmE;YACnE,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC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SAAgB,EAChB,QAA8B,EAC9B,SAAiC,EACjC,kBAAuB,EACvB,cAAkC;IAElC,OAAO,IAAI,OAAO,CAA6B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACjE,MAAM;aACH,gCAAgC,CAC/B,MAAM,EACN,kBAAkB,EAClB,cAAc,CACf;aACA,IAAI,CAAC,OAAO,CAAC,EAAE;YACd,IAAI,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE;gBACvC,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;gBAClE,MAAM;qBACH,4BAA4B,CAC3B,QAAQ,EACR,cAAc,EACd,QAAQ,CAAC,IAAI,CAAC,GAAG,EACjB,kBAAkB,CACnB;qBACA,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;aAC1B;iBAAM;gBACL,OAAO,CAAC,OAAO,CAAC,CAAC;aAClB;QACH,CAAC,EAAE,MAAM,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAED,YAAY"}
|
|
@@ -24,11 +24,12 @@ import * as common from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId
|
|
26
26
|
* @param itemInfo Feature service item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
28
29
|
* @param templateDictionary Hash mapping property names to replacement values
|
|
29
30
|
* @return A promise that will resolve when fullItem has been updated
|
|
30
31
|
*/
|
|
31
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
32
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary?: any): Promise<common.IItemTemplate>;
|
|
32
33
|
/**
|
|
33
34
|
* Creates an item in a specified folder (except for Group item type).
|
|
34
35
|
*
|
|
@@ -16,14 +16,13 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.postProcess = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
|
|
19
|
-
var tslib_1 = require("tslib");
|
|
20
19
|
/**
|
|
21
20
|
* Manages the creation and deployment of feature layers and services.
|
|
22
21
|
*
|
|
23
22
|
* @module feature-layer
|
|
24
23
|
*/
|
|
25
24
|
//#region Imports ----------------------------------------------------------------------------------------------//
|
|
26
|
-
|
|
25
|
+
const common = require("@esri/solution-common");
|
|
27
26
|
//#endregion
|
|
28
27
|
//#region Publish Process --------------------------------------------------------------------------------------//
|
|
29
28
|
/**
|
|
@@ -31,35 +30,36 @@ var common = require("@esri/solution-common");
|
|
|
31
30
|
*
|
|
32
31
|
* @param solutionItemId
|
|
33
32
|
* @param itemInfo Feature service item
|
|
34
|
-
* @param
|
|
33
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
34
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
35
35
|
* @param templateDictionary Hash mapping property names to replacement values
|
|
36
36
|
* @return A promise that will resolve when fullItem has been updated
|
|
37
37
|
*/
|
|
38
|
-
function convertItemToTemplate(solutionItemId, itemInfo,
|
|
39
|
-
return new Promise(
|
|
38
|
+
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
40
|
// Init template
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const template = common.createInitializedItemTemplate(itemInfo);
|
|
42
|
+
const hasInvalidDesignations = common.hasInvalidGroupDesignations(itemInfo.groupDesignations);
|
|
43
43
|
if (hasInvalidDesignations) {
|
|
44
44
|
common
|
|
45
|
-
.updateTemplateForInvalidDesignations(template,
|
|
46
|
-
.then(
|
|
45
|
+
.updateTemplateForInvalidDesignations(template, srcAuthentication)
|
|
46
|
+
.then(_template => resolve(_template), e => reject(common.fail(e)));
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
49
|
// Update the estimated cost factor to deploy this item
|
|
50
50
|
template.estimatedDeploymentCostFactor = 10;
|
|
51
51
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
52
|
-
common.getItemDataAsJson(template.item.id,
|
|
52
|
+
common.getItemDataAsJson(template.item.id, srcAuthentication).then(data => {
|
|
53
53
|
template.data = data;
|
|
54
|
-
common.getServiceLayersAndTables(template,
|
|
54
|
+
common.getServiceLayersAndTables(template, srcAuthentication).then(itemTemplate => {
|
|
55
55
|
// Extract dependencies
|
|
56
|
-
common.extractDependencies(itemTemplate,
|
|
56
|
+
common.extractDependencies(itemTemplate, srcAuthentication).then((dependencies) => {
|
|
57
57
|
// set the dependencies as an array of IDs from the array of IDependency
|
|
58
|
-
itemTemplate.dependencies = dependencies.map(
|
|
58
|
+
itemTemplate.dependencies = dependencies.map((dep) => dep.id);
|
|
59
59
|
// resolve the template with templatized values
|
|
60
60
|
resolve(common.templatize(itemTemplate, dependencies, false, templateDictionary));
|
|
61
|
-
},
|
|
62
|
-
},
|
|
61
|
+
}, (e) => reject(common.fail(e)));
|
|
62
|
+
}, e => reject(common.fail(e)));
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
});
|
|
@@ -79,7 +79,7 @@ exports.convertItemToTemplate = convertItemToTemplate;
|
|
|
79
79
|
* @protected
|
|
80
80
|
*/
|
|
81
81
|
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
82
|
-
return new Promise(
|
|
82
|
+
return new Promise(resolve => {
|
|
83
83
|
// Interrupt process if progress callback returns `false`
|
|
84
84
|
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Started, 0)) {
|
|
85
85
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Ignored, 0);
|
|
@@ -87,27 +87,23 @@ function createItemFromTemplate(template, templateDictionary, destinationAuthent
|
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
89
|
// Replace the templatized symbols in a copy of the template
|
|
90
|
-
|
|
90
|
+
let newItemTemplate = common.cloneObject(template);
|
|
91
91
|
newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
|
|
92
92
|
// Thumbnail has to be updated separately; doesn't work in create service call
|
|
93
93
|
delete newItemTemplate.item.thumbnail;
|
|
94
94
|
// cache the popup info to be added later
|
|
95
|
-
|
|
95
|
+
const popupInfos = common.cachePopupInfos(newItemTemplate.data);
|
|
96
96
|
// Create the item, then update its URL with its new id
|
|
97
97
|
common
|
|
98
98
|
.createFeatureService(newItemTemplate, destinationAuthentication, templateDictionary)
|
|
99
|
-
.then(
|
|
99
|
+
.then(createResponse => {
|
|
100
100
|
if (createResponse.success) {
|
|
101
101
|
// Interrupt process if progress callback returns `false`
|
|
102
102
|
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.serviceItemId)) {
|
|
103
103
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
|
|
104
104
|
common
|
|
105
105
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
106
|
-
.then(
|
|
107
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
108
|
-
}, function () {
|
|
109
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
110
|
-
});
|
|
106
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
111
107
|
}
|
|
112
108
|
else {
|
|
113
109
|
// Detemplatize what we can now that the service has been created
|
|
@@ -115,29 +111,27 @@ function createItemFromTemplate(template, templateDictionary, destinationAuthent
|
|
|
115
111
|
// Add the layers and tables to the feature service
|
|
116
112
|
common
|
|
117
113
|
.addFeatureServiceLayersAndTables(newItemTemplate, templateDictionary, popupInfos, destinationAuthentication)
|
|
118
|
-
.then(
|
|
114
|
+
.then(() => {
|
|
119
115
|
newItemTemplate = common.updateTemplate(newItemTemplate, templateDictionary, createResponse);
|
|
120
116
|
// Update the item with snippet, description, popupInfo, etc.
|
|
121
117
|
common
|
|
122
|
-
.updateItemExtended(
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
.updateItemExtended({
|
|
119
|
+
...newItemTemplate.item,
|
|
120
|
+
url: undefined // can't update the URL of a feature service
|
|
121
|
+
}, newItemTemplate.data, destinationAuthentication, template.item.thumbnail, undefined, templateDictionary)
|
|
122
|
+
.then(() => {
|
|
125
123
|
// Interrupt process if progress callback returns `false`
|
|
126
124
|
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor / 2, createResponse.serviceItemId)) {
|
|
127
125
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
|
|
128
126
|
common
|
|
129
127
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
130
|
-
.then(
|
|
131
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
132
|
-
}, function () {
|
|
133
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
134
|
-
});
|
|
128
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
135
129
|
}
|
|
136
130
|
else {
|
|
137
131
|
// Update the template to match what we've stored in AGO
|
|
138
132
|
common
|
|
139
133
|
.getItemBase(newItemTemplate.itemId, destinationAuthentication)
|
|
140
|
-
.then(
|
|
134
|
+
.then(updatedItem => {
|
|
141
135
|
newItemTemplate.item = updatedItem;
|
|
142
136
|
/* istanbul ignore else */
|
|
143
137
|
if (common.getProp(newItemTemplate, "item.url") &&
|
|
@@ -154,38 +148,26 @@ function createItemFromTemplate(template, templateDictionary, destinationAuthent
|
|
|
154
148
|
}) ||
|
|
155
149
|
common.isWorkforceProject(newItemTemplate)
|
|
156
150
|
});
|
|
157
|
-
},
|
|
151
|
+
}, () => {
|
|
158
152
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
159
153
|
common
|
|
160
154
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
161
|
-
.then(
|
|
162
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
163
|
-
}, function () {
|
|
164
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
165
|
-
});
|
|
155
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
166
156
|
} // fails to update item
|
|
167
157
|
);
|
|
168
158
|
}
|
|
169
|
-
},
|
|
159
|
+
}, () => {
|
|
170
160
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
171
161
|
common
|
|
172
162
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
173
|
-
.then(
|
|
174
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
175
|
-
}, function () {
|
|
176
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
177
|
-
});
|
|
163
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
178
164
|
} // fails to update item
|
|
179
165
|
);
|
|
180
|
-
},
|
|
166
|
+
}, () => {
|
|
181
167
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
182
168
|
common
|
|
183
169
|
.removeItem(createResponse.serviceItemId, destinationAuthentication)
|
|
184
|
-
.then(
|
|
185
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
186
|
-
}, function () {
|
|
187
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
188
|
-
});
|
|
170
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
189
171
|
} // fails to add service layers and/or tables
|
|
190
172
|
);
|
|
191
173
|
}
|
|
@@ -194,7 +176,7 @@ function createItemFromTemplate(template, templateDictionary, destinationAuthent
|
|
|
194
176
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
195
177
|
resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
|
|
196
178
|
}
|
|
197
|
-
},
|
|
179
|
+
}, () => {
|
|
198
180
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
199
181
|
resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
|
|
200
182
|
});
|
|
@@ -212,10 +194,10 @@ exports.createItemFromTemplate = createItemFromTemplate;
|
|
|
212
194
|
* @returns Promise resolving to successfulness of update
|
|
213
195
|
*/
|
|
214
196
|
function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
215
|
-
return new Promise(
|
|
197
|
+
return new Promise((resolve, reject) => {
|
|
216
198
|
common
|
|
217
199
|
.updateItemTemplateFromDictionary(itemId, templateDictionary, authentication)
|
|
218
|
-
.then(
|
|
200
|
+
.then(results => {
|
|
219
201
|
if (common.isWorkforceProject(template)) {
|
|
220
202
|
template = common.replaceInTemplate(template, templateDictionary);
|
|
221
203
|
common
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-layer.js","sourceRoot":"","sources":["../../src/feature-layer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"feature-layer.js","sourceRoot":"","sources":["../../src/feature-layer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,kHAAkH;AAElH,gDAAgD;AAEhD,YAAY;AAEZ,kHAAkH;AAElH;;;;;;;;;GASG;AACH,SAAgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAwB;IAExB,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,gBAAgB;QAChB,MAAM,QAAQ,GAAyB,MAAM,CAAC,6BAA6B,CACzE,QAAQ,CACT,CAAC;QAEF,MAAM,sBAAsB,GAAY,MAAM,CAAC,2BAA2B,CACxE,QAA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C,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uBAAuB;aACtF;QACH,CAAC,EACD,GAAG,EAAE;YACH,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;YACF,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uBAAuB;QACvF,CAAC,CACF,CAAC;IACN,CAAC,CAAC,CAAC;AACL,CAAC;AAvRD,wDAuRC;AAED;;;;;;;;;GASG;AACH,SAAgB,WAAW,CACzB,MAAc,EACd,IAAY,EACZ,SAAgB,EAChB,QAA8B,EAC9B,SAAiC,EACjC,kBAAuB,EACvB,cAAkC;IAElC,OAAO,IAAI,OAAO,CAA6B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACjE,MAAM;aACH,gCAAgC,CAC/B,MAAM,EACN,kBAAkB,EAClB,cAAc,CACf;aACA,IAAI,CAAC,OAAO,CAAC,EAAE;YACd,IAAI,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE;gBACvC,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;gBAClE,MAAM;qBACH,4BAA4B,CAC3B,QAAQ,EACR,cAAc,EACd,QAAQ,CAAC,IAAI,CAAC,GAAG,EACjB,kBAAkB,CACnB;qBACA,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;aAC1B;iBAAM;gBACL,OAAO,CAAC,OAAO,CAAC,CAAC;aAClB;QACH,CAAC,EAAE,MAAM,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAhCD,kCAgCC;AAED,YAAY"}
|
package/dist/node/index.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
|
|
18
|
+
const tslib_1 = require("tslib");
|
|
19
19
|
/**
|
|
20
20
|
* Manages the creation and deployment of feature layers and services.
|
|
21
21
|
*
|
|
@@ -24,11 +24,12 @@ import * as common from "@esri/solution-common";
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId
|
|
26
26
|
* @param itemInfo Feature service item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
28
29
|
* @param templateDictionary Hash mapping property names to replacement values
|
|
29
30
|
* @return A promise that will resolve when fullItem has been updated
|
|
30
31
|
*/
|
|
31
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
32
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary?: any): Promise<common.IItemTemplate>;
|
|
32
33
|
/**
|
|
33
34
|
* Creates an item in a specified folder (except for Group item type).
|
|
34
35
|
*
|