@esri/solution-simple-types 3.0.0 → 3.1.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.
Files changed (69) hide show
  1. package/dist/esm/helpers/convert-item-to-template.js +1 -0
  2. package/dist/esm/helpers/convert-item-to-template.js.map +1 -1
  3. package/dist/esm/webmap.js +6 -5
  4. package/dist/esm/webmap.js.map +1 -1
  5. package/package.json +7 -7
  6. package/dist/node/dashboard.d.ts +0 -93
  7. package/dist/node/dashboard.js +0 -354
  8. package/dist/node/dashboard.js.map +0 -1
  9. package/dist/node/helpers/convert-item-to-template.d.ts +0 -39
  10. package/dist/node/helpers/convert-item-to-template.js +0 -184
  11. package/dist/node/helpers/convert-item-to-template.js.map +0 -1
  12. package/dist/node/helpers/create-item-from-template.d.ts +0 -17
  13. package/dist/node/helpers/create-item-from-template.js +0 -138
  14. package/dist/node/helpers/create-item-from-template.js.map +0 -1
  15. package/dist/node/helpers/notebook-helpers.d.ts +0 -19
  16. package/dist/node/helpers/notebook-helpers.js +0 -25
  17. package/dist/node/helpers/notebook-helpers.js.map +0 -1
  18. package/dist/node/helpers/quickcapture-helpers.d.ts +0 -18
  19. package/dist/node/helpers/quickcapture-helpers.js +0 -23
  20. package/dist/node/helpers/quickcapture-helpers.js.map +0 -1
  21. package/dist/node/helpers/simple-type-helpers.d.ts +0 -18
  22. package/dist/node/helpers/simple-type-helpers.js +0 -23
  23. package/dist/node/helpers/simple-type-helpers.js.map +0 -1
  24. package/dist/node/helpers/update-notebook-data.d.ts +0 -17
  25. package/dist/node/helpers/update-notebook-data.js +0 -28
  26. package/dist/node/helpers/update-notebook-data.js.map +0 -1
  27. package/dist/node/index.d.ts +0 -27
  28. package/dist/node/index.js +0 -37
  29. package/dist/node/index.js.map +0 -1
  30. package/dist/node/notebook.d.ts +0 -66
  31. package/dist/node/notebook.js +0 -134
  32. package/dist/node/notebook.js.map +0 -1
  33. package/dist/node/oic.d.ts +0 -53
  34. package/dist/node/oic.js +0 -171
  35. package/dist/node/oic.js.map +0 -1
  36. package/dist/node/quickcapture.d.ts +0 -87
  37. package/dist/node/quickcapture.js +0 -193
  38. package/dist/node/quickcapture.js.map +0 -1
  39. package/dist/node/simple-types.d.ts +0 -57
  40. package/dist/node/simple-types.js +0 -95
  41. package/dist/node/simple-types.js.map +0 -1
  42. package/dist/node/webmap.d.ts +0 -101
  43. package/dist/node/webmap.js +0 -273
  44. package/dist/node/webmap.js.map +0 -1
  45. package/dist/node/webmappingapplication.d.ts +0 -176
  46. package/dist/node/webmappingapplication.js +0 -675
  47. package/dist/node/webmappingapplication.js.map +0 -1
  48. package/dist/node/workforce.d.ts +0 -34
  49. package/dist/node/workforce.js +0 -45
  50. package/dist/node/workforce.js.map +0 -1
  51. package/dist/umd/simple-types/src/dashboard.d.ts +0 -93
  52. package/dist/umd/simple-types/src/helpers/convert-item-to-template.d.ts +0 -39
  53. package/dist/umd/simple-types/src/helpers/create-item-from-template.d.ts +0 -17
  54. package/dist/umd/simple-types/src/helpers/notebook-helpers.d.ts +0 -19
  55. package/dist/umd/simple-types/src/helpers/quickcapture-helpers.d.ts +0 -18
  56. package/dist/umd/simple-types/src/helpers/simple-type-helpers.d.ts +0 -18
  57. package/dist/umd/simple-types/src/helpers/update-notebook-data.d.ts +0 -17
  58. package/dist/umd/simple-types/src/index.d.ts +0 -27
  59. package/dist/umd/simple-types/src/notebook.d.ts +0 -66
  60. package/dist/umd/simple-types/src/oic.d.ts +0 -53
  61. package/dist/umd/simple-types/src/quickcapture.d.ts +0 -87
  62. package/dist/umd/simple-types/src/simple-types.d.ts +0 -57
  63. package/dist/umd/simple-types/src/webmap.d.ts +0 -101
  64. package/dist/umd/simple-types/src/webmappingapplication.d.ts +0 -176
  65. package/dist/umd/simple-types/src/workforce.d.ts +0 -34
  66. package/dist/umd/simple-types.umd.js +0 -2296
  67. package/dist/umd/simple-types.umd.js.map +0 -1
  68. package/dist/umd/simple-types.umd.min.js +0 -19
  69. package/dist/umd/simple-types.umd.min.js.map +0 -1
@@ -1,193 +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.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
- return new Promise((resolve, reject) => {
48
- // The templates data to process
49
- const data = itemTemplate.data;
50
- if (data && Array.isArray(data)) {
51
- let applicationRequest = Promise.resolve(null);
52
- let applicationName = "";
53
- data.some((item) => {
54
- if (item.type === "application/json") {
55
- applicationName = item.name;
56
- applicationRequest = common.getBlobText(item);
57
- return true;
58
- }
59
- });
60
- applicationRequest.then(result => {
61
- // replace the template data array with the templatized application JSON
62
- itemTemplate.data = result
63
- ? {
64
- application: _templatizeApplication(JSON.parse(result), itemTemplate),
65
- name: applicationName
66
- }
67
- : {};
68
- resolve(itemTemplate);
69
- }, reject);
70
- }
71
- else {
72
- resolve(itemTemplate);
73
- }
74
- });
75
- }
76
- exports.convertQuickCaptureToTemplate = convertQuickCaptureToTemplate;
77
- /**
78
- * Templatizes key properties for a quick capture project and gathers item dependencies
79
- *
80
- * @param data the projects json
81
- * @param itemTemplate template for the quick capture project item
82
- * @returns templatized itemTemplate
83
- * @private
84
- */
85
- function _templatizeApplication(data, itemTemplate) {
86
- // Quick Project item id
87
- _templatizeId(data, "itemId");
88
- // Set the admin email
89
- _templatizeAdminEmail(data);
90
- // datasource item id and url
91
- const dataSources = data.dataSources;
92
- if (dataSources && Array.isArray(dataSources)) {
93
- dataSources.forEach(ds => {
94
- const id = ds.featureServiceItemId;
95
- if (id) {
96
- _updateDependencies(id, itemTemplate);
97
- _templatizeUrl(ds, "featureServiceItemId", "url");
98
- _templatizeId(ds, "featureServiceItemId");
99
- }
100
- });
101
- }
102
- return data;
103
- }
104
- exports._templatizeApplication = _templatizeApplication;
105
- /**
106
- * Templatize the email property
107
- *
108
- * @param data the quick capture application
109
- * @private
110
- */
111
- function _templatizeAdminEmail(data) {
112
- if (common.getProp(data, "preferences.adminEmail")) {
113
- common.setProp(data, "preferences.adminEmail", "{{user.email}}");
114
- }
115
- }
116
- exports._templatizeAdminEmail = _templatizeAdminEmail;
117
- /**
118
- * Updates the templates dependencies list with unique item ids
119
- *
120
- * @param id the item id of the dependency
121
- * @param itemTemplate template for the quick capture project item
122
- * @returns templatized itemTemplate
123
- */
124
- function _updateDependencies(id, itemTemplate) {
125
- if (itemTemplate.dependencies.indexOf(id) === -1) {
126
- itemTemplate.dependencies.push(id);
127
- }
128
- }
129
- exports._updateDependencies = _updateDependencies;
130
- /**
131
- * Templatize a url property
132
- *
133
- * @param obj the datasource object
134
- * @param idPath the path to the id property
135
- * @param urlPath the path to the url property
136
- * @private
137
- */
138
- function _templatizeUrl(obj, idPath, urlPath) {
139
- const id = common.getProp(obj, idPath);
140
- const url = common.getProp(obj, urlPath);
141
- if (url) {
142
- const layerId = url.substr(url.lastIndexOf("/") + 1);
143
- common.setProp(obj, urlPath, common.templatizeTerm(id, id, ".layer" + layerId + ".url"));
144
- }
145
- }
146
- exports._templatizeUrl = _templatizeUrl;
147
- /**
148
- * Templatize the item id property
149
- *
150
- * @param obj the datasource or object that contains the item id property
151
- * @param path the path to the id property
152
- * @private
153
- */
154
- function _templatizeId(obj, path) {
155
- const id = common.getProp(obj, path);
156
- if (id) {
157
- common.setProp(obj, path, common.templatizeTerm(id, id, ".itemId"));
158
- }
159
- }
160
- exports._templatizeId = _templatizeId;
161
- //#endregion
162
- //#region Deploy Process ---------------------------------------------------------------------------------------//
163
- // Delegate back to simple-types
164
- // This is a temporary refactor step
165
- function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
166
- return quickcaptureHelpers.createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback);
167
- }
168
- exports.createItemFromTemplate = createItemFromTemplate;
169
- /**
170
- * QuickCapture post-processing actions
171
- *
172
- * @param {string} itemId The item ID
173
- * @param {string} type The template type
174
- * @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
175
- * @param {any} templateDictionary The template dictionary
176
- * @param {UserSession} authentication The destination session info
177
- * @returns Promise resolving to successfulness of update
178
- */
179
- function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
180
- return new Promise((resolve, reject) => {
181
- template.data = common.replaceInTemplate(template.data, templateDictionary);
182
- common
183
- .updateItemTemplateFromDictionary(itemId, templateDictionary, authentication)
184
- .then(() => {
185
- common
186
- .updateItemResourceText(itemId, template.data.name, JSON.stringify(template.data.application), authentication)
187
- .then(resolve, reject);
188
- }, reject);
189
- });
190
- }
191
- exports.postProcess = postProcess;
192
- //#endregion
193
- //# 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,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,OAAO,CAAC,IAAI,CAAC,CAAC;YAC7D,IAAI,eAAe,GAAW,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAU,EAAE,EAAE;gBACvB,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAAE;oBACpC,eAAe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CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;KACrE;AACH,CAAC;AALD,sCAKC;AAED,YAAY;AAEZ,kHAAkH;AAElH,gCAAgC;AAChC,oCAAoC;AACpC,SAAgB,sBAAsB,CACpC,QAA8B,EAC9B,kBAAuB,EACvB,yBAA6C,EAC7C,oBAAkD;IAElD,OAAO,mBAAmB,CAAC,sBAAsB,CAC/C,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,CACrB,CAAC;AACJ,CAAC;AAZD,wDAYC;AAED;;;;;;;;;GASG;AACH,SAAgB,WAAW,CACzB,MAAc,EACd,IAAY,EACZ,SAAgB,EAChB,QAA8B,EAC9B,SAAiC,EACjC,kBAAuB,EACvB,cAAkC;IAElC,OAAO,IAAI,OAAO,CAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,QAAQ,CAAC,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAC5E,MAAM;aACH,gCAAgC,CAC/B,MAAM,EACN,kBAAkB,EAClB,cAAc,CACf;aACA,IAAI,CAAC,GAAG,EAAE;YACT,MAAM;iBACH,sBAAsB,CACrB,MAAM,EACN,QAAQ,CAAC,IAAI,CAAC,IAAI,EAClB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EACzC,cAAc,CACf;iBACA,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3B,CAAC,EAAE,MAAM,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AA5BD,kCA4BC;AAED,YAAY"}
@@ -1,57 +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 { 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,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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;AAdD,kCAcC"}
@@ -1,101 +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 webmap item to a template.
19
- *
20
- * @param itemTemplate Template for the webmap item
21
- * @param destAuthentication Credentials for requests to the destination organization
22
- * @param srcAuthentication Credentials for requests to source items
23
- * @param templateDictionary Hash of key details used for variable replacement
24
- * @returns Template for the solution item that contains key details for item reconstruction
25
- */
26
- export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
27
- /**
28
- * Gets the ids of the dependencies of an AGOL webmap item.
29
- *
30
- * @param itemTemplate A webmap item whose dependencies are sought
31
- * @param authentication Credentials for any requests
32
- * @returns List of dependencies ids and url/itemId hash
33
- * @private
34
- */
35
- export declare function _extractDependencies(itemTemplate: common.IItemTemplate, authentication: common.UserSession): Promise<any>;
36
- /**
37
- * Remove the initialState prop from webmaps saved from the new map viewer.
38
- * This allows the map to use the item extent property that we templatize.
39
- *
40
- * Added for issue #662
41
- *
42
- * @param data the data for the web maps item template
43
- * @returns void
44
- * @private
45
- */
46
- export declare function _excludeInitialState(data: any): void;
47
- /**
48
- * Extracts the AGOL itemId for each layer or table object in a list using the url.
49
- *
50
- * @param layerList List of map layers or tables
51
- * @param dependencies Current list of dependencies
52
- * @param authentication Credentials for any requests
53
- * @returns List of dependencies ids and url/itemId hash
54
- * @private
55
- */
56
- export declare function _getLayerIds(layerList: any[], dependencies: string[], authentication: common.UserSession): Promise<any>;
57
- /**
58
- * Templatizes the url and item id for layers or tables within the webmap.
59
- *
60
- * @param layerList List of map layers or tables
61
- * @param urlHash Lookup object for analysis layers
62
- * @param templateDictionary Hash of key details used for variable replacement
63
- * @returns void
64
- * @private
65
- */
66
- export declare function _templatizeWebmapLayerIdsAndUrls(layerList: any[], urlHash: any, templateDictionary: any): void;
67
- /**
68
- * Templatize field references.
69
- *
70
- * @param solutionTemplate The solution item template
71
- * @param datasourceInfos A list of datasource info objects that contain key values to templatize field references
72
- * @returns The solutionTemplate with templatized field references
73
- */
74
- export declare function postProcessFieldReferences(solutionTemplate: common.IItemTemplate, datasourceInfos: common.IDatasourceInfo[]): common.IItemTemplate;
75
- /**
76
- * Templatize field references.
77
- *
78
- * @param solutionTemplate The solution item template
79
- * @param datasourceInfos A list of datasource info objects that contain key values to templatize field references
80
- * @param path A string path to the object property to templatize
81
- * @private
82
- */
83
- export declare function _templatizeProperty(solutionTemplate: common.IItemTemplate, datasourceInfos: common.IDatasourceInfo[], path: string): void;
84
- /**
85
- * Templatize field references.
86
- *
87
- * @param objs Can be operationalLayers or tables or appProperties search layers
88
- * @param datasourceInfos A list of datasource info objects that contain key values to templatize field references
89
- * @returns updated instances of the objects
90
- * @private
91
- */
92
- export declare function _templatize(objs: any[], datasourceInfos: common.IDatasourceInfo[]): any[];
93
- /**
94
- * Get datasourceInfo by map layer id
95
- *
96
- * @param obj Can be operationalLayer or table or appProperties search layer
97
- * @param datasourceInfos A list of datasource info objects that contain key values to templatize field references
98
- * @returns datasourceInfo for the given object id
99
- * @private
100
- */
101
- export declare function _getDatasourceInfo(obj: any, datasourceInfos: common.IDatasourceInfo[]): any;