@transcend-io/cli 8.31.0 → 8.32.4

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 (153) hide show
  1. package/README.md +121 -0
  2. package/dist/bin/bash-complete.cjs +1 -1
  3. package/dist/bin/cli.cjs +1 -1
  4. package/dist/bin/deprecated-command.cjs +2 -2
  5. package/dist/{chunk-JSVWGZUF.cjs → chunk-22KX2NM4.cjs} +4 -4
  6. package/dist/{chunk-JSVWGZUF.cjs.map → chunk-22KX2NM4.cjs.map} +1 -1
  7. package/dist/chunk-56QKBG2R.cjs +3001 -0
  8. package/dist/chunk-56QKBG2R.cjs.map +1 -0
  9. package/dist/chunk-6TKTYQIF.cjs +3 -0
  10. package/dist/chunk-6TKTYQIF.cjs.map +1 -0
  11. package/dist/{chunk-CLJATLM4.cjs → chunk-BPOXNSPY.cjs} +2 -2
  12. package/dist/{chunk-CLJATLM4.cjs.map → chunk-BPOXNSPY.cjs.map} +1 -1
  13. package/dist/chunk-CM7VJEOY.cjs +4 -0
  14. package/dist/chunk-CM7VJEOY.cjs.map +1 -0
  15. package/dist/chunk-D3VRD5F5.cjs +2 -0
  16. package/dist/chunk-D3VRD5F5.cjs.map +1 -0
  17. package/dist/{chunk-FZTNEEMW.cjs → chunk-DQCPGPXG.cjs} +2 -2
  18. package/dist/{chunk-FZTNEEMW.cjs.map → chunk-DQCPGPXG.cjs.map} +1 -1
  19. package/dist/{chunk-EA6WCT7X.cjs → chunk-DYBVUGHH.cjs} +22 -22
  20. package/dist/chunk-DYBVUGHH.cjs.map +1 -0
  21. package/dist/chunk-IHUCIK5T.cjs +2 -0
  22. package/dist/{chunk-FMFQTG5Q.cjs.map → chunk-IHUCIK5T.cjs.map} +1 -1
  23. package/dist/{chunk-HAAVY3FG.cjs → chunk-LQUVB4MI.cjs} +4 -4
  24. package/dist/chunk-LQUVB4MI.cjs.map +1 -0
  25. package/dist/chunk-P5GD5LAK.cjs +2 -0
  26. package/dist/chunk-P5GD5LAK.cjs.map +1 -0
  27. package/dist/chunk-PGO2YKRX.cjs +12 -0
  28. package/dist/chunk-PGO2YKRX.cjs.map +1 -0
  29. package/dist/{chunk-CBBHRSKJ.cjs → chunk-VCPZG4FJ.cjs} +2 -2
  30. package/dist/{chunk-CBBHRSKJ.cjs.map → chunk-VCPZG4FJ.cjs.map} +1 -1
  31. package/dist/chunk-VUQAH7YK.cjs +12 -0
  32. package/dist/chunk-VUQAH7YK.cjs.map +1 -0
  33. package/dist/{impl-OTMLF2EA.cjs → impl-2JA6BPE7.cjs} +2 -2
  34. package/dist/{impl-OTMLF2EA.cjs.map → impl-2JA6BPE7.cjs.map} +1 -1
  35. package/dist/{impl-4TYC4KRL.cjs → impl-4AI7T6RD.cjs} +2 -2
  36. package/dist/{impl-4TYC4KRL.cjs.map → impl-4AI7T6RD.cjs.map} +1 -1
  37. package/dist/impl-4LAJNPQ4.cjs +16 -0
  38. package/dist/impl-4LAJNPQ4.cjs.map +1 -0
  39. package/dist/{impl-3X74MLJH.cjs → impl-4YFJOKCA.cjs} +2 -2
  40. package/dist/{impl-3X74MLJH.cjs.map → impl-4YFJOKCA.cjs.map} +1 -1
  41. package/dist/{impl-P2KE5XGI.cjs → impl-5RX3NB6C.cjs} +2 -2
  42. package/dist/{impl-P2KE5XGI.cjs.map → impl-5RX3NB6C.cjs.map} +1 -1
  43. package/dist/{impl-B4H2FDZW.cjs → impl-66CDS7IN.cjs} +2 -2
  44. package/dist/{impl-B4H2FDZW.cjs.map → impl-66CDS7IN.cjs.map} +1 -1
  45. package/dist/{impl-3NPILIEL.cjs → impl-ADPBEB3N.cjs} +2 -2
  46. package/dist/{impl-3NPILIEL.cjs.map → impl-ADPBEB3N.cjs.map} +1 -1
  47. package/dist/{impl-5BYWLODX.cjs → impl-B6DTQRYV.cjs} +2 -2
  48. package/dist/{impl-5BYWLODX.cjs.map → impl-B6DTQRYV.cjs.map} +1 -1
  49. package/dist/impl-BHA2L6BP.cjs +2 -0
  50. package/dist/{impl-QOFK7XCV.cjs.map → impl-BHA2L6BP.cjs.map} +1 -1
  51. package/dist/impl-BLGX7DMN.cjs +6 -0
  52. package/dist/impl-BLGX7DMN.cjs.map +1 -0
  53. package/dist/{impl-DLES54N2.cjs → impl-DA7AASRR.cjs} +2 -2
  54. package/dist/{impl-DLES54N2.cjs.map → impl-DA7AASRR.cjs.map} +1 -1
  55. package/dist/{impl-2F2MAY5Q.cjs → impl-EXHOBCQW.cjs} +2 -2
  56. package/dist/{impl-2F2MAY5Q.cjs.map → impl-EXHOBCQW.cjs.map} +1 -1
  57. package/dist/{impl-YL4BEMVB.cjs → impl-FRWZLZ2V.cjs} +2 -2
  58. package/dist/{impl-YL4BEMVB.cjs.map → impl-FRWZLZ2V.cjs.map} +1 -1
  59. package/dist/impl-GA6T4SCB.cjs +2 -0
  60. package/dist/impl-GA6T4SCB.cjs.map +1 -0
  61. package/dist/{impl-FOWYFCLQ.cjs → impl-GG3S2VBT.cjs} +2 -2
  62. package/dist/{impl-FOWYFCLQ.cjs.map → impl-GG3S2VBT.cjs.map} +1 -1
  63. package/dist/impl-GZNNNSYW.cjs +7 -0
  64. package/dist/{impl-AS634NMX.cjs.map → impl-GZNNNSYW.cjs.map} +1 -1
  65. package/dist/{impl-YGWOUGKU.cjs → impl-IOS3QLTX.cjs} +2 -2
  66. package/dist/{impl-YGWOUGKU.cjs.map → impl-IOS3QLTX.cjs.map} +1 -1
  67. package/dist/{impl-MEYQSNWH.cjs → impl-IQGUF37H.cjs} +2 -2
  68. package/dist/{impl-MEYQSNWH.cjs.map → impl-IQGUF37H.cjs.map} +1 -1
  69. package/dist/impl-IZIXOMMN.cjs +2 -0
  70. package/dist/impl-IZIXOMMN.cjs.map +1 -0
  71. package/dist/{impl-TU75DDAK.cjs → impl-J5PWNHKL.cjs} +2 -2
  72. package/dist/{impl-TU75DDAK.cjs.map → impl-J5PWNHKL.cjs.map} +1 -1
  73. package/dist/impl-JI6COVDW.cjs +2 -0
  74. package/dist/{impl-C52MFDKN.cjs.map → impl-JI6COVDW.cjs.map} +1 -1
  75. package/dist/{impl-7XQ333J3.cjs → impl-JY7YM3QH.cjs} +2 -2
  76. package/dist/{impl-7XQ333J3.cjs.map → impl-JY7YM3QH.cjs.map} +1 -1
  77. package/dist/{impl-FCNDIDLG.cjs → impl-LKX6OLE2.cjs} +2 -2
  78. package/dist/{impl-FCNDIDLG.cjs.map → impl-LKX6OLE2.cjs.map} +1 -1
  79. package/dist/impl-MRC5UI22.cjs +2 -0
  80. package/dist/impl-MRC5UI22.cjs.map +1 -0
  81. package/dist/{impl-ZNEHRZSH.cjs → impl-NW57RBBR.cjs} +2 -2
  82. package/dist/{impl-ZNEHRZSH.cjs.map → impl-NW57RBBR.cjs.map} +1 -1
  83. package/dist/impl-QOCEM2K5.cjs +2 -0
  84. package/dist/{impl-VWVHHW42.cjs.map → impl-QOCEM2K5.cjs.map} +1 -1
  85. package/dist/{impl-U2HXJYMF.cjs → impl-QPLTL2SO.cjs} +2 -2
  86. package/dist/{impl-U2HXJYMF.cjs.map → impl-QPLTL2SO.cjs.map} +1 -1
  87. package/dist/impl-R35FW4U7.cjs +9 -0
  88. package/dist/impl-R35FW4U7.cjs.map +1 -0
  89. package/dist/{impl-GRFZUIPA.cjs → impl-RMPDHVAH.cjs} +2 -2
  90. package/dist/{impl-GRFZUIPA.cjs.map → impl-RMPDHVAH.cjs.map} +1 -1
  91. package/dist/{impl-E6HLH54N.cjs → impl-S64WVKSC.cjs} +2 -2
  92. package/dist/{impl-E6HLH54N.cjs.map → impl-S64WVKSC.cjs.map} +1 -1
  93. package/dist/{impl-EUBXVGYE.cjs → impl-SE32ARTN.cjs} +2 -2
  94. package/dist/{impl-EUBXVGYE.cjs.map → impl-SE32ARTN.cjs.map} +1 -1
  95. package/dist/{impl-BRV53IYV.cjs → impl-SSBP4ONX.cjs} +2 -2
  96. package/dist/{impl-BRV53IYV.cjs.map → impl-SSBP4ONX.cjs.map} +1 -1
  97. package/dist/{impl-T3YCRT7O.cjs → impl-UA7V6YEM.cjs} +2 -2
  98. package/dist/{impl-T3YCRT7O.cjs.map → impl-UA7V6YEM.cjs.map} +1 -1
  99. package/dist/{impl-L5CDLEYL.cjs → impl-WTGAAEUZ.cjs} +2 -2
  100. package/dist/{impl-L5CDLEYL.cjs.map → impl-WTGAAEUZ.cjs.map} +1 -1
  101. package/dist/{impl-ZVMSDS7K.cjs → impl-WVOFYJLG.cjs} +2 -2
  102. package/dist/{impl-ZVMSDS7K.cjs.map → impl-WVOFYJLG.cjs.map} +1 -1
  103. package/dist/{impl-NRPKPOKV.cjs → impl-X23VUODX.cjs} +2 -2
  104. package/dist/{impl-NRPKPOKV.cjs.map → impl-X23VUODX.cjs.map} +1 -1
  105. package/dist/{impl-WJUSRANT.cjs → impl-XU54KM62.cjs} +2 -2
  106. package/dist/{impl-WJUSRANT.cjs.map → impl-XU54KM62.cjs.map} +1 -1
  107. package/dist/{impl-CDNCBR7T.cjs → impl-XYHIS7X5.cjs} +2 -2
  108. package/dist/{impl-CDNCBR7T.cjs.map → impl-XYHIS7X5.cjs.map} +1 -1
  109. package/dist/{impl-HRQUBR2Y.cjs → impl-Y3MY5EKD.cjs} +2 -2
  110. package/dist/{impl-HRQUBR2Y.cjs.map → impl-Y3MY5EKD.cjs.map} +1 -1
  111. package/dist/impl-YIPC6MAR.cjs +6 -0
  112. package/dist/impl-YIPC6MAR.cjs.map +1 -0
  113. package/dist/{impl-64R4NW2W.cjs → impl-Z54SB7SM.cjs} +2 -2
  114. package/dist/{impl-64R4NW2W.cjs.map → impl-Z54SB7SM.cjs.map} +1 -1
  115. package/dist/{impl-MDV6LYET.cjs → impl-ZTEP5CYM.cjs} +2 -2
  116. package/dist/{impl-MDV6LYET.cjs.map → impl-ZTEP5CYM.cjs.map} +1 -1
  117. package/dist/index.cjs +3 -3
  118. package/dist/index.cjs.map +1 -1
  119. package/dist/index.d.cts +1 -1
  120. package/package.json +2 -2
  121. package/dist/chunk-5SEDJJAH.cjs +0 -12
  122. package/dist/chunk-5SEDJJAH.cjs.map +0 -1
  123. package/dist/chunk-EA6WCT7X.cjs.map +0 -1
  124. package/dist/chunk-FMFQTG5Q.cjs +0 -2
  125. package/dist/chunk-HAAVY3FG.cjs.map +0 -1
  126. package/dist/chunk-HUZESENZ.cjs +0 -2
  127. package/dist/chunk-HUZESENZ.cjs.map +0 -1
  128. package/dist/chunk-J7BM4Z6U.cjs +0 -3
  129. package/dist/chunk-J7BM4Z6U.cjs.map +0 -1
  130. package/dist/chunk-UHERPTMC.cjs +0 -2
  131. package/dist/chunk-UHERPTMC.cjs.map +0 -1
  132. package/dist/chunk-VWGA62SG.cjs +0 -3001
  133. package/dist/chunk-VWGA62SG.cjs.map +0 -1
  134. package/dist/chunk-WAWECZTF.cjs +0 -4
  135. package/dist/chunk-WAWECZTF.cjs.map +0 -1
  136. package/dist/chunk-ZZPMCMEB.cjs +0 -12
  137. package/dist/chunk-ZZPMCMEB.cjs.map +0 -1
  138. package/dist/impl-AS634NMX.cjs +0 -7
  139. package/dist/impl-BBDBG5OZ.cjs +0 -6
  140. package/dist/impl-BBDBG5OZ.cjs.map +0 -1
  141. package/dist/impl-C52MFDKN.cjs +0 -2
  142. package/dist/impl-FORZFZ2Q.cjs +0 -2
  143. package/dist/impl-FORZFZ2Q.cjs.map +0 -1
  144. package/dist/impl-GISNUHI6.cjs +0 -9
  145. package/dist/impl-GISNUHI6.cjs.map +0 -1
  146. package/dist/impl-KM3U7E44.cjs +0 -6
  147. package/dist/impl-KM3U7E44.cjs.map +0 -1
  148. package/dist/impl-QOFK7XCV.cjs +0 -2
  149. package/dist/impl-VWVHHW42.cjs +0 -2
  150. package/dist/impl-YDV6YOOI.cjs +0 -2
  151. package/dist/impl-YDV6YOOI.cjs.map +0 -1
  152. package/dist/impl-ZHTH3L2C.cjs +0 -2
  153. package/dist/impl-ZHTH3L2C.cjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-5SEDJJAH.cjs","../src/lib/consent-manager/updateConsentManagerVersionToLatest.ts","../src/lib/consent-manager/uploadDataFlowsFromCsv.ts","../src/lib/consent-manager/uploadCookiesFromCsv.ts","../src/lib/consent-manager/pullConsentManagerMetrics.ts","../src/lib/consent-manager/domainToHost.ts","../src/lib/consent-manager/buildXdiSyncEndpoint.ts","../src/lib/consent-manager/consentManagersToBusinessEntities.ts"],"names":["updateConsentManagerVersionToLatest","auth","deploy","transcendUrl","DEFAULT_TRANSCEND_API","bundleTypes","ConsentBundleType","client","buildTranscendGraphQLClient","consentManagerId","fetchConsentManagerId","mapSeries","bundleType","logger","colors","updateConsentManagerToLatest","deployConsentManager","OMIT_COLUMNS","uploadDataFlowsFromCsv","trackerStatus","file","classifyService","validatedDataFlowInputs","readCsv","DataFlowCsvInput","Type","Notes","Service","Purpose","Status","Owners","Teams","value","rest","splitCsvToList","key","syncDataFlows","uploadCookiesFromCsv","validatedCookieInputs","CookieCsvInput","isRegex","Name","syncCookies","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_WEEK","pullConsentManagerMetrics","bin","start","end","airgapBundleId","startTime","endTime","startDate","endDate","privacySignalData","consentChangesData","consentSessionsByRegimeData","fetchConsentManagerAnalyticsData","domainToHost","domain"],"mappings":"AAAA,quBAAiD,wDAAkH,wDAAyC,wDAAgD,2DCA1N,oCACR,gFAOP,MAUnB,SAAsBA,EAAAA,CAAoC,CACxD,IAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CAAS,CAAA,CAAA,CACT,YAAA,CAAAC,CAAAA,CAAeC,mBAAAA,CACf,WAAA,CAAAC,CAAAA,CAAc,MAAA,CAAO,MAAA,CAAOC,+BAAiB,CAC/C,CAAA,CASkB,CAEhB,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BL,CAAcF,CAAI,CAAA,CAGvDQ,CAAAA,CAAmB,MAAMC,kCAAAA,CAA4B,CAAA,CAG3D,MAAMC,iCAAAA,CAAU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AEH,MAAO,CACL,yBAAA,CAA2BQ,CAAAA,CAC3B,0BAAA,CAA4BC,CAAAA,CAC5B,0BAAA,CAA4BC,CAC9B,CACF,CChGO,IAAME,CAAAA,CAAgBC,CAAAA,EAC3B,IAAI,GAAA,CAAI,CAAA,QAAA,EAAWA,CAAM,CAAA,CAAA;ACiHA;AAAA;AAGT,KAAA;AACqC,kBAAA;AAChB,mBAAA;AAAA;AC5DzB;AAAA;AAAA;AAUd,uBAAA","file":"/home/runner/work/cli/cli/dist/chunk-5SEDJJAH.cjs","sourcesContent":[null,"import { ConsentBundleType } from '@transcend-io/privacy-types';\nimport { mapSeries } from 'bluebird';\nimport {\n updateConsentManagerToLatest,\n buildTranscendGraphQLClient,\n fetchConsentManagerId,\n deployConsentManager,\n} from '../graphql';\nimport colors from 'colors';\n\nimport { logger } from '../../logger';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\n/**\n * Update the consent manager to latest version\n *\n * @param options - Options\n */\nexport async function updateConsentManagerVersionToLatest({\n auth,\n deploy = false,\n transcendUrl = DEFAULT_TRANSCEND_API,\n bundleTypes = Object.values(ConsentBundleType),\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Deploy consent manager with this update */\n deploy?: boolean;\n /** The bundle types to update and deploy */\n bundleTypes?: ConsentBundleType[];\n}): Promise<void> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Grab Consent Manager ID\n const consentManagerId = await fetchConsentManagerId(client);\n\n // Update each bundle type to latest version\n await mapSeries(bundleTypes, async (bundleType) => {\n logger.info(\n colors.magenta(\n `Update Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\" to latest version...`,\n ),\n );\n await updateConsentManagerToLatest(client, {\n id: consentManagerId,\n bundleType,\n });\n logger.info(\n colors.green(\n `Updated Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\" to latest version!`,\n ),\n );\n });\n\n // deploy Consent Managers\n if (deploy) {\n // Update each bundle type to latest version\n await mapSeries(bundleTypes, async (bundleType) => {\n logger.info(\n colors.magenta(\n `Deploying Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\"...`,\n ),\n );\n await deployConsentManager(client, {\n id: consentManagerId,\n bundleType,\n });\n logger.info(\n colors.green(\n `Deployed Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\"!`,\n ),\n );\n });\n }\n}\n","import colors from 'colors';\nimport { logger } from '../../logger';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncDataFlows } from '../graphql';\nimport { readCsv } from '../requests/readCsv';\nimport { DataFlowInput, DataFlowCsvInput } from '../../codecs';\nimport { splitCsvToList } from '../requests';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of data flows from CSV\n *\n * @param options - Options\n */\nexport async function uploadDataFlowsFromCsv({\n auth,\n trackerStatus,\n file,\n classifyService = false,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of data flow inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const dataFlowInputs = readCsv(file, DataFlowCsvInput);\n\n // Convert these data flow inputs into a format that the other function can use\n const validatedDataFlowInputs = dataFlowInputs.map(\n ({\n Type,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n 'Connections Made To': value,\n ...rest\n }): DataFlowInput => ({\n value,\n type: Type,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the data flows into Transcend dashboard\n const syncedDataFlows = await syncDataFlows(\n client,\n validatedDataFlowInputs,\n classifyService,\n );\n\n // Log errors\n if (!syncedDataFlows) {\n logger.error(\n colors.red(\n 'Encountered error(s) syncing data flows from CSV, see logs above for more info. ',\n ),\n );\n process.exit(1);\n }\n}\n","import colors from 'colors';\nimport { logger } from '../../logger';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncCookies } from '../graphql';\nimport { readCsv } from '../requests/readCsv';\nimport { CookieInput, CookieCsvInput } from '../../codecs';\nimport { splitCsvToList } from '../requests';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of cookies from CSV\n *\n * @param options - Options\n */\nexport async function uploadCookiesFromCsv({\n auth,\n trackerStatus,\n file,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of cookie inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const cookieInputs = readCsv(file, CookieCsvInput);\n\n // Convert these inputs into a format that the other function can use\n const validatedCookieInputs = cookieInputs.map(\n ({\n 'Is Regex?': isRegex,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n Name,\n ...rest\n }): CookieInput => ({\n ...(typeof isRegex === 'string'\n ? { isRegex: isRegex.toLowerCase() === 'true' }\n : {}),\n name: Name,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the cookies into Transcend dashboard\n const syncedCookies = await syncCookies(client, validatedCookieInputs);\n\n // Log errors\n if (!syncedCookies) {\n logger.error(\n colors.red(\n 'Encountered error(s) syncing cookies from CSV, see logs above for more info. ',\n ),\n );\n process.exit(1);\n }\n}\n","import type { GraphQLClient } from 'graphql-request';\nimport {\n ConsentManagerMetric,\n ConsentManagerMetricBin,\n fetchConsentManagerAnalyticsData,\n fetchConsentManagerId,\n} from '../graphql';\n\n/**\n * One second of time in ms\n */\nconst ONE_SECOND = 1000;\nconst ONE_MINUTE = 60 * ONE_SECOND;\nconst ONE_HOUR = 60 * ONE_MINUTE;\nconst ONE_DAY = 24 * ONE_HOUR;\nconst ONE_WEEK = 7 * ONE_DAY;\n\n/**\n * Pull consent manager metrics in an organization\n *\n * @param client - GraphQL client\n * @param options - Options\n * @returns The consent manager metrics\n */\nexport async function pullConsentManagerMetrics(\n client: GraphQLClient,\n {\n bin,\n start,\n end = new Date(),\n }: {\n /** Start date to pull metrics from */\n start: Date;\n /** End date to pull metrics from (assumes now) */\n end?: Date;\n /** Bin size to pull metrics */\n bin: ConsentManagerMetricBin;\n },\n): Promise<{\n /** Privacy signal data */\n PRIVACY_SIGNAL_TIMESERIES: ConsentManagerMetric[];\n /** Consent changes data */\n CONSENT_CHANGES_TIMESERIES: ConsentManagerMetric[];\n /** Consent sessions by regime */\n CONSENT_SESSIONS_BY_REGIME: ConsentManagerMetric[];\n}> {\n // Grab the bundleId associated with this API key\n const airgapBundleId = await fetchConsentManagerId(client);\n\n // convert start and end to times\n const startTime = Math.floor(start.getTime() / 1000);\n const endTime = Math.floor(end.getTime() / 1000);\n if (startTime > endTime) {\n throw new Error('Received \"end\" date that happened before \"start\" date');\n }\n\n // do not allow hourly bins greater than 2 weeks\n if (bin === '1h' && end.getTime() - start.getTime() > ONE_WEEK * 2) {\n throw new Error(\n 'When using bin=1h, start and end time can be no more than 2 weeks apart',\n );\n }\n\n // Pull in the metrics\n const startDate = start.toISOString();\n const endDate = end.toISOString();\n const [privacySignalData, consentChangesData, consentSessionsByRegimeData] =\n await Promise.all([\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'PRIVACY_SIGNAL_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'CONSENT_CHANGES_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'CONSENT_SESSIONS_BY_REGIME',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n ]);\n\n return {\n PRIVACY_SIGNAL_TIMESERIES: privacySignalData,\n CONSENT_CHANGES_TIMESERIES: consentChangesData,\n CONSENT_SESSIONS_BY_REGIME: consentSessionsByRegimeData,\n };\n}\n","/**\n * Convert a domain to host\n *\n * @param domain - e.g. test.acme.com\n * @returns Host acme.com\n */\nexport const domainToHost = (domain: string): string =>\n new URL(`https://${domain}`).hostname.split('.').slice(-2).join('.');\n","import colors from 'colors';\n\nimport { buildTranscendGraphQLClient, fetchConsentManager } from '../graphql';\nimport { difference } from 'lodash-es';\nimport { map } from 'bluebird';\nimport { StoredApiKey } from '../../codecs';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport { logger } from '../../logger';\nimport { domainToHost } from './domainToHost';\n\n/**\n * Sync group configuration mapping\n * e.g.\n * {\n * \"abdb5e78-0d69-4554-a3bd-84b72ca3b3d9\": [\n * \"test.com\"\n * ],\n * \"f6b3ba87-c9df-444f-b420-6fac49e35910\": [\n * \"blue.com\"\n * ]\n * }\n */\nexport type XdiSyncGroups = { [k in string]: string[] };\n\n/** Regular expression for IP addresses - remove these from sync endpoint */\nexport const IP_ADDRESS_REGEX =\n // eslint-disable-next-line max-len\n /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\n/**\n * Build the sync endpoint definition for a set of Transcend accounts\n *\n * @param apiKeys - The API keys that will be used to pull down configurations for\n * @param options - Options\n * @returns The XDI configuration\n */\nexport async function buildXdiSyncEndpoint(\n apiKeys: string | StoredApiKey[],\n {\n xdiLocation,\n transcendUrl = DEFAULT_TRANSCEND_API,\n removeIpAddresses = true,\n domainBlockList = ['localhost'],\n xdiAllowedCommands = 'ConsentManager:Sync',\n }: {\n /** The file location where the XDI file is hosted */\n xdiLocation: string;\n /** URL of Transcend API */\n transcendUrl?: string;\n /** When true, remove IP addresses (defaults to true) */\n removeIpAddresses?: boolean;\n /** Block list of domains to omit from sync endpoint - includes `localhost` by default */\n domainBlockList?: string[];\n /** Allows XDI commands */\n xdiAllowedCommands?: string;\n },\n): Promise<{\n /** Sync group configurations */\n syncGroups: XdiSyncGroups;\n /** The HTML string */\n html: string;\n}> {\n // Convert API keys to list\n const apiKeysAsList = Array.isArray(apiKeys)\n ? apiKeys\n : [{ apiKey: apiKeys, organizationId: '', organizationName: '' }];\n\n // Fetch configuration for each account\n const consentManagers = await map(\n apiKeysAsList,\n async (apiKey) => {\n logger.info(\n colors.magenta(\n `Pulling consent metadata for organization - ${apiKey.organizationName}`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n // Grab consent manager\n const consentManager = await fetchConsentManager(client);\n return consentManager;\n },\n { concurrency: 5 },\n );\n\n // construct the sync groups\n const syncGroups: XdiSyncGroups = {};\n consentManagers.forEach((consentManager) => {\n // grab the partition key\n const partitionKey =\n // take explicit key first\n consentManager.partition?.partition ||\n // fallback to bundle ID\n consentManager.bundleURL.split('/').reverse()[1];\n\n // Ensure that partition exists in the sync groups\n if (!syncGroups[partitionKey]) {\n syncGroups[partitionKey] = [];\n }\n\n // Map domain list to a host list\n const hosts = difference(\n consentManager.configuration.domains\n .filter(\n // ignore IP addresses\n (domain) => !removeIpAddresses || !IP_ADDRESS_REGEX.test(domain),\n )\n .map((domain) => domainToHost(domain)),\n // ignore block list\n domainBlockList,\n );\n // merge existing sync group with hosts for this consent manager\n syncGroups[partitionKey] = [\n ...new Set([...(syncGroups[partitionKey] || []), ...hosts]),\n ];\n });\n\n // Construct the HTML\n const syncEndpointHtml = `\n<!DOCTYPE html>\n<script\nsrc=\"${xdiLocation}\"\ndata-sync-groups='${JSON.stringify(syncGroups, null, 2)}'\ndata-xdi-commands=\"${xdiAllowedCommands}\"\n></script>\n`;\n\n return {\n html: syncEndpointHtml,\n syncGroups,\n };\n}\n","import { BusinessEntityInput, ConsentManagerInput } from '../../codecs';\nimport { logger } from '../../logger';\n\n/**\n * Combine multiple consent manager configurations into a list of business entity configurations\n *\n * @param inputs - Consent manager configurations to combine\n * @returns Business entity configuration input\n */\nexport function consentManagersToBusinessEntities(\n inputs: {\n /** Name of business entity */\n name: string;\n /** Consent manager input */\n input?: ConsentManagerInput;\n }[],\n): BusinessEntityInput[] {\n // Construct the business entities YAML definition\n const businessEntities = inputs.map(\n ({ name, input }): BusinessEntityInput => ({\n // Title of Transcend Instance\n title: name.replace('.yml', ''),\n attributes: [\n // Sync domain list\n ...(input?.domains\n ? [\n {\n key: 'Transcend Domain List',\n values: [...new Set(input.domains)],\n },\n ]\n : []),\n // Sync bundle URLs\n ...(input?.bundleUrls\n ? [\n {\n key: 'Airgap Production URL',\n values: [input.bundleUrls.PRODUCTION],\n },\n {\n key: 'Airgap Test URL',\n values: [input.bundleUrls.TEST],\n },\n {\n key: 'Airgap XDI URL',\n values: [\n input.bundleUrls.PRODUCTION.replace('airgap.js', 'xdi.js'),\n ],\n },\n ]\n : []),\n // Sync partition keys\n ...(input?.partition\n ? [\n {\n key: 'Consent Partition Key',\n values: [input.partition],\n },\n ]\n : []),\n ],\n }),\n );\n\n // Log out info on airgap scripts to host\n logger.info('\\n\\n~~~~~~~~~~~\\nAirgap scripts to host:');\n businessEntities.forEach(({ attributes, title }, ind) => {\n attributes\n ?.find((attr) => attr.key === 'Airgap Production URL')\n ?.values?.forEach((url) => {\n logger.info(`${ind}) ${title} - ${url}`);\n });\n });\n\n return businessEntities;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-EA6WCT7X.cjs","../src/app.ts","../src/commands/admin/generate-api-keys/command.ts","../src/commands/admin/chunk-csv/command.ts","../src/commands/admin/parquet-to-csv/command.ts","../src/commands/admin/routes.ts","../src/commands/consent/routes.ts","../src/commands/consent/build-xdi-sync-endpoint/command.ts","../src/commands/consent/pull-consent-metrics/command.ts","../src/commands/consent/pull-consent-preferences/command.ts","../src/commands/consent/update-consent-manager/command.ts","../src/commands/consent/upload-consent-preferences/command.ts","../src/commands/consent/upload-cookies-from-csv/command.ts","../src/commands/consent/upload-data-flows-from-csv/command.ts","../src/commands/consent/upload-preferences/command.ts","../src/commands/consent/generate-access-tokens/command.ts","../src/commands/inventory/routes.ts","../src/commands/inventory/derive-data-silos-from-data-flows-cross-instance/command.ts","../src/commands/inventory/derive-data-silos-from-data-flows/command.ts","../src/commands/inventory/discover-silos/command.ts","../src/commands/inventory/pull-datapoints/command.ts","../src/commands/inventory/pull-unstructured-discovery-files/command.ts","../src/commands/inventory/push/command.ts","../src/commands/inventory/scan-packages/command.ts","../src/commands/inventory/consent-manager-service-json-to-yml/command.ts","../src/lib/docgen/buildExamples.ts","../src/commands/inventory/consent-managers-to-business-entities/command.ts","../src/commands/migration/sync-ot/command.ts","../src/commands/migration/routes.ts","../src/commands/request/cron/mark-identifiers-completed/command.ts","../src/commands/request/cron/pull-identifiers/command.ts","../src/commands/request/cron/pull-profiles/command.ts","../src/commands/request/cron/routes.ts","../src/commands/request/enricher-restart/command.ts","../src/commands/request/export/command.ts","../src/commands/request/preflight/pull-identifiers/command.ts","../src/commands/request/preflight/push-identifiers/command.ts","../src/commands/request/preflight/routes.ts","../src/commands/request/system/retry-request-data-silos/command.ts","../src/commands/request/upload/command.ts","../src/commands/request/routes.ts"],"names":["generateApiKeysCommand","buildCommand","generateApiKeys","SCOPE_TITLES","uuidParser","createTranscendUrlParameter","chunkCsvCommand","chunkCsv","v","n","parquetToCsvCommand","parquetToCsv","adminRoutes","buildRouteMap","buildXdiSyncEndpointCommand","buildXdiSyncEndpoint","createAuthParameter","ScopeName","arrayParser","pullConsentMetricsCommand","pullConsentMetrics","dateParser","pullConsentPreferencesCommand","pullConsentPreferences","createSombraAuthParameter","numberParser","updateConsentManagerCommand","updateConsentManager","ConsentBundleType","uploadConsentPreferencesCommand","uploadConsentPreferences","createConsentUrlParameter","uploadCookiesFromCsvCommand","uploadCookiesFromCsv","ConsentTrackerStatus","uploadDataFlowsFromCsvCommand","uploadDataFlowsFromCsv","uploadPreferencesCommand","uploadPreferences","generateAccessTokensCommand","generateAccessTokens","parseDurationToMs","consentRoutes","deriveDataSilosFromDataFlowsCrossInstanceCommand","deriveDataSilosFromDataFlowsCrossInstance","deriveDataSilosFromDataFlowsCommand","deriveDataSilosFromDataFlows","discoverSilosCommand","discoverSilos","pullDatapointsCommand","pullDatapoints","DataCategoryType","pullUnstructuredDiscoveryFilesCommand","pullUnstructuredDiscoveryFiles","UnstructuredSubDataPointRecommendationStatus","pushCommand","push","scanPackagesCommand","scanPackages","buildExampleCommand","commandPath","flags","options","command","flagList","getFlagList","forceSingleLine","argsIndent","RequestAction"],"mappings":"AAAA,ufAAgG,wDAA8D,wDAAgD,sDCGvM,qCACyC,ICCnCA,CAAAA,CAAyBC,gCAAAA,CACpC,MAAA,CAAQ,KAAA,CAAA,CAAA,EAAY,CAClB,GAAM,CAAE,eAAA,CAAAC,CAAgB,CAAA,CAAI,MAAM,4DAAA,CAAO,qBAAQ,GAAA,CACjD,OAAOA,CACT,CAAA,CACA,UAAA,CAAY,CACV,KAAA,CAAO,CACL,KAAA,CAAO,CACL,IAAA,CAAM,QAAA,CACN,KAAA,CAAO,MAAA,CACP,KAAA,CAAO,sDACT,CAAA,CACA,QAAA,CAAU,CACR,IAAA,CAAM,QAAA,CACN,KAAA,CAAO,MAAA,CACP,KAAA,CAAO,qCACT,CAAA,CACA,WAAA,CAAa,CACX,IAAA,CAAM,QAAA,CACN,KAAA,CAAO,MAAA,CACP,KAAA,CAAO,uDACT,CAAA,CACA,IAAA,CAAM,CACJ,IAAA,CAAM,QAAA,CACN,KAAA,CAAO,MAAA,CACP,KAAA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AAA;AAkET;AAAA;AAAA;AC7DjB,8EAAA;AC2DiB;AAAA;AClEd,4BAAA;ACyCc;AAAA;AAAA;AAAA;AAAA;AAYjB,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACzDK,GAAA;AAoDY;AAAA;AAAA;AAAA;AAAA;AAYjB,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACvDO,GAAA;ACTFI,4GAAAA;AC0GY;AAAA;AAAA;ACrFjB,yGAAA","file":"/home/runner/work/cli/cli/dist/chunk-EA6WCT7X.cjs","sourcesContent":[null,"import {\n buildInstallCommand,\n buildUninstallCommand,\n} from '@stricli/auto-complete';\nimport { buildApplication, buildRouteMap } from '@stricli/core';\nimport { adminRoutes } from './commands/admin/routes';\nimport { consentRoutes } from './commands/consent/routes';\nimport { inventoryRoutes } from './commands/inventory/routes';\nimport { migrationRoutes } from './commands/migration/routes';\nimport { requestRoutes } from './commands/request/routes';\nimport { description, name, version } from './constants';\n\nconst routes = buildRouteMap({\n routes: {\n request: requestRoutes,\n consent: consentRoutes,\n inventory: inventoryRoutes,\n admin: adminRoutes,\n migration: migrationRoutes,\n install: buildInstallCommand('@transcend-io/transcend', {\n bash: '__@transcend-io/cli_bash_complete',\n }),\n uninstall: buildUninstallCommand('@transcend-io/transcend', { bash: true }),\n },\n docs: {\n brief: description,\n hideRoute: {\n install: true,\n uninstall: true,\n },\n },\n});\n\nexport const app = buildApplication(routes, {\n name,\n versionInfo: {\n currentVersion: version,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { createTranscendUrlParameter } from '../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../lib/cli/parsers';\nimport { SCOPE_TITLES } from '../../../constants';\n\nexport const generateApiKeysCommand = buildCommand({\n loader: async () => {\n const { generateApiKeys } = await import('./impl');\n return generateApiKeys;\n },\n parameters: {\n flags: {\n email: {\n kind: 'parsed',\n parse: String,\n brief: 'The email address that you use to log into Transcend',\n },\n password: {\n kind: 'parsed',\n parse: String,\n brief: 'The password for your account login',\n },\n apiKeyTitle: {\n kind: 'parsed',\n parse: String,\n brief: 'The title of the API key being generated or destroyed',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file where API keys should be written to',\n },\n scopes: {\n kind: 'enum',\n values: SCOPE_TITLES,\n variadic: ',',\n brief: 'The list of scopes that should be given to the API key',\n },\n deleteExistingApiKey: {\n kind: 'boolean',\n brief:\n 'When true, if an API key exists with the specified apiKeyTitle, the existing API key is deleted',\n default: true,\n },\n createNewApiKey: {\n kind: 'boolean',\n brief:\n 'When true, new API keys will be created. Set to false if you simply want to delete all API keys with a title',\n default: true,\n },\n parentOrganizationId: {\n kind: 'parsed',\n parse: uuidParser,\n brief:\n 'Filter for only a specific organization by ID, returning all child accounts associated with that organization',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Generate API keys',\n fullDescription: `This command allows for creating API keys across multiple Transcend instances. This is useful for customers that are managing many Transcend instances and need to regularly create, cycle or delete API keys across all of their instances.\n\nUnlike the other commands that rely on API key authentication, this command relies upon username/password authentication. This command will spit out the API keys into a JSON file, and that JSON file can be used in subsequent CLI commands.\n\nAuthentication requires your email and password for the Transcend account. This command will only generate API keys for Transcend instances where you have the permission to \"Manage API Keys\".`,\n },\n});\n","import { buildCommand } from '@stricli/core';\n\nexport const chunkCsvCommand = buildCommand({\n loader: async () => {\n const { chunkCsv } = await import('./impl');\n return chunkCsv;\n },\n parameters: {\n flags: {\n directory: {\n kind: 'parsed',\n parse: String,\n brief: 'Directory containing CSV files to split (required)',\n },\n outputDir: {\n kind: 'parsed',\n parse: String,\n brief:\n \"Directory to write chunk files (defaults to each input file's directory)\",\n optional: true,\n },\n clearOutputDir: {\n kind: 'boolean',\n brief: 'Clear the output directory before writing chunks',\n default: true,\n },\n chunkSizeMB: {\n kind: 'parsed',\n parse: (v: string) => {\n const n = Number(v);\n if (!Number.isFinite(n) || n <= 0) {\n throw new Error('chunkSizeMB must be a positive number');\n }\n return n;\n },\n brief:\n 'Approximate chunk size in megabytes. Keep well under JS string size limits',\n default: '10',\n },\n concurrency: {\n kind: 'parsed',\n parse: (v: string) => Math.max(1, Number(v) || 0),\n brief:\n 'Max number of worker processes (defaults based on CPU and file count)',\n optional: true,\n },\n viewerMode: {\n kind: 'boolean',\n brief:\n 'Run in non-interactive viewer mode (no attach UI, auto-artifacts)',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Chunk all CSVs in a directory into smaller CSV files',\n fullDescription: `Streams every CSV in --directory and writes chunked files of approximately N MB each.\n- Runs files in parallel across worker processes (configurable via --concurrency).\n- Validates row-length consistency against the header row; logs periodic progress and memory usage.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\n\nexport const parquetToCsvCommand = buildCommand({\n loader: async () => {\n const { parquetToCsv } = await import('./impl');\n return parquetToCsv;\n },\n parameters: {\n flags: {\n directory: {\n kind: 'parsed',\n parse: String,\n brief: 'Directory containing Parquet files to convert (required)',\n },\n outputDir: {\n kind: 'parsed',\n parse: String,\n brief:\n \"Directory to write CSV files (defaults to each input file's directory)\",\n optional: true,\n },\n clearOutputDir: {\n kind: 'boolean',\n brief: 'Clear the output directory before writing CSVs',\n default: true,\n },\n concurrency: {\n kind: 'parsed',\n parse: (v: string) => Math.max(1, Number(v) || 0),\n brief:\n 'Max number of worker processes (defaults based on CPU and file count)',\n optional: true,\n },\n viewerMode: {\n kind: 'boolean',\n brief:\n 'Run in non-interactive viewer mode (no attach UI, auto-artifacts)',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Convert all Parquet files in a directory to CSV',\n fullDescription: `Streams every .parquet in --directory and writes CSV output files\n- Runs files in parallel across worker processes (configurable via --concurrency).\n- Validates row consistency; logs periodic progress and memory usage.\n\nThis is a useful administrative tool for converting Parquet exports to CSV for the purposes\nof uploading DSRs or Consent Preferences. e.g. transcend consent upload-preferences ...`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { generateApiKeysCommand } from './generate-api-keys/command';\nimport { chunkCsvCommand } from './chunk-csv/command';\nimport { parquetToCsvCommand } from './parquet-to-csv/command';\n\nexport const adminRoutes = buildRouteMap({\n routes: {\n 'generate-api-keys': generateApiKeysCommand,\n 'chunk-csv': chunkCsvCommand,\n 'parquet-to-csv': parquetToCsvCommand,\n },\n docs: {\n brief: 'Admin commands',\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { buildXdiSyncEndpointCommand } from './build-xdi-sync-endpoint/command';\nimport { pullConsentMetricsCommand } from './pull-consent-metrics/command';\nimport { pullConsentPreferencesCommand } from './pull-consent-preferences/command';\nimport { updateConsentManagerCommand } from './update-consent-manager/command';\nimport { uploadConsentPreferencesCommand } from './upload-consent-preferences/command';\nimport { uploadCookiesFromCsvCommand } from './upload-cookies-from-csv/command';\nimport { uploadDataFlowsFromCsvCommand } from './upload-data-flows-from-csv/command';\nimport { uploadPreferencesCommand } from './upload-preferences/command';\nimport { generateAccessTokensCommand } from './generate-access-tokens/command';\n\nexport const consentRoutes = buildRouteMap({\n routes: {\n 'build-xdi-sync-endpoint': buildXdiSyncEndpointCommand,\n 'generate-access-tokens': generateAccessTokensCommand,\n 'pull-consent-metrics': pullConsentMetricsCommand,\n 'pull-consent-preferences': pullConsentPreferencesCommand,\n 'update-consent-manager': updateConsentManagerCommand,\n 'upload-consent-preferences': uploadConsentPreferencesCommand,\n 'upload-cookies-from-csv': uploadCookiesFromCsvCommand,\n 'upload-data-flows-from-csv': uploadDataFlowsFromCsvCommand,\n 'upload-preferences': uploadPreferencesCommand,\n },\n docs: {\n brief: 'Consent commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { arrayParser } from '../../../lib/cli/parsers';\n\nexport const buildXdiSyncEndpointCommand = buildCommand({\n loader: async () => {\n const { buildXdiSyncEndpoint } = await import('./impl');\n return buildXdiSyncEndpoint;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewConsentManager],\n }),\n xdiLocation: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The location of the XDI that will be loaded by the generated sync endpoint',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The HTML file path where the sync endpoint should be written',\n default: './sync-endpoint.html',\n },\n removeIpAddresses: {\n kind: 'boolean',\n brief: 'When true, remove IP addresses from the domain list',\n default: true,\n },\n domainBlockList: {\n kind: 'parsed',\n parse: arrayParser,\n brief:\n 'The set of domains that should be excluded from the sync endpoint. Comma-separated list.',\n default: 'localhost',\n },\n xdiAllowedCommands: {\n kind: 'parsed',\n parse: String,\n brief: 'The allowed set of XDI commands',\n default: 'ConsentManager:Sync',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Build XDI sync endpoint',\n fullDescription:\n 'This command allows for building of the XDI Sync Endpoint across a set of Transcend accounts.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const pullConsentMetricsCommand = buildCommand({\n loader: async () => {\n const { pullConsentMetrics } = await import('./impl');\n return pullConsentMetrics;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewConsentManager],\n }),\n start: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'The start date to pull metrics from',\n },\n end: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'The end date to pull metrics until',\n optional: true,\n },\n folder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder to save metrics to',\n default: './consent-metrics/',\n },\n bin: {\n kind: 'parsed',\n parse: String,\n brief: 'The bin metric when pulling data (1h or 1d)',\n default: '1d',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Pull consent metrics',\n fullDescription: `This command allows for pulling consent manager metrics for a Transcend account, or a set of Transcend accounts.\n\nBy default, the consent metrics will be written to a folder named \\`consent-metrics\\` within the directory where you run the command. You can override the location that these CSVs are written to using the flag \\`--folder=./my-folder/\\`. This folder will contain a set of CSV files:\n\n- \\`CONSENT_CHANGES_TIMESERIES_optIn.csv\\` -> this is a feed containing the number of explicit opt in events that happen - these are calls to \\`airgap.setConsent(event, { SaleOfInfo: true });\\`\n- \\`CONSENT_CHANGES_TIMESERIES_optOut.csv\\` -> this is a feed containing the number of explicit opt out events that happen - these are calls to \\`airgap.setConsent(event, { SaleOfInfo: false });\\`\n- \\`CONSENT_SESSIONS_BY_REGIME_Default.csv\\` -> this contains the number of sessions detected for the bin period\n- \\`PRIVACY_SIGNAL_TIMESERIES_DNT.csv\\` -> the number of DNT signals detected.\n- \\`PRIVACY_SIGNAL_TIMESERIES_GPC.csv\\` -> the number of GPC signals detected.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const pullConsentPreferencesCommand = buildCommand({\n loader: async () => {\n const { pullConsentPreferences } = await import('./impl');\n return pullConsentPreferences;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.ViewManagedConsentDatabaseAdminApi,\n ScopeName.ViewRequestIdentitySettings,\n ScopeName.ViewPreferenceStoreSettings,\n ],\n }),\n partition: {\n kind: 'parsed',\n parse: String,\n brief: 'Partition ID to query in the Preference Store',\n },\n sombraAuth: createSombraAuthParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to CSV output file',\n default: './preferences.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n // \"timestamp*\" filters map to consent collection time\n timestampBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief:\n 'Filter: preferences collected before this time (timestampBefore)',\n optional: true,\n },\n timestampAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Filter: preferences collected after this time (timestampAfter)',\n optional: true,\n },\n // \"updated*\" filters map to system.updatedAt window\n updatedBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief:\n 'Filter: preferences updated before this time (system.updatedAt)',\n optional: true,\n },\n updatedAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Filter: preferences updated after this time (system.updatedAt)',\n optional: true,\n },\n identifiers: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief:\n 'Filter specific users by identifier(s) as \"name:value\". ' +\n 'If name is omitted, defaults to \"email\". Multiple values separated by commas.',\n optional: true,\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Page size / concurrency used when downloading (1–50 per API). Higher = fewer pages.',\n default: '50',\n },\n shouldChunk: {\n kind: 'boolean',\n brief: 'Whether to download requests in timestamp window chunks.',\n default: true,\n },\n windowConcurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'When chunking, how many windows to download in parallel (higher = faster, but more load).',\n default: '100',\n },\n maxChunks: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Maximum number of chunks to download (higher = more data, but more load).',\n default: '5000',\n },\n maxLookbackDays: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Maximum lookback period in days for fetching consent preferences.',\n default: '3650',\n },\n },\n },\n docs: {\n brief: 'Pull consent preferences from the Managed Consent Database',\n fullDescription:\n 'Uses POST /v1/preferences/{partition}/query with cursor-based pagination. ' +\n 'Supports filtering by identifiers, collection timestamps, and system.updatedAt.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ConsentBundleType, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const updateConsentManagerCommand = buildCommand({\n loader: async () => {\n const { updateConsentManager } = await import('./impl');\n return updateConsentManager;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageConsentManagerDeveloperSettings],\n }),\n bundleTypes: {\n kind: 'enum',\n values: Object.values(ConsentBundleType),\n brief: 'The bundle types to deploy. Defaults to PRODUCTION,TEST.',\n variadic: ',',\n },\n deploy: {\n kind: 'boolean',\n brief:\n 'When true, deploy the Consent Manager after updating the version',\n default: false,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Update consent manager',\n fullDescription:\n 'This command allows for updating Consent Manager to latest version. The Consent Manager bundle can also be deployed using this command.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { createConsentUrlParameter } from '../../../lib/cli/common-parameters';\n\nexport const uploadConsentPreferencesCommand = buildCommand({\n loader: async () => {\n const { uploadConsentPreferences } = await import('./impl');\n return uploadConsentPreferences;\n },\n parameters: {\n flags: {\n base64EncryptionKey: {\n kind: 'parsed',\n parse: String,\n brief: 'The encryption key used to encrypt the userId',\n },\n base64SigningKey: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The signing key used to prove authentication of consent request',\n },\n partition: {\n kind: 'parsed',\n parse: String,\n brief: 'The partition key to download consent preferences to',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file to pull consent preferences from',\n default: './preferences.csv',\n },\n consentUrl: createConsentUrlParameter(),\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Upload consent preferences to the Managed Consent Database',\n fullDescription:\n 'This command allows for updating of consent preferences to the Managed Consent Database.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ConsentTrackerStatus, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadCookiesFromCsvCommand = buildCommand({\n loader: async () => {\n const { uploadCookiesFromCsv } = await import('./impl');\n return uploadCookiesFromCsv;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageDataFlow],\n }),\n trackerStatus: {\n kind: 'enum',\n values: Object.values(ConsentTrackerStatus),\n brief: 'The status of the cookies you will upload.',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to upload',\n default: './cookies.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Upload cookies from CSV',\n fullDescription: `Upload cookies from CSV. This command allows for uploading of cookies from CSV.\n\nStep 1) Download the CSV of cookies that you want to edit from the Admin Dashboard under [Consent Management -> Cookies](https://app.transcend.io/consent-manager/cookies). You can download cookies from both the \"Triage\" and \"Approved\" tabs.\n\nStep 2) You can edit the contents of the CSV file as needed. You may adjust the \"Purpose\" column, adjust the \"Notes\" column, add \"Owners\" and \"Teams\" or even add custom columns with additional metadata.\n\nStep 3) Upload the modified CSV file back into the dashboard with this command.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ConsentTrackerStatus, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadDataFlowsFromCsvCommand = buildCommand({\n loader: async () => {\n const { uploadDataFlowsFromCsv } = await import('./impl');\n return uploadDataFlowsFromCsv;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageDataFlow],\n }),\n trackerStatus: {\n kind: 'enum',\n values: Object.values(ConsentTrackerStatus),\n brief: 'The status of the data flows you will upload.',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to upload',\n default: './data-flows.csv',\n },\n classifyService: {\n kind: 'boolean',\n brief:\n 'When true, automatically assign the service for a data flow based on the domain that is specified',\n default: false,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Upload data flows from CSV',\n fullDescription: `Upload data flows from CSV. This command allows for uploading of data flows from CSV.\n\nStep 1) Download the CSV of data flows that you want to edit from the Admin Dashboard under [Consent Management -> Data Flows](https://app.transcend.io/consent-manager/data-flows). You can download data flows from both the \"Triage\" and \"Approved\" tabs.\n\nStep 2) You can edit the contents of the CSV file as needed. You may adjust the \"Purpose\" column, adjust the \"Notes\" column, add \"Owners\" and \"Teams\" or even add custom columns with additional metadata.\n\nStep 3) Upload the modified CSV file back into the dashboard with this command.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadPreferencesCommand = buildCommand({\n loader: async () => {\n const { uploadPreferences } = await import('./impl');\n return uploadPreferences;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.ManageStoredPreferences,\n ScopeName.ViewManagedConsentDatabaseAdminApi,\n ScopeName.ViewPreferenceStoreSettings,\n ],\n }),\n partition: {\n kind: 'parsed',\n parse: String,\n brief: 'The partition key to download consent preferences to',\n },\n sombraAuth: createSombraAuthParameter(),\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to load preferences from',\n optional: true,\n },\n directory: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the directory of CSV files to load preferences from',\n optional: true,\n },\n dryRun: {\n kind: 'boolean',\n brief:\n 'Whether to do a dry run only - will write results to receiptFilepath without updating Transcend',\n default: false,\n },\n skipExistingRecordCheck: {\n kind: 'boolean',\n brief:\n 'Whether to skip the check for existing records. SHOULD ONLY BE USED FOR INITIAL UPLOAD',\n default: false,\n },\n receiptFileDir: {\n kind: 'parsed',\n parse: String,\n brief: 'Directory path where the response receipts should be saved',\n default: './receipts',\n },\n skipWorkflowTriggers: {\n kind: 'boolean',\n brief:\n 'Whether to skip workflow triggers when uploading to preference store',\n default: false,\n },\n forceTriggerWorkflows: {\n kind: 'boolean',\n brief:\n 'Whether to force trigger workflows for existing consent records',\n default: false,\n },\n skipConflictUpdates: {\n kind: 'boolean',\n brief:\n 'Whether to skip uploading of any records where the preference store and file have a hard conflict',\n default: false,\n },\n isSilent: {\n kind: 'boolean',\n brief: 'Whether to skip sending emails in workflows',\n default: true,\n },\n attributes: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Attributes to add to any DSR request if created. Comma-separated list of key:value pairs.',\n default: 'Tags:transcend-cli,Source:transcend-cli',\n },\n receiptFilepath: {\n kind: 'parsed',\n parse: String,\n brief: 'Store resulting, continuing where left off',\n default: './preference-management-upload-receipts.json',\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading in parallel',\n default: '10',\n },\n },\n },\n docs: {\n brief: 'Upload preference management data to your Preference Store',\n fullDescription: `Upload preference management data to your Preference Store.\n\nThis command prompts you to map the shape of the CSV to the shape of the Transcend API. There is no requirement for the shape of the incoming CSV, as the script will handle the mapping process.\n\nThe script will also produce a JSON cache file that allows for the mappings to be preserved between runs.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { parseDurationToMs } from '../../../lib/cli/parsers';\n\nexport const generateAccessTokensCommand = buildCommand({\n loader: async () => {\n const { generateAccessTokens } = await import('./impl');\n return generateAccessTokens;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.GeneratePreferenceAccessTokens],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the CSV file containing user identifiers to generate access tokens for',\n },\n subjectType: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Slug for the data subject that the user will be logged in as on the Privacy Center. e.g. \"customer\" or \"employee\"',\n },\n emailColumnName: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Name of the column in the CSV that contains user email addresses',\n default: 'email',\n },\n coreIdentifierColumnName: {\n kind: 'parsed',\n parse: String,\n optional: true,\n brief:\n 'Name of the column in the CSV that contains user core identifiers',\n },\n duration: {\n kind: 'parsed',\n parse: parseDurationToMs,\n brief:\n 'How long the access tokens should be valid. Accepts human-friendly values ' +\n 'like \"2 days\", \"10h\", \"90 minutes\". A bare number is interpreted as seconds ' +\n '(e.g., \"300\" = 5 minutes). Powered by the `ms` library: ' +\n 'https://github.com/vercel/ms',\n // Default of \"1y\" → parsed to 31_557_600_000 ms\n default: '1y',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Generate access tokens',\n fullDescription:\n 'This command allows for the generation of access tokens for users specified in a CSV file.',\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { deriveDataSilosFromDataFlowsCrossInstanceCommand } from './derive-data-silos-from-data-flows-cross-instance/command';\nimport { deriveDataSilosFromDataFlowsCommand } from './derive-data-silos-from-data-flows/command';\nimport { discoverSilosCommand } from './discover-silos/command';\nimport { pullDatapointsCommand } from './pull-datapoints/command';\nimport { pullUnstructuredDiscoveryFilesCommand } from './pull-unstructured-discovery-files/command';\nimport { pullCommand } from './pull/command';\nimport { pushCommand } from './push/command';\nimport { scanPackagesCommand } from './scan-packages/command';\nimport { consentManagerServiceJsonToYmlCommand } from './consent-manager-service-json-to-yml/command';\nimport { consentManagersToBusinessEntitiesCommand } from './consent-managers-to-business-entities/command';\n\nexport const inventoryRoutes = buildRouteMap({\n routes: {\n pull: pullCommand,\n push: pushCommand,\n 'scan-packages': scanPackagesCommand,\n 'discover-silos': discoverSilosCommand,\n 'pull-datapoints': pullDatapointsCommand,\n 'pull-unstructured-discovery-files': pullUnstructuredDiscoveryFilesCommand,\n 'derive-data-silos-from-data-flows': deriveDataSilosFromDataFlowsCommand,\n 'derive-data-silos-from-data-flows-cross-instance':\n deriveDataSilosFromDataFlowsCrossInstanceCommand,\n 'consent-manager-service-json-to-yml':\n consentManagerServiceJsonToYmlCommand,\n 'consent-managers-to-business-entities':\n consentManagersToBusinessEntitiesCommand,\n },\n docs: {\n brief: 'Inventory commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const deriveDataSilosFromDataFlowsCrossInstanceCommand = buildCommand({\n loader: async () => {\n const { deriveDataSilosFromDataFlowsCrossInstance } = await import(\n './impl'\n );\n return deriveDataSilosFromDataFlowsCrossInstance;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n }),\n dataFlowsYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder that contains data flow yml files',\n },\n output: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The output transcend.yml file containing the data silo configurations',\n default: './transcend.yml',\n },\n ignoreYmls: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'The set of yml files that should be skipped when uploading',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Derive data silos from data flows cross instance',\n fullDescription:\n 'Given a folder of data flow transcend.yml configurations, convert those configurations to a single transcend.yml configurations of all related data silos.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const deriveDataSilosFromDataFlowsCommand = buildCommand({\n loader: async () => {\n const { deriveDataSilosFromDataFlows } = await import('./impl');\n return deriveDataSilosFromDataFlows;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n }),\n dataFlowsYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder that contains data flow yml files',\n },\n dataSilosYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder that contains data silo yml files',\n },\n ignoreYmls: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'The set of yml files that should be skipped when uploading',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Derive data silos from data flows',\n fullDescription:\n 'Given a folder of data flow transcend.yml configurations, convert those configurations to set of data silo transcend.yml configurations.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../lib/cli/parsers';\n\nexport const discoverSilosCommand = buildCommand({\n loader: async () => {\n const { discoverSilos } = await import('./impl');\n return discoverSilos;\n },\n parameters: {\n flags: {\n scanPath: {\n kind: 'parsed',\n parse: String,\n brief: 'File path in the project to scan',\n },\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The UUID of the corresponding data silo',\n },\n auth: createAuthParameter({\n scopes: [ScopeName.ManageAssignedDataInventory],\n requiresSiloScope: true,\n }),\n fileGlobs: {\n kind: 'parsed',\n parse: String,\n brief:\n 'You can pass a glob syntax pattern(s) to specify additional file paths to scan. Comma-separated list of globs.',\n default: '',\n },\n ignoreDirs: {\n kind: 'parsed',\n parse: String,\n brief: 'Comma-separated list of directories to ignore.',\n default: '',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Scan dependency management files to discover new data silos.',\n fullDescription: `We support scanning for new data silos in JavaScript, Python, Gradle, and CocoaPods projects.\n\nTo get started, add a data silo for the corresponding project type with the \"silo discovery\" plugin enabled. For example, if you want to scan a JavaScript project, add a package.json data silo. Then, specify the data silo ID in the \"--dataSiloId\" parameter.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { DataCategoryType, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const pullDatapointsCommand = buildCommand({\n loader: async () => {\n const { pullDatapoints } = await import('./impl');\n return pullDatapoints;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewDataInventory],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file to save datapoints to',\n default: './datapoints.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n dataSiloIds: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'List of data silo IDs to filter by',\n optional: true,\n },\n includeAttributes: {\n kind: 'boolean',\n brief: 'Whether to include attributes in the output',\n default: false,\n },\n includeGuessedCategories: {\n kind: 'boolean',\n brief: 'Whether to include guessed categories in the output',\n default: false,\n },\n parentCategories: {\n kind: 'enum',\n values: Object.values(DataCategoryType),\n brief: 'List of parent categories to filter by',\n variadic: ',',\n optional: true,\n },\n subCategories: {\n kind: 'parsed',\n parse: String,\n brief: 'List of subcategories to filter by',\n variadic: ',',\n optional: true,\n },\n },\n },\n docs: {\n brief: 'Export the datapoints from your Data Inventory into a CSV.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n ScopeName,\n UnstructuredSubDataPointRecommendationStatus,\n} from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const pullUnstructuredDiscoveryFilesCommand = buildCommand({\n loader: async () => {\n const { pullUnstructuredDiscoveryFiles } = await import('./impl');\n return pullUnstructuredDiscoveryFiles;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewDataInventory],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file to save datapoints to',\n default: './unstructured-discovery-files.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n dataSiloIds: {\n kind: 'parsed',\n parse: String,\n brief: 'List of data silo IDs to filter by',\n variadic: ',',\n optional: true,\n },\n subCategories: {\n kind: 'parsed',\n parse: String,\n brief: 'List of data categories to filter by',\n variadic: ',',\n optional: true,\n },\n status: {\n kind: 'enum',\n values: Object.values(UnstructuredSubDataPointRecommendationStatus),\n brief: 'List of classification statuses to filter by',\n variadic: ',',\n optional: true,\n },\n includeEncryptedSnippets: {\n kind: 'boolean',\n brief:\n 'Whether to include encrypted snippets of the entries classified',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Pull unstructured discovery files',\n fullDescription:\n 'This command allows for pulling Unstructured Discovery into a CSV.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const pushCommand = buildCommand({\n loader: async () => {\n const { push } = await import('./impl');\n return push;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: 'Varies',\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the YAML file to push from',\n default: './transcend.yml',\n },\n transcendUrl: createTranscendUrlParameter(),\n pageSize: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page size to use when paginating over the API',\n default: '50',\n },\n variables: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The variables to template into the YAML file when pushing configuration. Comma-separated list of key:value pairs.',\n default: '',\n },\n publishToPrivacyCenter: {\n kind: 'boolean',\n brief: 'When true, publish the configuration to the Privacy Center',\n default: false,\n },\n classifyService: {\n kind: 'boolean',\n brief:\n 'When true, automatically assign the service for a data flow based on the domain that is specified',\n default: false,\n },\n deleteExtraAttributeValues: {\n kind: 'boolean',\n brief:\n 'When true and syncing attributes, delete any extra attributes instead of just upserting',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Push metadata from transcend.yml to Transcend',\n fullDescription:\n 'Given a transcend.yml file, sync the contents up to your Transcend instance.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const scanPackagesCommand = buildCommand({\n loader: async () => {\n const { scanPackages } = await import('./impl');\n return scanPackages;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageCodeScanning],\n }),\n scanPath: {\n kind: 'parsed',\n parse: String,\n brief: 'File path in the project to scan',\n default: './',\n },\n ignoreDirs: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'List of directories to ignore in scan',\n optional: true,\n },\n repositoryName: {\n kind: 'parsed',\n parse: String,\n brief: 'Name of the git repository that the package should be tied to',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Scan dependency management files to inventory code dependencies.',\n fullDescription: `Transcend scans packages and dependencies for the following frameworks:\n\n- package.json\n- requirements.txt & setup.py\n- Podfile\n- Package.resolved\n- build.gradle\n- pubspec.yaml\n- Gemfile & .gemspec\n- composer.json\n\nThis command will scan the folder you point at to look for any of these files. Once found, the build file will be parsed in search of dependencies. Those code packages and dependencies will be uploaded to Transcend. The information uploaded to Transcend is:\n\n- repository name\n- package names\n- dependency names and versions\n- package descriptions`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { buildExampleCommand } from '../../../lib/docgen/buildExamples';\nimport { ConsentManagerServiceJsonToYmlCommandFlags } from './impl';\nimport { PushCommandFlags } from '../push/impl';\n\nexport const consentManagerServiceJsonToYmlCommand = buildCommand({\n loader: async () => {\n const { consentManagerServiceJsonToYml } = await import('./impl');\n return consentManagerServiceJsonToYml;\n },\n parameters: {\n flags: {\n file: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the services.json file, output of await airgap.getMetadata()',\n default: './services.json',\n },\n output: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the output transcend.yml to write to',\n default: './transcend.yml',\n },\n },\n },\n docs: {\n brief: 'Convert consent manager services to transcend.yml',\n fullDescription: `Import the services from an airgap.js file into a Transcend instance.\n\n1. Run \\`await airgap.getMetadata()\\` on a site with airgap\n2. Right click on the printed object, and click \\`Copy object\\`\n3. Place output of file in a file named \\`services.json\\`\n4. Run:\n\n ${buildExampleCommand<ConsentManagerServiceJsonToYmlCommandFlags>(\n ['inventory', 'consent-manager-service-json-to-yml'],\n {\n file: './services.json',\n output: './transcend.yml',\n },\n { argsIndent: 5 },\n )}\n\n5. Run:\n\n ${buildExampleCommand<PushCommandFlags>(\n ['inventory', 'push'],\n {\n auth: '$TRANSCEND_API_KEY',\n file: './transcend.yml',\n classifyService: true,\n },\n { argsIndent: 5 },\n )}`,\n },\n});\n","import { name } from '../../constants';\n\nexport interface Example<Flags> {\n /** A description of the example */\n description: string;\n /** The flag arguments to the command */\n flags: Partial<Flags>;\n}\n\n/**\n * Builds a string of examples for the CLI\n *\n * @param commandPath - The path to the command to run, omitting the `transcend` command name, e.g., `['consent', 'upload-preferences']`\n * @param examples - The examples to build\n * @returns A string of examples for the CLI\n */\nexport function buildExamples<Flags = never>(\n commandPath: string[],\n examples: NoInfer<Example<Flags>>[],\n): string {\n return examples\n .map((example) => {\n const exampleCommand = buildExampleCommand<Flags>(\n commandPath,\n example.flags,\n );\n return `**${example.description}**\\n\\n\\`\\`\\`sh\\n${exampleCommand}\\n\\`\\`\\``;\n })\n .join('\\n\\n');\n}\n\n/**\n * Builds a command string for an example\n *\n * @param commandPath - The path to the command to run, omitting the `transcend` command name, e.g., `['consent', 'upload-preferences']`\n * @param flags - The flags to build the command with\n * @param options - The options for the command\n * @returns A command string for the example\n */\nexport function buildExampleCommand<Flags = never>(\n commandPath: string[],\n flags: NoInfer<Partial<Flags>>,\n options?: {\n /** If true, the command will be forced to a single line */\n forceSingleLine?: boolean;\n /** If true, the command will be indented */\n argsIndent?: number;\n },\n): string {\n const command = commandPath.join(' ');\n const flagList = getFlagList(flags);\n const { forceSingleLine = false, argsIndent = 2 } = options ?? {};\n\n if (flagList.length === 0) {\n return `${name} ${command}`;\n }\n\n // Break the command into multiple lines if it's too long\n const exampleCommand =\n `${name} ${command} ${flagList.join(' ')}`.length <= 117 && !forceSingleLine\n ? `${command} ${flagList.join(' ')}`\n : `${command} \\\\\\n${' '.repeat(argsIndent)}${flagList.join(\n ` \\\\\\n${' '.repeat(argsIndent)}`,\n )}`;\n\n // Add `transcend` before command name\n return `${name} ${exampleCommand}`;\n}\n\n/**\n * Formats a flag value to the bash string for an example command\n *\n * @param value - The value to format\n * @param depth - The depth of the recursion\n * @returns The formatted value\n */\nfunction formatFlagValue(value: unknown, depth = 0): string {\n if (typeof value === 'boolean') {\n return value ? 'true' : 'false';\n }\n\n if (typeof value === 'number') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toISOString();\n }\n\n if (Array.isArray(value) && depth === 0) {\n const values = value.map((v) => formatFlagValue(v, depth + 1));\n if (values.every((x) => x.startsWith('$') || x.includes(' '))) {\n return `\"${values.join(',')}\"`;\n }\n return values.join(',');\n }\n\n if (typeof value === 'string') {\n // If we're operating on list elements\n if (depth === 1) {\n if (value.startsWith('$')) {\n return `$\\{${value.slice(1)}}`;\n }\n return value;\n }\n\n // Escape strings that start with $ or contain spaces or special characters\n return value.startsWith('$') || value.includes(' ') ? `\"${value}\"` : value;\n }\n\n throw new Error(`Unsupported value type: ${typeof value}`);\n}\n\n/**\n * Builds a list of flags formatted for an example command\n *\n * @param flags - The flags to build the command with\n * @param depth - The depth of the recursion\n * @returns A list of flags for the example command\n */\nexport function getFlagList<Flags = never>(\n flags: Partial<Flags>,\n depth = 0,\n): string[] {\n return Object.entries(flags).map(([flag, value]) => {\n if (typeof value === 'boolean' && value) {\n // For true booleans, just pass the flag alone\n return `--${flag}`;\n }\n\n const formattedValue = formatFlagValue(value, depth);\n\n return `--${flag}=${formattedValue}`;\n });\n}\n","import { buildCommand } from '@stricli/core';\n\nexport const consentManagersToBusinessEntitiesCommand = buildCommand({\n loader: async () => {\n const { consentManagersToBusinessEntities } = await import('./impl');\n return consentManagersToBusinessEntities;\n },\n parameters: {\n flags: {\n consentManagerYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the folder of Consent Manager transcend.yml files to combine',\n },\n output: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the output transcend.yml with business entity configuration',\n default: './combined-business-entities.yml',\n },\n },\n },\n docs: {\n brief: 'Convert consent managers to business entities',\n fullDescription:\n 'This command allows for converting a folder or Consent Manager transcend.yml files into a single transcend.yml file where each consent manager configuration is a Business Entity in the data inventory.',\n },\n});\n","import { buildCommand, type TypedFlagParameter } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { OneTrustPullResource, OneTrustPullSource } from '../../../enums';\nimport type { LocalContext } from '../../../context';\n\nexport const syncOtCommand = buildCommand({\n loader: async () => {\n const { syncOt } = await import('./impl');\n return syncOt;\n },\n parameters: {\n flags: {\n hostname: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The domain of the OneTrust environment from which to pull the resource',\n optional: true,\n },\n oneTrustAuth: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The OAuth access token with the scopes necessary to access the OneTrust Public APIs',\n optional: true,\n },\n source: {\n kind: 'enum',\n values: Object.values(OneTrustPullSource) as OneTrustPullSource[],\n brief: 'Whether to read the assessments from OneTrust or from a file',\n default: OneTrustPullSource.OneTrust,\n },\n transcendAuth: {\n ...createAuthParameter({\n scopes: [ScopeName.ManageAssessments],\n }),\n optional: true,\n } as TypedFlagParameter<string | undefined, LocalContext>,\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the file to pull the resource into. Must be a json file!',\n optional: true,\n },\n resource: {\n kind: 'enum',\n values: Object.values(OneTrustPullResource) as OneTrustPullResource[],\n brief:\n 'The resource to pull from OneTrust. For now, only assessments is supported',\n default: OneTrustPullResource.Assessments,\n },\n dryRun: {\n kind: 'boolean',\n brief:\n 'Whether to export the resource to a file rather than sync to Transcend',\n default: false,\n },\n debug: {\n kind: 'boolean',\n brief: 'Whether to print detailed logs in case of error',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Sync OneTrust data',\n fullDescription: `Pulls resources from a OneTrust and syncs them to a Transcend instance. For now, it only supports retrieving OneTrust Assessments.\n\nThis command can be helpful if you are looking to:\n- Pull resources from your OneTrust account.\n- Migrate your resources from your OneTrust account to Transcend.\n\nOneTrust authentication requires an OAuth Token with scope for accessing the assessment endpoints.\nIf syncing the resources to Transcend, you will also need to generate an API key on the Transcend Admin Dashboard.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { syncOtCommand } from './sync-ot/command';\n\nexport const migrationRoutes = buildRouteMap({\n routes: {\n 'sync-ot': syncOtCommand,\n },\n docs: {\n brief: 'Migration commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport type { PullIdentifiersCommandFlags } from '../pull-identifiers/impl';\nimport { buildExampleCommand } from '../../../../lib/docgen/buildExamples';\nimport type { MarkIdentifiersCompletedCommandFlags } from './impl';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const markIdentifiersCompletedCommand = buildCommand({\n loader: async () => {\n const { markIdentifiersCompleted } = await import('./impl');\n return markIdentifiersCompleted;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n requiresSiloScope: true,\n }),\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the data silo to pull in',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n sombraAuth: createSombraAuthParameter(),\n },\n },\n docs: {\n brief: 'Mark identifiers as completed after processing.',\n fullDescription: `This command takes the output of \"${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'cron', 'pull-identifiers'],\n {},\n )}\" and notifies Transcend that all of the requests in the CSV have been processed.\nThis is used in the workflow like:\n\n1. Pull identifiers to CSV:\n\n ${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'cron', 'pull-identifiers'],\n {\n auth: '$TRANSCEND_API_KEY',\n dataSiloId: '70810f2e-cf90-43f6-9776-901a5950599f',\n actions: [RequestAction.Erasure],\n file: './outstanding-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\n2. Run your process to operate on that CSV of requests.\n\n3. Notify Transcend of completion\n\n ${buildExampleCommand<MarkIdentifiersCompletedCommandFlags>(\n ['request', 'cron', 'mark-identifiers-completed'],\n {\n auth: '$TRANSCEND_API_KEY',\n dataSiloId: '70810f2e-cf90-43f6-9776-901a5950599f',\n file: './outstanding-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\nRead more at https://docs.transcend.io/docs/integrations/cron-job-integration.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const pullIdentifiersCommand = buildCommand({\n loader: async () => {\n const { pullIdentifiers } = await import('./impl');\n return pullIdentifiers;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n requiresSiloScope: true,\n }),\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the data silo to pull in',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to restart',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n sombraAuth: createSombraAuthParameter(),\n pageLimit: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page limit to use when pulling in pages of identifiers',\n default: '100',\n },\n skipRequestCount: {\n kind: 'boolean',\n brief:\n 'Whether to skip the count of all outstanding requests. This is required to render the progress bar, but can take a long time to run if you have a large number of outstanding requests to process. In that case, we recommend setting skipRequestCount=true so that you can still proceed with fetching the identifiers',\n default: false,\n },\n chunkSize: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Maximum number of rows per CSV file. For large datasets, the output will be automatically split into multiple files to avoid file system size limits. Each file will contain at most this many rows',\n default: '10000',\n },\n },\n },\n docs: {\n brief: 'Pull identifiers of outstanding requests for a data silo to a CSV.',\n fullDescription: `If you are using the cron job integration, you can run this command to pull the outstanding identifiers for the data silo to a CSV.\n\nFor large datasets, the output will be automatically split into multiple CSV files to avoid file system size limits. Use the --chunkSize parameter to control the maximum number of rows per file.\n\nRead more at https://docs.transcend.io/docs/integrations/cron-job-integration.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const pullProfilesCommand = buildCommand({\n loader: async () => {\n const { pullProfiles } = await import('./impl');\n return pullProfiles;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n requiresSiloScope: true,\n }),\n cronDataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the cron data silo to pull in',\n },\n targetDataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the target data silo to pull in',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to restart',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers.csv',\n },\n fileTarget: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers-target.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n sombraAuth: createSombraAuthParameter(),\n pageLimit: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page limit to use when pulling in pages of identifiers',\n default: '100',\n },\n skipRequestCount: {\n kind: 'boolean',\n brief:\n 'Whether to skip the count of all outstanding requests. This is required to render the progress bar, but can take a long time to run if you have a large number of outstanding requests to process. In that case, we recommend setting skipRequestCount=true so that you can still proceed with fetching the identifiers',\n default: false,\n },\n chunkSize: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Maximum number of rows per CSV file. For large datasets, the output will be automatically split into multiple files to avoid file system size limits. Each file will contain at most this many rows',\n default: '10000',\n },\n },\n },\n docs: {\n brief: 'Pull profiles of outstanding requests for a data silo to a CSV.',\n fullDescription: `If you are using the cron job integration, you can run this command to pull the outstanding profiles for the data silo to a CSV.\n\nFor large datasets, the output will be automatically split into multiple CSV files to avoid file system size limits. Use the --chunkSize parameter to control the maximum number of rows per file.\n\nRead more at https://docs.transcend.io/docs/integrations/cron-job-integration.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { markIdentifiersCompletedCommand } from './mark-identifiers-completed/command';\nimport { pullIdentifiersCommand } from './pull-identifiers/command';\nimport { pullProfilesCommand } from './pull-profiles/command';\n\nexport const cronRoutes = buildRouteMap({\n routes: {\n 'pull-identifiers': pullIdentifiersCommand,\n 'pull-profiles': pullProfilesCommand,\n 'mark-identifiers-completed': markIdentifiersCompletedCommand,\n },\n docs: {\n brief: 'Cron commands',\n hideRoute: {\n 'pull-profiles': true,\n },\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n RequestAction,\n RequestEnricherStatus,\n ScopeName,\n} from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const enricherRestartCommand = buildCommand({\n loader: async () => {\n const { enricherRestart } = await import('./impl');\n return enricherRestart;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageRequestCompilation],\n }),\n enricherId: {\n kind: 'parsed',\n parse: String,\n brief: 'The ID of the enricher to restart',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request action to restart',\n optional: true,\n },\n requestEnricherStatuses: {\n kind: 'enum',\n values: Object.values(RequestEnricherStatus),\n variadic: ',',\n brief: 'The request enricher statuses to restart',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '15',\n },\n requestIds: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'Specify the specific request IDs to restart',\n optional: true,\n },\n createdAtBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Restart requests that were submitted before this time',\n optional: true,\n },\n createdAtAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Restart requests that were submitted after this time',\n optional: true,\n },\n },\n },\n docs: {\n brief: 'Bulk restart a particular enricher across a series of DSRs',\n fullDescription: `Bulk restart a particular enricher across a series of DSRs.\n\nThe API key needs the following scopes:\n- Manage Request Compilation`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n RequestAction,\n RequestStatus,\n ScopeName,\n} from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const exportCommand = buildCommand({\n loader: async () => {\n const { _export } = await import('./impl');\n return _export;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewRequests, ScopeName.ViewRequestCompilation],\n }),\n sombraAuth: createSombraAuthParameter(),\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to export',\n optional: true,\n },\n statuses: {\n kind: 'enum',\n values: Object.values(RequestStatus),\n variadic: ',',\n brief: 'The request statuses to export',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './transcend-request-export.csv',\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '50',\n },\n skipRequestIdentifiers: {\n kind: 'boolean',\n brief: 'Skip exporting request identifiers',\n optional: true,\n },\n createdAtBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Pull requests that were submitted before this time',\n optional: true,\n },\n createdAtAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Pull requests that were submitted after this time',\n optional: true,\n },\n showTests: {\n kind: 'boolean',\n brief:\n 'Filter for test requests or production requests - when not provided, pulls both',\n optional: true,\n },\n pageLimit: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page limit to use when pulling in pages of requests',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Export privacy requests and request identifiers to a CSV file',\n fullDescription:\n 'Export privacy requests and request identifiers to a CSV file.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { RequestAction, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { buildExampleCommand } from '../../../../lib/docgen/buildExamples';\nimport type { PullIdentifiersCommandFlags } from './impl';\nimport type { PushIdentifiersCommandFlags } from '../push-identifiers/impl';\n\nexport const pullIdentifiersCommand = buildCommand({\n loader: async () => {\n const { pullIdentifiers } = await import('./impl');\n return pullIdentifiers;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewRequests, ScopeName.ViewRequestCompilation],\n }),\n sombraAuth: createSombraAuthParameter(),\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where requests will be written to',\n default: './manual-enrichment-identifiers.csv',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to pull for',\n optional: true,\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Pull identifiers for manual enrichment',\n fullDescription: `This command pulls down the set of privacy requests that are currently pending manual enrichment.\n\nThis is useful for the following workflow:\n\n1. Pull identifiers to CSV:\n\n ${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'preflight', 'pull-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\n2. Fill out the CSV with additional identifiers\n\n3. Push updated back to Transcend:\n\n ${buildExampleCommand<PushIdentifiersCommandFlags>(\n ['request', 'preflight', 'push-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport { buildExampleCommand } from '../../../../lib/docgen/buildExamples';\nimport type { PullIdentifiersCommandFlags } from '../pull-identifiers/impl';\nimport type { PushIdentifiersCommandFlags } from './impl';\n\nexport const pushIdentifiersCommand = buildCommand({\n loader: async () => {\n const { pushIdentifiers } = await import('./impl');\n return pushIdentifiers;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.ManageRequestIdentities,\n ScopeName.ManageRequestCompilation,\n ],\n }),\n enricherId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the Request Enricher to upload to',\n },\n sombraAuth: createSombraAuthParameter(),\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where requests will be written to',\n default: './manual-enrichment-identifiers.csv',\n },\n markSilent: {\n kind: 'boolean',\n brief: 'When true, set requests into silent mode before enriching',\n default: false,\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Push identifiers for manual enrichment',\n fullDescription: `This command push up a set of identifiers for a set of requests pending manual enrichment.\n\nThis is useful for the following workflow:\n\n1. Pull identifiers to CSV:\n\n ${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'preflight', 'pull-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\n2. Fill out the CSV with additional identifiers\n\n3. Push updated back to Transcend:\n\n ${buildExampleCommand<PushIdentifiersCommandFlags>(\n ['request', 'preflight', 'push-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { pullIdentifiersCommand } from './pull-identifiers/command';\nimport { pushIdentifiersCommand } from './push-identifiers/command';\n\nexport const preflightRoutes = buildRouteMap({\n routes: {\n 'pull-identifiers': pullIdentifiersCommand,\n 'push-identifiers': pushIdentifiersCommand,\n },\n docs: {\n brief: 'Preflight commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { RequestAction, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\n\nexport const retryRequestDataSilosCommand = buildCommand({\n loader: async () => {\n const { retryRequestDataSilos } = await import('./impl');\n return retryRequestDataSilos;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageRequestCompilation],\n }),\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the data silo to pull in',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to restart',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Retry request data silos',\n fullDescription:\n 'This command allows for bulk restarting a set of data silos jobs for open privacy requests. This is equivalent to clicking the \"Wipe and Retry\" button for a particular data silo across a set of privacy requests.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadCommand = buildCommand({\n loader: async () => {\n const { upload } = await import('./impl');\n return upload;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.MakeDataSubjectRequest,\n ScopeName.ViewRequestIdentitySettings,\n ScopeName.ViewGlobalAttributes,\n ],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file of requests to upload',\n default: './requests.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n cacheFilepath: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The path to the JSON file encoding the metadata used to map the CSV shape to Transcend API',\n default: './transcend-privacy-requests-cache.json',\n },\n requestReceiptFolder: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The path to the folder where receipts of each upload are stored',\n default: './privacy-request-upload-receipts',\n },\n sombraAuth: createSombraAuthParameter(),\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '50',\n },\n attributes: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Tag all of the requests with the following attributes. Format: key1:value1;value2,key2:value3;value4',\n default: 'Tags:transcend-cli',\n },\n isTest: {\n kind: 'boolean',\n brief:\n 'Flag whether the requests being uploaded are test requests or regular requests',\n default: false,\n },\n isSilent: {\n kind: 'boolean',\n brief:\n 'Flag whether the requests being uploaded should be submitted in silent mode',\n default: true,\n },\n skipSendingReceipt: {\n kind: 'boolean',\n brief: 'Flag whether to skip sending of the receipt email',\n default: false,\n },\n emailIsVerified: {\n kind: 'boolean',\n brief:\n 'Indicate whether the email address being uploaded is pre-verified. Set to false to send a verification email',\n default: true,\n },\n skipFilterStep: {\n kind: 'boolean',\n brief: 'When true, skip the interactive step to filter down the CSV',\n default: false,\n },\n dryRun: {\n kind: 'boolean',\n brief:\n 'When true, perform a dry run of the upload instead of calling the API to submit the requests',\n default: false,\n },\n debug: {\n kind: 'boolean',\n brief: 'Debug logging',\n default: false,\n },\n defaultPhoneCountryCode: {\n kind: 'parsed',\n parse: String,\n brief:\n 'When uploading phone numbers, if the phone number is missing a country code, assume this country code',\n default: '1',\n },\n },\n },\n docs: {\n brief: 'Upload a set of requests from a CSV',\n fullDescription: `Upload a set of requests from a CSV.\n\nThis command prompts you to map the shape of the CSV to the shape of the Transcend API. There is no requirement for the shape of the incoming CSV, as the script will handle the mapping process.\n\nThe script will also produce a JSON cache file that allows for the mappings to be preserved between runs.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { approveCommand } from './approve/command';\nimport { cancelCommand } from './cancel/command';\nimport { cronRoutes } from './cron/routes';\nimport { downloadFilesCommand } from './download-files/command';\nimport { enricherRestartCommand } from './enricher-restart/command';\nimport { exportCommand } from './export/command';\nimport { markSilentCommand } from './mark-silent/command';\nimport { notifyAdditionalTimeCommand } from './notify-additional-time/command';\nimport { preflightRoutes } from './preflight/routes';\nimport { rejectUnverifiedIdentifiersCommand } from './reject-unverified-identifiers/command';\nimport { restartCommand } from './restart/command';\nimport { skipPreflightJobsCommand } from './skip-preflight-jobs/command';\nimport { systemRoutes } from './system/routes';\nimport { uploadCommand } from './upload/command';\n\nexport const requestRoutes = buildRouteMap({\n routes: {\n approve: approveCommand,\n upload: uploadCommand,\n 'download-files': downloadFilesCommand,\n cancel: cancelCommand,\n restart: restartCommand,\n 'notify-additional-time': notifyAdditionalTimeCommand,\n 'mark-silent': markSilentCommand,\n 'enricher-restart': enricherRestartCommand,\n 'reject-unverified-identifiers': rejectUnverifiedIdentifiersCommand,\n export: exportCommand,\n 'skip-preflight-jobs': skipPreflightJobsCommand,\n system: systemRoutes,\n preflight: preflightRoutes,\n cron: cronRoutes,\n },\n docs: {\n brief: 'All commands related to DSR requests',\n },\n});\n"]}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkFZTNEEMWcjs = require('./chunk-FZTNEEMW.cjs');var _iots = require('io-ts'); var e = _interopRequireWildcard(_iots); var P = _interopRequireWildcard(_iots);var _typeutils = require('@transcend-io/type-utils');var X=e.type({identifier:e.string,type:e.string,coreIdentifier:e.string,dataSiloId:e.string,requestId:e.string,nonce:e.string,requestCreatedAt:e.string,daysUntilOverdue:e.number,attributes:e.array(e.type({key:e.string,values:e.array(e.string)}))});async function U(r,{dataSiloId:s,limit:c=100,offset:n=0,requestType:a}){try{let i=await r.get(`v1/data-silo/${s}/pending-requests/${a}`,{searchParams:{offset:n,limit:c}}).json(),{items:f}=_typeutils.decodeCodec.call(void 0, e.type({items:e.array(X)}),i);return f}catch(i){throw new Error(`Received an error from server: ${_optionalChain([i, 'optionalAccess', _2 => _2.response, 'optionalAccess', _3 => _3.body])||_optionalChain([i, 'optionalAccess', _4 => _4.message])}`)}}var L=P.type({nonce:P.string,identifier:P.string});async function B(r,{nonce:s,identifier:c}){try{return await r.put("v1/data-silo",{headers:{"x-transcend-nonce":s},json:{profiles:[{profileId:c}]}}),!0}catch(n){if(_optionalChain([n, 'access', _5 => _5.response, 'optionalAccess', _6 => _6.statusCode])===409)return!1;throw new Error(`Received an error from server: ${_optionalChain([n, 'optionalAccess', _7 => _7.response, 'optionalAccess', _8 => _8.body])||_optionalChain([n, 'optionalAccess', _9 => _9.message])}`)}}var _bluebird = require('bluebird');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _cliprogress = require('cli-progress'); var _cliprogress2 = _interopRequireDefault(_cliprogress);async function ge({file:r,dataSiloId:s,auth:c,sombraAuth:n,concurrency:a=100,transcendUrl:i=_chunkFZTNEEMWcjs.r,sleepSeconds:f=10}){let y=await _chunkVWGA62SGcjs.yc.call(void 0, i,c,n);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${r}" from disk`));let o=_chunkVWGA62SGcjs.sc.call(void 0, r,L);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Notifying Transcend for data silo "${s}" marking "${o.length}" identifiers as completed.`));let C=new Date().getTime(),w=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),d=0,u=0,l=0;w.start(o.length,0);let m=_chunkFZTNEEMWcjs.b.call(void 0, o,a),I=m.length;await _bluebird.mapSeries.call(void 0, m,async($,S)=>{_chunkZUNVPK23cjs.a.info(_colors2.default.blue(`Processing chunk ${S+1}/${I} (${_chunkFZTNEEMWcjs.b.length} items)`)),await _bluebird.map.call(void 0, $,async h=>{try{await B(y,h)?d+=1:u+=1}catch(b){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Error notifying Transcend for identifier "${h.identifier}" - ${_optionalChain([b, 'optionalAccess', _10 => _10.message])}`)),l+=1}w.update(d+u)}),f>0&&S<I-1&&(_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`Sleeping for ${f}s before next chunk...`)),await new Promise(h=>{setTimeout(h,f*1e3)}))}),w.stop();let D=new Date().getTime()-C;if(_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully notified Transcend for ${d} identifiers in "${D/1e3}" seconds!`)),u&&_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`There were ${u} identifiers that were not in a state to be updated.They likely have already been resolved.`)),l)throw _chunkZUNVPK23cjs.a.error(_colors2.default.red(`There were ${l} identifiers that failed to be updated. Please review the logs for more information.`)),new Error("Failed to update all identifiers");return o.length}var _privacytypes = require('@transcend-io/privacy-types');async function Pe({requestIds:r,dataSiloId:s,auth:c,concurrency:n=100,status:a=_privacytypes.RequestDataSiloStatus.Resolved,transcendUrl:i=_chunkFZTNEEMWcjs.r}){let f=_chunkVWGA62SGcjs.xc.call(void 0, i,c),y=new Date().getTime(),o=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Notifying Transcend for data silo "${s}" marking "${r.length}" requests as completed.`));let C=0;o.start(r.length,0),await _bluebird.map.call(void 0, r,async u=>{let l=await _chunkVWGA62SGcjs.Hd.call(void 0, f,{requestId:u,dataSiloId:s});try{await _chunkVWGA62SGcjs.ug.call(void 0, f,_chunkVWGA62SGcjs.va,{requestDataSiloId:l.id,status:a})}catch(m){if(!m.message.includes("Client error: Request must be active:")&&!m.message.includes("Failed to find RequestDataSilo"))throw m}C+=1,o.update(C)},{concurrency:n}),o.stop();let d=new Date().getTime()-y;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully notified Transcend in "${d/1e3}" seconds!`)),r.length}async function _e({dataSiloId:r,auth:s,sombraAuth:c,actions:n,apiPageSize:a=100,savePageSize:i=1e3,onSave:f,transcendUrl:y=_chunkFZTNEEMWcjs.r,skipRequestCount:o=!1}){if(i%a!==0)throw new Error(`savePageSize must be a multiple of apiPageSize. savePageSize: ${i}, apiPageSize: ${a}`);let C=await _chunkVWGA62SGcjs.yc.call(void 0, y,s,c),w=_chunkVWGA62SGcjs.xc.call(void 0, y,s),d=0;o||(d=await _chunkVWGA62SGcjs.Id.call(void 0, w,{dataSiloId:r})),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling ${o?"all":d} outstanding request identifiers for data silo: "${r}" for requests of types "${n.join('", "')}"`));let u=new Date().getTime(),l=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),m=new Set,I=[],g=[];o||l.start(d,0),await _bluebird.mapSeries.call(void 0, n,async $=>{let S=0,h=!0;for(;h;){let b=await U(C,{dataSiloId:r,limit:a,offset:S,requestType:$}),k=b.map(A=>(m.add(A.requestId),{...A,action:$})),J=k.map(({attributes:A,...K})=>({...K,...A.reduce((M,E)=>Object.assign(M,{[E.key]:E.values.join(",")}),{})}));I.push(...k),g.push(...J),g.length>=i&&(await f(g),g=[]),h=b.length===a,S+=a,o?_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulled ${b.length} outstanding identifiers for ${m.size} requests`)):l.update(m.size)}}),g.length>0&&await f(g),o||l.stop();let D=new Date().getTime()-u;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully pulled ${I.length} outstanding identifiers from ${m.size} requests in "${D/1e3}" seconds!`)),{identifiers:I}}exports.a = X; exports.b = U; exports.c = L; exports.d = B; exports.e = ge; exports.f = Pe; exports.g = _e;
2
- //# sourceMappingURL=chunk-FMFQTG5Q.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-HAAVY3FG.cjs","../src/lib/data-inventory/pullAllDatapoints.ts","../src/lib/data-inventory/pullUnstructuredSubDataPointRecommendations.ts"],"names":["pullSubDatapoints","client","dataSiloIds","includeGuessedCategories","includeAttributes","parentCategories","subCategories","pageSize","subDataPoints","t0","progressBar","cliProgress","filterBy","SubDataPointDataSubCategoryGuessStatus","totalCount","makeGraphQLRequest","SUB_DATA_POINTS_COUNT","logger","colors","total","shouldContinue","cursor","offset","nodes","gql","err"],"mappings":"AAAA,quBAAqE,wDAAyC,wDAA8D,2DCKrK,qGACiB,iDACJ,gFACD,oCAWO,MAuE1B,SAAeA,CAAAA,CACbC,CAAAA,CACA,CACE,WAAA,CAAAC,CAAAA,CAAc,CAAC,CAAA,CACf,wBAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CAAmB,CAAC,CAAA,CACpB,aAAA,CAAAC,CAAAA,CAAgB,CAAC,CAAA,CACjB,QAAA,CAAAC,CAAAA,CAAW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AA;AA+BiB,QAAA","file":"/home/runner/work/cli/cli/dist/chunk-HAAVY3FG.cjs","sourcesContent":[null,"/* eslint-disable max-lines */\nimport { keyBy, uniq, chunk, sortBy } from 'lodash-es';\nimport {\n type DataCategoryType,\n SubDataPointDataSubCategoryGuessStatus,\n} from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport { gql } from 'graphql-request';\nimport colors from 'colors';\nimport type { GraphQLClient } from 'graphql-request';\nimport {\n DATAPOINT_EXPORT,\n DATA_SILO_EXPORT,\n type DataSiloAttributeValue,\n SUB_DATA_POINTS_COUNT,\n makeGraphQLRequest,\n} from '../graphql';\nimport { logger } from '../../logger';\nimport type { DataCategoryInput, ProcessingPurposeInput } from '../../codecs';\nimport { mapSeries } from 'bluebird';\n\nexport interface DataSiloCsvPreview {\n /** ID of dataSilo */\n id: string;\n /** Name of dataSilo */\n title: string;\n}\n\nexport interface DataPointCsvPreview {\n /** ID of dataPoint */\n id: string;\n /** The path to this data point */\n path: string[];\n /** Description */\n description: {\n /** Default message */\n defaultMessage: string;\n };\n /** Name */\n name: string;\n}\n\nexport interface SubDataPointCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Name (or key) of the subdatapoint */\n name: string;\n /** The description */\n description?: string;\n /** Personal data category */\n categories: DataCategoryInput[];\n /** Data point ID */\n dataPointId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** The processing purpose for this sub datapoint */\n purposes: ProcessingPurposeInput[];\n /** Attribute attached to subdatapoint */\n attributeValues?: DataSiloAttributeValue[];\n /** Data category guesses that are output by the classifier */\n pendingCategoryGuesses?: {\n /** Data category being guessed */\n category: DataCategoryInput;\n /** Status of guess */\n status: SubDataPointDataSubCategoryGuessStatus;\n /** classifier version that produced the guess */\n classifierVersion: number;\n }[];\n}\n\nexport interface DatapointFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Whether to include guessed categories, defaults to only approved categories */\n includeGuessedCategories?: boolean;\n /** Whether or not to include attributes */\n includeAttributes?: boolean;\n /** Parent categories to filter down for */\n parentCategories?: DataCategoryType[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n}\n\n/**\n * Pull subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The subdatapoints\n */\nasync function pullSubDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<SubDataPointCsvPreview[]> {\n const subDataPoints: SubDataPointCsvPreview[] = [];\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 // Filters\n const filterBy = {\n ...(parentCategories.length > 0 ? { category: parentCategories } : {}),\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n // if parentCategories or subCategories and not includeGuessedCategories\n ...(parentCategories.length + subCategories.length > 0 &&\n !includeGuessedCategories\n ? // then only show data points with approved data categories\n { status: SubDataPointDataSubCategoryGuessStatus.Approved }\n : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n subDataPoints: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** Count */\n totalCount: number;\n };\n }>(client, SUB_DATA_POINTS_COUNT, {\n filterBy,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n subDataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** List of matches */\n nodes: SubDataPointCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliSubDataPointCsvExport(\n $filterBy: SubDataPointFiltersInput\n $first: Int!\n $offset: Int!\n ) {\n subDataPoints(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n name\n description\n dataPointId\n dataSiloId\n purposes {\n name\n purpose\n }\n categories {\n name\n category\n }\n ${\n includeGuessedCategories\n ? `pendingCategoryGuesses {\n category {\n name\n category\n }\n status\n classifierVersion\n }`\n : ''\n }\n ${\n includeAttributes\n ? `attributeValues {\n attributeKey {\n name\n }\n name\n }`\n : ''\n }\n }\n }\n }\n `,\n {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n // TODO: https://transcend.height.app/T-40484 - add cursor support\n // ...(cursor ? { cursor: { id: cursor } } : {}),\n },\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n subDataPoints.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`,\n ),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(subDataPoints, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return sorted;\n}\n\n/**\n * Pull datapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints\n */\nasync function pullDatapoints(\n client: GraphQLClient,\n {\n dataPointIds = [],\n pageSize = 100,\n }: {\n /** IDs of data points to filter down */\n dataPointIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataPointCsvPreview[]> {\n const dataPoints: DataPointCsvPreview[] = [];\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 logger.info(\n colors.magenta(\n `[Step 2/3] Fetching metadata for ${dataPointIds.length} datapoints`,\n ),\n );\n\n // Group by 100\n const dataPointsGrouped = chunk(dataPointIds, pageSize);\n\n progressBar.start(dataPointIds.length, 0);\n let total = 0;\n await mapSeries(dataPointsGrouped, async (dataPointIdsGroup) => {\n try {\n const {\n dataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataPoints: {\n /** List of matches */\n nodes: DataPointCsvPreview[];\n };\n }>(client, DATAPOINT_EXPORT, {\n first: pageSize,\n filterBy: {\n ids: dataPointIdsGroup,\n },\n });\n\n dataPoints.push(...nodes);\n total += dataPointIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for IDs ${dataPointIdsGroup.join(\n ', ',\n )}`,\n ),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataPoints.length} dataPoints in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return dataPoints;\n}\n\n/**\n * Pull data silo information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The data silos\n */\nasync function pullDataSilos(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n pageSize = 100,\n }: {\n /** IDs of data silos to filter down */\n dataSiloIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataSiloCsvPreview[]> {\n const dataSilos: DataSiloCsvPreview[] = [];\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 logger.info(\n colors.magenta(\n `[Step 3/3] Fetching metadata for ${dataSiloIds.length} data silos`,\n ),\n );\n\n // Group by 100\n const dataSilosGrouped = chunk(dataSiloIds, pageSize);\n\n progressBar.start(dataSiloIds.length, 0);\n let total = 0;\n await mapSeries(dataSilosGrouped, async (dataSiloIdsGroup) => {\n try {\n const {\n dataSilos: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataSilos: {\n /** List of matches */\n nodes: DataSiloCsvPreview[];\n };\n }>(client, DATA_SILO_EXPORT, {\n first: pageSize,\n filterBy: {\n ids: dataSiloIdsGroup,\n },\n });\n\n dataSilos.push(...nodes);\n total += dataSiloIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching data silos for IDs ${dataSiloIdsGroup.join(', ')}`,\n ),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataSilos.length} data silos in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return dataSilos;\n}\n\n/**\n * Pull all datapoints from the data inventory.\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints and data silos\n */\nexport async function pullAllDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<\n (SubDataPointCsvPreview & {\n /** Data point information */\n dataPoint: DataPointCsvPreview;\n /** Data silo information */\n dataSilo: DataSiloCsvPreview;\n })[]\n> {\n // Subdatapoint information\n const subDatapoints = await pullSubDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n includeAttributes,\n parentCategories,\n subCategories,\n pageSize,\n });\n\n // The datapoint ids to grab\n const dataPointIds = uniq(subDatapoints.map((point) => point.dataPointId));\n const dataPoints = await pullDatapoints(client, {\n dataPointIds,\n });\n const dataPointById = keyBy(dataPoints, 'id');\n\n // The data silo IDs to grab\n const allDataSiloIds = uniq(subDatapoints.map((point) => point.dataSiloId));\n const dataSilos = await pullDataSilos(client, {\n dataSiloIds: allDataSiloIds,\n });\n const dataSiloById = keyBy(dataSilos, 'id');\n\n return subDatapoints.map((subDataPoint) => ({\n ...subDataPoint,\n dataPoint: dataPointById[subDataPoint.dataPointId],\n dataSilo: dataSiloById[subDataPoint.dataSiloId],\n }));\n}\n/* eslint-enable max-lines */\n","import type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { gql, type GraphQLClient } from 'graphql-request';\nimport { sortBy } from 'lodash-es';\nimport type { DataCategoryInput } from '../../codecs';\nimport { ENTRY_COUNT, makeGraphQLRequest } from '../graphql';\nimport { logger } from '../../logger';\n\ninterface UnstructuredSubDataPointRecommendationCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Entry or Named Entity recognized by the classifier */\n name: string;\n /** Context snippet including entry */\n contextSnippet: string;\n /** Scanned object ID */\n scannedObjectId: string;\n /** Scanned object path ID */\n scannedObjectPathId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** Personal data category */\n dataSubCategory: DataCategoryInput;\n /** Classification Status */\n status: UnstructuredSubDataPointRecommendationStatus;\n /** Confidence */\n confidence: number;\n /** Classification method */\n classificationMethod: string;\n /** Classifier version */\n classifierVersion: string;\n}\n\ninterface EntryFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Parent categories to filter down for */\n status?: UnstructuredSubDataPointRecommendationStatus[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n /** Include entry and snippet */\n includeEncryptedSnippets?: boolean;\n /** Include encryptedSamplesS3Key */\n includeEncryptedSamplesS3Key?: boolean;\n}\n/**\n * Pull unstructured subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @param options.dataSiloIds - IDs of data silos to filter down\n * @param options.status - Parent categories to filter down for\n * @param options.subCategories - Sub categories to filter down for\n * @param options.includeEncryptedSnippets - Include entry and snippet\n * @param options.includeEncryptedSamplesS3Key - Include encryptedSamplesS3Key\n * @param options.pageSize - Page size to pull in\n * @returns A promise that resolves to an array of unstructured subdatapoint recommendations\n */\nexport async function pullUnstructuredSubDataPointRecommendations(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n status,\n subCategories = [],\n includeEncryptedSnippets,\n pageSize = 100,\n }: EntryFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<UnstructuredSubDataPointRecommendationCsvPreview[]> {\n const unstructuredSubDataPointRecommendations: UnstructuredSubDataPointRecommendationCsvPreview[] =\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 // Filters\n const filterBy = {\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n ...(status ? { status } : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n unstructuredSubDataPointRecommendations: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n unstructuredSubDataPointRecommendations: {\n /** Count */\n totalCount: number;\n };\n }>(client, ENTRY_COUNT, {\n filterBy,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n unstructuredSubDataPointRecommendations: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n unstructuredSubDataPointRecommendations: {\n /** List of matches */\n nodes: UnstructuredSubDataPointRecommendationCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliUnstructuredSubDataPointRecommendationCsvExport(\n $filterBy: UnstructuredSubDataPointRecommendationsFilterInput\n $first: Int!\n $offset: Int!\n ) {\n unstructuredSubDataPointRecommendations(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n dataSiloId\n scannedObjectPathId\n scannedObjectId\n ${includeEncryptedSnippets ? 'name' : ''}\n ${includeEncryptedSnippets ? 'contextSnippet' : ''}\n dataSubCategory {\n name\n category\n }\n status\n confidence\n classificationMethod\n classifierVersion\n }\n }\n }\n `,\n {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n },\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n unstructuredSubDataPointRecommendations.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`,\n ),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(unstructuredSubDataPointRecommendations, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return sorted;\n}\n"]}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkFZTNEEMWcjs = require('./chunk-FZTNEEMW.cjs');var _crypto = require('crypto'); var E = _interopRequireWildcard(_crypto);var _jsonwebtoken = require('jsonwebtoken'); var $ = _interopRequireWildcard(_jsonwebtoken);function A(c,p,t){let n=Buffer.from(t,"base64"),u=Buffer.from(p,"base64"),f="id-aes256-wrap-pad",l=Buffer.from("A65959A6","hex"),o=E.createCipheriv(f,u,l),s={encryptedIdentifier:Buffer.concat([o.update(c),o.final()]).toString("base64")};return $.sign(s,n,{algorithm:"HS384"})}var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _iots = require('io-ts'); var r = _interopRequireWildcard(_iots);var _bluebird = require('bluebird');var _cliprogress = require('cli-progress'); var _cliprogress2 = _interopRequireDefault(_cliprogress);var _typeutils = require('@transcend-io/type-utils');var x=/^[0-9][Y|N]([Y|N])[Y|N]$/,I= exports.c =r.record(r.string,r.union([r.boolean,r.literal("Auto")]));async function q({base64EncryptionKey:c,base64SigningKey:p,preferences:t,partition:n,concurrency:u=100,transcendUrl:f=_chunkFZTNEEMWcjs.s}){let l=_chunkVWGA62SGcjs.zc.call(void 0, f),o=t.filter(e=>e.usp&&!x.test(e.usp));if(o.length>0)throw new Error(`Received invalid usp strings: ${JSON.stringify(o,null,2)}`);let d=t.map((e,g)=>[e,g]).filter(([e])=>{if(!e.purposes)return!1;try{return _typeutils.decodeCodec.call(void 0, I,e.purposes),!1}catch (e2){return!0}});if(d.length>0)throw new Error(`Received invalid purpose maps: ${JSON.stringify(d,null,2)}`);let s=t.filter(e=>!e.usp&&!e.purposes);if(s.length>0)throw new Error(`Received invalid inputs, expected either purposes or usp to be defined: ${JSON.stringify(s,null,2)}`);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Uploading ${t.length} user preferences to partition ${n}`));let S=new Date().getTime(),m=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),v=0;m.start(t.length,0),await _bluebird.map.call(void 0, t,async({userId:e,confirmed:g="true",updated:C,prompted:P,purposes:N,...i})=>{let O=A(e,c,p),[,_]=i.usp?x.exec(i.usp)||[]:[],j={token:O,partition:n,consent:{confirmed:g==="true",purposes:N?_typeutils.decodeCodec.call(void 0, I,N):i.usp?{SaleOfInfo:_==="Y"}:{},...C?{updated:C==="true"}:{},...P?{prompted:P==="true"}:{},...i}};try{await l.post("sync",{json:j}).json()}catch(y){try{let h=JSON.parse(_optionalChain([y, 'optionalAccess', _2 => _2.response, 'optionalAccess', _3 => _3.body])||"{}");h.error&&_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Error: ${h.error}`))}catch (e3){}throw new Error(`Received an error from server: ${_optionalChain([y, 'optionalAccess', _4 => _4.response, 'optionalAccess', _5 => _5.body])||_optionalChain([y, 'optionalAccess', _6 => _6.message])}`)}v+=1,m.update(v)},{concurrency:u}),m.stop();let R=new Date().getTime()-S;_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully uploaded ${t.length} user preferences to partition ${n} in "${R/1e3}" seconds!`))}exports.a = A; exports.b = x; exports.c = I; exports.d = q;
2
- //# sourceMappingURL=chunk-HUZESENZ.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-HUZESENZ.cjs","../src/lib/consent-manager/createConsentToken.ts","../src/lib/consent-manager/uploadConsents.ts"],"names":["createConsentToken","userId","base64EncryptionKey","base64SigningKey","signingKey","encryptionKey","encryptionAlgorithm","iv","cipher","jwtPayload","USP_STRING_REGEX","PurposeMap","uploadConsents","preferences","partition","concurrency","transcendUrl","DEFAULT_TRANSCEND_CONSENT_API","transcendConsentApi","createTranscendConsentGotInstance","invalidUspStrings","pref"],"mappings":"AAAA,u/BAAyC,wDAAoC,wDAAyC,0ECA9F,4FACH,SAWLA,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACQ,CAER,IAAMC,CAAAA,CAAa,MAAA,CAAO,IAAA,CAAKD,CAAAA,CAAkB,QAAQ,CAAA,CACnDE,CAAAA,CAAgB,MAAA,CAAO,IAAA,CAAKH,CAAAA,CAA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,CAAA,CAC7B,MAAM,IAAI,KAAA,CACR,CAAA,8BAAA,EAAiC,IAAA,CAAK,SAAA,CACpCA,CAAAA,CACA,IAAA,CACA,CACF,CAAC,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/chunk-HUZESENZ.cjs","sourcesContent":[null,"import * as crypto from 'crypto';\nimport * as jwt from 'jsonwebtoken';\n\n/**\n * Function to create a consent manager token\n *\n * @see https://docs.transcend.io/docs/consent/reference/managed-consent-database\n * @param userId - User ID\n * @param base64EncryptionKey - Encryption key\n * @param base64SigningKey - Signing key\n * @returns Token\n */\nexport function createConsentToken(\n userId: string,\n base64EncryptionKey: string,\n base64SigningKey: string,\n): string {\n // Read on for where to find these keys\n const signingKey = Buffer.from(base64SigningKey, 'base64');\n const encryptionKey = Buffer.from(base64EncryptionKey, 'base64');\n\n // NIST's AES-KWP implementation { aes 48 } - see https://tools.ietf.org/html/rfc5649\n const encryptionAlgorithm = 'id-aes256-wrap-pad';\n // Initial Value for AES-KWP integrity check - see https://tools.ietf.org/html/rfc5649#section-3\n const iv = Buffer.from('A65959A6', 'hex');\n // Set up encryption algorithm\n const cipher = crypto.createCipheriv(encryptionAlgorithm, encryptionKey, iv);\n\n // Encrypt the userId and base64-encode the result\n const encryptedIdentifier = Buffer.concat([\n cipher.update(userId),\n cipher.final(),\n ]).toString('base64');\n\n // Create the JWT content - jwt.sign will add a 'iat' (issued at) field to the payload\n // If you wanted to add something manually, consider\n // const issued: Date = new Date();\n // const isoDate = issued.toISOString();\n const jwtPayload = {\n encryptedIdentifier,\n };\n\n // Create a JSON web token and HMAC it with SHA-384\n const consentToken = jwt.sign(jwtPayload, signingKey, {\n algorithm: 'HS384',\n });\n\n return consentToken;\n}\n","import { createTranscendConsentGotInstance } from '../graphql';\nimport colors from 'colors';\nimport * as t from 'io-ts';\nimport { DEFAULT_TRANSCEND_CONSENT_API } from '../../constants';\nimport { map } from 'bluebird';\nimport { createConsentToken } from './createConsentToken';\nimport { logger } from '../../logger';\nimport cliProgress from 'cli-progress';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { ConsentPreferenceUpload } from './types';\nimport { ConsentPreferencesBody } from '@transcend-io/airgap.js-types';\n\nexport const USP_STRING_REGEX = /^[0-9][Y|N]([Y|N])[Y|N]$/;\n\nexport const PurposeMap = t.record(\n t.string,\n t.union([t.boolean, t.literal('Auto')]),\n);\n\n/**\n * Upload a set of consent preferences\n *\n * @param options - Options\n */\nexport async function uploadConsents({\n base64EncryptionKey,\n base64SigningKey,\n preferences,\n partition,\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_CONSENT_API,\n}: {\n /** base64 encryption key */\n base64EncryptionKey: string;\n /** base64 signing key */\n base64SigningKey: string;\n /** Partition key */\n partition: string;\n /** Sombra API key authentication */\n preferences: ConsentPreferenceUpload[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Concurrency limit for approving */\n concurrency?: number;\n}): Promise<void> {\n // Create connection to API\n const transcendConsentApi = createTranscendConsentGotInstance(transcendUrl);\n\n // Ensure usp strings are valid\n const invalidUspStrings = preferences.filter(\n (pref) => pref.usp && !USP_STRING_REGEX.test(pref.usp),\n );\n if (invalidUspStrings.length > 0) {\n throw new Error(\n `Received invalid usp strings: ${JSON.stringify(\n invalidUspStrings,\n null,\n 2,\n )}`,\n );\n }\n\n // Ensure purpose maps are valid\n const invalidPurposeMaps = preferences\n .map((pref, ind) => [pref, ind] as [ConsentPreferenceUpload, number])\n .filter(([pref]) => {\n if (!pref.purposes) {\n return false;\n }\n try {\n decodeCodec(PurposeMap, pref.purposes);\n return false;\n } catch {\n return true;\n }\n });\n if (invalidPurposeMaps.length > 0) {\n throw new Error(\n `Received invalid purpose maps: ${JSON.stringify(\n invalidPurposeMaps,\n null,\n 2,\n )}`,\n );\n }\n\n // Ensure usp or preferences are provided\n const invalidInputs = preferences.filter(\n (pref) => !pref.usp && !pref.purposes,\n );\n if (invalidInputs.length > 0) {\n throw new Error(\n `Received invalid inputs, expected either purposes or usp to be defined: ${JSON.stringify(\n invalidInputs,\n null,\n 2,\n )}`,\n );\n }\n\n logger.info(\n colors.magenta(\n `Uploading ${preferences.length} user preferences to partition ${partition}`,\n ),\n );\n\n // Time duration\n const t0 = new Date().getTime();\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 progressBar.start(preferences.length, 0);\n await map(\n preferences,\n async ({\n userId,\n confirmed = 'true',\n updated,\n prompted,\n purposes,\n ...consent\n }) => {\n const token = createConsentToken(\n userId,\n base64EncryptionKey,\n base64SigningKey,\n );\n\n // parse usp string\n const [, saleStatus] = consent.usp\n ? USP_STRING_REGEX.exec(consent.usp) || []\n : [];\n\n const input = {\n token,\n partition,\n consent: {\n confirmed: confirmed === 'true',\n purposes: purposes\n ? decodeCodec(PurposeMap, purposes)\n : consent.usp\n ? { SaleOfInfo: saleStatus === 'Y' }\n : {},\n ...(updated ? { updated: updated === 'true' } : {}),\n ...(prompted ? { prompted: prompted === 'true' } : {}),\n ...consent,\n },\n } as ConsentPreferencesBody;\n\n // Make the request\n try {\n await transcendConsentApi\n .post('sync', {\n json: input,\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 throw new Error(\n `Received an error from server: ${\n err?.response?.body || err?.message\n }`,\n );\n }\n\n total += 1;\n progressBar.update(total);\n },\n { concurrency },\n );\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully uploaded ${\n preferences.length\n } user preferences to partition ${partition} in \"${\n totalTime / 1000\n }\" seconds!`,\n ),\n );\n}\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkFZTNEEMWcjs = require('./chunk-FZTNEEMW.cjs');var _privacytypes = require('@transcend-io/privacy-types');var _bluebird = require('bluebird');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function te({file:u,auth:s,sombraAuth:g,requestActions:f=[],concurrency:p=100,transcendUrl:n=_chunkFZTNEEMWcjs.r}){let o=_chunkVWGA62SGcjs.xc.call(void 0, n,s),e=await _chunkVWGA62SGcjs.yc.call(void 0, n,s,g);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling manual enrichment requests, filtered for actions: ${f.join(",")}`));let d=await _chunkVWGA62SGcjs.od.call(void 0, o,{actions:f,statuses:[_privacytypes.RequestStatus.Enriching]}),i=[];await _bluebird.map.call(void 0, d,async t=>{let c=await _chunkVWGA62SGcjs.id.call(void 0, o,{requestId:t.id});if(c.filter(({status:m})=>m==="ACTION_REQUIRED")){let m=await _chunkVWGA62SGcjs.ld.call(void 0, o,e,{requestId:t.id});i.push({...t,requestIdentifiers:m,requestEnrichers:c})}},{concurrency:p});let l=i.map(({attributeValues:t,requestIdentifiers:c,requestEnrichers:w,...m})=>({...m,...Object.entries(_chunkFZTNEEMWcjs.d.call(void 0, c,"name")).reduce((I,[P,$])=>Object.assign(I,{[P]:$.map(({value:C})=>C).join(",")}),{}),...Object.entries(_chunkFZTNEEMWcjs.d.call(void 0, t,"attributeKey.name")).reduce((I,[P,$])=>Object.assign(I,{[P]:$.map(({name:C})=>C).join(",")}),{})})),a=_chunkFZTNEEMWcjs.j.call(void 0, l.map(t=>Object.keys(t)).flat());return await _chunkVWGA62SGcjs.rg.call(void 0, u,l,a),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${i.length} requests to file "${u}"`)),i}var _iots = require('io-ts'); var R = _interopRequireWildcard(_iots);var T="https://app.transcend.io/privacy-requests/incoming-requests/",F= exports.b =R.record(R.string,R.string);async function M(u,{id:s,...g},f,p){if(!s){let e=`Request ID must be provided to enricher request.${p?` Found error in row: ${p}`:""}`;throw _chunkZUNVPK23cjs.a.error(_colors2.default.red(e)),new Error(e)}let n=s.toLowerCase(),o=Object.entries(g).reduce((e,[d,i])=>_chunkFZTNEEMWcjs.j.call(void 0, _chunkVWGA62SGcjs.pc.call(void 0, i)).length===0?e:Object.assign(e,{[d]:_chunkFZTNEEMWcjs.j.call(void 0, _chunkVWGA62SGcjs.pc.call(void 0, i)).map(a=>({value:d==="email"?a.toLowerCase():a}))}),{});try{return await u.post("v1/enrich-identifiers",{headers:{"x-transcend-request-id":n,"x-transcend-enricher-id":f},json:{enrichedIdentifiers:o}}).json(),_chunkZUNVPK23cjs.a.error(_colors2.default.green(`Successfully enriched request: ${T}${n}`)),!0}catch(e){if(typeof e.response.body=="string"&&e.response.body.includes("Cannot update a resolved RequestEnricher"))return _chunkZUNVPK23cjs.a.warn(_colors2.default.magenta(`Skipped enrichment for request: ${T}${n}, request is no longer in the enriching phase.`)),!1;throw _chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to enricher identifiers for request with id: ${T}${n} - ${e.message} - ${e.response.body}`)),e}}async function ge({file:u,auth:s,sombraAuth:g,enricherId:f,markSilent:p,concurrency:n=100,transcendUrl:o=_chunkFZTNEEMWcjs.r}){let e=await _chunkVWGA62SGcjs.yc.call(void 0, o,s,g),d=_chunkVWGA62SGcjs.xc.call(void 0, o,s);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${u}" from disk`));let i=_chunkVWGA62SGcjs.sc.call(void 0, u,F);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Enriching "${i.length}" privacy requests.`));let l=0,a=0,t=0;if(await _bluebird.map.call(void 0, i,async(c,w)=>{try{p&&(await _chunkVWGA62SGcjs.ug.call(void 0, d,_chunkVWGA62SGcjs.Z,{input:{id:c.id,isSilent:!0}}),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Mark request as silent mode - ${c.id}`))),await M(e,c,f,w)?l+=1:a+=1}catch (e2){t+=1}},{concurrency:n}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully notified Transcend!
2
- Success count: ${l}.`)),a>0&&_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Skipped count: ${a}.`)),t>0)throw _chunkZUNVPK23cjs.a.info(_colors2.default.red(`Error Count: ${t}.`)),new Error(`Failed to enrich: ${t} requests.`);return i.length}exports.a = te; exports.b = F; exports.c = M; exports.d = ge;
3
- //# sourceMappingURL=chunk-J7BM4Z6U.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-J7BM4Z6U.cjs","../src/lib/manual-enrichment/pullManualEnrichmentIdentifiersToCsv.ts","../src/lib/manual-enrichment/pushManualEnrichmentIdentifiersFromCsv.ts"],"names":["pullManualEnrichmentIdentifiersToCsv","file","auth","sombraAuth","requestActions","concurrency","transcendUrl","DEFAULT_TRANSCEND_API","client","buildTranscendGraphQLClient","sombra","createSombraGotInstance","logger","colors"],"mappings":"AAAA,mfAAgH,wDAAyC,wDAAuD,2DCAnK,oCACzB,gFACD,MA6BnB,SAAsBA,EAAAA,CAAqC,CACzD,IAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CAAiB,CAAC,CAAA,CAClB,WAAA,CAAAC,CAAAA,CAAc,GAAA,CACd,YAAA,CAAAC,CAAAA,CAAeC,mBACjB,CAAA,CAa6C,CAE3C,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BH,CAAcJ,CAAI,CAAA,CACvDQ,CAAAA,CAAS,MAAMC,kCAAAA,CAAwBL,CAAcJ,CAAAA,CAAMC,CAAU,CAAA,CAE3ES,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,OAAA,CACL,CAAA,0DAAA,EAA6DT,CAAAA,CAAe,IAAA,CAC1E,GACF,CAAC,CAAA,CAAA;ACuDP,gBAAA","file":"/home/runner/work/cli/cli/dist/chunk-J7BM4Z6U.cjs","sourcesContent":[null,"import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport { map } from 'bluebird';\nimport colors from 'colors';\nimport { groupBy, uniq } from 'lodash-es';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport { writeCsv } from '../helpers/writeCsv';\nimport {\n PrivacyRequest,\n RequestEnricher,\n RequestIdentifier,\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllRequestEnrichers,\n fetchAllRequestIdentifiers,\n fetchAllRequests,\n} from '../graphql';\nimport { logger } from '../../logger';\n\nexport interface PrivacyRequestWithIdentifiers extends PrivacyRequest {\n /** Request Enrichers */\n requestEnrichers: RequestEnricher[];\n /** Request Identifiers */\n requestIdentifiers: RequestIdentifier[];\n}\n\n/**\n * Pull the set of manual enrichment jobs to CSV\n *\n * @param options - Options\n * @returns List of requests with identifiers\n */\nexport async function pullManualEnrichmentIdentifiersToCsv({\n file,\n auth,\n sombraAuth,\n requestActions = [],\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key */\n sombraAuth?: string;\n /** Concurrency */\n concurrency?: number;\n /** The request actions to fetch */\n requestActions?: RequestAction[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<PrivacyRequestWithIdentifiers[]> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const sombra = await createSombraGotInstance(transcendUrl, auth, sombraAuth);\n\n logger.info(\n colors.magenta(\n `Pulling manual enrichment requests, filtered for actions: ${requestActions.join(\n ',',\n )}`,\n ),\n );\n\n // Pull all privacy requests\n const allRequests = await fetchAllRequests(client, {\n actions: requestActions,\n statuses: [RequestStatus.Enriching],\n });\n\n // Requests to save\n const savedRequests: PrivacyRequestWithIdentifiers[] = [];\n\n // Filter down requests to what is needed\n await map(\n allRequests,\n async (request) => {\n // Fetch enrichers\n const requestEnrichers = await fetchAllRequestEnrichers(client, {\n requestId: request.id,\n });\n\n // Check if manual enrichment exists for that request\n const hasManualEnrichment = requestEnrichers.filter(\n ({ status }) => status === 'ACTION_REQUIRED',\n );\n\n // Save request to queue\n if (hasManualEnrichment) {\n const requestIdentifiers = await fetchAllRequestIdentifiers(\n client,\n sombra,\n {\n requestId: request.id,\n },\n );\n savedRequests.push({\n ...request,\n requestIdentifiers,\n requestEnrichers,\n });\n }\n },\n {\n concurrency,\n },\n );\n\n const data = savedRequests.map(\n ({\n attributeValues,\n requestIdentifiers,\n requestEnrichers, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...request\n }) => ({\n ...request,\n // flatten identifiers\n ...Object.entries(groupBy(requestIdentifiers, 'name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ value }) => value).join(','),\n }),\n {},\n ),\n // flatten attributes\n ...Object.entries(groupBy(attributeValues, 'attributeKey.name')).reduce(\n (acc, [key, values]) =>\n Object.assign(acc, {\n [key]: values.map(({ name }) => name).join(','),\n }),\n {},\n ),\n }),\n );\n\n // Write out to CSV\n const headers = uniq(data.map((d) => Object.keys(d)).flat());\n await writeCsv(file, data, headers);\n\n logger.info(\n colors.green(\n `Successfully wrote ${savedRequests.length} requests to file \"${file}\"`,\n ),\n );\n\n return savedRequests;\n}\n","import colors from 'colors';\nimport { map } from 'bluebird';\nimport { logger } from '../../logger';\nimport {\n UPDATE_PRIVACY_REQUEST,\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n makeGraphQLRequest,\n} from '../graphql';\nimport {\n enrichPrivacyRequest,\n EnrichPrivacyRequest,\n} from './enrichPrivacyRequest';\nimport { readCsv } from '../requests';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\n/**\n * Push a CSV of enriched requests back into Transcend\n *\n * @param options - Options\n * @returns Number of items processed\n */\nexport async function pushManualEnrichmentIdentifiersFromCsv({\n file,\n auth,\n sombraAuth,\n enricherId,\n markSilent,\n concurrency = 100,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** ID of enricher being uploaded to */\n enricherId: string;\n /** Sombra API key authentication */\n sombraAuth?: string;\n /** Concurrency */\n concurrency?: number;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Mark requests in silent mode before enriching */\n markSilent?: boolean;\n}): Promise<number> {\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, sombraAuth);\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const activeResults = readCsv(file, EnrichPrivacyRequest);\n\n // Notify Transcend\n logger.info(\n colors.magenta(`Enriching \"${activeResults.length}\" privacy requests.`),\n );\n\n let successCount = 0;\n let skippedCount = 0;\n let errorCount = 0;\n\n await map(\n activeResults,\n async (request, index) => {\n try {\n // Mark requests in silent mode before a certain date\n if (markSilent) {\n await makeGraphQLRequest(client, UPDATE_PRIVACY_REQUEST, {\n input: {\n id: request.id,\n isSilent: true,\n },\n });\n\n logger.info(\n colors.magenta(`Mark request as silent mode - ${request.id}`),\n );\n }\n\n const result = await enrichPrivacyRequest(\n sombra,\n request,\n enricherId,\n index,\n );\n if (result) {\n successCount += 1;\n } else {\n skippedCount += 1;\n }\n } catch (err) {\n errorCount += 1;\n }\n },\n { concurrency },\n );\n\n logger.info(\n colors.green(\n `Successfully notified Transcend! \\n Success count: ${successCount}.`,\n ),\n );\n\n if (skippedCount > 0) {\n logger.info(colors.magenta(`Skipped count: ${skippedCount}.`));\n }\n\n if (errorCount > 0) {\n logger.info(colors.red(`Error Count: ${errorCount}.`));\n throw new Error(`Failed to enrich: ${errorCount} requests.`);\n }\n\n return activeResults.length;\n}\n"]}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkABKDAPPRcjs = require('./chunk-ABKDAPPR.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkFZTNEEMWcjs = require('./chunk-FZTNEEMW.cjs');var _bluebird = require('bluebird');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function H({email:r,password:a,scopes:f,apiKeyTitle:t,parentOrganizationId:o,deleteExistingApiKey:l=!0,createNewApiKey:I=!0,transcendUrl:x=_chunkFZTNEEMWcjs.r}){let s=await _chunkVWGA62SGcjs.wc.call(void 0, x,{});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Logging in using email and password."));let{roles:d,loginCookie:k}=await _chunkVWGA62SGcjs.Kd.call(void 0, s,{email:r,password:a});_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully logged in and found ${d.length} role${d.length===1?"":"s"}!`));let P=o?d.filter(e=>e.organization.id===o||e.organization.parentOrganizationId===o):d;s.setHeaders({Cookie:k});let m=[],c=[];return _chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Generating API keys with title: ${t}, scopes: ${f.join(",")}.`)),await _bluebird.mapSeries.call(void 0, P,async e=>{try{await _chunkVWGA62SGcjs.Ld.call(void 0, s,{roleId:e.id,email:r}),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Checking if API key already exists in organization "${e.organization.name}" with title: "${t}".`));let[g]=await _chunkVWGA62SGcjs.sd.call(void 0, s,[t]);if(g&&l)_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`Deleting existing API key in "${e.organization.name}" with title: "${t}".`)),await _chunkVWGA62SGcjs.Nd.call(void 0, s,g.id),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully deleted API key in "${e.organization.name}" with title: "${t}".`));else if(g)throw new Error(`API key already exists with title: "${t}"`);if(I){_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Creating API key in "${e.organization.name}" with title: "${t}".`));let{apiKey:K}=await _chunkVWGA62SGcjs.Md.call(void 0, s,{title:t,scopes:f});m.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:K}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully created API key in "${e.organization.name}" with title: "${t}".`))}else m.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:""})}catch(g){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to create API key in organization "${e.organization.name}"! - ${g.message}`)),c.push({organizationName:e.organization.name,organizationId:e.organization.id,error:g.message})}}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully created ${m.length} API key${m.length===1?"":"s"}`)),c.length>0&&_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to create ${c.length} API key${c.length===1?"":"s"}!`)),{errors:c,apiKeys:m}}var _typeutils = require('@transcend-io/type-utils');var _iots = require('io-ts'); var S = _interopRequireWildcard(_iots);var _fs = require('fs');function T(r){return r||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY")),process.exit(1)),_fs.existsSync.call(void 0, r)?_typeutils.decodeCodec.call(void 0, S.array(_chunkABKDAPPRcjs.ia),_fs.readFileSync.call(void 0, r,"utf-8")):r}function Z(r,a,f=!1){if(!_fs.existsSync.call(void 0, r))return[];let t=_fs.readdirSync.call(void 0, r).filter(o=>a?a.filter(l=>o.endsWith(l)).length:!0).filter(o=>o.indexOf(".")>0);return f?t.map(o=>o.replace(/\.[^/.]+$/,"")):t}var _path = require('path');function te(r){return _fs.readdirSync.call(void 0, r).filter(a=>_fs.statSync.call(void 0, _path.join.call(void 0, r,a)).isDirectory())}exports.a = H; exports.b = T; exports.c = Z; exports.d = te;
2
- //# sourceMappingURL=chunk-UHERPTMC.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-UHERPTMC.cjs","../src/lib/api-keys/generateCrossAccountApiKeys.ts"],"names":["generateCrossAccountApiKeys","email","password","scopes","apiKeyTitle","parentOrganizationId","deleteExistingApiKey","createNewApiKey","transcendUrl","DEFAULT_TRANSCEND_API","client","buildTranscendGraphQLClientGeneric","logger","colors","roles","loginCookie","loginUser","filteredRoles","role","results","errors","mapSeries","assumeRole","apiKeyWithTitle","fetchAllApiKeys","deleteApiKey","apiKey","createApiKey","err"],"mappings":"AAAA,mfAAyC,wDAAkF,wDAAyC,wDAAyC,oCCAnL,gFAUP,MAoBnB,SAAsBA,CAAAA,CAA4B,CAChD,KAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CAAuB,CAAA,CAAA,CACvB,eAAA,CAAAC,CAAAA,CAAkB,CAAA,CAAA,CAClB,YAAA,CAAAC,CAAAA,CAAeC,mBACjB,CAAA,CAsBG,CAED,IAAMC,CAAAA,CAAS,MAAMC,kCAAAA,CAAmCH,CAAc,CAAC,CAAC,CAAA,CAGxEI,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,sCAAsC,CAAC,CAAA,CAClE,GAAM,CAAE,KAAA,CAAAC,CAAAA,CAAO,WAAA,CAAAC,CAAY,CAAA,CAAI,MAAMC,kCAAAA,CAAUN,CAAQ,CAAE,KAAA,CAAAT,CAAAA,CAAO,QAAA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,CAAQ,IAAA,CAAK,CACX,gBAAA,CAAkBD,CAAAA,CAAK,YAAA,CAAa,IAAA,CACpC,cAAA,CAAgBA,CAAAA,CAAK,YAAA,CAAa,EAAA,CAClC,MAAA,CAAQ,EACV,CAAC,CAEL,CAAA,KAAA,CAASU,CAAAA,CAAK,CACZhB,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,0CAAA,EAA6CK,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,KAAA,EAAQU,CAAAA,CAAI,OAAO,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/chunk-UHERPTMC.cjs","sourcesContent":[null,"import { mapSeries } from 'bluebird';\nimport {\n buildTranscendGraphQLClientGeneric,\n loginUser,\n createApiKey,\n fetchAllApiKeys,\n deleteApiKey,\n assumeRole,\n} from '../graphql';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport colors from 'colors';\nimport { StoredApiKey } from '../../codecs';\nimport { logger } from '../../logger';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nexport interface ApiKeyGenerateError {\n /** Name of instance */\n organizationName: string;\n /** Error */\n error: string;\n /** Organization ID API key is for */\n organizationId: string;\n}\n\n/**\n * Generate API keys across multiple transcend accounts\n *\n * @param options - Options\n * @returns Number of API keys created\n */\nexport async function generateCrossAccountApiKeys({\n email,\n password,\n scopes,\n apiKeyTitle,\n parentOrganizationId,\n deleteExistingApiKey = true,\n createNewApiKey = true,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** Email address of user generating API keys */\n email: string;\n /** Password of user generating API keys */\n password: string;\n /** Filter for organizations that match this parent organization ID */\n parentOrganizationId?: string;\n /** Title of the API create to create */\n apiKeyTitle: string;\n /** Title of the API create to create */\n scopes: ScopeName[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** When true delete existing API keys with that title, if set to false an API key exists with that title, an error is thrown */\n deleteExistingApiKey?: boolean;\n /** When true, generate new API keys, otherwise only will delete past API keys */\n createNewApiKey?: boolean;\n}): Promise<{\n /** Successfully generated */\n apiKeys: StoredApiKey[];\n /** Error results */\n errors: ApiKeyGenerateError[];\n}> {\n // Create GraphQL client\n const client = await buildTranscendGraphQLClientGeneric(transcendUrl, {});\n\n // Login the user\n logger.info(colors.magenta('Logging in using email and password.'));\n const { roles, loginCookie } = await loginUser(client, { email, password });\n logger.info(\n colors.green(\n `Successfully logged in and found ${roles.length} role${\n roles.length === 1 ? '' : 's'\n }!`,\n ),\n );\n\n // Filter down by parentOrganizationId\n const filteredRoles = parentOrganizationId\n ? roles.filter(\n (role) =>\n role.organization.id === parentOrganizationId ||\n role.organization.parentOrganizationId === parentOrganizationId,\n )\n : roles;\n\n // Save cookie to call route subsequent times\n client.setHeaders({\n Cookie: loginCookie,\n });\n\n // Save the resulting API keys\n const results: StoredApiKey[] = [];\n const errors: ApiKeyGenerateError[] = [];\n\n // Generate API keys\n logger.info(\n colors.magenta(\n `Generating API keys with title: ${apiKeyTitle}, scopes: ${scopes.join(\n ',',\n )}.`,\n ),\n );\n\n // Map over each role\n await mapSeries(filteredRoles, async (role) => {\n try {\n // Log into the other instance\n await assumeRole(client, { roleId: role.id, email });\n\n // Grab API keys with that title\n logger.info(\n colors.magenta(\n `Checking if API key already exists in organization \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n\n // Delete existing API key\n const [apiKeyWithTitle] = await fetchAllApiKeys(client, [apiKeyTitle]);\n if (apiKeyWithTitle && deleteExistingApiKey) {\n logger.info(\n colors.yellow(\n `Deleting existing API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n await deleteApiKey(client, apiKeyWithTitle.id);\n logger.info(\n colors.green(\n `Successfully deleted API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else if (apiKeyWithTitle) {\n // throw error if one exists but not configured to delete\n throw new Error(`API key already exists with title: \"${apiKeyTitle}\"`);\n }\n\n // Create the API key\n if (createNewApiKey) {\n logger.info(\n colors.magenta(\n `Creating API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n const { apiKey } = await createApiKey(client, {\n title: apiKeyTitle,\n scopes,\n });\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey,\n });\n logger.info(\n colors.green(\n `Successfully created API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else {\n // Delete only\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey: '',\n });\n }\n } catch (err) {\n logger.error(\n colors.red(\n `Failed to create API key in organization \"${role.organization.name}\"! - ${err.message}`,\n ),\n );\n errors.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n error: err.message,\n });\n }\n });\n logger.info(\n colors.green(\n `Successfully created ${results.length} API key${\n results.length === 1 ? '' : 's'\n }`,\n ),\n );\n\n if (errors.length > 0) {\n logger.error(\n colors.red(\n `Failed to create ${errors.length} API key${\n errors.length === 1 ? '' : 's'\n }!`,\n ),\n );\n }\n\n return { errors, apiKeys: results };\n}\n"]}