@transcend-io/cli 7.0.2 → 7.0.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 +1816 -158
- 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-3ZKZCSGD.cjs +2847 -0
- package/dist/chunk-3ZKZCSGD.cjs.map +1 -0
- package/dist/{chunk-QXKWSBYR.cjs → chunk-6DWFLWWT.cjs} +2 -2
- package/dist/{chunk-QXKWSBYR.cjs.map → chunk-6DWFLWWT.cjs.map} +1 -1
- package/dist/chunk-6FGYCQAQ.cjs +2 -0
- package/dist/chunk-6FGYCQAQ.cjs.map +1 -0
- package/dist/chunk-BF5T3SGE.cjs +3 -0
- package/dist/chunk-BF5T3SGE.cjs.map +1 -0
- package/dist/chunk-E3CF3RKX.cjs +2 -0
- package/dist/chunk-E3CF3RKX.cjs.map +1 -0
- package/dist/chunk-EVZLUL56.cjs +75 -0
- package/dist/chunk-EVZLUL56.cjs.map +1 -0
- package/dist/{chunk-W5T3VHKD.cjs → chunk-FPXWBUHS.cjs} +2 -2
- package/dist/{chunk-W5T3VHKD.cjs.map → chunk-FPXWBUHS.cjs.map} +1 -1
- package/dist/chunk-G2T7YVBG.cjs +113 -0
- package/dist/chunk-G2T7YVBG.cjs.map +1 -0
- package/dist/{chunk-WAYG2MDL.cjs → chunk-IG65EYJY.cjs} +2 -2
- package/dist/{chunk-WAYG2MDL.cjs.map → chunk-IG65EYJY.cjs.map} +1 -1
- package/dist/chunk-L7YT5ETS.cjs +2 -0
- package/dist/{chunk-VFP6EKTE.cjs.map → chunk-L7YT5ETS.cjs.map} +1 -1
- package/dist/{chunk-U6G3J6VJ.cjs → chunk-R4IKDXM5.cjs} +2 -2
- package/dist/{chunk-U6G3J6VJ.cjs.map → chunk-R4IKDXM5.cjs.map} +1 -1
- package/dist/chunk-TS5EYI4O.cjs +12 -0
- package/dist/chunk-TS5EYI4O.cjs.map +1 -0
- package/dist/chunk-WIXQSFS6.cjs +2 -0
- package/dist/chunk-WIXQSFS6.cjs.map +1 -0
- package/dist/chunk-WKCTKYN4.cjs +2 -0
- package/dist/chunk-WKCTKYN4.cjs.map +1 -0
- package/dist/chunk-Y4BWTFTX.cjs +15 -0
- package/dist/chunk-Y4BWTFTX.cjs.map +1 -0
- package/dist/{chunk-XHS3FR6L.cjs → chunk-YA5UZ3YM.cjs} +2 -2
- package/dist/{chunk-XHS3FR6L.cjs.map → chunk-YA5UZ3YM.cjs.map} +1 -1
- package/dist/impl-24MFRX5R.cjs +2 -0
- package/dist/impl-24MFRX5R.cjs.map +1 -0
- package/dist/impl-2G6FOZLU.cjs +2 -0
- package/dist/impl-2G6FOZLU.cjs.map +1 -0
- package/dist/impl-4EDFESYC.cjs +2 -0
- package/dist/impl-4EDFESYC.cjs.map +1 -0
- package/dist/impl-5FO2QEHJ.cjs +2 -0
- package/dist/impl-5FO2QEHJ.cjs.map +1 -0
- package/dist/impl-6B7JDOM5.cjs +3 -0
- package/dist/impl-6B7JDOM5.cjs.map +1 -0
- package/dist/impl-AUOR6D3Q.cjs +2 -0
- package/dist/impl-AUOR6D3Q.cjs.map +1 -0
- package/dist/impl-B5HQXUMH.cjs +2 -0
- package/dist/impl-B5HQXUMH.cjs.map +1 -0
- package/dist/impl-BNFADMTO.cjs +2 -0
- package/dist/impl-BNFADMTO.cjs.map +1 -0
- package/dist/impl-BPWMOF4U.cjs +2 -0
- package/dist/impl-BPWMOF4U.cjs.map +1 -0
- package/dist/impl-CNCC36M6.cjs +9 -0
- package/dist/impl-CNCC36M6.cjs.map +1 -0
- package/dist/impl-DBDL4Z23.cjs +2 -0
- package/dist/impl-DBDL4Z23.cjs.map +1 -0
- package/dist/impl-FG47LALL.cjs +2 -0
- package/dist/impl-FG47LALL.cjs.map +1 -0
- package/dist/impl-GNB7TDFU.cjs +2 -0
- package/dist/impl-GNB7TDFU.cjs.map +1 -0
- package/dist/impl-HB3R7YDP.cjs +2 -0
- package/dist/impl-HB3R7YDP.cjs.map +1 -0
- package/dist/impl-ICI7EQKE.cjs +2 -0
- package/dist/impl-ICI7EQKE.cjs.map +1 -0
- package/dist/impl-KOMGU55G.cjs +2 -0
- package/dist/impl-KOMGU55G.cjs.map +1 -0
- package/dist/impl-KP27234L.cjs +2 -0
- package/dist/impl-KP27234L.cjs.map +1 -0
- package/dist/impl-KZ2L66Q3.cjs +2 -0
- package/dist/impl-KZ2L66Q3.cjs.map +1 -0
- package/dist/impl-L3M67IGI.cjs +7 -0
- package/dist/{impl-JH4KIP5U.cjs.map → impl-L3M67IGI.cjs.map} +1 -1
- package/dist/impl-LTOV5CHF.cjs +2 -0
- package/dist/impl-LTOV5CHF.cjs.map +1 -0
- package/dist/impl-MO6AOGQM.cjs +2 -0
- package/dist/impl-MO6AOGQM.cjs.map +1 -0
- package/dist/impl-MPGDZ2M2.cjs +12 -0
- package/dist/impl-MPGDZ2M2.cjs.map +1 -0
- package/dist/impl-N54C7NPT.cjs +2 -0
- package/dist/impl-N54C7NPT.cjs.map +1 -0
- package/dist/impl-N6ML5K5S.cjs +2 -0
- package/dist/impl-N6ML5K5S.cjs.map +1 -0
- package/dist/impl-NKLZ5RG4.cjs +2 -0
- package/dist/impl-NKLZ5RG4.cjs.map +1 -0
- package/dist/impl-NNOWJ4Q4.cjs +6 -0
- package/dist/impl-NNOWJ4Q4.cjs.map +1 -0
- package/dist/impl-OLEEHZUA.cjs +6 -0
- package/dist/impl-OLEEHZUA.cjs.map +1 -0
- package/dist/impl-Q6EQYFKN.cjs +4 -0
- package/dist/impl-Q6EQYFKN.cjs.map +1 -0
- package/dist/impl-QHTG36G3.cjs +2 -0
- package/dist/impl-QHTG36G3.cjs.map +1 -0
- package/dist/impl-QITUCVEV.cjs +2 -0
- package/dist/impl-QITUCVEV.cjs.map +1 -0
- package/dist/impl-R3KCARSP.cjs +2 -0
- package/dist/impl-R3KCARSP.cjs.map +1 -0
- package/dist/impl-RSHVCDLE.cjs +2 -0
- package/dist/impl-RSHVCDLE.cjs.map +1 -0
- package/dist/impl-SNLQCZOR.cjs +2 -0
- package/dist/impl-SNLQCZOR.cjs.map +1 -0
- package/dist/impl-TPVA6DLJ.cjs +2 -0
- package/dist/impl-TPVA6DLJ.cjs.map +1 -0
- package/dist/impl-TVNBHOR4.cjs +2 -0
- package/dist/impl-TVNBHOR4.cjs.map +1 -0
- package/dist/impl-TWLWQSZG.cjs +2 -0
- package/dist/impl-TWLWQSZG.cjs.map +1 -0
- package/dist/impl-UKOAB6ED.cjs +2 -0
- package/dist/impl-UKOAB6ED.cjs.map +1 -0
- package/dist/impl-ZKBMWGMK.cjs +2 -0
- package/dist/impl-ZKBMWGMK.cjs.map +1 -0
- package/dist/impl-ZTWLYZZO.cjs +2 -0
- package/dist/impl-ZTWLYZZO.cjs.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -7
- package/package.json +2 -1
- package/dist/chunk-25UGE4YY.cjs +0 -12
- package/dist/chunk-25UGE4YY.cjs.map +0 -1
- package/dist/chunk-EG4L6YAJ.cjs +0 -2
- package/dist/chunk-EG4L6YAJ.cjs.map +0 -1
- package/dist/chunk-FPTEK7BG.cjs +0 -2
- package/dist/chunk-FPTEK7BG.cjs.map +0 -1
- package/dist/chunk-HAOVN3XO.cjs +0 -75
- package/dist/chunk-HAOVN3XO.cjs.map +0 -1
- package/dist/chunk-KWG56BUX.cjs +0 -2
- package/dist/chunk-KWG56BUX.cjs.map +0 -1
- package/dist/chunk-NOF6QHE4.cjs +0 -2843
- package/dist/chunk-NOF6QHE4.cjs.map +0 -1
- package/dist/chunk-QY37PK62.cjs +0 -94
- package/dist/chunk-QY37PK62.cjs.map +0 -1
- package/dist/chunk-SHV6R64J.cjs +0 -2
- package/dist/chunk-SHV6R64J.cjs.map +0 -1
- package/dist/chunk-VFP6EKTE.cjs +0 -2
- package/dist/chunk-XBHJO2OX.cjs +0 -3
- package/dist/chunk-XBHJO2OX.cjs.map +0 -1
- package/dist/impl-2DZFILID.cjs +0 -2
- package/dist/impl-2DZFILID.cjs.map +0 -1
- package/dist/impl-3CTVL4TA.cjs +0 -2
- package/dist/impl-3CTVL4TA.cjs.map +0 -1
- package/dist/impl-3IN6AV44.cjs +0 -9
- package/dist/impl-3IN6AV44.cjs.map +0 -1
- package/dist/impl-3PSE2WEI.cjs +0 -2
- package/dist/impl-3PSE2WEI.cjs.map +0 -1
- package/dist/impl-4XMTTFXK.cjs +0 -2
- package/dist/impl-4XMTTFXK.cjs.map +0 -1
- package/dist/impl-5L4G73JT.cjs +0 -2
- package/dist/impl-5L4G73JT.cjs.map +0 -1
- package/dist/impl-6NO74W36.cjs +0 -2
- package/dist/impl-6NO74W36.cjs.map +0 -1
- package/dist/impl-6TJRZGRQ.cjs +0 -2
- package/dist/impl-6TJRZGRQ.cjs.map +0 -1
- package/dist/impl-7FHT7P3V.cjs +0 -2
- package/dist/impl-7FHT7P3V.cjs.map +0 -1
- package/dist/impl-7KOXTJKC.cjs +0 -2
- package/dist/impl-7KOXTJKC.cjs.map +0 -1
- package/dist/impl-BESS7RG2.cjs +0 -2
- package/dist/impl-BESS7RG2.cjs.map +0 -1
- package/dist/impl-COCUOYKI.cjs +0 -2
- package/dist/impl-COCUOYKI.cjs.map +0 -1
- package/dist/impl-ELOMI7JW.cjs +0 -6
- package/dist/impl-ELOMI7JW.cjs.map +0 -1
- package/dist/impl-EUJEQGOT.cjs +0 -2
- package/dist/impl-EUJEQGOT.cjs.map +0 -1
- package/dist/impl-F3OOKCK6.cjs +0 -2
- package/dist/impl-F3OOKCK6.cjs.map +0 -1
- package/dist/impl-GH42XS6I.cjs +0 -2
- package/dist/impl-GH42XS6I.cjs.map +0 -1
- package/dist/impl-GSD2LS72.cjs +0 -2
- package/dist/impl-GSD2LS72.cjs.map +0 -1
- package/dist/impl-IIP3SXEB.cjs +0 -6
- package/dist/impl-IIP3SXEB.cjs.map +0 -1
- package/dist/impl-JD4LU2UP.cjs +0 -4
- package/dist/impl-JD4LU2UP.cjs.map +0 -1
- package/dist/impl-JH4KIP5U.cjs +0 -7
- package/dist/impl-JVXU24DF.cjs +0 -2
- package/dist/impl-JVXU24DF.cjs.map +0 -1
- package/dist/impl-KO4JL735.cjs +0 -2
- package/dist/impl-KO4JL735.cjs.map +0 -1
- package/dist/impl-L464FWQF.cjs +0 -2
- package/dist/impl-L464FWQF.cjs.map +0 -1
- package/dist/impl-LH2NCUFY.cjs +0 -2
- package/dist/impl-LH2NCUFY.cjs.map +0 -1
- package/dist/impl-LTL4WYPE.cjs +0 -2
- package/dist/impl-LTL4WYPE.cjs.map +0 -1
- package/dist/impl-MHML3KTM.cjs +0 -2
- package/dist/impl-MHML3KTM.cjs.map +0 -1
- package/dist/impl-NKUI2BXG.cjs +0 -2
- package/dist/impl-NKUI2BXG.cjs.map +0 -1
- package/dist/impl-NXTGH73U.cjs +0 -2
- package/dist/impl-NXTGH73U.cjs.map +0 -1
- package/dist/impl-OAPUUSOI.cjs +0 -2
- package/dist/impl-OAPUUSOI.cjs.map +0 -1
- package/dist/impl-OCJDYVIR.cjs +0 -2
- package/dist/impl-OCJDYVIR.cjs.map +0 -1
- package/dist/impl-PDWZ4O5W.cjs +0 -2
- package/dist/impl-PDWZ4O5W.cjs.map +0 -1
- package/dist/impl-Q2MH6BDT.cjs +0 -2
- package/dist/impl-Q2MH6BDT.cjs.map +0 -1
- package/dist/impl-QV42ZSX6.cjs +0 -6
- package/dist/impl-QV42ZSX6.cjs.map +0 -1
- package/dist/impl-TEQOCEBB.cjs +0 -2
- package/dist/impl-TEQOCEBB.cjs.map +0 -1
- package/dist/impl-TXQ4XVDC.cjs +0 -12
- package/dist/impl-TXQ4XVDC.cjs.map +0 -1
- package/dist/impl-U744VBLW.cjs +0 -2
- package/dist/impl-U744VBLW.cjs.map +0 -1
- package/dist/impl-VEGPS7VZ.cjs +0 -2
- package/dist/impl-VEGPS7VZ.cjs.map +0 -1
- package/dist/impl-XBEBGY37.cjs +0 -2
- package/dist/impl-XBEBGY37.cjs.map +0 -1
- package/dist/impl-Y3YSZDVF.cjs +0 -2
- package/dist/impl-Y3YSZDVF.cjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
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 _chunk6FGYCQAQcjs = require('./chunk-6FGYCQAQ.cjs');var _chunkZVK4HIDFcjs = require('./chunk-ZVK4HIDF.cjs');require('./chunk-WIXQSFS6.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk3ZKZCSGDcjs = require('./chunk-3ZKZCSGD.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-E3CF3RKX.cjs');var _chunkY4BWTFTXcjs = require('./chunk-Y4BWTFTX.cjs');require('./chunk-BY7W4UQF.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function Z({file:l,fileTarget:f,transcendUrl:p,auth:g,sombraAuth:v,cronDataSiloId:N,targetDataSiloId:R,actions:S,skipRequestCount:h,pageLimit:s,chunkSize:r}){h&&_chunkZUNVPK23cjs.a.info(_colors2.default.yellow("Skipping request count as requested. This may help speed up the call.")),(Number.isNaN(r)||r<=0||r%s!==0)&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Invalid chunk size: "${r}". Must be a positive integer that is a multiple of ${s}.`)),this.process.exit(1)),_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let j=_chunk3ZKZCSGDcjs.qe.call(void 0, p,g),{baseName:O,extension:A}=_chunkZVK4HIDFcjs.d.call(void 0, l),{baseName:D,extension:k}=_chunkZVK4HIDFcjs.d.call(void 0, f),$=0,b=0,d=0;await _chunk6FGYCQAQcjs.g.call(void 0, {dataSiloId:N,auth:g,sombraAuth:v,actions:S,apiPageSize:s,savePageSize:r,onSave:async n=>{$+=n.length;let E=n.map(t=>t.requestId),G=_chunkY4BWTFTXcjs.j.call(void 0, E),M=_chunkY4BWTFTXcjs.b.call(void 0, G,s),y=await _chunk3ZKZCSGDcjs.b.call(void 0, M,async t=>(_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Fetching target identifiers for ${t.length} requests`)),(await _chunk3ZKZCSGDcjs.Le.call(void 0, j,s*2,{requestIds:t,dataSiloIds:[R]})).map(({fileName:I,remoteId:C})=>{if(!C)throw new Error(`Failed to find remoteId for ${I}`);return{RecordId:C,Object:_optionalChain([I, 'access', _ => _.replace, 'call', _2 => _2(".json",""), 'access', _3 => _3.split, 'call', _4 => _4("/"), 'access', _5 => _5.pop, 'call', _6 => _6(), 'optionalAccess', _7 => _7.replace, 'call', _8 => _8(" Information","")]),Comment:"Customer data deletion request submitted via transcend.io"}})),{concurrency:1});b+=y.flat().length;let Q=_chunkY4BWTFTXcjs.j.call(void 0, n.map(t=>Object.keys(t)).flat()),T=`${O}-${d}${A}`,V=`${D}-${d}${k}`;_chunkZVK4HIDFcjs.c.call(void 0, T,n,Q),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${n.length} identifiers to file "${l}"`));let o=y.flat(),z=_chunkY4BWTFTXcjs.j.call(void 0, o.map(t=>Object.keys(t)).flat());_chunkZVK4HIDFcjs.c.call(void 0, V,o,z),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${o.length} identifiers to file "${f}"`)),_chunkZUNVPK23cjs.a.info(_colors2.default.blue(`Processed chunk of ${_chunkY4BWTFTXcjs.b.length} identifiers, found ${o.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 = Z;
|
|
2
|
+
//# sourceMappingURL=impl-SNLQCZOR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-SNLQCZOR.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,wDAAgD,gCAA6B,wDAAyC,wDAAyD,wDAAyC,gCAA6B,wDAAgD,gCAA6B,gFCEvV,MA8BnB,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,C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f,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-SNLQCZOR.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 '../../../../lib/bluebird-replace';\nimport {\n buildTranscendGraphQLClient,\n fetchRequestFilesForRequest,\n} from '../../../../lib/graphql';\nimport type { LocalContext } from '../../../../context';\nimport {\n parseFilePath,\n pullChunkedCustomSiloOutstandingIdentifiers,\n writeCsv,\n type CsvFormattedIdentifier,\n} from '../../../../lib/cron';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation';\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 writeCsv(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 writeCsv(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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWIXQSFS6cjs = require('./chunk-WIXQSFS6.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-3ZKZCSGD.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-E3CF3RKX.cjs');require('./chunk-Y4BWTFTX.cjs');require('./chunk-BY7W4UQF.cjs');async function p({auth:r,actions:s,statuses:i=[],requestIds:c,silentModeBefore:e,createdAtBefore:t,createdAtAfter:n,cancellationTitle:u,transcendUrl:d,concurrency:l}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkWIXQSFS6cjs.L.call(void 0, {transcendUrl:d,requestActions:s,auth:r,cancellationTitle:u,requestIds:c,statuses:i,concurrency:l,silentModeBefore:e?new Date(e):void 0,createdAtBefore:t?new Date(t):void 0,createdAtAfter:n?new Date(n):void 0})}exports.cancel = p;
|
|
2
|
+
//# sourceMappingURL=impl-TPVA6DLJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-TPVA6DLJ.cjs","../src/commands/request/cancel/impl.ts"],"names":["cancel","auth","actions","statuses","requestIds","silentModeBefore","createdAtBefore","createdAtAfter","cancellationTitle","transcendUrl","concurrency","doneInputValidation","cancelPrivacyRequests"],"mappings":"AAAA,iIAAwC,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCkBlO,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,CAAC,CAAA,CACZ,UAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,iCAAAA,CACJ,YAAA,CAAAH,CAAAA,CACA,cAAA,CAAgBP,CAAAA,CAChB,IAAA,CAAAD,CAAAA,CACA,iBAAA,CAAAO,CAAAA,CACA,UAAA,CAAAJ,CAAAA,CACA,QAAA,CAAAD,CAAAA,CACA,WAAA,CAAAO,CAAAA,CACA,gBAAA,CAAkBL,CAAAA,CAAmB,IAAI,IAAA,CAAKA,CAAgB,CAAA,CAAI,KAAA,CAAA,CAClE,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,CAC9D,CAAC,CACH,CAAA,mBAAA","file":"/home/runner/work/cli/cli/dist/impl-TPVA6DLJ.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport { cancelPrivacyRequests } from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface CancelCommandFlags {\n auth: string;\n actions: RequestAction[];\n statuses?: RequestStatus[];\n requestIds?: string[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n cancellationTitle: string;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function cancel(\n this: LocalContext,\n {\n auth,\n actions,\n statuses = [],\n requestIds,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n cancellationTitle,\n transcendUrl,\n concurrency,\n }: CancelCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await cancelPrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n cancellationTitle,\n requestIds,\n statuses,\n concurrency,\n silentModeBefore: silentModeBefore ? new Date(silentModeBefore) : undefined,\n createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,\n createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,\n });\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWIXQSFS6cjs = require('./chunk-WIXQSFS6.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-3ZKZCSGD.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-E3CF3RKX.cjs');require('./chunk-Y4BWTFTX.cjs');require('./chunk-BY7W4UQF.cjs');async function c({auth:o,dataSiloId:a,actions:r,transcendUrl:s}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkWIXQSFS6cjs.T.call(void 0, {requestActions:r,transcendUrl:s,auth:o,dataSiloId:a})}exports.retryRequestDataSilos = c;
|
|
2
|
+
//# sourceMappingURL=impl-TVNBHOR4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-TVNBHOR4.cjs","../src/commands/request/system/retry-request-data-silos/impl.ts"],"names":["retryRequestDataSilos","auth","dataSiloId","actions","transcendUrl","doneInputValidation"],"mappings":"AAAA,iIAAwC,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCYlO,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAML,iCAAAA,CACJ,cAAA,CAAgBG,CAAAA,CAChB,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAH,CAAAA,CACA,UAAA,CAAAC,CACF,CAAC,CACH,CAAA,kCAAA","file":"/home/runner/work/cli/cli/dist/impl-TVNBHOR4.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../../context';\nimport type { RequestAction } from '@transcend-io/privacy-types';\nimport { retryRequestDataSilos as retryRequestDataSilosHelper } from '../../../../lib/requests';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation';\n\nexport interface RetryRequestDataSilosCommandFlags {\n auth: string;\n dataSiloId: string;\n actions: RequestAction[];\n transcendUrl: string;\n}\n\nexport async function retryRequestDataSilos(\n this: LocalContext,\n {\n auth,\n dataSiloId,\n actions,\n transcendUrl,\n }: RetryRequestDataSilosCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await retryRequestDataSilosHelper({\n requestActions: actions,\n transcendUrl,\n auth,\n dataSiloId,\n });\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWIXQSFS6cjs = require('./chunk-WIXQSFS6.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-3ZKZCSGD.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-E3CF3RKX.cjs');require('./chunk-Y4BWTFTX.cjs');require('./chunk-BY7W4UQF.cjs');async function n({auth:s,dataSiloId:a,status:o,statuses:i,transcendUrl:p}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkWIXQSFS6cjs.V.call(void 0, {transcendUrl:p,auth:s,status:o,dataSiloId:a,requestStatuses:i})}exports.skipRequestDataSilos = n;
|
|
2
|
+
//# sourceMappingURL=impl-TWLWQSZG.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-TWLWQSZG.cjs","../src/commands/request/system/skip-request-data-silos/impl.ts"],"names":["skipRequestDataSilos","auth","dataSiloId","status","statuses","transcendUrl","doneInputValidation"],"mappings":"AAAA,iIAAwC,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCkBlO,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMN,iCAAAA,CACJ,YAAA,CAAAK,CAAAA,CACA,IAAA,CAAAJ,CAAAA,CACA,MAAA,CAAAE,CAAAA,CACA,UAAA,CAAAD,CAAAA,CACA,eAAA,CAAiBE,CACnB,CAAC,CACH,CAAA,iCAAA","file":"/home/runner/work/cli/cli/dist/impl-TWLWQSZG.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../../context';\nimport type {\n RequestDataSiloStatus,\n RequestStatus,\n} from '@transcend-io/privacy-types';\nimport { skipRequestDataSilos as skipRequestDataSilosHelper } from '../../../../lib/requests';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation';\n\nexport interface SkipRequestDataSilosCommandFlags {\n auth: string;\n dataSiloId: string;\n transcendUrl: string;\n statuses: RequestStatus[];\n status:\n | (typeof RequestDataSiloStatus)['Skipped']\n | (typeof RequestDataSiloStatus)['Resolved'];\n}\n\nexport async function skipRequestDataSilos(\n this: LocalContext,\n {\n auth,\n dataSiloId,\n status,\n statuses,\n transcendUrl,\n }: SkipRequestDataSilosCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await skipRequestDataSilosHelper({\n transcendUrl,\n auth,\n status,\n dataSiloId,\n requestStatuses: statuses,\n });\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6FGYCQAQcjs = require('./chunk-6FGYCQAQ.cjs');require('./chunk-ZVK4HIDF.cjs');require('./chunk-WIXQSFS6.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-3ZKZCSGD.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-E3CF3RKX.cjs');require('./chunk-Y4BWTFTX.cjs');require('./chunk-BY7W4UQF.cjs');async function d({file:i,transcendUrl:o,auth:r,sombraAuth:n,dataSiloId:s}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk6FGYCQAQcjs.e.call(void 0, {file:i,transcendUrl:o,auth:r,sombraAuth:n,dataSiloId:s})}exports.markIdentifiersCompleted = d;
|
|
2
|
+
//# sourceMappingURL=impl-UKOAB6ED.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-UKOAB6ED.cjs","../src/commands/request/cron/mark-identifiers-completed/impl.ts"],"names":["markIdentifiersCompleted","file","transcendUrl","auth","sombraAuth","dataSiloId","doneInputValidation","pushCronIdentifiersFromCsv"],"mappings":"AAAA,iIAAwC,gCAA6B,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCY5R,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,iCAAAA,CACJ,IAAA,CAAAN,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CACF,CAAC,CACH,CAAA,qCAAA","file":"/home/runner/work/cli/cli/dist/impl-UKOAB6ED.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../../context';\nimport { pushCronIdentifiersFromCsv } from '../../../../lib/cron';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation';\n\nexport interface MarkIdentifiersCompletedCommandFlags {\n file: string;\n transcendUrl: string;\n auth: string;\n sombraAuth?: string;\n dataSiloId: string;\n}\n\nexport async function markIdentifiersCompleted(\n this: LocalContext,\n {\n file,\n transcendUrl,\n auth,\n sombraAuth,\n dataSiloId,\n }: MarkIdentifiersCompletedCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await pushCronIdentifiersFromCsv({\n file,\n transcendUrl,\n auth,\n sombraAuth,\n dataSiloId,\n });\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWIXQSFS6cjs = require('./chunk-WIXQSFS6.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-3ZKZCSGD.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-E3CF3RKX.cjs');require('./chunk-Y4BWTFTX.cjs');require('./chunk-BY7W4UQF.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 _chunkWIXQSFS6cjs.S.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-ZKBMWGMK.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZKBMWGMK.cjs","../src/commands/request/enricher-restart/impl.ts"],"names":["enricherRestart","auth","enricherId","actions","requestEnricherStatuses","requestIds","createdAtBefore","createdAtAfter","concurrency","transcendUrl","doneInputValidation","bulkRetryEnrichers"],"mappings":"AAAA,iIAAwC,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCoBlO,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,iCAAAA,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-ZKBMWGMK.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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWIXQSFS6cjs = require('./chunk-WIXQSFS6.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-3ZKZCSGD.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-E3CF3RKX.cjs');require('./chunk-Y4BWTFTX.cjs');require('./chunk-BY7W4UQF.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 _chunkWIXQSFS6cjs.I.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-ZTWLYZZO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZTWLYZZO.cjs","../src/commands/request/approve/impl.ts"],"names":["approve","auth","actions","origins","silentModeBefore","createdAtBefore","createdAtAfter","transcendUrl","concurrency","doneInputValidation","approvePrivacyRequests"],"mappings":"AAAA,iIAAwC,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCiBlO,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,iCAAAA,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-ZTWLYZZO.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"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _class;var _chunkXBHJO2OXcjs = require('./chunk-XBHJO2OX.cjs');var _chunkHAOVN3XOcjs = require('./chunk-HAOVN3XO.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkU6G3J6VJcjs = require('./chunk-U6G3J6VJ.cjs');var _chunkTD7ADMVOcjs = require('./chunk-TD7ADMVO.cjs');var _chunkL7NHDBBNcjs = require('./chunk-L7NHDBBN.cjs');var _chunkWAYG2MDLcjs = require('./chunk-WAYG2MDL.cjs');var _chunkKWG56BUXcjs = require('./chunk-KWG56BUX.cjs');var _chunkZVK4HIDFcjs = require('./chunk-ZVK4HIDF.cjs');var _chunk25UGE4YYcjs = require('./chunk-25UGE4YY.cjs');var _chunkQXKWSBYRcjs = require('./chunk-QXKWSBYR.cjs');var _chunkSHV6R64Jcjs = require('./chunk-SHV6R64J.cjs');var _chunkZD2HOHJIcjs = require('./chunk-ZD2HOHJI.cjs');var _chunkSAEKBZGFcjs = require('./chunk-SAEKBZGF.cjs');var _chunkNOF6QHE4cjs = require('./chunk-NOF6QHE4.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkEG4L6YAJcjs = require('./chunk-EG4L6YAJ.cjs');var _chunkFPTEK7BGcjs = require('./chunk-FPTEK7BG.cjs');var _chunkBY7W4UQFcjs = require('./chunk-BY7W4UQF.cjs');var _typeutils = require('@transcend-io/type-utils');var _handlebarsutils = require('@transcend-io/handlebars-utils');var _privacytypes = require('@transcend-io/privacy-types');var T=20;async function $(a){let e=[],r=0,t=!1;do{let{largeLanguageModels:{nodes:s}}=await _chunkNOF6QHE4cjs.gc.call(void 0, a,_chunkNOF6QHE4cjs.Gb,{first:T,offset:r});e.push(...s),r+=T,t=s.length===T}while(t);return e.sort((s,o)=>s.name.localeCompare(o.name))}function j(a){return new RegExp(`<${a}>([\\s\\S]+?)<\\/${a}>`)}function hm(a){return a}var H=a=>{try{return JSON.parse(a)}catch (e2){return a}},F= exports.TranscendPromptManager = (_class =class{__init() {this.largeLanguageModels=[]}__init2() {this.agentsByName={}}__init3() {this.agentsByAgentId={}}constructor({prompts:e,handlebarsOptions:r={},transcendUrl:t=_chunkEG4L6YAJcjs.e,transcendApiKey:s,requireApproval:o=!0,cacheDuration:i,defaultVariables:p={}}){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);this.prompts=e,this.transcendUrl=t,this.transcendApiKey=s,this.variables=p,this.defaultVariables=p,this.graphQLClient=_chunkNOF6QHE4cjs.xe.call(void 0, t,typeof s=="object"?s.release():s),this.requireApproval=o,this.cacheDuration=i,this.handlebarsOptions=r,this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, r)}async fetchPromptsAndMetadata(){let e=_typeutils.getValues.call(void 0, this.prompts),r=e.map(({id:n})=>n).filter(n=>!!n),t=e.map(({title:n})=>n).filter(n=>!!n),s=_chunkNOF6QHE4cjs.fc.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunkNOF6QHE4cjs.Kc.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),$(this.graphQLClient),_chunkNOF6QHE4cjs.qd.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunkNOF6QHE4cjs.bc.call(void 0, p,"name"),this.agentsByAgentId=_chunkNOF6QHE4cjs.bc.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunkNOF6QHE4cjs.bc.call(void 0, o.prompts,"title"),c=_chunkNOF6QHE4cjs.bc.call(void 0, o.prompts,"id");return this.variables={...o.calculatedVariables.reduce((n,g)=>Object.assign(n,{[g.name]:g.data?JSON.parse(g.data):g.data}),{}),...this.defaultVariables},this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, {...this.handlebarsOptions,templates:[...this.handlebarsOptions.templates||[],...o.promptPartials.map(n=>({name:n.slug,content:n.content}))]}),this.promptContentMap=_typeutils.apply.call(void 0, this.prompts,({id:n,title:g})=>{let d=n?c[n]:g?m[g]:void 0;if(!d)throw new Error(`Failed to find prompt with title: "${g}" and id: "${n}"`);return d}),this.lastUpdatedAt=new Date,o}async getAgentByName(e){let r=this.agentsByName[e];if(r)return r;let[t]=await _chunkNOF6QHE4cjs.qd.call(void 0, this.graphQLClient,{names:[e]});if(t)return this.agentsByName[t.name]=t,this.agentsByAgentId[t.agentId]=t,t}async getPromptThreadBySlackTs(e){let[r]=await _chunkNOF6QHE4cjs.Be.call(void 0, this.graphQLClient,{slackMessageTs:[e]});return r}async getAgentsByName(e){if(e.length<1)throw new Error("Expected at least one name to be provided");let{hasCache:r=[],missingCache:t=[]}=_chunkNOF6QHE4cjs.ac.call(void 0, e,p=>this.agentsByName[p]?"hasCache":"missingCache"),s=r.map(p=>this.agentsByName[p]);if(t.length===0)return s;let o=_chunkNOF6QHE4cjs._b.call(void 0, t,50),i=[];return await _chunkNOF6QHE4cjs.a.call(void 0, o,async p=>{let m=await _chunkNOF6QHE4cjs.qd.call(void 0, this.graphQLClient,{names:p});m.forEach(c=>{this.agentsByName[c.name]=c,this.agentsByAgentId[c.agentId]=c}),i.push(...m)}),[...s,...i]}getAgentFiles(e){return _chunkNOF6QHE4cjs.Fd.call(void 0, this.graphQLClient,e)}getLargeLanguageModel(e){let r=this.largeLanguageModels.find(t=>typeof e=="string"?t.id===e:t.name===e.name&&t.client===e.client);if(!r)throw new Error(`Failed to find model matching: ${typeof e=="string"?e:JSON.stringify(e)}`);return r}async getPromptDefinition(e){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let{promptContentMap:r}=this;if(!r)throw new Error("Expected this.promptContentMap to be defined");let t=r[e];if(!t)throw new Error(`Expected this.promptContentMap[${e}] to be defined`);return t}async compilePrompt(e,r){let t=await this.getPromptDefinition(e),s=this.prompts[e];if(!s)throw new Error(`Expected this.prompts[${e}] to be defined`);if(this.requireApproval&&t.status!==_privacytypes.PromptStatus.Approved)throw new Error(`Assessment "${t.title}" cannot be used because its in status: "${t.status}"`);if(t.status===_privacytypes.PromptStatus.Rejected)throw new Error(`Assessment "${t.title}" cannot be used because it's in status: "${t.status}"`);return _typeutils.decodeCodec.call(void 0, s.paramCodec,r),this.handlebars.compile(t.content)({currentDate:new Date().toISOString(),...this.variables,...r})}parseAiResponse(e,r){let t=this.prompts[e];if(!t)throw new Error(`Expected this.prompts[${e}] to be defined`);let s=t.extractFromTag&&(j(t.extractFromTag).exec(r)||[])[1]||r;return _typeutils.decodeCodec.call(void 0, t.outputCodec,H(s),!1)}async reportAndParsePromptRun(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);if(t.promptRunMessages[t.promptRunMessages.length-1].role!==_privacytypes.ChatCompletionRole.Assistant)throw new Error(`promptRunMessages[${t.promptRunMessages.length-1}].role is expected to be = ${_privacytypes.ChatCompletionRole.Assistant}`);let i=t.promptRunMessages[t.promptRunMessages.length-1].content,p;try{p=this.parseAiResponse(e,i)}catch(c){throw await _chunkNOF6QHE4cjs.Ve.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,error:c.message,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((n,g)=>({...n,...g===0?{template:o.content}:{}}))}),c}let m=await _chunkNOF6QHE4cjs.Ve.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Resolved,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((c,n)=>({...c,...n===0?{template:o.content}:{}}))});return{result:p,promptRunId:m,promptRunUrl:`https://app.transcend.io/prompts/runs/${m}`}}async reportPromptRunError(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);let i=await _chunkNOF6QHE4cjs.Ve.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((p,m)=>({...p,...m===0?{template:o.content}:{}}))});return{promptRunId:i,promptRunUrl:`https://app.transcend.io/prompts/runs/${i}`}}}, _class);function Pm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function Am(a){return Object.entries(a).reduce((e,[r,t])=>t!=null&&t!==""&&!(Array.isArray(t)&&t.length===0)&&!(typeof t=="object"&&Object.keys(t).length===0)?Object.assign(e,{[r]:t}):e,{})}var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _child_process = require('child_process');function Rm({baseBranch:a,rootDirectory:e,githubRepo:r,excludedGlob:t=[],fileBlockList:s=[]}){_child_process.execSync.call(void 0, `git fetch origin ${a}`);let o=_child_process.execSync.call(void 0, `git ls-remote ${r} "refs/heads/${a}" | cut -f 1`,{encoding:"utf-8"}).split(`
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _class;var _chunkBF5T3SGEcjs = require('./chunk-BF5T3SGE.cjs');var _chunkEVZLUL56cjs = require('./chunk-EVZLUL56.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkR4IKDXM5cjs = require('./chunk-R4IKDXM5.cjs');var _chunkTD7ADMVOcjs = require('./chunk-TD7ADMVO.cjs');var _chunkL7NHDBBNcjs = require('./chunk-L7NHDBBN.cjs');var _chunkIG65EYJYcjs = require('./chunk-IG65EYJY.cjs');var _chunk6FGYCQAQcjs = require('./chunk-6FGYCQAQ.cjs');var _chunkZVK4HIDFcjs = require('./chunk-ZVK4HIDF.cjs');var _chunkTS5EYI4Ocjs = require('./chunk-TS5EYI4O.cjs');var _chunk6DWFLWWTcjs = require('./chunk-6DWFLWWT.cjs');var _chunkWIXQSFS6cjs = require('./chunk-WIXQSFS6.cjs');var _chunkZD2HOHJIcjs = require('./chunk-ZD2HOHJI.cjs');var _chunkSAEKBZGFcjs = require('./chunk-SAEKBZGF.cjs');var _chunk3ZKZCSGDcjs = require('./chunk-3ZKZCSGD.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkE3CF3RKXcjs = require('./chunk-E3CF3RKX.cjs');var _chunkY4BWTFTXcjs = require('./chunk-Y4BWTFTX.cjs');var _chunkBY7W4UQFcjs = require('./chunk-BY7W4UQF.cjs');var _typeutils = require('@transcend-io/type-utils');var _handlebarsutils = require('@transcend-io/handlebars-utils');var _privacytypes = require('@transcend-io/privacy-types');var T=20;async function $(a){let e=[],r=0,t=!1;do{let{largeLanguageModels:{nodes:s}}=await _chunk3ZKZCSGDcjs.$b.call(void 0, a,_chunk3ZKZCSGDcjs.Hb,{first:T,offset:r});e.push(...s),r+=T,t=s.length===T}while(t);return e.sort((s,o)=>s.name.localeCompare(o.name))}function j(a){return new RegExp(`<${a}>([\\s\\S]+?)<\\/${a}>`)}function Tm(a){return a}var H=a=>{try{return JSON.parse(a)}catch (e2){return a}},F= exports.TranscendPromptManager = (_class =class{__init() {this.largeLanguageModels=[]}__init2() {this.agentsByName={}}__init3() {this.agentsByAgentId={}}constructor({prompts:e,handlebarsOptions:r={},transcendUrl:t=_chunkE3CF3RKXcjs.e,transcendApiKey:s,requireApproval:o=!0,cacheDuration:i,defaultVariables:p={}}){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);this.prompts=e,this.transcendUrl=t,this.transcendApiKey=s,this.variables=p,this.defaultVariables=p,this.graphQLClient=_chunk3ZKZCSGDcjs.qe.call(void 0, t,typeof s=="object"?s.release():s),this.requireApproval=o,this.cacheDuration=i,this.handlebarsOptions=r,this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, r)}async fetchPromptsAndMetadata(){let e=_typeutils.getValues.call(void 0, this.prompts),r=e.map(({id:n})=>n).filter(n=>!!n),t=e.map(({title:n})=>n).filter(n=>!!n),s=_chunkY4BWTFTXcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunk3ZKZCSGDcjs.Dc.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),$(this.graphQLClient),_chunk3ZKZCSGDcjs.jd.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunkY4BWTFTXcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunkY4BWTFTXcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunkY4BWTFTXcjs.e.call(void 0, o.prompts,"title"),c=_chunkY4BWTFTXcjs.e.call(void 0, o.prompts,"id");return this.variables={...o.calculatedVariables.reduce((n,g)=>Object.assign(n,{[g.name]:g.data?JSON.parse(g.data):g.data}),{}),...this.defaultVariables},this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, {...this.handlebarsOptions,templates:[...this.handlebarsOptions.templates||[],...o.promptPartials.map(n=>({name:n.slug,content:n.content}))]}),this.promptContentMap=_typeutils.apply.call(void 0, this.prompts,({id:n,title:g})=>{let d=n?c[n]:g?m[g]:void 0;if(!d)throw new Error(`Failed to find prompt with title: "${g}" and id: "${n}"`);return d}),this.lastUpdatedAt=new Date,o}async getAgentByName(e){let r=this.agentsByName[e];if(r)return r;let[t]=await _chunk3ZKZCSGDcjs.jd.call(void 0, this.graphQLClient,{names:[e]});if(t)return this.agentsByName[t.name]=t,this.agentsByAgentId[t.agentId]=t,t}async getPromptThreadBySlackTs(e){let[r]=await _chunk3ZKZCSGDcjs.ue.call(void 0, this.graphQLClient,{slackMessageTs:[e]});return r}async getAgentsByName(e){if(e.length<1)throw new Error("Expected at least one name to be provided");let{hasCache:r=[],missingCache:t=[]}=_chunkY4BWTFTXcjs.d.call(void 0, e,p=>this.agentsByName[p]?"hasCache":"missingCache"),s=r.map(p=>this.agentsByName[p]);if(t.length===0)return s;let o=_chunkY4BWTFTXcjs.b.call(void 0, t,50),i=[];return await _chunk3ZKZCSGDcjs.a.call(void 0, o,async p=>{let m=await _chunk3ZKZCSGDcjs.jd.call(void 0, this.graphQLClient,{names:p});m.forEach(c=>{this.agentsByName[c.name]=c,this.agentsByAgentId[c.agentId]=c}),i.push(...m)}),[...s,...i]}getAgentFiles(e){return _chunk3ZKZCSGDcjs.yd.call(void 0, this.graphQLClient,e)}getLargeLanguageModel(e){let r=this.largeLanguageModels.find(t=>typeof e=="string"?t.id===e:t.name===e.name&&t.client===e.client);if(!r)throw new Error(`Failed to find model matching: ${typeof e=="string"?e:JSON.stringify(e)}`);return r}async getPromptDefinition(e){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let{promptContentMap:r}=this;if(!r)throw new Error("Expected this.promptContentMap to be defined");let t=r[e];if(!t)throw new Error(`Expected this.promptContentMap[${e}] to be defined`);return t}async compilePrompt(e,r){let t=await this.getPromptDefinition(e),s=this.prompts[e];if(!s)throw new Error(`Expected this.prompts[${e}] to be defined`);if(this.requireApproval&&t.status!==_privacytypes.PromptStatus.Approved)throw new Error(`Assessment "${t.title}" cannot be used because its in status: "${t.status}"`);if(t.status===_privacytypes.PromptStatus.Rejected)throw new Error(`Assessment "${t.title}" cannot be used because it's in status: "${t.status}"`);return _typeutils.decodeCodec.call(void 0, s.paramCodec,r),this.handlebars.compile(t.content)({currentDate:new Date().toISOString(),...this.variables,...r})}parseAiResponse(e,r){let t=this.prompts[e];if(!t)throw new Error(`Expected this.prompts[${e}] to be defined`);let s=t.extractFromTag&&(j(t.extractFromTag).exec(r)||[])[1]||r;return _typeutils.decodeCodec.call(void 0, t.outputCodec,H(s),!1)}async reportAndParsePromptRun(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);if(t.promptRunMessages[t.promptRunMessages.length-1].role!==_privacytypes.ChatCompletionRole.Assistant)throw new Error(`promptRunMessages[${t.promptRunMessages.length-1}].role is expected to be = ${_privacytypes.ChatCompletionRole.Assistant}`);let i=t.promptRunMessages[t.promptRunMessages.length-1].content,p;try{p=this.parseAiResponse(e,i)}catch(c){throw await _chunk3ZKZCSGDcjs.Oe.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,error:c.message,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((n,g)=>({...n,...g===0?{template:o.content}:{}}))}),c}let m=await _chunk3ZKZCSGDcjs.Oe.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Resolved,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((c,n)=>({...c,...n===0?{template:o.content}:{}}))});return{result:p,promptRunId:m,promptRunUrl:`https://app.transcend.io/prompts/runs/${m}`}}async reportPromptRunError(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);let i=await _chunk3ZKZCSGDcjs.Oe.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((p,m)=>({...p,...m===0?{template:o.content}:{}}))});return{promptRunId:i,promptRunUrl:`https://app.transcend.io/prompts/runs/${i}`}}}, _class);function ym(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function bm(a){return Object.entries(a).reduce((e,[r,t])=>t!=null&&t!==""&&!(Array.isArray(t)&&t.length===0)&&!(typeof t=="object"&&Object.keys(t).length===0)?Object.assign(e,{[r]:t}):e,{})}var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _child_process = require('child_process');function Lm({baseBranch:a,rootDirectory:e,githubRepo:r,excludedGlob:t=[],fileBlockList:s=[]}){_child_process.execSync.call(void 0, `git fetch origin ${a}`);let o=_child_process.execSync.call(void 0, `git ls-remote ${r} "refs/heads/${a}" | cut -f 1`,{encoding:"utf-8"}).split(`
|
|
2
2
|
`)[0],i=_child_process.execSync.call(void 0, "git rev-parse HEAD",{encoding:"utf-8"}).split(`
|
|
3
|
-
`)[0];if(!o||!i)throw new Error("FAILED TO FIND COMMIT RANGE");let p=_child_process.execSync.call(void 0, `git fetch && git diff --name-only "${a||o}...${i}" -- ${e}`,{encoding:"utf-8"}),m=
|
|
4
|
-
`).filter(d=>d),s),c=t.length>0?_fastglob2.default.sync(m,{ignore:t}):m,n={};c.forEach(d=>{let Q=_child_process.execSync.call(void 0, `git show ${i}:${d}`,{encoding:"utf-8"});n[d]=Q});let g=r.split("/").pop().split(".")[0];return{changedFiles:m,fileDiffs:n,repoName:g,commit:i}}exports.ACTIONS = _chunkNOF6QHE4cjs.ub; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunkNOF6QHE4cjs.Ha; exports.ADD_SILO_DISCOVERY_RESULTS = _chunkNOF6QHE4cjs.I; exports.ADMIN_DASH = _chunkEG4L6YAJcjs.b; exports.ADMIN_DASH_DATAPOINTS = _chunkEG4L6YAJcjs.d; exports.ADMIN_DASH_INTEGRATIONS = _chunkEG4L6YAJcjs.c; exports.AGENTS = _chunkNOF6QHE4cjs.Hb; exports.AGENT_FILES = _chunkNOF6QHE4cjs.Kb; exports.AGENT_FUNCTIONS = _chunkNOF6QHE4cjs.Nb; exports.API_KEYS = _chunkNOF6QHE4cjs.F; exports.APPROVE_PRIVACY_REQUEST = _chunkNOF6QHE4cjs.Y; exports.ASSESSMENTS = _chunkNOF6QHE4cjs.ga; exports.ASSESSMENT_SECTION_FIELDS = _chunkNOF6QHE4cjs.fa; exports.ASSESSMENT_TEMPLATES = _chunkNOF6QHE4cjs.ka; exports.ASSUME_ROLE = _chunkNOF6QHE4cjs.Fb; exports.ATTRIBUTES = _chunkNOF6QHE4cjs.La; exports.ATTRIBUTE_KEYS_REQUESTS = _chunkNOF6QHE4cjs.N; exports.ATTRIBUTE_VALUES = _chunkNOF6QHE4cjs.Pa; exports.ActionInput = _chunkZD2HOHJIcjs.E; exports.ActionItemCollectionInput = _chunkZD2HOHJIcjs.P; exports.ActionItemInput = _chunkZD2HOHJIcjs.Q; exports.AgentFileInput = _chunkZD2HOHJIcjs.o; exports.AgentFunctionInput = _chunkZD2HOHJIcjs.n; exports.AgentInput = _chunkZD2HOHJIcjs.m; exports.ApiKeyInput = _chunkZD2HOHJIcjs.c; exports.AssessmentAction = _chunkNOF6QHE4cjs.ce; exports.AssessmentAnswerOptionInput = _chunkZD2HOHJIcjs.W; exports.AssessmentDisplayLogicInput = _chunkZD2HOHJIcjs.T; exports.AssessmentInput = _chunkZD2HOHJIcjs.aa; exports.AssessmentNestedRule = _chunkNOF6QHE4cjs.be; exports.AssessmentNestedRuleInput = _chunkZD2HOHJIcjs.S; exports.AssessmentResourceInput = _chunkZD2HOHJIcjs.$; exports.AssessmentRetentionScheduleInput = _chunkZD2HOHJIcjs.Z; exports.AssessmentRiskLogic = _chunkNOF6QHE4cjs.ee; exports.AssessmentRule = _chunkNOF6QHE4cjs.ae; exports.AssessmentRuleInput = _chunkZD2HOHJIcjs.R; exports.AssessmentSectionInput = _chunkZD2HOHJIcjs.Y; exports.AssessmentSectionQuestionInput = _chunkZD2HOHJIcjs.X; exports.AssessmentTemplateInput = _chunkZD2HOHJIcjs._; exports.AttestedExtraIdentifiers = _chunkSHV6R64Jcjs.w; exports.AttributeInput = _chunkZD2HOHJIcjs.k; exports.AttributePreview = _chunkZD2HOHJIcjs.l; exports.AttributeValueInput = _chunkZD2HOHJIcjs.j; exports.BLANK = _chunkSHV6R64Jcjs.c; exports.BULK_APPLY = _chunkSHV6R64Jcjs.b; exports.BUSINESS_ENTITIES = _chunkNOF6QHE4cjs.rb; exports.BusinessEntityInput = _chunkZD2HOHJIcjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunkNOF6QHE4cjs.Z; exports.CAN_APPLY_IN_BULK = _chunkSHV6R64Jcjs.g; exports.CATALOGS = _chunkNOF6QHE4cjs.t; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunkNOF6QHE4cjs.wa; exports.CODE_PACKAGES = _chunkNOF6QHE4cjs.R; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunkNOF6QHE4cjs.qb; exports.CONSENT_PARTITIONS = _chunkNOF6QHE4cjs.Ua; exports.COOKIES = _chunkNOF6QHE4cjs.Za; exports.CREATE_ACTION_ITEMS = _chunkNOF6QHE4cjs.yb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunkNOF6QHE4cjs.Ja; exports.CREATE_AGENT = _chunkNOF6QHE4cjs.Ib; exports.CREATE_AGENT_FILE = _chunkNOF6QHE4cjs.Lb; exports.CREATE_AGENT_FUNCTION = _chunkNOF6QHE4cjs.Ob; exports.CREATE_API_KEY = _chunkNOF6QHE4cjs.G; exports.CREATE_ATTRIBUTE = _chunkNOF6QHE4cjs.Qa; exports.CREATE_ATTRIBUTE_VALUES = _chunkNOF6QHE4cjs.Ma; exports.CREATE_BUSINESS_ENTITY = _chunkNOF6QHE4cjs.sb; exports.CREATE_CODE_PACKAGE = _chunkNOF6QHE4cjs.T; exports.CREATE_CONSENT_EXPERIENCE = _chunkNOF6QHE4cjs.ob; exports.CREATE_CONSENT_MANAGER = _chunkNOF6QHE4cjs.bb; exports.CREATE_CONSENT_PARTITION = _chunkNOF6QHE4cjs.pb; exports.CREATE_DATA_FLOWS = _chunkNOF6QHE4cjs.Va; exports.CREATE_DATA_SILOS = _chunkNOF6QHE4cjs.o; exports.CREATE_DATA_SUBJECT = _chunkNOF6QHE4cjs.z; exports.CREATE_DATA_SUB_CATEGORY = _chunkNOF6QHE4cjs.Ub; exports.CREATE_ENRICHER = _chunkNOF6QHE4cjs.r; exports.CREATE_IDENTIFIER = _chunkNOF6QHE4cjs.w; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunkNOF6QHE4cjs.Xb; exports.CREATE_PROMPT = _chunkNOF6QHE4cjs.qa; exports.CREATE_PROMPT_GROUP = _chunkNOF6QHE4cjs.ua; exports.CREATE_PROMPT_PARTIAL = _chunkNOF6QHE4cjs.sa; exports.CREATE_REPOSITORY = _chunkNOF6QHE4cjs.E; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunkNOF6QHE4cjs.Q; exports.CREATE_TEAM = _chunkNOF6QHE4cjs.Aa; exports.CREATE_TEMPLATE = _chunkNOF6QHE4cjs.L; exports.CREATE_VENDOR = _chunkNOF6QHE4cjs.Rb; exports.CachedFileState = _chunkSHV6R64Jcjs.h; exports.CachedRequestState = _chunkSHV6R64Jcjs.j; exports.CodePackageInput = _chunkZD2HOHJIcjs.B; exports.CodePackageSdk = _chunkZD2HOHJIcjs.A; exports.ColumnName = _chunkSHV6R64Jcjs.e; exports.ConsentManageExperienceInput = _chunkZD2HOHJIcjs.I; exports.ConsentManagerInput = _chunkZD2HOHJIcjs.K; exports.ConsentManagerMetricBin = _chunkNOF6QHE4cjs.Ac; exports.ConsentManagerServiceMetadata = _chunkZD2HOHJIcjs.ia; exports.ConsentPreferenceResponse = _chunk25UGE4YYcjs.i; exports.ConsentPreferenceTopic = _chunkZD2HOHJIcjs.ca; exports.ConsentPreferenceTopicOptionValue = _chunkZD2HOHJIcjs.ba; exports.ConsentPurpose = _chunkZD2HOHJIcjs.da; exports.CookieCsvInput = _chunkZD2HOHJIcjs.ha; exports.CookieInput = _chunkZD2HOHJIcjs.H; exports.CronIdentifier = _chunkKWG56BUXcjs.a; exports.CronIdentifierPush = _chunkKWG56BUXcjs.c; exports.DATAPOINT_EXPORT = _chunkNOF6QHE4cjs.i; exports.DATA_FLOWS = _chunkNOF6QHE4cjs.Ya; exports.DATA_POINTS = _chunkNOF6QHE4cjs.c; exports.DATA_POINT_COUNT = _chunkNOF6QHE4cjs.d; exports.DATA_SILOS = _chunkNOF6QHE4cjs.k; exports.DATA_SILOS_ENRICHED = _chunkNOF6QHE4cjs.m; exports.DATA_SILO_EXPORT = _chunkNOF6QHE4cjs.l; exports.DATA_SUBJECTS = _chunkNOF6QHE4cjs.y; exports.DATA_SUB_CATEGORIES = _chunkNOF6QHE4cjs.Tb; exports.DEFAULT_TRANSCEND_API = _chunkEG4L6YAJcjs.e; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkEG4L6YAJcjs.f; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunkNOF6QHE4cjs.ie; exports.DELETE_API_KEY = _chunkNOF6QHE4cjs.H; exports.DELETE_ATTRIBUTE_VALUE = _chunkNOF6QHE4cjs.Oa; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunkNOF6QHE4cjs.Ab; exports.DEPLOY_CONSENT_MANAGER = _chunkNOF6QHE4cjs.eb; exports.DETERMINE_LOGIN_METHOD = _chunkNOF6QHE4cjs.Db; exports.DataCategoryGuessInput = _chunkZD2HOHJIcjs.h; exports.DataCategoryInput = _chunkZD2HOHJIcjs.q; exports.DataCategoryPreviewInput = _chunkZD2HOHJIcjs.g; exports.DataCategoryRecommendationInput = _chunkZD2HOHJIcjs.i; exports.DataFlowCsvInput = _chunkZD2HOHJIcjs.ga; exports.DataFlowInput = _chunkZD2HOHJIcjs.G; exports.DataSiloInput = _chunkZD2HOHJIcjs.O; exports.DataSubjectInput = _chunkZD2HOHJIcjs.D; exports.DatapointInput = _chunkZD2HOHJIcjs.w; exports.ENABLED_PLUGINS = _chunkNOF6QHE4cjs.J; exports.ENRICHERS = _chunkNOF6QHE4cjs.p; exports.ENTRY_COUNT = _chunkNOF6QHE4cjs.j; exports.EXPERIENCES = _chunkNOF6QHE4cjs.Ta; exports.EnrichPrivacyRequest = _chunkXBHJO2OXcjs.b; exports.EnricherInput = _chunkZD2HOHJIcjs.e; exports.FETCH_CONSENT_MANAGER = _chunkNOF6QHE4cjs.$a; exports.FETCH_CONSENT_MANAGER_ID = _chunkNOF6QHE4cjs._a; exports.FETCH_CONSENT_MANAGER_THEME = _chunkNOF6QHE4cjs.ab; exports.FETCH_PRIVACY_CENTER_ID = _chunkNOF6QHE4cjs.zb; exports.FieldInput = _chunkZD2HOHJIcjs.v; exports.GLOBAL_ACTION_ITEMS = _chunkNOF6QHE4cjs.wb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunkNOF6QHE4cjs.Ia; exports.IDENTIFIERS = _chunkNOF6QHE4cjs.u; exports.IDENTIFIER_BLOCK_LIST = _chunkSHV6R64Jcjs.d; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunkNOF6QHE4cjs.ha; exports.INITIALIZER = _chunkNOF6QHE4cjs.q; exports.IP_ADDRESS_REGEX = _chunk25UGE4YYcjs.f; exports.IS_REQUIRED = _chunkSHV6R64Jcjs.f; exports.IdentifierInput = _chunkZD2HOHJIcjs.F; exports.ImportOnetrustAssessmentsInput = _chunkZD2HOHJIcjs.pa; exports.IntlMessage = _chunkSHV6R64Jcjs.A; exports.IntlMessageInput = _chunkZD2HOHJIcjs.N; exports.LARGE_LANGUAGE_MODELS = _chunkNOF6QHE4cjs.Gb; exports.LOGIN = _chunkNOF6QHE4cjs.Eb; exports.MESSAGES = _chunkNOF6QHE4cjs.aa; exports.NEW_IDENTIFIER_TYPES = _chunkNOF6QHE4cjs.v; exports.NONE = _chunkSHV6R64Jcjs.a; exports.NOTIFY_ADDITIONAL_TIME = _chunkNOF6QHE4cjs.$; exports.ORGANIZATION = _chunkNOF6QHE4cjs.M; exports.OneTrustFileFormat = _chunkBY7W4UQFcjs.a; exports.OneTrustPullResource = _chunkBY7W4UQFcjs.b; exports.OneTrustPullSource = _chunkBY7W4UQFcjs.c; exports.OpenAIEnabledRoute = _chunkZD2HOHJIcjs.ka; exports.OpenAIEnabledRoutes = _chunkZD2HOHJIcjs.la; exports.OpenAIIntegration = _chunkZD2HOHJIcjs.ma; exports.OpenAIRouteName = _chunkBY7W4UQFcjs.f; exports.POLICIES = _chunkNOF6QHE4cjs.V; exports.PREFERENCE_TOPICS = _chunkNOF6QHE4cjs.ja; exports.PRIVACY_CENTER = _chunkNOF6QHE4cjs.Bb; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkNOF6QHE4cjs.Wb; exports.PROMPTS = _chunkNOF6QHE4cjs.la; exports.PROMPTS_WITH_VARIABLES = _chunkNOF6QHE4cjs.oa; exports.PROMPT_GROUPS = _chunkNOF6QHE4cjs.na; exports.PROMPT_PARTIALS = _chunkNOF6QHE4cjs.ma; exports.PROMPT_THREADS = _chunkNOF6QHE4cjs.U; exports.PURPOSES = _chunkNOF6QHE4cjs.ia; exports.ParsedAttributeInput = _chunkSHV6R64Jcjs.o; exports.PartitionInput = _chunkZD2HOHJIcjs.J; exports.PathfinderPolicy = _chunkZD2HOHJIcjs.na; exports.PathfinderPolicyName = _chunkBY7W4UQFcjs.e; exports.PathfinderPolicyNameC = _chunkZD2HOHJIcjs.ja; exports.PathfinderPromptRunMetadata = _chunkZD2HOHJIcjs.oa; exports.PolicyInput = _chunkZD2HOHJIcjs.M; exports.PrivacyCenterInput = _chunkZD2HOHJIcjs.L; exports.PrivacyRequest = _chunkNOF6QHE4cjs.Fe; exports.PrivacyRequestInput = _chunkSHV6R64Jcjs.x; exports.PrivacyRequestResponse = _chunkSHV6R64Jcjs.G; exports.ProcessingPurposeInput = _chunkZD2HOHJIcjs.r; exports.ProcessingPurposePreviewInput = _chunkZD2HOHJIcjs.f; exports.PromptAVendorEmailSettings = _chunkZD2HOHJIcjs.x; exports.PromptGroupInput = _chunkZD2HOHJIcjs.u; exports.PromptInput = _chunkZD2HOHJIcjs.s; exports.PromptPartialInput = _chunkZD2HOHJIcjs.t; exports.PurposeMap = _chunkQXKWSBYRcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunkNOF6QHE4cjs.ya; exports.REMOVE_REQUEST_IDENTIFIERS = _chunkNOF6QHE4cjs.Ca; exports.REPORT_PROMPT_RUN = _chunkNOF6QHE4cjs.Ga; exports.REPOSITORIES = _chunkNOF6QHE4cjs.C; exports.REQUESTS = _chunkNOF6QHE4cjs.X; exports.REQUEST_DATA_SILOS = _chunkNOF6QHE4cjs.va; exports.REQUEST_ENRICHERS = _chunkNOF6QHE4cjs.ca; exports.REQUEST_FILES = _chunkNOF6QHE4cjs.Fa; exports.REQUEST_IDENTIFIERS = _chunkNOF6QHE4cjs.Da; exports.RETRY_REQUEST_DATA_SILO = _chunkNOF6QHE4cjs.xa; exports.RETRY_REQUEST_ENRICHER = _chunkNOF6QHE4cjs.da; exports.RepositoryInput = _chunkZD2HOHJIcjs.C; exports.RequestFileMetadata = _chunkSHV6R64Jcjs.B; exports.RequestFileMetadataResponse = _chunkSHV6R64Jcjs.C; exports.RequestIdentifiersResponse = _chunkNOF6QHE4cjs.He; exports.RiskAssignmentInput = _chunkZD2HOHJIcjs.U; exports.RiskLogicInput = _chunkZD2HOHJIcjs.V; exports.SET_RESOURCE_ATTRIBUTES = _chunkNOF6QHE4cjs.Sa; exports.SKIP_REQUEST_ENRICHER = _chunkNOF6QHE4cjs.ea; exports.SOFTWARE_DEVELOPMENT_KITS = _chunkNOF6QHE4cjs.O; exports.SOMBRA_VERSION = _chunkNOF6QHE4cjs.Zb; exports.SUB_DATA_POINTS = _chunkNOF6QHE4cjs.e; exports.SUB_DATA_POINTS_COUNT = _chunkNOF6QHE4cjs.f; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunkNOF6QHE4cjs.g; exports.SYNC_ATTRIBUTE_TYPES = _chunkNOF6QHE4cjs.ad; exports.SoftwareDevelopmentKitInput = _chunkZD2HOHJIcjs.z; exports.StoredApiKey = _chunkZD2HOHJIcjs.fa; exports.SuccessfulRequest = _chunkSHV6R64Jcjs.i; exports.TEAMS = _chunkNOF6QHE4cjs.za; exports.TEMPLATES = _chunkNOF6QHE4cjs.K; exports.TOGGLE_CONSENT_PRECEDENCE = _chunkNOF6QHE4cjs.lb; exports.TOGGLE_DATA_SUBJECT = _chunkNOF6QHE4cjs.B; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunkNOF6QHE4cjs.kb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunkNOF6QHE4cjs.jb; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunkNOF6QHE4cjs.ib; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkEG4L6YAJcjs.h; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkEG4L6YAJcjs.g; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkEG4L6YAJcjs.i; exports.TeamInput = _chunkZD2HOHJIcjs.d; exports.TemplateInput = _chunkZD2HOHJIcjs.a; exports.TranscendInput = _chunkZD2HOHJIcjs.ea; exports.TranscendPromptManager = F; exports.TranscendPullResource = _chunkBY7W4UQFcjs.d; exports.UPDATE_ACTION = _chunkNOF6QHE4cjs.vb; exports.UPDATE_ACTION_ITEMS = _chunkNOF6QHE4cjs.xb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunkNOF6QHE4cjs.Ka; exports.UPDATE_AGENTS = _chunkNOF6QHE4cjs.Jb; exports.UPDATE_AGENT_FILES = _chunkNOF6QHE4cjs.Mb; exports.UPDATE_AGENT_FUNCTIONS = _chunkNOF6QHE4cjs.Pb; exports.UPDATE_ATTRIBUTE = _chunkNOF6QHE4cjs.Ra; exports.UPDATE_ATTRIBUTE_VALUES = _chunkNOF6QHE4cjs.Na; exports.UPDATE_BUSINESS_ENTITIES = _chunkNOF6QHE4cjs.tb; exports.UPDATE_CODE_PACKAGES = _chunkNOF6QHE4cjs.S; exports.UPDATE_CONSENT_EXPERIENCE = _chunkNOF6QHE4cjs.nb; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunkNOF6QHE4cjs.fb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunkNOF6QHE4cjs.gb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunkNOF6QHE4cjs.mb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunkNOF6QHE4cjs.db; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunkNOF6QHE4cjs.cb; exports.UPDATE_DATA_FLOWS = _chunkNOF6QHE4cjs.Wa; exports.UPDATE_DATA_SILOS = _chunkNOF6QHE4cjs.n; exports.UPDATE_DATA_SUBJECT = _chunkNOF6QHE4cjs.A; exports.UPDATE_DATA_SUB_CATEGORIES = _chunkNOF6QHE4cjs.Vb; exports.UPDATE_ENRICHER = _chunkNOF6QHE4cjs.s; exports.UPDATE_IDENTIFIER = _chunkNOF6QHE4cjs.x; exports.UPDATE_INTL_MESSAGES = _chunkNOF6QHE4cjs.ba; exports.UPDATE_LOAD_OPTIONS = _chunkNOF6QHE4cjs.hb; exports.UPDATE_OR_CREATE_COOKIES = _chunkNOF6QHE4cjs.Xa; exports.UPDATE_OR_CREATE_DATA_POINT = _chunkNOF6QHE4cjs.h; exports.UPDATE_POLICIES = _chunkNOF6QHE4cjs.W; exports.UPDATE_PRIVACY_CENTER = _chunkNOF6QHE4cjs.Cb; exports.UPDATE_PRIVACY_REQUEST = _chunkNOF6QHE4cjs._; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkNOF6QHE4cjs.Yb; exports.UPDATE_PROMPTS = _chunkNOF6QHE4cjs.pa; exports.UPDATE_PROMPT_GROUPS = _chunkNOF6QHE4cjs.ta; exports.UPDATE_PROMPT_PARTIALS = _chunkNOF6QHE4cjs.ra; exports.UPDATE_REPOSITORIES = _chunkNOF6QHE4cjs.D; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunkNOF6QHE4cjs.P; exports.UPDATE_TEAM = _chunkNOF6QHE4cjs.Ba; exports.UPDATE_VENDORS = _chunkNOF6QHE4cjs.Sb; exports.USERS = _chunkNOF6QHE4cjs.Ea; exports.USP_STRING_REGEX = _chunkQXKWSBYRcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkL7NHDBBNcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkL7NHDBBNcjs.a; exports.VENDORS = _chunkNOF6QHE4cjs.Qb; exports.VendorInput = _chunkZD2HOHJIcjs.p; exports.WebhookHeader = _chunkZD2HOHJIcjs.b; exports.addMessagesToPromptRun = _chunkNOF6QHE4cjs.We; exports.appendCsvSync = _chunkZVK4HIDFcjs.b; exports.approvePrivacyRequests = _chunkSHV6R64Jcjs.I; exports.assumeRole = _chunkNOF6QHE4cjs.Oe; exports.buildAIIntegrationType = _chunkSAEKBZGFcjs.b; exports.buildEnabledRouteType = _chunkSAEKBZGFcjs.a; exports.buildTranscendGraphQLClient = _chunkNOF6QHE4cjs.xe; exports.buildTranscendGraphQLClientGeneric = _chunkNOF6QHE4cjs.we; exports.buildXdiSyncEndpoint = _chunk25UGE4YYcjs.g; exports.bulkRestartRequests = _chunkSHV6R64Jcjs.Q; exports.bulkRetryEnrichers = _chunkSHV6R64Jcjs.S; exports.cancelPrivacyRequests = _chunkSHV6R64Jcjs.L; exports.consentManagersToBusinessEntities = _chunk25UGE4YYcjs.h; exports.convertToDataSubjectAllowlist = _chunkNOF6QHE4cjs.qc; exports.convertToDataSubjectBlockList = _chunkNOF6QHE4cjs.pc; exports.createActionItemCollection = _chunkNOF6QHE4cjs.ud; exports.createActionItems = _chunkNOF6QHE4cjs.yd; exports.createAgent = _chunkNOF6QHE4cjs.rd; exports.createAgentFile = _chunkNOF6QHE4cjs.Gd; exports.createAgentFunction = _chunkNOF6QHE4cjs.Cd; exports.createApiKey = _chunkNOF6QHE4cjs.Qe; exports.createBusinessEntity = _chunkNOF6QHE4cjs.dd; exports.createCodePackage = _chunkNOF6QHE4cjs.qe; exports.createConsentToken = _chunkQXKWSBYRcjs.a; exports.createDataCategory = _chunkNOF6QHE4cjs.Od; exports.createDataFlows = _chunkNOF6QHE4cjs.id; exports.createProcessingPurpose = _chunkNOF6QHE4cjs.Sd; exports.createPrompt = _chunkNOF6QHE4cjs.Lc; exports.createRegexForTag = j; exports.createRepository = _chunkNOF6QHE4cjs.ne; exports.createSoftwareDevelopmentKit = _chunkNOF6QHE4cjs.ke; exports.createSombraGotInstance = _chunkNOF6QHE4cjs.ye; exports.createTranscendConsentGotInstance = _chunkNOF6QHE4cjs.Me; exports.createVendor = _chunkNOF6QHE4cjs.Kd; exports.defineTranscendPrompts = hm; exports.deleteApiKey = _chunkNOF6QHE4cjs.Re; exports.deployConsentManager = _chunkNOF6QHE4cjs.Te; exports.description = _chunkFPTEK7BGcjs.a; exports.domainToHost = _chunk25UGE4YYcjs.e; exports.downloadPrivacyRequestFiles = _chunkSHV6R64Jcjs.F; exports.enrichPrivacyRequest = _chunkXBHJO2OXcjs.c; exports.ensureAllDataSubjectsExist = _chunkNOF6QHE4cjs.oc; exports.extractClientError = _chunkSHV6R64Jcjs.N; exports.fetchActiveSiloDiscoPlugin = _chunkNOF6QHE4cjs.Wd; exports.fetchAllActionItems = _chunkNOF6QHE4cjs.xd; exports.fetchAllActions = _chunkNOF6QHE4cjs.nd; exports.fetchAllAgentFiles = _chunkNOF6QHE4cjs.Fd; exports.fetchAllAgentFunctions = _chunkNOF6QHE4cjs.Bd; exports.fetchAllAgents = _chunkNOF6QHE4cjs.qd; exports.fetchAllApiKeys = _chunkNOF6QHE4cjs.Hc; exports.fetchAllAssessmentTemplates = _chunkNOF6QHE4cjs.$d; exports.fetchAllAssessments = _chunkNOF6QHE4cjs._d; exports.fetchAllAttributeValues = _chunkNOF6QHE4cjs.$c; exports.fetchAllAttributes = _chunkNOF6QHE4cjs.bd; exports.fetchAllBusinessEntities = _chunkNOF6QHE4cjs.cd; exports.fetchAllCatalogs = _chunkNOF6QHE4cjs.ue; exports.fetchAllCookies = _chunkNOF6QHE4cjs.Zd; exports.fetchAllDataCategories = _chunkNOF6QHE4cjs.Nd; exports.fetchAllDataFlows = _chunkNOF6QHE4cjs.gd; exports.fetchAllDataPoints = _chunkNOF6QHE4cjs.tc; exports.fetchAllDataSilos = _chunkNOF6QHE4cjs.rc; exports.fetchAllDataSubjects = _chunkNOF6QHE4cjs.nc; exports.fetchAllEnrichers = _chunkNOF6QHE4cjs.kc; exports.fetchAllIdentifiers = _chunkNOF6QHE4cjs.hc; exports.fetchAllMessages = _chunkNOF6QHE4cjs.Yd; exports.fetchAllPolicies = _chunkNOF6QHE4cjs.Qc; exports.fetchAllPreferenceTopics = _chunkNOF6QHE4cjs.ge; exports.fetchAllPrivacyCenters = _chunkNOF6QHE4cjs.Xd; exports.fetchAllProcessingPurposes = _chunkNOF6QHE4cjs.Rd; exports.fetchAllPromptGroups = _chunkNOF6QHE4cjs.pd; exports.fetchAllPromptPartials = _chunkNOF6QHE4cjs.od; exports.fetchAllPromptThreads = _chunkNOF6QHE4cjs.Be; exports.fetchAllPrompts = _chunkNOF6QHE4cjs.Jc; exports.fetchAllPurposes = _chunkNOF6QHE4cjs.Yc; exports.fetchAllPurposesAndPreferences = _chunkNOF6QHE4cjs.he; exports.fetchAllRequestAttributeKeys = _chunkNOF6QHE4cjs.Ee; exports.fetchAllRequestEnrichers = _chunkNOF6QHE4cjs.Je; exports.fetchAllRequestIdentifierMetadata = _chunkNOF6QHE4cjs.Ce; exports.fetchAllRequestIdentifiers = _chunkNOF6QHE4cjs.Ie; exports.fetchAllRequests = _chunkNOF6QHE4cjs.Ge; exports.fetchAllSubDataPoints = _chunkNOF6QHE4cjs.sc; exports.fetchAllTeams = _chunkNOF6QHE4cjs.Fc; exports.fetchAllTemplates = _chunkNOF6QHE4cjs.ld; exports.fetchAllUsers = _chunkNOF6QHE4cjs.Pe; exports.fetchAllVendors = _chunkNOF6QHE4cjs.Jd; exports.fetchAndIndexCatalogs = _chunkNOF6QHE4cjs.ve; exports.fetchApiKeys = _chunkNOF6QHE4cjs.Ic; exports.fetchConsentManager = _chunkNOF6QHE4cjs.xc; exports.fetchConsentManagerAnalyticsData = _chunkNOF6QHE4cjs.Bc; exports.fetchConsentManagerExperiences = _chunkNOF6QHE4cjs.zc; exports.fetchConsentManagerId = _chunkNOF6QHE4cjs.yc; exports.fetchConsentManagerTheme = _chunkNOF6QHE4cjs.Cc; exports.fetchConsentPreferences = _chunk25UGE4YYcjs.j; exports.fetchEnrichedDataSilos = _chunkNOF6QHE4cjs.uc; exports.fetchIdentifiersAndCreateMissing = _chunkNOF6QHE4cjs.ic; exports.fetchPartitions = _chunkNOF6QHE4cjs.Wc; exports.fetchPrivacyCenterId = _chunkNOF6QHE4cjs.Pc; exports.fetchPrivacyCenterUrl = _chunkNOF6QHE4cjs.Oc; exports.fetchPromptsWithVariables = _chunkNOF6QHE4cjs.Kc; exports.fetchRequestDataSilo = _chunkNOF6QHE4cjs.Le; exports.fetchRequestDataSiloActiveCount = _chunkNOF6QHE4cjs.De; exports.fetchRequestDataSilos = _chunkNOF6QHE4cjs.Ke; exports.fetchRequestFilesForRequest = _chunkNOF6QHE4cjs.Se; exports.filterNullishValuesFromObject = Am; exports.filterRows = _chunkSHV6R64Jcjs.s; exports.fuzzyMatchColumns = _chunkSHV6R64Jcjs.l; exports.fuzzySearch = _chunkSHV6R64Jcjs.k; exports.generateCrossAccountApiKeys = _chunkWAYG2MDLcjs.a; exports.getFileMetadataForPrivacyRequests = _chunkSHV6R64Jcjs.D; exports.getGitFilesThatChanged = Rm; exports.getUniqueValuesForColumn = _chunkSHV6R64Jcjs.r; exports.inquirerAutoComplete = _chunkU6G3J6VJcjs.c; exports.inquirerConfirmBoolean = _chunkU6G3J6VJcjs.a; exports.inquirerConfirmText = _chunkU6G3J6VJcjs.b; exports.listDirectories = _chunkWAYG2MDLcjs.d; exports.listFiles = _chunkWAYG2MDLcjs.c; exports.loginUser = _chunkNOF6QHE4cjs.Ne; exports.makeGraphQLRequest = _chunkNOF6QHE4cjs.gc; exports.mapColumnsToAttributes = _chunkSHV6R64Jcjs.M; exports.mapColumnsToIdentifiers = _chunkSHV6R64Jcjs.K; exports.mapCsvColumnsToApi = _chunkSHV6R64Jcjs.u; exports.mapCsvRowsToRequestInputs = _chunkSHV6R64Jcjs.z; exports.mapEnumValues = _chunkSHV6R64Jcjs.m; exports.mapRequestEnumValues = _chunkSHV6R64Jcjs.v; exports.markCronIdentifierCompleted = _chunkKWG56BUXcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkKWG56BUXcjs.f; exports.markSilentPrivacyRequests = _chunkSHV6R64Jcjs.t; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkEG4L6YAJcjs.a; exports.normalizeIdentifierValue = _chunkSHV6R64Jcjs.y; exports.notifyPrivacyRequestsAdditionalTime = _chunkSHV6R64Jcjs.J; exports.parseAssessmentDisplayLogic = _chunkNOF6QHE4cjs.de; exports.parseAssessmentRiskLogic = _chunkNOF6QHE4cjs.fe; exports.parseAttributesFromString = _chunkSHV6R64Jcjs.p; exports.parseFilePath = _chunkZVK4HIDFcjs.d; exports.parseVariablesFromString = _chunkTD7ADMVOcjs.a; exports.pullAllDatapoints = _chunkHAOVN3XOcjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkKWG56BUXcjs.g; exports.pullConsentManagerMetrics = _chunk25UGE4YYcjs.d; exports.pullCronPageOfIdentifiers = _chunkKWG56BUXcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkXBHJO2OXcjs.a; exports.pullPrivacyRequests = _chunkSHV6R64Jcjs.U; exports.pullTranscendConfiguration = _chunkNOF6QHE4cjs.je; exports.pullUnstructuredSubDataPointRecommendations = _chunkHAOVN3XOcjs.b; exports.pushCronIdentifiersFromCsv = _chunkKWG56BUXcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkXBHJO2OXcjs.d; exports.readCsv = _chunkSHV6R64Jcjs.q; exports.readTranscendYaml = _chunkL7NHDBBNcjs.d; exports.removeLinks = Pm; exports.removeUnverifiedRequestIdentifiers = _chunkSHV6R64Jcjs.W; exports.replaceVariablesInYaml = _chunkL7NHDBBNcjs.c; exports.reportPromptRun = _chunkNOF6QHE4cjs.Ve; exports.restartPrivacyRequest = _chunkSHV6R64Jcjs.P; exports.retryRequestDataSilos = _chunkSHV6R64Jcjs.T; exports.retryRequestEnricher = _chunkNOF6QHE4cjs.Ae; exports.setResourceAttributes = _chunkNOF6QHE4cjs.ze; exports.skipPreflightJobs = _chunkSHV6R64Jcjs.R; exports.skipRequestDataSilos = _chunkSHV6R64Jcjs.V; exports.splitCsvToList = _chunkSHV6R64Jcjs.n; exports.streamPrivacyRequestFiles = _chunkSHV6R64Jcjs.E; exports.submitPrivacyRequest = _chunkSHV6R64Jcjs.H; exports.syncAction = _chunkNOF6QHE4cjs.kd; exports.syncActionItemCollections = _chunkNOF6QHE4cjs.wd; exports.syncActionItems = _chunkNOF6QHE4cjs.Ad; exports.syncAgentFiles = _chunkNOF6QHE4cjs.Id; exports.syncAgentFunctions = _chunkNOF6QHE4cjs.Ed; exports.syncAgents = _chunkNOF6QHE4cjs.td; exports.syncAttribute = _chunkNOF6QHE4cjs.mc; exports.syncBusinessEntities = _chunkNOF6QHE4cjs.fd; exports.syncCodePackages = _chunkNOF6QHE4cjs.se; exports.syncConfigurationToTranscend = _chunkNOF6QHE4cjs.Vd; exports.syncConsentManager = _chunkNOF6QHE4cjs._c; exports.syncConsentManagerExperiences = _chunkNOF6QHE4cjs.Zc; exports.syncCookies = _chunkNOF6QHE4cjs.Ec; exports.syncDataCategories = _chunkNOF6QHE4cjs.Qd; exports.syncDataFlows = _chunkNOF6QHE4cjs.jd; exports.syncDataSiloDependencies = _chunkNOF6QHE4cjs.wc; exports.syncDataSilos = _chunkNOF6QHE4cjs.vc; exports.syncDataSubject = _chunkNOF6QHE4cjs.Gc; exports.syncEnricher = _chunkNOF6QHE4cjs.lc; exports.syncIdentifier = _chunkNOF6QHE4cjs.jc; exports.syncIntlMessages = _chunkNOF6QHE4cjs.Uc; exports.syncPartitions = _chunkNOF6QHE4cjs.Xc; exports.syncPolicies = _chunkNOF6QHE4cjs.Sc; exports.syncPrivacyCenter = _chunkNOF6QHE4cjs.Vc; exports.syncProcessingPurposes = _chunkNOF6QHE4cjs.Ud; exports.syncPrompts = _chunkNOF6QHE4cjs.Nc; exports.syncRepositories = _chunkNOF6QHE4cjs.pe; exports.syncSoftwareDevelopmentKits = _chunkNOF6QHE4cjs.me; exports.syncTemplate = _chunkNOF6QHE4cjs.md; exports.syncVendors = _chunkNOF6QHE4cjs.Md; exports.updateActionItem = _chunkNOF6QHE4cjs.zd; exports.updateActionItemCollection = _chunkNOF6QHE4cjs.vd; exports.updateAgentFiles = _chunkNOF6QHE4cjs.Hd; exports.updateAgentFunctions = _chunkNOF6QHE4cjs.Dd; exports.updateAgents = _chunkNOF6QHE4cjs.sd; exports.updateBusinessEntities = _chunkNOF6QHE4cjs.ed; exports.updateCodePackages = _chunkNOF6QHE4cjs.re; exports.updateConsentManagerToLatest = _chunkNOF6QHE4cjs.Ue; exports.updateConsentManagerVersionToLatest = _chunk25UGE4YYcjs.a; exports.updateDataCategories = _chunkNOF6QHE4cjs.Pd; exports.updateDataFlows = _chunkNOF6QHE4cjs.hd; exports.updateIntlMessages = _chunkNOF6QHE4cjs.Tc; exports.updateOrCreateCookies = _chunkNOF6QHE4cjs.Dc; exports.updatePolicies = _chunkNOF6QHE4cjs.Rc; exports.updateProcessingPurposes = _chunkNOF6QHE4cjs.Td; exports.updatePrompts = _chunkNOF6QHE4cjs.Mc; exports.updateRepositories = _chunkNOF6QHE4cjs.oe; exports.updateSoftwareDevelopmentKits = _chunkNOF6QHE4cjs.le; exports.updateVendors = _chunkNOF6QHE4cjs.Ld; exports.uploadConsents = _chunkQXKWSBYRcjs.f; exports.uploadCookiesFromCsv = _chunk25UGE4YYcjs.c; exports.uploadDataFlowsFromCsv = _chunk25UGE4YYcjs.b; exports.uploadPrivacyRequestsFromCsv = _chunkSHV6R64Jcjs.O; exports.uploadSiloDiscoveryResults = _chunkNOF6QHE4cjs.te; exports.validateTranscendAuth = _chunkWAYG2MDLcjs.b; exports.version = _chunkFPTEK7BGcjs.b; exports.writeCsv = _chunkZVK4HIDFcjs.c; exports.writeCsvSync = _chunkZVK4HIDFcjs.a; exports.writeLargeCsv = _chunkZVK4HIDFcjs.e; exports.writeTranscendYaml = _chunkL7NHDBBNcjs.e;
|
|
3
|
+
`)[0];if(!o||!i)throw new Error("FAILED TO FIND COMMIT RANGE");let p=_child_process.execSync.call(void 0, `git fetch && git diff --name-only "${a||o}...${i}" -- ${e}`,{encoding:"utf-8"}),m=_chunkY4BWTFTXcjs.c.call(void 0, p.split(`
|
|
4
|
+
`).filter(d=>d),s),c=t.length>0?_fastglob2.default.sync(m,{ignore:t}):m,n={};c.forEach(d=>{let Q=_child_process.execSync.call(void 0, `git show ${i}:${d}`,{encoding:"utf-8"});n[d]=Q});let g=r.split("/").pop().split(".")[0];return{changedFiles:m,fileDiffs:n,repoName:g,commit:i}}exports.ACTIONS = _chunk3ZKZCSGDcjs.vb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunk3ZKZCSGDcjs.Ia; exports.ADD_SILO_DISCOVERY_RESULTS = _chunk3ZKZCSGDcjs.I; exports.ADMIN_DASH = _chunkE3CF3RKXcjs.b; exports.ADMIN_DASH_DATAPOINTS = _chunkE3CF3RKXcjs.d; exports.ADMIN_DASH_INTEGRATIONS = _chunkE3CF3RKXcjs.c; exports.AGENTS = _chunk3ZKZCSGDcjs.Ib; exports.AGENT_FILES = _chunk3ZKZCSGDcjs.Lb; exports.AGENT_FUNCTIONS = _chunk3ZKZCSGDcjs.Ob; exports.API_KEYS = _chunk3ZKZCSGDcjs.F; exports.APPROVE_PRIVACY_REQUEST = _chunk3ZKZCSGDcjs.Y; exports.ASSESSMENTS = _chunk3ZKZCSGDcjs.ga; exports.ASSESSMENT_SECTION_FIELDS = _chunk3ZKZCSGDcjs.fa; exports.ASSESSMENT_TEMPLATES = _chunk3ZKZCSGDcjs.ka; exports.ASSUME_ROLE = _chunk3ZKZCSGDcjs.Gb; exports.ATTRIBUTES = _chunk3ZKZCSGDcjs.Ma; exports.ATTRIBUTE_KEYS_REQUESTS = _chunk3ZKZCSGDcjs.N; exports.ATTRIBUTE_VALUES = _chunk3ZKZCSGDcjs.Qa; exports.ActionInput = _chunkZD2HOHJIcjs.E; exports.ActionItemCollectionInput = _chunkZD2HOHJIcjs.P; exports.ActionItemInput = _chunkZD2HOHJIcjs.Q; exports.AgentFileInput = _chunkZD2HOHJIcjs.o; exports.AgentFunctionInput = _chunkZD2HOHJIcjs.n; exports.AgentInput = _chunkZD2HOHJIcjs.m; exports.ApiKeyInput = _chunkZD2HOHJIcjs.c; exports.AssessmentAction = _chunk3ZKZCSGDcjs.Xd; exports.AssessmentAnswerOptionInput = _chunkZD2HOHJIcjs.W; exports.AssessmentDisplayLogicInput = _chunkZD2HOHJIcjs.T; exports.AssessmentInput = _chunkZD2HOHJIcjs.aa; exports.AssessmentNestedRule = _chunk3ZKZCSGDcjs.Wd; exports.AssessmentNestedRuleInput = _chunkZD2HOHJIcjs.S; exports.AssessmentResourceInput = _chunkZD2HOHJIcjs.$; exports.AssessmentRetentionScheduleInput = _chunkZD2HOHJIcjs.Z; exports.AssessmentRiskLogic = _chunk3ZKZCSGDcjs.Zd; exports.AssessmentRule = _chunk3ZKZCSGDcjs.Vd; exports.AssessmentRuleInput = _chunkZD2HOHJIcjs.R; exports.AssessmentSectionInput = _chunkZD2HOHJIcjs.Y; exports.AssessmentSectionQuestionInput = _chunkZD2HOHJIcjs.X; exports.AssessmentTemplateInput = _chunkZD2HOHJIcjs._; exports.AttestedExtraIdentifiers = _chunkWIXQSFS6cjs.w; exports.AttributeInput = _chunkZD2HOHJIcjs.k; exports.AttributePreview = _chunkZD2HOHJIcjs.l; exports.AttributeValueInput = _chunkZD2HOHJIcjs.j; exports.BLANK = _chunkWIXQSFS6cjs.c; exports.BULK_APPLY = _chunkWIXQSFS6cjs.b; exports.BULK_REQUEST_FILES = _chunk3ZKZCSGDcjs.Ga; exports.BUSINESS_ENTITIES = _chunk3ZKZCSGDcjs.sb; exports.BusinessEntityInput = _chunkZD2HOHJIcjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunk3ZKZCSGDcjs.Z; exports.CAN_APPLY_IN_BULK = _chunkWIXQSFS6cjs.g; exports.CATALOGS = _chunk3ZKZCSGDcjs.t; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunk3ZKZCSGDcjs.wa; exports.CODE_PACKAGES = _chunk3ZKZCSGDcjs.R; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunk3ZKZCSGDcjs.rb; exports.CONSENT_PARTITIONS = _chunk3ZKZCSGDcjs.Va; exports.COOKIES = _chunk3ZKZCSGDcjs._a; exports.CREATE_ACTION_ITEMS = _chunk3ZKZCSGDcjs.zb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunk3ZKZCSGDcjs.Ka; exports.CREATE_AGENT = _chunk3ZKZCSGDcjs.Jb; exports.CREATE_AGENT_FILE = _chunk3ZKZCSGDcjs.Mb; exports.CREATE_AGENT_FUNCTION = _chunk3ZKZCSGDcjs.Pb; exports.CREATE_API_KEY = _chunk3ZKZCSGDcjs.G; exports.CREATE_ATTRIBUTE = _chunk3ZKZCSGDcjs.Ra; exports.CREATE_ATTRIBUTE_VALUES = _chunk3ZKZCSGDcjs.Na; exports.CREATE_BUSINESS_ENTITY = _chunk3ZKZCSGDcjs.tb; exports.CREATE_CODE_PACKAGE = _chunk3ZKZCSGDcjs.T; exports.CREATE_CONSENT_EXPERIENCE = _chunk3ZKZCSGDcjs.pb; exports.CREATE_CONSENT_MANAGER = _chunk3ZKZCSGDcjs.cb; exports.CREATE_CONSENT_PARTITION = _chunk3ZKZCSGDcjs.qb; exports.CREATE_DATA_FLOWS = _chunk3ZKZCSGDcjs.Wa; exports.CREATE_DATA_SILOS = _chunk3ZKZCSGDcjs.o; exports.CREATE_DATA_SUBJECT = _chunk3ZKZCSGDcjs.z; exports.CREATE_DATA_SUB_CATEGORY = _chunk3ZKZCSGDcjs.Vb; exports.CREATE_ENRICHER = _chunk3ZKZCSGDcjs.r; exports.CREATE_IDENTIFIER = _chunk3ZKZCSGDcjs.w; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunk3ZKZCSGDcjs.Yb; exports.CREATE_PROMPT = _chunk3ZKZCSGDcjs.qa; exports.CREATE_PROMPT_GROUP = _chunk3ZKZCSGDcjs.ua; exports.CREATE_PROMPT_PARTIAL = _chunk3ZKZCSGDcjs.sa; exports.CREATE_REPOSITORY = _chunk3ZKZCSGDcjs.E; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunk3ZKZCSGDcjs.Q; exports.CREATE_TEAM = _chunk3ZKZCSGDcjs.Aa; exports.CREATE_TEMPLATE = _chunk3ZKZCSGDcjs.L; exports.CREATE_VENDOR = _chunk3ZKZCSGDcjs.Sb; exports.CachedFileState = _chunkWIXQSFS6cjs.h; exports.CachedRequestState = _chunkWIXQSFS6cjs.j; exports.CodePackageInput = _chunkZD2HOHJIcjs.B; exports.CodePackageSdk = _chunkZD2HOHJIcjs.A; exports.ColumnName = _chunkWIXQSFS6cjs.e; exports.ConsentManageExperienceInput = _chunkZD2HOHJIcjs.I; exports.ConsentManagerInput = _chunkZD2HOHJIcjs.K; exports.ConsentManagerMetricBin = _chunk3ZKZCSGDcjs.tc; exports.ConsentManagerServiceMetadata = _chunkZD2HOHJIcjs.ia; exports.ConsentPreferenceResponse = _chunkTS5EYI4Ocjs.i; exports.ConsentPreferenceTopic = _chunkZD2HOHJIcjs.ca; exports.ConsentPreferenceTopicOptionValue = _chunkZD2HOHJIcjs.ba; exports.ConsentPurpose = _chunkZD2HOHJIcjs.da; exports.CookieCsvInput = _chunkZD2HOHJIcjs.ha; exports.CookieInput = _chunkZD2HOHJIcjs.H; exports.CronIdentifier = _chunk6FGYCQAQcjs.a; exports.CronIdentifierPush = _chunk6FGYCQAQcjs.c; exports.DATAPOINT_EXPORT = _chunk3ZKZCSGDcjs.i; exports.DATA_FLOWS = _chunk3ZKZCSGDcjs.Za; exports.DATA_POINTS = _chunk3ZKZCSGDcjs.c; exports.DATA_POINT_COUNT = _chunk3ZKZCSGDcjs.d; exports.DATA_SILOS = _chunk3ZKZCSGDcjs.k; exports.DATA_SILOS_ENRICHED = _chunk3ZKZCSGDcjs.m; exports.DATA_SILO_EXPORT = _chunk3ZKZCSGDcjs.l; exports.DATA_SUBJECTS = _chunk3ZKZCSGDcjs.y; exports.DATA_SUB_CATEGORIES = _chunk3ZKZCSGDcjs.Ub; exports.DEFAULT_TRANSCEND_API = _chunkE3CF3RKXcjs.e; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkE3CF3RKXcjs.f; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunk3ZKZCSGDcjs.be; exports.DELETE_API_KEY = _chunk3ZKZCSGDcjs.H; exports.DELETE_ATTRIBUTE_VALUE = _chunk3ZKZCSGDcjs.Pa; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunk3ZKZCSGDcjs.Bb; exports.DEPLOY_CONSENT_MANAGER = _chunk3ZKZCSGDcjs.fb; exports.DETERMINE_LOGIN_METHOD = _chunk3ZKZCSGDcjs.Eb; exports.DataCategoryGuessInput = _chunkZD2HOHJIcjs.h; exports.DataCategoryInput = _chunkZD2HOHJIcjs.q; exports.DataCategoryPreviewInput = _chunkZD2HOHJIcjs.g; exports.DataCategoryRecommendationInput = _chunkZD2HOHJIcjs.i; exports.DataFlowCsvInput = _chunkZD2HOHJIcjs.ga; exports.DataFlowInput = _chunkZD2HOHJIcjs.G; exports.DataSiloInput = _chunkZD2HOHJIcjs.O; exports.DataSubjectInput = _chunkZD2HOHJIcjs.D; exports.DatapointInput = _chunkZD2HOHJIcjs.w; exports.ENABLED_PLUGINS = _chunk3ZKZCSGDcjs.J; exports.ENRICHERS = _chunk3ZKZCSGDcjs.p; exports.ENTRY_COUNT = _chunk3ZKZCSGDcjs.j; exports.EXPERIENCES = _chunk3ZKZCSGDcjs.Ua; exports.EnrichPrivacyRequest = _chunkBF5T3SGEcjs.b; exports.EnricherInput = _chunkZD2HOHJIcjs.e; exports.FETCH_CONSENT_MANAGER = _chunk3ZKZCSGDcjs.ab; exports.FETCH_CONSENT_MANAGER_ID = _chunk3ZKZCSGDcjs.$a; exports.FETCH_CONSENT_MANAGER_THEME = _chunk3ZKZCSGDcjs.bb; exports.FETCH_PRIVACY_CENTER_ID = _chunk3ZKZCSGDcjs.Ab; exports.FieldInput = _chunkZD2HOHJIcjs.v; exports.GLOBAL_ACTION_ITEMS = _chunk3ZKZCSGDcjs.xb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunk3ZKZCSGDcjs.Ja; exports.IDENTIFIERS = _chunk3ZKZCSGDcjs.u; exports.IDENTIFIER_BLOCK_LIST = _chunkWIXQSFS6cjs.d; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunk3ZKZCSGDcjs.ha; exports.INITIALIZER = _chunk3ZKZCSGDcjs.q; exports.IP_ADDRESS_REGEX = _chunkTS5EYI4Ocjs.f; exports.IS_REQUIRED = _chunkWIXQSFS6cjs.f; exports.IdentifierInput = _chunkZD2HOHJIcjs.F; exports.ImportOnetrustAssessmentsInput = _chunkZD2HOHJIcjs.pa; exports.IntlMessage = _chunkWIXQSFS6cjs.A; exports.IntlMessageInput = _chunkZD2HOHJIcjs.N; exports.LARGE_LANGUAGE_MODELS = _chunk3ZKZCSGDcjs.Hb; exports.LOGIN = _chunk3ZKZCSGDcjs.Fb; exports.MESSAGES = _chunk3ZKZCSGDcjs.aa; exports.NEW_IDENTIFIER_TYPES = _chunk3ZKZCSGDcjs.v; exports.NONE = _chunkWIXQSFS6cjs.a; exports.NOTIFY_ADDITIONAL_TIME = _chunk3ZKZCSGDcjs.$; exports.ORGANIZATION = _chunk3ZKZCSGDcjs.M; exports.OneTrustFileFormat = _chunkBY7W4UQFcjs.a; exports.OneTrustPullResource = _chunkBY7W4UQFcjs.b; exports.OneTrustPullSource = _chunkBY7W4UQFcjs.c; exports.OpenAIEnabledRoute = _chunkZD2HOHJIcjs.ka; exports.OpenAIEnabledRoutes = _chunkZD2HOHJIcjs.la; exports.OpenAIIntegration = _chunkZD2HOHJIcjs.ma; exports.OpenAIRouteName = _chunkBY7W4UQFcjs.f; exports.POLICIES = _chunk3ZKZCSGDcjs.V; exports.PREFERENCE_TOPICS = _chunk3ZKZCSGDcjs.ja; exports.PRIVACY_CENTER = _chunk3ZKZCSGDcjs.Cb; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunk3ZKZCSGDcjs.Xb; exports.PROMPTS = _chunk3ZKZCSGDcjs.la; exports.PROMPTS_WITH_VARIABLES = _chunk3ZKZCSGDcjs.oa; exports.PROMPT_GROUPS = _chunk3ZKZCSGDcjs.na; exports.PROMPT_PARTIALS = _chunk3ZKZCSGDcjs.ma; exports.PROMPT_THREADS = _chunk3ZKZCSGDcjs.U; exports.PURPOSES = _chunk3ZKZCSGDcjs.ia; exports.ParsedAttributeInput = _chunkWIXQSFS6cjs.o; exports.PartitionInput = _chunkZD2HOHJIcjs.J; exports.PathfinderPolicy = _chunkZD2HOHJIcjs.na; exports.PathfinderPolicyName = _chunkBY7W4UQFcjs.e; exports.PathfinderPolicyNameC = _chunkZD2HOHJIcjs.ja; exports.PathfinderPromptRunMetadata = _chunkZD2HOHJIcjs.oa; exports.PolicyInput = _chunkZD2HOHJIcjs.M; exports.PrivacyCenterInput = _chunkZD2HOHJIcjs.L; exports.PrivacyRequest = _chunk3ZKZCSGDcjs.ye; exports.PrivacyRequestInput = _chunkWIXQSFS6cjs.x; exports.PrivacyRequestResponse = _chunkWIXQSFS6cjs.G; exports.ProcessingPurposeInput = _chunkZD2HOHJIcjs.r; exports.ProcessingPurposePreviewInput = _chunkZD2HOHJIcjs.f; exports.PromptAVendorEmailSettings = _chunkZD2HOHJIcjs.x; exports.PromptGroupInput = _chunkZD2HOHJIcjs.u; exports.PromptInput = _chunkZD2HOHJIcjs.s; exports.PromptPartialInput = _chunkZD2HOHJIcjs.t; exports.PurposeMap = _chunk6DWFLWWTcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunk3ZKZCSGDcjs.ya; exports.REMOVE_REQUEST_IDENTIFIERS = _chunk3ZKZCSGDcjs.Ca; exports.REPORT_PROMPT_RUN = _chunk3ZKZCSGDcjs.Ha; exports.REPOSITORIES = _chunk3ZKZCSGDcjs.C; exports.REQUESTS = _chunk3ZKZCSGDcjs.X; exports.REQUEST_DATA_SILOS = _chunk3ZKZCSGDcjs.va; exports.REQUEST_ENRICHERS = _chunk3ZKZCSGDcjs.ca; exports.REQUEST_FILES = _chunk3ZKZCSGDcjs.Fa; exports.REQUEST_IDENTIFIERS = _chunk3ZKZCSGDcjs.Da; exports.RETRY_REQUEST_DATA_SILO = _chunk3ZKZCSGDcjs.xa; exports.RETRY_REQUEST_ENRICHER = _chunk3ZKZCSGDcjs.da; exports.RepositoryInput = _chunkZD2HOHJIcjs.C; exports.RequestFileMetadata = _chunkWIXQSFS6cjs.B; exports.RequestFileMetadataResponse = _chunkWIXQSFS6cjs.C; exports.RequestIdentifiersResponse = _chunk3ZKZCSGDcjs.Ae; exports.RiskAssignmentInput = _chunkZD2HOHJIcjs.U; exports.RiskLogicInput = _chunkZD2HOHJIcjs.V; exports.SCOPES_BY_TITLE = _chunkE3CF3RKXcjs.j; exports.SCOPE_TITLES = _chunkE3CF3RKXcjs.k; exports.SET_RESOURCE_ATTRIBUTES = _chunk3ZKZCSGDcjs.Ta; exports.SKIP_REQUEST_ENRICHER = _chunk3ZKZCSGDcjs.ea; exports.SOFTWARE_DEVELOPMENT_KITS = _chunk3ZKZCSGDcjs.O; exports.SOMBRA_VERSION = _chunk3ZKZCSGDcjs._b; exports.SUB_DATA_POINTS = _chunk3ZKZCSGDcjs.e; exports.SUB_DATA_POINTS_COUNT = _chunk3ZKZCSGDcjs.f; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunk3ZKZCSGDcjs.g; exports.SYNC_ATTRIBUTE_TYPES = _chunk3ZKZCSGDcjs.Vc; exports.SoftwareDevelopmentKitInput = _chunkZD2HOHJIcjs.z; exports.StoredApiKey = _chunkZD2HOHJIcjs.fa; exports.SuccessfulRequest = _chunkWIXQSFS6cjs.i; exports.TEAMS = _chunk3ZKZCSGDcjs.za; exports.TEMPLATES = _chunk3ZKZCSGDcjs.K; exports.TOGGLE_CONSENT_PRECEDENCE = _chunk3ZKZCSGDcjs.mb; exports.TOGGLE_DATA_SUBJECT = _chunk3ZKZCSGDcjs.B; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunk3ZKZCSGDcjs.lb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunk3ZKZCSGDcjs.kb; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunk3ZKZCSGDcjs.jb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkE3CF3RKXcjs.h; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkE3CF3RKXcjs.g; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkE3CF3RKXcjs.i; exports.TeamInput = _chunkZD2HOHJIcjs.d; exports.TemplateInput = _chunkZD2HOHJIcjs.a; exports.TranscendInput = _chunkZD2HOHJIcjs.ea; exports.TranscendPromptManager = F; exports.TranscendPullResource = _chunkBY7W4UQFcjs.d; exports.UPDATE_ACTION = _chunk3ZKZCSGDcjs.wb; exports.UPDATE_ACTION_ITEMS = _chunk3ZKZCSGDcjs.yb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunk3ZKZCSGDcjs.La; exports.UPDATE_AGENTS = _chunk3ZKZCSGDcjs.Kb; exports.UPDATE_AGENT_FILES = _chunk3ZKZCSGDcjs.Nb; exports.UPDATE_AGENT_FUNCTIONS = _chunk3ZKZCSGDcjs.Qb; exports.UPDATE_ATTRIBUTE = _chunk3ZKZCSGDcjs.Sa; exports.UPDATE_ATTRIBUTE_VALUES = _chunk3ZKZCSGDcjs.Oa; exports.UPDATE_BUSINESS_ENTITIES = _chunk3ZKZCSGDcjs.ub; exports.UPDATE_CODE_PACKAGES = _chunk3ZKZCSGDcjs.S; exports.UPDATE_CONSENT_EXPERIENCE = _chunk3ZKZCSGDcjs.ob; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunk3ZKZCSGDcjs.gb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunk3ZKZCSGDcjs.hb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunk3ZKZCSGDcjs.nb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunk3ZKZCSGDcjs.eb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunk3ZKZCSGDcjs.db; exports.UPDATE_DATA_FLOWS = _chunk3ZKZCSGDcjs.Xa; exports.UPDATE_DATA_SILOS = _chunk3ZKZCSGDcjs.n; exports.UPDATE_DATA_SUBJECT = _chunk3ZKZCSGDcjs.A; exports.UPDATE_DATA_SUB_CATEGORIES = _chunk3ZKZCSGDcjs.Wb; exports.UPDATE_ENRICHER = _chunk3ZKZCSGDcjs.s; exports.UPDATE_IDENTIFIER = _chunk3ZKZCSGDcjs.x; exports.UPDATE_INTL_MESSAGES = _chunk3ZKZCSGDcjs.ba; exports.UPDATE_LOAD_OPTIONS = _chunk3ZKZCSGDcjs.ib; exports.UPDATE_OR_CREATE_COOKIES = _chunk3ZKZCSGDcjs.Ya; exports.UPDATE_OR_CREATE_DATA_POINT = _chunk3ZKZCSGDcjs.h; exports.UPDATE_POLICIES = _chunk3ZKZCSGDcjs.W; exports.UPDATE_PRIVACY_CENTER = _chunk3ZKZCSGDcjs.Db; exports.UPDATE_PRIVACY_REQUEST = _chunk3ZKZCSGDcjs._; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunk3ZKZCSGDcjs.Zb; exports.UPDATE_PROMPTS = _chunk3ZKZCSGDcjs.pa; exports.UPDATE_PROMPT_GROUPS = _chunk3ZKZCSGDcjs.ta; exports.UPDATE_PROMPT_PARTIALS = _chunk3ZKZCSGDcjs.ra; exports.UPDATE_REPOSITORIES = _chunk3ZKZCSGDcjs.D; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunk3ZKZCSGDcjs.P; exports.UPDATE_TEAM = _chunk3ZKZCSGDcjs.Ba; exports.UPDATE_VENDORS = _chunk3ZKZCSGDcjs.Tb; exports.USERS = _chunk3ZKZCSGDcjs.Ea; exports.USP_STRING_REGEX = _chunk6DWFLWWTcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkL7NHDBBNcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkL7NHDBBNcjs.a; exports.VENDORS = _chunk3ZKZCSGDcjs.Rb; exports.VendorInput = _chunkZD2HOHJIcjs.p; exports.WebhookHeader = _chunkZD2HOHJIcjs.b; exports.addMessagesToPromptRun = _chunk3ZKZCSGDcjs.Pe; exports.appendCsvSync = _chunkZVK4HIDFcjs.b; exports.approvePrivacyRequests = _chunkWIXQSFS6cjs.I; exports.assumeRole = _chunk3ZKZCSGDcjs.He; exports.buildAIIntegrationType = _chunkSAEKBZGFcjs.b; exports.buildEnabledRouteType = _chunkSAEKBZGFcjs.a; exports.buildTranscendGraphQLClient = _chunk3ZKZCSGDcjs.qe; exports.buildTranscendGraphQLClientGeneric = _chunk3ZKZCSGDcjs.pe; exports.buildXdiSyncEndpoint = _chunkTS5EYI4Ocjs.g; exports.bulkRestartRequests = _chunkWIXQSFS6cjs.Q; exports.bulkRetryEnrichers = _chunkWIXQSFS6cjs.S; exports.cancelPrivacyRequests = _chunkWIXQSFS6cjs.L; exports.consentManagersToBusinessEntities = _chunkTS5EYI4Ocjs.h; exports.convertToDataSubjectAllowlist = _chunk3ZKZCSGDcjs.jc; exports.convertToDataSubjectBlockList = _chunk3ZKZCSGDcjs.ic; exports.createActionItemCollection = _chunk3ZKZCSGDcjs.nd; exports.createActionItems = _chunk3ZKZCSGDcjs.rd; exports.createAgent = _chunk3ZKZCSGDcjs.kd; exports.createAgentFile = _chunk3ZKZCSGDcjs.zd; exports.createAgentFunction = _chunk3ZKZCSGDcjs.vd; exports.createApiKey = _chunk3ZKZCSGDcjs.Je; exports.createBusinessEntity = _chunk3ZKZCSGDcjs.Yc; exports.createCodePackage = _chunk3ZKZCSGDcjs.je; exports.createConsentToken = _chunk6DWFLWWTcjs.a; exports.createDataCategory = _chunk3ZKZCSGDcjs.Hd; exports.createDataFlows = _chunk3ZKZCSGDcjs.bd; exports.createProcessingPurpose = _chunk3ZKZCSGDcjs.Ld; exports.createPrompt = _chunk3ZKZCSGDcjs.Ec; exports.createRegexForTag = j; exports.createRepository = _chunk3ZKZCSGDcjs.ge; exports.createSoftwareDevelopmentKit = _chunk3ZKZCSGDcjs.de; exports.createSombraGotInstance = _chunk3ZKZCSGDcjs.re; exports.createTranscendConsentGotInstance = _chunk3ZKZCSGDcjs.Fe; exports.createVendor = _chunk3ZKZCSGDcjs.Dd; exports.defineTranscendPrompts = Tm; exports.deleteApiKey = _chunk3ZKZCSGDcjs.Ke; exports.deployConsentManager = _chunk3ZKZCSGDcjs.Me; exports.description = _chunkY4BWTFTXcjs.l; exports.domainToHost = _chunkTS5EYI4Ocjs.e; exports.downloadPrivacyRequestFiles = _chunkWIXQSFS6cjs.F; exports.enrichPrivacyRequest = _chunkBF5T3SGEcjs.c; exports.ensureAllDataSubjectsExist = _chunk3ZKZCSGDcjs.hc; exports.extractClientError = _chunkWIXQSFS6cjs.N; exports.fetchActiveSiloDiscoPlugin = _chunk3ZKZCSGDcjs.Pd; exports.fetchAllActionItems = _chunk3ZKZCSGDcjs.qd; exports.fetchAllActions = _chunk3ZKZCSGDcjs.gd; exports.fetchAllAgentFiles = _chunk3ZKZCSGDcjs.yd; exports.fetchAllAgentFunctions = _chunk3ZKZCSGDcjs.ud; exports.fetchAllAgents = _chunk3ZKZCSGDcjs.jd; exports.fetchAllApiKeys = _chunk3ZKZCSGDcjs.Ac; exports.fetchAllAssessmentTemplates = _chunk3ZKZCSGDcjs.Ud; exports.fetchAllAssessments = _chunk3ZKZCSGDcjs.Td; exports.fetchAllAttributeValues = _chunk3ZKZCSGDcjs.Uc; exports.fetchAllAttributes = _chunk3ZKZCSGDcjs.Wc; exports.fetchAllBusinessEntities = _chunk3ZKZCSGDcjs.Xc; exports.fetchAllCatalogs = _chunk3ZKZCSGDcjs.ne; exports.fetchAllCookies = _chunk3ZKZCSGDcjs.Sd; exports.fetchAllDataCategories = _chunk3ZKZCSGDcjs.Gd; exports.fetchAllDataFlows = _chunk3ZKZCSGDcjs.$c; exports.fetchAllDataPoints = _chunk3ZKZCSGDcjs.mc; exports.fetchAllDataSilos = _chunk3ZKZCSGDcjs.kc; exports.fetchAllDataSubjects = _chunk3ZKZCSGDcjs.gc; exports.fetchAllEnrichers = _chunk3ZKZCSGDcjs.dc; exports.fetchAllIdentifiers = _chunk3ZKZCSGDcjs.ac; exports.fetchAllMessages = _chunk3ZKZCSGDcjs.Rd; exports.fetchAllPolicies = _chunk3ZKZCSGDcjs.Jc; exports.fetchAllPreferenceTopics = _chunk3ZKZCSGDcjs.$d; exports.fetchAllPrivacyCenters = _chunk3ZKZCSGDcjs.Qd; exports.fetchAllProcessingPurposes = _chunk3ZKZCSGDcjs.Kd; exports.fetchAllPromptGroups = _chunk3ZKZCSGDcjs.id; exports.fetchAllPromptPartials = _chunk3ZKZCSGDcjs.hd; exports.fetchAllPromptThreads = _chunk3ZKZCSGDcjs.ue; exports.fetchAllPrompts = _chunk3ZKZCSGDcjs.Cc; exports.fetchAllPurposes = _chunk3ZKZCSGDcjs.Rc; exports.fetchAllPurposesAndPreferences = _chunk3ZKZCSGDcjs.ae; exports.fetchAllRequestAttributeKeys = _chunk3ZKZCSGDcjs.xe; exports.fetchAllRequestEnrichers = _chunk3ZKZCSGDcjs.Ce; exports.fetchAllRequestIdentifierMetadata = _chunk3ZKZCSGDcjs.ve; exports.fetchAllRequestIdentifiers = _chunk3ZKZCSGDcjs.Be; exports.fetchAllRequests = _chunk3ZKZCSGDcjs.ze; exports.fetchAllSubDataPoints = _chunk3ZKZCSGDcjs.lc; exports.fetchAllTeams = _chunk3ZKZCSGDcjs.yc; exports.fetchAllTemplates = _chunk3ZKZCSGDcjs.ed; exports.fetchAllUsers = _chunk3ZKZCSGDcjs.Ie; exports.fetchAllVendors = _chunk3ZKZCSGDcjs.Cd; exports.fetchAndIndexCatalogs = _chunk3ZKZCSGDcjs.oe; exports.fetchApiKeys = _chunk3ZKZCSGDcjs.Bc; exports.fetchConsentManager = _chunk3ZKZCSGDcjs.qc; exports.fetchConsentManagerAnalyticsData = _chunk3ZKZCSGDcjs.uc; exports.fetchConsentManagerExperiences = _chunk3ZKZCSGDcjs.sc; exports.fetchConsentManagerId = _chunk3ZKZCSGDcjs.rc; exports.fetchConsentManagerTheme = _chunk3ZKZCSGDcjs.vc; exports.fetchConsentPreferences = _chunkTS5EYI4Ocjs.j; exports.fetchEnrichedDataSilos = _chunk3ZKZCSGDcjs.nc; exports.fetchIdentifiersAndCreateMissing = _chunk3ZKZCSGDcjs.bc; exports.fetchPartitions = _chunk3ZKZCSGDcjs.Pc; exports.fetchPrivacyCenterId = _chunk3ZKZCSGDcjs.Ic; exports.fetchPrivacyCenterUrl = _chunk3ZKZCSGDcjs.Hc; exports.fetchPromptsWithVariables = _chunk3ZKZCSGDcjs.Dc; exports.fetchRequestDataSilo = _chunk3ZKZCSGDcjs.Ee; exports.fetchRequestDataSiloActiveCount = _chunk3ZKZCSGDcjs.we; exports.fetchRequestDataSilos = _chunk3ZKZCSGDcjs.De; exports.fetchRequestFilesForRequest = _chunk3ZKZCSGDcjs.Le; exports.filterNullishValuesFromObject = bm; exports.filterRows = _chunkWIXQSFS6cjs.s; exports.fuzzyMatchColumns = _chunkWIXQSFS6cjs.l; exports.fuzzySearch = _chunkWIXQSFS6cjs.k; exports.generateCrossAccountApiKeys = _chunkIG65EYJYcjs.a; exports.getFileMetadataForPrivacyRequests = _chunkWIXQSFS6cjs.D; exports.getGitFilesThatChanged = Lm; exports.getUniqueValuesForColumn = _chunkWIXQSFS6cjs.r; exports.inquirerAutoComplete = _chunkR4IKDXM5cjs.c; exports.inquirerConfirmBoolean = _chunkR4IKDXM5cjs.a; exports.inquirerConfirmText = _chunkR4IKDXM5cjs.b; exports.listDirectories = _chunkIG65EYJYcjs.d; exports.listFiles = _chunkIG65EYJYcjs.c; exports.loginUser = _chunk3ZKZCSGDcjs.Ge; exports.makeGraphQLRequest = _chunk3ZKZCSGDcjs.$b; exports.mapColumnsToAttributes = _chunkWIXQSFS6cjs.M; exports.mapColumnsToIdentifiers = _chunkWIXQSFS6cjs.K; exports.mapCsvColumnsToApi = _chunkWIXQSFS6cjs.u; exports.mapCsvRowsToRequestInputs = _chunkWIXQSFS6cjs.z; exports.mapEnumValues = _chunkWIXQSFS6cjs.m; exports.mapRequestEnumValues = _chunkWIXQSFS6cjs.v; exports.markCronIdentifierCompleted = _chunk6FGYCQAQcjs.d; exports.markRequestDataSiloIdsCompleted = _chunk6FGYCQAQcjs.f; exports.markSilentPrivacyRequests = _chunkWIXQSFS6cjs.t; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkE3CF3RKXcjs.a; exports.normalizeIdentifierValue = _chunkWIXQSFS6cjs.y; exports.notifyPrivacyRequestsAdditionalTime = _chunkWIXQSFS6cjs.J; exports.parseAssessmentDisplayLogic = _chunk3ZKZCSGDcjs.Yd; exports.parseAssessmentRiskLogic = _chunk3ZKZCSGDcjs._d; exports.parseAttributesFromString = _chunkWIXQSFS6cjs.p; exports.parseFilePath = _chunkZVK4HIDFcjs.d; exports.parseVariablesFromString = _chunkTD7ADMVOcjs.a; exports.pullAllDatapoints = _chunkEVZLUL56cjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunk6FGYCQAQcjs.g; exports.pullConsentManagerMetrics = _chunkTS5EYI4Ocjs.d; exports.pullCronPageOfIdentifiers = _chunk6FGYCQAQcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkBF5T3SGEcjs.a; exports.pullPrivacyRequests = _chunkWIXQSFS6cjs.U; exports.pullTranscendConfiguration = _chunk3ZKZCSGDcjs.ce; exports.pullUnstructuredSubDataPointRecommendations = _chunkEVZLUL56cjs.b; exports.pushCronIdentifiersFromCsv = _chunk6FGYCQAQcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkBF5T3SGEcjs.d; exports.readCsv = _chunkWIXQSFS6cjs.q; exports.readTranscendYaml = _chunkL7NHDBBNcjs.d; exports.removeLinks = ym; exports.removeUnverifiedRequestIdentifiers = _chunkWIXQSFS6cjs.W; exports.replaceVariablesInYaml = _chunkL7NHDBBNcjs.c; exports.reportPromptRun = _chunk3ZKZCSGDcjs.Oe; exports.restartPrivacyRequest = _chunkWIXQSFS6cjs.P; exports.retryRequestDataSilos = _chunkWIXQSFS6cjs.T; exports.retryRequestEnricher = _chunk3ZKZCSGDcjs.te; exports.setResourceAttributes = _chunk3ZKZCSGDcjs.se; exports.skipPreflightJobs = _chunkWIXQSFS6cjs.R; exports.skipRequestDataSilos = _chunkWIXQSFS6cjs.V; exports.splitCsvToList = _chunkWIXQSFS6cjs.n; exports.streamPrivacyRequestFiles = _chunkWIXQSFS6cjs.E; exports.submitPrivacyRequest = _chunkWIXQSFS6cjs.H; exports.syncAction = _chunk3ZKZCSGDcjs.dd; exports.syncActionItemCollections = _chunk3ZKZCSGDcjs.pd; exports.syncActionItems = _chunk3ZKZCSGDcjs.td; exports.syncAgentFiles = _chunk3ZKZCSGDcjs.Bd; exports.syncAgentFunctions = _chunk3ZKZCSGDcjs.xd; exports.syncAgents = _chunk3ZKZCSGDcjs.md; exports.syncAttribute = _chunk3ZKZCSGDcjs.fc; exports.syncBusinessEntities = _chunk3ZKZCSGDcjs._c; exports.syncCodePackages = _chunk3ZKZCSGDcjs.le; exports.syncConfigurationToTranscend = _chunk3ZKZCSGDcjs.Od; exports.syncConsentManager = _chunk3ZKZCSGDcjs.Tc; exports.syncConsentManagerExperiences = _chunk3ZKZCSGDcjs.Sc; exports.syncCookies = _chunk3ZKZCSGDcjs.xc; exports.syncDataCategories = _chunk3ZKZCSGDcjs.Jd; exports.syncDataFlows = _chunk3ZKZCSGDcjs.cd; exports.syncDataSiloDependencies = _chunk3ZKZCSGDcjs.pc; exports.syncDataSilos = _chunk3ZKZCSGDcjs.oc; exports.syncDataSubject = _chunk3ZKZCSGDcjs.zc; exports.syncEnricher = _chunk3ZKZCSGDcjs.ec; exports.syncIdentifier = _chunk3ZKZCSGDcjs.cc; exports.syncIntlMessages = _chunk3ZKZCSGDcjs.Nc; exports.syncPartitions = _chunk3ZKZCSGDcjs.Qc; exports.syncPolicies = _chunk3ZKZCSGDcjs.Lc; exports.syncPrivacyCenter = _chunk3ZKZCSGDcjs.Oc; exports.syncProcessingPurposes = _chunk3ZKZCSGDcjs.Nd; exports.syncPrompts = _chunk3ZKZCSGDcjs.Gc; exports.syncRepositories = _chunk3ZKZCSGDcjs.ie; exports.syncSoftwareDevelopmentKits = _chunk3ZKZCSGDcjs.fe; exports.syncTemplate = _chunk3ZKZCSGDcjs.fd; exports.syncVendors = _chunk3ZKZCSGDcjs.Fd; exports.updateActionItem = _chunk3ZKZCSGDcjs.sd; exports.updateActionItemCollection = _chunk3ZKZCSGDcjs.od; exports.updateAgentFiles = _chunk3ZKZCSGDcjs.Ad; exports.updateAgentFunctions = _chunk3ZKZCSGDcjs.wd; exports.updateAgents = _chunk3ZKZCSGDcjs.ld; exports.updateBusinessEntities = _chunk3ZKZCSGDcjs.Zc; exports.updateCodePackages = _chunk3ZKZCSGDcjs.ke; exports.updateConsentManagerToLatest = _chunk3ZKZCSGDcjs.Ne; exports.updateConsentManagerVersionToLatest = _chunkTS5EYI4Ocjs.a; exports.updateDataCategories = _chunk3ZKZCSGDcjs.Id; exports.updateDataFlows = _chunk3ZKZCSGDcjs.ad; exports.updateIntlMessages = _chunk3ZKZCSGDcjs.Mc; exports.updateOrCreateCookies = _chunk3ZKZCSGDcjs.wc; exports.updatePolicies = _chunk3ZKZCSGDcjs.Kc; exports.updateProcessingPurposes = _chunk3ZKZCSGDcjs.Md; exports.updatePrompts = _chunk3ZKZCSGDcjs.Fc; exports.updateRepositories = _chunk3ZKZCSGDcjs.he; exports.updateSoftwareDevelopmentKits = _chunk3ZKZCSGDcjs.ee; exports.updateVendors = _chunk3ZKZCSGDcjs.Ed; exports.uploadConsents = _chunk6DWFLWWTcjs.f; exports.uploadCookiesFromCsv = _chunkTS5EYI4Ocjs.c; exports.uploadDataFlowsFromCsv = _chunkTS5EYI4Ocjs.b; exports.uploadPrivacyRequestsFromCsv = _chunkWIXQSFS6cjs.O; exports.uploadSiloDiscoveryResults = _chunk3ZKZCSGDcjs.me; exports.validateTranscendAuth = _chunkIG65EYJYcjs.b; exports.version = _chunkY4BWTFTXcjs.m; exports.writeCsv = _chunkZVK4HIDFcjs.c; exports.writeCsvSync = _chunkZVK4HIDFcjs.a; exports.writeLargeCsv = _chunkZVK4HIDFcjs.e; exports.writeTranscendYaml = _chunkL7NHDBBNcjs.e;
|
|
5
5
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/index.cjs","../src/lib/ai/TranscendPromptManager.ts","../src/lib/graphql/fetchLargeLanguageModels.ts","../src/lib/ai/getGitFilesThatChanged.ts"],"names":["PAGE_SIZE","fetchAllLargeLanguageModels","client","largeLanguageModels","offset","shouldContinue","nodes","makeGraphQLRequest","LARGE_LANGUAGE_MODELS","a","b","createRegexForTag","tagName","defineTranscendPrompts","prompts","jsonParseSafe","obj","TranscendPromptManager","handlebarsOptions","transcendUrl","DEFAULT_TRANSCEND_API","transcendApiKey","requireApproval","cacheDuration","defaultVariables","buildTranscendGraphQLClient","createHandlebarsWithHelpers","promptDefinitions","getValues","promptIds","id","x","promptTitles","title","agentNames","uniq_default","response","agents","fetchPromptsWithVariables","fetchAllAgents","keyBy_default","model","promptByTitle","promptById","acc","v","partial","apply","result","name","agent","remoteAgent","ts","thread","fetchAllPromptThreads","names","hasCache","missingCache","groupBy_default","cachedAgents","chunkedNames","chunk_default","remoteAgents","mapSeries","chunkedName","pageOfAgents","filterBy","fetchAllAgentFiles","largeLanguageModel","matching"],"mappings":"AAAA,6OAAiE,wDAAkD,wDAA0C,wDAA0D,wDAA0C,wDAA0E,wDAAkE,wDAA0F,wDAA0E,wDAAkH,wDAAkE,wDAA0a,wDAAgmB,wDAAgD,wDAAkv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C,IAAA,CAAK,eAAA,CAAgBA,CAAAA,CAAM,OAAO,CAAA,CAAIA,CACxC,CAAC,CAAA,CACDY,CAAAA,CAAa,IAAA,CAAK,GAAGG,CAAY,CACnC,CAAC,CAAA,CACM,CAAC,GAAGN,CAAAA,CAAc,GAAGG,CAAY,CAC1C,CAQA,aAAA,CAAcI,CAAAA,CAAmD,CAC/D,OAAOC,kCAAAA,IAAmB,CAAK,aAAA,CAAeD,CAAQ,CACxD,CAQA,qBAAA,CACEE,CAAAA,CACoB,CACpB,IAAMC,CAAAA,CAAW,IAAA,CAAK,mBAAA,CAAoB,IAAA,CAAM5B,CAAAA,EAC9C,OAAO2B,CAAAA,EAAuB,QAAA,CAC1B3B,CAAAA,CAAM,EAAA,GAAO2B,CAAAA,CACb3B,CAAAA,CAAM,IAAA,GAAS2B,CAAAA,CAAmB,IAAA,EAClC3B,CAAAA,CAAM,MAAA,GAAW2B,CAAAA,CAAmB,MAC1C,CAAA,CACA,EAAA,CAAI,CAACC,CAAAA,CACH,MAAM,IAAI,KAAA,CACR,CAAA,+BAAA,EACE,OAAOD,CAAAA,EAAuB,QAAA,CAC1BA,CAAAA,CACA,IAAA,CAAK,SAAA,CAAUA,CAAkB,CACvC,CAAA,CAAA;AE1ZG;AAiBI;AA4Bf","file":"/home/runner/work/cli/cli/dist/index.cjs","sourcesContent":[null,"/* eslint-disable max-lines */\nimport {\n Optionalize,\n Requirize,\n apply,\n decodeCodec,\n getValues,\n} from '@transcend-io/type-utils';\nimport type { Handlebars } from '@transcend-io/handlebars-utils';\nimport { Secret } from '@transcend-io/secret-value';\nimport * as t from 'io-ts';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport {\n Agent,\n AgentFile,\n AgentFileFilterBy,\n ReportPromptRunInput,\n buildTranscendGraphQLClient,\n fetchAllAgentFiles,\n fetchAllAgents,\n reportPromptRun,\n} from '../graphql';\nimport {\n HandlebarsInput,\n createHandlebarsWithHelpers,\n} from '@transcend-io/handlebars-utils';\nimport {\n TranscendPromptTemplated,\n TranscendPromptsAndVariables,\n fetchPromptsWithVariables,\n} from '../graphql/fetchPrompts';\nimport { GraphQLClient } from 'graphql-request';\nimport {\n PromptStatus,\n ChatCompletionRole,\n PromptRunProductArea,\n QueueStatus,\n LargeLanguageModelClient,\n} from '@transcend-io/privacy-types';\nimport {\n LargeLanguageModel,\n fetchAllLargeLanguageModels,\n} from '../graphql/fetchLargeLanguageModels';\nimport { groupBy, keyBy, uniq, chunk } from 'lodash-es';\nimport { mapSeries } from '../bluebird-replace';\nimport {\n PromptThread,\n fetchAllPromptThreads,\n} from '../graphql/fetchPromptThreads';\n\n/**\n * An LLM Prompt definition\n */\nexport type TranscendPrompt<\n TInputParams extends t.Any,\n TOutputCodec extends t.Any,\n> = (\n | {\n /** ID of the prompt */\n id: string;\n /** Title of the prompt */\n title?: string;\n }\n | {\n /** ID of the prompt */\n id?: string;\n /** Title of the prompt */\n title: string;\n }\n) & {\n /** The names of the agents that should be loaded along with the prompt */\n agentNames?: string[];\n /** Codec to validate runtime input shape */\n paramCodec: TInputParams;\n /** Codec to validate output response */\n outputCodec: TOutputCodec;\n /**\n * If the output that needs to be parsed is returned within a tag\n * e.g. <tag> or <json> - this is the name of the tag\n */\n extractFromTag?: string;\n};\n\nexport interface PromptRunResult {\n /** The ID of the prompt run created on Transcend */\n promptRunId: string;\n /** The URL of the prompt run on Transcend */\n promptRunUrl: string;\n}\n\n/**\n * Create a regex to extract data from a tag\n *\n * Input:\n * \"here is some data <tag>Data</tag>...\"\n *\n * @param tagName - Name of tag\n * @returns Data within the tag\n */\nexport function createRegexForTag(tagName: string): RegExp {\n return new RegExp(`<${tagName}>([\\\\s\\\\S]+?)<\\\\/${tagName}>`);\n}\n\n/**\n * Helper function to declare prompts\n *\n * @param prompts - Prompt config\n * @returns Prompts as identity function - but type enforced\n */\nexport function defineTranscendPrompts<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n>(prompts: TPrompts): TPrompts {\n return prompts;\n}\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptParamType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['paramCodec']>;\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptResponseType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n\n/**\n * Input for reporting a prompt run\n */\nexport interface ReportPromptRunOptions\n extends Optionalize<\n Omit<ReportPromptRunInput, 'status' | 'promptId' | 'largeLanguageModelId'>,\n 'name' | 'productArea'\n > {\n /** The large language model being run. Either the ID of the LLM or the client/name pairing */\n largeLanguageModel:\n | string\n | {\n /** Name of client */\n client: LargeLanguageModelClient;\n /** Name of the model */\n name: string;\n };\n}\n\nconst jsonParseSafe = (obj: string): unknown => {\n try {\n return JSON.parse(obj);\n } catch (e) {\n return obj;\n }\n};\n\n/**\n * A class that is capable of loading and insert variables into prompts from\n * Transcend's Prompt Manager\n */\nexport class TranscendPromptManager<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n> {\n /** Prompt definitions */\n public prompts: TPrompts;\n\n /** Options for configuring handlebars */\n public handlebarsOptions!: HandlebarsInput;\n\n /** Prompt name -> content map, populated by call to Transcend API */\n public promptContentMap?: { [k in TPromptNames]: TranscendPromptTemplated };\n\n /** The large language models that are registered to this organization for reporting */\n public largeLanguageModels: LargeLanguageModel[] = [];\n\n /** The agent definitions registered to this organization */\n private agentsByName: { [name in string]: Agent } = {};\n\n /** The agent definitions registered to this organization */\n private agentsByAgentId: { [id in string]: Agent } = {};\n\n /** The GraphQL client that can be used to call Transcend */\n public graphQLClient: GraphQLClient;\n\n /** The set of variables to expose in handlebars context specified at class initiation */\n public defaultVariables: { [k in string]: unknown };\n\n /**\n * The set of variables to expose in handlebars context,\n * merges defaults with calculated variables from the inventory\n */\n public variables: { [k in string]: unknown };\n\n /** Handlebars compiler */\n public handlebars: typeof Handlebars;\n\n /** The Transcend API key */\n public transcendApiKey: string | Secret<string>;\n\n /** API of Transcend to call */\n public transcendUrl: string;\n\n /** When true, throw an error if the prompt is not approved */\n public requireApproval: boolean;\n\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n public cacheDuration?: number;\n\n /**\n * The last time the metadata was fetched\n */\n public lastUpdatedAt?: Date;\n\n /**\n * Constructor\n *\n * @param options - Options\n */\n constructor({\n prompts,\n handlebarsOptions = {},\n transcendUrl = DEFAULT_TRANSCEND_API,\n transcendApiKey,\n requireApproval = true,\n cacheDuration,\n defaultVariables = {},\n }: {\n /** Prompt definitions to load */\n prompts: TPrompts;\n /** Options for configuring handlebars */\n handlebarsOptions?: HandlebarsInput;\n /** The Transcend API key */\n transcendApiKey: string | Secret<string>;\n /** API of Transcend to call */\n transcendUrl?: string;\n /** When true, throw an error if the prompt is not approved */\n requireApproval?: boolean;\n /** The set of variables to expose in handlebars context specified at class initiation */\n defaultVariables?: { [k in string]: unknown };\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n cacheDuration?: number;\n }) {\n this.prompts = prompts;\n this.transcendUrl = transcendUrl;\n this.transcendApiKey = transcendApiKey;\n this.variables = defaultVariables;\n this.defaultVariables = defaultVariables;\n this.graphQLClient = buildTranscendGraphQLClient(\n transcendUrl,\n typeof transcendApiKey === 'object'\n ? transcendApiKey.release()\n : transcendApiKey,\n );\n this.requireApproval = requireApproval;\n this.cacheDuration = cacheDuration;\n this.handlebarsOptions = handlebarsOptions;\n this.handlebars = createHandlebarsWithHelpers(handlebarsOptions);\n }\n\n /**\n * Fetch prompt metadata from Transcend and cache to the class definition\n *\n * @returns A function that can be used to call the prompt\n */\n async fetchPromptsAndMetadata(): Promise<TranscendPromptsAndVariables> {\n // Determine what to fetch\n const promptDefinitions = getValues(this.prompts) as TranscendPrompt<\n t.Any,\n t.Any\n >[];\n const promptIds = promptDefinitions\n .map(({ id }) => id)\n .filter((x): x is string => !!x);\n const promptTitles = promptDefinitions\n .map(({ title }) => title)\n .filter((x): x is string => !!x);\n const agentNames = uniq(\n promptDefinitions.map(({ agentNames }) => agentNames || []).flat(),\n );\n\n // Fetch prompts and data\n const [response, largeLanguageModels, agents] = await Promise.all([\n fetchPromptsWithVariables(this.graphQLClient, {\n promptIds,\n promptTitles,\n }),\n fetchAllLargeLanguageModels(this.graphQLClient),\n fetchAllAgents(this.graphQLClient, { names: agentNames }),\n ]);\n this.agentsByName = keyBy(agents, 'name');\n this.agentsByAgentId = keyBy(agents, 'agentId');\n this.largeLanguageModels = largeLanguageModels.filter(\n (model) => model.isTranscendHosted === false,\n );\n\n // Lookup prompts by id/title\n const promptByTitle = keyBy(response.prompts, 'title');\n const promptById = keyBy(response.prompts, 'id');\n\n // Update variables\n this.variables = {\n ...response.calculatedVariables.reduce(\n (acc, v) =>\n Object.assign(acc, {\n [v.name]: v.data ? JSON.parse(v.data) : v.data,\n }),\n {},\n ),\n ...this.defaultVariables,\n };\n\n // Update partials\n this.handlebars = createHandlebarsWithHelpers({\n ...this.handlebarsOptions,\n templates: [\n ...(this.handlebarsOptions.templates || []),\n ...response.promptPartials.map((partial) => ({\n name: partial.slug,\n content: partial.content,\n })),\n ],\n });\n\n // Create mapping from prompt to content\n this.promptContentMap = apply(this.prompts, ({ id, title }) => {\n const result = id\n ? promptById[id]\n : title\n ? promptByTitle[title]\n : undefined;\n if (!result) {\n throw new Error(\n `Failed to find prompt with title: \"${title}\" and id: \"${id}\"`,\n );\n }\n return result;\n });\n\n // For cache\n this.lastUpdatedAt = new Date();\n\n return response;\n }\n\n /**\n * Get an agent definition by name\n *\n * @param name - Name of the agent to grab\n * @returns Large language model configuration\n */\n async getAgentByName(name: string): Promise<Agent | undefined> {\n const agent = this.agentsByName[name];\n if (agent) {\n return agent;\n }\n const [remoteAgent] = await fetchAllAgents(this.graphQLClient, {\n names: [name],\n });\n if (!remoteAgent) {\n return undefined;\n }\n this.agentsByName[remoteAgent.name] = remoteAgent;\n this.agentsByAgentId[remoteAgent.agentId] = remoteAgent;\n return remoteAgent;\n }\n\n /**\n * Get a prompt thread by ts\n *\n * @param ts - the slack message timestamp to look up thread for\n * @returns Large language model configuration\n */\n async getPromptThreadBySlackTs(\n ts: string,\n ): Promise<PromptThread | undefined> {\n const [thread] = await fetchAllPromptThreads(this.graphQLClient, {\n slackMessageTs: [ts],\n });\n return thread;\n }\n\n /**\n * Get a list of agent definitions by name.\n * Pulls from cache and may return less agents\n * than requested if some are not found\n *\n * @param names - Names of agents to fetch\n * @returns The agents that were found matching the names\n */\n async getAgentsByName(names: string[]): Promise<Agent[]> {\n if (names.length < 1) {\n throw new Error('Expected at least one name to be provided');\n }\n const { hasCache = [], missingCache = [] } = groupBy(names, (name) =>\n this.agentsByName[name] ? 'hasCache' : 'missingCache',\n );\n const cachedAgents = hasCache.map((name) => this.agentsByName[name]);\n if (missingCache.length === 0) {\n return cachedAgents;\n }\n const chunkedNames = chunk(missingCache, 50);\n const remoteAgents: Agent[] = [];\n await mapSeries(chunkedNames, async (chunkedName) => {\n const pageOfAgents = await fetchAllAgents(this.graphQLClient, {\n names: chunkedName,\n });\n pageOfAgents.forEach((agent) => {\n this.agentsByName[agent.name] = agent;\n this.agentsByAgentId[agent.agentId] = agent;\n });\n remoteAgents.push(...pageOfAgents);\n });\n return [...cachedAgents, ...remoteAgents];\n }\n\n /**\n * Fetch metadata on agent files\n *\n * @param filterBy - Filter by parameters\n * @returns The files found matching the filter\n */\n getAgentFiles(filterBy: AgentFileFilterBy): Promise<AgentFile[]> {\n return fetchAllAgentFiles(this.graphQLClient, filterBy);\n }\n\n /**\n * Look up the large language model to report on\n *\n * @param largeLanguageModel - Input\n * @returns Large language model configuration\n */\n getLargeLanguageModel(\n largeLanguageModel: ReportPromptRunOptions['largeLanguageModel'],\n ): LargeLanguageModel {\n const matching = this.largeLanguageModels.find((model) =>\n typeof largeLanguageModel === 'string'\n ? model.id === largeLanguageModel\n : model.name === largeLanguageModel.name &&\n model.client === largeLanguageModel.client,\n );\n if (!matching) {\n throw new Error(\n `Failed to find model matching: ${\n typeof largeLanguageModel === 'string'\n ? largeLanguageModel\n : JSON.stringify(largeLanguageModel)\n }`,\n );\n }\n return matching;\n }\n\n /**\n * Get a prompt definition by name\n *\n * @param promptName - Prompt to compile\n * @returns Parsed content\n */\n async getPromptDefinition<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n ): Promise<TranscendPromptTemplated> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n // Lookup prompt\n const { promptContentMap } = this;\n if (!promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n const promptTemplate = promptContentMap[promptName];\n if (!promptTemplate) {\n throw new Error(\n `Expected this.promptContentMap[${promptName}] to be defined`,\n );\n }\n return promptTemplate;\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to compile\n * @param params - Runtime parameters\n * @returns Parsed content\n */\n async compilePrompt<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n params: t.TypeOf<TPrompts[TPromptName]['paramCodec']>,\n ): Promise<string> {\n // Grab the prompt\n const promptTemplate = await this.getPromptDefinition(promptName);\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure prompt is approved\n if (\n this.requireApproval &&\n promptTemplate.status !== PromptStatus.Approved\n ) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because its in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // If prompt is rejected, throw error\n if (promptTemplate.status === PromptStatus.Rejected) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because it's in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // Validate params\n decodeCodec(promptInput.paramCodec, params);\n\n // Compile prompt and template\n return this.handlebars.compile(promptTemplate.content)({\n // template in currentDate by default\n currentDate: new Date().toISOString(),\n ...this.variables,\n ...params,\n });\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to parse\n * @param response - AI response as string\n * @returns Parsed content\n */\n parseAiResponse<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n response: string,\n ): t.TypeOf<TPrompts[TPromptName]['outputCodec']> {\n // Look up prompt info\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Extract from tag if needed\n const extracted = promptInput.extractFromTag\n ? (createRegexForTag(promptInput.extractFromTag).exec(response) ||\n [])[1] || response\n : response;\n\n // Parse via codec\n return decodeCodec(\n promptInput.outputCodec,\n jsonParseSafe(extracted),\n false,\n );\n }\n\n /**\n * Parse the AI response and report back to Transcend\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportAndParsePromptRun<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n { largeLanguageModel, ...options }: ReportPromptRunOptions,\n ): Promise<\n PromptRunResult & {\n /** Resulting prompt run */\n result: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n }\n > {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n if (\n options.promptRunMessages[options.promptRunMessages.length - 1].role !==\n ChatCompletionRole.Assistant\n ) {\n throw new Error(\n `promptRunMessages[${\n options.promptRunMessages.length - 1\n }].role is expected to be = ${ChatCompletionRole.Assistant}`,\n );\n }\n const response =\n options.promptRunMessages[options.promptRunMessages.length - 1].content;\n\n let parsed: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n try {\n // Parse the response\n parsed = this.parseAiResponse(promptName, response);\n } catch (err) {\n await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n error: err.message,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n throw err;\n }\n\n // report successful run\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Resolved,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n result: parsed,\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n\n /**\n * Report an error for a particular prompt\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportPromptRunError<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n {\n largeLanguageModel,\n ...options\n }: Requirize<ReportPromptRunOptions, 'error'>,\n ): Promise<PromptRunResult> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n}\n/* eslint-enable max-lines */\n","import { GraphQLClient } from 'graphql-request';\nimport { LargeLanguageModelClient } from '@transcend-io/privacy-types';\nimport { LARGE_LANGUAGE_MODELS } from './gqls';\nimport { makeGraphQLRequest } from './makeGraphQLRequest';\n\nexport interface LargeLanguageModel {\n /** ID of prompts */\n id: string;\n /** The name of the large language model. */\n name: string;\n /** The content of the prompt template. */\n client: LargeLanguageModelClient;\n /** Whether hosted by Transcend or not */\n isTranscendHosted: boolean;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all LargeLanguageModels in the organization\n *\n * @param client - GraphQL client\n * @returns All LargeLanguageModels in the organization\n */\nexport async function fetchAllLargeLanguageModels(\n client: GraphQLClient,\n): Promise<LargeLanguageModel[]> {\n const largeLanguageModels: LargeLanguageModel[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n largeLanguageModels: { nodes },\n } = await makeGraphQLRequest<{\n /** LargeLanguageModels */\n largeLanguageModels: {\n /** List */\n nodes: LargeLanguageModel[];\n };\n }>(client, LARGE_LANGUAGE_MODELS, {\n first: PAGE_SIZE,\n offset,\n });\n largeLanguageModels.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return largeLanguageModels.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { difference } from 'lodash-es';\nimport fastGlob from 'fast-glob';\nimport { execSync } from 'child_process';\n\n/**\n * Function thats gets the git files that have changed\n * and returns the code\n *\n * @param options - Options\n * @returns Changes files and diffs\n */\nexport function getGitFilesThatChanged({\n baseBranch,\n rootDirectory,\n githubRepo,\n excludedGlob = [],\n fileBlockList = [],\n}: {\n /** Base branch */\n baseBranch: string;\n /** Github repo name */\n githubRepo: string;\n /** Root directory */\n rootDirectory: string;\n /** A glob that excludes files */\n excludedGlob?: string[];\n /** Block list of files to not process */\n fileBlockList?: string[];\n}): {\n /** The list of files that changed */\n changedFiles: string[];\n /** Github repo name */\n repoName: string;\n /** Current commit */\n commit: string;\n /** File diffs */\n fileDiffs: { [k in string]: string };\n} {\n // Pull base branch\n execSync(`git fetch origin ${baseBranch}`);\n\n // Latest commit on base branch. If we are on the base branch, we take the prior commit\n const latestBasedCommit = execSync(\n `git ls-remote ${githubRepo} \"refs/heads/${baseBranch}\" | cut -f 1`,\n { encoding: 'utf-8' },\n ).split('\\n')[0];\n\n // This commit\n const latestThisCommit = execSync('git rev-parse HEAD', {\n encoding: 'utf-8',\n }).split('\\n')[0];\n\n // Ensure commits are present\n if (!latestBasedCommit || !latestThisCommit) {\n throw new Error('FAILED TO FIND COMMIT RANGE');\n }\n\n // Get the diff between the given branch and base branch\n const diff = execSync(\n `git fetch && git diff --name-only \"${\n baseBranch || latestBasedCommit\n }...${latestThisCommit}\" -- ${rootDirectory}`,\n { encoding: 'utf-8' },\n );\n\n // Filter out block list\n const changedFiles = difference(\n diff.split('\\n').filter((f) => f),\n fileBlockList,\n );\n\n // Filter out globs\n const filteredChanges =\n excludedGlob.length > 0\n ? fastGlob.sync(changedFiles, { ignore: excludedGlob })\n : changedFiles;\n\n // Get the contents of only the changed files\n const fileDiffs: { [k in string]: string } = {};\n filteredChanges.forEach((file) => {\n const contents = execSync(`git show ${latestThisCommit}:${file}`, {\n encoding: 'utf-8',\n });\n fileDiffs[file] = contents;\n });\n\n // Pull the github repo name\n const repoName = githubRepo.split('/').pop()!.split('.')[0];\n\n return {\n changedFiles,\n fileDiffs,\n repoName,\n commit: latestThisCommit,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/index.cjs","../src/lib/ai/TranscendPromptManager.ts","../src/lib/graphql/fetchLargeLanguageModels.ts","../src/lib/ai/getGitFilesThatChanged.ts"],"names":["PAGE_SIZE","fetchAllLargeLanguageModels","client","largeLanguageModels","offset","shouldContinue","nodes","makeGraphQLRequest","LARGE_LANGUAGE_MODELS","a","b","createRegexForTag","tagName","defineTranscendPrompts","prompts","jsonParseSafe","obj","TranscendPromptManager","handlebarsOptions","transcendUrl","DEFAULT_TRANSCEND_API","transcendApiKey","requireApproval","cacheDuration","defaultVariables","buildTranscendGraphQLClient","createHandlebarsWithHelpers","promptDefinitions","getValues","promptIds","id","x","promptTitles","title","agentNames","uniq_default","response","agents","fetchPromptsWithVariables","fetchAllAgents","keyBy_default","model","promptByTitle","promptById","acc","v","partial","apply","result","name","agent","remoteAgent","ts","thread","fetchAllPromptThreads","names","hasCache","missingCache","groupBy_default","cachedAgents","chunkedNames","chunk_default","remoteAgents","mapSeries","chunkedName","pageOfAgents","filterBy","fetchAllAgentFiles","largeLanguageModel","matching"],"mappings":"AAAA,6OAAiE,wDAAkD,wDAA0C,wDAA0D,wDAA0C,wDAA0E,wDAAkE,wDAA0F,wDAA0E,wDAAkH,wDAAkE,wDAA0a,wDAAgmB,wDAAgD,wDAAmtF,gCAA6B,wDAAyH,wDAAqF,wDAA4E,qDCOlyJ,iEAkBA,2DAaA,ICtBDA,CAAAA,CAAY,EAAA,CAQlB,MAAA,SAAsBC,CAAAA,CACpBC,CAAAA,CAC+B,CAC/B,IAAMC,CAAAA,CAA4C,CAAC,CAAA,CAC/CC,CAAAA,CAAS,CAAA,CAGTC,CAAAA,CAAiB,CAAA,CAAA,CACrB,EAAG,CACD,GAAM,CACJ,mBAAA,CAAqB,CAAE,KAAA,CAAAC,CAAM,CAC/B,CAAA,CAAI,MAAMC,kCAAAA,CAMPL,CAAQM,oBAAAA,CAAuB,CAChC,KAAA,CAAOR,CAAAA,CACP,MAAA,CAAAI,CACF,CAAC,CAAA,CACDD,CAAAA,CAAoB,IAAA,CAAK,GAAGG,CAAK,CAAA,CACjCF,CAAAA,EAAUJ,CAAAA,CACVK,CAAAA,CAAiBC,CAAAA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,CAAM,MAAA,GAAW2B,CAAAA,CAAmB,MAC1C,CAAA,CACA,EAAA,CAAI,CAACC,CAAAA,CACH,MAAM,IAAI,KAAA,CACR,CAAA,+BAAA,EACE,OAAOD,CAAAA,EAAuB,QAAA,CAC1BA,CAAAA,CACA,IAAA,CAAK,SAAA,CAAUA,CAAkB,CACvC,CAAA,CAAA;AE1ZG;AAiBI;AA4Bf","file":"/home/runner/work/cli/cli/dist/index.cjs","sourcesContent":[null,"/* eslint-disable max-lines */\nimport {\n Optionalize,\n Requirize,\n apply,\n decodeCodec,\n getValues,\n} from '@transcend-io/type-utils';\nimport type { Handlebars } from '@transcend-io/handlebars-utils';\nimport { Secret } from '@transcend-io/secret-value';\nimport * as t from 'io-ts';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport {\n Agent,\n AgentFile,\n AgentFileFilterBy,\n ReportPromptRunInput,\n buildTranscendGraphQLClient,\n fetchAllAgentFiles,\n fetchAllAgents,\n reportPromptRun,\n} from '../graphql';\nimport {\n HandlebarsInput,\n createHandlebarsWithHelpers,\n} from '@transcend-io/handlebars-utils';\nimport {\n TranscendPromptTemplated,\n TranscendPromptsAndVariables,\n fetchPromptsWithVariables,\n} from '../graphql/fetchPrompts';\nimport { GraphQLClient } from 'graphql-request';\nimport {\n PromptStatus,\n ChatCompletionRole,\n PromptRunProductArea,\n QueueStatus,\n LargeLanguageModelClient,\n} from '@transcend-io/privacy-types';\nimport {\n LargeLanguageModel,\n fetchAllLargeLanguageModels,\n} from '../graphql/fetchLargeLanguageModels';\nimport { groupBy, keyBy, uniq, chunk } from 'lodash-es';\nimport { mapSeries } from '../bluebird-replace';\nimport {\n PromptThread,\n fetchAllPromptThreads,\n} from '../graphql/fetchPromptThreads';\n\n/**\n * An LLM Prompt definition\n */\nexport type TranscendPrompt<\n TInputParams extends t.Any,\n TOutputCodec extends t.Any,\n> = (\n | {\n /** ID of the prompt */\n id: string;\n /** Title of the prompt */\n title?: string;\n }\n | {\n /** ID of the prompt */\n id?: string;\n /** Title of the prompt */\n title: string;\n }\n) & {\n /** The names of the agents that should be loaded along with the prompt */\n agentNames?: string[];\n /** Codec to validate runtime input shape */\n paramCodec: TInputParams;\n /** Codec to validate output response */\n outputCodec: TOutputCodec;\n /**\n * If the output that needs to be parsed is returned within a tag\n * e.g. <tag> or <json> - this is the name of the tag\n */\n extractFromTag?: string;\n};\n\nexport interface PromptRunResult {\n /** The ID of the prompt run created on Transcend */\n promptRunId: string;\n /** The URL of the prompt run on Transcend */\n promptRunUrl: string;\n}\n\n/**\n * Create a regex to extract data from a tag\n *\n * Input:\n * \"here is some data <tag>Data</tag>...\"\n *\n * @param tagName - Name of tag\n * @returns Data within the tag\n */\nexport function createRegexForTag(tagName: string): RegExp {\n return new RegExp(`<${tagName}>([\\\\s\\\\S]+?)<\\\\/${tagName}>`);\n}\n\n/**\n * Helper function to declare prompts\n *\n * @param prompts - Prompt config\n * @returns Prompts as identity function - but type enforced\n */\nexport function defineTranscendPrompts<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n>(prompts: TPrompts): TPrompts {\n return prompts;\n}\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptParamType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['paramCodec']>;\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptResponseType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n\n/**\n * Input for reporting a prompt run\n */\nexport interface ReportPromptRunOptions\n extends Optionalize<\n Omit<ReportPromptRunInput, 'status' | 'promptId' | 'largeLanguageModelId'>,\n 'name' | 'productArea'\n > {\n /** The large language model being run. Either the ID of the LLM or the client/name pairing */\n largeLanguageModel:\n | string\n | {\n /** Name of client */\n client: LargeLanguageModelClient;\n /** Name of the model */\n name: string;\n };\n}\n\nconst jsonParseSafe = (obj: string): unknown => {\n try {\n return JSON.parse(obj);\n } catch (e) {\n return obj;\n }\n};\n\n/**\n * A class that is capable of loading and insert variables into prompts from\n * Transcend's Prompt Manager\n */\nexport class TranscendPromptManager<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n> {\n /** Prompt definitions */\n public prompts: TPrompts;\n\n /** Options for configuring handlebars */\n public handlebarsOptions!: HandlebarsInput;\n\n /** Prompt name -> content map, populated by call to Transcend API */\n public promptContentMap?: { [k in TPromptNames]: TranscendPromptTemplated };\n\n /** The large language models that are registered to this organization for reporting */\n public largeLanguageModels: LargeLanguageModel[] = [];\n\n /** The agent definitions registered to this organization */\n private agentsByName: { [name in string]: Agent } = {};\n\n /** The agent definitions registered to this organization */\n private agentsByAgentId: { [id in string]: Agent } = {};\n\n /** The GraphQL client that can be used to call Transcend */\n public graphQLClient: GraphQLClient;\n\n /** The set of variables to expose in handlebars context specified at class initiation */\n public defaultVariables: { [k in string]: unknown };\n\n /**\n * The set of variables to expose in handlebars context,\n * merges defaults with calculated variables from the inventory\n */\n public variables: { [k in string]: unknown };\n\n /** Handlebars compiler */\n public handlebars: typeof Handlebars;\n\n /** The Transcend API key */\n public transcendApiKey: string | Secret<string>;\n\n /** API of Transcend to call */\n public transcendUrl: string;\n\n /** When true, throw an error if the prompt is not approved */\n public requireApproval: boolean;\n\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n public cacheDuration?: number;\n\n /**\n * The last time the metadata was fetched\n */\n public lastUpdatedAt?: Date;\n\n /**\n * Constructor\n *\n * @param options - Options\n */\n constructor({\n prompts,\n handlebarsOptions = {},\n transcendUrl = DEFAULT_TRANSCEND_API,\n transcendApiKey,\n requireApproval = true,\n cacheDuration,\n defaultVariables = {},\n }: {\n /** Prompt definitions to load */\n prompts: TPrompts;\n /** Options for configuring handlebars */\n handlebarsOptions?: HandlebarsInput;\n /** The Transcend API key */\n transcendApiKey: string | Secret<string>;\n /** API of Transcend to call */\n transcendUrl?: string;\n /** When true, throw an error if the prompt is not approved */\n requireApproval?: boolean;\n /** The set of variables to expose in handlebars context specified at class initiation */\n defaultVariables?: { [k in string]: unknown };\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n cacheDuration?: number;\n }) {\n this.prompts = prompts;\n this.transcendUrl = transcendUrl;\n this.transcendApiKey = transcendApiKey;\n this.variables = defaultVariables;\n this.defaultVariables = defaultVariables;\n this.graphQLClient = buildTranscendGraphQLClient(\n transcendUrl,\n typeof transcendApiKey === 'object'\n ? transcendApiKey.release()\n : transcendApiKey,\n );\n this.requireApproval = requireApproval;\n this.cacheDuration = cacheDuration;\n this.handlebarsOptions = handlebarsOptions;\n this.handlebars = createHandlebarsWithHelpers(handlebarsOptions);\n }\n\n /**\n * Fetch prompt metadata from Transcend and cache to the class definition\n *\n * @returns A function that can be used to call the prompt\n */\n async fetchPromptsAndMetadata(): Promise<TranscendPromptsAndVariables> {\n // Determine what to fetch\n const promptDefinitions = getValues(this.prompts) as TranscendPrompt<\n t.Any,\n t.Any\n >[];\n const promptIds = promptDefinitions\n .map(({ id }) => id)\n .filter((x): x is string => !!x);\n const promptTitles = promptDefinitions\n .map(({ title }) => title)\n .filter((x): x is string => !!x);\n const agentNames = uniq(\n promptDefinitions.map(({ agentNames }) => agentNames || []).flat(),\n );\n\n // Fetch prompts and data\n const [response, largeLanguageModels, agents] = await Promise.all([\n fetchPromptsWithVariables(this.graphQLClient, {\n promptIds,\n promptTitles,\n }),\n fetchAllLargeLanguageModels(this.graphQLClient),\n fetchAllAgents(this.graphQLClient, { names: agentNames }),\n ]);\n this.agentsByName = keyBy(agents, 'name');\n this.agentsByAgentId = keyBy(agents, 'agentId');\n this.largeLanguageModels = largeLanguageModels.filter(\n (model) => model.isTranscendHosted === false,\n );\n\n // Lookup prompts by id/title\n const promptByTitle = keyBy(response.prompts, 'title');\n const promptById = keyBy(response.prompts, 'id');\n\n // Update variables\n this.variables = {\n ...response.calculatedVariables.reduce(\n (acc, v) =>\n Object.assign(acc, {\n [v.name]: v.data ? JSON.parse(v.data) : v.data,\n }),\n {},\n ),\n ...this.defaultVariables,\n };\n\n // Update partials\n this.handlebars = createHandlebarsWithHelpers({\n ...this.handlebarsOptions,\n templates: [\n ...(this.handlebarsOptions.templates || []),\n ...response.promptPartials.map((partial) => ({\n name: partial.slug,\n content: partial.content,\n })),\n ],\n });\n\n // Create mapping from prompt to content\n this.promptContentMap = apply(this.prompts, ({ id, title }) => {\n const result = id\n ? promptById[id]\n : title\n ? promptByTitle[title]\n : undefined;\n if (!result) {\n throw new Error(\n `Failed to find prompt with title: \"${title}\" and id: \"${id}\"`,\n );\n }\n return result;\n });\n\n // For cache\n this.lastUpdatedAt = new Date();\n\n return response;\n }\n\n /**\n * Get an agent definition by name\n *\n * @param name - Name of the agent to grab\n * @returns Large language model configuration\n */\n async getAgentByName(name: string): Promise<Agent | undefined> {\n const agent = this.agentsByName[name];\n if (agent) {\n return agent;\n }\n const [remoteAgent] = await fetchAllAgents(this.graphQLClient, {\n names: [name],\n });\n if (!remoteAgent) {\n return undefined;\n }\n this.agentsByName[remoteAgent.name] = remoteAgent;\n this.agentsByAgentId[remoteAgent.agentId] = remoteAgent;\n return remoteAgent;\n }\n\n /**\n * Get a prompt thread by ts\n *\n * @param ts - the slack message timestamp to look up thread for\n * @returns Large language model configuration\n */\n async getPromptThreadBySlackTs(\n ts: string,\n ): Promise<PromptThread | undefined> {\n const [thread] = await fetchAllPromptThreads(this.graphQLClient, {\n slackMessageTs: [ts],\n });\n return thread;\n }\n\n /**\n * Get a list of agent definitions by name.\n * Pulls from cache and may return less agents\n * than requested if some are not found\n *\n * @param names - Names of agents to fetch\n * @returns The agents that were found matching the names\n */\n async getAgentsByName(names: string[]): Promise<Agent[]> {\n if (names.length < 1) {\n throw new Error('Expected at least one name to be provided');\n }\n const { hasCache = [], missingCache = [] } = groupBy(names, (name) =>\n this.agentsByName[name] ? 'hasCache' : 'missingCache',\n );\n const cachedAgents = hasCache.map((name) => this.agentsByName[name]);\n if (missingCache.length === 0) {\n return cachedAgents;\n }\n const chunkedNames = chunk(missingCache, 50);\n const remoteAgents: Agent[] = [];\n await mapSeries(chunkedNames, async (chunkedName) => {\n const pageOfAgents = await fetchAllAgents(this.graphQLClient, {\n names: chunkedName,\n });\n pageOfAgents.forEach((agent) => {\n this.agentsByName[agent.name] = agent;\n this.agentsByAgentId[agent.agentId] = agent;\n });\n remoteAgents.push(...pageOfAgents);\n });\n return [...cachedAgents, ...remoteAgents];\n }\n\n /**\n * Fetch metadata on agent files\n *\n * @param filterBy - Filter by parameters\n * @returns The files found matching the filter\n */\n getAgentFiles(filterBy: AgentFileFilterBy): Promise<AgentFile[]> {\n return fetchAllAgentFiles(this.graphQLClient, filterBy);\n }\n\n /**\n * Look up the large language model to report on\n *\n * @param largeLanguageModel - Input\n * @returns Large language model configuration\n */\n getLargeLanguageModel(\n largeLanguageModel: ReportPromptRunOptions['largeLanguageModel'],\n ): LargeLanguageModel {\n const matching = this.largeLanguageModels.find((model) =>\n typeof largeLanguageModel === 'string'\n ? model.id === largeLanguageModel\n : model.name === largeLanguageModel.name &&\n model.client === largeLanguageModel.client,\n );\n if (!matching) {\n throw new Error(\n `Failed to find model matching: ${\n typeof largeLanguageModel === 'string'\n ? largeLanguageModel\n : JSON.stringify(largeLanguageModel)\n }`,\n );\n }\n return matching;\n }\n\n /**\n * Get a prompt definition by name\n *\n * @param promptName - Prompt to compile\n * @returns Parsed content\n */\n async getPromptDefinition<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n ): Promise<TranscendPromptTemplated> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n // Lookup prompt\n const { promptContentMap } = this;\n if (!promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n const promptTemplate = promptContentMap[promptName];\n if (!promptTemplate) {\n throw new Error(\n `Expected this.promptContentMap[${promptName}] to be defined`,\n );\n }\n return promptTemplate;\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to compile\n * @param params - Runtime parameters\n * @returns Parsed content\n */\n async compilePrompt<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n params: t.TypeOf<TPrompts[TPromptName]['paramCodec']>,\n ): Promise<string> {\n // Grab the prompt\n const promptTemplate = await this.getPromptDefinition(promptName);\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure prompt is approved\n if (\n this.requireApproval &&\n promptTemplate.status !== PromptStatus.Approved\n ) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because its in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // If prompt is rejected, throw error\n if (promptTemplate.status === PromptStatus.Rejected) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because it's in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // Validate params\n decodeCodec(promptInput.paramCodec, params);\n\n // Compile prompt and template\n return this.handlebars.compile(promptTemplate.content)({\n // template in currentDate by default\n currentDate: new Date().toISOString(),\n ...this.variables,\n ...params,\n });\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to parse\n * @param response - AI response as string\n * @returns Parsed content\n */\n parseAiResponse<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n response: string,\n ): t.TypeOf<TPrompts[TPromptName]['outputCodec']> {\n // Look up prompt info\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Extract from tag if needed\n const extracted = promptInput.extractFromTag\n ? (createRegexForTag(promptInput.extractFromTag).exec(response) ||\n [])[1] || response\n : response;\n\n // Parse via codec\n return decodeCodec(\n promptInput.outputCodec,\n jsonParseSafe(extracted),\n false,\n );\n }\n\n /**\n * Parse the AI response and report back to Transcend\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportAndParsePromptRun<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n { largeLanguageModel, ...options }: ReportPromptRunOptions,\n ): Promise<\n PromptRunResult & {\n /** Resulting prompt run */\n result: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n }\n > {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n if (\n options.promptRunMessages[options.promptRunMessages.length - 1].role !==\n ChatCompletionRole.Assistant\n ) {\n throw new Error(\n `promptRunMessages[${\n options.promptRunMessages.length - 1\n }].role is expected to be = ${ChatCompletionRole.Assistant}`,\n );\n }\n const response =\n options.promptRunMessages[options.promptRunMessages.length - 1].content;\n\n let parsed: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n try {\n // Parse the response\n parsed = this.parseAiResponse(promptName, response);\n } catch (err) {\n await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n error: err.message,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n throw err;\n }\n\n // report successful run\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Resolved,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n result: parsed,\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n\n /**\n * Report an error for a particular prompt\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportPromptRunError<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n {\n largeLanguageModel,\n ...options\n }: Requirize<ReportPromptRunOptions, 'error'>,\n ): Promise<PromptRunResult> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n}\n/* eslint-enable max-lines */\n","import { GraphQLClient } from 'graphql-request';\nimport { LargeLanguageModelClient } from '@transcend-io/privacy-types';\nimport { LARGE_LANGUAGE_MODELS } from './gqls';\nimport { makeGraphQLRequest } from './makeGraphQLRequest';\n\nexport interface LargeLanguageModel {\n /** ID of prompts */\n id: string;\n /** The name of the large language model. */\n name: string;\n /** The content of the prompt template. */\n client: LargeLanguageModelClient;\n /** Whether hosted by Transcend or not */\n isTranscendHosted: boolean;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all LargeLanguageModels in the organization\n *\n * @param client - GraphQL client\n * @returns All LargeLanguageModels in the organization\n */\nexport async function fetchAllLargeLanguageModels(\n client: GraphQLClient,\n): Promise<LargeLanguageModel[]> {\n const largeLanguageModels: LargeLanguageModel[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n largeLanguageModels: { nodes },\n } = await makeGraphQLRequest<{\n /** LargeLanguageModels */\n largeLanguageModels: {\n /** List */\n nodes: LargeLanguageModel[];\n };\n }>(client, LARGE_LANGUAGE_MODELS, {\n first: PAGE_SIZE,\n offset,\n });\n largeLanguageModels.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return largeLanguageModels.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { difference } from 'lodash-es';\nimport fastGlob from 'fast-glob';\nimport { execSync } from 'child_process';\n\n/**\n * Function thats gets the git files that have changed\n * and returns the code\n *\n * @param options - Options\n * @returns Changes files and diffs\n */\nexport function getGitFilesThatChanged({\n baseBranch,\n rootDirectory,\n githubRepo,\n excludedGlob = [],\n fileBlockList = [],\n}: {\n /** Base branch */\n baseBranch: string;\n /** Github repo name */\n githubRepo: string;\n /** Root directory */\n rootDirectory: string;\n /** A glob that excludes files */\n excludedGlob?: string[];\n /** Block list of files to not process */\n fileBlockList?: string[];\n}): {\n /** The list of files that changed */\n changedFiles: string[];\n /** Github repo name */\n repoName: string;\n /** Current commit */\n commit: string;\n /** File diffs */\n fileDiffs: { [k in string]: string };\n} {\n // Pull base branch\n execSync(`git fetch origin ${baseBranch}`);\n\n // Latest commit on base branch. If we are on the base branch, we take the prior commit\n const latestBasedCommit = execSync(\n `git ls-remote ${githubRepo} \"refs/heads/${baseBranch}\" | cut -f 1`,\n { encoding: 'utf-8' },\n ).split('\\n')[0];\n\n // This commit\n const latestThisCommit = execSync('git rev-parse HEAD', {\n encoding: 'utf-8',\n }).split('\\n')[0];\n\n // Ensure commits are present\n if (!latestBasedCommit || !latestThisCommit) {\n throw new Error('FAILED TO FIND COMMIT RANGE');\n }\n\n // Get the diff between the given branch and base branch\n const diff = execSync(\n `git fetch && git diff --name-only \"${\n baseBranch || latestBasedCommit\n }...${latestThisCommit}\" -- ${rootDirectory}`,\n { encoding: 'utf-8' },\n );\n\n // Filter out block list\n const changedFiles = difference(\n diff.split('\\n').filter((f) => f),\n fileBlockList,\n );\n\n // Filter out globs\n const filteredChanges =\n excludedGlob.length > 0\n ? fastGlob.sync(changedFiles, { ignore: excludedGlob })\n : changedFiles;\n\n // Get the contents of only the changed files\n const fileDiffs: { [k in string]: string } = {};\n filteredChanges.forEach((file) => {\n const contents = execSync(`git show ${latestThisCommit}:${file}`, {\n encoding: 'utf-8',\n });\n fileDiffs[file] = contents;\n });\n\n // Pull the github repo name\n const repoName = githubRepo.split('/').pop()!.split('.')[0];\n\n return {\n changedFiles,\n fileDiffs,\n repoName,\n commit: latestThisCommit,\n };\n}\n"]}
|