@transcend-io/cli 8.1.8 → 8.20.1

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 (113) hide show
  1. package/README.md +20 -13
  2. package/dist/bin/bash-complete.cjs +1 -1
  3. package/dist/bin/cli.cjs +1 -1
  4. package/dist/bin/deprecated-command.cjs +2 -2
  5. package/dist/{chunk-FK7EPQ7K.cjs → chunk-25BAHKKQ.cjs} +2 -2
  6. package/dist/{chunk-FK7EPQ7K.cjs.map → chunk-25BAHKKQ.cjs.map} +1 -1
  7. package/dist/{chunk-UTU4F57H.cjs → chunk-7YNUSMVA.cjs} +51 -14
  8. package/dist/{chunk-UTU4F57H.cjs.map → chunk-7YNUSMVA.cjs.map} +1 -1
  9. package/dist/{chunk-2CCKVEWS.cjs → chunk-CIUYGNQB.cjs} +2 -2
  10. package/dist/{chunk-2CCKVEWS.cjs.map → chunk-CIUYGNQB.cjs.map} +1 -1
  11. package/dist/{chunk-XCTTKA6C.cjs → chunk-FEYTT6HR.cjs} +4 -4
  12. package/dist/{chunk-XCTTKA6C.cjs.map → chunk-FEYTT6HR.cjs.map} +1 -1
  13. package/dist/{chunk-VWFYPZ4Q.cjs → chunk-GIQ4W7IV.cjs} +2 -2
  14. package/dist/{chunk-VWFYPZ4Q.cjs.map → chunk-GIQ4W7IV.cjs.map} +1 -1
  15. package/dist/{chunk-22FMPHOU.cjs → chunk-K6HEZGQI.cjs} +2 -2
  16. package/dist/{chunk-22FMPHOU.cjs.map → chunk-K6HEZGQI.cjs.map} +1 -1
  17. package/dist/{chunk-L3GIP73U.cjs → chunk-NL6N7BKE.cjs} +20 -20
  18. package/dist/{chunk-L3GIP73U.cjs.map → chunk-NL6N7BKE.cjs.map} +1 -1
  19. package/dist/{chunk-IXOC4S5L.cjs → chunk-NZDUGK2E.cjs} +3 -3
  20. package/dist/{chunk-IXOC4S5L.cjs.map → chunk-NZDUGK2E.cjs.map} +1 -1
  21. package/dist/{chunk-6LMZMYBN.cjs → chunk-OKGYUSXP.cjs} +2 -2
  22. package/dist/{chunk-6LMZMYBN.cjs.map → chunk-OKGYUSXP.cjs.map} +1 -1
  23. package/dist/{chunk-WI7C7KDM.cjs → chunk-Q3L3F6ZM.cjs} +2 -2
  24. package/dist/{chunk-WI7C7KDM.cjs.map → chunk-Q3L3F6ZM.cjs.map} +1 -1
  25. package/dist/{chunk-TXG7TJLK.cjs → chunk-SHUWLLFX.cjs} +2 -2
  26. package/dist/{chunk-TXG7TJLK.cjs.map → chunk-SHUWLLFX.cjs.map} +1 -1
  27. package/dist/{chunk-K45V7WKN.cjs → chunk-VV5ICWOA.cjs} +2 -2
  28. package/dist/{chunk-K45V7WKN.cjs.map → chunk-VV5ICWOA.cjs.map} +1 -1
  29. package/dist/{impl-XGKSU4NG.cjs → impl-2TWG5FB4.cjs} +2 -2
  30. package/dist/{impl-XGKSU4NG.cjs.map → impl-2TWG5FB4.cjs.map} +1 -1
  31. package/dist/{impl-NFM4JZLR.cjs → impl-4KY3OTA5.cjs} +2 -2
  32. package/dist/{impl-NFM4JZLR.cjs.map → impl-4KY3OTA5.cjs.map} +1 -1
  33. package/dist/{impl-FXYNZQL3.cjs → impl-4PLQOUTR.cjs} +2 -2
  34. package/dist/{impl-FXYNZQL3.cjs.map → impl-4PLQOUTR.cjs.map} +1 -1
  35. package/dist/{impl-NNT5EBMK.cjs → impl-525AVKX2.cjs} +2 -2
  36. package/dist/{impl-NNT5EBMK.cjs.map → impl-525AVKX2.cjs.map} +1 -1
  37. package/dist/{impl-DOPOJXH2.cjs → impl-5D7UM6EE.cjs} +2 -2
  38. package/dist/{impl-DOPOJXH2.cjs.map → impl-5D7UM6EE.cjs.map} +1 -1
  39. package/dist/{impl-JLVAP3PH.cjs → impl-5M24IMCM.cjs} +2 -2
  40. package/dist/{impl-JLVAP3PH.cjs.map → impl-5M24IMCM.cjs.map} +1 -1
  41. package/dist/{impl-NCKHD5HN.cjs → impl-5Q6XGXFD.cjs} +3 -3
  42. package/dist/{impl-NCKHD5HN.cjs.map → impl-5Q6XGXFD.cjs.map} +1 -1
  43. package/dist/impl-6D2ZPQOK.cjs +2 -0
  44. package/dist/{impl-XN2JRARB.cjs.map → impl-6D2ZPQOK.cjs.map} +1 -1
  45. package/dist/{impl-T3XZ5262.cjs → impl-A5AXNEAP.cjs} +2 -2
  46. package/dist/{impl-T3XZ5262.cjs.map → impl-A5AXNEAP.cjs.map} +1 -1
  47. package/dist/{impl-T2FIEZLI.cjs → impl-ALCLH443.cjs} +2 -2
  48. package/dist/{impl-T2FIEZLI.cjs.map → impl-ALCLH443.cjs.map} +1 -1
  49. package/dist/{impl-6RCILBC5.cjs → impl-CQNJ6HJQ.cjs} +2 -2
  50. package/dist/{impl-6RCILBC5.cjs.map → impl-CQNJ6HJQ.cjs.map} +1 -1
  51. package/dist/{impl-QTO2EWMC.cjs → impl-DBFAJVHK.cjs} +2 -2
  52. package/dist/{impl-QTO2EWMC.cjs.map → impl-DBFAJVHK.cjs.map} +1 -1
  53. package/dist/{impl-PFPN37IX.cjs → impl-DOKZVEDX.cjs} +2 -2
  54. package/dist/{impl-PFPN37IX.cjs.map → impl-DOKZVEDX.cjs.map} +1 -1
  55. package/dist/{impl-KZATCJTP.cjs → impl-E7OIEYXX.cjs} +6 -6
  56. package/dist/{impl-KZATCJTP.cjs.map → impl-E7OIEYXX.cjs.map} +1 -1
  57. package/dist/{impl-24WF6BP2.cjs → impl-ESGT6IFB.cjs} +2 -2
  58. package/dist/{impl-24WF6BP2.cjs.map → impl-ESGT6IFB.cjs.map} +1 -1
  59. package/dist/{impl-MKEVOXWE.cjs → impl-HCIWAR4K.cjs} +2 -2
  60. package/dist/{impl-MKEVOXWE.cjs.map → impl-HCIWAR4K.cjs.map} +1 -1
  61. package/dist/{impl-2YFKUYD6.cjs → impl-J4RNNM5J.cjs} +2 -2
  62. package/dist/{impl-2YFKUYD6.cjs.map → impl-J4RNNM5J.cjs.map} +1 -1
  63. package/dist/{impl-76RWHLA4.cjs → impl-JXBBXXSV.cjs} +2 -2
  64. package/dist/{impl-76RWHLA4.cjs.map → impl-JXBBXXSV.cjs.map} +1 -1
  65. package/dist/{impl-GZ2ZIYWN.cjs → impl-KKHB3WSS.cjs} +2 -2
  66. package/dist/{impl-GZ2ZIYWN.cjs.map → impl-KKHB3WSS.cjs.map} +1 -1
  67. package/dist/impl-LIGJD3OO.cjs +2 -0
  68. package/dist/impl-LIGJD3OO.cjs.map +1 -0
  69. package/dist/{impl-YI6MEGDR.cjs → impl-LN4DSTAR.cjs} +4 -4
  70. package/dist/{impl-YI6MEGDR.cjs.map → impl-LN4DSTAR.cjs.map} +1 -1
  71. package/dist/{impl-RDXUUMXQ.cjs → impl-LRAKEF2T.cjs} +2 -2
  72. package/dist/{impl-RDXUUMXQ.cjs.map → impl-LRAKEF2T.cjs.map} +1 -1
  73. package/dist/{impl-RM5WL2FX.cjs → impl-PAEBDGSD.cjs} +2 -2
  74. package/dist/{impl-RM5WL2FX.cjs.map → impl-PAEBDGSD.cjs.map} +1 -1
  75. package/dist/{impl-RSPCWV5C.cjs → impl-Q7ZLQBGK.cjs} +2 -2
  76. package/dist/{impl-RSPCWV5C.cjs.map → impl-Q7ZLQBGK.cjs.map} +1 -1
  77. package/dist/{impl-AA2S5XWZ.cjs → impl-QN7YU4D2.cjs} +2 -2
  78. package/dist/{impl-AA2S5XWZ.cjs.map → impl-QN7YU4D2.cjs.map} +1 -1
  79. package/dist/{impl-QK22H5S4.cjs → impl-RYEREEYF.cjs} +2 -2
  80. package/dist/{impl-QK22H5S4.cjs.map → impl-RYEREEYF.cjs.map} +1 -1
  81. package/dist/{impl-AYAPFSK5.cjs → impl-RYITPCNS.cjs} +2 -2
  82. package/dist/{impl-AYAPFSK5.cjs.map → impl-RYITPCNS.cjs.map} +1 -1
  83. package/dist/{impl-U67PZO2U.cjs → impl-SIINULLT.cjs} +5 -5
  84. package/dist/{impl-U67PZO2U.cjs.map → impl-SIINULLT.cjs.map} +1 -1
  85. package/dist/{impl-RD2RWVVR.cjs → impl-SQCIHHWP.cjs} +2 -2
  86. package/dist/{impl-RD2RWVVR.cjs.map → impl-SQCIHHWP.cjs.map} +1 -1
  87. package/dist/{impl-SXGH7WAQ.cjs → impl-T3RWXOCB.cjs} +2 -2
  88. package/dist/{impl-SXGH7WAQ.cjs.map → impl-T3RWXOCB.cjs.map} +1 -1
  89. package/dist/{impl-KFML3O7R.cjs → impl-TFALTZMI.cjs} +2 -2
  90. package/dist/{impl-KFML3O7R.cjs.map → impl-TFALTZMI.cjs.map} +1 -1
  91. package/dist/{impl-NPNBU4L2.cjs → impl-UB3JBDFF.cjs} +2 -2
  92. package/dist/{impl-NPNBU4L2.cjs.map → impl-UB3JBDFF.cjs.map} +1 -1
  93. package/dist/{impl-N24QF4DA.cjs → impl-VHZCJ576.cjs} +5 -5
  94. package/dist/{impl-N24QF4DA.cjs.map → impl-VHZCJ576.cjs.map} +1 -1
  95. package/dist/{impl-57VL3VKK.cjs → impl-W37LK3FV.cjs} +2 -2
  96. package/dist/{impl-57VL3VKK.cjs.map → impl-W37LK3FV.cjs.map} +1 -1
  97. package/dist/{impl-PZBN6XCO.cjs → impl-XYX4VOVC.cjs} +2 -2
  98. package/dist/{impl-PZBN6XCO.cjs.map → impl-XYX4VOVC.cjs.map} +1 -1
  99. package/dist/{impl-RCSSVIJF.cjs → impl-YCB6VJXU.cjs} +2 -2
  100. package/dist/{impl-RCSSVIJF.cjs.map → impl-YCB6VJXU.cjs.map} +1 -1
  101. package/dist/{impl-MCCYBIUO.cjs → impl-Z3IU4T47.cjs} +2 -2
  102. package/dist/{impl-MCCYBIUO.cjs.map → impl-Z3IU4T47.cjs.map} +1 -1
  103. package/dist/{impl-VRKVDMBB.cjs → impl-ZT6V4JU3.cjs} +3 -3
  104. package/dist/{impl-VRKVDMBB.cjs.map → impl-ZT6V4JU3.cjs.map} +1 -1
  105. package/dist/{impl-IP7IRDK3.cjs → impl-ZXGWXMGH.cjs} +2 -2
  106. package/dist/{impl-IP7IRDK3.cjs.map → impl-ZXGWXMGH.cjs.map} +1 -1
  107. package/dist/index.cjs +3 -3
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.d.cts +74 -3
  110. package/package.json +1 -1
  111. package/dist/impl-DBWCR5EV.cjs +0 -2
  112. package/dist/impl-DBWCR5EV.cjs.map +0 -1
  113. package/dist/impl-XN2JRARB.cjs +0 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-MCCYBIUO.cjs","../src/commands/inventory/scan-packages/impl.ts"],"names":["REPO_ERROR","scanPackages","auth","scanPath","ignoreDirs","repositoryName","transcendUrl","doneInputValidation","gitRepositoryName","url","execSync","logger","colors","err"],"mappings":"AAAA,iOAAwC,gCAA6B,gCAA6B,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAyC,gCAA6B,gFCEtT,8CAOM,IAGnBA,CAAAA,CACJ,0LAAA,CAYF,MAAA,SAAsBC,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAIC,CAAAA,CAAoBH,CAAAA,CACxB,EAAA,CAAI,CAACG,CAAAA,CACH,GAAI,CAKF,IAAMC,CAAAA,CAJOC,qCAAAA,CACX,GAAA,EAAMP,CAAQ,CAAA,sCAAA,CAChB,CAAA,CAEiB,QAAA,CAAS,OAAO,CAAA,CAAE,IAAA,CAAK,CAAA,CACxC,CAACK,CAAiB,CAAA,CAAKC,CAAAA,CAAI,QAAA,CAAS,QAAQ,CAAA,CAExCA,CAAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA,CAAA,CAD1CA,CAAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAAE,GAAA,CAAI,CAAA,EAAK,EAAA,CAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAErCD,CAAAA,EAAAA,CACHG,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAIZ,CAAU,CAAC,CAAA,CACnC,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAEvB,CAAA,KAAA,CAASa,CAAAA,CAAK,CACZF,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAI,CAAA,EAAA","file":"/home/runner/work/cli/cli/dist/impl-MCCYBIUO.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { ADMIN_DASH } from '../../../constants';\nimport { findCodePackagesInFolder } from '../../../lib/code-scanning';\nimport {\n buildTranscendGraphQLClient,\n syncCodePackages,\n} from '../../../lib/graphql';\nimport { execSync } from 'child_process';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nconst REPO_ERROR =\n 'A repository name must be provided. ' +\n 'You can specify using --repositoryName=$REPO_NAME or by ensuring the ' +\n 'command \"git config --get remote.origin.url\" returns the name of the repository';\n\nexport interface ScanPackagesCommandFlags {\n auth: string;\n scanPath: string;\n ignoreDirs?: string[];\n repositoryName?: string;\n transcendUrl: string;\n}\n\nexport async function scanPackages(\n this: LocalContext,\n {\n auth,\n scanPath,\n ignoreDirs,\n repositoryName,\n transcendUrl,\n }: ScanPackagesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Ensure repository name is specified\n let gitRepositoryName = repositoryName;\n if (!gitRepositoryName) {\n try {\n const name = execSync(\n `cd ${scanPath} && git config --get remote.origin.url`,\n );\n // Trim and parse the URL\n const url = name.toString('utf-8').trim();\n [gitRepositoryName] = !url.includes('https:')\n ? (url.split(':').pop() || '').split('.')\n : url.split('/').slice(3).join('/').split('.');\n if (!gitRepositoryName) {\n logger.error(colors.red(REPO_ERROR));\n this.process.exit(1);\n }\n } catch (err) {\n logger.error(colors.red(`${REPO_ERROR} - Got error: ${err.message}`));\n this.process.exit(1);\n }\n }\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Scan the codebase to discovery packages\n const results = await findCodePackagesInFolder({\n scanPath,\n ignoreDirs,\n repositoryName: gitRepositoryName,\n });\n\n // Report scan to Transcend\n await syncCodePackages(client, results);\n\n const newUrl = new URL(ADMIN_DASH);\n newUrl.pathname = '/code-scanning/code-packages';\n\n // Indicate success\n logger.info(\n colors.green(\n `Scan found ${results.length} packages at ${scanPath}! ` +\n `View results at '${newUrl.href}'`,\n ),\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-Z3IU4T47.cjs","../src/commands/inventory/scan-packages/impl.ts"],"names":["REPO_ERROR","scanPackages","auth","scanPath","ignoreDirs","repositoryName","transcendUrl","doneInputValidation","gitRepositoryName","url","execSync","logger","colors","err"],"mappings":"AAAA,iOAAwC,gCAA6B,gCAA6B,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAyC,gCAA6B,gFCEtT,8CAOM,IAGnBA,CAAAA,CACJ,0LAAA,CAYF,MAAA,SAAsBC,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAIC,CAAAA,CAAoBH,CAAAA,CACxB,EAAA,CAAI,CAACG,CAAAA,CACH,GAAI,CAKF,IAAMC,CAAAA,CAJOC,qCAAAA,CACX,GAAA,EAAMP,CAAQ,CAAA,sCAAA,CAChB,CAAA,CAEiB,QAAA,CAAS,OAAO,CAAA,CAAE,IAAA,CAAK,CAAA,CACxC,CAACK,CAAiB,CAAA,CAAKC,CAAAA,CAAI,QAAA,CAAS,QAAQ,CAAA,CAExCA,CAAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA,CAAA,CAD1CA,CAAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAAE,GAAA,CAAI,CAAA,EAAK,EAAA,CAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAErCD,CAAAA,EAAAA,CACHG,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAIZ,CAAU,CAAC,CAAA,CACnC,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAEvB,CAAA,KAAA,CAASa,CAAAA,CAAK,CACZF,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAI,CAAA,EAAA","file":"/home/runner/work/cli/cli/dist/impl-Z3IU4T47.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { ADMIN_DASH } from '../../../constants';\nimport { findCodePackagesInFolder } from '../../../lib/code-scanning';\nimport {\n buildTranscendGraphQLClient,\n syncCodePackages,\n} from '../../../lib/graphql';\nimport { execSync } from 'child_process';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nconst REPO_ERROR =\n 'A repository name must be provided. ' +\n 'You can specify using --repositoryName=$REPO_NAME or by ensuring the ' +\n 'command \"git config --get remote.origin.url\" returns the name of the repository';\n\nexport interface ScanPackagesCommandFlags {\n auth: string;\n scanPath: string;\n ignoreDirs?: string[];\n repositoryName?: string;\n transcendUrl: string;\n}\n\nexport async function scanPackages(\n this: LocalContext,\n {\n auth,\n scanPath,\n ignoreDirs,\n repositoryName,\n transcendUrl,\n }: ScanPackagesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Ensure repository name is specified\n let gitRepositoryName = repositoryName;\n if (!gitRepositoryName) {\n try {\n const name = execSync(\n `cd ${scanPath} && git config --get remote.origin.url`,\n );\n // Trim and parse the URL\n const url = name.toString('utf-8').trim();\n [gitRepositoryName] = !url.includes('https:')\n ? (url.split(':').pop() || '').split('.')\n : url.split('/').slice(3).join('/').split('.');\n if (!gitRepositoryName) {\n logger.error(colors.red(REPO_ERROR));\n this.process.exit(1);\n }\n } catch (err) {\n logger.error(colors.red(`${REPO_ERROR} - Got error: ${err.message}`));\n this.process.exit(1);\n }\n }\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Scan the codebase to discovery packages\n const results = await findCodePackagesInFolder({\n scanPath,\n ignoreDirs,\n repositoryName: gitRepositoryName,\n });\n\n // Report scan to Transcend\n await syncCodePackages(client, results);\n\n const newUrl = new URL(ADMIN_DASH);\n newUrl.pathname = '/code-scanning/code-packages';\n\n // Indicate success\n logger.info(\n colors.green(\n `Scan found ${results.length} packages at ${scanPath}! ` +\n `View results at '${newUrl.href}'`,\n ),\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkSW5CIF5Dcjs = require('./chunk-SW5CIF5D.cjs');var _chunkTXG7TJLKcjs = require('./chunk-TXG7TJLK.cjs');require('./chunk-QEM6S2W7.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkUTU4F57Hcjs = require('./chunk-UTU4F57H.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkWI7C7KDMcjs = require('./chunk-WI7C7KDM.cjs');require('./chunk-Q7I37FJV.cjs');var _bluebird = require('bluebird');var _fs = require('fs');var _path = require('path');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function I({transcendUrl:i,auth:c,pageSize:h,publishToPrivacyCenter:y,contents:l,deleteExtraAttributeValues:m=!1,classifyService:f=!1}){let u=_chunkUTU4F57Hcjs.vc.call(void 0, i,c);try{return!await _chunkUTU4F57Hcjs.bg.call(void 0, l,u,{pageSize:h,publishToPrivacyCenter:y,classifyService:f,deleteExtraAttributeValues:m})}catch(o){return _chunkZUNVPK23cjs.a.error(_colors2.default.red(`An unexpected error occurred syncing the schema: ${o.message}`)),!1}}async function U({file:i="./transcend.yml",transcendUrl:c,auth:h,variables:y,pageSize:l,publishToPrivacyCenter:m,classifyService:f,deleteExtraAttributeValues:u}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let o=await _chunkTXG7TJLKcjs.b.call(void 0, h),N=_chunkUTU4F57Hcjs.Rf.call(void 0, y),p;if(Array.isArray(o)&&_fs.lstatSync.call(void 0, i).isDirectory()?p=_chunkTXG7TJLKcjs.c.call(void 0, i).map(e=>_path.join.call(void 0, i,e)):p=i.split(","),p.length<1)throw new Error("No file specified!");let s=p.map(e=>{_fs.existsSync.call(void 0, e)?_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading file "${e}"...`)):(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`The file path does not exist on disk: ${e}. You can specify the filepath using --file=./examples/transcend.yml`)),this.process.exit(1));try{let r=_chunkSW5CIF5Dcjs.d.call(void 0, e,N);return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully read in "${e}"`)),{content:r,name:e.split("/").pop().replace(".yml","")}}catch(r){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`The shape of your yaml file is invalid with the following errors: ${r.message}`)),this.process.exit(1)}});if(typeof o=="string"){let[e,...r]=s.map(({content:d})=>d),$=_chunkIBTP5OXEcjs.a.call(void 0, e,...r);await I({transcendUrl:c,auth:o,contents:$,publishToPrivacyCenter:m,deleteExtraAttributeValues:u,pageSize:l,classifyService:!!f})||(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors. View output above for more information, or check out ${_chunkWI7C7KDMcjs.p}`)),this.process.exit(1))}else{if(s.length!==1&&s.length!==o.length)throw new Error(`Expected list of yml files to be equal to the list of API keys.Got ${s.length} YML file${s.length===1?"":"s"} and ${o.length} API key${o.length===1?"":"s"}`);let e=[];await _bluebird.mapSeries.call(void 0, o,async(r,$)=>{let a=`[${$+1}/${o.length}][${r.organizationName}] `;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`~~~
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkSW5CIF5Dcjs = require('./chunk-SW5CIF5D.cjs');var _chunkSHUWLLFXcjs = require('./chunk-SHUWLLFX.cjs');require('./chunk-QEM6S2W7.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk7YNUSMVAcjs = require('./chunk-7YNUSMVA.cjs');require('./chunk-LCDYXJN6.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkQ3L3F6ZMcjs = require('./chunk-Q3L3F6ZM.cjs');require('./chunk-Q7I37FJV.cjs');var _bluebird = require('bluebird');var _fs = require('fs');var _path = require('path');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function I({transcendUrl:i,auth:c,pageSize:h,publishToPrivacyCenter:y,contents:l,deleteExtraAttributeValues:m=!1,classifyService:f=!1}){let u=_chunk7YNUSMVAcjs.vc.call(void 0, i,c);try{return!await _chunk7YNUSMVAcjs.cg.call(void 0, l,u,{pageSize:h,publishToPrivacyCenter:y,classifyService:f,deleteExtraAttributeValues:m})}catch(o){return _chunkZUNVPK23cjs.a.error(_colors2.default.red(`An unexpected error occurred syncing the schema: ${o.message}`)),!1}}async function U({file:i="./transcend.yml",transcendUrl:c,auth:h,variables:y,pageSize:l,publishToPrivacyCenter:m,classifyService:f,deleteExtraAttributeValues:u}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let o=await _chunkSHUWLLFXcjs.b.call(void 0, h),N=_chunk7YNUSMVAcjs.Sf.call(void 0, y),p;if(Array.isArray(o)&&_fs.lstatSync.call(void 0, i).isDirectory()?p=_chunkSHUWLLFXcjs.c.call(void 0, i).map(e=>_path.join.call(void 0, i,e)):p=i.split(","),p.length<1)throw new Error("No file specified!");let s=p.map(e=>{_fs.existsSync.call(void 0, e)?_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading file "${e}"...`)):(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`The file path does not exist on disk: ${e}. You can specify the filepath using --file=./examples/transcend.yml`)),this.process.exit(1));try{let r=_chunkSW5CIF5Dcjs.d.call(void 0, e,N);return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully read in "${e}"`)),{content:r,name:e.split("/").pop().replace(".yml","")}}catch(r){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`The shape of your yaml file is invalid with the following errors: ${r.message}`)),this.process.exit(1)}});if(typeof o=="string"){let[e,...r]=s.map(({content:d})=>d),$=_chunkIBTP5OXEcjs.a.call(void 0, e,...r);await I({transcendUrl:c,auth:o,contents:$,publishToPrivacyCenter:m,deleteExtraAttributeValues:u,pageSize:l,classifyService:!!f})||(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors. View output above for more information, or check out ${_chunkQ3L3F6ZMcjs.p}`)),this.process.exit(1))}else{if(s.length!==1&&s.length!==o.length)throw new Error(`Expected list of yml files to be equal to the list of API keys.Got ${s.length} YML file${s.length===1?"":"s"} and ${o.length} API key${o.length===1?"":"s"}`);let e=[];await _bluebird.mapSeries.call(void 0, o,async(r,$)=>{let a=`[${$+1}/${o.length}][${r.organizationName}] `;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`~~~
2
2
 
3
3
  ${a}Attempting to push configuration...
4
4
 
5
- ~~~`));let d=s.length===1?s[0].content:_optionalChain([s, 'access', _ => _.find, 'call', _2 => _2(E=>E.name===r.organizationName), 'optionalAccess', _3 => _3.content]);if(!d){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${a}Failed to find transcend.yml file for organization: "${r.organizationName}".`)),e.push(r.organizationName);return}await I({transcendUrl:c,auth:r.apiKey,contents:d,pageSize:l,publishToPrivacyCenter:m,deleteExtraAttributeValues:u,classifyService:f})?_chunkZUNVPK23cjs.a.info(_colors2.default.green(`${a}Successfully pushed configuration!`)):(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${a}Failed to sync configuration.`)),e.push(r.organizationName))}),e.length>0&&(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors for "${e.join(",")}". View output above for more information, or check out ${_chunkWI7C7KDMcjs.p}`)),this.process.exit(1))}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced yaml file to Transcend! View at ${_chunkWI7C7KDMcjs.p}`))}exports.push = U;
6
- //# sourceMappingURL=impl-VRKVDMBB.cjs.map
5
+ ~~~`));let d=s.length===1?s[0].content:_optionalChain([s, 'access', _ => _.find, 'call', _2 => _2(E=>E.name===r.organizationName), 'optionalAccess', _3 => _3.content]);if(!d){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${a}Failed to find transcend.yml file for organization: "${r.organizationName}".`)),e.push(r.organizationName);return}await I({transcendUrl:c,auth:r.apiKey,contents:d,pageSize:l,publishToPrivacyCenter:m,deleteExtraAttributeValues:u,classifyService:f})?_chunkZUNVPK23cjs.a.info(_colors2.default.green(`${a}Successfully pushed configuration!`)):(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${a}Failed to sync configuration.`)),e.push(r.organizationName))}),e.length>0&&(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors for "${e.join(",")}". View output above for more information, or check out ${_chunkQ3L3F6ZMcjs.p}`)),this.process.exit(1))}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced yaml file to Transcend! View at ${_chunkQ3L3F6ZMcjs.p}`))}exports.push = U;
6
+ //# sourceMappingURL=impl-ZT6V4JU3.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-VRKVDMBB.cjs","../src/commands/inventory/push/impl.ts"],"names":["syncConfiguration","transcendUrl","auth","pageSize","publishToPrivacyCenter","contents","deleteExtraAttributeValues","classifyService","client","buildTranscendGraphQLClient","syncConfigurationToTranscend","err","logger","colors"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAgD,gCAA6B,wDAAyC,wDAA0D,gCAA6B,wDAAyC,wDAAyC,gCAA6B,oCCGnX,wBACY,4BACjB,gFAEF,MAmBnB,SAAeA,CAAAA,CAAkB,CAC/B,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,0BAAA,CAAAC,CAAAA,CAA6B,CAAA,CAAA,CAC7B,eAAA,CAAAC,CAAAA,CAAkB,CAAA,CACpB,CAAA,CAeqB,CACnB,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BR,CAAcC,CAAI,CAAA,CAG7D,GAAI,CAWF,MAAO,CAVkB,MAAMQ,kCAAAA,CAC7BL,CACAG,CAAAA,CACA,CACE,QAAA,CAAAL,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAG,CAAAA,CACA,0BAAA,CAAAD,CACF,CACF,CAEF,CAAA,KAAA,CAASK,CAAAA,CAAK,CACZ,OAAAC,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,iDAAA,EAAoDF,CAAAA,CAAI,OAAO,CAAA,CAAA;AAsI7D;AAAgB;AAAA;AA8D1B,GAAA","file":"/home/runner/work/cli/cli/dist/impl-VRKVDMBB.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { logger } from '../../../logger';\nimport { mapSeries } from 'bluebird';\nimport { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { readTranscendYaml } from '../../../lib/readTranscendYaml';\nimport colors from 'colors';\nimport {\n buildTranscendGraphQLClient,\n syncConfigurationToTranscend,\n} from '../../../lib/graphql';\n\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { TranscendInput } from '../../../codecs';\nimport { validateTranscendAuth, listFiles } from '../../../lib/api-keys';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\n/**\n * Sync configuration to Transcend\n *\n * @param options - Options\n * @returns True if synced successfully, false if error occurs\n */\nasync function syncConfiguration({\n transcendUrl,\n auth,\n pageSize,\n publishToPrivacyCenter,\n contents,\n deleteExtraAttributeValues = false,\n classifyService = false,\n}: {\n /** Transcend YAML */\n contents: TranscendInput;\n /** Transcend URL */\n transcendUrl: string;\n /** API key */\n auth: string;\n /** Page size */\n pageSize: number;\n /** Skip privacy center publish step */\n publishToPrivacyCenter: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** Delete attributes when syncing */\n deleteExtraAttributeValues?: boolean;\n}): Promise<boolean> {\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Sync to Transcend\n try {\n const encounteredError = await syncConfigurationToTranscend(\n contents,\n client,\n {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n },\n );\n return !encounteredError;\n } catch (err) {\n logger.error(\n colors.red(\n `An unexpected error occurred syncing the schema: ${err.message}`,\n ),\n );\n return false;\n }\n}\n\nexport interface PushCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n pageSize: number;\n variables: string;\n publishToPrivacyCenter: boolean;\n classifyService: boolean;\n deleteExtraAttributeValues: boolean;\n}\n\nexport async function push(\n this: LocalContext,\n {\n file = './transcend.yml',\n transcendUrl,\n auth,\n variables,\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n }: PushCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Parse out the variables\n const vars = parseVariablesFromString(variables);\n\n // check if we are being passed a list of API keys and a list of files\n let fileList: string[];\n if (Array.isArray(apiKeyOrList) && lstatSync(file).isDirectory()) {\n fileList = listFiles(file).map((filePath) => join(file, filePath));\n } else {\n fileList = file.split(',');\n }\n\n // Ensure at least one file is parsed\n if (fileList.length < 1) {\n throw new Error('No file specified!');\n }\n\n // eslint-disable-next-line array-callback-return,consistent-return\n const transcendInputs = fileList.map((filePath) => {\n // Ensure yaml file exists on disk\n if (!existsSync(filePath)) {\n logger.error(\n colors.red(\n `The file path does not exist on disk: ${filePath}. You can specify the filepath using --file=./examples/transcend.yml`,\n ),\n );\n this.process.exit(1);\n } else {\n logger.info(colors.magenta(`Reading file \"${filePath}\"...`));\n }\n\n try {\n // Read in the yaml file and validate it's shape\n const newContents = readTranscendYaml(filePath, vars);\n logger.info(colors.green(`Successfully read in \"${filePath}\"`));\n return {\n content: newContents,\n name: filePath.split('/').pop()!.replace('.yml', ''),\n };\n } catch (err) {\n logger.error(\n colors.red(\n `The shape of your yaml file is invalid with the following errors: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n });\n\n // process a single API key\n if (typeof apiKeyOrList === 'string') {\n // if passed multiple inputs, merge them together\n const [base, ...rest] = transcendInputs.map(({ content }) => content);\n const contents = mergeTranscendInputs(base, ...rest);\n\n // sync the configuration\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKeyOrList,\n contents,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n pageSize,\n classifyService: !!classifyService,\n });\n\n // exist with error code\n if (!success) {\n logger.info(\n colors.red(\n `Sync encountered errors. View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n } else {\n // if passed multiple inputs, expect them to be one per instance\n if (\n transcendInputs.length !== 1 &&\n transcendInputs.length !== apiKeyOrList.length\n ) {\n throw new Error(\n 'Expected list of yml files to be equal to the list of API keys.' +\n `Got ${transcendInputs.length} YML file${\n transcendInputs.length === 1 ? '' : 's'\n } and ${apiKeyOrList.length} API key${\n apiKeyOrList.length === 1 ? '' : 's'\n }`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`,\n ),\n );\n\n // use the merged contents if 1 yml passed, else use the contents that map to that organization\n const useContents =\n transcendInputs.length === 1\n ? transcendInputs[0].content\n : transcendInputs.find(\n (input) => input.name === apiKey.organizationName,\n )?.content;\n\n // Throw error if cannot find a yml file matching that organization name\n if (!useContents) {\n logger.error(\n colors.red(\n `${prefix}Failed to find transcend.yml file for organization: \"${apiKey.organizationName}\".`,\n ),\n );\n encounteredErrors.push(apiKey.organizationName);\n return;\n }\n\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKey.apiKey,\n contents: useContents,\n pageSize,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n classifyService,\n });\n\n if (success) {\n logger.info(\n colors.green(`${prefix}Successfully pushed configuration!`),\n );\n } else {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced yaml file to Transcend! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZT6V4JU3.cjs","../src/commands/inventory/push/impl.ts"],"names":["syncConfiguration","transcendUrl","auth","pageSize","publishToPrivacyCenter","contents","deleteExtraAttributeValues","classifyService","client","buildTranscendGraphQLClient","syncConfigurationToTranscend","err","logger","colors"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAgD,gCAA6B,wDAAyC,wDAA0D,gCAA6B,wDAAyC,wDAAyC,gCAA6B,oCCGnX,wBACY,4BACjB,gFAEF,MAmBnB,SAAeA,CAAAA,CAAkB,CAC/B,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,0BAAA,CAAAC,CAAAA,CAA6B,CAAA,CAAA,CAC7B,eAAA,CAAAC,CAAAA,CAAkB,CAAA,CACpB,CAAA,CAeqB,CACnB,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BR,CAAcC,CAAI,CAAA,CAG7D,GAAI,CAWF,MAAO,CAVkB,MAAMQ,kCAAAA,CAC7BL,CACAG,CAAAA,CACA,CACE,QAAA,CAAAL,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAG,CAAAA,CACA,0BAAA,CAAAD,CACF,CACF,CAEF,CAAA,KAAA,CAASK,CAAAA,CAAK,CACZ,OAAAC,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,iDAAA,EAAoDF,CAAAA,CAAI,OAAO,CAAA,CAAA;AAsI7D;AAAgB;AAAA;AA8D1B,GAAA","file":"/home/runner/work/cli/cli/dist/impl-ZT6V4JU3.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { logger } from '../../../logger';\nimport { mapSeries } from 'bluebird';\nimport { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { readTranscendYaml } from '../../../lib/readTranscendYaml';\nimport colors from 'colors';\nimport {\n buildTranscendGraphQLClient,\n syncConfigurationToTranscend,\n} from '../../../lib/graphql';\n\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { TranscendInput } from '../../../codecs';\nimport { validateTranscendAuth, listFiles } from '../../../lib/api-keys';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\n/**\n * Sync configuration to Transcend\n *\n * @param options - Options\n * @returns True if synced successfully, false if error occurs\n */\nasync function syncConfiguration({\n transcendUrl,\n auth,\n pageSize,\n publishToPrivacyCenter,\n contents,\n deleteExtraAttributeValues = false,\n classifyService = false,\n}: {\n /** Transcend YAML */\n contents: TranscendInput;\n /** Transcend URL */\n transcendUrl: string;\n /** API key */\n auth: string;\n /** Page size */\n pageSize: number;\n /** Skip privacy center publish step */\n publishToPrivacyCenter: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** Delete attributes when syncing */\n deleteExtraAttributeValues?: boolean;\n}): Promise<boolean> {\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Sync to Transcend\n try {\n const encounteredError = await syncConfigurationToTranscend(\n contents,\n client,\n {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n },\n );\n return !encounteredError;\n } catch (err) {\n logger.error(\n colors.red(\n `An unexpected error occurred syncing the schema: ${err.message}`,\n ),\n );\n return false;\n }\n}\n\nexport interface PushCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n pageSize: number;\n variables: string;\n publishToPrivacyCenter: boolean;\n classifyService: boolean;\n deleteExtraAttributeValues: boolean;\n}\n\nexport async function push(\n this: LocalContext,\n {\n file = './transcend.yml',\n transcendUrl,\n auth,\n variables,\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n }: PushCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Parse out the variables\n const vars = parseVariablesFromString(variables);\n\n // check if we are being passed a list of API keys and a list of files\n let fileList: string[];\n if (Array.isArray(apiKeyOrList) && lstatSync(file).isDirectory()) {\n fileList = listFiles(file).map((filePath) => join(file, filePath));\n } else {\n fileList = file.split(',');\n }\n\n // Ensure at least one file is parsed\n if (fileList.length < 1) {\n throw new Error('No file specified!');\n }\n\n // eslint-disable-next-line array-callback-return,consistent-return\n const transcendInputs = fileList.map((filePath) => {\n // Ensure yaml file exists on disk\n if (!existsSync(filePath)) {\n logger.error(\n colors.red(\n `The file path does not exist on disk: ${filePath}. You can specify the filepath using --file=./examples/transcend.yml`,\n ),\n );\n this.process.exit(1);\n } else {\n logger.info(colors.magenta(`Reading file \"${filePath}\"...`));\n }\n\n try {\n // Read in the yaml file and validate it's shape\n const newContents = readTranscendYaml(filePath, vars);\n logger.info(colors.green(`Successfully read in \"${filePath}\"`));\n return {\n content: newContents,\n name: filePath.split('/').pop()!.replace('.yml', ''),\n };\n } catch (err) {\n logger.error(\n colors.red(\n `The shape of your yaml file is invalid with the following errors: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n });\n\n // process a single API key\n if (typeof apiKeyOrList === 'string') {\n // if passed multiple inputs, merge them together\n const [base, ...rest] = transcendInputs.map(({ content }) => content);\n const contents = mergeTranscendInputs(base, ...rest);\n\n // sync the configuration\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKeyOrList,\n contents,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n pageSize,\n classifyService: !!classifyService,\n });\n\n // exist with error code\n if (!success) {\n logger.info(\n colors.red(\n `Sync encountered errors. View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n } else {\n // if passed multiple inputs, expect them to be one per instance\n if (\n transcendInputs.length !== 1 &&\n transcendInputs.length !== apiKeyOrList.length\n ) {\n throw new Error(\n 'Expected list of yml files to be equal to the list of API keys.' +\n `Got ${transcendInputs.length} YML file${\n transcendInputs.length === 1 ? '' : 's'\n } and ${apiKeyOrList.length} API key${\n apiKeyOrList.length === 1 ? '' : 's'\n }`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`,\n ),\n );\n\n // use the merged contents if 1 yml passed, else use the contents that map to that organization\n const useContents =\n transcendInputs.length === 1\n ? transcendInputs[0].content\n : transcendInputs.find(\n (input) => input.name === apiKey.organizationName,\n )?.content;\n\n // Throw error if cannot find a yml file matching that organization name\n if (!useContents) {\n logger.error(\n colors.red(\n `${prefix}Failed to find transcend.yml file for organization: \"${apiKey.organizationName}\".`,\n ),\n );\n encounteredErrors.push(apiKey.organizationName);\n return;\n }\n\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKey.apiKey,\n contents: useContents,\n pageSize,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n classifyService,\n });\n\n if (success) {\n logger.info(\n colors.green(`${prefix}Successfully pushed configuration!`),\n );\n } else {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced yaml file to Transcend! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkUTU4F57Hcjs = require('./chunk-UTU4F57H.cjs');require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-WI7C7KDM.cjs');require('./chunk-Q7I37FJV.cjs');async function h({auth:i,enricherId:s,actions:o,requestEnricherStatuses:a,requestIds:c,createdAtBefore:e,createdAtAfter:t,concurrency:u,transcendUrl:d}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkUTU4F57Hcjs.Jf.call(void 0, {auth:i,enricherId:s,requestActions:o,requestEnricherStatuses:a,requestIds:c,createdAtBefore:e?new Date(e):void 0,createdAtAfter:t?new Date(t):void 0,concurrency:u,transcendUrl:d})}exports.enricherRestart = h;
2
- //# sourceMappingURL=impl-IP7IRDK3.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk7YNUSMVAcjs = require('./chunk-7YNUSMVA.cjs');require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-Q3L3F6ZM.cjs');require('./chunk-Q7I37FJV.cjs');async function h({auth:i,enricherId:s,actions:o,requestEnricherStatuses:a,requestIds:c,createdAtBefore:e,createdAtAfter:t,concurrency:u,transcendUrl:d}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk7YNUSMVAcjs.Kf.call(void 0, {auth:i,enricherId:s,requestActions:o,requestEnricherStatuses:a,requestIds:c,createdAtBefore:e?new Date(e):void 0,createdAtAfter:t?new Date(t):void 0,concurrency:u,transcendUrl:d})}exports.enricherRestart = h;
2
+ //# sourceMappingURL=impl-ZXGWXMGH.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-IP7IRDK3.cjs","../src/commands/request/enricher-restart/impl.ts"],"names":["enricherRestart","auth","enricherId","actions","requestEnricherStatuses","requestIds","createdAtBefore","createdAtAfter","concurrency","transcendUrl","doneInputValidation","bulkRetryEnrichers"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCoBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,IAAA,CAAAV,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAgBC,CAAAA,CAChB,uBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,eAAA,CAAiBC,CAAAA,CAAkB,IAAI,IAAA,CAAKA,CAAe,CAAA,CAAI,KAAA,CAAA,CAC/D,cAAA,CAAgBC,CAAAA,CAAiB,IAAI,IAAA,CAAKA,CAAc,CAAA,CAAI,KAAA,CAAA,CAC5D,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAC,CACH,CAAA,4BAAA","file":"/home/runner/work/cli/cli/dist/impl-IP7IRDK3.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { bulkRetryEnrichers } from '../../../lib/requests';\nimport type {\n RequestAction,\n RequestEnricherStatus,\n} from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface EnricherRestartCommandFlags {\n auth: string;\n enricherId: string;\n actions?: RequestAction[];\n requestEnricherStatuses?: RequestEnricherStatus[];\n transcendUrl: string;\n concurrency: number;\n requestIds?: string[];\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n}\n\nexport async function enricherRestart(\n this: LocalContext,\n {\n auth,\n enricherId,\n actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore,\n createdAtAfter,\n concurrency,\n transcendUrl,\n }: EnricherRestartCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await bulkRetryEnrichers({\n auth,\n enricherId,\n requestActions: actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,\n createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,\n concurrency,\n transcendUrl,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZXGWXMGH.cjs","../src/commands/request/enricher-restart/impl.ts"],"names":["enricherRestart","auth","enricherId","actions","requestEnricherStatuses","requestIds","createdAtBefore","createdAtAfter","concurrency","transcendUrl","doneInputValidation","bulkRetryEnrichers"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCoBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,IAAA,CAAAV,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAgBC,CAAAA,CAChB,uBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,eAAA,CAAiBC,CAAAA,CAAkB,IAAI,IAAA,CAAKA,CAAe,CAAA,CAAI,KAAA,CAAA,CAC/D,cAAA,CAAgBC,CAAAA,CAAiB,IAAI,IAAA,CAAKA,CAAc,CAAA,CAAI,KAAA,CAAA,CAC5D,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAC,CACH,CAAA,4BAAA","file":"/home/runner/work/cli/cli/dist/impl-ZXGWXMGH.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { bulkRetryEnrichers } from '../../../lib/requests';\nimport type {\n RequestAction,\n RequestEnricherStatus,\n} from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface EnricherRestartCommandFlags {\n auth: string;\n enricherId: string;\n actions?: RequestAction[];\n requestEnricherStatuses?: RequestEnricherStatus[];\n transcendUrl: string;\n concurrency: number;\n requestIds?: string[];\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n}\n\nexport async function enricherRestart(\n this: LocalContext,\n {\n auth,\n enricherId,\n actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore,\n createdAtAfter,\n concurrency,\n transcendUrl,\n }: EnricherRestartCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await bulkRetryEnrichers({\n auth,\n enricherId,\n requestActions: actions,\n requestEnricherStatuses,\n requestIds,\n createdAtBefore: createdAtBefore ? new Date(createdAtBefore) : undefined,\n createdAtAfter: createdAtAfter ? new Date(createdAtAfter) : undefined,\n concurrency,\n transcendUrl,\n });\n}\n"]}
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 _chunk2CCKVEWScjs = require('./chunk-2CCKVEWS.cjs');var _chunkXCTTKA6Ccjs = require('./chunk-XCTTKA6C.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkSW5CIF5Dcjs = require('./chunk-SW5CIF5D.cjs');var _chunkVWFYPZ4Qcjs = require('./chunk-VWFYPZ4Q.cjs');var _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunkIXOC4S5Lcjs = require('./chunk-IXOC4S5L.cjs');var _chunkK45V7WKNcjs = require('./chunk-K45V7WKN.cjs');var _chunkTXG7TJLKcjs = require('./chunk-TXG7TJLK.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunkUTU4F57Hcjs = require('./chunk-UTU4F57H.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkWI7C7KDMcjs = require('./chunk-WI7C7KDM.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 _chunkUTU4F57Hcjs._f.call(void 0, a,_chunkUTU4F57Hcjs.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 Gm(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=_chunkWI7C7KDMcjs.r,transcendApiKey:s,requireApproval:o=!0,cacheDuration:i,defaultVariables:p={}}){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);this.prompts=e,this.transcendUrl=t,this.transcendApiKey=s,this.variables=p,this.defaultVariables=p,this.graphQLClient=_chunkUTU4F57Hcjs.vc.call(void 0, t,typeof s=="object"?s.release():s),this.requireApproval=o,this.cacheDuration=i,this.handlebarsOptions=r,this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, r)}async fetchPromptsAndMetadata(){let e=_typeutils.getValues.call(void 0, this.prompts),r=e.map(({id:n})=>n).filter(n=>!!n),t=e.map(({title:n})=>n).filter(n=>!!n),s=_chunkWI7C7KDMcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunkUTU4F57Hcjs.zd.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),D(this.graphQLClient),_chunkUTU4F57Hcjs.Fc.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunkWI7C7KDMcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunkWI7C7KDMcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunkWI7C7KDMcjs.e.call(void 0, o.prompts,"title"),c=_chunkWI7C7KDMcjs.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 _chunkUTU4F57Hcjs.Fc.call(void 0, this.graphQLClient,{names:[e]});if(t)return this.agentsByName[t.name]=t,this.agentsByAgentId[t.agentId]=t,t}async getPromptThreadBySlackTs(e){let[r]=await _chunkUTU4F57Hcjs.Ad.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=[]}=_chunkWI7C7KDMcjs.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=_chunkWI7C7KDMcjs.b.call(void 0, t,50),i=[];return await _bluebird.mapSeries.call(void 0, o,async p=>{let m=await _chunkUTU4F57Hcjs.Fc.call(void 0, this.graphQLClient,{names:p});m.forEach(c=>{this.agentsByName[c.name]=c,this.agentsByAgentId[c.agentId]=c}),i.push(...m)}),[...s,...i]}getAgentFiles(e){return _chunkUTU4F57Hcjs.Dc.call(void 0, this.graphQLClient,e)}getLargeLanguageModel(e){let r=this.largeLanguageModels.find(t=>typeof e=="string"?t.id===e:t.name===e.name&&t.client===e.client);if(!r)throw new Error(`Failed to find model matching: ${typeof e=="string"?e:JSON.stringify(e)}`);return r}async getPromptDefinition(e){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let{promptContentMap:r}=this;if(!r)throw new Error("Expected this.promptContentMap to be defined");let t=r[e];if(!t)throw new Error(`Expected this.promptContentMap[${e}] to be defined`);return t}async compilePrompt(e,r){let t=await this.getPromptDefinition(e),s=this.prompts[e];if(!s)throw new Error(`Expected this.prompts[${e}] to be defined`);if(this.requireApproval&&t.status!==_privacytypes.PromptStatus.Approved)throw new Error(`Assessment "${t.title}" cannot be used because its in status: "${t.status}"`);if(t.status===_privacytypes.PromptStatus.Rejected)throw new Error(`Assessment "${t.title}" cannot be used because it's in status: "${t.status}"`);return _typeutils.decodeCodec.call(void 0, s.paramCodec,r),this.handlebars.compile(t.content)({currentDate:new Date().toISOString(),...this.variables,...r})}parseAiResponse(e,r){let t=this.prompts[e];if(!t)throw new Error(`Expected this.prompts[${e}] to be defined`);let s=t.extractFromTag&&(j(t.extractFromTag).exec(r)||[])[1]||r;return _typeutils.decodeCodec.call(void 0, t.outputCodec,H(s),!1)}async reportAndParsePromptRun(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);if(t.promptRunMessages[t.promptRunMessages.length-1].role!==_privacytypes.ChatCompletionRole.Assistant)throw new Error(`promptRunMessages[${t.promptRunMessages.length-1}].role is expected to be = ${_privacytypes.ChatCompletionRole.Assistant}`);let i=t.promptRunMessages[t.promptRunMessages.length-1].content,p;try{p=this.parseAiResponse(e,i)}catch(c){throw await _chunkUTU4F57Hcjs.ee.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 _chunkUTU4F57Hcjs.ee.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 _chunkUTU4F57Hcjs.ee.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 jm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function Vm(a){return Object.entries(a).reduce((e,[r,t])=>t!=null&&t!==""&&!(Array.isArray(t)&&t.length===0)&&!(typeof t=="object"&&Object.keys(t).length===0)?Object.assign(e,{[r]:t}):e,{})}var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _child_process = require('child_process');function Jm({baseBranch:a,rootDirectory:e,githubRepo:r,excludedGlob:t=[],fileBlockList:s=[]}){_child_process.execSync.call(void 0, `git fetch origin ${a}`);let o=_child_process.execSync.call(void 0, `git ls-remote ${r} "refs/heads/${a}" | cut -f 1`,{encoding:"utf-8"}).split(`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _class;var _chunkCIUYGNQBcjs = require('./chunk-CIUYGNQB.cjs');var _chunkFEYTT6HRcjs = require('./chunk-FEYTT6HR.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkSW5CIF5Dcjs = require('./chunk-SW5CIF5D.cjs');var _chunkGIQ4W7IVcjs = require('./chunk-GIQ4W7IV.cjs');var _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunkNZDUGK2Ecjs = require('./chunk-NZDUGK2E.cjs');var _chunkVV5ICWOAcjs = require('./chunk-VV5ICWOA.cjs');var _chunkSHUWLLFXcjs = require('./chunk-SHUWLLFX.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunk7YNUSMVAcjs = require('./chunk-7YNUSMVA.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkQ3L3F6ZMcjs = require('./chunk-Q3L3F6ZM.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 _chunk7YNUSMVAcjs.$f.call(void 0, a,_chunk7YNUSMVAcjs.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 Um(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=_chunkQ3L3F6ZMcjs.r,transcendApiKey:s,requireApproval:o=!0,cacheDuration:i,defaultVariables:p={}}){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);this.prompts=e,this.transcendUrl=t,this.transcendApiKey=s,this.variables=p,this.defaultVariables=p,this.graphQLClient=_chunk7YNUSMVAcjs.vc.call(void 0, t,typeof s=="object"?s.release():s),this.requireApproval=o,this.cacheDuration=i,this.handlebarsOptions=r,this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, r)}async fetchPromptsAndMetadata(){let e=_typeutils.getValues.call(void 0, this.prompts),r=e.map(({id:n})=>n).filter(n=>!!n),t=e.map(({title:n})=>n).filter(n=>!!n),s=_chunkQ3L3F6ZMcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunk7YNUSMVAcjs.Ad.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),D(this.graphQLClient),_chunk7YNUSMVAcjs.Fc.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunkQ3L3F6ZMcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunkQ3L3F6ZMcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunkQ3L3F6ZMcjs.e.call(void 0, o.prompts,"title"),c=_chunkQ3L3F6ZMcjs.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 _chunk7YNUSMVAcjs.Fc.call(void 0, this.graphQLClient,{names:[e]});if(t)return this.agentsByName[t.name]=t,this.agentsByAgentId[t.agentId]=t,t}async getPromptThreadBySlackTs(e){let[r]=await _chunk7YNUSMVAcjs.Bd.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=[]}=_chunkQ3L3F6ZMcjs.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=_chunkQ3L3F6ZMcjs.b.call(void 0, t,50),i=[];return await _bluebird.mapSeries.call(void 0, o,async p=>{let m=await _chunk7YNUSMVAcjs.Fc.call(void 0, this.graphQLClient,{names:p});m.forEach(c=>{this.agentsByName[c.name]=c,this.agentsByAgentId[c.agentId]=c}),i.push(...m)}),[...s,...i]}getAgentFiles(e){return _chunk7YNUSMVAcjs.Dc.call(void 0, this.graphQLClient,e)}getLargeLanguageModel(e){let r=this.largeLanguageModels.find(t=>typeof e=="string"?t.id===e:t.name===e.name&&t.client===e.client);if(!r)throw new Error(`Failed to find model matching: ${typeof e=="string"?e:JSON.stringify(e)}`);return r}async getPromptDefinition(e){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let{promptContentMap:r}=this;if(!r)throw new Error("Expected this.promptContentMap to be defined");let t=r[e];if(!t)throw new Error(`Expected this.promptContentMap[${e}] to be defined`);return t}async compilePrompt(e,r){let t=await this.getPromptDefinition(e),s=this.prompts[e];if(!s)throw new Error(`Expected this.prompts[${e}] to be defined`);if(this.requireApproval&&t.status!==_privacytypes.PromptStatus.Approved)throw new Error(`Assessment "${t.title}" cannot be used because its in status: "${t.status}"`);if(t.status===_privacytypes.PromptStatus.Rejected)throw new Error(`Assessment "${t.title}" cannot be used because it's in status: "${t.status}"`);return _typeutils.decodeCodec.call(void 0, s.paramCodec,r),this.handlebars.compile(t.content)({currentDate:new Date().toISOString(),...this.variables,...r})}parseAiResponse(e,r){let t=this.prompts[e];if(!t)throw new Error(`Expected this.prompts[${e}] to be defined`);let s=t.extractFromTag&&(j(t.extractFromTag).exec(r)||[])[1]||r;return _typeutils.decodeCodec.call(void 0, t.outputCodec,H(s),!1)}async reportAndParsePromptRun(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);if(t.promptRunMessages[t.promptRunMessages.length-1].role!==_privacytypes.ChatCompletionRole.Assistant)throw new Error(`promptRunMessages[${t.promptRunMessages.length-1}].role is expected to be = ${_privacytypes.ChatCompletionRole.Assistant}`);let i=t.promptRunMessages[t.promptRunMessages.length-1].content,p;try{p=this.parseAiResponse(e,i)}catch(c){throw await _chunk7YNUSMVAcjs.fe.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 _chunk7YNUSMVAcjs.fe.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 _chunk7YNUSMVAcjs.fe.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 Hm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function qm(a){return Object.entries(a).reduce((e,[r,t])=>t!=null&&t!==""&&!(Array.isArray(t)&&t.length===0)&&!(typeof t=="object"&&Object.keys(t).length===0)?Object.assign(e,{[r]:t}):e,{})}var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _child_process = require('child_process');function Wm({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=_chunkWI7C7KDMcjs.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 = _chunkUTU4F57Hcjs.tb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunkUTU4F57Hcjs.Ga; exports.ADD_SILO_DISCOVERY_RESULTS = _chunkUTU4F57Hcjs.G; exports.ADMIN_DASH = _chunkWI7C7KDMcjs.o; exports.ADMIN_DASH_DATAPOINTS = _chunkWI7C7KDMcjs.q; exports.ADMIN_DASH_INTEGRATIONS = _chunkWI7C7KDMcjs.p; exports.AGENTS = _chunkUTU4F57Hcjs.Gb; exports.AGENT_FILES = _chunkUTU4F57Hcjs.Jb; exports.AGENT_FUNCTIONS = _chunkUTU4F57Hcjs.Mb; exports.API_KEYS = _chunkUTU4F57Hcjs.D; exports.APPROVE_PRIVACY_REQUEST = _chunkUTU4F57Hcjs.W; exports.ASSESSMENTS = _chunkUTU4F57Hcjs.ea; exports.ASSESSMENT_SECTION_FIELDS = _chunkUTU4F57Hcjs.da; exports.ASSESSMENT_TEMPLATES = _chunkUTU4F57Hcjs.ia; exports.ASSUME_ROLE = _chunkUTU4F57Hcjs.Eb; exports.ATTRIBUTES = _chunkUTU4F57Hcjs.Ka; exports.ATTRIBUTE_KEYS_REQUESTS = _chunkUTU4F57Hcjs.L; exports.ATTRIBUTE_VALUES = _chunkUTU4F57Hcjs.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 = _chunkUTU4F57Hcjs.Od; exports.AssessmentAnswerOptionInput = _chunkQEM6S2W7cjs.Y; exports.AssessmentDisplayLogicInput = _chunkQEM6S2W7cjs.V; exports.AssessmentInput = _chunkQEM6S2W7cjs.ca; exports.AssessmentNestedRule = _chunkUTU4F57Hcjs.Nd; exports.AssessmentNestedRuleInput = _chunkQEM6S2W7cjs.U; exports.AssessmentResourceInput = _chunkQEM6S2W7cjs.ba; exports.AssessmentRetentionScheduleInput = _chunkQEM6S2W7cjs.$; exports.AssessmentRiskLogic = _chunkUTU4F57Hcjs.Qd; exports.AssessmentRule = _chunkUTU4F57Hcjs.Md; exports.AssessmentRuleInput = _chunkQEM6S2W7cjs.T; exports.AssessmentRuleWithOperands = _chunkUTU4F57Hcjs.Kd; exports.AssessmentRuleWithoutOperands = _chunkUTU4F57Hcjs.Ld; exports.AssessmentSectionInput = _chunkQEM6S2W7cjs._; exports.AssessmentSectionQuestionInput = _chunkQEM6S2W7cjs.Z; exports.AssessmentTemplateInput = _chunkQEM6S2W7cjs.aa; exports.AttestedExtraIdentifiers = _chunkUTU4F57Hcjs.nf; exports.AttributeInput = _chunkQEM6S2W7cjs.k; exports.AttributePreview = _chunkQEM6S2W7cjs.l; exports.AttributeValueInput = _chunkQEM6S2W7cjs.j; exports.BLANK = _chunkUTU4F57Hcjs.cc; exports.BULK_APPLY = _chunkUTU4F57Hcjs.bc; exports.BULK_REQUEST_FILES = _chunkUTU4F57Hcjs.Ea; exports.BUSINESS_ENTITIES = _chunkUTU4F57Hcjs.qb; exports.BusinessEntityInput = _chunkQEM6S2W7cjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunkUTU4F57Hcjs.X; exports.CAN_APPLY_IN_BULK = _chunkUTU4F57Hcjs.gc; exports.CATALOGS = _chunkUTU4F57Hcjs.r; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunkUTU4F57Hcjs.ua; exports.CODE_PACKAGES = _chunkUTU4F57Hcjs.P; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunkUTU4F57Hcjs.pb; exports.CONSENT_PARTITIONS = _chunkUTU4F57Hcjs.Ta; exports.COOKIES = _chunkUTU4F57Hcjs.Ya; exports.CREATE_ACTION_ITEMS = _chunkUTU4F57Hcjs.xb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunkUTU4F57Hcjs.Ia; exports.CREATE_AGENT = _chunkUTU4F57Hcjs.Hb; exports.CREATE_AGENT_FILE = _chunkUTU4F57Hcjs.Kb; exports.CREATE_AGENT_FUNCTION = _chunkUTU4F57Hcjs.Nb; exports.CREATE_API_KEY = _chunkUTU4F57Hcjs.E; exports.CREATE_ATTRIBUTE = _chunkUTU4F57Hcjs.Pa; exports.CREATE_ATTRIBUTE_VALUES = _chunkUTU4F57Hcjs.La; exports.CREATE_BUSINESS_ENTITY = _chunkUTU4F57Hcjs.rb; exports.CREATE_CODE_PACKAGE = _chunkUTU4F57Hcjs.R; exports.CREATE_CONSENT_EXPERIENCE = _chunkUTU4F57Hcjs.nb; exports.CREATE_CONSENT_MANAGER = _chunkUTU4F57Hcjs.ab; exports.CREATE_CONSENT_PARTITION = _chunkUTU4F57Hcjs.ob; exports.CREATE_DATA_FLOWS = _chunkUTU4F57Hcjs.Ua; exports.CREATE_DATA_SILOS = _chunkUTU4F57Hcjs.m; exports.CREATE_DATA_SUBJECT = _chunkUTU4F57Hcjs.x; exports.CREATE_DATA_SUB_CATEGORY = _chunkUTU4F57Hcjs.Tb; exports.CREATE_ENRICHER = _chunkUTU4F57Hcjs.p; exports.CREATE_IDENTIFIER = _chunkUTU4F57Hcjs.u; exports.CREATE_PROCESSING_ACTIVITY = _chunkUTU4F57Hcjs.Zb; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunkUTU4F57Hcjs.Wb; exports.CREATE_PROMPT = _chunkUTU4F57Hcjs.oa; exports.CREATE_PROMPT_GROUP = _chunkUTU4F57Hcjs.sa; exports.CREATE_PROMPT_PARTIAL = _chunkUTU4F57Hcjs.qa; exports.CREATE_REPOSITORY = _chunkUTU4F57Hcjs.C; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunkUTU4F57Hcjs.O; exports.CREATE_TEAM = _chunkUTU4F57Hcjs.ya; exports.CREATE_TEMPLATE = _chunkUTU4F57Hcjs.J; exports.CREATE_VENDOR = _chunkUTU4F57Hcjs.Qb; exports.CachedFileState = _chunkUTU4F57Hcjs.hc; exports.CachedRequestState = _chunkUTU4F57Hcjs.jc; exports.CodePackageInput = _chunkQEM6S2W7cjs.D; exports.CodePackageSdk = _chunkQEM6S2W7cjs.C; exports.ColumnName = _chunkUTU4F57Hcjs.ec; exports.ConsentManageExperienceInput = _chunkQEM6S2W7cjs.K; exports.ConsentManagerInput = _chunkQEM6S2W7cjs.M; exports.ConsentManagerMetricBin = _chunkUTU4F57Hcjs.Qc; exports.ConsentManagerServiceMetadata = _chunkQEM6S2W7cjs.ka; exports.ConsentPreferenceResponse = _chunkIXOC4S5Lcjs.i; exports.ConsentPreferenceTopic = _chunkQEM6S2W7cjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkQEM6S2W7cjs.da; exports.ConsentPurpose = _chunkQEM6S2W7cjs.fa; exports.CookieCsvInput = _chunkQEM6S2W7cjs.ja; exports.CookieInput = _chunkQEM6S2W7cjs.J; exports.CronIdentifier = _chunkVWFYPZ4Qcjs.a; exports.CronIdentifierPush = _chunkVWFYPZ4Qcjs.c; exports.DATAPOINT_EXPORT = _chunkUTU4F57Hcjs.g; exports.DATA_FLOWS = _chunkUTU4F57Hcjs.Xa; exports.DATA_POINTS = _chunkUTU4F57Hcjs.a; exports.DATA_POINT_COUNT = _chunkUTU4F57Hcjs.b; exports.DATA_SILOS = _chunkUTU4F57Hcjs.i; exports.DATA_SILOS_ENRICHED = _chunkUTU4F57Hcjs.k; exports.DATA_SILO_EXPORT = _chunkUTU4F57Hcjs.j; exports.DATA_SUBJECTS = _chunkUTU4F57Hcjs.w; exports.DATA_SUB_CATEGORIES = _chunkUTU4F57Hcjs.Sb; exports.DEBUG = _chunkWI7C7KDMcjs.z; exports.DEFAULT_TRANSCEND_API = _chunkWI7C7KDMcjs.r; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkWI7C7KDMcjs.s; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunkUTU4F57Hcjs.ce; exports.DELETE_API_KEY = _chunkUTU4F57Hcjs.F; exports.DELETE_ATTRIBUTE_VALUE = _chunkUTU4F57Hcjs.Na; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunkUTU4F57Hcjs.zb; exports.DEPLOY_CONSENT_MANAGER = _chunkUTU4F57Hcjs.db; exports.DETERMINE_LOGIN_METHOD = _chunkUTU4F57Hcjs.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 = _chunkUTU4F57Hcjs.H; exports.ENRICHERS = _chunkUTU4F57Hcjs.n; exports.ENTRY_COUNT = _chunkUTU4F57Hcjs.h; exports.EXPERIENCES = _chunkUTU4F57Hcjs.Sa; exports.EnrichPrivacyRequest = _chunk2CCKVEWScjs.b; exports.EnricherInput = _chunkQEM6S2W7cjs.e; exports.FETCH_CONSENT_MANAGER = _chunkUTU4F57Hcjs._a; exports.FETCH_CONSENT_MANAGER_ID = _chunkUTU4F57Hcjs.Za; exports.FETCH_CONSENT_MANAGER_THEME = _chunkUTU4F57Hcjs.$a; exports.FETCH_PRIVACY_CENTER_ID = _chunkUTU4F57Hcjs.yb; exports.FieldInput = _chunkQEM6S2W7cjs.v; exports.GLOBAL_ACTION_ITEMS = _chunkUTU4F57Hcjs.vb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunkUTU4F57Hcjs.Ha; exports.IDENTIFIERS = _chunkUTU4F57Hcjs.s; exports.IDENTIFIER_BLOCK_LIST = _chunkUTU4F57Hcjs.dc; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunkUTU4F57Hcjs.fa; exports.INITIALIZER = _chunkUTU4F57Hcjs.o; exports.IP_ADDRESS_REGEX = _chunkIXOC4S5Lcjs.f; exports.IS_REQUIRED = _chunkUTU4F57Hcjs.fc; exports.IdentifierInput = _chunkQEM6S2W7cjs.H; exports.ImportOnetrustAssessmentsInput = _chunkQEM6S2W7cjs.ra; exports.IntlMessage = _chunkUTU4F57Hcjs.rf; exports.IntlMessageInput = _chunkQEM6S2W7cjs.P; exports.LARGE_LANGUAGE_MODELS = _chunkUTU4F57Hcjs.Fb; exports.LOGIN = _chunkUTU4F57Hcjs.Db; exports.MESSAGES = _chunkUTU4F57Hcjs._; exports.NEW_IDENTIFIER_TYPES = _chunkUTU4F57Hcjs.t; exports.NONE = _chunkUTU4F57Hcjs.ac; exports.NOTIFY_ADDITIONAL_TIME = _chunkUTU4F57Hcjs.Z; exports.ORGANIZATION = _chunkUTU4F57Hcjs.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 = _chunkUTU4F57Hcjs.T; exports.PREFERENCE_TOPICS = _chunkUTU4F57Hcjs.ha; exports.PRIVACY_CENTER = _chunkUTU4F57Hcjs.Ab; exports.PROCESSING_ACTIVITIES = _chunkUTU4F57Hcjs.Yb; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkUTU4F57Hcjs.Vb; exports.PROMPTS = _chunkUTU4F57Hcjs.ja; exports.PROMPTS_WITH_VARIABLES = _chunkUTU4F57Hcjs.ma; exports.PROMPT_GROUPS = _chunkUTU4F57Hcjs.la; exports.PROMPT_PARTIALS = _chunkUTU4F57Hcjs.ka; exports.PROMPT_THREADS = _chunkUTU4F57Hcjs.S; exports.PURPOSES = _chunkUTU4F57Hcjs.ga; exports.ParsedAttributeInput = _chunkUTU4F57Hcjs.oc; exports.PartitionInput = _chunkQEM6S2W7cjs.L; exports.PathfinderPolicy = _chunkQEM6S2W7cjs.pa; exports.PathfinderPolicyName = _chunkQ7I37FJVcjs.e; exports.PathfinderPolicyNameC = _chunkQEM6S2W7cjs.la; exports.PathfinderPromptRunMetadata = _chunkQEM6S2W7cjs.qa; exports.PolicyInput = _chunkQEM6S2W7cjs.O; exports.PrivacyCenterInput = _chunkQEM6S2W7cjs.N; exports.PrivacyRequest = _chunkUTU4F57Hcjs.jd; exports.PrivacyRequestInput = _chunkUTU4F57Hcjs.of; exports.PrivacyRequestResponse = _chunkUTU4F57Hcjs.xf; 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 = _chunkK45V7WKNcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunkUTU4F57Hcjs.wa; exports.REMOVE_REQUEST_IDENTIFIERS = _chunkUTU4F57Hcjs.Aa; exports.REPORT_PROMPT_RUN = _chunkUTU4F57Hcjs.Fa; exports.REPOSITORIES = _chunkUTU4F57Hcjs.A; exports.REQUESTS = _chunkUTU4F57Hcjs.V; exports.REQUEST_DATA_SILOS = _chunkUTU4F57Hcjs.ta; exports.REQUEST_ENRICHERS = _chunkUTU4F57Hcjs.aa; exports.REQUEST_FILES = _chunkUTU4F57Hcjs.Da; exports.REQUEST_IDENTIFIERS = _chunkUTU4F57Hcjs.Ba; exports.RETRYABLE_BATCH_STATUSES = _chunkWI7C7KDMcjs.y; exports.RETRY_REQUEST_DATA_SILO = _chunkUTU4F57Hcjs.va; exports.RETRY_REQUEST_ENRICHER = _chunkUTU4F57Hcjs.ba; exports.RateCounter = _chunkUTU4F57Hcjs.Yf; exports.RegionInput = _chunkQEM6S2W7cjs.z; exports.RepositoryInput = _chunkQEM6S2W7cjs.E; exports.RequestFileMetadata = _chunkUTU4F57Hcjs.sf; exports.RequestFileMetadataResponse = _chunkUTU4F57Hcjs.tf; exports.RequestIdentifiersResponse = _chunkUTU4F57Hcjs.hd; exports.RiskAssignmentInput = _chunkQEM6S2W7cjs.W; exports.RiskLogicInput = _chunkQEM6S2W7cjs.X; exports.SCOPES_BY_TITLE = _chunkWI7C7KDMcjs.w; exports.SCOPE_TITLES = _chunkWI7C7KDMcjs.x; exports.SET_RESOURCE_ATTRIBUTES = _chunkUTU4F57Hcjs.Ra; exports.SKIP_REQUEST_ENRICHER = _chunkUTU4F57Hcjs.ca; exports.SOFTWARE_DEVELOPMENT_KITS = _chunkUTU4F57Hcjs.M; exports.SOMBRA_VERSION = _chunkUTU4F57Hcjs.$b; exports.SUB_DATA_POINTS = _chunkUTU4F57Hcjs.c; exports.SUB_DATA_POINTS_COUNT = _chunkUTU4F57Hcjs.d; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunkUTU4F57Hcjs.e; exports.SYNC_ATTRIBUTE_TYPES = _chunkUTU4F57Hcjs.Kc; exports.SoftwareDevelopmentKitInput = _chunkQEM6S2W7cjs.B; exports.StoredApiKey = _chunkQEM6S2W7cjs.ha; exports.SuccessfulRequest = _chunkUTU4F57Hcjs.ic; exports.TEAMS = _chunkUTU4F57Hcjs.xa; exports.TEMPLATES = _chunkUTU4F57Hcjs.I; exports.TOGGLE_CONSENT_PRECEDENCE = _chunkUTU4F57Hcjs.kb; exports.TOGGLE_DATA_SUBJECT = _chunkUTU4F57Hcjs.z; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunkUTU4F57Hcjs.jb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunkUTU4F57Hcjs.ib; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunkUTU4F57Hcjs.hb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkWI7C7KDMcjs.u; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkWI7C7KDMcjs.t; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkWI7C7KDMcjs.v; exports.TeamInput = _chunkQEM6S2W7cjs.d; exports.TemplateInput = _chunkQEM6S2W7cjs.a; exports.TranscendInput = _chunkQEM6S2W7cjs.ga; exports.TranscendPromptManager = B; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunkUTU4F57Hcjs.ub; exports.UPDATE_ACTION_ITEMS = _chunkUTU4F57Hcjs.wb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunkUTU4F57Hcjs.Ja; exports.UPDATE_AGENTS = _chunkUTU4F57Hcjs.Ib; exports.UPDATE_AGENT_FILES = _chunkUTU4F57Hcjs.Lb; exports.UPDATE_AGENT_FUNCTIONS = _chunkUTU4F57Hcjs.Ob; exports.UPDATE_ATTRIBUTE = _chunkUTU4F57Hcjs.Qa; exports.UPDATE_ATTRIBUTE_VALUES = _chunkUTU4F57Hcjs.Ma; exports.UPDATE_BUSINESS_ENTITIES = _chunkUTU4F57Hcjs.sb; exports.UPDATE_CODE_PACKAGES = _chunkUTU4F57Hcjs.Q; exports.UPDATE_CONSENT_EXPERIENCE = _chunkUTU4F57Hcjs.mb; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunkUTU4F57Hcjs.eb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunkUTU4F57Hcjs.fb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunkUTU4F57Hcjs.lb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunkUTU4F57Hcjs.cb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunkUTU4F57Hcjs.bb; exports.UPDATE_DATA_FLOWS = _chunkUTU4F57Hcjs.Va; exports.UPDATE_DATA_SILOS = _chunkUTU4F57Hcjs.l; exports.UPDATE_DATA_SUBJECT = _chunkUTU4F57Hcjs.y; exports.UPDATE_DATA_SUB_CATEGORIES = _chunkUTU4F57Hcjs.Ub; exports.UPDATE_ENRICHER = _chunkUTU4F57Hcjs.q; exports.UPDATE_IDENTIFIER = _chunkUTU4F57Hcjs.v; exports.UPDATE_INTL_MESSAGES = _chunkUTU4F57Hcjs.$; exports.UPDATE_LOAD_OPTIONS = _chunkUTU4F57Hcjs.gb; exports.UPDATE_OR_CREATE_COOKIES = _chunkUTU4F57Hcjs.Wa; exports.UPDATE_OR_CREATE_DATA_POINT = _chunkUTU4F57Hcjs.f; exports.UPDATE_POLICIES = _chunkUTU4F57Hcjs.U; exports.UPDATE_PRIVACY_CENTER = _chunkUTU4F57Hcjs.Bb; exports.UPDATE_PRIVACY_REQUEST = _chunkUTU4F57Hcjs.Y; exports.UPDATE_PROCESSING_ACTIVITIES = _chunkUTU4F57Hcjs._b; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkUTU4F57Hcjs.Xb; exports.UPDATE_PROMPTS = _chunkUTU4F57Hcjs.na; exports.UPDATE_PROMPT_GROUPS = _chunkUTU4F57Hcjs.ra; exports.UPDATE_PROMPT_PARTIALS = _chunkUTU4F57Hcjs.pa; exports.UPDATE_REPOSITORIES = _chunkUTU4F57Hcjs.B; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunkUTU4F57Hcjs.N; exports.UPDATE_TEAM = _chunkUTU4F57Hcjs.za; exports.UPDATE_VENDORS = _chunkUTU4F57Hcjs.Rb; exports.USERS = _chunkUTU4F57Hcjs.Ca; exports.USP_STRING_REGEX = _chunkK45V7WKNcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkSW5CIF5Dcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkSW5CIF5Dcjs.a; exports.VENDORS = _chunkUTU4F57Hcjs.Pb; exports.VendorInput = _chunkQEM6S2W7cjs.p; exports.WebhookHeader = _chunkQEM6S2W7cjs.b; exports.addMessagesToPromptRun = _chunkUTU4F57Hcjs.tc; exports.appendCsvSync = _chunkLR3CPNDMcjs.b; exports.approvePrivacyRequests = _chunkUTU4F57Hcjs.zf; exports.assumeRole = _chunkUTU4F57Hcjs.Hd; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunkUTU4F57Hcjs.vc; exports.buildTranscendGraphQLClientGeneric = _chunkUTU4F57Hcjs.uc; exports.buildXdiSyncEndpoint = _chunkIXOC4S5Lcjs.g; exports.bulkRestartRequests = _chunkUTU4F57Hcjs.Hf; exports.bulkRetryEnrichers = _chunkUTU4F57Hcjs.Jf; exports.cancelPrivacyRequests = _chunkUTU4F57Hcjs.Cf; exports.consentManagersToBusinessEntities = _chunkIXOC4S5Lcjs.h; exports.convertToDataSubjectAllowlist = _chunkUTU4F57Hcjs.vd; exports.convertToDataSubjectBlockList = _chunkUTU4F57Hcjs.ud; exports.createActionItemCollection = _chunkUTU4F57Hcjs.ie; exports.createActionItems = _chunkUTU4F57Hcjs.le; exports.createAgent = _chunkUTU4F57Hcjs.ue; exports.createAgentFile = _chunkUTU4F57Hcjs.oe; exports.createAgentFunction = _chunkUTU4F57Hcjs.re; exports.createApiKey = _chunkUTU4F57Hcjs.Id; exports.createBusinessEntity = _chunkUTU4F57Hcjs.ye; exports.createCodePackage = _chunkUTU4F57Hcjs.He; exports.createConsentToken = _chunkK45V7WKNcjs.a; exports.createDataCategory = _chunkUTU4F57Hcjs.Oe; exports.createDataFlows = _chunkUTU4F57Hcjs.Se; exports.createProcessingPurpose = _chunkUTU4F57Hcjs.af; exports.createPrompt = _chunkUTU4F57Hcjs.df; exports.createRegexForTag = j; exports.createRepository = _chunkUTU4F57Hcjs.Ee; exports.createSoftwareDevelopmentKit = _chunkUTU4F57Hcjs.Be; exports.createSombraGotInstance = _chunkUTU4F57Hcjs.wc; exports.createTranscendConsentGotInstance = _chunkUTU4F57Hcjs.xc; exports.createVendor = _chunkUTU4F57Hcjs.gf; exports.defineTranscendPrompts = Gm; exports.deleteApiKey = _chunkUTU4F57Hcjs.Jd; exports.deployConsentManager = _chunkUTU4F57Hcjs.yc; exports.description = _chunkWI7C7KDMcjs.l; exports.domainToHost = _chunkIXOC4S5Lcjs.e; exports.downloadPrivacyRequestFiles = _chunkUTU4F57Hcjs.wf; exports.enrichPrivacyRequest = _chunk2CCKVEWScjs.c; exports.ensureAllDataSubjectsExist = _chunkUTU4F57Hcjs.td; exports.extractClientError = _chunkUTU4F57Hcjs.Ef; exports.extractErrorMessage = _chunkUTU4F57Hcjs.Tf; exports.fetchActiveSiloDiscoPlugin = _chunkUTU4F57Hcjs.Ac; exports.fetchAllActionItems = _chunkUTU4F57Hcjs.Bc; exports.fetchAllActions = _chunkUTU4F57Hcjs.Cc; exports.fetchAllAgentFiles = _chunkUTU4F57Hcjs.Dc; exports.fetchAllAgentFunctions = _chunkUTU4F57Hcjs.Ec; exports.fetchAllAgents = _chunkUTU4F57Hcjs.Fc; exports.fetchAllApiKeys = _chunkUTU4F57Hcjs.od; exports.fetchAllAssessmentTemplates = _chunkUTU4F57Hcjs.Hc; exports.fetchAllAssessments = _chunkUTU4F57Hcjs.Gc; exports.fetchAllAttributeValues = _chunkUTU4F57Hcjs.Jc; exports.fetchAllAttributes = _chunkUTU4F57Hcjs.Lc; exports.fetchAllBusinessEntities = _chunkUTU4F57Hcjs.Mc; exports.fetchAllCatalogs = _chunkUTU4F57Hcjs.qd; exports.fetchAllCookies = _chunkUTU4F57Hcjs.Tc; exports.fetchAllDataCategories = _chunkUTU4F57Hcjs.Uc; exports.fetchAllDataFlows = _chunkUTU4F57Hcjs.Vc; exports.fetchAllDataPoints = _chunkUTU4F57Hcjs.Ud; exports.fetchAllDataSilos = _chunkUTU4F57Hcjs.Sd; exports.fetchAllDataSubjects = _chunkUTU4F57Hcjs.sd; exports.fetchAllEnrichers = _chunkUTU4F57Hcjs.Yd; exports.fetchAllIdentifiers = _chunkUTU4F57Hcjs.$f; exports.fetchAllMessages = _chunkUTU4F57Hcjs.Wc; exports.fetchAllPolicies = _chunkUTU4F57Hcjs.Zc; exports.fetchAllPreferenceTopics = _chunkUTU4F57Hcjs.$c; exports.fetchAllPrivacyCenters = _chunkUTU4F57Hcjs.ad; exports.fetchAllProcessingActivities = _chunkUTU4F57Hcjs.bd; exports.fetchAllProcessingPurposes = _chunkUTU4F57Hcjs.cd; exports.fetchAllPromptGroups = _chunkUTU4F57Hcjs.wd; exports.fetchAllPromptPartials = _chunkUTU4F57Hcjs.xd; exports.fetchAllPromptThreads = _chunkUTU4F57Hcjs.Ad; exports.fetchAllPrompts = _chunkUTU4F57Hcjs.yd; exports.fetchAllPurposes = _chunkUTU4F57Hcjs.dd; exports.fetchAllPurposesAndPreferences = _chunkUTU4F57Hcjs.ed; exports.fetchAllRequestAttributeKeys = _chunkUTU4F57Hcjs.Ic; exports.fetchAllRequestEnrichers = _chunkUTU4F57Hcjs.fd; exports.fetchAllRequestIdentifierMetadata = _chunkUTU4F57Hcjs.gd; exports.fetchAllRequestIdentifiers = _chunkUTU4F57Hcjs.id; exports.fetchAllRequests = _chunkUTU4F57Hcjs.kd; exports.fetchAllSubDataPoints = _chunkUTU4F57Hcjs.Td; exports.fetchAllTeams = _chunkUTU4F57Hcjs.ld; exports.fetchAllTemplates = _chunkUTU4F57Hcjs._d; exports.fetchAllUsers = _chunkUTU4F57Hcjs.md; exports.fetchAllVendors = _chunkUTU4F57Hcjs.nd; exports.fetchAndIndexCatalogs = _chunkUTU4F57Hcjs.rd; exports.fetchApiKeys = _chunkUTU4F57Hcjs.pd; exports.fetchConsentManager = _chunkUTU4F57Hcjs.Nc; exports.fetchConsentManagerAnalyticsData = _chunkUTU4F57Hcjs.Rc; exports.fetchConsentManagerExperiences = _chunkUTU4F57Hcjs.Pc; exports.fetchConsentManagerId = _chunkUTU4F57Hcjs.Oc; exports.fetchConsentManagerTheme = _chunkUTU4F57Hcjs.Sc; exports.fetchConsentPreferences = _chunkIXOC4S5Lcjs.j; exports.fetchEnrichedDataSilos = _chunkUTU4F57Hcjs.Vd; exports.fetchIdentifiersAndCreateMissing = _chunkUTU4F57Hcjs.ag; exports.fetchPartitions = _chunkUTU4F57Hcjs.ae; exports.fetchPrivacyCenterId = _chunkUTU4F57Hcjs.Yc; exports.fetchPrivacyCenterUrl = _chunkUTU4F57Hcjs.Xc; exports.fetchPromptsWithVariables = _chunkUTU4F57Hcjs.zd; exports.fetchRequestDataSilo = _chunkUTU4F57Hcjs.Dd; exports.fetchRequestDataSiloActiveCount = _chunkUTU4F57Hcjs.Ed; exports.fetchRequestDataSilos = _chunkUTU4F57Hcjs.Cd; exports.fetchRequestDataSilosCount = _chunkUTU4F57Hcjs.Bd; exports.fetchRequestFilesForRequest = _chunkUTU4F57Hcjs.Fd; exports.filterNullishValuesFromObject = Vm; exports.filterRows = _chunkUTU4F57Hcjs.sc; exports.formatAttributeValues = _chunkUTU4F57Hcjs._c; exports.fuzzyMatchColumns = _chunkUTU4F57Hcjs.lc; exports.fuzzySearch = _chunkUTU4F57Hcjs.kc; exports.generateCrossAccountApiKeys = _chunkTXG7TJLKcjs.a; exports.getErrorStatus = _chunkUTU4F57Hcjs.Sf; exports.getFileMetadataForPrivacyRequests = _chunkUTU4F57Hcjs.uf; exports.getGitFilesThatChanged = Jm; exports.getUniqueValuesForColumn = _chunkUTU4F57Hcjs.rc; exports.inquirerAutoComplete = _chunkUTU4F57Hcjs.Qf; exports.inquirerConfirmBoolean = _chunkUTU4F57Hcjs.Of; exports.inquirerConfirmText = _chunkUTU4F57Hcjs.Pf; exports.limitRecords = _chunkUTU4F57Hcjs.Xf; exports.listDirectories = _chunkTXG7TJLKcjs.d; exports.listFiles = _chunkTXG7TJLKcjs.c; exports.loginUser = _chunkUTU4F57Hcjs.Gd; exports.makeGraphQLRequest = _chunkUTU4F57Hcjs._f; exports.mapColumnsToAttributes = _chunkUTU4F57Hcjs.Df; exports.mapColumnsToIdentifiers = _chunkUTU4F57Hcjs.Bf; exports.mapCsvColumnsToApi = _chunkUTU4F57Hcjs.lf; exports.mapCsvRowsToRequestInputs = _chunkUTU4F57Hcjs.qf; exports.mapEnumValues = _chunkUTU4F57Hcjs.mc; exports.mapRequestEnumValues = _chunkUTU4F57Hcjs.mf; exports.markCronIdentifierCompleted = _chunkVWFYPZ4Qcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkVWFYPZ4Qcjs.f; exports.markSilentPrivacyRequests = _chunkUTU4F57Hcjs.kf; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkWI7C7KDMcjs.n; exports.normalizeIdentifierValue = _chunkUTU4F57Hcjs.pf; exports.notifyPrivacyRequestsAdditionalTime = _chunkUTU4F57Hcjs.Af; exports.parseAssessmentDisplayLogic = _chunkUTU4F57Hcjs.Pd; exports.parseAssessmentRiskLogic = _chunkUTU4F57Hcjs.Rd; exports.parseAttributesFromString = _chunkUTU4F57Hcjs.pc; exports.parseFilePath = _chunkLR3CPNDMcjs.d; exports.parseVariablesFromString = _chunkUTU4F57Hcjs.Rf; exports.pullAllDatapoints = _chunkXCTTKA6Ccjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkVWFYPZ4Qcjs.g; exports.pullConsentManagerMetrics = _chunkIXOC4S5Lcjs.d; exports.pullCronPageOfIdentifiers = _chunkVWFYPZ4Qcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunk2CCKVEWScjs.a; exports.pullPrivacyRequests = _chunkUTU4F57Hcjs.Lf; exports.pullTranscendConfiguration = _chunkUTU4F57Hcjs.de; exports.pullUnstructuredSubDataPointRecommendations = _chunkXCTTKA6Ccjs.b; exports.pushCronIdentifiersFromCsv = _chunkVWFYPZ4Qcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunk2CCKVEWScjs.d; exports.readCsv = _chunkUTU4F57Hcjs.qc; exports.readSafe = _chunkUTU4F57Hcjs.Zf; exports.readTranscendYaml = _chunkSW5CIF5Dcjs.d; exports.removeLinks = jm; exports.removeUnverifiedRequestIdentifiers = _chunkUTU4F57Hcjs.Nf; exports.replaceVariablesInYaml = _chunkSW5CIF5Dcjs.c; exports.reportPromptRun = _chunkUTU4F57Hcjs.ee; exports.restartPrivacyRequest = _chunkUTU4F57Hcjs.Gf; exports.retryRequestDataSilos = _chunkUTU4F57Hcjs.Kf; exports.retryRequestEnricher = _chunkUTU4F57Hcjs.fe; exports.retrySamePromise = _chunkUTU4F57Hcjs.Wf; exports.setResourceAttributes = _chunkUTU4F57Hcjs.ge; exports.skipPreflightJobs = _chunkUTU4F57Hcjs.If; exports.skipRequestDataSilos = _chunkUTU4F57Hcjs.Mf; exports.sleepPromise = _chunkUTU4F57Hcjs.Uf; exports.splitCsvToList = _chunkUTU4F57Hcjs.nc; exports.splitInHalf = _chunkUTU4F57Hcjs.Vf; exports.streamPrivacyRequestFiles = _chunkUTU4F57Hcjs.vf; exports.submitPrivacyRequest = _chunkUTU4F57Hcjs.yf; exports.syncAction = _chunkUTU4F57Hcjs.he; exports.syncActionItemCollections = _chunkUTU4F57Hcjs.ke; exports.syncActionItems = _chunkUTU4F57Hcjs.ne; exports.syncAgentFiles = _chunkUTU4F57Hcjs.qe; exports.syncAgentFunctions = _chunkUTU4F57Hcjs.te; exports.syncAgents = _chunkUTU4F57Hcjs.we; exports.syncAttribute = _chunkUTU4F57Hcjs.xe; exports.syncBusinessEntities = _chunkUTU4F57Hcjs.Ae; exports.syncCodePackages = _chunkUTU4F57Hcjs.Je; exports.syncConfigurationToTranscend = _chunkUTU4F57Hcjs.bg; exports.syncConsentManager = _chunkUTU4F57Hcjs.Le; exports.syncConsentManagerExperiences = _chunkUTU4F57Hcjs.Ke; exports.syncCookies = _chunkUTU4F57Hcjs.Ne; exports.syncDataCategories = _chunkUTU4F57Hcjs.Qe; exports.syncDataFlows = _chunkUTU4F57Hcjs.Te; exports.syncDataSiloDependencies = _chunkUTU4F57Hcjs.Xd; exports.syncDataSilos = _chunkUTU4F57Hcjs.Wd; exports.syncDataSubject = _chunkUTU4F57Hcjs.Ue; exports.syncEnricher = _chunkUTU4F57Hcjs.Zd; exports.syncIdentifier = _chunkUTU4F57Hcjs.Ve; exports.syncIntlMessages = _chunkUTU4F57Hcjs.Xe; exports.syncPartitions = _chunkUTU4F57Hcjs.be; exports.syncPolicies = _chunkUTU4F57Hcjs.Ze; exports.syncPrivacyCenter = _chunkUTU4F57Hcjs._e; exports.syncProcessingActivities = _chunkUTU4F57Hcjs.$e; exports.syncProcessingPurposes = _chunkUTU4F57Hcjs.cf; exports.syncPrompts = _chunkUTU4F57Hcjs.ff; exports.syncRepositories = _chunkUTU4F57Hcjs.Ge; exports.syncSoftwareDevelopmentKits = _chunkUTU4F57Hcjs.De; exports.syncTemplate = _chunkUTU4F57Hcjs.$d; exports.syncVendors = _chunkUTU4F57Hcjs.if; exports.updateActionItem = _chunkUTU4F57Hcjs.me; exports.updateActionItemCollection = _chunkUTU4F57Hcjs.je; exports.updateAgentFiles = _chunkUTU4F57Hcjs.pe; exports.updateAgentFunctions = _chunkUTU4F57Hcjs.se; exports.updateAgents = _chunkUTU4F57Hcjs.ve; exports.updateBusinessEntities = _chunkUTU4F57Hcjs.ze; exports.updateCodePackages = _chunkUTU4F57Hcjs.Ie; exports.updateConsentManagerToLatest = _chunkUTU4F57Hcjs.zc; exports.updateConsentManagerVersionToLatest = _chunkIXOC4S5Lcjs.a; exports.updateDataCategories = _chunkUTU4F57Hcjs.Pe; exports.updateDataFlows = _chunkUTU4F57Hcjs.Re; exports.updateIntlMessages = _chunkUTU4F57Hcjs.We; exports.updateOrCreateCookies = _chunkUTU4F57Hcjs.Me; exports.updatePolicies = _chunkUTU4F57Hcjs.Ye; exports.updateProcessingPurposes = _chunkUTU4F57Hcjs.bf; exports.updatePrompts = _chunkUTU4F57Hcjs.ef; exports.updateRepositories = _chunkUTU4F57Hcjs.Fe; exports.updateSoftwareDevelopmentKits = _chunkUTU4F57Hcjs.Ce; exports.updateVendors = _chunkUTU4F57Hcjs.hf; exports.uploadConsents = _chunkK45V7WKNcjs.f; exports.uploadCookiesFromCsv = _chunkIXOC4S5Lcjs.c; exports.uploadDataFlowsFromCsv = _chunkIXOC4S5Lcjs.b; exports.uploadPrivacyRequestsFromCsv = _chunkUTU4F57Hcjs.Ff; exports.uploadSiloDiscoveryResults = _chunkUTU4F57Hcjs.jf; exports.validateTranscendAuth = _chunkTXG7TJLKcjs.b; exports.version = _chunkWI7C7KDMcjs.m; exports.writeCsv = _chunkLR3CPNDMcjs.c; exports.writeCsvSync = _chunkLR3CPNDMcjs.a; exports.writeLargeCsv = _chunkLR3CPNDMcjs.e; exports.writeTranscendYaml = _chunkSW5CIF5Dcjs.e;
3
+ `)[0];if(!o||!i)throw new Error("FAILED TO FIND COMMIT RANGE");let p=_child_process.execSync.call(void 0, `git fetch && git diff --name-only "${a||o}...${i}" -- ${e}`,{encoding:"utf-8"}),m=_chunkQ3L3F6ZMcjs.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 = _chunk7YNUSMVAcjs.tb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunk7YNUSMVAcjs.Ga; exports.ADD_SILO_DISCOVERY_RESULTS = _chunk7YNUSMVAcjs.G; exports.ADMIN_DASH = _chunkQ3L3F6ZMcjs.o; exports.ADMIN_DASH_DATAPOINTS = _chunkQ3L3F6ZMcjs.q; exports.ADMIN_DASH_INTEGRATIONS = _chunkQ3L3F6ZMcjs.p; exports.AGENTS = _chunk7YNUSMVAcjs.Gb; exports.AGENT_FILES = _chunk7YNUSMVAcjs.Jb; exports.AGENT_FUNCTIONS = _chunk7YNUSMVAcjs.Mb; exports.API_KEYS = _chunk7YNUSMVAcjs.D; exports.APPROVE_PRIVACY_REQUEST = _chunk7YNUSMVAcjs.W; exports.ASSESSMENTS = _chunk7YNUSMVAcjs.ea; exports.ASSESSMENT_SECTION_FIELDS = _chunk7YNUSMVAcjs.da; exports.ASSESSMENT_TEMPLATES = _chunk7YNUSMVAcjs.ia; exports.ASSUME_ROLE = _chunk7YNUSMVAcjs.Eb; exports.ATTRIBUTES = _chunk7YNUSMVAcjs.Ka; exports.ATTRIBUTE_KEYS_REQUESTS = _chunk7YNUSMVAcjs.L; exports.ATTRIBUTE_VALUES = _chunk7YNUSMVAcjs.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 = _chunk7YNUSMVAcjs.Pd; exports.AssessmentAnswerOptionInput = _chunkQEM6S2W7cjs.Y; exports.AssessmentDisplayLogicInput = _chunkQEM6S2W7cjs.V; exports.AssessmentInput = _chunkQEM6S2W7cjs.ca; exports.AssessmentNestedRule = _chunk7YNUSMVAcjs.Od; exports.AssessmentNestedRuleInput = _chunkQEM6S2W7cjs.U; exports.AssessmentResourceInput = _chunkQEM6S2W7cjs.ba; exports.AssessmentRetentionScheduleInput = _chunkQEM6S2W7cjs.$; exports.AssessmentRiskLogic = _chunk7YNUSMVAcjs.Rd; exports.AssessmentRule = _chunk7YNUSMVAcjs.Nd; exports.AssessmentRuleInput = _chunkQEM6S2W7cjs.T; exports.AssessmentRuleWithOperands = _chunk7YNUSMVAcjs.Ld; exports.AssessmentRuleWithoutOperands = _chunk7YNUSMVAcjs.Md; exports.AssessmentSectionInput = _chunkQEM6S2W7cjs._; exports.AssessmentSectionQuestionInput = _chunkQEM6S2W7cjs.Z; exports.AssessmentTemplateInput = _chunkQEM6S2W7cjs.aa; exports.AttestedExtraIdentifiers = _chunk7YNUSMVAcjs.of; exports.AttributeInput = _chunkQEM6S2W7cjs.k; exports.AttributePreview = _chunkQEM6S2W7cjs.l; exports.AttributeValueInput = _chunkQEM6S2W7cjs.j; exports.BLANK = _chunk7YNUSMVAcjs.cc; exports.BULK_APPLY = _chunk7YNUSMVAcjs.bc; exports.BULK_REQUEST_FILES = _chunk7YNUSMVAcjs.Ea; exports.BUSINESS_ENTITIES = _chunk7YNUSMVAcjs.qb; exports.BusinessEntityInput = _chunkQEM6S2W7cjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunk7YNUSMVAcjs.X; exports.CAN_APPLY_IN_BULK = _chunk7YNUSMVAcjs.gc; exports.CATALOGS = _chunk7YNUSMVAcjs.r; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunk7YNUSMVAcjs.ua; exports.CODE_PACKAGES = _chunk7YNUSMVAcjs.P; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunk7YNUSMVAcjs.pb; exports.CONSENT_PARTITIONS = _chunk7YNUSMVAcjs.Ta; exports.COOKIES = _chunk7YNUSMVAcjs.Ya; exports.CREATE_ACTION_ITEMS = _chunk7YNUSMVAcjs.xb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunk7YNUSMVAcjs.Ia; exports.CREATE_AGENT = _chunk7YNUSMVAcjs.Hb; exports.CREATE_AGENT_FILE = _chunk7YNUSMVAcjs.Kb; exports.CREATE_AGENT_FUNCTION = _chunk7YNUSMVAcjs.Nb; exports.CREATE_API_KEY = _chunk7YNUSMVAcjs.E; exports.CREATE_ATTRIBUTE = _chunk7YNUSMVAcjs.Pa; exports.CREATE_ATTRIBUTE_VALUES = _chunk7YNUSMVAcjs.La; exports.CREATE_BUSINESS_ENTITY = _chunk7YNUSMVAcjs.rb; exports.CREATE_CODE_PACKAGE = _chunk7YNUSMVAcjs.R; exports.CREATE_CONSENT_EXPERIENCE = _chunk7YNUSMVAcjs.nb; exports.CREATE_CONSENT_MANAGER = _chunk7YNUSMVAcjs.ab; exports.CREATE_CONSENT_PARTITION = _chunk7YNUSMVAcjs.ob; exports.CREATE_DATA_FLOWS = _chunk7YNUSMVAcjs.Ua; exports.CREATE_DATA_SILOS = _chunk7YNUSMVAcjs.m; exports.CREATE_DATA_SUBJECT = _chunk7YNUSMVAcjs.x; exports.CREATE_DATA_SUB_CATEGORY = _chunk7YNUSMVAcjs.Tb; exports.CREATE_ENRICHER = _chunk7YNUSMVAcjs.p; exports.CREATE_IDENTIFIER = _chunk7YNUSMVAcjs.u; exports.CREATE_PROCESSING_ACTIVITY = _chunk7YNUSMVAcjs.Zb; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunk7YNUSMVAcjs.Wb; exports.CREATE_PROMPT = _chunk7YNUSMVAcjs.oa; exports.CREATE_PROMPT_GROUP = _chunk7YNUSMVAcjs.sa; exports.CREATE_PROMPT_PARTIAL = _chunk7YNUSMVAcjs.qa; exports.CREATE_REPOSITORY = _chunk7YNUSMVAcjs.C; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunk7YNUSMVAcjs.O; exports.CREATE_TEAM = _chunk7YNUSMVAcjs.ya; exports.CREATE_TEMPLATE = _chunk7YNUSMVAcjs.J; exports.CREATE_VENDOR = _chunk7YNUSMVAcjs.Qb; exports.CachedFileState = _chunk7YNUSMVAcjs.hc; exports.CachedRequestState = _chunk7YNUSMVAcjs.jc; exports.CodePackageInput = _chunkQEM6S2W7cjs.D; exports.CodePackageSdk = _chunkQEM6S2W7cjs.C; exports.ColumnName = _chunk7YNUSMVAcjs.ec; exports.ConsentManageExperienceInput = _chunkQEM6S2W7cjs.K; exports.ConsentManagerInput = _chunkQEM6S2W7cjs.M; exports.ConsentManagerMetricBin = _chunk7YNUSMVAcjs.Qc; exports.ConsentManagerServiceMetadata = _chunkQEM6S2W7cjs.ka; exports.ConsentPreferenceResponse = _chunkNZDUGK2Ecjs.i; exports.ConsentPreferenceTopic = _chunkQEM6S2W7cjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkQEM6S2W7cjs.da; exports.ConsentPurpose = _chunkQEM6S2W7cjs.fa; exports.CookieCsvInput = _chunkQEM6S2W7cjs.ja; exports.CookieInput = _chunkQEM6S2W7cjs.J; exports.CronIdentifier = _chunkGIQ4W7IVcjs.a; exports.CronIdentifierPush = _chunkGIQ4W7IVcjs.c; exports.DATAPOINT_EXPORT = _chunk7YNUSMVAcjs.g; exports.DATA_FLOWS = _chunk7YNUSMVAcjs.Xa; exports.DATA_POINTS = _chunk7YNUSMVAcjs.a; exports.DATA_POINT_COUNT = _chunk7YNUSMVAcjs.b; exports.DATA_SILOS = _chunk7YNUSMVAcjs.i; exports.DATA_SILOS_ENRICHED = _chunk7YNUSMVAcjs.k; exports.DATA_SILO_EXPORT = _chunk7YNUSMVAcjs.j; exports.DATA_SUBJECTS = _chunk7YNUSMVAcjs.w; exports.DATA_SUB_CATEGORIES = _chunk7YNUSMVAcjs.Sb; exports.DEBUG = _chunkQ3L3F6ZMcjs.z; exports.DEFAULT_TRANSCEND_API = _chunkQ3L3F6ZMcjs.r; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkQ3L3F6ZMcjs.s; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunk7YNUSMVAcjs.de; exports.DELETE_API_KEY = _chunk7YNUSMVAcjs.F; exports.DELETE_ATTRIBUTE_VALUE = _chunk7YNUSMVAcjs.Na; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunk7YNUSMVAcjs.zb; exports.DEPLOY_CONSENT_MANAGER = _chunk7YNUSMVAcjs.db; exports.DETERMINE_LOGIN_METHOD = _chunk7YNUSMVAcjs.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 = _chunk7YNUSMVAcjs.H; exports.ENRICHERS = _chunk7YNUSMVAcjs.n; exports.ENTRY_COUNT = _chunk7YNUSMVAcjs.h; exports.EXPERIENCES = _chunk7YNUSMVAcjs.Sa; exports.EnrichPrivacyRequest = _chunkCIUYGNQBcjs.b; exports.EnricherInput = _chunkQEM6S2W7cjs.e; exports.FETCH_CONSENT_MANAGER = _chunk7YNUSMVAcjs._a; exports.FETCH_CONSENT_MANAGER_ID = _chunk7YNUSMVAcjs.Za; exports.FETCH_CONSENT_MANAGER_THEME = _chunk7YNUSMVAcjs.$a; exports.FETCH_PRIVACY_CENTER_ID = _chunk7YNUSMVAcjs.yb; exports.FieldInput = _chunkQEM6S2W7cjs.v; exports.GLOBAL_ACTION_ITEMS = _chunk7YNUSMVAcjs.vb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunk7YNUSMVAcjs.Ha; exports.IDENTIFIERS = _chunk7YNUSMVAcjs.s; exports.IDENTIFIER_BLOCK_LIST = _chunk7YNUSMVAcjs.dc; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunk7YNUSMVAcjs.fa; exports.INITIALIZER = _chunk7YNUSMVAcjs.o; exports.IP_ADDRESS_REGEX = _chunkNZDUGK2Ecjs.f; exports.IS_REQUIRED = _chunk7YNUSMVAcjs.fc; exports.IdentifierInput = _chunkQEM6S2W7cjs.H; exports.ImportOnetrustAssessmentsInput = _chunkQEM6S2W7cjs.ra; exports.IntlMessage = _chunk7YNUSMVAcjs.sf; exports.IntlMessageInput = _chunkQEM6S2W7cjs.P; exports.LARGE_LANGUAGE_MODELS = _chunk7YNUSMVAcjs.Fb; exports.LOGIN = _chunk7YNUSMVAcjs.Db; exports.MESSAGES = _chunk7YNUSMVAcjs._; exports.NEW_IDENTIFIER_TYPES = _chunk7YNUSMVAcjs.t; exports.NONE = _chunk7YNUSMVAcjs.ac; exports.NOTIFY_ADDITIONAL_TIME = _chunk7YNUSMVAcjs.Z; exports.ORGANIZATION = _chunk7YNUSMVAcjs.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 = _chunk7YNUSMVAcjs.T; exports.PREFERENCE_TOPICS = _chunk7YNUSMVAcjs.ha; exports.PRIVACY_CENTER = _chunk7YNUSMVAcjs.Ab; exports.PROCESSING_ACTIVITIES = _chunk7YNUSMVAcjs.Yb; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunk7YNUSMVAcjs.Vb; exports.PROMPTS = _chunk7YNUSMVAcjs.ja; exports.PROMPTS_WITH_VARIABLES = _chunk7YNUSMVAcjs.ma; exports.PROMPT_GROUPS = _chunk7YNUSMVAcjs.la; exports.PROMPT_PARTIALS = _chunk7YNUSMVAcjs.ka; exports.PROMPT_THREADS = _chunk7YNUSMVAcjs.S; exports.PURPOSES = _chunk7YNUSMVAcjs.ga; exports.ParsedAttributeInput = _chunk7YNUSMVAcjs.oc; exports.PartitionInput = _chunkQEM6S2W7cjs.L; exports.PathfinderPolicy = _chunkQEM6S2W7cjs.pa; exports.PathfinderPolicyName = _chunkQ7I37FJVcjs.e; exports.PathfinderPolicyNameC = _chunkQEM6S2W7cjs.la; exports.PathfinderPromptRunMetadata = _chunkQEM6S2W7cjs.qa; exports.PolicyInput = _chunkQEM6S2W7cjs.O; exports.PrivacyCenterInput = _chunkQEM6S2W7cjs.N; exports.PrivacyRequest = _chunk7YNUSMVAcjs.kd; exports.PrivacyRequestInput = _chunk7YNUSMVAcjs.pf; exports.PrivacyRequestResponse = _chunk7YNUSMVAcjs.yf; 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 = _chunkVV5ICWOAcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunk7YNUSMVAcjs.wa; exports.REMOVE_REQUEST_IDENTIFIERS = _chunk7YNUSMVAcjs.Aa; exports.REPORT_PROMPT_RUN = _chunk7YNUSMVAcjs.Fa; exports.REPOSITORIES = _chunk7YNUSMVAcjs.A; exports.REQUESTS = _chunk7YNUSMVAcjs.V; exports.REQUEST_DATA_SILOS = _chunk7YNUSMVAcjs.ta; exports.REQUEST_ENRICHERS = _chunk7YNUSMVAcjs.aa; exports.REQUEST_FILES = _chunk7YNUSMVAcjs.Da; exports.REQUEST_IDENTIFIERS = _chunk7YNUSMVAcjs.Ba; exports.RETRYABLE_BATCH_STATUSES = _chunkQ3L3F6ZMcjs.y; exports.RETRY_REQUEST_DATA_SILO = _chunk7YNUSMVAcjs.va; exports.RETRY_REQUEST_ENRICHER = _chunk7YNUSMVAcjs.ba; exports.RateCounter = _chunk7YNUSMVAcjs.Zf; exports.RegionInput = _chunkQEM6S2W7cjs.z; exports.RepositoryInput = _chunkQEM6S2W7cjs.E; exports.RequestFileMetadata = _chunk7YNUSMVAcjs.tf; exports.RequestFileMetadataResponse = _chunk7YNUSMVAcjs.uf; exports.RequestIdentifiersResponse = _chunk7YNUSMVAcjs.hd; exports.RequestPurposeTrigger = _chunk7YNUSMVAcjs.jd; exports.RiskAssignmentInput = _chunkQEM6S2W7cjs.W; exports.RiskLogicInput = _chunkQEM6S2W7cjs.X; exports.SCOPES_BY_TITLE = _chunkQ3L3F6ZMcjs.w; exports.SCOPE_TITLES = _chunkQ3L3F6ZMcjs.x; exports.SET_RESOURCE_ATTRIBUTES = _chunk7YNUSMVAcjs.Ra; exports.SKIP_REQUEST_ENRICHER = _chunk7YNUSMVAcjs.ca; exports.SOFTWARE_DEVELOPMENT_KITS = _chunk7YNUSMVAcjs.M; exports.SOMBRA_VERSION = _chunk7YNUSMVAcjs.$b; exports.SUB_DATA_POINTS = _chunk7YNUSMVAcjs.c; exports.SUB_DATA_POINTS_COUNT = _chunk7YNUSMVAcjs.d; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunk7YNUSMVAcjs.e; exports.SYNC_ATTRIBUTE_TYPES = _chunk7YNUSMVAcjs.Kc; exports.SoftwareDevelopmentKitInput = _chunkQEM6S2W7cjs.B; exports.StoredApiKey = _chunkQEM6S2W7cjs.ha; exports.SuccessfulRequest = _chunk7YNUSMVAcjs.ic; exports.TEAMS = _chunk7YNUSMVAcjs.xa; exports.TEMPLATES = _chunk7YNUSMVAcjs.I; exports.TOGGLE_CONSENT_PRECEDENCE = _chunk7YNUSMVAcjs.kb; exports.TOGGLE_DATA_SUBJECT = _chunk7YNUSMVAcjs.z; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunk7YNUSMVAcjs.jb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunk7YNUSMVAcjs.ib; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunk7YNUSMVAcjs.hb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkQ3L3F6ZMcjs.u; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkQ3L3F6ZMcjs.t; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkQ3L3F6ZMcjs.v; exports.TeamInput = _chunkQEM6S2W7cjs.d; exports.TemplateInput = _chunkQEM6S2W7cjs.a; exports.TranscendInput = _chunkQEM6S2W7cjs.ga; exports.TranscendPromptManager = B; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunk7YNUSMVAcjs.ub; exports.UPDATE_ACTION_ITEMS = _chunk7YNUSMVAcjs.wb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunk7YNUSMVAcjs.Ja; exports.UPDATE_AGENTS = _chunk7YNUSMVAcjs.Ib; exports.UPDATE_AGENT_FILES = _chunk7YNUSMVAcjs.Lb; exports.UPDATE_AGENT_FUNCTIONS = _chunk7YNUSMVAcjs.Ob; exports.UPDATE_ATTRIBUTE = _chunk7YNUSMVAcjs.Qa; exports.UPDATE_ATTRIBUTE_VALUES = _chunk7YNUSMVAcjs.Ma; exports.UPDATE_BUSINESS_ENTITIES = _chunk7YNUSMVAcjs.sb; exports.UPDATE_CODE_PACKAGES = _chunk7YNUSMVAcjs.Q; exports.UPDATE_CONSENT_EXPERIENCE = _chunk7YNUSMVAcjs.mb; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunk7YNUSMVAcjs.eb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunk7YNUSMVAcjs.fb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunk7YNUSMVAcjs.lb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunk7YNUSMVAcjs.cb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunk7YNUSMVAcjs.bb; exports.UPDATE_DATA_FLOWS = _chunk7YNUSMVAcjs.Va; exports.UPDATE_DATA_SILOS = _chunk7YNUSMVAcjs.l; exports.UPDATE_DATA_SUBJECT = _chunk7YNUSMVAcjs.y; exports.UPDATE_DATA_SUB_CATEGORIES = _chunk7YNUSMVAcjs.Ub; exports.UPDATE_ENRICHER = _chunk7YNUSMVAcjs.q; exports.UPDATE_IDENTIFIER = _chunk7YNUSMVAcjs.v; exports.UPDATE_INTL_MESSAGES = _chunk7YNUSMVAcjs.$; exports.UPDATE_LOAD_OPTIONS = _chunk7YNUSMVAcjs.gb; exports.UPDATE_OR_CREATE_COOKIES = _chunk7YNUSMVAcjs.Wa; exports.UPDATE_OR_CREATE_DATA_POINT = _chunk7YNUSMVAcjs.f; exports.UPDATE_POLICIES = _chunk7YNUSMVAcjs.U; exports.UPDATE_PRIVACY_CENTER = _chunk7YNUSMVAcjs.Bb; exports.UPDATE_PRIVACY_REQUEST = _chunk7YNUSMVAcjs.Y; exports.UPDATE_PROCESSING_ACTIVITIES = _chunk7YNUSMVAcjs._b; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunk7YNUSMVAcjs.Xb; exports.UPDATE_PROMPTS = _chunk7YNUSMVAcjs.na; exports.UPDATE_PROMPT_GROUPS = _chunk7YNUSMVAcjs.ra; exports.UPDATE_PROMPT_PARTIALS = _chunk7YNUSMVAcjs.pa; exports.UPDATE_REPOSITORIES = _chunk7YNUSMVAcjs.B; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunk7YNUSMVAcjs.N; exports.UPDATE_TEAM = _chunk7YNUSMVAcjs.za; exports.UPDATE_VENDORS = _chunk7YNUSMVAcjs.Rb; exports.USERS = _chunk7YNUSMVAcjs.Ca; exports.USP_STRING_REGEX = _chunkVV5ICWOAcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkSW5CIF5Dcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkSW5CIF5Dcjs.a; exports.VENDORS = _chunk7YNUSMVAcjs.Pb; exports.VendorInput = _chunkQEM6S2W7cjs.p; exports.WebhookHeader = _chunkQEM6S2W7cjs.b; exports.addMessagesToPromptRun = _chunk7YNUSMVAcjs.tc; exports.appendCsvSync = _chunkLR3CPNDMcjs.b; exports.approvePrivacyRequests = _chunk7YNUSMVAcjs.Af; exports.assumeRole = _chunk7YNUSMVAcjs.Id; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunk7YNUSMVAcjs.vc; exports.buildTranscendGraphQLClientGeneric = _chunk7YNUSMVAcjs.uc; exports.buildXdiSyncEndpoint = _chunkNZDUGK2Ecjs.g; exports.bulkRestartRequests = _chunk7YNUSMVAcjs.If; exports.bulkRetryEnrichers = _chunk7YNUSMVAcjs.Kf; exports.cancelPrivacyRequests = _chunk7YNUSMVAcjs.Df; exports.consentManagersToBusinessEntities = _chunkNZDUGK2Ecjs.h; exports.convertToDataSubjectAllowlist = _chunk7YNUSMVAcjs.wd; exports.convertToDataSubjectBlockList = _chunk7YNUSMVAcjs.vd; exports.createActionItemCollection = _chunk7YNUSMVAcjs.je; exports.createActionItems = _chunk7YNUSMVAcjs.me; exports.createAgent = _chunk7YNUSMVAcjs.ve; exports.createAgentFile = _chunk7YNUSMVAcjs.pe; exports.createAgentFunction = _chunk7YNUSMVAcjs.se; exports.createApiKey = _chunk7YNUSMVAcjs.Jd; exports.createBusinessEntity = _chunk7YNUSMVAcjs.ze; exports.createCodePackage = _chunk7YNUSMVAcjs.Ie; exports.createConsentToken = _chunkVV5ICWOAcjs.a; exports.createDataCategory = _chunk7YNUSMVAcjs.Pe; exports.createDataFlows = _chunk7YNUSMVAcjs.Te; exports.createProcessingPurpose = _chunk7YNUSMVAcjs.bf; exports.createPrompt = _chunk7YNUSMVAcjs.ef; exports.createRegexForTag = j; exports.createRepository = _chunk7YNUSMVAcjs.Fe; exports.createSoftwareDevelopmentKit = _chunk7YNUSMVAcjs.Ce; exports.createSombraGotInstance = _chunk7YNUSMVAcjs.wc; exports.createTranscendConsentGotInstance = _chunk7YNUSMVAcjs.xc; exports.createVendor = _chunk7YNUSMVAcjs.hf; exports.defineTranscendPrompts = Um; exports.deleteApiKey = _chunk7YNUSMVAcjs.Kd; exports.deployConsentManager = _chunk7YNUSMVAcjs.yc; exports.description = _chunkQ3L3F6ZMcjs.l; exports.domainToHost = _chunkNZDUGK2Ecjs.e; exports.downloadPrivacyRequestFiles = _chunk7YNUSMVAcjs.xf; exports.enrichPrivacyRequest = _chunkCIUYGNQBcjs.c; exports.ensureAllDataSubjectsExist = _chunk7YNUSMVAcjs.ud; exports.extractClientError = _chunk7YNUSMVAcjs.Ff; exports.extractErrorMessage = _chunk7YNUSMVAcjs.Uf; exports.fetchActiveSiloDiscoPlugin = _chunk7YNUSMVAcjs.Ac; exports.fetchAllActionItems = _chunk7YNUSMVAcjs.Bc; exports.fetchAllActions = _chunk7YNUSMVAcjs.Cc; exports.fetchAllAgentFiles = _chunk7YNUSMVAcjs.Dc; exports.fetchAllAgentFunctions = _chunk7YNUSMVAcjs.Ec; exports.fetchAllAgents = _chunk7YNUSMVAcjs.Fc; exports.fetchAllApiKeys = _chunk7YNUSMVAcjs.pd; exports.fetchAllAssessmentTemplates = _chunk7YNUSMVAcjs.Hc; exports.fetchAllAssessments = _chunk7YNUSMVAcjs.Gc; exports.fetchAllAttributeValues = _chunk7YNUSMVAcjs.Jc; exports.fetchAllAttributes = _chunk7YNUSMVAcjs.Lc; exports.fetchAllBusinessEntities = _chunk7YNUSMVAcjs.Mc; exports.fetchAllCatalogs = _chunk7YNUSMVAcjs.rd; exports.fetchAllCookies = _chunk7YNUSMVAcjs.Tc; exports.fetchAllDataCategories = _chunk7YNUSMVAcjs.Uc; exports.fetchAllDataFlows = _chunk7YNUSMVAcjs.Vc; exports.fetchAllDataPoints = _chunk7YNUSMVAcjs.Vd; exports.fetchAllDataSilos = _chunk7YNUSMVAcjs.Td; exports.fetchAllDataSubjects = _chunk7YNUSMVAcjs.td; exports.fetchAllEnrichers = _chunk7YNUSMVAcjs.Zd; exports.fetchAllIdentifiers = _chunk7YNUSMVAcjs.ag; exports.fetchAllMessages = _chunk7YNUSMVAcjs.Wc; exports.fetchAllPolicies = _chunk7YNUSMVAcjs.Zc; exports.fetchAllPreferenceTopics = _chunk7YNUSMVAcjs.$c; exports.fetchAllPrivacyCenters = _chunk7YNUSMVAcjs.ad; exports.fetchAllProcessingActivities = _chunk7YNUSMVAcjs.bd; exports.fetchAllProcessingPurposes = _chunk7YNUSMVAcjs.cd; exports.fetchAllPromptGroups = _chunk7YNUSMVAcjs.xd; exports.fetchAllPromptPartials = _chunk7YNUSMVAcjs.yd; exports.fetchAllPromptThreads = _chunk7YNUSMVAcjs.Bd; exports.fetchAllPrompts = _chunk7YNUSMVAcjs.zd; exports.fetchAllPurposes = _chunk7YNUSMVAcjs.dd; exports.fetchAllPurposesAndPreferences = _chunk7YNUSMVAcjs.ed; exports.fetchAllRequestAttributeKeys = _chunk7YNUSMVAcjs.Ic; exports.fetchAllRequestEnrichers = _chunk7YNUSMVAcjs.fd; exports.fetchAllRequestIdentifierMetadata = _chunk7YNUSMVAcjs.gd; exports.fetchAllRequestIdentifiers = _chunk7YNUSMVAcjs.id; exports.fetchAllRequests = _chunk7YNUSMVAcjs.ld; exports.fetchAllSubDataPoints = _chunk7YNUSMVAcjs.Ud; exports.fetchAllTeams = _chunk7YNUSMVAcjs.md; exports.fetchAllTemplates = _chunk7YNUSMVAcjs.$d; exports.fetchAllUsers = _chunk7YNUSMVAcjs.nd; exports.fetchAllVendors = _chunk7YNUSMVAcjs.od; exports.fetchAndIndexCatalogs = _chunk7YNUSMVAcjs.sd; exports.fetchApiKeys = _chunk7YNUSMVAcjs.qd; exports.fetchConsentManager = _chunk7YNUSMVAcjs.Nc; exports.fetchConsentManagerAnalyticsData = _chunk7YNUSMVAcjs.Rc; exports.fetchConsentManagerExperiences = _chunk7YNUSMVAcjs.Pc; exports.fetchConsentManagerId = _chunk7YNUSMVAcjs.Oc; exports.fetchConsentManagerTheme = _chunk7YNUSMVAcjs.Sc; exports.fetchConsentPreferences = _chunkNZDUGK2Ecjs.j; exports.fetchEnrichedDataSilos = _chunk7YNUSMVAcjs.Wd; exports.fetchIdentifiersAndCreateMissing = _chunk7YNUSMVAcjs.bg; exports.fetchPartitions = _chunk7YNUSMVAcjs.be; exports.fetchPrivacyCenterId = _chunk7YNUSMVAcjs.Yc; exports.fetchPrivacyCenterUrl = _chunk7YNUSMVAcjs.Xc; exports.fetchPromptsWithVariables = _chunk7YNUSMVAcjs.Ad; exports.fetchRequestDataSilo = _chunk7YNUSMVAcjs.Ed; exports.fetchRequestDataSiloActiveCount = _chunk7YNUSMVAcjs.Fd; exports.fetchRequestDataSilos = _chunk7YNUSMVAcjs.Dd; exports.fetchRequestDataSilosCount = _chunk7YNUSMVAcjs.Cd; exports.fetchRequestFilesForRequest = _chunk7YNUSMVAcjs.Gd; exports.filterNullishValuesFromObject = qm; exports.filterRows = _chunk7YNUSMVAcjs.sc; exports.formatAttributeValues = _chunk7YNUSMVAcjs._c; exports.fuzzyMatchColumns = _chunk7YNUSMVAcjs.lc; exports.fuzzySearch = _chunk7YNUSMVAcjs.kc; exports.generateCrossAccountApiKeys = _chunkSHUWLLFXcjs.a; exports.getErrorStatus = _chunk7YNUSMVAcjs.Tf; exports.getFileMetadataForPrivacyRequests = _chunk7YNUSMVAcjs.vf; exports.getGitFilesThatChanged = Wm; exports.getUniqueValuesForColumn = _chunk7YNUSMVAcjs.rc; exports.inquirerAutoComplete = _chunk7YNUSMVAcjs.Rf; exports.inquirerConfirmBoolean = _chunk7YNUSMVAcjs.Pf; exports.inquirerConfirmText = _chunk7YNUSMVAcjs.Qf; exports.limitRecords = _chunk7YNUSMVAcjs.Yf; exports.listDirectories = _chunkSHUWLLFXcjs.d; exports.listFiles = _chunkSHUWLLFXcjs.c; exports.loginUser = _chunk7YNUSMVAcjs.Hd; exports.makeGraphQLRequest = _chunk7YNUSMVAcjs.$f; exports.mapColumnsToAttributes = _chunk7YNUSMVAcjs.Ef; exports.mapColumnsToIdentifiers = _chunk7YNUSMVAcjs.Cf; exports.mapCsvColumnsToApi = _chunk7YNUSMVAcjs.mf; exports.mapCsvRowsToRequestInputs = _chunk7YNUSMVAcjs.rf; exports.mapEnumValues = _chunk7YNUSMVAcjs.mc; exports.mapRequestEnumValues = _chunk7YNUSMVAcjs.nf; exports.markCronIdentifierCompleted = _chunkGIQ4W7IVcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkGIQ4W7IVcjs.f; exports.markSilentPrivacyRequests = _chunk7YNUSMVAcjs.lf; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkQ3L3F6ZMcjs.n; exports.normalizeIdentifierValue = _chunk7YNUSMVAcjs.qf; exports.notifyPrivacyRequestsAdditionalTime = _chunk7YNUSMVAcjs.Bf; exports.parseAssessmentDisplayLogic = _chunk7YNUSMVAcjs.Qd; exports.parseAssessmentRiskLogic = _chunk7YNUSMVAcjs.Sd; exports.parseAttributesFromString = _chunk7YNUSMVAcjs.pc; exports.parseFilePath = _chunkLR3CPNDMcjs.d; exports.parseVariablesFromString = _chunk7YNUSMVAcjs.Sf; exports.pullAllDatapoints = _chunkFEYTT6HRcjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkGIQ4W7IVcjs.g; exports.pullConsentManagerMetrics = _chunkNZDUGK2Ecjs.d; exports.pullCronPageOfIdentifiers = _chunkGIQ4W7IVcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkCIUYGNQBcjs.a; exports.pullPrivacyRequests = _chunk7YNUSMVAcjs.Mf; exports.pullTranscendConfiguration = _chunk7YNUSMVAcjs.ee; exports.pullUnstructuredSubDataPointRecommendations = _chunkFEYTT6HRcjs.b; exports.pushCronIdentifiersFromCsv = _chunkGIQ4W7IVcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkCIUYGNQBcjs.d; exports.readCsv = _chunk7YNUSMVAcjs.qc; exports.readSafe = _chunk7YNUSMVAcjs._f; exports.readTranscendYaml = _chunkSW5CIF5Dcjs.d; exports.removeLinks = Hm; exports.removeUnverifiedRequestIdentifiers = _chunk7YNUSMVAcjs.Of; exports.replaceVariablesInYaml = _chunkSW5CIF5Dcjs.c; exports.reportPromptRun = _chunk7YNUSMVAcjs.fe; exports.restartPrivacyRequest = _chunk7YNUSMVAcjs.Hf; exports.retryRequestDataSilos = _chunk7YNUSMVAcjs.Lf; exports.retryRequestEnricher = _chunk7YNUSMVAcjs.ge; exports.retrySamePromise = _chunk7YNUSMVAcjs.Xf; exports.setResourceAttributes = _chunk7YNUSMVAcjs.he; exports.skipPreflightJobs = _chunk7YNUSMVAcjs.Jf; exports.skipRequestDataSilos = _chunk7YNUSMVAcjs.Nf; exports.sleepPromise = _chunk7YNUSMVAcjs.Vf; exports.splitCsvToList = _chunk7YNUSMVAcjs.nc; exports.splitInHalf = _chunk7YNUSMVAcjs.Wf; exports.streamPrivacyRequestFiles = _chunk7YNUSMVAcjs.wf; exports.submitPrivacyRequest = _chunk7YNUSMVAcjs.zf; exports.syncAction = _chunk7YNUSMVAcjs.ie; exports.syncActionItemCollections = _chunk7YNUSMVAcjs.le; exports.syncActionItems = _chunk7YNUSMVAcjs.oe; exports.syncAgentFiles = _chunk7YNUSMVAcjs.re; exports.syncAgentFunctions = _chunk7YNUSMVAcjs.ue; exports.syncAgents = _chunk7YNUSMVAcjs.xe; exports.syncAttribute = _chunk7YNUSMVAcjs.ye; exports.syncBusinessEntities = _chunk7YNUSMVAcjs.Be; exports.syncCodePackages = _chunk7YNUSMVAcjs.Ke; exports.syncConfigurationToTranscend = _chunk7YNUSMVAcjs.cg; exports.syncConsentManager = _chunk7YNUSMVAcjs.Me; exports.syncConsentManagerExperiences = _chunk7YNUSMVAcjs.Le; exports.syncCookies = _chunk7YNUSMVAcjs.Oe; exports.syncDataCategories = _chunk7YNUSMVAcjs.Re; exports.syncDataFlows = _chunk7YNUSMVAcjs.Ue; exports.syncDataSiloDependencies = _chunk7YNUSMVAcjs.Yd; exports.syncDataSilos = _chunk7YNUSMVAcjs.Xd; exports.syncDataSubject = _chunk7YNUSMVAcjs.Ve; exports.syncEnricher = _chunk7YNUSMVAcjs._d; exports.syncIdentifier = _chunk7YNUSMVAcjs.We; exports.syncIntlMessages = _chunk7YNUSMVAcjs.Ye; exports.syncPartitions = _chunk7YNUSMVAcjs.ce; exports.syncPolicies = _chunk7YNUSMVAcjs._e; exports.syncPrivacyCenter = _chunk7YNUSMVAcjs.$e; exports.syncProcessingActivities = _chunk7YNUSMVAcjs.af; exports.syncProcessingPurposes = _chunk7YNUSMVAcjs.df; exports.syncPrompts = _chunk7YNUSMVAcjs.gf; exports.syncRepositories = _chunk7YNUSMVAcjs.He; exports.syncSoftwareDevelopmentKits = _chunk7YNUSMVAcjs.Ee; exports.syncTemplate = _chunk7YNUSMVAcjs.ae; exports.syncVendors = _chunk7YNUSMVAcjs.jf; exports.updateActionItem = _chunk7YNUSMVAcjs.ne; exports.updateActionItemCollection = _chunk7YNUSMVAcjs.ke; exports.updateAgentFiles = _chunk7YNUSMVAcjs.qe; exports.updateAgentFunctions = _chunk7YNUSMVAcjs.te; exports.updateAgents = _chunk7YNUSMVAcjs.we; exports.updateBusinessEntities = _chunk7YNUSMVAcjs.Ae; exports.updateCodePackages = _chunk7YNUSMVAcjs.Je; exports.updateConsentManagerToLatest = _chunk7YNUSMVAcjs.zc; exports.updateConsentManagerVersionToLatest = _chunkNZDUGK2Ecjs.a; exports.updateDataCategories = _chunk7YNUSMVAcjs.Qe; exports.updateDataFlows = _chunk7YNUSMVAcjs.Se; exports.updateIntlMessages = _chunk7YNUSMVAcjs.Xe; exports.updateOrCreateCookies = _chunk7YNUSMVAcjs.Ne; exports.updatePolicies = _chunk7YNUSMVAcjs.Ze; exports.updateProcessingPurposes = _chunk7YNUSMVAcjs.cf; exports.updatePrompts = _chunk7YNUSMVAcjs.ff; exports.updateRepositories = _chunk7YNUSMVAcjs.Ge; exports.updateSoftwareDevelopmentKits = _chunk7YNUSMVAcjs.De; exports.updateVendors = _chunk7YNUSMVAcjs.if; exports.uploadConsents = _chunkVV5ICWOAcjs.f; exports.uploadCookiesFromCsv = _chunkNZDUGK2Ecjs.c; exports.uploadDataFlowsFromCsv = _chunkNZDUGK2Ecjs.b; exports.uploadPrivacyRequestsFromCsv = _chunk7YNUSMVAcjs.Gf; exports.uploadSiloDiscoveryResults = _chunk7YNUSMVAcjs.kf; exports.validateTranscendAuth = _chunkSHUWLLFXcjs.b; exports.version = _chunkQ3L3F6ZMcjs.m; exports.writeCsv = _chunkLR3CPNDMcjs.c; exports.writeCsvSync = _chunkLR3CPNDMcjs.a; exports.writeLargeCsv = _chunkLR3CPNDMcjs.e; exports.writeTranscendYaml = _chunkSW5CIF5Dcjs.e;
5
5
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/index.cjs","../src/lib/ai/TranscendPromptManager.ts","../src/lib/graphql/fetchLargeLanguageModels.ts","../src/lib/ai/getGitFilesThatChanged.ts"],"names":["PAGE_SIZE","fetchAllLargeLanguageModels","client","largeLanguageModels","offset","shouldContinue","nodes","makeGraphQLRequest","LARGE_LANGUAGE_MODELS","a","b","createRegexForTag","tagName","defineTranscendPrompts","prompts","jsonParseSafe","obj","TranscendPromptManager","handlebarsOptions","transcendUrl","DEFAULT_TRANSCEND_API","transcendApiKey","requireApproval","cacheDuration","defaultVariables","buildTranscendGraphQLClient","createHandlebarsWithHelpers","promptDefinitions","getValues","promptIds","id","x","promptTitles","title","agentNames","uniq_default","response","agents","fetchPromptsWithVariables","fetchAllAgents","keyBy_default","model","promptByTitle","promptById","acc","v","partial","apply","result","name","agent","remoteAgent","ts","thread","fetchAllPromptThreads","names","hasCache","missingCache","groupBy_default","cachedAgents","chunkedNames","chunk_default","remoteAgents","mapSeries","chunkedName","pageOfAgents","filterBy","fetchAllAgentFiles","largeLanguageModel","matching"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/index.cjs","sourcesContent":[null,"/* eslint-disable max-lines */\nimport {\n Optionalize,\n Requirize,\n apply,\n decodeCodec,\n getValues,\n} from '@transcend-io/type-utils';\nimport type { Handlebars } from '@transcend-io/handlebars-utils';\nimport { Secret } from '@transcend-io/secret-value';\nimport * as t from 'io-ts';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport {\n Agent,\n AgentFile,\n AgentFileFilterBy,\n ReportPromptRunInput,\n buildTranscendGraphQLClient,\n fetchAllAgentFiles,\n fetchAllAgents,\n reportPromptRun,\n} from '../graphql';\nimport {\n HandlebarsInput,\n createHandlebarsWithHelpers,\n} from '@transcend-io/handlebars-utils';\nimport {\n TranscendPromptTemplated,\n TranscendPromptsAndVariables,\n fetchPromptsWithVariables,\n} from '../graphql/fetchPrompts';\nimport { GraphQLClient } from 'graphql-request';\nimport {\n PromptStatus,\n ChatCompletionRole,\n PromptRunProductArea,\n QueueStatus,\n LargeLanguageModelClient,\n} from '@transcend-io/privacy-types';\nimport {\n LargeLanguageModel,\n fetchAllLargeLanguageModels,\n} from '../graphql/fetchLargeLanguageModels';\nimport { groupBy, keyBy, uniq, chunk } from 'lodash-es';\nimport { mapSeries } from 'bluebird';\nimport {\n PromptThread,\n fetchAllPromptThreads,\n} from '../graphql/fetchPromptThreads';\n\n/**\n * An LLM Prompt definition\n */\nexport type TranscendPrompt<\n TInputParams extends t.Any,\n TOutputCodec extends t.Any,\n> = (\n | {\n /** ID of the prompt */\n id: string;\n /** Title of the prompt */\n title?: string;\n }\n | {\n /** ID of the prompt */\n id?: string;\n /** Title of the prompt */\n title: string;\n }\n) & {\n /** The names of the agents that should be loaded along with the prompt */\n agentNames?: string[];\n /** Codec to validate runtime input shape */\n paramCodec: TInputParams;\n /** Codec to validate output response */\n outputCodec: TOutputCodec;\n /**\n * If the output that needs to be parsed is returned within a tag\n * e.g. <tag> or <json> - this is the name of the tag\n */\n extractFromTag?: string;\n};\n\nexport interface PromptRunResult {\n /** The ID of the prompt run created on Transcend */\n promptRunId: string;\n /** The URL of the prompt run on Transcend */\n promptRunUrl: string;\n}\n\n/**\n * Create a regex to extract data from a tag\n *\n * Input:\n * \"here is some data <tag>Data</tag>...\"\n *\n * @param tagName - Name of tag\n * @returns Data within the tag\n */\nexport function createRegexForTag(tagName: string): RegExp {\n return new RegExp(`<${tagName}>([\\\\s\\\\S]+?)<\\\\/${tagName}>`);\n}\n\n/**\n * Helper function to declare prompts\n *\n * @param prompts - Prompt config\n * @returns Prompts as identity function - but type enforced\n */\nexport function defineTranscendPrompts<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n>(prompts: TPrompts): TPrompts {\n return prompts;\n}\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptParamType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['paramCodec']>;\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptResponseType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n\n/**\n * Input for reporting a prompt run\n */\nexport interface ReportPromptRunOptions\n extends Optionalize<\n Omit<ReportPromptRunInput, 'status' | 'promptId' | 'largeLanguageModelId'>,\n 'name' | 'productArea'\n > {\n /** The large language model being run. Either the ID of the LLM or the client/name pairing */\n largeLanguageModel:\n | string\n | {\n /** Name of client */\n client: LargeLanguageModelClient;\n /** Name of the model */\n name: string;\n };\n}\n\nconst jsonParseSafe = (obj: string): unknown => {\n try {\n return JSON.parse(obj);\n } catch (e) {\n return obj;\n }\n};\n\n/**\n * A class that is capable of loading and insert variables into prompts from\n * Transcend's Prompt Manager\n */\nexport class TranscendPromptManager<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n> {\n /** Prompt definitions */\n public prompts: TPrompts;\n\n /** Options for configuring handlebars */\n public handlebarsOptions!: HandlebarsInput;\n\n /** Prompt name -> content map, populated by call to Transcend API */\n public promptContentMap?: { [k in TPromptNames]: TranscendPromptTemplated };\n\n /** The large language models that are registered to this organization for reporting */\n public largeLanguageModels: LargeLanguageModel[] = [];\n\n /** The agent definitions registered to this organization */\n private agentsByName: { [name in string]: Agent } = {};\n\n /** The agent definitions registered to this organization */\n private agentsByAgentId: { [id in string]: Agent } = {};\n\n /** The GraphQL client that can be used to call Transcend */\n public graphQLClient: GraphQLClient;\n\n /** The set of variables to expose in handlebars context specified at class initiation */\n public defaultVariables: { [k in string]: unknown };\n\n /**\n * The set of variables to expose in handlebars context,\n * merges defaults with calculated variables from the inventory\n */\n public variables: { [k in string]: unknown };\n\n /** Handlebars compiler */\n public handlebars: typeof Handlebars;\n\n /** The Transcend API key */\n public transcendApiKey: string | Secret<string>;\n\n /** API of Transcend to call */\n public transcendUrl: string;\n\n /** When true, throw an error if the prompt is not approved */\n public requireApproval: boolean;\n\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n public cacheDuration?: number;\n\n /**\n * The last time the metadata was fetched\n */\n public lastUpdatedAt?: Date;\n\n /**\n * Constructor\n *\n * @param options - Options\n */\n constructor({\n prompts,\n handlebarsOptions = {},\n transcendUrl = DEFAULT_TRANSCEND_API,\n transcendApiKey,\n requireApproval = true,\n cacheDuration,\n defaultVariables = {},\n }: {\n /** Prompt definitions to load */\n prompts: TPrompts;\n /** Options for configuring handlebars */\n handlebarsOptions?: HandlebarsInput;\n /** The Transcend API key */\n transcendApiKey: string | Secret<string>;\n /** API of Transcend to call */\n transcendUrl?: string;\n /** When true, throw an error if the prompt is not approved */\n requireApproval?: boolean;\n /** The set of variables to expose in handlebars context specified at class initiation */\n defaultVariables?: { [k in string]: unknown };\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n cacheDuration?: number;\n }) {\n this.prompts = prompts;\n this.transcendUrl = transcendUrl;\n this.transcendApiKey = transcendApiKey;\n this.variables = defaultVariables;\n this.defaultVariables = defaultVariables;\n this.graphQLClient = buildTranscendGraphQLClient(\n transcendUrl,\n typeof transcendApiKey === 'object'\n ? transcendApiKey.release()\n : transcendApiKey,\n );\n this.requireApproval = requireApproval;\n this.cacheDuration = cacheDuration;\n this.handlebarsOptions = handlebarsOptions;\n this.handlebars = createHandlebarsWithHelpers(handlebarsOptions);\n }\n\n /**\n * Fetch prompt metadata from Transcend and cache to the class definition\n *\n * @returns A function that can be used to call the prompt\n */\n async fetchPromptsAndMetadata(): Promise<TranscendPromptsAndVariables> {\n // Determine what to fetch\n const promptDefinitions = getValues(this.prompts) as TranscendPrompt<\n t.Any,\n t.Any\n >[];\n const promptIds = promptDefinitions\n .map(({ id }) => id)\n .filter((x): x is string => !!x);\n const promptTitles = promptDefinitions\n .map(({ title }) => title)\n .filter((x): x is string => !!x);\n const agentNames = uniq(\n promptDefinitions.map(({ agentNames }) => agentNames || []).flat(),\n );\n\n // Fetch prompts and data\n const [response, largeLanguageModels, agents] = await Promise.all([\n fetchPromptsWithVariables(this.graphQLClient, {\n promptIds,\n promptTitles,\n }),\n fetchAllLargeLanguageModels(this.graphQLClient),\n fetchAllAgents(this.graphQLClient, { names: agentNames }),\n ]);\n this.agentsByName = keyBy(agents, 'name');\n this.agentsByAgentId = keyBy(agents, 'agentId');\n this.largeLanguageModels = largeLanguageModels.filter(\n (model) => model.isTranscendHosted === false,\n );\n\n // Lookup prompts by id/title\n const promptByTitle = keyBy(response.prompts, 'title');\n const promptById = keyBy(response.prompts, 'id');\n\n // Update variables\n this.variables = {\n ...response.calculatedVariables.reduce(\n (acc, v) =>\n Object.assign(acc, {\n [v.name]: v.data ? JSON.parse(v.data) : v.data,\n }),\n {},\n ),\n ...this.defaultVariables,\n };\n\n // Update partials\n this.handlebars = createHandlebarsWithHelpers({\n ...this.handlebarsOptions,\n templates: [\n ...(this.handlebarsOptions.templates || []),\n ...response.promptPartials.map((partial) => ({\n name: partial.slug,\n content: partial.content,\n })),\n ],\n });\n\n // Create mapping from prompt to content\n this.promptContentMap = apply(this.prompts, ({ id, title }) => {\n const result = id\n ? promptById[id]\n : title\n ? promptByTitle[title]\n : undefined;\n if (!result) {\n throw new Error(\n `Failed to find prompt with title: \"${title}\" and id: \"${id}\"`,\n );\n }\n return result;\n });\n\n // For cache\n this.lastUpdatedAt = new Date();\n\n return response;\n }\n\n /**\n * Get an agent definition by name\n *\n * @param name - Name of the agent to grab\n * @returns Large language model configuration\n */\n async getAgentByName(name: string): Promise<Agent | undefined> {\n const agent = this.agentsByName[name];\n if (agent) {\n return agent;\n }\n const [remoteAgent] = await fetchAllAgents(this.graphQLClient, {\n names: [name],\n });\n if (!remoteAgent) {\n return undefined;\n }\n this.agentsByName[remoteAgent.name] = remoteAgent;\n this.agentsByAgentId[remoteAgent.agentId] = remoteAgent;\n return remoteAgent;\n }\n\n /**\n * Get a prompt thread by ts\n *\n * @param ts - the slack message timestamp to look up thread for\n * @returns Large language model configuration\n */\n async getPromptThreadBySlackTs(\n ts: string,\n ): Promise<PromptThread | undefined> {\n const [thread] = await fetchAllPromptThreads(this.graphQLClient, {\n slackMessageTs: [ts],\n });\n return thread;\n }\n\n /**\n * Get a list of agent definitions by name.\n * Pulls from cache and may return less agents\n * than requested if some are not found\n *\n * @param names - Names of agents to fetch\n * @returns The agents that were found matching the names\n */\n async getAgentsByName(names: string[]): Promise<Agent[]> {\n if (names.length < 1) {\n throw new Error('Expected at least one name to be provided');\n }\n const { hasCache = [], missingCache = [] } = groupBy(names, (name) =>\n this.agentsByName[name] ? 'hasCache' : 'missingCache',\n );\n const cachedAgents = hasCache.map((name) => this.agentsByName[name]);\n if (missingCache.length === 0) {\n return cachedAgents;\n }\n const chunkedNames = chunk(missingCache, 50);\n const remoteAgents: Agent[] = [];\n await mapSeries(chunkedNames, async (chunkedName) => {\n const pageOfAgents = await fetchAllAgents(this.graphQLClient, {\n names: chunkedName,\n });\n pageOfAgents.forEach((agent) => {\n this.agentsByName[agent.name] = agent;\n this.agentsByAgentId[agent.agentId] = agent;\n });\n remoteAgents.push(...pageOfAgents);\n });\n return [...cachedAgents, ...remoteAgents];\n }\n\n /**\n * Fetch metadata on agent files\n *\n * @param filterBy - Filter by parameters\n * @returns The files found matching the filter\n */\n getAgentFiles(filterBy: AgentFileFilterBy): Promise<AgentFile[]> {\n return fetchAllAgentFiles(this.graphQLClient, filterBy);\n }\n\n /**\n * Look up the large language model to report on\n *\n * @param largeLanguageModel - Input\n * @returns Large language model configuration\n */\n getLargeLanguageModel(\n largeLanguageModel: ReportPromptRunOptions['largeLanguageModel'],\n ): LargeLanguageModel {\n const matching = this.largeLanguageModels.find((model) =>\n typeof largeLanguageModel === 'string'\n ? model.id === largeLanguageModel\n : model.name === largeLanguageModel.name &&\n model.client === largeLanguageModel.client,\n );\n if (!matching) {\n throw new Error(\n `Failed to find model matching: ${\n typeof largeLanguageModel === 'string'\n ? largeLanguageModel\n : JSON.stringify(largeLanguageModel)\n }`,\n );\n }\n return matching;\n }\n\n /**\n * Get a prompt definition by name\n *\n * @param promptName - Prompt to compile\n * @returns Parsed content\n */\n async getPromptDefinition<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n ): Promise<TranscendPromptTemplated> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n // Lookup prompt\n const { promptContentMap } = this;\n if (!promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n const promptTemplate = promptContentMap[promptName];\n if (!promptTemplate) {\n throw new Error(\n `Expected this.promptContentMap[${promptName}] to be defined`,\n );\n }\n return promptTemplate;\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to compile\n * @param params - Runtime parameters\n * @returns Parsed content\n */\n async compilePrompt<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n params: t.TypeOf<TPrompts[TPromptName]['paramCodec']>,\n ): Promise<string> {\n // Grab the prompt\n const promptTemplate = await this.getPromptDefinition(promptName);\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure prompt is approved\n if (\n this.requireApproval &&\n promptTemplate.status !== PromptStatus.Approved\n ) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because its in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // If prompt is rejected, throw error\n if (promptTemplate.status === PromptStatus.Rejected) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because it's in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // Validate params\n decodeCodec(promptInput.paramCodec, params);\n\n // Compile prompt and template\n return this.handlebars.compile(promptTemplate.content)({\n // template in currentDate by default\n currentDate: new Date().toISOString(),\n ...this.variables,\n ...params,\n });\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to parse\n * @param response - AI response as string\n * @returns Parsed content\n */\n parseAiResponse<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n response: string,\n ): t.TypeOf<TPrompts[TPromptName]['outputCodec']> {\n // Look up prompt info\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Extract from tag if needed\n const extracted = promptInput.extractFromTag\n ? (createRegexForTag(promptInput.extractFromTag).exec(response) ||\n [])[1] || response\n : response;\n\n // Parse via codec\n return decodeCodec(\n promptInput.outputCodec,\n jsonParseSafe(extracted),\n false,\n );\n }\n\n /**\n * Parse the AI response and report back to Transcend\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportAndParsePromptRun<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n { largeLanguageModel, ...options }: ReportPromptRunOptions,\n ): Promise<\n PromptRunResult & {\n /** Resulting prompt run */\n result: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n }\n > {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n if (\n options.promptRunMessages[options.promptRunMessages.length - 1].role !==\n ChatCompletionRole.Assistant\n ) {\n throw new Error(\n `promptRunMessages[${\n options.promptRunMessages.length - 1\n }].role is expected to be = ${ChatCompletionRole.Assistant}`,\n );\n }\n const response =\n options.promptRunMessages[options.promptRunMessages.length - 1].content;\n\n let parsed: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n try {\n // Parse the response\n parsed = this.parseAiResponse(promptName, response);\n } catch (err) {\n await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n error: err.message,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n throw err;\n }\n\n // report successful run\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Resolved,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n result: parsed,\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n\n /**\n * Report an error for a particular prompt\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportPromptRunError<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n {\n largeLanguageModel,\n ...options\n }: Requirize<ReportPromptRunOptions, 'error'>,\n ): Promise<PromptRunResult> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n}\n/* eslint-enable max-lines */\n","import { GraphQLClient } from 'graphql-request';\nimport { LargeLanguageModelClient } from '@transcend-io/privacy-types';\nimport { LARGE_LANGUAGE_MODELS } from './gqls';\nimport { makeGraphQLRequest } from './makeGraphQLRequest';\n\nexport interface LargeLanguageModel {\n /** ID of prompts */\n id: string;\n /** The name of the large language model. */\n name: string;\n /** The content of the prompt template. */\n client: LargeLanguageModelClient;\n /** Whether hosted by Transcend or not */\n isTranscendHosted: boolean;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all LargeLanguageModels in the organization\n *\n * @param client - GraphQL client\n * @returns All LargeLanguageModels in the organization\n */\nexport async function fetchAllLargeLanguageModels(\n client: GraphQLClient,\n): Promise<LargeLanguageModel[]> {\n const largeLanguageModels: LargeLanguageModel[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n largeLanguageModels: { nodes },\n } = await makeGraphQLRequest<{\n /** LargeLanguageModels */\n largeLanguageModels: {\n /** List */\n nodes: LargeLanguageModel[];\n };\n }>(client, LARGE_LANGUAGE_MODELS, {\n first: PAGE_SIZE,\n offset,\n });\n largeLanguageModels.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return largeLanguageModels.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { difference } from 'lodash-es';\nimport fastGlob from 'fast-glob';\nimport { execSync } from 'child_process';\n\n/**\n * Function thats gets the git files that have changed\n * and returns the code\n *\n * @param options - Options\n * @returns Changes files and diffs\n */\nexport function getGitFilesThatChanged({\n baseBranch,\n rootDirectory,\n githubRepo,\n excludedGlob = [],\n fileBlockList = [],\n}: {\n /** Base branch */\n baseBranch: string;\n /** Github repo name */\n githubRepo: string;\n /** Root directory */\n rootDirectory: string;\n /** A glob that excludes files */\n excludedGlob?: string[];\n /** Block list of files to not process */\n fileBlockList?: string[];\n}): {\n /** The list of files that changed */\n changedFiles: string[];\n /** Github repo name */\n repoName: string;\n /** Current commit */\n commit: string;\n /** File diffs */\n fileDiffs: { [k in string]: string };\n} {\n // Pull base branch\n execSync(`git fetch origin ${baseBranch}`);\n\n // Latest commit on base branch. If we are on the base branch, we take the prior commit\n const latestBasedCommit = execSync(\n `git ls-remote ${githubRepo} \"refs/heads/${baseBranch}\" | cut -f 1`,\n { encoding: 'utf-8' },\n ).split('\\n')[0];\n\n // This commit\n const latestThisCommit = execSync('git rev-parse HEAD', {\n encoding: 'utf-8',\n }).split('\\n')[0];\n\n // Ensure commits are present\n if (!latestBasedCommit || !latestThisCommit) {\n throw new Error('FAILED TO FIND COMMIT RANGE');\n }\n\n // Get the diff between the given branch and base branch\n const diff = execSync(\n `git fetch && git diff --name-only \"${\n baseBranch || latestBasedCommit\n }...${latestThisCommit}\" -- ${rootDirectory}`,\n { encoding: 'utf-8' },\n );\n\n // Filter out block list\n const changedFiles = difference(\n diff.split('\\n').filter((f) => f),\n fileBlockList,\n );\n\n // Filter out globs\n const filteredChanges =\n excludedGlob.length > 0\n ? fastGlob.sync(changedFiles, { ignore: excludedGlob })\n : changedFiles;\n\n // Get the contents of only the changed files\n const fileDiffs: { [k in string]: string } = {};\n filteredChanges.forEach((file) => {\n const contents = execSync(`git show ${latestThisCommit}:${file}`, {\n encoding: 'utf-8',\n });\n fileDiffs[file] = contents;\n });\n\n // Pull the github repo name\n const repoName = githubRepo.split('/').pop()!.split('.')[0];\n\n return {\n changedFiles,\n fileDiffs,\n repoName,\n commit: latestThisCommit,\n };\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/index.cjs","../src/lib/ai/TranscendPromptManager.ts","../src/lib/graphql/fetchLargeLanguageModels.ts","../src/lib/ai/getGitFilesThatChanged.ts"],"names":["PAGE_SIZE","fetchAllLargeLanguageModels","client","largeLanguageModels","offset","shouldContinue","nodes","makeGraphQLRequest","LARGE_LANGUAGE_MODELS","a","b","createRegexForTag","tagName","defineTranscendPrompts","prompts","jsonParseSafe","obj","TranscendPromptManager","handlebarsOptions","transcendUrl","DEFAULT_TRANSCEND_API","transcendApiKey","requireApproval","cacheDuration","defaultVariables","buildTranscendGraphQLClient","createHandlebarsWithHelpers","promptDefinitions","getValues","promptIds","id","x","promptTitles","title","agentNames","uniq_default","response","agents","fetchPromptsWithVariables","fetchAllAgents","keyBy_default","model","promptByTitle","promptById","acc","v","partial","apply","result","name","agent","remoteAgent","ts","thread","fetchAllPromptThreads","names","hasCache","missingCache","groupBy_default","cachedAgents","chunkedNames","chunk_default","remoteAgents","mapSeries","chunkedName","pageOfAgents","filterBy","fetchAllAgentFiles","largeLanguageModel","matching"],"mappings":"AAAA,6OAAiE,wDAAkD,wDAA0C,wDAA0E,wDAA0F,wDAA0E,wDAAkH,wDAAkE,wDAAkE,wDAAknB,wDAAy0G,wDAAgD,gCAA6B,wDAAuL,wDAA4E,qDCOr4J,iEAkBA,2DAaA,ICtBDA,CAAAA,CAAY,EAAA,CAQlB,MAAA,SAAsBC,CAAAA,CACpBC,CAAAA,CAC+B,CAC/B,IAAMC,CAAAA,CAA4C,CAAC,CAAA,CAC/CC,CAAAA,CAAS,CAAA,CAGTC,CAAAA,CAAiB,CAAA,CAAA,CACrB,EAAG,CACD,GAAM,CACJ,mBAAA,CAAqB,CAAE,KAAA,CAAAC,CAAM,CAC/B,CAAA,CAAI,MAAMC,kCAAAA,CAMPL,CAAQM,oBAAAA,CAAuB,CAChC,KAAA,CAAOR,CAAAA,CACP,MAAA,CAAAI,CACF,CAAC,CAAA,CACDD,CAAAA,CAAoB,IAAA,CAAK,GAAGG,CAAK,CAAA,CACjCF,CAAAA,EAAUJ,CAAAA,CACVK,CAAAA,CAAiBC,CAAAA,CAAM,MAAA,GAAWN,CACpC,CAAA,KAAA,CAASK,CAAAA,CAAAA,CAET,OAAOF,CAAAA,CAAoB,IAAA,CAAK,CAACM,CAAAA,CAAGC,CAAAA,CAAAA,EAAMD,CAAAA,CAAE,IAAA,CAAK,aAAA,CAAcC,CAAAA,CAAE,IAAI,CAAC,CACxE,CDPA,oCAA0B,SAuDVC,CAAAA,CAAkBC,CAAAA,CAAyB,CACzD,OAAO,IAAI,MAAA,CAAO,CAAA,CAAA,EAAIA,CAAO,CAAA,iBAAA,EAAoBA,CAAO,CAAA,CAAA,CAAG,CAC7D,CAQO,SAASC,EAAAA,CAGdC,CAAAA,CAA6B,CAC7B,OAAOA,CACT,CAqCA,IAAMC,CAAAA,CAAiBC,CAAAA,EAAyB,CAC9C,GAAI,CACF,OAAO,IAAA,CAAK,KAAA,CAAMA,CAAG,CACvB,CAAA,UAAY,CACV,OAAOA,CACT,CACF,CAAA,CAMaC,CAAAA,4CAAN,KAGL,CAEO,eASA,mBAAA,CAA4C,CAAC,EAAA,gBAG5C,YAAA,CAA4C,CAAC,EAAA,gBAG7C,eAAA,CAA6C,CAAC,EAAA,WA4CtD,CAAY,CACV,OAAA,CAAAH,CAAAA,CACA,iBAAA,CAAAI,CAAAA,CAAoB,CAAC,CAAA,CACrB,YAAA,CAAAC,CAAAA,CAAeC,mBAAAA,CACf,eAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CAAkB,CAAA,CAAA,CAClB,aAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CAAmB,CAAC,CACtB,CAAA,CAoBG,6GACD,IAAA,CAAK,OAAA,CAAUV,CAAAA,CACf,IAAA,CAAK,YAAA,CAAeK,CAAAA,CACpB,IAAA,CAAK,eAAA,CAAkBE,CAAAA,CACvB,IAAA,CAAK,SAAA,CAAYG,CAAAA,CACjB,IAAA,CAAK,gBAAA,CAAmBA,CAAAA,CACxB,IAAA,CAAK,aAAA,CAAgBC,kCAAAA,CACnBN,CACA,OAAOE,CAAAA,EAAoB,QAAA,CACvBA,CAAAA,CAAgB,OAAA,CAAQ,CAAA,CACxBA,CACN,CAAA,CACA,IAAA,CAAK,eAAA,CAAkBC,CAAAA,CACvB,IAAA,CAAK,aAAA,CAAgBC,CAAAA,CACrB,IAAA,CAAK,iBAAA,CAAoBL,CAAAA,CACzB,IAAA,CAAK,UAAA,CAAaQ,0DAAAA,CAA6C,CACjE,CAOA,MAAM,uBAAA,CAAA,CAAiE,CAErE,IAAMC,CAAAA,CAAoBC,kCAAAA,IAAU,CAAK,OAAO,CAAA,CAI1CC,CAAAA,CAAYF,CAAAA,CACf,GAAA,CAAI,CAAC,CAAE,EAAA,CAAAG,CAAG,CAAA,CAAA,EAAMA,CAAE,CAAA,CAClB,MAAA,CAAQC,CAAAA,EAAmB,CAAC,CAACA,CAAC,CAAA,CAC3BC,CAAAA,CAAeL,CAAAA,CAClB,GAAA,CAAI,CAAC,CAAE,KAAA,CAAAM,CAAM,CAAA,CAAA,EAAMA,CAAK,CAAA,CACxB,MAAA,CAAQF,CAAAA,EAAmB,CAAC,CAACA,CAAC,CAAA,CAC3BG,CAAAA,CAAaC,iCAAAA,CACjBR,CAAkB,GAAA,CAAI,CAAC,CAAE,UAAA,CAAAO,CAAW,CAAA,CAAA,EAAMA,CAAAA,EAAc,CAAC,CAAC,CAAA,CAAE,IAAA,CAAK,CACnE,CAAA,CAGM,CAACE,CAAAA,CAAUjC,CAAAA,CAAqBkC,CAAM,CAAA,CAAI,MAAM,OAAA,CAAQ,GAAA,CAAI,CAChEC,kCAAAA,IAA0B,CAAK,aAAA,CAAe,CAC5C,SAAA,CAAAT,CAAAA,CACA,YAAA,CAAAG,CACF,CAAC,CAAA,CACD/B,CAAAA,CAA4B,IAAA,CAAK,aAAa,CAAA,CAC9CsC,kCAAAA,IAAe,CAAK,aAAA,CAAe,CAAE,KAAA,CAAOL,CAAW,CAAC,CAC1D,CAAC,CAAA,CACD,IAAA,CAAK,YAAA,CAAeM,iCAAAA,CAAMH,CAAQ,MAAM,CAAA,CACxC,IAAA,CAAK,eAAA,CAAkBG,iCAAAA,CAAMH,CAAQ,SAAS,CAAA,CAC9C,IAAA,CAAK,mBAAA,CAAsBlC,CAAAA,CAAoB,MAAA,CAC5CsC,CAAAA,EAAUA,CAAAA,CAAM,iBAAA,GAAsB,CAAA,CACzC,CAAA,CAGA,IAAMC,CAAAA,CAAgBF,iCAAAA,CAAMJ,CAAS,OAAA,CAAS,OAAO,CAAA,CAC/CO,CAAAA,CAAaH,iCAAAA,CAAMJ,CAAS,OAAA,CAAS,IAAI,CAAA,CAG/C,OAAA,IAAA,CAAK,SAAA,CAAY,CACf,GAAGA,CAAAA,CAAS,mBAAA,CAAoB,MAAA,CAC9B,CAACQ,CAAAA,CAAKC,CAAAA,CAAAA,EACJ,MAAA,CAAO,MAAA,CAAOD,CAAAA,CAAK,CACjB,CAACC,CAAAA,CAAE,IAAI,CAAA,CAAGA,CAAAA,CAAE,IAAA,CAAO,IAAA,CAAK,KAAA,CAAMA,CAAAA,CAAE,IAAI,CAAA,CAAIA,CAAAA,CAAE,IAC5C,CAAC,CAAA,CACH,CAAC,CACH,CAAA,CACA,GAAG,IAAA,CAAK,gBACV,CAAA,CAGA,IAAA,CAAK,UAAA,CAAanB,0DAAAA,CAChB,GAAG,IAAA,CAAK,iBAAA,CACR,SAAA,CAAW,CACT,GAAI,IAAA,CAAK,iBAAA,CAAkB,SAAA,EAAa,CAAC,CAAA,CACzC,GAAGU,CAAAA,CAAS,cAAA,CAAe,GAAA,CAAKU,CAAAA,EAAAA,CAAa,CAC3C,IAAA,CAAMA,CAAAA,CAAQ,IAAA,CACd,OAAA,CAASA,CAAAA,CAAQ,OACnB,CAAA,CAAE,CACJ,CACF,CAAC,CAAA,CAGD,IAAA,CAAK,gBAAA,CAAmBC,8BAAAA,IAAM,CAAK,OAAA,CAAS,CAAC,CAAE,EAAA,CAAAjB,CAAAA,CAAI,KAAA,CAAAG,CAAM,CAAA,CAAA,EAAM,CAC7D,IAAMe,CAAAA,CAASlB,CAAAA,CACXa,CAAAA,CAAWb,CAAE,CAAA,CACbG,CAAAA,CACAS,CAAAA,CAAcT,CAAK,CAAA,CACnB,KAAA,CAAA,CACJ,EAAA,CAAI,CAACe,CAAAA,CACH,MAAM,IAAI,KAAA,CACR,CAAA,mCAAA,EAAsCf,CAAK,CAAA,WAAA,EAAcH,CAAE,CAAA,CAAA,CAC7D,CAAA,CAEF,OAAOkB,CACT,CAAC,CAAA,CAGD,IAAA,CAAK,aAAA,CAAgB,IAAI,IAAA,CAElBZ,CACT,CAQA,MAAM,cAAA,CAAea,CAAAA,CAA0C,CAC7D,IAAMC,CAAAA,CAAQ,IAAA,CAAK,YAAA,CAAaD,CAAI,CAAA,CACpC,EAAA,CAAIC,CAAAA,CACF,OAAOA,CAAAA,CAET,GAAM,CAACC,CAAW,CAAA,CAAI,MAAMZ,kCAAAA,IAAe,CAAK,aAAA,CAAe,CAC7D,KAAA,CAAO,CAACU,CAAI,CACd,CAAC,CAAA,CACD,EAAA,CAAKE,CAAAA,CAGL,OAAA,IAAA,CAAK,YAAA,CAAaA,CAAAA,CAAY,IAAI,CAAA,CAAIA,CAAAA,CACtC,IAAA,CAAK,eAAA,CAAgBA,CAAAA,CAAY,OAAO,CAAA,CAAIA,CAAAA,CACrCA,CACT,CAQA,MAAM,wBAAA,CACJC,CAAAA,CACmC,CACnC,GAAM,CAACC,CAAM,CAAA,CAAI,MAAMC,kCAAAA,IAAsB,CAAK,aAAA,CAAe,CAC/D,cAAA,CAAgB,CAACF,CAAE,CACrB,CAAC,CAAA,CACD,OAAOC,CACT,CAUA,MAAM,eAAA,CAAgBE,CAAAA,CAAmC,CACvD,EAAA,CAAIA,CAAAA,CAAM,MAAA,CAAS,CAAA,CACjB,MAAM,IAAI,KAAA,CAAM,2CAA2C,CAAA,CAE7D,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAW,CAAC,CAAA,CAAG,YAAA,CAAAC,CAAAA,CAAe,CAAC,CAAE,CAAA,CAAIC,iCAAAA,CAAQH,CAAQN,CAAAA,EAC3D,IAAA,CAAK,YAAA,CAAaA,CAAI,CAAA,CAAI,UAAA,CAAa,cACzC,CAAA,CACMU,CAAAA,CAAeH,CAAAA,CAAS,GAAA,CAAKP,CAAAA,EAAS,IAAA,CAAK,YAAA,CAAaA,CAAI,CAAC,CAAA,CACnE,EAAA,CAAIQ,CAAAA,CAAa,MAAA,GAAW,CAAA,CAC1B,OAAOE,CAAAA,CAET,IAAMC,CAAAA,CAAeC,iCAAAA,CAAMJ,CAAc,EAAE,CAAA,CACrCK,CAAAA,CAAwB,CAAC,CAAA,CAC/B,OAAA,MAAMC,iCAAAA,CAAUH,CAAc,MAAOI,CAAAA,EAAgB,CACnD,IAAMC,CAAAA,CAAe,MAAM1B,kCAAAA,IAAe,CAAK,aAAA,CAAe,CAC5D,KAAA,CAAOyB,CACT,CAAC,CAAA,CACDC,CAAAA,CAAa,OAAA,CAASf,CAAAA,EAAU,CAC9B,IAAA,CAAK,YAAA,CAAaA,CAAAA,CAAM,IAAI,CAAA,CAAIA,CAAAA,CAChC,IAAA,CAAK,eAAA,CAAgBA,CAAAA,CAAM,OAAO,CAAA,CAAIA,CACxC,CAAC,CAAA,CACDY,CAAAA,CAAa,IAAA,CAAK,GAAGG,CAAY,CACnC,CAAC,CAAA,CACM,CAAC,GAAGN,CAAAA,CAAc,GAAGG,CAAY,CAC1C,CAQA,aAAA,CAAcI,CAAAA,CAAmD,CAC/D,OAAOC,kCAAAA,IAAmB,CAAK,aAAA,CAAeD,CAAQ,CACxD,CAQA,qBAAA,CACEE,CAAAA,CACoB,CACpB,IAAMC,CAAAA,CAAW,IAAA,CAAK,mBAAA,CAAoB,IAAA,CAAM5B,CAAAA,EAC9C,OAAO2B,CAAAA,EAAuB,QAAA,CAC1B3B,CAAAA,CAAM,EAAA,GAAO2B,CAAAA,CACb3B,CAAAA,CAAM,IAAA,GAAS2B,CAAAA,CAAmB,IAAA,EAClC3B,CAAAA,CAAM,MAAA,GAAW2B,CAAAA,CAAmB,MAC1C,CAAA,CACA,EAAA,CAAI,CAACC,CAAAA,CACH,MAAM,IAAI,KAAA,CACR,CAAA,+BAAA,EACE,OAAOD,CAAAA,EAAuB,QAAA,CAC1BA,CAAAA,CACA,IAAA,CAAK,SAAA,CAAUA,CAAkB,CACvC,CAAA,CAAA;AE1ZG;AAiBI;AA4Bf","file":"/home/runner/work/cli/cli/dist/index.cjs","sourcesContent":[null,"/* eslint-disable max-lines */\nimport {\n Optionalize,\n Requirize,\n apply,\n decodeCodec,\n getValues,\n} from '@transcend-io/type-utils';\nimport type { Handlebars } from '@transcend-io/handlebars-utils';\nimport { Secret } from '@transcend-io/secret-value';\nimport * as t from 'io-ts';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport {\n Agent,\n AgentFile,\n AgentFileFilterBy,\n ReportPromptRunInput,\n buildTranscendGraphQLClient,\n fetchAllAgentFiles,\n fetchAllAgents,\n reportPromptRun,\n} from '../graphql';\nimport {\n HandlebarsInput,\n createHandlebarsWithHelpers,\n} from '@transcend-io/handlebars-utils';\nimport {\n TranscendPromptTemplated,\n TranscendPromptsAndVariables,\n fetchPromptsWithVariables,\n} from '../graphql/fetchPrompts';\nimport { GraphQLClient } from 'graphql-request';\nimport {\n PromptStatus,\n ChatCompletionRole,\n PromptRunProductArea,\n QueueStatus,\n LargeLanguageModelClient,\n} from '@transcend-io/privacy-types';\nimport {\n LargeLanguageModel,\n fetchAllLargeLanguageModels,\n} from '../graphql/fetchLargeLanguageModels';\nimport { groupBy, keyBy, uniq, chunk } from 'lodash-es';\nimport { mapSeries } from 'bluebird';\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"]}