@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
|
@@ -1,225 +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.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
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,QAAa,EACb,kBAA+B,EAC/B,oBAAiC,IAAI;I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C,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE;QACX,KAAK,GAAG,EAAE,CAAC;QACX,qBAAqB;QACrB,OAAO,IAAA,qBAAQ,EAAC,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;QAClB,wBAAwB;QACxB,OAAO,IAAA,qCAAgB,EAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACP,CAAC;AAtBD,kCAsBC;AAED;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,QAAgB;IACtC,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,QAAQ,KAAK,UAAU,IAAI,QAAQ,KAAK,WAAW,EAAE;QACvD,MAAM,GAAG,IAAI,CAAC;KACf;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAPD,0BAOC"}
|
|
@@ -1,64 +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
|
-
/**
|
|
17
|
-
* Manages the creation and deployment of Hub Site item types.
|
|
18
|
-
*
|
|
19
|
-
* @module hub-site-processor
|
|
20
|
-
*/
|
|
21
|
-
import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse, UserSession } from "@esri/solution-common";
|
|
22
|
-
/**
|
|
23
|
-
* Converts a Site item into a template.
|
|
24
|
-
*
|
|
25
|
-
* @param itemInfo Info about the item
|
|
26
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
27
|
-
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
28
|
-
* @returns A promise that will resolve when the template has been created
|
|
29
|
-
*/
|
|
30
|
-
export declare function convertItemToTemplate(itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
31
|
-
/**
|
|
32
|
-
* Handle deployment of Site item templates
|
|
33
|
-
*
|
|
34
|
-
* @export
|
|
35
|
-
* @param {IItemTemplate} template
|
|
36
|
-
* @param {*} templateDictionary
|
|
37
|
-
* @param {UserSession} destinationAuthentication
|
|
38
|
-
* @param {IItemProgressCallback} itemProgressCallback
|
|
39
|
-
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
40
|
-
*/
|
|
41
|
-
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
42
|
-
/**
|
|
43
|
-
* Deployer life-cycle hook allowing the Site Processor
|
|
44
|
-
* a chance to apply final processes to all the items that
|
|
45
|
-
* were created as part of the solution.
|
|
46
|
-
* Specifically this will:
|
|
47
|
-
* - share all items to the content team, and (if created)
|
|
48
|
-
* the core team (depends on user privs)
|
|
49
|
-
* - link all Page items that were created, to the Site
|
|
50
|
-
*
|
|
51
|
-
* @param model
|
|
52
|
-
* @param items
|
|
53
|
-
* @param authentication
|
|
54
|
-
* @param templateDictionary
|
|
55
|
-
*/
|
|
56
|
-
export declare function postProcess(id: string, type: string, itemInfos: any[], template: any, templates: IItemTemplate[], templateDictionary: any, authentication: UserSession): Promise<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
* Check of an item type is a Site
|
|
59
|
-
* Hub Site Application is for ArcGIS Online
|
|
60
|
-
* Site Application is for ArcGIS Enterprise
|
|
61
|
-
*
|
|
62
|
-
* @param itemType
|
|
63
|
-
*/
|
|
64
|
-
export declare function isASite(itemType: string): boolean;
|
|
@@ -1,235 +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.isASite = exports.postProcess = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
|
|
19
|
-
/**
|
|
20
|
-
* Manages the creation and deployment of Hub Site item types.
|
|
21
|
-
*
|
|
22
|
-
* @module hub-site-processor
|
|
23
|
-
*/
|
|
24
|
-
const solution_common_1 = require("@esri/solution-common");
|
|
25
|
-
const hub_sites_1 = require("@esri/hub-sites");
|
|
26
|
-
const hub_common_1 = require("@esri/hub-common");
|
|
27
|
-
const move_model_to_folder_1 = require("./helpers/move-model-to-folder");
|
|
28
|
-
const _post_process_site_1 = require("./helpers/_post-process-site");
|
|
29
|
-
const replace_item_ids_1 = require("./helpers/replace-item-ids");
|
|
30
|
-
/**
|
|
31
|
-
* Converts a Site 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
|
-
let itemTitle;
|
|
42
|
-
let dataTitle;
|
|
43
|
-
let hubRo;
|
|
44
|
-
// get hubRequestOptions
|
|
45
|
-
return (0, solution_common_1.createHubRequestOptions)(destAuthentication)
|
|
46
|
-
.then((ro) => {
|
|
47
|
-
hubRo = ro;
|
|
48
|
-
return (0, hub_sites_1.getSiteById)(itemInfo.id, hubRo);
|
|
49
|
-
})
|
|
50
|
-
.then((siteModel) => {
|
|
51
|
-
// We need to save these properties in order to restore them after hub.js deletes them
|
|
52
|
-
created = siteModel.item.created;
|
|
53
|
-
modified = siteModel.item.modified;
|
|
54
|
-
itemTitle = siteModel.item.title;
|
|
55
|
-
dataTitle = siteModel.data.values.title;
|
|
56
|
-
return (0, hub_sites_1.convertSiteToTemplate)(siteModel, hubRo);
|
|
57
|
-
})
|
|
58
|
-
.then((tmpl) => {
|
|
59
|
-
// add in some stuff Hub.js does not yet add
|
|
60
|
-
tmpl.item.created = created;
|
|
61
|
-
tmpl.item.modified = modified;
|
|
62
|
-
tmpl.item.title = itemTitle;
|
|
63
|
-
tmpl.item.typeKeywords = (0, hub_common_1.without)(tmpl.item.typeKeywords, "doNotDelete");
|
|
64
|
-
tmpl.data.values.title = dataTitle;
|
|
65
|
-
tmpl.groups = [];
|
|
66
|
-
tmpl.estimatedDeploymentCostFactor = 2;
|
|
67
|
-
tmpl.resources = [];
|
|
68
|
-
if (!(0, solution_common_1.getProp)(tmpl, "properties")) {
|
|
69
|
-
tmpl.properties = {};
|
|
70
|
-
}
|
|
71
|
-
// swap out dependency id's to {{<depid>.itemId}}
|
|
72
|
-
// so it will be re-interpolated
|
|
73
|
-
tmpl.dependencies = (0, solution_common_1.dedupe)(tmpl.dependencies);
|
|
74
|
-
tmpl = (0, replace_item_ids_1.replaceItemIds)(tmpl);
|
|
75
|
-
// and return it
|
|
76
|
-
return tmpl;
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
exports.convertItemToTemplate = convertItemToTemplate;
|
|
80
|
-
/**
|
|
81
|
-
* Handle deployment of Site item templates
|
|
82
|
-
*
|
|
83
|
-
* @export
|
|
84
|
-
* @param {IItemTemplate} template
|
|
85
|
-
* @param {*} templateDictionary
|
|
86
|
-
* @param {UserSession} destinationAuthentication
|
|
87
|
-
* @param {IItemProgressCallback} itemProgressCallback
|
|
88
|
-
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
89
|
-
*/
|
|
90
|
-
function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
91
|
-
// let the progress system know we've started...
|
|
92
|
-
const startStatus = itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Started, 0);
|
|
93
|
-
// if it returned false, just resolve out
|
|
94
|
-
if (!startStatus) {
|
|
95
|
-
return Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type));
|
|
96
|
-
}
|
|
97
|
-
// TODO: Reassess with resource unification
|
|
98
|
-
if (template.assets && template.resources) {
|
|
99
|
-
delete template.assets;
|
|
100
|
-
}
|
|
101
|
-
// ensure we have a solution object in the templateDictionary hash
|
|
102
|
-
if (!templateDictionary.solution) {
|
|
103
|
-
templateDictionary.solution = {};
|
|
104
|
-
}
|
|
105
|
-
// .title should always be set on the templateDictionary
|
|
106
|
-
templateDictionary.solution.title = templateDictionary.title;
|
|
107
|
-
// TODO: Determine if we need any transforms in this new env
|
|
108
|
-
const transforms = {};
|
|
109
|
-
// create an object to hold the created site through
|
|
110
|
-
// subsequent promise calls
|
|
111
|
-
let siteModel;
|
|
112
|
-
// Create the "siteModel" from the template. Does not save the site item yet
|
|
113
|
-
// Note: depending on licensing and user privs, will also create the team groups
|
|
114
|
-
// and initiative item.
|
|
115
|
-
let hubRo;
|
|
116
|
-
const thumbnail = template.item.thumbnail; // createSiteModelFromTemplate trashes thumbnail
|
|
117
|
-
return (0, solution_common_1.createHubRequestOptions)(destinationAuthentication, templateDictionary)
|
|
118
|
-
.then((ro) => {
|
|
119
|
-
hubRo = ro;
|
|
120
|
-
return (0, hub_sites_1.createSiteModelFromTemplate)(template, templateDictionary, transforms, hubRo);
|
|
121
|
-
})
|
|
122
|
-
.then((interpolated) => {
|
|
123
|
-
const options = {
|
|
124
|
-
assets: interpolated.assets || [],
|
|
125
|
-
};
|
|
126
|
-
// Now create the item, register for oAuth, register domain etc
|
|
127
|
-
return (0, hub_sites_1.createSite)(interpolated, options, hubRo);
|
|
128
|
-
})
|
|
129
|
-
.then((site) => {
|
|
130
|
-
// hold onto the site
|
|
131
|
-
siteModel = site;
|
|
132
|
-
// Move the site and initiative to the solution folder
|
|
133
|
-
// this is essentially fire and forget. We fail-safe the actual moveItem
|
|
134
|
-
// call since it's not critical to the outcome
|
|
135
|
-
return (0, move_model_to_folder_1.moveModelToFolder)(site, templateDictionary.folderId, destinationAuthentication);
|
|
136
|
-
})
|
|
137
|
-
.then(() => {
|
|
138
|
-
// Fix the thumbnail
|
|
139
|
-
const updateOptions = {
|
|
140
|
-
item: {
|
|
141
|
-
id: siteModel.item.id,
|
|
142
|
-
},
|
|
143
|
-
params: {
|
|
144
|
-
// Pass thumbnail in via params because item property is serialized, which discards a blob
|
|
145
|
-
thumbnail,
|
|
146
|
-
},
|
|
147
|
-
authentication: destinationAuthentication,
|
|
148
|
-
};
|
|
149
|
-
return (0, solution_common_1.restUpdateItem)(updateOptions);
|
|
150
|
-
})
|
|
151
|
-
.then(() => {
|
|
152
|
-
// Update the template dictionary
|
|
153
|
-
// TODO: This should be done in whatever recieves
|
|
154
|
-
// the outcome of this promise chain
|
|
155
|
-
templateDictionary[template.itemId] = {
|
|
156
|
-
itemId: siteModel.item.id,
|
|
157
|
-
};
|
|
158
|
-
// call the progress callback, which also mutates templateDictionary
|
|
159
|
-
const finalStatus = itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor || 2, siteModel.item.id);
|
|
160
|
-
if (!finalStatus) {
|
|
161
|
-
// clean up the site we just created
|
|
162
|
-
const failSafeRemove = (0, hub_common_1.failSafe)(hub_sites_1.removeSite, { success: true });
|
|
163
|
-
return failSafeRemove(siteModel, hubRo).then(() => {
|
|
164
|
-
return Promise.resolve((0, solution_common_1.generateEmptyCreationResponse)(template.type));
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
// finally, return ICreateItemFromTemplateResponse
|
|
169
|
-
const response = {
|
|
170
|
-
item: {
|
|
171
|
-
...template,
|
|
172
|
-
...(0, solution_common_1.convertIModel)(siteModel),
|
|
173
|
-
},
|
|
174
|
-
id: siteModel.item.id,
|
|
175
|
-
type: template.type,
|
|
176
|
-
postProcess: true,
|
|
177
|
-
};
|
|
178
|
-
response.item.itemId = siteModel.item.id;
|
|
179
|
-
return response;
|
|
180
|
-
}
|
|
181
|
-
})
|
|
182
|
-
.catch((ex) => {
|
|
183
|
-
itemProgressCallback(template.itemId, solution_common_1.EItemProgressStatus.Failed, 0);
|
|
184
|
-
throw ex;
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
exports.createItemFromTemplate = createItemFromTemplate;
|
|
188
|
-
/**
|
|
189
|
-
* Deployer life-cycle hook allowing the Site Processor
|
|
190
|
-
* a chance to apply final processes to all the items that
|
|
191
|
-
* were created as part of the solution.
|
|
192
|
-
* Specifically this will:
|
|
193
|
-
* - share all items to the content team, and (if created)
|
|
194
|
-
* the core team (depends on user privs)
|
|
195
|
-
* - link all Page items that were created, to the Site
|
|
196
|
-
*
|
|
197
|
-
* @param model
|
|
198
|
-
* @param items
|
|
199
|
-
* @param authentication
|
|
200
|
-
* @param templateDictionary
|
|
201
|
-
*/
|
|
202
|
-
function postProcess(id, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
203
|
-
let hubRo;
|
|
204
|
-
return (0, solution_common_1.createHubRequestOptions)(authentication, templateDictionary)
|
|
205
|
-
.then((ro) => {
|
|
206
|
-
hubRo = ro;
|
|
207
|
-
// get the site model
|
|
208
|
-
return (0, hub_sites_1.getSiteById)(id, hubRo);
|
|
209
|
-
})
|
|
210
|
-
.then((siteModel) => {
|
|
211
|
-
// Hub.js does not expect the same structures, so we delegat to a local fn
|
|
212
|
-
return (0, _post_process_site_1._postProcessSite)(siteModel, itemInfos, templateDictionary, hubRo);
|
|
213
|
-
})
|
|
214
|
-
.then(() => {
|
|
215
|
-
// resolve w/ a boolean
|
|
216
|
-
return Promise.resolve(true);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
exports.postProcess = postProcess;
|
|
220
|
-
/**
|
|
221
|
-
* Check of an item type is a Site
|
|
222
|
-
* Hub Site Application is for ArcGIS Online
|
|
223
|
-
* Site Application is for ArcGIS Enterprise
|
|
224
|
-
*
|
|
225
|
-
* @param itemType
|
|
226
|
-
*/
|
|
227
|
-
function isASite(itemType) {
|
|
228
|
-
let result = false;
|
|
229
|
-
if (itemType === "Hub Site Application" || itemType === "Site Application") {
|
|
230
|
-
result = true;
|
|
231
|
-
}
|
|
232
|
-
return result;
|
|
233
|
-
}
|
|
234
|
-
exports.isASite = isASite;
|
|
235
|
-
//# sourceMappingURL=hub-site-processor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hub-site-processor.js","sourceRoot":"","sources":["../../src/hub-site-processor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,2DAa+B;AAC/B,+CAMyB;AAEzB,iDAAqF;AAErF,yEAAmE;AACnE,qEAAgE;AAChE,iEAA4D;AAE5D;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,QAAa,EACb,kBAA+B,EAC/B,oBAAiC,IAAI;IAErC,IAAI,OAAO,GAAW,CAAC,CAAC;IACxB,IAAI,QAAQ,GAAW,CAAC,CAAC;IACz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B,EAC1B,kBAAuB,EACvB,cAA2B;IAE3B,IAAI,KAA6B,CAAC;IAClC,OAAO,IAAA,yCAAuB,EAAC,cAAc,EAAE,kBAAkB,CAAC;SAC/D,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE;QACX,KAAK,GAAG,EAAE,CAAC;QACX,qBAAqB;QACrB,OAAO,IAAA,uBAAW,EAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;QAClB,0EAA0E;QAC1E,OAAO,IAAA,qCAAgB,EAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,EAAE;QACT,uBAAuB;QACvB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACP,CAAC;AAxBD,kCAwBC;AAED;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,QAAgB;IACtC,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,QAAQ,KAAK,sBAAsB,IAAI,QAAQ,KAAK,kBAAkB,EAAE;QAC1E,MAAM,GAAG,IAAI,CAAC;KACf;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAND,0BAMC"}
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,23 +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 Site and Page item types.
|
|
18
|
-
*
|
|
19
|
-
* @module hubTypes
|
|
20
|
-
*/
|
|
21
|
-
import * as HubPageProcessor from "./hub-page-processor";
|
|
22
|
-
import * as HubSiteProcessor from "./hub-site-processor";
|
|
23
|
-
export { HubPageProcessor, HubSiteProcessor };
|
package/dist/cjs/index.js
DELETED
|
@@ -1,29 +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.HubSiteProcessor = exports.HubPageProcessor = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
/**
|
|
21
|
-
* Manages the creation and deployment of Hub Site and Page item types.
|
|
22
|
-
*
|
|
23
|
-
* @module hubTypes
|
|
24
|
-
*/
|
|
25
|
-
const HubPageProcessor = tslib_1.__importStar(require("./hub-page-processor"));
|
|
26
|
-
exports.HubPageProcessor = HubPageProcessor;
|
|
27
|
-
const HubSiteProcessor = tslib_1.__importStar(require("./hub-site-processor"));
|
|
28
|
-
exports.HubSiteProcessor = HubSiteProcessor;
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,+EAAyD;AAGhD,4CAAgB;AAFzB,+EAAyD;AAE9B,4CAAgB"}
|
|
@@ -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,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 { 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
|
-
//# 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,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"}
|