apn-app-manager 2.2.1 → 2.3.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/README.md CHANGED
@@ -12,7 +12,7 @@ The functionality provided by this tool is not supported, nor endorsed by Appian
12
12
 
13
13
  Importing an application export modified by this tool should be done at your own discretion.
14
14
 
15
- Latest compatible Appian platform version tested against: **25.3**.
15
+ Latest compatible Appian platform version tested against: **26.3**.
16
16
 
17
17
  ## Installation
18
18
 
@@ -76,6 +76,7 @@ Used to duplicate all objects of an application, which replaces the namespace of
76
76
  - `not-cloned-uuids.json` - Warnings may appear during cloning about UUIDs in the package that the tool didn't know how to handle, which will be listed in this file. If no warnings appeared, this file will be empty. Generally these can be ignored if your inspection looks good, or if your application code has other UUIDs which are unrelated to Appian design objects. However these may be actual issues that come up due to XML structure changes in future Appian platform releases. Please reach out to the authors of this tool if you have any further questions.
77
77
  - `namespaces.json` - This contains a mapping of old-to-new namespaces used when cloning.
78
78
  - `problem-terms.json` - Only output if problem terms were identified. This contains a mapping of problem words, where they were found, and what decision was made for them.
79
+ - `unknown-object-types.json` - This contains new design objects that the tool has not been updated for yet. These objects won't be cloned until a compatible update to the tool is made and released.
79
80
  - `options.json` - This contains the options chosen (or used by default) when cloning.
80
81
  - `composer/` - This directory contains a JSON file for each application which has "Composer/Requirements/Plan" of the `requirementsCaptureB64` node in JSON format.
81
82
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apn-app-manager",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
@@ -37,6 +37,7 @@ const defaultContext = {
37
37
  let context;
38
38
  const objectMaps = {};
39
39
  const uuidCollector = {};
40
+ let unknownCollector = [];
40
41
  const skippedObjectCount = {};
41
42
 
42
43
  // Entry-point
@@ -47,6 +48,7 @@ function main(inputContext) {
47
48
  createValidContext(inputContext);
48
49
  Object.keys(objectMaps).forEach(key => delete objectMaps[key]);
49
50
  uuidCollector.uuids = [];
51
+ unknownCollector = [];
50
52
  skippedObjectCount.skipped = 0;
51
53
  util.delFile(cons.outDir);
52
54
 
@@ -131,7 +133,7 @@ function promptNamespaceMapAndOptions() {
131
133
  util.unzipDir(context.appZipPath, cons.tempDir);
132
134
 
133
135
  // Second, run extraction
134
- obExtract.buildObjectMaps(objectMaps, uuidCollector, context.namespaceMap, cons.tempDir, obProps.usageTypes.CLONE);
136
+ obExtract.buildObjectMaps(objectMaps, uuidCollector, context.namespaceMap, unknownCollector, cons.tempDir, obProps.usageTypes.CLONE);
135
137
 
136
138
  // Third, prompt for namespaces
137
139
  if (context.contextAlreadyProvided) {
@@ -195,6 +197,7 @@ function executeClone() {
195
197
  util.writeJson(path.resolve(cons.debugDir, `client-info.json`), util.clientInfo());
196
198
  util.writeJson(path.resolve(cons.debugDir, `objects.json`), objectMaps);
197
199
  util.writeJson(path.resolve(cons.debugDir, `not-cloned-uuids.json`), uuidCollector);
200
+ util.writeJson(path.resolve(cons.debugDir, `unknown-object-types.json`), unknownCollector);
198
201
  util.writeJson(path.resolve(cons.debugDir, `namespaces.json`), context.namespaceMap);
199
202
  util.writeJson(path.resolve(cons.debugDir, `options.json`), context.options);
200
203
  util.writeJson(path.resolve(cons.debugDir, `problem-terms.json`), context.problemWordMaps);
@@ -13,13 +13,13 @@ const { split } = require("lodash");
13
13
  // Exports
14
14
  module.exports = {
15
15
  // Builds the objectMaps object from the application
16
- buildObjectMaps: function (objectMaps, uuidCollector, namespaceCollector, appDir, usageType) {
16
+ buildObjectMaps: function (objectMaps, uuidCollector, namespaceCollector, unknownCollector, appDir, usageType) {
17
17
  specialHandler.updateFilesForExtract(appDir);
18
18
  let fileCount = { count: 0 };
19
19
  initObjectMaps(objectMaps);
20
20
  // Extract the name, uuid, etc. from each object file
21
21
  util.handleDirFiles(appDir, ["xml", "xsd"], 2, 2, function (obPath) {
22
- extractObProps(objectMaps, uuidCollector, namespaceCollector, fileCount, obPath, usageType);
22
+ extractObProps(objectMaps, uuidCollector, namespaceCollector, unknownCollector, fileCount, obPath, usageType);
23
23
  });
24
24
  // Set the datatype UUIDs from their name & namespace
25
25
  updateDatatypeUuids(objectMaps);
@@ -55,7 +55,7 @@ function initObjectMaps(objectMaps) {
55
55
  }
56
56
 
57
57
  // Extracts the name, uuid, etc. from a single object file
58
- function extractObProps(objectMaps, uuidCollector, namespaceCollector, fileCount, obPath, usageType) {
58
+ function extractObProps(objectMaps, uuidCollector, namespaceCollector, unknownCollector, fileCount, obPath, usageType) {
59
59
  fileCount.count = fileCount.count + 1;
60
60
  const obType = util.getFolderName(obPath);
61
61
  let isParsed = false;
@@ -98,6 +98,7 @@ function extractObProps(objectMaps, uuidCollector, namespaceCollector, fileCount
98
98
  // Unknown file type
99
99
  if (!isParsed) {
100
100
  util.printWarning(`WARNING: Unknown object type in package: ${obType}/${path.basename(obPath)}`);
101
+ unknownCollector.push({ type: obType, file: path.basename(obPath) });
101
102
  }
102
103
  }
103
104
 
@@ -159,7 +160,8 @@ function extractObjectPropertyJsonPath(haulField, object) {
159
160
  if (util.isBlank(haulField.jsonPath)) {
160
161
  return object;
161
162
  }
162
- return jp.query(JSON.parse(object), haulField.jsonPath);
163
+ let result = jp.query(JSON.parse(object), haulField.jsonPath);
164
+ return haulField.isArray ? result : result[0];
163
165
  }
164
166
 
165
167
  // Does the extractRegex logic of a haul field that requires regex
@@ -37,6 +37,9 @@ const obTypes = {
37
37
  PROCESSMODELFOLDER: "processModelFolder",
38
38
  CONNECTEDSYSTEM: "connectedSystem",
39
39
  AISKILL: "aiSkill",
40
+ AIAGENT: "aiAgent",
41
+ PHQREPORT: "report",
42
+ PHQDASHBOARD: "dashboard",
40
43
  CONTENT: "content", // obTypes.CONTENT contains: [rule, document, rulesFolder, constant, folder, communityKnowledgeCenter, decision, outboundIntegration, report (process report)]
41
44
  };
42
45
 
@@ -48,6 +51,11 @@ const fieldNames = {
48
51
  VERSION: "version",
49
52
  CACHE_VERSION: "cacheVersionKey",
50
53
  MODEL_IDS: "modelIds",
54
+ AGENT_VERSION: "agentVersion",
55
+ VARIABLE_IDS: "variableIds",
56
+ TOOL_IDS: "toolIds",
57
+ TEST_CASE_IDS: "testCaseIds",
58
+ TEST_CASE_VARIABLE_IDS: "testCaseVariableIds",
51
59
  HISTORY_UUIDS: "historyUuids",
52
60
  CDT_NAMESPACE: "cdtNamespace",
53
61
  CDT_UUID_ENCODED: "cdtUuidEncoded",
@@ -85,6 +93,10 @@ const fieldNames = {
85
93
  REQS_ACTIVITY_UUIDS: "composerReqsActivityUuids",
86
94
  REQS_STEP_UUIDS: "composerReqsStepUuids",
87
95
  REQS_ACTION_UUIDS: "composerReqsActionUuids",
96
+ REQS_UX_SCREEN_UUIDS: "composerReqsUxScreenUuids",
97
+ PHQ_REPORT_COLUMN_UUIDS: "phqReportColumnUuids",
98
+ PHQ_DASHBOARD_FILTER_UUIDS: "phqDashboardFilterUuids",
99
+ PHQ_DASHBOARD_FILTER_CONFIGURATION_UUIDS: "phqDashboardFilterConfigurationUuids",
88
100
  };
89
101
 
90
102
  const xmlNamespaces = {
@@ -518,6 +530,15 @@ const haulTypes = [
518
530
  usage: [usageTypes.CLONE, usageTypes.BUILD],
519
531
  isArray: true,
520
532
  },
533
+ {
534
+ fieldName: fieldNames.REQS_UX_SCREEN_UUIDS,
535
+ xpath: `applicationHaul/requirementsCaptureB64/node()`,
536
+ jsonPath: `$.content.uxScreens[*].uuid`,
537
+ type: propTypes.UUID,
538
+ forceUuidFormat: true,
539
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
540
+ isArray: true,
541
+ },
521
542
  ],
522
543
  },
523
544
  {
@@ -674,51 +695,128 @@ const haulTypes = [
674
695
  fields: [
675
696
  {
676
697
  fieldName: fieldNames.UUID,
677
- xpath: `aiSkillRemoteHaul/*[contains(name(), '')]/uuid/node()`,
698
+ xpath: `aiSkillRemoteHaul/remoteDesignObject/uuid/node()`,
678
699
  type: propTypes.UUID,
679
700
  forceUuidFormat: true,
680
701
  usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
681
702
  },
682
703
  {
683
704
  fieldName: fieldNames.NAME,
684
- xpath: `aiSkillRemoteHaul/*[contains(name(), '')]/name/node()`,
705
+ xpath: `aiSkillRemoteHaul/remoteDesignObject/name/node()`,
685
706
  type: propTypes.NAME,
686
707
  usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
687
708
  },
688
709
  {
689
710
  fieldName: fieldNames.DESCRIPTION,
690
- xpath: `aiSkillRemoteHaul/*[contains(name(), '')]/description/node()`,
711
+ xpath: `aiSkillRemoteHaul/remoteDesignObject/description/node()`,
691
712
  type: propTypes.TEXT,
692
713
  usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
693
714
  replaceFormat: "description>{VALUE}</",
694
715
  },
695
716
  {
696
- fieldName: fieldNames.INPUT_DESCRIPTION,
697
- xpath: `aiSkillRemoteHaul/*[contains(name(), '')]/namedTypedValue/description/node()`,
717
+ fieldName: fieldNames.VERSION,
718
+ xpath: `aiSkillRemoteHaul/versionUuid/node()`,
719
+ type: propTypes.UUID,
720
+ forceUuidFormat: true,
721
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
722
+ },
723
+ {
724
+ fieldName: fieldNames.HISTORY_UUIDS,
725
+ xpath: `aiSkillRemoteHaul/history/historyInfo/@versionUuid`,
726
+ type: propTypes.UUID,
727
+ forceUuidFormat: true,
728
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
729
+ isArray: true,
730
+ },
731
+ {
732
+ fieldName: fieldNames.MODEL_IDS,
733
+ xpath: `aiSkillRemoteHaul/remoteDesignObject/content/node()`,
734
+ jsonPath: `$.models[*].id`,
735
+ type: propTypes.UUID,
736
+ forceUuidFormat: true,
737
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
738
+ isArray: true,
739
+ },
740
+ ],
741
+ },
742
+ {
743
+ haulName: "AI Agents",
744
+ obs: [obTypes.AIAGENT],
745
+ fields: [
746
+ {
747
+ fieldName: fieldNames.UUID,
748
+ xpath: `aiAgentRemoteHaul/remoteDesignObject/uuid/node()`,
749
+ type: propTypes.UUID,
750
+ forceUuidFormat: true,
751
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
752
+ },
753
+ {
754
+ fieldName: fieldNames.NAME,
755
+ xpath: `aiAgentRemoteHaul/remoteDesignObject/name/node()`,
756
+ type: propTypes.NAME,
757
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
758
+ },
759
+ {
760
+ fieldName: fieldNames.DESCRIPTION,
761
+ xpath: `aiAgentRemoteHaul/remoteDesignObject/description/node()`,
698
762
  type: propTypes.TEXT,
699
763
  usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
700
764
  replaceFormat: "description>{VALUE}</",
701
- isArray: true,
702
765
  },
703
766
  {
704
767
  fieldName: fieldNames.VERSION,
705
- xpath: `aiSkillRemoteHaul/versionUuid/node()`,
768
+ xpath: `aiAgentRemoteHaul/versionUuid/node()`,
706
769
  type: propTypes.UUID,
707
770
  forceUuidFormat: true,
708
771
  usage: [usageTypes.CLONE, usageTypes.BUILD],
709
772
  },
710
773
  {
711
774
  fieldName: fieldNames.HISTORY_UUIDS,
712
- xpath: `aiSkillRemoteHaul/history/historyInfo/@versionUuid`,
775
+ xpath: `aiAgentRemoteHaul/history/historyInfo/@versionUuid`,
713
776
  type: propTypes.UUID,
714
777
  forceUuidFormat: true,
715
778
  usage: [usageTypes.CLONE, usageTypes.BUILD],
716
779
  isArray: true,
717
780
  },
718
781
  {
719
- fieldName: fieldNames.MODEL_IDS,
720
- xpath: `aiSkillRemoteHaul/*[contains(name(), '')]/content/node()`,
721
- extractRegex: /(?<="models":.*"id":")[A-Za-z0-9-_]{10,}[0-9][A-Za-z0-9-_]{1,}-[A-Za-z0-9-_]{10,}(?=")/g,
782
+ fieldName: fieldNames.AGENT_VERSION,
783
+ xpath: `aiAgentRemoteHaul/remoteDesignObject/content/node()`,
784
+ jsonPath: `$.agentVersion`,
785
+ type: propTypes.UUID,
786
+ forceUuidFormat: true,
787
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
788
+ },
789
+ {
790
+ fieldName: fieldNames.VARIABLE_IDS,
791
+ xpath: `aiAgentRemoteHaul/remoteDesignObject/content/node()`,
792
+ jsonPath: `$.variables[*].id`,
793
+ type: propTypes.UUID,
794
+ forceUuidFormat: true,
795
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
796
+ isArray: true,
797
+ },
798
+ {
799
+ fieldName: fieldNames.TOOL_IDS,
800
+ xpath: `aiAgentRemoteHaul/remoteDesignObject/content/node()`,
801
+ jsonPath: `$.tools[*].toolId`,
802
+ type: propTypes.UUID,
803
+ forceUuidFormat: true,
804
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
805
+ isArray: true,
806
+ },
807
+ {
808
+ fieldName: fieldNames.TEST_CASE_IDS,
809
+ xpath: `aiAgentRemoteHaul/remoteDesignObject/content/node()`,
810
+ jsonPath: `$.testCases[*].id`,
811
+ type: propTypes.UUID,
812
+ forceUuidFormat: true,
813
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
814
+ isArray: true,
815
+ },
816
+ {
817
+ fieldName: fieldNames.TEST_CASE_VARIABLE_IDS,
818
+ xpath: `aiAgentRemoteHaul/remoteDesignObject/content/node()`,
819
+ jsonPath: `$.testCases[*].variables[*].id`,
722
820
  type: propTypes.UUID,
723
821
  forceUuidFormat: true,
724
822
  usage: [usageTypes.CLONE, usageTypes.BUILD],
@@ -815,6 +913,113 @@ const haulTypes = [
815
913
  },
816
914
  ],
817
915
  },
916
+ {
917
+ haulName: "PHQ Reports",
918
+ obs: [obTypes.PHQREPORT],
919
+ fields: [
920
+ {
921
+ fieldName: fieldNames.UUID,
922
+ xpath: `reportHaul/report/@a:uuid`,
923
+ type: propTypes.UUID,
924
+ forceUuidFormat: true,
925
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
926
+ },
927
+ {
928
+ fieldName: fieldNames.NAME,
929
+ xpath: `reportHaul/report/@name`,
930
+ type: propTypes.NAME,
931
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
932
+ },
933
+ {
934
+ fieldName: fieldNames.DESCRIPTION,
935
+ xpath: `reportHaul/report/description/node()`,
936
+ type: propTypes.TEXT,
937
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
938
+ replaceFormat: "description>{VALUE}</",
939
+ },
940
+ {
941
+ fieldName: fieldNames.VERSION,
942
+ xpath: `reportHaul/versionUuid/node()`,
943
+ type: propTypes.UUID,
944
+ forceUuidFormat: true,
945
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
946
+ },
947
+ {
948
+ fieldName: fieldNames.HISTORY_UUIDS,
949
+ xpath: `reportHaul/history/historyInfo/@versionUuid`,
950
+ type: propTypes.UUID,
951
+ forceUuidFormat: true,
952
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
953
+ isArray: true,
954
+ },
955
+ {
956
+ fieldName: fieldNames.PHQ_REPORT_COLUMN_UUIDS,
957
+ xpath: `reportHaul/report/configJson/node()`,
958
+ jsonPath: `$.columns[*].columnUuid`,
959
+ type: propTypes.UUID,
960
+ forceUuidFormat: true,
961
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
962
+ isArray: true,
963
+ },
964
+ ],
965
+ },
966
+ {
967
+ haulName: "PHQ Dashboards",
968
+ obs: [obTypes.PHQDASHBOARD],
969
+ fields: [
970
+ {
971
+ fieldName: fieldNames.UUID,
972
+ xpath: `dashboardHaul/dashboard/@a:uuid`,
973
+ type: propTypes.UUID,
974
+ forceUuidFormat: true,
975
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
976
+ },
977
+ {
978
+ fieldName: fieldNames.NAME,
979
+ xpath: `dashboardHaul/dashboard/@name`,
980
+ type: propTypes.NAME,
981
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
982
+ },
983
+ {
984
+ fieldName: fieldNames.DESCRIPTION,
985
+ xpath: `dashboardHaul/dashboard/description/node()`,
986
+ type: propTypes.TEXT,
987
+ usage: [usageTypes.CLONE, usageTypes.BUILD, usageTypes.RENAME],
988
+ replaceFormat: "description>{VALUE}</",
989
+ },
990
+ {
991
+ fieldName: fieldNames.VERSION,
992
+ xpath: `dashboardHaul/versionUuid/node()`,
993
+ type: propTypes.UUID,
994
+ forceUuidFormat: true,
995
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
996
+ },
997
+ {
998
+ fieldName: fieldNames.HISTORY_UUIDS,
999
+ xpath: `dashboardHaul/history/historyInfo/@versionUuid`,
1000
+ type: propTypes.UUID,
1001
+ forceUuidFormat: true,
1002
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
1003
+ isArray: true,
1004
+ },
1005
+ {
1006
+ fieldName: fieldNames.PHQ_DASHBOARD_FILTER_UUIDS,
1007
+ xpath: `dashboardHaul/dashboard/filters/filter/@a:uuid`,
1008
+ type: propTypes.UUID,
1009
+ forceUuidFormat: true,
1010
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
1011
+ isArray: true,
1012
+ },
1013
+ {
1014
+ fieldName: fieldNames.PHQ_DASHBOARD_FILTER_CONFIGURATION_UUIDS,
1015
+ xpath: `dashboardHaul/dashboard/filters/filter/configurations/configuration/@a:uuid`,
1016
+ type: propTypes.UUID,
1017
+ forceUuidFormat: true,
1018
+ usage: [usageTypes.CLONE, usageTypes.BUILD],
1019
+ isArray: true,
1020
+ },
1021
+ ],
1022
+ },
818
1023
  {
819
1024
  haulName: "Everything Else",
820
1025
  obs: [obTypes.GROUP, obTypes.GROUPTYPE, obTypes.PROCESSMODELFOLDER, obTypes.CONNECTEDSYSTEM, obTypes.CONTENT],