@esri/solution-simple-types 4.1.2 → 5.0.1
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/cjs/dashboard.d.ts +93 -93
- package/dist/cjs/dashboard.js +352 -352
- package/dist/cjs/helpers/convert-item-to-template.d.ts +46 -46
- package/dist/cjs/helpers/convert-item-to-template.js +235 -209
- package/dist/cjs/helpers/convert-item-to-template.js.map +1 -1
- package/dist/cjs/helpers/create-item-from-template.d.ts +17 -17
- package/dist/cjs/helpers/create-item-from-template.js +153 -138
- package/dist/cjs/helpers/create-item-from-template.js.map +1 -1
- package/dist/cjs/helpers/notebook-helpers.d.ts +19 -19
- package/dist/cjs/helpers/notebook-helpers.js +24 -24
- package/dist/cjs/helpers/quickcapture-helpers.d.ts +18 -18
- package/dist/cjs/helpers/quickcapture-helpers.js +22 -22
- package/dist/cjs/helpers/simple-type-helpers.d.ts +18 -18
- package/dist/cjs/helpers/simple-type-helpers.js +22 -22
- package/dist/cjs/helpers/update-notebook-data.d.ts +17 -17
- package/dist/cjs/helpers/update-notebook-data.js +27 -27
- package/dist/cjs/index.d.ts +27 -27
- package/dist/cjs/index.js +36 -36
- package/dist/cjs/notebook.d.ts +66 -66
- package/dist/cjs/notebook.js +133 -133
- package/dist/cjs/oic.d.ts +53 -53
- package/dist/cjs/oic.js +170 -170
- package/dist/cjs/quickcapture.d.ts +76 -87
- package/dist/cjs/quickcapture.js +143 -192
- package/dist/cjs/quickcapture.js.map +1 -1
- package/dist/cjs/simple-types.d.ts +57 -57
- package/dist/cjs/simple-types.js +94 -94
- package/dist/cjs/webmap.d.ts +102 -102
- package/dist/cjs/webmap.js +325 -325
- package/dist/cjs/webmappingapplication.d.ts +176 -176
- package/dist/cjs/webmappingapplication.js +674 -674
- package/dist/cjs/webmappingapplication.js.map +1 -1
- package/dist/cjs/workforce.d.ts +34 -34
- package/dist/cjs/workforce.js +44 -44
- package/dist/esm/dashboard.d.ts +93 -93
- package/dist/esm/dashboard.js +339 -339
- package/dist/esm/helpers/convert-item-to-template.d.ts +46 -46
- package/dist/esm/helpers/convert-item-to-template.js +228 -202
- package/dist/esm/helpers/convert-item-to-template.js.map +1 -1
- package/dist/esm/helpers/create-item-from-template.d.ts +17 -17
- package/dist/esm/helpers/create-item-from-template.js +148 -133
- package/dist/esm/helpers/create-item-from-template.js.map +1 -1
- package/dist/esm/helpers/notebook-helpers.d.ts +19 -19
- package/dist/esm/helpers/notebook-helpers.js +20 -20
- package/dist/esm/helpers/quickcapture-helpers.d.ts +18 -18
- package/dist/esm/helpers/quickcapture-helpers.js +19 -19
- package/dist/esm/helpers/simple-type-helpers.d.ts +18 -18
- package/dist/esm/helpers/simple-type-helpers.js +19 -19
- package/dist/esm/helpers/update-notebook-data.d.ts +17 -17
- package/dist/esm/helpers/update-notebook-data.js +23 -23
- package/dist/esm/index.d.ts +27 -27
- package/dist/esm/index.js +27 -27
- package/dist/esm/notebook.d.ts +66 -66
- package/dist/esm/notebook.js +123 -123
- package/dist/esm/oic.d.ts +53 -53
- package/dist/esm/oic.js +162 -162
- package/dist/esm/quickcapture.d.ts +76 -87
- package/dist/esm/quickcapture.js +131 -179
- package/dist/esm/quickcapture.js.map +1 -1
- package/dist/esm/simple-types.d.ts +57 -57
- package/dist/esm/simple-types.js +86 -86
- package/dist/esm/webmap.d.ts +102 -102
- package/dist/esm/webmap.js +312 -312
- package/dist/esm/webmappingapplication.d.ts +176 -176
- package/dist/esm/webmappingapplication.js +648 -648
- package/dist/esm/webmappingapplication.js.map +1 -1
- package/dist/esm/workforce.d.ts +34 -34
- package/dist/esm/workforce.js +38 -38
- package/package.json +7 -7
package/dist/esm/quickcapture.js
CHANGED
|
@@ -1,180 +1,132 @@
|
|
|
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
|
-
import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
|
|
18
|
-
//#region Publish Process ---------------------------------------------------------------------------------------//
|
|
19
|
-
/**
|
|
20
|
-
* Converts a Quick Capture item into a template.
|
|
21
|
-
*
|
|
22
|
-
* @param solutionItemId The solution to contain the template
|
|
23
|
-
* @param itemInfo Info about the item
|
|
24
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
25
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
26
|
-
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
27
|
-
* @returns A promise that will resolve when the template has been created
|
|
28
|
-
*/
|
|
29
|
-
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
30
|
-
// Delegate back to simple-types, which will in-turn delegate
|
|
31
|
-
// to convertNotebookToTemplate at the correct point in the process
|
|
32
|
-
// This is a temporary refactor step
|
|
33
|
-
return quickcaptureHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Converts an quick capture item to a template.
|
|
37
|
-
*
|
|
38
|
-
* @param itemTemplate template for the quick capture project item
|
|
39
|
-
* @returns templatized itemTemplate
|
|
40
|
-
*/
|
|
41
|
-
export function convertQuickCaptureToTemplate(itemTemplate) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* @param
|
|
76
|
-
* @
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* @
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* @
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (url) {
|
|
133
|
-
const layerId = url.substr(url.lastIndexOf("/") + 1);
|
|
134
|
-
common.setProp(obj, urlPath, common.templatizeTerm(id, id, ".layer" + layerId + ".url"));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Templatize the item id property
|
|
139
|
-
*
|
|
140
|
-
* @param obj the datasource or object that contains the item id property
|
|
141
|
-
* @param path the path to the id property
|
|
142
|
-
* @private
|
|
143
|
-
*/
|
|
144
|
-
export function _templatizeId(obj, path) {
|
|
145
|
-
const id = common.getProp(obj, path);
|
|
146
|
-
if (id) {
|
|
147
|
-
common.setProp(obj, path, common.templatizeTerm(id, id, ".itemId"));
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region Deploy Process ---------------------------------------------------------------------------------------//
|
|
152
|
-
// Delegate back to simple-types
|
|
153
|
-
// This is a temporary refactor step
|
|
154
|
-
export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
155
|
-
return quickcaptureHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* QuickCapture post-processing actions
|
|
159
|
-
*
|
|
160
|
-
* @param {string} itemId The item ID
|
|
161
|
-
* @param {string} type The template type
|
|
162
|
-
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
163
|
-
* @param {any} templateDictionary The template dictionary
|
|
164
|
-
* @param {UserSession} authentication The destination session info
|
|
165
|
-
* @returns Promise resolving to successfulness of update
|
|
166
|
-
*/
|
|
167
|
-
export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
168
|
-
return new Promise((resolve, reject) => {
|
|
169
|
-
template.data = common.replaceInTemplate(template.data, templateDictionary);
|
|
170
|
-
common
|
|
171
|
-
.updateItemTemplateFromDictionary(itemId, templateDictionary, authentication)
|
|
172
|
-
.then(() => {
|
|
173
|
-
common
|
|
174
|
-
.updateItemResourceText(itemId, template.data.name, JSON.stringify(template.data.application), authentication)
|
|
175
|
-
.then(resolve, reject);
|
|
176
|
-
}, reject);
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
//#endregion
|
|
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
|
+
import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
|
|
18
|
+
//#region Publish Process ---------------------------------------------------------------------------------------//
|
|
19
|
+
/**
|
|
20
|
+
* Converts a Quick Capture item into a template.
|
|
21
|
+
*
|
|
22
|
+
* @param solutionItemId The solution to contain the template
|
|
23
|
+
* @param itemInfo Info about the item
|
|
24
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
25
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
26
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
27
|
+
* @returns A promise that will resolve when the template has been created
|
|
28
|
+
*/
|
|
29
|
+
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
30
|
+
// Delegate back to simple-types, which will in-turn delegate
|
|
31
|
+
// to convertNotebookToTemplate at the correct point in the process
|
|
32
|
+
// This is a temporary refactor step
|
|
33
|
+
return quickcaptureHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Converts an quick capture item to a template.
|
|
37
|
+
*
|
|
38
|
+
* @param itemTemplate template for the quick capture project item
|
|
39
|
+
* @returns templatized itemTemplate
|
|
40
|
+
*/
|
|
41
|
+
export function convertQuickCaptureToTemplate(itemTemplate) {
|
|
42
|
+
common.setProp(itemTemplate, "data.application", _templatizeApplication(itemTemplate.data.application, itemTemplate));
|
|
43
|
+
return itemTemplate;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Templatizes key properties for a quick capture project and gathers item dependencies
|
|
47
|
+
*
|
|
48
|
+
* @param data the projects json
|
|
49
|
+
* @param itemTemplate template for the quick capture project item
|
|
50
|
+
* @returns templatized itemTemplate
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
53
|
+
export function _templatizeApplication(data, itemTemplate) {
|
|
54
|
+
// Quick Project item id
|
|
55
|
+
_templatizeId(data, "itemId");
|
|
56
|
+
// Set the admin email
|
|
57
|
+
_templatizeAdminEmail(data);
|
|
58
|
+
// datasource item id and url
|
|
59
|
+
const dataSources = data?.dataSources;
|
|
60
|
+
if (dataSources && Array.isArray(dataSources)) {
|
|
61
|
+
dataSources.forEach(ds => {
|
|
62
|
+
const id = ds.featureServiceItemId;
|
|
63
|
+
if (id) {
|
|
64
|
+
_updateDependencies(id, itemTemplate);
|
|
65
|
+
_templatizeUrl(ds, "featureServiceItemId", "url");
|
|
66
|
+
_templatizeId(ds, "featureServiceItemId");
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return data;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Templatize the email property
|
|
74
|
+
*
|
|
75
|
+
* @param data the quick capture application
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
export function _templatizeAdminEmail(data) {
|
|
79
|
+
if (common.getProp(data, "preferences.adminEmail")) {
|
|
80
|
+
common.setProp(data, "preferences.adminEmail", "{{user.email}}");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Updates the templates dependencies list with unique item ids
|
|
85
|
+
*
|
|
86
|
+
* @param id the item id of the dependency
|
|
87
|
+
* @param itemTemplate template for the quick capture project item
|
|
88
|
+
* @returns templatized itemTemplate
|
|
89
|
+
*/
|
|
90
|
+
export function _updateDependencies(id, itemTemplate) {
|
|
91
|
+
if (itemTemplate.dependencies.indexOf(id) === -1) {
|
|
92
|
+
itemTemplate.dependencies.push(id);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Templatize a url property
|
|
97
|
+
*
|
|
98
|
+
* @param obj the datasource object
|
|
99
|
+
* @param idPath the path to the id property
|
|
100
|
+
* @param urlPath the path to the url property
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
export function _templatizeUrl(obj, idPath, urlPath) {
|
|
104
|
+
const id = common.getProp(obj, idPath);
|
|
105
|
+
const url = common.getProp(obj, urlPath);
|
|
106
|
+
if (url) {
|
|
107
|
+
const layerId = url.substr(url.lastIndexOf("/") + 1);
|
|
108
|
+
common.setProp(obj, urlPath, common.templatizeTerm(id, id, ".layer" + layerId + ".url"));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Templatize the item id property
|
|
113
|
+
*
|
|
114
|
+
* @param obj the datasource or object that contains the item id property
|
|
115
|
+
* @param path the path to the id property
|
|
116
|
+
* @private
|
|
117
|
+
*/
|
|
118
|
+
export function _templatizeId(obj, path) {
|
|
119
|
+
const id = common.getProp(obj, path);
|
|
120
|
+
if (id) {
|
|
121
|
+
common.setProp(obj, path, common.templatizeTerm(id, id, ".itemId"));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region Deploy Process ---------------------------------------------------------------------------------------//
|
|
126
|
+
// Delegate back to simple-types
|
|
127
|
+
// This is a temporary refactor step
|
|
128
|
+
export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
129
|
+
return quickcaptureHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
180
132
|
//# sourceMappingURL=quickcapture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickcapture.js","sourceRoot":"","sources":["../../src/quickcapture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,mBAAmB,MAAM,gCAAgC,CAAC;AAEtE,mHAAmH;AAEnH;;;;;;;;;GASG;AACH,MAAM,UAAU,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;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC3C,YAAkC;IAElC,
|
|
1
|
+
{"version":3,"file":"quickcapture.js","sourceRoot":"","sources":["../../src/quickcapture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,mBAAmB,MAAM,gCAAgC,CAAC;AAEtE,mHAAmH;AAEnH;;;;;;;;;GASG;AACH,MAAM,UAAU,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;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC3C,YAAkC;IAElC,MAAM,CAAC,OAAO,CAAC,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|
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 { 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>;
|
|
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 { 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/esm/simple-types.js
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2018 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Manages the creation and deployment of simple item types.
|
|
18
|
-
*
|
|
19
|
-
* @module simple-types
|
|
20
|
-
*/
|
|
21
|
-
import * as dashboard from "./dashboard";
|
|
22
|
-
import * as webmap from "./webmap";
|
|
23
|
-
import * as webmappingapplication from "./webmappingapplication";
|
|
24
|
-
import { updateItemTemplateFromDictionary } from "@esri/solution-common";
|
|
25
|
-
// Need to import collectively to enable spying
|
|
26
|
-
import * as simpleTypeHelpers from "./helpers/simple-type-helpers";
|
|
27
|
-
/**
|
|
28
|
-
* Converts an item into a template.
|
|
29
|
-
*
|
|
30
|
-
* @param solutionItemId The solution to contain the template
|
|
31
|
-
* @param itemInfo Info about the item
|
|
32
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
33
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
34
|
-
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
35
|
-
* @returns A promise that will resolve when the template has been created
|
|
36
|
-
*/
|
|
37
|
-
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
38
|
-
return simpleTypeHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Delegate to simpleType creator
|
|
42
|
-
*
|
|
43
|
-
* @param template
|
|
44
|
-
* @param templateDictionary
|
|
45
|
-
* @param destinationAuthentication
|
|
46
|
-
* @param itemProgressCallback
|
|
47
|
-
*/
|
|
48
|
-
export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
49
|
-
return simpleTypeHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Templatizes field references within specific template types.
|
|
53
|
-
* Currently only handles web mapping applications
|
|
54
|
-
*
|
|
55
|
-
* @param template A solution template
|
|
56
|
-
* @param datasourceInfos A list of objects that store key datasource info used to templatizing field references
|
|
57
|
-
* @param type The item type
|
|
58
|
-
* @returns The updated solution template
|
|
59
|
-
*/
|
|
60
|
-
export function postProcessFieldReferences(solutionTemplate, datasourceInfos, type) {
|
|
61
|
-
switch (type) {
|
|
62
|
-
case "Web Mapping Application":
|
|
63
|
-
webmappingapplication.postProcessFieldReferences(solutionTemplate, datasourceInfos);
|
|
64
|
-
break;
|
|
65
|
-
case "Dashboard":
|
|
66
|
-
dashboard.postProcessFieldReferences(solutionTemplate, datasourceInfos);
|
|
67
|
-
break;
|
|
68
|
-
case "Web Map":
|
|
69
|
-
webmap.postProcessFieldReferences(solutionTemplate, datasourceInfos);
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
return solutionTemplate;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Simple Type post-processing actions
|
|
76
|
-
*
|
|
77
|
-
* @param {string} itemId The item ID
|
|
78
|
-
* @param {string} type The template type
|
|
79
|
-
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
80
|
-
* @param {any} templateDictionary The template dictionary
|
|
81
|
-
* @param {UserSession} authentication The destination session info
|
|
82
|
-
* @returns Promise resolving to successfulness of update
|
|
83
|
-
*/
|
|
84
|
-
export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
85
|
-
return updateItemTemplateFromDictionary(itemId, templateDictionary, authentication);
|
|
86
|
-
}
|
|
1
|
+
/** @license
|
|
2
|
+
* Copyright 2018 Esri
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Manages the creation and deployment of simple item types.
|
|
18
|
+
*
|
|
19
|
+
* @module simple-types
|
|
20
|
+
*/
|
|
21
|
+
import * as dashboard from "./dashboard";
|
|
22
|
+
import * as webmap from "./webmap";
|
|
23
|
+
import * as webmappingapplication from "./webmappingapplication";
|
|
24
|
+
import { updateItemTemplateFromDictionary } from "@esri/solution-common";
|
|
25
|
+
// Need to import collectively to enable spying
|
|
26
|
+
import * as simpleTypeHelpers from "./helpers/simple-type-helpers";
|
|
27
|
+
/**
|
|
28
|
+
* Converts an item into a template.
|
|
29
|
+
*
|
|
30
|
+
* @param solutionItemId The solution to contain the template
|
|
31
|
+
* @param itemInfo Info about the item
|
|
32
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
33
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
34
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
35
|
+
* @returns A promise that will resolve when the template has been created
|
|
36
|
+
*/
|
|
37
|
+
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
38
|
+
return simpleTypeHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Delegate to simpleType creator
|
|
42
|
+
*
|
|
43
|
+
* @param template
|
|
44
|
+
* @param templateDictionary
|
|
45
|
+
* @param destinationAuthentication
|
|
46
|
+
* @param itemProgressCallback
|
|
47
|
+
*/
|
|
48
|
+
export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
49
|
+
return simpleTypeHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Templatizes field references within specific template types.
|
|
53
|
+
* Currently only handles web mapping applications
|
|
54
|
+
*
|
|
55
|
+
* @param template A solution template
|
|
56
|
+
* @param datasourceInfos A list of objects that store key datasource info used to templatizing field references
|
|
57
|
+
* @param type The item type
|
|
58
|
+
* @returns The updated solution template
|
|
59
|
+
*/
|
|
60
|
+
export function postProcessFieldReferences(solutionTemplate, datasourceInfos, type) {
|
|
61
|
+
switch (type) {
|
|
62
|
+
case "Web Mapping Application":
|
|
63
|
+
webmappingapplication.postProcessFieldReferences(solutionTemplate, datasourceInfos);
|
|
64
|
+
break;
|
|
65
|
+
case "Dashboard":
|
|
66
|
+
dashboard.postProcessFieldReferences(solutionTemplate, datasourceInfos);
|
|
67
|
+
break;
|
|
68
|
+
case "Web Map":
|
|
69
|
+
webmap.postProcessFieldReferences(solutionTemplate, datasourceInfos);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
return solutionTemplate;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Simple Type post-processing actions
|
|
76
|
+
*
|
|
77
|
+
* @param {string} itemId The item ID
|
|
78
|
+
* @param {string} type The template type
|
|
79
|
+
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
80
|
+
* @param {any} templateDictionary The template dictionary
|
|
81
|
+
* @param {UserSession} authentication The destination session info
|
|
82
|
+
* @returns Promise resolving to successfulness of update
|
|
83
|
+
*/
|
|
84
|
+
export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
85
|
+
return updateItemTemplateFromDictionary(itemId, templateDictionary, authentication);
|
|
86
|
+
}
|
|
87
87
|
//# sourceMappingURL=simple-types.js.map
|