@transcend-io/cli 8.0.6 → 8.0.7

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 (109) hide show
  1. package/dist/bin/bash-complete.cjs +1 -1
  2. package/dist/bin/cli.cjs +1 -1
  3. package/dist/bin/deprecated-command.cjs +2 -2
  4. package/dist/{chunk-DCBE53LG.cjs → chunk-2VX4QD73.cjs} +3 -3
  5. package/dist/{chunk-DCBE53LG.cjs.map → chunk-2VX4QD73.cjs.map} +1 -1
  6. package/dist/{chunk-JZEDU4GZ.cjs → chunk-4GRQMYW2.cjs} +2 -2
  7. package/dist/{chunk-JZEDU4GZ.cjs.map → chunk-4GRQMYW2.cjs.map} +1 -1
  8. package/dist/{chunk-MFIMY5RY.cjs → chunk-E57K4DGX.cjs} +2 -2
  9. package/dist/{chunk-MFIMY5RY.cjs.map → chunk-E57K4DGX.cjs.map} +1 -1
  10. package/dist/{chunk-IU4E6MQW.cjs → chunk-GT7Q27PI.cjs} +2 -2
  11. package/dist/{chunk-IU4E6MQW.cjs.map → chunk-GT7Q27PI.cjs.map} +1 -1
  12. package/dist/{chunk-5Y7FIOUT.cjs → chunk-H6YI2HZS.cjs} +2 -2
  13. package/dist/{chunk-5Y7FIOUT.cjs.map → chunk-H6YI2HZS.cjs.map} +1 -1
  14. package/dist/{chunk-KU3UCRAF.cjs → chunk-HBKA5Z5A.cjs} +2 -2
  15. package/dist/{chunk-KU3UCRAF.cjs.map → chunk-HBKA5Z5A.cjs.map} +1 -1
  16. package/dist/{chunk-NAGRUVXK.cjs → chunk-K2E6TCB5.cjs} +2 -2
  17. package/dist/{chunk-NAGRUVXK.cjs.map → chunk-K2E6TCB5.cjs.map} +1 -1
  18. package/dist/{chunk-OKLX7XKW.cjs → chunk-NKFAEQ2Q.cjs} +2 -2
  19. package/dist/{chunk-OKLX7XKW.cjs.map → chunk-NKFAEQ2Q.cjs.map} +1 -1
  20. package/dist/{chunk-LPUZGMB6.cjs → chunk-OCNPZWYT.cjs} +4 -4
  21. package/dist/{chunk-LPUZGMB6.cjs.map → chunk-OCNPZWYT.cjs.map} +1 -1
  22. package/dist/chunk-RSN3DUTP.cjs +2920 -0
  23. package/dist/{chunk-7O5DWH3M.cjs.map → chunk-RSN3DUTP.cjs.map} +1 -1
  24. package/dist/{chunk-DTGC4M5U.cjs → chunk-S3HIPD4J.cjs} +2 -2
  25. package/dist/{chunk-DTGC4M5U.cjs.map → chunk-S3HIPD4J.cjs.map} +1 -1
  26. package/dist/{chunk-YMH24XQT.cjs → chunk-SQVECTFA.cjs} +19 -19
  27. package/dist/{chunk-YMH24XQT.cjs.map → chunk-SQVECTFA.cjs.map} +1 -1
  28. package/dist/{impl-WCRE3QMZ.cjs → impl-2GZWVX2N.cjs} +2 -2
  29. package/dist/{impl-WCRE3QMZ.cjs.map → impl-2GZWVX2N.cjs.map} +1 -1
  30. package/dist/{impl-4WFQNFXM.cjs → impl-2NI344VN.cjs} +2 -2
  31. package/dist/{impl-4WFQNFXM.cjs.map → impl-2NI344VN.cjs.map} +1 -1
  32. package/dist/{impl-LAYRDHOS.cjs → impl-5XZA6XDY.cjs} +2 -2
  33. package/dist/{impl-LAYRDHOS.cjs.map → impl-5XZA6XDY.cjs.map} +1 -1
  34. package/dist/{impl-S3QSYERT.cjs → impl-A7WOM6B2.cjs} +2 -2
  35. package/dist/{impl-S3QSYERT.cjs.map → impl-A7WOM6B2.cjs.map} +1 -1
  36. package/dist/{impl-GNNZ6ISS.cjs → impl-ACT4HEIF.cjs} +2 -2
  37. package/dist/{impl-GNNZ6ISS.cjs.map → impl-ACT4HEIF.cjs.map} +1 -1
  38. package/dist/{impl-2XFKDVXC.cjs → impl-ASZALW6O.cjs} +2 -2
  39. package/dist/{impl-2XFKDVXC.cjs.map → impl-ASZALW6O.cjs.map} +1 -1
  40. package/dist/{impl-YYLZH24L.cjs → impl-B4RGQNKY.cjs} +4 -4
  41. package/dist/{impl-YYLZH24L.cjs.map → impl-B4RGQNKY.cjs.map} +1 -1
  42. package/dist/{impl-DUKSVNOM.cjs → impl-BRA6TEVA.cjs} +2 -2
  43. package/dist/{impl-DUKSVNOM.cjs.map → impl-BRA6TEVA.cjs.map} +1 -1
  44. package/dist/{impl-IN2PQA3H.cjs → impl-CWWICDPC.cjs} +2 -2
  45. package/dist/{impl-IN2PQA3H.cjs.map → impl-CWWICDPC.cjs.map} +1 -1
  46. package/dist/{impl-LWPYKGCZ.cjs → impl-E7JWHVRJ.cjs} +2 -2
  47. package/dist/{impl-LWPYKGCZ.cjs.map → impl-E7JWHVRJ.cjs.map} +1 -1
  48. package/dist/{impl-SZM2IXSY.cjs → impl-ERCHNSZD.cjs} +3 -3
  49. package/dist/{impl-SZM2IXSY.cjs.map → impl-ERCHNSZD.cjs.map} +1 -1
  50. package/dist/{impl-TEADN2ZL.cjs → impl-EU6DPMR5.cjs} +5 -5
  51. package/dist/{impl-TEADN2ZL.cjs.map → impl-EU6DPMR5.cjs.map} +1 -1
  52. package/dist/{impl-OZ6XHZRW.cjs → impl-GS4CVUAP.cjs} +2 -2
  53. package/dist/{impl-OZ6XHZRW.cjs.map → impl-GS4CVUAP.cjs.map} +1 -1
  54. package/dist/{impl-5IVCXXAL.cjs → impl-GTJ5DPQ4.cjs} +2 -2
  55. package/dist/{impl-5IVCXXAL.cjs.map → impl-GTJ5DPQ4.cjs.map} +1 -1
  56. package/dist/{impl-VZDR2CDX.cjs → impl-HHPNH3QN.cjs} +2 -2
  57. package/dist/{impl-VZDR2CDX.cjs.map → impl-HHPNH3QN.cjs.map} +1 -1
  58. package/dist/{impl-I6ETF7X7.cjs → impl-JYM2T6AQ.cjs} +2 -2
  59. package/dist/{impl-I6ETF7X7.cjs.map → impl-JYM2T6AQ.cjs.map} +1 -1
  60. package/dist/{impl-XXGHYIS2.cjs → impl-K6UD53QP.cjs} +2 -2
  61. package/dist/{impl-XXGHYIS2.cjs.map → impl-K6UD53QP.cjs.map} +1 -1
  62. package/dist/{impl-5VNZMRQP.cjs → impl-KHR6CYYW.cjs} +2 -2
  63. package/dist/{impl-5VNZMRQP.cjs.map → impl-KHR6CYYW.cjs.map} +1 -1
  64. package/dist/{impl-3JDGUUXS.cjs → impl-KQNFC333.cjs} +2 -2
  65. package/dist/{impl-3JDGUUXS.cjs.map → impl-KQNFC333.cjs.map} +1 -1
  66. package/dist/{impl-VRTPR7ZC.cjs → impl-LTMYU2AY.cjs} +2 -2
  67. package/dist/{impl-VRTPR7ZC.cjs.map → impl-LTMYU2AY.cjs.map} +1 -1
  68. package/dist/{impl-LO7NADSE.cjs → impl-M6XVZEZC.cjs} +2 -2
  69. package/dist/{impl-LO7NADSE.cjs.map → impl-M6XVZEZC.cjs.map} +1 -1
  70. package/dist/{impl-DGMMPU6J.cjs → impl-MM7Z76YA.cjs} +2 -2
  71. package/dist/{impl-DGMMPU6J.cjs.map → impl-MM7Z76YA.cjs.map} +1 -1
  72. package/dist/{impl-2WH2UTIZ.cjs → impl-MNZZSLBI.cjs} +2 -2
  73. package/dist/{impl-2WH2UTIZ.cjs.map → impl-MNZZSLBI.cjs.map} +1 -1
  74. package/dist/{impl-OMOQK2HQ.cjs → impl-N2ANLQOJ.cjs} +6 -6
  75. package/dist/{impl-OMOQK2HQ.cjs.map → impl-N2ANLQOJ.cjs.map} +1 -1
  76. package/dist/{impl-EJMVBV6T.cjs → impl-NRS5JFKV.cjs} +2 -2
  77. package/dist/{impl-EJMVBV6T.cjs.map → impl-NRS5JFKV.cjs.map} +1 -1
  78. package/dist/{impl-7U3M4RGF.cjs → impl-NWMCEWUU.cjs} +2 -2
  79. package/dist/{impl-7U3M4RGF.cjs.map → impl-NWMCEWUU.cjs.map} +1 -1
  80. package/dist/{impl-ZXCX5CQQ.cjs → impl-P23VFJZF.cjs} +2 -2
  81. package/dist/{impl-ZXCX5CQQ.cjs.map → impl-P23VFJZF.cjs.map} +1 -1
  82. package/dist/{impl-B3OMYCGQ.cjs → impl-QC2QXWOW.cjs} +2 -2
  83. package/dist/{impl-B3OMYCGQ.cjs.map → impl-QC2QXWOW.cjs.map} +1 -1
  84. package/dist/{impl-JA34WWJ5.cjs → impl-R3CY7ZIW.cjs} +2 -2
  85. package/dist/{impl-JA34WWJ5.cjs.map → impl-R3CY7ZIW.cjs.map} +1 -1
  86. package/dist/{impl-7JEVVESR.cjs → impl-SVCHBYPB.cjs} +2 -2
  87. package/dist/{impl-7JEVVESR.cjs.map → impl-SVCHBYPB.cjs.map} +1 -1
  88. package/dist/{impl-ZY3HLGMV.cjs → impl-T5AW675H.cjs} +2 -2
  89. package/dist/{impl-ZY3HLGMV.cjs.map → impl-T5AW675H.cjs.map} +1 -1
  90. package/dist/{impl-TVRDO556.cjs → impl-TGY32SCN.cjs} +2 -2
  91. package/dist/{impl-TVRDO556.cjs.map → impl-TGY32SCN.cjs.map} +1 -1
  92. package/dist/{impl-X7QVQTTU.cjs → impl-U6XFUPLF.cjs} +2 -2
  93. package/dist/{impl-X7QVQTTU.cjs.map → impl-U6XFUPLF.cjs.map} +1 -1
  94. package/dist/impl-UFXTQLXO.cjs +2 -0
  95. package/dist/{impl-IKL2VVT5.cjs.map → impl-UFXTQLXO.cjs.map} +1 -1
  96. package/dist/{impl-SVLQQPHG.cjs → impl-UHENI4EC.cjs} +2 -2
  97. package/dist/{impl-SVLQQPHG.cjs.map → impl-UHENI4EC.cjs.map} +1 -1
  98. package/dist/{impl-ZZL5FMCH.cjs → impl-UOAWNR34.cjs} +3 -3
  99. package/dist/{impl-ZZL5FMCH.cjs.map → impl-UOAWNR34.cjs.map} +1 -1
  100. package/dist/{impl-Z3TEIP7I.cjs → impl-VUQ6T7ON.cjs} +2 -2
  101. package/dist/{impl-Z3TEIP7I.cjs.map → impl-VUQ6T7ON.cjs.map} +1 -1
  102. package/dist/{impl-22FRQBKA.cjs → impl-W4I4GTBC.cjs} +2 -2
  103. package/dist/{impl-22FRQBKA.cjs.map → impl-W4I4GTBC.cjs.map} +1 -1
  104. package/dist/index.cjs +3 -3
  105. package/dist/index.cjs.map +1 -1
  106. package/dist/index.d.cts +447 -429
  107. package/package.json +1 -1
  108. package/dist/chunk-7O5DWH3M.cjs +0 -2920
  109. package/dist/impl-IKL2VVT5.cjs +0 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-ZZL5FMCH.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,wDAAyC,gCAA6B,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-ZZL5FMCH.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-UOAWNR34.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,wDAAyC,gCAA6B,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-UOAWNR34.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 _chunkDCBE53LGcjs = require('./chunk-DCBE53LG.cjs');require('./chunk-JZEDU4GZ.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-QEM6S2W7.cjs');require('./chunk-7O5DWH3M.cjs');require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-MFIMY5RY.cjs');require('./chunk-Q7I37FJV.cjs');async function m({auth:a,trackerStatus:r,file:s,classifyService:e,transcendUrl:n}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkDCBE53LGcjs.b.call(void 0, {auth:a,trackerStatus:r,file:s,classifyService:e,transcendUrl:n})}exports.uploadDataFlowsFromCsv = m;
2
- //# sourceMappingURL=impl-Z3TEIP7I.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2VX4QD73cjs = require('./chunk-2VX4QD73.cjs');require('./chunk-4GRQMYW2.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-QEM6S2W7.cjs');require('./chunk-RSN3DUTP.cjs');require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-E57K4DGX.cjs');require('./chunk-Q7I37FJV.cjs');async function m({auth:a,trackerStatus:r,file:s,classifyService:e,transcendUrl:n}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk2VX4QD73cjs.b.call(void 0, {auth:a,trackerStatus:r,file:s,classifyService:e,transcendUrl:n})}exports.uploadDataFlowsFromCsv = m;
2
+ //# sourceMappingURL=impl-VUQ6T7ON.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-Z3TEIP7I.cjs","../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"names":["uploadDataFlowsFromCsv","auth","trackerStatus","file","classifyService","transcendUrl","doneInputValidation"],"mappings":"AAAA,iIAAwC,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCa5R,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMN,iCAAAA,CACJ,IAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAC,CACH,CAAA,mCAAA","file":"/home/runner/work/cli/cli/dist/impl-Z3TEIP7I.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { uploadDataFlowsFromCsv as uploadDataFlowsFromCsvHelper } from '../../../lib/consent-manager';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadDataFlowsFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n classifyService: boolean;\n transcendUrl: string;\n}\n\nexport async function uploadDataFlowsFromCsv(\n this: LocalContext,\n {\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n }: UploadDataFlowsFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadDataFlowsFromCsvHelper({\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-VUQ6T7ON.cjs","../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"names":["uploadDataFlowsFromCsv","auth","trackerStatus","file","classifyService","transcendUrl","doneInputValidation"],"mappings":"AAAA,iIAAwC,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCa5R,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMN,iCAAAA,CACJ,IAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAC,CACH,CAAA,mCAAA","file":"/home/runner/work/cli/cli/dist/impl-VUQ6T7ON.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { uploadDataFlowsFromCsv as uploadDataFlowsFromCsvHelper } from '../../../lib/consent-manager';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadDataFlowsFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n classifyService: boolean;\n transcendUrl: string;\n}\n\nexport async function uploadDataFlowsFromCsv(\n this: LocalContext,\n {\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n }: UploadDataFlowsFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadDataFlowsFromCsvHelper({\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n });\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk7O5DWH3Mcjs = require('./chunk-7O5DWH3M.cjs');require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-MFIMY5RY.cjs');require('./chunk-Q7I37FJV.cjs');async function F({auth:i,file:n,transcendUrl:r,cacheFilepath:a,requestReceiptFolder:s,sombraAuth:l,concurrency:p,attributes:d,isTest:c,isSilent:u,skipSendingReceipt:m,emailIsVerified:b,skipFilterStep:g,dryRun:f,debug:C,defaultPhoneCountryCode:h}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk7O5DWH3Mcjs.Bf.call(void 0, {cacheFilepath:a,requestReceiptFolder:s,file:n,auth:i,sombraAuth:l,concurrency:p,transcendUrl:r,defaultPhoneCountryCode:h,attributes:_chunk7O5DWH3Mcjs.nc.call(void 0, d),debug:C,skipFilterStep:g,isSilent:u,skipSendingReceipt:m,emailIsVerified:b,isTest:c,dryRun:f})}exports.upload = F;
2
- //# sourceMappingURL=impl-22FRQBKA.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkRSN3DUTPcjs = require('./chunk-RSN3DUTP.cjs');require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-E57K4DGX.cjs');require('./chunk-Q7I37FJV.cjs');async function F({auth:i,file:n,transcendUrl:r,cacheFilepath:a,requestReceiptFolder:s,sombraAuth:l,concurrency:p,attributes:d,isTest:c,isSilent:u,skipSendingReceipt:m,emailIsVerified:b,skipFilterStep:g,dryRun:f,debug:C,defaultPhoneCountryCode:h}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkRSN3DUTPcjs.Cf.call(void 0, {cacheFilepath:a,requestReceiptFolder:s,file:n,auth:i,sombraAuth:l,concurrency:p,transcendUrl:r,defaultPhoneCountryCode:h,attributes:_chunkRSN3DUTPcjs.nc.call(void 0, d),debug:C,skipFilterStep:g,isSilent:u,skipSendingReceipt:m,emailIsVerified:b,isTest:c,dryRun:f})}exports.upload = F;
2
+ //# sourceMappingURL=impl-W4I4GTBC.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-22FRQBKA.cjs","../src/commands/request/upload/impl.ts"],"names":["upload","auth","file","transcendUrl","cacheFilepath","requestReceiptFolder","sombraAuth","concurrency","attributes","isTest","isSilent","skipSendingReceipt","emailIsVerified","skipFilterStep","dryRun","debug","defaultPhoneCountryCode","doneInputValidation","uploadPrivacyRequestsFromCsv","splitCsvToList"],"mappings":"AAAA,iIAAwC,wDAAkD,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MC0B9M,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,kBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,aAAA,CAAAd,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,IAAA,CAAAH,CAAAA,CACA,IAAA,CAAAD,CAAAA,CACA,UAAA,CAAAK,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAJ,CAAAA,CACA,uBAAA,CAAAa,CAAAA,CACA,UAAA,CAAYG,kCAAAA,CAAyB,CAAA,CACrC,KAAA,CAAAJ,CAAAA,CACA,cAAA,CAAAF,CAAAA,CACA,QAAA,CAAAH,CAAAA,CACA,kBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,MAAA,CAAAH,CAAAA,CACA,MAAA,CAAAK,CACF,CAAC,CACH,CAAA,mBAAA","file":"/home/runner/work/cli/cli/dist/impl-22FRQBKA.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport {\n splitCsvToList,\n uploadPrivacyRequestsFromCsv,\n} from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n cacheFilepath: string;\n requestReceiptFolder: string;\n sombraAuth?: string;\n concurrency: number;\n attributes: string;\n isTest: boolean;\n isSilent: boolean;\n skipSendingReceipt: boolean;\n emailIsVerified: boolean;\n skipFilterStep: boolean;\n dryRun: boolean;\n debug: boolean;\n defaultPhoneCountryCode: string;\n}\n\nexport async function upload(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n cacheFilepath,\n requestReceiptFolder,\n sombraAuth,\n concurrency,\n attributes,\n isTest,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n skipFilterStep,\n dryRun,\n debug,\n defaultPhoneCountryCode,\n }: UploadCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadPrivacyRequestsFromCsv({\n cacheFilepath,\n requestReceiptFolder,\n file,\n auth,\n sombraAuth,\n concurrency,\n transcendUrl,\n defaultPhoneCountryCode,\n attributes: splitCsvToList(attributes),\n debug,\n skipFilterStep,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n isTest,\n dryRun,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-W4I4GTBC.cjs","../src/commands/request/upload/impl.ts"],"names":["upload","auth","file","transcendUrl","cacheFilepath","requestReceiptFolder","sombraAuth","concurrency","attributes","isTest","isSilent","skipSendingReceipt","emailIsVerified","skipFilterStep","dryRun","debug","defaultPhoneCountryCode","doneInputValidation","uploadPrivacyRequestsFromCsv","splitCsvToList"],"mappings":"AAAA,iIAAwC,wDAAkD,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MC0B9M,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,kBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,aAAA,CAAAd,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,IAAA,CAAAH,CAAAA,CACA,IAAA,CAAAD,CAAAA,CACA,UAAA,CAAAK,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAJ,CAAAA,CACA,uBAAA,CAAAa,CAAAA,CACA,UAAA,CAAYG,kCAAAA,CAAyB,CAAA,CACrC,KAAA,CAAAJ,CAAAA,CACA,cAAA,CAAAF,CAAAA,CACA,QAAA,CAAAH,CAAAA,CACA,kBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,MAAA,CAAAH,CAAAA,CACA,MAAA,CAAAK,CACF,CAAC,CACH,CAAA,mBAAA","file":"/home/runner/work/cli/cli/dist/impl-W4I4GTBC.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport {\n splitCsvToList,\n uploadPrivacyRequestsFromCsv,\n} from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n cacheFilepath: string;\n requestReceiptFolder: string;\n sombraAuth?: string;\n concurrency: number;\n attributes: string;\n isTest: boolean;\n isSilent: boolean;\n skipSendingReceipt: boolean;\n emailIsVerified: boolean;\n skipFilterStep: boolean;\n dryRun: boolean;\n debug: boolean;\n defaultPhoneCountryCode: string;\n}\n\nexport async function upload(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n cacheFilepath,\n requestReceiptFolder,\n sombraAuth,\n concurrency,\n attributes,\n isTest,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n skipFilterStep,\n dryRun,\n debug,\n defaultPhoneCountryCode,\n }: UploadCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadPrivacyRequestsFromCsv({\n cacheFilepath,\n requestReceiptFolder,\n file,\n auth,\n sombraAuth,\n concurrency,\n transcendUrl,\n defaultPhoneCountryCode,\n attributes: splitCsvToList(attributes),\n debug,\n skipFilterStep,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n isTest,\n dryRun,\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 _chunkNAGRUVXKcjs = require('./chunk-NAGRUVXK.cjs');var _chunkLPUZGMB6cjs = require('./chunk-LPUZGMB6.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkSW5CIF5Dcjs = require('./chunk-SW5CIF5D.cjs');var _chunkOKLX7XKWcjs = require('./chunk-OKLX7XKW.cjs');var _chunkKU3UCRAFcjs = require('./chunk-KU3UCRAF.cjs');var _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunkDCBE53LGcjs = require('./chunk-DCBE53LG.cjs');var _chunkJZEDU4GZcjs = require('./chunk-JZEDU4GZ.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunk7O5DWH3Mcjs = require('./chunk-7O5DWH3M.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkMFIMY5RYcjs = require('./chunk-MFIMY5RY.cjs');var _chunkQ7I37FJVcjs = require('./chunk-Q7I37FJV.cjs');var _typeutils = require('@transcend-io/type-utils');var _handlebarsutils = require('@transcend-io/handlebars-utils');var _privacytypes = require('@transcend-io/privacy-types');var T=20;async function D(a){let e=[],r=0,t=!1;do{let{largeLanguageModels:{nodes:s}}=await _chunk7O5DWH3Mcjs.Wf.call(void 0, a,_chunk7O5DWH3Mcjs.Fb,{first:T,offset:r});e.push(...s),r+=T,t=s.length===T}while(t);return e.sort((s,o)=>s.name.localeCompare(o.name))}var _bluebird = require('bluebird');function j(a){return new RegExp(`<${a}>([\\s\\S]+?)<\\/${a}>`)}function Sm(a){return a}var H=a=>{try{return JSON.parse(a)}catch (e2){return a}},B= exports.TranscendPromptManager = (_class =class{__init() {this.largeLanguageModels=[]}__init2() {this.agentsByName={}}__init3() {this.agentsByAgentId={}}constructor({prompts:e,handlebarsOptions:r={},transcendUrl:t=_chunkMFIMY5RYcjs.r,transcendApiKey:s,requireApproval:o=!0,cacheDuration:i,defaultVariables:p={}}){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);this.prompts=e,this.transcendUrl=t,this.transcendApiKey=s,this.variables=p,this.defaultVariables=p,this.graphQLClient=_chunk7O5DWH3Mcjs.vc.call(void 0, t,typeof s=="object"?s.release():s),this.requireApproval=o,this.cacheDuration=i,this.handlebarsOptions=r,this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, r)}async fetchPromptsAndMetadata(){let e=_typeutils.getValues.call(void 0, this.prompts),r=e.map(({id:n})=>n).filter(n=>!!n),t=e.map(({title:n})=>n).filter(n=>!!n),s=_chunkMFIMY5RYcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunk7O5DWH3Mcjs.yd.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),D(this.graphQLClient),_chunk7O5DWH3Mcjs.Fc.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunkMFIMY5RYcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunkMFIMY5RYcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunkMFIMY5RYcjs.e.call(void 0, o.prompts,"title"),c=_chunkMFIMY5RYcjs.e.call(void 0, o.prompts,"id");return this.variables={...o.calculatedVariables.reduce((n,g)=>Object.assign(n,{[g.name]:g.data?JSON.parse(g.data):g.data}),{}),...this.defaultVariables},this.handlebars=_handlebarsutils.createHandlebarsWithHelpers.call(void 0, {...this.handlebarsOptions,templates:[...this.handlebarsOptions.templates||[],...o.promptPartials.map(n=>({name:n.slug,content:n.content}))]}),this.promptContentMap=_typeutils.apply.call(void 0, this.prompts,({id:n,title:g})=>{let d=n?c[n]:g?m[g]:void 0;if(!d)throw new Error(`Failed to find prompt with title: "${g}" and id: "${n}"`);return d}),this.lastUpdatedAt=new Date,o}async getAgentByName(e){let r=this.agentsByName[e];if(r)return r;let[t]=await _chunk7O5DWH3Mcjs.Fc.call(void 0, this.graphQLClient,{names:[e]});if(t)return this.agentsByName[t.name]=t,this.agentsByAgentId[t.agentId]=t,t}async getPromptThreadBySlackTs(e){let[r]=await _chunk7O5DWH3Mcjs.zd.call(void 0, this.graphQLClient,{slackMessageTs:[e]});return r}async getAgentsByName(e){if(e.length<1)throw new Error("Expected at least one name to be provided");let{hasCache:r=[],missingCache:t=[]}=_chunkMFIMY5RYcjs.d.call(void 0, e,p=>this.agentsByName[p]?"hasCache":"missingCache"),s=r.map(p=>this.agentsByName[p]);if(t.length===0)return s;let o=_chunkMFIMY5RYcjs.b.call(void 0, t,50),i=[];return await _bluebird.mapSeries.call(void 0, o,async p=>{let m=await _chunk7O5DWH3Mcjs.Fc.call(void 0, this.graphQLClient,{names:p});m.forEach(c=>{this.agentsByName[c.name]=c,this.agentsByAgentId[c.agentId]=c}),i.push(...m)}),[...s,...i]}getAgentFiles(e){return _chunk7O5DWH3Mcjs.Dc.call(void 0, this.graphQLClient,e)}getLargeLanguageModel(e){let r=this.largeLanguageModels.find(t=>typeof e=="string"?t.id===e:t.name===e.name&&t.client===e.client);if(!r)throw new Error(`Failed to find model matching: ${typeof e=="string"?e:JSON.stringify(e)}`);return r}async getPromptDefinition(e){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let{promptContentMap:r}=this;if(!r)throw new Error("Expected this.promptContentMap to be defined");let t=r[e];if(!t)throw new Error(`Expected this.promptContentMap[${e}] to be defined`);return t}async compilePrompt(e,r){let t=await this.getPromptDefinition(e),s=this.prompts[e];if(!s)throw new Error(`Expected this.prompts[${e}] to be defined`);if(this.requireApproval&&t.status!==_privacytypes.PromptStatus.Approved)throw new Error(`Assessment "${t.title}" cannot be used because its in status: "${t.status}"`);if(t.status===_privacytypes.PromptStatus.Rejected)throw new Error(`Assessment "${t.title}" cannot be used because it's in status: "${t.status}"`);return _typeutils.decodeCodec.call(void 0, s.paramCodec,r),this.handlebars.compile(t.content)({currentDate:new Date().toISOString(),...this.variables,...r})}parseAiResponse(e,r){let t=this.prompts[e];if(!t)throw new Error(`Expected this.prompts[${e}] to be defined`);let s=t.extractFromTag&&(j(t.extractFromTag).exec(r)||[])[1]||r;return _typeutils.decodeCodec.call(void 0, t.outputCodec,H(s),!1)}async reportAndParsePromptRun(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);if(t.promptRunMessages[t.promptRunMessages.length-1].role!==_privacytypes.ChatCompletionRole.Assistant)throw new Error(`promptRunMessages[${t.promptRunMessages.length-1}].role is expected to be = ${_privacytypes.ChatCompletionRole.Assistant}`);let i=t.promptRunMessages[t.promptRunMessages.length-1].content,p;try{p=this.parseAiResponse(e,i)}catch(c){throw await _chunk7O5DWH3Mcjs.ae.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,error:c.message,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((n,g)=>({...n,...g===0?{template:o.content}:{}}))}),c}let m=await _chunk7O5DWH3Mcjs.ae.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Resolved,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((c,n)=>({...c,...n===0?{template:o.content}:{}}))});return{result:p,promptRunId:m,promptRunUrl:`https://app.transcend.io/prompts/runs/${m}`}}async reportPromptRunError(e,{largeLanguageModel:r,...t}){(!this.lastUpdatedAt||this.cacheDuration===0||this.cacheDuration&&Date.now()-this.lastUpdatedAt.getTime()>this.cacheDuration)&&await this.fetchPromptsAndMetadata();let s=t.name||`@transcend-io/cli-prompt-run-${new Date().toISOString()}`;if(!this.promptContentMap)throw new Error("Expected this.promptContentMap to be defined");let o=this.promptContentMap[e];if(!o)throw new Error(`Expected this.prompts[${e}] to be defined`);if(t.promptRunMessages.length===0)throw new Error("promptRunMessages is expected to have length > 0");if(t.promptRunMessages[0].role!==_privacytypes.ChatCompletionRole.System)throw new Error(`promptRunMessages[0].role is expected to be = ${_privacytypes.ChatCompletionRole.System}`);let i=await _chunk7O5DWH3Mcjs.ae.call(void 0, this.graphQLClient,{productArea:_privacytypes.PromptRunProductArea.PromptManager,...t,name:s,status:_privacytypes.QueueStatus.Error,...typeof r=="string"?{largeLanguageModelId:r}:{largeLanguageModelName:r.name,largeLanguageModelClient:r.client},promptId:o.id,promptRunMessages:t.promptRunMessages.map((p,m)=>({...p,...m===0?{template:o.content}:{}}))});return{promptRunId:i,promptRunUrl:`https://app.transcend.io/prompts/runs/${i}`}}}, _class);function Bm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function Qm(a){return Object.entries(a).reduce((e,[r,t])=>t!=null&&t!==""&&!(Array.isArray(t)&&t.length===0)&&!(typeof t=="object"&&Object.keys(t).length===0)?Object.assign(e,{[r]:t}):e,{})}var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _child_process = require('child_process');function Vm({baseBranch:a,rootDirectory:e,githubRepo:r,excludedGlob:t=[],fileBlockList:s=[]}){_child_process.execSync.call(void 0, `git fetch origin ${a}`);let o=_child_process.execSync.call(void 0, `git ls-remote ${r} "refs/heads/${a}" | cut -f 1`,{encoding:"utf-8"}).split(`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _class;var _chunkK2E6TCB5cjs = require('./chunk-K2E6TCB5.cjs');var _chunkOCNPZWYTcjs = require('./chunk-OCNPZWYT.cjs');var _chunkIBTP5OXEcjs = require('./chunk-IBTP5OXE.cjs');var _chunkSW5CIF5Dcjs = require('./chunk-SW5CIF5D.cjs');var _chunkNKFAEQ2Qcjs = require('./chunk-NKFAEQ2Q.cjs');var _chunkHBKA5Z5Acjs = require('./chunk-HBKA5Z5A.cjs');var _chunkLR3CPNDMcjs = require('./chunk-LR3CPNDM.cjs');var _chunk2VX4QD73cjs = require('./chunk-2VX4QD73.cjs');var _chunk4GRQMYW2cjs = require('./chunk-4GRQMYW2.cjs');var _chunkQEM6S2W7cjs = require('./chunk-QEM6S2W7.cjs');var _chunkRSN3DUTPcjs = require('./chunk-RSN3DUTP.cjs');var _chunkLCDYXJN6cjs = require('./chunk-LCDYXJN6.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkE57K4DGXcjs = require('./chunk-E57K4DGX.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 _chunkRSN3DUTPcjs.Xf.call(void 0, a,_chunkRSN3DUTPcjs.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 Bm(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=_chunkE57K4DGXcjs.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=_chunkRSN3DUTPcjs.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=_chunkE57K4DGXcjs.j.call(void 0, e.map(({agentNames:n})=>n||[]).flat()),[o,i,p]=await Promise.all([_chunkRSN3DUTPcjs.zd.call(void 0, this.graphQLClient,{promptIds:r,promptTitles:t}),D(this.graphQLClient),_chunkRSN3DUTPcjs.Fc.call(void 0, this.graphQLClient,{names:s})]);this.agentsByName=_chunkE57K4DGXcjs.e.call(void 0, p,"name"),this.agentsByAgentId=_chunkE57K4DGXcjs.e.call(void 0, p,"agentId"),this.largeLanguageModels=i.filter(n=>n.isTranscendHosted===!1);let m=_chunkE57K4DGXcjs.e.call(void 0, o.prompts,"title"),c=_chunkE57K4DGXcjs.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 _chunkRSN3DUTPcjs.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 _chunkRSN3DUTPcjs.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=[]}=_chunkE57K4DGXcjs.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=_chunkE57K4DGXcjs.b.call(void 0, t,50),i=[];return await _bluebird.mapSeries.call(void 0, o,async p=>{let m=await _chunkRSN3DUTPcjs.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 _chunkRSN3DUTPcjs.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 _chunkRSN3DUTPcjs.be.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 _chunkRSN3DUTPcjs.be.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 _chunkRSN3DUTPcjs.be.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 Qm(a){let e=/(https?:\/\/[^\s]+)/g;return a.replace(e,"<link-omitted>")}function Um(a){return Object.entries(a).reduce((e,[r,t])=>t!=null&&t!==""&&!(Array.isArray(t)&&t.length===0)&&!(typeof t=="object"&&Object.keys(t).length===0)?Object.assign(e,{[r]:t}):e,{})}var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _child_process = require('child_process');function vm({baseBranch:a,rootDirectory:e,githubRepo:r,excludedGlob:t=[],fileBlockList:s=[]}){_child_process.execSync.call(void 0, `git fetch origin ${a}`);let o=_child_process.execSync.call(void 0, `git ls-remote ${r} "refs/heads/${a}" | cut -f 1`,{encoding:"utf-8"}).split(`
2
2
  `)[0],i=_child_process.execSync.call(void 0, "git rev-parse HEAD",{encoding:"utf-8"}).split(`
3
- `)[0];if(!o||!i)throw new Error("FAILED TO FIND COMMIT RANGE");let p=_child_process.execSync.call(void 0, `git fetch && git diff --name-only "${a||o}...${i}" -- ${e}`,{encoding:"utf-8"}),m=_chunkMFIMY5RYcjs.c.call(void 0, p.split(`
4
- `).filter(d=>d),s),c=t.length>0?_fastglob2.default.sync(m,{ignore:t}):m,n={};c.forEach(d=>{let F=_child_process.execSync.call(void 0, `git show ${i}:${d}`,{encoding:"utf-8"});n[d]=F});let g=r.split("/").pop().split(".")[0];return{changedFiles:m,fileDiffs:n,repoName:g,commit:i}}exports.ACTIONS = _chunk7O5DWH3Mcjs.tb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunk7O5DWH3Mcjs.Ga; exports.ADD_SILO_DISCOVERY_RESULTS = _chunk7O5DWH3Mcjs.G; exports.ADMIN_DASH = _chunkMFIMY5RYcjs.o; exports.ADMIN_DASH_DATAPOINTS = _chunkMFIMY5RYcjs.q; exports.ADMIN_DASH_INTEGRATIONS = _chunkMFIMY5RYcjs.p; exports.AGENTS = _chunk7O5DWH3Mcjs.Gb; exports.AGENT_FILES = _chunk7O5DWH3Mcjs.Jb; exports.AGENT_FUNCTIONS = _chunk7O5DWH3Mcjs.Mb; exports.API_KEYS = _chunk7O5DWH3Mcjs.D; exports.APPROVE_PRIVACY_REQUEST = _chunk7O5DWH3Mcjs.W; exports.ASSESSMENTS = _chunk7O5DWH3Mcjs.ea; exports.ASSESSMENT_SECTION_FIELDS = _chunk7O5DWH3Mcjs.da; exports.ASSESSMENT_TEMPLATES = _chunk7O5DWH3Mcjs.ia; exports.ASSUME_ROLE = _chunk7O5DWH3Mcjs.Eb; exports.ATTRIBUTES = _chunk7O5DWH3Mcjs.Ka; exports.ATTRIBUTE_KEYS_REQUESTS = _chunk7O5DWH3Mcjs.L; exports.ATTRIBUTE_VALUES = _chunk7O5DWH3Mcjs.Oa; exports.ActionInput = _chunkQEM6S2W7cjs.G; exports.ActionItemCollectionInput = _chunkQEM6S2W7cjs.R; exports.ActionItemInput = _chunkQEM6S2W7cjs.S; exports.AgentFileInput = _chunkQEM6S2W7cjs.o; exports.AgentFunctionInput = _chunkQEM6S2W7cjs.n; exports.AgentInput = _chunkQEM6S2W7cjs.m; exports.ApiKeyInput = _chunkQEM6S2W7cjs.c; exports.AssessmentAction = _chunk7O5DWH3Mcjs.Kd; exports.AssessmentAnswerOptionInput = _chunkQEM6S2W7cjs.Y; exports.AssessmentDisplayLogicInput = _chunkQEM6S2W7cjs.V; exports.AssessmentInput = _chunkQEM6S2W7cjs.ca; exports.AssessmentNestedRule = _chunk7O5DWH3Mcjs.Jd; exports.AssessmentNestedRuleInput = _chunkQEM6S2W7cjs.U; exports.AssessmentResourceInput = _chunkQEM6S2W7cjs.ba; exports.AssessmentRetentionScheduleInput = _chunkQEM6S2W7cjs.$; exports.AssessmentRiskLogic = _chunk7O5DWH3Mcjs.Md; exports.AssessmentRule = _chunk7O5DWH3Mcjs.Id; exports.AssessmentRuleInput = _chunkQEM6S2W7cjs.T; exports.AssessmentSectionInput = _chunkQEM6S2W7cjs._; exports.AssessmentSectionQuestionInput = _chunkQEM6S2W7cjs.Z; exports.AssessmentTemplateInput = _chunkQEM6S2W7cjs.aa; exports.AttestedExtraIdentifiers = _chunk7O5DWH3Mcjs.jf; exports.AttributeInput = _chunkQEM6S2W7cjs.k; exports.AttributePreview = _chunkQEM6S2W7cjs.l; exports.AttributeValueInput = _chunkQEM6S2W7cjs.j; exports.BLANK = _chunk7O5DWH3Mcjs.cc; exports.BULK_APPLY = _chunk7O5DWH3Mcjs.bc; exports.BULK_REQUEST_FILES = _chunk7O5DWH3Mcjs.Ea; exports.BUSINESS_ENTITIES = _chunk7O5DWH3Mcjs.qb; exports.BusinessEntityInput = _chunkQEM6S2W7cjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunk7O5DWH3Mcjs.X; exports.CAN_APPLY_IN_BULK = _chunk7O5DWH3Mcjs.gc; exports.CATALOGS = _chunk7O5DWH3Mcjs.r; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunk7O5DWH3Mcjs.ua; exports.CODE_PACKAGES = _chunk7O5DWH3Mcjs.P; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunk7O5DWH3Mcjs.pb; exports.CONSENT_PARTITIONS = _chunk7O5DWH3Mcjs.Ta; exports.COOKIES = _chunk7O5DWH3Mcjs.Ya; exports.CREATE_ACTION_ITEMS = _chunk7O5DWH3Mcjs.xb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunk7O5DWH3Mcjs.Ia; exports.CREATE_AGENT = _chunk7O5DWH3Mcjs.Hb; exports.CREATE_AGENT_FILE = _chunk7O5DWH3Mcjs.Kb; exports.CREATE_AGENT_FUNCTION = _chunk7O5DWH3Mcjs.Nb; exports.CREATE_API_KEY = _chunk7O5DWH3Mcjs.E; exports.CREATE_ATTRIBUTE = _chunk7O5DWH3Mcjs.Pa; exports.CREATE_ATTRIBUTE_VALUES = _chunk7O5DWH3Mcjs.La; exports.CREATE_BUSINESS_ENTITY = _chunk7O5DWH3Mcjs.rb; exports.CREATE_CODE_PACKAGE = _chunk7O5DWH3Mcjs.R; exports.CREATE_CONSENT_EXPERIENCE = _chunk7O5DWH3Mcjs.nb; exports.CREATE_CONSENT_MANAGER = _chunk7O5DWH3Mcjs.ab; exports.CREATE_CONSENT_PARTITION = _chunk7O5DWH3Mcjs.ob; exports.CREATE_DATA_FLOWS = _chunk7O5DWH3Mcjs.Ua; exports.CREATE_DATA_SILOS = _chunk7O5DWH3Mcjs.m; exports.CREATE_DATA_SUBJECT = _chunk7O5DWH3Mcjs.x; exports.CREATE_DATA_SUB_CATEGORY = _chunk7O5DWH3Mcjs.Tb; exports.CREATE_ENRICHER = _chunk7O5DWH3Mcjs.p; exports.CREATE_IDENTIFIER = _chunk7O5DWH3Mcjs.u; exports.CREATE_PROCESSING_ACTIVITY = _chunk7O5DWH3Mcjs.Zb; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunk7O5DWH3Mcjs.Wb; exports.CREATE_PROMPT = _chunk7O5DWH3Mcjs.oa; exports.CREATE_PROMPT_GROUP = _chunk7O5DWH3Mcjs.sa; exports.CREATE_PROMPT_PARTIAL = _chunk7O5DWH3Mcjs.qa; exports.CREATE_REPOSITORY = _chunk7O5DWH3Mcjs.C; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunk7O5DWH3Mcjs.O; exports.CREATE_TEAM = _chunk7O5DWH3Mcjs.ya; exports.CREATE_TEMPLATE = _chunk7O5DWH3Mcjs.J; exports.CREATE_VENDOR = _chunk7O5DWH3Mcjs.Qb; exports.CachedFileState = _chunk7O5DWH3Mcjs.hc; exports.CachedRequestState = _chunk7O5DWH3Mcjs.jc; exports.CodePackageInput = _chunkQEM6S2W7cjs.D; exports.CodePackageSdk = _chunkQEM6S2W7cjs.C; exports.ColumnName = _chunk7O5DWH3Mcjs.ec; exports.ConsentManageExperienceInput = _chunkQEM6S2W7cjs.K; exports.ConsentManagerInput = _chunkQEM6S2W7cjs.M; exports.ConsentManagerMetricBin = _chunk7O5DWH3Mcjs.Qc; exports.ConsentManagerServiceMetadata = _chunkQEM6S2W7cjs.ka; exports.ConsentPreferenceResponse = _chunkDCBE53LGcjs.i; exports.ConsentPreferenceTopic = _chunkQEM6S2W7cjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkQEM6S2W7cjs.da; exports.ConsentPurpose = _chunkQEM6S2W7cjs.fa; exports.CookieCsvInput = _chunkQEM6S2W7cjs.ja; exports.CookieInput = _chunkQEM6S2W7cjs.J; exports.CronIdentifier = _chunkKU3UCRAFcjs.a; exports.CronIdentifierPush = _chunkKU3UCRAFcjs.c; exports.DATAPOINT_EXPORT = _chunk7O5DWH3Mcjs.g; exports.DATA_FLOWS = _chunk7O5DWH3Mcjs.Xa; exports.DATA_POINTS = _chunk7O5DWH3Mcjs.a; exports.DATA_POINT_COUNT = _chunk7O5DWH3Mcjs.b; exports.DATA_SILOS = _chunk7O5DWH3Mcjs.i; exports.DATA_SILOS_ENRICHED = _chunk7O5DWH3Mcjs.k; exports.DATA_SILO_EXPORT = _chunk7O5DWH3Mcjs.j; exports.DATA_SUBJECTS = _chunk7O5DWH3Mcjs.w; exports.DATA_SUB_CATEGORIES = _chunk7O5DWH3Mcjs.Sb; exports.DEFAULT_TRANSCEND_API = _chunkMFIMY5RYcjs.r; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkMFIMY5RYcjs.s; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunk7O5DWH3Mcjs._d; exports.DELETE_API_KEY = _chunk7O5DWH3Mcjs.F; exports.DELETE_ATTRIBUTE_VALUE = _chunk7O5DWH3Mcjs.Na; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunk7O5DWH3Mcjs.zb; exports.DEPLOY_CONSENT_MANAGER = _chunk7O5DWH3Mcjs.db; exports.DETERMINE_LOGIN_METHOD = _chunk7O5DWH3Mcjs.Cb; exports.DataCategoryGuessInput = _chunkQEM6S2W7cjs.h; exports.DataCategoryInput = _chunkQEM6S2W7cjs.q; exports.DataCategoryPreviewInput = _chunkQEM6S2W7cjs.g; exports.DataCategoryRecommendationInput = _chunkQEM6S2W7cjs.i; exports.DataFlowCsvInput = _chunkQEM6S2W7cjs.ia; exports.DataFlowInput = _chunkQEM6S2W7cjs.I; exports.DataSiloInput = _chunkQEM6S2W7cjs.Q; exports.DataSubjectInput = _chunkQEM6S2W7cjs.F; exports.DatapointInput = _chunkQEM6S2W7cjs.w; exports.ENABLED_PLUGINS = _chunk7O5DWH3Mcjs.H; exports.ENRICHERS = _chunk7O5DWH3Mcjs.n; exports.ENTRY_COUNT = _chunk7O5DWH3Mcjs.h; exports.EXPERIENCES = _chunk7O5DWH3Mcjs.Sa; exports.EnrichPrivacyRequest = _chunkNAGRUVXKcjs.b; exports.EnricherInput = _chunkQEM6S2W7cjs.e; exports.FETCH_CONSENT_MANAGER = _chunk7O5DWH3Mcjs._a; exports.FETCH_CONSENT_MANAGER_ID = _chunk7O5DWH3Mcjs.Za; exports.FETCH_CONSENT_MANAGER_THEME = _chunk7O5DWH3Mcjs.$a; exports.FETCH_PRIVACY_CENTER_ID = _chunk7O5DWH3Mcjs.yb; exports.FieldInput = _chunkQEM6S2W7cjs.v; exports.GLOBAL_ACTION_ITEMS = _chunk7O5DWH3Mcjs.vb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunk7O5DWH3Mcjs.Ha; exports.IDENTIFIERS = _chunk7O5DWH3Mcjs.s; exports.IDENTIFIER_BLOCK_LIST = _chunk7O5DWH3Mcjs.dc; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunk7O5DWH3Mcjs.fa; exports.INITIALIZER = _chunk7O5DWH3Mcjs.o; exports.IP_ADDRESS_REGEX = _chunkDCBE53LGcjs.f; exports.IS_REQUIRED = _chunk7O5DWH3Mcjs.fc; exports.IdentifierInput = _chunkQEM6S2W7cjs.H; exports.ImportOnetrustAssessmentsInput = _chunkQEM6S2W7cjs.ra; exports.IntlMessage = _chunk7O5DWH3Mcjs.nf; exports.IntlMessageInput = _chunkQEM6S2W7cjs.P; exports.LARGE_LANGUAGE_MODELS = _chunk7O5DWH3Mcjs.Fb; exports.LOGIN = _chunk7O5DWH3Mcjs.Db; exports.MESSAGES = _chunk7O5DWH3Mcjs._; exports.NEW_IDENTIFIER_TYPES = _chunk7O5DWH3Mcjs.t; exports.NONE = _chunk7O5DWH3Mcjs.ac; exports.NOTIFY_ADDITIONAL_TIME = _chunk7O5DWH3Mcjs.Z; exports.ORGANIZATION = _chunk7O5DWH3Mcjs.K; exports.OneTrustFileFormat = _chunkQ7I37FJVcjs.a; exports.OneTrustPullResource = _chunkQ7I37FJVcjs.b; exports.OneTrustPullSource = _chunkQ7I37FJVcjs.c; exports.OpenAIEnabledRoute = _chunkQEM6S2W7cjs.ma; exports.OpenAIEnabledRoutes = _chunkQEM6S2W7cjs.na; exports.OpenAIIntegration = _chunkQEM6S2W7cjs.oa; exports.OpenAIRouteName = _chunkQ7I37FJVcjs.f; exports.POLICIES = _chunk7O5DWH3Mcjs.T; exports.PREFERENCE_TOPICS = _chunk7O5DWH3Mcjs.ha; exports.PRIVACY_CENTER = _chunk7O5DWH3Mcjs.Ab; exports.PROCESSING_ACTIVITIES = _chunk7O5DWH3Mcjs.Yb; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunk7O5DWH3Mcjs.Vb; exports.PROMPTS = _chunk7O5DWH3Mcjs.ja; exports.PROMPTS_WITH_VARIABLES = _chunk7O5DWH3Mcjs.ma; exports.PROMPT_GROUPS = _chunk7O5DWH3Mcjs.la; exports.PROMPT_PARTIALS = _chunk7O5DWH3Mcjs.ka; exports.PROMPT_THREADS = _chunk7O5DWH3Mcjs.S; exports.PURPOSES = _chunk7O5DWH3Mcjs.ga; exports.ParsedAttributeInput = _chunk7O5DWH3Mcjs.oc; exports.PartitionInput = _chunkQEM6S2W7cjs.L; exports.PathfinderPolicy = _chunkQEM6S2W7cjs.pa; exports.PathfinderPolicyName = _chunkQ7I37FJVcjs.e; exports.PathfinderPolicyNameC = _chunkQEM6S2W7cjs.la; exports.PathfinderPromptRunMetadata = _chunkQEM6S2W7cjs.qa; exports.PolicyInput = _chunkQEM6S2W7cjs.O; exports.PrivacyCenterInput = _chunkQEM6S2W7cjs.N; exports.PrivacyRequest = _chunk7O5DWH3Mcjs.id; exports.PrivacyRequestInput = _chunk7O5DWH3Mcjs.kf; exports.PrivacyRequestResponse = _chunk7O5DWH3Mcjs.tf; exports.ProcessingActivityInput = _chunkQEM6S2W7cjs.A; exports.ProcessingPurposeInput = _chunkQEM6S2W7cjs.r; exports.ProcessingPurposePreviewInput = _chunkQEM6S2W7cjs.f; exports.PromptAVendorEmailSettings = _chunkQEM6S2W7cjs.x; exports.PromptGroupInput = _chunkQEM6S2W7cjs.u; exports.PromptInput = _chunkQEM6S2W7cjs.s; exports.PromptPartialInput = _chunkQEM6S2W7cjs.t; exports.PurposeMap = _chunkJZEDU4GZcjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunk7O5DWH3Mcjs.wa; exports.REMOVE_REQUEST_IDENTIFIERS = _chunk7O5DWH3Mcjs.Aa; exports.REPORT_PROMPT_RUN = _chunk7O5DWH3Mcjs.Fa; exports.REPOSITORIES = _chunk7O5DWH3Mcjs.A; exports.REQUESTS = _chunk7O5DWH3Mcjs.V; exports.REQUEST_DATA_SILOS = _chunk7O5DWH3Mcjs.ta; exports.REQUEST_ENRICHERS = _chunk7O5DWH3Mcjs.aa; exports.REQUEST_FILES = _chunk7O5DWH3Mcjs.Da; exports.REQUEST_IDENTIFIERS = _chunk7O5DWH3Mcjs.Ba; exports.RETRYABLE_BATCH_STATUSES = _chunkMFIMY5RYcjs.y; exports.RETRY_REQUEST_DATA_SILO = _chunk7O5DWH3Mcjs.va; exports.RETRY_REQUEST_ENRICHER = _chunk7O5DWH3Mcjs.ba; exports.RateCounter = _chunk7O5DWH3Mcjs.Uf; exports.RegionInput = _chunkQEM6S2W7cjs.z; exports.RepositoryInput = _chunkQEM6S2W7cjs.E; exports.RequestFileMetadata = _chunk7O5DWH3Mcjs.of; exports.RequestFileMetadataResponse = _chunk7O5DWH3Mcjs.pf; exports.RequestIdentifiersResponse = _chunk7O5DWH3Mcjs.gd; exports.RiskAssignmentInput = _chunkQEM6S2W7cjs.W; exports.RiskLogicInput = _chunkQEM6S2W7cjs.X; exports.SCOPES_BY_TITLE = _chunkMFIMY5RYcjs.w; exports.SCOPE_TITLES = _chunkMFIMY5RYcjs.x; exports.SET_RESOURCE_ATTRIBUTES = _chunk7O5DWH3Mcjs.Ra; exports.SKIP_REQUEST_ENRICHER = _chunk7O5DWH3Mcjs.ca; exports.SOFTWARE_DEVELOPMENT_KITS = _chunk7O5DWH3Mcjs.M; exports.SOMBRA_VERSION = _chunk7O5DWH3Mcjs.$b; exports.SUB_DATA_POINTS = _chunk7O5DWH3Mcjs.c; exports.SUB_DATA_POINTS_COUNT = _chunk7O5DWH3Mcjs.d; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunk7O5DWH3Mcjs.e; exports.SYNC_ATTRIBUTE_TYPES = _chunk7O5DWH3Mcjs.Kc; exports.SoftwareDevelopmentKitInput = _chunkQEM6S2W7cjs.B; exports.StoredApiKey = _chunkQEM6S2W7cjs.ha; exports.SuccessfulRequest = _chunk7O5DWH3Mcjs.ic; exports.TEAMS = _chunk7O5DWH3Mcjs.xa; exports.TEMPLATES = _chunk7O5DWH3Mcjs.I; exports.TOGGLE_CONSENT_PRECEDENCE = _chunk7O5DWH3Mcjs.kb; exports.TOGGLE_DATA_SUBJECT = _chunk7O5DWH3Mcjs.z; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunk7O5DWH3Mcjs.jb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunk7O5DWH3Mcjs.ib; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunk7O5DWH3Mcjs.hb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkMFIMY5RYcjs.u; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkMFIMY5RYcjs.t; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkMFIMY5RYcjs.v; exports.TeamInput = _chunkQEM6S2W7cjs.d; exports.TemplateInput = _chunkQEM6S2W7cjs.a; exports.TranscendInput = _chunkQEM6S2W7cjs.ga; exports.TranscendPromptManager = B; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunk7O5DWH3Mcjs.ub; exports.UPDATE_ACTION_ITEMS = _chunk7O5DWH3Mcjs.wb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunk7O5DWH3Mcjs.Ja; exports.UPDATE_AGENTS = _chunk7O5DWH3Mcjs.Ib; exports.UPDATE_AGENT_FILES = _chunk7O5DWH3Mcjs.Lb; exports.UPDATE_AGENT_FUNCTIONS = _chunk7O5DWH3Mcjs.Ob; exports.UPDATE_ATTRIBUTE = _chunk7O5DWH3Mcjs.Qa; exports.UPDATE_ATTRIBUTE_VALUES = _chunk7O5DWH3Mcjs.Ma; exports.UPDATE_BUSINESS_ENTITIES = _chunk7O5DWH3Mcjs.sb; exports.UPDATE_CODE_PACKAGES = _chunk7O5DWH3Mcjs.Q; exports.UPDATE_CONSENT_EXPERIENCE = _chunk7O5DWH3Mcjs.mb; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunk7O5DWH3Mcjs.eb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunk7O5DWH3Mcjs.fb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunk7O5DWH3Mcjs.lb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunk7O5DWH3Mcjs.cb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunk7O5DWH3Mcjs.bb; exports.UPDATE_DATA_FLOWS = _chunk7O5DWH3Mcjs.Va; exports.UPDATE_DATA_SILOS = _chunk7O5DWH3Mcjs.l; exports.UPDATE_DATA_SUBJECT = _chunk7O5DWH3Mcjs.y; exports.UPDATE_DATA_SUB_CATEGORIES = _chunk7O5DWH3Mcjs.Ub; exports.UPDATE_ENRICHER = _chunk7O5DWH3Mcjs.q; exports.UPDATE_IDENTIFIER = _chunk7O5DWH3Mcjs.v; exports.UPDATE_INTL_MESSAGES = _chunk7O5DWH3Mcjs.$; exports.UPDATE_LOAD_OPTIONS = _chunk7O5DWH3Mcjs.gb; exports.UPDATE_OR_CREATE_COOKIES = _chunk7O5DWH3Mcjs.Wa; exports.UPDATE_OR_CREATE_DATA_POINT = _chunk7O5DWH3Mcjs.f; exports.UPDATE_POLICIES = _chunk7O5DWH3Mcjs.U; exports.UPDATE_PRIVACY_CENTER = _chunk7O5DWH3Mcjs.Bb; exports.UPDATE_PRIVACY_REQUEST = _chunk7O5DWH3Mcjs.Y; exports.UPDATE_PROCESSING_ACTIVITIES = _chunk7O5DWH3Mcjs._b; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunk7O5DWH3Mcjs.Xb; exports.UPDATE_PROMPTS = _chunk7O5DWH3Mcjs.na; exports.UPDATE_PROMPT_GROUPS = _chunk7O5DWH3Mcjs.ra; exports.UPDATE_PROMPT_PARTIALS = _chunk7O5DWH3Mcjs.pa; exports.UPDATE_REPOSITORIES = _chunk7O5DWH3Mcjs.B; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunk7O5DWH3Mcjs.N; exports.UPDATE_TEAM = _chunk7O5DWH3Mcjs.za; exports.UPDATE_VENDORS = _chunk7O5DWH3Mcjs.Rb; exports.USERS = _chunk7O5DWH3Mcjs.Ca; exports.USP_STRING_REGEX = _chunkJZEDU4GZcjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkSW5CIF5Dcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkSW5CIF5Dcjs.a; exports.VENDORS = _chunk7O5DWH3Mcjs.Pb; exports.VendorInput = _chunkQEM6S2W7cjs.p; exports.WebhookHeader = _chunkQEM6S2W7cjs.b; exports.addMessagesToPromptRun = _chunk7O5DWH3Mcjs.tc; exports.appendCsvSync = _chunkLR3CPNDMcjs.b; exports.approvePrivacyRequests = _chunk7O5DWH3Mcjs.vf; exports.assumeRole = _chunk7O5DWH3Mcjs.Fd; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunk7O5DWH3Mcjs.vc; exports.buildTranscendGraphQLClientGeneric = _chunk7O5DWH3Mcjs.uc; exports.buildXdiSyncEndpoint = _chunkDCBE53LGcjs.g; exports.bulkRestartRequests = _chunk7O5DWH3Mcjs.Df; exports.bulkRetryEnrichers = _chunk7O5DWH3Mcjs.Ff; exports.cancelPrivacyRequests = _chunk7O5DWH3Mcjs.yf; exports.consentManagersToBusinessEntities = _chunkDCBE53LGcjs.h; exports.convertToDataSubjectAllowlist = _chunk7O5DWH3Mcjs.ud; exports.convertToDataSubjectBlockList = _chunk7O5DWH3Mcjs.td; exports.createActionItemCollection = _chunk7O5DWH3Mcjs.ee; exports.createActionItems = _chunk7O5DWH3Mcjs.he; exports.createAgent = _chunk7O5DWH3Mcjs.qe; exports.createAgentFile = _chunk7O5DWH3Mcjs.ke; exports.createAgentFunction = _chunk7O5DWH3Mcjs.ne; exports.createApiKey = _chunk7O5DWH3Mcjs.Gd; exports.createBusinessEntity = _chunk7O5DWH3Mcjs.ue; exports.createCodePackage = _chunk7O5DWH3Mcjs.De; exports.createConsentToken = _chunkJZEDU4GZcjs.a; exports.createDataCategory = _chunk7O5DWH3Mcjs.Ke; exports.createDataFlows = _chunk7O5DWH3Mcjs.Oe; exports.createProcessingPurpose = _chunk7O5DWH3Mcjs.Ye; exports.createPrompt = _chunk7O5DWH3Mcjs.$e; exports.createRegexForTag = j; exports.createRepository = _chunk7O5DWH3Mcjs.Ae; exports.createSoftwareDevelopmentKit = _chunk7O5DWH3Mcjs.xe; exports.createSombraGotInstance = _chunk7O5DWH3Mcjs.wc; exports.createTranscendConsentGotInstance = _chunk7O5DWH3Mcjs.xc; exports.createVendor = _chunk7O5DWH3Mcjs.cf; exports.defineTranscendPrompts = Sm; exports.deleteApiKey = _chunk7O5DWH3Mcjs.Hd; exports.deployConsentManager = _chunk7O5DWH3Mcjs.yc; exports.description = _chunkMFIMY5RYcjs.l; exports.domainToHost = _chunkDCBE53LGcjs.e; exports.downloadPrivacyRequestFiles = _chunk7O5DWH3Mcjs.sf; exports.enrichPrivacyRequest = _chunkNAGRUVXKcjs.c; exports.ensureAllDataSubjectsExist = _chunk7O5DWH3Mcjs.sd; exports.extractClientError = _chunk7O5DWH3Mcjs.Af; exports.extractErrorMessage = _chunk7O5DWH3Mcjs.Pf; exports.fetchActiveSiloDiscoPlugin = _chunk7O5DWH3Mcjs.Ac; exports.fetchAllActionItems = _chunk7O5DWH3Mcjs.Bc; exports.fetchAllActions = _chunk7O5DWH3Mcjs.Cc; exports.fetchAllAgentFiles = _chunk7O5DWH3Mcjs.Dc; exports.fetchAllAgentFunctions = _chunk7O5DWH3Mcjs.Ec; exports.fetchAllAgents = _chunk7O5DWH3Mcjs.Fc; exports.fetchAllApiKeys = _chunk7O5DWH3Mcjs.nd; exports.fetchAllAssessmentTemplates = _chunk7O5DWH3Mcjs.Hc; exports.fetchAllAssessments = _chunk7O5DWH3Mcjs.Gc; exports.fetchAllAttributeValues = _chunk7O5DWH3Mcjs.Jc; exports.fetchAllAttributes = _chunk7O5DWH3Mcjs.Lc; exports.fetchAllBusinessEntities = _chunk7O5DWH3Mcjs.Mc; exports.fetchAllCatalogs = _chunk7O5DWH3Mcjs.pd; exports.fetchAllCookies = _chunk7O5DWH3Mcjs.Tc; exports.fetchAllDataCategories = _chunk7O5DWH3Mcjs.Uc; exports.fetchAllDataFlows = _chunk7O5DWH3Mcjs.Vc; exports.fetchAllDataPoints = _chunk7O5DWH3Mcjs.Qd; exports.fetchAllDataSilos = _chunk7O5DWH3Mcjs.Od; exports.fetchAllDataSubjects = _chunk7O5DWH3Mcjs.rd; exports.fetchAllEnrichers = _chunk7O5DWH3Mcjs.Ud; exports.fetchAllIdentifiers = _chunk7O5DWH3Mcjs.Xf; exports.fetchAllMessages = _chunk7O5DWH3Mcjs.Wc; exports.fetchAllPolicies = _chunk7O5DWH3Mcjs.Zc; exports.fetchAllPreferenceTopics = _chunk7O5DWH3Mcjs._c; exports.fetchAllPrivacyCenters = _chunk7O5DWH3Mcjs.$c; exports.fetchAllProcessingActivities = _chunk7O5DWH3Mcjs.ad; exports.fetchAllProcessingPurposes = _chunk7O5DWH3Mcjs.bd; exports.fetchAllPromptGroups = _chunk7O5DWH3Mcjs.vd; exports.fetchAllPromptPartials = _chunk7O5DWH3Mcjs.wd; exports.fetchAllPromptThreads = _chunk7O5DWH3Mcjs.zd; exports.fetchAllPrompts = _chunk7O5DWH3Mcjs.xd; exports.fetchAllPurposes = _chunk7O5DWH3Mcjs.cd; exports.fetchAllPurposesAndPreferences = _chunk7O5DWH3Mcjs.dd; exports.fetchAllRequestAttributeKeys = _chunk7O5DWH3Mcjs.Ic; exports.fetchAllRequestEnrichers = _chunk7O5DWH3Mcjs.ed; exports.fetchAllRequestIdentifierMetadata = _chunk7O5DWH3Mcjs.fd; exports.fetchAllRequestIdentifiers = _chunk7O5DWH3Mcjs.hd; exports.fetchAllRequests = _chunk7O5DWH3Mcjs.jd; exports.fetchAllSubDataPoints = _chunk7O5DWH3Mcjs.Pd; exports.fetchAllTeams = _chunk7O5DWH3Mcjs.kd; exports.fetchAllTemplates = _chunk7O5DWH3Mcjs.Wd; exports.fetchAllUsers = _chunk7O5DWH3Mcjs.ld; exports.fetchAllVendors = _chunk7O5DWH3Mcjs.md; exports.fetchAndIndexCatalogs = _chunk7O5DWH3Mcjs.qd; exports.fetchApiKeys = _chunk7O5DWH3Mcjs.od; exports.fetchConsentManager = _chunk7O5DWH3Mcjs.Nc; exports.fetchConsentManagerAnalyticsData = _chunk7O5DWH3Mcjs.Rc; exports.fetchConsentManagerExperiences = _chunk7O5DWH3Mcjs.Pc; exports.fetchConsentManagerId = _chunk7O5DWH3Mcjs.Oc; exports.fetchConsentManagerTheme = _chunk7O5DWH3Mcjs.Sc; exports.fetchConsentPreferences = _chunkDCBE53LGcjs.j; exports.fetchEnrichedDataSilos = _chunk7O5DWH3Mcjs.Rd; exports.fetchIdentifiersAndCreateMissing = _chunk7O5DWH3Mcjs.Yf; exports.fetchPartitions = _chunk7O5DWH3Mcjs.Yd; exports.fetchPrivacyCenterId = _chunk7O5DWH3Mcjs.Yc; exports.fetchPrivacyCenterUrl = _chunk7O5DWH3Mcjs.Xc; exports.fetchPromptsWithVariables = _chunk7O5DWH3Mcjs.yd; exports.fetchRequestDataSilo = _chunk7O5DWH3Mcjs.Bd; exports.fetchRequestDataSiloActiveCount = _chunk7O5DWH3Mcjs.Cd; exports.fetchRequestDataSilos = _chunk7O5DWH3Mcjs.Ad; exports.fetchRequestFilesForRequest = _chunk7O5DWH3Mcjs.Dd; exports.filterNullishValuesFromObject = Qm; exports.filterRows = _chunk7O5DWH3Mcjs.sc; exports.fuzzyMatchColumns = _chunk7O5DWH3Mcjs.lc; exports.fuzzySearch = _chunk7O5DWH3Mcjs.kc; exports.generateCrossAccountApiKeys = _chunkOKLX7XKWcjs.a; exports.getErrorStatus = _chunk7O5DWH3Mcjs.Of; exports.getFileMetadataForPrivacyRequests = _chunk7O5DWH3Mcjs.qf; exports.getGitFilesThatChanged = Vm; exports.getUniqueValuesForColumn = _chunk7O5DWH3Mcjs.rc; exports.inquirerAutoComplete = _chunk7O5DWH3Mcjs.Mf; exports.inquirerConfirmBoolean = _chunk7O5DWH3Mcjs.Kf; exports.inquirerConfirmText = _chunk7O5DWH3Mcjs.Lf; exports.limitRecords = _chunk7O5DWH3Mcjs.Tf; exports.listDirectories = _chunkOKLX7XKWcjs.d; exports.listFiles = _chunkOKLX7XKWcjs.c; exports.loginUser = _chunk7O5DWH3Mcjs.Ed; exports.makeGraphQLRequest = _chunk7O5DWH3Mcjs.Wf; exports.mapColumnsToAttributes = _chunk7O5DWH3Mcjs.zf; exports.mapColumnsToIdentifiers = _chunk7O5DWH3Mcjs.xf; exports.mapCsvColumnsToApi = _chunk7O5DWH3Mcjs.hf; exports.mapCsvRowsToRequestInputs = _chunk7O5DWH3Mcjs.mf; exports.mapEnumValues = _chunk7O5DWH3Mcjs.mc; exports.mapRequestEnumValues = _chunk7O5DWH3Mcjs.if; exports.markCronIdentifierCompleted = _chunkKU3UCRAFcjs.d; exports.markRequestDataSiloIdsCompleted = _chunkKU3UCRAFcjs.f; exports.markSilentPrivacyRequests = _chunk7O5DWH3Mcjs.gf; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkMFIMY5RYcjs.n; exports.normalizeIdentifierValue = _chunk7O5DWH3Mcjs.lf; exports.notifyPrivacyRequestsAdditionalTime = _chunk7O5DWH3Mcjs.wf; exports.parseAssessmentDisplayLogic = _chunk7O5DWH3Mcjs.Ld; exports.parseAssessmentRiskLogic = _chunk7O5DWH3Mcjs.Nd; exports.parseAttributesFromString = _chunk7O5DWH3Mcjs.pc; exports.parseFilePath = _chunkLR3CPNDMcjs.d; exports.parseVariablesFromString = _chunk7O5DWH3Mcjs.Nf; exports.pullAllDatapoints = _chunkLPUZGMB6cjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkKU3UCRAFcjs.g; exports.pullConsentManagerMetrics = _chunkDCBE53LGcjs.d; exports.pullCronPageOfIdentifiers = _chunkKU3UCRAFcjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkNAGRUVXKcjs.a; exports.pullPrivacyRequests = _chunk7O5DWH3Mcjs.Hf; exports.pullTranscendConfiguration = _chunk7O5DWH3Mcjs.$d; exports.pullUnstructuredSubDataPointRecommendations = _chunkLPUZGMB6cjs.b; exports.pushCronIdentifiersFromCsv = _chunkKU3UCRAFcjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkNAGRUVXKcjs.d; exports.readCsv = _chunk7O5DWH3Mcjs.qc; exports.readSafe = _chunk7O5DWH3Mcjs.Vf; exports.readTranscendYaml = _chunkSW5CIF5Dcjs.d; exports.removeLinks = Bm; exports.removeUnverifiedRequestIdentifiers = _chunk7O5DWH3Mcjs.Jf; exports.replaceVariablesInYaml = _chunkSW5CIF5Dcjs.c; exports.reportPromptRun = _chunk7O5DWH3Mcjs.ae; exports.restartPrivacyRequest = _chunk7O5DWH3Mcjs.Cf; exports.retryRequestDataSilos = _chunk7O5DWH3Mcjs.Gf; exports.retryRequestEnricher = _chunk7O5DWH3Mcjs.be; exports.retrySamePromise = _chunk7O5DWH3Mcjs.Sf; exports.setResourceAttributes = _chunk7O5DWH3Mcjs.ce; exports.skipPreflightJobs = _chunk7O5DWH3Mcjs.Ef; exports.skipRequestDataSilos = _chunk7O5DWH3Mcjs.If; exports.sleepPromise = _chunk7O5DWH3Mcjs.Qf; exports.splitCsvToList = _chunk7O5DWH3Mcjs.nc; exports.splitInHalf = _chunk7O5DWH3Mcjs.Rf; exports.streamPrivacyRequestFiles = _chunk7O5DWH3Mcjs.rf; exports.submitPrivacyRequest = _chunk7O5DWH3Mcjs.uf; exports.syncAction = _chunk7O5DWH3Mcjs.de; exports.syncActionItemCollections = _chunk7O5DWH3Mcjs.ge; exports.syncActionItems = _chunk7O5DWH3Mcjs.je; exports.syncAgentFiles = _chunk7O5DWH3Mcjs.me; exports.syncAgentFunctions = _chunk7O5DWH3Mcjs.pe; exports.syncAgents = _chunk7O5DWH3Mcjs.se; exports.syncAttribute = _chunk7O5DWH3Mcjs.te; exports.syncBusinessEntities = _chunk7O5DWH3Mcjs.we; exports.syncCodePackages = _chunk7O5DWH3Mcjs.Fe; exports.syncConfigurationToTranscend = _chunk7O5DWH3Mcjs.Zf; exports.syncConsentManager = _chunk7O5DWH3Mcjs.He; exports.syncConsentManagerExperiences = _chunk7O5DWH3Mcjs.Ge; exports.syncCookies = _chunk7O5DWH3Mcjs.Je; exports.syncDataCategories = _chunk7O5DWH3Mcjs.Me; exports.syncDataFlows = _chunk7O5DWH3Mcjs.Pe; exports.syncDataSiloDependencies = _chunk7O5DWH3Mcjs.Td; exports.syncDataSilos = _chunk7O5DWH3Mcjs.Sd; exports.syncDataSubject = _chunk7O5DWH3Mcjs.Qe; exports.syncEnricher = _chunk7O5DWH3Mcjs.Vd; exports.syncIdentifier = _chunk7O5DWH3Mcjs.Re; exports.syncIntlMessages = _chunk7O5DWH3Mcjs.Te; exports.syncPartitions = _chunk7O5DWH3Mcjs.Zd; exports.syncPolicies = _chunk7O5DWH3Mcjs.Ve; exports.syncPrivacyCenter = _chunk7O5DWH3Mcjs.We; exports.syncProcessingActivities = _chunk7O5DWH3Mcjs.Xe; exports.syncProcessingPurposes = _chunk7O5DWH3Mcjs._e; exports.syncPrompts = _chunk7O5DWH3Mcjs.bf; exports.syncRepositories = _chunk7O5DWH3Mcjs.Ce; exports.syncSoftwareDevelopmentKits = _chunk7O5DWH3Mcjs.ze; exports.syncTemplate = _chunk7O5DWH3Mcjs.Xd; exports.syncVendors = _chunk7O5DWH3Mcjs.ef; exports.updateActionItem = _chunk7O5DWH3Mcjs.ie; exports.updateActionItemCollection = _chunk7O5DWH3Mcjs.fe; exports.updateAgentFiles = _chunk7O5DWH3Mcjs.le; exports.updateAgentFunctions = _chunk7O5DWH3Mcjs.oe; exports.updateAgents = _chunk7O5DWH3Mcjs.re; exports.updateBusinessEntities = _chunk7O5DWH3Mcjs.ve; exports.updateCodePackages = _chunk7O5DWH3Mcjs.Ee; exports.updateConsentManagerToLatest = _chunk7O5DWH3Mcjs.zc; exports.updateConsentManagerVersionToLatest = _chunkDCBE53LGcjs.a; exports.updateDataCategories = _chunk7O5DWH3Mcjs.Le; exports.updateDataFlows = _chunk7O5DWH3Mcjs.Ne; exports.updateIntlMessages = _chunk7O5DWH3Mcjs.Se; exports.updateOrCreateCookies = _chunk7O5DWH3Mcjs.Ie; exports.updatePolicies = _chunk7O5DWH3Mcjs.Ue; exports.updateProcessingPurposes = _chunk7O5DWH3Mcjs.Ze; exports.updatePrompts = _chunk7O5DWH3Mcjs.af; exports.updateRepositories = _chunk7O5DWH3Mcjs.Be; exports.updateSoftwareDevelopmentKits = _chunk7O5DWH3Mcjs.ye; exports.updateVendors = _chunk7O5DWH3Mcjs.df; exports.uploadConsents = _chunkJZEDU4GZcjs.f; exports.uploadCookiesFromCsv = _chunkDCBE53LGcjs.c; exports.uploadDataFlowsFromCsv = _chunkDCBE53LGcjs.b; exports.uploadPrivacyRequestsFromCsv = _chunk7O5DWH3Mcjs.Bf; exports.uploadSiloDiscoveryResults = _chunk7O5DWH3Mcjs.ff; exports.validateTranscendAuth = _chunkOKLX7XKWcjs.b; exports.version = _chunkMFIMY5RYcjs.m; exports.writeCsv = _chunkLR3CPNDMcjs.c; exports.writeCsvSync = _chunkLR3CPNDMcjs.a; exports.writeLargeCsv = _chunkLR3CPNDMcjs.e; exports.writeTranscendYaml = _chunkSW5CIF5Dcjs.e;
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=_chunkE57K4DGXcjs.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 = _chunkRSN3DUTPcjs.tb; exports.ADD_MESSAGES_TO_PROMPT_RUN = _chunkRSN3DUTPcjs.Ga; exports.ADD_SILO_DISCOVERY_RESULTS = _chunkRSN3DUTPcjs.G; exports.ADMIN_DASH = _chunkE57K4DGXcjs.o; exports.ADMIN_DASH_DATAPOINTS = _chunkE57K4DGXcjs.q; exports.ADMIN_DASH_INTEGRATIONS = _chunkE57K4DGXcjs.p; exports.AGENTS = _chunkRSN3DUTPcjs.Gb; exports.AGENT_FILES = _chunkRSN3DUTPcjs.Jb; exports.AGENT_FUNCTIONS = _chunkRSN3DUTPcjs.Mb; exports.API_KEYS = _chunkRSN3DUTPcjs.D; exports.APPROVE_PRIVACY_REQUEST = _chunkRSN3DUTPcjs.W; exports.ASSESSMENTS = _chunkRSN3DUTPcjs.ea; exports.ASSESSMENT_SECTION_FIELDS = _chunkRSN3DUTPcjs.da; exports.ASSESSMENT_TEMPLATES = _chunkRSN3DUTPcjs.ia; exports.ASSUME_ROLE = _chunkRSN3DUTPcjs.Eb; exports.ATTRIBUTES = _chunkRSN3DUTPcjs.Ka; exports.ATTRIBUTE_KEYS_REQUESTS = _chunkRSN3DUTPcjs.L; exports.ATTRIBUTE_VALUES = _chunkRSN3DUTPcjs.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 = _chunkRSN3DUTPcjs.Ld; exports.AssessmentAnswerOptionInput = _chunkQEM6S2W7cjs.Y; exports.AssessmentDisplayLogicInput = _chunkQEM6S2W7cjs.V; exports.AssessmentInput = _chunkQEM6S2W7cjs.ca; exports.AssessmentNestedRule = _chunkRSN3DUTPcjs.Kd; exports.AssessmentNestedRuleInput = _chunkQEM6S2W7cjs.U; exports.AssessmentResourceInput = _chunkQEM6S2W7cjs.ba; exports.AssessmentRetentionScheduleInput = _chunkQEM6S2W7cjs.$; exports.AssessmentRiskLogic = _chunkRSN3DUTPcjs.Nd; exports.AssessmentRule = _chunkRSN3DUTPcjs.Jd; exports.AssessmentRuleInput = _chunkQEM6S2W7cjs.T; exports.AssessmentSectionInput = _chunkQEM6S2W7cjs._; exports.AssessmentSectionQuestionInput = _chunkQEM6S2W7cjs.Z; exports.AssessmentTemplateInput = _chunkQEM6S2W7cjs.aa; exports.AttestedExtraIdentifiers = _chunkRSN3DUTPcjs.kf; exports.AttributeInput = _chunkQEM6S2W7cjs.k; exports.AttributePreview = _chunkQEM6S2W7cjs.l; exports.AttributeValueInput = _chunkQEM6S2W7cjs.j; exports.BLANK = _chunkRSN3DUTPcjs.cc; exports.BULK_APPLY = _chunkRSN3DUTPcjs.bc; exports.BULK_REQUEST_FILES = _chunkRSN3DUTPcjs.Ea; exports.BUSINESS_ENTITIES = _chunkRSN3DUTPcjs.qb; exports.BusinessEntityInput = _chunkQEM6S2W7cjs.y; exports.CANCEL_PRIVACY_REQUEST = _chunkRSN3DUTPcjs.X; exports.CAN_APPLY_IN_BULK = _chunkRSN3DUTPcjs.gc; exports.CATALOGS = _chunkRSN3DUTPcjs.r; exports.CHANGE_REQUEST_DATA_SILO_STATUS = _chunkRSN3DUTPcjs.ua; exports.CODE_PACKAGES = _chunkRSN3DUTPcjs.P; exports.CONSENT_MANAGER_ANALYTICS_DATA = _chunkRSN3DUTPcjs.pb; exports.CONSENT_PARTITIONS = _chunkRSN3DUTPcjs.Ta; exports.COOKIES = _chunkRSN3DUTPcjs.Ya; exports.CREATE_ACTION_ITEMS = _chunkRSN3DUTPcjs.xb; exports.CREATE_ACTION_ITEM_COLLECTION = _chunkRSN3DUTPcjs.Ia; exports.CREATE_AGENT = _chunkRSN3DUTPcjs.Hb; exports.CREATE_AGENT_FILE = _chunkRSN3DUTPcjs.Kb; exports.CREATE_AGENT_FUNCTION = _chunkRSN3DUTPcjs.Nb; exports.CREATE_API_KEY = _chunkRSN3DUTPcjs.E; exports.CREATE_ATTRIBUTE = _chunkRSN3DUTPcjs.Pa; exports.CREATE_ATTRIBUTE_VALUES = _chunkRSN3DUTPcjs.La; exports.CREATE_BUSINESS_ENTITY = _chunkRSN3DUTPcjs.rb; exports.CREATE_CODE_PACKAGE = _chunkRSN3DUTPcjs.R; exports.CREATE_CONSENT_EXPERIENCE = _chunkRSN3DUTPcjs.nb; exports.CREATE_CONSENT_MANAGER = _chunkRSN3DUTPcjs.ab; exports.CREATE_CONSENT_PARTITION = _chunkRSN3DUTPcjs.ob; exports.CREATE_DATA_FLOWS = _chunkRSN3DUTPcjs.Ua; exports.CREATE_DATA_SILOS = _chunkRSN3DUTPcjs.m; exports.CREATE_DATA_SUBJECT = _chunkRSN3DUTPcjs.x; exports.CREATE_DATA_SUB_CATEGORY = _chunkRSN3DUTPcjs.Tb; exports.CREATE_ENRICHER = _chunkRSN3DUTPcjs.p; exports.CREATE_IDENTIFIER = _chunkRSN3DUTPcjs.u; exports.CREATE_PROCESSING_ACTIVITY = _chunkRSN3DUTPcjs.Zb; exports.CREATE_PROCESSING_PURPOSE_SUB_CATEGORY = _chunkRSN3DUTPcjs.Wb; exports.CREATE_PROMPT = _chunkRSN3DUTPcjs.oa; exports.CREATE_PROMPT_GROUP = _chunkRSN3DUTPcjs.sa; exports.CREATE_PROMPT_PARTIAL = _chunkRSN3DUTPcjs.qa; exports.CREATE_REPOSITORY = _chunkRSN3DUTPcjs.C; exports.CREATE_SOFTWARE_DEVELOPMENT_KIT = _chunkRSN3DUTPcjs.O; exports.CREATE_TEAM = _chunkRSN3DUTPcjs.ya; exports.CREATE_TEMPLATE = _chunkRSN3DUTPcjs.J; exports.CREATE_VENDOR = _chunkRSN3DUTPcjs.Qb; exports.CachedFileState = _chunkRSN3DUTPcjs.hc; exports.CachedRequestState = _chunkRSN3DUTPcjs.jc; exports.CodePackageInput = _chunkQEM6S2W7cjs.D; exports.CodePackageSdk = _chunkQEM6S2W7cjs.C; exports.ColumnName = _chunkRSN3DUTPcjs.ec; exports.ConsentManageExperienceInput = _chunkQEM6S2W7cjs.K; exports.ConsentManagerInput = _chunkQEM6S2W7cjs.M; exports.ConsentManagerMetricBin = _chunkRSN3DUTPcjs.Qc; exports.ConsentManagerServiceMetadata = _chunkQEM6S2W7cjs.ka; exports.ConsentPreferenceResponse = _chunk2VX4QD73cjs.i; exports.ConsentPreferenceTopic = _chunkQEM6S2W7cjs.ea; exports.ConsentPreferenceTopicOptionValue = _chunkQEM6S2W7cjs.da; exports.ConsentPurpose = _chunkQEM6S2W7cjs.fa; exports.CookieCsvInput = _chunkQEM6S2W7cjs.ja; exports.CookieInput = _chunkQEM6S2W7cjs.J; exports.CronIdentifier = _chunkHBKA5Z5Acjs.a; exports.CronIdentifierPush = _chunkHBKA5Z5Acjs.c; exports.DATAPOINT_EXPORT = _chunkRSN3DUTPcjs.g; exports.DATA_FLOWS = _chunkRSN3DUTPcjs.Xa; exports.DATA_POINTS = _chunkRSN3DUTPcjs.a; exports.DATA_POINT_COUNT = _chunkRSN3DUTPcjs.b; exports.DATA_SILOS = _chunkRSN3DUTPcjs.i; exports.DATA_SILOS_ENRICHED = _chunkRSN3DUTPcjs.k; exports.DATA_SILO_EXPORT = _chunkRSN3DUTPcjs.j; exports.DATA_SUBJECTS = _chunkRSN3DUTPcjs.w; exports.DATA_SUB_CATEGORIES = _chunkRSN3DUTPcjs.Sb; exports.DEBUG = _chunkE57K4DGXcjs.z; exports.DEFAULT_TRANSCEND_API = _chunkE57K4DGXcjs.r; exports.DEFAULT_TRANSCEND_CONSENT_API = _chunkE57K4DGXcjs.s; exports.DEFAULT_TRANSCEND_PULL_RESOURCES = _chunkRSN3DUTPcjs.$d; exports.DELETE_API_KEY = _chunkRSN3DUTPcjs.F; exports.DELETE_ATTRIBUTE_VALUE = _chunkRSN3DUTPcjs.Na; exports.DEPLOYED_PRIVACY_CENTER_URL = _chunkRSN3DUTPcjs.zb; exports.DEPLOY_CONSENT_MANAGER = _chunkRSN3DUTPcjs.db; exports.DETERMINE_LOGIN_METHOD = _chunkRSN3DUTPcjs.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 = _chunkRSN3DUTPcjs.H; exports.ENRICHERS = _chunkRSN3DUTPcjs.n; exports.ENTRY_COUNT = _chunkRSN3DUTPcjs.h; exports.EXPERIENCES = _chunkRSN3DUTPcjs.Sa; exports.EnrichPrivacyRequest = _chunkK2E6TCB5cjs.b; exports.EnricherInput = _chunkQEM6S2W7cjs.e; exports.FETCH_CONSENT_MANAGER = _chunkRSN3DUTPcjs._a; exports.FETCH_CONSENT_MANAGER_ID = _chunkRSN3DUTPcjs.Za; exports.FETCH_CONSENT_MANAGER_THEME = _chunkRSN3DUTPcjs.$a; exports.FETCH_PRIVACY_CENTER_ID = _chunkRSN3DUTPcjs.yb; exports.FieldInput = _chunkQEM6S2W7cjs.v; exports.GLOBAL_ACTION_ITEMS = _chunkRSN3DUTPcjs.vb; exports.GLOBAL_ACTION_ITEM_COLLECTIONS = _chunkRSN3DUTPcjs.Ha; exports.IDENTIFIERS = _chunkRSN3DUTPcjs.s; exports.IDENTIFIER_BLOCK_LIST = _chunkRSN3DUTPcjs.dc; exports.IMPORT_ONE_TRUST_ASSESSMENT_FORMS = _chunkRSN3DUTPcjs.fa; exports.INITIALIZER = _chunkRSN3DUTPcjs.o; exports.IP_ADDRESS_REGEX = _chunk2VX4QD73cjs.f; exports.IS_REQUIRED = _chunkRSN3DUTPcjs.fc; exports.IdentifierInput = _chunkQEM6S2W7cjs.H; exports.ImportOnetrustAssessmentsInput = _chunkQEM6S2W7cjs.ra; exports.IntlMessage = _chunkRSN3DUTPcjs.of; exports.IntlMessageInput = _chunkQEM6S2W7cjs.P; exports.LARGE_LANGUAGE_MODELS = _chunkRSN3DUTPcjs.Fb; exports.LOGIN = _chunkRSN3DUTPcjs.Db; exports.MESSAGES = _chunkRSN3DUTPcjs._; exports.NEW_IDENTIFIER_TYPES = _chunkRSN3DUTPcjs.t; exports.NONE = _chunkRSN3DUTPcjs.ac; exports.NOTIFY_ADDITIONAL_TIME = _chunkRSN3DUTPcjs.Z; exports.ORGANIZATION = _chunkRSN3DUTPcjs.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 = _chunkRSN3DUTPcjs.T; exports.PREFERENCE_TOPICS = _chunkRSN3DUTPcjs.ha; exports.PRIVACY_CENTER = _chunkRSN3DUTPcjs.Ab; exports.PROCESSING_ACTIVITIES = _chunkRSN3DUTPcjs.Yb; exports.PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkRSN3DUTPcjs.Vb; exports.PROMPTS = _chunkRSN3DUTPcjs.ja; exports.PROMPTS_WITH_VARIABLES = _chunkRSN3DUTPcjs.ma; exports.PROMPT_GROUPS = _chunkRSN3DUTPcjs.la; exports.PROMPT_PARTIALS = _chunkRSN3DUTPcjs.ka; exports.PROMPT_THREADS = _chunkRSN3DUTPcjs.S; exports.PURPOSES = _chunkRSN3DUTPcjs.ga; exports.ParsedAttributeInput = _chunkRSN3DUTPcjs.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 = _chunkRSN3DUTPcjs.jd; exports.PrivacyRequestInput = _chunkRSN3DUTPcjs.lf; exports.PrivacyRequestResponse = _chunkRSN3DUTPcjs.uf; 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 = _chunk4GRQMYW2cjs.e; exports.REDUCED_REQUESTS_FOR_DATA_SILO_COUNT = _chunkRSN3DUTPcjs.wa; exports.REMOVE_REQUEST_IDENTIFIERS = _chunkRSN3DUTPcjs.Aa; exports.REPORT_PROMPT_RUN = _chunkRSN3DUTPcjs.Fa; exports.REPOSITORIES = _chunkRSN3DUTPcjs.A; exports.REQUESTS = _chunkRSN3DUTPcjs.V; exports.REQUEST_DATA_SILOS = _chunkRSN3DUTPcjs.ta; exports.REQUEST_ENRICHERS = _chunkRSN3DUTPcjs.aa; exports.REQUEST_FILES = _chunkRSN3DUTPcjs.Da; exports.REQUEST_IDENTIFIERS = _chunkRSN3DUTPcjs.Ba; exports.RETRYABLE_BATCH_STATUSES = _chunkE57K4DGXcjs.y; exports.RETRY_REQUEST_DATA_SILO = _chunkRSN3DUTPcjs.va; exports.RETRY_REQUEST_ENRICHER = _chunkRSN3DUTPcjs.ba; exports.RateCounter = _chunkRSN3DUTPcjs.Vf; exports.RegionInput = _chunkQEM6S2W7cjs.z; exports.RepositoryInput = _chunkQEM6S2W7cjs.E; exports.RequestFileMetadata = _chunkRSN3DUTPcjs.pf; exports.RequestFileMetadataResponse = _chunkRSN3DUTPcjs.qf; exports.RequestIdentifiersResponse = _chunkRSN3DUTPcjs.hd; exports.RiskAssignmentInput = _chunkQEM6S2W7cjs.W; exports.RiskLogicInput = _chunkQEM6S2W7cjs.X; exports.SCOPES_BY_TITLE = _chunkE57K4DGXcjs.w; exports.SCOPE_TITLES = _chunkE57K4DGXcjs.x; exports.SET_RESOURCE_ATTRIBUTES = _chunkRSN3DUTPcjs.Ra; exports.SKIP_REQUEST_ENRICHER = _chunkRSN3DUTPcjs.ca; exports.SOFTWARE_DEVELOPMENT_KITS = _chunkRSN3DUTPcjs.M; exports.SOMBRA_VERSION = _chunkRSN3DUTPcjs.$b; exports.SUB_DATA_POINTS = _chunkRSN3DUTPcjs.c; exports.SUB_DATA_POINTS_COUNT = _chunkRSN3DUTPcjs.d; exports.SUB_DATA_POINTS_WITH_GUESSES = _chunkRSN3DUTPcjs.e; exports.SYNC_ATTRIBUTE_TYPES = _chunkRSN3DUTPcjs.Kc; exports.SoftwareDevelopmentKitInput = _chunkQEM6S2W7cjs.B; exports.StoredApiKey = _chunkQEM6S2W7cjs.ha; exports.SuccessfulRequest = _chunkRSN3DUTPcjs.ic; exports.TEAMS = _chunkRSN3DUTPcjs.xa; exports.TEMPLATES = _chunkRSN3DUTPcjs.I; exports.TOGGLE_CONSENT_PRECEDENCE = _chunkRSN3DUTPcjs.kb; exports.TOGGLE_DATA_SUBJECT = _chunkRSN3DUTPcjs.z; exports.TOGGLE_TELEMETRY_PARTITION_STRATEGY = _chunkRSN3DUTPcjs.jb; exports.TOGGLE_UNKNOWN_COOKIE_POLICY = _chunkRSN3DUTPcjs.ib; exports.TOGGLE_UNKNOWN_REQUEST_POLICY = _chunkRSN3DUTPcjs.hb; exports.TR_PULL_RESOURCE_SCOPE_MAP = _chunkE57K4DGXcjs.u; exports.TR_PUSH_RESOURCE_SCOPE_MAP = _chunkE57K4DGXcjs.t; exports.TR_YML_RESOURCE_TO_FIELD_NAME = _chunkE57K4DGXcjs.v; exports.TeamInput = _chunkQEM6S2W7cjs.d; exports.TemplateInput = _chunkQEM6S2W7cjs.a; exports.TranscendInput = _chunkQEM6S2W7cjs.ga; exports.TranscendPromptManager = B; exports.TranscendPullResource = _chunkQ7I37FJVcjs.d; exports.UPDATE_ACTION = _chunkRSN3DUTPcjs.ub; exports.UPDATE_ACTION_ITEMS = _chunkRSN3DUTPcjs.wb; exports.UPDATE_ACTION_ITEM_COLLECTION = _chunkRSN3DUTPcjs.Ja; exports.UPDATE_AGENTS = _chunkRSN3DUTPcjs.Ib; exports.UPDATE_AGENT_FILES = _chunkRSN3DUTPcjs.Lb; exports.UPDATE_AGENT_FUNCTIONS = _chunkRSN3DUTPcjs.Ob; exports.UPDATE_ATTRIBUTE = _chunkRSN3DUTPcjs.Qa; exports.UPDATE_ATTRIBUTE_VALUES = _chunkRSN3DUTPcjs.Ma; exports.UPDATE_BUSINESS_ENTITIES = _chunkRSN3DUTPcjs.sb; exports.UPDATE_CODE_PACKAGES = _chunkRSN3DUTPcjs.Q; exports.UPDATE_CONSENT_EXPERIENCE = _chunkRSN3DUTPcjs.mb; exports.UPDATE_CONSENT_MANAGER_DOMAINS = _chunkRSN3DUTPcjs.eb; exports.UPDATE_CONSENT_MANAGER_PARTITION = _chunkRSN3DUTPcjs.fb; exports.UPDATE_CONSENT_MANAGER_THEME = _chunkRSN3DUTPcjs.lb; exports.UPDATE_CONSENT_MANAGER_TO_LATEST = _chunkRSN3DUTPcjs.cb; exports.UPDATE_CONSENT_MANAGER_VERSION = _chunkRSN3DUTPcjs.bb; exports.UPDATE_DATA_FLOWS = _chunkRSN3DUTPcjs.Va; exports.UPDATE_DATA_SILOS = _chunkRSN3DUTPcjs.l; exports.UPDATE_DATA_SUBJECT = _chunkRSN3DUTPcjs.y; exports.UPDATE_DATA_SUB_CATEGORIES = _chunkRSN3DUTPcjs.Ub; exports.UPDATE_ENRICHER = _chunkRSN3DUTPcjs.q; exports.UPDATE_IDENTIFIER = _chunkRSN3DUTPcjs.v; exports.UPDATE_INTL_MESSAGES = _chunkRSN3DUTPcjs.$; exports.UPDATE_LOAD_OPTIONS = _chunkRSN3DUTPcjs.gb; exports.UPDATE_OR_CREATE_COOKIES = _chunkRSN3DUTPcjs.Wa; exports.UPDATE_OR_CREATE_DATA_POINT = _chunkRSN3DUTPcjs.f; exports.UPDATE_POLICIES = _chunkRSN3DUTPcjs.U; exports.UPDATE_PRIVACY_CENTER = _chunkRSN3DUTPcjs.Bb; exports.UPDATE_PRIVACY_REQUEST = _chunkRSN3DUTPcjs.Y; exports.UPDATE_PROCESSING_ACTIVITIES = _chunkRSN3DUTPcjs._b; exports.UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = _chunkRSN3DUTPcjs.Xb; exports.UPDATE_PROMPTS = _chunkRSN3DUTPcjs.na; exports.UPDATE_PROMPT_GROUPS = _chunkRSN3DUTPcjs.ra; exports.UPDATE_PROMPT_PARTIALS = _chunkRSN3DUTPcjs.pa; exports.UPDATE_REPOSITORIES = _chunkRSN3DUTPcjs.B; exports.UPDATE_SOFTWARE_DEVELOPMENT_KITS = _chunkRSN3DUTPcjs.N; exports.UPDATE_TEAM = _chunkRSN3DUTPcjs.za; exports.UPDATE_VENDORS = _chunkRSN3DUTPcjs.Rb; exports.USERS = _chunkRSN3DUTPcjs.Ca; exports.USP_STRING_REGEX = _chunk4GRQMYW2cjs.d; exports.VARIABLE_PARAMETERS_NAME = _chunkSW5CIF5Dcjs.b; exports.VARIABLE_PARAMETERS_REGEXP = _chunkSW5CIF5Dcjs.a; exports.VENDORS = _chunkRSN3DUTPcjs.Pb; exports.VendorInput = _chunkQEM6S2W7cjs.p; exports.WebhookHeader = _chunkQEM6S2W7cjs.b; exports.addMessagesToPromptRun = _chunkRSN3DUTPcjs.tc; exports.appendCsvSync = _chunkLR3CPNDMcjs.b; exports.approvePrivacyRequests = _chunkRSN3DUTPcjs.wf; exports.assumeRole = _chunkRSN3DUTPcjs.Gd; exports.buildAIIntegrationType = _chunkLCDYXJN6cjs.b; exports.buildEnabledRouteType = _chunkLCDYXJN6cjs.a; exports.buildTranscendGraphQLClient = _chunkRSN3DUTPcjs.vc; exports.buildTranscendGraphQLClientGeneric = _chunkRSN3DUTPcjs.uc; exports.buildXdiSyncEndpoint = _chunk2VX4QD73cjs.g; exports.bulkRestartRequests = _chunkRSN3DUTPcjs.Ef; exports.bulkRetryEnrichers = _chunkRSN3DUTPcjs.Gf; exports.cancelPrivacyRequests = _chunkRSN3DUTPcjs.zf; exports.consentManagersToBusinessEntities = _chunk2VX4QD73cjs.h; exports.convertToDataSubjectAllowlist = _chunkRSN3DUTPcjs.vd; exports.convertToDataSubjectBlockList = _chunkRSN3DUTPcjs.ud; exports.createActionItemCollection = _chunkRSN3DUTPcjs.fe; exports.createActionItems = _chunkRSN3DUTPcjs.ie; exports.createAgent = _chunkRSN3DUTPcjs.re; exports.createAgentFile = _chunkRSN3DUTPcjs.le; exports.createAgentFunction = _chunkRSN3DUTPcjs.oe; exports.createApiKey = _chunkRSN3DUTPcjs.Hd; exports.createBusinessEntity = _chunkRSN3DUTPcjs.ve; exports.createCodePackage = _chunkRSN3DUTPcjs.Ee; exports.createConsentToken = _chunk4GRQMYW2cjs.a; exports.createDataCategory = _chunkRSN3DUTPcjs.Le; exports.createDataFlows = _chunkRSN3DUTPcjs.Pe; exports.createProcessingPurpose = _chunkRSN3DUTPcjs.Ze; exports.createPrompt = _chunkRSN3DUTPcjs.af; exports.createRegexForTag = j; exports.createRepository = _chunkRSN3DUTPcjs.Be; exports.createSoftwareDevelopmentKit = _chunkRSN3DUTPcjs.ye; exports.createSombraGotInstance = _chunkRSN3DUTPcjs.wc; exports.createTranscendConsentGotInstance = _chunkRSN3DUTPcjs.xc; exports.createVendor = _chunkRSN3DUTPcjs.df; exports.defineTranscendPrompts = Bm; exports.deleteApiKey = _chunkRSN3DUTPcjs.Id; exports.deployConsentManager = _chunkRSN3DUTPcjs.yc; exports.description = _chunkE57K4DGXcjs.l; exports.domainToHost = _chunk2VX4QD73cjs.e; exports.downloadPrivacyRequestFiles = _chunkRSN3DUTPcjs.tf; exports.enrichPrivacyRequest = _chunkK2E6TCB5cjs.c; exports.ensureAllDataSubjectsExist = _chunkRSN3DUTPcjs.td; exports.extractClientError = _chunkRSN3DUTPcjs.Bf; exports.extractErrorMessage = _chunkRSN3DUTPcjs.Qf; exports.fetchActiveSiloDiscoPlugin = _chunkRSN3DUTPcjs.Ac; exports.fetchAllActionItems = _chunkRSN3DUTPcjs.Bc; exports.fetchAllActions = _chunkRSN3DUTPcjs.Cc; exports.fetchAllAgentFiles = _chunkRSN3DUTPcjs.Dc; exports.fetchAllAgentFunctions = _chunkRSN3DUTPcjs.Ec; exports.fetchAllAgents = _chunkRSN3DUTPcjs.Fc; exports.fetchAllApiKeys = _chunkRSN3DUTPcjs.od; exports.fetchAllAssessmentTemplates = _chunkRSN3DUTPcjs.Hc; exports.fetchAllAssessments = _chunkRSN3DUTPcjs.Gc; exports.fetchAllAttributeValues = _chunkRSN3DUTPcjs.Jc; exports.fetchAllAttributes = _chunkRSN3DUTPcjs.Lc; exports.fetchAllBusinessEntities = _chunkRSN3DUTPcjs.Mc; exports.fetchAllCatalogs = _chunkRSN3DUTPcjs.qd; exports.fetchAllCookies = _chunkRSN3DUTPcjs.Tc; exports.fetchAllDataCategories = _chunkRSN3DUTPcjs.Uc; exports.fetchAllDataFlows = _chunkRSN3DUTPcjs.Vc; exports.fetchAllDataPoints = _chunkRSN3DUTPcjs.Rd; exports.fetchAllDataSilos = _chunkRSN3DUTPcjs.Pd; exports.fetchAllDataSubjects = _chunkRSN3DUTPcjs.sd; exports.fetchAllEnrichers = _chunkRSN3DUTPcjs.Vd; exports.fetchAllIdentifiers = _chunkRSN3DUTPcjs.Yf; exports.fetchAllMessages = _chunkRSN3DUTPcjs.Wc; exports.fetchAllPolicies = _chunkRSN3DUTPcjs.Zc; exports.fetchAllPreferenceTopics = _chunkRSN3DUTPcjs.$c; exports.fetchAllPrivacyCenters = _chunkRSN3DUTPcjs.ad; exports.fetchAllProcessingActivities = _chunkRSN3DUTPcjs.bd; exports.fetchAllProcessingPurposes = _chunkRSN3DUTPcjs.cd; exports.fetchAllPromptGroups = _chunkRSN3DUTPcjs.wd; exports.fetchAllPromptPartials = _chunkRSN3DUTPcjs.xd; exports.fetchAllPromptThreads = _chunkRSN3DUTPcjs.Ad; exports.fetchAllPrompts = _chunkRSN3DUTPcjs.yd; exports.fetchAllPurposes = _chunkRSN3DUTPcjs.dd; exports.fetchAllPurposesAndPreferences = _chunkRSN3DUTPcjs.ed; exports.fetchAllRequestAttributeKeys = _chunkRSN3DUTPcjs.Ic; exports.fetchAllRequestEnrichers = _chunkRSN3DUTPcjs.fd; exports.fetchAllRequestIdentifierMetadata = _chunkRSN3DUTPcjs.gd; exports.fetchAllRequestIdentifiers = _chunkRSN3DUTPcjs.id; exports.fetchAllRequests = _chunkRSN3DUTPcjs.kd; exports.fetchAllSubDataPoints = _chunkRSN3DUTPcjs.Qd; exports.fetchAllTeams = _chunkRSN3DUTPcjs.ld; exports.fetchAllTemplates = _chunkRSN3DUTPcjs.Xd; exports.fetchAllUsers = _chunkRSN3DUTPcjs.md; exports.fetchAllVendors = _chunkRSN3DUTPcjs.nd; exports.fetchAndIndexCatalogs = _chunkRSN3DUTPcjs.rd; exports.fetchApiKeys = _chunkRSN3DUTPcjs.pd; exports.fetchConsentManager = _chunkRSN3DUTPcjs.Nc; exports.fetchConsentManagerAnalyticsData = _chunkRSN3DUTPcjs.Rc; exports.fetchConsentManagerExperiences = _chunkRSN3DUTPcjs.Pc; exports.fetchConsentManagerId = _chunkRSN3DUTPcjs.Oc; exports.fetchConsentManagerTheme = _chunkRSN3DUTPcjs.Sc; exports.fetchConsentPreferences = _chunk2VX4QD73cjs.j; exports.fetchEnrichedDataSilos = _chunkRSN3DUTPcjs.Sd; exports.fetchIdentifiersAndCreateMissing = _chunkRSN3DUTPcjs.Zf; exports.fetchPartitions = _chunkRSN3DUTPcjs.Zd; exports.fetchPrivacyCenterId = _chunkRSN3DUTPcjs.Yc; exports.fetchPrivacyCenterUrl = _chunkRSN3DUTPcjs.Xc; exports.fetchPromptsWithVariables = _chunkRSN3DUTPcjs.zd; exports.fetchRequestDataSilo = _chunkRSN3DUTPcjs.Cd; exports.fetchRequestDataSiloActiveCount = _chunkRSN3DUTPcjs.Dd; exports.fetchRequestDataSilos = _chunkRSN3DUTPcjs.Bd; exports.fetchRequestFilesForRequest = _chunkRSN3DUTPcjs.Ed; exports.filterNullishValuesFromObject = Um; exports.filterRows = _chunkRSN3DUTPcjs.sc; exports.formatAttributeValues = _chunkRSN3DUTPcjs._c; exports.fuzzyMatchColumns = _chunkRSN3DUTPcjs.lc; exports.fuzzySearch = _chunkRSN3DUTPcjs.kc; exports.generateCrossAccountApiKeys = _chunkNKFAEQ2Qcjs.a; exports.getErrorStatus = _chunkRSN3DUTPcjs.Pf; exports.getFileMetadataForPrivacyRequests = _chunkRSN3DUTPcjs.rf; exports.getGitFilesThatChanged = vm; exports.getUniqueValuesForColumn = _chunkRSN3DUTPcjs.rc; exports.inquirerAutoComplete = _chunkRSN3DUTPcjs.Nf; exports.inquirerConfirmBoolean = _chunkRSN3DUTPcjs.Lf; exports.inquirerConfirmText = _chunkRSN3DUTPcjs.Mf; exports.limitRecords = _chunkRSN3DUTPcjs.Uf; exports.listDirectories = _chunkNKFAEQ2Qcjs.d; exports.listFiles = _chunkNKFAEQ2Qcjs.c; exports.loginUser = _chunkRSN3DUTPcjs.Fd; exports.makeGraphQLRequest = _chunkRSN3DUTPcjs.Xf; exports.mapColumnsToAttributes = _chunkRSN3DUTPcjs.Af; exports.mapColumnsToIdentifiers = _chunkRSN3DUTPcjs.yf; exports.mapCsvColumnsToApi = _chunkRSN3DUTPcjs.if; exports.mapCsvRowsToRequestInputs = _chunkRSN3DUTPcjs.nf; exports.mapEnumValues = _chunkRSN3DUTPcjs.mc; exports.mapRequestEnumValues = _chunkRSN3DUTPcjs.jf; exports.markCronIdentifierCompleted = _chunkHBKA5Z5Acjs.d; exports.markRequestDataSiloIdsCompleted = _chunkHBKA5Z5Acjs.f; exports.markSilentPrivacyRequests = _chunkRSN3DUTPcjs.hf; exports.mergeTranscendInputs = _chunkIBTP5OXEcjs.a; exports.name = _chunkE57K4DGXcjs.n; exports.normalizeIdentifierValue = _chunkRSN3DUTPcjs.mf; exports.notifyPrivacyRequestsAdditionalTime = _chunkRSN3DUTPcjs.xf; exports.parseAssessmentDisplayLogic = _chunkRSN3DUTPcjs.Md; exports.parseAssessmentRiskLogic = _chunkRSN3DUTPcjs.Od; exports.parseAttributesFromString = _chunkRSN3DUTPcjs.pc; exports.parseFilePath = _chunkLR3CPNDMcjs.d; exports.parseVariablesFromString = _chunkRSN3DUTPcjs.Of; exports.pullAllDatapoints = _chunkOCNPZWYTcjs.a; exports.pullChunkedCustomSiloOutstandingIdentifiers = _chunkHBKA5Z5Acjs.g; exports.pullConsentManagerMetrics = _chunk2VX4QD73cjs.d; exports.pullCronPageOfIdentifiers = _chunkHBKA5Z5Acjs.b; exports.pullManualEnrichmentIdentifiersToCsv = _chunkK2E6TCB5cjs.a; exports.pullPrivacyRequests = _chunkRSN3DUTPcjs.If; exports.pullTranscendConfiguration = _chunkRSN3DUTPcjs.ae; exports.pullUnstructuredSubDataPointRecommendations = _chunkOCNPZWYTcjs.b; exports.pushCronIdentifiersFromCsv = _chunkHBKA5Z5Acjs.e; exports.pushManualEnrichmentIdentifiersFromCsv = _chunkK2E6TCB5cjs.d; exports.readCsv = _chunkRSN3DUTPcjs.qc; exports.readSafe = _chunkRSN3DUTPcjs.Wf; exports.readTranscendYaml = _chunkSW5CIF5Dcjs.d; exports.removeLinks = Qm; exports.removeUnverifiedRequestIdentifiers = _chunkRSN3DUTPcjs.Kf; exports.replaceVariablesInYaml = _chunkSW5CIF5Dcjs.c; exports.reportPromptRun = _chunkRSN3DUTPcjs.be; exports.restartPrivacyRequest = _chunkRSN3DUTPcjs.Df; exports.retryRequestDataSilos = _chunkRSN3DUTPcjs.Hf; exports.retryRequestEnricher = _chunkRSN3DUTPcjs.ce; exports.retrySamePromise = _chunkRSN3DUTPcjs.Tf; exports.setResourceAttributes = _chunkRSN3DUTPcjs.de; exports.skipPreflightJobs = _chunkRSN3DUTPcjs.Ff; exports.skipRequestDataSilos = _chunkRSN3DUTPcjs.Jf; exports.sleepPromise = _chunkRSN3DUTPcjs.Rf; exports.splitCsvToList = _chunkRSN3DUTPcjs.nc; exports.splitInHalf = _chunkRSN3DUTPcjs.Sf; exports.streamPrivacyRequestFiles = _chunkRSN3DUTPcjs.sf; exports.submitPrivacyRequest = _chunkRSN3DUTPcjs.vf; exports.syncAction = _chunkRSN3DUTPcjs.ee; exports.syncActionItemCollections = _chunkRSN3DUTPcjs.he; exports.syncActionItems = _chunkRSN3DUTPcjs.ke; exports.syncAgentFiles = _chunkRSN3DUTPcjs.ne; exports.syncAgentFunctions = _chunkRSN3DUTPcjs.qe; exports.syncAgents = _chunkRSN3DUTPcjs.te; exports.syncAttribute = _chunkRSN3DUTPcjs.ue; exports.syncBusinessEntities = _chunkRSN3DUTPcjs.xe; exports.syncCodePackages = _chunkRSN3DUTPcjs.Ge; exports.syncConfigurationToTranscend = _chunkRSN3DUTPcjs._f; exports.syncConsentManager = _chunkRSN3DUTPcjs.Ie; exports.syncConsentManagerExperiences = _chunkRSN3DUTPcjs.He; exports.syncCookies = _chunkRSN3DUTPcjs.Ke; exports.syncDataCategories = _chunkRSN3DUTPcjs.Ne; exports.syncDataFlows = _chunkRSN3DUTPcjs.Qe; exports.syncDataSiloDependencies = _chunkRSN3DUTPcjs.Ud; exports.syncDataSilos = _chunkRSN3DUTPcjs.Td; exports.syncDataSubject = _chunkRSN3DUTPcjs.Re; exports.syncEnricher = _chunkRSN3DUTPcjs.Wd; exports.syncIdentifier = _chunkRSN3DUTPcjs.Se; exports.syncIntlMessages = _chunkRSN3DUTPcjs.Ue; exports.syncPartitions = _chunkRSN3DUTPcjs._d; exports.syncPolicies = _chunkRSN3DUTPcjs.We; exports.syncPrivacyCenter = _chunkRSN3DUTPcjs.Xe; exports.syncProcessingActivities = _chunkRSN3DUTPcjs.Ye; exports.syncProcessingPurposes = _chunkRSN3DUTPcjs.$e; exports.syncPrompts = _chunkRSN3DUTPcjs.cf; exports.syncRepositories = _chunkRSN3DUTPcjs.De; exports.syncSoftwareDevelopmentKits = _chunkRSN3DUTPcjs.Ae; exports.syncTemplate = _chunkRSN3DUTPcjs.Yd; exports.syncVendors = _chunkRSN3DUTPcjs.ff; exports.updateActionItem = _chunkRSN3DUTPcjs.je; exports.updateActionItemCollection = _chunkRSN3DUTPcjs.ge; exports.updateAgentFiles = _chunkRSN3DUTPcjs.me; exports.updateAgentFunctions = _chunkRSN3DUTPcjs.pe; exports.updateAgents = _chunkRSN3DUTPcjs.se; exports.updateBusinessEntities = _chunkRSN3DUTPcjs.we; exports.updateCodePackages = _chunkRSN3DUTPcjs.Fe; exports.updateConsentManagerToLatest = _chunkRSN3DUTPcjs.zc; exports.updateConsentManagerVersionToLatest = _chunk2VX4QD73cjs.a; exports.updateDataCategories = _chunkRSN3DUTPcjs.Me; exports.updateDataFlows = _chunkRSN3DUTPcjs.Oe; exports.updateIntlMessages = _chunkRSN3DUTPcjs.Te; exports.updateOrCreateCookies = _chunkRSN3DUTPcjs.Je; exports.updatePolicies = _chunkRSN3DUTPcjs.Ve; exports.updateProcessingPurposes = _chunkRSN3DUTPcjs._e; exports.updatePrompts = _chunkRSN3DUTPcjs.bf; exports.updateRepositories = _chunkRSN3DUTPcjs.Ce; exports.updateSoftwareDevelopmentKits = _chunkRSN3DUTPcjs.ze; exports.updateVendors = _chunkRSN3DUTPcjs.ef; exports.uploadConsents = _chunk4GRQMYW2cjs.f; exports.uploadCookiesFromCsv = _chunk2VX4QD73cjs.c; exports.uploadDataFlowsFromCsv = _chunk2VX4QD73cjs.b; exports.uploadPrivacyRequestsFromCsv = _chunkRSN3DUTPcjs.Cf; exports.uploadSiloDiscoveryResults = _chunkRSN3DUTPcjs.gf; exports.validateTranscendAuth = _chunkNKFAEQ2Qcjs.b; exports.version = _chunkE57K4DGXcjs.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":"AAAA,6OAAiE,wDAAkD,wDAA0C,wDAA0E,wDAAkE,wDAA0F,wDAA0E,wDAAkH,wDAAkE,wDAAknB,wDAA4xG,wDAAgD,gCAA6B,wDAA+K,wDAA4E,qDCOh1J,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"]}
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"]}