@esri/solution-creator 4.1.2 → 5.0.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.
@@ -1,196 +1,196 @@
1
- "use strict";
2
- /** @license
3
- * Copyright 2020 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.moduleMap = exports.UNSUPPORTED = void 0;
19
- const tslib_1 = require("tslib");
20
- const featureLayer = tslib_1.__importStar(require("@esri/solution-feature-layer"));
21
- const fileProcessor = tslib_1.__importStar(require("@esri/solution-file"));
22
- const formProcessor = tslib_1.__importStar(require("@esri/solution-form"));
23
- const group = tslib_1.__importStar(require("@esri/solution-group"));
24
- const solution_simple_types_1 = require("@esri/solution-simple-types");
25
- const solution_storymap_1 = require("@esri/solution-storymap");
26
- const solution_velocity_1 = require("@esri/solution-velocity");
27
- const solution_web_experience_1 = require("@esri/solution-web-experience");
28
- const solution_hub_types_1 = require("@esri/solution-hub-types");
29
- exports.UNSUPPORTED = null;
30
- /**
31
- * Mapping from item type to module with type-specific template-handling code.
32
- * AGO types come from a blend of arcgis-portal-app\src\js\arcgisonline\pages\item\_Info.js and
33
- * arcgis-portal-app\src\js\arcgis-components\src\_utils\metadata\item\displayName.ts
34
- */
35
- exports.moduleMap = {
36
- ////////////////////////////////////////////////////////
37
- // Group type
38
- Group: group,
39
- ////////////////////////////////////////////////////////
40
- // Layer types
41
- "Big Data Analytic": solution_velocity_1.VelocityProcessor,
42
- "Feature Collection": solution_simple_types_1.simpleTypes,
43
- "Feature Service": featureLayer,
44
- Feed: solution_velocity_1.VelocityProcessor,
45
- "Geocoding Service": undefined,
46
- "Geodata Service": undefined,
47
- "Geometry Service": undefined,
48
- "Geoprocessing Service": undefined,
49
- "Globe Service": undefined,
50
- "Image Service": undefined,
51
- KML: undefined,
52
- "Map Service": featureLayer,
53
- "Network Analysis Service": undefined,
54
- "Real Time Analytic": solution_velocity_1.VelocityProcessor,
55
- "Relational Database Connection": undefined,
56
- "Scene Service": undefined,
57
- "Stream Service": undefined,
58
- Tool: undefined,
59
- "Vector Tile Service": solution_simple_types_1.simpleTypes,
60
- WFS: undefined,
61
- WMS: undefined,
62
- WMTS: undefined,
63
- "Workflow Manager Service": undefined,
64
- ////////////////////////////////////////////////////////
65
- // Map types
66
- "3D Web Scene": undefined,
67
- "Web Map": solution_simple_types_1.simpleTypes,
68
- "Web Scene": solution_simple_types_1.simpleTypes,
69
- ////////////////////////////////////////////////////////
70
- // App types
71
- Application: undefined,
72
- Dashboard: solution_simple_types_1.simpleTypes,
73
- "Data Pipeline": solution_simple_types_1.simpleTypes,
74
- "Data Store": undefined,
75
- "Desktop Application": undefined,
76
- "Excalibur Imagery Project": undefined,
77
- Form: formProcessor,
78
- "Hub Initiative": exports.UNSUPPORTED,
79
- "Hub Page": solution_hub_types_1.HubPageProcessor,
80
- "Hub Site Application": solution_hub_types_1.HubSiteProcessor,
81
- "Insights Model": solution_simple_types_1.simpleTypes,
82
- "Insights Page": undefined,
83
- "Insights Theme": undefined,
84
- "Insights Workbook": undefined,
85
- Mission: undefined,
86
- "Mobile Application": undefined,
87
- Notebook: solution_simple_types_1.notebookProcessor,
88
- "Oriented Imagery Catalog": solution_simple_types_1.simpleTypes,
89
- "Ortho Mapping Project": undefined,
90
- "QuickCapture Project": solution_simple_types_1.quickcaptureProcessor,
91
- "Site Application": solution_hub_types_1.HubSiteProcessor,
92
- "Site Page": solution_hub_types_1.HubPageProcessor,
93
- Solution: exports.UNSUPPORTED,
94
- StoryMap: solution_storymap_1.StoryMapProcessor,
95
- "Urban Model": undefined,
96
- "Web Experience Template": undefined,
97
- "Web Experience": solution_web_experience_1.WebExperienceProcessor,
98
- "Web Mapping Application": solution_simple_types_1.simpleTypes,
99
- "Workforce Project": solution_simple_types_1.simpleTypes,
100
- ////////////////////////////////////////////////////////
101
- // File types
102
- "360 VR Experience": fileProcessor,
103
- "AppBuilder Extension": fileProcessor,
104
- "AppBuilder Widget Package": fileProcessor,
105
- "Application Configuration": fileProcessor,
106
- "ArcGIS Pro Add In": fileProcessor,
107
- "ArcGIS Pro Configuration": fileProcessor,
108
- "ArcPad Package": fileProcessor,
109
- "Basemap Package": fileProcessor,
110
- "CAD Drawing": fileProcessor,
111
- "CityEngine Web Scene": fileProcessor,
112
- "Code Attachment": exports.UNSUPPORTED,
113
- "Code Sample": fileProcessor,
114
- "Color Set": fileProcessor,
115
- "Compact Tile Package": fileProcessor,
116
- "CSV Collection": fileProcessor,
117
- CSV: fileProcessor,
118
- "Deep Learning Package": fileProcessor,
119
- "Desktop Add In": fileProcessor,
120
- "Desktop Application Template": fileProcessor,
121
- "Desktop Style": fileProcessor,
122
- "Document Link": fileProcessor,
123
- "Explorer Add In": fileProcessor,
124
- "Explorer Layer": fileProcessor,
125
- "Explorer Map": fileProcessor,
126
- "Feature Collection Template": fileProcessor,
127
- "File Geodatabase": fileProcessor,
128
- GeoJson: fileProcessor,
129
- GeoPackage: fileProcessor,
130
- "Geoprocessing Package": fileProcessor,
131
- "Geoprocessing Sample": fileProcessor,
132
- "Globe Document": fileProcessor,
133
- "Image Collection": fileProcessor,
134
- Image: fileProcessor,
135
- "iWork Keynote": fileProcessor,
136
- "iWork Numbers": fileProcessor,
137
- "iWork Pages": fileProcessor,
138
- "KML Collection": fileProcessor,
139
- "Layer Package": fileProcessor,
140
- "Layer Template": fileProcessor,
141
- Layer: fileProcessor,
142
- Layout: fileProcessor,
143
- "Locator Package": fileProcessor,
144
- "Map Document": fileProcessor,
145
- "Map Package": fileProcessor,
146
- "Map Template": fileProcessor,
147
- "Microsoft Excel": fileProcessor,
148
- "Microsoft Powerpoint": fileProcessor,
149
- "Microsoft Word": fileProcessor,
150
- "Mobile Basemap Package": fileProcessor,
151
- "Mobile Map Package": fileProcessor,
152
- "Mobile Scene Package": fileProcessor,
153
- "Native Application": fileProcessor,
154
- "Native Application Installer": fileProcessor,
155
- "Native Application Template": fileProcessor,
156
- netCDF: fileProcessor,
157
- "Operation View": fileProcessor,
158
- "Operations Dashboard Add In": fileProcessor,
159
- "Operations Dashboard Extension": fileProcessor,
160
- PDF: fileProcessor,
161
- "Pro Layer Package": fileProcessor,
162
- "Pro Layer": fileProcessor,
163
- "Pro Map Package": fileProcessor,
164
- "Pro Map": fileProcessor,
165
- "Pro Report": fileProcessor,
166
- "Project Package": fileProcessor,
167
- "Project Template": fileProcessor,
168
- "Published Map": fileProcessor,
169
- "Raster function template": fileProcessor,
170
- "Report Template": fileProcessor,
171
- "Rule Package": fileProcessor,
172
- "Scene Document": fileProcessor,
173
- "Scene Package": fileProcessor,
174
- "Service Definition": fileProcessor,
175
- Shapefile: fileProcessor,
176
- "Statistical Data Collection": fileProcessor,
177
- Style: fileProcessor,
178
- "Survey123 Add In": fileProcessor,
179
- "Symbol Set": fileProcessor,
180
- "Task File": fileProcessor,
181
- "Tile Package": fileProcessor,
182
- "Toolbox Package": fileProcessor,
183
- "Vector Tile Package": fileProcessor,
184
- "Viewer Configuration": fileProcessor,
185
- "Visio Document": fileProcessor,
186
- "Window Mobile Package": fileProcessor,
187
- "Windows Mobile Package": fileProcessor,
188
- "Windows Viewer Add In": fileProcessor,
189
- "Windows Viewer Configuration": fileProcessor,
190
- "Workflow Manager Package": fileProcessor,
191
- ////////////////////////////////////////////////////////
192
- // Testing "types"
193
- Undefined: undefined,
194
- Unsupported: exports.UNSUPPORTED
195
- };
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2020 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.moduleMap = exports.UNSUPPORTED = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const featureLayer = tslib_1.__importStar(require("@esri/solution-feature-layer"));
21
+ const fileProcessor = tslib_1.__importStar(require("@esri/solution-file"));
22
+ const formProcessor = tslib_1.__importStar(require("@esri/solution-form"));
23
+ const group = tslib_1.__importStar(require("@esri/solution-group"));
24
+ const solution_simple_types_1 = require("@esri/solution-simple-types");
25
+ const solution_storymap_1 = require("@esri/solution-storymap");
26
+ const solution_velocity_1 = require("@esri/solution-velocity");
27
+ const solution_web_experience_1 = require("@esri/solution-web-experience");
28
+ const solution_hub_types_1 = require("@esri/solution-hub-types");
29
+ exports.UNSUPPORTED = null;
30
+ /**
31
+ * Mapping from item type to module with type-specific template-handling code.
32
+ * AGO types come from a blend of arcgis-portal-app\src\js\arcgisonline\pages\item\_Info.js and
33
+ * arcgis-portal-app\src\js\arcgis-components\src\_utils\metadata\item\displayName.ts
34
+ */
35
+ exports.moduleMap = {
36
+ ////////////////////////////////////////////////////////
37
+ // Group type
38
+ Group: group,
39
+ ////////////////////////////////////////////////////////
40
+ // Layer types
41
+ "Big Data Analytic": solution_velocity_1.VelocityProcessor,
42
+ "Feature Collection": solution_simple_types_1.simpleTypes,
43
+ "Feature Service": featureLayer,
44
+ Feed: solution_velocity_1.VelocityProcessor,
45
+ "Geocoding Service": undefined,
46
+ "Geodata Service": undefined,
47
+ "Geometry Service": undefined,
48
+ "Geoprocessing Service": undefined,
49
+ "Globe Service": undefined,
50
+ "Image Service": undefined,
51
+ KML: undefined,
52
+ "Map Service": featureLayer,
53
+ "Network Analysis Service": undefined,
54
+ "Real Time Analytic": solution_velocity_1.VelocityProcessor,
55
+ "Relational Database Connection": undefined,
56
+ "Scene Service": undefined,
57
+ "Stream Service": undefined,
58
+ Tool: undefined,
59
+ "Vector Tile Service": solution_simple_types_1.simpleTypes,
60
+ WFS: undefined,
61
+ WMS: undefined,
62
+ WMTS: undefined,
63
+ "Workflow Manager Service": undefined,
64
+ ////////////////////////////////////////////////////////
65
+ // Map types
66
+ "3D Web Scene": undefined,
67
+ "Web Map": solution_simple_types_1.simpleTypes,
68
+ "Web Scene": solution_simple_types_1.simpleTypes,
69
+ ////////////////////////////////////////////////////////
70
+ // App types
71
+ Application: undefined,
72
+ Dashboard: solution_simple_types_1.simpleTypes,
73
+ "Data Pipeline": solution_simple_types_1.simpleTypes,
74
+ "Data Store": undefined,
75
+ "Desktop Application": undefined,
76
+ "Excalibur Imagery Project": undefined,
77
+ Form: formProcessor,
78
+ "Hub Initiative": exports.UNSUPPORTED,
79
+ "Hub Page": solution_hub_types_1.HubPageProcessor,
80
+ "Hub Site Application": solution_hub_types_1.HubSiteProcessor,
81
+ "Insights Model": solution_simple_types_1.simpleTypes,
82
+ "Insights Page": undefined,
83
+ "Insights Theme": undefined,
84
+ "Insights Workbook": undefined,
85
+ Mission: undefined,
86
+ "Mobile Application": undefined,
87
+ Notebook: solution_simple_types_1.notebookProcessor,
88
+ "Oriented Imagery Catalog": solution_simple_types_1.simpleTypes,
89
+ "Ortho Mapping Project": undefined,
90
+ "QuickCapture Project": solution_simple_types_1.quickcaptureProcessor,
91
+ "Site Application": solution_hub_types_1.HubSiteProcessor,
92
+ "Site Page": solution_hub_types_1.HubPageProcessor,
93
+ Solution: exports.UNSUPPORTED,
94
+ StoryMap: solution_storymap_1.StoryMapProcessor,
95
+ "Urban Model": undefined,
96
+ "Web Experience Template": undefined,
97
+ "Web Experience": solution_web_experience_1.WebExperienceProcessor,
98
+ "Web Mapping Application": solution_simple_types_1.simpleTypes,
99
+ "Workforce Project": solution_simple_types_1.simpleTypes,
100
+ ////////////////////////////////////////////////////////
101
+ // File types
102
+ "360 VR Experience": fileProcessor,
103
+ "AppBuilder Extension": fileProcessor,
104
+ "AppBuilder Widget Package": fileProcessor,
105
+ "Application Configuration": fileProcessor,
106
+ "ArcGIS Pro Add In": fileProcessor,
107
+ "ArcGIS Pro Configuration": fileProcessor,
108
+ "ArcPad Package": fileProcessor,
109
+ "Basemap Package": fileProcessor,
110
+ "CAD Drawing": fileProcessor,
111
+ "CityEngine Web Scene": fileProcessor,
112
+ "Code Attachment": exports.UNSUPPORTED,
113
+ "Code Sample": fileProcessor,
114
+ "Color Set": fileProcessor,
115
+ "Compact Tile Package": fileProcessor,
116
+ "CSV Collection": fileProcessor,
117
+ CSV: fileProcessor,
118
+ "Deep Learning Package": fileProcessor,
119
+ "Desktop Add In": fileProcessor,
120
+ "Desktop Application Template": fileProcessor,
121
+ "Desktop Style": fileProcessor,
122
+ "Document Link": fileProcessor,
123
+ "Explorer Add In": fileProcessor,
124
+ "Explorer Layer": fileProcessor,
125
+ "Explorer Map": fileProcessor,
126
+ "Feature Collection Template": fileProcessor,
127
+ "File Geodatabase": fileProcessor,
128
+ GeoJson: fileProcessor,
129
+ GeoPackage: fileProcessor,
130
+ "Geoprocessing Package": fileProcessor,
131
+ "Geoprocessing Sample": fileProcessor,
132
+ "Globe Document": fileProcessor,
133
+ "Image Collection": fileProcessor,
134
+ Image: fileProcessor,
135
+ "iWork Keynote": fileProcessor,
136
+ "iWork Numbers": fileProcessor,
137
+ "iWork Pages": fileProcessor,
138
+ "KML Collection": fileProcessor,
139
+ "Layer Package": fileProcessor,
140
+ "Layer Template": fileProcessor,
141
+ Layer: fileProcessor,
142
+ Layout: fileProcessor,
143
+ "Locator Package": fileProcessor,
144
+ "Map Document": fileProcessor,
145
+ "Map Package": fileProcessor,
146
+ "Map Template": fileProcessor,
147
+ "Microsoft Excel": fileProcessor,
148
+ "Microsoft Powerpoint": fileProcessor,
149
+ "Microsoft Word": fileProcessor,
150
+ "Mobile Basemap Package": fileProcessor,
151
+ "Mobile Map Package": fileProcessor,
152
+ "Mobile Scene Package": fileProcessor,
153
+ "Native Application": fileProcessor,
154
+ "Native Application Installer": fileProcessor,
155
+ "Native Application Template": fileProcessor,
156
+ netCDF: fileProcessor,
157
+ "Operation View": fileProcessor,
158
+ "Operations Dashboard Add In": fileProcessor,
159
+ "Operations Dashboard Extension": fileProcessor,
160
+ PDF: fileProcessor,
161
+ "Pro Layer Package": fileProcessor,
162
+ "Pro Layer": fileProcessor,
163
+ "Pro Map Package": fileProcessor,
164
+ "Pro Map": fileProcessor,
165
+ "Pro Report": fileProcessor,
166
+ "Project Package": fileProcessor,
167
+ "Project Template": fileProcessor,
168
+ "Published Map": fileProcessor,
169
+ "Raster function template": fileProcessor,
170
+ "Report Template": fileProcessor,
171
+ "Rule Package": fileProcessor,
172
+ "Scene Document": fileProcessor,
173
+ "Scene Package": fileProcessor,
174
+ "Service Definition": fileProcessor,
175
+ Shapefile: fileProcessor,
176
+ "Statistical Data Collection": fileProcessor,
177
+ Style: fileProcessor,
178
+ "Survey123 Add In": fileProcessor,
179
+ "Symbol Set": fileProcessor,
180
+ "Task File": fileProcessor,
181
+ "Tile Package": fileProcessor,
182
+ "Toolbox Package": fileProcessor,
183
+ "Vector Tile Package": fileProcessor,
184
+ "Viewer Configuration": fileProcessor,
185
+ "Visio Document": fileProcessor,
186
+ "Window Mobile Package": fileProcessor,
187
+ "Windows Mobile Package": fileProcessor,
188
+ "Windows Viewer Add In": fileProcessor,
189
+ "Windows Viewer Configuration": fileProcessor,
190
+ "Workflow Manager Package": fileProcessor,
191
+ ////////////////////////////////////////////////////////
192
+ // Testing "types"
193
+ Undefined: undefined,
194
+ Unsupported: exports.UNSUPPORTED
195
+ };
196
196
  //# sourceMappingURL=module-map.js.map
@@ -1,108 +1,108 @@
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 creation of the template of a Solution item via the REST API.
18
- *
19
- * @module createItemTemplate
20
- */
21
- import { IDatasourceInfo, IItemProgressCallback, IItemTemplate, ISourceFile, UserSession } from "@esri/solution-common";
22
- /**
23
- * Creates template for an AGO item and its dependencies
24
- *
25
- * @param solutionItemId The solution to contain the item
26
- * @param itemId AGO id string
27
- * @param templateDictionary Hash of facts
28
- * @param srcAuthentication Credentials for requests to source items
29
- * @param destAuthentication Authentication for requesting information from AGO about items to be included in solution item
30
- * @param existingTemplates A collection of AGO item templates that can be referenced by newly-created templates
31
- * @returns A promise which resolves with an array of resources for the item and its dependencies
32
- * @private
33
- */
34
- export declare function createItemTemplate(solutionItemId: string, itemId: string, templateDictionary: any, srcAuthentication: UserSession, destAuthentication: UserSession, existingTemplates: IItemTemplate[], itemProgressCallback: IItemProgressCallback): Promise<ISourceFile[]>;
35
- /**
36
- * Templatizes field references within specific template types.
37
- * Currently only handles web applications
38
- *
39
- * @param templates List of solution templates
40
- * @returns A list of templates that have templatized field references
41
- */
42
- export declare function postProcessFieldReferences(templates: IItemTemplate[]): IItemTemplate[];
43
- /**
44
- * Get common properties that will support the templatization of field references
45
- *
46
- * @param templates List of solution templates
47
- * @returns A list of IDataSourceInfo objects with key properties
48
- * @private
49
- */
50
- export declare function _getDatasourceInfos(templates: IItemTemplate[]): IDatasourceInfo[];
51
- /**
52
- * Creates a simple lookup object to quickly understand an items type and dependencies
53
- * and associated web map layer ids based on itemId
54
- *
55
- * @param templates List of solution templates
56
- * @returns The lookup object with type, dependencies, and webmap layer info
57
- * @private
58
- */
59
- export declare function _getTemplateTypeHash(templates: IItemTemplate[]): any;
60
- /**
61
- * Updates the lookup object with webmap layer info
62
- * so we can know the id used within a map for a given feature service
63
- *
64
- * @param template A webmap solution template
65
- * @returns The lookup object with webmap layer info added
66
- * @private
67
- */
68
- export declare function _updateWebMapHashInfo(template: IItemTemplate, hashItem: any): void;
69
- /**
70
- * Updates a templatized datasource URL with a layer id.
71
- *
72
- * @param dataSourceUrl Templatized datasource URL
73
- * @param layerId Layer id
74
- * @returns string Amended datasource URL
75
- * @private
76
- */
77
- export declare function _addLayerIdToDatasourceUrl(datasourceUrl?: string, layerId?: any): string;
78
- /**
79
- * Updates the datasource info objects by passing the webmap layer IDs from the lookup hash
80
- * to the underlying feature service datasource infos
81
- *
82
- * @param datasourceInfos A webmap solution template
83
- * @param templateTypeHash A simple lookup object populated with key item info
84
- * @returns The updated datasource infos
85
- * @private
86
- */
87
- export declare function _addMapLayerIds(datasourceInfos: IDatasourceInfo[], templateTypeHash: any): IDatasourceInfo[];
88
- /**
89
- * Get feature service item IDs from applications webmaps
90
- * As they are not explict dependencies of the application but are needed for field references
91
- *
92
- * @param template A webmap solution template
93
- * @param templateTypeHash A simple lookup object populated with key item info
94
- * @returns A list of feature service item IDs
95
- * @private
96
- */
97
- export declare function _getWebMapFSDependencies(template: IItemTemplate, templateTypeHash: any): string[];
98
- /**
99
- * Perform templatizations needed in an item's resources
100
- *
101
- * @param itemTemplate Item being templatized
102
- * @param resourceItemFiles Resources for the item; these resources are modified as needed
103
- * by the templatization
104
- * @param srcAuthentication Credentials for requests to source items
105
- *
106
- * @returns A promise that resolves when all templatization has completed
107
- */
108
- export declare function _templatizeResources(itemTemplate: IItemTemplate, resourceItemFiles: ISourceFile[], srcAuthentication: UserSession): Promise<void[]>;
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 creation of the template of a Solution item via the REST API.
18
+ *
19
+ * @module createItemTemplate
20
+ */
21
+ import { IDatasourceInfo, IItemProgressCallback, IItemTemplate, ISourceFile, UserSession } from "@esri/solution-common";
22
+ /**
23
+ * Creates template for an AGO item and its dependencies
24
+ *
25
+ * @param solutionItemId The solution to contain the item
26
+ * @param itemId AGO id string
27
+ * @param templateDictionary Hash of facts
28
+ * @param srcAuthentication Credentials for requests to source items
29
+ * @param destAuthentication Authentication for requesting information from AGO about items to be included in solution item
30
+ * @param existingTemplates A collection of AGO item templates that can be referenced by newly-created templates
31
+ * @returns A promise which resolves with an array of resources for the item and its dependencies
32
+ * @private
33
+ */
34
+ export declare function createItemTemplate(solutionItemId: string, itemId: string, templateDictionary: any, srcAuthentication: UserSession, destAuthentication: UserSession, existingTemplates: IItemTemplate[], itemProgressCallback: IItemProgressCallback): Promise<ISourceFile[]>;
35
+ /**
36
+ * Templatizes field references within specific template types.
37
+ * Currently only handles web applications
38
+ *
39
+ * @param templates List of solution templates
40
+ * @returns A list of templates that have templatized field references
41
+ */
42
+ export declare function postProcessFieldReferences(templates: IItemTemplate[]): IItemTemplate[];
43
+ /**
44
+ * Get common properties that will support the templatization of field references
45
+ *
46
+ * @param templates List of solution templates
47
+ * @returns A list of IDataSourceInfo objects with key properties
48
+ * @private
49
+ */
50
+ export declare function _getDatasourceInfos(templates: IItemTemplate[]): IDatasourceInfo[];
51
+ /**
52
+ * Creates a simple lookup object to quickly understand an items type and dependencies
53
+ * and associated web map layer ids based on itemId
54
+ *
55
+ * @param templates List of solution templates
56
+ * @returns The lookup object with type, dependencies, and webmap layer info
57
+ * @private
58
+ */
59
+ export declare function _getTemplateTypeHash(templates: IItemTemplate[]): any;
60
+ /**
61
+ * Updates the lookup object with webmap layer info
62
+ * so we can know the id used within a map for a given feature service
63
+ *
64
+ * @param template A webmap solution template
65
+ * @returns The lookup object with webmap layer info added
66
+ * @private
67
+ */
68
+ export declare function _updateWebMapHashInfo(template: IItemTemplate, hashItem: any): void;
69
+ /**
70
+ * Updates a templatized datasource URL with a layer id.
71
+ *
72
+ * @param dataSourceUrl Templatized datasource URL
73
+ * @param layerId Layer id
74
+ * @returns string Amended datasource URL
75
+ * @private
76
+ */
77
+ export declare function _addLayerIdToDatasourceUrl(datasourceUrl?: string, layerId?: any): string;
78
+ /**
79
+ * Updates the datasource info objects by passing the webmap layer IDs from the lookup hash
80
+ * to the underlying feature service datasource infos
81
+ *
82
+ * @param datasourceInfos A webmap solution template
83
+ * @param templateTypeHash A simple lookup object populated with key item info
84
+ * @returns The updated datasource infos
85
+ * @private
86
+ */
87
+ export declare function _addMapLayerIds(datasourceInfos: IDatasourceInfo[], templateTypeHash: any): IDatasourceInfo[];
88
+ /**
89
+ * Get feature service item IDs from applications webmaps
90
+ * As they are not explict dependencies of the application but are needed for field references
91
+ *
92
+ * @param template A webmap solution template
93
+ * @param templateTypeHash A simple lookup object populated with key item info
94
+ * @returns A list of feature service item IDs
95
+ * @private
96
+ */
97
+ export declare function _getWebMapFSDependencies(template: IItemTemplate, templateTypeHash: any): string[];
98
+ /**
99
+ * Perform templatizations needed in an item's resources
100
+ *
101
+ * @param itemTemplate Item being templatized
102
+ * @param resourceItemFiles Resources for the item; these resources are modified as needed
103
+ * by the templatization
104
+ * @param srcAuthentication Credentials for requests to source items
105
+ *
106
+ * @returns A promise that resolves when all templatization has completed
107
+ */
108
+ export declare function _templatizeResources(itemTemplate: IItemTemplate, resourceItemFiles: ISourceFile[], srcAuthentication: UserSession): Promise<void[]>;