@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,126 +1,126 @@
1
- /** @license
2
- * Copyright 2020 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 { ICreateSolutionOptions, IItemTemplate, UserSession } from "@esri/solution-common";
17
- /**
18
- * Adds a list of AGO item ids to a solution item.
19
- *
20
- * @param solutionItemId AGO id of solution to receive items
21
- * @param options Customizations for creating the solution
22
- * @param srcAuthentication Credentials for requests to source items
23
- * @param destAuthentication Credentials for the requests to destination solution
24
- * @returns A promise that resolves with the AGO id of the updated solution
25
- * @internal
26
- */
27
- export declare function addContentToSolution(solutionItemId: string, options: ICreateSolutionOptions, srcAuthentication: UserSession, destAuthentication: UserSession): Promise<string>;
28
- /**
29
- * Gets the dependencies of an item by merging its dependencies list with item references in template variables.
30
- *
31
- * @param template Template to examine
32
- * @returns List of dependency ids
33
- * @private
34
- */
35
- export declare function _getDependencies(template: IItemTemplate): string[];
36
- /**
37
- * Extracts AGO ids out of template variables.
38
- *
39
- * @param variables List of template variables to examine
40
- * @returns List of AGO ids referenced in `variables`
41
- * @private
42
- */
43
- export declare function _getIdsOutOfTemplateVariables(variables: string[]): string[];
44
- /**
45
- * Creates a list of item URLs.
46
- *
47
- * @param templates Templates to check for URLs
48
- * @returns List of URLs
49
- * @private
50
- */
51
- export declare function _getSolutionItemUrls(templates: IItemTemplate[]): string[][];
52
- /**
53
- * Extracts template variables out of a string.
54
- *
55
- * @param text String to examine
56
- * @returns List of template variables found in string
57
- * @private
58
- */
59
- export declare function _getTemplateVariables(text: string): string[];
60
- /**
61
- * Update the items dependencies and groups arrays
62
- *
63
- * @param templates The array of templates to evaluate
64
- * @returns Updated version of the templates
65
- * @private
66
- */
67
- export declare function _postProcessGroupDependencies(templates: IItemTemplate[]): IItemTemplate[];
68
- /**
69
- * Check for feature service items that have been flagged for invalid designations.
70
- * Remove templates that have invalid designations from the solution item and other item dependencies.
71
- * Clean up any references to items with invalid designations in the other templates.
72
- *
73
- * @param templates The array of templates to evaluate
74
- * @param templateDictionary Hash of key details used for variable replacement
75
- * @returns Updated version of the templates
76
- * @private
77
- */
78
- export declare function _postProcessIgnoredItems(templates: IItemTemplate[], templateDictionary: any): IItemTemplate[];
79
- /**
80
- * Recursively runs through an object to find and replace any strings found in a dictionary.
81
- *
82
- * @param templateDictionary Hash of things to be replaced
83
- * @param obj Object to be examined
84
- * @private
85
- */
86
- export declare function _replaceDictionaryItemsInObject(hash: any, obj: any): any;
87
- /**
88
- * Recursively runs through an object to find and templatize any remaining references to solution's items.
89
- *
90
- * @param ids Ids to be replaced in strings found in object
91
- * @param obj Object to be examined
92
- * @private
93
- */
94
- export declare function _replaceRemainingIdsInObject(ids: string[], obj: any): any;
95
- /**
96
- * Templatizes ids from a list in a string if they're not already templatized.
97
- *
98
- * @param ids Ids to be replaced in source string
99
- * @param str Source string to be examined
100
- * @returns A copy of the source string with any templatization changes
101
- * @private
102
- */
103
- export declare function _replaceRemainingIdsInString(ids: string[], str: string): string;
104
- /**
105
- * Finds and templatizes any URLs in solution items' descriptions.
106
- *
107
- * @param templates The array of templates to evaluate, modified in place
108
- * @private
109
- */
110
- export declare function _simplifyUrlsInItemDescriptions(templates: IItemTemplate[]): void;
111
- /**
112
- * Templatizes occurrences of the URL to the user's organization in the `item` and `data` template sections.
113
- *
114
- * @param templates The array of templates to evaluate; templates is modified in place
115
- * @param destAuthentication Credentials for request organization info
116
- * @returns Promise resolving with `templates`
117
- * @private
118
- */
119
- export declare function _templatizeOrgUrl(templates: IItemTemplate[], destAuthentication: UserSession): Promise<IItemTemplate[]>;
120
- /**
121
- * Finds and templatizes any references to solution's items.
122
- *
123
- * @param templates The array of templates to evaluate, modified in place
124
- * @private
125
- */
126
- export declare function _templatizeSolutionIds(templates: IItemTemplate[]): void;
1
+ /** @license
2
+ * Copyright 2020 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 { ICreateSolutionOptions, IItemTemplate, UserSession } from "@esri/solution-common";
17
+ /**
18
+ * Adds a list of AGO item ids to a solution item.
19
+ *
20
+ * @param solutionItemId AGO id of solution to receive items
21
+ * @param options Customizations for creating the solution
22
+ * @param srcAuthentication Credentials for requests to source items
23
+ * @param destAuthentication Credentials for the requests to destination solution
24
+ * @returns A promise that resolves with the AGO id of the updated solution
25
+ * @internal
26
+ */
27
+ export declare function addContentToSolution(solutionItemId: string, options: ICreateSolutionOptions, srcAuthentication: UserSession, destAuthentication: UserSession): Promise<string>;
28
+ /**
29
+ * Gets the dependencies of an item by merging its dependencies list with item references in template variables.
30
+ *
31
+ * @param template Template to examine
32
+ * @returns List of dependency ids
33
+ * @private
34
+ */
35
+ export declare function _getDependencies(template: IItemTemplate): string[];
36
+ /**
37
+ * Extracts AGO ids out of template variables.
38
+ *
39
+ * @param variables List of template variables to examine
40
+ * @returns List of AGO ids referenced in `variables`
41
+ * @private
42
+ */
43
+ export declare function _getIdsOutOfTemplateVariables(variables: string[]): string[];
44
+ /**
45
+ * Creates a list of item URLs.
46
+ *
47
+ * @param templates Templates to check for URLs
48
+ * @returns List of URLs
49
+ * @private
50
+ */
51
+ export declare function _getSolutionItemUrls(templates: IItemTemplate[]): string[][];
52
+ /**
53
+ * Extracts template variables out of a string.
54
+ *
55
+ * @param text String to examine
56
+ * @returns List of template variables found in string
57
+ * @private
58
+ */
59
+ export declare function _getTemplateVariables(text: string): string[];
60
+ /**
61
+ * Update the items dependencies and groups arrays
62
+ *
63
+ * @param templates The array of templates to evaluate
64
+ * @returns Updated version of the templates
65
+ * @private
66
+ */
67
+ export declare function _postProcessGroupDependencies(templates: IItemTemplate[]): IItemTemplate[];
68
+ /**
69
+ * Check for feature service items that have been flagged for invalid designations.
70
+ * Remove templates that have invalid designations from the solution item and other item dependencies.
71
+ * Clean up any references to items with invalid designations in the other templates.
72
+ *
73
+ * @param templates The array of templates to evaluate
74
+ * @param templateDictionary Hash of key details used for variable replacement
75
+ * @returns Updated version of the templates
76
+ * @private
77
+ */
78
+ export declare function _postProcessIgnoredItems(templates: IItemTemplate[], templateDictionary: any): IItemTemplate[];
79
+ /**
80
+ * Recursively runs through an object to find and replace any strings found in a dictionary.
81
+ *
82
+ * @param templateDictionary Hash of things to be replaced
83
+ * @param obj Object to be examined
84
+ * @private
85
+ */
86
+ export declare function _replaceDictionaryItemsInObject(hash: any, obj: any): any;
87
+ /**
88
+ * Recursively runs through an object to find and templatize any remaining references to solution's items.
89
+ *
90
+ * @param ids Ids to be replaced in strings found in object
91
+ * @param obj Object to be examined
92
+ * @private
93
+ */
94
+ export declare function _replaceRemainingIdsInObject(ids: string[], obj: any): any;
95
+ /**
96
+ * Templatizes ids from a list in a string if they're not already templatized.
97
+ *
98
+ * @param ids Ids to be replaced in source string
99
+ * @param str Source string to be examined
100
+ * @returns A copy of the source string with any templatization changes
101
+ * @private
102
+ */
103
+ export declare function _replaceRemainingIdsInString(ids: string[], str: string): string;
104
+ /**
105
+ * Finds and templatizes any URLs in solution items' descriptions.
106
+ *
107
+ * @param templates The array of templates to evaluate, modified in place
108
+ * @private
109
+ */
110
+ export declare function _simplifyUrlsInItemDescriptions(templates: IItemTemplate[]): void;
111
+ /**
112
+ * Templatizes occurrences of the URL to the user's organization in the `item` and `data` template sections.
113
+ *
114
+ * @param templates The array of templates to evaluate; templates is modified in place
115
+ * @param destAuthentication Credentials for request organization info
116
+ * @returns Promise resolving with `templates`
117
+ * @private
118
+ */
119
+ export declare function _templatizeOrgUrl(templates: IItemTemplate[], destAuthentication: UserSession): Promise<IItemTemplate[]>;
120
+ /**
121
+ * Finds and templatizes any references to solution's items.
122
+ *
123
+ * @param templates The array of templates to evaluate, modified in place
124
+ * @private
125
+ */
126
+ export declare function _templatizeSolutionIds(templates: IItemTemplate[]): void;