@transcend-io/cli 8.0.0 → 8.0.2

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 (159) 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-R7QYSUEN.cjs → chunk-3PX3HVEO.cjs} +2 -2
  5. package/dist/{chunk-R7QYSUEN.cjs.map → chunk-3PX3HVEO.cjs.map} +1 -1
  6. package/dist/{chunk-3EZGFSMD.cjs → chunk-44J2TVZU.cjs} +2 -2
  7. package/dist/{chunk-3EZGFSMD.cjs.map → chunk-44J2TVZU.cjs.map} +1 -1
  8. package/dist/chunk-7UL54E7X.cjs +2 -0
  9. package/dist/{chunk-3FEOMF7G.cjs.map → chunk-7UL54E7X.cjs.map} +1 -1
  10. package/dist/chunk-A4OQQVQT.cjs +3 -0
  11. package/dist/chunk-A4OQQVQT.cjs.map +1 -0
  12. package/dist/chunk-BPX6MSMC.cjs +2 -0
  13. package/dist/chunk-BPX6MSMC.cjs.map +1 -0
  14. package/dist/{chunk-6DMFIXMV.cjs → chunk-FNBADTTI.cjs} +19 -19
  15. package/dist/{chunk-6DMFIXMV.cjs.map → chunk-FNBADTTI.cjs.map} +1 -1
  16. package/dist/{chunk-ZVK4HIDF.cjs → chunk-LR3CPNDM.cjs} +1 -1
  17. package/dist/chunk-LR3CPNDM.cjs.map +1 -0
  18. package/dist/{chunk-NKVC5Y53.cjs → chunk-N7QF44VW.cjs} +2 -2
  19. package/dist/{chunk-NKVC5Y53.cjs.map → chunk-N7QF44VW.cjs.map} +1 -1
  20. package/dist/chunk-PQTI6C4Q.cjs +12 -0
  21. package/dist/chunk-PQTI6C4Q.cjs.map +1 -0
  22. package/dist/{chunk-SUCCU2FS.cjs → chunk-SW5CIF5D.cjs} +1 -1
  23. package/dist/chunk-SW5CIF5D.cjs.map +1 -0
  24. package/dist/chunk-UONUI4AB.cjs +2920 -0
  25. package/dist/chunk-UONUI4AB.cjs.map +1 -0
  26. package/dist/chunk-W3S3ULXN.cjs +2 -0
  27. package/dist/chunk-W3S3ULXN.cjs.map +1 -0
  28. package/dist/{chunk-7QV5QNGW.cjs → chunk-XARKMCNP.cjs} +4 -4
  29. package/dist/chunk-XARKMCNP.cjs.map +1 -0
  30. package/dist/{chunk-KC7NDLN7.cjs → chunk-XPKFB4IL.cjs} +2 -2
  31. package/dist/{chunk-KC7NDLN7.cjs.map → chunk-XPKFB4IL.cjs.map} +1 -1
  32. package/dist/{chunk-6PCS4IRI.cjs → chunk-YKZKPWDF.cjs} +2 -2
  33. package/dist/chunk-YKZKPWDF.cjs.map +1 -0
  34. package/dist/chunk-YMXQXAUZ.cjs +2 -0
  35. package/dist/{chunk-AADFRD6P.cjs.map → chunk-YMXQXAUZ.cjs.map} +1 -1
  36. package/dist/{chunk-FMX5SPCL.cjs → chunk-YP2PMUM5.cjs} +2 -2
  37. package/dist/{chunk-FMX5SPCL.cjs.map → chunk-YP2PMUM5.cjs.map} +1 -1
  38. package/dist/{impl-HV2SRHDV.cjs → impl-2BXBJZII.cjs} +2 -2
  39. package/dist/impl-2BXBJZII.cjs.map +1 -0
  40. package/dist/{impl-ALXI3TP7.cjs → impl-2SHN3CZX.cjs} +2 -2
  41. package/dist/{impl-ALXI3TP7.cjs.map → impl-2SHN3CZX.cjs.map} +1 -1
  42. package/dist/{impl-3MB7W3JD.cjs → impl-334G4VTL.cjs} +2 -2
  43. package/dist/{impl-3MB7W3JD.cjs.map → impl-334G4VTL.cjs.map} +1 -1
  44. package/dist/{impl-SLRQDZB4.cjs → impl-37NGCBEQ.cjs} +2 -2
  45. package/dist/{impl-SLRQDZB4.cjs.map → impl-37NGCBEQ.cjs.map} +1 -1
  46. package/dist/{impl-LJMBCW6Z.cjs → impl-5IS3UVQQ.cjs} +2 -2
  47. package/dist/{impl-LJMBCW6Z.cjs.map → impl-5IS3UVQQ.cjs.map} +1 -1
  48. package/dist/{impl-A6IYDZLA.cjs → impl-5IZQDLG7.cjs} +2 -2
  49. package/dist/{impl-A6IYDZLA.cjs.map → impl-5IZQDLG7.cjs.map} +1 -1
  50. package/dist/impl-7MIPQI3E.cjs +2 -0
  51. package/dist/impl-7MIPQI3E.cjs.map +1 -0
  52. package/dist/impl-AJMAFFJG.cjs +2 -0
  53. package/dist/{impl-ZFJM6LMZ.cjs.map → impl-AJMAFFJG.cjs.map} +1 -1
  54. package/dist/{impl-5OEUTJB7.cjs → impl-BL64FHKY.cjs} +2 -2
  55. package/dist/{impl-5OEUTJB7.cjs.map → impl-BL64FHKY.cjs.map} +1 -1
  56. package/dist/{impl-OZ7S4WDL.cjs → impl-BXNGIHN2.cjs} +2 -2
  57. package/dist/{impl-OZ7S4WDL.cjs.map → impl-BXNGIHN2.cjs.map} +1 -1
  58. package/dist/impl-DDHHIRXW.cjs +12 -0
  59. package/dist/impl-DDHHIRXW.cjs.map +1 -0
  60. package/dist/impl-DFDEITPV.cjs +7 -0
  61. package/dist/impl-DFDEITPV.cjs.map +1 -0
  62. package/dist/{impl-BEGQABL3.cjs → impl-DZSW2V2J.cjs} +2 -2
  63. package/dist/{impl-BEGQABL3.cjs.map → impl-DZSW2V2J.cjs.map} +1 -1
  64. package/dist/impl-FC7ICRDM.cjs +2 -0
  65. package/dist/{impl-DHMLZZX7.cjs.map → impl-FC7ICRDM.cjs.map} +1 -1
  66. package/dist/{impl-HFDUNV2A.cjs → impl-G2MAA4QD.cjs} +2 -2
  67. package/dist/{impl-HFDUNV2A.cjs.map → impl-G2MAA4QD.cjs.map} +1 -1
  68. package/dist/{impl-DCPTYADV.cjs → impl-GIZXIRD5.cjs} +2 -2
  69. package/dist/{impl-DCPTYADV.cjs.map → impl-GIZXIRD5.cjs.map} +1 -1
  70. package/dist/{impl-TI7DA67A.cjs → impl-H3RZXUMP.cjs} +2 -2
  71. package/dist/{impl-TI7DA67A.cjs.map → impl-H3RZXUMP.cjs.map} +1 -1
  72. package/dist/impl-HG3PK5DG.cjs +2 -0
  73. package/dist/{impl-TVSTWXSI.cjs.map → impl-HG3PK5DG.cjs.map} +1 -1
  74. package/dist/impl-IAZCCRHG.cjs +2 -0
  75. package/dist/{impl-SCO4LJDB.cjs.map → impl-IAZCCRHG.cjs.map} +1 -1
  76. package/dist/{impl-YLORLMRQ.cjs → impl-K3VBUCUB.cjs} +2 -2
  77. package/dist/{impl-YLORLMRQ.cjs.map → impl-K3VBUCUB.cjs.map} +1 -1
  78. package/dist/impl-KMLDAWB5.cjs +6 -0
  79. package/dist/impl-KMLDAWB5.cjs.map +1 -0
  80. package/dist/impl-LDJGDZNJ.cjs +2 -0
  81. package/dist/impl-LDJGDZNJ.cjs.map +1 -0
  82. package/dist/impl-LLCE3XUF.cjs +6 -0
  83. package/dist/impl-LLCE3XUF.cjs.map +1 -0
  84. package/dist/{impl-EE72U2AE.cjs → impl-MLVIXJWF.cjs} +2 -2
  85. package/dist/impl-MLVIXJWF.cjs.map +1 -0
  86. package/dist/{impl-JYCFV5ST.cjs → impl-MVGWE3OY.cjs} +2 -2
  87. package/dist/{impl-JYCFV5ST.cjs.map → impl-MVGWE3OY.cjs.map} +1 -1
  88. package/dist/{impl-CT62BE2Y.cjs → impl-N56GZUUE.cjs} +2 -2
  89. package/dist/{impl-CT62BE2Y.cjs.map → impl-N56GZUUE.cjs.map} +1 -1
  90. package/dist/{impl-XTEZTAM2.cjs → impl-NRVKZ6QP.cjs} +2 -2
  91. package/dist/{impl-XTEZTAM2.cjs.map → impl-NRVKZ6QP.cjs.map} +1 -1
  92. package/dist/{impl-NCT2NJ62.cjs → impl-O7M62JQO.cjs} +2 -2
  93. package/dist/{impl-NCT2NJ62.cjs.map → impl-O7M62JQO.cjs.map} +1 -1
  94. package/dist/{impl-DJ3SW7AG.cjs → impl-OXCKKL3L.cjs} +2 -2
  95. package/dist/impl-OXCKKL3L.cjs.map +1 -0
  96. package/dist/{impl-4EYSMS5J.cjs → impl-OYQLTGBY.cjs} +2 -2
  97. package/dist/{impl-4EYSMS5J.cjs.map → impl-OYQLTGBY.cjs.map} +1 -1
  98. package/dist/{impl-6OK7OVS6.cjs → impl-PNDNQD25.cjs} +2 -2
  99. package/dist/{impl-6OK7OVS6.cjs.map → impl-PNDNQD25.cjs.map} +1 -1
  100. package/dist/{impl-4QGHJNOF.cjs → impl-Q2JAFPV5.cjs} +2 -2
  101. package/dist/{impl-4QGHJNOF.cjs.map → impl-Q2JAFPV5.cjs.map} +1 -1
  102. package/dist/impl-Q6LOHZB6.cjs +2 -0
  103. package/dist/{impl-OEZVSI3U.cjs.map → impl-Q6LOHZB6.cjs.map} +1 -1
  104. package/dist/{impl-GSLBE3DP.cjs → impl-QS77O4PW.cjs} +2 -2
  105. package/dist/{impl-GSLBE3DP.cjs.map → impl-QS77O4PW.cjs.map} +1 -1
  106. package/dist/{impl-SQDB5BDK.cjs → impl-TC6DE6BU.cjs} +5 -5
  107. package/dist/impl-TC6DE6BU.cjs.map +1 -0
  108. package/dist/{impl-6CESPVNS.cjs → impl-W6WGF5YD.cjs} +2 -2
  109. package/dist/impl-W6WGF5YD.cjs.map +1 -0
  110. package/dist/{impl-JTBEG5AM.cjs → impl-WHZWURMO.cjs} +2 -2
  111. package/dist/impl-WHZWURMO.cjs.map +1 -0
  112. package/dist/{impl-AMXKTPKE.cjs → impl-WWQBCKZV.cjs} +2 -2
  113. package/dist/impl-WWQBCKZV.cjs.map +1 -0
  114. package/dist/{impl-VVADV3UA.cjs → impl-XWRII7ET.cjs} +2 -2
  115. package/dist/{impl-VVADV3UA.cjs.map → impl-XWRII7ET.cjs.map} +1 -1
  116. package/dist/index.cjs +3 -3
  117. package/dist/index.cjs.map +1 -1
  118. package/dist/index.d.cts +1 -1
  119. package/package.json +4 -2
  120. package/dist/chunk-3FEOMF7G.cjs +0 -2
  121. package/dist/chunk-6PCS4IRI.cjs.map +0 -1
  122. package/dist/chunk-7QV5QNGW.cjs.map +0 -1
  123. package/dist/chunk-AADFRD6P.cjs +0 -2
  124. package/dist/chunk-ASFWHSOV.cjs +0 -2
  125. package/dist/chunk-ASFWHSOV.cjs.map +0 -1
  126. package/dist/chunk-GZ2U36SS.cjs +0 -12
  127. package/dist/chunk-GZ2U36SS.cjs.map +0 -1
  128. package/dist/chunk-MPI5VURJ.cjs +0 -2920
  129. package/dist/chunk-MPI5VURJ.cjs.map +0 -1
  130. package/dist/chunk-SUCCU2FS.cjs.map +0 -1
  131. package/dist/chunk-V4X4IT3T.cjs +0 -2
  132. package/dist/chunk-V4X4IT3T.cjs.map +0 -1
  133. package/dist/chunk-VHQY7TSF.cjs +0 -3
  134. package/dist/chunk-VHQY7TSF.cjs.map +0 -1
  135. package/dist/chunk-ZVK4HIDF.cjs.map +0 -1
  136. package/dist/impl-4TMKRPWO.cjs +0 -2
  137. package/dist/impl-4TMKRPWO.cjs.map +0 -1
  138. package/dist/impl-6CESPVNS.cjs.map +0 -1
  139. package/dist/impl-AMXKTPKE.cjs.map +0 -1
  140. package/dist/impl-DHMLZZX7.cjs +0 -2
  141. package/dist/impl-DJ3SW7AG.cjs.map +0 -1
  142. package/dist/impl-EE72U2AE.cjs.map +0 -1
  143. package/dist/impl-HV2SRHDV.cjs.map +0 -1
  144. package/dist/impl-JTBEG5AM.cjs.map +0 -1
  145. package/dist/impl-L7AJQDYS.cjs +0 -2
  146. package/dist/impl-L7AJQDYS.cjs.map +0 -1
  147. package/dist/impl-OEZVSI3U.cjs +0 -2
  148. package/dist/impl-SCO4LJDB.cjs +0 -2
  149. package/dist/impl-SQDB5BDK.cjs.map +0 -1
  150. package/dist/impl-TVSTWXSI.cjs +0 -2
  151. package/dist/impl-ULAYJG2T.cjs +0 -6
  152. package/dist/impl-ULAYJG2T.cjs.map +0 -1
  153. package/dist/impl-WBR473NQ.cjs +0 -7
  154. package/dist/impl-WBR473NQ.cjs.map +0 -1
  155. package/dist/impl-WKWQYPI4.cjs +0 -6
  156. package/dist/impl-WKWQYPI4.cjs.map +0 -1
  157. package/dist/impl-YVMYL724.cjs +0 -12
  158. package/dist/impl-YVMYL724.cjs.map +0 -1
  159. package/dist/impl-ZFJM6LMZ.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 _chunkVHQY7TSFcjs = require('./chunk-VHQY7TSF.cjs');var _chunk7QV5QNGWcjs = require('./chunk-7QV5QNGW.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkNKVC5Y53cjs = require('./chunk-NKVC5Y53.cjs');var _chunkTD7ADMVOcjs = require('./chunk-TD7ADMVO.cjs');var _chunkSUCCU2FScjs = require('./chunk-SUCCU2FS.cjs');var _chunkASFWHSOVcjs = require('./chunk-ASFWHSOV.cjs');var _chunkAADFRD6Pcjs = require('./chunk-AADFRD6P.cjs');var _chunkZVK4HIDFcjs = require('./chunk-ZVK4HIDF.cjs');var _chunkGZ2U36SScjs = require('./chunk-GZ2U36SS.cjs');var _chunkV4X4IT3Tcjs = require('./chunk-V4X4IT3T.cjs');var _chunk3FEOMF7Gcjs = require('./chunk-3FEOMF7G.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');var _chunkMPI5VURJcjs = require('./chunk-MPI5VURJ.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkKC7NDLN7cjs = require('./chunk-KC7NDLN7.cjs');var _chunk3EZGFSMDcjs = require('./chunk-3EZGFSMD.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 $(a){let e=[],r=0,t=!1;do{let{largeLanguageModels:{nodes:s}}=await _chunkMPI5VURJcjs.cc.call(void 0, a,_chunkMPI5VURJcjs.Hb,{first:T,offset:r});e.push(...s),r+=T,t=s.length===T}while(t);return e.sort((s,o)=>s.name.localeCompare(o.name))}function j(a){return new RegExp(`<${a}>([\\s\\S]+?)<\\/${a}>`)}function Cm(a){return a}var H=a=>{try{return JSON.parse(a)}catch (e2){return a}},F= exports.TranscendPromptManager = (_class =class{__init() {this.largeLanguageModels=[]}__init2() {this.agentsByName={}}__init3() {this.agentsByAgentId={}}constructor({prompts:e,handlebarsOptions:r={},transcendUrl:t=_chunkKC7NDLN7cjs.e,transcendApiKey:s,requireApproval:o=!0,cacheDuration:i,defaultVariables:p={}}){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);this.prompts=e,this.transcendUrl=t,this.transcendApiKey=s,this.variables=p,this.defaultVariables=p,this.graphQLClient=_chunkMPI5VURJcjs.Wd.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=_chunk3EZGFSMDcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunkMPI5VURJcjs.Gc.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),$(this.graphQLClient),_chunkMPI5VURJcjs.md.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunk3EZGFSMDcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunk3EZGFSMDcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunk3EZGFSMDcjs.e.call(void 0, o.prompts,"title"),c=_chunk3EZGFSMDcjs.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 _chunkMPI5VURJcjs.md.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 _chunkMPI5VURJcjs.re.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=[]}=_chunk3EZGFSMDcjs.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=_chunk3EZGFSMDcjs.b.call(void 0, t,50),i=[];return await _chunkMPI5VURJcjs.a.call(void 0, o,async p=>{let m=await _chunkMPI5VURJcjs.md.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 _chunkMPI5VURJcjs.Bd.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 _chunkMPI5VURJcjs.Ie.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 _chunkMPI5VURJcjs.Ie.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 _chunkMPI5VURJcjs.Ie.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 Lm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function Em(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 Sm({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 _chunkA4OQQVQTcjs = require('./chunk-A4OQQVQT.cjs');var _chunkXARKMCNPcjs = require('./chunk-XARKMCNP.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkN7QF44VWcjs = require('./chunk-N7QF44VW.cjs');var _chunkTD7ADMVOcjs = require('./chunk-TD7ADMVO.cjs');var _chunkSW5CIF5Dcjs = require('./chunk-SW5CIF5D.cjs');var _chunkW3S3ULXNcjs = require('./chunk-W3S3ULXN.cjs');var _chunkYMXQXAUZcjs = require('./chunk-YMXQXAUZ.cjs');var _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunkPQTI6C4Qcjs = require('./chunk-PQTI6C4Q.cjs');var _chunkBPX6MSMCcjs = require('./chunk-BPX6MSMC.cjs');var _chunk7UL54E7Xcjs = require('./chunk-7UL54E7X.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');var _chunkUONUI4ABcjs = require('./chunk-UONUI4AB.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkXPKFB4ILcjs = require('./chunk-XPKFB4IL.cjs');var _chunk44J2TVZUcjs = require('./chunk-44J2TVZU.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 _chunkUONUI4ABcjs.ac.call(void 0, a,_chunkUONUI4ABcjs.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 Cm(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=_chunkXPKFB4ILcjs.e,transcendApiKey:s,requireApproval:o=!0,cacheDuration:i,defaultVariables:p={}}){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);this.prompts=e,this.transcendUrl=t,this.transcendApiKey=s,this.variables=p,this.defaultVariables=p,this.graphQLClient=_chunkUONUI4ABcjs.Ud.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=_chunk44J2TVZUcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunkUONUI4ABcjs.Ec.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),D(this.graphQLClient),_chunkUONUI4ABcjs.kd.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunk44J2TVZUcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunk44J2TVZUcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunk44J2TVZUcjs.e.call(void 0, o.prompts,"title"),c=_chunk44J2TVZUcjs.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 _chunkUONUI4ABcjs.kd.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 _chunkUONUI4ABcjs.pe.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=[]}=_chunk44J2TVZUcjs.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=_chunk44J2TVZUcjs.b.call(void 0, t,50),i=[];return await _bluebird.mapSeries.call(void 0, o,async p=>{let m=await _chunkUONUI4ABcjs.kd.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 _chunkUONUI4ABcjs.zd.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 _chunkUONUI4ABcjs.Ge.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 _chunkUONUI4ABcjs.Ge.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 _chunkUONUI4ABcjs.Ge.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 Lm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function Em(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 Sm({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=_chunk3EZGFSMDcjs.c.call(void 0, p.split(`
4
- `).filter(d=>d),s),c=t.length>0?_fastglob2.default.sync(m,{ignore:t}):m,n={};c.forEach(d=>{let Q=_child_process.execSync.call(void 0, `git show ${i}:${d}`,{encoding:"utf-8"});n[d]=Q});let g=r.split("/").pop().split(".")[0];return{changedFiles:m,fileDiffs:n,repoName:g,commit:i}}exports.ACTIONS = _chunkMPI5VURJcjs.vb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunkMPI5VURJcjs.Ia; exports.ADD_SILO_DISCOVERY_RESULTS = _chunkMPI5VURJcjs.I; exports.ADMIN_DASH = _chunkKC7NDLN7cjs.b; exports.ADMIN_DASH_DATAPOINTS = _chunkKC7NDLN7cjs.d; exports.ADMIN_DASH_INTEGRATIONS = _chunkKC7NDLN7cjs.c; exports.AGENTS = _chunkMPI5VURJcjs.Ib; exports.AGENT_FILES = _chunkMPI5VURJcjs.Lb; exports.AGENT_FUNCTIONS = _chunkMPI5VURJcjs.Ob; exports.API_KEYS = _chunkMPI5VURJcjs.F; exports.APPROVE_PRIVACY_REQUEST = _chunkMPI5VURJcjs.Y; exports.ASSESSMENTS = _chunkMPI5VURJcjs.ga; exports.ASSESSMENT_SECTION_FIELDS = _chunkMPI5VURJcjs.fa; exports.ASSESSMENT_TEMPLATES = _chunkMPI5VURJcjs.ka; exports.ASSUME_ROLE = _chunkMPI5VURJcjs.Gb; exports.ATTRIBUTES = _chunkMPI5VURJcjs.Ma; exports.ATTRIBUTE_KEYS_REQUESTS = _chunkMPI5VURJcjs.N; exports.ATTRIBUTE_VALUES = _chunkMPI5VURJcjs.Qa; 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 = _chunkMPI5VURJcjs.Ce; exports.AssessmentAnswerOptionInput = _chunkQEM6S2W7cjs.Y; exports.AssessmentDisplayLogicInput = _chunkQEM6S2W7cjs.V; exports.AssessmentInput = _chunkQEM6S2W7cjs.ca; exports.AssessmentNestedRule = _chunkMPI5VURJcjs.Be; exports.AssessmentNestedRuleInput = _chunkQEM6S2W7cjs.U; exports.AssessmentResourceInput = _chunkQEM6S2W7cjs.ba; exports.AssessmentRetentionScheduleInput = _chunkQEM6S2W7cjs.$; exports.AssessmentRiskLogic = _chunkMPI5VURJcjs.Ee; exports.AssessmentRule = _chunkMPI5VURJcjs.Ae; exports.AssessmentRuleInput = _chunkQEM6S2W7cjs.T; exports.AssessmentSectionInput = _chunkQEM6S2W7cjs._; exports.AssessmentSectionQuestionInput = _chunkQEM6S2W7cjs.Z; exports.AssessmentTemplateInput = _chunkQEM6S2W7cjs.aa; exports.AttestedExtraIdentifiers = _chunk3FEOMF7Gcjs.w; exports.AttributeInput = _chunkQEM6S2W7cjs.k; exports.AttributePreview = _chunkQEM6S2W7cjs.l; exports.AttributeValueInput = _chunkQEM6S2W7cjs.j; exports.BLANK = _chunk3FEOMF7Gcjs.c; exports.BULK_APPLY = _chunk3FEOMF7Gcjs.b; exports.BULK_REQUEST_FILES = _chunkMPI5VURJcjs.Ga; exports.BUSINESS_ENTITIES = _chunkMPI5VURJcjs.sb; exports.BusinessEntityInput = _chunkQEM6S2W7cjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunkMPI5VURJcjs.Z; exports.CAN_APPLY_IN_BULK = _chunk3FEOMF7Gcjs.g; exports.CATALOGS = _chunkMPI5VURJcjs.t; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunkMPI5VURJcjs.wa; exports.CODE_PACKAGES = _chunkMPI5VURJcjs.R; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunkMPI5VURJcjs.rb; exports.CONSENT_PARTITIONS = _chunkMPI5VURJcjs.Va; exports.COOKIES = _chunkMPI5VURJcjs._a; exports.CREATE_ACTION_ITEMS = _chunkMPI5VURJcjs.zb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunkMPI5VURJcjs.Ka; exports.CREATE_AGENT = _chunkMPI5VURJcjs.Jb; exports.CREATE_AGENT_FILE = _chunkMPI5VURJcjs.Mb; exports.CREATE_AGENT_FUNCTION = _chunkMPI5VURJcjs.Pb; exports.CREATE_API_KEY = _chunkMPI5VURJcjs.G; exports.CREATE_ATTRIBUTE = _chunkMPI5VURJcjs.Ra; exports.CREATE_ATTRIBUTE_VALUES = _chunkMPI5VURJcjs.Na; exports.CREATE_BUSINESS_ENTITY = _chunkMPI5VURJcjs.tb; exports.CREATE_CODE_PACKAGE = _chunkMPI5VURJcjs.T; exports.CREATE_CONSENT_EXPERIENCE = _chunkMPI5VURJcjs.pb; exports.CREATE_CONSENT_MANAGER = _chunkMPI5VURJcjs.cb; exports.CREATE_CONSENT_PARTITION = _chunkMPI5VURJcjs.qb; exports.CREATE_DATA_FLOWS = _chunkMPI5VURJcjs.Wa; exports.CREATE_DATA_SILOS = _chunkMPI5VURJcjs.o; exports.CREATE_DATA_SUBJECT = _chunkMPI5VURJcjs.z; exports.CREATE_DATA_SUB_CATEGORY = _chunkMPI5VURJcjs.Vb; exports.CREATE_ENRICHER = _chunkMPI5VURJcjs.r; exports.CREATE_IDENTIFIER = _chunkMPI5VURJcjs.w; exports.CREATE_PROCESSING_ACTIVITY = _chunkMPI5VURJcjs.$b; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunkMPI5VURJcjs.Yb; exports.CREATE_PROMPT = _chunkMPI5VURJcjs.qa; exports.CREATE_PROMPT_GROUP = _chunkMPI5VURJcjs.ua; exports.CREATE_PROMPT_PARTIAL = _chunkMPI5VURJcjs.sa; exports.CREATE_REPOSITORY = _chunkMPI5VURJcjs.E; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunkMPI5VURJcjs.Q; exports.CREATE_TEAM = _chunkMPI5VURJcjs.Aa; exports.CREATE_TEMPLATE = _chunkMPI5VURJcjs.L; exports.CREATE_VENDOR = _chunkMPI5VURJcjs.Sb; exports.CachedFileState = _chunk3FEOMF7Gcjs.h; exports.CachedRequestState = _chunk3FEOMF7Gcjs.j; exports.CodePackageInput = _chunkQEM6S2W7cjs.D; exports.CodePackageSdk = _chunkQEM6S2W7cjs.C; exports.ColumnName = _chunk3FEOMF7Gcjs.e; exports.ConsentManageExperienceInput = _chunkQEM6S2W7cjs.K; exports.ConsentManagerInput = _chunkQEM6S2W7cjs.M; exports.ConsentManagerMetricBin = _chunkMPI5VURJcjs.wc; exports.ConsentManagerServiceMetadata = _chunkQEM6S2W7cjs.ka; exports.ConsentPreferenceResponse = _chunkGZ2U36SScjs.i; exports.ConsentPreferenceTopic = _chunkQEM6S2W7cjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkQEM6S2W7cjs.da; exports.ConsentPurpose = _chunkQEM6S2W7cjs.fa; exports.CookieCsvInput = _chunkQEM6S2W7cjs.ja; exports.CookieInput = _chunkQEM6S2W7cjs.J; exports.CronIdentifier = _chunkAADFRD6Pcjs.a; exports.CronIdentifierPush = _chunkAADFRD6Pcjs.c; exports.DATAPOINT_EXPORT = _chunkMPI5VURJcjs.i; exports.DATA_FLOWS = _chunkMPI5VURJcjs.Za; exports.DATA_POINTS = _chunkMPI5VURJcjs.c; exports.DATA_POINT_COUNT = _chunkMPI5VURJcjs.d; exports.DATA_SILOS = _chunkMPI5VURJcjs.k; exports.DATA_SILOS_ENRICHED = _chunkMPI5VURJcjs.m; exports.DATA_SILO_EXPORT = _chunkMPI5VURJcjs.l; exports.DATA_SUBJECTS = _chunkMPI5VURJcjs.y; exports.DATA_SUB_CATEGORIES = _chunkMPI5VURJcjs.Ub; exports.DEFAULT_TRANSCEND_API = _chunkKC7NDLN7cjs.e; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkKC7NDLN7cjs.f; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunkMPI5VURJcjs.Ge; exports.DELETE_API_KEY = _chunkMPI5VURJcjs.H; exports.DELETE_ATTRIBUTE_VALUE = _chunkMPI5VURJcjs.Pa; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunkMPI5VURJcjs.Bb; exports.DEPLOY_CONSENT_MANAGER = _chunkMPI5VURJcjs.fb; exports.DETERMINE_LOGIN_METHOD = _chunkMPI5VURJcjs.Eb; 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 = _chunkMPI5VURJcjs.J; exports.ENRICHERS = _chunkMPI5VURJcjs.p; exports.ENTRY_COUNT = _chunkMPI5VURJcjs.j; exports.EXPERIENCES = _chunkMPI5VURJcjs.Ua; exports.EnrichPrivacyRequest = _chunkVHQY7TSFcjs.b; exports.EnricherInput = _chunkQEM6S2W7cjs.e; exports.FETCH_CONSENT_MANAGER = _chunkMPI5VURJcjs.ab; exports.FETCH_CONSENT_MANAGER_ID = _chunkMPI5VURJcjs.$a; exports.FETCH_CONSENT_MANAGER_THEME = _chunkMPI5VURJcjs.bb; exports.FETCH_PRIVACY_CENTER_ID = _chunkMPI5VURJcjs.Ab; exports.FieldInput = _chunkQEM6S2W7cjs.v; exports.GLOBAL_ACTION_ITEMS = _chunkMPI5VURJcjs.xb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunkMPI5VURJcjs.Ja; exports.IDENTIFIERS = _chunkMPI5VURJcjs.u; exports.IDENTIFIER_BLOCK_LIST = _chunk3FEOMF7Gcjs.d; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunkMPI5VURJcjs.ha; exports.INITIALIZER = _chunkMPI5VURJcjs.q; exports.IP_ADDRESS_REGEX = _chunkGZ2U36SScjs.f; exports.IS_REQUIRED = _chunk3FEOMF7Gcjs.f; exports.IdentifierInput = _chunkQEM6S2W7cjs.H; exports.ImportOnetrustAssessmentsInput = _chunkQEM6S2W7cjs.ra; exports.IntlMessage = _chunk3FEOMF7Gcjs.A; exports.IntlMessageInput = _chunkQEM6S2W7cjs.P; exports.LARGE_LANGUAGE_MODELS = _chunkMPI5VURJcjs.Hb; exports.LOGIN = _chunkMPI5VURJcjs.Fb; exports.MESSAGES = _chunkMPI5VURJcjs.aa; exports.NEW_IDENTIFIER_TYPES = _chunkMPI5VURJcjs.v; exports.NONE = _chunk3FEOMF7Gcjs.a; exports.NOTIFY_ADDITIONAL_TIME = _chunkMPI5VURJcjs.$; exports.ORGANIZATION = _chunkMPI5VURJcjs.M; 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 = _chunkMPI5VURJcjs.V; exports.PREFERENCE_TOPICS = _chunkMPI5VURJcjs.ja; exports.PRIVACY_CENTER = _chunkMPI5VURJcjs.Cb; exports.PROCESSING_ACTIVITIES = _chunkMPI5VURJcjs._b; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkMPI5VURJcjs.Xb; exports.PROMPTS = _chunkMPI5VURJcjs.la; exports.PROMPTS_WITH_VARIABLES = _chunkMPI5VURJcjs.oa; exports.PROMPT_GROUPS = _chunkMPI5VURJcjs.na; exports.PROMPT_PARTIALS = _chunkMPI5VURJcjs.ma; exports.PROMPT_THREADS = _chunkMPI5VURJcjs.U; exports.PURPOSES = _chunkMPI5VURJcjs.ia; exports.ParsedAttributeInput = _chunk3FEOMF7Gcjs.o; 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 = _chunkMPI5VURJcjs.me; exports.PrivacyRequestInput = _chunk3FEOMF7Gcjs.x; exports.PrivacyRequestResponse = _chunk3FEOMF7Gcjs.G; 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 = _chunkV4X4IT3Tcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunkMPI5VURJcjs.ya; exports.REMOVE_REQUEST_IDENTIFIERS = _chunkMPI5VURJcjs.Ca; exports.REPORT_PROMPT_RUN = _chunkMPI5VURJcjs.Ha; exports.REPOSITORIES = _chunkMPI5VURJcjs.C; exports.REQUESTS = _chunkMPI5VURJcjs.X; exports.REQUEST_DATA_SILOS = _chunkMPI5VURJcjs.va; exports.REQUEST_ENRICHERS = _chunkMPI5VURJcjs.ca; exports.REQUEST_FILES = _chunkMPI5VURJcjs.Fa; exports.REQUEST_IDENTIFIERS = _chunkMPI5VURJcjs.Da; exports.RETRY_REQUEST_DATA_SILO = _chunkMPI5VURJcjs.xa; exports.RETRY_REQUEST_ENRICHER = _chunkMPI5VURJcjs.da; exports.RegionInput = _chunkQEM6S2W7cjs.z; exports.RepositoryInput = _chunkQEM6S2W7cjs.E; exports.RequestFileMetadata = _chunk3FEOMF7Gcjs.B; exports.RequestFileMetadataResponse = _chunk3FEOMF7Gcjs.C; exports.RequestIdentifiersResponse = _chunkMPI5VURJcjs.ke; exports.RiskAssignmentInput = _chunkQEM6S2W7cjs.W; exports.RiskLogicInput = _chunkQEM6S2W7cjs.X; exports.SCOPES_BY_TITLE = _chunkKC7NDLN7cjs.j; exports.SCOPE_TITLES = _chunkKC7NDLN7cjs.k; exports.SET_RESOURCE_ATTRIBUTES = _chunkMPI5VURJcjs.Ta; exports.SKIP_REQUEST_ENRICHER = _chunkMPI5VURJcjs.ea; exports.SOFTWARE_DEVELOPMENT_KITS = _chunkMPI5VURJcjs.O; exports.SOMBRA_VERSION = _chunkMPI5VURJcjs.bc; exports.SUB_DATA_POINTS = _chunkMPI5VURJcjs.e; exports.SUB_DATA_POINTS_COUNT = _chunkMPI5VURJcjs.f; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunkMPI5VURJcjs.g; exports.SYNC_ATTRIBUTE_TYPES = _chunkMPI5VURJcjs.Yc; exports.SoftwareDevelopmentKitInput = _chunkQEM6S2W7cjs.B; exports.StoredApiKey = _chunkQEM6S2W7cjs.ha; exports.SuccessfulRequest = _chunk3FEOMF7Gcjs.i; exports.TEAMS = _chunkMPI5VURJcjs.za; exports.TEMPLATES = _chunkMPI5VURJcjs.K; exports.TOGGLE_CONSENT_PRECEDENCE = _chunkMPI5VURJcjs.mb; exports.TOGGLE_DATA_SUBJECT = _chunkMPI5VURJcjs.B; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunkMPI5VURJcjs.lb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunkMPI5VURJcjs.kb; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunkMPI5VURJcjs.jb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkKC7NDLN7cjs.h; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkKC7NDLN7cjs.g; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkKC7NDLN7cjs.i; exports.TeamInput = _chunkQEM6S2W7cjs.d; exports.TemplateInput = _chunkQEM6S2W7cjs.a; exports.TranscendInput = _chunkQEM6S2W7cjs.ga; exports.TranscendPromptManager = F; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunkMPI5VURJcjs.wb; exports.UPDATE_ACTION_ITEMS = _chunkMPI5VURJcjs.yb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunkMPI5VURJcjs.La; exports.UPDATE_AGENTS = _chunkMPI5VURJcjs.Kb; exports.UPDATE_AGENT_FILES = _chunkMPI5VURJcjs.Nb; exports.UPDATE_AGENT_FUNCTIONS = _chunkMPI5VURJcjs.Qb; exports.UPDATE_ATTRIBUTE = _chunkMPI5VURJcjs.Sa; exports.UPDATE_ATTRIBUTE_VALUES = _chunkMPI5VURJcjs.Oa; exports.UPDATE_BUSINESS_ENTITIES = _chunkMPI5VURJcjs.ub; exports.UPDATE_CODE_PACKAGES = _chunkMPI5VURJcjs.S; exports.UPDATE_CONSENT_EXPERIENCE = _chunkMPI5VURJcjs.ob; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunkMPI5VURJcjs.gb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunkMPI5VURJcjs.hb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunkMPI5VURJcjs.nb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunkMPI5VURJcjs.eb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunkMPI5VURJcjs.db; exports.UPDATE_DATA_FLOWS = _chunkMPI5VURJcjs.Xa; exports.UPDATE_DATA_SILOS = _chunkMPI5VURJcjs.n; exports.UPDATE_DATA_SUBJECT = _chunkMPI5VURJcjs.A; exports.UPDATE_DATA_SUB_CATEGORIES = _chunkMPI5VURJcjs.Wb; exports.UPDATE_ENRICHER = _chunkMPI5VURJcjs.s; exports.UPDATE_IDENTIFIER = _chunkMPI5VURJcjs.x; exports.UPDATE_INTL_MESSAGES = _chunkMPI5VURJcjs.ba; exports.UPDATE_LOAD_OPTIONS = _chunkMPI5VURJcjs.ib; exports.UPDATE_OR_CREATE_COOKIES = _chunkMPI5VURJcjs.Ya; exports.UPDATE_OR_CREATE_DATA_POINT = _chunkMPI5VURJcjs.h; exports.UPDATE_POLICIES = _chunkMPI5VURJcjs.W; exports.UPDATE_PRIVACY_CENTER = _chunkMPI5VURJcjs.Db; exports.UPDATE_PRIVACY_REQUEST = _chunkMPI5VURJcjs._; exports.UPDATE_PROCESSING_ACTIVITIES = _chunkMPI5VURJcjs.ac; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkMPI5VURJcjs.Zb; exports.UPDATE_PROMPTS = _chunkMPI5VURJcjs.pa; exports.UPDATE_PROMPT_GROUPS = _chunkMPI5VURJcjs.ta; exports.UPDATE_PROMPT_PARTIALS = _chunkMPI5VURJcjs.ra; exports.UPDATE_REPOSITORIES = _chunkMPI5VURJcjs.D; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunkMPI5VURJcjs.P; exports.UPDATE_TEAM = _chunkMPI5VURJcjs.Ba; exports.UPDATE_VENDORS = _chunkMPI5VURJcjs.Tb; exports.USERS = _chunkMPI5VURJcjs.Ea; exports.USP_STRING_REGEX = _chunkV4X4IT3Tcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkSUCCU2FScjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkSUCCU2FScjs.a; exports.VENDORS = _chunkMPI5VURJcjs.Rb; exports.VendorInput = _chunkQEM6S2W7cjs.p; exports.WebhookHeader = _chunkQEM6S2W7cjs.b; exports.addMessagesToPromptRun = _chunkMPI5VURJcjs.Ud; exports.appendCsvSync = _chunkZVK4HIDFcjs.b; exports.approvePrivacyRequests = _chunk3FEOMF7Gcjs.I; exports.assumeRole = _chunkMPI5VURJcjs.xe; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunkMPI5VURJcjs.Wd; exports.buildTranscendGraphQLClientGeneric = _chunkMPI5VURJcjs.Vd; exports.buildXdiSyncEndpoint = _chunkGZ2U36SScjs.g; exports.bulkRestartRequests = _chunk3FEOMF7Gcjs.Q; exports.bulkRetryEnrichers = _chunk3FEOMF7Gcjs.S; exports.cancelPrivacyRequests = _chunk3FEOMF7Gcjs.L; exports.consentManagersToBusinessEntities = _chunkGZ2U36SScjs.h; exports.convertToDataSubjectAllowlist = _chunkMPI5VURJcjs.mc; exports.convertToDataSubjectBlockList = _chunkMPI5VURJcjs.lc; exports.createActionItemCollection = _chunkMPI5VURJcjs.qd; exports.createActionItems = _chunkMPI5VURJcjs.ud; exports.createAgent = _chunkMPI5VURJcjs.nd; exports.createAgentFile = _chunkMPI5VURJcjs.Cd; exports.createAgentFunction = _chunkMPI5VURJcjs.yd; exports.createApiKey = _chunkMPI5VURJcjs.ye; exports.createBusinessEntity = _chunkMPI5VURJcjs.$c; exports.createCodePackage = _chunkMPI5VURJcjs.Re; exports.createConsentToken = _chunkV4X4IT3Tcjs.a; exports.createDataCategory = _chunkMPI5VURJcjs.Kd; exports.createDataFlows = _chunkMPI5VURJcjs.ed; exports.createProcessingPurpose = _chunkMPI5VURJcjs.Od; exports.createPrompt = _chunkMPI5VURJcjs.Hc; exports.createRegexForTag = j; exports.createRepository = _chunkMPI5VURJcjs.Oe; exports.createSoftwareDevelopmentKit = _chunkMPI5VURJcjs.Le; exports.createSombraGotInstance = _chunkMPI5VURJcjs.Xd; exports.createTranscendConsentGotInstance = _chunkMPI5VURJcjs.Yd; exports.createVendor = _chunkMPI5VURJcjs.Gd; exports.defineTranscendPrompts = Cm; exports.deleteApiKey = _chunkMPI5VURJcjs.ze; exports.deployConsentManager = _chunkMPI5VURJcjs.Zd; exports.description = _chunk3EZGFSMDcjs.l; exports.domainToHost = _chunkGZ2U36SScjs.e; exports.downloadPrivacyRequestFiles = _chunk3FEOMF7Gcjs.F; exports.enrichPrivacyRequest = _chunkVHQY7TSFcjs.c; exports.ensureAllDataSubjectsExist = _chunkMPI5VURJcjs.kc; exports.extractClientError = _chunk3FEOMF7Gcjs.N; exports.fetchActiveSiloDiscoPlugin = _chunkMPI5VURJcjs.$d; exports.fetchAllActionItems = _chunkMPI5VURJcjs.td; exports.fetchAllActions = _chunkMPI5VURJcjs.jd; exports.fetchAllAgentFiles = _chunkMPI5VURJcjs.Bd; exports.fetchAllAgentFunctions = _chunkMPI5VURJcjs.xd; exports.fetchAllAgents = _chunkMPI5VURJcjs.md; exports.fetchAllApiKeys = _chunkMPI5VURJcjs.Dc; exports.fetchAllAssessmentTemplates = _chunkMPI5VURJcjs.be; exports.fetchAllAssessments = _chunkMPI5VURJcjs.ae; exports.fetchAllAttributeValues = _chunkMPI5VURJcjs.Xc; exports.fetchAllAttributes = _chunkMPI5VURJcjs.Zc; exports.fetchAllBusinessEntities = _chunkMPI5VURJcjs._c; exports.fetchAllCatalogs = _chunkMPI5VURJcjs.pe; exports.fetchAllCookies = _chunkMPI5VURJcjs.de; exports.fetchAllDataCategories = _chunkMPI5VURJcjs.Jd; exports.fetchAllDataFlows = _chunkMPI5VURJcjs.cd; exports.fetchAllDataPoints = _chunkMPI5VURJcjs.pc; exports.fetchAllDataSilos = _chunkMPI5VURJcjs.nc; exports.fetchAllDataSubjects = _chunkMPI5VURJcjs.jc; exports.fetchAllEnrichers = _chunkMPI5VURJcjs.gc; exports.fetchAllIdentifiers = _chunkMPI5VURJcjs.dc; exports.fetchAllMessages = _chunkMPI5VURJcjs.ee; exports.fetchAllPolicies = _chunkMPI5VURJcjs.Mc; exports.fetchAllPreferenceTopics = _chunkMPI5VURJcjs.fe; exports.fetchAllPrivacyCenters = _chunkMPI5VURJcjs.ge; exports.fetchAllProcessingActivities = _chunkMPI5VURJcjs.Rd; exports.fetchAllProcessingPurposes = _chunkMPI5VURJcjs.Nd; exports.fetchAllPromptGroups = _chunkMPI5VURJcjs.ld; exports.fetchAllPromptPartials = _chunkMPI5VURJcjs.kd; exports.fetchAllPromptThreads = _chunkMPI5VURJcjs.re; exports.fetchAllPrompts = _chunkMPI5VURJcjs.Fc; exports.fetchAllPurposes = _chunkMPI5VURJcjs.Uc; exports.fetchAllPurposesAndPreferences = _chunkMPI5VURJcjs.he; exports.fetchAllRequestAttributeKeys = _chunkMPI5VURJcjs.ce; exports.fetchAllRequestEnrichers = _chunkMPI5VURJcjs.ie; exports.fetchAllRequestIdentifierMetadata = _chunkMPI5VURJcjs.je; exports.fetchAllRequestIdentifiers = _chunkMPI5VURJcjs.le; exports.fetchAllRequests = _chunkMPI5VURJcjs.ne; exports.fetchAllSubDataPoints = _chunkMPI5VURJcjs.oc; exports.fetchAllTeams = _chunkMPI5VURJcjs.Bc; exports.fetchAllTemplates = _chunkMPI5VURJcjs.hd; exports.fetchAllUsers = _chunkMPI5VURJcjs.oe; exports.fetchAllVendors = _chunkMPI5VURJcjs.Fd; exports.fetchAndIndexCatalogs = _chunkMPI5VURJcjs.qe; exports.fetchApiKeys = _chunkMPI5VURJcjs.Ec; exports.fetchConsentManager = _chunkMPI5VURJcjs.tc; exports.fetchConsentManagerAnalyticsData = _chunkMPI5VURJcjs.xc; exports.fetchConsentManagerExperiences = _chunkMPI5VURJcjs.vc; exports.fetchConsentManagerId = _chunkMPI5VURJcjs.uc; exports.fetchConsentManagerTheme = _chunkMPI5VURJcjs.yc; exports.fetchConsentPreferences = _chunkGZ2U36SScjs.j; exports.fetchEnrichedDataSilos = _chunkMPI5VURJcjs.qc; exports.fetchIdentifiersAndCreateMissing = _chunkMPI5VURJcjs.ec; exports.fetchPartitions = _chunkMPI5VURJcjs.Sc; exports.fetchPrivacyCenterId = _chunkMPI5VURJcjs.Lc; exports.fetchPrivacyCenterUrl = _chunkMPI5VURJcjs.Kc; exports.fetchPromptsWithVariables = _chunkMPI5VURJcjs.Gc; exports.fetchRequestDataSilo = _chunkMPI5VURJcjs.te; exports.fetchRequestDataSiloActiveCount = _chunkMPI5VURJcjs.ue; exports.fetchRequestDataSilos = _chunkMPI5VURJcjs.se; exports.fetchRequestFilesForRequest = _chunkMPI5VURJcjs.ve; exports.filterNullishValuesFromObject = Em; exports.filterRows = _chunk3FEOMF7Gcjs.s; exports.fuzzyMatchColumns = _chunk3FEOMF7Gcjs.l; exports.fuzzySearch = _chunk3FEOMF7Gcjs.k; exports.generateCrossAccountApiKeys = _chunkASFWHSOVcjs.a; exports.getFileMetadataForPrivacyRequests = _chunk3FEOMF7Gcjs.D; exports.getGitFilesThatChanged = Sm; exports.getUniqueValuesForColumn = _chunk3FEOMF7Gcjs.r; exports.inquirerAutoComplete = _chunkNKVC5Y53cjs.c; exports.inquirerConfirmBoolean = _chunkNKVC5Y53cjs.a; exports.inquirerConfirmText = _chunkNKVC5Y53cjs.b; exports.listDirectories = _chunkASFWHSOVcjs.d; exports.listFiles = _chunkASFWHSOVcjs.c; exports.loginUser = _chunkMPI5VURJcjs.we; exports.makeGraphQLRequest = _chunkMPI5VURJcjs.cc; exports.mapColumnsToAttributes = _chunk3FEOMF7Gcjs.M; exports.mapColumnsToIdentifiers = _chunk3FEOMF7Gcjs.K; exports.mapCsvColumnsToApi = _chunk3FEOMF7Gcjs.u; exports.mapCsvRowsToRequestInputs = _chunk3FEOMF7Gcjs.z; exports.mapEnumValues = _chunk3FEOMF7Gcjs.m; exports.mapRequestEnumValues = _chunk3FEOMF7Gcjs.v; exports.markCronIdentifierCompleted = _chunkAADFRD6Pcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkAADFRD6Pcjs.f; exports.markSilentPrivacyRequests = _chunk3FEOMF7Gcjs.t; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkKC7NDLN7cjs.a; exports.normalizeIdentifierValue = _chunk3FEOMF7Gcjs.y; exports.notifyPrivacyRequestsAdditionalTime = _chunk3FEOMF7Gcjs.J; exports.parseAssessmentDisplayLogic = _chunkMPI5VURJcjs.De; exports.parseAssessmentRiskLogic = _chunkMPI5VURJcjs.Fe; exports.parseAttributesFromString = _chunk3FEOMF7Gcjs.p; exports.parseFilePath = _chunkZVK4HIDFcjs.d; exports.parseVariablesFromString = _chunkTD7ADMVOcjs.a; exports.pullAllDatapoints = _chunk7QV5QNGWcjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkAADFRD6Pcjs.g; exports.pullConsentManagerMetrics = _chunkGZ2U36SScjs.d; exports.pullCronPageOfIdentifiers = _chunkAADFRD6Pcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkVHQY7TSFcjs.a; exports.pullPrivacyRequests = _chunk3FEOMF7Gcjs.U; exports.pullTranscendConfiguration = _chunkMPI5VURJcjs.He; exports.pullUnstructuredSubDataPointRecommendations = _chunk7QV5QNGWcjs.b; exports.pushCronIdentifiersFromCsv = _chunkAADFRD6Pcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkVHQY7TSFcjs.d; exports.readCsv = _chunk3FEOMF7Gcjs.q; exports.readTranscendYaml = _chunkSUCCU2FScjs.d; exports.removeLinks = Lm; exports.removeUnverifiedRequestIdentifiers = _chunk3FEOMF7Gcjs.W; exports.replaceVariablesInYaml = _chunkSUCCU2FScjs.c; exports.reportPromptRun = _chunkMPI5VURJcjs.Ie; exports.restartPrivacyRequest = _chunk3FEOMF7Gcjs.P; exports.retryRequestDataSilos = _chunk3FEOMF7Gcjs.T; exports.retryRequestEnricher = _chunkMPI5VURJcjs.Je; exports.setResourceAttributes = _chunkMPI5VURJcjs.Ke; exports.skipPreflightJobs = _chunk3FEOMF7Gcjs.R; exports.skipRequestDataSilos = _chunk3FEOMF7Gcjs.V; exports.splitCsvToList = _chunk3FEOMF7Gcjs.n; exports.streamPrivacyRequestFiles = _chunk3FEOMF7Gcjs.E; exports.submitPrivacyRequest = _chunk3FEOMF7Gcjs.H; exports.syncAction = _chunkMPI5VURJcjs.gd; exports.syncActionItemCollections = _chunkMPI5VURJcjs.sd; exports.syncActionItems = _chunkMPI5VURJcjs.wd; exports.syncAgentFiles = _chunkMPI5VURJcjs.Ed; exports.syncAgentFunctions = _chunkMPI5VURJcjs.Ad; exports.syncAgents = _chunkMPI5VURJcjs.pd; exports.syncAttribute = _chunkMPI5VURJcjs.ic; exports.syncBusinessEntities = _chunkMPI5VURJcjs.bd; exports.syncCodePackages = _chunkMPI5VURJcjs.Te; exports.syncConfigurationToTranscend = _chunkMPI5VURJcjs.Td; exports.syncConsentManager = _chunkMPI5VURJcjs.Wc; exports.syncConsentManagerExperiences = _chunkMPI5VURJcjs.Vc; exports.syncCookies = _chunkMPI5VURJcjs.Ac; exports.syncDataCategories = _chunkMPI5VURJcjs.Md; exports.syncDataFlows = _chunkMPI5VURJcjs.fd; exports.syncDataSiloDependencies = _chunkMPI5VURJcjs.sc; exports.syncDataSilos = _chunkMPI5VURJcjs.rc; exports.syncDataSubject = _chunkMPI5VURJcjs.Cc; exports.syncEnricher = _chunkMPI5VURJcjs.hc; exports.syncIdentifier = _chunkMPI5VURJcjs.fc; exports.syncIntlMessages = _chunkMPI5VURJcjs.Qc; exports.syncPartitions = _chunkMPI5VURJcjs.Tc; exports.syncPolicies = _chunkMPI5VURJcjs.Oc; exports.syncPrivacyCenter = _chunkMPI5VURJcjs.Rc; exports.syncProcessingActivities = _chunkMPI5VURJcjs.Sd; exports.syncProcessingPurposes = _chunkMPI5VURJcjs.Qd; exports.syncPrompts = _chunkMPI5VURJcjs.Jc; exports.syncRepositories = _chunkMPI5VURJcjs.Qe; exports.syncSoftwareDevelopmentKits = _chunkMPI5VURJcjs.Ne; exports.syncTemplate = _chunkMPI5VURJcjs.id; exports.syncVendors = _chunkMPI5VURJcjs.Id; exports.updateActionItem = _chunkMPI5VURJcjs.vd; exports.updateActionItemCollection = _chunkMPI5VURJcjs.rd; exports.updateAgentFiles = _chunkMPI5VURJcjs.Dd; exports.updateAgentFunctions = _chunkMPI5VURJcjs.zd; exports.updateAgents = _chunkMPI5VURJcjs.od; exports.updateBusinessEntities = _chunkMPI5VURJcjs.ad; exports.updateCodePackages = _chunkMPI5VURJcjs.Se; exports.updateConsentManagerToLatest = _chunkMPI5VURJcjs._d; exports.updateConsentManagerVersionToLatest = _chunkGZ2U36SScjs.a; exports.updateDataCategories = _chunkMPI5VURJcjs.Ld; exports.updateDataFlows = _chunkMPI5VURJcjs.dd; exports.updateIntlMessages = _chunkMPI5VURJcjs.Pc; exports.updateOrCreateCookies = _chunkMPI5VURJcjs.zc; exports.updatePolicies = _chunkMPI5VURJcjs.Nc; exports.updateProcessingPurposes = _chunkMPI5VURJcjs.Pd; exports.updatePrompts = _chunkMPI5VURJcjs.Ic; exports.updateRepositories = _chunkMPI5VURJcjs.Pe; exports.updateSoftwareDevelopmentKits = _chunkMPI5VURJcjs.Me; exports.updateVendors = _chunkMPI5VURJcjs.Hd; exports.uploadConsents = _chunkV4X4IT3Tcjs.f; exports.uploadCookiesFromCsv = _chunkGZ2U36SScjs.c; exports.uploadDataFlowsFromCsv = _chunkGZ2U36SScjs.b; exports.uploadPrivacyRequestsFromCsv = _chunk3FEOMF7Gcjs.O; exports.uploadSiloDiscoveryResults = _chunkMPI5VURJcjs.Ue; exports.validateTranscendAuth = _chunkASFWHSOVcjs.b; exports.version = _chunk3EZGFSMDcjs.m; exports.writeCsv = _chunkZVK4HIDFcjs.c; exports.writeCsvSync = _chunkZVK4HIDFcjs.a; exports.writeLargeCsv = _chunkZVK4HIDFcjs.e; exports.writeTranscendYaml = _chunkSUCCU2FScjs.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=_chunk44J2TVZUcjs.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 = _chunkUONUI4ABcjs.tb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunkUONUI4ABcjs.Ga; exports.ADD_SILO_DISCOVERY_RESULTS = _chunkUONUI4ABcjs.G; exports.ADMIN_DASH = _chunkXPKFB4ILcjs.b; exports.ADMIN_DASH_DATAPOINTS = _chunkXPKFB4ILcjs.d; exports.ADMIN_DASH_INTEGRATIONS = _chunkXPKFB4ILcjs.c; exports.AGENTS = _chunkUONUI4ABcjs.Gb; exports.AGENT_FILES = _chunkUONUI4ABcjs.Jb; exports.AGENT_FUNCTIONS = _chunkUONUI4ABcjs.Mb; exports.API_KEYS = _chunkUONUI4ABcjs.D; exports.APPROVE_PRIVACY_REQUEST = _chunkUONUI4ABcjs.W; exports.ASSESSMENTS = _chunkUONUI4ABcjs.ea; exports.ASSESSMENT_SECTION_FIELDS = _chunkUONUI4ABcjs.da; exports.ASSESSMENT_TEMPLATES = _chunkUONUI4ABcjs.ia; exports.ASSUME_ROLE = _chunkUONUI4ABcjs.Eb; exports.ATTRIBUTES = _chunkUONUI4ABcjs.Ka; exports.ATTRIBUTE_KEYS_REQUESTS = _chunkUONUI4ABcjs.L; exports.ATTRIBUTE_VALUES = _chunkUONUI4ABcjs.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 = _chunkUONUI4ABcjs.Ae; exports.AssessmentAnswerOptionInput = _chunkQEM6S2W7cjs.Y; exports.AssessmentDisplayLogicInput = _chunkQEM6S2W7cjs.V; exports.AssessmentInput = _chunkQEM6S2W7cjs.ca; exports.AssessmentNestedRule = _chunkUONUI4ABcjs.ze; exports.AssessmentNestedRuleInput = _chunkQEM6S2W7cjs.U; exports.AssessmentResourceInput = _chunkQEM6S2W7cjs.ba; exports.AssessmentRetentionScheduleInput = _chunkQEM6S2W7cjs.$; exports.AssessmentRiskLogic = _chunkUONUI4ABcjs.Ce; exports.AssessmentRule = _chunkUONUI4ABcjs.ye; exports.AssessmentRuleInput = _chunkQEM6S2W7cjs.T; exports.AssessmentSectionInput = _chunkQEM6S2W7cjs._; exports.AssessmentSectionQuestionInput = _chunkQEM6S2W7cjs.Z; exports.AssessmentTemplateInput = _chunkQEM6S2W7cjs.aa; exports.AttestedExtraIdentifiers = _chunk7UL54E7Xcjs.w; exports.AttributeInput = _chunkQEM6S2W7cjs.k; exports.AttributePreview = _chunkQEM6S2W7cjs.l; exports.AttributeValueInput = _chunkQEM6S2W7cjs.j; exports.BLANK = _chunk7UL54E7Xcjs.c; exports.BULK_APPLY = _chunk7UL54E7Xcjs.b; exports.BULK_REQUEST_FILES = _chunkUONUI4ABcjs.Ea; exports.BUSINESS_ENTITIES = _chunkUONUI4ABcjs.qb; exports.BusinessEntityInput = _chunkQEM6S2W7cjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunkUONUI4ABcjs.X; exports.CAN_APPLY_IN_BULK = _chunk7UL54E7Xcjs.g; exports.CATALOGS = _chunkUONUI4ABcjs.r; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunkUONUI4ABcjs.ua; exports.CODE_PACKAGES = _chunkUONUI4ABcjs.P; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunkUONUI4ABcjs.pb; exports.CONSENT_PARTITIONS = _chunkUONUI4ABcjs.Ta; exports.COOKIES = _chunkUONUI4ABcjs.Ya; exports.CREATE_ACTION_ITEMS = _chunkUONUI4ABcjs.xb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunkUONUI4ABcjs.Ia; exports.CREATE_AGENT = _chunkUONUI4ABcjs.Hb; exports.CREATE_AGENT_FILE = _chunkUONUI4ABcjs.Kb; exports.CREATE_AGENT_FUNCTION = _chunkUONUI4ABcjs.Nb; exports.CREATE_API_KEY = _chunkUONUI4ABcjs.E; exports.CREATE_ATTRIBUTE = _chunkUONUI4ABcjs.Pa; exports.CREATE_ATTRIBUTE_VALUES = _chunkUONUI4ABcjs.La; exports.CREATE_BUSINESS_ENTITY = _chunkUONUI4ABcjs.rb; exports.CREATE_CODE_PACKAGE = _chunkUONUI4ABcjs.R; exports.CREATE_CONSENT_EXPERIENCE = _chunkUONUI4ABcjs.nb; exports.CREATE_CONSENT_MANAGER = _chunkUONUI4ABcjs.ab; exports.CREATE_CONSENT_PARTITION = _chunkUONUI4ABcjs.ob; exports.CREATE_DATA_FLOWS = _chunkUONUI4ABcjs.Ua; exports.CREATE_DATA_SILOS = _chunkUONUI4ABcjs.m; exports.CREATE_DATA_SUBJECT = _chunkUONUI4ABcjs.x; exports.CREATE_DATA_SUB_CATEGORY = _chunkUONUI4ABcjs.Tb; exports.CREATE_ENRICHER = _chunkUONUI4ABcjs.p; exports.CREATE_IDENTIFIER = _chunkUONUI4ABcjs.u; exports.CREATE_PROCESSING_ACTIVITY = _chunkUONUI4ABcjs.Zb; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunkUONUI4ABcjs.Wb; exports.CREATE_PROMPT = _chunkUONUI4ABcjs.oa; exports.CREATE_PROMPT_GROUP = _chunkUONUI4ABcjs.sa; exports.CREATE_PROMPT_PARTIAL = _chunkUONUI4ABcjs.qa; exports.CREATE_REPOSITORY = _chunkUONUI4ABcjs.C; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunkUONUI4ABcjs.O; exports.CREATE_TEAM = _chunkUONUI4ABcjs.ya; exports.CREATE_TEMPLATE = _chunkUONUI4ABcjs.J; exports.CREATE_VENDOR = _chunkUONUI4ABcjs.Qb; exports.CachedFileState = _chunk7UL54E7Xcjs.h; exports.CachedRequestState = _chunk7UL54E7Xcjs.j; exports.CodePackageInput = _chunkQEM6S2W7cjs.D; exports.CodePackageSdk = _chunkQEM6S2W7cjs.C; exports.ColumnName = _chunk7UL54E7Xcjs.e; exports.ConsentManageExperienceInput = _chunkQEM6S2W7cjs.K; exports.ConsentManagerInput = _chunkQEM6S2W7cjs.M; exports.ConsentManagerMetricBin = _chunkUONUI4ABcjs.uc; exports.ConsentManagerServiceMetadata = _chunkQEM6S2W7cjs.ka; exports.ConsentPreferenceResponse = _chunkPQTI6C4Qcjs.i; exports.ConsentPreferenceTopic = _chunkQEM6S2W7cjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkQEM6S2W7cjs.da; exports.ConsentPurpose = _chunkQEM6S2W7cjs.fa; exports.CookieCsvInput = _chunkQEM6S2W7cjs.ja; exports.CookieInput = _chunkQEM6S2W7cjs.J; exports.CronIdentifier = _chunkYMXQXAUZcjs.a; exports.CronIdentifierPush = _chunkYMXQXAUZcjs.c; exports.DATAPOINT_EXPORT = _chunkUONUI4ABcjs.g; exports.DATA_FLOWS = _chunkUONUI4ABcjs.Xa; exports.DATA_POINTS = _chunkUONUI4ABcjs.a; exports.DATA_POINT_COUNT = _chunkUONUI4ABcjs.b; exports.DATA_SILOS = _chunkUONUI4ABcjs.i; exports.DATA_SILOS_ENRICHED = _chunkUONUI4ABcjs.k; exports.DATA_SILO_EXPORT = _chunkUONUI4ABcjs.j; exports.DATA_SUBJECTS = _chunkUONUI4ABcjs.w; exports.DATA_SUB_CATEGORIES = _chunkUONUI4ABcjs.Sb; exports.DEFAULT_TRANSCEND_API = _chunkXPKFB4ILcjs.e; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkXPKFB4ILcjs.f; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunkUONUI4ABcjs.Ee; exports.DELETE_API_KEY = _chunkUONUI4ABcjs.F; exports.DELETE_ATTRIBUTE_VALUE = _chunkUONUI4ABcjs.Na; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunkUONUI4ABcjs.zb; exports.DEPLOY_CONSENT_MANAGER = _chunkUONUI4ABcjs.db; exports.DETERMINE_LOGIN_METHOD = _chunkUONUI4ABcjs.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 = _chunkUONUI4ABcjs.H; exports.ENRICHERS = _chunkUONUI4ABcjs.n; exports.ENTRY_COUNT = _chunkUONUI4ABcjs.h; exports.EXPERIENCES = _chunkUONUI4ABcjs.Sa; exports.EnrichPrivacyRequest = _chunkA4OQQVQTcjs.b; exports.EnricherInput = _chunkQEM6S2W7cjs.e; exports.FETCH_CONSENT_MANAGER = _chunkUONUI4ABcjs._a; exports.FETCH_CONSENT_MANAGER_ID = _chunkUONUI4ABcjs.Za; exports.FETCH_CONSENT_MANAGER_THEME = _chunkUONUI4ABcjs.$a; exports.FETCH_PRIVACY_CENTER_ID = _chunkUONUI4ABcjs.yb; exports.FieldInput = _chunkQEM6S2W7cjs.v; exports.GLOBAL_ACTION_ITEMS = _chunkUONUI4ABcjs.vb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunkUONUI4ABcjs.Ha; exports.IDENTIFIERS = _chunkUONUI4ABcjs.s; exports.IDENTIFIER_BLOCK_LIST = _chunk7UL54E7Xcjs.d; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunkUONUI4ABcjs.fa; exports.INITIALIZER = _chunkUONUI4ABcjs.o; exports.IP_ADDRESS_REGEX = _chunkPQTI6C4Qcjs.f; exports.IS_REQUIRED = _chunk7UL54E7Xcjs.f; exports.IdentifierInput = _chunkQEM6S2W7cjs.H; exports.ImportOnetrustAssessmentsInput = _chunkQEM6S2W7cjs.ra; exports.IntlMessage = _chunk7UL54E7Xcjs.A; exports.IntlMessageInput = _chunkQEM6S2W7cjs.P; exports.LARGE_LANGUAGE_MODELS = _chunkUONUI4ABcjs.Fb; exports.LOGIN = _chunkUONUI4ABcjs.Db; exports.MESSAGES = _chunkUONUI4ABcjs._; exports.NEW_IDENTIFIER_TYPES = _chunkUONUI4ABcjs.t; exports.NONE = _chunk7UL54E7Xcjs.a; exports.NOTIFY_ADDITIONAL_TIME = _chunkUONUI4ABcjs.Z; exports.ORGANIZATION = _chunkUONUI4ABcjs.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 = _chunkUONUI4ABcjs.T; exports.PREFERENCE_TOPICS = _chunkUONUI4ABcjs.ha; exports.PRIVACY_CENTER = _chunkUONUI4ABcjs.Ab; exports.PROCESSING_ACTIVITIES = _chunkUONUI4ABcjs.Yb; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkUONUI4ABcjs.Vb; exports.PROMPTS = _chunkUONUI4ABcjs.ja; exports.PROMPTS_WITH_VARIABLES = _chunkUONUI4ABcjs.ma; exports.PROMPT_GROUPS = _chunkUONUI4ABcjs.la; exports.PROMPT_PARTIALS = _chunkUONUI4ABcjs.ka; exports.PROMPT_THREADS = _chunkUONUI4ABcjs.S; exports.PURPOSES = _chunkUONUI4ABcjs.ga; exports.ParsedAttributeInput = _chunk7UL54E7Xcjs.o; 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 = _chunkUONUI4ABcjs.ke; exports.PrivacyRequestInput = _chunk7UL54E7Xcjs.x; exports.PrivacyRequestResponse = _chunk7UL54E7Xcjs.G; 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 = _chunkBPX6MSMCcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunkUONUI4ABcjs.wa; exports.REMOVE_REQUEST_IDENTIFIERS = _chunkUONUI4ABcjs.Aa; exports.REPORT_PROMPT_RUN = _chunkUONUI4ABcjs.Fa; exports.REPOSITORIES = _chunkUONUI4ABcjs.A; exports.REQUESTS = _chunkUONUI4ABcjs.V; exports.REQUEST_DATA_SILOS = _chunkUONUI4ABcjs.ta; exports.REQUEST_ENRICHERS = _chunkUONUI4ABcjs.aa; exports.REQUEST_FILES = _chunkUONUI4ABcjs.Da; exports.REQUEST_IDENTIFIERS = _chunkUONUI4ABcjs.Ba; exports.RETRY_REQUEST_DATA_SILO = _chunkUONUI4ABcjs.va; exports.RETRY_REQUEST_ENRICHER = _chunkUONUI4ABcjs.ba; exports.RegionInput = _chunkQEM6S2W7cjs.z; exports.RepositoryInput = _chunkQEM6S2W7cjs.E; exports.RequestFileMetadata = _chunk7UL54E7Xcjs.B; exports.RequestFileMetadataResponse = _chunk7UL54E7Xcjs.C; exports.RequestIdentifiersResponse = _chunkUONUI4ABcjs.ie; exports.RiskAssignmentInput = _chunkQEM6S2W7cjs.W; exports.RiskLogicInput = _chunkQEM6S2W7cjs.X; exports.SCOPES_BY_TITLE = _chunkXPKFB4ILcjs.j; exports.SCOPE_TITLES = _chunkXPKFB4ILcjs.k; exports.SET_RESOURCE_ATTRIBUTES = _chunkUONUI4ABcjs.Ra; exports.SKIP_REQUEST_ENRICHER = _chunkUONUI4ABcjs.ca; exports.SOFTWARE_DEVELOPMENT_KITS = _chunkUONUI4ABcjs.M; exports.SOMBRA_VERSION = _chunkUONUI4ABcjs.$b; exports.SUB_DATA_POINTS = _chunkUONUI4ABcjs.c; exports.SUB_DATA_POINTS_COUNT = _chunkUONUI4ABcjs.d; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunkUONUI4ABcjs.e; exports.SYNC_ATTRIBUTE_TYPES = _chunkUONUI4ABcjs.Wc; exports.SoftwareDevelopmentKitInput = _chunkQEM6S2W7cjs.B; exports.StoredApiKey = _chunkQEM6S2W7cjs.ha; exports.SuccessfulRequest = _chunk7UL54E7Xcjs.i; exports.TEAMS = _chunkUONUI4ABcjs.xa; exports.TEMPLATES = _chunkUONUI4ABcjs.I; exports.TOGGLE_CONSENT_PRECEDENCE = _chunkUONUI4ABcjs.kb; exports.TOGGLE_DATA_SUBJECT = _chunkUONUI4ABcjs.z; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunkUONUI4ABcjs.jb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunkUONUI4ABcjs.ib; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunkUONUI4ABcjs.hb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkXPKFB4ILcjs.h; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkXPKFB4ILcjs.g; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkXPKFB4ILcjs.i; exports.TeamInput = _chunkQEM6S2W7cjs.d; exports.TemplateInput = _chunkQEM6S2W7cjs.a; exports.TranscendInput = _chunkQEM6S2W7cjs.ga; exports.TranscendPromptManager = B; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunkUONUI4ABcjs.ub; exports.UPDATE_ACTION_ITEMS = _chunkUONUI4ABcjs.wb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunkUONUI4ABcjs.Ja; exports.UPDATE_AGENTS = _chunkUONUI4ABcjs.Ib; exports.UPDATE_AGENT_FILES = _chunkUONUI4ABcjs.Lb; exports.UPDATE_AGENT_FUNCTIONS = _chunkUONUI4ABcjs.Ob; exports.UPDATE_ATTRIBUTE = _chunkUONUI4ABcjs.Qa; exports.UPDATE_ATTRIBUTE_VALUES = _chunkUONUI4ABcjs.Ma; exports.UPDATE_BUSINESS_ENTITIES = _chunkUONUI4ABcjs.sb; exports.UPDATE_CODE_PACKAGES = _chunkUONUI4ABcjs.Q; exports.UPDATE_CONSENT_EXPERIENCE = _chunkUONUI4ABcjs.mb; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunkUONUI4ABcjs.eb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunkUONUI4ABcjs.fb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunkUONUI4ABcjs.lb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunkUONUI4ABcjs.cb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunkUONUI4ABcjs.bb; exports.UPDATE_DATA_FLOWS = _chunkUONUI4ABcjs.Va; exports.UPDATE_DATA_SILOS = _chunkUONUI4ABcjs.l; exports.UPDATE_DATA_SUBJECT = _chunkUONUI4ABcjs.y; exports.UPDATE_DATA_SUB_CATEGORIES = _chunkUONUI4ABcjs.Ub; exports.UPDATE_ENRICHER = _chunkUONUI4ABcjs.q; exports.UPDATE_IDENTIFIER = _chunkUONUI4ABcjs.v; exports.UPDATE_INTL_MESSAGES = _chunkUONUI4ABcjs.$; exports.UPDATE_LOAD_OPTIONS = _chunkUONUI4ABcjs.gb; exports.UPDATE_OR_CREATE_COOKIES = _chunkUONUI4ABcjs.Wa; exports.UPDATE_OR_CREATE_DATA_POINT = _chunkUONUI4ABcjs.f; exports.UPDATE_POLICIES = _chunkUONUI4ABcjs.U; exports.UPDATE_PRIVACY_CENTER = _chunkUONUI4ABcjs.Bb; exports.UPDATE_PRIVACY_REQUEST = _chunkUONUI4ABcjs.Y; exports.UPDATE_PROCESSING_ACTIVITIES = _chunkUONUI4ABcjs._b; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkUONUI4ABcjs.Xb; exports.UPDATE_PROMPTS = _chunkUONUI4ABcjs.na; exports.UPDATE_PROMPT_GROUPS = _chunkUONUI4ABcjs.ra; exports.UPDATE_PROMPT_PARTIALS = _chunkUONUI4ABcjs.pa; exports.UPDATE_REPOSITORIES = _chunkUONUI4ABcjs.B; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunkUONUI4ABcjs.N; exports.UPDATE_TEAM = _chunkUONUI4ABcjs.za; exports.UPDATE_VENDORS = _chunkUONUI4ABcjs.Rb; exports.USERS = _chunkUONUI4ABcjs.Ca; exports.USP_STRING_REGEX = _chunkBPX6MSMCcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkSW5CIF5Dcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkSW5CIF5Dcjs.a; exports.VENDORS = _chunkUONUI4ABcjs.Pb; exports.VendorInput = _chunkQEM6S2W7cjs.p; exports.WebhookHeader = _chunkQEM6S2W7cjs.b; exports.addMessagesToPromptRun = _chunkUONUI4ABcjs.Sd; exports.appendCsvSync = _chunkLR3CPNDMcjs.b; exports.approvePrivacyRequests = _chunk7UL54E7Xcjs.I; exports.assumeRole = _chunkUONUI4ABcjs.ve; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunkUONUI4ABcjs.Ud; exports.buildTranscendGraphQLClientGeneric = _chunkUONUI4ABcjs.Td; exports.buildXdiSyncEndpoint = _chunkPQTI6C4Qcjs.g; exports.bulkRestartRequests = _chunk7UL54E7Xcjs.Q; exports.bulkRetryEnrichers = _chunk7UL54E7Xcjs.S; exports.cancelPrivacyRequests = _chunk7UL54E7Xcjs.L; exports.consentManagersToBusinessEntities = _chunkPQTI6C4Qcjs.h; exports.convertToDataSubjectAllowlist = _chunkUONUI4ABcjs.kc; exports.convertToDataSubjectBlockList = _chunkUONUI4ABcjs.jc; exports.createActionItemCollection = _chunkUONUI4ABcjs.od; exports.createActionItems = _chunkUONUI4ABcjs.sd; exports.createAgent = _chunkUONUI4ABcjs.ld; exports.createAgentFile = _chunkUONUI4ABcjs.Ad; exports.createAgentFunction = _chunkUONUI4ABcjs.wd; exports.createApiKey = _chunkUONUI4ABcjs.we; exports.createBusinessEntity = _chunkUONUI4ABcjs.Zc; exports.createCodePackage = _chunkUONUI4ABcjs.Pe; exports.createConsentToken = _chunkBPX6MSMCcjs.a; exports.createDataCategory = _chunkUONUI4ABcjs.Id; exports.createDataFlows = _chunkUONUI4ABcjs.cd; exports.createProcessingPurpose = _chunkUONUI4ABcjs.Md; exports.createPrompt = _chunkUONUI4ABcjs.Fc; exports.createRegexForTag = j; exports.createRepository = _chunkUONUI4ABcjs.Me; exports.createSoftwareDevelopmentKit = _chunkUONUI4ABcjs.Je; exports.createSombraGotInstance = _chunkUONUI4ABcjs.Vd; exports.createTranscendConsentGotInstance = _chunkUONUI4ABcjs.Wd; exports.createVendor = _chunkUONUI4ABcjs.Ed; exports.defineTranscendPrompts = Cm; exports.deleteApiKey = _chunkUONUI4ABcjs.xe; exports.deployConsentManager = _chunkUONUI4ABcjs.Xd; exports.description = _chunk44J2TVZUcjs.l; exports.domainToHost = _chunkPQTI6C4Qcjs.e; exports.downloadPrivacyRequestFiles = _chunk7UL54E7Xcjs.F; exports.enrichPrivacyRequest = _chunkA4OQQVQTcjs.c; exports.ensureAllDataSubjectsExist = _chunkUONUI4ABcjs.ic; exports.extractClientError = _chunk7UL54E7Xcjs.N; exports.fetchActiveSiloDiscoPlugin = _chunkUONUI4ABcjs.Zd; exports.fetchAllActionItems = _chunkUONUI4ABcjs.rd; exports.fetchAllActions = _chunkUONUI4ABcjs.hd; exports.fetchAllAgentFiles = _chunkUONUI4ABcjs.zd; exports.fetchAllAgentFunctions = _chunkUONUI4ABcjs.vd; exports.fetchAllAgents = _chunkUONUI4ABcjs.kd; exports.fetchAllApiKeys = _chunkUONUI4ABcjs.Bc; exports.fetchAllAssessmentTemplates = _chunkUONUI4ABcjs.$d; exports.fetchAllAssessments = _chunkUONUI4ABcjs._d; exports.fetchAllAttributeValues = _chunkUONUI4ABcjs.Vc; exports.fetchAllAttributes = _chunkUONUI4ABcjs.Xc; exports.fetchAllBusinessEntities = _chunkUONUI4ABcjs.Yc; exports.fetchAllCatalogs = _chunkUONUI4ABcjs.ne; exports.fetchAllCookies = _chunkUONUI4ABcjs.be; exports.fetchAllDataCategories = _chunkUONUI4ABcjs.Hd; exports.fetchAllDataFlows = _chunkUONUI4ABcjs.ad; exports.fetchAllDataPoints = _chunkUONUI4ABcjs.nc; exports.fetchAllDataSilos = _chunkUONUI4ABcjs.lc; exports.fetchAllDataSubjects = _chunkUONUI4ABcjs.hc; exports.fetchAllEnrichers = _chunkUONUI4ABcjs.ec; exports.fetchAllIdentifiers = _chunkUONUI4ABcjs.bc; exports.fetchAllMessages = _chunkUONUI4ABcjs.ce; exports.fetchAllPolicies = _chunkUONUI4ABcjs.Kc; exports.fetchAllPreferenceTopics = _chunkUONUI4ABcjs.de; exports.fetchAllPrivacyCenters = _chunkUONUI4ABcjs.ee; exports.fetchAllProcessingActivities = _chunkUONUI4ABcjs.Pd; exports.fetchAllProcessingPurposes = _chunkUONUI4ABcjs.Ld; exports.fetchAllPromptGroups = _chunkUONUI4ABcjs.jd; exports.fetchAllPromptPartials = _chunkUONUI4ABcjs.id; exports.fetchAllPromptThreads = _chunkUONUI4ABcjs.pe; exports.fetchAllPrompts = _chunkUONUI4ABcjs.Dc; exports.fetchAllPurposes = _chunkUONUI4ABcjs.Sc; exports.fetchAllPurposesAndPreferences = _chunkUONUI4ABcjs.fe; exports.fetchAllRequestAttributeKeys = _chunkUONUI4ABcjs.ae; exports.fetchAllRequestEnrichers = _chunkUONUI4ABcjs.ge; exports.fetchAllRequestIdentifierMetadata = _chunkUONUI4ABcjs.he; exports.fetchAllRequestIdentifiers = _chunkUONUI4ABcjs.je; exports.fetchAllRequests = _chunkUONUI4ABcjs.le; exports.fetchAllSubDataPoints = _chunkUONUI4ABcjs.mc; exports.fetchAllTeams = _chunkUONUI4ABcjs.zc; exports.fetchAllTemplates = _chunkUONUI4ABcjs.fd; exports.fetchAllUsers = _chunkUONUI4ABcjs.me; exports.fetchAllVendors = _chunkUONUI4ABcjs.Dd; exports.fetchAndIndexCatalogs = _chunkUONUI4ABcjs.oe; exports.fetchApiKeys = _chunkUONUI4ABcjs.Cc; exports.fetchConsentManager = _chunkUONUI4ABcjs.rc; exports.fetchConsentManagerAnalyticsData = _chunkUONUI4ABcjs.vc; exports.fetchConsentManagerExperiences = _chunkUONUI4ABcjs.tc; exports.fetchConsentManagerId = _chunkUONUI4ABcjs.sc; exports.fetchConsentManagerTheme = _chunkUONUI4ABcjs.wc; exports.fetchConsentPreferences = _chunkPQTI6C4Qcjs.j; exports.fetchEnrichedDataSilos = _chunkUONUI4ABcjs.oc; exports.fetchIdentifiersAndCreateMissing = _chunkUONUI4ABcjs.cc; exports.fetchPartitions = _chunkUONUI4ABcjs.Qc; exports.fetchPrivacyCenterId = _chunkUONUI4ABcjs.Jc; exports.fetchPrivacyCenterUrl = _chunkUONUI4ABcjs.Ic; exports.fetchPromptsWithVariables = _chunkUONUI4ABcjs.Ec; exports.fetchRequestDataSilo = _chunkUONUI4ABcjs.re; exports.fetchRequestDataSiloActiveCount = _chunkUONUI4ABcjs.se; exports.fetchRequestDataSilos = _chunkUONUI4ABcjs.qe; exports.fetchRequestFilesForRequest = _chunkUONUI4ABcjs.te; exports.filterNullishValuesFromObject = Em; exports.filterRows = _chunk7UL54E7Xcjs.s; exports.fuzzyMatchColumns = _chunk7UL54E7Xcjs.l; exports.fuzzySearch = _chunk7UL54E7Xcjs.k; exports.generateCrossAccountApiKeys = _chunkW3S3ULXNcjs.a; exports.getFileMetadataForPrivacyRequests = _chunk7UL54E7Xcjs.D; exports.getGitFilesThatChanged = Sm; exports.getUniqueValuesForColumn = _chunk7UL54E7Xcjs.r; exports.inquirerAutoComplete = _chunkN7QF44VWcjs.c; exports.inquirerConfirmBoolean = _chunkN7QF44VWcjs.a; exports.inquirerConfirmText = _chunkN7QF44VWcjs.b; exports.listDirectories = _chunkW3S3ULXNcjs.d; exports.listFiles = _chunkW3S3ULXNcjs.c; exports.loginUser = _chunkUONUI4ABcjs.ue; exports.makeGraphQLRequest = _chunkUONUI4ABcjs.ac; exports.mapColumnsToAttributes = _chunk7UL54E7Xcjs.M; exports.mapColumnsToIdentifiers = _chunk7UL54E7Xcjs.K; exports.mapCsvColumnsToApi = _chunk7UL54E7Xcjs.u; exports.mapCsvRowsToRequestInputs = _chunk7UL54E7Xcjs.z; exports.mapEnumValues = _chunk7UL54E7Xcjs.m; exports.mapRequestEnumValues = _chunk7UL54E7Xcjs.v; exports.markCronIdentifierCompleted = _chunkYMXQXAUZcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkYMXQXAUZcjs.f; exports.markSilentPrivacyRequests = _chunk7UL54E7Xcjs.t; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkXPKFB4ILcjs.a; exports.normalizeIdentifierValue = _chunk7UL54E7Xcjs.y; exports.notifyPrivacyRequestsAdditionalTime = _chunk7UL54E7Xcjs.J; exports.parseAssessmentDisplayLogic = _chunkUONUI4ABcjs.Be; exports.parseAssessmentRiskLogic = _chunkUONUI4ABcjs.De; exports.parseAttributesFromString = _chunk7UL54E7Xcjs.p; exports.parseFilePath = _chunkLR3CPNDMcjs.d; exports.parseVariablesFromString = _chunkTD7ADMVOcjs.a; exports.pullAllDatapoints = _chunkXARKMCNPcjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkYMXQXAUZcjs.g; exports.pullConsentManagerMetrics = _chunkPQTI6C4Qcjs.d; exports.pullCronPageOfIdentifiers = _chunkYMXQXAUZcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkA4OQQVQTcjs.a; exports.pullPrivacyRequests = _chunk7UL54E7Xcjs.U; exports.pullTranscendConfiguration = _chunkUONUI4ABcjs.Fe; exports.pullUnstructuredSubDataPointRecommendations = _chunkXARKMCNPcjs.b; exports.pushCronIdentifiersFromCsv = _chunkYMXQXAUZcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkA4OQQVQTcjs.d; exports.readCsv = _chunk7UL54E7Xcjs.q; exports.readTranscendYaml = _chunkSW5CIF5Dcjs.d; exports.removeLinks = Lm; exports.removeUnverifiedRequestIdentifiers = _chunk7UL54E7Xcjs.W; exports.replaceVariablesInYaml = _chunkSW5CIF5Dcjs.c; exports.reportPromptRun = _chunkUONUI4ABcjs.Ge; exports.restartPrivacyRequest = _chunk7UL54E7Xcjs.P; exports.retryRequestDataSilos = _chunk7UL54E7Xcjs.T; exports.retryRequestEnricher = _chunkUONUI4ABcjs.He; exports.setResourceAttributes = _chunkUONUI4ABcjs.Ie; exports.skipPreflightJobs = _chunk7UL54E7Xcjs.R; exports.skipRequestDataSilos = _chunk7UL54E7Xcjs.V; exports.splitCsvToList = _chunk7UL54E7Xcjs.n; exports.streamPrivacyRequestFiles = _chunk7UL54E7Xcjs.E; exports.submitPrivacyRequest = _chunk7UL54E7Xcjs.H; exports.syncAction = _chunkUONUI4ABcjs.ed; exports.syncActionItemCollections = _chunkUONUI4ABcjs.qd; exports.syncActionItems = _chunkUONUI4ABcjs.ud; exports.syncAgentFiles = _chunkUONUI4ABcjs.Cd; exports.syncAgentFunctions = _chunkUONUI4ABcjs.yd; exports.syncAgents = _chunkUONUI4ABcjs.nd; exports.syncAttribute = _chunkUONUI4ABcjs.gc; exports.syncBusinessEntities = _chunkUONUI4ABcjs.$c; exports.syncCodePackages = _chunkUONUI4ABcjs.Re; exports.syncConfigurationToTranscend = _chunkUONUI4ABcjs.Rd; exports.syncConsentManager = _chunkUONUI4ABcjs.Uc; exports.syncConsentManagerExperiences = _chunkUONUI4ABcjs.Tc; exports.syncCookies = _chunkUONUI4ABcjs.yc; exports.syncDataCategories = _chunkUONUI4ABcjs.Kd; exports.syncDataFlows = _chunkUONUI4ABcjs.dd; exports.syncDataSiloDependencies = _chunkUONUI4ABcjs.qc; exports.syncDataSilos = _chunkUONUI4ABcjs.pc; exports.syncDataSubject = _chunkUONUI4ABcjs.Ac; exports.syncEnricher = _chunkUONUI4ABcjs.fc; exports.syncIdentifier = _chunkUONUI4ABcjs.dc; exports.syncIntlMessages = _chunkUONUI4ABcjs.Oc; exports.syncPartitions = _chunkUONUI4ABcjs.Rc; exports.syncPolicies = _chunkUONUI4ABcjs.Mc; exports.syncPrivacyCenter = _chunkUONUI4ABcjs.Pc; exports.syncProcessingActivities = _chunkUONUI4ABcjs.Qd; exports.syncProcessingPurposes = _chunkUONUI4ABcjs.Od; exports.syncPrompts = _chunkUONUI4ABcjs.Hc; exports.syncRepositories = _chunkUONUI4ABcjs.Oe; exports.syncSoftwareDevelopmentKits = _chunkUONUI4ABcjs.Le; exports.syncTemplate = _chunkUONUI4ABcjs.gd; exports.syncVendors = _chunkUONUI4ABcjs.Gd; exports.updateActionItem = _chunkUONUI4ABcjs.td; exports.updateActionItemCollection = _chunkUONUI4ABcjs.pd; exports.updateAgentFiles = _chunkUONUI4ABcjs.Bd; exports.updateAgentFunctions = _chunkUONUI4ABcjs.xd; exports.updateAgents = _chunkUONUI4ABcjs.md; exports.updateBusinessEntities = _chunkUONUI4ABcjs._c; exports.updateCodePackages = _chunkUONUI4ABcjs.Qe; exports.updateConsentManagerToLatest = _chunkUONUI4ABcjs.Yd; exports.updateConsentManagerVersionToLatest = _chunkPQTI6C4Qcjs.a; exports.updateDataCategories = _chunkUONUI4ABcjs.Jd; exports.updateDataFlows = _chunkUONUI4ABcjs.bd; exports.updateIntlMessages = _chunkUONUI4ABcjs.Nc; exports.updateOrCreateCookies = _chunkUONUI4ABcjs.xc; exports.updatePolicies = _chunkUONUI4ABcjs.Lc; exports.updateProcessingPurposes = _chunkUONUI4ABcjs.Nd; exports.updatePrompts = _chunkUONUI4ABcjs.Gc; exports.updateRepositories = _chunkUONUI4ABcjs.Ne; exports.updateSoftwareDevelopmentKits = _chunkUONUI4ABcjs.Ke; exports.updateVendors = _chunkUONUI4ABcjs.Fd; exports.uploadConsents = _chunkBPX6MSMCcjs.f; exports.uploadCookiesFromCsv = _chunkPQTI6C4Qcjs.c; exports.uploadDataFlowsFromCsv = _chunkPQTI6C4Qcjs.b; exports.uploadPrivacyRequestsFromCsv = _chunk7UL54E7Xcjs.O; exports.uploadSiloDiscoveryResults = _chunkUONUI4ABcjs.Se; exports.validateTranscendAuth = _chunkW3S3ULXNcjs.b; exports.version = _chunk44J2TVZUcjs.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-replace';\nimport {\n PromptThread,\n fetchAllPromptThreads,\n} from '../graphql/fetchPromptThreads';\n\n/**\n * An LLM Prompt definition\n */\nexport type TranscendPrompt<\n TInputParams extends t.Any,\n TOutputCodec extends t.Any,\n> = (\n | {\n /** ID of the prompt */\n id: string;\n /** Title of the prompt */\n title?: string;\n }\n | {\n /** ID of the prompt */\n id?: string;\n /** Title of the prompt */\n title: string;\n }\n) & {\n /** The names of the agents that should be loaded along with the prompt */\n agentNames?: string[];\n /** Codec to validate runtime input shape */\n paramCodec: TInputParams;\n /** Codec to validate output response */\n outputCodec: TOutputCodec;\n /**\n * If the output that needs to be parsed is returned within a tag\n * e.g. <tag> or <json> - this is the name of the tag\n */\n extractFromTag?: string;\n};\n\nexport interface PromptRunResult {\n /** The ID of the prompt run created on Transcend */\n promptRunId: string;\n /** The URL of the prompt run on Transcend */\n promptRunUrl: string;\n}\n\n/**\n * Create a regex to extract data from a tag\n *\n * Input:\n * \"here is some data <tag>Data</tag>...\"\n *\n * @param tagName - Name of tag\n * @returns Data within the tag\n */\nexport function createRegexForTag(tagName: string): RegExp {\n return new RegExp(`<${tagName}>([\\\\s\\\\S]+?)<\\\\/${tagName}>`);\n}\n\n/**\n * Helper function to declare prompts\n *\n * @param prompts - Prompt config\n * @returns Prompts as identity function - but type enforced\n */\nexport function defineTranscendPrompts<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n>(prompts: TPrompts): TPrompts {\n return prompts;\n}\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptParamType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['paramCodec']>;\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptResponseType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n\n/**\n * Input for reporting a prompt run\n */\nexport interface ReportPromptRunOptions\n extends Optionalize<\n Omit<ReportPromptRunInput, 'status' | 'promptId' | 'largeLanguageModelId'>,\n 'name' | 'productArea'\n > {\n /** The large language model being run. Either the ID of the LLM or the client/name pairing */\n largeLanguageModel:\n | string\n | {\n /** Name of client */\n client: LargeLanguageModelClient;\n /** Name of the model */\n name: string;\n };\n}\n\nconst jsonParseSafe = (obj: string): unknown => {\n try {\n return JSON.parse(obj);\n } catch (e) {\n return obj;\n }\n};\n\n/**\n * A class that is capable of loading and insert variables into prompts from\n * Transcend's Prompt Manager\n */\nexport class TranscendPromptManager<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n> {\n /** Prompt definitions */\n public prompts: TPrompts;\n\n /** Options for configuring handlebars */\n public handlebarsOptions!: HandlebarsInput;\n\n /** Prompt name -> content map, populated by call to Transcend API */\n public promptContentMap?: { [k in TPromptNames]: TranscendPromptTemplated };\n\n /** The large language models that are registered to this organization for reporting */\n public largeLanguageModels: LargeLanguageModel[] = [];\n\n /** The agent definitions registered to this organization */\n private agentsByName: { [name in string]: Agent } = {};\n\n /** The agent definitions registered to this organization */\n private agentsByAgentId: { [id in string]: Agent } = {};\n\n /** The GraphQL client that can be used to call Transcend */\n public graphQLClient: GraphQLClient;\n\n /** The set of variables to expose in handlebars context specified at class initiation */\n public defaultVariables: { [k in string]: unknown };\n\n /**\n * The set of variables to expose in handlebars context,\n * merges defaults with calculated variables from the inventory\n */\n public variables: { [k in string]: unknown };\n\n /** Handlebars compiler */\n public handlebars: typeof Handlebars;\n\n /** The Transcend API key */\n public transcendApiKey: string | Secret<string>;\n\n /** API of Transcend to call */\n public transcendUrl: string;\n\n /** When true, throw an error if the prompt is not approved */\n public requireApproval: boolean;\n\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n public cacheDuration?: number;\n\n /**\n * The last time the metadata was fetched\n */\n public lastUpdatedAt?: Date;\n\n /**\n * Constructor\n *\n * @param options - Options\n */\n constructor({\n prompts,\n handlebarsOptions = {},\n transcendUrl = DEFAULT_TRANSCEND_API,\n transcendApiKey,\n requireApproval = true,\n cacheDuration,\n defaultVariables = {},\n }: {\n /** Prompt definitions to load */\n prompts: TPrompts;\n /** Options for configuring handlebars */\n handlebarsOptions?: HandlebarsInput;\n /** The Transcend API key */\n transcendApiKey: string | Secret<string>;\n /** API of Transcend to call */\n transcendUrl?: string;\n /** When true, throw an error if the prompt is not approved */\n requireApproval?: boolean;\n /** The set of variables to expose in handlebars context specified at class initiation */\n defaultVariables?: { [k in string]: unknown };\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n cacheDuration?: number;\n }) {\n this.prompts = prompts;\n this.transcendUrl = transcendUrl;\n this.transcendApiKey = transcendApiKey;\n this.variables = defaultVariables;\n this.defaultVariables = defaultVariables;\n this.graphQLClient = buildTranscendGraphQLClient(\n transcendUrl,\n typeof transcendApiKey === 'object'\n ? transcendApiKey.release()\n : transcendApiKey,\n );\n this.requireApproval = requireApproval;\n this.cacheDuration = cacheDuration;\n this.handlebarsOptions = handlebarsOptions;\n this.handlebars = createHandlebarsWithHelpers(handlebarsOptions);\n }\n\n /**\n * Fetch prompt metadata from Transcend and cache to the class definition\n *\n * @returns A function that can be used to call the prompt\n */\n async fetchPromptsAndMetadata(): Promise<TranscendPromptsAndVariables> {\n // Determine what to fetch\n const promptDefinitions = getValues(this.prompts) as TranscendPrompt<\n t.Any,\n t.Any\n >[];\n const promptIds = promptDefinitions\n .map(({ id }) => id)\n .filter((x): x is string => !!x);\n const promptTitles = promptDefinitions\n .map(({ title }) => title)\n .filter((x): x is string => !!x);\n const agentNames = uniq(\n promptDefinitions.map(({ agentNames }) => agentNames || []).flat(),\n );\n\n // Fetch prompts and data\n const [response, largeLanguageModels, agents] = await Promise.all([\n fetchPromptsWithVariables(this.graphQLClient, {\n promptIds,\n promptTitles,\n }),\n fetchAllLargeLanguageModels(this.graphQLClient),\n fetchAllAgents(this.graphQLClient, { names: agentNames }),\n ]);\n this.agentsByName = keyBy(agents, 'name');\n this.agentsByAgentId = keyBy(agents, 'agentId');\n this.largeLanguageModels = largeLanguageModels.filter(\n (model) => model.isTranscendHosted === false,\n );\n\n // Lookup prompts by id/title\n const promptByTitle = keyBy(response.prompts, 'title');\n const promptById = keyBy(response.prompts, 'id');\n\n // Update variables\n this.variables = {\n ...response.calculatedVariables.reduce(\n (acc, v) =>\n Object.assign(acc, {\n [v.name]: v.data ? JSON.parse(v.data) : v.data,\n }),\n {},\n ),\n ...this.defaultVariables,\n };\n\n // Update partials\n this.handlebars = createHandlebarsWithHelpers({\n ...this.handlebarsOptions,\n templates: [\n ...(this.handlebarsOptions.templates || []),\n ...response.promptPartials.map((partial) => ({\n name: partial.slug,\n content: partial.content,\n })),\n ],\n });\n\n // Create mapping from prompt to content\n this.promptContentMap = apply(this.prompts, ({ id, title }) => {\n const result = id\n ? promptById[id]\n : title\n ? promptByTitle[title]\n : undefined;\n if (!result) {\n throw new Error(\n `Failed to find prompt with title: \"${title}\" and id: \"${id}\"`,\n );\n }\n return result;\n });\n\n // For cache\n this.lastUpdatedAt = new Date();\n\n return response;\n }\n\n /**\n * Get an agent definition by name\n *\n * @param name - Name of the agent to grab\n * @returns Large language model configuration\n */\n async getAgentByName(name: string): Promise<Agent | undefined> {\n const agent = this.agentsByName[name];\n if (agent) {\n return agent;\n }\n const [remoteAgent] = await fetchAllAgents(this.graphQLClient, {\n names: [name],\n });\n if (!remoteAgent) {\n return undefined;\n }\n this.agentsByName[remoteAgent.name] = remoteAgent;\n this.agentsByAgentId[remoteAgent.agentId] = remoteAgent;\n return remoteAgent;\n }\n\n /**\n * Get a prompt thread by ts\n *\n * @param ts - the slack message timestamp to look up thread for\n * @returns Large language model configuration\n */\n async getPromptThreadBySlackTs(\n ts: string,\n ): Promise<PromptThread | undefined> {\n const [thread] = await fetchAllPromptThreads(this.graphQLClient, {\n slackMessageTs: [ts],\n });\n return thread;\n }\n\n /**\n * Get a list of agent definitions by name.\n * Pulls from cache and may return less agents\n * than requested if some are not found\n *\n * @param names - Names of agents to fetch\n * @returns The agents that were found matching the names\n */\n async getAgentsByName(names: string[]): Promise<Agent[]> {\n if (names.length < 1) {\n throw new Error('Expected at least one name to be provided');\n }\n const { hasCache = [], missingCache = [] } = groupBy(names, (name) =>\n this.agentsByName[name] ? 'hasCache' : 'missingCache',\n );\n const cachedAgents = hasCache.map((name) => this.agentsByName[name]);\n if (missingCache.length === 0) {\n return cachedAgents;\n }\n const chunkedNames = chunk(missingCache, 50);\n const remoteAgents: Agent[] = [];\n await mapSeries(chunkedNames, async (chunkedName) => {\n const pageOfAgents = await fetchAllAgents(this.graphQLClient, {\n names: chunkedName,\n });\n pageOfAgents.forEach((agent) => {\n this.agentsByName[agent.name] = agent;\n this.agentsByAgentId[agent.agentId] = agent;\n });\n remoteAgents.push(...pageOfAgents);\n });\n return [...cachedAgents, ...remoteAgents];\n }\n\n /**\n * Fetch metadata on agent files\n *\n * @param filterBy - Filter by parameters\n * @returns The files found matching the filter\n */\n getAgentFiles(filterBy: AgentFileFilterBy): Promise<AgentFile[]> {\n return fetchAllAgentFiles(this.graphQLClient, filterBy);\n }\n\n /**\n * Look up the large language model to report on\n *\n * @param largeLanguageModel - Input\n * @returns Large language model configuration\n */\n getLargeLanguageModel(\n largeLanguageModel: ReportPromptRunOptions['largeLanguageModel'],\n ): LargeLanguageModel {\n const matching = this.largeLanguageModels.find((model) =>\n typeof largeLanguageModel === 'string'\n ? model.id === largeLanguageModel\n : model.name === largeLanguageModel.name &&\n model.client === largeLanguageModel.client,\n );\n if (!matching) {\n throw new Error(\n `Failed to find model matching: ${\n typeof largeLanguageModel === 'string'\n ? largeLanguageModel\n : JSON.stringify(largeLanguageModel)\n }`,\n );\n }\n return matching;\n }\n\n /**\n * Get a prompt definition by name\n *\n * @param promptName - Prompt to compile\n * @returns Parsed content\n */\n async getPromptDefinition<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n ): Promise<TranscendPromptTemplated> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n // Lookup prompt\n const { promptContentMap } = this;\n if (!promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n const promptTemplate = promptContentMap[promptName];\n if (!promptTemplate) {\n throw new Error(\n `Expected this.promptContentMap[${promptName}] to be defined`,\n );\n }\n return promptTemplate;\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to compile\n * @param params - Runtime parameters\n * @returns Parsed content\n */\n async compilePrompt<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n params: t.TypeOf<TPrompts[TPromptName]['paramCodec']>,\n ): Promise<string> {\n // Grab the prompt\n const promptTemplate = await this.getPromptDefinition(promptName);\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure prompt is approved\n if (\n this.requireApproval &&\n promptTemplate.status !== PromptStatus.Approved\n ) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because its in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // If prompt is rejected, throw error\n if (promptTemplate.status === PromptStatus.Rejected) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because it's in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // Validate params\n decodeCodec(promptInput.paramCodec, params);\n\n // Compile prompt and template\n return this.handlebars.compile(promptTemplate.content)({\n // template in currentDate by default\n currentDate: new Date().toISOString(),\n ...this.variables,\n ...params,\n });\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to parse\n * @param response - AI response as string\n * @returns Parsed content\n */\n parseAiResponse<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n response: string,\n ): t.TypeOf<TPrompts[TPromptName]['outputCodec']> {\n // Look up prompt info\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Extract from tag if needed\n const extracted = promptInput.extractFromTag\n ? (createRegexForTag(promptInput.extractFromTag).exec(response) ||\n [])[1] || response\n : response;\n\n // Parse via codec\n return decodeCodec(\n promptInput.outputCodec,\n jsonParseSafe(extracted),\n false,\n );\n }\n\n /**\n * Parse the AI response and report back to Transcend\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportAndParsePromptRun<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n { largeLanguageModel, ...options }: ReportPromptRunOptions,\n ): Promise<\n PromptRunResult & {\n /** Resulting prompt run */\n result: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n }\n > {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n if (\n options.promptRunMessages[options.promptRunMessages.length - 1].role !==\n ChatCompletionRole.Assistant\n ) {\n throw new Error(\n `promptRunMessages[${\n options.promptRunMessages.length - 1\n }].role is expected to be = ${ChatCompletionRole.Assistant}`,\n );\n }\n const response =\n options.promptRunMessages[options.promptRunMessages.length - 1].content;\n\n let parsed: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n try {\n // Parse the response\n parsed = this.parseAiResponse(promptName, response);\n } catch (err) {\n await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n error: err.message,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n throw err;\n }\n\n // report successful run\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Resolved,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n result: parsed,\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n\n /**\n * Report an error for a particular prompt\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportPromptRunError<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n {\n largeLanguageModel,\n ...options\n }: Requirize<ReportPromptRunOptions, 'error'>,\n ): Promise<PromptRunResult> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n}\n/* eslint-enable max-lines */\n","import { GraphQLClient } from 'graphql-request';\nimport { LargeLanguageModelClient } from '@transcend-io/privacy-types';\nimport { LARGE_LANGUAGE_MODELS } from './gqls';\nimport { makeGraphQLRequest } from './makeGraphQLRequest';\n\nexport interface LargeLanguageModel {\n /** ID of prompts */\n id: string;\n /** The name of the large language model. */\n name: string;\n /** The content of the prompt template. */\n client: LargeLanguageModelClient;\n /** Whether hosted by Transcend or not */\n isTranscendHosted: boolean;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all LargeLanguageModels in the organization\n *\n * @param client - GraphQL client\n * @returns All LargeLanguageModels in the organization\n */\nexport async function fetchAllLargeLanguageModels(\n client: GraphQLClient,\n): Promise<LargeLanguageModel[]> {\n const largeLanguageModels: LargeLanguageModel[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n largeLanguageModels: { nodes },\n } = await makeGraphQLRequest<{\n /** LargeLanguageModels */\n largeLanguageModels: {\n /** List */\n nodes: LargeLanguageModel[];\n };\n }>(client, LARGE_LANGUAGE_MODELS, {\n first: PAGE_SIZE,\n offset,\n });\n largeLanguageModels.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return largeLanguageModels.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { difference } from 'lodash-es';\nimport fastGlob from 'fast-glob';\nimport { execSync } from 'child_process';\n\n/**\n * Function thats gets the git files that have changed\n * and returns the code\n *\n * @param options - Options\n * @returns Changes files and diffs\n */\nexport function getGitFilesThatChanged({\n baseBranch,\n rootDirectory,\n githubRepo,\n excludedGlob = [],\n fileBlockList = [],\n}: {\n /** Base branch */\n baseBranch: string;\n /** Github repo name */\n githubRepo: string;\n /** Root directory */\n rootDirectory: string;\n /** A glob that excludes files */\n excludedGlob?: string[];\n /** Block list of files to not process */\n fileBlockList?: string[];\n}): {\n /** The list of files that changed */\n changedFiles: string[];\n /** Github repo name */\n repoName: string;\n /** Current commit */\n commit: string;\n /** File diffs */\n fileDiffs: { [k in string]: string };\n} {\n // Pull base branch\n execSync(`git fetch origin ${baseBranch}`);\n\n // Latest commit on base branch. If we are on the base branch, we take the prior commit\n const latestBasedCommit = execSync(\n `git ls-remote ${githubRepo} \"refs/heads/${baseBranch}\" | cut -f 1`,\n { encoding: 'utf-8' },\n ).split('\\n')[0];\n\n // This commit\n const latestThisCommit = execSync('git rev-parse HEAD', {\n encoding: 'utf-8',\n }).split('\\n')[0];\n\n // Ensure commits are present\n if (!latestBasedCommit || !latestThisCommit) {\n throw new Error('FAILED TO FIND COMMIT RANGE');\n }\n\n // Get the diff between the given branch and base branch\n const diff = execSync(\n `git fetch && git diff --name-only \"${\n baseBranch || latestBasedCommit\n }...${latestThisCommit}\" -- ${rootDirectory}`,\n { encoding: 'utf-8' },\n );\n\n // Filter out block list\n const changedFiles = difference(\n diff.split('\\n').filter((f) => f),\n fileBlockList,\n );\n\n // Filter out globs\n const filteredChanges =\n excludedGlob.length > 0\n ? fastGlob.sync(changedFiles, { ignore: excludedGlob })\n : changedFiles;\n\n // Get the contents of only the changed files\n const fileDiffs: { [k in string]: string } = {};\n filteredChanges.forEach((file) => {\n const contents = execSync(`git show ${latestThisCommit}:${file}`, {\n encoding: 'utf-8',\n });\n fileDiffs[file] = contents;\n });\n\n // Pull the github repo name\n const repoName = githubRepo.split('/').pop()!.split('.')[0];\n\n return {\n changedFiles,\n fileDiffs,\n repoName,\n commit: latestThisCommit,\n };\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/index.cjs","../src/lib/ai/TranscendPromptManager.ts","../src/lib/graphql/fetchLargeLanguageModels.ts","../src/lib/ai/getGitFilesThatChanged.ts"],"names":["PAGE_SIZE","fetchAllLargeLanguageModels","client","largeLanguageModels","offset","shouldContinue","nodes","makeGraphQLRequest","LARGE_LANGUAGE_MODELS","a","b","createRegexForTag","tagName","defineTranscendPrompts","prompts","jsonParseSafe","obj","TranscendPromptManager","handlebarsOptions","transcendUrl","DEFAULT_TRANSCEND_API","transcendApiKey","requireApproval","cacheDuration","defaultVariables","buildTranscendGraphQLClient","createHandlebarsWithHelpers","promptDefinitions","getValues","promptIds","id","x","promptTitles","title","agentNames","uniq_default","response","agents","fetchPromptsWithVariables","fetchAllAgents","keyBy_default","model","promptByTitle","promptById","acc","v","partial","apply","result","name","agent","remoteAgent","ts","thread","fetchAllPromptThreads","names","hasCache","missingCache","groupBy_default","cachedAgents","chunkedNames","chunk_default","remoteAgents","mapSeries","chunkedName","pageOfAgents","filterBy","fetchAllAgentFiles","largeLanguageModel","matching"],"mappings":"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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.0";
143853
+ var version = "8.0.2";
143854
143854
 
143855
143855
  /**
143856
143856
  * The name of the main binary for the CLI
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.0",
5
+ "version": "8.0.2",
6
6
  "homepage": "https://github.com/transcend-io/cli",
7
7
  "repository": {
8
8
  "type": "git",
@@ -91,6 +91,7 @@
91
91
  "@transcend-io/type-utils": "^1.8.0",
92
92
  "JSONStream": "^1.3.5",
93
93
  "cli-progress": "^3.11.2",
94
+ "bluebird": "^3.7.2",
94
95
  "colors": "^1.4.0",
95
96
  "csv-parse": "^5.6.0",
96
97
  "fast-csv": "^4.3.6",
@@ -148,7 +149,8 @@
148
149
  "tsx": "^4.20.3",
149
150
  "typescript": "^5.0.4",
150
151
  "vite-tsconfig-paths": "^5.1.4",
151
- "vitest": "^3.2.4"
152
+ "vitest": "^3.2.4",
153
+ "@types/bluebird": "^3.5.38"
152
154
  },
153
155
  "scripts": {
154
156
  "start": "./dist/bin/cli.cjs",
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkMPI5VURJcjs = require('./chunk-MPI5VURJ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkKC7NDLN7cjs = require('./chunk-KC7NDLN7.cjs');var _chunk3EZGFSMDcjs = require('./chunk-3EZGFSMD.cjs');var _typeutils = require('@transcend-io/type-utils');var _internationalization = require('@transcend-io/internationalization');var _privacytypes = require('@transcend-io/privacy-types');var _iots = require('io-ts'); var R = _interopRequireWildcard(_iots); var re = _interopRequireWildcard(_iots); var lt = _interopRequireWildcard(_iots); var D = _interopRequireWildcard(_iots); var q = _interopRequireWildcard(_iots); var I = _interopRequireWildcard(_iots); var de = _interopRequireWildcard(_iots); var Ft = _interopRequireWildcard(_iots); var M = _interopRequireWildcard(_iots);var A="[NONE]",pe= exports.b ="[APPLY VALUE TO ALL ROWS]",De= exports.c ="<blank>",be= exports.d =["email","coreIdentifier"],ne= exports.e =(c=>(c.Email="email",c.CoreIdentifier="coreIdentifier",c.RequestType="requestType",c.SubjectType="subjectType",c.Locale="locale",c.Country="country",c.CountrySubDivision="countrySubDivision",c.RequestStatus="requestStatus",c.CreatedAt="createdAt",c.DataSiloIds="dataSiloIds",c))(ne||{}),et= exports.f ={email:!1,coreIdentifier:!0,requestType:!0,subjectType:!0,requestStatus:!1,createdAt:!1,dataSiloIds:!1,locale:!1,country:!1,countrySubDivision:!1},tt= exports.g ={requestType:!0,subjectType:!0},rt= exports.h =R.type({columnNames:R.partial(_typeutils.applyEnum.call(void 0, ne,()=>R.string)),identifierNames:R.record(R.string,R.string),attributeNames:R.record(R.string,R.string),requestTypeToRequestAction:R.record(R.string,_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction)),subjectTypeToSubjectName:R.record(R.string,R.string),languageToLocale:R.record(R.string,_typeutils.valuesOf.call(void 0, _internationalization.LanguageKey)),regionToCountry:R.record(R.string,_typeutils.valuesOf.call(void 0, {..._privacytypes.IsoCountryCode,[A]:A})),regionToCountrySubDivision:R.record(R.string,_typeutils.valuesOf.call(void 0, {..._privacytypes.IsoCountrySubdivisionCode,[A]:A})),statusToRequestStatus:R.record(R.string,_typeutils.valuesOf.call(void 0, {..._privacytypes.CompletedRequestStatus,[A]:A}))}),Te= exports.i =R.type({id:R.string,link:R.string,rowIndex:R.number,coreIdentifier:R.string,attemptedAt:R.string}),st= exports.j =R.type({failingRequests:R.array(R.record(R.string,R.any)),successfulRequests:R.array(Te),duplicateRequests:R.array(R.type({rowIndex:R.number,coreIdentifier:R.string,attemptedAt:R.string}))});var _inquirer = require('inquirer'); var _inquirer2 = _interopRequireDefault(_inquirer);var _fuzzysearch = require('fuzzysearch'); var _fuzzysearch2 = _interopRequireDefault(_fuzzysearch);function Ae(n,e){return _fuzzysearch2.default.call(void 0, n.toLowerCase(),e.toLowerCase())||_fuzzysearch2.default.call(void 0, e.toLowerCase(),n.toLowerCase())}function ae(n,e,s,l){let a=n.filter(o=>Ae(e.toLowerCase(),o.toLowerCase()));return[...a,new _inquirer2.default.Separator,...s?[]:[A],...l?[pe]:[],...n.filter(o=>!a.includes(o))]}var _inquirerautocompleteprompt = require('inquirer-autocomplete-prompt'); var _inquirerautocompleteprompt2 = _interopRequireDefault(_inquirerautocompleteprompt);async function te(n,e,s){_inquirer2.default.registerPrompt("autocomplete",_inquirerautocompleteprompt2.default);let l=n.map(o=>o||"<blank>").filter(o=>!s[o]);if(l.length===0)return s;let a=await _inquirer2.default.prompt(l.map(o=>({name:o,message:`Map value of: ${o}`,type:"autocomplete",default:e.find(i=>Ae(o,i)),source:(i,r)=>r?e.filter(t=>typeof t=="string"&&Ae(r,t)):e})));return{...s,..._typeutils.apply.call(void 0, a,o=>typeof o=="string"?o:Object.values(o)[0])}}function Ee(n){return n.split(",").map(e=>e.trim()).filter(e=>e)}var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var at=re.type({key:re.string,values:re.array(re.string)});function ut(n){let e=n.map(s=>{let[l,a]=s.trim().split(":");if(!a)throw new Error("Expected attributes in key:value1;value2,key2:value3;value4");let o=a.split(";");return{key:l,values:o}});return _chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Attributes to apply to all requests:")),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(JSON.stringify(e,null,2))),e}var _sync = require('csv-parse/sync');var _fs = require('fs');function ct(n,e,s={columns:!0}){let l=_sync.parse.call(void 0, _fs.readFileSync.call(void 0, n,"utf-8"),s);return _typeutils.decodeCodec.call(void 0, lt.array(e),l).map(i=>Object.entries(i).reduce((r,[t,y])=>Object.assign(r,{[t.replace(/[^a-z_.+\-A-Z -~]/g,"")]:y}),{}))}function G(n,e){return _chunk3EZGFSMDcjs.j.call(void 0, n.map(s=>s[e]||"").flat())}async function pt(n){let e=_chunk3EZGFSMDcjs.j.call(void 0, n.map(a=>Object.keys(a)).flat()),s=n,l=!0;for(;l;){let{filterColumnName:a}=await _inquirer2.default.prompt([{name:"filterColumnName",message:`If you need to filter the list of requests to import, choose the column to filter on. Currently ${s.length} rows.`,type:"list",default:e,choices:[A,...e]}]);if(l=A!==a,l){let o=G(s,a),{valuesToKeep:i}=await _inquirer2.default.prompt([{name:"valuesToKeep",message:"Keep rows matching this value",type:"checkbox",default:e,choices:o}]);s=s.filter(r=>i.includes(r[a]))}}return _chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Importing ${s.length} requests`)),s}var _cliprogress = require('cli-progress'); var _cliprogress2 = _interopRequireDefault(_cliprogress);async function Us({requestActions:n,auth:e,requestIds:s,statuses:l=[_privacytypes.RequestStatus.Compiling,_privacytypes.RequestStatus.RequestMade,_privacytypes.RequestStatus.Delayed,_privacytypes.RequestStatus.Approving,_privacytypes.RequestStatus.Secondary,_privacytypes.RequestStatus.Enriching,_privacytypes.RequestStatus.Waiting,_privacytypes.RequestStatus.SecondaryApproving],createdAtAfter:a,createdAtBefore:o,concurrency:i=100,transcendUrl:r=_chunkKC7NDLN7cjs.e}){let t=_chunkMPI5VURJcjs.Wd.call(void 0, r,e),y=new Date().getTime(),c=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),g=await _chunkMPI5VURJcjs.ne.call(void 0, t,{actions:n,statuses:l,createdAtBefore:o,createdAtAfter:a,isSilent:!1,requestIds:s});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Marking "${g.length}" as silent mode.`));let m=0;c.start(g.length,0),await _chunkMPI5VURJcjs.b.call(void 0, g,async f=>{await _chunkMPI5VURJcjs.cc.call(void 0, t,_chunkMPI5VURJcjs._,{input:{id:f.id,isSilent:!0}}),m+=1,c.update(m)},{concurrency:i}),c.stop();let p=new Date().getTime()-y;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully marked ${m} requests as silent mode in "${p/1e3}" seconds!`)),g.length}async function gt(n,e){let s=_typeutils.getValues.call(void 0, ne).filter(a=>!e.getValue("columnNames",a)),l=s.length===0?{}:await _inquirer2.default.prompt(s.map(a=>{let o=_chunk3EZGFSMDcjs.h.call(void 0, a.replace("ColumnName","")),i=ae(n,o,et[a],!!tt[a]);return{name:a,message:`Choose the column that will be used to map in the field: ${o}`,type:"list",default:i[0],choices:i}}));return await Promise.all(_typeutils.getEntries.call(void 0, l).map(([a,o])=>e.setValue(o,"columnNames",a))),l}async function yt(n,e,{state:s,columnNameMap:l}){let a=f=>s.getValue("columnNames",f)||l[f],{internalSubjects:o}=await _chunkMPI5VURJcjs.cc.call(void 0, n,_chunkMPI5VURJcjs.y);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for request action"));let i=await te(G(e,a("requestType")),Object.values(_privacytypes.RequestAction),s.getValue("requestTypeToRequestAction"));await s.setValue(i,"requestTypeToRequestAction"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for subject"));let r=await te(G(e,a("subjectType")),o.map(({type:f})=>f),s.getValue("subjectTypeToSubjectName"));await s.setValue(r,"subjectTypeToSubjectName"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for locale"));let t=await te(G(e,a("locale")),Object.values(_internationalization.LanguageKey),s.getValue("languageToLocale"));await s.setValue(t,"languageToLocale"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for request status")),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for request status"));let y=a("requestStatus"),c=y===A?{}:await te(G(e,y),[...Object.values(_privacytypes.CompletedRequestStatus),A],s.getValue("statusToRequestStatus"));await s.setValue(c,"statusToRequestStatus"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for country"));let g=a("country"),m=g===A?{}:await te(G(e,g),[...Object.values(_privacytypes.IsoCountryCode),A],s.getValue("regionToCountry"));await s.setValue(m,"regionToCountry"),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Determining mapping of columns for country sub division"));let d=a("countrySubDivision"),p=d===A?{}:await te(G(e,d),[...Object.values(_privacytypes.IsoCountrySubdivisionCode),A],s.getValue("regionToCountrySubDivision"));await s.setValue(p,"regionToCountrySubDivision")}var _iotstypes = require('io-ts-types');var Pr=D.record(D.string,D.array(D.intersection([D.type({value:D.string}),D.partial({name:D.string})]))),ho= exports.x =D.intersection([D.type({email:D.string,attestedExtraIdentifiers:Pr,coreIdentifier:D.string,requestType:_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction),subjectType:D.string}),D.partial({country:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountryCode),countrySubDivision:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountrySubdivisionCode),attributes:D.array(at),status:_typeutils.valuesOf.call(void 0, _privacytypes.CompletedRequestStatus),createdAt:_iotstypes.DateFromISOString,dataSiloIds:D.array(D.string),locale:_typeutils.valuesOf.call(void 0, _internationalization.LanguageKey)})]);function Dr(n,e,s){if(e===_privacytypes.IdentifierType.Email)return n.toLowerCase();if(e===_privacytypes.IdentifierType.Phone){let l=n.replace(_privacytypes.NORMALIZE_PHONE_NUMBER,"").replace(/[()]/g,"").replace(/[–]/g,"").replace(/[:]/g,"").replace(/[‭‬]/g,"").replace(/[A-Za-z]/g,"");return l?l.startsWith("+")?l:`+${s}${l}`:""}return n}function qt(n,e,{columnNameMap:s,identifierNameMap:l,attributeNameMap:a,requestAttributeKeys:o,defaultPhoneCountryCode:i="1"}){let r=t=>e.getValue("columnNames",t)||s[t];return n.map(t=>{let y={};Object.entries(l).filter(([,d])=>d!==A).forEach(([d,p])=>{let f=Object.values(_privacytypes.IdentifierType).includes(d)?d:_privacytypes.IdentifierType.Custom,h=t[p];if(h){let S=Dr(h,f,i);S&&(y[f]||(y[f]=[]),y[f].push({value:S,name:d}))}});let c=[];Object.entries(a).filter(([,d])=>d!==A).forEach(([d,p])=>{let f=t[p];if(f){let h=_optionalChain([o, 'access', _2 => _2.find, 'call', _3 => _3(S=>S.name===d), 'optionalAccess', _4 => _4.type])==="MULTI_SELECT";c.push({values:h?Ee(f):f,key:d})}});let g=r("requestType"),m=r("subjectType");return[t,{email:t[r("email")],attestedExtraIdentifiers:y,attributes:c,coreIdentifier:t[r("coreIdentifier")],requestType:g===pe?e.getValue("requestTypeToRequestAction",De):e.getValue("requestTypeToRequestAction",t[g]),subjectType:m===pe?e.getValue("subjectTypeToSubjectName",De):e.getValue("subjectTypeToSubjectName",t[m]),...r("locale")!==A&&t[r("locale")]?{locale:e.getValue("languageToLocale",t[r("locale")])}:{},...r("country")!==A&&t[r("country")]?{country:e.getValue("regionToCountry",t[r("country")])}:{},...r("countrySubDivision")!==A&&t[r("countrySubDivision")]?{countrySubDivision:e.getValue("regionToCountrySubDivision",t[r("countrySubDivision")])}:{},...r("requestStatus")!==A&&e.getValue("statusToRequestStatus",t[r("requestStatus")])!==A&&t[r("requestStatus")]?{status:e.getValue("statusToRequestStatus",t[r("requestStatus")])}:{},...r("createdAt")!==A&&t[r("createdAt")]?{createdAt:new Date(t[r("createdAt")])}:{},...r("dataSiloIds")!==A&&t[r("dataSiloIds")]?{dataSiloIds:Ee(t[r("dataSiloIds")])}:{}}]})}var St=q.type({defaultMessage:q.string,id:q.string}),xr= exports.B =q.type({downloadKey:q.string,error:q.union([q.null,q.string]),mimetype:q.string,size:q.string,fileName:q.string,dataPoint:q.type({id:q.string,title:q.union([St,q.null]),description:q.union([St,q.null]),name:q.string,slug:q.string,encryption:q.union([_typeutils.valuesOf.call(void 0, _privacytypes.TableEncryptionType),q.null]),dataSilo:q.type({id:q.string,title:q.string,description:q.string,type:q.string,outerType:q.union([q.string,q.null])}),path:q.array(q.string)})}),Lr= exports.C =q.type({nodes:q.array(xr),totalCount:q.number,_links:q.partial({next:q.union([q.string,q.null]),previous:q.union([q.string,q.null])})});async function bt(n,{sombra:e,concurrency:s=5,limit:l=100}){_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling file metadata for ${n.length} requests`));let a=new Date().getTime(),o=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),i=0;o.start(n.length,0);let r=await _chunkMPI5VURJcjs.b.call(void 0, n,async c=>{let g=[],m=!0,d=0;for(;m;){let p;try{let f=await e.get(`v1/data-subject-request/${c.id}/download-keys`,{searchParams:{limit:l,offset:d}}).json();p=_typeutils.decodeCodec.call(void 0, Lr,f),g.push(...p.nodes),d+=l,m=!!p._links.next&&p.nodes.length===l}catch(f){throw new Error(`Received an error from server: ${_optionalChain([f, 'optionalAccess', _5 => _5.response, 'optionalAccess', _6 => _6.body])||_optionalChain([f, 'optionalAccess', _7 => _7.message])}`)}}return i+=1,o.update(i),[c,g]},{concurrency:s});o.stop();let y=new Date().getTime()-a;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully downloaded file metadata ${n.length} requests in "${y/1e3}" seconds!`)),r}async function Tt(n,{requestId:e,sombra:s,onFileDownloaded:l,concurrency:a=20}){await _chunkMPI5VURJcjs.b.call(void 0, n,async o=>{try{await s.get("v1/files",{searchParams:{downloadKey:o.downloadKey}}).buffer().then(i=>l(o,i))}catch(i){if(_optionalChain([i, 'optionalAccess', _8 => _8.response, 'optionalAccess', _9 => _9.body, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11("fileMetadata#verify")])){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to pull file for: ${o.fileName} (request:${e}) - JWT expired. This likely means that the file is no longer available. Try restarting the request from scratch in Transcend Admin Dashboard. Skipping the download of this file.`));return}throw new Error(`Received an error from server: ${_optionalChain([i, 'optionalAccess', _12 => _12.response, 'optionalAccess', _13 => _13.body])||_optionalChain([i, 'optionalAccess', _14 => _14.message])}`)}},{concurrency:a})}var _path = require('path');async function Uo({auth:n,folderPath:e,requestIds:s,createdAtBefore:l,sombraAuth:a,createdAtAfter:o,statuses:i=[_privacytypes.RequestStatus.Approving,_privacytypes.RequestStatus.Downloadable],concurrency:r=5,transcendUrl:t=_chunkKC7NDLN7cjs.e,approveAfterDownload:y=!1}){let c=_chunkMPI5VURJcjs.Wd.call(void 0, t,n),g=await _chunkMPI5VURJcjs.Xd.call(void 0, t,n,a);_fs.existsSync.call(void 0, e)||_fs.mkdirSync.call(void 0, e);let m=await _chunkMPI5VURJcjs.ne.call(void 0, c,{actions:[_privacytypes.RequestAction.Access],createdAtBefore:l,createdAtAfter:o,statuses:i,requestIds:s}),d=await bt(m,{sombra:g,concurrency:r}),p=new Date().getTime(),f=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),h=0,S=0;f.start(m.length,0),await _chunkMPI5VURJcjs.b.call(void 0, d,async([v,x])=>{let K=_path.join.call(void 0, e,v.id);_fs.existsSync.call(void 0, K)||_fs.mkdirSync.call(void 0, K),await Tt(x,{sombra:g,requestId:v.id,onFileDownloaded:($,_)=>{let z=_path.join.call(void 0, K,$.fileName),j=_path.dirname.call(void 0, z);_fs.existsSync.call(void 0, j)||_fs.mkdirSync.call(void 0, j,{recursive:!0}),_fs.writeFileSync.call(void 0, z,_)}}),y&&v.status===_privacytypes.RequestStatus.Approving&&(await _chunkMPI5VURJcjs.cc.call(void 0, c,_chunkMPI5VURJcjs.Y,{input:{requestId:v.id}}),S+=1),h+=1,f.update(h)},{concurrency:r}),f.stop();let T=new Date().getTime()-p;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully downloaded ${h} requests in "${T/1e3}" seconds!`)),S>0&&_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Approved ${S} requests in Transcend.`)),m.length}var Le=I.type({id:I.string,link:I.string,status:_typeutils.valuesOf.call(void 0, _privacytypes.RequestStatus),type:_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction),subjectType:I.string,email:I.union([I.null,I.string]),coreIdentifier:I.string,isSilent:I.boolean,isTest:I.boolean,country:I.union([I.null,_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountryCode)]),countrySubDivision:I.union([I.null,_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountrySubdivisionCode)]),attributeValues:I.array(I.type({attributeKey:I.type({name:I.string}),name:I.string}))});async function It(n,e,{details:s="",isTest:l=!1,emailIsVerified:a=!0,skipSendingReceipt:o=!1,isSilent:i=!0,additionalAttributes:r=[]}={}){let t=[...r];(e.attributes||[]).forEach(g=>{let m=t.find(d=>d.key===g.key);m?(m.values.push(...g.values),m.values=_chunk3EZGFSMDcjs.j.call(void 0, m.values)):t.push(g)});let y;try{y=await n.post("v1/data-subject-request",{json:{type:e.requestType,subject:{coreIdentifier:e.coreIdentifier,email:e.email,emailIsVerified:a,attestedExtraIdentifiers:e.attestedExtraIdentifiers},subjectType:e.subjectType,isSilent:i,isTest:l,skipSendingReceipt:o,...e.locale?{locale:e.locale}:{},details:s,attributes:t,...e.country||e.countrySubDivision?{region:{...e.country?{country:e.country}:e.countrySubDivision?{country:e.countrySubDivision.split("-")[0]}:{},...e.countrySubDivision?{countrySubDivision:e.countrySubDivision}:{}}}:{},...e.createdAt?{createdAt:e.createdAt}:{},...e.dataSiloIds?{dataSiloIds:e.dataSiloIds}:{},...e.status?{completedRequestStatus:e.status}:{}}}).json()}catch(g){throw new Error(`Received an error from server: ${_optionalChain([g, 'optionalAccess', _15 => _15.response, 'optionalAccess', _16 => _16.body])||_optionalChain([g, 'optionalAccess', _17 => _17.message])}`)}let{request:c}=_typeutils.decodeCodec.call(void 0, I.type({request:Le}),y);return c}async function oi({requestActions:n,requestOrigins:e,auth:s,silentModeBefore:l,createdAtAfter:a,createdAtBefore:o,concurrency:i=50,transcendUrl:r=_chunkKC7NDLN7cjs.e}){let t=_chunkMPI5VURJcjs.Wd.call(void 0, r,s),y=new Date().getTime(),c=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),g=await _chunkMPI5VURJcjs.ne.call(void 0, t,{actions:n,statuses:[_privacytypes.RequestStatus.Approving],createdAtAfter:a,origins:e,createdAtBefore:o});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Approving "${g.length}" requests.`));let m=0,d=0;c.start(g.length,0),await _chunkMPI5VURJcjs.b.call(void 0, g,async h=>{l&&new Date(l)>new Date(h.createdAt)&&await _chunkMPI5VURJcjs.cc.call(void 0, t,_chunkMPI5VURJcjs._,{input:{id:h.id,isSilent:!0}});try{await _chunkMPI5VURJcjs.cc.call(void 0, t,_chunkMPI5VURJcjs.Y,{input:{requestId:h.id}})}catch(S){S.message.includes("Request must be in an approving state,")&&(d+=1)}m+=1,c.update(m)},{concurrency:i}),c.stop();let f=new Date().getTime()-y;return d>0&&_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`${d} requests were skipped.`)),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully approved ${m} requests in "${f/1e3}" seconds!`)),g.length}async function fi({requestActions:n=Object.values(_privacytypes.RequestAction),auth:e,requestIds:s,createdAtBefore:l,days:a=45,daysLeft:o=10,createdAtAfter:i,emailTemplate:r="Additional Time Needed",concurrency:t=100,transcendUrl:y=_chunkKC7NDLN7cjs.e}){let c=_chunkMPI5VURJcjs.Wd.call(void 0, y,e),g=new Date().getTime(),m=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),p=(await _chunkMPI5VURJcjs.hd.call(void 0, c,r)).find(T=>T.title===r);if(!p)throw new Error(`Failed to find a template with title: "${r}"`);let f=await _chunkMPI5VURJcjs.ne.call(void 0, c,{actions:n,createdAtBefore:l,createdAtAfter:i,isSilent:!1,isClosed:!1,requestIds:s});f=f.filter(T=>typeof T.daysRemaining=="number"&&T.daysRemaining<o),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Notifying "${f.length}" that more time is needed.`));let h=0;m.start(f.length,0),await _chunkMPI5VURJcjs.b.call(void 0, f,async T=>{await _chunkMPI5VURJcjs.cc.call(void 0, c,_chunkMPI5VURJcjs.$,{input:{requestId:T.id,template:p.template.defaultMessage,subject:p.subject.defaultMessage,additionalTime:a}}),h+=1,m.update(h)},{concurrency:t}),m.stop();let N=new Date().getTime()-g;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully marked ${h} requests as silent mode in "${N/1e3}" seconds!`)),f.length}async function vt(n,e,s){let{initializer:l}=await _chunkMPI5VURJcjs.cc.call(void 0, n,_chunkMPI5VURJcjs.q),a=l.identifiers.filter(({name:i})=>!s.getValue("identifierNames",i)&&!be.includes(i)),o=a.length===0?{}:await _inquirer2.default.prompt(a.map(({name:i})=>{let r=ae(e,i,!1);return{name:i,message:`Choose the column that will be used to map in the identifier: ${i}`,type:"list",default:r[0],choices:r}}));return await Promise.all(Object.entries(o).map(([i,r])=>s.setValue(r,"identifierNames",i))),{...s.getValue("identifierNames"),...o}}async function Ni({requestActions:n,cancellationTitle:e,auth:s,requestIds:l,silentModeBefore:a,createdAtBefore:o,createdAtAfter:i,statuses:r=[_privacytypes.RequestStatus.Compiling,_privacytypes.RequestStatus.RequestMade,_privacytypes.RequestStatus.Delayed,_privacytypes.RequestStatus.Approving,_privacytypes.RequestStatus.Secondary,_privacytypes.RequestStatus.Enriching,_privacytypes.RequestStatus.Waiting,_privacytypes.RequestStatus.SecondaryApproving],concurrency:t=50,transcendUrl:y=_chunkKC7NDLN7cjs.e}){let c=_chunkMPI5VURJcjs.Wd.call(void 0, y,s),g=new Date().getTime(),m=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),d;if(e){let T=(await _chunkMPI5VURJcjs.hd.call(void 0, c,e)).find(v=>v.title===e);if(!T)throw new Error(`Failed to find a template with title: "${e}"`);d=T}let p=await _chunkMPI5VURJcjs.ne.call(void 0, c,{actions:n,createdAtBefore:o,createdAtAfter:i,statuses:r,requestIds:l});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Canceling "${p.length}" requests${d?` Using template: ${d.title}`:""}.`));let f=0;m.start(p.length,0),await _chunkMPI5VURJcjs.b.call(void 0, p,async N=>{a&&new Date(a)>new Date(N.createdAt)&&await _chunkMPI5VURJcjs.cc.call(void 0, c,_chunkMPI5VURJcjs._,{input:{id:N.id,isSilent:!0}}),await _chunkMPI5VURJcjs.cc.call(void 0, c,_chunkMPI5VURJcjs.Z,{input:{requestId:N.id,...d?{subject:`Re: ${d.subject.defaultMessage}`,template:d.template.defaultMessage}:{}}}),f+=1,m.update(f)},{concurrency:t}),m.stop();let S=new Date().getTime()-g;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully canceled ${f} requests in "${S/1e3}" seconds!`)),p.length}async function Lt(n,e,s,l){let a=l.filter(({name:i})=>!s.getValue("attributeNames",i)),o=a.length===0?{}:await _inquirer2.default.prompt(a.map(({name:i})=>{let r=ae(e,i,!1);return{name:i,message:`Choose the column that will be used to map in the attribute: ${i}`,type:"list",default:r[0],choices:r}}));return await Promise.all(Object.entries(o).map(([i,r])=>s.setValue(r,"attributeNames",i))),{...s.getValue("attributeNames"),...o}}var $t=/{\\"message\\":\\"(.+?)\\",/;function Ie(n){return $t.test(n)?$t.exec(n)[1]:null}var _persistedstate = require('@transcend-io/persisted-state');async function sn({cacheFilepath:n,requestReceiptFolder:e,file:s,auth:l,sombraAuth:a,concurrency:o=100,defaultPhoneCountryCode:i="1",transcendUrl:r=_chunkKC7NDLN7cjs.e,attributes:t=[],emailIsVerified:y=!0,skipFilterStep:c=!1,skipSendingReceipt:g=!0,isTest:m=!1,isSilent:d=!0,debug:p=!1,dryRun:f=!1}){let h=new Date().getTime(),S=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),N=ut(t),T=new (0, _persistedstate.PersistedState)(n,rt,{columnNames:{},requestTypeToRequestAction:{},subjectTypeToSubjectName:{},languageToLocale:{},statusToRequestStatus:{},identifierNames:{},attributeNames:{},regionToCountrySubDivision:{},regionToCountry:{}}),v=_path.join.call(void 0, e,`tr-request-upload-${new Date().toISOString()}-${s.split("/").pop()}`.replace(".csv",".json")),x=new (0, _persistedstate.PersistedState)(v,st,{successfulRequests:[],duplicateRequests:[],failingRequests:[]}),K=await _chunkMPI5VURJcjs.Xd.call(void 0, r,l,a),$=ct(s,de.record(de.string,de.string)),_=_chunk3EZGFSMDcjs.j.call(void 0, $.map(U=>Object.keys(U)).flat());if($.length===0)throw new Error("No Requests found in list! Ensure the first row of the CSV is a header and the rest are requests.");if(p){let U=$[0];_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`First request: ${JSON.stringify(U,null,2)}`))}let z=c?$:await pt($),j=_chunkMPI5VURJcjs.Wd.call(void 0, r,l),L=await _chunkMPI5VURJcjs.ce.call(void 0, j),B=await gt(_,T),Y=await vt(j,_,T),k=await Lt(j,_,T,L);await yt(j,z,{state:T,columnNameMap:B});let O=qt(z,T,{defaultPhoneCountryCode:i,columnNameMap:B,identifierNameMap:Y,attributeNameMap:k,requestAttributeKeys:L});p||S.start(O.length,0);let X=0;await _chunkMPI5VURJcjs.b.call(void 0, O,async([U,V],Q)=>{let _e=p?`email:${V.email} | coreIdentifier:${V.coreIdentifier}`:`row:${Q.toString()}`;if(p&&_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`[${Q+1}/${O.length}] Importing: ${JSON.stringify(V,null,2)}`)),f){_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Bailing out on dry run because dryRun is set"));return}try{let ee=await It(K,V,{details:`Uploaded by Transcend Cli: "tr-request-upload" : ${JSON.stringify(U,null,2)}`,isTest:m,emailIsVerified:y,skipSendingReceipt:g,isSilent:d,additionalAttributes:N});p&&(_chunkZUNVPK23cjs.a.info(_colors2.default.green(`[${Q+1}/${O.length}] Successfully submitted the test data subject request: "${_e}"`)),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`[${Q+1}/${O.length}] View it at: "${ee.link}"`)));let oe=x.getValue("successfulRequests");oe.push({id:ee.id,link:ee.link,rowIndex:Q,coreIdentifier:ee.coreIdentifier,attemptedAt:new Date().toISOString()}),await x.setValue(oe,"successfulRequests")}catch(ee){let oe=`${ee.message} - ${JSON.stringify(_optionalChain([ee, 'access', _18 => _18.response, 'optionalAccess', _19 => _19.body]),null,2)}`,Pe=Ie(oe);if(Pe==="Client error: You have already made this request."){p&&_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`[${Q+1}/${O.length}] Skipping request as it is a duplicate`));let le=x.getValue("duplicateRequests");le.push({coreIdentifier:V.coreIdentifier,rowIndex:Q,attemptedAt:new Date().toISOString()}),await x.setValue(le,"duplicateRequests")}else{let le=x.getValue("failingRequests");le.push({...V,rowIndex:Q,error:Pe||oe,attemptedAt:new Date().toISOString()}),await x.setValue(le,"failingRequests"),p&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(Pe||oe)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(`[${Q+1}/${O.length}] Failed to submit request for: "${_e}"`)))}}X+=1,p||S.update(X)},{concurrency:o}),S.stop();let ue=new Date().getTime()-h;_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Completed upload in "${ue/1e3}" seconds.`)),x.getValue("duplicateRequests").length>0&&_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`Encountered "${x.getValue("duplicateRequests").length}" duplicate requests. See "${v}" to review the core identifiers for these requests.`)),x.getValue("failingRequests").length>0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Encountered "${x.getValue("failingRequests").length}" errors. See "${v}" to review the error messages and inputs.`)),process.exit(1))}async function _t(n,e,{sendEmailReceipt:s=!1,skipWaitingPeriod:l=!1,emailIsVerified:a=!0,requestIdentifiers:o=[]}={}){let i=await n.post("v1/data-subject-request",{json:{type:e.type,subject:{coreIdentifier:e.coreIdentifier,email:e.email,emailIsVerified:a,...o.length>0?{attestedExtraIdentifiers:_typeutils.apply.call(void 0, _chunk3EZGFSMDcjs.d.call(void 0, o.filter(t=>!(t.name==="email"&&t.value===e.email)&&!be.includes(t.name)).map(t=>({...t,type:Object.values(_privacytypes.IdentifierType).includes(t.name)?t.name:_privacytypes.IdentifierType.Custom})),"type"),(t,y)=>t.map(({name:c,value:g})=>({...y===_privacytypes.IdentifierType.Custom?{name:c}:{},value:g})))}:{}},requestId:e.id,subjectType:e.subjectType,isSilent:e.isSilent,isTest:e.isTest,locale:e.locale,skipWaitingPeriod:l,createdAt:e.createdAt,details:`Restarted by Transcend cli: "tr-request-restart" - ${e.details}`,skipSendingReceipt:!s}}).json(),{request:r}=_typeutils.decodeCodec.call(void 0, Ft.type({request:Le}),i);return r}var Hr=M.intersection([Te,M.type({error:M.string})]),Xr=M.type({restartedRequests:M.array(Te),failingRequests:M.array(Hr)});async function wn({requestReceiptFolder:n,auth:e,sombraAuth:s,requestActions:l,requestStatuses:a,createdAtBefore:o,createdAtAfter:i,transcendUrl:r=_chunkKC7NDLN7cjs.e,requestIds:t=[],createdAt:y=new Date,silentModeBefore:c,sendEmailReceipt:g=!1,emailIsVerified:m=!0,copyIdentifiers:d=!1,skipWaitingPeriod:p=!1,concurrency:f=20}){let h=new Date().getTime(),S=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),N=_path.join.call(void 0, n,`tr-request-restart-${new Date().toISOString()}`),T=new (0, _persistedstate.PersistedState)(N,Xr,{restartedRequests:[],failingRequests:[]}),v=await _chunkMPI5VURJcjs.Xd.call(void 0, r,e,s),x=_chunkMPI5VURJcjs.Wd.call(void 0, r,e),$=(await _chunkMPI5VURJcjs.ne.call(void 0, x,{actions:l,statuses:a,createdAtBefore:o,createdAtAfter:i})).filter(L=>new Date(L.createdAt)<y);if(_chunkZUNVPK23cjs.a.info(`Found ${$.length} requests to process`),d&&_chunkZUNVPK23cjs.a.info("copyIdentifiers detected - All Identifiers will be copied."),g&&_chunkZUNVPK23cjs.a.info("sendEmailReceipt detected - Email receipts will be sent."),p&&_chunkZUNVPK23cjs.a.info("skipWaitingPeriod detected - Waiting period will be skipped."),t.length>0&&t.length!==$.length){let L=_chunk3EZGFSMDcjs.c.call(void 0, t,$.map(({id:B})=>B));L.length>0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to find the following requests by ID: ${L.join(",")}.`)),process.exit(1))}let _=0;S.start($.length,0),await _chunkMPI5VURJcjs.b.call(void 0, $,async(L,B)=>{try{let Y=d?await _chunkMPI5VURJcjs.le.call(void 0, x,v,{requestId:L.id}):[],k=await _t(v,{...L,isSilent:c&&new Date(L.createdAt)<c?!0:L.isSilent},{requestIdentifiers:Y,skipWaitingPeriod:p,sendEmailReceipt:g,emailIsVerified:m}),O=T.getValue("restartedRequests");O.push({id:k.id,link:k.link,rowIndex:B,coreIdentifier:k.coreIdentifier,attemptedAt:new Date().toISOString()}),await T.setValue(O,"restartedRequests")}catch(Y){let k=`${Y.message} - ${JSON.stringify(_optionalChain([Y, 'access', _20 => _20.response, 'optionalAccess', _21 => _21.body]),null,2)}`,O=Ie(k),X=T.getValue("failingRequests");X.push({id:L.id,link:L.link,rowIndex:B,coreIdentifier:L.coreIdentifier,attemptedAt:new Date().toISOString(),error:O||k}),await T.setValue(X,"failingRequests")}_+=1,S.update(_)},{concurrency:f}),S.stop();let j=new Date().getTime()-h;_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Completed restarting of requests in "${j/1e3}" seconds.`)),T.getValue("failingRequests").length>0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Encountered "${T.getValue("failingRequests").length}" errors. See "${N}" to review the error messages and inputs.`)),process.exit(1))}async function Ln({enricherIds:n,auth:e,concurrency:s=100,transcendUrl:l=_chunkKC7NDLN7cjs.e}){let a=_chunkMPI5VURJcjs.Wd.call(void 0, l,e),o=new Date().getTime(),i=await _chunkMPI5VURJcjs.ne.call(void 0, a,{statuses:[_privacytypes.RequestStatus.Enriching]});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Processing enricher: "${n.join(",")}" fetched "${i.length}" in enriching status.`));let r=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),t=0;r.start(i.length,0);let y=0;await _chunkMPI5VURJcjs.b.call(void 0, i,async m=>{let p=(await _chunkMPI5VURJcjs.ie.call(void 0, a,{requestId:m.id})).filter(f=>n.includes(f.enricher.id)&&![_privacytypes.RequestEnricherStatus.Resolved,_privacytypes.RequestEnricherStatus.Skipped].includes(f.status));p.length>0&&await _chunkMPI5VURJcjs.a.call(void 0, p,async f=>{try{await _chunkMPI5VURJcjs.cc.call(void 0, a,_chunkMPI5VURJcjs.ea,{requestEnricherId:f.id}),y+=1}catch(h){if(!h.message.includes("Client error: Cannot skip Request enricher because it has already completed"))throw h}}),t+=1,r.update(t)},{concurrency:s}),r.stop();let g=new Date().getTime()-o;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully skipped "${y}" for "${i.length}" requests in "${g/1e3}" seconds!`)),i.length}async function Qn({auth:n,requestActions:e=[],createdAtBefore:s,createdAtAfter:l,transcendUrl:a=_chunkKC7NDLN7cjs.e,requestEnricherStatuses:o=Object.values(_privacytypes.RequestEnricherStatus),requestIds:i=[],enricherId:r,concurrency:t=20}){let y=new Date().getTime(),c=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),g=_chunkMPI5VURJcjs.Wd.call(void 0, a,n);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Fetching requests to restart..."));let m=await _chunkMPI5VURJcjs.ne.call(void 0, g,{actions:e,statuses:[_privacytypes.RequestStatus.Enriching],createdAtBefore:s,createdAtAfter:l,requestIds:i}),d=0;if(i.length>0&&i.length!==m.length){let S=_chunk3EZGFSMDcjs.c.call(void 0, i,m.map(({id:N})=>N));S.length>0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to find the following requests by ID: ${S.join(",")}.`)),process.exit(1))}let p=0;c.start(m.length,0),await _chunkMPI5VURJcjs.b.call(void 0, m,async S=>{let T=(await _chunkMPI5VURJcjs.ie.call(void 0, g,{requestId:S.id})).filter(v=>v.enricher.id===r&&o.includes(v.status));await _chunkMPI5VURJcjs.b.call(void 0, T,async v=>{await _chunkMPI5VURJcjs.Je.call(void 0, g,v.id),d+=1}),p+=1,c.update(p)},{concurrency:t}),c.stop();let h=new Date().getTime()-y;_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Completed restarting of ${m.length} requests and ${d} enrichers in "${h/1e3}" seconds.`))}async function ea({requestActions:n,dataSiloId:e,auth:s,concurrency:l=20,transcendUrl:a=_chunkKC7NDLN7cjs.e}){let o=_chunkMPI5VURJcjs.Wd.call(void 0, a,s),i=new Date().getTime(),r=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),t=await _chunkMPI5VURJcjs.ne.call(void 0, o,{actions:n,statuses:[_privacytypes.RequestStatus.Compiling,_privacytypes.RequestStatus.Approving]});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Retrying requests for Data Silo: "${e}", restarting "${t.length}" requests.`));let y=0,c=0;r.start(t.length,0),await _chunkMPI5VURJcjs.b.call(void 0, t,async d=>{try{let p=await _chunkMPI5VURJcjs.te.call(void 0, o,{requestId:d.id,dataSiloId:e});await _chunkMPI5VURJcjs.cc.call(void 0, o,_chunkMPI5VURJcjs.xa,{requestDataSiloId:p.id})}catch(p){if(!p.message.includes("Failed to find RequestDataSilo"))throw p;c+=1}y+=1,r.update(y)},{concurrency:l}),r.stop();let m=new Date().getTime()-i;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully notified Transcend in "${m/1e3}" seconds for ${y} requests, ${c} requests were skipped because data silo was not attached to the request!`)),t.length}async function ca({auth:n,sombraAuth:e,actions:s=[],statuses:l=[],identifierSearch:a,pageLimit:o=100,transcendUrl:i=_chunkKC7NDLN7cjs.e,createdAtBefore:r,createdAtAfter:t,isTest:y}){let c=_chunkMPI5VURJcjs.Wd.call(void 0, i,n),g=await _chunkMPI5VURJcjs.Xd.call(void 0, i,n,e),m="";r&&(m+=` before ${r.toISOString()}`),t&&(m+=`${m?", and":""} after ${t.toISOString()}`),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`${s.length>0?`Pulling requests of type "${s.join('" , "')}"`:"Pulling all requests"}${m}`));let d=await _chunkMPI5VURJcjs.ne.call(void 0, c,{actions:s,text:a,statuses:l,createdAtBefore:r,createdAtAfter:t,isTest:y}),p=await _chunkMPI5VURJcjs.b.call(void 0, d,async h=>{let S=await _chunkMPI5VURJcjs.le.call(void 0, c,g,{requestId:h.id});return{...h,requestIdentifiers:S}},{concurrency:o});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulled ${p.length} requests`));let f=p.map(({attributeValues:h,requestIdentifiers:S,id:N,email:T,type:v,status:x,subjectType:K,details:$,createdAt:_,country:z,locale:j,origin:L,countrySubDivision:B,isSilent:Y,isTest:k,coreIdentifier:O,...X})=>({"Request ID":N,"Created At":_,Email:T,"Core Identifier":O,"Request Type":v,"Data Subject Type":K,Status:x,Country:z,"Country Sub Division":B,Details:$,Origin:L,"Silent Mode":Y,"Is Test Request":k,Language:j,...X,...Object.entries(_chunk3EZGFSMDcjs.d.call(void 0, h,"attributeKey.name")).reduce((ge,[ue,U])=>Object.assign(ge,{[ue]:U.map(({name:V})=>V).join(",")}),{}),...Object.entries(_chunk3EZGFSMDcjs.d.call(void 0, S,"name")).reduce((ge,[ue,U])=>Object.assign(ge,{[ue]:U.map(({value:V})=>V).join(",")}),{})}));return{requestsWithRequestIdentifiers:p,requestsFormattedForCsv:f}}async function ha({dataSiloId:n,auth:e,concurrency:s=100,status:l="SKIPPED",transcendUrl:a=_chunkKC7NDLN7cjs.e,requestStatuses:o=[_privacytypes.RequestStatus.Compiling,_privacytypes.RequestStatus.Secondary]}){let i=_chunkMPI5VURJcjs.Wd.call(void 0, a,e),r=new Date().getTime(),t=await _chunkMPI5VURJcjs.se.call(void 0, i,{dataSiloId:n,requestStatuses:o});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Processing data silo: "${n}" marking "${t.length}" requests as skipped.`));let y=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),c=0;y.start(t.length,0),await _chunkMPI5VURJcjs.b.call(void 0, t,async d=>{try{await _chunkMPI5VURJcjs.cc.call(void 0, i,_chunkMPI5VURJcjs.wa,{requestDataSiloId:d.id,status:l})}catch(p){if(!p.message.includes("Client error: Request must be active:"))throw p}c+=1,y.update(c)},{concurrency:s}),y.stop();let m=new Date().getTime()-r;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully skipped "${t.length}" requests in "${m/1e3}" seconds!`)),t.length}async function Ea({requestActions:n,identifierNames:e,auth:s,concurrency:l=20,transcendUrl:a=_chunkKC7NDLN7cjs.e}){let o=_chunkMPI5VURJcjs.Wd.call(void 0, a,s),i=new Date().getTime(),r=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),t=await _chunkMPI5VURJcjs.ne.call(void 0, o,{actions:n,statuses:[_privacytypes.RequestStatus.Enriching]});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Fetched requests in preflight/enriching state."));let y=0,c=0;r.start(t.length,0),await _chunkMPI5VURJcjs.b.call(void 0, t,async d=>{let f=(await _chunkMPI5VURJcjs.je.call(void 0, o,{requestId:d.id})).filter(({isVerifiedAtLeastOnce:h,name:S})=>h===!1&&e.includes(S)).map(({id:h})=>h);f.length>0&&(await _chunkMPI5VURJcjs.cc.call(void 0, o,_chunkMPI5VURJcjs.Ca,{input:{requestId:d.id,requestIdentifierIds:f}}),c+=f.length),y+=1,r.update(y)},{concurrency:l}),r.stop();let m=new Date().getTime()-i;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully cleared out unverified identifiers "${m/1e3}" seconds for ${y} requests, ${c} identifiers were cleared out!`)),t.length}exports.a = A; exports.b = pe; exports.c = De; exports.d = be; exports.e = ne; exports.f = et; exports.g = tt; exports.h = rt; exports.i = Te; exports.j = st; exports.k = Ae; exports.l = ae; exports.m = te; exports.n = Ee; exports.o = at; exports.p = ut; exports.q = ct; exports.r = G; exports.s = pt; exports.t = Us; exports.u = gt; exports.v = yt; exports.w = Pr; exports.x = ho; exports.y = Dr; exports.z = qt; exports.A = St; exports.B = xr; exports.C = Lr; exports.D = bt; exports.E = Tt; exports.F = Uo; exports.G = Le; exports.H = It; exports.I = oi; exports.J = fi; exports.K = vt; exports.L = Ni; exports.M = Lt; exports.N = Ie; exports.O = sn; exports.P = _t; exports.Q = wn; exports.R = Ln; exports.S = Qn; exports.T = ea; exports.U = ca; exports.V = ha; exports.W = Ea;
2
- //# sourceMappingURL=chunk-3FEOMF7G.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-6PCS4IRI.cjs","../src/lib/code-scanning/integrations/cocoaPods.ts","../src/lib/code-scanning/integrations/gradle.ts","../src/lib/code-scanning/integrations/pubspec.ts","../src/lib/code-scanning/constants.ts"],"names":["POD_TARGET_REGEX","POD_PACKAGE_REGEX","cocoaPods","filePath","fileContents","readFileSync","targets","findAllWithRegex","packages","target","ind","CodePackageType","pkg","GRADLE_IMPLEMENTATION_REGEX","GRADLE_PLUGIN_REGEX","GRADLE_IMPLEMENTATION_GROUP_REGEX","GRADLE_APPLICATION_NAME_REGEX","gradle","directory","dirname","targetPlugins","targetGroups","applications"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/chunk-6PCS4IRI.cjs","sourcesContent":[null,"import { readFileSync } from 'fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageSdk } from '../../../codecs';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { CodePackageType } from '@transcend-io/privacy-types';\n\nconst POD_TARGET_REGEX = /target ('|\")(.*?)('|\")/;\nconst POD_PACKAGE_REGEX = /pod ('|\")(.*?)('|\")(, ('|\")~> (.+?)('|\")|)/;\n\nexport const cocoaPods: CodeScanningConfig = {\n supportedFiles: ['Podfile'],\n ignoreDirs: ['Pods'],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(POD_TARGET_REGEX, 'g'),\n matches: ['quote1', 'name', 'quote2'],\n },\n fileContents,\n );\n const packages = findAllWithRegex(\n {\n value: new RegExp(POD_PACKAGE_REGEX, 'g'),\n matches: [\n 'quote1',\n 'name',\n 'quote2',\n 'extra',\n 'quote3',\n 'version',\n 'quote4',\n ],\n },\n fileContents,\n );\n\n const deps: CodePackageSdk[] = targets.map((target, ind) => ({\n name: target.name,\n type: CodePackageType.CocoaPods,\n softwareDevelopmentKits: packages\n .filter(\n (pkg) =>\n pkg.matchIndex > target.matchIndex &&\n (!targets[ind + 1] || pkg.matchIndex < targets[ind + 1].matchIndex),\n )\n .map((pkg) => ({\n name: pkg.name,\n version: pkg.version,\n })),\n }));\n\n return deps;\n },\n};\n","import { readFileSync } from 'fs';\nimport { CodeScanningConfig } from '../types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { dirname } from 'path';\n\nconst GRADLE_IMPLEMENTATION_REGEX =\n /implementation( *)('|\")(.+?):(.+?):(.+?|)('|\")/;\nconst GRADLE_PLUGIN_REGEX = /apply plugin: *('|\")(.+?)(:(.+?)|)('|\")/;\nconst GRADLE_IMPLEMENTATION_GROUP_REGEX =\n /implementation group:( *)('|\")(.+?)('|\"),( *)name:( *)('|\")(.+?)('|\"),( *)version:( *)('|\")(.+?)('|\")/;\nconst GRADLE_APPLICATION_NAME_REGEX = /applicationId( *)\"(.+?)\"/;\n\n/**\n * So far, there are three ways of defining dependencies that is supported\n * implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.core', version: '3.28.0'\n * or\n * implementation 'com.google.firebase:firebase-analytics:18.0.0'\n * or\n * apply plugin: 'com.google.gms.google-services'\n *\n * single and double quotes are both recognized\n */\nexport const gradle: CodeScanningConfig = {\n supportedFiles: ['build.gradle**'],\n ignoreDirs: [\n 'gradle-app.setting',\n 'gradle-wrapper.jar',\n 'gradle-wrapper.properties',\n ],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n const directory = dirname(filePath);\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_REGEX, 'g'),\n matches: ['space', 'quote1', 'name', 'path', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetPlugins = findAllWithRegex(\n {\n value: new RegExp(GRADLE_PLUGIN_REGEX, 'g'),\n matches: ['quote1', 'name', 'group', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetGroups = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_GROUP_REGEX, 'g'),\n matches: [\n 'space1',\n 'quote1',\n 'group',\n 'quote2',\n 'space2',\n 'space3',\n 'quote3',\n 'name',\n 'quote4',\n 'space4',\n 'space5',\n 'quote5',\n 'version',\n 'quote6',\n ],\n },\n fileContents,\n );\n const applications = findAllWithRegex(\n {\n value: new RegExp(GRADLE_APPLICATION_NAME_REGEX, 'g'),\n matches: ['space', 'name'],\n },\n fileContents,\n );\n if (applications.length > 1) {\n throw new Error(`Expected only one applicationId per file: ${filePath}`);\n }\n\n return [\n {\n name: applications[0]?.name || directory.split('/').pop()!,\n softwareDevelopmentKits: [\n ...targets,\n ...targetGroups,\n ...targetPlugins,\n ].map((target) => ({\n name: target.name,\n version: target.version || undefined,\n })),\n },\n ];\n },\n};\n","import { readFileSync } from 'fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport yaml from 'js-yaml';\nimport { dirname } from 'path';\n\n/**\n * Remove YAML comments from a string\n *\n * @param yamlString - YAML string\n * @returns String without comments\n */\nfunction removeYAMLComments(yamlString: string): string {\n return yamlString\n .split('\\n')\n .map((line) => {\n // Remove inline comments\n const commentIndex = line.indexOf('#');\n if (commentIndex > -1) {\n // Check if '#' is not inside a string\n if (\n !line.substring(0, commentIndex).includes('\"') &&\n !line.substring(0, commentIndex).includes(\"'\")\n ) {\n return line.substring(0, commentIndex).trim();\n }\n }\n return line;\n })\n .filter((line) => line.length > 0)\n .join('\\n');\n}\n\nexport const pubspec: CodeScanningConfig = {\n supportedFiles: ['pubspec.yml'],\n ignoreDirs: ['build'],\n scanFunction: (filePath) => {\n const directory = dirname(filePath);\n const fileContents = readFileSync(filePath, 'utf-8');\n const {\n name,\n description,\n dev_dependencies = {},\n dependencies = {},\n } = yaml.load(removeYAMLComments(fileContents)) as {\n /** Name */\n name?: string;\n /** Description */\n description?: string;\n /** Dev dependencies */\n dev_dependencies?: { [k in string]: number | Record<string, string> };\n /** Dependencies */\n dependencies?: { [k in string]: number | Record<string, string> };\n };\n return [\n {\n name: name || directory.split('/').pop()!,\n description,\n type: CodePackageType.RequirementsTxt,\n softwareDevelopmentKits: [\n ...Object.entries(dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n })),\n ...Object.entries(dev_dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n isDevDependency: true,\n })),\n ],\n },\n ];\n },\n};\n","import { CodeScanningConfig } from './types';\nimport {\n cocoaPods,\n gradle,\n javascriptPackageJson,\n gemfile,\n composerJson,\n pubspec,\n swift,\n pythonRequirementsTxt,\n} from './integrations';\nimport { CodePackageType } from '@transcend-io/privacy-types';\n\n/**\n * @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead\n */\nexport const SILO_DISCOVERY_CONFIGS: {\n [k in string]: CodeScanningConfig;\n} = {\n cocoaPods,\n gradle,\n javascriptPackageJson,\n pythonRequirementsTxt,\n gemfile,\n pubspec,\n swift,\n};\n\nexport const CODE_SCANNING_CONFIGS: {\n [k in CodePackageType]: CodeScanningConfig;\n} = {\n [CodePackageType.CocoaPods]: cocoaPods,\n [CodePackageType.Gradle]: gradle,\n [CodePackageType.PackageJson]: javascriptPackageJson,\n [CodePackageType.RequirementsTxt]: pythonRequirementsTxt,\n [CodePackageType.Gemfile]: gemfile,\n [CodePackageType.Pubspec]: pubspec,\n [CodePackageType.ComposerJson]: composerJson,\n [CodePackageType.Swift]: swift,\n};\n"]}