@esri/solution-web-tool 5.3.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2017 Esri Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ [![npm status][npm-img]][npm-url]
2
+ [![Build status][travis-img]][travis-url]
3
+ [![gzip bundle size][gzip-img]][npm-url]
4
+ [![Apache 2.0 licensed][license-img]][license-url]
5
+
6
+ [npm-img]: https://img.shields.io/npm/v/@esri/solution-web-tool.svg?style=round-square&color=blue
7
+ [npm-url]: https://www.npmjs.com/package/@esri/solution-web-tool
8
+ [travis-img]: https://img.shields.io/travis/com/Esri/solution.js/develop.svg
9
+ [travis-url]: https://travis-ci.org/Esri/solution.js
10
+ [gzip-img]: https://img.badgesize.io/https://unpkg.com/@esri/solution-web-tool/dist/esm/index.js?compression=gzip
11
+ [license-img]: https://img.shields.io/badge/license-Apache%202.0-blue.svg
12
+ [license-url]: #license
13
+
14
+ # @esri/solution-web-tool
15
+
16
+ > Manages the creation and deployment of web tool item types for [`@esri/solution-*`](https://github.com/Esri/solution.js).
17
+
18
+ ### [API Reference](https://esri.github.io/solution.js/modules/web-tool_src.html)
19
+
20
+ ### Issues
21
+
22
+ Found a bug or want to request a new feature? Please take a look at [previously logged issues](https://github.com/Esri/solution.js/issues); if you don't see your concern, please let us know by [submitting an issue](https://github.com/Esri/solution.js/issues/new).
23
+
24
+ ### [Changelog](https://github.com/Esri/solution.js/blob/develop/CHANGELOG.md)
25
+
26
+ ##### Versioning
27
+
28
+ For transparency into the release cycle and in striving to maintain backward compatibility, @esri/solution.js is maintained under Semantic Versioning guidelines and will adhere to these rules whenever possible. For more information on SemVer, please visit <http://semver.org/>.
29
+
30
+ ### Contributing
31
+
32
+ Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](CONTRIBUTING.md).
33
+
34
+ ### License
35
+
36
+ Copyright &copy; 2018 Esri
37
+
38
+ Licensed under the Apache License, Version 2.0 (the "License");
39
+ you may not use this file except in compliance with the License.
40
+ You may obtain a copy of the License at
41
+
42
+ > http://www.apache.org/licenses/LICENSE-2.0
43
+
44
+ Unless required by applicable law or agreed to in writing, software
45
+ distributed under the License is distributed on an "AS IS" BASIS,
46
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47
+ See the License for the specific language governing permissions and
48
+ limitations under the License.
49
+
50
+ A copy of the license is available in the repository's [LICENSE](./LICENSE) file.
@@ -0,0 +1,22 @@
1
+ /** @license
2
+ * Copyright 2024 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 web tool geoprocessing service item types.
18
+ *
19
+ * @module solution-web-tool
20
+ */
21
+ import * as WebToolProcessor from "./web-tool-processor";
22
+ export { WebToolProcessor };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2024 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.WebToolProcessor = void 0;
19
+ const tslib_1 = require("tslib");
20
+ /**
21
+ * Manages the creation and deployment of web tool geoprocessing service item types.
22
+ *
23
+ * @module solution-web-tool
24
+ */
25
+ const WebToolProcessor = tslib_1.__importStar(require("./web-tool-processor"));
26
+ exports.WebToolProcessor = WebToolProcessor;
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AACH,+EAAyD;AAEhD,4CAAgB"}
@@ -0,0 +1,50 @@
1
+ /** @license
2
+ * Copyright 2024 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 web-experience item types.
18
+ *
19
+ * @module solution-web-tool
20
+ */
21
+ import * as common from "@esri/solution-common";
22
+ /**
23
+ * Creates a template from a Web Tool Geoprocessing item
24
+ *
25
+ * @param {any} itemInfo: The base item info
26
+ * @param {UserSession} destAuthentication Credentials for requests to the destination organization
27
+ * @param {UserSession} srcAuthentication Credentials for requests to source items
28
+ * @param {any} templateDictionary Hash of facts: folder id, org URL, adlib replacements
29
+ * @returns {Promise<IItemTemplate>}
30
+ */
31
+ export declare function convertItemToTemplate(itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
32
+ /**
33
+ * Creates a Web Tool Geoprocessing item from a template
34
+ *
35
+ * @param {IItemTemplate} template The template
36
+ * @param {any} templateDictionary The template dictionary
37
+ * @param {UserSession} destinationAuthentication The destination user session info
38
+ * @param itemProgressCallback An item progress callback
39
+ * @returns {Promise<ICreateItemFromTemplateResponse>}
40
+ */
41
+ export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
42
+ /**
43
+ * Get the urls available on the portal self.
44
+ *
45
+ * @param {IItemTemplate} template The template
46
+ * @param {any} templateDictionary The template dictionary
47
+ * @param {UserSession} destinationAuthentication The destination user session info
48
+ * @returns List of http and https helper urls
49
+ */
50
+ export declare function createWebTool(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession): Promise<any>;
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2024 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.createWebTool = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
19
+ const tslib_1 = require("tslib");
20
+ /**
21
+ * Manages the creation and deployment of web-experience item types.
22
+ *
23
+ * @module solution-web-tool
24
+ */
25
+ const common = tslib_1.__importStar(require("@esri/solution-common"));
26
+ const solution_simple_types_1 = require("@esri/solution-simple-types");
27
+ const arcgis_rest_request_1 = require("@esri/arcgis-rest-request");
28
+ /**
29
+ * Creates a template from a Web Tool Geoprocessing item
30
+ *
31
+ * @param {any} itemInfo: The base item info
32
+ * @param {UserSession} destAuthentication Credentials for requests to the destination organization
33
+ * @param {UserSession} srcAuthentication Credentials for requests to source items
34
+ * @param {any} templateDictionary Hash of facts: folder id, org URL, adlib replacements
35
+ * @returns {Promise<IItemTemplate>}
36
+ */
37
+ function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
38
+ // Delegate to simple types
39
+ return solution_simple_types_1.simpleTypes.convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary);
40
+ }
41
+ exports.convertItemToTemplate = convertItemToTemplate;
42
+ /**
43
+ * Creates a Web Tool Geoprocessing item from a template
44
+ *
45
+ * @param {IItemTemplate} template The template
46
+ * @param {any} templateDictionary The template dictionary
47
+ * @param {UserSession} destinationAuthentication The destination user session info
48
+ * @param itemProgressCallback An item progress callback
49
+ * @returns {Promise<ICreateItemFromTemplateResponse>}
50
+ */
51
+ function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
52
+ return new Promise(resolve => {
53
+ // Interrupt process if progress callback returns `false`
54
+ if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Started, 0)) {
55
+ itemProgressCallback(template.itemId, common.EItemProgressStatus.Ignored, 0);
56
+ resolve(common.generateEmptyCreationResponse(template.type));
57
+ }
58
+ else {
59
+ // Replace the templatized symbols in a copy of the template
60
+ let newItemTemplate = common.cloneObject(template);
61
+ newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
62
+ if (template.item.thumbnail) {
63
+ newItemTemplate.item.thumbnail = template.item.thumbnail;
64
+ }
65
+ createWebTool(newItemTemplate, templateDictionary, destinationAuthentication).then(createResponse => {
66
+ // Interrupt process if progress callback returns `false`
67
+ if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.itemId)) {
68
+ itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
69
+ common
70
+ .removeItem(createResponse.itemId, destinationAuthentication)
71
+ .then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
72
+ }
73
+ else {
74
+ // Add the new item to the settings
75
+ templateDictionary[template.itemId] = {
76
+ itemId: createResponse.itemId,
77
+ itemUrl: templateDictionary["portalBaseUrl"] + "/sharing/rest/content/items/" + createResponse.itemId
78
+ };
79
+ newItemTemplate.itemId = createResponse.itemId;
80
+ newItemTemplate.data = {};
81
+ // Update the template again now that we have the new item id
82
+ newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
83
+ resolve({
84
+ item: newItemTemplate,
85
+ id: createResponse.itemId,
86
+ type: newItemTemplate.type,
87
+ postProcess: false
88
+ });
89
+ }
90
+ }, () => {
91
+ itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
92
+ resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
93
+ });
94
+ }
95
+ });
96
+ }
97
+ exports.createItemFromTemplate = createItemFromTemplate;
98
+ /**
99
+ * Get the urls available on the portal self.
100
+ *
101
+ * @param {IItemTemplate} template The template
102
+ * @param {any} templateDictionary The template dictionary
103
+ * @param {UserSession} destinationAuthentication The destination user session info
104
+ * @returns List of http and https helper urls
105
+ */
106
+ function createWebTool(template, templateDictionary, destinationAuthentication) {
107
+ return new Promise((resolve, reject) => {
108
+ if (templateDictionary?.portalUrls?.notebooks.https.length > 0) {
109
+ const notebookUrl = templateDictionary.portalUrls.notebooks.https[0];
110
+ const url = `https://${notebookUrl}/admin/services/createService?f=json&request.preventCache=${Date.now()}`;
111
+ const params = {
112
+ "serviceProperties": {
113
+ "description": template.item.description,
114
+ "provider": "notebooks",
115
+ "type": "GPServer",
116
+ "jsonProperties": {
117
+ "title": template.item.title,
118
+ "notebookId": template.data.notebookId,
119
+ "tasks": [{
120
+ "type": "notebook",
121
+ "name": template.data.name
122
+ }]
123
+ }
124
+ }
125
+ };
126
+ const requestOptions = {
127
+ httpMethod: "POST",
128
+ authentication: destinationAuthentication,
129
+ params,
130
+ headers: {
131
+ Accept: "application/json",
132
+ Authorization: `Bearer ${destinationAuthentication.token}`,
133
+ "Content-Type": "application/json",
134
+ "X-Esri-Authorization": `Bearer ${destinationAuthentication.token}`
135
+ },
136
+ };
137
+ (0, arcgis_rest_request_1.request)(url, requestOptions).then((response) => {
138
+ resolve(response);
139
+ }, e => {
140
+ reject(e);
141
+ });
142
+ }
143
+ else {
144
+ reject();
145
+ }
146
+ });
147
+ }
148
+ exports.createWebTool = createWebTool;
149
+ //# sourceMappingURL=web-tool-processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-tool-processor.js","sourceRoot":"","sources":["../../src/web-tool-processor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,sEAAgD;AAChD,uEAA0D;AAC1D,mEAAqE;AAErE;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACnC,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,2BAA2B;IAC3B,OAAO,mCAAW,CAAC,qBAAqB,CACtC,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,CACnB,CAAC;AACJ,CAAC;AAbD,sDAaC;AAED;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CACpC,QAA8B,EAC9B,kBAAuB,EACvB,yBAA6C,EAC7C,oBAAkD;IAElD,OAAO,IAAI,OAAO,CAAyC,OAAO,CAAC,EAAE;QACnE,yDAAyD;QACzD,IACE,CAAC,oBAAoB,CACnB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAClC,CAAC,CACF,EACD;YACA,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAClC,CAAC,CACF,CAAC;YACF,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9D;aAAM;YACL,4DAA4D;YAC5D,IAAI,eAAe,GAAyB,MAAM,CAA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tC,OAAO,EAAE,CAAC;gCACR,MAAM,EAAE,UAAU;gCAClB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI;6BAC3B,CAAC;qBACH;iBACF;aACF,CAAC;YAEF,MAAM,cAAc,GAAG;gBACrB,UAAU,EAAE,MAAM;gBAClB,cAAc,EAAE,yBAAyB;gBACzC,MAAM;gBACN,OAAO,EAAE;oBACP,MAAM,EAAE,kBAAkB;oBAC1B,aAAa,EAAE,UAAU,yBAAyB,CAAC,KAAK,EAAE;oBAC1D,cAAc,EAAE,kBAAkB;oBAClC,sBAAsB,EAAE,UAAU,yBAAyB,CAAC,KAAK,EAAE;iBACpE;aACiB,CAAC;YAErB,IAAA,6BAAO,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC7C,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC,EAAE,CAAC,CAAC,EAAE;gBACL,MAAM,CAAC,CAAC,CAAC,CAAC;YACZ,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,MAAM,EAAE,CAAC;SACV;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA/CD,sCA+CC"}
@@ -0,0 +1,22 @@
1
+ /** @license
2
+ * Copyright 2024 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 web tool geoprocessing service item types.
18
+ *
19
+ * @module solution-web-tool
20
+ */
21
+ import * as WebToolProcessor from "./web-tool-processor";
22
+ export { WebToolProcessor };
@@ -0,0 +1,23 @@
1
+ /** @license
2
+ * Copyright 2024 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 web tool geoprocessing service item types.
18
+ *
19
+ * @module solution-web-tool
20
+ */
21
+ import * as WebToolProcessor from "./web-tool-processor";
22
+ export { WebToolProcessor };
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AACH,OAAO,KAAK,gBAAgB,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,50 @@
1
+ /** @license
2
+ * Copyright 2024 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 web-experience item types.
18
+ *
19
+ * @module solution-web-tool
20
+ */
21
+ import * as common from "@esri/solution-common";
22
+ /**
23
+ * Creates a template from a Web Tool Geoprocessing item
24
+ *
25
+ * @param {any} itemInfo: The base item info
26
+ * @param {UserSession} destAuthentication Credentials for requests to the destination organization
27
+ * @param {UserSession} srcAuthentication Credentials for requests to source items
28
+ * @param {any} templateDictionary Hash of facts: folder id, org URL, adlib replacements
29
+ * @returns {Promise<IItemTemplate>}
30
+ */
31
+ export declare function convertItemToTemplate(itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
32
+ /**
33
+ * Creates a Web Tool Geoprocessing item from a template
34
+ *
35
+ * @param {IItemTemplate} template The template
36
+ * @param {any} templateDictionary The template dictionary
37
+ * @param {UserSession} destinationAuthentication The destination user session info
38
+ * @param itemProgressCallback An item progress callback
39
+ * @returns {Promise<ICreateItemFromTemplateResponse>}
40
+ */
41
+ export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
42
+ /**
43
+ * Get the urls available on the portal self.
44
+ *
45
+ * @param {IItemTemplate} template The template
46
+ * @param {any} templateDictionary The template dictionary
47
+ * @param {UserSession} destinationAuthentication The destination user session info
48
+ * @returns List of http and https helper urls
49
+ */
50
+ export declare function createWebTool(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession): Promise<any>;
@@ -0,0 +1,142 @@
1
+ /** @license
2
+ * Copyright 2024 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 web-experience item types.
18
+ *
19
+ * @module solution-web-tool
20
+ */
21
+ import * as common from "@esri/solution-common";
22
+ import { simpleTypes } from "@esri/solution-simple-types";
23
+ import { request } from "@esri/arcgis-rest-request";
24
+ /**
25
+ * Creates a template from a Web Tool Geoprocessing item
26
+ *
27
+ * @param {any} itemInfo: The base item info
28
+ * @param {UserSession} destAuthentication Credentials for requests to the destination organization
29
+ * @param {UserSession} srcAuthentication Credentials for requests to source items
30
+ * @param {any} templateDictionary Hash of facts: folder id, org URL, adlib replacements
31
+ * @returns {Promise<IItemTemplate>}
32
+ */
33
+ export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
34
+ // Delegate to simple types
35
+ return simpleTypes.convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary);
36
+ }
37
+ /**
38
+ * Creates a Web Tool Geoprocessing item from a template
39
+ *
40
+ * @param {IItemTemplate} template The template
41
+ * @param {any} templateDictionary The template dictionary
42
+ * @param {UserSession} destinationAuthentication The destination user session info
43
+ * @param itemProgressCallback An item progress callback
44
+ * @returns {Promise<ICreateItemFromTemplateResponse>}
45
+ */
46
+ export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
47
+ return new Promise(resolve => {
48
+ // Interrupt process if progress callback returns `false`
49
+ if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Started, 0)) {
50
+ itemProgressCallback(template.itemId, common.EItemProgressStatus.Ignored, 0);
51
+ resolve(common.generateEmptyCreationResponse(template.type));
52
+ }
53
+ else {
54
+ // Replace the templatized symbols in a copy of the template
55
+ let newItemTemplate = common.cloneObject(template);
56
+ newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
57
+ if (template.item.thumbnail) {
58
+ newItemTemplate.item.thumbnail = template.item.thumbnail;
59
+ }
60
+ createWebTool(newItemTemplate, templateDictionary, destinationAuthentication).then(createResponse => {
61
+ // Interrupt process if progress callback returns `false`
62
+ if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.itemId)) {
63
+ itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
64
+ common
65
+ .removeItem(createResponse.itemId, destinationAuthentication)
66
+ .then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
67
+ }
68
+ else {
69
+ // Add the new item to the settings
70
+ templateDictionary[template.itemId] = {
71
+ itemId: createResponse.itemId,
72
+ itemUrl: templateDictionary["portalBaseUrl"] + "/sharing/rest/content/items/" + createResponse.itemId
73
+ };
74
+ newItemTemplate.itemId = createResponse.itemId;
75
+ newItemTemplate.data = {};
76
+ // Update the template again now that we have the new item id
77
+ newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
78
+ resolve({
79
+ item: newItemTemplate,
80
+ id: createResponse.itemId,
81
+ type: newItemTemplate.type,
82
+ postProcess: false
83
+ });
84
+ }
85
+ }, () => {
86
+ itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
87
+ resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
88
+ });
89
+ }
90
+ });
91
+ }
92
+ /**
93
+ * Get the urls available on the portal self.
94
+ *
95
+ * @param {IItemTemplate} template The template
96
+ * @param {any} templateDictionary The template dictionary
97
+ * @param {UserSession} destinationAuthentication The destination user session info
98
+ * @returns List of http and https helper urls
99
+ */
100
+ export function createWebTool(template, templateDictionary, destinationAuthentication) {
101
+ return new Promise((resolve, reject) => {
102
+ if (templateDictionary?.portalUrls?.notebooks.https.length > 0) {
103
+ const notebookUrl = templateDictionary.portalUrls.notebooks.https[0];
104
+ const url = `https://${notebookUrl}/admin/services/createService?f=json&request.preventCache=${Date.now()}`;
105
+ const params = {
106
+ "serviceProperties": {
107
+ "description": template.item.description,
108
+ "provider": "notebooks",
109
+ "type": "GPServer",
110
+ "jsonProperties": {
111
+ "title": template.item.title,
112
+ "notebookId": template.data.notebookId,
113
+ "tasks": [{
114
+ "type": "notebook",
115
+ "name": template.data.name
116
+ }]
117
+ }
118
+ }
119
+ };
120
+ const requestOptions = {
121
+ httpMethod: "POST",
122
+ authentication: destinationAuthentication,
123
+ params,
124
+ headers: {
125
+ Accept: "application/json",
126
+ Authorization: `Bearer ${destinationAuthentication.token}`,
127
+ "Content-Type": "application/json",
128
+ "X-Esri-Authorization": `Bearer ${destinationAuthentication.token}`
129
+ },
130
+ };
131
+ request(url, requestOptions).then((response) => {
132
+ resolve(response);
133
+ }, e => {
134
+ reject(e);
135
+ });
136
+ }
137
+ else {
138
+ reject();
139
+ }
140
+ });
141
+ }
142
+ //# sourceMappingURL=web-tool-processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-tool-processor.js","sourceRoot":"","sources":["../../src/web-tool-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAmB,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,2BAA2B;IAC3B,OAAO,WAAW,CAAC,qBAAqB,CACtC,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,CACnB,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAA8B,EAC9B,kBAAuB,EACvB,yBAA6C,EAC7C,oBAAkD;IAElD,OAAO,IAAI,OAAO,CAAyC,OAAO,CAAC,EAAE;QACnE,yDAAyD;QACzD,IACE,CAAC,oBAAoB,CACnB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAClC,CAAC,CACF,EACD;YACA,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAClC,CAAC,CACF,CAAC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UAAU;oBAClB,gBAAgB,EAAE;wBAChB,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;wBAC5B,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU;wBACtC,OAAO,EAAE,CAAC;gCACR,MAAM,EAAE,UAAU;gCAClB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI;6BAC3B,CAAC;qBACH;iBACF;aACF,CAAC;YAEF,MAAM,cAAc,GAAG;gBACrB,UAAU,EAAE,MAAM;gBAClB,cAAc,EAAE,yBAAyB;gBACzC,MAAM;gBACN,OAAO,EAAE;oBACP,MAAM,EAAE,kBAAkB;oBAC1B,aAAa,EAAE,UAAU,yBAAyB,CAAC,KAAK,EAAE;oBAC1D,cAAc,EAAE,kBAAkB;oBAClC,sBAAsB,EAAE,UAAU,yBAAyB,CAAC,KAAK,EAAE;iBACpE;aACiB,CAAC;YAErB,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC7C,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC,EAAE,CAAC,CAAC,EAAE;gBACL,MAAM,CAAC,CAAC,CAAC,CAAC;YACZ,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,MAAM,EAAE,CAAC;SACV;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@esri/solution-web-tool",
3
+ "version": "5.3.1",
4
+ "description": "Manages the creation and deployment of web tool geoprocessing service item type for @esri/solution.js.",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/esm/index.js",
10
+ "require": "./dist/cjs/index.js"
11
+ },
12
+ "./package.json": "./package.json"
13
+ },
14
+ "types": "dist/esm/index.d.ts",
15
+ "author": "Esri",
16
+ "license": "Apache-2.0",
17
+ "files": [
18
+ "dist/**"
19
+ ],
20
+ "devDependencies": {
21
+ "@esri/arcgis-rest-auth": "^3.7.0",
22
+ "@esri/arcgis-rest-feature-layer": "^3.7.0",
23
+ "@esri/arcgis-rest-portal": "^3.7.0",
24
+ "@esri/arcgis-rest-request": "^3.7.0",
25
+ "@esri/arcgis-rest-service-admin": "^3.7.0",
26
+ "@esri/hub-common": "^14.109.1",
27
+ "@esri/hub-initiatives": "^14.0.0",
28
+ "@esri/hub-sites": "^14.2.4",
29
+ "@esri/hub-teams": "^14.1.0",
30
+ "@esri/solution-common": "^5.3.1",
31
+ "@esri/solution-simple-types": "^5.3.1",
32
+ "@types/jasmine": "^5.1.4",
33
+ "fetch-mock": "^7.7.3",
34
+ "jasmine": "^5.1.0",
35
+ "jasmine-core": "^5.1.0",
36
+ "rollup": "^4.13.2"
37
+ },
38
+ "dependencies": {
39
+ "tslib": "1.14.1"
40
+ },
41
+ "scripts": {
42
+ "build": "npm-run-all --parallel build:*",
43
+ "build:cjs": "tsc --outDir ./dist/cjs -m commonjs",
44
+ "postbuild:cjs": "node ../../scripts/create-dist-package-jsons.mjs",
45
+ "build:esm": "tsc --outDir ./dist/esm --declaration",
46
+ "postbuild:esm": "node ../../scripts/create-dist-package-jsons.mjs",
47
+ "dev": "npm-run-all --parallel dev:*",
48
+ "dev:cjs": "tsc -w --outDir ./dist/cjs -m commonjs",
49
+ "dev:esm": "tsc -w --outDir ./dist/esm --declaration",
50
+ "getupdates": "npm-check-updates --upgrade"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "git+https://github.com/Esri/solution.js.git"
58
+ },
59
+ "contributors": [
60
+ {
61
+ "name": "Mike Tschudi",
62
+ "email": "mtschudi@esri.com"
63
+ },
64
+ {
65
+ "name": "Chris Fox",
66
+ "email": "cfox@esri.com"
67
+ },
68
+ {
69
+ "name": "John Hauck",
70
+ "email": "jhauck@esri.com"
71
+ }
72
+ ],
73
+ "bugs": {
74
+ "url": "https://github.com/Esri/solution.js/issues"
75
+ },
76
+ "homepage": "https://github.com/Esri/solution.js#readme",
77
+ "keywords": [
78
+ "typescript",
79
+ "promise",
80
+ "fetch",
81
+ "arcgis",
82
+ "esri",
83
+ "ES6"
84
+ ],
85
+ "gitHead": "d41d52b96de73949d3e6652783fad1726ae66c1b"
86
+ }