@transcend-io/cli 8.31.1 → 8.32.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -0
- package/dist/bin/bash-complete.cjs +1 -1
- package/dist/bin/cli.cjs +1 -1
- package/dist/bin/deprecated-command.cjs +2 -2
- package/dist/{chunk-M7OVJJGB.cjs → chunk-22KX2NM4.cjs} +4 -4
- package/dist/{chunk-M7OVJJGB.cjs.map → chunk-22KX2NM4.cjs.map} +1 -1
- package/dist/chunk-56QKBG2R.cjs +3001 -0
- package/dist/chunk-56QKBG2R.cjs.map +1 -0
- package/dist/chunk-6TKTYQIF.cjs +3 -0
- package/dist/chunk-6TKTYQIF.cjs.map +1 -0
- package/dist/{chunk-DIB7IOEX.cjs → chunk-BPOXNSPY.cjs} +2 -2
- package/dist/{chunk-DIB7IOEX.cjs.map → chunk-BPOXNSPY.cjs.map} +1 -1
- package/dist/chunk-CM7VJEOY.cjs +4 -0
- package/dist/{chunk-SKOTYI3A.cjs.map → chunk-CM7VJEOY.cjs.map} +1 -1
- package/dist/chunk-D3VRD5F5.cjs +2 -0
- package/dist/chunk-D3VRD5F5.cjs.map +1 -0
- package/dist/{chunk-XXFLFF7Q.cjs → chunk-DQCPGPXG.cjs} +2 -2
- package/dist/{chunk-XXFLFF7Q.cjs.map → chunk-DQCPGPXG.cjs.map} +1 -1
- package/dist/{chunk-MXT7N555.cjs → chunk-DYBVUGHH.cjs} +22 -22
- package/dist/chunk-DYBVUGHH.cjs.map +1 -0
- package/dist/chunk-IHUCIK5T.cjs +2 -0
- package/dist/{chunk-Q2RJZGYW.cjs.map → chunk-IHUCIK5T.cjs.map} +1 -1
- package/dist/{chunk-7H4ALAHC.cjs → chunk-LQUVB4MI.cjs} +4 -4
- package/dist/chunk-LQUVB4MI.cjs.map +1 -0
- package/dist/chunk-P5GD5LAK.cjs +2 -0
- package/dist/chunk-P5GD5LAK.cjs.map +1 -0
- package/dist/chunk-PGO2YKRX.cjs +12 -0
- package/dist/chunk-PGO2YKRX.cjs.map +1 -0
- package/dist/{chunk-ALOB5SWZ.cjs → chunk-VCPZG4FJ.cjs} +2 -2
- package/dist/{chunk-ALOB5SWZ.cjs.map → chunk-VCPZG4FJ.cjs.map} +1 -1
- package/dist/chunk-VUQAH7YK.cjs +12 -0
- package/dist/chunk-VUQAH7YK.cjs.map +1 -0
- package/dist/{impl-VXOHC45F.cjs → impl-2JA6BPE7.cjs} +2 -2
- package/dist/{impl-VXOHC45F.cjs.map → impl-2JA6BPE7.cjs.map} +1 -1
- package/dist/{impl-PKWSORXX.cjs → impl-4AI7T6RD.cjs} +2 -2
- package/dist/{impl-PKWSORXX.cjs.map → impl-4AI7T6RD.cjs.map} +1 -1
- package/dist/impl-4LAJNPQ4.cjs +16 -0
- package/dist/impl-4LAJNPQ4.cjs.map +1 -0
- package/dist/{impl-4CWCLU5Z.cjs → impl-4YFJOKCA.cjs} +2 -2
- package/dist/{impl-4CWCLU5Z.cjs.map → impl-4YFJOKCA.cjs.map} +1 -1
- package/dist/{impl-WMI46UXI.cjs → impl-5RX3NB6C.cjs} +2 -2
- package/dist/{impl-WMI46UXI.cjs.map → impl-5RX3NB6C.cjs.map} +1 -1
- package/dist/{impl-VUAC7AYF.cjs → impl-66CDS7IN.cjs} +2 -2
- package/dist/{impl-VUAC7AYF.cjs.map → impl-66CDS7IN.cjs.map} +1 -1
- package/dist/{impl-542SIWQ2.cjs → impl-ADPBEB3N.cjs} +2 -2
- package/dist/{impl-542SIWQ2.cjs.map → impl-ADPBEB3N.cjs.map} +1 -1
- package/dist/{impl-REKQO7ZI.cjs → impl-B6DTQRYV.cjs} +2 -2
- package/dist/{impl-REKQO7ZI.cjs.map → impl-B6DTQRYV.cjs.map} +1 -1
- package/dist/impl-BHA2L6BP.cjs +2 -0
- package/dist/{impl-V3MXFXZF.cjs.map → impl-BHA2L6BP.cjs.map} +1 -1
- package/dist/impl-BLGX7DMN.cjs +6 -0
- package/dist/impl-BLGX7DMN.cjs.map +1 -0
- package/dist/{impl-XJBUIDZP.cjs → impl-DA7AASRR.cjs} +2 -2
- package/dist/{impl-XJBUIDZP.cjs.map → impl-DA7AASRR.cjs.map} +1 -1
- package/dist/{impl-OQAP7YDW.cjs → impl-EXHOBCQW.cjs} +2 -2
- package/dist/{impl-OQAP7YDW.cjs.map → impl-EXHOBCQW.cjs.map} +1 -1
- package/dist/{impl-D2HENZNO.cjs → impl-FRWZLZ2V.cjs} +2 -2
- package/dist/{impl-D2HENZNO.cjs.map → impl-FRWZLZ2V.cjs.map} +1 -1
- package/dist/impl-GA6T4SCB.cjs +2 -0
- package/dist/impl-GA6T4SCB.cjs.map +1 -0
- package/dist/{impl-RD5UOJY6.cjs → impl-GG3S2VBT.cjs} +2 -2
- package/dist/{impl-RD5UOJY6.cjs.map → impl-GG3S2VBT.cjs.map} +1 -1
- package/dist/impl-GZNNNSYW.cjs +7 -0
- package/dist/{impl-BQNXMBQ4.cjs.map → impl-GZNNNSYW.cjs.map} +1 -1
- package/dist/{impl-5VMEZB7F.cjs → impl-IOS3QLTX.cjs} +2 -2
- package/dist/{impl-5VMEZB7F.cjs.map → impl-IOS3QLTX.cjs.map} +1 -1
- package/dist/{impl-PHBUSAGS.cjs → impl-IQGUF37H.cjs} +2 -2
- package/dist/{impl-PHBUSAGS.cjs.map → impl-IQGUF37H.cjs.map} +1 -1
- package/dist/impl-IZIXOMMN.cjs +2 -0
- package/dist/impl-IZIXOMMN.cjs.map +1 -0
- package/dist/{impl-VT3C6SP4.cjs → impl-J5PWNHKL.cjs} +2 -2
- package/dist/{impl-VT3C6SP4.cjs.map → impl-J5PWNHKL.cjs.map} +1 -1
- package/dist/impl-JI6COVDW.cjs +2 -0
- package/dist/{impl-SRI65ZIC.cjs.map → impl-JI6COVDW.cjs.map} +1 -1
- package/dist/{impl-XLL66FXK.cjs → impl-JY7YM3QH.cjs} +2 -2
- package/dist/{impl-XLL66FXK.cjs.map → impl-JY7YM3QH.cjs.map} +1 -1
- package/dist/{impl-YGVW4RTA.cjs → impl-LKX6OLE2.cjs} +2 -2
- package/dist/{impl-YGVW4RTA.cjs.map → impl-LKX6OLE2.cjs.map} +1 -1
- package/dist/impl-MRC5UI22.cjs +2 -0
- package/dist/impl-MRC5UI22.cjs.map +1 -0
- package/dist/{impl-KQYINEBI.cjs → impl-NW57RBBR.cjs} +2 -2
- package/dist/{impl-KQYINEBI.cjs.map → impl-NW57RBBR.cjs.map} +1 -1
- package/dist/impl-QOCEM2K5.cjs +2 -0
- package/dist/{impl-JSXYZHX4.cjs.map → impl-QOCEM2K5.cjs.map} +1 -1
- package/dist/{impl-K2D3GTZG.cjs → impl-QPLTL2SO.cjs} +2 -2
- package/dist/{impl-K2D3GTZG.cjs.map → impl-QPLTL2SO.cjs.map} +1 -1
- package/dist/impl-R35FW4U7.cjs +9 -0
- package/dist/impl-R35FW4U7.cjs.map +1 -0
- package/dist/{impl-6ANYWCOV.cjs → impl-RMPDHVAH.cjs} +2 -2
- package/dist/{impl-6ANYWCOV.cjs.map → impl-RMPDHVAH.cjs.map} +1 -1
- package/dist/{impl-JQVCW52V.cjs → impl-S64WVKSC.cjs} +2 -2
- package/dist/{impl-JQVCW52V.cjs.map → impl-S64WVKSC.cjs.map} +1 -1
- package/dist/{impl-55GTRVMZ.cjs → impl-SE32ARTN.cjs} +2 -2
- package/dist/{impl-55GTRVMZ.cjs.map → impl-SE32ARTN.cjs.map} +1 -1
- package/dist/{impl-PWYKAVK4.cjs → impl-SSBP4ONX.cjs} +2 -2
- package/dist/{impl-PWYKAVK4.cjs.map → impl-SSBP4ONX.cjs.map} +1 -1
- package/dist/{impl-T67PUM7X.cjs → impl-UA7V6YEM.cjs} +2 -2
- package/dist/{impl-T67PUM7X.cjs.map → impl-UA7V6YEM.cjs.map} +1 -1
- package/dist/{impl-NK42TN4C.cjs → impl-WTGAAEUZ.cjs} +2 -2
- package/dist/{impl-NK42TN4C.cjs.map → impl-WTGAAEUZ.cjs.map} +1 -1
- package/dist/{impl-Q3P6DGHG.cjs → impl-WVOFYJLG.cjs} +2 -2
- package/dist/{impl-Q3P6DGHG.cjs.map → impl-WVOFYJLG.cjs.map} +1 -1
- package/dist/{impl-TCR3Y3J2.cjs → impl-X23VUODX.cjs} +2 -2
- package/dist/{impl-TCR3Y3J2.cjs.map → impl-X23VUODX.cjs.map} +1 -1
- package/dist/{impl-KRJNBGJ6.cjs → impl-XU54KM62.cjs} +2 -2
- package/dist/{impl-KRJNBGJ6.cjs.map → impl-XU54KM62.cjs.map} +1 -1
- package/dist/{impl-A7XL5O4W.cjs → impl-XYHIS7X5.cjs} +2 -2
- package/dist/{impl-A7XL5O4W.cjs.map → impl-XYHIS7X5.cjs.map} +1 -1
- package/dist/{impl-VL3CJ2OT.cjs → impl-Y3MY5EKD.cjs} +2 -2
- package/dist/{impl-VL3CJ2OT.cjs.map → impl-Y3MY5EKD.cjs.map} +1 -1
- package/dist/impl-YIPC6MAR.cjs +6 -0
- package/dist/impl-YIPC6MAR.cjs.map +1 -0
- package/dist/{impl-JFYHXSOV.cjs → impl-Z54SB7SM.cjs} +2 -2
- package/dist/{impl-JFYHXSOV.cjs.map → impl-Z54SB7SM.cjs.map} +1 -1
- package/dist/{impl-GEEPG7OH.cjs → impl-ZTEP5CYM.cjs} +2 -2
- package/dist/{impl-GEEPG7OH.cjs.map → impl-ZTEP5CYM.cjs.map} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/package.json +2 -2
- package/dist/chunk-52MA7ZLS.cjs +0 -12
- package/dist/chunk-52MA7ZLS.cjs.map +0 -1
- package/dist/chunk-55B57ZAY.cjs +0 -3001
- package/dist/chunk-55B57ZAY.cjs.map +0 -1
- package/dist/chunk-7H4ALAHC.cjs.map +0 -1
- package/dist/chunk-G522ZIHS.cjs +0 -3
- package/dist/chunk-G522ZIHS.cjs.map +0 -1
- package/dist/chunk-HCEZRZHV.cjs +0 -12
- package/dist/chunk-HCEZRZHV.cjs.map +0 -1
- package/dist/chunk-M3Y6JH6I.cjs +0 -2
- package/dist/chunk-M3Y6JH6I.cjs.map +0 -1
- package/dist/chunk-MXT7N555.cjs.map +0 -1
- package/dist/chunk-NC6VWOMN.cjs +0 -2
- package/dist/chunk-NC6VWOMN.cjs.map +0 -1
- package/dist/chunk-Q2RJZGYW.cjs +0 -2
- package/dist/chunk-SKOTYI3A.cjs +0 -4
- package/dist/impl-BQNXMBQ4.cjs +0 -7
- package/dist/impl-CFYRFABZ.cjs +0 -9
- package/dist/impl-CFYRFABZ.cjs.map +0 -1
- package/dist/impl-JSXYZHX4.cjs +0 -2
- package/dist/impl-RI3WQFOE.cjs +0 -6
- package/dist/impl-RI3WQFOE.cjs.map +0 -1
- package/dist/impl-SRI65ZIC.cjs +0 -2
- package/dist/impl-U46BMUFL.cjs +0 -2
- package/dist/impl-U46BMUFL.cjs.map +0 -1
- package/dist/impl-UVQJ7HSK.cjs +0 -6
- package/dist/impl-UVQJ7HSK.cjs.map +0 -1
- package/dist/impl-V3MXFXZF.cjs +0 -2
- package/dist/impl-ZAKPYQ32.cjs +0 -2
- package/dist/impl-ZAKPYQ32.cjs.map +0 -1
- package/dist/impl-ZTYQ3IB5.cjs +0 -2
- package/dist/impl-ZTYQ3IB5.cjs.map +0 -1
package/dist/chunk-SKOTYI3A.cjs
DELETED
|
@@ -1,4 +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 _chunkNC6VWOMNcjs = require('./chunk-NC6VWOMN.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _fs = require('fs');var _typeutils = require('@transcend-io/type-utils');var _privacytypes = require('@transcend-io/privacy-types');var M=/target ('|")(.*?)('|")/,j=/pod ('|")(.*?)('|")(, ('|")~> (.+?)('|")|)/,S={supportedFiles:["Podfile"],ignoreDirs:["Pods","Build"],scanFunction:r=>{let e=_fs.readFileSync.call(void 0, r,"utf-8"),s=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(M,"g"),matches:["quote1","name","quote2"]},e),c=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(j,"g"),matches:["quote1","name","quote2","extra","quote3","version","quote4"]},e);return s.map((i,d)=>({name:i.name,type:_privacytypes.CodePackageType.CocoaPods,softwareDevelopmentKits:c.filter(p=>p.matchIndex>i.matchIndex&&(!s[d+1]||p.matchIndex<s[d+1].matchIndex)).map(p=>({name:p.name,version:p.version}))}))}};var _path = require('path');var U=/implementation( *)('|")(.+?):(.+?):(.+?|)('|")/,W=/apply plugin: *('|")(.+?)(:(.+?)|)('|")/,Y=/implementation group:( *)('|")(.+?)('|"),( *)name:( *)('|")(.+?)('|"),( *)version:( *)('|")(.+?)('|")/,V=/applicationId( *)"(.+?)"/,_={supportedFiles:["build.gradle**"],ignoreDirs:["gradle-app.setting","gradle-wrapper.jar","gradle-wrapper.properties"],scanFunction:r=>{let e=_fs.readFileSync.call(void 0, r,"utf-8"),s=_path.dirname.call(void 0, r),c=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(U,"g"),matches:["space","quote1","name","path","version","quote2"]},e),m=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(W,"g"),matches:["quote1","name","group","version","quote2"]},e),i=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(Y,"g"),matches:["space1","quote1","group","quote2","space2","space3","quote3","name","quote4","space4","space5","quote5","version","quote6"]},e),d=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(V,"g"),matches:["space","name"]},e);if(d.length>1)throw new Error(`Expected only one applicationId per file: ${r}`);return[{name:_optionalChain([d, 'access', _2 => _2[0], 'optionalAccess', _3 => _3.name])||s.split("/").pop(),softwareDevelopmentKits:[...c,...i,...m].map(p=>({name:p.name,version:p.version||void 0}))}]}};var I={supportedFiles:["package.json"],ignoreDirs:["node_modules","serverless-build","lambda-build"],scanFunction:r=>{let e=_fs.readFileSync.call(void 0, r,"utf-8"),s=_path.dirname.call(void 0, r),c=JSON.parse(e),{name:m,description:i,dependencies:d={},devDependencies:p={},optionalDependencies:t={}}=c;return[{name:m||s.split("/").pop(),description:i,softwareDevelopmentKits:[...Object.entries(d).map(([o,a])=>({name:o,version:typeof a=="string"?a:void 0})),...Object.entries(p).map(([o,a])=>({name:o,version:typeof a=="string"?a:void 0,isDevDependency:!0})),...Object.entries(t).map(([o,a])=>({name:o,version:typeof a=="string"?a:void 0}))]}]}};var ne=/(.+?)(=+)(.+)/,te=/name *= *('|")(.+?)('|")/,oe=/description *= *('|")(.+?)('|")/,x={supportedFiles:["requirements.txt"],ignoreDirs:["build","lib","lib64"],scanFunction:r=>{let e=_fs.readFileSync.call(void 0, r,"utf-8"),s=_path.dirname.call(void 0, r),m=_chunkNC6VWOMNcjs.c.call(void 0, s).find(o=>o==="setup.py"),i=m?_fs.readFileSync.call(void 0, _path.join.call(void 0, s,m),"utf-8"):void 0,d=i?(te.exec(i)||[])[2]:void 0,p=i?(oe.exec(i)||[])[2]:void 0,t=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(ne,"g"),matches:["name","equals","version"]},e);return[{name:d||s.split("/").pop(),description:p||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:t.map(o=>({name:o.name,version:o.version}))}]}};var pe=/gem *('|")(.+?)('|")(, *('|")(.+?)('|")|)/,ae=/spec\.name *= *('|")(.+?)('|")/,ce=/spec\.description *= *('|")(.+?)('|")/,me=/spec\.summary *= *('|")(.+?)('|")/,D={supportedFiles:["Gemfile"],ignoreDirs:["bin"],scanFunction:r=>{let e=_fs.readFileSync.call(void 0, r,"utf-8"),s=_path.dirname.call(void 0, r),m=_chunkNC6VWOMNcjs.c.call(void 0, s).find(o=>o===".gemspec"),i=m?_fs.readFileSync.call(void 0, m,"utf-8"):void 0,d=i?(ae.exec(i)||[])[2]:void 0,p=i?(ce.exec(i)||me.exec(i)||[])[1]:void 0,t=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(pe,"g"),matches:["quote1","name","quote2","hasVersion","quote3","version","quote4"]},e);return[{name:d||s.split("/").pop(),description:p||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:t.map(o=>({name:o.name,version:o.version}))}]}};var _jsyaml = require('js-yaml'); var _jsyaml2 = _interopRequireDefault(_jsyaml);function ue(r){return r.split(`
|
|
2
|
-
`).map(e=>{let s=e.indexOf("#");return s>-1&&!e.substring(0,s).includes('"')&&!e.substring(0,s).includes("'")?e.substring(0,s).trim():e}).filter(e=>e.length>0).join(`
|
|
3
|
-
`)}var v={supportedFiles:["pubspec.yml"],ignoreDirs:["build"],scanFunction:r=>{let e=_path.dirname.call(void 0, r),s=_fs.readFileSync.call(void 0, r,"utf-8"),{name:c,description:m,dev_dependencies:i={},dependencies:d={}}=_jsyaml2.default.load(ue(s));return[{name:c||e.split("/").pop(),description:m,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:[...Object.entries(d).map(([p,t])=>({name:p,version:typeof t=="string"?t:typeof t=="number"?t.toString():_optionalChain([t, 'optionalAccess', _4 => _4.sdk])})),...Object.entries(i).map(([p,t])=>({name:p,version:typeof t=="string"?t:typeof t=="number"?t.toString():_optionalChain([t, 'optionalAccess', _5 => _5.sdk]),isDevDependency:!0}))]}]}};var F={supportedFiles:["composer.json"],ignoreDirs:["vendor","node_modules","cache","build","dist"],scanFunction:r=>{let e=_fs.readFileSync.call(void 0, r,"utf-8"),s=_path.dirname.call(void 0, r),c=JSON.parse(e),{name:m,description:i,require:d={},"require-dev":p={}}=c;return[{name:m||s.split("/").pop(),description:i,softwareDevelopmentKits:[...Object.entries(d).map(([t,o])=>({name:t,version:typeof o=="string"?o:void 0})),...Object.entries(p).map(([t,o])=>({name:t,version:typeof o=="string"?o:void 0,isDevDependency:!0}))]}]}};var _iots = require('io-ts'); var n = _interopRequireWildcard(_iots);var Se=n.type({pins:n.array(n.type({identity:n.string,kind:n.string,location:n.string,state:n.intersection([n.type({revision:n.string}),n.partial({version:n.union([n.string,n.undefined,n.null])})])})),version:n.number}),_e=n.type({object:n.type({pins:n.array(n.type({package:n.string,repositoryURL:n.string,state:n.intersection([n.type({branch:n.union([n.string,n.undefined,n.null]),revision:n.string}),n.partial({version:n.union([n.string,n.undefined,n.null])})])}))}),version:n.number}),A={supportedFiles:["Package.resolved"],ignoreDirs:[],scanFunction:r=>{let e=_fs.readFileSync.call(void 0, r,"utf-8");try{let s=_typeutils.decodeCodec.call(void 0, Se,e);return[{name:_path.dirname.call(void 0, r).split("/").pop()||"",type:_privacytypes.CodePackageType.Swift,softwareDevelopmentKits:s.pins.map(c=>({name:c.identity,version:c.state.version||void 0}))}]}catch(s){if(!_optionalChain([s, 'optionalAccess', _6 => _6.message, 'optionalAccess', _7 => _7.includes, 'call', _8 => _8("Failed to decode codec")]))throw s;try{let c=_typeutils.decodeCodec.call(void 0, _e,e);return[{name:_path.dirname.call(void 0, r).split("/").pop()||"",type:_privacytypes.CodePackageType.Swift,softwareDevelopmentKits:c.object.pins.map(m=>({name:m.package,version:m.state.version||void 0}))}]}catch(c){throw _optionalChain([c, 'optionalAccess', _9 => _9.message, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11("Failed to decode codec")])?s:c}}}};var P="(implementation|api|kapt|ksp|debugImplementation|releaseImplementation|androidTestImplementation|testImplementation|compileOnly|runtimeOnly)",De=new RegExp(`${P}\\s*\\(\\s*["']([^"':\\s]+):([^"':\\s]+):?([^"']*)["']\\s*\\)`,"g"),ve=new RegExp(`${P}\\s*\\(\\s*platform\\(\\s*["']([^"':\\s]+):([^"':\\s]+):?([^"']*)["']\\s*\\)\\s*\\)`,"g"),Ae=new RegExp(`${P}\\s*\\(\\s*libs(?:\\.[\\w\\-\\.]+|\\[["'][^"']+["']\\])\\s*\\)`,"g"),Pe=/id\s*\(\s*["']([^"']+)["']\s*\)(?:\s*version\s*["']([^"']+)["'])?/g,Re=/apply\s*\(\s*plugin\s*=\s*["']([^"']+)["']\s*\)/g,ke=/plugins\s*\{[^}]*alias\s*\(\s*libs(?:\.plugins)?(?:\.[\w\-.]+|\[["'][^"']+["']\])\s*\)[^}]*\}/g,Ge=/applicationId\s*=\s*["']([^"']+)["']/g,Fe=/applicationId\s*\(\s*["']([^"']+)["']\s*\)/g;function u(r,e){let s=e&&e.trim().length>0&&e!=="_"?e.trim():void 0;return{name:r,version:s}}var N={supportedFiles:["**/build.gradle.kts","**/*.gradle.kts"],ignoreDirs:["gradle-app.setting","gradle-wrapper.jar","gradle-wrapper.properties"],scanFunction:r=>{let e=_fs.readFileSync.call(void 0, r,"utf-8"),s=_path.dirname.call(void 0, r),c=[..._typeutils.findAllWithRegex.call(void 0, {value:Ge,matches:["name"]},e),..._typeutils.findAllWithRegex.call(void 0, {value:Fe,matches:["name"]},e)];if(c.length>1)throw new Error(`Expected only one applicationId per file: ${r}`);let m=_optionalChain([c, 'access', _12 => _12[0], 'optionalAccess', _13 => _13.name])||s.split("/").pop(),i=[];for(let t of e.matchAll(De)){let[,,o,a,f]=t;i.push(u(`${o}:${a}`,f))}for(let t of e.matchAll(ve)){let[,,o,a,f]=t;i.push(u(`${o}:${a}`,f))}for(let t of e.matchAll(Ae)){let o=t[0].replace(/^[^(]+\(\s*/,"").replace(/\)\s*$/,"").trim();i.push(u(o))}let d=[];for(let t of e.matchAll(Pe)){let[,o,a]=t;d.push(u(o,a))}for(let t of e.matchAll(Re)){let[,o]=t;d.push(u(o))}if(ke.test(e)){let t=e.matchAll(/alias\s*\(\s*(libs(?:\.plugins)?(?:\.[\w\-.]+|\[["'][^"']+["']\]))\s*\)/g);for(let o of t)d.push(u(o[1]))}let p=[...i,...d].reduce((t,o)=>{let a=`${o.name}@@${o.version||""}`;return t.map.has(a)||(t.map.set(a,o),t.list.push(o)),t},{map:new Map,list:[]}).list;return[{name:m,softwareDevelopmentKits:p}]}};var hn={cocoaPods:S,gradle:_,javascriptPackageJson:I,pythonRequirementsTxt:x,gemfile:D,pubspec:v,swift:A},q={[_privacytypes.CodePackageType.CocoaPods]:S,[_privacytypes.CodePackageType.Gradle]:_,[_privacytypes.CodePackageType.PackageJson]:I,[_privacytypes.CodePackageType.RequirementsTxt]:x,[_privacytypes.CodePackageType.Gemfile]:D,[_privacytypes.CodePackageType.Pubspec]:v,[_privacytypes.CodePackageType.ComposerJson]:F,[_privacytypes.CodePackageType.Swift]:A,[_privacytypes.CodePackageType.Kotlin]:N};var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function Ln({scanPath:r,ignoreDirs:e=[],repositoryName:s}){return(await Promise.all(_typeutils.getEntries.call(void 0, q).map(async([m,i])=>{let{ignoreDirs:d,supportedFiles:p,scanFunction:t}=i,o=[...e,...d].filter(a=>a.length>0);try{let a=await _fastglob2.default.call(void 0, `${r}/**/${p.join("|")}`,{ignore:o.map(l=>`${r}/**/${l}`),unique:!0,onlyFiles:!0});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Scanning: ${a.length} files of type ${m}`));let f=a.map(l=>t(l).map(K=>({...K,relativePath:l.replace(`${r}/`,"")}))).flat();return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Found: ${f.length} packages and ${f.map(({softwareDevelopmentKits:l=[]})=>l).flat().length} sdks`)),f.map(l=>({...l,type:m,repositoryName:s}))}catch(a){throw new Error(`Error scanning globs ${p} with error: ${a}`)}}))).flat()}exports.a = hn; exports.b = Ln;
|
|
4
|
-
//# sourceMappingURL=chunk-SKOTYI3A.cjs.map
|
package/dist/impl-BQNXMBQ4.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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 _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');var _chunk7PB6LVSEcjs = require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _got = require('got'); var _got2 = _interopRequireDefault(_got);var j=({hostname:t,auth:e})=>_got2.default.extend({prefixUrl:`https://${t}`,headers:{accept:"application/json","content-type":"application/json",authorization:`Bearer ${e}`}});var _yargsparser = require('yargs-parser'); var _yargsparser2 = _interopRequireDefault(_yargsparser);var ve=Object.values(_chunk7PB6LVSEcjs.b);var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);var R=({assessment:t,index:e,total:s,wrap:r=!0})=>{let n="";(e===0||r)&&(n=`[
|
|
2
|
-
`);let m=JSON.stringify(t),o=s&&e<s-1&&!r?",":"";return n=`${n+m+o}
|
|
3
|
-
`,(s&&e===s-1||r)&&(n+=`
|
|
4
|
-
]`),n};var q=({file:t,assessment:e,index:s,total:r})=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing enriched assessment ${s+1} of ${r} to file "${t}"...`)),s===0?_fs2.default.writeFileSync(t,R({assessment:e,index:s,total:r,wrap:!1})):_fs2.default.appendFileSync(t,R({assessment:e,index:s,total:r,wrap:!1}))};var _typeutils = require('@transcend-io/type-utils');var _privacytypes = require('@transcend-io/privacy-types');var J=async({oneTrust:t})=>{let e=0,s=1,r=0,n=[];for(;e<s;){let{body:m}=await t.get(`api/assessment/v2/assessments?page=${e}&size=2000`),{page:o,content:u}=_typeutils.decodeCodec.call(void 0, _privacytypes.OneTrustGetListOfAssessmentsResponse,m);n.push(..._nullishCoalesce(u, () => ([]))),e===0&&(s=_nullishCoalesce(_optionalChain([o, 'optionalAccess', _2 => _2.totalPages]), () => (0)),r=_nullishCoalesce(_optionalChain([o, 'optionalAccess', _3 => _3.totalElements]), () => (0))),e+=1,_chunkZUNVPK23cjs.a.info(`Fetched ${n.length} of ${r} assessments.`)}return n};var K=async({oneTrust:t,assessmentId:e})=>{let{body:s}=await t.get(`api/assessment/v2/assessments/${e}/export?ExcludeSkippedQuestions=false`);return _typeutils.decodeCodec.call(void 0, _privacytypes.OneTrustGetAssessmentResponse,s)};var W=async({oneTrust:t,riskId:e})=>{let{body:s}=await t.get(`api/risk/v2/risks/${e}`);return _typeutils.decodeCodec.call(void 0, _privacytypes.OneTrustGetRiskResponse,s)};var b=async({oneTrust:t,userId:e})=>{let{body:s}=await t.get(`api/scim/v2/Users/${e}`);return _typeutils.decodeCodec.call(void 0, _privacytypes.OneTrustGetUserResponse,s)};var _bluebird = require('bluebird');var H=({assessment:t,assessmentDetails:e,riskDetails:s,creatorDetails:r,approversDetails:n,respondentsDetails:m})=>{let o=_chunkXXFLFF7Qcjs.e.call(void 0, s,"id"),{sections:u,createdBy:h,...g}=e,O=u.map(i=>{let{questions:A,...$}=i,w=A.map(x=>{let{risks:U,...E}=x,G=(_nullishCoalesce(U, () => ([]))).map(y=>{let v=o[y.riskId];return{...y,...v,level:y.level,impactLevel:_nullishCoalesce(y.impactLevel, () => (0))}});return{...E,risks:G}});return{...$,questions:w}}),p={...h,active:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _4 => _4.active]), () => (!1)),userType:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _5 => _5.userType]), () => ("Internal")),emails:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _6 => _6.emails]), () => ([])),title:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _7 => _7.title]), () => (null)),givenName:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _8 => _8.name, 'access', _9 => _9.givenName]), () => (null)),familyName:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _10 => _10.name, 'access', _11 => _11.familyName]), () => (null))},d=_chunkXXFLFF7Qcjs.e.call(void 0, n,"id"),l=e.approvers.flatMap(i=>d[i.id]?[{...i,approver:{...i.approver,active:d[i.id].active,userType:d[i.id].userType,emails:d[i.id].emails,title:d[i.id].title,givenName:_nullishCoalesce(d[i.id].name.givenName, () => (null)),familyName:_nullishCoalesce(d[i.id].name.familyName, () => (null))}}]:[]),T=_chunkXXFLFF7Qcjs.e.call(void 0, m,"id"),C=e.respondents.filter(i=>!i.name.includes("@")).flatMap(i=>T[i.id]?[{...i,active:T[i.id].active,userType:T[i.id].userType,emails:T[i.id].emails,title:T[i.id].title,givenName:_nullishCoalesce(T[i.id].name.givenName, () => (null)),familyName:_nullishCoalesce(T[i.id].name.familyName, () => (null))}]:[]);return{...t,...g,approvers:l,respondents:C,createdBy:p,sections:O}};var k=async({transcend:t,assessment:e,total:s,index:r})=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing enriched assessment ${r+1} ${s?`of ${s} `:" "}to Transcend...`));let m={json:R({assessment:e,index:r,total:s})};try{await _chunk55B57ZAYcjs.ug.call(void 0, t,_chunk55B57ZAYcjs.ga,{input:m})}catch (e2){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to sync assessment ${r+1} ${s?`of ${s} `:" "}to Transcend.
|
|
5
|
-
Assessment Title: ${e.name}. Template Title: ${e.template.name}
|
|
6
|
-
`))}};var Y=async({oneTrust:t,file:e,dryRun:s,transcend:r})=>{_chunkZUNVPK23cjs.a.info("Getting list of all assessments from OneTrust...");let n=await J({oneTrust:t}),m={},o=5,u=Array.from({length:Math.ceil(n.length/o)},(h,g)=>n.slice(g*o,(g+1)*o));await _bluebird.mapSeries.call(void 0, u,async(h,g)=>{let O=[];await _bluebird.map.call(void 0, h,async(p,d)=>{let l=o*g+d+1;_chunkZUNVPK23cjs.a.info(`[assessment ${l} of ${n.length}]: fetching details...`);let{templateName:T,assessmentId:C}=p,i=await K({oneTrust:t,assessmentId:C}),A=i.createdBy.id,$=m[A];if(!$){_chunkZUNVPK23cjs.a.info(`[assessment ${l} of ${n.length}]: fetching creator...`);try{$=await b({oneTrust:t,userId:A}),m[A]=$}catch (e3){_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`[assessment ${l} of ${n.length}]: failed to fetch form creator. creatorId: ${A}. Assessment Title: ${p.name}. Template Title: ${T}`))}}let{approvers:w}=i,x=[];w.length>0&&(_chunkZUNVPK23cjs.a.info(`[assessment ${l} of ${n.length}]: fetching approvers...`),x=await _bluebird.map.call(void 0, w.map(({id:c})=>c),async c=>{try{let f=m[c];return f||(f=await b({oneTrust:t,userId:c}),m[c]=f),[f]}catch (e4){return _chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`[assessment ${l} of ${n.length}]: failed to fetch a form approver. approverId: ${c}. Assessment Title: ${p.name}. Template Title: ${T}`)),[]}},{concurrency:5}));let{respondents:U}=i,E=U.filter(c=>!c.name.includes("@")),G=[];E.length>0&&(_chunkZUNVPK23cjs.a.info(`[assessment ${l} of ${n.length}]: fetching respondents...`),G=await _bluebird.map.call(void 0, E.map(({id:c})=>c),async c=>{try{let f=m[c];return f||(f=await b({oneTrust:t,userId:c}),m[c]=f),[f]}catch (e5){return _chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`[assessment ${l} of ${n.length}]: failed to fetch a respondent. respondentId: ${c}. Assessment Title: ${p.name}. Template Title: ${T}`)),[]}},{concurrency:5}));let y=[],v=_chunkXXFLFF7Qcjs.j.call(void 0, i.sections.flatMap(c=>c.questions.flatMap(f=>(_nullishCoalesce(f.risks, () => ([]))).flatMap(ee=>ee.riskId))));v.length>0&&(_chunkZUNVPK23cjs.a.info(`[assessment ${l} of ${n.length}]: fetching risks...`),y=await _bluebird.map.call(void 0, v,c=>W({oneTrust:t,riskId:c}),{concurrency:5}));let X=H({assessment:p,assessmentDetails:i,riskDetails:y,creatorDetails:$,approversDetails:x.flat(),respondentsDetails:G.flat()});O.push(X)},{concurrency:o}),await _bluebird.mapSeries.call(void 0, O,async(p,d)=>{let l=g*o+d;s&&e?q({assessment:p,index:l,total:n.length,file:e}):r&&await k({assessment:p,transcend:r,total:n.length,index:l})})})};var _JSONStream = require('JSONStream'); var _JSONStream2 = _interopRequireDefault(_JSONStream);var Z=({transcend:t,file:e})=>(_chunkZUNVPK23cjs.a.info(`Getting list of all assessments from file ${e}...`),new Promise((s,r)=>{let n=_fs.createReadStream.call(void 0, e,{encoding:"utf-8",highWaterMark:65536}),m=_JSONStream2.default.parse("*"),o=0;n.pipe(m),m.on("data",async u=>{try{m.pause();let h=_typeutils.decodeCodec.call(void 0, _privacytypes.OneTrustEnrichedAssessment,u);await k({assessment:h,transcend:t,index:o}),o+=1,m.resume()}catch(h){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to parse the assessment ${o} from file '${e}': ${h.message}.`))}}),m.on("end",()=>{_chunkZUNVPK23cjs.a.info(`Finished processing ${o} assessments from file ${e}`),s()}),m.on("error",u=>{_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Error parsing file '${e}': ${u.message}`)),r(u)}),n.on("error",u=>{_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Error reading file '${e}': ${u.message}`)),r(u)})}));async function Ds({hostname:t,oneTrustAuth:e,source:s,transcendAuth:r,transcendUrl:n,resource:m,file:o,dryRun:u,debug:h}){if(!u&&!r)throw new Error('Must specify a "transcendAuth" parameter to sync resources to Transcend. e.g. --transcendAuth=${TRANSCEND_API_KEY}');if(u&&!o)throw new Error('Must set a "file" parameter when "dryRun" is "true". e.g. --file=./oneTrustAssessments.json');if(o){let p=o.split(".");if(p.length<2)throw new Error('The "file" parameter has an invalid format. Expected a path with extensions. e.g. --file=./pathToFile.json.');if(p.at(-1)!=="json")throw new Error(`Expected the format of the "file" parameters '${o}' to be 'json', but got '${p.at(-1)}'.`)}if(s==="oneTrust"){if(!t)throw new Error('Missing required parameter "hostname". e.g. --hostname=customer.my.onetrust.com');if(!e)throw new Error('Missing required parameter "oneTrustAuth". e.g. --oneTrustAuth=$ONE_TRUST_AUTH_TOKEN')}else{if(!o)throw new Error('Must specify a "file" parameter to read the OneTrust assessments from. e.g. --source=./oneTrustAssessments.json');if(u)throw new Error('Cannot read and write to a file simultaneously. Emit the "source" parameter or set it to oneTrust if "dryRun" is enabled.')}_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let g=t&&e?j({hostname:t,auth:e}):void 0,O=n&&r?_chunk55B57ZAYcjs.xc.call(void 0, n,r):void 0;try{m==="assessments"&&(s==="oneTrust"&&g?await Y({oneTrust:g,file:o,dryRun:u,...O&&{transcend:O}}):s==="file"&&o&&O&&await Z({file:o,transcend:O}))}catch(p){throw new Error(`An error occurred syncing the resource ${m} from OneTrust: ${h?p.stack:p.message}`)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced OneTrust ${m} to ${u?`disk at "${o}"`:"Transcend"}!`))}exports.syncOt = Ds;
|
|
7
|
-
//# sourceMappingURL=impl-BQNXMBQ4.cjs.map
|
package/dist/impl-CFYRFABZ.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk52MA7ZLScjs = require('./chunk-52MA7ZLS.cjs');require('./chunk-M3Y6JH6I.cjs');var _chunkNC6VWOMNcjs = require('./chunk-NC6VWOMN.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _bluebird = require('bluebird');var _path = require('path');var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);async function X({auth:E,start:C,end:f,folder:r,bin:p,transcendUrl:N}){let l=p;Object.values(_chunk55B57ZAYcjs.Tc).includes(l)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to parse argument "bin" with value "${p}"
|
|
2
|
-
Expected one of:
|
|
3
|
-
${Object.values(_chunk55B57ZAYcjs.Tc).join(`
|
|
4
|
-
`)}`)),this.process.exit(1));let i=new Date(C),o=f?new Date(f):new Date;Number.isNaN(i.getTime())&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Start date provided is invalid date. Got --start="${C}" expected --start="01/01/2023"`)),this.process.exit(1)),Number.isNaN(o.getTime())&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`End date provided is invalid date. Got --end="${f}" expected --end="01/01/2023"`)),this.process.exit(1)),i>o&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Got a start date "${i.toISOString()}" that was larger than the end date "${o.toISOString()}". Start date must be before end date.`)),this.process.exit(1)),_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let m=await _chunkNC6VWOMNcjs.b.call(void 0, E);if(_fs2.default.existsSync(r)&&!_fs2.default.lstatSync(r).isDirectory()&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red('The provided argument "folder" was passed a file. expected: folder="./consent-metrics/"')),this.process.exit(1)),_fs.existsSync.call(void 0, r)||_fs.mkdirSync.call(void 0, r),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling consent metrics from start=${i.toString()} to end=${o.toISOString()} with bin size "${p}"`)),typeof m=="string"){try{let n=_chunk55B57ZAYcjs.xc.call(void 0, N,m),s=await _chunk52MA7ZLScjs.d.call(void 0, n,{bin:l,start:i,end:o});await _bluebird.map.call(void 0, Object.entries(s),async([g,c])=>{await _bluebird.map.call(void 0, c,async({points:u,name:d})=>{let a=_path.join.call(void 0, r,`${g}_${d}.csv`);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing configuration to file "${a}"...`)),await _chunk55B57ZAYcjs.rg.call(void 0, a,u.map(({key:h,value:$})=>({timestamp:h,value:$})))},{concurrency:5})},{concurrency:5})}catch(n){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error occurred syncing the schema: ${n.message}`)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced consent metrics to disk in folder "${r}"! View at ${_chunkXXFLFF7Qcjs.p}`))}else{let n=[];await _bluebird.mapSeries.call(void 0, m,async(s,g)=>{let c=`[${g+1}/${m.length}][${s.organizationName}] `;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`~~~
|
|
5
|
-
|
|
6
|
-
${c}Attempting to pull consent metrics...
|
|
7
|
-
|
|
8
|
-
~~~`));let u=_chunk55B57ZAYcjs.xc.call(void 0, N,s.apiKey);try{let d=await _chunk52MA7ZLScjs.d.call(void 0, u,{bin:l,start:i,end:o}),a=_path.join.call(void 0, r,s.organizationName);_fs.existsSync.call(void 0, a)||_fs.mkdirSync.call(void 0, a),Object.entries(d).forEach(([h,$])=>{$.forEach(({points:F,name:G})=>{let D=_path.join.call(void 0, a,`${h}_${G}.csv`);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing configuration to file "${D}"...`)),_chunk55B57ZAYcjs.rg.call(void 0, D,F.map(({key:z,value:L})=>({timestamp:z,value:L})))})}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`${c}Successfully pulled configuration!`))}catch (e2){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${c}Failed to sync configuration.`)),n.push(s.organizationName)}}),n.length>0&&(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors for "${n.join(",")}". View output above for more information, or check out ${_chunkXXFLFF7Qcjs.p}`)),this.process.exit(1))}}exports.pullConsentMetrics = X;
|
|
9
|
-
//# sourceMappingURL=impl-CFYRFABZ.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-CFYRFABZ.cjs","../src/commands/consent/pull-consent-metrics/impl.ts"],"names":["pullConsentMetrics","auth","start","end","folder","bin","transcendUrl","parsedBin","ConsentManagerMetricBin","logger","colors"],"mappings":"AAAA,iOAAwC,gCAA6B,wDAAyC,gCAA6B,wDAAyC,wDAA0D,gCAA6B,wDAAyC,wDAAyC,gCAA6B,gFCEvW,oCACY,4BACV,gEACqB,MAoB1C,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,GAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,GAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CAEf,IAAMC,CAAAA,CAAYF,CAAAA,CACb,MAAA,CAAO,MAAA,CAAOG,oBAAuB,CAAA,CAAE,QAAA,CAASD,CAAS,CAAA,EAAA,CAC5DE,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,2CAAA,EAA8CL,CAAG,CAAA;AAAA;AAAA,EACzB,MAAA,CAAO,MAAA,CAAOG,oBAAuB,CAAA,CAAE,IAAA,CAC3D,CAAA;AAAA,CACF,CAAC,CAAA,CAAA;AAyHD;AAAgB;AAAA;AAAA,GAAA","file":"/home/runner/work/cli/cli/dist/impl-CFYRFABZ.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { map, mapSeries } from 'bluebird';\nimport { join } from 'node:path';\nimport fs, { existsSync, mkdirSync } from 'node:fs';\nimport {\n buildTranscendGraphQLClient,\n ConsentManagerMetricBin,\n} from '../../../lib/graphql';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { pullConsentManagerMetrics } from '../../../lib/consent-manager';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { writeCsv } from '../../../lib/helpers';\n\nexport interface PullConsentMetricsCommandFlags {\n auth: string;\n start: Date;\n end?: Date;\n folder: string;\n bin: string;\n transcendUrl: string;\n}\n\nexport async function pullConsentMetrics(\n this: LocalContext,\n {\n auth,\n start,\n end,\n folder,\n bin,\n transcendUrl,\n }: PullConsentMetricsCommandFlags,\n): Promise<void> {\n // Validate bin\n const parsedBin = bin as ConsentManagerMetricBin;\n if (!Object.values(ConsentManagerMetricBin).includes(parsedBin)) {\n logger.error(\n colors.red(\n `Failed to parse argument \"bin\" with value \"${bin}\"\\n` +\n `Expected one of: \\n${Object.values(ConsentManagerMetricBin).join(\n '\\n',\n )}`,\n ),\n );\n this.process.exit(1);\n }\n\n // Parse the dates\n const startDate = new Date(start);\n const endDate = end ? new Date(end) : new Date();\n if (Number.isNaN(startDate.getTime())) {\n logger.error(\n colors.red(\n `Start date provided is invalid date. Got --start=\"${start}\" expected --start=\"01/01/2023\"`,\n ),\n );\n this.process.exit(1);\n }\n if (Number.isNaN(endDate.getTime())) {\n logger.error(\n colors.red(\n `End date provided is invalid date. Got --end=\"${end}\" expected --end=\"01/01/2023\"`,\n ),\n );\n this.process.exit(1);\n }\n if (startDate > endDate) {\n logger.error(\n colors.red(\n `Got a start date \"${startDate.toISOString()}\" that was larger than the end date \"${endDate.toISOString()}\". ` +\n 'Start date must be before end date.',\n ),\n );\n this.process.exit(1);\n }\n\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 // Ensure folder either does not exist or is not a file\n if (fs.existsSync(folder) && !fs.lstatSync(folder).isDirectory()) {\n logger.error(\n colors.red(\n 'The provided argument \"folder\" was passed a file. expected: folder=\"./consent-metrics/\"',\n ),\n );\n this.process.exit(1);\n }\n\n // Create the folder if it does not exist\n if (!existsSync(folder)) {\n mkdirSync(folder);\n }\n\n logger.info(\n colors.magenta(\n `Pulling consent metrics from start=${startDate.toString()} to end=${endDate.toISOString()} with bin size \"${bin}\"`,\n ),\n );\n\n // Sync to Disk\n if (typeof apiKeyOrList === 'string') {\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKeyOrList);\n\n // Pull the metrics\n const configuration = await pullConsentManagerMetrics(client, {\n bin: parsedBin,\n start: startDate,\n end: endDate,\n });\n\n // Write to file\n await map(\n Object.entries(configuration),\n async ([metricName, metrics]) => {\n await map(\n metrics,\n async ({ points, name }) => {\n const file = join(folder, `${metricName}_${name}.csv`);\n logger.info(\n colors.magenta(`Writing configuration to file \"${file}\"...`),\n );\n await writeCsv(\n file,\n points.map(({ key, value }) => ({\n timestamp: key,\n value,\n })),\n );\n },\n {\n concurrency: 5,\n },\n );\n },\n { concurrency: 5 },\n );\n } catch (err) {\n logger.error(\n colors.red(`An error occurred syncing the schema: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced consent metrics to disk in folder \"${folder}\"! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n } else {\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to pull consent metrics...\\n\\n~~~`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n try {\n const configuration = await pullConsentManagerMetrics(client, {\n bin: parsedBin,\n start: startDate,\n end: endDate,\n });\n\n // ensure folder exists for that organization\n const subFolder = join(folder, apiKey.organizationName);\n if (!existsSync(subFolder)) {\n mkdirSync(subFolder);\n }\n\n // Write to file\n Object.entries(configuration).forEach(([metricName, metrics]) => {\n metrics.forEach(({ points, name }) => {\n const file = join(subFolder, `${metricName}_${name}.csv`);\n logger.info(\n colors.magenta(`Writing configuration to file \"${file}\"...`),\n );\n writeCsv(\n file,\n points.map(({ key, value }) => ({\n timestamp: key,\n value,\n })),\n );\n });\n });\n\n logger.info(\n colors.green(`${prefix}Successfully pulled configuration!`),\n );\n } catch (err) {\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"]}
|
package/dist/impl-JSXYZHX4.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk52MA7ZLScjs = require('./chunk-52MA7ZLS.cjs');require('./chunk-M3Y6JH6I.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');async function m({auth:r,trackerStatus:s,file:a,transcendUrl:e}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk52MA7ZLScjs.c.call(void 0, {auth:r,trackerStatus:s,file:a,transcendUrl:e})}exports.uploadCookiesFromCsv = m;
|
|
2
|
-
//# sourceMappingURL=impl-JSXYZHX4.cjs.map
|
package/dist/impl-RI3WQFOE.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkJH5HRI6Dcjs = require('./chunk-JH5HRI6D.cjs');var _chunkNC6VWOMNcjs = require('./chunk-NC6VWOMN.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _bluebird = require('bluebird');var _fs = require('fs');var _path = require('path');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function I({transcendUrl:i,auth:c,pageSize:h,publishToPrivacyCenter:y,contents:l,deleteExtraAttributeValues:m=!1,classifyService:f=!1}){let u=_chunk55B57ZAYcjs.xc.call(void 0, i,c);try{return!await _chunk55B57ZAYcjs.xg.call(void 0, l,u,{pageSize:h,publishToPrivacyCenter:y,classifyService:f,deleteExtraAttributeValues:m})}catch(o){return _chunkZUNVPK23cjs.a.error(_colors2.default.red(`An unexpected error occurred syncing the schema: ${o.message}`)),!1}}async function U({file:i="./transcend.yml",transcendUrl:c,auth:h,variables:y,pageSize:l,publishToPrivacyCenter:m,classifyService:f,deleteExtraAttributeValues:u}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let o=await _chunkNC6VWOMNcjs.b.call(void 0, h),N=_chunk55B57ZAYcjs.Wf.call(void 0, y),p;if(Array.isArray(o)&&_fs.lstatSync.call(void 0, i).isDirectory()?p=_chunkNC6VWOMNcjs.c.call(void 0, i).map(e=>_path.join.call(void 0, i,e)):p=i.split(","),p.length<1)throw new Error("No file specified!");let s=p.map(e=>{_fs.existsSync.call(void 0, e)?_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading file "${e}"...`)):(_chunkZUNVPK23cjs.a.error(_colors2.default.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=_chunkJH5HRI6Dcjs.d.call(void 0, e,N);return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully read in "${e}"`)),{content:r,name:e.split("/").pop().replace(".yml","")}}catch(r){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`The shape of your yaml file is invalid with the following errors: ${r.message}`)),this.process.exit(1)}});if(typeof o=="string"){let[e,...r]=s.map(({content:d})=>d),$=_chunkIBTP5OXEcjs.a.call(void 0, e,...r);await I({transcendUrl:c,auth:o,contents:$,publishToPrivacyCenter:m,deleteExtraAttributeValues:u,pageSize:l,classifyService:!!f})||(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors. View output above for more information, or check out ${_chunkXXFLFF7Qcjs.p}`)),this.process.exit(1))}else{if(s.length!==1&&s.length!==o.length)throw new Error(`Expected list of yml files to be equal to the list of API keys.Got ${s.length} YML file${s.length===1?"":"s"} and ${o.length} API key${o.length===1?"":"s"}`);let e=[];await _bluebird.mapSeries.call(void 0, o,async(r,$)=>{let a=`[${$+1}/${o.length}][${r.organizationName}] `;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`~~~
|
|
2
|
-
|
|
3
|
-
${a}Attempting to push configuration...
|
|
4
|
-
|
|
5
|
-
~~~`));let d=s.length===1?s[0].content:_optionalChain([s, 'access', _ => _.find, 'call', _2 => _2(E=>E.name===r.organizationName), 'optionalAccess', _3 => _3.content]);if(!d){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${a}Failed to find transcend.yml file for organization: "${r.organizationName}".`)),e.push(r.organizationName);return}await I({transcendUrl:c,auth:r.apiKey,contents:d,pageSize:l,publishToPrivacyCenter:m,deleteExtraAttributeValues:u,classifyService:f})?_chunkZUNVPK23cjs.a.info(_colors2.default.green(`${a}Successfully pushed configuration!`)):(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${a}Failed to sync configuration.`)),e.push(r.organizationName))}),e.length>0&&(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors for "${e.join(",")}". View output above for more information, or check out ${_chunkXXFLFF7Qcjs.p}`)),this.process.exit(1))}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced yaml file to Transcend! View at ${_chunkXXFLFF7Qcjs.p}`))}exports.push = U;
|
|
6
|
-
//# sourceMappingURL=impl-RI3WQFOE.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-RI3WQFOE.cjs","../src/commands/inventory/push/impl.ts"],"names":["syncConfiguration","transcendUrl","auth","pageSize","publishToPrivacyCenter","contents","deleteExtraAttributeValues","classifyService","client","buildTranscendGraphQLClient","syncConfigurationToTranscend","err","logger","colors"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAgD,gCAA6B,wDAAyC,wDAA0D,gCAA6B,wDAAyC,wDAAyC,gCAA6B,oCCGnX,wBACY,4BACjB,gFAEF,MAmBnB,SAAeA,CAAAA,CAAkB,CAC/B,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,0BAAA,CAAAC,CAAAA,CAA6B,CAAA,CAAA,CAC7B,eAAA,CAAAC,CAAAA,CAAkB,CAAA,CACpB,CAAA,CAeqB,CACnB,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BR,CAAcC,CAAI,CAAA,CAG7D,GAAI,CAWF,MAAO,CAVkB,MAAMQ,kCAAAA,CAC7BL,CACAG,CAAAA,CACA,CACE,QAAA,CAAAL,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAG,CAAAA,CACA,0BAAA,CAAAD,CACF,CACF,CAEF,CAAA,KAAA,CAASK,CAAAA,CAAK,CACZ,OAAAC,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,iDAAA,EAAoDF,CAAAA,CAAI,OAAO,CAAA,CAAA;AAsI7D;AAAgB;AAAA;AA8D1B,GAAA","file":"/home/runner/work/cli/cli/dist/impl-RI3WQFOE.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { logger } from '../../../logger';\nimport { mapSeries } from 'bluebird';\nimport { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { readTranscendYaml } from '../../../lib/readTranscendYaml';\nimport colors from 'colors';\nimport {\n buildTranscendGraphQLClient,\n syncConfigurationToTranscend,\n} from '../../../lib/graphql';\n\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { TranscendInput } from '../../../codecs';\nimport { validateTranscendAuth, listFiles } from '../../../lib/api-keys';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\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(\n contents,\n client,\n {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n },\n );\n return !encounteredError;\n } catch (err) {\n logger.error(\n colors.red(\n `An unexpected error occurred syncing the schema: ${err.message}`,\n ),\n );\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 (\n transcendInputs.length !== 1 &&\n transcendInputs.length !== apiKeyOrList.length\n ) {\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${\n apiKeyOrList.length === 1 ? '' : 's'\n }`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`,\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(\n (input) => input.name === apiKey.organizationName,\n )?.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(\n colors.green(`${prefix}Successfully pushed configuration!`),\n );\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(\n `Successfully synced yaml file to Transcend! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n}\n"]}
|
package/dist/impl-SRI65ZIC.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkG522ZIHScjs = require('./chunk-G522ZIHS.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');async function u({auth:r,transcendUrl:i,file:e,enricherId:o,concurrency:s,markSilent:a,sombraAuth:m}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkG522ZIHScjs.d.call(void 0, {file:e,transcendUrl:i,enricherId:o,concurrency:s,markSilent:a,auth:r,sombraAuth:m})}exports.pushIdentifiers = u;
|
|
2
|
-
//# sourceMappingURL=impl-SRI65ZIC.cjs.map
|
package/dist/impl-U46BMUFL.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkHCEZRZHVcjs = require('./chunk-HCEZRZHV.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _fs = require('fs');var _bluebird = require('bluebird');var _path = require('path');async function A({auth:g,partition:l,sombraAuth:h,transcendUrl:u,file:s="",directory:o,dryRun:b,skipExistingRecordCheck:a,receiptFileDir:v,skipWorkflowTriggers:x,forceTriggerWorkflows:y,skipConflictUpdates:F,isSilent:C,attributes:P,concurrency:$}){o&&s&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Cannot provide both a directory and a file. Please provide only one.")),this.process.exit(1)),!s&&!o&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences")),this.process.exit(1)),_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let t=[];if(o)try{let n=_fs.readdirSync.call(void 0, o).filter(c=>c.endsWith(".csv"));n.length===0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`No CSV files found in directory: ${o}`)),this.process.exit(1)),t.push(...n.map(c=>_path.join.call(void 0, o,c)))}catch(i){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to read directory: ${o}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(i.message)),this.process.exit(1)}else try{s.endsWith(".csv")||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("File must be a CSV file")),this.process.exit(1)),t.push(s)}catch(i){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to access file: ${s}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(i.message)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Processing ${t.length} consent preferences files for partition: ${l}`)),_chunkZUNVPK23cjs.a.debug(`Files to process: ${t.join(", ")}`),a&&_chunkZUNVPK23cjs.a.info(_colors2.default.bgYellow(`Skipping existing record check: ${a}`)),await _bluebird.map.call(void 0, t,async i=>{let n=_path.basename.call(void 0, i).replace(".csv","");await _chunkHCEZRZHVcjs.a.call(void 0, {receiptFilepath:_path.join.call(void 0, v,`${n}-receipts.json`),auth:g,sombraAuth:h,file:i,partition:l,transcendUrl:u,skipConflictUpdates:F,skipWorkflowTriggers:x,skipExistingRecordCheck:a,isSilent:C,dryRun:b,attributes:_chunk55B57ZAYcjs.pc.call(void 0, P),forceTriggerWorkflows:y})},{concurrency:$})}exports.uploadPreferences = A;
|
|
2
|
-
//# sourceMappingURL=impl-U46BMUFL.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-U46BMUFL.cjs","../src/commands/consent/upload-preferences/impl.ts"],"names":["uploadPreferences","auth","partition","sombraAuth","transcendUrl","file","directory","dryRun","skipExistingRecordCheck","receiptFileDir","skipWorkflowTriggers","forceTriggerWorkflows","skipConflictUpdates","isSilent","attributes","concurrency","logger","colors","doneInputValidation","files","csvFiles","readdirSync"],"mappings":"AAAA,iOAAwC,wDAAyC,wDAA0C,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gFCCxO,wBAKS,oCACR,4BACW,MAsB/B,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CAAO,EAAA,CACP,SAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,qBAAA,CAAAC,CAAAA,CACA,mBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACTT,CAAAA,EAAeD,CAAAA,EAAAA,CACnBW,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,sEACF,CACF,CAAA,CACA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGjB,CAACZ,CAAAA,EAAQ,CAACC,CAAAA,EAAAA,CACZU,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,sHACF,CACF,CAAA,CACA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGrBC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,IAAMC,CAAAA,CAAkB,CAAC,CAAA,CAEzB,EAAA,CAAIb,CAAAA,CACF,GAAI,CAEF,IAAMc,CAAAA,CADmBC,6BAAAA,CAAqB,CAAA,CACZ,MAAA,CAAQhB,CAAAA,EAASA,CAAAA,CAAK,QAAA,CAAS,MAAM,CAAC,CAAA,CAEpEe,CAAAA,CAAS,MAAA,GAAW,CAAA,EAAA,CACtBJ,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CAAI,CAAA,iCAAA,EAAoCX,CAAS,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/impl-U46BMUFL.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\n\nimport { logger } from '../../../logger';\nimport { uploadPreferenceManagementPreferencesInteractive } from '../../../lib/preference-management';\nimport { splitCsvToList } from '../../../lib/requests';\nimport { readdirSync } from 'node:fs';\nimport { map } from 'bluebird';\nimport { basename, join } from 'node:path';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n transcendUrl: string;\n file?: string;\n directory?: string;\n dryRun: boolean;\n skipExistingRecordCheck: boolean;\n receiptFileDir: string;\n skipWorkflowTriggers: boolean;\n forceTriggerWorkflows: boolean;\n skipConflictUpdates: boolean;\n isSilent: boolean;\n attributes: string;\n receiptFilepath: string;\n concurrency: number;\n}\n\nexport async function uploadPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n transcendUrl,\n file = '',\n directory,\n dryRun,\n skipExistingRecordCheck,\n receiptFileDir,\n skipWorkflowTriggers,\n forceTriggerWorkflows,\n skipConflictUpdates,\n isSilent,\n attributes,\n concurrency,\n }: UploadPreferencesCommandFlags,\n): Promise<void> {\n if (!!directory && !!file) {\n logger.error(\n colors.red(\n 'Cannot provide both a directory and a file. Please provide only one.',\n ),\n );\n this.process.exit(1);\n }\n\n if (!file && !directory) {\n logger.error(\n colors.red(\n 'A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences',\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process.exit);\n\n const files: string[] = [];\n\n if (directory) {\n try {\n const filesInDirectory = readdirSync(directory);\n const csvFiles = filesInDirectory.filter((file) => file.endsWith('.csv'));\n\n if (csvFiles.length === 0) {\n logger.error(\n colors.red(`No CSV files found in directory: ${directory}`),\n );\n this.process.exit(1);\n }\n\n // Add full paths for each CSV file\n files.push(...csvFiles.map((file) => join(directory, file)));\n } catch (err) {\n logger.error(colors.red(`Failed to read directory: ${directory}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n } else {\n try {\n // Verify file exists and is a CSV\n if (!file.endsWith('.csv')) {\n logger.error(colors.red('File must be a CSV file'));\n this.process.exit(1);\n }\n files.push(file);\n } catch (err) {\n logger.error(colors.red(`Failed to access file: ${file}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n }\n\n logger.info(\n colors.green(\n `Processing ${files.length} consent preferences files for partition: ${partition}`,\n ),\n );\n logger.debug(`Files to process: ${files.join(', ')}`);\n\n if (skipExistingRecordCheck) {\n logger.info(\n colors.bgYellow(\n `Skipping existing record check: ${skipExistingRecordCheck}`,\n ),\n );\n }\n\n await map(\n files,\n async (filePath) => {\n const fileName = basename(filePath).replace('.csv', '');\n await uploadPreferenceManagementPreferencesInteractive({\n receiptFilepath: join(receiptFileDir, `${fileName}-receipts.json`),\n auth,\n sombraAuth,\n file: filePath,\n partition,\n transcendUrl,\n skipConflictUpdates,\n skipWorkflowTriggers,\n skipExistingRecordCheck,\n isSilent,\n dryRun,\n attributes: splitCsvToList(attributes),\n forceTriggerWorkflows,\n });\n },\n { concurrency },\n );\n}\n"]}
|
package/dist/impl-UVQJ7HSK.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkJH5HRI6Dcjs = require('./chunk-JH5HRI6D.cjs');var _chunkDIB7IOEXcjs = require('./chunk-DIB7IOEX.cjs');var _chunkNC6VWOMNcjs = require('./chunk-NC6VWOMN.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');var _chunk7PB6LVSEcjs = require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _bluebird = require('bluebird');var _path = require('path');var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);async function Y({auth:b,resources:g=_chunkDIB7IOEXcjs.i,file:e,transcendUrl:p,dataSiloIds:d=[],integrationNames:T=[],trackerStatuses:h=_chunkDIB7IOEXcjs.j,pageSize:y,skipDatapoints:S,skipSubDatapoints:$,includeGuessedCategories:A,debug:s}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let i=await _chunkNC6VWOMNcjs.b.call(void 0, b),C=g.includes("all")?Object.values(_chunk7PB6LVSEcjs.d):g;if(typeof i=="string"){try{let r=_chunk55B57ZAYcjs.xc.call(void 0, p,i),t=await _chunk55B57ZAYcjs.ie.call(void 0, r,{dataSiloIds:d,integrationNames:T,resources:C,pageSize:y,debug:s,skipDatapoints:S,skipSubDatapoints:$,includeGuessedCategories:A,trackerStatuses:h});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing configuration to file "${e}"...`)),_chunkJH5HRI6Dcjs.e.call(void 0, e,t)}catch(r){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error occurred syncing the schema: ${s?r.stack:r.message}`)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced yaml file to disk at ${e}! View at ${_chunkXXFLFF7Qcjs.p}`))}else{if(!_fs2.default.lstatSync(e).isDirectory())throw new Error("File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/");let r=[];await _bluebird.mapSeries.call(void 0, i,async(t,L)=>{let a=`[${L+1}/${i.length}][${t.organizationName}] `;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`~~~
|
|
2
|
-
|
|
3
|
-
${a}Attempting to pull configuration...
|
|
4
|
-
|
|
5
|
-
~~~`));let _=_chunk55B57ZAYcjs.xc.call(void 0, p,t.apiKey);try{let c=await _chunk55B57ZAYcjs.ie.call(void 0, _,{dataSiloIds:d,integrationNames:T,resources:C,pageSize:y,debug:s,skipDatapoints:S,skipSubDatapoints:$,includeGuessedCategories:A,trackerStatuses:h}),w=_path.join.call(void 0, e,`${t.organizationName}.yml`);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing configuration to file "${w}"...`)),_chunkJH5HRI6Dcjs.e.call(void 0, w,c),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`${a}Successfully pulled configuration!`))}catch(c){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${a}Failed to sync configuration. - ${c.message}`)),r.push(t.organizationName)}}),r.length>0&&(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors for "${r.join(",")}". View output above for more information, or check out ${_chunkXXFLFF7Qcjs.p}`)),this.process.exit(1))}}exports.pull = Y;
|
|
6
|
-
//# sourceMappingURL=impl-UVQJ7HSK.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-UVQJ7HSK.cjs","../src/commands/inventory/pull/impl.ts"],"names":["pull","auth","resources","DEFAULT_TRANSCEND_PULL_RESOURCES","file","transcendUrl","dataSiloIds","integrationNames","trackerStatuses","DEFAULT_CONSENT_TRACKER_STATUSES","pageSize","skipDatapoints","skipSubDatapoints","includeGuessedCategories","debug","doneInputValidation","apiKeyOrList","validateTranscendAuth","resourcesToPull","TranscendPullResource","client","buildTranscendGraphQLClient","configuration","pullTranscendConfiguration","logger","colors","writeTranscendYaml","err"],"mappings":"AAAA,iOAAwC,wDAAgD,wDAAyC,gCAA6B,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAyC,wDAAyC,gFCS9X,oCACO,4BACL,gEACN,MA0Bf,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAYC,mBAAAA,CACZ,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,CAAC,CAAA,CACf,gBAAA,CAAAC,CAAAA,CAAmB,CAAC,CAAA,CACpB,eAAA,CAAAC,CAAAA,CAAkBC,mBAAAA,CAClB,QAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAMC,CAAAA,CAAe,MAAMC,iCAAAA,CAA0B,CAAA,CAE/CC,CAAAA,CAA2ChB,CAAAA,CAAU,QAAA,CAAS,KAAK,CAAA,CACrE,MAAA,CAAO,MAAA,CAAOiB,mBAAqB,CAAA,CAClCjB,CAAAA,CAGL,EAAA,CAAI,OAAOc,CAAAA,EAAiB,QAAA,CAAU,CACpC,GAAI,CAEF,IAAMI,CAAAA,CAASC,kCAAAA,CAA4BhB,CAAcW,CAAY,CAAA,CAE/DM,CAAAA,CAAgB,MAAMC,kCAAAA,CAA2BH,CAAQ,CAC7D,WAAA,CAAAd,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,SAAA,CAAWW,CAAAA,CACX,QAAA,CAAAR,CAAAA,CACA,KAAA,CAAAI,CAAAA,CACA,cAAA,CAAAH,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAL,CACF,CAAC,CAAA,CAEDgB,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,CAAA,+BAAA,EAAkCrB,CAAI,CAAA,IAAA,CAAM,CAAC,CAAA,CACxEsB,iCAAAA,CAAmBtB,CAAMkB,CAAa,CACxC,CAAA,KAAA,CAASK,CAAAA,CAAK,CACZH,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,sCAAA,EACEX,CAAAA,CAAQa,CAAAA,CAAI,KAAA,CAAQA,CAAAA,CAAI,OAC1B,CAAA,CAAA;AA0BA;AAAgB;AAAA;AAiD1B,GAAA","file":"/home/runner/work/cli/cli/dist/impl-UVQJ7HSK.cjs","sourcesContent":[null,"import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport type { LocalContext } from '../../../context';\nimport { TranscendPullResource } from '../../../enums';\nimport {\n DEFAULT_CONSENT_TRACKER_STATUSES,\n DEFAULT_TRANSCEND_PULL_RESOURCES,\n} from './command';\n\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { mapSeries } from 'bluebird';\nimport { join } from 'node:path';\nimport fs from 'node:fs';\nimport {\n buildTranscendGraphQLClient,\n pullTranscendConfiguration,\n} from '../../../lib/graphql';\n\nimport { writeTranscendYaml } from '../../../lib/readTranscendYaml';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface PullCommandFlags {\n auth: string;\n resources?: (TranscendPullResource | 'all')[];\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n integrationNames?: string[];\n trackerStatuses?: ConsentTrackerStatus[];\n pageSize: number;\n skipDatapoints: boolean;\n skipSubDatapoints: boolean;\n includeGuessedCategories: boolean;\n debug: boolean;\n}\n\nexport async function pull(\n this: LocalContext,\n {\n auth,\n resources = DEFAULT_TRANSCEND_PULL_RESOURCES,\n file,\n transcendUrl,\n dataSiloIds = [],\n integrationNames = [],\n trackerStatuses = DEFAULT_CONSENT_TRACKER_STATUSES,\n pageSize,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n debug,\n }: PullCommandFlags,\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 const resourcesToPull: TranscendPullResource[] = resources.includes('all')\n ? Object.values(TranscendPullResource)\n : (resources as TranscendPullResource[]);\n\n // Sync to Disk\n if (typeof apiKeyOrList === 'string') {\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKeyOrList);\n\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n logger.info(colors.magenta(`Writing configuration to file \"${file}\"...`));\n writeTranscendYaml(file, configuration);\n } catch (err) {\n logger.error(\n colors.red(\n `An error occurred syncing the schema: ${\n debug ? err.stack : err.message\n }`,\n ),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced yaml file to disk at ${file}! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n } else {\n if (!fs.lstatSync(file).isDirectory()) {\n throw new Error(\n 'File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/',\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to pull configuration...\\n\\n~~~`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n try {\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n const filePath = join(file, `${apiKey.organizationName}.yml`);\n logger.info(\n colors.magenta(`Writing configuration to file \"${filePath}\"...`),\n );\n writeTranscendYaml(filePath, configuration);\n\n logger.info(\n colors.green(`${prefix}Successfully pulled configuration!`),\n );\n } catch (err) {\n logger.error(\n colors.red(`${prefix}Failed to sync configuration. - ${err.message}`),\n );\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"]}
|
package/dist/impl-V3MXFXZF.cjs
DELETED
|
@@ -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 _chunkM7OVJJGBcjs = require('./chunk-M7OVJJGB.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _path = require('path');var _fs = require('fs');function H(r,e){r||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A --directory must be provided.")),e.process.exit(1));let n=[];try{n=_fs.readdirSync.call(void 0, r).filter(s=>s.endsWith(".csv")).map(s=>_path.join.call(void 0, r,s)).filter(s=>{try{return _fs.statSync.call(void 0, s).isFile()}catch (e2){return!1}})}catch(i){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to read directory: ${r}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(i.message)),e.process.exit(1)}return n.length===0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`No CSV files found in directory: ${r}`)),e.process.exit(1)),n}var _promises = require('fs/promises');var _promises3 = require('stream/promises');var _stream = require('stream');var _events = require('events');var _csvparse = require('csv-parse');var _fastcsv = require('fast-csv'); var K = _interopRequireWildcard(_fastcsv);function M(r,e){let n=_fs.createWriteStream.call(void 0, r),i=K.format({headers:e,writeHeaders:!0,objectMode:!0});return i.pipe(n),{async write(s){i.write(s)||await _events.once.call(void 0, i,"drain")},async end(){let s=Promise.all([_events.once.call(void 0, n,"finish")]);i.end(),await s}}}function me(r){return String(r).padStart(4,"0")}function fe(r){return Buffer.byteLength(Object.values(r).map(e=>e==null?"":String(e)).join(","),"utf8")}async function N(r){let{filePath:e,outputDir:n,clearOutputDir:i,chunkSizeMB:s,onProgress:f,reportEveryMs:g=500}=r,{size:l}=await _promises.stat.call(void 0, e),u=0;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Chunking ${e} into ~${s}MB files...`));let y=Math.floor(s*1024*1024),C=_path.basename.call(void 0, e,".csv"),d=n||_path.dirname.call(void 0, e);if(_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Output directory: ${d}`)),await _promises.mkdir.call(void 0, d,{recursive:!0}),i){_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`Clearing output directory: ${d}`));let a=await _promises.readdir.call(void 0, d);await Promise.all(a.filter(m=>m.startsWith(`${C}_chunk_`)&&m.endsWith(".csv")).map(m=>_promises.unlink.call(void 0, _path.join.call(void 0, d,m))))}let t=null,h=null,c=0,w=1,P=0,G=new (0, _csvparse.Parser)({columns:!1,skip_empty_lines:!0}),O=0,b=0,S=()=>{let a=b>0?O/b:0,m=a>0?Math.max(c,Math.ceil(l/a)):void 0;f(c,m),u=Date.now()};S();let p=null,$=()=>_path.join.call(void 0, d,`${C}_chunk_${me(w)}.csv`),U=new (0, _stream.Transform)({objectMode:!0,async transform(a,m,T){try{if(!t){t=a.slice(0),h=t.length,p=M($(),t),T();return}h!==null&&a.length!==h&&_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`Row has ${a.length} cols; expected ${h}`)),c+=1,c%25e4===0&&f(c);let v=Object.fromEntries(t.map((Q,X)=>[Q,a[X]])),D=fe(v);O+=D,b+=1,Date.now()-u>=g&&S(),p&&P>0&&P+D>y&&(await p.end(),w+=1,P=0,_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Rolling to chunk ${w} after ${c.toLocaleString()} rows.`)),p=M($(),t)),p||(p=M($(),t)),await p.write(v),P+=D,T()}catch(v){T(v)}},async flush(a){try{p&&(await p.end(),p=null),S(),a()}catch(m){a(m)}}}),J=_fs.createReadStream.call(void 0, e);await _promises3.pipeline.call(void 0, J,G,U),f(c),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Chunked ${e} into ${w} file(s); processed ${c.toLocaleString()} rows.`))}async function A(){let r=Number(process.env.WORKER_ID||"0");_chunkZUNVPK23cjs.a.info(`[w${r}] ready pid=${process.pid}`),_optionalChain([process, 'access', _2 => _2.send, 'optionalCall', _3 => _3({type:"ready"})]),process.on("message",async e=>{if(!e||typeof e!="object"||(e.type==="shutdown"&&process.exit(0),e.type!=="task"))return;let{filePath:n,options:i}=e.payload,{outputDir:s,clearOutputDir:f,chunkSizeMB:g}=i;try{await N({filePath:n,outputDir:s,clearOutputDir:f,chunkSizeMB:g,onProgress:(l,u)=>_optionalChain([process, 'access', _4 => _4.send, 'optionalCall', _5 => _5({type:"progress",payload:{filePath:n,processed:l,total:u}})])}),_optionalChain([process, 'access', _6 => _6.send, 'optionalCall', _7 => _7({type:"result",payload:{ok:!0,filePath:n}})])}catch(l){let u=_chunk55B57ZAYcjs.Yf.call(void 0, l);_chunkZUNVPK23cjs.a.error(`[w${r}] ERROR ${n}: ${u}`),_optionalChain([process, 'access', _8 => _8.send, 'optionalCall', _9 => _9({type:"result",payload:{ok:!1,filePath:n,error:u}})])}}),await new Promise(()=>{})}function de(r){return _chunkM7OVJJGBcjs.d.call(void 0, r)}function he(r){return _chunkM7OVJJGBcjs.e.call(void 0, r)}var q={renderHeader:de,renderWorkers:he};function ke(){return typeof __filename<"u"?__filename:process.argv[1]}async function Ue(r){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let{directory:e,outputDir:n,clearOutputDir:i,chunkSizeMB:s,concurrency:f,viewerMode:g}=r,l=H(e,this),{poolSize:u,cpuCount:y}=_chunkM7OVJJGBcjs.a.call(void 0, f,l.length);_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Chunking ${l.length} CSV file(s) with pool size ${u} (CPU=${y})`));let C=l.map(t=>({filePath:t,options:{outputDir:n,clearOutputDir:i,chunkSizeMB:s}})),d={nextTask:()=>C.shift(),taskLabel:t=>t.filePath,initTotals:()=>({}),initSlotProgress:()=>{},onProgress:t=>t,onResult:(t,h)=>({totals:t,ok:!!h.ok}),postProcess:async()=>{}};await _chunkM7OVJJGBcjs.f.call(void 0, {title:`Chunk CSV - ${e}`,baseDir:e||n||process.cwd(),childFlag:_chunkM7OVJJGBcjs.b,childModulePath:ke(),poolSize:u,cpuCount:y,filesTotal:l.length,hooks:d,viewerMode:g,render:t=>_chunkM7OVJJGBcjs.c.call(void 0, t,q,g),extraKeyHandler:({logsBySlot:t,repaint:h,setPaused:c})=>_chunkM7OVJJGBcjs.g.call(void 0, {logsBySlot:t,repaint:h,setPaused:c})})}process.argv.includes(_chunkM7OVJJGBcjs.b)&&A().catch(r=>{_chunkZUNVPK23cjs.a.error(r),process.exit(1)});exports.chunkCsv = Ue;
|
|
2
|
-
//# sourceMappingURL=impl-V3MXFXZF.cjs.map
|
package/dist/impl-ZAKPYQ32.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk52MA7ZLScjs = require('./chunk-52MA7ZLS.cjs');require('./chunk-M3Y6JH6I.cjs');var _chunkNC6VWOMNcjs = require('./chunk-NC6VWOMN.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _privacytypes = require('@transcend-io/privacy-types');var _bluebird = require('bluebird');async function x({auth:d,bundleTypes:r=[_privacytypes.ConsentBundleType.Production,_privacytypes.ConsentBundleType.Test],deploy:i,transcendUrl:s}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let t=await _chunkNC6VWOMNcjs.b.call(void 0, d);typeof t=="string"?(await _chunk52MA7ZLScjs.a.call(void 0, {deploy:i,transcendUrl:s,auth:t,bundleTypes:r}),_chunkZUNVPK23cjs.a.info(_colors2.default.green("Successfully updated Consent Manager!"))):(await _bluebird.mapSeries.call(void 0, t,async e=>{_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Updating Consent Manager for organization "${e.organizationName}"...`)),await _chunk52MA7ZLScjs.a.call(void 0, {deploy:i,transcendUrl:s,auth:e.apiKey,bundleTypes:r}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully updated Consent Manager for organization "${e.organizationName}"!`))}),_chunkZUNVPK23cjs.a.info(_colors2.default.green("Successfully updated Consent Managers!")))}exports.updateConsentManager = x;
|
|
2
|
-
//# sourceMappingURL=impl-ZAKPYQ32.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZAKPYQ32.cjs","../src/commands/consent/update-consent-manager/impl.ts"],"names":["updateConsentManager","auth","bundleTypes","ConsentBundleType","deploy","transcendUrl","doneInputValidation","apiKeyOrList","validateTranscendAuth","updateConsentManagerVersionToLatest","logger","colors","mapSeries","apiKey"],"mappings":"AAAA,iOAAmC,gCAA6B,wDAAyC,gCAA6B,wDAAyC,gCAA6B,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gFCCzT,2DACe,oCACR,MAc1B,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,CAACC,+BAAAA,CAAkB,UAAA,CAAYA,+BAAAA,CAAkB,IAAI,CAAA,CACnE,MAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAMC,CAAAA,CAAe,MAAMC,iCAAAA,CAA0B,CAAA,CAGjD,OAAOD,CAAAA,EAAiB,QAAA,CAAA,CAE1B,MAAME,iCAAAA,CACJ,MAAA,CAAAL,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAME,CAAAA,CACN,WAAA,CAAAL,CACF,CAAC,CAAA,CACDQ,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,KAAA,CAAM,uCAAuC,CAAC,CAAA,CAAA,CAAA,CAEjE,MAAMC,iCAAAA,CAAUL,CAAc,MAAOM,CAAAA,EAAW,CAC9CH,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,OAAA,CACL,CAAA,2CAAA,EAA8CE,CAAAA,CAAO,gBAAgB,CAAA,IAAA,CACvE,CACF,CAAA,CAEA,MAAMJ,iCAAAA,CACJ,MAAA,CAAAL,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAMQ,CAAAA,CAAO,MAAA,CACb,WAAA,CAAAX,CACF,CAAC,CAAA,CAEDQ,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,uDAAA,EAA0DE,CAAAA,CAAO,gBAAgB,CAAA,EAAA,CACnF,CACF,CACF,CAAC,CAAA,CACDH,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,KAAA,CAAM,wCAAwC,CAAC,CAAA,CAEtE,CAAA,iCAAA","file":"/home/runner/work/cli/cli/dist/impl-ZAKPYQ32.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\nimport { ConsentBundleType } from '@transcend-io/privacy-types';\nimport { mapSeries } from 'bluebird';\n\nimport { logger } from '../../../logger';\nimport { updateConsentManagerVersionToLatest } from '../../../lib/consent-manager';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UpdateConsentManagerCommandFlags {\n auth: string;\n bundleTypes: ConsentBundleType[];\n deploy: boolean;\n transcendUrl: string;\n}\n\nexport async function updateConsentManager(\n this: LocalContext,\n {\n auth,\n bundleTypes = [ConsentBundleType.Production, ConsentBundleType.Test],\n deploy,\n transcendUrl,\n }: UpdateConsentManagerCommandFlags,\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 // Handle single update\n if (typeof apiKeyOrList === 'string') {\n // Update consent manager\n await updateConsentManagerVersionToLatest({\n deploy,\n transcendUrl,\n auth: apiKeyOrList,\n bundleTypes,\n });\n logger.info(colors.green('Successfully updated Consent Manager!'));\n } else {\n await mapSeries(apiKeyOrList, async (apiKey) => {\n logger.info(\n colors.magenta(\n `Updating Consent Manager for organization \"${apiKey.organizationName}\"...`,\n ),\n );\n\n await updateConsentManagerVersionToLatest({\n deploy,\n transcendUrl,\n auth: apiKey.apiKey,\n bundleTypes,\n });\n\n logger.info(\n colors.green(\n `Successfully updated Consent Manager for organization \"${apiKey.organizationName}\"!`,\n ),\n );\n });\n logger.info(colors.green('Successfully updated Consent Managers!'));\n }\n}\n"]}
|
package/dist/impl-ZTYQ3IB5.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkQ2RJZGYWcjs = require('./chunk-Q2RJZGYW.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _bluebird = require('bluebird');async function _({file:l,fileTarget:f,transcendUrl:p,auth:g,sombraAuth:x,cronDataSiloId:v,targetDataSiloId:N,actions:R,skipRequestCount:h,pageLimit:r,chunkSize:s}){h&&_chunkZUNVPK23cjs.a.info(_colors2.default.yellow("Skipping request count as requested. This may help speed up the call.")),(Number.isNaN(s)||s<=0||s%r!==0)&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Invalid chunk size: "${s}". Must be a positive integer that is a multiple of ${r}.`)),this.process.exit(1)),_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let S=_chunk55B57ZAYcjs.xc.call(void 0, p,g),{baseName:j,extension:O}=_chunk55B57ZAYcjs.sg.call(void 0, l),{baseName:A,extension:D}=_chunk55B57ZAYcjs.sg.call(void 0, f),$=0,b=0,d=0;await _chunkQ2RJZGYWcjs.g.call(void 0, {dataSiloId:v,auth:g,sombraAuth:x,actions:R,apiPageSize:r,savePageSize:s,onSave:async o=>{$+=o.length;let k=o.map(t=>t.requestId),E=_chunkXXFLFF7Qcjs.j.call(void 0, k),G=_chunkXXFLFF7Qcjs.b.call(void 0, E,r),y=await _bluebird.map.call(void 0, G,async t=>(_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Fetching target identifiers for ${t.length} requests`)),(await _chunk55B57ZAYcjs.Jd.call(void 0, S,r*2,{requestIds:t,dataSiloIds:[N]})).map(({fileName:I,remoteId:C})=>{if(!C)throw new Error(`Failed to find remoteId for ${I}`);return{RecordId:C,Object:_optionalChain([I, 'access', _2 => _2.replace, 'call', _3 => _3(".json",""), 'access', _4 => _4.split, 'call', _5 => _5("/"), 'access', _6 => _6.pop, 'call', _7 => _7(), 'optionalAccess', _8 => _8.replace, 'call', _9 => _9(" Information","")]),Comment:"Customer data deletion request submitted via transcend.io"}})),{concurrency:1});b+=y.flat().length;let L=_chunkXXFLFF7Qcjs.j.call(void 0, o.map(t=>Object.keys(t)).flat()),M=`${j}-${d}${O}`,Q=`${A}-${d}${D}`;await _chunk55B57ZAYcjs.tg.call(void 0, M,o,L),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${o.length} identifiers to file "${l}"`));let n=y.flat(),T=_chunkXXFLFF7Qcjs.j.call(void 0, n.map(t=>Object.keys(t)).flat());await _chunk55B57ZAYcjs.tg.call(void 0, Q,n,T),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${n.length} identifiers to file "${f}"`)),_chunkZUNVPK23cjs.a.info(_colors2.default.blue(`Processed chunk of ${_chunkXXFLFF7Qcjs.b.length} identifiers, found ${n.length} target identifiers`)),d+=1},transcendUrl:p,skipRequestCount:h}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${$} identifiers to file "${l}"`)),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${b} identifiers to file "${f}"`))}exports.pullProfiles = _;
|
|
2
|
-
//# sourceMappingURL=impl-ZTYQ3IB5.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZTYQ3IB5.cjs","../src/commands/request/cron/pull-profiles/impl.ts"],"names":["pullProfiles","file","fileTarget","transcendUrl","auth","sombraAuth","cronDataSiloId","targetDataSiloId","actions","skipRequestCount","pageLimit","chunkSize","logger","colors","doneInputValidation","client","buildTranscendGraphQLClient","baseName","extension","parseFilePath","baseNameTarget","extensionTarget","allIdentifiersCount","allTargetIdentifiersCount","fileCount","pullChunkedCustomSiloOutstandingIdentifiers","chunkToSave","requestIds","d","uniqueRequestIds","uniq_default","chunkedRequestIds","chunk_default","results","map","fetchRequestFilesForRequest","fileName","remoteId"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAkE,gCAA6B,wDAAyC,wDAAgD,gCAA6B,gFCEnR,oCAEC,MA2BpB,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CACF,CAAA,CACe,CACXF,CAAAA,EACFG,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,MAAA,CACL,uEACF,CACF,CAAA,CAAA,CAIA,MAAA,CAAO,KAAA,CAAMF,CAAS,CAAA,EACtBA,CAAAA,EAAa,CAAA,EACbA,CAAAA,CAAYD,CAAAA,GAAc,CAAA,CAAA,EAAA,CAE1BE,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,qBAAA,EAAwBF,CAAS,CAAA,oDAAA,EAAuDD,CAAS,CAAA,CAAA,CACnG,CACF,CAAA,CACA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGrBI,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAMC,CAAAA,CAASC,kCAAAA,CAA4Bb,CAAcC,CAAI,CAAA,CACvD,CAAE,QAAA,CAAAa,CAAAA,CAAU,SAAA,CAAAC,CAAU,CAAA,CAAIC,kCAAAA,CAAkB,CAAA,CAC5C,CAAE,QAAA,CAAUC,CAAAA,CAAgB,SAAA,CAAWC,CAAgB,CAAA,CAC3DF,kCAAAA,CAAwB,CAAA,CAEtBG,CAAAA,CAAsB,CAAA,CACtBC,CAAAA,CAA4B,CAAA,CAC5BC,CAAAA,CAAY,CAAA,CAmFhB,MAAMC,iCAAAA,CACJ,UAAA,CAAYnB,CAAAA,CACZ,IAAA,CAAAF,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,OAAA,CAAAG,CAAAA,CACA,WAAA,CAAaE,CAAAA,CACb,YAAA,CAAcC,CAAAA,CACd,MAAA,CAxFa,MACbe,CAAAA,EACkB,CAElBJ,CAAAA,EAAuBI,CAAAA,CAAY,MAAA,CAGnC,IAAMC,CAAAA,CAAaD,CAAAA,CAAY,GAAA,CAAKE,CAAAA,EAAMA,CAAAA,CAAE,SAAmB,CAAA,CACzDC,CAAAA,CAAmBC,iCAAAA,CAAe,CAAA,CAGlCC,CAAAA,CAAoBC,iCAAAA,CAAMH,CAAkBnB,CAAS,CAAA,CACrDuB,CAAAA,CAAU,MAAMC,2BAAAA,CACpBH,CACA,MAAOJ,CAAAA,EAAAA,CACLf,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,OAAA,CACL,CAAA,gCAAA,EAAmCc,CAAAA,CAAW,MAAM,CAAA,SAAA,CACtD,CACF,CAAA,CAAA,CACgB,MAAMQ,kCAAAA,CACpBpB,CACAL,CAAAA,CAAY,CAAA,CACZ,CACE,UAAA,CAAAiB,CAAAA,CACA,WAAA,CAAa,CAACpB,CAAgB,CAChC,CACF,CAAA,CAAA,CACe,GAAA,CAAI,CAAC,CAAE,QAAA,CAAA6B,CAAAA,CAAU,QAAA,CAAAC,CAAS,CAAA,CAAA,EAAM,CAC7C,EAAA,CAAI,CAACA,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,CAAA,4BAAA,EAA+BD,CAAQ,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/impl-ZTYQ3IB5.cjs","sourcesContent":[null,"import type { RequestAction } from '@transcend-io/privacy-types';\nimport { logger } from '../../../../logger';\nimport colors from 'colors';\nimport { uniq, chunk } from 'lodash-es';\nimport { map } from 'bluebird';\nimport {\n buildTranscendGraphQLClient,\n fetchRequestFilesForRequest,\n} from '../../../../lib/graphql';\nimport type { LocalContext } from '../../../../context';\nimport {\n pullChunkedCustomSiloOutstandingIdentifiers,\n type CsvFormattedIdentifier,\n} from '../../../../lib/cron';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation';\nimport { parseFilePath, writeLargeCsv } from '../../../../lib/helpers';\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(\n 'Skipping request count as requested. This may help speed up the call.',\n ),\n );\n }\n\n if (\n Number.isNaN(chunkSize) ||\n chunkSize <= 0 ||\n chunkSize % pageLimit !== 0\n ) {\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 } =\n 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 (\n chunkToSave: CsvFormattedIdentifier[],\n ): 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(\n `Fetching target identifiers for ${requestIds.length} requests`,\n ),\n );\n const results = await fetchRequestFilesForRequest(\n client,\n pageLimit * 2,\n {\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\n .replace('.json', '')\n .split('/')\n .pop()\n ?.replace(' Information', ''),\n Comment:\n '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(\n `Successfully wrote ${chunkToSave.length} identifiers to file \"${file}\"`,\n ),\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(\n `Successfully wrote ${allIdentifiersCount} identifiers to file \"${file}\"`,\n ),\n );\n logger.info(\n colors.green(\n `Successfully wrote ${allTargetIdentifiersCount} identifiers to file \"${fileTarget}\"`,\n ),\n );\n}\n"]}
|