@transcend-io/cli 8.25.4 → 8.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -13
- package/dist/bin/bash-complete.cjs +1 -1
- package/dist/bin/cli.cjs +1 -1
- package/dist/bin/deprecated-command.cjs +2 -2
- package/dist/{chunk-YRLFFYWT.cjs → chunk-2MHJ5LZ7.cjs} +2 -2
- package/dist/{chunk-YRLFFYWT.cjs.map → chunk-2MHJ5LZ7.cjs.map} +1 -1
- package/dist/{chunk-WV7PEYHE.cjs → chunk-5TKJLZA2.cjs} +2 -2
- package/dist/{chunk-WV7PEYHE.cjs.map → chunk-5TKJLZA2.cjs.map} +1 -1
- package/dist/{chunk-2HKH3MW5.cjs → chunk-AZ4GTUNR.cjs} +22 -22
- package/dist/chunk-AZ4GTUNR.cjs.map +1 -0
- package/dist/{chunk-WF7EGPWL.cjs → chunk-FTXFBDFW.cjs} +2 -2
- package/dist/{chunk-WF7EGPWL.cjs.map → chunk-FTXFBDFW.cjs.map} +1 -1
- package/dist/{chunk-25JGKUUE.cjs → chunk-K65NYGJM.cjs} +4 -4
- package/dist/{chunk-25JGKUUE.cjs.map → chunk-K65NYGJM.cjs.map} +1 -1
- package/dist/{chunk-Z42WWJXP.cjs → chunk-KOXU6674.cjs} +2 -2
- package/dist/{chunk-Z42WWJXP.cjs.map → chunk-KOXU6674.cjs.map} +1 -1
- package/dist/{chunk-GZSDZRAF.cjs → chunk-L32BTN2M.cjs} +4 -4
- package/dist/{chunk-GZSDZRAF.cjs.map → chunk-L32BTN2M.cjs.map} +1 -1
- package/dist/{chunk-V5WGGXWV.cjs → chunk-L5QUUSVB.cjs} +4 -4
- package/dist/{chunk-V5WGGXWV.cjs.map → chunk-L5QUUSVB.cjs.map} +1 -1
- package/dist/{chunk-6PTR24XG.cjs → chunk-QAKUAPPO.cjs} +2 -2
- package/dist/{chunk-6PTR24XG.cjs.map → chunk-QAKUAPPO.cjs.map} +1 -1
- package/dist/chunk-SONNKP33.cjs +12 -0
- package/dist/chunk-SONNKP33.cjs.map +1 -0
- package/dist/{chunk-AGAP55PJ.cjs → chunk-U2XRCT7A.cjs} +2 -2
- package/dist/{chunk-AGAP55PJ.cjs.map → chunk-U2XRCT7A.cjs.map} +1 -1
- package/dist/{chunk-ZY2OEIDM.cjs → chunk-VEU5LPA6.cjs} +2 -2
- package/dist/{chunk-ZY2OEIDM.cjs.map → chunk-VEU5LPA6.cjs.map} +1 -1
- package/dist/{chunk-ZI4VPQTU.cjs → chunk-WGCFVEJZ.cjs} +2 -2
- package/dist/{chunk-ZI4VPQTU.cjs.map → chunk-WGCFVEJZ.cjs.map} +1 -1
- package/dist/{chunk-7YHV6PUI.cjs → chunk-XN6WUCF4.cjs} +2 -2
- package/dist/{chunk-7YHV6PUI.cjs.map → chunk-XN6WUCF4.cjs.map} +1 -1
- package/dist/{impl-2LKYEIZI.cjs → impl-2CF2PKFH.cjs} +2 -2
- package/dist/{impl-2LKYEIZI.cjs.map → impl-2CF2PKFH.cjs.map} +1 -1
- package/dist/{impl-6QA74NVV.cjs → impl-2XEHL54N.cjs} +2 -2
- package/dist/{impl-6QA74NVV.cjs.map → impl-2XEHL54N.cjs.map} +1 -1
- package/dist/{impl-LPFK3Y6E.cjs → impl-35DXHKNE.cjs} +2 -2
- package/dist/{impl-LPFK3Y6E.cjs.map → impl-35DXHKNE.cjs.map} +1 -1
- package/dist/{impl-UFPWZRKN.cjs → impl-3BLJB5VJ.cjs} +2 -2
- package/dist/{impl-UFPWZRKN.cjs.map → impl-3BLJB5VJ.cjs.map} +1 -1
- package/dist/impl-3TTJGFRK.cjs +2 -0
- package/dist/{impl-I4OB5JJW.cjs.map → impl-3TTJGFRK.cjs.map} +1 -1
- package/dist/impl-43MGE5WS.cjs +2 -0
- package/dist/{impl-BDFYLKR3.cjs.map → impl-43MGE5WS.cjs.map} +1 -1
- package/dist/{impl-XJCUQGWV.cjs → impl-4GZIUG3H.cjs} +3 -3
- package/dist/{impl-XJCUQGWV.cjs.map → impl-4GZIUG3H.cjs.map} +1 -1
- package/dist/{impl-LWCLFXJE.cjs → impl-4VNXB52F.cjs} +2 -2
- package/dist/{impl-LWCLFXJE.cjs.map → impl-4VNXB52F.cjs.map} +1 -1
- package/dist/{impl-ND36KD2S.cjs → impl-5PPLTGRY.cjs} +2 -2
- package/dist/{impl-ND36KD2S.cjs.map → impl-5PPLTGRY.cjs.map} +1 -1
- package/dist/{impl-MLUSR6C2.cjs → impl-7TIKA2O6.cjs} +2 -2
- package/dist/{impl-MLUSR6C2.cjs.map → impl-7TIKA2O6.cjs.map} +1 -1
- package/dist/{impl-INNQGTTN.cjs → impl-BEVLBZ2F.cjs} +2 -2
- package/dist/{impl-INNQGTTN.cjs.map → impl-BEVLBZ2F.cjs.map} +1 -1
- package/dist/{impl-H4RE4D4S.cjs → impl-CCY7BINI.cjs} +2 -2
- package/dist/{impl-H4RE4D4S.cjs.map → impl-CCY7BINI.cjs.map} +1 -1
- package/dist/{impl-S2ZHNQPA.cjs → impl-DEQW3OGQ.cjs} +2 -2
- package/dist/{impl-S2ZHNQPA.cjs.map → impl-DEQW3OGQ.cjs.map} +1 -1
- package/dist/{impl-DHRIGZHG.cjs → impl-F2UNSOIO.cjs} +2 -2
- package/dist/{impl-DHRIGZHG.cjs.map → impl-F2UNSOIO.cjs.map} +1 -1
- package/dist/{impl-EQTULPSC.cjs → impl-H3J7N77A.cjs} +2 -2
- package/dist/{impl-EQTULPSC.cjs.map → impl-H3J7N77A.cjs.map} +1 -1
- package/dist/{impl-OB57ILTQ.cjs → impl-HZJIVXWT.cjs} +2 -2
- package/dist/{impl-OB57ILTQ.cjs.map → impl-HZJIVXWT.cjs.map} +1 -1
- package/dist/{impl-U52ECRAI.cjs → impl-IQCQDDW7.cjs} +2 -2
- package/dist/{impl-U52ECRAI.cjs.map → impl-IQCQDDW7.cjs.map} +1 -1
- package/dist/{impl-MOZKJUJD.cjs → impl-J3FUD3MS.cjs} +5 -5
- package/dist/{impl-MOZKJUJD.cjs.map → impl-J3FUD3MS.cjs.map} +1 -1
- package/dist/{impl-7I7WLWJQ.cjs → impl-JHP4RJZ4.cjs} +2 -2
- package/dist/{impl-7I7WLWJQ.cjs.map → impl-JHP4RJZ4.cjs.map} +1 -1
- package/dist/{impl-UFMS6SI7.cjs → impl-JK3TTCKR.cjs} +2 -2
- package/dist/{impl-UFMS6SI7.cjs.map → impl-JK3TTCKR.cjs.map} +1 -1
- package/dist/{impl-BYTZY3Z6.cjs → impl-JYAKR5RR.cjs} +2 -2
- package/dist/{impl-BYTZY3Z6.cjs.map → impl-JYAKR5RR.cjs.map} +1 -1
- package/dist/{impl-CRNRICMD.cjs → impl-K6MYBWAY.cjs} +2 -2
- package/dist/{impl-CRNRICMD.cjs.map → impl-K6MYBWAY.cjs.map} +1 -1
- package/dist/{impl-JL7GLOZF.cjs → impl-KZZC7P5D.cjs} +2 -2
- package/dist/{impl-JL7GLOZF.cjs.map → impl-KZZC7P5D.cjs.map} +1 -1
- package/dist/{impl-3YE4WAQP.cjs → impl-L74WP6LX.cjs} +2 -2
- package/dist/{impl-3YE4WAQP.cjs.map → impl-L74WP6LX.cjs.map} +1 -1
- package/dist/{impl-BLJACUHU.cjs → impl-LUKG7ED6.cjs} +2 -2
- package/dist/{impl-BLJACUHU.cjs.map → impl-LUKG7ED6.cjs.map} +1 -1
- package/dist/{impl-JAZLFVKB.cjs → impl-MENWC3FS.cjs} +2 -2
- package/dist/{impl-JAZLFVKB.cjs.map → impl-MENWC3FS.cjs.map} +1 -1
- package/dist/{impl-UXAQZEE7.cjs → impl-PK3DXVLW.cjs} +2 -2
- package/dist/{impl-UXAQZEE7.cjs.map → impl-PK3DXVLW.cjs.map} +1 -1
- package/dist/impl-QVM227RD.cjs +2 -0
- package/dist/impl-QVM227RD.cjs.map +1 -0
- package/dist/{impl-KXF7BCHQ.cjs → impl-S2UBMTKQ.cjs} +2 -2
- package/dist/{impl-KXF7BCHQ.cjs.map → impl-S2UBMTKQ.cjs.map} +1 -1
- package/dist/{impl-6WJQPEMB.cjs → impl-S6GUFHKS.cjs} +2 -2
- package/dist/{impl-6WJQPEMB.cjs.map → impl-S6GUFHKS.cjs.map} +1 -1
- package/dist/{impl-YRWRS6KV.cjs → impl-SAWOUYGV.cjs} +2 -2
- package/dist/{impl-YRWRS6KV.cjs.map → impl-SAWOUYGV.cjs.map} +1 -1
- package/dist/{impl-PTM53QZ4.cjs → impl-SBIOFGRE.cjs} +2 -2
- package/dist/{impl-PTM53QZ4.cjs.map → impl-SBIOFGRE.cjs.map} +1 -1
- package/dist/{impl-ZJ7OGSS6.cjs → impl-UR7MDG5O.cjs} +2 -2
- package/dist/{impl-ZJ7OGSS6.cjs.map → impl-UR7MDG5O.cjs.map} +1 -1
- package/dist/{impl-U36BPXJJ.cjs → impl-UTDGC4UZ.cjs} +2 -2
- package/dist/{impl-U36BPXJJ.cjs.map → impl-UTDGC4UZ.cjs.map} +1 -1
- package/dist/{impl-N5DU3D2L.cjs → impl-UTJTENWY.cjs} +2 -2
- package/dist/{impl-N5DU3D2L.cjs.map → impl-UTJTENWY.cjs.map} +1 -1
- package/dist/{impl-AUV3SVBV.cjs → impl-VEW5WAK7.cjs} +3 -3
- package/dist/{impl-AUV3SVBV.cjs.map → impl-VEW5WAK7.cjs.map} +1 -1
- package/dist/{impl-OZSXSSM2.cjs → impl-W33BLTPN.cjs} +2 -2
- package/dist/{impl-OZSXSSM2.cjs.map → impl-W33BLTPN.cjs.map} +1 -1
- package/dist/{impl-JKCLI6YJ.cjs → impl-WLYI6G4A.cjs} +4 -4
- package/dist/{impl-JKCLI6YJ.cjs.map → impl-WLYI6G4A.cjs.map} +1 -1
- package/dist/{impl-ACVRWX3I.cjs → impl-X5JUJPG5.cjs} +2 -2
- package/dist/{impl-ACVRWX3I.cjs.map → impl-X5JUJPG5.cjs.map} +1 -1
- package/dist/{impl-BSAQKPCH.cjs → impl-XJX7GD3G.cjs} +2 -2
- package/dist/{impl-BSAQKPCH.cjs.map → impl-XJX7GD3G.cjs.map} +1 -1
- package/dist/{impl-FPAX7DCW.cjs → impl-YZ6LZ2LI.cjs} +2 -2
- package/dist/{impl-FPAX7DCW.cjs.map → impl-YZ6LZ2LI.cjs.map} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -1
- package/package.json +1 -1
- package/dist/chunk-2HKH3MW5.cjs.map +0 -1
- package/dist/chunk-NIACJFII.cjs +0 -12
- package/dist/chunk-NIACJFII.cjs.map +0 -1
- package/dist/impl-BDFYLKR3.cjs +0 -2
- package/dist/impl-GW25TQMJ.cjs +0 -2
- package/dist/impl-GW25TQMJ.cjs.map +0 -1
- package/dist/impl-I4OB5JJW.cjs +0 -2
package/README.md
CHANGED
|
@@ -1800,24 +1800,28 @@ 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] [--updatedBefore value] [--updatedAfter 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] [--shouldChunk] [--windowConcurrency value] [--maxChunks value] [--maxLookbackDays value]
|
|
1804
1804
|
transcend consent pull-consent-preferences --help
|
|
1805
1805
|
|
|
1806
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
|
-
--auth
|
|
1810
|
-
--partition
|
|
1811
|
-
[--sombraAuth]
|
|
1812
|
-
[--file]
|
|
1813
|
-
[--transcendUrl]
|
|
1814
|
-
[--timestampBefore]
|
|
1815
|
-
[--timestampAfter]
|
|
1816
|
-
[--updatedBefore]
|
|
1817
|
-
[--updatedAfter]
|
|
1818
|
-
[--identifiers]...
|
|
1819
|
-
[--concurrency]
|
|
1820
|
-
|
|
1809
|
+
--auth The Transcend API key. Requires scopes: "View Managed Consent Database Admin API", "View Identity Verification Settings", "View Preference Store Settings"
|
|
1810
|
+
--partition Partition ID to query in the Preference Store
|
|
1811
|
+
[--sombraAuth] The Sombra internal key, use for additional authentication when self-hosting Sombra
|
|
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]
|
|
1820
|
+
[--shouldChunk/--noShouldChunk] Whether to download requests in timestamp window chunks. [default = true]
|
|
1821
|
+
[--windowConcurrency] When chunking, how many windows to download in parallel (higher = faster, but more load). [default = 100]
|
|
1822
|
+
[--maxChunks] Maximum number of chunks to download (higher = more data, but more load). [default = 5000]
|
|
1823
|
+
[--maxLookbackDays] Maximum lookback period in days for fetching consent preferences. [default = 3650]
|
|
1824
|
+
-h --help Print help information and exit
|
|
1821
1825
|
```
|
|
1822
1826
|
|
|
1823
1827
|
#### Examples
|
|
@@ -1894,6 +1898,42 @@ transcend consent pull-consent-preferences \
|
|
|
1894
1898
|
--transcendUrl=https://api.us.transcend.io
|
|
1895
1899
|
```
|
|
1896
1900
|
|
|
1901
|
+
**Pull data in a single thread, instead of using the default which pulls data in parallel chunks with non-overlapping time windows (for large datasets)**
|
|
1902
|
+
|
|
1903
|
+
```sh
|
|
1904
|
+
transcend consent pull-consent-preferences \
|
|
1905
|
+
--auth="$TRANSCEND_API_KEY" \
|
|
1906
|
+
--partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 \
|
|
1907
|
+
--shouldChunk=false
|
|
1908
|
+
```
|
|
1909
|
+
|
|
1910
|
+
**Configure window concurrency for faster parallel downloads**
|
|
1911
|
+
|
|
1912
|
+
```sh
|
|
1913
|
+
transcend consent pull-consent-preferences \
|
|
1914
|
+
--auth="$TRANSCEND_API_KEY" \
|
|
1915
|
+
--partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 \
|
|
1916
|
+
--windowConcurrency=200
|
|
1917
|
+
```
|
|
1918
|
+
|
|
1919
|
+
**Limit maximum number of chunks to download**
|
|
1920
|
+
|
|
1921
|
+
```sh
|
|
1922
|
+
transcend consent pull-consent-preferences \
|
|
1923
|
+
--auth="$TRANSCEND_API_KEY" \
|
|
1924
|
+
--partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 \
|
|
1925
|
+
--maxChunks=1000
|
|
1926
|
+
```
|
|
1927
|
+
|
|
1928
|
+
**Set maximum lookback period to 30 days**
|
|
1929
|
+
|
|
1930
|
+
```sh
|
|
1931
|
+
transcend consent pull-consent-preferences \
|
|
1932
|
+
--auth="$TRANSCEND_API_KEY" \
|
|
1933
|
+
--partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 \
|
|
1934
|
+
--maxLookbackDays=30
|
|
1935
|
+
```
|
|
1936
|
+
|
|
1897
1937
|
### `transcend consent update-consent-manager`
|
|
1898
1938
|
|
|
1899
1939
|
```txt
|
|
@@ -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
|
|
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 _chunkAZ4GTUNRcjs = require('../chunk-AZ4GTUNR.cjs');require('../chunk-U2XRCT7A.cjs');require('../chunk-FTXFBDFW.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, _chunkAZ4GTUNRcjs.a,o,_chunkT462ONFXcjs.a.call(void 0, process));try{for(let{completion:r}of await _core.proposeCompletions.call(void 0, _chunkAZ4GTUNRcjs.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
|
|
2
|
+
"use strict";var _chunkT462ONFXcjs = require('../chunk-T462ONFX.cjs');var _chunkAZ4GTUNRcjs = require('../chunk-AZ4GTUNR.cjs');require('../chunk-U2XRCT7A.cjs');require('../chunk-FTXFBDFW.cjs');require('../chunk-Q7I37FJV.cjs');var _core = require('@stricli/core');async function n(){await _core.run.call(void 0, _chunkAZ4GTUNRcjs.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
|
|
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 _chunkAZ4GTUNRcjs = require('../chunk-AZ4GTUNR.cjs');require('../chunk-U2XRCT7A.cjs');var _chunkZUNVPK23cjs = require('../chunk-ZUNVPK23.cjs');require('../chunk-FTXFBDFW.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, _chunkAZ4GTUNRcjs.a), 'access', _ => _.find, 'call', _2 => _2(s=>s[0]===`${_chunkAZ4GTUNRcjs.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}\` -> \`${_chunkAZ4GTUNRcjs.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 \`${
|
|
5
|
+
Use \`${_chunkAZ4GTUNRcjs.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,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFTXFBDFWcjs = require('./chunk-FTXFBDFW.cjs');function f(p,{adTechPurposes:m=["SaleOfInfo"],serviceToTitle:s,serviceToSupportedIntegration:r}){let e=[],i=[],n={};p.forEach(t=>{let{service:a,attributes:c=[]}=t;if(!a||a==="internalService")return;let u=c.find(o=>o.key==="Found on Domain");u&&(n[a]||(n[a]=[]),n[a].push(...u.values.map(o=>o.replace("https://","").replace("http://",""))),n[a]=[...new Set(n[a])]),_chunkFTXFBDFWcjs.i.call(void 0, t.trackingPurposes,m).length>0?(i.push(a),e.includes(a)&&(e=e.filter(o=>o!==a))):i.includes(a)||e.push(a)});let h=[...new Set(i)].map(t=>({title:s[t],...r[t]?{integrationName:t}:{integrationName:"promptAPerson","outer-type":t},attributes:[{key:"Tech Type",values:["Ad Tech"]},{key:"Found On Domain",values:n[t]||[]}]}));return{siteTechDataSilos:[...new Set(e)].map(t=>({title:s[t],...r[t]?{integrationName:t}:{integrationName:"promptAPerson",outerType:t},attributes:[{key:"Tech Type",values:["Site Tech"]},{key:"Found On Domain",values:n[t]||[]}]})),adTechDataSilos:h}}exports.a = f;
|
|
2
|
+
//# sourceMappingURL=chunk-2MHJ5LZ7.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-2MHJ5LZ7.cjs","../src/lib/consent-manager/dataFlowsToDataSilos.ts"],"names":["dataFlowsToDataSilos","inputs","adTechPurposes","serviceToTitle","serviceToSupportedIntegration","siteTechIntegrations","adTechIntegrations","serviceToFoundOnDomain","flow","service","attributes","foundOnDomain","attr","v","union_default","s","adTechDataSilos"],"mappings":"AAAA,iIAAwC,SCWxBA,CAAAA,CACdC,CAAAA,CACA,CACE,cAAA,CAAAC,CAAAA,CAAiB,CAAC,YAAY,CAAA,CAC9B,cAAA,CAAAC,CAAAA,CACA,6BAAA,CAAAC,CACF,CAAA,CASA,CAEA,IAAIC,CAAAA,CAAiC,CAAC,CAAA,CAGhCC,CAAAA,CAA+B,CAAC,CAAA,CAGhCC,CAAAA,CAAsD,CAAC,CAAA,CAG7DN,CAAAA,CAAO,OAAA,CAASO,CAAAA,EAAS,CAEvB,GAAM,CAAE,OAAA,CAAAC,CAAAA,CAAS,UAAA,CAAAC,CAAAA,CAAa,CAAC,CAAE,CAAA,CAAIF,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8BK,CAAO,CAAA,CACrC,CAAE,eAAA,CAAiBA,CAAQ,CAAA,CAC3B,CAAE,eAAA,CAAiB,eAAA,CAAiB,YAAA,CAAcA,CAAQ,CAAA,CAC9D,UAAA,CAAY,CACV,CACE,GAAA,CAAK,WAAA,CACL,MAAA,CAAQ,CAAC,SAAS,CACpB,CAAA,CACA,CACE,GAAA,CAAK,iBAAA,CACL,MAAA,CAAQF,CAAAA,CAAuBE,CAAO,CAAA,EAAK,CAAC,CAC9C,CACF,CACF,CAAA,CAAE,CAAA,CAsBF,MAAO,CACL,iBAAA,CApBwB,CAAC,GAAG,IAAI,GAAA,CAAIJ,CAAoB,CAAC,CAAA,CAAE,GAAA,CAC1DI,CAAAA,EAAAA,CAAa,CACZ,KAAA,CAAON,CAAAA,CAAeM,CAAO,CAAA,CAC7B,GAAIL,CAAAA,CAA8BK,CAAO,CAAA,CACrC,CAAE,eAAA,CAAiBA,CAAQ,CAAA,CAC3B,CAAE,eAAA,CAAiB,eAAA,CAAiB,SAAA,CAAWA,CAAQ,CAAA,CAC3D,UAAA,CAAY,CACV,CACE,GAAA,CAAK,WAAA,CACL,MAAA,CAAQ,CAAC,WAAW,CACtB,CAAA,CACA,CACE,GAAA,CAAK,iBAAA,CACL,MAAA,CAAQF,CAAAA,CAAuBE,CAAO,CAAA,EAAK,CAAC,CAC9C,CACF,CACF,CAAA,CACF,CAAA,CAIE,eAAA,CAAAO,CACF,CACF,CAAA,cAAA","file":"/home/runner/work/cli/cli/dist/chunk-2MHJ5LZ7.cjs","sourcesContent":[null,"import { DataFlowInput, DataSiloInput } from '../../codecs';\nimport { union } from 'lodash-es';\nimport { IndexedCatalogs } from '../graphql';\n\n/**\n * Convert data flow configurations into a set of data silo configurations\n *\n * @param inputs - Data flow input to convert to data silos\n * @param options - Additional options\n * @returns Business entity configuration input\n */\nexport function dataFlowsToDataSilos(\n inputs: DataFlowInput[],\n {\n adTechPurposes = ['SaleOfInfo'],\n serviceToTitle,\n serviceToSupportedIntegration,\n }: IndexedCatalogs & {\n /** List of purposes that are considered \"Ad Tech\" */\n adTechPurposes?: string[];\n },\n): {\n /** List of data silo configurations for site-tech services */\n siteTechDataSilos: DataSiloInput[];\n /** List of data silo configurations for ad-tech services */\n adTechDataSilos: DataSiloInput[];\n} {\n // List of site tech integrations\n let siteTechIntegrations: string[] = [];\n\n // List of ad tech integrations\n const adTechIntegrations: string[] = [];\n\n // Mapping from service name to list of\n const serviceToFoundOnDomain: { [k in string]: string[] } = {};\n\n // iterate over each flow\n inputs.forEach((flow) => {\n // process data flows with services\n const { service, attributes = [] } = flow;\n if (!service || service === 'internalService') {\n return;\n }\n\n // create mapping to found on domain\n const foundOnDomain = attributes.find(\n (attr) => attr.key === 'Found on Domain',\n );\n\n // Create a list of all domains where the data flow was found\n if (foundOnDomain) {\n if (!serviceToFoundOnDomain[service]) {\n serviceToFoundOnDomain[service] = [];\n }\n serviceToFoundOnDomain[service]!.push(\n ...foundOnDomain.values.map((v) =>\n v.replace('https://', '').replace('http://', ''),\n ),\n );\n serviceToFoundOnDomain[service] = [\n ...new Set(serviceToFoundOnDomain[service]),\n ];\n }\n\n // Keep track of ad tech\n if (union(flow.trackingPurposes, adTechPurposes).length > 0) {\n // add service to ad tech list\n adTechIntegrations.push(service);\n\n // remove from site tech list\n if (siteTechIntegrations.includes(service)) {\n siteTechIntegrations = siteTechIntegrations.filter(\n (s) => s !== service,\n );\n }\n } else if (!adTechIntegrations.includes(service)) {\n // add to site tech list\n siteTechIntegrations.push(service);\n }\n });\n\n // create the list of ad tech integrations\n const adTechDataSilos = [...new Set(adTechIntegrations)].map((service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', 'outer-type': service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Ad Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }));\n\n // create the list of site tech integrations\n const siteTechDataSilos = [...new Set(siteTechIntegrations)].map(\n (service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', outerType: service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Site Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }),\n );\n\n return {\n siteTechDataSilos,\n adTechDataSilos,\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 }; }var _chunk5UBGZNDCcjs = require('./chunk-5UBGZNDC.cjs');var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
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 }; }var _chunk5UBGZNDCcjs = require('./chunk-5UBGZNDC.cjs');var _chunkK65NYGJMcjs = require('./chunk-K65NYGJM.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkFTXFBDFWcjs = require('./chunk-FTXFBDFW.cjs');var _bluebird = require('bluebird');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function H({email:r,password:a,scopes:f,apiKeyTitle:t,parentOrganizationId:o,deleteExistingApiKey:l=!0,createNewApiKey:I=!0,transcendUrl:x=_chunkFTXFBDFWcjs.r}){let s=await _chunkK65NYGJMcjs.vc.call(void 0, x,{});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Logging in using email and password."));let{roles:d,loginCookie:k}=await _chunkK65NYGJMcjs.Jd.call(void 0, s,{email:r,password:a});_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully logged in and found ${d.length} role${d.length===1?"":"s"}!`));let P=o?d.filter(e=>e.organization.id===o||e.organization.parentOrganizationId===o):d;s.setHeaders({Cookie:k});let m=[],c=[];return _chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Generating API keys with title: ${t}, scopes: ${f.join(",")}.`)),await _bluebird.mapSeries.call(void 0, P,async e=>{try{await _chunkK65NYGJMcjs.Kd.call(void 0, s,{roleId:e.id,email:r}),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Checking if API key already exists in organization "${e.organization.name}" with title: "${t}".`));let[g]=await _chunkK65NYGJMcjs.rd.call(void 0, s,[t]);if(g&&l)_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`Deleting existing API key in "${e.organization.name}" with title: "${t}".`)),await _chunkK65NYGJMcjs.Md.call(void 0, s,g.id),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully deleted API key in "${e.organization.name}" with title: "${t}".`));else if(g)throw new Error(`API key already exists with title: "${t}"`);if(I){_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Creating API key in "${e.organization.name}" with title: "${t}".`));let{apiKey:K}=await _chunkK65NYGJMcjs.Ld.call(void 0, s,{title:t,scopes:f});m.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:K}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully created API key in "${e.organization.name}" with title: "${t}".`))}else m.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:""})}catch(g){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to create API key in organization "${e.organization.name}"! - ${g.message}`)),c.push({organizationName:e.organization.name,organizationId:e.organization.id,error:g.message})}}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully created ${m.length} API key${m.length===1?"":"s"}`)),c.length>0&&_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to create ${c.length} API key${c.length===1?"":"s"}!`)),{errors:c,apiKeys:m}}var _typeutils = require('@transcend-io/type-utils');var _iots = require('io-ts'); var S = _interopRequireWildcard(_iots);var _fs = require('fs');function T(r){return r||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY")),process.exit(1)),_fs.existsSync.call(void 0, r)?_typeutils.decodeCodec.call(void 0, S.array(_chunk5UBGZNDCcjs.ha),_fs.readFileSync.call(void 0, r,"utf-8")):r}function Z(r,a,f=!1){if(!_fs.existsSync.call(void 0, r))return[];let t=_fs.readdirSync.call(void 0, r).filter(o=>a?a.filter(l=>o.endsWith(l)).length:!0).filter(o=>o.indexOf(".")>0);return f?t.map(o=>o.replace(/\.[^/.]+$/,"")):t}var _path = require('path');function te(r){return _fs.readdirSync.call(void 0, r).filter(a=>_fs.statSync.call(void 0, _path.join.call(void 0, r,a)).isDirectory())}exports.a = H; exports.b = T; exports.c = Z; exports.d = te;
|
|
2
|
+
//# sourceMappingURL=chunk-5TKJLZA2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-5TKJLZA2.cjs","../src/lib/api-keys/generateCrossAccountApiKeys.ts"],"names":["generateCrossAccountApiKeys","email","password","scopes","apiKeyTitle","parentOrganizationId","deleteExistingApiKey","createNewApiKey","transcendUrl","DEFAULT_TRANSCEND_API","client","buildTranscendGraphQLClientGeneric","logger","colors","roles","loginCookie","loginUser","filteredRoles","role","results","errors","mapSeries","assumeRole","apiKeyWithTitle","fetchAllApiKeys","deleteApiKey","apiKey","createApiKey","err"],"mappings":"AAAA,mfAAyC,wDAAkF,wDAAyC,wDAAyC,oCCAnL,gFAUP,MAoBnB,SAAsBA,C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,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,eAAA,EAAkBd,CAAW,CAAA,EAAA,CAC7E,CACF,CAAA,CACA,GAAM,CAAE,MAAA,CAAAsB,CAAO,CAAA,CAAI,MAAMC,kCAAAA,CAAajB,CAAQ,CAC5C,KAAA,CAAON,CAAAA,CACP,MAAA,CAAAD,CACF,CAAC,CAAA,CACDgB,CAAAA,CAAQ,IAAA,CAAK,CACX,gBAAA,CAAkBD,CAAAA,CAAK,YAAA,CAAa,IAAA,CACpC,cAAA,CAAgBA,CAAAA,CAAK,YAAA,CAAa,EAAA,CAClC,MAAA,CAAAQ,CACF,CAAC,CAAA,CACDd,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,iCAAA,EAAoCK,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,eAAA,EAAkBd,CAAW,CAAA,EAAA,CACzF,CACF,CACF,CAAA,KAEEe,CAAAA,CAAQ,IAAA,CAAK,CACX,gBAAA,CAAkBD,CAAAA,CAAK,YAAA,CAAa,IAAA,CACpC,cAAA,CAAgBA,CAAAA,CAAK,YAAA,CAAa,EAAA,CAClC,MAAA,CAAQ,EACV,CAAC,CAEL,CAAA,KAAA,CAASU,CAAAA,CAAK,CACZhB,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,0CAAA,EAA6CK,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,KAAA,EAAQU,CAAAA,CAAI,OAAO,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/chunk-5TKJLZA2.cjs","sourcesContent":[null,"import { mapSeries } from 'bluebird';\nimport {\n buildTranscendGraphQLClientGeneric,\n loginUser,\n createApiKey,\n fetchAllApiKeys,\n deleteApiKey,\n assumeRole,\n} from '../graphql';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport colors from 'colors';\nimport { StoredApiKey } from '../../codecs';\nimport { logger } from '../../logger';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nexport interface ApiKeyGenerateError {\n /** Name of instance */\n organizationName: string;\n /** Error */\n error: string;\n /** Organization ID API key is for */\n organizationId: string;\n}\n\n/**\n * Generate API keys across multiple transcend accounts\n *\n * @param options - Options\n * @returns Number of API keys created\n */\nexport async function generateCrossAccountApiKeys({\n email,\n password,\n scopes,\n apiKeyTitle,\n parentOrganizationId,\n deleteExistingApiKey = true,\n createNewApiKey = true,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** Email address of user generating API keys */\n email: string;\n /** Password of user generating API keys */\n password: string;\n /** Filter for organizations that match this parent organization ID */\n parentOrganizationId?: string;\n /** Title of the API create to create */\n apiKeyTitle: string;\n /** Title of the API create to create */\n scopes: ScopeName[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** When true delete existing API keys with that title, if set to false an API key exists with that title, an error is thrown */\n deleteExistingApiKey?: boolean;\n /** When true, generate new API keys, otherwise only will delete past API keys */\n createNewApiKey?: boolean;\n}): Promise<{\n /** Successfully generated */\n apiKeys: StoredApiKey[];\n /** Error results */\n errors: ApiKeyGenerateError[];\n}> {\n // Create GraphQL client\n const client = await buildTranscendGraphQLClientGeneric(transcendUrl, {});\n\n // Login the user\n logger.info(colors.magenta('Logging in using email and password.'));\n const { roles, loginCookie } = await loginUser(client, { email, password });\n logger.info(\n colors.green(\n `Successfully logged in and found ${roles.length} role${\n roles.length === 1 ? '' : 's'\n }!`,\n ),\n );\n\n // Filter down by parentOrganizationId\n const filteredRoles = parentOrganizationId\n ? roles.filter(\n (role) =>\n role.organization.id === parentOrganizationId ||\n role.organization.parentOrganizationId === parentOrganizationId,\n )\n : roles;\n\n // Save cookie to call route subsequent times\n client.setHeaders({\n Cookie: loginCookie,\n });\n\n // Save the resulting API keys\n const results: StoredApiKey[] = [];\n const errors: ApiKeyGenerateError[] = [];\n\n // Generate API keys\n logger.info(\n colors.magenta(\n `Generating API keys with title: ${apiKeyTitle}, scopes: ${scopes.join(\n ',',\n )}.`,\n ),\n );\n\n // Map over each role\n await mapSeries(filteredRoles, async (role) => {\n try {\n // Log into the other instance\n await assumeRole(client, { roleId: role.id, email });\n\n // Grab API keys with that title\n logger.info(\n colors.magenta(\n `Checking if API key already exists in organization \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n\n // Delete existing API key\n const [apiKeyWithTitle] = await fetchAllApiKeys(client, [apiKeyTitle]);\n if (apiKeyWithTitle && deleteExistingApiKey) {\n logger.info(\n colors.yellow(\n `Deleting existing API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n await deleteApiKey(client, apiKeyWithTitle.id);\n logger.info(\n colors.green(\n `Successfully deleted API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else if (apiKeyWithTitle) {\n // throw error if one exists but not configured to delete\n throw new Error(`API key already exists with title: \"${apiKeyTitle}\"`);\n }\n\n // Create the API key\n if (createNewApiKey) {\n logger.info(\n colors.magenta(\n `Creating API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n const { apiKey } = await createApiKey(client, {\n title: apiKeyTitle,\n scopes,\n });\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey,\n });\n logger.info(\n colors.green(\n `Successfully created API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else {\n // Delete only\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey: '',\n });\n }\n } catch (err) {\n logger.error(\n colors.red(\n `Failed to create API key in organization \"${role.organization.name}\"! - ${err.message}`,\n ),\n );\n errors.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n error: err.message,\n });\n }\n });\n logger.info(\n colors.green(\n `Successfully created ${results.length} API key${\n results.length === 1 ? '' : 's'\n }`,\n ),\n );\n\n if (errors.length > 0) {\n logger.error(\n colors.red(\n `Failed to create ${errors.length} API key${\n errors.length === 1 ? '' : 's'\n }!`,\n ),\n );\n }\n\n return { errors, apiKeys: results };\n}\n"]}
|