@transcend-io/cli 8.25.3 → 8.26.0

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 (126) hide show
  1. package/README.md +53 -13
  2. package/dist/bin/bash-complete.cjs +1 -1
  3. package/dist/bin/cli.cjs +1 -1
  4. package/dist/bin/deprecated-command.cjs +2 -2
  5. package/dist/{chunk-HPERBM2R.cjs → chunk-2MHJ5LZ7.cjs} +2 -2
  6. package/dist/{chunk-HPERBM2R.cjs.map → chunk-2MHJ5LZ7.cjs.map} +1 -1
  7. package/dist/{chunk-EDVVHIFK.cjs → chunk-5TKJLZA2.cjs} +2 -2
  8. package/dist/{chunk-EDVVHIFK.cjs.map → chunk-5TKJLZA2.cjs.map} +1 -1
  9. package/dist/{chunk-FIBHN6CY.cjs → chunk-AZ4GTUNR.cjs} +22 -22
  10. package/dist/chunk-AZ4GTUNR.cjs.map +1 -0
  11. package/dist/{chunk-HJTYLFGJ.cjs → chunk-FTXFBDFW.cjs} +2 -2
  12. package/dist/{chunk-HJTYLFGJ.cjs.map → chunk-FTXFBDFW.cjs.map} +1 -1
  13. package/dist/{chunk-GLXV5XPP.cjs → chunk-K65NYGJM.cjs} +165 -162
  14. package/dist/chunk-K65NYGJM.cjs.map +1 -0
  15. package/dist/{chunk-FGBTRT4J.cjs → chunk-KOXU6674.cjs} +2 -2
  16. package/dist/{chunk-FGBTRT4J.cjs.map → chunk-KOXU6674.cjs.map} +1 -1
  17. package/dist/{chunk-GDPRENOQ.cjs → chunk-L32BTN2M.cjs} +4 -4
  18. package/dist/{chunk-GDPRENOQ.cjs.map → chunk-L32BTN2M.cjs.map} +1 -1
  19. package/dist/{chunk-DV57HBVO.cjs → chunk-L5QUUSVB.cjs} +4 -4
  20. package/dist/{chunk-DV57HBVO.cjs.map → chunk-L5QUUSVB.cjs.map} +1 -1
  21. package/dist/{chunk-UMAN3VT7.cjs → chunk-QAKUAPPO.cjs} +2 -2
  22. package/dist/{chunk-UMAN3VT7.cjs.map → chunk-QAKUAPPO.cjs.map} +1 -1
  23. package/dist/chunk-SONNKP33.cjs +12 -0
  24. package/dist/chunk-SONNKP33.cjs.map +1 -0
  25. package/dist/{chunk-C3ZJMA3A.cjs → chunk-U2XRCT7A.cjs} +2 -2
  26. package/dist/{chunk-C3ZJMA3A.cjs.map → chunk-U2XRCT7A.cjs.map} +1 -1
  27. package/dist/{chunk-7YR2TG7U.cjs → chunk-VEU5LPA6.cjs} +2 -2
  28. package/dist/{chunk-7YR2TG7U.cjs.map → chunk-VEU5LPA6.cjs.map} +1 -1
  29. package/dist/{chunk-5MIDKBL7.cjs → chunk-WGCFVEJZ.cjs} +2 -2
  30. package/dist/{chunk-5MIDKBL7.cjs.map → chunk-WGCFVEJZ.cjs.map} +1 -1
  31. package/dist/{chunk-G6QNUBBK.cjs → chunk-XN6WUCF4.cjs} +2 -2
  32. package/dist/{chunk-G6QNUBBK.cjs.map → chunk-XN6WUCF4.cjs.map} +1 -1
  33. package/dist/{impl-GRQJMVJE.cjs → impl-2CF2PKFH.cjs} +2 -2
  34. package/dist/{impl-GRQJMVJE.cjs.map → impl-2CF2PKFH.cjs.map} +1 -1
  35. package/dist/{impl-DRHYZQSB.cjs → impl-2XEHL54N.cjs} +2 -2
  36. package/dist/{impl-DRHYZQSB.cjs.map → impl-2XEHL54N.cjs.map} +1 -1
  37. package/dist/{impl-FJO7BPTB.cjs → impl-35DXHKNE.cjs} +2 -2
  38. package/dist/{impl-FJO7BPTB.cjs.map → impl-35DXHKNE.cjs.map} +1 -1
  39. package/dist/{impl-QYNAMOYS.cjs → impl-3BLJB5VJ.cjs} +2 -2
  40. package/dist/{impl-QYNAMOYS.cjs.map → impl-3BLJB5VJ.cjs.map} +1 -1
  41. package/dist/impl-3TTJGFRK.cjs +2 -0
  42. package/dist/{impl-O742JPYW.cjs.map → impl-3TTJGFRK.cjs.map} +1 -1
  43. package/dist/impl-43MGE5WS.cjs +2 -0
  44. package/dist/{impl-C3XI35SQ.cjs.map → impl-43MGE5WS.cjs.map} +1 -1
  45. package/dist/{impl-T7EXOBCA.cjs → impl-4GZIUG3H.cjs} +3 -3
  46. package/dist/{impl-T7EXOBCA.cjs.map → impl-4GZIUG3H.cjs.map} +1 -1
  47. package/dist/{impl-4MW5YXMP.cjs → impl-4VNXB52F.cjs} +2 -2
  48. package/dist/{impl-4MW5YXMP.cjs.map → impl-4VNXB52F.cjs.map} +1 -1
  49. package/dist/{impl-5FBCF5HY.cjs → impl-5PPLTGRY.cjs} +2 -2
  50. package/dist/{impl-5FBCF5HY.cjs.map → impl-5PPLTGRY.cjs.map} +1 -1
  51. package/dist/{impl-BPFDJMJY.cjs → impl-7TIKA2O6.cjs} +2 -2
  52. package/dist/{impl-BPFDJMJY.cjs.map → impl-7TIKA2O6.cjs.map} +1 -1
  53. package/dist/{impl-X6RMXDJS.cjs → impl-BEVLBZ2F.cjs} +2 -2
  54. package/dist/{impl-X6RMXDJS.cjs.map → impl-BEVLBZ2F.cjs.map} +1 -1
  55. package/dist/{impl-QTTAMUHI.cjs → impl-CCY7BINI.cjs} +2 -2
  56. package/dist/{impl-QTTAMUHI.cjs.map → impl-CCY7BINI.cjs.map} +1 -1
  57. package/dist/{impl-22JGFXXK.cjs → impl-DEQW3OGQ.cjs} +2 -2
  58. package/dist/{impl-22JGFXXK.cjs.map → impl-DEQW3OGQ.cjs.map} +1 -1
  59. package/dist/{impl-IQVMZJD7.cjs → impl-F2UNSOIO.cjs} +2 -2
  60. package/dist/{impl-IQVMZJD7.cjs.map → impl-F2UNSOIO.cjs.map} +1 -1
  61. package/dist/{impl-M6JBOLVE.cjs → impl-H3J7N77A.cjs} +2 -2
  62. package/dist/{impl-M6JBOLVE.cjs.map → impl-H3J7N77A.cjs.map} +1 -1
  63. package/dist/{impl-YM2OKSJ4.cjs → impl-HZJIVXWT.cjs} +2 -2
  64. package/dist/{impl-YM2OKSJ4.cjs.map → impl-HZJIVXWT.cjs.map} +1 -1
  65. package/dist/{impl-DVNUPZK7.cjs → impl-IQCQDDW7.cjs} +2 -2
  66. package/dist/{impl-DVNUPZK7.cjs.map → impl-IQCQDDW7.cjs.map} +1 -1
  67. package/dist/{impl-I6NMF5QP.cjs → impl-J3FUD3MS.cjs} +5 -5
  68. package/dist/{impl-I6NMF5QP.cjs.map → impl-J3FUD3MS.cjs.map} +1 -1
  69. package/dist/{impl-KJQDZ5CD.cjs → impl-JHP4RJZ4.cjs} +2 -2
  70. package/dist/{impl-KJQDZ5CD.cjs.map → impl-JHP4RJZ4.cjs.map} +1 -1
  71. package/dist/{impl-XWVPG2AO.cjs → impl-JK3TTCKR.cjs} +2 -2
  72. package/dist/{impl-XWVPG2AO.cjs.map → impl-JK3TTCKR.cjs.map} +1 -1
  73. package/dist/{impl-XUBKDJNI.cjs → impl-JYAKR5RR.cjs} +2 -2
  74. package/dist/{impl-XUBKDJNI.cjs.map → impl-JYAKR5RR.cjs.map} +1 -1
  75. package/dist/{impl-JTLAUUYX.cjs → impl-K6MYBWAY.cjs} +2 -2
  76. package/dist/{impl-JTLAUUYX.cjs.map → impl-K6MYBWAY.cjs.map} +1 -1
  77. package/dist/{impl-VINV2XOZ.cjs → impl-KZZC7P5D.cjs} +2 -2
  78. package/dist/{impl-VINV2XOZ.cjs.map → impl-KZZC7P5D.cjs.map} +1 -1
  79. package/dist/{impl-PVIVOTA4.cjs → impl-L74WP6LX.cjs} +2 -2
  80. package/dist/{impl-PVIVOTA4.cjs.map → impl-L74WP6LX.cjs.map} +1 -1
  81. package/dist/{impl-2HC6MNNN.cjs → impl-LUKG7ED6.cjs} +2 -2
  82. package/dist/{impl-2HC6MNNN.cjs.map → impl-LUKG7ED6.cjs.map} +1 -1
  83. package/dist/{impl-52NIQWXG.cjs → impl-MENWC3FS.cjs} +2 -2
  84. package/dist/{impl-52NIQWXG.cjs.map → impl-MENWC3FS.cjs.map} +1 -1
  85. package/dist/{impl-BA6B2C6M.cjs → impl-PK3DXVLW.cjs} +2 -2
  86. package/dist/{impl-BA6B2C6M.cjs.map → impl-PK3DXVLW.cjs.map} +1 -1
  87. package/dist/impl-QVM227RD.cjs +2 -0
  88. package/dist/impl-QVM227RD.cjs.map +1 -0
  89. package/dist/{impl-4CRBCTLC.cjs → impl-S2UBMTKQ.cjs} +2 -2
  90. package/dist/{impl-4CRBCTLC.cjs.map → impl-S2UBMTKQ.cjs.map} +1 -1
  91. package/dist/{impl-PAKRFLP6.cjs → impl-S6GUFHKS.cjs} +2 -2
  92. package/dist/{impl-PAKRFLP6.cjs.map → impl-S6GUFHKS.cjs.map} +1 -1
  93. package/dist/{impl-BGBHVFXR.cjs → impl-SAWOUYGV.cjs} +2 -2
  94. package/dist/{impl-BGBHVFXR.cjs.map → impl-SAWOUYGV.cjs.map} +1 -1
  95. package/dist/{impl-IXVIQGXK.cjs → impl-SBIOFGRE.cjs} +2 -2
  96. package/dist/{impl-IXVIQGXK.cjs.map → impl-SBIOFGRE.cjs.map} +1 -1
  97. package/dist/{impl-M7XLIXX7.cjs → impl-UR7MDG5O.cjs} +2 -2
  98. package/dist/{impl-M7XLIXX7.cjs.map → impl-UR7MDG5O.cjs.map} +1 -1
  99. package/dist/{impl-MSDEMRBZ.cjs → impl-UTDGC4UZ.cjs} +2 -2
  100. package/dist/{impl-MSDEMRBZ.cjs.map → impl-UTDGC4UZ.cjs.map} +1 -1
  101. package/dist/{impl-UDUTUFUT.cjs → impl-UTJTENWY.cjs} +2 -2
  102. package/dist/{impl-UDUTUFUT.cjs.map → impl-UTJTENWY.cjs.map} +1 -1
  103. package/dist/{impl-2YWGSU4V.cjs → impl-VEW5WAK7.cjs} +3 -3
  104. package/dist/{impl-2YWGSU4V.cjs.map → impl-VEW5WAK7.cjs.map} +1 -1
  105. package/dist/{impl-RVJLQVKI.cjs → impl-W33BLTPN.cjs} +2 -2
  106. package/dist/{impl-RVJLQVKI.cjs.map → impl-W33BLTPN.cjs.map} +1 -1
  107. package/dist/{impl-6BPL3Z3G.cjs → impl-WLYI6G4A.cjs} +4 -4
  108. package/dist/{impl-6BPL3Z3G.cjs.map → impl-WLYI6G4A.cjs.map} +1 -1
  109. package/dist/{impl-5Z557CRG.cjs → impl-X5JUJPG5.cjs} +2 -2
  110. package/dist/{impl-5Z557CRG.cjs.map → impl-X5JUJPG5.cjs.map} +1 -1
  111. package/dist/{impl-XCXP4S3J.cjs → impl-XJX7GD3G.cjs} +2 -2
  112. package/dist/{impl-XCXP4S3J.cjs.map → impl-XJX7GD3G.cjs.map} +1 -1
  113. package/dist/{impl-5H7LSGMO.cjs → impl-YZ6LZ2LI.cjs} +2 -2
  114. package/dist/{impl-5H7LSGMO.cjs.map → impl-YZ6LZ2LI.cjs.map} +1 -1
  115. package/dist/index.cjs +3 -3
  116. package/dist/index.cjs.map +1 -1
  117. package/dist/index.d.cts +21 -4
  118. package/package.json +2 -1
  119. package/dist/chunk-FIBHN6CY.cjs.map +0 -1
  120. package/dist/chunk-GLXV5XPP.cjs.map +0 -1
  121. package/dist/chunk-WO3KAASS.cjs +0 -12
  122. package/dist/chunk-WO3KAASS.cjs.map +0 -1
  123. package/dist/impl-C3XI35SQ.cjs +0 -2
  124. package/dist/impl-LVGKFMBD.cjs +0 -2
  125. package/dist/impl-LVGKFMBD.cjs.map +0 -1
  126. package/dist/impl-O742JPYW.cjs +0 -2
@@ -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,wDAA0F,wDAAkD,wDAA0C,wDAA0E,wDAAkG,wDAAkE,wDAAkE,wDAAknB,wDAAy9G,wDAAgD,gCAA6B,wDAAuL,wDAA4E,qDCO37J,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,E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,\n Requirize,\n apply,\n decodeCodec,\n getValues,\n} from '@transcend-io/type-utils';\nimport type { Handlebars } from '@transcend-io/handlebars-utils';\nimport { Secret } from '@transcend-io/secret-value';\nimport * as t from 'io-ts';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\nimport {\n Agent,\n AgentFile,\n AgentFileFilterBy,\n ReportPromptRunInput,\n buildTranscendGraphQLClient,\n fetchAllAgentFiles,\n fetchAllAgents,\n reportPromptRun,\n} from '../graphql';\nimport {\n HandlebarsInput,\n createHandlebarsWithHelpers,\n} from '@transcend-io/handlebars-utils';\nimport {\n TranscendPromptTemplated,\n TranscendPromptsAndVariables,\n fetchPromptsWithVariables,\n} from '../graphql/fetchPrompts';\nimport { GraphQLClient } from 'graphql-request';\nimport {\n PromptStatus,\n ChatCompletionRole,\n PromptRunProductArea,\n QueueStatus,\n LargeLanguageModelClient,\n} from '@transcend-io/privacy-types';\nimport {\n LargeLanguageModel,\n fetchAllLargeLanguageModels,\n} from '../graphql/fetchLargeLanguageModels';\nimport { groupBy, keyBy, uniq, chunk } from 'lodash-es';\nimport { mapSeries } from 'bluebird';\nimport {\n PromptThread,\n fetchAllPromptThreads,\n} from '../graphql/fetchPromptThreads';\n\n/**\n * An LLM Prompt definition\n */\nexport type TranscendPrompt<\n TInputParams extends t.Any,\n TOutputCodec extends t.Any,\n> = (\n | {\n /** ID of the prompt */\n id: string;\n /** Title of the prompt */\n title?: string;\n }\n | {\n /** ID of the prompt */\n id?: string;\n /** Title of the prompt */\n title: string;\n }\n) & {\n /** The names of the agents that should be loaded along with the prompt */\n agentNames?: string[];\n /** Codec to validate runtime input shape */\n paramCodec: TInputParams;\n /** Codec to validate output response */\n outputCodec: TOutputCodec;\n /**\n * If the output that needs to be parsed is returned within a tag\n * e.g. <tag> or <json> - this is the name of the tag\n */\n extractFromTag?: string;\n};\n\nexport interface PromptRunResult {\n /** The ID of the prompt run created on Transcend */\n promptRunId: string;\n /** The URL of the prompt run on Transcend */\n promptRunUrl: string;\n}\n\n/**\n * Create a regex to extract data from a tag\n *\n * Input:\n * \"here is some data <tag>Data</tag>...\"\n *\n * @param tagName - Name of tag\n * @returns Data within the tag\n */\nexport function createRegexForTag(tagName: string): RegExp {\n return new RegExp(`<${tagName}>([\\\\s\\\\S]+?)<\\\\/${tagName}>`);\n}\n\n/**\n * Helper function to declare prompts\n *\n * @param prompts - Prompt config\n * @returns Prompts as identity function - but type enforced\n */\nexport function defineTranscendPrompts<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n>(prompts: TPrompts): TPrompts {\n return prompts;\n}\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptParamType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['paramCodec']>;\n\n/**\n * Helper to get the type of the parameter for a given prompt\n */\nexport type GetPromptResponseType<\n TPromptName extends keyof TPrompts,\n TPrompts extends { [k in TPromptName]: TranscendPrompt<t.Any, t.Any> },\n> = t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n\n/**\n * Input for reporting a prompt run\n */\nexport interface ReportPromptRunOptions\n extends Optionalize<\n Omit<ReportPromptRunInput, 'status' | 'promptId' | 'largeLanguageModelId'>,\n 'name' | 'productArea'\n > {\n /** The large language model being run. Either the ID of the LLM or the client/name pairing */\n largeLanguageModel:\n | string\n | {\n /** Name of client */\n client: LargeLanguageModelClient;\n /** Name of the model */\n name: string;\n };\n}\n\nconst jsonParseSafe = (obj: string): unknown => {\n try {\n return JSON.parse(obj);\n } catch (e) {\n return obj;\n }\n};\n\n/**\n * A class that is capable of loading and insert variables into prompts from\n * Transcend's Prompt Manager\n */\nexport class TranscendPromptManager<\n TPromptNames extends string,\n TPrompts extends { [k in TPromptNames]: TranscendPrompt<t.Any, t.Any> },\n> {\n /** Prompt definitions */\n public prompts: TPrompts;\n\n /** Options for configuring handlebars */\n public handlebarsOptions!: HandlebarsInput;\n\n /** Prompt name -> content map, populated by call to Transcend API */\n public promptContentMap?: { [k in TPromptNames]: TranscendPromptTemplated };\n\n /** The large language models that are registered to this organization for reporting */\n public largeLanguageModels: LargeLanguageModel[] = [];\n\n /** The agent definitions registered to this organization */\n private agentsByName: { [name in string]: Agent } = {};\n\n /** The agent definitions registered to this organization */\n private agentsByAgentId: { [id in string]: Agent } = {};\n\n /** The GraphQL client that can be used to call Transcend */\n public graphQLClient: GraphQLClient;\n\n /** The set of variables to expose in handlebars context specified at class initiation */\n public defaultVariables: { [k in string]: unknown };\n\n /**\n * The set of variables to expose in handlebars context,\n * merges defaults with calculated variables from the inventory\n */\n public variables: { [k in string]: unknown };\n\n /** Handlebars compiler */\n public handlebars: typeof Handlebars;\n\n /** The Transcend API key */\n public transcendApiKey: string | Secret<string>;\n\n /** API of Transcend to call */\n public transcendUrl: string;\n\n /** When true, throw an error if the prompt is not approved */\n public requireApproval: boolean;\n\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n public cacheDuration?: number;\n\n /**\n * The last time the metadata was fetched\n */\n public lastUpdatedAt?: Date;\n\n /**\n * Constructor\n *\n * @param options - Options\n */\n constructor({\n prompts,\n handlebarsOptions = {},\n transcendUrl = DEFAULT_TRANSCEND_API,\n transcendApiKey,\n requireApproval = true,\n cacheDuration,\n defaultVariables = {},\n }: {\n /** Prompt definitions to load */\n prompts: TPrompts;\n /** Options for configuring handlebars */\n handlebarsOptions?: HandlebarsInput;\n /** The Transcend API key */\n transcendApiKey: string | Secret<string>;\n /** API of Transcend to call */\n transcendUrl?: string;\n /** When true, throw an error if the prompt is not approved */\n requireApproval?: boolean;\n /** The set of variables to expose in handlebars context specified at class initiation */\n defaultVariables?: { [k in string]: unknown };\n /**\n * The cache duration in ms for how long prompts and associated metadata should be cached\n * When undefined - prompts are cached indefinitely unless explicitly re-requested\n * When 0, prompts and metadata are fetched every time (not recommended)\n * Setting this to be an hour is a good rate that optimizes for performance and keeping up to date\n */\n cacheDuration?: number;\n }) {\n this.prompts = prompts;\n this.transcendUrl = transcendUrl;\n this.transcendApiKey = transcendApiKey;\n this.variables = defaultVariables;\n this.defaultVariables = defaultVariables;\n this.graphQLClient = buildTranscendGraphQLClient(\n transcendUrl,\n typeof transcendApiKey === 'object'\n ? transcendApiKey.release()\n : transcendApiKey,\n );\n this.requireApproval = requireApproval;\n this.cacheDuration = cacheDuration;\n this.handlebarsOptions = handlebarsOptions;\n this.handlebars = createHandlebarsWithHelpers(handlebarsOptions);\n }\n\n /**\n * Fetch prompt metadata from Transcend and cache to the class definition\n *\n * @returns A function that can be used to call the prompt\n */\n async fetchPromptsAndMetadata(): Promise<TranscendPromptsAndVariables> {\n // Determine what to fetch\n const promptDefinitions = getValues(this.prompts) as TranscendPrompt<\n t.Any,\n t.Any\n >[];\n const promptIds = promptDefinitions\n .map(({ id }) => id)\n .filter((x): x is string => !!x);\n const promptTitles = promptDefinitions\n .map(({ title }) => title)\n .filter((x): x is string => !!x);\n const agentNames = uniq(\n promptDefinitions.map(({ agentNames }) => agentNames || []).flat(),\n );\n\n // Fetch prompts and data\n const [response, largeLanguageModels, agents] = await Promise.all([\n fetchPromptsWithVariables(this.graphQLClient, {\n promptIds,\n promptTitles,\n }),\n fetchAllLargeLanguageModels(this.graphQLClient),\n fetchAllAgents(this.graphQLClient, { names: agentNames }),\n ]);\n this.agentsByName = keyBy(agents, 'name');\n this.agentsByAgentId = keyBy(agents, 'agentId');\n this.largeLanguageModels = largeLanguageModels.filter(\n (model) => model.isTranscendHosted === false,\n );\n\n // Lookup prompts by id/title\n const promptByTitle = keyBy(response.prompts, 'title');\n const promptById = keyBy(response.prompts, 'id');\n\n // Update variables\n this.variables = {\n ...response.calculatedVariables.reduce(\n (acc, v) =>\n Object.assign(acc, {\n [v.name]: v.data ? JSON.parse(v.data) : v.data,\n }),\n {},\n ),\n ...this.defaultVariables,\n };\n\n // Update partials\n this.handlebars = createHandlebarsWithHelpers({\n ...this.handlebarsOptions,\n templates: [\n ...(this.handlebarsOptions.templates || []),\n ...response.promptPartials.map((partial) => ({\n name: partial.slug,\n content: partial.content,\n })),\n ],\n });\n\n // Create mapping from prompt to content\n this.promptContentMap = apply(this.prompts, ({ id, title }) => {\n const result = id\n ? promptById[id]\n : title\n ? promptByTitle[title]\n : undefined;\n if (!result) {\n throw new Error(\n `Failed to find prompt with title: \"${title}\" and id: \"${id}\"`,\n );\n }\n return result;\n });\n\n // For cache\n this.lastUpdatedAt = new Date();\n\n return response;\n }\n\n /**\n * Get an agent definition by name\n *\n * @param name - Name of the agent to grab\n * @returns Large language model configuration\n */\n async getAgentByName(name: string): Promise<Agent | undefined> {\n const agent = this.agentsByName[name];\n if (agent) {\n return agent;\n }\n const [remoteAgent] = await fetchAllAgents(this.graphQLClient, {\n names: [name],\n });\n if (!remoteAgent) {\n return undefined;\n }\n this.agentsByName[remoteAgent.name] = remoteAgent;\n this.agentsByAgentId[remoteAgent.agentId] = remoteAgent;\n return remoteAgent;\n }\n\n /**\n * Get a prompt thread by ts\n *\n * @param ts - the slack message timestamp to look up thread for\n * @returns Large language model configuration\n */\n async getPromptThreadBySlackTs(\n ts: string,\n ): Promise<PromptThread | undefined> {\n const [thread] = await fetchAllPromptThreads(this.graphQLClient, {\n slackMessageTs: [ts],\n });\n return thread;\n }\n\n /**\n * Get a list of agent definitions by name.\n * Pulls from cache and may return less agents\n * than requested if some are not found\n *\n * @param names - Names of agents to fetch\n * @returns The agents that were found matching the names\n */\n async getAgentsByName(names: string[]): Promise<Agent[]> {\n if (names.length < 1) {\n throw new Error('Expected at least one name to be provided');\n }\n const { hasCache = [], missingCache = [] } = groupBy(names, (name) =>\n this.agentsByName[name] ? 'hasCache' : 'missingCache',\n );\n const cachedAgents = hasCache.map((name) => this.agentsByName[name]);\n if (missingCache.length === 0) {\n return cachedAgents;\n }\n const chunkedNames = chunk(missingCache, 50);\n const remoteAgents: Agent[] = [];\n await mapSeries(chunkedNames, async (chunkedName) => {\n const pageOfAgents = await fetchAllAgents(this.graphQLClient, {\n names: chunkedName,\n });\n pageOfAgents.forEach((agent) => {\n this.agentsByName[agent.name] = agent;\n this.agentsByAgentId[agent.agentId] = agent;\n });\n remoteAgents.push(...pageOfAgents);\n });\n return [...cachedAgents, ...remoteAgents];\n }\n\n /**\n * Fetch metadata on agent files\n *\n * @param filterBy - Filter by parameters\n * @returns The files found matching the filter\n */\n getAgentFiles(filterBy: AgentFileFilterBy): Promise<AgentFile[]> {\n return fetchAllAgentFiles(this.graphQLClient, filterBy);\n }\n\n /**\n * Look up the large language model to report on\n *\n * @param largeLanguageModel - Input\n * @returns Large language model configuration\n */\n getLargeLanguageModel(\n largeLanguageModel: ReportPromptRunOptions['largeLanguageModel'],\n ): LargeLanguageModel {\n const matching = this.largeLanguageModels.find((model) =>\n typeof largeLanguageModel === 'string'\n ? model.id === largeLanguageModel\n : model.name === largeLanguageModel.name &&\n model.client === largeLanguageModel.client,\n );\n if (!matching) {\n throw new Error(\n `Failed to find model matching: ${\n typeof largeLanguageModel === 'string'\n ? largeLanguageModel\n : JSON.stringify(largeLanguageModel)\n }`,\n );\n }\n return matching;\n }\n\n /**\n * Get a prompt definition by name\n *\n * @param promptName - Prompt to compile\n * @returns Parsed content\n */\n async getPromptDefinition<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n ): Promise<TranscendPromptTemplated> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n // Lookup prompt\n const { promptContentMap } = this;\n if (!promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n const promptTemplate = promptContentMap[promptName];\n if (!promptTemplate) {\n throw new Error(\n `Expected this.promptContentMap[${promptName}] to be defined`,\n );\n }\n return promptTemplate;\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to compile\n * @param params - Runtime parameters\n * @returns Parsed content\n */\n async compilePrompt<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n params: t.TypeOf<TPrompts[TPromptName]['paramCodec']>,\n ): Promise<string> {\n // Grab the prompt\n const promptTemplate = await this.getPromptDefinition(promptName);\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure prompt is approved\n if (\n this.requireApproval &&\n promptTemplate.status !== PromptStatus.Approved\n ) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because its in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // If prompt is rejected, throw error\n if (promptTemplate.status === PromptStatus.Rejected) {\n throw new Error(\n `Assessment \"${promptTemplate.title}\" cannot be used because it's in status: \"${promptTemplate.status}\"`,\n );\n }\n\n // Validate params\n decodeCodec(promptInput.paramCodec, params);\n\n // Compile prompt and template\n return this.handlebars.compile(promptTemplate.content)({\n // template in currentDate by default\n currentDate: new Date().toISOString(),\n ...this.variables,\n ...params,\n });\n }\n\n /**\n * Validate the shape of the response from AI\n *\n * @param promptName - Prompt to parse\n * @param response - AI response as string\n * @returns Parsed content\n */\n parseAiResponse<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n response: string,\n ): t.TypeOf<TPrompts[TPromptName]['outputCodec']> {\n // Look up prompt info\n const promptInput = this.prompts[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Extract from tag if needed\n const extracted = promptInput.extractFromTag\n ? (createRegexForTag(promptInput.extractFromTag).exec(response) ||\n [])[1] || response\n : response;\n\n // Parse via codec\n return decodeCodec(\n promptInput.outputCodec,\n jsonParseSafe(extracted),\n false,\n );\n }\n\n /**\n * Parse the AI response and report back to Transcend\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportAndParsePromptRun<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n { largeLanguageModel, ...options }: ReportPromptRunOptions,\n ): Promise<\n PromptRunResult & {\n /** Resulting prompt run */\n result: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n }\n > {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n if (\n options.promptRunMessages[options.promptRunMessages.length - 1].role !==\n ChatCompletionRole.Assistant\n ) {\n throw new Error(\n `promptRunMessages[${\n options.promptRunMessages.length - 1\n }].role is expected to be = ${ChatCompletionRole.Assistant}`,\n );\n }\n const response =\n options.promptRunMessages[options.promptRunMessages.length - 1].content;\n\n let parsed: t.TypeOf<TPrompts[TPromptName]['outputCodec']>;\n try {\n // Parse the response\n parsed = this.parseAiResponse(promptName, response);\n } catch (err) {\n await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n error: err.message,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n throw err;\n }\n\n // report successful run\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Resolved,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n result: parsed,\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n\n /**\n * Report an error for a particular prompt\n *\n * @param promptName - Prompt to parse\n * @param options - Options for reporting\n * @returns Parsed content\n */\n async reportPromptRunError<TPromptName extends TPromptNames>(\n promptName: TPromptName,\n {\n largeLanguageModel,\n ...options\n }: Requirize<ReportPromptRunOptions, 'error'>,\n ): Promise<PromptRunResult> {\n // Determine if prompts need to be fetched\n if (\n // never been fetched\n !this.lastUpdatedAt ||\n // fetch every run\n this.cacheDuration === 0 ||\n // If cache duration met\n (this.cacheDuration &&\n Date.now() - this.lastUpdatedAt.getTime() > this.cacheDuration)\n ) {\n await this.fetchPromptsAndMetadata();\n }\n\n const name =\n options.name ||\n `@transcend-io/cli-prompt-run-${new Date().toISOString()}`;\n\n if (!this.promptContentMap) {\n throw new Error('Expected this.promptContentMap to be defined');\n }\n // Look up prompt info\n const promptInput = this.promptContentMap[promptName];\n if (!promptInput) {\n throw new Error(`Expected this.prompts[${promptName}] to be defined`);\n }\n\n // Ensure the first message in `promptRunMessages` is of type=system\n if (options.promptRunMessages.length === 0) {\n throw new Error('promptRunMessages is expected to have length > 0');\n }\n if (options.promptRunMessages[0].role !== ChatCompletionRole.System) {\n throw new Error(\n `promptRunMessages[0].role is expected to be = ${ChatCompletionRole.System}`,\n );\n }\n\n const promptRunId = await reportPromptRun(this.graphQLClient, {\n productArea: PromptRunProductArea.PromptManager,\n ...options,\n name,\n status: QueueStatus.Error,\n ...(typeof largeLanguageModel === 'string'\n ? { largeLanguageModelId: largeLanguageModel }\n : {\n largeLanguageModelName: largeLanguageModel.name,\n largeLanguageModelClient: largeLanguageModel.client,\n }),\n promptId: promptInput.id,\n promptRunMessages: options.promptRunMessages.map((message, ind) => ({\n ...message,\n ...(ind === 0 ? { template: promptInput.content } : {}),\n })),\n });\n\n return {\n promptRunId,\n promptRunUrl: `https://app.transcend.io/prompts/runs/${promptRunId}`,\n };\n }\n}\n/* eslint-enable max-lines */\n","import { GraphQLClient } from 'graphql-request';\nimport { LargeLanguageModelClient } from '@transcend-io/privacy-types';\nimport { LARGE_LANGUAGE_MODELS } from './gqls';\nimport { makeGraphQLRequest } from './makeGraphQLRequest';\n\nexport interface LargeLanguageModel {\n /** ID of prompts */\n id: string;\n /** The name of the large language model. */\n name: string;\n /** The content of the prompt template. */\n client: LargeLanguageModelClient;\n /** Whether hosted by Transcend or not */\n isTranscendHosted: boolean;\n}\n\nconst PAGE_SIZE = 20;\n\n/**\n * Fetch all LargeLanguageModels in the organization\n *\n * @param client - GraphQL client\n * @returns All LargeLanguageModels in the organization\n */\nexport async function fetchAllLargeLanguageModels(\n client: GraphQLClient,\n): Promise<LargeLanguageModel[]> {\n const largeLanguageModels: LargeLanguageModel[] = [];\n let offset = 0;\n\n // Whether to continue looping\n let shouldContinue = false;\n do {\n const {\n largeLanguageModels: { nodes },\n } = await makeGraphQLRequest<{\n /** LargeLanguageModels */\n largeLanguageModels: {\n /** List */\n nodes: LargeLanguageModel[];\n };\n }>(client, LARGE_LANGUAGE_MODELS, {\n first: PAGE_SIZE,\n offset,\n });\n largeLanguageModels.push(...nodes);\n offset += PAGE_SIZE;\n shouldContinue = nodes.length === PAGE_SIZE;\n } while (shouldContinue);\n\n return largeLanguageModels.sort((a, b) => a.name.localeCompare(b.name));\n}\n","import { difference } from 'lodash-es';\nimport fastGlob from 'fast-glob';\nimport { execSync } from 'child_process';\n\n/**\n * Function thats gets the git files that have changed\n * and returns the code\n *\n * @param options - Options\n * @returns Changes files and diffs\n */\nexport function getGitFilesThatChanged({\n baseBranch,\n rootDirectory,\n githubRepo,\n excludedGlob = [],\n fileBlockList = [],\n}: {\n /** Base branch */\n baseBranch: string;\n /** Github repo name */\n githubRepo: string;\n /** Root directory */\n rootDirectory: string;\n /** A glob that excludes files */\n excludedGlob?: string[];\n /** Block list of files to not process */\n fileBlockList?: string[];\n}): {\n /** The list of files that changed */\n changedFiles: string[];\n /** Github repo name */\n repoName: string;\n /** Current commit */\n commit: string;\n /** File diffs */\n fileDiffs: { [k in string]: string };\n} {\n // Pull base branch\n execSync(`git fetch origin ${baseBranch}`);\n\n // Latest commit on base branch. If we are on the base branch, we take the prior commit\n const latestBasedCommit = execSync(\n `git ls-remote ${githubRepo} \"refs/heads/${baseBranch}\" | cut -f 1`,\n { encoding: 'utf-8' },\n ).split('\\n')[0];\n\n // This commit\n const latestThisCommit = execSync('git rev-parse HEAD', {\n encoding: 'utf-8',\n }).split('\\n')[0];\n\n // Ensure commits are present\n if (!latestBasedCommit || !latestThisCommit) {\n throw new Error('FAILED TO FIND COMMIT RANGE');\n }\n\n // Get the diff between the given branch and base branch\n const diff = execSync(\n `git fetch && git diff --name-only \"${\n baseBranch || latestBasedCommit\n }...${latestThisCommit}\" -- ${rootDirectory}`,\n { encoding: 'utf-8' },\n );\n\n // Filter out block list\n const changedFiles = difference(\n diff.split('\\n').filter((f) => f),\n fileBlockList,\n );\n\n // Filter out globs\n const filteredChanges =\n excludedGlob.length > 0\n ? fastGlob.sync(changedFiles, { ignore: excludedGlob })\n : changedFiles;\n\n // Get the contents of only the changed files\n const fileDiffs: { [k in string]: string } = {};\n filteredChanges.forEach((file) => {\n const contents = execSync(`git show ${latestThisCommit}:${file}`, {\n encoding: 'utf-8',\n });\n fileDiffs[file] = contents;\n });\n\n // Pull the github repo name\n const repoName = githubRepo.split('/').pop()!.split('.')[0];\n\n return {\n changedFiles,\n fileDiffs,\n repoName,\n commit: latestThisCommit,\n };\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/index.cjs","../src/lib/ai/TranscendPromptManager.ts","../src/lib/graphql/fetchLargeLanguageModels.ts","../src/lib/ai/getGitFilesThatChanged.ts"],"names":["PAGE_SIZE","fetchAllLargeLanguageModels","client","largeLanguageModels","offset","shouldContinue","nodes","makeGraphQLRequest","LARGE_LANGUAGE_MODELS","a","b","createRegexForTag","tagName","defineTranscendPrompts","prompts","jsonParseSafe","obj","TranscendPromptManager","handlebarsOptions","transcendUrl","DEFAULT_TRANSCEND_API","transcendApiKey","requireApproval","cacheDuration","defaultVariables","buildTranscendGraphQLClient","createHandlebarsWithHelpers","promptDefinitions","getValues","promptIds","id","x","promptTitles","title","agentNames","uniq_default","response","agents","fetchPromptsWithVariables","fetchAllAgents","keyBy_default","model","promptByTitle","promptById","acc","v","partial","apply","result","name","agent","remoteAgent","ts","thread","fetchAllPromptThreads","names","hasCache","missingCache","groupBy_default","cachedAgents","chunkedNames","chunk_default","remoteAgents","mapSeries","chunkedName","pageOfAgents","filterBy","fetchAllAgentFiles","largeLanguageModel","matching"],"mappings":"AAAA,6OAAiE,wDAA0F,wDAAkD,wDAA0C,wDAA0E,wDAAkG,wDAAkE,wDAAkE,wDAAknB,wDAA2+G,wDAAgD,gCAA6B,wDAAuL,wDAA4E,qDCO78J,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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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"]}
package/dist/index.d.cts CHANGED
@@ -145344,7 +145344,7 @@ declare function removeUnverifiedRequestIdentifiers({ requestActions, identifier
145344
145344
  }): Promise<number>;
145345
145345
 
145346
145346
  var description = "A command line interface for programmatic operations across Transcend.";
145347
- var version = "8.25.3";
145347
+ var version = "8.26.0";
145348
145348
 
145349
145349
  /**
145350
145350
  * The name of the main binary for the CLI
@@ -145895,8 +145895,24 @@ declare const addDaysUtc: (d: Date, n: number) => Date;
145895
145895
  */
145896
145896
  declare function writeCsvSync(filePath: string, data: ObjByString[], headers: string[]): void;
145897
145897
  /**
145898
- * Append data to an existing csv file synchronously
145899
- * Assumes the data structure matches the existing file
145898
+ * Initialize a CSV file by writing only the header row (or an empty file if no headers).
145899
+ *
145900
+ * @param filePath - CSV path
145901
+ * @param headers - Ordered list of column names; if empty, creates/empties the file
145902
+ */
145903
+ declare function initCsvFile(filePath: string, headers: string[]): void;
145904
+ /**
145905
+ * Append rows to CSV using an explicit header order (no header line).
145906
+ * Values are written in the order of `headerOrder`.
145907
+ *
145908
+ * @param filePath - CSV path
145909
+ * @param data - Row objects
145910
+ * @param headerOrder - Column order to apply
145911
+ */
145912
+ declare function appendCsvRowsOrdered(filePath: string, data: ObjByString[], headerOrder: string[]): void;
145913
+ /**
145914
+ * Append data to an existing csv file synchronously (legacy, uses Object.values order).
145915
+ * Prefer appendCsvRowsOrdered for deterministic column order.
145900
145916
  *
145901
145917
  * @param filePath - File to append to
145902
145918
  * @param data - Data to append
@@ -145924,6 +145940,7 @@ declare function parseFilePath(filePath: string): {
145924
145940
  };
145925
145941
  /**
145926
145942
  * Stream a large CSV dataset to a single file with proper backpressure handling.
145943
+ * (Kept for completeness; not used by the incremental write path.)
145927
145944
  *
145928
145945
  * @param filePath - File to write out to
145929
145946
  * @param data - Data to write (iterated without buffering the entire file content)
@@ -146651,4 +146668,4 @@ type EnrichPrivacyRequest = t.TypeOf<typeof EnrichPrivacyRequest>;
146651
146668
  */
146652
146669
  declare function enrichPrivacyRequest(sombra: Got, { id: rawId, ...rest }: EnrichPrivacyRequest, enricherId: string, index?: number): Promise<boolean>;
146653
146670
 
146654
- export { ACTIONS, ADD_MESSAGES_TO_PROMPT_RUN, ADD_SILO_DISCOVERY_RESULTS, ADMIN_DASH, ADMIN_DASH_DATAPOINTS, ADMIN_DASH_INTEGRATIONS, AGENTS, AGENT_FILES, AGENT_FUNCTIONS, type AIIntegrationC, API_KEYS, APPROVE_PRIVACY_REQUEST, ASSESSMENTS, ASSESSMENT_SECTION_FIELDS, ASSESSMENT_TEMPLATES, ASSUME_ROLE, ATTRIBUTES, ATTRIBUTE_KEYS_REQUESTS, ATTRIBUTE_VALUES, type Action, ActionInput, type ActionItem, ActionItemCollectionInput, ActionItemInput, type ActionItemRaw, type AddMessagesToPromptRunInput, type Agent, type AgentFile, type AgentFileFilterBy, AgentFileInput, type AgentFunction, AgentFunctionInput, AgentInput, type ApiKey, type ApiKeyGenerateError, ApiKeyInput, type Assessment, AssessmentAction, type AssessmentAnswer, type AssessmentAnswerOption, AssessmentAnswerOptionInput, type AssessmentComment, AssessmentDisplayLogicInput, type AssessmentGroup, AssessmentInput, AssessmentNestedRule, AssessmentNestedRuleInput, type AssessmentPreviousSubmission, type AssessmentQuestion, type AssessmentResource, AssessmentResourceInput, AssessmentRetentionScheduleInput, AssessmentRiskLogic, AssessmentRule, AssessmentRuleInput, AssessmentRuleWithOperands, AssessmentRuleWithoutOperands, type AssessmentSection, AssessmentSectionInput, AssessmentSectionQuestionInput, type AssessmentTemplate, AssessmentTemplateInput, AttestedExtraIdentifiers, type Attribute, AttributeInput, type AttributeKey, type AttributeNameMap, AttributePreview, type AttributeValue, AttributeValueInput, BLANK, BULK_APPLY, BULK_REQUEST_FILES, BUSINESS_ENTITIES, type BusinessEntity, BusinessEntityInput, CANCEL_PRIVACY_REQUEST, CAN_APPLY_IN_BULK, CATALOGS, CHANGE_REQUEST_DATA_SILO_STATUS, CODE_PACKAGES, CONSENT_MANAGER_ANALYTICS_DATA, CONSENT_PARTITIONS, COOKIES, CREATE_ACTION_ITEMS, CREATE_ACTION_ITEM_COLLECTION, CREATE_AGENT, CREATE_AGENT_FILE, CREATE_AGENT_FUNCTION, CREATE_API_KEY, CREATE_ATTRIBUTE, CREATE_ATTRIBUTE_VALUES, CREATE_BUSINESS_ENTITY, CREATE_CODE_PACKAGE, CREATE_CONSENT_EXPERIENCE, CREATE_CONSENT_MANAGER, CREATE_CONSENT_PARTITION, CREATE_DATA_FLOWS, CREATE_DATA_SILOS, CREATE_DATA_SUBJECT, CREATE_DATA_SUB_CATEGORY, CREATE_ENRICHER, CREATE_IDENTIFIER, CREATE_PREFERENCE_ACCESS_TOKENS, CREATE_PROCESSING_ACTIVITY, CREATE_PROCESSING_PURPOSE_SUB_CATEGORY, CREATE_PROMPT, CREATE_PROMPT_GROUP, CREATE_PROMPT_PARTIAL, CREATE_REPOSITORY, CREATE_SOFTWARE_DEVELOPMENT_KIT, CREATE_TEAM, CREATE_TEMPLATE, CREATE_VENDOR, CachedFileState, CachedRequestState, type Catalog, CodePackageInput, CodePackageSdk, ColumnName, type ColumnNameMap, type ConsentExperience, ConsentManageExperienceInput, type ConsentManager, ConsentManagerInput, type ConsentManagerMetric, ConsentManagerMetricBin, ConsentManagerServiceMetadata, type ConsentManagerTheme, ConsentPreferenceTopic, ConsentPreferenceTopicOptionValue, ConsentPurpose, type Cookie, CookieCsvInput, CookieInput, type CreatedApiKey, CronIdentifier, CronIdentifierPush, type CronIdentifierWithAction, type CsvFormattedIdentifier, DATAPOINT_EXPORT, DATA_FLOWS, DATA_POINTS, DATA_POINT_COUNT, DATA_SILOS, DATA_SILOS_ENRICHED, DATA_SILO_EXPORT, DATA_SUBJECTS, DATA_SUB_CATEGORIES, DAY_MS, DEBUG, DEFAULT_TRANSCEND_API, DEFAULT_TRANSCEND_CONSENT_API, DEFAULT_TRANSCEND_PULL_RESOURCES, DELETE_API_KEY, DELETE_ATTRIBUTE_VALUE, DEPLOYED_PRIVACY_CENTER_URL, DEPLOY_CONSENT_MANAGER, DETERMINE_LOGIN_METHOD, DataCategoryGuessInput, DataCategoryInput, DataCategoryPreviewInput, DataCategoryRecommendationInput, type DataFlow, DataFlowCsvInput, DataFlowInput, type DataPointCsvPreview, type DataSilo, type DataSiloAttributeValue, type DataSiloCsvPreview, type DataSiloEnriched, DataSiloInput, type DataSubCategory, type DataSubject, DataSubjectInput, type DatapointFilterOptions, DatapointInput, ENABLED_PLUGINS, ENRICHERS, ENTRY_COUNT, EXPERIENCES, type EnabledRouteC, type EnabledRoutesC, EnrichPrivacyRequest, type Enricher, EnricherInput, type ExportedPrivacyRequest, type ExternalUser, FETCH_CONSENT_MANAGER, FETCH_CONSENT_MANAGER_ID, FETCH_CONSENT_MANAGER_THEME, FETCH_PRIVACY_CENTER_ID, FieldInput, type FormattedAttribute, GLOBAL_ACTION_ITEMS, GLOBAL_ACTION_ITEM_COLLECTIONS, type GetPromptParamType, type GetPromptResponseType, HOUR_MS, IDENTIFIERS, IDENTIFIER_BLOCK_LIST, IMPORT_ONE_TRUST_ASSESSMENT_FORMS, INITIALIZER, IP_ADDRESS_REGEX, IS_REQUIRED, type Identifier, IdentifierInput, type IdentifierNameMap, ImportOnetrustAssessmentsInput, type IndexedCatalogs, type Initializer, IntlMessage, IntlMessageInput, LARGE_LANGUAGE_MODELS, LOGIN, MESSAGES, type Message, NEW_IDENTIFIER_TYPES, NONE, NOTIFY_ADDITIONAL_TIME, ORGANIZATION, OneTrustFileFormat, OneTrustPullResource, OneTrustPullSource, OpenAIEnabledRoute, OpenAIEnabledRoutes, OpenAIIntegration, OpenAIRouteName, type OrganizationPreview, POLICIES, PREFERENCE_TOPICS, PRIVACY_CENTER, PROCESSING_ACTIVITIES, PROCESSING_PURPOSE_SUB_CATEGORIES, PROMPTS, PROMPTS_WITH_VARIABLES, PROMPT_GROUPS, PROMPT_PARTIALS, PROMPT_THREADS, PURPOSES, type ParquetToCsvOneFileOptions, ParsedAttributeInput, PartitionInput, PathfinderPolicy, PathfinderPolicyName, PathfinderPolicyNameC, PathfinderPromptRunMetadata, type Plugin, type PluginResponse, type Policy, PolicyInput, type PreferenceAccessTokenInput, type PreferenceTopic, type PrivacyCenter, PrivacyCenterInput, PrivacyRequest, PrivacyRequestInput, PrivacyRequestResponse, type PrivacyRequestWithIdentifiers, type ProcessingActivity, ProcessingActivityInput, ProcessingPurposeInput, ProcessingPurposePreviewInput, type ProcessingPurposeSubCategory, type Prompt, PromptAVendorEmailSettings, type PromptCalculatedVariable, type PromptGroup, PromptGroupInput, PromptInput, type PromptPartial, PromptPartialInput, type PromptRunResult, type PromptRuntimeVariable, type PromptThread, type Purpose, PurposeMap, type PurposeWithPreferences, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, REMOVE_REQUEST_IDENTIFIERS, REPORT_PROMPT_RUN, REPOSITORIES, REQUESTS, REQUEST_DATA_SILOS, REQUEST_ENRICHERS, REQUEST_FILES, REQUEST_IDENTIFIERS, RETRYABLE_BATCH_STATUSES, RETRY_REQUEST_DATA_SILO, RETRY_REQUEST_ENRICHER, RateCounter, RegionInput, type ReportPromptRunInput, type ReportPromptRunOptions, RepositoryInput, type RequestDataSilo, type RequestDataSiloFilters, type RequestEnricher, type RequestFile, type RequestFileCursor, RequestFileMetadata, RequestFileMetadataResponse, type RequestFileResponse, RequestIdentifier, type RequestIdentifierMetadata, RequestIdentifiersResponse, RequestPurposeTrigger, type RetentionSchedule, type RetryPolicy, RiskAssignmentInput, type RiskCategory, type RiskFramework, type RiskLevel, RiskLogicInput, type RiskMatrix, type RiskMatrixColumn, type RiskMatrixRow, SCOPES_BY_TITLE, SCOPE_TITLES, SET_RESOURCE_ATTRIBUTES, SKIP_REQUEST_ENRICHER, SOFTWARE_DEVELOPMENT_KITS, SOMBRA_VERSION, SUB_DATA_POINTS, SUB_DATA_POINTS_COUNT, SUB_DATA_POINTS_WITH_GUESSES, SYNC_ATTRIBUTE_TYPES, SoftwareDevelopmentKitInput, StoredApiKey, type SubDataPoint, type SubDataPointCsvPreview, SuccessfulRequest, TEAMS, TEMPLATES, TOGGLE_CONSENT_PRECEDENCE, TOGGLE_DATA_SUBJECT, TOGGLE_TELEMETRY_PARTITION_STRATEGY, TOGGLE_UNKNOWN_COOKIE_POLICY, TOGGLE_UNKNOWN_REQUEST_POLICY, TR_PULL_RESOURCE_SCOPE_MAP, TR_PUSH_RESOURCE_SCOPE_MAP, TR_YML_RESOURCE_TO_FIELD_NAME, type Team, TeamInput, type Template, TemplateInput, TranscendInput, type TranscendPartition, type TranscendPrompt, TranscendPromptManager, type TranscendPromptPartialTemplated, type TranscendPromptTemplated, type TranscendPromptsAndVariables, type TranscendPullConfigurationInput, TranscendPullResource, UPDATE_ACTION, UPDATE_ACTION_ITEMS, UPDATE_ACTION_ITEM_COLLECTION, UPDATE_AGENTS, UPDATE_AGENT_FILES, UPDATE_AGENT_FUNCTIONS, UPDATE_ATTRIBUTE, UPDATE_ATTRIBUTE_VALUES, UPDATE_BUSINESS_ENTITIES, UPDATE_CODE_PACKAGES, UPDATE_CONSENT_EXPERIENCE, UPDATE_CONSENT_MANAGER_DOMAINS, UPDATE_CONSENT_MANAGER_PARTITION, UPDATE_CONSENT_MANAGER_THEME, UPDATE_CONSENT_MANAGER_TO_LATEST, UPDATE_CONSENT_MANAGER_VERSION, UPDATE_DATA_FLOWS, UPDATE_DATA_SILOS, UPDATE_DATA_SUBJECT, UPDATE_DATA_SUB_CATEGORIES, UPDATE_ENRICHER, UPDATE_IDENTIFIER, UPDATE_INTL_MESSAGES, UPDATE_LOAD_OPTIONS, UPDATE_OR_CREATE_COOKIES, UPDATE_OR_CREATE_DATA_POINT, UPDATE_POLICIES, UPDATE_PRIVACY_CENTER, UPDATE_PRIVACY_REQUEST, UPDATE_PROCESSING_ACTIVITIES, UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES, UPDATE_PROMPTS, UPDATE_PROMPT_GROUPS, UPDATE_PROMPT_PARTIALS, UPDATE_REPOSITORIES, UPDATE_SOFTWARE_DEVELOPMENT_KITS, UPDATE_TEAM, UPDATE_VENDORS, USERS, USP_STRING_REGEX, type User, type UserPreview, type UserRole, VARIABLE_PARAMETERS_NAME, VARIABLE_PARAMETERS_REGEXP, VENDORS, type Vendor, VendorInput, WebhookHeader, type XdiSyncGroups, addDaysUtc, addMessagesToPromptRun, addMs, appendCsvSync, approvePrivacyRequests, assumeRole, buildAIIntegrationType, buildEnabledRouteType, buildTranscendGraphQLClient, buildTranscendGraphQLClientGeneric, buildXdiSyncEndpoint, bulkRestartRequests, bulkRetryEnrichers, cancelPrivacyRequests, clampPageSize, collectParquetFilesOrExit, consentManagersToBusinessEntities, convertToDataSubjectAllowlist, convertToDataSubjectBlockList, createActionItemCollection, createActionItems, createAgent, createAgentFile, createAgentFunction, createApiKey, createBusinessEntity, createCodePackage, createConsentToken, createDataCategory, createDataFlows, createPreferenceAccessTokens, createProcessingPurpose, createPrompt, createRegexForTag, createRepository, createSoftwareDevelopmentKit, createSombraGotInstance, createTranscendConsentGotInstance, createVendor, defineTranscendPrompts, deleteApiKey, deployConsentManager, description, domainToHost, downloadPrivacyRequestFiles, enrichPrivacyRequest, ensureAllDataSubjectsExist, extractClientError, extractErrorMessage, fetchActiveSiloDiscoPlugin, fetchAllActionItems, fetchAllActions, fetchAllAgentFiles, fetchAllAgentFunctions, fetchAllAgents, fetchAllApiKeys, fetchAllAssessmentTemplates, fetchAllAssessments, fetchAllAttributeValues, fetchAllAttributes, fetchAllBusinessEntities, fetchAllCatalogs, fetchAllCookies, fetchAllDataCategories, fetchAllDataFlows, fetchAllDataPoints, fetchAllDataSilos, fetchAllDataSubjects, fetchAllEnrichers, fetchAllIdentifiers, fetchAllMessages, fetchAllPolicies, fetchAllPreferenceTopics, fetchAllPrivacyCenters, fetchAllProcessingActivities, fetchAllProcessingPurposes, fetchAllPromptGroups, fetchAllPromptPartials, fetchAllPromptThreads, fetchAllPrompts, fetchAllPurposes, fetchAllPurposesAndPreferences, fetchAllRequestAttributeKeys, fetchAllRequestEnrichers, fetchAllRequestIdentifierMetadata, fetchAllRequestIdentifiers, fetchAllRequests, fetchAllSubDataPoints, fetchAllTeams, fetchAllTemplates, fetchAllUsers, fetchAllVendors, fetchAndIndexCatalogs, fetchApiKeys, fetchConsentManager, fetchConsentManagerAnalyticsData, fetchConsentManagerExperiences, fetchConsentManagerId, fetchConsentManagerTheme, fetchEnrichedDataSilos, fetchIdentifiersAndCreateMissing, fetchPartitions, fetchPrivacyCenterId, fetchPrivacyCenterUrl, fetchPromptsWithVariables, fetchRequestDataSilo, fetchRequestDataSiloActiveCount, fetchRequestDataSilos, fetchRequestDataSilosCount, fetchRequestFilesForRequest, filterNullishValuesFromObject, filterRows, formatAttributeValues, fuzzyMatchColumns, fuzzySearch, generateCrossAccountApiKeys, getErrorStatus, getFileMetadataForPrivacyRequests, getGitFilesThatChanged, getUniqueValuesForColumn, inquirerAutoComplete, inquirerConfirmBoolean, inquirerConfirmText, limitRecords, listDirectories, listFiles, loginUser, makeGraphQLRequest, mapColumnsToAttributes, mapColumnsToIdentifiers, mapCsvColumnsToApi, mapCsvRowsToRequestInputs, mapEnumValues, mapRequestEnumValues, markCronIdentifierCompleted, markRequestDataSiloIdsCompleted, markSilentPrivacyRequests, mergeTranscendInputs, name, normalizeIdentifierValue, notifyPrivacyRequestsAdditionalTime, parquetToCsvOneFile, parseAssessmentDisplayLogic, parseAssessmentRiskLogic, parseAttributesFromString, parseFilePath, parseVariablesFromString, pullAllDatapoints, pullChunkedCustomSiloOutstandingIdentifiers, pullConsentManagerMetrics, pullCronPageOfIdentifiers, pullManualEnrichmentIdentifiersToCsv, pullPrivacyRequests, pullTranscendConfiguration, pullUnstructuredSubDataPointRecommendations, pushCronIdentifiersFromCsv, pushManualEnrichmentIdentifiersFromCsv, readCsv, readSafe, readTranscendYaml, removeLinks, removeUnverifiedRequestIdentifiers, replaceVariablesInYaml, reportPromptRun, restartPrivacyRequest, retryRequestDataSilos, retryRequestEnricher, retrySamePromise, setResourceAttributes, skipPreflightJobs, skipRequestDataSilos, sleepPromise, splitCsvToList, splitInHalf, startOfHour, startOfUtcDay, streamPrivacyRequestFiles, submitPrivacyRequest, syncAction, syncActionItemCollections, syncActionItems, syncAgentFiles, syncAgentFunctions, syncAgents, syncAttribute, syncBusinessEntities, syncCodePackages, syncConfigurationToTranscend, syncConsentManager, syncConsentManagerExperiences, syncCookies, syncDataCategories, syncDataFlows, syncDataSiloDependencies, syncDataSilos, syncDataSubject, syncEnricher, syncIdentifier, syncIntlMessages, syncPartitions, syncPolicies, syncPrivacyCenter, syncProcessingActivities, syncProcessingPurposes, syncPrompts, syncRepositories, syncSoftwareDevelopmentKits, syncTemplate, syncVendors, updateActionItem, updateActionItemCollection, updateAgentFiles, updateAgentFunctions, updateAgents, updateBusinessEntities, updateCodePackages, updateConsentManagerToLatest, updateConsentManagerVersionToLatest, updateDataCategories, updateDataFlows, updateIntlMessages, updateOrCreateCookies, updatePolicies, updateProcessingPurposes, updatePrompts, updateRepositories, updateSoftwareDevelopmentKits, updateVendors, uploadConsents, uploadCookiesFromCsv, uploadDataFlowsFromCsv, uploadPrivacyRequestsFromCsv, uploadSiloDiscoveryResults, validateTranscendAuth, version, writeCsv, writeCsvSync, writeLargeCsv, writeTranscendYaml };
146671
+ export { ACTIONS, ADD_MESSAGES_TO_PROMPT_RUN, ADD_SILO_DISCOVERY_RESULTS, ADMIN_DASH, ADMIN_DASH_DATAPOINTS, ADMIN_DASH_INTEGRATIONS, AGENTS, AGENT_FILES, AGENT_FUNCTIONS, type AIIntegrationC, API_KEYS, APPROVE_PRIVACY_REQUEST, ASSESSMENTS, ASSESSMENT_SECTION_FIELDS, ASSESSMENT_TEMPLATES, ASSUME_ROLE, ATTRIBUTES, ATTRIBUTE_KEYS_REQUESTS, ATTRIBUTE_VALUES, type Action, ActionInput, type ActionItem, ActionItemCollectionInput, ActionItemInput, type ActionItemRaw, type AddMessagesToPromptRunInput, type Agent, type AgentFile, type AgentFileFilterBy, AgentFileInput, type AgentFunction, AgentFunctionInput, AgentInput, type ApiKey, type ApiKeyGenerateError, ApiKeyInput, type Assessment, AssessmentAction, type AssessmentAnswer, type AssessmentAnswerOption, AssessmentAnswerOptionInput, type AssessmentComment, AssessmentDisplayLogicInput, type AssessmentGroup, AssessmentInput, AssessmentNestedRule, AssessmentNestedRuleInput, type AssessmentPreviousSubmission, type AssessmentQuestion, type AssessmentResource, AssessmentResourceInput, AssessmentRetentionScheduleInput, AssessmentRiskLogic, AssessmentRule, AssessmentRuleInput, AssessmentRuleWithOperands, AssessmentRuleWithoutOperands, type AssessmentSection, AssessmentSectionInput, AssessmentSectionQuestionInput, type AssessmentTemplate, AssessmentTemplateInput, AttestedExtraIdentifiers, type Attribute, AttributeInput, type AttributeKey, type AttributeNameMap, AttributePreview, type AttributeValue, AttributeValueInput, BLANK, BULK_APPLY, BULK_REQUEST_FILES, BUSINESS_ENTITIES, type BusinessEntity, BusinessEntityInput, CANCEL_PRIVACY_REQUEST, CAN_APPLY_IN_BULK, CATALOGS, CHANGE_REQUEST_DATA_SILO_STATUS, CODE_PACKAGES, CONSENT_MANAGER_ANALYTICS_DATA, CONSENT_PARTITIONS, COOKIES, CREATE_ACTION_ITEMS, CREATE_ACTION_ITEM_COLLECTION, CREATE_AGENT, CREATE_AGENT_FILE, CREATE_AGENT_FUNCTION, CREATE_API_KEY, CREATE_ATTRIBUTE, CREATE_ATTRIBUTE_VALUES, CREATE_BUSINESS_ENTITY, CREATE_CODE_PACKAGE, CREATE_CONSENT_EXPERIENCE, CREATE_CONSENT_MANAGER, CREATE_CONSENT_PARTITION, CREATE_DATA_FLOWS, CREATE_DATA_SILOS, CREATE_DATA_SUBJECT, CREATE_DATA_SUB_CATEGORY, CREATE_ENRICHER, CREATE_IDENTIFIER, CREATE_PREFERENCE_ACCESS_TOKENS, CREATE_PROCESSING_ACTIVITY, CREATE_PROCESSING_PURPOSE_SUB_CATEGORY, CREATE_PROMPT, CREATE_PROMPT_GROUP, CREATE_PROMPT_PARTIAL, CREATE_REPOSITORY, CREATE_SOFTWARE_DEVELOPMENT_KIT, CREATE_TEAM, CREATE_TEMPLATE, CREATE_VENDOR, CachedFileState, CachedRequestState, type Catalog, CodePackageInput, CodePackageSdk, ColumnName, type ColumnNameMap, type ConsentExperience, ConsentManageExperienceInput, type ConsentManager, ConsentManagerInput, type ConsentManagerMetric, ConsentManagerMetricBin, ConsentManagerServiceMetadata, type ConsentManagerTheme, ConsentPreferenceTopic, ConsentPreferenceTopicOptionValue, ConsentPurpose, type Cookie, CookieCsvInput, CookieInput, type CreatedApiKey, CronIdentifier, CronIdentifierPush, type CronIdentifierWithAction, type CsvFormattedIdentifier, DATAPOINT_EXPORT, DATA_FLOWS, DATA_POINTS, DATA_POINT_COUNT, DATA_SILOS, DATA_SILOS_ENRICHED, DATA_SILO_EXPORT, DATA_SUBJECTS, DATA_SUB_CATEGORIES, DAY_MS, DEBUG, DEFAULT_TRANSCEND_API, DEFAULT_TRANSCEND_CONSENT_API, DEFAULT_TRANSCEND_PULL_RESOURCES, DELETE_API_KEY, DELETE_ATTRIBUTE_VALUE, DEPLOYED_PRIVACY_CENTER_URL, DEPLOY_CONSENT_MANAGER, DETERMINE_LOGIN_METHOD, DataCategoryGuessInput, DataCategoryInput, DataCategoryPreviewInput, DataCategoryRecommendationInput, type DataFlow, DataFlowCsvInput, DataFlowInput, type DataPointCsvPreview, type DataSilo, type DataSiloAttributeValue, type DataSiloCsvPreview, type DataSiloEnriched, DataSiloInput, type DataSubCategory, type DataSubject, DataSubjectInput, type DatapointFilterOptions, DatapointInput, ENABLED_PLUGINS, ENRICHERS, ENTRY_COUNT, EXPERIENCES, type EnabledRouteC, type EnabledRoutesC, EnrichPrivacyRequest, type Enricher, EnricherInput, type ExportedPrivacyRequest, type ExternalUser, FETCH_CONSENT_MANAGER, FETCH_CONSENT_MANAGER_ID, FETCH_CONSENT_MANAGER_THEME, FETCH_PRIVACY_CENTER_ID, FieldInput, type FormattedAttribute, GLOBAL_ACTION_ITEMS, GLOBAL_ACTION_ITEM_COLLECTIONS, type GetPromptParamType, type GetPromptResponseType, HOUR_MS, IDENTIFIERS, IDENTIFIER_BLOCK_LIST, IMPORT_ONE_TRUST_ASSESSMENT_FORMS, INITIALIZER, IP_ADDRESS_REGEX, IS_REQUIRED, type Identifier, IdentifierInput, type IdentifierNameMap, ImportOnetrustAssessmentsInput, type IndexedCatalogs, type Initializer, IntlMessage, IntlMessageInput, LARGE_LANGUAGE_MODELS, LOGIN, MESSAGES, type Message, NEW_IDENTIFIER_TYPES, NONE, NOTIFY_ADDITIONAL_TIME, ORGANIZATION, OneTrustFileFormat, OneTrustPullResource, OneTrustPullSource, OpenAIEnabledRoute, OpenAIEnabledRoutes, OpenAIIntegration, OpenAIRouteName, type OrganizationPreview, POLICIES, PREFERENCE_TOPICS, PRIVACY_CENTER, PROCESSING_ACTIVITIES, PROCESSING_PURPOSE_SUB_CATEGORIES, PROMPTS, PROMPTS_WITH_VARIABLES, PROMPT_GROUPS, PROMPT_PARTIALS, PROMPT_THREADS, PURPOSES, type ParquetToCsvOneFileOptions, ParsedAttributeInput, PartitionInput, PathfinderPolicy, PathfinderPolicyName, PathfinderPolicyNameC, PathfinderPromptRunMetadata, type Plugin, type PluginResponse, type Policy, PolicyInput, type PreferenceAccessTokenInput, type PreferenceTopic, type PrivacyCenter, PrivacyCenterInput, PrivacyRequest, PrivacyRequestInput, PrivacyRequestResponse, type PrivacyRequestWithIdentifiers, type ProcessingActivity, ProcessingActivityInput, ProcessingPurposeInput, ProcessingPurposePreviewInput, type ProcessingPurposeSubCategory, type Prompt, PromptAVendorEmailSettings, type PromptCalculatedVariable, type PromptGroup, PromptGroupInput, PromptInput, type PromptPartial, PromptPartialInput, type PromptRunResult, type PromptRuntimeVariable, type PromptThread, type Purpose, PurposeMap, type PurposeWithPreferences, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, REMOVE_REQUEST_IDENTIFIERS, REPORT_PROMPT_RUN, REPOSITORIES, REQUESTS, REQUEST_DATA_SILOS, REQUEST_ENRICHERS, REQUEST_FILES, REQUEST_IDENTIFIERS, RETRYABLE_BATCH_STATUSES, RETRY_REQUEST_DATA_SILO, RETRY_REQUEST_ENRICHER, RateCounter, RegionInput, type ReportPromptRunInput, type ReportPromptRunOptions, RepositoryInput, type RequestDataSilo, type RequestDataSiloFilters, type RequestEnricher, type RequestFile, type RequestFileCursor, RequestFileMetadata, RequestFileMetadataResponse, type RequestFileResponse, RequestIdentifier, type RequestIdentifierMetadata, RequestIdentifiersResponse, RequestPurposeTrigger, type RetentionSchedule, type RetryPolicy, RiskAssignmentInput, type RiskCategory, type RiskFramework, type RiskLevel, RiskLogicInput, type RiskMatrix, type RiskMatrixColumn, type RiskMatrixRow, SCOPES_BY_TITLE, SCOPE_TITLES, SET_RESOURCE_ATTRIBUTES, SKIP_REQUEST_ENRICHER, SOFTWARE_DEVELOPMENT_KITS, SOMBRA_VERSION, SUB_DATA_POINTS, SUB_DATA_POINTS_COUNT, SUB_DATA_POINTS_WITH_GUESSES, SYNC_ATTRIBUTE_TYPES, SoftwareDevelopmentKitInput, StoredApiKey, type SubDataPoint, type SubDataPointCsvPreview, SuccessfulRequest, TEAMS, TEMPLATES, TOGGLE_CONSENT_PRECEDENCE, TOGGLE_DATA_SUBJECT, TOGGLE_TELEMETRY_PARTITION_STRATEGY, TOGGLE_UNKNOWN_COOKIE_POLICY, TOGGLE_UNKNOWN_REQUEST_POLICY, TR_PULL_RESOURCE_SCOPE_MAP, TR_PUSH_RESOURCE_SCOPE_MAP, TR_YML_RESOURCE_TO_FIELD_NAME, type Team, TeamInput, type Template, TemplateInput, TranscendInput, type TranscendPartition, type TranscendPrompt, TranscendPromptManager, type TranscendPromptPartialTemplated, type TranscendPromptTemplated, type TranscendPromptsAndVariables, type TranscendPullConfigurationInput, TranscendPullResource, UPDATE_ACTION, UPDATE_ACTION_ITEMS, UPDATE_ACTION_ITEM_COLLECTION, UPDATE_AGENTS, UPDATE_AGENT_FILES, UPDATE_AGENT_FUNCTIONS, UPDATE_ATTRIBUTE, UPDATE_ATTRIBUTE_VALUES, UPDATE_BUSINESS_ENTITIES, UPDATE_CODE_PACKAGES, UPDATE_CONSENT_EXPERIENCE, UPDATE_CONSENT_MANAGER_DOMAINS, UPDATE_CONSENT_MANAGER_PARTITION, UPDATE_CONSENT_MANAGER_THEME, UPDATE_CONSENT_MANAGER_TO_LATEST, UPDATE_CONSENT_MANAGER_VERSION, UPDATE_DATA_FLOWS, UPDATE_DATA_SILOS, UPDATE_DATA_SUBJECT, UPDATE_DATA_SUB_CATEGORIES, UPDATE_ENRICHER, UPDATE_IDENTIFIER, UPDATE_INTL_MESSAGES, UPDATE_LOAD_OPTIONS, UPDATE_OR_CREATE_COOKIES, UPDATE_OR_CREATE_DATA_POINT, UPDATE_POLICIES, UPDATE_PRIVACY_CENTER, UPDATE_PRIVACY_REQUEST, UPDATE_PROCESSING_ACTIVITIES, UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES, UPDATE_PROMPTS, UPDATE_PROMPT_GROUPS, UPDATE_PROMPT_PARTIALS, UPDATE_REPOSITORIES, UPDATE_SOFTWARE_DEVELOPMENT_KITS, UPDATE_TEAM, UPDATE_VENDORS, USERS, USP_STRING_REGEX, type User, type UserPreview, type UserRole, VARIABLE_PARAMETERS_NAME, VARIABLE_PARAMETERS_REGEXP, VENDORS, type Vendor, VendorInput, WebhookHeader, type XdiSyncGroups, addDaysUtc, addMessagesToPromptRun, addMs, appendCsvRowsOrdered, appendCsvSync, approvePrivacyRequests, assumeRole, buildAIIntegrationType, buildEnabledRouteType, buildTranscendGraphQLClient, buildTranscendGraphQLClientGeneric, buildXdiSyncEndpoint, bulkRestartRequests, bulkRetryEnrichers, cancelPrivacyRequests, clampPageSize, collectParquetFilesOrExit, consentManagersToBusinessEntities, convertToDataSubjectAllowlist, convertToDataSubjectBlockList, createActionItemCollection, createActionItems, createAgent, createAgentFile, createAgentFunction, createApiKey, createBusinessEntity, createCodePackage, createConsentToken, createDataCategory, createDataFlows, createPreferenceAccessTokens, createProcessingPurpose, createPrompt, createRegexForTag, createRepository, createSoftwareDevelopmentKit, createSombraGotInstance, createTranscendConsentGotInstance, createVendor, defineTranscendPrompts, deleteApiKey, deployConsentManager, description, domainToHost, downloadPrivacyRequestFiles, enrichPrivacyRequest, ensureAllDataSubjectsExist, extractClientError, extractErrorMessage, fetchActiveSiloDiscoPlugin, fetchAllActionItems, fetchAllActions, fetchAllAgentFiles, fetchAllAgentFunctions, fetchAllAgents, fetchAllApiKeys, fetchAllAssessmentTemplates, fetchAllAssessments, fetchAllAttributeValues, fetchAllAttributes, fetchAllBusinessEntities, fetchAllCatalogs, fetchAllCookies, fetchAllDataCategories, fetchAllDataFlows, fetchAllDataPoints, fetchAllDataSilos, fetchAllDataSubjects, fetchAllEnrichers, fetchAllIdentifiers, fetchAllMessages, fetchAllPolicies, fetchAllPreferenceTopics, fetchAllPrivacyCenters, fetchAllProcessingActivities, fetchAllProcessingPurposes, fetchAllPromptGroups, fetchAllPromptPartials, fetchAllPromptThreads, fetchAllPrompts, fetchAllPurposes, fetchAllPurposesAndPreferences, fetchAllRequestAttributeKeys, fetchAllRequestEnrichers, fetchAllRequestIdentifierMetadata, fetchAllRequestIdentifiers, fetchAllRequests, fetchAllSubDataPoints, fetchAllTeams, fetchAllTemplates, fetchAllUsers, fetchAllVendors, fetchAndIndexCatalogs, fetchApiKeys, fetchConsentManager, fetchConsentManagerAnalyticsData, fetchConsentManagerExperiences, fetchConsentManagerId, fetchConsentManagerTheme, fetchEnrichedDataSilos, fetchIdentifiersAndCreateMissing, fetchPartitions, fetchPrivacyCenterId, fetchPrivacyCenterUrl, fetchPromptsWithVariables, fetchRequestDataSilo, fetchRequestDataSiloActiveCount, fetchRequestDataSilos, fetchRequestDataSilosCount, fetchRequestFilesForRequest, filterNullishValuesFromObject, filterRows, formatAttributeValues, fuzzyMatchColumns, fuzzySearch, generateCrossAccountApiKeys, getErrorStatus, getFileMetadataForPrivacyRequests, getGitFilesThatChanged, getUniqueValuesForColumn, initCsvFile, inquirerAutoComplete, inquirerConfirmBoolean, inquirerConfirmText, limitRecords, listDirectories, listFiles, loginUser, makeGraphQLRequest, mapColumnsToAttributes, mapColumnsToIdentifiers, mapCsvColumnsToApi, mapCsvRowsToRequestInputs, mapEnumValues, mapRequestEnumValues, markCronIdentifierCompleted, markRequestDataSiloIdsCompleted, markSilentPrivacyRequests, mergeTranscendInputs, name, normalizeIdentifierValue, notifyPrivacyRequestsAdditionalTime, parquetToCsvOneFile, parseAssessmentDisplayLogic, parseAssessmentRiskLogic, parseAttributesFromString, parseFilePath, parseVariablesFromString, pullAllDatapoints, pullChunkedCustomSiloOutstandingIdentifiers, pullConsentManagerMetrics, pullCronPageOfIdentifiers, pullManualEnrichmentIdentifiersToCsv, pullPrivacyRequests, pullTranscendConfiguration, pullUnstructuredSubDataPointRecommendations, pushCronIdentifiersFromCsv, pushManualEnrichmentIdentifiersFromCsv, readCsv, readSafe, readTranscendYaml, removeLinks, removeUnverifiedRequestIdentifiers, replaceVariablesInYaml, reportPromptRun, restartPrivacyRequest, retryRequestDataSilos, retryRequestEnricher, retrySamePromise, setResourceAttributes, skipPreflightJobs, skipRequestDataSilos, sleepPromise, splitCsvToList, splitInHalf, startOfHour, startOfUtcDay, streamPrivacyRequestFiles, submitPrivacyRequest, syncAction, syncActionItemCollections, syncActionItems, syncAgentFiles, syncAgentFunctions, syncAgents, syncAttribute, syncBusinessEntities, syncCodePackages, syncConfigurationToTranscend, syncConsentManager, syncConsentManagerExperiences, syncCookies, syncDataCategories, syncDataFlows, syncDataSiloDependencies, syncDataSilos, syncDataSubject, syncEnricher, syncIdentifier, syncIntlMessages, syncPartitions, syncPolicies, syncPrivacyCenter, syncProcessingActivities, syncProcessingPurposes, syncPrompts, syncRepositories, syncSoftwareDevelopmentKits, syncTemplate, syncVendors, updateActionItem, updateActionItemCollection, updateAgentFiles, updateAgentFunctions, updateAgents, updateBusinessEntities, updateCodePackages, updateConsentManagerToLatest, updateConsentManagerVersionToLatest, updateDataCategories, updateDataFlows, updateIntlMessages, updateOrCreateCookies, updatePolicies, updateProcessingPurposes, updatePrompts, updateRepositories, updateSoftwareDevelopmentKits, updateVendors, uploadConsents, uploadCookiesFromCsv, uploadDataFlowsFromCsv, uploadPrivacyRequestsFromCsv, uploadSiloDiscoveryResults, validateTranscendAuth, version, writeCsv, writeCsvSync, writeLargeCsv, writeTranscendYaml };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Transcend Inc.",
3
3
  "name": "@transcend-io/cli",
4
4
  "description": "A command line interface for programmatic operations across Transcend.",
5
- "version": "8.25.3",
5
+ "version": "8.26.0",
6
6
  "homepage": "https://github.com/transcend-io/cli",
7
7
  "repository": {
8
8
  "type": "git",
@@ -138,6 +138,7 @@
138
138
  "@typescript-eslint/parser": "^5.58.0",
139
139
  "depcheck": "^1.4.3",
140
140
  "doctoc": "^2.2.1",
141
+ "date-fns": "^4.1.0",
141
142
  "eslint": "^8.38.0",
142
143
  "eslint-config-airbnb-base": "^15.0.0",
143
144
  "eslint-import-resolver-typescript": "^3.5.5",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-FIBHN6CY.cjs","../src/app.ts","../src/commands/admin/generate-api-keys/command.ts","../src/commands/admin/chunk-csv/command.ts","../src/commands/admin/parquet-to-csv/command.ts","../src/commands/admin/routes.ts","../src/commands/consent/routes.ts","../src/commands/consent/build-xdi-sync-endpoint/command.ts","../src/commands/consent/pull-consent-metrics/command.ts","../src/commands/consent/pull-consent-preferences/command.ts","../src/commands/consent/update-consent-manager/command.ts","../src/commands/consent/upload-consent-preferences/command.ts","../src/commands/consent/upload-cookies-from-csv/command.ts","../src/commands/consent/upload-data-flows-from-csv/command.ts","../src/commands/consent/upload-preferences/command.ts","../src/commands/consent/generate-access-tokens/command.ts","../src/commands/inventory/routes.ts","../src/commands/inventory/derive-data-silos-from-data-flows-cross-instance/command.ts","../src/commands/inventory/derive-data-silos-from-data-flows/command.ts","../src/commands/inventory/discover-silos/command.ts","../src/commands/inventory/pull-datapoints/command.ts","../src/commands/inventory/pull-unstructured-discovery-files/command.ts","../src/commands/inventory/push/command.ts","../src/commands/inventory/scan-packages/command.ts","../src/commands/inventory/consent-manager-service-json-to-yml/command.ts","../src/lib/docgen/buildExamples.ts","../src/commands/inventory/consent-managers-to-business-entities/command.ts","../src/commands/migration/sync-ot/command.ts","../src/commands/migration/routes.ts","../src/commands/request/cron/mark-identifiers-completed/command.ts","../src/commands/request/cron/pull-identifiers/command.ts","../src/commands/request/cron/pull-profiles/command.ts","../src/commands/request/cron/routes.ts","../src/commands/request/enricher-restart/command.ts","../src/commands/request/export/command.ts","../src/commands/request/preflight/pull-identifiers/command.ts","../src/commands/request/preflight/push-identifiers/command.ts","../src/commands/request/preflight/routes.ts","../src/commands/request/system/retry-request-data-silos/command.ts","../src/commands/request/upload/command.ts","../src/commands/request/routes.ts"],"names":["generateApiKeysCommand","buildCommand","generateApiKeys","SCOPE_TITLES","uuidParser","createTranscendUrlParameter","chunkCsvCommand","chunkCsv","v","n","parquetToCsvCommand","parquetToCsv","adminRoutes","buildRouteMap","buildXdiSyncEndpointCommand","buildXdiSyncEndpoint","createAuthParameter","ScopeName","arrayParser","pullConsentMetricsCommand","pullConsentMetrics","dateParser","pullConsentPreferencesCommand","pullConsentPreferences","createSombraAuthParameter","numberParser","updateConsentManagerCommand","updateConsentManager","ConsentBundleType","uploadConsentPreferencesCommand","uploadConsentPreferences","createConsentUrlParameter","uploadCookiesFromCsvCommand","uploadCookiesFromCsv","ConsentTrackerStatus","uploadDataFlowsFromCsvCommand","uploadDataFlowsFromCsv","uploadPreferencesCommand","uploadPreferences","generateAccessTokensCommand","generateAccessTokens","parseDurationToMs","consentRoutes","deriveDataSilosFromDataFlowsCrossInstanceCommand","deriveDataSilosFromDataFlowsCrossInstance","deriveDataSilosFromDataFlowsCommand","deriveDataSilosFromDataFlows","discoverSilosCommand","discoverSilos","pullDatapointsCommand","pullDatapoints","DataCategoryType","pullUnstructuredDiscoveryFilesCommand","pullUnstructuredDiscoveryFiles","UnstructuredSubDataPointRecommendationStatus","pushCommand","push","scanPackagesCommand","scanPackages","buildExampleCommand","commandPath","flags","options","command","flagList","getFlagList","forceSingleLine","argsIndent","RequestAction"],"mappings":"AAAA,ufAAgG,wDAA8D,wDAAgD,sDCGvM,qCACyC,ICCnCA,CAAAA,CAAyBC,gCAAAA,CACpC,MAAA,CAAQ,KAAA,CAAA,CAAA,EAAY,CAClB,GAAM,CAAE,eAAA,CAAAC,CAAgB,CAAA,CAAI,MAAM,4DAAA,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;AAAA;AAAA;AAAA;AAYjB,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACzDK,GAAA;AAoDY;AAAA;AAAA;AAAA;AAAA;AAYjB,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACvDO,GAAA;ACTFI,4GAAAA;AC0GY;AAAA;AAAA;ACrFjB,yGAAA","file":"/home/runner/work/cli/cli/dist/chunk-FIBHN6CY.cjs","sourcesContent":[null,"import {\n buildInstallCommand,\n buildUninstallCommand,\n} from '@stricli/auto-complete';\nimport { buildApplication, buildRouteMap } from '@stricli/core';\nimport { adminRoutes } from './commands/admin/routes';\nimport { consentRoutes } from './commands/consent/routes';\nimport { inventoryRoutes } from './commands/inventory/routes';\nimport { migrationRoutes } from './commands/migration/routes';\nimport { requestRoutes } from './commands/request/routes';\nimport { description, name, version } from './constants';\n\nconst routes = buildRouteMap({\n routes: {\n request: requestRoutes,\n consent: consentRoutes,\n inventory: inventoryRoutes,\n admin: adminRoutes,\n migration: migrationRoutes,\n install: buildInstallCommand('@transcend-io/transcend', {\n bash: '__@transcend-io/cli_bash_complete',\n }),\n uninstall: buildUninstallCommand('@transcend-io/transcend', { bash: true }),\n },\n docs: {\n brief: description,\n hideRoute: {\n install: true,\n uninstall: true,\n },\n },\n});\n\nexport const app = buildApplication(routes, {\n name,\n versionInfo: {\n currentVersion: version,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { createTranscendUrlParameter } from '../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../lib/cli/parsers';\nimport { SCOPE_TITLES } from '../../../constants';\n\nexport const generateApiKeysCommand = buildCommand({\n loader: async () => {\n const { generateApiKeys } = await import('./impl');\n return generateApiKeys;\n },\n parameters: {\n flags: {\n email: {\n kind: 'parsed',\n parse: String,\n brief: 'The email address that you use to log into Transcend',\n },\n password: {\n kind: 'parsed',\n parse: String,\n brief: 'The password for your account login',\n },\n apiKeyTitle: {\n kind: 'parsed',\n parse: String,\n brief: 'The title of the API key being generated or destroyed',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file where API keys should be written to',\n },\n scopes: {\n kind: 'enum',\n values: SCOPE_TITLES,\n variadic: ',',\n brief: 'The list of scopes that should be given to the API key',\n },\n deleteExistingApiKey: {\n kind: 'boolean',\n brief:\n 'When true, if an API key exists with the specified apiKeyTitle, the existing API key is deleted',\n default: true,\n },\n createNewApiKey: {\n kind: 'boolean',\n brief:\n 'When true, new API keys will be created. Set to false if you simply want to delete all API keys with a title',\n default: true,\n },\n parentOrganizationId: {\n kind: 'parsed',\n parse: uuidParser,\n brief:\n 'Filter for only a specific organization by ID, returning all child accounts associated with that organization',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Generate API keys',\n fullDescription: `This command allows for creating API keys across multiple Transcend instances. This is useful for customers that are managing many Transcend instances and need to regularly create, cycle or delete API keys across all of their instances.\n\nUnlike the other commands that rely on API key authentication, this command relies upon username/password authentication. This command will spit out the API keys into a JSON file, and that JSON file can be used in subsequent CLI commands.\n\nAuthentication requires your email and password for the Transcend account. This command will only generate API keys for Transcend instances where you have the permission to \"Manage API Keys\".`,\n },\n});\n","import { buildCommand } from '@stricli/core';\n\nexport const chunkCsvCommand = buildCommand({\n loader: async () => {\n const { chunkCsv } = await import('./impl');\n return chunkCsv;\n },\n parameters: {\n flags: {\n directory: {\n kind: 'parsed',\n parse: String,\n brief: 'Directory containing CSV files to split (required)',\n },\n outputDir: {\n kind: 'parsed',\n parse: String,\n brief:\n \"Directory to write chunk files (defaults to each input file's directory)\",\n optional: true,\n },\n clearOutputDir: {\n kind: 'boolean',\n brief: 'Clear the output directory before writing chunks',\n default: true,\n },\n chunkSizeMB: {\n kind: 'parsed',\n parse: (v: string) => {\n const n = Number(v);\n if (!Number.isFinite(n) || n <= 0) {\n throw new Error('chunkSizeMB must be a positive number');\n }\n return n;\n },\n brief:\n 'Approximate chunk size in megabytes. Keep well under JS string size limits',\n default: '10',\n },\n concurrency: {\n kind: 'parsed',\n parse: (v: string) => Math.max(1, Number(v) || 0),\n brief:\n 'Max number of worker processes (defaults based on CPU and file count)',\n optional: true,\n },\n viewerMode: {\n kind: 'boolean',\n brief:\n 'Run in non-interactive viewer mode (no attach UI, auto-artifacts)',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Chunk all CSVs in a directory into smaller CSV files',\n fullDescription: `Streams every CSV in --directory and writes chunked files of approximately N MB each.\n- Runs files in parallel across worker processes (configurable via --concurrency).\n- Validates row-length consistency against the header row; logs periodic progress and memory usage.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\n\nexport const parquetToCsvCommand = buildCommand({\n loader: async () => {\n const { parquetToCsv } = await import('./impl');\n return parquetToCsv;\n },\n parameters: {\n flags: {\n directory: {\n kind: 'parsed',\n parse: String,\n brief: 'Directory containing Parquet files to convert (required)',\n },\n outputDir: {\n kind: 'parsed',\n parse: String,\n brief:\n \"Directory to write CSV files (defaults to each input file's directory)\",\n optional: true,\n },\n clearOutputDir: {\n kind: 'boolean',\n brief: 'Clear the output directory before writing CSVs',\n default: true,\n },\n concurrency: {\n kind: 'parsed',\n parse: (v: string) => Math.max(1, Number(v) || 0),\n brief:\n 'Max number of worker processes (defaults based on CPU and file count)',\n optional: true,\n },\n viewerMode: {\n kind: 'boolean',\n brief:\n 'Run in non-interactive viewer mode (no attach UI, auto-artifacts)',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Convert all Parquet files in a directory to CSV',\n fullDescription: `Streams every .parquet in --directory and writes CSV output files\n- Runs files in parallel across worker processes (configurable via --concurrency).\n- Validates row consistency; logs periodic progress and memory usage.\n\nThis is a useful administrative tool for converting Parquet exports to CSV for the purposes\nof uploading DSRs or Consent Preferences. e.g. transcend consent upload-preferences ...`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { generateApiKeysCommand } from './generate-api-keys/command';\nimport { chunkCsvCommand } from './chunk-csv/command';\nimport { parquetToCsvCommand } from './parquet-to-csv/command';\n\nexport const adminRoutes = buildRouteMap({\n routes: {\n 'generate-api-keys': generateApiKeysCommand,\n 'chunk-csv': chunkCsvCommand,\n 'parquet-to-csv': parquetToCsvCommand,\n },\n docs: {\n brief: 'Admin commands',\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { buildXdiSyncEndpointCommand } from './build-xdi-sync-endpoint/command';\nimport { pullConsentMetricsCommand } from './pull-consent-metrics/command';\nimport { pullConsentPreferencesCommand } from './pull-consent-preferences/command';\nimport { updateConsentManagerCommand } from './update-consent-manager/command';\nimport { uploadConsentPreferencesCommand } from './upload-consent-preferences/command';\nimport { uploadCookiesFromCsvCommand } from './upload-cookies-from-csv/command';\nimport { uploadDataFlowsFromCsvCommand } from './upload-data-flows-from-csv/command';\nimport { uploadPreferencesCommand } from './upload-preferences/command';\nimport { generateAccessTokensCommand } from './generate-access-tokens/command';\n\nexport const consentRoutes = buildRouteMap({\n routes: {\n 'build-xdi-sync-endpoint': buildXdiSyncEndpointCommand,\n 'generate-access-tokens': generateAccessTokensCommand,\n 'pull-consent-metrics': pullConsentMetricsCommand,\n 'pull-consent-preferences': pullConsentPreferencesCommand,\n 'update-consent-manager': updateConsentManagerCommand,\n 'upload-consent-preferences': uploadConsentPreferencesCommand,\n 'upload-cookies-from-csv': uploadCookiesFromCsvCommand,\n 'upload-data-flows-from-csv': uploadDataFlowsFromCsvCommand,\n 'upload-preferences': uploadPreferencesCommand,\n },\n docs: {\n brief: 'Consent commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { arrayParser } from '../../../lib/cli/parsers';\n\nexport const buildXdiSyncEndpointCommand = buildCommand({\n loader: async () => {\n const { buildXdiSyncEndpoint } = await import('./impl');\n return buildXdiSyncEndpoint;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewConsentManager],\n }),\n xdiLocation: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The location of the XDI that will be loaded by the generated sync endpoint',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The HTML file path where the sync endpoint should be written',\n default: './sync-endpoint.html',\n },\n removeIpAddresses: {\n kind: 'boolean',\n brief: 'When true, remove IP addresses from the domain list',\n default: true,\n },\n domainBlockList: {\n kind: 'parsed',\n parse: arrayParser,\n brief:\n 'The set of domains that should be excluded from the sync endpoint. Comma-separated list.',\n default: 'localhost',\n },\n xdiAllowedCommands: {\n kind: 'parsed',\n parse: String,\n brief: 'The allowed set of XDI commands',\n default: 'ConsentManager:Sync',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Build XDI sync endpoint',\n fullDescription:\n 'This command allows for building of the XDI Sync Endpoint across a set of Transcend accounts.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const pullConsentMetricsCommand = buildCommand({\n loader: async () => {\n const { pullConsentMetrics } = await import('./impl');\n return pullConsentMetrics;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewConsentManager],\n }),\n start: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'The start date to pull metrics from',\n },\n end: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'The end date to pull metrics until',\n optional: true,\n },\n folder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder to save metrics to',\n default: './consent-metrics/',\n },\n bin: {\n kind: 'parsed',\n parse: String,\n brief: 'The bin metric when pulling data (1h or 1d)',\n default: '1d',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Pull consent metrics',\n fullDescription: `This command allows for pulling consent manager metrics for a Transcend account, or a set of Transcend accounts.\n\nBy default, the consent metrics will be written to a folder named \\`consent-metrics\\` within the directory where you run the command. You can override the location that these CSVs are written to using the flag \\`--folder=./my-folder/\\`. This folder will contain a set of CSV files:\n\n- \\`CONSENT_CHANGES_TIMESERIES_optIn.csv\\` -> this is a feed containing the number of explicit opt in events that happen - these are calls to \\`airgap.setConsent(event, { SaleOfInfo: true });\\`\n- \\`CONSENT_CHANGES_TIMESERIES_optOut.csv\\` -> this is a feed containing the number of explicit opt out events that happen - these are calls to \\`airgap.setConsent(event, { SaleOfInfo: false });\\`\n- \\`CONSENT_SESSIONS_BY_REGIME_Default.csv\\` -> this contains the number of sessions detected for the bin period\n- \\`PRIVACY_SIGNAL_TIMESERIES_DNT.csv\\` -> the number of DNT signals detected.\n- \\`PRIVACY_SIGNAL_TIMESERIES_GPC.csv\\` -> the number of GPC signals detected.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const pullConsentPreferencesCommand = buildCommand({\n loader: async () => {\n const { pullConsentPreferences } = await import('./impl');\n return pullConsentPreferences;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewManagedConsentDatabaseAdminApi],\n }),\n partition: {\n kind: 'parsed',\n parse: String,\n brief: 'Partition ID to query in the Preference Store',\n },\n sombraAuth: createSombraAuthParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to CSV output file',\n default: './preferences.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n // \"timestamp*\" filters map to consent collection time\n timestampBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief:\n 'Filter: preferences collected before this time (timestampBefore)',\n optional: true,\n },\n timestampAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Filter: preferences collected after this time (timestampAfter)',\n optional: true,\n },\n // \"updated*\" filters map to system.updatedAt window\n updatedBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief:\n 'Filter: preferences updated before this time (system.updatedAt)',\n optional: true,\n },\n updatedAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Filter: preferences updated after this time (system.updatedAt)',\n optional: true,\n },\n identifiers: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief:\n 'Filter specific users by identifier(s) as \"name:value\". ' +\n 'If name is omitted, defaults to \"email\". Multiple values separated by commas.',\n optional: true,\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Page size / concurrency used when downloading (1–50 per API). Higher = fewer pages.',\n default: '50',\n },\n },\n },\n docs: {\n brief: 'Pull consent preferences from the Managed Consent Database',\n fullDescription:\n 'Uses POST /v1/preferences/{partition}/query with cursor-based pagination. ' +\n 'Supports filtering by identifiers, collection timestamps, and system.updatedAt.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ConsentBundleType, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const updateConsentManagerCommand = buildCommand({\n loader: async () => {\n const { updateConsentManager } = await import('./impl');\n return updateConsentManager;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageConsentManagerDeveloperSettings],\n }),\n bundleTypes: {\n kind: 'enum',\n values: Object.values(ConsentBundleType),\n brief: 'The bundle types to deploy. Defaults to PRODUCTION,TEST.',\n variadic: ',',\n },\n deploy: {\n kind: 'boolean',\n brief:\n 'When true, deploy the Consent Manager after updating the version',\n default: false,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Update consent manager',\n fullDescription:\n 'This command allows for updating Consent Manager to latest version. The Consent Manager bundle can also be deployed using this command.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { createConsentUrlParameter } from '../../../lib/cli/common-parameters';\n\nexport const uploadConsentPreferencesCommand = buildCommand({\n loader: async () => {\n const { uploadConsentPreferences } = await import('./impl');\n return uploadConsentPreferences;\n },\n parameters: {\n flags: {\n base64EncryptionKey: {\n kind: 'parsed',\n parse: String,\n brief: 'The encryption key used to encrypt the userId',\n },\n base64SigningKey: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The signing key used to prove authentication of consent request',\n },\n partition: {\n kind: 'parsed',\n parse: String,\n brief: 'The partition key to download consent preferences to',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file to pull consent preferences from',\n default: './preferences.csv',\n },\n consentUrl: createConsentUrlParameter(),\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Upload consent preferences to the Managed Consent Database',\n fullDescription:\n 'This command allows for updating of consent preferences to the Managed Consent Database.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ConsentTrackerStatus, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadCookiesFromCsvCommand = buildCommand({\n loader: async () => {\n const { uploadCookiesFromCsv } = await import('./impl');\n return uploadCookiesFromCsv;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageDataFlow],\n }),\n trackerStatus: {\n kind: 'enum',\n values: Object.values(ConsentTrackerStatus),\n brief: 'The status of the cookies you will upload.',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to upload',\n default: './cookies.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Upload cookies from CSV',\n fullDescription: `Upload cookies from CSV. This command allows for uploading of cookies from CSV.\n\nStep 1) Download the CSV of cookies that you want to edit from the Admin Dashboard under [Consent Management -> Cookies](https://app.transcend.io/consent-manager/cookies). You can download cookies from both the \"Triage\" and \"Approved\" tabs.\n\nStep 2) You can edit the contents of the CSV file as needed. You may adjust the \"Purpose\" column, adjust the \"Notes\" column, add \"Owners\" and \"Teams\" or even add custom columns with additional metadata.\n\nStep 3) Upload the modified CSV file back into the dashboard with this command.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ConsentTrackerStatus, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadDataFlowsFromCsvCommand = buildCommand({\n loader: async () => {\n const { uploadDataFlowsFromCsv } = await import('./impl');\n return uploadDataFlowsFromCsv;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageDataFlow],\n }),\n trackerStatus: {\n kind: 'enum',\n values: Object.values(ConsentTrackerStatus),\n brief: 'The status of the data flows you will upload.',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to upload',\n default: './data-flows.csv',\n },\n classifyService: {\n kind: 'boolean',\n brief:\n 'When true, automatically assign the service for a data flow based on the domain that is specified',\n default: false,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Upload data flows from CSV',\n fullDescription: `Upload data flows from CSV. This command allows for uploading of data flows from CSV.\n\nStep 1) Download the CSV of data flows that you want to edit from the Admin Dashboard under [Consent Management -> Data Flows](https://app.transcend.io/consent-manager/data-flows). You can download data flows from both the \"Triage\" and \"Approved\" tabs.\n\nStep 2) You can edit the contents of the CSV file as needed. You may adjust the \"Purpose\" column, adjust the \"Notes\" column, add \"Owners\" and \"Teams\" or even add custom columns with additional metadata.\n\nStep 3) Upload the modified CSV file back into the dashboard with this command.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadPreferencesCommand = buildCommand({\n loader: async () => {\n const { uploadPreferences } = await import('./impl');\n return uploadPreferences;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.ManageStoredPreferences,\n ScopeName.ViewManagedConsentDatabaseAdminApi,\n ScopeName.ViewPreferenceStoreSettings,\n ],\n }),\n partition: {\n kind: 'parsed',\n parse: String,\n brief: 'The partition key to download consent preferences to',\n },\n sombraAuth: createSombraAuthParameter(),\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file to load preferences from',\n optional: true,\n },\n directory: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the directory of CSV files to load preferences from',\n optional: true,\n },\n dryRun: {\n kind: 'boolean',\n brief:\n 'Whether to do a dry run only - will write results to receiptFilepath without updating Transcend',\n default: false,\n },\n skipExistingRecordCheck: {\n kind: 'boolean',\n brief:\n 'Whether to skip the check for existing records. SHOULD ONLY BE USED FOR INITIAL UPLOAD',\n default: false,\n },\n receiptFileDir: {\n kind: 'parsed',\n parse: String,\n brief: 'Directory path where the response receipts should be saved',\n default: './receipts',\n },\n skipWorkflowTriggers: {\n kind: 'boolean',\n brief:\n 'Whether to skip workflow triggers when uploading to preference store',\n default: false,\n },\n forceTriggerWorkflows: {\n kind: 'boolean',\n brief:\n 'Whether to force trigger workflows for existing consent records',\n default: false,\n },\n skipConflictUpdates: {\n kind: 'boolean',\n brief:\n 'Whether to skip uploading of any records where the preference store and file have a hard conflict',\n default: false,\n },\n isSilent: {\n kind: 'boolean',\n brief: 'Whether to skip sending emails in workflows',\n default: true,\n },\n attributes: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Attributes to add to any DSR request if created. Comma-separated list of key:value pairs.',\n default: 'Tags:transcend-cli,Source:transcend-cli',\n },\n receiptFilepath: {\n kind: 'parsed',\n parse: String,\n brief: 'Store resulting, continuing where left off',\n default: './preference-management-upload-receipts.json',\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading in parallel',\n default: '10',\n },\n },\n },\n docs: {\n brief: 'Upload preference management data to your Preference Store',\n fullDescription: `Upload preference management data to your Preference Store.\n\nThis command prompts you to map the shape of the CSV to the shape of the Transcend API. There is no requirement for the shape of the incoming CSV, as the script will handle the mapping process.\n\nThe script will also produce a JSON cache file that allows for the mappings to be preserved between runs.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { parseDurationToMs } from '../../../lib/cli/parsers';\n\nexport const generateAccessTokensCommand = buildCommand({\n loader: async () => {\n const { generateAccessTokens } = await import('./impl');\n return generateAccessTokens;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.GeneratePreferenceAccessTokens],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the CSV file containing user identifiers to generate access tokens for',\n },\n subjectType: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Slug for the data subject that the user will be logged in as on the Privacy Center. e.g. \"customer\" or \"employee\"',\n },\n emailColumnName: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Name of the column in the CSV that contains user email addresses',\n default: 'email',\n },\n coreIdentifierColumnName: {\n kind: 'parsed',\n parse: String,\n optional: true,\n brief:\n 'Name of the column in the CSV that contains user core identifiers',\n },\n duration: {\n kind: 'parsed',\n parse: parseDurationToMs,\n brief:\n 'How long the access tokens should be valid. Accepts human-friendly values ' +\n 'like \"2 days\", \"10h\", \"90 minutes\". A bare number is interpreted as seconds ' +\n '(e.g., \"300\" = 5 minutes). Powered by the `ms` library: ' +\n 'https://github.com/vercel/ms',\n // Default of \"1y\" → parsed to 31_557_600_000 ms\n default: '1y',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Generate access tokens',\n fullDescription:\n 'This command allows for the generation of access tokens for users specified in a CSV file.',\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { deriveDataSilosFromDataFlowsCrossInstanceCommand } from './derive-data-silos-from-data-flows-cross-instance/command';\nimport { deriveDataSilosFromDataFlowsCommand } from './derive-data-silos-from-data-flows/command';\nimport { discoverSilosCommand } from './discover-silos/command';\nimport { pullDatapointsCommand } from './pull-datapoints/command';\nimport { pullUnstructuredDiscoveryFilesCommand } from './pull-unstructured-discovery-files/command';\nimport { pullCommand } from './pull/command';\nimport { pushCommand } from './push/command';\nimport { scanPackagesCommand } from './scan-packages/command';\nimport { consentManagerServiceJsonToYmlCommand } from './consent-manager-service-json-to-yml/command';\nimport { consentManagersToBusinessEntitiesCommand } from './consent-managers-to-business-entities/command';\n\nexport const inventoryRoutes = buildRouteMap({\n routes: {\n pull: pullCommand,\n push: pushCommand,\n 'scan-packages': scanPackagesCommand,\n 'discover-silos': discoverSilosCommand,\n 'pull-datapoints': pullDatapointsCommand,\n 'pull-unstructured-discovery-files': pullUnstructuredDiscoveryFilesCommand,\n 'derive-data-silos-from-data-flows': deriveDataSilosFromDataFlowsCommand,\n 'derive-data-silos-from-data-flows-cross-instance':\n deriveDataSilosFromDataFlowsCrossInstanceCommand,\n 'consent-manager-service-json-to-yml':\n consentManagerServiceJsonToYmlCommand,\n 'consent-managers-to-business-entities':\n consentManagersToBusinessEntitiesCommand,\n },\n docs: {\n brief: 'Inventory commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const deriveDataSilosFromDataFlowsCrossInstanceCommand = buildCommand({\n loader: async () => {\n const { deriveDataSilosFromDataFlowsCrossInstance } = await import(\n './impl'\n );\n return deriveDataSilosFromDataFlowsCrossInstance;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n }),\n dataFlowsYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder that contains data flow yml files',\n },\n output: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The output transcend.yml file containing the data silo configurations',\n default: './transcend.yml',\n },\n ignoreYmls: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'The set of yml files that should be skipped when uploading',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Derive data silos from data flows cross instance',\n fullDescription:\n 'Given a folder of data flow transcend.yml configurations, convert those configurations to a single transcend.yml configurations of all related data silos.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const deriveDataSilosFromDataFlowsCommand = buildCommand({\n loader: async () => {\n const { deriveDataSilosFromDataFlows } = await import('./impl');\n return deriveDataSilosFromDataFlows;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n }),\n dataFlowsYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder that contains data flow yml files',\n },\n dataSilosYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief: 'The folder that contains data silo yml files',\n },\n ignoreYmls: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'The set of yml files that should be skipped when uploading',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Derive data silos from data flows',\n fullDescription:\n 'Given a folder of data flow transcend.yml configurations, convert those configurations to set of data silo transcend.yml configurations.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../lib/cli/parsers';\n\nexport const discoverSilosCommand = buildCommand({\n loader: async () => {\n const { discoverSilos } = await import('./impl');\n return discoverSilos;\n },\n parameters: {\n flags: {\n scanPath: {\n kind: 'parsed',\n parse: String,\n brief: 'File path in the project to scan',\n },\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The UUID of the corresponding data silo',\n },\n auth: createAuthParameter({\n scopes: [ScopeName.ManageAssignedDataInventory],\n requiresSiloScope: true,\n }),\n fileGlobs: {\n kind: 'parsed',\n parse: String,\n brief:\n 'You can pass a glob syntax pattern(s) to specify additional file paths to scan. Comma-separated list of globs.',\n default: '',\n },\n ignoreDirs: {\n kind: 'parsed',\n parse: String,\n brief: 'Comma-separated list of directories to ignore.',\n default: '',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Scan dependency management files to discover new data silos.',\n fullDescription: `We support scanning for new data silos in JavaScript, Python, Gradle, and CocoaPods projects.\n\nTo get started, add a data silo for the corresponding project type with the \"silo discovery\" plugin enabled. For example, if you want to scan a JavaScript project, add a package.json data silo. Then, specify the data silo ID in the \"--dataSiloId\" parameter.`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { DataCategoryType, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const pullDatapointsCommand = buildCommand({\n loader: async () => {\n const { pullDatapoints } = await import('./impl');\n return pullDatapoints;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewDataInventory],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file to save datapoints to',\n default: './datapoints.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n dataSiloIds: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'List of data silo IDs to filter by',\n optional: true,\n },\n includeAttributes: {\n kind: 'boolean',\n brief: 'Whether to include attributes in the output',\n default: false,\n },\n includeGuessedCategories: {\n kind: 'boolean',\n brief: 'Whether to include guessed categories in the output',\n default: false,\n },\n parentCategories: {\n kind: 'enum',\n values: Object.values(DataCategoryType),\n brief: 'List of parent categories to filter by',\n variadic: ',',\n optional: true,\n },\n subCategories: {\n kind: 'parsed',\n parse: String,\n brief: 'List of subcategories to filter by',\n variadic: ',',\n optional: true,\n },\n },\n },\n docs: {\n brief: 'Export the datapoints from your Data Inventory into a CSV.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n ScopeName,\n UnstructuredSubDataPointRecommendationStatus,\n} from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const pullUnstructuredDiscoveryFilesCommand = buildCommand({\n loader: async () => {\n const { pullUnstructuredDiscoveryFiles } = await import('./impl');\n return pullUnstructuredDiscoveryFiles;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewDataInventory],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'The file to save datapoints to',\n default: './unstructured-discovery-files.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n dataSiloIds: {\n kind: 'parsed',\n parse: String,\n brief: 'List of data silo IDs to filter by',\n variadic: ',',\n optional: true,\n },\n subCategories: {\n kind: 'parsed',\n parse: String,\n brief: 'List of data categories to filter by',\n variadic: ',',\n optional: true,\n },\n status: {\n kind: 'enum',\n values: Object.values(UnstructuredSubDataPointRecommendationStatus),\n brief: 'List of classification statuses to filter by',\n variadic: ',',\n optional: true,\n },\n includeEncryptedSnippets: {\n kind: 'boolean',\n brief:\n 'Whether to include encrypted snippets of the entries classified',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Pull unstructured discovery files',\n fullDescription:\n 'This command allows for pulling Unstructured Discovery into a CSV.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const pushCommand = buildCommand({\n loader: async () => {\n const { push } = await import('./impl');\n return push;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: 'Varies',\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the YAML file to push from',\n default: './transcend.yml',\n },\n transcendUrl: createTranscendUrlParameter(),\n pageSize: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page size to use when paginating over the API',\n default: '50',\n },\n variables: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The variables to template into the YAML file when pushing configuration. Comma-separated list of key:value pairs.',\n default: '',\n },\n publishToPrivacyCenter: {\n kind: 'boolean',\n brief: 'When true, publish the configuration to the Privacy Center',\n default: false,\n },\n classifyService: {\n kind: 'boolean',\n brief:\n 'When true, automatically assign the service for a data flow based on the domain that is specified',\n default: false,\n },\n deleteExtraAttributeValues: {\n kind: 'boolean',\n brief:\n 'When true and syncing attributes, delete any extra attributes instead of just upserting',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Push metadata from transcend.yml to Transcend',\n fullDescription:\n 'Given a transcend.yml file, sync the contents up to your Transcend instance.',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const scanPackagesCommand = buildCommand({\n loader: async () => {\n const { scanPackages } = await import('./impl');\n return scanPackages;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageCodeScanning],\n }),\n scanPath: {\n kind: 'parsed',\n parse: String,\n brief: 'File path in the project to scan',\n default: './',\n },\n ignoreDirs: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'List of directories to ignore in scan',\n optional: true,\n },\n repositoryName: {\n kind: 'parsed',\n parse: String,\n brief: 'Name of the git repository that the package should be tied to',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Scan dependency management files to inventory code dependencies.',\n fullDescription: `Transcend scans packages and dependencies for the following frameworks:\n\n- package.json\n- requirements.txt & setup.py\n- Podfile\n- Package.resolved\n- build.gradle\n- pubspec.yaml\n- Gemfile & .gemspec\n- composer.json\n\nThis command will scan the folder you point at to look for any of these files. Once found, the build file will be parsed in search of dependencies. Those code packages and dependencies will be uploaded to Transcend. The information uploaded to Transcend is:\n\n- repository name\n- package names\n- dependency names and versions\n- package descriptions`,\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { buildExampleCommand } from '../../../lib/docgen/buildExamples';\nimport { ConsentManagerServiceJsonToYmlCommandFlags } from './impl';\nimport { PushCommandFlags } from '../push/impl';\n\nexport const consentManagerServiceJsonToYmlCommand = buildCommand({\n loader: async () => {\n const { consentManagerServiceJsonToYml } = await import('./impl');\n return consentManagerServiceJsonToYml;\n },\n parameters: {\n flags: {\n file: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the services.json file, output of await airgap.getMetadata()',\n default: './services.json',\n },\n output: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the output transcend.yml to write to',\n default: './transcend.yml',\n },\n },\n },\n docs: {\n brief: 'Convert consent manager services to transcend.yml',\n fullDescription: `Import the services from an airgap.js file into a Transcend instance.\n\n1. Run \\`await airgap.getMetadata()\\` on a site with airgap\n2. Right click on the printed object, and click \\`Copy object\\`\n3. Place output of file in a file named \\`services.json\\`\n4. Run:\n\n ${buildExampleCommand<ConsentManagerServiceJsonToYmlCommandFlags>(\n ['inventory', 'consent-manager-service-json-to-yml'],\n {\n file: './services.json',\n output: './transcend.yml',\n },\n { argsIndent: 5 },\n )}\n\n5. Run:\n\n ${buildExampleCommand<PushCommandFlags>(\n ['inventory', 'push'],\n {\n auth: '$TRANSCEND_API_KEY',\n file: './transcend.yml',\n classifyService: true,\n },\n { argsIndent: 5 },\n )}`,\n },\n});\n","import { name } from '../../constants';\n\nexport interface Example<Flags> {\n /** A description of the example */\n description: string;\n /** The flag arguments to the command */\n flags: Partial<Flags>;\n}\n\n/**\n * Builds a string of examples for the CLI\n *\n * @param commandPath - The path to the command to run, omitting the `transcend` command name, e.g., `['consent', 'upload-preferences']`\n * @param examples - The examples to build\n * @returns A string of examples for the CLI\n */\nexport function buildExamples<Flags = never>(\n commandPath: string[],\n examples: NoInfer<Example<Flags>>[],\n): string {\n return examples\n .map((example) => {\n const exampleCommand = buildExampleCommand<Flags>(\n commandPath,\n example.flags,\n );\n return `**${example.description}**\\n\\n\\`\\`\\`sh\\n${exampleCommand}\\n\\`\\`\\``;\n })\n .join('\\n\\n');\n}\n\n/**\n * Builds a command string for an example\n *\n * @param commandPath - The path to the command to run, omitting the `transcend` command name, e.g., `['consent', 'upload-preferences']`\n * @param flags - The flags to build the command with\n * @param options - The options for the command\n * @returns A command string for the example\n */\nexport function buildExampleCommand<Flags = never>(\n commandPath: string[],\n flags: NoInfer<Partial<Flags>>,\n options?: {\n /** If true, the command will be forced to a single line */\n forceSingleLine?: boolean;\n /** If true, the command will be indented */\n argsIndent?: number;\n },\n): string {\n const command = commandPath.join(' ');\n const flagList = getFlagList(flags);\n const { forceSingleLine = false, argsIndent = 2 } = options ?? {};\n\n if (flagList.length === 0) {\n return `${name} ${command}`;\n }\n\n // Break the command into multiple lines if it's too long\n const exampleCommand =\n `${name} ${command} ${flagList.join(' ')}`.length <= 117 && !forceSingleLine\n ? `${command} ${flagList.join(' ')}`\n : `${command} \\\\\\n${' '.repeat(argsIndent)}${flagList.join(\n ` \\\\\\n${' '.repeat(argsIndent)}`,\n )}`;\n\n // Add `transcend` before command name\n return `${name} ${exampleCommand}`;\n}\n\n/**\n * Formats a flag value to the bash string for an example command\n *\n * @param value - The value to format\n * @param depth - The depth of the recursion\n * @returns The formatted value\n */\nfunction formatFlagValue(value: unknown, depth = 0): string {\n if (typeof value === 'boolean') {\n return value ? 'true' : 'false';\n }\n\n if (typeof value === 'number') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toISOString();\n }\n\n if (Array.isArray(value) && depth === 0) {\n const values = value.map((v) => formatFlagValue(v, depth + 1));\n if (values.every((x) => x.startsWith('$') || x.includes(' '))) {\n return `\"${values.join(',')}\"`;\n }\n return values.join(',');\n }\n\n if (typeof value === 'string') {\n // If we're operating on list elements\n if (depth === 1) {\n if (value.startsWith('$')) {\n return `$\\{${value.slice(1)}}`;\n }\n return value;\n }\n\n // Escape strings that start with $ or contain spaces or special characters\n return value.startsWith('$') || value.includes(' ') ? `\"${value}\"` : value;\n }\n\n throw new Error(`Unsupported value type: ${typeof value}`);\n}\n\n/**\n * Builds a list of flags formatted for an example command\n *\n * @param flags - The flags to build the command with\n * @param depth - The depth of the recursion\n * @returns A list of flags for the example command\n */\nexport function getFlagList<Flags = never>(\n flags: Partial<Flags>,\n depth = 0,\n): string[] {\n return Object.entries(flags).map(([flag, value]) => {\n if (typeof value === 'boolean' && value) {\n // For true booleans, just pass the flag alone\n return `--${flag}`;\n }\n\n const formattedValue = formatFlagValue(value, depth);\n\n return `--${flag}=${formattedValue}`;\n });\n}\n","import { buildCommand } from '@stricli/core';\n\nexport const consentManagersToBusinessEntitiesCommand = buildCommand({\n loader: async () => {\n const { consentManagersToBusinessEntities } = await import('./impl');\n return consentManagersToBusinessEntities;\n },\n parameters: {\n flags: {\n consentManagerYmlFolder: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the folder of Consent Manager transcend.yml files to combine',\n },\n output: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the output transcend.yml with business entity configuration',\n default: './combined-business-entities.yml',\n },\n },\n },\n docs: {\n brief: 'Convert consent managers to business entities',\n fullDescription:\n 'This command allows for converting a folder or Consent Manager transcend.yml files into a single transcend.yml file where each consent manager configuration is a Business Entity in the data inventory.',\n },\n});\n","import { buildCommand, type TypedFlagParameter } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { OneTrustPullResource, OneTrustPullSource } from '../../../enums';\nimport type { LocalContext } from '../../../context';\n\nexport const syncOtCommand = buildCommand({\n loader: async () => {\n const { syncOt } = await import('./impl');\n return syncOt;\n },\n parameters: {\n flags: {\n hostname: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The domain of the OneTrust environment from which to pull the resource',\n optional: true,\n },\n oneTrustAuth: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The OAuth access token with the scopes necessary to access the OneTrust Public APIs',\n optional: true,\n },\n source: {\n kind: 'enum',\n values: Object.values(OneTrustPullSource) as OneTrustPullSource[],\n brief: 'Whether to read the assessments from OneTrust or from a file',\n default: OneTrustPullSource.OneTrust,\n },\n transcendAuth: {\n ...createAuthParameter({\n scopes: [ScopeName.ManageAssessments],\n }),\n optional: true,\n } as TypedFlagParameter<string | undefined, LocalContext>,\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Path to the file to pull the resource into. Must be a json file!',\n optional: true,\n },\n resource: {\n kind: 'enum',\n values: Object.values(OneTrustPullResource) as OneTrustPullResource[],\n brief:\n 'The resource to pull from OneTrust. For now, only assessments is supported',\n default: OneTrustPullResource.Assessments,\n },\n dryRun: {\n kind: 'boolean',\n brief:\n 'Whether to export the resource to a file rather than sync to Transcend',\n default: false,\n },\n debug: {\n kind: 'boolean',\n brief: 'Whether to print detailed logs in case of error',\n default: false,\n },\n },\n },\n docs: {\n brief: 'Sync OneTrust data',\n fullDescription: `Pulls resources from a OneTrust and syncs them to a Transcend instance. For now, it only supports retrieving OneTrust Assessments.\n\nThis command can be helpful if you are looking to:\n- Pull resources from your OneTrust account.\n- Migrate your resources from your OneTrust account to Transcend.\n\nOneTrust authentication requires an OAuth Token with scope for accessing the assessment endpoints.\nIf syncing the resources to Transcend, you will also need to generate an API key on the Transcend Admin Dashboard.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { syncOtCommand } from './sync-ot/command';\n\nexport const migrationRoutes = buildRouteMap({\n routes: {\n 'sync-ot': syncOtCommand,\n },\n docs: {\n brief: 'Migration commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport type { PullIdentifiersCommandFlags } from '../pull-identifiers/impl';\nimport { buildExampleCommand } from '../../../../lib/docgen/buildExamples';\nimport type { MarkIdentifiersCompletedCommandFlags } from './impl';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const markIdentifiersCompletedCommand = buildCommand({\n loader: async () => {\n const { markIdentifiersCompleted } = await import('./impl');\n return markIdentifiersCompleted;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n requiresSiloScope: true,\n }),\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the data silo to pull in',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n sombraAuth: createSombraAuthParameter(),\n },\n },\n docs: {\n brief: 'Mark identifiers as completed after processing.',\n fullDescription: `This command takes the output of \"${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'cron', 'pull-identifiers'],\n {},\n )}\" and notifies Transcend that all of the requests in the CSV have been processed.\nThis is used in the workflow like:\n\n1. Pull identifiers to CSV:\n\n ${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'cron', 'pull-identifiers'],\n {\n auth: '$TRANSCEND_API_KEY',\n dataSiloId: '70810f2e-cf90-43f6-9776-901a5950599f',\n actions: [RequestAction.Erasure],\n file: './outstanding-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\n2. Run your process to operate on that CSV of requests.\n\n3. Notify Transcend of completion\n\n ${buildExampleCommand<MarkIdentifiersCompletedCommandFlags>(\n ['request', 'cron', 'mark-identifiers-completed'],\n {\n auth: '$TRANSCEND_API_KEY',\n dataSiloId: '70810f2e-cf90-43f6-9776-901a5950599f',\n file: './outstanding-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\nRead more at https://docs.transcend.io/docs/integrations/cron-job-integration.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const pullIdentifiersCommand = buildCommand({\n loader: async () => {\n const { pullIdentifiers } = await import('./impl');\n return pullIdentifiers;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n requiresSiloScope: true,\n }),\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the data silo to pull in',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to restart',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n sombraAuth: createSombraAuthParameter(),\n pageLimit: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page limit to use when pulling in pages of identifiers',\n default: '100',\n },\n skipRequestCount: {\n kind: 'boolean',\n brief:\n 'Whether to skip the count of all outstanding requests. This is required to render the progress bar, but can take a long time to run if you have a large number of outstanding requests to process. In that case, we recommend setting skipRequestCount=true so that you can still proceed with fetching the identifiers',\n default: false,\n },\n chunkSize: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Maximum number of rows per CSV file. For large datasets, the output will be automatically split into multiple files to avoid file system size limits. Each file will contain at most this many rows',\n default: '10000',\n },\n },\n },\n docs: {\n brief: 'Pull identifiers of outstanding requests for a data silo to a CSV.',\n fullDescription: `If you are using the cron job integration, you can run this command to pull the outstanding identifiers for the data silo to a CSV.\n\nFor large datasets, the output will be automatically split into multiple CSV files to avoid file system size limits. Use the --chunkSize parameter to control the maximum number of rows per file.\n\nRead more at https://docs.transcend.io/docs/integrations/cron-job-integration.`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport { RequestAction } from '@transcend-io/privacy-types';\n\nexport const pullProfilesCommand = buildCommand({\n loader: async () => {\n const { pullProfiles } = await import('./impl');\n return pullProfiles;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [],\n requiresSiloScope: true,\n }),\n cronDataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the cron data silo to pull in',\n },\n targetDataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the target data silo to pull in',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to restart',\n },\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers.csv',\n },\n fileTarget: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './cron-identifiers-target.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n sombraAuth: createSombraAuthParameter(),\n pageLimit: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page limit to use when pulling in pages of identifiers',\n default: '100',\n },\n skipRequestCount: {\n kind: 'boolean',\n brief:\n 'Whether to skip the count of all outstanding requests. This is required to render the progress bar, but can take a long time to run if you have a large number of outstanding requests to process. In that case, we recommend setting skipRequestCount=true so that you can still proceed with fetching the identifiers',\n default: false,\n },\n chunkSize: {\n kind: 'parsed',\n parse: numberParser,\n brief:\n 'Maximum number of rows per CSV file. For large datasets, the output will be automatically split into multiple files to avoid file system size limits. Each file will contain at most this many rows',\n default: '10000',\n },\n },\n },\n docs: {\n brief: 'Pull profiles of outstanding requests for a data silo to a CSV.',\n fullDescription: `If you are using the cron job integration, you can run this command to pull the outstanding profiles for the data silo to a CSV.\n\nFor large datasets, the output will be automatically split into multiple CSV files to avoid file system size limits. Use the --chunkSize parameter to control the maximum number of rows per file.\n\nRead more at https://docs.transcend.io/docs/integrations/cron-job-integration.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { markIdentifiersCompletedCommand } from './mark-identifiers-completed/command';\nimport { pullIdentifiersCommand } from './pull-identifiers/command';\nimport { pullProfilesCommand } from './pull-profiles/command';\n\nexport const cronRoutes = buildRouteMap({\n routes: {\n 'pull-identifiers': pullIdentifiersCommand,\n 'pull-profiles': pullProfilesCommand,\n 'mark-identifiers-completed': markIdentifiersCompletedCommand,\n },\n docs: {\n brief: 'Cron commands',\n hideRoute: {\n 'pull-profiles': true,\n },\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n RequestAction,\n RequestEnricherStatus,\n ScopeName,\n} from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const enricherRestartCommand = buildCommand({\n loader: async () => {\n const { enricherRestart } = await import('./impl');\n return enricherRestart;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageRequestCompilation],\n }),\n enricherId: {\n kind: 'parsed',\n parse: String,\n brief: 'The ID of the enricher to restart',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request action to restart',\n optional: true,\n },\n requestEnricherStatuses: {\n kind: 'enum',\n values: Object.values(RequestEnricherStatus),\n variadic: ',',\n brief: 'The request enricher statuses to restart',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '15',\n },\n requestIds: {\n kind: 'parsed',\n parse: String,\n variadic: ',',\n brief: 'Specify the specific request IDs to restart',\n optional: true,\n },\n createdAtBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Restart requests that were submitted before this time',\n optional: true,\n },\n createdAtAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Restart requests that were submitted after this time',\n optional: true,\n },\n },\n },\n docs: {\n brief: 'Bulk restart a particular enricher across a series of DSRs',\n fullDescription: `Bulk restart a particular enricher across a series of DSRs.\n\nThe API key needs the following scopes:\n- Manage Request Compilation`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport {\n RequestAction,\n RequestStatus,\n ScopeName,\n} from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\nimport { dateParser } from '../../../lib/cli/parsers';\n\nexport const exportCommand = buildCommand({\n loader: async () => {\n const { _export } = await import('./impl');\n return _export;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewRequests, ScopeName.ViewRequestCompilation],\n }),\n sombraAuth: createSombraAuthParameter(),\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to export',\n optional: true,\n },\n statuses: {\n kind: 'enum',\n values: Object.values(RequestStatus),\n variadic: ',',\n brief: 'The request statuses to export',\n optional: true,\n },\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where identifiers will be written to',\n default: './transcend-request-export.csv',\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '50',\n },\n skipRequestIdentifiers: {\n kind: 'boolean',\n brief: 'Skip exporting request identifiers',\n optional: true,\n },\n createdAtBefore: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Pull requests that were submitted before this time',\n optional: true,\n },\n createdAtAfter: {\n kind: 'parsed',\n parse: dateParser,\n brief: 'Pull requests that were submitted after this time',\n optional: true,\n },\n showTests: {\n kind: 'boolean',\n brief:\n 'Filter for test requests or production requests - when not provided, pulls both',\n optional: true,\n },\n pageLimit: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The page limit to use when pulling in pages of requests',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Export privacy requests and request identifiers to a CSV file',\n fullDescription:\n 'Export privacy requests and request identifiers to a CSV file.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { RequestAction, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { buildExampleCommand } from '../../../../lib/docgen/buildExamples';\nimport type { PullIdentifiersCommandFlags } from './impl';\nimport type { PushIdentifiersCommandFlags } from '../push-identifiers/impl';\n\nexport const pullIdentifiersCommand = buildCommand({\n loader: async () => {\n const { pullIdentifiers } = await import('./impl');\n return pullIdentifiers;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ViewRequests, ScopeName.ViewRequestCompilation],\n }),\n sombraAuth: createSombraAuthParameter(),\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where requests will be written to',\n default: './manual-enrichment-identifiers.csv',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to pull for',\n optional: true,\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Pull identifiers for manual enrichment',\n fullDescription: `This command pulls down the set of privacy requests that are currently pending manual enrichment.\n\nThis is useful for the following workflow:\n\n1. Pull identifiers to CSV:\n\n ${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'preflight', 'pull-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\n2. Fill out the CSV with additional identifiers\n\n3. Push updated back to Transcend:\n\n ${buildExampleCommand<PushIdentifiersCommandFlags>(\n ['request', 'preflight', 'push-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}`,\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\nimport { buildExampleCommand } from '../../../../lib/docgen/buildExamples';\nimport type { PullIdentifiersCommandFlags } from '../pull-identifiers/impl';\nimport type { PushIdentifiersCommandFlags } from './impl';\n\nexport const pushIdentifiersCommand = buildCommand({\n loader: async () => {\n const { pushIdentifiers } = await import('./impl');\n return pushIdentifiers;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.ManageRequestIdentities,\n ScopeName.ManageRequestCompilation,\n ],\n }),\n enricherId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the Request Enricher to upload to',\n },\n sombraAuth: createSombraAuthParameter(),\n transcendUrl: createTranscendUrlParameter(),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file where requests will be written to',\n default: './manual-enrichment-identifiers.csv',\n },\n markSilent: {\n kind: 'boolean',\n brief: 'When true, set requests into silent mode before enriching',\n default: false,\n },\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '100',\n },\n },\n },\n docs: {\n brief: 'Push identifiers for manual enrichment',\n fullDescription: `This command push up a set of identifiers for a set of requests pending manual enrichment.\n\nThis is useful for the following workflow:\n\n1. Pull identifiers to CSV:\n\n ${buildExampleCommand<PullIdentifiersCommandFlags>(\n ['request', 'preflight', 'pull-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}\n\n2. Fill out the CSV with additional identifiers\n\n3. Push updated back to Transcend:\n\n ${buildExampleCommand<PushIdentifiersCommandFlags>(\n ['request', 'preflight', 'push-identifiers'],\n {\n file: './enrichment-requests.csv',\n },\n { argsIndent: 5 },\n )}`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { pullIdentifiersCommand } from './pull-identifiers/command';\nimport { pushIdentifiersCommand } from './push-identifiers/command';\n\nexport const preflightRoutes = buildRouteMap({\n routes: {\n 'pull-identifiers': pullIdentifiersCommand,\n 'push-identifiers': pushIdentifiersCommand,\n },\n docs: {\n brief: 'Preflight commands',\n },\n});\n","import { buildCommand } from '@stricli/core';\nimport { RequestAction, ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createTranscendUrlParameter,\n} from '../../../../lib/cli/common-parameters';\nimport { uuidParser } from '../../../../lib/cli/parsers';\n\nexport const retryRequestDataSilosCommand = buildCommand({\n loader: async () => {\n const { retryRequestDataSilos } = await import('./impl');\n return retryRequestDataSilos;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [ScopeName.ManageRequestCompilation],\n }),\n dataSiloId: {\n kind: 'parsed',\n parse: uuidParser,\n brief: 'The ID of the data silo to pull in',\n },\n actions: {\n kind: 'enum',\n values: Object.values(RequestAction),\n variadic: ',',\n brief: 'The request actions to restart',\n },\n transcendUrl: createTranscendUrlParameter(),\n },\n },\n docs: {\n brief: 'Retry request data silos',\n fullDescription:\n 'This command allows for bulk restarting a set of data silos jobs for open privacy requests. This is equivalent to clicking the \"Wipe and Retry\" button for a particular data silo across a set of privacy requests.',\n },\n});\n","import { buildCommand, numberParser } from '@stricli/core';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport {\n createAuthParameter,\n createSombraAuthParameter,\n createTranscendUrlParameter,\n} from '../../../lib/cli/common-parameters';\n\nexport const uploadCommand = buildCommand({\n loader: async () => {\n const { upload } = await import('./impl');\n return upload;\n },\n parameters: {\n flags: {\n auth: createAuthParameter({\n scopes: [\n ScopeName.MakeDataSubjectRequest,\n ScopeName.ViewRequestIdentitySettings,\n ScopeName.ViewGlobalAttributes,\n ],\n }),\n file: {\n kind: 'parsed',\n parse: String,\n brief: 'Path to the CSV file of requests to upload',\n default: './requests.csv',\n },\n transcendUrl: createTranscendUrlParameter(),\n cacheFilepath: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The path to the JSON file encoding the metadata used to map the CSV shape to Transcend API',\n default: './transcend-privacy-requests-cache.json',\n },\n requestReceiptFolder: {\n kind: 'parsed',\n parse: String,\n brief:\n 'The path to the folder where receipts of each upload are stored',\n default: './privacy-request-upload-receipts',\n },\n sombraAuth: createSombraAuthParameter(),\n concurrency: {\n kind: 'parsed',\n parse: numberParser,\n brief: 'The concurrency to use when uploading requests in parallel',\n default: '50',\n },\n attributes: {\n kind: 'parsed',\n parse: String,\n brief:\n 'Tag all of the requests with the following attributes. Format: key1:value1;value2,key2:value3;value4',\n default: 'Tags:transcend-cli',\n },\n isTest: {\n kind: 'boolean',\n brief:\n 'Flag whether the requests being uploaded are test requests or regular requests',\n default: false,\n },\n isSilent: {\n kind: 'boolean',\n brief:\n 'Flag whether the requests being uploaded should be submitted in silent mode',\n default: true,\n },\n skipSendingReceipt: {\n kind: 'boolean',\n brief: 'Flag whether to skip sending of the receipt email',\n default: false,\n },\n emailIsVerified: {\n kind: 'boolean',\n brief:\n 'Indicate whether the email address being uploaded is pre-verified. Set to false to send a verification email',\n default: true,\n },\n skipFilterStep: {\n kind: 'boolean',\n brief: 'When true, skip the interactive step to filter down the CSV',\n default: false,\n },\n dryRun: {\n kind: 'boolean',\n brief:\n 'When true, perform a dry run of the upload instead of calling the API to submit the requests',\n default: false,\n },\n debug: {\n kind: 'boolean',\n brief: 'Debug logging',\n default: false,\n },\n defaultPhoneCountryCode: {\n kind: 'parsed',\n parse: String,\n brief:\n 'When uploading phone numbers, if the phone number is missing a country code, assume this country code',\n default: '1',\n },\n },\n },\n docs: {\n brief: 'Upload a set of requests from a CSV',\n fullDescription: `Upload a set of requests from a CSV.\n\nThis command prompts you to map the shape of the CSV to the shape of the Transcend API. There is no requirement for the shape of the incoming CSV, as the script will handle the mapping process.\n\nThe script will also produce a JSON cache file that allows for the mappings to be preserved between runs.`,\n },\n});\n","import { buildRouteMap } from '@stricli/core';\nimport { approveCommand } from './approve/command';\nimport { cancelCommand } from './cancel/command';\nimport { cronRoutes } from './cron/routes';\nimport { downloadFilesCommand } from './download-files/command';\nimport { enricherRestartCommand } from './enricher-restart/command';\nimport { exportCommand } from './export/command';\nimport { markSilentCommand } from './mark-silent/command';\nimport { notifyAdditionalTimeCommand } from './notify-additional-time/command';\nimport { preflightRoutes } from './preflight/routes';\nimport { rejectUnverifiedIdentifiersCommand } from './reject-unverified-identifiers/command';\nimport { restartCommand } from './restart/command';\nimport { skipPreflightJobsCommand } from './skip-preflight-jobs/command';\nimport { systemRoutes } from './system/routes';\nimport { uploadCommand } from './upload/command';\n\nexport const requestRoutes = buildRouteMap({\n routes: {\n approve: approveCommand,\n upload: uploadCommand,\n 'download-files': downloadFilesCommand,\n cancel: cancelCommand,\n restart: restartCommand,\n 'notify-additional-time': notifyAdditionalTimeCommand,\n 'mark-silent': markSilentCommand,\n 'enricher-restart': enricherRestartCommand,\n 'reject-unverified-identifiers': rejectUnverifiedIdentifiersCommand,\n export: exportCommand,\n 'skip-preflight-jobs': skipPreflightJobsCommand,\n system: systemRoutes,\n preflight: preflightRoutes,\n cron: cronRoutes,\n },\n docs: {\n brief: 'All commands related to DSR requests',\n },\n});\n"]}