@esri/solution-simple-types 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/dashboard.d.ts +0 -1
- package/dist/esm/dashboard.js +55 -56
- package/dist/esm/dashboard.js.map +1 -1
- package/dist/esm/helpers/convert-item-to-template.d.ts +3 -2
- package/dist/esm/helpers/convert-item-to-template.js +35 -37
- package/dist/esm/helpers/convert-item-to-template.js.map +1 -1
- package/dist/esm/helpers/create-item-from-template.js +33 -41
- package/dist/esm/helpers/create-item-from-template.js.map +1 -1
- package/dist/esm/helpers/update-notebook-data.js +1 -1
- package/dist/esm/helpers/update-notebook-data.js.map +1 -1
- package/dist/esm/notebook.d.ts +3 -2
- package/dist/esm/notebook.js +16 -15
- package/dist/esm/notebook.js.map +1 -1
- package/dist/esm/oic.d.ts +3 -2
- package/dist/esm/oic.js +30 -29
- package/dist/esm/oic.js.map +1 -1
- package/dist/esm/quickcapture.d.ts +3 -2
- package/dist/esm/quickcapture.js +22 -21
- package/dist/esm/quickcapture.js.map +1 -1
- package/dist/esm/simple-types.d.ts +3 -2
- package/dist/esm/simple-types.js +4 -3
- package/dist/esm/simple-types.js.map +1 -1
- package/dist/esm/webmap.d.ts +3 -2
- package/dist/esm/webmap.js +39 -39
- package/dist/esm/webmap.js.map +1 -1
- package/dist/esm/webmappingapplication.d.ts +3 -2
- package/dist/esm/webmappingapplication.js +126 -128
- package/dist/esm/webmappingapplication.js.map +1 -1
- package/dist/esm/workforce.d.ts +3 -2
- package/dist/esm/workforce.js +4 -3
- package/dist/esm/workforce.js.map +1 -1
- package/dist/node/dashboard.d.ts +0 -1
- package/dist/node/dashboard.js +56 -57
- package/dist/node/dashboard.js.map +1 -1
- package/dist/node/helpers/convert-item-to-template.d.ts +3 -2
- package/dist/node/helpers/convert-item-to-template.js +43 -45
- package/dist/node/helpers/convert-item-to-template.js.map +1 -1
- package/dist/node/helpers/create-item-from-template.js +37 -45
- package/dist/node/helpers/create-item-from-template.js.map +1 -1
- package/dist/node/helpers/notebook-helpers.js +3 -3
- package/dist/node/helpers/notebook-helpers.js.map +1 -1
- package/dist/node/helpers/quickcapture-helpers.js +2 -2
- package/dist/node/helpers/quickcapture-helpers.js.map +1 -1
- package/dist/node/helpers/simple-type-helpers.js +2 -2
- package/dist/node/helpers/simple-type-helpers.js.map +1 -1
- package/dist/node/helpers/update-notebook-data.js +2 -2
- package/dist/node/helpers/update-notebook-data.js.map +1 -1
- package/dist/node/index.js +6 -6
- package/dist/node/index.js.map +1 -1
- package/dist/node/notebook.d.ts +3 -2
- package/dist/node/notebook.js +18 -17
- package/dist/node/notebook.js.map +1 -1
- package/dist/node/oic.d.ts +3 -2
- package/dist/node/oic.js +31 -30
- package/dist/node/oic.js.map +1 -1
- package/dist/node/quickcapture.d.ts +3 -2
- package/dist/node/quickcapture.js +24 -23
- package/dist/node/quickcapture.js.map +1 -1
- package/dist/node/simple-types.d.ts +3 -2
- package/dist/node/simple-types.js +9 -8
- package/dist/node/simple-types.js.map +1 -1
- package/dist/node/webmap.d.ts +3 -2
- package/dist/node/webmap.js +40 -40
- package/dist/node/webmap.js.map +1 -1
- package/dist/node/webmappingapplication.d.ts +3 -2
- package/dist/node/webmappingapplication.js +127 -129
- package/dist/node/webmappingapplication.js.map +1 -1
- package/dist/node/workforce.d.ts +3 -2
- package/dist/node/workforce.js +5 -4
- package/dist/node/workforce.js.map +1 -1
- package/dist/umd/dashboard.d.ts +0 -1
- package/dist/umd/helpers/convert-item-to-template.d.ts +3 -2
- package/dist/umd/notebook.d.ts +3 -2
- package/dist/umd/oic.d.ts +3 -2
- package/dist/umd/quickcapture.d.ts +3 -2
- package/dist/umd/simple-types.d.ts +3 -2
- package/dist/umd/simple-types.umd.js +2142 -2152
- package/dist/umd/simple-types.umd.js.map +1 -1
- package/dist/umd/simple-types.umd.min.js +3 -3
- package/dist/umd/simple-types.umd.min.js.map +1 -1
- package/dist/umd/webmap.d.ts +3 -2
- package/dist/umd/webmappingapplication.d.ts +3 -2
- package/dist/umd/workforce.d.ts +3 -2
- package/package.json +23 -23
|
@@ -19,11 +19,12 @@ import * as common from "@esri/solution-common";
|
|
|
19
19
|
*
|
|
20
20
|
* @param solutionItemId The solution to contain the template
|
|
21
21
|
* @param itemInfo Info about the item
|
|
22
|
-
* @param
|
|
22
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
23
24
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
24
25
|
* @return A promise that will resolve when the template has been created
|
|
25
26
|
*/
|
|
26
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
27
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
|
|
27
28
|
/**
|
|
28
29
|
* Converts an quick capture item to a template.
|
|
29
30
|
*
|
|
@@ -16,23 +16,24 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.postProcess = exports.createItemFromTemplate = exports._templatizeId = exports._templatizeUrl = exports._updateDependencies = exports._templatizeAdminEmail = exports._templatizeApplication = exports.convertQuickCaptureToTemplate = exports.convertItemToTemplate = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const common = require("@esri/solution-common");
|
|
20
|
+
const quickcaptureHelpers = require("./helpers/quickcapture-helpers");
|
|
21
21
|
//#region Publish Process ---------------------------------------------------------------------------------------//
|
|
22
22
|
/**
|
|
23
23
|
* Converts a Quick Capture item into a template.
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId The solution to contain the template
|
|
26
26
|
* @param itemInfo Info about the 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 of facts: folder id, org URL, adlib replacements
|
|
29
30
|
* @return A promise that will resolve when the template has been created
|
|
30
31
|
*/
|
|
31
|
-
function convertItemToTemplate(solutionItemId, itemInfo,
|
|
32
|
+
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
32
33
|
// Delegate back to simple-types, which will in-turn delegate
|
|
33
34
|
// to convertNotebookToTemplate at the correct point in the process
|
|
34
35
|
// This is a temporary refactor step
|
|
35
|
-
return quickcaptureHelpers.convertItemToTemplate(solutionItemId, itemInfo,
|
|
36
|
+
return quickcaptureHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
36
37
|
}
|
|
37
38
|
exports.convertItemToTemplate = convertItemToTemplate;
|
|
38
39
|
/**
|
|
@@ -42,25 +43,25 @@ exports.convertItemToTemplate = convertItemToTemplate;
|
|
|
42
43
|
* @return templatized itemTemplate
|
|
43
44
|
*/
|
|
44
45
|
function convertQuickCaptureToTemplate(itemTemplate) {
|
|
45
|
-
return new Promise(
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
46
47
|
// The templates data to process
|
|
47
|
-
|
|
48
|
+
const data = itemTemplate.data;
|
|
48
49
|
if (data && Array.isArray(data)) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
data.some(
|
|
50
|
+
let applicationRequest = Promise.resolve(null);
|
|
51
|
+
let applicationName = "";
|
|
52
|
+
data.some((item) => {
|
|
52
53
|
if (item.type === "application/json") {
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
applicationName = item.name;
|
|
55
|
+
applicationRequest = common.getBlobText(item);
|
|
55
56
|
return true;
|
|
56
57
|
}
|
|
57
58
|
});
|
|
58
|
-
|
|
59
|
+
applicationRequest.then(result => {
|
|
59
60
|
// replace the template data array with the templatized application JSON
|
|
60
61
|
itemTemplate.data = result
|
|
61
62
|
? {
|
|
62
63
|
application: _templatizeApplication(JSON.parse(result), itemTemplate),
|
|
63
|
-
name:
|
|
64
|
+
name: applicationName
|
|
64
65
|
}
|
|
65
66
|
: {};
|
|
66
67
|
resolve(itemTemplate);
|
|
@@ -85,10 +86,10 @@ function _templatizeApplication(data, itemTemplate) {
|
|
|
85
86
|
// Set the admin email
|
|
86
87
|
_templatizeAdminEmail(data);
|
|
87
88
|
// datasource item id and url
|
|
88
|
-
|
|
89
|
+
const dataSources = data.dataSources;
|
|
89
90
|
if (dataSources && Array.isArray(dataSources)) {
|
|
90
|
-
dataSources.forEach(
|
|
91
|
-
|
|
91
|
+
dataSources.forEach(ds => {
|
|
92
|
+
const id = ds.featureServiceItemId;
|
|
92
93
|
if (id) {
|
|
93
94
|
_updateDependencies(id, itemTemplate);
|
|
94
95
|
_templatizeUrl(ds, "featureServiceItemId", "url");
|
|
@@ -131,10 +132,10 @@ exports._updateDependencies = _updateDependencies;
|
|
|
131
132
|
* @param urlPath the path to the url property
|
|
132
133
|
*/
|
|
133
134
|
function _templatizeUrl(obj, idPath, urlPath) {
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
const id = common.getProp(obj, idPath);
|
|
136
|
+
const url = common.getProp(obj, urlPath);
|
|
136
137
|
if (url) {
|
|
137
|
-
|
|
138
|
+
const layerId = url.substr(url.lastIndexOf("/") + 1);
|
|
138
139
|
common.setProp(obj, urlPath, common.templatizeTerm(id, id, ".layer" + layerId + ".url"));
|
|
139
140
|
}
|
|
140
141
|
}
|
|
@@ -146,7 +147,7 @@ exports._templatizeUrl = _templatizeUrl;
|
|
|
146
147
|
* @param path the path to the id property
|
|
147
148
|
*/
|
|
148
149
|
function _templatizeId(obj, path) {
|
|
149
|
-
|
|
150
|
+
const id = common.getProp(obj, path);
|
|
150
151
|
if (id) {
|
|
151
152
|
common.setProp(obj, path, common.templatizeTerm(id, id, ".itemId"));
|
|
152
153
|
}
|
|
@@ -171,11 +172,11 @@ exports.createItemFromTemplate = createItemFromTemplate;
|
|
|
171
172
|
* @returns Promise resolving to successfulness of update
|
|
172
173
|
*/
|
|
173
174
|
function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
174
|
-
return new Promise(
|
|
175
|
+
return new Promise((resolve, reject) => {
|
|
175
176
|
template.data = common.replaceInTemplate(template.data, templateDictionary);
|
|
176
177
|
common
|
|
177
178
|
.updateItemTemplateFromDictionary(itemId, templateDictionary, authentication)
|
|
178
|
-
.then(
|
|
179
|
+
.then(() => {
|
|
179
180
|
common
|
|
180
181
|
.updateItemResourceText(itemId, template.data.name, JSON.stringify(template.data.application), authentication)
|
|
181
182
|
.then(resolve, reject);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickcapture.js","sourceRoot":"","sources":["../../src/quickcapture.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"quickcapture.js","sourceRoot":"","sources":["../../src/quickcapture.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,gDAAgD;AAChD,sEAAsE;AAEtE,mHAAmH;AAEnH;;;;;;;;;GASG;AACH,SAAgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,6DAA6D;IAC7D,mEAAmE;IACnE,oCAAoC;IACpC,OAAO,mBAAmB,CAAC,qBAAqB,CAC9C,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,CACnB,CAAC;AACJ,CAAC;AAjBD,sDAiBC;AAED;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,YAAkC;IAElC,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,gCAAgC;QAChC,MAAM,IAAI,GAAQ,YAAY,CAAC,IAAI,CAAC;QACpC,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC/B,IAAI,kBAAkB,GAAiB,OAAO,CAAC,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f,CAAC,CAAC,CAAC;AACL,CAAC;AA5BD,kCA4BC;AAED,YAAY"}
|
|
@@ -19,11 +19,12 @@ import { ICreateItemFromTemplateResponse, IDatasourceInfo, IItemProgressCallback
|
|
|
19
19
|
*
|
|
20
20
|
* @param solutionItemId The solution to contain the template
|
|
21
21
|
* @param itemInfo Info about the item
|
|
22
|
-
* @param
|
|
22
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
23
24
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
24
25
|
* @return A promise that will resolve when the template has been created
|
|
25
26
|
*/
|
|
26
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
27
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession, templateDictionary: any): Promise<IItemTemplate>;
|
|
27
28
|
/**
|
|
28
29
|
* Delegate to simpleType creator
|
|
29
30
|
*
|
|
@@ -21,23 +21,24 @@ exports.postProcess = exports.postProcessFieldReferences = exports.createItemFro
|
|
|
21
21
|
*
|
|
22
22
|
* @module simple-types
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const dashboard = require("./dashboard");
|
|
25
|
+
const webmap = require("./webmap");
|
|
26
|
+
const webmappingapplication = require("./webmappingapplication");
|
|
27
|
+
const solution_common_1 = require("@esri/solution-common");
|
|
28
28
|
// Need to import collectively to enable spying
|
|
29
|
-
|
|
29
|
+
const simpleTypeHelpers = require("./helpers/simple-type-helpers");
|
|
30
30
|
/**
|
|
31
31
|
* Converts an item into a template.
|
|
32
32
|
*
|
|
33
33
|
* @param solutionItemId The solution to contain the template
|
|
34
34
|
* @param itemInfo Info about the item
|
|
35
|
-
* @param
|
|
35
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
36
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
36
37
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
37
38
|
* @return A promise that will resolve when the template has been created
|
|
38
39
|
*/
|
|
39
|
-
function convertItemToTemplate(solutionItemId, itemInfo,
|
|
40
|
-
return simpleTypeHelpers.convertItemToTemplate(solutionItemId, itemInfo,
|
|
40
|
+
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
41
|
+
return simpleTypeHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
41
42
|
}
|
|
42
43
|
exports.convertItemToTemplate = convertItemToTemplate;
|
|
43
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-types.js","sourceRoot":"","sources":["../../src/simple-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":"simple-types.js","sourceRoot":"","sources":["../../src/simple-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,yCAAyC;AACzC,mCAAmC;AACnC,iEAAiE;AAEjE,2DAQ+B;AAE/B,+CAA+C;AAC/C,mEAAmE;AAEnE;;;;;;;;;GASG;AACH,SAAgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAA+B,EAC/B,iBAA8B,EAC9B,kBAAuB;IAEvB,OAAO,iBAAiB,CAAC,qBAAqB,CAC5C,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,CACnB,CAAC;AACJ,CAAC;AAdD,sDAcC;AAED;;;;;;;GAOG;AACH,SAAgB,sBAAsB,CACpC,QAAuB,EACvB,kBAAuB,EACvB,yBAAsC,EACtC,oBAA2C;IAE3C,OAAO,iBAAiB,CAAC,sBAAsB,CAC7C,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,CACrB,CAAC;AACJ,CAAC;AAZD,wDAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,0BAA0B,CACxC,gBAA+B,EAC/B,eAAkC,EAClC,IAAY;IAEZ,QAAQ,IAAI,EAAE;QACZ,KAAK,yBAAyB;YAC5B,qBAAqB,CAAC,0BAA0B,CAC9C,gBAAgB,EAChB,eAAe,CAChB,CAAC;YACF,MAAM;QACR,KAAK,WAAW;YACd,SAAS,CAAC,0BAA0B,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;YACxE,MAAM;QACR,KAAK,SAAS;YACZ,MAAM,CAAC,0BAA0B,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;YACrE,MAAM;KACT;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AApBD,gEAoBC;AAED;;;;;;;;;GASG;AACH,SAAgB,WAAW,CACzB,MAAc,EACd,IAAY,EACZ,SAAgB,EAChB,QAAuB,EACvB,SAA0B,EAC1B,kBAAuB,EACvB,cAA2B;IAE3B,OAAO,IAAA,kDAAgC,EACrC,MAAM,EACN,kBAAkB,EAClB,cAAc,CACf,CAAC;AACJ,CAAC;AAdD,kCAcC"}
|
package/dist/node/webmap.d.ts
CHANGED
|
@@ -18,10 +18,11 @@ import * as common from "@esri/solution-common";
|
|
|
18
18
|
* Converts an AGOL webmap item to a template.
|
|
19
19
|
*
|
|
20
20
|
* @param itemTemplate Template for the webmap item
|
|
21
|
-
* @param
|
|
21
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
22
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
22
23
|
* @return Template for the solution item that contains key details for item reconstruction
|
|
23
24
|
*/
|
|
24
|
-
export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate,
|
|
25
|
+
export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
25
26
|
/**
|
|
26
27
|
* Gets the ids of the dependencies of an AGOL webmap item.
|
|
27
28
|
*
|
package/dist/node/webmap.js
CHANGED
|
@@ -16,30 +16,31 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports._getDatasourceInfo = exports._templatize = exports._templatizeProperty = exports.postProcessFieldReferences = exports._templatizeWebmapLayerIdsAndUrls = exports._getLayerIds = exports._excludeInitialState = exports._extractDependencies = exports.convertItemToTemplate = void 0;
|
|
19
|
-
|
|
19
|
+
const common = require("@esri/solution-common");
|
|
20
20
|
/**
|
|
21
21
|
* The portion of a Webmap URL between the server and the map id.
|
|
22
22
|
*
|
|
23
23
|
* @protected
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
const WEBMAP_APP_URL_PART = "home/webmap/viewer.html?webmap=";
|
|
26
26
|
// ------------------------------------------------------------------------------------------------------------------ //
|
|
27
27
|
/**
|
|
28
28
|
* Converts an AGOL webmap item to a template.
|
|
29
29
|
*
|
|
30
30
|
* @param itemTemplate Template for the webmap item
|
|
31
|
-
* @param
|
|
31
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
32
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
32
33
|
* @return Template for the solution item that contains key details for item reconstruction
|
|
33
34
|
*/
|
|
34
|
-
function convertItemToTemplate(itemTemplate,
|
|
35
|
-
return new Promise(
|
|
35
|
+
function convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication) {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
36
37
|
// Templatize the app URL
|
|
37
38
|
itemTemplate.item.url =
|
|
38
39
|
common.checkUrlPathTermination(common.placeholder(common.SERVER_NAME)) +
|
|
39
40
|
WEBMAP_APP_URL_PART +
|
|
40
41
|
itemTemplate.item.id; // templatized id
|
|
41
42
|
// Extract dependencies
|
|
42
|
-
_extractDependencies(itemTemplate,
|
|
43
|
+
_extractDependencies(itemTemplate, srcAuthentication).then((results) => {
|
|
43
44
|
itemTemplate.dependencies = results.dependencies;
|
|
44
45
|
// Templatize the map layer ids after we've extracted them as dependencies
|
|
45
46
|
if (itemTemplate.data) {
|
|
@@ -49,7 +50,7 @@ function convertItemToTemplate(itemTemplate, authentication) {
|
|
|
49
50
|
_excludeInitialState(itemTemplate.data);
|
|
50
51
|
}
|
|
51
52
|
resolve(itemTemplate);
|
|
52
|
-
},
|
|
53
|
+
}, e => reject(common.fail(e)));
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
exports.convertItemToTemplate = convertItemToTemplate;
|
|
@@ -62,15 +63,15 @@ exports.convertItemToTemplate = convertItemToTemplate;
|
|
|
62
63
|
* @protected
|
|
63
64
|
*/
|
|
64
65
|
function _extractDependencies(itemTemplate, authentication) {
|
|
65
|
-
return new Promise(
|
|
66
|
-
|
|
66
|
+
return new Promise((resolve, reject) => {
|
|
67
|
+
const dependencies = [];
|
|
67
68
|
if (itemTemplate.data) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
_getLayerIds(layersAndTables, dependencies, authentication).then(
|
|
69
|
+
const layers = itemTemplate.data.operationalLayers || [];
|
|
70
|
+
const tables = itemTemplate.data.tables || [];
|
|
71
|
+
const layersAndTables = layers.concat(tables);
|
|
72
|
+
_getLayerIds(layersAndTables, dependencies, authentication).then(results => {
|
|
72
73
|
resolve(results);
|
|
73
|
-
},
|
|
74
|
+
}, e => reject(common.fail(e)));
|
|
74
75
|
}
|
|
75
76
|
else {
|
|
76
77
|
resolve({
|
|
@@ -105,18 +106,18 @@ exports._excludeInitialState = _excludeInitialState;
|
|
|
105
106
|
* @protected
|
|
106
107
|
*/
|
|
107
108
|
function _getLayerIds(layerList, dependencies, authentication) {
|
|
108
|
-
return new Promise(
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
return new Promise((resolve, reject) => {
|
|
110
|
+
const urlHash = {};
|
|
111
|
+
const options = {
|
|
111
112
|
f: "json",
|
|
112
113
|
authentication: authentication
|
|
113
114
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
const layerPromises = [];
|
|
116
|
+
const layerChecks = {};
|
|
117
|
+
const layers = layerList.filter(layer => {
|
|
117
118
|
if (layer.url && layer.url.indexOf("{{velocityUrl}}") < 0) {
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
const results = /.+FeatureServer/g.exec(layer.url);
|
|
120
|
+
const baseUrl = Array.isArray(results) && results.length > 0 ? results[0] : undefined;
|
|
120
121
|
if (baseUrl) {
|
|
121
122
|
// avoid redundant checks when we have a layer with subLayers
|
|
122
123
|
if (Object.keys(layerChecks).indexOf(baseUrl) < 0) {
|
|
@@ -134,10 +135,10 @@ function _getLayerIds(layerList, dependencies, authentication) {
|
|
|
134
135
|
}
|
|
135
136
|
});
|
|
136
137
|
if (layerPromises.length > 0) {
|
|
137
|
-
Promise.all(layerPromises).then(
|
|
138
|
-
serviceResponses.forEach(
|
|
138
|
+
Promise.all(layerPromises).then(serviceResponses => {
|
|
139
|
+
serviceResponses.forEach((serviceResponse, i) => {
|
|
139
140
|
if (common.getProp(serviceResponse, "serviceItemId")) {
|
|
140
|
-
|
|
141
|
+
const id = serviceResponse.serviceItemId;
|
|
141
142
|
if (dependencies.indexOf(id) < 0) {
|
|
142
143
|
dependencies.push(id);
|
|
143
144
|
}
|
|
@@ -148,7 +149,7 @@ function _getLayerIds(layerList, dependencies, authentication) {
|
|
|
148
149
|
dependencies: dependencies,
|
|
149
150
|
urlHash: urlHash
|
|
150
151
|
});
|
|
151
|
-
},
|
|
152
|
+
}, e => reject(common.fail(e)));
|
|
152
153
|
}
|
|
153
154
|
else {
|
|
154
155
|
resolve({
|
|
@@ -167,12 +168,11 @@ exports._getLayerIds = _getLayerIds;
|
|
|
167
168
|
* @return void
|
|
168
169
|
* @protected
|
|
169
170
|
*/
|
|
170
|
-
function _templatizeWebmapLayerIdsAndUrls(layerList, urlHash) {
|
|
171
|
-
|
|
172
|
-
layerList.forEach(function (layer) {
|
|
171
|
+
function _templatizeWebmapLayerIdsAndUrls(layerList = [], urlHash) {
|
|
172
|
+
layerList.forEach((layer) => {
|
|
173
173
|
if (layer.url) {
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
const layerId = layer.url.substr(layer.url.lastIndexOf("/") + 1);
|
|
175
|
+
const id = Object.keys(urlHash).indexOf(layer.url) > -1
|
|
176
176
|
? urlHash[layer.url]
|
|
177
177
|
: undefined;
|
|
178
178
|
if (id) {
|
|
@@ -191,12 +191,12 @@ exports._templatizeWebmapLayerIdsAndUrls = _templatizeWebmapLayerIdsAndUrls;
|
|
|
191
191
|
* @returns The solutionTemplate with templatized field references
|
|
192
192
|
*/
|
|
193
193
|
function postProcessFieldReferences(solutionTemplate, datasourceInfos) {
|
|
194
|
-
|
|
194
|
+
const paths = [
|
|
195
195
|
"data.operationalLayers",
|
|
196
196
|
"data.tables",
|
|
197
197
|
"data.applicationProperties.viewing.search.layers"
|
|
198
198
|
];
|
|
199
|
-
paths.forEach(
|
|
199
|
+
paths.forEach(p => _templatizeProperty(solutionTemplate, datasourceInfos, p));
|
|
200
200
|
return solutionTemplate;
|
|
201
201
|
}
|
|
202
202
|
exports.postProcessFieldReferences = postProcessFieldReferences;
|
|
@@ -208,7 +208,7 @@ exports.postProcessFieldReferences = postProcessFieldReferences;
|
|
|
208
208
|
* @param path A string path to the object property to templatize
|
|
209
209
|
*/
|
|
210
210
|
function _templatizeProperty(solutionTemplate, datasourceInfos, path) {
|
|
211
|
-
|
|
211
|
+
const objs = common.getProp(solutionTemplate, path);
|
|
212
212
|
if (objs) {
|
|
213
213
|
common.setProp(solutionTemplate, path, _templatize(objs, datasourceInfos));
|
|
214
214
|
}
|
|
@@ -222,10 +222,10 @@ exports._templatizeProperty = _templatizeProperty;
|
|
|
222
222
|
* @returns updated instances of the objects
|
|
223
223
|
*/
|
|
224
224
|
function _templatize(objs, datasourceInfos) {
|
|
225
|
-
objs.forEach(
|
|
226
|
-
|
|
225
|
+
objs.forEach(obj => {
|
|
226
|
+
const ds = _getDatasourceInfo(obj, datasourceInfos);
|
|
227
227
|
if (ds) {
|
|
228
|
-
|
|
228
|
+
const fieldNames = ds.fields.map(f => f.name);
|
|
229
229
|
common._templatizePopupInfo(obj, ds, ds.basePath, ds.itemId, fieldNames);
|
|
230
230
|
common._templatizeDefinitionEditor(obj, ds.basePath, fieldNames);
|
|
231
231
|
if (obj.layerDefinition) {
|
|
@@ -233,7 +233,7 @@ function _templatize(objs, datasourceInfos) {
|
|
|
233
233
|
common._templatizeDefinitionExpression(obj.layerDefinition, ds.basePath, fieldNames);
|
|
234
234
|
}
|
|
235
235
|
// used for applicationProperties search layers
|
|
236
|
-
|
|
236
|
+
const fieldName = common.getProp(obj, "field.name");
|
|
237
237
|
if (fieldName) {
|
|
238
238
|
common.setProp(obj, "field.name", common._templatizeFieldName(fieldName, obj, ds.itemId, ds.basePath));
|
|
239
239
|
}
|
|
@@ -250,8 +250,8 @@ exports._templatize = _templatize;
|
|
|
250
250
|
* @returns datasourceInfo for the given object id
|
|
251
251
|
*/
|
|
252
252
|
function _getDatasourceInfo(obj, datasourceInfos) {
|
|
253
|
-
|
|
254
|
-
datasourceInfos.some(
|
|
253
|
+
let datasourceInfo;
|
|
254
|
+
datasourceInfos.some(ds => {
|
|
255
255
|
if (ds.ids.indexOf(obj.id) > -1) {
|
|
256
256
|
datasourceInfo = ds;
|
|
257
257
|
return true;
|
package/dist/node/webmap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webmap.js","sourceRoot":"","sources":["../../src/webmap.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"webmap.js","sourceRoot":"","sources":["../../src/webmap.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,gDAAgD;AAEhD;;;;GAIG;AACH,MAAM,mBAAmB,GAAW,iCAAiC,CAAC;AAEtE,wHAAwH;AAExH;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,YAAkC,EAClC,kBAAsC,EACtC,iBAA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G,CAAC,eAAe,EACnB,EAAE,CAAC,QAAQ,EACX,UAAU,CACX,CAAC;aACH;YAED,+CAA+C;YAC/C,MAAM,SAAS,GAAQ,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YACzD,IAAI,SAAS,EAAE;gBACb,MAAM,CAAC,OAAO,CACZ,GAAG,EACH,YAAY,EACZ,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,CACpE,CAAC;aACH;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAxCD,kCAwCC;AAED;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAChC,GAAQ,EACR,eAAyC;IAEzC,IAAI,cAAmB,CAAC;IACxB,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;QACxB,IAAI,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;YAC/B,cAAc,GAAG,EAAE,CAAC;YACpB,OAAO,IAAI,CAAC;SACb;aAAM;YACL,OAAO,KAAK,CAAC;SACd;IACH,CAAC,CAAC,CAAC;IACH,OAAO,cAAc,CAAC;AACxB,CAAC;AAdD,gDAcC"}
|
|
@@ -18,10 +18,11 @@ import * as common from "@esri/solution-common";
|
|
|
18
18
|
* Converts a web mapping application item into a template.
|
|
19
19
|
*
|
|
20
20
|
* @param itemInfo Info about the item
|
|
21
|
-
* @param
|
|
21
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
22
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
22
23
|
* @return A promise that will resolve when the template has been created
|
|
23
24
|
*/
|
|
24
|
-
export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate,
|
|
25
|
+
export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
25
26
|
export declare function templatizeDatasources(itemTemplate: common.IItemTemplate, authentication: common.UserSession, portalUrl: string): Promise<common.IItemTemplate>;
|
|
26
27
|
export declare function templatizeWidgets(itemTemplate: common.IItemTemplate, authentication: common.UserSession, portalUrl: string, widgetPath: string, isOnScreen?: boolean): Promise<common.IItemTemplate>;
|
|
27
28
|
export declare function templatizeValues(itemTemplate: common.IItemTemplate, authentication: common.UserSession, portalUrl: string, widgetPath: string): Promise<common.IItemTemplate>;
|