@esri/solution-simple-types 1.1.2 → 1.2.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/esm/dashboard.d.ts +0 -1
- package/dist/esm/dashboard.js +55 -56
- package/dist/esm/dashboard.js.map +1 -1
- package/dist/esm/helpers/convert-item-to-template.d.ts +3 -2
- package/dist/esm/helpers/convert-item-to-template.js +35 -37
- package/dist/esm/helpers/convert-item-to-template.js.map +1 -1
- package/dist/esm/helpers/create-item-from-template.js +33 -41
- package/dist/esm/helpers/create-item-from-template.js.map +1 -1
- package/dist/esm/helpers/update-notebook-data.js +1 -1
- package/dist/esm/helpers/update-notebook-data.js.map +1 -1
- package/dist/esm/notebook.d.ts +3 -2
- package/dist/esm/notebook.js +16 -15
- package/dist/esm/notebook.js.map +1 -1
- package/dist/esm/oic.d.ts +3 -2
- package/dist/esm/oic.js +30 -29
- package/dist/esm/oic.js.map +1 -1
- package/dist/esm/quickcapture.d.ts +3 -2
- package/dist/esm/quickcapture.js +22 -21
- package/dist/esm/quickcapture.js.map +1 -1
- package/dist/esm/simple-types.d.ts +3 -2
- package/dist/esm/simple-types.js +4 -3
- package/dist/esm/simple-types.js.map +1 -1
- package/dist/esm/webmap.d.ts +3 -2
- package/dist/esm/webmap.js +39 -39
- package/dist/esm/webmap.js.map +1 -1
- package/dist/esm/webmappingapplication.d.ts +3 -2
- package/dist/esm/webmappingapplication.js +126 -128
- package/dist/esm/webmappingapplication.js.map +1 -1
- package/dist/esm/workforce.d.ts +3 -2
- package/dist/esm/workforce.js +4 -3
- package/dist/esm/workforce.js.map +1 -1
- package/dist/node/dashboard.d.ts +0 -1
- package/dist/node/dashboard.js +56 -57
- package/dist/node/dashboard.js.map +1 -1
- package/dist/node/helpers/convert-item-to-template.d.ts +3 -2
- package/dist/node/helpers/convert-item-to-template.js +43 -45
- package/dist/node/helpers/convert-item-to-template.js.map +1 -1
- package/dist/node/helpers/create-item-from-template.js +37 -45
- package/dist/node/helpers/create-item-from-template.js.map +1 -1
- package/dist/node/helpers/notebook-helpers.js +3 -3
- package/dist/node/helpers/notebook-helpers.js.map +1 -1
- package/dist/node/helpers/quickcapture-helpers.js +2 -2
- package/dist/node/helpers/quickcapture-helpers.js.map +1 -1
- package/dist/node/helpers/simple-type-helpers.js +2 -2
- package/dist/node/helpers/simple-type-helpers.js.map +1 -1
- package/dist/node/helpers/update-notebook-data.js +2 -2
- package/dist/node/helpers/update-notebook-data.js.map +1 -1
- package/dist/node/index.js +6 -6
- package/dist/node/index.js.map +1 -1
- package/dist/node/notebook.d.ts +3 -2
- package/dist/node/notebook.js +18 -17
- package/dist/node/notebook.js.map +1 -1
- package/dist/node/oic.d.ts +3 -2
- package/dist/node/oic.js +31 -30
- package/dist/node/oic.js.map +1 -1
- package/dist/node/quickcapture.d.ts +3 -2
- package/dist/node/quickcapture.js +24 -23
- package/dist/node/quickcapture.js.map +1 -1
- package/dist/node/simple-types.d.ts +3 -2
- package/dist/node/simple-types.js +9 -8
- package/dist/node/simple-types.js.map +1 -1
- package/dist/node/webmap.d.ts +3 -2
- package/dist/node/webmap.js +40 -40
- package/dist/node/webmap.js.map +1 -1
- package/dist/node/webmappingapplication.d.ts +3 -2
- package/dist/node/webmappingapplication.js +127 -129
- package/dist/node/webmappingapplication.js.map +1 -1
- package/dist/node/workforce.d.ts +3 -2
- package/dist/node/workforce.js +5 -4
- package/dist/node/workforce.js.map +1 -1
- package/dist/umd/dashboard.d.ts +0 -1
- package/dist/umd/helpers/convert-item-to-template.d.ts +3 -2
- package/dist/umd/notebook.d.ts +3 -2
- package/dist/umd/oic.d.ts +3 -2
- package/dist/umd/quickcapture.d.ts +3 -2
- package/dist/umd/simple-types.d.ts +3 -2
- package/dist/umd/simple-types.umd.js +2142 -2152
- package/dist/umd/simple-types.umd.js.map +1 -1
- package/dist/umd/simple-types.umd.min.js +3 -3
- package/dist/umd/simple-types.umd.min.js.map +1 -1
- package/dist/umd/webmap.d.ts +3 -2
- package/dist/umd/webmappingapplication.d.ts +3 -2
- package/dist/umd/workforce.d.ts +3 -2
- package/package.json +23 -23
|
@@ -18,7 +18,7 @@ import * as notebook from "../notebook";
|
|
|
18
18
|
import * as webmappingapplication from "../webmappingapplication";
|
|
19
19
|
import * as workforce from "../workforce";
|
|
20
20
|
export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
21
|
-
return new Promise(
|
|
21
|
+
return new Promise(resolve => {
|
|
22
22
|
// Interrupt process if progress callback returns `false`
|
|
23
23
|
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Started, 0)) {
|
|
24
24
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Ignored, 0);
|
|
@@ -26,59 +26,55 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
// Replace the templatized symbols in a copy of the template
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
let newItemTemplate = common.cloneObject(template);
|
|
30
|
+
newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
|
|
31
31
|
// Create the item, then update its URL with its new id
|
|
32
32
|
// some fieldnames are used as keys for objects
|
|
33
33
|
// when we templatize field references for web applications we first stringify the components of the
|
|
34
34
|
// web application that could contain field references and then serach for them with a regular expression.
|
|
35
35
|
// We also need to stringify the web application when de-templatizing so it will find all of these occurrences as well.
|
|
36
36
|
if (template.type === "Web Mapping Application" && template.data) {
|
|
37
|
-
|
|
37
|
+
newItemTemplate = JSON.parse(common.replaceInTemplate(JSON.stringify(newItemTemplate), templateDictionary));
|
|
38
38
|
}
|
|
39
39
|
if (template.item.thumbnail) {
|
|
40
|
-
|
|
40
|
+
newItemTemplate.item.thumbnail = template.item.thumbnail; // make sure that our File is still there
|
|
41
41
|
}
|
|
42
42
|
common
|
|
43
|
-
.createItemWithData(
|
|
44
|
-
.then(
|
|
43
|
+
.createItemWithData(newItemTemplate.item, newItemTemplate.data, destinationAuthentication, templateDictionary.folderId)
|
|
44
|
+
.then(createResponse => {
|
|
45
45
|
// Interrupt process if progress callback returns `false`
|
|
46
46
|
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.id)) {
|
|
47
47
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
|
|
48
48
|
common
|
|
49
49
|
.removeItem(createResponse.id, destinationAuthentication)
|
|
50
|
-
.then(
|
|
51
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
52
|
-
}, function () {
|
|
53
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
54
|
-
});
|
|
50
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
55
51
|
}
|
|
56
52
|
else {
|
|
57
53
|
// Add the new item to the settings
|
|
58
54
|
templateDictionary[template.itemId] = {
|
|
59
55
|
itemId: createResponse.id
|
|
60
56
|
};
|
|
61
|
-
|
|
57
|
+
newItemTemplate.itemId = createResponse.id;
|
|
62
58
|
// Set the appItemId manually to get around cases where the path was incorrectly set
|
|
63
59
|
// in legacy deployments
|
|
64
|
-
if (
|
|
60
|
+
if (newItemTemplate.type === "Web Mapping Application" &&
|
|
65
61
|
template.data) {
|
|
66
|
-
common.setProp(
|
|
62
|
+
common.setProp(newItemTemplate, "data.appItemId", createResponse.id);
|
|
67
63
|
}
|
|
68
|
-
|
|
64
|
+
const postProcess = common.hasUnresolvedVariables(newItemTemplate.data);
|
|
69
65
|
// Update the template again now that we have the new item id
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
const originalURL = newItemTemplate.item.url;
|
|
67
|
+
newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
|
|
72
68
|
// Update relationships
|
|
73
|
-
|
|
74
|
-
if (
|
|
69
|
+
let relationshipsDef = Promise.resolve([]);
|
|
70
|
+
if (newItemTemplate.relatedItems) {
|
|
75
71
|
// Templatize references in relationships obj
|
|
76
|
-
|
|
72
|
+
const updatedRelatedItems = common.replaceInTemplate(common.templatizeIds(newItemTemplate.relatedItems), templateDictionary);
|
|
77
73
|
// Add the relationships
|
|
78
|
-
relationshipsDef = common.addForwardItemRelationships(
|
|
74
|
+
relationshipsDef = common.addForwardItemRelationships(newItemTemplate.itemId, updatedRelatedItems, destinationAuthentication);
|
|
79
75
|
}
|
|
80
76
|
// Check for extra processing for web mapping application et al.
|
|
81
|
-
|
|
77
|
+
let customProcDef;
|
|
82
78
|
if (template.type === "Web Mapping Application" &&
|
|
83
79
|
template.data &&
|
|
84
80
|
common.hasAnyKeyword(template, [
|
|
@@ -87,51 +83,47 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
87
83
|
"Web AppBuilder"
|
|
88
84
|
])) {
|
|
89
85
|
// If this is a Web AppBuilder application, we will create a Code Attachment for downloading
|
|
90
|
-
customProcDef = webmappingapplication.fineTuneCreatedItem(template,
|
|
86
|
+
customProcDef = webmappingapplication.fineTuneCreatedItem(template, newItemTemplate, templateDictionary, destinationAuthentication);
|
|
91
87
|
}
|
|
92
88
|
else if (template.type === "Workforce Project") {
|
|
93
|
-
customProcDef = workforce.fineTuneCreatedItem(
|
|
89
|
+
customProcDef = workforce.fineTuneCreatedItem(newItemTemplate, destinationAuthentication, templateDictionary);
|
|
94
90
|
}
|
|
95
91
|
else if (template.type === "Notebook") {
|
|
96
|
-
customProcDef = notebook.fineTuneCreatedItem(template,
|
|
92
|
+
customProcDef = notebook.fineTuneCreatedItem(template, newItemTemplate, templateDictionary, destinationAuthentication);
|
|
97
93
|
}
|
|
98
|
-
else if (originalURL !==
|
|
94
|
+
else if (originalURL !== newItemTemplate.item.url) {
|
|
99
95
|
// For web mapping applications that are not Web AppBuilder apps
|
|
100
|
-
customProcDef = new Promise(
|
|
96
|
+
customProcDef = new Promise((resolve2, reject2) => {
|
|
101
97
|
common
|
|
102
|
-
.updateItemURL(createResponse.id,
|
|
103
|
-
.then(
|
|
98
|
+
.updateItemURL(createResponse.id, newItemTemplate.item.url, destinationAuthentication)
|
|
99
|
+
.then(() => resolve2(), reject2);
|
|
104
100
|
});
|
|
105
101
|
}
|
|
106
102
|
else {
|
|
107
103
|
customProcDef = Promise.resolve(null);
|
|
108
104
|
}
|
|
109
|
-
Promise.all([relationshipsDef, customProcDef]).then(
|
|
105
|
+
Promise.all([relationshipsDef, customProcDef]).then(() => {
|
|
110
106
|
// Interrupt process if progress callback returns `false`
|
|
111
107
|
if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor / 2, createResponse.id)) {
|
|
112
108
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
|
|
113
109
|
common
|
|
114
110
|
.removeItem(createResponse.id, destinationAuthentication)
|
|
115
|
-
.then(
|
|
116
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
117
|
-
}, function () {
|
|
118
|
-
return resolve(common.generateEmptyCreationResponse(template.type));
|
|
119
|
-
});
|
|
111
|
+
.then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
|
|
120
112
|
}
|
|
121
113
|
else {
|
|
122
114
|
resolve({
|
|
123
|
-
item:
|
|
115
|
+
item: newItemTemplate,
|
|
124
116
|
id: createResponse.id,
|
|
125
|
-
type:
|
|
126
|
-
postProcess:
|
|
117
|
+
type: newItemTemplate.type,
|
|
118
|
+
postProcess: postProcess
|
|
127
119
|
});
|
|
128
120
|
}
|
|
129
|
-
},
|
|
121
|
+
}, () => {
|
|
130
122
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
131
123
|
resolve(common.generateEmptyCreationResponse(template.type)); // fails to deploy all resources to the item
|
|
132
124
|
});
|
|
133
125
|
}
|
|
134
|
-
},
|
|
126
|
+
}, () => {
|
|
135
127
|
itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
|
|
136
128
|
resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
|
|
137
129
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-item-from-template.js","sourceRoot":"","sources":["../../../src/helpers/create-item-from-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,MAAM,UAAU,sBAAsB,CACpC,QAA8B,EAC9B,kBAAuB,EACvB,yBAA6C,EAC7C,oBAAkD;IAElD,OAAO,IAAI,OAAO,CAAyC,
|
|
1
|
+
{"version":3,"file":"create-item-from-template.js","sourceRoot":"","sources":["../../../src/helpers/create-item-from-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,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;YACF,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9D;aAAM;YACL,4DAA4D;YAC5D,IAAI,eA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A,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,SAAS,EACpC,CAAC,CACF,CAAC;4BACF,MAAM;iCACH,UAAU,CAAC,cAAc,CAAC,EAAE,EAAE,yBAAyB,CAAC;iCACxD,IAAI,CACH,GAAG,EAAE,CACH,OAAO,CACL,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CACpD,EACH,GAAG,EAAE,CACH,OAAO,CACL,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CACpD,CACJ,CAAC;yBACL;6BAAM;4BACL,OAAO,CAAC;gCACN,IAAI,EAAE,eAAe;gCACrB,EAAE,EAAE,cAAc,CAAC,EAAE;gCACrB,IAAI,EAAE,eAAe,CAAC,IAAI;gCAC1B,WAAW,EAAE,WAAW;6BACzB,CAAC,CAAC;yBACJ;oBACH,CAAC,EACD,GAAG,EAAE;wBACH,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;wBACF,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,4CAA4C;oBAC5G,CAAC,CACF,CAAC;iBACH;YACH,CAAC,EACD,GAAG,EAAE;gBACH,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,mBAAmB,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;gBACF,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uBAAuB;YACvF,CAAC,CACF,CAAC;SACL;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-notebook-data.js","sourceRoot":"","sources":["../../../src/helpers/update-notebook-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAGL,UAAU,EACV,UAAU,EACX,MAAM,uBAAuB,CAAC;AAE/B,MAAM,UAAU,kBAAkB,CAChC,MAAc,EACd,IAAS,EACT,cAA2B;IAE3B,
|
|
1
|
+
{"version":3,"file":"update-notebook-data.js","sourceRoot":"","sources":["../../../src/helpers/update-notebook-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAGL,UAAU,EACV,UAAU,EACX,MAAM,uBAAuB,CAAC;AAE/B,MAAM,UAAU,kBAAkB,CAChC,MAAc,EACd,IAAS,EACT,cAA2B;IAE3B,MAAM,aAAa,GAAgB;QACjC,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;KACvB,CAAC;IACF,OAAO,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/esm/notebook.d.ts
CHANGED
|
@@ -19,11 +19,12 @@ import * as common from "@esri/solution-common";
|
|
|
19
19
|
*
|
|
20
20
|
* @param solutionItemId The solution to contain the template
|
|
21
21
|
* @param itemInfo Info about the item
|
|
22
|
-
* @param
|
|
22
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
23
24
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
24
25
|
* @return A promise that will resolve when the template has been created
|
|
25
26
|
*/
|
|
26
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
27
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
|
|
27
28
|
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
|
28
29
|
/**
|
|
29
30
|
* Converts a Python Notebook item to a template.
|
package/dist/esm/notebook.js
CHANGED
|
@@ -21,15 +21,16 @@ import * as notebookHelpers from "./helpers/notebook-helpers";
|
|
|
21
21
|
*
|
|
22
22
|
* @param solutionItemId The solution to contain the template
|
|
23
23
|
* @param itemInfo Info about the item
|
|
24
|
-
* @param
|
|
24
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
25
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
25
26
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
26
27
|
* @return A promise that will resolve when the template has been created
|
|
27
28
|
*/
|
|
28
|
-
export function convertItemToTemplate(solutionItemId, itemInfo,
|
|
29
|
+
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
29
30
|
// Delegate back to simple-types, which will in-turn delegate
|
|
30
31
|
// to convertNotebookToTemplate at the correct point in the process
|
|
31
32
|
// This is a temporary refactor step
|
|
32
|
-
return notebookHelpers.convertItemToTemplate(solutionItemId, itemInfo,
|
|
33
|
+
return notebookHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
33
34
|
}
|
|
34
35
|
// Delegate back to simple-types
|
|
35
36
|
// This is a temporary refactor step
|
|
@@ -44,17 +45,17 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
44
45
|
*/
|
|
45
46
|
export function convertNotebookToTemplate(itemTemplate) {
|
|
46
47
|
// The templates data to process
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const data = itemTemplate.data;
|
|
49
|
+
let dataString = JSON.stringify(data);
|
|
50
|
+
const idTest = /[0-9A-F]{32}/gim;
|
|
50
51
|
if (data && idTest.test(dataString)) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
ids.forEach(
|
|
54
|
-
if (
|
|
55
|
-
|
|
52
|
+
const ids = dataString.match(idTest);
|
|
53
|
+
const verifiedIds = [];
|
|
54
|
+
ids.forEach(id => {
|
|
55
|
+
if (verifiedIds.indexOf(id) === -1) {
|
|
56
|
+
verifiedIds.push(id);
|
|
56
57
|
// templatize the itemId--but only once per unique id
|
|
57
|
-
|
|
58
|
+
const regEx = new RegExp(id, "gm");
|
|
58
59
|
dataString = dataString.replace(regEx, "{{" + id + ".itemId}}");
|
|
59
60
|
// update the dependencies
|
|
60
61
|
if (itemTemplate.dependencies.indexOf(id) === -1) {
|
|
@@ -77,15 +78,15 @@ export function convertNotebookToTemplate(itemTemplate) {
|
|
|
77
78
|
* @return A promise that will resolve once any updates have been made
|
|
78
79
|
*/
|
|
79
80
|
export function fineTuneCreatedItem(originalTemplate, newlyCreatedItem, templateDictionary, authentication) {
|
|
80
|
-
return new Promise(
|
|
81
|
-
|
|
81
|
+
return new Promise((resolve, reject) => {
|
|
82
|
+
const updateOptions = {
|
|
82
83
|
id: newlyCreatedItem.itemId,
|
|
83
84
|
url: newlyCreatedItem.item.url,
|
|
84
85
|
data: common.jsonToFile(newlyCreatedItem.data, newlyCreatedItem.itemId + ".ipynb")
|
|
85
86
|
};
|
|
86
87
|
common
|
|
87
88
|
.updateItem(updateOptions, authentication)
|
|
88
|
-
.then(
|
|
89
|
+
.then(() => resolve(null), reject);
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
92
|
/**
|
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","sourceRoot":"","sources":["../../src/notebook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,+CAA+C;AAC/C,OAAO,KAAK,eAAe,M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";
|
|
|
18
18
|
* Converts an AGOL OIC (Oriented Imagery Catalog) item to a template.
|
|
19
19
|
*
|
|
20
20
|
* @param itemTemplate Template for the OIC (Oriented Imagery Catalog) item
|
|
21
|
-
* @param
|
|
21
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
22
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
22
23
|
* @return Template for the solution item that contains key details for item reconstruction
|
|
23
24
|
*/
|
|
24
|
-
export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate,
|
|
25
|
+
export declare function convertItemToTemplate(itemTemplate: common.IItemTemplate, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
25
26
|
/**
|
|
26
27
|
* Gets the ids of the dependencies of an AGOL OIC (Oriented Imagery Catalog) item.
|
|
27
28
|
*
|
package/dist/esm/oic.js
CHANGED
|
@@ -19,23 +19,23 @@ import * as common from "@esri/solution-common";
|
|
|
19
19
|
* Converts an AGOL OIC (Oriented Imagery Catalog) item to a template.
|
|
20
20
|
*
|
|
21
21
|
* @param itemTemplate Template for the OIC (Oriented Imagery Catalog) item
|
|
22
|
-
* @param
|
|
22
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
23
24
|
* @return Template for the solution item that contains key details for item reconstruction
|
|
24
25
|
*/
|
|
25
|
-
export function convertItemToTemplate(itemTemplate,
|
|
26
|
-
return new Promise(
|
|
26
|
+
export function convertItemToTemplate(itemTemplate, destAuthentication, srcAuthentication) {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
27
28
|
// Extract dependencies
|
|
28
|
-
_extractDependencies(itemTemplate,
|
|
29
|
-
var _a;
|
|
29
|
+
_extractDependencies(itemTemplate, srcAuthentication).then((results) => {
|
|
30
30
|
itemTemplate.dependencies = results.dependencies;
|
|
31
31
|
// Templatize the map layer ids after we've extracted them as dependencies
|
|
32
32
|
/* istanbul ignore else */
|
|
33
|
-
if (
|
|
33
|
+
if (itemTemplate.data?.properties) {
|
|
34
34
|
itemTemplate.data.properties.ServiceURL = _templatizeOicLayerUrl(itemTemplate.data.properties.ServiceURL, results.urlHash);
|
|
35
35
|
itemTemplate.data.properties.OverviewURL = _templatizeOicLayerUrl(itemTemplate.data.properties.OverviewURL, results.urlHash);
|
|
36
36
|
}
|
|
37
37
|
resolve(itemTemplate);
|
|
38
|
-
},
|
|
38
|
+
}, e => reject(common.fail(e)));
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -47,11 +47,10 @@ export function convertItemToTemplate(itemTemplate, authentication) {
|
|
|
47
47
|
* @protected
|
|
48
48
|
*/
|
|
49
49
|
export function _extractDependencies(itemTemplate, authentication) {
|
|
50
|
-
return new Promise(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var layerURLs = [];
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
const dependencies = [];
|
|
52
|
+
if (itemTemplate.data?.properties) {
|
|
53
|
+
const layerURLs = [];
|
|
55
54
|
/* istanbul ignore else */
|
|
56
55
|
if (itemTemplate.data.properties.ServiceURL) {
|
|
57
56
|
layerURLs.push(itemTemplate.data.properties.ServiceURL);
|
|
@@ -62,9 +61,9 @@ export function _extractDependencies(itemTemplate, authentication) {
|
|
|
62
61
|
itemTemplate.data.properties.ServiceURL) {
|
|
63
62
|
layerURLs.push(itemTemplate.data.properties.OverviewURL);
|
|
64
63
|
}
|
|
65
|
-
_getLayerIds(layerURLs, dependencies, authentication).then(
|
|
64
|
+
_getLayerIds(layerURLs, dependencies, authentication).then(results => {
|
|
66
65
|
resolve(results);
|
|
67
|
-
},
|
|
66
|
+
}, e => reject(common.fail(e)));
|
|
68
67
|
}
|
|
69
68
|
else {
|
|
70
69
|
resolve({
|
|
@@ -84,18 +83,18 @@ export function _extractDependencies(itemTemplate, authentication) {
|
|
|
84
83
|
* @protected
|
|
85
84
|
*/
|
|
86
85
|
export function _getLayerIds(layerURLs, dependencies, authentication) {
|
|
87
|
-
return new Promise(
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
return new Promise((resolve, reject) => {
|
|
87
|
+
const urlHash = {};
|
|
88
|
+
const options = {
|
|
90
89
|
f: "json",
|
|
91
90
|
authentication: authentication
|
|
92
91
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
const layerPromises = [];
|
|
93
|
+
const layerChecks = {};
|
|
94
|
+
const filteredLayerURLs = layerURLs.filter(layerURL => {
|
|
96
95
|
if (layerURL) {
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
const results = /.+FeatureServer/g.exec(layerURL);
|
|
97
|
+
const baseUrl = Array.isArray(results) && results.length > 0 ? results[0] : undefined;
|
|
99
98
|
if (baseUrl) {
|
|
100
99
|
// avoid redundant checks when we have a layer with subLayers
|
|
101
100
|
/* istanbul ignore else */
|
|
@@ -114,11 +113,11 @@ export function _getLayerIds(layerURLs, dependencies, authentication) {
|
|
|
114
113
|
}
|
|
115
114
|
});
|
|
116
115
|
if (layerPromises.length > 0) {
|
|
117
|
-
Promise.all(layerPromises).then(
|
|
118
|
-
serviceResponses.forEach(
|
|
116
|
+
Promise.all(layerPromises).then(serviceResponses => {
|
|
117
|
+
serviceResponses.forEach((serviceResponse, i) => {
|
|
119
118
|
/* istanbul ignore else */
|
|
120
119
|
if (common.getProp(serviceResponse, "serviceItemId")) {
|
|
121
|
-
|
|
120
|
+
const id = serviceResponse.serviceItemId;
|
|
122
121
|
/* istanbul ignore else */
|
|
123
122
|
if (dependencies.indexOf(id) < 0) {
|
|
124
123
|
dependencies.push(id);
|
|
@@ -130,7 +129,7 @@ export function _getLayerIds(layerURLs, dependencies, authentication) {
|
|
|
130
129
|
dependencies: dependencies,
|
|
131
130
|
urlHash: urlHash
|
|
132
131
|
});
|
|
133
|
-
},
|
|
132
|
+
}, e => reject(common.fail(e)));
|
|
134
133
|
}
|
|
135
134
|
else {
|
|
136
135
|
resolve({
|
|
@@ -149,13 +148,15 @@ export function _getLayerIds(layerURLs, dependencies, authentication) {
|
|
|
149
148
|
* @protected
|
|
150
149
|
*/
|
|
151
150
|
export function _templatizeOicLayerUrl(layerURL, urlHash) {
|
|
152
|
-
|
|
151
|
+
let templatizedURL = layerURL;
|
|
153
152
|
if (layerURL) {
|
|
154
|
-
|
|
153
|
+
const id = urlHash[layerURL];
|
|
155
154
|
if (id) {
|
|
156
|
-
|
|
155
|
+
const layerId = layerURL.substr(layerURL.lastIndexOf("/") + 1);
|
|
157
156
|
templatizedURL = common.templatizeTerm(id, id, ".layer" + layerId + ".url");
|
|
158
157
|
}
|
|
158
|
+
// replace everything up until /home with portalBaseUrl var and templatize the itemId
|
|
159
|
+
templatizedURL = common.templatizeIds(templatizedURL.replace(/.+?(?=\/home)/, "{{portalBaseUrl}}"));
|
|
159
160
|
}
|
|
160
161
|
return templatizedURL;
|
|
161
162
|
}
|
package/dist/esm/oic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oic.js","sourceRoot":"","sources":["../../src/oic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,wHAAwH;AAExH
|
|
1
|
+
{"version":3,"file":"oic.js","sourceRoot":"","sources":["../../src/oic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,wHAAwH;AAExH;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,YAAkC,EAClC,kBAAsC,EACtC,iBAAqC;IAErC,OAAO,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3D,uBAAuB;QACvB,oBAAoB,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC,IAAI,CACxD,CAAC,OAAY,EAAE,EAAE;YACf,YAAY,CAAC,YAAY,GAAG,OAAO,CAA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OG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB,EAAE,OAAY;IACnE,IAAI,cAAc,GAAG,QAAQ,CAAC;IAC9B,IAAI,QAAQ,EAAE;QACZ,MAAM,EAAE,GAAQ,OAAO,CAAC,QAAQ,CAAC,CAAC;QAClC,IAAI,EAAE,EAAE;YACN,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YAC/D,cAAc,GAAG,MAAM,CAAC,cAAc,CACpC,EAAE,EACF,EAAE,EACF,QAAQ,GAAG,OAAO,GAAG,MAAM,CAC5B,CAAC;SACH;QAED,qFAAqF;QACrF,cAAc,GAAG,MAAM,CAAC,aAAa,CACnC,cAAc,CAAC,OAAO,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAC7D,CAAC;KACH;IACD,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -19,11 +19,12 @@ import * as common from "@esri/solution-common";
|
|
|
19
19
|
*
|
|
20
20
|
* @param solutionItemId The solution to contain the template
|
|
21
21
|
* @param itemInfo Info about the item
|
|
22
|
-
* @param
|
|
22
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
23
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
23
24
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
24
25
|
* @return A promise that will resolve when the template has been created
|
|
25
26
|
*/
|
|
26
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
27
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession, templateDictionary: any): Promise<common.IItemTemplate>;
|
|
27
28
|
/**
|
|
28
29
|
* Converts an quick capture item to a template.
|
|
29
30
|
*
|
package/dist/esm/quickcapture.js
CHANGED
|
@@ -21,15 +21,16 @@ import * as quickcaptureHelpers from "./helpers/quickcapture-helpers";
|
|
|
21
21
|
*
|
|
22
22
|
* @param solutionItemId The solution to contain the template
|
|
23
23
|
* @param itemInfo Info about the item
|
|
24
|
-
* @param
|
|
24
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
25
|
+
* @param srcAuthentication Credentials for requests to source items
|
|
25
26
|
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
26
27
|
* @return A promise that will resolve when the template has been created
|
|
27
28
|
*/
|
|
28
|
-
export function convertItemToTemplate(solutionItemId, itemInfo,
|
|
29
|
+
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary) {
|
|
29
30
|
// Delegate back to simple-types, which will in-turn delegate
|
|
30
31
|
// to convertNotebookToTemplate at the correct point in the process
|
|
31
32
|
// This is a temporary refactor step
|
|
32
|
-
return quickcaptureHelpers.convertItemToTemplate(solutionItemId, itemInfo,
|
|
33
|
+
return quickcaptureHelpers.convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication, templateDictionary);
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* Converts an quick capture item to a template.
|
|
@@ -38,25 +39,25 @@ export function convertItemToTemplate(solutionItemId, itemInfo, authentication,
|
|
|
38
39
|
* @return templatized itemTemplate
|
|
39
40
|
*/
|
|
40
41
|
export function convertQuickCaptureToTemplate(itemTemplate) {
|
|
41
|
-
return new Promise(
|
|
42
|
+
return new Promise((resolve, reject) => {
|
|
42
43
|
// The templates data to process
|
|
43
|
-
|
|
44
|
+
const data = itemTemplate.data;
|
|
44
45
|
if (data && Array.isArray(data)) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
data.some(
|
|
46
|
+
let applicationRequest = Promise.resolve(null);
|
|
47
|
+
let applicationName = "";
|
|
48
|
+
data.some((item) => {
|
|
48
49
|
if (item.type === "application/json") {
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
applicationName = item.name;
|
|
51
|
+
applicationRequest = common.getBlobText(item);
|
|
51
52
|
return true;
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
|
-
|
|
55
|
+
applicationRequest.then(result => {
|
|
55
56
|
// replace the template data array with the templatized application JSON
|
|
56
57
|
itemTemplate.data = result
|
|
57
58
|
? {
|
|
58
59
|
application: _templatizeApplication(JSON.parse(result), itemTemplate),
|
|
59
|
-
name:
|
|
60
|
+
name: applicationName
|
|
60
61
|
}
|
|
61
62
|
: {};
|
|
62
63
|
resolve(itemTemplate);
|
|
@@ -80,10 +81,10 @@ export function _templatizeApplication(data, itemTemplate) {
|
|
|
80
81
|
// Set the admin email
|
|
81
82
|
_templatizeAdminEmail(data);
|
|
82
83
|
// datasource item id and url
|
|
83
|
-
|
|
84
|
+
const dataSources = data.dataSources;
|
|
84
85
|
if (dataSources && Array.isArray(dataSources)) {
|
|
85
|
-
dataSources.forEach(
|
|
86
|
-
|
|
86
|
+
dataSources.forEach(ds => {
|
|
87
|
+
const id = ds.featureServiceItemId;
|
|
87
88
|
if (id) {
|
|
88
89
|
_updateDependencies(id, itemTemplate);
|
|
89
90
|
_templatizeUrl(ds, "featureServiceItemId", "url");
|
|
@@ -123,10 +124,10 @@ export function _updateDependencies(id, itemTemplate) {
|
|
|
123
124
|
* @param urlPath the path to the url property
|
|
124
125
|
*/
|
|
125
126
|
export function _templatizeUrl(obj, idPath, urlPath) {
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
const id = common.getProp(obj, idPath);
|
|
128
|
+
const url = common.getProp(obj, urlPath);
|
|
128
129
|
if (url) {
|
|
129
|
-
|
|
130
|
+
const layerId = url.substr(url.lastIndexOf("/") + 1);
|
|
130
131
|
common.setProp(obj, urlPath, common.templatizeTerm(id, id, ".layer" + layerId + ".url"));
|
|
131
132
|
}
|
|
132
133
|
}
|
|
@@ -137,7 +138,7 @@ export function _templatizeUrl(obj, idPath, urlPath) {
|
|
|
137
138
|
* @param path the path to the id property
|
|
138
139
|
*/
|
|
139
140
|
export function _templatizeId(obj, path) {
|
|
140
|
-
|
|
141
|
+
const id = common.getProp(obj, path);
|
|
141
142
|
if (id) {
|
|
142
143
|
common.setProp(obj, path, common.templatizeTerm(id, id, ".itemId"));
|
|
143
144
|
}
|
|
@@ -160,11 +161,11 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
160
161
|
* @returns Promise resolving to successfulness of update
|
|
161
162
|
*/
|
|
162
163
|
export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
163
|
-
return new Promise(
|
|
164
|
+
return new Promise((resolve, reject) => {
|
|
164
165
|
template.data = common.replaceInTemplate(template.data, templateDictionary);
|
|
165
166
|
common
|
|
166
167
|
.updateItemTemplateFromDictionary(itemId, templateDictionary, authentication)
|
|
167
|
-
.then(
|
|
168
|
+
.then(() => {
|
|
168
169
|
common
|
|
169
170
|
.updateItemResourceText(itemId, template.data.name, JSON.stringify(template.data.application), authentication)
|
|
170
171
|
.then(resolve, reject);
|
|
@@ -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;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC,EACrC,kBAAuB;IAEvB,6DAA6D;IAC7D,mEAAmE;IACnE,oCAAoC;IACpC,OAAO,mBAAmB,CAAC,qBAAqB,CAC9C,cAAc,EACd,QAAQ,EACR,kBAAkB,EA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