@esri/solution-hub-types 6.0.2-alpha.23 → 6.0.2-alpha.250423
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/package.json +3 -3
- package/dist/cjs/helpers/_post-process-page.d.ts +0 -17
- package/dist/cjs/helpers/_post-process-page.js +0 -33
- package/dist/cjs/helpers/_post-process-page.js.map +0 -1
- package/dist/cjs/helpers/_post-process-site.d.ts +0 -29
- package/dist/cjs/helpers/_post-process-site.js +0 -53
- package/dist/cjs/helpers/_post-process-site.js.map +0 -1
- package/dist/cjs/helpers/_update-site-pages.d.ts +0 -24
- package/dist/cjs/helpers/_update-site-pages.js +0 -43
- package/dist/cjs/helpers/_update-site-pages.js.map +0 -1
- package/dist/cjs/helpers/move-model-to-folder.d.ts +0 -26
- package/dist/cjs/helpers/move-model-to-folder.js +0 -50
- package/dist/cjs/helpers/move-model-to-folder.js.map +0 -1
- package/dist/cjs/helpers/replace-item-ids.d.ts +0 -17
- package/dist/cjs/helpers/replace-item-ids.js +0 -37
- package/dist/cjs/helpers/replace-item-ids.js.map +0 -1
- package/dist/cjs/hub-page-processor.d.ts +0 -62
- package/dist/cjs/hub-page-processor.js +0 -225
- package/dist/cjs/hub-page-processor.js.map +0 -1
- package/dist/cjs/hub-site-processor.d.ts +0 -64
- package/dist/cjs/hub-site-processor.js +0 -235
- package/dist/cjs/hub-site-processor.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -23
- package/dist/cjs/index.js +0 -29
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/helpers/_post-process-page.d.ts +0 -17
- package/dist/esm/helpers/_post-process-page.js +0 -29
- package/dist/esm/helpers/_post-process-page.js.map +0 -1
- package/dist/esm/helpers/_post-process-site.d.ts +0 -29
- package/dist/esm/helpers/_post-process-site.js +0 -49
- package/dist/esm/helpers/_post-process-site.js.map +0 -1
- package/dist/esm/helpers/_update-site-pages.d.ts +0 -24
- package/dist/esm/helpers/_update-site-pages.js +0 -39
- package/dist/esm/helpers/_update-site-pages.js.map +0 -1
- package/dist/esm/helpers/move-model-to-folder.d.ts +0 -26
- package/dist/esm/helpers/move-model-to-folder.js +0 -46
- package/dist/esm/helpers/move-model-to-folder.js.map +0 -1
- package/dist/esm/helpers/replace-item-ids.d.ts +0 -17
- package/dist/esm/helpers/replace-item-ids.js +0 -33
- package/dist/esm/helpers/replace-item-ids.js.map +0 -1
- package/dist/esm/hub-page-processor.d.ts +0 -62
- package/dist/esm/hub-page-processor.js +0 -218
- package/dist/esm/hub-page-processor.js.map +0 -1
- package/dist/esm/hub-site-processor.d.ts +0 -64
- package/dist/esm/hub-site-processor.js +0 -228
- package/dist/esm/hub-site-processor.js.map +0 -1
- package/dist/esm/index.d.ts +0 -23
- package/dist/esm/index.js +0 -25
- package/dist/esm/index.js.map +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { IModel, IHubUserRequestOptions } from "@esri/hub-common";
|
|
17
|
-
/**
|
|
18
|
-
* Post Process a Site
|
|
19
|
-
* - share all items to the Hub teams created as part of the site
|
|
20
|
-
* - link any created page to the site item
|
|
21
|
-
* - re-interpolate any remaining item ids that were not direct deps of the site
|
|
22
|
-
*
|
|
23
|
-
* @param siteModel
|
|
24
|
-
* @param itemInfos
|
|
25
|
-
* @param templateDictionary
|
|
26
|
-
* @param hubRequestOptions
|
|
27
|
-
* @private
|
|
28
|
-
*/
|
|
29
|
-
export declare function _postProcessSite(siteModel: IModel, itemInfos: any[], templateDictionary: any, hubRequestOptions: IHubUserRequestOptions): Promise<boolean>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { shareItemsToSiteGroups, updateSite, interpolateSite } from "@esri/hub-sites";
|
|
2
|
-
import { _updateSitePages } from "./_update-site-pages";
|
|
3
|
-
/**
|
|
4
|
-
* Post Process a Site
|
|
5
|
-
* - share all items to the Hub teams created as part of the site
|
|
6
|
-
* - link any created page to the site item
|
|
7
|
-
* - re-interpolate any remaining item ids that were not direct deps of the site
|
|
8
|
-
*
|
|
9
|
-
* @param siteModel
|
|
10
|
-
* @param itemInfos
|
|
11
|
-
* @param templateDictionary
|
|
12
|
-
* @param hubRequestOptions
|
|
13
|
-
* @private
|
|
14
|
-
*/
|
|
15
|
-
export function _postProcessSite(siteModel, itemInfos, templateDictionary, hubRequestOptions) {
|
|
16
|
-
const infosWithoutSite = itemInfos.filter((info) => info.id !== siteModel.item.id);
|
|
17
|
-
// convert the itemInfo's into things that look enough like a model
|
|
18
|
-
// that we can call shareItemsToSiteGroups
|
|
19
|
-
const pseudoModels = infosWithoutSite.map((e) => {
|
|
20
|
-
return {
|
|
21
|
-
item: {
|
|
22
|
-
id: e.id,
|
|
23
|
-
type: e.type,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
let secondPassPromises = [];
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
29
|
-
secondPassPromises = secondPassPromises.concat(shareItemsToSiteGroups(siteModel, pseudoModels, hubRequestOptions));
|
|
30
|
-
// we can't use that same trick w/ the page sharing
|
|
31
|
-
// because we really need the models themselves
|
|
32
|
-
// so we delegate to a local function
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
34
|
-
secondPassPromises = secondPassPromises.concat(_updateSitePages(siteModel, infosWithoutSite, hubRequestOptions));
|
|
35
|
-
// need to get all the child items and add into site.item.properties.children
|
|
36
|
-
const childItemIds = infosWithoutSite.map((i) => i.id);
|
|
37
|
-
siteModel.item.properties.children = childItemIds;
|
|
38
|
-
// re-interpolate the siteModel using the itemInfos
|
|
39
|
-
siteModel = interpolateSite(siteModel, templateDictionary, {});
|
|
40
|
-
// and update the model
|
|
41
|
-
secondPassPromises.push(updateSite(siteModel, {
|
|
42
|
-
...hubRequestOptions,
|
|
43
|
-
allowList: undefined,
|
|
44
|
-
}));
|
|
45
|
-
return Promise.all(secondPassPromises).then(() => {
|
|
46
|
-
return true;
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=_post-process-site.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_post-process-site.js","sourceRoot":"","sources":["../../../src/helpers/_post-process-site.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,SAAgB,EAChB,kBAAuB,EACvB,iBAAyC;IAEzC,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEnF,mEAAmE;IACnE,0CAA0C;IAC1C,MAAM,YAAY,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC9C,OAAO;YACL,IAAI,EAAE;gBACJ,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,IAAI,EAAE,CAAC,CAAC,IAAI;aACb;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,kBAAkB,GAAwB,EAAE,CAAC;IAEjD,mEAAmE;IACnE,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,CAC5C,sBAAsB,CAAC,SAAS,EAAE,YAAmC,EAAE,iBAAiB,CAAC,CAC1F,CAAC;IAEF,mDAAmD;IACnD,+CAA+C;IAC/C,qCAAqC;IACrC,mEAAmE;IACnE,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACjH,6EAA6E;IAC7E,MAAM,YAAY,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEvD,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,YAAY,CAAC;IAElD,mDAAmD;IACnD,SAAS,GAAG,eAAe,CAAC,SAAS,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC/D,uBAAuB;IACvB,kBAAkB,CAAC,IAAI,CACrB,UAAU,CAAC,SAAS,EAAE;QACpB,GAAG,iBAAiB;QACpB,SAAS,EAAE,SAAS;KACrB,CAAC,CACH,CAAC;IAEF,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { IModel, IHubUserRequestOptions } from "@esri/hub-common";
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param siteModel
|
|
20
|
-
* @param itemInfos
|
|
21
|
-
* @param hubRequestOptions
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
export declare function _updateSitePages(siteModel: IModel, itemInfos: any[], hubRequestOptions: IHubUserRequestOptions): Promise<any>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { getModel } from "@esri/hub-common";
|
|
17
|
-
import { _updatePages } from "@esri/hub-sites";
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param siteModel
|
|
21
|
-
* @param itemInfos
|
|
22
|
-
* @param hubRequestOptions
|
|
23
|
-
* @private
|
|
24
|
-
*/
|
|
25
|
-
export function _updateSitePages(siteModel, itemInfos, hubRequestOptions) {
|
|
26
|
-
const pageIds = itemInfos
|
|
27
|
-
.filter((e) => {
|
|
28
|
-
return e.type.indexOf("Page") > -1;
|
|
29
|
-
})
|
|
30
|
-
.map((e) => e.id);
|
|
31
|
-
// now get all those models
|
|
32
|
-
return Promise.all(pageIds.map((id) => {
|
|
33
|
-
return getModel(id, hubRequestOptions);
|
|
34
|
-
})).then((pageModels) => {
|
|
35
|
-
// now delegate back to hub.js internal _updatePages fn
|
|
36
|
-
return _updatePages(siteModel, pageModels, hubRequestOptions);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=_update-site-pages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,SAAgB,EAChB,iBAAyC;IAEzC,MAAM,OAAO,GAAG,SAAS;SACtB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACZ,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEpB,2BAA2B;IAC3B,OAAO,OAAO,CAAC,GAAG,CAChB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QACjB,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"}
|
|
@@ -1,26 +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 { IModel } from "@esri/hub-common";
|
|
17
|
-
import { UserSession } from "@esri/solution-common";
|
|
18
|
-
/**
|
|
19
|
-
* Move the created site item, and optionally the Initiative, into
|
|
20
|
-
* the solution folder
|
|
21
|
-
*
|
|
22
|
-
* @param siteModel
|
|
23
|
-
* @param folderId
|
|
24
|
-
* @param authentication
|
|
25
|
-
*/
|
|
26
|
-
export declare function moveModelToFolder(siteModel: IModel, folderId: string, authentication: UserSession): Promise<any>;
|
|
@@ -1,46 +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 { getProp, failSafe } from "@esri/hub-common";
|
|
17
|
-
import { moveItem } from "@esri/solution-common";
|
|
18
|
-
/**
|
|
19
|
-
* Move the created site item, and optionally the Initiative, into
|
|
20
|
-
* the solution folder
|
|
21
|
-
*
|
|
22
|
-
* @param siteModel
|
|
23
|
-
* @param folderId
|
|
24
|
-
* @param authentication
|
|
25
|
-
*/
|
|
26
|
-
export function moveModelToFolder(siteModel, folderId, authentication) {
|
|
27
|
-
// Fail-Safe the move call as it's not critical if it fails
|
|
28
|
-
const failSafeMove = failSafe(moveItem, { success: true });
|
|
29
|
-
const movePromises = [
|
|
30
|
-
failSafeMove({
|
|
31
|
-
itemId: siteModel.item.id,
|
|
32
|
-
folderId,
|
|
33
|
-
authentication,
|
|
34
|
-
}),
|
|
35
|
-
];
|
|
36
|
-
// if an initiative was created...
|
|
37
|
-
if (getProp(siteModel, "item.properties.parentInitiativeId")) {
|
|
38
|
-
movePromises.push(failSafeMove({
|
|
39
|
-
itemId: siteModel.item.properties.parentInitiativeId,
|
|
40
|
-
folderId,
|
|
41
|
-
authentication,
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
return Promise.all(movePromises);
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=move-model-to-folder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAC7D,OAAO,EAAE,QAAQ,EAAe,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB,EAAE,QAAgB,EAAE,cAA2B;IAChG,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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { IModelTemplate } from "@esri/hub-common";
|
|
17
|
-
export declare function replaceItemIds(template: IModelTemplate): IModelTemplate;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { cloneObject, deepStringReplace } from "@esri/hub-common";
|
|
17
|
-
export function replaceItemIds(template) {
|
|
18
|
-
const clone = cloneObject(template);
|
|
19
|
-
const deps = template.dependencies || [];
|
|
20
|
-
// iterate the dependencies
|
|
21
|
-
deps.forEach((depId) => {
|
|
22
|
-
const re = new RegExp(depId, "g");
|
|
23
|
-
const replacement = `{{${depId}.itemId}}`;
|
|
24
|
-
// we have to do this property-by-property or we would replace the `itemId` prop itself
|
|
25
|
-
clone.item = deepStringReplace(clone.item, re, replacement);
|
|
26
|
-
clone.data = deepStringReplace(clone.data, re, replacement);
|
|
27
|
-
if (template.properties) {
|
|
28
|
-
clone.properties = deepStringReplace(clone.properties, re, replacement);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return clone;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=replace-item-ids.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replace-item-ids.js","sourceRoot":"","sources":["../../../src/helpers/replace-item-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAkB,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAElF,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,CAAC,KAAK,EAAE,EAAE;QACrB,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"}
|
|
@@ -1,62 +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
|
-
/**
|
|
17
|
-
* Manages the creation and deployment of Hub Page item types.
|
|
18
|
-
*
|
|
19
|
-
* @module hub-page-processor
|
|
20
|
-
*/
|
|
21
|
-
import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse, UserSession } from "@esri/solution-common";
|
|
22
|
-
/**
|
|
23
|
-
* Converts a Hub Page item into a template.
|
|
24
|
-
*
|
|
25
|
-
* @param itemInfo Info about the item
|
|
26
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
27
|
-
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
28
|
-
* @returns A promise that will resolve when the template has been created
|
|
29
|
-
*/
|
|
30
|
-
export declare function convertItemToTemplate(itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
31
|
-
/**
|
|
32
|
-
* Handle deployment of Page item templates
|
|
33
|
-
*
|
|
34
|
-
* @export
|
|
35
|
-
* @param {IItemTemplate} template
|
|
36
|
-
* @param {*} templateDictionary
|
|
37
|
-
* @param {UserSession} destinationAuthentication
|
|
38
|
-
* @param {IItemProgressCallback} itemProgressCallback
|
|
39
|
-
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
40
|
-
*/
|
|
41
|
-
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
42
|
-
/**
|
|
43
|
-
* Post-Process a Page
|
|
44
|
-
* Re-interpolate the page item + data w/ the full template dictionary hash
|
|
45
|
-
*
|
|
46
|
-
* @param id
|
|
47
|
-
* @param type
|
|
48
|
-
* @param itemInfos
|
|
49
|
-
* @param template
|
|
50
|
-
* @param templates
|
|
51
|
-
* @param templateDictionary
|
|
52
|
-
* @param authentication
|
|
53
|
-
*/
|
|
54
|
-
export declare function postProcess(id: string, type: string, itemInfos: any[], template: any, templates: IItemTemplate[], templateDictionary: any, authentication: UserSession): Promise<boolean>;
|
|
55
|
-
/**
|
|
56
|
-
* Check of an item type is a Page
|
|
57
|
-
* Hub Page is for ArcGIS Online
|
|
58
|
-
* Site Page is for ArcGIS Enterprise
|
|
59
|
-
*
|
|
60
|
-
* @param itemType
|
|
61
|
-
*/
|
|
62
|
-
export declare function isAPage(itemType: string): boolean;
|
|
@@ -1,218 +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
|
-
/**
|
|
17
|
-
* Manages the creation and deployment of Hub Page item types.
|
|
18
|
-
*
|
|
19
|
-
* @module hub-page-processor
|
|
20
|
-
*/
|
|
21
|
-
import { EItemProgressStatus, convertIModel, createHubRequestOptions, generateEmptyCreationResponse, restUpdateItem, } from "@esri/solution-common";
|
|
22
|
-
import { failSafe, getModel, getProp, without } from "@esri/hub-common";
|
|
23
|
-
import { createPageModelFromTemplate, createPage, removePage, convertPageToTemplate } from "@esri/hub-sites";
|
|
24
|
-
import { _postProcessPage } from "./helpers/_post-process-page";
|
|
25
|
-
import { replaceItemIds } from "./helpers/replace-item-ids";
|
|
26
|
-
import { moveModelToFolder } from "./helpers/move-model-to-folder";
|
|
27
|
-
/**
|
|
28
|
-
* Converts a Hub Page item into a template.
|
|
29
|
-
*
|
|
30
|
-
* @param itemInfo Info about the item
|
|
31
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
32
|
-
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
33
|
-
* @returns A promise that will resolve when the template has been created
|
|
34
|
-
*/
|
|
35
|
-
export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication = null) {
|
|
36
|
-
let created = 0;
|
|
37
|
-
let modified = 0;
|
|
38
|
-
// get the page model and hubRequestOptions
|
|
39
|
-
return Promise.all([
|
|
40
|
-
getModel(itemInfo.id, { authentication: destAuthentication }),
|
|
41
|
-
createHubRequestOptions(destAuthentication),
|
|
42
|
-
])
|
|
43
|
-
.then(([pageModel, ro]) => {
|
|
44
|
-
// We need to save these properties in order to restore them after hub.js deletes them
|
|
45
|
-
created = pageModel.item.created;
|
|
46
|
-
modified = pageModel.item.modified;
|
|
47
|
-
return convertPageToTemplate(pageModel, ro);
|
|
48
|
-
})
|
|
49
|
-
.then((tmpl) => {
|
|
50
|
-
// add in some stuff Hub.js does not yet add
|
|
51
|
-
tmpl.item.created = created;
|
|
52
|
-
tmpl.item.modified = modified;
|
|
53
|
-
tmpl.item.typeKeywords = without(tmpl.item.typeKeywords, "doNotDelete");
|
|
54
|
-
tmpl.groups = [];
|
|
55
|
-
tmpl.estimatedDeploymentCostFactor = 2;
|
|
56
|
-
tmpl.resources = [];
|
|
57
|
-
if (!getProp(tmpl, "properties")) {
|
|
58
|
-
tmpl.properties = {};
|
|
59
|
-
}
|
|
60
|
-
// swap out dependency id's to {{<depid>.itemId}}
|
|
61
|
-
// so it will be re-interpolated
|
|
62
|
-
tmpl = replaceItemIds(tmpl);
|
|
63
|
-
// and return it
|
|
64
|
-
return tmpl;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Handle deployment of Page item templates
|
|
69
|
-
*
|
|
70
|
-
* @export
|
|
71
|
-
* @param {IItemTemplate} template
|
|
72
|
-
* @param {*} templateDictionary
|
|
73
|
-
* @param {UserSession} destinationAuthentication
|
|
74
|
-
* @param {IItemProgressCallback} itemProgressCallback
|
|
75
|
-
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
76
|
-
*/
|
|
77
|
-
export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
78
|
-
// let the progress system know we've started...
|
|
79
|
-
const startStatus = itemProgressCallback(template.itemId, EItemProgressStatus.Started, 0);
|
|
80
|
-
// and if it returned false, just resolve out
|
|
81
|
-
if (!startStatus) {
|
|
82
|
-
return Promise.resolve(generateEmptyCreationResponse(template.type));
|
|
83
|
-
}
|
|
84
|
-
// TODO: Reassess with resource unification
|
|
85
|
-
if (template.assets && template.resources) {
|
|
86
|
-
delete template.assets;
|
|
87
|
-
}
|
|
88
|
-
// solutionItemExtent is in geographic, but it's a string, and we want/need a bbox
|
|
89
|
-
// and Hub templates expect it in organization.defaultExtentBBox
|
|
90
|
-
if (templateDictionary.solutionItemExtent) {
|
|
91
|
-
const parts = templateDictionary.solutionItemExtent.split(",");
|
|
92
|
-
templateDictionary.organization.defaultExtentBBox = [
|
|
93
|
-
[parts[0], parts[1]],
|
|
94
|
-
[parts[2], parts[3]],
|
|
95
|
-
];
|
|
96
|
-
}
|
|
97
|
-
// TODO: Determine if we need any transforms in this new env
|
|
98
|
-
const transforms = {};
|
|
99
|
-
// create an object to hold the created site through
|
|
100
|
-
// subsequent promise calls
|
|
101
|
-
let pageModel;
|
|
102
|
-
let hubRo;
|
|
103
|
-
const thumbnail = template.item.thumbnail; // createPageModelFromTemplate trashes thumbnail
|
|
104
|
-
return createHubRequestOptions(destinationAuthentication, templateDictionary)
|
|
105
|
-
.then((ro) => {
|
|
106
|
-
hubRo = ro;
|
|
107
|
-
return createPageModelFromTemplate(template, templateDictionary, transforms, hubRo);
|
|
108
|
-
})
|
|
109
|
-
.then((interpolated) => {
|
|
110
|
-
// --------------------------------------------
|
|
111
|
-
// TODO: Update hub.js to take an IModel in createPage
|
|
112
|
-
// then remove this silliness
|
|
113
|
-
const modelTmpl = interpolated;
|
|
114
|
-
const options = {
|
|
115
|
-
assets: modelTmpl.assets || [],
|
|
116
|
-
};
|
|
117
|
-
// --------------------------------------------
|
|
118
|
-
return createPage(modelTmpl, options, hubRo);
|
|
119
|
-
})
|
|
120
|
-
.then((page) => {
|
|
121
|
-
pageModel = page;
|
|
122
|
-
// Move the site and initiative to the solution folder
|
|
123
|
-
// this is essentially fire and forget. We fail-safe the actual moveItem
|
|
124
|
-
// call since it's not critical to the outcome
|
|
125
|
-
return moveModelToFolder(page, templateDictionary.folderId, destinationAuthentication);
|
|
126
|
-
})
|
|
127
|
-
.then(() => {
|
|
128
|
-
// Fix the thumbnail
|
|
129
|
-
const updateOptions = {
|
|
130
|
-
item: {
|
|
131
|
-
id: pageModel.item.id,
|
|
132
|
-
},
|
|
133
|
-
params: {
|
|
134
|
-
// Pass thumbnail in via params because item property is serialized, which discards a blob
|
|
135
|
-
thumbnail,
|
|
136
|
-
},
|
|
137
|
-
authentication: destinationAuthentication,
|
|
138
|
-
};
|
|
139
|
-
return restUpdateItem(updateOptions);
|
|
140
|
-
})
|
|
141
|
-
.then(() => {
|
|
142
|
-
// Update the template dictionary
|
|
143
|
-
// TODO: This should be done in whatever recieves
|
|
144
|
-
// the outcome of this promise chain
|
|
145
|
-
templateDictionary[template.itemId] = {
|
|
146
|
-
itemId: pageModel.item.id,
|
|
147
|
-
};
|
|
148
|
-
// call the progress callback, which also mutates templateDictionary
|
|
149
|
-
const finalStatus = itemProgressCallback(template.itemId, EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor || 2, pageModel.item.id);
|
|
150
|
-
if (!finalStatus) {
|
|
151
|
-
// clean up the site we just created
|
|
152
|
-
const failSafeRemove = failSafe(removePage, { success: true });
|
|
153
|
-
return failSafeRemove(pageModel, hubRo).then(() => {
|
|
154
|
-
return Promise.resolve(generateEmptyCreationResponse(template.type));
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
// finally, return ICreateItemFromTemplateResponse
|
|
159
|
-
const response = {
|
|
160
|
-
item: {
|
|
161
|
-
...template,
|
|
162
|
-
...convertIModel(pageModel),
|
|
163
|
-
},
|
|
164
|
-
id: pageModel.item.id,
|
|
165
|
-
type: template.type,
|
|
166
|
-
postProcess: true,
|
|
167
|
-
};
|
|
168
|
-
response.item.itemId = pageModel.item.id;
|
|
169
|
-
return response;
|
|
170
|
-
}
|
|
171
|
-
})
|
|
172
|
-
.catch((ex) => {
|
|
173
|
-
itemProgressCallback(template.itemId, EItemProgressStatus.Failed, 0);
|
|
174
|
-
throw ex;
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Post-Process a Page
|
|
179
|
-
* Re-interpolate the page item + data w/ the full template dictionary hash
|
|
180
|
-
*
|
|
181
|
-
* @param id
|
|
182
|
-
* @param type
|
|
183
|
-
* @param itemInfos
|
|
184
|
-
* @param template
|
|
185
|
-
* @param templates
|
|
186
|
-
* @param templateDictionary
|
|
187
|
-
* @param authentication
|
|
188
|
-
*/
|
|
189
|
-
export function postProcess(id, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
190
|
-
// create the requestOptions
|
|
191
|
-
let hubRo;
|
|
192
|
-
// get hubRequestOptions
|
|
193
|
-
return createHubRequestOptions(authentication)
|
|
194
|
-
.then((ro) => {
|
|
195
|
-
hubRo = ro;
|
|
196
|
-
// get the site model
|
|
197
|
-
return getModel(id, { authentication });
|
|
198
|
-
})
|
|
199
|
-
.then((pageModel) => {
|
|
200
|
-
// post process the page
|
|
201
|
-
return _postProcessPage(pageModel, itemInfos, templateDictionary, hubRo);
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Check of an item type is a Page
|
|
206
|
-
* Hub Page is for ArcGIS Online
|
|
207
|
-
* Site Page is for ArcGIS Enterprise
|
|
208
|
-
*
|
|
209
|
-
* @param itemType
|
|
210
|
-
*/
|
|
211
|
-
export function isAPage(itemType) {
|
|
212
|
-
let result = false;
|
|
213
|
-
if (itemType === "Hub Page" || itemType === "Site Page") {
|
|
214
|
-
result = true;
|
|
215
|
-
}
|
|
216
|
-
return result;
|
|
217
|
-
}
|
|
218
|
-
//# sourceMappingURL=hub-page-processor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hub-page-processor.js","sourceRoot":"","sources":["../../src/hub-page-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;A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CAAC;SACD,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE;QACZ,oBAAoB,CAAC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACrE,MAAM,EAAE,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CACzB,EAAU,EACV,IAAY,EACZ,SAAgB,EAChB,QAAa,EACb,SAA0B,EAC1B,kBAAuB,EACvB,cAA2B;IAE3B,4BAA4B;IAC5B,IAAI,KAA6B,CAAC;IAClC,wBAAwB;IACxB,OAAO,uBAAuB,CAAC,cAAc,CAAC;SAC3C,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE;QACX,KAAK,GAAG,EAAE,CAAC;QACX,qBAAqB;QACrB,OAAO,QAAQ,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;QAClB,wBAAwB;QACxB,OAAO,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;GAMG;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"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Manages the creation and deployment of Hub Site item types.
|
|
18
|
-
*
|
|
19
|
-
* @module hub-site-processor
|
|
20
|
-
*/
|
|
21
|
-
import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse, UserSession } from "@esri/solution-common";
|
|
22
|
-
/**
|
|
23
|
-
* Converts a Site item into a template.
|
|
24
|
-
*
|
|
25
|
-
* @param itemInfo Info about the item
|
|
26
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
27
|
-
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
28
|
-
* @returns A promise that will resolve when the template has been created
|
|
29
|
-
*/
|
|
30
|
-
export declare function convertItemToTemplate(itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
31
|
-
/**
|
|
32
|
-
* Handle deployment of Site item templates
|
|
33
|
-
*
|
|
34
|
-
* @export
|
|
35
|
-
* @param {IItemTemplate} template
|
|
36
|
-
* @param {*} templateDictionary
|
|
37
|
-
* @param {UserSession} destinationAuthentication
|
|
38
|
-
* @param {IItemProgressCallback} itemProgressCallback
|
|
39
|
-
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
40
|
-
*/
|
|
41
|
-
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
42
|
-
/**
|
|
43
|
-
* Deployer life-cycle hook allowing the Site Processor
|
|
44
|
-
* a chance to apply final processes to all the items that
|
|
45
|
-
* were created as part of the solution.
|
|
46
|
-
* Specifically this will:
|
|
47
|
-
* - share all items to the content team, and (if created)
|
|
48
|
-
* the core team (depends on user privs)
|
|
49
|
-
* - link all Page items that were created, to the Site
|
|
50
|
-
*
|
|
51
|
-
* @param model
|
|
52
|
-
* @param items
|
|
53
|
-
* @param authentication
|
|
54
|
-
* @param templateDictionary
|
|
55
|
-
*/
|
|
56
|
-
export declare function postProcess(id: string, type: string, itemInfos: any[], template: any, templates: IItemTemplate[], templateDictionary: any, authentication: UserSession): Promise<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
* Check of an item type is a Site
|
|
59
|
-
* Hub Site Application is for ArcGIS Online
|
|
60
|
-
* Site Application is for ArcGIS Enterprise
|
|
61
|
-
*
|
|
62
|
-
* @param itemType
|
|
63
|
-
*/
|
|
64
|
-
export declare function isASite(itemType: string): boolean;
|