@xyo-network/url-safety-plugin 7.0.3 → 7.0.4
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/neutral/index.d.ts +1 -2
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +2 -115
- package/dist/neutral/index.mjs.map +4 -4
- package/package.json +72 -16
- package/dist/neutral/Plugin.d.ts +0 -3
- package/dist/neutral/Plugin.d.ts.map +0 -1
- package/dist/neutral/Witness/Config.d.ts +0 -15
- package/dist/neutral/Witness/Config.d.ts.map +0 -1
- package/dist/neutral/Witness/Params.d.ts +0 -11
- package/dist/neutral/Witness/Params.d.ts.map +0 -1
- package/dist/neutral/Witness/Witness.d.ts +0 -105
- package/dist/neutral/Witness/Witness.d.ts.map +0 -1
- package/dist/neutral/Witness/index.d.ts +0 -4
- package/dist/neutral/Witness/index.d.ts.map +0 -1
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,4CAA4C,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,116 +1,3 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
|
|
3
|
-
import { UrlSafetySchema as UrlSafetySchema3 } from "@xyo-network/url-safety-payload-plugin";
|
|
4
|
-
|
|
5
|
-
// src/Witness/Config.ts
|
|
6
|
-
import { asSchema } from "@xyo-network/sdk";
|
|
7
|
-
import { UrlSafetySchema } from "@xyo-network/url-safety-payload-plugin";
|
|
8
|
-
var UrlSafetyWitnessConfigSchema = asSchema(`${UrlSafetySchema}.witness.config`, true);
|
|
9
|
-
|
|
10
|
-
// src/Witness/Witness.ts
|
|
11
|
-
import {
|
|
12
|
-
FetchJsonClient,
|
|
13
|
-
zodAsFactory,
|
|
14
|
-
zodIsFactory,
|
|
15
|
-
zodToFactory
|
|
16
|
-
} from "@ariestools/sdk";
|
|
17
|
-
import {
|
|
18
|
-
asSchema as asSchema2,
|
|
19
|
-
PayloadZodOfSchema
|
|
20
|
-
} from "@xyo-network/sdk";
|
|
21
|
-
import { AbstractWitness } from "@xyo-network/sdk";
|
|
22
|
-
import { UrlSchema } from "@xyo-network/url-payload-plugin";
|
|
23
|
-
import { UrlSafetySchema as UrlSafetySchema2 } from "@xyo-network/url-safety-payload-plugin";
|
|
24
|
-
import * as z from "zod/mini";
|
|
25
|
-
var GoogleSafeBrowsingMatchSchema = asSchema2("com.google.safebrowsing.match", true);
|
|
26
|
-
var GoogleSafeBrowsingMatchZod = z.object({
|
|
27
|
-
cacheDuration: z.string(),
|
|
28
|
-
platformType: z.string(),
|
|
29
|
-
threat: z.object({ url: z.string() }),
|
|
30
|
-
threatEntryType: z.string(),
|
|
31
|
-
threatType: z.string()
|
|
32
|
-
});
|
|
33
|
-
var GoogleSafeBrowsingMatchPayloadZod = z.extend(PayloadZodOfSchema(GoogleSafeBrowsingMatchSchema), { ...GoogleSafeBrowsingMatchZod.shape });
|
|
34
|
-
var isGoogleSafeBrowsingMatchPayload = zodIsFactory(GoogleSafeBrowsingMatchPayloadZod);
|
|
35
|
-
var asGoogleSafeBrowsingMatchPayload = zodAsFactory(GoogleSafeBrowsingMatchPayloadZod, "asGoogleSafeBrowsingMatchPayload");
|
|
36
|
-
var toGoogleSafeBrowsingMatchPayload = zodToFactory(GoogleSafeBrowsingMatchPayloadZod, "toGoogleSafeBrowsingMatchPayload");
|
|
37
|
-
var checkUrlSafety = async (urls, config) => {
|
|
38
|
-
const client = new FetchJsonClient();
|
|
39
|
-
const endPoint = config?.endPoint ?? "https://safebrowsing.googleapis.com/v4/threatMatches:find";
|
|
40
|
-
const key = config?.key;
|
|
41
|
-
const mutatedUrls = urls.map((url) => url.replace("ipfs://", "https://cloudflare-ipfs.com/"));
|
|
42
|
-
if (mutatedUrls.length === 0) {
|
|
43
|
-
return [];
|
|
44
|
-
}
|
|
45
|
-
const postData = {
|
|
46
|
-
client: {
|
|
47
|
-
clientId: "foreventory",
|
|
48
|
-
clientVersion: "1.0"
|
|
49
|
-
},
|
|
50
|
-
threatInfo: {
|
|
51
|
-
platformTypes: ["WINDOWS", "LINUX", "OSX"],
|
|
52
|
-
threatEntries: mutatedUrls.map((url) => ({ url })),
|
|
53
|
-
threatEntryTypes: ["URL"],
|
|
54
|
-
threatTypes: ["SOCIAL_ENGINEERING", "POTENTIALLY_HARMFUL_APPLICATION", "UNWANTED_SOFTWARE", "THREAT_TYPE_UNSPECIFIED"]
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const response = await client.post(`${endPoint}?key=${key}`, postData, { headers: { referer: "http://localhost:3000" } });
|
|
58
|
-
const result = response.data;
|
|
59
|
-
return result?.matches?.map((match) => ({ ...match, schema: GoogleSafeBrowsingMatchSchema })) ?? [];
|
|
60
|
-
};
|
|
61
|
-
var UrlSafetyWitness = class extends AbstractWitness {
|
|
62
|
-
static configSchemas = [...super.configSchemas, UrlSafetyWitnessConfigSchema];
|
|
63
|
-
static defaultConfigSchema = UrlSafetyWitnessConfigSchema;
|
|
64
|
-
get key() {
|
|
65
|
-
return this.params.google?.safeBrowsing?.key;
|
|
66
|
-
}
|
|
67
|
-
get urls() {
|
|
68
|
-
return this.config?.urls;
|
|
69
|
-
}
|
|
70
|
-
async observeHandler(payloads = []) {
|
|
71
|
-
const urls = this.urls ?? payloads.filter((p) => p.schema === UrlSchema).map((p) => {
|
|
72
|
-
return p.url;
|
|
73
|
-
});
|
|
74
|
-
const matches = await checkUrlSafety(urls, { key: this.key });
|
|
75
|
-
return urls.map((url) => {
|
|
76
|
-
const payload = matches.reduce(
|
|
77
|
-
(prev, match) => {
|
|
78
|
-
if (match.threat.url === url) {
|
|
79
|
-
prev.threatTypes = prev.threatTypes ?? [];
|
|
80
|
-
if (!prev.threatTypes.includes(match.threatEntryType)) {
|
|
81
|
-
prev.threatTypes.push(match.threatEntryType);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return prev;
|
|
85
|
-
},
|
|
86
|
-
{ schema: UrlSafetySchema2, url }
|
|
87
|
-
);
|
|
88
|
-
payload.threatTypes = payload.threatTypes?.toSorted((a, b) => a.localeCompare(b));
|
|
89
|
-
return payload;
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
// src/Plugin.ts
|
|
95
|
-
var UrlSafetyPlugin = () => createPayloadSetWitnessPlugin(
|
|
96
|
-
{ required: { [UrlSafetySchema3]: 1 }, schema: PayloadSetSchema },
|
|
97
|
-
{
|
|
98
|
-
witness: async (params) => {
|
|
99
|
-
const result = await UrlSafetyWitness.create(params);
|
|
100
|
-
return result;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
export {
|
|
105
|
-
GoogleSafeBrowsingMatchPayloadZod,
|
|
106
|
-
GoogleSafeBrowsingMatchSchema,
|
|
107
|
-
GoogleSafeBrowsingMatchZod,
|
|
108
|
-
UrlSafetyPlugin,
|
|
109
|
-
UrlSafetyWitness,
|
|
110
|
-
UrlSafetyWitnessConfigSchema,
|
|
111
|
-
asGoogleSafeBrowsingMatchPayload,
|
|
112
|
-
UrlSafetyPlugin as default,
|
|
113
|
-
isGoogleSafeBrowsingMatchPayload,
|
|
114
|
-
toGoogleSafeBrowsingMatchPayload
|
|
115
|
-
};
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@xyo-network/payloadset-plugins/url-safety";
|
|
116
3
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Compatibility shim: this package re-exports from @xyo-network/payloadset-plugins/url-safety.\nexport * from '@xyo-network/payloadset-plugins/url-safety'\n"],
|
|
5
|
+
"mappings": ";AACA,cAAc;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/url-safety-plugin",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.4",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -31,12 +31,15 @@
|
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@xyo-network/
|
|
35
|
-
"@xyo-network/url-payload-plugin": "~7.0.3"
|
|
34
|
+
"@xyo-network/payloadset-plugins": "~7.0.4"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
|
-
"@ariestools/
|
|
39
|
-
"@ariestools/
|
|
37
|
+
"@ariestools/crypto": "~8.0.3",
|
|
38
|
+
"@ariestools/eth-address": "~8.0.3",
|
|
39
|
+
"@ariestools/sdk": "~8.0.3",
|
|
40
|
+
"@ariestools/threads": "~8.0.3",
|
|
41
|
+
"@ariestools/toolchain": "~8.6.12",
|
|
42
|
+
"@ariestools/tsconfig": "~8.6.12",
|
|
40
43
|
"@bitauth/libauth": "~3.0.0",
|
|
41
44
|
"@metamask/providers": "~22.1.1",
|
|
42
45
|
"@noble/post-quantum": "~0.6.1",
|
|
@@ -44,29 +47,54 @@
|
|
|
44
47
|
"@opentelemetry/sdk-trace-base": "~2.9.0",
|
|
45
48
|
"@scure/base": "~2.2.0",
|
|
46
49
|
"@scure/bip39": "~2.2.0",
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@xyo-network/
|
|
50
|
-
"@xyo-network/
|
|
50
|
+
"@uniswap/v3-sdk": "~3.31.0",
|
|
51
|
+
"@xyo-network/diviner-hash-lease": "~7.0.11",
|
|
52
|
+
"@xyo-network/diviner-indexing": "~7.0.11",
|
|
53
|
+
"@xyo-network/open-zeppelin-typechain": "~4.1.3",
|
|
54
|
+
"@xyo-network/sdk": "~7.0.11",
|
|
55
|
+
"@xyo-network/sdk-protocol": "~7.0.15",
|
|
56
|
+
"@xyo-network/uniswap-typechain": "~4.1.3",
|
|
57
|
+
"@xyo-network/witness-blockchain-abstract": "~7.0.11",
|
|
58
|
+
"@xyo-network/witness-evm-abstract": "~7.0.11",
|
|
59
|
+
"@xyo-network/witness-timestamp": "~7.0.11",
|
|
51
60
|
"ajv": "~8.20.0",
|
|
52
61
|
"async-mutex": "~0.5.0",
|
|
62
|
+
"base64-js": "~1.5.1",
|
|
63
|
+
"bowser": "~2.14.1",
|
|
64
|
+
"crypto-js": "~4.2.0",
|
|
53
65
|
"debug": "~4.4.3",
|
|
66
|
+
"es6-dynamic-template": "~2.0.0",
|
|
54
67
|
"eslint": "~10.6.0",
|
|
55
68
|
"eslint-import-resolver-typescript": "~4.4.5",
|
|
56
69
|
"ethers": "~6.17.0",
|
|
70
|
+
"file-type": "~22.0.1",
|
|
71
|
+
"fluent-ffmpeg": "~2.1.3",
|
|
72
|
+
"geotiff": "~3.0.5",
|
|
73
|
+
"gm": "~1.25.1",
|
|
74
|
+
"graphql": "~17.0.2",
|
|
75
|
+
"hasbin": "~1.2.3",
|
|
57
76
|
"hash-wasm": "~4.12.0",
|
|
58
77
|
"idb": "~8.0.3",
|
|
59
78
|
"lru-cache": "~11.5.1",
|
|
79
|
+
"node-screenlogic": "~2.1.1",
|
|
60
80
|
"observable-fns": "~0.6.1",
|
|
81
|
+
"parse-data-url": "~6.0.0",
|
|
82
|
+
"prom-client": "~15.1.3",
|
|
83
|
+
"regression": "~2.0.1",
|
|
84
|
+
"sha.js": "~2.4.12",
|
|
85
|
+
"svg-parser": "~2.0.4",
|
|
86
|
+
"systeminformation": "~5.31.14",
|
|
61
87
|
"typescript": "~6.0.3",
|
|
62
|
-
"
|
|
63
|
-
"vitest": "~4.1.9",
|
|
88
|
+
"uuid": "~14.0.1",
|
|
64
89
|
"webextension-polyfill": "~0.12.0",
|
|
90
|
+
"xml2js": "~0.6.2",
|
|
65
91
|
"zod": "~4.4.3"
|
|
66
92
|
},
|
|
67
93
|
"peerDependencies": {
|
|
68
|
-
"@ariestools/
|
|
69
|
-
"@ariestools/
|
|
94
|
+
"@ariestools/crypto": "^8.0.3",
|
|
95
|
+
"@ariestools/eth-address": "^8.0.3",
|
|
96
|
+
"@ariestools/sdk": "^8.0.3",
|
|
97
|
+
"@ariestools/threads": "^8.0.3",
|
|
70
98
|
"@bitauth/libauth": "^3.0.0",
|
|
71
99
|
"@metamask/providers": "^22.1.1",
|
|
72
100
|
"@noble/post-quantum": "^0.6.1",
|
|
@@ -74,17 +102,44 @@
|
|
|
74
102
|
"@opentelemetry/sdk-trace-base": "^2.9.0",
|
|
75
103
|
"@scure/base": "^2.2.0",
|
|
76
104
|
"@scure/bip39": "^2.2.0",
|
|
77
|
-
"@
|
|
78
|
-
"@xyo-network/
|
|
105
|
+
"@uniswap/v3-sdk": "^3.31.0",
|
|
106
|
+
"@xyo-network/diviner-hash-lease": "^7.0.11",
|
|
107
|
+
"@xyo-network/diviner-indexing": "^7.0.11",
|
|
108
|
+
"@xyo-network/open-zeppelin-typechain": "^4.1.3",
|
|
109
|
+
"@xyo-network/sdk": "^7.0.11",
|
|
110
|
+
"@xyo-network/sdk-protocol": "^7.0.15",
|
|
111
|
+
"@xyo-network/uniswap-typechain": "^4.1.3",
|
|
112
|
+
"@xyo-network/witness-blockchain-abstract": "^7.0.11",
|
|
113
|
+
"@xyo-network/witness-evm-abstract": "^7.0.11",
|
|
114
|
+
"@xyo-network/witness-timestamp": "^7.0.11",
|
|
79
115
|
"ajv": "^8.20.0",
|
|
80
116
|
"async-mutex": "^0.5.0",
|
|
117
|
+
"base64-js": "^1.5.1",
|
|
118
|
+
"bowser": "^2.14.1",
|
|
119
|
+
"crypto-js": "^4.2.0",
|
|
81
120
|
"debug": "^4.4.3",
|
|
121
|
+
"es6-dynamic-template": "^2.0.0",
|
|
82
122
|
"ethers": "^6.17.0",
|
|
123
|
+
"file-type": "^22.0.1",
|
|
124
|
+
"fluent-ffmpeg": "^2.1.3",
|
|
125
|
+
"geotiff": "^3.0.5",
|
|
126
|
+
"gm": "^1.25.1",
|
|
127
|
+
"graphql": "^17.0.2",
|
|
128
|
+
"hasbin": "^1.2.3",
|
|
83
129
|
"hash-wasm": "^4.12.0",
|
|
84
130
|
"idb": "^8.0.3",
|
|
85
131
|
"lru-cache": "^11.5.1",
|
|
132
|
+
"node-screenlogic": "^2.1.1",
|
|
86
133
|
"observable-fns": "^0.6.1",
|
|
134
|
+
"parse-data-url": "^6.0.0",
|
|
135
|
+
"prom-client": "^15.1.3",
|
|
136
|
+
"regression": "^2.0.1",
|
|
137
|
+
"sha.js": "^2.4.12",
|
|
138
|
+
"svg-parser": "^2.0.4",
|
|
139
|
+
"systeminformation": "^5.31.14",
|
|
140
|
+
"uuid": "^14.0.1",
|
|
87
141
|
"webextension-polyfill": "^0.12.0",
|
|
142
|
+
"xml2js": "^0.6.2",
|
|
88
143
|
"zod": "^4.4.3"
|
|
89
144
|
},
|
|
90
145
|
"engines": {
|
|
@@ -92,5 +147,6 @@
|
|
|
92
147
|
},
|
|
93
148
|
"publishConfig": {
|
|
94
149
|
"access": "public"
|
|
95
|
-
}
|
|
150
|
+
},
|
|
151
|
+
"deprecated": "Use @xyo-network/payloadset-plugins/url-safety instead. Replace @xyo-network/url-safety-plugin with @xyo-network/payloadset-plugins/url-safety. This package is a compatibility shim only and will not receive further updates."
|
|
96
152
|
}
|
package/dist/neutral/Plugin.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,eAAO,MAAM,eAAe,kIASzB,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { WitnessConfig } from '@xyo-network/sdk';
|
|
2
|
-
export declare const UrlSafetyWitnessConfigSchema: string & {
|
|
3
|
-
readonly __schema: true;
|
|
4
|
-
};
|
|
5
|
-
export type UrlSafetyWitnessConfigSchema = typeof UrlSafetyWitnessConfigSchema;
|
|
6
|
-
export type UrlSafetyWitnessConfig = WitnessConfig<{
|
|
7
|
-
google?: {
|
|
8
|
-
safeBrowsing?: {
|
|
9
|
-
endPoint?: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
schema: UrlSafetyWitnessConfigSchema;
|
|
13
|
-
urls?: string[];
|
|
14
|
-
}>;
|
|
15
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/Witness/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAIrD,eAAO,MAAM,4BAA4B;;CAAsD,CAAA;AAC/F,MAAM,MAAM,4BAA4B,GAAG,OAAO,4BAA4B,CAAA;AAE9E,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;IACjD,MAAM,CAAC,EAAE;QACP,YAAY,CAAC,EAAE;YACb,QAAQ,CAAC,EAAE,MAAM,CAAA;SAClB,CAAA;KACF,CAAA;IACD,MAAM,EAAE,4BAA4B,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB,CAAC,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AnyConfigSchema, WitnessParams } from '@xyo-network/sdk';
|
|
2
|
-
import type { UrlSafetyWitnessConfig } from './Config.ts';
|
|
3
|
-
export interface UrlSafetyWitnessParams extends WitnessParams<AnyConfigSchema<UrlSafetyWitnessConfig>> {
|
|
4
|
-
google?: {
|
|
5
|
-
safeBrowsing?: {
|
|
6
|
-
endPoint?: string;
|
|
7
|
-
key?: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=Params.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../../src/Witness/Params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEzD,MAAM,WAAW,sBAAuB,SAAQ,aAAa,CAC3D,eAAe,CAAC,sBAAsB,CAAC,CAAC;IACxC,MAAM,CAAC,EAAE;QACP,YAAY,CAAC,EAAE;YACb,QAAQ,CAAC,EAAE,MAAM,CAAA;YACjB,GAAG,CAAC,EAAE,MAAM,CAAA;SACb,CAAA;KACF,CAAA;CACF"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { type Schema } from '@xyo-network/sdk';
|
|
2
|
-
import { AbstractWitness } from '@xyo-network/sdk';
|
|
3
|
-
import type { UrlPayload } from '@xyo-network/url-payload-plugin';
|
|
4
|
-
import type { UrlSafetyPayload } from '@xyo-network/url-safety-payload-plugin';
|
|
5
|
-
import * as z from 'zod/mini';
|
|
6
|
-
import type { UrlSafetyWitnessParams } from './Params.ts';
|
|
7
|
-
export type GoogleSafeBrowsingMatchSchema = typeof GoogleSafeBrowsingMatchSchema;
|
|
8
|
-
export declare const GoogleSafeBrowsingMatchSchema: "com.google.safebrowsing.match" & {
|
|
9
|
-
readonly __schema: true;
|
|
10
|
-
};
|
|
11
|
-
export declare const GoogleSafeBrowsingMatchZod: z.ZodMiniObject<{
|
|
12
|
-
cacheDuration: z.ZodMiniString<string>;
|
|
13
|
-
platformType: z.ZodMiniString<string>;
|
|
14
|
-
threat: z.ZodMiniObject<{
|
|
15
|
-
url: z.ZodMiniString<string>;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
threatEntryType: z.ZodMiniString<string>;
|
|
18
|
-
threatType: z.ZodMiniString<string>;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
export type GoogleSafeBrowsingMatch = z.infer<typeof GoogleSafeBrowsingMatchZod>;
|
|
21
|
-
export declare const GoogleSafeBrowsingMatchPayloadZod: z.ZodMiniObject<{
|
|
22
|
-
schema: z.ZodMiniLiteral<"com.google.safebrowsing.match" & {
|
|
23
|
-
readonly __schema: true;
|
|
24
|
-
}>;
|
|
25
|
-
cacheDuration: z.ZodMiniString<string>;
|
|
26
|
-
platformType: z.ZodMiniString<string>;
|
|
27
|
-
threat: z.ZodMiniObject<{
|
|
28
|
-
url: z.ZodMiniString<string>;
|
|
29
|
-
}, z.core.$strip>;
|
|
30
|
-
threatEntryType: z.ZodMiniString<string>;
|
|
31
|
-
threatType: z.ZodMiniString<string>;
|
|
32
|
-
}, z.core.$strip>;
|
|
33
|
-
export type GoogleSafeBrowsingMatchPayload = z.infer<typeof GoogleSafeBrowsingMatchPayloadZod>;
|
|
34
|
-
export declare const isGoogleSafeBrowsingMatchPayload: <T>(value: T) => value is T & {
|
|
35
|
-
schema: "com.google.safebrowsing.match" & {
|
|
36
|
-
readonly __schema: true;
|
|
37
|
-
};
|
|
38
|
-
cacheDuration: string;
|
|
39
|
-
platformType: string;
|
|
40
|
-
threat: {
|
|
41
|
-
url: string;
|
|
42
|
-
};
|
|
43
|
-
threatEntryType: string;
|
|
44
|
-
threatType: string;
|
|
45
|
-
};
|
|
46
|
-
export declare const asGoogleSafeBrowsingMatchPayload: {
|
|
47
|
-
<T>(value: T): (T & {
|
|
48
|
-
schema: "com.google.safebrowsing.match" & {
|
|
49
|
-
readonly __schema: true;
|
|
50
|
-
};
|
|
51
|
-
cacheDuration: string;
|
|
52
|
-
platformType: string;
|
|
53
|
-
threat: {
|
|
54
|
-
url: string;
|
|
55
|
-
};
|
|
56
|
-
threatEntryType: string;
|
|
57
|
-
threatType: string;
|
|
58
|
-
}) | undefined;
|
|
59
|
-
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
60
|
-
schema: "com.google.safebrowsing.match" & {
|
|
61
|
-
readonly __schema: true;
|
|
62
|
-
};
|
|
63
|
-
cacheDuration: string;
|
|
64
|
-
platformType: string;
|
|
65
|
-
threat: {
|
|
66
|
-
url: string;
|
|
67
|
-
};
|
|
68
|
-
threatEntryType: string;
|
|
69
|
-
threatType: string;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
export declare const toGoogleSafeBrowsingMatchPayload: {
|
|
73
|
-
<T>(value: T): (T & {
|
|
74
|
-
schema: "com.google.safebrowsing.match" & {
|
|
75
|
-
readonly __schema: true;
|
|
76
|
-
};
|
|
77
|
-
cacheDuration: string;
|
|
78
|
-
platformType: string;
|
|
79
|
-
threat: {
|
|
80
|
-
url: string;
|
|
81
|
-
};
|
|
82
|
-
threatEntryType: string;
|
|
83
|
-
threatType: string;
|
|
84
|
-
}) | undefined;
|
|
85
|
-
<T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
|
|
86
|
-
schema: "com.google.safebrowsing.match" & {
|
|
87
|
-
readonly __schema: true;
|
|
88
|
-
};
|
|
89
|
-
cacheDuration: string;
|
|
90
|
-
platformType: string;
|
|
91
|
-
threat: {
|
|
92
|
-
url: string;
|
|
93
|
-
};
|
|
94
|
-
threatEntryType: string;
|
|
95
|
-
threatType: string;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
export declare class UrlSafetyWitness<TParams extends UrlSafetyWitnessParams = UrlSafetyWitnessParams> extends AbstractWitness<TParams> {
|
|
99
|
-
static readonly configSchemas: Schema[];
|
|
100
|
-
static readonly defaultConfigSchema: Schema;
|
|
101
|
-
get key(): string | undefined;
|
|
102
|
-
get urls(): string[] | undefined;
|
|
103
|
-
protected observeHandler(payloads?: UrlPayload[]): Promise<UrlSafetyPayload[]>;
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../../src/Witness/Witness.ts"],"names":[],"mappings":"AAIA,OAAO,EACyB,KAAK,MAAM,EAC1C,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,wCAAwC,CAAA;AAEnG,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAG7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEzD,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAChF,eAAO,MAAM,6BAA6B;;CAAkD,CAAA;AAE5F,eAAO,MAAM,0BAA0B;;;;;;;;iBAMrC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEhF,eAAO,MAAM,iCAAiC;;;;;;;;;;;iBAAuG,CAAA;AAErJ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAE9F,eAAO,MAAM,gCAAgC;;;;;;;;;;;CAAkD,CAAA;AAC/F,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;CAAsF,CAAA;AACnI,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;CAAsF,CAAA;AAqCnI,qBAAa,gBAAgB,CAAC,OAAO,SAAS,sBAAsB,GAAG,sBAAsB,CAAE,SAAQ,eAAe,CAAC,OAAO,CAAC;IAC7H,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAyD;IACzG,gBAAyB,mBAAmB,EAAE,MAAM,CAA+B;IAEnF,IAAI,GAAG,uBAEN;IAED,IAAI,IAAI,yBAEP;cAEwB,cAAc,CAAC,QAAQ,GAAE,UAAU,EAAO,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;CA4BlG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Witness/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|