@transcend-io/cli 7.2.0 → 8.0.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 (128) hide show
  1. package/dist/bin/bash-complete.cjs +1 -1
  2. package/dist/bin/cli.cjs +1 -1
  3. package/dist/bin/deprecated-command.cjs +2 -2
  4. package/dist/{chunk-EAJZX4TX.cjs → chunk-3EZGFSMD.cjs} +2 -2
  5. package/dist/{chunk-EAJZX4TX.cjs.map → chunk-3EZGFSMD.cjs.map} +1 -1
  6. package/dist/{chunk-NW3O6OPS.cjs → chunk-3FEOMF7G.cjs} +2 -2
  7. package/dist/{chunk-NW3O6OPS.cjs.map → chunk-3FEOMF7G.cjs.map} +1 -1
  8. package/dist/{chunk-VMGXBH6E.cjs → chunk-6DMFIXMV.cjs} +19 -19
  9. package/dist/{chunk-VMGXBH6E.cjs.map → chunk-6DMFIXMV.cjs.map} +1 -1
  10. package/dist/{chunk-NNMCZMFJ.cjs → chunk-6PCS4IRI.cjs} +2 -2
  11. package/dist/{chunk-NNMCZMFJ.cjs.map → chunk-6PCS4IRI.cjs.map} +1 -1
  12. package/dist/{chunk-5JXP3N7U.cjs → chunk-7QV5QNGW.cjs} +4 -4
  13. package/dist/{chunk-5JXP3N7U.cjs.map → chunk-7QV5QNGW.cjs.map} +1 -1
  14. package/dist/{chunk-Z2PA2QDO.cjs → chunk-AADFRD6P.cjs} +2 -2
  15. package/dist/{chunk-Z2PA2QDO.cjs.map → chunk-AADFRD6P.cjs.map} +1 -1
  16. package/dist/{chunk-YK5YCHD6.cjs → chunk-ASFWHSOV.cjs} +2 -2
  17. package/dist/{chunk-YK5YCHD6.cjs.map → chunk-ASFWHSOV.cjs.map} +1 -1
  18. package/dist/{chunk-AFYBKLWT.cjs → chunk-FMX5SPCL.cjs} +2 -2
  19. package/dist/{chunk-AFYBKLWT.cjs.map → chunk-FMX5SPCL.cjs.map} +1 -1
  20. package/dist/{chunk-PIJPXUK5.cjs → chunk-GZ2U36SS.cjs} +3 -3
  21. package/dist/{chunk-PIJPXUK5.cjs.map → chunk-GZ2U36SS.cjs.map} +1 -1
  22. package/dist/{chunk-VIPFYWRR.cjs → chunk-KC7NDLN7.cjs} +2 -2
  23. package/dist/{chunk-VIPFYWRR.cjs.map → chunk-KC7NDLN7.cjs.map} +1 -1
  24. package/dist/{chunk-R77JR6OQ.cjs → chunk-MPI5VURJ.cjs} +11 -10
  25. package/dist/chunk-MPI5VURJ.cjs.map +1 -0
  26. package/dist/{chunk-I4XVTF53.cjs → chunk-NKVC5Y53.cjs} +2 -2
  27. package/dist/{chunk-I4XVTF53.cjs.map → chunk-NKVC5Y53.cjs.map} +1 -1
  28. package/dist/chunk-QEM6S2W7.cjs +2 -0
  29. package/dist/chunk-QEM6S2W7.cjs.map +1 -0
  30. package/dist/{chunk-3G77IGKQ.cjs → chunk-R7QYSUEN.cjs} +2 -2
  31. package/dist/{chunk-3G77IGKQ.cjs.map → chunk-R7QYSUEN.cjs.map} +1 -1
  32. package/dist/{chunk-2FBBA65B.cjs → chunk-SUCCU2FS.cjs} +3 -3
  33. package/dist/{chunk-2FBBA65B.cjs.map → chunk-SUCCU2FS.cjs.map} +1 -1
  34. package/dist/{chunk-74OAET6D.cjs → chunk-V4X4IT3T.cjs} +2 -2
  35. package/dist/{chunk-74OAET6D.cjs.map → chunk-V4X4IT3T.cjs.map} +1 -1
  36. package/dist/{chunk-327HQXYV.cjs → chunk-VHQY7TSF.cjs} +2 -2
  37. package/dist/{chunk-327HQXYV.cjs.map → chunk-VHQY7TSF.cjs.map} +1 -1
  38. package/dist/impl-3MB7W3JD.cjs +2 -0
  39. package/dist/{impl-EZEGBKX7.cjs.map → impl-3MB7W3JD.cjs.map} +1 -1
  40. package/dist/{impl-OKB3HF7H.cjs → impl-4EYSMS5J.cjs} +2 -2
  41. package/dist/{impl-OKB3HF7H.cjs.map → impl-4EYSMS5J.cjs.map} +1 -1
  42. package/dist/{impl-NL7N7YF4.cjs → impl-4QGHJNOF.cjs} +2 -2
  43. package/dist/{impl-NL7N7YF4.cjs.map → impl-4QGHJNOF.cjs.map} +1 -1
  44. package/dist/{impl-MEK2DTKK.cjs → impl-4TMKRPWO.cjs} +2 -2
  45. package/dist/{impl-MEK2DTKK.cjs.map → impl-4TMKRPWO.cjs.map} +1 -1
  46. package/dist/{impl-VOTMQS3M.cjs → impl-5OEUTJB7.cjs} +2 -2
  47. package/dist/{impl-VOTMQS3M.cjs.map → impl-5OEUTJB7.cjs.map} +1 -1
  48. package/dist/{impl-OBAYFQ23.cjs → impl-6CESPVNS.cjs} +2 -2
  49. package/dist/{impl-OBAYFQ23.cjs.map → impl-6CESPVNS.cjs.map} +1 -1
  50. package/dist/{impl-7L5YW5CG.cjs → impl-6OK7OVS6.cjs} +2 -2
  51. package/dist/{impl-7L5YW5CG.cjs.map → impl-6OK7OVS6.cjs.map} +1 -1
  52. package/dist/{impl-HKEYENUI.cjs → impl-A6IYDZLA.cjs} +2 -2
  53. package/dist/{impl-HKEYENUI.cjs.map → impl-A6IYDZLA.cjs.map} +1 -1
  54. package/dist/{impl-6ALA6KXM.cjs → impl-ALXI3TP7.cjs} +2 -2
  55. package/dist/{impl-6ALA6KXM.cjs.map → impl-ALXI3TP7.cjs.map} +1 -1
  56. package/dist/{impl-3HQ63RRZ.cjs → impl-AMXKTPKE.cjs} +2 -2
  57. package/dist/{impl-3HQ63RRZ.cjs.map → impl-AMXKTPKE.cjs.map} +1 -1
  58. package/dist/{impl-P77UGVDU.cjs → impl-BEGQABL3.cjs} +2 -2
  59. package/dist/{impl-P77UGVDU.cjs.map → impl-BEGQABL3.cjs.map} +1 -1
  60. package/dist/{impl-WMJ7ZSI2.cjs → impl-CT62BE2Y.cjs} +2 -2
  61. package/dist/{impl-WMJ7ZSI2.cjs.map → impl-CT62BE2Y.cjs.map} +1 -1
  62. package/dist/{impl-6FMDP53G.cjs → impl-DCPTYADV.cjs} +2 -2
  63. package/dist/{impl-6FMDP53G.cjs.map → impl-DCPTYADV.cjs.map} +1 -1
  64. package/dist/impl-DHMLZZX7.cjs +2 -0
  65. package/dist/{impl-3ON47TMW.cjs.map → impl-DHMLZZX7.cjs.map} +1 -1
  66. package/dist/impl-DJ3SW7AG.cjs +2 -0
  67. package/dist/{impl-RTDKCEU3.cjs.map → impl-DJ3SW7AG.cjs.map} +1 -1
  68. package/dist/{impl-U64CK4IR.cjs → impl-EE72U2AE.cjs} +2 -2
  69. package/dist/{impl-U64CK4IR.cjs.map → impl-EE72U2AE.cjs.map} +1 -1
  70. package/dist/{impl-2ZHRCHKL.cjs → impl-GSLBE3DP.cjs} +2 -2
  71. package/dist/{impl-2ZHRCHKL.cjs.map → impl-GSLBE3DP.cjs.map} +1 -1
  72. package/dist/{impl-OJ5LZMML.cjs → impl-HFDUNV2A.cjs} +2 -2
  73. package/dist/{impl-OJ5LZMML.cjs.map → impl-HFDUNV2A.cjs.map} +1 -1
  74. package/dist/{impl-FPDL23FO.cjs → impl-HV2SRHDV.cjs} +2 -2
  75. package/dist/{impl-FPDL23FO.cjs.map → impl-HV2SRHDV.cjs.map} +1 -1
  76. package/dist/{impl-5RAQCIIT.cjs → impl-JTBEG5AM.cjs} +2 -2
  77. package/dist/{impl-5RAQCIIT.cjs.map → impl-JTBEG5AM.cjs.map} +1 -1
  78. package/dist/{impl-Y2UFIDZG.cjs → impl-JYCFV5ST.cjs} +2 -2
  79. package/dist/{impl-Y2UFIDZG.cjs.map → impl-JYCFV5ST.cjs.map} +1 -1
  80. package/dist/{impl-B5GIP2VU.cjs → impl-L7AJQDYS.cjs} +2 -2
  81. package/dist/{impl-B5GIP2VU.cjs.map → impl-L7AJQDYS.cjs.map} +1 -1
  82. package/dist/{impl-V3TJ5WS2.cjs → impl-LJMBCW6Z.cjs} +2 -2
  83. package/dist/{impl-V3TJ5WS2.cjs.map → impl-LJMBCW6Z.cjs.map} +1 -1
  84. package/dist/{impl-CSVPLCDE.cjs → impl-NCT2NJ62.cjs} +2 -2
  85. package/dist/{impl-CSVPLCDE.cjs.map → impl-NCT2NJ62.cjs.map} +1 -1
  86. package/dist/{impl-275S73PA.cjs → impl-OEZVSI3U.cjs} +2 -2
  87. package/dist/{impl-275S73PA.cjs.map → impl-OEZVSI3U.cjs.map} +1 -1
  88. package/dist/{impl-C7VBO6EQ.cjs → impl-OZ7S4WDL.cjs} +2 -2
  89. package/dist/{impl-C7VBO6EQ.cjs.map → impl-OZ7S4WDL.cjs.map} +1 -1
  90. package/dist/impl-SCO4LJDB.cjs +2 -0
  91. package/dist/{impl-S7SJFITO.cjs.map → impl-SCO4LJDB.cjs.map} +1 -1
  92. package/dist/{impl-PJF6PVKZ.cjs → impl-SLRQDZB4.cjs} +2 -2
  93. package/dist/{impl-PJF6PVKZ.cjs.map → impl-SLRQDZB4.cjs.map} +1 -1
  94. package/dist/{impl-57FO3PX7.cjs → impl-SQDB5BDK.cjs} +5 -5
  95. package/dist/{impl-57FO3PX7.cjs.map → impl-SQDB5BDK.cjs.map} +1 -1
  96. package/dist/{impl-JDJ4CQXV.cjs → impl-TI7DA67A.cjs} +2 -2
  97. package/dist/{impl-JDJ4CQXV.cjs.map → impl-TI7DA67A.cjs.map} +1 -1
  98. package/dist/impl-TVSTWXSI.cjs +2 -0
  99. package/dist/{impl-CNNTC625.cjs.map → impl-TVSTWXSI.cjs.map} +1 -1
  100. package/dist/{impl-42EGVNC4.cjs → impl-ULAYJG2T.cjs} +3 -3
  101. package/dist/{impl-42EGVNC4.cjs.map → impl-ULAYJG2T.cjs.map} +1 -1
  102. package/dist/impl-VVADV3UA.cjs +2 -0
  103. package/dist/{impl-IZ6KZF27.cjs.map → impl-VVADV3UA.cjs.map} +1 -1
  104. package/dist/{impl-EKGVCWVS.cjs → impl-WBR473NQ.cjs} +4 -4
  105. package/dist/{impl-EKGVCWVS.cjs.map → impl-WBR473NQ.cjs.map} +1 -1
  106. package/dist/{impl-OOKYV6NI.cjs → impl-WKWQYPI4.cjs} +3 -3
  107. package/dist/{impl-OOKYV6NI.cjs.map → impl-WKWQYPI4.cjs.map} +1 -1
  108. package/dist/{impl-BSJJNNCI.cjs → impl-XTEZTAM2.cjs} +2 -2
  109. package/dist/{impl-BSJJNNCI.cjs.map → impl-XTEZTAM2.cjs.map} +1 -1
  110. package/dist/{impl-JKSZNCWA.cjs → impl-YLORLMRQ.cjs} +2 -2
  111. package/dist/{impl-JKSZNCWA.cjs.map → impl-YLORLMRQ.cjs.map} +1 -1
  112. package/dist/{impl-HI3ZAAZJ.cjs → impl-YVMYL724.cjs} +6 -6
  113. package/dist/{impl-HI3ZAAZJ.cjs.map → impl-YVMYL724.cjs.map} +1 -1
  114. package/dist/impl-ZFJM6LMZ.cjs +2 -0
  115. package/dist/{impl-ZP5ZWANC.cjs.map → impl-ZFJM6LMZ.cjs.map} +1 -1
  116. package/dist/index.cjs +3 -3
  117. package/dist/index.d.cts +7 -1
  118. package/package.json +2 -2
  119. package/dist/chunk-R77JR6OQ.cjs.map +0 -1
  120. package/dist/chunk-UWUR56CO.cjs +0 -2
  121. package/dist/chunk-UWUR56CO.cjs.map +0 -1
  122. package/dist/impl-3ON47TMW.cjs +0 -2
  123. package/dist/impl-CNNTC625.cjs +0 -2
  124. package/dist/impl-EZEGBKX7.cjs +0 -2
  125. package/dist/impl-IZ6KZF27.cjs +0 -2
  126. package/dist/impl-RTDKCEU3.cjs +0 -2
  127. package/dist/impl-S7SJFITO.cjs +0 -2
  128. package/dist/impl-ZP5ZWANC.cjs +0 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-HI3ZAAZJ.cjs","../src/commands/consent/upload-preferences/impl.ts","../src/lib/preference-management/uploadPreferenceManagementPreferencesInteractive.ts","../src/lib/preference-management/parsePreferenceManagementCsv.ts","../src/lib/preference-management/getPreferencesForIdentifiers.ts","../src/lib/preference-management/parsePreferenceIdentifiersFromCsv.ts","../src/lib/preference-management/parsePreferenceAndPurposeValuesFromCsv.ts"],"names":["PreferenceRecordsQueryResponse","PreferenceQueryResponseItem","MSGS","getPreferencesForIdentifiers","sombra","identifiers","partitionKey","skipLogging","results","groupedIdentifiers","chunk_default","t0","progressBar","cliProgress","total","map","group","attempts","maxAttempts","rawResult","result","decodeCodec","err","msg","errorMessage"],"mappings":"AAAA,u/BAAwC,gCAA6B,wDAAyD,wDAA0C,gCAA6B,wDAAoF,wDAAyC,gCAA6B,wDAAuE,gCAA6B,gFCChb,qGCWK,+DAEO,qJCXZ,2DCHyB,qDAKhB,IAKtBA,EAAAA,CAAmC,CAAA,CAAA,YAAA,CAAa,CAClD,CAAA,CAAA,IAAA,CAAK,CACL,KAAA,CAAS,CAAA,CAAA,KAAA,CAAMC,yCAA2B,CAC5C,CAAC,CAAA,CACC,CAAA,CAAA,OAAA,CAAQ,CAER,MAAA,CAAU,CAAA,CAAA,MACZ,CAAC,CACH,CAAC,CAAA,CAEKC,EAAAA,CAAO,CACX,WAAA,CACA,WAAA,CACA,sBAAA,CACA,sBACF,CAAA,CASA,MAAA,SAAsBC,EAAAA,CACpBC,CAAAA,CACA,CACE,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,CAAA,CAChB,CAAA,CAWwC,CACxC,IAAMC,CAAAA,CAAyC,CAAC,CAAA,CAC1CC,CAAAA,CAAqBC,iCAAAA,CAAML,CAAa,GAAG,CAAA,CAG3CM,CAAAA,CAAK,IAAI,IAAA,CAAK,CAAA,CAAE,OAAA,CAAQ,CAAA,CACxBC,CAAAA,CAAc,IAAIC,qBAAAA,CAAY,SAAA,CAClC,CAAC,CAAA,CACDA,qBAAAA,CAAY,OAAA,CAAQ,cACtB,CAAA,CACKN,CAAAA,EACHK,CAAAA,CAAY,KAAA,CAAMP,CAAAA,CAAY,MAAA,CAAQ,CAAC,CAAA,CAGzC,IAAIS,CAAAA,CAAQ,CAAA,CACZ,MAAMC,iCAAAA,CACJN,CACA,MAAOO,CAAAA,EAAU,CAEf,IAAIC,CAAAA,CAAW,CAAA,CACTC,CAAAA,CAAc,CAAA,CACpB,GAAA,CAAA,CAAOD,CAAAA,CAAWC,CAAAA,CAAAA,CAChB,GAAI,CACF,IAAMC,CAAAA,CAAY,MAAMf,CAAAA,CACrB,IAAA,CAAK,CAAA,eAAA,EAAkBE,CAAY,CAAA,MAAA,CAAA,CAAU,CAC5C,IAAA,CAAM,CACJ,MAAA,CAAQ,CACN,WAAA,CAAaU,CACf,CAAA,CACA,KAAA,CAAOA,CAAAA,CAAM,MACf,CACF,CAAC,CAAA,CACA,IAAA,CAAK,CAAA,CAEFI,CAAAA,CAASC,oCAAAA,EAAYrB,CAAgCmB,CAAS,CAAA,CACpEX,CAAAA,CAAQ,IAAA,CAAK,GAAGY,CAAAA,CAAO,KAAK,CAAA,CAC5BN,CAAAA,EAASE,CAAAA,CAAM,MAAA,CACfJ,CAAAA,CAAY,MAAA,CAAOE,CAAK,CAAA,CACxB,KACF,CAAA,KAAA,CAASQ,CAAAA,CAAK,CACZL,CAAAA,EAAY,CAAA,CACZ,IAAMM,CAAAA,iBAAMD,CAAAA,6BAAK,QAAA,6BAAU,MAAA,kBAAQA,CAAAA,6BAAK,SAAA,EAAW,EAAA,CACnD,EAAA,CACEL,CAAAA,EAAYC,CAAAA,EACZ,CAAChB,EAAAA,CAAK,IAAA,CAAMsB,CAAAA,EAAiBD,CAAAA,CAAI,QAAA,CAASC,CAAY,CAAC,CAAA,CAEvD,MAAM,IAAI,KAAA,CACR,CAAA,oCAAA,EAAuCP,CAAQ,CAAA,WAAA,EAAcM,CAAG,CAAA,CAAA;ACclE;ACEW;AJ5ErB,oGAAA;AAoDM;AAGA;AAAA;AAKQ;AAAK;AACgC,sCAAA;AA4IvC","file":"/home/runner/work/cli/cli/dist/impl-HI3ZAAZJ.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\n\nimport { logger } from '../../../logger';\nimport { uploadPreferenceManagementPreferencesInteractive } from '../../../lib/preference-management';\nimport { splitCsvToList } from '../../../lib/requests';\nimport { readdirSync } from 'fs';\nimport { map } from '../../../lib/bluebird-replace';\nimport { basename, join } from 'path';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n transcendUrl: string;\n file?: string;\n directory?: string;\n dryRun: boolean;\n skipExistingRecordCheck: boolean;\n receiptFileDir: string;\n skipWorkflowTriggers: boolean;\n forceTriggerWorkflows: boolean;\n skipConflictUpdates: boolean;\n isSilent: boolean;\n attributes: string;\n receiptFilepath: string;\n concurrency: number;\n}\n\nexport async function uploadPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n transcendUrl,\n file = '',\n directory,\n dryRun,\n skipExistingRecordCheck,\n receiptFileDir,\n skipWorkflowTriggers,\n forceTriggerWorkflows,\n skipConflictUpdates,\n isSilent,\n attributes,\n concurrency,\n }: UploadPreferencesCommandFlags,\n): Promise<void> {\n if (!!directory && !!file) {\n logger.error(\n colors.red(\n 'Cannot provide both a directory and a file. Please provide only one.',\n ),\n );\n this.process.exit(1);\n }\n\n if (!file && !directory) {\n logger.error(\n colors.red(\n 'A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences',\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process.exit);\n\n const files: string[] = [];\n\n if (directory) {\n try {\n const filesInDirectory = readdirSync(directory);\n const csvFiles = filesInDirectory.filter((file) => file.endsWith('.csv'));\n\n if (csvFiles.length === 0) {\n logger.error(\n colors.red(`No CSV files found in directory: ${directory}`),\n );\n this.process.exit(1);\n }\n\n // Add full paths for each CSV file\n files.push(...csvFiles.map((file) => join(directory, file)));\n } catch (err) {\n logger.error(colors.red(`Failed to read directory: ${directory}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n } else {\n try {\n // Verify file exists and is a CSV\n if (!file.endsWith('.csv')) {\n logger.error(colors.red('File must be a CSV file'));\n this.process.exit(1);\n }\n files.push(file);\n } catch (err) {\n logger.error(colors.red(`Failed to access file: ${file}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n }\n\n logger.info(\n colors.green(\n `Processing ${files.length} consent preferences files for partition: ${partition}`,\n ),\n );\n logger.debug(`Files to process: ${files.join(', ')}`);\n\n if (skipExistingRecordCheck) {\n logger.info(\n colors.bgYellow(\n `Skipping existing record check: ${skipExistingRecordCheck}`,\n ),\n );\n }\n\n await map(\n files,\n async (filePath) => {\n const fileName = basename(filePath).replace('.csv', '');\n await uploadPreferenceManagementPreferencesInteractive({\n receiptFilepath: join(receiptFileDir, `${fileName}-receipts.json`),\n auth,\n sombraAuth,\n file: filePath,\n partition,\n transcendUrl,\n skipConflictUpdates,\n skipWorkflowTriggers,\n skipExistingRecordCheck,\n isSilent,\n dryRun,\n attributes: splitCsvToList(attributes),\n forceTriggerWorkflows,\n });\n },\n { concurrency },\n );\n}\n","import {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllPurposes,\n fetchAllPreferenceTopics,\n PreferenceTopic,\n Purpose,\n} from '../graphql';\nimport colors from 'colors';\nimport { map } from '../bluebird-replace';\nimport { chunk } from 'lodash-es';\nimport { logger } from '../../logger';\nimport cliProgress from 'cli-progress';\nimport { parseAttributesFromString } from '../requests';\nimport { PersistedState } from '@transcend-io/persisted-state';\nimport { parsePreferenceManagementCsvWithCache } from './parsePreferenceManagementCsv';\nimport { PreferenceState } from './codecs';\nimport { PreferenceUpdateItem } from '@transcend-io/privacy-types';\nimport { apply } from '@transcend-io/type-utils';\nimport { NONE_PREFERENCE_MAP } from './parsePreferenceTimestampsFromCsv';\nimport { getPreferenceUpdatesFromRow } from './getPreferenceUpdatesFromRow';\n\n/**\n * Upload a set of consent preferences\n *\n * @param options - Options\n */\nexport async function uploadPreferenceManagementPreferencesInteractive({\n auth,\n sombraAuth,\n receiptFilepath,\n file,\n partition,\n isSilent = true,\n dryRun = false,\n skipWorkflowTriggers = false,\n skipConflictUpdates = false,\n skipExistingRecordCheck = false,\n attributes = [],\n transcendUrl,\n forceTriggerWorkflows = false,\n}: {\n /** The Transcend API key */\n auth: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Partition key */\n partition: string;\n /** File where to store receipt and continue from where left off */\n receiptFilepath: string;\n /** The file to process */\n file: string;\n /** API URL for Transcend backend */\n transcendUrl: string;\n /** Whether to do a dry run */\n dryRun?: boolean;\n /** Whether to upload as isSilent */\n isSilent?: boolean;\n /** Attributes string pre-parse. In format Key:Value */\n attributes?: string[];\n /** Skip workflow triggers */\n skipWorkflowTriggers?: boolean;\n /**\n * When true, only update preferences that do not conflict with existing\n * preferences. When false, update all preferences in CSV based on timestamp.\n */\n skipConflictUpdates?: boolean;\n /** Whether to skip the check for existing records. SHOULD ONLY BE USED FOR INITIAL UPLOAD */\n skipExistingRecordCheck?: boolean;\n /** Whether to force trigger workflows */\n forceTriggerWorkflows?: boolean;\n}): Promise<void> {\n // Parse out the extra attributes to apply to all requests uploaded\n const parsedAttributes = parseAttributesFromString(attributes);\n\n // Create a new state file to store the requests from this run\n const preferenceState = new PersistedState(receiptFilepath, PreferenceState, {\n fileMetadata: {},\n failingUpdates: {},\n pendingUpdates: {},\n });\n const failingRequests = preferenceState.getValue('failingUpdates');\n const pendingRequests = preferenceState.getValue('pendingUpdates');\n let fileMetadata = preferenceState.getValue('fileMetadata');\n\n logger.info(\n colors.magenta(\n 'Restored cache, there are: \\n' +\n `${\n Object.values(failingRequests).length\n } failing requests to be retried\\n` +\n `${\n Object.values(pendingRequests).length\n } pending requests to be processed\\n` +\n `The following files are stored in cache and will be used:\\n${Object.keys(\n fileMetadata,\n )\n .map((x) => x)\n .join('\\n')}\\n` +\n `The following file will be processed: ${file}\\n`,\n ),\n );\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const [sombra, purposes, preferenceTopics] = await Promise.all([\n // Create sombra instance to communicate with\n createSombraGotInstance(transcendUrl, auth, sombraAuth),\n // get all purposes and topics\n forceTriggerWorkflows\n ? Promise.resolve([] as Purpose[])\n : fetchAllPurposes(client),\n forceTriggerWorkflows\n ? Promise.resolve([] as PreferenceTopic[])\n : fetchAllPreferenceTopics(client),\n ]);\n\n // Process the file\n await parsePreferenceManagementCsvWithCache(\n {\n file,\n purposeSlugs: purposes.map((x) => x.trackingType),\n preferenceTopics,\n sombra,\n partitionKey: partition,\n skipExistingRecordCheck,\n forceTriggerWorkflows,\n },\n preferenceState,\n );\n\n // Construct the pending updates\n const pendingUpdates: Record<string, PreferenceUpdateItem> = {};\n fileMetadata = preferenceState.getValue('fileMetadata');\n const metadata = fileMetadata[file];\n\n logger.info(\n colors.magenta(\n `Found ${\n Object.entries(metadata.pendingSafeUpdates).length\n } safe updates in ${file}`,\n ),\n );\n logger.info(\n colors.magenta(\n `Found ${\n Object.entries(metadata.pendingConflictUpdates).length\n } conflict updates in ${file}`,\n ),\n );\n logger.info(\n colors.magenta(\n `Found ${\n Object.entries(metadata.skippedUpdates).length\n } skipped updates in ${file}`,\n ),\n );\n\n // Update either safe updates only or safe + conflict\n Object.entries({\n ...metadata.pendingSafeUpdates,\n ...(skipConflictUpdates\n ? {}\n : apply(metadata.pendingConflictUpdates, ({ row }) => row)),\n }).forEach(([userId, update]) => {\n // Determine timestamp\n const timestamp =\n metadata.timestampColum === NONE_PREFERENCE_MAP\n ? new Date()\n : new Date(update[metadata.timestampColum!]);\n\n // Determine updates\n const updates = getPreferenceUpdatesFromRow({\n row: update,\n columnToPurposeName: metadata.columnToPurposeName,\n preferenceTopics,\n purposeSlugs: purposes.map((x) => x.trackingType),\n });\n pendingUpdates[userId] = {\n userId,\n partition,\n timestamp: timestamp.toISOString(),\n purposes: Object.entries(updates).map(([purpose, value]) => ({\n ...value,\n purpose,\n workflowSettings: {\n attributes: parsedAttributes,\n isSilent,\n skipWorkflowTrigger: skipWorkflowTriggers,\n },\n })),\n };\n });\n await preferenceState.setValue(pendingUpdates, 'pendingUpdates');\n await preferenceState.setValue({}, 'failingUpdates');\n\n // Exist early if dry run\n if (dryRun) {\n logger.info(\n colors.green(\n `Dry run complete, exiting. ${\n Object.values(pendingUpdates).length\n } pending updates. Check file: ${receiptFilepath}`,\n ),\n );\n return;\n }\n\n logger.info(\n colors.magenta(\n `Uploading ${\n Object.values(pendingUpdates).length\n } preferences to partition: ${partition}`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n // Build a GraphQL client\n let total = 0;\n const updatesToRun = Object.entries(pendingUpdates);\n const chunkedUpdates = chunk(updatesToRun, skipWorkflowTriggers ? 100 : 10);\n progressBar.start(updatesToRun.length, 0);\n await map(\n chunkedUpdates,\n async (currentChunk) => {\n // Make the request\n try {\n await sombra\n .put('v1/preferences', {\n json: {\n records: currentChunk.map(([, update]) => update),\n skipWorkflowTriggers,\n forceTriggerWorkflows,\n },\n })\n .json();\n } catch (err) {\n try {\n const parsed = JSON.parse(err?.response?.body || '{}');\n if (parsed.error) {\n logger.error(colors.red(`Error: ${parsed.error}`));\n }\n } catch (e) {\n // continue\n }\n logger.error(\n colors.red(\n `Failed to upload ${\n currentChunk.length\n } user preferences to partition ${partition}: ${\n err?.response?.body || err?.message\n }`,\n ),\n );\n const failingUpdates = preferenceState.getValue('failingUpdates');\n currentChunk.forEach(([userId, update]) => {\n failingUpdates[userId] = {\n uploadedAt: new Date().toISOString(),\n update,\n error: err?.response?.body || err?.message || 'Unknown error',\n };\n });\n await preferenceState.setValue(failingUpdates, 'failingUpdates');\n }\n\n total += currentChunk.length;\n progressBar.update(total);\n },\n {\n concurrency: 40,\n },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n logger.info(\n colors.green(\n `Successfully uploaded ${\n updatesToRun.length\n } user preferences to partition ${partition} in \"${\n totalTime / 1000\n }\" seconds!`,\n ),\n );\n}\n","import { PersistedState } from '@transcend-io/persisted-state';\nimport type { Got } from 'got';\nimport { keyBy } from 'lodash-es';\nimport * as t from 'io-ts';\nimport colors from 'colors';\nimport { FileMetadataState, PreferenceState } from './codecs';\nimport { logger } from '../../logger';\nimport { readCsv } from '../requests';\nimport { getPreferencesForIdentifiers } from './getPreferencesForIdentifiers';\nimport { PreferenceTopic } from '../graphql';\nimport { getPreferenceUpdatesFromRow } from './getPreferenceUpdatesFromRow';\nimport { parsePreferenceTimestampsFromCsv } from './parsePreferenceTimestampsFromCsv';\nimport { parsePreferenceIdentifiersFromCsv } from './parsePreferenceIdentifiersFromCsv';\nimport { parsePreferenceAndPurposeValuesFromCsv } from './parsePreferenceAndPurposeValuesFromCsv';\nimport { checkIfPendingPreferenceUpdatesAreNoOp } from './checkIfPendingPreferenceUpdatesAreNoOp';\nimport { checkIfPendingPreferenceUpdatesCauseConflict } from './checkIfPendingPreferenceUpdatesCauseConflict';\n\n/**\n * Parse a file into the cache\n *\n *\n * @param options - Options\n * @param cache - The cache to store the parsed file in\n * @returns The cache with the parsed file\n */\nexport async function parsePreferenceManagementCsvWithCache(\n {\n file,\n sombra,\n purposeSlugs,\n preferenceTopics,\n partitionKey,\n skipExistingRecordCheck,\n forceTriggerWorkflows,\n }: {\n /** File to parse */\n file: string;\n /** The purpose slugs that are allowed to be updated */\n purposeSlugs: string[];\n /** The preference topics */\n preferenceTopics: PreferenceTopic[];\n /** Sombra got instance */\n sombra: Got;\n /** Partition key */\n partitionKey: string;\n /** Whether to skip the check for existing records. SHOULD ONLY BE USED FOR INITIAL UPLOAD */\n skipExistingRecordCheck: boolean;\n /** Wheather to force workflow triggers */\n forceTriggerWorkflows: boolean;\n },\n cache: PersistedState<typeof PreferenceState>,\n): Promise<void> {\n // Start the timer\n const t0 = new Date().getTime();\n\n // Get the current metadata\n const fileMetadata = cache.getValue('fileMetadata');\n\n // Read in the file\n logger.info(colors.magenta(`Reading in file: \"${file}\"`));\n let preferences = readCsv(file, t.record(t.string, t.string));\n\n // start building the cache, can use previous cache as well\n let currentState: FileMetadataState = {\n columnToPurposeName: {},\n pendingSafeUpdates: {},\n pendingConflictUpdates: {},\n skippedUpdates: {},\n // Load in the last fetched time\n ...((fileMetadata[file] || {}) as Partial<FileMetadataState>),\n lastFetchedAt: new Date().toISOString(),\n };\n\n // Validate that all timestamps are present in the file\n currentState = await parsePreferenceTimestampsFromCsv(\n preferences,\n currentState,\n );\n fileMetadata[file] = currentState;\n await cache.setValue(fileMetadata, 'fileMetadata');\n\n // Validate that all identifiers are present and unique\n const result = await parsePreferenceIdentifiersFromCsv(\n preferences,\n currentState,\n );\n currentState = result.currentState;\n preferences = result.preferences;\n fileMetadata[file] = currentState;\n await cache.setValue(fileMetadata, 'fileMetadata');\n\n // Ensure all other columns are mapped to purpose and preference\n // slug values\n currentState = await parsePreferenceAndPurposeValuesFromCsv(\n preferences,\n currentState,\n {\n preferenceTopics,\n purposeSlugs,\n forceTriggerWorkflows,\n },\n );\n fileMetadata[file] = currentState;\n await cache.setValue(fileMetadata, 'fileMetadata');\n\n // Grab existing preference store records\n const identifiers = preferences.map(\n (pref) => pref[currentState.identifierColumn!],\n );\n const existingConsentRecords = skipExistingRecordCheck\n ? []\n : await getPreferencesForIdentifiers(sombra, {\n identifiers: identifiers.map((x) => ({ value: x })),\n partitionKey,\n });\n const consentRecordByIdentifier = keyBy(existingConsentRecords, 'userId');\n\n // Clear out previous updates\n currentState.pendingConflictUpdates = {};\n currentState.pendingSafeUpdates = {};\n currentState.skippedUpdates = {};\n\n // Process each row\n preferences.forEach((pref) => {\n // Grab unique Id for the user\n const userId = pref[currentState.identifierColumn!];\n\n // determine updates for user\n const pendingUpdates = getPreferenceUpdatesFromRow({\n row: pref,\n columnToPurposeName: currentState.columnToPurposeName,\n preferenceTopics,\n purposeSlugs,\n });\n\n // Grab current state of the update\n const currentConsentRecord = consentRecordByIdentifier[userId];\n if (forceTriggerWorkflows && !currentConsentRecord) {\n throw new Error(\n `No existing consent record found for user with id: ${userId}. \n When 'forceTriggerWorkflows' is set all the user identifiers should contain a consent record`,\n );\n }\n // Check if the update can be skipped\n // this is the case if a record exists, and the purpose\n // and preference values are all in sync\n if (\n currentConsentRecord &&\n checkIfPendingPreferenceUpdatesAreNoOp({\n currentConsentRecord,\n pendingUpdates,\n preferenceTopics,\n }) &&\n !forceTriggerWorkflows\n ) {\n currentState.skippedUpdates[userId] = pref;\n return;\n }\n\n // Determine if there are any conflicts\n if (\n currentConsentRecord &&\n checkIfPendingPreferenceUpdatesCauseConflict({\n currentConsentRecord,\n pendingUpdates,\n preferenceTopics,\n })\n ) {\n currentState.pendingConflictUpdates[userId] = {\n row: pref,\n record: currentConsentRecord,\n };\n return;\n }\n\n // Add to pending updates\n currentState.pendingSafeUpdates[userId] = pref;\n });\n\n // Read in the file\n fileMetadata[file] = currentState;\n await cache.setValue(fileMetadata, 'fileMetadata');\n const t1 = new Date().getTime();\n logger.info(\n colors.green(\n `Successfully pre-processed file: \"${file}\" in ${(t1 - t0) / 1000}s`,\n ),\n );\n}\n","import { PreferenceQueryResponseItem } from '@transcend-io/privacy-types';\nimport type { Got } from 'got';\nimport colors from 'colors';\nimport cliProgress from 'cli-progress';\nimport { chunk } from 'lodash-es';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport * as t from 'io-ts';\nimport { map } from '../bluebird-replace';\nimport { logger } from '../../logger';\n\nconst PreferenceRecordsQueryResponse = t.intersection([\n t.type({\n nodes: t.array(PreferenceQueryResponseItem),\n }),\n t.partial({\n /** The base64 encoded(PreferenceStorePaginationKey) cursor for pagination */\n cursor: t.string,\n }),\n]);\n\nconst MSGS = [\n 'ENOTFOUND',\n 'ETIMEDOUT',\n '504 Gateway Time-out',\n 'Task timed out after',\n];\n\n/**\n * Grab the current consent preference values for a list of identifiers\n *\n * @param sombra - Backend to make API call to\n * @param options - Options\n * @returns Plaintext context information\n */\nexport async function getPreferencesForIdentifiers(\n sombra: Got,\n {\n identifiers,\n partitionKey,\n skipLogging = false,\n }: {\n /** The list of identifiers to look up */\n identifiers: {\n /** The value of the identifier */\n value: string;\n }[];\n /** The partition key to look up */\n partitionKey: string;\n /** Whether to skip logging */\n skipLogging?: boolean;\n },\n): Promise<PreferenceQueryResponseItem[]> {\n const results: PreferenceQueryResponseItem[] = [];\n const groupedIdentifiers = chunk(identifiers, 100);\n\n // create a new progress bar instance and use shades_classic theme\n const t0 = new Date().getTime();\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n if (!skipLogging) {\n progressBar.start(identifiers.length, 0);\n }\n\n let total = 0;\n await map(\n groupedIdentifiers,\n async (group) => {\n // Make the request with retry logic\n let attempts = 0;\n const maxAttempts = 3;\n while (attempts < maxAttempts) {\n try {\n const rawResult = await sombra\n .post(`v1/preferences/${partitionKey}/query`, {\n json: {\n filter: {\n identifiers: group,\n },\n limit: group.length,\n },\n })\n .json();\n\n const result = decodeCodec(PreferenceRecordsQueryResponse, rawResult);\n results.push(...result.nodes);\n total += group.length;\n progressBar.update(total);\n break; // Exit loop if successful\n } catch (err) {\n attempts += 1;\n const msg = err?.response?.body || err?.message || '';\n if (\n attempts >= maxAttempts ||\n !MSGS.some((errorMessage) => msg.includes(errorMessage))\n ) {\n throw new Error(\n `Received an error from server after ${attempts} attempts: ${msg}`,\n );\n }\n\n logger.warn(\n colors.yellow(\n `[RETRYING FAILED REQUEST - Attempt ${attempts}] ` +\n `Failed to fetch ${group.length} user preferences from partition ${partitionKey}: ${msg}`,\n ),\n );\n }\n }\n },\n {\n concurrency: 40,\n },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n if (!skipLogging) {\n // Log completion time\n logger.info(\n colors.green(`Completed download in \"${totalTime / 1000}\" seconds.`),\n );\n }\n\n return results;\n}\n","import { uniq, groupBy, difference } from 'lodash-es';\nimport colors from 'colors';\nimport inquirer from 'inquirer';\nimport { FileMetadataState } from './codecs';\nimport { logger } from '../../logger';\nimport { inquirerConfirmBoolean } from '../helpers';\n\n/* eslint-disable no-param-reassign */\n\n/**\n * Parse identifiers from a CSV list of preferences\n *\n * Ensures that all rows have a valid identifier\n * and that all identifiers are unique.\n *\n * @param preferences - List of preferences\n * @param currentState - The current file metadata state for parsing this list\n * @returns The updated file metadata state\n */\nexport async function parsePreferenceIdentifiersFromCsv(\n preferences: Record<string, string>[],\n currentState: FileMetadataState,\n): Promise<{\n /** The updated state */\n currentState: FileMetadataState;\n /** The updated preferences */\n preferences: Record<string, string>[];\n}> {\n // Determine columns to map\n const columnNames = uniq(preferences.map((x) => Object.keys(x)).flat());\n\n // Determine the columns that could potentially be used for identifier\n const remainingColumnsForIdentifier = difference(columnNames, [\n ...(currentState.identifierColumn ? [currentState.identifierColumn] : []),\n ...Object.keys(currentState.columnToPurposeName),\n ]);\n\n // Determine the identifier column to work off of\n if (!currentState.identifierColumn) {\n const { identifierName } = await inquirer.prompt<{\n /** Identifier name */\n identifierName: string;\n }>([\n {\n name: 'identifierName',\n message:\n 'Choose the column that will be used as the identifier to upload consent preferences by',\n type: 'list',\n default:\n remainingColumnsForIdentifier.find((col) =>\n col.toLowerCase().includes('email'),\n ) || remainingColumnsForIdentifier[0],\n choices: remainingColumnsForIdentifier,\n },\n ]);\n currentState.identifierColumn = identifierName;\n }\n logger.info(\n colors.magenta(\n `Using identifier column \"${currentState.identifierColumn}\"`,\n ),\n );\n\n // Validate that the identifier column is present for all rows and unique\n const identifierColumnsMissing = preferences\n .map((pref, ind) => (pref[currentState.identifierColumn!] ? null : [ind]))\n .filter((x): x is number[] => !!x)\n .flat();\n if (identifierColumnsMissing.length > 0) {\n const msg = `The identifier column \"${\n currentState.identifierColumn\n }\" is missing a value for the following rows: ${identifierColumnsMissing.join(\n ', ',\n )}`;\n logger.warn(colors.yellow(msg));\n\n // Ask user if they would like to skip rows missing an identifier\n const skip = await inquirerConfirmBoolean({\n message: 'Would you like to skip rows missing an identifier?',\n });\n if (!skip) {\n throw new Error(msg);\n }\n\n // Filter out rows missing an identifier\n const previous = preferences.length;\n preferences = preferences.filter(\n (pref) => pref[currentState.identifierColumn!],\n );\n logger.info(\n colors.yellow(\n `Skipped ${previous - preferences.length} rows missing an identifier`,\n ),\n );\n }\n logger.info(\n colors.magenta(\n `The identifier column \"${currentState.identifierColumn}\" is present for all rows`,\n ),\n );\n\n // Validate that all identifiers are unique\n const rowsByUserId = groupBy(preferences, currentState.identifierColumn);\n const duplicateIdentifiers = Object.entries(rowsByUserId).filter(\n ([, rows]) => rows.length > 1,\n );\n if (duplicateIdentifiers.length > 0) {\n const msg = `The identifier column \"${\n currentState.identifierColumn\n }\" has duplicate values for the following rows: ${duplicateIdentifiers\n .slice(0, 10)\n .map(([userId, rows]) => `${userId} (${rows.length})`)\n .join('\\n')}`;\n logger.warn(colors.yellow(msg));\n\n // Ask user if they would like to take the most recent update\n // for each duplicate identifier\n const skip = await inquirerConfirmBoolean({\n message: 'Would you like to automatically take the latest update?',\n });\n if (!skip) {\n throw new Error(msg);\n }\n preferences = Object.entries(rowsByUserId)\n .map(([, rows]) => {\n const sorted = rows.sort(\n (a, b) =>\n new Date(b[currentState.timestampColum!]).getTime() -\n new Date(a[currentState.timestampColum!]).getTime(),\n );\n return sorted[0];\n })\n .filter((x) => x);\n }\n\n return { currentState, preferences };\n}\n/* eslint-enable no-param-reassign */\n","import { uniq, difference } from 'lodash-es';\nimport colors from 'colors';\nimport inquirer from 'inquirer';\nimport { FileMetadataState } from './codecs';\nimport { logger } from '../../logger';\nimport { mapSeries } from '../bluebird-replace';\nimport { PreferenceTopic } from '../graphql';\nimport { PreferenceTopicType } from '@transcend-io/privacy-types';\nimport { splitCsvToList } from '../requests';\n\n/* eslint-disable no-param-reassign */\n\n/**\n * Parse out the purpose.enabled and preference values from a CSV file\n *\n * @param preferences - List of preferences\n * @param currentState - The current file metadata state for parsing this list\n * @param options - Options\n * @returns The updated file metadata state\n */\nexport async function parsePreferenceAndPurposeValuesFromCsv(\n preferences: Record<string, string>[],\n currentState: FileMetadataState,\n {\n purposeSlugs,\n preferenceTopics,\n forceTriggerWorkflows,\n }: {\n /** The purpose slugs that are allowed to be updated */\n purposeSlugs: string[];\n /** The preference topics */\n preferenceTopics: PreferenceTopic[];\n /** Force workflow triggers */\n forceTriggerWorkflows: boolean;\n },\n): Promise<FileMetadataState> {\n // Determine columns to map\n const columnNames = uniq(preferences.map((x) => Object.keys(x)).flat());\n\n // Determine the columns that could potentially be used for identifier\n const otherColumns = difference(columnNames, [\n ...(currentState.identifierColumn ? [currentState.identifierColumn] : []),\n ...(currentState.timestampColum ? [currentState.timestampColum] : []),\n ]);\n if (otherColumns.length === 0) {\n if (forceTriggerWorkflows) {\n return currentState;\n }\n throw new Error('No other columns to process');\n }\n\n // The purpose and preferences to map to\n const purposeNames = [\n ...purposeSlugs,\n ...preferenceTopics.map((x) => `${x.purpose.trackingType}->${x.slug}`),\n ];\n\n // Ensure all columns are accounted for\n await mapSeries(otherColumns, async (col) => {\n // Determine the unique values to map in this column\n const uniqueValues = uniq(preferences.map((x) => x[col]));\n\n // Map the column to a purpose\n let purposeMapping = currentState.columnToPurposeName[col];\n if (purposeMapping) {\n logger.info(\n colors.magenta(\n `Column \"${col}\" is associated with purpose \"${purposeMapping.purpose}\"`,\n ),\n );\n } else {\n const { purposeName } = await inquirer.prompt<{\n /** purpose name */\n purposeName: string;\n }>([\n {\n name: 'purposeName',\n message: `Choose the purpose that column ${col} is associated with`,\n type: 'list',\n default: purposeNames.find((x) => x.startsWith(purposeSlugs[0])),\n choices: purposeNames,\n },\n ]);\n const [purposeSlug, preferenceSlug] = purposeName.split('->');\n purposeMapping = {\n purpose: purposeSlug,\n preference: preferenceSlug || null,\n valueMapping: {},\n };\n }\n\n // map each value to the purpose value\n await mapSeries(uniqueValues, async (value) => {\n if (purposeMapping.valueMapping[value] !== undefined) {\n logger.info(\n colors.magenta(\n `Value \"${value}\" is associated with purpose value \"${purposeMapping.valueMapping[value]}\"`,\n ),\n );\n return;\n }\n // if preference is null, this column is just for the purpose\n if (purposeMapping.preference === null) {\n const { purposeValue } = await inquirer.prompt<{\n /** purpose value */\n purposeValue: boolean;\n }>([\n {\n name: 'purposeValue',\n message: `Choose the purpose value for value \"${value}\" associated with purpose \"${purposeMapping.purpose}\"`,\n type: 'confirm',\n default: value !== 'false',\n },\n ]);\n purposeMapping.valueMapping[value] = purposeValue;\n }\n\n // if preference is not null, this column is for a specific preference\n if (purposeMapping.preference !== null) {\n const preferenceTopic = preferenceTopics.find(\n (x) => x.slug === purposeMapping.preference,\n );\n if (!preferenceTopic) {\n logger.error(\n colors.red(\n `Preference topic \"${purposeMapping.preference}\" not found`,\n ),\n );\n return;\n }\n const preferenceOptions = preferenceTopic.preferenceOptionValues.map(\n ({ slug }) => slug,\n );\n\n if (preferenceTopic.type === PreferenceTopicType.Boolean) {\n const { preferenceValue } = await inquirer.prompt<{\n /** purpose value */\n preferenceValue: boolean;\n }>([\n {\n name: 'preferenceValue',\n message:\n // eslint-disable-next-line max-len\n `Choose the preference value for \"${preferenceTopic.slug}\" value \"${value}\" associated with purpose \"${purposeMapping.purpose}\"`,\n type: 'confirm',\n default: value !== 'false',\n },\n ]);\n purposeMapping.valueMapping[value] = preferenceValue;\n return;\n }\n\n if (preferenceTopic.type === PreferenceTopicType.Select) {\n const { preferenceValue } = await inquirer.prompt<{\n /** purpose value */\n preferenceValue: boolean;\n }>([\n {\n name: 'preferenceValue',\n // eslint-disable-next-line max-len\n message: `Choose the preference value for \"${preferenceTopic.slug}\" value \"${value}\" associated with purpose \"${purposeMapping.purpose}\"`,\n type: 'list',\n choices: preferenceOptions,\n default: preferenceOptions.find((x) => x === value),\n },\n ]);\n purposeMapping.valueMapping[value] = preferenceValue;\n return;\n }\n\n if (preferenceTopic.type === PreferenceTopicType.MultiSelect) {\n const parsedValues = splitCsvToList(value);\n // need to do this serially\n await mapSeries(parsedValues, async (parsedValue) => {\n // if we already have a value, skip re-processing it again\n if (purposeMapping.valueMapping[parsedValue] !== undefined) {\n return;\n }\n const { preferenceValue } = await inquirer.prompt<{\n /** purpose value */\n preferenceValue: boolean;\n }>([\n {\n name: 'preferenceValue',\n // eslint-disable-next-line max-len\n message: `Choose the preference value for \"${preferenceTopic.slug}\" value \"${parsedValue}\" associated with purpose \"${purposeMapping.purpose}\"`,\n type: 'list',\n choices: preferenceOptions,\n default: preferenceOptions.find((x) => x === parsedValue),\n },\n ]);\n purposeMapping.valueMapping[parsedValue] = preferenceValue;\n });\n return;\n }\n\n throw new Error(\n `Unknown preference topic type: ${preferenceTopic.type}`,\n );\n }\n });\n\n currentState.columnToPurposeName[col] = purposeMapping;\n });\n\n return currentState;\n}\n/* eslint-enable no-param-reassign */\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-YVMYL724.cjs","../src/commands/consent/upload-preferences/impl.ts","../src/lib/preference-management/uploadPreferenceManagementPreferencesInteractive.ts","../src/lib/preference-management/parsePreferenceManagementCsv.ts","../src/lib/preference-management/getPreferencesForIdentifiers.ts","../src/lib/preference-management/parsePreferenceIdentifiersFromCsv.ts","../src/lib/preference-management/parsePreferenceAndPurposeValuesFromCsv.ts"],"names":["PreferenceRecordsQueryResponse","PreferenceQueryResponseItem","MSGS","getPreferencesForIdentifiers","sombra","identifiers","partitionKey","skipLogging","results","groupedIdentifiers","chunk_default","t0","progressBar","cliProgress","total","map","group","attempts","maxAttempts","rawResult","result","decodeCodec","err","msg","errorMessage"],"mappings":"AAAA,u/BAAwC,gCAA6B,wDAAyD,wDAA0C,gCAA6B,wDAAoF,wDAAyC,gCAA6B,wDAAuE,gCAA6B,gFCChb,qGCWK,+DAEO,qJCXZ,2DCHyB,qDAKhB,IAKtBA,EAAAA,CAAmC,CAAA,CAAA,YAAA,CAAa,CAClD,CAAA,CAAA,IAAA,CAAK,CACL,KAAA,CAAS,CAAA,CAAA,KAAA,CAAMC,yCAA2B,CAC5C,CAAC,CAAA,CACC,CAAA,CAAA,OAAA,CAAQ,CAER,MAAA,CAAU,CAAA,CAAA,MACZ,CAAC,CACH,CAAC,CAAA,CAEKC,EAAAA,CAAO,CACX,WAAA,CACA,WAAA,CACA,sBAAA,CACA,sBACF,CAAA,CASA,MAAA,SAAsBC,EAAAA,CACpBC,CAAAA,CACA,CACE,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,CAAA,CAChB,CAAA,CAWwC,CACxC,IAAMC,CAAAA,CAAyC,CAAC,CAAA,CAC1CC,CAAAA,CAAqBC,iCAAAA,CAAML,CAAa,GAAG,CAAA,CAG3CM,CAAAA,CAAK,IAAI,IAAA,CAAK,CAAA,CAAE,OAAA,CAAQ,CAAA,CACxBC,CAAAA,CAAc,IAAIC,qBAAAA,CAAY,SAAA,CAClC,CAAC,CAAA,CACDA,qBAAAA,CAAY,OAAA,CAAQ,cACtB,CAAA,CACKN,CAAAA,EACHK,CAAAA,CAAY,KAAA,CAAMP,CAAAA,CAAY,MAAA,CAAQ,CAAC,CAAA,CAGzC,IAAIS,CAAAA,CAAQ,CAAA,CACZ,MAAMC,iCAAAA,CACJN,CACA,MAAOO,CAAAA,EAAU,CAEf,IAAIC,CAAAA,CAAW,CAAA,CACTC,CAAAA,CAAc,CAAA,CACpB,GAAA,CAAA,CAAOD,CAAAA,CAAWC,CAAAA,CAAAA,CAChB,GAAI,CACF,IAAMC,CAAAA,CAAY,MAAMf,CAAAA,CACrB,IAAA,CAAK,CAAA,eAAA,EAAkBE,CAAY,CAAA,MAAA,CAAA,CAAU,CAC5C,IAAA,CAAM,CACJ,MAAA,CAAQ,CACN,WAAA,CAAaU,CACf,CAAA,CACA,KAAA,CAAOA,CAAAA,CAAM,MACf,CACF,CAAC,CAAA,CACA,IAAA,CAAK,CAAA,CAEFI,CAAAA,CAASC,oCAAAA,EAAYrB,CAAgCmB,CAAS,CAAA,CACpEX,CAAAA,CAAQ,IAAA,CAAK,GAAGY,CAAAA,CAAO,KAAK,CAAA,CAC5BN,CAAAA,EAASE,CAAAA,CAAM,MAAA,CACfJ,CAAAA,CAAY,MAAA,CAAOE,CAAK,CAAA,CACxB,KACF,CAAA,KAAA,CAASQ,CAAAA,CAAK,CACZL,CAAAA,EAAY,CAAA,CACZ,IAAMM,CAAAA,iBAAMD,CAAAA,6BAAK,QAAA,6BAAU,MAAA,kBAAQA,CAAAA,6BAAK,SAAA,EAAW,EAAA,CACnD,EAAA,CACEL,CAAAA,EAAYC,CAAAA,EACZ,CAAChB,EAAAA,CAAK,IAAA,CAAMsB,CAAAA,EAAiBD,CAAAA,CAAI,QAAA,CAASC,CAAY,CAAC,CAAA,CAEvD,MAAM,IAAI,KAAA,CACR,CAAA,oCAAA,EAAuCP,CAAQ,CAAA,WAAA,EAAcM,CAAG,CAAA,CAAA;ACclE;ACEW;AJ5ErB,oGAAA;AAoDM;AAGA;AAAA;AAKQ;AAAK;AACgC,sCAAA;AA4IvC","file":"/home/runner/work/cli/cli/dist/impl-YVMYL724.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\n\nimport { logger } from '../../../logger';\nimport { uploadPreferenceManagementPreferencesInteractive } from '../../../lib/preference-management';\nimport { splitCsvToList } from '../../../lib/requests';\nimport { readdirSync } from 'fs';\nimport { map } from '../../../lib/bluebird-replace';\nimport { basename, join } from 'path';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n transcendUrl: string;\n file?: string;\n directory?: string;\n dryRun: boolean;\n skipExistingRecordCheck: boolean;\n receiptFileDir: string;\n skipWorkflowTriggers: boolean;\n forceTriggerWorkflows: boolean;\n skipConflictUpdates: boolean;\n isSilent: boolean;\n attributes: string;\n receiptFilepath: string;\n concurrency: number;\n}\n\nexport async function uploadPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n transcendUrl,\n file = '',\n directory,\n dryRun,\n skipExistingRecordCheck,\n receiptFileDir,\n skipWorkflowTriggers,\n forceTriggerWorkflows,\n skipConflictUpdates,\n isSilent,\n attributes,\n concurrency,\n }: UploadPreferencesCommandFlags,\n): Promise<void> {\n if (!!directory && !!file) {\n logger.error(\n colors.red(\n 'Cannot provide both a directory and a file. Please provide only one.',\n ),\n );\n this.process.exit(1);\n }\n\n if (!file && !directory) {\n logger.error(\n colors.red(\n 'A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences',\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process.exit);\n\n const files: string[] = [];\n\n if (directory) {\n try {\n const filesInDirectory = readdirSync(directory);\n const csvFiles = filesInDirectory.filter((file) => file.endsWith('.csv'));\n\n if (csvFiles.length === 0) {\n logger.error(\n colors.red(`No CSV files found in directory: ${directory}`),\n );\n this.process.exit(1);\n }\n\n // Add full paths for each CSV file\n files.push(...csvFiles.map((file) => join(directory, file)));\n } catch (err) {\n logger.error(colors.red(`Failed to read directory: ${directory}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n } else {\n try {\n // Verify file exists and is a CSV\n if (!file.endsWith('.csv')) {\n logger.error(colors.red('File must be a CSV file'));\n this.process.exit(1);\n }\n files.push(file);\n } catch (err) {\n logger.error(colors.red(`Failed to access file: ${file}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n }\n\n logger.info(\n colors.green(\n `Processing ${files.length} consent preferences files for partition: ${partition}`,\n ),\n );\n logger.debug(`Files to process: ${files.join(', ')}`);\n\n if (skipExistingRecordCheck) {\n logger.info(\n colors.bgYellow(\n `Skipping existing record check: ${skipExistingRecordCheck}`,\n ),\n );\n }\n\n await map(\n files,\n async (filePath) => {\n const fileName = basename(filePath).replace('.csv', '');\n await uploadPreferenceManagementPreferencesInteractive({\n receiptFilepath: join(receiptFileDir, `${fileName}-receipts.json`),\n auth,\n sombraAuth,\n file: filePath,\n partition,\n transcendUrl,\n skipConflictUpdates,\n skipWorkflowTriggers,\n skipExistingRecordCheck,\n isSilent,\n dryRun,\n attributes: splitCsvToList(attributes),\n forceTriggerWorkflows,\n });\n },\n { concurrency },\n );\n}\n","import {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllPurposes,\n fetchAllPreferenceTopics,\n PreferenceTopic,\n Purpose,\n} from '../graphql';\nimport colors from 'colors';\nimport { map } from '../bluebird-replace';\nimport { chunk } from 'lodash-es';\nimport { logger } from '../../logger';\nimport cliProgress from 'cli-progress';\nimport { parseAttributesFromString } from '../requests';\nimport { PersistedState } from '@transcend-io/persisted-state';\nimport { parsePreferenceManagementCsvWithCache } from './parsePreferenceManagementCsv';\nimport { PreferenceState } from './codecs';\nimport { PreferenceUpdateItem } from '@transcend-io/privacy-types';\nimport { apply } from '@transcend-io/type-utils';\nimport { NONE_PREFERENCE_MAP } from './parsePreferenceTimestampsFromCsv';\nimport { getPreferenceUpdatesFromRow } from './getPreferenceUpdatesFromRow';\n\n/**\n * Upload a set of consent preferences\n *\n * @param options - Options\n */\nexport async function uploadPreferenceManagementPreferencesInteractive({\n auth,\n sombraAuth,\n receiptFilepath,\n file,\n partition,\n isSilent = true,\n dryRun = false,\n skipWorkflowTriggers = false,\n skipConflictUpdates = false,\n skipExistingRecordCheck = false,\n attributes = [],\n transcendUrl,\n forceTriggerWorkflows = false,\n}: {\n /** The Transcend API key */\n auth: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Partition key */\n partition: string;\n /** File where to store receipt and continue from where left off */\n receiptFilepath: string;\n /** The file to process */\n file: string;\n /** API URL for Transcend backend */\n transcendUrl: string;\n /** Whether to do a dry run */\n dryRun?: boolean;\n /** Whether to upload as isSilent */\n isSilent?: boolean;\n /** Attributes string pre-parse. In format Key:Value */\n attributes?: string[];\n /** Skip workflow triggers */\n skipWorkflowTriggers?: boolean;\n /**\n * When true, only update preferences that do not conflict with existing\n * preferences. When false, update all preferences in CSV based on timestamp.\n */\n skipConflictUpdates?: boolean;\n /** Whether to skip the check for existing records. SHOULD ONLY BE USED FOR INITIAL UPLOAD */\n skipExistingRecordCheck?: boolean;\n /** Whether to force trigger workflows */\n forceTriggerWorkflows?: boolean;\n}): Promise<void> {\n // Parse out the extra attributes to apply to all requests uploaded\n const parsedAttributes = parseAttributesFromString(attributes);\n\n // Create a new state file to store the requests from this run\n const preferenceState = new PersistedState(receiptFilepath, PreferenceState, {\n fileMetadata: {},\n failingUpdates: {},\n pendingUpdates: {},\n });\n const failingRequests = preferenceState.getValue('failingUpdates');\n const pendingRequests = preferenceState.getValue('pendingUpdates');\n let fileMetadata = preferenceState.getValue('fileMetadata');\n\n logger.info(\n colors.magenta(\n 'Restored cache, there are: \\n' +\n `${\n Object.values(failingRequests).length\n } failing requests to be retried\\n` +\n `${\n Object.values(pendingRequests).length\n } pending requests to be processed\\n` +\n `The following files are stored in cache and will be used:\\n${Object.keys(\n fileMetadata,\n )\n .map((x) => x)\n .join('\\n')}\\n` +\n `The following file will be processed: ${file}\\n`,\n ),\n );\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const [sombra, purposes, preferenceTopics] = await Promise.all([\n // Create sombra instance to communicate with\n createSombraGotInstance(transcendUrl, auth, sombraAuth),\n // get all purposes and topics\n forceTriggerWorkflows\n ? Promise.resolve([] as Purpose[])\n : fetchAllPurposes(client),\n forceTriggerWorkflows\n ? Promise.resolve([] as PreferenceTopic[])\n : fetchAllPreferenceTopics(client),\n ]);\n\n // Process the file\n await parsePreferenceManagementCsvWithCache(\n {\n file,\n purposeSlugs: purposes.map((x) => x.trackingType),\n preferenceTopics,\n sombra,\n partitionKey: partition,\n skipExistingRecordCheck,\n forceTriggerWorkflows,\n },\n preferenceState,\n );\n\n // Construct the pending updates\n const pendingUpdates: Record<string, PreferenceUpdateItem> = {};\n fileMetadata = preferenceState.getValue('fileMetadata');\n const metadata = fileMetadata[file];\n\n logger.info(\n colors.magenta(\n `Found ${\n Object.entries(metadata.pendingSafeUpdates).length\n } safe updates in ${file}`,\n ),\n );\n logger.info(\n colors.magenta(\n `Found ${\n Object.entries(metadata.pendingConflictUpdates).length\n } conflict updates in ${file}`,\n ),\n );\n logger.info(\n colors.magenta(\n `Found ${\n Object.entries(metadata.skippedUpdates).length\n } skipped updates in ${file}`,\n ),\n );\n\n // Update either safe updates only or safe + conflict\n Object.entries({\n ...metadata.pendingSafeUpdates,\n ...(skipConflictUpdates\n ? {}\n : apply(metadata.pendingConflictUpdates, ({ row }) => row)),\n }).forEach(([userId, update]) => {\n // Determine timestamp\n const timestamp =\n metadata.timestampColum === NONE_PREFERENCE_MAP\n ? new Date()\n : new Date(update[metadata.timestampColum!]);\n\n // Determine updates\n const updates = getPreferenceUpdatesFromRow({\n row: update,\n columnToPurposeName: metadata.columnToPurposeName,\n preferenceTopics,\n purposeSlugs: purposes.map((x) => x.trackingType),\n });\n pendingUpdates[userId] = {\n userId,\n partition,\n timestamp: timestamp.toISOString(),\n purposes: Object.entries(updates).map(([purpose, value]) => ({\n ...value,\n purpose,\n workflowSettings: {\n attributes: parsedAttributes,\n isSilent,\n skipWorkflowTrigger: skipWorkflowTriggers,\n },\n })),\n };\n });\n await preferenceState.setValue(pendingUpdates, 'pendingUpdates');\n await preferenceState.setValue({}, 'failingUpdates');\n\n // Exist early if dry run\n if (dryRun) {\n logger.info(\n colors.green(\n `Dry run complete, exiting. ${\n Object.values(pendingUpdates).length\n } pending updates. Check file: ${receiptFilepath}`,\n ),\n );\n return;\n }\n\n logger.info(\n colors.magenta(\n `Uploading ${\n Object.values(pendingUpdates).length\n } preferences to partition: ${partition}`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n // Build a GraphQL client\n let total = 0;\n const updatesToRun = Object.entries(pendingUpdates);\n const chunkedUpdates = chunk(updatesToRun, skipWorkflowTriggers ? 100 : 10);\n progressBar.start(updatesToRun.length, 0);\n await map(\n chunkedUpdates,\n async (currentChunk) => {\n // Make the request\n try {\n await sombra\n .put('v1/preferences', {\n json: {\n records: currentChunk.map(([, update]) => update),\n skipWorkflowTriggers,\n forceTriggerWorkflows,\n },\n })\n .json();\n } catch (err) {\n try {\n const parsed = JSON.parse(err?.response?.body || '{}');\n if (parsed.error) {\n logger.error(colors.red(`Error: ${parsed.error}`));\n }\n } catch (e) {\n // continue\n }\n logger.error(\n colors.red(\n `Failed to upload ${\n currentChunk.length\n } user preferences to partition ${partition}: ${\n err?.response?.body || err?.message\n }`,\n ),\n );\n const failingUpdates = preferenceState.getValue('failingUpdates');\n currentChunk.forEach(([userId, update]) => {\n failingUpdates[userId] = {\n uploadedAt: new Date().toISOString(),\n update,\n error: err?.response?.body || err?.message || 'Unknown error',\n };\n });\n await preferenceState.setValue(failingUpdates, 'failingUpdates');\n }\n\n total += currentChunk.length;\n progressBar.update(total);\n },\n {\n concurrency: 40,\n },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n logger.info(\n colors.green(\n `Successfully uploaded ${\n updatesToRun.length\n } user preferences to partition ${partition} in \"${\n totalTime / 1000\n }\" seconds!`,\n ),\n );\n}\n","import { PersistedState } from '@transcend-io/persisted-state';\nimport type { Got } from 'got';\nimport { keyBy } from 'lodash-es';\nimport * as t from 'io-ts';\nimport colors from 'colors';\nimport { FileMetadataState, PreferenceState } from './codecs';\nimport { logger } from '../../logger';\nimport { readCsv } from '../requests';\nimport { getPreferencesForIdentifiers } from './getPreferencesForIdentifiers';\nimport { PreferenceTopic } from '../graphql';\nimport { getPreferenceUpdatesFromRow } from './getPreferenceUpdatesFromRow';\nimport { parsePreferenceTimestampsFromCsv } from './parsePreferenceTimestampsFromCsv';\nimport { parsePreferenceIdentifiersFromCsv } from './parsePreferenceIdentifiersFromCsv';\nimport { parsePreferenceAndPurposeValuesFromCsv } from './parsePreferenceAndPurposeValuesFromCsv';\nimport { checkIfPendingPreferenceUpdatesAreNoOp } from './checkIfPendingPreferenceUpdatesAreNoOp';\nimport { checkIfPendingPreferenceUpdatesCauseConflict } from './checkIfPendingPreferenceUpdatesCauseConflict';\n\n/**\n * Parse a file into the cache\n *\n *\n * @param options - Options\n * @param cache - The cache to store the parsed file in\n * @returns The cache with the parsed file\n */\nexport async function parsePreferenceManagementCsvWithCache(\n {\n file,\n sombra,\n purposeSlugs,\n preferenceTopics,\n partitionKey,\n skipExistingRecordCheck,\n forceTriggerWorkflows,\n }: {\n /** File to parse */\n file: string;\n /** The purpose slugs that are allowed to be updated */\n purposeSlugs: string[];\n /** The preference topics */\n preferenceTopics: PreferenceTopic[];\n /** Sombra got instance */\n sombra: Got;\n /** Partition key */\n partitionKey: string;\n /** Whether to skip the check for existing records. SHOULD ONLY BE USED FOR INITIAL UPLOAD */\n skipExistingRecordCheck: boolean;\n /** Wheather to force workflow triggers */\n forceTriggerWorkflows: boolean;\n },\n cache: PersistedState<typeof PreferenceState>,\n): Promise<void> {\n // Start the timer\n const t0 = new Date().getTime();\n\n // Get the current metadata\n const fileMetadata = cache.getValue('fileMetadata');\n\n // Read in the file\n logger.info(colors.magenta(`Reading in file: \"${file}\"`));\n let preferences = readCsv(file, t.record(t.string, t.string));\n\n // start building the cache, can use previous cache as well\n let currentState: FileMetadataState = {\n columnToPurposeName: {},\n pendingSafeUpdates: {},\n pendingConflictUpdates: {},\n skippedUpdates: {},\n // Load in the last fetched time\n ...((fileMetadata[file] || {}) as Partial<FileMetadataState>),\n lastFetchedAt: new Date().toISOString(),\n };\n\n // Validate that all timestamps are present in the file\n currentState = await parsePreferenceTimestampsFromCsv(\n preferences,\n currentState,\n );\n fileMetadata[file] = currentState;\n await cache.setValue(fileMetadata, 'fileMetadata');\n\n // Validate that all identifiers are present and unique\n const result = await parsePreferenceIdentifiersFromCsv(\n preferences,\n currentState,\n );\n currentState = result.currentState;\n preferences = result.preferences;\n fileMetadata[file] = currentState;\n await cache.setValue(fileMetadata, 'fileMetadata');\n\n // Ensure all other columns are mapped to purpose and preference\n // slug values\n currentState = await parsePreferenceAndPurposeValuesFromCsv(\n preferences,\n currentState,\n {\n preferenceTopics,\n purposeSlugs,\n forceTriggerWorkflows,\n },\n );\n fileMetadata[file] = currentState;\n await cache.setValue(fileMetadata, 'fileMetadata');\n\n // Grab existing preference store records\n const identifiers = preferences.map(\n (pref) => pref[currentState.identifierColumn!],\n );\n const existingConsentRecords = skipExistingRecordCheck\n ? []\n : await getPreferencesForIdentifiers(sombra, {\n identifiers: identifiers.map((x) => ({ value: x })),\n partitionKey,\n });\n const consentRecordByIdentifier = keyBy(existingConsentRecords, 'userId');\n\n // Clear out previous updates\n currentState.pendingConflictUpdates = {};\n currentState.pendingSafeUpdates = {};\n currentState.skippedUpdates = {};\n\n // Process each row\n preferences.forEach((pref) => {\n // Grab unique Id for the user\n const userId = pref[currentState.identifierColumn!];\n\n // determine updates for user\n const pendingUpdates = getPreferenceUpdatesFromRow({\n row: pref,\n columnToPurposeName: currentState.columnToPurposeName,\n preferenceTopics,\n purposeSlugs,\n });\n\n // Grab current state of the update\n const currentConsentRecord = consentRecordByIdentifier[userId];\n if (forceTriggerWorkflows && !currentConsentRecord) {\n throw new Error(\n `No existing consent record found for user with id: ${userId}. \n When 'forceTriggerWorkflows' is set all the user identifiers should contain a consent record`,\n );\n }\n // Check if the update can be skipped\n // this is the case if a record exists, and the purpose\n // and preference values are all in sync\n if (\n currentConsentRecord &&\n checkIfPendingPreferenceUpdatesAreNoOp({\n currentConsentRecord,\n pendingUpdates,\n preferenceTopics,\n }) &&\n !forceTriggerWorkflows\n ) {\n currentState.skippedUpdates[userId] = pref;\n return;\n }\n\n // Determine if there are any conflicts\n if (\n currentConsentRecord &&\n checkIfPendingPreferenceUpdatesCauseConflict({\n currentConsentRecord,\n pendingUpdates,\n preferenceTopics,\n })\n ) {\n currentState.pendingConflictUpdates[userId] = {\n row: pref,\n record: currentConsentRecord,\n };\n return;\n }\n\n // Add to pending updates\n currentState.pendingSafeUpdates[userId] = pref;\n });\n\n // Read in the file\n fileMetadata[file] = currentState;\n await cache.setValue(fileMetadata, 'fileMetadata');\n const t1 = new Date().getTime();\n logger.info(\n colors.green(\n `Successfully pre-processed file: \"${file}\" in ${(t1 - t0) / 1000}s`,\n ),\n );\n}\n","import { PreferenceQueryResponseItem } from '@transcend-io/privacy-types';\nimport type { Got } from 'got';\nimport colors from 'colors';\nimport cliProgress from 'cli-progress';\nimport { chunk } from 'lodash-es';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport * as t from 'io-ts';\nimport { map } from '../bluebird-replace';\nimport { logger } from '../../logger';\n\nconst PreferenceRecordsQueryResponse = t.intersection([\n t.type({\n nodes: t.array(PreferenceQueryResponseItem),\n }),\n t.partial({\n /** The base64 encoded(PreferenceStorePaginationKey) cursor for pagination */\n cursor: t.string,\n }),\n]);\n\nconst MSGS = [\n 'ENOTFOUND',\n 'ETIMEDOUT',\n '504 Gateway Time-out',\n 'Task timed out after',\n];\n\n/**\n * Grab the current consent preference values for a list of identifiers\n *\n * @param sombra - Backend to make API call to\n * @param options - Options\n * @returns Plaintext context information\n */\nexport async function getPreferencesForIdentifiers(\n sombra: Got,\n {\n identifiers,\n partitionKey,\n skipLogging = false,\n }: {\n /** The list of identifiers to look up */\n identifiers: {\n /** The value of the identifier */\n value: string;\n }[];\n /** The partition key to look up */\n partitionKey: string;\n /** Whether to skip logging */\n skipLogging?: boolean;\n },\n): Promise<PreferenceQueryResponseItem[]> {\n const results: PreferenceQueryResponseItem[] = [];\n const groupedIdentifiers = chunk(identifiers, 100);\n\n // create a new progress bar instance and use shades_classic theme\n const t0 = new Date().getTime();\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n if (!skipLogging) {\n progressBar.start(identifiers.length, 0);\n }\n\n let total = 0;\n await map(\n groupedIdentifiers,\n async (group) => {\n // Make the request with retry logic\n let attempts = 0;\n const maxAttempts = 3;\n while (attempts < maxAttempts) {\n try {\n const rawResult = await sombra\n .post(`v1/preferences/${partitionKey}/query`, {\n json: {\n filter: {\n identifiers: group,\n },\n limit: group.length,\n },\n })\n .json();\n\n const result = decodeCodec(PreferenceRecordsQueryResponse, rawResult);\n results.push(...result.nodes);\n total += group.length;\n progressBar.update(total);\n break; // Exit loop if successful\n } catch (err) {\n attempts += 1;\n const msg = err?.response?.body || err?.message || '';\n if (\n attempts >= maxAttempts ||\n !MSGS.some((errorMessage) => msg.includes(errorMessage))\n ) {\n throw new Error(\n `Received an error from server after ${attempts} attempts: ${msg}`,\n );\n }\n\n logger.warn(\n colors.yellow(\n `[RETRYING FAILED REQUEST - Attempt ${attempts}] ` +\n `Failed to fetch ${group.length} user preferences from partition ${partitionKey}: ${msg}`,\n ),\n );\n }\n }\n },\n {\n concurrency: 40,\n },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n if (!skipLogging) {\n // Log completion time\n logger.info(\n colors.green(`Completed download in \"${totalTime / 1000}\" seconds.`),\n );\n }\n\n return results;\n}\n","import { uniq, groupBy, difference } from 'lodash-es';\nimport colors from 'colors';\nimport inquirer from 'inquirer';\nimport { FileMetadataState } from './codecs';\nimport { logger } from '../../logger';\nimport { inquirerConfirmBoolean } from '../helpers';\n\n/* eslint-disable no-param-reassign */\n\n/**\n * Parse identifiers from a CSV list of preferences\n *\n * Ensures that all rows have a valid identifier\n * and that all identifiers are unique.\n *\n * @param preferences - List of preferences\n * @param currentState - The current file metadata state for parsing this list\n * @returns The updated file metadata state\n */\nexport async function parsePreferenceIdentifiersFromCsv(\n preferences: Record<string, string>[],\n currentState: FileMetadataState,\n): Promise<{\n /** The updated state */\n currentState: FileMetadataState;\n /** The updated preferences */\n preferences: Record<string, string>[];\n}> {\n // Determine columns to map\n const columnNames = uniq(preferences.map((x) => Object.keys(x)).flat());\n\n // Determine the columns that could potentially be used for identifier\n const remainingColumnsForIdentifier = difference(columnNames, [\n ...(currentState.identifierColumn ? [currentState.identifierColumn] : []),\n ...Object.keys(currentState.columnToPurposeName),\n ]);\n\n // Determine the identifier column to work off of\n if (!currentState.identifierColumn) {\n const { identifierName } = await inquirer.prompt<{\n /** Identifier name */\n identifierName: string;\n }>([\n {\n name: 'identifierName',\n message:\n 'Choose the column that will be used as the identifier to upload consent preferences by',\n type: 'list',\n default:\n remainingColumnsForIdentifier.find((col) =>\n col.toLowerCase().includes('email'),\n ) || remainingColumnsForIdentifier[0],\n choices: remainingColumnsForIdentifier,\n },\n ]);\n currentState.identifierColumn = identifierName;\n }\n logger.info(\n colors.magenta(\n `Using identifier column \"${currentState.identifierColumn}\"`,\n ),\n );\n\n // Validate that the identifier column is present for all rows and unique\n const identifierColumnsMissing = preferences\n .map((pref, ind) => (pref[currentState.identifierColumn!] ? null : [ind]))\n .filter((x): x is number[] => !!x)\n .flat();\n if (identifierColumnsMissing.length > 0) {\n const msg = `The identifier column \"${\n currentState.identifierColumn\n }\" is missing a value for the following rows: ${identifierColumnsMissing.join(\n ', ',\n )}`;\n logger.warn(colors.yellow(msg));\n\n // Ask user if they would like to skip rows missing an identifier\n const skip = await inquirerConfirmBoolean({\n message: 'Would you like to skip rows missing an identifier?',\n });\n if (!skip) {\n throw new Error(msg);\n }\n\n // Filter out rows missing an identifier\n const previous = preferences.length;\n preferences = preferences.filter(\n (pref) => pref[currentState.identifierColumn!],\n );\n logger.info(\n colors.yellow(\n `Skipped ${previous - preferences.length} rows missing an identifier`,\n ),\n );\n }\n logger.info(\n colors.magenta(\n `The identifier column \"${currentState.identifierColumn}\" is present for all rows`,\n ),\n );\n\n // Validate that all identifiers are unique\n const rowsByUserId = groupBy(preferences, currentState.identifierColumn);\n const duplicateIdentifiers = Object.entries(rowsByUserId).filter(\n ([, rows]) => rows.length > 1,\n );\n if (duplicateIdentifiers.length > 0) {\n const msg = `The identifier column \"${\n currentState.identifierColumn\n }\" has duplicate values for the following rows: ${duplicateIdentifiers\n .slice(0, 10)\n .map(([userId, rows]) => `${userId} (${rows.length})`)\n .join('\\n')}`;\n logger.warn(colors.yellow(msg));\n\n // Ask user if they would like to take the most recent update\n // for each duplicate identifier\n const skip = await inquirerConfirmBoolean({\n message: 'Would you like to automatically take the latest update?',\n });\n if (!skip) {\n throw new Error(msg);\n }\n preferences = Object.entries(rowsByUserId)\n .map(([, rows]) => {\n const sorted = rows.sort(\n (a, b) =>\n new Date(b[currentState.timestampColum!]).getTime() -\n new Date(a[currentState.timestampColum!]).getTime(),\n );\n return sorted[0];\n })\n .filter((x) => x);\n }\n\n return { currentState, preferences };\n}\n/* eslint-enable no-param-reassign */\n","import { uniq, difference } from 'lodash-es';\nimport colors from 'colors';\nimport inquirer from 'inquirer';\nimport { FileMetadataState } from './codecs';\nimport { logger } from '../../logger';\nimport { mapSeries } from '../bluebird-replace';\nimport { PreferenceTopic } from '../graphql';\nimport { PreferenceTopicType } from '@transcend-io/privacy-types';\nimport { splitCsvToList } from '../requests';\n\n/* eslint-disable no-param-reassign */\n\n/**\n * Parse out the purpose.enabled and preference values from a CSV file\n *\n * @param preferences - List of preferences\n * @param currentState - The current file metadata state for parsing this list\n * @param options - Options\n * @returns The updated file metadata state\n */\nexport async function parsePreferenceAndPurposeValuesFromCsv(\n preferences: Record<string, string>[],\n currentState: FileMetadataState,\n {\n purposeSlugs,\n preferenceTopics,\n forceTriggerWorkflows,\n }: {\n /** The purpose slugs that are allowed to be updated */\n purposeSlugs: string[];\n /** The preference topics */\n preferenceTopics: PreferenceTopic[];\n /** Force workflow triggers */\n forceTriggerWorkflows: boolean;\n },\n): Promise<FileMetadataState> {\n // Determine columns to map\n const columnNames = uniq(preferences.map((x) => Object.keys(x)).flat());\n\n // Determine the columns that could potentially be used for identifier\n const otherColumns = difference(columnNames, [\n ...(currentState.identifierColumn ? [currentState.identifierColumn] : []),\n ...(currentState.timestampColum ? [currentState.timestampColum] : []),\n ]);\n if (otherColumns.length === 0) {\n if (forceTriggerWorkflows) {\n return currentState;\n }\n throw new Error('No other columns to process');\n }\n\n // The purpose and preferences to map to\n const purposeNames = [\n ...purposeSlugs,\n ...preferenceTopics.map((x) => `${x.purpose.trackingType}->${x.slug}`),\n ];\n\n // Ensure all columns are accounted for\n await mapSeries(otherColumns, async (col) => {\n // Determine the unique values to map in this column\n const uniqueValues = uniq(preferences.map((x) => x[col]));\n\n // Map the column to a purpose\n let purposeMapping = currentState.columnToPurposeName[col];\n if (purposeMapping) {\n logger.info(\n colors.magenta(\n `Column \"${col}\" is associated with purpose \"${purposeMapping.purpose}\"`,\n ),\n );\n } else {\n const { purposeName } = await inquirer.prompt<{\n /** purpose name */\n purposeName: string;\n }>([\n {\n name: 'purposeName',\n message: `Choose the purpose that column ${col} is associated with`,\n type: 'list',\n default: purposeNames.find((x) => x.startsWith(purposeSlugs[0])),\n choices: purposeNames,\n },\n ]);\n const [purposeSlug, preferenceSlug] = purposeName.split('->');\n purposeMapping = {\n purpose: purposeSlug,\n preference: preferenceSlug || null,\n valueMapping: {},\n };\n }\n\n // map each value to the purpose value\n await mapSeries(uniqueValues, async (value) => {\n if (purposeMapping.valueMapping[value] !== undefined) {\n logger.info(\n colors.magenta(\n `Value \"${value}\" is associated with purpose value \"${purposeMapping.valueMapping[value]}\"`,\n ),\n );\n return;\n }\n // if preference is null, this column is just for the purpose\n if (purposeMapping.preference === null) {\n const { purposeValue } = await inquirer.prompt<{\n /** purpose value */\n purposeValue: boolean;\n }>([\n {\n name: 'purposeValue',\n message: `Choose the purpose value for value \"${value}\" associated with purpose \"${purposeMapping.purpose}\"`,\n type: 'confirm',\n default: value !== 'false',\n },\n ]);\n purposeMapping.valueMapping[value] = purposeValue;\n }\n\n // if preference is not null, this column is for a specific preference\n if (purposeMapping.preference !== null) {\n const preferenceTopic = preferenceTopics.find(\n (x) => x.slug === purposeMapping.preference,\n );\n if (!preferenceTopic) {\n logger.error(\n colors.red(\n `Preference topic \"${purposeMapping.preference}\" not found`,\n ),\n );\n return;\n }\n const preferenceOptions = preferenceTopic.preferenceOptionValues.map(\n ({ slug }) => slug,\n );\n\n if (preferenceTopic.type === PreferenceTopicType.Boolean) {\n const { preferenceValue } = await inquirer.prompt<{\n /** purpose value */\n preferenceValue: boolean;\n }>([\n {\n name: 'preferenceValue',\n message:\n // eslint-disable-next-line max-len\n `Choose the preference value for \"${preferenceTopic.slug}\" value \"${value}\" associated with purpose \"${purposeMapping.purpose}\"`,\n type: 'confirm',\n default: value !== 'false',\n },\n ]);\n purposeMapping.valueMapping[value] = preferenceValue;\n return;\n }\n\n if (preferenceTopic.type === PreferenceTopicType.Select) {\n const { preferenceValue } = await inquirer.prompt<{\n /** purpose value */\n preferenceValue: boolean;\n }>([\n {\n name: 'preferenceValue',\n // eslint-disable-next-line max-len\n message: `Choose the preference value for \"${preferenceTopic.slug}\" value \"${value}\" associated with purpose \"${purposeMapping.purpose}\"`,\n type: 'list',\n choices: preferenceOptions,\n default: preferenceOptions.find((x) => x === value),\n },\n ]);\n purposeMapping.valueMapping[value] = preferenceValue;\n return;\n }\n\n if (preferenceTopic.type === PreferenceTopicType.MultiSelect) {\n const parsedValues = splitCsvToList(value);\n // need to do this serially\n await mapSeries(parsedValues, async (parsedValue) => {\n // if we already have a value, skip re-processing it again\n if (purposeMapping.valueMapping[parsedValue] !== undefined) {\n return;\n }\n const { preferenceValue } = await inquirer.prompt<{\n /** purpose value */\n preferenceValue: boolean;\n }>([\n {\n name: 'preferenceValue',\n // eslint-disable-next-line max-len\n message: `Choose the preference value for \"${preferenceTopic.slug}\" value \"${parsedValue}\" associated with purpose \"${purposeMapping.purpose}\"`,\n type: 'list',\n choices: preferenceOptions,\n default: preferenceOptions.find((x) => x === parsedValue),\n },\n ]);\n purposeMapping.valueMapping[parsedValue] = preferenceValue;\n });\n return;\n }\n\n throw new Error(\n `Unknown preference topic type: ${preferenceTopic.type}`,\n );\n }\n });\n\n currentState.columnToPurposeName[col] = purposeMapping;\n });\n\n return currentState;\n}\n/* eslint-enable no-param-reassign */\n"]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-AADFRD6P.cjs');var _chunkZVK4HIDFcjs = require('./chunk-ZVK4HIDF.cjs');var _chunkGZ2U36SScjs = require('./chunk-GZ2U36SS.cjs');require('./chunk-V4X4IT3T.cjs');require('./chunk-3FEOMF7G.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-QEM6S2W7.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkMPI5VURJcjs = require('./chunk-MPI5VURJ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-KC7NDLN7.cjs');require('./chunk-3EZGFSMD.cjs');require('./chunk-Q7I37FJV.cjs');async function S({auth:m,partition:c,sombraAuth:p,file:f,transcendUrl:l,timestampBefore:e,timestampAfter:r,identifiers:n=[],concurrency:g}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let u=await _chunkMPI5VURJcjs.Xd.call(void 0, l,m,p),C=await _chunkGZ2U36SScjs.j.call(void 0, u,{partition:c,filterBy:{...e?{timestampBefore:e.toISOString()}:{},...r?{timestampAfter:r.toISOString()}:{},...n.length>0?{identifiers:n}:{}},limit:g});_chunkZVK4HIDFcjs.c.call(void 0, f,C.map(t=>({...t,purposes:JSON.stringify(t.purposes),...t.purposes})))}exports.pullConsentPreferences = S;
2
+ //# sourceMappingURL=impl-ZFJM6LMZ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZP5ZWANC.cjs","../src/commands/consent/pull-consent-preferences/impl.ts"],"names":["pullConsentPreferences","auth","partition","sombraAuth","file","transcendUrl","timestampBefore","timestampAfter","identifiers","concurrency","doneInputValidation","sombra","createSombraGotInstance","preferences","fetchConsentPreferences","writeCsv","pref"],"mappings":"AAAA,yGAA4B,wDAAyC,wDAAyC,gCAA6B,gCAA6B,wDAAoC,gCAA6B,gCAA6B,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCmBpa,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,CAAC,CAAA,CACf,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAMC,CAAAA,CAAS,MAAMC,kCAAAA,CAAwBP,CAAcJ,CAAAA,CAAME,CAAU,CAAA,CAGrEU,CAAAA,CAAc,MAAMC,iCAAAA,CAAwBH,CAAQ,CACxD,SAAA,CAAAT,CAAAA,CACA,QAAA,CAAU,CACR,GAAII,CAAAA,CACA,CAAE,eAAA,CAAiBA,CAAAA,CAAgB,WAAA,CAAY,CAAE,CAAA,CACjD,CAAC,CAAA,CACL,GAAIC,CAAAA,CACA,CAAE,cAAA,CAAgBA,CAAAA,CAAe,WAAA,CAAY,CAAE,CAAA,CAC/C,CAAC,CAAA,CACL,GAAIC,CAAAA,CAAY,MAAA,CAAS,CAAA,CAAI,CAAE,WAAA,CAAAA,CAAY,CAAA,CAAI,CAAC,CAClD,CAAA,CACA,KAAA,CAAOC,CACT,CAAC,CAAA,CAGDM,iCAAAA,CACEX,CACAS,CAAAA,CAAY,GAAA,CAAKG,CAAAA,EAAAA,CAAU,CACzB,GAAGA,CAAAA,CACH,QAAA,CAAU,IAAA,CAAK,SAAA,CAAUA,CAAAA,CAAK,QAAQ,CAAA,CACtC,GAAGA,CAAAA,CAAK,QACV,CAAA,CAAE,CACJ,CACF,CAAA,mCAAA","file":"/home/runner/work/cli/cli/dist/impl-ZP5ZWANC.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { fetchConsentPreferences } from '../../../lib/consent-manager';\nimport { writeCsv } from '../../../lib/cron';\nimport { createSombraGotInstance } from '../../../lib/graphql';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface PullConsentPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n file: string;\n transcendUrl: string;\n timestampBefore?: Date;\n timestampAfter?: Date;\n identifiers?: string[];\n concurrency: number;\n}\n\nexport async function pullConsentPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n file,\n transcendUrl,\n timestampBefore,\n timestampAfter,\n identifiers = [],\n concurrency,\n }: PullConsentPreferencesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, sombraAuth);\n\n // Fetch preferences\n const preferences = await fetchConsentPreferences(sombra, {\n partition,\n filterBy: {\n ...(timestampBefore\n ? { timestampBefore: timestampBefore.toISOString() }\n : {}),\n ...(timestampAfter\n ? { timestampAfter: timestampAfter.toISOString() }\n : {}),\n ...(identifiers.length > 0 ? { identifiers } : {}),\n },\n limit: concurrency,\n });\n\n // Write to disk\n writeCsv(\n file,\n preferences.map((pref) => ({\n ...pref,\n purposes: JSON.stringify(pref.purposes),\n ...pref.purposes,\n })),\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZFJM6LMZ.cjs","../src/commands/consent/pull-consent-preferences/impl.ts"],"names":["pullConsentPreferences","auth","partition","sombraAuth","file","transcendUrl","timestampBefore","timestampAfter","identifiers","concurrency","doneInputValidation","sombra","createSombraGotInstance","preferences","fetchConsentPreferences","writeCsv","pref"],"mappings":"AAAA,yGAA4B,wDAAyC,wDAAyC,gCAA6B,gCAA6B,wDAAoC,gCAA6B,gCAA6B,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCmBpa,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,CAAC,CAAA,CACf,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAMC,CAAAA,CAAS,MAAMC,kCAAAA,CAAwBP,CAAcJ,CAAAA,CAAME,CAAU,CAAA,CAGrEU,CAAAA,CAAc,MAAMC,iCAAAA,CAAwBH,CAAQ,CACxD,SAAA,CAAAT,CAAAA,CACA,QAAA,CAAU,CACR,GAAII,CAAAA,CACA,CAAE,eAAA,CAAiBA,CAAAA,CAAgB,WAAA,CAAY,CAAE,CAAA,CACjD,CAAC,CAAA,CACL,GAAIC,CAAAA,CACA,CAAE,cAAA,CAAgBA,CAAAA,CAAe,WAAA,CAAY,CAAE,CAAA,CAC/C,CAAC,CAAA,CACL,GAAIC,CAAAA,CAAY,MAAA,CAAS,CAAA,CAAI,CAAE,WAAA,CAAAA,CAAY,CAAA,CAAI,CAAC,CAClD,CAAA,CACA,KAAA,CAAOC,CACT,CAAC,CAAA,CAGDM,iCAAAA,CACEX,CACAS,CAAAA,CAAY,GAAA,CAAKG,CAAAA,EAAAA,CAAU,CACzB,GAAGA,CAAAA,CACH,QAAA,CAAU,IAAA,CAAK,SAAA,CAAUA,CAAAA,CAAK,QAAQ,CAAA,CACtC,GAAGA,CAAAA,CAAK,QACV,CAAA,CAAE,CACJ,CACF,CAAA,mCAAA","file":"/home/runner/work/cli/cli/dist/impl-ZFJM6LMZ.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { fetchConsentPreferences } from '../../../lib/consent-manager';\nimport { writeCsv } from '../../../lib/cron';\nimport { createSombraGotInstance } from '../../../lib/graphql';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface PullConsentPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n file: string;\n transcendUrl: string;\n timestampBefore?: Date;\n timestampAfter?: Date;\n identifiers?: string[];\n concurrency: number;\n}\n\nexport async function pullConsentPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n file,\n transcendUrl,\n timestampBefore,\n timestampAfter,\n identifiers = [],\n concurrency,\n }: PullConsentPreferencesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, sombraAuth);\n\n // Fetch preferences\n const preferences = await fetchConsentPreferences(sombra, {\n partition,\n filterBy: {\n ...(timestampBefore\n ? { timestampBefore: timestampBefore.toISOString() }\n : {}),\n ...(timestampAfter\n ? { timestampAfter: timestampAfter.toISOString() }\n : {}),\n ...(identifiers.length > 0 ? { identifiers } : {}),\n },\n limit: concurrency,\n });\n\n // Write to disk\n writeCsv(\n file,\n preferences.map((pref) => ({\n ...pref,\n purposes: JSON.stringify(pref.purposes),\n ...pref.purposes,\n })),\n );\n}\n"]}
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _class;var _chunk327HQXYVcjs = require('./chunk-327HQXYV.cjs');var _chunk5JXP3N7Ucjs = require('./chunk-5JXP3N7U.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkI4XVTF53cjs = require('./chunk-I4XVTF53.cjs');var _chunkTD7ADMVOcjs = require('./chunk-TD7ADMVO.cjs');var _chunk2FBBA65Bcjs = require('./chunk-2FBBA65B.cjs');var _chunkYK5YCHD6cjs = require('./chunk-YK5YCHD6.cjs');var _chunkZ2PA2QDOcjs = require('./chunk-Z2PA2QDO.cjs');var _chunkZVK4HIDFcjs = require('./chunk-ZVK4HIDF.cjs');var _chunkPIJPXUK5cjs = require('./chunk-PIJPXUK5.cjs');var _chunk74OAET6Dcjs = require('./chunk-74OAET6D.cjs');var _chunkNW3O6OPScjs = require('./chunk-NW3O6OPS.cjs');var _chunkUWUR56COcjs = require('./chunk-UWUR56CO.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');var _chunkR77JR6OQcjs = require('./chunk-R77JR6OQ.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkVIPFYWRRcjs = require('./chunk-VIPFYWRR.cjs');var _chunkEAJZX4TXcjs = require('./chunk-EAJZX4TX.cjs');var _chunkQ7I37FJVcjs = require('./chunk-Q7I37FJV.cjs');var _typeutils = require('@transcend-io/type-utils');var _handlebarsutils = require('@transcend-io/handlebars-utils');var _privacytypes = require('@transcend-io/privacy-types');var T=20;async function $(a){let e=[],r=0,t=!1;do{let{largeLanguageModels:{nodes:s}}=await _chunkR77JR6OQcjs.cc.call(void 0, a,_chunkR77JR6OQcjs.Hb,{first:T,offset:r});e.push(...s),r+=T,t=s.length===T}while(t);return e.sort((s,o)=>s.name.localeCompare(o.name))}function j(a){return new RegExp(`<${a}>([\\s\\S]+?)<\\/${a}>`)}function Cm(a){return a}var H=a=>{try{return JSON.parse(a)}catch (e2){return a}},F= exports.TranscendPromptManager = (_class =class{__init() {this.largeLanguageModels=[]}__init2() {this.agentsByName={}}__init3() {this.agentsByAgentId={}}constructor({prompts:e,handlebarsOptions:r={},transcendUrl:t=_chunkVIPFYWRRcjs.e,transcendApiKey:s,requireApproval:o=!0,cacheDuration:i,defaultVariables:p={}}){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);this.prompts=e,this.transcendUrl=t,this.transcendApiKey=s,this.variables=p,this.defaultVariables=p,this.graphQLClient=_chunkR77JR6OQcjs.Wd.call(void 0, t,typeof s=="object"?s.release():s),this.requireApproval=o,this.cacheDuration=i,this.handlebarsOptions=r,this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, r)}async fetchPromptsAndMetadata(){let e=_typeutils.getValues.call(void 0, this.prompts),r=e.map(({id:n})=>n).filter(n=>!!n),t=e.map(({title:n})=>n).filter(n=>!!n),s=_chunkEAJZX4TXcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunkR77JR6OQcjs.Gc.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),$(this.graphQLClient),_chunkR77JR6OQcjs.md.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunkEAJZX4TXcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunkEAJZX4TXcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunkEAJZX4TXcjs.e.call(void 0, o.prompts,"title"),c=_chunkEAJZX4TXcjs.e.call(void 0, o.prompts,"id");return this.variables={...o.calculatedVariables.reduce((n,g)=>Object.assign(n,{[g.name]:g.data?JSON.parse(g.data):g.data}),{}),...this.defaultVariables},this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, {...this.handlebarsOptions,templates:[...this.handlebarsOptions.templates||[],...o.promptPartials.map(n=>({name:n.slug,content:n.content}))]}),this.promptContentMap=_typeutils.apply.call(void 0, this.prompts,({id:n,title:g})=>{let d=n?c[n]:g?m[g]:void 0;if(!d)throw new Error(`Failed to find prompt with title: "${g}" and id: "${n}"`);return d}),this.lastUpdatedAt=new Date,o}async getAgentByName(e){let r=this.agentsByName[e];if(r)return r;let[t]=await _chunkR77JR6OQcjs.md.call(void 0, this.graphQLClient,{names:[e]});if(t)return this.agentsByName[t.name]=t,this.agentsByAgentId[t.agentId]=t,t}async getPromptThreadBySlackTs(e){let[r]=await _chunkR77JR6OQcjs.re.call(void 0, this.graphQLClient,{slackMessageTs:[e]});return r}async getAgentsByName(e){if(e.length<1)throw new Error("Expected at least one name to be provided");let{hasCache:r=[],missingCache:t=[]}=_chunkEAJZX4TXcjs.d.call(void 0, e,p=>this.agentsByName[p]?"hasCache":"missingCache"),s=r.map(p=>this.agentsByName[p]);if(t.length===0)return s;let o=_chunkEAJZX4TXcjs.b.call(void 0, t,50),i=[];return await _chunkR77JR6OQcjs.a.call(void 0, o,async p=>{let m=await _chunkR77JR6OQcjs.md.call(void 0, this.graphQLClient,{names:p});m.forEach(c=>{this.agentsByName[c.name]=c,this.agentsByAgentId[c.agentId]=c}),i.push(...m)}),[...s,...i]}getAgentFiles(e){return _chunkR77JR6OQcjs.Bd.call(void 0, this.graphQLClient,e)}getLargeLanguageModel(e){let r=this.largeLanguageModels.find(t=>typeof e=="string"?t.id===e:t.name===e.name&&t.client===e.client);if(!r)throw new Error(`Failed to find model matching: ${typeof e=="string"?e:JSON.stringify(e)}`);return r}async getPromptDefinition(e){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let{promptContentMap:r}=this;if(!r)throw new Error("Expected this.promptContentMap to be defined");let t=r[e];if(!t)throw new Error(`Expected this.promptContentMap[${e}] to be defined`);return t}async compilePrompt(e,r){let t=await this.getPromptDefinition(e),s=this.prompts[e];if(!s)throw new Error(`Expected this.prompts[${e}] to be defined`);if(this.requireApproval&&t.status!==_privacytypes.PromptStatus.Approved)throw new Error(`Assessment "${t.title}" cannot be used because its in status: "${t.status}"`);if(t.status===_privacytypes.PromptStatus.Rejected)throw new Error(`Assessment "${t.title}" cannot be used because it's in status: "${t.status}"`);return _typeutils.decodeCodec.call(void 0, s.paramCodec,r),this.handlebars.compile(t.content)({currentDate:new Date().toISOString(),...this.variables,...r})}parseAiResponse(e,r){let t=this.prompts[e];if(!t)throw new Error(`Expected this.prompts[${e}] to be defined`);let s=t.extractFromTag&&(j(t.extractFromTag).exec(r)||[])[1]||r;return _typeutils.decodeCodec.call(void 0, t.outputCodec,H(s),!1)}async reportAndParsePromptRun(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);if(t.promptRunMessages[t.promptRunMessages.length-1].role!==_privacytypes.ChatCompletionRole.Assistant)throw new Error(`promptRunMessages[${t.promptRunMessages.length-1}].role is expected to be = ${_privacytypes.ChatCompletionRole.Assistant}`);let i=t.promptRunMessages[t.promptRunMessages.length-1].content,p;try{p=this.parseAiResponse(e,i)}catch(c){throw await _chunkR77JR6OQcjs.Ie.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,error:c.message,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((n,g)=>({...n,...g===0?{template:o.content}:{}}))}),c}let m=await _chunkR77JR6OQcjs.Ie.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Resolved,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((c,n)=>({...c,...n===0?{template:o.content}:{}}))});return{result:p,promptRunId:m,promptRunUrl:`https://app.transcend.io/prompts/runs/${m}`}}async reportPromptRunError(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);let i=await _chunkR77JR6OQcjs.Ie.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((p,m)=>({...p,...m===0?{template:o.content}:{}}))});return{promptRunId:i,promptRunUrl:`https://app.transcend.io/prompts/runs/${i}`}}}, _class);function Lm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function Em(a){return Object.entries(a).reduce((e,[r,t])=>t!=null&&t!==""&&!(Array.isArray(t)&&t.length===0)&&!(typeof t=="object"&&Object.keys(t).length===0)?Object.assign(e,{[r]:t}):e,{})}var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _child_process = require('child_process');function Sm({baseBranch:a,rootDirectory:e,githubRepo:r,excludedGlob:t=[],fileBlockList:s=[]}){_child_process.execSync.call(void 0, `git fetch origin ${a}`);let o=_child_process.execSync.call(void 0, `git ls-remote ${r} "refs/heads/${a}" | cut -f 1`,{encoding:"utf-8"}).split(`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _class;var _chunkVHQY7TSFcjs = require('./chunk-VHQY7TSF.cjs');var _chunk7QV5QNGWcjs = require('./chunk-7QV5QNGW.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkNKVC5Y53cjs = require('./chunk-NKVC5Y53.cjs');var _chunkTD7ADMVOcjs = require('./chunk-TD7ADMVO.cjs');var _chunkSUCCU2FScjs = require('./chunk-SUCCU2FS.cjs');var _chunkASFWHSOVcjs = require('./chunk-ASFWHSOV.cjs');var _chunkAADFRD6Pcjs = require('./chunk-AADFRD6P.cjs');var _chunkZVK4HIDFcjs = require('./chunk-ZVK4HIDF.cjs');var _chunkGZ2U36SScjs = require('./chunk-GZ2U36SS.cjs');var _chunkV4X4IT3Tcjs = require('./chunk-V4X4IT3T.cjs');var _chunk3FEOMF7Gcjs = require('./chunk-3FEOMF7G.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');var _chunkMPI5VURJcjs = require('./chunk-MPI5VURJ.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkKC7NDLN7cjs = require('./chunk-KC7NDLN7.cjs');var _chunk3EZGFSMDcjs = require('./chunk-3EZGFSMD.cjs');var _chunkQ7I37FJVcjs = require('./chunk-Q7I37FJV.cjs');var _typeutils = require('@transcend-io/type-utils');var _handlebarsutils = require('@transcend-io/handlebars-utils');var _privacytypes = require('@transcend-io/privacy-types');var T=20;async function $(a){let e=[],r=0,t=!1;do{let{largeLanguageModels:{nodes:s}}=await _chunkMPI5VURJcjs.cc.call(void 0, a,_chunkMPI5VURJcjs.Hb,{first:T,offset:r});e.push(...s),r+=T,t=s.length===T}while(t);return e.sort((s,o)=>s.name.localeCompare(o.name))}function j(a){return new RegExp(`<${a}>([\\s\\S]+?)<\\/${a}>`)}function Cm(a){return a}var H=a=>{try{return JSON.parse(a)}catch (e2){return a}},F= exports.TranscendPromptManager = (_class =class{__init() {this.largeLanguageModels=[]}__init2() {this.agentsByName={}}__init3() {this.agentsByAgentId={}}constructor({prompts:e,handlebarsOptions:r={},transcendUrl:t=_chunkKC7NDLN7cjs.e,transcendApiKey:s,requireApproval:o=!0,cacheDuration:i,defaultVariables:p={}}){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);this.prompts=e,this.transcendUrl=t,this.transcendApiKey=s,this.variables=p,this.defaultVariables=p,this.graphQLClient=_chunkMPI5VURJcjs.Wd.call(void 0, t,typeof s=="object"?s.release():s),this.requireApproval=o,this.cacheDuration=i,this.handlebarsOptions=r,this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, r)}async fetchPromptsAndMetadata(){let e=_typeutils.getValues.call(void 0, this.prompts),r=e.map(({id:n})=>n).filter(n=>!!n),t=e.map(({title:n})=>n).filter(n=>!!n),s=_chunk3EZGFSMDcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunkMPI5VURJcjs.Gc.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),$(this.graphQLClient),_chunkMPI5VURJcjs.md.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunk3EZGFSMDcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunk3EZGFSMDcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunk3EZGFSMDcjs.e.call(void 0, o.prompts,"title"),c=_chunk3EZGFSMDcjs.e.call(void 0, o.prompts,"id");return this.variables={...o.calculatedVariables.reduce((n,g)=>Object.assign(n,{[g.name]:g.data?JSON.parse(g.data):g.data}),{}),...this.defaultVariables},this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, {...this.handlebarsOptions,templates:[...this.handlebarsOptions.templates||[],...o.promptPartials.map(n=>({name:n.slug,content:n.content}))]}),this.promptContentMap=_typeutils.apply.call(void 0, this.prompts,({id:n,title:g})=>{let d=n?c[n]:g?m[g]:void 0;if(!d)throw new Error(`Failed to find prompt with title: "${g}" and id: "${n}"`);return d}),this.lastUpdatedAt=new Date,o}async getAgentByName(e){let r=this.agentsByName[e];if(r)return r;let[t]=await _chunkMPI5VURJcjs.md.call(void 0, this.graphQLClient,{names:[e]});if(t)return this.agentsByName[t.name]=t,this.agentsByAgentId[t.agentId]=t,t}async getPromptThreadBySlackTs(e){let[r]=await _chunkMPI5VURJcjs.re.call(void 0, this.graphQLClient,{slackMessageTs:[e]});return r}async getAgentsByName(e){if(e.length<1)throw new Error("Expected at least one name to be provided");let{hasCache:r=[],missingCache:t=[]}=_chunk3EZGFSMDcjs.d.call(void 0, e,p=>this.agentsByName[p]?"hasCache":"missingCache"),s=r.map(p=>this.agentsByName[p]);if(t.length===0)return s;let o=_chunk3EZGFSMDcjs.b.call(void 0, t,50),i=[];return await _chunkMPI5VURJcjs.a.call(void 0, o,async p=>{let m=await _chunkMPI5VURJcjs.md.call(void 0, this.graphQLClient,{names:p});m.forEach(c=>{this.agentsByName[c.name]=c,this.agentsByAgentId[c.agentId]=c}),i.push(...m)}),[...s,...i]}getAgentFiles(e){return _chunkMPI5VURJcjs.Bd.call(void 0, this.graphQLClient,e)}getLargeLanguageModel(e){let r=this.largeLanguageModels.find(t=>typeof e=="string"?t.id===e:t.name===e.name&&t.client===e.client);if(!r)throw new Error(`Failed to find model matching: ${typeof e=="string"?e:JSON.stringify(e)}`);return r}async getPromptDefinition(e){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let{promptContentMap:r}=this;if(!r)throw new Error("Expected this.promptContentMap to be defined");let t=r[e];if(!t)throw new Error(`Expected this.promptContentMap[${e}] to be defined`);return t}async compilePrompt(e,r){let t=await this.getPromptDefinition(e),s=this.prompts[e];if(!s)throw new Error(`Expected this.prompts[${e}] to be defined`);if(this.requireApproval&&t.status!==_privacytypes.PromptStatus.Approved)throw new Error(`Assessment "${t.title}" cannot be used because its in status: "${t.status}"`);if(t.status===_privacytypes.PromptStatus.Rejected)throw new Error(`Assessment "${t.title}" cannot be used because it's in status: "${t.status}"`);return _typeutils.decodeCodec.call(void 0, s.paramCodec,r),this.handlebars.compile(t.content)({currentDate:new Date().toISOString(),...this.variables,...r})}parseAiResponse(e,r){let t=this.prompts[e];if(!t)throw new Error(`Expected this.prompts[${e}] to be defined`);let s=t.extractFromTag&&(j(t.extractFromTag).exec(r)||[])[1]||r;return _typeutils.decodeCodec.call(void 0, t.outputCodec,H(s),!1)}async reportAndParsePromptRun(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);if(t.promptRunMessages[t.promptRunMessages.length-1].role!==_privacytypes.ChatCompletionRole.Assistant)throw new Error(`promptRunMessages[${t.promptRunMessages.length-1}].role is expected to be = ${_privacytypes.ChatCompletionRole.Assistant}`);let i=t.promptRunMessages[t.promptRunMessages.length-1].content,p;try{p=this.parseAiResponse(e,i)}catch(c){throw await _chunkMPI5VURJcjs.Ie.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,error:c.message,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((n,g)=>({...n,...g===0?{template:o.content}:{}}))}),c}let m=await _chunkMPI5VURJcjs.Ie.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Resolved,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((c,n)=>({...c,...n===0?{template:o.content}:{}}))});return{result:p,promptRunId:m,promptRunUrl:`https://app.transcend.io/prompts/runs/${m}`}}async reportPromptRunError(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);let i=await _chunkMPI5VURJcjs.Ie.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((p,m)=>({...p,...m===0?{template:o.content}:{}}))});return{promptRunId:i,promptRunUrl:`https://app.transcend.io/prompts/runs/${i}`}}}, _class);function Lm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function Em(a){return Object.entries(a).reduce((e,[r,t])=>t!=null&&t!==""&&!(Array.isArray(t)&&t.length===0)&&!(typeof t=="object"&&Object.keys(t).length===0)?Object.assign(e,{[r]:t}):e,{})}var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _child_process = require('child_process');function Sm({baseBranch:a,rootDirectory:e,githubRepo:r,excludedGlob:t=[],fileBlockList:s=[]}){_child_process.execSync.call(void 0, `git fetch origin ${a}`);let o=_child_process.execSync.call(void 0, `git ls-remote ${r} "refs/heads/${a}" | cut -f 1`,{encoding:"utf-8"}).split(`
2
2
  `)[0],i=_child_process.execSync.call(void 0, "git rev-parse HEAD",{encoding:"utf-8"}).split(`
3
- `)[0];if(!o||!i)throw new Error("FAILED TO FIND COMMIT RANGE");let p=_child_process.execSync.call(void 0, `git fetch && git diff --name-only "${a||o}...${i}" -- ${e}`,{encoding:"utf-8"}),m=_chunkEAJZX4TXcjs.c.call(void 0, p.split(`
4
- `).filter(d=>d),s),c=t.length>0?_fastglob2.default.sync(m,{ignore:t}):m,n={};c.forEach(d=>{let Q=_child_process.execSync.call(void 0, `git show ${i}:${d}`,{encoding:"utf-8"});n[d]=Q});let g=r.split("/").pop().split(".")[0];return{changedFiles:m,fileDiffs:n,repoName:g,commit:i}}exports.ACTIONS = _chunkR77JR6OQcjs.vb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunkR77JR6OQcjs.Ia; exports.ADD_SILO_DISCOVERY_RESULTS = _chunkR77JR6OQcjs.I; exports.ADMIN_DASH = _chunkVIPFYWRRcjs.b; exports.ADMIN_DASH_DATAPOINTS = _chunkVIPFYWRRcjs.d; exports.ADMIN_DASH_INTEGRATIONS = _chunkVIPFYWRRcjs.c; exports.AGENTS = _chunkR77JR6OQcjs.Ib; exports.AGENT_FILES = _chunkR77JR6OQcjs.Lb; exports.AGENT_FUNCTIONS = _chunkR77JR6OQcjs.Ob; exports.API_KEYS = _chunkR77JR6OQcjs.F; exports.APPROVE_PRIVACY_REQUEST = _chunkR77JR6OQcjs.Y; exports.ASSESSMENTS = _chunkR77JR6OQcjs.ga; exports.ASSESSMENT_SECTION_FIELDS = _chunkR77JR6OQcjs.fa; exports.ASSESSMENT_TEMPLATES = _chunkR77JR6OQcjs.ka; exports.ASSUME_ROLE = _chunkR77JR6OQcjs.Gb; exports.ATTRIBUTES = _chunkR77JR6OQcjs.Ma; exports.ATTRIBUTE_KEYS_REQUESTS = _chunkR77JR6OQcjs.N; exports.ATTRIBUTE_VALUES = _chunkR77JR6OQcjs.Qa; exports.ActionInput = _chunkUWUR56COcjs.G; exports.ActionItemCollectionInput = _chunkUWUR56COcjs.R; exports.ActionItemInput = _chunkUWUR56COcjs.S; exports.AgentFileInput = _chunkUWUR56COcjs.o; exports.AgentFunctionInput = _chunkUWUR56COcjs.n; exports.AgentInput = _chunkUWUR56COcjs.m; exports.ApiKeyInput = _chunkUWUR56COcjs.c; exports.AssessmentAction = _chunkR77JR6OQcjs.Ce; exports.AssessmentAnswerOptionInput = _chunkUWUR56COcjs.Y; exports.AssessmentDisplayLogicInput = _chunkUWUR56COcjs.V; exports.AssessmentInput = _chunkUWUR56COcjs.ca; exports.AssessmentNestedRule = _chunkR77JR6OQcjs.Be; exports.AssessmentNestedRuleInput = _chunkUWUR56COcjs.U; exports.AssessmentResourceInput = _chunkUWUR56COcjs.ba; exports.AssessmentRetentionScheduleInput = _chunkUWUR56COcjs.$; exports.AssessmentRiskLogic = _chunkR77JR6OQcjs.Ee; exports.AssessmentRule = _chunkR77JR6OQcjs.Ae; exports.AssessmentRuleInput = _chunkUWUR56COcjs.T; exports.AssessmentSectionInput = _chunkUWUR56COcjs._; exports.AssessmentSectionQuestionInput = _chunkUWUR56COcjs.Z; exports.AssessmentTemplateInput = _chunkUWUR56COcjs.aa; exports.AttestedExtraIdentifiers = _chunkNW3O6OPScjs.w; exports.AttributeInput = _chunkUWUR56COcjs.k; exports.AttributePreview = _chunkUWUR56COcjs.l; exports.AttributeValueInput = _chunkUWUR56COcjs.j; exports.BLANK = _chunkNW3O6OPScjs.c; exports.BULK_APPLY = _chunkNW3O6OPScjs.b; exports.BULK_REQUEST_FILES = _chunkR77JR6OQcjs.Ga; exports.BUSINESS_ENTITIES = _chunkR77JR6OQcjs.sb; exports.BusinessEntityInput = _chunkUWUR56COcjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunkR77JR6OQcjs.Z; exports.CAN_APPLY_IN_BULK = _chunkNW3O6OPScjs.g; exports.CATALOGS = _chunkR77JR6OQcjs.t; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunkR77JR6OQcjs.wa; exports.CODE_PACKAGES = _chunkR77JR6OQcjs.R; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunkR77JR6OQcjs.rb; exports.CONSENT_PARTITIONS = _chunkR77JR6OQcjs.Va; exports.COOKIES = _chunkR77JR6OQcjs._a; exports.CREATE_ACTION_ITEMS = _chunkR77JR6OQcjs.zb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunkR77JR6OQcjs.Ka; exports.CREATE_AGENT = _chunkR77JR6OQcjs.Jb; exports.CREATE_AGENT_FILE = _chunkR77JR6OQcjs.Mb; exports.CREATE_AGENT_FUNCTION = _chunkR77JR6OQcjs.Pb; exports.CREATE_API_KEY = _chunkR77JR6OQcjs.G; exports.CREATE_ATTRIBUTE = _chunkR77JR6OQcjs.Ra; exports.CREATE_ATTRIBUTE_VALUES = _chunkR77JR6OQcjs.Na; exports.CREATE_BUSINESS_ENTITY = _chunkR77JR6OQcjs.tb; exports.CREATE_CODE_PACKAGE = _chunkR77JR6OQcjs.T; exports.CREATE_CONSENT_EXPERIENCE = _chunkR77JR6OQcjs.pb; exports.CREATE_CONSENT_MANAGER = _chunkR77JR6OQcjs.cb; exports.CREATE_CONSENT_PARTITION = _chunkR77JR6OQcjs.qb; exports.CREATE_DATA_FLOWS = _chunkR77JR6OQcjs.Wa; exports.CREATE_DATA_SILOS = _chunkR77JR6OQcjs.o; exports.CREATE_DATA_SUBJECT = _chunkR77JR6OQcjs.z; exports.CREATE_DATA_SUB_CATEGORY = _chunkR77JR6OQcjs.Vb; exports.CREATE_ENRICHER = _chunkR77JR6OQcjs.r; exports.CREATE_IDENTIFIER = _chunkR77JR6OQcjs.w; exports.CREATE_PROCESSING_ACTIVITY = _chunkR77JR6OQcjs.$b; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunkR77JR6OQcjs.Yb; exports.CREATE_PROMPT = _chunkR77JR6OQcjs.qa; exports.CREATE_PROMPT_GROUP = _chunkR77JR6OQcjs.ua; exports.CREATE_PROMPT_PARTIAL = _chunkR77JR6OQcjs.sa; exports.CREATE_REPOSITORY = _chunkR77JR6OQcjs.E; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunkR77JR6OQcjs.Q; exports.CREATE_TEAM = _chunkR77JR6OQcjs.Aa; exports.CREATE_TEMPLATE = _chunkR77JR6OQcjs.L; exports.CREATE_VENDOR = _chunkR77JR6OQcjs.Sb; exports.CachedFileState = _chunkNW3O6OPScjs.h; exports.CachedRequestState = _chunkNW3O6OPScjs.j; exports.CodePackageInput = _chunkUWUR56COcjs.D; exports.CodePackageSdk = _chunkUWUR56COcjs.C; exports.ColumnName = _chunkNW3O6OPScjs.e; exports.ConsentManageExperienceInput = _chunkUWUR56COcjs.K; exports.ConsentManagerInput = _chunkUWUR56COcjs.M; exports.ConsentManagerMetricBin = _chunkR77JR6OQcjs.wc; exports.ConsentManagerServiceMetadata = _chunkUWUR56COcjs.ka; exports.ConsentPreferenceResponse = _chunkPIJPXUK5cjs.i; exports.ConsentPreferenceTopic = _chunkUWUR56COcjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkUWUR56COcjs.da; exports.ConsentPurpose = _chunkUWUR56COcjs.fa; exports.CookieCsvInput = _chunkUWUR56COcjs.ja; exports.CookieInput = _chunkUWUR56COcjs.J; exports.CronIdentifier = _chunkZ2PA2QDOcjs.a; exports.CronIdentifierPush = _chunkZ2PA2QDOcjs.c; exports.DATAPOINT_EXPORT = _chunkR77JR6OQcjs.i; exports.DATA_FLOWS = _chunkR77JR6OQcjs.Za; exports.DATA_POINTS = _chunkR77JR6OQcjs.c; exports.DATA_POINT_COUNT = _chunkR77JR6OQcjs.d; exports.DATA_SILOS = _chunkR77JR6OQcjs.k; exports.DATA_SILOS_ENRICHED = _chunkR77JR6OQcjs.m; exports.DATA_SILO_EXPORT = _chunkR77JR6OQcjs.l; exports.DATA_SUBJECTS = _chunkR77JR6OQcjs.y; exports.DATA_SUB_CATEGORIES = _chunkR77JR6OQcjs.Ub; exports.DEFAULT_TRANSCEND_API = _chunkVIPFYWRRcjs.e; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkVIPFYWRRcjs.f; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunkR77JR6OQcjs.Ge; exports.DELETE_API_KEY = _chunkR77JR6OQcjs.H; exports.DELETE_ATTRIBUTE_VALUE = _chunkR77JR6OQcjs.Pa; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunkR77JR6OQcjs.Bb; exports.DEPLOY_CONSENT_MANAGER = _chunkR77JR6OQcjs.fb; exports.DETERMINE_LOGIN_METHOD = _chunkR77JR6OQcjs.Eb; exports.DataCategoryGuessInput = _chunkUWUR56COcjs.h; exports.DataCategoryInput = _chunkUWUR56COcjs.q; exports.DataCategoryPreviewInput = _chunkUWUR56COcjs.g; exports.DataCategoryRecommendationInput = _chunkUWUR56COcjs.i; exports.DataFlowCsvInput = _chunkUWUR56COcjs.ia; exports.DataFlowInput = _chunkUWUR56COcjs.I; exports.DataSiloInput = _chunkUWUR56COcjs.Q; exports.DataSubjectInput = _chunkUWUR56COcjs.F; exports.DatapointInput = _chunkUWUR56COcjs.w; exports.ENABLED_PLUGINS = _chunkR77JR6OQcjs.J; exports.ENRICHERS = _chunkR77JR6OQcjs.p; exports.ENTRY_COUNT = _chunkR77JR6OQcjs.j; exports.EXPERIENCES = _chunkR77JR6OQcjs.Ua; exports.EnrichPrivacyRequest = _chunk327HQXYVcjs.b; exports.EnricherInput = _chunkUWUR56COcjs.e; exports.FETCH_CONSENT_MANAGER = _chunkR77JR6OQcjs.ab; exports.FETCH_CONSENT_MANAGER_ID = _chunkR77JR6OQcjs.$a; exports.FETCH_CONSENT_MANAGER_THEME = _chunkR77JR6OQcjs.bb; exports.FETCH_PRIVACY_CENTER_ID = _chunkR77JR6OQcjs.Ab; exports.FieldInput = _chunkUWUR56COcjs.v; exports.GLOBAL_ACTION_ITEMS = _chunkR77JR6OQcjs.xb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunkR77JR6OQcjs.Ja; exports.IDENTIFIERS = _chunkR77JR6OQcjs.u; exports.IDENTIFIER_BLOCK_LIST = _chunkNW3O6OPScjs.d; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunkR77JR6OQcjs.ha; exports.INITIALIZER = _chunkR77JR6OQcjs.q; exports.IP_ADDRESS_REGEX = _chunkPIJPXUK5cjs.f; exports.IS_REQUIRED = _chunkNW3O6OPScjs.f; exports.IdentifierInput = _chunkUWUR56COcjs.H; exports.ImportOnetrustAssessmentsInput = _chunkUWUR56COcjs.ra; exports.IntlMessage = _chunkNW3O6OPScjs.A; exports.IntlMessageInput = _chunkUWUR56COcjs.P; exports.LARGE_LANGUAGE_MODELS = _chunkR77JR6OQcjs.Hb; exports.LOGIN = _chunkR77JR6OQcjs.Fb; exports.MESSAGES = _chunkR77JR6OQcjs.aa; exports.NEW_IDENTIFIER_TYPES = _chunkR77JR6OQcjs.v; exports.NONE = _chunkNW3O6OPScjs.a; exports.NOTIFY_ADDITIONAL_TIME = _chunkR77JR6OQcjs.$; exports.ORGANIZATION = _chunkR77JR6OQcjs.M; exports.OneTrustFileFormat = _chunkQ7I37FJVcjs.a; exports.OneTrustPullResource = _chunkQ7I37FJVcjs.b; exports.OneTrustPullSource = _chunkQ7I37FJVcjs.c; exports.OpenAIEnabledRoute = _chunkUWUR56COcjs.ma; exports.OpenAIEnabledRoutes = _chunkUWUR56COcjs.na; exports.OpenAIIntegration = _chunkUWUR56COcjs.oa; exports.OpenAIRouteName = _chunkQ7I37FJVcjs.f; exports.POLICIES = _chunkR77JR6OQcjs.V; exports.PREFERENCE_TOPICS = _chunkR77JR6OQcjs.ja; exports.PRIVACY_CENTER = _chunkR77JR6OQcjs.Cb; exports.PROCESSING_ACTIVITIES = _chunkR77JR6OQcjs._b; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkR77JR6OQcjs.Xb; exports.PROMPTS = _chunkR77JR6OQcjs.la; exports.PROMPTS_WITH_VARIABLES = _chunkR77JR6OQcjs.oa; exports.PROMPT_GROUPS = _chunkR77JR6OQcjs.na; exports.PROMPT_PARTIALS = _chunkR77JR6OQcjs.ma; exports.PROMPT_THREADS = _chunkR77JR6OQcjs.U; exports.PURPOSES = _chunkR77JR6OQcjs.ia; exports.ParsedAttributeInput = _chunkNW3O6OPScjs.o; exports.PartitionInput = _chunkUWUR56COcjs.L; exports.PathfinderPolicy = _chunkUWUR56COcjs.pa; exports.PathfinderPolicyName = _chunkQ7I37FJVcjs.e; exports.PathfinderPolicyNameC = _chunkUWUR56COcjs.la; exports.PathfinderPromptRunMetadata = _chunkUWUR56COcjs.qa; exports.PolicyInput = _chunkUWUR56COcjs.O; exports.PrivacyCenterInput = _chunkUWUR56COcjs.N; exports.PrivacyRequest = _chunkR77JR6OQcjs.me; exports.PrivacyRequestInput = _chunkNW3O6OPScjs.x; exports.PrivacyRequestResponse = _chunkNW3O6OPScjs.G; exports.ProcessingActivityInput = _chunkUWUR56COcjs.A; exports.ProcessingPurposeInput = _chunkUWUR56COcjs.r; exports.ProcessingPurposePreviewInput = _chunkUWUR56COcjs.f; exports.PromptAVendorEmailSettings = _chunkUWUR56COcjs.x; exports.PromptGroupInput = _chunkUWUR56COcjs.u; exports.PromptInput = _chunkUWUR56COcjs.s; exports.PromptPartialInput = _chunkUWUR56COcjs.t; exports.PurposeMap = _chunk74OAET6Dcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunkR77JR6OQcjs.ya; exports.REMOVE_REQUEST_IDENTIFIERS = _chunkR77JR6OQcjs.Ca; exports.REPORT_PROMPT_RUN = _chunkR77JR6OQcjs.Ha; exports.REPOSITORIES = _chunkR77JR6OQcjs.C; exports.REQUESTS = _chunkR77JR6OQcjs.X; exports.REQUEST_DATA_SILOS = _chunkR77JR6OQcjs.va; exports.REQUEST_ENRICHERS = _chunkR77JR6OQcjs.ca; exports.REQUEST_FILES = _chunkR77JR6OQcjs.Fa; exports.REQUEST_IDENTIFIERS = _chunkR77JR6OQcjs.Da; exports.RETRY_REQUEST_DATA_SILO = _chunkR77JR6OQcjs.xa; exports.RETRY_REQUEST_ENRICHER = _chunkR77JR6OQcjs.da; exports.RegionInput = _chunkUWUR56COcjs.z; exports.RepositoryInput = _chunkUWUR56COcjs.E; exports.RequestFileMetadata = _chunkNW3O6OPScjs.B; exports.RequestFileMetadataResponse = _chunkNW3O6OPScjs.C; exports.RequestIdentifiersResponse = _chunkR77JR6OQcjs.ke; exports.RiskAssignmentInput = _chunkUWUR56COcjs.W; exports.RiskLogicInput = _chunkUWUR56COcjs.X; exports.SCOPES_BY_TITLE = _chunkVIPFYWRRcjs.j; exports.SCOPE_TITLES = _chunkVIPFYWRRcjs.k; exports.SET_RESOURCE_ATTRIBUTES = _chunkR77JR6OQcjs.Ta; exports.SKIP_REQUEST_ENRICHER = _chunkR77JR6OQcjs.ea; exports.SOFTWARE_DEVELOPMENT_KITS = _chunkR77JR6OQcjs.O; exports.SOMBRA_VERSION = _chunkR77JR6OQcjs.bc; exports.SUB_DATA_POINTS = _chunkR77JR6OQcjs.e; exports.SUB_DATA_POINTS_COUNT = _chunkR77JR6OQcjs.f; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunkR77JR6OQcjs.g; exports.SYNC_ATTRIBUTE_TYPES = _chunkR77JR6OQcjs.Yc; exports.SoftwareDevelopmentKitInput = _chunkUWUR56COcjs.B; exports.StoredApiKey = _chunkUWUR56COcjs.ha; exports.SuccessfulRequest = _chunkNW3O6OPScjs.i; exports.TEAMS = _chunkR77JR6OQcjs.za; exports.TEMPLATES = _chunkR77JR6OQcjs.K; exports.TOGGLE_CONSENT_PRECEDENCE = _chunkR77JR6OQcjs.mb; exports.TOGGLE_DATA_SUBJECT = _chunkR77JR6OQcjs.B; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunkR77JR6OQcjs.lb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunkR77JR6OQcjs.kb; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunkR77JR6OQcjs.jb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkVIPFYWRRcjs.h; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkVIPFYWRRcjs.g; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkVIPFYWRRcjs.i; exports.TeamInput = _chunkUWUR56COcjs.d; exports.TemplateInput = _chunkUWUR56COcjs.a; exports.TranscendInput = _chunkUWUR56COcjs.ga; exports.TranscendPromptManager = F; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunkR77JR6OQcjs.wb; exports.UPDATE_ACTION_ITEMS = _chunkR77JR6OQcjs.yb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunkR77JR6OQcjs.La; exports.UPDATE_AGENTS = _chunkR77JR6OQcjs.Kb; exports.UPDATE_AGENT_FILES = _chunkR77JR6OQcjs.Nb; exports.UPDATE_AGENT_FUNCTIONS = _chunkR77JR6OQcjs.Qb; exports.UPDATE_ATTRIBUTE = _chunkR77JR6OQcjs.Sa; exports.UPDATE_ATTRIBUTE_VALUES = _chunkR77JR6OQcjs.Oa; exports.UPDATE_BUSINESS_ENTITIES = _chunkR77JR6OQcjs.ub; exports.UPDATE_CODE_PACKAGES = _chunkR77JR6OQcjs.S; exports.UPDATE_CONSENT_EXPERIENCE = _chunkR77JR6OQcjs.ob; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunkR77JR6OQcjs.gb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunkR77JR6OQcjs.hb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunkR77JR6OQcjs.nb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunkR77JR6OQcjs.eb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunkR77JR6OQcjs.db; exports.UPDATE_DATA_FLOWS = _chunkR77JR6OQcjs.Xa; exports.UPDATE_DATA_SILOS = _chunkR77JR6OQcjs.n; exports.UPDATE_DATA_SUBJECT = _chunkR77JR6OQcjs.A; exports.UPDATE_DATA_SUB_CATEGORIES = _chunkR77JR6OQcjs.Wb; exports.UPDATE_ENRICHER = _chunkR77JR6OQcjs.s; exports.UPDATE_IDENTIFIER = _chunkR77JR6OQcjs.x; exports.UPDATE_INTL_MESSAGES = _chunkR77JR6OQcjs.ba; exports.UPDATE_LOAD_OPTIONS = _chunkR77JR6OQcjs.ib; exports.UPDATE_OR_CREATE_COOKIES = _chunkR77JR6OQcjs.Ya; exports.UPDATE_OR_CREATE_DATA_POINT = _chunkR77JR6OQcjs.h; exports.UPDATE_POLICIES = _chunkR77JR6OQcjs.W; exports.UPDATE_PRIVACY_CENTER = _chunkR77JR6OQcjs.Db; exports.UPDATE_PRIVACY_REQUEST = _chunkR77JR6OQcjs._; exports.UPDATE_PROCESSING_ACTIVITIES = _chunkR77JR6OQcjs.ac; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkR77JR6OQcjs.Zb; exports.UPDATE_PROMPTS = _chunkR77JR6OQcjs.pa; exports.UPDATE_PROMPT_GROUPS = _chunkR77JR6OQcjs.ta; exports.UPDATE_PROMPT_PARTIALS = _chunkR77JR6OQcjs.ra; exports.UPDATE_REPOSITORIES = _chunkR77JR6OQcjs.D; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunkR77JR6OQcjs.P; exports.UPDATE_TEAM = _chunkR77JR6OQcjs.Ba; exports.UPDATE_VENDORS = _chunkR77JR6OQcjs.Tb; exports.USERS = _chunkR77JR6OQcjs.Ea; exports.USP_STRING_REGEX = _chunk74OAET6Dcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunk2FBBA65Bcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunk2FBBA65Bcjs.a; exports.VENDORS = _chunkR77JR6OQcjs.Rb; exports.VendorInput = _chunkUWUR56COcjs.p; exports.WebhookHeader = _chunkUWUR56COcjs.b; exports.addMessagesToPromptRun = _chunkR77JR6OQcjs.Ud; exports.appendCsvSync = _chunkZVK4HIDFcjs.b; exports.approvePrivacyRequests = _chunkNW3O6OPScjs.I; exports.assumeRole = _chunkR77JR6OQcjs.xe; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunkR77JR6OQcjs.Wd; exports.buildTranscendGraphQLClientGeneric = _chunkR77JR6OQcjs.Vd; exports.buildXdiSyncEndpoint = _chunkPIJPXUK5cjs.g; exports.bulkRestartRequests = _chunkNW3O6OPScjs.Q; exports.bulkRetryEnrichers = _chunkNW3O6OPScjs.S; exports.cancelPrivacyRequests = _chunkNW3O6OPScjs.L; exports.consentManagersToBusinessEntities = _chunkPIJPXUK5cjs.h; exports.convertToDataSubjectAllowlist = _chunkR77JR6OQcjs.mc; exports.convertToDataSubjectBlockList = _chunkR77JR6OQcjs.lc; exports.createActionItemCollection = _chunkR77JR6OQcjs.qd; exports.createActionItems = _chunkR77JR6OQcjs.ud; exports.createAgent = _chunkR77JR6OQcjs.nd; exports.createAgentFile = _chunkR77JR6OQcjs.Cd; exports.createAgentFunction = _chunkR77JR6OQcjs.yd; exports.createApiKey = _chunkR77JR6OQcjs.ye; exports.createBusinessEntity = _chunkR77JR6OQcjs.$c; exports.createCodePackage = _chunkR77JR6OQcjs.Re; exports.createConsentToken = _chunk74OAET6Dcjs.a; exports.createDataCategory = _chunkR77JR6OQcjs.Kd; exports.createDataFlows = _chunkR77JR6OQcjs.ed; exports.createProcessingPurpose = _chunkR77JR6OQcjs.Od; exports.createPrompt = _chunkR77JR6OQcjs.Hc; exports.createRegexForTag = j; exports.createRepository = _chunkR77JR6OQcjs.Oe; exports.createSoftwareDevelopmentKit = _chunkR77JR6OQcjs.Le; exports.createSombraGotInstance = _chunkR77JR6OQcjs.Xd; exports.createTranscendConsentGotInstance = _chunkR77JR6OQcjs.Yd; exports.createVendor = _chunkR77JR6OQcjs.Gd; exports.defineTranscendPrompts = Cm; exports.deleteApiKey = _chunkR77JR6OQcjs.ze; exports.deployConsentManager = _chunkR77JR6OQcjs.Zd; exports.description = _chunkEAJZX4TXcjs.l; exports.domainToHost = _chunkPIJPXUK5cjs.e; exports.downloadPrivacyRequestFiles = _chunkNW3O6OPScjs.F; exports.enrichPrivacyRequest = _chunk327HQXYVcjs.c; exports.ensureAllDataSubjectsExist = _chunkR77JR6OQcjs.kc; exports.extractClientError = _chunkNW3O6OPScjs.N; exports.fetchActiveSiloDiscoPlugin = _chunkR77JR6OQcjs.$d; exports.fetchAllActionItems = _chunkR77JR6OQcjs.td; exports.fetchAllActions = _chunkR77JR6OQcjs.jd; exports.fetchAllAgentFiles = _chunkR77JR6OQcjs.Bd; exports.fetchAllAgentFunctions = _chunkR77JR6OQcjs.xd; exports.fetchAllAgents = _chunkR77JR6OQcjs.md; exports.fetchAllApiKeys = _chunkR77JR6OQcjs.Dc; exports.fetchAllAssessmentTemplates = _chunkR77JR6OQcjs.be; exports.fetchAllAssessments = _chunkR77JR6OQcjs.ae; exports.fetchAllAttributeValues = _chunkR77JR6OQcjs.Xc; exports.fetchAllAttributes = _chunkR77JR6OQcjs.Zc; exports.fetchAllBusinessEntities = _chunkR77JR6OQcjs._c; exports.fetchAllCatalogs = _chunkR77JR6OQcjs.pe; exports.fetchAllCookies = _chunkR77JR6OQcjs.de; exports.fetchAllDataCategories = _chunkR77JR6OQcjs.Jd; exports.fetchAllDataFlows = _chunkR77JR6OQcjs.cd; exports.fetchAllDataPoints = _chunkR77JR6OQcjs.pc; exports.fetchAllDataSilos = _chunkR77JR6OQcjs.nc; exports.fetchAllDataSubjects = _chunkR77JR6OQcjs.jc; exports.fetchAllEnrichers = _chunkR77JR6OQcjs.gc; exports.fetchAllIdentifiers = _chunkR77JR6OQcjs.dc; exports.fetchAllMessages = _chunkR77JR6OQcjs.ee; exports.fetchAllPolicies = _chunkR77JR6OQcjs.Mc; exports.fetchAllPreferenceTopics = _chunkR77JR6OQcjs.fe; exports.fetchAllPrivacyCenters = _chunkR77JR6OQcjs.ge; exports.fetchAllProcessingActivities = _chunkR77JR6OQcjs.Rd; exports.fetchAllProcessingPurposes = _chunkR77JR6OQcjs.Nd; exports.fetchAllPromptGroups = _chunkR77JR6OQcjs.ld; exports.fetchAllPromptPartials = _chunkR77JR6OQcjs.kd; exports.fetchAllPromptThreads = _chunkR77JR6OQcjs.re; exports.fetchAllPrompts = _chunkR77JR6OQcjs.Fc; exports.fetchAllPurposes = _chunkR77JR6OQcjs.Uc; exports.fetchAllPurposesAndPreferences = _chunkR77JR6OQcjs.he; exports.fetchAllRequestAttributeKeys = _chunkR77JR6OQcjs.ce; exports.fetchAllRequestEnrichers = _chunkR77JR6OQcjs.ie; exports.fetchAllRequestIdentifierMetadata = _chunkR77JR6OQcjs.je; exports.fetchAllRequestIdentifiers = _chunkR77JR6OQcjs.le; exports.fetchAllRequests = _chunkR77JR6OQcjs.ne; exports.fetchAllSubDataPoints = _chunkR77JR6OQcjs.oc; exports.fetchAllTeams = _chunkR77JR6OQcjs.Bc; exports.fetchAllTemplates = _chunkR77JR6OQcjs.hd; exports.fetchAllUsers = _chunkR77JR6OQcjs.oe; exports.fetchAllVendors = _chunkR77JR6OQcjs.Fd; exports.fetchAndIndexCatalogs = _chunkR77JR6OQcjs.qe; exports.fetchApiKeys = _chunkR77JR6OQcjs.Ec; exports.fetchConsentManager = _chunkR77JR6OQcjs.tc; exports.fetchConsentManagerAnalyticsData = _chunkR77JR6OQcjs.xc; exports.fetchConsentManagerExperiences = _chunkR77JR6OQcjs.vc; exports.fetchConsentManagerId = _chunkR77JR6OQcjs.uc; exports.fetchConsentManagerTheme = _chunkR77JR6OQcjs.yc; exports.fetchConsentPreferences = _chunkPIJPXUK5cjs.j; exports.fetchEnrichedDataSilos = _chunkR77JR6OQcjs.qc; exports.fetchIdentifiersAndCreateMissing = _chunkR77JR6OQcjs.ec; exports.fetchPartitions = _chunkR77JR6OQcjs.Sc; exports.fetchPrivacyCenterId = _chunkR77JR6OQcjs.Lc; exports.fetchPrivacyCenterUrl = _chunkR77JR6OQcjs.Kc; exports.fetchPromptsWithVariables = _chunkR77JR6OQcjs.Gc; exports.fetchRequestDataSilo = _chunkR77JR6OQcjs.te; exports.fetchRequestDataSiloActiveCount = _chunkR77JR6OQcjs.ue; exports.fetchRequestDataSilos = _chunkR77JR6OQcjs.se; exports.fetchRequestFilesForRequest = _chunkR77JR6OQcjs.ve; exports.filterNullishValuesFromObject = Em; exports.filterRows = _chunkNW3O6OPScjs.s; exports.fuzzyMatchColumns = _chunkNW3O6OPScjs.l; exports.fuzzySearch = _chunkNW3O6OPScjs.k; exports.generateCrossAccountApiKeys = _chunkYK5YCHD6cjs.a; exports.getFileMetadataForPrivacyRequests = _chunkNW3O6OPScjs.D; exports.getGitFilesThatChanged = Sm; exports.getUniqueValuesForColumn = _chunkNW3O6OPScjs.r; exports.inquirerAutoComplete = _chunkI4XVTF53cjs.c; exports.inquirerConfirmBoolean = _chunkI4XVTF53cjs.a; exports.inquirerConfirmText = _chunkI4XVTF53cjs.b; exports.listDirectories = _chunkYK5YCHD6cjs.d; exports.listFiles = _chunkYK5YCHD6cjs.c; exports.loginUser = _chunkR77JR6OQcjs.we; exports.makeGraphQLRequest = _chunkR77JR6OQcjs.cc; exports.mapColumnsToAttributes = _chunkNW3O6OPScjs.M; exports.mapColumnsToIdentifiers = _chunkNW3O6OPScjs.K; exports.mapCsvColumnsToApi = _chunkNW3O6OPScjs.u; exports.mapCsvRowsToRequestInputs = _chunkNW3O6OPScjs.z; exports.mapEnumValues = _chunkNW3O6OPScjs.m; exports.mapRequestEnumValues = _chunkNW3O6OPScjs.v; exports.markCronIdentifierCompleted = _chunkZ2PA2QDOcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkZ2PA2QDOcjs.f; exports.markSilentPrivacyRequests = _chunkNW3O6OPScjs.t; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkVIPFYWRRcjs.a; exports.normalizeIdentifierValue = _chunkNW3O6OPScjs.y; exports.notifyPrivacyRequestsAdditionalTime = _chunkNW3O6OPScjs.J; exports.parseAssessmentDisplayLogic = _chunkR77JR6OQcjs.De; exports.parseAssessmentRiskLogic = _chunkR77JR6OQcjs.Fe; exports.parseAttributesFromString = _chunkNW3O6OPScjs.p; exports.parseFilePath = _chunkZVK4HIDFcjs.d; exports.parseVariablesFromString = _chunkTD7ADMVOcjs.a; exports.pullAllDatapoints = _chunk5JXP3N7Ucjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkZ2PA2QDOcjs.g; exports.pullConsentManagerMetrics = _chunkPIJPXUK5cjs.d; exports.pullCronPageOfIdentifiers = _chunkZ2PA2QDOcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunk327HQXYVcjs.a; exports.pullPrivacyRequests = _chunkNW3O6OPScjs.U; exports.pullTranscendConfiguration = _chunkR77JR6OQcjs.He; exports.pullUnstructuredSubDataPointRecommendations = _chunk5JXP3N7Ucjs.b; exports.pushCronIdentifiersFromCsv = _chunkZ2PA2QDOcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunk327HQXYVcjs.d; exports.readCsv = _chunkNW3O6OPScjs.q; exports.readTranscendYaml = _chunk2FBBA65Bcjs.d; exports.removeLinks = Lm; exports.removeUnverifiedRequestIdentifiers = _chunkNW3O6OPScjs.W; exports.replaceVariablesInYaml = _chunk2FBBA65Bcjs.c; exports.reportPromptRun = _chunkR77JR6OQcjs.Ie; exports.restartPrivacyRequest = _chunkNW3O6OPScjs.P; exports.retryRequestDataSilos = _chunkNW3O6OPScjs.T; exports.retryRequestEnricher = _chunkR77JR6OQcjs.Je; exports.setResourceAttributes = _chunkR77JR6OQcjs.Ke; exports.skipPreflightJobs = _chunkNW3O6OPScjs.R; exports.skipRequestDataSilos = _chunkNW3O6OPScjs.V; exports.splitCsvToList = _chunkNW3O6OPScjs.n; exports.streamPrivacyRequestFiles = _chunkNW3O6OPScjs.E; exports.submitPrivacyRequest = _chunkNW3O6OPScjs.H; exports.syncAction = _chunkR77JR6OQcjs.gd; exports.syncActionItemCollections = _chunkR77JR6OQcjs.sd; exports.syncActionItems = _chunkR77JR6OQcjs.wd; exports.syncAgentFiles = _chunkR77JR6OQcjs.Ed; exports.syncAgentFunctions = _chunkR77JR6OQcjs.Ad; exports.syncAgents = _chunkR77JR6OQcjs.pd; exports.syncAttribute = _chunkR77JR6OQcjs.ic; exports.syncBusinessEntities = _chunkR77JR6OQcjs.bd; exports.syncCodePackages = _chunkR77JR6OQcjs.Te; exports.syncConfigurationToTranscend = _chunkR77JR6OQcjs.Td; exports.syncConsentManager = _chunkR77JR6OQcjs.Wc; exports.syncConsentManagerExperiences = _chunkR77JR6OQcjs.Vc; exports.syncCookies = _chunkR77JR6OQcjs.Ac; exports.syncDataCategories = _chunkR77JR6OQcjs.Md; exports.syncDataFlows = _chunkR77JR6OQcjs.fd; exports.syncDataSiloDependencies = _chunkR77JR6OQcjs.sc; exports.syncDataSilos = _chunkR77JR6OQcjs.rc; exports.syncDataSubject = _chunkR77JR6OQcjs.Cc; exports.syncEnricher = _chunkR77JR6OQcjs.hc; exports.syncIdentifier = _chunkR77JR6OQcjs.fc; exports.syncIntlMessages = _chunkR77JR6OQcjs.Qc; exports.syncPartitions = _chunkR77JR6OQcjs.Tc; exports.syncPolicies = _chunkR77JR6OQcjs.Oc; exports.syncPrivacyCenter = _chunkR77JR6OQcjs.Rc; exports.syncProcessingActivities = _chunkR77JR6OQcjs.Sd; exports.syncProcessingPurposes = _chunkR77JR6OQcjs.Qd; exports.syncPrompts = _chunkR77JR6OQcjs.Jc; exports.syncRepositories = _chunkR77JR6OQcjs.Qe; exports.syncSoftwareDevelopmentKits = _chunkR77JR6OQcjs.Ne; exports.syncTemplate = _chunkR77JR6OQcjs.id; exports.syncVendors = _chunkR77JR6OQcjs.Id; exports.updateActionItem = _chunkR77JR6OQcjs.vd; exports.updateActionItemCollection = _chunkR77JR6OQcjs.rd; exports.updateAgentFiles = _chunkR77JR6OQcjs.Dd; exports.updateAgentFunctions = _chunkR77JR6OQcjs.zd; exports.updateAgents = _chunkR77JR6OQcjs.od; exports.updateBusinessEntities = _chunkR77JR6OQcjs.ad; exports.updateCodePackages = _chunkR77JR6OQcjs.Se; exports.updateConsentManagerToLatest = _chunkR77JR6OQcjs._d; exports.updateConsentManagerVersionToLatest = _chunkPIJPXUK5cjs.a; exports.updateDataCategories = _chunkR77JR6OQcjs.Ld; exports.updateDataFlows = _chunkR77JR6OQcjs.dd; exports.updateIntlMessages = _chunkR77JR6OQcjs.Pc; exports.updateOrCreateCookies = _chunkR77JR6OQcjs.zc; exports.updatePolicies = _chunkR77JR6OQcjs.Nc; exports.updateProcessingPurposes = _chunkR77JR6OQcjs.Pd; exports.updatePrompts = _chunkR77JR6OQcjs.Ic; exports.updateRepositories = _chunkR77JR6OQcjs.Pe; exports.updateSoftwareDevelopmentKits = _chunkR77JR6OQcjs.Me; exports.updateVendors = _chunkR77JR6OQcjs.Hd; exports.uploadConsents = _chunk74OAET6Dcjs.f; exports.uploadCookiesFromCsv = _chunkPIJPXUK5cjs.c; exports.uploadDataFlowsFromCsv = _chunkPIJPXUK5cjs.b; exports.uploadPrivacyRequestsFromCsv = _chunkNW3O6OPScjs.O; exports.uploadSiloDiscoveryResults = _chunkR77JR6OQcjs.Ue; exports.validateTranscendAuth = _chunkYK5YCHD6cjs.b; exports.version = _chunkEAJZX4TXcjs.m; exports.writeCsv = _chunkZVK4HIDFcjs.c; exports.writeCsvSync = _chunkZVK4HIDFcjs.a; exports.writeLargeCsv = _chunkZVK4HIDFcjs.e; exports.writeTranscendYaml = _chunk2FBBA65Bcjs.e;
3
+ `)[0];if(!o||!i)throw new Error("FAILED TO FIND COMMIT RANGE");let p=_child_process.execSync.call(void 0, `git fetch && git diff --name-only "${a||o}...${i}" -- ${e}`,{encoding:"utf-8"}),m=_chunk3EZGFSMDcjs.c.call(void 0, p.split(`
4
+ `).filter(d=>d),s),c=t.length>0?_fastglob2.default.sync(m,{ignore:t}):m,n={};c.forEach(d=>{let Q=_child_process.execSync.call(void 0, `git show ${i}:${d}`,{encoding:"utf-8"});n[d]=Q});let g=r.split("/").pop().split(".")[0];return{changedFiles:m,fileDiffs:n,repoName:g,commit:i}}exports.ACTIONS = _chunkMPI5VURJcjs.vb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunkMPI5VURJcjs.Ia; exports.ADD_SILO_DISCOVERY_RESULTS = _chunkMPI5VURJcjs.I; exports.ADMIN_DASH = _chunkKC7NDLN7cjs.b; exports.ADMIN_DASH_DATAPOINTS = _chunkKC7NDLN7cjs.d; exports.ADMIN_DASH_INTEGRATIONS = _chunkKC7NDLN7cjs.c; exports.AGENTS = _chunkMPI5VURJcjs.Ib; exports.AGENT_FILES = _chunkMPI5VURJcjs.Lb; exports.AGENT_FUNCTIONS = _chunkMPI5VURJcjs.Ob; exports.API_KEYS = _chunkMPI5VURJcjs.F; exports.APPROVE_PRIVACY_REQUEST = _chunkMPI5VURJcjs.Y; exports.ASSESSMENTS = _chunkMPI5VURJcjs.ga; exports.ASSESSMENT_SECTION_FIELDS = _chunkMPI5VURJcjs.fa; exports.ASSESSMENT_TEMPLATES = _chunkMPI5VURJcjs.ka; exports.ASSUME_ROLE = _chunkMPI5VURJcjs.Gb; exports.ATTRIBUTES = _chunkMPI5VURJcjs.Ma; exports.ATTRIBUTE_KEYS_REQUESTS = _chunkMPI5VURJcjs.N; exports.ATTRIBUTE_VALUES = _chunkMPI5VURJcjs.Qa; exports.ActionInput = _chunkQEM6S2W7cjs.G; exports.ActionItemCollectionInput = _chunkQEM6S2W7cjs.R; exports.ActionItemInput = _chunkQEM6S2W7cjs.S; exports.AgentFileInput = _chunkQEM6S2W7cjs.o; exports.AgentFunctionInput = _chunkQEM6S2W7cjs.n; exports.AgentInput = _chunkQEM6S2W7cjs.m; exports.ApiKeyInput = _chunkQEM6S2W7cjs.c; exports.AssessmentAction = _chunkMPI5VURJcjs.Ce; exports.AssessmentAnswerOptionInput = _chunkQEM6S2W7cjs.Y; exports.AssessmentDisplayLogicInput = _chunkQEM6S2W7cjs.V; exports.AssessmentInput = _chunkQEM6S2W7cjs.ca; exports.AssessmentNestedRule = _chunkMPI5VURJcjs.Be; exports.AssessmentNestedRuleInput = _chunkQEM6S2W7cjs.U; exports.AssessmentResourceInput = _chunkQEM6S2W7cjs.ba; exports.AssessmentRetentionScheduleInput = _chunkQEM6S2W7cjs.$; exports.AssessmentRiskLogic = _chunkMPI5VURJcjs.Ee; exports.AssessmentRule = _chunkMPI5VURJcjs.Ae; exports.AssessmentRuleInput = _chunkQEM6S2W7cjs.T; exports.AssessmentSectionInput = _chunkQEM6S2W7cjs._; exports.AssessmentSectionQuestionInput = _chunkQEM6S2W7cjs.Z; exports.AssessmentTemplateInput = _chunkQEM6S2W7cjs.aa; exports.AttestedExtraIdentifiers = _chunk3FEOMF7Gcjs.w; exports.AttributeInput = _chunkQEM6S2W7cjs.k; exports.AttributePreview = _chunkQEM6S2W7cjs.l; exports.AttributeValueInput = _chunkQEM6S2W7cjs.j; exports.BLANK = _chunk3FEOMF7Gcjs.c; exports.BULK_APPLY = _chunk3FEOMF7Gcjs.b; exports.BULK_REQUEST_FILES = _chunkMPI5VURJcjs.Ga; exports.BUSINESS_ENTITIES = _chunkMPI5VURJcjs.sb; exports.BusinessEntityInput = _chunkQEM6S2W7cjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunkMPI5VURJcjs.Z; exports.CAN_APPLY_IN_BULK = _chunk3FEOMF7Gcjs.g; exports.CATALOGS = _chunkMPI5VURJcjs.t; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunkMPI5VURJcjs.wa; exports.CODE_PACKAGES = _chunkMPI5VURJcjs.R; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunkMPI5VURJcjs.rb; exports.CONSENT_PARTITIONS = _chunkMPI5VURJcjs.Va; exports.COOKIES = _chunkMPI5VURJcjs._a; exports.CREATE_ACTION_ITEMS = _chunkMPI5VURJcjs.zb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunkMPI5VURJcjs.Ka; exports.CREATE_AGENT = _chunkMPI5VURJcjs.Jb; exports.CREATE_AGENT_FILE = _chunkMPI5VURJcjs.Mb; exports.CREATE_AGENT_FUNCTION = _chunkMPI5VURJcjs.Pb; exports.CREATE_API_KEY = _chunkMPI5VURJcjs.G; exports.CREATE_ATTRIBUTE = _chunkMPI5VURJcjs.Ra; exports.CREATE_ATTRIBUTE_VALUES = _chunkMPI5VURJcjs.Na; exports.CREATE_BUSINESS_ENTITY = _chunkMPI5VURJcjs.tb; exports.CREATE_CODE_PACKAGE = _chunkMPI5VURJcjs.T; exports.CREATE_CONSENT_EXPERIENCE = _chunkMPI5VURJcjs.pb; exports.CREATE_CONSENT_MANAGER = _chunkMPI5VURJcjs.cb; exports.CREATE_CONSENT_PARTITION = _chunkMPI5VURJcjs.qb; exports.CREATE_DATA_FLOWS = _chunkMPI5VURJcjs.Wa; exports.CREATE_DATA_SILOS = _chunkMPI5VURJcjs.o; exports.CREATE_DATA_SUBJECT = _chunkMPI5VURJcjs.z; exports.CREATE_DATA_SUB_CATEGORY = _chunkMPI5VURJcjs.Vb; exports.CREATE_ENRICHER = _chunkMPI5VURJcjs.r; exports.CREATE_IDENTIFIER = _chunkMPI5VURJcjs.w; exports.CREATE_PROCESSING_ACTIVITY = _chunkMPI5VURJcjs.$b; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunkMPI5VURJcjs.Yb; exports.CREATE_PROMPT = _chunkMPI5VURJcjs.qa; exports.CREATE_PROMPT_GROUP = _chunkMPI5VURJcjs.ua; exports.CREATE_PROMPT_PARTIAL = _chunkMPI5VURJcjs.sa; exports.CREATE_REPOSITORY = _chunkMPI5VURJcjs.E; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunkMPI5VURJcjs.Q; exports.CREATE_TEAM = _chunkMPI5VURJcjs.Aa; exports.CREATE_TEMPLATE = _chunkMPI5VURJcjs.L; exports.CREATE_VENDOR = _chunkMPI5VURJcjs.Sb; exports.CachedFileState = _chunk3FEOMF7Gcjs.h; exports.CachedRequestState = _chunk3FEOMF7Gcjs.j; exports.CodePackageInput = _chunkQEM6S2W7cjs.D; exports.CodePackageSdk = _chunkQEM6S2W7cjs.C; exports.ColumnName = _chunk3FEOMF7Gcjs.e; exports.ConsentManageExperienceInput = _chunkQEM6S2W7cjs.K; exports.ConsentManagerInput = _chunkQEM6S2W7cjs.M; exports.ConsentManagerMetricBin = _chunkMPI5VURJcjs.wc; exports.ConsentManagerServiceMetadata = _chunkQEM6S2W7cjs.ka; exports.ConsentPreferenceResponse = _chunkGZ2U36SScjs.i; exports.ConsentPreferenceTopic = _chunkQEM6S2W7cjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkQEM6S2W7cjs.da; exports.ConsentPurpose = _chunkQEM6S2W7cjs.fa; exports.CookieCsvInput = _chunkQEM6S2W7cjs.ja; exports.CookieInput = _chunkQEM6S2W7cjs.J; exports.CronIdentifier = _chunkAADFRD6Pcjs.a; exports.CronIdentifierPush = _chunkAADFRD6Pcjs.c; exports.DATAPOINT_EXPORT = _chunkMPI5VURJcjs.i; exports.DATA_FLOWS = _chunkMPI5VURJcjs.Za; exports.DATA_POINTS = _chunkMPI5VURJcjs.c; exports.DATA_POINT_COUNT = _chunkMPI5VURJcjs.d; exports.DATA_SILOS = _chunkMPI5VURJcjs.k; exports.DATA_SILOS_ENRICHED = _chunkMPI5VURJcjs.m; exports.DATA_SILO_EXPORT = _chunkMPI5VURJcjs.l; exports.DATA_SUBJECTS = _chunkMPI5VURJcjs.y; exports.DATA_SUB_CATEGORIES = _chunkMPI5VURJcjs.Ub; exports.DEFAULT_TRANSCEND_API = _chunkKC7NDLN7cjs.e; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkKC7NDLN7cjs.f; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunkMPI5VURJcjs.Ge; exports.DELETE_API_KEY = _chunkMPI5VURJcjs.H; exports.DELETE_ATTRIBUTE_VALUE = _chunkMPI5VURJcjs.Pa; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunkMPI5VURJcjs.Bb; exports.DEPLOY_CONSENT_MANAGER = _chunkMPI5VURJcjs.fb; exports.DETERMINE_LOGIN_METHOD = _chunkMPI5VURJcjs.Eb; exports.DataCategoryGuessInput = _chunkQEM6S2W7cjs.h; exports.DataCategoryInput = _chunkQEM6S2W7cjs.q; exports.DataCategoryPreviewInput = _chunkQEM6S2W7cjs.g; exports.DataCategoryRecommendationInput = _chunkQEM6S2W7cjs.i; exports.DataFlowCsvInput = _chunkQEM6S2W7cjs.ia; exports.DataFlowInput = _chunkQEM6S2W7cjs.I; exports.DataSiloInput = _chunkQEM6S2W7cjs.Q; exports.DataSubjectInput = _chunkQEM6S2W7cjs.F; exports.DatapointInput = _chunkQEM6S2W7cjs.w; exports.ENABLED_PLUGINS = _chunkMPI5VURJcjs.J; exports.ENRICHERS = _chunkMPI5VURJcjs.p; exports.ENTRY_COUNT = _chunkMPI5VURJcjs.j; exports.EXPERIENCES = _chunkMPI5VURJcjs.Ua; exports.EnrichPrivacyRequest = _chunkVHQY7TSFcjs.b; exports.EnricherInput = _chunkQEM6S2W7cjs.e; exports.FETCH_CONSENT_MANAGER = _chunkMPI5VURJcjs.ab; exports.FETCH_CONSENT_MANAGER_ID = _chunkMPI5VURJcjs.$a; exports.FETCH_CONSENT_MANAGER_THEME = _chunkMPI5VURJcjs.bb; exports.FETCH_PRIVACY_CENTER_ID = _chunkMPI5VURJcjs.Ab; exports.FieldInput = _chunkQEM6S2W7cjs.v; exports.GLOBAL_ACTION_ITEMS = _chunkMPI5VURJcjs.xb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunkMPI5VURJcjs.Ja; exports.IDENTIFIERS = _chunkMPI5VURJcjs.u; exports.IDENTIFIER_BLOCK_LIST = _chunk3FEOMF7Gcjs.d; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunkMPI5VURJcjs.ha; exports.INITIALIZER = _chunkMPI5VURJcjs.q; exports.IP_ADDRESS_REGEX = _chunkGZ2U36SScjs.f; exports.IS_REQUIRED = _chunk3FEOMF7Gcjs.f; exports.IdentifierInput = _chunkQEM6S2W7cjs.H; exports.ImportOnetrustAssessmentsInput = _chunkQEM6S2W7cjs.ra; exports.IntlMessage = _chunk3FEOMF7Gcjs.A; exports.IntlMessageInput = _chunkQEM6S2W7cjs.P; exports.LARGE_LANGUAGE_MODELS = _chunkMPI5VURJcjs.Hb; exports.LOGIN = _chunkMPI5VURJcjs.Fb; exports.MESSAGES = _chunkMPI5VURJcjs.aa; exports.NEW_IDENTIFIER_TYPES = _chunkMPI5VURJcjs.v; exports.NONE = _chunk3FEOMF7Gcjs.a; exports.NOTIFY_ADDITIONAL_TIME = _chunkMPI5VURJcjs.$; exports.ORGANIZATION = _chunkMPI5VURJcjs.M; exports.OneTrustFileFormat = _chunkQ7I37FJVcjs.a; exports.OneTrustPullResource = _chunkQ7I37FJVcjs.b; exports.OneTrustPullSource = _chunkQ7I37FJVcjs.c; exports.OpenAIEnabledRoute = _chunkQEM6S2W7cjs.ma; exports.OpenAIEnabledRoutes = _chunkQEM6S2W7cjs.na; exports.OpenAIIntegration = _chunkQEM6S2W7cjs.oa; exports.OpenAIRouteName = _chunkQ7I37FJVcjs.f; exports.POLICIES = _chunkMPI5VURJcjs.V; exports.PREFERENCE_TOPICS = _chunkMPI5VURJcjs.ja; exports.PRIVACY_CENTER = _chunkMPI5VURJcjs.Cb; exports.PROCESSING_ACTIVITIES = _chunkMPI5VURJcjs._b; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkMPI5VURJcjs.Xb; exports.PROMPTS = _chunkMPI5VURJcjs.la; exports.PROMPTS_WITH_VARIABLES = _chunkMPI5VURJcjs.oa; exports.PROMPT_GROUPS = _chunkMPI5VURJcjs.na; exports.PROMPT_PARTIALS = _chunkMPI5VURJcjs.ma; exports.PROMPT_THREADS = _chunkMPI5VURJcjs.U; exports.PURPOSES = _chunkMPI5VURJcjs.ia; exports.ParsedAttributeInput = _chunk3FEOMF7Gcjs.o; exports.PartitionInput = _chunkQEM6S2W7cjs.L; exports.PathfinderPolicy = _chunkQEM6S2W7cjs.pa; exports.PathfinderPolicyName = _chunkQ7I37FJVcjs.e; exports.PathfinderPolicyNameC = _chunkQEM6S2W7cjs.la; exports.PathfinderPromptRunMetadata = _chunkQEM6S2W7cjs.qa; exports.PolicyInput = _chunkQEM6S2W7cjs.O; exports.PrivacyCenterInput = _chunkQEM6S2W7cjs.N; exports.PrivacyRequest = _chunkMPI5VURJcjs.me; exports.PrivacyRequestInput = _chunk3FEOMF7Gcjs.x; exports.PrivacyRequestResponse = _chunk3FEOMF7Gcjs.G; exports.ProcessingActivityInput = _chunkQEM6S2W7cjs.A; exports.ProcessingPurposeInput = _chunkQEM6S2W7cjs.r; exports.ProcessingPurposePreviewInput = _chunkQEM6S2W7cjs.f; exports.PromptAVendorEmailSettings = _chunkQEM6S2W7cjs.x; exports.PromptGroupInput = _chunkQEM6S2W7cjs.u; exports.PromptInput = _chunkQEM6S2W7cjs.s; exports.PromptPartialInput = _chunkQEM6S2W7cjs.t; exports.PurposeMap = _chunkV4X4IT3Tcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunkMPI5VURJcjs.ya; exports.REMOVE_REQUEST_IDENTIFIERS = _chunkMPI5VURJcjs.Ca; exports.REPORT_PROMPT_RUN = _chunkMPI5VURJcjs.Ha; exports.REPOSITORIES = _chunkMPI5VURJcjs.C; exports.REQUESTS = _chunkMPI5VURJcjs.X; exports.REQUEST_DATA_SILOS = _chunkMPI5VURJcjs.va; exports.REQUEST_ENRICHERS = _chunkMPI5VURJcjs.ca; exports.REQUEST_FILES = _chunkMPI5VURJcjs.Fa; exports.REQUEST_IDENTIFIERS = _chunkMPI5VURJcjs.Da; exports.RETRY_REQUEST_DATA_SILO = _chunkMPI5VURJcjs.xa; exports.RETRY_REQUEST_ENRICHER = _chunkMPI5VURJcjs.da; exports.RegionInput = _chunkQEM6S2W7cjs.z; exports.RepositoryInput = _chunkQEM6S2W7cjs.E; exports.RequestFileMetadata = _chunk3FEOMF7Gcjs.B; exports.RequestFileMetadataResponse = _chunk3FEOMF7Gcjs.C; exports.RequestIdentifiersResponse = _chunkMPI5VURJcjs.ke; exports.RiskAssignmentInput = _chunkQEM6S2W7cjs.W; exports.RiskLogicInput = _chunkQEM6S2W7cjs.X; exports.SCOPES_BY_TITLE = _chunkKC7NDLN7cjs.j; exports.SCOPE_TITLES = _chunkKC7NDLN7cjs.k; exports.SET_RESOURCE_ATTRIBUTES = _chunkMPI5VURJcjs.Ta; exports.SKIP_REQUEST_ENRICHER = _chunkMPI5VURJcjs.ea; exports.SOFTWARE_DEVELOPMENT_KITS = _chunkMPI5VURJcjs.O; exports.SOMBRA_VERSION = _chunkMPI5VURJcjs.bc; exports.SUB_DATA_POINTS = _chunkMPI5VURJcjs.e; exports.SUB_DATA_POINTS_COUNT = _chunkMPI5VURJcjs.f; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunkMPI5VURJcjs.g; exports.SYNC_ATTRIBUTE_TYPES = _chunkMPI5VURJcjs.Yc; exports.SoftwareDevelopmentKitInput = _chunkQEM6S2W7cjs.B; exports.StoredApiKey = _chunkQEM6S2W7cjs.ha; exports.SuccessfulRequest = _chunk3FEOMF7Gcjs.i; exports.TEAMS = _chunkMPI5VURJcjs.za; exports.TEMPLATES = _chunkMPI5VURJcjs.K; exports.TOGGLE_CONSENT_PRECEDENCE = _chunkMPI5VURJcjs.mb; exports.TOGGLE_DATA_SUBJECT = _chunkMPI5VURJcjs.B; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunkMPI5VURJcjs.lb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunkMPI5VURJcjs.kb; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunkMPI5VURJcjs.jb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkKC7NDLN7cjs.h; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkKC7NDLN7cjs.g; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkKC7NDLN7cjs.i; exports.TeamInput = _chunkQEM6S2W7cjs.d; exports.TemplateInput = _chunkQEM6S2W7cjs.a; exports.TranscendInput = _chunkQEM6S2W7cjs.ga; exports.TranscendPromptManager = F; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunkMPI5VURJcjs.wb; exports.UPDATE_ACTION_ITEMS = _chunkMPI5VURJcjs.yb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunkMPI5VURJcjs.La; exports.UPDATE_AGENTS = _chunkMPI5VURJcjs.Kb; exports.UPDATE_AGENT_FILES = _chunkMPI5VURJcjs.Nb; exports.UPDATE_AGENT_FUNCTIONS = _chunkMPI5VURJcjs.Qb; exports.UPDATE_ATTRIBUTE = _chunkMPI5VURJcjs.Sa; exports.UPDATE_ATTRIBUTE_VALUES = _chunkMPI5VURJcjs.Oa; exports.UPDATE_BUSINESS_ENTITIES = _chunkMPI5VURJcjs.ub; exports.UPDATE_CODE_PACKAGES = _chunkMPI5VURJcjs.S; exports.UPDATE_CONSENT_EXPERIENCE = _chunkMPI5VURJcjs.ob; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunkMPI5VURJcjs.gb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunkMPI5VURJcjs.hb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunkMPI5VURJcjs.nb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunkMPI5VURJcjs.eb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunkMPI5VURJcjs.db; exports.UPDATE_DATA_FLOWS = _chunkMPI5VURJcjs.Xa; exports.UPDATE_DATA_SILOS = _chunkMPI5VURJcjs.n; exports.UPDATE_DATA_SUBJECT = _chunkMPI5VURJcjs.A; exports.UPDATE_DATA_SUB_CATEGORIES = _chunkMPI5VURJcjs.Wb; exports.UPDATE_ENRICHER = _chunkMPI5VURJcjs.s; exports.UPDATE_IDENTIFIER = _chunkMPI5VURJcjs.x; exports.UPDATE_INTL_MESSAGES = _chunkMPI5VURJcjs.ba; exports.UPDATE_LOAD_OPTIONS = _chunkMPI5VURJcjs.ib; exports.UPDATE_OR_CREATE_COOKIES = _chunkMPI5VURJcjs.Ya; exports.UPDATE_OR_CREATE_DATA_POINT = _chunkMPI5VURJcjs.h; exports.UPDATE_POLICIES = _chunkMPI5VURJcjs.W; exports.UPDATE_PRIVACY_CENTER = _chunkMPI5VURJcjs.Db; exports.UPDATE_PRIVACY_REQUEST = _chunkMPI5VURJcjs._; exports.UPDATE_PROCESSING_ACTIVITIES = _chunkMPI5VURJcjs.ac; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkMPI5VURJcjs.Zb; exports.UPDATE_PROMPTS = _chunkMPI5VURJcjs.pa; exports.UPDATE_PROMPT_GROUPS = _chunkMPI5VURJcjs.ta; exports.UPDATE_PROMPT_PARTIALS = _chunkMPI5VURJcjs.ra; exports.UPDATE_REPOSITORIES = _chunkMPI5VURJcjs.D; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunkMPI5VURJcjs.P; exports.UPDATE_TEAM = _chunkMPI5VURJcjs.Ba; exports.UPDATE_VENDORS = _chunkMPI5VURJcjs.Tb; exports.USERS = _chunkMPI5VURJcjs.Ea; exports.USP_STRING_REGEX = _chunkV4X4IT3Tcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkSUCCU2FScjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkSUCCU2FScjs.a; exports.VENDORS = _chunkMPI5VURJcjs.Rb; exports.VendorInput = _chunkQEM6S2W7cjs.p; exports.WebhookHeader = _chunkQEM6S2W7cjs.b; exports.addMessagesToPromptRun = _chunkMPI5VURJcjs.Ud; exports.appendCsvSync = _chunkZVK4HIDFcjs.b; exports.approvePrivacyRequests = _chunk3FEOMF7Gcjs.I; exports.assumeRole = _chunkMPI5VURJcjs.xe; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunkMPI5VURJcjs.Wd; exports.buildTranscendGraphQLClientGeneric = _chunkMPI5VURJcjs.Vd; exports.buildXdiSyncEndpoint = _chunkGZ2U36SScjs.g; exports.bulkRestartRequests = _chunk3FEOMF7Gcjs.Q; exports.bulkRetryEnrichers = _chunk3FEOMF7Gcjs.S; exports.cancelPrivacyRequests = _chunk3FEOMF7Gcjs.L; exports.consentManagersToBusinessEntities = _chunkGZ2U36SScjs.h; exports.convertToDataSubjectAllowlist = _chunkMPI5VURJcjs.mc; exports.convertToDataSubjectBlockList = _chunkMPI5VURJcjs.lc; exports.createActionItemCollection = _chunkMPI5VURJcjs.qd; exports.createActionItems = _chunkMPI5VURJcjs.ud; exports.createAgent = _chunkMPI5VURJcjs.nd; exports.createAgentFile = _chunkMPI5VURJcjs.Cd; exports.createAgentFunction = _chunkMPI5VURJcjs.yd; exports.createApiKey = _chunkMPI5VURJcjs.ye; exports.createBusinessEntity = _chunkMPI5VURJcjs.$c; exports.createCodePackage = _chunkMPI5VURJcjs.Re; exports.createConsentToken = _chunkV4X4IT3Tcjs.a; exports.createDataCategory = _chunkMPI5VURJcjs.Kd; exports.createDataFlows = _chunkMPI5VURJcjs.ed; exports.createProcessingPurpose = _chunkMPI5VURJcjs.Od; exports.createPrompt = _chunkMPI5VURJcjs.Hc; exports.createRegexForTag = j; exports.createRepository = _chunkMPI5VURJcjs.Oe; exports.createSoftwareDevelopmentKit = _chunkMPI5VURJcjs.Le; exports.createSombraGotInstance = _chunkMPI5VURJcjs.Xd; exports.createTranscendConsentGotInstance = _chunkMPI5VURJcjs.Yd; exports.createVendor = _chunkMPI5VURJcjs.Gd; exports.defineTranscendPrompts = Cm; exports.deleteApiKey = _chunkMPI5VURJcjs.ze; exports.deployConsentManager = _chunkMPI5VURJcjs.Zd; exports.description = _chunk3EZGFSMDcjs.l; exports.domainToHost = _chunkGZ2U36SScjs.e; exports.downloadPrivacyRequestFiles = _chunk3FEOMF7Gcjs.F; exports.enrichPrivacyRequest = _chunkVHQY7TSFcjs.c; exports.ensureAllDataSubjectsExist = _chunkMPI5VURJcjs.kc; exports.extractClientError = _chunk3FEOMF7Gcjs.N; exports.fetchActiveSiloDiscoPlugin = _chunkMPI5VURJcjs.$d; exports.fetchAllActionItems = _chunkMPI5VURJcjs.td; exports.fetchAllActions = _chunkMPI5VURJcjs.jd; exports.fetchAllAgentFiles = _chunkMPI5VURJcjs.Bd; exports.fetchAllAgentFunctions = _chunkMPI5VURJcjs.xd; exports.fetchAllAgents = _chunkMPI5VURJcjs.md; exports.fetchAllApiKeys = _chunkMPI5VURJcjs.Dc; exports.fetchAllAssessmentTemplates = _chunkMPI5VURJcjs.be; exports.fetchAllAssessments = _chunkMPI5VURJcjs.ae; exports.fetchAllAttributeValues = _chunkMPI5VURJcjs.Xc; exports.fetchAllAttributes = _chunkMPI5VURJcjs.Zc; exports.fetchAllBusinessEntities = _chunkMPI5VURJcjs._c; exports.fetchAllCatalogs = _chunkMPI5VURJcjs.pe; exports.fetchAllCookies = _chunkMPI5VURJcjs.de; exports.fetchAllDataCategories = _chunkMPI5VURJcjs.Jd; exports.fetchAllDataFlows = _chunkMPI5VURJcjs.cd; exports.fetchAllDataPoints = _chunkMPI5VURJcjs.pc; exports.fetchAllDataSilos = _chunkMPI5VURJcjs.nc; exports.fetchAllDataSubjects = _chunkMPI5VURJcjs.jc; exports.fetchAllEnrichers = _chunkMPI5VURJcjs.gc; exports.fetchAllIdentifiers = _chunkMPI5VURJcjs.dc; exports.fetchAllMessages = _chunkMPI5VURJcjs.ee; exports.fetchAllPolicies = _chunkMPI5VURJcjs.Mc; exports.fetchAllPreferenceTopics = _chunkMPI5VURJcjs.fe; exports.fetchAllPrivacyCenters = _chunkMPI5VURJcjs.ge; exports.fetchAllProcessingActivities = _chunkMPI5VURJcjs.Rd; exports.fetchAllProcessingPurposes = _chunkMPI5VURJcjs.Nd; exports.fetchAllPromptGroups = _chunkMPI5VURJcjs.ld; exports.fetchAllPromptPartials = _chunkMPI5VURJcjs.kd; exports.fetchAllPromptThreads = _chunkMPI5VURJcjs.re; exports.fetchAllPrompts = _chunkMPI5VURJcjs.Fc; exports.fetchAllPurposes = _chunkMPI5VURJcjs.Uc; exports.fetchAllPurposesAndPreferences = _chunkMPI5VURJcjs.he; exports.fetchAllRequestAttributeKeys = _chunkMPI5VURJcjs.ce; exports.fetchAllRequestEnrichers = _chunkMPI5VURJcjs.ie; exports.fetchAllRequestIdentifierMetadata = _chunkMPI5VURJcjs.je; exports.fetchAllRequestIdentifiers = _chunkMPI5VURJcjs.le; exports.fetchAllRequests = _chunkMPI5VURJcjs.ne; exports.fetchAllSubDataPoints = _chunkMPI5VURJcjs.oc; exports.fetchAllTeams = _chunkMPI5VURJcjs.Bc; exports.fetchAllTemplates = _chunkMPI5VURJcjs.hd; exports.fetchAllUsers = _chunkMPI5VURJcjs.oe; exports.fetchAllVendors = _chunkMPI5VURJcjs.Fd; exports.fetchAndIndexCatalogs = _chunkMPI5VURJcjs.qe; exports.fetchApiKeys = _chunkMPI5VURJcjs.Ec; exports.fetchConsentManager = _chunkMPI5VURJcjs.tc; exports.fetchConsentManagerAnalyticsData = _chunkMPI5VURJcjs.xc; exports.fetchConsentManagerExperiences = _chunkMPI5VURJcjs.vc; exports.fetchConsentManagerId = _chunkMPI5VURJcjs.uc; exports.fetchConsentManagerTheme = _chunkMPI5VURJcjs.yc; exports.fetchConsentPreferences = _chunkGZ2U36SScjs.j; exports.fetchEnrichedDataSilos = _chunkMPI5VURJcjs.qc; exports.fetchIdentifiersAndCreateMissing = _chunkMPI5VURJcjs.ec; exports.fetchPartitions = _chunkMPI5VURJcjs.Sc; exports.fetchPrivacyCenterId = _chunkMPI5VURJcjs.Lc; exports.fetchPrivacyCenterUrl = _chunkMPI5VURJcjs.Kc; exports.fetchPromptsWithVariables = _chunkMPI5VURJcjs.Gc; exports.fetchRequestDataSilo = _chunkMPI5VURJcjs.te; exports.fetchRequestDataSiloActiveCount = _chunkMPI5VURJcjs.ue; exports.fetchRequestDataSilos = _chunkMPI5VURJcjs.se; exports.fetchRequestFilesForRequest = _chunkMPI5VURJcjs.ve; exports.filterNullishValuesFromObject = Em; exports.filterRows = _chunk3FEOMF7Gcjs.s; exports.fuzzyMatchColumns = _chunk3FEOMF7Gcjs.l; exports.fuzzySearch = _chunk3FEOMF7Gcjs.k; exports.generateCrossAccountApiKeys = _chunkASFWHSOVcjs.a; exports.getFileMetadataForPrivacyRequests = _chunk3FEOMF7Gcjs.D; exports.getGitFilesThatChanged = Sm; exports.getUniqueValuesForColumn = _chunk3FEOMF7Gcjs.r; exports.inquirerAutoComplete = _chunkNKVC5Y53cjs.c; exports.inquirerConfirmBoolean = _chunkNKVC5Y53cjs.a; exports.inquirerConfirmText = _chunkNKVC5Y53cjs.b; exports.listDirectories = _chunkASFWHSOVcjs.d; exports.listFiles = _chunkASFWHSOVcjs.c; exports.loginUser = _chunkMPI5VURJcjs.we; exports.makeGraphQLRequest = _chunkMPI5VURJcjs.cc; exports.mapColumnsToAttributes = _chunk3FEOMF7Gcjs.M; exports.mapColumnsToIdentifiers = _chunk3FEOMF7Gcjs.K; exports.mapCsvColumnsToApi = _chunk3FEOMF7Gcjs.u; exports.mapCsvRowsToRequestInputs = _chunk3FEOMF7Gcjs.z; exports.mapEnumValues = _chunk3FEOMF7Gcjs.m; exports.mapRequestEnumValues = _chunk3FEOMF7Gcjs.v; exports.markCronIdentifierCompleted = _chunkAADFRD6Pcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkAADFRD6Pcjs.f; exports.markSilentPrivacyRequests = _chunk3FEOMF7Gcjs.t; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkKC7NDLN7cjs.a; exports.normalizeIdentifierValue = _chunk3FEOMF7Gcjs.y; exports.notifyPrivacyRequestsAdditionalTime = _chunk3FEOMF7Gcjs.J; exports.parseAssessmentDisplayLogic = _chunkMPI5VURJcjs.De; exports.parseAssessmentRiskLogic = _chunkMPI5VURJcjs.Fe; exports.parseAttributesFromString = _chunk3FEOMF7Gcjs.p; exports.parseFilePath = _chunkZVK4HIDFcjs.d; exports.parseVariablesFromString = _chunkTD7ADMVOcjs.a; exports.pullAllDatapoints = _chunk7QV5QNGWcjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkAADFRD6Pcjs.g; exports.pullConsentManagerMetrics = _chunkGZ2U36SScjs.d; exports.pullCronPageOfIdentifiers = _chunkAADFRD6Pcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkVHQY7TSFcjs.a; exports.pullPrivacyRequests = _chunk3FEOMF7Gcjs.U; exports.pullTranscendConfiguration = _chunkMPI5VURJcjs.He; exports.pullUnstructuredSubDataPointRecommendations = _chunk7QV5QNGWcjs.b; exports.pushCronIdentifiersFromCsv = _chunkAADFRD6Pcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkVHQY7TSFcjs.d; exports.readCsv = _chunk3FEOMF7Gcjs.q; exports.readTranscendYaml = _chunkSUCCU2FScjs.d; exports.removeLinks = Lm; exports.removeUnverifiedRequestIdentifiers = _chunk3FEOMF7Gcjs.W; exports.replaceVariablesInYaml = _chunkSUCCU2FScjs.c; exports.reportPromptRun = _chunkMPI5VURJcjs.Ie; exports.restartPrivacyRequest = _chunk3FEOMF7Gcjs.P; exports.retryRequestDataSilos = _chunk3FEOMF7Gcjs.T; exports.retryRequestEnricher = _chunkMPI5VURJcjs.Je; exports.setResourceAttributes = _chunkMPI5VURJcjs.Ke; exports.skipPreflightJobs = _chunk3FEOMF7Gcjs.R; exports.skipRequestDataSilos = _chunk3FEOMF7Gcjs.V; exports.splitCsvToList = _chunk3FEOMF7Gcjs.n; exports.streamPrivacyRequestFiles = _chunk3FEOMF7Gcjs.E; exports.submitPrivacyRequest = _chunk3FEOMF7Gcjs.H; exports.syncAction = _chunkMPI5VURJcjs.gd; exports.syncActionItemCollections = _chunkMPI5VURJcjs.sd; exports.syncActionItems = _chunkMPI5VURJcjs.wd; exports.syncAgentFiles = _chunkMPI5VURJcjs.Ed; exports.syncAgentFunctions = _chunkMPI5VURJcjs.Ad; exports.syncAgents = _chunkMPI5VURJcjs.pd; exports.syncAttribute = _chunkMPI5VURJcjs.ic; exports.syncBusinessEntities = _chunkMPI5VURJcjs.bd; exports.syncCodePackages = _chunkMPI5VURJcjs.Te; exports.syncConfigurationToTranscend = _chunkMPI5VURJcjs.Td; exports.syncConsentManager = _chunkMPI5VURJcjs.Wc; exports.syncConsentManagerExperiences = _chunkMPI5VURJcjs.Vc; exports.syncCookies = _chunkMPI5VURJcjs.Ac; exports.syncDataCategories = _chunkMPI5VURJcjs.Md; exports.syncDataFlows = _chunkMPI5VURJcjs.fd; exports.syncDataSiloDependencies = _chunkMPI5VURJcjs.sc; exports.syncDataSilos = _chunkMPI5VURJcjs.rc; exports.syncDataSubject = _chunkMPI5VURJcjs.Cc; exports.syncEnricher = _chunkMPI5VURJcjs.hc; exports.syncIdentifier = _chunkMPI5VURJcjs.fc; exports.syncIntlMessages = _chunkMPI5VURJcjs.Qc; exports.syncPartitions = _chunkMPI5VURJcjs.Tc; exports.syncPolicies = _chunkMPI5VURJcjs.Oc; exports.syncPrivacyCenter = _chunkMPI5VURJcjs.Rc; exports.syncProcessingActivities = _chunkMPI5VURJcjs.Sd; exports.syncProcessingPurposes = _chunkMPI5VURJcjs.Qd; exports.syncPrompts = _chunkMPI5VURJcjs.Jc; exports.syncRepositories = _chunkMPI5VURJcjs.Qe; exports.syncSoftwareDevelopmentKits = _chunkMPI5VURJcjs.Ne; exports.syncTemplate = _chunkMPI5VURJcjs.id; exports.syncVendors = _chunkMPI5VURJcjs.Id; exports.updateActionItem = _chunkMPI5VURJcjs.vd; exports.updateActionItemCollection = _chunkMPI5VURJcjs.rd; exports.updateAgentFiles = _chunkMPI5VURJcjs.Dd; exports.updateAgentFunctions = _chunkMPI5VURJcjs.zd; exports.updateAgents = _chunkMPI5VURJcjs.od; exports.updateBusinessEntities = _chunkMPI5VURJcjs.ad; exports.updateCodePackages = _chunkMPI5VURJcjs.Se; exports.updateConsentManagerToLatest = _chunkMPI5VURJcjs._d; exports.updateConsentManagerVersionToLatest = _chunkGZ2U36SScjs.a; exports.updateDataCategories = _chunkMPI5VURJcjs.Ld; exports.updateDataFlows = _chunkMPI5VURJcjs.dd; exports.updateIntlMessages = _chunkMPI5VURJcjs.Pc; exports.updateOrCreateCookies = _chunkMPI5VURJcjs.zc; exports.updatePolicies = _chunkMPI5VURJcjs.Nc; exports.updateProcessingPurposes = _chunkMPI5VURJcjs.Pd; exports.updatePrompts = _chunkMPI5VURJcjs.Ic; exports.updateRepositories = _chunkMPI5VURJcjs.Pe; exports.updateSoftwareDevelopmentKits = _chunkMPI5VURJcjs.Me; exports.updateVendors = _chunkMPI5VURJcjs.Hd; exports.uploadConsents = _chunkV4X4IT3Tcjs.f; exports.uploadCookiesFromCsv = _chunkGZ2U36SScjs.c; exports.uploadDataFlowsFromCsv = _chunkGZ2U36SScjs.b; exports.uploadPrivacyRequestsFromCsv = _chunk3FEOMF7Gcjs.O; exports.uploadSiloDiscoveryResults = _chunkMPI5VURJcjs.Ue; exports.validateTranscendAuth = _chunkASFWHSOVcjs.b; exports.version = _chunk3EZGFSMDcjs.m; exports.writeCsv = _chunkZVK4HIDFcjs.c; exports.writeCsvSync = _chunkZVK4HIDFcjs.a; exports.writeLargeCsv = _chunkZVK4HIDFcjs.e; exports.writeTranscendYaml = _chunkSUCCU2FScjs.e;
5
5
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -44728,6 +44728,8 @@ declare const IdentifierInput: t.IntersectionC<[t.TypeC<{
44728
44728
  displayDescription: t.StringC;
44729
44729
  /** The display order for the identifier */
44730
44730
  displayOrder: t.NumberC;
44731
+ /** Whether or not the identifier is unique on the preference store */
44732
+ isUniqueOnPreferenceStore: t.BooleanC;
44731
44733
  }>]>;
44732
44734
  /** Type override */
44733
44735
  type IdentifierInput = t.TypeOf<typeof IdentifierInput>;
@@ -92432,6 +92434,8 @@ declare const TranscendInput: t.PartialC<{
92432
92434
  displayDescription: t.StringC;
92433
92435
  /** The display order for the identifier */
92434
92436
  displayOrder: t.NumberC;
92437
+ /** Whether or not the identifier is unique on the preference store */
92438
+ isUniqueOnPreferenceStore: t.BooleanC;
92435
92439
  }>]>>;
92436
92440
  /**
92437
92441
  * Data silo definitions
@@ -130176,6 +130180,8 @@ interface Identifier {
130176
130180
  };
130177
130181
  /** Display order */
130178
130182
  displayOrder: number;
130183
+ /** does this identifier uniquely identify a consent record */
130184
+ isUniqueOnPreferenceStore: boolean;
130179
130185
  }
130180
130186
  /**
130181
130187
  * Fetch all identifiers in the organization
@@ -143844,7 +143850,7 @@ declare function removeUnverifiedRequestIdentifiers({ requestActions, identifier
143844
143850
  }): Promise<number>;
143845
143851
 
143846
143852
  var description = "A command line interface for programmatic operations across Transcend.";
143847
- var version = "7.2.0";
143853
+ var version = "8.0.0";
143848
143854
 
143849
143855
  /**
143850
143856
  * The name of the main binary for the CLI
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Transcend Inc.",
3
3
  "name": "@transcend-io/cli",
4
4
  "description": "A command line interface for programmatic operations across Transcend.",
5
- "version": "7.2.0",
5
+ "version": "8.0.0",
6
6
  "homepage": "https://github.com/transcend-io/cli",
7
7
  "repository": {
8
8
  "type": "git",
@@ -54,7 +54,7 @@
54
54
  "__tr-upload-preferences": "dist/bin/deprecated-command.cjs"
55
55
  },
56
56
  "engines": {
57
- "node": ">=18"
57
+ "node": ">=22"
58
58
  },
59
59
  "files": [
60
60
  "dist"