@ht-sdks/consent-manager 0.1.0 → 0.2.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 (98) hide show
  1. package/commonjs/__tests__/consent-manager/dialog.test.js +33 -0
  2. package/commonjs/__tests__/consent-manager-builder/analytics.test.js +53 -46
  3. package/commonjs/__tests__/consent-manager-builder/index.todo.js +48 -87
  4. package/commonjs/__tests__/consent-manager-builder/preferences.test.js +34 -27
  5. package/commonjs/__tests__/index.test.js +12 -12
  6. package/commonjs/consent-manager/banner.js +35 -19
  7. package/commonjs/consent-manager/buttons.js +5 -5
  8. package/commonjs/consent-manager/cancel-dialog.js +26 -10
  9. package/commonjs/consent-manager/categories.js +2 -2
  10. package/commonjs/consent-manager/container.js +2 -3
  11. package/commonjs/consent-manager/dialog.js +39 -23
  12. package/commonjs/consent-manager/font-styles.js +2 -2
  13. package/commonjs/consent-manager/index.js +41 -25
  14. package/commonjs/consent-manager/preference-dialog.js +36 -20
  15. package/commonjs/consent-manager-builder/analytics.js +3 -5
  16. package/commonjs/consent-manager-builder/index.js +30 -30
  17. package/commonjs/consent-manager-builder/preferences.js +22 -16
  18. package/commonjs/index.js +5 -4
  19. package/commonjs/standalone.js +25 -11
  20. package/esm/__tests__/consent-manager/dialog.test.js +28 -0
  21. package/esm/__tests__/consent-manager-builder/analytics.test.js +41 -34
  22. package/esm/__tests__/consent-manager-builder/index.todo.js +34 -73
  23. package/esm/__tests__/consent-manager-builder/preferences.test.js +30 -23
  24. package/esm/consent-manager/banner.js +5 -3
  25. package/esm/consent-manager/buttons.js +4 -4
  26. package/esm/consent-manager/cancel-dialog.js +4 -2
  27. package/esm/consent-manager/categories.js +2 -2
  28. package/esm/consent-manager/container.js +1 -1
  29. package/esm/consent-manager/dialog.js +7 -5
  30. package/esm/consent-manager/font-styles.js +2 -2
  31. package/esm/consent-manager/index.js +19 -17
  32. package/esm/consent-manager/preference-dialog.js +7 -5
  33. package/esm/consent-manager-builder/analytics.js +2 -4
  34. package/esm/consent-manager-builder/index.js +26 -26
  35. package/esm/consent-manager-builder/preferences.js +17 -11
  36. package/esm/index.js +4 -3
  37. package/esm/standalone.js +3 -3
  38. package/esm/types.js +1 -0
  39. package/package.json +62 -67
  40. package/src/__tests__/consent-manager/dialog.test.tsx +42 -0
  41. package/src/__tests__/consent-manager-builder/analytics.test.ts +40 -33
  42. package/src/__tests__/consent-manager-builder/index.todo.js +52 -95
  43. package/src/__tests__/consent-manager-builder/preferences.test.ts +31 -21
  44. package/src/consent-manager/banner.tsx +11 -11
  45. package/src/consent-manager/buttons.tsx +26 -10
  46. package/src/consent-manager/cancel-dialog.tsx +1 -1
  47. package/src/consent-manager/categories.ts +2 -2
  48. package/src/consent-manager/container.tsx +14 -17
  49. package/src/consent-manager/dialog.tsx +4 -4
  50. package/src/consent-manager/font-styles.tsx +12 -2
  51. package/src/consent-manager/index.tsx +27 -29
  52. package/src/consent-manager/preference-dialog.tsx +13 -11
  53. package/src/consent-manager-builder/analytics.ts +5 -5
  54. package/src/consent-manager-builder/index.tsx +28 -28
  55. package/src/consent-manager-builder/preferences.ts +20 -14
  56. package/src/index.ts +8 -4
  57. package/src/standalone.tsx +1 -1
  58. package/src/types.ts +8 -2
  59. package/standalone/consent-manager.js +5 -10
  60. package/standalone/consent-manager.js.map +1 -1
  61. package/types/consent-manager/banner.d.ts +1 -1
  62. package/types/consent-manager/buttons.d.ts +6 -7
  63. package/types/consent-manager/cancel-dialog.d.ts +1 -1
  64. package/types/consent-manager/index.d.ts +3 -3
  65. package/types/consent-manager/preference-dialog.d.ts +1 -1
  66. package/types/consent-manager-builder/analytics.d.ts +1 -1
  67. package/types/consent-manager-builder/index.d.ts +7 -8
  68. package/types/consent-manager-builder/preferences.d.ts +4 -6
  69. package/types/index.d.ts +1 -1
  70. package/types/types.d.ts +14 -10
  71. package/commonjs/__tests__/consent-manager-builder/fetch-destinations.test.js +0 -155
  72. package/commonjs/consent-manager-builder/fetch-destinations.js +0 -104
  73. package/esm/__tests__/consent-manager-builder/fetch-destinations.test.js +0 -150
  74. package/esm/consent-manager-builder/fetch-destinations.js +0 -98
  75. package/src/__tests__/consent-manager-builder/fetch-destinations.test.ts +0 -89
  76. package/src/consent-manager-builder/fetch-destinations.ts +0 -50
  77. package/types/consent-manager-builder/fetch-destinations.d.ts +0 -2
  78. package/types/src/__tests__/consent-manager-builder/analytics.test.d.ts +0 -1
  79. package/types/src/__tests__/consent-manager-builder/fetch-destinations.test.d.ts +0 -1
  80. package/types/src/__tests__/consent-manager-builder/preferences.test.d.ts +0 -1
  81. package/types/src/__tests__/index.test.d.ts +0 -1
  82. package/types/src/consent-manager/banner.d.ts +0 -21
  83. package/types/src/consent-manager/buttons.d.ts +0 -13
  84. package/types/src/consent-manager/cancel-dialog.d.ts +0 -19
  85. package/types/src/consent-manager/categories.d.ts +0 -3
  86. package/types/src/consent-manager/container.d.ts +0 -35
  87. package/types/src/consent-manager/dialog.d.ts +0 -29
  88. package/types/src/consent-manager/font-styles.d.ts +0 -2
  89. package/types/src/consent-manager/index.d.ts +0 -35
  90. package/types/src/consent-manager/preference-dialog.d.ts +0 -32
  91. package/types/src/consent-manager-builder/analytics.d.ts +0 -14
  92. package/types/src/consent-manager-builder/fetch-destinations.d.ts +0 -2
  93. package/types/src/consent-manager-builder/index.d.ts +0 -126
  94. package/types/src/consent-manager-builder/preferences.d.ts +0 -26
  95. package/types/src/index.d.ts +0 -7
  96. package/types/src/standalone.d.ts +0 -5
  97. package/types/src/types.d.ts +0 -130
  98. /package/types/__tests__/{consent-manager-builder/fetch-destinations.test.d.ts → consent-manager/dialog.test.d.ts} +0 -0
@@ -1,150 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import nock from 'nock';
38
- import fetchDestinations from '../../consent-manager-builder/fetch-destinations';
39
- describe('fetchDestinations', function () {
40
- test('Returns destinations for a writekey', function () { return __awaiter(void 0, void 0, void 0, function () {
41
- var _a;
42
- return __generator(this, function (_b) {
43
- switch (_b.label) {
44
- case 0:
45
- nock('https://cdn.hightouch-events.com')
46
- .get('/v1/projects/123/integrations')
47
- .reply(200, [
48
- {
49
- name: 'Google Analytics',
50
- creationName: 'Google Analytics'
51
- },
52
- {
53
- name: 'Amplitude',
54
- creationName: 'Amplitude'
55
- }
56
- ]);
57
- _a = expect;
58
- return [4 /*yield*/, fetchDestinations('cdn.hightouch-events.com', ['123'])];
59
- case 1:
60
- _a.apply(void 0, [_b.sent()]).toMatchObject([
61
- {
62
- id: 'Amplitude',
63
- name: 'Amplitude'
64
- },
65
- {
66
- id: 'Google Analytics',
67
- name: 'Google Analytics'
68
- }
69
- ]);
70
- return [2 /*return*/];
71
- }
72
- });
73
- }); });
74
- test('Renames creationName to id', function () { return __awaiter(void 0, void 0, void 0, function () {
75
- var _a;
76
- return __generator(this, function (_b) {
77
- switch (_b.label) {
78
- case 0:
79
- nock('https://cdn.hightouch-events.com')
80
- .get('/v1/projects/123/integrations')
81
- .reply(200, [
82
- {
83
- name: 'New Amplitude',
84
- creationName: 'Old Amplitude'
85
- }
86
- ]);
87
- _a = expect;
88
- return [4 /*yield*/, fetchDestinations('cdn.hightouch-events.com', ['123'])];
89
- case 1:
90
- _a.apply(void 0, [_b.sent()]).toMatchObject([
91
- {
92
- id: 'Old Amplitude',
93
- name: 'New Amplitude'
94
- }
95
- ]);
96
- return [2 /*return*/];
97
- }
98
- });
99
- }); });
100
- test('Doesn՚t include duplicate destinations', function () { return __awaiter(void 0, void 0, void 0, function () {
101
- var _a;
102
- return __generator(this, function (_b) {
103
- switch (_b.label) {
104
- case 0:
105
- nock('https://cdn.hightouch-events.com')
106
- .get('/v1/projects/123/integrations')
107
- .reply(200, [
108
- {
109
- name: 'Google Analytics',
110
- creationName: 'Google Analytics'
111
- },
112
- {
113
- name: 'Amplitude',
114
- creationName: 'Amplitude'
115
- }
116
- ])
117
- .get('/v1/projects/abc/integrations')
118
- .reply(200, [
119
- {
120
- name: 'Google Analytics',
121
- creationName: 'Google Analytics'
122
- },
123
- {
124
- name: 'FullStory',
125
- creationName: 'FullStory'
126
- }
127
- ]);
128
- _a = expect;
129
- return [4 /*yield*/, fetchDestinations('cdn.hightouch-events.com', ['123', 'abc'])];
130
- case 1:
131
- _a.apply(void 0, [_b.sent()]).toMatchObject([
132
- {
133
- id: 'Amplitude',
134
- name: 'Amplitude'
135
- },
136
- {
137
- id: 'FullStory',
138
- name: 'FullStory'
139
- },
140
- {
141
- id: 'Google Analytics',
142
- name: 'Google Analytics'
143
- }
144
- ]);
145
- return [2 /*return*/];
146
- }
147
- });
148
- }); });
149
- });
150
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmV0Y2gtZGVzdGluYXRpb25zLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvX190ZXN0c19fL2NvbnNlbnQtbWFuYWdlci1idWlsZGVyL2ZldGNoLWRlc3RpbmF0aW9ucy50ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLE9BQU8sSUFBSSxNQUFNLE1BQU0sQ0FBQTtBQUN2QixPQUFPLGlCQUFpQixNQUFNLGtEQUFrRCxDQUFBO0FBRWhGLFFBQVEsQ0FBQyxtQkFBbUIsRUFBRTtJQUM1QixJQUFJLENBQUMscUNBQXFDLEVBQUU7Ozs7O29CQUMxQyxJQUFJLENBQUMsa0NBQWtDLENBQUM7eUJBQ3JDLEdBQUcsQ0FBQywrQkFBK0IsQ0FBQzt5QkFDcEMsS0FBSyxDQUFDLEdBQUcsRUFBRTt3QkFDVjs0QkFDRSxJQUFJLEVBQUUsa0JBQWtCOzRCQUN4QixZQUFZLEVBQUUsa0JBQWtCO3lCQUNqQzt3Qk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this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import fetch from 'isomorphic-fetch';
38
- import flatten from 'lodash/flatten';
39
- import sortedUniqBy from 'lodash/sortedUniqBy';
40
- import sortBy from 'lodash/sortBy';
41
- function fetchDestinationForWriteKey(cdnHost, writeKey) {
42
- return __awaiter(this, void 0, void 0, function () {
43
- var res, destinations, _i, destinations_1, destination;
44
- return __generator(this, function (_a) {
45
- switch (_a.label) {
46
- case 0: return [4 /*yield*/, fetch("https://" + cdnHost + "/v1/projects/" + writeKey + "/integrations")];
47
- case 1:
48
- res = _a.sent();
49
- if (!res.ok) {
50
- throw new Error("Failed to fetch integrations for write key " + writeKey + ": HTTP " + res.status + " " + res.statusText);
51
- }
52
- return [4 /*yield*/, res.json()
53
- // Rename creationName to id to abstract the weird data model
54
- ];
55
- case 2:
56
- destinations = _a.sent();
57
- // Rename creationName to id to abstract the weird data model
58
- for (_i = 0, destinations_1 = destinations; _i < destinations_1.length; _i++) {
59
- destination = destinations_1[_i];
60
- // Because of the legacy Fullstory integration the creationName for this integration is the `name`
61
- if (destination.name === 'Fullstory') {
62
- destination.id = destination.name;
63
- }
64
- else {
65
- destination.id = destination.creationName;
66
- }
67
- delete destination.creationName;
68
- }
69
- return [2 /*return*/, destinations];
70
- }
71
- });
72
- });
73
- }
74
- export default function fetchDestinations(cdnHost, writeKeys) {
75
- return __awaiter(this, void 0, void 0, function () {
76
- var destinationsRequests, _i, writeKeys_1, writeKey, destinations, _a;
77
- return __generator(this, function (_b) {
78
- switch (_b.label) {
79
- case 0:
80
- destinationsRequests = [];
81
- for (_i = 0, writeKeys_1 = writeKeys; _i < writeKeys_1.length; _i++) {
82
- writeKey = writeKeys_1[_i];
83
- destinationsRequests.push(fetchDestinationForWriteKey(cdnHost, writeKey));
84
- }
85
- _a = flatten;
86
- return [4 /*yield*/, Promise.all(destinationsRequests)];
87
- case 1:
88
- destinations = _a.apply(void 0, [_b.sent()]);
89
- // Remove the dummy Repeater destination
90
- destinations = destinations.filter(function (d) { return d.id !== 'Repeater'; });
91
- destinations = sortBy(destinations, ['id']);
92
- destinations = sortedUniqBy(destinations, 'id');
93
- return [2 /*return*/, destinations];
94
- }
95
- });
96
- });
97
- }
98
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmV0Y2gtZGVzdGluYXRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnNlbnQtbWFuYWdlci1idWlsZGVyL2ZldGNoLWRlc3RpbmF0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxPQUFPLEtBQUssTUFBTSxrQkFBa0IsQ0FBQTtBQUNwQyxPQUFPLE9BQU8sTUFBTSxnQkFBZ0IsQ0FBQTtBQUNwQyxPQUFPLFlBQVksTUFBTSxxQkFBcUIsQ0FBQTtBQUM5QyxPQUFPLE1BQU0sTUFBTSxlQUFlLENBQUE7QUFHbEMsU0FBZSwyQkFBMkIsQ0FDeEMsT0FBZSxFQUNmLFFBQWdCOzs7Ozt3QkFFSixxQkFBTSxLQUFLLENBQUMsYUFBVyxPQUFPLHFCQUFnQixRQUFRLGtCQUFlLENBQUMsRUFBQTs7b0JBQTVFLEdBQUcsR0FBRyxTQUFzRTtvQkFFbEYsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUU7d0JBQ1gsTUFBTSxJQUFJLEtBQUssQ0FDYixnREFBOEMsUUFBUSxlQUFVLEdBQUcsQ0FBQyxNQUFNLFNBQUksR0FBRyxDQUFDLFVBQVksQ0FDL0YsQ0FBQTtxQkFDRjtvQkFFb0IscUJBQU0sR0FBRyxDQUFDLElBQUksRUFBRTt3QkFFckMsNkRBQTZEO3NCQUZ4Qjs7b0JBQS9CLFlBQ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RCxZQUFZLEdBQUcsTUFBTSxDQUFDLFlBQVksRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUE7b0JBQzNDLFlBQVksR0FBRyxZQUFZLENBQUMsWUFBWSxFQUFFLElBQUksQ0FBQyxDQUFBO29CQUMvQyxzQkFBTyxZQUFZLEVBQUE7Ozs7Q0FDcEIifQ==
@@ -1,89 +0,0 @@
1
- import nock from 'nock'
2
- import fetchDestinations from '../../consent-manager-builder/fetch-destinations'
3
-
4
- describe('fetchDestinations', () => {
5
- test('Returns destinations for a writekey', async () => {
6
- nock('https://cdn.hightouch-events.com')
7
- .get('/v1/projects/123/integrations')
8
- .reply(200, [
9
- {
10
- name: 'Google Analytics',
11
- creationName: 'Google Analytics'
12
- },
13
- {
14
- name: 'Amplitude',
15
- creationName: 'Amplitude'
16
- }
17
- ])
18
-
19
- expect(await fetchDestinations('cdn.hightouch-events.com', ['123'])).toMatchObject([
20
- {
21
- id: 'Amplitude',
22
- name: 'Amplitude'
23
- },
24
- {
25
- id: 'Google Analytics',
26
- name: 'Google Analytics'
27
- }
28
- ])
29
- })
30
-
31
- test('Renames creationName to id', async () => {
32
- nock('https://cdn.hightouch-events.com')
33
- .get('/v1/projects/123/integrations')
34
- .reply(200, [
35
- {
36
- name: 'New Amplitude',
37
- creationName: 'Old Amplitude'
38
- }
39
- ])
40
-
41
- expect(await fetchDestinations('cdn.hightouch-events.com', ['123'])).toMatchObject([
42
- {
43
- id: 'Old Amplitude',
44
- name: 'New Amplitude'
45
- }
46
- ])
47
- })
48
-
49
- test('Doesn՚t include duplicate destinations', async () => {
50
- nock('https://cdn.hightouch-events.com')
51
- .get('/v1/projects/123/integrations')
52
- .reply(200, [
53
- {
54
- name: 'Google Analytics',
55
- creationName: 'Google Analytics'
56
- },
57
- {
58
- name: 'Amplitude',
59
- creationName: 'Amplitude'
60
- }
61
- ])
62
- .get('/v1/projects/abc/integrations')
63
- .reply(200, [
64
- {
65
- name: 'Google Analytics',
66
- creationName: 'Google Analytics'
67
- },
68
- {
69
- name: 'FullStory',
70
- creationName: 'FullStory'
71
- }
72
- ])
73
-
74
- expect(await fetchDestinations('cdn.hightouch-events.com', ['123', 'abc'])).toMatchObject([
75
- {
76
- id: 'Amplitude',
77
- name: 'Amplitude'
78
- },
79
- {
80
- id: 'FullStory',
81
- name: 'FullStory'
82
- },
83
- {
84
- id: 'Google Analytics',
85
- name: 'Google Analytics'
86
- }
87
- ])
88
- })
89
- })
@@ -1,50 +0,0 @@
1
- import fetch from 'isomorphic-fetch'
2
- import flatten from 'lodash/flatten'
3
- import sortedUniqBy from 'lodash/sortedUniqBy'
4
- import sortBy from 'lodash/sortBy'
5
- import { Destination } from '../types'
6
-
7
- async function fetchDestinationForWriteKey(
8
- cdnHost: string,
9
- writeKey: string
10
- ): Promise<Destination[]> {
11
- const res = await fetch(`https://${cdnHost}/v1/projects/${writeKey}/integrations`)
12
-
13
- if (!res.ok) {
14
- throw new Error(
15
- `Failed to fetch integrations for write key ${writeKey}: HTTP ${res.status} ${res.statusText}`
16
- )
17
- }
18
-
19
- const destinations = await res.json()
20
-
21
- // Rename creationName to id to abstract the weird data model
22
- for (const destination of destinations) {
23
- // Because of the legacy Fullstory integration the creationName for this integration is the `name`
24
- if (destination.name === 'Fullstory') {
25
- destination.id = destination.name
26
- } else {
27
- destination.id = destination.creationName
28
- }
29
- delete destination.creationName
30
- }
31
-
32
- return destinations
33
- }
34
-
35
- export default async function fetchDestinations(
36
- cdnHost: string,
37
- writeKeys: string[]
38
- ): Promise<Destination[]> {
39
- const destinationsRequests: Promise<Destination[]>[] = []
40
- for (const writeKey of writeKeys) {
41
- destinationsRequests.push(fetchDestinationForWriteKey(cdnHost, writeKey))
42
- }
43
-
44
- let destinations = flatten(await Promise.all(destinationsRequests))
45
- // Remove the dummy Repeater destination
46
- destinations = destinations.filter(d => d.id !== 'Repeater')
47
- destinations = sortBy(destinations, ['id'])
48
- destinations = sortedUniqBy(destinations, 'id')
49
- return destinations
50
- }
@@ -1,2 +0,0 @@
1
- import { Destination } from '../types';
2
- export default function fetchDestinations(cdnHost: string, writeKeys: string[]): Promise<Destination[]>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- import React, { PureComponent } from 'react';
2
- import { ActionsBlockProps } from '../types';
3
- interface BannerProps {
4
- innerRef: (node: HTMLElement | null) => void;
5
- onClose: () => void;
6
- onChangePreferences: () => void;
7
- content: React.ReactNode;
8
- subContent: string | undefined;
9
- actionsBlock?: ((props: ActionsBlockProps) => React.ReactElement) | true;
10
- backgroundColor: string;
11
- textColor: string;
12
- onAcceptAll: () => void;
13
- onDenyAll: () => void;
14
- hideCloseButton: boolean;
15
- asModal?: boolean;
16
- }
17
- export default class Banner extends PureComponent<BannerProps> {
18
- static displayName: string;
19
- render(): JSX.Element;
20
- }
21
- export {};
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const DefaultButton: import("@emotion/styled").StyledComponent<{
3
- theme?: import("@emotion/react").Theme | undefined;
4
- as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").FunctionComponent<any> | "big" | "keygen" | "menuitem" | "noindex" | "webview" | "animate" | "animateMotion" | "animateTransform" | "feDropShadow" | "mpath" | import("react").ComponentClass<any, any> | undefined;
5
- }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
6
- export declare const GreenButton: import("@emotion/styled").StyledComponent<{
7
- theme?: import("@emotion/react").Theme | undefined;
8
- as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").FunctionComponent<any> | "big" | "keygen" | "menuitem" | "noindex" | "webview" | "animate" | "animateMotion" | "animateTransform" | "feDropShadow" | "mpath" | import("react").ComponentClass<any, any> | undefined;
9
- }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
10
- export declare const RedButton: import("@emotion/styled").StyledComponent<{
11
- theme?: import("@emotion/react").Theme | undefined;
12
- as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").FunctionComponent<any> | "big" | "keygen" | "menuitem" | "noindex" | "webview" | "animate" | "animateMotion" | "animateTransform" | "feDropShadow" | "mpath" | import("react").ComponentClass<any, any> | undefined;
13
- }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
@@ -1,19 +0,0 @@
1
- import React, { PureComponent } from 'react';
2
- import { PreferenceDialogTemplate } from '../types';
3
- interface Props {
4
- innerRef: (node: HTMLElement) => void;
5
- onBack: () => void;
6
- onConfirm: () => void;
7
- title: React.ReactNode;
8
- content: React.ReactNode;
9
- preferencesDialogTemplate?: PreferenceDialogTemplate;
10
- }
11
- export default class CancelDialog extends PureComponent<Props> {
12
- static displayName: string;
13
- render(): JSX.Element;
14
- componentDidMount(): void;
15
- componentWillUnmount(): void;
16
- handleSubmit: (e: any) => void;
17
- handleEsc: (e: KeyboardEvent) => void;
18
- }
19
- export {};
@@ -1,3 +0,0 @@
1
- export declare const MARKETING_AND_ANALYTICS_CATEGORIES: string[];
2
- export declare const ADVERTISING_CATEGORIES: string[];
3
- export declare const FUNCTIONAL_CATEGORIES: string[];
@@ -1,35 +0,0 @@
1
- import React from 'react';
2
- import { Destination, CategoryPreferences, CustomCategories, DefaultDestinationBehavior, ActionsBlockProps, PreferenceDialogTemplate, CloseBehavior } from '../types';
3
- export declare function openDialog(): void;
4
- export interface CloseBehaviorFunction {
5
- (categories: CategoryPreferences): CategoryPreferences;
6
- }
7
- interface ContainerProps {
8
- setPreferences: (prefs: CategoryPreferences) => void;
9
- saveConsent: (newPreferences?: CategoryPreferences, shouldReload?: boolean, devMode?: boolean) => void;
10
- resetPreferences: () => void;
11
- closeBehavior?: CloseBehavior | CloseBehaviorFunction;
12
- destinations: Destination[];
13
- customCategories?: CustomCategories | undefined;
14
- newDestinations: Destination[];
15
- preferences: CategoryPreferences;
16
- havePreferencesChanged: boolean;
17
- isConsentRequired: boolean;
18
- implyConsentOnInteraction: boolean;
19
- bannerContent: React.ReactNode;
20
- bannerSubContent: string | undefined;
21
- bannerActionsBlock?: ((props: ActionsBlockProps) => React.ReactElement) | true;
22
- bannerTextColor: string;
23
- bannerBackgroundColor: string;
24
- bannerHideCloseButton: boolean;
25
- bannerAsModal?: boolean;
26
- preferencesDialogTitle: React.ReactNode;
27
- preferencesDialogContent: React.ReactNode;
28
- cancelDialogTitle: React.ReactNode;
29
- cancelDialogContent: React.ReactNode;
30
- workspaceAddedNewDestinations?: boolean;
31
- defaultDestinationBehavior?: DefaultDestinationBehavior;
32
- preferencesDialogTemplate?: PreferenceDialogTemplate;
33
- }
34
- declare const Container: React.FC<ContainerProps>;
35
- export default Container;
@@ -1,29 +0,0 @@
1
- import React, { PureComponent } from 'react';
2
- interface DialogProps {
3
- innerRef: (element: HTMLElement | null) => void;
4
- onCancel?: () => void;
5
- onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
6
- title: React.ReactNode;
7
- buttons: React.ReactNode;
8
- width?: string;
9
- }
10
- export default class Dialog extends PureComponent<DialogProps, {}> {
11
- static displayName: string;
12
- private titleId;
13
- private container;
14
- private root;
15
- private form;
16
- static defaultProps: {
17
- onCancel: undefined;
18
- width: string;
19
- };
20
- constructor(props: DialogProps);
21
- render(): React.ReactPortal;
22
- componentDidMount(): void;
23
- componentWillUnmount(): void;
24
- handleRootRef: (node: HTMLElement) => void;
25
- handleFormRef: (node: HTMLFormElement) => void;
26
- handleOverlayClick: (e: any) => void;
27
- handleEsc: (e: KeyboardEvent) => void;
28
- }
29
- export {};
@@ -1,2 +0,0 @@
1
- declare const _default: import("@emotion/react").SerializedStyles;
2
- export default _default;
@@ -1,35 +0,0 @@
1
- import { PureComponent } from 'react';
2
- import { CategoryPreferences, Destination, ConsentManagerProps, PreferenceDialogTemplate } from '../types';
3
- export default class ConsentManager extends PureComponent<ConsentManagerProps, {}> {
4
- static displayName: string;
5
- static defaultProps: {
6
- options: undefined;
7
- shouldRequireConsent: () => boolean;
8
- implyConsentOnInteraction: boolean;
9
- onError: undefined;
10
- cookieDomain: undefined;
11
- cookieName: undefined;
12
- cookieExpires: undefined;
13
- cookieAttributes: {};
14
- customCategories: undefined;
15
- bannerActionsBlock: undefined;
16
- bannerHideCloseButton: boolean;
17
- bannerTextColor: string;
18
- bannerContent: string;
19
- bannerSubContent: string;
20
- bannerBackgroundColor: string;
21
- preferencesDialogTitle: string;
22
- preferencesDialogContent: JSX.Element;
23
- cancelDialogTitle: string;
24
- cancelDialogContent: string;
25
- defaultDestinationBehavior: string;
26
- preferencesDialogTemplate: PreferenceDialogTemplate;
27
- };
28
- render(): JSX.Element;
29
- mergeTemplates: (newProps: PreferenceDialogTemplate, defaultPreferencesDialogTemplate: PreferenceDialogTemplate) => PreferenceDialogTemplate;
30
- getInitialPreferences: () => {};
31
- handleMapCustomPreferences: (destinations: Destination[], preferences: CategoryPreferences) => {
32
- destinationPreferences: {};
33
- customPreferences: {};
34
- };
35
- }
@@ -1,32 +0,0 @@
1
- import React, { PureComponent } from 'react';
2
- import { Destination, CustomCategories, CategoryPreferences, PreferenceDialogTemplate } from '../types';
3
- interface PreferenceDialogProps {
4
- innerRef: (element: HTMLElement | null) => void;
5
- onCancel: () => void;
6
- onSave: () => void;
7
- onChange: (name: string, value: boolean) => void;
8
- marketingDestinations: Destination[];
9
- advertisingDestinations: Destination[];
10
- functionalDestinations: Destination[];
11
- marketingAndAnalytics?: boolean | null;
12
- advertising?: boolean | null;
13
- functional?: boolean | null;
14
- customCategories?: CustomCategories;
15
- destinations: Destination[];
16
- preferences: CategoryPreferences;
17
- title: React.ReactNode;
18
- content: React.ReactNode;
19
- preferencesDialogTemplate?: PreferenceDialogTemplate;
20
- }
21
- export default class PreferenceDialog extends PureComponent<PreferenceDialogProps, {}> {
22
- static displayName: string;
23
- static defaultProps: {
24
- marketingAndAnalytics: null;
25
- advertising: null;
26
- functional: null;
27
- };
28
- render(): JSX.Element;
29
- handleChange: (e: any) => void;
30
- handleSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
31
- }
32
- export {};
@@ -1,14 +0,0 @@
1
- import { Destination, DefaultDestinationBehavior, CategoryPreferences, HtEventsBrowserOptions } from '../types';
2
- interface AnalyticsParams {
3
- writeKey: string;
4
- options?: HtEventsBrowserOptions;
5
- destinations: Destination[];
6
- destinationPreferences: CategoryPreferences | null | undefined;
7
- isConsentRequired: boolean;
8
- shouldReload?: boolean;
9
- devMode?: boolean;
10
- defaultDestinationBehavior?: DefaultDestinationBehavior;
11
- categoryPreferences: CategoryPreferences | null | undefined;
12
- }
13
- export default function conditionallyLoadAnalytics({ writeKey, options, destinations, destinationPreferences, isConsentRequired, shouldReload, devMode, defaultDestinationBehavior, categoryPreferences }: AnalyticsParams): void;
14
- export {};