@esri/solution-simple-types 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.
- package/README.md +4 -7
- package/dist/esm/helpers/convert-item-to-template.d.ts +1 -2
- package/dist/esm/helpers/convert-item-to-template.js +24 -14
- package/dist/esm/helpers/convert-item-to-template.js.map +1 -1
- package/dist/{cjs/helpers/create-item-from-template.d.ts → esm/helpers/formHelpers.d.ts} +11 -3
- package/dist/esm/helpers/formHelpers.js +53 -0
- package/dist/esm/helpers/formHelpers.js.map +1 -0
- package/dist/esm/notebook.d.ts +1 -2
- package/dist/esm/notebook.js +2 -3
- package/dist/esm/notebook.js.map +1 -1
- package/dist/esm/quickcapture.d.ts +1 -2
- package/dist/esm/quickcapture.js +2 -3
- package/dist/esm/quickcapture.js.map +1 -1
- package/dist/esm/simple-types.d.ts +1 -2
- package/dist/esm/simple-types.js +2 -3
- package/dist/esm/simple-types.js.map +1 -1
- package/package.json +7 -7
- package/dist/cjs/dashboard.d.ts +0 -93
- package/dist/cjs/dashboard.js +0 -353
- package/dist/cjs/dashboard.js.map +0 -1
- package/dist/cjs/helpers/convert-item-to-template.d.ts +0 -46
- package/dist/cjs/helpers/convert-item-to-template.js +0 -236
- package/dist/cjs/helpers/convert-item-to-template.js.map +0 -1
- package/dist/cjs/helpers/create-item-from-template.js +0 -154
- package/dist/cjs/helpers/create-item-from-template.js.map +0 -1
- package/dist/cjs/helpers/notebook-helpers.d.ts +0 -19
- package/dist/cjs/helpers/notebook-helpers.js +0 -25
- package/dist/cjs/helpers/notebook-helpers.js.map +0 -1
- package/dist/cjs/helpers/quickcapture-helpers.d.ts +0 -18
- package/dist/cjs/helpers/quickcapture-helpers.js +0 -23
- package/dist/cjs/helpers/quickcapture-helpers.js.map +0 -1
- package/dist/cjs/helpers/simple-type-helpers.d.ts +0 -18
- package/dist/cjs/helpers/simple-type-helpers.js +0 -23
- package/dist/cjs/helpers/simple-type-helpers.js.map +0 -1
- package/dist/cjs/helpers/update-notebook-data.d.ts +0 -17
- package/dist/cjs/helpers/update-notebook-data.js +0 -28
- package/dist/cjs/helpers/update-notebook-data.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -27
- package/dist/cjs/index.js +0 -37
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/notebook.d.ts +0 -66
- package/dist/cjs/notebook.js +0 -134
- package/dist/cjs/notebook.js.map +0 -1
- package/dist/cjs/oic.d.ts +0 -53
- package/dist/cjs/oic.js +0 -171
- package/dist/cjs/oic.js.map +0 -1
- package/dist/cjs/quickcapture.d.ts +0 -76
- package/dist/cjs/quickcapture.js +0 -144
- package/dist/cjs/quickcapture.js.map +0 -1
- package/dist/cjs/simple-types.d.ts +0 -57
- package/dist/cjs/simple-types.js +0 -95
- package/dist/cjs/simple-types.js.map +0 -1
- package/dist/cjs/webmap.d.ts +0 -102
- package/dist/cjs/webmap.js +0 -318
- package/dist/cjs/webmap.js.map +0 -1
- package/dist/cjs/webmappingapplication.d.ts +0 -176
- package/dist/cjs/webmappingapplication.js +0 -675
- package/dist/cjs/webmappingapplication.js.map +0 -1
- package/dist/cjs/workforce.d.ts +0 -34
- package/dist/cjs/workforce.js +0 -45
- package/dist/cjs/workforce.js.map +0 -1
package/dist/cjs/oic.d.ts
DELETED
|
@@ -1,53 +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
|
-
import * as common from "@esri/solution-common";
|
|
17
|
-
/**
|
|
18
|
-
* Converts an AGOL OIC (Oriented Imagery Catalog) item to a template.
|
|
19
|
-
*
|
|
20
|
-
* @param itemTemplate Template for the OIC (Oriented Imagery Catalog) item
|
|
21
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
22
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
23
|
-
* @returns Template for the solution item that contains key details for item reconstruction
|
|
24
|
-
*/
|
|
25
|
-
export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
26
|
-
/**
|
|
27
|
-
* Gets the ids of the dependencies of an AGOL OIC (Oriented Imagery Catalog) item.
|
|
28
|
-
*
|
|
29
|
-
* @param itemTemplate A OIC (Oriented Imagery Catalog) item whose dependencies are sought
|
|
30
|
-
* @param authentication Credentials for any requests
|
|
31
|
-
* @returns List of dependencies ids and url/itemId hash
|
|
32
|
-
* @private
|
|
33
|
-
*/
|
|
34
|
-
export declare function _extractDependencies(itemTemplate: common.IItemTemplate, authentication: common.UserSession): Promise<any>;
|
|
35
|
-
/**
|
|
36
|
-
* Extracts the AGOL itemId for each layer in a list using the url.
|
|
37
|
-
*
|
|
38
|
-
* @param layerURLs List of OIC layer URLs
|
|
39
|
-
* @param dependencies Current list of dependencies
|
|
40
|
-
* @param authentication Credentials for any requests
|
|
41
|
-
* @returns List of dependencies ids and url/itemId hash
|
|
42
|
-
* @private
|
|
43
|
-
*/
|
|
44
|
-
export declare function _getLayerIds(layerURLs: string[], dependencies: string[], authentication: common.UserSession): Promise<any>;
|
|
45
|
-
/**
|
|
46
|
-
* Templatizes the url and item id for a layer.
|
|
47
|
-
*
|
|
48
|
-
* @param layerURL OIC layer URL
|
|
49
|
-
* @param urlHash Lookup object for analysis layers
|
|
50
|
-
* @returns Templatized URL if layerURL is in the urlHash
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
export declare function _templatizeOicLayerUrl(layerURL: string, urlHash: any): string;
|
package/dist/cjs/oic.js
DELETED
|
@@ -1,171 +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._templatizeOicLayerUrl = exports._getLayerIds = exports._extractDependencies = exports.convertItemToTemplate = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const common = tslib_1.__importStar(require("@esri/solution-common"));
|
|
21
|
-
// ------------------------------------------------------------------------------------------------------------------ //
|
|
22
|
-
/**
|
|
23
|
-
* Converts an AGOL OIC (Oriented Imagery Catalog) item to a template.
|
|
24
|
-
*
|
|
25
|
-
* @param itemTemplate Template for the OIC (Oriented Imagery Catalog) item
|
|
26
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
27
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
28
|
-
* @returns Template for the solution item that contains key details for item reconstruction
|
|
29
|
-
*/
|
|
30
|
-
function convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication) {
|
|
31
|
-
return new Promise((resolve, reject) => {
|
|
32
|
-
// Extract dependencies
|
|
33
|
-
_extractDependencies(itemTemplate, srcAuthentication).then((results) => {
|
|
34
|
-
itemTemplate.dependencies = results.dependencies;
|
|
35
|
-
// Templatize the map layer ids after we've extracted them as dependencies
|
|
36
|
-
/* istanbul ignore else */
|
|
37
|
-
if (itemTemplate.data?.properties) {
|
|
38
|
-
itemTemplate.data.properties.ServiceURL = _templatizeOicLayerUrl(itemTemplate.data.properties.ServiceURL, results.urlHash);
|
|
39
|
-
itemTemplate.data.properties.OverviewURL = _templatizeOicLayerUrl(itemTemplate.data.properties.OverviewURL, results.urlHash);
|
|
40
|
-
}
|
|
41
|
-
resolve(itemTemplate);
|
|
42
|
-
}, e => reject(common.fail(e)));
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
exports.convertItemToTemplate = convertItemToTemplate;
|
|
46
|
-
/**
|
|
47
|
-
* Gets the ids of the dependencies of an AGOL OIC (Oriented Imagery Catalog) item.
|
|
48
|
-
*
|
|
49
|
-
* @param itemTemplate A OIC (Oriented Imagery Catalog) item whose dependencies are sought
|
|
50
|
-
* @param authentication Credentials for any requests
|
|
51
|
-
* @returns List of dependencies ids and url/itemId hash
|
|
52
|
-
* @private
|
|
53
|
-
*/
|
|
54
|
-
function _extractDependencies(itemTemplate, authentication) {
|
|
55
|
-
return new Promise((resolve, reject) => {
|
|
56
|
-
const dependencies = [];
|
|
57
|
-
if (itemTemplate.data?.properties) {
|
|
58
|
-
const layerURLs = [];
|
|
59
|
-
/* istanbul ignore else */
|
|
60
|
-
if (itemTemplate.data.properties.ServiceURL) {
|
|
61
|
-
layerURLs.push(itemTemplate.data.properties.ServiceURL);
|
|
62
|
-
}
|
|
63
|
-
/* istanbul ignore else */
|
|
64
|
-
if (itemTemplate.data.properties.OverviewURL &&
|
|
65
|
-
itemTemplate.data.properties.OverviewURL !==
|
|
66
|
-
itemTemplate.data.properties.ServiceURL) {
|
|
67
|
-
layerURLs.push(itemTemplate.data.properties.OverviewURL);
|
|
68
|
-
}
|
|
69
|
-
_getLayerIds(layerURLs, dependencies, authentication).then(results => {
|
|
70
|
-
resolve(results);
|
|
71
|
-
}, e => reject(common.fail(e)));
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
resolve({
|
|
75
|
-
dependencies: dependencies,
|
|
76
|
-
urlHash: {}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
exports._extractDependencies = _extractDependencies;
|
|
82
|
-
/**
|
|
83
|
-
* Extracts the AGOL itemId for each layer in a list using the url.
|
|
84
|
-
*
|
|
85
|
-
* @param layerURLs List of OIC layer URLs
|
|
86
|
-
* @param dependencies Current list of dependencies
|
|
87
|
-
* @param authentication Credentials for any requests
|
|
88
|
-
* @returns List of dependencies ids and url/itemId hash
|
|
89
|
-
* @private
|
|
90
|
-
*/
|
|
91
|
-
function _getLayerIds(layerURLs, dependencies, authentication) {
|
|
92
|
-
return new Promise((resolve, reject) => {
|
|
93
|
-
const urlHash = {};
|
|
94
|
-
const options = {
|
|
95
|
-
f: "json",
|
|
96
|
-
authentication: authentication
|
|
97
|
-
};
|
|
98
|
-
const layerPromises = [];
|
|
99
|
-
const layerChecks = {};
|
|
100
|
-
const filteredLayerURLs = layerURLs.filter(layerURL => {
|
|
101
|
-
if (layerURL) {
|
|
102
|
-
const results = /.+FeatureServer/g.exec(layerURL);
|
|
103
|
-
const baseUrl = Array.isArray(results) && results.length > 0 ? results[0] : undefined;
|
|
104
|
-
if (baseUrl) {
|
|
105
|
-
// avoid redundant checks when we have a layer with subLayers
|
|
106
|
-
/* istanbul ignore else */
|
|
107
|
-
if (Object.keys(layerChecks).indexOf(baseUrl) < 0) {
|
|
108
|
-
layerChecks[baseUrl] = common.rest_request(layerURL, options);
|
|
109
|
-
}
|
|
110
|
-
layerPromises.push(layerChecks[baseUrl]);
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
if (layerPromises.length > 0) {
|
|
122
|
-
Promise.all(layerPromises).then(serviceResponses => {
|
|
123
|
-
serviceResponses.forEach((serviceResponse, i) => {
|
|
124
|
-
/* istanbul ignore else */
|
|
125
|
-
if (common.getProp(serviceResponse, "serviceItemId")) {
|
|
126
|
-
const id = serviceResponse.serviceItemId;
|
|
127
|
-
/* istanbul ignore else */
|
|
128
|
-
if (dependencies.indexOf(id) < 0) {
|
|
129
|
-
dependencies.push(id);
|
|
130
|
-
}
|
|
131
|
-
urlHash[filteredLayerURLs[i]] = id;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
resolve({
|
|
135
|
-
dependencies: dependencies,
|
|
136
|
-
urlHash: urlHash
|
|
137
|
-
});
|
|
138
|
-
}, e => reject(common.fail(e)));
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
resolve({
|
|
142
|
-
dependencies: dependencies,
|
|
143
|
-
urlHash: urlHash
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
exports._getLayerIds = _getLayerIds;
|
|
149
|
-
/**
|
|
150
|
-
* Templatizes the url and item id for a layer.
|
|
151
|
-
*
|
|
152
|
-
* @param layerURL OIC layer URL
|
|
153
|
-
* @param urlHash Lookup object for analysis layers
|
|
154
|
-
* @returns Templatized URL if layerURL is in the urlHash
|
|
155
|
-
* @private
|
|
156
|
-
*/
|
|
157
|
-
function _templatizeOicLayerUrl(layerURL, urlHash) {
|
|
158
|
-
let templatizedURL = layerURL;
|
|
159
|
-
if (layerURL) {
|
|
160
|
-
const id = urlHash[layerURL];
|
|
161
|
-
if (id) {
|
|
162
|
-
const layerId = layerURL.substr(layerURL.lastIndexOf("/") + 1);
|
|
163
|
-
templatizedURL = common.templatizeTerm(id, id, ".layer" + layerId + ".url");
|
|
164
|
-
}
|
|
165
|
-
// replace everything up until /home with portalBaseUrl var and templatize the itemId
|
|
166
|
-
templatizedURL = common.templatizeIds(templatizedURL.replace(/.+?(?=\/home)/, "{{portalBaseUrl}}"));
|
|
167
|
-
}
|
|
168
|
-
return templatizedURL;
|
|
169
|
-
}
|
|
170
|
-
exports._templatizeOicLayerUrl = _templatizeOicLayerUrl;
|
|
171
|
-
//# sourceMappingURL=oic.js.map
|
package/dist/cjs/oic.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oic.js","sourceRoot":"","sources":["../../src/oic.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,sEAAgD;AAEhD,wHAAwH;AAExH;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,YAAkC,EAClC,kBAAsC,EACtC,iBAAqC;IAErC,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,uBAAuB;QACvB,oBAAoB,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC,IAAI,CACxD,CAAC,OAAY,EAAE,EAAE;YACf,YAAY,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;YAEjD,0EAA0E;YAC1E,0BAA0B;YAC1B,IAAI,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE;gBACjC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,sBAAsB,CAC9D,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,EACvC,OAAO,CAAC,OAAO,CAChB,CAAC;gBACF,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,sBAAsB,CAC/D,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EACxC,OAAO,CAAC,OAAO,CAChB,CAAC;aACH;YAED,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,CAAC,EACD,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAC5B,CAAC;IACJ,CAA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AmB,CAAC,CAC7D,CAAC;KACH;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAnBD,wDAmBC"}
|
|
@@ -1,76 +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
|
-
import * as common from "@esri/solution-common";
|
|
17
|
-
/**
|
|
18
|
-
* Converts a Quick Capture item into a template.
|
|
19
|
-
*
|
|
20
|
-
* @param solutionItemId The solution to contain the template
|
|
21
|
-
* @param itemInfo Info about the item
|
|
22
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
24
|
-
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
25
|
-
* @returns A promise that will resolve when the template has been created
|
|
26
|
-
*/
|
|
27
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
|
|
28
|
-
/**
|
|
29
|
-
* Converts an quick capture item to a template.
|
|
30
|
-
*
|
|
31
|
-
* @param itemTemplate template for the quick capture project item
|
|
32
|
-
* @returns templatized itemTemplate
|
|
33
|
-
*/
|
|
34
|
-
export declare function convertQuickCaptureToTemplate(itemTemplate: common.IItemTemplate): common.IItemTemplate;
|
|
35
|
-
/**
|
|
36
|
-
* Templatizes key properties for a quick capture project and gathers item dependencies
|
|
37
|
-
*
|
|
38
|
-
* @param data the projects json
|
|
39
|
-
* @param itemTemplate template for the quick capture project item
|
|
40
|
-
* @returns templatized itemTemplate
|
|
41
|
-
* @private
|
|
42
|
-
*/
|
|
43
|
-
export declare function _templatizeApplication(data: any, itemTemplate: common.IItemTemplate): any;
|
|
44
|
-
/**
|
|
45
|
-
* Templatize the email property
|
|
46
|
-
*
|
|
47
|
-
* @param data the quick capture application
|
|
48
|
-
* @private
|
|
49
|
-
*/
|
|
50
|
-
export declare function _templatizeAdminEmail(data: any): void;
|
|
51
|
-
/**
|
|
52
|
-
* Updates the templates dependencies list with unique item ids
|
|
53
|
-
*
|
|
54
|
-
* @param id the item id of the dependency
|
|
55
|
-
* @param itemTemplate template for the quick capture project item
|
|
56
|
-
* @returns templatized itemTemplate
|
|
57
|
-
*/
|
|
58
|
-
export declare function _updateDependencies(id: string, itemTemplate: common.IItemTemplate): void;
|
|
59
|
-
/**
|
|
60
|
-
* Templatize a url property
|
|
61
|
-
*
|
|
62
|
-
* @param obj the datasource object
|
|
63
|
-
* @param idPath the path to the id property
|
|
64
|
-
* @param urlPath the path to the url property
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
export declare function _templatizeUrl(obj: any, idPath: string, urlPath: string): void;
|
|
68
|
-
/**
|
|
69
|
-
* Templatize the item id property
|
|
70
|
-
*
|
|
71
|
-
* @param obj the datasource or object that contains the item id property
|
|
72
|
-
* @param path the path to the id property
|
|
73
|
-
* @private
|
|
74
|
-
*/
|
|
75
|
-
export declare function _templatizeId(obj: any, path: string): void;
|
|
76
|
-
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
package/dist/cjs/quickcapture.js
DELETED
|
@@ -1,144 +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.createItemFromTemplate = exports._templatizeId = exports._templatizeUrl = exports._updateDependencies = exports._templatizeAdminEmail = exports._templatizeApplication = exports.convertQuickCaptureToTemplate = exports.convertItemToTemplate = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const common = tslib_1.__importStar(require("@esri/solution-common"));
|
|
21
|
-
const quickcaptureHelpers = tslib_1.__importStar(require("./helpers/quickcapture-helpers"));
|
|
22
|
-
//#region Publish Process ---------------------------------------------------------------------------------------//
|
|
23
|
-
/**
|
|
24
|
-
* Converts a Quick Capture item into a template.
|
|
25
|
-
*
|
|
26
|
-
* @param solutionItemId The solution to contain the template
|
|
27
|
-
* @param itemInfo Info about the item
|
|
28
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
29
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
30
|
-
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
31
|
-
* @returns A promise that will resolve when the template has been created
|
|
32
|
-
*/
|
|
33
|
-
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
34
|
-
// Delegate back to simple-types, which will in-turn delegate
|
|
35
|
-
// to convertNotebookToTemplate at the correct point in the process
|
|
36
|
-
// This is a temporary refactor step
|
|
37
|
-
return quickcaptureHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
38
|
-
}
|
|
39
|
-
exports.convertItemToTemplate = convertItemToTemplate;
|
|
40
|
-
/**
|
|
41
|
-
* Converts an quick capture item to a template.
|
|
42
|
-
*
|
|
43
|
-
* @param itemTemplate template for the quick capture project item
|
|
44
|
-
* @returns templatized itemTemplate
|
|
45
|
-
*/
|
|
46
|
-
function convertQuickCaptureToTemplate(itemTemplate) {
|
|
47
|
-
common.setProp(itemTemplate, "data.application", _templatizeApplication(itemTemplate.data.application, itemTemplate));
|
|
48
|
-
return itemTemplate;
|
|
49
|
-
}
|
|
50
|
-
exports.convertQuickCaptureToTemplate = convertQuickCaptureToTemplate;
|
|
51
|
-
/**
|
|
52
|
-
* Templatizes key properties for a quick capture project and gathers item dependencies
|
|
53
|
-
*
|
|
54
|
-
* @param data the projects json
|
|
55
|
-
* @param itemTemplate template for the quick capture project item
|
|
56
|
-
* @returns templatized itemTemplate
|
|
57
|
-
* @private
|
|
58
|
-
*/
|
|
59
|
-
function _templatizeApplication(data, itemTemplate) {
|
|
60
|
-
// Quick Project item id
|
|
61
|
-
_templatizeId(data, "itemId");
|
|
62
|
-
// Set the admin email
|
|
63
|
-
_templatizeAdminEmail(data);
|
|
64
|
-
// datasource item id and url
|
|
65
|
-
const dataSources = data?.dataSources;
|
|
66
|
-
if (dataSources && Array.isArray(dataSources)) {
|
|
67
|
-
dataSources.forEach(ds => {
|
|
68
|
-
const id = ds.featureServiceItemId;
|
|
69
|
-
if (id) {
|
|
70
|
-
_updateDependencies(id, itemTemplate);
|
|
71
|
-
_templatizeUrl(ds, "featureServiceItemId", "url");
|
|
72
|
-
_templatizeId(ds, "featureServiceItemId");
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return data;
|
|
77
|
-
}
|
|
78
|
-
exports._templatizeApplication = _templatizeApplication;
|
|
79
|
-
/**
|
|
80
|
-
* Templatize the email property
|
|
81
|
-
*
|
|
82
|
-
* @param data the quick capture application
|
|
83
|
-
* @private
|
|
84
|
-
*/
|
|
85
|
-
function _templatizeAdminEmail(data) {
|
|
86
|
-
if (common.getProp(data, "preferences.adminEmail")) {
|
|
87
|
-
common.setProp(data, "preferences.adminEmail", "{{user.email}}");
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports._templatizeAdminEmail = _templatizeAdminEmail;
|
|
91
|
-
/**
|
|
92
|
-
* Updates the templates dependencies list with unique item ids
|
|
93
|
-
*
|
|
94
|
-
* @param id the item id of the dependency
|
|
95
|
-
* @param itemTemplate template for the quick capture project item
|
|
96
|
-
* @returns templatized itemTemplate
|
|
97
|
-
*/
|
|
98
|
-
function _updateDependencies(id, itemTemplate) {
|
|
99
|
-
if (itemTemplate.dependencies.indexOf(id) === -1) {
|
|
100
|
-
itemTemplate.dependencies.push(id);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
exports._updateDependencies = _updateDependencies;
|
|
104
|
-
/**
|
|
105
|
-
* Templatize a url property
|
|
106
|
-
*
|
|
107
|
-
* @param obj the datasource object
|
|
108
|
-
* @param idPath the path to the id property
|
|
109
|
-
* @param urlPath the path to the url property
|
|
110
|
-
* @private
|
|
111
|
-
*/
|
|
112
|
-
function _templatizeUrl(obj, idPath, urlPath) {
|
|
113
|
-
const id = common.getProp(obj, idPath);
|
|
114
|
-
const url = common.getProp(obj, urlPath);
|
|
115
|
-
if (url) {
|
|
116
|
-
const layerId = url.substr(url.lastIndexOf("/") + 1);
|
|
117
|
-
common.setProp(obj, urlPath, common.templatizeTerm(id, id, ".layer" + layerId + ".url"));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
exports._templatizeUrl = _templatizeUrl;
|
|
121
|
-
/**
|
|
122
|
-
* Templatize the item id property
|
|
123
|
-
*
|
|
124
|
-
* @param obj the datasource or object that contains the item id property
|
|
125
|
-
* @param path the path to the id property
|
|
126
|
-
* @private
|
|
127
|
-
*/
|
|
128
|
-
function _templatizeId(obj, path) {
|
|
129
|
-
const id = common.getProp(obj, path);
|
|
130
|
-
if (id) {
|
|
131
|
-
common.setProp(obj, path, common.templatizeTerm(id, id, ".itemId"));
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports._templatizeId = _templatizeId;
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region Deploy Process ---------------------------------------------------------------------------------------//
|
|
137
|
-
// Delegate back to simple-types
|
|
138
|
-
// This is a temporary refactor step
|
|
139
|
-
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
140
|
-
return quickcaptureHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
|
|
141
|
-
}
|
|
142
|
-
exports.createItemFromTemplate = createItemFromTemplate;
|
|
143
|
-
//#endregion
|
|
144
|
-
//# sourceMappingURL=quickcapture.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quickcapture.js","sourceRoot":"","sources":["../../src/quickcapture.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,sEAAgD;AAChD,4FAAsE;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,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,kBAAkB,EAC7C,sBAAsB,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,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 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
|
-
import { ICreateItemFromTemplateResponse, IDatasourceInfo, IItemProgressCallback, IItemTemplate, IUpdateItemResponse, UserSession } from "@esri/solution-common";
|
|
17
|
-
/**
|
|
18
|
-
* Converts an item into a template.
|
|
19
|
-
*
|
|
20
|
-
* @param solutionItemId The solution to contain the template
|
|
21
|
-
* @param itemInfo Info about the item
|
|
22
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
24
|
-
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
25
|
-
* @returns A promise that will resolve when the template has been created
|
|
26
|
-
*/
|
|
27
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession, templateDictionary: any): Promise<IItemTemplate>;
|
|
28
|
-
/**
|
|
29
|
-
* Delegate to simpleType creator
|
|
30
|
-
*
|
|
31
|
-
* @param template
|
|
32
|
-
* @param templateDictionary
|
|
33
|
-
* @param destinationAuthentication
|
|
34
|
-
* @param itemProgressCallback
|
|
35
|
-
*/
|
|
36
|
-
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
37
|
-
/**
|
|
38
|
-
* Templatizes field references within specific template types.
|
|
39
|
-
* Currently only handles web mapping applications
|
|
40
|
-
*
|
|
41
|
-
* @param template A solution template
|
|
42
|
-
* @param datasourceInfos A list of objects that store key datasource info used to templatizing field references
|
|
43
|
-
* @param type The item type
|
|
44
|
-
* @returns The updated solution template
|
|
45
|
-
*/
|
|
46
|
-
export declare function postProcessFieldReferences(solutionTemplate: IItemTemplate, datasourceInfos: IDatasourceInfo[], type: string): IItemTemplate;
|
|
47
|
-
/**
|
|
48
|
-
* Simple Type post-processing actions
|
|
49
|
-
*
|
|
50
|
-
* @param {string} itemId The item ID
|
|
51
|
-
* @param {string} type The template type
|
|
52
|
-
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
53
|
-
* @param {any} templateDictionary The template dictionary
|
|
54
|
-
* @param {UserSession} authentication The destination session info
|
|
55
|
-
* @returns Promise resolving to successfulness of update
|
|
56
|
-
*/
|
|
57
|
-
export declare function postProcess(itemId: string, type: string, itemInfos: any[], template: IItemTemplate, templates: IItemTemplate[], templateDictionary: any, authentication: UserSession): Promise<IUpdateItemResponse>;
|
package/dist/cjs/simple-types.js
DELETED
|
@@ -1,95 +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.postProcess = exports.postProcessFieldReferences = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
/**
|
|
21
|
-
* Manages the creation and deployment of simple item types.
|
|
22
|
-
*
|
|
23
|
-
* @module simple-types
|
|
24
|
-
*/
|
|
25
|
-
const dashboard = tslib_1.__importStar(require("./dashboard"));
|
|
26
|
-
const webmap = tslib_1.__importStar(require("./webmap"));
|
|
27
|
-
const webmappingapplication = tslib_1.__importStar(require("./webmappingapplication"));
|
|
28
|
-
const solution_common_1 = require("@esri/solution-common");
|
|
29
|
-
// Need to import collectively to enable spying
|
|
30
|
-
const simpleTypeHelpers = tslib_1.__importStar(require("./helpers/simple-type-helpers"));
|
|
31
|
-
/**
|
|
32
|
-
* Converts an item into a template.
|
|
33
|
-
*
|
|
34
|
-
* @param solutionItemId The solution to contain the template
|
|
35
|
-
* @param itemInfo Info about the item
|
|
36
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
37
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
38
|
-
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
39
|
-
* @returns A promise that will resolve when the template has been created
|
|
40
|
-
*/
|
|
41
|
-
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
42
|
-
return simpleTypeHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
43
|
-
}
|
|
44
|
-
exports.convertItemToTemplate = convertItemToTemplate;
|
|
45
|
-
/**
|
|
46
|
-
* Delegate to simpleType creator
|
|
47
|
-
*
|
|
48
|
-
* @param template
|
|
49
|
-
* @param templateDictionary
|
|
50
|
-
* @param destinationAuthentication
|
|
51
|
-
* @param itemProgressCallback
|
|
52
|
-
*/
|
|
53
|
-
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
54
|
-
return simpleTypeHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
|
|
55
|
-
}
|
|
56
|
-
exports.createItemFromTemplate = createItemFromTemplate;
|
|
57
|
-
/**
|
|
58
|
-
* Templatizes field references within specific template types.
|
|
59
|
-
* Currently only handles web mapping applications
|
|
60
|
-
*
|
|
61
|
-
* @param template A solution template
|
|
62
|
-
* @param datasourceInfos A list of objects that store key datasource info used to templatizing field references
|
|
63
|
-
* @param type The item type
|
|
64
|
-
* @returns The updated solution template
|
|
65
|
-
*/
|
|
66
|
-
function postProcessFieldReferences(solutionTemplate, datasourceInfos, type) {
|
|
67
|
-
switch (type) {
|
|
68
|
-
case "Web Mapping Application":
|
|
69
|
-
webmappingapplication.postProcessFieldReferences(solutionTemplate, datasourceInfos);
|
|
70
|
-
break;
|
|
71
|
-
case "Dashboard":
|
|
72
|
-
dashboard.postProcessFieldReferences(solutionTemplate, datasourceInfos);
|
|
73
|
-
break;
|
|
74
|
-
case "Web Map":
|
|
75
|
-
webmap.postProcessFieldReferences(solutionTemplate, datasourceInfos);
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
return solutionTemplate;
|
|
79
|
-
}
|
|
80
|
-
exports.postProcessFieldReferences = postProcessFieldReferences;
|
|
81
|
-
/**
|
|
82
|
-
* Simple Type post-processing actions
|
|
83
|
-
*
|
|
84
|
-
* @param {string} itemId The item ID
|
|
85
|
-
* @param {string} type The template type
|
|
86
|
-
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
87
|
-
* @param {any} templateDictionary The template dictionary
|
|
88
|
-
* @param {UserSession} authentication The destination session info
|
|
89
|
-
* @returns Promise resolving to successfulness of update
|
|
90
|
-
*/
|
|
91
|
-
function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
92
|
-
return (0, solution_common_1.updateItemTemplateFromDictionary)(itemId, templateDictionary, authentication);
|
|
93
|
-
}
|
|
94
|
-
exports.postProcess = postProcess;
|
|
95
|
-
//# sourceMappingURL=simple-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-types.js","sourceRoot":"","sources":["../../src/simple-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,+DAAyC;AACzC,yDAAmC;AACnC,uFAAiE;AAEjE,2DAQ+B;AAE/B,+CAA+C;AAC/C,yFAAmE;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,S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