@transcend-io/cli 8.0.2 → 8.0.3

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 (200) hide show
  1. package/dist/bin/bash-complete.cjs +1 -1
  2. package/dist/bin/bash-complete.cjs.map +1 -1
  3. package/dist/bin/cli.cjs +1 -1
  4. package/dist/bin/cli.cjs.map +1 -1
  5. package/dist/bin/deprecated-command.cjs +2 -2
  6. package/dist/bin/deprecated-command.cjs.map +1 -1
  7. package/dist/{chunk-BPX6MSMC.cjs → chunk-6OZONTDQ.cjs} +2 -2
  8. package/dist/{chunk-BPX6MSMC.cjs.map → chunk-6OZONTDQ.cjs.map} +1 -1
  9. package/dist/{chunk-FNBADTTI.cjs → chunk-6TGK25IB.cjs} +19 -19
  10. package/dist/chunk-6TGK25IB.cjs.map +1 -0
  11. package/dist/chunk-6XM6VMLJ.cjs +3 -0
  12. package/dist/chunk-6XM6VMLJ.cjs.map +1 -0
  13. package/dist/{chunk-XARKMCNP.cjs → chunk-CKMSFTE3.cjs} +4 -4
  14. package/dist/{chunk-XARKMCNP.cjs.map → chunk-CKMSFTE3.cjs.map} +1 -1
  15. package/dist/{chunk-YKZKPWDF.cjs → chunk-ID37BANI.cjs} +2 -2
  16. package/dist/{chunk-YKZKPWDF.cjs.map → chunk-ID37BANI.cjs.map} +1 -1
  17. package/dist/chunk-LKUJWJR3.cjs +2920 -0
  18. package/dist/chunk-LKUJWJR3.cjs.map +1 -0
  19. package/dist/{chunk-3PX3HVEO.cjs → chunk-NKFMM546.cjs} +2 -2
  20. package/dist/{chunk-3PX3HVEO.cjs.map → chunk-NKFMM546.cjs.map} +1 -1
  21. package/dist/chunk-O3WQC6E5.cjs +15 -0
  22. package/dist/chunk-O3WQC6E5.cjs.map +1 -0
  23. package/dist/chunk-PZBS6J75.cjs +2 -0
  24. package/dist/chunk-PZBS6J75.cjs.map +1 -0
  25. package/dist/{chunk-W3S3ULXN.cjs → chunk-RWJAOMT2.cjs} +2 -2
  26. package/dist/{chunk-W3S3ULXN.cjs.map → chunk-RWJAOMT2.cjs.map} +1 -1
  27. package/dist/chunk-VGKI7LU6.cjs +12 -0
  28. package/dist/chunk-VGKI7LU6.cjs.map +1 -0
  29. package/dist/{chunk-YP2PMUM5.cjs → chunk-VOKC5JFF.cjs} +2 -2
  30. package/dist/{chunk-YP2PMUM5.cjs.map → chunk-VOKC5JFF.cjs.map} +1 -1
  31. package/dist/impl-2LCNGN5D.cjs +2 -0
  32. package/dist/impl-2LCNGN5D.cjs.map +1 -0
  33. package/dist/impl-33QXEL4O.cjs +2 -0
  34. package/dist/impl-33QXEL4O.cjs.map +1 -0
  35. package/dist/impl-43DKJXBV.cjs +2 -0
  36. package/dist/impl-43DKJXBV.cjs.map +1 -0
  37. package/dist/impl-5AFEZAKI.cjs +2 -0
  38. package/dist/impl-5AFEZAKI.cjs.map +1 -0
  39. package/dist/impl-5YD72VPT.cjs +2 -0
  40. package/dist/impl-5YD72VPT.cjs.map +1 -0
  41. package/dist/impl-66EIN2RJ.cjs +2 -0
  42. package/dist/impl-66EIN2RJ.cjs.map +1 -0
  43. package/dist/{impl-TC6DE6BU.cjs → impl-6R4MPO2O.cjs} +5 -5
  44. package/dist/impl-6R4MPO2O.cjs.map +1 -0
  45. package/dist/{impl-OXCKKL3L.cjs → impl-6RKVUEC3.cjs} +2 -2
  46. package/dist/impl-6RKVUEC3.cjs.map +1 -0
  47. package/dist/impl-6U7SEQSV.cjs +2 -0
  48. package/dist/impl-6U7SEQSV.cjs.map +1 -0
  49. package/dist/impl-BNFO7GWR.cjs +2 -0
  50. package/dist/impl-BNFO7GWR.cjs.map +1 -0
  51. package/dist/impl-FBTBJCFT.cjs +2 -0
  52. package/dist/impl-FBTBJCFT.cjs.map +1 -0
  53. package/dist/{impl-7MIPQI3E.cjs → impl-FLGGMBT2.cjs} +2 -2
  54. package/dist/impl-FLGGMBT2.cjs.map +1 -0
  55. package/dist/impl-FUIXYMVR.cjs +2 -0
  56. package/dist/impl-FUIXYMVR.cjs.map +1 -0
  57. package/dist/impl-G4QTM3EH.cjs +2 -0
  58. package/dist/impl-G4QTM3EH.cjs.map +1 -0
  59. package/dist/impl-G4TWPWWG.cjs +2 -0
  60. package/dist/impl-G4TWPWWG.cjs.map +1 -0
  61. package/dist/impl-IAR3M5WX.cjs +2 -0
  62. package/dist/impl-IAR3M5WX.cjs.map +1 -0
  63. package/dist/impl-KLZ5YXHK.cjs +4 -0
  64. package/dist/impl-KLZ5YXHK.cjs.map +1 -0
  65. package/dist/impl-L7K7UJ6R.cjs +12 -0
  66. package/dist/impl-L7K7UJ6R.cjs.map +1 -0
  67. package/dist/impl-LXV4X3QI.cjs +2 -0
  68. package/dist/impl-LXV4X3QI.cjs.map +1 -0
  69. package/dist/impl-MLYBMFOO.cjs +2 -0
  70. package/dist/impl-MLYBMFOO.cjs.map +1 -0
  71. package/dist/impl-MY6ZDXYW.cjs +2 -0
  72. package/dist/impl-MY6ZDXYW.cjs.map +1 -0
  73. package/dist/impl-O5IWDALJ.cjs +3 -0
  74. package/dist/impl-O5IWDALJ.cjs.map +1 -0
  75. package/dist/impl-OFTJE5SD.cjs +2 -0
  76. package/dist/impl-OFTJE5SD.cjs.map +1 -0
  77. package/dist/{impl-DFDEITPV.cjs → impl-OJSC5MYT.cjs} +4 -4
  78. package/dist/impl-OJSC5MYT.cjs.map +1 -0
  79. package/dist/impl-OUJ4L35V.cjs +2 -0
  80. package/dist/impl-OUJ4L35V.cjs.map +1 -0
  81. package/dist/impl-OXQKOZ4M.cjs +2 -0
  82. package/dist/impl-OXQKOZ4M.cjs.map +1 -0
  83. package/dist/impl-QHCWUI7F.cjs +2 -0
  84. package/dist/impl-QHCWUI7F.cjs.map +1 -0
  85. package/dist/impl-QW3OXCQ4.cjs +2 -0
  86. package/dist/impl-QW3OXCQ4.cjs.map +1 -0
  87. package/dist/impl-QWSN2LRT.cjs +2 -0
  88. package/dist/impl-QWSN2LRT.cjs.map +1 -0
  89. package/dist/impl-QX2IEWST.cjs +2 -0
  90. package/dist/impl-QX2IEWST.cjs.map +1 -0
  91. package/dist/impl-RZQTA7AY.cjs +2 -0
  92. package/dist/impl-RZQTA7AY.cjs.map +1 -0
  93. package/dist/impl-S2JT2ALK.cjs +2 -0
  94. package/dist/impl-S2JT2ALK.cjs.map +1 -0
  95. package/dist/impl-TGEQAHJ6.cjs +6 -0
  96. package/dist/impl-TGEQAHJ6.cjs.map +1 -0
  97. package/dist/impl-TGWQ5K5I.cjs +2 -0
  98. package/dist/impl-TGWQ5K5I.cjs.map +1 -0
  99. package/dist/impl-TJW5OUHX.cjs +6 -0
  100. package/dist/impl-TJW5OUHX.cjs.map +1 -0
  101. package/dist/impl-UQUGKIP5.cjs +2 -0
  102. package/dist/impl-UQUGKIP5.cjs.map +1 -0
  103. package/dist/{impl-WWQBCKZV.cjs → impl-VVKD5D4X.cjs} +2 -2
  104. package/dist/impl-VVKD5D4X.cjs.map +1 -0
  105. package/dist/impl-WYJ3WF33.cjs +2 -0
  106. package/dist/impl-WYJ3WF33.cjs.map +1 -0
  107. package/dist/index.cjs +3 -3
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.d.cts +92 -12
  110. package/package.json +1 -1
  111. package/dist/chunk-44J2TVZU.cjs +0 -15
  112. package/dist/chunk-44J2TVZU.cjs.map +0 -1
  113. package/dist/chunk-7UL54E7X.cjs +0 -2
  114. package/dist/chunk-7UL54E7X.cjs.map +0 -1
  115. package/dist/chunk-A4OQQVQT.cjs +0 -3
  116. package/dist/chunk-A4OQQVQT.cjs.map +0 -1
  117. package/dist/chunk-FNBADTTI.cjs.map +0 -1
  118. package/dist/chunk-N7QF44VW.cjs +0 -2
  119. package/dist/chunk-N7QF44VW.cjs.map +0 -1
  120. package/dist/chunk-PQTI6C4Q.cjs +0 -12
  121. package/dist/chunk-PQTI6C4Q.cjs.map +0 -1
  122. package/dist/chunk-TD7ADMVO.cjs +0 -2
  123. package/dist/chunk-TD7ADMVO.cjs.map +0 -1
  124. package/dist/chunk-UONUI4AB.cjs +0 -2920
  125. package/dist/chunk-UONUI4AB.cjs.map +0 -1
  126. package/dist/chunk-XPKFB4IL.cjs +0 -2
  127. package/dist/chunk-XPKFB4IL.cjs.map +0 -1
  128. package/dist/chunk-YMXQXAUZ.cjs +0 -2
  129. package/dist/chunk-YMXQXAUZ.cjs.map +0 -1
  130. package/dist/impl-2BXBJZII.cjs +0 -2
  131. package/dist/impl-2BXBJZII.cjs.map +0 -1
  132. package/dist/impl-2SHN3CZX.cjs +0 -2
  133. package/dist/impl-2SHN3CZX.cjs.map +0 -1
  134. package/dist/impl-334G4VTL.cjs +0 -2
  135. package/dist/impl-334G4VTL.cjs.map +0 -1
  136. package/dist/impl-37NGCBEQ.cjs +0 -2
  137. package/dist/impl-37NGCBEQ.cjs.map +0 -1
  138. package/dist/impl-5IS3UVQQ.cjs +0 -2
  139. package/dist/impl-5IS3UVQQ.cjs.map +0 -1
  140. package/dist/impl-5IZQDLG7.cjs +0 -2
  141. package/dist/impl-5IZQDLG7.cjs.map +0 -1
  142. package/dist/impl-7MIPQI3E.cjs.map +0 -1
  143. package/dist/impl-AJMAFFJG.cjs +0 -2
  144. package/dist/impl-AJMAFFJG.cjs.map +0 -1
  145. package/dist/impl-BL64FHKY.cjs +0 -2
  146. package/dist/impl-BL64FHKY.cjs.map +0 -1
  147. package/dist/impl-BXNGIHN2.cjs +0 -4
  148. package/dist/impl-BXNGIHN2.cjs.map +0 -1
  149. package/dist/impl-DDHHIRXW.cjs +0 -12
  150. package/dist/impl-DDHHIRXW.cjs.map +0 -1
  151. package/dist/impl-DFDEITPV.cjs.map +0 -1
  152. package/dist/impl-DZSW2V2J.cjs +0 -2
  153. package/dist/impl-DZSW2V2J.cjs.map +0 -1
  154. package/dist/impl-FC7ICRDM.cjs +0 -2
  155. package/dist/impl-FC7ICRDM.cjs.map +0 -1
  156. package/dist/impl-G2MAA4QD.cjs +0 -2
  157. package/dist/impl-G2MAA4QD.cjs.map +0 -1
  158. package/dist/impl-GIZXIRD5.cjs +0 -2
  159. package/dist/impl-GIZXIRD5.cjs.map +0 -1
  160. package/dist/impl-H3RZXUMP.cjs +0 -2
  161. package/dist/impl-H3RZXUMP.cjs.map +0 -1
  162. package/dist/impl-HG3PK5DG.cjs +0 -2
  163. package/dist/impl-HG3PK5DG.cjs.map +0 -1
  164. package/dist/impl-IAZCCRHG.cjs +0 -2
  165. package/dist/impl-IAZCCRHG.cjs.map +0 -1
  166. package/dist/impl-K3VBUCUB.cjs +0 -2
  167. package/dist/impl-K3VBUCUB.cjs.map +0 -1
  168. package/dist/impl-KMLDAWB5.cjs +0 -6
  169. package/dist/impl-KMLDAWB5.cjs.map +0 -1
  170. package/dist/impl-LDJGDZNJ.cjs +0 -2
  171. package/dist/impl-LDJGDZNJ.cjs.map +0 -1
  172. package/dist/impl-LLCE3XUF.cjs +0 -6
  173. package/dist/impl-LLCE3XUF.cjs.map +0 -1
  174. package/dist/impl-MVGWE3OY.cjs +0 -2
  175. package/dist/impl-MVGWE3OY.cjs.map +0 -1
  176. package/dist/impl-N56GZUUE.cjs +0 -2
  177. package/dist/impl-N56GZUUE.cjs.map +0 -1
  178. package/dist/impl-NRVKZ6QP.cjs +0 -2
  179. package/dist/impl-NRVKZ6QP.cjs.map +0 -1
  180. package/dist/impl-O7M62JQO.cjs +0 -2
  181. package/dist/impl-O7M62JQO.cjs.map +0 -1
  182. package/dist/impl-OXCKKL3L.cjs.map +0 -1
  183. package/dist/impl-OYQLTGBY.cjs +0 -2
  184. package/dist/impl-OYQLTGBY.cjs.map +0 -1
  185. package/dist/impl-PNDNQD25.cjs +0 -2
  186. package/dist/impl-PNDNQD25.cjs.map +0 -1
  187. package/dist/impl-Q2JAFPV5.cjs +0 -2
  188. package/dist/impl-Q2JAFPV5.cjs.map +0 -1
  189. package/dist/impl-Q6LOHZB6.cjs +0 -2
  190. package/dist/impl-Q6LOHZB6.cjs.map +0 -1
  191. package/dist/impl-QS77O4PW.cjs +0 -2
  192. package/dist/impl-QS77O4PW.cjs.map +0 -1
  193. package/dist/impl-TC6DE6BU.cjs.map +0 -1
  194. package/dist/impl-W6WGF5YD.cjs +0 -3
  195. package/dist/impl-W6WGF5YD.cjs.map +0 -1
  196. package/dist/impl-WHZWURMO.cjs +0 -2
  197. package/dist/impl-WHZWURMO.cjs.map +0 -1
  198. package/dist/impl-WWQBCKZV.cjs.map +0 -1
  199. package/dist/impl-XWRII7ET.cjs +0 -2
  200. package/dist/impl-XWRII7ET.cjs.map +0 -1
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkUONUI4ABcjs = require('./chunk-UONUI4AB.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXPKFB4ILcjs = require('./chunk-XPKFB4IL.cjs');var _chunk44J2TVZUcjs = require('./chunk-44J2TVZU.cjs');var _typeutils = require('@transcend-io/type-utils');var _internationalization = require('@transcend-io/internationalization');var _privacytypes = require('@transcend-io/privacy-types');var _iots = require('io-ts'); var R = _interopRequireWildcard(_iots); var te = _interopRequireWildcard(_iots); var at = _interopRequireWildcard(_iots); var P = _interopRequireWildcard(_iots); var q = _interopRequireWildcard(_iots); var C = _interopRequireWildcard(_iots); var fe = _interopRequireWildcard(_iots); var Ot = _interopRequireWildcard(_iots); var V = _interopRequireWildcard(_iots);var T="[NONE]",me= exports.b ="[APPLY VALUE TO ALL ROWS]",Pe= exports.c ="<blank>",Se= exports.d =["email","coreIdentifier"],ie= exports.e =(c=>(c.Email="email",c.CoreIdentifier="coreIdentifier",c.RequestType="requestType",c.SubjectType="subjectType",c.Locale="locale",c.Country="country",c.CountrySubDivision="countrySubDivision",c.RequestStatus="requestStatus",c.CreatedAt="createdAt",c.DataSiloIds="dataSiloIds",c))(ie||{}),He= exports.f ={email:!1,coreIdentifier:!0,requestType:!0,subjectType:!0,requestStatus:!1,createdAt:!1,dataSiloIds:!1,locale:!1,country:!1,countrySubDivision:!1},Xe= exports.g ={requestType:!0,subjectType:!0},et= exports.h =R.type({columnNames:R.partial(_typeutils.applyEnum.call(void 0, ie,()=>R.string)),identifierNames:R.record(R.string,R.string),attributeNames:R.record(R.string,R.string),requestTypeToRequestAction:R.record(R.string,_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction)),subjectTypeToSubjectName:R.record(R.string,R.string),languageToLocale:R.record(R.string,_typeutils.valuesOf.call(void 0, _internationalization.LanguageKey)),regionToCountry:R.record(R.string,_typeutils.valuesOf.call(void 0, {..._privacytypes.IsoCountryCode,[T]:T})),regionToCountrySubDivision:R.record(R.string,_typeutils.valuesOf.call(void 0, {..._privacytypes.IsoCountrySubdivisionCode,[T]:T})),statusToRequestStatus:R.record(R.string,_typeutils.valuesOf.call(void 0, {..._privacytypes.CompletedRequestStatus,[T]:T}))}),be= exports.i =R.type({id:R.string,link:R.string,rowIndex:R.number,coreIdentifier:R.string,attemptedAt:R.string}),tt= exports.j =R.type({failingRequests:R.array(R.record(R.string,R.any)),successfulRequests:R.array(be),duplicateRequests:R.array(R.type({rowIndex:R.number,coreIdentifier:R.string,attemptedAt:R.string}))});var _inquirer = require('inquirer'); var _inquirer2 = _interopRequireDefault(_inquirer);var _fuzzysearch = require('fuzzysearch'); var _fuzzysearch2 = _interopRequireDefault(_fuzzysearch);function Te(n,e){return _fuzzysearch2.default.call(void 0, n.toLowerCase(),e.toLowerCase())||_fuzzysearch2.default.call(void 0, e.toLowerCase(),n.toLowerCase())}function ne(n,e,s,l){let a=n.filter(o=>Te(e.toLowerCase(),o.toLowerCase()));return[...a,new _inquirer2.default.Separator,...s?[]:[T],...l?[me]:[],...n.filter(o=>!a.includes(o))]}var _inquirerautocompleteprompt = require('inquirer-autocomplete-prompt'); var _inquirerautocompleteprompt2 = _interopRequireDefault(_inquirerautocompleteprompt);async function ee(n,e,s){_inquirer2.default.registerPrompt("autocomplete",_inquirerautocompleteprompt2.default);let l=n.map(o=>o||"<blank>").filter(o=>!s[o]);if(l.length===0)return s;let a=await _inquirer2.default.prompt(l.map(o=>({name:o,message:`Map value of: ${o}`,type:"autocomplete",default:e.find(i=>Te(o,i)),source:(i,r)=>r?e.filter(t=>typeof t=="string"&&Te(r,t)):e})));return{...s,..._typeutils.apply.call(void 0, a,o=>typeof o=="string"?o:Object.values(o)[0])}}function De(n){return n.split(",").map(e=>e.trim()).filter(e=>e)}var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var it=te.type({key:te.string,values:te.array(te.string)});function nt(n){let e=n.map(s=>{let[l,a]=s.trim().split(":");if(!a)throw new Error("Expected attributes in key:value1;value2,key2:value3;value4");let o=a.split(";");return{key:l,values:o}});return _chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Attributes to apply to all requests:")),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(JSON.stringify(e,null,2))),e}var _sync = require('csv-parse/sync');var _fs = require('fs');function ut(n,e,s={columns:!0}){let l=_sync.parse.call(void 0, _fs.readFileSync.call(void 0, n,"utf-8"),s);return _typeutils.decodeCodec.call(void 0, at.array(e),l).map(i=>Object.entries(i).reduce((r,[t,y])=>Object.assign(r,{[t.replace(/[^a-z_.+\-A-Z -~]/g,"")]:y}),{}))}function Q(n,e){return _chunk44J2TVZUcjs.j.call(void 0, n.map(s=>s[e]||"").flat())}async function ct(n){let e=_chunk44J2TVZUcjs.j.call(void 0, n.map(a=>Object.keys(a)).flat()),s=n,l=!0;for(;l;){let{filterColumnName:a}=await _inquirer2.default.prompt([{name:"filterColumnName",message:`If you need to filter the list of requests to import, choose the column to filter on. Currently ${s.length} rows.`,type:"list",default:e,choices:[T,...e]}]);if(l=T!==a,l){let o=Q(s,a),{valuesToKeep:i}=await _inquirer2.default.prompt([{name:"valuesToKeep",message:"Keep rows matching this value",type:"checkbox",default:e,choices:o}]);s=s.filter(r=>i.includes(r[a]))}}return _chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Importing ${s.length} requests`)),s}var _bluebird = require('bluebird');var _cliprogress = require('cli-progress'); var _cliprogress2 = _interopRequireDefault(_cliprogress);async function so({requestActions:n,auth:e,requestIds:s,statuses:l=[_privacytypes.RequestStatus.Compiling,_privacytypes.RequestStatus.RequestMade,_privacytypes.RequestStatus.Delayed,_privacytypes.RequestStatus.Approving,_privacytypes.RequestStatus.Secondary,_privacytypes.RequestStatus.Enriching,_privacytypes.RequestStatus.Waiting,_privacytypes.RequestStatus.SecondaryApproving],createdAtAfter:a,createdAtBefore:o,concurrency:i=100,transcendUrl:r=_chunkXPKFB4ILcjs.e}){let t=_chunkUONUI4ABcjs.Ud.call(void 0, r,e),y=new Date().getTime(),c=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),g=await _chunkUONUI4ABcjs.le.call(void 0, t,{actions:n,statuses:l,createdAtBefore:o,createdAtAfter:a,isSilent:!1,requestIds:s});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Marking "${g.length}" as silent mode.`));let m=0;c.start(g.length,0),await _bluebird.map.call(void 0, g,async f=>{await _chunkUONUI4ABcjs.ac.call(void 0, t,_chunkUONUI4ABcjs.Y,{input:{id:f.id,isSilent:!0}}),m+=1,c.update(m)},{concurrency:i}),c.stop();let p=new Date().getTime()-y;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully marked ${m} requests as silent mode in "${p/1e3}" seconds!`)),g.length}async function ft(n,e){let s=_typeutils.getValues.call(void 0, ie).filter(a=>!e.getValue("columnNames",a)),l=s.length===0?{}:await _inquirer2.default.prompt(s.map(a=>{let o=_chunk44J2TVZUcjs.h.call(void 0, a.replace("ColumnName","")),i=ne(n,o,He[a],!!Xe[a]);return{name:a,message:`Choose the column that will be used to map in the field: ${o}`,type:"list",default:i[0],choices:i}}));return await Promise.all(_typeutils.getEntries.call(void 0, l).map(([a,o])=>e.setValue(o,"columnNames",a))),l}async function dt(n,e,{state:s,columnNameMap:l}){let a=f=>s.getValue("columnNames",f)||l[f],{internalSubjects:o}=await _chunkUONUI4ABcjs.ac.call(void 0, n,_chunkUONUI4ABcjs.w);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for request action"));let i=await ee(Q(e,a("requestType")),Object.values(_privacytypes.RequestAction),s.getValue("requestTypeToRequestAction"));await s.setValue(i,"requestTypeToRequestAction"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for subject"));let r=await ee(Q(e,a("subjectType")),o.map(({type:f})=>f),s.getValue("subjectTypeToSubjectName"));await s.setValue(r,"subjectTypeToSubjectName"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for locale"));let t=await ee(Q(e,a("locale")),Object.values(_internationalization.LanguageKey),s.getValue("languageToLocale"));await s.setValue(t,"languageToLocale"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for request status")),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for request status"));let y=a("requestStatus"),c=y===T?{}:await ee(Q(e,y),[...Object.values(_privacytypes.CompletedRequestStatus),T],s.getValue("statusToRequestStatus"));await s.setValue(c,"statusToRequestStatus"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for country"));let g=a("country"),m=g===T?{}:await ee(Q(e,g),[...Object.values(_privacytypes.IsoCountryCode),T],s.getValue("regionToCountry"));await s.setValue(m,"regionToCountry"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for country sub division"));let d=a("countrySubDivision"),p=d===T?{}:await ee(Q(e,d),[...Object.values(_privacytypes.IsoCountrySubdivisionCode),T],s.getValue("regionToCountrySubDivision"));await s.setValue(p,"regionToCountrySubDivision")}var _iotstypes = require('io-ts-types');var Pr=P.record(P.string,P.array(P.intersection([P.type({value:P.string}),P.partial({name:P.string})]))),Lo= exports.x =P.intersection([P.type({email:P.string,attestedExtraIdentifiers:Pr,coreIdentifier:P.string,requestType:_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction),subjectType:P.string}),P.partial({country:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountryCode),countrySubDivision:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountrySubdivisionCode),attributes:P.array(it),status:_typeutils.valuesOf.call(void 0, _privacytypes.CompletedRequestStatus),createdAt:_iotstypes.DateFromISOString,dataSiloIds:P.array(P.string),locale:_typeutils.valuesOf.call(void 0, _internationalization.LanguageKey)})]);function Dr(n,e,s){if(e===_privacytypes.IdentifierType.Email)return n.toLowerCase();if(e===_privacytypes.IdentifierType.Phone){let l=n.replace(_privacytypes.NORMALIZE_PHONE_NUMBER,"").replace(/[()]/g,"").replace(/[–]/g,"").replace(/[:]/g,"").replace(/[‭‬]/g,"").replace(/[A-Za-z]/g,"");return l?l.startsWith("+")?l:`+${s}${l}`:""}return n}function gt(n,e,{columnNameMap:s,identifierNameMap:l,attributeNameMap:a,requestAttributeKeys:o,defaultPhoneCountryCode:i="1"}){let r=t=>e.getValue("columnNames",t)||s[t];return n.map(t=>{let y={};Object.entries(l).filter(([,d])=>d!==T).forEach(([d,p])=>{let f=Object.values(_privacytypes.IdentifierType).includes(d)?d:_privacytypes.IdentifierType.Custom,h=t[p];if(h){let S=Dr(h,f,i);S&&(y[f]||(y[f]=[]),y[f].push({value:S,name:d}))}});let c=[];Object.entries(a).filter(([,d])=>d!==T).forEach(([d,p])=>{let f=t[p];if(f){let h=_optionalChain([o, 'access', _2 => _2.find, 'call', _3 => _3(S=>S.name===d), 'optionalAccess', _4 => _4.type])==="MULTI_SELECT";c.push({values:h?De(f):f,key:d})}});let g=r("requestType"),m=r("subjectType");return[t,{email:t[r("email")],attestedExtraIdentifiers:y,attributes:c,coreIdentifier:t[r("coreIdentifier")],requestType:g===me?e.getValue("requestTypeToRequestAction",Pe):e.getValue("requestTypeToRequestAction",t[g]),subjectType:m===me?e.getValue("subjectTypeToSubjectName",Pe):e.getValue("subjectTypeToSubjectName",t[m]),...r("locale")!==T&&t[r("locale")]?{locale:e.getValue("languageToLocale",t[r("locale")])}:{},...r("country")!==T&&t[r("country")]?{country:e.getValue("regionToCountry",t[r("country")])}:{},...r("countrySubDivision")!==T&&t[r("countrySubDivision")]?{countrySubDivision:e.getValue("regionToCountrySubDivision",t[r("countrySubDivision")])}:{},...r("requestStatus")!==T&&e.getValue("statusToRequestStatus",t[r("requestStatus")])!==T&&t[r("requestStatus")]?{status:e.getValue("statusToRequestStatus",t[r("requestStatus")])}:{},...r("createdAt")!==T&&t[r("createdAt")]?{createdAt:new Date(t[r("createdAt")])}:{},...r("dataSiloIds")!==T&&t[r("dataSiloIds")]?{dataSiloIds:De(t[r("dataSiloIds")])}:{}}]})}var Rt=q.type({defaultMessage:q.string,id:q.string}),Lr= exports.B =q.type({downloadKey:q.string,error:q.union([q.null,q.string]),mimetype:q.string,size:q.string,fileName:q.string,dataPoint:q.type({id:q.string,title:q.union([Rt,q.null]),description:q.union([Rt,q.null]),name:q.string,slug:q.string,encryption:q.union([_typeutils.valuesOf.call(void 0, _privacytypes.TableEncryptionType),q.null]),dataSilo:q.type({id:q.string,title:q.string,description:q.string,type:q.string,outerType:q.union([q.string,q.null])}),path:q.array(q.string)})}),$r= exports.C =q.type({nodes:q.array(Lr),totalCount:q.number,_links:q.partial({next:q.union([q.string,q.null]),previous:q.union([q.string,q.null])})});async function ht(n,{sombra:e,concurrency:s=5,limit:l=100}){_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling file metadata for ${n.length} requests`));let a=new Date().getTime(),o=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),i=0;o.start(n.length,0);let r=await _bluebird.map.call(void 0, n,async c=>{let g=[],m=!0,d=0;for(;m;){let p;try{let f=await e.get(`v1/data-subject-request/${c.id}/download-keys`,{searchParams:{limit:l,offset:d}}).json();p=_typeutils.decodeCodec.call(void 0, $r,f),g.push(...p.nodes),d+=l,m=!!p._links.next&&p.nodes.length===l}catch(f){throw new Error(`Received an error from server: ${_optionalChain([f, 'optionalAccess', _5 => _5.response, 'optionalAccess', _6 => _6.body])||_optionalChain([f, 'optionalAccess', _7 => _7.message])}`)}}return i+=1,o.update(i),[c,g]},{concurrency:s});o.stop();let y=new Date().getTime()-a;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully downloaded file metadata ${n.length} requests in "${y/1e3}" seconds!`)),r}async function St(n,{requestId:e,sombra:s,onFileDownloaded:l,concurrency:a=20}){await _bluebird.map.call(void 0, n,async o=>{try{await s.get("v1/files",{searchParams:{downloadKey:o.downloadKey}}).buffer().then(i=>l(o,i))}catch(i){if(_optionalChain([i, 'optionalAccess', _8 => _8.response, 'optionalAccess', _9 => _9.body, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11("fileMetadata#verify")])){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to pull file for: ${o.fileName} (request:${e}) - JWT expired. This likely means that the file is no longer available. Try restarting the request from scratch in Transcend Admin Dashboard. Skipping the download of this file.`));return}throw new Error(`Received an error from server: ${_optionalChain([i, 'optionalAccess', _12 => _12.response, 'optionalAccess', _13 => _13.body])||_optionalChain([i, 'optionalAccess', _14 => _14.message])}`)}},{concurrency:a})}var _path = require('path');async function si({auth:n,folderPath:e,requestIds:s,createdAtBefore:l,sombraAuth:a,createdAtAfter:o,statuses:i=[_privacytypes.RequestStatus.Approving,_privacytypes.RequestStatus.Downloadable],concurrency:r=5,transcendUrl:t=_chunkXPKFB4ILcjs.e,approveAfterDownload:y=!1}){let c=_chunkUONUI4ABcjs.Ud.call(void 0, t,n),g=await _chunkUONUI4ABcjs.Vd.call(void 0, t,n,a);_fs.existsSync.call(void 0, e)||_fs.mkdirSync.call(void 0, e);let m=await _chunkUONUI4ABcjs.le.call(void 0, c,{actions:[_privacytypes.RequestAction.Access],createdAtBefore:l,createdAtAfter:o,statuses:i,requestIds:s}),d=await ht(m,{sombra:g,concurrency:r}),p=new Date().getTime(),f=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),h=0,S=0;f.start(m.length,0),await _bluebird.map.call(void 0, d,async([E,N])=>{let G=_path.join.call(void 0, e,E.id);_fs.existsSync.call(void 0, G)||_fs.mkdirSync.call(void 0, G),await St(N,{sombra:g,requestId:E.id,onFileDownloaded:(L,F)=>{let K=_path.join.call(void 0, G,L.fileName),O=_path.dirname.call(void 0, K);_fs.existsSync.call(void 0, O)||_fs.mkdirSync.call(void 0, O,{recursive:!0}),_fs.writeFileSync.call(void 0, K,F)}}),y&&E.status===_privacytypes.RequestStatus.Approving&&(await _chunkUONUI4ABcjs.ac.call(void 0, c,_chunkUONUI4ABcjs.W,{input:{requestId:E.id}}),S+=1),h+=1,f.update(h)},{concurrency:r}),f.stop();let b=new Date().getTime()-p;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully downloaded ${h} requests in "${b/1e3}" seconds!`)),S>0&&_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Approved ${S} requests in Transcend.`)),m.length}var xe=C.type({id:C.string,link:C.string,status:_typeutils.valuesOf.call(void 0, _privacytypes.RequestStatus),type:_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction),subjectType:C.string,email:C.union([C.null,C.string]),coreIdentifier:C.string,isSilent:C.boolean,isTest:C.boolean,country:C.union([C.null,_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountryCode)]),countrySubDivision:C.union([C.null,_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountrySubdivisionCode)]),attributeValues:C.array(C.type({attributeKey:C.type({name:C.string}),name:C.string}))});async function wt(n,e,{details:s="",isTest:l=!1,emailIsVerified:a=!0,skipSendingReceipt:o=!1,isSilent:i=!0,additionalAttributes:r=[]}={}){let t=[...r];(e.attributes||[]).forEach(g=>{let m=t.find(d=>d.key===g.key);m?(m.values.push(...g.values),m.values=_chunk44J2TVZUcjs.j.call(void 0, m.values)):t.push(g)});let y;try{y=await n.post("v1/data-subject-request",{json:{type:e.requestType,subject:{coreIdentifier:e.coreIdentifier,email:e.email,emailIsVerified:a,attestedExtraIdentifiers:e.attestedExtraIdentifiers},subjectType:e.subjectType,isSilent:i,isTest:l,skipSendingReceipt:o,...e.locale?{locale:e.locale}:{},details:s,attributes:t,...e.country||e.countrySubDivision?{region:{...e.country?{country:e.country}:e.countrySubDivision?{country:e.countrySubDivision.split("-")[0]}:{},...e.countrySubDivision?{countrySubDivision:e.countrySubDivision}:{}}}:{},...e.createdAt?{createdAt:e.createdAt}:{},...e.dataSiloIds?{dataSiloIds:e.dataSiloIds}:{},...e.status?{completedRequestStatus:e.status}:{}}}).json()}catch(g){throw new Error(`Received an error from server: ${_optionalChain([g, 'optionalAccess', _15 => _15.response, 'optionalAccess', _16 => _16.body])||_optionalChain([g, 'optionalAccess', _17 => _17.message])}`)}let{request:c}=_typeutils.decodeCodec.call(void 0, C.type({request:xe}),y);return c}async function Ri({requestActions:n,requestOrigins:e,auth:s,silentModeBefore:l,createdAtAfter:a,createdAtBefore:o,concurrency:i=50,transcendUrl:r=_chunkXPKFB4ILcjs.e}){let t=_chunkUONUI4ABcjs.Ud.call(void 0, r,s),y=new Date().getTime(),c=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),g=await _chunkUONUI4ABcjs.le.call(void 0, t,{actions:n,statuses:[_privacytypes.RequestStatus.Approving],createdAtAfter:a,origins:e,createdAtBefore:o});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Approving "${g.length}" requests.`));let m=0,d=0;c.start(g.length,0),await _bluebird.map.call(void 0, g,async h=>{l&&new Date(l)>new Date(h.createdAt)&&await _chunkUONUI4ABcjs.ac.call(void 0, t,_chunkUONUI4ABcjs.Y,{input:{id:h.id,isSilent:!0}});try{await _chunkUONUI4ABcjs.ac.call(void 0, t,_chunkUONUI4ABcjs.W,{input:{requestId:h.id}})}catch(S){S.message.includes("Request must be in an approving state,")&&(d+=1)}m+=1,c.update(m)},{concurrency:i}),c.stop();let f=new Date().getTime()-y;return d>0&&_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`${d} requests were skipped.`)),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully approved ${m} requests in "${f/1e3}" seconds!`)),g.length}async function Pi({requestActions:n=Object.values(_privacytypes.RequestAction),auth:e,requestIds:s,createdAtBefore:l,days:a=45,daysLeft:o=10,createdAtAfter:i,emailTemplate:r="Additional Time Needed",concurrency:t=100,transcendUrl:y=_chunkXPKFB4ILcjs.e}){let c=_chunkUONUI4ABcjs.Ud.call(void 0, y,e),g=new Date().getTime(),m=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),p=(await _chunkUONUI4ABcjs.fd.call(void 0, c,r)).find(b=>b.title===r);if(!p)throw new Error(`Failed to find a template with title: "${r}"`);let f=await _chunkUONUI4ABcjs.le.call(void 0, c,{actions:n,createdAtBefore:l,createdAtAfter:i,isSilent:!1,isClosed:!1,requestIds:s});f=f.filter(b=>typeof b.daysRemaining=="number"&&b.daysRemaining<o),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Notifying "${f.length}" that more time is needed.`));let h=0;m.start(f.length,0),await _bluebird.map.call(void 0, f,async b=>{await _chunkUONUI4ABcjs.ac.call(void 0, c,_chunkUONUI4ABcjs.Z,{input:{requestId:b.id,template:p.template.defaultMessage,subject:p.subject.defaultMessage,additionalTime:a}}),h+=1,m.update(h)},{concurrency:t}),m.stop();let v=new Date().getTime()-g;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully marked ${h} requests as silent mode in "${v/1e3}" seconds!`)),f.length}async function Dt(n,e,s){let{initializer:l}=await _chunkUONUI4ABcjs.ac.call(void 0, n,_chunkUONUI4ABcjs.o),a=l.identifiers.filter(({name:i})=>!s.getValue("identifierNames",i)&&!Se.includes(i)),o=a.length===0?{}:await _inquirer2.default.prompt(a.map(({name:i})=>{let r=ne(e,i,!1);return{name:i,message:`Choose the column that will be used to map in the identifier: ${i}`,type:"list",default:r[0],choices:r}}));return await Promise.all(Object.entries(o).map(([i,r])=>s.setValue(r,"identifierNames",i))),{...s.getValue("identifierNames"),...o}}async function Gi({requestActions:n,cancellationTitle:e,auth:s,requestIds:l,silentModeBefore:a,createdAtBefore:o,createdAtAfter:i,statuses:r=[_privacytypes.RequestStatus.Compiling,_privacytypes.RequestStatus.RequestMade,_privacytypes.RequestStatus.Delayed,_privacytypes.RequestStatus.Approving,_privacytypes.RequestStatus.Secondary,_privacytypes.RequestStatus.Enriching,_privacytypes.RequestStatus.Waiting,_privacytypes.RequestStatus.SecondaryApproving],concurrency:t=50,transcendUrl:y=_chunkXPKFB4ILcjs.e}){let c=_chunkUONUI4ABcjs.Ud.call(void 0, y,s),g=new Date().getTime(),m=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),d;if(e){let b=(await _chunkUONUI4ABcjs.fd.call(void 0, c,e)).find(E=>E.title===e);if(!b)throw new Error(`Failed to find a template with title: "${e}"`);d=b}let p=await _chunkUONUI4ABcjs.le.call(void 0, c,{actions:n,createdAtBefore:o,createdAtAfter:i,statuses:r,requestIds:l});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Canceling "${p.length}" requests${d?` Using template: ${d.title}`:""}.`));let f=0;m.start(p.length,0),await _bluebird.map.call(void 0, p,async v=>{a&&new Date(a)>new Date(v.createdAt)&&await _chunkUONUI4ABcjs.ac.call(void 0, c,_chunkUONUI4ABcjs.Y,{input:{id:v.id,isSilent:!0}}),await _chunkUONUI4ABcjs.ac.call(void 0, c,_chunkUONUI4ABcjs.X,{input:{requestId:v.id,...d?{subject:`Re: ${d.subject.defaultMessage}`,template:d.template.defaultMessage}:{}}}),f+=1,m.update(f)},{concurrency:t}),m.stop();let S=new Date().getTime()-g;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully canceled ${f} requests in "${S/1e3}" seconds!`)),p.length}async function Nt(n,e,s,l){let a=l.filter(({name:i})=>!s.getValue("attributeNames",i)),o=a.length===0?{}:await _inquirer2.default.prompt(a.map(({name:i})=>{let r=ne(e,i,!1);return{name:i,message:`Choose the column that will be used to map in the attribute: ${i}`,type:"list",default:r[0],choices:r}}));return await Promise.all(Object.entries(o).map(([i,r])=>s.setValue(r,"attributeNames",i))),{...s.getValue("attributeNames"),...o}}var xt=/{\\"message\\":\\"(.+?)\\",/;function Ce(n){return xt.test(n)?xt.exec(n)[1]:null}var _persistedstate = require('@transcend-io/persisted-state');async function Rn({cacheFilepath:n,requestReceiptFolder:e,file:s,auth:l,sombraAuth:a,concurrency:o=100,defaultPhoneCountryCode:i="1",transcendUrl:r=_chunkXPKFB4ILcjs.e,attributes:t=[],emailIsVerified:y=!0,skipFilterStep:c=!1,skipSendingReceipt:g=!0,isTest:m=!1,isSilent:d=!0,debug:p=!1,dryRun:f=!1}){let h=new Date().getTime(),S=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),v=nt(t),b=new (0, _persistedstate.PersistedState)(n,et,{columnNames:{},requestTypeToRequestAction:{},subjectTypeToSubjectName:{},languageToLocale:{},statusToRequestStatus:{},identifierNames:{},attributeNames:{},regionToCountrySubDivision:{},regionToCountry:{}}),E=_path.join.call(void 0, e,`tr-request-upload-${new Date().toISOString()}-${s.split("/").pop()}`.replace(".csv",".json")),N=new (0, _persistedstate.PersistedState)(E,tt,{successfulRequests:[],duplicateRequests:[],failingRequests:[]}),G=await _chunkUONUI4ABcjs.Vd.call(void 0, r,l,a),L=ut(s,fe.record(fe.string,fe.string)),F=_chunk44J2TVZUcjs.j.call(void 0, L.map(B=>Object.keys(B)).flat());if(L.length===0)throw new Error("No Requests found in list! Ensure the first row of the CSV is a header and the rest are requests.");if(p){let B=L[0];_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`First request: ${JSON.stringify(B,null,2)}`))}let K=c?L:await ct(L),O=_chunkUONUI4ABcjs.Ud.call(void 0, r,l),x=await _chunkUONUI4ABcjs.ae.call(void 0, O),M=await ft(F,b),z=await Dt(O,F,b),_=await Nt(O,F,b,x);await dt(O,K,{state:b,columnNameMap:M});let $=gt(K,b,{defaultPhoneCountryCode:i,columnNameMap:M,identifierNameMap:z,attributeNameMap:_,requestAttributeKeys:x});p||S.start($.length,0);let H=0;await _bluebird.map.call(void 0, $,async([B,k],U)=>{let Fe=p?`email:${k.email} | coreIdentifier:${k.coreIdentifier}`:`row:${U.toString()}`;if(p&&_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`[${U+1}/${$.length}] Importing: ${JSON.stringify(k,null,2)}`)),f){_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Bailing out on dry run because dryRun is set"));return}try{let X=await wt(G,k,{details:`Uploaded by Transcend Cli: "tr-request-upload" : ${JSON.stringify(B,null,2)}`,isTest:m,emailIsVerified:y,skipSendingReceipt:g,isSilent:d,additionalAttributes:v});p&&(_chunkZUNVPK23cjs.a.info(_colors2.default.green(`[${U+1}/${$.length}] Successfully submitted the test data subject request: "${Fe}"`)),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`[${U+1}/${$.length}] View it at: "${X.link}"`)));let se=N.getValue("successfulRequests");se.push({id:X.id,link:X.link,rowIndex:U,coreIdentifier:X.coreIdentifier,attemptedAt:new Date().toISOString()}),await N.setValue(se,"successfulRequests")}catch(X){let se=`${X.message} - ${JSON.stringify(_optionalChain([X, 'access', _18 => _18.response, 'optionalAccess', _19 => _19.body]),null,2)}`,Ie=Ce(se);if(Ie==="Client error: You have already made this request."){p&&_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`[${U+1}/${$.length}] Skipping request as it is a duplicate`));let ue=N.getValue("duplicateRequests");ue.push({coreIdentifier:k.coreIdentifier,rowIndex:U,attemptedAt:new Date().toISOString()}),await N.setValue(ue,"duplicateRequests")}else{let ue=N.getValue("failingRequests");ue.push({...k,rowIndex:U,error:Ie||se,attemptedAt:new Date().toISOString()}),await N.setValue(ue,"failingRequests"),p&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(Ie||se)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(`[${U+1}/${$.length}] Failed to submit request for: "${Fe}"`)))}}H+=1,p||S.update(H)},{concurrency:o}),S.stop();let ae=new Date().getTime()-h;_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Completed upload in "${ae/1e3}" seconds.`)),N.getValue("duplicateRequests").length>0&&_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`Encountered "${N.getValue("duplicateRequests").length}" duplicate requests. See "${E}" to review the core identifiers for these requests.`)),N.getValue("failingRequests").length>0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Encountered "${N.getValue("failingRequests").length}" errors. See "${E}" to review the error messages and inputs.`)),process.exit(1))}async function jt(n,e,{sendEmailReceipt:s=!1,skipWaitingPeriod:l=!1,emailIsVerified:a=!0,requestIdentifiers:o=[]}={}){let i=await n.post("v1/data-subject-request",{json:{type:e.type,subject:{coreIdentifier:e.coreIdentifier,email:e.email,emailIsVerified:a,...o.length>0?{attestedExtraIdentifiers:_typeutils.apply.call(void 0, _chunk44J2TVZUcjs.d.call(void 0, o.filter(t=>!(t.name==="email"&&t.value===e.email)&&!Se.includes(t.name)).map(t=>({...t,type:Object.values(_privacytypes.IdentifierType).includes(t.name)?t.name:_privacytypes.IdentifierType.Custom})),"type"),(t,y)=>t.map(({name:c,value:g})=>({...y===_privacytypes.IdentifierType.Custom?{name:c}:{},value:g})))}:{}},requestId:e.id,subjectType:e.subjectType,isSilent:e.isSilent,isTest:e.isTest,locale:e.locale,skipWaitingPeriod:l,createdAt:e.createdAt,details:`Restarted by Transcend cli: "tr-request-restart" - ${e.details}`,skipSendingReceipt:!s}}).json(),{request:r}=_typeutils.decodeCodec.call(void 0, Ot.type({request:xe}),i);return r}var ns=V.intersection([be,V.type({error:V.string})]),as=V.type({restartedRequests:V.array(be),failingRequests:V.array(ns)});async function _n({requestReceiptFolder:n,auth:e,sombraAuth:s,requestActions:l,requestStatuses:a,createdAtBefore:o,createdAtAfter:i,transcendUrl:r=_chunkXPKFB4ILcjs.e,requestIds:t=[],createdAt:y=new Date,silentModeBefore:c,sendEmailReceipt:g=!1,emailIsVerified:m=!0,copyIdentifiers:d=!1,skipWaitingPeriod:p=!1,concurrency:f=20}){let h=new Date().getTime(),S=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),v=_path.join.call(void 0, n,`tr-request-restart-${new Date().toISOString()}`),b=new (0, _persistedstate.PersistedState)(v,as,{restartedRequests:[],failingRequests:[]}),E=await _chunkUONUI4ABcjs.Vd.call(void 0, r,e,s),N=_chunkUONUI4ABcjs.Ud.call(void 0, r,e),L=(await _chunkUONUI4ABcjs.le.call(void 0, N,{actions:l,statuses:a,createdAtBefore:o,createdAtAfter:i})).filter(x=>new Date(x.createdAt)<y);if(_chunkZUNVPK23cjs.a.info(`Found ${L.length} requests to process`),d&&_chunkZUNVPK23cjs.a.info("copyIdentifiers detected - All Identifiers will be copied."),g&&_chunkZUNVPK23cjs.a.info("sendEmailReceipt detected - Email receipts will be sent."),p&&_chunkZUNVPK23cjs.a.info("skipWaitingPeriod detected - Waiting period will be skipped."),t.length>0&&t.length!==L.length){let x=_chunk44J2TVZUcjs.c.call(void 0, t,L.map(({id:M})=>M));x.length>0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to find the following requests by ID: ${x.join(",")}.`)),process.exit(1))}let F=0;S.start(L.length,0),await _bluebird.map.call(void 0, L,async(x,M)=>{try{let z=d?await _chunkUONUI4ABcjs.je.call(void 0, N,E,{requestId:x.id}):[],_=await jt(E,{...x,isSilent:c&&new Date(x.createdAt)<c?!0:x.isSilent},{requestIdentifiers:z,skipWaitingPeriod:p,sendEmailReceipt:g,emailIsVerified:m}),$=b.getValue("restartedRequests");$.push({id:_.id,link:_.link,rowIndex:M,coreIdentifier:_.coreIdentifier,attemptedAt:new Date().toISOString()}),await b.setValue($,"restartedRequests")}catch(z){let _=`${z.message} - ${JSON.stringify(_optionalChain([z, 'access', _20 => _20.response, 'optionalAccess', _21 => _21.body]),null,2)}`,$=Ce(_),H=b.getValue("failingRequests");H.push({id:x.id,link:x.link,rowIndex:M,coreIdentifier:x.coreIdentifier,attemptedAt:new Date().toISOString(),error:$||_}),await b.setValue(H,"failingRequests")}F+=1,S.update(F)},{concurrency:f}),S.stop();let O=new Date().getTime()-h;_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Completed restarting of requests in "${O/1e3}" seconds.`)),b.getValue("failingRequests").length>0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Encountered "${b.getValue("failingRequests").length}" errors. See "${v}" to review the error messages and inputs.`)),process.exit(1))}async function zn({enricherIds:n,auth:e,concurrency:s=100,transcendUrl:l=_chunkXPKFB4ILcjs.e}){let a=_chunkUONUI4ABcjs.Ud.call(void 0, l,e),o=new Date().getTime(),i=await _chunkUONUI4ABcjs.le.call(void 0, a,{statuses:[_privacytypes.RequestStatus.Enriching]});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Processing enricher: "${n.join(",")}" fetched "${i.length}" in enriching status.`));let r=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),t=0;r.start(i.length,0);let y=0;await _bluebird.map.call(void 0, i,async m=>{let p=(await _chunkUONUI4ABcjs.ge.call(void 0, a,{requestId:m.id})).filter(f=>n.includes(f.enricher.id)&&![_privacytypes.RequestEnricherStatus.Resolved,_privacytypes.RequestEnricherStatus.Skipped].includes(f.status));p.length>0&&await _bluebird.mapSeries.call(void 0, p,async f=>{try{await _chunkUONUI4ABcjs.ac.call(void 0, a,_chunkUONUI4ABcjs.ca,{requestEnricherId:f.id}),y+=1}catch(h){if(!h.message.includes("Client error: Cannot skip Request enricher because it has already completed"))throw h}}),t+=1,r.update(t)},{concurrency:s}),r.stop();let g=new Date().getTime()-o;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully skipped "${y}" for "${i.length}" requests in "${g/1e3}" seconds!`)),i.length}async function oa({auth:n,requestActions:e=[],createdAtBefore:s,createdAtAfter:l,transcendUrl:a=_chunkXPKFB4ILcjs.e,requestEnricherStatuses:o=Object.values(_privacytypes.RequestEnricherStatus),requestIds:i=[],enricherId:r,concurrency:t=20}){let y=new Date().getTime(),c=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),g=_chunkUONUI4ABcjs.Ud.call(void 0, a,n);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Fetching requests to restart..."));let m=await _chunkUONUI4ABcjs.le.call(void 0, g,{actions:e,statuses:[_privacytypes.RequestStatus.Enriching],createdAtBefore:s,createdAtAfter:l,requestIds:i}),d=0;if(i.length>0&&i.length!==m.length){let S=_chunk44J2TVZUcjs.c.call(void 0, i,m.map(({id:v})=>v));S.length>0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to find the following requests by ID: ${S.join(",")}.`)),process.exit(1))}let p=0;c.start(m.length,0),await _bluebird.map.call(void 0, m,async S=>{let b=(await _chunkUONUI4ABcjs.ge.call(void 0, g,{requestId:S.id})).filter(E=>E.enricher.id===r&&o.includes(E.status));await _bluebird.map.call(void 0, b,async E=>{await _chunkUONUI4ABcjs.He.call(void 0, g,E.id),d+=1}),p+=1,c.update(p)},{concurrency:t}),c.stop();let h=new Date().getTime()-y;_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Completed restarting of ${m.length} requests and ${d} enrichers in "${h/1e3}" seconds.`))}async function da({requestActions:n,dataSiloId:e,auth:s,concurrency:l=20,transcendUrl:a=_chunkXPKFB4ILcjs.e}){let o=_chunkUONUI4ABcjs.Ud.call(void 0, a,s),i=new Date().getTime(),r=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),t=await _chunkUONUI4ABcjs.le.call(void 0, o,{actions:n,statuses:[_privacytypes.RequestStatus.Compiling,_privacytypes.RequestStatus.Approving]});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Retrying requests for Data Silo: "${e}", restarting "${t.length}" requests.`));let y=0,c=0;r.start(t.length,0),await _bluebird.map.call(void 0, t,async d=>{try{let p=await _chunkUONUI4ABcjs.re.call(void 0, o,{requestId:d.id,dataSiloId:e});await _chunkUONUI4ABcjs.ac.call(void 0, o,_chunkUONUI4ABcjs.va,{requestDataSiloId:p.id})}catch(p){if(!p.message.includes("Failed to find RequestDataSilo"))throw p;c+=1}y+=1,r.update(y)},{concurrency:l}),r.stop();let m=new Date().getTime()-i;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully notified Transcend in "${m/1e3}" seconds for ${y} requests, ${c} requests were skipped because data silo was not attached to the request!`)),t.length}async function wa({auth:n,sombraAuth:e,actions:s=[],statuses:l=[],identifierSearch:a,pageLimit:o=100,transcendUrl:i=_chunkXPKFB4ILcjs.e,createdAtBefore:r,createdAtAfter:t,isTest:y}){let c=_chunkUONUI4ABcjs.Ud.call(void 0, i,n),g=await _chunkUONUI4ABcjs.Vd.call(void 0, i,n,e),m="";r&&(m+=` before ${r.toISOString()}`),t&&(m+=`${m?", and":""} after ${t.toISOString()}`),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`${s.length>0?`Pulling requests of type "${s.join('" , "')}"`:"Pulling all requests"}${m}`));let d=await _chunkUONUI4ABcjs.le.call(void 0, c,{actions:s,text:a,statuses:l,createdAtBefore:r,createdAtAfter:t,isTest:y}),p=await _bluebird.map.call(void 0, d,async h=>{let S=await _chunkUONUI4ABcjs.je.call(void 0, c,g,{requestId:h.id});return{...h,requestIdentifiers:S}},{concurrency:o});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulled ${p.length} requests`));let f=p.map(({attributeValues:h,requestIdentifiers:S,id:v,email:b,type:E,status:N,subjectType:G,details:L,createdAt:F,country:K,locale:O,origin:x,countrySubDivision:M,isSilent:z,isTest:_,coreIdentifier:$,...H})=>({"Request ID":v,"Created At":F,Email:b,"Core Identifier":$,"Request Type":E,"Data Subject Type":G,Status:N,Country:K,"Country Sub Division":M,Details:L,Origin:x,"Silent Mode":z,"Is Test Request":_,Language:O,...H,...Object.entries(_chunk44J2TVZUcjs.d.call(void 0, h,"attributeKey.name")).reduce((de,[ae,B])=>Object.assign(de,{[ae]:B.map(({name:k})=>k).join(",")}),{}),...Object.entries(_chunk44J2TVZUcjs.d.call(void 0, S,"name")).reduce((de,[ae,B])=>Object.assign(de,{[ae]:B.map(({value:k})=>k).join(",")}),{})}));return{requestsWithRequestIdentifiers:p,requestsFormattedForCsv:f}}async function La({dataSiloId:n,auth:e,concurrency:s=100,status:l="SKIPPED",transcendUrl:a=_chunkXPKFB4ILcjs.e,requestStatuses:o=[_privacytypes.RequestStatus.Compiling,_privacytypes.RequestStatus.Secondary]}){let i=_chunkUONUI4ABcjs.Ud.call(void 0, a,e),r=new Date().getTime(),t=await _chunkUONUI4ABcjs.qe.call(void 0, i,{dataSiloId:n,requestStatuses:o});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Processing data silo: "${n}" marking "${t.length}" requests as skipped.`));let y=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),c=0;y.start(t.length,0),await _bluebird.map.call(void 0, t,async d=>{try{await _chunkUONUI4ABcjs.ac.call(void 0, i,_chunkUONUI4ABcjs.ua,{requestDataSiloId:d.id,status:l})}catch(p){if(!p.message.includes("Client error: Request must be active:"))throw p}c+=1,y.update(c)},{concurrency:s}),y.stop();let m=new Date().getTime()-r;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully skipped "${t.length}" requests in "${m/1e3}" seconds!`)),t.length}async function Ua({requestActions:n,identifierNames:e,auth:s,concurrency:l=20,transcendUrl:a=_chunkXPKFB4ILcjs.e}){let o=_chunkUONUI4ABcjs.Ud.call(void 0, a,s),i=new Date().getTime(),r=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),t=await _chunkUONUI4ABcjs.le.call(void 0, o,{actions:n,statuses:[_privacytypes.RequestStatus.Enriching]});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Fetched requests in preflight/enriching state."));let y=0,c=0;r.start(t.length,0),await _bluebird.map.call(void 0, t,async d=>{let f=(await _chunkUONUI4ABcjs.he.call(void 0, o,{requestId:d.id})).filter(({isVerifiedAtLeastOnce:h,name:S})=>h===!1&&e.includes(S)).map(({id:h})=>h);f.length>0&&(await _chunkUONUI4ABcjs.ac.call(void 0, o,_chunkUONUI4ABcjs.Aa,{input:{requestId:d.id,requestIdentifierIds:f}}),c+=f.length),y+=1,r.update(y)},{concurrency:l}),r.stop();let m=new Date().getTime()-i;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully cleared out unverified identifiers "${m/1e3}" seconds for ${y} requests, ${c} identifiers were cleared out!`)),t.length}exports.a = T; exports.b = me; exports.c = Pe; exports.d = Se; exports.e = ie; exports.f = He; exports.g = Xe; exports.h = et; exports.i = be; exports.j = tt; exports.k = Te; exports.l = ne; exports.m = ee; exports.n = De; exports.o = it; exports.p = nt; exports.q = ut; exports.r = Q; exports.s = ct; exports.t = so; exports.u = ft; exports.v = dt; exports.w = Pr; exports.x = Lo; exports.y = Dr; exports.z = gt; exports.A = Rt; exports.B = Lr; exports.C = $r; exports.D = ht; exports.E = St; exports.F = si; exports.G = xe; exports.H = wt; exports.I = Ri; exports.J = Pi; exports.K = Dt; exports.L = Gi; exports.M = Nt; exports.N = Ce; exports.O = Rn; exports.P = jt; exports.Q = _n; exports.R = zn; exports.S = oa; exports.T = da; exports.U = wa; exports.V = La; exports.W = Ua;
2
- //# sourceMappingURL=chunk-7UL54E7X.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-7UL54E7X.cjs","../src/lib/requests/constants.ts","../src/lib/requests/fuzzyMatchColumns.ts","../src/lib/requests/mapEnumValues.ts"],"names":["NONE","BULK_APPLY","BLANK","IDENTIFIER_BLOCK_LIST","ColumnName","IS_REQUIRED","CAN_APPLY_IN_BULK","CachedFileState","applyEnum","valuesOf","IsoCountryCode","IsoCountrySubdivisionCode","CompletedRequestStatus","SuccessfulRequest","CachedRequestState","fuzzySearch","word1","word2","fuzzysearch","fuzzyMatchColumns","allColumnNames","fuzzyMapName","isRequired","canApplyAll","matchingColumnNames","x","inquirer","mapEnumValues","csvInputs","expectedOutputs","cache","autoCompletePrompt","inputs","item","value","result"],"mappings":"AAAA,u/BAA6N,wDAAyC,wDAAyC,wDAAiE,qDCA5U,0EACR,2DAMrB,yYACY,IAENA,CAAAA,CAAO,QAAA,CACPC,EAAAA,aAAa,2BAAA,CACbC,EAAAA,aAAQ,SAAA,CAGRC,EAAAA,aAAwB,CAAC,OAAA,CAAS,gBAAgB,CAAA,CAKnDC,EAAAA,aAAAA,CAAAA,CAAAA,EAAAA,CAEVA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CAERA,CAAAA,CAAA,cAAA,CAAiB,gBAAA,CAEjBA,CAAAA,CAAA,WAAA,CAAc,aAAA,CAEdA,CAAAA,CAAA,WAAA,CAAc,aAAA,CAEdA,CAAAA,CAAA,MAAA,CAAS,QAAA,CAETA,CAAAA,CAAA,OAAA,CAAU,SAAA,CAEVA,CAAAA,CAAA,kBAAA,CAAqB,oBAAA,CAErBA,CAAAA,CAAA,aAAA,CAAgB,eAAA,CAEhBA,CAAAA,CAAA,SAAA,CAAY,WAAA,CAEZA,CAAAA,CAAA,WAAA,CAAc,aAAA,CApBJA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,EAAA,CAAA,CAAA,CAAA,CAwBCC,EAAAA,aAA8C,CACxD,KAAA,CAAmB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AA,CACdC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACsD,CACtD,IAAMC,CAAAA,CAAsBJ,CAAAA,CAAe,MAAA,CAAQK,CAAAA,EACjDV,EAAAA,CAAYM,CAAAA,CAAa,WAAA,CAAY,CAAA,CAAGI,CAAAA,CAAE,WAAA,CAAY,CAAC,CACzD,CAAA,CACA,MAAO,CACL,GAAGD,CAAAA,CACH,IAAIE,kBAAAA,CAAS,SAAA,CACb,GAAIJ,CAAAA,CAAa,CAAC,CAAA,CAAI,CAACtB,CAAI,CAAA,CAC3B,GAAIuB,CAAAA,CAAc,CAACtB,EAAU,CAAA,CAAI,CAAC,CAAA,CAClC,GAAGmB,CAAAA,CAAe,MAAA,CAAQK,CAAAA,EAAM,CAACD,CAAAA,CAAoB,QAAA,CAASC,CAAC,CAAC,CAClE,CACF,CC7CA,kKAC+B,MAY/B,SAAsBE,EAAAA,CACpBC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACoC,CACpCJ,kBAAAA,CAAS,cAAA,CAAe,cAAA,CAAgBK,oCAAkB,CAAA,CAE1D,IAAMC,CAAAA,CAASJ,CAAAA,CACZ,GAAA,CAAKK,CAAAA,EAASA,CAAAA,EAAQ,SAAS,CAAA,CAC/B,MAAA,CAAQC,CAAAA,EAAU,CAACJ,CAAAA,CAAMI,CAAK,CAAC,CAAA,CAClC,EAAA,CAAIF,CAAAA,CAAO,MAAA,GAAW,CAAA,CACpB,OAAOF,CAAAA,CAET,IAAMK,CAAAA,CAAS,MAAMT,kBAAAA,CAAS,MAAA,CAC5BM,CAAAA,CAAO,GAAA,CAAKE,CAAAA,EAAAA,CAAW,CACrB,IAAA,CAAMA,CAAAA,CACN,OAAA,CAAS,CAAA,cAAA,EAAiBA,CAAK,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/chunk-7UL54E7X.cjs","sourcesContent":[null,"import { applyEnum, valuesOf } from '@transcend-io/type-utils';\nimport { LanguageKey } from '@transcend-io/internationalization';\nimport {\n CompletedRequestStatus,\n RequestAction,\n IsoCountryCode,\n IsoCountrySubdivisionCode,\n} from '@transcend-io/privacy-types';\nimport * as t from 'io-ts';\n\nexport const NONE = '[NONE]' as const;\nexport const BULK_APPLY = '[APPLY VALUE TO ALL ROWS]' as const;\nexport const BLANK = '<blank>' as const;\n\n/** These are uploaded at the top level of the request */\nexport const IDENTIFIER_BLOCK_LIST = ['email', 'coreIdentifier'];\n\n/**\n * Column names to map\n */\nexport enum ColumnName {\n /** The title of the email column */\n Email = 'email',\n /** The title of the core identifier column */\n CoreIdentifier = 'coreIdentifier',\n /** The title of the requestType column */\n RequestType = 'requestType',\n /** The title of the subjectType column */\n SubjectType = 'subjectType',\n /** The title of the locale column */\n Locale = 'locale',\n /** The country */\n Country = 'country',\n /** The country sub division */\n CountrySubDivision = 'countrySubDivision',\n /** The title of the requestStatus column */\n RequestStatus = 'requestStatus',\n /** The title of the createdAt column */\n CreatedAt = 'createdAt',\n /** The title of the dataSiloIds column */\n DataSiloIds = 'dataSiloIds',\n}\n\n/** These parameters are required in the Transcend DSR API */\nexport const IS_REQUIRED: { [k in ColumnName]: boolean } = {\n [ColumnName.Email]: false,\n [ColumnName.CoreIdentifier]: true,\n [ColumnName.RequestType]: true,\n [ColumnName.SubjectType]: true,\n [ColumnName.RequestStatus]: false,\n [ColumnName.CreatedAt]: false,\n [ColumnName.DataSiloIds]: false,\n [ColumnName.Locale]: false,\n [ColumnName.Country]: false,\n [ColumnName.CountrySubDivision]: false,\n};\n\n/** These parameters can be specified for the entire CSV set if needed */\nexport const CAN_APPLY_IN_BULK: { [k in ColumnName]?: boolean } = {\n [ColumnName.RequestType]: true,\n [ColumnName.SubjectType]: true,\n};\n\n// Cache state\nexport const CachedFileState = t.type({\n /** Mapping between the default request input column names and the CSV column name for that input */\n columnNames: t.partial(applyEnum(ColumnName, () => t.string)),\n /** Mapping between the identifier names and the CSV column name for that input */\n identifierNames: t.record(t.string, t.string),\n /** Mapping between the request attribute inputs and the CSV column name for that input */\n attributeNames: t.record(t.string, t.string),\n /** Mapping between CSV request type and Transcend Request Action */\n requestTypeToRequestAction: t.record(t.string, valuesOf(RequestAction)),\n /** Mapping between CSV data subject type and the name of the data subject in Transcend */\n subjectTypeToSubjectName: t.record(t.string, t.string),\n /** Mapping between language imported and Transcend locale code */\n languageToLocale: t.record(t.string, valuesOf(LanguageKey)),\n /** Mapping between region and country code */\n regionToCountry: t.record(\n t.string,\n valuesOf({ ...IsoCountryCode, [NONE]: NONE }),\n ),\n /** Mapping between region and country sub division code */\n regionToCountrySubDivision: t.record(\n t.string,\n valuesOf({ ...IsoCountrySubdivisionCode, [NONE]: NONE }),\n ),\n /** Mapping between request status in import to Transcend request status */\n statusToRequestStatus: t.record(\n t.string,\n valuesOf({ ...CompletedRequestStatus, [NONE]: NONE }),\n ),\n});\n\n/** Type override */\nexport type CachedFileState = t.TypeOf<typeof CachedFileState>;\n\n/**\n * Successfully processed request\n */\nexport const SuccessfulRequest = t.type({\n id: t.string,\n link: t.string,\n rowIndex: t.number,\n coreIdentifier: t.string,\n attemptedAt: t.string,\n});\n\n/** Type override */\nexport type SuccessfulRequest = t.TypeOf<typeof SuccessfulRequest>;\n\n// Cache state\nexport const CachedRequestState = t.type({\n /** Set of privacy requests that failed to upload */\n failingRequests: t.array(t.record(t.string, t.any)),\n /** Successfully uploaded requests */\n successfulRequests: t.array(SuccessfulRequest),\n /** Duplicate requests */\n duplicateRequests: t.array(\n t.type({\n rowIndex: t.number,\n coreIdentifier: t.string,\n attemptedAt: t.string,\n }),\n ),\n});\n\n/** Type override */\nexport type CachedRequestState = t.TypeOf<typeof CachedRequestState>;\n","import inquirer from 'inquirer';\nimport { NONE, BULK_APPLY } from './constants';\n\nimport fuzzysearch from 'fuzzysearch';\n\n/**\n * Check if word1 and word2 are a fuzzy match of each other.\n * Returns true if word1 is fuzzy match of word2 or vice versa.\n *\n * @param word1 - First word\n * @param word2 - Second word\n * @returns True if words are fuzzy match\n */\nexport function fuzzySearch(word1: string, word2: string): boolean {\n return (\n fuzzysearch(word1.toLowerCase(), word2.toLowerCase()) ||\n fuzzysearch(word2.toLowerCase(), word1.toLowerCase())\n );\n}\n\n/**\n * Fuzzy match column names for a particular field\n *\n * @param allColumnNames - List of all column names\n * @param fuzzyMapName - The name of field being mapped to\n * @param isRequired - When true, don't include \"NONE\" as an option\n * @param canApplyAll - When true, include an option to specify the value in bulk\n * @returns The list of suggestions for inquirer\n */\nexport function fuzzyMatchColumns(\n allColumnNames: string[],\n fuzzyMapName: string,\n isRequired: boolean,\n canApplyAll?: boolean,\n): (string | InstanceType<typeof inquirer.Separator>)[] {\n const matchingColumnNames = allColumnNames.filter((x) =>\n fuzzySearch(fuzzyMapName.toLowerCase(), x.toLowerCase()),\n );\n return [\n ...matchingColumnNames,\n new inquirer.Separator(),\n ...(isRequired ? [] : [NONE]),\n ...(canApplyAll ? [BULK_APPLY] : []),\n ...allColumnNames.filter((x) => !matchingColumnNames.includes(x)),\n ];\n}\n","import inquirer from 'inquirer';\nimport autoCompletePrompt from 'inquirer-autocomplete-prompt';\nimport { apply, ObjByString } from '@transcend-io/type-utils';\nimport { fuzzySearch } from './fuzzyMatchColumns';\n\n/**\n * Map a set of inputs to a set of outputs\n *\n * @param csvInputs - Input list\n * @param expectedOutputs - Output list\n * @param cache - Cache\n * @returns Mapping from row to enum value\n */\nexport async function mapEnumValues<TValue extends string>(\n csvInputs: string[],\n expectedOutputs: TValue[],\n cache: { [k in string]: TValue },\n): Promise<{ [k in string]: TValue }> {\n inquirer.registerPrompt('autocomplete', autoCompletePrompt);\n\n const inputs = csvInputs\n .map((item) => item || '<blank>')\n .filter((value) => !cache[value]);\n if (inputs.length === 0) {\n return cache;\n }\n const result = await inquirer.prompt<{ [k in string]: TValue }>(\n inputs.map((value) => ({\n name: value,\n message: `Map value of: ${value}`,\n type: 'autocomplete',\n default: expectedOutputs.find((x) => fuzzySearch(value, x)),\n source: (answersSoFar: ObjByString, input: string) =>\n !input\n ? expectedOutputs\n : expectedOutputs.filter(\n (x) => typeof x === 'string' && fuzzySearch(input, x),\n ),\n })),\n );\n return {\n ...cache,\n ...apply(result, (r) =>\n typeof r === 'string' ? (r as TValue) : (Object.values(r)[0] as TValue),\n ),\n };\n}\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunk7UL54E7Xcjs = require('./chunk-7UL54E7X.cjs');var _chunkUONUI4ABcjs = require('./chunk-UONUI4AB.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXPKFB4ILcjs = require('./chunk-XPKFB4IL.cjs');var _chunk44J2TVZUcjs = require('./chunk-44J2TVZU.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=_chunkXPKFB4ILcjs.e}){let o=_chunkUONUI4ABcjs.Ud.call(void 0, n,s),e=await _chunkUONUI4ABcjs.Vd.call(void 0, n,s,g);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling manual enrichment requests, filtered for actions: ${f.join(",")}`));let d=await _chunkUONUI4ABcjs.le.call(void 0, o,{actions:f,statuses:[_privacytypes.RequestStatus.Enriching]}),i=[];await _bluebird.map.call(void 0, d,async t=>{let c=await _chunkUONUI4ABcjs.ge.call(void 0, o,{requestId:t.id});if(c.filter(({status:m})=>m==="ACTION_REQUIRED")){let m=await _chunkUONUI4ABcjs.je.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(_chunk44J2TVZUcjs.d.call(void 0, c,"name")).reduce((w,[P,$])=>Object.assign(w,{[P]:$.map(({value:C})=>C).join(",")}),{}),...Object.entries(_chunk44J2TVZUcjs.d.call(void 0, t,"attributeKey.name")).reduce((w,[P,$])=>Object.assign(w,{[P]:$.map(({name:C})=>C).join(",")}),{})})),a=_chunk44J2TVZUcjs.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])=>_chunk44J2TVZUcjs.j.call(void 0, _chunk7UL54E7Xcjs.n.call(void 0, i)).length===0?e:Object.assign(e,{[d]:_chunk44J2TVZUcjs.j.call(void 0, _chunk7UL54E7Xcjs.n.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=_chunkXPKFB4ILcjs.e}){let e=await _chunkUONUI4ABcjs.Vd.call(void 0, o,s,g),d=_chunkUONUI4ABcjs.Ud.call(void 0, o,s);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${u}" from disk`));let i=_chunk7UL54E7Xcjs.q.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 _chunkUONUI4ABcjs.ac.call(void 0, d,_chunkUONUI4ABcjs.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
- 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-A4OQQVQT.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-A4OQQVQT.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,wDAAgD,wDAAyF,wDAAyC,wDAAyC,wDAAgD,2DCAtQ,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-A4OQQVQT.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 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-FNBADTTI.cjs","../src/app.ts","../src/commands/admin/generate-api-keys/command.ts","../src/commands/admin/routes.ts","../src/commands/consent/routes.ts","../src/commands/consent/build-xdi-sync-endpoint/command.ts","../src/commands/consent/pull-consent-metrics/command.ts","../src/commands/consent/pull-consent-preferences/command.ts","../src/commands/consent/update-consent-manager/command.ts","../src/commands/consent/upload-consent-preferences/command.ts","../src/commands/consent/upload-cookies-from-csv/command.ts","../src/commands/consent/upload-data-flows-from-csv/command.ts","../src/commands/consent/upload-preferences/command.ts","../src/commands/inventory/routes.ts","../src/commands/inventory/derive-data-silos-from-data-flows-cross-instance/command.ts","../src/commands/inventory/derive-data-silos-from-data-flows/command.ts","../src/commands/inventory/discover-silos/command.ts","../src/commands/inventory/pull-datapoints/command.ts","../src/commands/inventory/pull-unstructured-discovery-files/command.ts","../src/commands/inventory/push/command.ts","../src/commands/inventory/scan-packages/command.ts","../src/commands/inventory/consent-manager-service-json-to-yml/command.ts","../src/lib/docgen/buildExamples.ts","../src/commands/inventory/consent-managers-to-business-entities/command.ts","../src/commands/migration/sync-ot/command.ts","../src/commands/migration/routes.ts","../src/commands/request/cron/mark-identifiers-completed/command.ts","../src/commands/request/cron/pull-identifiers/command.ts","../src/commands/request/cron/pull-profiles/command.ts","../src/commands/request/cron/routes.ts","../src/commands/request/enricher-restart/command.ts","../src/commands/request/export/command.ts","../src/commands/request/preflight/pull-identifiers/command.ts","../src/commands/request/preflight/push-identifiers/command.ts","../src/commands/request/preflight/routes.ts","../src/commands/request/system/retry-request-data-silos/command.ts","../src/commands/request/upload/command.ts","../src/commands/request/routes.ts"],"names":["generateApiKeysCommand","buildCommand","generateApiKeys","SCOPE_TITLES","uuidParser","createTranscendUrlParameter","adminRoutes","buildRouteMap","buildXdiSyncEndpointCommand","buildXdiSyncEndpoint","createAuthParameter","ScopeName","arrayParser","pullConsentMetricsCommand","pullConsentMetrics","dateParser","pullConsentPreferencesCommand","pullConsentPreferences","createSombraAuthParameter","numberParser","updateConsentManagerCommand","updateConsentManager","ConsentBundleType","uploadConsentPreferencesCommand","uploadConsentPreferences","createConsentUrlParameter","uploadCookiesFromCsvCommand","uploadCookiesFromCsv","ConsentTrackerStatus","uploadDataFlowsFromCsvCommand","uploadDataFlowsFromCsv","uploadPreferencesCommand","uploadPreferences","consentRoutes","deriveDataSilosFromDataFlowsCrossInstanceCommand","deriveDataSilosFromDataFlowsCrossInstance","deriveDataSilosFromDataFlowsCommand","deriveDataSilosFromDataFlows","discoverSilosCommand","discoverSilos","pullDatapointsCommand","pullDatapoints","DataCategoryType","pullUnstructuredDiscoveryFilesCommand","pullUnstructuredDiscoveryFiles","UnstructuredSubDataPointRecommendationStatus","pushCommand","push","scanPackagesCommand","scanPackages","buildExampleCommand","commandPath","flags","options","command","flagList","getFlagList","forceSingleLine","argsIndent","RequestAction"],"mappings":"AAAA,ufAAyF,wDAAgD,wDAAgD,wDAAgD,sDCGlO,qCACyC,ICCnCA,CAAAA,CAAyBC,gCAAAA,CACpC,MAAA,CAAQ,KAAA,CAAA,CAAA,EAAY,CAClB,GAAM,CAAE,e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AAcA,GAAA;AAAA;AChE0B,8EAAA;AAuDT;AAAA;AAAA;ACvDS,8EAAA;AAkET;AAAA;AAAA;AC7DjB,8EAAA;AC2DiB;AAAA;AClEd,4BAAA;ACyCc;AAAA;AAAA;AAAA;AAAA;AAYjB,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACzDK,GAAA;AAoDY;AAAA;AAAA;AAAA;AAAA;AAYjB,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACvDO,GAAA;ACTFI,4GAAAA;AC0GY;AAAA;AAAA;ACrFjB,yGAAA","file":"/home/runner/work/cli/cli/dist/chunk-FNBADTTI.cjs","sourcesContent":[null,"import {\n buildInstallCommand,\n buildUninstallCommand,\n} from '@stricli/auto-complete';\nimport { buildApplication, buildRouteMap } from '@stricli/core';\nimport { adminRoutes } from './commands/admin/routes';\nimport { consentRoutes } from './commands/consent/routes';\nimport { inventoryRoutes } from './commands/inventory/routes';\nimport { migrationRoutes } from './commands/migration/routes';\nimport { requestRoutes } from './commands/request/routes';\nimport { description, name, version } from './constants';\n\nconst routes = buildRouteMap({\n routes: {\n request: requestRoutes,\n consent: consentRoutes,\n inventory: inventoryRoutes,\n admin: adminRoutes,\n migration: migrationRoutes,\n install: buildInstallCommand('@transcend-io/transcend', {\n bash: '__@transcend-io/cli_bash_complete',\n }),\n uninstall: buildUninstallCommand('@transcend-io/transcend', { bash: true }),\n },\n docs: {\n brief: description,\n hideRoute: {\n install: true,\n uninstall: true,\n },\n },\n});\n\nexport const app = buildApplication(routes, {\n name,\n versionInfo: {\n currentVersion: version,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { createTranscendUrlParameter } from '../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../lib/cli/parsers';\nimport { SCOPE_TITLES } from '../../../constants';\n\nexport const generateApiKeysCommand = buildCommand({\n loader: async () => {\n const { generateApiKeys } = await import('./impl');\n return generateApiKeys;\n },\n parameters: {\n flags: {\n email: {\n kind: 'parsed',\n parse: String,\n brief: 'The email address that you use to log into Transcend',\n },\n password: {\n kind: 'parsed',\n parse: String,\n brief: 'The password for your account login',\n },\n apiKeyTitle: {\n kind: 'parsed',\n parse: String,\n brief: 'The title of the API key being generated or destroyed',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file where API keys should be written to',\n },\n scopes: {\n kind: 'enum',\n values: SCOPE_TITLES,\n variadic: ',',\n brief: 'The list of scopes that should be given to the API key',\n },\n deleteExistingApiKey: {\n kind: 'boolean',\n brief:\n 'When true, if an API key exists with the specified apiKeyTitle, the existing API key is deleted',\n default: true,\n },\n createNewApiKey: {\n kind: 'boolean',\n brief:\n 'When true, new API keys will be created. Set to false if you simply want to delete all API keys with a title',\n default: true,\n },\n parentOrganizationId: {\n kind: 'parsed',\n parse: uuidParser,\n brief:\n 'Filter for only a specific organization by ID, returning all child accounts associated with that organization',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Generate API keys',\n fullDescription: `This command allows for creating API keys across multiple Transcend instances. This is useful for customers that are managing many Transcend instances and need to regularly create, cycle or delete API keys across all of their instances.\n\nUnlike the other commands that rely on API key authentication, this command relies upon username/password authentication. This command will spit out the API keys into a JSON file, and that JSON file can be used in subsequent CLI commands.\n\nAuthentication requires your email and password for the Transcend account. This command will only generate API keys for Transcend instances where you have the permission to \"Manage API Keys\".`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { generateApiKeysCommand } from './generate-api-keys/command';\n\nexport const adminRoutes = buildRouteMap({\n routes: {\n 'generate-api-keys': generateApiKeysCommand,\n },\n docs: {\n brief: 'Admin commands',\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { buildXdiSyncEndpointCommand } from './build-xdi-sync-endpoint/command';\nimport { pullConsentMetricsCommand } from './pull-consent-metrics/command';\nimport { pullConsentPreferencesCommand } from './pull-consent-preferences/command';\nimport { updateConsentManagerCommand } from './update-consent-manager/command';\nimport { uploadConsentPreferencesCommand } from './upload-consent-preferences/command';\nimport { uploadCookiesFromCsvCommand } from './upload-cookies-from-csv/command';\nimport { uploadDataFlowsFromCsvCommand } from './upload-data-flows-from-csv/command';\nimport { uploadPreferencesCommand } from './upload-preferences/command';\n\nexport const consentRoutes = buildRouteMap({\n routes: {\n 'build-xdi-sync-endpoint': buildXdiSyncEndpointCommand,\n 'pull-consent-metrics': pullConsentMetricsCommand,\n 'pull-consent-preferences': pullConsentPreferencesCommand,\n 'update-consent-manager': updateConsentManagerCommand,\n 'upload-consent-preferences': uploadConsentPreferencesCommand,\n 'upload-cookies-from-csv': uploadCookiesFromCsvCommand,\n 'upload-data-flows-from-csv': uploadDataFlowsFromCsvCommand,\n 'upload-preferences': uploadPreferencesCommand,\n },\n docs: {\n brief: 'Consent commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { arrayParser } from '../../../lib/cli/parsers';\n\nexport const buildXdiSyncEndpointCommand = buildCommand({\n loader: async () => {\n const { buildXdiSyncEndpoint } = await import('./impl');\n return buildXdiSyncEndpoint;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewConsentManager],\n }),\n xdiLocation: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The location of the XDI that will be loaded by the generated sync endpoint',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The HTML file path where the sync endpoint should be written',\n default: './sync-endpoint.html',\n },\n removeIpAddresses: {\n kind: 'boolean',\n brief: 'When true, remove IP addresses from the domain list',\n default: true,\n },\n domainBlockList: {\n kind: 'parsed',\n parse: arrayParser,\n brief:\n 'The set of domains that should be excluded from the sync endpoint. Comma-separated list.',\n default: 'localhost',\n },\n xdiAllowedCommands: {\n kind: 'parsed',\n parse: String,\n brief: 'The allowed set of XDI commands',\n default: 'ConsentManager:Sync',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Build XDI sync endpoint',\n fullDescription:\n 'This command allows for building of the XDI Sync Endpoint across a set of Transcend accounts.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const pullConsentMetricsCommand = buildCommand({\n loader: async () => {\n const { pullConsentMetrics } = await import('./impl');\n return pullConsentMetrics;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewConsentManager],\n }),\n start: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'The start date to pull metrics from',\n },\n end: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'The end date to pull metrics until',\n optional: true,\n },\n folder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder to save metrics to',\n default: './consent-metrics/',\n },\n bin: {\n kind: 'parsed',\n parse: String,\n brief: 'The bin metric when pulling data (1h or 1d)',\n default: '1d',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Pull consent metrics',\n fullDescription: `This command allows for pulling consent manager metrics for a Transcend account, or a set of Transcend accounts.\n\nBy default, the consent metrics will be written to a folder named \\`consent-metrics\\` within the directory where you run the command. You can override the location that these CSVs are written to using the flag \\`--folder=./my-folder/\\`. This folder will contain a set of CSV files:\n\n- \\`CONSENT_CHANGES_TIMESERIES_optIn.csv\\` -> this is a feed containing the number of explicit opt in events that happen - these are calls to \\`airgap.setConsent(event, { SaleOfInfo: true });\\`\n- \\`CONSENT_CHANGES_TIMESERIES_optOut.csv\\` -> this is a feed containing the number of explicit opt out events that happen - these are calls to \\`airgap.setConsent(event, { SaleOfInfo: false });\\`\n- \\`CONSENT_SESSIONS_BY_REGIME_Default.csv\\` -> this contains the number of sessions detected for the bin period\n- \\`PRIVACY_SIGNAL_TIMESERIES_DNT.csv\\` -> the number of DNT signals detected.\n- \\`PRIVACY_SIGNAL_TIMESERIES_GPC.csv\\` -> the number of GPC signals detected.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const pullConsentPreferencesCommand = buildCommand({\n loader: async () => {\n const { pullConsentPreferences } = await import('./impl');\n return pullConsentPreferences;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewManagedConsentDatabaseAdminApi],\n }),\n partition: {\n kind: 'parsed',\n parse: String,\n brief: 'The partition key to download consent preferences to',\n },\n sombraAuth: createSombraAuthParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to save preferences to',\n default: './preferences.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n timestampBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Filter for consents updated this time',\n optional: true,\n },\n timestampAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Filter for consents updated after this time',\n optional: true,\n },\n identifiers: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'Filter for specific identifiers',\n optional: true,\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when downloading consents in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Pull consent preferences',\n fullDescription:\n 'This command allows for pull of consent preferences from the Managed Consent Database.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ConsentBundleType, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const updateConsentManagerCommand = buildCommand({\n loader: async () => {\n const { updateConsentManager } = await import('./impl');\n return updateConsentManager;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageConsentManagerDeveloperSettings],\n }),\n bundleTypes: {\n kind: 'enum',\n values: Object.values(ConsentBundleType),\n brief: 'The bundle types to deploy. Defaults to PRODUCTION,TEST.',\n variadic: ',',\n },\n deploy: {\n kind: 'boolean',\n brief:\n 'When true, deploy the Consent Manager after updating the version',\n default: false,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Update consent manager',\n fullDescription:\n 'This command allows for updating Consent Manager to latest version. The Consent Manager bundle can also be deployed using this command.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { createConsentUrlParameter } from '../../../lib/cli/common-parameters';\n\nexport const uploadConsentPreferencesCommand = buildCommand({\n loader: async () => {\n const { uploadConsentPreferences } = await import('./impl');\n return uploadConsentPreferences;\n },\n parameters: {\n flags: {\n base64EncryptionKey: {\n kind: 'parsed',\n parse: String,\n brief: 'The encryption key used to encrypt the userId',\n },\n base64SigningKey: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The signing key used to prove authentication of consent request',\n },\n partition: {\n kind: 'parsed',\n parse: String,\n brief: 'The partition key to download consent preferences to',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file to pull consent preferences from',\n default: './preferences.csv',\n },\n consentUrl: createConsentUrlParameter(),\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Upload consent preferences to the Managed Consent Database',\n fullDescription:\n 'This command allows for updating of consent preferences to the Managed Consent Database.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ConsentTrackerStatus, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadCookiesFromCsvCommand = buildCommand({\n loader: async () => {\n const { uploadCookiesFromCsv } = await import('./impl');\n return uploadCookiesFromCsv;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageDataFlow],\n }),\n trackerStatus: {\n kind: 'enum',\n values: Object.values(ConsentTrackerStatus),\n brief: 'The status of the cookies you will upload.',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to upload',\n default: './cookies.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Upload cookies from CSV',\n fullDescription: `Upload cookies from CSV. This command allows for uploading of cookies from CSV.\n\nStep 1) Download the CSV of cookies that you want to edit from the Admin Dashboard under [Consent Management -> Cookies](https://app.transcend.io/consent-manager/cookies). You can download cookies from both the \"Triage\" and \"Approved\" tabs.\n\nStep 2) You can edit the contents of the CSV file as needed. You may adjust the \"Purpose\" column, adjust the \"Notes\" column, add \"Owners\" and \"Teams\" or even add custom columns with additional metadata.\n\nStep 3) Upload the modified CSV file back into the dashboard with this command.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ConsentTrackerStatus, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadDataFlowsFromCsvCommand = buildCommand({\n loader: async () => {\n const { uploadDataFlowsFromCsv } = await import('./impl');\n return uploadDataFlowsFromCsv;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageDataFlow],\n }),\n trackerStatus: {\n kind: 'enum',\n values: Object.values(ConsentTrackerStatus),\n brief: 'The status of the data flows you will upload.',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to upload',\n default: './data-flows.csv',\n },\n classifyService: {\n kind: 'boolean',\n brief:\n 'When true, automatically assign the service for a data flow based on the domain that is specified',\n default: false,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Upload data flows from CSV',\n fullDescription: `Upload data flows from CSV. This command allows for uploading of data flows from CSV.\n\nStep 1) Download the CSV of data flows that you want to edit from the Admin Dashboard under [Consent Management -> Data Flows](https://app.transcend.io/consent-manager/data-flows). You can download data flows from both the \"Triage\" and \"Approved\" tabs.\n\nStep 2) You can edit the contents of the CSV file as needed. You may adjust the \"Purpose\" column, adjust the \"Notes\" column, add \"Owners\" and \"Teams\" or even add custom columns with additional metadata.\n\nStep 3) Upload the modified CSV file back into the dashboard with this command.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadPreferencesCommand = buildCommand({\n loader: async () => {\n const { uploadPreferences } = await import('./impl');\n return uploadPreferences;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.ManageStoredPreferences,\n ScopeName.ViewManagedConsentDatabaseAdminApi,\n ScopeName.ViewPreferenceStoreSettings,\n ],\n }),\n partition: {\n kind: 'parsed',\n parse: String,\n brief: 'The partition key to download consent preferences to',\n },\n sombraAuth: createSombraAuthParameter(),\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to load preferences from',\n optional: true,\n },\n directory: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the directory of CSV files to load preferences from',\n optional: true,\n },\n dryRun: {\n kind: 'boolean',\n brief:\n 'Whether to do a dry run only - will write results to receiptFilepath without updating Transcend',\n default: false,\n },\n skipExistingRecordCheck: {\n kind: 'boolean',\n brief:\n 'Whether to skip the check for existing records. SHOULD ONLY BE USED FOR INITIAL UPLOAD',\n default: false,\n },\n receiptFileDir: {\n kind: 'parsed',\n parse: String,\n brief: 'Directory path where the response receipts should be saved',\n default: './receipts',\n },\n skipWorkflowTriggers: {\n kind: 'boolean',\n brief:\n 'Whether to skip workflow triggers when uploading to preference store',\n default: false,\n },\n forceTriggerWorkflows: {\n kind: 'boolean',\n brief:\n 'Whether to force trigger workflows for existing consent records',\n default: false,\n },\n skipConflictUpdates: {\n kind: 'boolean',\n brief:\n 'Whether to skip uploading of any records where the preference store and file have a hard conflict',\n default: false,\n },\n isSilent: {\n kind: 'boolean',\n brief: 'Whether to skip sending emails in workflows',\n default: true,\n },\n attributes: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Attributes to add to any DSR request if created. Comma-separated list of key:value pairs.',\n default: 'Tags:transcend-cli,Source:transcend-cli',\n },\n receiptFilepath: {\n kind: 'parsed',\n parse: String,\n brief: 'Store resulting, continuing where left off',\n default: './preference-management-upload-receipts.json',\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading in parallel',\n default: '10',\n },\n },\n },\n docs: {\n brief: 'Upload preference management data to your Preference Store',\n fullDescription: `Upload preference management data to your Preference Store.\n\nThis command prompts you to map the shape of the CSV to the shape of the Transcend API. There is no requirement for the shape of the incoming CSV, as the script will handle the mapping process.\n\nThe script will also produce a JSON cache file that allows for the mappings to be preserved between runs.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { deriveDataSilosFromDataFlowsCrossInstanceCommand } from './derive-data-silos-from-data-flows-cross-instance/command';\nimport { deriveDataSilosFromDataFlowsCommand } from './derive-data-silos-from-data-flows/command';\nimport { discoverSilosCommand } from './discover-silos/command';\nimport { pullDatapointsCommand } from './pull-datapoints/command';\nimport { pullUnstructuredDiscoveryFilesCommand } from './pull-unstructured-discovery-files/command';\nimport { pullCommand } from './pull/command';\nimport { pushCommand } from './push/command';\nimport { scanPackagesCommand } from './scan-packages/command';\nimport { consentManagerServiceJsonToYmlCommand } from './consent-manager-service-json-to-yml/command';\nimport { consentManagersToBusinessEntitiesCommand } from './consent-managers-to-business-entities/command';\n\nexport const inventoryRoutes = buildRouteMap({\n routes: {\n pull: pullCommand,\n push: pushCommand,\n 'scan-packages': scanPackagesCommand,\n 'discover-silos': discoverSilosCommand,\n 'pull-datapoints': pullDatapointsCommand,\n 'pull-unstructured-discovery-files': pullUnstructuredDiscoveryFilesCommand,\n 'derive-data-silos-from-data-flows': deriveDataSilosFromDataFlowsCommand,\n 'derive-data-silos-from-data-flows-cross-instance':\n deriveDataSilosFromDataFlowsCrossInstanceCommand,\n 'consent-manager-service-json-to-yml':\n consentManagerServiceJsonToYmlCommand,\n 'consent-managers-to-business-entities':\n consentManagersToBusinessEntitiesCommand,\n },\n docs: {\n brief: 'Inventory commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const deriveDataSilosFromDataFlowsCrossInstanceCommand = buildCommand({\n loader: async () => {\n const { deriveDataSilosFromDataFlowsCrossInstance } = await import(\n './impl'\n );\n return deriveDataSilosFromDataFlowsCrossInstance;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n }),\n dataFlowsYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder that contains data flow yml files',\n },\n output: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The output transcend.yml file containing the data silo configurations',\n default: './transcend.yml',\n },\n ignoreYmls: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'The set of yml files that should be skipped when uploading',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Derive data silos from data flows cross instance',\n fullDescription:\n 'Given a folder of data flow transcend.yml configurations, convert those configurations to a single transcend.yml configurations of all related data silos.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const deriveDataSilosFromDataFlowsCommand = buildCommand({\n loader: async () => {\n const { deriveDataSilosFromDataFlows } = await import('./impl');\n return deriveDataSilosFromDataFlows;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n }),\n dataFlowsYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder that contains data flow yml files',\n },\n dataSilosYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder that contains data silo yml files',\n },\n ignoreYmls: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'The set of yml files that should be skipped when uploading',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Derive data silos from data flows',\n fullDescription:\n 'Given a folder of data flow transcend.yml configurations, convert those configurations to set of data silo transcend.yml configurations.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../lib/cli/parsers';\n\nexport const discoverSilosCommand = buildCommand({\n loader: async () => {\n const { discoverSilos } = await import('./impl');\n return discoverSilos;\n },\n parameters: {\n flags: {\n scanPath: {\n kind: 'parsed',\n parse: String,\n brief: 'File path in the project to scan',\n },\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The UUID of the corresponding data silo',\n },\n auth: createAuthParameter({\n scopes: [ScopeName.ManageAssignedDataInventory],\n requiresSiloScope: true,\n }),\n fileGlobs: {\n kind: 'parsed',\n parse: String,\n brief:\n 'You can pass a glob syntax pattern(s) to specify additional file paths to scan. Comma-separated list of globs.',\n default: '',\n },\n ignoreDirs: {\n kind: 'parsed',\n parse: String,\n brief: 'Comma-separated list of directories to ignore.',\n default: '',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Scan dependency management files to discover new data silos.',\n fullDescription: `We support scanning for new data silos in JavaScript, Python, Gradle, and CocoaPods projects.\n\nTo get started, add a data silo for the corresponding project type with the \"silo discovery\" plugin enabled. For example, if you want to scan a JavaScript project, add a package.json data silo. Then, specify the data silo ID in the \"--dataSiloId\" parameter.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { DataCategoryType, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const pullDatapointsCommand = buildCommand({\n loader: async () => {\n const { pullDatapoints } = await import('./impl');\n return pullDatapoints;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewDataInventory],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file to save datapoints to',\n default: './datapoints.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n dataSiloIds: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'List of data silo IDs to filter by',\n optional: true,\n },\n includeAttributes: {\n kind: 'boolean',\n brief: 'Whether to include attributes in the output',\n default: false,\n },\n includeGuessedCategories: {\n kind: 'boolean',\n brief: 'Whether to include guessed categories in the output',\n default: false,\n },\n parentCategories: {\n kind: 'enum',\n values: Object.values(DataCategoryType),\n brief: 'List of parent categories to filter by',\n variadic: ',',\n optional: true,\n },\n subCategories: {\n kind: 'parsed',\n parse: String,\n brief: 'List of subcategories to filter by',\n variadic: ',',\n optional: true,\n },\n },\n },\n docs: {\n brief: 'Export the datapoints from your Data Inventory into a CSV.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n ScopeName,\n UnstructuredSubDataPointRecommendationStatus,\n} from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const pullUnstructuredDiscoveryFilesCommand = buildCommand({\n loader: async () => {\n const { pullUnstructuredDiscoveryFiles } = await import('./impl');\n return pullUnstructuredDiscoveryFiles;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewDataInventory],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file to save datapoints to',\n default: './unstructured-discovery-files.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n dataSiloIds: {\n kind: 'parsed',\n parse: String,\n brief: 'List of data silo IDs to filter by',\n variadic: ',',\n optional: true,\n },\n subCategories: {\n kind: 'parsed',\n parse: String,\n brief: 'List of data categories to filter by',\n variadic: ',',\n optional: true,\n },\n status: {\n kind: 'enum',\n values: Object.values(UnstructuredSubDataPointRecommendationStatus),\n brief: 'List of classification statuses to filter by',\n variadic: ',',\n optional: true,\n },\n includeEncryptedSnippets: {\n kind: 'boolean',\n brief:\n 'Whether to include encrypted snippets of the entries classified',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Pull unstructured discovery files',\n fullDescription:\n 'This command allows for pulling Unstructured Discovery into a CSV.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const pushCommand = buildCommand({\n loader: async () => {\n const { push } = await import('./impl');\n return push;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: 'Varies',\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the YAML file to push from',\n default: './transcend.yml',\n },\n transcendUrl: createTranscendUrlParameter(),\n pageSize: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page size to use when paginating over the API',\n default: '50',\n },\n variables: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The variables to template into the YAML file when pushing configuration. Comma-separated list of key:value pairs.',\n default: '',\n },\n publishToPrivacyCenter: {\n kind: 'boolean',\n brief: 'When true, publish the configuration to the Privacy Center',\n default: false,\n },\n classifyService: {\n kind: 'boolean',\n brief:\n 'When true, automatically assign the service for a data flow based on the domain that is specified',\n default: false,\n },\n deleteExtraAttributeValues: {\n kind: 'boolean',\n brief:\n 'When true and syncing attributes, delete any extra attributes instead of just upserting',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Push metadata from transcend.yml to Transcend',\n fullDescription:\n 'Given a transcend.yml file, sync the contents up to your Transcend instance.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const scanPackagesCommand = buildCommand({\n loader: async () => {\n const { scanPackages } = await import('./impl');\n return scanPackages;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageCodeScanning],\n }),\n scanPath: {\n kind: 'parsed',\n parse: String,\n brief: 'File path in the project to scan',\n default: './',\n },\n ignoreDirs: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'List of directories to ignore in scan',\n optional: true,\n },\n repositoryName: {\n kind: 'parsed',\n parse: String,\n brief: 'Name of the git repository that the package should be tied to',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Scan dependency management files to inventory code dependencies.',\n fullDescription: `Transcend scans packages and dependencies for the following frameworks:\n\n- package.json\n- requirements.txt & setup.py\n- Podfile\n- Package.resolved\n- build.gradle\n- pubspec.yaml\n- Gemfile & .gemspec\n- composer.json\n\nThis command will scan the folder you point at to look for any of these files. Once found, the build file will be parsed in search of dependencies. Those code packages and dependencies will be uploaded to Transcend. The information uploaded to Transcend is:\n\n- repository name\n- package names\n- dependency names and versions\n- package descriptions`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { buildExampleCommand } from '../../../lib/docgen/buildExamples';\nimport { ConsentManagerServiceJsonToYmlCommandFlags } from './impl';\nimport { PushCommandFlags } from '../push/impl';\n\nexport const consentManagerServiceJsonToYmlCommand = buildCommand({\n loader: async () => {\n const { consentManagerServiceJsonToYml } = await import('./impl');\n return consentManagerServiceJsonToYml;\n },\n parameters: {\n flags: {\n file: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the services.json file, output of await airgap.getMetadata()',\n default: './services.json',\n },\n output: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the output transcend.yml to write to',\n default: './transcend.yml',\n },\n },\n },\n docs: {\n brief: 'Convert consent manager services to transcend.yml',\n fullDescription: `Import the services from an airgap.js file into a Transcend instance.\n\n1. Run \\`await airgap.getMetadata()\\` on a site with airgap\n2. Right click on the printed object, and click \\`Copy object\\`\n3. Place output of file in a file named \\`services.json\\`\n4. Run:\n\n ${buildExampleCommand<ConsentManagerServiceJsonToYmlCommandFlags>(\n ['inventory', 'consent-manager-service-json-to-yml'],\n {\n file: './services.json',\n output: './transcend.yml',\n },\n { argsIndent: 5 },\n )}\n\n5. Run:\n\n ${buildExampleCommand<PushCommandFlags>(\n ['inventory', 'push'],\n {\n auth: '$TRANSCEND_API_KEY',\n file: './transcend.yml',\n classifyService: true,\n },\n { argsIndent: 5 },\n )}`,\n },\n});\n","import { name } from '../../constants';\n\nexport interface Example<Flags> {\n /** A description of the example */\n description: string;\n /** The flag arguments to the command */\n flags: Partial<Flags>;\n}\n\n/**\n * Builds a string of examples for the CLI\n *\n * @param commandPath - The path to the command to run, omitting the `transcend` command name, e.g., `['consent', 'upload-preferences']`\n * @param examples - The examples to build\n * @returns A string of examples for the CLI\n */\nexport function buildExamples<Flags = never>(\n commandPath: string[],\n examples: NoInfer<Example<Flags>>[],\n): string {\n return examples\n .map((example) => {\n const exampleCommand = buildExampleCommand<Flags>(\n commandPath,\n example.flags,\n );\n return `**${example.description}**\\n\\n\\`\\`\\`sh\\n${exampleCommand}\\n\\`\\`\\``;\n })\n .join('\\n\\n');\n}\n\n/**\n * Builds a command string for an example\n *\n * @param commandPath - The path to the command to run, omitting the `transcend` command name, e.g., `['consent', 'upload-preferences']`\n * @param flags - The flags to build the command with\n * @param options - The options for the command\n * @returns A command string for the example\n */\nexport function buildExampleCommand<Flags = never>(\n commandPath: string[],\n flags: NoInfer<Partial<Flags>>,\n options?: {\n /** If true, the command will be forced to a single line */\n forceSingleLine?: boolean;\n /** If true, the command will be indented */\n argsIndent?: number;\n },\n): string {\n const command = commandPath.join(' ');\n const flagList = getFlagList(flags);\n const { forceSingleLine = false, argsIndent = 2 } = options ?? {};\n\n if (flagList.length === 0) {\n return `${name} ${command}`;\n }\n\n // Break the command into multiple lines if it's too long\n const exampleCommand =\n `${name} ${command} ${flagList.join(' ')}`.length <= 117 && !forceSingleLine\n ? `${command} ${flagList.join(' ')}`\n : `${command} \\\\\\n${' '.repeat(argsIndent)}${flagList.join(\n ` \\\\\\n${' '.repeat(argsIndent)}`,\n )}`;\n\n // Add `transcend` before command name\n return `${name} ${exampleCommand}`;\n}\n\n/**\n * Formats a flag value to the bash string for an example command\n *\n * @param value - The value to format\n * @param depth - The depth of the recursion\n * @returns The formatted value\n */\nfunction formatFlagValue(value: unknown, depth = 0): string {\n if (typeof value === 'boolean') {\n return value ? 'true' : 'false';\n }\n\n if (typeof value === 'number') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toISOString();\n }\n\n if (Array.isArray(value) && depth === 0) {\n const values = value.map((v) => formatFlagValue(v, depth + 1));\n if (values.every((x) => x.startsWith('$') || x.includes(' '))) {\n return `\"${values.join(',')}\"`;\n }\n return values.join(',');\n }\n\n if (typeof value === 'string') {\n // If we're operating on list elements\n if (depth === 1) {\n if (value.startsWith('$')) {\n return `$\\{${value.slice(1)}}`;\n }\n return value;\n }\n\n // Escape strings that start with $ or contain spaces or special characters\n return value.startsWith('$') || value.includes(' ') ? `\"${value}\"` : value;\n }\n\n throw new Error(`Unsupported value type: ${typeof value}`);\n}\n\n/**\n * Builds a list of flags formatted for an example command\n *\n * @param flags - The flags to build the command with\n * @param depth - The depth of the recursion\n * @returns A list of flags for the example command\n */\nexport function getFlagList<Flags = never>(\n flags: Partial<Flags>,\n depth = 0,\n): string[] {\n return Object.entries(flags).map(([flag, value]) => {\n if (typeof value === 'boolean' && value) {\n // For true booleans, just pass the flag alone\n return `--${flag}`;\n }\n\n const formattedValue = formatFlagValue(value, depth);\n\n return `--${flag}=${formattedValue}`;\n });\n}\n","import { buildCommand } from '@stricli/core';\n\nexport const consentManagersToBusinessEntitiesCommand = buildCommand({\n loader: async () => {\n const { consentManagersToBusinessEntities } = await import('./impl');\n return consentManagersToBusinessEntities;\n },\n parameters: {\n flags: {\n consentManagerYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the folder of Consent Manager transcend.yml files to combine',\n },\n output: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the output transcend.yml with business entity configuration',\n default: './combined-business-entities.yml',\n },\n },\n },\n docs: {\n brief: 'Convert consent managers to business entities',\n fullDescription:\n 'This command allows for converting a folder or Consent Manager transcend.yml files into a single transcend.yml file where each consent manager configuration is a Business Entity in the data inventory.',\n },\n});\n","import { buildCommand, type TypedFlagParameter } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { OneTrustPullResource, OneTrustPullSource } from '../../../enums';\nimport type { LocalContext } from '../../../context';\n\nexport const syncOtCommand = buildCommand({\n loader: async () => {\n const { syncOt } = await import('./impl');\n return syncOt;\n },\n parameters: {\n flags: {\n hostname: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The domain of the OneTrust environment from which to pull the resource',\n optional: true,\n },\n oneTrustAuth: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The OAuth access token with the scopes necessary to access the OneTrust Public APIs',\n optional: true,\n },\n source: {\n kind: 'enum',\n values: Object.values(OneTrustPullSource) as OneTrustPullSource[],\n brief: 'Whether to read the assessments from OneTrust or from a file',\n default: OneTrustPullSource.OneTrust,\n },\n transcendAuth: {\n ...createAuthParameter({\n scopes: [ScopeName.ManageAssessments],\n }),\n optional: true,\n } as TypedFlagParameter<string | undefined, LocalContext>,\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the file to pull the resource into. Must be a json file!',\n optional: true,\n },\n resource: {\n kind: 'enum',\n values: Object.values(OneTrustPullResource) as OneTrustPullResource[],\n brief:\n 'The resource to pull from OneTrust. For now, only assessments is supported',\n default: OneTrustPullResource.Assessments,\n },\n dryRun: {\n kind: 'boolean',\n brief:\n 'Whether to export the resource to a file rather than sync to Transcend',\n default: false,\n },\n debug: {\n kind: 'boolean',\n brief: 'Whether to print detailed logs in case of error',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Sync OneTrust data',\n fullDescription: `Pulls resources from a OneTrust and syncs them to a Transcend instance. For now, it only supports retrieving OneTrust Assessments.\n\nThis command can be helpful if you are looking to:\n- Pull resources from your OneTrust account.\n- Migrate your resources from your OneTrust account to Transcend.\n\nOneTrust authentication requires an OAuth Token with scope for accessing the assessment endpoints.\nIf syncing the resources to Transcend, you will also need to generate an API key on the Transcend Admin Dashboard.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { syncOtCommand } from './sync-ot/command';\n\nexport const migrationRoutes = buildRouteMap({\n routes: {\n 'sync-ot': syncOtCommand,\n },\n docs: {\n brief: 'Migration commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport type { PullIdentifiersCommandFlags } from '../pull-identifiers/impl';\nimport { buildExampleCommand } from '../../../../lib/docgen/buildExamples';\nimport type { MarkIdentifiersCompletedCommandFlags } from './impl';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const markIdentifiersCompletedCommand = buildCommand({\n loader: async () => {\n const { markIdentifiersCompleted } = await import('./impl');\n return markIdentifiersCompleted;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n requiresSiloScope: true,\n }),\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the data silo to pull in',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n sombraAuth: createSombraAuthParameter(),\n },\n },\n docs: {\n brief: 'Mark identifiers as completed after processing.',\n fullDescription: `This command takes the output of \"${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'cron', 'pull-identifiers'],\n {},\n )}\" and notifies Transcend that all of the requests in the CSV have been processed.\nThis is used in the workflow like:\n\n1. Pull identifiers to CSV:\n\n ${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'cron', 'pull-identifiers'],\n {\n auth: '$TRANSCEND_API_KEY',\n dataSiloId: '70810f2e-cf90-43f6-9776-901a5950599f',\n actions: [RequestAction.Erasure],\n file: './outstanding-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\n2. Run your process to operate on that CSV of requests.\n\n3. Notify Transcend of completion\n\n ${buildExampleCommand<MarkIdentifiersCompletedCommandFlags>(\n ['request', 'cron', 'mark-identifiers-completed'],\n {\n auth: '$TRANSCEND_API_KEY',\n dataSiloId: '70810f2e-cf90-43f6-9776-901a5950599f',\n file: './outstanding-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\nRead more at https://docs.transcend.io/docs/integrations/cron-job-integration.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const pullIdentifiersCommand = buildCommand({\n loader: async () => {\n const { pullIdentifiers } = await import('./impl');\n return pullIdentifiers;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n requiresSiloScope: true,\n }),\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the data silo to pull in',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to restart',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n sombraAuth: createSombraAuthParameter(),\n pageLimit: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page limit to use when pulling in pages of identifiers',\n default: '100',\n },\n skipRequestCount: {\n kind: 'boolean',\n brief:\n 'Whether to skip the count of all outstanding requests. This is required to render the progress bar, but can take a long time to run if you have a large number of outstanding requests to process. In that case, we recommend setting skipRequestCount=true so that you can still proceed with fetching the identifiers',\n default: false,\n },\n chunkSize: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Maximum number of rows per CSV file. For large datasets, the output will be automatically split into multiple files to avoid file system size limits. Each file will contain at most this many rows',\n default: '10000',\n },\n },\n },\n docs: {\n brief: 'Pull identifiers of outstanding requests for a data silo to a CSV.',\n fullDescription: `If you are using the cron job integration, you can run this command to pull the outstanding identifiers for the data silo to a CSV.\n\nFor large datasets, the output will be automatically split into multiple CSV files to avoid file system size limits. Use the --chunkSize parameter to control the maximum number of rows per file.\n\nRead more at https://docs.transcend.io/docs/integrations/cron-job-integration.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const pullProfilesCommand = buildCommand({\n loader: async () => {\n const { pullProfiles } = await import('./impl');\n return pullProfiles;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n requiresSiloScope: true,\n }),\n cronDataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the cron data silo to pull in',\n },\n targetDataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the target data silo to pull in',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to restart',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers.csv',\n },\n fileTarget: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers-target.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n sombraAuth: createSombraAuthParameter(),\n pageLimit: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page limit to use when pulling in pages of identifiers',\n default: '100',\n },\n skipRequestCount: {\n kind: 'boolean',\n brief:\n 'Whether to skip the count of all outstanding requests. This is required to render the progress bar, but can take a long time to run if you have a large number of outstanding requests to process. In that case, we recommend setting skipRequestCount=true so that you can still proceed with fetching the identifiers',\n default: false,\n },\n chunkSize: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Maximum number of rows per CSV file. For large datasets, the output will be automatically split into multiple files to avoid file system size limits. Each file will contain at most this many rows',\n default: '10000',\n },\n },\n },\n docs: {\n brief: 'Pull profiles of outstanding requests for a data silo to a CSV.',\n fullDescription: `If you are using the cron job integration, you can run this command to pull the outstanding profiles for the data silo to a CSV.\n\nFor large datasets, the output will be automatically split into multiple CSV files to avoid file system size limits. Use the --chunkSize parameter to control the maximum number of rows per file.\n\nRead more at https://docs.transcend.io/docs/integrations/cron-job-integration.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { markIdentifiersCompletedCommand } from './mark-identifiers-completed/command';\nimport { pullIdentifiersCommand } from './pull-identifiers/command';\nimport { pullProfilesCommand } from './pull-profiles/command';\n\nexport const cronRoutes = buildRouteMap({\n routes: {\n 'pull-identifiers': pullIdentifiersCommand,\n 'pull-profiles': pullProfilesCommand,\n 'mark-identifiers-completed': markIdentifiersCompletedCommand,\n },\n docs: {\n brief: 'Cron commands',\n hideRoute: {\n 'pull-profiles': true,\n },\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n RequestAction,\n RequestEnricherStatus,\n ScopeName,\n} from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const enricherRestartCommand = buildCommand({\n loader: async () => {\n const { enricherRestart } = await import('./impl');\n return enricherRestart;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageRequestCompilation],\n }),\n enricherId: {\n kind: 'parsed',\n parse: String,\n brief: 'The ID of the enricher to restart',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request action to restart',\n optional: true,\n },\n requestEnricherStatuses: {\n kind: 'enum',\n values: Object.values(RequestEnricherStatus),\n variadic: ',',\n brief: 'The request enricher statuses to restart',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '15',\n },\n requestIds: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'Specify the specific request IDs to restart',\n optional: true,\n },\n createdAtBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Restart requests that were submitted before this time',\n optional: true,\n },\n createdAtAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Restart requests that were submitted after this time',\n optional: true,\n },\n },\n },\n docs: {\n brief: 'Bulk restart a particular enricher across a series of DSRs',\n fullDescription: `Bulk restart a particular enricher across a series of DSRs.\n\nThe API key needs the following scopes:\n- Manage Request Compilation`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n RequestAction,\n RequestStatus,\n ScopeName,\n} from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const exportCommand = buildCommand({\n loader: async () => {\n const { _export } = await import('./impl');\n return _export;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewRequests, ScopeName.ViewRequestCompilation],\n }),\n sombraAuth: createSombraAuthParameter(),\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to export',\n optional: true,\n },\n statuses: {\n kind: 'enum',\n values: Object.values(RequestStatus),\n variadic: ',',\n brief: 'The request statuses to export',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './transcend-request-export.csv',\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n createdAtBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Pull requests that were submitted before this time',\n optional: true,\n },\n createdAtAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Pull requests that were submitted after this time',\n optional: true,\n },\n showTests: {\n kind: 'boolean',\n brief:\n 'Filter for test requests or production requests - when not provided, pulls both',\n optional: true,\n },\n pageLimit: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page limit to use when pulling in pages of requests',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Export privacy requests and request identifiers to a CSV file',\n fullDescription:\n 'Export privacy requests and request identifiers to a CSV file.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { RequestAction, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { buildExampleCommand } from '../../../../lib/docgen/buildExamples';\nimport type { PullIdentifiersCommandFlags } from './impl';\nimport type { PushIdentifiersCommandFlags } from '../push-identifiers/impl';\n\nexport const pullIdentifiersCommand = buildCommand({\n loader: async () => {\n const { pullIdentifiers } = await import('./impl');\n return pullIdentifiers;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewRequests, ScopeName.ViewRequestCompilation],\n }),\n sombraAuth: createSombraAuthParameter(),\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where requests will be written to',\n default: './manual-enrichment-identifiers.csv',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to pull for',\n optional: true,\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Pull identifiers for manual enrichment',\n fullDescription: `This command pulls down the set of privacy requests that are currently pending manual enrichment.\n\nThis is useful for the following workflow:\n\n1. Pull identifiers to CSV:\n\n ${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'preflight', 'pull-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\n2. Fill out the CSV with additional identifiers\n\n3. Push updated back to Transcend:\n\n ${buildExampleCommand<PushIdentifiersCommandFlags>(\n ['request', 'preflight', 'push-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport { buildExampleCommand } from '../../../../lib/docgen/buildExamples';\nimport type { PullIdentifiersCommandFlags } from '../pull-identifiers/impl';\nimport type { PushIdentifiersCommandFlags } from './impl';\n\nexport const pushIdentifiersCommand = buildCommand({\n loader: async () => {\n const { pushIdentifiers } = await import('./impl');\n return pushIdentifiers;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.ManageRequestIdentities,\n ScopeName.ManageRequestCompilation,\n ],\n }),\n enricherId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the Request Enricher to upload to',\n },\n sombraAuth: createSombraAuthParameter(),\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where requests will be written to',\n default: './manual-enrichment-identifiers.csv',\n },\n markSilent: {\n kind: 'boolean',\n brief: 'When true, set requests into silent mode before enriching',\n default: false,\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Push identifiers for manual enrichment',\n fullDescription: `This command push up a set of identifiers for a set of requests pending manual enrichment.\n\nThis is useful for the following workflow:\n\n1. Pull identifiers to CSV:\n\n ${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'preflight', 'pull-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\n2. Fill out the CSV with additional identifiers\n\n3. Push updated back to Transcend:\n\n ${buildExampleCommand<PushIdentifiersCommandFlags>(\n ['request', 'preflight', 'push-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { pullIdentifiersCommand } from './pull-identifiers/command';\nimport { pushIdentifiersCommand } from './push-identifiers/command';\n\nexport const preflightRoutes = buildRouteMap({\n routes: {\n 'pull-identifiers': pullIdentifiersCommand,\n 'push-identifiers': pushIdentifiersCommand,\n },\n docs: {\n brief: 'Preflight commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { RequestAction, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\n\nexport const retryRequestDataSilosCommand = buildCommand({\n loader: async () => {\n const { retryRequestDataSilos } = await import('./impl');\n return retryRequestDataSilos;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageRequestCompilation],\n }),\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the data silo to pull in',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to restart',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Retry request data silos',\n fullDescription:\n 'This command allows for bulk restarting a set of data silos jobs for open privacy requests. This is equivalent to clicking the \"Wipe and Retry\" button for a particular data silo across a set of privacy requests.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadCommand = buildCommand({\n loader: async () => {\n const { upload } = await import('./impl');\n return upload;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.MakeDataSubjectRequest,\n ScopeName.ViewRequestIdentitySettings,\n ScopeName.ViewGlobalAttributes,\n ],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file of requests to upload',\n default: './requests.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n cacheFilepath: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The path to the JSON file encoding the metadata used to map the CSV shape to Transcend API',\n default: './transcend-privacy-requests-cache.json',\n },\n requestReceiptFolder: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The path to the folder where receipts of each upload are stored',\n default: './privacy-request-upload-receipts',\n },\n sombraAuth: createSombraAuthParameter(),\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '50',\n },\n attributes: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Tag all of the requests with the following attributes. Format: key1:value1;value2,key2:value3;value4',\n default: 'Tags:transcend-cli',\n },\n isTest: {\n kind: 'boolean',\n brief:\n 'Flag whether the requests being uploaded are test requests or regular requests',\n default: false,\n },\n isSilent: {\n kind: 'boolean',\n brief:\n 'Flag whether the requests being uploaded should be submitted in silent mode',\n default: true,\n },\n skipSendingReceipt: {\n kind: 'boolean',\n brief: 'Flag whether to skip sending of the receipt email',\n default: false,\n },\n emailIsVerified: {\n kind: 'boolean',\n brief:\n 'Indicate whether the email address being uploaded is pre-verified. Set to false to send a verification email',\n default: true,\n },\n skipFilterStep: {\n kind: 'boolean',\n brief: 'When true, skip the interactive step to filter down the CSV',\n default: false,\n },\n dryRun: {\n kind: 'boolean',\n brief:\n 'When true, perform a dry run of the upload instead of calling the API to submit the requests',\n default: false,\n },\n debug: {\n kind: 'boolean',\n brief: 'Debug logging',\n default: false,\n },\n defaultPhoneCountryCode: {\n kind: 'parsed',\n parse: String,\n brief:\n 'When uploading phone numbers, if the phone number is missing a country code, assume this country code',\n default: '1',\n },\n },\n },\n docs: {\n brief: 'Upload a set of requests from a CSV',\n fullDescription: `Upload a set of requests from a CSV.\n\nThis command prompts you to map the shape of the CSV to the shape of the Transcend API. There is no requirement for the shape of the incoming CSV, as the script will handle the mapping process.\n\nThe script will also produce a JSON cache file that allows for the mappings to be preserved between runs.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { approveCommand } from './approve/command';\nimport { cancelCommand } from './cancel/command';\nimport { cronRoutes } from './cron/routes';\nimport { downloadFilesCommand } from './download-files/command';\nimport { enricherRestartCommand } from './enricher-restart/command';\nimport { exportCommand } from './export/command';\nimport { markSilentCommand } from './mark-silent/command';\nimport { notifyAdditionalTimeCommand } from './notify-additional-time/command';\nimport { preflightRoutes } from './preflight/routes';\nimport { rejectUnverifiedIdentifiersCommand } from './reject-unverified-identifiers/command';\nimport { restartCommand } from './restart/command';\nimport { skipPreflightJobsCommand } from './skip-preflight-jobs/command';\nimport { systemRoutes } from './system/routes';\nimport { uploadCommand } from './upload/command';\n\nexport const requestRoutes = buildRouteMap({\n routes: {\n approve: approveCommand,\n upload: uploadCommand,\n 'download-files': downloadFilesCommand,\n cancel: cancelCommand,\n restart: restartCommand,\n 'notify-additional-time': notifyAdditionalTimeCommand,\n 'mark-silent': markSilentCommand,\n 'enricher-restart': enricherRestartCommand,\n 'reject-unverified-identifiers': rejectUnverifiedIdentifiersCommand,\n export: exportCommand,\n 'skip-preflight-jobs': skipPreflightJobsCommand,\n system: systemRoutes,\n preflight: preflightRoutes,\n cron: cronRoutes,\n },\n docs: {\n brief: 'All commands related to DSR requests',\n },\n});\n"]}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk7UL54E7Xcjs = require('./chunk-7UL54E7X.cjs');var _inquirer = require('inquirer'); var _inquirer2 = _interopRequireDefault(_inquirer);var _inquirerautocompleteprompt = require('inquirer-autocomplete-prompt'); var _inquirerautocompleteprompt2 = _interopRequireDefault(_inquirerautocompleteprompt);async function c({message:e}){let{response:r}=await _inquirer2.default.prompt([{name:"response",message:e,type:"confirm"}]);return r}async function l({message:e}){let{response:r}=await _inquirer2.default.prompt([{name:"response",message:e,type:"text",validate:t=>t.trim().length>0}]);return r}async function y({defaultValue:e,values:r,message:t}){_inquirer2.default.registerPrompt("autocomplete",_inquirerautocompleteprompt2.default);let{response:p}=await _inquirer2.default.prompt([{name:"response",message:t,type:"autocomplete",default:e,source:(a,n)=>n?r.filter(s=>typeof s=="string"&&_chunk7UL54E7Xcjs.k.call(void 0, n,s)):r}]);return p}exports.a = c; exports.b = l; exports.c = y;
2
- //# sourceMappingURL=chunk-N7QF44VW.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-N7QF44VW.cjs","../src/lib/helpers/inquirer.ts"],"names":["inquirerConfirmBoolean","message","response","inquirer","inquirerConfirmText","x","inquirerAutoComplete","defaultValue","values","autoCompletePrompt","answersSoFar","input","fuzzySearch"],"mappings":"AAAA,iOAAwC,wFCAnB,kKACU,MAU/B,SAAsBA,CAAAA,CAAuB,CAC3C,OAAA,CAAAC,CACF,CAAA,CAGqB,CACnB,GAAM,CAAE,QAAA,CAAAC,CAAS,CAAA,CAAI,MAAMC,kBAAAA,CAAS,MAAA,CAGjC,CACD,CACE,IAAA,CAAM,UAAA,CACN,OAAA,CAAAF,CAAAA,CACA,IAAA,CAAM,SACR,CACF,CAAC,CAAA,CACD,OAAOC,CACT,CAQA,MAAA,SAAsBE,CAAAA,CAAoB,CACxC,OAAA,CAAAH,CACF,CAAA,CAGoB,CAClB,GAAM,CAAE,QAAA,CAAAC,CAAS,CAAA,CAAI,MAAMC,kBAAAA,CAAS,MAAA,CAGjC,CACD,CACE,IAAA,CAAM,UAAA,CACN,OAAA,CAAAF,CAAAA,CACA,IAAA,CAAM,MAAA,CACN,QAAA,CAAWI,CAAAA,EAAMA,CAAAA,CAAE,IAAA,CAAK,CAAA,CAAE,MAAA,CAAS,CACrC,CACF,CAAC,CAAA,CACD,OAAOH,CACT,CAQA,MAAA,SAAsBI,CAAAA,CAAqB,CACzC,YAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,OAAA,CAAAP,CACF,CAAA,CAOoB,CAClBE,kBAAAA,CAAS,cAAA,CAAe,cAAA,CAAgBM,oCAAkB,CAAA,CAC1D,GAAM,CAAE,QAAA,CAAAP,CAAS,CAAA,CAAI,MAAMC,kBAAAA,CAAS,MAAA,CAGjC,CACD,CACE,IAAA,CAAM,UAAA,CACN,OAAA,CAAAF,CAAAA,CACA,IAAA,CAAM,cAAA,CACN,OAAA,CAASM,CAAAA,CACT,MAAA,CAAQ,CAACG,CAAAA,CAA2BC,CAAAA,CAAAA,EACjCA,CAAAA,CAEGH,CAAAA,CAAO,MAAA,CACJH,CAAAA,EAAM,OAAOA,CAAAA,EAAM,QAAA,EAAYO,iCAAAA,CAAYD,CAAON,CAAC,CACtD,CAAA,CAHAG,CAIR,CACF,CAAC,CAAA,CACD,OAAON,CACT,CAAA,4CAAA","file":"/home/runner/work/cli/cli/dist/chunk-N7QF44VW.cjs","sourcesContent":[null,"import inquirer from 'inquirer';\nimport autoCompletePrompt from 'inquirer-autocomplete-prompt';\nimport { fuzzySearch } from '../requests';\nimport { ObjByString } from '@transcend-io/type-utils';\n\n/**\n * Inquirer confirm text\n *\n * @param options - Options\n * @returns The response\n */\nexport async function inquirerConfirmBoolean({\n message,\n}: {\n /** Message */\n message: string;\n}): Promise<boolean> {\n const { response } = await inquirer.prompt<{\n /** confirmation */\n response: boolean;\n }>([\n {\n name: 'response',\n message,\n type: 'confirm',\n },\n ]);\n return response;\n}\n\n/**\n * Inquirer confirm text\n *\n * @param options - Options\n * @returns The response\n */\nexport async function inquirerConfirmText({\n message,\n}: {\n /** Message */\n message: string;\n}): Promise<string> {\n const { response } = await inquirer.prompt<{\n /** confirmation */\n response: string;\n }>([\n {\n name: 'response',\n message,\n type: 'text',\n validate: (x) => x.trim().length > 0,\n },\n ]);\n return response;\n}\n\n/**\n * Inquirer auto complete\n *\n * @param options - Options\n * @returns The response\n */\nexport async function inquirerAutoComplete({\n defaultValue,\n values,\n message,\n}: {\n /** Default value */\n defaultValue?: string;\n /** Message */\n message: string;\n /** Values to select */\n values: string[];\n}): Promise<string> {\n inquirer.registerPrompt('autocomplete', autoCompletePrompt);\n const { response } = await inquirer.prompt<{\n /** confirmation */\n response: string;\n }>([\n {\n name: 'response',\n message,\n type: 'autocomplete',\n default: defaultValue,\n source: (answersSoFar: ObjByString, input: string) =>\n !input\n ? values\n : values.filter(\n (x) => typeof x === 'string' && fuzzySearch(input, x),\n ),\n },\n ]);\n return response;\n}\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkBPX6MSMCcjs = require('./chunk-BPX6MSMC.cjs');var _chunk7UL54E7Xcjs = require('./chunk-7UL54E7X.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunkUONUI4ABcjs = require('./chunk-UONUI4AB.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXPKFB4ILcjs = require('./chunk-XPKFB4IL.cjs');var _chunk44J2TVZUcjs = require('./chunk-44J2TVZU.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=_chunkXPKFB4ILcjs.e,bundleTypes:t=Object.values(_privacytypes.ConsentBundleType)}){let r=_chunkUONUI4ABcjs.Ud.call(void 0, o,e),n=await _chunkUONUI4ABcjs.sc.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 _chunkUONUI4ABcjs.Yd.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 _chunkUONUI4ABcjs.Xd.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=_chunkXPKFB4ILcjs.e}){let n=_chunkUONUI4ABcjs.Ud.call(void 0, r,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let l=_chunk7UL54E7Xcjs.q.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:_chunk7UL54E7Xcjs.n.call(void 0, E),status:g||i,owners:I?_chunk7UL54E7Xcjs.n.call(void 0, I):void 0,teams:T?_chunk7UL54E7Xcjs.n.call(void 0, T):void 0,attributes:Object.entries(y).filter(([h])=>!K.includes(h)).map(([h,B])=>({key:h,values:_chunk7UL54E7Xcjs.n.call(void 0, B)}))}));await _chunkUONUI4ABcjs.dd.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=_chunkXPKFB4ILcjs.e}){let r=_chunkUONUI4ABcjs.Ud.call(void 0, t,e);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let a=_chunk7UL54E7Xcjs.q.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:_chunk7UL54E7Xcjs.n.call(void 0, f),status:E||i,owners:g?_chunk7UL54E7Xcjs.n.call(void 0, g):void 0,teams:I?_chunk7UL54E7Xcjs.n.call(void 0, I):void 0,attributes:Object.entries(v).filter(([y])=>!j.includes(y)).map(([y,h])=>({key:y,values:_chunk7UL54E7Xcjs.n.call(void 0, h)}))}));await _chunkUONUI4ABcjs.yc.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 _chunkUONUI4ABcjs.sc.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([_chunkUONUI4ABcjs.vc.call(void 0, e,{dataSource:"PRIVACY_SIGNAL_TIMESERIES",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1}),_chunkUONUI4ABcjs.vc.call(void 0, e,{dataSource:"CONSENT_CHANGES_TIMESERIES",startDate:l,endDate:s,forceRefetch:!0,airgapBundleId:r,binInterval:i,smoothTimeseries:!1}),_chunkUONUI4ABcjs.vc.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=_chunkXPKFB4ILcjs.e,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=_chunkUONUI4ABcjs.Ud.call(void 0, o,m.apiKey);return await _chunkUONUI4ABcjs.rc.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=_chunk44J2TVZUcjs.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
- <!DOCTYPE html>
3
- <script
4
- src="${i}"
5
- data-sync-groups='${JSON.stringify(s,null,2)}'
6
- data-xdi-commands="${n}"
7
- ></script>
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
-
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(_chunkBPX6MSMCcjs.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-PQTI6C4Q.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-PQTI6C4Q.cjs","../src/lib/consent-manager/updateConsentManagerVersionToLatest.ts","../src/lib/consent-manager/uploadDataFlowsFromCsv.ts","../src/lib/consent-manager/uploadCookiesFromCsv.ts","../src/lib/consent-manager/pullConsentManagerMetrics.ts","../src/lib/consent-manager/domainToHost.ts","../src/lib/consent-manager/buildXdiSyncEndpoint.ts","../src/lib/consent-manager/consentManagersToBusinessEntities.ts","../src/lib/consent-manager/fetchConsentPreferences.ts"],"names":["updateConsentManagerVersionToLatest","auth","deploy","transcendUrl","DEFAULT_TRANSCEND_API","bundleTypes","ConsentBundleType","client","buildTranscendGraphQLClient","consentManagerId","fetchConsentManagerId","mapSeries","bundleType","logger","colors","updateConsentManagerToLatest","deployConsentManager","OMIT_COLUMNS","uploadDataFlowsFromCsv","trackerStatus","file","classifyService","validatedDataFlowInputs","readCsv","DataFlowCsvInput","Type","Notes","Service","Purpose","Status","Owners","Teams","value","rest","splitCsvToList","key","syncDataFlows","uploadCookiesFromCsv","validatedCookieInputs","CookieCsvInput","isRegex","Name","syncCookies","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_WEEK","pullConsentManagerMetrics","bin","start","end","airgapBundleId","startTime","endTime","startDate","endDate","privacySignalData","consentChangesData","consentSessionsByRegimeData","fetchConsentManagerAnalyticsData","domainToHost","domain"],"mappings":"AAAA,u/BAAwC,wDAA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CAAY,4BAAA,CACZ,SAAA,CAAAgD,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAc,CAAA,CAAA,CACd,cAAA,CAAAJ,CAAAA,CACA,WAAA,CAAaH,CAAAA,CACb,gBAAA,CAAkB,CAAA,CACpB,CAAC,CAAA,CACDW,kCAAAA,CAAiCrD,CAAQ,CACvC,UAAA,CAAY,4BAAA,CACZ,SAAA,CAAAgD,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAc,CAAA,CAAA,CACd,cAAA,CAAAJ,CAAAA,CACA,WAAA,CAAaH,CAAAA,CACb,gBAAA,CAAkB,CAAA,CACpB,CAAC,CACH,CAAC,CAAA,CAEH,MAAO,CACL,yBAAA,CAA2BQ,CAAAA,CAC3B,0BAAA,CAA4BC,CAAAA,CAC5B,0BAAA,CAA4BC,CAC9B,CACF,CChGO,IAAME,CAAAA,CAAgBC,CAAAA,EAC3B,IAAI,GAAA,CAAI,CAAA,QAAA,EAAWA,CAAM,CAAA,CAAA;ACiHA;AAAA;AAGT,KAAA;AACqC,kBAAA;AAChB,mBAAA;AAAA;AC5DzB;AAAA;AAAA;ACmBd,uBAAA","file":"/home/runner/work/cli/cli/dist/chunk-PQTI6C4Q.cjs","sourcesContent":[null,"import { ConsentBundleType } from '@transcend-io/privacy-types';\nimport { mapSeries } from 'bluebird';\nimport {\n updateConsentManagerToLatest,\n buildTranscendGraphQLClient,\n fetchConsentManagerId,\n deployConsentManager,\n} from '../graphql';\nimport colors from 'colors';\n\nimport { logger } from '../../logger';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\n/**\n * Update the consent manager to latest version\n *\n * @param options - Options\n */\nexport async function updateConsentManagerVersionToLatest({\n auth,\n deploy = false,\n transcendUrl = DEFAULT_TRANSCEND_API,\n bundleTypes = Object.values(ConsentBundleType),\n}: {\n /** Transcend API key authentication */\n auth: string;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** Deploy consent manager with this update */\n deploy?: boolean;\n /** The bundle types to update and deploy */\n bundleTypes?: ConsentBundleType[];\n}): Promise<void> {\n // Find all requests made before createdAt that are in a removing data state\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Grab Consent Manager ID\n const consentManagerId = await fetchConsentManagerId(client);\n\n // Update each bundle type to latest version\n await mapSeries(bundleTypes, async (bundleType) => {\n logger.info(\n colors.magenta(\n `Update Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\" to latest version...`,\n ),\n );\n await updateConsentManagerToLatest(client, {\n id: consentManagerId,\n bundleType,\n });\n logger.info(\n colors.green(\n `Updated Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\" to latest version!`,\n ),\n );\n });\n\n // deploy Consent Managers\n if (deploy) {\n // Update each bundle type to latest version\n await mapSeries(bundleTypes, async (bundleType) => {\n logger.info(\n colors.magenta(\n `Deploying Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\"...`,\n ),\n );\n await deployConsentManager(client, {\n id: consentManagerId,\n bundleType,\n });\n logger.info(\n colors.green(\n `Deployed Consent Manager bundle with ID \"${consentManagerId}\" and type \"${bundleType}\"!`,\n ),\n );\n });\n }\n}\n","import colors from 'colors';\nimport { logger } from '../../logger';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncDataFlows } from '../graphql';\nimport { readCsv } from '../requests/readCsv';\nimport { DataFlowInput, DataFlowCsvInput } from '../../codecs';\nimport { splitCsvToList } from '../requests';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of data flows from CSV\n *\n * @param options - Options\n */\nexport async function uploadDataFlowsFromCsv({\n auth,\n trackerStatus,\n file,\n classifyService = false,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of data flow inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const dataFlowInputs = readCsv(file, DataFlowCsvInput);\n\n // Convert these data flow inputs into a format that the other function can use\n const validatedDataFlowInputs = dataFlowInputs.map(\n ({\n Type,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n 'Connections Made To': value,\n ...rest\n }): DataFlowInput => ({\n value,\n type: Type,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the data flows into Transcend dashboard\n const syncedDataFlows = await syncDataFlows(\n client,\n validatedDataFlowInputs,\n classifyService,\n );\n\n // Log errors\n if (!syncedDataFlows) {\n logger.error(\n colors.red(\n 'Encountered error(s) syncing data flows from CSV, see logs above for more info. ',\n ),\n );\n process.exit(1);\n }\n}\n","import colors from 'colors';\nimport { logger } from '../../logger';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, syncCookies } from '../graphql';\nimport { readCsv } from '../requests/readCsv';\nimport { CookieInput, CookieCsvInput } from '../../codecs';\nimport { splitCsvToList } from '../requests';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nconst OMIT_COLUMNS = [\n 'ID',\n 'Activity',\n 'Encounters',\n 'Last Seen At',\n 'Has Native Do Not Sell/Share Support',\n 'IAB USP API Support',\n 'Service Description',\n 'Website URL',\n 'Categories of Recipients',\n];\n\n/**\n * Upload a set of cookies from CSV\n *\n * @param options - Options\n */\nexport async function uploadCookiesFromCsv({\n auth,\n trackerStatus,\n file,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** CSV file path */\n file: string;\n /** Transcend API key authentication */\n auth: string;\n /** Sombra API key authentication */\n trackerStatus: ConsentTrackerStatus;\n /** API URL for Transcend backend */\n transcendUrl?: string;\n}): Promise<void> {\n // Build a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read from CSV the set of cookie inputs\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const cookieInputs = readCsv(file, CookieCsvInput);\n\n // Convert these inputs into a format that the other function can use\n const validatedCookieInputs = cookieInputs.map(\n ({\n 'Is Regex?': isRegex,\n Notes,\n // TODO: https://transcend.height.app/T-26391 - export in CSV\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Service,\n Purpose,\n Status,\n Owners,\n Teams,\n Name,\n ...rest\n }): CookieInput => ({\n ...(typeof isRegex === 'string'\n ? { isRegex: isRegex.toLowerCase() === 'true' }\n : {}),\n name: Name,\n description: Notes,\n trackingPurposes: splitCsvToList(Purpose),\n // TODO: https://transcend.height.app/T-26391\n // service: Service,\n // Apply the trackerStatus to all values in the CSV -> allows for customer to define tracker status\n // on a row by row basis if needed\n status: Status || trackerStatus,\n owners: Owners ? splitCsvToList(Owners) : undefined,\n teams: Teams ? splitCsvToList(Teams) : undefined,\n // all remaining options are attribute\n attributes: Object.entries(rest)\n // filter out native columns that are exported from the admin dashboard\n // but not custom attributes\n .filter(([key]) => !OMIT_COLUMNS.includes(key))\n .map(([key, value]) => ({\n key,\n values: splitCsvToList(value),\n })),\n }),\n );\n\n // Upload the cookies into Transcend dashboard\n const syncedCookies = await syncCookies(client, validatedCookieInputs);\n\n // Log errors\n if (!syncedCookies) {\n logger.error(\n colors.red(\n 'Encountered error(s) syncing cookies from CSV, see logs above for more info. ',\n ),\n );\n process.exit(1);\n }\n}\n","import type { GraphQLClient } from 'graphql-request';\nimport {\n ConsentManagerMetric,\n ConsentManagerMetricBin,\n fetchConsentManagerAnalyticsData,\n fetchConsentManagerId,\n} from '../graphql';\n\n/**\n * One second of time in ms\n */\nconst ONE_SECOND = 1000;\nconst ONE_MINUTE = 60 * ONE_SECOND;\nconst ONE_HOUR = 60 * ONE_MINUTE;\nconst ONE_DAY = 24 * ONE_HOUR;\nconst ONE_WEEK = 7 * ONE_DAY;\n\n/**\n * Pull consent manager metrics in an organization\n *\n * @param client - GraphQL client\n * @param options - Options\n * @returns The consent manager metrics\n */\nexport async function pullConsentManagerMetrics(\n client: GraphQLClient,\n {\n bin,\n start,\n end = new Date(),\n }: {\n /** Start date to pull metrics from */\n start: Date;\n /** End date to pull metrics from (assumes now) */\n end?: Date;\n /** Bin size to pull metrics */\n bin: ConsentManagerMetricBin;\n },\n): Promise<{\n /** Privacy signal data */\n PRIVACY_SIGNAL_TIMESERIES: ConsentManagerMetric[];\n /** Consent changes data */\n CONSENT_CHANGES_TIMESERIES: ConsentManagerMetric[];\n /** Consent sessions by regime */\n CONSENT_SESSIONS_BY_REGIME: ConsentManagerMetric[];\n}> {\n // Grab the bundleId associated with this API key\n const airgapBundleId = await fetchConsentManagerId(client);\n\n // convert start and end to times\n const startTime = Math.floor(start.getTime() / 1000);\n const endTime = Math.floor(end.getTime() / 1000);\n if (startTime > endTime) {\n throw new Error('Received \"end\" date that happened before \"start\" date');\n }\n\n // do not allow hourly bins greater than 2 weeks\n if (bin === '1h' && end.getTime() - start.getTime() > ONE_WEEK * 2) {\n throw new Error(\n 'When using bin=1h, start and end time can be no more than 2 weeks apart',\n );\n }\n\n // Pull in the metrics\n const startDate = start.toISOString();\n const endDate = end.toISOString();\n const [privacySignalData, consentChangesData, consentSessionsByRegimeData] =\n await Promise.all([\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'PRIVACY_SIGNAL_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'CONSENT_CHANGES_TIMESERIES',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n fetchConsentManagerAnalyticsData(client, {\n dataSource: 'CONSENT_SESSIONS_BY_REGIME',\n startDate,\n endDate,\n forceRefetch: true,\n airgapBundleId,\n binInterval: bin,\n smoothTimeseries: false,\n }),\n ]);\n\n return {\n PRIVACY_SIGNAL_TIMESERIES: privacySignalData,\n CONSENT_CHANGES_TIMESERIES: consentChangesData,\n CONSENT_SESSIONS_BY_REGIME: consentSessionsByRegimeData,\n };\n}\n","/**\n * Convert a domain to host\n *\n * @param domain - e.g. test.acme.com\n * @returns Host acme.com\n */\nexport const domainToHost = (domain: string): string =>\n new URL(`https://${domain}`).hostname.split('.').slice(-2).join('.');\n","import colors from 'colors';\n\nimport { buildTranscendGraphQLClient, fetchConsentManager } from '../graphql';\nimport { difference } from 'lodash-es';\nimport { map } from 'bluebird';\nimport { StoredApiKey } from '../../codecs';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport { logger } from '../../logger';\nimport { domainToHost } from './domainToHost';\n\n/**\n * Sync group configuration mapping\n * e.g.\n * {\n * \"abdb5e78-0d69-4554-a3bd-84b72ca3b3d9\": [\n * \"test.com\"\n * ],\n * \"f6b3ba87-c9df-444f-b420-6fac49e35910\": [\n * \"blue.com\"\n * ]\n * }\n */\nexport type XdiSyncGroups = { [k in string]: string[] };\n\n/** Regular expression for IP addresses - remove these from sync endpoint */\nexport const IP_ADDRESS_REGEX =\n // eslint-disable-next-line max-len\n /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\n/**\n * Build the sync endpoint definition for a set of Transcend accounts\n *\n * @param apiKeys - The API keys that will be used to pull down configurations for\n * @param options - Options\n * @returns The XDI configuration\n */\nexport async function buildXdiSyncEndpoint(\n apiKeys: string | StoredApiKey[],\n {\n xdiLocation,\n transcendUrl = DEFAULT_TRANSCEND_API,\n removeIpAddresses = true,\n domainBlockList = ['localhost'],\n xdiAllowedCommands = 'ConsentManager:Sync',\n }: {\n /** The file location where the XDI file is hosted */\n xdiLocation: string;\n /** URL of Transcend API */\n transcendUrl?: string;\n /** When true, remove IP addresses (defaults to true) */\n removeIpAddresses?: boolean;\n /** Block list of domains to omit from sync endpoint - includes `localhost` by default */\n domainBlockList?: string[];\n /** Allows XDI commands */\n xdiAllowedCommands?: string;\n },\n): Promise<{\n /** Sync group configurations */\n syncGroups: XdiSyncGroups;\n /** The HTML string */\n html: string;\n}> {\n // Convert API keys to list\n const apiKeysAsList = Array.isArray(apiKeys)\n ? apiKeys\n : [{ apiKey: apiKeys, organizationId: '', organizationName: '' }];\n\n // Fetch configuration for each account\n const consentManagers = await map(\n apiKeysAsList,\n async (apiKey) => {\n logger.info(\n colors.magenta(\n `Pulling consent metadata for organization - ${apiKey.organizationName}`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n // Grab consent manager\n const consentManager = await fetchConsentManager(client);\n return consentManager;\n },\n { concurrency: 5 },\n );\n\n // construct the sync groups\n const syncGroups: XdiSyncGroups = {};\n consentManagers.forEach((consentManager) => {\n // grab the partition key\n const partitionKey =\n // take explicit key first\n consentManager.partition?.partition ||\n // fallback to bundle ID\n consentManager.bundleURL.split('/').reverse()[1];\n\n // Ensure that partition exists in the sync groups\n if (!syncGroups[partitionKey]) {\n syncGroups[partitionKey] = [];\n }\n\n // Map domain list to a host list\n const hosts = difference(\n consentManager.configuration.domains\n .filter(\n // ignore IP addresses\n (domain) => !removeIpAddresses || !IP_ADDRESS_REGEX.test(domain),\n )\n .map((domain) => domainToHost(domain)),\n // ignore block list\n domainBlockList,\n );\n // merge existing sync group with hosts for this consent manager\n syncGroups[partitionKey] = [\n ...new Set([...(syncGroups[partitionKey] || []), ...hosts]),\n ];\n });\n\n // Construct the HTML\n const syncEndpointHtml = `\n<!DOCTYPE html>\n<script\nsrc=\"${xdiLocation}\"\ndata-sync-groups='${JSON.stringify(syncGroups, null, 2)}'\ndata-xdi-commands=\"${xdiAllowedCommands}\"\n></script>\n`;\n\n return {\n html: syncEndpointHtml,\n syncGroups,\n };\n}\n","import { BusinessEntityInput, ConsentManagerInput } from '../../codecs';\nimport { logger } from '../../logger';\n\n/**\n * Combine multiple consent manager configurations into a list of business entity configurations\n *\n * @param inputs - Consent manager configurations to combine\n * @returns Business entity configuration input\n */\nexport function consentManagersToBusinessEntities(\n inputs: {\n /** Name of business entity */\n name: string;\n /** Consent manager input */\n input?: ConsentManagerInput;\n }[],\n): BusinessEntityInput[] {\n // Construct the business entities YAML definition\n const businessEntities = inputs.map(\n ({ name, input }): BusinessEntityInput => ({\n // Title of Transcend Instance\n title: name.replace('.yml', ''),\n attributes: [\n // Sync domain list\n ...(input?.domains\n ? [\n {\n key: 'Transcend Domain List',\n values: [...new Set(input.domains)],\n },\n ]\n : []),\n // Sync bundle URLs\n ...(input?.bundleUrls\n ? [\n {\n key: 'Airgap Production URL',\n values: [input.bundleUrls.PRODUCTION],\n },\n {\n key: 'Airgap Test URL',\n values: [input.bundleUrls.TEST],\n },\n {\n key: 'Airgap XDI URL',\n values: [\n input.bundleUrls.PRODUCTION.replace('airgap.js', 'xdi.js'),\n ],\n },\n ]\n : []),\n // Sync partition keys\n ...(input?.partition\n ? [\n {\n key: 'Consent Partition Key',\n values: [input.partition],\n },\n ]\n : []),\n ],\n }),\n );\n\n // Log out info on airgap scripts to host\n logger.info('\\n\\n~~~~~~~~~~~\\nAirgap scripts to host:');\n businessEntities.forEach(({ attributes, title }, ind) => {\n attributes\n ?.find((attr) => attr.key === 'Airgap Production URL')\n ?.values?.forEach((url) => {\n logger.info(`${ind}) ${title} - ${url}`);\n });\n });\n\n return businessEntities;\n}\n","import * as t from 'io-ts';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport type { Got } from 'got';\nimport { ConsentPreferenceFetch } from './types';\n\nexport const ConsentPreferenceResponse = t.intersection([\n t.type({\n nodes: t.array(ConsentPreferenceFetch),\n }),\n t.partial({\n lastKey: t.partial({\n userId: t.string,\n partition: t.string,\n timestamp: t.string,\n }),\n }),\n]);\n\n/** Type override */\nexport type ConsentPreferenceResponse = t.TypeOf<\n typeof ConsentPreferenceResponse\n>;\n\n/**\n * Fetch consent preferences for the managed consent database\n *\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns The consent preferences\n */\nexport async function fetchConsentPreferences(\n sombra: Got,\n {\n partition,\n filterBy = {},\n limit = 50,\n }: {\n /** Partition key to fetch */\n partition: string;\n /** Filter consent preferences */\n filterBy?: {\n /** Fetch specific identifiers */\n identifiers?: string[];\n /** Filter before timestamp */\n timestampBefore?: string;\n /** Filter after timestamp */\n timestampAfter?: string;\n };\n /** Number of items to pull back at once */\n limit?: number;\n },\n): Promise<ConsentPreferenceFetch[]> {\n let currentLastKey: ConsentPreferenceResponse['lastKey'];\n const data: ConsentPreferenceFetch[] = [];\n let shouldContinue = true;\n\n while (shouldContinue) {\n const response = await sombra\n .post('v1/consent-preferences', {\n json: {\n partition,\n ...filterBy,\n // using lastKey to paginate if it exists (will not for first iteration)\n startKey: currentLastKey || undefined,\n limit,\n },\n })\n .json();\n const { nodes, lastKey } = decodeCodec(ConsentPreferenceResponse, response);\n\n if (!nodes || nodes.length === 0) {\n break;\n }\n\n // Process the data received from the API call\n // For example, push the new data into an array\n data.push(...nodes);\n\n // Extract the lastKey from the API response\n currentLastKey = lastKey;\n shouldContinue = !!lastKey && Object.keys(lastKey).length > 0;\n }\n\n return data;\n}\n"]}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});function o(s){let e=s.split(",").filter(r=>!!r),t={};return e.forEach(r=>{let[i,n]=r.split(":");if(!i||!n)throw new Error(`Invalid variable: ${r}. Expected format: key:value`);t[i]=n}),t}exports.a = o;
2
- //# sourceMappingURL=chunk-TD7ADMVO.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/helpers/parseVariablesFromString.ts"],"names":["parseVariablesFromString","variables","splitVars","x","vars","variable","k","v"],"mappings":"AAMO,kFAASA,CAAAA,CAAyBC,CAAAA,CAEvC,CAEA,IAAMC,CAAAA,CAAYD,CAAAA,CAAU,KAAA,CAAM,GAAG,CAAA,CAAE,MAAA,CAAQE,CAAAA,EAAM,CAAC,CAACA,CAAC,CAAA,CAClDC,CAAAA,CAAkC,CAAC,CAAA,CACzC,OAAAF,CAAAA,CAAU,OAAA,CAASG,CAAAA,EAAa,CAC9B,GAAM,CAACC,CAAAA,CAAGC,CAAC,CAAA,CAAIF,CAAAA,CAAS,KAAA,CAAM,GAAG,CAAA,CACjC,EAAA,CAAI,CAACC,CAAAA,EAAK,CAACC,CAAAA,CACT,MAAM,IAAI,KAAA,CACR,CAAA,kBAAA,EAAqBF,CAAQ,CAAA,4BAAA,CAC/B,CAAA,CAEFD,CAAAA,CAAKE,CAAC,CAAA,CAAIC,CACZ,CAAC,CAAA,CACMH,CACT,CAAA,cAAA","file":"/home/runner/work/cli/cli/dist/chunk-TD7ADMVO.cjs","sourcesContent":["/**\n * Parse variables from string\n *\n * @param variables - Variables as string\n * @returns Variables as object\n */\nexport function parseVariablesFromString(variables: string): {\n [k in string]: string;\n} {\n // Parse out the variables\n const splitVars = variables.split(',').filter((x) => !!x);\n const vars: { [k in string]: string } = {};\n splitVars.forEach((variable) => {\n const [k, v] = variable.split(':');\n if (!k || !v) {\n throw new Error(\n `Invalid variable: ${variable}. Expected format: key:value`,\n );\n }\n vars[k] = v;\n });\n return vars;\n}\n"]}