@transcend-io/cli 8.0.4 → 8.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/bin/bash-complete.cjs +1 -1
  2. package/dist/bin/cli.cjs +1 -1
  3. package/dist/bin/deprecated-command.cjs +2 -2
  4. package/dist/{chunk-XJAEXXYU.cjs → chunk-5Y7FIOUT.cjs} +2 -2
  5. package/dist/{chunk-XJAEXXYU.cjs.map → chunk-5Y7FIOUT.cjs.map} +1 -1
  6. package/dist/{chunk-ZBKJMC7C.cjs → chunk-7O5DWH3M.cjs} +18 -18
  7. package/dist/{chunk-ZBKJMC7C.cjs.map → chunk-7O5DWH3M.cjs.map} +1 -1
  8. package/dist/{chunk-HJBQCKCR.cjs → chunk-DCBE53LG.cjs} +3 -3
  9. package/dist/{chunk-HJBQCKCR.cjs.map → chunk-DCBE53LG.cjs.map} +1 -1
  10. package/dist/{chunk-6VG44TPZ.cjs → chunk-DTGC4M5U.cjs} +2 -2
  11. package/dist/{chunk-6VG44TPZ.cjs.map → chunk-DTGC4M5U.cjs.map} +1 -1
  12. package/dist/{chunk-2P2C7ZL3.cjs → chunk-IU4E6MQW.cjs} +2 -2
  13. package/dist/{chunk-2P2C7ZL3.cjs.map → chunk-IU4E6MQW.cjs.map} +1 -1
  14. package/dist/{chunk-6Z44RBJE.cjs → chunk-JZEDU4GZ.cjs} +2 -2
  15. package/dist/{chunk-6Z44RBJE.cjs.map → chunk-JZEDU4GZ.cjs.map} +1 -1
  16. package/dist/{chunk-LQHB5EIW.cjs → chunk-KU3UCRAF.cjs} +2 -2
  17. package/dist/{chunk-LQHB5EIW.cjs.map → chunk-KU3UCRAF.cjs.map} +1 -1
  18. package/dist/{chunk-4ZN6PNJE.cjs → chunk-LPUZGMB6.cjs} +4 -4
  19. package/dist/{chunk-4ZN6PNJE.cjs.map → chunk-LPUZGMB6.cjs.map} +1 -1
  20. package/dist/{chunk-QG4ECDFE.cjs → chunk-MFIMY5RY.cjs} +2 -2
  21. package/dist/{chunk-QG4ECDFE.cjs.map → chunk-MFIMY5RY.cjs.map} +1 -1
  22. package/dist/{chunk-GVWWTQ2S.cjs → chunk-NAGRUVXK.cjs} +2 -2
  23. package/dist/{chunk-GVWWTQ2S.cjs.map → chunk-NAGRUVXK.cjs.map} +1 -1
  24. package/dist/{chunk-YREFLYHM.cjs → chunk-OKLX7XKW.cjs} +2 -2
  25. package/dist/{chunk-YREFLYHM.cjs.map → chunk-OKLX7XKW.cjs.map} +1 -1
  26. package/dist/{chunk-OBNZ7JBG.cjs → chunk-YMH24XQT.cjs} +19 -19
  27. package/dist/{chunk-OBNZ7JBG.cjs.map → chunk-YMH24XQT.cjs.map} +1 -1
  28. package/dist/{impl-3WG6YKYX.cjs → impl-22FRQBKA.cjs} +2 -2
  29. package/dist/{impl-3WG6YKYX.cjs.map → impl-22FRQBKA.cjs.map} +1 -1
  30. package/dist/{impl-6GEUCO6I.cjs → impl-2WH2UTIZ.cjs} +2 -2
  31. package/dist/{impl-6GEUCO6I.cjs.map → impl-2WH2UTIZ.cjs.map} +1 -1
  32. package/dist/{impl-6HXNGVRH.cjs → impl-2XFKDVXC.cjs} +2 -2
  33. package/dist/{impl-6HXNGVRH.cjs.map → impl-2XFKDVXC.cjs.map} +1 -1
  34. package/dist/{impl-YVUKRVNV.cjs → impl-3JDGUUXS.cjs} +2 -2
  35. package/dist/{impl-YVUKRVNV.cjs.map → impl-3JDGUUXS.cjs.map} +1 -1
  36. package/dist/{impl-RO3RT7ZE.cjs → impl-4WFQNFXM.cjs} +2 -2
  37. package/dist/{impl-RO3RT7ZE.cjs.map → impl-4WFQNFXM.cjs.map} +1 -1
  38. package/dist/{impl-BYVUQ5PD.cjs → impl-5IVCXXAL.cjs} +2 -2
  39. package/dist/{impl-BYVUQ5PD.cjs.map → impl-5IVCXXAL.cjs.map} +1 -1
  40. package/dist/{impl-CQPYZDEP.cjs → impl-5VNZMRQP.cjs} +2 -2
  41. package/dist/{impl-CQPYZDEP.cjs.map → impl-5VNZMRQP.cjs.map} +1 -1
  42. package/dist/{impl-I7QN6JHE.cjs → impl-7JEVVESR.cjs} +2 -2
  43. package/dist/{impl-I7QN6JHE.cjs.map → impl-7JEVVESR.cjs.map} +1 -1
  44. package/dist/{impl-426AX523.cjs → impl-7U3M4RGF.cjs} +2 -2
  45. package/dist/{impl-426AX523.cjs.map → impl-7U3M4RGF.cjs.map} +1 -1
  46. package/dist/{impl-AIUN3M37.cjs → impl-B3OMYCGQ.cjs} +2 -2
  47. package/dist/{impl-AIUN3M37.cjs.map → impl-B3OMYCGQ.cjs.map} +1 -1
  48. package/dist/{impl-EHBBW7RO.cjs → impl-DGMMPU6J.cjs} +2 -2
  49. package/dist/{impl-EHBBW7RO.cjs.map → impl-DGMMPU6J.cjs.map} +1 -1
  50. package/dist/{impl-WVOC3NBM.cjs → impl-DUKSVNOM.cjs} +2 -2
  51. package/dist/{impl-WVOC3NBM.cjs.map → impl-DUKSVNOM.cjs.map} +1 -1
  52. package/dist/{impl-3IUL3P3V.cjs → impl-EJMVBV6T.cjs} +2 -2
  53. package/dist/{impl-3IUL3P3V.cjs.map → impl-EJMVBV6T.cjs.map} +1 -1
  54. package/dist/{impl-E6NFYH4V.cjs → impl-GNNZ6ISS.cjs} +2 -2
  55. package/dist/{impl-E6NFYH4V.cjs.map → impl-GNNZ6ISS.cjs.map} +1 -1
  56. package/dist/{impl-EPE2BP2D.cjs → impl-I6ETF7X7.cjs} +2 -2
  57. package/dist/{impl-EPE2BP2D.cjs.map → impl-I6ETF7X7.cjs.map} +1 -1
  58. package/dist/impl-IKL2VVT5.cjs +2 -0
  59. package/dist/{impl-VO6SR3UF.cjs.map → impl-IKL2VVT5.cjs.map} +1 -1
  60. package/dist/{impl-O5FXKTSS.cjs → impl-IN2PQA3H.cjs} +2 -2
  61. package/dist/{impl-O5FXKTSS.cjs.map → impl-IN2PQA3H.cjs.map} +1 -1
  62. package/dist/{impl-QHLD4E4E.cjs → impl-JA34WWJ5.cjs} +2 -2
  63. package/dist/{impl-QHLD4E4E.cjs.map → impl-JA34WWJ5.cjs.map} +1 -1
  64. package/dist/{impl-35XLHL4O.cjs → impl-LAYRDHOS.cjs} +2 -2
  65. package/dist/{impl-35XLHL4O.cjs.map → impl-LAYRDHOS.cjs.map} +1 -1
  66. package/dist/{impl-5IBWZCND.cjs → impl-LO7NADSE.cjs} +2 -2
  67. package/dist/{impl-5IBWZCND.cjs.map → impl-LO7NADSE.cjs.map} +1 -1
  68. package/dist/{impl-UIQVAQFF.cjs → impl-LWPYKGCZ.cjs} +2 -2
  69. package/dist/{impl-UIQVAQFF.cjs.map → impl-LWPYKGCZ.cjs.map} +1 -1
  70. package/dist/impl-OMOQK2HQ.cjs +12 -0
  71. package/dist/impl-OMOQK2HQ.cjs.map +1 -0
  72. package/dist/{impl-M6FW6NDT.cjs → impl-OZ6XHZRW.cjs} +2 -2
  73. package/dist/{impl-M6FW6NDT.cjs.map → impl-OZ6XHZRW.cjs.map} +1 -1
  74. package/dist/{impl-IHFTH6YX.cjs → impl-S3QSYERT.cjs} +2 -2
  75. package/dist/{impl-IHFTH6YX.cjs.map → impl-S3QSYERT.cjs.map} +1 -1
  76. package/dist/{impl-JZLYOI5F.cjs → impl-SVLQQPHG.cjs} +2 -2
  77. package/dist/{impl-JZLYOI5F.cjs.map → impl-SVLQQPHG.cjs.map} +1 -1
  78. package/dist/{impl-77KAZ4XH.cjs → impl-SZM2IXSY.cjs} +3 -3
  79. package/dist/{impl-77KAZ4XH.cjs.map → impl-SZM2IXSY.cjs.map} +1 -1
  80. package/dist/{impl-OKNOTBT6.cjs → impl-TEADN2ZL.cjs} +5 -5
  81. package/dist/{impl-OKNOTBT6.cjs.map → impl-TEADN2ZL.cjs.map} +1 -1
  82. package/dist/{impl-5B6CLRP6.cjs → impl-TVRDO556.cjs} +2 -2
  83. package/dist/{impl-5B6CLRP6.cjs.map → impl-TVRDO556.cjs.map} +1 -1
  84. package/dist/{impl-VMZLIXUM.cjs → impl-VRTPR7ZC.cjs} +2 -2
  85. package/dist/{impl-VMZLIXUM.cjs.map → impl-VRTPR7ZC.cjs.map} +1 -1
  86. package/dist/{impl-HOCQ2FU3.cjs → impl-VZDR2CDX.cjs} +2 -2
  87. package/dist/{impl-HOCQ2FU3.cjs.map → impl-VZDR2CDX.cjs.map} +1 -1
  88. package/dist/{impl-PB3CEDXP.cjs → impl-WCRE3QMZ.cjs} +2 -2
  89. package/dist/{impl-PB3CEDXP.cjs.map → impl-WCRE3QMZ.cjs.map} +1 -1
  90. package/dist/{impl-E7RIXWG5.cjs → impl-X7QVQTTU.cjs} +2 -2
  91. package/dist/{impl-E7RIXWG5.cjs.map → impl-X7QVQTTU.cjs.map} +1 -1
  92. package/dist/{impl-V4AAI72P.cjs → impl-XXGHYIS2.cjs} +2 -2
  93. package/dist/{impl-V4AAI72P.cjs.map → impl-XXGHYIS2.cjs.map} +1 -1
  94. package/dist/{impl-T4JNIPRU.cjs → impl-YYLZH24L.cjs} +4 -4
  95. package/dist/{impl-T4JNIPRU.cjs.map → impl-YYLZH24L.cjs.map} +1 -1
  96. package/dist/{impl-YJ7MLTPD.cjs → impl-Z3TEIP7I.cjs} +2 -2
  97. package/dist/{impl-YJ7MLTPD.cjs.map → impl-Z3TEIP7I.cjs.map} +1 -1
  98. package/dist/{impl-SDF36RUQ.cjs → impl-ZXCX5CQQ.cjs} +2 -2
  99. package/dist/{impl-SDF36RUQ.cjs.map → impl-ZXCX5CQQ.cjs.map} +1 -1
  100. package/dist/{impl-B5MBY4PI.cjs → impl-ZY3HLGMV.cjs} +2 -2
  101. package/dist/{impl-B5MBY4PI.cjs.map → impl-ZY3HLGMV.cjs.map} +1 -1
  102. package/dist/{impl-ZGRHLCA3.cjs → impl-ZZL5FMCH.cjs} +3 -3
  103. package/dist/{impl-ZGRHLCA3.cjs.map → impl-ZZL5FMCH.cjs.map} +1 -1
  104. package/dist/index.cjs +3 -3
  105. package/dist/index.cjs.map +1 -1
  106. package/dist/index.d.cts +43 -3
  107. package/package.json +1 -1
  108. package/dist/impl-G7JOSWM6.cjs +0 -12
  109. package/dist/impl-G7JOSWM6.cjs.map +0 -1
  110. package/dist/impl-VO6SR3UF.cjs +0 -2
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 _chunkGVWWTQ2Scjs = require('./chunk-GVWWTQ2S.cjs');var _chunk4ZN6PNJEcjs = require('./chunk-4ZN6PNJE.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkSW5CIF5Dcjs = require('./chunk-SW5CIF5D.cjs');var _chunkYREFLYHMcjs = require('./chunk-YREFLYHM.cjs');var _chunkLQHB5EIWcjs = require('./chunk-LQHB5EIW.cjs');var _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunkHJBQCKCRcjs = require('./chunk-HJBQCKCR.cjs');var _chunk6Z44RBJEcjs = require('./chunk-6Z44RBJE.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunkZBKJMC7Ccjs = require('./chunk-ZBKJMC7C.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkQG4ECDFEcjs = require('./chunk-QG4ECDFE.cjs');var _chunkQ7I37FJVcjs = require('./chunk-Q7I37FJV.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 D(a){let e=[],r=0,t=!1;do{let{largeLanguageModels:{nodes:s}}=await _chunkZBKJMC7Ccjs.Uf.call(void 0, a,_chunkZBKJMC7Ccjs.Fb,{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))}var _bluebird = require('bluebird');function j(a){return new RegExp(`<${a}>([\\s\\S]+?)<\\/${a}>`)}function Dm(a){return a}var H=a=>{try{return JSON.parse(a)}catch (e2){return a}},B= exports.TranscendPromptManager = (_class =class{__init() {this.largeLanguageModels=[]}__init2() {this.agentsByName={}}__init3() {this.agentsByAgentId={}}constructor({prompts:e,handlebarsOptions:r={},transcendUrl:t=_chunkQG4ECDFEcjs.r,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=_chunkZBKJMC7Ccjs.vc.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=_chunkQG4ECDFEcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunkZBKJMC7Ccjs.yd.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),D(this.graphQLClient),_chunkZBKJMC7Ccjs.Fc.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunkQG4ECDFEcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunkQG4ECDFEcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunkQG4ECDFEcjs.e.call(void 0, o.prompts,"title"),c=_chunkQG4ECDFEcjs.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 _chunkZBKJMC7Ccjs.Fc.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 _chunkZBKJMC7Ccjs.zd.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=[]}=_chunkQG4ECDFEcjs.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=_chunkQG4ECDFEcjs.b.call(void 0, t,50),i=[];return await _bluebird.mapSeries.call(void 0, o,async p=>{let m=await _chunkZBKJMC7Ccjs.Fc.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 _chunkZBKJMC7Ccjs.Dc.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 _chunkZBKJMC7Ccjs.ae.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 _chunkZBKJMC7Ccjs.ae.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 _chunkZBKJMC7Ccjs.ae.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 Sm(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 jm({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 _chunkNAGRUVXKcjs = require('./chunk-NAGRUVXK.cjs');var _chunkLPUZGMB6cjs = require('./chunk-LPUZGMB6.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkSW5CIF5Dcjs = require('./chunk-SW5CIF5D.cjs');var _chunkOKLX7XKWcjs = require('./chunk-OKLX7XKW.cjs');var _chunkKU3UCRAFcjs = require('./chunk-KU3UCRAF.cjs');var _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunkDCBE53LGcjs = require('./chunk-DCBE53LG.cjs');var _chunkJZEDU4GZcjs = require('./chunk-JZEDU4GZ.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunk7O5DWH3Mcjs = require('./chunk-7O5DWH3M.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkMFIMY5RYcjs = require('./chunk-MFIMY5RY.cjs');var _chunkQ7I37FJVcjs = require('./chunk-Q7I37FJV.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 D(a){let e=[],r=0,t=!1;do{let{largeLanguageModels:{nodes:s}}=await _chunk7O5DWH3Mcjs.Wf.call(void 0, a,_chunk7O5DWH3Mcjs.Fb,{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))}var _bluebird = require('bluebird');function j(a){return new RegExp(`<${a}>([\\s\\S]+?)<\\/${a}>`)}function Sm(a){return a}var H=a=>{try{return JSON.parse(a)}catch (e2){return a}},B= exports.TranscendPromptManager = (_class =class{__init() {this.largeLanguageModels=[]}__init2() {this.agentsByName={}}__init3() {this.agentsByAgentId={}}constructor({prompts:e,handlebarsOptions:r={},transcendUrl:t=_chunkMFIMY5RYcjs.r,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=_chunk7O5DWH3Mcjs.vc.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=_chunkMFIMY5RYcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunk7O5DWH3Mcjs.yd.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),D(this.graphQLClient),_chunk7O5DWH3Mcjs.Fc.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunkMFIMY5RYcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunkMFIMY5RYcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunkMFIMY5RYcjs.e.call(void 0, o.prompts,"title"),c=_chunkMFIMY5RYcjs.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 _chunk7O5DWH3Mcjs.Fc.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 _chunk7O5DWH3Mcjs.zd.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=[]}=_chunkMFIMY5RYcjs.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=_chunkMFIMY5RYcjs.b.call(void 0, t,50),i=[];return await _bluebird.mapSeries.call(void 0, o,async p=>{let m=await _chunk7O5DWH3Mcjs.Fc.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 _chunk7O5DWH3Mcjs.Dc.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 _chunk7O5DWH3Mcjs.ae.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 _chunk7O5DWH3Mcjs.ae.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 _chunk7O5DWH3Mcjs.ae.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 Bm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function Qm(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 Vm({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=_chunkQG4ECDFEcjs.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 F=_child_process.execSync.call(void 0, `git show ${i}:${d}`,{encoding:"utf-8"});n[d]=F});let g=r.split("/").pop().split(".")[0];return{changedFiles:m,fileDiffs:n,repoName:g,commit:i}}exports.ACTIONS = _chunkZBKJMC7Ccjs.tb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunkZBKJMC7Ccjs.Ga; exports.ADD_SILO_DISCOVERY_RESULTS = _chunkZBKJMC7Ccjs.G; exports.ADMIN_DASH = _chunkQG4ECDFEcjs.o; exports.ADMIN_DASH_DATAPOINTS = _chunkQG4ECDFEcjs.q; exports.ADMIN_DASH_INTEGRATIONS = _chunkQG4ECDFEcjs.p; exports.AGENTS = _chunkZBKJMC7Ccjs.Gb; exports.AGENT_FILES = _chunkZBKJMC7Ccjs.Jb; exports.AGENT_FUNCTIONS = _chunkZBKJMC7Ccjs.Mb; exports.API_KEYS = _chunkZBKJMC7Ccjs.D; exports.APPROVE_PRIVACY_REQUEST = _chunkZBKJMC7Ccjs.W; exports.ASSESSMENTS = _chunkZBKJMC7Ccjs.ea; exports.ASSESSMENT_SECTION_FIELDS = _chunkZBKJMC7Ccjs.da; exports.ASSESSMENT_TEMPLATES = _chunkZBKJMC7Ccjs.ia; exports.ASSUME_ROLE = _chunkZBKJMC7Ccjs.Eb; exports.ATTRIBUTES = _chunkZBKJMC7Ccjs.Ka; exports.ATTRIBUTE_KEYS_REQUESTS = _chunkZBKJMC7Ccjs.L; exports.ATTRIBUTE_VALUES = _chunkZBKJMC7Ccjs.Oa; exports.ActionInput = _chunkQEM6S2W7cjs.G; exports.ActionItemCollectionInput = _chunkQEM6S2W7cjs.R; exports.ActionItemInput = _chunkQEM6S2W7cjs.S; exports.AgentFileInput = _chunkQEM6S2W7cjs.o; exports.AgentFunctionInput = _chunkQEM6S2W7cjs.n; exports.AgentInput = _chunkQEM6S2W7cjs.m; exports.ApiKeyInput = _chunkQEM6S2W7cjs.c; exports.AssessmentAction = _chunkZBKJMC7Ccjs.Kd; exports.AssessmentAnswerOptionInput = _chunkQEM6S2W7cjs.Y; exports.AssessmentDisplayLogicInput = _chunkQEM6S2W7cjs.V; exports.AssessmentInput = _chunkQEM6S2W7cjs.ca; exports.AssessmentNestedRule = _chunkZBKJMC7Ccjs.Jd; exports.AssessmentNestedRuleInput = _chunkQEM6S2W7cjs.U; exports.AssessmentResourceInput = _chunkQEM6S2W7cjs.ba; exports.AssessmentRetentionScheduleInput = _chunkQEM6S2W7cjs.$; exports.AssessmentRiskLogic = _chunkZBKJMC7Ccjs.Md; exports.AssessmentRule = _chunkZBKJMC7Ccjs.Id; exports.AssessmentRuleInput = _chunkQEM6S2W7cjs.T; exports.AssessmentSectionInput = _chunkQEM6S2W7cjs._; exports.AssessmentSectionQuestionInput = _chunkQEM6S2W7cjs.Z; exports.AssessmentTemplateInput = _chunkQEM6S2W7cjs.aa; exports.AttestedExtraIdentifiers = _chunkZBKJMC7Ccjs.jf; exports.AttributeInput = _chunkQEM6S2W7cjs.k; exports.AttributePreview = _chunkQEM6S2W7cjs.l; exports.AttributeValueInput = _chunkQEM6S2W7cjs.j; exports.BLANK = _chunkZBKJMC7Ccjs.cc; exports.BULK_APPLY = _chunkZBKJMC7Ccjs.bc; exports.BULK_REQUEST_FILES = _chunkZBKJMC7Ccjs.Ea; exports.BUSINESS_ENTITIES = _chunkZBKJMC7Ccjs.qb; exports.BusinessEntityInput = _chunkQEM6S2W7cjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunkZBKJMC7Ccjs.X; exports.CAN_APPLY_IN_BULK = _chunkZBKJMC7Ccjs.gc; exports.CATALOGS = _chunkZBKJMC7Ccjs.r; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunkZBKJMC7Ccjs.ua; exports.CODE_PACKAGES = _chunkZBKJMC7Ccjs.P; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunkZBKJMC7Ccjs.pb; exports.CONSENT_PARTITIONS = _chunkZBKJMC7Ccjs.Ta; exports.COOKIES = _chunkZBKJMC7Ccjs.Ya; exports.CREATE_ACTION_ITEMS = _chunkZBKJMC7Ccjs.xb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunkZBKJMC7Ccjs.Ia; exports.CREATE_AGENT = _chunkZBKJMC7Ccjs.Hb; exports.CREATE_AGENT_FILE = _chunkZBKJMC7Ccjs.Kb; exports.CREATE_AGENT_FUNCTION = _chunkZBKJMC7Ccjs.Nb; exports.CREATE_API_KEY = _chunkZBKJMC7Ccjs.E; exports.CREATE_ATTRIBUTE = _chunkZBKJMC7Ccjs.Pa; exports.CREATE_ATTRIBUTE_VALUES = _chunkZBKJMC7Ccjs.La; exports.CREATE_BUSINESS_ENTITY = _chunkZBKJMC7Ccjs.rb; exports.CREATE_CODE_PACKAGE = _chunkZBKJMC7Ccjs.R; exports.CREATE_CONSENT_EXPERIENCE = _chunkZBKJMC7Ccjs.nb; exports.CREATE_CONSENT_MANAGER = _chunkZBKJMC7Ccjs.ab; exports.CREATE_CONSENT_PARTITION = _chunkZBKJMC7Ccjs.ob; exports.CREATE_DATA_FLOWS = _chunkZBKJMC7Ccjs.Ua; exports.CREATE_DATA_SILOS = _chunkZBKJMC7Ccjs.m; exports.CREATE_DATA_SUBJECT = _chunkZBKJMC7Ccjs.x; exports.CREATE_DATA_SUB_CATEGORY = _chunkZBKJMC7Ccjs.Tb; exports.CREATE_ENRICHER = _chunkZBKJMC7Ccjs.p; exports.CREATE_IDENTIFIER = _chunkZBKJMC7Ccjs.u; exports.CREATE_PROCESSING_ACTIVITY = _chunkZBKJMC7Ccjs.Zb; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunkZBKJMC7Ccjs.Wb; exports.CREATE_PROMPT = _chunkZBKJMC7Ccjs.oa; exports.CREATE_PROMPT_GROUP = _chunkZBKJMC7Ccjs.sa; exports.CREATE_PROMPT_PARTIAL = _chunkZBKJMC7Ccjs.qa; exports.CREATE_REPOSITORY = _chunkZBKJMC7Ccjs.C; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunkZBKJMC7Ccjs.O; exports.CREATE_TEAM = _chunkZBKJMC7Ccjs.ya; exports.CREATE_TEMPLATE = _chunkZBKJMC7Ccjs.J; exports.CREATE_VENDOR = _chunkZBKJMC7Ccjs.Qb; exports.CachedFileState = _chunkZBKJMC7Ccjs.hc; exports.CachedRequestState = _chunkZBKJMC7Ccjs.jc; exports.CodePackageInput = _chunkQEM6S2W7cjs.D; exports.CodePackageSdk = _chunkQEM6S2W7cjs.C; exports.ColumnName = _chunkZBKJMC7Ccjs.ec; exports.ConsentManageExperienceInput = _chunkQEM6S2W7cjs.K; exports.ConsentManagerInput = _chunkQEM6S2W7cjs.M; exports.ConsentManagerMetricBin = _chunkZBKJMC7Ccjs.Qc; exports.ConsentManagerServiceMetadata = _chunkQEM6S2W7cjs.ka; exports.ConsentPreferenceResponse = _chunkHJBQCKCRcjs.i; exports.ConsentPreferenceTopic = _chunkQEM6S2W7cjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkQEM6S2W7cjs.da; exports.ConsentPurpose = _chunkQEM6S2W7cjs.fa; exports.CookieCsvInput = _chunkQEM6S2W7cjs.ja; exports.CookieInput = _chunkQEM6S2W7cjs.J; exports.CronIdentifier = _chunkLQHB5EIWcjs.a; exports.CronIdentifierPush = _chunkLQHB5EIWcjs.c; exports.DATAPOINT_EXPORT = _chunkZBKJMC7Ccjs.g; exports.DATA_FLOWS = _chunkZBKJMC7Ccjs.Xa; exports.DATA_POINTS = _chunkZBKJMC7Ccjs.a; exports.DATA_POINT_COUNT = _chunkZBKJMC7Ccjs.b; exports.DATA_SILOS = _chunkZBKJMC7Ccjs.i; exports.DATA_SILOS_ENRICHED = _chunkZBKJMC7Ccjs.k; exports.DATA_SILO_EXPORT = _chunkZBKJMC7Ccjs.j; exports.DATA_SUBJECTS = _chunkZBKJMC7Ccjs.w; exports.DATA_SUB_CATEGORIES = _chunkZBKJMC7Ccjs.Sb; exports.DEFAULT_TRANSCEND_API = _chunkQG4ECDFEcjs.r; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkQG4ECDFEcjs.s; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunkZBKJMC7Ccjs._d; exports.DELETE_API_KEY = _chunkZBKJMC7Ccjs.F; exports.DELETE_ATTRIBUTE_VALUE = _chunkZBKJMC7Ccjs.Na; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunkZBKJMC7Ccjs.zb; exports.DEPLOY_CONSENT_MANAGER = _chunkZBKJMC7Ccjs.db; exports.DETERMINE_LOGIN_METHOD = _chunkZBKJMC7Ccjs.Cb; exports.DataCategoryGuessInput = _chunkQEM6S2W7cjs.h; exports.DataCategoryInput = _chunkQEM6S2W7cjs.q; exports.DataCategoryPreviewInput = _chunkQEM6S2W7cjs.g; exports.DataCategoryRecommendationInput = _chunkQEM6S2W7cjs.i; exports.DataFlowCsvInput = _chunkQEM6S2W7cjs.ia; exports.DataFlowInput = _chunkQEM6S2W7cjs.I; exports.DataSiloInput = _chunkQEM6S2W7cjs.Q; exports.DataSubjectInput = _chunkQEM6S2W7cjs.F; exports.DatapointInput = _chunkQEM6S2W7cjs.w; exports.ENABLED_PLUGINS = _chunkZBKJMC7Ccjs.H; exports.ENRICHERS = _chunkZBKJMC7Ccjs.n; exports.ENTRY_COUNT = _chunkZBKJMC7Ccjs.h; exports.EXPERIENCES = _chunkZBKJMC7Ccjs.Sa; exports.EnrichPrivacyRequest = _chunkGVWWTQ2Scjs.b; exports.EnricherInput = _chunkQEM6S2W7cjs.e; exports.FETCH_CONSENT_MANAGER = _chunkZBKJMC7Ccjs._a; exports.FETCH_CONSENT_MANAGER_ID = _chunkZBKJMC7Ccjs.Za; exports.FETCH_CONSENT_MANAGER_THEME = _chunkZBKJMC7Ccjs.$a; exports.FETCH_PRIVACY_CENTER_ID = _chunkZBKJMC7Ccjs.yb; exports.FieldInput = _chunkQEM6S2W7cjs.v; exports.GLOBAL_ACTION_ITEMS = _chunkZBKJMC7Ccjs.vb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunkZBKJMC7Ccjs.Ha; exports.IDENTIFIERS = _chunkZBKJMC7Ccjs.s; exports.IDENTIFIER_BLOCK_LIST = _chunkZBKJMC7Ccjs.dc; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunkZBKJMC7Ccjs.fa; exports.INITIALIZER = _chunkZBKJMC7Ccjs.o; exports.IP_ADDRESS_REGEX = _chunkHJBQCKCRcjs.f; exports.IS_REQUIRED = _chunkZBKJMC7Ccjs.fc; exports.IdentifierInput = _chunkQEM6S2W7cjs.H; exports.ImportOnetrustAssessmentsInput = _chunkQEM6S2W7cjs.ra; exports.IntlMessage = _chunkZBKJMC7Ccjs.nf; exports.IntlMessageInput = _chunkQEM6S2W7cjs.P; exports.LARGE_LANGUAGE_MODELS = _chunkZBKJMC7Ccjs.Fb; exports.LOGIN = _chunkZBKJMC7Ccjs.Db; exports.MESSAGES = _chunkZBKJMC7Ccjs._; exports.NEW_IDENTIFIER_TYPES = _chunkZBKJMC7Ccjs.t; exports.NONE = _chunkZBKJMC7Ccjs.ac; exports.NOTIFY_ADDITIONAL_TIME = _chunkZBKJMC7Ccjs.Z; exports.ORGANIZATION = _chunkZBKJMC7Ccjs.K; exports.OneTrustFileFormat = _chunkQ7I37FJVcjs.a; exports.OneTrustPullResource = _chunkQ7I37FJVcjs.b; exports.OneTrustPullSource = _chunkQ7I37FJVcjs.c; exports.OpenAIEnabledRoute = _chunkQEM6S2W7cjs.ma; exports.OpenAIEnabledRoutes = _chunkQEM6S2W7cjs.na; exports.OpenAIIntegration = _chunkQEM6S2W7cjs.oa; exports.OpenAIRouteName = _chunkQ7I37FJVcjs.f; exports.POLICIES = _chunkZBKJMC7Ccjs.T; exports.PREFERENCE_TOPICS = _chunkZBKJMC7Ccjs.ha; exports.PRIVACY_CENTER = _chunkZBKJMC7Ccjs.Ab; exports.PROCESSING_ACTIVITIES = _chunkZBKJMC7Ccjs.Yb; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkZBKJMC7Ccjs.Vb; exports.PROMPTS = _chunkZBKJMC7Ccjs.ja; exports.PROMPTS_WITH_VARIABLES = _chunkZBKJMC7Ccjs.ma; exports.PROMPT_GROUPS = _chunkZBKJMC7Ccjs.la; exports.PROMPT_PARTIALS = _chunkZBKJMC7Ccjs.ka; exports.PROMPT_THREADS = _chunkZBKJMC7Ccjs.S; exports.PURPOSES = _chunkZBKJMC7Ccjs.ga; exports.ParsedAttributeInput = _chunkZBKJMC7Ccjs.oc; exports.PartitionInput = _chunkQEM6S2W7cjs.L; exports.PathfinderPolicy = _chunkQEM6S2W7cjs.pa; exports.PathfinderPolicyName = _chunkQ7I37FJVcjs.e; exports.PathfinderPolicyNameC = _chunkQEM6S2W7cjs.la; exports.PathfinderPromptRunMetadata = _chunkQEM6S2W7cjs.qa; exports.PolicyInput = _chunkQEM6S2W7cjs.O; exports.PrivacyCenterInput = _chunkQEM6S2W7cjs.N; exports.PrivacyRequest = _chunkZBKJMC7Ccjs.id; exports.PrivacyRequestInput = _chunkZBKJMC7Ccjs.kf; exports.PrivacyRequestResponse = _chunkZBKJMC7Ccjs.tf; exports.ProcessingActivityInput = _chunkQEM6S2W7cjs.A; exports.ProcessingPurposeInput = _chunkQEM6S2W7cjs.r; exports.ProcessingPurposePreviewInput = _chunkQEM6S2W7cjs.f; exports.PromptAVendorEmailSettings = _chunkQEM6S2W7cjs.x; exports.PromptGroupInput = _chunkQEM6S2W7cjs.u; exports.PromptInput = _chunkQEM6S2W7cjs.s; exports.PromptPartialInput = _chunkQEM6S2W7cjs.t; exports.PurposeMap = _chunk6Z44RBJEcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunkZBKJMC7Ccjs.wa; exports.REMOVE_REQUEST_IDENTIFIERS = _chunkZBKJMC7Ccjs.Aa; exports.REPORT_PROMPT_RUN = _chunkZBKJMC7Ccjs.Fa; exports.REPOSITORIES = _chunkZBKJMC7Ccjs.A; exports.REQUESTS = _chunkZBKJMC7Ccjs.V; exports.REQUEST_DATA_SILOS = _chunkZBKJMC7Ccjs.ta; exports.REQUEST_ENRICHERS = _chunkZBKJMC7Ccjs.aa; exports.REQUEST_FILES = _chunkZBKJMC7Ccjs.Da; exports.REQUEST_IDENTIFIERS = _chunkZBKJMC7Ccjs.Ba; exports.RETRYABLE_BATCH_STATUSES = _chunkQG4ECDFEcjs.y; exports.RETRY_REQUEST_DATA_SILO = _chunkZBKJMC7Ccjs.va; exports.RETRY_REQUEST_ENRICHER = _chunkZBKJMC7Ccjs.ba; exports.RegionInput = _chunkQEM6S2W7cjs.z; exports.RepositoryInput = _chunkQEM6S2W7cjs.E; exports.RequestFileMetadata = _chunkZBKJMC7Ccjs.of; exports.RequestFileMetadataResponse = _chunkZBKJMC7Ccjs.pf; exports.RequestIdentifiersResponse = _chunkZBKJMC7Ccjs.gd; exports.RiskAssignmentInput = _chunkQEM6S2W7cjs.W; exports.RiskLogicInput = _chunkQEM6S2W7cjs.X; exports.SCOPES_BY_TITLE = _chunkQG4ECDFEcjs.w; exports.SCOPE_TITLES = _chunkQG4ECDFEcjs.x; exports.SET_RESOURCE_ATTRIBUTES = _chunkZBKJMC7Ccjs.Ra; exports.SKIP_REQUEST_ENRICHER = _chunkZBKJMC7Ccjs.ca; exports.SOFTWARE_DEVELOPMENT_KITS = _chunkZBKJMC7Ccjs.M; exports.SOMBRA_VERSION = _chunkZBKJMC7Ccjs.$b; exports.SUB_DATA_POINTS = _chunkZBKJMC7Ccjs.c; exports.SUB_DATA_POINTS_COUNT = _chunkZBKJMC7Ccjs.d; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunkZBKJMC7Ccjs.e; exports.SYNC_ATTRIBUTE_TYPES = _chunkZBKJMC7Ccjs.Kc; exports.SoftwareDevelopmentKitInput = _chunkQEM6S2W7cjs.B; exports.StoredApiKey = _chunkQEM6S2W7cjs.ha; exports.SuccessfulRequest = _chunkZBKJMC7Ccjs.ic; exports.TEAMS = _chunkZBKJMC7Ccjs.xa; exports.TEMPLATES = _chunkZBKJMC7Ccjs.I; exports.TOGGLE_CONSENT_PRECEDENCE = _chunkZBKJMC7Ccjs.kb; exports.TOGGLE_DATA_SUBJECT = _chunkZBKJMC7Ccjs.z; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunkZBKJMC7Ccjs.jb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunkZBKJMC7Ccjs.ib; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunkZBKJMC7Ccjs.hb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkQG4ECDFEcjs.u; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkQG4ECDFEcjs.t; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkQG4ECDFEcjs.v; exports.TeamInput = _chunkQEM6S2W7cjs.d; exports.TemplateInput = _chunkQEM6S2W7cjs.a; exports.TranscendInput = _chunkQEM6S2W7cjs.ga; exports.TranscendPromptManager = B; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunkZBKJMC7Ccjs.ub; exports.UPDATE_ACTION_ITEMS = _chunkZBKJMC7Ccjs.wb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunkZBKJMC7Ccjs.Ja; exports.UPDATE_AGENTS = _chunkZBKJMC7Ccjs.Ib; exports.UPDATE_AGENT_FILES = _chunkZBKJMC7Ccjs.Lb; exports.UPDATE_AGENT_FUNCTIONS = _chunkZBKJMC7Ccjs.Ob; exports.UPDATE_ATTRIBUTE = _chunkZBKJMC7Ccjs.Qa; exports.UPDATE_ATTRIBUTE_VALUES = _chunkZBKJMC7Ccjs.Ma; exports.UPDATE_BUSINESS_ENTITIES = _chunkZBKJMC7Ccjs.sb; exports.UPDATE_CODE_PACKAGES = _chunkZBKJMC7Ccjs.Q; exports.UPDATE_CONSENT_EXPERIENCE = _chunkZBKJMC7Ccjs.mb; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunkZBKJMC7Ccjs.eb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunkZBKJMC7Ccjs.fb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunkZBKJMC7Ccjs.lb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunkZBKJMC7Ccjs.cb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunkZBKJMC7Ccjs.bb; exports.UPDATE_DATA_FLOWS = _chunkZBKJMC7Ccjs.Va; exports.UPDATE_DATA_SILOS = _chunkZBKJMC7Ccjs.l; exports.UPDATE_DATA_SUBJECT = _chunkZBKJMC7Ccjs.y; exports.UPDATE_DATA_SUB_CATEGORIES = _chunkZBKJMC7Ccjs.Ub; exports.UPDATE_ENRICHER = _chunkZBKJMC7Ccjs.q; exports.UPDATE_IDENTIFIER = _chunkZBKJMC7Ccjs.v; exports.UPDATE_INTL_MESSAGES = _chunkZBKJMC7Ccjs.$; exports.UPDATE_LOAD_OPTIONS = _chunkZBKJMC7Ccjs.gb; exports.UPDATE_OR_CREATE_COOKIES = _chunkZBKJMC7Ccjs.Wa; exports.UPDATE_OR_CREATE_DATA_POINT = _chunkZBKJMC7Ccjs.f; exports.UPDATE_POLICIES = _chunkZBKJMC7Ccjs.U; exports.UPDATE_PRIVACY_CENTER = _chunkZBKJMC7Ccjs.Bb; exports.UPDATE_PRIVACY_REQUEST = _chunkZBKJMC7Ccjs.Y; exports.UPDATE_PROCESSING_ACTIVITIES = _chunkZBKJMC7Ccjs._b; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkZBKJMC7Ccjs.Xb; exports.UPDATE_PROMPTS = _chunkZBKJMC7Ccjs.na; exports.UPDATE_PROMPT_GROUPS = _chunkZBKJMC7Ccjs.ra; exports.UPDATE_PROMPT_PARTIALS = _chunkZBKJMC7Ccjs.pa; exports.UPDATE_REPOSITORIES = _chunkZBKJMC7Ccjs.B; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunkZBKJMC7Ccjs.N; exports.UPDATE_TEAM = _chunkZBKJMC7Ccjs.za; exports.UPDATE_VENDORS = _chunkZBKJMC7Ccjs.Rb; exports.USERS = _chunkZBKJMC7Ccjs.Ca; exports.USP_STRING_REGEX = _chunk6Z44RBJEcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkSW5CIF5Dcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkSW5CIF5Dcjs.a; exports.VENDORS = _chunkZBKJMC7Ccjs.Pb; exports.VendorInput = _chunkQEM6S2W7cjs.p; exports.WebhookHeader = _chunkQEM6S2W7cjs.b; exports.addMessagesToPromptRun = _chunkZBKJMC7Ccjs.tc; exports.appendCsvSync = _chunkLR3CPNDMcjs.b; exports.approvePrivacyRequests = _chunkZBKJMC7Ccjs.vf; exports.assumeRole = _chunkZBKJMC7Ccjs.Fd; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunkZBKJMC7Ccjs.vc; exports.buildTranscendGraphQLClientGeneric = _chunkZBKJMC7Ccjs.uc; exports.buildXdiSyncEndpoint = _chunkHJBQCKCRcjs.g; exports.bulkRestartRequests = _chunkZBKJMC7Ccjs.Df; exports.bulkRetryEnrichers = _chunkZBKJMC7Ccjs.Ff; exports.cancelPrivacyRequests = _chunkZBKJMC7Ccjs.yf; exports.consentManagersToBusinessEntities = _chunkHJBQCKCRcjs.h; exports.convertToDataSubjectAllowlist = _chunkZBKJMC7Ccjs.ud; exports.convertToDataSubjectBlockList = _chunkZBKJMC7Ccjs.td; exports.createActionItemCollection = _chunkZBKJMC7Ccjs.ee; exports.createActionItems = _chunkZBKJMC7Ccjs.he; exports.createAgent = _chunkZBKJMC7Ccjs.qe; exports.createAgentFile = _chunkZBKJMC7Ccjs.ke; exports.createAgentFunction = _chunkZBKJMC7Ccjs.ne; exports.createApiKey = _chunkZBKJMC7Ccjs.Gd; exports.createBusinessEntity = _chunkZBKJMC7Ccjs.ue; exports.createCodePackage = _chunkZBKJMC7Ccjs.De; exports.createConsentToken = _chunk6Z44RBJEcjs.a; exports.createDataCategory = _chunkZBKJMC7Ccjs.Ke; exports.createDataFlows = _chunkZBKJMC7Ccjs.Oe; exports.createProcessingPurpose = _chunkZBKJMC7Ccjs.Ye; exports.createPrompt = _chunkZBKJMC7Ccjs.$e; exports.createRegexForTag = j; exports.createRepository = _chunkZBKJMC7Ccjs.Ae; exports.createSoftwareDevelopmentKit = _chunkZBKJMC7Ccjs.xe; exports.createSombraGotInstance = _chunkZBKJMC7Ccjs.wc; exports.createTranscendConsentGotInstance = _chunkZBKJMC7Ccjs.xc; exports.createVendor = _chunkZBKJMC7Ccjs.cf; exports.defineTranscendPrompts = Dm; exports.deleteApiKey = _chunkZBKJMC7Ccjs.Hd; exports.deployConsentManager = _chunkZBKJMC7Ccjs.yc; exports.description = _chunkQG4ECDFEcjs.l; exports.domainToHost = _chunkHJBQCKCRcjs.e; exports.downloadPrivacyRequestFiles = _chunkZBKJMC7Ccjs.sf; exports.enrichPrivacyRequest = _chunkGVWWTQ2Scjs.c; exports.ensureAllDataSubjectsExist = _chunkZBKJMC7Ccjs.sd; exports.extractClientError = _chunkZBKJMC7Ccjs.Af; exports.extractErrorMessage = _chunkZBKJMC7Ccjs.Pf; exports.fetchActiveSiloDiscoPlugin = _chunkZBKJMC7Ccjs.Ac; exports.fetchAllActionItems = _chunkZBKJMC7Ccjs.Bc; exports.fetchAllActions = _chunkZBKJMC7Ccjs.Cc; exports.fetchAllAgentFiles = _chunkZBKJMC7Ccjs.Dc; exports.fetchAllAgentFunctions = _chunkZBKJMC7Ccjs.Ec; exports.fetchAllAgents = _chunkZBKJMC7Ccjs.Fc; exports.fetchAllApiKeys = _chunkZBKJMC7Ccjs.nd; exports.fetchAllAssessmentTemplates = _chunkZBKJMC7Ccjs.Hc; exports.fetchAllAssessments = _chunkZBKJMC7Ccjs.Gc; exports.fetchAllAttributeValues = _chunkZBKJMC7Ccjs.Jc; exports.fetchAllAttributes = _chunkZBKJMC7Ccjs.Lc; exports.fetchAllBusinessEntities = _chunkZBKJMC7Ccjs.Mc; exports.fetchAllCatalogs = _chunkZBKJMC7Ccjs.pd; exports.fetchAllCookies = _chunkZBKJMC7Ccjs.Tc; exports.fetchAllDataCategories = _chunkZBKJMC7Ccjs.Uc; exports.fetchAllDataFlows = _chunkZBKJMC7Ccjs.Vc; exports.fetchAllDataPoints = _chunkZBKJMC7Ccjs.Qd; exports.fetchAllDataSilos = _chunkZBKJMC7Ccjs.Od; exports.fetchAllDataSubjects = _chunkZBKJMC7Ccjs.rd; exports.fetchAllEnrichers = _chunkZBKJMC7Ccjs.Ud; exports.fetchAllIdentifiers = _chunkZBKJMC7Ccjs.Vf; exports.fetchAllMessages = _chunkZBKJMC7Ccjs.Wc; exports.fetchAllPolicies = _chunkZBKJMC7Ccjs.Zc; exports.fetchAllPreferenceTopics = _chunkZBKJMC7Ccjs._c; exports.fetchAllPrivacyCenters = _chunkZBKJMC7Ccjs.$c; exports.fetchAllProcessingActivities = _chunkZBKJMC7Ccjs.ad; exports.fetchAllProcessingPurposes = _chunkZBKJMC7Ccjs.bd; exports.fetchAllPromptGroups = _chunkZBKJMC7Ccjs.vd; exports.fetchAllPromptPartials = _chunkZBKJMC7Ccjs.wd; exports.fetchAllPromptThreads = _chunkZBKJMC7Ccjs.zd; exports.fetchAllPrompts = _chunkZBKJMC7Ccjs.xd; exports.fetchAllPurposes = _chunkZBKJMC7Ccjs.cd; exports.fetchAllPurposesAndPreferences = _chunkZBKJMC7Ccjs.dd; exports.fetchAllRequestAttributeKeys = _chunkZBKJMC7Ccjs.Ic; exports.fetchAllRequestEnrichers = _chunkZBKJMC7Ccjs.ed; exports.fetchAllRequestIdentifierMetadata = _chunkZBKJMC7Ccjs.fd; exports.fetchAllRequestIdentifiers = _chunkZBKJMC7Ccjs.hd; exports.fetchAllRequests = _chunkZBKJMC7Ccjs.jd; exports.fetchAllSubDataPoints = _chunkZBKJMC7Ccjs.Pd; exports.fetchAllTeams = _chunkZBKJMC7Ccjs.kd; exports.fetchAllTemplates = _chunkZBKJMC7Ccjs.Wd; exports.fetchAllUsers = _chunkZBKJMC7Ccjs.ld; exports.fetchAllVendors = _chunkZBKJMC7Ccjs.md; exports.fetchAndIndexCatalogs = _chunkZBKJMC7Ccjs.qd; exports.fetchApiKeys = _chunkZBKJMC7Ccjs.od; exports.fetchConsentManager = _chunkZBKJMC7Ccjs.Nc; exports.fetchConsentManagerAnalyticsData = _chunkZBKJMC7Ccjs.Rc; exports.fetchConsentManagerExperiences = _chunkZBKJMC7Ccjs.Pc; exports.fetchConsentManagerId = _chunkZBKJMC7Ccjs.Oc; exports.fetchConsentManagerTheme = _chunkZBKJMC7Ccjs.Sc; exports.fetchConsentPreferences = _chunkHJBQCKCRcjs.j; exports.fetchEnrichedDataSilos = _chunkZBKJMC7Ccjs.Rd; exports.fetchIdentifiersAndCreateMissing = _chunkZBKJMC7Ccjs.Wf; exports.fetchPartitions = _chunkZBKJMC7Ccjs.Yd; exports.fetchPrivacyCenterId = _chunkZBKJMC7Ccjs.Yc; exports.fetchPrivacyCenterUrl = _chunkZBKJMC7Ccjs.Xc; exports.fetchPromptsWithVariables = _chunkZBKJMC7Ccjs.yd; exports.fetchRequestDataSilo = _chunkZBKJMC7Ccjs.Bd; exports.fetchRequestDataSiloActiveCount = _chunkZBKJMC7Ccjs.Cd; exports.fetchRequestDataSilos = _chunkZBKJMC7Ccjs.Ad; exports.fetchRequestFilesForRequest = _chunkZBKJMC7Ccjs.Dd; exports.filterNullishValuesFromObject = Bm; exports.filterRows = _chunkZBKJMC7Ccjs.sc; exports.fuzzyMatchColumns = _chunkZBKJMC7Ccjs.lc; exports.fuzzySearch = _chunkZBKJMC7Ccjs.kc; exports.generateCrossAccountApiKeys = _chunkYREFLYHMcjs.a; exports.getErrorStatus = _chunkZBKJMC7Ccjs.Of; exports.getFileMetadataForPrivacyRequests = _chunkZBKJMC7Ccjs.qf; exports.getGitFilesThatChanged = jm; exports.getUniqueValuesForColumn = _chunkZBKJMC7Ccjs.rc; exports.inquirerAutoComplete = _chunkZBKJMC7Ccjs.Mf; exports.inquirerConfirmBoolean = _chunkZBKJMC7Ccjs.Kf; exports.inquirerConfirmText = _chunkZBKJMC7Ccjs.Lf; exports.limitRecords = _chunkZBKJMC7Ccjs.Tf; exports.listDirectories = _chunkYREFLYHMcjs.d; exports.listFiles = _chunkYREFLYHMcjs.c; exports.loginUser = _chunkZBKJMC7Ccjs.Ed; exports.makeGraphQLRequest = _chunkZBKJMC7Ccjs.Uf; exports.mapColumnsToAttributes = _chunkZBKJMC7Ccjs.zf; exports.mapColumnsToIdentifiers = _chunkZBKJMC7Ccjs.xf; exports.mapCsvColumnsToApi = _chunkZBKJMC7Ccjs.hf; exports.mapCsvRowsToRequestInputs = _chunkZBKJMC7Ccjs.mf; exports.mapEnumValues = _chunkZBKJMC7Ccjs.mc; exports.mapRequestEnumValues = _chunkZBKJMC7Ccjs.if; exports.markCronIdentifierCompleted = _chunkLQHB5EIWcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkLQHB5EIWcjs.f; exports.markSilentPrivacyRequests = _chunkZBKJMC7Ccjs.gf; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkQG4ECDFEcjs.n; exports.normalizeIdentifierValue = _chunkZBKJMC7Ccjs.lf; exports.notifyPrivacyRequestsAdditionalTime = _chunkZBKJMC7Ccjs.wf; exports.parseAssessmentDisplayLogic = _chunkZBKJMC7Ccjs.Ld; exports.parseAssessmentRiskLogic = _chunkZBKJMC7Ccjs.Nd; exports.parseAttributesFromString = _chunkZBKJMC7Ccjs.pc; exports.parseFilePath = _chunkLR3CPNDMcjs.d; exports.parseVariablesFromString = _chunkZBKJMC7Ccjs.Nf; exports.pullAllDatapoints = _chunk4ZN6PNJEcjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkLQHB5EIWcjs.g; exports.pullConsentManagerMetrics = _chunkHJBQCKCRcjs.d; exports.pullCronPageOfIdentifiers = _chunkLQHB5EIWcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkGVWWTQ2Scjs.a; exports.pullPrivacyRequests = _chunkZBKJMC7Ccjs.Hf; exports.pullTranscendConfiguration = _chunkZBKJMC7Ccjs.$d; exports.pullUnstructuredSubDataPointRecommendations = _chunk4ZN6PNJEcjs.b; exports.pushCronIdentifiersFromCsv = _chunkLQHB5EIWcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkGVWWTQ2Scjs.d; exports.readCsv = _chunkZBKJMC7Ccjs.qc; exports.readTranscendYaml = _chunkSW5CIF5Dcjs.d; exports.removeLinks = Sm; exports.removeUnverifiedRequestIdentifiers = _chunkZBKJMC7Ccjs.Jf; exports.replaceVariablesInYaml = _chunkSW5CIF5Dcjs.c; exports.reportPromptRun = _chunkZBKJMC7Ccjs.ae; exports.restartPrivacyRequest = _chunkZBKJMC7Ccjs.Cf; exports.retryRequestDataSilos = _chunkZBKJMC7Ccjs.Gf; exports.retryRequestEnricher = _chunkZBKJMC7Ccjs.be; exports.retrySamePromise = _chunkZBKJMC7Ccjs.Sf; exports.setResourceAttributes = _chunkZBKJMC7Ccjs.ce; exports.skipPreflightJobs = _chunkZBKJMC7Ccjs.Ef; exports.skipRequestDataSilos = _chunkZBKJMC7Ccjs.If; exports.sleepPromise = _chunkZBKJMC7Ccjs.Qf; exports.splitCsvToList = _chunkZBKJMC7Ccjs.nc; exports.splitInHalf = _chunkZBKJMC7Ccjs.Rf; exports.streamPrivacyRequestFiles = _chunkZBKJMC7Ccjs.rf; exports.submitPrivacyRequest = _chunkZBKJMC7Ccjs.uf; exports.syncAction = _chunkZBKJMC7Ccjs.de; exports.syncActionItemCollections = _chunkZBKJMC7Ccjs.ge; exports.syncActionItems = _chunkZBKJMC7Ccjs.je; exports.syncAgentFiles = _chunkZBKJMC7Ccjs.me; exports.syncAgentFunctions = _chunkZBKJMC7Ccjs.pe; exports.syncAgents = _chunkZBKJMC7Ccjs.se; exports.syncAttribute = _chunkZBKJMC7Ccjs.te; exports.syncBusinessEntities = _chunkZBKJMC7Ccjs.we; exports.syncCodePackages = _chunkZBKJMC7Ccjs.Fe; exports.syncConfigurationToTranscend = _chunkZBKJMC7Ccjs.Xf; exports.syncConsentManager = _chunkZBKJMC7Ccjs.He; exports.syncConsentManagerExperiences = _chunkZBKJMC7Ccjs.Ge; exports.syncCookies = _chunkZBKJMC7Ccjs.Je; exports.syncDataCategories = _chunkZBKJMC7Ccjs.Me; exports.syncDataFlows = _chunkZBKJMC7Ccjs.Pe; exports.syncDataSiloDependencies = _chunkZBKJMC7Ccjs.Td; exports.syncDataSilos = _chunkZBKJMC7Ccjs.Sd; exports.syncDataSubject = _chunkZBKJMC7Ccjs.Qe; exports.syncEnricher = _chunkZBKJMC7Ccjs.Vd; exports.syncIdentifier = _chunkZBKJMC7Ccjs.Re; exports.syncIntlMessages = _chunkZBKJMC7Ccjs.Te; exports.syncPartitions = _chunkZBKJMC7Ccjs.Zd; exports.syncPolicies = _chunkZBKJMC7Ccjs.Ve; exports.syncPrivacyCenter = _chunkZBKJMC7Ccjs.We; exports.syncProcessingActivities = _chunkZBKJMC7Ccjs.Xe; exports.syncProcessingPurposes = _chunkZBKJMC7Ccjs._e; exports.syncPrompts = _chunkZBKJMC7Ccjs.bf; exports.syncRepositories = _chunkZBKJMC7Ccjs.Ce; exports.syncSoftwareDevelopmentKits = _chunkZBKJMC7Ccjs.ze; exports.syncTemplate = _chunkZBKJMC7Ccjs.Xd; exports.syncVendors = _chunkZBKJMC7Ccjs.ef; exports.updateActionItem = _chunkZBKJMC7Ccjs.ie; exports.updateActionItemCollection = _chunkZBKJMC7Ccjs.fe; exports.updateAgentFiles = _chunkZBKJMC7Ccjs.le; exports.updateAgentFunctions = _chunkZBKJMC7Ccjs.oe; exports.updateAgents = _chunkZBKJMC7Ccjs.re; exports.updateBusinessEntities = _chunkZBKJMC7Ccjs.ve; exports.updateCodePackages = _chunkZBKJMC7Ccjs.Ee; exports.updateConsentManagerToLatest = _chunkZBKJMC7Ccjs.zc; exports.updateConsentManagerVersionToLatest = _chunkHJBQCKCRcjs.a; exports.updateDataCategories = _chunkZBKJMC7Ccjs.Le; exports.updateDataFlows = _chunkZBKJMC7Ccjs.Ne; exports.updateIntlMessages = _chunkZBKJMC7Ccjs.Se; exports.updateOrCreateCookies = _chunkZBKJMC7Ccjs.Ie; exports.updatePolicies = _chunkZBKJMC7Ccjs.Ue; exports.updateProcessingPurposes = _chunkZBKJMC7Ccjs.Ze; exports.updatePrompts = _chunkZBKJMC7Ccjs.af; exports.updateRepositories = _chunkZBKJMC7Ccjs.Be; exports.updateSoftwareDevelopmentKits = _chunkZBKJMC7Ccjs.ye; exports.updateVendors = _chunkZBKJMC7Ccjs.df; exports.uploadConsents = _chunk6Z44RBJEcjs.f; exports.uploadCookiesFromCsv = _chunkHJBQCKCRcjs.c; exports.uploadDataFlowsFromCsv = _chunkHJBQCKCRcjs.b; exports.uploadPrivacyRequestsFromCsv = _chunkZBKJMC7Ccjs.Bf; exports.uploadSiloDiscoveryResults = _chunkZBKJMC7Ccjs.ff; exports.validateTranscendAuth = _chunkYREFLYHMcjs.b; exports.version = _chunkQG4ECDFEcjs.m; exports.writeCsv = _chunkLR3CPNDMcjs.c; exports.writeCsvSync = _chunkLR3CPNDMcjs.a; exports.writeLargeCsv = _chunkLR3CPNDMcjs.e; exports.writeTranscendYaml = _chunkSW5CIF5Dcjs.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=_chunkMFIMY5RYcjs.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 F=_child_process.execSync.call(void 0, `git show ${i}:${d}`,{encoding:"utf-8"});n[d]=F});let g=r.split("/").pop().split(".")[0];return{changedFiles:m,fileDiffs:n,repoName:g,commit:i}}exports.ACTIONS = _chunk7O5DWH3Mcjs.tb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunk7O5DWH3Mcjs.Ga; exports.ADD_SILO_DISCOVERY_RESULTS = _chunk7O5DWH3Mcjs.G; exports.ADMIN_DASH = _chunkMFIMY5RYcjs.o; exports.ADMIN_DASH_DATAPOINTS = _chunkMFIMY5RYcjs.q; exports.ADMIN_DASH_INTEGRATIONS = _chunkMFIMY5RYcjs.p; exports.AGENTS = _chunk7O5DWH3Mcjs.Gb; exports.AGENT_FILES = _chunk7O5DWH3Mcjs.Jb; exports.AGENT_FUNCTIONS = _chunk7O5DWH3Mcjs.Mb; exports.API_KEYS = _chunk7O5DWH3Mcjs.D; exports.APPROVE_PRIVACY_REQUEST = _chunk7O5DWH3Mcjs.W; exports.ASSESSMENTS = _chunk7O5DWH3Mcjs.ea; exports.ASSESSMENT_SECTION_FIELDS = _chunk7O5DWH3Mcjs.da; exports.ASSESSMENT_TEMPLATES = _chunk7O5DWH3Mcjs.ia; exports.ASSUME_ROLE = _chunk7O5DWH3Mcjs.Eb; exports.ATTRIBUTES = _chunk7O5DWH3Mcjs.Ka; exports.ATTRIBUTE_KEYS_REQUESTS = _chunk7O5DWH3Mcjs.L; exports.ATTRIBUTE_VALUES = _chunk7O5DWH3Mcjs.Oa; exports.ActionInput = _chunkQEM6S2W7cjs.G; exports.ActionItemCollectionInput = _chunkQEM6S2W7cjs.R; exports.ActionItemInput = _chunkQEM6S2W7cjs.S; exports.AgentFileInput = _chunkQEM6S2W7cjs.o; exports.AgentFunctionInput = _chunkQEM6S2W7cjs.n; exports.AgentInput = _chunkQEM6S2W7cjs.m; exports.ApiKeyInput = _chunkQEM6S2W7cjs.c; exports.AssessmentAction = _chunk7O5DWH3Mcjs.Kd; exports.AssessmentAnswerOptionInput = _chunkQEM6S2W7cjs.Y; exports.AssessmentDisplayLogicInput = _chunkQEM6S2W7cjs.V; exports.AssessmentInput = _chunkQEM6S2W7cjs.ca; exports.AssessmentNestedRule = _chunk7O5DWH3Mcjs.Jd; exports.AssessmentNestedRuleInput = _chunkQEM6S2W7cjs.U; exports.AssessmentResourceInput = _chunkQEM6S2W7cjs.ba; exports.AssessmentRetentionScheduleInput = _chunkQEM6S2W7cjs.$; exports.AssessmentRiskLogic = _chunk7O5DWH3Mcjs.Md; exports.AssessmentRule = _chunk7O5DWH3Mcjs.Id; exports.AssessmentRuleInput = _chunkQEM6S2W7cjs.T; exports.AssessmentSectionInput = _chunkQEM6S2W7cjs._; exports.AssessmentSectionQuestionInput = _chunkQEM6S2W7cjs.Z; exports.AssessmentTemplateInput = _chunkQEM6S2W7cjs.aa; exports.AttestedExtraIdentifiers = _chunk7O5DWH3Mcjs.jf; exports.AttributeInput = _chunkQEM6S2W7cjs.k; exports.AttributePreview = _chunkQEM6S2W7cjs.l; exports.AttributeValueInput = _chunkQEM6S2W7cjs.j; exports.BLANK = _chunk7O5DWH3Mcjs.cc; exports.BULK_APPLY = _chunk7O5DWH3Mcjs.bc; exports.BULK_REQUEST_FILES = _chunk7O5DWH3Mcjs.Ea; exports.BUSINESS_ENTITIES = _chunk7O5DWH3Mcjs.qb; exports.BusinessEntityInput = _chunkQEM6S2W7cjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunk7O5DWH3Mcjs.X; exports.CAN_APPLY_IN_BULK = _chunk7O5DWH3Mcjs.gc; exports.CATALOGS = _chunk7O5DWH3Mcjs.r; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunk7O5DWH3Mcjs.ua; exports.CODE_PACKAGES = _chunk7O5DWH3Mcjs.P; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunk7O5DWH3Mcjs.pb; exports.CONSENT_PARTITIONS = _chunk7O5DWH3Mcjs.Ta; exports.COOKIES = _chunk7O5DWH3Mcjs.Ya; exports.CREATE_ACTION_ITEMS = _chunk7O5DWH3Mcjs.xb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunk7O5DWH3Mcjs.Ia; exports.CREATE_AGENT = _chunk7O5DWH3Mcjs.Hb; exports.CREATE_AGENT_FILE = _chunk7O5DWH3Mcjs.Kb; exports.CREATE_AGENT_FUNCTION = _chunk7O5DWH3Mcjs.Nb; exports.CREATE_API_KEY = _chunk7O5DWH3Mcjs.E; exports.CREATE_ATTRIBUTE = _chunk7O5DWH3Mcjs.Pa; exports.CREATE_ATTRIBUTE_VALUES = _chunk7O5DWH3Mcjs.La; exports.CREATE_BUSINESS_ENTITY = _chunk7O5DWH3Mcjs.rb; exports.CREATE_CODE_PACKAGE = _chunk7O5DWH3Mcjs.R; exports.CREATE_CONSENT_EXPERIENCE = _chunk7O5DWH3Mcjs.nb; exports.CREATE_CONSENT_MANAGER = _chunk7O5DWH3Mcjs.ab; exports.CREATE_CONSENT_PARTITION = _chunk7O5DWH3Mcjs.ob; exports.CREATE_DATA_FLOWS = _chunk7O5DWH3Mcjs.Ua; exports.CREATE_DATA_SILOS = _chunk7O5DWH3Mcjs.m; exports.CREATE_DATA_SUBJECT = _chunk7O5DWH3Mcjs.x; exports.CREATE_DATA_SUB_CATEGORY = _chunk7O5DWH3Mcjs.Tb; exports.CREATE_ENRICHER = _chunk7O5DWH3Mcjs.p; exports.CREATE_IDENTIFIER = _chunk7O5DWH3Mcjs.u; exports.CREATE_PROCESSING_ACTIVITY = _chunk7O5DWH3Mcjs.Zb; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunk7O5DWH3Mcjs.Wb; exports.CREATE_PROMPT = _chunk7O5DWH3Mcjs.oa; exports.CREATE_PROMPT_GROUP = _chunk7O5DWH3Mcjs.sa; exports.CREATE_PROMPT_PARTIAL = _chunk7O5DWH3Mcjs.qa; exports.CREATE_REPOSITORY = _chunk7O5DWH3Mcjs.C; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunk7O5DWH3Mcjs.O; exports.CREATE_TEAM = _chunk7O5DWH3Mcjs.ya; exports.CREATE_TEMPLATE = _chunk7O5DWH3Mcjs.J; exports.CREATE_VENDOR = _chunk7O5DWH3Mcjs.Qb; exports.CachedFileState = _chunk7O5DWH3Mcjs.hc; exports.CachedRequestState = _chunk7O5DWH3Mcjs.jc; exports.CodePackageInput = _chunkQEM6S2W7cjs.D; exports.CodePackageSdk = _chunkQEM6S2W7cjs.C; exports.ColumnName = _chunk7O5DWH3Mcjs.ec; exports.ConsentManageExperienceInput = _chunkQEM6S2W7cjs.K; exports.ConsentManagerInput = _chunkQEM6S2W7cjs.M; exports.ConsentManagerMetricBin = _chunk7O5DWH3Mcjs.Qc; exports.ConsentManagerServiceMetadata = _chunkQEM6S2W7cjs.ka; exports.ConsentPreferenceResponse = _chunkDCBE53LGcjs.i; exports.ConsentPreferenceTopic = _chunkQEM6S2W7cjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkQEM6S2W7cjs.da; exports.ConsentPurpose = _chunkQEM6S2W7cjs.fa; exports.CookieCsvInput = _chunkQEM6S2W7cjs.ja; exports.CookieInput = _chunkQEM6S2W7cjs.J; exports.CronIdentifier = _chunkKU3UCRAFcjs.a; exports.CronIdentifierPush = _chunkKU3UCRAFcjs.c; exports.DATAPOINT_EXPORT = _chunk7O5DWH3Mcjs.g; exports.DATA_FLOWS = _chunk7O5DWH3Mcjs.Xa; exports.DATA_POINTS = _chunk7O5DWH3Mcjs.a; exports.DATA_POINT_COUNT = _chunk7O5DWH3Mcjs.b; exports.DATA_SILOS = _chunk7O5DWH3Mcjs.i; exports.DATA_SILOS_ENRICHED = _chunk7O5DWH3Mcjs.k; exports.DATA_SILO_EXPORT = _chunk7O5DWH3Mcjs.j; exports.DATA_SUBJECTS = _chunk7O5DWH3Mcjs.w; exports.DATA_SUB_CATEGORIES = _chunk7O5DWH3Mcjs.Sb; exports.DEFAULT_TRANSCEND_API = _chunkMFIMY5RYcjs.r; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkMFIMY5RYcjs.s; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunk7O5DWH3Mcjs._d; exports.DELETE_API_KEY = _chunk7O5DWH3Mcjs.F; exports.DELETE_ATTRIBUTE_VALUE = _chunk7O5DWH3Mcjs.Na; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunk7O5DWH3Mcjs.zb; exports.DEPLOY_CONSENT_MANAGER = _chunk7O5DWH3Mcjs.db; exports.DETERMINE_LOGIN_METHOD = _chunk7O5DWH3Mcjs.Cb; exports.DataCategoryGuessInput = _chunkQEM6S2W7cjs.h; exports.DataCategoryInput = _chunkQEM6S2W7cjs.q; exports.DataCategoryPreviewInput = _chunkQEM6S2W7cjs.g; exports.DataCategoryRecommendationInput = _chunkQEM6S2W7cjs.i; exports.DataFlowCsvInput = _chunkQEM6S2W7cjs.ia; exports.DataFlowInput = _chunkQEM6S2W7cjs.I; exports.DataSiloInput = _chunkQEM6S2W7cjs.Q; exports.DataSubjectInput = _chunkQEM6S2W7cjs.F; exports.DatapointInput = _chunkQEM6S2W7cjs.w; exports.ENABLED_PLUGINS = _chunk7O5DWH3Mcjs.H; exports.ENRICHERS = _chunk7O5DWH3Mcjs.n; exports.ENTRY_COUNT = _chunk7O5DWH3Mcjs.h; exports.EXPERIENCES = _chunk7O5DWH3Mcjs.Sa; exports.EnrichPrivacyRequest = _chunkNAGRUVXKcjs.b; exports.EnricherInput = _chunkQEM6S2W7cjs.e; exports.FETCH_CONSENT_MANAGER = _chunk7O5DWH3Mcjs._a; exports.FETCH_CONSENT_MANAGER_ID = _chunk7O5DWH3Mcjs.Za; exports.FETCH_CONSENT_MANAGER_THEME = _chunk7O5DWH3Mcjs.$a; exports.FETCH_PRIVACY_CENTER_ID = _chunk7O5DWH3Mcjs.yb; exports.FieldInput = _chunkQEM6S2W7cjs.v; exports.GLOBAL_ACTION_ITEMS = _chunk7O5DWH3Mcjs.vb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunk7O5DWH3Mcjs.Ha; exports.IDENTIFIERS = _chunk7O5DWH3Mcjs.s; exports.IDENTIFIER_BLOCK_LIST = _chunk7O5DWH3Mcjs.dc; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunk7O5DWH3Mcjs.fa; exports.INITIALIZER = _chunk7O5DWH3Mcjs.o; exports.IP_ADDRESS_REGEX = _chunkDCBE53LGcjs.f; exports.IS_REQUIRED = _chunk7O5DWH3Mcjs.fc; exports.IdentifierInput = _chunkQEM6S2W7cjs.H; exports.ImportOnetrustAssessmentsInput = _chunkQEM6S2W7cjs.ra; exports.IntlMessage = _chunk7O5DWH3Mcjs.nf; exports.IntlMessageInput = _chunkQEM6S2W7cjs.P; exports.LARGE_LANGUAGE_MODELS = _chunk7O5DWH3Mcjs.Fb; exports.LOGIN = _chunk7O5DWH3Mcjs.Db; exports.MESSAGES = _chunk7O5DWH3Mcjs._; exports.NEW_IDENTIFIER_TYPES = _chunk7O5DWH3Mcjs.t; exports.NONE = _chunk7O5DWH3Mcjs.ac; exports.NOTIFY_ADDITIONAL_TIME = _chunk7O5DWH3Mcjs.Z; exports.ORGANIZATION = _chunk7O5DWH3Mcjs.K; exports.OneTrustFileFormat = _chunkQ7I37FJVcjs.a; exports.OneTrustPullResource = _chunkQ7I37FJVcjs.b; exports.OneTrustPullSource = _chunkQ7I37FJVcjs.c; exports.OpenAIEnabledRoute = _chunkQEM6S2W7cjs.ma; exports.OpenAIEnabledRoutes = _chunkQEM6S2W7cjs.na; exports.OpenAIIntegration = _chunkQEM6S2W7cjs.oa; exports.OpenAIRouteName = _chunkQ7I37FJVcjs.f; exports.POLICIES = _chunk7O5DWH3Mcjs.T; exports.PREFERENCE_TOPICS = _chunk7O5DWH3Mcjs.ha; exports.PRIVACY_CENTER = _chunk7O5DWH3Mcjs.Ab; exports.PROCESSING_ACTIVITIES = _chunk7O5DWH3Mcjs.Yb; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunk7O5DWH3Mcjs.Vb; exports.PROMPTS = _chunk7O5DWH3Mcjs.ja; exports.PROMPTS_WITH_VARIABLES = _chunk7O5DWH3Mcjs.ma; exports.PROMPT_GROUPS = _chunk7O5DWH3Mcjs.la; exports.PROMPT_PARTIALS = _chunk7O5DWH3Mcjs.ka; exports.PROMPT_THREADS = _chunk7O5DWH3Mcjs.S; exports.PURPOSES = _chunk7O5DWH3Mcjs.ga; exports.ParsedAttributeInput = _chunk7O5DWH3Mcjs.oc; exports.PartitionInput = _chunkQEM6S2W7cjs.L; exports.PathfinderPolicy = _chunkQEM6S2W7cjs.pa; exports.PathfinderPolicyName = _chunkQ7I37FJVcjs.e; exports.PathfinderPolicyNameC = _chunkQEM6S2W7cjs.la; exports.PathfinderPromptRunMetadata = _chunkQEM6S2W7cjs.qa; exports.PolicyInput = _chunkQEM6S2W7cjs.O; exports.PrivacyCenterInput = _chunkQEM6S2W7cjs.N; exports.PrivacyRequest = _chunk7O5DWH3Mcjs.id; exports.PrivacyRequestInput = _chunk7O5DWH3Mcjs.kf; exports.PrivacyRequestResponse = _chunk7O5DWH3Mcjs.tf; exports.ProcessingActivityInput = _chunkQEM6S2W7cjs.A; exports.ProcessingPurposeInput = _chunkQEM6S2W7cjs.r; exports.ProcessingPurposePreviewInput = _chunkQEM6S2W7cjs.f; exports.PromptAVendorEmailSettings = _chunkQEM6S2W7cjs.x; exports.PromptGroupInput = _chunkQEM6S2W7cjs.u; exports.PromptInput = _chunkQEM6S2W7cjs.s; exports.PromptPartialInput = _chunkQEM6S2W7cjs.t; exports.PurposeMap = _chunkJZEDU4GZcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunk7O5DWH3Mcjs.wa; exports.REMOVE_REQUEST_IDENTIFIERS = _chunk7O5DWH3Mcjs.Aa; exports.REPORT_PROMPT_RUN = _chunk7O5DWH3Mcjs.Fa; exports.REPOSITORIES = _chunk7O5DWH3Mcjs.A; exports.REQUESTS = _chunk7O5DWH3Mcjs.V; exports.REQUEST_DATA_SILOS = _chunk7O5DWH3Mcjs.ta; exports.REQUEST_ENRICHERS = _chunk7O5DWH3Mcjs.aa; exports.REQUEST_FILES = _chunk7O5DWH3Mcjs.Da; exports.REQUEST_IDENTIFIERS = _chunk7O5DWH3Mcjs.Ba; exports.RETRYABLE_BATCH_STATUSES = _chunkMFIMY5RYcjs.y; exports.RETRY_REQUEST_DATA_SILO = _chunk7O5DWH3Mcjs.va; exports.RETRY_REQUEST_ENRICHER = _chunk7O5DWH3Mcjs.ba; exports.RateCounter = _chunk7O5DWH3Mcjs.Uf; exports.RegionInput = _chunkQEM6S2W7cjs.z; exports.RepositoryInput = _chunkQEM6S2W7cjs.E; exports.RequestFileMetadata = _chunk7O5DWH3Mcjs.of; exports.RequestFileMetadataResponse = _chunk7O5DWH3Mcjs.pf; exports.RequestIdentifiersResponse = _chunk7O5DWH3Mcjs.gd; exports.RiskAssignmentInput = _chunkQEM6S2W7cjs.W; exports.RiskLogicInput = _chunkQEM6S2W7cjs.X; exports.SCOPES_BY_TITLE = _chunkMFIMY5RYcjs.w; exports.SCOPE_TITLES = _chunkMFIMY5RYcjs.x; exports.SET_RESOURCE_ATTRIBUTES = _chunk7O5DWH3Mcjs.Ra; exports.SKIP_REQUEST_ENRICHER = _chunk7O5DWH3Mcjs.ca; exports.SOFTWARE_DEVELOPMENT_KITS = _chunk7O5DWH3Mcjs.M; exports.SOMBRA_VERSION = _chunk7O5DWH3Mcjs.$b; exports.SUB_DATA_POINTS = _chunk7O5DWH3Mcjs.c; exports.SUB_DATA_POINTS_COUNT = _chunk7O5DWH3Mcjs.d; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunk7O5DWH3Mcjs.e; exports.SYNC_ATTRIBUTE_TYPES = _chunk7O5DWH3Mcjs.Kc; exports.SoftwareDevelopmentKitInput = _chunkQEM6S2W7cjs.B; exports.StoredApiKey = _chunkQEM6S2W7cjs.ha; exports.SuccessfulRequest = _chunk7O5DWH3Mcjs.ic; exports.TEAMS = _chunk7O5DWH3Mcjs.xa; exports.TEMPLATES = _chunk7O5DWH3Mcjs.I; exports.TOGGLE_CONSENT_PRECEDENCE = _chunk7O5DWH3Mcjs.kb; exports.TOGGLE_DATA_SUBJECT = _chunk7O5DWH3Mcjs.z; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunk7O5DWH3Mcjs.jb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunk7O5DWH3Mcjs.ib; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunk7O5DWH3Mcjs.hb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkMFIMY5RYcjs.u; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkMFIMY5RYcjs.t; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkMFIMY5RYcjs.v; exports.TeamInput = _chunkQEM6S2W7cjs.d; exports.TemplateInput = _chunkQEM6S2W7cjs.a; exports.TranscendInput = _chunkQEM6S2W7cjs.ga; exports.TranscendPromptManager = B; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunk7O5DWH3Mcjs.ub; exports.UPDATE_ACTION_ITEMS = _chunk7O5DWH3Mcjs.wb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunk7O5DWH3Mcjs.Ja; exports.UPDATE_AGENTS = _chunk7O5DWH3Mcjs.Ib; exports.UPDATE_AGENT_FILES = _chunk7O5DWH3Mcjs.Lb; exports.UPDATE_AGENT_FUNCTIONS = _chunk7O5DWH3Mcjs.Ob; exports.UPDATE_ATTRIBUTE = _chunk7O5DWH3Mcjs.Qa; exports.UPDATE_ATTRIBUTE_VALUES = _chunk7O5DWH3Mcjs.Ma; exports.UPDATE_BUSINESS_ENTITIES = _chunk7O5DWH3Mcjs.sb; exports.UPDATE_CODE_PACKAGES = _chunk7O5DWH3Mcjs.Q; exports.UPDATE_CONSENT_EXPERIENCE = _chunk7O5DWH3Mcjs.mb; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunk7O5DWH3Mcjs.eb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunk7O5DWH3Mcjs.fb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunk7O5DWH3Mcjs.lb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunk7O5DWH3Mcjs.cb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunk7O5DWH3Mcjs.bb; exports.UPDATE_DATA_FLOWS = _chunk7O5DWH3Mcjs.Va; exports.UPDATE_DATA_SILOS = _chunk7O5DWH3Mcjs.l; exports.UPDATE_DATA_SUBJECT = _chunk7O5DWH3Mcjs.y; exports.UPDATE_DATA_SUB_CATEGORIES = _chunk7O5DWH3Mcjs.Ub; exports.UPDATE_ENRICHER = _chunk7O5DWH3Mcjs.q; exports.UPDATE_IDENTIFIER = _chunk7O5DWH3Mcjs.v; exports.UPDATE_INTL_MESSAGES = _chunk7O5DWH3Mcjs.$; exports.UPDATE_LOAD_OPTIONS = _chunk7O5DWH3Mcjs.gb; exports.UPDATE_OR_CREATE_COOKIES = _chunk7O5DWH3Mcjs.Wa; exports.UPDATE_OR_CREATE_DATA_POINT = _chunk7O5DWH3Mcjs.f; exports.UPDATE_POLICIES = _chunk7O5DWH3Mcjs.U; exports.UPDATE_PRIVACY_CENTER = _chunk7O5DWH3Mcjs.Bb; exports.UPDATE_PRIVACY_REQUEST = _chunk7O5DWH3Mcjs.Y; exports.UPDATE_PROCESSING_ACTIVITIES = _chunk7O5DWH3Mcjs._b; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunk7O5DWH3Mcjs.Xb; exports.UPDATE_PROMPTS = _chunk7O5DWH3Mcjs.na; exports.UPDATE_PROMPT_GROUPS = _chunk7O5DWH3Mcjs.ra; exports.UPDATE_PROMPT_PARTIALS = _chunk7O5DWH3Mcjs.pa; exports.UPDATE_REPOSITORIES = _chunk7O5DWH3Mcjs.B; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunk7O5DWH3Mcjs.N; exports.UPDATE_TEAM = _chunk7O5DWH3Mcjs.za; exports.UPDATE_VENDORS = _chunk7O5DWH3Mcjs.Rb; exports.USERS = _chunk7O5DWH3Mcjs.Ca; exports.USP_STRING_REGEX = _chunkJZEDU4GZcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkSW5CIF5Dcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkSW5CIF5Dcjs.a; exports.VENDORS = _chunk7O5DWH3Mcjs.Pb; exports.VendorInput = _chunkQEM6S2W7cjs.p; exports.WebhookHeader = _chunkQEM6S2W7cjs.b; exports.addMessagesToPromptRun = _chunk7O5DWH3Mcjs.tc; exports.appendCsvSync = _chunkLR3CPNDMcjs.b; exports.approvePrivacyRequests = _chunk7O5DWH3Mcjs.vf; exports.assumeRole = _chunk7O5DWH3Mcjs.Fd; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunk7O5DWH3Mcjs.vc; exports.buildTranscendGraphQLClientGeneric = _chunk7O5DWH3Mcjs.uc; exports.buildXdiSyncEndpoint = _chunkDCBE53LGcjs.g; exports.bulkRestartRequests = _chunk7O5DWH3Mcjs.Df; exports.bulkRetryEnrichers = _chunk7O5DWH3Mcjs.Ff; exports.cancelPrivacyRequests = _chunk7O5DWH3Mcjs.yf; exports.consentManagersToBusinessEntities = _chunkDCBE53LGcjs.h; exports.convertToDataSubjectAllowlist = _chunk7O5DWH3Mcjs.ud; exports.convertToDataSubjectBlockList = _chunk7O5DWH3Mcjs.td; exports.createActionItemCollection = _chunk7O5DWH3Mcjs.ee; exports.createActionItems = _chunk7O5DWH3Mcjs.he; exports.createAgent = _chunk7O5DWH3Mcjs.qe; exports.createAgentFile = _chunk7O5DWH3Mcjs.ke; exports.createAgentFunction = _chunk7O5DWH3Mcjs.ne; exports.createApiKey = _chunk7O5DWH3Mcjs.Gd; exports.createBusinessEntity = _chunk7O5DWH3Mcjs.ue; exports.createCodePackage = _chunk7O5DWH3Mcjs.De; exports.createConsentToken = _chunkJZEDU4GZcjs.a; exports.createDataCategory = _chunk7O5DWH3Mcjs.Ke; exports.createDataFlows = _chunk7O5DWH3Mcjs.Oe; exports.createProcessingPurpose = _chunk7O5DWH3Mcjs.Ye; exports.createPrompt = _chunk7O5DWH3Mcjs.$e; exports.createRegexForTag = j; exports.createRepository = _chunk7O5DWH3Mcjs.Ae; exports.createSoftwareDevelopmentKit = _chunk7O5DWH3Mcjs.xe; exports.createSombraGotInstance = _chunk7O5DWH3Mcjs.wc; exports.createTranscendConsentGotInstance = _chunk7O5DWH3Mcjs.xc; exports.createVendor = _chunk7O5DWH3Mcjs.cf; exports.defineTranscendPrompts = Sm; exports.deleteApiKey = _chunk7O5DWH3Mcjs.Hd; exports.deployConsentManager = _chunk7O5DWH3Mcjs.yc; exports.description = _chunkMFIMY5RYcjs.l; exports.domainToHost = _chunkDCBE53LGcjs.e; exports.downloadPrivacyRequestFiles = _chunk7O5DWH3Mcjs.sf; exports.enrichPrivacyRequest = _chunkNAGRUVXKcjs.c; exports.ensureAllDataSubjectsExist = _chunk7O5DWH3Mcjs.sd; exports.extractClientError = _chunk7O5DWH3Mcjs.Af; exports.extractErrorMessage = _chunk7O5DWH3Mcjs.Pf; exports.fetchActiveSiloDiscoPlugin = _chunk7O5DWH3Mcjs.Ac; exports.fetchAllActionItems = _chunk7O5DWH3Mcjs.Bc; exports.fetchAllActions = _chunk7O5DWH3Mcjs.Cc; exports.fetchAllAgentFiles = _chunk7O5DWH3Mcjs.Dc; exports.fetchAllAgentFunctions = _chunk7O5DWH3Mcjs.Ec; exports.fetchAllAgents = _chunk7O5DWH3Mcjs.Fc; exports.fetchAllApiKeys = _chunk7O5DWH3Mcjs.nd; exports.fetchAllAssessmentTemplates = _chunk7O5DWH3Mcjs.Hc; exports.fetchAllAssessments = _chunk7O5DWH3Mcjs.Gc; exports.fetchAllAttributeValues = _chunk7O5DWH3Mcjs.Jc; exports.fetchAllAttributes = _chunk7O5DWH3Mcjs.Lc; exports.fetchAllBusinessEntities = _chunk7O5DWH3Mcjs.Mc; exports.fetchAllCatalogs = _chunk7O5DWH3Mcjs.pd; exports.fetchAllCookies = _chunk7O5DWH3Mcjs.Tc; exports.fetchAllDataCategories = _chunk7O5DWH3Mcjs.Uc; exports.fetchAllDataFlows = _chunk7O5DWH3Mcjs.Vc; exports.fetchAllDataPoints = _chunk7O5DWH3Mcjs.Qd; exports.fetchAllDataSilos = _chunk7O5DWH3Mcjs.Od; exports.fetchAllDataSubjects = _chunk7O5DWH3Mcjs.rd; exports.fetchAllEnrichers = _chunk7O5DWH3Mcjs.Ud; exports.fetchAllIdentifiers = _chunk7O5DWH3Mcjs.Xf; exports.fetchAllMessages = _chunk7O5DWH3Mcjs.Wc; exports.fetchAllPolicies = _chunk7O5DWH3Mcjs.Zc; exports.fetchAllPreferenceTopics = _chunk7O5DWH3Mcjs._c; exports.fetchAllPrivacyCenters = _chunk7O5DWH3Mcjs.$c; exports.fetchAllProcessingActivities = _chunk7O5DWH3Mcjs.ad; exports.fetchAllProcessingPurposes = _chunk7O5DWH3Mcjs.bd; exports.fetchAllPromptGroups = _chunk7O5DWH3Mcjs.vd; exports.fetchAllPromptPartials = _chunk7O5DWH3Mcjs.wd; exports.fetchAllPromptThreads = _chunk7O5DWH3Mcjs.zd; exports.fetchAllPrompts = _chunk7O5DWH3Mcjs.xd; exports.fetchAllPurposes = _chunk7O5DWH3Mcjs.cd; exports.fetchAllPurposesAndPreferences = _chunk7O5DWH3Mcjs.dd; exports.fetchAllRequestAttributeKeys = _chunk7O5DWH3Mcjs.Ic; exports.fetchAllRequestEnrichers = _chunk7O5DWH3Mcjs.ed; exports.fetchAllRequestIdentifierMetadata = _chunk7O5DWH3Mcjs.fd; exports.fetchAllRequestIdentifiers = _chunk7O5DWH3Mcjs.hd; exports.fetchAllRequests = _chunk7O5DWH3Mcjs.jd; exports.fetchAllSubDataPoints = _chunk7O5DWH3Mcjs.Pd; exports.fetchAllTeams = _chunk7O5DWH3Mcjs.kd; exports.fetchAllTemplates = _chunk7O5DWH3Mcjs.Wd; exports.fetchAllUsers = _chunk7O5DWH3Mcjs.ld; exports.fetchAllVendors = _chunk7O5DWH3Mcjs.md; exports.fetchAndIndexCatalogs = _chunk7O5DWH3Mcjs.qd; exports.fetchApiKeys = _chunk7O5DWH3Mcjs.od; exports.fetchConsentManager = _chunk7O5DWH3Mcjs.Nc; exports.fetchConsentManagerAnalyticsData = _chunk7O5DWH3Mcjs.Rc; exports.fetchConsentManagerExperiences = _chunk7O5DWH3Mcjs.Pc; exports.fetchConsentManagerId = _chunk7O5DWH3Mcjs.Oc; exports.fetchConsentManagerTheme = _chunk7O5DWH3Mcjs.Sc; exports.fetchConsentPreferences = _chunkDCBE53LGcjs.j; exports.fetchEnrichedDataSilos = _chunk7O5DWH3Mcjs.Rd; exports.fetchIdentifiersAndCreateMissing = _chunk7O5DWH3Mcjs.Yf; exports.fetchPartitions = _chunk7O5DWH3Mcjs.Yd; exports.fetchPrivacyCenterId = _chunk7O5DWH3Mcjs.Yc; exports.fetchPrivacyCenterUrl = _chunk7O5DWH3Mcjs.Xc; exports.fetchPromptsWithVariables = _chunk7O5DWH3Mcjs.yd; exports.fetchRequestDataSilo = _chunk7O5DWH3Mcjs.Bd; exports.fetchRequestDataSiloActiveCount = _chunk7O5DWH3Mcjs.Cd; exports.fetchRequestDataSilos = _chunk7O5DWH3Mcjs.Ad; exports.fetchRequestFilesForRequest = _chunk7O5DWH3Mcjs.Dd; exports.filterNullishValuesFromObject = Qm; exports.filterRows = _chunk7O5DWH3Mcjs.sc; exports.fuzzyMatchColumns = _chunk7O5DWH3Mcjs.lc; exports.fuzzySearch = _chunk7O5DWH3Mcjs.kc; exports.generateCrossAccountApiKeys = _chunkOKLX7XKWcjs.a; exports.getErrorStatus = _chunk7O5DWH3Mcjs.Of; exports.getFileMetadataForPrivacyRequests = _chunk7O5DWH3Mcjs.qf; exports.getGitFilesThatChanged = Vm; exports.getUniqueValuesForColumn = _chunk7O5DWH3Mcjs.rc; exports.inquirerAutoComplete = _chunk7O5DWH3Mcjs.Mf; exports.inquirerConfirmBoolean = _chunk7O5DWH3Mcjs.Kf; exports.inquirerConfirmText = _chunk7O5DWH3Mcjs.Lf; exports.limitRecords = _chunk7O5DWH3Mcjs.Tf; exports.listDirectories = _chunkOKLX7XKWcjs.d; exports.listFiles = _chunkOKLX7XKWcjs.c; exports.loginUser = _chunk7O5DWH3Mcjs.Ed; exports.makeGraphQLRequest = _chunk7O5DWH3Mcjs.Wf; exports.mapColumnsToAttributes = _chunk7O5DWH3Mcjs.zf; exports.mapColumnsToIdentifiers = _chunk7O5DWH3Mcjs.xf; exports.mapCsvColumnsToApi = _chunk7O5DWH3Mcjs.hf; exports.mapCsvRowsToRequestInputs = _chunk7O5DWH3Mcjs.mf; exports.mapEnumValues = _chunk7O5DWH3Mcjs.mc; exports.mapRequestEnumValues = _chunk7O5DWH3Mcjs.if; exports.markCronIdentifierCompleted = _chunkKU3UCRAFcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkKU3UCRAFcjs.f; exports.markSilentPrivacyRequests = _chunk7O5DWH3Mcjs.gf; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkMFIMY5RYcjs.n; exports.normalizeIdentifierValue = _chunk7O5DWH3Mcjs.lf; exports.notifyPrivacyRequestsAdditionalTime = _chunk7O5DWH3Mcjs.wf; exports.parseAssessmentDisplayLogic = _chunk7O5DWH3Mcjs.Ld; exports.parseAssessmentRiskLogic = _chunk7O5DWH3Mcjs.Nd; exports.parseAttributesFromString = _chunk7O5DWH3Mcjs.pc; exports.parseFilePath = _chunkLR3CPNDMcjs.d; exports.parseVariablesFromString = _chunk7O5DWH3Mcjs.Nf; exports.pullAllDatapoints = _chunkLPUZGMB6cjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkKU3UCRAFcjs.g; exports.pullConsentManagerMetrics = _chunkDCBE53LGcjs.d; exports.pullCronPageOfIdentifiers = _chunkKU3UCRAFcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkNAGRUVXKcjs.a; exports.pullPrivacyRequests = _chunk7O5DWH3Mcjs.Hf; exports.pullTranscendConfiguration = _chunk7O5DWH3Mcjs.$d; exports.pullUnstructuredSubDataPointRecommendations = _chunkLPUZGMB6cjs.b; exports.pushCronIdentifiersFromCsv = _chunkKU3UCRAFcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkNAGRUVXKcjs.d; exports.readCsv = _chunk7O5DWH3Mcjs.qc; exports.readSafe = _chunk7O5DWH3Mcjs.Vf; exports.readTranscendYaml = _chunkSW5CIF5Dcjs.d; exports.removeLinks = Bm; exports.removeUnverifiedRequestIdentifiers = _chunk7O5DWH3Mcjs.Jf; exports.replaceVariablesInYaml = _chunkSW5CIF5Dcjs.c; exports.reportPromptRun = _chunk7O5DWH3Mcjs.ae; exports.restartPrivacyRequest = _chunk7O5DWH3Mcjs.Cf; exports.retryRequestDataSilos = _chunk7O5DWH3Mcjs.Gf; exports.retryRequestEnricher = _chunk7O5DWH3Mcjs.be; exports.retrySamePromise = _chunk7O5DWH3Mcjs.Sf; exports.setResourceAttributes = _chunk7O5DWH3Mcjs.ce; exports.skipPreflightJobs = _chunk7O5DWH3Mcjs.Ef; exports.skipRequestDataSilos = _chunk7O5DWH3Mcjs.If; exports.sleepPromise = _chunk7O5DWH3Mcjs.Qf; exports.splitCsvToList = _chunk7O5DWH3Mcjs.nc; exports.splitInHalf = _chunk7O5DWH3Mcjs.Rf; exports.streamPrivacyRequestFiles = _chunk7O5DWH3Mcjs.rf; exports.submitPrivacyRequest = _chunk7O5DWH3Mcjs.uf; exports.syncAction = _chunk7O5DWH3Mcjs.de; exports.syncActionItemCollections = _chunk7O5DWH3Mcjs.ge; exports.syncActionItems = _chunk7O5DWH3Mcjs.je; exports.syncAgentFiles = _chunk7O5DWH3Mcjs.me; exports.syncAgentFunctions = _chunk7O5DWH3Mcjs.pe; exports.syncAgents = _chunk7O5DWH3Mcjs.se; exports.syncAttribute = _chunk7O5DWH3Mcjs.te; exports.syncBusinessEntities = _chunk7O5DWH3Mcjs.we; exports.syncCodePackages = _chunk7O5DWH3Mcjs.Fe; exports.syncConfigurationToTranscend = _chunk7O5DWH3Mcjs.Zf; exports.syncConsentManager = _chunk7O5DWH3Mcjs.He; exports.syncConsentManagerExperiences = _chunk7O5DWH3Mcjs.Ge; exports.syncCookies = _chunk7O5DWH3Mcjs.Je; exports.syncDataCategories = _chunk7O5DWH3Mcjs.Me; exports.syncDataFlows = _chunk7O5DWH3Mcjs.Pe; exports.syncDataSiloDependencies = _chunk7O5DWH3Mcjs.Td; exports.syncDataSilos = _chunk7O5DWH3Mcjs.Sd; exports.syncDataSubject = _chunk7O5DWH3Mcjs.Qe; exports.syncEnricher = _chunk7O5DWH3Mcjs.Vd; exports.syncIdentifier = _chunk7O5DWH3Mcjs.Re; exports.syncIntlMessages = _chunk7O5DWH3Mcjs.Te; exports.syncPartitions = _chunk7O5DWH3Mcjs.Zd; exports.syncPolicies = _chunk7O5DWH3Mcjs.Ve; exports.syncPrivacyCenter = _chunk7O5DWH3Mcjs.We; exports.syncProcessingActivities = _chunk7O5DWH3Mcjs.Xe; exports.syncProcessingPurposes = _chunk7O5DWH3Mcjs._e; exports.syncPrompts = _chunk7O5DWH3Mcjs.bf; exports.syncRepositories = _chunk7O5DWH3Mcjs.Ce; exports.syncSoftwareDevelopmentKits = _chunk7O5DWH3Mcjs.ze; exports.syncTemplate = _chunk7O5DWH3Mcjs.Xd; exports.syncVendors = _chunk7O5DWH3Mcjs.ef; exports.updateActionItem = _chunk7O5DWH3Mcjs.ie; exports.updateActionItemCollection = _chunk7O5DWH3Mcjs.fe; exports.updateAgentFiles = _chunk7O5DWH3Mcjs.le; exports.updateAgentFunctions = _chunk7O5DWH3Mcjs.oe; exports.updateAgents = _chunk7O5DWH3Mcjs.re; exports.updateBusinessEntities = _chunk7O5DWH3Mcjs.ve; exports.updateCodePackages = _chunk7O5DWH3Mcjs.Ee; exports.updateConsentManagerToLatest = _chunk7O5DWH3Mcjs.zc; exports.updateConsentManagerVersionToLatest = _chunkDCBE53LGcjs.a; exports.updateDataCategories = _chunk7O5DWH3Mcjs.Le; exports.updateDataFlows = _chunk7O5DWH3Mcjs.Ne; exports.updateIntlMessages = _chunk7O5DWH3Mcjs.Se; exports.updateOrCreateCookies = _chunk7O5DWH3Mcjs.Ie; exports.updatePolicies = _chunk7O5DWH3Mcjs.Ue; exports.updateProcessingPurposes = _chunk7O5DWH3Mcjs.Ze; exports.updatePrompts = _chunk7O5DWH3Mcjs.af; exports.updateRepositories = _chunk7O5DWH3Mcjs.Be; exports.updateSoftwareDevelopmentKits = _chunk7O5DWH3Mcjs.ye; exports.updateVendors = _chunk7O5DWH3Mcjs.df; exports.uploadConsents = _chunkJZEDU4GZcjs.f; exports.uploadCookiesFromCsv = _chunkDCBE53LGcjs.c; exports.uploadDataFlowsFromCsv = _chunkDCBE53LGcjs.b; exports.uploadPrivacyRequestsFromCsv = _chunk7O5DWH3Mcjs.Bf; exports.uploadSiloDiscoveryResults = _chunk7O5DWH3Mcjs.ff; exports.validateTranscendAuth = _chunkOKLX7XKWcjs.b; exports.version = _chunkMFIMY5RYcjs.m; exports.writeCsv = _chunkLR3CPNDMcjs.c; exports.writeCsvSync = _chunkLR3CPNDMcjs.a; exports.writeLargeCsv = _chunkLR3CPNDMcjs.e; exports.writeTranscendYaml = _chunkSW5CIF5Dcjs.e;
5
5
  //# sourceMappingURL=index.cjs.map
@@ -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":"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","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';\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":"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","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';\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"]}
package/dist/index.d.cts CHANGED
@@ -143850,7 +143850,7 @@ declare function removeUnverifiedRequestIdentifiers({ requestActions, identifier
143850
143850
  }): Promise<number>;
143851
143851
 
143852
143852
  var description = "A command line interface for programmatic operations across Transcend.";
143853
- var version = "8.0.4";
143853
+ var version = "8.0.6";
143854
143854
 
143855
143855
  /**
143856
143856
  * The name of the main binary for the CLI
@@ -143893,7 +143893,7 @@ declare const SCOPE_TITLES: string[];
143893
143893
  * 502: Upstream/edge gateway error
143894
143894
  * 329: Reserved for custom infra (kept defensively)
143895
143895
  */
143896
- declare const RETRYABLE_BATCH_STATUSES: Set<429 | 502 | 329>;
143896
+ declare const RETRYABLE_BATCH_STATUSES: Set<429 | 502 | 500 | 504 | 329>;
143897
143897
 
143898
143898
  /**
143899
143899
  * Update the consent manager to latest version
@@ -144321,6 +144321,46 @@ declare function retrySamePromise<T>(op: () => Promise<T>, policy: RetryPolicy,
144321
144321
  */
144322
144322
  declare function limitRecords<T>(obj: Record<string, T>, max: number): Record<string, T | true>;
144323
144323
 
144324
+ /**
144325
+ * Tracks counts over time and calculates rates within a specified time window.
144326
+ *
144327
+ * This class maintains a rolling window of count "buckets" (timestamped values)
144328
+ * and provides methods to add new counts and compute the rate of events over a
144329
+ * configurable time window.
144330
+ *
144331
+ * Example usage:
144332
+ * ```typescript
144333
+ * const counter = new RateCounter();
144334
+ * counter.add(5); // Add 5 events
144335
+ * const rate = counter.rate(60_000); // Get rate over last 60 seconds
144336
+ * ```
144337
+ */
144338
+ declare class RateCounter {
144339
+ private buckets;
144340
+ /**
144341
+ * Adds a new count to the counter.
144342
+ *
144343
+ * @param n - The number of events to add to the counter.
144344
+ */
144345
+ add(n: number): void;
144346
+ /**
144347
+ * rate over the last `windowMs` milliseconds
144348
+ *
144349
+ * @param windowMs - The time window in milliseconds to calculate the rate over.
144350
+ * @returns The average rate of events per second over the specified time window.
144351
+ */
144352
+ rate(windowMs: number): number;
144353
+ }
144354
+
144355
+ /**
144356
+ * Safely reads the contents of a file as a UTF-8 string.
144357
+ * Returns an empty string if the path is not provided or if reading fails.
144358
+ *
144359
+ * @param p - The path to the file to read.
144360
+ * @returns The file contents as a string, or an empty string on error.
144361
+ */
144362
+ declare function readSafe(p?: string): string;
144363
+
144324
144364
  declare const CronIdentifier: t.TypeC<{
144325
144365
  /** The identifier value */
144326
144366
  identifier: t.StringC;
@@ -145087,4 +145127,4 @@ type EnrichPrivacyRequest = t.TypeOf<typeof EnrichPrivacyRequest>;
145087
145127
  */
145088
145128
  declare function enrichPrivacyRequest(sombra: Got, { id: rawId, ...rest }: EnrichPrivacyRequest, enricherId: string, index?: number): Promise<boolean>;
145089
145129
 
145090
- export { ACTIONS, ADD_MESSAGES_TO_PROMPT_RUN, ADD_SILO_DISCOVERY_RESULTS, ADMIN_DASH, ADMIN_DASH_DATAPOINTS, ADMIN_DASH_INTEGRATIONS, AGENTS, AGENT_FILES, AGENT_FUNCTIONS, type AIIntegrationC, API_KEYS, APPROVE_PRIVACY_REQUEST, ASSESSMENTS, ASSESSMENT_SECTION_FIELDS, ASSESSMENT_TEMPLATES, ASSUME_ROLE, ATTRIBUTES, ATTRIBUTE_KEYS_REQUESTS, ATTRIBUTE_VALUES, type Action, ActionInput, type ActionItem, ActionItemCollectionInput, ActionItemInput, type ActionItemRaw, type AddMessagesToPromptRunInput, type Agent, type AgentFile, type AgentFileFilterBy, AgentFileInput, type AgentFunction, AgentFunctionInput, AgentInput, type ApiKey, type ApiKeyGenerateError, ApiKeyInput, type Assessment, AssessmentAction, type AssessmentAnswer, type AssessmentAnswerOption, AssessmentAnswerOptionInput, type AssessmentComment, AssessmentDisplayLogicInput, type AssessmentGroup, AssessmentInput, AssessmentNestedRule, AssessmentNestedRuleInput, type AssessmentPreviousSubmission, type AssessmentQuestion, type AssessmentResource, AssessmentResourceInput, AssessmentRetentionScheduleInput, AssessmentRiskLogic, AssessmentRule, AssessmentRuleInput, type AssessmentSection, AssessmentSectionInput, AssessmentSectionQuestionInput, type AssessmentTemplate, AssessmentTemplateInput, AttestedExtraIdentifiers, type Attribute, AttributeInput, type AttributeKey, type AttributeNameMap, AttributePreview, type AttributeValue, AttributeValueInput, BLANK, BULK_APPLY, BULK_REQUEST_FILES, BUSINESS_ENTITIES, type BusinessEntity, BusinessEntityInput, CANCEL_PRIVACY_REQUEST, CAN_APPLY_IN_BULK, CATALOGS, CHANGE_REQUEST_DATA_SILO_STATUS, CODE_PACKAGES, CONSENT_MANAGER_ANALYTICS_DATA, CONSENT_PARTITIONS, COOKIES, CREATE_ACTION_ITEMS, CREATE_ACTION_ITEM_COLLECTION, CREATE_AGENT, CREATE_AGENT_FILE, CREATE_AGENT_FUNCTION, CREATE_API_KEY, CREATE_ATTRIBUTE, CREATE_ATTRIBUTE_VALUES, CREATE_BUSINESS_ENTITY, CREATE_CODE_PACKAGE, CREATE_CONSENT_EXPERIENCE, CREATE_CONSENT_MANAGER, CREATE_CONSENT_PARTITION, CREATE_DATA_FLOWS, CREATE_DATA_SILOS, CREATE_DATA_SUBJECT, CREATE_DATA_SUB_CATEGORY, CREATE_ENRICHER, CREATE_IDENTIFIER, CREATE_PROCESSING_ACTIVITY, CREATE_PROCESSING_PURPOSE_SUB_CATEGORY, CREATE_PROMPT, CREATE_PROMPT_GROUP, CREATE_PROMPT_PARTIAL, CREATE_REPOSITORY, CREATE_SOFTWARE_DEVELOPMENT_KIT, CREATE_TEAM, CREATE_TEMPLATE, CREATE_VENDOR, CachedFileState, CachedRequestState, type Catalog, CodePackageInput, CodePackageSdk, ColumnName, type ColumnNameMap, type ConsentExperience, ConsentManageExperienceInput, type ConsentManager, ConsentManagerInput, type ConsentManagerMetric, ConsentManagerMetricBin, ConsentManagerServiceMetadata, type ConsentManagerTheme, ConsentPreferenceResponse, ConsentPreferenceTopic, ConsentPreferenceTopicOptionValue, ConsentPurpose, type Cookie, CookieCsvInput, CookieInput, type CreatedApiKey, CronIdentifier, CronIdentifierPush, type CronIdentifierWithAction, type CsvFormattedIdentifier, DATAPOINT_EXPORT, DATA_FLOWS, DATA_POINTS, DATA_POINT_COUNT, DATA_SILOS, DATA_SILOS_ENRICHED, DATA_SILO_EXPORT, DATA_SUBJECTS, DATA_SUB_CATEGORIES, DEFAULT_TRANSCEND_API, DEFAULT_TRANSCEND_CONSENT_API, DEFAULT_TRANSCEND_PULL_RESOURCES, DELETE_API_KEY, DELETE_ATTRIBUTE_VALUE, DEPLOYED_PRIVACY_CENTER_URL, DEPLOY_CONSENT_MANAGER, DETERMINE_LOGIN_METHOD, DataCategoryGuessInput, DataCategoryInput, DataCategoryPreviewInput, DataCategoryRecommendationInput, type DataFlow, DataFlowCsvInput, DataFlowInput, type DataPointCsvPreview, type DataSilo, type DataSiloAttributeValue, type DataSiloCsvPreview, type DataSiloEnriched, DataSiloInput, type DataSubCategory, type DataSubject, DataSubjectInput, type DatapointFilterOptions, DatapointInput, ENABLED_PLUGINS, ENRICHERS, ENTRY_COUNT, EXPERIENCES, type EnabledRouteC, type EnabledRoutesC, EnrichPrivacyRequest, type Enricher, EnricherInput, type ExportedPrivacyRequest, type ExternalUser, FETCH_CONSENT_MANAGER, FETCH_CONSENT_MANAGER_ID, FETCH_CONSENT_MANAGER_THEME, FETCH_PRIVACY_CENTER_ID, FieldInput, GLOBAL_ACTION_ITEMS, GLOBAL_ACTION_ITEM_COLLECTIONS, type GetPromptParamType, type GetPromptResponseType, IDENTIFIERS, IDENTIFIER_BLOCK_LIST, IMPORT_ONE_TRUST_ASSESSMENT_FORMS, INITIALIZER, IP_ADDRESS_REGEX, IS_REQUIRED, type Identifier, IdentifierInput, type IdentifierNameMap, ImportOnetrustAssessmentsInput, type IndexedCatalogs, type Initializer, IntlMessage, IntlMessageInput, LARGE_LANGUAGE_MODELS, LOGIN, MESSAGES, type Message, NEW_IDENTIFIER_TYPES, NONE, NOTIFY_ADDITIONAL_TIME, ORGANIZATION, OneTrustFileFormat, OneTrustPullResource, OneTrustPullSource, OpenAIEnabledRoute, OpenAIEnabledRoutes, OpenAIIntegration, OpenAIRouteName, type OrganizationPreview, POLICIES, PREFERENCE_TOPICS, PRIVACY_CENTER, PROCESSING_ACTIVITIES, PROCESSING_PURPOSE_SUB_CATEGORIES, PROMPTS, PROMPTS_WITH_VARIABLES, PROMPT_GROUPS, PROMPT_PARTIALS, PROMPT_THREADS, PURPOSES, ParsedAttributeInput, PartitionInput, PathfinderPolicy, PathfinderPolicyName, PathfinderPolicyNameC, PathfinderPromptRunMetadata, type Plugin, type PluginResponse, type Policy, PolicyInput, type PreferenceTopic, type PrivacyCenter, PrivacyCenterInput, PrivacyRequest, PrivacyRequestInput, PrivacyRequestResponse, type PrivacyRequestWithIdentifiers, type ProcessingActivity, ProcessingActivityInput, ProcessingPurposeInput, ProcessingPurposePreviewInput, type ProcessingPurposeSubCategory, type Prompt, PromptAVendorEmailSettings, type PromptCalculatedVariable, type PromptGroup, PromptGroupInput, PromptInput, type PromptPartial, PromptPartialInput, type PromptRunResult, type PromptRuntimeVariable, type PromptThread, type Purpose, PurposeMap, type PurposeWithPreferences, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, REMOVE_REQUEST_IDENTIFIERS, REPORT_PROMPT_RUN, REPOSITORIES, REQUESTS, REQUEST_DATA_SILOS, REQUEST_ENRICHERS, REQUEST_FILES, REQUEST_IDENTIFIERS, RETRYABLE_BATCH_STATUSES, RETRY_REQUEST_DATA_SILO, RETRY_REQUEST_ENRICHER, RegionInput, type ReportPromptRunInput, type ReportPromptRunOptions, RepositoryInput, type RequestDataSilo, type RequestEnricher, type RequestFile, type RequestFileCursor, RequestFileMetadata, RequestFileMetadataResponse, type RequestFileResponse, RequestIdentifier, type RequestIdentifierMetadata, RequestIdentifiersResponse, type RetentionSchedule, type RetryPolicy, RiskAssignmentInput, type RiskCategory, type RiskFramework, type RiskLevel, RiskLogicInput, type RiskMatrix, type RiskMatrixColumn, type RiskMatrixRow, SCOPES_BY_TITLE, SCOPE_TITLES, SET_RESOURCE_ATTRIBUTES, SKIP_REQUEST_ENRICHER, SOFTWARE_DEVELOPMENT_KITS, SOMBRA_VERSION, SUB_DATA_POINTS, SUB_DATA_POINTS_COUNT, SUB_DATA_POINTS_WITH_GUESSES, SYNC_ATTRIBUTE_TYPES, SoftwareDevelopmentKitInput, StoredApiKey, type SubDataPoint, type SubDataPointCsvPreview, SuccessfulRequest, TEAMS, TEMPLATES, TOGGLE_CONSENT_PRECEDENCE, TOGGLE_DATA_SUBJECT, TOGGLE_TELEMETRY_PARTITION_STRATEGY, TOGGLE_UNKNOWN_COOKIE_POLICY, TOGGLE_UNKNOWN_REQUEST_POLICY, TR_PULL_RESOURCE_SCOPE_MAP, TR_PUSH_RESOURCE_SCOPE_MAP, TR_YML_RESOURCE_TO_FIELD_NAME, type Team, TeamInput, type Template, TemplateInput, TranscendInput, type TranscendPartition, type TranscendPrompt, TranscendPromptManager, type TranscendPromptPartialTemplated, type TranscendPromptTemplated, type TranscendPromptsAndVariables, type TranscendPullConfigurationInput, TranscendPullResource, UPDATE_ACTION, UPDATE_ACTION_ITEMS, UPDATE_ACTION_ITEM_COLLECTION, UPDATE_AGENTS, UPDATE_AGENT_FILES, UPDATE_AGENT_FUNCTIONS, UPDATE_ATTRIBUTE, UPDATE_ATTRIBUTE_VALUES, UPDATE_BUSINESS_ENTITIES, UPDATE_CODE_PACKAGES, UPDATE_CONSENT_EXPERIENCE, UPDATE_CONSENT_MANAGER_DOMAINS, UPDATE_CONSENT_MANAGER_PARTITION, UPDATE_CONSENT_MANAGER_THEME, UPDATE_CONSENT_MANAGER_TO_LATEST, UPDATE_CONSENT_MANAGER_VERSION, UPDATE_DATA_FLOWS, UPDATE_DATA_SILOS, UPDATE_DATA_SUBJECT, UPDATE_DATA_SUB_CATEGORIES, UPDATE_ENRICHER, UPDATE_IDENTIFIER, UPDATE_INTL_MESSAGES, UPDATE_LOAD_OPTIONS, UPDATE_OR_CREATE_COOKIES, UPDATE_OR_CREATE_DATA_POINT, UPDATE_POLICIES, UPDATE_PRIVACY_CENTER, UPDATE_PRIVACY_REQUEST, UPDATE_PROCESSING_ACTIVITIES, UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES, UPDATE_PROMPTS, UPDATE_PROMPT_GROUPS, UPDATE_PROMPT_PARTIALS, UPDATE_REPOSITORIES, UPDATE_SOFTWARE_DEVELOPMENT_KITS, UPDATE_TEAM, UPDATE_VENDORS, USERS, USP_STRING_REGEX, type User, type UserPreview, type UserRole, VARIABLE_PARAMETERS_NAME, VARIABLE_PARAMETERS_REGEXP, VENDORS, type Vendor, VendorInput, WebhookHeader, type XdiSyncGroups, addMessagesToPromptRun, appendCsvSync, approvePrivacyRequests, assumeRole, buildAIIntegrationType, buildEnabledRouteType, buildTranscendGraphQLClient, buildTranscendGraphQLClientGeneric, buildXdiSyncEndpoint, bulkRestartRequests, bulkRetryEnrichers, cancelPrivacyRequests, consentManagersToBusinessEntities, convertToDataSubjectAllowlist, convertToDataSubjectBlockList, createActionItemCollection, createActionItems, createAgent, createAgentFile, createAgentFunction, createApiKey, createBusinessEntity, createCodePackage, createConsentToken, createDataCategory, createDataFlows, createProcessingPurpose, createPrompt, createRegexForTag, createRepository, createSoftwareDevelopmentKit, createSombraGotInstance, createTranscendConsentGotInstance, createVendor, defineTranscendPrompts, deleteApiKey, deployConsentManager, description, domainToHost, downloadPrivacyRequestFiles, enrichPrivacyRequest, ensureAllDataSubjectsExist, extractClientError, extractErrorMessage, fetchActiveSiloDiscoPlugin, fetchAllActionItems, fetchAllActions, fetchAllAgentFiles, fetchAllAgentFunctions, fetchAllAgents, fetchAllApiKeys, fetchAllAssessmentTemplates, fetchAllAssessments, fetchAllAttributeValues, fetchAllAttributes, fetchAllBusinessEntities, fetchAllCatalogs, fetchAllCookies, fetchAllDataCategories, fetchAllDataFlows, fetchAllDataPoints, fetchAllDataSilos, fetchAllDataSubjects, fetchAllEnrichers, fetchAllIdentifiers, fetchAllMessages, fetchAllPolicies, fetchAllPreferenceTopics, fetchAllPrivacyCenters, fetchAllProcessingActivities, fetchAllProcessingPurposes, fetchAllPromptGroups, fetchAllPromptPartials, fetchAllPromptThreads, fetchAllPrompts, fetchAllPurposes, fetchAllPurposesAndPreferences, fetchAllRequestAttributeKeys, fetchAllRequestEnrichers, fetchAllRequestIdentifierMetadata, fetchAllRequestIdentifiers, fetchAllRequests, fetchAllSubDataPoints, fetchAllTeams, fetchAllTemplates, fetchAllUsers, fetchAllVendors, fetchAndIndexCatalogs, fetchApiKeys, fetchConsentManager, fetchConsentManagerAnalyticsData, fetchConsentManagerExperiences, fetchConsentManagerId, fetchConsentManagerTheme, fetchConsentPreferences, fetchEnrichedDataSilos, fetchIdentifiersAndCreateMissing, fetchPartitions, fetchPrivacyCenterId, fetchPrivacyCenterUrl, fetchPromptsWithVariables, fetchRequestDataSilo, fetchRequestDataSiloActiveCount, fetchRequestDataSilos, fetchRequestFilesForRequest, filterNullishValuesFromObject, filterRows, fuzzyMatchColumns, fuzzySearch, generateCrossAccountApiKeys, getErrorStatus, getFileMetadataForPrivacyRequests, getGitFilesThatChanged, getUniqueValuesForColumn, inquirerAutoComplete, inquirerConfirmBoolean, inquirerConfirmText, limitRecords, listDirectories, listFiles, loginUser, makeGraphQLRequest, mapColumnsToAttributes, mapColumnsToIdentifiers, mapCsvColumnsToApi, mapCsvRowsToRequestInputs, mapEnumValues, mapRequestEnumValues, markCronIdentifierCompleted, markRequestDataSiloIdsCompleted, markSilentPrivacyRequests, mergeTranscendInputs, name, normalizeIdentifierValue, notifyPrivacyRequestsAdditionalTime, parseAssessmentDisplayLogic, parseAssessmentRiskLogic, parseAttributesFromString, parseFilePath, parseVariablesFromString, pullAllDatapoints, pullChunkedCustomSiloOutstandingIdentifiers, pullConsentManagerMetrics, pullCronPageOfIdentifiers, pullManualEnrichmentIdentifiersToCsv, pullPrivacyRequests, pullTranscendConfiguration, pullUnstructuredSubDataPointRecommendations, pushCronIdentifiersFromCsv, pushManualEnrichmentIdentifiersFromCsv, readCsv, readTranscendYaml, removeLinks, removeUnverifiedRequestIdentifiers, replaceVariablesInYaml, reportPromptRun, restartPrivacyRequest, retryRequestDataSilos, retryRequestEnricher, retrySamePromise, setResourceAttributes, skipPreflightJobs, skipRequestDataSilos, sleepPromise, splitCsvToList, splitInHalf, streamPrivacyRequestFiles, submitPrivacyRequest, syncAction, syncActionItemCollections, syncActionItems, syncAgentFiles, syncAgentFunctions, syncAgents, syncAttribute, syncBusinessEntities, syncCodePackages, syncConfigurationToTranscend, syncConsentManager, syncConsentManagerExperiences, syncCookies, syncDataCategories, syncDataFlows, syncDataSiloDependencies, syncDataSilos, syncDataSubject, syncEnricher, syncIdentifier, syncIntlMessages, syncPartitions, syncPolicies, syncPrivacyCenter, syncProcessingActivities, syncProcessingPurposes, syncPrompts, syncRepositories, syncSoftwareDevelopmentKits, syncTemplate, syncVendors, updateActionItem, updateActionItemCollection, updateAgentFiles, updateAgentFunctions, updateAgents, updateBusinessEntities, updateCodePackages, updateConsentManagerToLatest, updateConsentManagerVersionToLatest, updateDataCategories, updateDataFlows, updateIntlMessages, updateOrCreateCookies, updatePolicies, updateProcessingPurposes, updatePrompts, updateRepositories, updateSoftwareDevelopmentKits, updateVendors, uploadConsents, uploadCookiesFromCsv, uploadDataFlowsFromCsv, uploadPrivacyRequestsFromCsv, uploadSiloDiscoveryResults, validateTranscendAuth, version, writeCsv, writeCsvSync, writeLargeCsv, writeTranscendYaml };
145130
+ export { ACTIONS, ADD_MESSAGES_TO_PROMPT_RUN, ADD_SILO_DISCOVERY_RESULTS, ADMIN_DASH, ADMIN_DASH_DATAPOINTS, ADMIN_DASH_INTEGRATIONS, AGENTS, AGENT_FILES, AGENT_FUNCTIONS, type AIIntegrationC, API_KEYS, APPROVE_PRIVACY_REQUEST, ASSESSMENTS, ASSESSMENT_SECTION_FIELDS, ASSESSMENT_TEMPLATES, ASSUME_ROLE, ATTRIBUTES, ATTRIBUTE_KEYS_REQUESTS, ATTRIBUTE_VALUES, type Action, ActionInput, type ActionItem, ActionItemCollectionInput, ActionItemInput, type ActionItemRaw, type AddMessagesToPromptRunInput, type Agent, type AgentFile, type AgentFileFilterBy, AgentFileInput, type AgentFunction, AgentFunctionInput, AgentInput, type ApiKey, type ApiKeyGenerateError, ApiKeyInput, type Assessment, AssessmentAction, type AssessmentAnswer, type AssessmentAnswerOption, AssessmentAnswerOptionInput, type AssessmentComment, AssessmentDisplayLogicInput, type AssessmentGroup, AssessmentInput, AssessmentNestedRule, AssessmentNestedRuleInput, type AssessmentPreviousSubmission, type AssessmentQuestion, type AssessmentResource, AssessmentResourceInput, AssessmentRetentionScheduleInput, AssessmentRiskLogic, AssessmentRule, AssessmentRuleInput, type AssessmentSection, AssessmentSectionInput, AssessmentSectionQuestionInput, type AssessmentTemplate, AssessmentTemplateInput, AttestedExtraIdentifiers, type Attribute, AttributeInput, type AttributeKey, type AttributeNameMap, AttributePreview, type AttributeValue, AttributeValueInput, BLANK, BULK_APPLY, BULK_REQUEST_FILES, BUSINESS_ENTITIES, type BusinessEntity, BusinessEntityInput, CANCEL_PRIVACY_REQUEST, CAN_APPLY_IN_BULK, CATALOGS, CHANGE_REQUEST_DATA_SILO_STATUS, CODE_PACKAGES, CONSENT_MANAGER_ANALYTICS_DATA, CONSENT_PARTITIONS, COOKIES, CREATE_ACTION_ITEMS, CREATE_ACTION_ITEM_COLLECTION, CREATE_AGENT, CREATE_AGENT_FILE, CREATE_AGENT_FUNCTION, CREATE_API_KEY, CREATE_ATTRIBUTE, CREATE_ATTRIBUTE_VALUES, CREATE_BUSINESS_ENTITY, CREATE_CODE_PACKAGE, CREATE_CONSENT_EXPERIENCE, CREATE_CONSENT_MANAGER, CREATE_CONSENT_PARTITION, CREATE_DATA_FLOWS, CREATE_DATA_SILOS, CREATE_DATA_SUBJECT, CREATE_DATA_SUB_CATEGORY, CREATE_ENRICHER, CREATE_IDENTIFIER, CREATE_PROCESSING_ACTIVITY, CREATE_PROCESSING_PURPOSE_SUB_CATEGORY, CREATE_PROMPT, CREATE_PROMPT_GROUP, CREATE_PROMPT_PARTIAL, CREATE_REPOSITORY, CREATE_SOFTWARE_DEVELOPMENT_KIT, CREATE_TEAM, CREATE_TEMPLATE, CREATE_VENDOR, CachedFileState, CachedRequestState, type Catalog, CodePackageInput, CodePackageSdk, ColumnName, type ColumnNameMap, type ConsentExperience, ConsentManageExperienceInput, type ConsentManager, ConsentManagerInput, type ConsentManagerMetric, ConsentManagerMetricBin, ConsentManagerServiceMetadata, type ConsentManagerTheme, ConsentPreferenceResponse, ConsentPreferenceTopic, ConsentPreferenceTopicOptionValue, ConsentPurpose, type Cookie, CookieCsvInput, CookieInput, type CreatedApiKey, CronIdentifier, CronIdentifierPush, type CronIdentifierWithAction, type CsvFormattedIdentifier, DATAPOINT_EXPORT, DATA_FLOWS, DATA_POINTS, DATA_POINT_COUNT, DATA_SILOS, DATA_SILOS_ENRICHED, DATA_SILO_EXPORT, DATA_SUBJECTS, DATA_SUB_CATEGORIES, DEFAULT_TRANSCEND_API, DEFAULT_TRANSCEND_CONSENT_API, DEFAULT_TRANSCEND_PULL_RESOURCES, DELETE_API_KEY, DELETE_ATTRIBUTE_VALUE, DEPLOYED_PRIVACY_CENTER_URL, DEPLOY_CONSENT_MANAGER, DETERMINE_LOGIN_METHOD, DataCategoryGuessInput, DataCategoryInput, DataCategoryPreviewInput, DataCategoryRecommendationInput, type DataFlow, DataFlowCsvInput, DataFlowInput, type DataPointCsvPreview, type DataSilo, type DataSiloAttributeValue, type DataSiloCsvPreview, type DataSiloEnriched, DataSiloInput, type DataSubCategory, type DataSubject, DataSubjectInput, type DatapointFilterOptions, DatapointInput, ENABLED_PLUGINS, ENRICHERS, ENTRY_COUNT, EXPERIENCES, type EnabledRouteC, type EnabledRoutesC, EnrichPrivacyRequest, type Enricher, EnricherInput, type ExportedPrivacyRequest, type ExternalUser, FETCH_CONSENT_MANAGER, FETCH_CONSENT_MANAGER_ID, FETCH_CONSENT_MANAGER_THEME, FETCH_PRIVACY_CENTER_ID, FieldInput, GLOBAL_ACTION_ITEMS, GLOBAL_ACTION_ITEM_COLLECTIONS, type GetPromptParamType, type GetPromptResponseType, IDENTIFIERS, IDENTIFIER_BLOCK_LIST, IMPORT_ONE_TRUST_ASSESSMENT_FORMS, INITIALIZER, IP_ADDRESS_REGEX, IS_REQUIRED, type Identifier, IdentifierInput, type IdentifierNameMap, ImportOnetrustAssessmentsInput, type IndexedCatalogs, type Initializer, IntlMessage, IntlMessageInput, LARGE_LANGUAGE_MODELS, LOGIN, MESSAGES, type Message, NEW_IDENTIFIER_TYPES, NONE, NOTIFY_ADDITIONAL_TIME, ORGANIZATION, OneTrustFileFormat, OneTrustPullResource, OneTrustPullSource, OpenAIEnabledRoute, OpenAIEnabledRoutes, OpenAIIntegration, OpenAIRouteName, type OrganizationPreview, POLICIES, PREFERENCE_TOPICS, PRIVACY_CENTER, PROCESSING_ACTIVITIES, PROCESSING_PURPOSE_SUB_CATEGORIES, PROMPTS, PROMPTS_WITH_VARIABLES, PROMPT_GROUPS, PROMPT_PARTIALS, PROMPT_THREADS, PURPOSES, ParsedAttributeInput, PartitionInput, PathfinderPolicy, PathfinderPolicyName, PathfinderPolicyNameC, PathfinderPromptRunMetadata, type Plugin, type PluginResponse, type Policy, PolicyInput, type PreferenceTopic, type PrivacyCenter, PrivacyCenterInput, PrivacyRequest, PrivacyRequestInput, PrivacyRequestResponse, type PrivacyRequestWithIdentifiers, type ProcessingActivity, ProcessingActivityInput, ProcessingPurposeInput, ProcessingPurposePreviewInput, type ProcessingPurposeSubCategory, type Prompt, PromptAVendorEmailSettings, type PromptCalculatedVariable, type PromptGroup, PromptGroupInput, PromptInput, type PromptPartial, PromptPartialInput, type PromptRunResult, type PromptRuntimeVariable, type PromptThread, type Purpose, PurposeMap, type PurposeWithPreferences, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, REMOVE_REQUEST_IDENTIFIERS, REPORT_PROMPT_RUN, REPOSITORIES, REQUESTS, REQUEST_DATA_SILOS, REQUEST_ENRICHERS, REQUEST_FILES, REQUEST_IDENTIFIERS, RETRYABLE_BATCH_STATUSES, RETRY_REQUEST_DATA_SILO, RETRY_REQUEST_ENRICHER, RateCounter, RegionInput, type ReportPromptRunInput, type ReportPromptRunOptions, RepositoryInput, type RequestDataSilo, type RequestEnricher, type RequestFile, type RequestFileCursor, RequestFileMetadata, RequestFileMetadataResponse, type RequestFileResponse, RequestIdentifier, type RequestIdentifierMetadata, RequestIdentifiersResponse, type RetentionSchedule, type RetryPolicy, RiskAssignmentInput, type RiskCategory, type RiskFramework, type RiskLevel, RiskLogicInput, type RiskMatrix, type RiskMatrixColumn, type RiskMatrixRow, SCOPES_BY_TITLE, SCOPE_TITLES, SET_RESOURCE_ATTRIBUTES, SKIP_REQUEST_ENRICHER, SOFTWARE_DEVELOPMENT_KITS, SOMBRA_VERSION, SUB_DATA_POINTS, SUB_DATA_POINTS_COUNT, SUB_DATA_POINTS_WITH_GUESSES, SYNC_ATTRIBUTE_TYPES, SoftwareDevelopmentKitInput, StoredApiKey, type SubDataPoint, type SubDataPointCsvPreview, SuccessfulRequest, TEAMS, TEMPLATES, TOGGLE_CONSENT_PRECEDENCE, TOGGLE_DATA_SUBJECT, TOGGLE_TELEMETRY_PARTITION_STRATEGY, TOGGLE_UNKNOWN_COOKIE_POLICY, TOGGLE_UNKNOWN_REQUEST_POLICY, TR_PULL_RESOURCE_SCOPE_MAP, TR_PUSH_RESOURCE_SCOPE_MAP, TR_YML_RESOURCE_TO_FIELD_NAME, type Team, TeamInput, type Template, TemplateInput, TranscendInput, type TranscendPartition, type TranscendPrompt, TranscendPromptManager, type TranscendPromptPartialTemplated, type TranscendPromptTemplated, type TranscendPromptsAndVariables, type TranscendPullConfigurationInput, TranscendPullResource, UPDATE_ACTION, UPDATE_ACTION_ITEMS, UPDATE_ACTION_ITEM_COLLECTION, UPDATE_AGENTS, UPDATE_AGENT_FILES, UPDATE_AGENT_FUNCTIONS, UPDATE_ATTRIBUTE, UPDATE_ATTRIBUTE_VALUES, UPDATE_BUSINESS_ENTITIES, UPDATE_CODE_PACKAGES, UPDATE_CONSENT_EXPERIENCE, UPDATE_CONSENT_MANAGER_DOMAINS, UPDATE_CONSENT_MANAGER_PARTITION, UPDATE_CONSENT_MANAGER_THEME, UPDATE_CONSENT_MANAGER_TO_LATEST, UPDATE_CONSENT_MANAGER_VERSION, UPDATE_DATA_FLOWS, UPDATE_DATA_SILOS, UPDATE_DATA_SUBJECT, UPDATE_DATA_SUB_CATEGORIES, UPDATE_ENRICHER, UPDATE_IDENTIFIER, UPDATE_INTL_MESSAGES, UPDATE_LOAD_OPTIONS, UPDATE_OR_CREATE_COOKIES, UPDATE_OR_CREATE_DATA_POINT, UPDATE_POLICIES, UPDATE_PRIVACY_CENTER, UPDATE_PRIVACY_REQUEST, UPDATE_PROCESSING_ACTIVITIES, UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES, UPDATE_PROMPTS, UPDATE_PROMPT_GROUPS, UPDATE_PROMPT_PARTIALS, UPDATE_REPOSITORIES, UPDATE_SOFTWARE_DEVELOPMENT_KITS, UPDATE_TEAM, UPDATE_VENDORS, USERS, USP_STRING_REGEX, type User, type UserPreview, type UserRole, VARIABLE_PARAMETERS_NAME, VARIABLE_PARAMETERS_REGEXP, VENDORS, type Vendor, VendorInput, WebhookHeader, type XdiSyncGroups, addMessagesToPromptRun, appendCsvSync, approvePrivacyRequests, assumeRole, buildAIIntegrationType, buildEnabledRouteType, buildTranscendGraphQLClient, buildTranscendGraphQLClientGeneric, buildXdiSyncEndpoint, bulkRestartRequests, bulkRetryEnrichers, cancelPrivacyRequests, consentManagersToBusinessEntities, convertToDataSubjectAllowlist, convertToDataSubjectBlockList, createActionItemCollection, createActionItems, createAgent, createAgentFile, createAgentFunction, createApiKey, createBusinessEntity, createCodePackage, createConsentToken, createDataCategory, createDataFlows, createProcessingPurpose, createPrompt, createRegexForTag, createRepository, createSoftwareDevelopmentKit, createSombraGotInstance, createTranscendConsentGotInstance, createVendor, defineTranscendPrompts, deleteApiKey, deployConsentManager, description, domainToHost, downloadPrivacyRequestFiles, enrichPrivacyRequest, ensureAllDataSubjectsExist, extractClientError, extractErrorMessage, fetchActiveSiloDiscoPlugin, fetchAllActionItems, fetchAllActions, fetchAllAgentFiles, fetchAllAgentFunctions, fetchAllAgents, fetchAllApiKeys, fetchAllAssessmentTemplates, fetchAllAssessments, fetchAllAttributeValues, fetchAllAttributes, fetchAllBusinessEntities, fetchAllCatalogs, fetchAllCookies, fetchAllDataCategories, fetchAllDataFlows, fetchAllDataPoints, fetchAllDataSilos, fetchAllDataSubjects, fetchAllEnrichers, fetchAllIdentifiers, fetchAllMessages, fetchAllPolicies, fetchAllPreferenceTopics, fetchAllPrivacyCenters, fetchAllProcessingActivities, fetchAllProcessingPurposes, fetchAllPromptGroups, fetchAllPromptPartials, fetchAllPromptThreads, fetchAllPrompts, fetchAllPurposes, fetchAllPurposesAndPreferences, fetchAllRequestAttributeKeys, fetchAllRequestEnrichers, fetchAllRequestIdentifierMetadata, fetchAllRequestIdentifiers, fetchAllRequests, fetchAllSubDataPoints, fetchAllTeams, fetchAllTemplates, fetchAllUsers, fetchAllVendors, fetchAndIndexCatalogs, fetchApiKeys, fetchConsentManager, fetchConsentManagerAnalyticsData, fetchConsentManagerExperiences, fetchConsentManagerId, fetchConsentManagerTheme, fetchConsentPreferences, fetchEnrichedDataSilos, fetchIdentifiersAndCreateMissing, fetchPartitions, fetchPrivacyCenterId, fetchPrivacyCenterUrl, fetchPromptsWithVariables, fetchRequestDataSilo, fetchRequestDataSiloActiveCount, fetchRequestDataSilos, fetchRequestFilesForRequest, filterNullishValuesFromObject, filterRows, fuzzyMatchColumns, fuzzySearch, generateCrossAccountApiKeys, getErrorStatus, getFileMetadataForPrivacyRequests, getGitFilesThatChanged, getUniqueValuesForColumn, inquirerAutoComplete, inquirerConfirmBoolean, inquirerConfirmText, limitRecords, listDirectories, listFiles, loginUser, makeGraphQLRequest, mapColumnsToAttributes, mapColumnsToIdentifiers, mapCsvColumnsToApi, mapCsvRowsToRequestInputs, mapEnumValues, mapRequestEnumValues, markCronIdentifierCompleted, markRequestDataSiloIdsCompleted, markSilentPrivacyRequests, mergeTranscendInputs, name, normalizeIdentifierValue, notifyPrivacyRequestsAdditionalTime, parseAssessmentDisplayLogic, parseAssessmentRiskLogic, parseAttributesFromString, parseFilePath, parseVariablesFromString, pullAllDatapoints, pullChunkedCustomSiloOutstandingIdentifiers, pullConsentManagerMetrics, pullCronPageOfIdentifiers, pullManualEnrichmentIdentifiersToCsv, pullPrivacyRequests, pullTranscendConfiguration, pullUnstructuredSubDataPointRecommendations, pushCronIdentifiersFromCsv, pushManualEnrichmentIdentifiersFromCsv, readCsv, readSafe, readTranscendYaml, removeLinks, removeUnverifiedRequestIdentifiers, replaceVariablesInYaml, reportPromptRun, restartPrivacyRequest, retryRequestDataSilos, retryRequestEnricher, retrySamePromise, setResourceAttributes, skipPreflightJobs, skipRequestDataSilos, sleepPromise, splitCsvToList, splitInHalf, streamPrivacyRequestFiles, submitPrivacyRequest, syncAction, syncActionItemCollections, syncActionItems, syncAgentFiles, syncAgentFunctions, syncAgents, syncAttribute, syncBusinessEntities, syncCodePackages, syncConfigurationToTranscend, syncConsentManager, syncConsentManagerExperiences, syncCookies, syncDataCategories, syncDataFlows, syncDataSiloDependencies, syncDataSilos, syncDataSubject, syncEnricher, syncIdentifier, syncIntlMessages, syncPartitions, syncPolicies, syncPrivacyCenter, syncProcessingActivities, syncProcessingPurposes, syncPrompts, syncRepositories, syncSoftwareDevelopmentKits, syncTemplate, syncVendors, updateActionItem, updateActionItemCollection, updateAgentFiles, updateAgentFunctions, updateAgents, updateBusinessEntities, updateCodePackages, updateConsentManagerToLatest, updateConsentManagerVersionToLatest, updateDataCategories, updateDataFlows, updateIntlMessages, updateOrCreateCookies, updatePolicies, updateProcessingPurposes, updatePrompts, updateRepositories, updateSoftwareDevelopmentKits, updateVendors, uploadConsents, uploadCookiesFromCsv, uploadDataFlowsFromCsv, uploadPrivacyRequestsFromCsv, uploadSiloDiscoveryResults, validateTranscendAuth, version, writeCsv, writeCsvSync, writeLargeCsv, writeTranscendYaml };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Transcend Inc.",
3
3
  "name": "@transcend-io/cli",
4
4
  "description": "A command line interface for programmatic operations across Transcend.",
5
- "version": "8.0.4",
5
+ "version": "8.0.6",
6
6
  "homepage": "https://github.com/transcend-io/cli",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkZBKJMC7Ccjs = require('./chunk-ZBKJMC7C.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkQG4ECDFEcjs = require('./chunk-QG4ECDFE.cjs');require('./chunk-Q7I37FJV.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _bluebird = require('bluebird');var _cliprogress = require('cli-progress'); var _cliprogress2 = _interopRequireDefault(_cliprogress);var _persistedstate = require('@transcend-io/persisted-state');var _iots = require('io-ts'); var j = _interopRequireWildcard(_iots); var T = _interopRequireWildcard(_iots); var o = _interopRequireWildcard(_iots);var _privacytypes = require('@transcend-io/privacy-types');var _typeutils = require('@transcend-io/type-utils');var xe=T.intersection([T.type({nodes:T.array(_privacytypes.PreferenceQueryResponseItem)}),T.partial({cursor:T.string})]),Ee=["ENOTFOUND","ETIMEDOUT","504 Gateway Time-out","Task timed out after"];async function ce(l,{identifiers:n,partitionKey:h,skipLogging:m=!1}){let s=[],d=_chunkQG4ECDFEcjs.b.call(void 0, n,100),f=new Date().getTime(),r=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic);m||r.start(n.length,0);let p=0;await _bluebird.map.call(void 0, d,async e=>{let c=0,g=3;for(;c<g;)try{let i=await l.post(`v1/preferences/${h}/query`,{json:{filter:{identifiers:e},limit:e.length}}).json(),w=_typeutils.decodeCodec.call(void 0, xe,i);s.push(...w.nodes),p+=e.length,r.update(p);break}catch(i){c+=1;let w=_optionalChain([i, 'optionalAccess', _2 => _2.response, 'optionalAccess', _3 => _3.body])||_optionalChain([i, 'optionalAccess', _4 => _4.message])||"";if(c>=g||!Ee.some(P=>w.includes(P)))throw new Error(`Received an error from server after ${c} attempts: ${w}`);_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`[RETRYING FAILED REQUEST - Attempt ${c}] Failed to fetch ${e.length} user preferences from partition ${h}: ${w}`))}},{concurrency:40}),r.stop();let t=new Date().getTime()-f;return m||_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Completed download in "${t/1e3}" seconds.`)),s}function q({row:l,columnToPurposeName:n,purposeSlugs:h,preferenceTopics:m}){let s={};return Object.entries(n).forEach(([d,{purpose:f,preference:r,valueMapping:p}])=>{if(!h.includes(f))throw new Error(`Invalid purpose slug: ${f}, expected: ${h.join(", ")}`);if(r){let u=m.find(g=>g.slug===r&&g.purpose.trackingType===f);if(!u){let g=m.filter(i=>i.purpose.trackingType===f).map(i=>i.slug);throw new Error(`Invalid preference slug: ${r} for purpose: ${f}. Allowed preference slugs for purpose are: ${g.join(",")}`)}s[f]||(s[f]={preferences:[]}),s[f].preferences||(s[f].preferences=[]);let t=l[d],e=p[t],c=typeof e=="string"&&e.trim()||null;switch(u.type){case _privacytypes.PreferenceTopicType.Boolean:if(typeof e!="boolean")throw new Error(`Invalid value for boolean preference: ${r}, expected boolean, got: ${t}`);s[f].preferences.push({topic:r,choice:{booleanValue:e}});break;case _privacytypes.PreferenceTopicType.Select:if(typeof e!="string"&&e!==null)throw new Error(`Invalid value for select preference: ${r}, expected string or null, got: ${t}`);if(c&&!u.preferenceOptionValues.map(({slug:g})=>g).includes(c))throw new Error(`Invalid value for select preference: ${r}, expected one of: ${u.preferenceOptionValues.map(({slug:g})=>g).join(", ")}, got: ${t}`);s[f].preferences.push({topic:r,choice:{selectValue:c}});break;case _privacytypes.PreferenceTopicType.MultiSelect:if(typeof t!="string")throw new Error(`Invalid value for multi select preference: ${r}, expected string, got: ${t}`);s[f].preferences.push({topic:r,choice:{selectValues:_chunkZBKJMC7Ccjs.nc.call(void 0, t).map(g=>{let i=p[g];if(typeof i!="string")throw new Error(`Invalid value for multi select preference: ${r}, expected one of: ${u.preferenceOptionValues.map(({slug:w})=>w).join(", ")}, got: ${g}`);return i}).sort((g,i)=>g.localeCompare(i))}});break;default:throw new Error(`Unknown preference type: ${u.type}`)}}else s[f]?s[f].enabled=p[l[d]]===!0:s[f]={enabled:p[l[d]]===!0}}),_typeutils.apply.call(void 0, s,(d,f)=>{if(typeof d.enabled!="boolean")throw new Error(`No mapping provided for purpose.enabled=true/false value: ${f}`);return{...d,enabled:d.enabled}})}var _inquirer = require('inquirer'); var _inquirer2 = _interopRequireDefault(_inquirer);var B="[NONE]";async function me(l,n){let h=_chunkQG4ECDFEcjs.j.call(void 0, l.map(s=>Object.keys(s)).flat()),m=_chunkQG4ECDFEcjs.c.call(void 0, h,[...n.identifierColumn?[n.identifierColumn]:[],...Object.keys(n.columnToPurposeName)]);if(!n.timestampColum){let{timestampName:s}=await _inquirer2.default.prompt([{name:"timestampName",message:"Choose the column that will be used as the timestamp of last preference update",type:"list",default:m.find(d=>d.toLowerCase().includes("date"))||m.find(d=>d.toLowerCase().includes("time"))||m[0],choices:[...m,B]}]);n.timestampColum=s}if(_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Using timestamp column "${n.timestampColum}"`)),n.timestampColum!==B){let s=l.map((d,f)=>d[n.timestampColum]?null:[f]).filter(d=>!!d).flat();if(s.length>0)throw new Error(`The timestamp column "${n.timestampColum}" is missing a value for the following rows: ${s.join(`
2
- `)}`);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`The timestamp column "${n.timestampColum}" is present for all row`))}return n}async function ue(l,n){let h=_chunkQG4ECDFEcjs.j.call(void 0, l.map(r=>Object.keys(r)).flat()),m=_chunkQG4ECDFEcjs.c.call(void 0, h,[...n.identifierColumn?[n.identifierColumn]:[],...Object.keys(n.columnToPurposeName)]);if(!n.identifierColumn){let{identifierName:r}=await _inquirer2.default.prompt([{name:"identifierName",message:"Choose the column that will be used as the identifier to upload consent preferences by",type:"list",default:m.find(p=>p.toLowerCase().includes("email"))||m[0],choices:m}]);n.identifierColumn=r}_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Using identifier column "${n.identifierColumn}"`));let s=l.map((r,p)=>r[n.identifierColumn]?null:[p]).filter(r=>!!r).flat();if(s.length>0){let r=`The identifier column "${n.identifierColumn}" is missing a value for the following rows: ${s.join(", ")}`;if(_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(r)),!await _chunkZBKJMC7Ccjs.Kf.call(void 0, {message:"Would you like to skip rows missing an identifier?"}))throw new Error(r);let u=l.length;l=l.filter(t=>t[n.identifierColumn]),_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`Skipped ${u-l.length} rows missing an identifier`))}_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`The identifier column "${n.identifierColumn}" is present for all rows`));let d=_chunkQG4ECDFEcjs.d.call(void 0, l,n.identifierColumn),f=Object.entries(d).filter(([,r])=>r.length>1);if(f.length>0){let r=`The identifier column "${n.identifierColumn}" has duplicate values for the following rows: ${f.slice(0,10).map(([u,t])=>`${u} (${t.length})`).join(`
3
- `)}`;if(_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(r)),!await _chunkZBKJMC7Ccjs.Kf.call(void 0, {message:"Would you like to automatically take the latest update?"}))throw new Error(r);l=Object.entries(d).map(([,u])=>u.sort((e,c)=>new Date(c[n.timestampColum]).getTime()-new Date(e[n.timestampColum]).getTime())[0]).filter(u=>u)}return{currentState:n,preferences:l}}async function de(l,n,{purposeSlugs:h,preferenceTopics:m,forceTriggerWorkflows:s}){let d=_chunkQG4ECDFEcjs.j.call(void 0, l.map(p=>Object.keys(p)).flat()),f=_chunkQG4ECDFEcjs.c.call(void 0, d,[...n.identifierColumn?[n.identifierColumn]:[],...n.timestampColum?[n.timestampColum]:[]]);if(f.length===0){if(s)return n;throw new Error("No other columns to process")}let r=[...h,...m.map(p=>`${p.purpose.trackingType}->${p.slug}`)];return await _bluebird.mapSeries.call(void 0, f,async p=>{let u=_chunkQG4ECDFEcjs.j.call(void 0, l.map(e=>e[p])),t=n.columnToPurposeName[p];if(t)_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Column "${p}" is associated with purpose "${t.purpose}"`));else{let{purposeName:e}=await _inquirer2.default.prompt([{name:"purposeName",message:`Choose the purpose that column ${p} is associated with`,type:"list",default:r.find(i=>i.startsWith(h[0])),choices:r}]),[c,g]=e.split("->");t={purpose:c,preference:g||null,valueMapping:{}}}await _bluebird.mapSeries.call(void 0, u,async e=>{if(t.valueMapping[e]!==void 0){_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Value "${e}" is associated with purpose value "${t.valueMapping[e]}"`));return}if(t.preference===null){let{purposeValue:c}=await _inquirer2.default.prompt([{name:"purposeValue",message:`Choose the purpose value for value "${e}" associated with purpose "${t.purpose}"`,type:"confirm",default:e!=="false"}]);t.valueMapping[e]=c}if(t.preference!==null){let c=m.find(i=>i.slug===t.preference);if(!c){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Preference topic "${t.preference}" not found`));return}let g=c.preferenceOptionValues.map(({slug:i})=>i);if(c.type===_privacytypes.PreferenceTopicType.Boolean){let{preferenceValue:i}=await _inquirer2.default.prompt([{name:"preferenceValue",message:`Choose the preference value for "${c.slug}" value "${e}" associated with purpose "${t.purpose}"`,type:"confirm",default:e!=="false"}]);t.valueMapping[e]=i;return}if(c.type===_privacytypes.PreferenceTopicType.Select){let{preferenceValue:i}=await _inquirer2.default.prompt([{name:"preferenceValue",message:`Choose the preference value for "${c.slug}" value "${e}" associated with purpose "${t.purpose}"`,type:"list",choices:g,default:g.find(w=>w===e)}]);t.valueMapping[e]=i;return}if(c.type===_privacytypes.PreferenceTopicType.MultiSelect){let i=_chunkZBKJMC7Ccjs.nc.call(void 0, e);await _bluebird.mapSeries.call(void 0, i,async w=>{if(t.valueMapping[w]!==void 0)return;let{preferenceValue:P}=await _inquirer2.default.prompt([{name:"preferenceValue",message:`Choose the preference value for "${c.slug}" value "${w}" associated with purpose "${t.purpose}"`,type:"list",choices:g,default:g.find(y=>y===w)}]);t.valueMapping[w]=P});return}throw new Error(`Unknown preference topic type: ${c.type}`)}}),n.columnToPurposeName[p]=t}),n}function ge({currentConsentRecord:l,pendingUpdates:n,preferenceTopics:h}){return Object.entries(n).every(([m,{preferences:s=[],enabled:d}])=>{let f=l.purposes.find(p=>p.purpose===m);return!!f&&f.enabled===d?s.every(({topic:p,choice:u})=>f.preferences&&f.preferences.find(t=>{if(t.topic!==p)return!1;let e=h.find(c=>c.slug===p&&c.purpose.trackingType===m);if(!e)throw new Error(`Could not find preference topic for ${p}`);switch(e.type){case _privacytypes.PreferenceTopicType.Boolean:return t.choice.booleanValue===u.booleanValue;case _privacytypes.PreferenceTopicType.Select:return t.choice.selectValue===u.selectValue;case _privacytypes.PreferenceTopicType.MultiSelect:let c=(t.choice.selectValues||[]).sort(),g=(u.selectValues||[]).sort();return c.length===g.length&&c.every((i,w)=>i===g[w]);default:throw new Error(`Unknown preference topic type: ${e.type}`)}})):!1})}function we({currentConsentRecord:l,pendingUpdates:n,preferenceTopics:h,log:m}){return!!Object.entries(n).find(([s,{preferences:d=[],enabled:f}])=>{let r=l.purposes.find(p=>p.purpose===s);return r?r.enabled!==f?(m&&_chunkZUNVPK23cjs.a.warn(`Purpose ${s} enabled value conflict for user ${l.userId}. Pending Value: ${f}, Current Value: ${r.enabled}`),!0):!!d.find(({topic:p,choice:u})=>{let t=(r.preferences||[]).find(i=>i.topic===p);if(!t)return m&&_chunkZUNVPK23cjs.a.warn(`No existing preference found for topic ${p} in purpose ${s} for user ${l.userId}.`),!1;let e=h.find(i=>i.slug===p&&i.purpose.trackingType===s);if(!e)throw new Error(`Could not find preference topic for ${p}`);let c,g;switch(e.type){case _privacytypes.PreferenceTopicType.Boolean:return c=t.choice.booleanValue!==u.booleanValue,m&&_chunkZUNVPK23cjs.a.warn(`Preference topic ${p} boolean value conflict for user ${l.userId}. Expected: ${u.booleanValue}, Found: ${t.choice.booleanValue}`),c;case _privacytypes.PreferenceTopicType.Select:return g=t.choice.selectValue!==u.selectValue,m&&_chunkZUNVPK23cjs.a.warn(`Preference topic ${p} select value conflict for user ${l.userId}. Expected: ${u.selectValue}, Found: ${t.choice.selectValue}`),g;case _privacytypes.PreferenceTopicType.MultiSelect:let i=(t.choice.selectValues||[]).sort(),w=(u.selectValues||[]).sort();return g=i.length!==w.length||!i.every((P,y)=>P===w[y]),m&&_chunkZUNVPK23cjs.a.warn(`Preference topic ${p} multi-select value conflict for user ${l.userId}. Expected: ${w.join(", ")}, Found: ${i.join(", ")}`),g;default:throw new Error(`Unknown preference topic type: ${e.type}`)}}):(m&&_chunkZUNVPK23cjs.a.warn(`No existing purpose found for ${s} in consent record for ${l.userId}.`),!1)})}async function ye({file:l,sombra:n,purposeSlugs:h,preferenceTopics:m,partitionKey:s,skipExistingRecordCheck:d,forceTriggerWorkflows:f},r){let p=new Date().getTime(),u=r.getValue("fileMetadata");_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading in file: "${l}"`));let t=_chunkZBKJMC7Ccjs.qc.call(void 0, l,j.record(j.string,j.string)),e={columnToPurposeName:{},pendingSafeUpdates:{},pendingConflictUpdates:{},skippedUpdates:{},...u[l]||{},lastFetchedAt:new Date().toISOString()};e=await me(t,e),u[l]=e,await r.setValue(u,"fileMetadata");let c=await ue(t,e);e=c.currentState,t=c.preferences,u[l]=e,await r.setValue(u,"fileMetadata"),e=await de(t,e,{preferenceTopics:m,purposeSlugs:h,forceTriggerWorkflows:f}),u[l]=e,await r.setValue(u,"fileMetadata");let g=t.map(y=>y[e.identifierColumn]),i=d?[]:await ce(n,{identifiers:g.map(y=>({value:y})),partitionKey:s}),w=_chunkQG4ECDFEcjs.e.call(void 0, i,"userId");e.pendingConflictUpdates={},e.pendingSafeUpdates={},e.skippedUpdates={},t.forEach(y=>{let b=y[e.identifierColumn],E=q({row:y,columnToPurposeName:e.columnToPurposeName,preferenceTopics:m,purposeSlugs:h}),U=w[b];if(f&&!U)throw new Error(`No existing consent record found for user with id: ${b}.
4
- When 'forceTriggerWorkflows' is set all the user identifiers should contain a consent record`);if(U&&ge({currentConsentRecord:U,pendingUpdates:E,preferenceTopics:m})&&!f){e.skippedUpdates[b]=y;return}if(U&&we({currentConsentRecord:U,pendingUpdates:E,preferenceTopics:m})){e.pendingConflictUpdates[b]={row:y,record:U};return}e.pendingSafeUpdates[b]=y}),u[l]=e,await r.setValue(u,"fileMetadata");let P=new Date().getTime();_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully pre-processed file: "${l}" in ${(P-p)/1e3}s`))}var je=o.type({purpose:o.string,preference:o.union([o.string,o.null]),valueMapping:o.record(o.string,o.union([o.string,o.boolean,o.null]))}),Ae=o.intersection([o.type({columnToPurposeName:o.record(o.string,je),lastFetchedAt:o.string,pendingSafeUpdates:o.record(o.string,o.record(o.string,o.string)),pendingConflictUpdates:o.record(o.string,o.type({record:_privacytypes.PreferenceQueryResponseItem,row:o.record(o.string,o.string)})),skippedUpdates:o.record(o.string,o.record(o.string,o.string))}),o.partial({identifierColumn:o.string,timestampColum:o.string})]),$e=o.type({fileMetadata:o.record(o.string,Ae),failingUpdates:o.record(o.string,o.type({uploadedAt:o.string,error:o.string,update:_privacytypes.PreferenceUpdateItem})),pendingUpdates:o.record(o.string,_privacytypes.PreferenceUpdateItem)});async function Ce({auth:l,sombraAuth:n,receiptFilepath:h,file:m,partition:s,isSilent:d=!0,dryRun:f=!1,skipWorkflowTriggers:r=!1,skipConflictUpdates:p=!1,skipExistingRecordCheck:u=!1,attributes:t=[],transcendUrl:e,forceTriggerWorkflows:c=!1}){let g=_chunkZBKJMC7Ccjs.pc.call(void 0, t),i=new (0, _persistedstate.PersistedState)(h,$e,{fileMetadata:{},failingUpdates:{},pendingUpdates:{}}),w=i.getValue("failingUpdates"),P=i.getValue("pendingUpdates"),y=i.getValue("fileMetadata");_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Restored cache, there are:
5
- ${Object.values(w).length} failing requests to be retried
6
- ${Object.values(P).length} pending requests to be processed
7
- The following files are stored in cache and will be used:
8
- ${Object.keys(y).map($=>$).join(`
9
- `)}
10
- The following file will be processed: ${m}
11
- `));let b=_chunkZBKJMC7Ccjs.vc.call(void 0, e,l),[E,U,H]=await Promise.all([_chunkZBKJMC7Ccjs.wc.call(void 0, e,l,n),c?Promise.resolve([]):_chunkZBKJMC7Ccjs.cd.call(void 0, b),c?Promise.resolve([]):_chunkZBKJMC7Ccjs._c.call(void 0, b)]);await ye({file:m,purposeSlugs:U.map($=>$.trackingType),preferenceTopics:H,sombra:E,partitionKey:s,skipExistingRecordCheck:u,forceTriggerWorkflows:c},i);let S={};y=i.getValue("fileMetadata");let M=y[m];if(_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Found ${Object.entries(M.pendingSafeUpdates).length} safe updates in ${m}`)),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Found ${Object.entries(M.pendingConflictUpdates).length} conflict updates in ${m}`)),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Found ${Object.entries(M.skippedUpdates).length} skipped updates in ${m}`)),Object.entries({...M.pendingSafeUpdates,...p?{}:_typeutils.apply.call(void 0, M.pendingConflictUpdates,({row:$})=>$)}).forEach(([$,C])=>{let A=M.timestampColum===B?new Date:new Date(C[M.timestampColum]),k=q({row:C,columnToPurposeName:M.columnToPurposeName,preferenceTopics:H,purposeSlugs:U.map(R=>R.trackingType)});S[$]={userId:$,partition:s,timestamp:A.toISOString(),purposes:Object.entries(k).map(([R,Me])=>({...Me,purpose:R,workflowSettings:{attributes:g,isSilent:d,skipWorkflowTrigger:r}}))}}),await i.setValue(S,"pendingUpdates"),await i.setValue({},"failingUpdates"),f){_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Dry run complete, exiting. ${Object.values(S).length} pending updates. Check file: ${h}`));return}_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Uploading ${Object.values(S).length} preferences to partition: ${s}`));let ve=new Date().getTime(),Q=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),X=0,L=Object.entries(S),Ue=_chunkQG4ECDFEcjs.b.call(void 0, L,r?100:10);Q.start(L.length,0),await _bluebird.map.call(void 0, Ue,async $=>{try{await E.put("v1/preferences",{json:{records:$.map(([,C])=>C),skipWorkflowTriggers:r,forceTriggerWorkflows:c}}).json()}catch(C){try{let k=JSON.parse(_optionalChain([C, 'optionalAccess', _5 => _5.response, 'optionalAccess', _6 => _6.body])||"{}");k.error&&_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Error: ${k.error}`))}catch (e2){}_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to upload ${$.length} user preferences to partition ${s}: ${_optionalChain([C, 'optionalAccess', _7 => _7.response, 'optionalAccess', _8 => _8.body])||_optionalChain([C, 'optionalAccess', _9 => _9.message])}`));let A=i.getValue("failingUpdates");$.forEach(([k,R])=>{A[k]={uploadedAt:new Date().toISOString(),update:R,error:_optionalChain([C, 'optionalAccess', _10 => _10.response, 'optionalAccess', _11 => _11.body])||_optionalChain([C, 'optionalAccess', _12 => _12.message])||"Unknown error"}}),await i.setValue(A,"failingUpdates")}X+=$.length,Q.update(X)},{concurrency:40}),Q.stop();let Ve=new Date().getTime()-ve;_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully uploaded ${L.length} user preferences to partition ${s} in "${Ve/1e3}" seconds!`))}var _fs = require('fs');var _path = require('path');async function Ir({auth:l,partition:n,sombraAuth:h,transcendUrl:m,file:s="",directory:d,dryRun:f,skipExistingRecordCheck:r,receiptFileDir:p,skipWorkflowTriggers:u,forceTriggerWorkflows:t,skipConflictUpdates:e,isSilent:c,attributes:g,concurrency:i}){d&&s&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Cannot provide both a directory and a file. Please provide only one.")),this.process.exit(1)),!s&&!d&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences")),this.process.exit(1)),_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let w=[];if(d)try{let y=_fs.readdirSync.call(void 0, d).filter(b=>b.endsWith(".csv"));y.length===0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`No CSV files found in directory: ${d}`)),this.process.exit(1)),w.push(...y.map(b=>_path.join.call(void 0, d,b)))}catch(P){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to read directory: ${d}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(P.message)),this.process.exit(1)}else try{s.endsWith(".csv")||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("File must be a CSV file")),this.process.exit(1)),w.push(s)}catch(P){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to access file: ${s}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(P.message)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Processing ${w.length} consent preferences files for partition: ${n}`)),_chunkZUNVPK23cjs.a.debug(`Files to process: ${w.join(", ")}`),r&&_chunkZUNVPK23cjs.a.info(_colors2.default.bgYellow(`Skipping existing record check: ${r}`)),await _bluebird.map.call(void 0, w,async P=>{let y=_path.basename.call(void 0, P).replace(".csv","");await Ce({receiptFilepath:_path.join.call(void 0, p,`${y}-receipts.json`),auth:l,sombraAuth:h,file:P,partition:n,transcendUrl:m,skipConflictUpdates:e,skipWorkflowTriggers:u,skipExistingRecordCheck:r,isSilent:c,dryRun:f,attributes:_chunkZBKJMC7Ccjs.nc.call(void 0, g),forceTriggerWorkflows:t})},{concurrency:i})}exports.uploadPreferences = Ir;
12
- //# sourceMappingURL=impl-G7JOSWM6.cjs.map