@transcend-io/cli 4.73.0 → 4.75.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 (37) hide show
  1. package/README.md +171 -6
  2. package/build/cli-consent-managers-to-business-entities.js +1 -1
  3. package/build/cli-consent-managers-to-business-entities.js.map +1 -1
  4. package/build/cli-derive-data-silos-from-data-flows-cross-instance.d.ts +3 -0
  5. package/build/cli-derive-data-silos-from-data-flows-cross-instance.d.ts.map +1 -0
  6. package/build/cli-derive-data-silos-from-data-flows-cross-instance.js +148 -0
  7. package/build/cli-derive-data-silos-from-data-flows-cross-instance.js.map +1 -0
  8. package/build/cli-derive-data-silos-from-data-flows.d.ts +3 -0
  9. package/build/cli-derive-data-silos-from-data-flows.d.ts.map +1 -0
  10. package/build/cli-derive-data-silos-from-data-flows.js +88 -0
  11. package/build/cli-derive-data-silos-from-data-flows.js.map +1 -0
  12. package/build/cli-upload-cookies-from-csv.d.ts +3 -0
  13. package/build/cli-upload-cookies-from-csv.d.ts.map +1 -0
  14. package/build/cli-upload-cookies-from-csv.js +59 -0
  15. package/build/cli-upload-cookies-from-csv.js.map +1 -0
  16. package/build/codecs.d.ts +22 -0
  17. package/build/codecs.d.ts.map +1 -1
  18. package/build/codecs.js +23 -1
  19. package/build/codecs.js.map +1 -1
  20. package/build/consent-manager/dataFlowsToDataSilos.d.ts +19 -0
  21. package/build/consent-manager/dataFlowsToDataSilos.d.ts.map +1 -0
  22. package/build/consent-manager/dataFlowsToDataSilos.js +95 -0
  23. package/build/consent-manager/dataFlowsToDataSilos.js.map +1 -0
  24. package/build/consent-manager/index.d.ts +1 -0
  25. package/build/consent-manager/index.d.ts.map +1 -1
  26. package/build/consent-manager/index.js +1 -0
  27. package/build/consent-manager/index.js.map +1 -1
  28. package/build/consent-manager/uploadCookiesFromCsv.d.ts +17 -0
  29. package/build/consent-manager/uploadCookiesFromCsv.d.ts.map +1 -0
  30. package/build/consent-manager/uploadCookiesFromCsv.js +70 -0
  31. package/build/consent-manager/uploadCookiesFromCsv.js.map +1 -0
  32. package/build/graphql/fetchCatalogs.d.ts +20 -0
  33. package/build/graphql/fetchCatalogs.d.ts.map +1 -1
  34. package/build/graphql/fetchCatalogs.js +23 -1
  35. package/build/graphql/fetchCatalogs.js.map +1 -1
  36. package/build/tsbuildinfo +1 -1
  37. package/package.json +4 -1
package/README.md CHANGED
@@ -77,22 +77,34 @@
77
77
  - [Authentication](#authentication-16)
78
78
  - [Arguments](#arguments-16)
79
79
  - [Usage](#usage-17)
80
- - [tr-pull-consent-metrics](#tr-pull-consent-metrics)
80
+ - [tr-derive-data-silos-from-data-flows](#tr-derive-data-silos-from-data-flows)
81
81
  - [Authentication](#authentication-17)
82
82
  - [Arguments](#arguments-17)
83
83
  - [Usage](#usage-18)
84
- - [tr-upload-data-flows-from-csv](#tr-upload-data-flows-from-csv)
84
+ - [tr-derive-data-silos-from-data-flows-cross-instance](#tr-derive-data-silos-from-data-flows-cross-instance)
85
85
  - [Authentication](#authentication-18)
86
86
  - [Arguments](#arguments-18)
87
87
  - [Usage](#usage-19)
88
- - [tr-generate-api-keys](#tr-generate-api-keys)
88
+ - [tr-pull-consent-metrics](#tr-pull-consent-metrics)
89
89
  - [Authentication](#authentication-19)
90
90
  - [Arguments](#arguments-19)
91
91
  - [Usage](#usage-20)
92
- - [tr-build-xdi-sync-endpoint](#tr-build-xdi-sync-endpoint)
92
+ - [tr-upload-data-flows-from-csv](#tr-upload-data-flows-from-csv)
93
93
  - [Authentication](#authentication-20)
94
94
  - [Arguments](#arguments-20)
95
95
  - [Usage](#usage-21)
96
+ - [tr-upload-cookies-from-csv](#tr-upload-cookies-from-csv)
97
+ - [Authentication](#authentication-21)
98
+ - [Arguments](#arguments-21)
99
+ - [Usage](#usage-22)
100
+ - [tr-generate-api-keys](#tr-generate-api-keys)
101
+ - [Authentication](#authentication-22)
102
+ - [Arguments](#arguments-22)
103
+ - [Usage](#usage-23)
104
+ - [tr-build-xdi-sync-endpoint](#tr-build-xdi-sync-endpoint)
105
+ - [Authentication](#authentication-23)
106
+ - [Arguments](#arguments-23)
107
+ - [Usage](#usage-24)
96
108
  - [Proxy usage](#proxy-usage)
97
109
 
98
110
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -127,9 +139,12 @@ yarn tr-mark-request-data-silos-completed --auth=$TRANSCEND_API_KEY
127
139
  yarn tr-skip-request-data-silos --auth=$TRANSCEND_API_KEY
128
140
  yarn tr-retry-request-data-silos --auth=$TRANSCEND_API_KEY
129
141
  yarn tr-update-consent-manager --auth=$TRANSCEND_API_KEY
130
- yarn tr-consent-managers-to-business-entities --auth=$TRANSCEND_API_KEY
142
+ yarn tr-consent-managers-to-business-entities
143
+ yarn tr-derive-data-silos-from-data-flows --auth=$TRANSCEND_API_KEY
144
+ yarn tr-derive-data-silos-from-data-flows-cross-instance --auth=$TRANSCEND_API_KEY
131
145
  yarn tr-pull-consent-metrics --auth=$TRANSCEND_API_KEY
132
146
  yarn tr-upload-data-flows-from-csv --auth=$TRANSCEND_API_KEY
147
+ yarn tr-upload-cookies-from-csv --auth=$TRANSCEND_API_KEY
133
148
  yarn tr-generate-api-keys --auth=$TRANSCEND_API_KEY
134
149
  yarn tr-build-xdi-sync-endpoint --auth=$TRANSCEND_API_KEY
135
150
  ```
@@ -157,7 +172,9 @@ tr-skip-request-data-silos --auth=$TRANSCEND_API_KEY
157
172
  tr-retry-request-data-silos --auth=$TRANSCEND_API_KEY
158
173
  tr-update-consent-manager --auth=$TRANSCEND_API_KEY
159
174
  tr-pull-consent-metrics --auth=$TRANSCEND_API_KEY
160
- tr-consent-managers-to-business-entities --auth=$TRANSCEND_API_KEY
175
+ tr-consent-managers-to-business-entities
176
+ tr-derive-data-silos-from-data-flows --auth=$TRANSCEND_API_KEY
177
+ tr-derive-data-silos-from-data-flows-cross-instance --auth=$TRANSCEND_API_KEY
161
178
  tr-upload-data-flows-from-csv --auth=$TRANSCEND_API_KEY
162
179
  tr-generate-api-keys --auth=$TRANSCEND_API_KEY
163
180
  tr-build-xdi-sync-endpoint --auth=$TRANSCEND_API_KEY
@@ -1492,6 +1509,99 @@ Specify custom output file
1492
1509
  yarn tr-consent-managers-to-business-entities --consentManagerYmlFolder=./working/consent-managers/ --output=./custom.yml
1493
1510
  ```
1494
1511
 
1512
+ ### tr-derive-data-silos-from-data-flows
1513
+
1514
+ Given a folder of data flow `transcend.yml` configurations, convert those configurations to set of data silo `transcend.yml` configurations.
1515
+
1516
+ #### Authentication
1517
+
1518
+ In order to use this cli, you will first need to generate an API key on the Transcend Admin Dashboard (https://app.transcend.io/infrastructure/api-keys).
1519
+
1520
+ The API does not need any scopes, any API key will work.
1521
+
1522
+ #### Arguments
1523
+
1524
+ | Argument | Description | Type | Default | Required |
1525
+ | ------------------ | ----------------------------------------------------------------------------- | -------------------- | ------------------------ | -------- |
1526
+ | auth | The Transcend API key with the scopes necessary for the command. | string | N/A | true |
1527
+ | dataFlowsYmlFolder | The folder that contains data flow yml files | string - folder-path | N/A | true |
1528
+ | dataSilosYmlFolder | The folder that contains data silo yml files | string - folder-path | N/A | true |
1529
+ | ignoreYmls | The set of yml files that should be skipped when uploading | string[] | [] | false |
1530
+ | transcendUrl | URL of the Transcend backend. Use https://api.us.transcend.io for US hosting. | string - URL | https://api.transcend.io | false |
1531
+
1532
+ #### Usage
1533
+
1534
+ Convert data flow configurations in folder `./working/data-flows/` to data silo configurations in folder `./working/data-silos/`
1535
+
1536
+ ```sh
1537
+ yarn tr-derive-data-silos-from-data-flows --auth=$TRANSCEND_API_KEY \
1538
+ --dataFlowsYmlFolder=./working/data-flows/ \
1539
+ --dataSilosYmlFolder=./working/data-silos/
1540
+ ```
1541
+
1542
+ Use with US backend
1543
+
1544
+ ```sh
1545
+ yarn tr-derive-data-silos-from-data-flows --auth=$TRANSCEND_API_KEY --transcendUrl=https://api.us.transcend.io \
1546
+ --dataFlowsYmlFolder=./working/data-flows/ \
1547
+ --dataSilosYmlFolder=./working/data-silos/
1548
+ ```
1549
+
1550
+ Skip a set of yml files
1551
+
1552
+ ```sh
1553
+ yarn tr-derive-data-silos-from-data-flows --auth=$TRANSCEND_API_KEY --ignoreYmls="Skip.yml,Other.yml" \
1554
+ --dataFlowsYmlFolder=./working/data-flows/ \
1555
+ --dataSilosYmlFolder=./working/data-silos/
1556
+ ```
1557
+
1558
+ ### tr-derive-data-silos-from-data-flows-cross-instance
1559
+
1560
+ Given a folder of data flow `transcend.yml` configurations, convert those configurations to a single `transcend.yml` configurations of all related data silos.
1561
+
1562
+ #### Authentication
1563
+
1564
+ In order to use this cli, you will first need to generate an API key on the Transcend Admin Dashboard (https://app.transcend.io/infrastructure/api-keys).
1565
+
1566
+ The API does not need any scopes, any API key will work.
1567
+
1568
+ #### Arguments
1569
+
1570
+ | Argument | Description | Type | Default | Required |
1571
+ | ------------------ | ----------------------------------------------------------------------------- | -------------------- | ------------------------ | -------- |
1572
+ | auth | The Transcend API key with the scopes necessary for the command. | string | N/A | true |
1573
+ | dataFlowsYmlFolder | The folder that contains data flow yml files | string - folder-path | N/A | true |
1574
+ | output | The output transcend.yml file containing the data silo configurations | string - file-path | ./transcend.yml | false |
1575
+ | ignoreYmls | The set of yml files that should be skipped when uploading | string[] | [] | false |
1576
+ | transcendUrl | URL of the Transcend backend. Use https://api.us.transcend.io for US hosting. | string - URL | https://api.transcend.io | false |
1577
+
1578
+ #### Usage
1579
+
1580
+ Convert data flow configurations in folder `./working/data-flows/` to data silo configurations in file `./transcend.yml`
1581
+
1582
+ ```sh
1583
+ yarn tr-derive-data-silos-from-data-flows-cross-instance --auth=$TRANSCEND_API_KEY --dataFlowsYmlFolder=./working/data-flows/
1584
+ ```
1585
+
1586
+ Use with US backend
1587
+
1588
+ ```sh
1589
+ yarn tr-derive-data-silos-from-data-flows-cross-instance --auth=$TRANSCEND_API_KEY --dataFlowsYmlFolder=./working/data-flows/ \
1590
+ --transcendUrl=https://api.us.transcend.io
1591
+ ```
1592
+
1593
+ Skip a set of yml files
1594
+
1595
+ ```sh
1596
+ yarn tr-derive-data-silos-from-data-flows-cross-instance --auth=$TRANSCEND_API_KEY --dataFlowsYmlFolder=./working/data-flows/ --ignoreYmls="Skip.yml,Other.yml"
1597
+ ```
1598
+
1599
+ Convert data flow configurations in folder `./working/data-flows/` to data silo configurations in file `./output.yml`
1600
+
1601
+ ```sh
1602
+ yarn tr-derive-data-silos-from-data-flows-cross-instance --auth=$TRANSCEND_API_KEY --dataFlowsYmlFolder=./working/data-flows/ --output=./output.yml
1603
+ ```
1604
+
1495
1605
  ### tr-pull-consent-metrics
1496
1606
 
1497
1607
  This command allows for pulling consent manager metrics for a Transcend account, or a set of Transcend accounts.
@@ -1609,6 +1719,61 @@ Specifying the backend URL, needed for US hosted backend infrastructure.
1609
1719
  yarn tr-upload-data-flows-from-csv --auth=$TRANSCEND_API_KEY --transcendUrl=https://api.us.transcend.io
1610
1720
  ```
1611
1721
 
1722
+ ### tr-upload-cookies-from-csv
1723
+
1724
+ This command allows for uploading cookies from CSV
1725
+
1726
+ Step 1) Download the CSV of cookies that you want to edit from the Admin Dashboard under [Consent Manager -> Cookies](https://app.transcend.io/consent-manager/cookies). You can download cookies from both the "Triage" and "Approved" tabs.
1727
+
1728
+ Step 2) You can edit the contents of the CSV file as needed. You may adjust the "Purpose" column, adjust the "Notes" column, add "Owners" and "Teams" or even add custom columns with additional metadata.
1729
+
1730
+ Step 3) Upload the modified CSV file back into the dashboard with the command `yarn tr-upload-cookies-from-csv --auth=$TRANSCEND_API_KEY --file=./approved-flows.csv --trackerStatus=LIVE`
1731
+
1732
+ #### Authentication
1733
+
1734
+ In order to use this cli, you will first need to generate an API key on the Transcend Admin Dashboard (https://app.transcend.io/infrastructure/api-keys).
1735
+
1736
+ The API key must have the following scopes:
1737
+
1738
+ - "Manage Cookies"
1739
+
1740
+ #### Arguments
1741
+
1742
+ | Argument | Description | Type | Default | Required |
1743
+ | ------------- | ------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------ | -------- |
1744
+ | auth | The Transcend API key with the scopes necessary for the command. | string | N/A | true |
1745
+ | trackerStatus | Whether or not to upload the cookies into the "Approved" tab (LIVE) or the "Triage" tab (NEEDS_REVIEW). | ConsentTrackerStatus | N/A | true |
1746
+ | file | Path to the CSV file to upload | string - file-path | ./cookies.csv | false |
1747
+ | transcendUrl | URL of the Transcend backend. Use https://api.us.transcend.io for US hosting. | string - URL | https://api.transcend.io | false |
1748
+
1749
+ Note: You `trackerStatus` can be specified on a per cookie basis by adding a column named "Status" to the CSV. The values should be of type `ConsentTrackerStatus` - which is `LIVE` or `NEEDS_REVIEW`.
1750
+
1751
+ #### Usage
1752
+
1753
+ Upload the file of cookies in `./cookies.csv` into the ["Approved" tab](https://app.transcend.io/consent-manager/cookies/approved).
1754
+
1755
+ ```sh
1756
+ yarn tr-upload-cookies-from-csv --auth=$TRANSCEND_API_KEY --trackerStatus=LIVE
1757
+ ```
1758
+
1759
+ Upload the file of cookies in `./cookies.csv` into the ["Triage" tab](https://app.transcend.io/consent-manager/cookies).
1760
+
1761
+ ```sh
1762
+ yarn tr-upload-cookies-from-csv --auth=$TRANSCEND_API_KEY --trackerStatus=NEEDS_REVIEW
1763
+ ```
1764
+
1765
+ Specifying the CSV file to read from:
1766
+
1767
+ ```sh
1768
+ yarn tr-upload-cookies-from-csv --auth=$TRANSCEND_API_KEY --trackerStatus=LIVE --file=./custom/my-cookies.csv
1769
+ ```
1770
+
1771
+ Specifying the backend URL, needed for US hosted backend infrastructure.
1772
+
1773
+ ```sh
1774
+ yarn tr-upload-cookies-from-csv --auth=$TRANSCEND_API_KEY --transcendUrl=https://api.us.transcend.io
1775
+ ```
1776
+
1612
1777
  ### tr-generate-api-keys
1613
1778
 
1614
1779
  This command allows for creating API keys across multiple Transcend instances. This is useful for customers that are managing many Transcend instances and need to regularly create, cycle or delete API keys across all of their instances. Unlike the other commands that rely on API key authentication, this command relies upon username/password authentication. This command will spit out the API keys into a [JSON file](./examples/api-keys.json), and that JSON file can be used in subsequent cli commands.
@@ -33,7 +33,7 @@ function main() {
33
33
  logger_1.logger.error(colors_1.default.red('Missing required arg: --consentManagerYmlFolder=./working/consent-managers/'));
34
34
  process.exit(1);
35
35
  }
36
- // Ensure file is passed
36
+ // Ensure folder is passed
37
37
  if (!(0, fs_1.existsSync)(consentManagerYmlFolder) ||
38
38
  !(0, fs_1.lstatSync)(consentManagerYmlFolder).isDirectory()) {
39
39
  logger_1.logger.error(colors_1.default.red(`Folder does not exist: "${consentManagerYmlFolder}"`));
@@ -1 +1 @@
1
- {"version":3,"file":"cli-consent-managers-to-business-entities.js","sourceRoot":"","sources":["../src/cli-consent-managers-to-business-entities.ts"],"names":[],"mappings":";;;;;;AACA,yCAAuC;AACvC,uDAAsE;AACtE,2DAA4E;AAC5E,+BAA4B;AAC5B,gEAAiC;AACjC,oDAA4B;AAC5B,qCAAkC;AAClC,2BAA2C;AAE3C;;;;;;;;;;;;GAYG;AACH,SAAS,IAAI;IACX,+BAA+B;IAC/B,MAAM,EACJ,uBAAuB,EACvB,MAAM,GAAG,kCAAkC,GAC5C,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,qDAAqD;IACrD,IAAI,CAAC,uBAAuB,EAAE;QAC5B,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,6EAA6E,CAC9E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,wBAAwB;IACxB,IACE,CAAC,IAAA,eAAU,EAAC,uBAAuB,CAAC;QACpC,CAAC,IAAA,cAAS,EAAC,uBAAuB,CAAC,CAAC,WAAW,EAAE,EACjD;QACA,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CAAC,2BAA2B,uBAAuB,GAAG,CAAC,CAClE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,6CAA6C;IAC7C,MAAM,MAAM,GAAG,IAAA,oBAAS,EAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAClE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAA,qCAAiB,EAC7D,IAAA,WAAI,EAAC,uBAAuB,EAAE,SAAS,CAAC,CACzC,CAAC;QACF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,+BAA+B;IAC/B,MAAM,gBAAgB,GAAG,IAAA,mDAAiC,EAAC,MAAM,CAAC,CAAC;IAEnE,gBAAgB;IAChB,IAAA,sCAAkB,EAAC,MAAM,EAAE;QACzB,mBAAmB,EAAE,gBAAgB;KACtC,CAAC,CAAC;IAEH,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,sBAAsB,gBAAgB,CAAC,MAAM,+BAA+B,MAAM,GAAG,CACtF,CACF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"cli-consent-managers-to-business-entities.js","sourceRoot":"","sources":["../src/cli-consent-managers-to-business-entities.ts"],"names":[],"mappings":";;;;;;AACA,yCAAuC;AACvC,uDAAsE;AACtE,2DAA4E;AAC5E,+BAA4B;AAC5B,gEAAiC;AACjC,oDAA4B;AAC5B,qCAAkC;AAClC,2BAA2C;AAE3C;;;;;;;;;;;;GAYG;AACH,SAAS,IAAI;IACX,+BAA+B;IAC/B,MAAM,EACJ,uBAAuB,EACvB,MAAM,GAAG,kCAAkC,GAC5C,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,qDAAqD;IACrD,IAAI,CAAC,uBAAuB,EAAE;QAC5B,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,6EAA6E,CAC9E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,0BAA0B;IAC1B,IACE,CAAC,IAAA,eAAU,EAAC,uBAAuB,CAAC;QACpC,CAAC,IAAA,cAAS,EAAC,uBAAuB,CAAC,CAAC,WAAW,EAAE,EACjD;QACA,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CAAC,2BAA2B,uBAAuB,GAAG,CAAC,CAClE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,6CAA6C;IAC7C,MAAM,MAAM,GAAG,IAAA,oBAAS,EAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAClE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAA,qCAAiB,EAC7D,IAAA,WAAI,EAAC,uBAAuB,EAAE,SAAS,CAAC,CACzC,CAAC;QACF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,+BAA+B;IAC/B,MAAM,gBAAgB,GAAG,IAAA,mDAAiC,EAAC,MAAM,CAAC,CAAC;IAEnE,gBAAgB;IAChB,IAAA,sCAAkB,EAAC,MAAM,EAAE;QACzB,mBAAmB,EAAE,gBAAgB;KACtC,CAAC,CAAC;IAEH,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,sBAAsB,gBAAgB,CAAC,MAAM,+BAA+B,MAAM,GAAG,CACtF,CACF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli-derive-data-silos-from-data-flows-cross-instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-derive-data-silos-from-data-flows-cross-instance.d.ts","sourceRoot":"","sources":["../src/cli-derive-data-silos-from-data-flows-cross-instance.ts"],"names":[],"mappings":""}
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const graphql_1 = require("./graphql");
8
+ const path_1 = require("path");
9
+ const yargs_parser_1 = __importDefault(require("yargs-parser"));
10
+ const difference_1 = __importDefault(require("lodash/difference"));
11
+ const colors_1 = __importDefault(require("colors"));
12
+ const logger_1 = require("./logger");
13
+ const constants_1 = require("./constants");
14
+ const dataFlowsToDataSilos_1 = require("./consent-manager/dataFlowsToDataSilos");
15
+ const fs_1 = require("fs");
16
+ const api_keys_1 = require("./api-keys");
17
+ const readTranscendYaml_1 = require("./readTranscendYaml");
18
+ const requests_1 = require("./requests");
19
+ /**
20
+ * Derive the set of data silos from a set of data flows.
21
+ *
22
+ * Requires an API key - no scope required on API key
23
+ *
24
+ * Dev Usage:
25
+ * yarn ts-node ./src/cli-derive-data-silos-from-data-flows-cross-instance.ts --auth=$TRANSCEND_API_KEY \
26
+ * --dataFlowsYmlFolder=./working/data-flows/ \
27
+ * --output=./transcend.yml
28
+ *
29
+ * Standard usage:
30
+ * yarn tr-derive-data-silos-from-data-flows-cross-instance --auth=$TRANSCEND_API_KEY \
31
+ * --dataFlowsYmlFolder=./working/data-flows/ \
32
+ * --output=./transcend.yml
33
+ */
34
+ async function main() {
35
+ // Parse command line arguments
36
+ const { transcendUrl = constants_1.DEFAULT_TRANSCEND_API, auth, dataFlowsYmlFolder, output = 'transcend.yml', ignoreYmls = '', } = (0, yargs_parser_1.default)(process.argv.slice(2));
37
+ // Ensure auth is passed
38
+ if (!auth) {
39
+ logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
40
+ process.exit(1);
41
+ }
42
+ // Ensure folder is passed to dataFlowsYmlFolder
43
+ if (!dataFlowsYmlFolder) {
44
+ logger_1.logger.error(colors_1.default.red('Missing required arg: --dataFlowsYmlFolder=./working/data-flows/'));
45
+ process.exit(1);
46
+ }
47
+ // Ensure folder is passed
48
+ if (!(0, fs_1.existsSync)(dataFlowsYmlFolder) ||
49
+ !(0, fs_1.lstatSync)(dataFlowsYmlFolder).isDirectory()) {
50
+ logger_1.logger.error(colors_1.default.red(`Folder does not exist: "${dataFlowsYmlFolder}"`));
51
+ process.exit(1);
52
+ }
53
+ // Ignore the data flows in these yml files
54
+ const instancesToIgnore = (0, requests_1.splitCsvToList)(ignoreYmls).map((x) => x.split('.')[0]);
55
+ // Map over each data flow yml file and convert to data silo configurations
56
+ const dataSiloInputs = (0, api_keys_1.listFiles)(dataFlowsYmlFolder).map((directory) => {
57
+ // read in the data flows for a specific instance
58
+ const { 'data-flows': dataFlows = [] } = (0, readTranscendYaml_1.readTranscendYaml)((0, path_1.join)(dataFlowsYmlFolder, directory));
59
+ // map the data flows to data silos
60
+ const { adTechDataSilos, siteTechDataSilos } = (0, dataFlowsToDataSilos_1.dataFlowsToDataSilos)(dataFlows, {
61
+ serviceToSupportedIntegration,
62
+ serviceToTitle,
63
+ });
64
+ return {
65
+ adTechDataSilos,
66
+ siteTechDataSilos,
67
+ organizationName: directory.split('.')[0],
68
+ };
69
+ });
70
+ // Mapping from service name to instances that have that service
71
+ const serviceToInstance = {};
72
+ dataSiloInputs.forEach(({ adTechDataSilos, siteTechDataSilos, organizationName }) => {
73
+ const allDataSilos = [...adTechDataSilos, ...siteTechDataSilos];
74
+ allDataSilos.forEach((dataSilo) => {
75
+ const service = dataSilo['outer-type'] || dataSilo.integrationName;
76
+ // create mapping to instance
77
+ if (!serviceToInstance[service]) {
78
+ serviceToInstance[service] = [];
79
+ }
80
+ serviceToInstance[service].push(organizationName);
81
+ serviceToInstance[service] = [...new Set(serviceToInstance[service])];
82
+ });
83
+ });
84
+ // List of ad tech integrations
85
+ const adTechIntegrations = [
86
+ ...new Set(dataSiloInputs
87
+ .map(({ adTechDataSilos }) => adTechDataSilos.map((silo) => silo['outer-type'] || silo.integrationName))
88
+ .flat()),
89
+ ];
90
+ // List of site tech integrations
91
+ const siteTechIntegrations = (0, difference_1.default)([
92
+ ...new Set(dataSiloInputs
93
+ .map(({ siteTechDataSilos }) => siteTechDataSilos.map((silo) => silo['outer-type'] || silo.integrationName))
94
+ .flat()),
95
+ ], adTechIntegrations);
96
+ // Mapping from service name to list of
97
+ const serviceToFoundOnDomain = {};
98
+ dataSiloInputs.forEach(({ adTechDataSilos, siteTechDataSilos }) => {
99
+ const allDataSilos = [...adTechDataSilos, ...siteTechDataSilos];
100
+ allDataSilos.forEach((dataSilo) => {
101
+ var _a;
102
+ const service = dataSilo['outer-type'] || dataSilo.integrationName;
103
+ const foundOnDomain = (_a = dataSilo.attributes) === null || _a === void 0 ? void 0 : _a.find((attr) => attr.key === 'Found On Domain');
104
+ // create mapping to instance
105
+ if (!serviceToFoundOnDomain[service]) {
106
+ serviceToFoundOnDomain[service] = [];
107
+ }
108
+ serviceToFoundOnDomain[service].push(...((foundOnDomain === null || foundOnDomain === void 0 ? void 0 : foundOnDomain.values) || []));
109
+ serviceToFoundOnDomain[service] = [
110
+ ...new Set(serviceToFoundOnDomain[service]),
111
+ ];
112
+ });
113
+ });
114
+ // Fetch all integrations in the catalog
115
+ const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, auth);
116
+ const { serviceToTitle, serviceToSupportedIntegration } = await (0, graphql_1.fetchAndIndexCatalogs)(client);
117
+ // construct the aggregated data silo inputs
118
+ const dataSilos = [...adTechIntegrations, ...siteTechIntegrations].map((service) => ({
119
+ title: serviceToTitle[service],
120
+ ...(serviceToSupportedIntegration[service]
121
+ ? { integrationName: service }
122
+ : { integrationName: 'promptAPerson', 'outer-type': service }),
123
+ attributes: [
124
+ {
125
+ key: 'Tech Type',
126
+ values: ['Ad Tech'],
127
+ },
128
+ {
129
+ key: 'Business Units',
130
+ values: (0, difference_1.default)(serviceToInstance[service] || [], instancesToIgnore),
131
+ },
132
+ {
133
+ key: 'Found On Domain',
134
+ values: serviceToFoundOnDomain[service] || [],
135
+ },
136
+ ],
137
+ }));
138
+ // Log output
139
+ logger_1.logger.log(`Total Services: ${dataSilos.length}`);
140
+ logger_1.logger.log(`Ad Tech Services: ${adTechIntegrations.length}`);
141
+ logger_1.logger.log(`Site Tech Services: ${siteTechIntegrations.length}`);
142
+ // Write to yaml
143
+ (0, readTranscendYaml_1.writeTranscendYaml)(output, {
144
+ 'data-silos': dataSilos,
145
+ });
146
+ }
147
+ main();
148
+ //# sourceMappingURL=cli-derive-data-silos-from-data-flows-cross-instance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-derive-data-silos-from-data-flows-cross-instance.js","sourceRoot":"","sources":["../src/cli-derive-data-silos-from-data-flows-cross-instance.ts"],"names":[],"mappings":";;;;;;AACA,uCAA+E;AAC/E,+BAA4B;AAC5B,gEAAiC;AACjC,mEAA2C;AAC3C,oDAA4B;AAC5B,qCAAkC;AAClC,2CAAoD;AACpD,iFAA8E;AAE9E,2BAA2C;AAC3C,yCAAuC;AACvC,2DAA4E;AAC5E,yCAA4C;AAE5C;;;;;;;;;;;;;;GAcG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,YAAY,GAAG,iCAAqB,EACpC,IAAI,EACJ,kBAAkB,EAClB,MAAM,GAAG,eAAe,EACxB,UAAU,GAAG,EAAE,GAChB,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uFAAuF,CACxF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,gDAAgD;IAChD,IAAI,CAAC,kBAAkB,EAAE;QACvB,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,kEAAk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C,OAAO,CAAC;QAC9B,GAAG,CAAC,6BAA6B,CAAC,OAAO,CAAC;YACxC,CAAC,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE;YAC9B,CAAC,CAAC,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;QAChE,UAAU,EAAE;YACV;gBACE,GAAG,EAAE,WAAW;gBAChB,MAAM,EAAE,CAAC,SAAS,CAAC;aACpB;YACD;gBACE,GAAG,EAAE,gBAAgB;gBACrB,MAAM,EAAE,IAAA,oBAAU,EAChB,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,EAChC,iBAAiB,CAClB;aACF;YACD;gBACE,GAAG,EAAE,iBAAiB;gBACtB,MAAM,EAAE,sBAAsB,CAAC,OAAO,CAAC,IAAI,EAAE;aAC9C;SACF;KACF,CAAC,CACH,CAAC;IAEF,aAAa;IACb,eAAM,CAAC,GAAG,CAAC,mBAAmB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IAClD,eAAM,CAAC,GAAG,CAAC,qBAAqB,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7D,eAAM,CAAC,GAAG,CAAC,uBAAuB,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;IAEjE,gBAAgB;IAChB,IAAA,sCAAkB,EAAC,MAAM,EAAE;QACzB,YAAY,EAAE,SAAS;KACxB,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli-derive-data-silos-from-data-flows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-derive-data-silos-from-data-flows.d.ts","sourceRoot":"","sources":["../src/cli-derive-data-silos-from-data-flows.ts"],"names":[],"mappings":""}
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const graphql_1 = require("./graphql");
8
+ const path_1 = require("path");
9
+ const yargs_parser_1 = __importDefault(require("yargs-parser"));
10
+ const colors_1 = __importDefault(require("colors"));
11
+ const logger_1 = require("./logger");
12
+ const constants_1 = require("./constants");
13
+ const dataFlowsToDataSilos_1 = require("./consent-manager/dataFlowsToDataSilos");
14
+ const requests_1 = require("./requests");
15
+ const fs_1 = require("fs");
16
+ const api_keys_1 = require("./api-keys");
17
+ const readTranscendYaml_1 = require("./readTranscendYaml");
18
+ /**
19
+ * Derive the set of data silos that can be derived from a set of data flows.
20
+ *
21
+ * Requires an API key - no scope required on API key
22
+ *
23
+ * Dev Usage:
24
+ * yarn ts-node ./src/cli-derive-data-silos-from-data-flows.ts --auth=$TRANSCEND_API_KEY \
25
+ * --dataFlowsYmlFolder=./working/data-flows/ \
26
+ * --dataSilosYmlFolder=./working/data-silos/
27
+ *
28
+ * Standard usage:
29
+ * yarn tr-derive-data-silos-from-data-flows --auth=$TRANSCEND_API_KEY \
30
+ * --dataFlowsYmlFolder=./working/data-flows/ \
31
+ * --dataSilosYmlFolder=./working/data-silos/
32
+ */
33
+ async function main() {
34
+ // Parse command line arguments
35
+ const { transcendUrl = constants_1.DEFAULT_TRANSCEND_API, auth, dataFlowsYmlFolder, dataSilosYmlFolder, ignoreYmls = '', } = (0, yargs_parser_1.default)(process.argv.slice(2));
36
+ // Ensure auth is passed
37
+ if (!auth) {
38
+ logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
39
+ process.exit(1);
40
+ }
41
+ // Ensure folder is passed to dataFlowsYmlFolder
42
+ if (!dataFlowsYmlFolder) {
43
+ logger_1.logger.error(colors_1.default.red('Missing required arg: --dataFlowsYmlFolder=./working/data-flows/'));
44
+ process.exit(1);
45
+ }
46
+ // Ensure folder is passed
47
+ if (!(0, fs_1.existsSync)(dataFlowsYmlFolder) ||
48
+ !(0, fs_1.lstatSync)(dataFlowsYmlFolder).isDirectory()) {
49
+ logger_1.logger.error(colors_1.default.red(`Folder does not exist: "${dataFlowsYmlFolder}"`));
50
+ process.exit(1);
51
+ }
52
+ // Ensure folder is passed to dataSilosYmlFolder
53
+ if (!dataSilosYmlFolder) {
54
+ logger_1.logger.error(colors_1.default.red('Missing required arg: --dataSilosYmlFolder=./working/data-silos/'));
55
+ process.exit(1);
56
+ }
57
+ // Ensure folder is passed
58
+ if (!(0, fs_1.existsSync)(dataSilosYmlFolder) ||
59
+ !(0, fs_1.lstatSync)(dataSilosYmlFolder).isDirectory()) {
60
+ logger_1.logger.error(colors_1.default.red(`Folder does not exist: "${dataSilosYmlFolder}"`));
61
+ process.exit(1);
62
+ }
63
+ // Ignore the data flows in these yml files
64
+ const ymlsToIgnore = (0, requests_1.splitCsvToList)(ignoreYmls);
65
+ // Fetch all integrations in the catalog
66
+ const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, auth);
67
+ const { serviceToTitle, serviceToSupportedIntegration } = await (0, graphql_1.fetchAndIndexCatalogs)(client);
68
+ // List of each data flow yml file
69
+ (0, api_keys_1.listFiles)(dataFlowsYmlFolder).forEach((directory) => {
70
+ // read in the data flows for a specific instance
71
+ const { 'data-flows': dataFlows = [] } = (0, readTranscendYaml_1.readTranscendYaml)((0, path_1.join)(dataFlowsYmlFolder, directory));
72
+ // map the data flows to data silos
73
+ const { adTechDataSilos, siteTechDataSilos } = (0, dataFlowsToDataSilos_1.dataFlowsToDataSilos)(dataFlows, {
74
+ serviceToSupportedIntegration,
75
+ serviceToTitle,
76
+ });
77
+ // combine and write to yml file
78
+ const dataSilos = [...adTechDataSilos, ...siteTechDataSilos];
79
+ logger_1.logger.log(`Total Services: ${dataSilos.length}`);
80
+ logger_1.logger.log(`Ad Tech Services: ${adTechDataSilos.length}`);
81
+ logger_1.logger.log(`Site Tech Services: ${siteTechDataSilos.length}`);
82
+ (0, readTranscendYaml_1.writeTranscendYaml)((0, path_1.join)(dataSilosYmlFolder, directory), {
83
+ 'data-silos': ymlsToIgnore.includes(directory) ? [] : dataSilos,
84
+ });
85
+ });
86
+ }
87
+ main();
88
+ //# sourceMappingURL=cli-derive-data-silos-from-data-flows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-derive-data-silos-from-data-flows.js","sourceRoot":"","sources":["../src/cli-derive-data-silos-from-data-flows.ts"],"names":[],"mappings":";;;;;;AACA,uCAA+E;AAC/E,+BAA4B;AAC5B,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,2CAAoD;AACpD,iFAA8E;AAE9E,yCAA4C;AAC5C,2BAA2C;AAC3C,yCAAuC;AACvC,2DAA4E;AAE5E;;;;;;;;;;;;;;GAcG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,YAAY,GAAG,iCAAqB,EACpC,IAAI,EACJ,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,GAAG,EAAE,GAChB,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uFAAuF,CACxF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,gDAAgD;IAChD,IAAI,CAAC,kBAAkB,EAAE;QACvB,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,kEAAkE,CACnE,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,0BAA0B;IAC1B,IACE,CAAC,IAAA,eAAU,EAAC,kBAAkB,CAAC;QAC/B,CAAC,IAAA,cAAS,EAAC,kBAAkB,CAAC,CAAC,WAAW,EAAE,EAC5C;QACA,eAAM,CAAC,KAAK,CAAC,g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AC;QAEF,gCAAgC;QAChC,MAAM,SAAS,GAAG,CAAC,GAAG,eAAe,EAAE,GAAG,iBAAiB,CAAC,CAAC;QAC7D,eAAM,CAAC,GAAG,CAAC,mBAAmB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;QAClD,eAAM,CAAC,GAAG,CAAC,qBAAqB,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1D,eAAM,CAAC,GAAG,CAAC,uBAAuB,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC;QAC9D,IAAA,sCAAkB,EAAC,IAAA,WAAI,EAAC,kBAAkB,EAAE,SAAS,CAAC,EAAE;YACtD,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;SAChE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli-upload-cookies-from-csv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-upload-cookies-from-csv.d.ts","sourceRoot":"","sources":["../src/cli-upload-cookies-from-csv.ts"],"names":[],"mappings":""}
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const yargs_parser_1 = __importDefault(require("yargs-parser"));
8
+ const colors_1 = __importDefault(require("colors"));
9
+ const logger_1 = require("./logger");
10
+ const consent_manager_1 = require("./consent-manager");
11
+ const privacy_types_1 = require("@transcend-io/privacy-types");
12
+ const constants_1 = require("./constants");
13
+ /**
14
+ * Upload a CSV of cookies
15
+ *
16
+ * Requires an API key with follow scopes: https://app.transcend.io/infrastructure/api-keys
17
+ * - "Manage Consent Manager"
18
+ *
19
+ * Dev Usage:
20
+ * yarn ts-node ./src/cli-upload-cookies-from-csv.ts --auth=$TRANSCEND_API_KEY \
21
+ * --file=/Users/michaelfarrell/Desktop/test.csv \
22
+ * --trackerStatus=LIVE
23
+ *
24
+ * Standard usage:
25
+ * yarn tr-upload-cookies-from-csv --auth=$TRANSCEND_API_KEY \
26
+ * --file=/Users/michaelfarrell/Desktop/test.csv \
27
+ * --trackerStatus=LIVE
28
+ */
29
+ async function main() {
30
+ // Parse command line arguments
31
+ const { auth, trackerStatus, file = 'cookies.csv', transcendUrl = constants_1.DEFAULT_TRANSCEND_API, } = (0, yargs_parser_1.default)(process.argv.slice(2));
32
+ // Ensure auth is passed
33
+ if (!auth) {
34
+ logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
35
+ process.exit(1);
36
+ }
37
+ // Ensure trackerStatus is passed
38
+ const VALID_TRACKER_OPTIONS = Object.values(privacy_types_1.ConsentTrackerStatus);
39
+ if (!trackerStatus) {
40
+ logger_1.logger.error(colors_1.default.red('The trackerStatus must be provided. You can specify using --trackerStatus=LIVE. ' +
41
+ `Valid options include: ${VALID_TRACKER_OPTIONS.join(',')}`));
42
+ process.exit(1);
43
+ }
44
+ const consentTrackerStatus = trackerStatus;
45
+ if (!VALID_TRACKER_OPTIONS.includes(consentTrackerStatus)) {
46
+ logger_1.logger.error(colors_1.default.red(`The trackerStatus option was invalid, got: "${trackerStatus}". You can specify using --trackerStatus=LIVE. ` +
47
+ `Valid options include: ${VALID_TRACKER_OPTIONS.join(',')}`));
48
+ process.exit(1);
49
+ }
50
+ // Upload cookies
51
+ await (0, consent_manager_1.uploadCookiesFromCsv)({
52
+ auth,
53
+ trackerStatus: consentTrackerStatus,
54
+ file,
55
+ transcendUrl,
56
+ });
57
+ }
58
+ main();
59
+ //# sourceMappingURL=cli-upload-cookies-from-csv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-upload-cookies-from-csv.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AAC;QACzB,IAAI;QACJ,aAAa,EAAE,oBAAoB;QACnC,IAAI;QACJ,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
package/build/codecs.d.ts CHANGED
@@ -63378,4 +63378,26 @@ export declare const DataFlowCsvInput: t.IntersectionC<[t.TypeC<{
63378
63378
  }>, t.RecordC<t.StringC, t.StringC>]>;
63379
63379
  /** Type override */
63380
63380
  export type DataFlowCsvInput = t.TypeOf<typeof DataFlowCsvInput>;
63381
+ export declare const CookieCsvInput: t.IntersectionC<[t.TypeC<{
63382
+ /** The value of the cookie */
63383
+ Name: t.StringC;
63384
+ /** The CSV of purposes mapped to that cookie */
63385
+ Purpose: t.StringC;
63386
+ }>, t.PartialC<{
63387
+ /** The service that the cookie relates to */
63388
+ Service: t.StringC;
63389
+ /** Notes and descriptions for the cookie */
63390
+ Notes: t.StringC;
63391
+ /** Set of cookie owners */
63392
+ Owners: t.StringC;
63393
+ /** Set of cookie team owners */
63394
+ Teams: t.StringC;
63395
+ /** LIVE vs NEEDS_REVIEW aka Approved vs Triage */
63396
+ Status: t.KeyofC<{
63397
+ LIVE: unknown;
63398
+ NEEDS_REVIEW: unknown;
63399
+ }>;
63400
+ }>, t.RecordC<t.StringC, t.StringC>]>;
63401
+ /** Type override */
63402
+ export type CookieCsvInput = t.TypeOf<typeof CookieCsvInput>;
63381
63403
  //# sourceMappingURL=codecs.d.ts.map