@transcend-io/cli 10.14.0 → 10.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +98 -47
  2. package/dist/app-COX_n1FP.mjs +131 -0
  3. package/dist/app-COX_n1FP.mjs.map +1 -0
  4. package/dist/{approvePrivacyRequests-BmjMLA3C.mjs → approvePrivacyRequests-DJItn7R6.mjs} +2 -2
  5. package/dist/{approvePrivacyRequests-BmjMLA3C.mjs.map → approvePrivacyRequests-DJItn7R6.mjs.map} +1 -1
  6. package/dist/bin/bash-complete.mjs +1 -1
  7. package/dist/bin/cli.mjs +1 -1
  8. package/dist/bin/deprecated-command.mjs +1 -1
  9. package/dist/{buildExamples-tZJof83F.mjs → buildExamples-CZ8kcEqO.mjs} +2 -2
  10. package/dist/{buildExamples-tZJof83F.mjs.map → buildExamples-CZ8kcEqO.mjs.map} +1 -1
  11. package/dist/{buildXdiSyncEndpoint-DsxFqz9E.mjs → buildXdiSyncEndpoint-CSGwr2H5.mjs} +2 -2
  12. package/dist/{buildXdiSyncEndpoint-DsxFqz9E.mjs.map → buildXdiSyncEndpoint-CSGwr2H5.mjs.map} +1 -1
  13. package/dist/bulkRestartRequests-D-t58SeM.mjs +2 -0
  14. package/dist/bulkRestartRequests-D-t58SeM.mjs.map +1 -0
  15. package/dist/{bulkRetryEnrichers-nBG87Q8B.mjs → bulkRetryEnrichers-BmwRLF2w.mjs} +2 -2
  16. package/dist/{bulkRetryEnrichers-nBG87Q8B.mjs.map → bulkRetryEnrichers-BmwRLF2w.mjs.map} +1 -1
  17. package/dist/{cancelPrivacyRequests-DBjBnX2p.mjs → cancelPrivacyRequests-CFCULeSv.mjs} +2 -2
  18. package/dist/{cancelPrivacyRequests-DBjBnX2p.mjs.map → cancelPrivacyRequests-CFCULeSv.mjs.map} +1 -1
  19. package/dist/{command-BDVLuBwL.mjs → command-8AnltUOG.mjs} +2 -2
  20. package/dist/{command-BDVLuBwL.mjs.map → command-8AnltUOG.mjs.map} +1 -1
  21. package/dist/{constants-Co8rkELu.mjs → constants-B7bW_WN2.mjs} +2 -2
  22. package/dist/{constants-Co8rkELu.mjs.map → constants-B7bW_WN2.mjs.map} +1 -1
  23. package/dist/{createExtraKeyHandler-CC-YNn6m.mjs → createExtraKeyHandler-DqiD609a.mjs} +2 -2
  24. package/dist/{createExtraKeyHandler-CC-YNn6m.mjs.map → createExtraKeyHandler-DqiD609a.mjs.map} +1 -1
  25. package/dist/{downloadPrivacyRequestFiles-C_60XBVX.mjs → downloadPrivacyRequestFiles-B7HNc-Y1.mjs} +2 -2
  26. package/dist/{downloadPrivacyRequestFiles-C_60XBVX.mjs.map → downloadPrivacyRequestFiles-B7HNc-Y1.mjs.map} +1 -1
  27. package/dist/formatPolicyEngineRequestError-C8g0v7nh.mjs +2 -0
  28. package/dist/formatPolicyEngineRequestError-C8g0v7nh.mjs.map +1 -0
  29. package/dist/{generateCrossAccountApiKeys-JvTpNM7h.mjs → generateCrossAccountApiKeys-kqzneWII.mjs} +2 -2
  30. package/dist/{generateCrossAccountApiKeys-JvTpNM7h.mjs.map → generateCrossAccountApiKeys-kqzneWII.mjs.map} +1 -1
  31. package/dist/impl--eayIBq5.mjs +2 -0
  32. package/dist/impl--eayIBq5.mjs.map +1 -0
  33. package/dist/{impl-TnRighiD.mjs → impl-0C9N9md8.mjs} +2 -2
  34. package/dist/{impl-TnRighiD.mjs.map → impl-0C9N9md8.mjs.map} +1 -1
  35. package/dist/{impl-CQ94Ys6i.mjs → impl-6rvA_yyd.mjs} +2 -2
  36. package/dist/{impl-CQ94Ys6i.mjs.map → impl-6rvA_yyd.mjs.map} +1 -1
  37. package/dist/{impl-pGIOCyRI.mjs → impl-B3u38Ct_.mjs} +1 -1
  38. package/dist/{impl-pGIOCyRI.mjs.map → impl-B3u38Ct_.mjs.map} +1 -1
  39. package/dist/{impl-CPZSFIEn2.mjs → impl-B9AtL5ta2.mjs} +2 -2
  40. package/dist/{impl-CPZSFIEn2.mjs.map → impl-B9AtL5ta2.mjs.map} +1 -1
  41. package/dist/{impl-BWt2WOj4.mjs → impl-BDc4D9nA.mjs} +2 -2
  42. package/dist/{impl-BWt2WOj4.mjs.map → impl-BDc4D9nA.mjs.map} +1 -1
  43. package/dist/{impl-bzESF0CN.mjs → impl-BJldWkkC.mjs} +1 -1
  44. package/dist/{impl-bzESF0CN.mjs.map → impl-BJldWkkC.mjs.map} +1 -1
  45. package/dist/{impl-Bf_Wy1-i.mjs → impl-BOXnkx44.mjs} +2 -2
  46. package/dist/{impl-Bf_Wy1-i.mjs.map → impl-BOXnkx44.mjs.map} +1 -1
  47. package/dist/{impl-CHA9Ioez2.mjs → impl-BUF6G3P32.mjs} +2 -2
  48. package/dist/{impl-CHA9Ioez2.mjs.map → impl-BUF6G3P32.mjs.map} +1 -1
  49. package/dist/{impl-DctqoksW2.mjs → impl-BVcXWJyI2.mjs} +2 -2
  50. package/dist/{impl-DctqoksW2.mjs.map → impl-BVcXWJyI2.mjs.map} +1 -1
  51. package/dist/impl-BbfuEhKu.mjs +2 -0
  52. package/dist/impl-BbfuEhKu.mjs.map +1 -0
  53. package/dist/{impl-DtjphdYd2.mjs → impl-BcIZos3y.mjs} +2 -2
  54. package/dist/impl-BcIZos3y.mjs.map +1 -0
  55. package/dist/{impl-8i-k9wal2.mjs → impl-Bkdu-3yo.mjs} +2 -2
  56. package/dist/impl-Bkdu-3yo.mjs.map +1 -0
  57. package/dist/{impl-CnfqPqKR.mjs → impl-Bq-tabdZ2.mjs} +2 -2
  58. package/dist/impl-Bq-tabdZ2.mjs.map +1 -0
  59. package/dist/{impl-BxJcoWPI.mjs → impl-Bul8gUqq.mjs} +2 -2
  60. package/dist/{impl-BxJcoWPI.mjs.map → impl-Bul8gUqq.mjs.map} +1 -1
  61. package/dist/{impl-kyicyfTy.mjs → impl-BuqBEZCk.mjs} +2 -2
  62. package/dist/{impl-kyicyfTy.mjs.map → impl-BuqBEZCk.mjs.map} +1 -1
  63. package/dist/{impl-DOp0z0s3.mjs → impl-BvOLkTWD.mjs} +2 -2
  64. package/dist/{impl-DOp0z0s3.mjs.map → impl-BvOLkTWD.mjs.map} +1 -1
  65. package/dist/{impl-DasdQVVL.mjs → impl-Bvkhu8fB.mjs} +2 -2
  66. package/dist/{impl-DasdQVVL.mjs.map → impl-Bvkhu8fB.mjs.map} +1 -1
  67. package/dist/{impl-CQcfrcc42.mjs → impl-CCSb7Pyd.mjs} +2 -2
  68. package/dist/impl-CCSb7Pyd.mjs.map +1 -0
  69. package/dist/{impl-BcP6NXxv.mjs → impl-CDNTdi62.mjs} +2 -2
  70. package/dist/{impl-BcP6NXxv.mjs.map → impl-CDNTdi62.mjs.map} +1 -1
  71. package/dist/{impl-0WH9Y-7n2.mjs → impl-CLrF-Xhp2.mjs} +2 -2
  72. package/dist/{impl-0WH9Y-7n2.mjs.map → impl-CLrF-Xhp2.mjs.map} +1 -1
  73. package/dist/impl-CX1J2iHE.mjs +2 -0
  74. package/dist/impl-CX1J2iHE.mjs.map +1 -0
  75. package/dist/{impl-vLFKOFp6.mjs → impl-C_K23xoc.mjs} +2 -2
  76. package/dist/{impl-vLFKOFp6.mjs.map → impl-C_K23xoc.mjs.map} +1 -1
  77. package/dist/{impl-DmsEZEkY2.mjs → impl-CeqMxdZm2.mjs} +2 -2
  78. package/dist/{impl-DmsEZEkY2.mjs.map → impl-CeqMxdZm2.mjs.map} +1 -1
  79. package/dist/{impl-BmB5DH95.mjs → impl-ChDwTQ3Z2.mjs} +2 -2
  80. package/dist/impl-ChDwTQ3Z2.mjs.map +1 -0
  81. package/dist/{impl-BQizHx-b.mjs → impl-CkFqqhQ-.mjs} +2 -2
  82. package/dist/{impl-BQizHx-b.mjs.map → impl-CkFqqhQ-.mjs.map} +1 -1
  83. package/dist/{impl-C9RGUYAT.mjs → impl-CkU-WD3b.mjs} +2 -2
  84. package/dist/{impl-C9RGUYAT.mjs.map → impl-CkU-WD3b.mjs.map} +1 -1
  85. package/dist/{impl-COWe0KAi.mjs → impl-Cx5U2XsV.mjs} +2 -2
  86. package/dist/{impl-COWe0KAi.mjs.map → impl-Cx5U2XsV.mjs.map} +1 -1
  87. package/dist/impl-DGm5NVUi.mjs +3 -0
  88. package/dist/impl-DGm5NVUi.mjs.map +1 -0
  89. package/dist/{impl-BcirxaFO.mjs → impl-DMbgck0i.mjs} +2 -2
  90. package/dist/{impl-BcirxaFO.mjs.map → impl-DMbgck0i.mjs.map} +1 -1
  91. package/dist/{impl-BM0EEvkt.mjs → impl-DQH1CGup.mjs} +2 -2
  92. package/dist/{impl-BM0EEvkt.mjs.map → impl-DQH1CGup.mjs.map} +1 -1
  93. package/dist/{impl-5pww5SHw.mjs → impl-DTDnN3Hn.mjs} +2 -2
  94. package/dist/{impl-5pww5SHw.mjs.map → impl-DTDnN3Hn.mjs.map} +1 -1
  95. package/dist/{impl-Cih-nyPz.mjs → impl-DYsJKLfp.mjs} +2 -2
  96. package/dist/{impl-Cih-nyPz.mjs.map → impl-DYsJKLfp.mjs.map} +1 -1
  97. package/dist/impl-DiRx33sh.mjs +2 -0
  98. package/dist/impl-DiRx33sh.mjs.map +1 -0
  99. package/dist/{impl-Cp_cXJgT2.mjs → impl-DiysQB762.mjs} +2 -2
  100. package/dist/{impl-Cp_cXJgT2.mjs.map → impl-DiysQB762.mjs.map} +1 -1
  101. package/dist/{impl-DQdzYE12.mjs → impl-DqcpxYHF.mjs} +1 -1
  102. package/dist/{impl-DQdzYE12.mjs.map → impl-DqcpxYHF.mjs.map} +1 -1
  103. package/dist/{impl-DtVfOZhs.mjs → impl-DqyYxDti.mjs} +2 -2
  104. package/dist/{impl-DtVfOZhs.mjs.map → impl-DqyYxDti.mjs.map} +1 -1
  105. package/dist/{impl-DpU2s1HR.mjs → impl-RqwgNa2O.mjs} +2 -2
  106. package/dist/{impl-DpU2s1HR.mjs.map → impl-RqwgNa2O.mjs.map} +1 -1
  107. package/dist/{impl-cro4x_eG.mjs → impl-TTeKThep2.mjs} +2 -2
  108. package/dist/impl-TTeKThep2.mjs.map +1 -0
  109. package/dist/{impl-CJIfMPOK.mjs → impl-X13pzYJN2.mjs} +2 -2
  110. package/dist/impl-X13pzYJN2.mjs.map +1 -0
  111. package/dist/{impl-B4mrbkzO.mjs → impl-e-_DWiv4.mjs} +2 -2
  112. package/dist/{impl-B4mrbkzO.mjs.map → impl-e-_DWiv4.mjs.map} +1 -1
  113. package/dist/index.d.mts +17 -13
  114. package/dist/index.d.mts.map +1 -1
  115. package/dist/index.mjs +1 -1
  116. package/dist/{markRequestDataSiloIdsCompleted-DYsj2ONd.mjs → markRequestDataSiloIdsCompleted-nAV0VLEA.mjs} +2 -2
  117. package/dist/{markRequestDataSiloIdsCompleted-DYsj2ONd.mjs.map → markRequestDataSiloIdsCompleted-nAV0VLEA.mjs.map} +1 -1
  118. package/dist/{markSilentPrivacyRequests-DQYDLnBX.mjs → markSilentPrivacyRequests-BhF4r8n9.mjs} +2 -2
  119. package/dist/{markSilentPrivacyRequests-DQYDLnBX.mjs.map → markSilentPrivacyRequests-BhF4r8n9.mjs.map} +1 -1
  120. package/dist/{notifyPrivacyRequestsAdditionalTime-BYpsssGt.mjs → notifyPrivacyRequestsAdditionalTime-B6e9SfP7.mjs} +2 -2
  121. package/dist/{notifyPrivacyRequestsAdditionalTime-BYpsssGt.mjs.map → notifyPrivacyRequestsAdditionalTime-B6e9SfP7.mjs.map} +1 -1
  122. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-aBPmYMAU.mjs → pullChunkedCustomSiloOutstandingIdentifiers-DiZTo2K_.mjs} +2 -2
  123. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-aBPmYMAU.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-DiZTo2K_.mjs.map} +1 -1
  124. package/dist/{pullManualEnrichmentIdentifiersToCsv-DGdMOzd_.mjs → pullManualEnrichmentIdentifiersToCsv--dw03arC.mjs} +2 -2
  125. package/dist/{pullManualEnrichmentIdentifiersToCsv-DGdMOzd_.mjs.map → pullManualEnrichmentIdentifiersToCsv--dw03arC.mjs.map} +1 -1
  126. package/dist/{pushCronIdentifiersFromCsv-mMGYEnWE.mjs → pushCronIdentifiersFromCsv-DdcsnXf5.mjs} +2 -2
  127. package/dist/{pushCronIdentifiersFromCsv-mMGYEnWE.mjs.map → pushCronIdentifiersFromCsv-DdcsnXf5.mjs.map} +1 -1
  128. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BJtIFf35.mjs → pushManualEnrichmentIdentifiersFromCsv-BYJCQOI-.mjs} +2 -2
  129. package/dist/{pushManualEnrichmentIdentifiersFromCsv-BJtIFf35.mjs.map → pushManualEnrichmentIdentifiersFromCsv-BYJCQOI-.mjs.map} +1 -1
  130. package/dist/{removeUnverifiedRequestIdentifiers-GM1MhbRO.mjs → removeUnverifiedRequestIdentifiers-CC471vSR.mjs} +2 -2
  131. package/dist/{removeUnverifiedRequestIdentifiers-GM1MhbRO.mjs.map → removeUnverifiedRequestIdentifiers-CC471vSR.mjs.map} +1 -1
  132. package/dist/{renderTable-BgjVr6ch.mjs → renderTable-BzIh5FoT.mjs} +1 -1
  133. package/dist/{renderTable-BgjVr6ch.mjs.map → renderTable-BzIh5FoT.mjs.map} +1 -1
  134. package/dist/{resolveBundleIdByName-DdemhmTX.mjs → resolveBundleIdByName-Bxoxa8CK.mjs} +1 -1
  135. package/dist/{resolveBundleIdByName-DdemhmTX.mjs.map → resolveBundleIdByName-Bxoxa8CK.mjs.map} +1 -1
  136. package/dist/{retryRequestDataSilos-DkCW5Dap.mjs → retryRequestDataSilos-DlkJmEjH.mjs} +2 -2
  137. package/dist/{retryRequestDataSilos-DkCW5Dap.mjs.map → retryRequestDataSilos-DlkJmEjH.mjs.map} +1 -1
  138. package/dist/{skipPreflightJobs-BBfI9gnC.mjs → skipPreflightJobs-xVBZC-iI.mjs} +2 -2
  139. package/dist/{skipPreflightJobs-BBfI9gnC.mjs.map → skipPreflightJobs-xVBZC-iI.mjs.map} +1 -1
  140. package/dist/{skipRequestDataSilos-CjaWLHRh.mjs → skipRequestDataSilos-BriqhLT3.mjs} +2 -2
  141. package/dist/{skipRequestDataSilos-CjaWLHRh.mjs.map → skipRequestDataSilos-BriqhLT3.mjs.map} +1 -1
  142. package/dist/{streamPrivacyRequestsToCsv-DeBjRAo6.mjs → streamPrivacyRequestsToCsv-D8b097c1.mjs} +2 -2
  143. package/dist/{streamPrivacyRequestsToCsv-DeBjRAo6.mjs.map → streamPrivacyRequestsToCsv-D8b097c1.mjs.map} +1 -1
  144. package/dist/{updateConsentManagerVersionToLatest-2SBywtZH.mjs → updateConsentManagerVersionToLatest-w_ftOmxi.mjs} +2 -2
  145. package/dist/{updateConsentManagerVersionToLatest-2SBywtZH.mjs.map → updateConsentManagerVersionToLatest-w_ftOmxi.mjs.map} +1 -1
  146. package/dist/{uploadConsents-K3cGrF3M.mjs → uploadConsents-D8IJDaTN.mjs} +2 -2
  147. package/dist/{uploadConsents-K3cGrF3M.mjs.map → uploadConsents-D8IJDaTN.mjs.map} +1 -1
  148. package/dist/{uploadCookiesFromCsv-Cf4q-K4o.mjs → uploadCookiesFromCsv-8hq-Of_p.mjs} +2 -2
  149. package/dist/{uploadCookiesFromCsv-Cf4q-K4o.mjs.map → uploadCookiesFromCsv-8hq-Of_p.mjs.map} +1 -1
  150. package/dist/{uploadDataFlowsFromCsv-CrC_UGCw.mjs → uploadDataFlowsFromCsv-B854o0O5.mjs} +2 -2
  151. package/dist/{uploadDataFlowsFromCsv-CrC_UGCw.mjs.map → uploadDataFlowsFromCsv-B854o0O5.mjs.map} +1 -1
  152. package/dist/{uploadPrivacyRequestsFromCsv-CtLCdggr.mjs → uploadPrivacyRequestsFromCsv-D-RTgJsx.mjs} +2 -2
  153. package/dist/{uploadPrivacyRequestsFromCsv-CtLCdggr.mjs.map → uploadPrivacyRequestsFromCsv-D-RTgJsx.mjs.map} +1 -1
  154. package/package.json +2 -2
  155. package/dist/app-jtpjVOh5.mjs +0 -131
  156. package/dist/app-jtpjVOh5.mjs.map +0 -1
  157. package/dist/bulkRestartRequests-Cg0_c6sr.mjs +0 -2
  158. package/dist/bulkRestartRequests-Cg0_c6sr.mjs.map +0 -1
  159. package/dist/impl-8i-k9wal2.mjs.map +0 -1
  160. package/dist/impl-BmB5DH95.mjs.map +0 -1
  161. package/dist/impl-CJIfMPOK.mjs.map +0 -1
  162. package/dist/impl-CQcfrcc42.mjs.map +0 -1
  163. package/dist/impl-CnfqPqKR.mjs.map +0 -1
  164. package/dist/impl-DZ2ESN0W.mjs +0 -2
  165. package/dist/impl-DZ2ESN0W.mjs.map +0 -1
  166. package/dist/impl-DtjphdYd2.mjs.map +0 -1
  167. package/dist/impl-DxziWqbj.mjs +0 -2
  168. package/dist/impl-DxziWqbj.mjs.map +0 -1
  169. package/dist/impl-QhkS8iHU.mjs +0 -2
  170. package/dist/impl-QhkS8iHU.mjs.map +0 -1
  171. package/dist/impl-WYYi6kC-.mjs +0 -2
  172. package/dist/impl-WYYi6kC-.mjs.map +0 -1
  173. package/dist/impl-cro4x_eG.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./pullChunkedCustomSiloOutstandingIdentifiers-aBPmYMAU.mjs";import{i as n,s as r}from"./writeCsv-Dg4Wuj5V.mjs";import{t as i}from"./done-input-validation-D25TzrxG.mjs";import{chunk as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c,fetchRequestFilesForRequest as l}from"@transcend-io/sdk";import{map as u}from"@transcend-io/utils";async function d({file:d,fileTarget:f,transcendUrl:p,auth:m,sombraAuth:h,cronDataSiloId:g,targetDataSiloId:_,actions:v,skipRequestCount:y,pageLimit:b,chunkSize:x}){y&&e.info(s.yellow(`Skipping request count as requested. This may help speed up the call.`)),(Number.isNaN(x)||x<=0||x%b!==0)&&(e.error(s.red(`Invalid chunk size: "${x}". Must be a positive integer that is a multiple of ${b}.`)),this.process.exit(1)),i(this.process.exit);let S=c(p,m),{baseName:C,extension:w}=n(d),{baseName:T,extension:E}=n(f),D=0,O=0,k=0;await t({dataSiloId:g,auth:m,sombraAuth:h,actions:v,apiPageSize:b,savePageSize:x,onSave:async t=>{D+=t.length;let n=await u(a(o(t.map(e=>e.requestId)),b),async t=>(e.info(s.magenta(`Fetching target identifiers for ${t.length} requests`)),(await l(S,{logger:e,pageSize:b*2,filterBy:{requestIds:t,dataSiloIds:[_]}})).map(({fileName:e,remoteId:t})=>{if(!t)throw Error(`Failed to find remoteId for ${e}`);return{RecordId:t,Object:e.replace(`.json`,``).split(`/`).pop()?.replace(` Information`,``),Comment:`Customer data deletion request submitted via transcend.io`}})),{concurrency:1});O+=n.flat().length;let i=o(t.map(e=>Object.keys(e)).flat()),c=`${C}-${k}${w}`,p=`${T}-${k}${E}`;await r(c,t,i),e.info(s.green(`Successfully wrote ${t.length} identifiers to file "${d}"`));let m=n.flat();await r(p,m,o(m.map(e=>Object.keys(e)).flat())),e.info(s.green(`Successfully wrote ${m.length} identifiers to file "${f}"`)),e.info(s.blue(`Processed chunk of ${a.length} identifiers, found ${m.length} target identifiers`)),k+=1},transcendUrl:p,skipRequestCount:y}),e.info(s.green(`Successfully wrote ${D} identifiers to file "${d}"`)),e.info(s.green(`Successfully wrote ${O} identifiers to file "${f}"`))}export{d as pullProfiles};
2
- //# sourceMappingURL=impl-Cp_cXJgT2.mjs.map
1
+ import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./pullChunkedCustomSiloOutstandingIdentifiers-DiZTo2K_.mjs";import{i as n,s as r}from"./writeCsv-Dg4Wuj5V.mjs";import{t as i}from"./done-input-validation-D25TzrxG.mjs";import{chunk as a,uniq as o}from"lodash-es";import s from"colors";import{buildTranscendGraphQLClient as c,fetchRequestFilesForRequest as l}from"@transcend-io/sdk";import{map as u}from"@transcend-io/utils";async function d({file:d,fileTarget:f,transcendUrl:p,auth:m,sombraAuth:h,cronDataSiloId:g,targetDataSiloId:_,actions:v,skipRequestCount:y,pageLimit:b,chunkSize:x}){y&&e.info(s.yellow(`Skipping request count as requested. This may help speed up the call.`)),(Number.isNaN(x)||x<=0||x%b!==0)&&(e.error(s.red(`Invalid chunk size: "${x}". Must be a positive integer that is a multiple of ${b}.`)),this.process.exit(1)),i(this.process.exit);let S=c(p,m),{baseName:C,extension:w}=n(d),{baseName:T,extension:E}=n(f),D=0,O=0,k=0;await t({dataSiloId:g,auth:m,sombraAuth:h,actions:v,apiPageSize:b,savePageSize:x,onSave:async t=>{D+=t.length;let n=await u(a(o(t.map(e=>e.requestId)),b),async t=>(e.info(s.magenta(`Fetching target identifiers for ${t.length} requests`)),(await l(S,{logger:e,pageSize:b*2,filterBy:{requestIds:t,dataSiloIds:[_]}})).map(({fileName:e,remoteId:t})=>{if(!t)throw Error(`Failed to find remoteId for ${e}`);return{RecordId:t,Object:e.replace(`.json`,``).split(`/`).pop()?.replace(` Information`,``),Comment:`Customer data deletion request submitted via transcend.io`}})),{concurrency:1});O+=n.flat().length;let i=o(t.map(e=>Object.keys(e)).flat()),c=`${C}-${k}${w}`,p=`${T}-${k}${E}`;await r(c,t,i),e.info(s.green(`Successfully wrote ${t.length} identifiers to file "${d}"`));let m=n.flat();await r(p,m,o(m.map(e=>Object.keys(e)).flat())),e.info(s.green(`Successfully wrote ${m.length} identifiers to file "${f}"`)),e.info(s.blue(`Processed chunk of ${a.length} identifiers, found ${m.length} target identifiers`)),k+=1},transcendUrl:p,skipRequestCount:y}),e.info(s.green(`Successfully wrote ${D} identifiers to file "${d}"`)),e.info(s.green(`Successfully wrote ${O} identifiers to file "${f}"`))}export{d as pullProfiles};
2
+ //# sourceMappingURL=impl-DiysQB762.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-Cp_cXJgT2.mjs","names":[],"sources":["../src/commands/request/cron/pull-profiles/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, fetchRequestFilesForRequest } from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { uniq, chunk } from 'lodash-es';\n\nimport type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport {\n pullChunkedCustomSiloOutstandingIdentifiers,\n type CsvFormattedIdentifier,\n} from '../../../../lib/cron/index.js';\nimport { parseFilePath, writeLargeCsv } from '../../../../lib/helpers/index.js';\nimport { logger } from '../../../../logger.js';\n\nexport interface PullProfilesCommandFlags {\n file: string;\n fileTarget: string;\n transcendUrl: string;\n auth: string;\n sombraAuth?: string;\n cronDataSiloId: string;\n targetDataSiloId: string;\n actions: RequestAction[];\n skipRequestCount: boolean;\n pageLimit: number;\n chunkSize: number;\n}\n\nexport async function pullProfiles(\n this: LocalContext,\n {\n file,\n fileTarget,\n transcendUrl,\n auth,\n sombraAuth,\n cronDataSiloId,\n targetDataSiloId,\n actions,\n skipRequestCount,\n pageLimit,\n chunkSize,\n }: PullProfilesCommandFlags,\n): Promise<void> {\n if (skipRequestCount) {\n logger.info(\n colors.yellow('Skipping request count as requested. This may help speed up the call.'),\n );\n }\n\n if (Number.isNaN(chunkSize) || chunkSize <= 0 || chunkSize % pageLimit !== 0) {\n logger.error(\n colors.red(\n `Invalid chunk size: \"${chunkSize}\". Must be a positive integer that is a multiple of ${pageLimit}.`,\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process.exit);\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const { baseName, extension } = parseFilePath(file);\n const { baseName: baseNameTarget, extension: extensionTarget } = parseFilePath(fileTarget);\n\n let allIdentifiersCount = 0;\n let allTargetIdentifiersCount = 0;\n let fileCount = 0;\n // Create onSave callback to handle chunked processing\n const onSave = async (chunkToSave: CsvFormattedIdentifier[]): Promise<void> => {\n // Add to all identifiers\n allIdentifiersCount += chunkToSave.length;\n\n // Get unique request IDs from this chunk\n const requestIds = chunkToSave.map((d) => d.requestId as string);\n const uniqueRequestIds = uniq(requestIds);\n\n // Pull down target identifiers for this chunk\n const chunkedRequestIds = chunk(uniqueRequestIds, pageLimit);\n const results = await map(\n chunkedRequestIds,\n async (requestIds) => {\n logger.info(\n colors.magenta(`Fetching target identifiers for ${requestIds.length} requests`),\n );\n const results = await fetchRequestFilesForRequest(client, {\n logger,\n pageSize: pageLimit * 2,\n filterBy: {\n requestIds,\n dataSiloIds: [targetDataSiloId],\n },\n });\n return results.map(({ fileName, remoteId }) => {\n if (!remoteId) {\n throw new Error(`Failed to find remoteId for ${fileName}`);\n }\n return {\n RecordId: remoteId,\n Object: fileName.replace('.json', '').split('/').pop()?.replace(' Information', ''),\n Comment: 'Customer data deletion request submitted via transcend.io',\n };\n });\n },\n // We are grabbing all the request files for the 'pageLimit' # of requests at a time\n {\n concurrency: 1,\n },\n );\n\n allTargetIdentifiersCount += results.flat().length;\n\n // Write the identifiers and target identifiers to CSV\n const headers = uniq(chunkToSave.map((d) => Object.keys(d)).flat());\n const numberedFileName = `${baseName}-${fileCount}${extension}`;\n const numberedFileNameTarget = `${baseNameTarget}-${fileCount}${extensionTarget}`;\n await writeLargeCsv(numberedFileName, chunkToSave, headers);\n logger.info(\n colors.green(`Successfully wrote ${chunkToSave.length} identifiers to file \"${file}\"`),\n );\n\n const targetIdentifiers = results.flat();\n const headers2 = uniq(targetIdentifiers.map((d) => Object.keys(d)).flat());\n await writeLargeCsv(numberedFileNameTarget, targetIdentifiers, headers2);\n logger.info(\n colors.green(\n `Successfully wrote ${targetIdentifiers.length} identifiers to file \"${fileTarget}\"`,\n ),\n );\n\n logger.info(\n colors.blue(\n `Processed chunk of ${chunk.length} identifiers, found ${targetIdentifiers.length} target identifiers`,\n ),\n );\n fileCount += 1;\n };\n\n // Pull down outstanding identifiers using the new chunked function\n await pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId: cronDataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize: pageLimit,\n savePageSize: chunkSize,\n onSave,\n transcendUrl,\n skipRequestCount,\n });\n\n logger.info(\n colors.green(`Successfully wrote ${allIdentifiersCount} identifiers to file \"${file}\"`),\n );\n logger.info(\n colors.green(\n `Successfully wrote ${allTargetIdentifiersCount} identifiers to file \"${fileTarget}\"`,\n ),\n );\n}\n"],"mappings":"6aA6BA,eAAsB,EAEpB,CACE,OACA,aACA,eACA,OACA,aACA,iBACA,mBACA,UACA,mBACA,YACA,aAEa,CACX,GACF,EAAO,KACL,EAAO,OAAO,wEAAwE,CACvF,EAGC,OAAO,MAAM,EAAU,EAAI,GAAa,GAAK,EAAY,IAAc,KACzE,EAAO,MACL,EAAO,IACL,wBAAwB,EAAU,sDAAsD,EAAU,GACnG,CACF,CACD,KAAK,QAAQ,KAAK,EAAE,EAGtB,EAAoB,KAAK,QAAQ,KAAK,CAGtC,IAAM,EAAS,EAA4B,EAAc,EAAK,CACxD,CAAE,WAAU,aAAc,EAAc,EAAK,CAC7C,CAAE,SAAU,EAAgB,UAAW,GAAoB,EAAc,EAAW,CAEtF,EAAsB,EACtB,EAA4B,EAC5B,EAAY,EAwEhB,MAAM,EAA4C,CAChD,WAAY,EACZ,OACA,aACA,UACA,YAAa,EACb,aAAc,EACd,YA7EoB,IAAyD,CAE7E,GAAuB,EAAY,OAQnC,IAAM,EAAU,MAAM,EADI,EAHD,EADN,EAAY,IAAK,GAAM,EAAE,UACJ,CAGQ,CAAE,EAE/B,CACjB,KAAO,KACL,EAAO,KACL,EAAO,QAAQ,mCAAmC,EAAW,OAAO,WAAW,CAChF,EASM,MARe,EAA4B,EAAQ,CACxD,SACA,SAAU,EAAY,EACtB,SAAU,CACR,aACA,YAAa,CAAC,EAAiB,CAChC,CACF,CAAC,EACa,KAAK,CAAE,WAAU,cAAe,CAC7C,GAAI,CAAC,EACH,MAAU,MAAM,+BAA+B,IAAW,CAE5D,MAAO,CACL,SAAU,EACV,OAAQ,EAAS,QAAQ,QAAS,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,QAAQ,eAAgB,GAAG,CACnF,QAAS,4DACV,EACD,EAGJ,CACE,YAAa,EACd,CACF,CAED,GAA6B,EAAQ,MAAM,CAAC,OAG5C,IAAM,EAAU,EAAK,EAAY,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAC7D,EAAmB,GAAG,EAAS,GAAG,IAAY,IAC9C,EAAyB,GAAG,EAAe,GAAG,IAAY,IAChE,MAAM,EAAc,EAAkB,EAAa,EAAQ,CAC3D,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAY,OAAO,wBAAwB,EAAK,GAAG,CACvF,CAED,IAAM,EAAoB,EAAQ,MAAM,CAExC,MAAM,EAAc,EAAwB,EAD3B,EAAK,EAAkB,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CACF,CAAC,CACxE,EAAO,KACL,EAAO,MACL,sBAAsB,EAAkB,OAAO,wBAAwB,EAAW,GACnF,CACF,CAED,EAAO,KACL,EAAO,KACL,sBAAsB,EAAM,OAAO,sBAAsB,EAAkB,OAAO,qBACnF,CACF,CACD,GAAa,GAYb,eACA,mBACD,CAAC,CAEF,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAoB,wBAAwB,EAAK,GAAG,CACxF,CACD,EAAO,KACL,EAAO,MACL,sBAAsB,EAA0B,wBAAwB,EAAW,GACpF,CACF"}
1
+ {"version":3,"file":"impl-DiysQB762.mjs","names":[],"sources":["../src/commands/request/cron/pull-profiles/impl.ts"],"sourcesContent":["import type { RequestAction } from '@transcend-io/privacy-types';\nimport { buildTranscendGraphQLClient, fetchRequestFilesForRequest } from '@transcend-io/sdk';\nimport { map } from '@transcend-io/utils';\nimport colors from 'colors';\nimport { uniq, chunk } from 'lodash-es';\n\nimport type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport {\n pullChunkedCustomSiloOutstandingIdentifiers,\n type CsvFormattedIdentifier,\n} from '../../../../lib/cron/index.js';\nimport { parseFilePath, writeLargeCsv } from '../../../../lib/helpers/index.js';\nimport { logger } from '../../../../logger.js';\n\nexport interface PullProfilesCommandFlags {\n file: string;\n fileTarget: string;\n transcendUrl: string;\n auth: string;\n sombraAuth?: string;\n cronDataSiloId: string;\n targetDataSiloId: string;\n actions: RequestAction[];\n skipRequestCount: boolean;\n pageLimit: number;\n chunkSize: number;\n}\n\nexport async function pullProfiles(\n this: LocalContext,\n {\n file,\n fileTarget,\n transcendUrl,\n auth,\n sombraAuth,\n cronDataSiloId,\n targetDataSiloId,\n actions,\n skipRequestCount,\n pageLimit,\n chunkSize,\n }: PullProfilesCommandFlags,\n): Promise<void> {\n if (skipRequestCount) {\n logger.info(\n colors.yellow('Skipping request count as requested. This may help speed up the call.'),\n );\n }\n\n if (Number.isNaN(chunkSize) || chunkSize <= 0 || chunkSize % pageLimit !== 0) {\n logger.error(\n colors.red(\n `Invalid chunk size: \"${chunkSize}\". Must be a positive integer that is a multiple of ${pageLimit}.`,\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process.exit);\n\n // Create GraphQL client to connect to Transcend backend\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n const { baseName, extension } = parseFilePath(file);\n const { baseName: baseNameTarget, extension: extensionTarget } = parseFilePath(fileTarget);\n\n let allIdentifiersCount = 0;\n let allTargetIdentifiersCount = 0;\n let fileCount = 0;\n // Create onSave callback to handle chunked processing\n const onSave = async (chunkToSave: CsvFormattedIdentifier[]): Promise<void> => {\n // Add to all identifiers\n allIdentifiersCount += chunkToSave.length;\n\n // Get unique request IDs from this chunk\n const requestIds = chunkToSave.map((d) => d.requestId as string);\n const uniqueRequestIds = uniq(requestIds);\n\n // Pull down target identifiers for this chunk\n const chunkedRequestIds = chunk(uniqueRequestIds, pageLimit);\n const results = await map(\n chunkedRequestIds,\n async (requestIds) => {\n logger.info(\n colors.magenta(`Fetching target identifiers for ${requestIds.length} requests`),\n );\n const results = await fetchRequestFilesForRequest(client, {\n logger,\n pageSize: pageLimit * 2,\n filterBy: {\n requestIds,\n dataSiloIds: [targetDataSiloId],\n },\n });\n return results.map(({ fileName, remoteId }) => {\n if (!remoteId) {\n throw new Error(`Failed to find remoteId for ${fileName}`);\n }\n return {\n RecordId: remoteId,\n Object: fileName.replace('.json', '').split('/').pop()?.replace(' Information', ''),\n Comment: 'Customer data deletion request submitted via transcend.io',\n };\n });\n },\n // We are grabbing all the request files for the 'pageLimit' # of requests at a time\n {\n concurrency: 1,\n },\n );\n\n allTargetIdentifiersCount += results.flat().length;\n\n // Write the identifiers and target identifiers to CSV\n const headers = uniq(chunkToSave.map((d) => Object.keys(d)).flat());\n const numberedFileName = `${baseName}-${fileCount}${extension}`;\n const numberedFileNameTarget = `${baseNameTarget}-${fileCount}${extensionTarget}`;\n await writeLargeCsv(numberedFileName, chunkToSave, headers);\n logger.info(\n colors.green(`Successfully wrote ${chunkToSave.length} identifiers to file \"${file}\"`),\n );\n\n const targetIdentifiers = results.flat();\n const headers2 = uniq(targetIdentifiers.map((d) => Object.keys(d)).flat());\n await writeLargeCsv(numberedFileNameTarget, targetIdentifiers, headers2);\n logger.info(\n colors.green(\n `Successfully wrote ${targetIdentifiers.length} identifiers to file \"${fileTarget}\"`,\n ),\n );\n\n logger.info(\n colors.blue(\n `Processed chunk of ${chunk.length} identifiers, found ${targetIdentifiers.length} target identifiers`,\n ),\n );\n fileCount += 1;\n };\n\n // Pull down outstanding identifiers using the new chunked function\n await pullChunkedCustomSiloOutstandingIdentifiers({\n dataSiloId: cronDataSiloId,\n auth,\n sombraAuth,\n actions,\n apiPageSize: pageLimit,\n savePageSize: chunkSize,\n onSave,\n transcendUrl,\n skipRequestCount,\n });\n\n logger.info(\n colors.green(`Successfully wrote ${allIdentifiersCount} identifiers to file \"${file}\"`),\n );\n logger.info(\n colors.green(\n `Successfully wrote ${allTargetIdentifiersCount} identifiers to file \"${fileTarget}\"`,\n ),\n );\n}\n"],"mappings":"6aA6BA,eAAsB,EAEpB,CACE,OACA,aACA,eACA,OACA,aACA,iBACA,mBACA,UAC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AG,IAAY,IAChE,MAAM,EAAc,EAAkB,EAAa,EAAQ,CAC3D,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAY,OAAO,wBAAwB,EAAK,GAAG,CACvF,CAED,IAAM,EAAoB,EAAQ,MAAM,CAExC,MAAM,EAAc,EAAwB,EAD3B,EAAK,EAAkB,IAAK,GAAM,OAAO,KAAK,EAAE,CAAC,CAAC,MAAM,CACF,CAAC,CACxE,EAAO,KACL,EAAO,MACL,sBAAsB,EAAkB,OAAO,wBAAwB,EAAW,GACnF,CACF,CAED,EAAO,KACL,EAAO,KACL,sBAAsB,EAAM,OAAO,sBAAsB,EAAkB,OAAO,qBACnF,CACF,CACD,GAAa,GAYb,eACA,mBACD,CAAC,CAEF,EAAO,KACL,EAAO,MAAM,sBAAsB,EAAoB,wBAAwB,EAAK,GAAG,CACxF,CACD,EAAO,KACL,EAAO,MACL,sBAAsB,EAA0B,wBAAwB,EAAW,GACpF,CACF"}
@@ -1,2 +1,2 @@
1
1
  import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";import{n,r}from"./runOpa-NnuspgN0.mjs";import i from"node:fs";import a from"node:path";import o from"colors";async function s({pkg:s,input:c,bundle:l}){t(this.process.exit),r();let u=a.resolve(c);if(!i.existsSync(u))throw Error(`Input file not found: ${u}`);let d=[`eval`,`--format`,`pretty`,`--input`,u];l&&d.push(`-b`,a.resolve(l)),d.push(s),e.info(o.green(`Evaluating ${s} with input ${u}...`));let f=await n(d);f!==0&&this.process.exit(f)}export{s as _eval};
2
- //# sourceMappingURL=impl-DQdzYE12.mjs.map
2
+ //# sourceMappingURL=impl-DqcpxYHF.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-DQdzYE12.mjs","names":[],"sources":["../src/commands/policy/eval/impl.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { logger } from '../../../logger.js';\nimport { assertOpaInstalled, runOpa } from '../helpers/index.js';\n\n/** CLI flags for `transcend policy eval`. */\nexport interface EvalCommandFlags {\n /** OPA package/query to evaluate (e.g. `data.transcend.decision`) */\n pkg: string;\n /** Path to a JSON envelope input file */\n input: string;\n /** Optional local policy bundle directory */\n bundle?: string;\n}\n\n/**\n * Evaluate one envelope against a local policy bundle via `opa eval`.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function _eval(\n this: LocalContext,\n { pkg, input, bundle }: EvalCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n assertOpaInstalled();\n\n const inputPath = path.resolve(input);\n if (!fs.existsSync(inputPath)) {\n throw new Error(`Input file not found: ${inputPath}`);\n }\n\n const args = ['eval', '--format', 'pretty', '--input', inputPath];\n if (bundle) {\n args.push('-b', path.resolve(bundle));\n }\n args.push(pkg);\n\n logger.info(colors.green(`Evaluating ${pkg} with input ${inputPath}...`));\n\n const exitCode = await runOpa(args);\n if (exitCode !== 0) {\n this.process.exit(exitCode);\n }\n}\n"],"mappings":"2MA0BA,eAAsB,EAEpB,CAAE,MAAK,QAAO,UACC,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAoB,CAEpB,IAAM,EAAY,EAAK,QAAQ,EAAM,CACrC,GAAI,CAAC,EAAG,WAAW,EAAU,CAC3B,MAAU,MAAM,yBAAyB,IAAY,CAGvD,IAAM,EAAO,CAAC,OAAQ,WAAY,SAAU,UAAW,EAAU,CAC7D,GACF,EAAK,KAAK,KAAM,EAAK,QAAQ,EAAO,CAAC,CAEvC,EAAK,KAAK,EAAI,CAEd,EAAO,KAAK,EAAO,MAAM,cAAc,EAAI,cAAc,EAAU,KAAK,CAAC,CAEzE,IAAM,EAAW,MAAM,EAAO,EAAK,CAC/B,IAAa,GACf,KAAK,QAAQ,KAAK,EAAS"}
1
+ {"version":3,"file":"impl-DqcpxYHF.mjs","names":[],"sources":["../src/commands/policy/eval/impl.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport colors from 'colors';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { logger } from '../../../logger.js';\nimport { assertOpaInstalled, runOpa } from '../helpers/index.js';\n\n/** CLI flags for `transcend policy eval`. */\nexport interface EvalCommandFlags {\n /** OPA package/query to evaluate (e.g. `data.transcend.decision`) */\n pkg: string;\n /** Path to a JSON envelope input file */\n input: string;\n /** Optional local policy bundle directory */\n bundle?: string;\n}\n\n/**\n * Evaluate one envelope against a local policy bundle via `opa eval`.\n *\n * @param this - CLI context\n * @param flags - Command flags\n */\nexport async function _eval(\n this: LocalContext,\n { pkg, input, bundle }: EvalCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n assertOpaInstalled();\n\n const inputPath = path.resolve(input);\n if (!fs.existsSync(inputPath)) {\n throw new Error(`Input file not found: ${inputPath}`);\n }\n\n const args = ['eval', '--format', 'pretty', '--input', inputPath];\n if (bundle) {\n args.push('-b', path.resolve(bundle));\n }\n args.push(pkg);\n\n logger.info(colors.green(`Evaluating ${pkg} with input ${inputPath}...`));\n\n const exitCode = await runOpa(args);\n if (exitCode !== 0) {\n this.process.exit(exitCode);\n }\n}\n"],"mappings":"2MA0BA,eAAsB,EAEpB,CAAE,MAAK,QAAO,UACC,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,GAAoB,CAEpB,IAAM,EAAY,EAAK,QAAQ,EAAM,CACrC,GAAI,CAAC,EAAG,WAAW,EAAU,CAC3B,MAAU,MAAM,yBAAyB,IAAY,CAGvD,IAAM,EAAO,CAAC,OAAQ,WAAY,SAAU,UAAW,EAAU,CAC7D,GACF,EAAK,KAAK,KAAM,EAAK,QAAQ,EAAO,CAAC,CAEvC,EAAK,KAAK,EAAI,CAEd,EAAO,KAAK,EAAO,MAAM,cAAc,EAAI,cAAc,EAAU,KAAK,CAAC,CAEzE,IAAM,EAAW,MAAM,EAAO,EAAK,CAC/B,IAAa,GACf,KAAK,QAAQ,KAAK,EAAS"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./uploadCookiesFromCsv-Cf4q-K4o.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";async function n({auth:n,trackerStatus:r,file:i,transcendUrl:a}){t(this.process.exit),await e({auth:n,trackerStatus:r,file:i,transcendUrl:a})}export{n as uploadCookiesFromCsv};
2
- //# sourceMappingURL=impl-DtVfOZhs.mjs.map
1
+ import{t as e}from"./uploadCookiesFromCsv-8hq-Of_p.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";async function n({auth:n,trackerStatus:r,file:i,transcendUrl:a}){t(this.process.exit),await e({auth:n,trackerStatus:r,file:i,transcendUrl:a})}export{n as uploadCookiesFromCsv};
2
+ //# sourceMappingURL=impl-DqyYxDti.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-DtVfOZhs.mjs","names":["uploadCookiesFromCsvHelper"],"sources":["../src/commands/consent/upload-cookies-from-csv/impl.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { uploadCookiesFromCsv as uploadCookiesFromCsvHelper } from '../../../lib/consent-manager/index.js';\n\nexport interface UploadCookiesFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n transcendUrl: string;\n}\n\nexport async function uploadCookiesFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, transcendUrl }: UploadCookiesFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Upload cookies\n await uploadCookiesFromCsvHelper({\n auth,\n trackerStatus,\n file,\n transcendUrl,\n });\n}\n"],"mappings":"4GAaA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,gBACd,CACf,EAAoB,KAAK,QAAQ,KAAK,CAGtC,MAAMA,EAA2B,CAC/B,OACA,gBACA,OACA,eACD,CAAC"}
1
+ {"version":3,"file":"impl-DqyYxDti.mjs","names":["uploadCookiesFromCsvHelper"],"sources":["../src/commands/consent/upload-cookies-from-csv/impl.ts"],"sourcesContent":["import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { uploadCookiesFromCsv as uploadCookiesFromCsvHelper } from '../../../lib/consent-manager/index.js';\n\nexport interface UploadCookiesFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n transcendUrl: string;\n}\n\nexport async function uploadCookiesFromCsv(\n this: LocalContext,\n { auth, trackerStatus, file, transcendUrl }: UploadCookiesFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Upload cookies\n await uploadCookiesFromCsvHelper({\n auth,\n trackerStatus,\n file,\n transcendUrl,\n });\n}\n"],"mappings":"4GAaA,eAAsB,EAEpB,CAAE,OAAM,gBAAe,OAAM,gBACd,CACf,EAAoB,KAAK,QAAQ,KAAK,CAGtC,MAAMA,EAA2B,CAC/B,OACA,gBACA,OACA,eACD,CAAC"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./readCsv-ddmavI86.mjs";import{t as n}from"./markRequestDataSiloIdsCompleted-DYsj2ONd.mjs";import{t as r}from"./done-input-validation-D25TzrxG.mjs";import i from"colors";import*as a from"io-ts";const o=a.type({"Request Id":a.string});async function s({auth:a,dataSiloId:s,file:c,transcendUrl:l}){r(this.process.exit),e.info(i.magenta(`Reading "${c}" from disk`)),await n({requestIds:t(c,o).map(e=>e[`Request Id`]),transcendUrl:l,auth:a,dataSiloId:s})}export{s as markRequestDataSilosCompleted};
2
- //# sourceMappingURL=impl-DpU2s1HR.mjs.map
1
+ import{t as e}from"./logger-D1tXVwJj.mjs";import{t}from"./readCsv-ddmavI86.mjs";import{t as n}from"./markRequestDataSiloIdsCompleted-nAV0VLEA.mjs";import{t as r}from"./done-input-validation-D25TzrxG.mjs";import i from"colors";import*as a from"io-ts";const o=a.type({"Request Id":a.string});async function s({auth:a,dataSiloId:s,file:c,transcendUrl:l}){r(this.process.exit),e.info(i.magenta(`Reading "${c}" from disk`)),await n({requestIds:t(c,o).map(e=>e[`Request Id`]),transcendUrl:l,auth:a,dataSiloId:s})}export{s as markRequestDataSilosCompleted};
2
+ //# sourceMappingURL=impl-RqwgNa2O.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-DpU2s1HR.mjs","names":[],"sources":["../src/commands/request/system/mark-request-data-silos-completed/impl.ts"],"sourcesContent":["import colors from 'colors';\nimport * as t from 'io-ts';\n\nimport type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport { markRequestDataSiloIdsCompleted } from '../../../../lib/cron/index.js';\nimport { readCsv } from '../../../../lib/requests/index.js';\nimport { logger } from '../../../../logger.js';\n\nconst RequestIdRow = t.type({\n 'Request Id': t.string,\n});\n\nexport interface MarkRequestDataSilosCompletedCommandFlags {\n auth: string;\n dataSiloId: string;\n file: string;\n transcendUrl: string;\n}\n\nexport async function markRequestDataSilosCompleted(\n this: LocalContext,\n { auth, dataSiloId, file, transcendUrl }: MarkRequestDataSilosCompletedCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const activeResults = readCsv(file, RequestIdRow);\n\n await markRequestDataSiloIdsCompleted({\n requestIds: activeResults.map((request) => request['Request Id']),\n transcendUrl,\n auth,\n dataSiloId,\n });\n}\n"],"mappings":"0PASA,MAAM,EAAe,EAAE,KAAK,CAC1B,aAAc,EAAE,OACjB,CAAC,CASF,eAAsB,EAEpB,CAAE,OAAM,aAAY,OAAM,gBACX,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,EAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CAG1D,MAAM,EAAgC,CACpC,WAHoB,EAAQ,EAAM,EAGT,CAAC,IAAK,GAAY,EAAQ,cAAc,CACjE,eACA,OACA,aACD,CAAC"}
1
+ {"version":3,"file":"impl-RqwgNa2O.mjs","names":[],"sources":["../src/commands/request/system/mark-request-data-silos-completed/impl.ts"],"sourcesContent":["import colors from 'colors';\nimport * as t from 'io-ts';\n\nimport type { LocalContext } from '../../../../context.js';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation.js';\nimport { markRequestDataSiloIdsCompleted } from '../../../../lib/cron/index.js';\nimport { readCsv } from '../../../../lib/requests/index.js';\nimport { logger } from '../../../../logger.js';\n\nconst RequestIdRow = t.type({\n 'Request Id': t.string,\n});\n\nexport interface MarkRequestDataSilosCompletedCommandFlags {\n auth: string;\n dataSiloId: string;\n file: string;\n transcendUrl: string;\n}\n\nexport async function markRequestDataSilosCompleted(\n this: LocalContext,\n { auth, dataSiloId, file, transcendUrl }: MarkRequestDataSilosCompletedCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const activeResults = readCsv(file, RequestIdRow);\n\n await markRequestDataSiloIdsCompleted({\n requestIds: activeResults.map((request) => request['Request Id']),\n transcendUrl,\n auth,\n dataSiloId,\n });\n}\n"],"mappings":"0PASA,MAAM,EAAe,EAAE,KAAK,CAC1B,aAAc,EAAE,OACjB,CAAC,CASF,eAAsB,EAEpB,CAAE,OAAM,aAAY,OAAM,gBACX,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,EAAO,KAAK,EAAO,QAAQ,YAAY,EAAK,aAAa,CAAC,CAG1D,MAAM,EAAgC,CACpC,WAHoB,EAAQ,EAAM,EAGT,CAAC,IAAK,GAAY,EAAQ,cAAc,CACjE,eACA,OACA,aACD,CAAC"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./cancelPrivacyRequests-DBjBnX2p.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";async function n({auth:n,actions:r,statuses:i=[],requestIds:a,silentModeBefore:o,createdAtBefore:s,createdAtAfter:c,updatedAtBefore:l,updatedAtAfter:u,cancellationTitle:d,transcendUrl:f,concurrency:p}){t(this.process.exit),await e({transcendUrl:f,requestActions:r,auth:n,cancellationTitle:d,requestIds:a,statuses:i,concurrency:p,silentModeBefore:o?new Date(o):void 0,createdAtBefore:s?new Date(s):void 0,createdAtAfter:c?new Date(c):void 0,updatedAtBefore:l?new Date(l):void 0,updatedAtAfter:u?new Date(u):void 0})}export{n as cancel};
2
- //# sourceMappingURL=impl-cro4x_eG.mjs.map
1
+ import{t as e}from"./cancelPrivacyRequests-CFCULeSv.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";async function n({auth:n,actions:r,statuses:i=[],requestIds:a,silentModeBefore:o,createdAtBefore:s,createdAtAfter:c,updatedAtBefore:l,updatedAtAfter:u,cancellationTitle:d,transcendUrl:f,concurrency:p}){t(this.process.exit),await e({transcendUrl:f,requestActions:r,auth:n,cancellationTitle:d,requestIds:a,statuses:i,concurrency:p,silentModeBefore:o?new Date(o):void 0,createdAtBefore:s?new Date(s):void 0,createdAtAfter:c?new Date(c):void 0,updatedAtBefore:l?new Date(l):void 0,updatedAtAfter:u?new Date(u):void 0})}export{n as cancel};
2
+ //# sourceMappingURL=impl-TTeKThep2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-TTeKThep2.mjs","names":[],"sources":["../src/commands/request/cancel/impl.ts"],"sourcesContent":["import { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { cancelPrivacyRequests } from '../../../lib/requests/index.js';\n\nexport interface CancelCommandFlags {\n auth: string;\n actions: RequestAction[];\n statuses?: RequestStatus[];\n requestIds?: string[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n updatedAtBefore?: Date;\n updatedAtAfter?: Date;\n cancellationTitle: string;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function cancel(\n this: LocalContext,\n {\n auth,\n actions,\n statuses = [],\n requestIds,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n updatedAtBefore,\n updatedAtAfter,\n cancellationTitle,\n transcendUrl,\n concurrency,\n }: CancelCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await cancelPrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n cancellationTitle,\n requestIds,\n statuses,\n concurrency,\n silentModeBefore: silentModeBefore ? new Date(silentModeBefore) : undefined,\n createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,\n createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,\n updatedAtBefore: updatedAtBefore ? new Date(updatedAtBefore) : undefined,\n updatedAtAfter: updatedAtAfter ? new Date(updatedAtAfter) : undefined,\n });\n}\n"],"mappings":"6GAqBA,eAAsB,EAEpB,CACE,OACA,UACA,WAAW,EAAE,CACb,aACA,mBACA,kBACA,iBACA,kBACA,iBACA,oBACA,eACA,eAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAAsB,CAC1B,eACA,eAAgB,EAChB,OACA,oBACA,aACA,WACA,cACA,iBAAkB,EAAmB,IAAI,KAAK,EAAiB,CAAG,IAAA,GAClE,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC5D,gBAAiB,EAAkB,IAAI,KAAK,EAAgB,CAAG,IAAA,GAC/D,eAAgB,EAAiB,IAAI,KAAK,EAAe,CAAG,IAAA,GAC7D,CAAC"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./uploadPrivacyRequestsFromCsv-CtLCdggr.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";import{splitCsvToList as n}from"@transcend-io/utils";async function r({auth:r,file:i,transcendUrl:a,cacheFilepath:o,requestReceiptFolder:s,sombraAuth:c,concurrency:l,attributes:u,isTest:d,isSilent:f,skipSendingReceipt:p,emailIsVerified:m,skipFilterStep:h,dryRun:g,debug:_,defaultPhoneCountryCode:v}){t(this.process.exit),await e({cacheFilepath:o,requestReceiptFolder:s,file:i,auth:r,sombraAuth:c,concurrency:l,transcendUrl:a,defaultPhoneCountryCode:v,attributes:n(u),debug:_,skipFilterStep:h,isSilent:f,skipSendingReceipt:p,emailIsVerified:m,isTest:d,dryRun:g})}export{r as upload};
2
- //# sourceMappingURL=impl-CJIfMPOK.mjs.map
1
+ import{t as e}from"./uploadPrivacyRequestsFromCsv-D-RTgJsx.mjs";import{t}from"./done-input-validation-D25TzrxG.mjs";import{splitCsvToList as n}from"@transcend-io/utils";async function r({auth:r,file:i,transcendUrl:a,cacheFilepath:o,requestReceiptFolder:s,sombraAuth:c,concurrency:l,attributes:u,isTest:d,isSilent:f,skipSendingReceipt:p,emailIsVerified:m,skipFilterStep:h,dryRun:g,debug:_,defaultPhoneCountryCode:v}){t(this.process.exit),await e({cacheFilepath:o,requestReceiptFolder:s,file:i,auth:r,sombraAuth:c,concurrency:l,transcendUrl:a,defaultPhoneCountryCode:v,attributes:n(u),debug:_,skipFilterStep:h,isSilent:f,skipSendingReceipt:p,emailIsVerified:m,isTest:d,dryRun:g})}export{r as upload};
2
+ //# sourceMappingURL=impl-X13pzYJN2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impl-X13pzYJN2.mjs","names":[],"sources":["../src/commands/request/upload/impl.ts"],"sourcesContent":["import { splitCsvToList } from '@transcend-io/utils';\n\nimport type { LocalContext } from '../../../context.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { uploadPrivacyRequestsFromCsv } from '../../../lib/requests/index.js';\n\nexport interface UploadCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n cacheFilepath: string;\n requestReceiptFolder: string;\n sombraAuth?: string;\n concurrency: number;\n attributes: string;\n isTest: boolean;\n isSilent: boolean;\n skipSendingReceipt: boolean;\n emailIsVerified: boolean;\n skipFilterStep: boolean;\n dryRun: boolean;\n debug: boolean;\n defaultPhoneCountryCode: string;\n}\n\nexport async function upload(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n cacheFilepath,\n requestReceiptFolder,\n sombraAuth,\n concurrency,\n attributes,\n isTest,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n skipFilterStep,\n dryRun,\n debug,\n defaultPhoneCountryCode,\n }: UploadCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadPrivacyRequestsFromCsv({\n cacheFilepath,\n requestReceiptFolder,\n file,\n auth,\n sombraAuth,\n concurrency,\n transcendUrl,\n defaultPhoneCountryCode,\n attributes: splitCsvToList(attributes),\n debug,\n skipFilterStep,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n isTest,\n dryRun,\n });\n}\n"],"mappings":"yKAyBA,eAAsB,EAEpB,CACE,OACA,OACA,eACA,gBACA,uBACA,aACA,cACA,aACA,SACA,WACA,qBACA,kBACA,iBACA,SACA,QACA,2BAEa,CACf,EAAoB,KAAK,QAAQ,KAAK,CAEtC,MAAM,EAA6B,CACjC,gBACA,uBACA,OACA,OACA,aACA,cACA,eACA,0BACA,WAAY,EAAe,EAAW,CACtC,QACA,iBACA,WACA,qBACA,kBACA,SACA,SACD,CAAC"}
@@ -1,2 +1,2 @@
1
- import{r as e}from"./constants-Co8rkELu.mjs";import{t}from"./logger-D1tXVwJj.mjs";import{r as n}from"./readTranscendYaml-I64TqeSd.mjs";import{n as r,r as i,t as a}from"./parseVariablesFromString-Cpjk0zeN.mjs";import{t as o}from"./validateTranscendAuth-CToEUu1U.mjs";import{t as s}from"./listFiles-DsUfOUWr.mjs";import{t as c}from"./done-input-validation-D25TzrxG.mjs";import{existsSync as l,lstatSync as u}from"node:fs";import{join as d}from"node:path";import f from"colors";import{buildTranscendGraphQLClient as p}from"@transcend-io/sdk";import{mapSeries as m}from"@transcend-io/utils";async function h({transcendUrl:e,auth:n,pageSize:r,publishToPrivacyCenter:a,contents:o,deleteExtraAttributeValues:s=!1,classifyService:c=!1}){let l=p(e,n);try{return!await i(o,l,{pageSize:r,publishToPrivacyCenter:a,classifyService:c,deleteExtraAttributeValues:s})}catch(e){return t.error(f.red(`An unexpected error occurred syncing the schema: ${e.message}`)),!1}}async function g({file:i=`./transcend.yml`,transcendUrl:p,auth:g,variables:_,pageSize:v,publishToPrivacyCenter:y,classifyService:b,deleteExtraAttributeValues:x}){c(this.process.exit);let S=await o(g),C=a(_),w;if(w=Array.isArray(S)&&u(i).isDirectory()?s(i).map(e=>d(i,e)):i.split(`,`),w.length<1)throw Error(`No file specified!`);let T=w.map(e=>{l(e)?t.info(f.magenta(`Reading file "${e}"...`)):(t.error(f.red(`The file path does not exist on disk: ${e}. You can specify the filepath using --file=./examples/transcend.yml`)),this.process.exit(1));try{let r=n(e,C);return t.info(f.green(`Successfully read in "${e}"`)),{content:r,name:e.split(`/`).pop().replace(`.yml`,``)}}catch(e){t.error(f.red(`The shape of your yaml file is invalid with the following errors: ${e.message}`)),this.process.exit(1)}});if(typeof S==`string`){let[n,...i]=T.map(({content:e})=>e);await h({transcendUrl:p,auth:S,contents:r(n,...i),publishToPrivacyCenter:y,deleteExtraAttributeValues:x,pageSize:v,classifyService:!!b})||(t.info(f.red(`Sync encountered errors. View output above for more information, or check out ${e}`)),this.process.exit(1))}else{if(T.length!==1&&T.length!==S.length)throw Error(`Expected list of yml files to be equal to the list of API keys.Got ${T.length} YML file${T.length===1?``:`s`} and ${S.length} API key${S.length===1?``:`s`}`);let n=[];await m(S,async(e,r)=>{let i=`[${r+1}/${S.length}][${e.organizationName}] `;t.info(f.magenta(`~~~\n\n${i}Attempting to push configuration...\n\n~~~`));let a=T.length===1?T[0].content:T.find(t=>t.name===e.organizationName)?.content;if(!a){t.error(f.red(`${i}Failed to find transcend.yml file for organization: "${e.organizationName}".`)),n.push(e.organizationName);return}await h({transcendUrl:p,auth:e.apiKey,contents:a,pageSize:v,publishToPrivacyCenter:y,deleteExtraAttributeValues:x,classifyService:b})?t.info(f.green(`${i}Successfully pushed configuration!`)):(t.error(f.red(`${i}Failed to sync configuration.`)),n.push(e.organizationName))}),n.length>0&&(t.info(f.red(`Sync encountered errors for "${n.join(`,`)}". View output above for more information, or check out ${e}`)),this.process.exit(1))}t.info(f.green(`Successfully synced yaml file to Transcend! View at ${e}`))}export{g as push};
2
- //# sourceMappingURL=impl-B4mrbkzO.mjs.map
1
+ import{r as e}from"./constants-B7bW_WN2.mjs";import{t}from"./logger-D1tXVwJj.mjs";import{r as n}from"./readTranscendYaml-I64TqeSd.mjs";import{n as r,r as i,t as a}from"./parseVariablesFromString-Cpjk0zeN.mjs";import{t as o}from"./validateTranscendAuth-CToEUu1U.mjs";import{t as s}from"./listFiles-DsUfOUWr.mjs";import{t as c}from"./done-input-validation-D25TzrxG.mjs";import{existsSync as l,lstatSync as u}from"node:fs";import{join as d}from"node:path";import f from"colors";import{buildTranscendGraphQLClient as p}from"@transcend-io/sdk";import{mapSeries as m}from"@transcend-io/utils";async function h({transcendUrl:e,auth:n,pageSize:r,publishToPrivacyCenter:a,contents:o,deleteExtraAttributeValues:s=!1,classifyService:c=!1}){let l=p(e,n);try{return!await i(o,l,{pageSize:r,publishToPrivacyCenter:a,classifyService:c,deleteExtraAttributeValues:s})}catch(e){return t.error(f.red(`An unexpected error occurred syncing the schema: ${e.message}`)),!1}}async function g({file:i=`./transcend.yml`,transcendUrl:p,auth:g,variables:_,pageSize:v,publishToPrivacyCenter:y,classifyService:b,deleteExtraAttributeValues:x}){c(this.process.exit);let S=await o(g),C=a(_),w;if(w=Array.isArray(S)&&u(i).isDirectory()?s(i).map(e=>d(i,e)):i.split(`,`),w.length<1)throw Error(`No file specified!`);let T=w.map(e=>{l(e)?t.info(f.magenta(`Reading file "${e}"...`)):(t.error(f.red(`The file path does not exist on disk: ${e}. You can specify the filepath using --file=./examples/transcend.yml`)),this.process.exit(1));try{let r=n(e,C);return t.info(f.green(`Successfully read in "${e}"`)),{content:r,name:e.split(`/`).pop().replace(`.yml`,``)}}catch(e){t.error(f.red(`The shape of your yaml file is invalid with the following errors: ${e.message}`)),this.process.exit(1)}});if(typeof S==`string`){let[n,...i]=T.map(({content:e})=>e);await h({transcendUrl:p,auth:S,contents:r(n,...i),publishToPrivacyCenter:y,deleteExtraAttributeValues:x,pageSize:v,classifyService:!!b})||(t.info(f.red(`Sync encountered errors. View output above for more information, or check out ${e}`)),this.process.exit(1))}else{if(T.length!==1&&T.length!==S.length)throw Error(`Expected list of yml files to be equal to the list of API keys.Got ${T.length} YML file${T.length===1?``:`s`} and ${S.length} API key${S.length===1?``:`s`}`);let n=[];await m(S,async(e,r)=>{let i=`[${r+1}/${S.length}][${e.organizationName}] `;t.info(f.magenta(`~~~\n\n${i}Attempting to push configuration...\n\n~~~`));let a=T.length===1?T[0].content:T.find(t=>t.name===e.organizationName)?.content;if(!a){t.error(f.red(`${i}Failed to find transcend.yml file for organization: "${e.organizationName}".`)),n.push(e.organizationName);return}await h({transcendUrl:p,auth:e.apiKey,contents:a,pageSize:v,publishToPrivacyCenter:y,deleteExtraAttributeValues:x,classifyService:b})?t.info(f.green(`${i}Successfully pushed configuration!`)):(t.error(f.red(`${i}Failed to sync configuration.`)),n.push(e.organizationName))}),n.length>0&&(t.info(f.red(`Sync encountered errors for "${n.join(`,`)}". View output above for more information, or check out ${e}`)),this.process.exit(1))}t.info(f.green(`Successfully synced yaml file to Transcend! View at ${e}`))}export{g as push};
2
+ //# sourceMappingURL=impl-e-_DWiv4.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"impl-B4mrbkzO.mjs","names":[],"sources":["../src/commands/inventory/push/impl.ts"],"sourcesContent":["import { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\n\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { TranscendInput } from '../../../codecs.js';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth, listFiles } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { syncConfigurationToTranscend } from '../../../lib/graphql/index.js';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString.js';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs.js';\nimport { readTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { logger } from '../../../logger.js';\n\n/**\n * Sync configuration to Transcend\n *\n * @param options - Options\n * @returns True if synced successfully, false if error occurs\n */\nasync function syncConfiguration({\n transcendUrl,\n auth,\n pageSize,\n publishToPrivacyCenter,\n contents,\n deleteExtraAttributeValues = false,\n classifyService = false,\n}: {\n /** Transcend YAML */\n contents: TranscendInput;\n /** Transcend URL */\n transcendUrl: string;\n /** API key */\n auth: string;\n /** Page size */\n pageSize: number;\n /** Skip privacy center publish step */\n publishToPrivacyCenter: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** Delete attributes when syncing */\n deleteExtraAttributeValues?: boolean;\n}): Promise<boolean> {\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Sync to Transcend\n try {\n const encounteredError = await syncConfigurationToTranscend(contents, client, {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n });\n return !encounteredError;\n } catch (err) {\n logger.error(colors.red(`An unexpected error occurred syncing the schema: ${err.message}`));\n return false;\n }\n}\n\nexport interface PushCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n pageSize: number;\n variables: string;\n publishToPrivacyCenter: boolean;\n classifyService: boolean;\n deleteExtraAttributeValues: boolean;\n}\n\nexport async function push(\n this: LocalContext,\n {\n file = './transcend.yml',\n transcendUrl,\n auth,\n variables,\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n }: PushCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Parse out the variables\n const vars = parseVariablesFromString(variables);\n\n // check if we are being passed a list of API keys and a list of files\n let fileList: string[];\n if (Array.isArray(apiKeyOrList) && lstatSync(file).isDirectory()) {\n fileList = listFiles(file).map((filePath) => join(file, filePath));\n } else {\n fileList = file.split(',');\n }\n\n // Ensure at least one file is parsed\n if (fileList.length < 1) {\n throw new Error('No file specified!');\n }\n\n // eslint-disable-next-line array-callback-return,consistent-return\n const transcendInputs = fileList.map((filePath) => {\n // Ensure yaml file exists on disk\n if (!existsSync(filePath)) {\n logger.error(\n colors.red(\n `The file path does not exist on disk: ${filePath}. You can specify the filepath using --file=./examples/transcend.yml`,\n ),\n );\n this.process.exit(1);\n } else {\n logger.info(colors.magenta(`Reading file \"${filePath}\"...`));\n }\n\n try {\n // Read in the yaml file and validate it's shape\n const newContents = readTranscendYaml(filePath, vars);\n logger.info(colors.green(`Successfully read in \"${filePath}\"`));\n return {\n content: newContents,\n name: filePath.split('/').pop()!.replace('.yml', ''),\n };\n } catch (err) {\n logger.error(\n colors.red(\n `The shape of your yaml file is invalid with the following errors: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n });\n\n // process a single API key\n if (typeof apiKeyOrList === 'string') {\n // if passed multiple inputs, merge them together\n const [base, ...rest] = transcendInputs.map(({ content }) => content);\n const contents = mergeTranscendInputs(base, ...rest);\n\n // sync the configuration\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKeyOrList,\n contents,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n pageSize,\n classifyService: !!classifyService,\n });\n\n // exist with error code\n if (!success) {\n logger.info(\n colors.red(\n `Sync encountered errors. View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n } else {\n // if passed multiple inputs, expect them to be one per instance\n if (transcendInputs.length !== 1 && transcendInputs.length !== apiKeyOrList.length) {\n throw new Error(\n 'Expected list of yml files to be equal to the list of API keys.' +\n `Got ${transcendInputs.length} YML file${\n transcendInputs.length === 1 ? '' : 's'\n } and ${apiKeyOrList.length} API key${apiKeyOrList.length === 1 ? '' : 's'}`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${apiKey.organizationName}] `;\n logger.info(colors.magenta(`~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`));\n\n // use the merged contents if 1 yml passed, else use the contents that map to that organization\n const useContents =\n transcendInputs.length === 1\n ? transcendInputs[0].content\n : transcendInputs.find((input) => input.name === apiKey.organizationName)?.content;\n\n // Throw error if cannot find a yml file matching that organization name\n if (!useContents) {\n logger.error(\n colors.red(\n `${prefix}Failed to find transcend.yml file for organization: \"${apiKey.organizationName}\".`,\n ),\n );\n encounteredErrors.push(apiKey.organizationName);\n return;\n }\n\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKey.apiKey,\n contents: useContents,\n pageSize,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n classifyService,\n });\n\n if (success) {\n logger.info(colors.green(`${prefix}Successfully pushed configuration!`));\n } else {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n\n // Indicate success\n logger.info(\n colors.green(`Successfully synced yaml file to Transcend! View at ${ADMIN_DASH_INTEGRATIONS}`),\n );\n}\n"],"mappings":"2kBAwBA,eAAe,EAAkB,CAC/B,eACA,OACA,WACA,yBACA,WACA,6BAA6B,GAC7B,kBAAkB,IAgBC,CACnB,IAAM,EAAS,EAA4B,EAAc,EAAK,CAG9D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v4.mjs","names":[],"sources":["../src/commands/inventory/push/impl.ts"],"sourcesContent":["import { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\n\nimport { buildTranscendGraphQLClient } from '@transcend-io/sdk';\nimport { mapSeries } from '@transcend-io/utils';\nimport colors from 'colors';\n\nimport { TranscendInput } from '../../../codecs.js';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants.js';\nimport type { LocalContext } from '../../../context.js';\nimport { validateTranscendAuth, listFiles } from '../../../lib/api-keys/index.js';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation.js';\nimport { syncConfigurationToTranscend } from '../../../lib/graphql/index.js';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString.js';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs.js';\nimport { readTranscendYaml } from '../../../lib/readTranscendYaml.js';\nimport { logger } from '../../../logger.js';\n\n/**\n * Sync configuration to Transcend\n *\n * @param options - Options\n * @returns True if synced successfully, false if error occurs\n */\nasync function syncConfiguration({\n transcendUrl,\n auth,\n pageSize,\n publishToPrivacyCenter,\n contents,\n deleteExtraAttributeValues = false,\n classifyService = false,\n}: {\n /** Transcend YAML */\n contents: TranscendInput;\n /** Transcend URL */\n transcendUrl: string;\n /** API key */\n auth: string;\n /** Page size */\n pageSize: number;\n /** Skip privacy center publish step */\n publishToPrivacyCenter: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** Delete attributes when syncing */\n deleteExtraAttributeValues?: boolean;\n}): Promise<boolean> {\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Sync to Transcend\n try {\n const encounteredError = await syncConfigurationToTranscend(contents, client, {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n });\n return !encounteredError;\n } catch (err) {\n logger.error(colors.red(`An unexpected error occurred syncing the schema: ${err.message}`));\n return false;\n }\n}\n\nexport interface PushCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n pageSize: number;\n variables: string;\n publishToPrivacyCenter: boolean;\n classifyService: boolean;\n deleteExtraAttributeValues: boolean;\n}\n\nexport async function push(\n this: LocalContext,\n {\n file = './transcend.yml',\n transcendUrl,\n auth,\n variables,\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n }: PushCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Parse out the variables\n const vars = parseVariablesFromString(variables);\n\n // check if we are being passed a list of API keys and a list of files\n let fileList: string[];\n if (Array.isArray(apiKeyOrList) && lstatSync(file).isDirectory()) {\n fileList = listFiles(file).map((filePath) => join(file, filePath));\n } else {\n fileList = file.split(',');\n }\n\n // Ensure at least one file is parsed\n if (fileList.length < 1) {\n throw new Error('No file specified!');\n }\n\n // eslint-disable-next-line array-callback-return,consistent-return\n const transcendInputs = fileList.map((filePath) => {\n // Ensure yaml file exists on disk\n if (!existsSync(filePath)) {\n logger.error(\n colors.red(\n `The file path does not exist on disk: ${filePath}. You can specify the filepath using --file=./examples/transcend.yml`,\n ),\n );\n this.process.exit(1);\n } else {\n logger.info(colors.magenta(`Reading file \"${filePath}\"...`));\n }\n\n try {\n // Read in the yaml file and validate it's shape\n const newContents = readTranscendYaml(filePath, vars);\n logger.info(colors.green(`Successfully read in \"${filePath}\"`));\n return {\n content: newContents,\n name: filePath.split('/').pop()!.replace('.yml', ''),\n };\n } catch (err) {\n logger.error(\n colors.red(\n `The shape of your yaml file is invalid with the following errors: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n });\n\n // process a single API key\n if (typeof apiKeyOrList === 'string') {\n // if passed multiple inputs, merge them together\n const [base, ...rest] = transcendInputs.map(({ content }) => content);\n const contents = mergeTranscendInputs(base, ...rest);\n\n // sync the configuration\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKeyOrList,\n contents,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n pageSize,\n classifyService: !!classifyService,\n });\n\n // exist with error code\n if (!success) {\n logger.info(\n colors.red(\n `Sync encountered errors. View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n } else {\n // if passed multiple inputs, expect them to be one per instance\n if (transcendInputs.length !== 1 && transcendInputs.length !== apiKeyOrList.length) {\n throw new Error(\n 'Expected list of yml files to be equal to the list of API keys.' +\n `Got ${transcendInputs.length} YML file${\n transcendInputs.length === 1 ? '' : 's'\n } and ${apiKeyOrList.length} API key${apiKeyOrList.length === 1 ? '' : 's'}`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${apiKey.organizationName}] `;\n logger.info(colors.magenta(`~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`));\n\n // use the merged contents if 1 yml passed, else use the contents that map to that organization\n const useContents =\n transcendInputs.length === 1\n ? transcendInputs[0].content\n : transcendInputs.find((input) => input.name === apiKey.organizationName)?.content;\n\n // Throw error if cannot find a yml file matching that organization name\n if (!useContents) {\n logger.error(\n colors.red(\n `${prefix}Failed to find transcend.yml file for organization: \"${apiKey.organizationName}\".`,\n ),\n );\n encounteredErrors.push(apiKey.organizationName);\n return;\n }\n\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKey.apiKey,\n contents: useContents,\n pageSize,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n classifyService,\n });\n\n if (success) {\n logger.info(colors.green(`${prefix}Successfully pushed configuration!`));\n } else {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n\n // Indicate success\n logger.info(\n colors.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B,OAAS,IAC7B,EAAO,KACL,EAAO,IACL,gCAAgC,EAAkB,KAChD,IACD,CAAC,0DAA0D,IAC7D,CACF,CAED,KAAK,QAAQ,KAAK,EAAE,EAKxB,EAAO,KACL,EAAO,MAAM,uDAAuD,IAA0B,CAC/F"}
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CommandContext } from "@stricli/core";
2
2
  import { StricliAutoCompleteContext } from "@stricli/auto-complete";
3
- import { AssessmentFormTemplateSource, AssessmentFormTemplateStatus, CodePackageType, ConsentBundleType, ConsentManagerMetricBin, ConsentTrackerStatus, DataCategoryType, IdentifierType, LargeLanguageModelClient, LogicOperator, RequestAction, RequestDataSiloStatus, RequestEnricherStatus, RequestOrigin, RequestStatus, ScopeDefinition, ScopeName, SubDataPointDataSubCategoryGuessStatus, UnstructuredSubDataPointRecommendationStatus } from "@transcend-io/privacy-types";
3
+ import { AssessmentFormTemplateSource, AssessmentFormTemplateStatus, CodePackageType, ConsentBundleType, ConsentManagerMetricBin, ConsentTrackerStatus, DataCategoryType, IdentifierType, LargeLanguageModelClient, LogicOperator, RequestAction, RequestDataSiloStatus, RequestEnricherStatus, RequestOrigin, RequestStatus, RestartIdentifierStrategy, ScopeDefinition, ScopeName, SubDataPointDataSubCategoryGuessStatus, UnstructuredSubDataPointRecommendationStatus } from "@transcend-io/privacy-types";
4
4
  import { ObjByString, Optionalize, Requirize } from "@transcend-io/type-utils";
5
5
  import * as t from "io-ts";
6
6
  import { Agent, AgentFile, AgentFileFilterBy, ApiKey, AssessmentSection, AttributeKey, CodePackage, ConsentManagerMetric, DataSiloAttributeValue, DataSubject, LargeLanguageModel, PromptThread, ReportPromptRunInput, RequestEnricher, RequestIdentifier, RetentionSchedule, TranscendPromptTemplated, TranscendPromptsAndVariables, UserPreview } from "@transcend-io/sdk";
@@ -134198,11 +134198,11 @@ declare const CachedFileState: t.TypeC<{
134198
134198
  }>>; /** Mapping between request status in import to Transcend request status */
134199
134199
  statusToRequestStatus: t.RecordC<t.StringC, t.KeyofC<{
134200
134200
  CANCELED: unknown;
134201
- "[NONE]": unknown;
134202
134201
  FAILED_VERIFICATION: unknown;
134203
134202
  COMPLETED: unknown;
134204
134203
  SECONDARY_COMPLETED: unknown;
134205
134204
  REVOKED: unknown;
134205
+ "[NONE]": unknown;
134206
134206
  }>>;
134207
134207
  }>;
134208
134208
  /** Type override */
@@ -140109,20 +140109,20 @@ declare const PrivacyRequestResponse: t.TypeC<{
140109
140109
  status: t.KeyofC<{
140110
140110
  CANCELED: unknown;
140111
140111
  ON_HOLD: unknown;
140112
- FAILED_VERIFICATION: unknown;
140113
- COMPLETED: unknown;
140114
- SECONDARY_COMPLETED: unknown;
140115
- REVOKED: unknown;
140116
140112
  REQUEST_MADE: unknown;
140113
+ FAILED_VERIFICATION: unknown;
140117
140114
  ENRICHING: unknown;
140118
140115
  WAITING: unknown;
140119
140116
  COMPILING: unknown;
140120
140117
  APPROVING: unknown;
140121
140118
  DELAYED: unknown;
140119
+ COMPLETED: unknown;
140122
140120
  DOWNLOADABLE: unknown;
140123
140121
  VIEW_CATEGORIES: unknown;
140124
140122
  SECONDARY: unknown;
140123
+ SECONDARY_COMPLETED: unknown;
140125
140124
  SECONDARY_APPROVING: unknown;
140125
+ REVOKED: unknown;
140126
140126
  }>;
140127
140127
  type: t.KeyofC<{
140128
140128
  AUTOMATED_DECISION_MAKING_OPT_OUT: unknown;
@@ -146007,20 +146007,20 @@ declare const PrivacyRequest: t.IntersectionC<[t.TypeC<{
146007
146007
  status: t.KeyofC<{
146008
146008
  CANCELED: unknown;
146009
146009
  ON_HOLD: unknown;
146010
- FAILED_VERIFICATION: unknown;
146011
- COMPLETED: unknown;
146012
- SECONDARY_COMPLETED: unknown;
146013
- REVOKED: unknown;
146014
146010
  REQUEST_MADE: unknown;
146011
+ FAILED_VERIFICATION: unknown;
146015
146012
  ENRICHING: unknown;
146016
146013
  WAITING: unknown;
146017
146014
  COMPILING: unknown;
146018
146015
  APPROVING: unknown;
146019
146016
  DELAYED: unknown;
146017
+ COMPLETED: unknown;
146020
146018
  DOWNLOADABLE: unknown;
146021
146019
  VIEW_CATEGORIES: unknown;
146022
146020
  SECONDARY: unknown;
146021
+ SECONDARY_COMPLETED: unknown;
146023
146022
  SECONDARY_APPROVING: unknown;
146023
+ REVOKED: unknown;
146024
146024
  }>; /** Type of data subject */
146025
146025
  subjectType: t.StringC; /** Country of request */
146026
146026
  country: t.UnionC<[t.NullC, t.KeyofC<{
@@ -151871,6 +151871,7 @@ declare function bulkRestartRequests({
151871
151871
  sendEmailReceipt,
151872
151872
  emailIsVerified,
151873
151873
  copyIdentifiers,
151874
+ restartIdentifierStrategy,
151874
151875
  skipWaitingPeriod,
151875
151876
  concurrency
151876
151877
  }: {
@@ -151885,7 +151886,8 @@ declare function bulkRestartRequests({
151885
151886
  createdAt?: Date; /** Requests that have been open for this length of time should be marked as silent mode */
151886
151887
  silentModeBefore?: Date; /** Send an email receipt to the restarted requests */
151887
151888
  sendEmailReceipt?: boolean; /** Copy over all identifiers rather than restarting the request only with the core identifier */
151888
- copyIdentifiers?: boolean; /** Skip the waiting period when restarting requests */
151889
+ copyIdentifiers?: boolean; /** How request identifiers should be handled when restarting */
151890
+ restartIdentifierStrategy?: RestartIdentifierStrategy; /** Skip the waiting period when restarting requests */
151889
151891
  skipWaitingPeriod?: boolean; /** Filter for requests created before this date */
151890
151892
  createdAtBefore?: Date; /** Filter for requests created after this date */
151891
151893
  createdAtAfter?: Date; /** Filter for requests updated before this date */
@@ -151907,12 +151909,14 @@ declare function restartPrivacyRequest(sombra: Got, request: PrivacyRequest, {
151907
151909
  sendEmailReceipt,
151908
151910
  skipWaitingPeriod,
151909
151911
  emailIsVerified,
151910
- requestIdentifiers
151912
+ requestIdentifiers,
151913
+ restartIdentifierStrategy
151911
151914
  }?: {
151912
151915
  /** List of request identifiers to include */requestIdentifiers?: RequestIdentifier[]; /** When true, send an email receipt to data subject */
151913
151916
  sendEmailReceipt?: boolean; /** Whether the email is verified */
151914
151917
  emailIsVerified?: boolean; /** Whether to skip waiting period */
151915
- skipWaitingPeriod?: boolean;
151918
+ skipWaitingPeriod?: boolean; /** How request identifiers should be handled when restarting */
151919
+ restartIdentifierStrategy?: RestartIdentifierStrategy;
151916
151920
  }): Promise<PrivacyRequestResponse>;
151917
151921
  //#endregion
151918
151922
  //#region src/lib/requests/skipPreflightJobs.d.ts