@esri/solution-hub-types 4.1.2 → 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.
- package/dist/cjs/helpers/_post-process-page.d.ts +17 -17
- package/dist/cjs/helpers/_post-process-page.js +32 -32
- package/dist/cjs/helpers/_post-process-page.js.map +1 -1
- package/dist/cjs/helpers/_post-process-site.d.ts +29 -29
- package/dist/cjs/helpers/_post-process-site.js +50 -50
- package/dist/cjs/helpers/_update-site-pages.d.ts +24 -24
- package/dist/cjs/helpers/_update-site-pages.js +42 -42
- package/dist/cjs/helpers/move-model-to-folder.d.ts +26 -26
- package/dist/cjs/helpers/move-model-to-folder.js +49 -49
- package/dist/cjs/helpers/replace-item-ids.d.ts +17 -17
- package/dist/cjs/helpers/replace-item-ids.js +36 -36
- package/dist/cjs/hub-page-processor.d.ts +63 -63
- package/dist/cjs/hub-page-processor.js +227 -227
- package/dist/cjs/hub-site-processor.d.ts +65 -65
- package/dist/cjs/hub-site-processor.js +231 -231
- package/dist/cjs/index.d.ts +23 -23
- package/dist/cjs/index.js +28 -28
- package/dist/esm/helpers/_post-process-page.d.ts +17 -17
- package/dist/esm/helpers/_post-process-page.js +28 -28
- package/dist/esm/helpers/_post-process-page.js.map +1 -1
- package/dist/esm/helpers/_post-process-site.d.ts +29 -29
- package/dist/esm/helpers/_post-process-site.js +46 -46
- package/dist/esm/helpers/_update-site-pages.d.ts +24 -24
- package/dist/esm/helpers/_update-site-pages.js +38 -38
- package/dist/esm/helpers/move-model-to-folder.d.ts +26 -26
- package/dist/esm/helpers/move-model-to-folder.js +45 -45
- package/dist/esm/helpers/replace-item-ids.d.ts +17 -17
- package/dist/esm/helpers/replace-item-ids.js +32 -32
- package/dist/esm/hub-page-processor.d.ts +63 -63
- package/dist/esm/hub-page-processor.js +220 -220
- package/dist/esm/hub-site-processor.d.ts +65 -65
- package/dist/esm/hub-site-processor.js +224 -224
- package/dist/esm/index.d.ts +23 -23
- package/dist/esm/index.js +24 -24
- package/package.json +3 -3
|
@@ -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,33 +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
|
-
|
|
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;
|
|
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
33
|
//# 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,iDAA+E;AAC/E,+CAA6C;AAE7C,
|
|
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"}
|
|
@@ -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,51 +1,51 @@
|
|
|
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
|
-
secondPassPromises = secondPassPromises.concat((0, hub_sites_1.shareItemsToSiteGroups)(siteModel, pseudoModels, hubRequestOptions));
|
|
32
|
-
// we can't use that same trick w/ the page sharing
|
|
33
|
-
// because we really need the models themselves
|
|
34
|
-
// so we delegate to a local function
|
|
35
|
-
secondPassPromises = secondPassPromises.concat((0, _update_site_pages_1._updateSitePages)(siteModel, infosWithoutSite, hubRequestOptions));
|
|
36
|
-
// need to get all the child items and add into site.item.properties.children
|
|
37
|
-
const childItemIds = infosWithoutSite.map(i => i.id);
|
|
38
|
-
siteModel.item.properties.children = childItemIds;
|
|
39
|
-
// re-interpolate the siteModel using the itemInfos
|
|
40
|
-
siteModel = (0, hub_sites_1.interpolateSite)(siteModel, templateDictionary, {});
|
|
41
|
-
// and update the model
|
|
42
|
-
secondPassPromises.push((0, hub_sites_1.updateSite)(siteModel, {
|
|
43
|
-
...hubRequestOptions,
|
|
44
|
-
allowList: null
|
|
45
|
-
}));
|
|
46
|
-
return Promise.all(secondPassPromises).then(() => {
|
|
47
|
-
return true;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
exports._postProcessSite = _postProcessSite;
|
|
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
|
+
secondPassPromises = secondPassPromises.concat((0, hub_sites_1.shareItemsToSiteGroups)(siteModel, pseudoModels, hubRequestOptions));
|
|
32
|
+
// we can't use that same trick w/ the page sharing
|
|
33
|
+
// because we really need the models themselves
|
|
34
|
+
// so we delegate to a local function
|
|
35
|
+
secondPassPromises = secondPassPromises.concat((0, _update_site_pages_1._updateSitePages)(siteModel, infosWithoutSite, hubRequestOptions));
|
|
36
|
+
// need to get all the child items and add into site.item.properties.children
|
|
37
|
+
const childItemIds = infosWithoutSite.map(i => i.id);
|
|
38
|
+
siteModel.item.properties.children = childItemIds;
|
|
39
|
+
// re-interpolate the siteModel using the itemInfos
|
|
40
|
+
siteModel = (0, hub_sites_1.interpolateSite)(siteModel, templateDictionary, {});
|
|
41
|
+
// and update the model
|
|
42
|
+
secondPassPromises.push((0, hub_sites_1.updateSite)(siteModel, {
|
|
43
|
+
...hubRequestOptions,
|
|
44
|
+
allowList: null
|
|
45
|
+
}));
|
|
46
|
+
return Promise.all(secondPassPromises).then(() => {
|
|
47
|
+
return true;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
exports._postProcessSite = _postProcessSite;
|
|
51
51
|
//# 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,43 +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;
|
|
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
43
|
//# 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,50 +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;
|
|
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
50
|
//# 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;
|