@esri/solution-hub-types 1.1.3 → 1.3.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/esm/hub-page-processor.d.ts +3 -2
- package/dist/esm/hub-page-processor.js +13 -4
- package/dist/esm/hub-page-processor.js.map +1 -1
- package/dist/esm/hub-site-processor.d.ts +10 -9
- package/dist/esm/hub-site-processor.js +45 -36
- package/dist/esm/hub-site-processor.js.map +1 -1
- package/dist/node/hub-page-processor.d.ts +3 -2
- package/dist/node/hub-page-processor.js +13 -4
- package/dist/node/hub-page-processor.js.map +1 -1
- package/dist/node/hub-site-processor.d.ts +10 -9
- package/dist/node/hub-site-processor.js +47 -38
- package/dist/node/hub-site-processor.js.map +1 -1
- package/dist/node/index.js +3 -2
- package/dist/node/index.js.map +1 -1
- package/dist/umd/hub-page-processor.d.ts +3 -2
- package/dist/umd/hub-site-processor.d.ts +10 -9
- package/dist/umd/hub-types.umd.js +74 -56
- package/dist/umd/hub-types.umd.js.map +1 -1
- package/dist/umd/hub-types.umd.min.js +4 -4
- package/dist/umd/hub-types.umd.min.js.map +1 -1
- package/package.json +24 -25
|
@@ -24,10 +24,11 @@ import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse,
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId The solution to contain the template
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
28
29
|
* @return A promise that will resolve when the template has been created
|
|
29
30
|
*/
|
|
30
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
31
32
|
/**
|
|
32
33
|
* Handle deployment of Page item templates
|
|
33
34
|
*
|
|
@@ -30,20 +30,29 @@ import { moveModelToFolder } from "./helpers/move-model-to-folder";
|
|
|
30
30
|
*
|
|
31
31
|
* @param solutionItemId The solution to contain the template
|
|
32
32
|
* @param itemInfo Info about the item
|
|
33
|
-
* @param
|
|
33
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
34
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
34
35
|
* @return A promise that will resolve when the template has been created
|
|
35
36
|
*/
|
|
36
|
-
export function convertItemToTemplate(solutionItemId, itemInfo,
|
|
37
|
+
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication = null // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
38
|
+
) {
|
|
39
|
+
let created = 0;
|
|
40
|
+
let modified = 0;
|
|
37
41
|
// get the page model and hubRequestOptions
|
|
38
42
|
return Promise.all([
|
|
39
|
-
getModel(itemInfo.id, { authentication }),
|
|
40
|
-
createHubRequestOptions(
|
|
43
|
+
getModel(itemInfo.id, { authentication: destAuthentication }),
|
|
44
|
+
createHubRequestOptions(destAuthentication)
|
|
41
45
|
])
|
|
42
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;
|
|
43
50
|
return convertPageToTemplate(pageModel, ro);
|
|
44
51
|
})
|
|
45
52
|
.then(tmpl => {
|
|
46
53
|
// add in some stuff Hub.js does not yet add
|
|
54
|
+
tmpl.item.created = created;
|
|
55
|
+
tmpl.item.modified = modified;
|
|
47
56
|
tmpl.item.typeKeywords = without(tmpl.item.typeKeywords, "doNotDelete");
|
|
48
57
|
tmpl.groups = [];
|
|
49
58
|
tmpl.estimatedDeploymentCostFactor = 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-page-processor.js","sourceRoot":"","sources":["../../src/hub-page-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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CAAC,EAAE;QAChB,wBAAwB;QACxB,OAAO,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,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"}
|
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
* @module hub-site-processor
|
|
20
20
|
*/
|
|
21
21
|
import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse, UserSession } from "@esri/solution-common";
|
|
22
|
+
/**
|
|
23
|
+
* Converts a Site item into a template.
|
|
24
|
+
*
|
|
25
|
+
* @param solutionItemId The solution to contain the template
|
|
26
|
+
* @param itemInfo Info about the item
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
29
|
+
* @return A promise that will resolve when the template has been created
|
|
30
|
+
*/
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
22
32
|
/**
|
|
23
33
|
* Handle deployment of Site item templates
|
|
24
34
|
*
|
|
@@ -30,15 +40,6 @@ import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse,
|
|
|
30
40
|
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
31
41
|
*/
|
|
32
42
|
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
33
|
-
/**
|
|
34
|
-
* Converts a Site item into a template.
|
|
35
|
-
*
|
|
36
|
-
* @param solutionItemId The solution to contain the template
|
|
37
|
-
* @param itemInfo Info about the item
|
|
38
|
-
* @param authentication Credentials for working with AGO
|
|
39
|
-
* @return A promise that will resolve when the template has been created
|
|
40
|
-
*/
|
|
41
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, authentication: UserSession): Promise<IItemTemplate>;
|
|
42
43
|
/**
|
|
43
44
|
* Deployer life-cycle hook allowing the Site Processor
|
|
44
45
|
* a chance to apply final processes to all the items that
|
|
@@ -25,6 +25,51 @@ import { failSafe, without } from "@esri/hub-common";
|
|
|
25
25
|
import { moveModelToFolder } from "./helpers/move-model-to-folder";
|
|
26
26
|
import { _postProcessSite } from "./helpers/_post-process-site";
|
|
27
27
|
import { replaceItemIds } from "./helpers/replace-item-ids";
|
|
28
|
+
/**
|
|
29
|
+
* Converts a Site item into a template.
|
|
30
|
+
*
|
|
31
|
+
* @param solutionItemId The solution to contain the template
|
|
32
|
+
* @param itemInfo Info about the item
|
|
33
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
34
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
35
|
+
* @return A promise that will resolve when the template has been created
|
|
36
|
+
*/
|
|
37
|
+
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication = null // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
38
|
+
) {
|
|
39
|
+
let created = 0;
|
|
40
|
+
let modified = 0;
|
|
41
|
+
let hubRo;
|
|
42
|
+
// get hubRequestOptions
|
|
43
|
+
return createHubRequestOptions(destAuthentication)
|
|
44
|
+
.then(ro => {
|
|
45
|
+
hubRo = ro;
|
|
46
|
+
return getSiteById(itemInfo.id, hubRo);
|
|
47
|
+
})
|
|
48
|
+
.then(siteModel => {
|
|
49
|
+
// We need to save these properties in order to restore them after hub.js deletes them
|
|
50
|
+
created = siteModel.item.created;
|
|
51
|
+
modified = siteModel.item.modified;
|
|
52
|
+
return convertSiteToTemplate(siteModel, hubRo);
|
|
53
|
+
})
|
|
54
|
+
.then(tmpl => {
|
|
55
|
+
// add in some stuff Hub.js does not yet add
|
|
56
|
+
tmpl.item.created = created;
|
|
57
|
+
tmpl.item.modified = modified;
|
|
58
|
+
tmpl.item.typeKeywords = without(tmpl.item.typeKeywords, "doNotDelete");
|
|
59
|
+
tmpl.groups = [];
|
|
60
|
+
tmpl.estimatedDeploymentCostFactor = 2;
|
|
61
|
+
tmpl.resources = [];
|
|
62
|
+
if (!getProp(tmpl, "properties")) {
|
|
63
|
+
tmpl.properties = {};
|
|
64
|
+
}
|
|
65
|
+
// swap out dependency id's to {{<depid>.itemId}}
|
|
66
|
+
// so it will be re-interpolated
|
|
67
|
+
tmpl.dependencies = dedupe(tmpl.dependencies);
|
|
68
|
+
tmpl = replaceItemIds(tmpl);
|
|
69
|
+
// and return it
|
|
70
|
+
return tmpl;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
28
73
|
/**
|
|
29
74
|
* Handle deployment of Site item templates
|
|
30
75
|
*
|
|
@@ -132,42 +177,6 @@ export function createItemFromTemplate(template, templateDictionary, destination
|
|
|
132
177
|
throw ex;
|
|
133
178
|
});
|
|
134
179
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Converts a Site item into a template.
|
|
137
|
-
*
|
|
138
|
-
* @param solutionItemId The solution to contain the template
|
|
139
|
-
* @param itemInfo Info about the item
|
|
140
|
-
* @param authentication Credentials for working with AGO
|
|
141
|
-
* @return A promise that will resolve when the template has been created
|
|
142
|
-
*/
|
|
143
|
-
export function convertItemToTemplate(solutionItemId, itemInfo, authentication) {
|
|
144
|
-
let hubRo;
|
|
145
|
-
// get hubRequestOptions
|
|
146
|
-
return createHubRequestOptions(authentication)
|
|
147
|
-
.then(ro => {
|
|
148
|
-
hubRo = ro;
|
|
149
|
-
return getSiteById(itemInfo.id, hubRo);
|
|
150
|
-
})
|
|
151
|
-
.then(siteModel => {
|
|
152
|
-
return convertSiteToTemplate(siteModel, hubRo);
|
|
153
|
-
})
|
|
154
|
-
.then(tmpl => {
|
|
155
|
-
// add in some stuff Hub.js does not yet add
|
|
156
|
-
tmpl.item.typeKeywords = without(tmpl.item.typeKeywords, "doNotDelete");
|
|
157
|
-
tmpl.groups = [];
|
|
158
|
-
tmpl.estimatedDeploymentCostFactor = 2;
|
|
159
|
-
tmpl.resources = [];
|
|
160
|
-
if (!getProp(tmpl, "properties")) {
|
|
161
|
-
tmpl.properties = {};
|
|
162
|
-
}
|
|
163
|
-
// swap out dependency id's to {{<depid>.itemId}}
|
|
164
|
-
// so it will be re-interpolated
|
|
165
|
-
tmpl.dependencies = dedupe(tmpl.dependencies);
|
|
166
|
-
tmpl = replaceItemIds(tmpl);
|
|
167
|
-
// and return it
|
|
168
|
-
return tmpl;
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
180
|
/**
|
|
172
181
|
* Deployer life-cycle hook allowing the Site Processor
|
|
173
182
|
* a chance to apply final processes to all the items that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-site-processor.js","sourceRoot":"","sources":["../../src/hub-site-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,EAIL,mBAAmB,EAEnB,uBAAuB,EACvB,MAAM,EACN,6BAA6B,EAC7B,OAAO,EACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAsB,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EACL,2BAA2B,EAC3B,UAAU,EACV,WAAW,EACX,UAAU,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,QAAQ,EAER,OAAO,EACR,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,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AAC,CAAC;SACD,KAAK,CAAC,EAAE,CAAC,EAAE;QACV,oBAAoB,CAAC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACrE,MAAM,EAAE,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CACzB,EAAU,EACV,IAAY,EACZ,SAAgB,EAChB,QAAa,EACb,SAA0B,EAC1B,kBAAuB,EACvB,cAA2B;IAE3B,IAAI,KAA6B,CAAC;IAClC,OAAO,uBAAuB,CAAC,cAAc,EAAE,kBAAkB,CAAC;SAC/D,IAAI,CAAC,EAAE,CAAC,EAAE;QACT,KAAK,GAAG,EAAE,CAAC;QACX,qBAAqB;QACrB,OAAO,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC;SACD,IAAI,CAAC,SAAS,CAAC,EAAE;QAChB,0EAA0E;QAC1E,OAAO,gBAAgB,CAAC,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;AAED;;;;;;GAMG;AACH,MAAM,UAAU,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"}
|
|
@@ -24,10 +24,11 @@ import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse,
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId The solution to contain the template
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
28
29
|
* @return A promise that will resolve when the template has been created
|
|
29
30
|
*/
|
|
30
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
31
32
|
/**
|
|
32
33
|
* Handle deployment of Page item templates
|
|
33
34
|
*
|
|
@@ -33,20 +33,29 @@ const move_model_to_folder_1 = require("./helpers/move-model-to-folder");
|
|
|
33
33
|
*
|
|
34
34
|
* @param solutionItemId The solution to contain the template
|
|
35
35
|
* @param itemInfo Info about the item
|
|
36
|
-
* @param
|
|
36
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
37
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
37
38
|
* @return A promise that will resolve when the template has been created
|
|
38
39
|
*/
|
|
39
|
-
function convertItemToTemplate(solutionItemId, itemInfo,
|
|
40
|
+
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication = null // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
41
|
+
) {
|
|
42
|
+
let created = 0;
|
|
43
|
+
let modified = 0;
|
|
40
44
|
// get the page model and hubRequestOptions
|
|
41
45
|
return Promise.all([
|
|
42
|
-
(0, hub_common_1.getModel)(itemInfo.id, { authentication }),
|
|
43
|
-
(0, solution_common_1.createHubRequestOptions)(
|
|
46
|
+
(0, hub_common_1.getModel)(itemInfo.id, { authentication: destAuthentication }),
|
|
47
|
+
(0, solution_common_1.createHubRequestOptions)(destAuthentication)
|
|
44
48
|
])
|
|
45
49
|
.then(([pageModel, ro]) => {
|
|
50
|
+
// We need to save these properties in order to restore them after hub.js deletes them
|
|
51
|
+
created = pageModel.item.created;
|
|
52
|
+
modified = pageModel.item.modified;
|
|
46
53
|
return (0, hub_sites_1.convertPageToTemplate)(pageModel, ro);
|
|
47
54
|
})
|
|
48
55
|
.then(tmpl => {
|
|
49
56
|
// add in some stuff Hub.js does not yet add
|
|
57
|
+
tmpl.item.created = created;
|
|
58
|
+
tmpl.item.modified = modified;
|
|
50
59
|
tmpl.item.typeKeywords = (0, hub_common_1.without)(tmpl.item.typeKeywords, "doNotDelete");
|
|
51
60
|
tmpl.groups = [];
|
|
52
61
|
tmpl.estimatedDeploymentCostFactor = 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-page-processor.js","sourceRoot":"","sources":["../../src/hub-page-processor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,2DAQ+B;AAC/B,iEAA0E;AAC1E,iDAQ0B;AAC1B,+CAKyB;AAEzB,qEAAgE;AAChE,iEAA4D;AAC5D,yEAAmE;AAEnE
|
|
1
|
+
{"version":3,"file":"hub-page-processor.js","sourceRoot":"","sources":["../../src/hub-page-processor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,2DAQ+B;AAC/B,iEAA0E;AAC1E,iDAQ0B;AAC1B,+CAKyB;AAEzB,qEAAgE;AAChE,iEAA4D;AAC5D,yEAAmE;AAEnE;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAA+B,EAC/B,oBAAiC,IAAI,CAAC,wDAAwD;;IAE9F,IAAI,OAAO,GAAW,CAAC,CAAC;IACxB,IAAI,QAAQ,GAAW,CAAC,CAAC;IAEzB,2CAA2C;IAC3C,OAAO,OAAO,CAAC,GAAG,CAAC;QACjB,IAAA,qBAAQ,EAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC;QAC7D,IAAA,yCAAuB,EAAC,kBAAkB,CAAC;KAC5C,CAAC;SACC,IAAI,CAAC,CAAC,CAAC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BC;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"}
|
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
* @module hub-site-processor
|
|
20
20
|
*/
|
|
21
21
|
import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse, UserSession } from "@esri/solution-common";
|
|
22
|
+
/**
|
|
23
|
+
* Converts a Site item into a template.
|
|
24
|
+
*
|
|
25
|
+
* @param solutionItemId The solution to contain the template
|
|
26
|
+
* @param itemInfo Info about the item
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
29
|
+
* @return A promise that will resolve when the template has been created
|
|
30
|
+
*/
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
22
32
|
/**
|
|
23
33
|
* Handle deployment of Site item templates
|
|
24
34
|
*
|
|
@@ -30,15 +40,6 @@ import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse,
|
|
|
30
40
|
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
31
41
|
*/
|
|
32
42
|
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
33
|
-
/**
|
|
34
|
-
* Converts a Site item into a template.
|
|
35
|
-
*
|
|
36
|
-
* @param solutionItemId The solution to contain the template
|
|
37
|
-
* @param itemInfo Info about the item
|
|
38
|
-
* @param authentication Credentials for working with AGO
|
|
39
|
-
* @return A promise that will resolve when the template has been created
|
|
40
|
-
*/
|
|
41
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, authentication: UserSession): Promise<IItemTemplate>;
|
|
42
43
|
/**
|
|
43
44
|
* Deployer life-cycle hook allowing the Site Processor
|
|
44
45
|
* a chance to apply final processes to all the items that
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.isASite = exports.postProcess = exports.
|
|
18
|
+
exports.isASite = exports.postProcess = exports.createItemFromTemplate = exports.convertItemToTemplate = void 0;
|
|
19
19
|
/**
|
|
20
20
|
* Manages the creation and deployment of Hub Site item types.
|
|
21
21
|
*
|
|
@@ -28,6 +28,52 @@ const hub_common_1 = require("@esri/hub-common");
|
|
|
28
28
|
const move_model_to_folder_1 = require("./helpers/move-model-to-folder");
|
|
29
29
|
const _post_process_site_1 = require("./helpers/_post-process-site");
|
|
30
30
|
const replace_item_ids_1 = require("./helpers/replace-item-ids");
|
|
31
|
+
/**
|
|
32
|
+
* Converts a Site item into a template.
|
|
33
|
+
*
|
|
34
|
+
* @param solutionItemId The solution to contain the template
|
|
35
|
+
* @param itemInfo Info about the item
|
|
36
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
37
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
38
|
+
* @return A promise that will resolve when the template has been created
|
|
39
|
+
*/
|
|
40
|
+
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication = null // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
41
|
+
) {
|
|
42
|
+
let created = 0;
|
|
43
|
+
let modified = 0;
|
|
44
|
+
let hubRo;
|
|
45
|
+
// get hubRequestOptions
|
|
46
|
+
return (0, solution_common_1.createHubRequestOptions)(destAuthentication)
|
|
47
|
+
.then(ro => {
|
|
48
|
+
hubRo = ro;
|
|
49
|
+
return (0, hub_sites_1.getSiteById)(itemInfo.id, hubRo);
|
|
50
|
+
})
|
|
51
|
+
.then(siteModel => {
|
|
52
|
+
// We need to save these properties in order to restore them after hub.js deletes them
|
|
53
|
+
created = siteModel.item.created;
|
|
54
|
+
modified = siteModel.item.modified;
|
|
55
|
+
return (0, hub_sites_1.convertSiteToTemplate)(siteModel, hubRo);
|
|
56
|
+
})
|
|
57
|
+
.then(tmpl => {
|
|
58
|
+
// add in some stuff Hub.js does not yet add
|
|
59
|
+
tmpl.item.created = created;
|
|
60
|
+
tmpl.item.modified = modified;
|
|
61
|
+
tmpl.item.typeKeywords = (0, hub_common_1.without)(tmpl.item.typeKeywords, "doNotDelete");
|
|
62
|
+
tmpl.groups = [];
|
|
63
|
+
tmpl.estimatedDeploymentCostFactor = 2;
|
|
64
|
+
tmpl.resources = [];
|
|
65
|
+
if (!(0, solution_common_1.getProp)(tmpl, "properties")) {
|
|
66
|
+
tmpl.properties = {};
|
|
67
|
+
}
|
|
68
|
+
// swap out dependency id's to {{<depid>.itemId}}
|
|
69
|
+
// so it will be re-interpolated
|
|
70
|
+
tmpl.dependencies = (0, solution_common_1.dedupe)(tmpl.dependencies);
|
|
71
|
+
tmpl = (0, replace_item_ids_1.replaceItemIds)(tmpl);
|
|
72
|
+
// and return it
|
|
73
|
+
return tmpl;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
exports.convertItemToTemplate = convertItemToTemplate;
|
|
31
77
|
/**
|
|
32
78
|
* Handle deployment of Site item templates
|
|
33
79
|
*
|
|
@@ -136,43 +182,6 @@ function createItemFromTemplate(template, templateDictionary, destinationAuthent
|
|
|
136
182
|
});
|
|
137
183
|
}
|
|
138
184
|
exports.createItemFromTemplate = createItemFromTemplate;
|
|
139
|
-
/**
|
|
140
|
-
* Converts a Site item into a template.
|
|
141
|
-
*
|
|
142
|
-
* @param solutionItemId The solution to contain the template
|
|
143
|
-
* @param itemInfo Info about the item
|
|
144
|
-
* @param authentication Credentials for working with AGO
|
|
145
|
-
* @return A promise that will resolve when the template has been created
|
|
146
|
-
*/
|
|
147
|
-
function convertItemToTemplate(solutionItemId, itemInfo, authentication) {
|
|
148
|
-
let hubRo;
|
|
149
|
-
// get hubRequestOptions
|
|
150
|
-
return (0, solution_common_1.createHubRequestOptions)(authentication)
|
|
151
|
-
.then(ro => {
|
|
152
|
-
hubRo = ro;
|
|
153
|
-
return (0, hub_sites_1.getSiteById)(itemInfo.id, hubRo);
|
|
154
|
-
})
|
|
155
|
-
.then(siteModel => {
|
|
156
|
-
return (0, hub_sites_1.convertSiteToTemplate)(siteModel, hubRo);
|
|
157
|
-
})
|
|
158
|
-
.then(tmpl => {
|
|
159
|
-
// add in some stuff Hub.js does not yet add
|
|
160
|
-
tmpl.item.typeKeywords = (0, hub_common_1.without)(tmpl.item.typeKeywords, "doNotDelete");
|
|
161
|
-
tmpl.groups = [];
|
|
162
|
-
tmpl.estimatedDeploymentCostFactor = 2;
|
|
163
|
-
tmpl.resources = [];
|
|
164
|
-
if (!(0, solution_common_1.getProp)(tmpl, "properties")) {
|
|
165
|
-
tmpl.properties = {};
|
|
166
|
-
}
|
|
167
|
-
// swap out dependency id's to {{<depid>.itemId}}
|
|
168
|
-
// so it will be re-interpolated
|
|
169
|
-
tmpl.dependencies = (0, solution_common_1.dedupe)(tmpl.dependencies);
|
|
170
|
-
tmpl = (0, replace_item_ids_1.replaceItemIds)(tmpl);
|
|
171
|
-
// and return it
|
|
172
|
-
return tmpl;
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
exports.convertItemToTemplate = convertItemToTemplate;
|
|
176
185
|
/**
|
|
177
186
|
* Deployer life-cycle hook allowing the Site Processor
|
|
178
187
|
* a chance to apply final processes to all the items that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub-site-processor.js","sourceRoot":"","sources":["../../src/hub-site-processor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,2DAU+B;AAC/B,iEAA0E;AAC1E,+CAMyB;A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,CAAC;AA3HD,wDA2HC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,WAAW,CACzB,EAAU,EACV,IAAY,EACZ,SAAgB,EAChB,QAAa,EACb,SAA0B,EAC1B,kBAAuB,EACvB,cAA2B;IAE3B,IAAI,KAA6B,CAAC;IAClC,OAAO,IAAA,yCAAuB,EAAC,cAAc,EAAE,kBAAkB,CAAC;SAC/D,IAAI,CAAC,EAAE,CAAC,EAAE;QACT,KAAK,GAAG,EAAE,CAAC;QACX,qBAAqB;QACrB,OAAO,IAAA,uBAAW,EAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC;SACD,IAAI,CAAC,SAAS,CAAC,EAAE;QAChB,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/node/index.js
CHANGED
|
@@ -16,13 +16,14 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.HubSiteProcessor = exports.HubPageProcessor = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
19
20
|
/**
|
|
20
21
|
* Manages the creation and deployment of Hub Site and Page item types.
|
|
21
22
|
*
|
|
22
23
|
* @module hubTypes
|
|
23
24
|
*/
|
|
24
|
-
const HubPageProcessor = require("./hub-page-processor");
|
|
25
|
+
const HubPageProcessor = (0, tslib_1.__importStar)(require("./hub-page-processor"));
|
|
25
26
|
exports.HubPageProcessor = HubPageProcessor;
|
|
26
|
-
const HubSiteProcessor = require("./hub-site-processor");
|
|
27
|
+
const HubSiteProcessor = (0, tslib_1.__importStar)(require("./hub-site-processor"));
|
|
27
28
|
exports.HubSiteProcessor = HubSiteProcessor;
|
|
28
29
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,oFAAyD;AAGhD,4CAAgB;AAFzB,oFAAyD;AAE9B,4CAAgB"}
|
|
@@ -24,10 +24,11 @@ import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse,
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId The solution to contain the template
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
|
-
* @param
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
28
29
|
* @return A promise that will resolve when the template has been created
|
|
29
30
|
*/
|
|
30
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any,
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
31
32
|
/**
|
|
32
33
|
* Handle deployment of Page item templates
|
|
33
34
|
*
|
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
* @module hub-site-processor
|
|
20
20
|
*/
|
|
21
21
|
import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse, UserSession } from "@esri/solution-common";
|
|
22
|
+
/**
|
|
23
|
+
* Converts a Site item into a template.
|
|
24
|
+
*
|
|
25
|
+
* @param solutionItemId The solution to contain the template
|
|
26
|
+
* @param itemInfo Info about the item
|
|
27
|
+
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
|
+
* @param srcAuthentication Credentials for requests to source items (placeholder--not used)
|
|
29
|
+
* @return A promise that will resolve when the template has been created
|
|
30
|
+
*/
|
|
31
|
+
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication?: UserSession): Promise<IItemTemplate>;
|
|
22
32
|
/**
|
|
23
33
|
* Handle deployment of Site item templates
|
|
24
34
|
*
|
|
@@ -30,15 +40,6 @@ import { IItemTemplate, IItemProgressCallback, ICreateItemFromTemplateResponse,
|
|
|
30
40
|
* @returns {Promise<ICreateItemFromTemplateResponse>}
|
|
31
41
|
*/
|
|
32
42
|
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
33
|
-
/**
|
|
34
|
-
* Converts a Site item into a template.
|
|
35
|
-
*
|
|
36
|
-
* @param solutionItemId The solution to contain the template
|
|
37
|
-
* @param itemInfo Info about the item
|
|
38
|
-
* @param authentication Credentials for working with AGO
|
|
39
|
-
* @return A promise that will resolve when the template has been created
|
|
40
|
-
*/
|
|
41
|
-
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, authentication: UserSession): Promise<IItemTemplate>;
|
|
42
43
|
/**
|
|
43
44
|
* Deployer life-cycle hook allowing the Site Processor
|
|
44
45
|
* a chance to apply final processes to all the items that
|