@esri/solution-group 1.3.5 → 1.3.11
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/group.d.ts +1 -1
- package/dist/esm/group.js +1 -1
- package/dist/node/group.d.ts +1 -1
- package/dist/node/group.js +2 -2
- package/dist/node/group.js.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/umd/group.d.ts +1 -1
- package/dist/umd/group.umd.js +3 -3
- package/dist/umd/group.umd.js.map +1 -1
- package/dist/umd/group.umd.min.js +2 -2
- package/dist/umd/group.umd.min.js.map +1 -1
- package/package.json +15 -14
package/dist/esm/group.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import * as common from "@esri/solution-common";
|
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
27
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
28
|
* @param srcAuthentication Credentials for requests to source items
|
|
29
|
-
* @
|
|
29
|
+
* @returns A promise that will resolve when the template has been created
|
|
30
30
|
*/
|
|
31
31
|
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
32
32
|
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
package/dist/esm/group.js
CHANGED
|
@@ -27,7 +27,7 @@ import * as common from "@esri/solution-common";
|
|
|
27
27
|
* @param itemInfo Info about the item
|
|
28
28
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
29
29
|
* @param srcAuthentication Credentials for requests to source items
|
|
30
|
-
* @
|
|
30
|
+
* @returns A promise that will resolve when the template has been created
|
|
31
31
|
*/
|
|
32
32
|
export function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication) {
|
|
33
33
|
return new Promise(resolve => {
|
package/dist/node/group.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import * as common from "@esri/solution-common";
|
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
27
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
28
|
* @param srcAuthentication Credentials for requests to source items
|
|
29
|
-
* @
|
|
29
|
+
* @returns A promise that will resolve when the template has been created
|
|
30
30
|
*/
|
|
31
31
|
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
32
32
|
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
package/dist/node/group.js
CHANGED
|
@@ -22,7 +22,7 @@ const tslib_1 = require("tslib");
|
|
|
22
22
|
*
|
|
23
23
|
* @module group
|
|
24
24
|
*/
|
|
25
|
-
const common =
|
|
25
|
+
const common = tslib_1.__importStar(require("@esri/solution-common"));
|
|
26
26
|
// ------------------------------------------------------------------------------------------------------------------ //
|
|
27
27
|
/**
|
|
28
28
|
* Converts a group item into a template.
|
|
@@ -31,7 +31,7 @@ const common = (0, tslib_1.__importStar)(require("@esri/solution-common"));
|
|
|
31
31
|
* @param itemInfo Info about the item
|
|
32
32
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
33
33
|
* @param srcAuthentication Credentials for requests to source items
|
|
34
|
-
* @
|
|
34
|
+
* @returns A promise that will resolve when the template has been created
|
|
35
35
|
*/
|
|
36
36
|
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication) {
|
|
37
37
|
return new Promise(resolve => {
|
package/dist/node/group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../src/group.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":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CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAxBD,kCAwBC"}
|
package/dist/node/index.js
CHANGED
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH,kDAAwB"}
|
package/dist/umd/group.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import * as common from "@esri/solution-common";
|
|
|
26
26
|
* @param itemInfo Info about the item
|
|
27
27
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
28
28
|
* @param srcAuthentication Credentials for requests to source items
|
|
29
|
-
* @
|
|
29
|
+
* @returns A promise that will resolve when the template has been created
|
|
30
30
|
*/
|
|
31
31
|
export declare function convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: common.UserSession, srcAuthentication: common.UserSession): Promise<common.IItemTemplate>;
|
|
32
32
|
export declare function createItemFromTemplate(template: common.IItemTemplate, templateDictionary: any, destinationAuthentication: common.UserSession, itemProgressCallback: common.IItemProgressCallback): Promise<common.ICreateItemFromTemplateResponse>;
|
package/dist/umd/group.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-group - v1.3.
|
|
2
|
+
* @esri/solution-group - v1.3.11 - Apache-2.0
|
|
3
3
|
* Copyright (c) 2018-2022 Esri, Inc.
|
|
4
|
-
*
|
|
4
|
+
* Mon Apr 25 2022 11:58:40 GMT-0700 (Pacific Daylight Time)
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
* @param itemInfo Info about the item
|
|
65
65
|
* @param destAuthentication Credentials for requests to the destination organization
|
|
66
66
|
* @param srcAuthentication Credentials for requests to source items
|
|
67
|
-
* @
|
|
67
|
+
* @returns A promise that will resolve when the template has been created
|
|
68
68
|
*/
|
|
69
69
|
function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication) {
|
|
70
70
|
return new Promise(resolve => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.umd.js","sources":["../../src/group.ts"],"sourcesContent":["/** @license\r\n * Copyright 2019 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Manages the creation and deployment of groups.\r\n *\r\n * @module group\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Converts a group item into a template.\r\n *\r\n * @param solutionItemId The solution to contain the template\r\n * @param itemInfo Info about the item\r\n * @param destAuthentication Credentials for requests to the destination organization\r\n * @param srcAuthentication Credentials for requests to source items\r\n * @return A promise that will resolve when the template has been created\r\n */\r\nexport function convertItemToTemplate(\r\n solutionItemId: string,\r\n itemInfo: any,\r\n destAuthentication: common.UserSession,\r\n srcAuthentication: common.UserSession\r\n): Promise<common.IItemTemplate> {\r\n return new Promise<common.IItemTemplate>(resolve => {\r\n // Init template\r\n const itemTemplate: common.IItemTemplate = common.createInitializedGroupTemplate(\r\n itemInfo\r\n );\r\n\r\n // Templatize item info property values\r\n itemTemplate.item.id = common.templatizeTerm(\r\n itemTemplate.item.id,\r\n itemTemplate.item.id,\r\n \".itemId\"\r\n );\r\n\r\n // Get the group's items--its dependencies\r\n common.getGroupContents(itemInfo.id, srcAuthentication).then(\r\n groupContents => {\r\n itemTemplate.type = \"Group\";\r\n itemTemplate.dependencies = groupContents;\r\n common.getGroupBase(itemInfo.id, srcAuthentication).then(\r\n groupResponse => {\r\n groupResponse.id = itemTemplate.item.id;\r\n itemTemplate.item = {\r\n ...groupResponse,\r\n type: \"Group\"\r\n };\r\n resolve(itemTemplate);\r\n },\r\n () => resolve(itemTemplate)\r\n );\r\n },\r\n () => resolve(itemTemplate)\r\n );\r\n });\r\n}\r\n\r\nexport function createItemFromTemplate(\r\n template: common.IItemTemplate,\r\n templateDictionary: any,\r\n destinationAuthentication: common.UserSession,\r\n itemProgressCallback: common.IItemProgressCallback\r\n): Promise<common.ICreateItemFromTemplateResponse> {\r\n return new Promise<common.ICreateItemFromTemplateResponse>(resolve => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Started,\r\n 0\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Ignored,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type));\r\n return;\r\n }\r\n\r\n // Replace the templatized symbols in a copy of the template\r\n let newItemTemplate: common.IItemTemplate = common.cloneObject(template);\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n // Need to manually reset thumbnail because adlib in replaceInTemplate breaks it\r\n newItemTemplate.item.thumbnail = template.item.thumbnail;\r\n\r\n // Set up properties needed to create group\r\n const newGroup: common.IGroupAdd = {\r\n title: newItemTemplate.item.title || \"\",\r\n access: \"private\",\r\n owner: newItemTemplate.item.owner,\r\n tags: newItemTemplate.item.tags,\r\n typeKeywords: newItemTemplate.item.typeKeywords,\r\n description: newItemTemplate.item.description,\r\n thumbnail: newItemTemplate.item.thumbnail,\r\n snippet: newItemTemplate.item.snippet\r\n };\r\n\r\n const props: string[] = [\r\n \"isInvitationOnly\", \"autoJoin\", \"membershipAccess\", \"isViewOnly\", \"sortField\", \"sortOrder\", \"isOpenData\", \"displaySettings\"\r\n ];\r\n props.forEach(p => {\r\n /* istanbul ignore else */\r\n if (newItemTemplate.item.hasOwnProperty(p)) {\r\n newGroup[p] = newItemTemplate.item[p];\r\n }\r\n })\r\n\r\n // Create a group, appending a sequential suffix to its name if the group exists, e.g.,\r\n // * Manage Right of Way Activities\r\n // * Manage Right of Way Activities 1\r\n // * Manage Right of Way Activities 2\r\n common\r\n .createUniqueGroup(\r\n newGroup.title,\r\n newGroup,\r\n templateDictionary,\r\n destinationAuthentication,\r\n common.isTrackingViewGroup(newItemTemplate) ? templateDictionary.locationTracking.owner : undefined\r\n )\r\n .then(\r\n (createResponse: common.IAddGroupResponse) => {\r\n if (createResponse.success) {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n newItemTemplate.itemId = createResponse.group.id;\r\n templateDictionary[template.itemId] = {\r\n itemId: createResponse.group.id\r\n };\r\n\r\n // Update the template again now that we have the new item id\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n\r\n // Update the template dictionary with the new id\r\n templateDictionary[template.itemId].itemId =\r\n createResponse.group.id;\r\n\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Finished,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(\r\n createResponse.group.id,\r\n destinationAuthentication\r\n )\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n )\r\n );\r\n } else {\r\n if (common.isTrackingViewGroup(newItemTemplate)) {\r\n const owner: string = templateDictionary.locationTracking.owner;\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common.reassignGroup(\r\n createResponse.group.id,\r\n owner,\r\n destinationAuthentication\r\n ).then(assignResults => {\r\n if (assignResults.success) {\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common.removeUsers(\r\n createResponse.group.id,\r\n [destinationAuthentication.username],\r\n destinationAuthentication\r\n ).then(removeResults => {\r\n if (Array.isArray(removeResults.notRemoved) && removeResults.notRemoved.length === 0) {\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.group.id,\r\n type: newItemTemplate.type,\r\n postProcess: common.hasUnresolvedVariables(\r\n newItemTemplate\r\n )\r\n });\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n });\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n })\r\n } else {\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.group.id,\r\n type: newItemTemplate.type,\r\n postProcess: common.hasUnresolvedVariables(\r\n newItemTemplate\r\n )\r\n });\r\n }\r\n }\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n },\r\n () => {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Group post-processing actions\r\n *\r\n * @param {string} id The item ID\r\n * @param {string} type The template type\r\n * @param {any[]} itemInfos Array of {id: 'ef3', type: 'Web Map'} objects\r\n * @param {common.IItemTemplate} template The original template\r\n * @param {common.IItemTemplate[]} templates The original templates\r\n * @param {any} templateDictionary The template dictionary\r\n * @param {UserSession} authentication The destination session info\r\n * @returns Promise resolving to successfulness of update\r\n */\r\nexport function postProcess(\r\n id: string,\r\n type: string,\r\n itemInfos: any[],\r\n template: common.IItemTemplate,\r\n templates: common.IItemTemplate[],\r\n templateDictionary: any,\r\n authentication: any\r\n): Promise<any> {\r\n let promise = Promise.resolve({success: true});\r\n itemInfos.some(t => {\r\n /* istanbul ignore else */\r\n if (t.id === id) {\r\n let group = t.item.item;\r\n /* istanbul ignore else */\r\n if (common.hasUnresolvedVariables(group)) {\r\n group = common.replaceInTemplate(group, templateDictionary);\r\n // update the group\r\n promise = common.updateGroup(group, authentication);\r\n }\r\n return true;\r\n }\r\n });\r\n return promise;\r\n}\r\n"],"names":["common"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;;;;;;EAwBA;EAEA;;;;;;;;;WASgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC;MAErC,OAAO,IAAI,OAAO,CAAuB,OAAO;;UAE9C,MAAM,YAAY,GAAyBA,iBAAM,CAAC,8BAA8B,CAC9E,QAAQ,CACT,CAAC;;UAGF,YAAY,CAAC,IAAI,CAAC,EAAE,GAAGA,iBAAM,CAAC,cAAc,CAC1C,YAAY,CAAC,IAAI,CAAC,EAAE,EACpB,YAAY,CAAC,IAAI,CAAC,EAAE,EACpB,SAAS,CACV,CAAC;;UAGFA,iBAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC,IAAI,CAC1D,aAAa;cACX,YAAY,CAAC,IAAI,GAAG,OAAO,CAAC;cAC5B,YAAY,CAAC,YAAY,GAAG,aAAa,CAAC;cAC1CA,iBAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC,IAAI,CACtD,aAAa;kBAC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,CAAC,MAAM,EACfA,iBAAM,CAAC,mBAAmB,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;kBACF,OAAO,CAACA,iBAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;eAC9D;WACF,EACD;cACE,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACfA,iBAAM,CAAC,mBAAmB,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;cACF,OAAO,CAACA,iBAAM,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;WAC9D,CACF,CAAC;OACL,CAAC,CAAC;EACL,CAAC;EAED;;;;;;;;;;;;WAYgB,WAAW,CACzB,EAAU,EACV,IAAY,EACZ,SAAgB,EAChB,QAA8B,EAC9B,SAAiC,EACjC,kBAAuB,EACvB,cAAmB;MAEnB,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;MAC/C,SAAS,CAAC,IAAI,CAAC,CAAC;;UAEd,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;cACf,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;cAExB,IAAIA,iBAAM,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE;kBACxC,KAAK,GAAGA,iBAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;;kBAE5D,OAAO,GAAGA,iBAAM,CAAC,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;eACrD;cACD,OAAO,IAAI,CAAC;WACb;OACF,CAAC,CAAC;MACH,OAAO,OAAO,CAAC;EACjB;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"group.umd.js","sources":["../../src/group.ts"],"sourcesContent":["/** @license\r\n * Copyright 2019 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Manages the creation and deployment of groups.\r\n *\r\n * @module group\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Converts a group item into a template.\r\n *\r\n * @param solutionItemId The solution to contain the template\r\n * @param itemInfo Info about the item\r\n * @param destAuthentication Credentials for requests to the destination organization\r\n * @param srcAuthentication Credentials for requests to source items\r\n * @returns A promise that will resolve when the template has been created\r\n */\r\nexport function convertItemToTemplate(\r\n solutionItemId: string,\r\n itemInfo: any,\r\n destAuthentication: common.UserSession,\r\n srcAuthentication: common.UserSession\r\n): Promise<common.IItemTemplate> {\r\n return new Promise<common.IItemTemplate>(resolve => {\r\n // Init template\r\n const itemTemplate: common.IItemTemplate = common.createInitializedGroupTemplate(\r\n itemInfo\r\n );\r\n\r\n // Templatize item info property values\r\n itemTemplate.item.id = common.templatizeTerm(\r\n itemTemplate.item.id,\r\n itemTemplate.item.id,\r\n \".itemId\"\r\n );\r\n\r\n // Get the group's items--its dependencies\r\n common.getGroupContents(itemInfo.id, srcAuthentication).then(\r\n groupContents => {\r\n itemTemplate.type = \"Group\";\r\n itemTemplate.dependencies = groupContents;\r\n common.getGroupBase(itemInfo.id, srcAuthentication).then(\r\n groupResponse => {\r\n groupResponse.id = itemTemplate.item.id;\r\n itemTemplate.item = {\r\n ...groupResponse,\r\n type: \"Group\"\r\n };\r\n resolve(itemTemplate);\r\n },\r\n () => resolve(itemTemplate)\r\n );\r\n },\r\n () => resolve(itemTemplate)\r\n );\r\n });\r\n}\r\n\r\nexport function createItemFromTemplate(\r\n template: common.IItemTemplate,\r\n templateDictionary: any,\r\n destinationAuthentication: common.UserSession,\r\n itemProgressCallback: common.IItemProgressCallback\r\n): Promise<common.ICreateItemFromTemplateResponse> {\r\n return new Promise<common.ICreateItemFromTemplateResponse>(resolve => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Started,\r\n 0\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Ignored,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type));\r\n return;\r\n }\r\n\r\n // Replace the templatized symbols in a copy of the template\r\n let newItemTemplate: common.IItemTemplate = common.cloneObject(template);\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n // Need to manually reset thumbnail because adlib in replaceInTemplate breaks it\r\n newItemTemplate.item.thumbnail = template.item.thumbnail;\r\n\r\n // Set up properties needed to create group\r\n const newGroup: common.IGroupAdd = {\r\n title: newItemTemplate.item.title || \"\",\r\n access: \"private\",\r\n owner: newItemTemplate.item.owner,\r\n tags: newItemTemplate.item.tags,\r\n typeKeywords: newItemTemplate.item.typeKeywords,\r\n description: newItemTemplate.item.description,\r\n thumbnail: newItemTemplate.item.thumbnail,\r\n snippet: newItemTemplate.item.snippet\r\n };\r\n\r\n const props: string[] = [\r\n \"isInvitationOnly\", \"autoJoin\", \"membershipAccess\", \"isViewOnly\", \"sortField\", \"sortOrder\", \"isOpenData\", \"displaySettings\"\r\n ];\r\n props.forEach(p => {\r\n /* istanbul ignore else */\r\n if (newItemTemplate.item.hasOwnProperty(p)) {\r\n newGroup[p] = newItemTemplate.item[p];\r\n }\r\n })\r\n\r\n // Create a group, appending a sequential suffix to its name if the group exists, e.g.,\r\n // * Manage Right of Way Activities\r\n // * Manage Right of Way Activities 1\r\n // * Manage Right of Way Activities 2\r\n common\r\n .createUniqueGroup(\r\n newGroup.title,\r\n newGroup,\r\n templateDictionary,\r\n destinationAuthentication,\r\n common.isTrackingViewGroup(newItemTemplate) ? templateDictionary.locationTracking.owner : undefined\r\n )\r\n .then(\r\n (createResponse: common.IAddGroupResponse) => {\r\n if (createResponse.success) {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n newItemTemplate.itemId = createResponse.group.id;\r\n templateDictionary[template.itemId] = {\r\n itemId: createResponse.group.id\r\n };\r\n\r\n // Update the template again now that we have the new item id\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n\r\n // Update the template dictionary with the new id\r\n templateDictionary[template.itemId].itemId =\r\n createResponse.group.id;\r\n\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Finished,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(\r\n createResponse.group.id,\r\n destinationAuthentication\r\n )\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n )\r\n );\r\n } else {\r\n if (common.isTrackingViewGroup(newItemTemplate)) {\r\n const owner: string = templateDictionary.locationTracking.owner;\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common.reassignGroup(\r\n createResponse.group.id,\r\n owner,\r\n destinationAuthentication\r\n ).then(assignResults => {\r\n if (assignResults.success) {\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common.removeUsers(\r\n createResponse.group.id,\r\n [destinationAuthentication.username],\r\n destinationAuthentication\r\n ).then(removeResults => {\r\n if (Array.isArray(removeResults.notRemoved) && removeResults.notRemoved.length === 0) {\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.group.id,\r\n type: newItemTemplate.type,\r\n postProcess: common.hasUnresolvedVariables(\r\n newItemTemplate\r\n )\r\n });\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n });\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n })\r\n } else {\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.group.id,\r\n type: newItemTemplate.type,\r\n postProcess: common.hasUnresolvedVariables(\r\n newItemTemplate\r\n )\r\n });\r\n }\r\n }\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n },\r\n () => {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Group post-processing actions\r\n *\r\n * @param {string} id The item ID\r\n * @param {string} type The template type\r\n * @param {any[]} itemInfos Array of {id: 'ef3', type: 'Web Map'} objects\r\n * @param {common.IItemTemplate} template The original template\r\n * @param {common.IItemTemplate[]} templates The original templates\r\n * @param {any} templateDictionary The template dictionary\r\n * @param {UserSession} authentication The destination session info\r\n * @returns Promise resolving to successfulness of update\r\n */\r\nexport function postProcess(\r\n id: string,\r\n type: string,\r\n itemInfos: any[],\r\n template: common.IItemTemplate,\r\n templates: common.IItemTemplate[],\r\n templateDictionary: any,\r\n authentication: any\r\n): Promise<any> {\r\n let promise = Promise.resolve({success: true});\r\n itemInfos.some(t => {\r\n /* istanbul ignore else */\r\n if (t.id === id) {\r\n let group = t.item.item;\r\n /* istanbul ignore else */\r\n if (common.hasUnresolvedVariables(group)) {\r\n group = common.replaceInTemplate(group, templateDictionary);\r\n // update the group\r\n promise = common.updateGroup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ACrD,aAAA;EACD,YAAA,OAAO,IAAI,CAAC;EACb,SAAA;EACH,KAAC,CAAC,CAAC;EACH,IAAA,OAAO,OAAO,CAAC;EACjB;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-group - v1.3.
|
|
2
|
+
* @esri/solution-group - v1.3.11 - Apache-2.0
|
|
3
3
|
* Copyright (c) 2018-2022 Esri, Inc.
|
|
4
|
-
*
|
|
4
|
+
* Mon Apr 25 2022 11:58:48 GMT-0700 (Pacific Daylight Time)
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.umd.min.js","sources":["../../src/group.ts"],"sourcesContent":["/** @license\r\n * Copyright 2019 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Manages the creation and deployment of groups.\r\n *\r\n * @module group\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Converts a group item into a template.\r\n *\r\n * @param solutionItemId The solution to contain the template\r\n * @param itemInfo Info about the item\r\n * @param destAuthentication Credentials for requests to the destination organization\r\n * @param srcAuthentication Credentials for requests to source items\r\n * @return A promise that will resolve when the template has been created\r\n */\r\nexport function convertItemToTemplate(\r\n solutionItemId: string,\r\n itemInfo: any,\r\n destAuthentication: common.UserSession,\r\n srcAuthentication: common.UserSession\r\n): Promise<common.IItemTemplate> {\r\n return new Promise<common.IItemTemplate>(resolve => {\r\n // Init template\r\n const itemTemplate: common.IItemTemplate = common.createInitializedGroupTemplate(\r\n itemInfo\r\n );\r\n\r\n // Templatize item info property values\r\n itemTemplate.item.id = common.templatizeTerm(\r\n itemTemplate.item.id,\r\n itemTemplate.item.id,\r\n \".itemId\"\r\n );\r\n\r\n // Get the group's items--its dependencies\r\n common.getGroupContents(itemInfo.id, srcAuthentication).then(\r\n groupContents => {\r\n itemTemplate.type = \"Group\";\r\n itemTemplate.dependencies = groupContents;\r\n common.getGroupBase(itemInfo.id, srcAuthentication).then(\r\n groupResponse => {\r\n groupResponse.id = itemTemplate.item.id;\r\n itemTemplate.item = {\r\n ...groupResponse,\r\n type: \"Group\"\r\n };\r\n resolve(itemTemplate);\r\n },\r\n () => resolve(itemTemplate)\r\n );\r\n },\r\n () => resolve(itemTemplate)\r\n );\r\n });\r\n}\r\n\r\nexport function createItemFromTemplate(\r\n template: common.IItemTemplate,\r\n templateDictionary: any,\r\n destinationAuthentication: common.UserSession,\r\n itemProgressCallback: common.IItemProgressCallback\r\n): Promise<common.ICreateItemFromTemplateResponse> {\r\n return new Promise<common.ICreateItemFromTemplateResponse>(resolve => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Started,\r\n 0\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Ignored,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type));\r\n return;\r\n }\r\n\r\n // Replace the templatized symbols in a copy of the template\r\n let newItemTemplate: common.IItemTemplate = common.cloneObject(template);\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n // Need to manually reset thumbnail because adlib in replaceInTemplate breaks it\r\n newItemTemplate.item.thumbnail = template.item.thumbnail;\r\n\r\n // Set up properties needed to create group\r\n const newGroup: common.IGroupAdd = {\r\n title: newItemTemplate.item.title || \"\",\r\n access: \"private\",\r\n owner: newItemTemplate.item.owner,\r\n tags: newItemTemplate.item.tags,\r\n typeKeywords: newItemTemplate.item.typeKeywords,\r\n description: newItemTemplate.item.description,\r\n thumbnail: newItemTemplate.item.thumbnail,\r\n snippet: newItemTemplate.item.snippet\r\n };\r\n\r\n const props: string[] = [\r\n \"isInvitationOnly\", \"autoJoin\", \"membershipAccess\", \"isViewOnly\", \"sortField\", \"sortOrder\", \"isOpenData\", \"displaySettings\"\r\n ];\r\n props.forEach(p => {\r\n /* istanbul ignore else */\r\n if (newItemTemplate.item.hasOwnProperty(p)) {\r\n newGroup[p] = newItemTemplate.item[p];\r\n }\r\n })\r\n\r\n // Create a group, appending a sequential suffix to its name if the group exists, e.g.,\r\n // * Manage Right of Way Activities\r\n // * Manage Right of Way Activities 1\r\n // * Manage Right of Way Activities 2\r\n common\r\n .createUniqueGroup(\r\n newGroup.title,\r\n newGroup,\r\n templateDictionary,\r\n destinationAuthentication,\r\n common.isTrackingViewGroup(newItemTemplate) ? templateDictionary.locationTracking.owner : undefined\r\n )\r\n .then(\r\n (createResponse: common.IAddGroupResponse) => {\r\n if (createResponse.success) {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n newItemTemplate.itemId = createResponse.group.id;\r\n templateDictionary[template.itemId] = {\r\n itemId: createResponse.group.id\r\n };\r\n\r\n // Update the template again now that we have the new item id\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n\r\n // Update the template dictionary with the new id\r\n templateDictionary[template.itemId].itemId =\r\n createResponse.group.id;\r\n\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Finished,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(\r\n createResponse.group.id,\r\n destinationAuthentication\r\n )\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n )\r\n );\r\n } else {\r\n if (common.isTrackingViewGroup(newItemTemplate)) {\r\n const owner: string = templateDictionary.locationTracking.owner;\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common.reassignGroup(\r\n createResponse.group.id,\r\n owner,\r\n destinationAuthentication\r\n ).then(assignResults => {\r\n if (assignResults.success) {\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common.removeUsers(\r\n createResponse.group.id,\r\n [destinationAuthentication.username],\r\n destinationAuthentication\r\n ).then(removeResults => {\r\n if (Array.isArray(removeResults.notRemoved) && removeResults.notRemoved.length === 0) {\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.group.id,\r\n type: newItemTemplate.type,\r\n postProcess: common.hasUnresolvedVariables(\r\n newItemTemplate\r\n )\r\n });\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n });\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n })\r\n } else {\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.group.id,\r\n type: newItemTemplate.type,\r\n postProcess: common.hasUnresolvedVariables(\r\n newItemTemplate\r\n )\r\n });\r\n }\r\n }\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n },\r\n () => {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Group post-processing actions\r\n *\r\n * @param {string} id The item ID\r\n * @param {string} type The template type\r\n * @param {any[]} itemInfos Array of {id: 'ef3', type: 'Web Map'} objects\r\n * @param {common.IItemTemplate} template The original template\r\n * @param {common.IItemTemplate[]} templates The original templates\r\n * @param {any} templateDictionary The template dictionary\r\n * @param {UserSession} authentication The destination session info\r\n * @returns Promise resolving to successfulness of update\r\n */\r\nexport function postProcess(\r\n id: string,\r\n type: string,\r\n itemInfos: any[],\r\n template: common.IItemTemplate,\r\n templates: common.IItemTemplate[],\r\n templateDictionary: any,\r\n authentication: any\r\n): Promise<any> {\r\n let promise = Promise.resolve({success: true});\r\n itemInfos.some(t => {\r\n /* istanbul ignore else */\r\n if (t.id === id) {\r\n let group = t.item.item;\r\n /* istanbul ignore else */\r\n if (common.hasUnresolvedVariables(group)) {\r\n group = common.replaceInTemplate(group, templateDictionary);\r\n // update the group\r\n promise = common.updateGroup(group, authentication);\r\n }\r\n return true;\r\n }\r\n });\r\n return promise;\r\n}\r\n"],"names":["solutionItemId","itemInfo","destAuthentication","srcAuthentication","Promise","resolve","itemTemplate","common","createInitializedGroupTemplate","item","id","templatizeTerm","getGroupContents","then","groupContents","type","dependencies","getGroupBase","groupResponse","template","templateDictionary","destinationAuthentication","itemProgressCallback","itemId","EItemProgressStatus","Started","Ignored","generateEmptyCreationResponse","newItemTemplate","cloneObject","replaceInTemplate","thumbnail","newGroup","title","access","owner","tags","typeKeywords","description","snippet","forEach","p","hasOwnProperty","createUniqueGroup","isTrackingViewGroup","locationTracking","undefined","createResponse","success","Created","estimatedDeploymentCostFactor","group","Finished","reassignGroup","assignResults","removeUsers","username","removeResults","Array","isArray","notRemoved","length","postProcess","hasUnresolvedVariables","Cancelled","removeGroup","Failed","itemInfos","templates","authentication","promise","some","t","updateGroup"],"mappings":";;;;;;;;;;;;;;;;;+pBAoCEA,EACAC,EACAC,EACAC,GAEA,OAA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2C,SAAS,IAcxC,OAbAmB,EAAUI,MAAKC,IAEb,GAAIA,EAAE9D,KAAOA,EAAI,CACf,IAAIyC,EAAQqB,EAAE/D,KAAKA,KAOnB,OALIF,EAAOwD,uBAAuBZ,KAChCA,EAAQ5C,EAAOuB,kBAAkBqB,EAAO/B,GAExCkD,EAAU/D,EAAOkE,YAAYtB,EAAOkB,KAE/B,MAGJC"}
|
|
1
|
+
{"version":3,"file":"group.umd.min.js","sources":["../../src/group.ts"],"sourcesContent":["/** @license\r\n * Copyright 2019 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Manages the creation and deployment of groups.\r\n *\r\n * @module group\r\n */\r\n\r\nimport * as common from \"@esri/solution-common\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n\r\n/**\r\n * Converts a group item into a template.\r\n *\r\n * @param solutionItemId The solution to contain the template\r\n * @param itemInfo Info about the item\r\n * @param destAuthentication Credentials for requests to the destination organization\r\n * @param srcAuthentication Credentials for requests to source items\r\n * @returns A promise that will resolve when the template has been created\r\n */\r\nexport function convertItemToTemplate(\r\n solutionItemId: string,\r\n itemInfo: any,\r\n destAuthentication: common.UserSession,\r\n srcAuthentication: common.UserSession\r\n): Promise<common.IItemTemplate> {\r\n return new Promise<common.IItemTemplate>(resolve => {\r\n // Init template\r\n const itemTemplate: common.IItemTemplate = common.createInitializedGroupTemplate(\r\n itemInfo\r\n );\r\n\r\n // Templatize item info property values\r\n itemTemplate.item.id = common.templatizeTerm(\r\n itemTemplate.item.id,\r\n itemTemplate.item.id,\r\n \".itemId\"\r\n );\r\n\r\n // Get the group's items--its dependencies\r\n common.getGroupContents(itemInfo.id, srcAuthentication).then(\r\n groupContents => {\r\n itemTemplate.type = \"Group\";\r\n itemTemplate.dependencies = groupContents;\r\n common.getGroupBase(itemInfo.id, srcAuthentication).then(\r\n groupResponse => {\r\n groupResponse.id = itemTemplate.item.id;\r\n itemTemplate.item = {\r\n ...groupResponse,\r\n type: \"Group\"\r\n };\r\n resolve(itemTemplate);\r\n },\r\n () => resolve(itemTemplate)\r\n );\r\n },\r\n () => resolve(itemTemplate)\r\n );\r\n });\r\n}\r\n\r\nexport function createItemFromTemplate(\r\n template: common.IItemTemplate,\r\n templateDictionary: any,\r\n destinationAuthentication: common.UserSession,\r\n itemProgressCallback: common.IItemProgressCallback\r\n): Promise<common.ICreateItemFromTemplateResponse> {\r\n return new Promise<common.ICreateItemFromTemplateResponse>(resolve => {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Started,\r\n 0\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Ignored,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type));\r\n return;\r\n }\r\n\r\n // Replace the templatized symbols in a copy of the template\r\n let newItemTemplate: common.IItemTemplate = common.cloneObject(template);\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n // Need to manually reset thumbnail because adlib in replaceInTemplate breaks it\r\n newItemTemplate.item.thumbnail = template.item.thumbnail;\r\n\r\n // Set up properties needed to create group\r\n const newGroup: common.IGroupAdd = {\r\n title: newItemTemplate.item.title || \"\",\r\n access: \"private\",\r\n owner: newItemTemplate.item.owner,\r\n tags: newItemTemplate.item.tags,\r\n typeKeywords: newItemTemplate.item.typeKeywords,\r\n description: newItemTemplate.item.description,\r\n thumbnail: newItemTemplate.item.thumbnail,\r\n snippet: newItemTemplate.item.snippet\r\n };\r\n\r\n const props: string[] = [\r\n \"isInvitationOnly\", \"autoJoin\", \"membershipAccess\", \"isViewOnly\", \"sortField\", \"sortOrder\", \"isOpenData\", \"displaySettings\"\r\n ];\r\n props.forEach(p => {\r\n /* istanbul ignore else */\r\n if (newItemTemplate.item.hasOwnProperty(p)) {\r\n newGroup[p] = newItemTemplate.item[p];\r\n }\r\n })\r\n\r\n // Create a group, appending a sequential suffix to its name if the group exists, e.g.,\r\n // * Manage Right of Way Activities\r\n // * Manage Right of Way Activities 1\r\n // * Manage Right of Way Activities 2\r\n common\r\n .createUniqueGroup(\r\n newGroup.title,\r\n newGroup,\r\n templateDictionary,\r\n destinationAuthentication,\r\n common.isTrackingViewGroup(newItemTemplate) ? templateDictionary.locationTracking.owner : undefined\r\n )\r\n .then(\r\n (createResponse: common.IAddGroupResponse) => {\r\n if (createResponse.success) {\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n newItemTemplate.itemId = createResponse.group.id;\r\n templateDictionary[template.itemId] = {\r\n itemId: createResponse.group.id\r\n };\r\n\r\n // Update the template again now that we have the new item id\r\n newItemTemplate = common.replaceInTemplate(\r\n newItemTemplate,\r\n templateDictionary\r\n );\r\n\r\n // Update the template dictionary with the new id\r\n templateDictionary[template.itemId].itemId =\r\n createResponse.group.id;\r\n\r\n // Interrupt process if progress callback returns `false`\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Finished,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(\r\n createResponse.group.id,\r\n destinationAuthentication\r\n )\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n )\r\n );\r\n } else {\r\n if (common.isTrackingViewGroup(newItemTemplate)) {\r\n const owner: string = templateDictionary.locationTracking.owner;\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common.reassignGroup(\r\n createResponse.group.id,\r\n owner,\r\n destinationAuthentication\r\n ).then(assignResults => {\r\n if (assignResults.success) {\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common.removeUsers(\r\n createResponse.group.id,\r\n [destinationAuthentication.username],\r\n destinationAuthentication\r\n ).then(removeResults => {\r\n if (Array.isArray(removeResults.notRemoved) && removeResults.notRemoved.length === 0) {\r\n if (\r\n !itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Created,\r\n template.estimatedDeploymentCostFactor / 2,\r\n createResponse.group.id\r\n )\r\n ) {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Cancelled,\r\n 0\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n common\r\n .removeGroup(createResponse.group.id, destinationAuthentication)\r\n .then(\r\n () =>\r\n resolve(\r\n common.generateEmptyCreationResponse(template.type)\r\n ),\r\n () =>\r\n resolve(common.generateEmptyCreationResponse(template.type))\r\n );\r\n } else {\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.group.id,\r\n type: newItemTemplate.type,\r\n postProcess: common.hasUnresolvedVariables(\r\n newItemTemplate\r\n )\r\n });\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n });\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n })\r\n } else {\r\n resolve({\r\n item: newItemTemplate,\r\n id: createResponse.group.id,\r\n type: newItemTemplate.type,\r\n postProcess: common.hasUnresolvedVariables(\r\n newItemTemplate\r\n )\r\n });\r\n }\r\n }\r\n }\r\n } else {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n },\r\n () => {\r\n itemProgressCallback(\r\n template.itemId,\r\n common.EItemProgressStatus.Failed,\r\n 0\r\n );\r\n resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item\r\n }\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Group post-processing actions\r\n *\r\n * @param {string} id The item ID\r\n * @param {string} type The template type\r\n * @param {any[]} itemInfos Array of {id: 'ef3', type: 'Web Map'} objects\r\n * @param {common.IItemTemplate} template The original template\r\n * @param {common.IItemTemplate[]} templates The original templates\r\n * @param {any} templateDictionary The template dictionary\r\n * @param {UserSession} authentication The destination session info\r\n * @returns Promise resolving to successfulness of update\r\n */\r\nexport function postProcess(\r\n id: string,\r\n type: string,\r\n itemInfos: any[],\r\n template: common.IItemTemplate,\r\n templates: common.IItemTemplate[],\r\n templateDictionary: any,\r\n authentication: any\r\n): Promise<any> {\r\n let promise = Promise.resolve({success: true});\r\n itemInfos.some(t => {\r\n /* istanbul ignore else */\r\n if (t.id === id) {\r\n let group = t.item.item;\r\n /* istanbul ignore else */\r\n if (common.hasUnresolvedVariables(group)) {\r\n group = common.replaceInTemplate(group, templateDictionary);\r\n // update the group\r\n promise = common.updateGroup(group, authentication);\r\n }\r\n return true;\r\n }\r\n });\r\n return promise;\r\n}\r\n"],"names":["solutionItemId","itemInfo","destAuthentication","srcAuthentication","Promise","resolve","itemTemplate","common","createInitializedGroupTemplate","item","id","templatizeTerm","getGroupContents","then","groupContents","type","dependencies","getGroupBase","groupResponse","template","templateDictionary","destinationAuthentication","itemProgressCallback","itemId","EItemProgressStatus","Started","Ignored","generateEmptyCreationResponse","newItemTemplate","cloneObject","replaceInTemplate","thumbnail","newGroup","title","access","owner","tags","typeKeywords","description","snippet","forEach","p","hasOwnProperty","createUniqueGroup","isTrackingViewGroup","locationTracking","undefined","createResponse","success","Created","estimatedDeploymentCostFactor","group","Finished","reassignGroup","assignResults","removeUsers","username","removeResults","Array","isArray","notRemoved","length","postProcess","hasUnresolvedVariables","Cancelled","removeGroup","Failed","itemInfos","templates","authentication","promise","some","t","updateGroup"],"mappings":";;;;;;;;;;;;;;;;;spBAmCM,SACJA,EACAC,EACAC,EACAC,GAEA,OAAO,IAAIC,SAA8BC,IAEvC,MAAMC,EAAqCC,EAAOC,+BAChDP,GAIFK,EAAaG,KAAKC,GAAKH,EAAOI,eAC5BL,EAAaG,KAAKC,GAClBJ,EAAaG,KAAKC,GAClB,WAIFH,EAAOK,iBAAiBX,EAASS,GAAIP,GAAmBU,MACtDC,IACER,EAAaS,KAAO,QACp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kE,YAAYtB,EAAOkB,KAE/B,MAGJC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esri/solution-group",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.11",
|
|
4
4
|
"description": "Manages the creation and deployment of group item types for @esri/solution.js.",
|
|
5
5
|
"main": "dist/node/index.js",
|
|
6
6
|
"unpkg": "dist/umd/group.umd.min.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"@esri/arcgis-rest-portal": "3.4.3",
|
|
19
19
|
"@esri/arcgis-rest-request": "3.4.3",
|
|
20
20
|
"@esri/arcgis-rest-service-admin": "3.4.3",
|
|
21
|
-
"@esri/hub-common": "9.
|
|
22
|
-
"@esri/hub-initiatives": "9.
|
|
23
|
-
"@esri/hub-sites": "9.
|
|
24
|
-
"@esri/hub-teams": "9.
|
|
25
|
-
"rollup": "
|
|
21
|
+
"@esri/hub-common": "9.29.0",
|
|
22
|
+
"@esri/hub-initiatives": "9.29.0",
|
|
23
|
+
"@esri/hub-sites": "9.29.0",
|
|
24
|
+
"@esri/hub-teams": "9.29.0",
|
|
25
|
+
"rollup": "2.70.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@esri/arcgis-rest-auth": "3.4.3",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"@esri/arcgis-rest-portal": "3.4.3",
|
|
31
31
|
"@esri/arcgis-rest-request": "3.4.3",
|
|
32
32
|
"@esri/arcgis-rest-service-admin": "3.4.3",
|
|
33
|
-
"@esri/hub-common": "9.
|
|
34
|
-
"@esri/hub-initiatives": "9.
|
|
35
|
-
"@esri/hub-sites": "9.
|
|
36
|
-
"@esri/hub-teams": "9.
|
|
33
|
+
"@esri/hub-common": "9.29.0",
|
|
34
|
+
"@esri/hub-initiatives": "9.29.0",
|
|
35
|
+
"@esri/hub-sites": "9.29.0",
|
|
36
|
+
"@esri/hub-teams": "9.29.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@esri/solution-common": "^1.3.
|
|
40
|
-
"tslib": "1.
|
|
39
|
+
"@esri/solution-common": "^1.3.11",
|
|
40
|
+
"tslib": "1.14.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"prepare": "npm run build",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"build:node": "tsc -p ./tsconfig.json --module commonjs --outDir ./dist/node",
|
|
48
48
|
"dev:esm": "tsc -w --module esnext --outDir ./dist/esm --declaration",
|
|
49
49
|
"dev:umd": "rollup -w -c ../../umd-base-profile.js",
|
|
50
|
-
"dev:node": "tsc -w --module commonjs --outDir ./dist/node"
|
|
50
|
+
"dev:node": "tsc -w --module commonjs --outDir ./dist/node",
|
|
51
|
+
"getupdates": "npm-check-updates --upgrade"
|
|
51
52
|
},
|
|
52
53
|
"publishConfig": {
|
|
53
54
|
"access": "public"
|
|
@@ -89,5 +90,5 @@
|
|
|
89
90
|
"esri",
|
|
90
91
|
"ES6"
|
|
91
92
|
],
|
|
92
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "eb2ce85aa37bd71c0961df7b7bd89d461cf9b697"
|
|
93
94
|
}
|