@transcend-io/cli 8.31.0 → 8.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/bin/bash-complete.cjs +1 -1
  2. package/dist/bin/cli.cjs +1 -1
  3. package/dist/bin/deprecated-command.cjs +2 -2
  4. package/dist/{chunk-5SEDJJAH.cjs → chunk-52MA7ZLS.cjs} +2 -2
  5. package/dist/{chunk-5SEDJJAH.cjs.map → chunk-52MA7ZLS.cjs.map} +1 -1
  6. package/dist/{chunk-VWGA62SG.cjs → chunk-55B57ZAY.cjs} +4 -4
  7. package/dist/{chunk-VWGA62SG.cjs.map → chunk-55B57ZAY.cjs.map} +1 -1
  8. package/dist/{chunk-HAAVY3FG.cjs → chunk-7H4ALAHC.cjs} +4 -4
  9. package/dist/{chunk-HAAVY3FG.cjs.map → chunk-7H4ALAHC.cjs.map} +1 -1
  10. package/dist/{chunk-CBBHRSKJ.cjs → chunk-ALOB5SWZ.cjs} +2 -2
  11. package/dist/{chunk-CBBHRSKJ.cjs.map → chunk-ALOB5SWZ.cjs.map} +1 -1
  12. package/dist/{chunk-CLJATLM4.cjs → chunk-DIB7IOEX.cjs} +2 -2
  13. package/dist/{chunk-CLJATLM4.cjs.map → chunk-DIB7IOEX.cjs.map} +1 -1
  14. package/dist/{chunk-J7BM4Z6U.cjs → chunk-G522ZIHS.cjs} +2 -2
  15. package/dist/{chunk-J7BM4Z6U.cjs.map → chunk-G522ZIHS.cjs.map} +1 -1
  16. package/dist/{chunk-ZZPMCMEB.cjs → chunk-HCEZRZHV.cjs} +6 -6
  17. package/dist/{chunk-ZZPMCMEB.cjs.map → chunk-HCEZRZHV.cjs.map} +1 -1
  18. package/dist/{chunk-HUZESENZ.cjs → chunk-M3Y6JH6I.cjs} +2 -2
  19. package/dist/{chunk-HUZESENZ.cjs.map → chunk-M3Y6JH6I.cjs.map} +1 -1
  20. package/dist/{chunk-JSVWGZUF.cjs → chunk-M7OVJJGB.cjs} +4 -4
  21. package/dist/{chunk-JSVWGZUF.cjs.map → chunk-M7OVJJGB.cjs.map} +1 -1
  22. package/dist/{chunk-EA6WCT7X.cjs → chunk-MXT7N555.cjs} +21 -21
  23. package/dist/{chunk-EA6WCT7X.cjs.map → chunk-MXT7N555.cjs.map} +1 -1
  24. package/dist/{chunk-UHERPTMC.cjs → chunk-NC6VWOMN.cjs} +2 -2
  25. package/dist/{chunk-UHERPTMC.cjs.map → chunk-NC6VWOMN.cjs.map} +1 -1
  26. package/dist/{chunk-FMFQTG5Q.cjs → chunk-Q2RJZGYW.cjs} +2 -2
  27. package/dist/{chunk-FMFQTG5Q.cjs.map → chunk-Q2RJZGYW.cjs.map} +1 -1
  28. package/dist/{chunk-WAWECZTF.cjs → chunk-SKOTYI3A.cjs} +2 -2
  29. package/dist/chunk-SKOTYI3A.cjs.map +1 -0
  30. package/dist/{chunk-FZTNEEMW.cjs → chunk-XXFLFF7Q.cjs} +2 -2
  31. package/dist/{chunk-FZTNEEMW.cjs.map → chunk-XXFLFF7Q.cjs.map} +1 -1
  32. package/dist/{impl-3X74MLJH.cjs → impl-4CWCLU5Z.cjs} +2 -2
  33. package/dist/{impl-3X74MLJH.cjs.map → impl-4CWCLU5Z.cjs.map} +1 -1
  34. package/dist/{impl-3NPILIEL.cjs → impl-542SIWQ2.cjs} +2 -2
  35. package/dist/{impl-3NPILIEL.cjs.map → impl-542SIWQ2.cjs.map} +1 -1
  36. package/dist/{impl-EUBXVGYE.cjs → impl-55GTRVMZ.cjs} +2 -2
  37. package/dist/{impl-EUBXVGYE.cjs.map → impl-55GTRVMZ.cjs.map} +1 -1
  38. package/dist/{impl-YGWOUGKU.cjs → impl-5VMEZB7F.cjs} +2 -2
  39. package/dist/{impl-YGWOUGKU.cjs.map → impl-5VMEZB7F.cjs.map} +1 -1
  40. package/dist/{impl-GRFZUIPA.cjs → impl-6ANYWCOV.cjs} +2 -2
  41. package/dist/{impl-GRFZUIPA.cjs.map → impl-6ANYWCOV.cjs.map} +1 -1
  42. package/dist/{impl-CDNCBR7T.cjs → impl-A7XL5O4W.cjs} +2 -2
  43. package/dist/{impl-CDNCBR7T.cjs.map → impl-A7XL5O4W.cjs.map} +1 -1
  44. package/dist/{impl-AS634NMX.cjs → impl-BQNXMBQ4.cjs} +4 -4
  45. package/dist/{impl-AS634NMX.cjs.map → impl-BQNXMBQ4.cjs.map} +1 -1
  46. package/dist/{impl-GISNUHI6.cjs → impl-CFYRFABZ.cjs} +5 -5
  47. package/dist/{impl-GISNUHI6.cjs.map → impl-CFYRFABZ.cjs.map} +1 -1
  48. package/dist/{impl-YL4BEMVB.cjs → impl-D2HENZNO.cjs} +2 -2
  49. package/dist/{impl-YL4BEMVB.cjs.map → impl-D2HENZNO.cjs.map} +1 -1
  50. package/dist/{impl-MDV6LYET.cjs → impl-GEEPG7OH.cjs} +2 -2
  51. package/dist/{impl-MDV6LYET.cjs.map → impl-GEEPG7OH.cjs.map} +1 -1
  52. package/dist/{impl-64R4NW2W.cjs → impl-JFYHXSOV.cjs} +2 -2
  53. package/dist/{impl-64R4NW2W.cjs.map → impl-JFYHXSOV.cjs.map} +1 -1
  54. package/dist/{impl-E6HLH54N.cjs → impl-JQVCW52V.cjs} +2 -2
  55. package/dist/{impl-E6HLH54N.cjs.map → impl-JQVCW52V.cjs.map} +1 -1
  56. package/dist/impl-JSXYZHX4.cjs +2 -0
  57. package/dist/{impl-VWVHHW42.cjs.map → impl-JSXYZHX4.cjs.map} +1 -1
  58. package/dist/{impl-U2HXJYMF.cjs → impl-K2D3GTZG.cjs} +2 -2
  59. package/dist/{impl-U2HXJYMF.cjs.map → impl-K2D3GTZG.cjs.map} +1 -1
  60. package/dist/{impl-ZNEHRZSH.cjs → impl-KQYINEBI.cjs} +2 -2
  61. package/dist/{impl-ZNEHRZSH.cjs.map → impl-KQYINEBI.cjs.map} +1 -1
  62. package/dist/{impl-WJUSRANT.cjs → impl-KRJNBGJ6.cjs} +2 -2
  63. package/dist/{impl-WJUSRANT.cjs.map → impl-KRJNBGJ6.cjs.map} +1 -1
  64. package/dist/{impl-L5CDLEYL.cjs → impl-NK42TN4C.cjs} +2 -2
  65. package/dist/{impl-L5CDLEYL.cjs.map → impl-NK42TN4C.cjs.map} +1 -1
  66. package/dist/{impl-2F2MAY5Q.cjs → impl-OQAP7YDW.cjs} +2 -2
  67. package/dist/{impl-2F2MAY5Q.cjs.map → impl-OQAP7YDW.cjs.map} +1 -1
  68. package/dist/{impl-MEYQSNWH.cjs → impl-PHBUSAGS.cjs} +2 -2
  69. package/dist/{impl-MEYQSNWH.cjs.map → impl-PHBUSAGS.cjs.map} +1 -1
  70. package/dist/{impl-4TYC4KRL.cjs → impl-PKWSORXX.cjs} +2 -2
  71. package/dist/{impl-4TYC4KRL.cjs.map → impl-PKWSORXX.cjs.map} +1 -1
  72. package/dist/{impl-BRV53IYV.cjs → impl-PWYKAVK4.cjs} +2 -2
  73. package/dist/{impl-BRV53IYV.cjs.map → impl-PWYKAVK4.cjs.map} +1 -1
  74. package/dist/{impl-ZVMSDS7K.cjs → impl-Q3P6DGHG.cjs} +2 -2
  75. package/dist/{impl-ZVMSDS7K.cjs.map → impl-Q3P6DGHG.cjs.map} +1 -1
  76. package/dist/{impl-FOWYFCLQ.cjs → impl-RD5UOJY6.cjs} +2 -2
  77. package/dist/{impl-FOWYFCLQ.cjs.map → impl-RD5UOJY6.cjs.map} +1 -1
  78. package/dist/{impl-5BYWLODX.cjs → impl-REKQO7ZI.cjs} +2 -2
  79. package/dist/{impl-5BYWLODX.cjs.map → impl-REKQO7ZI.cjs.map} +1 -1
  80. package/dist/{impl-KM3U7E44.cjs → impl-RI3WQFOE.cjs} +3 -3
  81. package/dist/{impl-KM3U7E44.cjs.map → impl-RI3WQFOE.cjs.map} +1 -1
  82. package/dist/impl-SRI65ZIC.cjs +2 -0
  83. package/dist/{impl-C52MFDKN.cjs.map → impl-SRI65ZIC.cjs.map} +1 -1
  84. package/dist/{impl-T3YCRT7O.cjs → impl-T67PUM7X.cjs} +2 -2
  85. package/dist/{impl-T3YCRT7O.cjs.map → impl-T67PUM7X.cjs.map} +1 -1
  86. package/dist/{impl-NRPKPOKV.cjs → impl-TCR3Y3J2.cjs} +2 -2
  87. package/dist/{impl-NRPKPOKV.cjs.map → impl-TCR3Y3J2.cjs.map} +1 -1
  88. package/dist/{impl-FORZFZ2Q.cjs → impl-U46BMUFL.cjs} +2 -2
  89. package/dist/{impl-FORZFZ2Q.cjs.map → impl-U46BMUFL.cjs.map} +1 -1
  90. package/dist/{impl-BBDBG5OZ.cjs → impl-UVQJ7HSK.cjs} +3 -3
  91. package/dist/{impl-BBDBG5OZ.cjs.map → impl-UVQJ7HSK.cjs.map} +1 -1
  92. package/dist/{impl-QOFK7XCV.cjs → impl-V3MXFXZF.cjs} +2 -2
  93. package/dist/{impl-QOFK7XCV.cjs.map → impl-V3MXFXZF.cjs.map} +1 -1
  94. package/dist/{impl-HRQUBR2Y.cjs → impl-VL3CJ2OT.cjs} +2 -2
  95. package/dist/{impl-HRQUBR2Y.cjs.map → impl-VL3CJ2OT.cjs.map} +1 -1
  96. package/dist/{impl-TU75DDAK.cjs → impl-VT3C6SP4.cjs} +2 -2
  97. package/dist/{impl-TU75DDAK.cjs.map → impl-VT3C6SP4.cjs.map} +1 -1
  98. package/dist/{impl-B4H2FDZW.cjs → impl-VUAC7AYF.cjs} +2 -2
  99. package/dist/{impl-B4H2FDZW.cjs.map → impl-VUAC7AYF.cjs.map} +1 -1
  100. package/dist/{impl-OTMLF2EA.cjs → impl-VXOHC45F.cjs} +2 -2
  101. package/dist/{impl-OTMLF2EA.cjs.map → impl-VXOHC45F.cjs.map} +1 -1
  102. package/dist/{impl-P2KE5XGI.cjs → impl-WMI46UXI.cjs} +2 -2
  103. package/dist/{impl-P2KE5XGI.cjs.map → impl-WMI46UXI.cjs.map} +1 -1
  104. package/dist/{impl-DLES54N2.cjs → impl-XJBUIDZP.cjs} +2 -2
  105. package/dist/{impl-DLES54N2.cjs.map → impl-XJBUIDZP.cjs.map} +1 -1
  106. package/dist/{impl-7XQ333J3.cjs → impl-XLL66FXK.cjs} +2 -2
  107. package/dist/{impl-7XQ333J3.cjs.map → impl-XLL66FXK.cjs.map} +1 -1
  108. package/dist/{impl-FCNDIDLG.cjs → impl-YGVW4RTA.cjs} +2 -2
  109. package/dist/{impl-FCNDIDLG.cjs.map → impl-YGVW4RTA.cjs.map} +1 -1
  110. package/dist/{impl-YDV6YOOI.cjs → impl-ZAKPYQ32.cjs} +2 -2
  111. package/dist/{impl-YDV6YOOI.cjs.map → impl-ZAKPYQ32.cjs.map} +1 -1
  112. package/dist/{impl-ZHTH3L2C.cjs → impl-ZTYQ3IB5.cjs} +2 -2
  113. package/dist/{impl-ZHTH3L2C.cjs.map → impl-ZTYQ3IB5.cjs.map} +1 -1
  114. package/dist/index.cjs +3 -3
  115. package/dist/index.d.cts +1 -1
  116. package/package.json +1 -1
  117. package/dist/chunk-WAWECZTF.cjs.map +0 -1
  118. package/dist/impl-C52MFDKN.cjs +0 -2
  119. package/dist/impl-VWVHHW42.cjs +0 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-KM3U7E44.cjs","../src/commands/inventory/push/impl.ts"],"names":["syncConfiguration","transcendUrl","auth","pageSize","publishToPrivacyCenter","contents","deleteExtraAttributeValues","classifyService","client","buildTranscendGraphQLClient","syncConfigurationToTranscend","err","logger","colors"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAgD,gCAA6B,wDAAyC,wDAA0D,gCAA6B,wDAAyC,wDAAyC,gCAA6B,oCCGnX,wBACY,4BACjB,gFAEF,MAmBnB,SAAeA,CAAAA,CAAkB,CAC/B,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,0BAAA,CAAAC,CAAAA,CAA6B,CAAA,CAAA,CAC7B,eAAA,CAAAC,CAAAA,CAAkB,CAAA,CACpB,CAAA,CAeqB,CACnB,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BR,CAAcC,CAAI,CAAA,CAG7D,GAAI,CAWF,MAAO,CAVkB,MAAMQ,kCAAAA,CAC7BL,CACAG,CAAAA,CACA,CACE,QAAA,CAAAL,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAG,CAAAA,CACA,0BAAA,CAAAD,CACF,CACF,CAEF,CAAA,KAAA,CAASK,CAAAA,CAAK,CACZ,OAAAC,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,iDAAA,EAAoDF,CAAAA,CAAI,OAAO,CAAA,CAAA;AAsI7D;AAAgB;AAAA;AA8D1B,GAAA","file":"/home/runner/work/cli/cli/dist/impl-KM3U7E44.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { logger } from '../../../logger';\nimport { mapSeries } from 'bluebird';\nimport { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { readTranscendYaml } from '../../../lib/readTranscendYaml';\nimport colors from 'colors';\nimport {\n buildTranscendGraphQLClient,\n syncConfigurationToTranscend,\n} from '../../../lib/graphql';\n\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { TranscendInput } from '../../../codecs';\nimport { validateTranscendAuth, listFiles } from '../../../lib/api-keys';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\n/**\n * Sync configuration to Transcend\n *\n * @param options - Options\n * @returns True if synced successfully, false if error occurs\n */\nasync function syncConfiguration({\n transcendUrl,\n auth,\n pageSize,\n publishToPrivacyCenter,\n contents,\n deleteExtraAttributeValues = false,\n classifyService = false,\n}: {\n /** Transcend YAML */\n contents: TranscendInput;\n /** Transcend URL */\n transcendUrl: string;\n /** API key */\n auth: string;\n /** Page size */\n pageSize: number;\n /** Skip privacy center publish step */\n publishToPrivacyCenter: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** Delete attributes when syncing */\n deleteExtraAttributeValues?: boolean;\n}): Promise<boolean> {\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Sync to Transcend\n try {\n const encounteredError = await syncConfigurationToTranscend(\n contents,\n client,\n {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n },\n );\n return !encounteredError;\n } catch (err) {\n logger.error(\n colors.red(\n `An unexpected error occurred syncing the schema: ${err.message}`,\n ),\n );\n return false;\n }\n}\n\nexport interface PushCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n pageSize: number;\n variables: string;\n publishToPrivacyCenter: boolean;\n classifyService: boolean;\n deleteExtraAttributeValues: boolean;\n}\n\nexport async function push(\n this: LocalContext,\n {\n file = './transcend.yml',\n transcendUrl,\n auth,\n variables,\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n }: PushCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Parse out the variables\n const vars = parseVariablesFromString(variables);\n\n // check if we are being passed a list of API keys and a list of files\n let fileList: string[];\n if (Array.isArray(apiKeyOrList) && lstatSync(file).isDirectory()) {\n fileList = listFiles(file).map((filePath) => join(file, filePath));\n } else {\n fileList = file.split(',');\n }\n\n // Ensure at least one file is parsed\n if (fileList.length < 1) {\n throw new Error('No file specified!');\n }\n\n // eslint-disable-next-line array-callback-return,consistent-return\n const transcendInputs = fileList.map((filePath) => {\n // Ensure yaml file exists on disk\n if (!existsSync(filePath)) {\n logger.error(\n colors.red(\n `The file path does not exist on disk: ${filePath}. You can specify the filepath using --file=./examples/transcend.yml`,\n ),\n );\n this.process.exit(1);\n } else {\n logger.info(colors.magenta(`Reading file \"${filePath}\"...`));\n }\n\n try {\n // Read in the yaml file and validate it's shape\n const newContents = readTranscendYaml(filePath, vars);\n logger.info(colors.green(`Successfully read in \"${filePath}\"`));\n return {\n content: newContents,\n name: filePath.split('/').pop()!.replace('.yml', ''),\n };\n } catch (err) {\n logger.error(\n colors.red(\n `The shape of your yaml file is invalid with the following errors: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n });\n\n // process a single API key\n if (typeof apiKeyOrList === 'string') {\n // if passed multiple inputs, merge them together\n const [base, ...rest] = transcendInputs.map(({ content }) => content);\n const contents = mergeTranscendInputs(base, ...rest);\n\n // sync the configuration\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKeyOrList,\n contents,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n pageSize,\n classifyService: !!classifyService,\n });\n\n // exist with error code\n if (!success) {\n logger.info(\n colors.red(\n `Sync encountered errors. View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n } else {\n // if passed multiple inputs, expect them to be one per instance\n if (\n transcendInputs.length !== 1 &&\n transcendInputs.length !== apiKeyOrList.length\n ) {\n throw new Error(\n 'Expected list of yml files to be equal to the list of API keys.' +\n `Got ${transcendInputs.length} YML file${\n transcendInputs.length === 1 ? '' : 's'\n } and ${apiKeyOrList.length} API key${\n apiKeyOrList.length === 1 ? '' : 's'\n }`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`,\n ),\n );\n\n // use the merged contents if 1 yml passed, else use the contents that map to that organization\n const useContents =\n transcendInputs.length === 1\n ? transcendInputs[0].content\n : transcendInputs.find(\n (input) => input.name === apiKey.organizationName,\n )?.content;\n\n // Throw error if cannot find a yml file matching that organization name\n if (!useContents) {\n logger.error(\n colors.red(\n `${prefix}Failed to find transcend.yml file for organization: \"${apiKey.organizationName}\".`,\n ),\n );\n encounteredErrors.push(apiKey.organizationName);\n return;\n }\n\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKey.apiKey,\n contents: useContents,\n pageSize,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n classifyService,\n });\n\n if (success) {\n logger.info(\n colors.green(`${prefix}Successfully pushed configuration!`),\n );\n } else {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced yaml file to Transcend! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-RI3WQFOE.cjs","../src/commands/inventory/push/impl.ts"],"names":["syncConfiguration","transcendUrl","auth","pageSize","publishToPrivacyCenter","contents","deleteExtraAttributeValues","classifyService","client","buildTranscendGraphQLClient","syncConfigurationToTranscend","err","logger","colors"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAgD,gCAA6B,wDAAyC,wDAA0D,gCAA6B,wDAAyC,wDAAyC,gCAA6B,oCCGnX,wBACY,4BACjB,gFAEF,MAmBnB,SAAeA,CAAAA,CAAkB,CAC/B,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,0BAAA,CAAAC,CAAAA,CAA6B,CAAA,CAAA,CAC7B,eAAA,CAAAC,CAAAA,CAAkB,CAAA,CACpB,CAAA,CAeqB,CACnB,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BR,CAAcC,CAAI,CAAA,CAG7D,GAAI,CAWF,MAAO,CAVkB,MAAMQ,kCAAAA,CAC7BL,CACAG,CAAAA,CACA,CACE,QAAA,CAAAL,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAG,CAAAA,CACA,0BAAA,CAAAD,CACF,CACF,CAEF,CAAA,KAAA,CAASK,CAAAA,CAAK,CACZ,OAAAC,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,iDAAA,EAAoDF,CAAAA,CAAI,OAAO,CAAA,CAAA;AAsI7D;AAAgB;AAAA;AA8D1B,GAAA","file":"/home/runner/work/cli/cli/dist/impl-RI3WQFOE.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { logger } from '../../../logger';\nimport { mapSeries } from 'bluebird';\nimport { existsSync, lstatSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { readTranscendYaml } from '../../../lib/readTranscendYaml';\nimport colors from 'colors';\nimport {\n buildTranscendGraphQLClient,\n syncConfigurationToTranscend,\n} from '../../../lib/graphql';\n\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { TranscendInput } from '../../../codecs';\nimport { validateTranscendAuth, listFiles } from '../../../lib/api-keys';\nimport { mergeTranscendInputs } from '../../../lib/mergeTranscendInputs';\nimport { parseVariablesFromString } from '../../../lib/helpers/parseVariablesFromString';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\n/**\n * Sync configuration to Transcend\n *\n * @param options - Options\n * @returns True if synced successfully, false if error occurs\n */\nasync function syncConfiguration({\n transcendUrl,\n auth,\n pageSize,\n publishToPrivacyCenter,\n contents,\n deleteExtraAttributeValues = false,\n classifyService = false,\n}: {\n /** Transcend YAML */\n contents: TranscendInput;\n /** Transcend URL */\n transcendUrl: string;\n /** API key */\n auth: string;\n /** Page size */\n pageSize: number;\n /** Skip privacy center publish step */\n publishToPrivacyCenter: boolean;\n /** classify data flow service if missing */\n classifyService?: boolean;\n /** Delete attributes when syncing */\n deleteExtraAttributeValues?: boolean;\n}): Promise<boolean> {\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Sync to Transcend\n try {\n const encounteredError = await syncConfigurationToTranscend(\n contents,\n client,\n {\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n },\n );\n return !encounteredError;\n } catch (err) {\n logger.error(\n colors.red(\n `An unexpected error occurred syncing the schema: ${err.message}`,\n ),\n );\n return false;\n }\n}\n\nexport interface PushCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n pageSize: number;\n variables: string;\n publishToPrivacyCenter: boolean;\n classifyService: boolean;\n deleteExtraAttributeValues: boolean;\n}\n\nexport async function push(\n this: LocalContext,\n {\n file = './transcend.yml',\n transcendUrl,\n auth,\n variables,\n pageSize,\n publishToPrivacyCenter,\n classifyService,\n deleteExtraAttributeValues,\n }: PushCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n // Parse out the variables\n const vars = parseVariablesFromString(variables);\n\n // check if we are being passed a list of API keys and a list of files\n let fileList: string[];\n if (Array.isArray(apiKeyOrList) && lstatSync(file).isDirectory()) {\n fileList = listFiles(file).map((filePath) => join(file, filePath));\n } else {\n fileList = file.split(',');\n }\n\n // Ensure at least one file is parsed\n if (fileList.length < 1) {\n throw new Error('No file specified!');\n }\n\n // eslint-disable-next-line array-callback-return,consistent-return\n const transcendInputs = fileList.map((filePath) => {\n // Ensure yaml file exists on disk\n if (!existsSync(filePath)) {\n logger.error(\n colors.red(\n `The file path does not exist on disk: ${filePath}. You can specify the filepath using --file=./examples/transcend.yml`,\n ),\n );\n this.process.exit(1);\n } else {\n logger.info(colors.magenta(`Reading file \"${filePath}\"...`));\n }\n\n try {\n // Read in the yaml file and validate it's shape\n const newContents = readTranscendYaml(filePath, vars);\n logger.info(colors.green(`Successfully read in \"${filePath}\"`));\n return {\n content: newContents,\n name: filePath.split('/').pop()!.replace('.yml', ''),\n };\n } catch (err) {\n logger.error(\n colors.red(\n `The shape of your yaml file is invalid with the following errors: ${err.message}`,\n ),\n );\n this.process.exit(1);\n }\n });\n\n // process a single API key\n if (typeof apiKeyOrList === 'string') {\n // if passed multiple inputs, merge them together\n const [base, ...rest] = transcendInputs.map(({ content }) => content);\n const contents = mergeTranscendInputs(base, ...rest);\n\n // sync the configuration\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKeyOrList,\n contents,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n pageSize,\n classifyService: !!classifyService,\n });\n\n // exist with error code\n if (!success) {\n logger.info(\n colors.red(\n `Sync encountered errors. View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n } else {\n // if passed multiple inputs, expect them to be one per instance\n if (\n transcendInputs.length !== 1 &&\n transcendInputs.length !== apiKeyOrList.length\n ) {\n throw new Error(\n 'Expected list of yml files to be equal to the list of API keys.' +\n `Got ${transcendInputs.length} YML file${\n transcendInputs.length === 1 ? '' : 's'\n } and ${apiKeyOrList.length} API key${\n apiKeyOrList.length === 1 ? '' : 's'\n }`,\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to push configuration...\\n\\n~~~`,\n ),\n );\n\n // use the merged contents if 1 yml passed, else use the contents that map to that organization\n const useContents =\n transcendInputs.length === 1\n ? transcendInputs[0].content\n : transcendInputs.find(\n (input) => input.name === apiKey.organizationName,\n )?.content;\n\n // Throw error if cannot find a yml file matching that organization name\n if (!useContents) {\n logger.error(\n colors.red(\n `${prefix}Failed to find transcend.yml file for organization: \"${apiKey.organizationName}\".`,\n ),\n );\n encounteredErrors.push(apiKey.organizationName);\n return;\n }\n\n const success = await syncConfiguration({\n transcendUrl,\n auth: apiKey.apiKey,\n contents: useContents,\n pageSize,\n publishToPrivacyCenter,\n deleteExtraAttributeValues,\n classifyService,\n });\n\n if (success) {\n logger.info(\n colors.green(`${prefix}Successfully pushed configuration!`),\n );\n } else {\n logger.error(colors.red(`${prefix}Failed to sync configuration.`));\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced yaml file to Transcend! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkG522ZIHScjs = require('./chunk-G522ZIHS.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');async function u({auth:r,transcendUrl:i,file:e,enricherId:o,concurrency:s,markSilent:a,sombraAuth:m}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkG522ZIHScjs.d.call(void 0, {file:e,transcendUrl:i,enricherId:o,concurrency:s,markSilent:a,auth:r,sombraAuth:m})}exports.pushIdentifiers = u;
2
+ //# sourceMappingURL=impl-SRI65ZIC.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-C52MFDKN.cjs","../src/commands/request/preflight/push-identifiers/impl.ts"],"names":["pushIdentifiers","auth","transcendUrl","file","enricherId","concurrency","markSilent","sombraAuth","doneInputValidation","pushManualEnrichmentIdentifiersFromCsv"],"mappings":"AAAA,iIAAwC,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCclO,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,iCAAAA,CACJ,IAAA,CAAAN,CAAAA,CACA,YAAA,CAAAD,CAAAA,CACA,UAAA,CAAAE,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,IAAA,CAAAL,CAAAA,CACA,UAAA,CAAAM,CACF,CAAC,CACH,CAAA,4BAAA","file":"/home/runner/work/cli/cli/dist/impl-C52MFDKN.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../../context';\nimport { pushManualEnrichmentIdentifiersFromCsv } from '../../../../lib/manual-enrichment';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation';\n\nexport interface PushIdentifiersCommandFlags {\n auth: string;\n enricherId: string;\n sombraAuth?: string;\n transcendUrl: string;\n file: string;\n markSilent: boolean;\n concurrency: number;\n}\n\nexport async function pushIdentifiers(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n file,\n enricherId,\n concurrency,\n markSilent,\n sombraAuth,\n }: PushIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await pushManualEnrichmentIdentifiersFromCsv({\n file,\n transcendUrl,\n enricherId,\n concurrency,\n markSilent,\n auth,\n sombraAuth,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-SRI65ZIC.cjs","../src/commands/request/preflight/push-identifiers/impl.ts"],"names":["pushIdentifiers","auth","transcendUrl","file","enricherId","concurrency","markSilent","sombraAuth","doneInputValidation","pushManualEnrichmentIdentifiersFromCsv"],"mappings":"AAAA,iIAAwC,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCclO,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,iCAAAA,CACJ,IAAA,CAAAN,CAAAA,CACA,YAAA,CAAAD,CAAAA,CACA,UAAA,CAAAE,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,IAAA,CAAAL,CAAAA,CACA,UAAA,CAAAM,CACF,CAAC,CACH,CAAA,4BAAA","file":"/home/runner/work/cli/cli/dist/impl-SRI65ZIC.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../../context';\nimport { pushManualEnrichmentIdentifiersFromCsv } from '../../../../lib/manual-enrichment';\nimport { doneInputValidation } from '../../../../lib/cli/done-input-validation';\n\nexport interface PushIdentifiersCommandFlags {\n auth: string;\n enricherId: string;\n sombraAuth?: string;\n transcendUrl: string;\n file: string;\n markSilent: boolean;\n concurrency: number;\n}\n\nexport async function pushIdentifiers(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n file,\n enricherId,\n concurrency,\n markSilent,\n sombraAuth,\n }: PushIdentifiersCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await pushManualEnrichmentIdentifiersFromCsv({\n file,\n transcendUrl,\n enricherId,\n concurrency,\n markSilent,\n auth,\n sombraAuth,\n });\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');async function l({auth:i,transcendUrl:o,createdAtBefore:n,createdAtAfter:r,actions:a,daysLeft:s,days:m,requestIds:c,emailTemplate:d,concurrency:f}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkVWGA62SGcjs.Ff.call(void 0, {transcendUrl:o,requestActions:a,auth:i,emailTemplate:d,days:m,daysLeft:s,requestIds:c,concurrency:f,createdAtBefore:n,createdAtAfter:r})}exports.notifyAdditionalTime = l;
2
- //# sourceMappingURL=impl-T3YCRT7O.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');async function l({auth:i,transcendUrl:o,createdAtBefore:n,createdAtAfter:r,actions:a,daysLeft:s,days:m,requestIds:c,emailTemplate:d,concurrency:f}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk55B57ZAYcjs.Ff.call(void 0, {transcendUrl:o,requestActions:a,auth:i,emailTemplate:d,days:m,daysLeft:s,requestIds:c,concurrency:f,createdAtBefore:n,createdAtAfter:r})}exports.notifyAdditionalTime = l;
2
+ //# sourceMappingURL=impl-T67PUM7X.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-T3YCRT7O.cjs","../src/commands/request/notify-additional-time/impl.ts"],"names":["notifyAdditionalTime","auth","transcendUrl","createdAtBefore","createdAtAfter","actions","daysLeft","days","requestIds","emailTemplate","concurrency","doneInputValidation","notifyPrivacyRequestsAdditionalTime"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCkBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,YAAA,CAAAV,CAAAA,CACA,cAAA,CAAgBG,CAAAA,CAChB,IAAA,CAAAJ,CAAAA,CACA,aAAA,CAAAQ,CAAAA,CACA,IAAA,CAAAF,CAAAA,CACA,QAAA,CAAAD,CAAAA,CACA,UAAA,CAAAE,CAAAA,CACA,WAAA,CAAAE,CAAAA,CACA,eAAA,CAAAP,CAAAA,CACA,cAAA,CAAAC,CACF,CAAC,CACH,CAAA,iCAAA","file":"/home/runner/work/cli/cli/dist/impl-T3YCRT7O.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { notifyPrivacyRequestsAdditionalTime } from '../../../lib/requests';\nimport type { RequestAction } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface NotifyAdditionalTimeCommandFlags {\n auth: string;\n createdAtBefore: Date;\n createdAtAfter?: Date;\n actions?: RequestAction[];\n daysLeft: number;\n days: number;\n requestIds?: string[];\n emailTemplate: string;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function notifyAdditionalTime(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n createdAtBefore,\n createdAtAfter,\n actions,\n daysLeft,\n days,\n requestIds,\n emailTemplate,\n concurrency,\n }: NotifyAdditionalTimeCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await notifyPrivacyRequestsAdditionalTime({\n transcendUrl,\n requestActions: actions,\n auth,\n emailTemplate,\n days,\n daysLeft,\n requestIds,\n concurrency,\n createdAtBefore,\n createdAtAfter,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-T67PUM7X.cjs","../src/commands/request/notify-additional-time/impl.ts"],"names":["notifyAdditionalTime","auth","transcendUrl","createdAtBefore","createdAtAfter","actions","daysLeft","days","requestIds","emailTemplate","concurrency","doneInputValidation","notifyPrivacyRequestsAdditionalTime"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCkBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,YAAA,CAAAV,CAAAA,CACA,cAAA,CAAgBG,CAAAA,CAChB,IAAA,CAAAJ,CAAAA,CACA,aAAA,CAAAQ,CAAAA,CACA,IAAA,CAAAF,CAAAA,CACA,QAAA,CAAAD,CAAAA,CACA,UAAA,CAAAE,CAAAA,CACA,WAAA,CAAAE,CAAAA,CACA,eAAA,CAAAP,CAAAA,CACA,cAAA,CAAAC,CACF,CAAC,CACH,CAAA,iCAAA","file":"/home/runner/work/cli/cli/dist/impl-T67PUM7X.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { notifyPrivacyRequestsAdditionalTime } from '../../../lib/requests';\nimport type { RequestAction } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface NotifyAdditionalTimeCommandFlags {\n auth: string;\n createdAtBefore: Date;\n createdAtAfter?: Date;\n actions?: RequestAction[];\n daysLeft: number;\n days: number;\n requestIds?: string[];\n emailTemplate: string;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function notifyAdditionalTime(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n createdAtBefore,\n createdAtAfter,\n actions,\n daysLeft,\n days,\n requestIds,\n emailTemplate,\n concurrency,\n }: NotifyAdditionalTimeCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await notifyPrivacyRequestsAdditionalTime({\n transcendUrl,\n requestActions: actions,\n auth,\n emailTemplate,\n days,\n daysLeft,\n requestIds,\n concurrency,\n createdAtBefore,\n createdAtAfter,\n });\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkWAWECZTFcjs = require('./chunk-WAWECZTF.cjs');require('./chunk-UHERPTMC.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkFZTNEEMWcjs = require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _child_process = require('child_process');var d='A repository name must be provided. You can specify using --repositoryName=$REPO_NAME or by ensuring the command "git config --get remote.origin.url" returns the name of the repository';async function A({auth:f,scanPath:r,ignoreDirs:u,repositoryName:h,transcendUrl:y}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let e=h;if(!e)try{let o=_child_process.execSync.call(void 0, `cd ${r} && git config --get remote.origin.url`).toString("utf-8").trim();[e]=o.includes("https:")?o.split("/").slice(3).join("/").split("."):(o.split(":").pop()||"").split("."),e||(_chunkZUNVPK23cjs.a.error(_colors2.default.red(d)),this.process.exit(1))}catch(a){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${d} - Got error: ${a.message}`)),this.process.exit(1)}let x=_chunkVWGA62SGcjs.xc.call(void 0, y,f),n=await _chunkWAWECZTFcjs.b.call(void 0, {scanPath:r,ignoreDirs:u,repositoryName:e});await _chunkVWGA62SGcjs.Oe.call(void 0, x,n);let s=new URL(_chunkFZTNEEMWcjs.o);s.pathname="/code-scanning/code-packages",_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Scan found ${n.length} packages at ${r}! View results at '${s.href}'`))}exports.scanPackages = A;
2
- //# sourceMappingURL=impl-NRPKPOKV.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkSKOTYI3Acjs = require('./chunk-SKOTYI3A.cjs');require('./chunk-NC6VWOMN.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _child_process = require('child_process');var d='A repository name must be provided. You can specify using --repositoryName=$REPO_NAME or by ensuring the command "git config --get remote.origin.url" returns the name of the repository';async function A({auth:f,scanPath:r,ignoreDirs:u,repositoryName:h,transcendUrl:y}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let e=h;if(!e)try{let o=_child_process.execSync.call(void 0, `cd ${r} && git config --get remote.origin.url`).toString("utf-8").trim();[e]=o.includes("https:")?o.split("/").slice(3).join("/").split("."):(o.split(":").pop()||"").split("."),e||(_chunkZUNVPK23cjs.a.error(_colors2.default.red(d)),this.process.exit(1))}catch(a){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${d} - Got error: ${a.message}`)),this.process.exit(1)}let x=_chunk55B57ZAYcjs.xc.call(void 0, y,f),n=await _chunkSKOTYI3Acjs.b.call(void 0, {scanPath:r,ignoreDirs:u,repositoryName:e});await _chunk55B57ZAYcjs.Oe.call(void 0, x,n);let s=new URL(_chunkXXFLFF7Qcjs.o);s.pathname="/code-scanning/code-packages",_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Scan found ${n.length} packages at ${r}! View results at '${s.href}'`))}exports.scanPackages = A;
2
+ //# sourceMappingURL=impl-TCR3Y3J2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-NRPKPOKV.cjs","../src/commands/inventory/scan-packages/impl.ts"],"names":["REPO_ERROR","scanPackages","auth","scanPath","ignoreDirs","repositoryName","transcendUrl","doneInputValidation","gitRepositoryName","url","execSync","logger","colors","err"],"mappings":"AAAA,iOAAwC,gCAA6B,gCAA6B,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAyC,gCAA6B,gFCEtT,8CAOM,IAGnBA,CAAAA,CACJ,0LAAA,CAYF,MAAA,SAAsBC,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAIC,CAAAA,CAAoBH,CAAAA,CACxB,EAAA,CAAI,CAACG,CAAAA,CACH,GAAI,CAKF,IAAMC,CAAAA,CAJOC,qCAAAA,CACX,GAAA,EAAMP,CAAQ,CAAA,sCAAA,CAChB,CAAA,CAEiB,QAAA,CAAS,OAAO,CAAA,CAAE,IAAA,CAAK,CAAA,CACxC,CAACK,CAAiB,CAAA,CAAKC,CAAAA,CAAI,QAAA,CAAS,QAAQ,CAAA,CAExCA,CAAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA,CAAA,CAD1CA,CAAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAAE,GAAA,CAAI,CAAA,EAAK,EAAA,CAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAErCD,CAAAA,EAAAA,CACHG,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAIZ,CAAU,CAAC,CAAA,CACnC,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAEvB,CAAA,KAAA,CAASa,CAAAA,CAAK,CACZF,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAI,CAAA,EAAA","file":"/home/runner/work/cli/cli/dist/impl-NRPKPOKV.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { ADMIN_DASH } from '../../../constants';\nimport { findCodePackagesInFolder } from '../../../lib/code-scanning';\nimport {\n buildTranscendGraphQLClient,\n syncCodePackages,\n} from '../../../lib/graphql';\nimport { execSync } from 'child_process';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nconst REPO_ERROR =\n 'A repository name must be provided. ' +\n 'You can specify using --repositoryName=$REPO_NAME or by ensuring the ' +\n 'command \"git config --get remote.origin.url\" returns the name of the repository';\n\nexport interface ScanPackagesCommandFlags {\n auth: string;\n scanPath: string;\n ignoreDirs?: string[];\n repositoryName?: string;\n transcendUrl: string;\n}\n\nexport async function scanPackages(\n this: LocalContext,\n {\n auth,\n scanPath,\n ignoreDirs,\n repositoryName,\n transcendUrl,\n }: ScanPackagesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Ensure repository name is specified\n let gitRepositoryName = repositoryName;\n if (!gitRepositoryName) {\n try {\n const name = execSync(\n `cd ${scanPath} && git config --get remote.origin.url`,\n );\n // Trim and parse the URL\n const url = name.toString('utf-8').trim();\n [gitRepositoryName] = !url.includes('https:')\n ? (url.split(':').pop() || '').split('.')\n : url.split('/').slice(3).join('/').split('.');\n if (!gitRepositoryName) {\n logger.error(colors.red(REPO_ERROR));\n this.process.exit(1);\n }\n } catch (err) {\n logger.error(colors.red(`${REPO_ERROR} - Got error: ${err.message}`));\n this.process.exit(1);\n }\n }\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Scan the codebase to discovery packages\n const results = await findCodePackagesInFolder({\n scanPath,\n ignoreDirs,\n repositoryName: gitRepositoryName,\n });\n\n // Report scan to Transcend\n await syncCodePackages(client, results);\n\n const newUrl = new URL(ADMIN_DASH);\n newUrl.pathname = '/code-scanning/code-packages';\n\n // Indicate success\n logger.info(\n colors.green(\n `Scan found ${results.length} packages at ${scanPath}! ` +\n `View results at '${newUrl.href}'`,\n ),\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-TCR3Y3J2.cjs","../src/commands/inventory/scan-packages/impl.ts"],"names":["REPO_ERROR","scanPackages","auth","scanPath","ignoreDirs","repositoryName","transcendUrl","doneInputValidation","gitRepositoryName","url","execSync","logger","colors","err"],"mappings":"AAAA,iOAAwC,gCAA6B,gCAA6B,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAyC,gCAA6B,gFCEtT,8CAOM,IAGnBA,CAAAA,CACJ,0LAAA,CAYF,MAAA,SAAsBC,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAIC,CAAAA,CAAoBH,CAAAA,CACxB,EAAA,CAAI,CAACG,CAAAA,CACH,GAAI,CAKF,IAAMC,CAAAA,CAJOC,qCAAAA,CACX,GAAA,EAAMP,CAAQ,CAAA,sCAAA,CAChB,CAAA,CAEiB,QAAA,CAAS,OAAO,CAAA,CAAE,IAAA,CAAK,CAAA,CACxC,CAACK,CAAiB,CAAA,CAAKC,CAAAA,CAAI,QAAA,CAAS,QAAQ,CAAA,CAExCA,CAAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA,CAAA,CAD1CA,CAAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAAE,GAAA,CAAI,CAAA,EAAK,EAAA,CAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAErCD,CAAAA,EAAAA,CACHG,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAIZ,CAAU,CAAC,CAAA,CACnC,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAEvB,CAAA,KAAA,CAASa,CAAAA,CAAK,CACZF,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAI,CAAA,EAAA","file":"/home/runner/work/cli/cli/dist/impl-TCR3Y3J2.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { ADMIN_DASH } from '../../../constants';\nimport { findCodePackagesInFolder } from '../../../lib/code-scanning';\nimport {\n buildTranscendGraphQLClient,\n syncCodePackages,\n} from '../../../lib/graphql';\nimport { execSync } from 'child_process';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nconst REPO_ERROR =\n 'A repository name must be provided. ' +\n 'You can specify using --repositoryName=$REPO_NAME or by ensuring the ' +\n 'command \"git config --get remote.origin.url\" returns the name of the repository';\n\nexport interface ScanPackagesCommandFlags {\n auth: string;\n scanPath: string;\n ignoreDirs?: string[];\n repositoryName?: string;\n transcendUrl: string;\n}\n\nexport async function scanPackages(\n this: LocalContext,\n {\n auth,\n scanPath,\n ignoreDirs,\n repositoryName,\n transcendUrl,\n }: ScanPackagesCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Ensure repository name is specified\n let gitRepositoryName = repositoryName;\n if (!gitRepositoryName) {\n try {\n const name = execSync(\n `cd ${scanPath} && git config --get remote.origin.url`,\n );\n // Trim and parse the URL\n const url = name.toString('utf-8').trim();\n [gitRepositoryName] = !url.includes('https:')\n ? (url.split(':').pop() || '').split('.')\n : url.split('/').slice(3).join('/').split('.');\n if (!gitRepositoryName) {\n logger.error(colors.red(REPO_ERROR));\n this.process.exit(1);\n }\n } catch (err) {\n logger.error(colors.red(`${REPO_ERROR} - Got error: ${err.message}`));\n this.process.exit(1);\n }\n }\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n // Scan the codebase to discovery packages\n const results = await findCodePackagesInFolder({\n scanPath,\n ignoreDirs,\n repositoryName: gitRepositoryName,\n });\n\n // Report scan to Transcend\n await syncCodePackages(client, results);\n\n const newUrl = new URL(ADMIN_DASH);\n newUrl.pathname = '/code-scanning/code-packages';\n\n // Indicate success\n logger.info(\n colors.green(\n `Scan found ${results.length} packages at ${scanPath}! ` +\n `View results at '${newUrl.href}'`,\n ),\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkZZPMCMEBcjs = require('./chunk-ZZPMCMEB.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _fs = require('fs');var _bluebird = require('bluebird');var _path = require('path');async function A({auth:g,partition:l,sombraAuth:h,transcendUrl:u,file:s="",directory:o,dryRun:b,skipExistingRecordCheck:a,receiptFileDir:v,skipWorkflowTriggers:x,forceTriggerWorkflows:y,skipConflictUpdates:F,isSilent:C,attributes:P,concurrency:$}){o&&s&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Cannot provide both a directory and a file. Please provide only one.")),this.process.exit(1)),!s&&!o&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences")),this.process.exit(1)),_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let t=[];if(o)try{let n=_fs.readdirSync.call(void 0, o).filter(c=>c.endsWith(".csv"));n.length===0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`No CSV files found in directory: ${o}`)),this.process.exit(1)),t.push(...n.map(c=>_path.join.call(void 0, o,c)))}catch(i){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to read directory: ${o}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(i.message)),this.process.exit(1)}else try{s.endsWith(".csv")||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("File must be a CSV file")),this.process.exit(1)),t.push(s)}catch(i){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to access file: ${s}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(i.message)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Processing ${t.length} consent preferences files for partition: ${l}`)),_chunkZUNVPK23cjs.a.debug(`Files to process: ${t.join(", ")}`),a&&_chunkZUNVPK23cjs.a.info(_colors2.default.bgYellow(`Skipping existing record check: ${a}`)),await _bluebird.map.call(void 0, t,async i=>{let n=_path.basename.call(void 0, i).replace(".csv","");await _chunkZZPMCMEBcjs.a.call(void 0, {receiptFilepath:_path.join.call(void 0, v,`${n}-receipts.json`),auth:g,sombraAuth:h,file:i,partition:l,transcendUrl:u,skipConflictUpdates:F,skipWorkflowTriggers:x,skipExistingRecordCheck:a,isSilent:C,dryRun:b,attributes:_chunkVWGA62SGcjs.pc.call(void 0, P),forceTriggerWorkflows:y})},{concurrency:$})}exports.uploadPreferences = A;
2
- //# sourceMappingURL=impl-FORZFZ2Q.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkHCEZRZHVcjs = require('./chunk-HCEZRZHV.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _fs = require('fs');var _bluebird = require('bluebird');var _path = require('path');async function A({auth:g,partition:l,sombraAuth:h,transcendUrl:u,file:s="",directory:o,dryRun:b,skipExistingRecordCheck:a,receiptFileDir:v,skipWorkflowTriggers:x,forceTriggerWorkflows:y,skipConflictUpdates:F,isSilent:C,attributes:P,concurrency:$}){o&&s&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red("Cannot provide both a directory and a file. Please provide only one.")),this.process.exit(1)),!s&&!o&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences")),this.process.exit(1)),_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let t=[];if(o)try{let n=_fs.readdirSync.call(void 0, o).filter(c=>c.endsWith(".csv"));n.length===0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`No CSV files found in directory: ${o}`)),this.process.exit(1)),t.push(...n.map(c=>_path.join.call(void 0, o,c)))}catch(i){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to read directory: ${o}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(i.message)),this.process.exit(1)}else try{s.endsWith(".csv")||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("File must be a CSV file")),this.process.exit(1)),t.push(s)}catch(i){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to access file: ${s}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(i.message)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Processing ${t.length} consent preferences files for partition: ${l}`)),_chunkZUNVPK23cjs.a.debug(`Files to process: ${t.join(", ")}`),a&&_chunkZUNVPK23cjs.a.info(_colors2.default.bgYellow(`Skipping existing record check: ${a}`)),await _bluebird.map.call(void 0, t,async i=>{let n=_path.basename.call(void 0, i).replace(".csv","");await _chunkHCEZRZHVcjs.a.call(void 0, {receiptFilepath:_path.join.call(void 0, v,`${n}-receipts.json`),auth:g,sombraAuth:h,file:i,partition:l,transcendUrl:u,skipConflictUpdates:F,skipWorkflowTriggers:x,skipExistingRecordCheck:a,isSilent:C,dryRun:b,attributes:_chunk55B57ZAYcjs.pc.call(void 0, P),forceTriggerWorkflows:y})},{concurrency:$})}exports.uploadPreferences = A;
2
+ //# sourceMappingURL=impl-U46BMUFL.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-FORZFZ2Q.cjs","../src/commands/consent/upload-preferences/impl.ts"],"names":["uploadPreferences","auth","partition","sombraAuth","transcendUrl","file","directory","dryRun","skipExistingRecordCheck","receiptFileDir","skipWorkflowTriggers","forceTriggerWorkflows","skipConflictUpdates","isSilent","attributes","concurrency","logger","colors","doneInputValidation","files","csvFiles","readdirSync"],"mappings":"AAAA,iOAAwC,wDAAyC,wDAA0C,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gFCCxO,wBAKS,oCACR,4BACW,MAsB/B,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CAAO,EAAA,CACP,SAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,qBAAA,CAAAC,CAAAA,CACA,mBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACTT,CAAAA,EAAeD,CAAAA,EAAAA,CACnBW,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,sEACF,CACF,CAAA,CACA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGjB,CAACZ,CAAAA,EAAQ,CAACC,CAAAA,EAAAA,CACZU,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,sHACF,CACF,CAAA,CACA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGrBC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,IAAMC,CAAAA,CAAkB,CAAC,CAAA,CAEzB,EAAA,CAAIb,CAAAA,CACF,GAAI,CAEF,IAAMc,CAAAA,CADmBC,6BAAAA,CAAqB,CAAA,CACZ,MAAA,CAAQhB,CAAAA,EAASA,CAAAA,CAAK,QAAA,CAAS,MAAM,CAAC,CAAA,CAEpEe,CAAAA,CAAS,MAAA,GAAW,CAAA,EAAA,CACtBJ,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CAAI,CAAA,iCAAA,EAAoCX,CAAS,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/impl-FORZFZ2Q.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\n\nimport { logger } from '../../../logger';\nimport { uploadPreferenceManagementPreferencesInteractive } from '../../../lib/preference-management';\nimport { splitCsvToList } from '../../../lib/requests';\nimport { readdirSync } from 'node:fs';\nimport { map } from 'bluebird';\nimport { basename, join } from 'node:path';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n transcendUrl: string;\n file?: string;\n directory?: string;\n dryRun: boolean;\n skipExistingRecordCheck: boolean;\n receiptFileDir: string;\n skipWorkflowTriggers: boolean;\n forceTriggerWorkflows: boolean;\n skipConflictUpdates: boolean;\n isSilent: boolean;\n attributes: string;\n receiptFilepath: string;\n concurrency: number;\n}\n\nexport async function uploadPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n transcendUrl,\n file = '',\n directory,\n dryRun,\n skipExistingRecordCheck,\n receiptFileDir,\n skipWorkflowTriggers,\n forceTriggerWorkflows,\n skipConflictUpdates,\n isSilent,\n attributes,\n concurrency,\n }: UploadPreferencesCommandFlags,\n): Promise<void> {\n if (!!directory && !!file) {\n logger.error(\n colors.red(\n 'Cannot provide both a directory and a file. Please provide only one.',\n ),\n );\n this.process.exit(1);\n }\n\n if (!file && !directory) {\n logger.error(\n colors.red(\n 'A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences',\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process.exit);\n\n const files: string[] = [];\n\n if (directory) {\n try {\n const filesInDirectory = readdirSync(directory);\n const csvFiles = filesInDirectory.filter((file) => file.endsWith('.csv'));\n\n if (csvFiles.length === 0) {\n logger.error(\n colors.red(`No CSV files found in directory: ${directory}`),\n );\n this.process.exit(1);\n }\n\n // Add full paths for each CSV file\n files.push(...csvFiles.map((file) => join(directory, file)));\n } catch (err) {\n logger.error(colors.red(`Failed to read directory: ${directory}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n } else {\n try {\n // Verify file exists and is a CSV\n if (!file.endsWith('.csv')) {\n logger.error(colors.red('File must be a CSV file'));\n this.process.exit(1);\n }\n files.push(file);\n } catch (err) {\n logger.error(colors.red(`Failed to access file: ${file}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n }\n\n logger.info(\n colors.green(\n `Processing ${files.length} consent preferences files for partition: ${partition}`,\n ),\n );\n logger.debug(`Files to process: ${files.join(', ')}`);\n\n if (skipExistingRecordCheck) {\n logger.info(\n colors.bgYellow(\n `Skipping existing record check: ${skipExistingRecordCheck}`,\n ),\n );\n }\n\n await map(\n files,\n async (filePath) => {\n const fileName = basename(filePath).replace('.csv', '');\n await uploadPreferenceManagementPreferencesInteractive({\n receiptFilepath: join(receiptFileDir, `${fileName}-receipts.json`),\n auth,\n sombraAuth,\n file: filePath,\n partition,\n transcendUrl,\n skipConflictUpdates,\n skipWorkflowTriggers,\n skipExistingRecordCheck,\n isSilent,\n dryRun,\n attributes: splitCsvToList(attributes),\n forceTriggerWorkflows,\n });\n },\n { concurrency },\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-U46BMUFL.cjs","../src/commands/consent/upload-preferences/impl.ts"],"names":["uploadPreferences","auth","partition","sombraAuth","transcendUrl","file","directory","dryRun","skipExistingRecordCheck","receiptFileDir","skipWorkflowTriggers","forceTriggerWorkflows","skipConflictUpdates","isSilent","attributes","concurrency","logger","colors","doneInputValidation","files","csvFiles","readdirSync"],"mappings":"AAAA,iOAAwC,wDAAyC,wDAA0C,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gFCCxO,wBAKS,oCACR,4BACW,MAsB/B,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CAAO,EAAA,CACP,SAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,qBAAA,CAAAC,CAAAA,CACA,mBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACTT,CAAAA,EAAeD,CAAAA,EAAAA,CACnBW,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,sEACF,CACF,CAAA,CACA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGjB,CAACZ,CAAAA,EAAQ,CAACC,CAAAA,EAAAA,CACZU,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,sHACF,CACF,CAAA,CACA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGrBC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,IAAMC,CAAAA,CAAkB,CAAC,CAAA,CAEzB,EAAA,CAAIb,CAAAA,CACF,GAAI,CAEF,IAAMc,CAAAA,CADmBC,6BAAAA,CAAqB,CAAA,CACZ,MAAA,CAAQhB,CAAAA,EAASA,CAAAA,CAAK,QAAA,CAAS,MAAM,CAAC,CAAA,CAEpEe,CAAAA,CAAS,MAAA,GAAW,CAAA,EAAA,CACtBJ,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CAAI,CAAA,iCAAA,EAAoCX,CAAS,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/impl-U46BMUFL.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\n\nimport { logger } from '../../../logger';\nimport { uploadPreferenceManagementPreferencesInteractive } from '../../../lib/preference-management';\nimport { splitCsvToList } from '../../../lib/requests';\nimport { readdirSync } from 'node:fs';\nimport { map } from 'bluebird';\nimport { basename, join } from 'node:path';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadPreferencesCommandFlags {\n auth: string;\n partition: string;\n sombraAuth?: string;\n transcendUrl: string;\n file?: string;\n directory?: string;\n dryRun: boolean;\n skipExistingRecordCheck: boolean;\n receiptFileDir: string;\n skipWorkflowTriggers: boolean;\n forceTriggerWorkflows: boolean;\n skipConflictUpdates: boolean;\n isSilent: boolean;\n attributes: string;\n receiptFilepath: string;\n concurrency: number;\n}\n\nexport async function uploadPreferences(\n this: LocalContext,\n {\n auth,\n partition,\n sombraAuth,\n transcendUrl,\n file = '',\n directory,\n dryRun,\n skipExistingRecordCheck,\n receiptFileDir,\n skipWorkflowTriggers,\n forceTriggerWorkflows,\n skipConflictUpdates,\n isSilent,\n attributes,\n concurrency,\n }: UploadPreferencesCommandFlags,\n): Promise<void> {\n if (!!directory && !!file) {\n logger.error(\n colors.red(\n 'Cannot provide both a directory and a file. Please provide only one.',\n ),\n );\n this.process.exit(1);\n }\n\n if (!file && !directory) {\n logger.error(\n colors.red(\n 'A file or directory must be provided. Please provide one using --file=./preferences.csv or --directory=./preferences',\n ),\n );\n this.process.exit(1);\n }\n\n doneInputValidation(this.process.exit);\n\n const files: string[] = [];\n\n if (directory) {\n try {\n const filesInDirectory = readdirSync(directory);\n const csvFiles = filesInDirectory.filter((file) => file.endsWith('.csv'));\n\n if (csvFiles.length === 0) {\n logger.error(\n colors.red(`No CSV files found in directory: ${directory}`),\n );\n this.process.exit(1);\n }\n\n // Add full paths for each CSV file\n files.push(...csvFiles.map((file) => join(directory, file)));\n } catch (err) {\n logger.error(colors.red(`Failed to read directory: ${directory}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n } else {\n try {\n // Verify file exists and is a CSV\n if (!file.endsWith('.csv')) {\n logger.error(colors.red('File must be a CSV file'));\n this.process.exit(1);\n }\n files.push(file);\n } catch (err) {\n logger.error(colors.red(`Failed to access file: ${file}`));\n logger.error(colors.red((err as Error).message));\n this.process.exit(1);\n }\n }\n\n logger.info(\n colors.green(\n `Processing ${files.length} consent preferences files for partition: ${partition}`,\n ),\n );\n logger.debug(`Files to process: ${files.join(', ')}`);\n\n if (skipExistingRecordCheck) {\n logger.info(\n colors.bgYellow(\n `Skipping existing record check: ${skipExistingRecordCheck}`,\n ),\n );\n }\n\n await map(\n files,\n async (filePath) => {\n const fileName = basename(filePath).replace('.csv', '');\n await uploadPreferenceManagementPreferencesInteractive({\n receiptFilepath: join(receiptFileDir, `${fileName}-receipts.json`),\n auth,\n sombraAuth,\n file: filePath,\n partition,\n transcendUrl,\n skipConflictUpdates,\n skipWorkflowTriggers,\n skipExistingRecordCheck,\n isSilent,\n dryRun,\n attributes: splitCsvToList(attributes),\n forceTriggerWorkflows,\n });\n },\n { concurrency },\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkJH5HRI6Dcjs = require('./chunk-JH5HRI6D.cjs');var _chunkCLJATLM4cjs = require('./chunk-CLJATLM4.cjs');var _chunkUHERPTMCcjs = require('./chunk-UHERPTMC.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkFZTNEEMWcjs = require('./chunk-FZTNEEMW.cjs');var _chunk7PB6LVSEcjs = require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _bluebird = require('bluebird');var _path = require('path');var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);async function Y({auth:b,resources:g=_chunkCLJATLM4cjs.i,file:e,transcendUrl:p,dataSiloIds:d=[],integrationNames:T=[],trackerStatuses:h=_chunkCLJATLM4cjs.j,pageSize:y,skipDatapoints:S,skipSubDatapoints:$,includeGuessedCategories:A,debug:s}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let i=await _chunkUHERPTMCcjs.b.call(void 0, b),C=g.includes("all")?Object.values(_chunk7PB6LVSEcjs.d):g;if(typeof i=="string"){try{let r=_chunkVWGA62SGcjs.xc.call(void 0, p,i),t=await _chunkVWGA62SGcjs.ie.call(void 0, r,{dataSiloIds:d,integrationNames:T,resources:C,pageSize:y,debug:s,skipDatapoints:S,skipSubDatapoints:$,includeGuessedCategories:A,trackerStatuses:h});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing configuration to file "${e}"...`)),_chunkJH5HRI6Dcjs.e.call(void 0, e,t)}catch(r){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error occurred syncing the schema: ${s?r.stack:r.message}`)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced yaml file to disk at ${e}! View at ${_chunkFZTNEEMWcjs.p}`))}else{if(!_fs2.default.lstatSync(e).isDirectory())throw new Error("File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/");let r=[];await _bluebird.mapSeries.call(void 0, i,async(t,L)=>{let a=`[${L+1}/${i.length}][${t.organizationName}] `;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`~~~
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkJH5HRI6Dcjs = require('./chunk-JH5HRI6D.cjs');var _chunkDIB7IOEXcjs = require('./chunk-DIB7IOEX.cjs');var _chunkNC6VWOMNcjs = require('./chunk-NC6VWOMN.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');var _chunk7PB6LVSEcjs = require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _bluebird = require('bluebird');var _path = require('path');var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);async function Y({auth:b,resources:g=_chunkDIB7IOEXcjs.i,file:e,transcendUrl:p,dataSiloIds:d=[],integrationNames:T=[],trackerStatuses:h=_chunkDIB7IOEXcjs.j,pageSize:y,skipDatapoints:S,skipSubDatapoints:$,includeGuessedCategories:A,debug:s}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let i=await _chunkNC6VWOMNcjs.b.call(void 0, b),C=g.includes("all")?Object.values(_chunk7PB6LVSEcjs.d):g;if(typeof i=="string"){try{let r=_chunk55B57ZAYcjs.xc.call(void 0, p,i),t=await _chunk55B57ZAYcjs.ie.call(void 0, r,{dataSiloIds:d,integrationNames:T,resources:C,pageSize:y,debug:s,skipDatapoints:S,skipSubDatapoints:$,includeGuessedCategories:A,trackerStatuses:h});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing configuration to file "${e}"...`)),_chunkJH5HRI6Dcjs.e.call(void 0, e,t)}catch(r){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error occurred syncing the schema: ${s?r.stack:r.message}`)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced yaml file to disk at ${e}! View at ${_chunkXXFLFF7Qcjs.p}`))}else{if(!_fs2.default.lstatSync(e).isDirectory())throw new Error("File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/");let r=[];await _bluebird.mapSeries.call(void 0, i,async(t,L)=>{let a=`[${L+1}/${i.length}][${t.organizationName}] `;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`~~~
2
2
 
3
3
  ${a}Attempting to pull configuration...
4
4
 
5
- ~~~`));let _=_chunkVWGA62SGcjs.xc.call(void 0, p,t.apiKey);try{let c=await _chunkVWGA62SGcjs.ie.call(void 0, _,{dataSiloIds:d,integrationNames:T,resources:C,pageSize:y,debug:s,skipDatapoints:S,skipSubDatapoints:$,includeGuessedCategories:A,trackerStatuses:h}),w=_path.join.call(void 0, e,`${t.organizationName}.yml`);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing configuration to file "${w}"...`)),_chunkJH5HRI6Dcjs.e.call(void 0, w,c),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`${a}Successfully pulled configuration!`))}catch(c){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${a}Failed to sync configuration. - ${c.message}`)),r.push(t.organizationName)}}),r.length>0&&(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors for "${r.join(",")}". View output above for more information, or check out ${_chunkFZTNEEMWcjs.p}`)),this.process.exit(1))}}exports.pull = Y;
6
- //# sourceMappingURL=impl-BBDBG5OZ.cjs.map
5
+ ~~~`));let _=_chunk55B57ZAYcjs.xc.call(void 0, p,t.apiKey);try{let c=await _chunk55B57ZAYcjs.ie.call(void 0, _,{dataSiloIds:d,integrationNames:T,resources:C,pageSize:y,debug:s,skipDatapoints:S,skipSubDatapoints:$,includeGuessedCategories:A,trackerStatuses:h}),w=_path.join.call(void 0, e,`${t.organizationName}.yml`);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing configuration to file "${w}"...`)),_chunkJH5HRI6Dcjs.e.call(void 0, w,c),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`${a}Successfully pulled configuration!`))}catch(c){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`${a}Failed to sync configuration. - ${c.message}`)),r.push(t.organizationName)}}),r.length>0&&(_chunkZUNVPK23cjs.a.info(_colors2.default.red(`Sync encountered errors for "${r.join(",")}". View output above for more information, or check out ${_chunkXXFLFF7Qcjs.p}`)),this.process.exit(1))}}exports.pull = Y;
6
+ //# sourceMappingURL=impl-UVQJ7HSK.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-BBDBG5OZ.cjs","../src/commands/inventory/pull/impl.ts"],"names":["pull","auth","resources","DEFAULT_TRANSCEND_PULL_RESOURCES","file","transcendUrl","dataSiloIds","integrationNames","trackerStatuses","DEFAULT_CONSENT_TRACKER_STATUSES","pageSize","skipDatapoints","skipSubDatapoints","includeGuessedCategories","debug","doneInputValidation","apiKeyOrList","validateTranscendAuth","resourcesToPull","TranscendPullResource","client","buildTranscendGraphQLClient","configuration","pullTranscendConfiguration","logger","colors","writeTranscendYaml","err"],"mappings":"AAAA,iOAAwC,wDAAgD,wDAAyC,gCAA6B,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAyC,wDAAyC,gFCS9X,oCACO,4BACL,gEACN,MA0Bf,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAYC,mBAAAA,CACZ,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,CAAC,CAAA,CACf,gBAAA,CAAAC,CAAAA,CAAmB,CAAC,CAAA,CACpB,eAAA,CAAAC,CAAAA,CAAkBC,mBAAAA,CAClB,QAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAMC,CAAAA,CAAe,MAAMC,iCAAAA,CAA0B,CAAA,CAE/CC,CAAAA,CAA2ChB,CAAAA,CAAU,QAAA,CAAS,KAAK,CAAA,CACrE,MAAA,CAAO,MAAA,CAAOiB,mBAAqB,CAAA,CAClCjB,CAAAA,CAGL,EAAA,CAAI,OAAOc,CAAAA,EAAiB,QAAA,CAAU,CACpC,GAAI,CAEF,IAAMI,CAAAA,CAASC,kCAAAA,CAA4BhB,CAAcW,CAAY,CAAA,CAE/DM,CAAAA,CAAgB,MAAMC,kCAAAA,CAA2BH,CAAQ,CAC7D,WAAA,CAAAd,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,SAAA,CAAWW,CAAAA,CACX,QAAA,CAAAR,CAAAA,CACA,KAAA,CAAAI,CAAAA,CACA,cAAA,CAAAH,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAL,CACF,CAAC,CAAA,CAEDgB,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,CAAA,+BAAA,EAAkCrB,CAAI,CAAA,IAAA,CAAM,CAAC,CAAA,CACxEsB,iCAAAA,CAAmBtB,CAAMkB,CAAa,CACxC,CAAA,KAAA,CAASK,CAAAA,CAAK,CACZH,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,sCAAA,EACEX,CAAAA,CAAQa,CAAAA,CAAI,KAAA,CAAQA,CAAAA,CAAI,OAC1B,CAAA,CAAA;AA0BA;AAAgB;AAAA;AAiD1B,GAAA","file":"/home/runner/work/cli/cli/dist/impl-BBDBG5OZ.cjs","sourcesContent":[null,"import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport type { LocalContext } from '../../../context';\nimport { TranscendPullResource } from '../../../enums';\nimport {\n DEFAULT_CONSENT_TRACKER_STATUSES,\n DEFAULT_TRANSCEND_PULL_RESOURCES,\n} from './command';\n\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { mapSeries } from 'bluebird';\nimport { join } from 'node:path';\nimport fs from 'node:fs';\nimport {\n buildTranscendGraphQLClient,\n pullTranscendConfiguration,\n} from '../../../lib/graphql';\n\nimport { writeTranscendYaml } from '../../../lib/readTranscendYaml';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface PullCommandFlags {\n auth: string;\n resources?: (TranscendPullResource | 'all')[];\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n integrationNames?: string[];\n trackerStatuses?: ConsentTrackerStatus[];\n pageSize: number;\n skipDatapoints: boolean;\n skipSubDatapoints: boolean;\n includeGuessedCategories: boolean;\n debug: boolean;\n}\n\nexport async function pull(\n this: LocalContext,\n {\n auth,\n resources = DEFAULT_TRANSCEND_PULL_RESOURCES,\n file,\n transcendUrl,\n dataSiloIds = [],\n integrationNames = [],\n trackerStatuses = DEFAULT_CONSENT_TRACKER_STATUSES,\n pageSize,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n debug,\n }: PullCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n const resourcesToPull: TranscendPullResource[] = resources.includes('all')\n ? Object.values(TranscendPullResource)\n : (resources as TranscendPullResource[]);\n\n // Sync to Disk\n if (typeof apiKeyOrList === 'string') {\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKeyOrList);\n\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n logger.info(colors.magenta(`Writing configuration to file \"${file}\"...`));\n writeTranscendYaml(file, configuration);\n } catch (err) {\n logger.error(\n colors.red(\n `An error occurred syncing the schema: ${\n debug ? err.stack : err.message\n }`,\n ),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced yaml file to disk at ${file}! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n } else {\n if (!fs.lstatSync(file).isDirectory()) {\n throw new Error(\n 'File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/',\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to pull configuration...\\n\\n~~~`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n try {\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n const filePath = join(file, `${apiKey.organizationName}.yml`);\n logger.info(\n colors.magenta(`Writing configuration to file \"${filePath}\"...`),\n );\n writeTranscendYaml(filePath, configuration);\n\n logger.info(\n colors.green(`${prefix}Successfully pulled configuration!`),\n );\n } catch (err) {\n logger.error(\n colors.red(`${prefix}Failed to sync configuration. - ${err.message}`),\n );\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-UVQJ7HSK.cjs","../src/commands/inventory/pull/impl.ts"],"names":["pull","auth","resources","DEFAULT_TRANSCEND_PULL_RESOURCES","file","transcendUrl","dataSiloIds","integrationNames","trackerStatuses","DEFAULT_CONSENT_TRACKER_STATUSES","pageSize","skipDatapoints","skipSubDatapoints","includeGuessedCategories","debug","doneInputValidation","apiKeyOrList","validateTranscendAuth","resourcesToPull","TranscendPullResource","client","buildTranscendGraphQLClient","configuration","pullTranscendConfiguration","logger","colors","writeTranscendYaml","err"],"mappings":"AAAA,iOAAwC,wDAAgD,wDAAyC,gCAA6B,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAyC,wDAAyC,gFCS9X,oCACO,4BACL,gEACN,MA0Bf,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAYC,mBAAAA,CACZ,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,CAAC,CAAA,CACf,gBAAA,CAAAC,CAAAA,CAAmB,CAAC,CAAA,CACpB,eAAA,CAAAC,CAAAA,CAAkBC,mBAAAA,CAClB,QAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAGrC,IAAMC,CAAAA,CAAe,MAAMC,iCAAAA,CAA0B,CAAA,CAE/CC,CAAAA,CAA2ChB,CAAAA,CAAU,QAAA,CAAS,KAAK,CAAA,CACrE,MAAA,CAAO,MAAA,CAAOiB,mBAAqB,CAAA,CAClCjB,CAAAA,CAGL,EAAA,CAAI,OAAOc,CAAAA,EAAiB,QAAA,CAAU,CACpC,GAAI,CAEF,IAAMI,CAAAA,CAASC,kCAAAA,CAA4BhB,CAAcW,CAAY,CAAA,CAE/DM,CAAAA,CAAgB,MAAMC,kCAAAA,CAA2BH,CAAQ,CAC7D,WAAA,CAAAd,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,SAAA,CAAWW,CAAAA,CACX,QAAA,CAAAR,CAAAA,CACA,KAAA,CAAAI,CAAAA,CACA,cAAA,CAAAH,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAL,CACF,CAAC,CAAA,CAEDgB,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,CAAA,+BAAA,EAAkCrB,CAAI,CAAA,IAAA,CAAM,CAAC,CAAA,CACxEsB,iCAAAA,CAAmBtB,CAAMkB,CAAa,CACxC,CAAA,KAAA,CAASK,CAAAA,CAAK,CACZH,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,sCAAA,EACEX,CAAAA,CAAQa,CAAAA,CAAI,KAAA,CAAQA,CAAAA,CAAI,OAC1B,CAAA,CAAA;AA0BA;AAAgB;AAAA;AAiD1B,GAAA","file":"/home/runner/work/cli/cli/dist/impl-UVQJ7HSK.cjs","sourcesContent":[null,"import { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport type { LocalContext } from '../../../context';\nimport { TranscendPullResource } from '../../../enums';\nimport {\n DEFAULT_CONSENT_TRACKER_STATUSES,\n DEFAULT_TRANSCEND_PULL_RESOURCES,\n} from './command';\n\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { mapSeries } from 'bluebird';\nimport { join } from 'node:path';\nimport fs from 'node:fs';\nimport {\n buildTranscendGraphQLClient,\n pullTranscendConfiguration,\n} from '../../../lib/graphql';\n\nimport { writeTranscendYaml } from '../../../lib/readTranscendYaml';\nimport { ADMIN_DASH_INTEGRATIONS } from '../../../constants';\nimport { validateTranscendAuth } from '../../../lib/api-keys';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface PullCommandFlags {\n auth: string;\n resources?: (TranscendPullResource | 'all')[];\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n integrationNames?: string[];\n trackerStatuses?: ConsentTrackerStatus[];\n pageSize: number;\n skipDatapoints: boolean;\n skipSubDatapoints: boolean;\n includeGuessedCategories: boolean;\n debug: boolean;\n}\n\nexport async function pull(\n this: LocalContext,\n {\n auth,\n resources = DEFAULT_TRANSCEND_PULL_RESOURCES,\n file,\n transcendUrl,\n dataSiloIds = [],\n integrationNames = [],\n trackerStatuses = DEFAULT_CONSENT_TRACKER_STATUSES,\n pageSize,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n debug,\n }: PullCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n // Parse authentication as API key or path to list of API keys\n const apiKeyOrList = await validateTranscendAuth(auth);\n\n const resourcesToPull: TranscendPullResource[] = resources.includes('all')\n ? Object.values(TranscendPullResource)\n : (resources as TranscendPullResource[]);\n\n // Sync to Disk\n if (typeof apiKeyOrList === 'string') {\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKeyOrList);\n\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n logger.info(colors.magenta(`Writing configuration to file \"${file}\"...`));\n writeTranscendYaml(file, configuration);\n } catch (err) {\n logger.error(\n colors.red(\n `An error occurred syncing the schema: ${\n debug ? err.stack : err.message\n }`,\n ),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced yaml file to disk at ${file}! View at ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n } else {\n if (!fs.lstatSync(file).isDirectory()) {\n throw new Error(\n 'File is expected to be a folder when passing in a list of API keys to pull from. e.g. --file=./working/',\n );\n }\n\n const encounteredErrors: string[] = [];\n await mapSeries(apiKeyOrList, async (apiKey, ind) => {\n const prefix = `[${ind + 1}/${apiKeyOrList.length}][${\n apiKey.organizationName\n }] `;\n logger.info(\n colors.magenta(\n `~~~\\n\\n${prefix}Attempting to pull configuration...\\n\\n~~~`,\n ),\n );\n\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, apiKey.apiKey);\n\n try {\n const configuration = await pullTranscendConfiguration(client, {\n dataSiloIds,\n integrationNames,\n resources: resourcesToPull,\n pageSize,\n debug,\n skipDatapoints,\n skipSubDatapoints,\n includeGuessedCategories,\n trackerStatuses,\n });\n\n const filePath = join(file, `${apiKey.organizationName}.yml`);\n logger.info(\n colors.magenta(`Writing configuration to file \"${filePath}\"...`),\n );\n writeTranscendYaml(filePath, configuration);\n\n logger.info(\n colors.green(`${prefix}Successfully pulled configuration!`),\n );\n } catch (err) {\n logger.error(\n colors.red(`${prefix}Failed to sync configuration. - ${err.message}`),\n );\n encounteredErrors.push(apiKey.organizationName);\n }\n });\n\n if (encounteredErrors.length > 0) {\n logger.info(\n colors.red(\n `Sync encountered errors for \"${encounteredErrors.join(\n ',',\n )}\". View output above for more information, or check out ${ADMIN_DASH_INTEGRATIONS}`,\n ),\n );\n\n this.process.exit(1);\n }\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJSVWGZUFcjs = require('./chunk-JSVWGZUF.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _path = require('path');var _fs = require('fs');function H(r,e){r||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A --directory must be provided.")),e.process.exit(1));let n=[];try{n=_fs.readdirSync.call(void 0, r).filter(s=>s.endsWith(".csv")).map(s=>_path.join.call(void 0, r,s)).filter(s=>{try{return _fs.statSync.call(void 0, s).isFile()}catch (e2){return!1}})}catch(i){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to read directory: ${r}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(i.message)),e.process.exit(1)}return n.length===0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`No CSV files found in directory: ${r}`)),e.process.exit(1)),n}var _promises = require('fs/promises');var _promises3 = require('stream/promises');var _stream = require('stream');var _events = require('events');var _csvparse = require('csv-parse');var _fastcsv = require('fast-csv'); var K = _interopRequireWildcard(_fastcsv);function M(r,e){let n=_fs.createWriteStream.call(void 0, r),i=K.format({headers:e,writeHeaders:!0,objectMode:!0});return i.pipe(n),{async write(s){i.write(s)||await _events.once.call(void 0, i,"drain")},async end(){let s=Promise.all([_events.once.call(void 0, n,"finish")]);i.end(),await s}}}function me(r){return String(r).padStart(4,"0")}function fe(r){return Buffer.byteLength(Object.values(r).map(e=>e==null?"":String(e)).join(","),"utf8")}async function N(r){let{filePath:e,outputDir:n,clearOutputDir:i,chunkSizeMB:s,onProgress:f,reportEveryMs:g=500}=r,{size:l}=await _promises.stat.call(void 0, e),u=0;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Chunking ${e} into ~${s}MB files...`));let y=Math.floor(s*1024*1024),C=_path.basename.call(void 0, e,".csv"),d=n||_path.dirname.call(void 0, e);if(_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Output directory: ${d}`)),await _promises.mkdir.call(void 0, d,{recursive:!0}),i){_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`Clearing output directory: ${d}`));let a=await _promises.readdir.call(void 0, d);await Promise.all(a.filter(m=>m.startsWith(`${C}_chunk_`)&&m.endsWith(".csv")).map(m=>_promises.unlink.call(void 0, _path.join.call(void 0, d,m))))}let t=null,h=null,c=0,w=1,P=0,G=new (0, _csvparse.Parser)({columns:!1,skip_empty_lines:!0}),O=0,b=0,S=()=>{let a=b>0?O/b:0,m=a>0?Math.max(c,Math.ceil(l/a)):void 0;f(c,m),u=Date.now()};S();let p=null,$=()=>_path.join.call(void 0, d,`${C}_chunk_${me(w)}.csv`),U=new (0, _stream.Transform)({objectMode:!0,async transform(a,m,T){try{if(!t){t=a.slice(0),h=t.length,p=M($(),t),T();return}h!==null&&a.length!==h&&_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`Row has ${a.length} cols; expected ${h}`)),c+=1,c%25e4===0&&f(c);let v=Object.fromEntries(t.map((Q,X)=>[Q,a[X]])),D=fe(v);O+=D,b+=1,Date.now()-u>=g&&S(),p&&P>0&&P+D>y&&(await p.end(),w+=1,P=0,_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Rolling to chunk ${w} after ${c.toLocaleString()} rows.`)),p=M($(),t)),p||(p=M($(),t)),await p.write(v),P+=D,T()}catch(v){T(v)}},async flush(a){try{p&&(await p.end(),p=null),S(),a()}catch(m){a(m)}}}),J=_fs.createReadStream.call(void 0, e);await _promises3.pipeline.call(void 0, J,G,U),f(c),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Chunked ${e} into ${w} file(s); processed ${c.toLocaleString()} rows.`))}async function A(){let r=Number(process.env.WORKER_ID||"0");_chunkZUNVPK23cjs.a.info(`[w${r}] ready pid=${process.pid}`),_optionalChain([process, 'access', _2 => _2.send, 'optionalCall', _3 => _3({type:"ready"})]),process.on("message",async e=>{if(!e||typeof e!="object"||(e.type==="shutdown"&&process.exit(0),e.type!=="task"))return;let{filePath:n,options:i}=e.payload,{outputDir:s,clearOutputDir:f,chunkSizeMB:g}=i;try{await N({filePath:n,outputDir:s,clearOutputDir:f,chunkSizeMB:g,onProgress:(l,u)=>_optionalChain([process, 'access', _4 => _4.send, 'optionalCall', _5 => _5({type:"progress",payload:{filePath:n,processed:l,total:u}})])}),_optionalChain([process, 'access', _6 => _6.send, 'optionalCall', _7 => _7({type:"result",payload:{ok:!0,filePath:n}})])}catch(l){let u=_chunkVWGA62SGcjs.Yf.call(void 0, l);_chunkZUNVPK23cjs.a.error(`[w${r}] ERROR ${n}: ${u}`),_optionalChain([process, 'access', _8 => _8.send, 'optionalCall', _9 => _9({type:"result",payload:{ok:!1,filePath:n,error:u}})])}}),await new Promise(()=>{})}function de(r){return _chunkJSVWGZUFcjs.d.call(void 0, r)}function he(r){return _chunkJSVWGZUFcjs.e.call(void 0, r)}var q={renderHeader:de,renderWorkers:he};function ke(){return typeof __filename<"u"?__filename:process.argv[1]}async function Ue(r){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let{directory:e,outputDir:n,clearOutputDir:i,chunkSizeMB:s,concurrency:f,viewerMode:g}=r,l=H(e,this),{poolSize:u,cpuCount:y}=_chunkJSVWGZUFcjs.a.call(void 0, f,l.length);_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Chunking ${l.length} CSV file(s) with pool size ${u} (CPU=${y})`));let C=l.map(t=>({filePath:t,options:{outputDir:n,clearOutputDir:i,chunkSizeMB:s}})),d={nextTask:()=>C.shift(),taskLabel:t=>t.filePath,initTotals:()=>({}),initSlotProgress:()=>{},onProgress:t=>t,onResult:(t,h)=>({totals:t,ok:!!h.ok}),postProcess:async()=>{}};await _chunkJSVWGZUFcjs.f.call(void 0, {title:`Chunk CSV - ${e}`,baseDir:e||n||process.cwd(),childFlag:_chunkJSVWGZUFcjs.b,childModulePath:ke(),poolSize:u,cpuCount:y,filesTotal:l.length,hooks:d,viewerMode:g,render:t=>_chunkJSVWGZUFcjs.c.call(void 0, t,q,g),extraKeyHandler:({logsBySlot:t,repaint:h,setPaused:c})=>_chunkJSVWGZUFcjs.g.call(void 0, {logsBySlot:t,repaint:h,setPaused:c})})}process.argv.includes(_chunkJSVWGZUFcjs.b)&&A().catch(r=>{_chunkZUNVPK23cjs.a.error(r),process.exit(1)});exports.chunkCsv = Ue;
2
- //# sourceMappingURL=impl-QOFK7XCV.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkM7OVJJGBcjs = require('./chunk-M7OVJJGB.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _path = require('path');var _fs = require('fs');function H(r,e){r||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A --directory must be provided.")),e.process.exit(1));let n=[];try{n=_fs.readdirSync.call(void 0, r).filter(s=>s.endsWith(".csv")).map(s=>_path.join.call(void 0, r,s)).filter(s=>{try{return _fs.statSync.call(void 0, s).isFile()}catch (e2){return!1}})}catch(i){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to read directory: ${r}`)),_chunkZUNVPK23cjs.a.error(_colors2.default.red(i.message)),e.process.exit(1)}return n.length===0&&(_chunkZUNVPK23cjs.a.error(_colors2.default.red(`No CSV files found in directory: ${r}`)),e.process.exit(1)),n}var _promises = require('fs/promises');var _promises3 = require('stream/promises');var _stream = require('stream');var _events = require('events');var _csvparse = require('csv-parse');var _fastcsv = require('fast-csv'); var K = _interopRequireWildcard(_fastcsv);function M(r,e){let n=_fs.createWriteStream.call(void 0, r),i=K.format({headers:e,writeHeaders:!0,objectMode:!0});return i.pipe(n),{async write(s){i.write(s)||await _events.once.call(void 0, i,"drain")},async end(){let s=Promise.all([_events.once.call(void 0, n,"finish")]);i.end(),await s}}}function me(r){return String(r).padStart(4,"0")}function fe(r){return Buffer.byteLength(Object.values(r).map(e=>e==null?"":String(e)).join(","),"utf8")}async function N(r){let{filePath:e,outputDir:n,clearOutputDir:i,chunkSizeMB:s,onProgress:f,reportEveryMs:g=500}=r,{size:l}=await _promises.stat.call(void 0, e),u=0;_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Chunking ${e} into ~${s}MB files...`));let y=Math.floor(s*1024*1024),C=_path.basename.call(void 0, e,".csv"),d=n||_path.dirname.call(void 0, e);if(_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Output directory: ${d}`)),await _promises.mkdir.call(void 0, d,{recursive:!0}),i){_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`Clearing output directory: ${d}`));let a=await _promises.readdir.call(void 0, d);await Promise.all(a.filter(m=>m.startsWith(`${C}_chunk_`)&&m.endsWith(".csv")).map(m=>_promises.unlink.call(void 0, _path.join.call(void 0, d,m))))}let t=null,h=null,c=0,w=1,P=0,G=new (0, _csvparse.Parser)({columns:!1,skip_empty_lines:!0}),O=0,b=0,S=()=>{let a=b>0?O/b:0,m=a>0?Math.max(c,Math.ceil(l/a)):void 0;f(c,m),u=Date.now()};S();let p=null,$=()=>_path.join.call(void 0, d,`${C}_chunk_${me(w)}.csv`),U=new (0, _stream.Transform)({objectMode:!0,async transform(a,m,T){try{if(!t){t=a.slice(0),h=t.length,p=M($(),t),T();return}h!==null&&a.length!==h&&_chunkZUNVPK23cjs.a.warn(_colors2.default.yellow(`Row has ${a.length} cols; expected ${h}`)),c+=1,c%25e4===0&&f(c);let v=Object.fromEntries(t.map((Q,X)=>[Q,a[X]])),D=fe(v);O+=D,b+=1,Date.now()-u>=g&&S(),p&&P>0&&P+D>y&&(await p.end(),w+=1,P=0,_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Rolling to chunk ${w} after ${c.toLocaleString()} rows.`)),p=M($(),t)),p||(p=M($(),t)),await p.write(v),P+=D,T()}catch(v){T(v)}},async flush(a){try{p&&(await p.end(),p=null),S(),a()}catch(m){a(m)}}}),J=_fs.createReadStream.call(void 0, e);await _promises3.pipeline.call(void 0, J,G,U),f(c),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Chunked ${e} into ${w} file(s); processed ${c.toLocaleString()} rows.`))}async function A(){let r=Number(process.env.WORKER_ID||"0");_chunkZUNVPK23cjs.a.info(`[w${r}] ready pid=${process.pid}`),_optionalChain([process, 'access', _2 => _2.send, 'optionalCall', _3 => _3({type:"ready"})]),process.on("message",async e=>{if(!e||typeof e!="object"||(e.type==="shutdown"&&process.exit(0),e.type!=="task"))return;let{filePath:n,options:i}=e.payload,{outputDir:s,clearOutputDir:f,chunkSizeMB:g}=i;try{await N({filePath:n,outputDir:s,clearOutputDir:f,chunkSizeMB:g,onProgress:(l,u)=>_optionalChain([process, 'access', _4 => _4.send, 'optionalCall', _5 => _5({type:"progress",payload:{filePath:n,processed:l,total:u}})])}),_optionalChain([process, 'access', _6 => _6.send, 'optionalCall', _7 => _7({type:"result",payload:{ok:!0,filePath:n}})])}catch(l){let u=_chunk55B57ZAYcjs.Yf.call(void 0, l);_chunkZUNVPK23cjs.a.error(`[w${r}] ERROR ${n}: ${u}`),_optionalChain([process, 'access', _8 => _8.send, 'optionalCall', _9 => _9({type:"result",payload:{ok:!1,filePath:n,error:u}})])}}),await new Promise(()=>{})}function de(r){return _chunkM7OVJJGBcjs.d.call(void 0, r)}function he(r){return _chunkM7OVJJGBcjs.e.call(void 0, r)}var q={renderHeader:de,renderWorkers:he};function ke(){return typeof __filename<"u"?__filename:process.argv[1]}async function Ue(r){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let{directory:e,outputDir:n,clearOutputDir:i,chunkSizeMB:s,concurrency:f,viewerMode:g}=r,l=H(e,this),{poolSize:u,cpuCount:y}=_chunkM7OVJJGBcjs.a.call(void 0, f,l.length);_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Chunking ${l.length} CSV file(s) with pool size ${u} (CPU=${y})`));let C=l.map(t=>({filePath:t,options:{outputDir:n,clearOutputDir:i,chunkSizeMB:s}})),d={nextTask:()=>C.shift(),taskLabel:t=>t.filePath,initTotals:()=>({}),initSlotProgress:()=>{},onProgress:t=>t,onResult:(t,h)=>({totals:t,ok:!!h.ok}),postProcess:async()=>{}};await _chunkM7OVJJGBcjs.f.call(void 0, {title:`Chunk CSV - ${e}`,baseDir:e||n||process.cwd(),childFlag:_chunkM7OVJJGBcjs.b,childModulePath:ke(),poolSize:u,cpuCount:y,filesTotal:l.length,hooks:d,viewerMode:g,render:t=>_chunkM7OVJJGBcjs.c.call(void 0, t,q,g),extraKeyHandler:({logsBySlot:t,repaint:h,setPaused:c})=>_chunkM7OVJJGBcjs.g.call(void 0, {logsBySlot:t,repaint:h,setPaused:c})})}process.argv.includes(_chunkM7OVJJGBcjs.b)&&A().catch(r=>{_chunkZUNVPK23cjs.a.error(r),process.exit(1)});exports.chunkCsv = Ue;
2
+ //# sourceMappingURL=impl-V3MXFXZF.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-QOFK7XCV.cjs","../src/commands/admin/chunk-csv/impl.ts","../src/lib/helpers/collectCsvFilesOrExit.ts"],"names":["collectCsvFilesOrExit","directory","localContext","logger","colors","files","readdirSync","f","join","p","statSync","err"],"mappings":"AAAA,u/BAAkF,wDAAyC,wDAA0C,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gFCClR,4BCDE,wBACiB,SAatBA,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACU,CACLD,CAAAA,EAAAA,CACHE,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAI,iCAAiC,CAAC,CAAA,CAC1DF,CAAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAG7B,IAAIG,CAAAA,CAAkB,CAAC,CAAA,CACvB,GAAI,CAEFA,CAAAA,CADgBC,6BAAAA,CAAqB,CAAA,CAElC,MAAA,CAAQC,CAAAA,EAAMA,CAAAA,CAAE,QAAA,CAAS,MAAM,CAAC,CAAA,CAChC,GAAA,CAAKA,CAAAA,EAAMC,wBAAAA,CAAKP,CAAWM,CAAC,CAAC,CAAA,CAC7B,MAAA,CAAQE,CAAAA,EAAM,CACb,GAAI,CACF,OAAOC,0BAAAA,CAAU,CAAA,CAAE,MAAA,CAAO,CAC5B,CAAA,UAAQ,CACN,MAAO,CAAA,CACT,CACF,CAAC,CACL,CAAA,KAAA,CAASC,CAAAA,CAAK,CACZR,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAI,CAAA,0BAAA,EAA6BH,CAAS,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/impl-QOFK7XCV.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\nimport { logger } from '../../../logger';\nimport { collectCsvFilesOrExit } from '../../../lib/helpers/collectCsvFilesOrExit';\nimport {\n computePoolSize,\n createExtraKeyHandler,\n CHILD_FLAG,\n type PoolHooks,\n runPool,\n dashboardPlugin,\n} from '../../../lib/pooling';\nimport {\n runChild,\n type ChunkProgress,\n type ChunkResult,\n type ChunkTask,\n} from './worker';\nimport { chunkCsvPlugin } from './ui';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\n/**\n * Returns the current module's path so the worker pool knows what file to re-exec.\n * In Node ESM, __filename is undefined, so we fall back to argv[1].\n *\n * @returns The current module's path as a string\n */\nfunction getCurrentModulePath(): string {\n if (typeof __filename !== 'undefined') {\n return __filename as unknown as string;\n }\n return process.argv[1];\n}\n\n/**\n * Totals aggregate for this command.\n * We don’t need custom counters since the runner already tracks\n * completed/failed counts in its header — so we just use an empty record.\n */\ntype Totals = Record<string, never>;\n\n/**\n * CLI flags accepted by the `chunk-csv` command.\n *\n * These are passed down from the CLI parser into the parent process.\n */\nexport type ChunkCsvCommandFlags = {\n directory: string;\n outputDir?: string;\n clearOutputDir: boolean;\n chunkSizeMB: number;\n concurrency?: number;\n viewerMode: boolean;\n};\n\n/**\n * Parent entrypoint for chunking many CSVs in parallel using the worker pool runner.\n *\n * Lifecycle:\n * 1) Discover CSV inputs (exit if none).\n * 2) Compute pool size (CPU-count heuristic or --concurrency).\n * 3) Build a FIFO queue of `ChunkTask`s.\n * 4) Define pool hooks to drive task assignment, progress, and result handling.\n * 5) Launch the pool with `runPool`, rendering via the `chunkCsvPlugin`.\n *\n * @param this - Bound CLI context (provides process exit + logging).\n * @param flags - CLI options for the run.\n */\nexport async function chunkCsv(\n this: LocalContext,\n flags: ChunkCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const {\n directory,\n outputDir,\n clearOutputDir,\n chunkSizeMB,\n concurrency,\n viewerMode,\n } = flags;\n\n /* 1) Discover CSV inputs */\n const files = collectCsvFilesOrExit(directory, this);\n\n /* 2) Size the pool */\n const { poolSize, cpuCount } = computePoolSize(concurrency, files.length);\n\n logger.info(\n colors.green(\n `Chunking ${files.length} CSV file(s) with pool size ${poolSize} (CPU=${cpuCount})`,\n ),\n );\n\n /* 3) Prepare a simple FIFO queue of tasks (one per file). */\n const queue = files.map<ChunkTask>((filePath) => ({\n filePath,\n options: { outputDir, clearOutputDir, chunkSizeMB },\n }));\n\n /* 4) Define pool hooks to adapt runner to this command. */\n const hooks: PoolHooks<ChunkTask, ChunkProgress, ChunkResult, Totals> = {\n nextTask: () => queue.shift(),\n taskLabel: (t) => t.filePath,\n initTotals: () => ({} as Totals),\n initSlotProgress: () => undefined,\n onProgress: (totals) => totals,\n onResult: (totals, res) => ({ totals, ok: !!res.ok }),\n // postProcess receives log context when viewerMode=true — we don’t need it here.\n postProcess: async () => {\n // nothing extra for chunk-csv\n },\n };\n\n /* 5) Launch the pool runner with our hooks and custom dashboard plugin. */\n await runPool({\n title: `Chunk CSV - ${directory}`,\n baseDir: directory || outputDir || process.cwd(),\n childFlag: CHILD_FLAG,\n childModulePath: getCurrentModulePath(),\n poolSize,\n cpuCount,\n filesTotal: files.length,\n hooks,\n viewerMode,\n render: (input) => dashboardPlugin(input, chunkCsvPlugin, viewerMode),\n extraKeyHandler: ({ logsBySlot, repaint, setPaused }) =>\n createExtraKeyHandler({\n logsBySlot,\n repaint,\n setPaused,\n }),\n });\n}\n\n/* -------------------------------------------------------------------------------------------------\n * If invoked directly as a child process, enter worker loop\n * ------------------------------------------------------------------------------------------------- */\nif (process.argv.includes(CHILD_FLAG)) {\n runChild().catch((err) => {\n logger.error(err);\n process.exit(1);\n });\n}\n","import { join } from 'node:path';\nimport { readdirSync, statSync } from 'node:fs';\nimport colors from 'colors';\nimport { logger } from '../../logger';\nimport type { LocalContext } from '../../context';\n\n/**\n * Validate flags and collect CSV file paths from a directory.\n * On validation error, the provided `exit` function is called.\n *\n * @param directory - the directory containing CSV files\n * @param localContext - the context of the command, used for logging and exit\n * @returns an array of valid CSV file paths\n */\nexport function collectCsvFilesOrExit(\n directory: string | undefined,\n localContext: LocalContext,\n): string[] {\n if (!directory) {\n logger.error(colors.red('A --directory must be provided.'));\n localContext.process.exit(1);\n }\n\n let files: string[] = [];\n try {\n const entries = readdirSync(directory);\n files = entries\n .filter((f) => f.endsWith('.csv'))\n .map((f) => join(directory, f))\n .filter((p) => {\n try {\n return statSync(p).isFile();\n } catch {\n return false;\n }\n });\n } catch (err) {\n logger.error(colors.red(`Failed to read directory: ${directory}`));\n logger.error(colors.red((err as Error).message));\n localContext.process.exit(1);\n }\n\n if (files.length === 0) {\n logger.error(colors.red(`No CSV files found in directory: ${directory}`));\n localContext.process.exit(1);\n }\n\n return files;\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-V3MXFXZF.cjs","../src/commands/admin/chunk-csv/impl.ts","../src/lib/helpers/collectCsvFilesOrExit.ts"],"names":["collectCsvFilesOrExit","directory","localContext","logger","colors","files","readdirSync","f","join","p","statSync","err"],"mappings":"AAAA,u/BAAkF,wDAAyC,wDAA0C,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gFCClR,4BCDE,wBACiB,SAatBA,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACU,CACLD,CAAAA,EAAAA,CACHE,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAI,iCAAiC,CAAC,CAAA,CAC1DF,CAAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAG7B,IAAIG,CAAAA,CAAkB,CAAC,CAAA,CACvB,GAAI,CAEFA,CAAAA,CADgBC,6BAAAA,CAAqB,CAAA,CAElC,MAAA,CAAQC,CAAAA,EAAMA,CAAAA,CAAE,QAAA,CAAS,MAAM,CAAC,CAAA,CAChC,GAAA,CAAKA,CAAAA,EAAMC,wBAAAA,CAAKP,CAAWM,CAAC,CAAC,CAAA,CAC7B,MAAA,CAAQE,CAAAA,EAAM,CACb,GAAI,CACF,OAAOC,0BAAAA,CAAU,CAAA,CAAE,MAAA,CAAO,CAC5B,CAAA,UAAQ,CACN,MAAO,CAAA,CACT,CACF,CAAC,CACL,CAAA,KAAA,CAASC,CAAAA,CAAK,CACZR,mBAAAA,CAAO,KAAA,CAAMC,gBAAAA,CAAO,GAAA,CAAI,CAAA,0BAAA,EAA6BH,CAAS,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/impl-V3MXFXZF.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\nimport { logger } from '../../../logger';\nimport { collectCsvFilesOrExit } from '../../../lib/helpers/collectCsvFilesOrExit';\nimport {\n computePoolSize,\n createExtraKeyHandler,\n CHILD_FLAG,\n type PoolHooks,\n runPool,\n dashboardPlugin,\n} from '../../../lib/pooling';\nimport {\n runChild,\n type ChunkProgress,\n type ChunkResult,\n type ChunkTask,\n} from './worker';\nimport { chunkCsvPlugin } from './ui';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\n/**\n * Returns the current module's path so the worker pool knows what file to re-exec.\n * In Node ESM, __filename is undefined, so we fall back to argv[1].\n *\n * @returns The current module's path as a string\n */\nfunction getCurrentModulePath(): string {\n if (typeof __filename !== 'undefined') {\n return __filename as unknown as string;\n }\n return process.argv[1];\n}\n\n/**\n * Totals aggregate for this command.\n * We don’t need custom counters since the runner already tracks\n * completed/failed counts in its header — so we just use an empty record.\n */\ntype Totals = Record<string, never>;\n\n/**\n * CLI flags accepted by the `chunk-csv` command.\n *\n * These are passed down from the CLI parser into the parent process.\n */\nexport type ChunkCsvCommandFlags = {\n directory: string;\n outputDir?: string;\n clearOutputDir: boolean;\n chunkSizeMB: number;\n concurrency?: number;\n viewerMode: boolean;\n};\n\n/**\n * Parent entrypoint for chunking many CSVs in parallel using the worker pool runner.\n *\n * Lifecycle:\n * 1) Discover CSV inputs (exit if none).\n * 2) Compute pool size (CPU-count heuristic or --concurrency).\n * 3) Build a FIFO queue of `ChunkTask`s.\n * 4) Define pool hooks to drive task assignment, progress, and result handling.\n * 5) Launch the pool with `runPool`, rendering via the `chunkCsvPlugin`.\n *\n * @param this - Bound CLI context (provides process exit + logging).\n * @param flags - CLI options for the run.\n */\nexport async function chunkCsv(\n this: LocalContext,\n flags: ChunkCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const {\n directory,\n outputDir,\n clearOutputDir,\n chunkSizeMB,\n concurrency,\n viewerMode,\n } = flags;\n\n /* 1) Discover CSV inputs */\n const files = collectCsvFilesOrExit(directory, this);\n\n /* 2) Size the pool */\n const { poolSize, cpuCount } = computePoolSize(concurrency, files.length);\n\n logger.info(\n colors.green(\n `Chunking ${files.length} CSV file(s) with pool size ${poolSize} (CPU=${cpuCount})`,\n ),\n );\n\n /* 3) Prepare a simple FIFO queue of tasks (one per file). */\n const queue = files.map<ChunkTask>((filePath) => ({\n filePath,\n options: { outputDir, clearOutputDir, chunkSizeMB },\n }));\n\n /* 4) Define pool hooks to adapt runner to this command. */\n const hooks: PoolHooks<ChunkTask, ChunkProgress, ChunkResult, Totals> = {\n nextTask: () => queue.shift(),\n taskLabel: (t) => t.filePath,\n initTotals: () => ({} as Totals),\n initSlotProgress: () => undefined,\n onProgress: (totals) => totals,\n onResult: (totals, res) => ({ totals, ok: !!res.ok }),\n // postProcess receives log context when viewerMode=true — we don’t need it here.\n postProcess: async () => {\n // nothing extra for chunk-csv\n },\n };\n\n /* 5) Launch the pool runner with our hooks and custom dashboard plugin. */\n await runPool({\n title: `Chunk CSV - ${directory}`,\n baseDir: directory || outputDir || process.cwd(),\n childFlag: CHILD_FLAG,\n childModulePath: getCurrentModulePath(),\n poolSize,\n cpuCount,\n filesTotal: files.length,\n hooks,\n viewerMode,\n render: (input) => dashboardPlugin(input, chunkCsvPlugin, viewerMode),\n extraKeyHandler: ({ logsBySlot, repaint, setPaused }) =>\n createExtraKeyHandler({\n logsBySlot,\n repaint,\n setPaused,\n }),\n });\n}\n\n/* -------------------------------------------------------------------------------------------------\n * If invoked directly as a child process, enter worker loop\n * ------------------------------------------------------------------------------------------------- */\nif (process.argv.includes(CHILD_FLAG)) {\n runChild().catch((err) => {\n logger.error(err);\n process.exit(1);\n });\n}\n","import { join } from 'node:path';\nimport { readdirSync, statSync } from 'node:fs';\nimport colors from 'colors';\nimport { logger } from '../../logger';\nimport type { LocalContext } from '../../context';\n\n/**\n * Validate flags and collect CSV file paths from a directory.\n * On validation error, the provided `exit` function is called.\n *\n * @param directory - the directory containing CSV files\n * @param localContext - the context of the command, used for logging and exit\n * @returns an array of valid CSV file paths\n */\nexport function collectCsvFilesOrExit(\n directory: string | undefined,\n localContext: LocalContext,\n): string[] {\n if (!directory) {\n logger.error(colors.red('A --directory must be provided.'));\n localContext.process.exit(1);\n }\n\n let files: string[] = [];\n try {\n const entries = readdirSync(directory);\n files = entries\n .filter((f) => f.endsWith('.csv'))\n .map((f) => join(directory, f))\n .filter((p) => {\n try {\n return statSync(p).isFile();\n } catch {\n return false;\n }\n });\n } catch (err) {\n logger.error(colors.red(`Failed to read directory: ${directory}`));\n logger.error(colors.red((err as Error).message));\n localContext.process.exit(1);\n }\n\n if (files.length === 0) {\n logger.error(colors.red(`No CSV files found in directory: ${directory}`));\n localContext.process.exit(1);\n }\n\n return files;\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');async function d({auth:o,actions:r,origins:i,silentModeBefore:n,createdAtBefore:s,createdAtAfter:a,transcendUrl:c,concurrency:p}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkVWGA62SGcjs.Ef.call(void 0, {transcendUrl:c,requestActions:r,auth:o,requestOrigins:i,concurrency:p,silentModeBefore:n,createdAtBefore:s,createdAtAfter:a})}exports.approve = d;
2
- //# sourceMappingURL=impl-HRQUBR2Y.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');async function d({auth:o,actions:r,origins:i,silentModeBefore:n,createdAtBefore:s,createdAtAfter:a,transcendUrl:c,concurrency:p}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk55B57ZAYcjs.Ef.call(void 0, {transcendUrl:c,requestActions:r,auth:o,requestOrigins:i,concurrency:p,silentModeBefore:n,createdAtBefore:s,createdAtAfter:a})}exports.approve = d;
2
+ //# sourceMappingURL=impl-VL3CJ2OT.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-HRQUBR2Y.cjs","../src/commands/request/approve/impl.ts"],"names":["approve","auth","actions","origins","silentModeBefore","createdAtBefore","createdAtAfter","transcendUrl","concurrency","doneInputValidation","approvePrivacyRequests"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCiBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,YAAA,CAAAH,CAAAA,CACA,cAAA,CAAgBL,CAAAA,CAChB,IAAA,CAAAD,CAAAA,CACA,cAAA,CAAgBE,CAAAA,CAChB,WAAA,CAAAK,CAAAA,CACA,gBAAA,CAAAJ,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CACF,CAAC,CACH,CAAA,oBAAA","file":"/home/runner/work/cli/cli/dist/impl-HRQUBR2Y.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { RequestAction, RequestOrigin } from '@transcend-io/privacy-types';\nimport { approvePrivacyRequests } from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface ApproveCommandFlags {\n auth: string;\n actions: RequestAction[];\n origins?: RequestOrigin[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function approve(\n this: LocalContext,\n {\n auth,\n actions,\n origins,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n transcendUrl,\n concurrency,\n }: ApproveCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await approvePrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n requestOrigins: origins,\n concurrency,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-VL3CJ2OT.cjs","../src/commands/request/approve/impl.ts"],"names":["approve","auth","actions","origins","silentModeBefore","createdAtBefore","createdAtAfter","transcendUrl","concurrency","doneInputValidation","approvePrivacyRequests"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCiBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,YAAA,CAAAH,CAAAA,CACA,cAAA,CAAgBL,CAAAA,CAChB,IAAA,CAAAD,CAAAA,CACA,cAAA,CAAgBE,CAAAA,CAChB,WAAA,CAAAK,CAAAA,CACA,gBAAA,CAAAJ,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CACF,CAAC,CACH,CAAA,oBAAA","file":"/home/runner/work/cli/cli/dist/impl-VL3CJ2OT.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\n\nimport { RequestAction, RequestOrigin } from '@transcend-io/privacy-types';\nimport { approvePrivacyRequests } from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface ApproveCommandFlags {\n auth: string;\n actions: RequestAction[];\n origins?: RequestOrigin[];\n silentModeBefore?: Date;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function approve(\n this: LocalContext,\n {\n auth,\n actions,\n origins,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n transcendUrl,\n concurrency,\n }: ApproveCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await approvePrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n requestOrigins: origins,\n concurrency,\n silentModeBefore,\n createdAtBefore,\n createdAtAfter,\n });\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkFZTNEEMWcjs = require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function F({auth:n,transcendUrl:m,file:e,pageLimit:c,actions:p,sombraAuth:u,skipRequestIdentifiers:f,statuses:l,createdAtBefore:d,createdAtAfter:g,showTests:q}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let{requestsFormattedForCsv:t}=await _chunkVWGA62SGcjs.Qf.call(void 0, {transcendUrl:m,pageLimit:c,actions:p,skipRequestIdentifiers:f,statuses:l,auth:n,sombraAuth:u,createdAtBefore:d,createdAtAfter:g,isTest:q}),x=_chunkFZTNEEMWcjs.j.call(void 0, t.map(y=>Object.keys(y)).flat());await _chunkVWGA62SGcjs.tg.call(void 0, e,t,x),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${t.length} requests to file "${e}"`))}exports._export = F;
2
- //# sourceMappingURL=impl-TU75DDAK.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function F({auth:n,transcendUrl:m,file:e,pageLimit:c,actions:p,sombraAuth:u,skipRequestIdentifiers:f,statuses:l,createdAtBefore:d,createdAtAfter:g,showTests:q}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let{requestsFormattedForCsv:t}=await _chunk55B57ZAYcjs.Qf.call(void 0, {transcendUrl:m,pageLimit:c,actions:p,skipRequestIdentifiers:f,statuses:l,auth:n,sombraAuth:u,createdAtBefore:d,createdAtAfter:g,isTest:q}),x=_chunkXXFLFF7Qcjs.j.call(void 0, t.map(y=>Object.keys(y)).flat());await _chunk55B57ZAYcjs.tg.call(void 0, e,t,x),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully wrote ${t.length} requests to file "${e}"`))}exports._export = F;
2
+ //# sourceMappingURL=impl-VT3C6SP4.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-TU75DDAK.cjs","../src/commands/request/export/impl.ts"],"names":["_export","auth","transcendUrl","file","pageLimit","actions","sombraAuth","skipRequestIdentifiers","statuses","createdAtBefore","createdAtAfter","showTests","doneInputValidation","requestsFormattedForCsv","pullPrivacyRequests","headers","uniq_default","d","writeLargeCsv","logger","colors"],"mappings":"AAAA,iOAAmC,wDAAkD,gCAA6B,wDAAyC,wDAAyC,gCAA6B,gFCC9M,MA0BnB,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,GAAM,CAAE,uBAAA,CAAAC,CAAwB,CAAA,CAAI,MAAMC,kCAAAA,CACxC,YAAA,CAAAZ,CAAAA,CACA,SAAA,CAAAE,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAE,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAAP,CAAAA,CACA,UAAA,CAAAK,CAAAA,CACA,eAAA,CAAAG,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,MAAA,CAAQC,CACV,CAAC,CAAA,CAGKI,CAAAA,CAAUC,iCAAAA,CACdH,CAAwB,GAAA,CAAKI,CAAAA,EAAM,MAAA,CAAO,IAAA,CAAKA,CAAC,CAAC,CAAA,CAAE,IAAA,CAAK,CAC1D,CAAA,CACA,MAAMC,kCAAAA,CAAcf,CAAMU,CAAAA,CAAyBE,CAAO,CAAA,CAC1DI,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,mBAAA,EAAsBP,CAAAA,CAAwB,MAAM,CAAA,mBAAA,EAAsBV,CAAI,CAAA,CAAA,CAChF,CACF,CACF,CAAA,oBAAA","file":"/home/runner/work/cli/cli/dist/impl-TU75DDAK.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\n\nimport { logger } from '../../../logger';\nimport { uniq } from 'lodash-es';\nimport { pullPrivacyRequests } from '../../../lib/requests';\nimport { writeLargeCsv } from '../../../lib/helpers';\nimport type { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface ExportCommandFlags {\n auth: string;\n sombraAuth?: string;\n actions?: RequestAction[];\n statuses?: RequestStatus[];\n transcendUrl: string;\n file: string;\n concurrency: number;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n showTests?: boolean;\n skipRequestIdentifiers?: boolean;\n pageLimit: number;\n}\n\n// `export` is a reserved keyword, so we need to prefix it with an underscore\n// eslint-disable-next-line no-underscore-dangle\nexport async function _export(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n file,\n pageLimit,\n actions,\n sombraAuth,\n skipRequestIdentifiers,\n statuses,\n createdAtBefore,\n createdAtAfter,\n showTests,\n }: ExportCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const { requestsFormattedForCsv } = await pullPrivacyRequests({\n transcendUrl,\n pageLimit,\n actions,\n skipRequestIdentifiers,\n statuses,\n auth,\n sombraAuth,\n createdAtBefore,\n createdAtAfter,\n isTest: showTests,\n });\n\n // Write to CSV\n const headers = uniq(\n requestsFormattedForCsv.map((d) => Object.keys(d)).flat(),\n );\n await writeLargeCsv(file, requestsFormattedForCsv, headers);\n logger.info(\n colors.green(\n `Successfully wrote ${requestsFormattedForCsv.length} requests to file \"${file}\"`,\n ),\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-VT3C6SP4.cjs","../src/commands/request/export/impl.ts"],"names":["_export","auth","transcendUrl","file","pageLimit","actions","sombraAuth","skipRequestIdentifiers","statuses","createdAtBefore","createdAtAfter","showTests","doneInputValidation","requestsFormattedForCsv","pullPrivacyRequests","headers","uniq_default","d","writeLargeCsv","logger","colors"],"mappings":"AAAA,iOAAmC,wDAAkD,gCAA6B,wDAAyC,wDAAyC,gCAA6B,gFCC9M,MA0BnB,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,GAAM,CAAE,uBAAA,CAAAC,CAAwB,CAAA,CAAI,MAAMC,kCAAAA,CACxC,YAAA,CAAAZ,CAAAA,CACA,SAAA,CAAAE,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAE,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAAP,CAAAA,CACA,UAAA,CAAAK,CAAAA,CACA,eAAA,CAAAG,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,MAAA,CAAQC,CACV,CAAC,CAAA,CAGKI,CAAAA,CAAUC,iCAAAA,CACdH,CAAwB,GAAA,CAAKI,CAAAA,EAAM,MAAA,CAAO,IAAA,CAAKA,CAAC,CAAC,CAAA,CAAE,IAAA,CAAK,CAC1D,CAAA,CACA,MAAMC,kCAAAA,CAAcf,CAAMU,CAAAA,CAAyBE,CAAO,CAAA,CAC1DI,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,mBAAA,EAAsBP,CAAAA,CAAwB,MAAM,CAAA,mBAAA,EAAsBV,CAAI,CAAA,CAAA,CAChF,CACF,CACF,CAAA,oBAAA","file":"/home/runner/work/cli/cli/dist/impl-VT3C6SP4.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport colors from 'colors';\n\nimport { logger } from '../../../logger';\nimport { uniq } from 'lodash-es';\nimport { pullPrivacyRequests } from '../../../lib/requests';\nimport { writeLargeCsv } from '../../../lib/helpers';\nimport type { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface ExportCommandFlags {\n auth: string;\n sombraAuth?: string;\n actions?: RequestAction[];\n statuses?: RequestStatus[];\n transcendUrl: string;\n file: string;\n concurrency: number;\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n showTests?: boolean;\n skipRequestIdentifiers?: boolean;\n pageLimit: number;\n}\n\n// `export` is a reserved keyword, so we need to prefix it with an underscore\n// eslint-disable-next-line no-underscore-dangle\nexport async function _export(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n file,\n pageLimit,\n actions,\n sombraAuth,\n skipRequestIdentifiers,\n statuses,\n createdAtBefore,\n createdAtAfter,\n showTests,\n }: ExportCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const { requestsFormattedForCsv } = await pullPrivacyRequests({\n transcendUrl,\n pageLimit,\n actions,\n skipRequestIdentifiers,\n statuses,\n auth,\n sombraAuth,\n createdAtBefore,\n createdAtAfter,\n isTest: showTests,\n });\n\n // Write to CSV\n const headers = uniq(\n requestsFormattedForCsv.map((d) => Object.keys(d)).flat(),\n );\n await writeLargeCsv(file, requestsFormattedForCsv, headers);\n logger.info(\n colors.green(\n `Successfully wrote ${requestsFormattedForCsv.length} requests to file \"${file}\"`,\n ),\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkHAAVY3FGcjs = require('./chunk-HAAVY3FG.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkFZTNEEMWcjs = require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function v({auth:y,file:a,transcendUrl:C,dataSiloIds:f,includeAttributes:D,includeGuessedCategories:P,parentCategories:b,subCategories:h=[]}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);try{let o=_chunkVWGA62SGcjs.xc.call(void 0, C,y),$=await _chunkHAAVY3FGcjs.a.call(void 0, o,{dataSiloIds:f,includeGuessedCategories:P,parentCategories:b,includeAttributes:D,subCategories:h});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing datapoints to file "${a}"...`));let s=[],j=$.map(t=>{let n={"Property ID":t.id,"Data Silo":t.dataSilo.title,Object:t.dataPoint.name,"Object Path":t.dataPoint.path.join("."),Property:t.name,"Property Description":t.description,"Data Categories":t.categories.map(e=>`${e.category}:${e.name}`).join(", "),"Guessed Category":_optionalChain([t, 'access', _ => _.pendingCategoryGuesses, 'optionalAccess', _2 => _2[0]])?`${t.pendingCategoryGuesses[0].category.category}:${t.pendingCategoryGuesses[0].category.name}`:"","Processing Purposes":t.purposes.map(e=>`${e.purpose}:${e.name}`).join(", "),...Object.entries(_chunkFZTNEEMWcjs.d.call(void 0, t.attributeValues||[],({attributeKey:e})=>e.name)).reduce((e,[x,A])=>(e[x]=A.map(G=>G.name).join(","),e),{})};return s=_chunkFZTNEEMWcjs.j.call(void 0, [...s,...Object.keys(n)]),n});await _chunkVWGA62SGcjs.tg.call(void 0, a,j,s)}catch(o){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error occurred syncing the datapoints: ${o.message}`)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced datapoints to disk at ${a}! View at ${_chunkFZTNEEMWcjs.q}`))}exports.pullDatapoints = v;
2
- //# sourceMappingURL=impl-B4H2FDZW.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk7H4ALAHCcjs = require('./chunk-7H4ALAHC.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function v({auth:y,file:a,transcendUrl:C,dataSiloIds:f,includeAttributes:D,includeGuessedCategories:P,parentCategories:b,subCategories:h=[]}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);try{let o=_chunk55B57ZAYcjs.xc.call(void 0, C,y),$=await _chunk7H4ALAHCcjs.a.call(void 0, o,{dataSiloIds:f,includeGuessedCategories:P,parentCategories:b,includeAttributes:D,subCategories:h});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Writing datapoints to file "${a}"...`));let s=[],j=$.map(t=>{let n={"Property ID":t.id,"Data Silo":t.dataSilo.title,Object:t.dataPoint.name,"Object Path":t.dataPoint.path.join("."),Property:t.name,"Property Description":t.description,"Data Categories":t.categories.map(e=>`${e.category}:${e.name}`).join(", "),"Guessed Category":_optionalChain([t, 'access', _ => _.pendingCategoryGuesses, 'optionalAccess', _2 => _2[0]])?`${t.pendingCategoryGuesses[0].category.category}:${t.pendingCategoryGuesses[0].category.name}`:"","Processing Purposes":t.purposes.map(e=>`${e.purpose}:${e.name}`).join(", "),...Object.entries(_chunkXXFLFF7Qcjs.d.call(void 0, t.attributeValues||[],({attributeKey:e})=>e.name)).reduce((e,[x,A])=>(e[x]=A.map(G=>G.name).join(","),e),{})};return s=_chunkXXFLFF7Qcjs.j.call(void 0, [...s,...Object.keys(n)]),n});await _chunk55B57ZAYcjs.tg.call(void 0, a,j,s)}catch(o){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error occurred syncing the datapoints: ${o.message}`)),this.process.exit(1)}_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully synced datapoints to disk at ${a}! View at ${_chunkXXFLFF7Qcjs.q}`))}exports.pullDatapoints = v;
2
+ //# sourceMappingURL=impl-VUAC7AYF.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-B4H2FDZW.cjs","../src/commands/inventory/pull-datapoints/impl.ts"],"names":["pullDatapoints","auth","file","transcendUrl","dataSiloIds","includeAttributes","includeGuessedCategories","parentCategories","subCategories","doneInputValidation","client","buildTranscendGraphQLClient","dataPoints","pullAllDatapoints","logger","colors","headers","inputs","point","result","category"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAuD,gCAA6B,gFCI1Q,MAmBnB,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CAAgB,CAAC,CACnB,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,GAAI,CAEF,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BR,CAAcF,CAAI,CAAA,CAEvDW,CAAAA,CAAa,MAAMC,iCAAAA,CAAkBH,CAAQ,CACjD,WAAA,CAAAN,CAAAA,CACA,wBAAA,CAAAE,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAF,CAAAA,CACA,aAAA,CAAAG,CACF,CAAC,CAAA,CAEDM,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,CAAA,4BAAA,EAA+Bb,CAAI,CAAA,IAAA,CAAM,CAAC,CAAA,CACrE,IAAIc,CAAAA,CAAoB,CAAC,CAAA,CACnBC,CAAAA,CAASL,CAAAA,CAAW,GAAA,CAAKM,CAAAA,EAAU,CACvC,IAAMC,CAAAA,CAAS,CACb,aAAA,CAAeD,CAAAA,CAAM,EAAA,CACrB,WAAA,CAAaA,CAAAA,CAAM,QAAA,CAAS,KAAA,CAC5B,MAAA,CAAQA,CAAAA,CAAM,SAAA,CAAU,IAAA,CACxB,aAAA,CAAeA,CAAAA,CAAM,SAAA,CAAU,IAAA,CAAK,IAAA,CAAK,GAAG,CAAA,CAC5C,QAAA,CAAUA,CAAAA,CAAM,IAAA,CAChB,sBAAA,CAAwBA,CAAAA,CAAM,WAAA,CAC9B,iBAAA,CAAmBA,CAAAA,CAAM,UAAA,CACtB,GAAA,CAAKE,CAAAA,EAAa,CAAA,EAAA","file":"/home/runner/work/cli/cli/dist/impl-B4H2FDZW.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { uniq, groupBy } from 'lodash-es';\n\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { buildTranscendGraphQLClient } from '../../../lib/graphql';\nimport { ADMIN_DASH_DATAPOINTS } from '../../../constants';\nimport { pullAllDatapoints } from '../../../lib/data-inventory';\nimport { DataCategoryType } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { writeLargeCsv } from '../../../lib/helpers';\n\nexport interface PullDatapointsCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n includeAttributes: boolean;\n includeGuessedCategories: boolean;\n parentCategories?: DataCategoryType[];\n subCategories?: string[];\n}\n\nexport async function pullDatapoints(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n includeAttributes,\n includeGuessedCategories,\n parentCategories,\n subCategories = [],\n }: PullDatapointsCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const dataPoints = await pullAllDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n parentCategories,\n includeAttributes,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n });\n\n logger.info(colors.magenta(`Writing datapoints to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = dataPoints.map((point) => {\n const result = {\n 'Property ID': point.id,\n 'Data Silo': point.dataSilo.title,\n Object: point.dataPoint.name,\n 'Object Path': point.dataPoint.path.join('.'),\n Property: point.name,\n 'Property Description': point.description,\n 'Data Categories': point.categories\n .map((category) => `${category.category}:${category.name}`)\n .join(', '),\n 'Guessed Category': point.pendingCategoryGuesses?.[0]\n ? `${point.pendingCategoryGuesses![0]!.category.category}:${\n point.pendingCategoryGuesses![0]!.category.name\n }`\n : '',\n 'Processing Purposes': point.purposes\n .map((purpose) => `${purpose.purpose}:${purpose.name}`)\n .join(', '),\n ...Object.entries(\n groupBy(\n point.attributeValues || [],\n ({ attributeKey }) => attributeKey.name,\n ),\n ).reduce((acc, [key, values]) => {\n acc[key] = values.map((value) => value.name).join(',');\n return acc;\n }, {} as Record<string, string>),\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(\n colors.red(`An error occurred syncing the datapoints: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced datapoints to disk at ${file}! View at ${ADMIN_DASH_DATAPOINTS}`,\n ),\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-VUAC7AYF.cjs","../src/commands/inventory/pull-datapoints/impl.ts"],"names":["pullDatapoints","auth","file","transcendUrl","dataSiloIds","includeAttributes","includeGuessedCategories","parentCategories","subCategories","doneInputValidation","client","buildTranscendGraphQLClient","dataPoints","pullAllDatapoints","logger","colors","headers","inputs","point","result","category"],"mappings":"AAAA,quBAAwC,wDAAyC,wDAAkD,gCAA6B,wDAAyC,wDAAuD,gCAA6B,gFCI1Q,MAmBnB,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CAAgB,CAAC,CACnB,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,GAAI,CAEF,IAAMC,CAAAA,CAASC,kCAAAA,CAA4BR,CAAcF,CAAI,CAAA,CAEvDW,CAAAA,CAAa,MAAMC,iCAAAA,CAAkBH,CAAQ,CACjD,WAAA,CAAAN,CAAAA,CACA,wBAAA,CAAAE,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAF,CAAAA,CACA,aAAA,CAAAG,CACF,CAAC,CAAA,CAEDM,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,CAAA,4BAAA,EAA+Bb,CAAI,CAAA,IAAA,CAAM,CAAC,CAAA,CACrE,IAAIc,CAAAA,CAAoB,CAAC,CAAA,CACnBC,CAAAA,CAASL,CAAAA,CAAW,GAAA,CAAKM,CAAAA,EAAU,CACvC,IAAMC,CAAAA,CAAS,CACb,aAAA,CAAeD,CAAAA,CAAM,EAAA,CACrB,WAAA,CAAaA,CAAAA,CAAM,QAAA,CAAS,KAAA,CAC5B,MAAA,CAAQA,CAAAA,CAAM,SAAA,CAAU,IAAA,CACxB,aAAA,CAAeA,CAAAA,CAAM,SAAA,CAAU,IAAA,CAAK,IAAA,CAAK,GAAG,CAAA,CAC5C,QAAA,CAAUA,CAAAA,CAAM,IAAA,CAChB,sBAAA,CAAwBA,CAAAA,CAAM,WAAA,CAC9B,iBAAA,CAAmBA,CAAAA,CAAM,UAAA,CACtB,GAAA,CAAKE,CAAAA,EAAa,CAAA,EAAA","file":"/home/runner/work/cli/cli/dist/impl-VUAC7AYF.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { uniq, groupBy } from 'lodash-es';\n\nimport { logger } from '../../../logger';\nimport colors from 'colors';\nimport { buildTranscendGraphQLClient } from '../../../lib/graphql';\nimport { ADMIN_DASH_DATAPOINTS } from '../../../constants';\nimport { pullAllDatapoints } from '../../../lib/data-inventory';\nimport { DataCategoryType } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { writeLargeCsv } from '../../../lib/helpers';\n\nexport interface PullDatapointsCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n dataSiloIds?: string[];\n includeAttributes: boolean;\n includeGuessedCategories: boolean;\n parentCategories?: DataCategoryType[];\n subCategories?: string[];\n}\n\nexport async function pullDatapoints(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n dataSiloIds,\n includeAttributes,\n includeGuessedCategories,\n parentCategories,\n subCategories = [],\n }: PullDatapointsCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n try {\n // Create a GraphQL client\n const client = buildTranscendGraphQLClient(transcendUrl, auth);\n\n const dataPoints = await pullAllDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n parentCategories,\n includeAttributes,\n subCategories, // TODO: https://transcend.height.app/T-40482 - do by name not ID\n });\n\n logger.info(colors.magenta(`Writing datapoints to file \"${file}\"...`));\n let headers: string[] = [];\n const inputs = dataPoints.map((point) => {\n const result = {\n 'Property ID': point.id,\n 'Data Silo': point.dataSilo.title,\n Object: point.dataPoint.name,\n 'Object Path': point.dataPoint.path.join('.'),\n Property: point.name,\n 'Property Description': point.description,\n 'Data Categories': point.categories\n .map((category) => `${category.category}:${category.name}`)\n .join(', '),\n 'Guessed Category': point.pendingCategoryGuesses?.[0]\n ? `${point.pendingCategoryGuesses![0]!.category.category}:${\n point.pendingCategoryGuesses![0]!.category.name\n }`\n : '',\n 'Processing Purposes': point.purposes\n .map((purpose) => `${purpose.purpose}:${purpose.name}`)\n .join(', '),\n ...Object.entries(\n groupBy(\n point.attributeValues || [],\n ({ attributeKey }) => attributeKey.name,\n ),\n ).reduce((acc, [key, values]) => {\n acc[key] = values.map((value) => value.name).join(',');\n return acc;\n }, {} as Record<string, string>),\n };\n headers = uniq([...headers, ...Object.keys(result)]);\n return result;\n });\n await writeLargeCsv(file, inputs, headers);\n } catch (err) {\n logger.error(\n colors.red(`An error occurred syncing the datapoints: ${err.message}`),\n );\n this.process.exit(1);\n }\n\n // Indicate success\n logger.info(\n colors.green(\n `Successfully synced datapoints to disk at ${file}! View at ${ADMIN_DASH_DATAPOINTS}`,\n ),\n );\n}\n"]}
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUHERPTMCcjs = require('./chunk-UHERPTMC.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkFZTNEEMWcjs = require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');var _fs = require('fs');async function N({email:o,password:r,apiKeyTitle:n,file:s,scopes:a,deleteExistingApiKey:p,createNewApiKey:m,parentOrganizationId:c,transcendUrl:l}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let g=a.map(d=>_chunkFZTNEEMWcjs.w[d].name),{errors:y,apiKeys:f}=await _chunkUHERPTMCcjs.a.call(void 0, {transcendUrl:l,password:r,email:o,parentOrganizationId:c,deleteExistingApiKey:p,createNewApiKey:m,apiKeyTitle:n,scopes:g});_fs.writeFileSync.call(void 0, s,`${JSON.stringify(f,null,2)}
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNC6VWOMNcjs = require('./chunk-NC6VWOMN.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');var _chunkXXFLFF7Qcjs = require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _fs = require('fs');async function N({email:o,password:r,apiKeyTitle:n,file:s,scopes:a,deleteExistingApiKey:p,createNewApiKey:m,parentOrganizationId:c,transcendUrl:l}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let g=a.map(d=>_chunkXXFLFF7Qcjs.w[d].name),{errors:y,apiKeys:f}=await _chunkNC6VWOMNcjs.a.call(void 0, {transcendUrl:l,password:r,email:o,parentOrganizationId:c,deleteExistingApiKey:p,createNewApiKey:m,apiKeyTitle:n,scopes:g});_fs.writeFileSync.call(void 0, s,`${JSON.stringify(f,null,2)}
2
2
  `),y.length>0&&this.process.exit(1)}exports.generateApiKeys = N;
3
- //# sourceMappingURL=impl-OTMLF2EA.cjs.map
3
+ //# sourceMappingURL=impl-VXOHC45F.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-OTMLF2EA.cjs","../src/commands/admin/generate-api-keys/impl.ts"],"names":["generateApiKeys","email","password","apiKeyTitle","file","scopes","deleteExistingApiKey","createNewApiKey","parentOrganizationId","transcendUrl","doneInputValidation","scopeNames","scopeTitle","SCOPES_BY_TITLE","errors","apiKeys","generateCrossAccountApiKeys","writeFileSync"],"mappings":"AAAA,iIAAwC,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gCAA6B,wDAAyC,gCAA6B,wBCC7O,MAsB9B,SAAsBA,CAAAA,CAEpB,CACE,KAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,IAAMC,CAAAA,CAAaN,CAAAA,CAAO,GAAA,CACvBO,CAAAA,EAAeC,mBAAAA,CAAgBD,CAAU,CAAA,CAAE,IAC9C,CAAA,CAGM,CAAE,MAAA,CAAAE,CAAAA,CAAQ,OAAA,CAAAC,CAAQ,CAAA,CAAI,MAAMC,iCAAAA,CAChC,YAAA,CAAAP,CAAAA,CACA,QAAA,CAAAP,CAAAA,CACA,KAAA,CAAAD,CAAAA,CACA,oBAAA,CAAAO,CAAAA,CACA,oBAAA,CAAAF,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,WAAA,CAAAJ,CAAAA,CACA,MAAA,CAAQQ,CACV,CAAC,CAAA,CAGDM,+BAAAA,CAAcb,CAAM,CAAA,EAAA;AAItB","file":"/home/runner/work/cli/cli/dist/impl-OTMLF2EA.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { writeFileSync } from 'node:fs';\n\nimport { ScopeName } from '@transcend-io/privacy-types';\n\nimport { generateCrossAccountApiKeys } from '../../../lib/api-keys';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { SCOPES_BY_TITLE } from '../../../constants';\n\n// Command flag interface\nexport interface GenerateApiKeysCommandFlags {\n email: string;\n password: string;\n apiKeyTitle: string;\n file: string;\n scopes: string[];\n deleteExistingApiKey: boolean;\n createNewApiKey: boolean;\n parentOrganizationId?: string;\n transcendUrl: string;\n}\n\n// Command implementation\nexport async function generateApiKeys(\n this: LocalContext,\n {\n email,\n password,\n apiKeyTitle,\n file,\n scopes,\n deleteExistingApiKey,\n createNewApiKey,\n parentOrganizationId,\n transcendUrl,\n }: GenerateApiKeysCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const scopeNames = scopes.map(\n (scopeTitle) => SCOPES_BY_TITLE[scopeTitle].name as ScopeName,\n );\n\n // Upload privacy requests\n const { errors, apiKeys } = await generateCrossAccountApiKeys({\n transcendUrl,\n password,\n email,\n parentOrganizationId,\n deleteExistingApiKey,\n createNewApiKey,\n apiKeyTitle,\n scopes: scopeNames,\n });\n\n // Write to disk\n writeFileSync(file, `${JSON.stringify(apiKeys, null, 2)}\\n`);\n if (errors.length > 0) {\n this.process.exit(1);\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-VXOHC45F.cjs","../src/commands/admin/generate-api-keys/impl.ts"],"names":["generateApiKeys","email","password","apiKeyTitle","file","scopes","deleteExistingApiKey","createNewApiKey","parentOrganizationId","transcendUrl","doneInputValidation","scopeNames","scopeTitle","SCOPES_BY_TITLE","errors","apiKeys","generateCrossAccountApiKeys","writeFileSync"],"mappings":"AAAA,iIAAwC,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gCAA6B,wDAAyC,gCAA6B,wBCC7O,MAsB9B,SAAsBA,CAAAA,CAEpB,CACE,KAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,IAAMC,CAAAA,CAAaN,CAAAA,CAAO,GAAA,CACvBO,CAAAA,EAAeC,mBAAAA,CAAgBD,CAAU,CAAA,CAAE,IAC9C,CAAA,CAGM,CAAE,MAAA,CAAAE,CAAAA,CAAQ,OAAA,CAAAC,CAAQ,CAAA,CAAI,MAAMC,iCAAAA,CAChC,YAAA,CAAAP,CAAAA,CACA,QAAA,CAAAP,CAAAA,CACA,KAAA,CAAAD,CAAAA,CACA,oBAAA,CAAAO,CAAAA,CACA,oBAAA,CAAAF,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,WAAA,CAAAJ,CAAAA,CACA,MAAA,CAAQQ,CACV,CAAC,CAAA,CAGDM,+BAAAA,CAAcb,CAAM,CAAA,EAAA;AAItB","file":"/home/runner/work/cli/cli/dist/impl-VXOHC45F.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { writeFileSync } from 'node:fs';\n\nimport { ScopeName } from '@transcend-io/privacy-types';\n\nimport { generateCrossAccountApiKeys } from '../../../lib/api-keys';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\nimport { SCOPES_BY_TITLE } from '../../../constants';\n\n// Command flag interface\nexport interface GenerateApiKeysCommandFlags {\n email: string;\n password: string;\n apiKeyTitle: string;\n file: string;\n scopes: string[];\n deleteExistingApiKey: boolean;\n createNewApiKey: boolean;\n parentOrganizationId?: string;\n transcendUrl: string;\n}\n\n// Command implementation\nexport async function generateApiKeys(\n this: LocalContext,\n {\n email,\n password,\n apiKeyTitle,\n file,\n scopes,\n deleteExistingApiKey,\n createNewApiKey,\n parentOrganizationId,\n transcendUrl,\n }: GenerateApiKeysCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n const scopeNames = scopes.map(\n (scopeTitle) => SCOPES_BY_TITLE[scopeTitle].name as ScopeName,\n );\n\n // Upload privacy requests\n const { errors, apiKeys } = await generateCrossAccountApiKeys({\n transcendUrl,\n password,\n email,\n parentOrganizationId,\n deleteExistingApiKey,\n createNewApiKey,\n apiKeyTitle,\n scopes: scopeNames,\n });\n\n // Write to disk\n writeFileSync(file, `${JSON.stringify(apiKeys, null, 2)}\\n`);\n if (errors.length > 0) {\n this.process.exit(1);\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');async function d({auth:r,transcendUrl:n,actions:o,statuses:s,requestIds:a,createdAtBefore:i,createdAtAfter:c,concurrency:m}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkVWGA62SGcjs.pf.call(void 0, {transcendUrl:n,requestActions:o,auth:r,requestIds:a,statuses:s,concurrency:m,createdAtBefore:i,createdAtAfter:c})}exports.markSilent = d;
2
- //# sourceMappingURL=impl-P2KE5XGI.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');async function d({auth:r,transcendUrl:n,actions:o,statuses:s,requestIds:a,createdAtBefore:i,createdAtAfter:c,concurrency:m}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk55B57ZAYcjs.pf.call(void 0, {transcendUrl:n,requestActions:o,auth:r,requestIds:a,statuses:s,concurrency:m,createdAtBefore:i,createdAtAfter:c})}exports.markSilent = d;
2
+ //# sourceMappingURL=impl-WMI46UXI.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-P2KE5XGI.cjs","../src/commands/request/mark-silent/impl.ts"],"names":["markSilent","auth","transcendUrl","actions","statuses","requestIds","createdAtBefore","createdAtAfter","concurrency","doneInputValidation","markSilentPrivacyRequests"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCgBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,YAAA,CAAAR,CAAAA,CACA,cAAA,CAAgBC,CAAAA,CAChB,IAAA,CAAAF,CAAAA,CACA,UAAA,CAAAI,CAAAA,CACA,QAAA,CAAAD,CAAAA,CACA,WAAA,CAAAI,CAAAA,CACA,eAAA,CAAAF,CAAAA,CACA,cAAA,CAAAC,CACF,CAAC,CACH,CAAA,uBAAA","file":"/home/runner/work/cli/cli/dist/impl-P2KE5XGI.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { markSilentPrivacyRequests } from '../../../lib/requests';\nimport type { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface MarkSilentCommandFlags {\n auth: string;\n actions: RequestAction[];\n statuses?: RequestStatus[];\n requestIds?: string[];\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function markSilent(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n actions,\n statuses,\n requestIds,\n createdAtBefore,\n createdAtAfter,\n concurrency,\n }: MarkSilentCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await markSilentPrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n requestIds,\n statuses,\n concurrency,\n createdAtBefore,\n createdAtAfter,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-WMI46UXI.cjs","../src/commands/request/mark-silent/impl.ts"],"names":["markSilent","auth","transcendUrl","actions","statuses","requestIds","createdAtBefore","createdAtAfter","concurrency","doneInputValidation","markSilentPrivacyRequests"],"mappings":"AAAA,iIAAwC,wDAA0C,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCgBtM,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,YAAA,CAAAR,CAAAA,CACA,cAAA,CAAgBC,CAAAA,CAChB,IAAA,CAAAF,CAAAA,CACA,UAAA,CAAAI,CAAAA,CACA,QAAA,CAAAD,CAAAA,CACA,WAAA,CAAAI,CAAAA,CACA,eAAA,CAAAF,CAAAA,CACA,cAAA,CAAAC,CACF,CAAC,CACH,CAAA,uBAAA","file":"/home/runner/work/cli/cli/dist/impl-WMI46UXI.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { markSilentPrivacyRequests } from '../../../lib/requests';\nimport type { RequestAction, RequestStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface MarkSilentCommandFlags {\n auth: string;\n actions: RequestAction[];\n statuses?: RequestStatus[];\n requestIds?: string[];\n createdAtBefore?: Date;\n createdAtAfter?: Date;\n transcendUrl: string;\n concurrency: number;\n}\n\nexport async function markSilent(\n this: LocalContext,\n {\n auth,\n transcendUrl,\n actions,\n statuses,\n requestIds,\n createdAtBefore,\n createdAtAfter,\n concurrency,\n }: MarkSilentCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await markSilentPrivacyRequests({\n transcendUrl,\n requestActions: actions,\n auth,\n requestIds,\n statuses,\n concurrency,\n createdAtBefore,\n createdAtAfter,\n });\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');async function F({auth:i,file:n,transcendUrl:r,cacheFilepath:a,requestReceiptFolder:s,sombraAuth:l,concurrency:p,attributes:d,isTest:c,isSilent:u,skipSendingReceipt:m,emailIsVerified:b,skipFilterStep:g,dryRun:f,debug:C,defaultPhoneCountryCode:h}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunkVWGA62SGcjs.Kf.call(void 0, {cacheFilepath:a,requestReceiptFolder:s,file:n,auth:i,sombraAuth:l,concurrency:p,transcendUrl:r,defaultPhoneCountryCode:h,attributes:_chunkVWGA62SGcjs.pc.call(void 0, d),debug:C,skipFilterStep:g,isSilent:u,skipSendingReceipt:m,emailIsVerified:b,isTest:c,dryRun:f})}exports.upload = F;
2
- //# sourceMappingURL=impl-DLES54N2.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');async function F({auth:i,file:n,transcendUrl:r,cacheFilepath:a,requestReceiptFolder:s,sombraAuth:l,concurrency:p,attributes:d,isTest:c,isSilent:u,skipSendingReceipt:m,emailIsVerified:b,skipFilterStep:g,dryRun:f,debug:C,defaultPhoneCountryCode:h}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk55B57ZAYcjs.Kf.call(void 0, {cacheFilepath:a,requestReceiptFolder:s,file:n,auth:i,sombraAuth:l,concurrency:p,transcendUrl:r,defaultPhoneCountryCode:h,attributes:_chunk55B57ZAYcjs.pc.call(void 0, d),debug:C,skipFilterStep:g,isSilent:u,skipSendingReceipt:m,emailIsVerified:b,isTest:c,dryRun:f})}exports.upload = F;
2
+ //# sourceMappingURL=impl-XJBUIDZP.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-DLES54N2.cjs","../src/commands/request/upload/impl.ts"],"names":["upload","auth","file","transcendUrl","cacheFilepath","requestReceiptFolder","sombraAuth","concurrency","attributes","isTest","isSilent","skipSendingReceipt","emailIsVerified","skipFilterStep","dryRun","debug","defaultPhoneCountryCode","doneInputValidation","uploadPrivacyRequestsFromCsv","splitCsvToList"],"mappings":"AAAA,iIAAwC,wDAAkD,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MC0B9M,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,kBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,aAAA,CAAAd,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,IAAA,CAAAH,CAAAA,CACA,IAAA,CAAAD,CAAAA,CACA,UAAA,CAAAK,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAJ,CAAAA,CACA,uBAAA,CAAAa,CAAAA,CACA,UAAA,CAAYG,kCAAAA,CAAyB,CAAA,CACrC,KAAA,CAAAJ,CAAAA,CACA,cAAA,CAAAF,CAAAA,CACA,QAAA,CAAAH,CAAAA,CACA,kBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,MAAA,CAAAH,CAAAA,CACA,MAAA,CAAAK,CACF,CAAC,CACH,CAAA,mBAAA","file":"/home/runner/work/cli/cli/dist/impl-DLES54N2.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport {\n splitCsvToList,\n uploadPrivacyRequestsFromCsv,\n} from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n cacheFilepath: string;\n requestReceiptFolder: string;\n sombraAuth?: string;\n concurrency: number;\n attributes: string;\n isTest: boolean;\n isSilent: boolean;\n skipSendingReceipt: boolean;\n emailIsVerified: boolean;\n skipFilterStep: boolean;\n dryRun: boolean;\n debug: boolean;\n defaultPhoneCountryCode: string;\n}\n\nexport async function upload(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n cacheFilepath,\n requestReceiptFolder,\n sombraAuth,\n concurrency,\n attributes,\n isTest,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n skipFilterStep,\n dryRun,\n debug,\n defaultPhoneCountryCode,\n }: UploadCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadPrivacyRequestsFromCsv({\n cacheFilepath,\n requestReceiptFolder,\n file,\n auth,\n sombraAuth,\n concurrency,\n transcendUrl,\n defaultPhoneCountryCode,\n attributes: splitCsvToList(attributes),\n debug,\n skipFilterStep,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n isTest,\n dryRun,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-XJBUIDZP.cjs","../src/commands/request/upload/impl.ts"],"names":["upload","auth","file","transcendUrl","cacheFilepath","requestReceiptFolder","sombraAuth","concurrency","attributes","isTest","isSilent","skipSendingReceipt","emailIsVerified","skipFilterStep","dryRun","debug","defaultPhoneCountryCode","doneInputValidation","uploadPrivacyRequestsFromCsv","splitCsvToList"],"mappings":"AAAA,iIAAwC,wDAAkD,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MC0B9M,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,kBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,uBAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMC,kCAAAA,CACJ,aAAA,CAAAd,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,IAAA,CAAAH,CAAAA,CACA,IAAA,CAAAD,CAAAA,CACA,UAAA,CAAAK,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAJ,CAAAA,CACA,uBAAA,CAAAa,CAAAA,CACA,UAAA,CAAYG,kCAAAA,CAAyB,CAAA,CACrC,KAAA,CAAAJ,CAAAA,CACA,cAAA,CAAAF,CAAAA,CACA,QAAA,CAAAH,CAAAA,CACA,kBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,MAAA,CAAAH,CAAAA,CACA,MAAA,CAAAK,CACF,CAAC,CACH,CAAA,mBAAA","file":"/home/runner/work/cli/cli/dist/impl-XJBUIDZP.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport {\n splitCsvToList,\n uploadPrivacyRequestsFromCsv,\n} from '../../../lib/requests';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadCommandFlags {\n auth: string;\n file: string;\n transcendUrl: string;\n cacheFilepath: string;\n requestReceiptFolder: string;\n sombraAuth?: string;\n concurrency: number;\n attributes: string;\n isTest: boolean;\n isSilent: boolean;\n skipSendingReceipt: boolean;\n emailIsVerified: boolean;\n skipFilterStep: boolean;\n dryRun: boolean;\n debug: boolean;\n defaultPhoneCountryCode: string;\n}\n\nexport async function upload(\n this: LocalContext,\n {\n auth,\n file,\n transcendUrl,\n cacheFilepath,\n requestReceiptFolder,\n sombraAuth,\n concurrency,\n attributes,\n isTest,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n skipFilterStep,\n dryRun,\n debug,\n defaultPhoneCountryCode,\n }: UploadCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadPrivacyRequestsFromCsv({\n cacheFilepath,\n requestReceiptFolder,\n file,\n auth,\n sombraAuth,\n concurrency,\n transcendUrl,\n defaultPhoneCountryCode,\n attributes: splitCsvToList(attributes),\n debug,\n skipFilterStep,\n isSilent,\n skipSendingReceipt,\n emailIsVerified,\n isTest,\n dryRun,\n });\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5SEDJJAHcjs = require('./chunk-5SEDJJAH.cjs');require('./chunk-HUZESENZ.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');async function m({auth:a,trackerStatus:r,file:s,classifyService:e,transcendUrl:n}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk5SEDJJAHcjs.b.call(void 0, {auth:a,trackerStatus:r,file:s,classifyService:e,transcendUrl:n})}exports.uploadDataFlowsFromCsv = m;
2
- //# sourceMappingURL=impl-7XQ333J3.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk52MA7ZLScjs = require('./chunk-52MA7ZLS.cjs');require('./chunk-M3Y6JH6I.cjs');require('./chunk-ABKDAPPR.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');async function m({auth:a,trackerStatus:r,file:s,classifyService:e,transcendUrl:n}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit),await _chunk52MA7ZLScjs.b.call(void 0, {auth:a,trackerStatus:r,file:s,classifyService:e,transcendUrl:n})}exports.uploadDataFlowsFromCsv = m;
2
+ //# sourceMappingURL=impl-XLL66FXK.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-7XQ333J3.cjs","../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"names":["uploadDataFlowsFromCsv","auth","trackerStatus","file","classifyService","transcendUrl","doneInputValidation"],"mappings":"AAAA,iIAAwC,gCAA6B,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCa5R,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMN,iCAAAA,CACJ,IAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAC,CACH,CAAA,mCAAA","file":"/home/runner/work/cli/cli/dist/impl-7XQ333J3.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { uploadDataFlowsFromCsv as uploadDataFlowsFromCsvHelper } from '../../../lib/consent-manager';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadDataFlowsFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n classifyService: boolean;\n transcendUrl: string;\n}\n\nexport async function uploadDataFlowsFromCsv(\n this: LocalContext,\n {\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n }: UploadDataFlowsFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadDataFlowsFromCsvHelper({\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/impl-XLL66FXK.cjs","../src/commands/consent/upload-data-flows-from-csv/impl.ts"],"names":["uploadDataFlowsFromCsv","auth","trackerStatus","file","classifyService","transcendUrl","doneInputValidation"],"mappings":"AAAA,iIAAwC,gCAA6B,gCAA6B,wDAAyC,gCAA6B,gCAA6B,gCAA6B,gCAA6B,gCAA6B,MCa5R,SAAsBA,CAAAA,CAEpB,CACE,IAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACe,CACfC,iCAAAA,IAAoB,CAAK,OAAA,CAAQ,IAAI,CAAA,CAErC,MAAMN,iCAAAA,CACJ,IAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAC,CACH,CAAA,mCAAA","file":"/home/runner/work/cli/cli/dist/impl-XLL66FXK.cjs","sourcesContent":[null,"import type { LocalContext } from '../../../context';\nimport { uploadDataFlowsFromCsv as uploadDataFlowsFromCsvHelper } from '../../../lib/consent-manager';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport { doneInputValidation } from '../../../lib/cli/done-input-validation';\n\nexport interface UploadDataFlowsFromCsvCommandFlags {\n auth: string;\n trackerStatus: ConsentTrackerStatus;\n file: string;\n classifyService: boolean;\n transcendUrl: string;\n}\n\nexport async function uploadDataFlowsFromCsv(\n this: LocalContext,\n {\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n }: UploadDataFlowsFromCsvCommandFlags,\n): Promise<void> {\n doneInputValidation(this.process.exit);\n\n await uploadDataFlowsFromCsvHelper({\n auth,\n trackerStatus,\n file,\n classifyService,\n transcendUrl,\n });\n}\n"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkHUZESENZcjs = require('./chunk-HUZESENZ.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunkVWGA62SGcjs = require('./chunk-VWGA62SG.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-FZTNEEMW.cjs');require('./chunk-7PB6LVSE.cjs');var _iots = require('io-ts'); var t = _interopRequireWildcard(_iots);var o=t.intersection([t.type({userId:t.string,timestamp:t.string}),t.partial({confirmed:t.union([t.literal("true"),t.literal("false")]),updated:t.union([t.literal("true"),t.literal("false")]),prompted:t.union([t.literal("true"),t.literal("false")]),metadata:t.string,usp:t.union([t.string,t.null]),gpp:t.union([t.string,t.null]),purposes:t.string})]);async function y({base64EncryptionKey:i,base64SigningKey:s,partition:a,file:p,consentUrl:l,concurrency:c}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let f=_chunkVWGA62SGcjs.sc.call(void 0, p,o);await _chunkHUZESENZcjs.d.call(void 0, {base64EncryptionKey:i,base64SigningKey:s,preferences:f,partition:a,concurrency:c,transcendUrl:l})}exports.uploadConsentPreferences = y;
2
- //# sourceMappingURL=impl-FCNDIDLG.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkM3Y6JH6Icjs = require('./chunk-M3Y6JH6I.cjs');var _chunkWKCTKYN4cjs = require('./chunk-WKCTKYN4.cjs');var _chunk55B57ZAYcjs = require('./chunk-55B57ZAY.cjs');require('./chunk-TSJTXXLZ.cjs');require('./chunk-ZUNVPK23.cjs');require('./chunk-XXFLFF7Q.cjs');require('./chunk-7PB6LVSE.cjs');var _iots = require('io-ts'); var t = _interopRequireWildcard(_iots);var o=t.intersection([t.type({userId:t.string,timestamp:t.string}),t.partial({confirmed:t.union([t.literal("true"),t.literal("false")]),updated:t.union([t.literal("true"),t.literal("false")]),prompted:t.union([t.literal("true"),t.literal("false")]),metadata:t.string,usp:t.union([t.string,t.null]),gpp:t.union([t.string,t.null]),purposes:t.string})]);async function y({base64EncryptionKey:i,base64SigningKey:s,partition:a,file:p,consentUrl:l,concurrency:c}){_chunkWKCTKYN4cjs.a.call(void 0, this.process.exit);let f=_chunk55B57ZAYcjs.sc.call(void 0, p,o);await _chunkM3Y6JH6Icjs.d.call(void 0, {base64EncryptionKey:i,base64SigningKey:s,preferences:f,partition:a,concurrency:c,transcendUrl:l})}exports.uploadConsentPreferences = y;
2
+ //# sourceMappingURL=impl-YGVW4RTA.cjs.map