@url-sanitize/core 2.0.4 → 2.0.5
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/index.d.ts +669 -665
- package/dist/index.js +501 -432
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,735 +1,739 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
1
2
|
type RuleSource = 'clearurls' | 'adguard' | 'brave' | 'firefox' | 'custom';
|
|
2
3
|
type RedirectMatchPart = 'url' | 'pathname';
|
|
3
4
|
type RedirectTargetEncoding = 'percent' | 'base64';
|
|
4
5
|
type RedirectPrependScheme = 'http' | 'https';
|
|
5
6
|
type SanitizerRule = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
kind: 'strip-param';
|
|
8
|
+
source: RuleSource;
|
|
9
|
+
provider: string;
|
|
10
|
+
urlPattern?: string;
|
|
11
|
+
paramPattern: string;
|
|
12
|
+
valuePattern?: string;
|
|
13
|
+
exceptions?: string[];
|
|
14
|
+
isReferralMarketing?: boolean;
|
|
14
15
|
} | {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
kind: 'raw-replace';
|
|
17
|
+
source: RuleSource;
|
|
18
|
+
provider: string;
|
|
19
|
+
urlPattern?: string;
|
|
20
|
+
pattern: string;
|
|
21
|
+
replacement: string;
|
|
22
|
+
exceptions?: string[];
|
|
22
23
|
} | {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
kind: 'unwrap-redirect';
|
|
25
|
+
source: RuleSource;
|
|
26
|
+
provider: string;
|
|
27
|
+
urlPattern?: string;
|
|
28
|
+
pattern: string;
|
|
29
|
+
captureGroup: number;
|
|
30
|
+
matchPart?: RedirectMatchPart;
|
|
31
|
+
targetEncoding?: RedirectTargetEncoding;
|
|
32
|
+
prependScheme?: RedirectPrependScheme;
|
|
33
|
+
targetTemplate?: string;
|
|
34
|
+
exceptions?: string[];
|
|
34
35
|
} | {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
kind: 'block-domain';
|
|
37
|
+
source: RuleSource;
|
|
38
|
+
provider: string;
|
|
39
|
+
urlPattern: string;
|
|
40
|
+
exceptions?: string[];
|
|
40
41
|
};
|
|
41
42
|
interface SanitizerCatalog {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
version: string;
|
|
44
|
+
generatedAt: string;
|
|
45
|
+
sources: Array<{
|
|
46
|
+
name: RuleSource;
|
|
47
|
+
version?: string;
|
|
48
|
+
hash?: string;
|
|
49
|
+
license?: string;
|
|
50
|
+
upstream?: string;
|
|
51
|
+
}>;
|
|
52
|
+
rules: SanitizerRule[];
|
|
52
53
|
}
|
|
53
54
|
interface MatchedRule {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
source: RuleSource;
|
|
56
|
+
provider: string;
|
|
57
|
+
kind: SanitizerRule['kind'];
|
|
58
|
+
detail?: string;
|
|
58
59
|
}
|
|
59
60
|
type SanitizeResult = {
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
kind: 'unchanged';
|
|
62
|
+
url: string;
|
|
62
63
|
} | {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
kind: 'cleaned';
|
|
65
|
+
original: string;
|
|
66
|
+
url: string;
|
|
67
|
+
strippedParams: string[];
|
|
68
|
+
matchedRules: MatchedRule[];
|
|
68
69
|
} | {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
kind: 'redirected';
|
|
71
|
+
original: string;
|
|
72
|
+
url: string;
|
|
73
|
+
via: MatchedRule;
|
|
73
74
|
} | {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
kind: 'blocked';
|
|
76
|
+
original: string;
|
|
77
|
+
via: MatchedRule;
|
|
77
78
|
};
|
|
78
79
|
interface SanitizerOptions {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
stripReferralMarketing?: boolean;
|
|
81
|
+
unwrapRedirects?: boolean;
|
|
82
|
+
domainBlocking?: boolean;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
declare function
|
|
86
|
-
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/catalog.d.ts
|
|
86
|
+
export declare function defineCatalog(catalog: SanitizerCatalog): SanitizerCatalog;
|
|
87
|
+
export declare function mergeCatalogs(first: SanitizerCatalog, ...rest: SanitizerCatalog[]): SanitizerCatalog;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/sanitize.d.ts
|
|
87
90
|
type Sanitizer = (input: string) => SanitizeResult;
|
|
88
|
-
declare function compileSanitizer(catalog: SanitizerCatalog, options?: SanitizerOptions): Sanitizer;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
readonly unwrapRedirects: {
|
|
101
|
-
readonly type: "boolean";
|
|
102
|
-
};
|
|
103
|
-
readonly domainBlocking: {
|
|
104
|
-
readonly type: "boolean";
|
|
105
|
-
};
|
|
91
|
+
export declare function compileSanitizer(catalog: SanitizerCatalog, options?: SanitizerOptions): Sanitizer;
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/schemas.d.ts
|
|
94
|
+
export declare const sanitizerOptionsJsonSchema: {
|
|
95
|
+
readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
96
|
+
readonly $id: 'https://url-sanitize.dev/schema/v1/options.json';
|
|
97
|
+
readonly title: 'url-sanitize options';
|
|
98
|
+
readonly type: 'object';
|
|
99
|
+
readonly additionalProperties: false;
|
|
100
|
+
readonly properties: {
|
|
101
|
+
readonly stripReferralMarketing: {
|
|
102
|
+
readonly type: 'boolean';
|
|
106
103
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
110
|
-
readonly $id: "https://url-sanitize.dev/schema/v1/catalog.json";
|
|
111
|
-
readonly title: "url-sanitize catalog";
|
|
112
|
-
readonly type: "object";
|
|
113
|
-
readonly required: readonly ["version", "generatedAt", "sources", "rules"];
|
|
114
|
-
readonly additionalProperties: false;
|
|
115
|
-
readonly properties: {
|
|
116
|
-
readonly version: {
|
|
117
|
-
readonly type: "string";
|
|
118
|
-
};
|
|
119
|
-
readonly generatedAt: {
|
|
120
|
-
readonly type: "string";
|
|
121
|
-
};
|
|
122
|
-
readonly sources: {
|
|
123
|
-
readonly type: "array";
|
|
124
|
-
readonly items: {
|
|
125
|
-
readonly type: "object";
|
|
126
|
-
readonly required: readonly ["name"];
|
|
127
|
-
readonly additionalProperties: false;
|
|
128
|
-
readonly properties: {
|
|
129
|
-
readonly name: {
|
|
130
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
131
|
-
};
|
|
132
|
-
readonly version: {
|
|
133
|
-
readonly type: "string";
|
|
134
|
-
};
|
|
135
|
-
readonly hash: {
|
|
136
|
-
readonly type: "string";
|
|
137
|
-
};
|
|
138
|
-
readonly license: {
|
|
139
|
-
readonly type: "string";
|
|
140
|
-
};
|
|
141
|
-
readonly upstream: {
|
|
142
|
-
readonly type: "string";
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
readonly rules: {
|
|
148
|
-
readonly type: "array";
|
|
149
|
-
readonly items: {
|
|
150
|
-
readonly oneOf: readonly [{
|
|
151
|
-
readonly type: "object";
|
|
152
|
-
readonly required: readonly ["kind", "source", "provider", "paramPattern"];
|
|
153
|
-
readonly additionalProperties: false;
|
|
154
|
-
readonly properties: {
|
|
155
|
-
readonly kind: {
|
|
156
|
-
readonly const: "strip-param";
|
|
157
|
-
};
|
|
158
|
-
readonly paramPattern: {
|
|
159
|
-
readonly type: "string";
|
|
160
|
-
};
|
|
161
|
-
readonly valuePattern: {
|
|
162
|
-
readonly type: "string";
|
|
163
|
-
};
|
|
164
|
-
readonly isReferralMarketing: {
|
|
165
|
-
readonly type: "boolean";
|
|
166
|
-
};
|
|
167
|
-
readonly source: {
|
|
168
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
169
|
-
};
|
|
170
|
-
readonly provider: {
|
|
171
|
-
readonly type: "string";
|
|
172
|
-
};
|
|
173
|
-
readonly urlPattern: {
|
|
174
|
-
readonly type: "string";
|
|
175
|
-
};
|
|
176
|
-
readonly exceptions: {
|
|
177
|
-
readonly type: "array";
|
|
178
|
-
readonly items: {
|
|
179
|
-
readonly type: "string";
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
}, {
|
|
184
|
-
readonly type: "object";
|
|
185
|
-
readonly required: readonly ["kind", "source", "provider", "pattern", "replacement"];
|
|
186
|
-
readonly additionalProperties: false;
|
|
187
|
-
readonly properties: {
|
|
188
|
-
readonly kind: {
|
|
189
|
-
readonly const: "raw-replace";
|
|
190
|
-
};
|
|
191
|
-
readonly pattern: {
|
|
192
|
-
readonly type: "string";
|
|
193
|
-
};
|
|
194
|
-
readonly replacement: {
|
|
195
|
-
readonly type: "string";
|
|
196
|
-
};
|
|
197
|
-
readonly source: {
|
|
198
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
199
|
-
};
|
|
200
|
-
readonly provider: {
|
|
201
|
-
readonly type: "string";
|
|
202
|
-
};
|
|
203
|
-
readonly urlPattern: {
|
|
204
|
-
readonly type: "string";
|
|
205
|
-
};
|
|
206
|
-
readonly exceptions: {
|
|
207
|
-
readonly type: "array";
|
|
208
|
-
readonly items: {
|
|
209
|
-
readonly type: "string";
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
}, {
|
|
214
|
-
readonly type: "object";
|
|
215
|
-
readonly required: readonly ["kind", "source", "provider", "pattern", "captureGroup"];
|
|
216
|
-
readonly additionalProperties: false;
|
|
217
|
-
readonly properties: {
|
|
218
|
-
readonly kind: {
|
|
219
|
-
readonly const: "unwrap-redirect";
|
|
220
|
-
};
|
|
221
|
-
readonly pattern: {
|
|
222
|
-
readonly type: "string";
|
|
223
|
-
};
|
|
224
|
-
readonly captureGroup: {
|
|
225
|
-
readonly type: "integer";
|
|
226
|
-
readonly minimum: 0;
|
|
227
|
-
};
|
|
228
|
-
readonly matchPart: {
|
|
229
|
-
readonly enum: readonly ["url", "pathname"];
|
|
230
|
-
};
|
|
231
|
-
readonly targetEncoding: {
|
|
232
|
-
readonly enum: readonly ["percent", "base64"];
|
|
233
|
-
};
|
|
234
|
-
readonly prependScheme: {
|
|
235
|
-
readonly enum: readonly ["http", "https"];
|
|
236
|
-
};
|
|
237
|
-
readonly targetTemplate: {
|
|
238
|
-
readonly type: "string";
|
|
239
|
-
};
|
|
240
|
-
readonly source: {
|
|
241
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
242
|
-
};
|
|
243
|
-
readonly provider: {
|
|
244
|
-
readonly type: "string";
|
|
245
|
-
};
|
|
246
|
-
readonly urlPattern: {
|
|
247
|
-
readonly type: "string";
|
|
248
|
-
};
|
|
249
|
-
readonly exceptions: {
|
|
250
|
-
readonly type: "array";
|
|
251
|
-
readonly items: {
|
|
252
|
-
readonly type: "string";
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
|
-
}, {
|
|
257
|
-
readonly type: "object";
|
|
258
|
-
readonly required: readonly ["kind", "source", "provider", "urlPattern"];
|
|
259
|
-
readonly additionalProperties: false;
|
|
260
|
-
readonly properties: {
|
|
261
|
-
readonly kind: {
|
|
262
|
-
readonly const: "block-domain";
|
|
263
|
-
};
|
|
264
|
-
readonly source: {
|
|
265
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
266
|
-
};
|
|
267
|
-
readonly provider: {
|
|
268
|
-
readonly type: "string";
|
|
269
|
-
};
|
|
270
|
-
readonly urlPattern: {
|
|
271
|
-
readonly type: "string";
|
|
272
|
-
};
|
|
273
|
-
readonly exceptions: {
|
|
274
|
-
readonly type: "array";
|
|
275
|
-
readonly items: {
|
|
276
|
-
readonly type: "string";
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
};
|
|
280
|
-
}];
|
|
281
|
-
};
|
|
282
|
-
};
|
|
104
|
+
readonly unwrapRedirects: {
|
|
105
|
+
readonly type: 'boolean';
|
|
283
106
|
};
|
|
107
|
+
readonly domainBlocking: {
|
|
108
|
+
readonly type: 'boolean';
|
|
109
|
+
};
|
|
110
|
+
};
|
|
284
111
|
};
|
|
285
|
-
declare const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
112
|
+
export declare const sanitizerCatalogJsonSchema: {
|
|
113
|
+
readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
114
|
+
readonly $id: 'https://url-sanitize.dev/schema/v1/catalog.json';
|
|
115
|
+
readonly title: 'url-sanitize catalog';
|
|
116
|
+
readonly type: 'object';
|
|
117
|
+
readonly required: readonly ['version', 'generatedAt', 'sources', 'rules'];
|
|
118
|
+
readonly additionalProperties: false;
|
|
119
|
+
readonly properties: {
|
|
120
|
+
readonly version: {
|
|
121
|
+
readonly type: 'string';
|
|
122
|
+
};
|
|
123
|
+
readonly generatedAt: {
|
|
124
|
+
readonly type: 'string';
|
|
125
|
+
};
|
|
126
|
+
readonly sources: {
|
|
127
|
+
readonly type: 'array';
|
|
128
|
+
readonly items: {
|
|
129
|
+
readonly type: 'object';
|
|
130
|
+
readonly required: readonly ['name'];
|
|
292
131
|
readonly additionalProperties: false;
|
|
293
132
|
readonly properties: {
|
|
133
|
+
readonly name: {
|
|
134
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
135
|
+
};
|
|
136
|
+
readonly version: {
|
|
137
|
+
readonly type: 'string';
|
|
138
|
+
};
|
|
139
|
+
readonly hash: {
|
|
140
|
+
readonly type: 'string';
|
|
141
|
+
};
|
|
142
|
+
readonly license: {
|
|
143
|
+
readonly type: 'string';
|
|
144
|
+
};
|
|
145
|
+
readonly upstream: {
|
|
146
|
+
readonly type: 'string';
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
readonly rules: {
|
|
152
|
+
readonly type: 'array';
|
|
153
|
+
readonly items: {
|
|
154
|
+
readonly oneOf: readonly [{
|
|
155
|
+
readonly type: 'object';
|
|
156
|
+
readonly required: readonly ['kind', 'source', 'provider', 'paramPattern'];
|
|
157
|
+
readonly additionalProperties: false;
|
|
158
|
+
readonly properties: {
|
|
159
|
+
readonly source: {
|
|
160
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
161
|
+
};
|
|
162
|
+
readonly provider: {
|
|
163
|
+
readonly type: 'string';
|
|
164
|
+
};
|
|
165
|
+
readonly urlPattern: {
|
|
166
|
+
readonly type: 'string';
|
|
167
|
+
};
|
|
168
|
+
readonly exceptions: {
|
|
169
|
+
readonly type: 'array';
|
|
170
|
+
readonly items: {
|
|
171
|
+
readonly type: 'string';
|
|
172
|
+
};
|
|
173
|
+
};
|
|
294
174
|
readonly kind: {
|
|
295
|
-
|
|
175
|
+
readonly const: 'strip-param';
|
|
296
176
|
};
|
|
297
|
-
readonly
|
|
298
|
-
|
|
177
|
+
readonly paramPattern: {
|
|
178
|
+
readonly type: 'string';
|
|
179
|
+
};
|
|
180
|
+
readonly valuePattern: {
|
|
181
|
+
readonly type: 'string';
|
|
182
|
+
};
|
|
183
|
+
readonly isReferralMarketing: {
|
|
184
|
+
readonly type: 'boolean';
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
}, {
|
|
188
|
+
readonly type: 'object';
|
|
189
|
+
readonly required: readonly ['kind', 'source', 'provider', 'pattern', 'replacement'];
|
|
190
|
+
readonly additionalProperties: false;
|
|
191
|
+
readonly properties: {
|
|
192
|
+
readonly source: {
|
|
193
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
194
|
+
};
|
|
195
|
+
readonly provider: {
|
|
196
|
+
readonly type: 'string';
|
|
197
|
+
};
|
|
198
|
+
readonly urlPattern: {
|
|
199
|
+
readonly type: 'string';
|
|
200
|
+
};
|
|
201
|
+
readonly exceptions: {
|
|
202
|
+
readonly type: 'array';
|
|
203
|
+
readonly items: {
|
|
204
|
+
readonly type: 'string';
|
|
205
|
+
};
|
|
299
206
|
};
|
|
300
|
-
};
|
|
301
|
-
}, {
|
|
302
|
-
readonly type: "object";
|
|
303
|
-
readonly required: readonly ["kind", "original", "url", "strippedParams", "matchedRules"];
|
|
304
|
-
readonly additionalProperties: false;
|
|
305
|
-
readonly properties: {
|
|
306
207
|
readonly kind: {
|
|
307
|
-
|
|
208
|
+
readonly const: 'raw-replace';
|
|
308
209
|
};
|
|
309
|
-
readonly
|
|
310
|
-
|
|
210
|
+
readonly pattern: {
|
|
211
|
+
readonly type: 'string';
|
|
311
212
|
};
|
|
312
|
-
readonly
|
|
313
|
-
|
|
213
|
+
readonly replacement: {
|
|
214
|
+
readonly type: 'string';
|
|
314
215
|
};
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
216
|
+
};
|
|
217
|
+
}, {
|
|
218
|
+
readonly type: 'object';
|
|
219
|
+
readonly required: readonly ['kind', 'source', 'provider', 'pattern', 'captureGroup'];
|
|
220
|
+
readonly additionalProperties: false;
|
|
221
|
+
readonly properties: {
|
|
222
|
+
readonly source: {
|
|
223
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
320
224
|
};
|
|
321
|
-
readonly
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
readonly type: "string";
|
|
333
|
-
};
|
|
334
|
-
readonly kind: {
|
|
335
|
-
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
336
|
-
};
|
|
337
|
-
readonly detail: {
|
|
338
|
-
readonly type: "string";
|
|
339
|
-
};
|
|
340
|
-
};
|
|
341
|
-
};
|
|
225
|
+
readonly provider: {
|
|
226
|
+
readonly type: 'string';
|
|
227
|
+
};
|
|
228
|
+
readonly urlPattern: {
|
|
229
|
+
readonly type: 'string';
|
|
230
|
+
};
|
|
231
|
+
readonly exceptions: {
|
|
232
|
+
readonly type: 'array';
|
|
233
|
+
readonly items: {
|
|
234
|
+
readonly type: 'string';
|
|
235
|
+
};
|
|
342
236
|
};
|
|
343
|
-
};
|
|
344
|
-
}, {
|
|
345
|
-
readonly type: "object";
|
|
346
|
-
readonly required: readonly ["kind", "original", "url", "via"];
|
|
347
|
-
readonly additionalProperties: false;
|
|
348
|
-
readonly properties: {
|
|
349
237
|
readonly kind: {
|
|
350
|
-
|
|
351
|
-
};
|
|
352
|
-
readonly
|
|
353
|
-
|
|
354
|
-
};
|
|
355
|
-
readonly
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
238
|
+
readonly const: 'unwrap-redirect';
|
|
239
|
+
};
|
|
240
|
+
readonly pattern: {
|
|
241
|
+
readonly type: 'string';
|
|
242
|
+
};
|
|
243
|
+
readonly captureGroup: {
|
|
244
|
+
readonly type: 'integer';
|
|
245
|
+
readonly minimum: 0;
|
|
246
|
+
};
|
|
247
|
+
readonly matchPart: {
|
|
248
|
+
readonly enum: readonly ["url", "pathname"];
|
|
249
|
+
};
|
|
250
|
+
readonly targetEncoding: {
|
|
251
|
+
readonly enum: readonly ["percent", "base64"];
|
|
252
|
+
};
|
|
253
|
+
readonly prependScheme: {
|
|
254
|
+
readonly enum: readonly ["http", "https"];
|
|
255
|
+
};
|
|
256
|
+
readonly targetTemplate: {
|
|
257
|
+
readonly type: 'string';
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
}, {
|
|
261
|
+
readonly type: 'object';
|
|
262
|
+
readonly required: readonly ['kind', 'source', 'provider', 'urlPattern'];
|
|
263
|
+
readonly additionalProperties: false;
|
|
264
|
+
readonly properties: {
|
|
265
|
+
readonly source: {
|
|
266
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
267
|
+
};
|
|
268
|
+
readonly provider: {
|
|
269
|
+
readonly type: 'string';
|
|
270
|
+
};
|
|
271
|
+
readonly urlPattern: {
|
|
272
|
+
readonly type: 'string';
|
|
273
|
+
};
|
|
274
|
+
readonly exceptions: {
|
|
275
|
+
readonly type: 'array';
|
|
276
|
+
readonly items: {
|
|
277
|
+
readonly type: 'string';
|
|
278
|
+
};
|
|
376
279
|
};
|
|
377
|
-
};
|
|
378
|
-
}, {
|
|
379
|
-
readonly type: "object";
|
|
380
|
-
readonly required: readonly ["kind", "original", "via"];
|
|
381
|
-
readonly additionalProperties: false;
|
|
382
|
-
readonly properties: {
|
|
383
280
|
readonly kind: {
|
|
384
|
-
|
|
385
|
-
};
|
|
386
|
-
readonly original: {
|
|
387
|
-
readonly type: "string";
|
|
388
|
-
};
|
|
389
|
-
readonly via: {
|
|
390
|
-
readonly type: "object";
|
|
391
|
-
readonly required: readonly ["source", "provider", "kind"];
|
|
392
|
-
readonly additionalProperties: false;
|
|
393
|
-
readonly properties: {
|
|
394
|
-
readonly source: {
|
|
395
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
396
|
-
};
|
|
397
|
-
readonly provider: {
|
|
398
|
-
readonly type: "string";
|
|
399
|
-
};
|
|
400
|
-
readonly kind: {
|
|
401
|
-
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
402
|
-
};
|
|
403
|
-
readonly detail: {
|
|
404
|
-
readonly type: "string";
|
|
405
|
-
};
|
|
406
|
-
};
|
|
281
|
+
readonly const: 'block-domain';
|
|
407
282
|
};
|
|
408
|
-
|
|
409
|
-
|
|
283
|
+
};
|
|
284
|
+
}];
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
};
|
|
410
288
|
};
|
|
411
|
-
declare const
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
289
|
+
export declare const sanitizeResultJsonSchema: {
|
|
290
|
+
readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
291
|
+
readonly $id: 'https://url-sanitize.dev/schema/v1/result.json';
|
|
292
|
+
readonly title: 'url-sanitize result';
|
|
293
|
+
readonly oneOf: readonly [{
|
|
294
|
+
readonly type: 'object';
|
|
295
|
+
readonly required: readonly ['kind', 'url'];
|
|
296
|
+
readonly additionalProperties: false;
|
|
297
|
+
readonly properties: {
|
|
298
|
+
readonly kind: {
|
|
299
|
+
readonly const: 'unchanged';
|
|
300
|
+
};
|
|
301
|
+
readonly url: {
|
|
302
|
+
readonly type: 'string';
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
}, {
|
|
306
|
+
readonly type: 'object';
|
|
307
|
+
readonly required: readonly ['kind', 'original', 'url', 'strippedParams', 'matchedRules'];
|
|
308
|
+
readonly additionalProperties: false;
|
|
309
|
+
readonly properties: {
|
|
310
|
+
readonly kind: {
|
|
311
|
+
readonly const: 'cleaned';
|
|
312
|
+
};
|
|
313
|
+
readonly original: {
|
|
314
|
+
readonly type: 'string';
|
|
315
|
+
};
|
|
316
|
+
readonly url: {
|
|
317
|
+
readonly type: 'string';
|
|
318
|
+
};
|
|
319
|
+
readonly strippedParams: {
|
|
320
|
+
readonly type: 'array';
|
|
321
|
+
readonly items: {
|
|
322
|
+
readonly type: 'string';
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
readonly matchedRules: {
|
|
326
|
+
readonly type: 'array';
|
|
327
|
+
readonly items: {
|
|
328
|
+
readonly type: 'object';
|
|
329
|
+
readonly required: readonly ['source', 'provider', 'kind'];
|
|
330
|
+
readonly additionalProperties: false;
|
|
331
|
+
readonly properties: {
|
|
332
|
+
readonly source: {
|
|
333
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
422
334
|
};
|
|
423
|
-
readonly
|
|
424
|
-
|
|
335
|
+
readonly provider: {
|
|
336
|
+
readonly type: 'string';
|
|
425
337
|
};
|
|
426
|
-
readonly
|
|
427
|
-
|
|
428
|
-
readonly items: {
|
|
429
|
-
readonly type: "object";
|
|
430
|
-
readonly required: readonly ["name"];
|
|
431
|
-
readonly additionalProperties: false;
|
|
432
|
-
readonly properties: {
|
|
433
|
-
readonly name: {
|
|
434
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
435
|
-
};
|
|
436
|
-
readonly version: {
|
|
437
|
-
readonly type: "string";
|
|
438
|
-
};
|
|
439
|
-
readonly hash: {
|
|
440
|
-
readonly type: "string";
|
|
441
|
-
};
|
|
442
|
-
readonly license: {
|
|
443
|
-
readonly type: "string";
|
|
444
|
-
};
|
|
445
|
-
readonly upstream: {
|
|
446
|
-
readonly type: "string";
|
|
447
|
-
};
|
|
448
|
-
};
|
|
449
|
-
};
|
|
338
|
+
readonly kind: {
|
|
339
|
+
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
450
340
|
};
|
|
451
|
-
readonly
|
|
452
|
-
|
|
453
|
-
readonly items: {
|
|
454
|
-
readonly oneOf: readonly [{
|
|
455
|
-
readonly type: "object";
|
|
456
|
-
readonly required: readonly ["kind", "source", "provider", "paramPattern"];
|
|
457
|
-
readonly additionalProperties: false;
|
|
458
|
-
readonly properties: {
|
|
459
|
-
readonly kind: {
|
|
460
|
-
readonly const: "strip-param";
|
|
461
|
-
};
|
|
462
|
-
readonly paramPattern: {
|
|
463
|
-
readonly type: "string";
|
|
464
|
-
};
|
|
465
|
-
readonly valuePattern: {
|
|
466
|
-
readonly type: "string";
|
|
467
|
-
};
|
|
468
|
-
readonly isReferralMarketing: {
|
|
469
|
-
readonly type: "boolean";
|
|
470
|
-
};
|
|
471
|
-
readonly source: {
|
|
472
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
473
|
-
};
|
|
474
|
-
readonly provider: {
|
|
475
|
-
readonly type: "string";
|
|
476
|
-
};
|
|
477
|
-
readonly urlPattern: {
|
|
478
|
-
readonly type: "string";
|
|
479
|
-
};
|
|
480
|
-
readonly exceptions: {
|
|
481
|
-
readonly type: "array";
|
|
482
|
-
readonly items: {
|
|
483
|
-
readonly type: "string";
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
|
-
};
|
|
487
|
-
}, {
|
|
488
|
-
readonly type: "object";
|
|
489
|
-
readonly required: readonly ["kind", "source", "provider", "pattern", "replacement"];
|
|
490
|
-
readonly additionalProperties: false;
|
|
491
|
-
readonly properties: {
|
|
492
|
-
readonly kind: {
|
|
493
|
-
readonly const: "raw-replace";
|
|
494
|
-
};
|
|
495
|
-
readonly pattern: {
|
|
496
|
-
readonly type: "string";
|
|
497
|
-
};
|
|
498
|
-
readonly replacement: {
|
|
499
|
-
readonly type: "string";
|
|
500
|
-
};
|
|
501
|
-
readonly source: {
|
|
502
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
503
|
-
};
|
|
504
|
-
readonly provider: {
|
|
505
|
-
readonly type: "string";
|
|
506
|
-
};
|
|
507
|
-
readonly urlPattern: {
|
|
508
|
-
readonly type: "string";
|
|
509
|
-
};
|
|
510
|
-
readonly exceptions: {
|
|
511
|
-
readonly type: "array";
|
|
512
|
-
readonly items: {
|
|
513
|
-
readonly type: "string";
|
|
514
|
-
};
|
|
515
|
-
};
|
|
516
|
-
};
|
|
517
|
-
}, {
|
|
518
|
-
readonly type: "object";
|
|
519
|
-
readonly required: readonly ["kind", "source", "provider", "pattern", "captureGroup"];
|
|
520
|
-
readonly additionalProperties: false;
|
|
521
|
-
readonly properties: {
|
|
522
|
-
readonly kind: {
|
|
523
|
-
readonly const: "unwrap-redirect";
|
|
524
|
-
};
|
|
525
|
-
readonly pattern: {
|
|
526
|
-
readonly type: "string";
|
|
527
|
-
};
|
|
528
|
-
readonly captureGroup: {
|
|
529
|
-
readonly type: "integer";
|
|
530
|
-
readonly minimum: 0;
|
|
531
|
-
};
|
|
532
|
-
readonly matchPart: {
|
|
533
|
-
readonly enum: readonly ["url", "pathname"];
|
|
534
|
-
};
|
|
535
|
-
readonly targetEncoding: {
|
|
536
|
-
readonly enum: readonly ["percent", "base64"];
|
|
537
|
-
};
|
|
538
|
-
readonly prependScheme: {
|
|
539
|
-
readonly enum: readonly ["http", "https"];
|
|
540
|
-
};
|
|
541
|
-
readonly targetTemplate: {
|
|
542
|
-
readonly type: "string";
|
|
543
|
-
};
|
|
544
|
-
readonly source: {
|
|
545
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
546
|
-
};
|
|
547
|
-
readonly provider: {
|
|
548
|
-
readonly type: "string";
|
|
549
|
-
};
|
|
550
|
-
readonly urlPattern: {
|
|
551
|
-
readonly type: "string";
|
|
552
|
-
};
|
|
553
|
-
readonly exceptions: {
|
|
554
|
-
readonly type: "array";
|
|
555
|
-
readonly items: {
|
|
556
|
-
readonly type: "string";
|
|
557
|
-
};
|
|
558
|
-
};
|
|
559
|
-
};
|
|
560
|
-
}, {
|
|
561
|
-
readonly type: "object";
|
|
562
|
-
readonly required: readonly ["kind", "source", "provider", "urlPattern"];
|
|
563
|
-
readonly additionalProperties: false;
|
|
564
|
-
readonly properties: {
|
|
565
|
-
readonly kind: {
|
|
566
|
-
readonly const: "block-domain";
|
|
567
|
-
};
|
|
568
|
-
readonly source: {
|
|
569
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
570
|
-
};
|
|
571
|
-
readonly provider: {
|
|
572
|
-
readonly type: "string";
|
|
573
|
-
};
|
|
574
|
-
readonly urlPattern: {
|
|
575
|
-
readonly type: "string";
|
|
576
|
-
};
|
|
577
|
-
readonly exceptions: {
|
|
578
|
-
readonly type: "array";
|
|
579
|
-
readonly items: {
|
|
580
|
-
readonly type: "string";
|
|
581
|
-
};
|
|
582
|
-
};
|
|
583
|
-
};
|
|
584
|
-
}];
|
|
585
|
-
};
|
|
341
|
+
readonly detail: {
|
|
342
|
+
readonly type: 'string';
|
|
586
343
|
};
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
}, {
|
|
349
|
+
readonly type: 'object';
|
|
350
|
+
readonly required: readonly ['kind', 'original', 'url', 'via'];
|
|
351
|
+
readonly additionalProperties: false;
|
|
352
|
+
readonly properties: {
|
|
353
|
+
readonly kind: {
|
|
354
|
+
readonly const: 'redirected';
|
|
355
|
+
};
|
|
356
|
+
readonly original: {
|
|
357
|
+
readonly type: 'string';
|
|
358
|
+
};
|
|
359
|
+
readonly url: {
|
|
360
|
+
readonly type: 'string';
|
|
361
|
+
};
|
|
362
|
+
readonly via: {
|
|
363
|
+
readonly type: 'object';
|
|
364
|
+
readonly required: readonly ['source', 'provider', 'kind'];
|
|
365
|
+
readonly additionalProperties: false;
|
|
366
|
+
readonly properties: {
|
|
367
|
+
readonly source: {
|
|
368
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
369
|
+
};
|
|
370
|
+
readonly provider: {
|
|
371
|
+
readonly type: 'string';
|
|
372
|
+
};
|
|
373
|
+
readonly kind: {
|
|
374
|
+
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
375
|
+
};
|
|
376
|
+
readonly detail: {
|
|
377
|
+
readonly type: 'string';
|
|
378
|
+
};
|
|
587
379
|
};
|
|
380
|
+
};
|
|
588
381
|
};
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
382
|
+
}, {
|
|
383
|
+
readonly type: 'object';
|
|
384
|
+
readonly required: readonly ['kind', 'original', 'via'];
|
|
385
|
+
readonly additionalProperties: false;
|
|
386
|
+
readonly properties: {
|
|
387
|
+
readonly kind: {
|
|
388
|
+
readonly const: 'blocked';
|
|
389
|
+
};
|
|
390
|
+
readonly original: {
|
|
391
|
+
readonly type: 'string';
|
|
392
|
+
};
|
|
393
|
+
readonly via: {
|
|
394
|
+
readonly type: 'object';
|
|
395
|
+
readonly required: readonly ['source', 'provider', 'kind'];
|
|
594
396
|
readonly additionalProperties: false;
|
|
595
397
|
readonly properties: {
|
|
596
|
-
|
|
597
|
-
|
|
398
|
+
readonly source: {
|
|
399
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
400
|
+
};
|
|
401
|
+
readonly provider: {
|
|
402
|
+
readonly type: 'string';
|
|
403
|
+
};
|
|
404
|
+
readonly kind: {
|
|
405
|
+
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
406
|
+
};
|
|
407
|
+
readonly detail: {
|
|
408
|
+
readonly type: 'string';
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
}];
|
|
414
|
+
};
|
|
415
|
+
export declare const urlSanitizeJsonSchemas: {
|
|
416
|
+
readonly catalog: {
|
|
417
|
+
readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
418
|
+
readonly $id: 'https://url-sanitize.dev/schema/v1/catalog.json';
|
|
419
|
+
readonly title: 'url-sanitize catalog';
|
|
420
|
+
readonly type: 'object';
|
|
421
|
+
readonly required: readonly ['version', 'generatedAt', 'sources', 'rules'];
|
|
422
|
+
readonly additionalProperties: false;
|
|
423
|
+
readonly properties: {
|
|
424
|
+
readonly version: {
|
|
425
|
+
readonly type: 'string';
|
|
426
|
+
};
|
|
427
|
+
readonly generatedAt: {
|
|
428
|
+
readonly type: 'string';
|
|
429
|
+
};
|
|
430
|
+
readonly sources: {
|
|
431
|
+
readonly type: 'array';
|
|
432
|
+
readonly items: {
|
|
433
|
+
readonly type: 'object';
|
|
434
|
+
readonly required: readonly ['name'];
|
|
435
|
+
readonly additionalProperties: false;
|
|
436
|
+
readonly properties: {
|
|
437
|
+
readonly name: {
|
|
438
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
439
|
+
};
|
|
440
|
+
readonly version: {
|
|
441
|
+
readonly type: 'string';
|
|
598
442
|
};
|
|
599
|
-
readonly
|
|
600
|
-
|
|
443
|
+
readonly hash: {
|
|
444
|
+
readonly type: 'string';
|
|
601
445
|
};
|
|
602
|
-
readonly
|
|
603
|
-
|
|
446
|
+
readonly license: {
|
|
447
|
+
readonly type: 'string';
|
|
604
448
|
};
|
|
449
|
+
readonly upstream: {
|
|
450
|
+
readonly type: 'string';
|
|
451
|
+
};
|
|
452
|
+
};
|
|
605
453
|
};
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
readonly
|
|
609
|
-
readonly
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
readonly
|
|
613
|
-
readonly required: readonly ["kind", "url"];
|
|
454
|
+
};
|
|
455
|
+
readonly rules: {
|
|
456
|
+
readonly type: 'array';
|
|
457
|
+
readonly items: {
|
|
458
|
+
readonly oneOf: readonly [{
|
|
459
|
+
readonly type: 'object';
|
|
460
|
+
readonly required: readonly ['kind', 'source', 'provider', 'paramPattern'];
|
|
614
461
|
readonly additionalProperties: false;
|
|
615
462
|
readonly properties: {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
463
|
+
readonly source: {
|
|
464
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
465
|
+
};
|
|
466
|
+
readonly provider: {
|
|
467
|
+
readonly type: 'string';
|
|
468
|
+
};
|
|
469
|
+
readonly urlPattern: {
|
|
470
|
+
readonly type: 'string';
|
|
471
|
+
};
|
|
472
|
+
readonly exceptions: {
|
|
473
|
+
readonly type: 'array';
|
|
474
|
+
readonly items: {
|
|
475
|
+
readonly type: 'string';
|
|
621
476
|
};
|
|
477
|
+
};
|
|
478
|
+
readonly kind: {
|
|
479
|
+
readonly const: 'strip-param';
|
|
480
|
+
};
|
|
481
|
+
readonly paramPattern: {
|
|
482
|
+
readonly type: 'string';
|
|
483
|
+
};
|
|
484
|
+
readonly valuePattern: {
|
|
485
|
+
readonly type: 'string';
|
|
486
|
+
};
|
|
487
|
+
readonly isReferralMarketing: {
|
|
488
|
+
readonly type: 'boolean';
|
|
489
|
+
};
|
|
622
490
|
};
|
|
623
|
-
|
|
624
|
-
readonly type:
|
|
625
|
-
readonly required: readonly [
|
|
491
|
+
}, {
|
|
492
|
+
readonly type: 'object';
|
|
493
|
+
readonly required: readonly ['kind', 'source', 'provider', 'pattern', 'replacement'];
|
|
626
494
|
readonly additionalProperties: false;
|
|
627
495
|
readonly properties: {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
};
|
|
642
|
-
};
|
|
643
|
-
readonly matchedRules: {
|
|
644
|
-
readonly type: "array";
|
|
645
|
-
readonly items: {
|
|
646
|
-
readonly type: "object";
|
|
647
|
-
readonly required: readonly ["source", "provider", "kind"];
|
|
648
|
-
readonly additionalProperties: false;
|
|
649
|
-
readonly properties: {
|
|
650
|
-
readonly source: {
|
|
651
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
652
|
-
};
|
|
653
|
-
readonly provider: {
|
|
654
|
-
readonly type: "string";
|
|
655
|
-
};
|
|
656
|
-
readonly kind: {
|
|
657
|
-
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
658
|
-
};
|
|
659
|
-
readonly detail: {
|
|
660
|
-
readonly type: "string";
|
|
661
|
-
};
|
|
662
|
-
};
|
|
663
|
-
};
|
|
496
|
+
readonly source: {
|
|
497
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
498
|
+
};
|
|
499
|
+
readonly provider: {
|
|
500
|
+
readonly type: 'string';
|
|
501
|
+
};
|
|
502
|
+
readonly urlPattern: {
|
|
503
|
+
readonly type: 'string';
|
|
504
|
+
};
|
|
505
|
+
readonly exceptions: {
|
|
506
|
+
readonly type: 'array';
|
|
507
|
+
readonly items: {
|
|
508
|
+
readonly type: 'string';
|
|
664
509
|
};
|
|
510
|
+
};
|
|
511
|
+
readonly kind: {
|
|
512
|
+
readonly const: 'raw-replace';
|
|
513
|
+
};
|
|
514
|
+
readonly pattern: {
|
|
515
|
+
readonly type: 'string';
|
|
516
|
+
};
|
|
517
|
+
readonly replacement: {
|
|
518
|
+
readonly type: 'string';
|
|
519
|
+
};
|
|
665
520
|
};
|
|
666
|
-
|
|
667
|
-
readonly type:
|
|
668
|
-
readonly required: readonly [
|
|
521
|
+
}, {
|
|
522
|
+
readonly type: 'object';
|
|
523
|
+
readonly required: readonly ['kind', 'source', 'provider', 'pattern', 'captureGroup'];
|
|
669
524
|
readonly additionalProperties: false;
|
|
670
525
|
readonly properties: {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
readonly properties: {
|
|
685
|
-
readonly source: {
|
|
686
|
-
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
687
|
-
};
|
|
688
|
-
readonly provider: {
|
|
689
|
-
readonly type: "string";
|
|
690
|
-
};
|
|
691
|
-
readonly kind: {
|
|
692
|
-
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
693
|
-
};
|
|
694
|
-
readonly detail: {
|
|
695
|
-
readonly type: "string";
|
|
696
|
-
};
|
|
697
|
-
};
|
|
526
|
+
readonly source: {
|
|
527
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
528
|
+
};
|
|
529
|
+
readonly provider: {
|
|
530
|
+
readonly type: 'string';
|
|
531
|
+
};
|
|
532
|
+
readonly urlPattern: {
|
|
533
|
+
readonly type: 'string';
|
|
534
|
+
};
|
|
535
|
+
readonly exceptions: {
|
|
536
|
+
readonly type: 'array';
|
|
537
|
+
readonly items: {
|
|
538
|
+
readonly type: 'string';
|
|
698
539
|
};
|
|
540
|
+
};
|
|
541
|
+
readonly kind: {
|
|
542
|
+
readonly const: 'unwrap-redirect';
|
|
543
|
+
};
|
|
544
|
+
readonly pattern: {
|
|
545
|
+
readonly type: 'string';
|
|
546
|
+
};
|
|
547
|
+
readonly captureGroup: {
|
|
548
|
+
readonly type: 'integer';
|
|
549
|
+
readonly minimum: 0;
|
|
550
|
+
};
|
|
551
|
+
readonly matchPart: {
|
|
552
|
+
readonly enum: readonly ["url", "pathname"];
|
|
553
|
+
};
|
|
554
|
+
readonly targetEncoding: {
|
|
555
|
+
readonly enum: readonly ["percent", "base64"];
|
|
556
|
+
};
|
|
557
|
+
readonly prependScheme: {
|
|
558
|
+
readonly enum: readonly ["http", "https"];
|
|
559
|
+
};
|
|
560
|
+
readonly targetTemplate: {
|
|
561
|
+
readonly type: 'string';
|
|
562
|
+
};
|
|
699
563
|
};
|
|
700
|
-
|
|
701
|
-
readonly type:
|
|
702
|
-
readonly required: readonly [
|
|
564
|
+
}, {
|
|
565
|
+
readonly type: 'object';
|
|
566
|
+
readonly required: readonly ['kind', 'source', 'provider', 'urlPattern'];
|
|
703
567
|
readonly additionalProperties: false;
|
|
704
568
|
readonly properties: {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
};
|
|
719
|
-
readonly provider: {
|
|
720
|
-
readonly type: "string";
|
|
721
|
-
};
|
|
722
|
-
readonly kind: {
|
|
723
|
-
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
724
|
-
};
|
|
725
|
-
readonly detail: {
|
|
726
|
-
readonly type: "string";
|
|
727
|
-
};
|
|
728
|
-
};
|
|
569
|
+
readonly source: {
|
|
570
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
571
|
+
};
|
|
572
|
+
readonly provider: {
|
|
573
|
+
readonly type: 'string';
|
|
574
|
+
};
|
|
575
|
+
readonly urlPattern: {
|
|
576
|
+
readonly type: 'string';
|
|
577
|
+
};
|
|
578
|
+
readonly exceptions: {
|
|
579
|
+
readonly type: 'array';
|
|
580
|
+
readonly items: {
|
|
581
|
+
readonly type: 'string';
|
|
729
582
|
};
|
|
583
|
+
};
|
|
584
|
+
readonly kind: {
|
|
585
|
+
readonly const: 'block-domain';
|
|
586
|
+
};
|
|
730
587
|
};
|
|
731
|
-
|
|
588
|
+
}];
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
readonly options: {
|
|
594
|
+
readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
595
|
+
readonly $id: 'https://url-sanitize.dev/schema/v1/options.json';
|
|
596
|
+
readonly title: 'url-sanitize options';
|
|
597
|
+
readonly type: 'object';
|
|
598
|
+
readonly additionalProperties: false;
|
|
599
|
+
readonly properties: {
|
|
600
|
+
readonly stripReferralMarketing: {
|
|
601
|
+
readonly type: 'boolean';
|
|
602
|
+
};
|
|
603
|
+
readonly unwrapRedirects: {
|
|
604
|
+
readonly type: 'boolean';
|
|
605
|
+
};
|
|
606
|
+
readonly domainBlocking: {
|
|
607
|
+
readonly type: 'boolean';
|
|
608
|
+
};
|
|
732
609
|
};
|
|
610
|
+
};
|
|
611
|
+
readonly result: {
|
|
612
|
+
readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
613
|
+
readonly $id: 'https://url-sanitize.dev/schema/v1/result.json';
|
|
614
|
+
readonly title: 'url-sanitize result';
|
|
615
|
+
readonly oneOf: readonly [{
|
|
616
|
+
readonly type: 'object';
|
|
617
|
+
readonly required: readonly ['kind', 'url'];
|
|
618
|
+
readonly additionalProperties: false;
|
|
619
|
+
readonly properties: {
|
|
620
|
+
readonly kind: {
|
|
621
|
+
readonly const: 'unchanged';
|
|
622
|
+
};
|
|
623
|
+
readonly url: {
|
|
624
|
+
readonly type: 'string';
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
}, {
|
|
628
|
+
readonly type: 'object';
|
|
629
|
+
readonly required: readonly ['kind', 'original', 'url', 'strippedParams', 'matchedRules'];
|
|
630
|
+
readonly additionalProperties: false;
|
|
631
|
+
readonly properties: {
|
|
632
|
+
readonly kind: {
|
|
633
|
+
readonly const: 'cleaned';
|
|
634
|
+
};
|
|
635
|
+
readonly original: {
|
|
636
|
+
readonly type: 'string';
|
|
637
|
+
};
|
|
638
|
+
readonly url: {
|
|
639
|
+
readonly type: 'string';
|
|
640
|
+
};
|
|
641
|
+
readonly strippedParams: {
|
|
642
|
+
readonly type: 'array';
|
|
643
|
+
readonly items: {
|
|
644
|
+
readonly type: 'string';
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
readonly matchedRules: {
|
|
648
|
+
readonly type: 'array';
|
|
649
|
+
readonly items: {
|
|
650
|
+
readonly type: 'object';
|
|
651
|
+
readonly required: readonly ['source', 'provider', 'kind'];
|
|
652
|
+
readonly additionalProperties: false;
|
|
653
|
+
readonly properties: {
|
|
654
|
+
readonly source: {
|
|
655
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
656
|
+
};
|
|
657
|
+
readonly provider: {
|
|
658
|
+
readonly type: 'string';
|
|
659
|
+
};
|
|
660
|
+
readonly kind: {
|
|
661
|
+
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
662
|
+
};
|
|
663
|
+
readonly detail: {
|
|
664
|
+
readonly type: 'string';
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
};
|
|
670
|
+
}, {
|
|
671
|
+
readonly type: 'object';
|
|
672
|
+
readonly required: readonly ['kind', 'original', 'url', 'via'];
|
|
673
|
+
readonly additionalProperties: false;
|
|
674
|
+
readonly properties: {
|
|
675
|
+
readonly kind: {
|
|
676
|
+
readonly const: 'redirected';
|
|
677
|
+
};
|
|
678
|
+
readonly original: {
|
|
679
|
+
readonly type: 'string';
|
|
680
|
+
};
|
|
681
|
+
readonly url: {
|
|
682
|
+
readonly type: 'string';
|
|
683
|
+
};
|
|
684
|
+
readonly via: {
|
|
685
|
+
readonly type: 'object';
|
|
686
|
+
readonly required: readonly ['source', 'provider', 'kind'];
|
|
687
|
+
readonly additionalProperties: false;
|
|
688
|
+
readonly properties: {
|
|
689
|
+
readonly source: {
|
|
690
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
691
|
+
};
|
|
692
|
+
readonly provider: {
|
|
693
|
+
readonly type: 'string';
|
|
694
|
+
};
|
|
695
|
+
readonly kind: {
|
|
696
|
+
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
697
|
+
};
|
|
698
|
+
readonly detail: {
|
|
699
|
+
readonly type: 'string';
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
};
|
|
703
|
+
};
|
|
704
|
+
}, {
|
|
705
|
+
readonly type: 'object';
|
|
706
|
+
readonly required: readonly ['kind', 'original', 'via'];
|
|
707
|
+
readonly additionalProperties: false;
|
|
708
|
+
readonly properties: {
|
|
709
|
+
readonly kind: {
|
|
710
|
+
readonly const: 'blocked';
|
|
711
|
+
};
|
|
712
|
+
readonly original: {
|
|
713
|
+
readonly type: 'string';
|
|
714
|
+
};
|
|
715
|
+
readonly via: {
|
|
716
|
+
readonly type: 'object';
|
|
717
|
+
readonly required: readonly ['source', 'provider', 'kind'];
|
|
718
|
+
readonly additionalProperties: false;
|
|
719
|
+
readonly properties: {
|
|
720
|
+
readonly source: {
|
|
721
|
+
readonly enum: readonly ["clearurls", "adguard", "brave", "firefox", "custom"];
|
|
722
|
+
};
|
|
723
|
+
readonly provider: {
|
|
724
|
+
readonly type: 'string';
|
|
725
|
+
};
|
|
726
|
+
readonly kind: {
|
|
727
|
+
readonly enum: readonly ["strip-param", "raw-replace", "unwrap-redirect", "block-domain"];
|
|
728
|
+
};
|
|
729
|
+
readonly detail: {
|
|
730
|
+
readonly type: 'string';
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
}];
|
|
736
|
+
};
|
|
733
737
|
};
|
|
734
|
-
|
|
735
|
-
export {
|
|
738
|
+
//#endregion
|
|
739
|
+
export type { MatchedRule, RedirectMatchPart, RedirectPrependScheme, RedirectTargetEncoding, RuleSource, SanitizeResult, Sanitizer, SanitizerCatalog, SanitizerOptions, SanitizerRule };
|