@esri/solution-hub-types 6.0.4-alpha.0 → 6.1.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.
- package/package.json +7 -7
- package/dist/cjs/helpers/_post-process-page.d.ts +0 -17
- package/dist/cjs/helpers/_post-process-page.js +0 -33
- package/dist/cjs/helpers/_post-process-page.js.map +0 -1
- package/dist/cjs/helpers/_post-process-site.d.ts +0 -29
- package/dist/cjs/helpers/_post-process-site.js +0 -53
- package/dist/cjs/helpers/_post-process-site.js.map +0 -1
- package/dist/cjs/helpers/_update-site-pages.d.ts +0 -24
- package/dist/cjs/helpers/_update-site-pages.js +0 -43
- package/dist/cjs/helpers/_update-site-pages.js.map +0 -1
- package/dist/cjs/helpers/move-model-to-folder.d.ts +0 -26
- package/dist/cjs/helpers/move-model-to-folder.js +0 -50
- package/dist/cjs/helpers/move-model-to-folder.js.map +0 -1
- package/dist/cjs/helpers/replace-item-ids.d.ts +0 -17
- package/dist/cjs/helpers/replace-item-ids.js +0 -37
- package/dist/cjs/helpers/replace-item-ids.js.map +0 -1
- package/dist/cjs/hub-page-processor.d.ts +0 -62
- package/dist/cjs/hub-page-processor.js +0 -225
- package/dist/cjs/hub-page-processor.js.map +0 -1
- package/dist/cjs/hub-site-processor.d.ts +0 -64
- package/dist/cjs/hub-site-processor.js +0 -235
- package/dist/cjs/hub-site-processor.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -23
- package/dist/cjs/index.js +0 -29
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/helpers/_post-process-page.d.ts +0 -17
- package/dist/esm/helpers/_post-process-page.js +0 -29
- package/dist/esm/helpers/_post-process-page.js.map +0 -1
- package/dist/esm/helpers/_post-process-site.d.ts +0 -29
- package/dist/esm/helpers/_post-process-site.js +0 -49
- package/dist/esm/helpers/_post-process-site.js.map +0 -1
- package/dist/esm/helpers/_update-site-pages.d.ts +0 -24
- package/dist/esm/helpers/_update-site-pages.js +0 -39
- package/dist/esm/helpers/_update-site-pages.js.map +0 -1
- package/dist/esm/helpers/move-model-to-folder.d.ts +0 -26
- package/dist/esm/helpers/move-model-to-folder.js +0 -46
- package/dist/esm/helpers/move-model-to-folder.js.map +0 -1
- package/dist/esm/helpers/replace-item-ids.d.ts +0 -17
- package/dist/esm/helpers/replace-item-ids.js +0 -33
- package/dist/esm/helpers/replace-item-ids.js.map +0 -1
- package/dist/esm/hub-page-processor.d.ts +0 -62
- package/dist/esm/hub-page-processor.js +0 -218
- package/dist/esm/hub-page-processor.js.map +0 -1
- package/dist/esm/hub-site-processor.d.ts +0 -64
- package/dist/esm/hub-site-processor.js +0 -228
- package/dist/esm/hub-site-processor.js.map +0 -1
- package/dist/esm/index.d.ts +0 -23
- package/dist/esm/index.js +0 -25
- package/dist/esm/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esri/solution-hub-types",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0-alpha.0",
|
|
4
4
|
"description": "Manages the creation and deployment of Hub Site and Hub Page item types for @esri/solution.js.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"npm-check-updates": "^17.1.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@esri/hub-common": "
|
|
26
|
-
"@esri/hub-initiatives": "
|
|
27
|
-
"@esri/hub-sites": "
|
|
28
|
-
"@esri/hub-teams": "
|
|
29
|
-
"@esri/solution-common": "^6.0
|
|
25
|
+
"@esri/hub-common": "^17.0.2",
|
|
26
|
+
"@esri/hub-initiatives": "^17.0.1",
|
|
27
|
+
"@esri/hub-sites": "^18.0.1",
|
|
28
|
+
"@esri/hub-teams": "^17.0.1",
|
|
29
|
+
"@esri/solution-common": "^6.1.0-alpha.0",
|
|
30
30
|
"tslib": "1.14.1"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"esri",
|
|
81
81
|
"ES6"
|
|
82
82
|
],
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "19cbc20f4da03baa4676b3fad82abcea533432c3"
|
|
84
84
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { IModel, IHubUserRequestOptions } from "@esri/hub-common";
|
|
17
|
-
export declare function _postProcessPage(pageModel: IModel, itemInfos: any[], templateDictionary: any, hubRequestOptions: IHubUserRequestOptions): Promise<boolean>;
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { IModel, IHubUserRequestOptions } from "@esri/hub-common";
|
|
17
|
-
/**
|
|
18
|
-
* Post Process a Site
|
|
19
|
-
* - share all items to the Hub teams created as part of the site
|
|
20
|
-
* - link any created page to the site item
|
|
21
|
-
* - re-interpolate any remaining item ids that were not direct deps of the site
|
|
22
|
-
*
|
|
23
|
-
* @param siteModel
|
|
24
|
-
* @param itemInfos
|
|
25
|
-
* @param templateDictionary
|
|
26
|
-
* @param hubRequestOptions
|
|
27
|
-
* @private
|
|
28
|
-
*/
|
|
29
|
-
export declare function _postProcessSite(siteModel: IModel, itemInfos: any[], templateDictionary: any, hubRequestOptions: IHubUserRequestOptions): Promise<boolean>;
|
|
@@ -1,53 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { IModel, IHubUserRequestOptions } from "@esri/hub-common";
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param siteModel
|
|
20
|
-
* @param itemInfos
|
|
21
|
-
* @param hubRequestOptions
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
export declare function _updateSitePages(siteModel: IModel, itemInfos: any[], hubRequestOptions: IHubUserRequestOptions): Promise<any>;
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2018 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { IModel } from "@esri/hub-common";
|
|
17
|
-
import { UserSession } from "@esri/solution-common";
|
|
18
|
-
/**
|
|
19
|
-
* Move the created site item, and optionally the Initiative, into
|
|
20
|
-
* the solution folder
|
|
21
|
-
*
|
|
22
|
-
* @param siteModel
|
|
23
|
-
* @param folderId
|
|
24
|
-
* @param authentication
|
|
25
|
-
*/
|
|
26
|
-
export declare function moveModelToFolder(siteModel: IModel, folderId: string, authentication: UserSession): Promise<any>;
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"move-model-to-folder.js","sourceRoot":"","sources":["../../../src/helpers/move-model-to-folder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2020 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { IModelTemplate } from "@esri/hub-common";
|
|
17
|
-
export declare function replaceItemIds(template: IModelTemplate): IModelTemplate;
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/** @license
|
|
2
|
-
* Copyright 2018 Esri
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Manages the creation and deployment of Hub Page item types.
|
|
18
|
-
*
|
|
19
|
-
* @module hub-page-processor
|
|
20
|
-
*/
|
|
21
|
-
import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse, UserSession } from "@esri/solution-common";
|
|
22
|
-
/**
|
|
23
|
-
* Converts a Hub Page item into a template.
|
|
24
|
-
*
|
|
25
|
-
* @param itemInfo Info about the item
|
|
26
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
27
|
-
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
28
|
-
* @returns A promise that will resolve when the template has been created
|
|
29
|
-
*/
|
|
30
|
-
export declare function convertItemToTemplate(itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
31
|
-
/**
|
|
32
|
-
* Handle deployment of Page item templates
|
|
33
|
-
*
|
|
34
|
-
* @export
|
|
35
|
-
* @param {IItemTemplate} template
|
|
36
|
-
* @param {*} templateDictionary
|
|
37
|
-
* @param {UserSession} destinationAuthentication
|
|
38
|
-
* @param {IItemProgressCallback} itemProgressCallback
|
|
39
|
-
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
40
|
-
*/
|
|
41
|
-
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
42
|
-
/**
|
|
43
|
-
* Post-Process a Page
|
|
44
|
-
* Re-interpolate the page item + data w/ the full template dictionary hash
|
|
45
|
-
*
|
|
46
|
-
* @param id
|
|
47
|
-
* @param type
|
|
48
|
-
* @param itemInfos
|
|
49
|
-
* @param template
|
|
50
|
-
* @param templates
|
|
51
|
-
* @param templateDictionary
|
|
52
|
-
* @param authentication
|
|
53
|
-
*/
|
|
54
|
-
export declare function postProcess(id: string, type: string, itemInfos: any[], template: any, templates: IItemTemplate[], templateDictionary: any, authentication: UserSession): Promise<boolean>;
|
|
55
|
-
/**
|
|
56
|
-
* Check of an item type is a Page
|
|
57
|
-
* Hub Page is for ArcGIS Online
|
|
58
|
-
* Site Page is for ArcGIS Enterprise
|
|
59
|
-
*
|
|
60
|
-
* @param itemType
|
|
61
|
-
*/
|
|
62
|
-
export declare function isAPage(itemType: string): boolean;
|