@transcend-io/cli 4.72.0 → 4.73.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 CHANGED
@@ -73,22 +73,26 @@
73
73
  - [Authentication](#authentication-15)
74
74
  - [Arguments](#arguments-15)
75
75
  - [Usage](#usage-16)
76
- - [tr-pull-consent-metrics](#tr-pull-consent-metrics)
76
+ - [tr-consent-managers-to-business-entities](#tr-consent-managers-to-business-entities)
77
77
  - [Authentication](#authentication-16)
78
78
  - [Arguments](#arguments-16)
79
79
  - [Usage](#usage-17)
80
- - [tr-upload-data-flows-from-csv](#tr-upload-data-flows-from-csv)
80
+ - [tr-pull-consent-metrics](#tr-pull-consent-metrics)
81
81
  - [Authentication](#authentication-17)
82
82
  - [Arguments](#arguments-17)
83
83
  - [Usage](#usage-18)
84
- - [tr-generate-api-keys](#tr-generate-api-keys)
84
+ - [tr-upload-data-flows-from-csv](#tr-upload-data-flows-from-csv)
85
85
  - [Authentication](#authentication-18)
86
86
  - [Arguments](#arguments-18)
87
87
  - [Usage](#usage-19)
88
- - [tr-build-xdi-sync-endpoint](#tr-build-xdi-sync-endpoint)
88
+ - [tr-generate-api-keys](#tr-generate-api-keys)
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)
93
+ - [Authentication](#authentication-20)
94
+ - [Arguments](#arguments-20)
95
+ - [Usage](#usage-21)
92
96
  - [Proxy usage](#proxy-usage)
93
97
 
94
98
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -123,6 +127,7 @@ yarn tr-mark-request-data-silos-completed --auth=$TRANSCEND_API_KEY
123
127
  yarn tr-skip-request-data-silos --auth=$TRANSCEND_API_KEY
124
128
  yarn tr-retry-request-data-silos --auth=$TRANSCEND_API_KEY
125
129
  yarn tr-update-consent-manager --auth=$TRANSCEND_API_KEY
130
+ yarn tr-consent-managers-to-business-entities --auth=$TRANSCEND_API_KEY
126
131
  yarn tr-pull-consent-metrics --auth=$TRANSCEND_API_KEY
127
132
  yarn tr-upload-data-flows-from-csv --auth=$TRANSCEND_API_KEY
128
133
  yarn tr-generate-api-keys --auth=$TRANSCEND_API_KEY
@@ -152,6 +157,7 @@ tr-skip-request-data-silos --auth=$TRANSCEND_API_KEY
152
157
  tr-retry-request-data-silos --auth=$TRANSCEND_API_KEY
153
158
  tr-update-consent-manager --auth=$TRANSCEND_API_KEY
154
159
  tr-pull-consent-metrics --auth=$TRANSCEND_API_KEY
160
+ tr-consent-managers-to-business-entities --auth=$TRANSCEND_API_KEY
155
161
  tr-upload-data-flows-from-csv --auth=$TRANSCEND_API_KEY
156
162
  tr-generate-api-keys --auth=$TRANSCEND_API_KEY
157
163
  tr-build-xdi-sync-endpoint --auth=$TRANSCEND_API_KEY
@@ -1457,6 +1463,35 @@ tr-generate-api-keys --email=test@transcend.io --password=$TRANSCEND_PASSWORD -
1457
1463
  yarn tr-update-consent-manager --auth=./transcend-api-keys.json --deploy=true
1458
1464
  ```
1459
1465
 
1466
+ ### tr-consent-managers-to-business-entities
1467
+
1468
+ This command allows for converting a folder or Consent Manager `transcend.yml` files into a single `transcend.yml` file where each consent manager configuration is a Business Entity in the data inventory.
1469
+
1470
+ #### Authentication
1471
+
1472
+ No authentication is required to run this command. It reads and writes files from local disk.
1473
+
1474
+ #### Arguments
1475
+
1476
+ | Argument | Description | Type | Default | Required |
1477
+ | ----------------------- | ---------------------------------------------------------------------- | -------------------- | -------------------------------- | -------- |
1478
+ | consentManagerYmlFolder | Path to the folder of Consent Manager `transcend.yml` files to combine | string - folder-path | N/A | true |
1479
+ | output | Path to the output `transcend.yml` with business entity configuration | string - file-path | ./combined-business-entities.yml | false |
1480
+
1481
+ #### Usage
1482
+
1483
+ Combine files in folder `./working/consent-managers/` to file `./combined-business-entities.yml`
1484
+
1485
+ ```sh
1486
+ yarn tr-consent-managers-to-business-entities --consentManagerYmlFolder=./working/consent-managers/
1487
+ ```
1488
+
1489
+ Specify custom output file
1490
+
1491
+ ```sh
1492
+ yarn tr-consent-managers-to-business-entities --consentManagerYmlFolder=./working/consent-managers/ --output=./custom.yml
1493
+ ```
1494
+
1460
1495
  ### tr-pull-consent-metrics
1461
1496
 
1462
1497
  This command allows for pulling consent manager metrics for a Transcend account, or a set of Transcend accounts.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env/node
2
+ export {};
3
+ //# sourceMappingURL=cli-consent-managers-to-business-entities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-consent-managers-to-business-entities.d.ts","sourceRoot":"","sources":["../src/cli-consent-managers-to-business-entities.ts"],"names":[],"mappings":""}
@@ -0,0 +1,56 @@
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 api_keys_1 = require("./api-keys");
8
+ const consent_manager_1 = require("./consent-manager");
9
+ const readTranscendYaml_1 = require("./readTranscendYaml");
10
+ const path_1 = require("path");
11
+ const yargs_parser_1 = __importDefault(require("yargs-parser"));
12
+ const colors_1 = __importDefault(require("colors"));
13
+ const logger_1 = require("./logger");
14
+ const fs_1 = require("fs");
15
+ /**
16
+ * Combines folder of consent manager `transcend.yml` files into a single `transcend.yml` file
17
+ * where each consent manager configuration is created as a business entity.
18
+ *
19
+ * yarn ts-node ./src/cli-consent-managers-to-business-entities.ts \
20
+ * --consentManagerYmlFolder=./working/consent-managers/ \
21
+ * --output=./combined-business-entities.yml
22
+ *
23
+ * Standard usage:
24
+ * yarn tr-consent-managers-to-business-entities \
25
+ * --consentManagerYmlFolder=./working/consent-managers/ \
26
+ * --output=./combined-business-entities.yml
27
+ */
28
+ function main() {
29
+ // Parse command line arguments
30
+ const { consentManagerYmlFolder, output = './combined-business-entities.yml', } = (0, yargs_parser_1.default)(process.argv.slice(2));
31
+ // Ensure folder is passed to consentManagerYmlFolder
32
+ if (!consentManagerYmlFolder) {
33
+ logger_1.logger.error(colors_1.default.red('Missing required arg: --consentManagerYmlFolder=./working/consent-managers/'));
34
+ process.exit(1);
35
+ }
36
+ // Ensure file is passed
37
+ if (!(0, fs_1.existsSync)(consentManagerYmlFolder) ||
38
+ !(0, fs_1.lstatSync)(consentManagerYmlFolder).isDirectory()) {
39
+ logger_1.logger.error(colors_1.default.red(`Folder does not exist: "${consentManagerYmlFolder}"`));
40
+ process.exit(1);
41
+ }
42
+ // Read in each consent manager configuration
43
+ const inputs = (0, api_keys_1.listFiles)(consentManagerYmlFolder).map((directory) => {
44
+ const { 'consent-manager': consentManager } = (0, readTranscendYaml_1.readTranscendYaml)((0, path_1.join)(consentManagerYmlFolder, directory));
45
+ return { name: directory, input: consentManager };
46
+ });
47
+ // Convert to business entities
48
+ const businessEntities = (0, consent_manager_1.consentManagersToBusinessEntities)(inputs);
49
+ // write to disk
50
+ (0, readTranscendYaml_1.writeTranscendYaml)(output, {
51
+ 'business-entities': businessEntities,
52
+ });
53
+ logger_1.logger.info(colors_1.default.green(`Successfully wrote ${businessEntities.length} business entities to file "${output}"`));
54
+ }
55
+ main();
56
+ //# sourceMappingURL=cli-consent-managers-to-business-entities.js.map
@@ -0,0 +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,CAA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../../src/consent-manager/buildXdiSyncEndpoint.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,aAAa,GAAG;KAAG,CAAC,IAAI,MAAM,GAAG,MAAM,EAAE;CAAE,CAAC;AAExD,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,QAEuI,CAAC;AAWrK;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,EAChC,EACE,WAAW,EACX,YAAoC,EACpC,iBAAwB,EACxB,eAA+B,EAC/B,kBAA0C,GAC3C,EAAE;IACD,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yFAAyF;IACzF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,0BAA0B;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GACA,OAAO,CAAC;IACT,gCAAgC;IAChC,UAAU,EAAE,aAAa,CAAC;IAC1B,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAwED"}
1
+ {"version":3,"file":"buildXdiSyncEndpoint.d.ts","sourceRoot":"","sources":["../../src/consent-manager/buildXdiSyncEndpoint.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAKzC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,aAAa,GAAG;KAAG,CAAC,IAAI,MAAM,GAAG,MAAM,EAAE;CAAE,CAAC;AAExD,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,QAEuI,CAAC;AAErK;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,EAChC,EACE,WAAW,EACX,YAAoC,EACpC,iBAAwB,EACxB,eAA+B,EAC/B,kBAA0C,GAC3C,EAAE;IACD,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yFAAyF;IACzF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,0BAA0B;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GACA,OAAO,CAAC;IACT,gCAAgC;IAChC,UAAU,EAAE,aAAa,CAAC;IAC1B,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAwED"}
@@ -10,17 +10,11 @@ const difference_1 = __importDefault(require("lodash/difference"));
10
10
  const bluebird_1 = require("bluebird");
11
11
  const constants_1 = require("../constants");
12
12
  const logger_1 = require("../logger");
13
+ const domainToHost_1 = require("./domainToHost");
13
14
  /** Regular expression for IP addresses - remove these from sync endpoint */
14
15
  exports.IP_ADDRESS_REGEX =
15
16
  // eslint-disable-next-line max-len
16
17
  /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
17
- /**
18
- * Convert a domain to host
19
- *
20
- * @param domain - e.g. test.acme.com
21
- * @returns Host acme.com
22
- */
23
- const domainToHost = (domain) => new URL(`https://${domain}`).hostname.split('.').slice(-2).join('.');
24
18
  /**
25
19
  * Build the sync endpoint definition for a set of Transcend accounts
26
20
  *
@@ -61,7 +55,7 @@ async function buildXdiSyncEndpoint(apiKeys, { xdiLocation, transcendUrl = const
61
55
  .filter(
62
56
  // ignore IP addresses
63
57
  (domain) => !removeIpAddresses || !exports.IP_ADDRESS_REGEX.test(domain))
64
- .map((domain) => domainToHost(domain)),
58
+ .map((domain) => (0, domainToHost_1.domainToHost)(domain)),
65
59
  // ignore block list
66
60
  domainBlockList);
67
61
  // merge existing sync group with hosts for this consent manager
@@ -1 +1 @@
1
- {"version":3,"file":"buildXdiSyncEndpoint.js","sourceRoot":"","sources":["../../src/consent-manager/buildXdiSyncEndpoint.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,wCAA8E;AAC9E,mEAA2C;AAC3C,uCAA+B;AAE/B,4CAAqD;AACrD,sCAAmC;AAgBnC,4EAA4E;AAC/D,QAAA,gBAAgB;AAC3B,mCAAmC;AACnC,kKAAkK,CAAC;AAErK;;;;;GAKG;AACH,MAAM,YAAY,GAAG,CAAC,MAAc,EAAU,EAAE,CAC9C,IAAI,GAAG,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEvE;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CACxC,OAAgC,EAChC,EACE,WAAW,EACX,YAAY,GAAG,iCAAqB,EACpC,iBAAiB,GAAG,IAAI,EACxB,eAAe,GAAG,CAAC,WAAW,CAAC,EAC/B,kBAAkB,GAAG,qBAAqB,GAY3C;IAOD,2BAA2B;IAC3B,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAC1C,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;IAEpE,uCAAuC;IACvC,MAAM,eAAe,GAAG,MAAM,IAAA,cAAG,EAC/B,aAAa,EACb,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,OAAO,CACZ,+CAA+C,MAAM,CAAC,gBAAgB,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,MAAM,gBAAgB,GAAG;;;OAGpB,WAAW;oBACE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;qBAClC,kBAAkB;;CAEtC,CAAC;IAEA,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,UAAU;KACX,CAAC;AACJ,CAAC;AAjGD,oDAiGC"}
@@ -0,0 +1,14 @@
1
+ import { BusinessEntityInput, ConsentManagerInput } from '../codecs';
2
+ /**
3
+ * Combine multiple consent manager configurations into a list of business entity configurations
4
+ *
5
+ * @param inputs - Consent manager configurations to combine
6
+ * @returns Business entity configuration input
7
+ */
8
+ export declare function consentManagersToBusinessEntities(inputs: {
9
+ /** Name of business entity */
10
+ name: string;
11
+ /** Consent manager input */
12
+ input?: ConsentManagerInput;
13
+ }[]): BusinessEntityInput[];
14
+ //# sourceMappingURL=consentManagersToBusinessEntities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consentManagersToBusinessEntities.d.ts","sourceRoot":"","sources":["../../src/consent-manager/consentManagersToBusinessEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrE;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE;IACN,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,EAAE,GACF,mBAAmB,EAAE,CA2DvB"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.consentManagersToBusinessEntities = void 0;
4
+ const logger_1 = require("../logger");
5
+ /**
6
+ * Combine multiple consent manager configurations into a list of business entity configurations
7
+ *
8
+ * @param inputs - Consent manager configurations to combine
9
+ * @returns Business entity configuration input
10
+ */
11
+ function consentManagersToBusinessEntities(inputs) {
12
+ // Construct the business entities YAML definition
13
+ const businessEntities = inputs.map(({ name, input }) => ({
14
+ // Title of Transcend Instance
15
+ title: name.replace('.yml', ''),
16
+ attributes: [
17
+ // Sync domain list
18
+ ...((input === null || input === void 0 ? void 0 : input.domains)
19
+ ? [
20
+ {
21
+ key: 'Transcend Domain List',
22
+ values: [...new Set(input.domains)],
23
+ },
24
+ ]
25
+ : []),
26
+ // Sync bundle URLs
27
+ ...((input === null || input === void 0 ? void 0 : input.bundleUrls)
28
+ ? [
29
+ {
30
+ key: 'Airgap Production URL',
31
+ values: [input.bundleUrls.PRODUCTION],
32
+ },
33
+ {
34
+ key: 'Airgap Test URL',
35
+ values: [input.bundleUrls.TEST],
36
+ },
37
+ {
38
+ key: 'Airgap XDI URL',
39
+ values: [
40
+ input.bundleUrls.PRODUCTION.replace('airgap.js', 'xdi.js'),
41
+ ],
42
+ },
43
+ ]
44
+ : []),
45
+ // Sync partition keys
46
+ ...((input === null || input === void 0 ? void 0 : input.partition)
47
+ ? [
48
+ {
49
+ key: 'Consent Partition Key',
50
+ values: [input.partition],
51
+ },
52
+ ]
53
+ : []),
54
+ ],
55
+ }));
56
+ // Log out info on airgap scripts to host
57
+ logger_1.logger.info('\n\n~~~~~~~~~~~\nAirgap scripts to host:');
58
+ businessEntities.forEach(({ attributes, title }, ind) => {
59
+ var _a, _b;
60
+ (_b = (_a = attributes === null || attributes === void 0 ? void 0 : attributes.find((attr) => attr.key === 'Airgap Production URL')) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b.forEach((url) => {
61
+ logger_1.logger.info(`${ind}) ${title} - ${url}`);
62
+ });
63
+ });
64
+ return businessEntities;
65
+ }
66
+ exports.consentManagersToBusinessEntities = consentManagersToBusinessEntities;
67
+ //# sourceMappingURL=consentManagersToBusinessEntities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consentManagersToBusinessEntities.js","sourceRoot":"","sources":["../../src/consent-manager/consentManagersToBusinessEntities.ts"],"names":[],"mappings":";;;AACA,sCAAmC;AAEnC;;;;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AAC;SACR;KACF,CAAC,CACH,CAAC;IAEF,yCAAyC;IACzC,eAAM,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;IACxD,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;;QACtD,MAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CACN,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,uBAAuB,CAAC,0CACpD,MAAM,0CAAE,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACxB,eAAM,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,KAAK,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAlED,8EAkEC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Convert a domain to host
3
+ *
4
+ * @param domain - e.g. test.acme.com
5
+ * @returns Host acme.com
6
+ */
7
+ export declare const domainToHost: (domain: string) => string;
8
+ //# sourceMappingURL=domainToHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domainToHost.d.ts","sourceRoot":"","sources":["../../src/consent-manager/domainToHost.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,MACwB,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.domainToHost = void 0;
4
+ /**
5
+ * Convert a domain to host
6
+ *
7
+ * @param domain - e.g. test.acme.com
8
+ * @returns Host acme.com
9
+ */
10
+ const domainToHost = (domain) => new URL(`https://${domain}`).hostname.split('.').slice(-2).join('.');
11
+ exports.domainToHost = domainToHost;
12
+ //# sourceMappingURL=domainToHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domainToHost.js","sourceRoot":"","sources":["../../src/consent-manager/domainToHost.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACI,MAAM,YAAY,GAAG,CAAC,MAAc,EAAU,EAAE,CACrD,IAAI,GAAG,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAD1D,QAAA,YAAY,gBAC8C"}
@@ -2,4 +2,6 @@ export * from './updateConsentManagerVersionToLatest';
2
2
  export * from './uploadDataFlowsFromCsv';
3
3
  export * from './pullConsentManagerMetrics';
4
4
  export * from './buildXdiSyncEndpoint';
5
+ export * from './consentManagersToBusinessEntities';
6
+ export * from './domainToHost';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/consent-manager/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/consent-manager/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gBAAgB,CAAC"}
@@ -18,4 +18,6 @@ __exportStar(require("./updateConsentManagerVersionToLatest"), exports);
18
18
  __exportStar(require("./uploadDataFlowsFromCsv"), exports);
19
19
  __exportStar(require("./pullConsentManagerMetrics"), exports);
20
20
  __exportStar(require("./buildXdiSyncEndpoint"), exports);
21
+ __exportStar(require("./consentManagersToBusinessEntities"), exports);
22
+ __exportStar(require("./domainToHost"), exports);
21
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/consent-manager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wEAAsD;AACtD,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/consent-manager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wEAAsD;AACtD,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC;AACvC,sEAAoD;AACpD,iDAA+B"}