@esri/solution-simple-types 5.2.1 → 5.2.3
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/README.md +4 -7
- package/dist/esm/helpers/convert-item-to-template.d.ts +1 -2
- package/dist/esm/helpers/convert-item-to-template.js +24 -14
- package/dist/esm/helpers/convert-item-to-template.js.map +1 -1
- package/dist/{cjs/helpers/create-item-from-template.d.ts → esm/helpers/formHelpers.d.ts} +11 -3
- package/dist/esm/helpers/formHelpers.js +53 -0
- package/dist/esm/helpers/formHelpers.js.map +1 -0
- package/dist/esm/notebook.d.ts +1 -2
- package/dist/esm/notebook.js +2 -3
- package/dist/esm/notebook.js.map +1 -1
- package/dist/esm/quickcapture.d.ts +1 -2
- package/dist/esm/quickcapture.js +2 -3
- package/dist/esm/quickcapture.js.map +1 -1
- package/dist/esm/simple-types.d.ts +1 -2
- package/dist/esm/simple-types.js +2 -3
- package/dist/esm/simple-types.js.map +1 -1
- package/package.json +7 -7
- package/dist/cjs/dashboard.d.ts +0 -93
- package/dist/cjs/dashboard.js +0 -353
- package/dist/cjs/dashboard.js.map +0 -1
- package/dist/cjs/helpers/convert-item-to-template.d.ts +0 -46
- package/dist/cjs/helpers/convert-item-to-template.js +0 -236
- package/dist/cjs/helpers/convert-item-to-template.js.map +0 -1
- package/dist/cjs/helpers/create-item-from-template.js +0 -154
- package/dist/cjs/helpers/create-item-from-template.js.map +0 -1
- package/dist/cjs/helpers/notebook-helpers.d.ts +0 -19
- package/dist/cjs/helpers/notebook-helpers.js +0 -25
- package/dist/cjs/helpers/notebook-helpers.js.map +0 -1
- package/dist/cjs/helpers/quickcapture-helpers.d.ts +0 -18
- package/dist/cjs/helpers/quickcapture-helpers.js +0 -23
- package/dist/cjs/helpers/quickcapture-helpers.js.map +0 -1
- package/dist/cjs/helpers/simple-type-helpers.d.ts +0 -18
- package/dist/cjs/helpers/simple-type-helpers.js +0 -23
- package/dist/cjs/helpers/simple-type-helpers.js.map +0 -1
- package/dist/cjs/helpers/update-notebook-data.d.ts +0 -17
- package/dist/cjs/helpers/update-notebook-data.js +0 -28
- package/dist/cjs/helpers/update-notebook-data.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -27
- package/dist/cjs/index.js +0 -37
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/notebook.d.ts +0 -66
- package/dist/cjs/notebook.js +0 -134
- package/dist/cjs/notebook.js.map +0 -1
- package/dist/cjs/oic.d.ts +0 -53
- package/dist/cjs/oic.js +0 -171
- package/dist/cjs/oic.js.map +0 -1
- package/dist/cjs/quickcapture.d.ts +0 -76
- package/dist/cjs/quickcapture.js +0 -144
- package/dist/cjs/quickcapture.js.map +0 -1
- package/dist/cjs/simple-types.d.ts +0 -57
- package/dist/cjs/simple-types.js +0 -95
- package/dist/cjs/simple-types.js.map +0 -1
- package/dist/cjs/webmap.d.ts +0 -102
- package/dist/cjs/webmap.js +0 -318
- package/dist/cjs/webmap.js.map +0 -1
- package/dist/cjs/webmappingapplication.d.ts +0 -176
- package/dist/cjs/webmappingapplication.js +0 -675
- package/dist/cjs/webmappingapplication.js.map +0 -1
- package/dist/cjs/workforce.d.ts +0 -34
- package/dist/cjs/workforce.js +0 -45
- package/dist/cjs/workforce.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
[![npm status][npm-img]][npm-url]
|
|
2
2
|
[![Build status][travis-img]][travis-url]
|
|
3
3
|
[![gzip bundle size][gzip-img]][npm-url]
|
|
4
|
-
[![Coverage status][coverage-img]][coverage-url]
|
|
5
4
|
[![Apache 2.0 licensed][license-img]][license-url]
|
|
6
5
|
|
|
7
6
|
[npm-img]: https://img.shields.io/npm/v/@esri/solution-simple-types.svg?style=round-square&color=blue
|
|
8
7
|
[npm-url]: https://www.npmjs.com/package/@esri/solution-simple-types
|
|
9
|
-
[travis-img]: https://img.shields.io/travis/Esri/solution.js/develop.svg
|
|
8
|
+
[travis-img]: https://img.shields.io/travis/com/Esri/solution.js/develop.svg
|
|
10
9
|
[travis-url]: https://travis-ci.org/Esri/solution.js
|
|
11
|
-
[gzip-img]: https://img.badgesize.io/https://unpkg.com/@esri/solution-simple-types/dist/
|
|
12
|
-
[coverage-img]: https://coveralls.io/repos/github/Esri/solution.js/badge.svg
|
|
13
|
-
[coverage-url]: https://coveralls.io/github/Esri/solution.js
|
|
10
|
+
[gzip-img]: https://img.badgesize.io/https://unpkg.com/@esri/solution-simple-types/dist/esm/index.js?compression=gzip
|
|
14
11
|
[license-img]: https://img.shields.io/badge/license-Apache%202.0-blue.svg
|
|
15
12
|
[license-url]: #license
|
|
16
13
|
|
|
@@ -18,7 +15,7 @@
|
|
|
18
15
|
|
|
19
16
|
> Manages the creation and deployment of simple item types for [`@esri/solution-*`](https://github.com/Esri/solution.js).
|
|
20
17
|
|
|
21
|
-
### [API Reference](https://esri.github.io/solution.js/
|
|
18
|
+
### [API Reference](https://esri.github.io/solution.js/modules/simple_types_src.html)
|
|
22
19
|
|
|
23
20
|
### Issues
|
|
24
21
|
|
|
@@ -36,7 +33,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines
|
|
|
36
33
|
|
|
37
34
|
### License
|
|
38
35
|
|
|
39
|
-
Copyright © 2018
|
|
36
|
+
Copyright © 2018 Esri
|
|
40
37
|
|
|
41
38
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
42
39
|
you may not use this file except in compliance with the License.
|
|
@@ -17,7 +17,6 @@ import * as common from "@esri/solution-common";
|
|
|
17
17
|
/**
|
|
18
18
|
* Converts an item into a template.
|
|
19
19
|
*
|
|
20
|
-
* @param solutionItemId The solution to contain the template
|
|
21
20
|
* @param itemInfo Info about the item
|
|
22
21
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
22
|
* @param srcAuthentication Credentials for requests to source items
|
|
@@ -25,7 +24,7 @@ import * as common from "@esri/solution-common";
|
|
|
25
24
|
*
|
|
26
25
|
* @returns A promise that will resolve when the template has been created
|
|
27
26
|
*/
|
|
28
|
-
export declare function convertItemToTemplate(
|
|
27
|
+
export declare function convertItemToTemplate(itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
|
|
29
28
|
/**
|
|
30
29
|
* Extracts the feature layer ids for a Data Pipeline's sources and sinks.
|
|
31
30
|
*
|
|
@@ -21,10 +21,11 @@ import * as quickcapture from "../quickcapture";
|
|
|
21
21
|
import * as webmap from "../webmap";
|
|
22
22
|
import * as webmappingapplication from "../webmappingapplication";
|
|
23
23
|
import * as workforce from "../workforce";
|
|
24
|
+
import * as formHelpers from "./formHelpers";
|
|
25
|
+
// ------------------------------------------------------------------------------------------------------------------ //
|
|
24
26
|
/**
|
|
25
27
|
* Converts an item into a template.
|
|
26
28
|
*
|
|
27
|
-
* @param solutionItemId The solution to contain the template
|
|
28
29
|
* @param itemInfo Info about the item
|
|
29
30
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
30
31
|
* @param srcAuthentication Credentials for requests to source items
|
|
@@ -32,7 +33,7 @@ import * as workforce from "../workforce";
|
|
|
32
33
|
*
|
|
33
34
|
* @returns A promise that will resolve when the template has been created
|
|
34
35
|
*/
|
|
35
|
-
export function convertItemToTemplate(
|
|
36
|
+
export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
36
37
|
return new Promise((resolve, reject) => {
|
|
37
38
|
// Init template
|
|
38
39
|
const itemTemplate = common.createInitializedItemTemplate(itemInfo);
|
|
@@ -110,18 +111,27 @@ export function convertItemToTemplate(solutionItemId, itemInfo, destAuthenticati
|
|
|
110
111
|
itemTemplate.data = null;
|
|
111
112
|
// Add the form data to the template for a post-process resource upload
|
|
112
113
|
if (itemDataResponse) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
templateModifyingPromise = new Promise(
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises, no-async-promise-executor
|
|
116
|
+
async (resolve) => {
|
|
117
|
+
let zipObject = await common.blobToZipObject(itemDataResponse);
|
|
118
|
+
// Templatize the form's webhooks,
|
|
119
|
+
zipObject = await formHelpers.templatizeFormWebHooks(zipObject, itemTemplate.item.isOrgItem);
|
|
120
|
+
itemTemplate.item.name = _getFormDataFilename(itemTemplate.item.name, itemDataResponse.name, `${itemTemplate.itemId}.zip`);
|
|
121
|
+
const templatizedFormData = await common.zipObjectToZipFile(zipObject, itemTemplate.item.name);
|
|
122
|
+
// Add the data file to the template so that it can be uploaded with the other resources in the solution
|
|
123
|
+
const storageName = common.convertItemResourceToStorageResource(itemTemplate.itemId, itemTemplate.item.name, common.SolutionTemplateFormatVersion, common.SolutionResourceType.data);
|
|
124
|
+
const dataFile = {
|
|
125
|
+
itemId: itemTemplate.itemId,
|
|
126
|
+
file: templatizedFormData,
|
|
127
|
+
folder: storageName.folder,
|
|
128
|
+
filename: itemTemplate.item.name
|
|
129
|
+
};
|
|
130
|
+
itemTemplate.dataFile = dataFile;
|
|
131
|
+
// Update the template's resources
|
|
132
|
+
itemTemplate.resources.push(storageName.folder + "/" + storageName.filename);
|
|
133
|
+
resolve(itemTemplate);
|
|
134
|
+
});
|
|
125
135
|
}
|
|
126
136
|
break;
|
|
127
137
|
case "Notebook":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-item-to-template.js","sourceRoot":"","sources":["../../../src/helpers/convert-item-to-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"convert-item-to-template.js","sourceRoot":"","sources":["../../../src/helpers/convert-item-to-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAG7C,wHAAwH;AAExH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,gBAAgB;QAChB,MAAM,YAAY,GAAyB,MAAM,CAAC,6BAA6B,CAC7E,QAAQ,CACT,CAAC;QAEF,uCAAuC;QACvC,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,cAAc,CAC1C,YAAY,CAAC,IAAI,CAAC,EAAE,EACpB,YAAY,CAAC,IAAI,CAAC,EAAE,EACpB,SAAS,CACV,CAAC;QAEF,wBAAwB;QACxB,MAAM,cAAc,GAAG,MAAM,CAAC,kCAAkC,CAC9D,YAAY,CAAC,MAAM,EACnB,SAAS,EACT,iBAAiB,CAClB,CAAC;QAEF,iCA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,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IAEjF,eAAe,CAAC,OAAO,CACrB,YAAY,CAAC,EAAE;QACb,IAAI,YAAY,CAAC,IAAI,KAAK,sBAAsB,IAAI,YAAY,CAAC,IAAI,KAAK,oBAAoB,EAAE;YAC9F,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,+BAA+B,CAAC,CAAA;YACtF,IAAI,gBAAgB,EAAE;gBACpB,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aACrC;SACF;IACH,CAAC,CACF,CAAC;IAEF,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAAgB,EAChB,YAAoB,EACpB,YAAoB;IAEpB,MAAM,gBAAgB,GAAG,QAAQ,IAAI,YAAY,CAAC;IAClD,MAAM,QAAQ,GACZ,gBAAgB,IAAI,gBAAgB,KAAK,WAAW;QAClD,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,YAAY,CAAC;IACnB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @license
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2024 Esri
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,5 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
17
|
-
|
|
16
|
+
import JSZip from "jszip";
|
|
17
|
+
/**
|
|
18
|
+
* Templatizes the URLs in webhooks in a form's zip object.
|
|
19
|
+
*
|
|
20
|
+
* @param zipObject Form zip object to templatize; it is modified in place
|
|
21
|
+
* @param isOrgItem Indicates whether this item and the user whose credential was used to fetch this item belong
|
|
22
|
+
* to the same ArcGIS Enterprise Portal or ArcGIS Online Organization
|
|
23
|
+
* @returns Promise that resolves to the modified zip object
|
|
24
|
+
*/
|
|
25
|
+
export declare function templatizeFormWebHooks(zipObject: JSZip, isOrgItem: boolean): Promise<JSZip>;
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
import * as common from "@esri/solution-common";
|
|
17
|
+
// ------------------------------------------------------------------------------------------------------------------ //
|
|
18
|
+
/**
|
|
19
|
+
* Templatizes the URLs in webhooks in a form's zip object.
|
|
20
|
+
*
|
|
21
|
+
* @param zipObject Form zip object to templatize; it is modified in place
|
|
22
|
+
* @param isOrgItem Indicates whether this item and the user whose credential was used to fetch this item belong
|
|
23
|
+
* to the same ArcGIS Enterprise Portal or ArcGIS Online Organization
|
|
24
|
+
* @returns Promise that resolves to the modified zip object
|
|
25
|
+
*/
|
|
26
|
+
export async function templatizeFormWebHooks(zipObject, isOrgItem) {
|
|
27
|
+
const webhooks = await common.getWebHooksFromZipObject(zipObject);
|
|
28
|
+
if (webhooks.length > 0) {
|
|
29
|
+
webhooks.forEach((webhook) => {
|
|
30
|
+
// Templatize the webhook URL
|
|
31
|
+
let url = webhook.url;
|
|
32
|
+
const urlObj = new URL(url);
|
|
33
|
+
const server = `${urlObj.protocol}//${urlObj.host}`;
|
|
34
|
+
const workflowServer = "https://workflow.arcgis.com";
|
|
35
|
+
if (server === workflowServer) {
|
|
36
|
+
// Templatize organization
|
|
37
|
+
const partialPath = url.substring(workflowServer.length);
|
|
38
|
+
const partialPathParts = partialPath.split("/");
|
|
39
|
+
const orgId = partialPathParts[1];
|
|
40
|
+
url = url.replace(orgId, "{{user.orgId}}");
|
|
41
|
+
}
|
|
42
|
+
else if (isOrgItem) {
|
|
43
|
+
// Templatize server
|
|
44
|
+
url = url.replace(server, "{{portalBaseUrl}}");
|
|
45
|
+
}
|
|
46
|
+
webhook.url = url;
|
|
47
|
+
});
|
|
48
|
+
zipObject = await common.setWebHooksInZipObject(zipObject, webhooks);
|
|
49
|
+
}
|
|
50
|
+
// Return the modified zip object
|
|
51
|
+
return Promise.resolve(zipObject);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=formHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formHelpers.js","sourceRoot":"","sources":["../../../src/helpers/formHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAGhD,wHAAwH;AAExH;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,SAAgB,EAChB,SAAkB;IAElB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAClE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAY,EAAE,EAAE;YAChC,6BAA6B;YAC7B,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YACtB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YAE5B,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC;YACpD,MAAM,cAAc,GAAG,6BAA6B,CAAC;YAErD,IAAI,MAAM,KAAK,cAAc,EAAE;gBAC7B,0BAA0B;gBAC1B,MAAM,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;gBACzD,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAChD,MAAM,KAAK,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;gBAClC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;aAE5C;iBAAM,IAAI,SAAS,EAAE;gBACpB,oBAAoB;gBACpB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;aAChD;YAED,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,SAAS,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;KACtE;IAED,iCAAiC;IACjC,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/esm/notebook.d.ts
CHANGED
|
@@ -17,14 +17,13 @@ import * as common from "@esri/solution-common";
|
|
|
17
17
|
/**
|
|
18
18
|
* Converts a notebook item into a template.
|
|
19
19
|
*
|
|
20
|
-
* @param solutionItemId The solution to contain the template
|
|
21
20
|
* @param itemInfo Info about the item
|
|
22
21
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
22
|
* @param srcAuthentication Credentials for requests to source items
|
|
24
23
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
25
24
|
* @returns A promise that will resolve when the template has been created
|
|
26
25
|
*/
|
|
27
|
-
export declare function convertItemToTemplate(
|
|
26
|
+
export declare function convertItemToTemplate(itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
|
|
28
27
|
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
|
29
28
|
/**
|
|
30
29
|
* Converts a Python Notebook item to a template.
|
package/dist/esm/notebook.js
CHANGED
|
@@ -19,18 +19,17 @@ import * as notebookHelpers from "./helpers/notebook-helpers";
|
|
|
19
19
|
/**
|
|
20
20
|
* Converts a notebook item into a template.
|
|
21
21
|
*
|
|
22
|
-
* @param solutionItemId The solution to contain the template
|
|
23
22
|
* @param itemInfo Info about the item
|
|
24
23
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
25
24
|
* @param srcAuthentication Credentials for requests to source items
|
|
26
25
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
27
26
|
* @returns A promise that will resolve when the template has been created
|
|
28
27
|
*/
|
|
29
|
-
export function convertItemToTemplate(
|
|
28
|
+
export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
30
29
|
// Delegate back to simple-types, which will in-turn delegate
|
|
31
30
|
// to convertNotebookToTemplate at the correct point in the process
|
|
32
31
|
// This is a temporary refactor step
|
|
33
|
-
return notebookHelpers.convertItemToTemplate(
|
|
32
|
+
return notebookHelpers.convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
34
33
|
}
|
|
35
34
|
// Delegate back to simple-types
|
|
36
35
|
// This is a temporary refactor step
|
package/dist/esm/notebook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.js","sourceRoot":"","sources":["../../src/notebook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,+CAA+C;AAC/C,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAE9D
|
|
1
|
+
{"version":3,"file":"notebook.js","s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EAAE,MAAM,CAAC,UAAU,CACrB,gBAAgB,CAAC,IAAI,EACrB,gBAAgB,CAAC,MAAM,GAAG,QAAQ,CACnC;SACF,CAAC;QACF,MAAM;aACH,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC;aACzC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CACzB,MAAc,EACd,IAAY,EACZ,SAAgB,EAChB,QAA8B,EAC9B,SAAiC,EACjC,kBAAuB,EACvB,cAAkC;IAElC,OAAO,MAAM,CAAC,gCAAgC,CAC5C,MAAM,EACN,kBAAkB,EAClB,cAAc,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -17,14 +17,13 @@ import * as common from "@esri/solution-common";
|
|
|
17
17
|
/**
|
|
18
18
|
* Converts a Quick Capture item into a template.
|
|
19
19
|
*
|
|
20
|
-
* @param solutionItemId The solution to contain the template
|
|
21
20
|
* @param itemInfo Info about the item
|
|
22
21
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
22
|
* @param srcAuthentication Credentials for requests to source items
|
|
24
23
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
25
24
|
* @returns A promise that will resolve when the template has been created
|
|
26
25
|
*/
|
|
27
|
-
export declare function convertItemToTemplate(
|
|
26
|
+
export declare function convertItemToTemplate(itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
|
|
28
27
|
/**
|
|
29
28
|
* Converts an quick capture item to a template.
|
|
30
29
|
*
|
package/dist/esm/quickcapture.js
CHANGED
|
@@ -19,18 +19,17 @@ import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
|
|
|
19
19
|
/**
|
|
20
20
|
* Converts a Quick Capture item into a template.
|
|
21
21
|
*
|
|
22
|
-
* @param solutionItemId The solution to contain the template
|
|
23
22
|
* @param itemInfo Info about the item
|
|
24
23
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
25
24
|
* @param srcAuthentication Credentials for requests to source items
|
|
26
25
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
27
26
|
* @returns A promise that will resolve when the template has been created
|
|
28
27
|
*/
|
|
29
|
-
export function convertItemToTemplate(
|
|
28
|
+
export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
30
29
|
// Delegate back to simple-types, which will in-turn delegate
|
|
31
30
|
// to convertNotebookToTemplate at the correct point in the process
|
|
32
31
|
// This is a temporary refactor step
|
|
33
|
-
return quickcaptureHelpers.convertItemToTemplate(
|
|
32
|
+
return quickcaptureHelpers.convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
34
33
|
}
|
|
35
34
|
/**
|
|
36
35
|
* Converts an quick capture item to a template.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickcapture.js","sourceRoot":"","sources":["../../src/quickcapture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,mBAAmB,MAAM,gCAAgC,CAAC;AAEtE,mHAAmH;AAEnH
|
|
1
|
+
{"version":3,"file":"quickcapture.js","sourceRoot":"","sources":["../../src/quickcapture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,mBAAmB,MAAM,gCAAgC,CAAC;AAEtE,mHAAmH;AAEnH;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,6DAA6D;IAC7D,mEAAmE;IACnE,oCAAoC;IACpC,OAAO,mBAAmB,CAAC,qBAAqB,CAC9C,QAAQ,EAC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yBAAyB,EACzB,oBAAoB,CACrB,CAAC;AACJ,CAAC;AAED,YAAY"}
|
|
@@ -17,14 +17,13 @@ import { ICreateItemFromTemplateResponse, IDatasourceInfo, IItemProgressCallback
|
|
|
17
17
|
/**
|
|
18
18
|
* Converts an item into a template.
|
|
19
19
|
*
|
|
20
|
-
* @param solutionItemId The solution to contain the template
|
|
21
20
|
* @param itemInfo Info about the item
|
|
22
21
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
22
|
* @param srcAuthentication Credentials for requests to source items
|
|
24
23
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
25
24
|
* @returns A promise that will resolve when the template has been created
|
|
26
25
|
*/
|
|
27
|
-
export declare function convertItemToTemplate(
|
|
26
|
+
export declare function convertItemToTemplate(itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession, templateDictionary: any): Promise<IItemTemplate>;
|
|
28
27
|
/**
|
|
29
28
|
* Delegate to simpleType creator
|
|
30
29
|
*
|
package/dist/esm/simple-types.js
CHANGED
|
@@ -27,15 +27,14 @@ import * as simpleTypeHelpers from "./helpers/simple-type-helpers";
|
|
|
27
27
|
/**
|
|
28
28
|
* Converts an item into a template.
|
|
29
29
|
*
|
|
30
|
-
* @param solutionItemId The solution to contain the template
|
|
31
30
|
* @param itemInfo Info about the item
|
|
32
31
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
33
32
|
* @param srcAuthentication Credentials for requests to source items
|
|
34
33
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
35
34
|
* @returns A promise that will resolve when the template has been created
|
|
36
35
|
*/
|
|
37
|
-
export function convertItemToTemplate(
|
|
38
|
-
return simpleTypeHelpers.convertItemToTemplate(
|
|
36
|
+
export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
37
|
+
return simpleTypeHelpers.convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
39
38
|
}
|
|
40
39
|
/**
|
|
41
40
|
* Delegate to simpleType creator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-types.js","sourceRoot":"","sources":["../../src/simple-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,qBAAqB,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAML,gCAAgC,EAEjC,MAAM,uBAAuB,CAAC;AAE/B,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"simple-types.js","sourceRoot":"","sources":["../../src/simple-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,qBAAqB,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAML,gCAAgC,EAEjC,MAAM,uBAAuB,CAAC;AAE/B,+CAA+C;AAC/C,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAa,EACb,kBAA+B,EAC/B,iBAA8B,EAC9B,kBAAuB;IAEvB,OAAO,iBAAiB,CAAC,qBAAqB,CAC5C,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,CACnB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAuB,EACvB,kBAAuB,EACvB,yBAAsC,EACtC,oBAA2C;IAE3C,OAAO,iBAAiB,CAAC,sBAAsB,CAC7C,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,CACrB,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACxC,gBAA+B,EAC/B,eAAkC,EAClC,IAAY;IAEZ,QAAQ,IAAI,EAAE;QACZ,KAAK,yBAAyB;YAC5B,qBAAqB,CAAC,0BAA0B,CAC9C,gBAAgB,EAChB,eAAe,CAChB,CAAC;YACF,MAAM;QACR,KAAK,WAAW;YACd,SAAS,CAAC,0BAA0B,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;YACxE,MAAM;QACR,KAAK,SAAS;YACZ,MAAM,CAAC,0BAA0B,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;YACrE,MAAM;KACT;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CACzB,MAAc,EACd,IAAY,EACZ,SAAgB,EAChB,QAAuB,EACvB,SAA0B,EAC1B,kBAAuB,EACvB,cAA2B;IAE3B,OAAO,gCAAgC,CACrC,MAAM,EACN,kBAAkB,EAClB,cAAc,CACf,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esri/solution-simple-types",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
4
4
|
"description": "Manages the creation and deployment of simple item types for @esri/solution.js.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"@esri/arcgis-rest-portal": "^3.7.0",
|
|
24
24
|
"@esri/arcgis-rest-request": "^3.7.0",
|
|
25
25
|
"@esri/arcgis-rest-service-admin": "^3.7.0",
|
|
26
|
-
"@esri/hub-common": "^14.
|
|
26
|
+
"@esri/hub-common": "^14.97.0",
|
|
27
27
|
"@esri/hub-sites": "^14.2.2",
|
|
28
28
|
"@esri/hub-teams": "^14.1.0",
|
|
29
|
-
"@esri/solution-common": "^5.2.
|
|
30
|
-
"@esri/solution-feature-layer": "^5.2.
|
|
31
|
-
"@esri/solution-file": "^5.2.
|
|
32
|
-
"@esri/solution-group": "^5.2.
|
|
29
|
+
"@esri/solution-common": "^5.2.3",
|
|
30
|
+
"@esri/solution-feature-layer": "^5.2.3",
|
|
31
|
+
"@esri/solution-file": "^5.2.3",
|
|
32
|
+
"@esri/solution-group": "^5.2.3",
|
|
33
33
|
"@types/jasmine": "^5.1.4",
|
|
34
34
|
"fetch-mock": "^7.7.3",
|
|
35
35
|
"jasmine": "^5.1.0",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"esri",
|
|
91
91
|
"ES6"
|
|
92
92
|
],
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "bcf0907f47cf8a2970f8da38f8e1e2a4ac7beccb"
|
|
94
94
|
}
|
package/dist/cjs/dashboard.d.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2018 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import * as common from "@esri/solution-common";
|
|
17
|
-
/**
|
|
18
|
-
* Converts a dashboard item to a template.
|
|
19
|
-
*
|
|
20
|
-
* @param itemTemplate Template for the dashboard item
|
|
21
|
-
* @param templateDictionary Hash of key details used for variable replacement
|
|
22
|
-
* @returns templatized itemTemplate
|
|
23
|
-
*/
|
|
24
|
-
export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate, templateDictionary: any): common.IItemTemplate;
|
|
25
|
-
/**
|
|
26
|
-
* Templatizes all itemIds and updates the dependency array
|
|
27
|
-
*
|
|
28
|
-
* @param itemTemplate Template for the dashboard item
|
|
29
|
-
* @param templateDictionary Hash of key details used for variable replacement
|
|
30
|
-
* @returns The updated itemTemplate
|
|
31
|
-
* @private
|
|
32
|
-
*/
|
|
33
|
-
export declare function _extractDependencies(itemTemplate: common.IItemTemplate, templateDictionary: any): common.IItemTemplate;
|
|
34
|
-
/**
|
|
35
|
-
* Templatize datasource itemIds and update the dependency array
|
|
36
|
-
*
|
|
37
|
-
* @param obj A widget, selector, or urlParameter that contains a datasets collection
|
|
38
|
-
* @param itemTemplate Template for the dashboard item
|
|
39
|
-
* @param templateDictionary Hash of key details used for variable replacement
|
|
40
|
-
* @private
|
|
41
|
-
*/
|
|
42
|
-
export declare function _getDatasourceDependencies(obj: any, itemTemplate: common.IItemTemplate, templateDictionary: any): void;
|
|
43
|
-
/**
|
|
44
|
-
* Templatize field references for datasources and widgets.
|
|
45
|
-
*
|
|
46
|
-
* @param solutionTemplate The solution item template
|
|
47
|
-
* @param datasourceInfos A list of datasource info objects that contain key values to templatize field references
|
|
48
|
-
* @returns The solutionTemplate with templatized field references
|
|
49
|
-
*/
|
|
50
|
-
export declare function postProcessFieldReferences(solutionTemplate: common.IItemTemplate, datasourceInfos: common.IDatasourceInfo[]): common.IItemTemplate;
|
|
51
|
-
/**
|
|
52
|
-
* Add all dataset ids to the appropriate datasource info object so we can navigate any relative references
|
|
53
|
-
*
|
|
54
|
-
* @param objs Thes can be widgets, selectors, or urlParameters
|
|
55
|
-
* @param datasourceInfos A list of objects that contain key details about the datasources from the application
|
|
56
|
-
* @private
|
|
57
|
-
*/
|
|
58
|
-
export declare function _updateDatasourceReferences(objs: any, datasourceInfos: common.IDatasourceInfo[]): void;
|
|
59
|
-
/**
|
|
60
|
-
* Templatize all datasets and/or events for the objects at the given path
|
|
61
|
-
*
|
|
62
|
-
* @param itemTemplate Template for the dashboard item
|
|
63
|
-
* @param path A property path to an array of objects that could contain datasets or events
|
|
64
|
-
* @param datasourceInfos A list of objects that contain key details about the datasources from the application
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
export declare function _templatize(itemTemplate: common.IItemTemplate, path: string, datasourceInfos: common.IDatasourceInfo[]): void;
|
|
68
|
-
/**
|
|
69
|
-
* For any service dataset datasource templatize all field references
|
|
70
|
-
*
|
|
71
|
-
* @param objs A list of objects that can contain field references
|
|
72
|
-
* @param datasourceInfos A list of objects that contain key details about the datasources from the application
|
|
73
|
-
* @returns An updated list of objects with templatized field references
|
|
74
|
-
* @private
|
|
75
|
-
*/
|
|
76
|
-
export declare function _templatizeByDatasource(objs: any[], datasourceInfos: common.IDatasourceInfo[]): any;
|
|
77
|
-
/**
|
|
78
|
-
* Find the appropriate datasource info object from the datasourceInfo collection
|
|
79
|
-
*
|
|
80
|
-
* @param obj Can be a Dataset or an event
|
|
81
|
-
* @param datasourceInfos A list of objects that contain key details about the datasources from the application
|
|
82
|
-
* @returns The supporting datasource info for the given object
|
|
83
|
-
* @private
|
|
84
|
-
*/
|
|
85
|
-
export declare function _getDatasourceInfo(obj: any, datasourceInfos: common.IDatasourceInfo[]): any;
|
|
86
|
-
/**
|
|
87
|
-
* Verifies if the datasource info contains the given id and adds it if not
|
|
88
|
-
*
|
|
89
|
-
* @param ds The datasource info to add the reference to
|
|
90
|
-
* @param id The id from dashboard object, commonly another widget
|
|
91
|
-
* @private
|
|
92
|
-
*/
|
|
93
|
-
export declare function _updateReferences(ds: common.IDatasourceInfo, id: string): void;
|