@transcend-io/cli 8.26.3 → 8.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -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-IXJG6NAC.cjs → chunk-4PQ4RHUG.cjs} +4 -4
- package/dist/{chunk-IXJG6NAC.cjs.map → chunk-4PQ4RHUG.cjs.map} +1 -1
- package/dist/{chunk-PZLVJBQM.cjs → chunk-7PF5VVAF.cjs} +2 -2
- package/dist/{chunk-PZLVJBQM.cjs.map → chunk-7PF5VVAF.cjs.map} +1 -1
- package/dist/{chunk-4LHXA6MV.cjs → chunk-AEL3DOYI.cjs} +2 -2
- package/dist/{chunk-4LHXA6MV.cjs.map → chunk-AEL3DOYI.cjs.map} +1 -1
- package/dist/{chunk-YPUEGXPW.cjs → chunk-CQT5QQ3U.cjs} +2 -2
- package/dist/{chunk-YPUEGXPW.cjs.map → chunk-CQT5QQ3U.cjs.map} +1 -1
- package/dist/{chunk-5UBGZNDC.cjs → chunk-ECGHWDVP.cjs} +2 -2
- package/dist/chunk-ECGHWDVP.cjs.map +1 -0
- package/dist/{chunk-MGIVF74Z.cjs → chunk-EYOQLGDV.cjs} +2 -2
- package/dist/{chunk-MGIVF74Z.cjs.map → chunk-EYOQLGDV.cjs.map} +1 -1
- package/dist/{chunk-HPU3KPV4.cjs → chunk-FER7XKVN.cjs} +2 -2
- package/dist/{chunk-HPU3KPV4.cjs.map → chunk-FER7XKVN.cjs.map} +1 -1
- package/dist/{chunk-SBCX6SDE.cjs → chunk-I7PFP5VB.cjs} +2 -2
- package/dist/{chunk-SBCX6SDE.cjs.map → chunk-I7PFP5VB.cjs.map} +1 -1
- package/dist/{chunk-RE5YALEO.cjs → chunk-JFZPP4VV.cjs} +3 -3
- package/dist/{chunk-RE5YALEO.cjs.map → chunk-JFZPP4VV.cjs.map} +1 -1
- package/dist/{chunk-UAO3IAO3.cjs → chunk-K4TIJ3VM.cjs} +2 -2
- package/dist/{chunk-UAO3IAO3.cjs.map → chunk-K4TIJ3VM.cjs.map} +1 -1
- package/dist/{chunk-X6CJEYOA.cjs → chunk-KUBXRT3V.cjs} +5 -4
- package/dist/chunk-KUBXRT3V.cjs.map +1 -0
- package/dist/{chunk-ZOVKGQJQ.cjs → chunk-L7Z4PFRC.cjs} +2 -2
- package/dist/{chunk-ZOVKGQJQ.cjs.map → chunk-L7Z4PFRC.cjs.map} +1 -1
- package/dist/{chunk-PP4YLOQE.cjs → chunk-RNZ72QMS.cjs} +2 -2
- package/dist/{chunk-PP4YLOQE.cjs.map → chunk-RNZ72QMS.cjs.map} +1 -1
- package/dist/{chunk-LMUWS7HI.cjs → chunk-THOOR2KA.cjs} +4 -4
- package/dist/{chunk-LMUWS7HI.cjs.map → chunk-THOOR2KA.cjs.map} +1 -1
- package/dist/{chunk-S5MX7XJL.cjs → chunk-Y35YHYXP.cjs} +21 -21
- package/dist/{chunk-S5MX7XJL.cjs.map → chunk-Y35YHYXP.cjs.map} +1 -1
- package/dist/{chunk-EBEILTRR.cjs → chunk-YKGS253B.cjs} +6 -6
- package/dist/{chunk-EBEILTRR.cjs.map → chunk-YKGS253B.cjs.map} +1 -1
- package/dist/{impl-XW4UTUBW.cjs → impl-3YAJ7ZV3.cjs} +2 -2
- package/dist/{impl-XW4UTUBW.cjs.map → impl-3YAJ7ZV3.cjs.map} +1 -1
- package/dist/{impl-UHCILICE.cjs → impl-55NL4KOI.cjs} +2 -2
- package/dist/{impl-UHCILICE.cjs.map → impl-55NL4KOI.cjs.map} +1 -1
- package/dist/{impl-NAITRZS5.cjs → impl-7B7QDZZJ.cjs} +2 -2
- package/dist/{impl-NAITRZS5.cjs.map → impl-7B7QDZZJ.cjs.map} +1 -1
- package/dist/{impl-ZAKD7OF2.cjs → impl-A6W2KTYL.cjs} +2 -2
- package/dist/{impl-ZAKD7OF2.cjs.map → impl-A6W2KTYL.cjs.map} +1 -1
- package/dist/{impl-MNMSXIYH.cjs → impl-ALROZNDJ.cjs} +2 -2
- package/dist/{impl-MNMSXIYH.cjs.map → impl-ALROZNDJ.cjs.map} +1 -1
- package/dist/{impl-65UAYE4Y.cjs → impl-ANXIZT7S.cjs} +2 -2
- package/dist/{impl-65UAYE4Y.cjs.map → impl-ANXIZT7S.cjs.map} +1 -1
- package/dist/{impl-RIR5ANXH.cjs → impl-AP2ZTYJK.cjs} +2 -2
- package/dist/{impl-RIR5ANXH.cjs.map → impl-AP2ZTYJK.cjs.map} +1 -1
- package/dist/{impl-HNW6B2DU.cjs → impl-AZYBYV3X.cjs} +2 -2
- package/dist/{impl-HNW6B2DU.cjs.map → impl-AZYBYV3X.cjs.map} +1 -1
- package/dist/impl-B7ODYIUX.cjs +2 -0
- package/dist/{impl-6DHYOTA2.cjs.map → impl-B7ODYIUX.cjs.map} +1 -1
- package/dist/{impl-TNSZ6LTO.cjs → impl-BDPD5CCN.cjs} +2 -2
- package/dist/{impl-TNSZ6LTO.cjs.map → impl-BDPD5CCN.cjs.map} +1 -1
- package/dist/{impl-3BHV7STJ.cjs → impl-BL4XQEFX.cjs} +2 -2
- package/dist/{impl-3BHV7STJ.cjs.map → impl-BL4XQEFX.cjs.map} +1 -1
- package/dist/{impl-JBFNOZXK.cjs → impl-D7R3HZEC.cjs} +5 -5
- package/dist/{impl-JBFNOZXK.cjs.map → impl-D7R3HZEC.cjs.map} +1 -1
- package/dist/{impl-WTLPP6WJ.cjs → impl-DDQQGOQ3.cjs} +2 -2
- package/dist/{impl-WTLPP6WJ.cjs.map → impl-DDQQGOQ3.cjs.map} +1 -1
- package/dist/{impl-5FLGACAD.cjs → impl-DT5KLE2G.cjs} +3 -3
- package/dist/{impl-5FLGACAD.cjs.map → impl-DT5KLE2G.cjs.map} +1 -1
- package/dist/{impl-PBEQHLIJ.cjs → impl-DVE332P5.cjs} +2 -2
- package/dist/{impl-PBEQHLIJ.cjs.map → impl-DVE332P5.cjs.map} +1 -1
- package/dist/{impl-Z5MFXC4Y.cjs → impl-DXAKJNLZ.cjs} +2 -2
- package/dist/{impl-Z5MFXC4Y.cjs.map → impl-DXAKJNLZ.cjs.map} +1 -1
- package/dist/{impl-BFSDPXDV.cjs → impl-H2BRV4GP.cjs} +2 -2
- package/dist/{impl-BFSDPXDV.cjs.map → impl-H2BRV4GP.cjs.map} +1 -1
- package/dist/{impl-CSTT5HQH.cjs → impl-IFDUZGZM.cjs} +2 -2
- package/dist/{impl-CSTT5HQH.cjs.map → impl-IFDUZGZM.cjs.map} +1 -1
- package/dist/{impl-KAWZ42M5.cjs → impl-IIIT5MSV.cjs} +2 -2
- package/dist/{impl-KAWZ42M5.cjs.map → impl-IIIT5MSV.cjs.map} +1 -1
- package/dist/{impl-5K2UCOJJ.cjs → impl-JPVEFSJB.cjs} +2 -2
- package/dist/{impl-5K2UCOJJ.cjs.map → impl-JPVEFSJB.cjs.map} +1 -1
- package/dist/{impl-LVHX32GS.cjs → impl-LDOILOAQ.cjs} +2 -2
- package/dist/{impl-LVHX32GS.cjs.map → impl-LDOILOAQ.cjs.map} +1 -1
- package/dist/{impl-6YB36EZH.cjs → impl-LKJFVX7E.cjs} +2 -2
- package/dist/{impl-6YB36EZH.cjs.map → impl-LKJFVX7E.cjs.map} +1 -1
- package/dist/{impl-3DHFXZRO.cjs → impl-LQEYNOZS.cjs} +2 -2
- package/dist/{impl-3DHFXZRO.cjs.map → impl-LQEYNOZS.cjs.map} +1 -1
- package/dist/{impl-WP2EKZ6C.cjs → impl-M5QGTDLF.cjs} +2 -2
- package/dist/{impl-WP2EKZ6C.cjs.map → impl-M5QGTDLF.cjs.map} +1 -1
- package/dist/{impl-BJRSLU3V.cjs → impl-MBEVWSPX.cjs} +2 -2
- package/dist/{impl-BJRSLU3V.cjs.map → impl-MBEVWSPX.cjs.map} +1 -1
- package/dist/{impl-F4B6PYAE.cjs → impl-NCUMPL6B.cjs} +4 -4
- package/dist/{impl-F4B6PYAE.cjs.map → impl-NCUMPL6B.cjs.map} +1 -1
- package/dist/{impl-DHAB5PO6.cjs → impl-NISL4HZY.cjs} +2 -2
- package/dist/{impl-DHAB5PO6.cjs.map → impl-NISL4HZY.cjs.map} +1 -1
- package/dist/{impl-KWAOGILY.cjs → impl-OFRMKTX5.cjs} +2 -2
- package/dist/{impl-KWAOGILY.cjs.map → impl-OFRMKTX5.cjs.map} +1 -1
- package/dist/impl-PE52QYSI.cjs +2 -0
- package/dist/{impl-5G2I4YXV.cjs.map → impl-PE52QYSI.cjs.map} +1 -1
- package/dist/{impl-ZJFIQ3WO.cjs → impl-PXT7QNSR.cjs} +2 -2
- package/dist/{impl-ZJFIQ3WO.cjs.map → impl-PXT7QNSR.cjs.map} +1 -1
- package/dist/{impl-N7KXTUQ5.cjs → impl-SDQ6LUZD.cjs} +2 -2
- package/dist/{impl-N7KXTUQ5.cjs.map → impl-SDQ6LUZD.cjs.map} +1 -1
- package/dist/{impl-HFNH2244.cjs → impl-SVEK74IU.cjs} +2 -2
- package/dist/{impl-HFNH2244.cjs.map → impl-SVEK74IU.cjs.map} +1 -1
- package/dist/{impl-3WNATSXH.cjs → impl-SVPD3IHV.cjs} +2 -2
- package/dist/{impl-3WNATSXH.cjs.map → impl-SVPD3IHV.cjs.map} +1 -1
- package/dist/{impl-AH7B2B24.cjs → impl-UC5CCT6E.cjs} +3 -3
- package/dist/{impl-AH7B2B24.cjs.map → impl-UC5CCT6E.cjs.map} +1 -1
- package/dist/{impl-ZBPQU55V.cjs → impl-UZPP5VK5.cjs} +2 -2
- package/dist/{impl-ZBPQU55V.cjs.map → impl-UZPP5VK5.cjs.map} +1 -1
- package/dist/{impl-72IBK3I6.cjs → impl-VZ6NJDAV.cjs} +2 -2
- package/dist/{impl-72IBK3I6.cjs.map → impl-VZ6NJDAV.cjs.map} +1 -1
- package/dist/{impl-IG2OR2JL.cjs → impl-W35DMTQV.cjs} +2 -2
- package/dist/{impl-IG2OR2JL.cjs.map → impl-W35DMTQV.cjs.map} +1 -1
- package/dist/{impl-QUYKNAFP.cjs → impl-XHO6WQ2I.cjs} +2 -2
- package/dist/{impl-QUYKNAFP.cjs.map → impl-XHO6WQ2I.cjs.map} +1 -1
- package/dist/{impl-V2RBWUPL.cjs → impl-YHBNKYSL.cjs} +2 -2
- package/dist/{impl-V2RBWUPL.cjs.map → impl-YHBNKYSL.cjs.map} +1 -1
- package/dist/{impl-O7I2KRJ7.cjs → impl-YJ6UUT4D.cjs} +2 -2
- package/dist/{impl-O7I2KRJ7.cjs.map → impl-YJ6UUT4D.cjs.map} +1 -1
- package/dist/{impl-TXK727IK.cjs → impl-YWJCIRTP.cjs} +2 -2
- package/dist/{impl-TXK727IK.cjs.map → impl-YWJCIRTP.cjs.map} +1 -1
- package/dist/{impl-K6XHDMZZ.cjs → impl-ZTZHVQYY.cjs} +2 -2
- package/dist/{impl-K6XHDMZZ.cjs.map → impl-ZTZHVQYY.cjs.map} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +18 -1
- package/package.json +3 -3
- package/dist/chunk-5UBGZNDC.cjs.map +0 -1
- package/dist/chunk-X6CJEYOA.cjs.map +0 -1
- package/dist/impl-5G2I4YXV.cjs +0 -2
- package/dist/impl-6DHYOTA2.cjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-SDQ6LUZD.cjs","../src/commands/inventory/pull-datapoints/impl.ts"],"names":["pullDatapoints","auth","file","transcendUrl","dataSiloIds","includeAttributes","includeGuessedCategories","parentCategories","subCategories","doneInputValidation","client","buildTranscendGraphQLClient","dataPoints","pullAllDatapoints","logger","colors","headers","inputs","point","result","category"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAuD,gCAA6B,gFCI1Q,MAmBnB,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CAAgB,CAAC,CACnB,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,GAAI,CAEF,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BR,CAAcF,CAAI,CAAA,CAEvDW,CAAAA,CAAa,MAAMC,iCAAAA,CAAkBH,CAAQ,CACjD,WAAA,CAAAN,CAAAA,CACA,wBAAA,CAAAE,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAF,CAAAA,CACA,aAAA,CAAAG,CACF,CAAC,CAAA,CAEDM,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,CAAA,4BAAA,EAA+Bb,CAAI,CAAA,IAAA,CAAM,CAAC,CAAA,CACrE,IAAIc,CAAAA,CAAoB,CAAC,CAAA,CACnBC,CAAAA,CAASL,CAAAA,CAAW,GAAA,CAAKM,CAAAA,EAAU,CACvC,IAAMC,CAAAA,CAAS,CACb,aAAA,CAAeD,CAAAA,CAAM,EAAA,CACrB,WAAA,CAAaA,CAAAA,CAAM,QAAA,CAAS,KAAA,CAC5B,MAAA,CAAQA,CAAAA,CAAM,SAAA,CAAU,IAAA,CACxB,aAAA,CAAeA,CAAAA,CAAM,SAAA,CAAU,IAAA,CAAK,IAAA,CAAK,GAAG,CAAA,CAC5C,QAAA,CAAUA,CAAAA,CAAM,IAAA,CAChB,sBAAA,CAAwBA,CAAAA,CAAM,WAAA,CAC9B,iBAAA,CAAmBA,CAAAA,CAAM,UAAA,CACtB,GAAA,CAAKE,CAAAA,EAAa,CAAA,EAAA","file":"/home/runner/work/cli/cli/dist/impl-SDQ6LUZD.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { uniq, groupBy } from 'lodash-es';\n\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { buildTranscendGraphQLClient } from '../../../lib/graphql';\nimport { ADMIN_DASH_DATAPOINTS } from '../../../constants';\nimport { pullAllDatapoints } from '../../../lib/data-inventory';\nimport { DataCategoryType } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { writeLargeCsv } from '../../../lib/helpers';\n\nexport interface PullDatapointsCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n includeAttributes: boolean;\n includeGuessedCategories: boolean;\n parentCategories?: DataCategoryType[];\n subCategories?: string[];\n}\n\nexport async function pullDatapoints(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n includeAttributes,\n includeGuessedCategories,\n parentCategories,\n subCategories = [],\n }: PullDatapointsCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const dataPoints = await pullAllDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n parentCategories,\n includeAttributes,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n });\n\n logger.info(colors.magenta(`Writing datapoints to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = dataPoints.map((point) => {\n const result = {\n 'Property ID': point.id,\n 'Data Silo': point.dataSilo.title,\n Object: point.dataPoint.name,\n 'Object Path': point.dataPoint.path.join('.'),\n Property: point.name,\n 'Property Description': point.description,\n 'Data Categories': point.categories\n .map((category) => `${category.category}:${category.name}`)\n .join(', '),\n 'Guessed Category': point.pendingCategoryGuesses?.[0]\n ? `${point.pendingCategoryGuesses![0]!.category.category}:${\n point.pendingCategoryGuesses![0]!.category.name\n }`\n : '',\n 'Processing Purposes': point.purposes\n .map((purpose) => `${purpose.purpose}:${purpose.name}`)\n .join(', '),\n ...Object.entries(\n groupBy(\n point.attributeValues || [],\n ({ attributeKey }) => attributeKey.name,\n ),\n ).reduce((acc, [key, values]) => {\n acc[key] = values.map((value) => value.name).join(',');\n return acc;\n }, {} as Record<string, string>),\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(\n colors.red(`An error occurred syncing the datapoints: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced datapoints to disk at ${file}! View at ${ADMIN_DASH_DATAPOINTS}`,\n ),\n );\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
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 _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
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 _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkKUBXRT3Vcjs = require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.cjs');var _iots = require('io-ts'); var c = _interopRequireWildcard(_iots);var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _fs = require('fs');var _cliprogress = require('cli-progress'); var _cliprogress2 = _interopRequireDefault(_cliprogress);var _privacytypes = require('@transcend-io/privacy-types');async function U({auth:k,file:s,transcendUrl:$,duration:A,subjectType:P,emailColumnName:a,coreIdentifierColumnName:r}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),_fs.existsSync.call(void 0, s)||(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`File does not exist: "${s}". Please provide a valid path to a CSV file.`)),this.process.exit(1));try{let p=_chunkKUBXRT3Vcjs.wc.call(void 0, $,k),b=c.type({[a]:c.string,...r?{[r]:c.string}:{}}),n=_chunkKUBXRT3Vcjs.rc.call(void 0, s,b);if(!n.length)throw new Error("Input CSV is empty.");let h=n.map((e,t)=>[e,t]).filter(([e])=>!_optionalChain([e, 'access', _ => _[a], 'optionalAccess', _2 => _2.trim, 'call', _3 => _3()]));if(h.length){let e=h.map(([,t])=>t+2).join(", ");throw new Error(`The following rows are missing the required "${a}" column: ${e}`)}if(r){let e=n.map((t,o)=>[t,o]).filter(([t])=>!_optionalChain([t, 'access', _4 => _4[r], 'optionalAccess', _5 => _5.trim, 'call', _6 => _6()]));if(e.length){let t=e.map(([,o])=>o+2).join(", ");throw new Error(`The following rows are missing the required "${r}" column: ${t}`)}}let I=Math.max(1,Math.floor(A/1e3)),d=n.map((e,t)=>{let o=e[a].trim(),f=r?_optionalChain([e, 'access', _7 => _7[r], 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]):void 0,j=[_privacytypes.SombraStandardScope.PreferenceManagement];return{subjectType:P,scopes:j,expiresIn:I,email:o,...f?{coreIdentifier:f}:{},index:t}}),m=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic);m.start(d.length,0);let v=Date.now(),l=await _chunkKUBXRT3Vcjs.Jc.call(void 0, p,d,e=>{m.update(e)});m.update(d.length),m.stop();let E=l.map(({accessToken:e,input:t})=>{if(typeof t.index!="number")throw new Error("Internal error: missing input index.");return{...n[t.index],token:e}});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing access tokens to file "${s}"...`)),await _chunkKUBXRT3Vcjs.pg.call(void 0, s,E,!0);let M=Math.round((Date.now()-v)/1e3);_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully generated ${l.length} access tokens to "${s}" in ${M}s!`))}catch(p){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error occurred while generating access tokens: ${_optionalChain([p, 'optionalAccess', _10 => _10.message])||String(p)}`)),this.process.exit(1)}}exports.generateAccessTokens = U;
|
|
2
|
+
//# sourceMappingURL=impl-SVEK74IU.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-SVEK74IU.cjs","../src/commands/consent/generate-access-tokens/impl.ts"],"names":["generateAccessTokens","auth","file","transcendUrl","duration","subjectType","emailColumnName","coreIdentifierColumnName","doneInputValidation","existsSync","logger","colors","client","buildTranscendGraphQLClient","codec","rows","readCsv","missingEmail","r","i","rowNumbers"],"mappings":"AAAA,u/BAAwC,wDAAkE,gCAA6B,wDAAyC,gCAA6B,gCAA6B,qECCvN,gFACA,wBAGQ,qGACH,2DAOY,MA4BpC,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAChCC,4BAAAA,CAAe,CAAA,EAAA,CAClBC,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,sBAAA,EAAyBT,CAAI,CAAA,6CAAA,CAC/B,CACF,CAAA,CACA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGrB,GAAI,CAEF,IAAMU,CAAAA,CAASC,kCAAAA,CAA4BV,CAAcF,CAAI,CAAA,CAGvDa,CAAAA,CAAU,CAAA,CAAA,IAAA,CAAK,CACnB,CAACR,CAAe,CAAA,CAAK,CAAA,CAAA,MAAA,CACrB,GAAIC,CAAAA,CACA,CAAE,CAACA,CAAwB,CAAA,CAAK,CAAA,CAAA,MAAO,CAAA,CACvC,CAAC,CACP,CAAC,CAAA,CACKQ,CAAAA,CAAsCC,kCAAAA,CAAQd,CAAMY,CAAK,CAAA,CAC/D,EAAA,CAAI,CAACC,CAAAA,CAAK,MAAA,CACR,MAAM,IAAI,KAAA,CAAM,qBAAqB,CAAA,CAIvC,IAAME,CAAAA,CAAeF,CAAAA,CAClB,GAAA,CAAI,CAACG,CAAAA,CAAGC,CAAAA,CAAAA,EAAM,CAACD,CAAAA,CAAGC,CAAC,CAAU,CAAA,CAC7B,MAAA,CAAO,CAAC,CAACD,CAAC,CAAA,CAAA,EAAM,iBAACA,CAAAA,mBAAEZ,CAAe,CAAA,6BAAG,IAAA,mBAAK,GAAC,CAAA,CAC9C,EAAA,CAAIW,CAAAA,CAAa,MAAA,CAAQ,CACvB,IAAMG,CAAAA,CAAaH,CAAAA,CAChB,GAAA,CAAI,CAAC,CAAC,CAAEE,CAAC,CAAA,CAAA,EAAMA,CAAAA,CAAI,CAAC,CAAA,CACpB,IAAA,CAAK,IAAI,CAAA,CACZ,MAAM,IAAI,KAAA,CACR,CAAA,6CAAA,EAAgDb,CAAe,CAAA,UAAA,EAAac,CAAU,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/impl-SVEK74IU.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport * as t from 'io-ts';\nimport colors from 'colors';\nimport { logger } from '../../../logger';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { existsSync } from 'node:fs';\nimport cliProgress from 'cli-progress';\nimport {\n buildTranscendGraphQLClient,\n createPreferenceAccessTokens,\n type PreferenceAccessTokenInputWithIndex,\n} from '../../../lib/graphql';\nimport { readCsv } from '../../../lib/requests';\nimport { SombraStandardScope } from '@transcend-io/privacy-types';\nimport { writeCsv } from '../../../lib/helpers';\n\n/**\n * CLI flags accepted by the `generate-access-tokens` command.\n *\n * These are passed down from the CLI parser into the parent process.\n */\nexport type GenerateAccessTokenCommandFlags = {\n auth: string;\n file: string;\n duration: number;\n transcendUrl: string;\n subjectType: string;\n emailColumnName: string;\n coreIdentifierColumnName?: string;\n};\n\n/**\n * Take in a CSV of user identifiers and generate access tokens for each user.\n *\n * Expected CSV columns:\n * - [emailColumnName] (required)\n * - [coreIdentifierColumnName] (optional)\n *\n * @param this - Bound CLI context (provides process exit + logging).\n * @param flags - CLI options for the run.\n */\nexport async function generateAccessTokens(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n duration,\n subjectType,\n emailColumnName,\n coreIdentifierColumnName,\n }: GenerateAccessTokenCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n if (!existsSync(file)) {\n logger.error(\n colors.red(\n `File does not exist: \"${file}\". Please provide a valid path to a CSV file.`,\n ),\n );\n this.process.exit(1);\n }\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Read + parse CSV\n const codec = t.type({\n [emailColumnName]: t.string,\n ...(coreIdentifierColumnName\n ? { [coreIdentifierColumnName]: t.string }\n : {}),\n });\n const rows: Array<Record<string, string>> = readCsv(file, codec);\n if (!rows.length) {\n throw new Error('Input CSV is empty.');\n }\n\n // Ensure emails and core identifiers exist\n const missingEmail = rows\n .map((r, i) => [r, i] as const)\n .filter(([r]) => !r[emailColumnName]?.trim());\n if (missingEmail.length) {\n const rowNumbers = missingEmail\n .map(([, i]) => i + 2) // +2 to account for header row and 0-indexing\n .join(', ');\n throw new Error(\n `The following rows are missing the required \"${emailColumnName}\" column: ${rowNumbers}`,\n );\n }\n if (coreIdentifierColumnName) {\n const missingCoreId = rows\n .map((r, i) => [r, i] as const)\n .filter(([r]) => !r[coreIdentifierColumnName]?.trim());\n if (missingCoreId.length) {\n const rowNumbers = missingCoreId\n .map(([, i]) => i + 2) // +2 to account for header row and 0-indexing\n .join(', ');\n throw new Error(\n `The following rows are missing the required \"${coreIdentifierColumnName}\" column: ${rowNumbers}`,\n );\n }\n }\n\n // Duration provided by CLI is in ms; GraphQL expects seconds\n const expiresInSeconds = Math.max(1, Math.floor(duration / 1000));\n\n // Build inputs for GraphQL\n const inputs = rows.map((r, index): PreferenceAccessTokenInputWithIndex => {\n const email = r[emailColumnName].trim();\n const coreIdentifier = coreIdentifierColumnName\n ? r[coreIdentifierColumnName]?.trim()\n : undefined;\n const scopes = [SombraStandardScope.PreferenceManagement];\n return {\n subjectType,\n scopes,\n expiresIn: expiresInSeconds,\n email,\n ...(coreIdentifier ? { coreIdentifier } : {}),\n index,\n };\n });\n\n // Progress bar\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n progressBar.start(inputs.length, 0);\n\n // Kick off token creation (batched internally)\n const t0 = Date.now();\n const results = await createPreferenceAccessTokens(\n client,\n inputs,\n (progress) => {\n progressBar.update(progress);\n },\n );\n progressBar.update(inputs.length);\n progressBar.stop();\n\n // Prepare output CSV rows\n const outputRows = results.map(({ accessToken, input }) => {\n if (typeof input.index !== 'number') {\n throw new Error('Internal error: missing input index.');\n }\n return {\n ...rows[input.index],\n token: accessToken,\n };\n });\n\n logger.info(colors.magenta(`Writing access tokens to file \"${file}\"...`));\n await writeCsv(file, outputRows, true);\n\n const totalTimeSec = Math.round((Date.now() - t0) / 1000);\n logger.info(\n colors.green(\n `Successfully generated ${results.length} access tokens to \"${file}\" in ${totalTimeSec}s!`,\n ),\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n logger.error(\n colors.red(\n `An error occurred while generating access tokens: ${\n err?.message || String(err)\n }`,\n ),\n );\n this.process.exit(1);\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkKUBXRT3Vcjs = require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.cjs');async function d({auth:o,actions:r,origins:i,silentModeBefore:n,createdAtBefore:s,createdAtAfter:a,transcendUrl:c,concurrency:p}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkKUBXRT3Vcjs.Cf.call(void 0, {transcendUrl:c,requestActions:r,auth:o,requestOrigins:i,concurrency:p,silentModeBefore:n,createdAtBefore:s,createdAtAfter:a})}exports.approve = d;
|
|
2
|
+
//# sourceMappingURL=impl-SVPD3IHV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-SVPD3IHV.cjs","../src/commands/request/approve/impl.ts"],"names":["approve","auth","actions","origins","silentModeBefore","createdAtBefore","createdAtAfter","transcendUrl","concurrency","doneInputValidation","approvePrivacyRequests"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCiBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,YAAA,CAAAH,CAAAA,CACA,cAAA,CAAgBL,CAAAA,CAChB,IAAA,CAAAD,CAAAA,CACA,cAAA,CAAgBE,CAAAA,CAChB,WAAA,CAAAK,CAAAA,CACA,gBAAA,CAAAJ,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CACF,CAAC,CACH,CAAA,oBAAA","file":"/home/runner/work/cli/cli/dist/impl-SVPD3IHV.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { RequestAction, RequestOrigin } from '@transcend-io/privacy-types';\nimport { approvePrivacyRequests } from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface ApproveCommandFlags {\n auth: string;\n actions: RequestAction[];\n origins?: RequestOrigin[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function approve(\n this: LocalContext,\n {\n auth,\n actions,\n origins,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n transcendUrl,\n concurrency,\n }: ApproveCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await approvePrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n requestOrigins: origins,\n concurrency,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n });\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
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 _chunkJFZPP4VVcjs = require('./chunk-JFZPP4VV.cjs');var _chunkK4TIJ3VMcjs = require('./chunk-K4TIJ3VM.cjs');require('./chunk-ECGHWDVP.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkKUBXRT3Vcjs = require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkEYOQLGDVcjs = require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.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=_chunkKUBXRT3Vcjs.wc.call(void 0, i,c);try{return!await _chunkKUBXRT3Vcjs.vg.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 _chunkK4TIJ3VMcjs.b.call(void 0, h),N=_chunkKUBXRT3Vcjs.Uf.call(void 0, y),p;if(Array.isArray(o)&&_fs.lstatSync.call(void 0, i).isDirectory()?p=_chunkK4TIJ3VMcjs.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=_chunkJFZPP4VVcjs.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 ${_chunkEYOQLGDVcjs.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
2
|
|
|
3
3
|
${a}Attempting to push configuration...
|
|
4
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 ${
|
|
6
|
-
//# sourceMappingURL=impl-
|
|
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 ${_chunkEYOQLGDVcjs.p}`)),this.process.exit(1))}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced yaml file to Transcend! View at ${_chunkEYOQLGDVcjs.p}`))}exports.push = U;
|
|
6
|
+
//# sourceMappingURL=impl-UC5CCT6E.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-UC5CCT6E.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-UC5CCT6E.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"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkJFZPP4VVcjs = require('./chunk-JFZPP4VV.cjs');var _chunkRNZ72QMScjs = require('./chunk-RNZ72QMS.cjs');require('./chunk-L7Z4PFRC.cjs');var _chunkK4TIJ3VMcjs = require('./chunk-K4TIJ3VM.cjs');require('./chunk-ECGHWDVP.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.cjs');var _path = require('path');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _fs = require('fs');function M({consentManagerYmlFolder:s,output:n}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),(!_fs.existsSync.call(void 0, s)||!_fs.lstatSync.call(void 0, s).isDirectory())&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Folder does not exist: "${s}"`)),this.process.exit(1));let f=_chunkK4TIJ3VMcjs.c.call(void 0, s).map(i=>{let{"consent-manager":u}=_chunkJFZPP4VVcjs.d.call(void 0, _path.join.call(void 0, s,i));return{name:i,input:u}}),e=_chunkRNZ72QMScjs.h.call(void 0, f);_chunkJFZPP4VVcjs.e.call(void 0, n,{"business-entities":e}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${e.length} business entities to file "${n}"`))}exports.consentManagersToBusinessEntities = M;
|
|
2
|
+
//# sourceMappingURL=impl-UZPP5VK5.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-UZPP5VK5.cjs","../src/commands/inventory/consent-managers-to-business-entities/impl.ts"],"names":["consentManagersToBusinessEntities","consentManagerYmlFolder","output","doneInputValidation","existsSync","lstatSync","logger","colors","inputs","listFiles","directory","consentManager","readTranscendYaml","join","businessEntities","writeTranscendYaml"],"mappings":"AAAA,iOAA+C,wDAAyC,gCAA6B,wDAAyC,gCAA6B,wDAAyC,gCAA6B,gCAA6B,wDAAyC,gCAA6B,gCAA6B,4BCO5W,gFAEF,wBAEmB,SAQtBA,CAAAA,CAEd,CACE,uBAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CACF,CAAA,CACM,CACNC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAAA,CAInC,CAACC,4BAAAA,CAAkC,CAAA,EACnC,CAACC,2BAAAA,CAAiC,CAAA,CAAE,WAAA,CAAY,CAAA,CAAA,EAAA,CAEhDC,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CAAI,CAAA,wBAAA,EAA2BN,CAAuB,CAAA,CAAA,CAAG,CAClE,CAAA,CACA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAIrB,IAAMO,CAAAA,CAASC,iCAAAA,CAAiC,CAAA,CAAE,GAAA,CAAKC,CAAAA,EAAc,CACnE,GAAM,CAAE,iBAAA,CAAmBC,CAAe,CAAA,CAAIC,iCAAAA,wBAC5CC,CAAKZ,CAAyBS,CAAS,CACzC,CAAA,CACA,MAAO,CAAE,IAAA,CAAMA,CAAAA,CAAW,KAAA,CAAOC,CAAe,CAClD,CAAC,CAAA,CAGKG,CAAAA,CAAmBd,iCAAAA,CAA8C,CAAA,CAGvEe,iCAAAA,CAAmBb,CAAQ,CACzB,mBAAA,CAAqBY,CACvB,CAAC,CAAA,CAEDR,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,mBAAA,EAAsBO,CAAAA,CAAiB,MAAM,CAAA,4BAAA,EAA+BZ,CAAM,CAAA,CAAA,CACpF,CACF,CACF,CAAA,8CAAA","file":"/home/runner/work/cli/cli/dist/impl-UZPP5VK5.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { listFiles } from '../../../lib/api-keys';\nimport { consentManagersToBusinessEntities as consentManagersToBusinessEntitiesHelper } from '../../../lib/consent-manager';\nimport {\n readTranscendYaml,\n writeTranscendYaml,\n} from '../../../lib/readTranscendYaml';\nimport { join } from 'node:path';\n\nimport colors from 'colors';\nimport { logger } from '../../../logger';\nimport { existsSync, lstatSync } from 'node:fs';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface ConsentManagersToBusinessEntitiesCommandFlags {\n consentManagerYmlFolder: string;\n output: string;\n}\n\nexport function consentManagersToBusinessEntities(\n this: LocalContext,\n {\n consentManagerYmlFolder,\n output,\n }: ConsentManagersToBusinessEntitiesCommandFlags,\n): void {\n doneInputValidation(this.process.exit);\n\n // Ensure folder is passed\n if (\n !existsSync(consentManagerYmlFolder) ||\n !lstatSync(consentManagerYmlFolder).isDirectory()\n ) {\n logger.error(\n colors.red(`Folder does not exist: \"${consentManagerYmlFolder}\"`),\n );\n this.process.exit(1);\n }\n\n // Read in each consent manager configuration\n const inputs = listFiles(consentManagerYmlFolder).map((directory) => {\n const { 'consent-manager': consentManager } = readTranscendYaml(\n join(consentManagerYmlFolder, directory),\n );\n return { name: directory, input: consentManager };\n });\n\n // Convert to business entities\n const businessEntities = consentManagersToBusinessEntitiesHelper(inputs);\n\n // write to disk\n writeTranscendYaml(output, {\n 'business-entities': businessEntities,\n });\n\n logger.info(\n colors.green(\n `Successfully wrote ${businessEntities.length} business entities to file \"${output}\"`,\n ),\n );\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkKUBXRT3Vcjs = require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.cjs');async function h({auth:i,enricherId:s,actions:o,requestEnricherStatuses:a,requestIds:c,createdAtBefore:e,createdAtAfter:t,concurrency:u,transcendUrl:d}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkKUBXRT3Vcjs.Mf.call(void 0, {auth:i,enricherId:s,requestActions:o,requestEnricherStatuses:a,requestIds:c,createdAtBefore:e?new Date(e):void 0,createdAtAfter:t?new Date(t):void 0,concurrency:u,transcendUrl:d})}exports.enricherRestart = h;
|
|
2
|
+
//# sourceMappingURL=impl-VZ6NJDAV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-VZ6NJDAV.cjs","../src/commands/request/enricher-restart/impl.ts"],"names":["enricherRestart","auth","enricherId","actions","requestEnricherStatuses","requestIds","createdAtBefore","createdAtAfter","concurrency","transcendUrl","doneInputValidation","bulkRetryEnrichers"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCoBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,IAAA,CAAAV,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAgBC,CAAAA,CAChB,uBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,eAAA,CAAiBC,CAAAA,CAAkB,IAAI,IAAA,CAAKA,CAAe,CAAA,CAAI,KAAA,CAAA,CAC/D,cAAA,CAAgBC,CAAAA,CAAiB,IAAI,IAAA,CAAKA,CAAc,CAAA,CAAI,KAAA,CAAA,CAC5D,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAC,CACH,CAAA,4BAAA","file":"/home/runner/work/cli/cli/dist/impl-VZ6NJDAV.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { bulkRetryEnrichers } from '../../../lib/requests';\nimport type {\n RequestAction,\n RequestEnricherStatus,\n} from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface EnricherRestartCommandFlags {\n auth: string;\n enricherId: string;\n actions?: RequestAction[];\n requestEnricherStatuses?: RequestEnricherStatus[];\n transcendUrl: string;\n concurrency: number;\n requestIds?: string[];\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n}\n\nexport async function enricherRestart(\n this: LocalContext,\n {\n auth,\n enricherId,\n actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore,\n createdAtAfter,\n concurrency,\n transcendUrl,\n }: EnricherRestartCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await bulkRetryEnrichers({\n auth,\n enricherId,\n requestActions: actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,\n createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,\n concurrency,\n transcendUrl,\n });\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
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
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
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 _chunkYKGS253Bcjs = require('./chunk-YKGS253B.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkKUBXRT3Vcjs = require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var W=["userId","timestamp","partition","decryptionStatus","updatedAt","usp","gpp","tcf","airgapVersion","metadata","metadataTimestamp"];async function Y({auth:f,partition:o,sombraAuth:V,file:r,transcendUrl:l,timestampBefore:d,timestampAfter:u,updatedBefore:s,updatedAfter:i,identifiers:Q=[],concurrency:g,shouldChunk:C,windowConcurrency:B,maxChunks:G,maxLookbackDays:H}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let h=await _chunkKUBXRT3Vcjs.xc.call(void 0, l,f,V),y=_chunkKUBXRT3Vcjs.wc.call(void 0, l,f),P=Q.map(e=>{if(!e.includes(":"))return{name:"email",value:e};let[t,m]=e.split(":");return{name:t,value:m}}),S={...d?{timestampBefore:d.toISOString()}:{},...u?{timestampAfter:u.toISOString()}:{},...i||s?{system:{...s?{updatedBefore:s.toISOString()}:{},...i?{updatedAfter:i.toISOString()}:{}}}:{},...P.length>0?{identifiers:P}:{}};_chunkZUNVPK23cjs.a.info(`Fetching consent preferences from partition ${o}, using mode=${C?"chunked-stream":"paged-stream"}...`),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Preparing CSV at: ${r}`));let[w,_]=await Promise.all([_chunkKUBXRT3Vcjs.gd.call(void 0, y),_chunkKUBXRT3Vcjs.tg.call(void 0, y)]),j=_.map(e=>e.name),E=Array.from(new Set(w.flatMap(e=>_nullishCoalesce(_optionalChain([e, 'access', _2 => _2.topics, 'optionalAccess', _3 => _3.map, 'call', _4 => _4(t=>`${e.trackingType}_${t.slug}`)]), () => ([]))))).sort((e,t)=>e.localeCompare(t)),K=Array.from(new Set(w.map(e=>e.trackingType))).sort((e,t)=>e.localeCompare(t)),M=[...W,...j,...K,...E],a=null,I=!1,b=e=>{if(!e||e.length===0)return;let t=e.map(_chunkYKGS253Bcjs.b);if(!I){let m=Object.keys(_nullishCoalesce(t[0], () => ({}))),O=new Set;a=[...M,...m].filter(c=>c===void 0||O.has(c)?!1:(O.add(c),!0)),_chunkKUBXRT3Vcjs.mg.call(void 0, r,a),I=!0}_chunkKUBXRT3Vcjs.ng.call(void 0, r,t,a)};if(C){await _chunkYKGS253Bcjs.c.call(void 0, h,{partition:o,filterBy:S,limit:g,windowConcurrency:B,maxChunks:G,maxLookbackDays:H,onItems:e=>b(e)}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Finished writing CSV to ${r}`));return}await _chunkYKGS253Bcjs.d.call(void 0, h,{partition:o,filterBy:S,limit:g,onItems:e=>b(e)}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Finished writing CSV to ${r}`))}exports.pullConsentPreferences = Y;
|
|
2
|
+
//# sourceMappingURL=impl-W35DMTQV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-W35DMTQV.cjs","../src/commands/consent/pull-consent-preferences/impl.ts"],"names":["CORE_COLS","pullConsentPreferences","auth","partition","sombraAuth","file","transcendUrl","timestampBefore","timestampAfter","updatedBefore","updatedAfter","identifiers","concurrency","shouldChunk","windowConcurrency","maxChunks","maxLookbackDays","doneInputValidation","sombra","createSombraGotInstance","client","buildTranscendGraphQLClient","parsedIdentifiers","identifier","name","value","filterBy","logger","colors"],"mappings":"AAAA,y0BAAsD,wDAAyC,wDAAkF,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gFCC9R,IAqBbA,CAAAA,CAAY,CAChB,QAAA,CACA,WAAA,CACA,WAAA,CACA,kBAAA,CACA,WAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,eAAA,CACA,UAAA,CACA,mBACF,CAAA,CAoBA,MAAA,SAAsBC,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,CAAC,CAAA,CACf,WAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAMC,CAAAA,CAAS,MAAMC,kCAAAA,CAAwBb,CAAcJ,CAAAA,CAAME,CAAU,CAAA,CACrEgB,CAAAA,CAASC,kCAAAA,CAA4Bf,CAAcJ,CAAI,CAAA,CAGvDoB,CAAAA,CAAoBX,CAAAA,CAAY,GAAA,CACnCY,CAAAA,EAAqC,CACpC,EAAA,CAAI,CAACA,CAAAA,CAAW,QAAA,CAAS,GAAG,CAAA,CAC1B,MAAO,CACL,IAAA,CAAM,OAAA,CACN,KAAA,CAAOA,CACT,CAAA,CAEF,GAAM,CAACC,CAAAA,CAAMC,CAAK,CAAA,CAAIF,CAAAA,CAAW,KAAA,CAAM,GAAG,CAAA,CAC1C,MAAO,CAAE,IAAA,CAAAC,CAAAA,CAAM,KAAA,CAAAC,CAAM,CACvB,CACF,CAAA,CAGMC,CAAAA,CAAW,CACf,GAAInB,CAAAA,CACA,CAAE,eAAA,CAAiBA,CAAAA,CAAgB,WAAA,CAAY,CAAE,CAAA,CACjD,CAAC,CAAA,CACL,GAAIC,CAAAA,CAAiB,CAAE,cAAA,CAAgBA,CAAAA,CAAe,WAAA,CAAY,CAAE,CAAA,CAAI,CAAC,CAAA,CACzE,GAAIE,CAAAA,EAAgBD,CAAAA,CAChB,CACE,MAAA,CAAQ,CACN,GAAIA,CAAAA,CACA,CAAE,aAAA,CAAeA,CAAAA,CAAc,WAAA,CAAY,CAAE,CAAA,CAC7C,CAAC,CAAA,CACL,GAAIC,CAAAA,CACA,CAAE,YAAA,CAAcA,CAAAA,CAAa,WAAA,CAAY,CAAE,CAAA,CAC3C,CAAC,CACP,CACF,CAAA,CACA,CAAC,CAAA,CACL,GAAIY,CAAAA,CAAkB,MAAA,CAAS,CAAA,CAAI,CAAE,WAAA,CAAaA,CAAkB,CAAA,CAAI,CAAC,CAC3E,CAAA,CAEAK,mBAAAA,CAAO,IAAA,CACL,CAAA,4CAAA,EAA+CxB,CAAS,CAAA,aAAA,EACtDU,CAAAA,CAAc,gBAAA,CAAmB,cACnC,CAAA,GAAA,CACF,CAAA,CAEAc,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,CAAA,kBAAA,EAAqBvB,CAAI,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/impl-W35DMTQV.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\n\nimport {\n fetchConsentPreferences,\n fetchConsentPreferencesChunked,\n transformPreferenceRecordToCsv,\n type PreferenceIdentifier,\n} from '../../../lib/preference-management';\nimport {\n buildTranscendGraphQLClient,\n createSombraGotInstance,\n fetchAllIdentifiers,\n fetchAllPurposesAndPreferences,\n} from '../../../lib/graphql';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { logger } from '../../../logger';\nimport { initCsvFile, appendCsvRowsOrdered } from '../../../lib/helpers';\nimport type { PreferenceQueryResponseItem } from '@transcend-io/privacy-types';\n\n// Known “core” columns your transformer usually produces up front.\n// Leave this list conservative; we’ll still union with transformer keys.\nconst CORE_COLS = [\n 'userId',\n 'timestamp',\n 'partition',\n 'decryptionStatus',\n 'updatedAt',\n 'usp',\n 'gpp',\n 'tcf',\n 'airgapVersion',\n 'metadata',\n 'metadataTimestamp',\n];\n\nexport interface PullConsentPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n file: string;\n transcendUrl: string;\n timestampBefore?: Date;\n timestampAfter?: Date;\n updatedBefore?: Date;\n updatedAfter?: Date;\n identifiers?: string[];\n concurrency: number;\n shouldChunk: boolean;\n windowConcurrency: number;\n maxChunks: number;\n maxLookbackDays: number;\n}\n\nexport async function pullConsentPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n file,\n transcendUrl,\n timestampBefore,\n timestampAfter,\n updatedBefore,\n updatedAfter,\n identifiers = [],\n concurrency,\n shouldChunk,\n windowConcurrency,\n maxChunks,\n maxLookbackDays,\n }: PullConsentPreferencesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Create sombra instance to communicate with\n const sombra = await createSombraGotInstance(transcendUrl, auth, sombraAuth);\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Identifiers are key:value, parse to PreferenceIdentifier[]\n const parsedIdentifiers = identifiers.map(\n (identifier): PreferenceIdentifier => {\n if (!identifier.includes(':')) {\n return {\n name: 'email',\n value: identifier,\n };\n }\n const [name, value] = identifier.split(':');\n return { name, value };\n },\n );\n\n // Build filter\n const filterBy = {\n ...(timestampBefore\n ? { timestampBefore: timestampBefore.toISOString() }\n : {}),\n ...(timestampAfter ? { timestampAfter: timestampAfter.toISOString() } : {}),\n ...(updatedAfter || updatedBefore\n ? {\n system: {\n ...(updatedBefore\n ? { updatedBefore: updatedBefore.toISOString() }\n : {}),\n ...(updatedAfter\n ? { updatedAfter: updatedAfter.toISOString() }\n : {}),\n },\n }\n : {}),\n ...(parsedIdentifiers.length > 0 ? { identifiers: parsedIdentifiers } : {}),\n };\n\n logger.info(\n `Fetching consent preferences from partition ${partition}, using mode=${\n shouldChunk ? 'chunked-stream' : 'paged-stream'\n }...`,\n );\n\n logger.info(colors.magenta(`Preparing CSV at: ${file}`));\n\n // Fetch full sets (purposes+topics, identifiers) to ensure header completeness\n const [purposesWithTopics, allIdentifiers] = await Promise.all([\n fetchAllPurposesAndPreferences(client),\n fetchAllIdentifiers(client),\n ]);\n\n // Identifier columns: exactly the identifier names\n const identifierCols = allIdentifiers.map((i) => i.name);\n\n // Preference topic columns: topic names (de-duped)\n const topicCols = Array.from(\n new Set(\n purposesWithTopics.flatMap(\n (p) => p.topics?.map((t) => `${p.trackingType}_${t.slug}`) ?? [],\n ),\n ),\n ).sort((a, b) => a.localeCompare(b));\n\n // Some setups also want a per-purpose boolean column (e.g., “Email”, “Sms”).\n // If your transformer includes those, list them here, derived from purposes:\n const purposeCols = Array.from(\n new Set(purposesWithTopics.map((p) => p.trackingType)),\n ).sort((a, b) => a.localeCompare(b));\n\n // Build the complete header skeleton.\n // We’ll still union with the first transformed row’s keys to be safe.\n const completeHeadersList = [\n ...CORE_COLS,\n ...identifierCols,\n ...purposeCols,\n ...topicCols,\n ];\n\n // Lazily initialize CSV header order from the first transformed row.\n let headerOrder: string[] | null = null;\n let wroteHeader = false;\n const writeRows = (items: PreferenceQueryResponseItem[]): void => {\n if (!items || items.length === 0) return;\n const rows = items.map(transformPreferenceRecordToCsv);\n if (!wroteHeader) {\n const firstKeys = Object.keys(rows[0] ?? {});\n const seen = new Set<string>();\n headerOrder = [...completeHeadersList, ...firstKeys].filter((k) => {\n if (k === undefined) return false;\n if (seen.has(k)) return false;\n seen.add(k);\n return true;\n });\n initCsvFile(file, headerOrder);\n wroteHeader = true;\n }\n appendCsvRowsOrdered(file, rows, headerOrder!);\n };\n\n if (shouldChunk) {\n // Stream via chunked fetcher with page callback\n await fetchConsentPreferencesChunked(sombra, {\n partition,\n filterBy,\n limit: concurrency,\n windowConcurrency,\n maxChunks,\n maxLookbackDays,\n onItems: (items) => writeRows(items),\n });\n\n logger.info(colors.green(`Finished writing CSV to ${file}`));\n return;\n }\n\n // Non-chunked path: still stream page-by-page via onItems (no in-memory accumulation)\n await fetchConsentPreferences(sombra, {\n partition,\n filterBy,\n limit: concurrency, // page size (API max 50 enforced internally)\n onItems: (items) => writeRows(items),\n });\n\n logger.info(colors.green(`Finished writing CSV to ${file}`));\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkRNZ72QMScjs = require('./chunk-RNZ72QMS.cjs');require('./chunk-L7Z4PFRC.cjs');var _chunkK4TIJ3VMcjs = require('./chunk-K4TIJ3VM.cjs');require('./chunk-ECGHWDVP.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.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 _chunkK4TIJ3VMcjs.b.call(void 0, d);typeof t=="string"?(await _chunkRNZ72QMScjs.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 _chunkRNZ72QMScjs.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-XHO6WQ2I.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-XHO6WQ2I.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-XHO6WQ2I.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"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkRNZ72QMScjs = require('./chunk-RNZ72QMS.cjs');require('./chunk-L7Z4PFRC.cjs');var _chunkK4TIJ3VMcjs = require('./chunk-K4TIJ3VM.cjs');require('./chunk-ECGHWDVP.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _fs = require('fs');async function L({auth:d,xdiLocation:c,file:o,removeIpAddresses:l,domainBlockList:i,xdiAllowedCommands:a,transcendUrl:m}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let p=await _chunkK4TIJ3VMcjs.b.call(void 0, d),{syncGroups:f,html:u}=await _chunkRNZ72QMScjs.g.call(void 0, p,{xdiLocation:c,transcendUrl:m,removeIpAddresses:l,domainBlockList:i.length>0?i:void 0,xdiAllowedCommands:a});_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully constructed sync endpoint for sync groups: ${JSON.stringify(f,null,2)}`)),_fs.writeFileSync.call(void 0, o,u),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Wrote configuration to file "${o}"!`))}exports.buildXdiSyncEndpoint = L;
|
|
2
|
+
//# sourceMappingURL=impl-YHBNKYSL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-YHBNKYSL.cjs","../src/commands/consent/build-xdi-sync-endpoint/impl.ts"],"names":["buildXdiSyncEndpoint","auth","xdiLocation","file","removeIpAddresses","domainBlockList","xdiAllowedCommands","transcendUrl","doneInputValidation","apiKeyOrList","validateTranscendAuth","syncGroups","html","logger","colors"],"mappings":"AAAA,iOAAwC,gCAA6B,wDAAyC,gCAA6B,wDAAyC,gCAA6B,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gFCE9T,wBACW,MAe9B,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,kBAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAMC,CAAAA,CAAe,MAAMC,iCAAAA,CAA0B,CAAA,CAG/C,CAAE,UAAA,CAAAC,CAAAA,CAAY,IAAA,CAAAC,CAAK,CAAA,CAAI,MAAMZ,iCAAAA,CAA2BS,CAAc,CAC1E,WAAA,CAAAP,CAAAA,CACA,YAAA,CAAAK,CAAAA,CACA,iBAAA,CAAAH,CAAAA,CACA,eAAA,CAAiBC,CAAAA,CAAgB,MAAA,CAAS,CAAA,CAAIA,CAAAA,CAAkB,KAAA,CAAA,CAChE,kBAAA,CAAAC,CACF,CAAC,CAAA,CAGDO,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,wDAAA,EAA2D,IAAA,CAAK,SAAA,CAC9DH,CAAAA,CACA,IAAA,CACA,CACF,CAAC,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/impl-YHBNKYSL.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { writeFileSync } from 'node:fs';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { buildXdiSyncEndpoint as buildXdiSyncEndpointHelper } from '../../../lib/consent-manager';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface BuildXdiSyncEndpointCommandFlags {\n auth: string;\n xdiLocation: string;\n file: string;\n removeIpAddresses: boolean;\n domainBlockList: string[];\n xdiAllowedCommands: string;\n transcendUrl: string;\n}\n\nexport async function buildXdiSyncEndpoint(\n this: LocalContext,\n {\n auth,\n xdiLocation,\n file,\n removeIpAddresses,\n domainBlockList,\n xdiAllowedCommands,\n transcendUrl,\n }: BuildXdiSyncEndpointCommandFlags,\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 // Build the sync endpoint\n const { syncGroups, html } = await buildXdiSyncEndpointHelper(apiKeyOrList, {\n xdiLocation,\n transcendUrl,\n removeIpAddresses,\n domainBlockList: domainBlockList.length > 0 ? domainBlockList : undefined,\n xdiAllowedCommands,\n });\n\n // Log success\n logger.info(\n colors.green(\n `Successfully constructed sync endpoint for sync groups: ${JSON.stringify(\n syncGroups,\n null,\n 2,\n )}`,\n ),\n );\n\n // Write to disk\n writeFileSync(file, html);\n logger.info(colors.green(`Wrote configuration to file \"${file}\"!`));\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkYKGS253Bcjs = require('./chunk-YKGS253B.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkKUBXRT3Vcjs = require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.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 _chunkYKGS253Bcjs.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:_chunkKUBXRT3Vcjs.oc.call(void 0, P),forceTriggerWorkflows:y})},{concurrency:$})}exports.uploadPreferences = A;
|
|
2
|
+
//# sourceMappingURL=impl-YJ6UUT4D.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-YJ6UUT4D.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-YJ6UUT4D.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"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkI7PFP5VBcjs = require('./chunk-I7PFP5VB.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkKUBXRT3Vcjs = require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _iots = require('io-ts'); var t = _interopRequireWildcard(_iots);var c=t.type({"Request Id":t.string});async function q({auth:i,dataSiloId:m,file:o,transcendUrl:n}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${o}" from disk`));let d=_chunkKUBXRT3Vcjs.rc.call(void 0, o,c);await _chunkI7PFP5VBcjs.f.call(void 0, {requestIds:d.map(l=>l["Request Id"]),transcendUrl:n,auth:i,dataSiloId:m})}exports.markRequestDataSilosCompleted = q;
|
|
2
|
+
//# sourceMappingURL=impl-YWJCIRTP.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-YWJCIRTP.cjs","../src/commands/request/system/mark-request-data-silos-completed/impl.ts"],"names":["RequestIdRow","markRequestDataSilosCompleted","auth","dataSiloId","file","transcendUrl","doneInputValidation","logger","colors","activeResults","readCsv","markRequestDataSiloIdsCompleted","request"],"mappings":"AAAA,mfAAwC,wDAAyC,wDAA0C,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gFCCxO,qEACA,IAObA,CAAAA,CAAiB,CAAA,CAAA,IAAA,CAAK,CAC1B,YAAA,CAAgB,CAAA,CAAA,MAClB,CAAC,CAAA,CASD,MAAA,SAAsBC,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErCC,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,CAAA,SAAA,EAAYJ,CAAI,CAAA,WAAA,CAAa,CAAC,CAAA,CACzD,IAAMK,CAAAA,CAAgBC,kCAAAA,CAAQN,CAAMJ,CAAY,CAAA,CAEhD,MAAMW,iCAAAA,CACJ,UAAA,CAAYF,CAAAA,CAAc,GAAA,CAAKG,CAAAA,EAAYA,CAAAA,CAAQ,YAAY,CAAC,CAAA,CAChE,YAAA,CAAAP,CAAAA,CACA,IAAA,CAAAH,CAAAA,CACA,UAAA,CAAAC,CACF,CAAC,CACH,CAAA,0CAAA","file":"/home/runner/work/cli/cli/dist/impl-YWJCIRTP.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../../context';\nimport colors from 'colors';\nimport * as t from 'io-ts';\n\nimport { logger } from '../../../../logger';\nimport { markRequestDataSiloIdsCompleted } from '../../../../lib/cron';\nimport { readCsv } from '../../../../lib/requests';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation';\n\nconst RequestIdRow = t.type({\n 'Request Id': t.string,\n});\n\nexport interface MarkRequestDataSilosCompletedCommandFlags {\n auth: string;\n dataSiloId: string;\n file: string;\n transcendUrl: string;\n}\n\nexport async function markRequestDataSilosCompleted(\n this: LocalContext,\n {\n auth,\n dataSiloId,\n file,\n transcendUrl,\n }: MarkRequestDataSilosCompletedCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n logger.info(colors.magenta(`Reading \"${file}\" from disk`));\n const activeResults = readCsv(file, RequestIdRow);\n\n await markRequestDataSiloIdsCompleted({\n requestIds: activeResults.map((request) => request['Request Id']),\n transcendUrl,\n auth,\n dataSiloId,\n });\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var
|
|
2
|
-
//# sourceMappingURL=impl-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkKUBXRT3Vcjs = require('./chunk-KUBXRT3V.cjs');require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-EYOQLGDV.cjs');require('./chunk-Q7I37FJV.cjs');async function c({auth:i,transcendUrl:n,identifierNames:r,actions:o=[]}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkKUBXRT3Vcjs.Qf.call(void 0, {requestActions:o,transcendUrl:n,auth:i,identifierNames:r})}exports.rejectUnverifiedIdentifiers = c;
|
|
2
|
+
//# sourceMappingURL=impl-ZTZHVQYY.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZTZHVQYY.cjs","../src/commands/request/reject-unverified-identifiers/impl.ts"],"names":["rejectUnverifiedIdentifiers","auth","transcendUrl","identifierNames","actions","doneInputValidation","removeUnverifiedRequestIdentifiers"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCYtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CAAU,CAAC,CACb,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,cAAA,CAAgBF,CAAAA,CAChB,YAAA,CAAAF,CAAAA,CACA,IAAA,CAAAD,CAAAA,CACA,eAAA,CAAAE,CACF,CAAC,CACH,CAAA,wCAAA","file":"/home/runner/work/cli/cli/dist/impl-ZTZHVQYY.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { removeUnverifiedRequestIdentifiers } from '../../../lib/requests';\nimport type { RequestAction } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface RejectUnverifiedIdentifiersCommandFlags {\n auth: string;\n identifierNames: string[];\n actions?: RequestAction[];\n transcendUrl: string;\n}\n\nexport async function rejectUnverifiedIdentifiers(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n identifierNames,\n actions = [],\n }: RejectUnverifiedIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await removeUnverifiedRequestIdentifiers({\n requestActions: actions,\n transcendUrl,\n auth,\n identifierNames,\n });\n}\n"]}
|