@google-psat/common 0.9.0-3 → 0.10.1-1
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/data/cookieExclusionAndWarningReasons/cookieBlockedReason.js +10 -8
- package/dist/data/cookieExclusionAndWarningReasons/cookieBlockedReason.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/deriveBlockingStatus.js +1 -1
- package/dist/utils/deriveBlockingStatus.js.map +1 -1
- package/dist/utils/extractUrl.js +1 -1
- package/dist/utils/extractUrl.js.map +1 -1
- package/dist/utils/findAnalyticsMatch.js +6 -2
- package/dist/utils/findAnalyticsMatch.js.map +1 -1
- package/dist/utils/generateReports/generateAllCookiesCSV.js +15 -32
- package/dist/utils/generateReports/generateAllCookiesCSV.js.map +1 -1
- package/dist/utils/generateReports/generateCLICookieTableCSV.js +86 -0
- package/dist/utils/generateReports/generateCLICookieTableCSV.js.map +1 -0
- package/dist/utils/generateReports/generateCookiesWithIssuesCSV.js +17 -7
- package/dist/utils/generateReports/generateCookiesWithIssuesCSV.js.map +1 -1
- package/dist/utils/generateReports/generateExtensionCookietableCSV.js +92 -0
- package/dist/utils/generateReports/generateExtensionCookietableCSV.js.map +1 -0
- package/dist/utils/generateReports/index.js +5 -1
- package/dist/utils/generateReports/index.js.map +1 -1
- package/dist/utils/getCurrentDateAndTime.js +51 -0
- package/dist/utils/getCurrentDateAndTime.js.map +1 -0
- package/dist/utils/getDomainFromUrl.js +1 -1
- package/dist/utils/getDomainFromUrl.js.map +1 -1
- package/dist/utils/parseRequestWillBeSentExtraInfo.js +23 -5
- package/dist/utils/parseRequestWillBeSentExtraInfo.js.map +1 -1
- package/dist/utils/parseResponseReceivedExtraInfo.js +15 -10
- package/dist/utils/parseResponseReceivedExtraInfo.js.map +1 -1
- package/dist/utils/removeAndAddNewSpinnerText.js +37 -0
- package/dist/utils/removeAndAddNewSpinnerText.js.map +1 -0
- package/dist/utils/resolveWithTimeout.js +1 -1
- package/dist/utils/resolveWithTimeout.js.map +1 -1
- package/dist/utils/sanitizeCsvRecord.js +3 -1
- package/dist/utils/sanitizeCsvRecord.js.map +1 -1
- package/dist-types/cookies.types.d.ts +9 -5
- package/dist-types/data/cookieExclusionAndWarningReasons/cookieBlockedReason.d.ts +8 -8
- package/dist-types/data/cookieExclusionAndWarningReasons/index.d.ts +13 -13
- package/dist-types/index.d.ts +2 -0
- package/dist-types/libraryDetection.types.d.ts +1 -2
- package/dist-types/utils/generateReports/generateCLICookieTableCSV.d.ts +3 -0
- package/dist-types/utils/generateReports/generateExtensionCookietableCSV.d.ts +3 -0
- package/dist-types/utils/generateReports/index.d.ts +2 -0
- package/dist-types/utils/getCurrentDateAndTime.d.ts +10 -0
- package/dist-types/utils/removeAndAddNewSpinnerText.d.ts +8 -0
- package/package.json +4 -4
|
@@ -35,14 +35,16 @@ const CookieBlockedReason = {
|
|
|
35
35
|
SamePartyFromCrossPartyContext: ['body_SamePartyFromCrossPartyContext'],
|
|
36
36
|
NameValuePairExceedsMaxSize: ['body_NameValuePairExceedsMaxSize'],
|
|
37
37
|
InvalidDomain: ['body_InvalidDomain'],
|
|
38
|
-
SameSiteLax:
|
|
39
|
-
SyntaxError:
|
|
40
|
-
SchemeNotSupported: '
|
|
41
|
-
OverwriteSecure:
|
|
42
|
-
InvalidPrefix:
|
|
43
|
-
SamePartyConflictsWithOtherAttributes:
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
SameSiteLax: ['body_SameSiteLax'],
|
|
39
|
+
SyntaxError: ['body_SyntaxError'],
|
|
40
|
+
SchemeNotSupported: ['body_SchemeNotSupported'],
|
|
41
|
+
OverwriteSecure: ['body_OverwriteSecure'],
|
|
42
|
+
InvalidPrefix: ['body_InvalidPrefix'],
|
|
43
|
+
SamePartyConflictsWithOtherAttributes: [
|
|
44
|
+
'body_SamePartyConflictsWithOtherAttributes',
|
|
45
|
+
],
|
|
46
|
+
DisallowedCharacter: ['body_DisallowedCharacter'],
|
|
47
|
+
NoCookieContent: ['body_NoCookieContent'],
|
|
46
48
|
};
|
|
47
49
|
exports.default = CookieBlockedReason;
|
|
48
50
|
//# sourceMappingURL=cookieBlockedReason.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookieBlockedReason.js","sourceRoot":"","sources":["../../../src/data/cookieExclusionAndWarningReasons/cookieBlockedReason.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;GAcG;AACH,0FAA0F;AAC1F,MAAM,mBAAmB,GAAG;IAC1B,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,SAAS,EAAE,CAAC,gBAAgB,CAAC;IAC7B,cAAc,EAAE,CAAC,qBAAqB,CAAC;IACvC,cAAc,EAAE,CAAC,qBAAqB,CAAC;IACvC,+BAA+B,EAAE,CAAC,sCAAsC,CAAC;IACzE,oBAAoB,EAAE,CAAC,2BAA2B,CAAC;IACnD,eAAe,EAAE,CAAC,sBAAsB,CAAC;IACzC,kBAAkB,EAAE,CAAC,yBAAyB,CAAC;IAC/C,gCAAgC,EAAE,CAAC,uCAAuC,CAAC;IAC3E,YAAY,EAAE,CAAC,mBAAmB,CAAC;IACnC,uBAAuB,EAAE,CAAC,8BAA8B,CAAC;IACzD,oBAAoB,EAAE,CAAC,2BAA2B,CAAC;IACnD,wCAAwC,EAAE;QACxC,+CAA+C;KAChD;IACD,8BAA8B,EAAE,CAAC,qCAAqC,CAAC;IACvE,2BAA2B,EAAE,CAAC,kCAAkC,CAAC;IACjE,aAAa,EAAE,CAAC,oBAAoB,CAAC;IACrC,WAAW,
|
|
1
|
+
{"version":3,"file":"cookieBlockedReason.js","sourceRoot":"","sources":["../../../src/data/cookieExclusionAndWarningReasons/cookieBlockedReason.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;GAcG;AACH,0FAA0F;AAC1F,MAAM,mBAAmB,GAAG;IAC1B,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,SAAS,EAAE,CAAC,gBAAgB,CAAC;IAC7B,cAAc,EAAE,CAAC,qBAAqB,CAAC;IACvC,cAAc,EAAE,CAAC,qBAAqB,CAAC;IACvC,+BAA+B,EAAE,CAAC,sCAAsC,CAAC;IACzE,oBAAoB,EAAE,CAAC,2BAA2B,CAAC;IACnD,eAAe,EAAE,CAAC,sBAAsB,CAAC;IACzC,kBAAkB,EAAE,CAAC,yBAAyB,CAAC;IAC/C,gCAAgC,EAAE,CAAC,uCAAuC,CAAC;IAC3E,YAAY,EAAE,CAAC,mBAAmB,CAAC;IACnC,uBAAuB,EAAE,CAAC,8BAA8B,CAAC;IACzD,oBAAoB,EAAE,CAAC,2BAA2B,CAAC;IACnD,wCAAwC,EAAE;QACxC,+CAA+C;KAChD;IACD,8BAA8B,EAAE,CAAC,qCAAqC,CAAC;IACvE,2BAA2B,EAAE,CAAC,kCAAkC,CAAC;IACjE,aAAa,EAAE,CAAC,oBAAoB,CAAC;IACrC,WAAW,EAAE,CAAC,kBAAkB,CAAC;IACjC,WAAW,EAAE,CAAC,kBAAkB,CAAC;IACjC,kBAAkB,EAAE,CAAC,yBAAyB,CAAC;IAC/C,eAAe,EAAE,CAAC,sBAAsB,CAAC;IACzC,aAAa,EAAE,CAAC,oBAAoB,CAAC;IACrC,qCAAqC,EAAE;QACrC,4CAA4C;KAC7C;IACD,mBAAmB,EAAE,CAAC,0BAA0B,CAAC;IACjD,eAAe,EAAE,CAAC,sBAAsB,CAAC;CAC1C,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.getLegendDescription = exports.deriveBlockingStatus = exports.resolveWithTimeout = exports.mergeDeep = exports.delay = exports.addUTMParams = exports.getValueByKey = exports.executeTaskInDevToolWorker = exports.getDevToolWorker = exports.noop = exports.extractUrl = exports.getDomainFromUrl = exports.parseRequestWillBeSentExtraInfo = exports.parseResponseReceivedExtraInfo = exports.fetchLocalData = exports.parseUrl = exports.sanitizeCsvRecord = exports.calculateEffectiveExpiryDate = exports.emptyAnalytics = exports.findAnalyticsMatch = exports.getCookieKey = exports.filterCookiesByFrame = exports.filterFramesWithCookies = exports.isFirstParty = void 0;
|
|
35
|
+
exports.getLegendDescription = exports.deriveBlockingStatus = exports.resolveWithTimeout = exports.getCurrentDateAndTime = exports.mergeDeep = exports.delay = exports.addUTMParams = exports.getValueByKey = exports.executeTaskInDevToolWorker = exports.getDevToolWorker = exports.noop = exports.extractUrl = exports.getDomainFromUrl = exports.parseRequestWillBeSentExtraInfo = exports.parseResponseReceivedExtraInfo = exports.fetchLocalData = exports.parseUrl = exports.sanitizeCsvRecord = exports.calculateEffectiveExpiryDate = exports.removeAndAddNewSpinnerText = exports.emptyAnalytics = exports.findAnalyticsMatch = exports.getCookieKey = exports.filterCookiesByFrame = exports.filterFramesWithCookies = exports.isFirstParty = void 0;
|
|
36
36
|
var isFirstParty_1 = require("./utils/isFirstParty");
|
|
37
37
|
Object.defineProperty(exports, "isFirstParty", { enumerable: true, get: function () { return __importDefault(isFirstParty_1).default; } });
|
|
38
38
|
var filterFramesWithCookies_1 = require("./utils/filterFramesWithCookies");
|
|
@@ -44,6 +44,8 @@ Object.defineProperty(exports, "getCookieKey", { enumerable: true, get: function
|
|
|
44
44
|
var findAnalyticsMatch_1 = require("./utils/findAnalyticsMatch");
|
|
45
45
|
Object.defineProperty(exports, "findAnalyticsMatch", { enumerable: true, get: function () { return __importDefault(findAnalyticsMatch_1).default; } });
|
|
46
46
|
Object.defineProperty(exports, "emptyAnalytics", { enumerable: true, get: function () { return findAnalyticsMatch_1.emptyAnalytics; } });
|
|
47
|
+
var removeAndAddNewSpinnerText_1 = require("./utils/removeAndAddNewSpinnerText");
|
|
48
|
+
Object.defineProperty(exports, "removeAndAddNewSpinnerText", { enumerable: true, get: function () { return __importDefault(removeAndAddNewSpinnerText_1).default; } });
|
|
47
49
|
var calculateEffectiveExpiryDate_1 = require("./utils/calculateEffectiveExpiryDate");
|
|
48
50
|
Object.defineProperty(exports, "calculateEffectiveExpiryDate", { enumerable: true, get: function () { return __importDefault(calculateEffectiveExpiryDate_1).default; } });
|
|
49
51
|
var sanitizeCsvRecord_1 = require("./utils/sanitizeCsvRecord");
|
|
@@ -76,6 +78,8 @@ var delay_1 = require("./utils/delay");
|
|
|
76
78
|
Object.defineProperty(exports, "delay", { enumerable: true, get: function () { return __importDefault(delay_1).default; } });
|
|
77
79
|
var mergeDeep_1 = require("./utils/mergeDeep");
|
|
78
80
|
Object.defineProperty(exports, "mergeDeep", { enumerable: true, get: function () { return __importDefault(mergeDeep_1).default; } });
|
|
81
|
+
var getCurrentDateAndTime_1 = require("./utils/getCurrentDateAndTime");
|
|
82
|
+
Object.defineProperty(exports, "getCurrentDateAndTime", { enumerable: true, get: function () { return __importDefault(getCurrentDateAndTime_1).default; } });
|
|
79
83
|
var resolveWithTimeout_1 = require("./utils/resolveWithTimeout");
|
|
80
84
|
Object.defineProperty(exports, "resolveWithTimeout", { enumerable: true, get: function () { return __importDefault(resolveWithTimeout_1).default; } });
|
|
81
85
|
var deriveBlockingStatus_1 = require("./utils/deriveBlockingStatus");
|
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,c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;AAAlF,yJAAA,OAAO,OAA8B;AAC9C,qFAA+F;AAAtF,6JAAA,OAAO,OAAgC;AAChD,+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,iEAA2E;AAAlE,yIAAA,OAAO,OAAsB;AACtC,qEAA+E;AAAtE,6IAAA,OAAO,OAAwB;AACxC,qEAA+E;AAAtE,6IAAA,OAAO,OAAwB;AACxC,iDAA+B;AAC/B,0DAAwC;AACxC,kDAAgC;AAChC,2DAAyC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = deriveBlockingStatus;
|
|
3
4
|
/*
|
|
4
5
|
* Copyright 2023 Google LLC
|
|
5
6
|
*
|
|
@@ -94,5 +95,4 @@ function deriveBlockingStatus(networkEvents) {
|
|
|
94
95
|
outboundBlock: deriveOutboundBlocking(networkEvents.requestEvents),
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
|
-
exports.default = deriveBlockingStatus;
|
|
98
98
|
//# sourceMappingURL=deriveBlockingStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deriveBlockingStatus.js","sourceRoot":"","sources":["../../src/utils/deriveBlockingStatus.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"deriveBlockingStatus.js","sourceRoot":"","sources":["../../src/utils/deriveBlockingStatus.ts"],"names":[],"mappings":";;AAuFA,uCAaC;AApGD;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,oDAK0B;AAE1B;;;;;;;GAOG;AACH,SAAS,qBAAqB,CAAC,UAA2B;IACxD,iFAAiF;IACjF,2DAA2D;IAC3D,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,4BAAY,CAAC,WAAW,CAAC;IAClC,CAAC;IAED,uDAAuD;IACvD,MAAM,UAAU,GAAW,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC1D,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,GAAG,GAAG,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,4BAAY,CAAC,WAAW,CAAC;IAClC,CAAC;SAAM,IAAI,CAAC,GAAG,UAAU,IAAI,UAAU,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;QAC5D,OAAO,4BAAY,CAAC,sBAAsB,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,OAAO,4BAAY,CAAC,qBAAqB,CAAC;IAC5C,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,SAAS,sBAAsB,CAAC,SAAyB;IACvD,MAAM,UAAU,GAAW,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACzD,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,GAAG,GAAG,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,4BAAY,CAAC,WAAW,CAAC;IAClC,CAAC;SAAM,IAAI,CAAC,GAAG,UAAU,IAAI,UAAU,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;QAC3D,OAAO,4BAAY,CAAC,sBAAsB,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,OAAO,4BAAY,CAAC,qBAAqB,CAAC;IAC5C,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAwB,oBAAoB,CAC1C,aAA0C;IAE1C,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO;YACL,YAAY,EAAE,4BAAY,CAAC,OAAO;YAClC,aAAa,EAAE,4BAAY,CAAC,OAAO;SACpC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,YAAY,EAAE,qBAAqB,CAAC,aAAa,CAAC,cAAc,CAAC;QACjE,aAAa,EAAE,sBAAsB,CAAC,aAAa,CAAC,aAAa,CAAC;KACnE,CAAC;AACJ,CAAC"}
|
package/dist/utils/extractUrl.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = extractUrl;
|
|
3
4
|
/*
|
|
4
5
|
* Copyright 2023 Google LLC
|
|
5
6
|
*
|
|
@@ -28,5 +29,4 @@ function extractUrl(url) {
|
|
|
28
29
|
const parsedUrl = (0, tldts_1.parse)(url);
|
|
29
30
|
return parsedUrl || '';
|
|
30
31
|
}
|
|
31
|
-
exports.default = extractUrl;
|
|
32
32
|
//# sourceMappingURL=extractUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractUrl.js","sourceRoot":"","sources":["../../src/utils/extractUrl.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"extractUrl.js","sourceRoot":"","sources":["../../src/utils/extractUrl.ts"],"names":[],"mappings":";;AAyBA,6BAGC;AA5BD;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,iCAA8B;AAE9B;;;;GAIG;AACH,SAAwB,UAAU,CAAC,GAAW;IAC5C,MAAM,SAAS,GAAG,IAAA,aAAK,EAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,SAAS,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -13,7 +13,7 @@ const wildTest = (wildcard, str) => {
|
|
|
13
13
|
return result.test(str); // remove last 'i' above to have case sensitive
|
|
14
14
|
};
|
|
15
15
|
exports.emptyAnalytics = {
|
|
16
|
-
platform: '',
|
|
16
|
+
platform: 'Unknown',
|
|
17
17
|
category: 'Uncategorized',
|
|
18
18
|
name: '',
|
|
19
19
|
domain: '',
|
|
@@ -23,6 +23,7 @@ exports.emptyAnalytics = {
|
|
|
23
23
|
gdprUrl: '',
|
|
24
24
|
wildcard: '',
|
|
25
25
|
};
|
|
26
|
+
const STATIC_CATEGORIES = ['Functional', 'Marketing', 'Analytics'];
|
|
26
27
|
/**
|
|
27
28
|
* Finds analytics in cookie DB for a cookie name.
|
|
28
29
|
* @param {string} key cookie name to be matched.
|
|
@@ -30,6 +31,7 @@ exports.emptyAnalytics = {
|
|
|
30
31
|
* @returns {boolean} Flag for match
|
|
31
32
|
*/
|
|
32
33
|
const findAnalyticsMatch = (key, dictionary) => {
|
|
34
|
+
var _a;
|
|
33
35
|
let analytics = Object.assign({}, exports.emptyAnalytics);
|
|
34
36
|
Object.keys(dictionary).every((dictionaryKey) => {
|
|
35
37
|
if (key === dictionaryKey) {
|
|
@@ -44,7 +46,9 @@ const findAnalyticsMatch = (key, dictionary) => {
|
|
|
44
46
|
return true;
|
|
45
47
|
}
|
|
46
48
|
});
|
|
47
|
-
analytics.category = analytics.category
|
|
49
|
+
analytics.category = STATIC_CATEGORIES.includes((_a = analytics.category) !== null && _a !== void 0 ? _a : '')
|
|
50
|
+
? analytics.category
|
|
51
|
+
: 'Uncategorized';
|
|
48
52
|
return analytics;
|
|
49
53
|
};
|
|
50
54
|
exports.default = findAnalyticsMatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findAnalyticsMatch.js","sourceRoot":"","sources":["../../src/utils/findAnalyticsMatch.ts"],"names":[],"mappings":";;;AAoBA;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAE,GAAW,EAAW,EAAE;IAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC,gBAAgB;IAC9E,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,EACtD,GAAG,CACJ,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,+CAA+C;AAC1E,CAAC,CAAC;AAEW,QAAA,cAAc,GAAG;IAC5B,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"findAnalyticsMatch.js","sourceRoot":"","sources":["../../src/utils/findAnalyticsMatch.ts"],"names":[],"mappings":";;;AAoBA;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAE,GAAW,EAAW,EAAE;IAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC,gBAAgB;IAC9E,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC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AAe,CAAC;IAEpB,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -22,9 +22,9 @@ exports.COOKIES_DATA_HEADER = void 0;
|
|
|
22
22
|
/**
|
|
23
23
|
* External dependencies
|
|
24
24
|
*/
|
|
25
|
-
const sanitizeCsvRecord_1 = __importDefault(require("../sanitizeCsvRecord"));
|
|
26
25
|
const i18n_1 = require("@google-psat/i18n");
|
|
27
|
-
const
|
|
26
|
+
const generateExtensionCookietableCSV_1 = __importDefault(require("./generateExtensionCookietableCSV"));
|
|
27
|
+
const generateCLICookieTableCSV_1 = __importDefault(require("./generateCLICookieTableCSV"));
|
|
28
28
|
exports.COOKIES_DATA_HEADER = [
|
|
29
29
|
() => i18n_1.I18n.getMessage('name'),
|
|
30
30
|
() => i18n_1.I18n.getMessage('scope'),
|
|
@@ -39,48 +39,31 @@ exports.COOKIES_DATA_HEADER = [
|
|
|
39
39
|
() => i18n_1.I18n.getMessage('path'),
|
|
40
40
|
() => i18n_1.I18n.getMessage('expires'),
|
|
41
41
|
() => i18n_1.I18n.getMessage('issues'),
|
|
42
|
-
() => i18n_1.I18n.getMessage('
|
|
42
|
+
() => i18n_1.I18n.getMessage('gdpr'),
|
|
43
43
|
];
|
|
44
44
|
const generateAllCookiesCSV = (siteAnalysisData) => {
|
|
45
|
-
var _a, _b;
|
|
46
45
|
const frameCookieDataMap = siteAnalysisData.cookieData;
|
|
47
46
|
const cookieMap = new Map();
|
|
47
|
+
//@ts-ignore -- PSAT_EXTENSTION is added only when the report is downloaded from the extension. Since optional chaining is done it will return false if it doesnt exist.
|
|
48
|
+
const isExtension = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.PSAT_EXTENSION);
|
|
48
49
|
// More than one frame can use one cookie, need to make a map for gettig unique entries.
|
|
49
50
|
Object.entries(frameCookieDataMap).forEach(([, { frameCookies }]) => {
|
|
50
51
|
Object.entries(frameCookies).forEach(([cookieKey, cookieData]) => {
|
|
51
52
|
cookieMap.set(cookieKey, cookieData);
|
|
52
53
|
});
|
|
53
54
|
});
|
|
54
|
-
|
|
55
|
+
const cookieRecords = [];
|
|
55
56
|
for (const cookie of cookieMap.values()) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
cookie.parsedCookie.name,
|
|
59
|
-
cookie.isFirstParty
|
|
60
|
-
? i18n_1.I18n.getMessage('firstParty')
|
|
61
|
-
: i18n_1.I18n.getMessage('thirdParty'),
|
|
62
|
-
cookie.parsedCookie.domain || ' ',
|
|
63
|
-
cookie.parsedCookie.partitionKey || ' ',
|
|
64
|
-
cookie.parsedCookie.sameSite,
|
|
65
|
-
i18n_1.I18n.getMessage(((_b = (_a = cookie.analytics) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || 'uncategorized'),
|
|
66
|
-
cookie.analytics.platform,
|
|
67
|
-
cookie.parsedCookie.httpOnly
|
|
68
|
-
? i18n_1.I18n.getMessage('yes')
|
|
69
|
-
: i18n_1.I18n.getMessage('no'),
|
|
70
|
-
cookie.parsedCookie.secure
|
|
71
|
-
? i18n_1.I18n.getMessage('yes')
|
|
72
|
-
: i18n_1.I18n.getMessage('no'),
|
|
73
|
-
cookie.parsedCookie.value,
|
|
74
|
-
cookie.parsedCookie.path,
|
|
75
|
-
(0, calculateEffectiveExpiryDate_1.default)(cookie.parsedCookie.expires),
|
|
76
|
-
cookie.isBlocked ? i18n_1.I18n.getMessage('yes') : i18n_1.I18n.getMessage('no'),
|
|
77
|
-
cookie.analytics.GDPR || 'NA',
|
|
78
|
-
].map(sanitizeCsvRecord_1.default);
|
|
79
|
-
cookieRecords += recordsArray.join(',') + '\r\n';
|
|
57
|
+
//@ts-ignore
|
|
58
|
+
cookieRecords.push(cookie);
|
|
80
59
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
if (isExtension) {
|
|
61
|
+
return (0, generateExtensionCookietableCSV_1.default)(cookieRecords, true);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return (0, generateCLICookieTableCSV_1.default)(cookieRecords, true);
|
|
65
|
+
}
|
|
66
|
+
return '';
|
|
84
67
|
};
|
|
85
68
|
exports.default = generateAllCookiesCSV;
|
|
86
69
|
//# sourceMappingURL=generateAllCookiesCSV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateAllCookiesCSV.js","sourceRoot":"","sources":["../../../src/utils/generateReports/generateAllCookiesCSV.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"generateAllCookiesCSV.js","sourceRoot":"","sources":["../../../src/utils/generateReports/generateAllCookiesCSV.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH;;GAEG;AACH,4CAAyC;AASzC,wGAAgF;AAChF,4FAAoE;AAEvD,QAAA,mBAAmB,GAAG;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAC7B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IAC9B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC/B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,cAAc,CAAC;IACrC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC/B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IAC9B,GAAG,EA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EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,kBAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/*
|
|
7
|
+
* Copyright 2023 Google LLC
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* External dependencies.
|
|
23
|
+
*/
|
|
24
|
+
const i18n_1 = require("@google-psat/i18n");
|
|
25
|
+
/**
|
|
26
|
+
* Internal dependencies.
|
|
27
|
+
*/
|
|
28
|
+
const sanitizeCsvRecord_1 = __importDefault(require("../sanitizeCsvRecord"));
|
|
29
|
+
const COOKIES_TABLE_DATA_HEADER_CLI = [
|
|
30
|
+
() => i18n_1.I18n.getMessage('name'),
|
|
31
|
+
() => i18n_1.I18n.getMessage('scope'),
|
|
32
|
+
() => i18n_1.I18n.getMessage('domain'),
|
|
33
|
+
() => i18n_1.I18n.getMessage('partitionKey'),
|
|
34
|
+
() => i18n_1.I18n.getMessage('sameSite'),
|
|
35
|
+
() => i18n_1.I18n.getMessage('category'),
|
|
36
|
+
() => i18n_1.I18n.getMessage('platform'),
|
|
37
|
+
() => i18n_1.I18n.getMessage('httpOnly'),
|
|
38
|
+
() => i18n_1.I18n.getMessage('secure'),
|
|
39
|
+
() => i18n_1.I18n.getMessage('value'),
|
|
40
|
+
() => i18n_1.I18n.getMessage('path'),
|
|
41
|
+
() => i18n_1.I18n.getMessage('expires'),
|
|
42
|
+
() => i18n_1.I18n.getMessage('issues'),
|
|
43
|
+
() => i18n_1.I18n.getMessage('gdpr'),
|
|
44
|
+
];
|
|
45
|
+
const generateCLICookieTableCSV = (cookies, returnString = false) => {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f;
|
|
47
|
+
let cookieRecords = '';
|
|
48
|
+
for (const cookie of cookies) {
|
|
49
|
+
//This should be in the same order as cookieDataHeader
|
|
50
|
+
const recordsArray = [
|
|
51
|
+
cookie.parsedCookie.name,
|
|
52
|
+
cookie.isFirstParty
|
|
53
|
+
? i18n_1.I18n.getMessage('firstParty')
|
|
54
|
+
: i18n_1.I18n.getMessage('thirdParty'),
|
|
55
|
+
cookie.parsedCookie.domain || ' ',
|
|
56
|
+
cookie.parsedCookie.partitionKey || ' ',
|
|
57
|
+
i18n_1.I18n.getMessage(((_b = (_a = cookie.parsedCookie) === null || _a === void 0 ? void 0 : _a.samesite) !== null && _b !== void 0 ? _b : 'lax').toLowerCase()),
|
|
58
|
+
i18n_1.I18n.getMessage(((_d = (_c = cookie.analytics) === null || _c === void 0 ? void 0 : _c.category) === null || _d === void 0 ? void 0 : _d.toLowerCase()) || 'uncategorized'),
|
|
59
|
+
(_e = cookie.analytics) === null || _e === void 0 ? void 0 : _e.platform,
|
|
60
|
+
cookie.parsedCookie.httponly
|
|
61
|
+
? i18n_1.I18n.getMessage('yes')
|
|
62
|
+
: i18n_1.I18n.getMessage('no'),
|
|
63
|
+
cookie.parsedCookie.secure
|
|
64
|
+
? i18n_1.I18n.getMessage('yes')
|
|
65
|
+
: i18n_1.I18n.getMessage('no'),
|
|
66
|
+
cookie.parsedCookie.value,
|
|
67
|
+
cookie.parsedCookie.path,
|
|
68
|
+
cookie.parsedCookie.expires,
|
|
69
|
+
cookie.isBlocked ? i18n_1.I18n.getMessage('yes') : i18n_1.I18n.getMessage('no'),
|
|
70
|
+
((_f = cookie.analytics) === null || _f === void 0 ? void 0 : _f.gdprUrl) || 'NA',
|
|
71
|
+
].map(sanitizeCsvRecord_1.default);
|
|
72
|
+
cookieRecords += recordsArray.join(',') + '\r\n';
|
|
73
|
+
}
|
|
74
|
+
if (returnString) {
|
|
75
|
+
return (COOKIES_TABLE_DATA_HEADER_CLI.map((header) => header()).join(',') +
|
|
76
|
+
'\r\n' +
|
|
77
|
+
cookieRecords);
|
|
78
|
+
}
|
|
79
|
+
return new Blob([
|
|
80
|
+
COOKIES_TABLE_DATA_HEADER_CLI.map((header) => header()).join(',') +
|
|
81
|
+
'\r\n' +
|
|
82
|
+
cookieRecords,
|
|
83
|
+
]);
|
|
84
|
+
};
|
|
85
|
+
exports.default = generateCLICookieTableCSV;
|
|
86
|
+
//# sourceMappingURL=generateCLICookieTableCSV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateCLICookieTableCSV.js","sourceRoot":"","sources":["../../../src/utils/generateReports/generateCLICookieTableCSV.ts"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,4CAAyC;AACzC;;GAEG;AACH,6EAAqD;AAGrD,MAAM,6BAA6B,GAAG;IACpC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAC7B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IAC9B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC/B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,cAAc,CAAC;IACrC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC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HEADERS = [
|
|
|
38
38
|
() => i18n_1.I18n.getMessage('value'),
|
|
39
39
|
() => i18n_1.I18n.getMessage('path'),
|
|
40
40
|
() => i18n_1.I18n.getMessage('expires'),
|
|
41
|
-
() => i18n_1.I18n.getMessage('
|
|
41
|
+
() => i18n_1.I18n.getMessage('gdpr'),
|
|
42
42
|
];
|
|
43
43
|
const generateCookiesWithIssuesCSV = (siteAnalysisData) => {
|
|
44
|
-
var _a, _b;
|
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
45
|
+
//@ts-ignore -- PSAT_EXTENSTION is added only when the report is downloaded from the extension. Since optional chaining is done it will return false if it doesnt exist.
|
|
46
|
+
const isExtension = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.PSAT_EXTENSION);
|
|
47
|
+
if (isExtension) {
|
|
48
|
+
exports.COOKIES_WITH_ISSUES_DATA_HEADERS.push(() => i18n_1.I18n.getMessage('priority'), () => i18n_1.I18n.getMessage('size'));
|
|
49
|
+
}
|
|
45
50
|
const frameCookieDataMap = siteAnalysisData.cookieData;
|
|
46
51
|
const CookieWithIssueMap = new Map();
|
|
47
52
|
// More than one frame can use one cookie, need to make a map for getting unique entries.
|
|
@@ -55,6 +60,7 @@ const generateCookiesWithIssuesCSV = (siteAnalysisData) => {
|
|
|
55
60
|
let cookieRecords = '';
|
|
56
61
|
for (const cookie of CookieWithIssueMap.values()) {
|
|
57
62
|
//This should be in the same order as cookieDataHeader
|
|
63
|
+
const expires = (0, calculateEffectiveExpiryDate_1.default)(cookie.parsedCookie.expires);
|
|
58
64
|
const recordsArray = [
|
|
59
65
|
cookie.parsedCookie.name,
|
|
60
66
|
cookie.isFirstParty
|
|
@@ -62,10 +68,10 @@ const generateCookiesWithIssuesCSV = (siteAnalysisData) => {
|
|
|
62
68
|
: i18n_1.I18n.getMessage('thirdParty'),
|
|
63
69
|
cookie.parsedCookie.domain || ' ',
|
|
64
70
|
cookie.parsedCookie.partitionKey || ' ',
|
|
65
|
-
cookie.parsedCookie.
|
|
66
|
-
i18n_1.I18n.getMessage(((
|
|
71
|
+
i18n_1.I18n.getMessage(((_a = cookie.parsedCookie.samesite) !== null && _a !== void 0 ? _a : 'lax').toLowerCase()),
|
|
72
|
+
i18n_1.I18n.getMessage(((_c = (_b = cookie.analytics) === null || _b === void 0 ? void 0 : _b.category) === null || _c === void 0 ? void 0 : _c.toLowerCase()) || 'uncategorized'),
|
|
67
73
|
cookie.analytics.platform,
|
|
68
|
-
cookie.parsedCookie.
|
|
74
|
+
cookie.parsedCookie.httponly
|
|
69
75
|
? i18n_1.I18n.getMessage('yes')
|
|
70
76
|
: i18n_1.I18n.getMessage('no'),
|
|
71
77
|
cookie.parsedCookie.secure
|
|
@@ -73,9 +79,13 @@ const generateCookiesWithIssuesCSV = (siteAnalysisData) => {
|
|
|
73
79
|
: i18n_1.I18n.getMessage('no'),
|
|
74
80
|
cookie.parsedCookie.value,
|
|
75
81
|
cookie.parsedCookie.path,
|
|
76
|
-
|
|
82
|
+
expires === 'Session' ? i18n_1.I18n.getMessage('session') : expires,
|
|
77
83
|
cookie.analytics.GDPR || 'NA',
|
|
78
|
-
]
|
|
84
|
+
];
|
|
85
|
+
if (isExtension) {
|
|
86
|
+
recordsArray.push(i18n_1.I18n.getMessage((((_d = cookie.parsedCookie) === null || _d === void 0 ? void 0 : _d.priority) || ' ').toLowerCase()), (_g = (_f = (_e = cookie.parsedCookie) === null || _e === void 0 ? void 0 : _e.size) === null || _f === void 0 ? void 0 : _f.toString()) !== null && _g !== void 0 ? _g : ' ');
|
|
87
|
+
}
|
|
88
|
+
recordsArray.map(sanitizeCsvRecord_1.default);
|
|
79
89
|
cookieRecords += recordsArray.join(',') + '\r\n';
|
|
80
90
|
}
|
|
81
91
|
return (exports.COOKIES_WITH_ISSUES_DATA_HEADERS.map((header) => header()).join(',') +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateCookiesWithIssuesCSV.js","sourceRoot":"","sources":["../../../src/utils/gener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EAAE,CAAC,EAAE,EAAE;QAClE,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,EAAE;YAC/D,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;gBACzB,kBAAkB,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAChD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,GAAG,EAAE,CAAC;IAEvB,KAAK,MAAM,MAAM,IAAI,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC;QACjD,sDAAsD;QACtD,MAAM,YAAY,GAAG;YACnB,MAAM,CAAC,YAAY,CAAC,IAAI;YACxB,MAAM,CAAC,YAAY;gBACjB,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,YAAY,CAAC;gBAC/B,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,YAAY,CAAC;YACjC,MAAM,CAAC,YAAY,CAAC,MAAM,IAAI,GAAG;YACjC,MAAM,CAAC,YAAY,CAAC,YAAY,IAAI,GAAG;YACvC,MAAM,CAAC,YAAY,CAAC,QAAQ;
|
|
1
|
+
{"version":3,"file":"generateCookiesWithIssuesCSV.js","sourceRoot":"","sources":["../../../src/utils/generateReports/generateCookiesWithIssuesCSV.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,4CAAyC;AAKzC,mGAA2E;AAC3E,6EAAqD;AAExC,QAAA,gCAAgC,GAAG;IAC9C,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAC7B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IAC9B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC/B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,cAAc,CAAC;IACrC,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AC,UAAU,CAAC,IAAI,CAAC;YACzB,MAAM,CAAC,YAAY,CAAC,KAAK;YACzB,MAAM,CAAC,YAAY,CAAC,IAAI;YACxB,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO;YAC5D,MAAM,CAAC,SAAS,CAAC,IAAI,IAAI,IAAI;SAC9B,CAAC;QAEF,IAAI,WAAW,EAAE,CAAC;YAChB,YAAY,CAAC,IAAI,CACf,WAAI,CAAC,UAAU,CAAC,CAAC,CAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,QAAQ,KAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,EACrE,MAAA,MAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,IAAI,0CAAE,QAAQ,EAAE,mCAAI,GAAG,CAC7C,CAAC;QACJ,CAAC;QAED,YAAY,CAAC,GAAG,CAAC,2BAAiB,CAAC,CAAC;QACpC,aAAa,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACnD,CAAC;IAED,OAAO,CACL,wCAAgC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACpE,MAAM;QACN,aAAa,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/*
|
|
7
|
+
* Copyright 2023 Google LLC
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* External dependencies.
|
|
23
|
+
*/
|
|
24
|
+
const i18n_1 = require("@google-psat/i18n");
|
|
25
|
+
/**
|
|
26
|
+
* Internal dependencies.
|
|
27
|
+
*/
|
|
28
|
+
const sanitizeCsvRecord_1 = __importDefault(require("../sanitizeCsvRecord"));
|
|
29
|
+
const COOKIES_TABLE_DATA_HEADER_EXTENSION = [
|
|
30
|
+
() => i18n_1.I18n.getMessage('name'),
|
|
31
|
+
() => i18n_1.I18n.getMessage('scope'),
|
|
32
|
+
() => i18n_1.I18n.getMessage('domain'),
|
|
33
|
+
() => i18n_1.I18n.getMessage('partitionKey'),
|
|
34
|
+
() => i18n_1.I18n.getMessage('sameSite'),
|
|
35
|
+
() => i18n_1.I18n.getMessage('category'),
|
|
36
|
+
() => i18n_1.I18n.getMessage('platform'),
|
|
37
|
+
() => i18n_1.I18n.getMessage('httpOnly'),
|
|
38
|
+
() => i18n_1.I18n.getMessage('secure'),
|
|
39
|
+
() => i18n_1.I18n.getMessage('value'),
|
|
40
|
+
() => i18n_1.I18n.getMessage('path'),
|
|
41
|
+
() => i18n_1.I18n.getMessage('expires'),
|
|
42
|
+
() => i18n_1.I18n.getMessage('issues'),
|
|
43
|
+
() => i18n_1.I18n.getMessage('gdpr'),
|
|
44
|
+
() => i18n_1.I18n.getMessage('priority'),
|
|
45
|
+
() => i18n_1.I18n.getMessage('size'),
|
|
46
|
+
];
|
|
47
|
+
const generateExtensionCookieTableCSV = (cookies, returnString = false) => {
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
49
|
+
let cookieRecords = '';
|
|
50
|
+
for (const cookie of cookies) {
|
|
51
|
+
//This should be in the same order as cookieDataHeader
|
|
52
|
+
const recordsArray = [
|
|
53
|
+
cookie.parsedCookie.name,
|
|
54
|
+
cookie.isFirstParty
|
|
55
|
+
? i18n_1.I18n.getMessage('firstParty')
|
|
56
|
+
: i18n_1.I18n.getMessage('thirdParty'),
|
|
57
|
+
cookie.parsedCookie.domain || ' ',
|
|
58
|
+
cookie.parsedCookie.partitionKey || ' ',
|
|
59
|
+
i18n_1.I18n.getMessage(((_a = cookie.parsedCookie.samesite) !== null && _a !== void 0 ? _a : 'lax').toLowerCase()),
|
|
60
|
+
i18n_1.I18n.getMessage(((_c = (_b = cookie.analytics) === null || _b === void 0 ? void 0 : _b.category) === null || _c === void 0 ? void 0 : _c.toLowerCase()) || 'uncategorized'),
|
|
61
|
+
(_d = cookie.analytics) === null || _d === void 0 ? void 0 : _d.platform,
|
|
62
|
+
cookie.parsedCookie.httponly
|
|
63
|
+
? i18n_1.I18n.getMessage('yes')
|
|
64
|
+
: i18n_1.I18n.getMessage('no'),
|
|
65
|
+
cookie.parsedCookie.secure
|
|
66
|
+
? i18n_1.I18n.getMessage('yes')
|
|
67
|
+
: i18n_1.I18n.getMessage('no'),
|
|
68
|
+
cookie.parsedCookie.value,
|
|
69
|
+
cookie.parsedCookie.path,
|
|
70
|
+
cookie.parsedCookie.expires === 'Session'
|
|
71
|
+
? i18n_1.I18n.getMessage('session')
|
|
72
|
+
: cookie.parsedCookie.expires,
|
|
73
|
+
cookie.isBlocked ? i18n_1.I18n.getMessage('yes') : i18n_1.I18n.getMessage('no'),
|
|
74
|
+
((_e = cookie.analytics) === null || _e === void 0 ? void 0 : _e.gdprUrl) || 'NA',
|
|
75
|
+
i18n_1.I18n.getMessage((((_f = cookie.parsedCookie) === null || _f === void 0 ? void 0 : _f.priority) || '').toLowerCase()),
|
|
76
|
+
(_g = cookie.parsedCookie.size) === null || _g === void 0 ? void 0 : _g.toString(),
|
|
77
|
+
].map(sanitizeCsvRecord_1.default);
|
|
78
|
+
cookieRecords += recordsArray.join(',') + '\r\n';
|
|
79
|
+
}
|
|
80
|
+
if (returnString) {
|
|
81
|
+
return (COOKIES_TABLE_DATA_HEADER_EXTENSION.map((header) => header()).join(',') +
|
|
82
|
+
'\r\n' +
|
|
83
|
+
cookieRecords);
|
|
84
|
+
}
|
|
85
|
+
return new Blob([
|
|
86
|
+
COOKIES_TABLE_DATA_HEADER_EXTENSION.map((header) => header()).join(',') +
|
|
87
|
+
'\r\n' +
|
|
88
|
+
cookieRecords,
|
|
89
|
+
]);
|
|
90
|
+
};
|
|
91
|
+
exports.default = generateExtensionCookieTableCSV;
|
|
92
|
+
//# sourceMappingURL=generateExtensionCookietableCSV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateExtensionCookietableCSV.js","sourceRoot":"","sources":["../../../src/utils/generateReports/generateExtensionCookietableCSV.ts"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,4CAAyC;AACzC;;GAEG;AACH,6EAAqD;AAGrD,MAAM,mCAAmC,GAAG;IAC1C,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAC7B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IAC9B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC/B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,cAAc,CAAC;IACrC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CA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ACN,aAAa,CACd,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,IAAI,CAAC;QACd,mCAAmC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YACrE,MAAM;YACN,aAAa;KAChB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,+BAA+B,CAAC"}
|
|
@@ -18,7 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.generateTechnologyCSV = exports.generateSummaryDataCSV = exports.generateAllCookiesCSV = exports.generateCookiesWithIssuesCSV = void 0;
|
|
21
|
+
exports.generateExtensionCookieTableCSV = exports.generateCLICookieTableCSV = exports.generateTechnologyCSV = exports.generateSummaryDataCSV = exports.generateAllCookiesCSV = exports.generateCookiesWithIssuesCSV = void 0;
|
|
22
22
|
var generateCookiesWithIssuesCSV_1 = require("./generateCookiesWithIssuesCSV");
|
|
23
23
|
Object.defineProperty(exports, "generateCookiesWithIssuesCSV", { enumerable: true, get: function () { return __importDefault(generateCookiesWithIssuesCSV_1).default; } });
|
|
24
24
|
var generateAllCookiesCSV_1 = require("./generateAllCookiesCSV");
|
|
@@ -27,4 +27,8 @@ var generateSummaryDataCSV_1 = require("./generateSummaryDataCSV");
|
|
|
27
27
|
Object.defineProperty(exports, "generateSummaryDataCSV", { enumerable: true, get: function () { return __importDefault(generateSummaryDataCSV_1).default; } });
|
|
28
28
|
var generateTechnologyCSV_1 = require("./generateTechnologyCSV");
|
|
29
29
|
Object.defineProperty(exports, "generateTechnologyCSV", { enumerable: true, get: function () { return __importDefault(generateTechnologyCSV_1).default; } });
|
|
30
|
+
var generateCLICookieTableCSV_1 = require("./generateCLICookieTableCSV");
|
|
31
|
+
Object.defineProperty(exports, "generateCLICookieTableCSV", { enumerable: true, get: function () { return __importDefault(generateCLICookieTableCSV_1).default; } });
|
|
32
|
+
var generateExtensionCookietableCSV_1 = require("./generateExtensionCookietableCSV");
|
|
33
|
+
Object.defineProperty(exports, "generateExtensionCookieTableCSV", { enumerable: true, get: function () { return __importDefault(generateExtensionCookietableCSV_1).default; } });
|
|
30
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/generateReports/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH,+EAAyF;AAAhF,6JAAA,OAAO,OAAgC;AAChD,iEAA2E;AAAlE,+IAAA,OAAO,OAAyB;AACzC,mEAA6E;AAApE,iJAAA,OAAO,OAA0B;AAC1C,iEAA2E;AAAlE,+IAAA,OAAO,OAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/generateReports/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH,+EAAyF;AAAhF,6JAAA,OAAO,OAAgC;AAChD,iEAA2E;AAAlE,+IAAA,OAAO,OAAyB;AACzC,mEAA6E;AAApE,iJAAA,OAAO,OAA0B;AAC1C,iEAA2E;AAAlE,+IAAA,OAAO,OAAyB;AACzC,yEAAmF;AAA1E,uJAAA,OAAO,OAA6B;AAC7C,qFAA+F;AAAtF,mKAAA,OAAO,OAAmC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2023 Google LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Formats the current date and time into a specified string format.
|
|
20
|
+
* The supported formats are:
|
|
21
|
+
* - 'YYYY-MM-DD_HH-MM-SS': 24-hour format with seconds (e.g., 2024-07-19_14-30-45)
|
|
22
|
+
* - 'DD MMMM, YYYY, hh:mm:ssam/pm': 12-hour format with seconds and AM/PM (e.g., 19 July, 2024, 02:30:45pm)
|
|
23
|
+
* @param format {string} The format in which the date is required.
|
|
24
|
+
* @returns {string} The formatted date string.
|
|
25
|
+
*/
|
|
26
|
+
function getCurrentDateAndTime(format) {
|
|
27
|
+
const date = new Date();
|
|
28
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
29
|
+
const monthLong = date.toLocaleString('en-US', { month: 'long' });
|
|
30
|
+
const monthShort = String(date.getMonth() + 1).padStart(2, '0');
|
|
31
|
+
const year = date.getFullYear();
|
|
32
|
+
const hours24 = String(date.getHours()).padStart(2, '0');
|
|
33
|
+
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
34
|
+
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
35
|
+
let hours12 = date.getHours();
|
|
36
|
+
const ampm = hours12 >= 12 ? 'pm' : 'am';
|
|
37
|
+
hours12 = hours12 % 12;
|
|
38
|
+
hours12 = hours12 ? hours12 : 12; // the hour '0' should be '12'
|
|
39
|
+
const hoursPadded12 = String(hours12).padStart(2, '0');
|
|
40
|
+
if (format === 'YYYY-MM-DD_HH-MM-SS') {
|
|
41
|
+
return `${year}-${monthShort}-${day}_${hours24}-${minutes}-${seconds}`;
|
|
42
|
+
}
|
|
43
|
+
else if (format === 'DD MMMM, YYYY, hh:mm:ssam/pm') {
|
|
44
|
+
return `${day} ${monthLong}, ${year}, ${hoursPadded12}:${minutes}:${seconds}${ampm}`;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
throw new Error('Invalid format');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.default = getCurrentDateAndTime;
|
|
51
|
+
//# sourceMappingURL=getCurrentDateAndTime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCurrentDateAndTime.js","sourceRoot":"","sources":["../../src/utils/getCurrentDateAndTime.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;GAcG;AACH;;;;;;;GAOG;AACH,SAAS,qBAAqB,CAC5B,MAA8D;IAE9D,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IAExB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAE3D,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAEzC,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC;IACvB,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,8BAA8B;IAChE,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEvD,IAAI,MAAM,KAAK,qBAAqB,EAAE,CAAC;QACrC,OAAO,GAAG,IAAI,IAAI,UAAU,IAAI,GAAG,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;IACzE,CAAC;SAAM,IAAI,MAAM,KAAK,8BAA8B,EAAE,CAAC;QACrD,OAAO,GAAG,GAAG,IAAI,SAAS,KAAK,IAAI,KAAK,aAAa,IAAI,OAAO,IAAI,OAAO,GAAG,IAAI,EAAE,CAAC;IACvF,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACpC,CAAC;AACH,CAAC;AAED,kBAAe,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = getDomainFromUrl;
|
|
3
4
|
/*
|
|
4
5
|
* Copyright 2023 Google LLC
|
|
5
6
|
*
|
|
@@ -31,5 +32,4 @@ function getDomainFromUrl(url) {
|
|
|
31
32
|
}
|
|
32
33
|
return domain || '';
|
|
33
34
|
}
|
|
34
|
-
exports.default = getDomainFromUrl;
|
|
35
35
|
//# sourceMappingURL=getDomainFromUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDomainFromUrl.js","sourceRoot":"","sources":["../../src/utils/getDomainFromUrl.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getDomainFromUrl.js","sourceRoot":"","sources":["../../src/utils/getDomainFromUrl.ts"],"names":[],"mappings":";;AAyBA,mCAMC;AA/BD;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,iCAAkC;AAElC;;;;GAIG;AACH,SAAwB,gBAAgB,CAAC,GAAW;IAClD,IAAI,MAAM,GAAG,IAAA,iBAAS,EAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC;IAC1D,CAAC;IACD,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.default = parseRequestWillBeSentExtraInfo;
|
|
6
18
|
/**
|
|
7
19
|
* Internal dependencies.
|
|
8
20
|
*/
|
|
@@ -25,6 +37,7 @@ function parseRequestWillBeSentExtraInfo(associatedCookies, cookieDB, requestUrl
|
|
|
25
37
|
associatedCookies.forEach(({ blockedReasons, cookie, exemptionReason }) => {
|
|
26
38
|
var _a, _b, _c;
|
|
27
39
|
const effectiveExpirationDate = (0, calculateEffectiveExpiryDate_1.default)(cookie.expires);
|
|
40
|
+
const { partitionKey } = cookie, cookieWithoutPartitionKey = __rest(cookie, ["partitionKey"]);
|
|
28
41
|
let domain;
|
|
29
42
|
if (cookie === null || cookie === void 0 ? void 0 : cookie.domain) {
|
|
30
43
|
domain = cookie === null || cookie === void 0 ? void 0 : cookie.domain;
|
|
@@ -34,10 +47,7 @@ function parseRequestWillBeSentExtraInfo(associatedCookies, cookieDB, requestUrl
|
|
|
34
47
|
}
|
|
35
48
|
const singleCookie = {
|
|
36
49
|
isBlocked: blockedReasons.length !== 0,
|
|
37
|
-
parsedCookie: Object.assign(Object.assign({},
|
|
38
|
-
? cookie === null || cookie === void 0 ? void 0 : cookie.partitionKey
|
|
39
|
-
: //@ts-ignore This is to handle both stable and canary version of Chrome.
|
|
40
|
-
(_c = cookie === null || cookie === void 0 ? void 0 : cookie.partitionKey) === null || _c === void 0 ? void 0 : _c.topLevelSite }),
|
|
50
|
+
parsedCookie: Object.assign(Object.assign({}, cookieWithoutPartitionKey), { httponly: (_a = cookieWithoutPartitionKey === null || cookieWithoutPartitionKey === void 0 ? void 0 : cookieWithoutPartitionKey.httpOnly) !== null && _a !== void 0 ? _a : false, expires: effectiveExpirationDate, samesite: (_c = (_b = cookie.sameSite) === null || _b === void 0 ? void 0 : _b.toLowerCase()) !== null && _c !== void 0 ? _c : 'lax', domain, partitionKey: '' }),
|
|
41
51
|
networkEvents: {
|
|
42
52
|
requestEvents: [
|
|
43
53
|
{
|
|
@@ -60,6 +70,15 @@ function parseRequestWillBeSentExtraInfo(associatedCookies, cookieDB, requestUrl
|
|
|
60
70
|
? exemptionReason
|
|
61
71
|
: undefined,
|
|
62
72
|
};
|
|
73
|
+
if (partitionKey) {
|
|
74
|
+
if (typeof partitionKey === 'string') {
|
|
75
|
+
singleCookie.parsedCookie.partitionKey = partitionKey;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
singleCookie.parsedCookie.partitionKey =
|
|
79
|
+
partitionKey === null || partitionKey === void 0 ? void 0 : partitionKey.topLevelSite;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
63
82
|
//Sometimes frameId comes empty so it shows data in other frames where cookie should not be shown.
|
|
64
83
|
if (frameIds.length > 0) {
|
|
65
84
|
singleCookie.frameIdList = [...frameIds];
|
|
@@ -68,5 +87,4 @@ function parseRequestWillBeSentExtraInfo(associatedCookies, cookieDB, requestUrl
|
|
|
68
87
|
});
|
|
69
88
|
return cookies;
|
|
70
89
|
}
|
|
71
|
-
exports.default = parseRequestWillBeSentExtraInfo;
|
|
72
90
|
//# sourceMappingURL=parseRequestWillBeSentExtraInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseRequestWillBeSentExtraInfo.js","sourceRoot":"","sources":["../../src/utils/parseRequestWillBeSentExtraInfo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseRequestWillBeSentExtraInfo.js","sourceRoot":"","sources":["../../src/utils/parseRequestWillBeSentExtraInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0CA,kDA6EC;AAnGD;;GAEG;AACH,oDAI0B;AAC1B,kGAA0E;AAC1E,8EAAsD;AACtD,kEAA0C;AAE1C;;;;;;;;;GASG;AACH,SAAwB,+BAA+B,CACrD,iBAAwF,EACxF,QAAwB,EACxB,UAAkB,EAClB,MAAc,EACd,QAAkB,EAClB,SAAiB;IAEjB,MAAM,OAAO,GAAiB,EAAE,CAAC;IAEjC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,EAAE;;QACxE,MAAM,uBAAuB,GAAG,IAAA,sCAA4B,EA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f,UAAU,EAAE,SAAqC;YACjD,YAAY,EAAE,IAAA,sBAAY,EAAC,MAAM,EAAE,MAAM,CAAC;YAC1C,WAAW,EAAE,EAAE;YACf,eAAe,EACb,eAAe,IAAI,eAAe,KAAK,MAAM;gBAC3C,CAAC,CAAC,eAAe;gBACjB,CAAC,CAAC,SAAS;SAChB,CAAC;QAEF,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;gBACrC,YAAY,CAAC,YAAY,CAAC,YAAY,GAAG,YAAsB,CAAC;YAClE,CAAC;iBAAM,CAAC;gBACN,YAAY,CAAC,YAAY,CAAC,YAAY;oBACpC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,YAAsB,CAAC;YACzC,CAAC;QACH,CAAC;QAED,kGAAkG;QAClG,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,YAAY,CAAC,WAAW,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = parseResponseReceivedExtraInfo;
|
|
6
7
|
/*
|
|
7
8
|
* Copyright 2023 Google LLC
|
|
8
9
|
*
|
|
@@ -47,8 +48,8 @@ function parseResponseReceivedExtraInfo(headers, blockedCookies, exemptedCookies
|
|
|
47
48
|
const cookies = [];
|
|
48
49
|
const responseToParse = (_a = headers['set-cookie']) !== null && _a !== void 0 ? _a : headers['Set-Cookie'];
|
|
49
50
|
responseToParse === null || responseToParse === void 0 ? void 0 : responseToParse.split('\n').forEach((headerLine) => {
|
|
50
|
-
var _a;
|
|
51
|
-
|
|
51
|
+
var _a, _b;
|
|
52
|
+
const parsedCookie = (0, simple_cookie_1.parse)(headerLine);
|
|
52
53
|
const blockedCookie = blockedCookies.find((c) => {
|
|
53
54
|
var _a;
|
|
54
55
|
if (c.cookie) {
|
|
@@ -67,12 +68,6 @@ function parseResponseReceivedExtraInfo(headers, blockedCookies, exemptedCookies
|
|
|
67
68
|
return false;
|
|
68
69
|
});
|
|
69
70
|
const effectiveExpirationDate = (0, calculateEffectiveExpiryDate_1.default)(parsedCookie.expires);
|
|
70
|
-
if (headerLine.toLowerCase().includes('partitioned')) {
|
|
71
|
-
parsedCookie = Object.assign(Object.assign({}, parsedCookie), { partitionKey: cookiePartitionKey && typeof cookiePartitionKey === 'string'
|
|
72
|
-
? cookiePartitionKey
|
|
73
|
-
: //@ts-ignore This is to handle both stable and canary version of Chrome.
|
|
74
|
-
cookiePartitionKey === null || cookiePartitionKey === void 0 ? void 0 : cookiePartitionKey.topLevelSite });
|
|
75
|
-
}
|
|
76
71
|
let domain;
|
|
77
72
|
if (parsedCookie === null || parsedCookie === void 0 ? void 0 : parsedCookie.domain) {
|
|
78
73
|
domain = parsedCookie === null || parsedCookie === void 0 ? void 0 : parsedCookie.domain;
|
|
@@ -83,7 +78,9 @@ function parseResponseReceivedExtraInfo(headers, blockedCookies, exemptedCookies
|
|
|
83
78
|
const singleCookie = {
|
|
84
79
|
isBlocked: blockedCookie ? true : false,
|
|
85
80
|
blockedReasons: blockedCookie ? blockedCookie === null || blockedCookie === void 0 ? void 0 : blockedCookie.blockedReasons : [],
|
|
86
|
-
parsedCookie: Object.assign(Object.assign({}, parsedCookie), {
|
|
81
|
+
parsedCookie: Object.assign(Object.assign({}, parsedCookie), { httponly: (_a = parsedCookie === null || parsedCookie === void 0 ? void 0 : parsedCookie.httponly) !== null && _a !== void 0 ? _a : false, expires: effectiveExpirationDate, samesite: parsedCookie.samesite !== ''
|
|
82
|
+
? (_b = parsedCookie.samesite) === null || _b === void 0 ? void 0 : _b.toLowerCase()
|
|
83
|
+
: 'lax', domain, partitionKey: '' }),
|
|
87
84
|
networkEvents: {
|
|
88
85
|
requestEvents: [],
|
|
89
86
|
responseEvents: [
|
|
@@ -108,6 +105,15 @@ function parseResponseReceivedExtraInfo(headers, blockedCookies, exemptedCookies
|
|
|
108
105
|
? exemptedCookie === null || exemptedCookie === void 0 ? void 0 : exemptedCookie.exemptionReason
|
|
109
106
|
: undefined,
|
|
110
107
|
};
|
|
108
|
+
if (headerLine.toLowerCase().includes('partitioned')) {
|
|
109
|
+
if (typeof cookiePartitionKey === 'string') {
|
|
110
|
+
singleCookie.parsedCookie.partitionKey = cookiePartitionKey;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
singleCookie.parsedCookie.partitionKey =
|
|
114
|
+
cookiePartitionKey === null || cookiePartitionKey === void 0 ? void 0 : cookiePartitionKey.topLevelSite;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
111
117
|
//Sometimes frameId comes empty so it shows data in other frames where cookie should not be shown.
|
|
112
118
|
if (frameIds.length > 0) {
|
|
113
119
|
singleCookie.frameIdList = [...frameIds];
|
|
@@ -116,5 +122,4 @@ function parseResponseReceivedExtraInfo(headers, blockedCookies, exemptedCookies
|
|
|
116
122
|
});
|
|
117
123
|
return cookies;
|
|
118
124
|
}
|
|
119
|
-
exports.default = parseResponseReceivedExtraInfo;
|
|
120
125
|
//# sourceMappingURL=parseResponseReceivedExtraInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseResponseReceivedExtraInfo.js","sourceRoot":"","sources":["../../src/utils/parseResponseReceivedExtraInfo.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"parseResponseReceivedExtraInfo.js","sourceRoot":"","sources":["../../src/utils/parseResponseReceivedExtraInfo.ts"],"names":[],"mappings":";;;;;AA8CA,iDAuGC;AArJD;;;;;;;;;;;;;;GAcG;AACH;;GAEG;A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erText;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2023 Google LLC
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* This will make the pending text non-spinnable and make the add a new succeess spinnier.
|
|
21
|
+
* @param spinnies spinnies object to add or update the spinners in the CLI output.
|
|
22
|
+
* @param spinnerName name of the spinner.
|
|
23
|
+
* @param newSpinnerText The text to be added to the new spinner.
|
|
24
|
+
* @param indent The indentation for the new text.
|
|
25
|
+
*/
|
|
26
|
+
function removeAndAddNewSpinnerText(spinnies, spinnerName, newSpinnerText, indent = 0) {
|
|
27
|
+
spinnies.add(`${spinnerName}-succees`, {
|
|
28
|
+
text: newSpinnerText,
|
|
29
|
+
status: 'succeed',
|
|
30
|
+
indent,
|
|
31
|
+
});
|
|
32
|
+
spinnies.update(spinnerName, {
|
|
33
|
+
status: 'non-spinnable',
|
|
34
|
+
indent,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=removeAndAddNewSpinnerText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeAndAddNewSpinnerText.js","sourceRoot":"","sources":["../../src/utils/removeAndAddNewSpinnerText.ts"],"names":[],"mappings":";;AAsBA,6CAgBC;AAtCD;;;;;;;;;;;;;;GAcG;AACH;;;;;;GAMG;AACH,SAAwB,0BAA0B,CAChD,QAAa,EACb,WAAmB,EACnB,cAAsB,EACtB,MAAM,GAAG,CAAC;IAEV,QAAQ,CAAC,GAAG,CAAC,GAAG,WAAW,UAAU,EAAE;QACrC,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,SAAS;QACjB,MAAM;KACP,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE;QAC3B,MAAM,EAAE,eAAe;QACvB,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.default = resolveWithTimeout;
|
|
18
19
|
/**
|
|
19
20
|
* Time a promise.
|
|
20
21
|
* @param {Promise<T>} promise - A promise that need to be timed.
|
|
@@ -34,5 +35,4 @@ function resolveWithTimeout(promise, resolveInto, timeout) {
|
|
|
34
35
|
Promise.race([promise, timeoutPromise]).then(resolve).catch(reject);
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
|
-
exports.default = resolveWithTimeout;
|
|
38
38
|
//# sourceMappingURL=resolveWithTimeout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveWithTimeout.js","sourceRoot":"","sources":["../../src/utils/resolveWithTimeout.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;
|
|
1
|
+
{"version":3,"file":"resolveWithTimeout.js","sourceRoot":"","sources":["../../src/utils/resolveWithTimeout.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AASH,qCAgBC;AAvBD;;;;;;GAMG;AACH,SAAwB,kBAAkB,CACxC,OAAmB,EACnB,WAAc,EACd,OAAe;IAEf,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,kEAAkE;QAClE,MAAM,cAAc,GAAG,IAAI,OAAO,CAAI,CAAC,cAAc,EAAE,EAAE;YACvD,UAAU,CAAC,GAAG,EAAE;gBACd,cAAc,CAAC,WAAW,CAAC,CAAC;YAC9B,CAAC,EAAE,OAAO,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,oEAAoE;QACpE,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -33,7 +33,9 @@ const sanitizeCsvRecord = (record) => {
|
|
|
33
33
|
return '';
|
|
34
34
|
}
|
|
35
35
|
recordCopy = recordCopy.replace(/"/g, '""');
|
|
36
|
-
return recordCopy.includes(',')
|
|
36
|
+
return recordCopy.includes(',') || recordCopy.includes('"')
|
|
37
|
+
? '"' + recordCopy + '"'
|
|
38
|
+
: recordCopy;
|
|
37
39
|
};
|
|
38
40
|
exports.default = sanitizeCsvRecord;
|
|
39
41
|
//# sourceMappingURL=sanitizeCsvRecord.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeCsvRecord.js","sourceRoot":"","sources":["../../src/utils/sanitizeCsvRecord.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;GAcG;AACH;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,MAAe,EAAU,EAAE;IACpD,IAAI,UAAyB,CAAC;IAE9B,IAAI,MAAM,YAAY,IAAI,EAAE,CAAC;QAC3B,UAAU,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACtC,UAAU,GAAG,MAAM,CAAC;IACtB,CAAC;SAAM,CAAC;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"sanitizeCsvRecord.js","sourceRoot":"","sources":["../../src/utils/sanitizeCsvRecord.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;GAcG;AACH;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,MAAe,EAAU,EAAE;IACpD,IAAI,UAAyB,CAAC;IAE9B,IAAI,MAAM,YAAY,IAAI,EAAE,CAAC;QAC3B,UAAU,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACtC,UAAU,GAAG,MAAM,CAAC;IACtB,CAAC;SAAM,CAAC;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;QACzD,CAAC,CAAC,GAAG,GAAG,UAAU,GAAG,GAAG;QACxB,CAAC,CAAC,UAAU,CAAC;AACjB,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC"}
|
|
@@ -75,7 +75,7 @@ export type responseEvent = {
|
|
|
75
75
|
};
|
|
76
76
|
export type CookieData = {
|
|
77
77
|
parsedCookie: ParsedCookie & {
|
|
78
|
-
partitionKey
|
|
78
|
+
partitionKey: string;
|
|
79
79
|
priority?: 'Low' | 'Medium' | 'High';
|
|
80
80
|
size?: number;
|
|
81
81
|
};
|
|
@@ -85,7 +85,7 @@ export type CookieData = {
|
|
|
85
85
|
};
|
|
86
86
|
analytics?: CookieAnalytics | null;
|
|
87
87
|
url?: string;
|
|
88
|
-
headerType?: 'response' | 'request' | 'javascript';
|
|
88
|
+
headerType?: 'response' | 'request' | 'javascript' | 'http';
|
|
89
89
|
isFirstParty?: boolean | null;
|
|
90
90
|
frameIdList?: Array<number | string>;
|
|
91
91
|
blockedReasons?: BlockedReason[];
|
|
@@ -96,6 +96,7 @@ export type CookieData = {
|
|
|
96
96
|
outboundBlock: BLOCK_STATUS;
|
|
97
97
|
};
|
|
98
98
|
exemptionReason?: Protocol.Network.CookieExemptionReason;
|
|
99
|
+
pageUrl?: string;
|
|
99
100
|
};
|
|
100
101
|
export type CookieTableData = CookieData & {
|
|
101
102
|
frameUrls?: string | string[];
|
|
@@ -166,12 +167,14 @@ export type CookieJsonDataType = {
|
|
|
166
167
|
name: string;
|
|
167
168
|
value: string;
|
|
168
169
|
domain: string;
|
|
169
|
-
partitionKey
|
|
170
|
+
partitionKey: string;
|
|
170
171
|
path: string;
|
|
171
172
|
expires: string;
|
|
172
|
-
|
|
173
|
+
httponly: boolean;
|
|
173
174
|
secure: boolean;
|
|
174
|
-
|
|
175
|
+
samesite: string;
|
|
176
|
+
priority?: 'Low' | 'Medium' | 'High';
|
|
177
|
+
size?: number;
|
|
175
178
|
};
|
|
176
179
|
analytics: {
|
|
177
180
|
platform: string;
|
|
@@ -207,6 +210,7 @@ export type CompleteJson = {
|
|
|
207
210
|
frameCookies: {
|
|
208
211
|
[cookieKey: string]: CookieJsonDataType;
|
|
209
212
|
};
|
|
213
|
+
frameType?: string | undefined;
|
|
210
214
|
};
|
|
211
215
|
};
|
|
212
216
|
libraryMatches: {
|
|
@@ -15,13 +15,13 @@ declare const CookieBlockedReason: {
|
|
|
15
15
|
SamePartyFromCrossPartyContext: string[];
|
|
16
16
|
NameValuePairExceedsMaxSize: string[];
|
|
17
17
|
InvalidDomain: string[];
|
|
18
|
-
SameSiteLax: string;
|
|
19
|
-
SyntaxError: string;
|
|
20
|
-
SchemeNotSupported: string;
|
|
21
|
-
OverwriteSecure: string;
|
|
22
|
-
InvalidPrefix: string;
|
|
23
|
-
SamePartyConflictsWithOtherAttributes: string;
|
|
24
|
-
DisallowedCharacter: string;
|
|
25
|
-
NoCookieContent: string;
|
|
18
|
+
SameSiteLax: string[];
|
|
19
|
+
SyntaxError: string[];
|
|
20
|
+
SchemeNotSupported: string[];
|
|
21
|
+
OverwriteSecure: string[];
|
|
22
|
+
InvalidPrefix: string[];
|
|
23
|
+
SamePartyConflictsWithOtherAttributes: string[];
|
|
24
|
+
DisallowedCharacter: string[];
|
|
25
|
+
NoCookieContent: string[];
|
|
26
26
|
};
|
|
27
27
|
export default CookieBlockedReason;
|
|
@@ -14,15 +14,15 @@ declare const cookieIssueDetails: {
|
|
|
14
14
|
WarnCrossSiteRedirectDowngradeChangesInclusion: () => string;
|
|
15
15
|
};
|
|
16
16
|
CookieExclusionReason: {
|
|
17
|
-
ExcludeSameSiteUnspecifiedTreatedAsLax: (warningReasons?: string[]
|
|
18
|
-
ExcludeSameSiteNoneInsecure: (operation?: string
|
|
19
|
-
ExcludeSameSiteLax: (warningReasons?: string[]
|
|
20
|
-
ExcludeSameSiteStrict: (warningReasons?: string[]
|
|
17
|
+
ExcludeSameSiteUnspecifiedTreatedAsLax: (warningReasons?: string[], operation?: string, cookieUrl?: string) => string;
|
|
18
|
+
ExcludeSameSiteNoneInsecure: (operation?: string) => string;
|
|
19
|
+
ExcludeSameSiteLax: (warningReasons?: string[], operation?: string, cookieUrl?: string) => string;
|
|
20
|
+
ExcludeSameSiteStrict: (warningReasons?: string[], operation?: string, cookieUrl?: string) => string;
|
|
21
21
|
ExcludeInvalidSameParty: () => string;
|
|
22
22
|
ExcludeSamePartyCrossPartyContext: () => string;
|
|
23
23
|
ExcludeDomainNonASCII: () => string;
|
|
24
24
|
ExcludeThirdPartyCookieBlockedInFirstPartySet: () => string;
|
|
25
|
-
ExcludeThirdPartyPhaseout: (operation?: string
|
|
25
|
+
ExcludeThirdPartyPhaseout: (operation?: string) => string;
|
|
26
26
|
};
|
|
27
27
|
CookieBlockedReason: {
|
|
28
28
|
SecureOnly: string[];
|
|
@@ -41,14 +41,14 @@ declare const cookieIssueDetails: {
|
|
|
41
41
|
SamePartyFromCrossPartyContext: string[];
|
|
42
42
|
NameValuePairExceedsMaxSize: string[];
|
|
43
43
|
InvalidDomain: string[];
|
|
44
|
-
SameSiteLax: string;
|
|
45
|
-
SyntaxError: string;
|
|
46
|
-
SchemeNotSupported: string;
|
|
47
|
-
OverwriteSecure: string;
|
|
48
|
-
InvalidPrefix: string;
|
|
49
|
-
SamePartyConflictsWithOtherAttributes: string;
|
|
50
|
-
DisallowedCharacter: string;
|
|
51
|
-
NoCookieContent: string;
|
|
44
|
+
SameSiteLax: string[];
|
|
45
|
+
SyntaxError: string[];
|
|
46
|
+
SchemeNotSupported: string[];
|
|
47
|
+
OverwriteSecure: string[];
|
|
48
|
+
InvalidPrefix: string[];
|
|
49
|
+
SamePartyConflictsWithOtherAttributes: string[];
|
|
50
|
+
DisallowedCharacter: string[];
|
|
51
|
+
NoCookieContent: string[];
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
export default cookieIssueDetails;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { default as filterFramesWithCookies } from './utils/filterFramesWithCook
|
|
|
3
3
|
export { default as filterCookiesByFrame } from './utils/filterCookiesByFrame';
|
|
4
4
|
export { default as getCookieKey } from './utils/getCookieKey';
|
|
5
5
|
export { default as findAnalyticsMatch, emptyAnalytics, } from './utils/findAnalyticsMatch';
|
|
6
|
+
export { default as removeAndAddNewSpinnerText } from './utils/removeAndAddNewSpinnerText';
|
|
6
7
|
export { default as calculateEffectiveExpiryDate } from './utils/calculateEffectiveExpiryDate';
|
|
7
8
|
export { default as sanitizeCsvRecord } from './utils/sanitizeCsvRecord';
|
|
8
9
|
export { parseUrl } from './utils/parseUrl';
|
|
@@ -20,6 +21,7 @@ export * from './utils/contextSelector';
|
|
|
20
21
|
export { default as addUTMParams, type MediumType } from './utils/addUTMParams';
|
|
21
22
|
export { default as delay } from './utils/delay';
|
|
22
23
|
export { default as mergeDeep } from './utils/mergeDeep';
|
|
24
|
+
export { default as getCurrentDateAndTime } from './utils/getCurrentDateAndTime';
|
|
23
25
|
export { default as resolveWithTimeout } from './utils/resolveWithTimeout';
|
|
24
26
|
export { default as deriveBlockingStatus } from './utils/deriveBlockingStatus';
|
|
25
27
|
export { default as getLegendDescription } from './utils/getLegendDescription';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export type DetectedSignature = {
|
|
3
2
|
feature: {
|
|
4
3
|
type: 'link';
|
|
@@ -26,7 +25,7 @@ export type ScriptTagUnderCheck = {
|
|
|
26
25
|
content: string;
|
|
27
26
|
type?: string;
|
|
28
27
|
};
|
|
29
|
-
export type DetectionFunctions = (arg0: ScriptTagUnderCheck, arg1: DetectedSignature[], arg2: number, arg3
|
|
28
|
+
export type DetectionFunctions = (arg0: ScriptTagUnderCheck, arg1: DetectedSignature[], arg2: number, arg3: number) => {
|
|
30
29
|
signatureMatches: number;
|
|
31
30
|
matches: DetectedSignature[];
|
|
32
31
|
moduleMatch?: number;
|
|
@@ -2,3 +2,5 @@ export { default as generateCookiesWithIssuesCSV } from './generateCookiesWithIs
|
|
|
2
2
|
export { default as generateAllCookiesCSV } from './generateAllCookiesCSV';
|
|
3
3
|
export { default as generateSummaryDataCSV } from './generateSummaryDataCSV';
|
|
4
4
|
export { default as generateTechnologyCSV } from './generateTechnologyCSV';
|
|
5
|
+
export { default as generateCLICookieTableCSV } from './generateCLICookieTableCSV';
|
|
6
|
+
export { default as generateExtensionCookieTableCSV } from './generateExtensionCookietableCSV';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats the current date and time into a specified string format.
|
|
3
|
+
* The supported formats are:
|
|
4
|
+
* - 'YYYY-MM-DD_HH-MM-SS': 24-hour format with seconds (e.g., 2024-07-19_14-30-45)
|
|
5
|
+
* - 'DD MMMM, YYYY, hh:mm:ssam/pm': 12-hour format with seconds and AM/PM (e.g., 19 July, 2024, 02:30:45pm)
|
|
6
|
+
* @param format {string} The format in which the date is required.
|
|
7
|
+
* @returns {string} The formatted date string.
|
|
8
|
+
*/
|
|
9
|
+
declare function getCurrentDateAndTime(format: 'YYYY-MM-DD_HH-MM-SS' | 'DD MMMM, YYYY, hh:mm:ssam/pm'): string;
|
|
10
|
+
export default getCurrentDateAndTime;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This will make the pending text non-spinnable and make the add a new succeess spinnier.
|
|
3
|
+
* @param spinnies spinnies object to add or update the spinners in the CLI output.
|
|
4
|
+
* @param spinnerName name of the spinner.
|
|
5
|
+
* @param newSpinnerText The text to be added to the new spinner.
|
|
6
|
+
* @param indent The indentation for the new text.
|
|
7
|
+
*/
|
|
8
|
+
export default function removeAndAddNewSpinnerText(spinnies: any, spinnerName: string, newSpinnerText: string, indent?: number): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-psat/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1-1",
|
|
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",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "tsc",
|
|
15
15
|
"dev": "tsc-watch",
|
|
16
|
-
"
|
|
16
|
+
"prebuild": "rimraf dist dist-types tsconfig.tsbuildinfo",
|
|
17
17
|
"publish:local": "npm publish --registry=http://localhost:4873",
|
|
18
18
|
"publish:remote": "npm publish --access=public --registry=https://registry.npmjs.org",
|
|
19
19
|
"unpublish:local": "npm unpublish --registry=http://localhost:4873 --force",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "
|
|
24
|
+
"url": "https://github.com/GoogleChromeLabs/ps-analysis-tool",
|
|
25
25
|
"directory": "packages/common"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"tldts": "^6.0.14"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"devtools-protocol": "^0.0.
|
|
43
|
+
"devtools-protocol": "^0.0.1333880"
|
|
44
44
|
}
|
|
45
45
|
}
|