@google-psat/common 0.12.0 → 0.13.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/dist/attributionReporting.types.js +3 -0
- package/dist/attributionReporting.types.js.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/protectedAudience.types.js +3 -0
- package/dist/protectedAudience.types.js.map +1 -0
- package/dist/utils/contextSelector/shallowEqual.js +2 -16
- package/dist/utils/contextSelector/shallowEqual.js.map +1 -1
- package/dist/utils/extractReportData.js +1 -16
- package/dist/utils/extractReportData.js.map +1 -1
- package/dist/utils/sessionStorage.js +78 -0
- package/dist/utils/sessionStorage.js.map +1 -0
- package/dist-types/attributionReporting.types.d.ts +22 -0
- package/dist-types/index.d.ts +3 -0
- package/dist-types/protectedAudience.types.d.ts +61 -0
- package/dist-types/utils/sessionStorage.d.ts +16 -0
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributionReporting.types.js","sourceRoot":"","sources":["../src/attributionReporting.types.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -94,8 +94,11 @@ var extractReportData_1 = require("./utils/extractReportData");
|
|
|
94
94
|
Object.defineProperty(exports, "extractReportData", { enumerable: true, get: function () { return __importDefault(extractReportData_1).default; } });
|
|
95
95
|
var reshapeCookies_1 = require("./utils/reshapeCookies");
|
|
96
96
|
Object.defineProperty(exports, "reshapeCookies", { enumerable: true, get: function () { return __importDefault(reshapeCookies_1).default; } });
|
|
97
|
+
__exportStar(require("./utils/sessionStorage"), exports);
|
|
97
98
|
__exportStar(require("./worker/enums"), exports);
|
|
98
99
|
__exportStar(require("./utils/generateReports"), exports);
|
|
99
100
|
__exportStar(require("./cookies.types"), exports);
|
|
100
101
|
__exportStar(require("./libraryDetection.types"), exports);
|
|
102
|
+
__exportStar(require("./protectedAudience.types"), exports);
|
|
103
|
+
__exportStar(require("./attributionReporting.types"), exports);
|
|
101
104
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;AAEH,qDAA+D;AAAtD,6HAAA,OAAO,OAAgB;AAChC,2EAAqF;AAA5E,mJAAA,OAAO,OAA2B;AAC3C,qEAA+E;AAAtE,6IAAA,OAAO,OAAwB;AACxC,qDAA+D;AAAtD,6HAAA,OAAO,OAAgB;AAChC,iEAGoC;AAFlC,yIAAA,OAAO,OAAsB;AAC7B,oHAAA,cAAc,OAAA;AAEhB,iFAA2F;AAAlF,yJAAA,OAAO,OAA8B;AAC9C,qFAA+F;AAAtF,6JAAA,OAAO,OAAgC;AAChD,+DAA4E;AAAnE,0IAAA,OAAO,OAAwB;AACxC,+DAAyE;AAAhE,uIAAA,OAAO,OAAqB;AACrC,6CAA4C;AAAnC,oGAAA,QAAQ,OAAA;AACjB,yDAAmE;AAA1D,iIAAA,OAAO,OAAkB;AAClC,yCAAuB;AACvB,yFAAmG;AAA1F,iKAAA,OAAO,OAAkC;AAClD,2FAAqG;AAA5F,mKAAA,OAAO,OAAmC;AACnD,6DAAuE;AAA9D,qIAAA,OAAO,OAAoB;AACpC,iDAA2D;AAAlD,yHAAA,OAAO,OAAc;AAC9B,qCAA+C;AAAtC,6GAAA,OAAO,OAAQ;AACxB,wDAAqE;AAA5D,kIAAA,OAAO,OAAoB;AACpC,kFAA4F;AAAnF,yJAAA,OAAO,OAA8B;AAC9C,uDAAiE;AAAxD,+HAAA,OAAO,OAAiB;AACjC,0DAAwC;AACxC,qDAAgF;AAAvE,6HAAA,OAAO,OAAgB;AAChC,uCAAiD;AAAxC,+GAAA,OAAO,OAAS;AACzB,+CAAyD;AAAhD,uHAAA,OAAO,OAAa;AAC7B,uEAAiF;AAAxE,+IAAA,OAAO,OAAyB;AACzC,iEAA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uDAAiE;AAAxD,+HAAA,OAAO,OAAiB;AACjC,0DAAwC;AACxC,qDAAgF;AAAvE,6HAAA,OAAO,OAAgB;AAChC,uCAAiD;AAAxC,+GAAA,OAAO,OAAS;AACzB,+CAAyD;AAAhD,uHAAA,OAAO,OAAa;AAC7B,uEAAiF;AAAxE,+IAAA,OAAO,OAAyB;AACzC,iEAA2E;AAAlE,yIAAA,OAAO,OAAsB;AACtC,qEAA+E;AAAtE,6IAAA,OAAO,OAAwB;AACxC,qEAA+E;AAAtE,6IAAA,OAAO,OAAwB;AACxC,yDAAmE;AAA1D,iIAAA,OAAO,OAAkB;AAClC,+DAAyE;AAAhE,uIAAA,OAAO,OAAqB;AACrC,yDAAmE;AAA1D,iIAAA,OAAO,OAAkB;AAClC,yDAAuC;AACvC,iDAA+B;AAC/B,0DAAwC;AACxC,kDAAgC;AAChC,2DAAyC;AACzC,4DAA0C;AAC1C,+DAA6C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protectedAudience.types.js","sourceRoot":"","sources":["../src/protectedAudience.types.ts"],"names":[],"mappings":""}
|
|
@@ -19,23 +19,9 @@ exports.shallowEqual = void 0;
|
|
|
19
19
|
/**
|
|
20
20
|
* External dependencies
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const lodash_es_1 = require("lodash-es");
|
|
23
23
|
const shallowEqual = (a, b) => {
|
|
24
|
-
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
28
|
-
if (typeof a[0] === 'object' &&
|
|
29
|
-
typeof b[0] === 'object' &&
|
|
30
|
-
a.length === b.length) {
|
|
31
|
-
return a.every((item, index) => (0, shallow_equal_1.shallowEqualObjects)(item, b[index]));
|
|
32
|
-
}
|
|
33
|
-
return (0, shallow_equal_1.shallowEqualArrays)(a, b);
|
|
34
|
-
}
|
|
35
|
-
if (typeof a === 'object' && typeof b === 'object') {
|
|
36
|
-
return (0, shallow_equal_1.shallowEqualObjects)(a, b);
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
24
|
+
return (0, lodash_es_1.isEqual)(a, b);
|
|
39
25
|
};
|
|
40
26
|
exports.shallowEqual = shallowEqual;
|
|
41
27
|
//# sourceMappingURL=shallowEqual.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shallowEqual.js","sourceRoot":"","sources":["../../../src/utils/contextSelector/shallowEqual.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"shallowEqual.js","sourceRoot":"","sources":["../../../src/utils/contextSelector/shallowEqual.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,yCAAoC;AAE7B,MAAM,YAAY,GAAG,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE;IAC9D,OAAO,IAAA,mBAAO,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvB,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright 2023 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
@@ -21,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
6
|
const extractCookies_1 = __importDefault(require("./extractCookies"));
|
|
22
7
|
const extractReportData = (data) => {
|
|
23
8
|
const landingPageCookies = {};
|
|
24
|
-
const erroredOutUrlsData = [];
|
|
25
9
|
const consolidatedLibraryMatches = {};
|
|
10
|
+
const erroredOutUrlsData = [];
|
|
26
11
|
data.forEach(({ cookieData, pageUrl, libraryMatches, erroredOutUrls }) => {
|
|
27
12
|
erroredOutUrlsData.push(...(erroredOutUrls !== null && erroredOutUrls !== void 0 ? erroredOutUrls : []));
|
|
28
13
|
if (erroredOutUrls &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractReportData.js","sourceRoot":"","sources":["../../src/utils/extractReportData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractReportData.js","sourceRoot":"","sources":["../../src/utils/extractReportData.ts"],"names":[],"mappings":";;;;;AAwBA,sEAA8C;AAE9C,MAAM,iBAAiB,GAAG,CAAC,IAAoB,EAAE,EAAE;IACjD,MAAM,kBAAkB,GAAG,EAAE,CAAC;IAC9B,MAAM,0BAA0B,GAAmC,EAAE,CAAC;IACtE,MAAM,kBAAkB,GAAyB,EAAE,CAAC;IAEpD,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,EAAE;QACvE,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,EAAE,CAAC,CAAC,CAAC;QAEnD,IACE,cAAc;YACd,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,EAC9D,CAAC;YACD,OAAO;QACT,CAAC;QAED,gBAAgB,CACd,IAAA,wBAAc,EA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MAAM,CAAC,cAAc,IAAI,EAAE,CAAC;qBACjC,CAAC;iBACH,GACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.getSessionStorage = exports.updateSessionStorage = void 0;
|
|
28
|
+
/**
|
|
29
|
+
* Updates session storage for the current tab with the given items.
|
|
30
|
+
* The items are stored under a key format: `{tabId}-{name}-{key}`.
|
|
31
|
+
* @param {SessionData} items - The session data to be stored.
|
|
32
|
+
* @param {string} name - A namespace to distinguish different storage sets (e.g., "persistentSetting").
|
|
33
|
+
* @returns {Promise<SessionData>} - The updated session data.
|
|
34
|
+
*/
|
|
35
|
+
const updateSessionStorage = (items, name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
const tabId = chrome.devtools.inspectedWindow.tabId;
|
|
37
|
+
if (!tabId) {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
let newData = undefined;
|
|
41
|
+
if (items) {
|
|
42
|
+
newData = Object.fromEntries(Object.entries(items).map(([key, value]) => [
|
|
43
|
+
`${tabId}-${name}-${key}`,
|
|
44
|
+
value,
|
|
45
|
+
]));
|
|
46
|
+
yield chrome.storage.session.set(newData);
|
|
47
|
+
}
|
|
48
|
+
return newData;
|
|
49
|
+
});
|
|
50
|
+
exports.updateSessionStorage = updateSessionStorage;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves session storage for the current tab, grouping stored data by tab ID.
|
|
53
|
+
* The function filters data based on the provided name (namespace).
|
|
54
|
+
* @param {string} name - A namespace to filter session storage keys (e.g., "persistentSetting").
|
|
55
|
+
* @returns {Promise<Record<string, any>>} - The session data grouped under the current tab ID.
|
|
56
|
+
*/
|
|
57
|
+
const getSessionStorage = (name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
+
const data = (yield chrome.storage.session.get()) || {};
|
|
59
|
+
const groupedData = {};
|
|
60
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
61
|
+
const match = key.match(new RegExp(`^(\\d+)-${name}-(.+)$`));
|
|
62
|
+
if (match) {
|
|
63
|
+
const tabId = match[1];
|
|
64
|
+
const originalKey = match[2];
|
|
65
|
+
if (!groupedData[tabId]) {
|
|
66
|
+
groupedData[tabId] = {};
|
|
67
|
+
}
|
|
68
|
+
groupedData[tabId][originalKey] = value;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
groupedData[key] = value;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const tabId = chrome.devtools.inspectedWindow.tabId;
|
|
75
|
+
return groupedData[tabId] || {};
|
|
76
|
+
});
|
|
77
|
+
exports.getSessionStorage = getSessionStorage;
|
|
78
|
+
//# sourceMappingURL=sessionStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionStorage.js","sourceRoot":"","sources":["../../src/utils/sessionStorage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAIH;;;;;;GAMG;AACI,MAAM,oBAAoB,GAAG,CAClC,KAAkB,EAClB,IAAY,EACU,EAAE;IACxB,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC;IAEpD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,OAAO,GAAgB,SAAS,CAAC;IAErC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,GAAG,MAAM,CAAC,WAAW,CAC1B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;YAC1C,GAAG,KAAK,IAAI,IAAI,IAAI,GAAG,EAAE;YACzB,KAAK;SACN,CAAC,CACH,CAAC;QAEF,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAA,CAAC;AAxBW,QAAA,oBAAoB,wBAwB/B;AAEF;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAC/B,IAAY,EACkB,EAAE;IAChC,MAAM,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;IAExD,MAAM,WAAW,GAAwB,EAAE,CAAC;IAE5C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC5C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,CAAC,CAAC;QAE7D,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YAE7B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxB,WAAW,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAC1B,CAAC;YACD,WAAW,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC;IAEpD,OAAO,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;AAClC,CAAC,CAAA,CAAC;AA1BW,QAAA,iBAAiB,qBA0B5B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import Protocol from 'devtools-protocol';
|
|
5
|
+
export type Event = 'sourceRegistration' | 'triggerRegistration';
|
|
6
|
+
export type SourcesRegistration = Protocol.Storage.AttributionReportingSourceRegistration & {
|
|
7
|
+
requestUrl: string;
|
|
8
|
+
result: string;
|
|
9
|
+
index: number;
|
|
10
|
+
tabId: string;
|
|
11
|
+
};
|
|
12
|
+
export type TriggerRegistration = Protocol.Storage.AttributionReportingTriggerRegistration & {
|
|
13
|
+
requestUrl: string;
|
|
14
|
+
eventLevel: Protocol.Storage.AttributionReportingEventLevelResult;
|
|
15
|
+
aggregatable: Protocol.Storage.AttributionReportingAggregatableResult;
|
|
16
|
+
index: number;
|
|
17
|
+
time: number;
|
|
18
|
+
destination?: string;
|
|
19
|
+
reportingOrigin?: string;
|
|
20
|
+
tabId: string;
|
|
21
|
+
};
|
|
22
|
+
export type SourcesData = SourcesRegistration | TriggerRegistration;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -29,7 +29,10 @@ export { default as getLegendDescription } from './utils/getLegendDescription';
|
|
|
29
29
|
export { default as extractCookies } from './utils/extractCookies';
|
|
30
30
|
export { default as extractReportData } from './utils/extractReportData';
|
|
31
31
|
export { default as reshapeCookies } from './utils/reshapeCookies';
|
|
32
|
+
export * from './utils/sessionStorage';
|
|
32
33
|
export * from './worker/enums';
|
|
33
34
|
export * from './utils/generateReports';
|
|
34
35
|
export * from './cookies.types';
|
|
35
36
|
export * from './libraryDetection.types';
|
|
37
|
+
export * from './protectedAudience.types';
|
|
38
|
+
export * from './attributionReporting.types';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Protocol } from 'devtools-protocol';
|
|
5
|
+
export interface singleAuctionEvent {
|
|
6
|
+
bidCurrency?: string;
|
|
7
|
+
uniqueAuctionId?: Protocol.Storage.InterestGroupAuctionId;
|
|
8
|
+
bid?: number;
|
|
9
|
+
name?: string;
|
|
10
|
+
ownerOrigin?: string;
|
|
11
|
+
type: string;
|
|
12
|
+
formattedTime: string | Date;
|
|
13
|
+
componentSellerOrigin?: string;
|
|
14
|
+
time: number;
|
|
15
|
+
auctionConfig?: object;
|
|
16
|
+
interestGroupConfig?: Protocol.Storage.InterestGroupAccessedEvent;
|
|
17
|
+
parentAuctionId?: Protocol.Storage.InterestGroupAuctionId;
|
|
18
|
+
eventType: 'interestGroupAuctionEventOccurred' | 'interestGroupAuctionNetworkRequestCompleted' | 'interestGroupAuctionNetworkRequestCreated' | 'interestGroupAccessed';
|
|
19
|
+
}
|
|
20
|
+
export interface auctionData {
|
|
21
|
+
[uniqueAuctionId: Protocol.Storage.InterestGroupAuctionId]: {
|
|
22
|
+
auctionTime: Protocol.Network.TimeSinceEpoch;
|
|
23
|
+
auctionConfig?: any;
|
|
24
|
+
parentAuctionId?: Protocol.Storage.InterestGroupAuctionId;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export type InterestGroups = singleAuctionEvent & {
|
|
28
|
+
details: any;
|
|
29
|
+
};
|
|
30
|
+
export type MultiSellerAuction = {
|
|
31
|
+
[parentAuctionId: string]: {
|
|
32
|
+
[uniqueAuctionId: string]: singleAuctionEvent[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type SingleSellerAuction = {
|
|
36
|
+
[parentAuctionId: string]: singleAuctionEvent[];
|
|
37
|
+
};
|
|
38
|
+
export type NoBidsType = {
|
|
39
|
+
[auctionId: string]: {
|
|
40
|
+
ownerOrigin: string;
|
|
41
|
+
name: string;
|
|
42
|
+
uniqueAuctionId: string;
|
|
43
|
+
adUnitCode?: string;
|
|
44
|
+
mediaContainerSize?: number[][];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export type AdsAndBiddersTypeData = {
|
|
48
|
+
adUnitCode: string;
|
|
49
|
+
bidders: string[];
|
|
50
|
+
mediaContainerSize: number[][];
|
|
51
|
+
winningBid: number;
|
|
52
|
+
bidCurrency: string;
|
|
53
|
+
winningBidder: string;
|
|
54
|
+
};
|
|
55
|
+
export type AdsAndBiddersType = {
|
|
56
|
+
[adUnitCode: string]: AdsAndBiddersTypeData;
|
|
57
|
+
};
|
|
58
|
+
export type ReceivedBids = singleAuctionEvent & {
|
|
59
|
+
adUnitCode?: string;
|
|
60
|
+
mediaContainerSize?: number[][];
|
|
61
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type SessionData = Record<string, unknown> | undefined;
|
|
2
|
+
/**
|
|
3
|
+
* Updates session storage for the current tab with the given items.
|
|
4
|
+
* The items are stored under a key format: `{tabId}-{name}-{key}`.
|
|
5
|
+
* @param {SessionData} items - The session data to be stored.
|
|
6
|
+
* @param {string} name - A namespace to distinguish different storage sets (e.g., "persistentSetting").
|
|
7
|
+
* @returns {Promise<SessionData>} - The updated session data.
|
|
8
|
+
*/
|
|
9
|
+
export declare const updateSessionStorage: (items: SessionData, name: string) => Promise<SessionData>;
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves session storage for the current tab, grouping stored data by tab ID.
|
|
12
|
+
* The function filters data based on the provided name (namespace).
|
|
13
|
+
* @param {string} name - A namespace to filter session storage keys (e.g., "persistentSetting").
|
|
14
|
+
* @returns {Promise<Record<string, any>>} - The session data grouped under the current tab ID.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getSessionStorage: (name: string) => Promise<Record<string, any>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-psat/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "A package for common utilities that are being used in multiple packages",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist-types/index.d.ts",
|
|
@@ -37,9 +37,11 @@
|
|
|
37
37
|
"homepage": "https://github.com/GoogleChromeLabs/ps-analysis-tool",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@google-psat/i18n": "*",
|
|
40
|
+
"@types/lodash-es": "^4.17.12",
|
|
41
|
+
"lodash-es": "^4.17.21",
|
|
40
42
|
"tldts": "^6.0.14"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
43
|
-
"devtools-protocol": "^0.0.
|
|
45
|
+
"devtools-protocol": "^0.0.1345247"
|
|
44
46
|
}
|
|
45
47
|
}
|