@esri/solution-web-experience 6.0.2-alpha.23 → 6.0.2-alpha.250423
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 +3 -3
- package/dist/cjs/helpers/convert-web-experience-to-template.d.ts +0 -27
- package/dist/cjs/helpers/convert-web-experience-to-template.js +0 -67
- package/dist/cjs/helpers/convert-web-experience-to-template.js.map +0 -1
- package/dist/cjs/helpers/create-web-experience-model-from-template.d.ts +0 -26
- package/dist/cjs/helpers/create-web-experience-model-from-template.js +0 -42
- package/dist/cjs/helpers/create-web-experience-model-from-template.js.map +0 -1
- package/dist/cjs/helpers/create-web-experience.d.ts +0 -25
- package/dist/cjs/helpers/create-web-experience.js +0 -119
- package/dist/cjs/helpers/create-web-experience.js.map +0 -1
- package/dist/cjs/helpers/get-experience-subdomain.d.ts +0 -23
- package/dist/cjs/helpers/get-experience-subdomain.js +0 -26
- package/dist/cjs/helpers/get-experience-subdomain.js.map +0 -1
- package/dist/cjs/helpers/get-web-experience-dependencies.d.ts +0 -23
- package/dist/cjs/helpers/get-web-experience-dependencies.js +0 -33
- package/dist/cjs/helpers/get-web-experience-dependencies.js.map +0 -1
- package/dist/cjs/helpers/get-web-experience-url-template.d.ts +0 -23
- package/dist/cjs/helpers/get-web-experience-url-template.js +0 -26
- package/dist/cjs/helpers/get-web-experience-url-template.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -17
- package/dist/cjs/index.js +0 -22
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/web-experience-processor.d.ts +0 -50
- package/dist/cjs/web-experience-processor.js +0 -124
- package/dist/cjs/web-experience-processor.js.map +0 -1
- package/dist/esm/helpers/convert-web-experience-to-template.d.ts +0 -27
- package/dist/esm/helpers/convert-web-experience-to-template.js +0 -63
- package/dist/esm/helpers/convert-web-experience-to-template.js.map +0 -1
- package/dist/esm/helpers/create-web-experience-model-from-template.d.ts +0 -26
- package/dist/esm/helpers/create-web-experience-model-from-template.js +0 -38
- package/dist/esm/helpers/create-web-experience-model-from-template.js.map +0 -1
- package/dist/esm/helpers/create-web-experience.d.ts +0 -25
- package/dist/esm/helpers/create-web-experience.js +0 -115
- package/dist/esm/helpers/create-web-experience.js.map +0 -1
- package/dist/esm/helpers/get-experience-subdomain.d.ts +0 -23
- package/dist/esm/helpers/get-experience-subdomain.js +0 -22
- package/dist/esm/helpers/get-experience-subdomain.js.map +0 -1
- package/dist/esm/helpers/get-web-experience-dependencies.d.ts +0 -23
- package/dist/esm/helpers/get-web-experience-dependencies.js +0 -29
- package/dist/esm/helpers/get-web-experience-dependencies.js.map +0 -1
- package/dist/esm/helpers/get-web-experience-url-template.d.ts +0 -23
- package/dist/esm/helpers/get-web-experience-url-template.js +0 -22
- package/dist/esm/helpers/get-web-experience-url-template.js.map +0 -1
- package/dist/esm/index.d.ts +0 -17
- package/dist/esm/index.js +0 -18
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/web-experience-processor.d.ts +0 -50
- package/dist/esm/web-experience-processor.js +0 -118
- package/dist/esm/web-experience-processor.js.map +0 -1
|
@@ -1,50 +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 web-experience item types.
|
|
18
|
-
*
|
|
19
|
-
* @module solution-web-experience
|
|
20
|
-
*/
|
|
21
|
-
import { UserSession, IItemProgressCallback, IItemTemplate, ICreateItemFromTemplateResponse, IUpdateItemResponse } from "@esri/solution-common";
|
|
22
|
-
/**
|
|
23
|
-
* Convert a Web Experience item into a Template
|
|
24
|
-
*
|
|
25
|
-
* @param itemInfo
|
|
26
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
27
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
28
|
-
* @param isGroup
|
|
29
|
-
*/
|
|
30
|
-
export declare function convertItemToTemplate(itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession): Promise<IItemTemplate>;
|
|
31
|
-
/**
|
|
32
|
-
* Create a Web Experience from a Template
|
|
33
|
-
*
|
|
34
|
-
* @param template
|
|
35
|
-
* @param templateDictionary
|
|
36
|
-
* @param destinationAuthentication
|
|
37
|
-
* @param itemProgressCallback
|
|
38
|
-
*/
|
|
39
|
-
export declare function createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
|
|
40
|
-
/**
|
|
41
|
-
* Post-Process an Experience
|
|
42
|
-
*
|
|
43
|
-
* @param {string} itemId The item ID
|
|
44
|
-
* @param {string} type The template type
|
|
45
|
-
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
46
|
-
* @param {any} templateDictionary The template dictionary
|
|
47
|
-
* @param {UserSession} authentication The destination session info
|
|
48
|
-
* @returns Promise resolving to successfulness of update
|
|
49
|
-
*/
|
|
50
|
-
export declare function postProcess(itemId: string, type: string, itemInfos: any[], template: IItemTemplate, templates: IItemTemplate[], templateDictionary: any, authentication: UserSession): Promise<IUpdateItemResponse>;
|
|
@@ -1,118 +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 web-experience item types.
|
|
18
|
-
*
|
|
19
|
-
* @module solution-web-experience
|
|
20
|
-
*/
|
|
21
|
-
import { EItemProgressStatus, convertIModel, generateEmptyCreationResponse, getItemData, restRemoveItem, updateItemTemplateFromDictionary, } from "@esri/solution-common";
|
|
22
|
-
import { failSafe } from "@esri/hub-common";
|
|
23
|
-
import { createWebExperienceModelFromTemplate } from "./helpers/create-web-experience-model-from-template";
|
|
24
|
-
import { createWebExperience } from "./helpers/create-web-experience";
|
|
25
|
-
import { convertWebExperienceToTemplate } from "./helpers/convert-web-experience-to-template";
|
|
26
|
-
/**
|
|
27
|
-
* Convert a Web Experience item into a Template
|
|
28
|
-
*
|
|
29
|
-
* @param itemInfo
|
|
30
|
-
* @param destAuthentication Credentials for requests to the destination organization
|
|
31
|
-
* @param srcAuthentication Credentials for requests to source items
|
|
32
|
-
* @param isGroup
|
|
33
|
-
*/
|
|
34
|
-
export function convertItemToTemplate(itemInfo, destAuthentication, srcAuthentication) {
|
|
35
|
-
// use the itemInfo to setup a model
|
|
36
|
-
const model = {
|
|
37
|
-
item: itemInfo,
|
|
38
|
-
data: {},
|
|
39
|
-
};
|
|
40
|
-
// fetch the data.json
|
|
41
|
-
return getItemData(itemInfo.id, { authentication: srcAuthentication }).then((data) => {
|
|
42
|
-
// append into the model
|
|
43
|
-
model.data = data;
|
|
44
|
-
// and use that to create a template
|
|
45
|
-
return convertWebExperienceToTemplate(model);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Create a Web Experience from a Template
|
|
50
|
-
*
|
|
51
|
-
* @param template
|
|
52
|
-
* @param templateDictionary
|
|
53
|
-
* @param destinationAuthentication
|
|
54
|
-
* @param itemProgressCallback
|
|
55
|
-
*/
|
|
56
|
-
export function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
|
|
57
|
-
// let the progress system know we've started...
|
|
58
|
-
const startStatus = itemProgressCallback(template.itemId, EItemProgressStatus.Started, 0);
|
|
59
|
-
// and if it returned false, just resolve out
|
|
60
|
-
if (!startStatus) {
|
|
61
|
-
return Promise.resolve(generateEmptyCreationResponse(template.type));
|
|
62
|
-
}
|
|
63
|
-
let exbModel;
|
|
64
|
-
return createWebExperienceModelFromTemplate(template, templateDictionary, {}, destinationAuthentication)
|
|
65
|
-
.then((model) => {
|
|
66
|
-
exbModel = model;
|
|
67
|
-
return createWebExperience(model, templateDictionary.folderId, {}, destinationAuthentication);
|
|
68
|
-
})
|
|
69
|
-
.then((createdModel) => {
|
|
70
|
-
exbModel.item.id = createdModel.item.id;
|
|
71
|
-
exbModel.item.url = createdModel.item.url;
|
|
72
|
-
// Update the template dictionary
|
|
73
|
-
// TODO: This should be done in whatever recieves
|
|
74
|
-
// the outcome of this promise chain
|
|
75
|
-
templateDictionary[template.itemId] = {
|
|
76
|
-
itemId: createdModel.item.id,
|
|
77
|
-
};
|
|
78
|
-
const finalStatus = itemProgressCallback(template.itemId, EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor || 2, createdModel.item.id);
|
|
79
|
-
if (!finalStatus) {
|
|
80
|
-
// clean up the site we just created
|
|
81
|
-
const failSafeRemove = failSafe(restRemoveItem, { success: true });
|
|
82
|
-
return failSafeRemove({
|
|
83
|
-
id: exbModel.item.id,
|
|
84
|
-
authentication: destinationAuthentication,
|
|
85
|
-
}).then(() => {
|
|
86
|
-
return Promise.resolve(generateEmptyCreationResponse(template.type));
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
// finally, return ICreateItemFromTemplateResponse
|
|
91
|
-
const response = {
|
|
92
|
-
item: {
|
|
93
|
-
...template,
|
|
94
|
-
...convertIModel(exbModel),
|
|
95
|
-
},
|
|
96
|
-
id: exbModel.item.id,
|
|
97
|
-
type: template.type,
|
|
98
|
-
postProcess: false,
|
|
99
|
-
};
|
|
100
|
-
response.item.itemId = exbModel.item.id;
|
|
101
|
-
return response;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Post-Process an Experience
|
|
107
|
-
*
|
|
108
|
-
* @param {string} itemId The item ID
|
|
109
|
-
* @param {string} type The template type
|
|
110
|
-
* @param {any[]} itemInfos Array of \{id: 'ef3', type: 'Web Map'\} objects
|
|
111
|
-
* @param {any} templateDictionary The template dictionary
|
|
112
|
-
* @param {UserSession} authentication The destination session info
|
|
113
|
-
* @returns Promise resolving to successfulness of update
|
|
114
|
-
*/
|
|
115
|
-
export function postProcess(itemId, type, itemInfos, template, templates, templateDictionary, authentication) {
|
|
116
|
-
return updateItemTemplateFromDictionary(itemId, templateDictionary, authentication);
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=web-experience-processor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web-experience-processor.js","sourceRoot":"","sources":["../../src/web-experience-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,EAEL,mBAAmB,EAKnB,aAAa,EACb,6BAA6B,EAC7B,WAAW,EACX,cAAc,EACd,gCAAgC,GACjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAU,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,oCAAoC,EAAE,MAAM,qDAAqD,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CA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