@esri/solution-hub-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/helpers/_post-process-page.d.ts +2 -2
- package/dist/esm/helpers/_post-process-page.js +4 -2
- package/dist/esm/helpers/_post-process-page.js.map +1 -1
- package/dist/esm/helpers/_post-process-site.d.ts +2 -2
- package/dist/esm/helpers/_post-process-site.js +11 -25
- package/dist/esm/helpers/_post-process-site.js.map +1 -1
- package/dist/esm/helpers/_update-site-pages.d.ts +2 -2
- package/dist/esm/helpers/_update-site-pages.js +5 -5
- package/dist/esm/helpers/_update-site-pages.js.map +1 -1
- package/dist/esm/helpers/move-model-to-folder.js +6 -6
- package/dist/esm/helpers/move-model-to-folder.js.map +1 -1
- package/dist/esm/helpers/replace-item-ids.js +5 -5
- package/dist/esm/helpers/replace-item-ids.js.map +1 -1
- package/dist/esm/hub-page-processor.d.ts +3 -2
- package/dist/esm/hub-page-processor.js +44 -34
- package/dist/esm/hub-page-processor.js.map +1 -1
- package/dist/esm/hub-site-processor.d.ts +10 -9
- package/dist/esm/hub-site-processor.js +72 -61
- package/dist/esm/hub-site-processor.js.map +1 -1
- package/dist/node/helpers/_post-process-page.d.ts +2 -2
- package/dist/node/helpers/_post-process-page.js +6 -4
- package/dist/node/helpers/_post-process-page.js.map +1 -1
- package/dist/node/helpers/_post-process-site.d.ts +2 -2
- package/dist/node/helpers/_post-process-site.js +12 -26
- package/dist/node/helpers/_post-process-site.js.map +1 -1
- package/dist/node/helpers/_update-site-pages.d.ts +2 -2
- package/dist/node/helpers/_update-site-pages.js +7 -7
- package/dist/node/helpers/_update-site-pages.js.map +1 -1
- package/dist/node/helpers/move-model-to-folder.js +8 -8
- package/dist/node/helpers/move-model-to-folder.js.map +1 -1
- package/dist/node/helpers/replace-item-ids.js +6 -6
- package/dist/node/helpers/replace-item-ids.js.map +1 -1
- package/dist/node/hub-page-processor.d.ts +3 -2
- package/dist/node/hub-page-processor.js +51 -41
- package/dist/node/hub-page-processor.js.map +1 -1
- package/dist/node/hub-site-processor.d.ts +10 -9
- package/dist/node/hub-site-processor.js +81 -70
- package/dist/node/hub-site-processor.js.map +1 -1
- package/dist/node/index.js +2 -2
- package/dist/node/index.js.map +1 -1
- package/dist/umd/helpers/_post-process-page.d.ts +2 -2
- package/dist/umd/helpers/_post-process-site.d.ts +2 -2
- package/dist/umd/helpers/_update-site-pages.d.ts +2 -2
- package/dist/umd/hub-page-processor.d.ts +3 -2
- package/dist/umd/hub-site-processor.d.ts +10 -9
- package/dist/umd/hub-types.umd.js +621 -620
- package/dist/umd/hub-types.umd.js.map +1 -1
- package/dist/umd/hub-types.umd.min.js +3 -3
- package/dist/umd/hub-types.umd.min.js.map +1 -1
- package/package.json +25 -25
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IModel,
|
|
17
|
-
export declare function _postProcessPage(pageModel: IModel, itemInfos: any[], templateDictionary: any, hubRequestOptions:
|
|
16
|
+
import { IModel, IHubUserRequestOptions } from "@esri/hub-common";
|
|
17
|
+
export declare function _postProcessPage(pageModel: IModel, itemInfos: any[], templateDictionary: any, hubRequestOptions: IHubUserRequestOptions): Promise<boolean>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
/** @license
|
|
3
2
|
* Copyright 2020 Esri
|
|
4
3
|
*
|
|
@@ -19,7 +18,10 @@ import { updatePage } from "@esri/hub-sites";
|
|
|
19
18
|
export function _postProcessPage(pageModel, itemInfos, templateDictionary, hubRequestOptions) {
|
|
20
19
|
// re-interpolate the siteModel using the itemInfos; no patches supplied
|
|
21
20
|
pageModel = interpolate(pageModel, templateDictionary, {});
|
|
22
|
-
return updatePage(pageModel,
|
|
21
|
+
return updatePage(pageModel, {
|
|
22
|
+
...hubRequestOptions,
|
|
23
|
+
allowList: []
|
|
24
|
+
}).then(() => {
|
|
23
25
|
return true;
|
|
24
26
|
});
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_post-process-page.js","sourceRoot":"","sources":["../../../src/helpers/_post-process-page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_post-process-page.js","sourceRoot":"","sources":["../../../src/helpers/_post-process-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAkC,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,SAAgB,EAChB,kBAAuB,EACvB,iBAAyC;IAEzC,wEAAwE;IACxE,SAAS,GAAG,WAAW,CAAC,SAAS,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC3D,OAAO,UAAU,CAAC,SAAS,EAAE;QAC3B,GAAG,iBAAiB;QACpB,SAAS,EAAE,EAAE;KACd,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QACX,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IModel,
|
|
16
|
+
import { IModel, IHubUserRequestOptions } from "@esri/hub-common";
|
|
17
17
|
/**
|
|
18
18
|
* Post Process a Site
|
|
19
19
|
* - share all items to the Hub teams created as part of the site
|
|
@@ -25,4 +25,4 @@ import { IModel, IHubRequestOptions } from "@esri/hub-common";
|
|
|
25
25
|
* @param templateDictionary
|
|
26
26
|
* @param hubRequestOptions
|
|
27
27
|
*/
|
|
28
|
-
export declare function _postProcessSite(siteModel: IModel, itemInfos: any[], templateDictionary: any, hubRequestOptions:
|
|
28
|
+
export declare function _postProcessSite(siteModel: IModel, itemInfos: any[], templateDictionary: any, hubRequestOptions: IHubUserRequestOptions): Promise<boolean>;
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** @license
|
|
3
|
-
* Copyright 2020 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
|
-
import { interpolate } from "@esri/hub-common";
|
|
18
|
-
import { _shareItemsToSiteGroups, updateSite } from "@esri/hub-sites";
|
|
1
|
+
import { _shareItemsToSiteGroups, updateSite, interpolateSite } from "@esri/hub-sites";
|
|
19
2
|
import { _updateSitePages } from "./_update-site-pages";
|
|
20
3
|
/**
|
|
21
4
|
* Post Process a Site
|
|
@@ -29,10 +12,10 @@ import { _updateSitePages } from "./_update-site-pages";
|
|
|
29
12
|
* @param hubRequestOptions
|
|
30
13
|
*/
|
|
31
14
|
export function _postProcessSite(siteModel, itemInfos, templateDictionary, hubRequestOptions) {
|
|
32
|
-
|
|
15
|
+
const infosWithoutSite = itemInfos.filter(info => info.id !== siteModel.item.id);
|
|
33
16
|
// convert the itemInfo's into things that look enough like a model
|
|
34
17
|
// that we can call _shareItemsToSiteGroups
|
|
35
|
-
|
|
18
|
+
const pseudoModels = infosWithoutSite.map(e => {
|
|
36
19
|
return {
|
|
37
20
|
item: {
|
|
38
21
|
id: e.id,
|
|
@@ -40,20 +23,23 @@ export function _postProcessSite(siteModel, itemInfos, templateDictionary, hubRe
|
|
|
40
23
|
}
|
|
41
24
|
};
|
|
42
25
|
});
|
|
43
|
-
|
|
26
|
+
let secondPassPromises = [];
|
|
44
27
|
secondPassPromises = secondPassPromises.concat(_shareItemsToSiteGroups(siteModel, pseudoModels, hubRequestOptions));
|
|
45
28
|
// we can't use that same trick w/ the page sharing
|
|
46
29
|
// because we really need the models themselves
|
|
47
30
|
// so we delegate to a local function
|
|
48
31
|
secondPassPromises = secondPassPromises.concat(_updateSitePages(siteModel, infosWithoutSite, hubRequestOptions));
|
|
49
32
|
// need to get all the child items and add into site.item.properties.children
|
|
50
|
-
|
|
33
|
+
const childItemIds = infosWithoutSite.map(i => i.id);
|
|
51
34
|
siteModel.item.properties.children = childItemIds;
|
|
52
35
|
// re-interpolate the siteModel using the itemInfos
|
|
53
|
-
siteModel =
|
|
36
|
+
siteModel = interpolateSite(siteModel, templateDictionary, {});
|
|
54
37
|
// and update the model
|
|
55
|
-
secondPassPromises.push(updateSite(siteModel,
|
|
56
|
-
|
|
38
|
+
secondPassPromises.push(updateSite(siteModel, {
|
|
39
|
+
...hubRequestOptions,
|
|
40
|
+
allowList: null
|
|
41
|
+
}));
|
|
42
|
+
return Promise.all(secondPassPromises).then(() => {
|
|
57
43
|
return true;
|
|
58
44
|
});
|
|
59
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_post-process-site.js","sourceRoot":"","sources":["../../../src/helpers/_post-process-site.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_post-process-site.js","sourceRoot":"","sources":["../../../src/helpers/_post-process-site.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,uBAAuB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,SAAgB,EAChB,kBAAuB,EACvB,iBAAyC;IAE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AAC;AACL,CAAC"}
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IModel,
|
|
16
|
+
import { IModel, IHubUserRequestOptions } from "@esri/hub-common";
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
19
|
* @param siteModel
|
|
20
20
|
* @param itemInfos
|
|
21
21
|
* @param hubRequestOptions
|
|
22
22
|
*/
|
|
23
|
-
export declare function _updateSitePages(siteModel: IModel, itemInfos: any[], hubRequestOptions:
|
|
23
|
+
export declare function _updateSitePages(siteModel: IModel, itemInfos: any[], hubRequestOptions: IHubUserRequestOptions): Promise<any>;
|
|
@@ -22,15 +22,15 @@ import { _updatePages } from "@esri/hub-sites";
|
|
|
22
22
|
* @param hubRequestOptions
|
|
23
23
|
*/
|
|
24
24
|
export function _updateSitePages(siteModel, itemInfos, hubRequestOptions) {
|
|
25
|
-
|
|
26
|
-
.filter(
|
|
25
|
+
const pageIds = itemInfos
|
|
26
|
+
.filter(e => {
|
|
27
27
|
return e.type.indexOf("Page") > -1;
|
|
28
28
|
})
|
|
29
|
-
.map(
|
|
29
|
+
.map(e => e.id);
|
|
30
30
|
// now get all those models
|
|
31
|
-
return Promise.all(pageIds.map(
|
|
31
|
+
return Promise.all(pageIds.map(id => {
|
|
32
32
|
return getModel(id, hubRequestOptions);
|
|
33
|
-
})).then(
|
|
33
|
+
})).then((pageModels) => {
|
|
34
34
|
// now delegate back to hub.js internal _updatePages fn
|
|
35
35
|
return _updatePages(siteModel, pageModels, hubRequestOptions);
|
|
36
36
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_update-site-pages.js","sourceRoot":"","sources":["../../../src/helpers/_update-site-pages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"_update-site-pages.js","sourceRoot":"","sources":["../../../src/helpers/_update-site-pages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAkC,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,SAAgB,EAChB,iBAAyC;IAEzC,MAAM,OAAO,GAAG,SAAS;SACtB,MAAM,CAAC,CAAC,CAAC,EAAE;QACV,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAElB,2BAA2B;IAC3B,OAAO,OAAO,CAAC,GAAG,CAChB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QACf,OAAO,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;IACzC,CAAC,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,UAAe,EAAE,EAAE;QACzB,uDAAuD;QACvD,OAAO,YAAY,CAAC,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -25,20 +25,20 @@ import { moveItem } from "@esri/arcgis-rest-portal";
|
|
|
25
25
|
*/
|
|
26
26
|
export function moveModelToFolder(siteModel, folderId, authentication) {
|
|
27
27
|
// Fail-Safe the move call as it's not critical if it fails
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const failSafeMove = failSafe(moveItem, { success: true });
|
|
29
|
+
const movePromises = [
|
|
30
30
|
failSafeMove({
|
|
31
31
|
itemId: siteModel.item.id,
|
|
32
|
-
folderId
|
|
33
|
-
authentication
|
|
32
|
+
folderId,
|
|
33
|
+
authentication
|
|
34
34
|
})
|
|
35
35
|
];
|
|
36
36
|
// if an initiative was created...
|
|
37
37
|
if (getProp(siteModel, "item.properties.parentInitiativeId")) {
|
|
38
38
|
movePromises.push(failSafeMove({
|
|
39
39
|
itemId: siteModel.item.properties.parentInitiativeId,
|
|
40
|
-
folderId
|
|
41
|
-
authentication
|
|
40
|
+
folderId,
|
|
41
|
+
authentication
|
|
42
42
|
}));
|
|
43
43
|
}
|
|
44
44
|
return Promise.all(movePromises);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"move-model-to-folder.js","sourceRoot":"","sources":["../../../src/helpers/move-model-to-folder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAU,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAiB,EACjB,QAAgB,EAChB,cAA2B;IAE3B,2DAA2D;IAC3D,
|
|
1
|
+
{"version":3,"file":"move-model-to-folder.js","sourceRoot":"","sources":["../../../src/helpers/move-model-to-folder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAU,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAiB,EACjB,QAAgB,EAChB,cAA2B;IAE3B,2DAA2D;IAC3D,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3D,MAAM,YAAY,GAAG;QACnB,YAAY,CAAC;YACX,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE;YACzB,QAAQ;YACR,cAAc;SACf,CAAC;KACH,CAAC;IACF,kCAAkC;IAClC,IAAI,OAAO,CAAC,SAAS,EAAE,oCAAoC,CAAC,EAAE;QAC5D,YAAY,CAAC,IAAI,CACf,YAAY,CAAC;YACX,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,kBAAkB;YACpD,QAAQ;YACR,cAAc;SACf,CAAC,CACH,CAAC;KACH;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { cloneObject, deepStringReplace } from "@esri/hub-common";
|
|
17
17
|
export function replaceItemIds(template) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const clone = cloneObject(template);
|
|
19
|
+
const deps = template.dependencies || [];
|
|
20
20
|
// iterate the dependencies
|
|
21
|
-
deps.forEach(
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
deps.forEach(depId => {
|
|
22
|
+
const re = new RegExp(depId, "g");
|
|
23
|
+
const replacement = `{{${depId}.itemId}}`;
|
|
24
24
|
// we have to do this property-by-property or we would replace the `itemId` prop itself
|
|
25
25
|
clone.item = deepStringReplace(clone.item, re, replacement);
|
|
26
26
|
clone.data = deepStringReplace(clone.data, re, replacement);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace-item-ids.js","sourceRoot":"","sources":["../../../src/helpers/replace-item-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,WAAW,EACX,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,cAAc,CAAC,QAAwB;IACrD,
|
|
1
|
+
{"version":3,"file":"replace-item-ids.js","sourceRoot":"","sources":["../../../src/helpers/replace-item-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,WAAW,EACX,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,cAAc,CAAC,QAAwB;IACrD,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAC;IACzC,2BAA2B;IAC3B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACnB,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAClC,MAAM,WAAW,GAAG,KAAK,KAAK,WAAW,CAAC;QAC1C,uFAAuF;QACvF,KAAK,CAAC,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QAC5D,KAAK,CAAC,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QAC5D,IAAI,QAAQ,CAAC,UAAU,EAAE;YACvB,KAAK,CAAC,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;SACzE;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -24,10 +24,11 @@ import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse,
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId The solution to contain the template
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
28
29
|
* @return A promise that will resolve when the template has been created
|
|
29
30
|
*/
|
|
30
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
31
32
|
/**
|
|
32
33
|
* Handle deployment of Page item templates
|
|
33
34
|
*
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { __assign, __read } from "tslib";
|
|
17
16
|
/**
|
|
18
17
|
* Manages the creation and deployment of Hub Page item types.
|
|
19
18
|
*
|
|
@@ -31,21 +30,29 @@ import { moveModelToFolder } from "./helpers/move-model-to-folder";
|
|
|
31
30
|
*
|
|
32
31
|
* @param solutionItemId The solution to contain the template
|
|
33
32
|
* @param itemInfo Info about the item
|
|
34
|
-
* @param
|
|
33
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
34
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
35
35
|
* @return A promise that will resolve when the template has been created
|
|
36
36
|
*/
|
|
37
|
-
export function convertItemToTemplate(solutionItemId, itemInfo,
|
|
37
|
+
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication = null // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
38
|
+
) {
|
|
39
|
+
let created = 0;
|
|
40
|
+
let modified = 0;
|
|
38
41
|
// get the page model and hubRequestOptions
|
|
39
42
|
return Promise.all([
|
|
40
|
-
getModel(itemInfo.id, { authentication:
|
|
41
|
-
createHubRequestOptions(
|
|
43
|
+
getModel(itemInfo.id, { authentication: destAuthentication }),
|
|
44
|
+
createHubRequestOptions(destAuthentication)
|
|
42
45
|
])
|
|
43
|
-
.then(
|
|
44
|
-
|
|
46
|
+
.then(([pageModel, ro]) => {
|
|
47
|
+
// We need to save these properties in order to restore them after hub.js deletes them
|
|
48
|
+
created = pageModel.item.created;
|
|
49
|
+
modified = pageModel.item.modified;
|
|
45
50
|
return convertPageToTemplate(pageModel, ro);
|
|
46
51
|
})
|
|
47
|
-
.then(
|
|
52
|
+
.then(tmpl => {
|
|
48
53
|
// add in some stuff Hub.js does not yet add
|
|
54
|
+
tmpl.item.created = created;
|
|
55
|
+
tmpl.item.modified = modified;
|
|
49
56
|
tmpl.item.typeKeywords = without(tmpl.item.typeKeywords, "doNotDelete");
|
|
50
57
|
tmpl.groups = [];
|
|
51
58
|
tmpl.estimatedDeploymentCostFactor = 2;
|
|
@@ -72,7 +79,7 @@ export function convertItemToTemplate(solutionItemId, itemInfo, authentication)
|
|
|
72
79
|
*/
|
|
73
80
|
export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
74
81
|
// let the progress system know we've started...
|
|
75
|
-
|
|
82
|
+
const startStatus = itemProgressCallback(template.itemId, EItemProgressStatus.Started, 0);
|
|
76
83
|
// and if it returned false, just resolve out
|
|
77
84
|
if (!startStatus) {
|
|
78
85
|
return Promise.resolve(generateEmptyCreationResponse(template.type));
|
|
@@ -84,57 +91,57 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
84
91
|
// solutionItemExtent is in geographic, but it's a string, and we want/need a bbox
|
|
85
92
|
// and Hub templates expect it in organization.defaultExtentBBox
|
|
86
93
|
if (templateDictionary.solutionItemExtent) {
|
|
87
|
-
|
|
94
|
+
const parts = templateDictionary.solutionItemExtent.split(",");
|
|
88
95
|
templateDictionary.organization.defaultExtentBBox = [
|
|
89
96
|
[parts[0], parts[1]],
|
|
90
97
|
[parts[2], parts[3]]
|
|
91
98
|
];
|
|
92
99
|
}
|
|
93
100
|
// TODO: Determine if we need any transforms in this new env
|
|
94
|
-
|
|
101
|
+
const transforms = {};
|
|
95
102
|
// create an object to hold the created site through
|
|
96
103
|
// subsequent promise calls
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
let pageModel;
|
|
105
|
+
let hubRo;
|
|
106
|
+
const thumbnail = template.item.thumbnail; // createPageModelFromTemplate trashes thumbnail
|
|
100
107
|
return createHubRequestOptions(destinationAuthentication, templateDictionary)
|
|
101
|
-
.then(
|
|
108
|
+
.then(ro => {
|
|
102
109
|
hubRo = ro;
|
|
103
110
|
return createPageModelFromTemplate(template, templateDictionary, transforms, hubRo);
|
|
104
111
|
})
|
|
105
|
-
.then(
|
|
112
|
+
.then((interpolated) => {
|
|
106
113
|
// --------------------------------------------
|
|
107
114
|
// TODO: Update hub.js to take an IModel in createPage
|
|
108
115
|
// then remove this silliness
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
const modelTmpl = interpolated;
|
|
117
|
+
const options = {
|
|
111
118
|
assets: modelTmpl.assets || []
|
|
112
119
|
};
|
|
113
120
|
// --------------------------------------------
|
|
114
121
|
return createPage(modelTmpl, options, hubRo);
|
|
115
122
|
})
|
|
116
|
-
.then(
|
|
123
|
+
.then(page => {
|
|
117
124
|
pageModel = page;
|
|
118
125
|
// Move the site and initiative to the solution folder
|
|
119
126
|
// this is essentially fire and forget. We fail-safe the actual moveItem
|
|
120
127
|
// call since it's not critical to the outcome
|
|
121
128
|
return moveModelToFolder(page, templateDictionary.folderId, destinationAuthentication);
|
|
122
129
|
})
|
|
123
|
-
.then(
|
|
130
|
+
.then(() => {
|
|
124
131
|
// Fix the thumbnail
|
|
125
|
-
|
|
132
|
+
const updateOptions = {
|
|
126
133
|
item: {
|
|
127
134
|
id: pageModel.item.id
|
|
128
135
|
},
|
|
129
136
|
params: {
|
|
130
137
|
// Pass thumbnail in via params because item property is serialized, which discards a blob
|
|
131
|
-
thumbnail
|
|
138
|
+
thumbnail
|
|
132
139
|
},
|
|
133
140
|
authentication: destinationAuthentication
|
|
134
141
|
};
|
|
135
142
|
return updateItem(updateOptions);
|
|
136
143
|
})
|
|
137
|
-
.then(
|
|
144
|
+
.then(() => {
|
|
138
145
|
// Update the template dictionary
|
|
139
146
|
// TODO: This should be done in whatever recieves
|
|
140
147
|
// the outcome of this promise chain
|
|
@@ -142,18 +149,21 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
142
149
|
itemId: pageModel.item.id
|
|
143
150
|
};
|
|
144
151
|
// call the progress callback, which also mutates templateDictionary
|
|
145
|
-
|
|
152
|
+
const finalStatus = itemProgressCallback(template.itemId, EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor || 2, pageModel.item.id);
|
|
146
153
|
if (!finalStatus) {
|
|
147
154
|
// clean up the site we just created
|
|
148
|
-
|
|
149
|
-
return failSafeRemove(pageModel, hubRo).then(
|
|
155
|
+
const failSafeRemove = failSafe(removePage, { success: true });
|
|
156
|
+
return failSafeRemove(pageModel, hubRo).then(() => {
|
|
150
157
|
return Promise.resolve(generateEmptyCreationResponse(template.type));
|
|
151
158
|
});
|
|
152
159
|
}
|
|
153
160
|
else {
|
|
154
161
|
// finally, return ICreateItemFromTemplateResponse
|
|
155
|
-
|
|
156
|
-
item:
|
|
162
|
+
const response = {
|
|
163
|
+
item: {
|
|
164
|
+
...template,
|
|
165
|
+
...pageModel
|
|
166
|
+
},
|
|
157
167
|
id: pageModel.item.id,
|
|
158
168
|
type: template.type,
|
|
159
169
|
postProcess: true
|
|
@@ -162,7 +172,7 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
162
172
|
return response;
|
|
163
173
|
}
|
|
164
174
|
})
|
|
165
|
-
.catch(
|
|
175
|
+
.catch(ex => {
|
|
166
176
|
itemProgressCallback(template.itemId, EItemProgressStatus.Failed, 0);
|
|
167
177
|
throw ex;
|
|
168
178
|
});
|
|
@@ -181,15 +191,15 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
181
191
|
*/
|
|
182
192
|
export function postProcess(id, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
183
193
|
// create the requestOptions
|
|
184
|
-
|
|
194
|
+
let hubRo;
|
|
185
195
|
// get hubRequestOptions
|
|
186
196
|
return createHubRequestOptions(authentication)
|
|
187
|
-
.then(
|
|
197
|
+
.then(ro => {
|
|
188
198
|
hubRo = ro;
|
|
189
199
|
// get the site model
|
|
190
|
-
return getModel(id, { authentication
|
|
200
|
+
return getModel(id, { authentication });
|
|
191
201
|
})
|
|
192
|
-
.then(
|
|
202
|
+
.then(pageModel => {
|
|
193
203
|
// post process the page
|
|
194
204
|
return _postProcessPage(pageModel, itemInfos, templateDictionary, hubRo);
|
|
195
205
|
});
|
|
@@ -202,7 +212,7 @@ export function postProcess(id, type, itemInfos, template, templates, templateDi
|
|
|
202
212
|
* @param itemType
|
|
203
213
|
*/
|
|
204
214
|
export function isAPage(itemType) {
|
|
205
|
-
|
|
215
|
+
let result = false;
|
|
206
216
|
if (itemType === "Hub Page" || itemType === "Site Page") {
|
|
207
217
|
result = true;
|
|
208
218
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-page-processor.js","sourceRoot":"","sources":["../../src/hub-page-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"hub-page-processor.js","sourceRoot":"","sources":["../../src/hub-page-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,EAIL,mBAAmB,EAEnB,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAsB,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAGL,QAAQ,EACR,QAAQ,EAER,OAAO,EACP,OAAO,EACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,2BAA2B,EAC3B,UAAU,EACV,UAAU,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAA+B,EAC/B,oBAAiC,IAAI,CAAC,wDAAwD;;IAE9F,IAAI,OAAO,GAAW,CAAC,CAAC;IACxB,IAAI,QAAQ,GAAW,CAAC,CAAC;IAEzB,2CAA2C;IAC3C,OAAO,OAAO,CAAC,GAAG,CAAC;QACjB,QAAQ,CAAC,QAAQ,CAAC,EAAE,EA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MG;AACH,MAAM,UAAU,OAAO,CAAC,QAAgB;IACtC,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,QAAQ,KAAK,UAAU,IAAI,QAAQ,KAAK,WAAW,EAAE;QACvD,MAAM,GAAG,IAAI,CAAC;KACf;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
* @module hub-site-processor
|
|
20
20
|
*/
|
|
21
21
|
import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse, UserSession } from "@esri/solution-common";
|
|
22
|
+
/**
|
|
23
|
+
* Converts a Site item into a template.
|
|
24
|
+
*
|
|
25
|
+
* @param solutionItemId The solution to contain the template
|
|
26
|
+
* @param itemInfo Info about the item
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
29
|
+
* @return A promise that will resolve when the template has been created
|
|
30
|
+
*/
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
22
32
|
/**
|
|
23
33
|
* Handle deployment of Site item templates
|
|
24
34
|
*
|
|
@@ -30,15 +40,6 @@ import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse,
|
|
|
30
40
|
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
31
41
|
*/
|
|
32
42
|
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
33
|
-
/**
|
|
34
|
-
* Converts a Site item into a template.
|
|
35
|
-
*
|
|
36
|
-
* @param solutionItemId The solution to contain the template
|
|
37
|
-
* @param itemInfo Info about the item
|
|
38
|
-
* @param authentication Credentials for working with AGO
|
|
39
|
-
* @return A promise that will resolve when the template has been created
|
|
40
|
-
*/
|
|
41
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, authentication: UserSession): Promise<IItemTemplate>;
|
|
42
43
|
/**
|
|
43
44
|
* Deployer life-cycle hook allowing the Site Processor
|
|
44
45
|
* a chance to apply final processes to all the items that
|