@transcend-io/cli 8.1.7 → 8.1.8

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 (110) hide show
  1. package/README.md +5 -2
  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-NSZ2MJKX.cjs → chunk-22FMPHOU.cjs} +2 -2
  6. package/dist/{chunk-NSZ2MJKX.cjs.map → chunk-22FMPHOU.cjs.map} +1 -1
  7. package/dist/{chunk-BC4TRKYT.cjs → chunk-2CCKVEWS.cjs} +2 -2
  8. package/dist/{chunk-BC4TRKYT.cjs.map → chunk-2CCKVEWS.cjs.map} +1 -1
  9. package/dist/{chunk-SR64CZV3.cjs → chunk-6LMZMYBN.cjs} +2 -2
  10. package/dist/{chunk-SR64CZV3.cjs.map → chunk-6LMZMYBN.cjs.map} +1 -1
  11. package/dist/{chunk-X5CKWMKP.cjs → chunk-FK7EPQ7K.cjs} +2 -2
  12. package/dist/{chunk-X5CKWMKP.cjs.map → chunk-FK7EPQ7K.cjs.map} +1 -1
  13. package/dist/{chunk-LD6JDYD6.cjs → chunk-IXOC4S5L.cjs} +3 -3
  14. package/dist/{chunk-LD6JDYD6.cjs.map → chunk-IXOC4S5L.cjs.map} +1 -1
  15. package/dist/{chunk-54CJVBSO.cjs → chunk-K45V7WKN.cjs} +2 -2
  16. package/dist/{chunk-54CJVBSO.cjs.map → chunk-K45V7WKN.cjs.map} +1 -1
  17. package/dist/{chunk-5FRRIGVX.cjs → chunk-L3GIP73U.cjs} +20 -20
  18. package/dist/{chunk-5FRRIGVX.cjs.map → chunk-L3GIP73U.cjs.map} +1 -1
  19. package/dist/{chunk-IAZXK7V6.cjs → chunk-TXG7TJLK.cjs} +2 -2
  20. package/dist/{chunk-IAZXK7V6.cjs.map → chunk-TXG7TJLK.cjs.map} +1 -1
  21. package/dist/{chunk-NBN4WQAR.cjs → chunk-UTU4F57H.cjs} +4 -4
  22. package/dist/{chunk-NBN4WQAR.cjs.map → chunk-UTU4F57H.cjs.map} +1 -1
  23. package/dist/{chunk-NYWGNV2B.cjs → chunk-VWFYPZ4Q.cjs} +2 -2
  24. package/dist/{chunk-NYWGNV2B.cjs.map → chunk-VWFYPZ4Q.cjs.map} +1 -1
  25. package/dist/{chunk-43ZI3DHB.cjs → chunk-WI7C7KDM.cjs} +2 -2
  26. package/dist/{chunk-43ZI3DHB.cjs.map → chunk-WI7C7KDM.cjs.map} +1 -1
  27. package/dist/{chunk-GHM266IT.cjs → chunk-XCTTKA6C.cjs} +4 -4
  28. package/dist/{chunk-GHM266IT.cjs.map → chunk-XCTTKA6C.cjs.map} +1 -1
  29. package/dist/{impl-QIZVMBZZ.cjs → impl-24WF6BP2.cjs} +2 -2
  30. package/dist/{impl-QIZVMBZZ.cjs.map → impl-24WF6BP2.cjs.map} +1 -1
  31. package/dist/{impl-4BTKHZWQ.cjs → impl-2YFKUYD6.cjs} +2 -2
  32. package/dist/{impl-4BTKHZWQ.cjs.map → impl-2YFKUYD6.cjs.map} +1 -1
  33. package/dist/{impl-ISWQGD2H.cjs → impl-57VL3VKK.cjs} +2 -2
  34. package/dist/{impl-ISWQGD2H.cjs.map → impl-57VL3VKK.cjs.map} +1 -1
  35. package/dist/{impl-L3AVZ2FV.cjs → impl-6RCILBC5.cjs} +2 -2
  36. package/dist/{impl-L3AVZ2FV.cjs.map → impl-6RCILBC5.cjs.map} +1 -1
  37. package/dist/{impl-GCBMVYAB.cjs → impl-76RWHLA4.cjs} +2 -2
  38. package/dist/{impl-GCBMVYAB.cjs.map → impl-76RWHLA4.cjs.map} +1 -1
  39. package/dist/{impl-CUH6LSTU.cjs → impl-AA2S5XWZ.cjs} +2 -2
  40. package/dist/{impl-CUH6LSTU.cjs.map → impl-AA2S5XWZ.cjs.map} +1 -1
  41. package/dist/{impl-UNRZALEP.cjs → impl-AYAPFSK5.cjs} +2 -2
  42. package/dist/{impl-UNRZALEP.cjs.map → impl-AYAPFSK5.cjs.map} +1 -1
  43. package/dist/{impl-YKVQPUKP.cjs → impl-DBWCR5EV.cjs} +2 -2
  44. package/dist/{impl-YKVQPUKP.cjs.map → impl-DBWCR5EV.cjs.map} +1 -1
  45. package/dist/{impl-KIRRQQL3.cjs → impl-DOPOJXH2.cjs} +2 -2
  46. package/dist/{impl-KIRRQQL3.cjs.map → impl-DOPOJXH2.cjs.map} +1 -1
  47. package/dist/{impl-OXDUMKRZ.cjs → impl-FXYNZQL3.cjs} +2 -2
  48. package/dist/{impl-OXDUMKRZ.cjs.map → impl-FXYNZQL3.cjs.map} +1 -1
  49. package/dist/{impl-EUV2IN26.cjs → impl-GZ2ZIYWN.cjs} +2 -2
  50. package/dist/{impl-EUV2IN26.cjs.map → impl-GZ2ZIYWN.cjs.map} +1 -1
  51. package/dist/{impl-PYAG6UGW.cjs → impl-IP7IRDK3.cjs} +2 -2
  52. package/dist/{impl-PYAG6UGW.cjs.map → impl-IP7IRDK3.cjs.map} +1 -1
  53. package/dist/{impl-FMXAHGI6.cjs → impl-JLVAP3PH.cjs} +2 -2
  54. package/dist/{impl-FMXAHGI6.cjs.map → impl-JLVAP3PH.cjs.map} +1 -1
  55. package/dist/{impl-XYCZDR3W.cjs → impl-KFML3O7R.cjs} +2 -2
  56. package/dist/{impl-XYCZDR3W.cjs.map → impl-KFML3O7R.cjs.map} +1 -1
  57. package/dist/{impl-WTXLBBJA.cjs → impl-KZATCJTP.cjs} +6 -6
  58. package/dist/{impl-WTXLBBJA.cjs.map → impl-KZATCJTP.cjs.map} +1 -1
  59. package/dist/{impl-U7FM7ZP2.cjs → impl-MCCYBIUO.cjs} +2 -2
  60. package/dist/{impl-U7FM7ZP2.cjs.map → impl-MCCYBIUO.cjs.map} +1 -1
  61. package/dist/{impl-Z4VDHQE5.cjs → impl-MKEVOXWE.cjs} +2 -2
  62. package/dist/{impl-Z4VDHQE5.cjs.map → impl-MKEVOXWE.cjs.map} +1 -1
  63. package/dist/{impl-QNKRUF6I.cjs → impl-N24QF4DA.cjs} +5 -5
  64. package/dist/{impl-QNKRUF6I.cjs.map → impl-N24QF4DA.cjs.map} +1 -1
  65. package/dist/{impl-JH4CD23Q.cjs → impl-NCKHD5HN.cjs} +3 -3
  66. package/dist/{impl-JH4CD23Q.cjs.map → impl-NCKHD5HN.cjs.map} +1 -1
  67. package/dist/{impl-KOJDDUTL.cjs → impl-NFM4JZLR.cjs} +2 -2
  68. package/dist/{impl-KOJDDUTL.cjs.map → impl-NFM4JZLR.cjs.map} +1 -1
  69. package/dist/{impl-N4YX2RP6.cjs → impl-NNT5EBMK.cjs} +2 -2
  70. package/dist/{impl-N4YX2RP6.cjs.map → impl-NNT5EBMK.cjs.map} +1 -1
  71. package/dist/{impl-M5A6TUSN.cjs → impl-NPNBU4L2.cjs} +2 -2
  72. package/dist/{impl-M5A6TUSN.cjs.map → impl-NPNBU4L2.cjs.map} +1 -1
  73. package/dist/{impl-HKPYOLVB.cjs → impl-PFPN37IX.cjs} +2 -2
  74. package/dist/{impl-HKPYOLVB.cjs.map → impl-PFPN37IX.cjs.map} +1 -1
  75. package/dist/{impl-V3WISYYM.cjs → impl-PZBN6XCO.cjs} +2 -2
  76. package/dist/{impl-V3WISYYM.cjs.map → impl-PZBN6XCO.cjs.map} +1 -1
  77. package/dist/{impl-EOFCKDNY.cjs → impl-QK22H5S4.cjs} +2 -2
  78. package/dist/{impl-EOFCKDNY.cjs.map → impl-QK22H5S4.cjs.map} +1 -1
  79. package/dist/{impl-ZUPAQOEC.cjs → impl-QTO2EWMC.cjs} +2 -2
  80. package/dist/{impl-ZUPAQOEC.cjs.map → impl-QTO2EWMC.cjs.map} +1 -1
  81. package/dist/{impl-CSWMPWOS.cjs → impl-RCSSVIJF.cjs} +2 -2
  82. package/dist/{impl-CSWMPWOS.cjs.map → impl-RCSSVIJF.cjs.map} +1 -1
  83. package/dist/{impl-S7ZTKQXD.cjs → impl-RD2RWVVR.cjs} +2 -2
  84. package/dist/{impl-S7ZTKQXD.cjs.map → impl-RD2RWVVR.cjs.map} +1 -1
  85. package/dist/{impl-YUOKSS5F.cjs → impl-RDXUUMXQ.cjs} +2 -2
  86. package/dist/{impl-YUOKSS5F.cjs.map → impl-RDXUUMXQ.cjs.map} +1 -1
  87. package/dist/{impl-LSJ3XG7R.cjs → impl-RM5WL2FX.cjs} +2 -2
  88. package/dist/{impl-LSJ3XG7R.cjs.map → impl-RM5WL2FX.cjs.map} +1 -1
  89. package/dist/{impl-WS7EKXI2.cjs → impl-RSPCWV5C.cjs} +2 -2
  90. package/dist/{impl-WS7EKXI2.cjs.map → impl-RSPCWV5C.cjs.map} +1 -1
  91. package/dist/{impl-YWHK5MBZ.cjs → impl-SXGH7WAQ.cjs} +2 -2
  92. package/dist/{impl-YWHK5MBZ.cjs.map → impl-SXGH7WAQ.cjs.map} +1 -1
  93. package/dist/{impl-O2EQ7N63.cjs → impl-T2FIEZLI.cjs} +2 -2
  94. package/dist/{impl-O2EQ7N63.cjs.map → impl-T2FIEZLI.cjs.map} +1 -1
  95. package/dist/{impl-SSG2M6UC.cjs → impl-T3XZ5262.cjs} +2 -2
  96. package/dist/{impl-SSG2M6UC.cjs.map → impl-T3XZ5262.cjs.map} +1 -1
  97. package/dist/{impl-77V3PSE5.cjs → impl-U67PZO2U.cjs} +5 -5
  98. package/dist/{impl-77V3PSE5.cjs.map → impl-U67PZO2U.cjs.map} +1 -1
  99. package/dist/{impl-RJO7YW2C.cjs → impl-VRKVDMBB.cjs} +3 -3
  100. package/dist/{impl-RJO7YW2C.cjs.map → impl-VRKVDMBB.cjs.map} +1 -1
  101. package/dist/{impl-HQ3FNU66.cjs → impl-XGKSU4NG.cjs} +2 -2
  102. package/dist/{impl-HQ3FNU66.cjs.map → impl-XGKSU4NG.cjs.map} +1 -1
  103. package/dist/impl-XN2JRARB.cjs +2 -0
  104. package/dist/{impl-FYCAJPHI.cjs.map → impl-XN2JRARB.cjs.map} +1 -1
  105. package/dist/{impl-F7IPT4GV.cjs → impl-YI6MEGDR.cjs} +4 -4
  106. package/dist/{impl-F7IPT4GV.cjs.map → impl-YI6MEGDR.cjs.map} +1 -1
  107. package/dist/index.cjs +3 -3
  108. package/dist/index.d.cts +1 -1
  109. package/package.json +1 -1
  110. package/dist/impl-FYCAJPHI.cjs +0 -2
package/README.md CHANGED
@@ -1210,7 +1210,8 @@ FLAGS
1210
1210
  ```sh
1211
1211
  transcend request system skip-request-data-silos \
1212
1212
  --auth="$TRANSCEND_API_KEY" \
1213
- --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f
1213
+ --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f \
1214
+ --statuses=COMPILING,SECONDARY
1214
1215
  ```
1215
1216
 
1216
1217
  **Specifying the backend URL, needed for US hosted backend infrastructure**
@@ -1219,7 +1220,8 @@ transcend request system skip-request-data-silos \
1219
1220
  transcend request system skip-request-data-silos \
1220
1221
  --auth="$TRANSCEND_API_KEY" \
1221
1222
  --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f \
1222
- --transcendUrl=https://api.us.transcend.io
1223
+ --transcendUrl=https://api.us.transcend.io \
1224
+ --statuses=COMPILING,SECONDARY
1223
1225
  ```
1224
1226
 
1225
1227
  **Only mark as completed requests in "removing data" phase**
@@ -1237,6 +1239,7 @@ transcend request system skip-request-data-silos \
1237
1239
  transcend request system skip-request-data-silos \
1238
1240
  --auth="$TRANSCEND_API_KEY" \
1239
1241
  --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f \
1242
+ --statuses=COMPILING,SECONDARY \
1240
1243
  --status=RESOLVED
1241
1244
  ```
1242
1245
 
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- "use strict"; 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 _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunk5FRRIGVXcjs = require('../chunk-5FRRIGVX.cjs');require('../chunk-NSZ2MJKX.cjs');require('../chunk-43ZI3DHB.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');async function e(){let o=process.argv.slice(3);_optionalChain([process, 'access', _ => _.env, 'access', _2 => _2.COMP_LINE, 'optionalAccess', _3 => _3.endsWith, 'call', _4 => _4(" ")])&&o.push(""),await _core.proposeCompletions.call(void 0, _chunk5FRRIGVXcjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process));try{for(let{completion:r}of await _core.proposeCompletions.call(void 0, _chunk5FRRIGVXcjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process)))process.stdout.write(`${r}
2
+ "use strict"; 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 _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunkL3GIP73Ucjs = require('../chunk-L3GIP73U.cjs');require('../chunk-22FMPHOU.cjs');require('../chunk-WI7C7KDM.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');async function e(){let o=process.argv.slice(3);_optionalChain([process, 'access', _ => _.env, 'access', _2 => _2.COMP_LINE, 'optionalAccess', _3 => _3.endsWith, 'call', _4 => _4(" ")])&&o.push(""),await _core.proposeCompletions.call(void 0, _chunkL3GIP73Ucjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process));try{for(let{completion:r}of await _core.proposeCompletions.call(void 0, _chunkL3GIP73Ucjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process)))process.stdout.write(`${r}
3
3
  `)}catch (e2){}}e();
4
4
  //# sourceMappingURL=bash-complete.cjs.map
package/dist/bin/cli.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunk5FRRIGVXcjs = require('../chunk-5FRRIGVX.cjs');require('../chunk-NSZ2MJKX.cjs');require('../chunk-43ZI3DHB.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');async function n(){await _core.run.call(void 0, _chunk5FRRIGVXcjs.a,process.argv.slice(2),_chunkT462ONFXcjs.a.call(void 0, process))}n();
2
+ "use strict";var _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunkL3GIP73Ucjs = require('../chunk-L3GIP73U.cjs');require('../chunk-22FMPHOU.cjs');require('../chunk-WI7C7KDM.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');async function n(){await _core.run.call(void 0, _chunkL3GIP73Ucjs.a,process.argv.slice(2),_chunkT462ONFXcjs.a.call(void 0, process))}n();
3
3
  //# sourceMappingURL=cli.cjs.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- "use strict"; 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 _chunk5FRRIGVXcjs = require('../chunk-5FRRIGVX.cjs');require('../chunk-NSZ2MJKX.cjs');var _chunkZUNVPK23cjs = require('../chunk-ZUNVPK23.cjs');require('../chunk-43ZI3DHB.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');var o={"tr-build-xdi-sync-endpoint":["consent","build-xdi-sync-endpoint"],"tr-consent-manager-service-json-to-yml":["inventory","consent-manager-service-json-to-yml"],"tr-consent-managers-to-business-entities":["inventory","consent-managers-to-business-entities"],"tr-cron-mark-identifiers-completed":["request","cron","mark-identifiers-completed"],"tr-cron-pull-identifiers":["request","cron","pull-identifiers"],"tr-derive-data-silos-from-data-flows":["inventory","derive-data-silos-from-data-flows"],"tr-derive-data-silos-from-data-flows-cross-instance":["inventory","derive-data-silos-from-data-flows-cross-instance"],"tr-discover-silos":["inventory","discover-silos"],"tr-generate-api-keys":["admin","generate-api-keys"],"tr-manual-enrichment-pull-identifiers":["request","preflight","pull-identifiers"],"tr-manual-enrichment-push-identifiers":["request","preflight","push-identifiers"],"tr-mark-request-data-silos-completed":["request","system","mark-request-data-silos-completed"],"tr-pull":["inventory","pull"],"tr-pull-consent-metrics":["consent","pull-consent-metrics"],"tr-pull-consent-preferences":["consent","pull-consent-preferences"],"tr-pull-datapoints":["inventory","pull-datapoints"],"tr-pull-pull-unstructured-discovery-files":["inventory","pull-unstructured-discovery-files"],"tr-push":["inventory","push"],"tr-request-approve":["request","approve"],"tr-request-cancel":["request","cancel"],"tr-request-download-files":["request","download-files"],"tr-request-enricher-restart":["request","enricher-restart"],"tr-request-export":["request","export"],"tr-request-mark-silent":["request","mark-silent"],"tr-request-notify-additional-time":["request","notify-additional-time"],"tr-request-reject-unverified-identifiers":["request","reject-unverified-identifiers"],"tr-request-restart":["request","restart"],"tr-request-upload":["request","upload"],"tr-retry-request-data-silos":["request","system","retry-request-data-silos"],"tr-scan-packages":["inventory","scan-packages"],"tr-skip-preflight-jobs":["request","skip-preflight-jobs"],"tr-skip-request-data-silos":["request","system","skip-request-data-silos"],"tr-sync-ot":["migration","sync-ot"],"tr-update-consent-manager":["consent","update-consent-manager"],"tr-upload-consent-preferences":["consent","upload-consent-preferences"],"tr-upload-cookies-from-csv":["consent","upload-cookies-from-csv"],"tr-upload-data-flows-from-csv":["consent","upload-data-flows-from-csv"],"tr-upload-preferences":["consent","upload-preferences"]};function p(t){return _optionalChain([_core.generateHelpTextForAllCommands.call(void 0, _chunk5FRRIGVXcjs.a), 'access', _ => _.find, 'call', _2 => _2(s=>s[0]===`${_chunk5FRRIGVXcjs.a.config.name} ${t.join(" ")}`), 'optionalAccess', _3 => _3[1]])}function i(t){_chunkZUNVPK23cjs.a.log("[DEPRECATION NOTICE]");let e=o[t];if(!e){let a=Object.entries(o).map(([l,d])=>`\`${l}\` -> \`${_chunk5FRRIGVXcjs.a.config.name} ${d.join(" ")}\``).join(`
2
+ "use strict"; 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 _chunkL3GIP73Ucjs = require('../chunk-L3GIP73U.cjs');require('../chunk-22FMPHOU.cjs');var _chunkZUNVPK23cjs = require('../chunk-ZUNVPK23.cjs');require('../chunk-WI7C7KDM.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');var o={"tr-build-xdi-sync-endpoint":["consent","build-xdi-sync-endpoint"],"tr-consent-manager-service-json-to-yml":["inventory","consent-manager-service-json-to-yml"],"tr-consent-managers-to-business-entities":["inventory","consent-managers-to-business-entities"],"tr-cron-mark-identifiers-completed":["request","cron","mark-identifiers-completed"],"tr-cron-pull-identifiers":["request","cron","pull-identifiers"],"tr-derive-data-silos-from-data-flows":["inventory","derive-data-silos-from-data-flows"],"tr-derive-data-silos-from-data-flows-cross-instance":["inventory","derive-data-silos-from-data-flows-cross-instance"],"tr-discover-silos":["inventory","discover-silos"],"tr-generate-api-keys":["admin","generate-api-keys"],"tr-manual-enrichment-pull-identifiers":["request","preflight","pull-identifiers"],"tr-manual-enrichment-push-identifiers":["request","preflight","push-identifiers"],"tr-mark-request-data-silos-completed":["request","system","mark-request-data-silos-completed"],"tr-pull":["inventory","pull"],"tr-pull-consent-metrics":["consent","pull-consent-metrics"],"tr-pull-consent-preferences":["consent","pull-consent-preferences"],"tr-pull-datapoints":["inventory","pull-datapoints"],"tr-pull-pull-unstructured-discovery-files":["inventory","pull-unstructured-discovery-files"],"tr-push":["inventory","push"],"tr-request-approve":["request","approve"],"tr-request-cancel":["request","cancel"],"tr-request-download-files":["request","download-files"],"tr-request-enricher-restart":["request","enricher-restart"],"tr-request-export":["request","export"],"tr-request-mark-silent":["request","mark-silent"],"tr-request-notify-additional-time":["request","notify-additional-time"],"tr-request-reject-unverified-identifiers":["request","reject-unverified-identifiers"],"tr-request-restart":["request","restart"],"tr-request-upload":["request","upload"],"tr-retry-request-data-silos":["request","system","retry-request-data-silos"],"tr-scan-packages":["inventory","scan-packages"],"tr-skip-preflight-jobs":["request","skip-preflight-jobs"],"tr-skip-request-data-silos":["request","system","skip-request-data-silos"],"tr-sync-ot":["migration","sync-ot"],"tr-update-consent-manager":["consent","update-consent-manager"],"tr-upload-consent-preferences":["consent","upload-consent-preferences"],"tr-upload-cookies-from-csv":["consent","upload-cookies-from-csv"],"tr-upload-data-flows-from-csv":["consent","upload-data-flows-from-csv"],"tr-upload-preferences":["consent","upload-preferences"]};function p(t){return _optionalChain([_core.generateHelpTextForAllCommands.call(void 0, _chunkL3GIP73Ucjs.a), 'access', _ => _.find, 'call', _2 => _2(s=>s[0]===`${_chunkL3GIP73Ucjs.a.config.name} ${t.join(" ")}`), 'optionalAccess', _3 => _3[1]])}function i(t){_chunkZUNVPK23cjs.a.log("[DEPRECATION NOTICE]");let e=o[t];if(!e){let a=Object.entries(o).map(([l,d])=>`\`${l}\` -> \`${_chunkL3GIP73Ucjs.a.config.name} ${d.join(" ")}\``).join(`
3
3
  `);_chunkZUNVPK23cjs.a.log(`This command is deprecated as of v7.0.0. Here is a list of new commands, mapped to their legacy command names:
4
4
  ${a}`);return}_chunkZUNVPK23cjs.a.log(`\`${t}\` is deprecated as of v7.0.0.
5
- Use \`${_chunk5FRRIGVXcjs.a.config.name} ${e.join(" ")}\` instead.
5
+ Use \`${_chunkL3GIP73Ucjs.a.config.name} ${e.join(" ")}\` instead.
6
6
  `);let s=p(e);if(!s)throw new Error(`Failed to get help text for command: \`${e.join(" ")}\``);_chunkZUNVPK23cjs.a.log(s)}function m(){let e=_optionalChain([process, 'access', _4 => _4.argv, 'access', _5 => _5.at, 'call', _6 => _6(-1), 'optionalAccess', _7 => _7.split, 'call', _8 => _8("/"), 'access', _9 => _9.pop, 'call', _10 => _10(), 'optionalAccess', _11 => _11.trim, 'call', _12 => _12()]);if(e)i(e);else throw new Error("Deprecated command");process.exit(1)}m();
7
7
  //# sourceMappingURL=deprecated-command.cjs.map
@@ -1,4 +1,4 @@
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; } }var _chunk43ZI3DHBcjs = require('./chunk-43ZI3DHB.cjs');var _chunkQ7I37FJVcjs = require('./chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');var _privacytypes = require('@transcend-io/privacy-types');function h(e){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e))throw new Error(`Invalid UUID format: ${e}`);return e}function a(e){try{return new URL(e).toString().replace(/\/$/,"")}catch (e2){throw new Error(`Invalid URL format: ${e}`)}}function b(e){return e.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function T(e){let r=new Date(e);if(Number.isNaN(r.getTime()))throw new TypeError(`Invalid date: ${e}. Try using the ISO 8601 format (YYYY-MM-DDTHH:MM:SS.SSSZ)`);return r}var l=({scopes:e,requiresSiloScope:r=!1})=>{let t={kind:"parsed",parse:String,brief:"The Transcend API key."};return r&&(t.brief+=" This key must be associated with the data silo(s) being operated on."),e==="Varies"?{...t,brief:`${t.brief} The scopes required will vary depending on the operation performed. If in doubt, the ${_privacytypes.TRANSCEND_SCOPES[_privacytypes.ScopeName.FullAdmin].title} scope will always work.`}:e.length===0?{...t,brief:`${t.brief} No scopes are required for this command.`}:{...t,brief:`${t.brief} Requires scopes: ${e.map(p=>`"${_privacytypes.TRANSCEND_SCOPES[p].title}"`).join(", ")}`}},d= exports.e =(e=_chunk43ZI3DHBcjs.r)=>({kind:"parsed",parse:a,brief:"URL of the Transcend backend. Use https://api.us.transcend.io for US hosting",default:e}),A= exports.f =(e=_chunk43ZI3DHBcjs.s)=>({kind:"parsed",parse:a,brief:"URL of the Transcend consent backend. Use https://consent.us.transcend.io for US hosting",default:e}),U= exports.g =()=>({kind:"parsed",parse:String,brief:"The Sombra internal key, use for additional authentication when self-hosting Sombra",optional:!0});var g=["dataSilos","enrichers","templates","apiKeys"],N= exports.i =Object.values(_privacytypes.ConsentTrackerStatus),L= exports.j =_core.buildCommand.call(void 0, {loader:async()=>{let{pull:e}=await Promise.resolve().then(() => _interopRequireWildcard(require("./impl-JH4CD23Q.cjs")));return e},parameters:{flags:{auth:l({scopes:"Varies"}),resources:{kind:"enum",values:["all",...Object.values(_chunkQ7I37FJVcjs.d)],brief:`The different resource types to pull in. Defaults to ${g.join(",")}.`,variadic:",",optional:!0},file:{kind:"parsed",parse:String,brief:"Path to the YAML file to pull into",default:"./transcend.yml"},transcendUrl:d(),dataSiloIds:{kind:"parsed",parse:String,variadic:",",brief:"The UUIDs of the data silos that should be pulled into the YAML file",optional:!0},integrationNames:{kind:"parsed",parse:String,variadic:",",brief:"The types of integrations to pull down",optional:!0},trackerStatuses:{kind:"enum",values:Object.values(_privacytypes.ConsentTrackerStatus),variadic:",",brief:"The statuses of consent manager trackers to pull down. Defaults to all statuses.",optional:!0},pageSize:{kind:"parsed",parse:_core.numberParser,brief:"The page size to use when paginating over the API",default:"50"},skipDatapoints:{kind:"boolean",brief:"When true, skip pulling in datapoints alongside data silo resource",default:!1},skipSubDatapoints:{kind:"boolean",brief:"When true, skip pulling in subDatapoints alongside data silo resource",default:!1},includeGuessedCategories:{kind:"boolean",brief:"When true, included guessed data categories that came from the content classifier",default:!1},debug:{kind:"boolean",brief:"Set to true to include debug logs while pulling the configuration",default:!1}}},docs:{brief:"Pull metadata from Transcend into transcend.yml",fullDescription:`Generates a transcend.yml by pulling the configuration from your Transcend instance.
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; } }var _chunkWI7C7KDMcjs = require('./chunk-WI7C7KDM.cjs');var _chunkQ7I37FJVcjs = require('./chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');var _privacytypes = require('@transcend-io/privacy-types');function h(e){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e))throw new Error(`Invalid UUID format: ${e}`);return e}function a(e){try{return new URL(e).toString().replace(/\/$/,"")}catch (e2){throw new Error(`Invalid URL format: ${e}`)}}function b(e){return e.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function T(e){let r=new Date(e);if(Number.isNaN(r.getTime()))throw new TypeError(`Invalid date: ${e}. Try using the ISO 8601 format (YYYY-MM-DDTHH:MM:SS.SSSZ)`);return r}var l=({scopes:e,requiresSiloScope:r=!1})=>{let t={kind:"parsed",parse:String,brief:"The Transcend API key."};return r&&(t.brief+=" This key must be associated with the data silo(s) being operated on."),e==="Varies"?{...t,brief:`${t.brief} The scopes required will vary depending on the operation performed. If in doubt, the ${_privacytypes.TRANSCEND_SCOPES[_privacytypes.ScopeName.FullAdmin].title} scope will always work.`}:e.length===0?{...t,brief:`${t.brief} No scopes are required for this command.`}:{...t,brief:`${t.brief} Requires scopes: ${e.map(p=>`"${_privacytypes.TRANSCEND_SCOPES[p].title}"`).join(", ")}`}},d= exports.e =(e=_chunkWI7C7KDMcjs.r)=>({kind:"parsed",parse:a,brief:"URL of the Transcend backend. Use https://api.us.transcend.io for US hosting",default:e}),A= exports.f =(e=_chunkWI7C7KDMcjs.s)=>({kind:"parsed",parse:a,brief:"URL of the Transcend consent backend. Use https://consent.us.transcend.io for US hosting",default:e}),U= exports.g =()=>({kind:"parsed",parse:String,brief:"The Sombra internal key, use for additional authentication when self-hosting Sombra",optional:!0});var g=["dataSilos","enrichers","templates","apiKeys"],N= exports.i =Object.values(_privacytypes.ConsentTrackerStatus),L= exports.j =_core.buildCommand.call(void 0, {loader:async()=>{let{pull:e}=await Promise.resolve().then(() => _interopRequireWildcard(require("./impl-NCKHD5HN.cjs")));return e},parameters:{flags:{auth:l({scopes:"Varies"}),resources:{kind:"enum",values:["all",...Object.values(_chunkQ7I37FJVcjs.d)],brief:`The different resource types to pull in. Defaults to ${g.join(",")}.`,variadic:",",optional:!0},file:{kind:"parsed",parse:String,brief:"Path to the YAML file to pull into",default:"./transcend.yml"},transcendUrl:d(),dataSiloIds:{kind:"parsed",parse:String,variadic:",",brief:"The UUIDs of the data silos that should be pulled into the YAML file",optional:!0},integrationNames:{kind:"parsed",parse:String,variadic:",",brief:"The types of integrations to pull down",optional:!0},trackerStatuses:{kind:"enum",values:Object.values(_privacytypes.ConsentTrackerStatus),variadic:",",brief:"The statuses of consent manager trackers to pull down. Defaults to all statuses.",optional:!0},pageSize:{kind:"parsed",parse:_core.numberParser,brief:"The page size to use when paginating over the API",default:"50"},skipDatapoints:{kind:"boolean",brief:"When true, skip pulling in datapoints alongside data silo resource",default:!1},skipSubDatapoints:{kind:"boolean",brief:"When true, skip pulling in subDatapoints alongside data silo resource",default:!1},includeGuessedCategories:{kind:"boolean",brief:"When true, included guessed data categories that came from the content classifier",default:!1},debug:{kind:"boolean",brief:"Set to true to include debug logs while pulling the configuration",default:!1}}},docs:{brief:"Pull metadata from Transcend into transcend.yml",fullDescription:`Generates a transcend.yml by pulling the configuration from your Transcend instance.
2
2
 
3
3
  The API key needs various scopes depending on the resources being pulled (see the CLI's README for more details).
4
4
 
@@ -6,4 +6,4 @@ This command can be helpful if you are looking to:
6
6
 
7
7
  - Copy your data into another instance
8
8
  - Generate a transcend.yml file as a starting point to maintain parts of your data inventory in code.`}});exports.a = h; exports.b = b; exports.c = T; exports.d = l; exports.e = d; exports.f = A; exports.g = U; exports.h = g; exports.i = N; exports.j = L;
9
- //# sourceMappingURL=chunk-NSZ2MJKX.cjs.map
9
+ //# sourceMappingURL=chunk-22FMPHOU.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-NSZ2MJKX.cjs","../src/commands/inventory/pull/command.ts","../src/lib/cli/parsers.ts"],"names":["uuidParser","input"],"mappings":"AAAA,mZAA+C,wDAAyC,qCCA7C,2DACN,SCMrBA,CAAAA,CAAWC,CAAAA,CAAuB,CAGhD,EAAA,CAAI,CADF,4EAAA,CACa,IAAA,CAAKA,CAAK,CAAA,CACvB,MAAM,IAAI,KAAA,CAAM,CAAA,qBAAA,EAAwBA,CAAK,CAAA,CAAA;AD0F5B;AAAA;AAAA;AAAA;AAAA;AAAA;AASpB,qGAAA","file":"/home/runner/work/cli/cli/dist/chunk-NSZ2MJKX.cjs","sourcesContent":[null,"import { buildCommand, numberParser } from '@stricli/core';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { TranscendPullResource } from '../../../enums';\n\nexport const DEFAULT_TRANSCEND_PULL_RESOURCES = [\n TranscendPullResource.DataSilos,\n TranscendPullResource.Enrichers,\n TranscendPullResource.Templates,\n TranscendPullResource.ApiKeys,\n];\n\nexport const DEFAULT_CONSENT_TRACKER_STATUSES =\n Object.values(ConsentTrackerStatus);\n\nexport const pullCommand = buildCommand({\n loader: async () => {\n const { pull } = await import('./impl');\n return pull;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: 'Varies',\n }),\n resources: {\n kind: 'enum',\n values: ['all', ...Object.values(TranscendPullResource)],\n brief: `The different resource types to pull in. Defaults to ${DEFAULT_TRANSCEND_PULL_RESOURCES.join(\n ',',\n )}.`,\n variadic: ',',\n optional: true,\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the YAML file to pull into',\n default: './transcend.yml',\n },\n transcendUrl: createTranscendUrlParameter(),\n dataSiloIds: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief:\n 'The UUIDs of the data silos that should be pulled into the YAML file',\n optional: true,\n },\n integrationNames: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'The types of integrations to pull down',\n optional: true,\n },\n trackerStatuses: {\n kind: 'enum',\n values: Object.values(ConsentTrackerStatus),\n variadic: ',',\n brief:\n 'The statuses of consent manager trackers to pull down. Defaults to all statuses.',\n optional: true,\n },\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 skipDatapoints: {\n kind: 'boolean',\n brief:\n 'When true, skip pulling in datapoints alongside data silo resource',\n default: false,\n },\n skipSubDatapoints: {\n kind: 'boolean',\n brief:\n 'When true, skip pulling in subDatapoints alongside data silo resource',\n default: false,\n },\n includeGuessedCategories: {\n kind: 'boolean',\n brief:\n 'When true, included guessed data categories that came from the content classifier',\n default: false,\n },\n debug: {\n kind: 'boolean',\n brief:\n 'Set to true to include debug logs while pulling the configuration',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Pull metadata from Transcend into transcend.yml',\n fullDescription: `Generates a transcend.yml by pulling the configuration from your Transcend instance.\n\nThe API key needs various scopes depending on the resources being pulled (see the CLI's README for more details).\n\nThis command can be helpful if you are looking to:\n\n- Copy your data into another instance\n- Generate a transcend.yml file as a starting point to maintain parts of your data inventory in code.`,\n },\n});\n","/**\n * Validates and returns a UUID string.\n *\n * @param input - The input string to validate as UUID\n * @returns The validated UUID string\n * @throws Error if input is not a valid UUID\n */\nexport function uuidParser(input: string): string {\n const uuidRegex =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n if (!uuidRegex.test(input)) {\n throw new Error(`Invalid UUID format: ${input}`);\n }\n return input;\n}\n\n/**\n * Validates and returns a URL string.\n *\n * @param input - The input string to validate as URL\n * @returns The validated URL string\n * @throws Error if input is not a valid URL\n */\nexport function urlParser(input: string): string {\n try {\n const url = new URL(input);\n return url.toString().replace(/\\/$/, '');\n } catch {\n throw new Error(`Invalid URL format: ${input}`);\n }\n}\n\n/**\n * Parse a comma-separated string to array.\n * NOTE: Prefer using `variadic` for list arguments instead of this function. This should only be used for arguments which have a default value.\n *\n * @param input - The comma-separated string to parse\n * @returns Array of trimmed, non-empty strings\n */\nexport function arrayParser(input: string): string[] {\n return input\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0);\n}\n\n/**\n * Parse a date string to a Date object.\n *\n * @param input - The date string to parse\n * @returns The parsed Date object\n * @throws TypeError if input is not a valid date\n */\nexport function dateParser(input: string): Date {\n const date = new Date(input);\n if (Number.isNaN(date.getTime())) {\n throw new TypeError(\n `Invalid date: ${input}. Try using the ISO 8601 format (YYYY-MM-DDTHH:MM:SS.SSSZ)`,\n );\n }\n return date;\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-22FMPHOU.cjs","../src/commands/inventory/pull/command.ts","../src/lib/cli/parsers.ts"],"names":["uuidParser","input"],"mappings":"AAAA,mZAA+C,wDAAyC,qCCA7C,2DACN,SCMrBA,CAAAA,CAAWC,CAAAA,CAAuB,CAGhD,EAAA,CAAI,CADF,4EAAA,CACa,IAAA,CAAKA,CAAK,CAAA,CACvB,MAAM,IAAI,KAAA,CAAM,CAAA,qBAAA,EAAwBA,CAAK,CAAA,CAAA;AD0F5B;AAAA;AAAA;AAAA;AAAA;AAAA;AASpB,qGAAA","file":"/home/runner/work/cli/cli/dist/chunk-22FMPHOU.cjs","sourcesContent":[null,"import { buildCommand, numberParser } from '@stricli/core';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { TranscendPullResource } from '../../../enums';\n\nexport const DEFAULT_TRANSCEND_PULL_RESOURCES = [\n TranscendPullResource.DataSilos,\n TranscendPullResource.Enrichers,\n TranscendPullResource.Templates,\n TranscendPullResource.ApiKeys,\n];\n\nexport const DEFAULT_CONSENT_TRACKER_STATUSES =\n Object.values(ConsentTrackerStatus);\n\nexport const pullCommand = buildCommand({\n loader: async () => {\n const { pull } = await import('./impl');\n return pull;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: 'Varies',\n }),\n resources: {\n kind: 'enum',\n values: ['all', ...Object.values(TranscendPullResource)],\n brief: `The different resource types to pull in. Defaults to ${DEFAULT_TRANSCEND_PULL_RESOURCES.join(\n ',',\n )}.`,\n variadic: ',',\n optional: true,\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the YAML file to pull into',\n default: './transcend.yml',\n },\n transcendUrl: createTranscendUrlParameter(),\n dataSiloIds: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief:\n 'The UUIDs of the data silos that should be pulled into the YAML file',\n optional: true,\n },\n integrationNames: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'The types of integrations to pull down',\n optional: true,\n },\n trackerStatuses: {\n kind: 'enum',\n values: Object.values(ConsentTrackerStatus),\n variadic: ',',\n brief:\n 'The statuses of consent manager trackers to pull down. Defaults to all statuses.',\n optional: true,\n },\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 skipDatapoints: {\n kind: 'boolean',\n brief:\n 'When true, skip pulling in datapoints alongside data silo resource',\n default: false,\n },\n skipSubDatapoints: {\n kind: 'boolean',\n brief:\n 'When true, skip pulling in subDatapoints alongside data silo resource',\n default: false,\n },\n includeGuessedCategories: {\n kind: 'boolean',\n brief:\n 'When true, included guessed data categories that came from the content classifier',\n default: false,\n },\n debug: {\n kind: 'boolean',\n brief:\n 'Set to true to include debug logs while pulling the configuration',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Pull metadata from Transcend into transcend.yml',\n fullDescription: `Generates a transcend.yml by pulling the configuration from your Transcend instance.\n\nThe API key needs various scopes depending on the resources being pulled (see the CLI's README for more details).\n\nThis command can be helpful if you are looking to:\n\n- Copy your data into another instance\n- Generate a transcend.yml file as a starting point to maintain parts of your data inventory in code.`,\n },\n});\n","/**\n * Validates and returns a UUID string.\n *\n * @param input - The input string to validate as UUID\n * @returns The validated UUID string\n * @throws Error if input is not a valid UUID\n */\nexport function uuidParser(input: string): string {\n const uuidRegex =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n if (!uuidRegex.test(input)) {\n throw new Error(`Invalid UUID format: ${input}`);\n }\n return input;\n}\n\n/**\n * Validates and returns a URL string.\n *\n * @param input - The input string to validate as URL\n * @returns The validated URL string\n * @throws Error if input is not a valid URL\n */\nexport function urlParser(input: string): string {\n try {\n const url = new URL(input);\n return url.toString().replace(/\\/$/, '');\n } catch {\n throw new Error(`Invalid URL format: ${input}`);\n }\n}\n\n/**\n * Parse a comma-separated string to array.\n * NOTE: Prefer using `variadic` for list arguments instead of this function. This should only be used for arguments which have a default value.\n *\n * @param input - The comma-separated string to parse\n * @returns Array of trimmed, non-empty strings\n */\nexport function arrayParser(input: string): string[] {\n return input\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0);\n}\n\n/**\n * Parse a date string to a Date object.\n *\n * @param input - The date string to parse\n * @returns The parsed Date object\n * @throws TypeError if input is not a valid date\n */\nexport function dateParser(input: string): Date {\n const date = new Date(input);\n if (Number.isNaN(date.getTime())) {\n throw new TypeError(\n `Invalid date: ${input}. Try using the ISO 8601 format (YYYY-MM-DDTHH:MM:SS.SSSZ)`,\n );\n }\n return date;\n}\n"]}
@@ -1,3 +1,3 @@
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 _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunkNBN4WQARcjs = require('./chunk-NBN4WQAR.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunk43ZI3DHBcjs = require('./chunk-43ZI3DHB.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=_chunk43ZI3DHBcjs.r}){let o=_chunkNBN4WQARcjs.vc.call(void 0, n,s),e=await _chunkNBN4WQARcjs.wc.call(void 0, n,s,g);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling manual enrichment requests, filtered for actions: ${f.join(",")}`));let d=await _chunkNBN4WQARcjs.kd.call(void 0, o,{actions:f,statuses:[_privacytypes.RequestStatus.Enriching]}),i=[];await _bluebird.map.call(void 0, d,async t=>{let c=await _chunkNBN4WQARcjs.fd.call(void 0, o,{requestId:t.id});if(c.filter(({status:m})=>m==="ACTION_REQUIRED")){let m=await _chunkNBN4WQARcjs.id.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:I,...m})=>({...m,...Object.entries(_chunk43ZI3DHBcjs.d.call(void 0, c,"name")).reduce((w,[P,$])=>Object.assign(w,{[P]:$.map(({value:C})=>C).join(",")}),{}),...Object.entries(_chunk43ZI3DHBcjs.d.call(void 0, t,"attributeKey.name")).reduce((w,[P,$])=>Object.assign(w,{[P]:$.map(({name:C})=>C).join(",")}),{})})),a=_chunk43ZI3DHBcjs.j.call(void 0, l.map(t=>Object.keys(t)).flat());return _chunkLR3CPNDMcjs.c.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])=>_chunk43ZI3DHBcjs.j.call(void 0, _chunkNBN4WQARcjs.nc.call(void 0, i)).length===0?e:Object.assign(e,{[d]:_chunk43ZI3DHBcjs.j.call(void 0, _chunkNBN4WQARcjs.nc.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=_chunk43ZI3DHBcjs.r}){let e=await _chunkNBN4WQARcjs.wc.call(void 0, o,s,g),d=_chunkNBN4WQARcjs.vc.call(void 0, o,s);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${u}" from disk`));let i=_chunkNBN4WQARcjs.qc.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,I)=>{try{p&&(await _chunkNBN4WQARcjs._f.call(void 0, d,_chunkNBN4WQARcjs.Y,{input:{id:c.id,isSilent:!0}}),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Mark request as silent mode - ${c.id}`))),await M(e,c,f,I)?l+=1:a+=1}catch (e2){t+=1}},{concurrency:n}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully notified Transcend!
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 _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunkUTU4F57Hcjs = require('./chunk-UTU4F57H.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkWI7C7KDMcjs = require('./chunk-WI7C7KDM.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=_chunkWI7C7KDMcjs.r}){let o=_chunkUTU4F57Hcjs.vc.call(void 0, n,s),e=await _chunkUTU4F57Hcjs.wc.call(void 0, n,s,g);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling manual enrichment requests, filtered for actions: ${f.join(",")}`));let d=await _chunkUTU4F57Hcjs.kd.call(void 0, o,{actions:f,statuses:[_privacytypes.RequestStatus.Enriching]}),i=[];await _bluebird.map.call(void 0, d,async t=>{let c=await _chunkUTU4F57Hcjs.fd.call(void 0, o,{requestId:t.id});if(c.filter(({status:m})=>m==="ACTION_REQUIRED")){let m=await _chunkUTU4F57Hcjs.id.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:I,...m})=>({...m,...Object.entries(_chunkWI7C7KDMcjs.d.call(void 0, c,"name")).reduce((w,[P,$])=>Object.assign(w,{[P]:$.map(({value:C})=>C).join(",")}),{}),...Object.entries(_chunkWI7C7KDMcjs.d.call(void 0, t,"attributeKey.name")).reduce((w,[P,$])=>Object.assign(w,{[P]:$.map(({name:C})=>C).join(",")}),{})})),a=_chunkWI7C7KDMcjs.j.call(void 0, l.map(t=>Object.keys(t)).flat());return _chunkLR3CPNDMcjs.c.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])=>_chunkWI7C7KDMcjs.j.call(void 0, _chunkUTU4F57Hcjs.nc.call(void 0, i)).length===0?e:Object.assign(e,{[d]:_chunkWI7C7KDMcjs.j.call(void 0, _chunkUTU4F57Hcjs.nc.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=_chunkWI7C7KDMcjs.r}){let e=await _chunkUTU4F57Hcjs.wc.call(void 0, o,s,g),d=_chunkUTU4F57Hcjs.vc.call(void 0, o,s);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${u}" from disk`));let i=_chunkUTU4F57Hcjs.qc.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,I)=>{try{p&&(await _chunkUTU4F57Hcjs._f.call(void 0, d,_chunkUTU4F57Hcjs.Y,{input:{id:c.id,isSilent:!0}}),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Mark request as silent mode - ${c.id}`))),await M(e,c,f,I)?l+=1:a+=1}catch (e2){t+=1}},{concurrency:n}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully notified Transcend!
2
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-BC4TRKYT.cjs.map
3
+ //# sourceMappingURL=chunk-2CCKVEWS.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-BC4TRKYT.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,mfAAwC,wDAAyG,wDAAyC,wDAAuD,2DCApM,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-BC4TRKYT.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 '../cron/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 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
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-2CCKVEWS.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,mfAAwC,wDAAyG,wDAAyC,wDAAuD,2DCApM,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-2CCKVEWS.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 '../cron/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 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,4 +1,4 @@
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 _chunkIAZXK7V6cjs = require('./chunk-IAZXK7V6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _fs = require('fs');var _typeutils = require('@transcend-io/type-utils');var _privacytypes = require('@transcend-io/privacy-types');var N=/target ('|")(.*?)('|")/,O=/pod ('|")(.*?)('|")(, ('|")~> (.+?)('|")|)/,y={supportedFiles:["Podfile"],ignoreDirs:["Pods"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(N,"g"),matches:["quote1","name","quote2"]},n),c=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(O,"g"),matches:["quote1","name","quote2","extra","quote3","version","quote4"]},n);return o.map((t,p)=>({name:t.name,type:_privacytypes.CodePackageType.CocoaPods,softwareDevelopmentKits:c.filter(r=>r.matchIndex>t.matchIndex&&(!o[p+1]||r.matchIndex<o[p+1].matchIndex)).map(r=>({name:r.name,version:r.version}))}))}};var _path = require('path');var K=/implementation( *)('|")(.+?):(.+?):(.+?|)('|")/,M=/apply plugin: *('|")(.+?)(:(.+?)|)('|")/,j=/implementation group:( *)('|")(.+?)('|"),( *)name:( *)('|")(.+?)('|"),( *)version:( *)('|")(.+?)('|")/,L=/applicationId( *)"(.+?)"/,S={supportedFiles:["build.gradle**"],ignoreDirs:["gradle-app.setting","gradle-wrapper.jar","gradle-wrapper.properties"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_path.dirname.call(void 0, e),c=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(K,"g"),matches:["space","quote1","name","path","version","quote2"]},n),a=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(M,"g"),matches:["quote1","name","group","version","quote2"]},n),t=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(j,"g"),matches:["space1","quote1","group","quote2","space2","space3","quote3","name","quote4","space4","space5","quote5","version","quote6"]},n),p=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(L,"g"),matches:["space","name"]},n);if(p.length>1)throw new Error(`Expected only one applicationId per file: ${e}`);return[{name:_optionalChain([p, 'access', _2 => _2[0], 'optionalAccess', _3 => _3.name])||o.split("/").pop(),softwareDevelopmentKits:[...c,...t,...a].map(r=>({name:r.name,version:r.version||void 0}))}]}};var x={supportedFiles:["package.json"],ignoreDirs:["node_modules","serverless-build","lambda-build"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_path.dirname.call(void 0, e),c=JSON.parse(n),{name:a,description:t,dependencies:p={},devDependencies:r={},optionalDependencies:i={}}=c;return[{name:a||o.split("/").pop(),description:t,softwareDevelopmentKits:[...Object.entries(p).map(([s,m])=>({name:s,version:typeof m=="string"?m:void 0})),...Object.entries(r).map(([s,m])=>({name:s,version:typeof m=="string"?m:void 0,isDevDependency:!0})),...Object.entries(i).map(([s,m])=>({name:s,version:typeof m=="string"?m:void 0}))]}]}};var V=/(.+?)(=+)(.+)/,H=/name *= *('|")(.+?)('|")/,Q=/description *= *('|")(.+?)('|")/,P={supportedFiles:["requirements.txt"],ignoreDirs:["build","lib","lib64"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_path.dirname.call(void 0, e),a=_chunkIAZXK7V6cjs.c.call(void 0, o).find(s=>s==="setup.py"),t=a?_fs.readFileSync.call(void 0, _path.join.call(void 0, o,a),"utf-8"):void 0,p=t?(H.exec(t)||[])[2]:void 0,r=t?(Q.exec(t)||[])[2]:void 0,i=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(V,"g"),matches:["name","equals","version"]},n);return[{name:p||o.split("/").pop(),description:r||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:i.map(s=>({name:s.name,version:s.version}))}]}};var ee=/gem *('|")(.+?)('|")(, *('|")(.+?)('|")|)/,ne=/spec\.name *= *('|")(.+?)('|")/,oe=/spec\.description *= *('|")(.+?)('|")/,te=/spec\.summary *= *('|")(.+?)('|")/,k={supportedFiles:["Gemfile"],ignoreDirs:["bin"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_path.dirname.call(void 0, e),a=_chunkIAZXK7V6cjs.c.call(void 0, o).find(s=>s===".gemspec"),t=a?_fs.readFileSync.call(void 0, a,"utf-8"):void 0,p=t?(ne.exec(t)||[])[2]:void 0,r=t?(oe.exec(t)||te.exec(t)||[])[1]:void 0,i=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(ee,"g"),matches:["quote1","name","quote2","hasVersion","quote3","version","quote4"]},n);return[{name:p||o.split("/").pop(),description:r||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:i.map(s=>({name:s.name,version:s.version}))}]}};var _jsyaml = require('js-yaml'); var _jsyaml2 = _interopRequireDefault(_jsyaml);function pe(e){return e.split(`
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 _chunkTXG7TJLKcjs = require('./chunk-TXG7TJLK.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _fs = require('fs');var _typeutils = require('@transcend-io/type-utils');var _privacytypes = require('@transcend-io/privacy-types');var N=/target ('|")(.*?)('|")/,O=/pod ('|")(.*?)('|")(, ('|")~> (.+?)('|")|)/,y={supportedFiles:["Podfile"],ignoreDirs:["Pods"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(N,"g"),matches:["quote1","name","quote2"]},n),c=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(O,"g"),matches:["quote1","name","quote2","extra","quote3","version","quote4"]},n);return o.map((t,p)=>({name:t.name,type:_privacytypes.CodePackageType.CocoaPods,softwareDevelopmentKits:c.filter(r=>r.matchIndex>t.matchIndex&&(!o[p+1]||r.matchIndex<o[p+1].matchIndex)).map(r=>({name:r.name,version:r.version}))}))}};var _path = require('path');var K=/implementation( *)('|")(.+?):(.+?):(.+?|)('|")/,M=/apply plugin: *('|")(.+?)(:(.+?)|)('|")/,j=/implementation group:( *)('|")(.+?)('|"),( *)name:( *)('|")(.+?)('|"),( *)version:( *)('|")(.+?)('|")/,L=/applicationId( *)"(.+?)"/,S={supportedFiles:["build.gradle**"],ignoreDirs:["gradle-app.setting","gradle-wrapper.jar","gradle-wrapper.properties"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_path.dirname.call(void 0, e),c=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(K,"g"),matches:["space","quote1","name","path","version","quote2"]},n),a=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(M,"g"),matches:["quote1","name","group","version","quote2"]},n),t=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(j,"g"),matches:["space1","quote1","group","quote2","space2","space3","quote3","name","quote4","space4","space5","quote5","version","quote6"]},n),p=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(L,"g"),matches:["space","name"]},n);if(p.length>1)throw new Error(`Expected only one applicationId per file: ${e}`);return[{name:_optionalChain([p, 'access', _2 => _2[0], 'optionalAccess', _3 => _3.name])||o.split("/").pop(),softwareDevelopmentKits:[...c,...t,...a].map(r=>({name:r.name,version:r.version||void 0}))}]}};var x={supportedFiles:["package.json"],ignoreDirs:["node_modules","serverless-build","lambda-build"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_path.dirname.call(void 0, e),c=JSON.parse(n),{name:a,description:t,dependencies:p={},devDependencies:r={},optionalDependencies:i={}}=c;return[{name:a||o.split("/").pop(),description:t,softwareDevelopmentKits:[...Object.entries(p).map(([s,m])=>({name:s,version:typeof m=="string"?m:void 0})),...Object.entries(r).map(([s,m])=>({name:s,version:typeof m=="string"?m:void 0,isDevDependency:!0})),...Object.entries(i).map(([s,m])=>({name:s,version:typeof m=="string"?m:void 0}))]}]}};var V=/(.+?)(=+)(.+)/,H=/name *= *('|")(.+?)('|")/,Q=/description *= *('|")(.+?)('|")/,P={supportedFiles:["requirements.txt"],ignoreDirs:["build","lib","lib64"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_path.dirname.call(void 0, e),a=_chunkTXG7TJLKcjs.c.call(void 0, o).find(s=>s==="setup.py"),t=a?_fs.readFileSync.call(void 0, _path.join.call(void 0, o,a),"utf-8"):void 0,p=t?(H.exec(t)||[])[2]:void 0,r=t?(Q.exec(t)||[])[2]:void 0,i=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(V,"g"),matches:["name","equals","version"]},n);return[{name:p||o.split("/").pop(),description:r||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:i.map(s=>({name:s.name,version:s.version}))}]}};var ee=/gem *('|")(.+?)('|")(, *('|")(.+?)('|")|)/,ne=/spec\.name *= *('|")(.+?)('|")/,oe=/spec\.description *= *('|")(.+?)('|")/,te=/spec\.summary *= *('|")(.+?)('|")/,k={supportedFiles:["Gemfile"],ignoreDirs:["bin"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_path.dirname.call(void 0, e),a=_chunkTXG7TJLKcjs.c.call(void 0, o).find(s=>s===".gemspec"),t=a?_fs.readFileSync.call(void 0, a,"utf-8"):void 0,p=t?(ne.exec(t)||[])[2]:void 0,r=t?(oe.exec(t)||te.exec(t)||[])[1]:void 0,i=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(ee,"g"),matches:["quote1","name","quote2","hasVersion","quote3","version","quote4"]},n);return[{name:p||o.split("/").pop(),description:r||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:i.map(s=>({name:s.name,version:s.version}))}]}};var _jsyaml = require('js-yaml'); var _jsyaml2 = _interopRequireDefault(_jsyaml);function pe(e){return e.split(`
2
2
  `).map(n=>{let o=n.indexOf("#");return o>-1&&!n.substring(0,o).includes('"')&&!n.substring(0,o).includes("'")?n.substring(0,o).trim():n}).filter(n=>n.length>0).join(`
3
3
  `)}var v={supportedFiles:["pubspec.yml"],ignoreDirs:["build"],scanFunction:e=>{let n=_path.dirname.call(void 0, e),o=_fs.readFileSync.call(void 0, e,"utf-8"),{name:c,description:a,dev_dependencies:t={},dependencies:p={}}=_jsyaml2.default.load(pe(o));return[{name:c||n.split("/").pop(),description:a,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:[...Object.entries(p).map(([r,i])=>({name:r,version:typeof i=="string"?i:typeof i=="number"?i.toString():_optionalChain([i, 'optionalAccess', _4 => _4.sdk])})),...Object.entries(t).map(([r,i])=>({name:r,version:typeof i=="string"?i:typeof i=="number"?i.toString():_optionalChain([i, 'optionalAccess', _5 => _5.sdk]),isDevDependency:!0}))]}]}};var I={supportedFiles:["composer.json"],ignoreDirs:["vendor","node_modules","cache","build","dist"],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_path.dirname.call(void 0, e),c=JSON.parse(n),{name:a,description:t,require:p={},"require-dev":r={}}=c;return[{name:a||o.split("/").pop(),description:t,softwareDevelopmentKits:[...Object.entries(p).map(([i,s])=>({name:i,version:typeof s=="string"?s:void 0})),...Object.entries(r).map(([i,s])=>({name:i,version:typeof s=="string"?s:void 0,isDevDependency:!0}))]}]}};var _iots = require('io-ts'); var d = _interopRequireWildcard(_iots);var le=d.type({pins:d.array(d.type({identity:d.string,kind:d.string,location:d.string,state:d.type({revision:d.string,version:d.string})})),version:d.number}),D={supportedFiles:["Package.resolved"],ignoreDirs:[],scanFunction:e=>{let n=_fs.readFileSync.call(void 0, e,"utf-8"),o=_typeutils.decodeCodec.call(void 0, le,n);return[{name:_path.dirname.call(void 0, e).split("/").pop()||"",type:_privacytypes.CodePackageType.CocoaPods,softwareDevelopmentKits:o.pins.map(c=>({name:c.identity,version:c.state.version}))}]}};var gn={cocoaPods:y,gradle:S,javascriptPackageJson:x,pythonRequirementsTxt:P,gemfile:k,pubspec:v,swift:D},_={[_privacytypes.CodePackageType.CocoaPods]:y,[_privacytypes.CodePackageType.Gradle]:S,[_privacytypes.CodePackageType.PackageJson]:x,[_privacytypes.CodePackageType.RequirementsTxt]:P,[_privacytypes.CodePackageType.Gemfile]:k,[_privacytypes.CodePackageType.Pubspec]:v,[_privacytypes.CodePackageType.ComposerJson]:I,[_privacytypes.CodePackageType.Swift]:D};var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function Sn({scanPath:e,ignoreDirs:n=[],repositoryName:o}){return(await Promise.all(_typeutils.getEntries.call(void 0, _).map(async([a,t])=>{let{ignoreDirs:p,supportedFiles:r,scanFunction:i}=t,s=[...n,...p].filter(m=>m.length>0);try{let m=await _fastglob2.default.call(void 0, `${e}/**/${r.join("|")}`,{ignore:s.map(g=>`${e}/**/${g}`),unique:!0,onlyFiles:!0});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Scanning: ${m.length} files of type ${a}`));let C=m.map(g=>i(g).map(q=>({...q,relativePath:g.replace(`${e}/`,"")}))).flat();return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Found: ${C.length} packages and ${C.map(({softwareDevelopmentKits:g=[]})=>g).flat().length} sdks`)),C.map(g=>({...g,type:a,repositoryName:o}))}catch(m){throw new Error(`Error scanning globs ${r} with error: ${m}`)}}))).flat()}exports.a = gn; exports.b = Sn;
4
- //# sourceMappingURL=chunk-SR64CZV3.cjs.map
4
+ //# sourceMappingURL=chunk-6LMZMYBN.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-SR64CZV3.cjs","../src/lib/code-scanning/integrations/cocoaPods.ts","../src/lib/code-scanning/integrations/gradle.ts","../src/lib/code-scanning/integrations/pubspec.ts","../src/lib/code-scanning/constants.ts"],"names":["POD_TARGET_REGEX","POD_PACKAGE_REGEX","cocoaPods","filePath","fileContents","readFileSync","targets","findAllWithRegex","packages","target","ind","CodePackageType","pkg","GRADLE_IMPLEMENTATION_REGEX","GRADLE_PLUGIN_REGEX","GRADLE_IMPLEMENTATION_GROUP_REGEX","GRADLE_APPLICATION_NAME_REGEX","gradle","directory","dirname","targetPlugins","targetGroups","applications"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/chunk-SR64CZV3.cjs","sourcesContent":[null,"import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageSdk } from '../../../codecs';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { CodePackageType } from '@transcend-io/privacy-types';\n\nconst POD_TARGET_REGEX = /target ('|\")(.*?)('|\")/;\nconst POD_PACKAGE_REGEX = /pod ('|\")(.*?)('|\")(, ('|\")~> (.+?)('|\")|)/;\n\nexport const cocoaPods: CodeScanningConfig = {\n supportedFiles: ['Podfile'],\n ignoreDirs: ['Pods'],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(POD_TARGET_REGEX, 'g'),\n matches: ['quote1', 'name', 'quote2'],\n },\n fileContents,\n );\n const packages = findAllWithRegex(\n {\n value: new RegExp(POD_PACKAGE_REGEX, 'g'),\n matches: [\n 'quote1',\n 'name',\n 'quote2',\n 'extra',\n 'quote3',\n 'version',\n 'quote4',\n ],\n },\n fileContents,\n );\n\n const deps: CodePackageSdk[] = targets.map((target, ind) => ({\n name: target.name,\n type: CodePackageType.CocoaPods,\n softwareDevelopmentKits: packages\n .filter(\n (pkg) =>\n pkg.matchIndex > target.matchIndex &&\n (!targets[ind + 1] || pkg.matchIndex < targets[ind + 1].matchIndex),\n )\n .map((pkg) => ({\n name: pkg.name,\n version: pkg.version,\n })),\n }));\n\n return deps;\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { dirname } from 'node:path';\n\nconst GRADLE_IMPLEMENTATION_REGEX =\n /implementation( *)('|\")(.+?):(.+?):(.+?|)('|\")/;\nconst GRADLE_PLUGIN_REGEX = /apply plugin: *('|\")(.+?)(:(.+?)|)('|\")/;\nconst GRADLE_IMPLEMENTATION_GROUP_REGEX =\n /implementation group:( *)('|\")(.+?)('|\"),( *)name:( *)('|\")(.+?)('|\"),( *)version:( *)('|\")(.+?)('|\")/;\nconst GRADLE_APPLICATION_NAME_REGEX = /applicationId( *)\"(.+?)\"/;\n\n/**\n * So far, there are three ways of defining dependencies that is supported\n * implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.core', version: '3.28.0'\n * or\n * implementation 'com.google.firebase:firebase-analytics:18.0.0'\n * or\n * apply plugin: 'com.google.gms.google-services'\n *\n * single and double quotes are both recognized\n */\nexport const gradle: CodeScanningConfig = {\n supportedFiles: ['build.gradle**'],\n ignoreDirs: [\n 'gradle-app.setting',\n 'gradle-wrapper.jar',\n 'gradle-wrapper.properties',\n ],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n const directory = dirname(filePath);\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_REGEX, 'g'),\n matches: ['space', 'quote1', 'name', 'path', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetPlugins = findAllWithRegex(\n {\n value: new RegExp(GRADLE_PLUGIN_REGEX, 'g'),\n matches: ['quote1', 'name', 'group', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetGroups = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_GROUP_REGEX, 'g'),\n matches: [\n 'space1',\n 'quote1',\n 'group',\n 'quote2',\n 'space2',\n 'space3',\n 'quote3',\n 'name',\n 'quote4',\n 'space4',\n 'space5',\n 'quote5',\n 'version',\n 'quote6',\n ],\n },\n fileContents,\n );\n const applications = findAllWithRegex(\n {\n value: new RegExp(GRADLE_APPLICATION_NAME_REGEX, 'g'),\n matches: ['space', 'name'],\n },\n fileContents,\n );\n if (applications.length > 1) {\n throw new Error(`Expected only one applicationId per file: ${filePath}`);\n }\n\n return [\n {\n name: applications[0]?.name || directory.split('/').pop()!,\n softwareDevelopmentKits: [\n ...targets,\n ...targetGroups,\n ...targetPlugins,\n ].map((target) => ({\n name: target.name,\n version: target.version || undefined,\n })),\n },\n ];\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport yaml from 'js-yaml';\nimport { dirname } from 'node:path';\n\n/**\n * Remove YAML comments from a string\n *\n * @param yamlString - YAML string\n * @returns String without comments\n */\nfunction removeYAMLComments(yamlString: string): string {\n return yamlString\n .split('\\n')\n .map((line) => {\n // Remove inline comments\n const commentIndex = line.indexOf('#');\n if (commentIndex > -1) {\n // Check if '#' is not inside a string\n if (\n !line.substring(0, commentIndex).includes('\"') &&\n !line.substring(0, commentIndex).includes(\"'\")\n ) {\n return line.substring(0, commentIndex).trim();\n }\n }\n return line;\n })\n .filter((line) => line.length > 0)\n .join('\\n');\n}\n\nexport const pubspec: CodeScanningConfig = {\n supportedFiles: ['pubspec.yml'],\n ignoreDirs: ['build'],\n scanFunction: (filePath) => {\n const directory = dirname(filePath);\n const fileContents = readFileSync(filePath, 'utf-8');\n const {\n name,\n description,\n dev_dependencies = {},\n dependencies = {},\n } = yaml.load(removeYAMLComments(fileContents)) as {\n /** Name */\n name?: string;\n /** Description */\n description?: string;\n /** Dev dependencies */\n dev_dependencies?: { [k in string]: number | Record<string, string> };\n /** Dependencies */\n dependencies?: { [k in string]: number | Record<string, string> };\n };\n return [\n {\n name: name || directory.split('/').pop()!,\n description,\n type: CodePackageType.RequirementsTxt,\n softwareDevelopmentKits: [\n ...Object.entries(dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n })),\n ...Object.entries(dev_dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n isDevDependency: true,\n })),\n ],\n },\n ];\n },\n};\n","import { CodeScanningConfig } from './types';\nimport {\n cocoaPods,\n gradle,\n javascriptPackageJson,\n gemfile,\n composerJson,\n pubspec,\n swift,\n pythonRequirementsTxt,\n} from './integrations';\nimport { CodePackageType } from '@transcend-io/privacy-types';\n\n/**\n * @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead\n */\nexport const SILO_DISCOVERY_CONFIGS: {\n [k in string]: CodeScanningConfig;\n} = {\n cocoaPods,\n gradle,\n javascriptPackageJson,\n pythonRequirementsTxt,\n gemfile,\n pubspec,\n swift,\n};\n\nexport const CODE_SCANNING_CONFIGS: {\n [k in CodePackageType]: CodeScanningConfig;\n} = {\n [CodePackageType.CocoaPods]: cocoaPods,\n [CodePackageType.Gradle]: gradle,\n [CodePackageType.PackageJson]: javascriptPackageJson,\n [CodePackageType.RequirementsTxt]: pythonRequirementsTxt,\n [CodePackageType.Gemfile]: gemfile,\n [CodePackageType.Pubspec]: pubspec,\n [CodePackageType.ComposerJson]: composerJson,\n [CodePackageType.Swift]: swift,\n};\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-6LMZMYBN.cjs","../src/lib/code-scanning/integrations/cocoaPods.ts","../src/lib/code-scanning/integrations/gradle.ts","../src/lib/code-scanning/integrations/pubspec.ts","../src/lib/code-scanning/constants.ts"],"names":["POD_TARGET_REGEX","POD_PACKAGE_REGEX","cocoaPods","filePath","fileContents","readFileSync","targets","findAllWithRegex","packages","target","ind","CodePackageType","pkg","GRADLE_IMPLEMENTATION_REGEX","GRADLE_PLUGIN_REGEX","GRADLE_IMPLEMENTATION_GROUP_REGEX","GRADLE_APPLICATION_NAME_REGEX","gradle","directory","dirname","targetPlugins","targetGroups","applications"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/chunk-6LMZMYBN.cjs","sourcesContent":[null,"import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageSdk } from '../../../codecs';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { CodePackageType } from '@transcend-io/privacy-types';\n\nconst POD_TARGET_REGEX = /target ('|\")(.*?)('|\")/;\nconst POD_PACKAGE_REGEX = /pod ('|\")(.*?)('|\")(, ('|\")~> (.+?)('|\")|)/;\n\nexport const cocoaPods: CodeScanningConfig = {\n supportedFiles: ['Podfile'],\n ignoreDirs: ['Pods'],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(POD_TARGET_REGEX, 'g'),\n matches: ['quote1', 'name', 'quote2'],\n },\n fileContents,\n );\n const packages = findAllWithRegex(\n {\n value: new RegExp(POD_PACKAGE_REGEX, 'g'),\n matches: [\n 'quote1',\n 'name',\n 'quote2',\n 'extra',\n 'quote3',\n 'version',\n 'quote4',\n ],\n },\n fileContents,\n );\n\n const deps: CodePackageSdk[] = targets.map((target, ind) => ({\n name: target.name,\n type: CodePackageType.CocoaPods,\n softwareDevelopmentKits: packages\n .filter(\n (pkg) =>\n pkg.matchIndex > target.matchIndex &&\n (!targets[ind + 1] || pkg.matchIndex < targets[ind + 1].matchIndex),\n )\n .map((pkg) => ({\n name: pkg.name,\n version: pkg.version,\n })),\n }));\n\n return deps;\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { dirname } from 'node:path';\n\nconst GRADLE_IMPLEMENTATION_REGEX =\n /implementation( *)('|\")(.+?):(.+?):(.+?|)('|\")/;\nconst GRADLE_PLUGIN_REGEX = /apply plugin: *('|\")(.+?)(:(.+?)|)('|\")/;\nconst GRADLE_IMPLEMENTATION_GROUP_REGEX =\n /implementation group:( *)('|\")(.+?)('|\"),( *)name:( *)('|\")(.+?)('|\"),( *)version:( *)('|\")(.+?)('|\")/;\nconst GRADLE_APPLICATION_NAME_REGEX = /applicationId( *)\"(.+?)\"/;\n\n/**\n * So far, there are three ways of defining dependencies that is supported\n * implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.core', version: '3.28.0'\n * or\n * implementation 'com.google.firebase:firebase-analytics:18.0.0'\n * or\n * apply plugin: 'com.google.gms.google-services'\n *\n * single and double quotes are both recognized\n */\nexport const gradle: CodeScanningConfig = {\n supportedFiles: ['build.gradle**'],\n ignoreDirs: [\n 'gradle-app.setting',\n 'gradle-wrapper.jar',\n 'gradle-wrapper.properties',\n ],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n const directory = dirname(filePath);\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_REGEX, 'g'),\n matches: ['space', 'quote1', 'name', 'path', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetPlugins = findAllWithRegex(\n {\n value: new RegExp(GRADLE_PLUGIN_REGEX, 'g'),\n matches: ['quote1', 'name', 'group', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetGroups = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_GROUP_REGEX, 'g'),\n matches: [\n 'space1',\n 'quote1',\n 'group',\n 'quote2',\n 'space2',\n 'space3',\n 'quote3',\n 'name',\n 'quote4',\n 'space4',\n 'space5',\n 'quote5',\n 'version',\n 'quote6',\n ],\n },\n fileContents,\n );\n const applications = findAllWithRegex(\n {\n value: new RegExp(GRADLE_APPLICATION_NAME_REGEX, 'g'),\n matches: ['space', 'name'],\n },\n fileContents,\n );\n if (applications.length > 1) {\n throw new Error(`Expected only one applicationId per file: ${filePath}`);\n }\n\n return [\n {\n name: applications[0]?.name || directory.split('/').pop()!,\n softwareDevelopmentKits: [\n ...targets,\n ...targetGroups,\n ...targetPlugins,\n ].map((target) => ({\n name: target.name,\n version: target.version || undefined,\n })),\n },\n ];\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport yaml from 'js-yaml';\nimport { dirname } from 'node:path';\n\n/**\n * Remove YAML comments from a string\n *\n * @param yamlString - YAML string\n * @returns String without comments\n */\nfunction removeYAMLComments(yamlString: string): string {\n return yamlString\n .split('\\n')\n .map((line) => {\n // Remove inline comments\n const commentIndex = line.indexOf('#');\n if (commentIndex > -1) {\n // Check if '#' is not inside a string\n if (\n !line.substring(0, commentIndex).includes('\"') &&\n !line.substring(0, commentIndex).includes(\"'\")\n ) {\n return line.substring(0, commentIndex).trim();\n }\n }\n return line;\n })\n .filter((line) => line.length > 0)\n .join('\\n');\n}\n\nexport const pubspec: CodeScanningConfig = {\n supportedFiles: ['pubspec.yml'],\n ignoreDirs: ['build'],\n scanFunction: (filePath) => {\n const directory = dirname(filePath);\n const fileContents = readFileSync(filePath, 'utf-8');\n const {\n name,\n description,\n dev_dependencies = {},\n dependencies = {},\n } = yaml.load(removeYAMLComments(fileContents)) as {\n /** Name */\n name?: string;\n /** Description */\n description?: string;\n /** Dev dependencies */\n dev_dependencies?: { [k in string]: number | Record<string, string> };\n /** Dependencies */\n dependencies?: { [k in string]: number | Record<string, string> };\n };\n return [\n {\n name: name || directory.split('/').pop()!,\n description,\n type: CodePackageType.RequirementsTxt,\n softwareDevelopmentKits: [\n ...Object.entries(dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n })),\n ...Object.entries(dev_dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n isDevDependency: true,\n })),\n ],\n },\n ];\n },\n};\n","import { CodeScanningConfig } from './types';\nimport {\n cocoaPods,\n gradle,\n javascriptPackageJson,\n gemfile,\n composerJson,\n pubspec,\n swift,\n pythonRequirementsTxt,\n} from './integrations';\nimport { CodePackageType } from '@transcend-io/privacy-types';\n\n/**\n * @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead\n */\nexport const SILO_DISCOVERY_CONFIGS: {\n [k in string]: CodeScanningConfig;\n} = {\n cocoaPods,\n gradle,\n javascriptPackageJson,\n pythonRequirementsTxt,\n gemfile,\n pubspec,\n swift,\n};\n\nexport const CODE_SCANNING_CONFIGS: {\n [k in CodePackageType]: CodeScanningConfig;\n} = {\n [CodePackageType.CocoaPods]: cocoaPods,\n [CodePackageType.Gradle]: gradle,\n [CodePackageType.PackageJson]: javascriptPackageJson,\n [CodePackageType.RequirementsTxt]: pythonRequirementsTxt,\n [CodePackageType.Gemfile]: gemfile,\n [CodePackageType.Pubspec]: pubspec,\n [CodePackageType.ComposerJson]: composerJson,\n [CodePackageType.Swift]: swift,\n};\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk43ZI3DHBcjs = require('./chunk-43ZI3DHB.cjs');function f(p,{adTechPurposes:m=["SaleOfInfo"],serviceToTitle:s,serviceToSupportedIntegration:r}){let e=[],i=[],n={};p.forEach(t=>{let{service:a,attributes:c=[]}=t;if(!a||a==="internalService")return;let u=c.find(o=>o.key==="Found on Domain");u&&(n[a]||(n[a]=[]),n[a].push(...u.values.map(o=>o.replace("https://","").replace("http://",""))),n[a]=[...new Set(n[a])]),_chunk43ZI3DHBcjs.i.call(void 0, t.trackingPurposes,m).length>0?(i.push(a),e.includes(a)&&(e=e.filter(o=>o!==a))):i.includes(a)||e.push(a)});let h=[...new Set(i)].map(t=>({title:s[t],...r[t]?{integrationName:t}:{integrationName:"promptAPerson","outer-type":t},attributes:[{key:"Tech Type",values:["Ad Tech"]},{key:"Found On Domain",values:n[t]||[]}]}));return{siteTechDataSilos:[...new Set(e)].map(t=>({title:s[t],...r[t]?{integrationName:t}:{integrationName:"promptAPerson",outerType:t},attributes:[{key:"Tech Type",values:["Site Tech"]},{key:"Found On Domain",values:n[t]||[]}]})),adTechDataSilos:h}}exports.a = f;
2
- //# sourceMappingURL=chunk-X5CKWMKP.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWI7C7KDMcjs = require('./chunk-WI7C7KDM.cjs');function f(p,{adTechPurposes:m=["SaleOfInfo"],serviceToTitle:s,serviceToSupportedIntegration:r}){let e=[],i=[],n={};p.forEach(t=>{let{service:a,attributes:c=[]}=t;if(!a||a==="internalService")return;let u=c.find(o=>o.key==="Found on Domain");u&&(n[a]||(n[a]=[]),n[a].push(...u.values.map(o=>o.replace("https://","").replace("http://",""))),n[a]=[...new Set(n[a])]),_chunkWI7C7KDMcjs.i.call(void 0, t.trackingPurposes,m).length>0?(i.push(a),e.includes(a)&&(e=e.filter(o=>o!==a))):i.includes(a)||e.push(a)});let h=[...new Set(i)].map(t=>({title:s[t],...r[t]?{integrationName:t}:{integrationName:"promptAPerson","outer-type":t},attributes:[{key:"Tech Type",values:["Ad Tech"]},{key:"Found On Domain",values:n[t]||[]}]}));return{siteTechDataSilos:[...new Set(e)].map(t=>({title:s[t],...r[t]?{integrationName:t}:{integrationName:"promptAPerson",outerType:t},attributes:[{key:"Tech Type",values:["Site Tech"]},{key:"Found On Domain",values:n[t]||[]}]})),adTechDataSilos:h}}exports.a = f;
2
+ //# sourceMappingURL=chunk-FK7EPQ7K.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-X5CKWMKP.cjs","../src/lib/consent-manager/dataFlowsToDataSilos.ts"],"names":["dataFlowsToDataSilos","inputs","adTechPurposes","serviceToTitle","serviceToSupportedIntegration","siteTechIntegrations","adTechIntegrations","serviceToFoundOnDomain","flow","service","attributes","foundOnDomain","attr","v","union_default","s","adTechDataSilos"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/chunk-X5CKWMKP.cjs","sourcesContent":[null,"import { DataFlowInput, DataSiloInput } from '../../codecs';\nimport { union } from 'lodash-es';\nimport { IndexedCatalogs } from '../graphql';\n\n/**\n * Convert data flow configurations into a set of data silo configurations\n *\n * @param inputs - Data flow input to convert to data silos\n * @param options - Additional options\n * @returns Business entity configuration input\n */\nexport function dataFlowsToDataSilos(\n inputs: DataFlowInput[],\n {\n adTechPurposes = ['SaleOfInfo'],\n serviceToTitle,\n serviceToSupportedIntegration,\n }: IndexedCatalogs & {\n /** List of purposes that are considered \"Ad Tech\" */\n adTechPurposes?: string[];\n },\n): {\n /** List of data silo configurations for site-tech services */\n siteTechDataSilos: DataSiloInput[];\n /** List of data silo configurations for ad-tech services */\n adTechDataSilos: DataSiloInput[];\n} {\n // List of site tech integrations\n let siteTechIntegrations: string[] = [];\n\n // List of ad tech integrations\n const adTechIntegrations: string[] = [];\n\n // Mapping from service name to list of\n const serviceToFoundOnDomain: { [k in string]: string[] } = {};\n\n // iterate over each flow\n inputs.forEach((flow) => {\n // process data flows with services\n const { service, attributes = [] } = flow;\n if (!service || service === 'internalService') {\n return;\n }\n\n // create mapping to found on domain\n const foundOnDomain = attributes.find(\n (attr) => attr.key === 'Found on Domain',\n );\n\n // Create a list of all domains where the data flow was found\n if (foundOnDomain) {\n if (!serviceToFoundOnDomain[service]) {\n serviceToFoundOnDomain[service] = [];\n }\n serviceToFoundOnDomain[service]!.push(\n ...foundOnDomain.values.map((v) =>\n v.replace('https://', '').replace('http://', ''),\n ),\n );\n serviceToFoundOnDomain[service] = [\n ...new Set(serviceToFoundOnDomain[service]),\n ];\n }\n\n // Keep track of ad tech\n if (union(flow.trackingPurposes, adTechPurposes).length > 0) {\n // add service to ad tech list\n adTechIntegrations.push(service);\n\n // remove from site tech list\n if (siteTechIntegrations.includes(service)) {\n siteTechIntegrations = siteTechIntegrations.filter(\n (s) => s !== service,\n );\n }\n } else if (!adTechIntegrations.includes(service)) {\n // add to site tech list\n siteTechIntegrations.push(service);\n }\n });\n\n // create the list of ad tech integrations\n const adTechDataSilos = [...new Set(adTechIntegrations)].map((service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', 'outer-type': service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Ad Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }));\n\n // create the list of site tech integrations\n const siteTechDataSilos = [...new Set(siteTechIntegrations)].map(\n (service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', outerType: service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Site Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }),\n );\n\n return {\n siteTechDataSilos,\n adTechDataSilos,\n };\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-FK7EPQ7K.cjs","../src/lib/consent-manager/dataFlowsToDataSilos.ts"],"names":["dataFlowsToDataSilos","inputs","adTechPurposes","serviceToTitle","serviceToSupportedIntegration","siteTechIntegrations","adTechIntegrations","serviceToFoundOnDomain","flow","service","attributes","foundOnDomain","attr","v","union_default","s","adTechDataSilos"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/chunk-FK7EPQ7K.cjs","sourcesContent":[null,"import { DataFlowInput, DataSiloInput } from '../../codecs';\nimport { union } from 'lodash-es';\nimport { IndexedCatalogs } from '../graphql';\n\n/**\n * Convert data flow configurations into a set of data silo configurations\n *\n * @param inputs - Data flow input to convert to data silos\n * @param options - Additional options\n * @returns Business entity configuration input\n */\nexport function dataFlowsToDataSilos(\n inputs: DataFlowInput[],\n {\n adTechPurposes = ['SaleOfInfo'],\n serviceToTitle,\n serviceToSupportedIntegration,\n }: IndexedCatalogs & {\n /** List of purposes that are considered \"Ad Tech\" */\n adTechPurposes?: string[];\n },\n): {\n /** List of data silo configurations for site-tech services */\n siteTechDataSilos: DataSiloInput[];\n /** List of data silo configurations for ad-tech services */\n adTechDataSilos: DataSiloInput[];\n} {\n // List of site tech integrations\n let siteTechIntegrations: string[] = [];\n\n // List of ad tech integrations\n const adTechIntegrations: string[] = [];\n\n // Mapping from service name to list of\n const serviceToFoundOnDomain: { [k in string]: string[] } = {};\n\n // iterate over each flow\n inputs.forEach((flow) => {\n // process data flows with services\n const { service, attributes = [] } = flow;\n if (!service || service === 'internalService') {\n return;\n }\n\n // create mapping to found on domain\n const foundOnDomain = attributes.find(\n (attr) => attr.key === 'Found on Domain',\n );\n\n // Create a list of all domains where the data flow was found\n if (foundOnDomain) {\n if (!serviceToFoundOnDomain[service]) {\n serviceToFoundOnDomain[service] = [];\n }\n serviceToFoundOnDomain[service]!.push(\n ...foundOnDomain.values.map((v) =>\n v.replace('https://', '').replace('http://', ''),\n ),\n );\n serviceToFoundOnDomain[service] = [\n ...new Set(serviceToFoundOnDomain[service]),\n ];\n }\n\n // Keep track of ad tech\n if (union(flow.trackingPurposes, adTechPurposes).length > 0) {\n // add service to ad tech list\n adTechIntegrations.push(service);\n\n // remove from site tech list\n if (siteTechIntegrations.includes(service)) {\n siteTechIntegrations = siteTechIntegrations.filter(\n (s) => s !== service,\n );\n }\n } else if (!adTechIntegrations.includes(service)) {\n // add to site tech list\n siteTechIntegrations.push(service);\n }\n });\n\n // create the list of ad tech integrations\n const adTechDataSilos = [...new Set(adTechIntegrations)].map((service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', 'outer-type': service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Ad Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }));\n\n // create the list of site tech integrations\n const siteTechDataSilos = [...new Set(siteTechIntegrations)].map(\n (service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', outerType: service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Site Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }),\n );\n\n return {\n siteTechDataSilos,\n adTechDataSilos,\n };\n}\n"]}
@@ -1,4 +1,4 @@
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 _chunk54CJVBSOcjs = require('./chunk-54CJVBSO.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunkNBN4WQARcjs = require('./chunk-NBN4WQAR.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunk43ZI3DHBcjs = require('./chunk-43ZI3DHB.cjs');var _privacytypes = require('@transcend-io/privacy-types');var _bluebird = require('bluebird');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function at({auth:e,deploy:i=!1,transcendUrl:o=_chunk43ZI3DHBcjs.r,bundleTypes:t=Object.values(_privacytypes.ConsentBundleType)}){let r=_chunkNBN4WQARcjs.vc.call(void 0, o,e),n=await _chunkNBN4WQARcjs.Oc.call(void 0, r);await _bluebird.mapSeries.call(void 0, t,async a=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Update Consent Manager bundle with ID "${n}" and type "${a}" to latest version...`)),await _chunkNBN4WQARcjs.zc.call(void 0, r,{id:n,bundleType:a}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Updated Consent Manager bundle with ID "${n}" and type "${a}" to latest version!`))}),i&&await _bluebird.mapSeries.call(void 0, t,async a=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Deploying Consent Manager bundle with ID "${n}" and type "${a}"...`)),await _chunkNBN4WQARcjs.yc.call(void 0, r,{id:n,bundleType:a}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Deployed Consent Manager bundle with ID "${n}" and type "${a}"!`))})}var K=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function Ct({auth:e,trackerStatus:i,file:o,classifyService:t=!1,transcendUrl:r=_chunk43ZI3DHBcjs.r}){let n=_chunkNBN4WQARcjs.vc.call(void 0, r,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let l=_chunkNBN4WQARcjs.qc.call(void 0, o,_chunkQEM6S2W7cjs.ia).map(({Type:d,Notes:m,Service:f,Purpose:E,Status:g,Owners:I,Teams:T,"Connections Made To":v,...y})=>({value:v,type:d,description:m,trackingPurposes:_chunkNBN4WQARcjs.nc.call(void 0, E),status:g||i,owners:I?_chunkNBN4WQARcjs.nc.call(void 0, I):void 0,teams:T?_chunkNBN4WQARcjs.nc.call(void 0, T):void 0,attributes:Object.entries(y).filter(([h])=>!K.includes(h)).map(([h,B])=>({key:h,values:_chunkNBN4WQARcjs.nc.call(void 0, B)}))}));await _chunkNBN4WQARcjs.Te.call(void 0, n,l,t)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Encountered error(s) syncing data flows from CSV, see logs above for more info. ")),process.exit(1))}var j=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function vt({auth:e,trackerStatus:i,file:o,transcendUrl:t=_chunk43ZI3DHBcjs.r}){let r=_chunkNBN4WQARcjs.vc.call(void 0, t,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let a=_chunkNBN4WQARcjs.qc.call(void 0, o,_chunkQEM6S2W7cjs.ja).map(({"Is Regex?":s,Notes:d,Service:m,Purpose:f,Status:E,Owners:g,Teams:I,Name:T,...v})=>({...typeof s=="string"?{isRegex:s.toLowerCase()==="true"}:{},name:T,description:d,trackingPurposes:_chunkNBN4WQARcjs.nc.call(void 0, f),status:E||i,owners:g?_chunkNBN4WQARcjs.nc.call(void 0, g):void 0,teams:I?_chunkNBN4WQARcjs.nc.call(void 0, I):void 0,attributes:Object.entries(v).filter(([y])=>!j.includes(y)).map(([y,h])=>({key:y,values:_chunkNBN4WQARcjs.nc.call(void 0, h)}))}));await _chunkNBN4WQARcjs.Ne.call(void 0, r,a)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Encountered error(s) syncing cookies from CSV, see logs above for more info. ")),process.exit(1))}var Y=1e3,Q=60*Y,V=60*Q,X=24*V,z=7*X;async function Lt(e,{bin:i,start:o,end:t=new Date}){let r=await _chunkNBN4WQARcjs.Oc.call(void 0, e),n=Math.floor(o.getTime()/1e3),a=Math.floor(t.getTime()/1e3);if(n>a)throw new Error('Received "end" date that happened before "start" date');if(i==="1h"&&t.getTime()-o.getTime()>z*2)throw new Error("When using bin=1h, start and end time can be no more than 2 weeks apart");let l=o.toISOString(),s=t.toISOString(),[d,m,f]=await Promise.all([_chunkNBN4WQARcjs.Rc.call(void 0, e,{dataSource:"PRIVACY_SIGNAL_TIMESERIES",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1}),_chunkNBN4WQARcjs.Rc.call(void 0, e,{dataSource:"CONSENT_CHANGES_TIMESERIES",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1}),_chunkNBN4WQARcjs.Rc.call(void 0, e,{dataSource:"CONSENT_SESSIONS_BY_REGIME",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1})]);return{PRIVACY_SIGNAL_TIMESERIES:d,CONSENT_CHANGES_TIMESERIES:m,CONSENT_SESSIONS_BY_REGIME:f}}var $=e=>new URL(`https://${e}`).hostname.split(".").slice(-2).join(".");var J=/^(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]?)$/;async function Ht(e,{xdiLocation:i,transcendUrl:o=_chunk43ZI3DHBcjs.r,removeIpAddresses:t=!0,domainBlockList:r=["localhost"],xdiAllowedCommands:n="ConsentManager:Sync"}){let a=Array.isArray(e)?e:[{apiKey:e,organizationId:"",organizationName:""}],l=await _bluebird.map.call(void 0, a,async m=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling consent metadata for organization - ${m.organizationName}`));let f=_chunkNBN4WQARcjs.vc.call(void 0, o,m.apiKey);return await _chunkNBN4WQARcjs.Nc.call(void 0, f)},{concurrency:5}),s={};return l.forEach(m=>{let f=_optionalChain([m, 'access', _2 => _2.partition, 'optionalAccess', _3 => _3.partition])||m.bundleURL.split("/").reverse()[1];s[f]||(s[f]=[]);let E=_chunk43ZI3DHBcjs.c.call(void 0, m.configuration.domains.filter(g=>!t||!J.test(g)).map(g=>$(g)),r);s[f]=[...new Set([...s[f]||[],...E])]}),{html:`
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 _chunkK45V7WKNcjs = require('./chunk-K45V7WKN.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunkUTU4F57Hcjs = require('./chunk-UTU4F57H.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkWI7C7KDMcjs = require('./chunk-WI7C7KDM.cjs');var _privacytypes = require('@transcend-io/privacy-types');var _bluebird = require('bluebird');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function at({auth:e,deploy:i=!1,transcendUrl:o=_chunkWI7C7KDMcjs.r,bundleTypes:t=Object.values(_privacytypes.ConsentBundleType)}){let r=_chunkUTU4F57Hcjs.vc.call(void 0, o,e),n=await _chunkUTU4F57Hcjs.Oc.call(void 0, r);await _bluebird.mapSeries.call(void 0, t,async a=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Update Consent Manager bundle with ID "${n}" and type "${a}" to latest version...`)),await _chunkUTU4F57Hcjs.zc.call(void 0, r,{id:n,bundleType:a}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Updated Consent Manager bundle with ID "${n}" and type "${a}" to latest version!`))}),i&&await _bluebird.mapSeries.call(void 0, t,async a=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Deploying Consent Manager bundle with ID "${n}" and type "${a}"...`)),await _chunkUTU4F57Hcjs.yc.call(void 0, r,{id:n,bundleType:a}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Deployed Consent Manager bundle with ID "${n}" and type "${a}"!`))})}var K=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function Ct({auth:e,trackerStatus:i,file:o,classifyService:t=!1,transcendUrl:r=_chunkWI7C7KDMcjs.r}){let n=_chunkUTU4F57Hcjs.vc.call(void 0, r,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let l=_chunkUTU4F57Hcjs.qc.call(void 0, o,_chunkQEM6S2W7cjs.ia).map(({Type:d,Notes:m,Service:f,Purpose:E,Status:g,Owners:I,Teams:T,"Connections Made To":v,...y})=>({value:v,type:d,description:m,trackingPurposes:_chunkUTU4F57Hcjs.nc.call(void 0, E),status:g||i,owners:I?_chunkUTU4F57Hcjs.nc.call(void 0, I):void 0,teams:T?_chunkUTU4F57Hcjs.nc.call(void 0, T):void 0,attributes:Object.entries(y).filter(([h])=>!K.includes(h)).map(([h,B])=>({key:h,values:_chunkUTU4F57Hcjs.nc.call(void 0, B)}))}));await _chunkUTU4F57Hcjs.Te.call(void 0, n,l,t)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Encountered error(s) syncing data flows from CSV, see logs above for more info. ")),process.exit(1))}var j=["ID","Activity","Encounters","Last Seen At","Has Native Do Not Sell/Share Support","IAB USP API Support","Service Description","Website URL","Categories of Recipients"];async function vt({auth:e,trackerStatus:i,file:o,transcendUrl:t=_chunkWI7C7KDMcjs.r}){let r=_chunkUTU4F57Hcjs.vc.call(void 0, t,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let a=_chunkUTU4F57Hcjs.qc.call(void 0, o,_chunkQEM6S2W7cjs.ja).map(({"Is Regex?":s,Notes:d,Service:m,Purpose:f,Status:E,Owners:g,Teams:I,Name:T,...v})=>({...typeof s=="string"?{isRegex:s.toLowerCase()==="true"}:{},name:T,description:d,trackingPurposes:_chunkUTU4F57Hcjs.nc.call(void 0, f),status:E||i,owners:g?_chunkUTU4F57Hcjs.nc.call(void 0, g):void 0,teams:I?_chunkUTU4F57Hcjs.nc.call(void 0, I):void 0,attributes:Object.entries(v).filter(([y])=>!j.includes(y)).map(([y,h])=>({key:y,values:_chunkUTU4F57Hcjs.nc.call(void 0, h)}))}));await _chunkUTU4F57Hcjs.Ne.call(void 0, r,a)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Encountered error(s) syncing cookies from CSV, see logs above for more info. ")),process.exit(1))}var Y=1e3,Q=60*Y,V=60*Q,X=24*V,z=7*X;async function Lt(e,{bin:i,start:o,end:t=new Date}){let r=await _chunkUTU4F57Hcjs.Oc.call(void 0, e),n=Math.floor(o.getTime()/1e3),a=Math.floor(t.getTime()/1e3);if(n>a)throw new Error('Received "end" date that happened before "start" date');if(i==="1h"&&t.getTime()-o.getTime()>z*2)throw new Error("When using bin=1h, start and end time can be no more than 2 weeks apart");let l=o.toISOString(),s=t.toISOString(),[d,m,f]=await Promise.all([_chunkUTU4F57Hcjs.Rc.call(void 0, e,{dataSource:"PRIVACY_SIGNAL_TIMESERIES",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1}),_chunkUTU4F57Hcjs.Rc.call(void 0, e,{dataSource:"CONSENT_CHANGES_TIMESERIES",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1}),_chunkUTU4F57Hcjs.Rc.call(void 0, e,{dataSource:"CONSENT_SESSIONS_BY_REGIME",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1})]);return{PRIVACY_SIGNAL_TIMESERIES:d,CONSENT_CHANGES_TIMESERIES:m,CONSENT_SESSIONS_BY_REGIME:f}}var $=e=>new URL(`https://${e}`).hostname.split(".").slice(-2).join(".");var J=/^(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]?)$/;async function Ht(e,{xdiLocation:i,transcendUrl:o=_chunkWI7C7KDMcjs.r,removeIpAddresses:t=!0,domainBlockList:r=["localhost"],xdiAllowedCommands:n="ConsentManager:Sync"}){let a=Array.isArray(e)?e:[{apiKey:e,organizationId:"",organizationName:""}],l=await _bluebird.map.call(void 0, a,async m=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling consent metadata for organization - ${m.organizationName}`));let f=_chunkUTU4F57Hcjs.vc.call(void 0, o,m.apiKey);return await _chunkUTU4F57Hcjs.Nc.call(void 0, f)},{concurrency:5}),s={};return l.forEach(m=>{let f=_optionalChain([m, 'access', _2 => _2.partition, 'optionalAccess', _3 => _3.partition])||m.bundleURL.split("/").reverse()[1];s[f]||(s[f]=[]);let E=_chunkWI7C7KDMcjs.c.call(void 0, m.configuration.domains.filter(g=>!t||!J.test(g)).map(g=>$(g)),r);s[f]=[...new Set([...s[f]||[],...E])]}),{html:`
2
2
  <!DOCTYPE html>
3
3
  <script
4
4
  src="${i}"
@@ -8,5 +8,5 @@ data-xdi-commands="${n}"
8
8
  `,syncGroups:s}}function Yt(e){let i=e.map(({name:o,input:t})=>({title:o.replace(".yml",""),attributes:[..._optionalChain([t, 'optionalAccess', _4 => _4.domains])?[{key:"Transcend Domain List",values:[...new Set(t.domains)]}]:[],..._optionalChain([t, 'optionalAccess', _5 => _5.bundleUrls])?[{key:"Airgap Production URL",values:[t.bundleUrls.PRODUCTION]},{key:"Airgap Test URL",values:[t.bundleUrls.TEST]},{key:"Airgap XDI URL",values:[t.bundleUrls.PRODUCTION.replace("airgap.js","xdi.js")]}]:[],..._optionalChain([t, 'optionalAccess', _6 => _6.partition])?[{key:"Consent Partition Key",values:[t.partition]}]:[]]}));return _chunkZUNVPK23cjs.a.info(`
9
9
 
10
10
  ~~~~~~~~~~~
11
- Airgap scripts to host:`),i.forEach(({attributes:o,title:t},r)=>{_optionalChain([o, 'optionalAccess', _7 => _7.find, 'call', _8 => _8(n=>n.key==="Airgap Production URL"), 'optionalAccess', _9 => _9.values, 'optionalAccess', _10 => _10.forEach, 'call', _11 => _11(n=>{_chunkZUNVPK23cjs.a.info(`${r}) ${t} - ${n}`)})])}),i}var _iots = require('io-ts'); var p = _interopRequireWildcard(_iots);var _typeutils = require('@transcend-io/type-utils');var tt=p.intersection([p.type({nodes:p.array(_chunk54CJVBSOcjs.c)}),p.partial({lastKey:p.partial({userId:p.string,partition:p.string,timestamp:p.string})})]);async function zt(e,{partition:i,filterBy:o={},limit:t=50}){let r,n=[],a=!0;for(;a;){let l=await e.post("v1/consent-preferences",{json:{partition:i,...o,startKey:r||void 0,limit:t}}).json(),{nodes:s,lastKey:d}=_typeutils.decodeCodec.call(void 0, tt,l);if(!s||s.length===0)break;n.push(...s),r=d,a=!!d&&Object.keys(d).length>0}return n}exports.a = at; exports.b = Ct; exports.c = vt; exports.d = Lt; exports.e = $; exports.f = J; exports.g = Ht; exports.h = Yt; exports.i = tt; exports.j = zt;
12
- //# sourceMappingURL=chunk-LD6JDYD6.cjs.map
11
+ Airgap scripts to host:`),i.forEach(({attributes:o,title:t},r)=>{_optionalChain([o, 'optionalAccess', _7 => _7.find, 'call', _8 => _8(n=>n.key==="Airgap Production URL"), 'optionalAccess', _9 => _9.values, 'optionalAccess', _10 => _10.forEach, 'call', _11 => _11(n=>{_chunkZUNVPK23cjs.a.info(`${r}) ${t} - ${n}`)})])}),i}var _iots = require('io-ts'); var p = _interopRequireWildcard(_iots);var _typeutils = require('@transcend-io/type-utils');var tt=p.intersection([p.type({nodes:p.array(_chunkK45V7WKNcjs.c)}),p.partial({lastKey:p.partial({userId:p.string,partition:p.string,timestamp:p.string})})]);async function zt(e,{partition:i,filterBy:o={},limit:t=50}){let r,n=[],a=!0;for(;a;){let l=await e.post("v1/consent-preferences",{json:{partition:i,...o,startKey:r||void 0,limit:t}}).json(),{nodes:s,lastKey:d}=_typeutils.decodeCodec.call(void 0, tt,l);if(!s||s.length===0)break;n.push(...s),r=d,a=!!d&&Object.keys(d).length>0}return n}exports.a = at; exports.b = Ct; exports.c = vt; exports.d = Lt; exports.e = $; exports.f = J; exports.g = Ht; exports.h = Yt; exports.i = tt; exports.j = zt;
12
+ //# sourceMappingURL=chunk-IXOC4S5L.cjs.map