@transcend-io/cli 6.8.0 → 6.10.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.
Files changed (175) hide show
  1. package/README.md +96 -12
  2. package/build/cli-request-upload.js +1 -1
  3. package/build/cli-request-upload.js.map +1 -1
  4. package/build/cli-upload-consent-preferences.js +2 -2
  5. package/build/cli-upload-consent-preferences.js.map +1 -1
  6. package/build/cli-upload-preferences.d.ts +3 -0
  7. package/build/cli-upload-preferences.d.ts.map +1 -0
  8. package/build/cli-upload-preferences.js +79 -0
  9. package/build/cli-upload-preferences.js.map +1 -0
  10. package/build/codecs.d.ts +1824 -4
  11. package/build/codecs.d.ts.map +1 -1
  12. package/build/codecs.js +232 -2
  13. package/build/codecs.js.map +1 -1
  14. package/build/consent-manager/index.d.ts +1 -0
  15. package/build/consent-manager/index.d.ts.map +1 -1
  16. package/build/consent-manager/index.js +1 -0
  17. package/build/consent-manager/index.js.map +1 -1
  18. package/build/consent-manager/{uploadConsentPreferences.d.ts → uploadConsents.d.ts} +2 -2
  19. package/build/consent-manager/uploadConsents.d.ts.map +1 -0
  20. package/build/consent-manager/{uploadConsentPreferences.js → uploadConsents.js} +4 -4
  21. package/build/consent-manager/uploadConsents.js.map +1 -0
  22. package/build/constants.d.ts.map +1 -1
  23. package/build/constants.js +6 -0
  24. package/build/constants.js.map +1 -1
  25. package/build/enums.d.ts +3 -1
  26. package/build/enums.d.ts.map +1 -1
  27. package/build/enums.js +2 -0
  28. package/build/enums.js.map +1 -1
  29. package/build/graphql/createSombraGotInstance.d.ts.map +1 -1
  30. package/build/graphql/createSombraGotInstance.js.map +1 -1
  31. package/build/graphql/fetchAllAssessmentTemplates.d.ts +44 -0
  32. package/build/graphql/fetchAllAssessmentTemplates.d.ts.map +1 -0
  33. package/build/graphql/fetchAllAssessmentTemplates.js +31 -0
  34. package/build/graphql/fetchAllAssessmentTemplates.js.map +1 -0
  35. package/build/graphql/fetchAllAssessments.d.ts +309 -0
  36. package/build/graphql/fetchAllAssessments.d.ts.map +1 -0
  37. package/build/graphql/fetchAllAssessments.js +32 -0
  38. package/build/graphql/fetchAllAssessments.js.map +1 -0
  39. package/build/graphql/fetchAllPreferenceTopics.d.ts +28 -0
  40. package/build/graphql/fetchAllPreferenceTopics.d.ts.map +1 -0
  41. package/build/graphql/fetchAllPreferenceTopics.js +32 -0
  42. package/build/graphql/fetchAllPreferenceTopics.js.map +1 -0
  43. package/build/graphql/fetchAllPurposes.d.ts +25 -0
  44. package/build/graphql/fetchAllPurposes.d.ts.map +1 -0
  45. package/build/graphql/fetchAllPurposes.js +36 -0
  46. package/build/graphql/fetchAllPurposes.js.map +1 -0
  47. package/build/graphql/fetchAllRequestIdentifiers.d.ts +2 -2
  48. package/build/graphql/fetchConsentManagerId.d.ts +0 -7
  49. package/build/graphql/fetchConsentManagerId.d.ts.map +1 -1
  50. package/build/graphql/fetchConsentManagerId.js +1 -12
  51. package/build/graphql/fetchConsentManagerId.js.map +1 -1
  52. package/build/graphql/gqls/assessment.d.ts +3 -0
  53. package/build/graphql/gqls/assessment.d.ts.map +1 -0
  54. package/build/graphql/gqls/assessment.js +287 -0
  55. package/build/graphql/gqls/assessment.js.map +1 -0
  56. package/build/graphql/gqls/assessmentTemplate.d.ts +2 -0
  57. package/build/graphql/gqls/assessmentTemplate.d.ts.map +1 -0
  58. package/build/graphql/gqls/assessmentTemplate.js +70 -0
  59. package/build/graphql/gqls/assessmentTemplate.js.map +1 -0
  60. package/build/graphql/gqls/consentManager.d.ts +0 -1
  61. package/build/graphql/gqls/consentManager.d.ts.map +1 -1
  62. package/build/graphql/gqls/consentManager.js +1 -12
  63. package/build/graphql/gqls/consentManager.js.map +1 -1
  64. package/build/graphql/gqls/index.d.ts +4 -0
  65. package/build/graphql/gqls/index.d.ts.map +1 -1
  66. package/build/graphql/gqls/index.js +4 -0
  67. package/build/graphql/gqls/index.js.map +1 -1
  68. package/build/graphql/gqls/preferenceTopic.d.ts +2 -0
  69. package/build/graphql/gqls/preferenceTopic.d.ts.map +1 -0
  70. package/build/graphql/gqls/preferenceTopic.js +33 -0
  71. package/build/graphql/gqls/preferenceTopic.js.map +1 -0
  72. package/build/graphql/gqls/purpose.d.ts +2 -0
  73. package/build/graphql/gqls/purpose.d.ts.map +1 -0
  74. package/build/graphql/gqls/purpose.js +35 -0
  75. package/build/graphql/gqls/purpose.js.map +1 -0
  76. package/build/graphql/index.d.ts +6 -0
  77. package/build/graphql/index.d.ts.map +1 -1
  78. package/build/graphql/index.js +6 -0
  79. package/build/graphql/index.js.map +1 -1
  80. package/build/graphql/parseAssessmentDisplayLogic.d.ts +56 -0
  81. package/build/graphql/parseAssessmentDisplayLogic.d.ts.map +1 -0
  82. package/build/graphql/parseAssessmentDisplayLogic.js +62 -0
  83. package/build/graphql/parseAssessmentDisplayLogic.js.map +1 -0
  84. package/build/graphql/parseAssessmentRiskLogic.d.ts +27 -0
  85. package/build/graphql/parseAssessmentRiskLogic.d.ts.map +1 -0
  86. package/build/graphql/parseAssessmentRiskLogic.js +51 -0
  87. package/build/graphql/parseAssessmentRiskLogic.js.map +1 -0
  88. package/build/graphql/pullTranscendConfiguration.d.ts.map +1 -1
  89. package/build/graphql/pullTranscendConfiguration.js +220 -1
  90. package/build/graphql/pullTranscendConfiguration.js.map +1 -1
  91. package/build/graphql/syncConsentManager.js +2 -1
  92. package/build/graphql/syncConsentManager.js.map +1 -1
  93. package/build/graphql/syncCookies.js +1 -1
  94. package/build/graphql/syncCookies.js.map +1 -1
  95. package/build/graphql/syncDataFlows.js +2 -2
  96. package/build/graphql/syncDataFlows.js.map +1 -1
  97. package/build/preference-management/checkIfPendingPreferenceUpdatesAreNoOp.d.ts +19 -0
  98. package/build/preference-management/checkIfPendingPreferenceUpdatesAreNoOp.d.ts.map +1 -0
  99. package/build/preference-management/checkIfPendingPreferenceUpdatesAreNoOp.js +56 -0
  100. package/build/preference-management/checkIfPendingPreferenceUpdatesAreNoOp.js.map +1 -0
  101. package/build/preference-management/checkIfPendingPreferenceUpdatesCauseConflict.d.ts +20 -0
  102. package/build/preference-management/checkIfPendingPreferenceUpdatesCauseConflict.d.ts.map +1 -0
  103. package/build/preference-management/checkIfPendingPreferenceUpdatesCauseConflict.js +58 -0
  104. package/build/preference-management/checkIfPendingPreferenceUpdatesCauseConflict.js.map +1 -0
  105. package/build/preference-management/codecs.d.ts +369 -0
  106. package/build/preference-management/codecs.d.ts.map +1 -0
  107. package/build/preference-management/codecs.js +122 -0
  108. package/build/preference-management/codecs.js.map +1 -0
  109. package/build/preference-management/getPreferenceUpdatesFromRow.d.ts +37 -0
  110. package/build/preference-management/getPreferenceUpdatesFromRow.d.ts.map +1 -0
  111. package/build/preference-management/getPreferenceUpdatesFromRow.js +144 -0
  112. package/build/preference-management/getPreferenceUpdatesFromRow.js.map +1 -0
  113. package/build/preference-management/getPreferencesForIdentifiers.d.ts +21 -0
  114. package/build/preference-management/getPreferencesForIdentifiers.d.ts.map +1 -0
  115. package/build/preference-management/getPreferencesForIdentifiers.js +113 -0
  116. package/build/preference-management/getPreferencesForIdentifiers.js.map +1 -0
  117. package/build/preference-management/index.d.ts +12 -0
  118. package/build/preference-management/index.d.ts.map +1 -0
  119. package/build/preference-management/index.js +28 -0
  120. package/build/preference-management/index.js.map +1 -0
  121. package/build/preference-management/parsePreferenceAndPurposeValuesFromCsv.d.ts +17 -0
  122. package/build/preference-management/parsePreferenceAndPurposeValuesFromCsv.d.ts.map +1 -0
  123. package/build/preference-management/parsePreferenceAndPurposeValuesFromCsv.js +86 -0
  124. package/build/preference-management/parsePreferenceAndPurposeValuesFromCsv.js.map +1 -0
  125. package/build/preference-management/parsePreferenceIdentifiersFromCsv.d.ts +18 -0
  126. package/build/preference-management/parsePreferenceIdentifiersFromCsv.d.ts.map +1 -0
  127. package/build/preference-management/parsePreferenceIdentifiersFromCsv.js +97 -0
  128. package/build/preference-management/parsePreferenceIdentifiersFromCsv.js.map +1 -0
  129. package/build/preference-management/parsePreferenceManagementCsv.d.ts +25 -0
  130. package/build/preference-management/parsePreferenceManagementCsv.d.ts.map +1 -0
  131. package/build/preference-management/parsePreferenceManagementCsv.js +145 -0
  132. package/build/preference-management/parsePreferenceManagementCsv.js.map +1 -0
  133. package/build/preference-management/parsePreferenceTimestampsFromCsv.d.ts +16 -0
  134. package/build/preference-management/parsePreferenceTimestampsFromCsv.d.ts.map +1 -0
  135. package/build/preference-management/parsePreferenceTimestampsFromCsv.js +65 -0
  136. package/build/preference-management/parsePreferenceTimestampsFromCsv.js.map +1 -0
  137. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesAreNoOp.test.d.ts +2 -0
  138. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesAreNoOp.test.d.ts.map +1 -0
  139. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesAreNoOp.test.js +408 -0
  140. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesAreNoOp.test.js.map +1 -0
  141. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesCauseConflict.test.d.ts +2 -0
  142. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesCauseConflict.test.d.ts.map +1 -0
  143. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesCauseConflict.test.js +428 -0
  144. package/build/preference-management/tests/checkIfPendingPreferenceUpdatesCauseConflict.test.js.map +1 -0
  145. package/build/preference-management/tests/getPreferenceUpdatesFromRow.test.d.ts +2 -0
  146. package/build/preference-management/tests/getPreferenceUpdatesFromRow.test.d.ts.map +1 -0
  147. package/build/preference-management/tests/getPreferenceUpdatesFromRow.test.js +549 -0
  148. package/build/preference-management/tests/getPreferenceUpdatesFromRow.test.js.map +1 -0
  149. package/build/preference-management/uploadPreferenceManagementPreferencesInteractive.d.ts +33 -0
  150. package/build/preference-management/uploadPreferenceManagementPreferencesInteractive.d.ts.map +1 -0
  151. package/build/preference-management/uploadPreferenceManagementPreferencesInteractive.js +166 -0
  152. package/build/preference-management/uploadPreferenceManagementPreferencesInteractive.js.map +1 -0
  153. package/build/requests/approvePrivacyRequests.d.ts.map +1 -1
  154. package/build/requests/approvePrivacyRequests.js +15 -4
  155. package/build/requests/approvePrivacyRequests.js.map +1 -1
  156. package/build/requests/bulkRestartRequests.js +2 -2
  157. package/build/requests/bulkRestartRequests.js.map +1 -1
  158. package/build/requests/mapColumnsToAttributes.d.ts.map +1 -1
  159. package/build/requests/mapColumnsToAttributes.js +1 -3
  160. package/build/requests/mapColumnsToAttributes.js.map +1 -1
  161. package/build/requests/mapColumnsToIdentifiers.d.ts.map +1 -1
  162. package/build/requests/mapColumnsToIdentifiers.js +1 -3
  163. package/build/requests/mapColumnsToIdentifiers.js.map +1 -1
  164. package/build/requests/mapCsvColumnsToApi.d.ts.map +1 -1
  165. package/build/requests/mapCsvColumnsToApi.js +1 -3
  166. package/build/requests/mapCsvColumnsToApi.js.map +1 -1
  167. package/build/requests/mapRequestEnumValues.d.ts.map +1 -1
  168. package/build/requests/mapRequestEnumValues.js +6 -6
  169. package/build/requests/mapRequestEnumValues.js.map +1 -1
  170. package/build/requests/uploadPrivacyRequestsFromCsv.js +3 -3
  171. package/build/requests/uploadPrivacyRequestsFromCsv.js.map +1 -1
  172. package/build/tsbuildinfo +1 -1
  173. package/package.json +6 -3
  174. package/build/consent-manager/uploadConsentPreferences.d.ts.map +0 -1
  175. package/build/consent-manager/uploadConsentPreferences.js.map +0 -1
@@ -35,6 +35,8 @@ __exportStar(require("./setResourceAttributes"), exports);
35
35
  __exportStar(require("./buildTranscendGraphQLClient"), exports);
36
36
  __exportStar(require("./retryRequestEnricher"), exports);
37
37
  __exportStar(require("./gqls"), exports);
38
+ __exportStar(require("./fetchAllAssessmentTemplates"), exports);
39
+ __exportStar(require("./fetchAllAssessments"), exports);
38
40
  __exportStar(require("./fetchPromptThreads"), exports);
39
41
  __exportStar(require("./fetchAllPolicies"), exports);
40
42
  __exportStar(require("./fetchAllRequestIdentifierMetadata"), exports);
@@ -46,13 +48,17 @@ __exportStar(require("./fetchAllRequests"), exports);
46
48
  __exportStar(require("./fetchAllRequestIdentifiers"), exports);
47
49
  __exportStar(require("./fetchAllRequestEnrichers"), exports);
48
50
  __exportStar(require("./fetchRequestDataSilo"), exports);
51
+ __exportStar(require("./fetchAllPreferenceTopics"), exports);
49
52
  __exportStar(require("./fetchAllAttributes"), exports);
50
53
  __exportStar(require("./syncAttribute"), exports);
51
54
  __exportStar(require("./fetchAllDataFlows"), exports);
52
55
  __exportStar(require("./syncActionItems"), exports);
56
+ __exportStar(require("./fetchAllPurposes"), exports);
53
57
  __exportStar(require("./syncActionItemCollections"), exports);
54
58
  __exportStar(require("./fetchAllCookies"), exports);
55
59
  __exportStar(require("./fetchAllActionItems"), exports);
60
+ __exportStar(require("./parseAssessmentRiskLogic"), exports);
61
+ __exportStar(require("./parseAssessmentDisplayLogic"), exports);
56
62
  __exportStar(require("./fetchConsentManagerId"), exports);
57
63
  __exportStar(require("./createTranscendConsentGotInstance"), exports);
58
64
  __exportStar(require("./fetchAllBusinessEntities"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graphql/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,iDAA+B;AAC/B,sDAAoC;AACpC,qDAAmC;AACnC,+DAA6C;AAC7C,iEAA+C;AAC/C,qDAAmC;AACnC,gEAA8C;AAC9C,kDAAgC;AAChC,kDAAgC;AAChC,+DAA6C;AAC7C,kDAAgC;AAChC,kDAAgC;AAChC,uDAAqC;AACrC,4DAA0C;AAC1C,qDAAmC;AACnC,mDAAiC;AACjC,0DAAwC;AACxC,gEAA8C;AAC9C,yDAAuC;AACvC,yCAAuB;AACvB,uDAAqC;AACrC,qDAAmC;AACnC,sEAAoD;AACpD,2DAAyC;AACzC,qDAAmC;AACnC,oEAAkD;AAClD,0DAAwC;AACxC,qDAAmC;AACnC,+DAA6C;AAC7C,6DAA2C;AAC3C,yDAAuC;AACvC,uDAAqC;AACrC,kDAAgC;AAChC,sDAAoC;AACpC,oDAAkC;AAClC,8DAA4C;AAC5C,oDAAkC;AAClC,wDAAsC;AACtC,0DAAwC;AACxC,sEAAoD;AACpD,6DAA2C;AAC3C,kDAAgC;AAChC,uDAAqC;AACrC,yDAAuC;AACvC,oDAAkC;AAClC,oDAAkC;AAClC,mDAAiC;AACjC,+CAA6B;AAC7B,8CAA4B;AAC5B,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,gDAA8B;AAC9B,yDAAuC;AACvC,iDAA+B;AAC/B,sDAAoC;AACpC,wDAAsC;AACtC,sDAAoC;AACpC,gDAA8B;AAC9B,gEAA8C;AAC9C,yDAAuC;AACvC,oDAAkC;AAClC,2DAAyC;AACzC,qDAAmC;AACnC,iDAA+B;AAC/B,sDAAoC;AACpC,mDAAiC;AACjC,2DAAyC;AACzC,uDAAqC;AACrC,oDAAkC;AAClC,2DAAyC;AACzC,+DAA6C;AAC7C,+CAA6B;AAC7B,uDAAqC;AACrC,mDAAiC;AACjC,gDAA8B;AAC9B,uDAAqC;AACrC,2DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graphql/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,iDAA+B;AAC/B,sDAAoC;AACpC,qDAAmC;AACnC,+DAA6C;AAC7C,iEAA+C;AAC/C,qDAAmC;AACnC,gEAA8C;AAC9C,kDAAgC;AAChC,kDAAgC;AAChC,+DAA6C;AAC7C,kDAAgC;AAChC,kDAAgC;AAChC,uDAAqC;AACrC,4DAA0C;AAC1C,qDAAmC;AACnC,mDAAiC;AACjC,0DAAwC;AACxC,gEAA8C;AAC9C,yDAAuC;AACvC,yCAAuB;AACvB,gEAA8C;AAC9C,wDAAsC;AACtC,uDAAqC;AACrC,qDAAmC;AACnC,sEAAoD;AACpD,2DAAyC;AACzC,qDAAmC;AACnC,oEAAkD;AAClD,0DAAwC;AACxC,qDAAmC;AACnC,+DAA6C;AAC7C,6DAA2C;AAC3C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,kDAAgC;AAChC,sDAAoC;AACpC,oDAAkC;AAClC,qDAAmC;AACnC,8DAA4C;AAC5C,oDAAkC;AAClC,wDAAsC;AACtC,6DAA2C;AAC3C,gEAA8C;AAC9C,0DAAwC;AACxC,sEAAoD;AACpD,6DAA2C;AAC3C,kDAAgC;AAChC,uDAAqC;AACrC,yDAAuC;AACvC,oDAAkC;AAClC,oDAAkC;AAClC,mDAAiC;AACjC,+CAA6B;AAC7B,8CAA4B;AAC5B,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,gDAA8B;AAC9B,yDAAuC;AACvC,iDAA+B;AAC/B,sDAAoC;AACpC,wDAAsC;AACtC,sDAAoC;AACpC,gDAA8B;AAC9B,gEAA8C;AAC9C,yDAAuC;AACvC,oDAAkC;AAClC,2DAAyC;AACzC,qDAAmC;AACnC,iDAA+B;AAC/B,sDAAoC;AACpC,mDAAiC;AACjC,2DAAyC;AACzC,uDAAqC;AACrC,oDAAkC;AAClC,2DAAyC;AACzC,+DAA6C;AAC7C,+CAA6B;AAC7B,uDAAqC;AACrC,mDAAiC;AACjC,gDAA8B;AAC9B,uDAAqC;AACrC,2DAAyC"}
@@ -0,0 +1,56 @@
1
+ import { LogicOperator } from '@transcend-io/privacy-types';
2
+ import * as t from 'io-ts';
3
+ export declare const AssessmentRule: t.TypeC<{
4
+ dependsOnQuestionReferenceId: t.StringC;
5
+ comparisonOperator: t.KeyofC<{
6
+ IS_EQUAL_TO: unknown;
7
+ IS_NOT_EQUAL_TO: unknown;
8
+ IS_ONE_OF: unknown;
9
+ IS_NOT_ONE_OF: unknown;
10
+ CONTAINS: unknown;
11
+ IS_SHOWN: unknown;
12
+ IS_NOT_SHOWN: unknown;
13
+ }>;
14
+ comparisonOperands: t.ArrayC<t.StringC>;
15
+ }>;
16
+ /** Type override */
17
+ export type AssessmentRule = t.TypeOf<typeof AssessmentRule>;
18
+ export interface AssessmentNestedRule {
19
+ /** The operator to use when comparing the nested rules */
20
+ logicOperator: LogicOperator;
21
+ /** The rules to evaluate and be compared with to other using the LogicOperator */
22
+ rules?: AssessmentRule[];
23
+ /** The nested rules to add one more level of nesting to the rules. They are also compared to each other. */
24
+ nestedRules?: AssessmentNestedRule[];
25
+ }
26
+ export declare const AssessmentNestedRule: t.RecursiveType<t.Type<AssessmentNestedRule>>;
27
+ export declare const AssessmentAction: t.PartialC<{
28
+ action: t.KeyofC<{
29
+ SHOW: unknown;
30
+ SKIP: unknown;
31
+ }>;
32
+ rule: t.TypeC<{
33
+ dependsOnQuestionReferenceId: t.StringC;
34
+ comparisonOperator: t.KeyofC<{
35
+ IS_EQUAL_TO: unknown;
36
+ IS_NOT_EQUAL_TO: unknown;
37
+ IS_ONE_OF: unknown;
38
+ IS_NOT_ONE_OF: unknown;
39
+ CONTAINS: unknown;
40
+ IS_SHOWN: unknown;
41
+ IS_NOT_SHOWN: unknown;
42
+ }>;
43
+ comparisonOperands: t.ArrayC<t.StringC>;
44
+ }>;
45
+ nestedRule: t.RecursiveType<t.Type<AssessmentNestedRule, AssessmentNestedRule, unknown>, any, any, unknown>;
46
+ }>;
47
+ /** Type override */
48
+ export type AssessmentAction = t.TypeOf<typeof AssessmentAction>;
49
+ /**
50
+ * Parse the assessment display logic
51
+ *
52
+ * @param displayLogic - Stringified rule
53
+ * @returns The parsed assessment display logic
54
+ */
55
+ export declare function parseAssessmentDisplayLogic(displayLogic: string): AssessmentAction;
56
+ //# sourceMappingURL=parseAssessmentDisplayLogic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAssessmentDisplayLogic.d.ts","sourceRoot":"","sources":["../../src/graphql/parseAssessmentDisplayLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EACd,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAE3B,eAAO,MAAM,cAAc;;;;;;;;;;;;EAIzB,CAAC;AAEH,oBAAoB;AACpB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,aAAa,EAAE,aAAa,CAAC;IAC7B,kFAAkF;IAClF,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,4GAA4G;IAC5G,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,aAAa,CAChD,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAc7B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;EAI3B,CAAC;AAEH,oBAAoB;AACpB,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEjE;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,GACnB,gBAAgB,CAElB"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.parseAssessmentDisplayLogic = exports.AssessmentAction = exports.AssessmentNestedRule = exports.AssessmentRule = void 0;
27
+ const privacy_types_1 = require("@transcend-io/privacy-types");
28
+ const type_utils_1 = require("@transcend-io/type-utils");
29
+ const t = __importStar(require("io-ts"));
30
+ exports.AssessmentRule = t.type({
31
+ dependsOnQuestionReferenceId: t.string,
32
+ comparisonOperator: (0, type_utils_1.valuesOf)(privacy_types_1.ComparisonOperator),
33
+ comparisonOperands: t.array(t.string),
34
+ });
35
+ exports.AssessmentNestedRule = t.recursion('AssessmentNestedRule', (self) => t.intersection([
36
+ t.type({
37
+ /** The operator to use when comparing the nested rules */
38
+ logicOperator: (0, type_utils_1.valuesOf)(privacy_types_1.LogicOperator),
39
+ }),
40
+ t.partial({
41
+ /** The rules to evaluate and be compared with to other using the LogicOperator */
42
+ rules: t.array(exports.AssessmentRule),
43
+ /** The nested rules to add one more level of nesting to the rules. They are also compared to each other. */
44
+ nestedRules: t.array(self),
45
+ }),
46
+ ]));
47
+ exports.AssessmentAction = t.partial({
48
+ action: (0, type_utils_1.valuesOf)(privacy_types_1.AssessmentsDisplayLogicAction),
49
+ rule: exports.AssessmentRule,
50
+ nestedRule: exports.AssessmentNestedRule,
51
+ });
52
+ /**
53
+ * Parse the assessment display logic
54
+ *
55
+ * @param displayLogic - Stringified rule
56
+ * @returns The parsed assessment display logic
57
+ */
58
+ function parseAssessmentDisplayLogic(displayLogic) {
59
+ return (0, type_utils_1.decodeCodec)(exports.AssessmentAction, displayLogic);
60
+ }
61
+ exports.parseAssessmentDisplayLogic = parseAssessmentDisplayLogic;
62
+ //# sourceMappingURL=parseAssessmentDisplayLogic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAssessmentDisplayLogic.js","sourceRoot":"","sources":["../../src/graphql/parseAssessmentDisplayLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAIqC;AACrC,yDAAiE;AACjE,yCAA2B;AAEd,QAAA,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IACnC,4BAA4B,EAAE,CAAC,CAAC,MAAM;IACtC,kBAAkB,EAAE,IAAA,qBAAQ,EAAC,kCAAkB,CAAC;IAChD,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;CACtC,CAAC,CAAC;AAcU,QAAA,oBAAoB,GAE7B,CAAC,CAAC,SAAS,CAAC,sBAAsB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC/C,CAAC,CAAC,YAAY,CAAC;IACb,CAAC,CAAC,IAAI,CAAC;QACL,0DAA0D;QAC1D,aAAa,EAAE,IAAA,qBAAQ,EAAC,6BAAa,CAAC;KACvC,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,kFAAkF;QAClF,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAc,CAAC;QAC9B,4GAA4G;QAC5G,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;KAC3B,CAAC;CACH,CAAC,CACH,CAAC;AAEW,QAAA,gBAAgB,GAAG,CAAC,CAAC,OAAO,CAAC;IACxC,MAAM,EAAE,IAAA,qBAAQ,EAAC,6CAA6B,CAAC;IAC/C,IAAI,EAAE,sBAAc;IACpB,UAAU,EAAE,4BAAoB;CACjC,CAAC,CAAC;AAKH;;;;;GAKG;AACH,SAAgB,2BAA2B,CACzC,YAAoB;IAEpB,OAAO,IAAA,wBAAW,EAAC,wBAAgB,EAAE,YAAY,CAAC,CAAC;AACrD,CAAC;AAJD,kEAIC"}
@@ -0,0 +1,27 @@
1
+ import * as t from 'io-ts';
2
+ export declare const AssessmentRiskLogic: t.IntersectionC<[t.PartialC<{
3
+ riskAssignment: t.TypeC<{
4
+ riskLevelId: t.StringC;
5
+ }>;
6
+ }>, t.TypeC<{
7
+ comparisonOperands: t.ArrayC<t.StringC>;
8
+ comparisonOperator: t.KeyofC<{
9
+ IS_EQUAL_TO: unknown;
10
+ IS_NOT_EQUAL_TO: unknown;
11
+ IS_ONE_OF: unknown;
12
+ IS_NOT_ONE_OF: unknown;
13
+ CONTAINS: unknown;
14
+ IS_SHOWN: unknown;
15
+ IS_NOT_SHOWN: unknown;
16
+ }>;
17
+ }>]>;
18
+ /** Type override */
19
+ export type AssessmentRiskLogic = t.TypeOf<typeof AssessmentRiskLogic>;
20
+ /**
21
+ * Parse the assessment risk logic
22
+ *
23
+ * @param riskLogic - Stringified rule
24
+ * @returns The parsed assessment risk logic
25
+ */
26
+ export declare function parseAssessmentRiskLogic(riskLogic: string): AssessmentRiskLogic;
27
+ //# sourceMappingURL=parseAssessmentRiskLogic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAssessmentRiskLogic.d.ts","sourceRoot":"","sources":["../../src/graphql/parseAssessmentRiskLogic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAE3B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;IAU9B,CAAC;AAEH,oBAAoB;AACpB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEvE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,GAChB,mBAAmB,CAErB"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.parseAssessmentRiskLogic = exports.AssessmentRiskLogic = void 0;
27
+ const privacy_types_1 = require("@transcend-io/privacy-types");
28
+ const type_utils_1 = require("@transcend-io/type-utils");
29
+ const t = __importStar(require("io-ts"));
30
+ exports.AssessmentRiskLogic = t.intersection([
31
+ t.partial({
32
+ riskAssignment: t.type({
33
+ riskLevelId: t.string,
34
+ }),
35
+ }),
36
+ t.type({
37
+ comparisonOperands: t.array(t.string),
38
+ comparisonOperator: (0, type_utils_1.valuesOf)(privacy_types_1.ComparisonOperator),
39
+ }),
40
+ ]);
41
+ /**
42
+ * Parse the assessment risk logic
43
+ *
44
+ * @param riskLogic - Stringified rule
45
+ * @returns The parsed assessment risk logic
46
+ */
47
+ function parseAssessmentRiskLogic(riskLogic) {
48
+ return (0, type_utils_1.decodeCodec)(exports.AssessmentRiskLogic, riskLogic);
49
+ }
50
+ exports.parseAssessmentRiskLogic = parseAssessmentRiskLogic;
51
+ //# sourceMappingURL=parseAssessmentRiskLogic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAssessmentRiskLogic.js","sourceRoot":"","sources":["../../src/graphql/parseAssessmentRiskLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAiE;AACjE,yDAAiE;AACjE,yCAA2B;AAEd,QAAA,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC;IAChD,CAAC,CAAC,OAAO,CAAC;QACR,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC;YACrB,WAAW,EAAE,CAAC,CAAC,MAAM;SACtB,CAAC;KACH,CAAC;IACF,CAAC,CAAC,IAAI,CAAC;QACL,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACrC,kBAAkB,EAAE,IAAA,qBAAQ,EAAC,kCAAkB,CAAC;KACjD,CAAC;CACH,CAAC,CAAC;AAKH;;;;;GAKG;AACH,SAAgB,wBAAwB,CACtC,SAAiB;IAEjB,OAAO,IAAA,wBAAW,EAAC,2BAAmB,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC;AAJD,4DAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pullTranscendConfiguration.d.ts","sourceRoot":"","sources":["../../src/graphql/pullTranscendConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EA2Bf,MAAM,WAAW,CAAC;AACnB,OAAO,EAEL,oBAAoB,EAErB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAsChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAOjD,eAAO,MAAM,gCAAgC,yBAK5C,CAAC;AAEF,MAAM,WAAW,+BAA+B;IAC9C,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACpC,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,mCAAmC;IACnC,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACzC,kCAAkC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4EAA4E;IAC5E,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,aAAa,EACrB,EACE,WAAW,EACX,gBAAgB,EAChB,KAAK,EACL,SAA4C,EAC5C,QAAQ,EACR,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,eAAqD,GACtD,EAAE,+BAA+B,GACjC,OAAO,CAAC,cAAc,CAAC,CAyiCzB"}
1
+ {"version":3,"file":"pullTranscendConfiguration.d.ts","sourceRoot":"","sources":["../../src/graphql/pullTranscendConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EAgCf,MAAM,WAAW,CAAC;AACnB,OAAO,EAEL,oBAAoB,EAErB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAsChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAcjD,eAAO,MAAM,gCAAgC,yBAK5C,CAAC;AAEF,MAAM,WAAW,+BAA+B;IAC9C,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACpC,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,mCAAmC;IACnC,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACzC,kCAAkC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4EAA4E;IAC5E,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,aAAa,EACrB,EACE,WAAW,EACX,gBAAgB,EAChB,KAAK,EACL,SAA4C,EAC5C,QAAQ,EACR,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,eAAqD,GACtD,EAAE,+BAA+B,GACjC,OAAO,CAAC,cAAc,CAAC,CAi4CzB"}
@@ -40,6 +40,10 @@ const fetchAllActionItems_1 = require("./fetchAllActionItems");
40
40
  const fetchAllTeams_1 = require("./fetchAllTeams");
41
41
  const fetchAllActionItemCollections_1 = require("./fetchAllActionItemCollections");
42
42
  const syncPartitions_1 = require("./syncPartitions");
43
+ const fetchAllAssessments_1 = require("./fetchAllAssessments");
44
+ const fetchAllAssessmentTemplates_1 = require("./fetchAllAssessmentTemplates");
45
+ const parseAssessmentDisplayLogic_1 = require("./parseAssessmentDisplayLogic");
46
+ const parseAssessmentRiskLogic_1 = require("./parseAssessmentRiskLogic");
43
47
  exports.DEFAULT_TRANSCEND_PULL_RESOURCES = [
44
48
  enums_1.TranscendPullResource.DataSilos,
45
49
  enums_1.TranscendPullResource.Enrichers,
@@ -59,7 +63,7 @@ async function pullTranscendConfiguration(client, { dataSiloIds, integrationName
59
63
  }
60
64
  logger_1.logger.info(colors_1.default.magenta(`Fetching data with page size ${pageSize}...`));
61
65
  // Fetch all data, but only conditional fetch data that is requested
62
- const [dataSubjects, apiKeyTitleMap, dataSilos, enrichers, dataFlows, cookies, attributes, templates, identifiers, actions, businessEntities, consentManager, consentManagerExperiences, prompts, promptPartials, promptGroups, agents, agentFunctions, agentFiles, vendors, dataCategories, processingPurposes, actionItems, actionItemCollections, teams, policies, privacyCenters, messages, partitions,] = await Promise.all([
66
+ const [dataSubjects, apiKeyTitleMap, dataSilos, enrichers, dataFlows, cookies, attributes, templates, identifiers, actions, businessEntities, consentManager, consentManagerExperiences, prompts, promptPartials, promptGroups, agents, agentFunctions, agentFiles, vendors, dataCategories, processingPurposes, actionItems, actionItemCollections, teams, policies, privacyCenters, messages, partitions, assessments, assessmentTemplates,] = await Promise.all([
63
67
  // Grab all data subjects in the organization
64
68
  resources.includes(enums_1.TranscendPullResource.DataSilos) ||
65
69
  resources.includes(enums_1.TranscendPullResource.DataSubjects)
@@ -199,6 +203,14 @@ async function pullTranscendConfiguration(client, { dataSiloIds, integrationName
199
203
  resources.includes(enums_1.TranscendPullResource.Partitions)
200
204
  ? (0, syncPartitions_1.fetchPartitions)(client)
201
205
  : [],
206
+ // Fetch assessments
207
+ resources.includes(enums_1.TranscendPullResource.Assessments)
208
+ ? (0, fetchAllAssessments_1.fetchAllAssessments)(client)
209
+ : [],
210
+ // Fetch assessmentTemplates
211
+ resources.includes(enums_1.TranscendPullResource.AssessmentTemplates)
212
+ ? (0, fetchAllAssessmentTemplates_1.fetchAllAssessmentTemplates)(client)
213
+ : [],
202
214
  ]);
203
215
  const consentManagerTheme = resources.includes(enums_1.TranscendPullResource.ConsentManager) && consentManager
204
216
  ? await (0, fetchConsentManagerId_1.fetchConsentManagerTheme)(client, consentManager.id)
@@ -273,6 +285,213 @@ async function pullTranscendConfiguration(client, { dataSiloIds, integrationName
273
285
  })),
274
286
  };
275
287
  }
288
+ // Save assessments
289
+ if (assessments.length > 0 &&
290
+ resources.includes(enums_1.TranscendPullResource.Assessments)) {
291
+ result.assessments = assessments.map(({ title, assessmentGroup, sections, creator, description, status, assignees, externalAssignees, reviewers, isLocked, isArchived, isExternallyCreated, dueDate, createdAt, assignedAt, submittedAt, approvedAt, rejectedAt, titleIsInternal, retentionSchedule, attributeValues, resources, syncedRows, }) => ({
292
+ title,
293
+ group: assessmentGroup.title,
294
+ sections: sections.map(({ title, status, questions, assignees, isReviewed, externalAssignees, }) => ({
295
+ title,
296
+ status,
297
+ questions: questions.map(({ title, type, subType, placeholder, description, isRequired, referenceId, displayLogic, riskLogic, riskCategories, riskFramework, answerOptions, allowedMimeTypes, allowSelectOther, syncModel, syncColumn, attributeKey, requireRiskEvaluation, requireRiskMatrixEvaluation, }) => {
298
+ const displayLogicParsed = displayLogic
299
+ ? (0, parseAssessmentDisplayLogic_1.parseAssessmentDisplayLogic)(displayLogic)
300
+ : undefined;
301
+ return {
302
+ title,
303
+ type,
304
+ 'sub-type': subType,
305
+ placeholder,
306
+ description,
307
+ 'is-required': isRequired,
308
+ 'reference-id': referenceId,
309
+ 'display-logic': displayLogicParsed &&
310
+ Object.keys(displayLogicParsed).length > 0
311
+ ? {
312
+ action: displayLogicParsed.action,
313
+ rule: displayLogicParsed.rule
314
+ ? {
315
+ 'depends-on-question-reference-id': displayLogicParsed.rule
316
+ .dependsOnQuestionReferenceId,
317
+ 'comparison-operator': displayLogicParsed.rule.comparisonOperator,
318
+ 'comparison-operands': displayLogicParsed.rule.comparisonOperands,
319
+ }
320
+ : undefined,
321
+ 'nested-rule': displayLogicParsed.nestedRule
322
+ ? {
323
+ 'logic-operator': displayLogicParsed.nestedRule.logicOperator,
324
+ rules:
325
+ /* eslint-disable @typescript-eslint/no-explicit-any */
326
+ (displayLogicParsed
327
+ .nestedRule.rules || []).map((rule) => ({
328
+ 'depends-on-question-reference-id': rule.dependsOnQuestionReferenceId,
329
+ 'comparison-operator': rule.comparisonOperator,
330
+ 'comparison-operands': rule.comparisonOperands,
331
+ })),
332
+ /* eslint-enable @typescript-eslint/no-explicit-any */
333
+ }
334
+ : undefined,
335
+ }
336
+ : undefined,
337
+ 'risk-logic': riskLogic.map((logic) => {
338
+ var _a;
339
+ const parsed = (0, parseAssessmentRiskLogic_1.parseAssessmentRiskLogic)(logic);
340
+ return {
341
+ 'risk-level': (_a = parsed.riskAssignment) === null || _a === void 0 ? void 0 : _a.riskLevelId,
342
+ 'comparison-operands': parsed.comparisonOperands,
343
+ 'comparison-operator': parsed.comparisonOperator,
344
+ };
345
+ }),
346
+ 'risk-categories': riskCategories.map(({ title }) => title),
347
+ 'risk-framework': riskFramework === null || riskFramework === void 0 ? void 0 : riskFramework.title,
348
+ 'answer-options': answerOptions.map(({ value }) => ({
349
+ value,
350
+ })),
351
+ 'allowed-mime-types': allowedMimeTypes,
352
+ 'allow-select-other': allowSelectOther,
353
+ 'sync-model': syncModel || undefined,
354
+ 'sync-column': syncColumn || undefined,
355
+ 'attribute-key': attributeKey === null || attributeKey === void 0 ? void 0 : attributeKey.name,
356
+ 'require-risk-evaluation': requireRiskEvaluation,
357
+ 'require-risk-matrix-evaluation': requireRiskMatrixEvaluation,
358
+ };
359
+ }),
360
+ assignees: assignees.map(({ email }) => email),
361
+ 'external-assignees': externalAssignees.map(({ email }) => email),
362
+ 'is-reviewed': isReviewed,
363
+ })),
364
+ creator: creator === null || creator === void 0 ? void 0 : creator.email,
365
+ description,
366
+ status,
367
+ assignees: assignees.map(({ email }) => email),
368
+ 'external-assignees': externalAssignees.map(({ email }) => email),
369
+ reviewers: reviewers.map(({ email }) => email),
370
+ locked: isLocked,
371
+ archived: isArchived,
372
+ external: isExternallyCreated,
373
+ 'title-is-internal': titleIsInternal,
374
+ 'due-date': dueDate || undefined,
375
+ 'created-at': createdAt || undefined,
376
+ 'assigned-at': assignedAt || undefined,
377
+ 'submitted-at': submittedAt || undefined,
378
+ 'approved-at': approvedAt || undefined,
379
+ 'rejected-at': rejectedAt || undefined,
380
+ 'retention-schedule': retentionSchedule
381
+ ? {
382
+ type: retentionSchedule.type,
383
+ 'duration-days': retentionSchedule.durationDays,
384
+ operand: retentionSchedule.operation,
385
+ }
386
+ : undefined,
387
+ attributes: attributeValues !== undefined && attributeValues.length > 0
388
+ ? (0, formatAttributeValues_1.formatAttributeValues)(attributeValues)
389
+ : undefined,
390
+ resources: resources.map(({ resourceType, title, name, category, type, purpose }) => ({
391
+ type: resourceType,
392
+ title: category
393
+ ? `${category} - ${name}`
394
+ : purpose
395
+ ? `${purpose} - ${name}`
396
+ : title || name || type || '',
397
+ })),
398
+ rows: syncedRows.map(({ resourceType, title, name, category, type, purpose }) => ({
399
+ type: resourceType,
400
+ title: category
401
+ ? `${category} - ${name}`
402
+ : purpose
403
+ ? `${purpose} - ${name}`
404
+ : title || name || type || '',
405
+ })),
406
+ }));
407
+ }
408
+ // Save assessmentTemplates
409
+ if (assessmentTemplates.length > 0 &&
410
+ resources.includes(enums_1.TranscendPullResource.AssessmentTemplates)) {
411
+ result['assessment-templates'] = assessmentTemplates.map(({ title, description, sections, status, source, creator, isLocked, isArchived, createdAt, retentionSchedule, }) => ({
412
+ title,
413
+ description,
414
+ sections: sections.map(({ title, questions }) => ({
415
+ title,
416
+ questions: questions.map(({ title, type, subType, placeholder, description, isRequired, referenceId, displayLogic, riskLogic, riskCategories, riskFramework, answerOptions, allowedMimeTypes, allowSelectOther, syncModel, syncColumn, attributeKey, requireRiskEvaluation, requireRiskMatrixEvaluation, }) => {
417
+ const displayLogicParsed = displayLogic
418
+ ? (0, parseAssessmentDisplayLogic_1.parseAssessmentDisplayLogic)(displayLogic)
419
+ : undefined;
420
+ return {
421
+ title,
422
+ type,
423
+ 'sub-type': subType,
424
+ placeholder,
425
+ description,
426
+ 'is-required': isRequired,
427
+ 'reference-id': referenceId,
428
+ 'display-logic': displayLogicParsed &&
429
+ Object.keys(displayLogicParsed).length > 0
430
+ ? {
431
+ action: displayLogicParsed.action,
432
+ rule: displayLogicParsed.rule
433
+ ? {
434
+ 'depends-on-question-reference-id': displayLogicParsed.rule
435
+ .dependsOnQuestionReferenceId,
436
+ 'comparison-operator': displayLogicParsed.rule.comparisonOperator,
437
+ 'comparison-operands': displayLogicParsed.rule.comparisonOperands,
438
+ }
439
+ : undefined,
440
+ 'nested-rule': displayLogicParsed.nestedRule
441
+ ? {
442
+ 'logic-operator': displayLogicParsed.nestedRule.logicOperator,
443
+ rules:
444
+ /* eslint-disable @typescript-eslint/no-explicit-any */
445
+ (displayLogicParsed
446
+ .nestedRule.rules || []).map((rule) => ({
447
+ 'depends-on-question-reference-id': rule.dependsOnQuestionReferenceId,
448
+ 'comparison-operator': rule.comparisonOperator,
449
+ 'comparison-operands': rule.comparisonOperands,
450
+ })),
451
+ /* eslint-enable @typescript-eslint/no-explicit-any */
452
+ }
453
+ : undefined,
454
+ }
455
+ : undefined,
456
+ 'risk-logic': riskLogic.map((logic) => {
457
+ var _a;
458
+ const parsed = (0, parseAssessmentRiskLogic_1.parseAssessmentRiskLogic)(logic);
459
+ return {
460
+ 'risk-level': (_a = parsed.riskAssignment) === null || _a === void 0 ? void 0 : _a.riskLevelId,
461
+ 'comparison-operands': parsed.comparisonOperands,
462
+ 'comparison-operator': parsed.comparisonOperator,
463
+ };
464
+ }),
465
+ 'risk-categories': riskCategories.map(({ title }) => title),
466
+ 'risk-framework': riskFramework === null || riskFramework === void 0 ? void 0 : riskFramework.title,
467
+ 'answer-options': answerOptions.map(({ value }) => ({
468
+ value,
469
+ })),
470
+ 'allowed-mime-types': allowedMimeTypes,
471
+ 'allow-select-other': allowSelectOther,
472
+ 'sync-model': syncModel || undefined,
473
+ 'sync-column': syncColumn || undefined,
474
+ 'attribute-key': attributeKey === null || attributeKey === void 0 ? void 0 : attributeKey.name,
475
+ 'require-risk-evaluation': requireRiskEvaluation,
476
+ 'require-risk-matrix-evaluation': requireRiskMatrixEvaluation,
477
+ };
478
+ }),
479
+ })),
480
+ status,
481
+ source,
482
+ creator: creator === null || creator === void 0 ? void 0 : creator.email,
483
+ locked: isLocked,
484
+ archived: isArchived,
485
+ 'created-at': createdAt || undefined,
486
+ 'retention-schedule': retentionSchedule
487
+ ? {
488
+ type: retentionSchedule.type,
489
+ 'duration-days': retentionSchedule.durationDays,
490
+ operand: retentionSchedule.operation,
491
+ }
492
+ : undefined,
493
+ }));
494
+ }
276
495
  // Save prompts
277
496
  if (prompts.length > 0 && resources.includes(enums_1.TranscendPullResource.Prompts)) {
278
497
  result.prompts = prompts.map(({ title, content }) => ({