@ghostery/config 0.0.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/README.md +45 -0
- package/dist/commonjs/actions.js +20 -0
- package/dist/commonjs/flags.js +24 -0
- package/dist/commonjs/index.js +24 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/platforms.js +20 -0
- package/dist/esm/actions.js +16 -0
- package/dist/esm/flags.js +20 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/platforms.js +16 -0
- package/package.json +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @ghostery/config-types
|
|
2
|
+
|
|
3
|
+
Shared TypeScript types for Ghostery remote configuration.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @ghostery/config-types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### In TypeScript/JavaScript projects:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { Config, Platform, Action, Flag } from '@ghostery/config-types';
|
|
17
|
+
import { isPlatform, isAction, isFlag } from '@ghostery/config-types';
|
|
18
|
+
|
|
19
|
+
// Use the types
|
|
20
|
+
const config: Config = {
|
|
21
|
+
domains: {
|
|
22
|
+
"example.com": {
|
|
23
|
+
issueUrl: "https://github.com/...",
|
|
24
|
+
actions: ["disable-autoconsent"],
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
flags: {
|
|
28
|
+
"pause-assistant": [{
|
|
29
|
+
percentage: 10
|
|
30
|
+
}]
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Use type guards
|
|
35
|
+
if (isPlatform("firefox")) {
|
|
36
|
+
console.log("Valid platform");
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Available Types
|
|
41
|
+
|
|
42
|
+
- `Platform`: "firefox" | "safari" | "chromium"
|
|
43
|
+
- `Action`: "disable-autoconsent" | "disable-antitracking-modification" | "pause-assistant"
|
|
44
|
+
- `Flag`: Various feature flags
|
|
45
|
+
- `Config`: Main configuration interface
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2025 Ghostery GmbH
|
|
3
|
+
//
|
|
4
|
+
// Use of this source code is governed by an MIT-style
|
|
5
|
+
// license that can be found in the LICENSE file or at
|
|
6
|
+
// https://opensource.org/licenses/MIT.
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ACTIONS = exports.ACTION_PAUSE_ASSISTANT = exports.ACTION_DISABLE_AUTOCONSENT = exports.ACTION_DISABLE_ANTITRACKING_MODIFICATION = void 0;
|
|
9
|
+
exports.isAction = isAction;
|
|
10
|
+
exports.ACTION_DISABLE_ANTITRACKING_MODIFICATION = "disable-antitracking-modification";
|
|
11
|
+
exports.ACTION_DISABLE_AUTOCONSENT = "disable-autoconsent";
|
|
12
|
+
exports.ACTION_PAUSE_ASSISTANT = "pause-assistant";
|
|
13
|
+
exports.ACTIONS = [
|
|
14
|
+
exports.ACTION_DISABLE_ANTITRACKING_MODIFICATION,
|
|
15
|
+
exports.ACTION_DISABLE_AUTOCONSENT,
|
|
16
|
+
exports.ACTION_PAUSE_ASSISTANT,
|
|
17
|
+
];
|
|
18
|
+
function isAction(action) {
|
|
19
|
+
return exports.ACTIONS.includes(action);
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2025 Ghostery GmbH
|
|
3
|
+
//
|
|
4
|
+
// Use of this source code is governed by an MIT-style
|
|
5
|
+
// license that can be found in the LICENSE file or at
|
|
6
|
+
// https://opensource.org/licenses/MIT.
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.FLAGS = exports.FLAG_PAUSE_ASSISTANT = exports.FLAG_FIREFOX_CONTENT_SCRIPT_SCRIPTLETS = exports.FLAG_EXTENDED_SELECTORS = exports.FLAG_DYNAMIC_DNR_FIXES = exports.FLAG_CHROMIUM_INJECT_COSMETICS_ON_RESPONSE_STARTED = void 0;
|
|
9
|
+
exports.isFlag = isFlag;
|
|
10
|
+
exports.FLAG_CHROMIUM_INJECT_COSMETICS_ON_RESPONSE_STARTED = "chromium-inject-cosmetics-on-response-started";
|
|
11
|
+
exports.FLAG_DYNAMIC_DNR_FIXES = "dynamic-dnr-fixes";
|
|
12
|
+
exports.FLAG_EXTENDED_SELECTORS = "extended-selectors";
|
|
13
|
+
exports.FLAG_FIREFOX_CONTENT_SCRIPT_SCRIPTLETS = "firefox-content-script-scriptlets";
|
|
14
|
+
exports.FLAG_PAUSE_ASSISTANT = "pause-assistant";
|
|
15
|
+
exports.FLAGS = [
|
|
16
|
+
exports.FLAG_CHROMIUM_INJECT_COSMETICS_ON_RESPONSE_STARTED,
|
|
17
|
+
exports.FLAG_DYNAMIC_DNR_FIXES,
|
|
18
|
+
exports.FLAG_EXTENDED_SELECTORS,
|
|
19
|
+
exports.FLAG_FIREFOX_CONTENT_SCRIPT_SCRIPTLETS,
|
|
20
|
+
exports.FLAG_PAUSE_ASSISTANT,
|
|
21
|
+
];
|
|
22
|
+
function isFlag(flag) {
|
|
23
|
+
return exports.FLAGS.includes(flag);
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2025 Ghostery GmbH
|
|
3
|
+
//
|
|
4
|
+
// Use of this source code is governed by an MIT-style
|
|
5
|
+
// license that can be found in the LICENSE file or at
|
|
6
|
+
// https://opensource.org/licenses/MIT.
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
__exportStar(require("./platforms.js"), exports);
|
|
23
|
+
__exportStar(require("./actions.js"), exports);
|
|
24
|
+
__exportStar(require("./flags.js"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2025 Ghostery GmbH
|
|
3
|
+
//
|
|
4
|
+
// Use of this source code is governed by an MIT-style
|
|
5
|
+
// license that can be found in the LICENSE file or at
|
|
6
|
+
// https://opensource.org/licenses/MIT.
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.PLATFORMS = exports.PLATFORM_SAFARI = exports.PLATFORM_FIREFOX = exports.PLATFORM_CHROMIUM = void 0;
|
|
9
|
+
exports.isPlatform = isPlatform;
|
|
10
|
+
exports.PLATFORM_CHROMIUM = "chromium";
|
|
11
|
+
exports.PLATFORM_FIREFOX = "firefox";
|
|
12
|
+
exports.PLATFORM_SAFARI = "safari";
|
|
13
|
+
exports.PLATFORMS = [
|
|
14
|
+
exports.PLATFORM_CHROMIUM,
|
|
15
|
+
exports.PLATFORM_FIREFOX,
|
|
16
|
+
exports.PLATFORM_SAFARI,
|
|
17
|
+
];
|
|
18
|
+
function isPlatform(platform) {
|
|
19
|
+
return exports.PLATFORMS.includes(platform);
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2025 Ghostery GmbH
|
|
2
|
+
//
|
|
3
|
+
// Use of this source code is governed by an MIT-style
|
|
4
|
+
// license that can be found in the LICENSE file or at
|
|
5
|
+
// https://opensource.org/licenses/MIT.
|
|
6
|
+
export const ACTION_DISABLE_ANTITRACKING_MODIFICATION = "disable-antitracking-modification";
|
|
7
|
+
export const ACTION_DISABLE_AUTOCONSENT = "disable-autoconsent";
|
|
8
|
+
export const ACTION_PAUSE_ASSISTANT = "pause-assistant";
|
|
9
|
+
export const ACTIONS = [
|
|
10
|
+
ACTION_DISABLE_ANTITRACKING_MODIFICATION,
|
|
11
|
+
ACTION_DISABLE_AUTOCONSENT,
|
|
12
|
+
ACTION_PAUSE_ASSISTANT,
|
|
13
|
+
];
|
|
14
|
+
export function isAction(action) {
|
|
15
|
+
return ACTIONS.includes(action);
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2025 Ghostery GmbH
|
|
2
|
+
//
|
|
3
|
+
// Use of this source code is governed by an MIT-style
|
|
4
|
+
// license that can be found in the LICENSE file or at
|
|
5
|
+
// https://opensource.org/licenses/MIT.
|
|
6
|
+
export const FLAG_CHROMIUM_INJECT_COSMETICS_ON_RESPONSE_STARTED = "chromium-inject-cosmetics-on-response-started";
|
|
7
|
+
export const FLAG_DYNAMIC_DNR_FIXES = "dynamic-dnr-fixes";
|
|
8
|
+
export const FLAG_EXTENDED_SELECTORS = "extended-selectors";
|
|
9
|
+
export const FLAG_FIREFOX_CONTENT_SCRIPT_SCRIPTLETS = "firefox-content-script-scriptlets";
|
|
10
|
+
export const FLAG_PAUSE_ASSISTANT = "pause-assistant";
|
|
11
|
+
export const FLAGS = [
|
|
12
|
+
FLAG_CHROMIUM_INJECT_COSMETICS_ON_RESPONSE_STARTED,
|
|
13
|
+
FLAG_DYNAMIC_DNR_FIXES,
|
|
14
|
+
FLAG_EXTENDED_SELECTORS,
|
|
15
|
+
FLAG_FIREFOX_CONTENT_SCRIPT_SCRIPTLETS,
|
|
16
|
+
FLAG_PAUSE_ASSISTANT,
|
|
17
|
+
];
|
|
18
|
+
export function isFlag(flag) {
|
|
19
|
+
return FLAGS.includes(flag);
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright 2025 Ghostery GmbH
|
|
2
|
+
//
|
|
3
|
+
// Use of this source code is governed by an MIT-style
|
|
4
|
+
// license that can be found in the LICENSE file or at
|
|
5
|
+
// https://opensource.org/licenses/MIT.
|
|
6
|
+
export * from "./platforms.js";
|
|
7
|
+
export * from "./actions.js";
|
|
8
|
+
export * from "./flags.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2025 Ghostery GmbH
|
|
2
|
+
//
|
|
3
|
+
// Use of this source code is governed by an MIT-style
|
|
4
|
+
// license that can be found in the LICENSE file or at
|
|
5
|
+
// https://opensource.org/licenses/MIT.
|
|
6
|
+
export const PLATFORM_CHROMIUM = "chromium";
|
|
7
|
+
export const PLATFORM_FIREFOX = "firefox";
|
|
8
|
+
export const PLATFORM_SAFARI = "safari";
|
|
9
|
+
export const PLATFORMS = [
|
|
10
|
+
PLATFORM_CHROMIUM,
|
|
11
|
+
PLATFORM_FIREFOX,
|
|
12
|
+
PLATFORM_SAFARI,
|
|
13
|
+
];
|
|
14
|
+
export function isPlatform(platform) {
|
|
15
|
+
return PLATFORMS.includes(platform);
|
|
16
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ghostery/config",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Shared TypeScript types for Ghostery configuration",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "tsc --noEmit",
|
|
10
|
+
"build": "tshy"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"tshy": "^1.0.0",
|
|
14
|
+
"typescript": "^5.0.0"
|
|
15
|
+
},
|
|
16
|
+
"tshy": {
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./src/index.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"ghostery",
|
|
23
|
+
"types",
|
|
24
|
+
"typescript",
|
|
25
|
+
"config"
|
|
26
|
+
],
|
|
27
|
+
"author": "",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"import": {
|
|
35
|
+
"source": "./src/index.ts",
|
|
36
|
+
"types": "./dist/esm/index.d.ts",
|
|
37
|
+
"default": "./dist/esm/index.js"
|
|
38
|
+
},
|
|
39
|
+
"require": {
|
|
40
|
+
"source": "./src/index.ts",
|
|
41
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
42
|
+
"default": "./dist/commonjs/index.js"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"main": "./dist/commonjs/index.js",
|
|
47
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
48
|
+
"type": "module",
|
|
49
|
+
"module": "./dist/esm/index.js"
|
|
50
|
+
}
|