@esri/solution-deployer 1.2.0 → 1.3.2

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.
@@ -15,6 +15,13 @@
15
15
  */
16
16
  import * as common from "@esri/solution-common";
17
17
  export declare function deploySolutionFromTemplate(templateSolutionId: string, solutionTemplateBase: any, solutionTemplateData: any, authentication: common.UserSession, options: common.IDeploySolutionOptions): Promise<string>;
18
+ /**
19
+ * Add source-id to items/groups typeKeywords
20
+ *
21
+ * @param template the array of solution data templates
22
+ * @internal
23
+ */
24
+ export declare function _addSourceId(templates: common.IItemTemplate[]): common.IItemTemplate[];
18
25
  /**
19
26
  * Update the deployOptions with the group properties
20
27
  *
@@ -1,7 +1,7 @@
1
1
  /* @preserve
2
- * @esri/solution-deployer - v1.2.0 - Apache-2.0
3
- * Copyright (c) 2018-2021 Esri, Inc.
4
- * Thu Dec 09 2021 16:06:07 GMT-0800 (Pacific Standard Time)
2
+ * @esri/solution-deployer - v1.3.2 - Apache-2.0
3
+ * Copyright (c) 2018-2022 Esri, Inc.
4
+ * Thu Mar 03 2022 14:40:50 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.
@@ -868,7 +868,7 @@
868
868
  if (Array.isArray(userGroups)) {
869
869
  existingItemsDefs.push(Promise.resolve({
870
870
  results: userGroups
871
- .filter(g => g.tags.indexOf(`source-${template.itemId}`) > -1)
871
+ .filter(g => g.tags.indexOf(`source-${template.itemId}`) > -1 || g.typeKeywords.indexOf(`source-${template.itemId}`) > -1)
872
872
  .map(g => {
873
873
  g.type = "Group";
874
874
  return g;
@@ -1206,22 +1206,7 @@
1206
1206
  options.thumbnail = thumbnailFile;
1207
1207
  }
1208
1208
  // update template items with source-itemId type keyword
1209
- solutionTemplateData.templates = solutionTemplateData.templates.map((template) => {
1210
- const sourceId = "source-" + template.itemId;
1211
- /* istanbul ignore else */
1212
- if (template.item) {
1213
- /* istanbul ignore else */
1214
- if (template.item.typeKeywords) {
1215
- template.item.typeKeywords.push(sourceId);
1216
- }
1217
- /* istanbul ignore else */
1218
- if (template.item.tags &&
1219
- common__namespace.getProp(template, "item.type") === "Group") {
1220
- template.item.tags.push(sourceId);
1221
- }
1222
- }
1223
- return template;
1224
- });
1209
+ solutionTemplateData.templates = _addSourceId(solutionTemplateData.templates);
1225
1210
  templateDictionary.isPortal = portalResponse.isPortal;
1226
1211
  templateDictionary.organization = Object.assign(templateDictionary.organization || {}, portalResponse);
1227
1212
  // TODO: Add more computed properties here
@@ -1338,6 +1323,23 @@
1338
1323
  .then(() => resolve(solutionTemplateBase.id), reject);
1339
1324
  });
1340
1325
  }
1326
+ /**
1327
+ * Add source-id to items/groups typeKeywords
1328
+ *
1329
+ * @param template the array of solution data templates
1330
+ * @internal
1331
+ */
1332
+ function _addSourceId(templates) {
1333
+ return templates.map((template) => {
1334
+ /* istanbul ignore else */
1335
+ if (template.item) {
1336
+ const typeKeywords = template.item.typeKeywords || [];
1337
+ typeKeywords.push("source-" + template.itemId);
1338
+ template.item.typeKeywords = typeKeywords;
1339
+ }
1340
+ return template;
1341
+ });
1342
+ }
1341
1343
  /**
1342
1344
  * Update the deployOptions with the group properties
1343
1345
  *