@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.
- package/dist/cjs/createItemTemplate.d.ts +108 -108
- package/dist/cjs/createItemTemplate.js +438 -435
- package/dist/cjs/createItemTemplate.js.map +1 -1
- package/dist/cjs/creator.d.ts +97 -97
- package/dist/cjs/creator.js +278 -278
- package/dist/cjs/helpers/add-content-to-solution.d.ts +126 -126
- package/dist/cjs/helpers/add-content-to-solution.js +464 -464
- package/dist/cjs/helpers/template.d.ts +30 -30
- package/dist/cjs/helpers/template.js +48 -48
- package/dist/cjs/index.d.ts +23 -23
- package/dist/cjs/index.js +26 -26
- package/dist/cjs/module-map.d.ts +23 -23
- package/dist/cjs/module-map.js +195 -195
- package/dist/esm/createItemTemplate.d.ts +108 -108
- package/dist/esm/createItemTemplate.js +426 -423
- package/dist/esm/createItemTemplate.js.map +1 -1
- package/dist/esm/creator.d.ts +97 -97
- package/dist/esm/creator.js +267 -267
- package/dist/esm/helpers/add-content-to-solution.d.ts +126 -126
- package/dist/esm/helpers/add-content-to-solution.js +448 -448
- package/dist/esm/helpers/template.d.ts +30 -30
- package/dist/esm/helpers/template.js +43 -43
- package/dist/esm/index.d.ts +23 -23
- package/dist/esm/index.js +23 -23
- package/dist/esm/module-map.d.ts +23 -23
- package/dist/esm/module-map.js +191 -191
- package/package.json +12 -12
|
@@ -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[]>;
|