@esri/solution-hub-types 6.1.0-alpha.0 → 6.2.0-alpha.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.
Files changed (49) hide show
  1. package/dist/cjs/helpers/_post-process-page.d.ts +17 -0
  2. package/dist/cjs/helpers/_post-process-page.js +33 -0
  3. package/dist/cjs/helpers/_post-process-page.js.map +1 -0
  4. package/dist/cjs/helpers/_post-process-site.d.ts +29 -0
  5. package/dist/cjs/helpers/_post-process-site.js +53 -0
  6. package/dist/cjs/helpers/_post-process-site.js.map +1 -0
  7. package/dist/cjs/helpers/_update-site-pages.d.ts +24 -0
  8. package/dist/cjs/helpers/_update-site-pages.js +43 -0
  9. package/dist/cjs/helpers/_update-site-pages.js.map +1 -0
  10. package/dist/cjs/helpers/move-model-to-folder.d.ts +26 -0
  11. package/dist/cjs/helpers/move-model-to-folder.js +50 -0
  12. package/dist/cjs/helpers/move-model-to-folder.js.map +1 -0
  13. package/dist/cjs/helpers/replace-item-ids.d.ts +17 -0
  14. package/dist/cjs/helpers/replace-item-ids.js +37 -0
  15. package/dist/cjs/helpers/replace-item-ids.js.map +1 -0
  16. package/dist/cjs/hub-page-processor.d.ts +62 -0
  17. package/dist/cjs/hub-page-processor.js +225 -0
  18. package/dist/cjs/hub-page-processor.js.map +1 -0
  19. package/dist/cjs/hub-site-processor.d.ts +64 -0
  20. package/dist/cjs/hub-site-processor.js +235 -0
  21. package/dist/cjs/hub-site-processor.js.map +1 -0
  22. package/dist/cjs/index.d.ts +23 -0
  23. package/dist/cjs/index.js +29 -0
  24. package/dist/cjs/index.js.map +1 -0
  25. package/dist/esm/helpers/_post-process-page.d.ts +17 -0
  26. package/dist/esm/helpers/_post-process-page.js +29 -0
  27. package/dist/esm/helpers/_post-process-page.js.map +1 -0
  28. package/dist/esm/helpers/_post-process-site.d.ts +29 -0
  29. package/dist/esm/helpers/_post-process-site.js +49 -0
  30. package/dist/esm/helpers/_post-process-site.js.map +1 -0
  31. package/dist/esm/helpers/_update-site-pages.d.ts +24 -0
  32. package/dist/esm/helpers/_update-site-pages.js +39 -0
  33. package/dist/esm/helpers/_update-site-pages.js.map +1 -0
  34. package/dist/esm/helpers/move-model-to-folder.d.ts +26 -0
  35. package/dist/esm/helpers/move-model-to-folder.js +46 -0
  36. package/dist/esm/helpers/move-model-to-folder.js.map +1 -0
  37. package/dist/esm/helpers/replace-item-ids.d.ts +17 -0
  38. package/dist/esm/helpers/replace-item-ids.js +33 -0
  39. package/dist/esm/helpers/replace-item-ids.js.map +1 -0
  40. package/dist/esm/hub-page-processor.d.ts +62 -0
  41. package/dist/esm/hub-page-processor.js +218 -0
  42. package/dist/esm/hub-page-processor.js.map +1 -0
  43. package/dist/esm/hub-site-processor.d.ts +64 -0
  44. package/dist/esm/hub-site-processor.js +228 -0
  45. package/dist/esm/hub-site-processor.js.map +1 -0
  46. package/dist/esm/index.d.ts +23 -0
  47. package/dist/esm/index.js +25 -0
  48. package/dist/esm/index.js.map +1 -0
  49. package/package.json +3 -3
@@ -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: undefined,
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,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,IAAA,kCAAsB,EAAC,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,IAAA,qCAAgB,EAAC,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,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,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;AAjDD,4CAiDC"}
@@ -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,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,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 solution_common_1 = require("@esri/solution-common");
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)(solution_common_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;AAC7D,2DAA8D;AAE9D;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,SAAiB,EAAE,QAAgB,EAAE,cAA2B;IAChG,2DAA2D;IAC3D,MAAM,YAAY,GAAG,IAAA,qBAAQ,EAAC,0BAAQ,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;AAvBD,8CAuBC"}
@@ -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,iDAAkF;AAElF,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,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,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,225 @@
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 hub_common_1 = require("@esri/hub-common");
26
+ const hub_sites_1 = require("@esri/hub-sites");
27
+ const _post_process_page_1 = require("./helpers/_post-process-page");
28
+ const replace_item_ids_1 = require("./helpers/replace-item-ids");
29
+ const move_model_to_folder_1 = require("./helpers/move-model-to-folder");
30
+ /**
31
+ * Converts a Hub Page item into a template.
32
+ *
33
+ * @param itemInfo Info about the item
34
+ * @param destAuthentication Credentials for requests to the destination organization
35
+ * @param srcAuthentication Credentials for requests to source items (placeholder--not used)
36
+ * @returns A promise that will resolve when the template has been created
37
+ */
38
+ function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication = null) {
39
+ let created = 0;
40
+ let modified = 0;
41
+ // get the page model and hubRequestOptions
42
+ return Promise.all([
43
+ (0, hub_common_1.getModel)(itemInfo.id, { authentication: destAuthentication }),
44
+ (0, solution_common_1.createHubRequestOptions)(destAuthentication),
45
+ ])
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;
50
+ return (0, hub_sites_1.convertPageToTemplate)(pageModel, ro);
51
+ })
52
+ .then((tmpl) => {
53
+ // add in some stuff Hub.js does not yet add
54
+ tmpl.item.created = created;
55
+ tmpl.item.modified = modified;
56
+ tmpl.item.typeKeywords = (0, hub_common_1.without)(tmpl.item.typeKeywords, "doNotDelete");
57
+ tmpl.groups = [];
58
+ tmpl.estimatedDeploymentCostFactor = 2;
59
+ tmpl.resources = [];
60
+ if (!(0, hub_common_1.getProp)(tmpl, "properties")) {
61
+ tmpl.properties = {};
62
+ }
63
+ // swap out dependency id's to {{<depid>.itemId}}
64
+ // so it will be re-interpolated
65
+ tmpl = (0, replace_item_ids_1.replaceItemIds)(tmpl);
66
+ // and return it
67
+ return tmpl;
68
+ });
69
+ }
70
+ exports.convertItemToTemplate = convertItemToTemplate;
71
+ /**
72
+ * Handle deployment of Page item templates
73
+ *
74
+ * @export
75
+ * @param {IItemTemplate} template
76
+ * @param {*} templateDictionary
77
+ * @param {UserSession} destinationAuthentication
78
+ * @param {IItemProgressCallback} itemProgressCallback
79
+ * @returns {Promise<ICreateItemFromTemplateResponse>}
80
+ */
81
+ function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
82
+ // let the progress system know we've started...
83
+ const startStatus = itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Started, 0);
84
+ // and if it returned false, just resolve out
85
+ if (!startStatus) {
86
+ return Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type));
87
+ }
88
+ // TODO: Reassess with resource unification
89
+ if (template.assets && template.resources) {
90
+ delete template.assets;
91
+ }
92
+ // solutionItemExtent is in geographic, but it's a string, and we want/need a bbox
93
+ // and Hub templates expect it in organization.defaultExtentBBox
94
+ if (templateDictionary.solutionItemExtent) {
95
+ const parts = templateDictionary.solutionItemExtent.split(",");
96
+ templateDictionary.organization.defaultExtentBBox = [
97
+ [parts[0], parts[1]],
98
+ [parts[2], parts[3]],
99
+ ];
100
+ }
101
+ // TODO: Determine if we need any transforms in this new env
102
+ const transforms = {};
103
+ // create an object to hold the created site through
104
+ // subsequent promise calls
105
+ let pageModel;
106
+ let hubRo;
107
+ const thumbnail = template.item.thumbnail; // createPageModelFromTemplate trashes thumbnail
108
+ return (0, solution_common_1.createHubRequestOptions)(destinationAuthentication, templateDictionary)
109
+ .then((ro) => {
110
+ hubRo = ro;
111
+ return (0, hub_sites_1.createPageModelFromTemplate)(template, templateDictionary, transforms, hubRo);
112
+ })
113
+ .then((interpolated) => {
114
+ // --------------------------------------------
115
+ // TODO: Update hub.js to take an IModel in createPage
116
+ // then remove this silliness
117
+ const modelTmpl = interpolated;
118
+ const options = {
119
+ assets: modelTmpl.assets || [],
120
+ };
121
+ // --------------------------------------------
122
+ return (0, hub_sites_1.createPage)(modelTmpl, options, hubRo);
123
+ })
124
+ .then((page) => {
125
+ pageModel = page;
126
+ // Move the site and initiative to the solution folder
127
+ // this is essentially fire and forget. We fail-safe the actual moveItem
128
+ // call since it's not critical to the outcome
129
+ return (0, move_model_to_folder_1.moveModelToFolder)(page, templateDictionary.folderId, destinationAuthentication);
130
+ })
131
+ .then(() => {
132
+ // Fix the thumbnail
133
+ const updateOptions = {
134
+ item: {
135
+ id: pageModel.item.id,
136
+ },
137
+ params: {
138
+ // Pass thumbnail in via params because item property is serialized, which discards a blob
139
+ thumbnail,
140
+ },
141
+ authentication: destinationAuthentication,
142
+ };
143
+ return (0, solution_common_1.restUpdateItem)(updateOptions);
144
+ })
145
+ .then(() => {
146
+ // Update the template dictionary
147
+ // TODO: This should be done in whatever recieves
148
+ // the outcome of this promise chain
149
+ templateDictionary[template.itemId] = {
150
+ itemId: pageModel.item.id,
151
+ };
152
+ // call the progress callback, which also mutates templateDictionary
153
+ const finalStatus = itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor || 2, pageModel.item.id);
154
+ if (!finalStatus) {
155
+ // clean up the site we just created
156
+ const failSafeRemove = (0, hub_common_1.failSafe)(hub_sites_1.removePage, { success: true });
157
+ return failSafeRemove(pageModel, hubRo).then(() => {
158
+ return Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type));
159
+ });
160
+ }
161
+ else {
162
+ // finally, return ICreateItemFromTemplateResponse
163
+ const response = {
164
+ item: {
165
+ ...template,
166
+ ...(0, solution_common_1.convertIModel)(pageModel),
167
+ },
168
+ id: pageModel.item.id,
169
+ type: template.type,
170
+ postProcess: true,
171
+ };
172
+ response.item.itemId = pageModel.item.id;
173
+ return response;
174
+ }
175
+ })
176
+ .catch((ex) => {
177
+ itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Failed, 0);
178
+ throw ex;
179
+ });
180
+ }
181
+ exports.createItemFromTemplate = createItemFromTemplate;
182
+ /**
183
+ * Post-Process a Page
184
+ * Re-interpolate the page item + data w/ the full template dictionary hash
185
+ *
186
+ * @param id
187
+ * @param type
188
+ * @param itemInfos
189
+ * @param template
190
+ * @param templates
191
+ * @param templateDictionary
192
+ * @param authentication
193
+ */
194
+ function postProcess(id, type, itemInfos, template, templates, templateDictionary, authentication) {
195
+ // create the requestOptions
196
+ let hubRo;
197
+ // get hubRequestOptions
198
+ return (0, solution_common_1.createHubRequestOptions)(authentication)
199
+ .then((ro) => {
200
+ hubRo = ro;
201
+ // get the site model
202
+ return (0, hub_common_1.getModel)(id, { authentication });
203
+ })
204
+ .then((pageModel) => {
205
+ // post process the page
206
+ return (0, _post_process_page_1._postProcessPage)(pageModel, itemInfos, templateDictionary, hubRo);
207
+ });
208
+ }
209
+ exports.postProcess = postProcess;
210
+ /**
211
+ * Check of an item type is a Page
212
+ * Hub Page is for ArcGIS Online
213
+ * Site Page is for ArcGIS Enterprise
214
+ *
215
+ * @param itemType
216
+ */
217
+ function isAPage(itemType) {
218
+ let result = false;
219
+ if (itemType === "Hub Page" || itemType === "Site Page") {
220
+ result = true;
221
+ }
222
+ return result;
223
+ }
224
+ exports.isAPage = isAPage;
225
+ //# 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,2DAW+B;AAC/B,iDAAwH;AACxH,+CAA6G;AAE7G,qEAAgE;AAChE,iEAA4D;AAC5D,yEAAmE;AAEnE;;;;;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