apn-app-manager 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apn-app-manager",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "Appian App Manager",
5
5
  "license": "Apache-2.0",
6
6
  "preferGlobal": true,
@@ -122,6 +122,10 @@ function retrieveObjectMapCount(objectMaps, namespacesFilter) {
122
122
  } else {
123
123
  let countMatchingObjects = lodash.filter(objectMaps[key], function (objectMap) {
124
124
  let isMatch = false;
125
+ // Note that translation strings do not have names, additionally translation strings will NOT show up in the object count output in console
126
+ if (util.isBlank(objectMap["current"][obProps.fieldNames.NAME])) {
127
+ return true;
128
+ }
125
129
  for (const namespace of namespacesFilter) {
126
130
  if (util.doesNameMatchNamespace(objectMap["current"][obProps.fieldNames.NAME], namespace)) {
127
131
  isMatch = true;
@@ -25,7 +25,7 @@ module.exports = {
25
25
  function renameObjectMaps(objectMaps, uuidCollector, namespaceMap, options, usageType) {
26
26
  obProps.haulTypes.forEach(haulType => {
27
27
  objectMaps[haulType.haulName].forEach(function (objectMap, objectMapIndex) {
28
- let curNamespaceForObject = findNamespaceForObject(objectMap["current"][obProps.fieldNames.NAME], namespaceMap);
28
+ let curNamespaceForObject = findNamespaceForObject(objectMap, namespaceMap, haulType, objectMaps);
29
29
  if (Object.keys(namespaceMap).indexOf(curNamespaceForObject) < 0) {
30
30
  // Object will not be cloned
31
31
  objectMaps[haulType.haulName][objectMapIndex]["new"] = objectMap["current"];
@@ -36,8 +36,8 @@ function renameObjectMaps(objectMaps, uuidCollector, namespaceMap, options, usag
36
36
  }
37
37
  });
38
38
  } else {
39
- let newNamespaceForObject = namespaceMap[curNamespaceForObject]["newNamespace"];
40
39
  // Object will be cloned
40
+ let newNamespaceForObject = namespaceMap[curNamespaceForObject]["newNamespace"];
41
41
  objectMaps[haulType.haulName][objectMapIndex]["new"] = {};
42
42
  haulType.fields.forEach(haulField => {
43
43
  if (lodash.includes(haulField.usage, usageType)) {
@@ -142,7 +142,24 @@ function buildNamespaceReplacementRegex(curNamespace, newNamespace, regexTags) {
142
142
  }
143
143
 
144
144
  // Returns the namespace for an object
145
- function findNamespaceForObject(objectName, namespaceMap) {
145
+ function findNamespaceForObject(objectMap, namespaceMap, haulType, objectMaps) {
146
+ let objectName;
147
+ if (lodash.includes(haulType.obs, obProps.obTypes.TRANSLATIONSTRING)) {
148
+ // For translation strings, grab determine the namespace by its translation set name
149
+ let translationSetHaulType = lodash.filter(obProps.haulTypes, { obs: [obProps.obTypes.TRANSLATIONSET] })[0];
150
+ let translationSetObjectMaps = objectMaps[translationSetHaulType.haulName];
151
+ let translationSetObjectMapForThisString = lodash.filter(translationSetObjectMaps, function (ts) {
152
+ return ts["current"][obProps.fieldNames.UUID] == objectMap["current"][obProps.fieldNames.TRANSLATION_SET_UUID];
153
+ })[0];
154
+ objectName = translationSetObjectMapForThisString["current"][obProps.fieldNames.NAME];
155
+ } else {
156
+ objectName = objectMap["current"][obProps.fieldNames.NAME];
157
+ }
158
+ return findNamespaceForObjectByName(objectName, namespaceMap);
159
+ }
160
+
161
+ // Returns the namespace for an object by name
162
+ function findNamespaceForObjectByName(objectName, namespaceMap) {
146
163
  for (const namespace of util.sortNamespaces(Object.keys(namespaceMap)).reverse()) {
147
164
  if (util.doesNameMatchNamespace(objectName, namespace)) {
148
165
  return namespace;
@@ -19,6 +19,8 @@ const obTypes = {
19
19
  SITE: "site",
20
20
  PORTAL: "portal",
21
21
  WEBAPI: "webApi",
22
+ TRANSLATIONSET: "translationSet",
23
+ TRANSLATIONSTRING: "translationString",
22
24
  GROUP: "group",
23
25
  GROUPTYPE: "groupType",
24
26
  PROCESSMODELFOLDER: "processModelFolder",
@@ -57,6 +59,8 @@ const fieldNames = {
57
59
  RECORD_EVENTS_CONFIG_UUID: "recordEventsConfigUuid",
58
60
  DOCUMENT_EXTENSION: "documentExtension",
59
61
  DOCUMENT_RAW_NAME: "documentRawName",
62
+ TRANSLATION_SET_UUID: "translationSetUuid",
63
+ TRANSLATOR_NOTE: "translatorNotes",
60
64
  };
61
65
 
62
66
  const xmlNamespaces = {
@@ -400,7 +404,7 @@ const haulTypes = [
400
404
  },
401
405
  {
402
406
  haulName: "Reports, Sites, Portals, and Web APIs",
403
- obs: [obTypes.REPORT, obTypes.SITE, obTypes.WEBAPI, obTypes.PORTAL],
407
+ obs: [obTypes.REPORT, obTypes.SITE, obTypes.PORTAL, obTypes.WEBAPI],
404
408
  fields: [
405
409
  {
406
410
  fieldName: fieldNames.UUID,
@@ -442,7 +446,90 @@ const haulTypes = [
442
446
  },
443
447
  {
444
448
  fieldName: fieldNames.PAGE_UUIDS,
445
- xpath: `siteHaul/site/page/@a:uuid | portalHaul/portal/navigationNode/@a:uuid`,
449
+ xpath: `siteHaul/site//page/@a:uuid | portalHaul/portal/navigationNode/@a:uuid`,
450
+ type: propTypes.UUID,
451
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
452
+ isArray: true,
453
+ },
454
+ ],
455
+ },
456
+ {
457
+ haulName: "Translation Sets",
458
+ obs: [obTypes.TRANSLATIONSET],
459
+ fields: [
460
+ {
461
+ fieldName: fieldNames.UUID,
462
+ xpath: `{OBTYPE}Haul/{OBTYPE}/@a:uuid`,
463
+ type: propTypes.UUID,
464
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
465
+ },
466
+ {
467
+ fieldName: fieldNames.NAME,
468
+ xpath: `{OBTYPE}Haul/{OBTYPE}/@name`,
469
+ type: propTypes.NAME,
470
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
471
+ },
472
+ {
473
+ fieldName: fieldNames.DESCRIPTION,
474
+ xpath: `{OBTYPE}Haul/{OBTYPE}/*[local-name()='description']/node()`,
475
+ type: propTypes.TEXT,
476
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
477
+ replaceFormat: "description>{VALUE}</",
478
+ },
479
+ {
480
+ fieldName: fieldNames.VERSION,
481
+ xpath: `{OBTYPE}Haul/versionUuid/node()`,
482
+ type: propTypes.UUID,
483
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
484
+ },
485
+ {
486
+ fieldName: fieldNames.HISTORY_UUIDS,
487
+ xpath: `{OBTYPE}Haul/history/historyInfo/@versionUuid`,
488
+ type: propTypes.UUID,
489
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
490
+ isArray: true,
491
+ },
492
+ ],
493
+ },
494
+ {
495
+ haulName: "Translation Strings",
496
+ obs: [obTypes.TRANSLATIONSTRING],
497
+ fields: [
498
+ {
499
+ fieldName: fieldNames.UUID,
500
+ xpath: `{OBTYPE}Haul/{OBTYPE}/@a:uuid`,
501
+ type: propTypes.UUID,
502
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
503
+ },
504
+ {
505
+ fieldName: fieldNames.TRANSLATION_SET_UUID,
506
+ xpath: `{OBTYPE}Haul/{OBTYPE}/*[local-name()='translationSetUuid']/node()`,
507
+ type: propTypes.UUID,
508
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
509
+ },
510
+ {
511
+ fieldName: fieldNames.DESCRIPTION,
512
+ xpath: `{OBTYPE}Haul/{OBTYPE}/*[local-name()='description']/node()`,
513
+ type: propTypes.TEXT,
514
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
515
+ replaceFormat: "description>{VALUE}</",
516
+ },
517
+ {
518
+ fieldName: fieldNames.TRANSLATOR_NOTE,
519
+ xpath: `{OBTYPE}Haul/{OBTYPE}/*[local-name()='translatorNotes']/node()`,
520
+ type: propTypes.TEXT,
521
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
522
+ replaceFormat: "translatorNotes>{VALUE}</",
523
+ },
524
+ {
525
+ fieldName: fieldNames.VERSION,
526
+ xpath: `{OBTYPE}Haul/versionUuid/node()`,
527
+ type: propTypes.UUID,
528
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
529
+ },
530
+ {
531
+ fieldName: fieldNames.HISTORY_UUIDS,
532
+ xpath: `{OBTYPE}Haul/history/historyInfo/@versionUuid`,
446
533
  type: propTypes.UUID,
447
534
  usage: [usageTypes.CLONE, usageTypes.BUILD],
448
535
  isArray: true,