@esri/solution-hub-types 4.1.2-alpha.0 → 5.0.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 (35) hide show
  1. package/dist/cjs/helpers/_post-process-page.d.ts +17 -17
  2. package/dist/cjs/helpers/_post-process-page.js +32 -32
  3. package/dist/cjs/helpers/_post-process-page.js.map +1 -1
  4. package/dist/cjs/helpers/_post-process-site.d.ts +29 -29
  5. package/dist/cjs/helpers/_post-process-site.js +50 -50
  6. package/dist/cjs/helpers/_update-site-pages.d.ts +24 -24
  7. package/dist/cjs/helpers/_update-site-pages.js +42 -42
  8. package/dist/cjs/helpers/move-model-to-folder.d.ts +26 -26
  9. package/dist/cjs/helpers/move-model-to-folder.js +49 -49
  10. package/dist/cjs/helpers/replace-item-ids.d.ts +17 -17
  11. package/dist/cjs/helpers/replace-item-ids.js +36 -36
  12. package/dist/cjs/hub-page-processor.d.ts +63 -63
  13. package/dist/cjs/hub-page-processor.js +227 -227
  14. package/dist/cjs/hub-site-processor.d.ts +65 -65
  15. package/dist/cjs/hub-site-processor.js +231 -231
  16. package/dist/cjs/index.d.ts +23 -23
  17. package/dist/cjs/index.js +28 -28
  18. package/dist/esm/helpers/_post-process-page.d.ts +17 -17
  19. package/dist/esm/helpers/_post-process-page.js +28 -28
  20. package/dist/esm/helpers/_post-process-page.js.map +1 -1
  21. package/dist/esm/helpers/_post-process-site.d.ts +29 -29
  22. package/dist/esm/helpers/_post-process-site.js +46 -46
  23. package/dist/esm/helpers/_update-site-pages.d.ts +24 -24
  24. package/dist/esm/helpers/_update-site-pages.js +38 -38
  25. package/dist/esm/helpers/move-model-to-folder.d.ts +26 -26
  26. package/dist/esm/helpers/move-model-to-folder.js +45 -45
  27. package/dist/esm/helpers/replace-item-ids.d.ts +17 -17
  28. package/dist/esm/helpers/replace-item-ids.js +32 -32
  29. package/dist/esm/hub-page-processor.d.ts +63 -63
  30. package/dist/esm/hub-page-processor.js +220 -220
  31. package/dist/esm/hub-site-processor.d.ts +65 -65
  32. package/dist/esm/hub-site-processor.js +224 -224
  33. package/dist/esm/index.d.ts +23 -23
  34. package/dist/esm/index.js +24 -24
  35. package/package.json +3 -3
package/dist/cjs/index.js CHANGED
@@ -1,29 +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;
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
29
  //# sourceMappingURL=index.js.map
@@ -1,17 +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>;
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>;
@@ -1,29 +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 { interpolate } from "@esri/hub-common";
17
- import { updatePage } from "@esri/hub-sites";
18
- //???
19
- export function _postProcessPage(pageModel, itemInfos, templateDictionary, hubRequestOptions) {
20
- // re-interpolate the siteModel using the itemInfos; no patches supplied
21
- pageModel = interpolate(pageModel, templateDictionary, {});
22
- return updatePage(pageModel, {
23
- ...hubRequestOptions,
24
- allowList: []
25
- }).then(() => {
26
- return true;
27
- });
28
- }
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 { interpolate } from "@esri/hub-common";
17
+ import { updatePage } from "@esri/hub-sites";
18
+ //TODO: function doc
19
+ export function _postProcessPage(pageModel, itemInfos, templateDictionary, hubRequestOptions) {
20
+ // re-interpolate the siteModel using the itemInfos; no patches supplied
21
+ pageModel = interpolate(pageModel, templateDictionary, {});
22
+ return updatePage(pageModel, {
23
+ ...hubRequestOptions,
24
+ allowList: []
25
+ }).then(() => {
26
+ return true;
27
+ });
28
+ }
29
29
  //# sourceMappingURL=_post-process-page.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_post-process-page.js","sourceRoot":"","sources":["../../../src/helpers/_post-process-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAkC,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,KAAK;AACL,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,SAAgB,EAChB,kBAAuB,EACvB,iBAAyC;IAEzC,wEAAwE;IACxE,SAAS,GAAG,WAAW,CAAC,SAAS,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC3D,OAAO,UAAU,CAAC,SAAS,EAAE;QAC3B,GAAG,iBAAiB;QACpB,SAAS,EAAE,EAAE;KACd,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QACX,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"_post-process-page.js","sourceRoot":"","sources":["../../../src/helpers/_post-process-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAkC,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,oBAAoB;AACpB,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,SAAgB,EAChB,kBAAuB,EACvB,iBAAyC;IAEzC,wEAAwE;IACxE,SAAS,GAAG,WAAW,CAAC,SAAS,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC3D,OAAO,UAAU,CAAC,SAAS,EAAE;QAC3B,GAAG,iBAAiB;QACpB,SAAS,EAAE,EAAE;KACd,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QACX,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,29 +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>;
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,47 +1,47 @@
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
- secondPassPromises = secondPassPromises.concat(shareItemsToSiteGroups(siteModel, pseudoModels, hubRequestOptions));
29
- // we can't use that same trick w/ the page sharing
30
- // because we really need the models themselves
31
- // so we delegate to a local function
32
- secondPassPromises = secondPassPromises.concat(_updateSitePages(siteModel, infosWithoutSite, hubRequestOptions));
33
- // need to get all the child items and add into site.item.properties.children
34
- const childItemIds = infosWithoutSite.map(i => i.id);
35
- siteModel.item.properties.children = childItemIds;
36
- // re-interpolate the siteModel using the itemInfos
37
- siteModel = interpolateSite(siteModel, templateDictionary, {});
38
- // and update the model
39
- secondPassPromises.push(updateSite(siteModel, {
40
- ...hubRequestOptions,
41
- allowList: null
42
- }));
43
- return Promise.all(secondPassPromises).then(() => {
44
- return true;
45
- });
46
- }
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
+ secondPassPromises = secondPassPromises.concat(shareItemsToSiteGroups(siteModel, pseudoModels, hubRequestOptions));
29
+ // we can't use that same trick w/ the page sharing
30
+ // because we really need the models themselves
31
+ // so we delegate to a local function
32
+ secondPassPromises = secondPassPromises.concat(_updateSitePages(siteModel, infosWithoutSite, hubRequestOptions));
33
+ // need to get all the child items and add into site.item.properties.children
34
+ const childItemIds = infosWithoutSite.map(i => i.id);
35
+ siteModel.item.properties.children = childItemIds;
36
+ // re-interpolate the siteModel using the itemInfos
37
+ siteModel = interpolateSite(siteModel, templateDictionary, {});
38
+ // and update the model
39
+ secondPassPromises.push(updateSite(siteModel, {
40
+ ...hubRequestOptions,
41
+ allowList: null
42
+ }));
43
+ return Promise.all(secondPassPromises).then(() => {
44
+ return true;
45
+ });
46
+ }
47
47
  //# sourceMappingURL=_post-process-site.js.map
@@ -1,24 +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>;
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 +1,39 @@
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
- }
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
39
  //# sourceMappingURL=_update-site-pages.js.map
@@ -1,26 +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>;
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 +1,46 @@
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/arcgis-rest-portal";
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
- }
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/arcgis-rest-portal";
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
46
  //# sourceMappingURL=move-model-to-folder.js.map
@@ -1,17 +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;
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;