@transcend-io/cli 8.24.0 → 8.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/README.md +36 -15
  2. package/dist/bin/bash-complete.cjs +1 -1
  3. package/dist/bin/cli.cjs +1 -1
  4. package/dist/bin/deprecated-command.cjs +2 -2
  5. package/dist/{chunk-IWZ2HIHK.cjs → chunk-2Q7ADV5Y.cjs} +2 -2
  6. package/dist/{chunk-IWZ2HIHK.cjs.map → chunk-2Q7ADV5Y.cjs.map} +1 -1
  7. package/dist/{chunk-CYGC567Y.cjs → chunk-5PTFTN6J.cjs} +11 -11
  8. package/dist/{chunk-CYGC567Y.cjs.map → chunk-5PTFTN6J.cjs.map} +1 -1
  9. package/dist/chunk-7ZGJ4MJF.cjs +12 -0
  10. package/dist/{chunk-OKWH7Y2Z.cjs.map → chunk-7ZGJ4MJF.cjs.map} +1 -1
  11. package/dist/{chunk-7A6YW7SF.cjs → chunk-BGZ6TA6C.cjs} +2 -2
  12. package/dist/{chunk-7A6YW7SF.cjs.map → chunk-BGZ6TA6C.cjs.map} +1 -1
  13. package/dist/{chunk-C5AAGXZE.cjs → chunk-COKHIMLO.cjs} +2 -2
  14. package/dist/{chunk-C5AAGXZE.cjs.map → chunk-COKHIMLO.cjs.map} +1 -1
  15. package/dist/chunk-F3BRFYKD.cjs +2 -0
  16. package/dist/chunk-F3BRFYKD.cjs.map +1 -0
  17. package/dist/{chunk-AVZBE2R3.cjs → chunk-GG7P2RO6.cjs} +2 -2
  18. package/dist/{chunk-AVZBE2R3.cjs.map → chunk-GG7P2RO6.cjs.map} +1 -1
  19. package/dist/{chunk-LFAJZQET.cjs → chunk-HRNCQV6G.cjs} +4 -4
  20. package/dist/{chunk-LFAJZQET.cjs.map → chunk-HRNCQV6G.cjs.map} +1 -1
  21. package/dist/{chunk-DCLHMZWV.cjs → chunk-KYVDLURL.cjs} +4 -4
  22. package/dist/{chunk-DCLHMZWV.cjs.map → chunk-KYVDLURL.cjs.map} +1 -1
  23. package/dist/{chunk-7IN5X2S4.cjs → chunk-MOWFESXN.cjs} +2 -2
  24. package/dist/{chunk-7IN5X2S4.cjs.map → chunk-MOWFESXN.cjs.map} +1 -1
  25. package/dist/{chunk-UJPJAASL.cjs → chunk-MPMKY5NF.cjs} +22 -22
  26. package/dist/chunk-MPMKY5NF.cjs.map +1 -0
  27. package/dist/{chunk-4DYEWT53.cjs → chunk-NI434OII.cjs} +2 -2
  28. package/dist/{chunk-4DYEWT53.cjs.map → chunk-NI434OII.cjs.map} +1 -1
  29. package/dist/{chunk-CFFB56DK.cjs → chunk-RGBVP433.cjs} +2 -2
  30. package/dist/{chunk-CFFB56DK.cjs.map → chunk-RGBVP433.cjs.map} +1 -1
  31. package/dist/chunk-WWJHUHSQ.cjs +12 -0
  32. package/dist/chunk-WWJHUHSQ.cjs.map +1 -0
  33. package/dist/{impl-DD246CUP.cjs → impl-32ZRDOCN.cjs} +5 -5
  34. package/dist/{impl-DD246CUP.cjs.map → impl-32ZRDOCN.cjs.map} +1 -1
  35. package/dist/{impl-WV34A76M.cjs → impl-3VTN6SPE.cjs} +3 -3
  36. package/dist/{impl-WV34A76M.cjs.map → impl-3VTN6SPE.cjs.map} +1 -1
  37. package/dist/{impl-U4XXZKTL.cjs → impl-4YI4ERPI.cjs} +2 -2
  38. package/dist/{impl-U4XXZKTL.cjs.map → impl-4YI4ERPI.cjs.map} +1 -1
  39. package/dist/{impl-NTMCDOS7.cjs → impl-5H724WN5.cjs} +2 -2
  40. package/dist/{impl-NTMCDOS7.cjs.map → impl-5H724WN5.cjs.map} +1 -1
  41. package/dist/{impl-DEJ7Q25E.cjs → impl-6S3K72GP.cjs} +2 -2
  42. package/dist/{impl-DEJ7Q25E.cjs.map → impl-6S3K72GP.cjs.map} +1 -1
  43. package/dist/{impl-2RF3CQYJ.cjs → impl-7G2TDJGL.cjs} +2 -2
  44. package/dist/{impl-2RF3CQYJ.cjs.map → impl-7G2TDJGL.cjs.map} +1 -1
  45. package/dist/{impl-VE2OJ6VL.cjs → impl-7WCN5RAN.cjs} +2 -2
  46. package/dist/{impl-VE2OJ6VL.cjs.map → impl-7WCN5RAN.cjs.map} +1 -1
  47. package/dist/{impl-5YHZWUVM.cjs → impl-7ZGTTYG5.cjs} +2 -2
  48. package/dist/{impl-5YHZWUVM.cjs.map → impl-7ZGTTYG5.cjs.map} +1 -1
  49. package/dist/impl-AI276JNQ.cjs +2 -0
  50. package/dist/impl-AI276JNQ.cjs.map +1 -0
  51. package/dist/{impl-EMPK5SP4.cjs → impl-AQY6F4SC.cjs} +2 -2
  52. package/dist/{impl-EMPK5SP4.cjs.map → impl-AQY6F4SC.cjs.map} +1 -1
  53. package/dist/{impl-F7TSRMCF.cjs → impl-CLA7WK6U.cjs} +2 -2
  54. package/dist/{impl-F7TSRMCF.cjs.map → impl-CLA7WK6U.cjs.map} +1 -1
  55. package/dist/{impl-PDZTOIGB.cjs → impl-CP2GLGVZ.cjs} +2 -2
  56. package/dist/{impl-PDZTOIGB.cjs.map → impl-CP2GLGVZ.cjs.map} +1 -1
  57. package/dist/impl-CRQ4DYII.cjs +2 -0
  58. package/dist/impl-CRQ4DYII.cjs.map +1 -0
  59. package/dist/{impl-SKGYIPGE.cjs → impl-EQ4EH4QJ.cjs} +2 -2
  60. package/dist/{impl-SKGYIPGE.cjs.map → impl-EQ4EH4QJ.cjs.map} +1 -1
  61. package/dist/{impl-3PVAU2SZ.cjs → impl-FD5CDY7Y.cjs} +2 -2
  62. package/dist/{impl-3PVAU2SZ.cjs.map → impl-FD5CDY7Y.cjs.map} +1 -1
  63. package/dist/{impl-R2KE5BYZ.cjs → impl-FJ4XWHLE.cjs} +2 -2
  64. package/dist/{impl-R2KE5BYZ.cjs.map → impl-FJ4XWHLE.cjs.map} +1 -1
  65. package/dist/{impl-OGY3N3JL.cjs → impl-G6WAGNDN.cjs} +2 -2
  66. package/dist/{impl-OGY3N3JL.cjs.map → impl-G6WAGNDN.cjs.map} +1 -1
  67. package/dist/{impl-FS3K2DMH.cjs → impl-GIPZ5EW5.cjs} +2 -2
  68. package/dist/{impl-FS3K2DMH.cjs.map → impl-GIPZ5EW5.cjs.map} +1 -1
  69. package/dist/{impl-JX55JUEK.cjs → impl-HCY5MWEP.cjs} +2 -2
  70. package/dist/{impl-JX55JUEK.cjs.map → impl-HCY5MWEP.cjs.map} +1 -1
  71. package/dist/{impl-A5WFSC3U.cjs → impl-HEPMD6RG.cjs} +2 -2
  72. package/dist/{impl-A5WFSC3U.cjs.map → impl-HEPMD6RG.cjs.map} +1 -1
  73. package/dist/{impl-PWMPWKRC.cjs → impl-JREQ3SEN.cjs} +2 -2
  74. package/dist/{impl-PWMPWKRC.cjs.map → impl-JREQ3SEN.cjs.map} +1 -1
  75. package/dist/{impl-TYNSXOHT.cjs → impl-K5LDQF7V.cjs} +2 -2
  76. package/dist/{impl-TYNSXOHT.cjs.map → impl-K5LDQF7V.cjs.map} +1 -1
  77. package/dist/{impl-5273O2PM.cjs → impl-KPZSEHQG.cjs} +2 -2
  78. package/dist/{impl-5273O2PM.cjs.map → impl-KPZSEHQG.cjs.map} +1 -1
  79. package/dist/{impl-YE7X5MSV.cjs → impl-LGUMGRRA.cjs} +2 -2
  80. package/dist/{impl-YE7X5MSV.cjs.map → impl-LGUMGRRA.cjs.map} +1 -1
  81. package/dist/{impl-GWQDOEQM.cjs → impl-LI3SHHAQ.cjs} +2 -2
  82. package/dist/{impl-GWQDOEQM.cjs.map → impl-LI3SHHAQ.cjs.map} +1 -1
  83. package/dist/{impl-MYKXOHZB.cjs → impl-MH7OR57S.cjs} +2 -2
  84. package/dist/{impl-MYKXOHZB.cjs.map → impl-MH7OR57S.cjs.map} +1 -1
  85. package/dist/{impl-H7PE22UA.cjs → impl-OIXVXSLU.cjs} +2 -2
  86. package/dist/{impl-H7PE22UA.cjs.map → impl-OIXVXSLU.cjs.map} +1 -1
  87. package/dist/{impl-H2HELZXJ.cjs → impl-OXOU2A27.cjs} +2 -2
  88. package/dist/{impl-H2HELZXJ.cjs.map → impl-OXOU2A27.cjs.map} +1 -1
  89. package/dist/impl-PZ3JDEQN.cjs +2 -0
  90. package/dist/{impl-CVF67V6C.cjs.map → impl-PZ3JDEQN.cjs.map} +1 -1
  91. package/dist/{impl-55HR73CO.cjs → impl-QSTK5NYY.cjs} +3 -3
  92. package/dist/{impl-55HR73CO.cjs.map → impl-QSTK5NYY.cjs.map} +1 -1
  93. package/dist/{impl-ODHDBZ66.cjs → impl-QZHQCQ3B.cjs} +2 -2
  94. package/dist/{impl-ODHDBZ66.cjs.map → impl-QZHQCQ3B.cjs.map} +1 -1
  95. package/dist/{impl-NSQG5ZE2.cjs → impl-SYXFCDZC.cjs} +4 -4
  96. package/dist/{impl-NSQG5ZE2.cjs.map → impl-SYXFCDZC.cjs.map} +1 -1
  97. package/dist/{impl-BTCB55I2.cjs → impl-TCN6BRVK.cjs} +2 -2
  98. package/dist/{impl-BTCB55I2.cjs.map → impl-TCN6BRVK.cjs.map} +1 -1
  99. package/dist/{impl-KGR5OOIL.cjs → impl-TFAARXUG.cjs} +2 -2
  100. package/dist/{impl-KGR5OOIL.cjs.map → impl-TFAARXUG.cjs.map} +1 -1
  101. package/dist/{impl-M353HLO7.cjs → impl-VAQF5Y6W.cjs} +2 -2
  102. package/dist/{impl-M353HLO7.cjs.map → impl-VAQF5Y6W.cjs.map} +1 -1
  103. package/dist/{impl-2ZXK4G3X.cjs → impl-VGJPIZZY.cjs} +2 -2
  104. package/dist/{impl-2ZXK4G3X.cjs.map → impl-VGJPIZZY.cjs.map} +1 -1
  105. package/dist/impl-VGOV6N6A.cjs +2 -0
  106. package/dist/impl-VGOV6N6A.cjs.map +1 -0
  107. package/dist/{impl-CACU53DW.cjs → impl-X6Z7MKVJ.cjs} +2 -2
  108. package/dist/{impl-CACU53DW.cjs.map → impl-X6Z7MKVJ.cjs.map} +1 -1
  109. package/dist/{impl-YQ6LBC3S.cjs → impl-YIYW7STX.cjs} +2 -2
  110. package/dist/{impl-YQ6LBC3S.cjs.map → impl-YIYW7STX.cjs.map} +1 -1
  111. package/dist/{impl-XPH46QYI.cjs → impl-ZGACCLWF.cjs} +2 -2
  112. package/dist/{impl-XPH46QYI.cjs.map → impl-ZGACCLWF.cjs.map} +1 -1
  113. package/dist/{impl-EGBXUZEX.cjs → impl-ZV4VREIU.cjs} +2 -2
  114. package/dist/{impl-EGBXUZEX.cjs.map → impl-ZV4VREIU.cjs.map} +1 -1
  115. package/dist/index.cjs +3 -3
  116. package/dist/index.cjs.map +1 -1
  117. package/dist/index.d.cts +43 -89
  118. package/package.json +1 -1
  119. package/dist/chunk-4Y2OJ475.cjs +0 -2
  120. package/dist/chunk-4Y2OJ475.cjs.map +0 -1
  121. package/dist/chunk-OKWH7Y2Z.cjs +0 -12
  122. package/dist/chunk-UJPJAASL.cjs.map +0 -1
  123. package/dist/impl-7Q7N7MEL.cjs +0 -12
  124. package/dist/impl-7Q7N7MEL.cjs.map +0 -1
  125. package/dist/impl-CVF67V6C.cjs +0 -2
  126. package/dist/impl-DUFE2SD3.cjs +0 -2
  127. package/dist/impl-DUFE2SD3.cjs.map +0 -1
  128. package/dist/impl-QPOOCXTZ.cjs +0 -2
  129. package/dist/impl-QPOOCXTZ.cjs.map +0 -1
package/README.md CHANGED
@@ -1800,27 +1800,29 @@ transcend consent pull-consent-metrics --auth="$TRANSCEND_API_KEY" --start=2024-
1800
1800
 
1801
1801
  ```txt
1802
1802
  USAGE
1803
- transcend consent pull-consent-preferences (--auth value) (--partition value) [--sombraAuth value] [--file value] [--transcendUrl value] [--timestampBefore value] [--timestampAfter value] [--identifiers value]... [--concurrency value]
1803
+ transcend consent pull-consent-preferences (--auth value) (--partition value) [--sombraAuth value] [--file value] [--transcendUrl value] [--timestampBefore value] [--timestampAfter value] [--updatedBefore value] [--updatedAfter value] [--identifiers value]... [--concurrency value]
1804
1804
  transcend consent pull-consent-preferences --help
1805
1805
 
1806
- This command allows for pull of consent preferences from the Managed Consent Database.
1806
+ Uses POST /v1/preferences/{partition}/query with cursor-based pagination. Supports filtering by identifiers, collection timestamps, and system.updatedAt.
1807
1807
 
1808
1808
  FLAGS
1809
1809
  --auth The Transcend API key. Requires scopes: "View Managed Consent Database Admin API"
1810
- --partition The partition key to download consent preferences to
1810
+ --partition Partition ID to query in the Preference Store
1811
1811
  [--sombraAuth] The Sombra internal key, use for additional authentication when self-hosting Sombra
1812
- [--file] Path to the CSV file to save preferences to [default = ./preferences.csv]
1813
- [--transcendUrl] URL of the Transcend backend. Use https://api.us.transcend.io for US hosting [default = https://api.transcend.io]
1814
- [--timestampBefore] Filter for consents updated this time
1815
- [--timestampAfter] Filter for consents updated after this time
1816
- [--identifiers]... Filter for specific identifiers [separator = ,]
1817
- [--concurrency] The concurrency to use when downloading consents in parallel [default = 100]
1812
+ [--file] Path to CSV output file [default = ./preferences.csv]
1813
+ [--transcendUrl] URL of the Transcend backend. Use https://api.us.transcend.io for US hosting [default = https://api.transcend.io]
1814
+ [--timestampBefore] Filter: preferences collected before this time (timestampBefore)
1815
+ [--timestampAfter] Filter: preferences collected after this time (timestampAfter)
1816
+ [--updatedBefore] Filter: preferences updated before this time (system.updatedAt)
1817
+ [--updatedAfter] Filter: preferences updated after this time (system.updatedAt)
1818
+ [--identifiers]... Filter specific users by identifier(s) as "name:value". If name is omitted, defaults to "email". Multiple values separated by commas. [separator = ,]
1819
+ [--concurrency] Page size / concurrency used when downloading (1–50 per API). Higher = fewer pages. [default = 50]
1818
1820
  -h --help Print help information and exit
1819
1821
  ```
1820
1822
 
1821
1823
  #### Examples
1822
1824
 
1823
- **Fetch all consent preferences from partition key**
1825
+ **Fetch all consent preferences from a partition**
1824
1826
 
1825
1827
  ```sh
1826
1828
  transcend consent pull-consent-preferences \
@@ -1828,7 +1830,7 @@ transcend consent pull-consent-preferences \
1828
1830
  --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726
1829
1831
  ```
1830
1832
 
1831
- **Fetch all consent preferences from partition key and save to ./consent.csv**
1833
+ **Fetch all consent preferences and save to ./consent.csv**
1832
1834
 
1833
1835
  ```sh
1834
1836
  transcend consent pull-consent-preferences \
@@ -1837,7 +1839,7 @@ transcend consent pull-consent-preferences \
1837
1839
  --file=./consent.csv
1838
1840
  ```
1839
1841
 
1840
- **Filter on consent updates before a date**
1842
+ **Filter by consent collection time (timestampBefore)**
1841
1843
 
1842
1844
  ```sh
1843
1845
  transcend consent pull-consent-preferences \
@@ -1846,7 +1848,7 @@ transcend consent pull-consent-preferences \
1846
1848
  --timestampBefore=2024-04-03T00:00:00.000Z
1847
1849
  ```
1848
1850
 
1849
- **Filter on consent updates after a date**
1851
+ **Filter by consent collection time (timestampAfter)**
1850
1852
 
1851
1853
  ```sh
1852
1854
  transcend consent pull-consent-preferences \
@@ -1855,7 +1857,26 @@ transcend consent pull-consent-preferences \
1855
1857
  --timestampAfter=2024-04-03T00:00:00.000Z
1856
1858
  ```
1857
1859
 
1858
- **For self-hosted sombras that use an internal key**
1860
+ **Filter by last update time (system.updatedAt window)**
1861
+
1862
+ ```sh
1863
+ transcend consent pull-consent-preferences \
1864
+ --auth="$TRANSCEND_API_KEY" \
1865
+ --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 \
1866
+ --updatedAfter=2024-08-26T00:00:00.000Z \
1867
+ --updatedBefore=2024-08-27T00:00:00.000Z
1868
+ ```
1869
+
1870
+ **Filter specific users by identifiers (name:value). Default name=email if omitted.**
1871
+
1872
+ ```sh
1873
+ transcend consent pull-consent-preferences \
1874
+ --auth="$TRANSCEND_API_KEY" \
1875
+ --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 \
1876
+ --identifiers=email:no-track@example.com,phone:+11234567890,pls-no-track@example.com
1877
+ ```
1878
+
1879
+ **Self-hosted Sombra: include Sombra internal key header**
1859
1880
 
1860
1881
  ```sh
1861
1882
  transcend consent pull-consent-preferences \
@@ -1864,7 +1885,7 @@ transcend consent pull-consent-preferences \
1864
1885
  --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726
1865
1886
  ```
1866
1887
 
1867
- **Specifying the backend URL, needed for US hosted backend infrastructure**
1888
+ **Use a specific backend base URL (e.g., US-hosted)**
1868
1889
 
1869
1890
  ```sh
1870
1891
  transcend consent pull-consent-preferences \
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- "use strict"; 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 _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunkUJPJAASLcjs = require('../chunk-UJPJAASL.cjs');require('../chunk-CFFB56DK.cjs');require('../chunk-4DYEWT53.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');async function e(){let o=process.argv.slice(3);_optionalChain([process, 'access', _ => _.env, 'access', _2 => _2.COMP_LINE, 'optionalAccess', _3 => _3.endsWith, 'call', _4 => _4(" ")])&&o.push(""),await _core.proposeCompletions.call(void 0, _chunkUJPJAASLcjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process));try{for(let{completion:r}of await _core.proposeCompletions.call(void 0, _chunkUJPJAASLcjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process)))process.stdout.write(`${r}
2
+ "use strict"; 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 _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunkMPMKY5NFcjs = require('../chunk-MPMKY5NF.cjs');require('../chunk-RGBVP433.cjs');require('../chunk-NI434OII.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');async function e(){let o=process.argv.slice(3);_optionalChain([process, 'access', _ => _.env, 'access', _2 => _2.COMP_LINE, 'optionalAccess', _3 => _3.endsWith, 'call', _4 => _4(" ")])&&o.push(""),await _core.proposeCompletions.call(void 0, _chunkMPMKY5NFcjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process));try{for(let{completion:r}of await _core.proposeCompletions.call(void 0, _chunkMPMKY5NFcjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process)))process.stdout.write(`${r}
3
3
  `)}catch (e2){}}e();
4
4
  //# sourceMappingURL=bash-complete.cjs.map
package/dist/bin/cli.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunkUJPJAASLcjs = require('../chunk-UJPJAASL.cjs');require('../chunk-CFFB56DK.cjs');require('../chunk-4DYEWT53.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');async function n(){await _core.run.call(void 0, _chunkUJPJAASLcjs.a,process.argv.slice(2),_chunkT462ONFXcjs.a.call(void 0, process))}n();
2
+ "use strict";var _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunkMPMKY5NFcjs = require('../chunk-MPMKY5NF.cjs');require('../chunk-RGBVP433.cjs');require('../chunk-NI434OII.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');async function n(){await _core.run.call(void 0, _chunkMPMKY5NFcjs.a,process.argv.slice(2),_chunkT462ONFXcjs.a.call(void 0, process))}n();
3
3
  //# sourceMappingURL=cli.cjs.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- "use strict"; 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 _chunkUJPJAASLcjs = require('../chunk-UJPJAASL.cjs');require('../chunk-CFFB56DK.cjs');var _chunkZUNVPK23cjs = require('../chunk-ZUNVPK23.cjs');require('../chunk-4DYEWT53.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');var o={"tr-build-xdi-sync-endpoint":["consent","build-xdi-sync-endpoint"],"tr-consent-manager-service-json-to-yml":["inventory","consent-manager-service-json-to-yml"],"tr-consent-managers-to-business-entities":["inventory","consent-managers-to-business-entities"],"tr-cron-mark-identifiers-completed":["request","cron","mark-identifiers-completed"],"tr-cron-pull-identifiers":["request","cron","pull-identifiers"],"tr-derive-data-silos-from-data-flows":["inventory","derive-data-silos-from-data-flows"],"tr-derive-data-silos-from-data-flows-cross-instance":["inventory","derive-data-silos-from-data-flows-cross-instance"],"tr-discover-silos":["inventory","discover-silos"],"tr-generate-api-keys":["admin","generate-api-keys"],"tr-manual-enrichment-pull-identifiers":["request","preflight","pull-identifiers"],"tr-manual-enrichment-push-identifiers":["request","preflight","push-identifiers"],"tr-mark-request-data-silos-completed":["request","system","mark-request-data-silos-completed"],"tr-pull":["inventory","pull"],"tr-pull-consent-metrics":["consent","pull-consent-metrics"],"tr-pull-consent-preferences":["consent","pull-consent-preferences"],"tr-pull-datapoints":["inventory","pull-datapoints"],"tr-pull-pull-unstructured-discovery-files":["inventory","pull-unstructured-discovery-files"],"tr-push":["inventory","push"],"tr-request-approve":["request","approve"],"tr-request-cancel":["request","cancel"],"tr-request-download-files":["request","download-files"],"tr-request-enricher-restart":["request","enricher-restart"],"tr-request-export":["request","export"],"tr-request-mark-silent":["request","mark-silent"],"tr-request-notify-additional-time":["request","notify-additional-time"],"tr-request-reject-unverified-identifiers":["request","reject-unverified-identifiers"],"tr-request-restart":["request","restart"],"tr-request-upload":["request","upload"],"tr-retry-request-data-silos":["request","system","retry-request-data-silos"],"tr-scan-packages":["inventory","scan-packages"],"tr-skip-preflight-jobs":["request","skip-preflight-jobs"],"tr-skip-request-data-silos":["request","system","skip-request-data-silos"],"tr-sync-ot":["migration","sync-ot"],"tr-update-consent-manager":["consent","update-consent-manager"],"tr-upload-consent-preferences":["consent","upload-consent-preferences"],"tr-upload-cookies-from-csv":["consent","upload-cookies-from-csv"],"tr-upload-data-flows-from-csv":["consent","upload-data-flows-from-csv"],"tr-upload-preferences":["consent","upload-preferences"]};function p(t){return _optionalChain([_core.generateHelpTextForAllCommands.call(void 0, _chunkUJPJAASLcjs.a), 'access', _ => _.find, 'call', _2 => _2(s=>s[0]===`${_chunkUJPJAASLcjs.a.config.name} ${t.join(" ")}`), 'optionalAccess', _3 => _3[1]])}function i(t){_chunkZUNVPK23cjs.a.log("[DEPRECATION NOTICE]");let e=o[t];if(!e){let a=Object.entries(o).map(([l,d])=>`\`${l}\` -> \`${_chunkUJPJAASLcjs.a.config.name} ${d.join(" ")}\``).join(`
2
+ "use strict"; 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 _chunkMPMKY5NFcjs = require('../chunk-MPMKY5NF.cjs');require('../chunk-RGBVP433.cjs');var _chunkZUNVPK23cjs = require('../chunk-ZUNVPK23.cjs');require('../chunk-NI434OII.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');var o={"tr-build-xdi-sync-endpoint":["consent","build-xdi-sync-endpoint"],"tr-consent-manager-service-json-to-yml":["inventory","consent-manager-service-json-to-yml"],"tr-consent-managers-to-business-entities":["inventory","consent-managers-to-business-entities"],"tr-cron-mark-identifiers-completed":["request","cron","mark-identifiers-completed"],"tr-cron-pull-identifiers":["request","cron","pull-identifiers"],"tr-derive-data-silos-from-data-flows":["inventory","derive-data-silos-from-data-flows"],"tr-derive-data-silos-from-data-flows-cross-instance":["inventory","derive-data-silos-from-data-flows-cross-instance"],"tr-discover-silos":["inventory","discover-silos"],"tr-generate-api-keys":["admin","generate-api-keys"],"tr-manual-enrichment-pull-identifiers":["request","preflight","pull-identifiers"],"tr-manual-enrichment-push-identifiers":["request","preflight","push-identifiers"],"tr-mark-request-data-silos-completed":["request","system","mark-request-data-silos-completed"],"tr-pull":["inventory","pull"],"tr-pull-consent-metrics":["consent","pull-consent-metrics"],"tr-pull-consent-preferences":["consent","pull-consent-preferences"],"tr-pull-datapoints":["inventory","pull-datapoints"],"tr-pull-pull-unstructured-discovery-files":["inventory","pull-unstructured-discovery-files"],"tr-push":["inventory","push"],"tr-request-approve":["request","approve"],"tr-request-cancel":["request","cancel"],"tr-request-download-files":["request","download-files"],"tr-request-enricher-restart":["request","enricher-restart"],"tr-request-export":["request","export"],"tr-request-mark-silent":["request","mark-silent"],"tr-request-notify-additional-time":["request","notify-additional-time"],"tr-request-reject-unverified-identifiers":["request","reject-unverified-identifiers"],"tr-request-restart":["request","restart"],"tr-request-upload":["request","upload"],"tr-retry-request-data-silos":["request","system","retry-request-data-silos"],"tr-scan-packages":["inventory","scan-packages"],"tr-skip-preflight-jobs":["request","skip-preflight-jobs"],"tr-skip-request-data-silos":["request","system","skip-request-data-silos"],"tr-sync-ot":["migration","sync-ot"],"tr-update-consent-manager":["consent","update-consent-manager"],"tr-upload-consent-preferences":["consent","upload-consent-preferences"],"tr-upload-cookies-from-csv":["consent","upload-cookies-from-csv"],"tr-upload-data-flows-from-csv":["consent","upload-data-flows-from-csv"],"tr-upload-preferences":["consent","upload-preferences"]};function p(t){return _optionalChain([_core.generateHelpTextForAllCommands.call(void 0, _chunkMPMKY5NFcjs.a), 'access', _ => _.find, 'call', _2 => _2(s=>s[0]===`${_chunkMPMKY5NFcjs.a.config.name} ${t.join(" ")}`), 'optionalAccess', _3 => _3[1]])}function i(t){_chunkZUNVPK23cjs.a.log("[DEPRECATION NOTICE]");let e=o[t];if(!e){let a=Object.entries(o).map(([l,d])=>`\`${l}\` -> \`${_chunkMPMKY5NFcjs.a.config.name} ${d.join(" ")}\``).join(`
3
3
  `);_chunkZUNVPK23cjs.a.log(`This command is deprecated as of v7.0.0. Here is a list of new commands, mapped to their legacy command names:
4
4
  ${a}`);return}_chunkZUNVPK23cjs.a.log(`\`${t}\` is deprecated as of v7.0.0.
5
- Use \`${_chunkUJPJAASLcjs.a.config.name} ${e.join(" ")}\` instead.
5
+ Use \`${_chunkMPMKY5NFcjs.a.config.name} ${e.join(" ")}\` instead.
6
6
  `);let s=p(e);if(!s)throw new Error(`Failed to get help text for command: \`${e.join(" ")}\``);_chunkZUNVPK23cjs.a.log(s)}function m(){let e=_optionalChain([process, 'access', _4 => _4.argv, 'access', _5 => _5.at, 'call', _6 => _6(-1), 'optionalAccess', _7 => _7.split, 'call', _8 => _8("/"), 'access', _9 => _9.pop, 'call', _10 => _10(), 'optionalAccess', _11 => _11.trim, 'call', _12 => _12()]);if(e)i(e);else throw new Error("Deprecated command");process.exit(1)}m();
7
7
  //# sourceMappingURL=deprecated-command.cjs.map
@@ -1,4 +1,4 @@
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 _chunk7IN5X2S4cjs = require('./chunk-7IN5X2S4.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _fs = require('fs');var _typeutils = require('@transcend-io/type-utils');var _privacytypes = require('@transcend-io/privacy-types');var K=/target ('|")(.*?)('|")/,L=/pod ('|")(.*?)('|")(, ('|")~> (.+?)('|")|)/,y={supportedFiles:["Podfile"],ignoreDirs:["Pods"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(K,"g"),matches:["quote1","name","quote2"]},e),m=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(L,"g"),matches:["quote1","name","quote2","extra","quote3","version","quote4"]},e);return r.map((s,a)=>({name:s.name,type:_privacytypes.CodePackageType.CocoaPods,softwareDevelopmentKits:m.filter(i=>i.matchIndex>s.matchIndex&&(!r[a+1]||i.matchIndex<r[a+1].matchIndex)).map(i=>({name:i.name,version:i.version}))}))}};var _path = require('path');var X=/implementation( *)('|")(.+?):(.+?):(.+?|)('|")/,j=/apply plugin: *('|")(.+?)(:(.+?)|)('|")/,J=/implementation group:( *)('|")(.+?)('|"),( *)name:( *)('|")(.+?)('|"),( *)version:( *)('|")(.+?)('|")/,U=/applicationId( *)"(.+?)"/,_={supportedFiles:["build.gradle**"],ignoreDirs:["gradle-app.setting","gradle-wrapper.jar","gradle-wrapper.properties"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),m=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(X,"g"),matches:["space","quote1","name","path","version","quote2"]},e),c=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(j,"g"),matches:["quote1","name","group","version","quote2"]},e),s=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(J,"g"),matches:["space1","quote1","group","quote2","space2","space3","quote3","name","quote4","space4","space5","quote5","version","quote6"]},e),a=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(U,"g"),matches:["space","name"]},e);if(a.length>1)throw new Error(`Expected only one applicationId per file: ${t}`);return[{name:_optionalChain([a, 'access', _2 => _2[0], 'optionalAccess', _3 => _3.name])||r.split("/").pop(),softwareDevelopmentKits:[...m,...s,...c].map(i=>({name:i.name,version:i.version||void 0}))}]}};var I={supportedFiles:["package.json"],ignoreDirs:["node_modules","serverless-build","lambda-build"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),m=JSON.parse(e),{name:c,description:s,dependencies:a={},devDependencies:i={},optionalDependencies:n={}}=m;return[{name:c||r.split("/").pop(),description:s,softwareDevelopmentKits:[...Object.entries(a).map(([o,p])=>({name:o,version:typeof p=="string"?p:void 0})),...Object.entries(i).map(([o,p])=>({name:o,version:typeof p=="string"?p:void 0,isDevDependency:!0})),...Object.entries(n).map(([o,p])=>({name:o,version:typeof p=="string"?p:void 0}))]}]}};var z=/(.+?)(=+)(.+)/,Z=/name *= *('|")(.+?)('|")/,ee=/description *= *('|")(.+?)('|")/,x={supportedFiles:["requirements.txt"],ignoreDirs:["build","lib","lib64"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),c=_chunk7IN5X2S4cjs.c.call(void 0, r).find(o=>o==="setup.py"),s=c?_fs.readFileSync.call(void 0, _path.join.call(void 0, r,c),"utf-8"):void 0,a=s?(Z.exec(s)||[])[2]:void 0,i=s?(ee.exec(s)||[])[2]:void 0,n=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(z,"g"),matches:["name","equals","version"]},e);return[{name:a||r.split("/").pop(),description:i||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:n.map(o=>({name:o.name,version:o.version}))}]}};var re=/gem *('|")(.+?)('|")(, *('|")(.+?)('|")|)/,se=/spec\.name *= *('|")(.+?)('|")/,ie=/spec\.description *= *('|")(.+?)('|")/,pe=/spec\.summary *= *('|")(.+?)('|")/,D={supportedFiles:["Gemfile"],ignoreDirs:["bin"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),c=_chunk7IN5X2S4cjs.c.call(void 0, r).find(o=>o===".gemspec"),s=c?_fs.readFileSync.call(void 0, c,"utf-8"):void 0,a=s?(se.exec(s)||[])[2]:void 0,i=s?(ie.exec(s)||pe.exec(s)||[])[1]:void 0,n=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(re,"g"),matches:["quote1","name","quote2","hasVersion","quote3","version","quote4"]},e);return[{name:a||r.split("/").pop(),description:i||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:n.map(o=>({name:o.name,version:o.version}))}]}};var _jsyaml = require('js-yaml'); var _jsyaml2 = _interopRequireDefault(_jsyaml);function ge(t){return t.split(`
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 _chunkMOWFESXNcjs = require('./chunk-MOWFESXN.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _fs = require('fs');var _typeutils = require('@transcend-io/type-utils');var _privacytypes = require('@transcend-io/privacy-types');var K=/target ('|")(.*?)('|")/,L=/pod ('|")(.*?)('|")(, ('|")~> (.+?)('|")|)/,y={supportedFiles:["Podfile"],ignoreDirs:["Pods"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(K,"g"),matches:["quote1","name","quote2"]},e),m=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(L,"g"),matches:["quote1","name","quote2","extra","quote3","version","quote4"]},e);return r.map((s,a)=>({name:s.name,type:_privacytypes.CodePackageType.CocoaPods,softwareDevelopmentKits:m.filter(i=>i.matchIndex>s.matchIndex&&(!r[a+1]||i.matchIndex<r[a+1].matchIndex)).map(i=>({name:i.name,version:i.version}))}))}};var _path = require('path');var X=/implementation( *)('|")(.+?):(.+?):(.+?|)('|")/,j=/apply plugin: *('|")(.+?)(:(.+?)|)('|")/,J=/implementation group:( *)('|")(.+?)('|"),( *)name:( *)('|")(.+?)('|"),( *)version:( *)('|")(.+?)('|")/,U=/applicationId( *)"(.+?)"/,_={supportedFiles:["build.gradle**"],ignoreDirs:["gradle-app.setting","gradle-wrapper.jar","gradle-wrapper.properties"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),m=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(X,"g"),matches:["space","quote1","name","path","version","quote2"]},e),c=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(j,"g"),matches:["quote1","name","group","version","quote2"]},e),s=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(J,"g"),matches:["space1","quote1","group","quote2","space2","space3","quote3","name","quote4","space4","space5","quote5","version","quote6"]},e),a=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(U,"g"),matches:["space","name"]},e);if(a.length>1)throw new Error(`Expected only one applicationId per file: ${t}`);return[{name:_optionalChain([a, 'access', _2 => _2[0], 'optionalAccess', _3 => _3.name])||r.split("/").pop(),softwareDevelopmentKits:[...m,...s,...c].map(i=>({name:i.name,version:i.version||void 0}))}]}};var I={supportedFiles:["package.json"],ignoreDirs:["node_modules","serverless-build","lambda-build"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),m=JSON.parse(e),{name:c,description:s,dependencies:a={},devDependencies:i={},optionalDependencies:n={}}=m;return[{name:c||r.split("/").pop(),description:s,softwareDevelopmentKits:[...Object.entries(a).map(([o,p])=>({name:o,version:typeof p=="string"?p:void 0})),...Object.entries(i).map(([o,p])=>({name:o,version:typeof p=="string"?p:void 0,isDevDependency:!0})),...Object.entries(n).map(([o,p])=>({name:o,version:typeof p=="string"?p:void 0}))]}]}};var z=/(.+?)(=+)(.+)/,Z=/name *= *('|")(.+?)('|")/,ee=/description *= *('|")(.+?)('|")/,x={supportedFiles:["requirements.txt"],ignoreDirs:["build","lib","lib64"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),c=_chunkMOWFESXNcjs.c.call(void 0, r).find(o=>o==="setup.py"),s=c?_fs.readFileSync.call(void 0, _path.join.call(void 0, r,c),"utf-8"):void 0,a=s?(Z.exec(s)||[])[2]:void 0,i=s?(ee.exec(s)||[])[2]:void 0,n=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(z,"g"),matches:["name","equals","version"]},e);return[{name:a||r.split("/").pop(),description:i||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:n.map(o=>({name:o.name,version:o.version}))}]}};var re=/gem *('|")(.+?)('|")(, *('|")(.+?)('|")|)/,se=/spec\.name *= *('|")(.+?)('|")/,ie=/spec\.description *= *('|")(.+?)('|")/,pe=/spec\.summary *= *('|")(.+?)('|")/,D={supportedFiles:["Gemfile"],ignoreDirs:["bin"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),c=_chunkMOWFESXNcjs.c.call(void 0, r).find(o=>o===".gemspec"),s=c?_fs.readFileSync.call(void 0, c,"utf-8"):void 0,a=s?(se.exec(s)||[])[2]:void 0,i=s?(ie.exec(s)||pe.exec(s)||[])[1]:void 0,n=_typeutils.findAllWithRegex.call(void 0, {value:new RegExp(re,"g"),matches:["quote1","name","quote2","hasVersion","quote3","version","quote4"]},e);return[{name:a||r.split("/").pop(),description:i||void 0,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:n.map(o=>({name:o.name,version:o.version}))}]}};var _jsyaml = require('js-yaml'); var _jsyaml2 = _interopRequireDefault(_jsyaml);function ge(t){return t.split(`
2
2
  `).map(e=>{let r=e.indexOf("#");return r>-1&&!e.substring(0,r).includes('"')&&!e.substring(0,r).includes("'")?e.substring(0,r).trim():e}).filter(e=>e.length>0).join(`
3
3
  `)}var P={supportedFiles:["pubspec.yml"],ignoreDirs:["build"],scanFunction:t=>{let e=_path.dirname.call(void 0, t),r=_fs.readFileSync.call(void 0, t,"utf-8"),{name:m,description:c,dev_dependencies:s={},dependencies:a={}}=_jsyaml2.default.load(ge(r));return[{name:m||e.split("/").pop(),description:c,type:_privacytypes.CodePackageType.RequirementsTxt,softwareDevelopmentKits:[...Object.entries(a).map(([i,n])=>({name:i,version:typeof n=="string"?n:typeof n=="number"?n.toString():_optionalChain([n, 'optionalAccess', _4 => _4.sdk])})),...Object.entries(s).map(([i,n])=>({name:i,version:typeof n=="string"?n:typeof n=="number"?n.toString():_optionalChain([n, 'optionalAccess', _5 => _5.sdk]),isDevDependency:!0}))]}]}};var F={supportedFiles:["composer.json"],ignoreDirs:["vendor","node_modules","cache","build","dist"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),m=JSON.parse(e),{name:c,description:s,require:a={},"require-dev":i={}}=m;return[{name:c||r.split("/").pop(),description:s,softwareDevelopmentKits:[...Object.entries(a).map(([n,o])=>({name:n,version:typeof o=="string"?o:void 0})),...Object.entries(i).map(([n,o])=>({name:n,version:typeof o=="string"?o:void 0,isDevDependency:!0}))]}]}};var _iots = require('io-ts'); var d = _interopRequireWildcard(_iots);var ye=d.type({pins:d.array(d.type({identity:d.string,kind:d.string,location:d.string,state:d.type({revision:d.string,version:d.string})})),version:d.number}),A={supportedFiles:["Package.resolved"],ignoreDirs:[],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_typeutils.decodeCodec.call(void 0, ye,e);return[{name:_path.dirname.call(void 0, t).split("/").pop()||"",type:_privacytypes.CodePackageType.CocoaPods,softwareDevelopmentKits:r.pins.map(m=>({name:m.identity,version:m.state.version}))}]}};var R="(implementation|api|kapt|ksp|debugImplementation|releaseImplementation|androidTestImplementation|testImplementation|compileOnly|runtimeOnly)",xe=new RegExp(`${R}\\s*\\(\\s*["']([^"':\\s]+):([^"':\\s]+):?([^"']*)["']\\s*\\)`,"g"),De=new RegExp(`${R}\\s*\\(\\s*platform\\(\\s*["']([^"':\\s]+):([^"':\\s]+):?([^"']*)["']\\s*\\)\\s*\\)`,"g"),Pe=new RegExp(`${R}\\s*\\(\\s*libs(?:\\.[\\w\\-\\.]+|\\[["'][^"']+["']\\])\\s*\\)`,"g"),Ae=/id\s*\(\s*["']([^"']+)["']\s*\)(?:\s*version\s*["']([^"']+)["'])?/g,Re=/apply\s*\(\s*plugin\s*=\s*["']([^"']+)["']\s*\)/g,ke=/plugins\s*\{[^}]*alias\s*\(\s*libs(?:\.plugins)?(?:\.[\w\-.]+|\[["'][^"']+["']\])\s*\)[^}]*\}/g,ve=/applicationId\s*=\s*["']([^"']+)["']/g,Ge=/applicationId\s*\(\s*["']([^"']+)["']\s*\)/g;function u(t,e){let r=e&&e.trim().length>0&&e!=="_"?e.trim():void 0;return{name:t,version:r}}var w={supportedFiles:["**/build.gradle.kts","**/*.gradle.kts"],ignoreDirs:["gradle-app.setting","gradle-wrapper.jar","gradle-wrapper.properties"],scanFunction:t=>{let e=_fs.readFileSync.call(void 0, t,"utf-8"),r=_path.dirname.call(void 0, t),m=[..._typeutils.findAllWithRegex.call(void 0, {value:ve,matches:["name"]},e),..._typeutils.findAllWithRegex.call(void 0, {value:Ge,matches:["name"]},e)];if(m.length>1)throw new Error(`Expected only one applicationId per file: ${t}`);let c=_optionalChain([m, 'access', _6 => _6[0], 'optionalAccess', _7 => _7.name])||r.split("/").pop(),s=[];for(let n of e.matchAll(xe)){let[,,o,p,f]=n;s.push(u(`${o}:${p}`,f))}for(let n of e.matchAll(De)){let[,,o,p,f]=n;s.push(u(`${o}:${p}`,f))}for(let n of e.matchAll(Pe)){let o=n[0].replace(/^[^(]+\(\s*/,"").replace(/\)\s*$/,"").trim();s.push(u(o))}let a=[];for(let n of e.matchAll(Ae)){let[,o,p]=n;a.push(u(o,p))}for(let n of e.matchAll(Re)){let[,o]=n;a.push(u(o))}if(ke.test(e)){let n=e.matchAll(/alias\s*\(\s*(libs(?:\.plugins)?(?:\.[\w\-.]+|\[["'][^"']+["']\]))\s*\)/g);for(let o of n)a.push(u(o[1]))}let i=[...s,...a].reduce((n,o)=>{let p=`${o.name}@@${o.version||""}`;return n.map.has(p)||(n.map.set(p,o),n.list.push(o)),n},{map:new Map,list:[]}).list;return[{name:c,softwareDevelopmentKits:i}]}};var hn={cocoaPods:y,gradle:_,javascriptPackageJson:I,pythonRequirementsTxt:x,gemfile:D,pubspec:P,swift:A},T={[_privacytypes.CodePackageType.CocoaPods]:y,[_privacytypes.CodePackageType.Gradle]:_,[_privacytypes.CodePackageType.PackageJson]:I,[_privacytypes.CodePackageType.RequirementsTxt]:x,[_privacytypes.CodePackageType.Gemfile]:D,[_privacytypes.CodePackageType.Pubspec]:P,[_privacytypes.CodePackageType.ComposerJson]:F,[_privacytypes.CodePackageType.Swift]:A,[_privacytypes.CodePackageType.Kotlin]:w};var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function Kn({scanPath:t,ignoreDirs:e=[],repositoryName:r}){return(await Promise.all(_typeutils.getEntries.call(void 0, T).map(async([c,s])=>{let{ignoreDirs:a,supportedFiles:i,scanFunction:n}=s,o=[...e,...a].filter(p=>p.length>0);try{let p=await _fastglob2.default.call(void 0, `${t}/**/${i.join("|")}`,{ignore:o.map(l=>`${t}/**/${l}`),unique:!0,onlyFiles:!0});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Scanning: ${p.length} files of type ${c}`));let f=p.map(l=>n(l).map(N=>({...N,relativePath:l.replace(`${t}/`,"")}))).flat();return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Found: ${f.length} packages and ${f.map(({softwareDevelopmentKits:l=[]})=>l).flat().length} sdks`)),f.map(l=>({...l,type:c,repositoryName:r}))}catch(p){throw new Error(`Error scanning globs ${i} with error: ${p}`)}}))).flat()}exports.a = hn; exports.b = Kn;
4
- //# sourceMappingURL=chunk-IWZ2HIHK.cjs.map
4
+ //# sourceMappingURL=chunk-2Q7ADV5Y.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-IWZ2HIHK.cjs","../src/lib/code-scanning/integrations/cocoaPods.ts","../src/lib/code-scanning/integrations/gradle.ts","../src/lib/code-scanning/integrations/pubspec.ts","../src/lib/code-scanning/integrations/kotlin.ts"],"names":["POD_TARGET_REGEX","POD_PACKAGE_REGEX","cocoaPods","filePath","fileContents","readFileSync","targets","findAllWithRegex","packages","target","ind","CodePackageType","pkg","GRADLE_IMPLEMENTATION_REGEX","GRADLE_PLUGIN_REGEX","GRADLE_IMPLEMENTATION_GROUP_REGEX","GRADLE_APPLICATION_NAME_REGEX","gradle","directory","dirname","targetPlugins","targetGroups","applications"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/chunk-IWZ2HIHK.cjs","sourcesContent":[null,"import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageSdk } from '../../../codecs';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { CodePackageType } from '@transcend-io/privacy-types';\n\nconst POD_TARGET_REGEX = /target ('|\")(.*?)('|\")/;\nconst POD_PACKAGE_REGEX = /pod ('|\")(.*?)('|\")(, ('|\")~> (.+?)('|\")|)/;\n\nexport const cocoaPods: CodeScanningConfig = {\n supportedFiles: ['Podfile'],\n ignoreDirs: ['Pods'],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(POD_TARGET_REGEX, 'g'),\n matches: ['quote1', 'name', 'quote2'],\n },\n fileContents,\n );\n const packages = findAllWithRegex(\n {\n value: new RegExp(POD_PACKAGE_REGEX, 'g'),\n matches: [\n 'quote1',\n 'name',\n 'quote2',\n 'extra',\n 'quote3',\n 'version',\n 'quote4',\n ],\n },\n fileContents,\n );\n\n const deps: CodePackageSdk[] = targets.map((target, ind) => ({\n name: target.name,\n type: CodePackageType.CocoaPods,\n softwareDevelopmentKits: packages\n .filter(\n (pkg) =>\n pkg.matchIndex > target.matchIndex &&\n (!targets[ind + 1] || pkg.matchIndex < targets[ind + 1].matchIndex),\n )\n .map((pkg) => ({\n name: pkg.name,\n version: pkg.version,\n })),\n }));\n\n return deps;\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { dirname } from 'node:path';\n\nconst GRADLE_IMPLEMENTATION_REGEX =\n /implementation( *)('|\")(.+?):(.+?):(.+?|)('|\")/;\nconst GRADLE_PLUGIN_REGEX = /apply plugin: *('|\")(.+?)(:(.+?)|)('|\")/;\nconst GRADLE_IMPLEMENTATION_GROUP_REGEX =\n /implementation group:( *)('|\")(.+?)('|\"),( *)name:( *)('|\")(.+?)('|\"),( *)version:( *)('|\")(.+?)('|\")/;\nconst GRADLE_APPLICATION_NAME_REGEX = /applicationId( *)\"(.+?)\"/;\n\n/**\n * So far, there are three ways of defining dependencies that is supported\n * implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.core', version: '3.28.0'\n * or\n * implementation 'com.google.firebase:firebase-analytics:18.0.0'\n * or\n * apply plugin: 'com.google.gms.google-services'\n *\n * single and double quotes are both recognized\n */\nexport const gradle: CodeScanningConfig = {\n supportedFiles: ['build.gradle**'],\n ignoreDirs: [\n 'gradle-app.setting',\n 'gradle-wrapper.jar',\n 'gradle-wrapper.properties',\n ],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n const directory = dirname(filePath);\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_REGEX, 'g'),\n matches: ['space', 'quote1', 'name', 'path', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetPlugins = findAllWithRegex(\n {\n value: new RegExp(GRADLE_PLUGIN_REGEX, 'g'),\n matches: ['quote1', 'name', 'group', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetGroups = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_GROUP_REGEX, 'g'),\n matches: [\n 'space1',\n 'quote1',\n 'group',\n 'quote2',\n 'space2',\n 'space3',\n 'quote3',\n 'name',\n 'quote4',\n 'space4',\n 'space5',\n 'quote5',\n 'version',\n 'quote6',\n ],\n },\n fileContents,\n );\n const applications = findAllWithRegex(\n {\n value: new RegExp(GRADLE_APPLICATION_NAME_REGEX, 'g'),\n matches: ['space', 'name'],\n },\n fileContents,\n );\n if (applications.length > 1) {\n throw new Error(`Expected only one applicationId per file: ${filePath}`);\n }\n\n return [\n {\n name: applications[0]?.name || directory.split('/').pop()!,\n softwareDevelopmentKits: [\n ...targets,\n ...targetGroups,\n ...targetPlugins,\n ].map((target) => ({\n name: target.name,\n version: target.version || undefined,\n })),\n },\n ];\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport yaml from 'js-yaml';\nimport { dirname } from 'node:path';\n\n/**\n * Remove YAML comments from a string\n *\n * @param yamlString - YAML string\n * @returns String without comments\n */\nfunction removeYAMLComments(yamlString: string): string {\n return yamlString\n .split('\\n')\n .map((line) => {\n // Remove inline comments\n const commentIndex = line.indexOf('#');\n if (commentIndex > -1) {\n // Check if '#' is not inside a string\n if (\n !line.substring(0, commentIndex).includes('\"') &&\n !line.substring(0, commentIndex).includes(\"'\")\n ) {\n return line.substring(0, commentIndex).trim();\n }\n }\n return line;\n })\n .filter((line) => line.length > 0)\n .join('\\n');\n}\n\nexport const pubspec: CodeScanningConfig = {\n supportedFiles: ['pubspec.yml'],\n ignoreDirs: ['build'],\n scanFunction: (filePath) => {\n const directory = dirname(filePath);\n const fileContents = readFileSync(filePath, 'utf-8');\n const {\n name,\n description,\n dev_dependencies = {},\n dependencies = {},\n } = yaml.load(removeYAMLComments(fileContents)) as {\n /** Name */\n name?: string;\n /** Description */\n description?: string;\n /** Dev dependencies */\n dev_dependencies?: { [k in string]: number | Record<string, string> };\n /** Dependencies */\n dependencies?: { [k in string]: number | Record<string, string> };\n };\n return [\n {\n name: name || directory.split('/').pop()!,\n description,\n type: CodePackageType.RequirementsTxt,\n softwareDevelopmentKits: [\n ...Object.entries(dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n })),\n ...Object.entries(dev_dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n isDevDependency: true,\n })),\n ],\n },\n ];\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport { CodeScanningConfig } from '../types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\n\n/**\n * Kotlin DSL (build.gradle.kts) dependency & plugin parsing\n */\n\nconst KTS_DEP_CONFIGS =\n // eslint-disable-next-line max-len\n '(implementation|api|kapt|ksp|debugImplementation|releaseImplementation|androidTestImplementation|testImplementation|compileOnly|runtimeOnly)';\n\n// e.g. implementation(\"com.google.firebase:firebase-analytics:18.0.0\")\nconst KTS_DEP_STRING_COORDS_REGEX = new RegExp(\n `${KTS_DEP_CONFIGS}\\\\s*\\\\(\\\\s*[\"']([^\"':\\\\s]+):([^\"':\\\\s]+):?([^\"']*)[\"']\\\\s*\\\\)`,\n 'g',\n);\n// captures: [1]=config, [2]=group, [3]=artifact, [4]=version (may be '')\n\n// e.g. implementation(platform(\"com.google.firebase:firebase-bom:33.1.2\"))\nconst KTS_DEP_PLATFORM_REGEX = new RegExp(\n `${KTS_DEP_CONFIGS}\\\\s*\\\\(\\\\s*platform\\\\(\\\\s*[\"']([^\"':\\\\s]+):([^\"':\\\\s]+):?([^\"']*)[\"']\\\\s*\\\\)\\\\s*\\\\)`,\n 'g',\n);\n\n// e.g. implementation(libs.androidx.appcompat) / implementation(libs[\"androidx-core-ktx\"])\nconst KTS_DEP_LIBS_ALIAS_REGEX = new RegExp(\n `${KTS_DEP_CONFIGS}\\\\s*\\\\(\\\\s*libs(?:\\\\.[\\\\w\\\\-\\\\.]+|\\\\[[\"'][^\"']+[\"']\\\\])\\\\s*\\\\)`,\n 'g',\n);\n\n// Plugins:\n// plugins { id(\"com.google.gms.google-services\") version \"4.4.2\" apply false }\n// plugins { id(\"org.jetbrains.kotlin.android\") }\n// apply(plugin = \"newrelic\")\n// plugins { alias(libs.plugins.kotlin.android) }\nconst KTS_PLUGIN_ID_REGEX =\n /id\\s*\\(\\s*[\"']([^\"']+)[\"']\\s*\\)(?:\\s*version\\s*[\"']([^\"']+)[\"'])?/g;\nconst KTS_PLUGIN_APPLY_REGEX =\n /apply\\s*\\(\\s*plugin\\s*=\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\nconst KTS_PLUGIN_ALIAS_REGEX =\n /plugins\\s*\\{[^}]*alias\\s*\\(\\s*libs(?:\\.plugins)?(?:\\.[\\w\\-.]+|\\[[\"'][^\"']+[\"']\\])\\s*\\)[^}]*\\}/g;\n\n// applicationId in Kotlin DSL:\n// applicationId = \"com.foo.bar\"\n// applicationId(\"com.foo.bar\")\nconst KTS_APPLICATION_ID_EQ_REGEX = /applicationId\\s*=\\s*[\"']([^\"']+)[\"']/g;\nconst KTS_APPLICATION_ID_CALL_REGEX =\n /applicationId\\s*\\(\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\n\n/**\n * Input dep entry (partial)\n */\ntype DepInput = {\n /** Name of the dependency */\n name: string;\n /** Version of the dependency */\n version?: string;\n};\n\n/**\n * Helper to normalize a parsed dep entry\n *\n * @param name - name\n * @param version - version\n * @returns normalized entry\n */\nfunction depEntry(name: string, version?: string): DepInput {\n const v =\n version && version.trim().length > 0 && version !== '_'\n ? version.trim()\n : undefined;\n return { name, version: v };\n}\n\nexport const kotlin: CodeScanningConfig = {\n supportedFiles: ['**/build.gradle.kts', '**/*.gradle.kts'],\n ignoreDirs: [\n 'gradle-app.setting',\n 'gradle-wrapper.jar',\n 'gradle-wrapper.properties',\n ],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n const directory = dirname(filePath);\n\n // ---------- applicationId ----------\n const appIds = [\n ...findAllWithRegex(\n { value: KTS_APPLICATION_ID_EQ_REGEX, matches: ['name'] },\n fileContents,\n ),\n ...findAllWithRegex(\n { value: KTS_APPLICATION_ID_CALL_REGEX, matches: ['name'] },\n fileContents,\n ),\n ];\n if (appIds.length > 1) {\n throw new Error(`Expected only one applicationId per file: ${filePath}`);\n }\n const appName = appIds[0]?.name || directory.split('/').pop()!;\n\n // ---------- dependencies ----------\n const deps: Array<DepInput> = [];\n\n // \"group:artifact:version\"\n for (const m of fileContents.matchAll(KTS_DEP_STRING_COORDS_REGEX)) {\n const [, , group, artifact, version] = m;\n deps.push(depEntry(`${group}:${artifact}`, version));\n }\n\n // platform(\"group:artifact:version\")\n for (const m of fileContents.matchAll(KTS_DEP_PLATFORM_REGEX)) {\n const [, , group, artifact, version] = m;\n // Record as regular coord (you may prefer to tag as BoM separately)\n deps.push(depEntry(`${group}:${artifact}`, version));\n }\n\n // libs aliases (version catalogs) — keep alias as name, unknown version\n for (const m of fileContents.matchAll(KTS_DEP_LIBS_ALIAS_REGEX)) {\n // Grab the exact token as name (best-effort)\n const token = m[0]\n .replace(/^[^(]+\\(\\s*/, '')\n .replace(/\\)\\s*$/, '')\n .trim(); // e.g., libs.androidx.appcompat or libs[\"androidx-core-ktx\"]\n deps.push(depEntry(token));\n }\n\n // ---------- plugins ----------\n const plugins: Array<DepInput> = [];\n\n for (const m of fileContents.matchAll(KTS_PLUGIN_ID_REGEX)) {\n const [, pid, pver] = m;\n plugins.push(depEntry(pid, pver));\n }\n\n for (const m of fileContents.matchAll(KTS_PLUGIN_APPLY_REGEX)) {\n const [, pid] = m;\n plugins.push(depEntry(pid));\n }\n\n // alias(libs.plugins...) — keep alias token (no version)\n if (KTS_PLUGIN_ALIAS_REGEX.test(fileContents)) {\n // Collect all alias lines to preserve identifiers; light parse:\n const aliasMatches = fileContents.matchAll(\n /alias\\s*\\(\\s*(libs(?:\\.plugins)?(?:\\.[\\w\\-.]+|\\[[\"'][^\"']+[\"']\\]))\\s*\\)/g,\n );\n for (const m of aliasMatches) {\n plugins.push(depEntry(m[1]));\n }\n }\n\n // ---------- compose final list ----------\n // Merge deps + plugins as \"softwareDevelopmentKits\"\n const softwareDevelopmentKits = [...deps, ...plugins]\n // de-dup by name+version\n .reduce(\n (acc, cur) => {\n const key = `${cur.name}@@${cur.version || ''}`;\n if (!acc.map.has(key)) {\n acc.map.set(key, cur);\n acc.list.push(cur);\n }\n return acc;\n },\n {\n map: new Map<string, DepInput>(),\n list: [] as Array<DepInput>,\n },\n ).list;\n\n return [\n {\n name: appName,\n softwareDevelopmentKits,\n },\n ];\n },\n};\n"]}
1
+ {"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-2Q7ADV5Y.cjs","../src/lib/code-scanning/integrations/cocoaPods.ts","../src/lib/code-scanning/integrations/gradle.ts","../src/lib/code-scanning/integrations/pubspec.ts","../src/lib/code-scanning/integrations/kotlin.ts"],"names":["POD_TARGET_REGEX","POD_PACKAGE_REGEX","cocoaPods","filePath","fileContents","readFileSync","targets","findAllWithRegex","packages","target","ind","CodePackageType","pkg","GRADLE_IMPLEMENTATION_REGEX","GRADLE_PLUGIN_REGEX","GRADLE_IMPLEMENTATION_GROUP_REGEX","GRADLE_APPLICATION_NAME_REGEX","gradle","directory","dirname","targetPlugins","targetGroups","applications"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/chunk-2Q7ADV5Y.cjs","sourcesContent":[null,"import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageSdk } from '../../../codecs';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { CodePackageType } from '@transcend-io/privacy-types';\n\nconst POD_TARGET_REGEX = /target ('|\")(.*?)('|\")/;\nconst POD_PACKAGE_REGEX = /pod ('|\")(.*?)('|\")(, ('|\")~> (.+?)('|\")|)/;\n\nexport const cocoaPods: CodeScanningConfig = {\n supportedFiles: ['Podfile'],\n ignoreDirs: ['Pods'],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(POD_TARGET_REGEX, 'g'),\n matches: ['quote1', 'name', 'quote2'],\n },\n fileContents,\n );\n const packages = findAllWithRegex(\n {\n value: new RegExp(POD_PACKAGE_REGEX, 'g'),\n matches: [\n 'quote1',\n 'name',\n 'quote2',\n 'extra',\n 'quote3',\n 'version',\n 'quote4',\n ],\n },\n fileContents,\n );\n\n const deps: CodePackageSdk[] = targets.map((target, ind) => ({\n name: target.name,\n type: CodePackageType.CocoaPods,\n softwareDevelopmentKits: packages\n .filter(\n (pkg) =>\n pkg.matchIndex > target.matchIndex &&\n (!targets[ind + 1] || pkg.matchIndex < targets[ind + 1].matchIndex),\n )\n .map((pkg) => ({\n name: pkg.name,\n version: pkg.version,\n })),\n }));\n\n return deps;\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\nimport { dirname } from 'node:path';\n\nconst GRADLE_IMPLEMENTATION_REGEX =\n /implementation( *)('|\")(.+?):(.+?):(.+?|)('|\")/;\nconst GRADLE_PLUGIN_REGEX = /apply plugin: *('|\")(.+?)(:(.+?)|)('|\")/;\nconst GRADLE_IMPLEMENTATION_GROUP_REGEX =\n /implementation group:( *)('|\")(.+?)('|\"),( *)name:( *)('|\")(.+?)('|\"),( *)version:( *)('|\")(.+?)('|\")/;\nconst GRADLE_APPLICATION_NAME_REGEX = /applicationId( *)\"(.+?)\"/;\n\n/**\n * So far, there are three ways of defining dependencies that is supported\n * implementation group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.core', version: '3.28.0'\n * or\n * implementation 'com.google.firebase:firebase-analytics:18.0.0'\n * or\n * apply plugin: 'com.google.gms.google-services'\n *\n * single and double quotes are both recognized\n */\nexport const gradle: CodeScanningConfig = {\n supportedFiles: ['build.gradle**'],\n ignoreDirs: [\n 'gradle-app.setting',\n 'gradle-wrapper.jar',\n 'gradle-wrapper.properties',\n ],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n const directory = dirname(filePath);\n\n const targets = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_REGEX, 'g'),\n matches: ['space', 'quote1', 'name', 'path', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetPlugins = findAllWithRegex(\n {\n value: new RegExp(GRADLE_PLUGIN_REGEX, 'g'),\n matches: ['quote1', 'name', 'group', 'version', 'quote2'],\n },\n fileContents,\n );\n const targetGroups = findAllWithRegex(\n {\n value: new RegExp(GRADLE_IMPLEMENTATION_GROUP_REGEX, 'g'),\n matches: [\n 'space1',\n 'quote1',\n 'group',\n 'quote2',\n 'space2',\n 'space3',\n 'quote3',\n 'name',\n 'quote4',\n 'space4',\n 'space5',\n 'quote5',\n 'version',\n 'quote6',\n ],\n },\n fileContents,\n );\n const applications = findAllWithRegex(\n {\n value: new RegExp(GRADLE_APPLICATION_NAME_REGEX, 'g'),\n matches: ['space', 'name'],\n },\n fileContents,\n );\n if (applications.length > 1) {\n throw new Error(`Expected only one applicationId per file: ${filePath}`);\n }\n\n return [\n {\n name: applications[0]?.name || directory.split('/').pop()!,\n softwareDevelopmentKits: [\n ...targets,\n ...targetGroups,\n ...targetPlugins,\n ].map((target) => ({\n name: target.name,\n version: target.version || undefined,\n })),\n },\n ];\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { CodeScanningConfig } from '../types';\nimport { CodePackageType } from '@transcend-io/privacy-types';\nimport yaml from 'js-yaml';\nimport { dirname } from 'node:path';\n\n/**\n * Remove YAML comments from a string\n *\n * @param yamlString - YAML string\n * @returns String without comments\n */\nfunction removeYAMLComments(yamlString: string): string {\n return yamlString\n .split('\\n')\n .map((line) => {\n // Remove inline comments\n const commentIndex = line.indexOf('#');\n if (commentIndex > -1) {\n // Check if '#' is not inside a string\n if (\n !line.substring(0, commentIndex).includes('\"') &&\n !line.substring(0, commentIndex).includes(\"'\")\n ) {\n return line.substring(0, commentIndex).trim();\n }\n }\n return line;\n })\n .filter((line) => line.length > 0)\n .join('\\n');\n}\n\nexport const pubspec: CodeScanningConfig = {\n supportedFiles: ['pubspec.yml'],\n ignoreDirs: ['build'],\n scanFunction: (filePath) => {\n const directory = dirname(filePath);\n const fileContents = readFileSync(filePath, 'utf-8');\n const {\n name,\n description,\n dev_dependencies = {},\n dependencies = {},\n } = yaml.load(removeYAMLComments(fileContents)) as {\n /** Name */\n name?: string;\n /** Description */\n description?: string;\n /** Dev dependencies */\n dev_dependencies?: { [k in string]: number | Record<string, string> };\n /** Dependencies */\n dependencies?: { [k in string]: number | Record<string, string> };\n };\n return [\n {\n name: name || directory.split('/').pop()!,\n description,\n type: CodePackageType.RequirementsTxt,\n softwareDevelopmentKits: [\n ...Object.entries(dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n })),\n ...Object.entries(dev_dependencies).map(([name, version]) => ({\n name,\n version:\n typeof version === 'string'\n ? version\n : typeof version === 'number'\n ? version.toString()\n : version?.sdk,\n isDevDependency: true,\n })),\n ],\n },\n ];\n },\n};\n","import { readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport { CodeScanningConfig } from '../types';\nimport { findAllWithRegex } from '@transcend-io/type-utils';\n\n/**\n * Kotlin DSL (build.gradle.kts) dependency & plugin parsing\n */\n\nconst KTS_DEP_CONFIGS =\n // eslint-disable-next-line max-len\n '(implementation|api|kapt|ksp|debugImplementation|releaseImplementation|androidTestImplementation|testImplementation|compileOnly|runtimeOnly)';\n\n// e.g. implementation(\"com.google.firebase:firebase-analytics:18.0.0\")\nconst KTS_DEP_STRING_COORDS_REGEX = new RegExp(\n `${KTS_DEP_CONFIGS}\\\\s*\\\\(\\\\s*[\"']([^\"':\\\\s]+):([^\"':\\\\s]+):?([^\"']*)[\"']\\\\s*\\\\)`,\n 'g',\n);\n// captures: [1]=config, [2]=group, [3]=artifact, [4]=version (may be '')\n\n// e.g. implementation(platform(\"com.google.firebase:firebase-bom:33.1.2\"))\nconst KTS_DEP_PLATFORM_REGEX = new RegExp(\n `${KTS_DEP_CONFIGS}\\\\s*\\\\(\\\\s*platform\\\\(\\\\s*[\"']([^\"':\\\\s]+):([^\"':\\\\s]+):?([^\"']*)[\"']\\\\s*\\\\)\\\\s*\\\\)`,\n 'g',\n);\n\n// e.g. implementation(libs.androidx.appcompat) / implementation(libs[\"androidx-core-ktx\"])\nconst KTS_DEP_LIBS_ALIAS_REGEX = new RegExp(\n `${KTS_DEP_CONFIGS}\\\\s*\\\\(\\\\s*libs(?:\\\\.[\\\\w\\\\-\\\\.]+|\\\\[[\"'][^\"']+[\"']\\\\])\\\\s*\\\\)`,\n 'g',\n);\n\n// Plugins:\n// plugins { id(\"com.google.gms.google-services\") version \"4.4.2\" apply false }\n// plugins { id(\"org.jetbrains.kotlin.android\") }\n// apply(plugin = \"newrelic\")\n// plugins { alias(libs.plugins.kotlin.android) }\nconst KTS_PLUGIN_ID_REGEX =\n /id\\s*\\(\\s*[\"']([^\"']+)[\"']\\s*\\)(?:\\s*version\\s*[\"']([^\"']+)[\"'])?/g;\nconst KTS_PLUGIN_APPLY_REGEX =\n /apply\\s*\\(\\s*plugin\\s*=\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\nconst KTS_PLUGIN_ALIAS_REGEX =\n /plugins\\s*\\{[^}]*alias\\s*\\(\\s*libs(?:\\.plugins)?(?:\\.[\\w\\-.]+|\\[[\"'][^\"']+[\"']\\])\\s*\\)[^}]*\\}/g;\n\n// applicationId in Kotlin DSL:\n// applicationId = \"com.foo.bar\"\n// applicationId(\"com.foo.bar\")\nconst KTS_APPLICATION_ID_EQ_REGEX = /applicationId\\s*=\\s*[\"']([^\"']+)[\"']/g;\nconst KTS_APPLICATION_ID_CALL_REGEX =\n /applicationId\\s*\\(\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\n\n/**\n * Input dep entry (partial)\n */\ntype DepInput = {\n /** Name of the dependency */\n name: string;\n /** Version of the dependency */\n version?: string;\n};\n\n/**\n * Helper to normalize a parsed dep entry\n *\n * @param name - name\n * @param version - version\n * @returns normalized entry\n */\nfunction depEntry(name: string, version?: string): DepInput {\n const v =\n version && version.trim().length > 0 && version !== '_'\n ? version.trim()\n : undefined;\n return { name, version: v };\n}\n\nexport const kotlin: CodeScanningConfig = {\n supportedFiles: ['**/build.gradle.kts', '**/*.gradle.kts'],\n ignoreDirs: [\n 'gradle-app.setting',\n 'gradle-wrapper.jar',\n 'gradle-wrapper.properties',\n ],\n scanFunction: (filePath) => {\n const fileContents = readFileSync(filePath, 'utf-8');\n const directory = dirname(filePath);\n\n // ---------- applicationId ----------\n const appIds = [\n ...findAllWithRegex(\n { value: KTS_APPLICATION_ID_EQ_REGEX, matches: ['name'] },\n fileContents,\n ),\n ...findAllWithRegex(\n { value: KTS_APPLICATION_ID_CALL_REGEX, matches: ['name'] },\n fileContents,\n ),\n ];\n if (appIds.length > 1) {\n throw new Error(`Expected only one applicationId per file: ${filePath}`);\n }\n const appName = appIds[0]?.name || directory.split('/').pop()!;\n\n // ---------- dependencies ----------\n const deps: Array<DepInput> = [];\n\n // \"group:artifact:version\"\n for (const m of fileContents.matchAll(KTS_DEP_STRING_COORDS_REGEX)) {\n const [, , group, artifact, version] = m;\n deps.push(depEntry(`${group}:${artifact}`, version));\n }\n\n // platform(\"group:artifact:version\")\n for (const m of fileContents.matchAll(KTS_DEP_PLATFORM_REGEX)) {\n const [, , group, artifact, version] = m;\n // Record as regular coord (you may prefer to tag as BoM separately)\n deps.push(depEntry(`${group}:${artifact}`, version));\n }\n\n // libs aliases (version catalogs) — keep alias as name, unknown version\n for (const m of fileContents.matchAll(KTS_DEP_LIBS_ALIAS_REGEX)) {\n // Grab the exact token as name (best-effort)\n const token = m[0]\n .replace(/^[^(]+\\(\\s*/, '')\n .replace(/\\)\\s*$/, '')\n .trim(); // e.g., libs.androidx.appcompat or libs[\"androidx-core-ktx\"]\n deps.push(depEntry(token));\n }\n\n // ---------- plugins ----------\n const plugins: Array<DepInput> = [];\n\n for (const m of fileContents.matchAll(KTS_PLUGIN_ID_REGEX)) {\n const [, pid, pver] = m;\n plugins.push(depEntry(pid, pver));\n }\n\n for (const m of fileContents.matchAll(KTS_PLUGIN_APPLY_REGEX)) {\n const [, pid] = m;\n plugins.push(depEntry(pid));\n }\n\n // alias(libs.plugins...) — keep alias token (no version)\n if (KTS_PLUGIN_ALIAS_REGEX.test(fileContents)) {\n // Collect all alias lines to preserve identifiers; light parse:\n const aliasMatches = fileContents.matchAll(\n /alias\\s*\\(\\s*(libs(?:\\.plugins)?(?:\\.[\\w\\-.]+|\\[[\"'][^\"']+[\"']\\]))\\s*\\)/g,\n );\n for (const m of aliasMatches) {\n plugins.push(depEntry(m[1]));\n }\n }\n\n // ---------- compose final list ----------\n // Merge deps + plugins as \"softwareDevelopmentKits\"\n const softwareDevelopmentKits = [...deps, ...plugins]\n // de-dup by name+version\n .reduce(\n (acc, cur) => {\n const key = `${cur.name}@@${cur.version || ''}`;\n if (!acc.map.has(key)) {\n acc.map.set(key, cur);\n acc.list.push(cur);\n }\n return acc;\n },\n {\n map: new Map<string, DepInput>(),\n list: [] as Array<DepInput>,\n },\n ).list;\n\n return [\n {\n name: appName,\n softwareDevelopmentKits,\n },\n ];\n },\n};\n"]}