@esri/solution-group 1.1.5 → 1.2.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.
@@ -1,7 +1,7 @@
1
1
  /* @preserve
2
- * @esri/solution-group - v1.1.5 - Apache-2.0
2
+ * @esri/solution-group - v1.2.0 - Apache-2.0
3
3
  * Copyright (c) 2018-2021 Esri, Inc.
4
- * Tue Nov 16 2021 07:10:39 GMT-0800 (Pacific Standard Time)
4
+ * Thu Dec 09 2021 16:01:52 GMT-0800 (Pacific Standard 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.
@@ -18,8 +18,28 @@
18
18
  (function (global, factory) {
19
19
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@esri/solution-common')) :
20
20
  typeof define === 'function' && define.amd ? define(['exports', '@esri/solution-common'], factory) :
21
- (global = global || self, factory(global.arcgisSolution = global.arcgisSolution || {}, global.arcgisSolution));
22
- }(this, (function (exports, common) { 'use strict';
21
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.arcgisSolution = global.arcgisSolution || {}, global.arcgisSolution));
22
+ })(this, (function (exports, common) { 'use strict';
23
+
24
+ function _interopNamespace(e) {
25
+ if (e && e.__esModule) return e;
26
+ var n = Object.create(null);
27
+ if (e) {
28
+ Object.keys(e).forEach(function (k) {
29
+ if (k !== 'default') {
30
+ var d = Object.getOwnPropertyDescriptor(e, k);
31
+ Object.defineProperty(n, k, d.get ? d : {
32
+ enumerable: true,
33
+ get: function () { return e[k]; }
34
+ });
35
+ }
36
+ });
37
+ }
38
+ n["default"] = e;
39
+ return Object.freeze(n);
40
+ }
41
+
42
+ var common__namespace = /*#__PURE__*/_interopNamespace(common);
23
43
 
24
44
  /** @license
25
45
  * Copyright 2019 Esri
@@ -49,14 +69,14 @@
49
69
  function convertItemToTemplate(solutionItemId, itemInfo, destAuthentication, srcAuthentication) {
50
70
  return new Promise(resolve => {
51
71
  // Init template
52
- const itemTemplate = common.createInitializedGroupTemplate(itemInfo);
72
+ const itemTemplate = common__namespace.createInitializedGroupTemplate(itemInfo);
53
73
  // Templatize item info property values
54
- itemTemplate.item.id = common.templatizeTerm(itemTemplate.item.id, itemTemplate.item.id, ".itemId");
74
+ itemTemplate.item.id = common__namespace.templatizeTerm(itemTemplate.item.id, itemTemplate.item.id, ".itemId");
55
75
  // Get the group's items--its dependencies
56
- common.getGroupContents(itemInfo.id, srcAuthentication).then(groupContents => {
76
+ common__namespace.getGroupContents(itemInfo.id, srcAuthentication).then(groupContents => {
57
77
  itemTemplate.type = "Group";
58
78
  itemTemplate.dependencies = groupContents;
59
- common.getGroupBase(itemInfo.id, srcAuthentication).then(groupResponse => {
79
+ common__namespace.getGroupBase(itemInfo.id, srcAuthentication).then(groupResponse => {
60
80
  groupResponse.id = itemTemplate.item.id;
61
81
  itemTemplate.item = {
62
82
  ...groupResponse,
@@ -70,14 +90,14 @@
70
90
  function createItemFromTemplate(template, templateDictionary, destinationAuthentication, itemProgressCallback) {
71
91
  return new Promise(resolve => {
72
92
  // Interrupt process if progress callback returns `false`
73
- if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Started, 0)) {
74
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Ignored, 0);
75
- resolve(common.generateEmptyCreationResponse(template.type));
93
+ if (!itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Started, 0)) {
94
+ itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Ignored, 0);
95
+ resolve(common__namespace.generateEmptyCreationResponse(template.type));
76
96
  return;
77
97
  }
78
98
  // Replace the templatized symbols in a copy of the template
79
- let newItemTemplate = common.cloneObject(template);
80
- newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
99
+ let newItemTemplate = common__namespace.cloneObject(template);
100
+ newItemTemplate = common__namespace.replaceInTemplate(newItemTemplate, templateDictionary);
81
101
  // Need to manually reset thumbnail because adlib in replaceInTemplate breaks it
82
102
  newItemTemplate.item.thumbnail = template.item.thumbnail;
83
103
  // Set up properties needed to create group
@@ -94,15 +114,17 @@
94
114
  // * Manage Right of Way Activities
95
115
  // * Manage Right of Way Activities 1
96
116
  // * Manage Right of Way Activities 2
97
- common.createUniqueGroup(newGroup.title, newGroup, templateDictionary, destinationAuthentication, common.isTrackingViewGroup(newItemTemplate) ? templateDictionary.locationTracking.owner : undefined)
117
+ common__namespace
118
+ .createUniqueGroup(newGroup.title, newGroup, templateDictionary, destinationAuthentication, common__namespace.isTrackingViewGroup(newItemTemplate) ? templateDictionary.locationTracking.owner : undefined)
98
119
  .then((createResponse) => {
99
120
  if (createResponse.success) {
100
121
  // Interrupt process if progress callback returns `false`
101
- if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.group.id)) {
102
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
122
+ if (!itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.group.id)) {
123
+ itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Cancelled, 0);
103
124
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
104
- common.removeGroup(createResponse.group.id, destinationAuthentication)
105
- .then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
125
+ common__namespace
126
+ .removeGroup(createResponse.group.id, destinationAuthentication)
127
+ .then(() => resolve(common__namespace.generateEmptyCreationResponse(template.type)), () => resolve(common__namespace.generateEmptyCreationResponse(template.type)));
106
128
  }
107
129
  else {
108
130
  newItemTemplate.itemId = createResponse.group.id;
@@ -110,38 +132,41 @@
110
132
  itemId: createResponse.group.id
111
133
  };
112
134
  // Update the template again now that we have the new item id
113
- newItemTemplate = common.replaceInTemplate(newItemTemplate, templateDictionary);
135
+ newItemTemplate = common__namespace.replaceInTemplate(newItemTemplate, templateDictionary);
114
136
  // Update the template dictionary with the new id
115
137
  templateDictionary[template.itemId].itemId =
116
138
  createResponse.group.id;
117
139
  // Interrupt process if progress callback returns `false`
118
- if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor / 2, createResponse.group.id)) {
119
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
140
+ if (!itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Finished, template.estimatedDeploymentCostFactor / 2, createResponse.group.id)) {
141
+ itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Cancelled, 0);
120
142
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
121
- common.removeGroup(createResponse.group.id, destinationAuthentication)
122
- .then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
143
+ common__namespace
144
+ .removeGroup(createResponse.group.id, destinationAuthentication)
145
+ .then(() => resolve(common__namespace.generateEmptyCreationResponse(template.type)), () => resolve(common__namespace.generateEmptyCreationResponse(template.type)));
123
146
  }
124
147
  else {
125
- if (common.isTrackingViewGroup(newItemTemplate)) {
148
+ if (common__namespace.isTrackingViewGroup(newItemTemplate)) {
126
149
  const owner = templateDictionary.locationTracking.owner;
127
150
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
128
- common.reassignGroup(createResponse.group.id, owner, destinationAuthentication).then(assignResults => {
151
+ common__namespace.reassignGroup(createResponse.group.id, owner, destinationAuthentication).then(assignResults => {
129
152
  if (assignResults.success) {
130
- if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.group.id)) {
131
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
153
+ if (!itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.group.id)) {
154
+ itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Cancelled, 0);
132
155
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
133
- common.removeGroup(createResponse.group.id, destinationAuthentication)
134
- .then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
156
+ common__namespace
157
+ .removeGroup(createResponse.group.id, destinationAuthentication)
158
+ .then(() => resolve(common__namespace.generateEmptyCreationResponse(template.type)), () => resolve(common__namespace.generateEmptyCreationResponse(template.type)));
135
159
  }
136
160
  else {
137
161
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
138
- common.removeUsers(createResponse.group.id, [destinationAuthentication.username], destinationAuthentication).then(removeResults => {
162
+ common__namespace.removeUsers(createResponse.group.id, [destinationAuthentication.username], destinationAuthentication).then(removeResults => {
139
163
  if (Array.isArray(removeResults.notRemoved) && removeResults.notRemoved.length === 0) {
140
- if (!itemProgressCallback(template.itemId, common.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.group.id)) {
141
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Cancelled, 0);
164
+ if (!itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Created, template.estimatedDeploymentCostFactor / 2, createResponse.group.id)) {
165
+ itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Cancelled, 0);
142
166
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
143
- common.removeGroup(createResponse.group.id, destinationAuthentication)
144
- .then(() => resolve(common.generateEmptyCreationResponse(template.type)), () => resolve(common.generateEmptyCreationResponse(template.type)));
167
+ common__namespace
168
+ .removeGroup(createResponse.group.id, destinationAuthentication)
169
+ .then(() => resolve(common__namespace.generateEmptyCreationResponse(template.type)), () => resolve(common__namespace.generateEmptyCreationResponse(template.type)));
145
170
  }
146
171
  else {
147
172
  resolve({
@@ -153,15 +178,15 @@
153
178
  }
154
179
  }
155
180
  else {
156
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
157
- resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
181
+ itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Failed, 0);
182
+ resolve(common__namespace.generateEmptyCreationResponse(template.type)); // fails to create item
158
183
  }
159
184
  });
160
185
  }
161
186
  }
162
187
  else {
163
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
164
- resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
188
+ itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Failed, 0);
189
+ resolve(common__namespace.generateEmptyCreationResponse(template.type)); // fails to create item
165
190
  }
166
191
  });
167
192
  }
@@ -177,12 +202,12 @@
177
202
  }
178
203
  }
179
204
  else {
180
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
181
- resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
205
+ itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Failed, 0);
206
+ resolve(common__namespace.generateEmptyCreationResponse(template.type)); // fails to create item
182
207
  }
183
208
  }, () => {
184
- itemProgressCallback(template.itemId, common.EItemProgressStatus.Failed, 0);
185
- resolve(common.generateEmptyCreationResponse(template.type)); // fails to create item
209
+ itemProgressCallback(template.itemId, common__namespace.EItemProgressStatus.Failed, 0);
210
+ resolve(common__namespace.generateEmptyCreationResponse(template.type)); // fails to create item
186
211
  });
187
212
  });
188
213
  }
@@ -192,5 +217,5 @@
192
217
 
193
218
  Object.defineProperty(exports, '__esModule', { value: true });
194
219
 
195
- })));
220
+ }));
196
221
  //# sourceMappingURL=group.umd.js.map
@@ -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 description: newItemTemplate.item.description,\r\n thumbnail: newItemTemplate.item.thumbnail,\r\n snippet: newItemTemplate.item.snippet\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: false\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: false\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"],"names":["common.createInitializedGroupTemplate","common.templatizeTerm","common.getGroupContents","common.getGroupBase","common.EItemProgressStatus","common.generateEmptyCreationResponse","common.cloneObject","common.replaceInTemplate","common\r\n .createUniqueGroup","common.isTrackingViewGroup","common\r\n .removeGroup","common\r\n .removeGroup","common.reassignGroup","common\r\n .removeGroup","common.removeUsers","common\r\n .removeGroup"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;;;;;;EAwBA;EAEA;;;;;;;;;WASgB,qBAAqB,CACnC,cAAsB,EACtB,QAAa,EACb,kBAAsC,EACtC,iBAAqC;MAErC,OAAO,IAAI,OAAO,CAAuB,OAAO;;UAE9C,MAAM,YAAY,GAAyBA,qCAAqC,CAC9E,QAAQ,CACT,CAAC;;UAGF,YAAY,CAAC,IAAI,CAAC,EAAE,GAAGC,qBAAqB,CAC1C,YAAY,CAAC,IAAI,CAAC,EAAE,EACpB,YAAY,CAAC,IAAI,CAAC,EAAE,EACpB,SAAS,CACV,CAAC;;UAGFC,uBAAuB,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;cAC1CC,mBAAmB,CAAC,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC,IAAI,CACtD,aAAa;kBACX,aAAa,CAAC,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;kBACxC,YAAY,CAAC,IAAI,GAAG;sBAClB,GAAG,aAAa;sBAChB,IAAI,EAAE,OAAO;mBACd,CAAC;kBACF,OAAO,CAAC,YAAY,CAAC,CAAC;eACvB,EACD,MAAM,OAAO,CAAC,YAA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AW,EAAE,KAAK;+BACnB,CAAC,CAAC;2BACJ;uBACF;mBACF;eACF;mBAAM;kBACL,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACfD,0BAA0B,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;kBACF,OAAO,CAACC,oCAAoC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;eAC9D;WACF,EACD;cACE,oBAAoB,CAClB,QAAQ,CAAC,MAAM,EACfD,0BAA0B,CAAC,MAAM,EACjC,CAAC,CACF,CAAC;cACF,OAAO,CAACC,oCAAoC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;WAC9D,CACF,CAAC;OACL,CAAC,CAAC;EACL;;;;;;;;;;;;;"}
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 description: newItemTemplate.item.description,\r\n thumbnail: newItemTemplate.item.thumbnail,\r\n snippet: newItemTemplate.item.snippet\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: false\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: false\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"],"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,IA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B,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;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  /* @preserve
2
- * @esri/solution-group - v1.1.5 - Apache-2.0
2
+ * @esri/solution-group - v1.2.0 - Apache-2.0
3
3
  * Copyright (c) 2018-2021 Esri, Inc.
4
- * Tue Nov 16 2021 07:10:45 GMT-0800 (Pacific Standard Time)
4
+ * Thu Dec 09 2021 16:01:58 GMT-0800 (Pacific Standard 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.
@@ -15,5 +15,5 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@esri/solution-common")):"function"==typeof define&&define.amd?define(["exports","@esri/solution-common"],t):t((e=e||self).arcgisSolution=e.arcgisSolution||{},e.arcgisSolution)}(this,(function(e,t){"use strict";e.convertItemToTemplate=function(e,i,o,r){return new Promise((e=>{const o=t.createInitializedGroupTemplate(i);o.item.id=t.templatizeTerm(o.item.id,o.item.id,".itemId"),t.getGroupContents(i.id,r).then((s=>{o.type="Group",o.dependencies=s,t.getGroupBase(i.id,r).then((t=>{t.id=o.item.id,o.item={...t,type:"Group"},e(o)}),(()=>e(o)))}),(()=>e(o)))}))},e.createItemFromTemplate=function(e,i,o,r){return new Promise((s=>{if(!r(e.itemId,t.EItemProgressStatus.Started,0))return r(e.itemId,t.EItemProgressStatus.Ignored,0),void s(t.generateEmptyCreationResponse(e.type));let n=t.cloneObject(e);n=t.replaceInTemplate(n,i),n.item.thumbnail=e.item.thumbnail;const p={title:n.item.title||"",access:"private",owner:n.item.owner,tags:n.item.tags,description:n.item.description,thumbnail:n.item.thumbnail,snippet:n.item.snippet};t.createUniqueGroup(p.title,p,i,o,t.isTrackingViewGroup(n)?i.locationTracking.owner:void 0).then((p=>{if(p.success)if(r(e.itemId,t.EItemProgressStatus.Created,e.estimatedDeploymentCostFactor/2,p.group.id))if(n.itemId=p.group.id,i[e.itemId]={itemId:p.group.id},n=t.replaceInTemplate(n,i),i[e.itemId].itemId=p.group.id,r(e.itemId,t.EItemProgressStatus.Finished,e.estimatedDeploymentCostFactor/2,p.group.id))if(t.isTrackingViewGroup(n)){const m=i.locationTracking.owner;t.reassignGroup(p.group.id,m,o).then((i=>{i.success?r(e.itemId,t.EItemProgressStatus.Created,e.estimatedDeploymentCostFactor/2,p.group.id)?t.removeUsers(p.group.id,[o.username],o).then((i=>{Array.isArray(i.notRemoved)&&0===i.notRemoved.length?r(e.itemId,t.EItemProgressStatus.Created,e.estimatedDeploymentCostFactor/2,p.group.id)?s({item:n,id:p.group.id,type:n.type,postProcess:!1}):(r(e.itemId,t.EItemProgressStatus.Cancelled,0),t.removeGroup(p.group.id,o).then((()=>s(t.generateEmptyCreationResponse(e.type))),(()=>s(t.generateEmptyCreationResponse(e.type))))):(r(e.itemId,t.EItemProgressStatus.Failed,0),s(t.generateEmptyCreationResponse(e.type)))})):(r(e.itemId,t.EItemProgressStatus.Cancelled,0),t.removeGroup(p.group.id,o).then((()=>s(t.generateEmptyCreationResponse(e.type))),(()=>s(t.generateEmptyCreationResponse(e.type))))):(r(e.itemId,t.EItemProgressStatus.Failed,0),s(t.generateEmptyCreationResponse(e.type)))}))}else s({item:n,id:p.group.id,type:n.type,postProcess:!1});else r(e.itemId,t.EItemProgressStatus.Cancelled,0),t.removeGroup(p.group.id,o).then((()=>s(t.generateEmptyCreationResponse(e.type))),(()=>s(t.generateEmptyCreationResponse(e.type))));else r(e.itemId,t.EItemProgressStatus.Cancelled,0),t.removeGroup(p.group.id,o).then((()=>s(t.generateEmptyCreationResponse(e.type))),(()=>s(t.generateEmptyCreationResponse(e.type))));else r(e.itemId,t.EItemProgressStatus.Failed,0),s(t.generateEmptyCreationResponse(e.type))}),(()=>{r(e.itemId,t.EItemProgressStatus.Failed,0),s(t.generateEmptyCreationResponse(e.type))}))}))},Object.defineProperty(e,"__esModule",{value:!0})}));
18
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@esri/solution-common")):"function"==typeof define&&define.amd?define(["exports","@esri/solution-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arcgisSolution=e.arcgisSolution||{},e.arcgisSolution)}(this,(function(e,t){"use strict";function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=r(t);e.convertItemToTemplate=function(e,t,r,o){return new Promise((e=>{const r=i.createInitializedGroupTemplate(t);r.item.id=i.templatizeTerm(r.item.id,r.item.id,".itemId"),i.getGroupContents(t.id,o).then((n=>{r.type="Group",r.dependencies=n,i.getGroupBase(t.id,o).then((t=>{t.id=r.item.id,r.item={...t,type:"Group"},e(r)}),(()=>e(r)))}),(()=>e(r)))}))},e.createItemFromTemplate=function(e,t,r,o){return new Promise((n=>{if(!o(e.itemId,i.EItemProgressStatus.Started,0))return o(e.itemId,i.EItemProgressStatus.Ignored,0),void n(i.generateEmptyCreationResponse(e.type));let s=i.cloneObject(e);s=i.replaceInTemplate(s,t),s.item.thumbnail=e.item.thumbnail;const a={title:s.item.title||"",access:"private",owner:s.item.owner,tags:s.item.tags,description:s.item.description,thumbnail:s.item.thumbnail,snippet:s.item.snippet};i.createUniqueGroup(a.title,a,t,r,i.isTrackingViewGroup(s)?t.locationTracking.owner:void 0).then((a=>{if(a.success)if(o(e.itemId,i.EItemProgressStatus.Created,e.estimatedDeploymentCostFactor/2,a.group.id))if(s.itemId=a.group.id,t[e.itemId]={itemId:a.group.id},s=i.replaceInTemplate(s,t),t[e.itemId].itemId=a.group.id,o(e.itemId,i.EItemProgressStatus.Finished,e.estimatedDeploymentCostFactor/2,a.group.id))if(i.isTrackingViewGroup(s)){const p=t.locationTracking.owner;i.reassignGroup(a.group.id,p,r).then((t=>{t.success?o(e.itemId,i.EItemProgressStatus.Created,e.estimatedDeploymentCostFactor/2,a.group.id)?i.removeUsers(a.group.id,[r.username],r).then((t=>{Array.isArray(t.notRemoved)&&0===t.notRemoved.length?o(e.itemId,i.EItemProgressStatus.Created,e.estimatedDeploymentCostFactor/2,a.group.id)?n({item:s,id:a.group.id,type:s.type,postProcess:!1}):(o(e.itemId,i.EItemProgressStatus.Cancelled,0),i.removeGroup(a.group.id,r).then((()=>n(i.generateEmptyCreationResponse(e.type))),(()=>n(i.generateEmptyCreationResponse(e.type))))):(o(e.itemId,i.EItemProgressStatus.Failed,0),n(i.generateEmptyCreationResponse(e.type)))})):(o(e.itemId,i.EItemProgressStatus.Cancelled,0),i.removeGroup(a.group.id,r).then((()=>n(i.generateEmptyCreationResponse(e.type))),(()=>n(i.generateEmptyCreationResponse(e.type))))):(o(e.itemId,i.EItemProgressStatus.Failed,0),n(i.generateEmptyCreationResponse(e.type)))}))}else n({item:s,id:a.group.id,type:s.type,postProcess:!1});else o(e.itemId,i.EItemProgressStatus.Cancelled,0),i.removeGroup(a.group.id,r).then((()=>n(i.generateEmptyCreationResponse(e.type))),(()=>n(i.generateEmptyCreationResponse(e.type))));else o(e.itemId,i.EItemProgressStatus.Cancelled,0),i.removeGroup(a.group.id,r).then((()=>n(i.generateEmptyCreationResponse(e.type))),(()=>n(i.generateEmptyCreationResponse(e.type))));else o(e.itemId,i.EItemProgressStatus.Failed,0),n(i.generateEmptyCreationResponse(e.type))}),(()=>{o(e.itemId,i.EItemProgressStatus.Failed,0),n(i.generateEmptyCreationResponse(e.type))}))}))},Object.defineProperty(e,"__esModule",{value:!0})}));
19
19
  //# sourceMappingURL=group.umd.min.js.map
@@ -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 description: newItemTemplate.item.description,\r\n thumbnail: newItemTemplate.item.thumbnail,\r\n snippet: newItemTemplate.item.snippet\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: false\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: false\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"],"names":["solutionItemId","itemInfo","destAuthentication","srcAuthentication","Promise","resolve","itemTemplate","common.createInitializedGroupTemplate","item","id","common.templatizeTerm","common.getGroupContents","then","groupContents","type","dependencies","common.getGroupBase","groupResponse","template","templateDictionary","destinationAuthentication","itemProgressCallback","itemId","common.EItemProgressStatus","Started","Ignored","common.generateEmptyCreationResponse","newItemTemplate","common.cloneObject","common.replaceInTemplate","thumbnail","newGroup","title","access","owner","tags","description","snippet","common\r\n .createUniqueGroup","common.isTrackingViewGroup","locationTracking","undefined","createResponse","success","Created","estimatedDeploymentCostFactor","group","Finished","common.reassignGroup","assignResults","common.removeUsers","username","removeResults","Array","isArray","notRemoved","length","postProcess","Cancelled","common\r\n .removeGroup","Failed","common\r\n .removeGroup","common\r\n .removeGroup","common\r\n .removeGroup"],"mappings":";;;;;;;;;;;;;;;;;2UAoCEA,EACAC,EACAC,EACAC,GAEA,OAAO,IAAIC,SAA8BC,IAEvC,MAAMC,EAAqC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NlB,GAAIiC,EAAeI,MAAMrC,GACzBK,KAAMa,EAAgBb,KACtB2C,aAAa,SAvHjBpC,EACEH,EAASI,OACTC,sBAA2BmC,UAC3B,GAGFI,cAEIpB,EAAeI,MAAMrC,GACrBW,GAEDR,MACC,IACEP,EACEqB,gCAAqCR,EAASJ,SAElD,IACET,EACEqB,gCAAqCR,EAASJ,cA3DxDO,EACEH,EAASI,OACTC,sBAA2BmC,UAC3B,GAGFK,cACerB,EAAeI,MAAMrC,GAAIW,GACrCR,MACC,IACEP,EACEqB,gCAAqCR,EAASJ,SAElD,IACET,EAAQqB,gCAAqCR,EAASJ,cAwJ9DO,EACEH,EAASI,OACTC,sBAA2BqC,OAC3B,GAEFvD,EAAQqB,gCAAqCR,EAASJ,UAG1D,KACEO,EACEH,EAASI,OACTC,sBAA2BqC,OAC3B,GAEFvD,EAAQqB,gCAAqCR,EAASJ"}
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 description: newItemTemplate.item.description,\r\n thumbnail: newItemTemplate.item.thumbnail,\r\n snippet: newItemTemplate.item.snippet\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: false\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: false\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"],"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","description","snippet","createUniqueGroup","isTrackingViewGroup","locationTracking","undefined","createResponse","success","Created","estimatedDeploymentCostFactor","group","Finished","reassignGroup","assignResults","removeUsers","username","removeResults","Array","isArray","notRemoved","length","postProcess","Cancelled","removeGroup","Failed"],"mappings":";;;;;;;;;;;;;;;;;+pBAoCEA,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,QACpBT,EAAaU,aAAeF,EAC5BP,EAAOU,aAAahB,EAASS,GAAIP,GAAmBU,MAClDK,IACEA,EAAcR,GAAKJ,EAAaG,KAAKC,GACrCJ,EAAaG,KAAO,IACfS,EACHH,KAAM,SAERV,EAAQC,MAEV,IAAMD,EAAQC,QAGlB,IAAMD,EAAQC,2CAMlBa,EACAC,EACAC,EACAC,GAEA,OAAO,IAAIlB,SAAgDC,IAEzD,IACGiB,EACCH,EAASI,OACThB,EAAOiB,oBAAoBC,QAC3B,GASF,OANAH,EACEH,EAASI,OACThB,EAAOiB,oBAAoBE,QAC3B,QAEFrB,EAAQE,EAAOoB,8BAA8BR,EAASJ,OAKxD,IAAIa,EAAwCrB,EAAOsB,YAAYV,GAC/DS,EAAkBrB,EAAOuB,kBACvBF,EACAR,GAGFQ,EAAgBnB,KAAKsB,UAAYZ,EAASV,KAAKsB,UAG/C,MAAMC,EAA6B,CACjCC,MAAOL,EAAgBnB,KAAKwB,OAAS,GACrCC,OAAQ,UACRC,MAAOP,EAAgBnB,KAAK0B,MAC5BC,KAAMR,EAAgBnB,KAAK2B,KAC3BC,YAAaT,EAAgBnB,KAAK4B,YAClCN,UAAWH,EAAgBnB,KAAKsB,UA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1
1
  {
2
2
  "name": "@esri/solution-group",
3
- "version": "1.1.5",
3
+ "version": "1.2.0",
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",
@@ -13,32 +13,32 @@
13
13
  "dist/**"
14
14
  ],
15
15
  "devDependencies": {
16
- "@esri/arcgis-rest-auth": "3.4.2",
17
- "@esri/arcgis-rest-feature-layer": "3.4.2",
18
- "@esri/arcgis-rest-portal": "3.4.2",
19
- "@esri/arcgis-rest-request": "3.4.2",
20
- "@esri/arcgis-rest-service-admin": "3.4.2",
21
- "@esri/hub-common": "9.2.0",
22
- "@esri/hub-initiatives": "9.2.0",
23
- "@esri/hub-sites": "9.2.0",
24
- "@esri/hub-teams": "9.2.0",
25
- "rollup": "^1.22.0",
26
- "typescript": "^4.3.4"
16
+ "@esri/arcgis-rest-auth": "3.4.3",
17
+ "@esri/arcgis-rest-feature-layer": "3.4.3",
18
+ "@esri/arcgis-rest-portal": "3.4.3",
19
+ "@esri/arcgis-rest-request": "3.4.3",
20
+ "@esri/arcgis-rest-service-admin": "3.4.3",
21
+ "@esri/hub-common": "9.7.2",
22
+ "@esri/hub-initiatives": "9.7.2",
23
+ "@esri/hub-sites": "9.7.2",
24
+ "@esri/hub-teams": "9.7.2",
25
+ "rollup": "^2.60.0",
26
+ "typescript": "^4.4.4"
27
27
  },
28
28
  "peerDependencies": {
29
- "@esri/arcgis-rest-auth": "3.4.2",
30
- "@esri/arcgis-rest-feature-layer": "3.4.2",
31
- "@esri/arcgis-rest-portal": "3.4.2",
32
- "@esri/arcgis-rest-request": "3.4.2",
33
- "@esri/arcgis-rest-service-admin": "3.4.2",
34
- "@esri/hub-common": "9.2.0",
35
- "@esri/hub-initiatives": "9.2.0",
36
- "@esri/hub-sites": "9.2.0",
37
- "@esri/hub-teams": "9.2.0"
29
+ "@esri/arcgis-rest-auth": "3.4.3",
30
+ "@esri/arcgis-rest-feature-layer": "3.4.3",
31
+ "@esri/arcgis-rest-portal": "3.4.3",
32
+ "@esri/arcgis-rest-request": "3.4.3",
33
+ "@esri/arcgis-rest-service-admin": "3.4.3",
34
+ "@esri/hub-common": "9.7.2",
35
+ "@esri/hub-initiatives": "9.7.2",
36
+ "@esri/hub-sites": "9.7.2",
37
+ "@esri/hub-teams": "9.7.2"
38
38
  },
39
39
  "dependencies": {
40
- "@esri/solution-common": "^1.1.5",
41
- "tslib": "^1.13.0"
40
+ "@esri/solution-common": "^1.2.0",
41
+ "tslib": "1.13.0"
42
42
  },
43
43
  "scripts": {
44
44
  "prepare": "npm run build",
@@ -90,5 +90,5 @@
90
90
  "esri",
91
91
  "ES6"
92
92
  ],
93
- "gitHead": "5eded4ac0bb6b2230ab572d602b38c69c8d6578f"
93
+ "gitHead": "70f706fb28a50db0b9b13030f263f8e9e270b98d"
94
94
  }