@esri/solution-hub-types 5.2.3 → 5.2.5

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.
@@ -0,0 +1,17 @@
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
+ export declare function _postProcessPage(pageModel: IModel, itemInfos: any[], templateDictionary: any, hubRequestOptions: IHubUserRequestOptions): Promise<boolean>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._postProcessPage = void 0;
4
+ /** @license
5
+ * Copyright 2020 Esri
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ const hub_common_1 = require("@esri/hub-common");
20
+ const hub_sites_1 = require("@esri/hub-sites");
21
+ //TODO: function doc
22
+ function _postProcessPage(pageModel, itemInfos, templateDictionary, hubRequestOptions) {
23
+ // re-interpolate the siteModel using the itemInfos; no patches supplied
24
+ pageModel = (0, hub_common_1.interpolate)(pageModel, templateDictionary, {});
25
+ return (0, hub_sites_1.updatePage)(pageModel, {
26
+ ...hubRequestOptions,
27
+ allowList: []
28
+ }).then(() => {
29
+ return true;
30
+ });
31
+ }
32
+ exports._postProcessPage = _postProcessPage;
33
+ //# sourceMappingURL=_post-process-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_post-process-page.js","sourceRoot":"","sources":["../../../src/helpers/_post-process-page.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,iDAA+E;AAC/E,+CAA6C;AAE7C,oBAAoB;AACpB,SAAgB,gBAAgB,CAC9B,SAAiB,EACjB,SAAgB,EAChB,kBAAuB,EACvB,iBAAyC;IAEzC,wEAAwE;IACxE,SAAS,GAAG,IAAA,wBAAW,EAAC,SAAS,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC3D,OAAO,IAAA,sBAAU,EAAC,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;AAdD,4CAcC"}
@@ -0,0 +1,29 @@
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>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._postProcessSite = void 0;
4
+ const hub_sites_1 = require("@esri/hub-sites");
5
+ const _update_site_pages_1 = require("./_update-site-pages");
6
+ /**
7
+ * Post Process a Site
8
+ * - share all items to the Hub teams created as part of the site
9
+ * - link any created page to the site item
10
+ * - re-interpolate any remaining item ids that were not direct deps of the site
11
+ *
12
+ * @param siteModel
13
+ * @param itemInfos
14
+ * @param templateDictionary
15
+ * @param hubRequestOptions
16
+ * @private
17
+ */
18
+ function _postProcessSite(siteModel, itemInfos, templateDictionary, hubRequestOptions) {
19
+ const infosWithoutSite = itemInfos.filter(info => info.id !== siteModel.item.id);
20
+ // convert the itemInfo's into things that look enough like a model
21
+ // that we can call shareItemsToSiteGroups
22
+ const pseudoModels = infosWithoutSite.map(e => {
23
+ return {
24
+ item: {
25
+ id: e.id,
26
+ type: e.type
27
+ }
28
+ };
29
+ });
30
+ let secondPassPromises = [];
31
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
32
+ secondPassPromises = secondPassPromises.concat((0, hub_sites_1.shareItemsToSiteGroups)(siteModel, pseudoModels, hubRequestOptions));
33
+ // we can't use that same trick w/ the page sharing
34
+ // because we really need the models themselves
35
+ // so we delegate to a local function
36
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
37
+ secondPassPromises = secondPassPromises.concat((0, _update_site_pages_1._updateSitePages)(siteModel, infosWithoutSite, hubRequestOptions));
38
+ // need to get all the child items and add into site.item.properties.children
39
+ const childItemIds = infosWithoutSite.map(i => i.id);
40
+ siteModel.item.properties.children = childItemIds;
41
+ // re-interpolate the siteModel using the itemInfos
42
+ siteModel = (0, hub_sites_1.interpolateSite)(siteModel, templateDictionary, {});
43
+ // and update the model
44
+ secondPassPromises.push((0, hub_sites_1.updateSite)(siteModel, {
45
+ ...hubRequestOptions,
46
+ allowList: null
47
+ }));
48
+ return Promise.all(secondPassPromises).then(() => {
49
+ return true;
50
+ });
51
+ }
52
+ exports._postProcessSite = _postProcessSite;
53
+ //# sourceMappingURL=_post-process-site.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_post-process-site.js","sourceRoot":"","sources":["../../../src/helpers/_post-process-site.ts"],"names":[],"mappings":";;;AAiBA,+CAAsF;AAEtF,6DAAwD;AAExD;;;;;;;;;;;GAWG;AACH,SAAgB,gBAAgB,CAC9B,SAAiB,EACjB,SAAgB,EAChB,kBAAuB,EACvB,iBAAyC;IAEzC,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CACvC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,SAAS,CAAC,IAAI,CAAC,EAAE,CACtC,CAAC;IAEF,mEAAmE;IACnE,0CAA0C;IAC1C,MAAM,YAAY,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QAC5C,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,IAAA,kCAAsB,EACpB,SAAS,EACR,YAAoC,EACrC,iBAAiB,CAClB,CACF,CAAC;IAEF,mDAAmD;IACnD,+CAA+C;IAC/C,qCAAqC;IACrC,mEAAmE;IACnE,kBAAkB,GAAG,kBAAkB,CAAC,MAAM,CAC5C,IAAA,qCAAgB,EAAC,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CACjE,CAAC;IACF,6EAA6E;IAC7E,MAAM,YAAY,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAErD,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,YAAY,CAAC;IAElD,mDAAmD;IACnD,SAAS,GAAG,IAAA,2BAAe,EAAC,SAAS,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC/D,uBAAuB;IACvB,kBAAkB,CAAC,IAAI,CACrB,IAAA,sBAAU,EAAC,SAAS,EAAE;QACpB,GAAG,iBAAiB;QACpB,SAAS,EAAE,IAAI;KAChB,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;AAzDD,4CAyDC"}
@@ -0,0 +1,24 @@
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>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._updateSitePages = void 0;
4
+ /** @license
5
+ * Copyright 2020 Esri
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ const hub_common_1 = require("@esri/hub-common");
20
+ const hub_sites_1 = require("@esri/hub-sites");
21
+ /**
22
+ *
23
+ * @param siteModel
24
+ * @param itemInfos
25
+ * @param hubRequestOptions
26
+ * @private
27
+ */
28
+ function _updateSitePages(siteModel, itemInfos, hubRequestOptions) {
29
+ const pageIds = itemInfos
30
+ .filter(e => {
31
+ return e.type.indexOf("Page") > -1;
32
+ })
33
+ .map(e => e.id);
34
+ // now get all those models
35
+ return Promise.all(pageIds.map(id => {
36
+ return (0, hub_common_1.getModel)(id, hubRequestOptions);
37
+ })).then((pageModels) => {
38
+ // now delegate back to hub.js internal _updatePages fn
39
+ return (0, hub_sites_1._updatePages)(siteModel, pageModels, hubRequestOptions);
40
+ });
41
+ }
42
+ exports._updateSitePages = _updateSitePages;
43
+ //# sourceMappingURL=_update-site-pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_update-site-pages.js","sourceRoot":"","sources":["../../../src/helpers/_update-site-pages.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,iDAA4E;AAC5E,+CAA+C;AAC/C;;;;;;GAMG;AACH,SAAgB,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,IAAA,qBAAQ,EAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;IACzC,CAAC,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,UAAe,EAAE,EAAE;QACzB,uDAAuD;QACvD,OAAO,IAAA,wBAAY,EAAC,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC;AApBD,4CAoBC"}
@@ -0,0 +1,26 @@
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>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2018 Esri
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.moveModelToFolder = void 0;
19
+ const hub_common_1 = require("@esri/hub-common");
20
+ const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
21
+ /**
22
+ * Move the created site item, and optionally the Initiative, into
23
+ * the solution folder
24
+ *
25
+ * @param siteModel
26
+ * @param folderId
27
+ * @param authentication
28
+ */
29
+ function moveModelToFolder(siteModel, folderId, authentication) {
30
+ // Fail-Safe the move call as it's not critical if it fails
31
+ const failSafeMove = (0, hub_common_1.failSafe)(arcgis_rest_portal_1.moveItem, { success: true });
32
+ const movePromises = [
33
+ failSafeMove({
34
+ itemId: siteModel.item.id,
35
+ folderId,
36
+ authentication
37
+ })
38
+ ];
39
+ // if an initiative was created...
40
+ if ((0, hub_common_1.getProp)(siteModel, "item.properties.parentInitiativeId")) {
41
+ movePromises.push(failSafeMove({
42
+ itemId: siteModel.item.properties.parentInitiativeId,
43
+ folderId,
44
+ authentication
45
+ }));
46
+ }
47
+ return Promise.all(movePromises);
48
+ }
49
+ exports.moveModelToFolder = moveModelToFolder;
50
+ //# sourceMappingURL=move-model-to-folder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-model-to-folder.js","sourceRoot":"","sources":["../../../src/helpers/move-model-to-folder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,iDAA6D;AAE7D,iEAAoD;AAEpD;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC/B,SAAiB,EACjB,QAAgB,EAChB,cAA2B;IAE3B,2DAA2D;IAC3D,MAAM,YAAY,GAAG,IAAA,qBAAQ,EAAC,6BAAQ,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,IAAA,oBAAO,EAAC,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;AA3BD,8CA2BC"}
@@ -0,0 +1,17 @@
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;
@@ -0,0 +1,37 @@
1
+ "use strict";
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.replaceItemIds = void 0;
19
+ const hub_common_1 = require("@esri/hub-common");
20
+ function replaceItemIds(template) {
21
+ const clone = (0, hub_common_1.cloneObject)(template);
22
+ const deps = template.dependencies || [];
23
+ // iterate the dependencies
24
+ deps.forEach(depId => {
25
+ const re = new RegExp(depId, "g");
26
+ const replacement = `{{${depId}.itemId}}`;
27
+ // we have to do this property-by-property or we would replace the `itemId` prop itself
28
+ clone.item = (0, hub_common_1.deepStringReplace)(clone.item, re, replacement);
29
+ clone.data = (0, hub_common_1.deepStringReplace)(clone.data, re, replacement);
30
+ if (template.properties) {
31
+ clone.properties = (0, hub_common_1.deepStringReplace)(clone.properties, re, replacement);
32
+ }
33
+ });
34
+ return clone;
35
+ }
36
+ exports.replaceItemIds = replaceItemIds;
37
+ //# sourceMappingURL=replace-item-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-item-ids.js","sourceRoot":"","sources":["../../../src/helpers/replace-item-ids.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,iDAI0B;AAE1B,SAAgB,cAAc,CAAC,QAAwB;IACrD,MAAM,KAAK,GAAG,IAAA,wBAAW,EAAC,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,IAAA,8BAAiB,EAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QAC5D,KAAK,CAAC,IAAI,GAAG,IAAA,8BAAiB,EAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QAC5D,IAAI,QAAQ,CAAC,UAAU,EAAE;YACvB,KAAK,CAAC,UAAU,GAAG,IAAA,8BAAiB,EAAC,KAAK,CAAC,UAAU,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;SACzE;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AAfD,wCAeC"}
@@ -0,0 +1,62 @@
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;
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2018 Esri
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.isAPage = exports.postProcess = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
19
+ /**
20
+ * Manages the creation and deployment of Hub Page item types.
21
+ *
22
+ * @module hub-page-processor
23
+ */
24
+ const solution_common_1 = require("@esri/solution-common");
25
+ const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
26
+ const hub_common_1 = require("@esri/hub-common");
27
+ const hub_sites_1 = require("@esri/hub-sites");
28
+ const _post_process_page_1 = require("./helpers/_post-process-page");
29
+ const replace_item_ids_1 = require("./helpers/replace-item-ids");
30
+ const move_model_to_folder_1 = require("./helpers/move-model-to-folder");
31
+ /**
32
+ * Converts a Hub Page item into a template.
33
+ *
34
+ * @param itemInfo Info about the item
35
+ * @param destAuthentication Credentials for requests to the destination organization
36
+ * @param srcAuthentication Credentials for requests to source items (placeholder--not used)
37
+ * @returns A promise that will resolve when the template has been created
38
+ */
39
+ function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication = null // eslint-disable-line @typescript-eslint/no-unused-vars
40
+ ) {
41
+ let created = 0;
42
+ let modified = 0;
43
+ // get the page model and hubRequestOptions
44
+ return Promise.all([
45
+ (0, hub_common_1.getModel)(itemInfo.id, { authentication: destAuthentication }),
46
+ (0, solution_common_1.createHubRequestOptions)(destAuthentication)
47
+ ])
48
+ .then(([pageModel, ro]) => {
49
+ // We need to save these properties in order to restore them after hub.js deletes them
50
+ created = pageModel.item.created;
51
+ modified = pageModel.item.modified;
52
+ return (0, hub_sites_1.convertPageToTemplate)(pageModel, ro);
53
+ })
54
+ .then(tmpl => {
55
+ // add in some stuff Hub.js does not yet add
56
+ tmpl.item.created = created;
57
+ tmpl.item.modified = modified;
58
+ tmpl.item.typeKeywords = (0, hub_common_1.without)(tmpl.item.typeKeywords, "doNotDelete");
59
+ tmpl.groups = [];
60
+ tmpl.estimatedDeploymentCostFactor = 2;
61
+ tmpl.resources = [];
62
+ if (!(0, hub_common_1.getProp)(tmpl, "properties")) {
63
+ tmpl.properties = {};
64
+ }
65
+ // swap out dependency id's to {{<depid>.itemId}}
66
+ // so it will be re-interpolated
67
+ tmpl = (0, replace_item_ids_1.replaceItemIds)(tmpl);
68
+ // and return it
69
+ return tmpl;
70
+ });
71
+ }
72
+ exports.convertItemToTemplate = convertItemToTemplate;
73
+ /**
74
+ * Handle deployment of Page item templates
75
+ *
76
+ * @export
77
+ * @param {IItemTemplate} template
78
+ * @param {*} templateDictionary
79
+ * @param {UserSession} destinationAuthentication
80
+ * @param {IItemProgressCallback} itemProgressCallback
81
+ * @returns {Promise<ICreateItemFromTemplateResponse>}
82
+ */
83
+ function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
84
+ // let the progress system know we've started...
85
+ const startStatus = itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Started, 0);
86
+ // and if it returned false, just resolve out
87
+ if (!startStatus) {
88
+ return Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type));
89
+ }
90
+ // TODO: Reassess with resource unification
91
+ if (template.assets && template.resources) {
92
+ delete template.assets;
93
+ }
94
+ // solutionItemExtent is in geographic, but it's a string, and we want/need a bbox
95
+ // and Hub templates expect it in organization.defaultExtentBBox
96
+ if (templateDictionary.solutionItemExtent) {
97
+ const parts = templateDictionary.solutionItemExtent.split(",");
98
+ templateDictionary.organization.defaultExtentBBox = [
99
+ [parts[0], parts[1]],
100
+ [parts[2], parts[3]]
101
+ ];
102
+ }
103
+ // TODO: Determine if we need any transforms in this new env
104
+ const transforms = {};
105
+ // create an object to hold the created site through
106
+ // subsequent promise calls
107
+ let pageModel;
108
+ let hubRo;
109
+ const thumbnail = template.item.thumbnail; // createPageModelFromTemplate trashes thumbnail
110
+ return (0, solution_common_1.createHubRequestOptions)(destinationAuthentication, templateDictionary)
111
+ .then(ro => {
112
+ hubRo = ro;
113
+ return (0, hub_sites_1.createPageModelFromTemplate)(template, templateDictionary, transforms, hubRo);
114
+ })
115
+ .then((interpolated) => {
116
+ // --------------------------------------------
117
+ // TODO: Update hub.js to take an IModel in createPage
118
+ // then remove this silliness
119
+ const modelTmpl = interpolated;
120
+ const options = {
121
+ assets: modelTmpl.assets || []
122
+ };
123
+ // --------------------------------------------
124
+ return (0, hub_sites_1.createPage)(modelTmpl, options, hubRo);
125
+ })
126
+ .then(page => {
127
+ pageModel = page;
128
+ // Move the site and initiative to the solution folder
129
+ // this is essentially fire and forget. We fail-safe the actual moveItem
130
+ // call since it's not critical to the outcome
131
+ return (0, move_model_to_folder_1.moveModelToFolder)(page, templateDictionary.folderId, destinationAuthentication);
132
+ })
133
+ .then(() => {
134
+ // Fix the thumbnail
135
+ const updateOptions = {
136
+ item: {
137
+ id: pageModel.item.id
138
+ },
139
+ params: {
140
+ // Pass thumbnail in via params because item property is serialized, which discards a blob
141
+ thumbnail
142
+ },
143
+ authentication: destinationAuthentication
144
+ };
145
+ return (0, arcgis_rest_portal_1.updateItem)(updateOptions);
146
+ })
147
+ .then(() => {
148
+ // Update the template dictionary
149
+ // TODO: This should be done in whatever recieves
150
+ // the outcome of this promise chain
151
+ templateDictionary[template.itemId] = {
152
+ itemId: pageModel.item.id
153
+ };
154
+ // call the progress callback, which also mutates templateDictionary
155
+ const finalStatus = itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor || 2, pageModel.item.id);
156
+ if (!finalStatus) {
157
+ // clean up the site we just created
158
+ const failSafeRemove = (0, hub_common_1.failSafe)(hub_sites_1.removePage, { success: true });
159
+ return failSafeRemove(pageModel, hubRo).then(() => {
160
+ return Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type));
161
+ });
162
+ }
163
+ else {
164
+ // finally, return ICreateItemFromTemplateResponse
165
+ const response = {
166
+ item: {
167
+ ...template,
168
+ ...(0, solution_common_1.convertIModel)(pageModel)
169
+ },
170
+ id: pageModel.item.id,
171
+ type: template.type,
172
+ postProcess: true
173
+ };
174
+ response.item.itemId = pageModel.item.id;
175
+ return response;
176
+ }
177
+ })
178
+ .catch(ex => {
179
+ itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Failed, 0);
180
+ throw ex;
181
+ });
182
+ }
183
+ exports.createItemFromTemplate = createItemFromTemplate;
184
+ /**
185
+ * Post-Process a Page
186
+ * Re-interpolate the page item + data w/ the full template dictionary hash
187
+ *
188
+ * @param id
189
+ * @param type
190
+ * @param itemInfos
191
+ * @param template
192
+ * @param templates
193
+ * @param templateDictionary
194
+ * @param authentication
195
+ */
196
+ function postProcess(id, type, itemInfos, template, templates, templateDictionary, authentication) {
197
+ // create the requestOptions
198
+ let hubRo;
199
+ // get hubRequestOptions
200
+ return (0, solution_common_1.createHubRequestOptions)(authentication)
201
+ .then(ro => {
202
+ hubRo = ro;
203
+ // get the site model
204
+ return (0, hub_common_1.getModel)(id, { authentication });
205
+ })
206
+ .then(pageModel => {
207
+ // post process the page
208
+ return (0, _post_process_page_1._postProcessPage)(pageModel, itemInfos, templateDictionary, hubRo);
209
+ });
210
+ }
211
+ exports.postProcess = postProcess;
212
+ /**
213
+ * Check of an item type is a Page
214
+ * Hub Page is for ArcGIS Online
215
+ * Site Page is for ArcGIS Enterprise
216
+ *
217
+ * @param itemType
218
+ */
219
+ function isAPage(itemType) {
220
+ let result = false;
221
+ if (itemType === "Hub Page" || itemType === "Site Page") {
222
+ result = true;
223
+ }
224
+ return result;
225
+ }
226
+ exports.isAPage = isAPage;
227
+ //# sourceMappingURL=hub-page-processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-page-processor.js","sourceRoot":"","sources":["../../src/hub-page-processor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,2DAS+B;AAC/B,iEAA0E;AAC1E,iDAQ0B;AAC1B,+CAKyB;AAEzB,qEAAgE;AAChE,iEAA4D;AAC5D,yEAAmE;AAEnE;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,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,IAAA,qBAAQ,EAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC;QAC7D,IAAA,yCAAuB,EAAC,kBAAkB,CAAC;KAC5C,CAAC;SACC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;QACxB,sFAAsF;QACtF,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,OA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,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;AAPD,0BAOC"}
@@ -0,0 +1,64 @@
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;
@@ -0,0 +1,231 @@
1
+ "use strict";
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.isASite = exports.postProcess = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
19
+ /**
20
+ * Manages the creation and deployment of Hub Site item types.
21
+ *
22
+ * @module hub-site-processor
23
+ */
24
+ const solution_common_1 = require("@esri/solution-common");
25
+ const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
26
+ const hub_sites_1 = require("@esri/hub-sites");
27
+ const hub_common_1 = require("@esri/hub-common");
28
+ const move_model_to_folder_1 = require("./helpers/move-model-to-folder");
29
+ const _post_process_site_1 = require("./helpers/_post-process-site");
30
+ const replace_item_ids_1 = require("./helpers/replace-item-ids");
31
+ /**
32
+ * Converts a Site item into a template.
33
+ *
34
+ * @param itemInfo Info about the item
35
+ * @param destAuthentication Credentials for requests to the destination organization
36
+ * @param srcAuthentication Credentials for requests to source items (placeholder--not used)
37
+ * @returns A promise that will resolve when the template has been created
38
+ */
39
+ function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication = null // eslint-disable-line @typescript-eslint/no-unused-vars
40
+ ) {
41
+ let created = 0;
42
+ let modified = 0;
43
+ let hubRo;
44
+ // get hubRequestOptions
45
+ return (0, solution_common_1.createHubRequestOptions)(destAuthentication)
46
+ .then(ro => {
47
+ hubRo = ro;
48
+ return (0, hub_sites_1.getSiteById)(itemInfo.id, hubRo);
49
+ })
50
+ .then(siteModel => {
51
+ // We need to save these properties in order to restore them after hub.js deletes them
52
+ created = siteModel.item.created;
53
+ modified = siteModel.item.modified;
54
+ return (0, hub_sites_1.convertSiteToTemplate)(siteModel, hubRo);
55
+ })
56
+ .then(tmpl => {
57
+ // add in some stuff Hub.js does not yet add
58
+ tmpl.item.created = created;
59
+ tmpl.item.modified = modified;
60
+ tmpl.item.typeKeywords = (0, hub_common_1.without)(tmpl.item.typeKeywords, "doNotDelete");
61
+ tmpl.groups = [];
62
+ tmpl.estimatedDeploymentCostFactor = 2;
63
+ tmpl.resources = [];
64
+ if (!(0, solution_common_1.getProp)(tmpl, "properties")) {
65
+ tmpl.properties = {};
66
+ }
67
+ // swap out dependency id's to {{<depid>.itemId}}
68
+ // so it will be re-interpolated
69
+ tmpl.dependencies = (0, solution_common_1.dedupe)(tmpl.dependencies);
70
+ tmpl = (0, replace_item_ids_1.replaceItemIds)(tmpl);
71
+ // and return it
72
+ return tmpl;
73
+ });
74
+ }
75
+ exports.convertItemToTemplate = convertItemToTemplate;
76
+ /**
77
+ * Handle deployment of Site item templates
78
+ *
79
+ * @export
80
+ * @param {IItemTemplate} template
81
+ * @param {*} templateDictionary
82
+ * @param {UserSession} destinationAuthentication
83
+ * @param {IItemProgressCallback} itemProgressCallback
84
+ * @returns {Promise<ICreateItemFromTemplateResponse>}
85
+ */
86
+ function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
87
+ // let the progress system know we've started...
88
+ const startStatus = itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Started, 0);
89
+ // if it returned false, just resolve out
90
+ if (!startStatus) {
91
+ return Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type));
92
+ }
93
+ // TODO: Reassess with resource unification
94
+ if (template.assets && template.resources) {
95
+ delete template.assets;
96
+ }
97
+ // ensure we have a solution object in the templateDictionary hash
98
+ if (!templateDictionary.solution) {
99
+ templateDictionary.solution = {};
100
+ }
101
+ // .title should always be set on the templateDictionary
102
+ templateDictionary.solution.title = templateDictionary.title;
103
+ // TODO: Determine if we need any transforms in this new env
104
+ const transforms = {};
105
+ // create an object to hold the created site through
106
+ // subsequent promise calls
107
+ let siteModel;
108
+ // Create the "siteModel" from the template. Does not save the site item yet
109
+ // Note: depending on licensing and user privs, will also create the team groups
110
+ // and initiative item.
111
+ let hubRo;
112
+ const thumbnail = template.item.thumbnail; // createSiteModelFromTemplate trashes thumbnail
113
+ return (0, solution_common_1.createHubRequestOptions)(destinationAuthentication, templateDictionary)
114
+ .then(ro => {
115
+ hubRo = ro;
116
+ return (0, hub_sites_1.createSiteModelFromTemplate)(template, templateDictionary, transforms, hubRo);
117
+ })
118
+ .then(interpolated => {
119
+ const options = {
120
+ assets: interpolated.assets || []
121
+ };
122
+ // Now create the item, register for oAuth, register domain etc
123
+ return (0, hub_sites_1.createSite)(interpolated, options, hubRo);
124
+ })
125
+ .then(site => {
126
+ // hold onto the site
127
+ siteModel = site;
128
+ // Move the site and initiative to the solution folder
129
+ // this is essentially fire and forget. We fail-safe the actual moveItem
130
+ // call since it's not critical to the outcome
131
+ return (0, move_model_to_folder_1.moveModelToFolder)(site, templateDictionary.folderId, destinationAuthentication);
132
+ })
133
+ .then(() => {
134
+ // Fix the thumbnail
135
+ const updateOptions = {
136
+ item: {
137
+ id: siteModel.item.id
138
+ },
139
+ params: {
140
+ // Pass thumbnail in via params because item property is serialized, which discards a blob
141
+ thumbnail
142
+ },
143
+ authentication: destinationAuthentication
144
+ };
145
+ return (0, arcgis_rest_portal_1.updateItem)(updateOptions);
146
+ })
147
+ .then(() => {
148
+ // Update the template dictionary
149
+ // TODO: This should be done in whatever recieves
150
+ // the outcome of this promise chain
151
+ templateDictionary[template.itemId] = {
152
+ itemId: siteModel.item.id
153
+ };
154
+ // call the progress callback, which also mutates templateDictionary
155
+ const finalStatus = itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor || 2, siteModel.item.id);
156
+ if (!finalStatus) {
157
+ // clean up the site we just created
158
+ const failSafeRemove = (0, hub_common_1.failSafe)(hub_sites_1.removeSite, { success: true });
159
+ return failSafeRemove(siteModel, hubRo).then(() => {
160
+ return Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type));
161
+ });
162
+ }
163
+ else {
164
+ // finally, return ICreateItemFromTemplateResponse
165
+ const response = {
166
+ item: {
167
+ ...template,
168
+ ...(0, solution_common_1.convertIModel)(siteModel)
169
+ },
170
+ id: siteModel.item.id,
171
+ type: template.type,
172
+ postProcess: true
173
+ };
174
+ response.item.itemId = siteModel.item.id;
175
+ return response;
176
+ }
177
+ })
178
+ .catch(ex => {
179
+ itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Failed, 0);
180
+ throw ex;
181
+ });
182
+ }
183
+ exports.createItemFromTemplate = createItemFromTemplate;
184
+ /**
185
+ * Deployer life-cycle hook allowing the Site Processor
186
+ * a chance to apply final processes to all the items that
187
+ * were created as part of the solution.
188
+ * Specifically this will:
189
+ * - share all items to the content team, and (if created)
190
+ * the core team (depends on user privs)
191
+ * - link all Page items that were created, to the Site
192
+ *
193
+ * @param model
194
+ * @param items
195
+ * @param authentication
196
+ * @param templateDictionary
197
+ */
198
+ function postProcess(id, type, itemInfos, template, templates, templateDictionary, authentication) {
199
+ let hubRo;
200
+ return (0, solution_common_1.createHubRequestOptions)(authentication, templateDictionary)
201
+ .then(ro => {
202
+ hubRo = ro;
203
+ // get the site model
204
+ return (0, hub_sites_1.getSiteById)(id, hubRo);
205
+ })
206
+ .then(siteModel => {
207
+ // Hub.js does not expect the same structures, so we delegat to a local fn
208
+ return (0, _post_process_site_1._postProcessSite)(siteModel, itemInfos, templateDictionary, hubRo);
209
+ })
210
+ .then(() => {
211
+ // resolve w/ a boolean
212
+ return Promise.resolve(true);
213
+ });
214
+ }
215
+ exports.postProcess = postProcess;
216
+ /**
217
+ * Check of an item type is a Site
218
+ * Hub Site Application is for ArcGIS Online
219
+ * Site Application is for ArcGIS Enterprise
220
+ *
221
+ * @param itemType
222
+ */
223
+ function isASite(itemType) {
224
+ let result = false;
225
+ if (itemType === "Hub Site Application" || itemType === "Site Application") {
226
+ result = true;
227
+ }
228
+ return result;
229
+ }
230
+ exports.isASite = isASite;
231
+ //# sourceMappingURL=hub-site-processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-site-processor.js","sourceRoot":"","sources":["../../src/hub-site-processor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,2DAW+B;AAC/B,iEAA0E;AAC1E,+CAMyB;AAEzB,iDAK0B;AAE1B,yEAAmE;AACnE,qEAAgE;AAChE,iEAA4D;AAE5D;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,QAAa,EACb,kBAA+B,EAC/B,oBAAiC,IAAI,CAAC,wDAAwD;;IAE9F,IAAI,OAAO,GAAW,CAAC,CAAC;IACxB,IAAI,QAAQ,GAAW,CAAC,CAAC;IAEzB,IAAI,KAA6B,CAAC;IAClC,wBAAwB;IACxB,OAAO,IAAA,yCAAuB,EAAC,kBAAkB,CAAC;SAC/C,IAAI,CAAC,EAAE,CAAC,EAAE;QACT,KAAK,GAAG,EAAE,CAAC;QACX,OAAO,IAAA,uBAAW,EAAC,QAAQ,CAAC,EAAE,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AC,CAAC,CAAC;AACP,CAAC;AAxBD,kCAwBC;AAED;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,QAAgB;IACtC,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,QAAQ,KAAK,sBAAsB,IAAI,QAAQ,KAAK,kBAAkB,EAAE;QAC1E,MAAM,GAAG,IAAI,CAAC;KACf;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAND,0BAMC"}
@@ -0,0 +1,23 @@
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 Site and Page item types.
18
+ *
19
+ * @module hubTypes
20
+ */
21
+ import * as HubPageProcessor from "./hub-page-processor";
22
+ import * as HubSiteProcessor from "./hub-site-processor";
23
+ export { HubPageProcessor, HubSiteProcessor };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /** @license
3
+ * Copyright 2018 Esri
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.HubSiteProcessor = exports.HubPageProcessor = void 0;
19
+ const tslib_1 = require("tslib");
20
+ /**
21
+ * Manages the creation and deployment of Hub Site and Page item types.
22
+ *
23
+ * @module hubTypes
24
+ */
25
+ const HubPageProcessor = tslib_1.__importStar(require("./hub-page-processor"));
26
+ exports.HubPageProcessor = HubPageProcessor;
27
+ const HubSiteProcessor = tslib_1.__importStar(require("./hub-site-processor"));
28
+ exports.HubSiteProcessor = HubSiteProcessor;
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,+EAAyD;AAGhD,4CAAgB;AAFzB,+EAAyD;AAE9B,4CAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solution-hub-types",
3
- "version": "5.2.3",
3
+ "version": "5.2.5",
4
4
  "description": "Manages the creation and deployment of Hub Site and Hub Page item types for @esri/solution.js.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -27,7 +27,7 @@
27
27
  "@esri/hub-initiatives": "^14.0.0",
28
28
  "@esri/hub-sites": "^14.2.2",
29
29
  "@esri/hub-teams": "^14.1.0",
30
- "@esri/solution-common": "^5.2.3",
30
+ "@esri/solution-common": "^5.2.5",
31
31
  "@types/jasmine": "^5.1.4",
32
32
  "fetch-mock": "^7.7.3",
33
33
  "jasmine": "^5.1.0",
@@ -88,5 +88,5 @@
88
88
  "esri",
89
89
  "ES6"
90
90
  ],
91
- "gitHead": "bcf0907f47cf8a2970f8da38f8e1e2a4ac7beccb"
91
+ "gitHead": "1a9ab55a2b6fbfb307b4afbb09c2502f5578de73"
92
92
  }